react-semaphor 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/dist/react-semaphor.d.ts +534 -0
- package/dist/react-semaphor.js +51513 -0
- package/dist/react-semaphor.umd.cjs +505 -0
- package/dist/style.css +1 -0
- package/package.json +112 -0
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
(function(ct,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],m):(ct=typeof globalThis<"u"?globalThis:ct||self,m(ct["react-semaphor"]={},ct.React,ct.ReactDOM))})(this,function(ct,m,kt){"use strict";var _de=Object.defineProperty;var Sde=(ct,m,kt)=>m in ct?_de(ct,m,{enumerable:!0,configurable:!0,writable:!0,value:kt}):ct[m]=kt;var ke=(ct,m,kt)=>(Sde(ct,typeof m!="symbol"?m+"":m,kt),kt),z1=(ct,m,kt)=>{if(!m.has(ct))throw TypeError("Cannot "+kt)};var Z=(ct,m,kt)=>(z1(ct,m,"read from private field"),kt?kt.call(ct):m.get(ct)),ze=(ct,m,kt)=>{if(m.has(ct))throw TypeError("Cannot add the same private member more than once");m instanceof WeakSet?m.add(ct):m.set(ct,kt)},Ie=(ct,m,kt,Ms)=>(z1(ct,m,"write to private field"),Ms?Ms.call(ct,kt):m.set(ct,kt),kt);var Ug=(ct,m,kt,Ms)=>({set _(ue){Ie(ct,m,ue,kt)},get _(){return Z(ct,m,Ms)}}),xt=(ct,m,kt)=>(z1(ct,m,"access private method"),kt);var Oa,fs,Ql,_A,Zl,hs,Jl,SA,Pa,CA,ec,tc,ri,ps,ii,Mn,fd,ka,nc,Gg,Si,No,EA,Yi,OA,Ki,hd,zr,rc,Xi,ks,PA,oi,pd,Ma,kA,Sn,gs,ms,ic,oc,vs,sc,ac,MA,gr,Zt,gd,er,Da,lc,Qi,md,cc,uc,Ta,Aa,bs,dc,Ia,qd,vd,B1,bd,V1,yd,H1,xd,W1,wd,q1,_d,U1,Sd,G1,ig,n3,DA,og,Mx;function Ms(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 ue=Ms(m),r3=Ms(kt);var Ro=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Yg(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Kg={exports:{}},kc={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.development.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 Y1;function i3(){return Y1||(Y1=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),v=Symbol.iterator,y="@@iterator";function x(M){if(M===null||typeof M!="object")return null;var Y=v&&M[v]||M[y];return typeof Y=="function"?Y:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(M){{for(var Y=arguments.length,ae=new Array(Y>1?Y-1:0),Se=1;Se<Y;Se++)ae[Se-1]=arguments[Se];C("error",M,ae)}}function C(M,Y,ae){{var Se=w.ReactDebugCurrentFrame,Re=Se.getStackAddendum();Re!==""&&(Y+="%s",ae=ae.concat([Re]));var je=ae.map(function(Ae){return String(Ae)});je.unshift("Warning: "+Y),Function.prototype.apply.call(console[M],console,je)}}var P=!1,O=!1,k=!1,A=!1,L=!1,F;F=Symbol.for("react.module.reference");function z(M){return!!(typeof M=="string"||typeof M=="function"||M===r||M===o||L||M===i||M===c||M===d||A||M===p||P||O||k||typeof M=="object"&&M!==null&&(M.$$typeof===g||M.$$typeof===f||M.$$typeof===s||M.$$typeof===a||M.$$typeof===l||M.$$typeof===F||M.getModuleId!==void 0))}function B(M,Y,ae){var Se=M.displayName;if(Se)return Se;var Re=Y.displayName||Y.name||"";return Re!==""?ae+"("+Re+")":ae}function V(M){return M.displayName||"Context"}function X(M){if(M==null)return null;if(typeof M.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case d:return"SuspenseList"}if(typeof M=="object")switch(M.$$typeof){case a:var Y=M;return V(Y)+".Consumer";case s:var ae=M;return V(ae._context)+".Provider";case l:return B(M,M.render,"ForwardRef");case f:var Se=M.displayName||null;return Se!==null?Se:X(M.type)||"Memo";case g:{var Re=M,je=Re._payload,Ae=Re._init;try{return X(Ae(je))}catch{return null}}}return null}var K=Object.assign,$=0,J,G,q,se,D,W,re;function N(){}N.__reactDisabledLog=!0;function ne(){{if($===0){J=console.log,G=console.info,q=console.warn,se=console.error,D=console.group,W=console.groupCollapsed,re=console.groupEnd;var M={configurable:!0,enumerable:!0,value:N,writable:!0};Object.defineProperties(console,{info:M,log:M,warn:M,error:M,group:M,groupCollapsed:M,groupEnd:M})}$++}}function ge(){{if($--,$===0){var M={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:K({},M,{value:J}),info:K({},M,{value:G}),warn:K({},M,{value:q}),error:K({},M,{value:se}),group:K({},M,{value:D}),groupCollapsed:K({},M,{value:W}),groupEnd:K({},M,{value:re})})}$<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var he=w.ReactCurrentDispatcher,de;function ie(M,Y,ae){{if(de===void 0)try{throw Error()}catch(Re){var Se=Re.stack.trim().match(/\n( *(at )?)/);de=Se&&Se[1]||""}return`
|
|
10
|
+
`+de+M}}var ee=!1,H;{var ye=typeof WeakMap=="function"?WeakMap:Map;H=new ye}function oe(M,Y){if(!M||ee)return"";{var ae=H.get(M);if(ae!==void 0)return ae}var Se;ee=!0;var Re=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var je;je=he.current,he.current=null,ne();try{if(Y){var Ae=function(){throw Error()};if(Object.defineProperty(Ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ae,[])}catch(nn){Se=nn}Reflect.construct(M,[],Ae)}else{try{Ae.call()}catch(nn){Se=nn}M.call(Ae.prototype)}}else{try{throw Error()}catch(nn){Se=nn}M()}}catch(nn){if(nn&&Se&&typeof nn.stack=="string"){for(var Me=nn.stack.split(`
|
|
11
|
+
`),Pt=Se.stack.split(`
|
|
12
|
+
`),Ze=Me.length-1,nt=Pt.length-1;Ze>=1&&nt>=0&&Me[Ze]!==Pt[nt];)nt--;for(;Ze>=1&&nt>=0;Ze--,nt--)if(Me[Ze]!==Pt[nt]){if(Ze!==1||nt!==1)do if(Ze--,nt--,nt<0||Me[Ze]!==Pt[nt]){var zt=`
|
|
13
|
+
`+Me[Ze].replace(" at new "," at ");return M.displayName&&zt.includes("<anonymous>")&&(zt=zt.replace("<anonymous>",M.displayName)),typeof M=="function"&&H.set(M,zt),zt}while(Ze>=1&&nt>=0);break}}}finally{ee=!1,he.current=je,ge(),Error.prepareStackTrace=Re}var Tn=M?M.displayName||M.name:"",Ha=Tn?ie(Tn):"";return typeof M=="function"&&H.set(M,Ha),Ha}function Te(M,Y,ae){return oe(M,!1)}function Fe(M){var Y=M.prototype;return!!(Y&&Y.isReactComponent)}function He(M,Y,ae){if(M==null)return"";if(typeof M=="function")return oe(M,Fe(M));if(typeof M=="string")return ie(M);switch(M){case c:return ie("Suspense");case d:return ie("SuspenseList")}if(typeof M=="object")switch(M.$$typeof){case l:return Te(M.render);case f:return He(M.type,Y,ae);case g:{var Se=M,Re=Se._payload,je=Se._init;try{return He(je(Re),Y,ae)}catch{}}}return""}var Ke=Object.prototype.hasOwnProperty,St={},vt=w.ReactDebugCurrentFrame;function bt(M){if(M){var Y=M._owner,ae=He(M.type,M._source,Y?Y.type:null);vt.setExtraStackFrame(ae)}else vt.setExtraStackFrame(null)}function tn(M,Y,ae,Se,Re){{var je=Function.call.bind(Ke);for(var Ae in M)if(je(M,Ae)){var Me=void 0;try{if(typeof M[Ae]!="function"){var Pt=Error((Se||"React class")+": "+ae+" type `"+Ae+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof M[Ae]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Pt.name="Invariant Violation",Pt}Me=M[Ae](Y,Ae,Se,ae,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ze){Me=Ze}Me&&!(Me instanceof Error)&&(bt(Re),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Se||"React class",ae,Ae,typeof Me),bt(null)),Me instanceof Error&&!(Me.message in St)&&(St[Me.message]=!0,bt(Re),S("Failed %s type: %s",ae,Me.message),bt(null))}}}var Jt=Array.isArray;function Dn(M){return Jt(M)}function fn(M){{var Y=typeof Symbol=="function"&&Symbol.toStringTag,ae=Y&&M[Symbol.toStringTag]||M.constructor.name||"Object";return ae}}function Na(M){try{return fe(M),!1}catch{return!0}}function fe(M){return""+M}function Oe(M){if(Na(M))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",fn(M)),fe(M)}var Le=w.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},yt,hn,Cn;Cn={};function Fn(M){if(Ke.call(M,"ref")){var Y=Object.getOwnPropertyDescriptor(M,"ref").get;if(Y&&Y.isReactWarning)return!1}return M.ref!==void 0}function Br(M){if(Ke.call(M,"key")){var Y=Object.getOwnPropertyDescriptor(M,"key").get;if(Y&&Y.isReactWarning)return!1}return M.key!==void 0}function Vr(M,Y){if(typeof M.ref=="string"&&Le.current&&Y&&Le.current.stateNode!==Y){var ae=X(Le.current.type);Cn[ae]||(S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',X(Le.current.type),M.ref),Cn[ae]=!0)}}function pn(M,Y){{var ae=function(){yt||(yt=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Y))};ae.isReactWarning=!0,Object.defineProperty(M,"key",{get:ae,configurable:!0})}}function mr(M,Y){{var ae=function(){hn||(hn=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Y))};ae.isReactWarning=!0,Object.defineProperty(M,"ref",{get:ae,configurable:!0})}}var jn=function(M,Y,ae,Se,Re,je,Ae){var Me={$$typeof:t,type:M,key:Y,ref:ae,props:Ae,_owner:je};return Me._store={},Object.defineProperty(Me._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Me,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Se}),Object.defineProperty(Me,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Re}),Object.freeze&&(Object.freeze(Me.props),Object.freeze(Me)),Me};function Cd(M,Y,ae,Se,Re){{var je,Ae={},Me=null,Pt=null;ae!==void 0&&(Oe(ae),Me=""+ae),Br(Y)&&(Oe(Y.key),Me=""+Y.key),Fn(Y)&&(Pt=Y.ref,Vr(Y,Re));for(je in Y)Ke.call(Y,je)&&!Xe.hasOwnProperty(je)&&(Ae[je]=Y[je]);if(M&&M.defaultProps){var Ze=M.defaultProps;for(je in Ze)Ae[je]===void 0&&(Ae[je]=Ze[je])}if(Me||Pt){var nt=typeof M=="function"?M.displayName||M.name||"Unknown":M;Me&&pn(Ae,nt),Pt&&mr(Ae,nt)}return jn(M,Me,Pt,Re,Se,Le.current,Ae)}}var So=w.ReactCurrentOwner,Ra=w.ReactDebugCurrentFrame;function Yn(M){if(M){var Y=M._owner,ae=He(M.type,M._source,Y?Y.type:null);Ra.setExtraStackFrame(ae)}else Ra.setExtraStackFrame(null)}var Zi;Zi=!1;function Co(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function La(){{if(So.current){var M=X(So.current.type);if(M)return`
|
|
14
|
+
|
|
15
|
+
Check the render method of \``+M+"`."}return""}}function Ed(M){{if(M!==void 0){var Y=M.fileName.replace(/^.*[\\\/]/,""),ae=M.lineNumber;return`
|
|
16
|
+
|
|
17
|
+
Check your code at `+Y+":"+ae+"."}return""}}var $a={};function fc(M){{var Y=La();if(!Y){var ae=typeof M=="string"?M:M.displayName||M.name;ae&&(Y=`
|
|
18
|
+
|
|
19
|
+
Check the top-level render call using <`+ae+">.")}return Y}}function Fa(M,Y){{if(!M._store||M._store.validated||M.key!=null)return;M._store.validated=!0;var ae=fc(Y);if($a[ae])return;$a[ae]=!0;var Se="";M&&M._owner&&M._owner!==So.current&&(Se=" It was passed a child from "+X(M._owner.type)+"."),Yn(M),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ae,Se),Yn(null)}}function ja(M,Y){{if(typeof M!="object")return;if(Dn(M))for(var ae=0;ae<M.length;ae++){var Se=M[ae];Co(Se)&&Fa(Se,Y)}else if(Co(M))M._store&&(M._store.validated=!0);else if(M){var Re=x(M);if(typeof Re=="function"&&Re!==M.entries)for(var je=Re.call(M),Ae;!(Ae=je.next()).done;)Co(Ae.value)&&Fa(Ae.value,Y)}}}function Od(M){{var Y=M.type;if(Y==null||typeof Y=="string")return;var ae;if(typeof Y=="function")ae=Y.propTypes;else if(typeof Y=="object"&&(Y.$$typeof===l||Y.$$typeof===f))ae=Y.propTypes;else return;if(ae){var Se=X(Y);tn(ae,M.props,"prop",Se,M)}else if(Y.PropTypes!==void 0&&!Zi){Zi=!0;var Re=X(Y);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Re||"Unknown")}typeof Y.getDefaultProps=="function"&&!Y.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function za(M){{for(var Y=Object.keys(M.props),ae=0;ae<Y.length;ae++){var Se=Y[ae];if(Se!=="children"&&Se!=="key"){Yn(M),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Se),Yn(null);break}}M.ref!==null&&(Yn(M),S("Invalid attribute `ref` supplied to `React.Fragment`."),Yn(null))}}function Ba(M,Y,ae,Se,Re,je){{var Ae=z(M);if(!Ae){var Me="";(M===void 0||typeof M=="object"&&M!==null&&Object.keys(M).length===0)&&(Me+=" 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 Pt=Ed(Re);Pt?Me+=Pt:Me+=La();var Ze;M===null?Ze="null":Dn(M)?Ze="array":M!==void 0&&M.$$typeof===t?(Ze="<"+(X(M.type)||"Unknown")+" />",Me=" Did you accidentally export a JSX literal instead of a component?"):Ze=typeof M,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ze,Me)}var nt=Cd(M,Y,ae,Re,je);if(nt==null)return nt;if(Ae){var zt=Y.children;if(zt!==void 0)if(Se)if(Dn(zt)){for(var Tn=0;Tn<zt.length;Tn++)ja(zt[Tn],M);Object.freeze&&Object.freeze(zt)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ja(zt,M)}return M===r?za(nt):Od(nt),nt}}function Va(M,Y,ae){return Ba(M,Y,ae,!0)}function Pd(M,Y,ae){return Ba(M,Y,ae,!1)}var kd=Pd,Md=Va;kc.Fragment=r,kc.jsx=kd,kc.jsxs=Md}()),kc}var Mc={};/**
|
|
20
|
+
* @license React
|
|
21
|
+
* react-jsx-runtime.production.min.js
|
|
22
|
+
*
|
|
23
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the MIT license found in the
|
|
26
|
+
* LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/var K1;function o3(){if(K1)return Mc;K1=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var d,f={},g=null,p=null;c!==void 0&&(g=""+c),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(p=l.ref);for(d in l)r.call(l,d)&&!o.hasOwnProperty(d)&&(f[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)f[d]===void 0&&(f[d]=l[d]);return{$$typeof:t,type:a,key:g,ref:p,props:f,_owner:i.current}}return Mc.Fragment=n,Mc.jsx=s,Mc.jsxs=s,Mc}process.env.NODE_ENV==="production"?Kg.exports=o3():Kg.exports=i3();var _=Kg.exports;function X1(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=X1(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Ud(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=X1(e))&&(r&&(r+=" "),r+=t);return r}const s3=Object.freeze(Object.defineProperty({__proto__:null,clsx:Ud,default:Ud},Symbol.toStringTag,{value:"Module"})),Xg="-";function a3(e){const t=c3(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function i(s){const a=s.split(Xg);return a[0]===""&&a.length!==1&&a.shift(),Q1(a,t)||l3(s)}function o(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:i,getConflictingClassGroupIds:o}}function Q1(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Q1(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Xg);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId}const Z1=/^\[(.+)\]$/;function l3(e){if(Z1.test(e)){const t=Z1.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function c3(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return d3(Object.entries(e.classGroups),n).forEach(([o,s])=>{Qg(s,r,o,t)}),r}function Qg(e,t,n,r){e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:J1(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(u3(i)){Qg(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{Qg(s,J1(t,o),n,r)})})}function J1(e,t){let n=e;return t.split(Xg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function u3(e){return e.isThemeGetter}function d3(e,t){return t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[t+s,a])):o);return[n,i]}):e}function f3(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function i(o,s){n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}}const ew="!";function h3(e){const t=e.separator,n=t.length===1,r=t[0],i=t.length;return function(s){const a=[];let l=0,c=0,d;for(let y=0;y<s.length;y++){let x=s[y];if(l===0){if(x===r&&(n||s.slice(y,y+i)===t)){a.push(s.slice(c,y)),c=y+i;continue}if(x==="/"){d=y;continue}}x==="["?l++:x==="]"&&l--}const f=a.length===0?s:s.substring(c),g=f.startsWith(ew),p=g?f.substring(1):f,v=d&&d>c?d-c:void 0;return{modifiers:a,hasImportantModifier:g,baseClassName:p,maybePostfixModifierPosition:v}}}function p3(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}function g3(e){return{cache:f3(e.cacheSize),splitModifiers:h3(e),...a3(e)}}const m3=/\s+/;function v3(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=new Set;return e.trim().split(m3).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:d}=n(s);let f=r(d?c.substring(0,d):c),g=!!d;if(!f){if(!d)return{isTailwindClass:!1,originalClassName:s};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:s};g=!1}const p=p3(a).join(":");return{isTailwindClass:!0,modifierId:l?p+ew:p,classGroupId:f,originalClassName:s,hasPostfixModifier:g}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,d=a+l;return o.has(d)?!1:(o.add(d),i(l,c).forEach(f=>o.add(a+f)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function b3(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=tw(t))&&(r&&(r+=" "),r+=n);return r}function tw(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=tw(e[r]))&&(n&&(n+=" "),n+=t);return n}function y3(e,...t){let n,r,i,o=s;function s(l){const c=t.reduce((d,f)=>f(d),e());return n=g3(c),r=n.cache.get,i=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=v3(l,n);return i(l,d),d}return function(){return o(b3.apply(null,arguments))}}function Ut(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const nw=/^\[(?:([a-z-]+):)?(.+)\]$/i,x3=/^\d+\/\d+$/,w3=new Set(["px","full","screen"]),_3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,S3=/\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$/,C3=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,E3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function pi(e){return Ds(e)||w3.has(e)||x3.test(e)}function Lo(e){return Ja(e,"length",I3)}function Ds(e){return!!e&&!Number.isNaN(Number(e))}function Gd(e){return Ja(e,"number",Ds)}function Dc(e){return!!e&&Number.isInteger(Number(e))}function O3(e){return e.endsWith("%")&&Ds(e.slice(0,-1))}function ut(e){return nw.test(e)}function $o(e){return _3.test(e)}const P3=new Set(["length","size","percentage"]);function k3(e){return Ja(e,P3,rw)}function M3(e){return Ja(e,"position",rw)}const D3=new Set(["image","url"]);function T3(e){return Ja(e,D3,R3)}function A3(e){return Ja(e,"",N3)}function Tc(){return!0}function Ja(e,t,n){const r=nw.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function I3(e){return S3.test(e)}function rw(){return!1}function N3(e){return C3.test(e)}function R3(e){return E3.test(e)}function L3(){const e=Ut("colors"),t=Ut("spacing"),n=Ut("blur"),r=Ut("brightness"),i=Ut("borderColor"),o=Ut("borderRadius"),s=Ut("borderSpacing"),a=Ut("borderWidth"),l=Ut("contrast"),c=Ut("grayscale"),d=Ut("hueRotate"),f=Ut("invert"),g=Ut("gap"),p=Ut("gradientColorStops"),v=Ut("gradientColorStopPositions"),y=Ut("inset"),x=Ut("margin"),w=Ut("opacity"),S=Ut("padding"),C=Ut("saturate"),P=Ut("scale"),O=Ut("sepia"),k=Ut("skew"),A=Ut("space"),L=Ut("translate"),F=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",ut,t],V=()=>[ut,t],X=()=>["",pi,Lo],K=()=>["auto",Ds,ut],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],J=()=>["solid","dashed","dotted","double","none"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],q=()=>["start","end","center","between","around","evenly","stretch"],se=()=>["","0",ut],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>[Ds,Gd],re=()=>[Ds,ut];return{cacheSize:500,separator:":",theme:{colors:[Tc],spacing:[pi,Lo],blur:["none","",$o,ut],brightness:W(),borderColor:[e],borderRadius:["none","","full",$o,ut],borderSpacing:V(),borderWidth:X(),contrast:W(),grayscale:se(),hueRotate:re(),invert:se(),gap:V(),gradientColorStops:[e],gradientColorStopPositions:[O3,Lo],inset:B(),margin:B(),opacity:W(),padding:V(),saturate:W(),scale:W(),sepia:se(),skew:re(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",ut]}],container:["container"],columns:[{columns:[$o]}],"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"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),ut]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Dc,ut]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ut]}],grow:[{grow:se()}],shrink:[{shrink:se()}],order:[{order:["first","last","none",Dc,ut]}],"grid-cols":[{"grid-cols":[Tc]}],"col-start-end":[{col:["auto",{span:["full",Dc,ut]},ut]}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":[Tc]}],"row-start-end":[{row:["auto",{span:[Dc,ut]},ut]}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ut]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ut]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"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:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",ut,t]}],"min-w":[{"min-w":["min","max","fit",ut,pi]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[$o]},$o,ut]}],h:[{h:[ut,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",pi,ut]}],"max-h":[{"max-h":[ut,t,"min","max","fit"]}],"font-size":[{text:["base",$o,Lo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Gd]}],"font-family":[{font:[Tc]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ut]}],"line-clamp":[{"line-clamp":["none",Ds,Gd]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",pi,ut]}],"list-image":[{"list-image":["none",ut]}],"list-style-type":[{list:["none","disc","decimal",ut]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",pi,Lo]}],"underline-offset":[{"underline-offset":["auto",pi,ut]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ut]}],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",ut]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),M3]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",k3]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},T3]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...J(),"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":[w]}],"divide-style":[{divide:J()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...J()]}],"outline-offset":[{"outline-offset":[pi,ut]}],"outline-w":[{outline:[pi,Lo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[pi,Lo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$o,A3]}],"shadow-color":[{shadow:[Tc]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":G()}],"bg-blend":[{"bg-blend":G()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",$o,ut]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],sepia:[{sepia:[O]}],"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":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"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",ut]}],duration:[{duration:re()}],ease:[{ease:["linear","in","out","in-out",ut]}],delay:[{delay:re()}],animate:[{animate:["none","spin","ping","pulse","bounce",ut]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[Dc,ut]}],"translate-x":[{"translate-x":[L]}],"translate-y":[{"translate-y":[L]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ut]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],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",ut]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"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",ut]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[pi,Lo,Gd]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},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"],"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-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"]}}}const $3=y3(L3);class F3 extends Error{}F3.prototype.name="InvalidTokenError";function Pe(...e){return $3(Ud(e))}async function el(e,t,n={}){try{const r=new URLSearchParams(n).toString(),i=`${e}?${r}`,o=await fetch(i,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!o.ok){const a=await o.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${o.status}`)}return await o.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function Ts(e,t,n={}){try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(n)});return r.ok?await r.json():r.json().then(o=>{throw console.log(o.detail||"Unknown error occurred"),new Error((o==null?void 0:o.error)||`HTTP error! status: ${r.status}`)})}catch(r){throw console.error("Error during fetch:",r),r}}function j3(e){var t;if(navigator.clipboard&&e.current)navigator.clipboard.writeText(e.current.innerText).then(()=>console.log("Content copied to clipboard")).catch(n=>console.error("Failed to copy: ",n));else{const n=document.createElement("textarea");n.value=((t=e==null?void 0:e.current)==null?void 0:t.innerText)??"",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),console.log("Content copied to clipboard")}}var z3={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const iw=e=>{let t;const n=new Set,r=(l,c)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=c??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(g=>g(t,f))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(z3?"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()}};return t=e(r,i,a),a},B3=e=>e?iw(e):iw;var Zg={exports:{}},Jg={},Yd={exports:{}},em={};/**
|
|
28
|
+
* @license React
|
|
29
|
+
* use-sync-external-store-shim.development.js
|
|
30
|
+
*
|
|
31
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the MIT license found in the
|
|
34
|
+
* LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/var ow;function V3(){return ow||(ow=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=m,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(C){{for(var P=arguments.length,O=new Array(P>1?P-1:0),k=1;k<P;k++)O[k-1]=arguments[k];r("error",C,O)}}function r(C,P,O){{var k=t.ReactDebugCurrentFrame,A=k.getStackAddendum();A!==""&&(P+="%s",O=O.concat([A]));var L=O.map(function(F){return String(F)});L.unshift("Warning: "+P),Function.prototype.apply.call(console[C],console,L)}}function i(C,P){return C===P&&(C!==0||1/C===1/P)||C!==C&&P!==P}var o=typeof Object.is=="function"?Object.is:i,s=e.useState,a=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue,d=!1,f=!1;function g(C,P,O){d||e.startTransition!==void 0&&(d=!0,n("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 k=P();if(!f){var A=P();o(k,A)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var L=s({inst:{value:k,getSnapshot:P}}),F=L[0].inst,z=L[1];return l(function(){F.value=k,F.getSnapshot=P,p(F)&&z({inst:F})},[C,k,P]),a(function(){p(F)&&z({inst:F});var B=function(){p(F)&&z({inst:F})};return C(B)},[C]),c(k),k}function p(C){var P=C.getSnapshot,O=C.value;try{var k=P();return!o(O,k)}catch{return!0}}function v(C,P,O){return P()}var y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",x=!y,w=x?v:g,S=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w;em.useSyncExternalStore=S,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),em}var tm={};/**
|
|
36
|
+
* @license React
|
|
37
|
+
* use-sync-external-store-shim.production.min.js
|
|
38
|
+
*
|
|
39
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the MIT license found in the
|
|
42
|
+
* LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/var sw;function H3(){if(sw)return tm;sw=1;var e=m;function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(f,g){var p=g(),v=r({inst:{value:p,getSnapshot:g}}),y=v[0].inst,x=v[1];return o(function(){y.value=p,y.getSnapshot=g,l(y)&&x({inst:y})},[f,p,g]),i(function(){return l(y)&&x({inst:y}),f(function(){l(y)&&x({inst:y})})},[f]),s(p),p}function l(f){var g=f.getSnapshot;f=f.value;try{var p=g();return!n(f,p)}catch{return!0}}function c(f,g){return g()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return tm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,tm}var aw;function lw(){return aw||(aw=1,process.env.NODE_ENV==="production"?Yd.exports=H3():Yd.exports=V3()),Yd.exports}/**
|
|
44
|
+
* @license React
|
|
45
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
46
|
+
*
|
|
47
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the MIT license found in the
|
|
50
|
+
* LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/var cw;function W3(){return cw||(cw=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=m,t=lw();function n(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;function c(d,f,g,p,v){var y=o(null),x;y.current===null?(x={hasValue:!1,value:null},y.current=x):x=y.current;var w=a(function(){var O=!1,k,A,L=function(V){if(!O){O=!0,k=V;var X=p(V);if(v!==void 0&&x.hasValue){var K=x.value;if(v(K,X))return A=K,K}return A=X,X}var $=k,J=A;if(r($,V))return J;var G=p(V);return v!==void 0&&v(J,G)?J:(k=V,A=G,G)},F=g===void 0?null:g,z=function(){return L(f())},B=F===null?void 0:function(){return L(F())};return[z,B]},[f,g,p,v]),S=w[0],C=w[1],P=i(d,S,C);return s(function(){x.hasValue=!0,x.value=P},[P]),l(P),P}Jg.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Jg}var nm={};/**
|
|
52
|
+
* @license React
|
|
53
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
54
|
+
*
|
|
55
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the MIT license found in the
|
|
58
|
+
* LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/var uw;function q3(){if(uw)return nm;uw=1;var e=m,t=lw();function n(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return nm.useSyncExternalStoreWithSelector=function(c,d,f,g,p){var v=o(null);if(v.current===null){var y={hasValue:!1,value:null};v.current=y}else y=v.current;v=a(function(){function w(k){if(!S){if(S=!0,C=k,k=g(k),p!==void 0&&y.hasValue){var A=y.value;if(p(A,k))return P=A}return P=k}if(A=P,r(C,k))return A;var L=g(k);return p!==void 0&&p(A,L)?A:(C=k,P=L)}var S=!1,C,P,O=f===void 0?null:f;return[function(){return w(d())},O===null?void 0:function(){return w(O())}]},[d,f,g,p]);var x=i(c,v[0],v[1]);return s(function(){y.hasValue=!0,y.value=x},[x]),l(x),x},nm}process.env.NODE_ENV==="production"?Zg.exports=q3():Zg.exports=W3();var U3=Zg.exports;const G3=Pc(U3);var dw={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:Y3}=m,{useSyncExternalStoreWithSelector:K3}=G3;let fw=!1;function X3(e,t=e.getState,n){(dw?"production":void 0)!=="production"&&n&&!fw&&(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"),fw=!0);const r=K3(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return Y3(r),r}const hw=e=>{(dw?"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"?B3(e):e,n=(r,i)=>X3(t,r,i);return Object.assign(n,t),n},pw=e=>e?hw(e):hw;var gw=Symbol.for("immer-nothing"),mw=Symbol.for("immer-draftable"),wr=Symbol.for("immer-state"),Q3=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 ir(e,...t){if(process.env.NODE_ENV!=="production"){const n=Q3[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 tl=Object.getPrototypeOf;function nl(e){return!!e&&!!e[wr]}function As(e){var t;return e?vw(e)||Array.isArray(e)||!!e[mw]||!!((t=e.constructor)!=null&&t[mw])||Xd(e)||Qd(e):!1}var Z3=Object.prototype.constructor.toString();function vw(e){if(!e||typeof e!="object")return!1;const t=tl(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)===Z3}function Ac(e,t){Kd(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Kd(e){const t=e[wr];return t?t.type_:Array.isArray(e)?1:Xd(e)?2:Qd(e)?3:0}function rm(e,t){return Kd(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function bw(e,t,n){const r=Kd(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function J3(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Xd(e){return e instanceof Map}function Qd(e){return e instanceof Set}function Is(e){return e.copy_||e.base_}function im(e,t){if(Xd(e))return new Map(e);if(Qd(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&vw(e))return tl(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[wr];let r=Reflect.ownKeys(n);for(let i=0;i<r.length;i++){const o=r[i],s=n[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(tl(e),n)}function om(e,t=!1){return Zd(e)||nl(e)||!As(e)||(Kd(e)>1&&(e.set=e.add=e.clear=e.delete=eN),Object.freeze(e),t&&Ac(e,(n,r)=>om(r,!0))),e}function eN(){ir(2)}function Zd(e){return Object.isFrozen(e)}var tN={};function Ns(e){const t=tN[e];return t||ir(0,e),t}var Ic;function yw(){return Ic}function nN(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function xw(e,t){t&&(Ns("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function sm(e){am(e),e.drafts_.forEach(rN),e.drafts_=null}function am(e){e===Ic&&(Ic=e.parent_)}function ww(e){return Ic=nN(Ic,e)}function rN(e){const t=e[wr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function _w(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[wr].modified_&&(sm(t),ir(4)),As(e)&&(e=Jd(t,e),t.parent_||ef(t,e)),t.patches_&&Ns("Patches").generateReplacementPatches_(n[wr].base_,e,t.patches_,t.inversePatches_)):e=Jd(t,n,[]),sm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==gw?e:void 0}function Jd(e,t,n){if(Zd(t))return t;const r=t[wr];if(!r)return Ac(t,(i,o)=>Sw(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return ef(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,s=!1;r.type_===3&&(o=new Set(i),i.clear(),s=!0),Ac(o,(a,l)=>Sw(e,r,i,a,l,n,s)),ef(e,i,!1),n&&e.patches_&&Ns("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Sw(e,t,n,r,i,o,s){if(process.env.NODE_ENV!=="production"&&i===n&&ir(5),nl(i)){const a=o&&t&&t.type_!==3&&!rm(t.assigned_,r)?o.concat(r):void 0,l=Jd(e,i,a);if(bw(n,r,l),nl(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(As(i)&&!Zd(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Jd(e,i),(!t||!t.scope_.parent_)&&ef(e,i)}}function ef(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&om(t,n)}function iN(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:yw(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=lm;n&&(i=[r],o=Nc);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var lm={get(e,t){if(t===wr)return e;const n=Is(e);if(!rm(n,t))return oN(e,n,t);const r=n[t];return e.finalized_||!As(r)?r:r===cm(e.base_,t)?(dm(e),e.copy_[t]=fm(r,e)):r},has(e,t){return t in Is(e)},ownKeys(e){return Reflect.ownKeys(Is(e))},set(e,t,n){const r=Cw(Is(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=cm(Is(e),t),o=i==null?void 0:i[wr];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(J3(n,i)&&(n!==void 0||rm(e.base_,t)))return!0;dm(e),um(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 cm(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,dm(e),um(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Is(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ir(11)},getPrototypeOf(e){return tl(e.base_)},setPrototypeOf(){ir(12)}},Nc={};Ac(lm,(e,t)=>{Nc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Nc.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ir(13),Nc.set.call(this,e,t,void 0)},Nc.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ir(14),lm.set.call(this,e[0],t,n,e[0])};function cm(e,t){const n=e[wr];return(n?Is(n):e)[t]}function oN(e,t,n){var i;const r=Cw(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Cw(e,t){if(!(t in e))return;let n=tl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=tl(n)}}function um(e){e.modified_||(e.modified_=!0,e.parent_&&um(e.parent_))}function dm(e){e.copy_||(e.copy_=im(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var sN=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,d=>n.call(this,d,...c))}}typeof n!="function"&&ir(6),r!==void 0&&typeof r!="function"&&ir(7);let i;if(As(t)){const o=ww(this),s=fm(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?sm(o):am(o)}return xw(o,r),_w(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===gw&&(i=void 0),this.autoFreeze_&&om(i,!0),r){const o=[],s=[];Ns("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else ir(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){As(e)||ir(8),nl(e)&&(e=aN(e));const t=ww(this),n=fm(e,void 0);return n[wr].isManual_=!0,am(t),n}finishDraft(e,t){const n=e&&e[wr];(!n||!n.isManual_)&&ir(9);const{scope_:r}=n;return xw(r,t),_w(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Ns("Patches").applyPatches_;return nl(e)?r(e,t):this.produce(e,i=>r(i,t))}};function fm(e,t){const n=Xd(e)?Ns("MapSet").proxyMap_(e,t):Qd(e)?Ns("MapSet").proxySet_(e,t):iN(e,t);return(t?t.scope_:yw()).drafts_.push(n),n}function aN(e){return nl(e)||ir(10,e),Ew(e)}function Ew(e){if(!As(e)||Zd(e))return e;const t=e[wr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=im(e,t.scope_.immer_.useStrictShallowCopy_)}else n=im(e,!0);return Ac(n,(r,i)=>{bw(n,r,Ew(i))}),t&&(t.finalized_=!1),n}var _r=new sN,lN=_r.produce;_r.produceWithPatches.bind(_r),_r.setAutoFreeze.bind(_r),_r.setUseStrictShallowCopy.bind(_r),_r.applyPatches.bind(_r),_r.createDraft.bind(_r),_r.finishDraft.bind(_r);const Ow=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?lN(i):i;return t(a,o,...s)},e(r.setState,n,r));var tf,nf=kt;if(process.env.NODE_ENV==="production")tf=nf.createRoot,nf.hydrateRoot;else{var Pw=nf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;tf=function(e,t){Pw.usingClientEntryPoint=!0;try{return nf.createRoot(e,t)}finally{Pw.usingClientEntryPoint=!1}}}function kw(e,t,n){const r={count:0},i=a=>{const l=m.useRef(r.count);return m.useEffect(()=>{l.current+=1,l.current===r.count+1&&(l.current-=1,t.setState(a))}),null};if(i.displayName=`((${e})) devtool`,typeof document>"u")return;if(!n){let a=document.getElementById(`simple-zustand-devtools-${e}`);a||(a=document.createElement("div"),a.id=`simple-zustand-devtools-${e}`),document.body.appendChild(a),n=a}const o=tf(n),s=a=>{a&&(o.render(m.createElement(i,Object.assign({},a))),r.count+=1)};s(t.getState()),t.subscribe(s)}var Mw={},Dw={},hm={exports:{}},Gt=String,Tw=function(){return{isColorSupported:!1,reset:Gt,bold:Gt,dim:Gt,italic:Gt,underline:Gt,inverse:Gt,hidden:Gt,strikethrough:Gt,black:Gt,red:Gt,green:Gt,yellow:Gt,blue:Gt,magenta:Gt,cyan:Gt,white:Gt,gray:Gt,bgBlack:Gt,bgRed:Gt,bgGreen:Gt,bgYellow:Gt,bgBlue:Gt,bgMagenta:Gt,bgCyan:Gt,bgWhite:Gt}};hm.exports=Tw(),hm.exports.createColors=Tw;var cN=hm.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var d in c)Object.defineProperty(l,d,{enumerable:!0,get:c[d]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(cN);function r(l){return l&&l.__esModule?l:{default:l}}let i=new Set;function o(l,c,d){typeof process<"u"&&process.env.JEST_WORKER_ID||d&&i.has(d)||(d&&i.add(d),console.warn(""),c.forEach(f=>console.warn(l,"-",f)))}function s(l){return n.default.dim(l)}const a={info(l,c){o(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){o(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){o(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(Dw),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const t=n(Dw);function n(o){return o&&o.__esModule?o:{default:o}}function r({version:o,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${o}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const i={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}(Mw);let pm=Mw;var uN=(pm.__esModule?pm:{default:pm}).default;const an=Pc(uN),gm={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, sans-serif"},dataset:{backgroundColor:[an.violet[400],an.red[400],an.amber[400],an.orange[400],an.rose[400]],borderColor:[an.violet[400],an.red[400],an.amber[400],an.orange[400],an.rose[400]]},options:{plugins:{datalabels:{display:!1,color:dN},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4},legend:{position:"top",align:"center",maxHeight:0}},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:1,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[an.teal[100],an.purple[100],an.amber[100],an.orange[100],an.rose[100]],borderColor:[an.teal[400],an.purple[400],an.amber[400],an.orange[300],an.rose[400]]},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:an.slate[800]}},y:{grid:{display:!0,color:an.slate[800]}}}}}}};function dN(e){var r,i,o,s,a,l;const t=(a=(s=(o=(i=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:i._config)==null?void 0:o.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=Aw()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Aw()),fN(n)}function Aw(){return be.getState().theme==="dark"?"#000000":"#FFFFFF"}function fN(e){let t=0,n=0,r=0,i=0;const o=d=>{const f=d.replace("#",""),g=parseInt(f.substring(0,2),16),p=parseInt(f.substring(2,4),16),v=parseInt(f.substring(4,6),16);t+=g,n+=p,r+=v,i++};Array.isArray(e)?e.forEach(d=>{o(d)}):o(e);const s=t/i,a=n/i,l=r/i;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const be=pw()(Ow((e,t)=>({dashboard:{id:"",style:gm},selectedSheetId:null,selectedCardId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,isEditorSaveEvent:!1,actions:{setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setIsEditorSaveEvent:n=>{e(()=>({isEditorSaveEvent:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setDashboardTitle:n=>{e(r=>{r.dashboard&&(r.dashboard.title=n)})},setDashboardDescription:n=>{e(r=>{r.dashboard&&(r.dashboard.description=n)})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.title=r)})},setSheetDescription:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.description=r)})},setCards:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.cards=r)})},setCardTitle:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.title=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setCardSql:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.sql=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setCardData:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.data=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setCardDescription:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.description=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setSheetLayout:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layout=r)})},setShowFilters:n=>{e(()=>({showFilters:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1?r.filterValues.splice(i,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n);i>-1&&r.filterValues.splice(i,1)}})},addFilter:n=>{e(r=>{var i;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n]})},removeFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n);console.log("index",s),s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1))}})},updateFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n.id);s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addCard:(n,r)=>{e(i=>{var s,a,l,c,d;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){(l=o.cards)==null||l.push(r);const f={i:r.id,x:0,y:1/0,w:20,h:7,minW:10};(c=o.layout)==null||c.push(f),(d=i.onAddCard)==null||d.call(i,r,n)}})},updateCard:(n,r)=>{e(i=>{var a,l,c,d,f;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(g=>g.id===r.id);o&&((d=o.cards)==null||d.splice(s,1,r),(f=i.onUpdateCard)==null||f.call(i,r,n))})},removeCard:(n,r)=>{e(i=>{var a,l,c,d,f,g;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((d=o.cards)==null||d.splice(s,1),(f=o.layout)==null||f.splice(s,1),(g=i.onRemoveCard)==null||g.call(i,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(i=>{var s,a,l;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);o&&(((l=o.cards)==null?void 0:l.find(d=>d.id===r))?i.selectedCardId=r:i.selectedCardId=null)})},setSelectedCard:n=>{e(r=>{r.selectedCard=n})},setSelectedSheetId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(i=>i.id===t().selectedSheetId)},getSelectedCard:()=>{var r,i,o;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(s=>s.id===t().selectedSheetId);return(o=n==null?void 0:n.cards)==null?void 0:o.find(s=>s.id===t().selectedCardId)},getSelectedSheetCards:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.cards},getSelectedSheetLayout:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layout},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style}}})));process.env.NODE_ENV==="development"&&kw("DashboardStore",be);var Rc=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(){}},rl=typeof window>"u"||"Deno"in window;function Kr(){}function hN(e,t){return typeof e=="function"?e(t):e}function mm(e){return typeof e=="number"&&e>=0&&e!==1/0}function Iw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Nw(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==vm(s,t.options))return!1}else if(!$c(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||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Rw(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Lc(t.options.mutationKey)!==Lc(o))return!1}else if(!$c(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function vm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Lc)(e)}function Lc(e){return JSON.stringify(e,(t,n)=>ym(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function $c(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!$c(e[n],t[n])):!1}function Lw(e,t){if(e===t)return e;const n=$w(e)&&$w(t);if(n||ym(e)&&ym(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const d=n?c:o[c];!n&&e[d]===void 0&&t[d]===void 0&&r.includes(d)?(a[d]=void 0,l++):(a[d]=Lw(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function bm(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function $w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ym(e){if(!Fw(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Fw(n)||!n.hasOwnProperty("isPrototypeOf"))}function Fw(e){return Object.prototype.toString.call(e)==="[object Object]"}function pN(e){return new Promise(t=>{setTimeout(t,e)})}function xm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Lw(e,t):t}function gN(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function mN(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var vN=(_A=class extends Rc{constructor(){super();ze(this,Oa,void 0);ze(this,fs,void 0);ze(this,Ql,void 0);Ie(this,Ql,t=>{if(!rl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Z(this,fs)||this.setEventListener(Z(this,Ql))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,fs))==null||t.call(this),Ie(this,fs,void 0))}setEventListener(t){var n;Ie(this,Ql,t),(n=Z(this,fs))==null||n.call(this),Ie(this,fs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Z(this,Oa)!==t&&(Ie(this,Oa,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof Z(this,Oa)=="boolean"?Z(this,Oa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Oa=new WeakMap,fs=new WeakMap,Ql=new WeakMap,_A),rf=new vN,bN=(SA=class extends Rc{constructor(){super();ze(this,Zl,!0);ze(this,hs,void 0);ze(this,Jl,void 0);Ie(this,Jl,t=>{if(!rl&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Z(this,hs)||this.setEventListener(Z(this,Jl))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,hs))==null||t.call(this),Ie(this,hs,void 0))}setEventListener(t){var n;Ie(this,Jl,t),(n=Z(this,hs))==null||n.call(this),Ie(this,hs,t(this.setOnline.bind(this)))}setOnline(t){Z(this,Zl)!==t&&(Ie(this,Zl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Z(this,Zl)}},Zl=new WeakMap,hs=new WeakMap,Jl=new WeakMap,SA),of=new bN;function yN(e){return Math.min(1e3*2**e,3e4)}function sf(e){return(e??"online")==="online"?of.isOnline():!0}var jw=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wm(e){return e instanceof jw}function zw(e){let t=!1,n=0,r=!1,i,o,s;const a=new Promise((x,w)=>{o=x,s=w}),l=x=>{var w;r||(p(new jw(x)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},d=()=>{t=!1},f=()=>!rf.isFocused()||e.networkMode!=="always"&&!of.isOnline(),g=x=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,x),i==null||i(),o(x))},p=x=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,x),i==null||i(),s(x))},v=()=>new Promise(x=>{var w;i=S=>{const C=r||!f();return C&&x(S),C},(w=e.onPause)==null||w.call(e)}).then(()=>{var x;i=void 0,r||(x=e.onContinue)==null||x.call(e)}),y=()=>{if(r)return;let x;try{x=e.fn()}catch(w){x=Promise.reject(w)}Promise.resolve(x).then(g).catch(w=>{var k;if(r)return;const S=e.retry??(rl?0:3),C=e.retryDelay??yN,P=typeof C=="function"?C(n,w):C,O=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,w);if(t||!O){p(w);return}n++,(k=e.onFail)==null||k.call(e,n,w),pN(P).then(()=>{if(f())return v()}).then(()=>{t?p(w):y()})})};return sf(e.networkMode)?y():v().then(y),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:c,continueRetry:d}}function xN(){let e=[],t=0,n=g=>{g()},r=g=>{g()},i=g=>setTimeout(g,0);const o=g=>{i=g},s=g=>{let p;t++;try{p=g()}finally{t--,t||c()}return p},a=g=>{t?e.push(g):i(()=>{n(g)})},l=g=>(...p)=>{a(()=>{g(...p)})},c=()=>{const g=e;e=[],g.length&&i(()=>{r(()=>{g.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:g=>{n=g},setBatchNotifyFunction:g=>{r=g},setScheduler:o}}var In=xN(),Bw=(CA=class{constructor(){ze(this,Pa,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mm(this.gcTime)&&Ie(this,Pa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rl?1/0:5*60*1e3))}clearGcTimeout(){Z(this,Pa)&&(clearTimeout(Z(this,Pa)),Ie(this,Pa,void 0))}},Pa=new WeakMap,CA),wN=(EA=class extends Bw{constructor(t){super();ze(this,nc);ze(this,Si);ze(this,ec,void 0);ze(this,tc,void 0);ze(this,ri,void 0);ze(this,ps,void 0);ze(this,ii,void 0);ze(this,Mn,void 0);ze(this,fd,void 0);ze(this,ka,void 0);Ie(this,ka,!1),Ie(this,fd,t.defaultOptions),xt(this,nc,Gg).call(this,t.options),Ie(this,Mn,[]),Ie(this,ri,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ie(this,ec,t.state||_N(this.options)),this.state=Z(this,ec),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!Z(this,Mn).length&&this.state.fetchStatus==="idle"&&Z(this,ri).remove(this)}setData(t,n){const r=xm(this.state.data,t,this.options);return xt(this,Si,No).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){xt(this,Si,No).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=Z(this,ps);return(r=Z(this,ii))==null||r.cancel(t),n?n.then(Kr).catch(Kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Z(this,ec))}isActive(){return Z(this,Mn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||Z(this,Mn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Iw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=Z(this,Mn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,ii))==null||n.continue()}onOnline(){var n;const t=Z(this,Mn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,ii))==null||n.continue()}addObserver(t){Z(this,Mn).includes(t)||(Z(this,Mn).push(t),this.clearGcTimeout(),Z(this,ri).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){Z(this,Mn).includes(t)&&(Ie(this,Mn,Z(this,Mn).filter(n=>n!==t)),Z(this,Mn).length||(Z(this,ii)&&(Z(this,ka)?Z(this,ii).cancel({revert:!0}):Z(this,ii).cancelRetry()),this.scheduleGc()),Z(this,ri).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return Z(this,Mn).length}invalidate(){this.state.isInvalidated||xt(this,Si,No).call(this,{type:"invalidate"})}fetch(t,n){var c,d,f,g;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Z(this,ps))return(c=Z(this,ii))==null||c.continueRetry(),Z(this,ps)}if(t&&xt(this,nc,Gg).call(this,t),!this.options.queryFn){const p=Z(this,Mn).find(v=>v.options.queryFn);p&&xt(this,nc,Gg).call(this,p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,i={queryKey:this.queryKey,meta:this.meta},o=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Ie(this,ka,!0),r.signal)})};o(i);const s=()=>this.options.queryFn?(Ie(this,ka,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};o(a),(d=this.options.behavior)==null||d.onFetch(a,this),Ie(this,tc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&xt(this,Si,No).call(this,{type:"fetch",meta:(g=a.fetchOptions)==null?void 0:g.meta});const l=p=>{var v,y,x,w;wm(p)&&p.silent||xt(this,Si,No).call(this,{type:"error",error:p}),wm(p)||((y=(v=Z(this,ri).config).onError)==null||y.call(v,p,this),(w=(x=Z(this,ri).config).onSettled)==null||w.call(x,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ie(this,ii,zw({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var v,y,x,w;if(typeof p>"u"){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}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(p),(y=(v=Z(this,ri).config).onSuccess)==null||y.call(v,p,this),(w=(x=Z(this,ri).config).onSettled)==null||w.call(x,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,v)=>{xt(this,Si,No).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{xt(this,Si,No).call(this,{type:"pause"})},onContinue:()=>{xt(this,Si,No).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ie(this,ps,Z(this,ii).promise),Z(this,ps)}},ec=new WeakMap,tc=new WeakMap,ri=new WeakMap,ps=new WeakMap,ii=new WeakMap,Mn=new WeakMap,fd=new WeakMap,ka=new WeakMap,nc=new WeakSet,Gg=function(t){this.options={...Z(this,fd),...t},this.updateGcTime(this.options.gcTime)},Si=new WeakSet,No=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,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:sf(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return wm(i)&&i.revert&&Z(this,tc)?{...Z(this,tc),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),In.batch(()=>{Z(this,Mn).forEach(r=>{r.onQueryUpdate()}),Z(this,ri).notify({query:this,type:"updated",action:t})})},EA);function _N(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",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 SN=(OA=class extends Rc{constructor(t={}){super();ze(this,Yi,void 0);this.config=t,Ie(this,Yi,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??vm(i,n);let s=this.get(o);return s||(s=new wN({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){Z(this,Yi).has(t.queryHash)||(Z(this,Yi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Z(this,Yi).get(t.queryHash);n&&(t.destroy(),n===t&&Z(this,Yi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){In.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Z(this,Yi).get(t)}getAll(){return[...Z(this,Yi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Nw(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Nw(t,r)):n}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){In.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){In.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Yi=new WeakMap,OA),CN=(PA=class extends Bw{constructor(t){super();ze(this,Xi);ze(this,Ki,void 0);ze(this,hd,void 0);ze(this,zr,void 0);ze(this,rc,void 0);this.mutationId=t.mutationId,Ie(this,hd,t.defaultOptions),Ie(this,zr,t.mutationCache),Ie(this,Ki,[]),this.state=t.state||EN(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...Z(this,hd),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Z(this,Ki).includes(t)||(Z(this,Ki).push(t),this.clearGcTimeout(),Z(this,zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ie(this,Ki,Z(this,Ki).filter(n=>n!==t)),this.scheduleGc(),Z(this,zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Z(this,Ki).length||(this.state.status==="pending"?this.scheduleGc():Z(this,zr).remove(this))}continue(){var t;return((t=Z(this,rc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,c,d,f,g,p,v,y,x,w,S,C,P,O,k,A;const n=()=>(Ie(this,rc,zw({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(L,F)=>{xt(this,Xi,ks).call(this,{type:"failed",failureCount:L,error:F})},onPause:()=>{xt(this,Xi,ks).call(this,{type:"pause"})},onContinue:()=>{xt(this,Xi,ks).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),Z(this,rc).promise),r=this.state.status==="pending";try{if(!r){xt(this,Xi,ks).call(this,{type:"pending",variables:t}),await((o=(i=Z(this,zr).config).onMutate)==null?void 0:o.call(i,t,this));const F=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));F!==this.state.context&&xt(this,Xi,ks).call(this,{type:"pending",context:F,variables:t})}const L=await n();return await((c=(l=Z(this,zr).config).onSuccess)==null?void 0:c.call(l,L,t,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,L,t,this.state.context)),await((p=(g=Z(this,zr).config).onSettled)==null?void 0:p.call(g,L,null,this.state.variables,this.state.context,this)),await((y=(v=this.options).onSettled)==null?void 0:y.call(v,L,null,t,this.state.context)),xt(this,Xi,ks).call(this,{type:"success",data:L}),L}catch(L){try{throw await((w=(x=Z(this,zr).config).onError)==null?void 0:w.call(x,L,t,this.state.context,this)),await((C=(S=this.options).onError)==null?void 0:C.call(S,L,t,this.state.context)),await((O=(P=Z(this,zr).config).onSettled)==null?void 0:O.call(P,void 0,L,this.state.variables,this.state.context,this)),await((A=(k=this.options).onSettled)==null?void 0:A.call(k,void 0,L,t,this.state.context)),L}finally{xt(this,Xi,ks).call(this,{type:"error",error:L})}}}},Ki=new WeakMap,hd=new WeakMap,zr=new WeakMap,rc=new WeakMap,Xi=new WeakSet,ks=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:!sf(this.options.networkMode),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),In.batch(()=>{Z(this,Ki).forEach(r=>{r.onMutationUpdate(t)}),Z(this,zr).notify({mutation:this,type:"updated",action:t})})},PA);function EN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ON=(kA=class extends Rc{constructor(t={}){super();ze(this,oi,void 0);ze(this,pd,void 0);ze(this,Ma,void 0);this.config=t,Ie(this,oi,[]),Ie(this,pd,0)}build(t,n,r){const i=new CN({mutationCache:this,mutationId:++Ug(this,pd)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){Z(this,oi).push(t),this.notify({type:"added",mutation:t})}remove(t){Ie(this,oi,Z(this,oi).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){In.batch(()=>{Z(this,oi).forEach(t=>{this.remove(t)})})}getAll(){return Z(this,oi)}find(t){const n={exact:!0,...t};return Z(this,oi).find(r=>Rw(n,r))}findAll(t={}){return Z(this,oi).filter(n=>Rw(t,n))}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ie(this,Ma,(Z(this,Ma)??Promise.resolve()).then(()=>{const t=Z(this,oi).filter(n=>n.state.isPaused);return In.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Kr)),Promise.resolve()))}).then(()=>{Ie(this,Ma,void 0)})),Z(this,Ma)}},oi=new WeakMap,pd=new WeakMap,Ma=new WeakMap,kA);function PN(e){return{onFetch:(t,n)=>{const r=async()=>{var v,y,x,w,S;const i=t.options,o=(x=(y=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:y.fetchMore)==null?void 0:x.direction,s=((w=t.state.data)==null?void 0:w.pages)||[],a=((S=t.state.data)==null?void 0:S.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const d=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),g=async(C,P,O)=>{if(c)return Promise.reject();if(P==null&&C.pages.length)return Promise.resolve(C);const k={queryKey:t.queryKey,pageParam:P,direction:O?"backward":"forward",meta:t.options.meta};d(k);const A=await f(k),{maxPages:L}=t.options,F=O?mN:gN;return{pages:F(C.pages,A,L),pageParams:F(C.pageParams,P,L)}};let p;if(o&&s.length){const C=o==="backward",P=C?kN:Vw,O={pages:s,pageParams:a},k=P(i,O);p=await g(O,k,C)}else{p=await g(l,a[0]??i.initialPageParam);const C=e??s.length;for(let P=1;P<C;P++){const O=Vw(i,p);p=await g(p,O)}}return p};t.options.persister?t.fetchFn=()=>{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function Vw(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function kN(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var MN=(MA=class{constructor(e={}){ze(this,Sn,void 0);ze(this,gs,void 0);ze(this,ms,void 0);ze(this,ic,void 0);ze(this,oc,void 0);ze(this,vs,void 0);ze(this,sc,void 0);ze(this,ac,void 0);Ie(this,Sn,e.queryCache||new SN),Ie(this,gs,e.mutationCache||new ON),Ie(this,ms,e.defaultOptions||{}),Ie(this,ic,new Map),Ie(this,oc,new Map),Ie(this,vs,0)}mount(){Ug(this,vs)._++,Z(this,vs)===1&&(Ie(this,sc,rf.subscribe(()=>{rf.isFocused()&&(this.resumePausedMutations(),Z(this,Sn).onFocus())})),Ie(this,ac,of.subscribe(()=>{of.isOnline()&&(this.resumePausedMutations(),Z(this,Sn).onOnline())})))}unmount(){var e,t;Ug(this,vs)._--,Z(this,vs)===0&&((e=Z(this,sc))==null||e.call(this),Ie(this,sc,void 0),(t=Z(this,ac))==null||t.call(this),Ie(this,ac,void 0))}isFetching(e){return Z(this,Sn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Z(this,gs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=Z(this,Sn).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=Z(this,Sn).find({queryKey:e}),i=r==null?void 0:r.state.data,o=hN(t,i);if(typeof o>"u")return;const s=this.defaultQueryOptions({queryKey:e});return Z(this,Sn).build(this,s).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return In.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=Z(this,Sn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=Z(this,Sn);In.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Z(this,Sn),r={type:"active",...e};return In.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=In.batch(()=>Z(this,Sn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kr).catch(Kr)}invalidateQueries(e={},t={}){return In.batch(()=>{if(Z(this,Sn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=In.batch(()=>Z(this,Sn).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Kr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Kr)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=Z(this,Sn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kr).catch(Kr)}fetchInfiniteQuery(e){return e.behavior=PN(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kr).catch(Kr)}resumePausedMutations(){return Z(this,gs).resumePausedMutations()}getQueryCache(){return Z(this,Sn)}getMutationCache(){return Z(this,gs)}getDefaultOptions(){return Z(this,ms)}setDefaultOptions(e){Ie(this,ms,e)}setQueryDefaults(e,t){Z(this,ic).set(Lc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Z(this,ic).values()];let n={};return t.forEach(r=>{$c(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){Z(this,oc).set(Lc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Z(this,oc).values()];let n={};return t.forEach(r=>{$c(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...Z(this,ms).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=vm(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Z(this,ms).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Z(this,Sn).clear(),Z(this,gs).clear()}},Sn=new WeakMap,gs=new WeakMap,ms=new WeakMap,ic=new WeakMap,oc=new WeakMap,vs=new WeakMap,sc=new WeakMap,ac=new WeakMap,MA),DN=(DA=class extends Rc{constructor(t,n){super();ze(this,Ia);ze(this,vd);ze(this,bd);ze(this,yd);ze(this,xd);ze(this,wd);ze(this,_d);ze(this,Sd);ze(this,ig);ze(this,gr,void 0);ze(this,Zt,void 0);ze(this,gd,void 0);ze(this,er,void 0);ze(this,Da,void 0);ze(this,lc,void 0);ze(this,Qi,void 0);ze(this,md,void 0);ze(this,cc,void 0);ze(this,uc,void 0);ze(this,Ta,void 0);ze(this,Aa,void 0);ze(this,bs,void 0);ze(this,dc,new Set);this.options=n,Ie(this,gr,t),Ie(this,Qi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Z(this,Zt).addObserver(this),Hw(Z(this,Zt),this.options)?xt(this,Ia,qd).call(this):this.updateResult(),xt(this,xd,W1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _m(Z(this,Zt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _m(Z(this,Zt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,xt(this,wd,q1).call(this),xt(this,_d,U1).call(this),Z(this,Zt).removeObserver(this)}setOptions(t,n){const r=this.options,i=Z(this,Zt);if(this.options=Z(this,gr).defaultQueryOptions(t),bm(r,this.options)||Z(this,gr).getQueryCache().notify({type:"observerOptionsUpdated",query:Z(this,Zt),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),xt(this,Sd,G1).call(this);const o=this.hasListeners();o&&Ww(Z(this,Zt),i,this.options,r)&&xt(this,Ia,qd).call(this),this.updateResult(n),o&&(Z(this,Zt)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&xt(this,vd,B1).call(this);const s=xt(this,bd,V1).call(this);o&&(Z(this,Zt)!==i||this.options.enabled!==r.enabled||s!==Z(this,bs))&&xt(this,yd,H1).call(this,s)}getOptimisticResult(t){const n=Z(this,gr).getQueryCache().build(Z(this,gr),t),r=this.createResult(n,t);return AN(this,r)&&(Ie(this,er,r),Ie(this,lc,this.options),Ie(this,Da,Z(this,Zt).state)),r}getCurrentResult(){return Z(this,er)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(Z(this,dc).add(r),t[r])})}),n}getCurrentQuery(){return Z(this,Zt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Z(this,gr).defaultQueryOptions(t),r=Z(this,gr).getQueryCache().build(Z(this,gr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return xt(this,Ia,qd).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Z(this,er)))}createResult(t,n){var k;const r=Z(this,Zt),i=this.options,o=Z(this,er),s=Z(this,Da),a=Z(this,lc),c=t!==r?t.state:Z(this,gd),{state:d}=t;let{error:f,errorUpdatedAt:g,fetchStatus:p,status:v}=d,y=!1,x;if(n._optimisticResults){const A=this.hasListeners(),L=!A&&Hw(t,n),F=A&&Ww(t,r,n,i);(L||F)&&(p=sf(t.options.networkMode)?"fetching":"paused",d.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof d.data<"u")if(o&&d.data===(s==null?void 0:s.data)&&n.select===Z(this,md))x=Z(this,cc);else try{Ie(this,md,n.select),x=n.select(d.data),x=xm(o==null?void 0:o.data,x,n),Ie(this,cc,x),Ie(this,Qi,null)}catch(A){Ie(this,Qi,A)}else x=d.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let A;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))A=o.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((k=Z(this,uc))==null?void 0:k.state.data,Z(this,uc)):n.placeholderData,n.select&&typeof A<"u")try{A=n.select(A),Ie(this,Qi,null)}catch(L){Ie(this,Qi,L)}typeof A<"u"&&(v="success",x=xm(o==null?void 0:o.data,A,n),y=!0)}Z(this,Qi)&&(f=Z(this,Qi),x=Z(this,cc),g=Date.now(),v="error");const w=p==="fetching",S=v==="pending",C=v==="error",P=S&&w;return{status:v,fetchStatus:p,isPending:S,isSuccess:v==="success",isError:C,isInitialLoading:P,isLoading:P,data:x,dataUpdatedAt:d.dataUpdatedAt,error:f,errorUpdatedAt:g,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:w,isRefetching:w&&!S,isLoadingError:C&&d.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:y,isRefetchError:C&&d.dataUpdatedAt!==0,isStale:Sm(t,n),refetch:this.refetch}}updateResult(t){const n=Z(this,er),r=this.createResult(Z(this,Zt),this.options);if(Ie(this,Da,Z(this,Zt).state),Ie(this,lc,this.options),Z(this,Da).data!==void 0&&Ie(this,uc,Z(this,Zt)),bm(r,n))return;Ie(this,er,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!Z(this,dc).size)return!0;const l=new Set(a??Z(this,dc));return this.options.throwOnError&&l.add("error"),Object.keys(Z(this,er)).some(c=>{const d=c;return Z(this,er)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),xt(this,ig,n3).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&xt(this,xd,W1).call(this)}},gr=new WeakMap,Zt=new WeakMap,gd=new WeakMap,er=new WeakMap,Da=new WeakMap,lc=new WeakMap,Qi=new WeakMap,md=new WeakMap,cc=new WeakMap,uc=new WeakMap,Ta=new WeakMap,Aa=new WeakMap,bs=new WeakMap,dc=new WeakMap,Ia=new WeakSet,qd=function(t){xt(this,Sd,G1).call(this);let n=Z(this,Zt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Kr)),n},vd=new WeakSet,B1=function(){if(xt(this,wd,q1).call(this),rl||Z(this,er).isStale||!mm(this.options.staleTime))return;const n=Iw(Z(this,er).dataUpdatedAt,this.options.staleTime)+1;Ie(this,Ta,setTimeout(()=>{Z(this,er).isStale||this.updateResult()},n))},bd=new WeakSet,V1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Z(this,Zt)):this.options.refetchInterval)??!1},yd=new WeakSet,H1=function(t){xt(this,_d,U1).call(this),Ie(this,bs,t),!(rl||this.options.enabled===!1||!mm(Z(this,bs))||Z(this,bs)===0)&&Ie(this,Aa,setInterval(()=>{(this.options.refetchIntervalInBackground||rf.isFocused())&&xt(this,Ia,qd).call(this)},Z(this,bs)))},xd=new WeakSet,W1=function(){xt(this,vd,B1).call(this),xt(this,yd,H1).call(this,xt(this,bd,V1).call(this))},wd=new WeakSet,q1=function(){Z(this,Ta)&&(clearTimeout(Z(this,Ta)),Ie(this,Ta,void 0))},_d=new WeakSet,U1=function(){Z(this,Aa)&&(clearInterval(Z(this,Aa)),Ie(this,Aa,void 0))},Sd=new WeakSet,G1=function(){const t=Z(this,gr).getQueryCache().build(Z(this,gr),this.options);if(t===Z(this,Zt))return;const n=Z(this,Zt);Ie(this,Zt,t),Ie(this,gd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},ig=new WeakSet,n3=function(t){In.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Z(this,er))}),Z(this,gr).getQueryCache().notify({query:Z(this,Zt),type:"observerResultsUpdated"})})},DA);function TN(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Hw(e,t){return TN(e,t)||e.state.dataUpdatedAt>0&&_m(e,t,t.refetchOnMount)}function _m(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Sm(e,t)}return!1}function Ww(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Sm(e,n)}function Sm(e,t){return e.isStaleByTime(t.staleTime)}function AN(e,t){return!bm(e.getCurrentResult(),t)}var qw=ue.createContext(void 0),IN=e=>{const t=ue.useContext(qw);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},NN=({client:e,children:t})=>(ue.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ue.createElement(qw.Provider,{value:e},t)),Uw=ue.createContext(!1),RN=()=>ue.useContext(Uw);Uw.Provider;function LN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $N=ue.createContext(LN()),FN=()=>ue.useContext($N);function jN(e,t){return typeof e=="function"?e(...t):!!e}var zN=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},BN=e=>{ue.useEffect(()=>{e.clearReset()},[e])},VN=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&jN(n,[e.error,r]),HN=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},WN=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,qN=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function UN(e,t,n){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=IN(n),i=RN(),o=FN(),s=r.defaultQueryOptions(e);s._optimisticResults=i?"isRestoring":"optimistic",HN(s),zN(s,o),BN(o);const[a]=ue.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(ue.useSyncExternalStore(ue.useCallback(c=>{const d=i?()=>{}:a.subscribe(In.batchCalls(c));return a.updateResult(),d},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),ue.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),WN(s,l))throw qN(s,a,o);if(VN({result:l,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Sr(e,t){return UN(e,DN,t)}var af={exports:{}};/**
|
|
60
|
+
* @license
|
|
61
|
+
* Lodash <https://lodash.com/>
|
|
62
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
63
|
+
* Released under MIT license <https://lodash.com/license>
|
|
64
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
65
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
66
|
+
*/af.exports,function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,d="__lodash_placeholder__",f=1,g=2,p=4,v=1,y=2,x=1,w=2,S=4,C=8,P=16,O=32,k=64,A=128,L=256,F=512,z=30,B="...",V=800,X=16,K=1,$=2,J=3,G=1/0,q=9007199254740991,se=17976931348623157e292,D=NaN,W=4294967295,re=W-1,N=W>>>1,ne=[["ary",A],["bind",x],["bindKey",w],["curry",C],["curryRight",P],["flip",F],["partial",O],["partialRight",k],["rearg",L]],ge="[object Arguments]",he="[object Array]",de="[object AsyncFunction]",ie="[object Boolean]",ee="[object Date]",H="[object DOMException]",ye="[object Error]",oe="[object Function]",Te="[object GeneratorFunction]",Fe="[object Map]",He="[object Number]",Ke="[object Null]",St="[object Object]",vt="[object Promise]",bt="[object Proxy]",tn="[object RegExp]",Jt="[object Set]",Dn="[object String]",fn="[object Symbol]",Na="[object Undefined]",fe="[object WeakMap]",Oe="[object WeakSet]",Le="[object ArrayBuffer]",Xe="[object DataView]",yt="[object Float32Array]",hn="[object Float64Array]",Cn="[object Int8Array]",Fn="[object Int16Array]",Br="[object Int32Array]",Vr="[object Uint8Array]",pn="[object Uint8ClampedArray]",mr="[object Uint16Array]",jn="[object Uint32Array]",Cd=/\b__p \+= '';/g,So=/\b(__p \+=) '' \+/g,Ra=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Yn=/&(?:amp|lt|gt|quot|#39);/g,Zi=/[&<>"']/g,Co=RegExp(Yn.source),La=RegExp(Zi.source),Ed=/<%-([\s\S]+?)%>/g,$a=/<%([\s\S]+?)%>/g,fc=/<%=([\s\S]+?)%>/g,Fa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ja=/^\w*$/,Od=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,za=/[\\^$.*+?()[\]{}|]/g,Ba=RegExp(za.source),Va=/^\s+/,Pd=/\s/,kd=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Md=/\{\n\/\* \[wrapped with (.+)\] \*/,M=/,? & /,Y=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ae=/[()=,{}\[\]\/\s]/,Se=/\\(\\)?/g,Re=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,je=/\w*$/,Ae=/^[-+]0x[0-9a-f]+$/i,Me=/^0b[01]+$/i,Pt=/^\[object .+?Constructor\]$/,Ze=/^0o[0-7]+$/i,nt=/^(?:0|[1-9]\d*)$/,zt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tn=/($^)/,Ha=/['\n\r\u2028\u2029\\]/g,nn="\\ud800-\\udfff",gie="\\u0300-\\u036f",mie="\\ufe20-\\ufe2f",vie="\\u20d0-\\u20ff",TA=gie+mie+vie,AA="\\u2700-\\u27bf",IA="a-z\\xdf-\\xf6\\xf8-\\xff",bie="\\xac\\xb1\\xd7\\xf7",yie="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",xie="\\u2000-\\u206f",wie=" \\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",NA="A-Z\\xc0-\\xd6\\xd8-\\xde",RA="\\ufe0e\\ufe0f",LA=bie+yie+xie+wie,Dx="['’]",_ie="["+nn+"]",$A="["+LA+"]",sg="["+TA+"]",FA="\\d+",Sie="["+AA+"]",jA="["+IA+"]",zA="[^"+nn+LA+FA+AA+IA+NA+"]",Tx="\\ud83c[\\udffb-\\udfff]",Cie="(?:"+sg+"|"+Tx+")",BA="[^"+nn+"]",Ax="(?:\\ud83c[\\udde6-\\uddff]){2}",Ix="[\\ud800-\\udbff][\\udc00-\\udfff]",hc="["+NA+"]",VA="\\u200d",HA="(?:"+jA+"|"+zA+")",Eie="(?:"+hc+"|"+zA+")",WA="(?:"+Dx+"(?:d|ll|m|re|s|t|ve))?",qA="(?:"+Dx+"(?:D|LL|M|RE|S|T|VE))?",UA=Cie+"?",GA="["+RA+"]?",Oie="(?:"+VA+"(?:"+[BA,Ax,Ix].join("|")+")"+GA+UA+")*",Pie="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",kie="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",YA=GA+UA+Oie,Mie="(?:"+[Sie,Ax,Ix].join("|")+")"+YA,Die="(?:"+[BA+sg+"?",sg,Ax,Ix,_ie].join("|")+")",Tie=RegExp(Dx,"g"),Aie=RegExp(sg,"g"),Nx=RegExp(Tx+"(?="+Tx+")|"+Die+YA,"g"),Iie=RegExp([hc+"?"+jA+"+"+WA+"(?="+[$A,hc,"$"].join("|")+")",Eie+"+"+qA+"(?="+[$A,hc+HA,"$"].join("|")+")",hc+"?"+HA+"+"+WA,hc+"+"+qA,kie,Pie,FA,Mie].join("|"),"g"),Nie=RegExp("["+VA+nn+TA+RA+"]"),Rie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Lie=["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"],$ie=-1,en={};en[yt]=en[hn]=en[Cn]=en[Fn]=en[Br]=en[Vr]=en[pn]=en[mr]=en[jn]=!0,en[ge]=en[he]=en[Le]=en[ie]=en[Xe]=en[ee]=en[ye]=en[oe]=en[Fe]=en[He]=en[St]=en[tn]=en[Jt]=en[Dn]=en[fe]=!1;var qt={};qt[ge]=qt[he]=qt[Le]=qt[Xe]=qt[ie]=qt[ee]=qt[yt]=qt[hn]=qt[Cn]=qt[Fn]=qt[Br]=qt[Fe]=qt[He]=qt[St]=qt[tn]=qt[Jt]=qt[Dn]=qt[fn]=qt[Vr]=qt[pn]=qt[mr]=qt[jn]=!0,qt[ye]=qt[oe]=qt[fe]=!1;var Fie={À:"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"},jie={"&":"&","<":"<",">":">",'"':""","'":"'"},zie={"&":"&","<":"<",">":">",""":'"',"'":"'"},Bie={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Vie=parseFloat,Hie=parseInt,KA=typeof Ro=="object"&&Ro&&Ro.Object===Object&&Ro,Wie=typeof self=="object"&&self&&self.Object===Object&&self,zn=KA||Wie||Function("return this")(),Rx=t&&!t.nodeType&&t,Wa=Rx&&!0&&e&&!e.nodeType&&e,XA=Wa&&Wa.exports===Rx,Lx=XA&&KA.process,si=function(){try{var Q=Wa&&Wa.require&&Wa.require("util").types;return Q||Lx&&Lx.binding&&Lx.binding("util")}catch{}}(),QA=si&&si.isArrayBuffer,ZA=si&&si.isDate,JA=si&&si.isMap,e5=si&&si.isRegExp,t5=si&&si.isSet,n5=si&&si.isTypedArray;function Hr(Q,pe,ce){switch(ce.length){case 0:return Q.call(pe);case 1:return Q.call(pe,ce[0]);case 2:return Q.call(pe,ce[0],ce[1]);case 3:return Q.call(pe,ce[0],ce[1],ce[2])}return Q.apply(pe,ce)}function qie(Q,pe,ce,Ne){for(var Je=-1,Tt=Q==null?0:Q.length;++Je<Tt;){var En=Q[Je];pe(Ne,En,ce(En),Q)}return Ne}function ai(Q,pe){for(var ce=-1,Ne=Q==null?0:Q.length;++ce<Ne&&pe(Q[ce],ce,Q)!==!1;);return Q}function Uie(Q,pe){for(var ce=Q==null?0:Q.length;ce--&&pe(Q[ce],ce,Q)!==!1;);return Q}function r5(Q,pe){for(var ce=-1,Ne=Q==null?0:Q.length;++ce<Ne;)if(!pe(Q[ce],ce,Q))return!1;return!0}function ys(Q,pe){for(var ce=-1,Ne=Q==null?0:Q.length,Je=0,Tt=[];++ce<Ne;){var En=Q[ce];pe(En,ce,Q)&&(Tt[Je++]=En)}return Tt}function ag(Q,pe){var ce=Q==null?0:Q.length;return!!ce&&pc(Q,pe,0)>-1}function $x(Q,pe,ce){for(var Ne=-1,Je=Q==null?0:Q.length;++Ne<Je;)if(ce(pe,Q[Ne]))return!0;return!1}function rn(Q,pe){for(var ce=-1,Ne=Q==null?0:Q.length,Je=Array(Ne);++ce<Ne;)Je[ce]=pe(Q[ce],ce,Q);return Je}function xs(Q,pe){for(var ce=-1,Ne=pe.length,Je=Q.length;++ce<Ne;)Q[Je+ce]=pe[ce];return Q}function Fx(Q,pe,ce,Ne){var Je=-1,Tt=Q==null?0:Q.length;for(Ne&&Tt&&(ce=Q[++Je]);++Je<Tt;)ce=pe(ce,Q[Je],Je,Q);return ce}function Gie(Q,pe,ce,Ne){var Je=Q==null?0:Q.length;for(Ne&&Je&&(ce=Q[--Je]);Je--;)ce=pe(ce,Q[Je],Je,Q);return ce}function jx(Q,pe){for(var ce=-1,Ne=Q==null?0:Q.length;++ce<Ne;)if(pe(Q[ce],ce,Q))return!0;return!1}var Yie=zx("length");function Kie(Q){return Q.split("")}function Xie(Q){return Q.match(Y)||[]}function i5(Q,pe,ce){var Ne;return ce(Q,function(Je,Tt,En){if(pe(Je,Tt,En))return Ne=Tt,!1}),Ne}function lg(Q,pe,ce,Ne){for(var Je=Q.length,Tt=ce+(Ne?1:-1);Ne?Tt--:++Tt<Je;)if(pe(Q[Tt],Tt,Q))return Tt;return-1}function pc(Q,pe,ce){return pe===pe?loe(Q,pe,ce):lg(Q,o5,ce)}function Qie(Q,pe,ce,Ne){for(var Je=ce-1,Tt=Q.length;++Je<Tt;)if(Ne(Q[Je],pe))return Je;return-1}function o5(Q){return Q!==Q}function s5(Q,pe){var ce=Q==null?0:Q.length;return ce?Vx(Q,pe)/ce:D}function zx(Q){return function(pe){return pe==null?n:pe[Q]}}function Bx(Q){return function(pe){return Q==null?n:Q[pe]}}function a5(Q,pe,ce,Ne,Je){return Je(Q,function(Tt,En,Bt){ce=Ne?(Ne=!1,Tt):pe(ce,Tt,En,Bt)}),ce}function Zie(Q,pe){var ce=Q.length;for(Q.sort(pe);ce--;)Q[ce]=Q[ce].value;return Q}function Vx(Q,pe){for(var ce,Ne=-1,Je=Q.length;++Ne<Je;){var Tt=pe(Q[Ne]);Tt!==n&&(ce=ce===n?Tt:ce+Tt)}return ce}function Hx(Q,pe){for(var ce=-1,Ne=Array(Q);++ce<Q;)Ne[ce]=pe(ce);return Ne}function Jie(Q,pe){return rn(pe,function(ce){return[ce,Q[ce]]})}function l5(Q){return Q&&Q.slice(0,f5(Q)+1).replace(Va,"")}function Wr(Q){return function(pe){return Q(pe)}}function Wx(Q,pe){return rn(pe,function(ce){return Q[ce]})}function Dd(Q,pe){return Q.has(pe)}function c5(Q,pe){for(var ce=-1,Ne=Q.length;++ce<Ne&&pc(pe,Q[ce],0)>-1;);return ce}function u5(Q,pe){for(var ce=Q.length;ce--&&pc(pe,Q[ce],0)>-1;);return ce}function eoe(Q,pe){for(var ce=Q.length,Ne=0;ce--;)Q[ce]===pe&&++Ne;return Ne}var toe=Bx(Fie),noe=Bx(jie);function roe(Q){return"\\"+Bie[Q]}function ioe(Q,pe){return Q==null?n:Q[pe]}function gc(Q){return Nie.test(Q)}function ooe(Q){return Rie.test(Q)}function soe(Q){for(var pe,ce=[];!(pe=Q.next()).done;)ce.push(pe.value);return ce}function qx(Q){var pe=-1,ce=Array(Q.size);return Q.forEach(function(Ne,Je){ce[++pe]=[Je,Ne]}),ce}function d5(Q,pe){return function(ce){return Q(pe(ce))}}function ws(Q,pe){for(var ce=-1,Ne=Q.length,Je=0,Tt=[];++ce<Ne;){var En=Q[ce];(En===pe||En===d)&&(Q[ce]=d,Tt[Je++]=ce)}return Tt}function cg(Q){var pe=-1,ce=Array(Q.size);return Q.forEach(function(Ne){ce[++pe]=Ne}),ce}function aoe(Q){var pe=-1,ce=Array(Q.size);return Q.forEach(function(Ne){ce[++pe]=[Ne,Ne]}),ce}function loe(Q,pe,ce){for(var Ne=ce-1,Je=Q.length;++Ne<Je;)if(Q[Ne]===pe)return Ne;return-1}function coe(Q,pe,ce){for(var Ne=ce+1;Ne--;)if(Q[Ne]===pe)return Ne;return Ne}function mc(Q){return gc(Q)?doe(Q):Yie(Q)}function Ci(Q){return gc(Q)?foe(Q):Kie(Q)}function f5(Q){for(var pe=Q.length;pe--&&Pd.test(Q.charAt(pe)););return pe}var uoe=Bx(zie);function doe(Q){for(var pe=Nx.lastIndex=0;Nx.test(Q);)++pe;return pe}function foe(Q){return Q.match(Nx)||[]}function hoe(Q){return Q.match(Iie)||[]}var poe=function Q(pe){pe=pe==null?zn:vc.defaults(zn.Object(),pe,vc.pick(zn,Lie));var ce=pe.Array,Ne=pe.Date,Je=pe.Error,Tt=pe.Function,En=pe.Math,Bt=pe.Object,Ux=pe.RegExp,goe=pe.String,li=pe.TypeError,ug=ce.prototype,moe=Tt.prototype,bc=Bt.prototype,dg=pe["__core-js_shared__"],fg=moe.toString,Ft=bc.hasOwnProperty,voe=0,h5=function(){var u=/[^.]+$/.exec(dg&&dg.keys&&dg.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),hg=bc.toString,boe=fg.call(Bt),yoe=zn._,xoe=Ux("^"+fg.call(Ft).replace(za,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pg=XA?pe.Buffer:n,_s=pe.Symbol,gg=pe.Uint8Array,p5=pg?pg.allocUnsafe:n,mg=d5(Bt.getPrototypeOf,Bt),g5=Bt.create,m5=bc.propertyIsEnumerable,vg=ug.splice,v5=_s?_s.isConcatSpreadable:n,Td=_s?_s.iterator:n,qa=_s?_s.toStringTag:n,bg=function(){try{var u=Xa(Bt,"defineProperty");return u({},"",{}),u}catch{}}(),woe=pe.clearTimeout!==zn.clearTimeout&&pe.clearTimeout,_oe=Ne&&Ne.now!==zn.Date.now&&Ne.now,Soe=pe.setTimeout!==zn.setTimeout&&pe.setTimeout,yg=En.ceil,xg=En.floor,Gx=Bt.getOwnPropertySymbols,Coe=pg?pg.isBuffer:n,b5=pe.isFinite,Eoe=ug.join,Ooe=d5(Bt.keys,Bt),On=En.max,Kn=En.min,Poe=Ne.now,koe=pe.parseInt,y5=En.random,Moe=ug.reverse,Yx=Xa(pe,"DataView"),Ad=Xa(pe,"Map"),Kx=Xa(pe,"Promise"),yc=Xa(pe,"Set"),Id=Xa(pe,"WeakMap"),Nd=Xa(Bt,"create"),wg=Id&&new Id,xc={},Doe=Qa(Yx),Toe=Qa(Ad),Aoe=Qa(Kx),Ioe=Qa(yc),Noe=Qa(Id),_g=_s?_s.prototype:n,Rd=_g?_g.valueOf:n,x5=_g?_g.toString:n;function I(u){if(un(u)&&!rt(u)&&!(u instanceof Ct)){if(u instanceof ci)return u;if(Ft.call(u,"__wrapped__"))return wI(u)}return new ci(u)}var wc=function(){function u(){}return function(h){if(!sn(h))return{};if(g5)return g5(h);u.prototype=h;var b=new u;return u.prototype=n,b}}();function Sg(){}function ci(u,h){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=n}I.templateSettings={escape:Ed,evaluate:$a,interpolate:fc,variable:"",imports:{_:I}},I.prototype=Sg.prototype,I.prototype.constructor=I,ci.prototype=wc(Sg.prototype),ci.prototype.constructor=ci;function Ct(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=W,this.__views__=[]}function Roe(){var u=new Ct(this.__wrapped__);return u.__actions__=vr(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=vr(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=vr(this.__views__),u}function Loe(){if(this.__filtered__){var u=new Ct(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}function $oe(){var u=this.__wrapped__.value(),h=this.__dir__,b=rt(u),E=h<0,T=b?u.length:0,R=Kse(0,T,this.__views__),j=R.start,U=R.end,te=U-j,me=E?U:j-1,ve=this.__iteratees__,we=ve.length,De=0,$e=Kn(te,this.__takeCount__);if(!b||!E&&T==te&&$e==te)return W5(u,this.__actions__);var We=[];e:for(;te--&&De<$e;){me+=h;for(var ft=-1,qe=u[me];++ft<we;){var _t=ve[ft],Et=_t.iteratee,Gr=_t.type,rr=Et(qe);if(Gr==$)qe=rr;else if(!rr){if(Gr==K)continue e;break e}}We[De++]=qe}return We}Ct.prototype=wc(Sg.prototype),Ct.prototype.constructor=Ct;function Ua(u){var h=-1,b=u==null?0:u.length;for(this.clear();++h<b;){var E=u[h];this.set(E[0],E[1])}}function Foe(){this.__data__=Nd?Nd(null):{},this.size=0}function joe(u){var h=this.has(u)&&delete this.__data__[u];return this.size-=h?1:0,h}function zoe(u){var h=this.__data__;if(Nd){var b=h[u];return b===l?n:b}return Ft.call(h,u)?h[u]:n}function Boe(u){var h=this.__data__;return Nd?h[u]!==n:Ft.call(h,u)}function Voe(u,h){var b=this.__data__;return this.size+=this.has(u)?0:1,b[u]=Nd&&h===n?l:h,this}Ua.prototype.clear=Foe,Ua.prototype.delete=joe,Ua.prototype.get=zoe,Ua.prototype.has=Boe,Ua.prototype.set=Voe;function Eo(u){var h=-1,b=u==null?0:u.length;for(this.clear();++h<b;){var E=u[h];this.set(E[0],E[1])}}function Hoe(){this.__data__=[],this.size=0}function Woe(u){var h=this.__data__,b=Cg(h,u);if(b<0)return!1;var E=h.length-1;return b==E?h.pop():vg.call(h,b,1),--this.size,!0}function qoe(u){var h=this.__data__,b=Cg(h,u);return b<0?n:h[b][1]}function Uoe(u){return Cg(this.__data__,u)>-1}function Goe(u,h){var b=this.__data__,E=Cg(b,u);return E<0?(++this.size,b.push([u,h])):b[E][1]=h,this}Eo.prototype.clear=Hoe,Eo.prototype.delete=Woe,Eo.prototype.get=qoe,Eo.prototype.has=Uoe,Eo.prototype.set=Goe;function Oo(u){var h=-1,b=u==null?0:u.length;for(this.clear();++h<b;){var E=u[h];this.set(E[0],E[1])}}function Yoe(){this.size=0,this.__data__={hash:new Ua,map:new(Ad||Eo),string:new Ua}}function Koe(u){var h=Lg(this,u).delete(u);return this.size-=h?1:0,h}function Xoe(u){return Lg(this,u).get(u)}function Qoe(u){return Lg(this,u).has(u)}function Zoe(u,h){var b=Lg(this,u),E=b.size;return b.set(u,h),this.size+=b.size==E?0:1,this}Oo.prototype.clear=Yoe,Oo.prototype.delete=Koe,Oo.prototype.get=Xoe,Oo.prototype.has=Qoe,Oo.prototype.set=Zoe;function Ga(u){var h=-1,b=u==null?0:u.length;for(this.__data__=new Oo;++h<b;)this.add(u[h])}function Joe(u){return this.__data__.set(u,l),this}function ese(u){return this.__data__.has(u)}Ga.prototype.add=Ga.prototype.push=Joe,Ga.prototype.has=ese;function Ei(u){var h=this.__data__=new Eo(u);this.size=h.size}function tse(){this.__data__=new Eo,this.size=0}function nse(u){var h=this.__data__,b=h.delete(u);return this.size=h.size,b}function rse(u){return this.__data__.get(u)}function ise(u){return this.__data__.has(u)}function ose(u,h){var b=this.__data__;if(b instanceof Eo){var E=b.__data__;if(!Ad||E.length<i-1)return E.push([u,h]),this.size=++b.size,this;b=this.__data__=new Oo(E)}return b.set(u,h),this.size=b.size,this}Ei.prototype.clear=tse,Ei.prototype.delete=nse,Ei.prototype.get=rse,Ei.prototype.has=ise,Ei.prototype.set=ose;function w5(u,h){var b=rt(u),E=!b&&Za(u),T=!b&&!E&&Ps(u),R=!b&&!E&&!T&&Ec(u),j=b||E||T||R,U=j?Hx(u.length,goe):[],te=U.length;for(var me in u)(h||Ft.call(u,me))&&!(j&&(me=="length"||T&&(me=="offset"||me=="parent")||R&&(me=="buffer"||me=="byteLength"||me=="byteOffset")||Do(me,te)))&&U.push(me);return U}function _5(u){var h=u.length;return h?u[s1(0,h-1)]:n}function sse(u,h){return $g(vr(u),Ya(h,0,u.length))}function ase(u){return $g(vr(u))}function Xx(u,h,b){(b!==n&&!Oi(u[h],b)||b===n&&!(h in u))&&Po(u,h,b)}function Ld(u,h,b){var E=u[h];(!(Ft.call(u,h)&&Oi(E,b))||b===n&&!(h in u))&&Po(u,h,b)}function Cg(u,h){for(var b=u.length;b--;)if(Oi(u[b][0],h))return b;return-1}function lse(u,h,b,E){return Ss(u,function(T,R,j){h(E,T,b(T),j)}),E}function S5(u,h){return u&&eo(h,An(h),u)}function cse(u,h){return u&&eo(h,yr(h),u)}function Po(u,h,b){h=="__proto__"&&bg?bg(u,h,{configurable:!0,enumerable:!0,value:b,writable:!0}):u[h]=b}function Qx(u,h){for(var b=-1,E=h.length,T=ce(E),R=u==null;++b<E;)T[b]=R?n:T1(u,h[b]);return T}function Ya(u,h,b){return u===u&&(b!==n&&(u=u<=b?u:b),h!==n&&(u=u>=h?u:h)),u}function ui(u,h,b,E,T,R){var j,U=h&f,te=h&g,me=h&p;if(b&&(j=T?b(u,E,T,R):b(u)),j!==n)return j;if(!sn(u))return u;var ve=rt(u);if(ve){if(j=Qse(u),!U)return vr(u,j)}else{var we=Xn(u),De=we==oe||we==Te;if(Ps(u))return G5(u,U);if(we==St||we==ge||De&&!T){if(j=te||De?{}:fI(u),!U)return te?zse(u,cse(j,u)):jse(u,S5(j,u))}else{if(!qt[we])return T?u:{};j=Zse(u,we,U)}}R||(R=new Ei);var $e=R.get(u);if($e)return $e;R.set(u,j),BI(u)?u.forEach(function(qe){j.add(ui(qe,h,b,qe,u,R))}):jI(u)&&u.forEach(function(qe,_t){j.set(_t,ui(qe,h,b,_t,u,R))});var We=me?te?v1:m1:te?yr:An,ft=ve?n:We(u);return ai(ft||u,function(qe,_t){ft&&(_t=qe,qe=u[_t]),Ld(j,_t,ui(qe,h,b,_t,u,R))}),j}function use(u){var h=An(u);return function(b){return C5(b,u,h)}}function C5(u,h,b){var E=b.length;if(u==null)return!E;for(u=Bt(u);E--;){var T=b[E],R=h[T],j=u[T];if(j===n&&!(T in u)||!R(j))return!1}return!0}function E5(u,h,b){if(typeof u!="function")throw new li(s);return Hd(function(){u.apply(n,b)},h)}function $d(u,h,b,E){var T=-1,R=ag,j=!0,U=u.length,te=[],me=h.length;if(!U)return te;b&&(h=rn(h,Wr(b))),E?(R=$x,j=!1):h.length>=i&&(R=Dd,j=!1,h=new Ga(h));e:for(;++T<U;){var ve=u[T],we=b==null?ve:b(ve);if(ve=E||ve!==0?ve:0,j&&we===we){for(var De=me;De--;)if(h[De]===we)continue e;te.push(ve)}else R(h,we,E)||te.push(ve)}return te}var Ss=Z5(Ji),O5=Z5(Jx,!0);function dse(u,h){var b=!0;return Ss(u,function(E,T,R){return b=!!h(E,T,R),b}),b}function Eg(u,h,b){for(var E=-1,T=u.length;++E<T;){var R=u[E],j=h(R);if(j!=null&&(U===n?j===j&&!Ur(j):b(j,U)))var U=j,te=R}return te}function fse(u,h,b,E){var T=u.length;for(b=lt(b),b<0&&(b=-b>T?0:T+b),E=E===n||E>T?T:lt(E),E<0&&(E+=T),E=b>E?0:HI(E);b<E;)u[b++]=h;return u}function P5(u,h){var b=[];return Ss(u,function(E,T,R){h(E,T,R)&&b.push(E)}),b}function Bn(u,h,b,E,T){var R=-1,j=u.length;for(b||(b=eae),T||(T=[]);++R<j;){var U=u[R];h>0&&b(U)?h>1?Bn(U,h-1,b,E,T):xs(T,U):E||(T[T.length]=U)}return T}var Zx=J5(),k5=J5(!0);function Ji(u,h){return u&&Zx(u,h,An)}function Jx(u,h){return u&&k5(u,h,An)}function Og(u,h){return ys(h,function(b){return To(u[b])})}function Ka(u,h){h=Es(h,u);for(var b=0,E=h.length;u!=null&&b<E;)u=u[to(h[b++])];return b&&b==E?u:n}function M5(u,h,b){var E=h(u);return rt(u)?E:xs(E,b(u))}function tr(u){return u==null?u===n?Na:Ke:qa&&qa in Bt(u)?Yse(u):aae(u)}function e1(u,h){return u>h}function hse(u,h){return u!=null&&Ft.call(u,h)}function pse(u,h){return u!=null&&h in Bt(u)}function gse(u,h,b){return u>=Kn(h,b)&&u<On(h,b)}function t1(u,h,b){for(var E=b?$x:ag,T=u[0].length,R=u.length,j=R,U=ce(R),te=1/0,me=[];j--;){var ve=u[j];j&&h&&(ve=rn(ve,Wr(h))),te=Kn(ve.length,te),U[j]=!b&&(h||T>=120&&ve.length>=120)?new Ga(j&&ve):n}ve=u[0];var we=-1,De=U[0];e:for(;++we<T&&me.length<te;){var $e=ve[we],We=h?h($e):$e;if($e=b||$e!==0?$e:0,!(De?Dd(De,We):E(me,We,b))){for(j=R;--j;){var ft=U[j];if(!(ft?Dd(ft,We):E(u[j],We,b)))continue e}De&&De.push(We),me.push($e)}}return me}function mse(u,h,b,E){return Ji(u,function(T,R,j){h(E,b(T),R,j)}),E}function Fd(u,h,b){h=Es(h,u),u=mI(u,h);var E=u==null?u:u[to(fi(h))];return E==null?n:Hr(E,u,b)}function D5(u){return un(u)&&tr(u)==ge}function vse(u){return un(u)&&tr(u)==Le}function bse(u){return un(u)&&tr(u)==ee}function jd(u,h,b,E,T){return u===h?!0:u==null||h==null||!un(u)&&!un(h)?u!==u&&h!==h:yse(u,h,b,E,jd,T)}function yse(u,h,b,E,T,R){var j=rt(u),U=rt(h),te=j?he:Xn(u),me=U?he:Xn(h);te=te==ge?St:te,me=me==ge?St:me;var ve=te==St,we=me==St,De=te==me;if(De&&Ps(u)){if(!Ps(h))return!1;j=!0,ve=!1}if(De&&!ve)return R||(R=new Ei),j||Ec(u)?cI(u,h,b,E,T,R):Use(u,h,te,b,E,T,R);if(!(b&v)){var $e=ve&&Ft.call(u,"__wrapped__"),We=we&&Ft.call(h,"__wrapped__");if($e||We){var ft=$e?u.value():u,qe=We?h.value():h;return R||(R=new Ei),T(ft,qe,b,E,R)}}return De?(R||(R=new Ei),Gse(u,h,b,E,T,R)):!1}function xse(u){return un(u)&&Xn(u)==Fe}function n1(u,h,b,E){var T=b.length,R=T,j=!E;if(u==null)return!R;for(u=Bt(u);T--;){var U=b[T];if(j&&U[2]?U[1]!==u[U[0]]:!(U[0]in u))return!1}for(;++T<R;){U=b[T];var te=U[0],me=u[te],ve=U[1];if(j&&U[2]){if(me===n&&!(te in u))return!1}else{var we=new Ei;if(E)var De=E(me,ve,te,u,h,we);if(!(De===n?jd(ve,me,v|y,E,we):De))return!1}}return!0}function T5(u){if(!sn(u)||nae(u))return!1;var h=To(u)?xoe:Pt;return h.test(Qa(u))}function wse(u){return un(u)&&tr(u)==tn}function _se(u){return un(u)&&Xn(u)==Jt}function Sse(u){return un(u)&&Hg(u.length)&&!!en[tr(u)]}function A5(u){return typeof u=="function"?u:u==null?xr:typeof u=="object"?rt(u)?R5(u[0],u[1]):N5(u):e3(u)}function r1(u){if(!Vd(u))return Ooe(u);var h=[];for(var b in Bt(u))Ft.call(u,b)&&b!="constructor"&&h.push(b);return h}function Cse(u){if(!sn(u))return sae(u);var h=Vd(u),b=[];for(var E in u)E=="constructor"&&(h||!Ft.call(u,E))||b.push(E);return b}function i1(u,h){return u<h}function I5(u,h){var b=-1,E=br(u)?ce(u.length):[];return Ss(u,function(T,R,j){E[++b]=h(T,R,j)}),E}function N5(u){var h=y1(u);return h.length==1&&h[0][2]?pI(h[0][0],h[0][1]):function(b){return b===u||n1(b,u,h)}}function R5(u,h){return w1(u)&&hI(h)?pI(to(u),h):function(b){var E=T1(b,u);return E===n&&E===h?A1(b,u):jd(h,E,v|y)}}function Pg(u,h,b,E,T){u!==h&&Zx(h,function(R,j){if(T||(T=new Ei),sn(R))Ese(u,h,j,b,Pg,E,T);else{var U=E?E(S1(u,j),R,j+"",u,h,T):n;U===n&&(U=R),Xx(u,j,U)}},yr)}function Ese(u,h,b,E,T,R,j){var U=S1(u,b),te=S1(h,b),me=j.get(te);if(me){Xx(u,b,me);return}var ve=R?R(U,te,b+"",u,h,j):n,we=ve===n;if(we){var De=rt(te),$e=!De&&Ps(te),We=!De&&!$e&&Ec(te);ve=te,De||$e||We?rt(U)?ve=U:gn(U)?ve=vr(U):$e?(we=!1,ve=G5(te,!0)):We?(we=!1,ve=Y5(te,!0)):ve=[]:Wd(te)||Za(te)?(ve=U,Za(U)?ve=WI(U):(!sn(U)||To(U))&&(ve=fI(te))):we=!1}we&&(j.set(te,ve),T(ve,te,E,R,j),j.delete(te)),Xx(u,b,ve)}function L5(u,h){var b=u.length;if(b)return h+=h<0?b:0,Do(h,b)?u[h]:n}function $5(u,h,b){h.length?h=rn(h,function(R){return rt(R)?function(j){return Ka(j,R.length===1?R[0]:R)}:R}):h=[xr];var E=-1;h=rn(h,Wr(Ve()));var T=I5(u,function(R,j,U){var te=rn(h,function(me){return me(R)});return{criteria:te,index:++E,value:R}});return Zie(T,function(R,j){return Fse(R,j,b)})}function Ose(u,h){return F5(u,h,function(b,E){return A1(u,E)})}function F5(u,h,b){for(var E=-1,T=h.length,R={};++E<T;){var j=h[E],U=Ka(u,j);b(U,j)&&zd(R,Es(j,u),U)}return R}function Pse(u){return function(h){return Ka(h,u)}}function o1(u,h,b,E){var T=E?Qie:pc,R=-1,j=h.length,U=u;for(u===h&&(h=vr(h)),b&&(U=rn(u,Wr(b)));++R<j;)for(var te=0,me=h[R],ve=b?b(me):me;(te=T(U,ve,te,E))>-1;)U!==u&&vg.call(U,te,1),vg.call(u,te,1);return u}function j5(u,h){for(var b=u?h.length:0,E=b-1;b--;){var T=h[b];if(b==E||T!==R){var R=T;Do(T)?vg.call(u,T,1):c1(u,T)}}return u}function s1(u,h){return u+xg(y5()*(h-u+1))}function kse(u,h,b,E){for(var T=-1,R=On(yg((h-u)/(b||1)),0),j=ce(R);R--;)j[E?R:++T]=u,u+=b;return j}function a1(u,h){var b="";if(!u||h<1||h>q)return b;do h%2&&(b+=u),h=xg(h/2),h&&(u+=u);while(h);return b}function ht(u,h){return C1(gI(u,h,xr),u+"")}function Mse(u){return _5(Oc(u))}function Dse(u,h){var b=Oc(u);return $g(b,Ya(h,0,b.length))}function zd(u,h,b,E){if(!sn(u))return u;h=Es(h,u);for(var T=-1,R=h.length,j=R-1,U=u;U!=null&&++T<R;){var te=to(h[T]),me=b;if(te==="__proto__"||te==="constructor"||te==="prototype")return u;if(T!=j){var ve=U[te];me=E?E(ve,te,U):n,me===n&&(me=sn(ve)?ve:Do(h[T+1])?[]:{})}Ld(U,te,me),U=U[te]}return u}var z5=wg?function(u,h){return wg.set(u,h),u}:xr,Tse=bg?function(u,h){return bg(u,"toString",{configurable:!0,enumerable:!1,value:N1(h),writable:!0})}:xr;function Ase(u){return $g(Oc(u))}function di(u,h,b){var E=-1,T=u.length;h<0&&(h=-h>T?0:T+h),b=b>T?T:b,b<0&&(b+=T),T=h>b?0:b-h>>>0,h>>>=0;for(var R=ce(T);++E<T;)R[E]=u[E+h];return R}function Ise(u,h){var b;return Ss(u,function(E,T,R){return b=h(E,T,R),!b}),!!b}function kg(u,h,b){var E=0,T=u==null?E:u.length;if(typeof h=="number"&&h===h&&T<=N){for(;E<T;){var R=E+T>>>1,j=u[R];j!==null&&!Ur(j)&&(b?j<=h:j<h)?E=R+1:T=R}return T}return l1(u,h,xr,b)}function l1(u,h,b,E){var T=0,R=u==null?0:u.length;if(R===0)return 0;h=b(h);for(var j=h!==h,U=h===null,te=Ur(h),me=h===n;T<R;){var ve=xg((T+R)/2),we=b(u[ve]),De=we!==n,$e=we===null,We=we===we,ft=Ur(we);if(j)var qe=E||We;else me?qe=We&&(E||De):U?qe=We&&De&&(E||!$e):te?qe=We&&De&&!$e&&(E||!ft):$e||ft?qe=!1:qe=E?we<=h:we<h;qe?T=ve+1:R=ve}return Kn(R,re)}function B5(u,h){for(var b=-1,E=u.length,T=0,R=[];++b<E;){var j=u[b],U=h?h(j):j;if(!b||!Oi(U,te)){var te=U;R[T++]=j===0?0:j}}return R}function V5(u){return typeof u=="number"?u:Ur(u)?D:+u}function qr(u){if(typeof u=="string")return u;if(rt(u))return rn(u,qr)+"";if(Ur(u))return x5?x5.call(u):"";var h=u+"";return h=="0"&&1/u==-G?"-0":h}function Cs(u,h,b){var E=-1,T=ag,R=u.length,j=!0,U=[],te=U;if(b)j=!1,T=$x;else if(R>=i){var me=h?null:Wse(u);if(me)return cg(me);j=!1,T=Dd,te=new Ga}else te=h?[]:U;e:for(;++E<R;){var ve=u[E],we=h?h(ve):ve;if(ve=b||ve!==0?ve:0,j&&we===we){for(var De=te.length;De--;)if(te[De]===we)continue e;h&&te.push(we),U.push(ve)}else T(te,we,b)||(te!==U&&te.push(we),U.push(ve))}return U}function c1(u,h){return h=Es(h,u),u=mI(u,h),u==null||delete u[to(fi(h))]}function H5(u,h,b,E){return zd(u,h,b(Ka(u,h)),E)}function Mg(u,h,b,E){for(var T=u.length,R=E?T:-1;(E?R--:++R<T)&&h(u[R],R,u););return b?di(u,E?0:R,E?R+1:T):di(u,E?R+1:0,E?T:R)}function W5(u,h){var b=u;return b instanceof Ct&&(b=b.value()),Fx(h,function(E,T){return T.func.apply(T.thisArg,xs([E],T.args))},b)}function u1(u,h,b){var E=u.length;if(E<2)return E?Cs(u[0]):[];for(var T=-1,R=ce(E);++T<E;)for(var j=u[T],U=-1;++U<E;)U!=T&&(R[T]=$d(R[T]||j,u[U],h,b));return Cs(Bn(R,1),h,b)}function q5(u,h,b){for(var E=-1,T=u.length,R=h.length,j={};++E<T;){var U=E<R?h[E]:n;b(j,u[E],U)}return j}function d1(u){return gn(u)?u:[]}function f1(u){return typeof u=="function"?u:xr}function Es(u,h){return rt(u)?u:w1(u,h)?[u]:xI(Lt(u))}var Nse=ht;function Os(u,h,b){var E=u.length;return b=b===n?E:b,!h&&b>=E?u:di(u,h,b)}var U5=woe||function(u){return zn.clearTimeout(u)};function G5(u,h){if(h)return u.slice();var b=u.length,E=p5?p5(b):new u.constructor(b);return u.copy(E),E}function h1(u){var h=new u.constructor(u.byteLength);return new gg(h).set(new gg(u)),h}function Rse(u,h){var b=h?h1(u.buffer):u.buffer;return new u.constructor(b,u.byteOffset,u.byteLength)}function Lse(u){var h=new u.constructor(u.source,je.exec(u));return h.lastIndex=u.lastIndex,h}function $se(u){return Rd?Bt(Rd.call(u)):{}}function Y5(u,h){var b=h?h1(u.buffer):u.buffer;return new u.constructor(b,u.byteOffset,u.length)}function K5(u,h){if(u!==h){var b=u!==n,E=u===null,T=u===u,R=Ur(u),j=h!==n,U=h===null,te=h===h,me=Ur(h);if(!U&&!me&&!R&&u>h||R&&j&&te&&!U&&!me||E&&j&&te||!b&&te||!T)return 1;if(!E&&!R&&!me&&u<h||me&&b&&T&&!E&&!R||U&&b&&T||!j&&T||!te)return-1}return 0}function Fse(u,h,b){for(var E=-1,T=u.criteria,R=h.criteria,j=T.length,U=b.length;++E<j;){var te=K5(T[E],R[E]);if(te){if(E>=U)return te;var me=b[E];return te*(me=="desc"?-1:1)}}return u.index-h.index}function X5(u,h,b,E){for(var T=-1,R=u.length,j=b.length,U=-1,te=h.length,me=On(R-j,0),ve=ce(te+me),we=!E;++U<te;)ve[U]=h[U];for(;++T<j;)(we||T<R)&&(ve[b[T]]=u[T]);for(;me--;)ve[U++]=u[T++];return ve}function Q5(u,h,b,E){for(var T=-1,R=u.length,j=-1,U=b.length,te=-1,me=h.length,ve=On(R-U,0),we=ce(ve+me),De=!E;++T<ve;)we[T]=u[T];for(var $e=T;++te<me;)we[$e+te]=h[te];for(;++j<U;)(De||T<R)&&(we[$e+b[j]]=u[T++]);return we}function vr(u,h){var b=-1,E=u.length;for(h||(h=ce(E));++b<E;)h[b]=u[b];return h}function eo(u,h,b,E){var T=!b;b||(b={});for(var R=-1,j=h.length;++R<j;){var U=h[R],te=E?E(b[U],u[U],U,b,u):n;te===n&&(te=u[U]),T?Po(b,U,te):Ld(b,U,te)}return b}function jse(u,h){return eo(u,x1(u),h)}function zse(u,h){return eo(u,uI(u),h)}function Dg(u,h){return function(b,E){var T=rt(b)?qie:lse,R=h?h():{};return T(b,u,Ve(E,2),R)}}function _c(u){return ht(function(h,b){var E=-1,T=b.length,R=T>1?b[T-1]:n,j=T>2?b[2]:n;for(R=u.length>3&&typeof R=="function"?(T--,R):n,j&&nr(b[0],b[1],j)&&(R=T<3?n:R,T=1),h=Bt(h);++E<T;){var U=b[E];U&&u(h,U,E,R)}return h})}function Z5(u,h){return function(b,E){if(b==null)return b;if(!br(b))return u(b,E);for(var T=b.length,R=h?T:-1,j=Bt(b);(h?R--:++R<T)&&E(j[R],R,j)!==!1;);return b}}function J5(u){return function(h,b,E){for(var T=-1,R=Bt(h),j=E(h),U=j.length;U--;){var te=j[u?U:++T];if(b(R[te],te,R)===!1)break}return h}}function Bse(u,h,b){var E=h&x,T=Bd(u);function R(){var j=this&&this!==zn&&this instanceof R?T:u;return j.apply(E?b:this,arguments)}return R}function eI(u){return function(h){h=Lt(h);var b=gc(h)?Ci(h):n,E=b?b[0]:h.charAt(0),T=b?Os(b,1).join(""):h.slice(1);return E[u]()+T}}function Sc(u){return function(h){return Fx(ZI(QI(h).replace(Tie,"")),u,"")}}function Bd(u){return function(){var h=arguments;switch(h.length){case 0:return new u;case 1:return new u(h[0]);case 2:return new u(h[0],h[1]);case 3:return new u(h[0],h[1],h[2]);case 4:return new u(h[0],h[1],h[2],h[3]);case 5:return new u(h[0],h[1],h[2],h[3],h[4]);case 6:return new u(h[0],h[1],h[2],h[3],h[4],h[5]);case 7:return new u(h[0],h[1],h[2],h[3],h[4],h[5],h[6])}var b=wc(u.prototype),E=u.apply(b,h);return sn(E)?E:b}}function Vse(u,h,b){var E=Bd(u);function T(){for(var R=arguments.length,j=ce(R),U=R,te=Cc(T);U--;)j[U]=arguments[U];var me=R<3&&j[0]!==te&&j[R-1]!==te?[]:ws(j,te);if(R-=me.length,R<b)return oI(u,h,Tg,T.placeholder,n,j,me,n,n,b-R);var ve=this&&this!==zn&&this instanceof T?E:u;return Hr(ve,this,j)}return T}function tI(u){return function(h,b,E){var T=Bt(h);if(!br(h)){var R=Ve(b,3);h=An(h),b=function(U){return R(T[U],U,T)}}var j=u(h,b,E);return j>-1?T[R?h[j]:j]:n}}function nI(u){return Mo(function(h){var b=h.length,E=b,T=ci.prototype.thru;for(u&&h.reverse();E--;){var R=h[E];if(typeof R!="function")throw new li(s);if(T&&!j&&Rg(R)=="wrapper")var j=new ci([],!0)}for(E=j?E:b;++E<b;){R=h[E];var U=Rg(R),te=U=="wrapper"?b1(R):n;te&&_1(te[0])&&te[1]==(A|C|O|L)&&!te[4].length&&te[9]==1?j=j[Rg(te[0])].apply(j,te[3]):j=R.length==1&&_1(R)?j[U]():j.thru(R)}return function(){var me=arguments,ve=me[0];if(j&&me.length==1&&rt(ve))return j.plant(ve).value();for(var we=0,De=b?h[we].apply(this,me):ve;++we<b;)De=h[we].call(this,De);return De}})}function Tg(u,h,b,E,T,R,j,U,te,me){var ve=h&A,we=h&x,De=h&w,$e=h&(C|P),We=h&F,ft=De?n:Bd(u);function qe(){for(var _t=arguments.length,Et=ce(_t),Gr=_t;Gr--;)Et[Gr]=arguments[Gr];if($e)var rr=Cc(qe),Yr=eoe(Et,rr);if(E&&(Et=X5(Et,E,T,$e)),R&&(Et=Q5(Et,R,j,$e)),_t-=Yr,$e&&_t<me){var mn=ws(Et,rr);return oI(u,h,Tg,qe.placeholder,b,Et,mn,U,te,me-_t)}var Pi=we?b:this,Io=De?Pi[u]:u;return _t=Et.length,U?Et=lae(Et,U):We&&_t>1&&Et.reverse(),ve&&te<_t&&(Et.length=te),this&&this!==zn&&this instanceof qe&&(Io=ft||Bd(Io)),Io.apply(Pi,Et)}return qe}function rI(u,h){return function(b,E){return mse(b,u,h(E),{})}}function Ag(u,h){return function(b,E){var T;if(b===n&&E===n)return h;if(b!==n&&(T=b),E!==n){if(T===n)return E;typeof b=="string"||typeof E=="string"?(b=qr(b),E=qr(E)):(b=V5(b),E=V5(E)),T=u(b,E)}return T}}function p1(u){return Mo(function(h){return h=rn(h,Wr(Ve())),ht(function(b){var E=this;return u(h,function(T){return Hr(T,E,b)})})})}function Ig(u,h){h=h===n?" ":qr(h);var b=h.length;if(b<2)return b?a1(h,u):h;var E=a1(h,yg(u/mc(h)));return gc(h)?Os(Ci(E),0,u).join(""):E.slice(0,u)}function Hse(u,h,b,E){var T=h&x,R=Bd(u);function j(){for(var U=-1,te=arguments.length,me=-1,ve=E.length,we=ce(ve+te),De=this&&this!==zn&&this instanceof j?R:u;++me<ve;)we[me]=E[me];for(;te--;)we[me++]=arguments[++U];return Hr(De,T?b:this,we)}return j}function iI(u){return function(h,b,E){return E&&typeof E!="number"&&nr(h,b,E)&&(b=E=n),h=Ao(h),b===n?(b=h,h=0):b=Ao(b),E=E===n?h<b?1:-1:Ao(E),kse(h,b,E,u)}}function Ng(u){return function(h,b){return typeof h=="string"&&typeof b=="string"||(h=hi(h),b=hi(b)),u(h,b)}}function oI(u,h,b,E,T,R,j,U,te,me){var ve=h&C,we=ve?j:n,De=ve?n:j,$e=ve?R:n,We=ve?n:R;h|=ve?O:k,h&=~(ve?k:O),h&S||(h&=~(x|w));var ft=[u,h,T,$e,we,We,De,U,te,me],qe=b.apply(n,ft);return _1(u)&&vI(qe,ft),qe.placeholder=E,bI(qe,u,h)}function g1(u){var h=En[u];return function(b,E){if(b=hi(b),E=E==null?0:Kn(lt(E),292),E&&b5(b)){var T=(Lt(b)+"e").split("e"),R=h(T[0]+"e"+(+T[1]+E));return T=(Lt(R)+"e").split("e"),+(T[0]+"e"+(+T[1]-E))}return h(b)}}var Wse=yc&&1/cg(new yc([,-0]))[1]==G?function(u){return new yc(u)}:$1;function sI(u){return function(h){var b=Xn(h);return b==Fe?qx(h):b==Jt?aoe(h):Jie(h,u(h))}}function ko(u,h,b,E,T,R,j,U){var te=h&w;if(!te&&typeof u!="function")throw new li(s);var me=E?E.length:0;if(me||(h&=~(O|k),E=T=n),j=j===n?j:On(lt(j),0),U=U===n?U:lt(U),me-=T?T.length:0,h&k){var ve=E,we=T;E=T=n}var De=te?n:b1(u),$e=[u,h,b,E,T,ve,we,R,j,U];if(De&&oae($e,De),u=$e[0],h=$e[1],b=$e[2],E=$e[3],T=$e[4],U=$e[9]=$e[9]===n?te?0:u.length:On($e[9]-me,0),!U&&h&(C|P)&&(h&=~(C|P)),!h||h==x)var We=Bse(u,h,b);else h==C||h==P?We=Vse(u,h,U):(h==O||h==(x|O))&&!T.length?We=Hse(u,h,b,E):We=Tg.apply(n,$e);var ft=De?z5:vI;return bI(ft(We,$e),u,h)}function aI(u,h,b,E){return u===n||Oi(u,bc[b])&&!Ft.call(E,b)?h:u}function lI(u,h,b,E,T,R){return sn(u)&&sn(h)&&(R.set(h,u),Pg(u,h,n,lI,R),R.delete(h)),u}function qse(u){return Wd(u)?n:u}function cI(u,h,b,E,T,R){var j=b&v,U=u.length,te=h.length;if(U!=te&&!(j&&te>U))return!1;var me=R.get(u),ve=R.get(h);if(me&&ve)return me==h&&ve==u;var we=-1,De=!0,$e=b&y?new Ga:n;for(R.set(u,h),R.set(h,u);++we<U;){var We=u[we],ft=h[we];if(E)var qe=j?E(ft,We,we,h,u,R):E(We,ft,we,u,h,R);if(qe!==n){if(qe)continue;De=!1;break}if($e){if(!jx(h,function(_t,Et){if(!Dd($e,Et)&&(We===_t||T(We,_t,b,E,R)))return $e.push(Et)})){De=!1;break}}else if(!(We===ft||T(We,ft,b,E,R))){De=!1;break}}return R.delete(u),R.delete(h),De}function Use(u,h,b,E,T,R,j){switch(b){case Xe:if(u.byteLength!=h.byteLength||u.byteOffset!=h.byteOffset)return!1;u=u.buffer,h=h.buffer;case Le:return!(u.byteLength!=h.byteLength||!R(new gg(u),new gg(h)));case ie:case ee:case He:return Oi(+u,+h);case ye:return u.name==h.name&&u.message==h.message;case tn:case Dn:return u==h+"";case Fe:var U=qx;case Jt:var te=E&v;if(U||(U=cg),u.size!=h.size&&!te)return!1;var me=j.get(u);if(me)return me==h;E|=y,j.set(u,h);var ve=cI(U(u),U(h),E,T,R,j);return j.delete(u),ve;case fn:if(Rd)return Rd.call(u)==Rd.call(h)}return!1}function Gse(u,h,b,E,T,R){var j=b&v,U=m1(u),te=U.length,me=m1(h),ve=me.length;if(te!=ve&&!j)return!1;for(var we=te;we--;){var De=U[we];if(!(j?De in h:Ft.call(h,De)))return!1}var $e=R.get(u),We=R.get(h);if($e&&We)return $e==h&&We==u;var ft=!0;R.set(u,h),R.set(h,u);for(var qe=j;++we<te;){De=U[we];var _t=u[De],Et=h[De];if(E)var Gr=j?E(Et,_t,De,h,u,R):E(_t,Et,De,u,h,R);if(!(Gr===n?_t===Et||T(_t,Et,b,E,R):Gr)){ft=!1;break}qe||(qe=De=="constructor")}if(ft&&!qe){var rr=u.constructor,Yr=h.constructor;rr!=Yr&&"constructor"in u&&"constructor"in h&&!(typeof rr=="function"&&rr instanceof rr&&typeof Yr=="function"&&Yr instanceof Yr)&&(ft=!1)}return R.delete(u),R.delete(h),ft}function Mo(u){return C1(gI(u,n,CI),u+"")}function m1(u){return M5(u,An,x1)}function v1(u){return M5(u,yr,uI)}var b1=wg?function(u){return wg.get(u)}:$1;function Rg(u){for(var h=u.name+"",b=xc[h],E=Ft.call(xc,h)?b.length:0;E--;){var T=b[E],R=T.func;if(R==null||R==u)return T.name}return h}function Cc(u){var h=Ft.call(I,"placeholder")?I:u;return h.placeholder}function Ve(){var u=I.iteratee||R1;return u=u===R1?A5:u,arguments.length?u(arguments[0],arguments[1]):u}function Lg(u,h){var b=u.__data__;return tae(h)?b[typeof h=="string"?"string":"hash"]:b.map}function y1(u){for(var h=An(u),b=h.length;b--;){var E=h[b],T=u[E];h[b]=[E,T,hI(T)]}return h}function Xa(u,h){var b=ioe(u,h);return T5(b)?b:n}function Yse(u){var h=Ft.call(u,qa),b=u[qa];try{u[qa]=n;var E=!0}catch{}var T=hg.call(u);return E&&(h?u[qa]=b:delete u[qa]),T}var x1=Gx?function(u){return u==null?[]:(u=Bt(u),ys(Gx(u),function(h){return m5.call(u,h)}))}:F1,uI=Gx?function(u){for(var h=[];u;)xs(h,x1(u)),u=mg(u);return h}:F1,Xn=tr;(Yx&&Xn(new Yx(new ArrayBuffer(1)))!=Xe||Ad&&Xn(new Ad)!=Fe||Kx&&Xn(Kx.resolve())!=vt||yc&&Xn(new yc)!=Jt||Id&&Xn(new Id)!=fe)&&(Xn=function(u){var h=tr(u),b=h==St?u.constructor:n,E=b?Qa(b):"";if(E)switch(E){case Doe:return Xe;case Toe:return Fe;case Aoe:return vt;case Ioe:return Jt;case Noe:return fe}return h});function Kse(u,h,b){for(var E=-1,T=b.length;++E<T;){var R=b[E],j=R.size;switch(R.type){case"drop":u+=j;break;case"dropRight":h-=j;break;case"take":h=Kn(h,u+j);break;case"takeRight":u=On(u,h-j);break}}return{start:u,end:h}}function Xse(u){var h=u.match(Md);return h?h[1].split(M):[]}function dI(u,h,b){h=Es(h,u);for(var E=-1,T=h.length,R=!1;++E<T;){var j=to(h[E]);if(!(R=u!=null&&b(u,j)))break;u=u[j]}return R||++E!=T?R:(T=u==null?0:u.length,!!T&&Hg(T)&&Do(j,T)&&(rt(u)||Za(u)))}function Qse(u){var h=u.length,b=new u.constructor(h);return h&&typeof u[0]=="string"&&Ft.call(u,"index")&&(b.index=u.index,b.input=u.input),b}function fI(u){return typeof u.constructor=="function"&&!Vd(u)?wc(mg(u)):{}}function Zse(u,h,b){var E=u.constructor;switch(h){case Le:return h1(u);case ie:case ee:return new E(+u);case Xe:return Rse(u,b);case yt:case hn:case Cn:case Fn:case Br:case Vr:case pn:case mr:case jn:return Y5(u,b);case Fe:return new E;case He:case Dn:return new E(u);case tn:return Lse(u);case Jt:return new E;case fn:return $se(u)}}function Jse(u,h){var b=h.length;if(!b)return u;var E=b-1;return h[E]=(b>1?"& ":"")+h[E],h=h.join(b>2?", ":" "),u.replace(kd,`{
|
|
67
|
+
/* [wrapped with `+h+`] */
|
|
68
|
+
`)}function eae(u){return rt(u)||Za(u)||!!(v5&&u&&u[v5])}function Do(u,h){var b=typeof u;return h=h??q,!!h&&(b=="number"||b!="symbol"&&nt.test(u))&&u>-1&&u%1==0&&u<h}function nr(u,h,b){if(!sn(b))return!1;var E=typeof h;return(E=="number"?br(b)&&Do(h,b.length):E=="string"&&h in b)?Oi(b[h],u):!1}function w1(u,h){if(rt(u))return!1;var b=typeof u;return b=="number"||b=="symbol"||b=="boolean"||u==null||Ur(u)?!0:ja.test(u)||!Fa.test(u)||h!=null&&u in Bt(h)}function tae(u){var h=typeof u;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?u!=="__proto__":u===null}function _1(u){var h=Rg(u),b=I[h];if(typeof b!="function"||!(h in Ct.prototype))return!1;if(u===b)return!0;var E=b1(b);return!!E&&u===E[0]}function nae(u){return!!h5&&h5 in u}var rae=dg?To:j1;function Vd(u){var h=u&&u.constructor,b=typeof h=="function"&&h.prototype||bc;return u===b}function hI(u){return u===u&&!sn(u)}function pI(u,h){return function(b){return b==null?!1:b[u]===h&&(h!==n||u in Bt(b))}}function iae(u){var h=Bg(u,function(E){return b.size===c&&b.clear(),E}),b=h.cache;return h}function oae(u,h){var b=u[1],E=h[1],T=b|E,R=T<(x|w|A),j=E==A&&b==C||E==A&&b==L&&u[7].length<=h[8]||E==(A|L)&&h[7].length<=h[8]&&b==C;if(!(R||j))return u;E&x&&(u[2]=h[2],T|=b&x?0:S);var U=h[3];if(U){var te=u[3];u[3]=te?X5(te,U,h[4]):U,u[4]=te?ws(u[3],d):h[4]}return U=h[5],U&&(te=u[5],u[5]=te?Q5(te,U,h[6]):U,u[6]=te?ws(u[5],d):h[6]),U=h[7],U&&(u[7]=U),E&A&&(u[8]=u[8]==null?h[8]:Kn(u[8],h[8])),u[9]==null&&(u[9]=h[9]),u[0]=h[0],u[1]=T,u}function sae(u){var h=[];if(u!=null)for(var b in Bt(u))h.push(b);return h}function aae(u){return hg.call(u)}function gI(u,h,b){return h=On(h===n?u.length-1:h,0),function(){for(var E=arguments,T=-1,R=On(E.length-h,0),j=ce(R);++T<R;)j[T]=E[h+T];T=-1;for(var U=ce(h+1);++T<h;)U[T]=E[T];return U[h]=b(j),Hr(u,this,U)}}function mI(u,h){return h.length<2?u:Ka(u,di(h,0,-1))}function lae(u,h){for(var b=u.length,E=Kn(h.length,b),T=vr(u);E--;){var R=h[E];u[E]=Do(R,b)?T[R]:n}return u}function S1(u,h){if(!(h==="constructor"&&typeof u[h]=="function")&&h!="__proto__")return u[h]}var vI=yI(z5),Hd=Soe||function(u,h){return zn.setTimeout(u,h)},C1=yI(Tse);function bI(u,h,b){var E=h+"";return C1(u,Jse(E,cae(Xse(E),b)))}function yI(u){var h=0,b=0;return function(){var E=Poe(),T=X-(E-b);if(b=E,T>0){if(++h>=V)return arguments[0]}else h=0;return u.apply(n,arguments)}}function $g(u,h){var b=-1,E=u.length,T=E-1;for(h=h===n?E:h;++b<h;){var R=s1(b,T),j=u[R];u[R]=u[b],u[b]=j}return u.length=h,u}var xI=iae(function(u){var h=[];return u.charCodeAt(0)===46&&h.push(""),u.replace(Od,function(b,E,T,R){h.push(T?R.replace(Se,"$1"):E||b)}),h});function to(u){if(typeof u=="string"||Ur(u))return u;var h=u+"";return h=="0"&&1/u==-G?"-0":h}function Qa(u){if(u!=null){try{return fg.call(u)}catch{}try{return u+""}catch{}}return""}function cae(u,h){return ai(ne,function(b){var E="_."+b[0];h&b[1]&&!ag(u,E)&&u.push(E)}),u.sort()}function wI(u){if(u instanceof Ct)return u.clone();var h=new ci(u.__wrapped__,u.__chain__);return h.__actions__=vr(u.__actions__),h.__index__=u.__index__,h.__values__=u.__values__,h}function uae(u,h,b){(b?nr(u,h,b):h===n)?h=1:h=On(lt(h),0);var E=u==null?0:u.length;if(!E||h<1)return[];for(var T=0,R=0,j=ce(yg(E/h));T<E;)j[R++]=di(u,T,T+=h);return j}function dae(u){for(var h=-1,b=u==null?0:u.length,E=0,T=[];++h<b;){var R=u[h];R&&(T[E++]=R)}return T}function fae(){var u=arguments.length;if(!u)return[];for(var h=ce(u-1),b=arguments[0],E=u;E--;)h[E-1]=arguments[E];return xs(rt(b)?vr(b):[b],Bn(h,1))}var hae=ht(function(u,h){return gn(u)?$d(u,Bn(h,1,gn,!0)):[]}),pae=ht(function(u,h){var b=fi(h);return gn(b)&&(b=n),gn(u)?$d(u,Bn(h,1,gn,!0),Ve(b,2)):[]}),gae=ht(function(u,h){var b=fi(h);return gn(b)&&(b=n),gn(u)?$d(u,Bn(h,1,gn,!0),n,b):[]});function mae(u,h,b){var E=u==null?0:u.length;return E?(h=b||h===n?1:lt(h),di(u,h<0?0:h,E)):[]}function vae(u,h,b){var E=u==null?0:u.length;return E?(h=b||h===n?1:lt(h),h=E-h,di(u,0,h<0?0:h)):[]}function bae(u,h){return u&&u.length?Mg(u,Ve(h,3),!0,!0):[]}function yae(u,h){return u&&u.length?Mg(u,Ve(h,3),!0):[]}function xae(u,h,b,E){var T=u==null?0:u.length;return T?(b&&typeof b!="number"&&nr(u,h,b)&&(b=0,E=T),fse(u,h,b,E)):[]}function _I(u,h,b){var E=u==null?0:u.length;if(!E)return-1;var T=b==null?0:lt(b);return T<0&&(T=On(E+T,0)),lg(u,Ve(h,3),T)}function SI(u,h,b){var E=u==null?0:u.length;if(!E)return-1;var T=E-1;return b!==n&&(T=lt(b),T=b<0?On(E+T,0):Kn(T,E-1)),lg(u,Ve(h,3),T,!0)}function CI(u){var h=u==null?0:u.length;return h?Bn(u,1):[]}function wae(u){var h=u==null?0:u.length;return h?Bn(u,G):[]}function _ae(u,h){var b=u==null?0:u.length;return b?(h=h===n?1:lt(h),Bn(u,h)):[]}function Sae(u){for(var h=-1,b=u==null?0:u.length,E={};++h<b;){var T=u[h];E[T[0]]=T[1]}return E}function EI(u){return u&&u.length?u[0]:n}function Cae(u,h,b){var E=u==null?0:u.length;if(!E)return-1;var T=b==null?0:lt(b);return T<0&&(T=On(E+T,0)),pc(u,h,T)}function Eae(u){var h=u==null?0:u.length;return h?di(u,0,-1):[]}var Oae=ht(function(u){var h=rn(u,d1);return h.length&&h[0]===u[0]?t1(h):[]}),Pae=ht(function(u){var h=fi(u),b=rn(u,d1);return h===fi(b)?h=n:b.pop(),b.length&&b[0]===u[0]?t1(b,Ve(h,2)):[]}),kae=ht(function(u){var h=fi(u),b=rn(u,d1);return h=typeof h=="function"?h:n,h&&b.pop(),b.length&&b[0]===u[0]?t1(b,n,h):[]});function Mae(u,h){return u==null?"":Eoe.call(u,h)}function fi(u){var h=u==null?0:u.length;return h?u[h-1]:n}function Dae(u,h,b){var E=u==null?0:u.length;if(!E)return-1;var T=E;return b!==n&&(T=lt(b),T=T<0?On(E+T,0):Kn(T,E-1)),h===h?coe(u,h,T):lg(u,o5,T,!0)}function Tae(u,h){return u&&u.length?L5(u,lt(h)):n}var Aae=ht(OI);function OI(u,h){return u&&u.length&&h&&h.length?o1(u,h):u}function Iae(u,h,b){return u&&u.length&&h&&h.length?o1(u,h,Ve(b,2)):u}function Nae(u,h,b){return u&&u.length&&h&&h.length?o1(u,h,n,b):u}var Rae=Mo(function(u,h){var b=u==null?0:u.length,E=Qx(u,h);return j5(u,rn(h,function(T){return Do(T,b)?+T:T}).sort(K5)),E});function Lae(u,h){var b=[];if(!(u&&u.length))return b;var E=-1,T=[],R=u.length;for(h=Ve(h,3);++E<R;){var j=u[E];h(j,E,u)&&(b.push(j),T.push(E))}return j5(u,T),b}function E1(u){return u==null?u:Moe.call(u)}function $ae(u,h,b){var E=u==null?0:u.length;return E?(b&&typeof b!="number"&&nr(u,h,b)?(h=0,b=E):(h=h==null?0:lt(h),b=b===n?E:lt(b)),di(u,h,b)):[]}function Fae(u,h){return kg(u,h)}function jae(u,h,b){return l1(u,h,Ve(b,2))}function zae(u,h){var b=u==null?0:u.length;if(b){var E=kg(u,h);if(E<b&&Oi(u[E],h))return E}return-1}function Bae(u,h){return kg(u,h,!0)}function Vae(u,h,b){return l1(u,h,Ve(b,2),!0)}function Hae(u,h){var b=u==null?0:u.length;if(b){var E=kg(u,h,!0)-1;if(Oi(u[E],h))return E}return-1}function Wae(u){return u&&u.length?B5(u):[]}function qae(u,h){return u&&u.length?B5(u,Ve(h,2)):[]}function Uae(u){var h=u==null?0:u.length;return h?di(u,1,h):[]}function Gae(u,h,b){return u&&u.length?(h=b||h===n?1:lt(h),di(u,0,h<0?0:h)):[]}function Yae(u,h,b){var E=u==null?0:u.length;return E?(h=b||h===n?1:lt(h),h=E-h,di(u,h<0?0:h,E)):[]}function Kae(u,h){return u&&u.length?Mg(u,Ve(h,3),!1,!0):[]}function Xae(u,h){return u&&u.length?Mg(u,Ve(h,3)):[]}var Qae=ht(function(u){return Cs(Bn(u,1,gn,!0))}),Zae=ht(function(u){var h=fi(u);return gn(h)&&(h=n),Cs(Bn(u,1,gn,!0),Ve(h,2))}),Jae=ht(function(u){var h=fi(u);return h=typeof h=="function"?h:n,Cs(Bn(u,1,gn,!0),n,h)});function ele(u){return u&&u.length?Cs(u):[]}function tle(u,h){return u&&u.length?Cs(u,Ve(h,2)):[]}function nle(u,h){return h=typeof h=="function"?h:n,u&&u.length?Cs(u,n,h):[]}function O1(u){if(!(u&&u.length))return[];var h=0;return u=ys(u,function(b){if(gn(b))return h=On(b.length,h),!0}),Hx(h,function(b){return rn(u,zx(b))})}function PI(u,h){if(!(u&&u.length))return[];var b=O1(u);return h==null?b:rn(b,function(E){return Hr(h,n,E)})}var rle=ht(function(u,h){return gn(u)?$d(u,h):[]}),ile=ht(function(u){return u1(ys(u,gn))}),ole=ht(function(u){var h=fi(u);return gn(h)&&(h=n),u1(ys(u,gn),Ve(h,2))}),sle=ht(function(u){var h=fi(u);return h=typeof h=="function"?h:n,u1(ys(u,gn),n,h)}),ale=ht(O1);function lle(u,h){return q5(u||[],h||[],Ld)}function cle(u,h){return q5(u||[],h||[],zd)}var ule=ht(function(u){var h=u.length,b=h>1?u[h-1]:n;return b=typeof b=="function"?(u.pop(),b):n,PI(u,b)});function kI(u){var h=I(u);return h.__chain__=!0,h}function dle(u,h){return h(u),u}function Fg(u,h){return h(u)}var fle=Mo(function(u){var h=u.length,b=h?u[0]:0,E=this.__wrapped__,T=function(R){return Qx(R,u)};return h>1||this.__actions__.length||!(E instanceof Ct)||!Do(b)?this.thru(T):(E=E.slice(b,+b+(h?1:0)),E.__actions__.push({func:Fg,args:[T],thisArg:n}),new ci(E,this.__chain__).thru(function(R){return h&&!R.length&&R.push(n),R}))});function hle(){return kI(this)}function ple(){return new ci(this.value(),this.__chain__)}function gle(){this.__values__===n&&(this.__values__=VI(this.value()));var u=this.__index__>=this.__values__.length,h=u?n:this.__values__[this.__index__++];return{done:u,value:h}}function mle(){return this}function vle(u){for(var h,b=this;b instanceof Sg;){var E=wI(b);E.__index__=0,E.__values__=n,h?T.__wrapped__=E:h=E;var T=E;b=b.__wrapped__}return T.__wrapped__=u,h}function ble(){var u=this.__wrapped__;if(u instanceof Ct){var h=u;return this.__actions__.length&&(h=new Ct(this)),h=h.reverse(),h.__actions__.push({func:Fg,args:[E1],thisArg:n}),new ci(h,this.__chain__)}return this.thru(E1)}function yle(){return W5(this.__wrapped__,this.__actions__)}var xle=Dg(function(u,h,b){Ft.call(u,b)?++u[b]:Po(u,b,1)});function wle(u,h,b){var E=rt(u)?r5:dse;return b&&nr(u,h,b)&&(h=n),E(u,Ve(h,3))}function _le(u,h){var b=rt(u)?ys:P5;return b(u,Ve(h,3))}var Sle=tI(_I),Cle=tI(SI);function Ele(u,h){return Bn(jg(u,h),1)}function Ole(u,h){return Bn(jg(u,h),G)}function Ple(u,h,b){return b=b===n?1:lt(b),Bn(jg(u,h),b)}function MI(u,h){var b=rt(u)?ai:Ss;return b(u,Ve(h,3))}function DI(u,h){var b=rt(u)?Uie:O5;return b(u,Ve(h,3))}var kle=Dg(function(u,h,b){Ft.call(u,b)?u[b].push(h):Po(u,b,[h])});function Mle(u,h,b,E){u=br(u)?u:Oc(u),b=b&&!E?lt(b):0;var T=u.length;return b<0&&(b=On(T+b,0)),Wg(u)?b<=T&&u.indexOf(h,b)>-1:!!T&&pc(u,h,b)>-1}var Dle=ht(function(u,h,b){var E=-1,T=typeof h=="function",R=br(u)?ce(u.length):[];return Ss(u,function(j){R[++E]=T?Hr(h,j,b):Fd(j,h,b)}),R}),Tle=Dg(function(u,h,b){Po(u,b,h)});function jg(u,h){var b=rt(u)?rn:I5;return b(u,Ve(h,3))}function Ale(u,h,b,E){return u==null?[]:(rt(h)||(h=h==null?[]:[h]),b=E?n:b,rt(b)||(b=b==null?[]:[b]),$5(u,h,b))}var Ile=Dg(function(u,h,b){u[b?0:1].push(h)},function(){return[[],[]]});function Nle(u,h,b){var E=rt(u)?Fx:a5,T=arguments.length<3;return E(u,Ve(h,4),b,T,Ss)}function Rle(u,h,b){var E=rt(u)?Gie:a5,T=arguments.length<3;return E(u,Ve(h,4),b,T,O5)}function Lle(u,h){var b=rt(u)?ys:P5;return b(u,Vg(Ve(h,3)))}function $le(u){var h=rt(u)?_5:Mse;return h(u)}function Fle(u,h,b){(b?nr(u,h,b):h===n)?h=1:h=lt(h);var E=rt(u)?sse:Dse;return E(u,h)}function jle(u){var h=rt(u)?ase:Ase;return h(u)}function zle(u){if(u==null)return 0;if(br(u))return Wg(u)?mc(u):u.length;var h=Xn(u);return h==Fe||h==Jt?u.size:r1(u).length}function Ble(u,h,b){var E=rt(u)?jx:Ise;return b&&nr(u,h,b)&&(h=n),E(u,Ve(h,3))}var Vle=ht(function(u,h){if(u==null)return[];var b=h.length;return b>1&&nr(u,h[0],h[1])?h=[]:b>2&&nr(h[0],h[1],h[2])&&(h=[h[0]]),$5(u,Bn(h,1),[])}),zg=_oe||function(){return zn.Date.now()};function Hle(u,h){if(typeof h!="function")throw new li(s);return u=lt(u),function(){if(--u<1)return h.apply(this,arguments)}}function TI(u,h,b){return h=b?n:h,h=u&&h==null?u.length:h,ko(u,A,n,n,n,n,h)}function AI(u,h){var b;if(typeof h!="function")throw new li(s);return u=lt(u),function(){return--u>0&&(b=h.apply(this,arguments)),u<=1&&(h=n),b}}var P1=ht(function(u,h,b){var E=x;if(b.length){var T=ws(b,Cc(P1));E|=O}return ko(u,E,h,b,T)}),II=ht(function(u,h,b){var E=x|w;if(b.length){var T=ws(b,Cc(II));E|=O}return ko(h,E,u,b,T)});function NI(u,h,b){h=b?n:h;var E=ko(u,C,n,n,n,n,n,h);return E.placeholder=NI.placeholder,E}function RI(u,h,b){h=b?n:h;var E=ko(u,P,n,n,n,n,n,h);return E.placeholder=RI.placeholder,E}function LI(u,h,b){var E,T,R,j,U,te,me=0,ve=!1,we=!1,De=!0;if(typeof u!="function")throw new li(s);h=hi(h)||0,sn(b)&&(ve=!!b.leading,we="maxWait"in b,R=we?On(hi(b.maxWait)||0,h):R,De="trailing"in b?!!b.trailing:De);function $e(mn){var Pi=E,Io=T;return E=T=n,me=mn,j=u.apply(Io,Pi),j}function We(mn){return me=mn,U=Hd(_t,h),ve?$e(mn):j}function ft(mn){var Pi=mn-te,Io=mn-me,t3=h-Pi;return we?Kn(t3,R-Io):t3}function qe(mn){var Pi=mn-te,Io=mn-me;return te===n||Pi>=h||Pi<0||we&&Io>=R}function _t(){var mn=zg();if(qe(mn))return Et(mn);U=Hd(_t,ft(mn))}function Et(mn){return U=n,De&&E?$e(mn):(E=T=n,j)}function Gr(){U!==n&&U5(U),me=0,E=te=T=U=n}function rr(){return U===n?j:Et(zg())}function Yr(){var mn=zg(),Pi=qe(mn);if(E=arguments,T=this,te=mn,Pi){if(U===n)return We(te);if(we)return U5(U),U=Hd(_t,h),$e(te)}return U===n&&(U=Hd(_t,h)),j}return Yr.cancel=Gr,Yr.flush=rr,Yr}var Wle=ht(function(u,h){return E5(u,1,h)}),qle=ht(function(u,h,b){return E5(u,hi(h)||0,b)});function Ule(u){return ko(u,F)}function Bg(u,h){if(typeof u!="function"||h!=null&&typeof h!="function")throw new li(s);var b=function(){var E=arguments,T=h?h.apply(this,E):E[0],R=b.cache;if(R.has(T))return R.get(T);var j=u.apply(this,E);return b.cache=R.set(T,j)||R,j};return b.cache=new(Bg.Cache||Oo),b}Bg.Cache=Oo;function Vg(u){if(typeof u!="function")throw new li(s);return function(){var h=arguments;switch(h.length){case 0:return!u.call(this);case 1:return!u.call(this,h[0]);case 2:return!u.call(this,h[0],h[1]);case 3:return!u.call(this,h[0],h[1],h[2])}return!u.apply(this,h)}}function Gle(u){return AI(2,u)}var Yle=Nse(function(u,h){h=h.length==1&&rt(h[0])?rn(h[0],Wr(Ve())):rn(Bn(h,1),Wr(Ve()));var b=h.length;return ht(function(E){for(var T=-1,R=Kn(E.length,b);++T<R;)E[T]=h[T].call(this,E[T]);return Hr(u,this,E)})}),k1=ht(function(u,h){var b=ws(h,Cc(k1));return ko(u,O,n,h,b)}),$I=ht(function(u,h){var b=ws(h,Cc($I));return ko(u,k,n,h,b)}),Kle=Mo(function(u,h){return ko(u,L,n,n,n,h)});function Xle(u,h){if(typeof u!="function")throw new li(s);return h=h===n?h:lt(h),ht(u,h)}function Qle(u,h){if(typeof u!="function")throw new li(s);return h=h==null?0:On(lt(h),0),ht(function(b){var E=b[h],T=Os(b,0,h);return E&&xs(T,E),Hr(u,this,T)})}function Zle(u,h,b){var E=!0,T=!0;if(typeof u!="function")throw new li(s);return sn(b)&&(E="leading"in b?!!b.leading:E,T="trailing"in b?!!b.trailing:T),LI(u,h,{leading:E,maxWait:h,trailing:T})}function Jle(u){return TI(u,1)}function ece(u,h){return k1(f1(h),u)}function tce(){if(!arguments.length)return[];var u=arguments[0];return rt(u)?u:[u]}function nce(u){return ui(u,p)}function rce(u,h){return h=typeof h=="function"?h:n,ui(u,p,h)}function ice(u){return ui(u,f|p)}function oce(u,h){return h=typeof h=="function"?h:n,ui(u,f|p,h)}function sce(u,h){return h==null||C5(u,h,An(h))}function Oi(u,h){return u===h||u!==u&&h!==h}var ace=Ng(e1),lce=Ng(function(u,h){return u>=h}),Za=D5(function(){return arguments}())?D5:function(u){return un(u)&&Ft.call(u,"callee")&&!m5.call(u,"callee")},rt=ce.isArray,cce=QA?Wr(QA):vse;function br(u){return u!=null&&Hg(u.length)&&!To(u)}function gn(u){return un(u)&&br(u)}function uce(u){return u===!0||u===!1||un(u)&&tr(u)==ie}var Ps=Coe||j1,dce=ZA?Wr(ZA):bse;function fce(u){return un(u)&&u.nodeType===1&&!Wd(u)}function hce(u){if(u==null)return!0;if(br(u)&&(rt(u)||typeof u=="string"||typeof u.splice=="function"||Ps(u)||Ec(u)||Za(u)))return!u.length;var h=Xn(u);if(h==Fe||h==Jt)return!u.size;if(Vd(u))return!r1(u).length;for(var b in u)if(Ft.call(u,b))return!1;return!0}function pce(u,h){return jd(u,h)}function gce(u,h,b){b=typeof b=="function"?b:n;var E=b?b(u,h):n;return E===n?jd(u,h,n,b):!!E}function M1(u){if(!un(u))return!1;var h=tr(u);return h==ye||h==H||typeof u.message=="string"&&typeof u.name=="string"&&!Wd(u)}function mce(u){return typeof u=="number"&&b5(u)}function To(u){if(!sn(u))return!1;var h=tr(u);return h==oe||h==Te||h==de||h==bt}function FI(u){return typeof u=="number"&&u==lt(u)}function Hg(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=q}function sn(u){var h=typeof u;return u!=null&&(h=="object"||h=="function")}function un(u){return u!=null&&typeof u=="object"}var jI=JA?Wr(JA):xse;function vce(u,h){return u===h||n1(u,h,y1(h))}function bce(u,h,b){return b=typeof b=="function"?b:n,n1(u,h,y1(h),b)}function yce(u){return zI(u)&&u!=+u}function xce(u){if(rae(u))throw new Je(o);return T5(u)}function wce(u){return u===null}function _ce(u){return u==null}function zI(u){return typeof u=="number"||un(u)&&tr(u)==He}function Wd(u){if(!un(u)||tr(u)!=St)return!1;var h=mg(u);if(h===null)return!0;var b=Ft.call(h,"constructor")&&h.constructor;return typeof b=="function"&&b instanceof b&&fg.call(b)==boe}var D1=e5?Wr(e5):wse;function Sce(u){return FI(u)&&u>=-q&&u<=q}var BI=t5?Wr(t5):_se;function Wg(u){return typeof u=="string"||!rt(u)&&un(u)&&tr(u)==Dn}function Ur(u){return typeof u=="symbol"||un(u)&&tr(u)==fn}var Ec=n5?Wr(n5):Sse;function Cce(u){return u===n}function Ece(u){return un(u)&&Xn(u)==fe}function Oce(u){return un(u)&&tr(u)==Oe}var Pce=Ng(i1),kce=Ng(function(u,h){return u<=h});function VI(u){if(!u)return[];if(br(u))return Wg(u)?Ci(u):vr(u);if(Td&&u[Td])return soe(u[Td]());var h=Xn(u),b=h==Fe?qx:h==Jt?cg:Oc;return b(u)}function Ao(u){if(!u)return u===0?u:0;if(u=hi(u),u===G||u===-G){var h=u<0?-1:1;return h*se}return u===u?u:0}function lt(u){var h=Ao(u),b=h%1;return h===h?b?h-b:h:0}function HI(u){return u?Ya(lt(u),0,W):0}function hi(u){if(typeof u=="number")return u;if(Ur(u))return D;if(sn(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=sn(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=l5(u);var b=Me.test(u);return b||Ze.test(u)?Hie(u.slice(2),b?2:8):Ae.test(u)?D:+u}function WI(u){return eo(u,yr(u))}function Mce(u){return u?Ya(lt(u),-q,q):u===0?u:0}function Lt(u){return u==null?"":qr(u)}var Dce=_c(function(u,h){if(Vd(h)||br(h)){eo(h,An(h),u);return}for(var b in h)Ft.call(h,b)&&Ld(u,b,h[b])}),qI=_c(function(u,h){eo(h,yr(h),u)}),qg=_c(function(u,h,b,E){eo(h,yr(h),u,E)}),Tce=_c(function(u,h,b,E){eo(h,An(h),u,E)}),Ace=Mo(Qx);function Ice(u,h){var b=wc(u);return h==null?b:S5(b,h)}var Nce=ht(function(u,h){u=Bt(u);var b=-1,E=h.length,T=E>2?h[2]:n;for(T&&nr(h[0],h[1],T)&&(E=1);++b<E;)for(var R=h[b],j=yr(R),U=-1,te=j.length;++U<te;){var me=j[U],ve=u[me];(ve===n||Oi(ve,bc[me])&&!Ft.call(u,me))&&(u[me]=R[me])}return u}),Rce=ht(function(u){return u.push(n,lI),Hr(UI,n,u)});function Lce(u,h){return i5(u,Ve(h,3),Ji)}function $ce(u,h){return i5(u,Ve(h,3),Jx)}function Fce(u,h){return u==null?u:Zx(u,Ve(h,3),yr)}function jce(u,h){return u==null?u:k5(u,Ve(h,3),yr)}function zce(u,h){return u&&Ji(u,Ve(h,3))}function Bce(u,h){return u&&Jx(u,Ve(h,3))}function Vce(u){return u==null?[]:Og(u,An(u))}function Hce(u){return u==null?[]:Og(u,yr(u))}function T1(u,h,b){var E=u==null?n:Ka(u,h);return E===n?b:E}function Wce(u,h){return u!=null&&dI(u,h,hse)}function A1(u,h){return u!=null&&dI(u,h,pse)}var qce=rI(function(u,h,b){h!=null&&typeof h.toString!="function"&&(h=hg.call(h)),u[h]=b},N1(xr)),Uce=rI(function(u,h,b){h!=null&&typeof h.toString!="function"&&(h=hg.call(h)),Ft.call(u,h)?u[h].push(b):u[h]=[b]},Ve),Gce=ht(Fd);function An(u){return br(u)?w5(u):r1(u)}function yr(u){return br(u)?w5(u,!0):Cse(u)}function Yce(u,h){var b={};return h=Ve(h,3),Ji(u,function(E,T,R){Po(b,h(E,T,R),E)}),b}function Kce(u,h){var b={};return h=Ve(h,3),Ji(u,function(E,T,R){Po(b,T,h(E,T,R))}),b}var Xce=_c(function(u,h,b){Pg(u,h,b)}),UI=_c(function(u,h,b,E){Pg(u,h,b,E)}),Qce=Mo(function(u,h){var b={};if(u==null)return b;var E=!1;h=rn(h,function(R){return R=Es(R,u),E||(E=R.length>1),R}),eo(u,v1(u),b),E&&(b=ui(b,f|g|p,qse));for(var T=h.length;T--;)c1(b,h[T]);return b});function Zce(u,h){return GI(u,Vg(Ve(h)))}var Jce=Mo(function(u,h){return u==null?{}:Ose(u,h)});function GI(u,h){if(u==null)return{};var b=rn(v1(u),function(E){return[E]});return h=Ve(h),F5(u,b,function(E,T){return h(E,T[0])})}function eue(u,h,b){h=Es(h,u);var E=-1,T=h.length;for(T||(T=1,u=n);++E<T;){var R=u==null?n:u[to(h[E])];R===n&&(E=T,R=b),u=To(R)?R.call(u):R}return u}function tue(u,h,b){return u==null?u:zd(u,h,b)}function nue(u,h,b,E){return E=typeof E=="function"?E:n,u==null?u:zd(u,h,b,E)}var YI=sI(An),KI=sI(yr);function rue(u,h,b){var E=rt(u),T=E||Ps(u)||Ec(u);if(h=Ve(h,4),b==null){var R=u&&u.constructor;T?b=E?new R:[]:sn(u)?b=To(R)?wc(mg(u)):{}:b={}}return(T?ai:Ji)(u,function(j,U,te){return h(b,j,U,te)}),b}function iue(u,h){return u==null?!0:c1(u,h)}function oue(u,h,b){return u==null?u:H5(u,h,f1(b))}function sue(u,h,b,E){return E=typeof E=="function"?E:n,u==null?u:H5(u,h,f1(b),E)}function Oc(u){return u==null?[]:Wx(u,An(u))}function aue(u){return u==null?[]:Wx(u,yr(u))}function lue(u,h,b){return b===n&&(b=h,h=n),b!==n&&(b=hi(b),b=b===b?b:0),h!==n&&(h=hi(h),h=h===h?h:0),Ya(hi(u),h,b)}function cue(u,h,b){return h=Ao(h),b===n?(b=h,h=0):b=Ao(b),u=hi(u),gse(u,h,b)}function uue(u,h,b){if(b&&typeof b!="boolean"&&nr(u,h,b)&&(h=b=n),b===n&&(typeof h=="boolean"?(b=h,h=n):typeof u=="boolean"&&(b=u,u=n)),u===n&&h===n?(u=0,h=1):(u=Ao(u),h===n?(h=u,u=0):h=Ao(h)),u>h){var E=u;u=h,h=E}if(b||u%1||h%1){var T=y5();return Kn(u+T*(h-u+Vie("1e-"+((T+"").length-1))),h)}return s1(u,h)}var due=Sc(function(u,h,b){return h=h.toLowerCase(),u+(b?XI(h):h)});function XI(u){return I1(Lt(u).toLowerCase())}function QI(u){return u=Lt(u),u&&u.replace(zt,toe).replace(Aie,"")}function fue(u,h,b){u=Lt(u),h=qr(h);var E=u.length;b=b===n?E:Ya(lt(b),0,E);var T=b;return b-=h.length,b>=0&&u.slice(b,T)==h}function hue(u){return u=Lt(u),u&&La.test(u)?u.replace(Zi,noe):u}function pue(u){return u=Lt(u),u&&Ba.test(u)?u.replace(za,"\\$&"):u}var gue=Sc(function(u,h,b){return u+(b?"-":"")+h.toLowerCase()}),mue=Sc(function(u,h,b){return u+(b?" ":"")+h.toLowerCase()}),vue=eI("toLowerCase");function bue(u,h,b){u=Lt(u),h=lt(h);var E=h?mc(u):0;if(!h||E>=h)return u;var T=(h-E)/2;return Ig(xg(T),b)+u+Ig(yg(T),b)}function yue(u,h,b){u=Lt(u),h=lt(h);var E=h?mc(u):0;return h&&E<h?u+Ig(h-E,b):u}function xue(u,h,b){u=Lt(u),h=lt(h);var E=h?mc(u):0;return h&&E<h?Ig(h-E,b)+u:u}function wue(u,h,b){return b||h==null?h=0:h&&(h=+h),koe(Lt(u).replace(Va,""),h||0)}function _ue(u,h,b){return(b?nr(u,h,b):h===n)?h=1:h=lt(h),a1(Lt(u),h)}function Sue(){var u=arguments,h=Lt(u[0]);return u.length<3?h:h.replace(u[1],u[2])}var Cue=Sc(function(u,h,b){return u+(b?"_":"")+h.toLowerCase()});function Eue(u,h,b){return b&&typeof b!="number"&&nr(u,h,b)&&(h=b=n),b=b===n?W:b>>>0,b?(u=Lt(u),u&&(typeof h=="string"||h!=null&&!D1(h))&&(h=qr(h),!h&&gc(u))?Os(Ci(u),0,b):u.split(h,b)):[]}var Oue=Sc(function(u,h,b){return u+(b?" ":"")+I1(h)});function Pue(u,h,b){return u=Lt(u),b=b==null?0:Ya(lt(b),0,u.length),h=qr(h),u.slice(b,b+h.length)==h}function kue(u,h,b){var E=I.templateSettings;b&&nr(u,h,b)&&(h=n),u=Lt(u),h=qg({},h,E,aI);var T=qg({},h.imports,E.imports,aI),R=An(T),j=Wx(T,R),U,te,me=0,ve=h.interpolate||Tn,we="__p += '",De=Ux((h.escape||Tn).source+"|"+ve.source+"|"+(ve===fc?Re:Tn).source+"|"+(h.evaluate||Tn).source+"|$","g"),$e="//# sourceURL="+(Ft.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$ie+"]")+`
|
|
69
|
+
`;u.replace(De,function(qe,_t,Et,Gr,rr,Yr){return Et||(Et=Gr),we+=u.slice(me,Yr).replace(Ha,roe),_t&&(U=!0,we+=`' +
|
|
70
|
+
__e(`+_t+`) +
|
|
71
|
+
'`),rr&&(te=!0,we+=`';
|
|
72
|
+
`+rr+`;
|
|
73
|
+
__p += '`),Et&&(we+=`' +
|
|
74
|
+
((__t = (`+Et+`)) == null ? '' : __t) +
|
|
75
|
+
'`),me=Yr+qe.length,qe}),we+=`';
|
|
76
|
+
`;var We=Ft.call(h,"variable")&&h.variable;if(!We)we=`with (obj) {
|
|
77
|
+
`+we+`
|
|
78
|
+
}
|
|
79
|
+
`;else if(ae.test(We))throw new Je(a);we=(te?we.replace(Cd,""):we).replace(So,"$1").replace(Ra,"$1;"),we="function("+(We||"obj")+`) {
|
|
80
|
+
`+(We?"":`obj || (obj = {});
|
|
81
|
+
`)+"var __t, __p = ''"+(U?", __e = _.escape":"")+(te?`, __j = Array.prototype.join;
|
|
82
|
+
function print() { __p += __j.call(arguments, '') }
|
|
83
|
+
`:`;
|
|
84
|
+
`)+we+`return __p
|
|
85
|
+
}`;var ft=JI(function(){return Tt(R,$e+"return "+we).apply(n,j)});if(ft.source=we,M1(ft))throw ft;return ft}function Mue(u){return Lt(u).toLowerCase()}function Due(u){return Lt(u).toUpperCase()}function Tue(u,h,b){if(u=Lt(u),u&&(b||h===n))return l5(u);if(!u||!(h=qr(h)))return u;var E=Ci(u),T=Ci(h),R=c5(E,T),j=u5(E,T)+1;return Os(E,R,j).join("")}function Aue(u,h,b){if(u=Lt(u),u&&(b||h===n))return u.slice(0,f5(u)+1);if(!u||!(h=qr(h)))return u;var E=Ci(u),T=u5(E,Ci(h))+1;return Os(E,0,T).join("")}function Iue(u,h,b){if(u=Lt(u),u&&(b||h===n))return u.replace(Va,"");if(!u||!(h=qr(h)))return u;var E=Ci(u),T=c5(E,Ci(h));return Os(E,T).join("")}function Nue(u,h){var b=z,E=B;if(sn(h)){var T="separator"in h?h.separator:T;b="length"in h?lt(h.length):b,E="omission"in h?qr(h.omission):E}u=Lt(u);var R=u.length;if(gc(u)){var j=Ci(u);R=j.length}if(b>=R)return u;var U=b-mc(E);if(U<1)return E;var te=j?Os(j,0,U).join(""):u.slice(0,U);if(T===n)return te+E;if(j&&(U+=te.length-U),D1(T)){if(u.slice(U).search(T)){var me,ve=te;for(T.global||(T=Ux(T.source,Lt(je.exec(T))+"g")),T.lastIndex=0;me=T.exec(ve);)var we=me.index;te=te.slice(0,we===n?U:we)}}else if(u.indexOf(qr(T),U)!=U){var De=te.lastIndexOf(T);De>-1&&(te=te.slice(0,De))}return te+E}function Rue(u){return u=Lt(u),u&&Co.test(u)?u.replace(Yn,uoe):u}var Lue=Sc(function(u,h,b){return u+(b?" ":"")+h.toUpperCase()}),I1=eI("toUpperCase");function ZI(u,h,b){return u=Lt(u),h=b?n:h,h===n?ooe(u)?hoe(u):Xie(u):u.match(h)||[]}var JI=ht(function(u,h){try{return Hr(u,n,h)}catch(b){return M1(b)?b:new Je(b)}}),$ue=Mo(function(u,h){return ai(h,function(b){b=to(b),Po(u,b,P1(u[b],u))}),u});function Fue(u){var h=u==null?0:u.length,b=Ve();return u=h?rn(u,function(E){if(typeof E[1]!="function")throw new li(s);return[b(E[0]),E[1]]}):[],ht(function(E){for(var T=-1;++T<h;){var R=u[T];if(Hr(R[0],this,E))return Hr(R[1],this,E)}})}function jue(u){return use(ui(u,f))}function N1(u){return function(){return u}}function zue(u,h){return u==null||u!==u?h:u}var Bue=nI(),Vue=nI(!0);function xr(u){return u}function R1(u){return A5(typeof u=="function"?u:ui(u,f))}function Hue(u){return N5(ui(u,f))}function Wue(u,h){return R5(u,ui(h,f))}var que=ht(function(u,h){return function(b){return Fd(b,u,h)}}),Uue=ht(function(u,h){return function(b){return Fd(u,b,h)}});function L1(u,h,b){var E=An(h),T=Og(h,E);b==null&&!(sn(h)&&(T.length||!E.length))&&(b=h,h=u,u=this,T=Og(h,An(h)));var R=!(sn(b)&&"chain"in b)||!!b.chain,j=To(u);return ai(T,function(U){var te=h[U];u[U]=te,j&&(u.prototype[U]=function(){var me=this.__chain__;if(R||me){var ve=u(this.__wrapped__),we=ve.__actions__=vr(this.__actions__);return we.push({func:te,args:arguments,thisArg:u}),ve.__chain__=me,ve}return te.apply(u,xs([this.value()],arguments))})}),u}function Gue(){return zn._===this&&(zn._=yoe),this}function $1(){}function Yue(u){return u=lt(u),ht(function(h){return L5(h,u)})}var Kue=p1(rn),Xue=p1(r5),Que=p1(jx);function e3(u){return w1(u)?zx(to(u)):Pse(u)}function Zue(u){return function(h){return u==null?n:Ka(u,h)}}var Jue=iI(),ede=iI(!0);function F1(){return[]}function j1(){return!1}function tde(){return{}}function nde(){return""}function rde(){return!0}function ide(u,h){if(u=lt(u),u<1||u>q)return[];var b=W,E=Kn(u,W);h=Ve(h),u-=W;for(var T=Hx(E,h);++b<u;)h(b);return T}function ode(u){return rt(u)?rn(u,to):Ur(u)?[u]:vr(xI(Lt(u)))}function sde(u){var h=++voe;return Lt(u)+h}var ade=Ag(function(u,h){return u+h},0),lde=g1("ceil"),cde=Ag(function(u,h){return u/h},1),ude=g1("floor");function dde(u){return u&&u.length?Eg(u,xr,e1):n}function fde(u,h){return u&&u.length?Eg(u,Ve(h,2),e1):n}function hde(u){return s5(u,xr)}function pde(u,h){return s5(u,Ve(h,2))}function gde(u){return u&&u.length?Eg(u,xr,i1):n}function mde(u,h){return u&&u.length?Eg(u,Ve(h,2),i1):n}var vde=Ag(function(u,h){return u*h},1),bde=g1("round"),yde=Ag(function(u,h){return u-h},0);function xde(u){return u&&u.length?Vx(u,xr):0}function wde(u,h){return u&&u.length?Vx(u,Ve(h,2)):0}return I.after=Hle,I.ary=TI,I.assign=Dce,I.assignIn=qI,I.assignInWith=qg,I.assignWith=Tce,I.at=Ace,I.before=AI,I.bind=P1,I.bindAll=$ue,I.bindKey=II,I.castArray=tce,I.chain=kI,I.chunk=uae,I.compact=dae,I.concat=fae,I.cond=Fue,I.conforms=jue,I.constant=N1,I.countBy=xle,I.create=Ice,I.curry=NI,I.curryRight=RI,I.debounce=LI,I.defaults=Nce,I.defaultsDeep=Rce,I.defer=Wle,I.delay=qle,I.difference=hae,I.differenceBy=pae,I.differenceWith=gae,I.drop=mae,I.dropRight=vae,I.dropRightWhile=bae,I.dropWhile=yae,I.fill=xae,I.filter=_le,I.flatMap=Ele,I.flatMapDeep=Ole,I.flatMapDepth=Ple,I.flatten=CI,I.flattenDeep=wae,I.flattenDepth=_ae,I.flip=Ule,I.flow=Bue,I.flowRight=Vue,I.fromPairs=Sae,I.functions=Vce,I.functionsIn=Hce,I.groupBy=kle,I.initial=Eae,I.intersection=Oae,I.intersectionBy=Pae,I.intersectionWith=kae,I.invert=qce,I.invertBy=Uce,I.invokeMap=Dle,I.iteratee=R1,I.keyBy=Tle,I.keys=An,I.keysIn=yr,I.map=jg,I.mapKeys=Yce,I.mapValues=Kce,I.matches=Hue,I.matchesProperty=Wue,I.memoize=Bg,I.merge=Xce,I.mergeWith=UI,I.method=que,I.methodOf=Uue,I.mixin=L1,I.negate=Vg,I.nthArg=Yue,I.omit=Qce,I.omitBy=Zce,I.once=Gle,I.orderBy=Ale,I.over=Kue,I.overArgs=Yle,I.overEvery=Xue,I.overSome=Que,I.partial=k1,I.partialRight=$I,I.partition=Ile,I.pick=Jce,I.pickBy=GI,I.property=e3,I.propertyOf=Zue,I.pull=Aae,I.pullAll=OI,I.pullAllBy=Iae,I.pullAllWith=Nae,I.pullAt=Rae,I.range=Jue,I.rangeRight=ede,I.rearg=Kle,I.reject=Lle,I.remove=Lae,I.rest=Xle,I.reverse=E1,I.sampleSize=Fle,I.set=tue,I.setWith=nue,I.shuffle=jle,I.slice=$ae,I.sortBy=Vle,I.sortedUniq=Wae,I.sortedUniqBy=qae,I.split=Eue,I.spread=Qle,I.tail=Uae,I.take=Gae,I.takeRight=Yae,I.takeRightWhile=Kae,I.takeWhile=Xae,I.tap=dle,I.throttle=Zle,I.thru=Fg,I.toArray=VI,I.toPairs=YI,I.toPairsIn=KI,I.toPath=ode,I.toPlainObject=WI,I.transform=rue,I.unary=Jle,I.union=Qae,I.unionBy=Zae,I.unionWith=Jae,I.uniq=ele,I.uniqBy=tle,I.uniqWith=nle,I.unset=iue,I.unzip=O1,I.unzipWith=PI,I.update=oue,I.updateWith=sue,I.values=Oc,I.valuesIn=aue,I.without=rle,I.words=ZI,I.wrap=ece,I.xor=ile,I.xorBy=ole,I.xorWith=sle,I.zip=ale,I.zipObject=lle,I.zipObjectDeep=cle,I.zipWith=ule,I.entries=YI,I.entriesIn=KI,I.extend=qI,I.extendWith=qg,L1(I,I),I.add=ade,I.attempt=JI,I.camelCase=due,I.capitalize=XI,I.ceil=lde,I.clamp=lue,I.clone=nce,I.cloneDeep=ice,I.cloneDeepWith=oce,I.cloneWith=rce,I.conformsTo=sce,I.deburr=QI,I.defaultTo=zue,I.divide=cde,I.endsWith=fue,I.eq=Oi,I.escape=hue,I.escapeRegExp=pue,I.every=wle,I.find=Sle,I.findIndex=_I,I.findKey=Lce,I.findLast=Cle,I.findLastIndex=SI,I.findLastKey=$ce,I.floor=ude,I.forEach=MI,I.forEachRight=DI,I.forIn=Fce,I.forInRight=jce,I.forOwn=zce,I.forOwnRight=Bce,I.get=T1,I.gt=ace,I.gte=lce,I.has=Wce,I.hasIn=A1,I.head=EI,I.identity=xr,I.includes=Mle,I.indexOf=Cae,I.inRange=cue,I.invoke=Gce,I.isArguments=Za,I.isArray=rt,I.isArrayBuffer=cce,I.isArrayLike=br,I.isArrayLikeObject=gn,I.isBoolean=uce,I.isBuffer=Ps,I.isDate=dce,I.isElement=fce,I.isEmpty=hce,I.isEqual=pce,I.isEqualWith=gce,I.isError=M1,I.isFinite=mce,I.isFunction=To,I.isInteger=FI,I.isLength=Hg,I.isMap=jI,I.isMatch=vce,I.isMatchWith=bce,I.isNaN=yce,I.isNative=xce,I.isNil=_ce,I.isNull=wce,I.isNumber=zI,I.isObject=sn,I.isObjectLike=un,I.isPlainObject=Wd,I.isRegExp=D1,I.isSafeInteger=Sce,I.isSet=BI,I.isString=Wg,I.isSymbol=Ur,I.isTypedArray=Ec,I.isUndefined=Cce,I.isWeakMap=Ece,I.isWeakSet=Oce,I.join=Mae,I.kebabCase=gue,I.last=fi,I.lastIndexOf=Dae,I.lowerCase=mue,I.lowerFirst=vue,I.lt=Pce,I.lte=kce,I.max=dde,I.maxBy=fde,I.mean=hde,I.meanBy=pde,I.min=gde,I.minBy=mde,I.stubArray=F1,I.stubFalse=j1,I.stubObject=tde,I.stubString=nde,I.stubTrue=rde,I.multiply=vde,I.nth=Tae,I.noConflict=Gue,I.noop=$1,I.now=zg,I.pad=bue,I.padEnd=yue,I.padStart=xue,I.parseInt=wue,I.random=uue,I.reduce=Nle,I.reduceRight=Rle,I.repeat=_ue,I.replace=Sue,I.result=eue,I.round=bde,I.runInContext=Q,I.sample=$le,I.size=zle,I.snakeCase=Cue,I.some=Ble,I.sortedIndex=Fae,I.sortedIndexBy=jae,I.sortedIndexOf=zae,I.sortedLastIndex=Bae,I.sortedLastIndexBy=Vae,I.sortedLastIndexOf=Hae,I.startCase=Oue,I.startsWith=Pue,I.subtract=yde,I.sum=xde,I.sumBy=wde,I.template=kue,I.times=ide,I.toFinite=Ao,I.toInteger=lt,I.toLength=HI,I.toLower=Mue,I.toNumber=hi,I.toSafeInteger=Mce,I.toString=Lt,I.toUpper=Due,I.trim=Tue,I.trimEnd=Aue,I.trimStart=Iue,I.truncate=Nue,I.unescape=Rue,I.uniqueId=sde,I.upperCase=Lue,I.upperFirst=I1,I.each=MI,I.eachRight=DI,I.first=EI,L1(I,function(){var u={};return Ji(I,function(h,b){Ft.call(I.prototype,b)||(u[b]=h)}),u}(),{chain:!1}),I.VERSION=r,ai(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){I[u].placeholder=I}),ai(["drop","take"],function(u,h){Ct.prototype[u]=function(b){b=b===n?1:On(lt(b),0);var E=this.__filtered__&&!h?new Ct(this):this.clone();return E.__filtered__?E.__takeCount__=Kn(b,E.__takeCount__):E.__views__.push({size:Kn(b,W),type:u+(E.__dir__<0?"Right":"")}),E},Ct.prototype[u+"Right"]=function(b){return this.reverse()[u](b).reverse()}}),ai(["filter","map","takeWhile"],function(u,h){var b=h+1,E=b==K||b==J;Ct.prototype[u]=function(T){var R=this.clone();return R.__iteratees__.push({iteratee:Ve(T,3),type:b}),R.__filtered__=R.__filtered__||E,R}}),ai(["head","last"],function(u,h){var b="take"+(h?"Right":"");Ct.prototype[u]=function(){return this[b](1).value()[0]}}),ai(["initial","tail"],function(u,h){var b="drop"+(h?"":"Right");Ct.prototype[u]=function(){return this.__filtered__?new Ct(this):this[b](1)}}),Ct.prototype.compact=function(){return this.filter(xr)},Ct.prototype.find=function(u){return this.filter(u).head()},Ct.prototype.findLast=function(u){return this.reverse().find(u)},Ct.prototype.invokeMap=ht(function(u,h){return typeof u=="function"?new Ct(this):this.map(function(b){return Fd(b,u,h)})}),Ct.prototype.reject=function(u){return this.filter(Vg(Ve(u)))},Ct.prototype.slice=function(u,h){u=lt(u);var b=this;return b.__filtered__&&(u>0||h<0)?new Ct(b):(u<0?b=b.takeRight(-u):u&&(b=b.drop(u)),h!==n&&(h=lt(h),b=h<0?b.dropRight(-h):b.take(h-u)),b)},Ct.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Ct.prototype.toArray=function(){return this.take(W)},Ji(Ct.prototype,function(u,h){var b=/^(?:filter|find|map|reject)|While$/.test(h),E=/^(?:head|last)$/.test(h),T=I[E?"take"+(h=="last"?"Right":""):h],R=E||/^find/.test(h);T&&(I.prototype[h]=function(){var j=this.__wrapped__,U=E?[1]:arguments,te=j instanceof Ct,me=U[0],ve=te||rt(j),we=function(_t){var Et=T.apply(I,xs([_t],U));return E&&De?Et[0]:Et};ve&&b&&typeof me=="function"&&me.length!=1&&(te=ve=!1);var De=this.__chain__,$e=!!this.__actions__.length,We=R&&!De,ft=te&&!$e;if(!R&&ve){j=ft?j:new Ct(this);var qe=u.apply(j,U);return qe.__actions__.push({func:Fg,args:[we],thisArg:n}),new ci(qe,De)}return We&&ft?u.apply(this,U):(qe=this.thru(we),We?E?qe.value()[0]:qe.value():qe)})}),ai(["pop","push","shift","sort","splice","unshift"],function(u){var h=ug[u],b=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",E=/^(?:pop|shift)$/.test(u);I.prototype[u]=function(){var T=arguments;if(E&&!this.__chain__){var R=this.value();return h.apply(rt(R)?R:[],T)}return this[b](function(j){return h.apply(rt(j)?j:[],T)})}}),Ji(Ct.prototype,function(u,h){var b=I[h];if(b){var E=b.name+"";Ft.call(xc,E)||(xc[E]=[]),xc[E].push({name:h,func:b})}}),xc[Tg(n,w).name]=[{name:"wrapper",func:n}],Ct.prototype.clone=Roe,Ct.prototype.reverse=Loe,Ct.prototype.value=$oe,I.prototype.at=fle,I.prototype.chain=hle,I.prototype.commit=ple,I.prototype.next=gle,I.prototype.plant=vle,I.prototype.reverse=ble,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=yle,I.prototype.first=I.prototype.head,Td&&(I.prototype[Td]=mle),I},vc=poe();Wa?((Wa.exports=vc)._=vc,Rx._=vc):zn._=vc}).call(Ro)}(af,af.exports);var GN=af.exports;const Rs=Pc(GN),YN={theme:"system",setTheme:()=>null},Gw=m.createContext(YN);function KN({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),i==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(i)},[i]);const s={theme:i,setTheme:a=>{localStorage.setItem(n,a),o(a)}};return _.jsx(Gw.Provider,{...r,value:s,children:e})}const Cm=()=>{const e=m.useContext(Gw);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function XN(e,t){return await(await fetch(`https://semaphor.cloud/api/v1/dashboard?id=${e}`,{headers:{Authorization:`Bearer ${t}`}})).json()}function Yw(e,t){return e==="dark"?Rs.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function QN(e,t,n,r,i,o){const{data:s,refetch:a,isLoading:l,isError:c}=Sr({queryKey:[e],queryFn:()=>XN(e,t==null?void 0:t.accessToken),enabled:!1}),{theme:d,setTheme:f}=Cm(),{setDashboard:g,setSelectedSheetId:p,setStyle:v,setOnSaveFunction:y}=be(P=>P.actions),x=be(P=>P.actions.setAuthToken),w=be(P=>P.actions.setThemeStyle),S=be(P=>P.actions.setDashboardTheme),C=be(P=>P.actions.setOnEvent);return m.useEffect(()=>{d&&S(d)},[d,S]),m.useEffect(()=>{r&&f(r)},[r,f]),m.useEffect(()=>{const P=Rs.cloneDeep(gm);if(n){const O=Rs.merge(P,n),k=Yw(d,O);w(k),v(O)}else{const O=Yw(d,P);w(O),v(gm)}},[d,n,v]),m.useEffect(()=>{var O;if(!s||!s.dashboard)return;const P=s.dashboard;g(P),p((O=P.sheets)==null?void 0:O[0].id)},[s,g,p]),m.useEffect(()=>{i&&y(i),o&&C(o)},[i,y,o,C]),m.useEffect(()=>{t&&t.accessToken&&(x(t),a())},[t,a,x]),{isLoading:l,isError:c}}function lf({className:e,...t}){return _.jsx("div",{className:Pe("animate-pulse rounded-md bg-muted",e),...t})}function Kw({className:e,style:t,onSave:n,onEvent:r,LoadingComponent:i,ErrorComponent:o,id:s,authToken:a,currentTheme:l,...c}){be(v=>v.selectedSheetId);const d=be(v=>v.themeStyle),f=be(v=>v.onEvent),{isLoading:g,isError:p}=QN(s,a,t,l,n,r);return g||!a?(f==null||f({type:"info",message:`isLoading: ${g}, accessToken: ${a==null?void 0:a.accessToken}`}),i?_.jsx(i,{message:"loading"}):_.jsx("div",{className:" flex items-center gap-3",children:_.jsx(lf,{className:"dark:h-[2px] h-1 w-full"})})):p?(f==null||f({type:"error",message:"Error fetching dashboard"}),o?(console.log("Error fetching dashboard"),_.jsx(o,{})):_.jsx("div",{children:"Error"})):_.jsx("div",{className:Pe(" h-full flex flex-col justify-between",d==null?void 0:d.dashboardPanel,e),role:"dashboard-panel",...c})}function le(){return le=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},le.apply(this,arguments)}function Ce(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Pn(e,t=[]){let n=[];function r(o,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:g,children:p,...v}=f,y=(g==null?void 0:g[e][l])||a,x=m.useMemo(()=>v,Object.values(v));return m.createElement(y.Provider,{value:x},p)}function d(f,g){const p=(g==null?void 0:g[e][l])||a,v=m.useContext(p);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,d]}const i=()=>{const o=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,ZN(i,...t)]}function ZN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function JN(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function cf(...e){return t=>e.forEach(n=>JN(n,t))}function et(...e){return m.useCallback(cf(...e),e)}const no=m.forwardRef((e,t)=>{const{children:n,...r}=e,i=m.Children.toArray(n),o=i.find(eR);if(o){const s=o.props.children,a=i.map(l=>l===o?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(Em,le({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Em,le({},r,{ref:t}),n)});no.displayName="Slot";const Em=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...tR(r,n.props),ref:t?cf(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Em.displayName="SlotClone";const Xw=({children:e})=>m.createElement(m.Fragment,null,e);function eR(e){return m.isValidElement(e)&&e.type===Xw}function tR(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function uf(e){const t=e+"CollectionProvider",[n,r]=Pn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:y}=p,x=m.useRef(null),w=m.useRef(new Map).current;return m.createElement(i,{scope:v,itemMap:w,collectionRef:x},y)},a=e+"CollectionSlot",l=m.forwardRef((p,v)=>{const{scope:y,children:x}=p,w=o(a,y),S=et(v,w.collectionRef);return m.createElement(no,{ref:S},x)}),c=e+"CollectionItemSlot",d="data-radix-collection-item",f=m.forwardRef((p,v)=>{const{scope:y,children:x,...w}=p,S=m.useRef(null),C=et(v,S),P=o(c,y);return m.useEffect(()=>(P.itemMap.set(S,{ref:S,...w}),()=>void P.itemMap.delete(S))),m.createElement(no,{[d]:"",ref:C},x)});function g(p){const v=o(e+"CollectionConsumer",p);return m.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((P,O)=>w.indexOf(P.ref.current)-w.indexOf(O.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},g,r]}const Vn=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},nR=ue.useId||(()=>{});let rR=0;function or(e){const[t,n]=ue.useState(nR());return Vn(()=>{e||n(r=>r??String(rR++))},[e]),e||(t?`radix-${t}`:"")}const Be=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=m.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?no:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,le({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Qw(e,t){e&&kt.flushSync(()=>e.dispatchEvent(t))}function xn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Qn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=iR({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=xn(n),l=m.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else i(c)},[o,e,i,a]);return[s,l]}function iR({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,i=m.useRef(r),o=xn(t);return m.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const oR=m.createContext(void 0);function Ls(e){const t=m.useContext(oR);return e||t||"ltr"}const Om="rovingFocusGroup.onEntryFocus",sR={bubbles:!1,cancelable:!0},Pm="RovingFocusGroup",[km,Zw,aR]=uf(Pm),[lR,il]=Pn(Pm,[aR]),[cR,uR]=lR(Pm),dR=m.forwardRef((e,t)=>m.createElement(km.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(km.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(fR,le({},e,{ref:t}))))),fR=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...d}=e,f=m.useRef(null),g=et(t,f),p=Ls(o),[v=null,y]=Qn({prop:s,defaultProp:a,onChange:l}),[x,w]=m.useState(!1),S=xn(c),C=Zw(n),P=m.useRef(!1),[O,k]=m.useState(0);return m.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(Om,S),()=>A.removeEventListener(Om,S)},[S]),m.createElement(cR,{scope:n,orientation:r,dir:p,loop:i,currentTabStopId:v,onItemFocus:m.useCallback(A=>y(A),[y]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>k(A=>A+1),[]),onFocusableItemRemove:m.useCallback(()=>k(A=>A-1),[])},m.createElement(Be.div,le({tabIndex:x||O===0?-1:0,"data-orientation":r},d,{ref:g,style:{outline:"none",...e.style},onMouseDown:Ce(e.onMouseDown,()=>{P.current=!0}),onFocus:Ce(e.onFocus,A=>{const L=!P.current;if(A.target===A.currentTarget&&L&&!x){const F=new CustomEvent(Om,sR);if(A.currentTarget.dispatchEvent(F),!F.defaultPrevented){const z=C().filter($=>$.focusable),B=z.find($=>$.active),V=z.find($=>$.id===v),K=[B,V,...z].filter(Boolean).map($=>$.ref.current);Jw(K)}}P.current=!1}),onBlur:Ce(e.onBlur,()=>w(!1))})))}),hR="RovingFocusGroupItem",pR=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=or(),l=o||a,c=uR(hR,n),d=c.currentTabStopId===l,f=Zw(n),{onFocusableItemAdd:g,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return g(),()=>p()},[r,g,p]),m.createElement(km.ItemSlot,{scope:n,id:l,focusable:r,active:i},m.createElement(Be.span,le({tabIndex:d?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Ce(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Ce(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Ce(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=vR(v,c.orientation,c.dir);if(y!==void 0){v.preventDefault();let w=f().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const S=w.indexOf(v.currentTarget);w=c.loop?bR(w,S+1):w.slice(S+1)}setTimeout(()=>Jw(w))}})})))}),gR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mR(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function vR(e,t,n){const r=mR(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return gR[r]}function Jw(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function bR(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Mm=dR,Dm=pR;function yR(e,t){return m.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const vn=e=>{const{present:t,children:n}=e,r=xR(t),i=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=et(r.ref,i.ref);return typeof n=="function"||r.isPresent?m.cloneElement(i,{ref:o}):null};vn.displayName="Presence";function xR(e){const[t,n]=m.useState(),r=m.useRef({}),i=m.useRef(e),o=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=yR(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=df(r.current);o.current=a==="mounted"?c:"none"},[a]),Vn(()=>{const c=r.current,d=i.current;if(d!==e){const g=o.current,p=df(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&g!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Vn(()=>{if(t){const c=f=>{const p=df(r.current).includes(f.animationName);f.target===t&&p&&kt.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(o.current=df(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function df(e){return(e==null?void 0:e.animationName)||"none"}const e_="Tabs",[wR,Ode]=Pn(e_,[il]),t_=il(),[_R,Tm]=wR(e_),SR=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,d=Ls(a),[f,g]=Qn({prop:r,onChange:i,defaultProp:o});return m.createElement(_R,{scope:n,baseId:or(),value:f,onValueChange:g,orientation:s,dir:d,activationMode:l},m.createElement(Be.div,le({dir:d,"data-orientation":s},c,{ref:t})))}),CR="TabsList",ER=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Tm(CR,n),s=t_(n);return m.createElement(Mm,le({asChild:!0},s,{orientation:o.orientation,dir:o.dir,loop:r}),m.createElement(Be.div,le({role:"tablist","aria-orientation":o.orientation},i,{ref:t})))}),OR="TabsTrigger",PR=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=Tm(OR,n),a=t_(n),l=n_(s.baseId,r),c=r_(s.baseId,r),d=r===s.value;return m.createElement(Dm,le({asChild:!0},a,{focusable:!i,active:d}),m.createElement(Be.button,le({type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},o,{ref:t,onMouseDown:Ce(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Ce(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Ce(e.onFocus,()=>{const f=s.activationMode!=="manual";!d&&!i&&f&&s.onValueChange(r)})})))}),kR="TabsContent",MR=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=Tm(kR,n),l=n_(a.baseId,r),c=r_(a.baseId,r),d=r===a.value,f=m.useRef(d);return m.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),m.createElement(vn,{present:i||d},({present:g})=>m.createElement(Be.div,le({"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!g,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),g&&o))});function n_(e,t){return`${e}-trigger-${t}`}function r_(e,t){return`${e}-content-${t}`}const DR=SR,i_=ER,o_=PR,s_=MR,a_=DR,l_=ue.forwardRef(({className:e,...t},n)=>_.jsx(i_,{ref:n,className:Pe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));l_.displayName=i_.displayName;const Am=ue.forwardRef(({className:e,...t},n)=>_.jsx(o_,{ref:n,className:Pe("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}));Am.displayName=o_.displayName;const ff=ue.forwardRef(({className:e,...t},n)=>_.jsx(s_,{ref:n,className:Pe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ff.displayName=s_.displayName;var c_={exports:{}},Fc={},Im={exports:{}};(function(e,t){(function(n,r){r(t)})(Ro,function(n){function r(ie){return function(H,ye,oe,Te,Fe,He,Ke){return ie(H,ye,Ke)}}function i(ie){return function(H,ye,oe,Te){if(!H||!ye||typeof H!="object"||typeof ye!="object")return ie(H,ye,oe,Te);var Fe=Te.get(H),He=Te.get(ye);if(Fe&&He)return Fe===ye&&He===H;Te.set(H,ye),Te.set(ye,H);var Ke=ie(H,ye,oe,Te);return Te.delete(H),Te.delete(ye),Ke}}function o(ie,ee){var H={};for(var ye in ie)H[ye]=ie[ye];for(var ye in ee)H[ye]=ee[ye];return H}function s(ie){return ie.constructor===Object||ie.constructor==null}function a(ie){return typeof ie.then=="function"}function l(ie,ee){return ie===ee||ie!==ie&&ee!==ee}var c="[object Arguments]",d="[object Boolean]",f="[object Date]",g="[object RegExp]",p="[object Map]",v="[object Number]",y="[object Object]",x="[object Set]",w="[object String]",S=Object.prototype.toString;function C(ie){var ee=ie.areArraysEqual,H=ie.areDatesEqual,ye=ie.areMapsEqual,oe=ie.areObjectsEqual,Te=ie.areRegExpsEqual,Fe=ie.areSetsEqual,He=ie.createIsNestedEqual,Ke=He(St);function St(vt,bt,tn){if(vt===bt)return!0;if(!vt||!bt||typeof vt!="object"||typeof bt!="object")return vt!==vt&&bt!==bt;if(s(vt)&&s(bt))return oe(vt,bt,Ke,tn);var Jt=Array.isArray(vt),Dn=Array.isArray(bt);if(Jt||Dn)return Jt===Dn&&ee(vt,bt,Ke,tn);var fn=S.call(vt);return fn!==S.call(bt)?!1:fn===f?H(vt,bt,Ke,tn):fn===g?Te(vt,bt,Ke,tn):fn===p?ye(vt,bt,Ke,tn):fn===x?Fe(vt,bt,Ke,tn):fn===y||fn===c?a(vt)||a(bt)?!1:oe(vt,bt,Ke,tn):fn===d||fn===v||fn===w?l(vt.valueOf(),bt.valueOf()):!1}return St}function P(ie,ee,H,ye){var oe=ie.length;if(ee.length!==oe)return!1;for(;oe-- >0;)if(!H(ie[oe],ee[oe],oe,oe,ie,ee,ye))return!1;return!0}var O=i(P);function k(ie,ee){return l(ie.valueOf(),ee.valueOf())}function A(ie,ee,H,ye){var oe=ie.size===ee.size;if(!oe)return!1;if(!ie.size)return!0;var Te={},Fe=0;return ie.forEach(function(He,Ke){if(oe){var St=!1,vt=0;ee.forEach(function(bt,tn){!St&&!Te[vt]&&(St=H(Ke,tn,Fe,vt,ie,ee,ye)&&H(He,bt,Ke,tn,ie,ee,ye))&&(Te[vt]=!0),vt++}),Fe++,oe=St}}),oe}var L=i(A),F="_owner",z=Object.prototype.hasOwnProperty;function B(ie,ee,H,ye){var oe=Object.keys(ie),Te=oe.length;if(Object.keys(ee).length!==Te)return!1;for(var Fe;Te-- >0;){if(Fe=oe[Te],Fe===F){var He=!!ie.$$typeof,Ke=!!ee.$$typeof;if((He||Ke)&&He!==Ke)return!1}if(!z.call(ee,Fe)||!H(ie[Fe],ee[Fe],Fe,Fe,ie,ee,ye))return!1}return!0}var V=i(B);function X(ie,ee){return ie.source===ee.source&&ie.flags===ee.flags}function K(ie,ee,H,ye){var oe=ie.size===ee.size;if(!oe)return!1;if(!ie.size)return!0;var Te={};return ie.forEach(function(Fe,He){if(oe){var Ke=!1,St=0;ee.forEach(function(vt,bt){!Ke&&!Te[St]&&(Ke=H(Fe,vt,He,bt,ie,ee,ye))&&(Te[St]=!0),St++}),oe=Ke}}),oe}var $=i(K),J=Object.freeze({areArraysEqual:P,areDatesEqual:k,areMapsEqual:A,areObjectsEqual:B,areRegExpsEqual:X,areSetsEqual:K,createIsNestedEqual:r}),G=Object.freeze({areArraysEqual:O,areDatesEqual:k,areMapsEqual:L,areObjectsEqual:V,areRegExpsEqual:X,areSetsEqual:$,createIsNestedEqual:r}),q=C(J);function se(ie,ee){return q(ie,ee,void 0)}var D=C(o(J,{createIsNestedEqual:function(){return l}}));function W(ie,ee){return D(ie,ee,void 0)}var re=C(G);function N(ie,ee){return re(ie,ee,new WeakMap)}var ne=C(o(G,{createIsNestedEqual:function(){return l}}));function ge(ie,ee){return ne(ie,ee,new WeakMap)}function he(ie){return C(o(J,ie(J)))}function de(ie){var ee=C(o(G,ie(G)));return function(H,ye,oe){return oe===void 0&&(oe=new WeakMap),ee(H,ye,oe)}}n.circularDeepEqual=N,n.circularShallowEqual=ge,n.createCustomCircularEqual=de,n.createCustomEqual=he,n.deepEqual=se,n.sameValueZeroEqual=l,n.shallowEqual=W,Object.defineProperty(n,"__esModule",{value:!0})})})(Im,Im.exports);var Nm=Im.exports;const Rm=Yg(s3);var pt={},TR=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(pt,"__esModule",{value:!0}),pt.bottom=Lm,pt.childrenEqual=RR,pt.cloneLayout=d_,pt.cloneLayoutItem=$s,pt.collides=hf,pt.compact=h_,pt.compactItem=p_,pt.compactType=qR,pt.correctBounds=g_,pt.fastPositionEqual=$R,pt.fastRGLPropsEqual=void 0,pt.getAllCollisions=m_,pt.getFirstCollision=Fs,pt.getLayoutItem=Fm,pt.getStatics=jm,pt.modifyLayout=f_,pt.moveElement=zc,pt.moveElementAwayFromCollision=zm,pt.noop=void 0,pt.perc=jR,pt.resizeItemInDirection=BR,pt.setTopLeft=HR,pt.setTransform=VR,pt.sortLayoutItems=Um,pt.sortLayoutItemsByColRow=w_,pt.sortLayoutItemsByRowCol=x_,pt.synchronizeLayoutWithChildren=WR,pt.validateLayout=__,pt.withLayoutItem=NR;var u_=Nm,jc=AR(m);function AR(e){return e&&e.__esModule?e:{default:e}}const IR=process.env.NODE_ENV==="production";function Lm(e){let t=0,n;for(let r=0,i=e.length;r<i;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function d_(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=$s(e[n]);return t}function f_(e,t){const n=Array(e.length);for(let r=0,i=e.length;r<i;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function NR(e,t,n){let r=Fm(e,t);return r?(r=n($s(r)),e=f_(e,r),[e,r]):[e,null]}function $s(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 RR(e,t){return(0,u_.deepEqual)(jc.default.Children.map(e,n=>n==null?void 0:n.key),jc.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,u_.deepEqual)(jc.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),jc.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const LR=TR;pt.fastRGLPropsEqual=LR;function $R(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function hf(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 h_(e,t,n,r){const i=jm(e),o=Um(e,t),s=Array(e.length);for(let a=0,l=o.length;a<l;a++){let c=$s(o[a]);c.static||(c=p_(i,c,t,n,o,r),i.push(c)),s[e.indexOf(o[a])]=c,c.moved=!1}return s}const FR={x:"w",y:"h"};function $m(e,t,n,r){const i=FR[r];t[r]+=1;const o=e.map(s=>s.i).indexOf(t.i);for(let s=o+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;hf(t,a)&&$m(e,a,n+t[i],r)}}t[r]=n}function p_(e,t,n,r,i,o){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Lm(e),t.y);t.y>0&&!Fs(e,t);)t.y--;else if(a)for(;t.x>0&&!Fs(e,t);)t.x--;let l;for(;(l=Fs(e,t))&&!(n===null&&o);)if(a?$m(i,t,l.x+l.w,"x"):$m(i,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Fs(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function g_(e,t){const n=jm(e);for(let r=0,i=e.length;r<i;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;Fs(n,o);)o.y++}return e}function Fm(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Fs(e,t){for(let n=0,r=e.length;n<r;n++)if(hf(e[n],t))return e[n]}function m_(e,t){return e.filter(n=>hf(n,t))}function jm(e){return e.filter(t=>t.static)}function zc(e,t,n,r,i,o,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=Um(e,s);(s==="vertical"&&typeof r=="number"?d>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const p=m_(f,t),v=p.length>0;if(v&&l)return d_(e);if(v&&o)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=d,t.moved=!1,e;for(let y=0,x=p.length;y<x;y++){const w=p[y];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(w.i," at [").concat(w.x,",").concat(w.y,"]"),!w.moved&&(w.static?e=zm(e,w,t,i,s):e=zm(e,t,w,i,s))}return e}function zm(e,t,n,r,i,o){const s=i==="horizontal",a=i==="vertical",l=t.static;if(r){r=!1;const f={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"},g=Fs(e,f),p=g&&g.y+g.h>t.y,v=g&&t.x+t.w>g.x;if(g){if(p&&a)return zc(e,n,void 0,t.y+1,r,l,i);if(p&&i==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return zc(e,t,n.x,void 0,r,l,i)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),zc(e,n,s?f.x:void 0,a?f.y:void 0,r,l,i)}const c=s?n.x+1:void 0,d=a?n.y+1:void 0;return c==null&&d==null?e:zc(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,i)}function jR(e){return e*100+"%"}const v_=(e,t,n,r)=>e+n>r?t:n,b_=(e,t,n)=>e<0?t:n,y_=e=>Math.max(0,e),Bm=e=>Math.max(0,e),Vm=(e,t,n)=>{let{left:r,height:i,width:o}=t;const s=e.top-(i-e.height);return{left:r,width:o,height:b_(s,e.height,i),top:Bm(s)}},Hm=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{top:r,height:o,width:v_(e.left,e.width,s,n),left:y_(i)}},Wm=(e,t,n)=>{let{top:r,height:i,width:o}=t;const s=e.left-(o-e.width);return{height:i,width:s<0?e.width:v_(e.left,e.width,o,n),top:Bm(r),left:y_(s)}},qm=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{width:s,left:i,height:b_(r,e.height,o),top:Bm(r)}},zR={n:Vm,ne:function(){return Vm(arguments.length<=0?void 0:arguments[0],Hm(...arguments))},e:Hm,se:function(){return qm(arguments.length<=0?void 0:arguments[0],Hm(...arguments))},s:qm,sw:function(){return qm(arguments.length<=0?void 0:arguments[0],Wm(...arguments))},w:Wm,nw:function(){return Vm(arguments.length<=0?void 0:arguments[0],Wm(...arguments))}};function BR(e,t,n,r){const i=zR[e];return i?i(t,{...t,...n},r):n}function VR(e){let{top:t,left:n,width:r,height:i}=e;const o="translate(".concat(n,"px,").concat(t,"px)");return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function HR(e){let{top:t,left:n,width:r,height:i}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function Um(e,t){return t==="horizontal"?w_(e):t==="vertical"?x_(e):e}function x_(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 w_(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 WR(e,t,n,r,i){e=e||[];const o=[];jc.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Fm(e,String(a.key)),c=a.props["data-grid"];l&&c==null?o.push($s(l)):c?(IR||__([c],"ReactGridLayout.children"),o.push($s({...c,i:a.key}))):o.push($s({w:1,h:1,x:0,y:Lm(o),i:String(a.key)}))});const s=g_(o,{cols:n});return i?s:h_(s,r,n)}function __(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,i=e.length;r<i;r++){const o=e[r];for(let s=0;s<n.length;s++)if(typeof o[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function qR(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function Tde(){}const UR=()=>{};pt.noop=UR;var ki={};Object.defineProperty(ki,"__esModule",{value:!0}),ki.calcGridColWidth=pf,ki.calcGridItemPosition=GR,ki.calcGridItemWHPx=Gm,ki.calcWH=KR,ki.calcXY=YR,ki.clamp=js;function pf(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Gm(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function GR(e,t,n,r,i,o){const{margin:s,containerPadding:a,rowHeight:l}=e,c=pf(e),d={};return o&&o.resizing?(d.width=Math.round(o.resizing.width),d.height=Math.round(o.resizing.height)):(d.width=Gm(r,c,s[0]),d.height=Gm(i,l,s[1])),o&&o.dragging?(d.top=Math.round(o.dragging.top),d.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(d.top=Math.round(o.resizing.top),d.left=Math.round(o.resizing.left)):(d.top=Math.round((l+s[1])*n+a[1]),d.left=Math.round((c+s[0])*t+a[0])),d}function YR(e,t,n,r,i){const{margin:o,cols:s,rowHeight:a,maxRows:l}=e,c=pf(e);let d=Math.round((n-o[0])/(c+o[0])),f=Math.round((t-o[1])/(a+o[1]));return d=js(d,0,s-r),f=js(f,0,l-i),{x:d,y:f}}function KR(e,t,n,r,i,o){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,d=pf(e);let f=Math.round((t+s[0])/(d+s[0])),g=Math.round((n+s[1])/(c+s[1])),p=js(f,0,l-r),v=js(g,0,a-i);return["sw","w","nw"].indexOf(o)!==-1&&(p=js(f,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(v=js(g,0,a)),{w:p,h:v}}function js(e,t,n){return Math.max(Math.min(e,n),t)}var gf={},Ym={exports:{}},Km,S_;function Xm(){if(S_)return Km;S_=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Km=e,Km}var Qm,C_;function XR(){if(C_)return Qm;C_=1;var e=Xm();function t(){}function n(){}return n.resetWarningCache=t,Qm=function(){function r(s,a,l,c,d,f){if(f!==e){var g=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 g.name="Invariant Violation",g}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Qm}var mf={exports:{}},At={};/** @license React v16.13.1
|
|
86
|
+
* react-is.development.js
|
|
87
|
+
*
|
|
88
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
89
|
+
*
|
|
90
|
+
* This source code is licensed under the MIT license found in the
|
|
91
|
+
* LICENSE file in the root directory of this source tree.
|
|
92
|
+
*/var E_;function QR(){return E_||(E_=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,g=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function C(oe){return typeof oe=="string"||typeof oe=="function"||oe===r||oe===c||oe===o||oe===i||oe===f||oe===g||typeof oe=="object"&&oe!==null&&(oe.$$typeof===v||oe.$$typeof===p||oe.$$typeof===s||oe.$$typeof===a||oe.$$typeof===d||oe.$$typeof===x||oe.$$typeof===w||oe.$$typeof===S||oe.$$typeof===y)}function P(oe){if(typeof oe=="object"&&oe!==null){var Te=oe.$$typeof;switch(Te){case t:var Fe=oe.type;switch(Fe){case l:case c:case r:case o:case i:case f:return Fe;default:var He=Fe&&Fe.$$typeof;switch(He){case a:case d:case v:case p:case s:return He;default:return Te}}case n:return Te}}}var O=l,k=c,A=a,L=s,F=t,z=d,B=r,V=v,X=p,K=n,$=o,J=i,G=f,q=!1;function se(oe){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(oe)||P(oe)===l}function D(oe){return P(oe)===c}function W(oe){return P(oe)===a}function re(oe){return P(oe)===s}function N(oe){return typeof oe=="object"&&oe!==null&&oe.$$typeof===t}function ne(oe){return P(oe)===d}function ge(oe){return P(oe)===r}function he(oe){return P(oe)===v}function de(oe){return P(oe)===p}function ie(oe){return P(oe)===n}function ee(oe){return P(oe)===o}function H(oe){return P(oe)===i}function ye(oe){return P(oe)===f}At.AsyncMode=O,At.ConcurrentMode=k,At.ContextConsumer=A,At.ContextProvider=L,At.Element=F,At.ForwardRef=z,At.Fragment=B,At.Lazy=V,At.Memo=X,At.Portal=K,At.Profiler=$,At.StrictMode=J,At.Suspense=G,At.isAsyncMode=se,At.isConcurrentMode=D,At.isContextConsumer=W,At.isContextProvider=re,At.isElement=N,At.isForwardRef=ne,At.isFragment=ge,At.isLazy=he,At.isMemo=de,At.isPortal=ie,At.isProfiler=ee,At.isStrictMode=H,At.isSuspense=ye,At.isValidElementType=C,At.typeOf=P}()),At}var It={};/** @license React v16.13.1
|
|
93
|
+
* react-is.production.min.js
|
|
94
|
+
*
|
|
95
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the MIT license found in the
|
|
98
|
+
* LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/var O_;function ZR(){if(O_)return It;O_=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,g=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function C(O){if(typeof O=="object"&&O!==null){var k=O.$$typeof;switch(k){case t:switch(O=O.type,O){case l:case c:case r:case o:case i:case f:return O;default:switch(O=O&&O.$$typeof,O){case a:case d:case v:case p:case s:return O;default:return k}}case n:return k}}}function P(O){return C(O)===c}return It.AsyncMode=l,It.ConcurrentMode=c,It.ContextConsumer=a,It.ContextProvider=s,It.Element=t,It.ForwardRef=d,It.Fragment=r,It.Lazy=v,It.Memo=p,It.Portal=n,It.Profiler=o,It.StrictMode=i,It.Suspense=f,It.isAsyncMode=function(O){return P(O)||C(O)===l},It.isConcurrentMode=P,It.isContextConsumer=function(O){return C(O)===a},It.isContextProvider=function(O){return C(O)===s},It.isElement=function(O){return typeof O=="object"&&O!==null&&O.$$typeof===t},It.isForwardRef=function(O){return C(O)===d},It.isFragment=function(O){return C(O)===r},It.isLazy=function(O){return C(O)===v},It.isMemo=function(O){return C(O)===p},It.isPortal=function(O){return C(O)===n},It.isProfiler=function(O){return C(O)===o},It.isStrictMode=function(O){return C(O)===i},It.isSuspense=function(O){return C(O)===f},It.isValidElementType=function(O){return typeof O=="string"||typeof O=="function"||O===r||O===c||O===o||O===i||O===f||O===g||typeof O=="object"&&O!==null&&(O.$$typeof===v||O.$$typeof===p||O.$$typeof===s||O.$$typeof===a||O.$$typeof===d||O.$$typeof===x||O.$$typeof===w||O.$$typeof===S||O.$$typeof===y)},It.typeOf=C,It}var P_;function k_(){return P_||(P_=1,process.env.NODE_ENV==="production"?mf.exports=ZR():mf.exports=QR()),mf.exports}/*
|
|
100
|
+
object-assign
|
|
101
|
+
(c) Sindre Sorhus
|
|
102
|
+
@license MIT
|
|
103
|
+
*/var Zm,M_;function JR(){if(M_)return Zm;M_=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(d){return s[d]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(d){c[d]=d}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Zm=i()?Object.assign:function(o,s){for(var a,l=r(o),c,d=1;d<arguments.length;d++){a=Object(arguments[d]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){c=e(a);for(var g=0;g<c.length;g++)n.call(a,c[g])&&(l[c[g]]=a[c[g]])}}return l},Zm}var Jm,D_;function T_(){return D_||(D_=1,Jm=Function.call.bind(Object.prototype.hasOwnProperty)),Jm}var ev,A_;function e7(){if(A_)return ev;A_=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Xm(),n={},r=T_();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var d in o)if(r(o,d)){var f;try{if(typeof o[d]!="function"){var g=Error((l||"React class")+": "+a+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw g.name="Invariant Violation",g}f=o[d](s,d,l,a,null,t)}catch(v){f=v}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var p=c?c():"";e("Failed "+a+" type: "+f.message+(p??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},ev=i,ev}var tv,I_;function t7(){if(I_)return tv;I_=1;var e=k_(),t=JR(),n=Xm(),r=T_(),i=e7(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return tv=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function f(D){var W=D&&(c&&D[c]||D[d]);if(typeof W=="function")return W}var g="<<anonymous>>",p={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:S(),arrayOf:C,element:P(),elementType:O(),instanceOf:k,node:z(),objectOf:L,oneOf:A,oneOfType:F,shape:V,exact:X};function v(D,W){return D===W?D!==0||1/D===1/W:D!==D&&W!==W}function y(D,W){this.message=D,this.data=W&&typeof W=="object"?W:{},this.stack=""}y.prototype=Error.prototype;function x(D){if(process.env.NODE_ENV!=="production")var W={},re=0;function N(ge,he,de,ie,ee,H,ye){if(ie=ie||g,H=H||de,ye!==n){if(l){var oe=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw oe.name="Invariant Violation",oe}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Te=ie+":"+de;!W[Te]&&re<3&&(o("You are manually calling a React.PropTypes validation function for the `"+H+"` prop on `"+ie+"`. 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."),W[Te]=!0,re++)}}return he[de]==null?ge?he[de]===null?new y("The "+ee+" `"+H+"` is marked as required "+("in `"+ie+"`, but its value is `null`.")):new y("The "+ee+" `"+H+"` is marked as required in "+("`"+ie+"`, but its value is `undefined`.")):null:D(he,de,ie,ee,H)}var ne=N.bind(null,!1);return ne.isRequired=N.bind(null,!0),ne}function w(D){function W(re,N,ne,ge,he,de){var ie=re[N],ee=J(ie);if(ee!==D){var H=G(ie);return new y("Invalid "+ge+" `"+he+"` of type "+("`"+H+"` supplied to `"+ne+"`, expected ")+("`"+D+"`."),{expectedType:D})}return null}return x(W)}function S(){return x(s)}function C(D){function W(re,N,ne,ge,he){if(typeof D!="function")return new y("Property `"+he+"` of component `"+ne+"` has invalid PropType notation inside arrayOf.");var de=re[N];if(!Array.isArray(de)){var ie=J(de);return new y("Invalid "+ge+" `"+he+"` of type "+("`"+ie+"` supplied to `"+ne+"`, expected an array."))}for(var ee=0;ee<de.length;ee++){var H=D(de,ee,ne,ge,he+"["+ee+"]",n);if(H instanceof Error)return H}return null}return x(W)}function P(){function D(W,re,N,ne,ge){var he=W[re];if(!a(he)){var de=J(he);return new y("Invalid "+ne+" `"+ge+"` of type "+("`"+de+"` supplied to `"+N+"`, expected a single ReactElement."))}return null}return x(D)}function O(){function D(W,re,N,ne,ge){var he=W[re];if(!e.isValidElementType(he)){var de=J(he);return new y("Invalid "+ne+" `"+ge+"` of type "+("`"+de+"` supplied to `"+N+"`, expected a single ReactElement type."))}return null}return x(D)}function k(D){function W(re,N,ne,ge,he){if(!(re[N]instanceof D)){var de=D.name||g,ie=se(re[N]);return new y("Invalid "+ge+" `"+he+"` of type "+("`"+ie+"` supplied to `"+ne+"`, expected ")+("instance of `"+de+"`."))}return null}return x(W)}function A(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function W(re,N,ne,ge,he){for(var de=re[N],ie=0;ie<D.length;ie++)if(v(de,D[ie]))return null;var ee=JSON.stringify(D,function(ye,oe){var Te=G(oe);return Te==="symbol"?String(oe):oe});return new y("Invalid "+ge+" `"+he+"` of value `"+String(de)+"` "+("supplied to `"+ne+"`, expected one of "+ee+"."))}return x(W)}function L(D){function W(re,N,ne,ge,he){if(typeof D!="function")return new y("Property `"+he+"` of component `"+ne+"` has invalid PropType notation inside objectOf.");var de=re[N],ie=J(de);if(ie!=="object")return new y("Invalid "+ge+" `"+he+"` of type "+("`"+ie+"` supplied to `"+ne+"`, expected an object."));for(var ee in de)if(r(de,ee)){var H=D(de,ee,ne,ge,he+"."+ee,n);if(H instanceof Error)return H}return null}return x(W)}function F(D){if(!Array.isArray(D))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var W=0;W<D.length;W++){var re=D[W];if(typeof re!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+q(re)+" at index "+W+"."),s}function N(ne,ge,he,de,ie){for(var ee=[],H=0;H<D.length;H++){var ye=D[H],oe=ye(ne,ge,he,de,ie,n);if(oe==null)return null;oe.data&&r(oe.data,"expectedType")&&ee.push(oe.data.expectedType)}var Te=ee.length>0?", expected one of type ["+ee.join(", ")+"]":"";return new y("Invalid "+de+" `"+ie+"` supplied to "+("`"+he+"`"+Te+"."))}return x(N)}function z(){function D(W,re,N,ne,ge){return K(W[re])?null:new y("Invalid "+ne+" `"+ge+"` supplied to "+("`"+N+"`, expected a ReactNode."))}return x(D)}function B(D,W,re,N,ne){return new y((D||"React class")+": "+W+" type `"+re+"."+N+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ne+"`.")}function V(D){function W(re,N,ne,ge,he){var de=re[N],ie=J(de);if(ie!=="object")return new y("Invalid "+ge+" `"+he+"` of type `"+ie+"` "+("supplied to `"+ne+"`, expected `object`."));for(var ee in D){var H=D[ee];if(typeof H!="function")return B(ne,ge,he,ee,G(H));var ye=H(de,ee,ne,ge,he+"."+ee,n);if(ye)return ye}return null}return x(W)}function X(D){function W(re,N,ne,ge,he){var de=re[N],ie=J(de);if(ie!=="object")return new y("Invalid "+ge+" `"+he+"` of type `"+ie+"` "+("supplied to `"+ne+"`, expected `object`."));var ee=t({},re[N],D);for(var H in ee){var ye=D[H];if(r(D,H)&&typeof ye!="function")return B(ne,ge,he,H,G(ye));if(!ye)return new y("Invalid "+ge+" `"+he+"` key `"+H+"` supplied to `"+ne+"`.\nBad object: "+JSON.stringify(re[N],null," ")+`
|
|
104
|
+
Valid keys: `+JSON.stringify(Object.keys(D),null," "));var oe=ye(de,H,ne,ge,he+"."+H,n);if(oe)return oe}return null}return x(W)}function K(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(K);if(D===null||a(D))return!0;var W=f(D);if(W){var re=W.call(D),N;if(W!==D.entries){for(;!(N=re.next()).done;)if(!K(N.value))return!1}else for(;!(N=re.next()).done;){var ne=N.value;if(ne&&!K(ne[1]))return!1}}else return!1;return!0;default:return!1}}function $(D,W){return D==="symbol"?!0:W?W["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&W instanceof Symbol:!1}function J(D){var W=typeof D;return Array.isArray(D)?"array":D instanceof RegExp?"object":$(W,D)?"symbol":W}function G(D){if(typeof D>"u"||D===null)return""+D;var W=J(D);if(W==="object"){if(D instanceof Date)return"date";if(D instanceof RegExp)return"regexp"}return W}function q(D){var W=G(D);switch(W){case"array":case"object":return"an "+W;case"boolean":case"date":case"regexp":return"a "+W;default:return W}}function se(D){return!D.constructor||!D.constructor.name?g:D.constructor.name}return p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},tv}if(process.env.NODE_ENV!=="production"){var n7=k_(),r7=!0;Ym.exports=t7()(n7.isElement,r7)}else Ym.exports=XR()();var Fo=Ym.exports,vf={exports:{}},N_={};function R_(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=R_(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function L_(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=R_(e))&&(r&&(r+=" "),r+=t);return r}const i7=Yg(Object.freeze(Object.defineProperty({__proto__:null,clsx:L_,default:L_},Symbol.toStringTag,{value:"Module"})));var ln={},Mi={};Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.dontSetMe=c7,Mi.findInArray=o7,Mi.int=l7,Mi.isFunction=s7,Mi.isNum=a7;function o7(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function s7(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function a7(e){return typeof e=="number"&&!isNaN(e)}function l7(e){return parseInt(e,10)}function c7(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 zs={};Object.defineProperty(zs,"__esModule",{value:!0}),zs.browserPrefixToKey=F_,zs.browserPrefixToStyle=u7,zs.default=void 0,zs.getPrefix=$_;const nv=["Moz","Webkit","O","ms"];function $_(){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<nv.length;r++)if(F_(t,nv[r])in n)return nv[r];return""}function F_(e,t){return t?"".concat(t).concat(d7(e)):e}function u7(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function d7(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}zs.default=$_(),Object.defineProperty(ln,"__esModule",{value:!0}),ln.addClassName=V_,ln.addEvent=p7,ln.addUserSelectStyles=E7,ln.createCSSTransform=w7,ln.createSVGTransform=_7,ln.getTouch=S7,ln.getTouchIdentifier=C7,ln.getTranslation=rv,ln.innerHeight=b7,ln.innerWidth=y7,ln.matchesSelector=B_,ln.matchesSelectorAndParentsTo=h7,ln.offsetXYFromParent=x7,ln.outerHeight=m7,ln.outerWidth=v7,ln.removeClassName=H_,ln.removeEvent=g7,ln.removeUserSelectStyles=O7;var Cr=Mi,j_=f7(zs);function z_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(z_=function(r){return r?n:t})(e)}function f7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=z_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}let bf="";function B_(e,t){return bf||(bf=(0,Cr.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Cr.isFunction)(e[n])})),(0,Cr.isFunction)(e[bf])?e[bf](t):!1}function h7(e,t,n){let r=e;do{if(B_(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function p7(e,t,n,r){if(!e)return;const i={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,i):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function g7(e,t,n,r){if(!e)return;const i={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,i):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function m7(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Cr.int)(n.borderTopWidth),t+=(0,Cr.int)(n.borderBottomWidth),t}function v7(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Cr.int)(n.borderLeftWidth),t+=(0,Cr.int)(n.borderRightWidth),t}function b7(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Cr.int)(n.paddingTop),t-=(0,Cr.int)(n.paddingBottom),t}function y7(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Cr.int)(n.paddingLeft),t-=(0,Cr.int)(n.paddingRight),t}function x7(e,t,n){const i=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-i.left)/n,s=(e.clientY+t.scrollTop-i.top)/n;return{x:o,y:s}}function w7(e,t){const n=rv(e,t,"px");return{[(0,j_.browserPrefixToKey)("transform",j_.default)]:n}}function _7(e,t){return rv(e,t,"")}function rv(e,t,n){let{x:r,y:i}=e,o="translate(".concat(r).concat(n,",").concat(i).concat(n,")");if(t){const s="".concat(typeof t.x=="string"?t.x:t.x+n),a="".concat(typeof t.y=="string"?t.y:t.y+n);o="translate(".concat(s,", ").concat(a,")")+o}return o}function S7(e,t){return e.targetTouches&&(0,Cr.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Cr.findInArray)(e.changedTouches,n=>t===n.identifier)}function C7(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function E7(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;}
|
|
105
|
+
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
106
|
+
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&V_(e.body,"react-draggable-transparent-selection")}function O7(e){if(e)try{if(e.body&&H_(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 V_(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function H_(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Di={};Object.defineProperty(Di,"__esModule",{value:!0}),Di.canDragX=M7,Di.canDragY=D7,Di.createCoreData=A7,Di.createDraggableData=I7,Di.getBoundPosition=P7,Di.getControlPosition=T7,Di.snapToGrid=k7;var Er=Mi,ol=ln;function P7(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:N7(r);const i=iv(e);if(typeof r=="string"){const{ownerDocument:o}=i,s=o.defaultView;let a;if(r==="parent"?a=i.parentNode:a=o.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(i),d=s.getComputedStyle(l);r={left:-i.offsetLeft+(0,Er.int)(d.paddingLeft)+(0,Er.int)(c.marginLeft),top:-i.offsetTop+(0,Er.int)(d.paddingTop)+(0,Er.int)(c.marginTop),right:(0,ol.innerWidth)(l)-(0,ol.outerWidth)(i)-i.offsetLeft+(0,Er.int)(d.paddingRight)-(0,Er.int)(c.marginRight),bottom:(0,ol.innerHeight)(l)-(0,ol.outerHeight)(i)-i.offsetTop+(0,Er.int)(d.paddingBottom)-(0,Er.int)(c.marginBottom)}}return(0,Er.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Er.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Er.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Er.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function k7(e,t,n){const r=Math.round(t/e[0])*e[0],i=Math.round(n/e[1])*e[1];return[r,i]}function M7(e){return e.props.axis==="both"||e.props.axis==="x"}function D7(e){return e.props.axis==="both"||e.props.axis==="y"}function T7(e,t,n){const r=typeof t=="number"?(0,ol.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const i=iv(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,ol.offsetXYFromParent)(r||e,o,n.props.scale)}function A7(e,t,n){const r=!(0,Er.isNum)(e.lastX),i=iv(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function I7(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 N7(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function iv(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var yf={},xf={};Object.defineProperty(xf,"__esModule",{value:!0}),xf.default=R7;function R7(){}Object.defineProperty(yf,"__esModule",{value:!0}),yf.default=void 0;var ov=$7(m),sr=av(Fo),L7=av(kt),Hn=ln,jo=Di,sv=Mi,Bc=av(xf);function av(e){return e&&e.__esModule?e:{default:e}}function W_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(W_=function(r){return r?n:t})(e)}function $7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=W_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Zn(e,t,n){return t=F7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F7(e){var t=j7(e,"string");return typeof t=="symbol"?t:String(t)}function j7(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const gi={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let zo=gi.mouse,wf=class extends ov.Component{constructor(){super(...arguments),Zn(this,"dragging",!1),Zn(this,"lastX",NaN),Zn(this,"lastY",NaN),Zn(this,"touchIdentifier",null),Zn(this,"mounted",!1),Zn(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,Hn.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Hn.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const i=(0,Hn.getTouchIdentifier)(t);this.touchIdentifier=i;const o=(0,jo.getControlPosition)(t,i,this);if(o==null)return;const{x:s,y:a}=o,l=(0,jo.createCoreData)(this,s,a);(0,Bc.default)("DraggableCore: handleDragStart: %j",l),(0,Bc.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Hn.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Hn.addEvent)(r,zo.move,this.handleDrag),(0,Hn.addEvent)(r,zo.stop,this.handleDragStop))}),Zn(this,"handleDrag",t=>{const n=(0,jo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=i-this.lastY;if([a,l]=(0,jo.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,i=this.lastY+l}const o=(0,jo.createCoreData)(this,r,i);if((0,Bc.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=i}),Zn(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,jo.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=i-this.lastY||0;[l,c]=(0,jo.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,i=this.lastY+c}const o=(0,jo.createCoreData)(this,r,i);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,Hn.removeUserSelectStyles)(a.ownerDocument),(0,Bc.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Bc.default)("DraggableCore: Removing handlers"),(0,Hn.removeEvent)(a.ownerDocument,zo.move,this.handleDrag),(0,Hn.removeEvent)(a.ownerDocument,zo.stop,this.handleDragStop))}),Zn(this,"onMouseDown",t=>(zo=gi.mouse,this.handleDragStart(t))),Zn(this,"onMouseUp",t=>(zo=gi.mouse,this.handleDragStop(t))),Zn(this,"onTouchStart",t=>(zo=gi.touch,this.handleDragStart(t))),Zn(this,"onTouchEnd",t=>(zo=gi.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Hn.addEvent)(t,gi.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Hn.removeEvent)(n,gi.mouse.move,this.handleDrag),(0,Hn.removeEvent)(n,gi.touch.move,this.handleDrag),(0,Hn.removeEvent)(n,gi.mouse.stop,this.handleDragStop),(0,Hn.removeEvent)(n,gi.touch.stop,this.handleDragStop),(0,Hn.removeEvent)(t,gi.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Hn.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:L7.default.findDOMNode(this)}render(){return ov.cloneElement(ov.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};yf.default=wf,Zn(wf,"displayName","DraggableCore"),Zn(wf,"propTypes",{allowAnyClick:sr.default.bool,children:sr.default.node.isRequired,disabled:sr.default.bool,enableUserSelectHack:sr.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:sr.default.arrayOf(sr.default.number),handle:sr.default.string,cancel:sr.default.string,nodeRef:sr.default.object,onStart:sr.default.func,onDrag:sr.default.func,onStop:sr.default.func,onMouseDown:sr.default.func,scale:sr.default.number,className:sv.dontSetMe,style:sv.dontSetMe,transform:sv.dontSetMe}),Zn(wf,"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=g(m),n=d(Fo),r=d(kt),i=d(i7),o=ln,s=Di,a=Mi,l=d(yf),c=d(xf);function d(S){return S&&S.__esModule?S:{default:S}}function f(S){if(typeof WeakMap!="function")return null;var C=new WeakMap,P=new WeakMap;return(f=function(O){return O?P:C})(S)}function g(S,C){if(!C&&S&&S.__esModule)return S;if(S===null||typeof S!="object"&&typeof S!="function")return{default:S};var P=f(C);if(P&&P.has(S))return P.get(S);var O={},k=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in S)if(A!=="default"&&Object.prototype.hasOwnProperty.call(S,A)){var L=k?Object.getOwnPropertyDescriptor(S,A):null;L&&(L.get||L.set)?Object.defineProperty(O,A,L):O[A]=S[A]}return O.default=S,P&&P.set(S,O),O}function p(){return p=Object.assign?Object.assign.bind():function(S){for(var C=1;C<arguments.length;C++){var P=arguments[C];for(var O in P)Object.prototype.hasOwnProperty.call(P,O)&&(S[O]=P[O])}return S},p.apply(this,arguments)}function v(S,C,P){return C=y(C),C in S?Object.defineProperty(S,C,{value:P,enumerable:!0,configurable:!0,writable:!0}):S[C]=P,S}function y(S){var C=x(S,"string");return typeof C=="symbol"?C:String(C)}function x(S,C){if(typeof S!="object"||S===null)return S;var P=S[Symbol.toPrimitive];if(P!==void 0){var O=P.call(S,C||"default");if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(S)}class w extends t.Component{static getDerivedStateFromProps(C,P){let{position:O}=C,{prevPropsPosition:k}=P;return O&&(!k||O.x!==k.x||O.y!==k.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:O,prevPropsPosition:k}),{x:O.x,y:O.y,prevPropsPosition:{...O}}):null}constructor(C){super(C),v(this,"onDragStart",(P,O)=>{if((0,c.default)("Draggable: onDragStart: %j",O),this.props.onStart(P,(0,s.createDraggableData)(this,O))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(P,O)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",O);const k=(0,s.createDraggableData)(this,O),A={x:k.x,y:k.y,slackX:0,slackY:0};if(this.props.bounds){const{x:F,y:z}=A;A.x+=this.state.slackX,A.y+=this.state.slackY;const[B,V]=(0,s.getBoundPosition)(this,A.x,A.y);A.x=B,A.y=V,A.slackX=this.state.slackX+(F-A.x),A.slackY=this.state.slackY+(z-A.y),k.x=A.x,k.y=A.y,k.deltaX=A.x-this.state.x,k.deltaY=A.y-this.state.y}if(this.props.onDrag(P,k)===!1)return!1;this.setState(A)}),v(this,"onDragStop",(P,O)=>{if(!this.state.dragging||this.props.onStop(P,(0,s.createDraggableData)(this,O))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",O);const A={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:F,y:z}=this.props.position;A.x=F,A.y=z}this.setState(A)}),this.state={dragging:!1,dragged:!1,x:C.position?C.position.x:C.defaultPosition.x,y:C.position?C.position.y:C.defaultPosition.y,prevPropsPosition:{...C.position},slackX:0,slackY:0,isElementSVG:!1},C.position&&!(C.onDrag||C.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 C,P;return(C=(P=this.props)===null||P===void 0||(P=P.nodeRef)===null||P===void 0?void 0:P.current)!==null&&C!==void 0?C:r.default.findDOMNode(this)}render(){const{axis:C,bounds:P,children:O,defaultPosition:k,defaultClassName:A,defaultClassNameDragging:L,defaultClassNameDragged:F,position:z,positionOffset:B,scale:V,...X}=this.props;let K={},$=null;const G=!!!z||this.state.dragging,q=z||k,se={x:(0,s.canDragX)(this)&&G?this.state.x:q.x,y:(0,s.canDragY)(this)&&G?this.state.y:q.y};this.state.isElementSVG?$=(0,o.createSVGTransform)(se,B):K=(0,o.createCSSTransform)(se,B);const D=(0,i.default)(O.props.className||"",A,{[L]:this.state.dragging,[F]:this.state.dragged});return t.createElement(l.default,p({},X,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(O),{className:D,style:{...O.props.style,...K},transform:$}))}}e.default=w,v(w,"displayName","Draggable"),v(w,"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}),v(w,"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})}(N_);const{default:q_,DraggableCore:z7}=N_;vf.exports=q_,vf.exports.default=q_,vf.exports.DraggableCore=z7;var U_=vf.exports,_f={exports:{}},Vc={},lv={};lv.__esModule=!0,lv.cloneElement=U7;var B7=V7(m);function V7(e){return e&&e.__esModule?e:{default:e}}function G_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Y_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?G_(Object(n),!0).forEach(function(r){H7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function H7(e,t,n){return t=W7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W7(e){var t=q7(e,"string");return typeof t=="symbol"?t:String(t)}function q7(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function U7(e,t){return t.style&&e.props.style&&(t.style=Y_(Y_({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),B7.default.cloneElement(e,t)}var Hc={};Hc.__esModule=!0,Hc.resizableProps=void 0;var ot=G7(Fo);function G7(e){return e&&e.__esModule?e:{default:e}}var Y7={axis:ot.default.oneOf(["both","x","y","none"]),className:ot.default.string,children:ot.default.element.isRequired,draggableOpts:ot.default.shape({allowAnyClick:ot.default.bool,cancel:ot.default.string,children:ot.default.node,disabled:ot.default.bool,enableUserSelectHack:ot.default.bool,offsetParent:ot.default.node,grid:ot.default.arrayOf(ot.default.number),handle:ot.default.string,nodeRef:ot.default.object,onStart:ot.default.func,onDrag:ot.default.func,onStop:ot.default.func,onMouseDown:ot.default.func,scale:ot.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="y"){var o;return(o=ot.default.number).isRequired.apply(o,n)}return ot.default.number.apply(ot.default,n)},handle:ot.default.oneOfType([ot.default.node,ot.default.func]),handleSize:ot.default.arrayOf(ot.default.number),lockAspectRatio:ot.default.bool,maxConstraints:ot.default.arrayOf(ot.default.number),minConstraints:ot.default.arrayOf(ot.default.number),onResizeStop:ot.default.func,onResizeStart:ot.default.func,onResize:ot.default.func,resizeHandles:ot.default.arrayOf(ot.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:ot.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="x"){var o;return(o=ot.default.number).isRequired.apply(o,n)}return ot.default.number.apply(ot.default,n)}};Hc.resizableProps=Y7,Vc.__esModule=!0,Vc.default=void 0;var Wc=J7(m),K7=U_,X7=lv,Q7=Hc,Z7=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function K_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(K_=function(i){return i?n:t})(e)}function J7(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=K_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function cv(){return cv=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},cv.apply(this,arguments)}function e4(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function X_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function uv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?X_(Object(n),!0).forEach(function(r){t4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function t4(e,t,n){return t=n4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n4(e){var t=r4(e,"string");return typeof t=="symbol"?t:String(t)}function r4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function i4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,dv(e,t)}function dv(e,t){return dv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},dv(e,t)}var fv=function(e){i4(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(i,o){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[i,o];if(c){var d=this.props.width/this.props.height,f=i-this.props.width,g=o-this.props.height;Math.abs(f)>Math.abs(g*d)?o=i/d:i=o*d}var p=i,v=o,y=this.slack||[0,0],x=y[0],w=y[1];return i+=x,o+=w,a&&(i=Math.max(a[0],i),o=Math.max(a[1],o)),l&&(i=Math.min(l[0],i),o=Math.min(l[1],o)),this.slack=[x+(p-i),w+(v-o)],[i,o]},n.resizeHandler=function(i,o){var s=this;return function(a,l){var c=l.node,d=l.deltaX,f=l.deltaY;i==="onResizeStart"&&s.resetData();var g=(s.props.axis==="both"||s.props.axis==="x")&&o!=="n"&&o!=="s",p=(s.props.axis==="both"||s.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!g&&!p)){var v=o[0],y=o[o.length-1],x=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(y==="w"){var w=x.left-s.lastHandleRect.left;d+=w}if(v==="n"){var S=x.top-s.lastHandleRect.top;f+=S}}s.lastHandleRect=x,y==="w"&&(d=-d),v==="n"&&(f=-f);var C=s.props.width+(g?d/s.props.transformScale:0),P=s.props.height+(p?f/s.props.transformScale:0),O=s.runConstraints(C,P);C=O[0],P=O[1];var k=C!==s.props.width||P!==s.props.height,A=typeof s.props[i]=="function"?s.props[i]:null,L=i==="onResize"&&!k;A&&!L&&(a.persist==null||a.persist(),A(a,{node:c,size:{width:C,height:P},handle:o})),i==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(i,o){var s=this.props.handle;if(!s)return Wc.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:o});if(typeof s=="function")return s(i,o);var a=typeof s.type=="string",l=uv({ref:o},a?{}:{handleAxis:i});return Wc.cloneElement(s,l)},n.render=function(){var i=this,o=this.props,s=o.children,a=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var d=e4(o,Z7);return(0,X7.cloneElement)(s,uv(uv({},d),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var g,p=(g=i.handleRefs[f])!=null?g:i.handleRefs[f]=Wc.createRef();return Wc.createElement(K7.DraggableCore,cv({},l,{nodeRef:p,key:"resizableHandle-"+f,onStop:i.resizeHandler("onResizeStop",f),onStart:i.resizeHandler("onResizeStart",f),onDrag:i.resizeHandler("onResize",f)}),i.renderResizeHandle(f,p))}))}))},t}(Wc.Component);Vc.default=fv,fv.propTypes=Q7.resizableProps,fv.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Sf={};Sf.__esModule=!0,Sf.default=void 0;var hv=c4(m),o4=Q_(Fo),s4=Q_(Vc),a4=Hc,l4=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function Q_(e){return e&&e.__esModule?e:{default:e}}function Z_(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Z_=function(i){return i?n:t})(e)}function c4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Z_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function pv(){return pv=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},pv.apply(this,arguments)}function J_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J_(Object(n),!0).forEach(function(r){u4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function u4(e,t,n){return t=d4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d4(e){var t=f4(e,"string");return typeof t=="symbol"?t:String(t)}function f4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function h4(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function p4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,gv(e,t)}function gv(e,t){return gv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},gv(e,t)}var eS=function(e){p4(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(i,o){return o.propsWidth!==i.width||o.propsHeight!==i.height?{width:i.width,height:i.height,propsWidth:i.width,propsHeight:i.height}:null};var n=t.prototype;return n.render=function(){var i=this.props,o=i.handle,s=i.handleSize;i.onResize;var a=i.onResizeStart,l=i.onResizeStop,c=i.draggableOpts,d=i.minConstraints,f=i.maxConstraints,g=i.lockAspectRatio,p=i.axis;i.width,i.height;var v=i.resizeHandles,y=i.style,x=i.transformScale,w=h4(i,l4);return hv.createElement(s4.default,{axis:p,draggableOpts:c,handle:o,handleSize:s,height:this.state.height,lockAspectRatio:g,maxConstraints:f,minConstraints:d,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:x,width:this.state.width},hv.createElement("div",pv({},w,{style:Cf(Cf({},y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(hv.Component);Sf.default=eS,eS.propTypes=Cf(Cf({},a4.resizableProps),{},{children:o4.default.element}),_f.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},_f.exports.Resizable=Vc.default,_f.exports.ResizableBox=Sf.default;var g4=_f.exports,ro={};Object.defineProperty(ro,"__esModule",{value:!0}),ro.resizeHandleType=ro.resizeHandleAxesType=ro.default=void 0;var dt=tS(Fo),m4=tS(m);function tS(e){return e&&e.__esModule?e:{default:e}}const nS=dt.default.arrayOf(dt.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));ro.resizeHandleAxesType=nS;const rS=dt.default.oneOfType([dt.default.node,dt.default.func]);ro.resizeHandleType=rS;var v4={className:dt.default.string,style:dt.default.object,width:dt.default.number,autoSize:dt.default.bool,cols:dt.default.number,draggableCancel:dt.default.string,draggableHandle:dt.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:dt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&pt.validateLayout(t,"layout")},margin:dt.default.arrayOf(dt.default.number),containerPadding:dt.default.arrayOf(dt.default.number),rowHeight:dt.default.number,maxRows:dt.default.number,isBounded:dt.default.bool,isDraggable:dt.default.bool,isResizable:dt.default.bool,allowOverlap:dt.default.bool,preventCollision:dt.default.bool,useCSSTransforms:dt.default.bool,transformScale:dt.default.number,isDroppable:dt.default.bool,resizeHandles:nS,resizeHandle:rS,onLayoutChange:dt.default.func,onDragStart:dt.default.func,onDrag:dt.default.func,onDragStop:dt.default.func,onResizeStart:dt.default.func,onResize:dt.default.func,onResizeStop:dt.default.func,onDrop:dt.default.func,droppingItem:dt.default.shape({i:dt.default.string.isRequired,w:dt.default.number.isRequired,h:dt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};m4.default.Children.forEach(n,function(i){if((i==null?void 0:i.key)!=null){if(r[i.key])throw new Error('Duplicate child key "'+i.key+'" found! This will cause problems in ReactGridLayout.');r[i.key]=!0}})},innerRef:dt.default.any};ro.default=v4,Object.defineProperty(gf,"__esModule",{value:!0}),gf.default=void 0;var sl=mv(m),Mt=mv(Fo),b4=U_,y4=g4,al=pt,Nn=ki,iS=ro,x4=mv(Rm);function mv(e){return e&&e.__esModule?e:{default:e}}function Ti(e,t,n){return t=w4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w4(e){var t=_4(e,"string");return typeof t=="symbol"?t:String(t)}function _4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class vv extends sl.default.Component{constructor(){super(...arguments),Ti(this,"state",{resizing:null,dragging:null,className:""}),Ti(this,"elementRef",sl.default.createRef()),Ti(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:i,transformScale:o}=this.props;if(!i)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),d=c.left/o,f=l.left/o,g=c.top/o,p=l.top/o;s.left=d-f+a.scrollLeft,s.top=g-p+a.scrollTop,this.setState({dragging:s});const{x:v,y}=(0,Nn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return i.call(this,this.props.i,v,y,{e:t,node:r,newPosition:s})}),Ti(this,"onDrag",(t,n)=>{let{node:r,deltaX:i,deltaY:o}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+o,l=this.state.dragging.left+i;const{isBounded:c,i:d,w:f,h:g,containerWidth:p}=this.props,v=this.getPositionParams();if(c){const{offsetParent:S}=r;if(S){const{margin:C,rowHeight:P}=this.props,O=S.clientHeight-(0,Nn.calcGridItemWHPx)(g,P,C[1]);a=(0,Nn.clamp)(a,0,O);const k=(0,Nn.calcGridColWidth)(v),A=p-(0,Nn.calcGridItemWHPx)(f,k,C[0]);l=(0,Nn.clamp)(l,0,A)}}const y={top:a,left:l};this.setState({dragging:y});const{x,y:w}=(0,Nn.calcXY)(v,a,l,f,g);return s.call(this,d,x,w,{e:t,node:r,newPosition:y})}),Ti(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:o,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,d={top:c,left:l};this.setState({dragging:null});const{x:f,y:g}=(0,Nn.calcXY)(this.getPositionParams(),c,l,o,s);return i.call(this,a,f,g,{e:t,node:r,newPosition:d})}),Ti(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Ti(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Ti(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,Nn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,Nn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,al.fastPositionEqual)(r,i)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const i=t.droppingPosition||{left:0,top:0},{dragging:o}=this.state,s=o&&n.left!==i.left||n.top!==i.top;if(!o)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-o.left,l=n.top-o.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:i}=this.props;let o;return i?o=(0,al.setTransform)(t):(o=(0,al.setTopLeft)(t),n&&(o.left=(0,al.perc)(t.left/r),o.width=(0,al.perc)(t.width/r))),o}mixinDraggable(t,n){return sl.default.createElement(b4.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,i)=>n(r,i,t)}mixinResizable(t,n,r){const{cols:i,minW:o,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:d,resizeHandle:f}=this.props,g=this.getPositionParams(),p=(0,Nn.calcGridItemPosition)(g,0,0,i,0).width,v=(0,Nn.calcGridItemPosition)(g,0,0,o,s),y=(0,Nn.calcGridItemPosition)(g,0,0,a,l),x=[v.width,v.height],w=[Math.min(y.width,p),Math.min(y.height,1/0)];return sl.default.createElement(y4.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:w,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:d,handle:f},t)}onResizeHandler(t,n,r,i){let{node:o,size:s,handle:a}=n;const l=this.props[i];if(!l)return;const{x:c,y:d,i:f,maxH:g,minH:p,containerWidth:v}=this.props,{minW:y,maxW:x}=this.props;let w=s;o&&(w=(0,al.resizeItemInDirection)(a,r,s,v),this.setState({resizing:i==="onResizeStop"?null:w}));let{w:S,h:C}=(0,Nn.calcWH)(this.getPositionParams(),w.width,w.height,c,d,a);S=(0,Nn.clamp)(S,Math.max(y,1),x),C=(0,Nn.clamp)(C,p,g),l.call(this,f,S,C,{e:t,node:o,size:w,handle:a})}render(){const{x:t,y:n,w:r,h:i,isDraggable:o,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,Nn.calcGridItemPosition)(this.getPositionParams(),t,n,r,i,this.state),d=sl.default.Children.only(this.props.children);let f=sl.default.cloneElement(d,{ref:this.elementRef,className:(0,x4.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":o,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(c)}});return f=this.mixinResizable(f,c,s),f=this.mixinDraggable(f,o),f}}gf.default=vv,Ti(vv,"propTypes",{children:Mt.default.element,cols:Mt.default.number.isRequired,containerWidth:Mt.default.number.isRequired,rowHeight:Mt.default.number.isRequired,margin:Mt.default.array.isRequired,maxRows:Mt.default.number.isRequired,containerPadding:Mt.default.array.isRequired,x:Mt.default.number.isRequired,y:Mt.default.number.isRequired,w:Mt.default.number.isRequired,h:Mt.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:Mt.default.string.isRequired,resizeHandles:iS.resizeHandleAxesType,resizeHandle:iS.resizeHandleType,onDragStop:Mt.default.func,onDragStart:Mt.default.func,onDrag:Mt.default.func,onResizeStop:Mt.default.func,onResizeStart:Mt.default.func,onResize:Mt.default.func,isDraggable:Mt.default.bool.isRequired,isResizable:Mt.default.bool.isRequired,isBounded:Mt.default.bool.isRequired,static:Mt.default.bool,useCSSTransforms:Mt.default.bool.isRequired,transformScale:Mt.default.number,className:Mt.default.string,handle:Mt.default.string,cancel:Mt.default.string,droppingPosition:Mt.default.shape({e:Mt.default.object.isRequired,left:Mt.default.number.isRequired,top:Mt.default.number.isRequired})}),Ti(vv,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.default=void 0;var Bs=O4(m),bv=Nm,S4=yv(Rm),Ye=pt,C4=ki,oS=yv(gf),E4=yv(ro);function yv(e){return e&&e.__esModule?e:{default:e}}function sS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(sS=function(r){return r?n:t})(e)}function O4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=sS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Wn(e,t,n){return t=P4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P4(e){var t=k4(e,"string");return typeof t=="symbol"?t:String(t)}function k4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const aS="react-grid-layout";let lS=!1;try{lS=/firefox/i.test(navigator.userAgent)}catch{}class Ef extends Bs.Component{constructor(){super(...arguments),Wn(this,"state",{activeDrag:null,layout:(0,Ye.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,Ye.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Wn(this,"dragEnterCounter",0),Wn(this,"onDragStart",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a}=this.state,l=(0,Ye.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,Ye.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,o,s)}),Wn(this,"onDrag",(t,n,r,i)=>{let{e:o,node:s}=i;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:d,preventCollision:f}=this.props,g=(0,Ye.getLayoutItem)(l,t);if(!g)return;const p={w:g.w,h:g.h,x:g.x,y:g.y,placeholder:!0,i:t},v=!0;l=(0,Ye.moveElement)(l,g,n,r,v,f,(0,Ye.compactType)(this.props),c,d),this.props.onDrag(l,a,g,p,o,s),this.setState({layout:d?l:(0,Ye.compact)(l,(0,Ye.compactType)(this.props),c),activeDrag:p})}),Wn(this,"onDragStop",(t,n,r,i)=>{let{e:o,node:s}=i;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:d,allowOverlap:f}=this.props,g=(0,Ye.getLayoutItem)(l,t);if(!g)return;const p=!0;l=(0,Ye.moveElement)(l,g,n,r,p,d,(0,Ye.compactType)(this.props),c,f);const v=f?l:(0,Ye.compact)(l,(0,Ye.compactType)(this.props),c);this.props.onDragStop(v,a,g,null,o,s);const{oldLayout:y}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,y)}),Wn(this,"onResizeStart",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a}=this.state,l=(0,Ye.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,Ye.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,o,s))}),Wn(this,"onResize",(t,n,r,i)=>{let{e:o,node:s,size:a,handle:l}=i;const{oldResizeItem:c}=this.state;let{layout:d}=this.state;const{cols:f,preventCollision:g,allowOverlap:p}=this.props;let v=!1,y,x,w;const[S,C]=(0,Ye.withLayoutItem)(d,t,O=>{let k;return x=O.x,w=O.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=O.x+(O.w-n),n=O.x!==x&&x<0?O.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(w=O.y+(O.h-r),r=O.y!==w&&w<0?O.h:r,w=w<0?0:w),v=!0),g&&!p&&(k=(0,Ye.getAllCollisions)(d,{...O,w:n,h:r,x,y:w}).filter(L=>L.i!==O.i).length>0,k&&(w=O.y,r=O.h,x=O.x,n=O.w,v=!1)),O.w=n,O.h=r,O});if(!C)return;y=S,v&&(y=(0,Ye.moveElement)(S,C,x,w,!0,this.props.preventCollision,(0,Ye.compactType)(this.props),f,p));const P={w:C.w,h:C.h,x:C.x,y:C.y,static:!0,i:t};this.props.onResize(y,c,C,P,o,s),this.setState({layout:p?y:(0,Ye.compact)(y,(0,Ye.compactType)(this.props),f),activeDrag:P})}),Wn(this,"onResizeStop",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:d}=this.props,f=(0,Ye.getLayoutItem)(a,t),g=d?a:(0,Ye.compact)(a,(0,Ye.compactType)(this.props),c);this.props.onResizeStop(g,l,f,null,o,s);const{oldLayout:p}=this.state;this.setState({activeDrag:null,layout:g,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(g,p)}),Wn(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),lS&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(aS)))return!1;const{droppingItem:r,onDropDragOver:i,margin:o,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:d,transformScale:f}=this.props,g=i==null?void 0:i(t);if(g===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...r,...g},{layout:v}=this.state,{layerX:y,layerY:x}=t.nativeEvent,w={left:y/f,top:x/f,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:S,top:C}=this.state.droppingPosition;(S!=y||C!=x)&&this.setState({droppingPosition:w})}}else{const S={cols:s,margin:o,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:d||o},C=(0,C4.calcXY)(S,x,y,p.w,p.h);this.setState({droppingDOMNode:Bs.createElement("div",{key:p.i}),droppingPosition:w,layout:[...v,{...p,x:C.x,y:C.y,static:!1,isDraggable:!0}]})}}),Wn(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,i=(0,Ye.compact)(r.filter(o=>o.i!==t.i),(0,Ye.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:i,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Wn(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Wn(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Wn(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,i=r.find(o=>o.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,i,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,bv.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,Ye.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,Ye.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,Ye.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,Ye.fastRGLPropsEqual)(this.props,t,bv.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,i=n.layout;this.onLayoutMaybeChanged(r,i)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,Ye.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,bv.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:i,containerPadding:o,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return Bs.createElement(oS.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:n,cols:r,margin:i,containerPadding:o||i,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Bs.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,Ye.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:i,cols:o,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:d,isResizable:f,isBounded:g,useCSSTransforms:p,transformScale:v,draggableCancel:y,draggableHandle:x,resizeHandles:w,resizeHandle:S}=this.props,{mounted:C,droppingPosition:P}=this.state,O=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&d,k=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,A=r.resizeHandles||w,L=O&&g&&r.isBounded!==!1;return Bs.createElement(oS.default,{containerWidth:i,cols:o,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:y,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:O,isResizable:k,isBounded:L,useCSSTransforms:p&&C,usePercentages:!C,transformScale:v,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?P:void 0,resizeHandles:A,resizeHandle:S},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:i}=this.props,o=(0,S4.default)(aS,t),s={height:this.containerHeight(),...n};return Bs.createElement("div",{ref:i,className:o,style:s,onDrop:r?this.onDrop:Ye.noop,onDragLeave:r?this.onDragLeave:Ye.noop,onDragEnter:r?this.onDragEnter:Ye.noop,onDragOver:r?this.onDragOver:Ye.noop},Bs.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Fc.default=Ef,Wn(Ef,"displayName","ReactGridLayout"),Wn(Ef,"propTypes",E4.default),Wn(Ef,"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:Ye.noop,onDragStart:Ye.noop,onDrag:Ye.noop,onDragStop:Ye.noop,onResizeStart:Ye.noop,onResize:Ye.noop,onResizeStop:Ye.noop,onDrop:Ye.noop,onDropDragOver:Ye.noop});var Of={},Vs={};Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.findOrGenerateResponsiveLayout=T4,Vs.getBreakpointFromWidth=M4,Vs.getColsFromBreakpoint=D4,Vs.sortBreakpoints=xv;var Pf=pt;function M4(e,t){const n=xv(e);let r=n[0];for(let i=1,o=n.length;i<o;i++){const s=n[i];t>e[s]&&(r=s)}return r}function D4(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function T4(e,t,n,r,i,o){if(e[n])return(0,Pf.cloneLayout)(e[n]);let s=e[r];const a=xv(t),l=a.slice(a.indexOf(n));for(let c=0,d=l.length;c<d;c++){const f=l[c];if(e[f]){s=e[f];break}}return s=(0,Pf.cloneLayout)(s||[]),(0,Pf.compact)((0,Pf.correctBounds)(s,{cols:i}),o,i)}function xv(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(Of,"__esModule",{value:!0}),Of.default=void 0;var cS=I4(m),ar=uS(Fo),wv=Nm,ll=pt,Hs=Vs,A4=uS(Fc);function uS(e){return e&&e.__esModule?e:{default:e}}function dS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(dS=function(r){return r?n:t})(e)}function I4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=dS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function _v(){return _v=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},_v.apply(this,arguments)}function kf(e,t,n){return t=N4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N4(e){var t=R4(e,"string");return typeof t=="symbol"?t:String(t)}function R4(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const fS=e=>Object.prototype.toString.call(e);function Mf(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class Sv extends cS.Component{constructor(){super(...arguments),kf(this,"state",this.generateInitialState()),kf(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:i}=this.props,o=(0,Hs.getBreakpointFromWidth)(n,t),s=(0,Hs.getColsFromBreakpoint)(o,i),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Hs.findOrGenerateResponsiveLayout)(r,n,o,o,s,a),breakpoint:o,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,wv.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:i}=n;return{layout:(0,Hs.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,i,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,wv.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,wv.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:i,compactType:o}=this.props,s=this.props.breakpoint||(0,Hs.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,Hs.getColsFromBreakpoint)(s,r),c={...i};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,ll.cloneLayout)(this.state.layout));let g=(0,Hs.findOrGenerateResponsiveLayout)(c,n,s,a,l,o);g=(0,ll.synchronizeLayoutWithChildren)(g,this.props.children,l,o,this.props.allowOverlap),c[s]=g,this.props.onLayoutChange(g,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:g,cols:l})}const d=Mf(this.props.margin,s),f=Mf(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,d,l,f)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:i,margin:o,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...d}=this.props;return cS.createElement(A4.default,_v({},d,{margin:Mf(o,this.state.breakpoint),containerPadding:Mf(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Of.default=Sv,kf(Sv,"propTypes",{breakpoint:ar.default.string,breakpoints:ar.default.object,allowOverlap:ar.default.bool,cols:ar.default.object,margin:ar.default.oneOfType([ar.default.array,ar.default.object]),containerPadding:ar.default.oneOfType([ar.default.array,ar.default.object]),layouts(e,t){if(fS(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+fS(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,ll.validateLayout)(e.layouts[n],"layouts."+n)})},width:ar.default.number.isRequired,onBreakpointChange:ar.default.func,onLayoutChange:ar.default.func,onWidthChange:ar.default.func}),kf(Sv,"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:ll.noop,onLayoutChange:ll.noop,onWidthChange:ll.noop});var Cv={},hS=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(i,o){return i[0]===n?(r=o,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(n,r){var i=e(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,i=e(r,n);~i&&r.splice(i,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i<o.length;i++){var s=o[i];n.call(r,s[1],s[0])}},t}()}(),Ev=typeof window<"u"&&typeof document<"u"&&window.document===document,Df=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")()}(),L4=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Df):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),$4=2;function F4(e,t){var n=!1,r=!1,i=0;function o(){n&&(n=!1,e()),r&&a()}function s(){L4(o)}function a(){var l=Date.now();if(n){if(l-i<$4)return;r=!0}else n=!0,r=!1,setTimeout(s,t);i=l}return a}var j4=20,z4=["top","right","bottom","left","width","height","size","weight"],B4=typeof MutationObserver<"u",V4=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=F4(this.refresh.bind(this),j4)}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(){!Ev||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),B4?(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(){!Ev||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=z4.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),pS=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},cl=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Df},gS=Af(0,0,0,0);function Tf(e){return parseFloat(e)||0}function mS(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,i){var o=e["border-"+i+"-width"];return r+Tf(o)},0)}function H4(e){for(var t=["top","right","bottom","left"],n={},r=0,i=t;r<i.length;r++){var o=i[r],s=e["padding-"+o];n[o]=Tf(s)}return n}function W4(e){var t=e.getBBox();return Af(0,0,t.width,t.height)}function q4(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return gS;var r=cl(e).getComputedStyle(e),i=H4(r),o=i.left+i.right,s=i.top+i.bottom,a=Tf(r.width),l=Tf(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+o)!==t&&(a-=mS(r,"left","right")+o),Math.round(l+s)!==n&&(l-=mS(r,"top","bottom")+s)),!G4(e)){var c=Math.round(a+o)-t,d=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(d)!==1&&(l-=d)}return Af(i.left,i.top,a,l)}var U4=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof cl(e).SVGGraphicsElement}:function(e){return e instanceof cl(e).SVGElement&&typeof e.getBBox=="function"}}();function G4(e){return e===cl(e).document.documentElement}function Y4(e){return Ev?U4(e)?W4(e):q4(e):gS}function K4(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(o.prototype);return pS(s,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),s}function Af(e,t,n,r){return{x:e,y:t,width:n,height:r}}var X4=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Af(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=Y4(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}(),Q4=function(){function e(t,n){var r=K4(n);pS(this,{target:t,contentRect:r})}return e}(),Z4=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new hS,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 cl(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new X4(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 cl(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 Q4(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}(),vS=typeof WeakMap<"u"?new WeakMap:new hS,bS=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=V4.getInstance(),r=new Z4(t,n,this);vS.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){bS.prototype[e]=function(){var t;return(t=vS.get(this))[e].apply(t,arguments)}});var J4=function(){return typeof Df.ResizeObserver<"u"?Df.ResizeObserver:bS}();const eL=Yg(Object.freeze(Object.defineProperty({__proto__:null,default:J4},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(Cv,"__esModule",{value:!0}),Cv.default=lL;var If=iL(m),tL=Ov(Fo),nL=Ov(eL),rL=Ov(Rm);function Ov(e){return e&&e.__esModule?e:{default:e}}function yS(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(yS=function(r){return r?n:t})(e)}function iL(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=yS(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Pv(){return Pv=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},Pv.apply(this,arguments)}function ul(e,t,n){return t=oL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oL(e){var t=sL(e,"string");return typeof t=="symbol"?t:String(t)}function sL(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const aL="react-grid-layout";function lL(e){var t;return t=class extends If.Component{constructor(){super(...arguments),ul(this,"state",{width:1280}),ul(this,"elementRef",If.createRef()),ul(this,"mounted",!1),ul(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new nL.default(i=>{if(this.elementRef.current instanceof HTMLElement){const s=i[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...i}=this.props;return r&&!this.mounted?If.createElement("div",{className:(0,rL.default)(this.props.className,aL),style:this.props.style,ref:this.elementRef}):If.createElement(e,Pv({innerRef:this.elementRef},i,this.state))}},ul(t,"defaultProps",{measureBeforeMount:!1}),ul(t,"propTypes",{measureBeforeMount:tL.default.bool}),t}(function(e){e.exports=Fc.default,e.exports.utils=pt,e.exports.calculateUtils=ki,e.exports.Responsive=Of.default,e.exports.Responsive.utils=Vs,e.exports.WidthProvider=Cv.default})(c_);var xS=c_.exports;function qc({children:e,className:t,text:n,onSave:r}){const[i,o]=m.useState(!1),[s,a]=m.useState(n),l=be(d=>d.isDashboardEditing),c=d=>{d.stopPropagation(),l&&o(!0)};return _.jsx("div",{role:"editable",onDoubleClick:c,children:i?_.jsx("input",{type:"text",className:Pe("px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:d=>a(d.target.value),value:s,autoFocus:!0,onBlur:()=>o(!1),onKeyDown:d=>{d.key==="Enter"&&(o(!1),r(s))}}):e})}const kv=ue.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));kv.displayName="Card";const Mv=ue.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe("flex flex-col space-y-1.5 p-6",e),...t}));Mv.displayName="CardHeader";const Dv=ue.forwardRef(({className:e,...t},n)=>_.jsx("h3",{ref:n,className:Pe("text-2xl font-semibold leading-none tracking-tight",e),...t}));Dv.displayName="CardTitle";const Tv=ue.forwardRef(({className:e,...t},n)=>_.jsx("p",{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));Tv.displayName="CardDescription";const Av=ue.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe("p-6 pt-0",e),...t}));Av.displayName="CardContent";const cL=ue.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe("flex items-center p-6 pt-0",e),...t}));cL.displayName="CardFooter";/*!
|
|
107
|
+
* @kurkle/color v0.3.2
|
|
108
|
+
* https://github.com/kurkle/color#readme
|
|
109
|
+
* (c) 2023 Jukka Kurkela
|
|
110
|
+
* Released under the MIT License
|
|
111
|
+
*/function Uc(e){return e+.5|0}const Bo=(e,t,n)=>Math.max(Math.min(e,n),t);function Gc(e){return Bo(Uc(e*2.55),0,255)}function Vo(e){return Bo(Uc(e*255),0,255)}function io(e){return Bo(Uc(e/2.55)/100,0,1)}function wS(e){return Bo(Uc(e*100),0,100)}const Xr={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},Iv=[..."0123456789ABCDEF"],uL=e=>Iv[e&15],dL=e=>Iv[(e&240)>>4]+Iv[e&15],Nf=e=>(e&240)>>4===(e&15),fL=e=>Nf(e.r)&&Nf(e.g)&&Nf(e.b)&&Nf(e.a);function hL(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Xr[e[1]]*17,g:255&Xr[e[2]]*17,b:255&Xr[e[3]]*17,a:t===5?Xr[e[4]]*17:255}:(t===7||t===9)&&(n={r:Xr[e[1]]<<4|Xr[e[2]],g:Xr[e[3]]<<4|Xr[e[4]],b:Xr[e[5]]<<4|Xr[e[6]],a:t===9?Xr[e[7]]<<4|Xr[e[8]]:255})),n}const pL=(e,t)=>e<255?t(e):"";function gL(e){var t=fL(e)?uL:dL;return e?"#"+t(e.r)+t(e.g)+t(e.b)+pL(e.a,t):void 0}const mL=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function _S(e,t,n){const r=t*Math.min(n,1-n),i=(o,s=(o+e/30)%12)=>n-r*Math.max(Math.min(s-3,9-s,1),-1);return[i(0),i(8),i(4)]}function vL(e,t,n){const r=(i,o=(i+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function bL(e,t,n){const r=_S(e,1,.5);let i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function yL(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function Nv(e){const n=e.r/255,r=e.g/255,i=e.b/255,o=Math.max(n,r,i),s=Math.min(n,r,i),a=(o+s)/2;let l,c,d;return o!==s&&(d=o-s,c=a>.5?d/(2-o-s):d/(o+s),l=yL(n,r,i,d,o),l=l*60+.5),[l|0,c||0,a]}function Rv(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Vo)}function Lv(e,t,n){return Rv(_S,e,t,n)}function xL(e,t,n){return Rv(bL,e,t,n)}function wL(e,t,n){return Rv(vL,e,t,n)}function SS(e){return(e%360+360)%360}function _L(e){const t=mL.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Gc(+t[5]):Vo(+t[5]));const i=SS(+t[2]),o=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=xL(i,o,s):t[1]==="hsv"?r=wL(i,o,s):r=Lv(i,o,s),{r:r[0],g:r[1],b:r[2],a:n}}function SL(e,t){var n=Nv(e);n[0]=SS(n[0]+t),n=Lv(n),e.r=n[0],e.g=n[1],e.b=n[2]}function CL(e){if(!e)return;const t=Nv(e),n=t[0],r=wS(t[1]),i=wS(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${io(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const CS={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"},ES={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 EL(){const e={},t=Object.keys(ES),n=Object.keys(CS);let r,i,o,s,a;for(r=0;r<t.length;r++){for(s=a=t[r],i=0;i<n.length;i++)o=n[i],a=a.replace(o,CS[o]);o=parseInt(ES[s],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let Rf;function OL(e){Rf||(Rf=EL(),Rf.transparent=[0,0,0,0]);const t=Rf[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const PL=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function kL(e){const t=PL.exec(e);let n=255,r,i,o;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?Gc(s):Bo(s*255,0,255)}return r=+t[1],i=+t[3],o=+t[5],r=255&(t[2]?Gc(r):Bo(r,0,255)),i=255&(t[4]?Gc(i):Bo(i,0,255)),o=255&(t[6]?Gc(o):Bo(o,0,255)),{r,g:i,b:o,a:n}}}function ML(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${io(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const $v=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,dl=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function DL(e,t,n){const r=dl(io(e.r)),i=dl(io(e.g)),o=dl(io(e.b));return{r:Vo($v(r+n*(dl(io(t.r))-r))),g:Vo($v(i+n*(dl(io(t.g))-i))),b:Vo($v(o+n*(dl(io(t.b))-o))),a:e.a+n*(t.a-e.a)}}function Lf(e,t,n){if(e){let r=Nv(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Lv(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function OS(e,t){return e&&Object.assign(t||{},e)}function PS(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=Vo(e[3]))):(t=OS(e,{r:0,g:0,b:0,a:1}),t.a=Vo(t.a)),t}function TL(e){return e.charAt(0)==="r"?kL(e):_L(e)}class Yc{constructor(t){if(t instanceof Yc)return t;const n=typeof t;let r;n==="object"?r=PS(t):n==="string"&&(r=hL(t)||OL(t)||TL(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=OS(this._rgb);return t&&(t.a=io(t.a)),t}set rgb(t){this._rgb=PS(t)}rgbString(){return this._valid?ML(this._rgb):void 0}hexString(){return this._valid?gL(this._rgb):void 0}hslString(){return this._valid?CL(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,i=t.rgb;let o;const s=n===o?.5:n,a=2*s-1,l=r.a-i.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,r.r=255&c*r.r+o*i.r+.5,r.g=255&c*r.g+o*i.g+.5,r.b=255&c*r.b+o*i.b+.5,r.a=s*r.a+(1-s)*i.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=DL(this._rgb,t._rgb,n)),this}clone(){return new Yc(this.rgb)}alpha(t){return this._rgb.a=Vo(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Uc(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 Lf(this._rgb,2,t),this}darken(t){return Lf(this._rgb,2,-t),this}saturate(t){return Lf(this._rgb,1,t),this}desaturate(t){return Lf(this._rgb,1,-t),this}rotate(t){return SL(this._rgb,t),this}}/*!
|
|
112
|
+
* Chart.js v4.4.1
|
|
113
|
+
* https://www.chartjs.org
|
|
114
|
+
* (c) 2023 Chart.js Contributors
|
|
115
|
+
* Released under the MIT License
|
|
116
|
+
*/function oo(){}const AL=(()=>{let e=0;return()=>e++})();function gt(e){return e===null||typeof e>"u"}function Yt(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 wt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function cn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Or(e,t){return cn(e)?e:t}function tt(e,t){return typeof e>"u"?t:e}const IL=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,kS=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function jt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Nt(e,t,n,r){let i,o,s;if(Yt(e))if(o=e.length,r)for(i=o-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;i<o;i++)t.call(n,e[i],i);else if(wt(e))for(s=Object.keys(e),o=s.length,i=0;i<o;i++)t.call(n,e[s[i]],s[i])}function $f(e,t){let n,r,i,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],o=t[n],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function Ff(e){if(Yt(e))return e.map(Ff);if(wt(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=Ff(e[n[i]]);return t}return e}function MS(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function NL(e,t,n,r){if(!MS(e))return;const i=t[e],o=n[e];wt(i)&&wt(o)?Ai(i,o,r):t[e]=Ff(o)}function Ai(e,t,n){const r=Yt(t)?t:[t],i=r.length;if(!wt(e))return e;n=n||{};const o=n.merger||NL;let s;for(let a=0;a<i;++a){if(s=r[a],!wt(s))continue;const l=Object.keys(s);for(let c=0,d=l.length;c<d;++c)o(l[c],e,s,n)}return e}function Kc(e,t){return Ai(e,t,{merger:RL})}function RL(e,t,n){if(!MS(e))return;const r=t[e],i=n[e];wt(r)&&wt(i)?Kc(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ff(i))}const DS={"":e=>e,x:e=>e.x,y:e=>e.y};function LL(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function $L(e){const t=LL(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Ho(e,t){return(DS[t]||(DS[t]=$L(t)))(e)}function Fv(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Xc=e=>typeof e<"u",Wo=e=>typeof e=="function",TS=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function FL(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Kt=Math.PI,Xt=2*Kt,jL=Xt+Kt,jf=Number.POSITIVE_INFINITY,zL=Kt/180,dn=Kt/2,Ws=Kt/4,AS=Kt*2/3,qo=Math.log10,Ii=Math.sign;function Qc(e,t,n){return Math.abs(e-t)<n}function IS(e){const t=Math.round(e);e=Qc(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(qo(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function BL(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((i,o)=>i-o).pop(),t}function fl(e){return!isNaN(parseFloat(e))&&isFinite(e)}function VL(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function NS(e,t,n){let r,i,o;for(r=0,i=e.length;r<i;r++)o=e[r][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function mi(e){return e*(Kt/180)}function jv(e){return e*(180/Kt)}function RS(e){if(!cn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function LS(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*Kt&&(o+=Xt),{angle:o,distance:i}}function zv(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function HL(e,t){return(e-t+jL)%Xt-Kt}function Pr(e){return(e%Xt+Xt)%Xt}function Zc(e,t,n,r){const i=Pr(e),o=Pr(t),s=Pr(n),a=Pr(o-i),l=Pr(s-i),c=Pr(i-o),d=Pr(i-s);return i===o||i===s||r&&o===s||a>l&&c<d}function kn(e,t,n){return Math.max(t,Math.min(n,e))}function WL(e){return kn(e,-32768,32767)}function so(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Bv(e,t,n){n=n||(s=>e[s]<t);let r=e.length-1,i=0,o;for(;r-i>1;)o=i+r>>1,n(o)?i=o:r=o;return{lo:i,hi:r}}const ao=(e,t,n,r)=>Bv(e,n,r?i=>{const o=e[i][t];return o<n||o===n&&e[i+1][t]===n}:i=>e[i][t]<n),qL=(e,t,n)=>Bv(e,n,r=>e[r][t]>=n);function UL(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}const $S=["push","pop","shift","splice","unshift"];function GL(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),$S.forEach(n=>{const r="_onData"+Fv(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const s=i.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),s}})})}function FS(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&($S.forEach(o=>{delete e[o]}),delete e._chartjs)}function jS(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const zS=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function BS(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,zS.call(window,()=>{r=!1,e.apply(t,n)}))}}function YL(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Vv=e=>e==="start"?"left":e==="end"?"right":"center",qn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,KL=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function VS(e,t,n){const r=t.length;let i=0,o=r;if(e._sorted){const{iScale:s,_parsed:a}=e,l=s.axis,{min:c,max:d,minDefined:f,maxDefined:g}=s.getUserBounds();f&&(i=kn(Math.min(ao(a,l,c).lo,n?r:ao(t,l,s.getPixelForValue(c)).lo),0,r-1)),g?o=kn(Math.max(ao(a,s.axis,d,!0).hi+1,n?0:ao(t,l,s.getPixelForValue(d),!0).hi+1),i,r)-i:o=r-i}return{start:i,count:o}}function HS(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),o}const zf=e=>e===0||e===1,WS=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Xt/n)),qS=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Xt/n)+1,Jc={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*dn)+1,easeOutSine:e=>Math.sin(e*dn),easeInOutSine:e=>-.5*(Math.cos(Kt*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=>zf(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=>zf(e)?e:WS(e,.075,.3),easeOutElastic:e=>zf(e)?e:qS(e,.075,.3),easeInOutElastic(e){return zf(e)?e:e<.5?.5*WS(e*2,.1125,.45):.5+.5*qS(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-Jc.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?Jc.easeInBounce(e*2)*.5:Jc.easeOutBounce(e*2-1)*.5+.5};function Hv(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function US(e){return Hv(e)?e:new Yc(e)}function Wv(e){return Hv(e)?e:new Yc(e).saturate(.5).darken(.1).hexString()}const XL=["x","y","borderWidth","radius","tension"],QL=["color","borderColor","backgroundColor"];function ZL(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:QL},numbers:{type:"number",properties:XL}}),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 JL(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const GS=new Map;function e9(e,t){t=t||{};const n=e+JSON.stringify(t);let r=GS.get(n);return r||(r=new Intl.NumberFormat(e,t),GS.set(n,r)),r}function eu(e,t,n){return e9(t,n).format(e)}const YS={values(e){return Yt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),o=t9(e,n)}const s=qo(Math.abs(o)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),eu(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(qo(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?YS.numeric.call(this,e,t,n):""}};function t9(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 Bf={formatters:YS};function n9(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:Bf.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 qs=Object.create(null),qv=Object.create(null);function tu(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const o=n[r];e=e[o]||(e[o]=Object.create(null))}return e}function Uv(e,t,n){return typeof t=="string"?Ai(tu(e,t),n):Ai(tu(e,""),t)}class r9{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>Wv(i.backgroundColor),this.hoverBorderColor=(r,i)=>Wv(i.borderColor),this.hoverColor=(r,i)=>Wv(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Uv(this,t,n)}get(t){return tu(this,t)}describe(t,n){return Uv(qv,t,n)}override(t,n){return Uv(qs,t,n)}route(t,n,r,i){const o=tu(this,t),s=tu(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[i];return wt(l)?Object.assign({},c,l):tt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var on=new r9({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ZL,JL,n9]);function i9(e){return!e||gt(e.size)||gt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Vf(e,t,n,r,i){let o=t[i];return o||(o=t[i]=e.measureText(i).width,n.push(i)),o>r&&(r=o),r}function o9(e,t,n,r){r=r||{};let i=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},o=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=n.length;let l,c,d,f,g;for(l=0;l<a;l++)if(f=n[l],f!=null&&!Yt(f))s=Vf(e,i,o,s,f);else if(Yt(f))for(c=0,d=f.length;c<d;c++)g=f[c],g!=null&&!Yt(g)&&(s=Vf(e,i,o,s,g));e.restore();const p=o.length/2;if(p>n.length){for(l=0;l<p;l++)delete i[o[l]];o.splice(0,p)}return s}function Us(e,t,n){const r=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*r)/r+i}function KS(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function Gv(e,t,n,r){XS(e,t,n,r,null)}function XS(e,t,n,r,i){let o,s,a,l,c,d,f,g;const p=t.pointStyle,v=t.rotation,y=t.radius;let x=(v||0)*zL;if(p&&typeof p=="object"&&(o=p.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(x),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(y)||y<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,y,0,0,Xt):e.arc(n,r,y,0,Xt),e.closePath();break;case"triangle":d=i?i/2:y,e.moveTo(n+Math.sin(x)*d,r-Math.cos(x)*y),x+=AS,e.lineTo(n+Math.sin(x)*d,r-Math.cos(x)*y),x+=AS,e.lineTo(n+Math.sin(x)*d,r-Math.cos(x)*y),e.closePath();break;case"rectRounded":c=y*.516,l=y-c,s=Math.cos(x+Ws)*l,f=Math.cos(x+Ws)*(i?i/2-c:l),a=Math.sin(x+Ws)*l,g=Math.sin(x+Ws)*(i?i/2-c:l),e.arc(n-f,r-a,c,x-Kt,x-dn),e.arc(n+g,r-s,c,x-dn,x),e.arc(n+f,r+a,c,x,x+dn),e.arc(n-g,r+s,c,x+dn,x+Kt),e.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*y,d=i?i/2:l,e.rect(n-d,r-l,2*d,2*l);break}x+=Ws;case"rectRot":f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+g,r-s),e.lineTo(n+f,r+a),e.lineTo(n-g,r+s),e.closePath();break;case"crossRot":x+=Ws;case"cross":f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s);break;case"star":f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s),x+=Ws,f=Math.cos(x)*(i?i/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(i?i/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s);break;case"line":s=i?i/2:Math.cos(x)*y,a=Math.sin(x)*y,e.moveTo(n-s,r-a),e.lineTo(n+s,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(x)*(i?i/2:y),r+Math.sin(x)*y);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function lo(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 Hf(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Wf(e){e.restore()}function s9(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else i==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function a9(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 l9(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),gt(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 c9(e,t,n,r,i){if(i.strikethrough||i.underline){const o=e.measureText(r),s=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,d=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(s,d),e.lineTo(a,d),e.stroke()}}function u9(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Gs(e,t,n,r,i,o={}){const s=Yt(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,l9(e,o),l=0;l<s.length;++l)c=s[l],o.backdrop&&u9(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),gt(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,r,o.maxWidth)),e.fillText(c,n,r,o.maxWidth),c9(e,n,r,c,o),r+=Number(i.lineHeight);e.restore()}function nu(e,t){const{x:n,y:r,w:i,h:o,radius:s}=t;e.arc(n+s.topLeft,r+s.topLeft,s.topLeft,1.5*Kt,Kt,!0),e.lineTo(n,r+o-s.bottomLeft),e.arc(n+s.bottomLeft,r+o-s.bottomLeft,s.bottomLeft,Kt,dn,!0),e.lineTo(n+i-s.bottomRight,r+o),e.arc(n+i-s.bottomRight,r+o-s.bottomRight,s.bottomRight,dn,0,!0),e.lineTo(n+i,r+s.topRight),e.arc(n+i-s.topRight,r+s.topRight,s.topRight,0,-dn,!0),e.lineTo(n+s.topLeft,r)}const d9=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,f9=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function h9(e,t){const n=(""+e).match(d9);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 p9=e=>+e||0;function Yv(e,t){const n={},r=wt(t),i=r?Object.keys(t):t,o=wt(e)?r?s=>tt(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of i)n[s]=p9(o(s));return n}function QS(e){return Yv(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ys(e){return Yv(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Rn(e){const t=QS(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function bn(e,t){e=e||{},t=t||on.font;let n=tt(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=tt(e.style,t.style);r&&!(""+r).match(f9)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:tt(e.family,t.family),lineHeight:h9(tt(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:tt(e.weight,t.weight),string:""};return i.string=i9(i),i}function Qt(e,t,n,r){let i=!0,o,s,a;for(o=0,s=e.length;o<s;++o)if(a=e[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),i=!1),n!==void 0&&Yt(a)&&(a=a[n%a.length],i=!1),a!==void 0))return r&&!i&&(r.cacheable=!1),a}function g9(e,t,n){const{min:r,max:i}=e,o=kS(t,(i-r)/2),s=(a,l)=>n&&a===0?0:a+l;return{min:s(r,-Math.abs(o)),max:s(i,o)}}function Uo(e,t){return Object.assign(Object.create(e),t)}function Kv(e,t=[""],n,r,i=()=>e[0]){const o=n||e;typeof r>"u"&&(r=nC("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:i,override:a=>Kv([a,...e],t,o,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return JS(a,l,()=>S9(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return rC(a).includes(l)},ownKeys(a){return rC(a)},set(a,l,c){const d=a._storage||(a._storage=i());return a[l]=d[l]=c,delete a._keys,!0}})}function hl(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:ZS(e,r),setContext:o=>hl(e,o,n,r),override:o=>hl(e.override(o),t,n,r)};return new Proxy(i,{deleteProperty(o,s){return delete o[s],delete e[s],!0},get(o,s,a){return JS(o,s,()=>v9(o,s,a))},getOwnPropertyDescriptor(o,s){return o._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(o,s,a){return e[s]=a,delete o[s],!0}})}function ZS(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Wo(n)?n:()=>n,isIndexable:Wo(r)?r:()=>r}}const m9=(e,t)=>e?e+Fv(t):t,Xv=(e,t)=>wt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function JS(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function v9(e,t,n){const{_proxy:r,_context:i,_subProxy:o,_descriptors:s}=e;let a=r[t];return Wo(a)&&s.isScriptable(t)&&(a=b9(t,a,e,n)),Yt(a)&&a.length&&(a=y9(t,a,e,s.isIndexable)),Xv(t,a)&&(a=hl(a,i,o&&o[t],s)),a}function b9(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,s||r);return a.delete(e),Xv(e,l)&&(l=Qv(i._scopes,i,e,l)),l}function y9(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_descriptors:a}=n;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(wt(t[0])){const l=t,c=i._scopes.filter(d=>d!==l);t=[];for(const d of l){const f=Qv(c,i,e,d);t.push(hl(f,o,s&&s[e],a))}}return t}function eC(e,t,n){return Wo(e)?e(t,n):e}const x9=(e,t)=>e===!0?t:typeof e=="string"?Ho(t,e):void 0;function w9(e,t,n,r,i){for(const o of t){const s=x9(n,o);if(s){e.add(s);const a=eC(s._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function Qv(e,t,n,r){const i=t._rootScopes,o=eC(t._fallback,n,r),s=[...e,...i],a=new Set;a.add(r);let l=tC(a,s,n,o||n,r);return l===null||typeof o<"u"&&o!==n&&(l=tC(a,s,o,l,r),l===null)?!1:Kv(Array.from(a),[""],i,o,()=>_9(t,n,r))}function tC(e,t,n,r,i){for(;n;)n=w9(e,t,n,r,i);return n}function _9(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return Yt(i)&&wt(n)?n:i||{}}function S9(e,t,n,r){let i;for(const o of t)if(i=nC(m9(o,e),n),typeof i<"u")return Xv(e,i)?Qv(n,r,e,i):i}function nC(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function rC(e){let t=e._keys;return t||(t=e._keys=C9(e._scopes)),t}function C9(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}function iC(e,t,n,r){const{iScale:i}=e,{key:o="r"}=this._parsing,s=new Array(r);let a,l,c,d;for(a=0,l=r;a<l;++a)c=a+n,d=t[c],s[a]={r:i.parse(Ho(d,o),c)};return s}const E9=Number.EPSILON||1e-14,pl=(e,t)=>t<e.length&&!e[t].skip&&e[t],oC=e=>e==="x"?"y":"x";function O9(e,t,n,r){const i=e.skip?t:e,o=t,s=n.skip?t:n,a=zv(o,i),l=zv(s,o);let c=a/(a+l),d=l/(a+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;const f=r*c,g=r*d;return{previous:{x:o.x-f*(s.x-i.x),y:o.y-f*(s.y-i.y)},next:{x:o.x+g*(s.x-i.x),y:o.y+g*(s.y-i.y)}}}function P9(e,t,n){const r=e.length;let i,o,s,a,l,c=pl(e,0);for(let d=0;d<r-1;++d)if(l=c,c=pl(e,d+1),!(!l||!c)){if(Qc(t[d],0,E9)){n[d]=n[d+1]=0;continue}i=n[d]/t[d],o=n[d+1]/t[d],a=Math.pow(i,2)+Math.pow(o,2),!(a<=9)&&(s=3/Math.sqrt(a),n[d]=i*s*t[d],n[d+1]=o*s*t[d])}}function k9(e,t,n="x"){const r=oC(n),i=e.length;let o,s,a,l=pl(e,0);for(let c=0;c<i;++c){if(s=a,a=l,l=pl(e,c+1),!a)continue;const d=a[n],f=a[r];s&&(o=(d-s[n])/3,a[`cp1${n}`]=d-o,a[`cp1${r}`]=f-o*t[c]),l&&(o=(l[n]-d)/3,a[`cp2${n}`]=d+o,a[`cp2${r}`]=f+o*t[c])}}function M9(e,t="x"){const n=oC(t),r=e.length,i=Array(r).fill(0),o=Array(r);let s,a,l,c=pl(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=pl(e,s+1),!!l){if(c){const d=c[t]-l[t];i[s]=d!==0?(c[n]-l[n])/d:0}o[s]=a?c?Ii(i[s-1])!==Ii(i[s])?0:(i[s-1]+i[s])/2:i[s-1]:i[s]}P9(e,i,o),k9(e,o,t)}function qf(e,t,n){return Math.max(Math.min(e,n),t)}function D9(e,t){let n,r,i,o,s,a=lo(e[0],t);for(n=0,r=e.length;n<r;++n)s=o,o=a,a=n<r-1&&lo(e[n+1],t),o&&(i=e[n],s&&(i.cp1x=qf(i.cp1x,t.left,t.right),i.cp1y=qf(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=qf(i.cp2x,t.left,t.right),i.cp2y=qf(i.cp2y,t.top,t.bottom)))}function T9(e,t,n,r,i){let o,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")M9(e,i);else{let c=r?e[e.length-1]:e[0];for(o=0,s=e.length;o<s;++o)a=e[o],l=O9(c,a,e[Math.min(o+1,s-(r?0:1))%s],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&D9(e,n)}function Zv(){return typeof window<"u"&&typeof document<"u"}function Jv(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Uf(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 Gf=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function A9(e,t){return Gf(e).getPropertyValue(t)}const I9=["top","right","bottom","left"];function Ks(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=I9[i];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const N9=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function R9(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:o}=r;let s=!1,a,l;if(N9(i,o,e.target))a=i,l=o;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:a,y:l,box:s}}function Xs(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Gf(n),o=i.boxSizing==="border-box",s=Ks(i,"padding"),a=Ks(i,"border","width"),{x:l,y:c,box:d}=R9(e,n),f=s.left+(d&&a.left),g=s.top+(d&&a.top);let{width:p,height:v}=t;return o&&(p-=s.width+a.width,v-=s.height+a.height),{x:Math.round((l-f)/p*n.width/r),y:Math.round((c-g)/v*n.height/r)}}function L9(e,t,n){let r,i;if(t===void 0||n===void 0){const o=Jv(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const s=o.getBoundingClientRect(),a=Gf(o),l=Ks(a,"border","width"),c=Ks(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Uf(a.maxWidth,o,"clientWidth"),i=Uf(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||jf,maxHeight:i||jf}}const Yf=e=>Math.round(e*10)/10;function $9(e,t,n,r){const i=Gf(e),o=Ks(i,"margin"),s=Uf(i.maxWidth,e,"clientWidth")||jf,a=Uf(i.maxHeight,e,"clientHeight")||jf,l=L9(e,t,n);let{width:c,height:d}=l;if(i.boxSizing==="content-box"){const g=Ks(i,"border","width"),p=Ks(i,"padding");c-=p.width+g.width,d-=p.height+g.height}return c=Math.max(0,c-o.width),d=Math.max(0,r?c/r:d-o.height),c=Yf(Math.min(c,s,l.maxWidth)),d=Yf(Math.min(d,a,l.maxHeight)),c&&!d&&(d=Yf(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&d>l.height&&(d=l.height,c=Yf(Math.floor(d*r))),{width:c,height:d}}function sC(e,t,n){const r=t||1,i=Math.floor(e.height*r),o=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==i||s.width!==o?(e.currentDevicePixelRatio=r,s.height=i,s.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const F9=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Zv()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function aC(e,t){const n=A9(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Qs(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function j9(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 z9(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},s=Qs(e,i,n),a=Qs(i,o,n),l=Qs(o,t,n),c=Qs(s,a,n),d=Qs(a,l,n);return Qs(c,d,n)}const B9=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}}},V9=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function gl(e,t,n){return e?B9(t,n):V9()}function lC(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 cC(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function uC(e){return e==="angle"?{between:Zc,compare:HL,normalize:Pr}:{between:so,compare:(t,n)=>t-n,normalize:t=>t}}function dC({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function H9(e,t,n){const{property:r,start:i,end:o}=n,{between:s,normalize:a}=uC(r),l=t.length;let{start:c,end:d,loop:f}=e,g,p;if(f){for(c+=l,d+=l,g=0,p=l;g<p&&s(a(t[c%l][r]),i,o);++g)c--,d--;c%=l,d%=l}return d<c&&(d+=l),{start:c,end:d,loop:f,style:e.style}}function fC(e,t,n){if(!n)return[e];const{property:r,start:i,end:o}=n,s=t.length,{compare:a,between:l,normalize:c}=uC(r),{start:d,end:f,loop:g,style:p}=H9(e,t,n),v=[];let y=!1,x=null,w,S,C;const P=()=>l(i,C,w)&&a(i,C)!==0,O=()=>a(o,w)===0||l(o,C,w),k=()=>y||P(),A=()=>!y||O();for(let L=d,F=d;L<=f;++L)S=t[L%s],!S.skip&&(w=c(S[r]),w!==C&&(y=l(w,i,o),x===null&&k()&&(x=a(w,i)===0?L:F),x!==null&&A()&&(v.push(dC({start:x,end:L,loop:g,count:s,style:p})),x=null),F=L,C=w));return x!==null&&v.push(dC({start:x,end:f,loop:g,count:s,style:p})),v}function hC(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const o=fC(r[i],e.points,t);o.length&&n.push(...o)}return n}function W9(e,t,n,r){let i=0,o=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(o+=i);o>i&&e[o%t].skip;)o--;return o%=t,{start:i,end:o}}function q9(e,t,n,r){const i=e.length,o=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%i];c.skip||c.stop?a.skip||(r=!1,o.push({start:t%i,end:(l-1)%i,loop:r}),t=s=c.stop?l:null):(s=l,a.skip&&(t=l)),a=c}return s!==null&&o.push({start:t%i,end:s%i,loop:r}),o}function U9(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const o=!!e._loop,{start:s,end:a}=W9(n,i,o,r);if(r===!0)return pC(e,[{start:s,end:a,loop:o}],n,t);const l=a<s?a+i:a,c=!!e._fullLoop&&s===0&&a===i-1;return pC(e,q9(n,s,l,c),n,t)}function pC(e,t,n,r){return!r||!r.setContext||!n?t:G9(e,t,n,r)}function G9(e,t,n,r){const i=e._chart.getContext(),o=gC(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let d=o,f=t[0].start,g=f;function p(v,y,x,w){const S=a?-1:1;if(v!==y){for(v+=l;n[v%l].skip;)v-=S;for(;n[y%l].skip;)y+=S;v%l!==y%l&&(c.push({start:v%l,end:y%l,loop:x,style:w}),d=w,f=y%l)}}for(const v of t){f=a?f:v.start;let y=n[f%l],x;for(g=f+1;g<=v.end;g++){const w=n[g%l];x=gC(r.setContext(Uo(i,{type:"segment",p0:y,p1:w,p0DataIndex:(g-1)%l,p1DataIndex:g%l,datasetIndex:s}))),Y9(x,d)&&p(f,g-1,v.loop,d),y=w,d=x}f<g-1&&p(f,g-1,v.loop,d)}return c}function gC(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Y9(e,t){if(!t)return!1;const n=[],r=function(i,o){return Hv(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
|
|
117
|
+
* Chart.js v4.4.1
|
|
118
|
+
* https://www.chartjs.org
|
|
119
|
+
* (c) 2023 Chart.js Contributors
|
|
120
|
+
* Released under the MIT License
|
|
121
|
+
*/class K9{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const o=n.listeners[i],s=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=zS.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,l;for(;s>=0;--s)l=o[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var co=new K9;const mC="transparent",X9={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=US(e||mC),i=r.valid&&US(t||mC);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Q9{constructor(t,n,r,i){const o=n[r];i=Qt([t.to,i,o,t.from]);const s=Qt([t.from,o,i]);this._active=!0,this._fn=t.fn||X9[t.type||typeof s],this._easing=Jc[t.easing]||Jc.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Qt([t.to,n,i,t.from]),this._from=Qt([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,s=this._loop,a=this._to;let l;if(this._active=o!==a&&(s||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=o;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class vC{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!wt(t))return;const n=Object.keys(on.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!wt(o))return;const s={};for(const a of n)s[a]=o[a];(Yt(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,i=J9(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&Z9(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const d=n[c];let f=o[c];const g=r.get(c);if(f)if(g&&f.active()){f.update(g,d,a);continue}else f.cancel();if(!g||!g.duration){t[c]=d;continue}o[c]=f=new Q9(g,t,c,d),i.push(f)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return co.add(this._chart,r),!0}}function Z9(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const o=e[r[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function J9(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 bC(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:i,end:r?i:o}}function e$(e,t,n){if(n===!1)return!1;const r=bC(e,n),i=bC(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function t$(e){let t,n,r,i;return wt(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function yC(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,o;for(i=0,o=r.length;i<o;++i)n.push(r[i].index);return n}function xC(e,t,n,r={}){const i=e.keys,o=r.mode==="single";let s,a,l,c;if(t!==null){for(s=0,a=i.length;s<a;++s){if(l=+i[s],l===n){if(r.all)continue;break}c=e.values[l],cn(c)&&(o||t===0||Ii(t)===Ii(c))&&(t+=c)}return t}}function n$(e){const t=Object.keys(e),n=new Array(t.length);let r,i,o;for(r=0,i=t.length;r<i;++r)o=t[r],n[r]={x:o,y:e[o]};return n}function wC(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function r$(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function i$(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function o$(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function _C(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const o=e[i.index];if(n&&o>0||!n&&o<0)return i.index}return null}function SC(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=r,l=o.axis,c=s.axis,d=r$(o,s,r),f=t.length;let g;for(let p=0;p<f;++p){const v=t[p],{[l]:y,[c]:x}=v,w=v._stacks||(v._stacks={});g=w[c]=o$(i,d,y),g[a]=x,g._top=_C(g,s,!0,r.type),g._bottom=_C(g,s,!1,r.type);const S=g._visualValues||(g._visualValues={});S[a]=x}}function eb(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function s$(e,t){return Uo(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function a$(e,t,n){return Uo(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function ru(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const tb=e=>e==="reset"||e==="none",CC=(e,t)=>t?e:Object.assign({},e),l$=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:yC(n,!0),values:null};class vi{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=wC(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&&ru(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(f,g,p,v)=>f==="x"?g:f==="r"?v:p,o=n.xAxisID=tt(r.xAxisID,eb(t,"x")),s=n.yAxisID=tt(r.yAxisID,eb(t,"y")),a=n.rAxisID=tt(r.rAxisID,eb(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,s,a),d=n.vAxisID=i(l,s,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(d)}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&&FS(this._data,this),t._stacked&&ru(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(wt(n))this._data=n$(n);else if(r!==n){if(r){FS(r,this);const i=this._cachedMeta;ru(i),i._parsed=[]}n&&Object.isExtensible(n)&&GL(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=wC(n.vScale,n),n.stack!==r.stack&&(i=!0,ru(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&SC(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:o,_stacked:s}=r,a=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],d,f,g;if(this._parsing===!1)r._parsed=i,r._sorted=!0,g=i;else{Yt(i[t])?g=this.parseArrayData(r,i,t,n):wt(i[t])?g=this.parseObjectData(r,i,t,n):g=this.parsePrimitiveData(r,i,t,n);const p=()=>f[a]===null||c&&f[a]<c[a];for(d=0;d<n;++d)r._parsed[d+t]=f=g[d],l&&(p()&&(l=!1),c=f);r._sorted=l}s&&SC(this,g)}parsePrimitiveData(t,n,r,i){const{iScale:o,vScale:s}=t,a=o.axis,l=s.axis,c=o.getLabels(),d=o===s,f=new Array(i);let g,p,v;for(g=0,p=i;g<p;++g)v=g+r,f[g]={[a]:d||o.parse(c[v],v),[l]:s.parse(n[v],v)};return f}parseArrayData(t,n,r,i){const{xScale:o,yScale:s}=t,a=new Array(i);let l,c,d,f;for(l=0,c=i;l<c;++l)d=l+r,f=n[d],a[l]={x:o.parse(f[0],d),y:s.parse(f[1],d)};return a}parseObjectData(t,n,r,i){const{xScale:o,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let d,f,g,p;for(d=0,f=i;d<f;++d)g=d+r,p=n[g],c[d]={x:o.parse(Ho(p,a),g),y:s.parse(Ho(p,l),g)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,o=this._cachedMeta,s=n[t.axis],a={keys:yC(i,!0),values:n._stacks[t.axis]._visualValues};return xC(a,s,o.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const o=r[n.axis];let s=o===null?NaN:o;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,s=xC(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,o=r._sorted&&t===r.iScale,s=i.length,a=this._getOtherScale(t),l=l$(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:f}=i$(a);let g,p;function v(){p=i[g];const y=p[a.axis];return!cn(p[t.axis])||d>y||f<y}for(g=0;g<s&&!(!v()&&(this.updateRangeFromParsed(c,t,p,l),o));++g);if(o){for(g=s-1;g>=0;--g)if(!v()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,s;for(i=0,o=n.length;i<o;++i)s=n[i][t.axis],cn(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=t$(tt(this.options.clip,e$(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],o=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let d;for(r.dataset&&r.dataset.draw(t,o,a,l),d=a;d<a+l;++d){const f=i[d];f.hidden||(f.active&&c?s.push(f):f.draw(t,o))}for(d=0;d<s.length;++d)s[d].draw(t,o)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];o=s.$context||(s.$context=a$(this.getContext(),t,s)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=s$(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",o=this._cachedDataOpts,s=t+"-"+n,a=o[s],l=this.enableOptionSharing&&Xc(r);if(a)return CC(a,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),f=i?[`${t}Hover`,"hover",t,""]:[t,""],g=c.getOptionScopes(this.getDataset(),d),p=Object.keys(on.elements[t]),v=()=>this.getContext(r,i,n),y=c.resolveNamedOptions(g,p,v,f);return y.$shared&&(y.$shared=l,o[s]=Object.freeze(CC(y,l))),y}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,s=`animation-${n}`,a=o[s];if(a)return a;let l;if(i.options.animation!==!1){const d=this.chart.config,f=d.datasetAnimationScopeKeys(this._type,n),g=d.getOptionScopes(this.getDataset(),f);l=d.createResolver(g,this.getContext(t,r,n))}const c=new vC(i,l&&l.animations);return l&&l._cacheable&&(o[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||tb(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:s}}updateElement(t,n,r,i){tb(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!tb(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,o=n.length,s=Math.min(o,i);s&&this.parse(0,s),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,n,r=!0){const i=this._cachedMeta,o=i.data,s=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(o),a=t;a<s;++a)o[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&ru(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}ke(vi,"defaults",{}),ke(vi,"datasetElementType",null),ke(vi,"dataElementType",null);function c$(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,o=n.length;i<o;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=jS(r.sort((i,o)=>i-o))}return e._cache.$bar}function u$(e){const t=e.iScale,n=c$(t,e.type);let r=t._length,i,o,s,a;const l=()=>{s===32767||s===-32768||(Xc(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(i=0,o=n.length;i<o;++i)s=t.getPixelForValue(n[i]),l();for(a=void 0,i=0,o=t.ticks.length;i<o;++i)s=t.getPixelForTick(i),l();return r}function d$(e,t,n,r){const i=n.barThickness;let o,s;return gt(i)?(o=t.min*n.categoryPercentage,s=n.barPercentage):(o=i*r,s=1),{chunk:o/r,ratio:s,start:t.pixels[e]-o/2}}function f$(e,t,n,r){const i=t.pixels,o=i[e];let s=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;s===null&&(s=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-s);const c=o-(o-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function h$(e,t,n,r){const i=n.parse(e[0],r),o=n.parse(e[1],r),s=Math.min(i,o),a=Math.max(i,o);let l=s,c=a;Math.abs(s)>Math.abs(a)&&(l=a,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:o,min:s,max:a}}function EC(e,t,n,r){return Yt(e)?h$(e,t,n,r):t[n.axis]=n.parse(e,r),t}function OC(e,t,n,r){const i=e.iScale,o=e.vScale,s=i.getLabels(),a=i===o,l=[];let c,d,f,g;for(c=n,d=n+r;c<d;++c)g=t[c],f={},f[i.axis]=a||i.parse(s[c],c),l.push(EC(g,f,o,c));return l}function nb(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function p$(e,t,n){return e!==0?Ii(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function g$(e){let t,n,r,i,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:t,top:i,bottom:o}}function m$(e,t,n,r){let i=t.borderSkipped;const o={};if(!i){e.borderSkipped=o;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:c,bottom:d}=g$(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=d:(o[PC(d,s,a,l)]=!0,i=c)),o[PC(i,s,a,l)]=!0,e.borderSkipped=o}function PC(e,t,n,r){return r?(e=v$(e,t,n),e=kC(e,n,t)):e=kC(e,t,n),e}function v$(e,t,n){return e===t?n:e===n?t:e}function kC(e,t,n){return e==="start"?t:e==="end"?n:e}function b$(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Kf extends vi{parsePrimitiveData(t,n,r,i){return OC(t,n,r,i)}parseArrayData(t,n,r,i){return OC(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:o,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,d=s.axis==="x"?a:l,f=[];let g,p,v,y;for(g=r,p=r+i;g<p;++g)y=n[g],v={},v[o.axis]=o.parse(Ho(y,c),g),f.push(EC(Ho(y,d),v,s,g));return f}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,o=this.getParsed(t),s=o._custom,a=nb(s)?"["+s.start+", "+s.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const o=i==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),d=this._getRuler(),{sharedOptions:f,includeOptions:g}=this._getSharedOptions(n,i);for(let p=n;p<n+r;p++){const v=this.getParsed(p),y=o||gt(v[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),x=this._calculateBarIndexPixels(p,d),w=(v._stacks||{})[a.axis],S={horizontal:c,base:y.base,enableBorderRadius:!w||nb(v._custom)||s===w._top||s===w._bottom,x:c?y.head:x.center,y:c?x.center:y.head,height:c?x.size:Math.abs(y.size),width:c?Math.abs(y.size):x.size};g&&(S.options=f||this.resolveDataElementOptions(p,t[p].active?"active":i));const C=S.options||t[p].options;m$(S,C,w,s),b$(S,C,d.ratio),this.updateElement(t[p],p,S,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=r.options.stacked,s=[],a=l=>{const c=l.controller.getParsed(n),d=c&&c[l.vScale.axis];if(gt(d)||isNaN(d))return!0};for(const l of i)if(!(n!==void 0&&a(l))&&((o===!1||s.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const i=this._getStacks(t,r),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let o,s;for(o=0,s=n.data.length;o<s;++o)i.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=t.barThickness;return{min:a||u$(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:o,minBarLength:s}}=this,a=o||0,l=this.getParsed(t),c=l._custom,d=nb(c);let f=l[n.axis],g=0,p=r?this.applyStack(n,l,r):f,v,y;p!==f&&(g=p-f,p=f),d&&(f=c.barStart,p=c.barEnd-c.barStart,f!==0&&Ii(f)!==Ii(c.barEnd)&&(g=0),g+=f);const x=!gt(o)&&!d?o:g;let w=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?v=n.getPixelForValue(g+p):v=w,y=v-w,Math.abs(y)<s){y=p$(y,n,a)*s,f===a&&(w-=y/2);const S=n.getPixelForDecimal(0),C=n.getPixelForDecimal(1),P=Math.min(S,C),O=Math.max(S,C);w=Math.max(Math.min(w,O),P),v=w+y,r&&!d&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(v)-n.getValueForPixel(w))}if(w===n.getPixelForValue(a)){const S=Ii(y)*n.getLineWidthForValue(a)/2;w+=S,y-=S}return{size:y,base:w,head:v,center:v+y/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,o=i.skipNull,s=tt(i.maxBarThickness,1/0);let a,l;if(n.grouped){const c=o?this._getStackCount(t):n.stackCount,d=i.barThickness==="flex"?f$(t,n,i,c):d$(t,n,i,c),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=d.start+d.chunk*f+d.chunk/2,l=Math.min(s,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let o=0;for(;o<i;++o)this.getParsed(o)[n.axis]!==null&&r[o].draw(this._ctx)}}ke(Kf,"id","bar"),ke(Kf,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),ke(Kf,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Xf extends vi{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,i){const o=super.parsePrimitiveData(t,n,r,i);for(let s=0;s<o.length;s++)o[s]._custom=this.resolveDataElementOptions(s+r).radius;return o}parseArrayData(t,n,r,i){const o=super.parseArrayData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=tt(a[2],this.resolveDataElementOptions(s+r).radius)}return o}parseObjectData(t,n,r,i){const o=super.parseObjectData(t,n,r,i);for(let s=0;s<o.length;s++){const a=n[r+s];o[s]._custom=tt(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,i),d=s.axis,f=a.axis;for(let g=n;g<n+r;g++){const p=t[g],v=!o&&this.getParsed(g),y={},x=y[d]=o?s.getPixelForDecimal(.5):s.getPixelForValue(v[d]),w=y[f]=o?a.getBasePixel():a.getPixelForValue(v[f]);y.skip=isNaN(x)||isNaN(w),c&&(y.options=l||this.resolveDataElementOptions(g,p.active?"active":i),o&&(y.options.radius=0)),this.updateElement(p,g,y,i)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return n!=="active"&&(i.radius=0),i.radius+=tt(r&&r._custom,o),i}}ke(Xf,"id","bubble"),ke(Xf,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),ke(Xf,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function y$(e,t,n){let r=1,i=1,o=0,s=0;if(t<Xt){const a=e,l=a+t,c=Math.cos(a),d=Math.sin(a),f=Math.cos(l),g=Math.sin(l),p=(C,P,O)=>Zc(C,a,l,!0)?1:Math.max(P,P*n,O,O*n),v=(C,P,O)=>Zc(C,a,l,!0)?-1:Math.min(P,P*n,O,O*n),y=p(0,c,f),x=p(dn,d,g),w=v(Kt,c,f),S=v(Kt+dn,d,g);r=(y-w)/2,i=(x-S)/2,o=-(y+w)/2,s=-(x+S)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:s}}class Zs extends vi{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let o=l=>+r[l];if(wt(r[t])){const{key:l="value"}=this._parsing;o=c=>+Ho(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)i._parsed[s]=o(s)}}_getRotation(){return mi(this.options.rotation-90)}_getCircumference(){return mi(this.options.circumference)}_getRotationExtents(){let t=Xt,n=-Xt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,o=i._getRotation(),s=i._getCircumference();t=Math.min(t,o),n=Math.max(n,o+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,o=i.data,s=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(IL(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:d,rotation:f}=this._getRotationExtents(),{ratioX:g,ratioY:p,offsetX:v,offsetY:y}=y$(f,d,l),x=(r.width-s)/g,w=(r.height-s)/p,S=Math.max(Math.min(x,w)/2,0),C=kS(this.options.radius,S),P=Math.max(C*l,0),O=(C-P)/this._getVisibleDatasetWeightTotal();this.offsetX=v*C,this.offsetY=y*C,i.total=this.calculateTotal(),this.outerRadius=C-O*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-O*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/Xt)}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,d=(a.left+a.right)/2,f=(a.top+a.bottom)/2,g=o&&c.animateScale,p=g?0:this.innerRadius,v=g?0:this.outerRadius,{sharedOptions:y,includeOptions:x}=this._getSharedOptions(n,i);let w=this._getRotation(),S;for(S=0;S<n;++S)w+=this._circumference(S,o);for(S=n;S<n+r;++S){const C=this._circumference(S,o),P=t[S],O={x:d+this.offsetX,y:f+this.offsetY,startAngle:w,endAngle:w+C,circumference:C,outerRadius:v,innerRadius:p};x&&(O.options=y||this.resolveDataElementOptions(S,P.active?"active":i)),w+=C,this.updateElement(P,S,O,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Xt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=eu(n._parsed[t],r.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,o,s,a,l;if(!t){for(i=0,o=r.data.datasets.length;i<o;++i)if(r.isDatasetVisible(i)){s=r.getDatasetMeta(i),t=s.data,a=s.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(tt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}ke(Zs,"id","doughnut"),ke(Zs,"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"}),ke(Zs,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),ke(Zs,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class Qf extends vi{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:o}=n,s=this.chart._animationsDisabled;let{start:a,count:l}=VS(n,i,s);this._drawStart=a,this._drawCount=l,HS(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,i),g=s.axis,p=a.axis,{spanGaps:v,segment:y}=this.options,x=fl(v)?v:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||i==="none",S=n+r,C=t.length;let P=n>0&&this.getParsed(n-1);for(let O=0;O<C;++O){const k=t[O],A=w?k:{};if(O<n||O>=S){A.skip=!0;continue}const L=this.getParsed(O),F=gt(L[p]),z=A[g]=s.getPixelForValue(L[g],O),B=A[p]=o||F?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,L,l):L[p],O);A.skip=isNaN(z)||isNaN(B)||F,A.stop=O>0&&Math.abs(L[g]-P[g])>x,y&&(A.parsed=L,A.raw=c.data[O]),f&&(A.options=d||this.resolveDataElementOptions(O,k.active?"active":i)),w||this.updateElement(k,O,A,i),P=L}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}ke(Qf,"id","line"),ke(Qf,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ke(Qf,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class iu extends vi{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=eu(n._parsed[t].r,r.options.locale);return{label:i[t]||"",value:o}}parseObjectData(t,n,r,i){return iC.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,i)=>{const o=this.getParsed(i).r;!isNaN(o)&&this.chart.getDataVisibility(i)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(i/2,0),s=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),a=(o-s)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,i){const o=i==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,f=c.yCenter,g=c.getIndexAngle(0)-.5*Kt;let p=g,v;const y=360/this.countVisibleElements();for(v=0;v<n;++v)p+=this._computeAngle(v,i,y);for(v=n;v<n+r;v++){const x=t[v];let w=p,S=p+this._computeAngle(v,i,y),C=s.getDataVisibility(v)?c.getDistanceFromCenterForValue(this.getParsed(v).r):0;p=S,o&&(l.animateScale&&(C=0),l.animateRotate&&(w=S=g));const P={x:d,y:f,innerRadius:0,outerRadius:C,startAngle:w,endAngle:S,options:this.resolveDataElementOptions(v,x.active?"active":i)};this.updateElement(x,v,P,i)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?mi(this.resolveDataElementOptions(t,n).angle||r):0}}ke(iu,"id","polarArea"),ke(iu,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),ke(iu,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class rb extends Zs{}ke(rb,"id","pie"),ke(rb,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Zf extends vi{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,i){return iC.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],o=n.iScale.getLabels();if(r.points=i,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===i.length,options:s};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const o=this._cachedMeta.rScale,s=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),d=o.getPointPositionForValue(a,this.getParsed(a).r),f=s?o.xCenter:d.x,g=s?o.yCenter:d.y,p={x:f,y:g,angle:d.angle,skip:isNaN(f)||isNaN(g),options:c};this.updateElement(l,a,p,i)}}}ke(Zf,"id","radar"),ke(Zf,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),ke(Zf,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Jf extends vi{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:o}=n,s=this.getParsed(t),a=i.getLabelForValue(s.x),l=o.getLabelForValue(s.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,i=this.chart._animationsDisabled;let{start:o,count:s}=VS(n,r,i);if(this._drawStart=o,this._drawCount=s,HS(n)&&(o=0,s=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,o,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,i){const o=i==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(n,i),f=this.getSharedOptions(d),g=this.includeOptions(i,f),p=s.axis,v=a.axis,{spanGaps:y,segment:x}=this.options,w=fl(y)?y:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||o||i==="none";let C=n>0&&this.getParsed(n-1);for(let P=n;P<n+r;++P){const O=t[P],k=this.getParsed(P),A=S?O:{},L=gt(k[v]),F=A[p]=s.getPixelForValue(k[p],P),z=A[v]=o||L?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[v],P);A.skip=isNaN(F)||isNaN(z)||L,A.stop=P>0&&Math.abs(k[p]-C[p])>w,x&&(A.parsed=k,A.raw=c.data[P]),g&&(A.options=f||this.resolveDataElementOptions(P,O.active?"active":i)),S||this.updateElement(O,P,A,i),C=k}this.updateSharedOptions(f,i,d)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,s)/2}}ke(Jf,"id","scatter"),ke(Jf,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),ke(Jf,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var x$=Object.freeze({__proto__:null,BarController:Kf,BubbleController:Xf,DoughnutController:Zs,LineController:Qf,PieController:rb,PolarAreaController:iu,RadarController:Zf,ScatterController:Jf});function Js(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ib{constructor(t){ke(this,"options");this.options=t||{}}static override(t){Object.assign(ib.prototype,t)}init(){}formats(){return Js()}parse(){return Js()}format(){return Js()}add(){return Js()}diff(){return Js()}startOf(){return Js()}endOf(){return Js()}}var w$={_date:ib};function _$(e,t,n,r){const{controller:i,data:o,_sorted:s}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&o.length){const l=a._reversePixels?qL:ao;if(r){if(i._sharedOptions){const c=o[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){const f=l(o,t,n-d),g=l(o,t,n+d);return{lo:f.lo,hi:g.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function ou(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:d}=o[a],{lo:f,hi:g}=_$(o[a],t,s,i);for(let p=f;p<=g;++p){const v=d[p];v.skip||r(v,c,p)}}}function S$(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const o=t?Math.abs(r.x-i.x):0,s=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(s,2))}}function ob(e,t,n,r,i){const o=[];return!i&&!e.isPointInArea(t)||ou(e,n,t,function(a,l,c){!i&&!lo(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function C$(e,t,n,r){let i=[];function o(s,a,l){const{startAngle:c,endAngle:d}=s.getProps(["startAngle","endAngle"],r),{angle:f}=LS(s,{x:t.x,y:t.y});Zc(f,c,d)&&i.push({element:s,datasetIndex:a,index:l})}return ou(e,n,t,o),i}function E$(e,t,n,r,i,o){let s=[];const a=S$(n);let l=Number.POSITIVE_INFINITY;function c(d,f,g){const p=d.inRange(t.x,t.y,i);if(r&&!p)return;const v=d.getCenterPoint(i);if(!(!!o||e.isPointInArea(v))&&!p)return;const x=a(t,v);x<l?(s=[{element:d,datasetIndex:f,index:g}],l=x):x===l&&s.push({element:d,datasetIndex:f,index:g})}return ou(e,n,t,c),s}function sb(e,t,n,r,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?C$(e,t,n,i):E$(e,t,n,r,i,o)}function MC(e,t,n,r,i){const o=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return ou(e,n,t,(l,c,d)=>{l[s](t[n],i)&&(o.push({element:l,datasetIndex:c,index:d}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:o}var O$={evaluateInteractionItems:ou,modes:{index(e,t,n,r){const i=Xs(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?ob(e,i,o,r,s):sb(e,i,o,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const d=a[0].index,f=c.data[d];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:d})}),l):[]},dataset(e,t,n,r){const i=Xs(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?ob(e,i,o,r,s):sb(e,i,o,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let d=0;d<c.length;++d)a.push({element:c[d],datasetIndex:l,index:d})}return a},point(e,t,n,r){const i=Xs(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return ob(e,i,o,r,s)},nearest(e,t,n,r){const i=Xs(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;return sb(e,i,o,n.intersect,r,s)},x(e,t,n,r){const i=Xs(t,e);return MC(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=Xs(t,e);return MC(e,i,"y",n.intersect,r)}}};const DC=["left","top","right","bottom"];function su(e,t){return e.filter(n=>n.pos===t)}function TC(e,t){return e.filter(n=>DC.indexOf(n.pos)===-1&&n.box.axis===t)}function au(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function P$(e){const t=[];let n,r,i,o,s,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:o,options:{stack:s,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:s&&o+s,stackWeight:a});return t}function k$(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!DC.includes(i))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=o}return t}function M$(e,t){const n=k$(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let o,s,a;for(o=0,s=e.length;o<s;++o){a=e[o];const{fullSize:l}=a.box,c=n[a.stack],d=c&&a.stackWeight/c.weight;a.horizontal?(a.width=d?d*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=d?d*i:l&&t.availableHeight)}return n}function D$(e){const t=P$(e),n=au(t.filter(c=>c.box.fullSize),!0),r=au(su(t,"left"),!0),i=au(su(t,"right")),o=au(su(t,"top"),!0),s=au(su(t,"bottom")),a=TC(t,"x"),l=TC(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(s).concat(a),chartArea:su(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(s).concat(a)}}function AC(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function IC(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 T$(e,t,n,r){const{pos:i,box:o}=n,s=e.maxPadding;if(!wt(i)){n.size&&(e[i]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?o.height:o.width),n.size=f.size/f.count,e[i]+=n.size}o.getPadding&&IC(s,o.getPadding());const a=Math.max(0,t.outerWidth-AC(s,e,"left","right")),l=Math.max(0,t.outerHeight-AC(s,e,"top","bottom")),c=a!==e.w,d=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:d}:{same:d,other:c}}function A$(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function I$(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{o[s]=Math.max(t[s],n[s])}),o}return r(e?["left","right"]:["top","bottom"])}function lu(e,t,n,r){const i=[];let o,s,a,l,c,d;for(o=0,s=e.length,c=0;o<s;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,I$(a.horizontal,t));const{same:f,other:g}=T$(t,n,a,r);c|=f&&i.length,d=d||g,l.fullSize||i.push(a)}return c&&lu(i,t,n,r)||d}function eh(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function NC(e,t,n,r){const i=n.padding;let{x:o,y:s}=t;for(const a of e){const l=a.box,c=r[a.stack]||{count:1,placed:0,weight:1},d=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*d,g=c.size||l.height;Xc(c.start)&&(s=c.start),l.fullSize?eh(l,i.left,s,n.outerWidth-i.right-i.left,g):eh(l,t.left+c.placed,s,f,g),c.start=s,c.placed+=f,s=l.bottom}else{const f=t.h*d,g=c.size||l.width;Xc(c.start)&&(o=c.start),l.fullSize?eh(l,o,i.top,g,n.outerHeight-i.bottom-i.top):eh(l,o,t.top+c.placed,g,f),c.start=o,c.placed+=f,o=l.right}}t.x=o,t.y=s}var Un={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=Rn(e.options.layout.padding),o=Math.max(t-i.width,0),s=Math.max(n-i.height,0),a=D$(e.boxes),l=a.vertical,c=a.horizontal;Nt(e.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const d=l.reduce((y,x)=>x.box.options&&x.box.options.display===!1?y:y+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/d,hBoxMaxHeight:s/2}),g=Object.assign({},i);IC(g,Rn(r));const p=Object.assign({maxPadding:g,w:o,h:s,x:i.left,y:i.top},i),v=M$(l.concat(c),f);lu(a.fullSize,p,f,v),lu(l,p,f,v),lu(c,p,f,v)&&lu(l,p,f,v),A$(p),NC(a.leftAndTop,p,f,v),p.x+=p.w,p.y+=p.h,NC(a.rightAndBottom,p,f,v),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Nt(a.chartArea,y=>{const x=y.box;Object.assign(x,e.chartArea),x.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class RC{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class N$ extends RC{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const th="$chartjs",R$={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},LC=e=>e===null||e==="";function L$(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[th]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",LC(i)){const o=aC(e,"width");o!==void 0&&(e.width=o)}if(LC(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=aC(e,"height");o!==void 0&&(e.height=o)}return e}const $C=F9?{passive:!0}:!1;function $$(e,t,n){e.addEventListener(t,n,$C)}function F$(e,t,n){e.canvas.removeEventListener(t,n,$C)}function j$(e,t){const n=R$[e.type]||e.type,{x:r,y:i}=Xs(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function nh(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function z$(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||nh(a.addedNodes,r),s=s&&!nh(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function B$(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||nh(a.removedNodes,r),s=s&&!nh(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const cu=new Map;let FC=0;function jC(){const e=window.devicePixelRatio;e!==FC&&(FC=e,cu.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function V$(e,t){cu.size||window.addEventListener("resize",jC),cu.set(e,t)}function H$(e){cu.delete(e),cu.size||window.removeEventListener("resize",jC)}function W$(e,t,n){const r=e.canvas,i=r&&Jv(r);if(!i)return;const o=BS((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return s.observe(i),V$(e,o),s}function ab(e,t,n){n&&n.disconnect(),t==="resize"&&H$(e)}function q$(e,t,n){const r=e.canvas,i=BS(o=>{e.ctx!==null&&n(j$(o,e))},e);return $$(r,t,i),i}class U$ extends RC{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(L$(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[th])return!1;const r=n[th].initial;["height","width"].forEach(o=>{const s=r[o];gt(s)?n.removeAttribute(o):n.setAttribute(o,s)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[th],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:z$,detach:B$,resize:W$}[n]||q$;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:ab,detach:ab,resize:ab}[n]||F$)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return $9(t,n,r,i)}isAttached(t){const n=Jv(t);return!!(n&&n.isConnected)}}function G$(e){return!Zv()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?N$:U$}let uo=(og=class{constructor(){ke(this,"x");ke(this,"y");ke(this,"active",!1);ke(this,"options");ke(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return fl(this.x)&&fl(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}},ke(og,"defaults",{}),ke(og,"defaultRoutes"),og);function Y$(e,t){const n=e.options.ticks,r=K$(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?Q$(t):[],s=o.length,a=o[0],l=o[s-1],c=[];if(s>i)return Z$(t,c,o,s/i),c;const d=X$(o,t,i);if(s>0){let f,g;const p=s>1?Math.round((l-a)/(s-1)):null;for(rh(t,c,d,gt(p)?0:a-p,a),f=0,g=s-1;f<g;f++)rh(t,c,d,o[f],o[f+1]);return rh(t,c,d,l,gt(p)?t.length:l+p),c}return rh(t,c,d),c}function K$(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function X$(e,t,n){const r=J$(e),i=t.length/n;if(!r)return Math.max(i,1);const o=BL(r);for(let s=0,a=o.length-1;s<a;s++){const l=o[s];if(l>i)return l}return Math.max(i,1)}function Q$(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Z$(e,t,n,r){let i=0,o=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===o&&(t.push(e[s]),i++,o=n[i*r])}function rh(e,t,n,r,i){const o=tt(r,0),s=Math.min(tt(i,e.length),e.length);let a=0,l,c,d;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),d=o;d<0;)a++,d=Math.round(o+a*n);for(c=Math.max(o,0);c<s;c++)c===d&&(t.push(e[c]),a++,d=Math.round(o+a*n))}function J$(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 eF=e=>e==="left"?"right":e==="right"?"left":e,zC=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,BC=(e,t)=>Math.min(t||e,e);function VC(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;o<i;o+=r)n.push(e[Math.floor(o)]);return n}function tF(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),o=e._startPixel,s=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-o,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<o-a||l>s+a)))return l}function nF(e,t){Nt(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;o<i;++o)delete n.data[r[o]];r.splice(0,i)}})}function uu(e){return e.drawTicks?e.tickLength:0}function HC(e,t){if(!e.display)return 0;const n=bn(e.font,t),r=Rn(e.padding);return(Yt(e.text)?e.text.length:1)*n.lineHeight+r.height}function rF(e,t){return Uo(e,{scale:t,type:"scale"})}function iF(e,t,n){return Uo(e,{tick:n,index:t,type:"tick"})}function oF(e,t,n){let r=Vv(e);return(n&&t!=="right"||!n&&t==="right")&&(r=eF(r)),r}function sF(e,t,n,r){const{top:i,left:o,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:d}=l;let f=0,g,p,v;const y=s-i,x=a-o;if(e.isHorizontal()){if(p=qn(r,o,a),wt(n)){const w=Object.keys(n)[0],S=n[w];v=d[w].getPixelForValue(S)+y-t}else n==="center"?v=(c.bottom+c.top)/2+y-t:v=zC(e,n,t);g=a-o}else{if(wt(n)){const w=Object.keys(n)[0],S=n[w];p=d[w].getPixelForValue(S)-x+t}else n==="center"?p=(c.left+c.right)/2-x+t:p=zC(e,n,t);v=qn(r,s,i),f=n==="left"?-dn:dn}return{titleX:p,titleY:v,maxWidth:g,rotation:f}}class ea extends uo{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=Or(t,Number.POSITIVE_INFINITY),n=Or(n,Number.NEGATIVE_INFINITY),r=Or(r,Number.POSITIVE_INFINITY),i=Or(i,Number.NEGATIVE_INFINITY),{min:Or(t,r),max:Or(n,i),minDefined:cn(t),maxDefined:cn(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds(),s;if(i&&o)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)s=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,s.min)),o||(r=Math.max(r,s.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:Or(n,Or(r,n)),max:Or(r,Or(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(){jt(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=g9(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?VC(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=Y$(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(){jt(this.options.afterUpdate,[this])}beforeSetDimensions(){jt(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(){jt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),jt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){jt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,o;for(r=0,i=t.length;r<i;r++)o=t[r],o.label=jt(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){jt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){jt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=BC(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,o=n.maxRotation;let s=i,a,l,c;if(!this._isVisible()||!n.display||i>=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const d=this._getLabelSizes(),f=d.widest.width,g=d.highest.height,p=kn(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:p/(r-1),f+6>a&&(a=p/(r-(t.offset?.5:1)),l=this.maxHeight-uu(t.grid)-n.padding-HC(t.title,this.chart.options.font),c=Math.sqrt(f*f+g*g),s=jv(Math.min(Math.asin(kn((d.highest.height+6)/a,-1,1)),Math.asin(kn(l/c,-1,1))-Math.asin(kn(g/c,-1,1)))),s=Math.max(i,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){jt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){jt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=HC(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=uu(o)+l):(t.height=this.maxHeight,t.width=uu(o)+l),r.display&&this.ticks.length){const{first:c,last:d,widest:f,highest:g}=this._getLabelSizes(),p=r.padding*2,v=mi(this.labelRotation),y=Math.cos(v),x=Math.sin(v);if(a){const w=r.mirror?0:x*f.width+y*g.height;t.height=Math.min(this.maxHeight,t.height+w+p)}else{const w=r.mirror?0:y*f.width+x*g.height;t.width=Math.min(this.maxWidth,t.width+w+p)}this._calculatePadding(c,d,x,y)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:o,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let g=0,p=0;l?c?(g=i*t.width,p=r*n.height):(g=r*t.height,p=i*n.width):o==="start"?p=n.width:o==="end"?g=t.width:o!=="inner"&&(g=t.width/2,p=n.width/2),this.paddingLeft=Math.max((g-d+s)*this.width/(this.width-d),0),this.paddingRight=Math.max((p-f+s)*this.width/(this.width-f),0)}else{let d=n.height/2,f=t.height/2;o==="start"?(d=0,f=t.height):o==="end"&&(d=n.height,f=0),this.paddingTop=d+s,this.paddingBottom=f+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(){jt(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++)gt(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=VC(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:o}=this,s=[],a=[],l=Math.floor(n/BC(n,r));let c=0,d=0,f,g,p,v,y,x,w,S,C,P,O;for(f=0;f<n;f+=l){if(v=t[f].label,y=this._resolveTickFontOptions(f),i.font=x=y.string,w=o[x]=o[x]||{data:{},gc:[]},S=y.lineHeight,C=P=0,!gt(v)&&!Yt(v))C=Vf(i,w.data,w.gc,C,v),P=S;else if(Yt(v))for(g=0,p=v.length;g<p;++g)O=v[g],!gt(O)&&!Yt(O)&&(C=Vf(i,w.data,w.gc,C,O),P+=S);s.push(C),a.push(P),c=Math.max(C,c),d=Math.max(P,d)}nF(o,n);const k=s.indexOf(c),A=a.indexOf(d),L=F=>({width:s[F]||0,height:a[F]||0});return{first:L(0),last:L(n-1),widest:L(k),highest:L(A),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 WL(this._alignToPixels?Us(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=iF(this.getContext(),t,r))}return this.$context||(this.$context=rF(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=mi(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=this._getLabelSizes(),s=t.autoSkipPadding||0,a=o?o.widest.width+s:0,l=o?o.highest.height+s:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:s,border:a}=i,l=o.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),g=uu(o),p=[],v=a.setContext(this.getContext()),y=v.display?v.width:0,x=y/2,w=function(J){return Us(r,J,y)};let S,C,P,O,k,A,L,F,z,B,V,X;if(s==="top")S=w(this.bottom),A=this.bottom-g,F=S-x,B=w(t.top)+x,X=t.bottom;else if(s==="bottom")S=w(this.top),B=t.top,X=w(t.bottom)-x,A=S+x,F=this.top+g;else if(s==="left")S=w(this.right),k=this.right-g,L=S-x,z=w(t.left)+x,V=t.right;else if(s==="right")S=w(this.left),z=t.left,V=w(t.right)-x,k=S+x,L=this.left+g;else if(n==="x"){if(s==="center")S=w((t.top+t.bottom)/2+.5);else if(wt(s)){const J=Object.keys(s)[0],G=s[J];S=w(this.chart.scales[J].getPixelForValue(G))}B=t.top,X=t.bottom,A=S+x,F=A+g}else if(n==="y"){if(s==="center")S=w((t.left+t.right)/2);else if(wt(s)){const J=Object.keys(s)[0],G=s[J];S=w(this.chart.scales[J].getPixelForValue(G))}k=S-x,L=k-g,z=t.left,V=t.right}const K=tt(i.ticks.maxTicksLimit,f),$=Math.max(1,Math.ceil(f/K));for(C=0;C<f;C+=$){const J=this.getContext(C),G=o.setContext(J),q=a.setContext(J),se=G.lineWidth,D=G.color,W=q.dash||[],re=q.dashOffset,N=G.tickWidth,ne=G.tickColor,ge=G.tickBorderDash||[],he=G.tickBorderDashOffset;P=tF(this,C,l),P!==void 0&&(O=Us(r,P,se),c?k=L=z=V=O:A=F=B=X=O,p.push({tx1:k,ty1:A,tx2:L,ty2:F,x1:z,y1:B,x2:V,y2:X,width:se,color:D,borderDash:W,borderDashOffset:re,tickWidth:N,tickColor:ne,tickBorderDash:ge,tickBorderDashOffset:he}))}return this._ticksLength=f,this._borderValue=S,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:o}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:d,mirror:f}=o,g=uu(r.grid),p=g+d,v=f?-d:p,y=-mi(this.labelRotation),x=[];let w,S,C,P,O,k,A,L,F,z,B,V,X="middle";if(i==="top")k=this.bottom-v,A=this._getXAxisLabelAlignment();else if(i==="bottom")k=this.top+v,A=this._getXAxisLabelAlignment();else if(i==="left"){const $=this._getYAxisLabelAlignment(g);A=$.textAlign,O=$.x}else if(i==="right"){const $=this._getYAxisLabelAlignment(g);A=$.textAlign,O=$.x}else if(n==="x"){if(i==="center")k=(t.top+t.bottom)/2+p;else if(wt(i)){const $=Object.keys(i)[0],J=i[$];k=this.chart.scales[$].getPixelForValue(J)+p}A=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")O=(t.left+t.right)/2-p;else if(wt(i)){const $=Object.keys(i)[0],J=i[$];O=this.chart.scales[$].getPixelForValue(J)}A=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(l==="start"?X="top":l==="end"&&(X="bottom"));const K=this._getLabelSizes();for(w=0,S=a.length;w<S;++w){C=a[w],P=C.label;const $=o.setContext(this.getContext(w));L=this.getPixelForTick(w)+o.labelOffset,F=this._resolveTickFontOptions(w),z=F.lineHeight,B=Yt(P)?P.length:1;const J=B/2,G=$.color,q=$.textStrokeColor,se=$.textStrokeWidth;let D=A;s?(O=L,A==="inner"&&(w===S-1?D=this.options.reverse?"left":"right":w===0?D=this.options.reverse?"right":"left":D="center"),i==="top"?c==="near"||y!==0?V=-B*z+z/2:c==="center"?V=-K.highest.height/2-J*z+z:V=-K.highest.height+z/2:c==="near"||y!==0?V=z/2:c==="center"?V=K.highest.height/2-J*z:V=K.highest.height-B*z,f&&(V*=-1),y!==0&&!$.showLabelBackdrop&&(O+=z/2*Math.sin(y))):(k=L,V=(1-B)*z/2);let W;if($.showLabelBackdrop){const re=Rn($.backdropPadding),N=K.heights[w],ne=K.widths[w];let ge=V-re.top,he=0-re.left;switch(X){case"middle":ge-=N/2;break;case"bottom":ge-=N;break}switch(A){case"center":he-=ne/2;break;case"right":he-=ne;break;case"inner":w===S-1?he-=ne:w>0&&(he-=ne/2);break}W={left:he,top:ge,width:ne+re.width,height:N+re.height,color:$.backdropColor}}x.push({label:P,font:F,textOffset:V,options:{rotation:y,color:G,strokeColor:q,strokeWidth:se,textAlign:D,textBaseline:X,translation:[O,k],backdrop:W}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-mi(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,s=this._getLabelSizes(),a=t+o,l=s.widest.width;let c,d;return n==="left"?i?(d=this.right+o,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-a,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d=this.left)):n==="right"?i?(d=this.left+o,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+a,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:o,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,s;const a=(l,c,d)=>{!d.width||!d.color||(r.save(),r.lineWidth=d.width,r.strokeStyle=d.color,r.setLineDash(d.borderDash||[]),r.lineDashOffset=d.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,s=i.length;o<s;++o){const l=i[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,o=r.setContext(this.getContext()),s=r.display?o.width:0;if(!s)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,d,f,g;this.isHorizontal()?(c=Us(t,this.left,s)-s/2,d=Us(t,this.right,a)+a/2,f=g=l):(f=Us(t,this.top,s)-s/2,g=Us(t,this.bottom,a)+a/2,c=d=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,f),n.lineTo(d,g),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Hf(r,i);const o=this.getLabelItems(t);for(const s of o){const a=s.options,l=s.font,c=s.label,d=s.textOffset;Gs(r,c,0,d,l,a)}i&&Wf(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=bn(r.font),s=Rn(r.padding),a=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||wt(n)?(l+=s.bottom,Yt(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:d,maxWidth:f,rotation:g}=sF(this,l,n,a);Gs(t,r.text,0,0,o,{color:r.color,maxWidth:f,rotation:g,textAlign:oF(a,n,i),textBaseline:"middle",translation:[c,d]})}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=tt(t.grid&&t.grid.z,-1),i=tt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ea.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,s;for(o=0,s=n.length;o<s;++o){const a=n[o];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return bn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ih{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;cF(n)&&(r=this.register(n));const i=this.items,o=t.id,s=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,aF(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,i=this.scope;r in n&&delete n[r],i&&r in on[i]&&(delete on[i][r],this.override&&delete qs[r])}}function aF(e,t,n){const r=Ai(Object.create(null),[n?on.get(n):{},on.get(t),e.defaults]);on.set(t,r),e.defaultRoutes&&lF(t,e.defaultRoutes),e.descriptors&&on.describe(t,e.descriptors)}function lF(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");on.route(o,i,l,a)})}function cF(e){return"id"in e&&"defaults"in e}class uF{constructor(){this.controllers=new ih(vi,"datasets",!0),this.elements=new ih(uo,"elements"),this.plugins=new ih(Object,"plugins"),this.scales=new ih(ea,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Nt(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=Fv(t);jt(r["before"+i],[],r),n[t](r),jt(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Ni=new uF;class dF{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),s=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,i){i=i||{};for(const o of t){const s=o.plugin,a=s[r],l=[n,i,o.options];if(jt(a,l,s)===!1&&i.cancelable)return!1}return!0}invalidate(){gt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=tt(r.options&&r.options.plugins,{}),o=fF(r);return i===!1&&!n?[]:pF(t,o,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(o,s)=>o.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function fF(e){const t={},n=[],r=Object.keys(Ni.plugins.items);for(let o=0;o<r.length;o++)n.push(Ni.getPlugin(r[o]));const i=e.plugins||[];for(let o=0;o<i.length;o++){const s=i[o];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function hF(e,t){return!t&&e===!1?null:e===!0?{}:e}function pF(e,{plugins:t,localIds:n},r,i){const o=[],s=e.getContext();for(const a of t){const l=a.id,c=hF(r[l],i);c!==null&&o.push({plugin:a,options:gF(e.config,{plugin:a,local:n[l]},c,s)})}return o}function gF(e,{plugin:t,local:n},r,i){const o=e.pluginScopeKeys(t),s=e.getOptionScopes(r,o);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function lb(e,t){const n=on.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function mF(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function vF(e,t){return e===t?"_index_":"_value_"}function WC(e){if(e==="x"||e==="y"||e==="r")return e}function bF(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function cb(e,...t){if(WC(e))return e;for(const n of t){const r=n.axis||bF(n.position)||e.length>1&&WC(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function qC(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function yF(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 qC(e,"x",n[0])||qC(e,"y",n[0])}return{}}function xF(e,t){const n=qs[e.type]||{scales:{}},r=t.scales||{},i=lb(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!wt(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=cb(s,a,yF(s,e),on.scales[a.type]),c=vF(l,i),d=n.scales||{};o[s]=Kc(Object.create(null),[{axis:l},a,d[l],d[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||lb(a,t),d=(qs[a]||{}).scales||{};Object.keys(d).forEach(f=>{const g=mF(f,l),p=s[g+"AxisID"]||g;o[p]=o[p]||Object.create(null),Kc(o[p],[{axis:g},r[p],d[f]])})}),Object.keys(o).forEach(s=>{const a=o[s];Kc(a,[on.scales[a.type],on.scale])}),o}function UC(e){const t=e.options||(e.options={});t.plugins=tt(t.plugins,{}),t.scales=xF(e,t)}function GC(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function wF(e){return e=e||{},e.data=GC(e.data),UC(e),e}const YC=new Map,KC=new Set;function oh(e,t){let n=YC.get(e);return n||(n=t(),YC.set(e,n),KC.add(n)),n}const du=(e,t,n)=>{const r=Ho(t,n);r!==void 0&&e.add(r)};class _F{constructor(t){this._config=wF(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=GC(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(),UC(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return oh(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return oh(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return oh(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return oh(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(d=>{t&&(l.add(t),d.forEach(f=>du(l,t,f))),d.forEach(f=>du(l,i,f)),d.forEach(f=>du(l,qs[o]||{},f)),d.forEach(f=>du(l,on,f)),d.forEach(f=>du(l,qv,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),KC.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,qs[n]||{},on.datasets[n]||{},{type:n},on,qv]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=XC(this._resolverCache,t,i);let l=s;if(CF(s,n)){o.$shared=!1,r=Wo(r)?r():r;const c=this.createResolver(t,r,a);l=hl(s,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=XC(this._resolverCache,t,r);return wt(n)?hl(o,n,void 0,i):o}}function XC(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:Kv(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const SF=e=>wt(e)&&Object.getOwnPropertyNames(e).some(t=>Wo(e[t]));function CF(e,t){const{isScriptable:n,isIndexable:r}=ZS(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(Wo(a)||SF(a))||s&&Yt(a))return!0}return!1}var EF="4.4.1";const OF=["top","bottom","left","right","chartArea"];function QC(e,t){return e==="top"||e==="bottom"||OF.indexOf(e)===-1&&t==="x"}function ZC(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function JC(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),jt(n&&n.onComplete,[e],t)}function PF(e){const t=e.chart,n=t.options.animation;jt(n&&n.onProgress,[e],t)}function eE(e){return Zv()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const sh={},tE=e=>{const t=eE(e);return Object.values(sh).filter(n=>n.canvas===t).pop()};function kF(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const s=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=s)}}}function MF(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function ah(e,t,n){return e.options.clip?e[n]:t[n]}function DF(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:ah(n,t,"left"),right:ah(n,t,"right"),top:ah(r,t,"top"),bottom:ah(r,t,"bottom")}:t}class Qr{static register(...t){Ni.add(...t),nE()}static unregister(...t){Ni.remove(...t),nE()}constructor(t,n){const r=this.config=new _F(n),i=eE(t),o=tE(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||G$(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,d=l&&l.width;if(this.id=AL(),this.ctx=a,this.canvas=l,this.width=d,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 dF,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=YL(f=>this.update(f),s.resizeDelay||0),this._dataChanges=[],sh[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}co.listen(this,"complete",JC),co.listen(this,"progress",PF),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return gt(t)?n&&o?o:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ni}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():sC(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return KS(this.canvas,this.ctx),this}stop(){return co.stop(this),this}resize(t,n){co.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,sC(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),jt(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Nt(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];n&&(o=o.concat(Object.keys(n).map(s=>{const a=n[s],l=cb(s,a),c=l==="r",d=l==="x";return{options:a,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),Nt(o,s=>{const a=s.options,l=a.id,c=cb(l,a),d=tt(a.type,s.dtype);(a.position===void 0||QC(a.position,c)!==QC(s.dposition))&&(a.position=s.dposition),i[l]=!0;let f=null;if(l in r&&r[l].type===d)f=r[l];else{const g=Ni.getScale(d);f=new g({id:l,type:d,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),Nt(i,(s,a)=>{s||delete r[a]}),Nt(r,s=>{Un.configure(this,s,s.options),Un.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(ZC("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const o=n[r];let s=this.getDatasetMeta(r);const a=o.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=o.indexAxis||lb(a,this.options),s.order=o.order||0,s.index=r,s.label=""+o.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=Ni.getController(a),{datasetElementType:c,dataElementType:d}=on.datasets[a];Object.assign(l,{dataElementType:Ni.getElement(d),datasetElementType:c&&Ni.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Nt(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,d=this.data.datasets.length;c<d;c++){const{controller:f}=this.getDatasetMeta(c),g=!i&&o.indexOf(f)===-1;f.buildOrUpdateElements(g),s=Math.max(+f.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),i||Nt(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ZC("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Nt(this.scales,t=>{Un.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!TS(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const s=r==="_removeElements"?-o:o;kF(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),i=r(0);for(let o=1;o<n;o++)if(!TS(i,r(o)))return;return Array.from(i).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Un.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Nt(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Wo(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(co.has(this)?this.attached&&!co.running(this)&&co.start(this):(this.draw(),JC({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resize(r,i),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,o;for(i=0,o=n.length;i<o;++i){const s=n[i];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,i=!r.disabled,o=DF(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&Hf(n,{left:r.left===!1?0:o.left-r.left,right:r.right===!1?this.width:o.right+r.right,top:r.top===!1?0:o.top-r.top,bottom:r.bottom===!1?this.height:o.bottom+r.bottom}),t.controller.draw(),i&&Wf(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return lo(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=O$.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=Uo(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",o=this.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,i);Xc(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),co.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(),KS(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete sh[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(o,s)=>{n.addEventListener(this,o,s),t[o]=s},i=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};Nt(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){Nt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Nt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,s,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){s=t[a];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[i+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:s})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!$f(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(f=>d.datasetIndex===f.datasetIndex&&d.index===f.index)),s=o(n,t),a=r?t:o(t,n);s.length&&this.updateHoverStyle(s,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,s=n,a=this._getActiveElements(t,i,r,s),l=FL(t),c=MF(t,this._lastEvent,r,l);r&&(this._lastEvent=null,jt(o.onHover,[t,a,this],this),l&&jt(o.onClick,[t,a,this],this));const d=!$f(a,i);return(d||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,d}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}ke(Qr,"defaults",on),ke(Qr,"instances",sh),ke(Qr,"overrides",qs),ke(Qr,"registry",Ni),ke(Qr,"version",EF),ke(Qr,"getChart",tE);function nE(){return Nt(Qr.instances,e=>e._plugins.invalidate())}function TF(e,t,n){const{startAngle:r,pixelMargin:i,x:o,y:s,outerRadius:a,innerRadius:l}=t;let c=i/a;e.beginPath(),e.arc(o,s,a,r-c,n+c),l>i?(c=i/l,e.arc(o,s,l,n+c,r-c,!0)):e.arc(o,s,i,n+dn,r-dn),e.closePath(),e.clip()}function AF(e){return Yv(e,["outerStart","outerEnd","innerStart","innerEnd"])}function IF(e,t,n,r){const i=AF(e.options.borderRadius),o=(n-t)/2,s=Math.min(o,r*t/2),a=l=>{const c=(n-Math.min(o,l))*r/2;return kn(l,0,Math.min(o,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:kn(i.innerStart,0,s),innerEnd:kn(i.innerEnd,0,s)}}function ml(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function lh(e,t,n,r,i,o){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:d}=t,f=Math.max(t.outerRadius+r+n-c,0),g=d>0?d+r+n+c:0;let p=0;const v=i-l;if(r){const $=d>0?d-r:0,J=f>0?f-r:0,G=($+J)/2,q=G!==0?v*G/(G+r):v;p=(v-q)/2}const y=Math.max(.001,v*f-n/Kt)/f,x=(v-y)/2,w=l+x+p,S=i-x-p,{outerStart:C,outerEnd:P,innerStart:O,innerEnd:k}=IF(t,g,f,S-w),A=f-C,L=f-P,F=w+C/A,z=S-P/L,B=g+O,V=g+k,X=w+O/B,K=S-k/V;if(e.beginPath(),o){const $=(F+z)/2;if(e.arc(s,a,f,F,$),e.arc(s,a,f,$,z),P>0){const se=ml(L,z,s,a);e.arc(se.x,se.y,P,z,S+dn)}const J=ml(V,S,s,a);if(e.lineTo(J.x,J.y),k>0){const se=ml(V,K,s,a);e.arc(se.x,se.y,k,S+dn,K+Math.PI)}const G=(S-k/g+(w+O/g))/2;if(e.arc(s,a,g,S-k/g,G,!0),e.arc(s,a,g,G,w+O/g,!0),O>0){const se=ml(B,X,s,a);e.arc(se.x,se.y,O,X+Math.PI,w-dn)}const q=ml(A,w,s,a);if(e.lineTo(q.x,q.y),C>0){const se=ml(A,F,s,a);e.arc(se.x,se.y,C,w-dn,F)}}else{e.moveTo(s,a);const $=Math.cos(F)*f+s,J=Math.sin(F)*f+a;e.lineTo($,J);const G=Math.cos(z)*f+s,q=Math.sin(z)*f+a;e.lineTo(G,q)}e.closePath()}function NF(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a}=t;let l=t.endAngle;if(o){lh(e,t,n,r,l,i);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=s+(a%Xt||Xt))}return lh(e,t,n,r,l,i),e.fill(),l}function RF(e,t,n,r,i){const{fullCircles:o,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:f,borderDashOffset:g}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(f||[]),e.lineDashOffset=g,p?(e.lineWidth=c*2,e.lineJoin=d||"round"):(e.lineWidth=c,e.lineJoin=d||"bevel");let v=t.endAngle;if(o){lh(e,t,n,r,v,i);for(let y=0;y<o;++y)e.stroke();isNaN(a)||(v=s+(a%Xt||Xt))}p&&TF(e,t,v),o||(lh(e,t,n,r,v,i),e.stroke())}class vl extends uo{constructor(n){super();ke(this,"circumference");ke(this,"endAngle");ke(this,"fullCircles");ke(this,"innerRadius");ke(this,"outerRadius");ke(this,"pixelMargin");ke(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,i){const o=this.getProps(["x","y"],i),{angle:s,distance:a}=LS(o,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:d,outerRadius:f,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=(this.options.spacing+this.options.borderWidth)/2,y=tt(g,c-l)>=Xt||Zc(s,l,c),x=so(a,d+p,f+p);return y&&x}getCenterPoint(n){const{x:r,y:i,startAngle:o,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:d}=this.options,f=(o+s)/2,g=(a+l+d+c)/2;return{x:r+Math.cos(f)*g,y:i+Math.sin(f)*g}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,o=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>Xt?Math.floor(i/Xt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(Kt,i||0)),d=o*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,NF(n,this,d,s,a),RF(n,this,d,s,a),n.restore()}}ke(vl,"id","arc"),ke(vl,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),ke(vl,"defaultRoutes",{backgroundColor:"backgroundColor"}),ke(vl,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function rE(e,t,n=t){e.lineCap=tt(n.borderCapStyle,t.borderCapStyle),e.setLineDash(tt(n.borderDash,t.borderDash)),e.lineDashOffset=tt(n.borderDashOffset,t.borderDashOffset),e.lineJoin=tt(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=tt(n.borderWidth,t.borderWidth),e.strokeStyle=tt(n.borderColor,t.borderColor)}function LF(e,t,n){e.lineTo(n.x,n.y)}function $F(e){return e.stepped?s9:e.tension||e.cubicInterpolationMode==="monotone"?a9:LF}function iE(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:s,end:a}=t,l=Math.max(i,s),c=Math.min(o,a),d=i<s&&o<s||i>a&&o>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!d?r+c-l:c-l}}function FF(e,t,n,r){const{points:i,options:o}=t,{count:s,start:a,loop:l,ilen:c}=iE(i,n,r),d=$F(o);let{move:f=!0,reverse:g}=r||{},p,v,y;for(p=0;p<=c;++p)v=i[(a+(g?c-p:p))%s],!v.skip&&(f?(e.moveTo(v.x,v.y),f=!1):d(e,y,v,g,o.stepped),y=v);return l&&(v=i[(a+(g?c:0))%s],d(e,y,v,g,o.stepped)),!!l}function jF(e,t,n,r){const i=t.points,{count:o,start:s,ilen:a}=iE(i,n,r),{move:l=!0,reverse:c}=r||{};let d=0,f=0,g,p,v,y,x,w;const S=P=>(s+(c?a-P:P))%o,C=()=>{y!==x&&(e.lineTo(d,x),e.lineTo(d,y),e.lineTo(d,w))};for(l&&(p=i[S(0)],e.moveTo(p.x,p.y)),g=0;g<=a;++g){if(p=i[S(g)],p.skip)continue;const P=p.x,O=p.y,k=P|0;k===v?(O<y?y=O:O>x&&(x=O),d=(f*d+P)/++f):(C(),e.lineTo(P,O),v=k,f=0,y=x=O),w=O}C()}function ub(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?jF:FF}function zF(e){return e.stepped?j9:e.tension||e.cubicInterpolationMode==="monotone"?z9:Qs}function BF(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),rE(e,t.options),e.stroke(i)}function VF(e,t,n,r){const{segments:i,options:o}=t,s=ub(t);for(const a of i)rE(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const HF=typeof Path2D=="function";function WF(e,t,n,r){HF&&!t.options.segment?BF(e,t,n,r):VF(e,t,n,r)}class Go extends uo{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;T9(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=U9(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],o=this.points,s=hC(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],l=zF(r);let c,d;for(c=0,d=s.length;c<d;++c){const{start:f,end:g}=s[c],p=o[f],v=o[g];if(p===v){a.push(p);continue}const y=Math.abs((i-p[n])/(v[n]-p[n])),x=l(p,v,y,r.stepped);x[n]=t[n],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,n,r){return ub(this)(t,this,n,r)}path(t,n,r){const i=this.segments,o=ub(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)s&=o(t,this,a,{start:n,end:n+r-1});return!!s}draw(t,n,r,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),WF(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ke(Go,"id","line"),ke(Go,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ke(Go,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ke(Go,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function oE(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<i.radius+i.hitRadius}class fu extends uo{constructor(n){super();ke(this,"parsed");ke(this,"skip");ke(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const o=this.options,{x:s,y:a}=this.getProps(["x","y"],i);return Math.pow(n-s,2)+Math.pow(r-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,r){return oE(this,n,"x",r)}inYRange(n,r){return oE(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!lo(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Gv(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}ke(fu,"id","point"),ke(fu,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ke(fu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function sE(e,t){const{x:n,y:r,base:i,width:o,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,c,d,f;return e.horizontal?(f=s/2,a=Math.min(n,i),l=Math.max(n,i),c=r-f,d=r+f):(f=o/2,a=n-f,l=n+f,c=Math.min(r,i),d=Math.max(r,i)),{left:a,top:c,right:l,bottom:d}}function Yo(e,t,n,r){return e?0:kn(t,n,r)}function qF(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,o=QS(r);return{t:Yo(i.top,o.top,0,n),r:Yo(i.right,o.right,0,t),b:Yo(i.bottom,o.bottom,0,n),l:Yo(i.left,o.left,0,t)}}function UF(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=Ys(i),s=Math.min(t,n),a=e.borderSkipped,l=r||wt(i);return{topLeft:Yo(!l||a.top||a.left,o.topLeft,0,s),topRight:Yo(!l||a.top||a.right,o.topRight,0,s),bottomLeft:Yo(!l||a.bottom||a.left,o.bottomLeft,0,s),bottomRight:Yo(!l||a.bottom||a.right,o.bottomRight,0,s)}}function GF(e){const t=sE(e),n=t.right-t.left,r=t.bottom-t.top,i=qF(e,n/2,r/2),o=UF(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function db(e,t,n,r){const i=t===null,o=n===null,a=e&&!(i&&o)&&sE(e,r);return a&&(i||so(t,a.left,a.right))&&(o||so(n,a.top,a.bottom))}function YF(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function KF(e,t){e.rect(t.x,t.y,t.w,t.h)}function fb(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+o,h:e.h+s,radius:e.radius}}class hu extends uo{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:o,outer:s}=GF(this),a=YF(s.radius)?nu:KF;t.save(),(s.w!==o.w||s.h!==o.h)&&(t.beginPath(),a(t,fb(s,n,o)),t.clip(),a(t,fb(o,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,fb(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return db(this,t,n,r)}inXRange(t,n){return db(this,t,null,n)}inYRange(t,n){return db(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+i)/2:n,y:o?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}ke(hu,"id","bar"),ke(hu,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),ke(hu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var XF=Object.freeze({__proto__:null,ArcElement:vl,BarElement:hu,LineElement:Go,PointElement:fu});const hb=["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)"],aE=hb.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function lE(e){return hb[e%hb.length]}function cE(e){return aE[e%aE.length]}function QF(e,t){return e.borderColor=lE(t),e.backgroundColor=cE(t),++t}function ZF(e,t){return e.backgroundColor=e.data.map(()=>lE(t++)),t}function JF(e,t){return e.backgroundColor=e.data.map(()=>cE(t++)),t}function e8(e){let t=0;return(n,r)=>{const i=e.getDatasetMeta(r).controller;i instanceof Zs?t=ZF(n,t):i instanceof iu?t=JF(n,t):i&&(t=QF(n,t))}}function uE(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function t8(e){return e&&(e.borderColor||e.backgroundColor)}var n8={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:i}=e.config,{elements:o}=i;if(!n.forceOverride&&(uE(r)||t8(i)||o&&uE(o)))return;const s=e8(e);r.forEach(s)}};function r8(e,t,n,r,i){const o=i.samples||r;if(o>=n)return e.slice(t,t+n);const s=[],a=(n-2)/(o-2);let l=0;const c=t+n-1;let d=t,f,g,p,v,y;for(s[l++]=e[d],f=0;f<o-2;f++){let x=0,w=0,S;const C=Math.floor((f+1)*a)+1+t,P=Math.min(Math.floor((f+2)*a)+1,n)+t,O=P-C;for(S=C;S<P;S++)x+=e[S].x,w+=e[S].y;x/=O,w/=O;const k=Math.floor(f*a)+1+t,A=Math.min(Math.floor((f+1)*a)+1,n)+t,{x:L,y:F}=e[d];for(p=v=-1,S=k;S<A;S++)v=.5*Math.abs((L-x)*(e[S].y-F)-(L-e[S].x)*(w-F)),v>p&&(p=v,g=e[S],y=S);s[l++]=g,d=y}return s[l++]=e[c],s}function i8(e,t,n,r){let i=0,o=0,s,a,l,c,d,f,g,p,v,y;const x=[],w=t+n-1,S=e[t].x,P=e[w].x-S;for(s=t;s<t+n;++s){a=e[s],l=(a.x-S)/P*r,c=a.y;const O=l|0;if(O===d)c<v?(v=c,f=s):c>y&&(y=c,g=s),i=(o*i+a.x)/++o;else{const k=s-1;if(!gt(f)&&!gt(g)){const A=Math.min(f,g),L=Math.max(f,g);A!==p&&A!==k&&x.push({...e[A],x:i}),L!==p&&L!==k&&x.push({...e[L],x:i})}s>0&&k!==p&&x.push(e[k]),x.push(a),d=O,o=0,v=y=c,f=g=p=s}}return x}function dE(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 fE(e){e.data.datasets.forEach(t=>{dE(t)})}function o8(e,t){const n=t.length;let r=0,i;const{iScale:o}=e,{min:s,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(r=kn(ao(t,o.axis,s).lo,0,n-1)),c?i=kn(ao(t,o.axis,a).hi+1,r,n)-r:i=n-r,{start:r,count:i}}var s8={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){fE(e);return}const r=e.width;e.data.datasets.forEach((i,o)=>{const{_data:s,indexAxis:a}=i,l=e.getDatasetMeta(o),c=s||i.data;if(Qt([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const d=e.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||e.options.parsing)return;let{start:f,count:g}=o8(l,c);const p=n.threshold||4*r;if(g<=p){dE(i);return}gt(s)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let v;switch(n.algorithm){case"lttb":v=r8(c,f,g,r,n);break;case"min-max":v=i8(c,f,g,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=v})},destroy(e){fE(e)}};function a8(e,t,n){const r=e.segments,i=e.points,o=t.points,s=[];for(const a of r){let{start:l,end:c}=a;c=gb(l,c,i);const d=pb(n,i[l],i[c],a.loop);if(!t.segments){s.push({source:a,target:d,start:i[l],end:i[c]});continue}const f=hC(t,d);for(const g of f){const p=pb(n,o[g.start],o[g.end],g.loop),v=fC(a,i,p);for(const y of v)s.push({source:y,target:g,start:{[n]:hE(d,p,"start",Math.max)},end:{[n]:hE(d,p,"end",Math.min)}})}}return s}function pb(e,t,n,r){if(r)return;let i=t[e],o=n[e];return e==="angle"&&(i=Pr(i),o=Pr(o)),{property:e,start:i,end:o}}function l8(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,o=[];return t.segments.forEach(({start:s,end:a})=>{a=gb(s,a,i);const l=i[s],c=i[a];r!==null?(o.push({x:l.x,y:r}),o.push({x:c.x,y:r})):n!==null&&(o.push({x:n,y:l.y}),o.push({x:n,y:c.y}))}),o}function gb(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function hE(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function pE(e,t){let n=[],r=!1;return Yt(e)?(r=!0,n=e):n=l8(e,t),n.length?new Go({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function gE(e){return e&&e.fill!==!1}function c8(e,t,n){let i=e[t].fill;const o=[t];let s;if(!n)return i;for(;i!==!1&&o.indexOf(i)===-1;){if(!cn(i))return i;if(s=e[i],!s)return!1;if(s.visible)return i;o.push(i),i=s.fill}return!1}function u8(e,t,n){const r=p8(e);if(wt(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return cn(i)&&Math.floor(i)===i?d8(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function d8(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function f8(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:wt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function h8(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:wt(e)?r=e.value:r=t.getBaseValue(),r}function p8(e){const t=e.options,n=t.fill;let r=tt(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function g8(e){const{scale:t,index:n,line:r}=e,i=[],o=r.segments,s=r.points,a=m8(t,n);a.push(pE({x:null,y:t.bottom},r));for(let l=0;l<o.length;l++){const c=o[l];for(let d=c.start;d<=c.end;d++)v8(i,s[d],a)}return new Go({points:i,options:{}})}function m8(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const o=r[i];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function v8(e,t,n){const r=[];for(let i=0;i<n.length;i++){const o=n[i],{first:s,last:a,point:l}=b8(o,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function b8(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],o=e.segments,s=e.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const d=o[c],f=s[d.start][n],g=s[d.end][n];if(so(i,f,g)){a=i===f,l=i===g;break}}return{first:a,last:l,point:r}}class mE{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:o,radius:s}=this;return n=n||{start:0,end:Xt},t.arc(i,o,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,o=t.angle;return{x:n+Math.cos(o)*i,y:r+Math.sin(o)*i,angle:o}}}function y8(e){const{chart:t,fill:n,line:r}=e;if(cn(n))return x8(t,n);if(n==="stack")return g8(e);if(n==="shape")return!0;const i=w8(e);return i instanceof mE?i:pE(i,r)}function x8(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function w8(e){return(e.scale||{}).getPointPositionForValue?S8(e):_8(e)}function _8(e){const{scale:t={},fill:n}=e,r=f8(n,t);if(cn(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function S8(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,o=r.reverse?t.max:t.min,s=h8(n,t,o),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,o);return new mE({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,s));return a}function mb(e,t,n){const r=y8(t),{line:i,scale:o,axis:s}=t,a=i.options,l=a.fill,c=a.backgroundColor,{above:d=c,below:f=c}=l||{};r&&i.points.length&&(Hf(e,n),C8(e,{line:i,target:r,above:d,below:f,area:n,scale:o,axis:s}),Wf(e))}function C8(e,t){const{line:n,target:r,above:i,below:o,area:s,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&o!==i&&(vE(e,r,s.top),bE(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore(),e.save(),vE(e,r,s.bottom)),bE(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore()}function vE(e,t,n){const{segments:r,points:i}=t;let o=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,d=i[l],f=i[gb(l,c,i)];o?(e.moveTo(d.x,d.y),o=!1):(e.lineTo(d.x,n),e.lineTo(d.x,d.y)),s=!!t.pathSegment(e,a,{move:s}),s?e.closePath():e.lineTo(f.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function bE(e,t){const{line:n,target:r,property:i,color:o,scale:s}=t,a=a8(n,r,i);for(const{source:l,target:c,start:d,end:f}of a){const{style:{backgroundColor:g=o}={}}=l,p=r!==!0;e.save(),e.fillStyle=g,E8(e,s,p&&pb(i,d,f)),e.beginPath();const v=!!n.pathSegment(e,l);let y;if(p){v?e.closePath():yE(e,r,f,i);const x=!!r.pathSegment(e,c,{move:v,reverse:!0});y=v&&x,y||yE(e,r,d,i)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function E8(e,t,n){const{top:r,bottom:i}=t.chart.chartArea,{property:o,start:s,end:a}=n||{};o==="x"&&(e.beginPath(),e.rect(s,r,a-s,i-r),e.clip())}function yE(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var O8={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let o,s,a,l;for(s=0;s<r;++s)o=e.getDatasetMeta(s),a=o.dataset,l=null,a&&a.options&&a instanceof Go&&(l={visible:e.isDatasetVisible(s),index:s,fill:u8(a,s,r),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,i.push(l);for(s=0;s<r;++s)l=i[s],!(!l||l.fill===!1)&&(l.fill=c8(i,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let s=i.length-1;s>=0;--s){const a=i[s].$filler;a&&(a.line.updateControlPoints(o,a.axis),r&&a.fill&&mb(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const o=r[i].$filler;gE(o)&&mb(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!gE(r)||n.drawTime!=="beforeDatasetDraw"||mb(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const xE=(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)}},P8=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class wE extends uo{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=jt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=bn(r.font),o=i.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=xE(r,o);let c,d;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(s,o,a,l)+10):(d=this.maxHeight,c=this._fitCols(s,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:o,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=i+a;let f=t;o.textAlign="left",o.textBaseline="middle";let g=-1,p=-d;return this.legendItems.forEach((v,y)=>{const x=r+n/2+o.measureText(v.text).width;(y===0||c[c.length-1]+x+2*a>s)&&(f+=d,c[c.length-(y>0?0:1)]=0,p+=d,g++),l[y]={left:0,top:p,row:g,width:x,height:i},c[c.length-1]+=x+a}),f}_fitCols(t,n,r,i){const{ctx:o,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=s-t;let f=a,g=0,p=0,v=0,y=0;return this.legendItems.forEach((x,w)=>{const{itemWidth:S,itemHeight:C}=k8(r,n,o,x,i);w>0&&p+C+2*a>d&&(f+=g+a,c.push({width:g,height:p}),v+=g+a,y++,g=p=0),l[w]={left:v,top:p,col:y,width:S,height:C},g=Math.max(g,S),p+=C+a}),f+=g,c.push({width:g,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,s=gl(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=qn(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=qn(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+i}else{let a=0,l=qn(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=qn(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Hf(t,this),this._draw(),Wf(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:s}=t,a=on.color,l=gl(t.rtl,this.left,this.width),c=bn(s.font),{padding:d}=s,f=c.size,g=f/2;let p;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:v,boxHeight:y,itemHeight:x}=xE(s,f),w=function(k,A,L){if(isNaN(v)||v<=0||isNaN(y)||y<0)return;i.save();const F=tt(L.lineWidth,1);if(i.fillStyle=tt(L.fillStyle,a),i.lineCap=tt(L.lineCap,"butt"),i.lineDashOffset=tt(L.lineDashOffset,0),i.lineJoin=tt(L.lineJoin,"miter"),i.lineWidth=F,i.strokeStyle=tt(L.strokeStyle,a),i.setLineDash(tt(L.lineDash,[])),s.usePointStyle){const z={radius:y*Math.SQRT2/2,pointStyle:L.pointStyle,rotation:L.rotation,borderWidth:F},B=l.xPlus(k,v/2),V=A+g;XS(i,z,B,V,s.pointStyleWidth&&v)}else{const z=A+Math.max((f-y)/2,0),B=l.leftForLtr(k,v),V=Ys(L.borderRadius);i.beginPath(),Object.values(V).some(X=>X!==0)?nu(i,{x:B,y:z,w:v,h:y,radius:V}):i.rect(B,z,v,y),i.fill(),F!==0&&i.stroke()}i.restore()},S=function(k,A,L){Gs(i,L.text,k,A+x/2,c,{strikethrough:L.hidden,textAlign:l.textAlign(L.textAlign)})},C=this.isHorizontal(),P=this._computeTitleHeight();C?p={x:qn(o,this.left+d,this.right-r[0]),y:this.top+d+P,line:0}:p={x:this.left+d,y:qn(o,this.top+P+d,this.bottom-n[0].height),line:0},lC(this.ctx,t.textDirection);const O=x+d;this.legendItems.forEach((k,A)=>{i.strokeStyle=k.fontColor,i.fillStyle=k.fontColor;const L=i.measureText(k.text).width,F=l.textAlign(k.textAlign||(k.textAlign=s.textAlign)),z=v+g+L;let B=p.x,V=p.y;l.setWidth(this.width),C?A>0&&B+z+d>this.right&&(V=p.y+=O,p.line++,B=p.x=qn(o,this.left+d,this.right-r[p.line])):A>0&&V+O>this.bottom&&(B=p.x=B+n[p.line].width+d,p.line++,V=p.y=qn(o,this.top+P+d,this.bottom-n[p.line].height));const X=l.x(B);if(w(X,V,k),B=KL(F,B+v+g,C?B+z:this.right,t.rtl),S(l.x(B),V,k),C)p.x+=z+d;else if(typeof k.text!="string"){const K=c.lineHeight;p.y+=_E(k,K)+d}else p.y+=O}),cC(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=bn(n.font),i=Rn(n.padding);if(!n.display)return;const o=gl(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let d,f=this.left,g=this.width;if(this.isHorizontal())g=Math.max(...this.lineWidths),d=this.top+c,f=qn(t.align,f,this.right-g);else{const v=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);d=c+qn(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const p=qn(a,f,f+g);s.textAlign=o.textAlign(Vv(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Gs(s,n.text,p,d,r)}_computeTitleHeight(){const t=this.options.title,n=bn(t.font),r=Rn(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(so(t,this.left,this.right)&&so(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(i=o[r],so(t,i.left,i.left+i.width)&&so(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!T8(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=P8(i,r);i&&!o&&jt(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!o&&jt(n.onHover,[t,r,this],this)}else r&&jt(n.onClick,[t,r,this],this)}}function k8(e,t,n,r,i){const o=M8(r,e,t,n),s=D8(i,r,t.lineHeight);return{itemWidth:o,itemHeight:s}}function M8(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((o,s)=>o.length>s.length?o:s)),t+n.size/2+r.measureText(i).width}function D8(e,t,n){let r=e;return typeof t.text!="string"&&(r=_E(t,n)),r}function _E(e,t){const n=e.text?e.text.length:0;return t*n}function T8(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var A8={id:"legend",_element:wE,start(e,t,n){const r=e.legend=new wE({ctx:e.ctx,options:n,chart:e});Un.configure(e,r,n),Un.addBox(e,r)},stop(e){Un.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Un.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),d=Rn(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:s&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class vb extends uo{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=Yt(r.text)?r.text.length:1;this._padding=Rn(r.padding);const o=i*bn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:o,options:s}=this,a=s.align;let l=0,c,d,f;return this.isHorizontal()?(d=qn(a,r,o),f=n+t,c=o-r):(s.position==="left"?(d=r+t,f=qn(a,i,n),l=Kt*-.5):(d=o-t,f=qn(a,n,i),l=Kt*.5),c=i-n),{titleX:d,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=bn(n.font),o=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Gs(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Vv(n.align),textBaseline:"middle",translation:[s,a]})}}function I8(e,t){const n=new vb({ctx:e.ctx,options:t,chart:e});Un.configure(e,n,t),Un.addBox(e,n),e.titleBlock=n}var N8={id:"title",_element:vb,start(e,t,n){I8(e,n)},stop(e){const t=e.titleBlock;Un.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Un.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 ch=new WeakMap;var R8={id:"subtitle",start(e,t,n){const r=new vb({ctx:e.ctx,options:n,chart:e});Un.configure(e,r,n),Un.addBox(e,r),ch.set(e,r)},stop(e){Un.removeBox(e,ch.get(e)),ch.delete(e)},beforeUpdate(e,t,n){const r=ch.get(e);Un.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 pu={average(e){if(!e.length)return!1;let t,n,r=0,i=0,o=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const a=s.tooltipPosition();r+=a.x,i+=a.y,++o}}return{x:r/o,y:i/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,o,s,a;for(o=0,s=e.length;o<s;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),d=zv(t,c);d<i&&(i=d,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Ri(e,t){return t&&(Yt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function fo(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
122
|
+
`)>-1?e.split(`
|
|
123
|
+
`):e}function L8(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:s,value:a}=o.getLabelAndValue(i);return{chart:e,label:s,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function SE(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:s,boxHeight:a}=t,l=bn(t.bodyFont),c=bn(t.titleFont),d=bn(t.footerFont),f=o.length,g=i.length,p=r.length,v=Rn(t.padding);let y=v.height,x=0,w=r.reduce((P,O)=>P+O.before.length+O.lines.length+O.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,f&&(y+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),w){const P=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=p*P+(w-p)*l.lineHeight+(w-1)*t.bodySpacing}g&&(y+=t.footerMarginTop+g*d.lineHeight+(g-1)*t.footerSpacing);let S=0;const C=function(P){x=Math.max(x,n.measureText(P).width+S)};return n.save(),n.font=c.string,Nt(e.title,C),n.font=l.string,Nt(e.beforeBody.concat(e.afterBody),C),S=t.displayColors?s+2+t.boxPadding:0,Nt(r,P=>{Nt(P.before,C),Nt(P.lines,C),Nt(P.after,C)}),S=0,n.font=d.string,Nt(e.footer,C),n.restore(),x+=v.width,{width:x,height:y}}function $8(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function F8(e,t,n,r){const{x:i,width:o}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&i+o+s>t.width||e==="right"&&i-o-s<0)return!0}function j8(e,t,n,r){const{x:i,width:o}=n,{width:s,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=o/2?c="left":i>=s-o/2&&(c="right"),F8(c,e,t,n)&&(c="center"),c}function CE(e,t,n){const r=n.yAlign||t.yAlign||$8(e,n);return{xAlign:n.xAlign||t.xAlign||j8(e,t,n,r),yAlign:r}}function z8(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function B8(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function EE(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=i+o,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:p}=Ys(s);let v=z8(t,a);const y=B8(t,l,c);return l==="center"?a==="left"?v+=c:a==="right"&&(v-=c):a==="left"?v-=Math.max(d,g)+i:a==="right"&&(v+=Math.max(f,p)+i),{x:kn(v,0,r.width-t.width),y:kn(y,0,r.height-t.height)}}function uh(e,t,n){const r=Rn(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function OE(e){return Ri([],fo(e))}function V8(e,t,n){return Uo(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function PE(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const kE={beforeTitle:oo,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:oo,beforeBody:oo,beforeLabel:oo,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 gt(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:oo,afterBody:oo,beforeFooter:oo,footer:oo,afterFooter:oo};function lr(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?kE[t].call(n,r):i}let ME=(Mx=class extends uo{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new vC(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=V8(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=lr(r,"beforeTitle",this,t),o=lr(r,"title",this,t),s=lr(r,"afterTitle",this,t);let a=[];return a=Ri(a,fo(i)),a=Ri(a,fo(o)),a=Ri(a,fo(s)),a}getBeforeBody(t,n){return OE(lr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Nt(t,o=>{const s={before:[],lines:[],after:[]},a=PE(r,o);Ri(s.before,fo(lr(a,"beforeLabel",this,o))),Ri(s.lines,lr(a,"label",this,o)),Ri(s.after,fo(lr(a,"afterLabel",this,o))),i.push(s)}),i}getAfterBody(t,n){return OE(lr(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=lr(r,"beforeFooter",this,t),o=lr(r,"footer",this,t),s=lr(r,"afterFooter",this,t);let a=[];return a=Ri(a,fo(i)),a=Ri(a,fo(o)),a=Ri(a,fo(s)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],s=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(L8(this.chart,n[l]));return t.filter&&(a=a.filter((d,f,g)=>t.filter(d,f,g,r))),t.itemSort&&(a=a.sort((d,f)=>t.itemSort(d,f,r))),Nt(a,d=>{const f=PE(t.callbacks,d);i.push(lr(f,"labelColor",this,d)),o.push(lr(f,"labelPointStyle",this,d)),s.push(lr(f,"labelTextColor",this,d))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=s,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,s=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const a=pu[r.position].call(this,i,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=SE(this,r),c=Object.assign({},a,l),d=CE(this.chart,r,c),f=EE(r,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:f}=Ys(a),{x:g,y:p}=t,{width:v,height:y}=n;let x,w,S,C,P,O;return o==="center"?(P=p+y/2,i==="left"?(x=g,w=x-s,C=P+s,O=P-s):(x=g+v,w=x+s,C=P-s,O=P+s),S=x):(i==="left"?w=g+Math.max(l,d)+s:i==="right"?w=g+v-Math.max(c,f)-s:w=this.caretX,o==="top"?(C=p,P=C-s,x=w-s,S=w+s):(C=p+y,P=C+s,x=w+s,S=w-s),O=C),{x1:x,x2:w,x3:S,y1:C,y2:P,y3:O}}drawTitle(t,n,r){const i=this.title,o=i.length;let s,a,l;if(o){const c=gl(r.rtl,this.x,this.width);for(t.x=uh(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=bn(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+a,l+1===o&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,o){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,d=bn(o.bodyFont),f=uh(this,"left",o),g=i.x(f),p=l<d.lineHeight?(d.lineHeight-l)/2:0,v=n.y+p;if(o.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=i.leftForLtr(g,c)+c/2,w=v+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Gv(t,y,x,w),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Gv(t,y,x,w)}else{t.lineWidth=wt(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 y=i.leftForLtr(g,c),x=i.leftForLtr(i.xPlus(g,1),c-2),w=Ys(s.borderRadius);Object.values(w).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,nu(t,{x:y,y:v,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),nu(t,{x,y:v+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(y,v,c,l),t.strokeRect(y,v,c,l),t.fillStyle=s.backgroundColor,t.fillRect(x,v+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:d}=r,f=bn(r.bodyFont);let g=f.lineHeight,p=0;const v=gl(r.rtl,this.x,this.width),y=function(L){n.fillText(L,v.x(t.x+p),t.y+g/2),t.y+=g+o},x=v.textAlign(s);let w,S,C,P,O,k,A;for(n.textAlign=s,n.textBaseline="middle",n.font=f.string,t.x=uh(this,x,r),n.fillStyle=r.bodyColor,Nt(this.beforeBody,y),p=a&&x!=="right"?s==="center"?c/2+d:c+2+d:0,P=0,k=i.length;P<k;++P){for(w=i[P],S=this.labelTextColors[P],n.fillStyle=S,Nt(w.before,y),C=w.lines,a&&C.length&&(this._drawColorBox(n,t,P,v,r),g=Math.max(f.lineHeight,l)),O=0,A=C.length;O<A;++O)y(C[O]),g=f.lineHeight;Nt(w.after,y)}p=0,g=f.lineHeight,Nt(this.afterBody,y),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let s,a;if(o){const l=gl(r.rtl,this.x,this.width);for(t.x=uh(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=bn(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,a=0;a<o;++a)n.fillText(i[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:o,yAlign:s}=this,{x:a,y:l}=t,{width:c,height:d}=r,{topLeft:f,topRight:g,bottomLeft:p,bottomRight:v}=Ys(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+f,l),s==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-g,l),n.quadraticCurveTo(a+c,l,a+c,l+g),s==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+d-v),n.quadraticCurveTo(a+c,l+d,a+c-v,l+d),s==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+p,l+d),n.quadraticCurveTo(a,l+d,a,l+d-p),s==="center"&&o==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const s=pu[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=SE(this,t),l=Object.assign({},s,this._size),c=CE(n,t,l),d=EE(t,l,c,n);(i._to!==d.x||o._to!==d.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,d))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=Rn(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,i,n),lC(t,n.textDirection),o.y+=s.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),cC(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!$f(r,i),s=this._positionChanged(i,n);(o||s)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],s=this._getActiveElements(t,o,n,r),a=this._positionChanged(s,t),l=n||!$f(s,o)||a;return l&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,s=pu[o.position].call(this,t,n);return s!==!1&&(r!==s.x||i!==s.y)}},ke(Mx,"positioners",pu),Mx);var H8={id:"tooltip",_element:ME,positioners:pu,afterInit(e,t,n){n&&(e.tooltip=new ME({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:kE},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"]},W8=Object.freeze({__proto__:null,Colors:n8,Decimation:s8,Filler:O8,Legend:A8,SubTitle:R8,Title:N8,Tooltip:H8});const q8=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function U8(e,t,n,r){const i=e.indexOf(t);if(i===-1)return q8(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const G8=(e,t)=>e===null?null:kn(Math.round(e),0,t);function DE(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class bb extends ea{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(gt(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:U8(r,t,tt(n,t),this._addedLabels),G8(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)i.push({value:s});return i}getLabelForValue(t){return DE.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}}ke(bb,"id","category"),ke(bb,"defaults",{ticks:{callback:DE}});function Y8(e,t){const n=[],{bounds:i,step:o,min:s,max:a,precision:l,count:c,maxTicks:d,maxDigits:f,includeBounds:g}=e,p=o||1,v=d-1,{min:y,max:x}=t,w=!gt(s),S=!gt(a),C=!gt(c),P=(x-y)/(f+1);let O=IS((x-y)/v/p)*p,k,A,L,F;if(O<1e-14&&!w&&!S)return[{value:y},{value:x}];F=Math.ceil(x/O)-Math.floor(y/O),F>v&&(O=IS(F*O/v/p)*p),gt(l)||(k=Math.pow(10,l),O=Math.ceil(O*k)/k),i==="ticks"?(A=Math.floor(y/O)*O,L=Math.ceil(x/O)*O):(A=y,L=x),w&&S&&o&&VL((a-s)/o,O/1e3)?(F=Math.round(Math.min((a-s)/O,d)),O=(a-s)/F,A=s,L=a):C?(A=w?s:A,L=S?a:L,F=c-1,O=(L-A)/F):(F=(L-A)/O,Qc(F,Math.round(F),O/1e3)?F=Math.round(F):F=Math.ceil(F));const z=Math.max(RS(O),RS(A));k=Math.pow(10,gt(l)?z:l),A=Math.round(A*k)/k,L=Math.round(L*k)/k;let B=0;for(w&&(g&&A!==s?(n.push({value:s}),A<s&&B++,Qc(Math.round((A+B*O)*k)/k,s,TE(s,P,e))&&B++):A<s&&B++);B<F;++B){const V=Math.round((A+B*O)*k)/k;if(S&&V>a)break;n.push({value:V})}return S&&g&&L!==a?n.length&&Qc(n[n.length-1].value,a,TE(a,P,e))?n[n.length-1].value=a:n.push({value:a}):(!S||L===a)&&n.push({value:L}),n}function TE(e,t,{horizontal:n,minRotation:r}){const i=mi(r),o=(n?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class dh extends ea{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 gt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const s=l=>i=n?i:l,a=l=>o=r?o:l;if(t){const l=Ii(i),c=Ii(o);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||s(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,s=Y8(i,o);return t.bounds==="ticks"&&NS(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return eu(t,this.chart.options.locale,this.options.ticks.format)}}class yb extends dh{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=cn(t)?t:0,this.max=cn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=mi(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}ke(yb,"id","linear"),ke(yb,"defaults",{ticks:{callback:Bf.formatters.numeric}});const gu=e=>Math.floor(qo(e)),ta=(e,t)=>Math.pow(10,gu(e)+t);function AE(e){return e/Math.pow(10,gu(e))===1}function IE(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function K8(e,t){const n=t-e;let r=gu(n);for(;IE(e,t,r)>10;)r++;for(;IE(e,t,r)<10;)r--;return Math.min(r,gu(e))}function X8(e,{min:t,max:n}){t=Or(e.min,t);const r=[],i=gu(t);let o=K8(t,n),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=i>o?Math.pow(10,i):0,c=Math.round((t-l)*s)/s,d=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-d)/Math.pow(10,o)),g=Or(e.min,Math.round((l+d+f*Math.pow(10,o))*s)/s);for(;g<n;)r.push({value:g,major:AE(g),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,s=o>=0?1:s),g=Math.round((l+d+f*Math.pow(10,o))*s)/s;const p=Or(e.max,g);return r.push({value:p,major:AE(p),significand:f}),r}class xb extends ea{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=dh.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return cn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=cn(t)?Math.max(0,t):null,this.max=cn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!cn(this._userMin)&&(this.min=t===ta(this.min,0)?ta(this.min,-1):ta(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const o=a=>r=t?r:a,s=a=>i=n?i:a;r===i&&(r<=0?(o(1),s(10)):(o(ta(r,-1)),s(ta(i,1)))),r<=0&&o(ta(i,-1)),i<=0&&s(ta(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=X8(n,this);return t.bounds==="ticks"&&NS(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":eu(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=qo(t),this._valueRange=qo(this.max)-qo(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(qo(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}ke(xb,"id","logarithmic"),ke(xb,"defaults",{ticks:{callback:Bf.formatters.logarithmic,major:{enabled:!0}}});function wb(e){const t=e.ticks;if(t.display&&e.display){const n=Rn(t.backdropPadding);return tt(t.font&&t.font.size,on.font.size)+n.height}return 0}function Q8(e,t,n){return n=Yt(n)?n:[n],{w:o9(e,t.string,n),h:n.length*t.lineHeight}}function NE(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function Z8(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],o=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?Kt/o:0;for(let l=0;l<o;l++){const c=s.setContext(e.getPointLabelContext(l));i[l]=c.padding;const d=e.getPointPosition(l,e.drawingArea+i[l],a),f=bn(c.font),g=Q8(e.ctx,f,e._pointLabels[l]);r[l]=g;const p=Pr(e.getIndexAngle(l)+a),v=Math.round(jv(p)),y=NE(v,d.x,g.w,0,180),x=NE(v,d.y,g.h,90,270);J8(n,t,p,y,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=nj(e,r,i)}function J8(e,t,n,r,i){const o=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/o,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/s,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function ej(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:o,padding:s,size:a}=n,l=e.getPointPosition(t,r+i+s,o),c=Math.round(jv(Pr(l.angle+dn))),d=oj(l.y,a.h,c),f=rj(c),g=ij(l.x,a.w,f);return{visible:!0,x:l.x,y:d,textAlign:f,left:g,top:d,right:g+a.w,bottom:d+a.h}}function tj(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:o}=e;return!(lo({x:n,y:r},t)||lo({x:n,y:o},t)||lo({x:i,y:r},t)||lo({x:i,y:o},t))}function nj(e,t,n){const r=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:wb(o)/2,additionalAngle:s?Kt/i:0};let c;for(let d=0;d<i;d++){l.padding=n[d],l.size=t[d];const f=ej(e,d,l);r.push(f),a==="auto"&&(f.visible=tj(f,c),f.visible&&(c=f))}return r}function rj(e){return e===0||e===180?"center":e<180?"left":"right"}function ij(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function oj(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function sj(e,t,n){const{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!gt(a)){const l=Ys(t.borderRadius),c=Rn(t.backdropPadding);e.fillStyle=a;const d=r-c.left,f=i-c.top,g=o-r+c.width,p=s-i+c.height;Object.values(l).some(v=>v!==0)?(e.beginPath(),nu(e,{x:d,y:f,w:g,h:p,radius:l}),e.fill()):e.fillRect(d,f,g,p)}}function aj(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const o=e._pointLabelItems[i];if(!o.visible)continue;const s=r.setContext(e.getPointLabelContext(i));sj(n,s,o);const a=bn(s.font),{x:l,y:c,textAlign:d}=o;Gs(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:s.color,textAlign:d,textBaseline:"middle"})}}function RE(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,Xt);else{let o=e.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let s=1;s<r;s++)o=e.getPointPosition(s,t),i.lineTo(o.x,o.y)}}function lj(e,t,n,r,i){const o=e.ctx,s=t.circular,{color:a,lineWidth:l}=t;!s&&!r||!a||!l||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(i.dash),o.lineDashOffset=i.dashOffset,o.beginPath(),RE(e,n,s,r),o.closePath(),o.stroke(),o.restore())}function cj(e,t,n){return Uo(e,{label:n,index:t,type:"pointLabel"})}class mu extends dh{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=Rn(wb(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=cn(t)&&!isNaN(t)?t:0,this.max=cn(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/wb(this.options))}generateTickLabels(t){dh.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=jt(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?Z8(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=Xt/(this._pointLabels.length||1),r=this.options.startAngle||0;return Pr(t*n+mi(r))}getDistanceFromCenterForValue(t){if(gt(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(gt(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 cj(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-dn+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:o}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),RE(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:o}=n,s=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&aj(this,s),i.display&&this.ticks.forEach((d,f)=>{if(f!==0){l=this.getDistanceFromCenterForValue(d.value);const g=this.getContext(f),p=i.setContext(g),v=o.setContext(g);lj(this,p,l,s,v)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const d=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:g}=d;!g||!f||(t.lineWidth=g,t.strokeStyle=f,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let o,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),d=bn(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=d.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=Rn(c.backdropPadding);t.fillRect(-s/2-f.left,-o-d.size/2-f.top,s+f.width,d.size+f.height)}Gs(t,a.label,0,-o,d,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}ke(mu,"id","radialLinear"),ke(mu,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Bf.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),ke(mu,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),ke(mu,"descriptors",{angleLines:{_fallback:"grid"}});const fh={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}},cr=Object.keys(fh);function LE(e,t){return e-t}function $E(e,t){if(gt(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),cn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(i&&(s=i==="week"&&(fl(o)||o===!0)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function FE(e,t,n,r){const i=cr.length;for(let o=cr.indexOf(e);o<i-1;++o){const s=fh[cr[o]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return cr[o]}return cr[i-1]}function uj(e,t,n,r,i){for(let o=cr.length-1;o>=cr.indexOf(n);o--){const s=cr[o];if(fh[s].common&&e._adapter.diff(i,r,s)>=t-1)return s}return cr[n?cr.indexOf(n):0]}function dj(e){for(let t=cr.indexOf(e)+1,n=cr.length;t<n;++t)if(fh[cr[t]].common)return cr[t]}function jE(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Bv(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function fj(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=o;a<=s;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function zE(e,t,n){const r=[],i={},o=t.length;let s,a;for(s=0;s<o;++s)a=t[s],i[a]=s,r.push({value:a,major:!1});return o===0||!n?r:fj(e,r,i,n)}class vu extends ea{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new w$._date(t.adapters.date);i.init(n),Kc(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:$E(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:o,minDefined:s,maxDefined:a}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=cn(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=cn(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,s=this.max,a=UL(i,o,s);return this._unit=n.unit||(r.autoSkip?FE(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):uj(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:dj(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),zE(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=kn(n,0,s),r=kn(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,s=o.unit||FE(o.minUnit,n,r,this._getLabelCapacity(n)),a=tt(i.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,c=fl(l)||l===!0,d={};let f=n,g,p;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,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 v=i.ticks.source==="data"&&this.getDataTimestamps();for(g=f,p=0;g<r;g=+t.add(g,a,s),p++)jE(d,g,v);return(g===r||i.bounds==="ticks"||p===1)&&jE(d,g,v),Object.keys(d).sort(LE).map(y=>+y)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,s=n||i[o];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,i){const o=this.options,s=o.ticks.callback;if(s)return jt(s,[t,n,r],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&a[l],f=c&&a[c],g=r[n],p=c&&f&&g&&g.major;return this._adapter.format(t,i||(p?f:d))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=mi(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),s=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*s,h:r*s+a*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,zE(this,[t],this._majorUnit),i),s=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push($E(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return jS(t.sort(LE))}}ke(vu,"id","time"),ke(vu,"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 hh(e,t,n){let r=0,i=e.length-1,o,s,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=ao(e,"pos",t)),{pos:o,time:a}=e[r],{pos:s,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=ao(e,"time",t)),{time:o,pos:a}=e[r],{time:s,pos:l}=e[i]);const c=s-o;return c?a+(l-a)*(t-o)/c:a}class _b extends vu{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=hh(n,this.min),this._tableRange=hh(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let s,a,l,c,d;for(s=0,a=t.length;s<a;++s)c=t[s],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=i.length;s<a;++s)d=i[s+1],l=i[s-1],c=i[s],Math.round((d+l)/2)!==c&&o.push({time:c,pos:s/(a-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(hh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return hh(this._table,r*this._tableRange+this._minPos,!0)}}ke(_b,"id","timeseries"),ke(_b,"defaults",vu.defaults);var hj=Object.freeze({__proto__:null,CategoryScale:bb,LinearScale:yb,LogarithmicScale:xb,RadialLinearScale:mu,TimeScale:vu,TimeSeriesScale:_b});const pj=[x$,XF,W8,hj];/*!
|
|
124
|
+
* chartjs-plugin-datalabels v2.2.0
|
|
125
|
+
* https://chartjs-plugin-datalabels.netlify.app
|
|
126
|
+
* (c) 2017-2022 chartjs-plugin-datalabels contributors
|
|
127
|
+
* Released under the MIT license
|
|
128
|
+
*/var BE=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}(),bu={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
|
|
129
|
+
`)):Array.isArray(n)?e.push.apply(e,n):gt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),i=r.length,o=e.font,s=0,a;for(e.font=n.string,a=0;a<i;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=o,{height:i*n.lineHeight,width:s}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),r=[],i,o,s,a;for(i=0,s=t.length;i<s;++i)a=t[i],o=n.indexOf(a),o===-1?r.push([a,1]):n.splice(o,1);for(i=0,s=n.length;i<s;++i)r.push([n[i],-1]);return r},rasterize:function(e){return Math.round(e*BE)/BE}};function Sb(e,t){var n=t.x,r=t.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var i=e.x-n,o=e.y-r,s=Math.sqrt(i*i+o*o);return{x:s?i/s:0,y:s?o/s:-1}}function gj(e,t,n,r,i){switch(i){case"center":n=r=0;break;case"bottom":n=0,r=1;break;case"right":n=1,r=0;break;case"left":n=-1,r=0;break;case"top":n=0,r=-1;break;case"start":n=-n,r=-r;break;case"end":break;default:i*=Math.PI/180,n=Math.cos(i),r=Math.sin(i);break}return{x:e,y:t,vx:n,vy:r}}var mj=0,VE=1,HE=2,WE=4,qE=8;function ph(e,t,n){var r=mj;return e<n.left?r|=VE:e>n.right&&(r|=HE),t<n.top?r|=qE:t>n.bottom&&(r|=WE),r}function vj(e,t){for(var n=e.x0,r=e.y0,i=e.x1,o=e.y1,s=ph(n,r,t),a=ph(i,o,t),l,c,d;!(!(s|a)||s&a);)l=s||a,l&qE?(c=n+(i-n)*(t.top-r)/(o-r),d=t.top):l&WE?(c=n+(i-n)*(t.bottom-r)/(o-r),d=t.bottom):l&HE?(d=r+(o-r)*(t.right-n)/(i-n),c=t.right):l&VE&&(d=r+(o-r)*(t.left-n)/(i-n),c=t.left),l===s?(n=c,r=d,s=ph(n,r,t)):(i=c,o=d,a=ph(i,o,t));return{x0:n,x1:i,y0:r,y1:o}}function gh(e,t){var n=t.anchor,r=e,i,o;return t.clamp&&(r=vj(r,t.area)),n==="start"?(i=r.x0,o=r.y0):n==="end"?(i=r.x1,o=r.y1):(i=(r.x0+r.x1)/2,o=(r.y0+r.y1)/2),gj(i,o,e.vx,e.vy,t.align)}var mh={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),i=Math.sin(n),o=e.innerRadius,s=e.outerRadius;return gh({x0:e.x+r*o,y0:e.y+i*o,x1:e.x+r*s,y1:e.y+i*s,vx:r,vy:i},t)},point:function(e,t){var n=Sb(e,t.origin),r=n.x*e.options.radius,i=n.y*e.options.radius;return gh({x0:e.x-r,y0:e.y-i,x1:e.x+r,y1:e.y+i,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=Sb(e,t.origin),r=e.x,i=e.y,o=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),o=Math.abs(e.base-e.x)):(i=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),gh({x0:r,y0:i+s,x1:r+o,y1:i,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=Sb(e,t.origin);return gh({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)}},ho=bu.rasterize;function bj(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,i=e.size.width,o=-i/2,s=-r/2;return{frame:{x:o-n.left-t,y:s-n.top-t,w:i+n.width+t*2,h:r+n.height+t*2},text:{x:o,y:s,w:i,h:r}}}function yj(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 xj(e){return e instanceof vl?mh.arc:e instanceof fu?mh.point:e instanceof hu?mh.bar:mh.fallback}function wj(e,t,n,r,i,o){var s=Math.PI/2;if(o){var a=Math.min(o,i/2,r/2),l=t+a,c=n+a,d=t+r-a,f=n+i-a;e.moveTo(t,c),l<d&&c<f?(e.arc(l,c,a,-Math.PI,-s),e.arc(d,c,a,-s,0),e.arc(d,f,a,0,s),e.arc(l,f,a,s,Math.PI)):l<d?(e.moveTo(l,n),e.arc(d,c,a,-s,s),e.arc(l,c,a,s,Math.PI+s)):c<f?(e.arc(l,c,a,-Math.PI,0),e.arc(l,f,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,i)}function _j(e,t,n){var r=n.backgroundColor,i=n.borderColor,o=n.borderWidth;!r&&(!i||!o)||(e.beginPath(),wj(e,ho(t.x)+o/2,ho(t.y)+o/2,ho(t.w)-o,ho(t.h)-o,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),i&&o&&(e.strokeStyle=i,e.lineWidth=o,e.lineJoin="miter",e.stroke()))}function Sj(e,t,n){var r=n.lineHeight,i=e.w,o=e.x,s=e.y+r/2;return t==="center"?o+=i/2:(t==="end"||t==="right")&&(o+=i),{h:r,w:i,x:o,y:s}}function Cj(e,t,n){var r=e.shadowBlur,i=n.stroked,o=ho(n.x),s=ho(n.y),a=ho(n.w);i&&e.strokeText(t,o,s,a),n.filled&&(r&&i&&(e.shadowBlur=0),e.fillText(t,o,s,a),r&&i&&(e.shadowBlur=r))}function Ej(e,t,n,r){var i=r.textAlign,o=r.color,s=!!o,a=r.font,l=t.length,c=r.textStrokeColor,d=r.textStrokeWidth,f=c&&d,g;if(!(!l||!s&&!f))for(n=Sj(n,i,a),e.font=a.string,e.textAlign=i,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=o),f&&(e.lineJoin="round",e.lineWidth=d,e.strokeStyle=c),g=0,l=t.length;g<l;++g)Cj(e,t[g],{stroked:f,filled:s,w:n.w,x:n.x,y:n.y+n.h*g})}var UE=function(e,t,n,r){var i=this;i._config=e,i._index=r,i._model=null,i._rects=null,i._ctx=t,i._el=n};Ai(UE.prototype,{_modelize:function(e,t,n,r){var i=this,o=i._index,s=bn(Qt([n.font,{}],r,o)),a=Qt([n.color,on.color],r,o);return{align:Qt([n.align,"center"],r,o),anchor:Qt([n.anchor,"center"],r,o),area:r.chart.chartArea,backgroundColor:Qt([n.backgroundColor,null],r,o),borderColor:Qt([n.borderColor,null],r,o),borderRadius:Qt([n.borderRadius,0],r,o),borderWidth:Qt([n.borderWidth,0],r,o),clamp:Qt([n.clamp,!1],r,o),clip:Qt([n.clip,!1],r,o),color:a,display:e,font:s,lines:t,offset:Qt([n.offset,4],r,o),opacity:Qt([n.opacity,1],r,o),origin:yj(i._el,r),padding:Rn(Qt([n.padding,4],r,o)),positioner:xj(i._el),rotation:Qt([n.rotation,0],r,o)*(Math.PI/180),size:bu.textSize(i._ctx,t,s),textAlign:Qt([n.textAlign,"start"],r,o),textShadowBlur:Qt([n.textShadowBlur,0],r,o),textShadowColor:Qt([n.textShadowColor,a],r,o),textStrokeColor:Qt([n.textStrokeColor,a],r,o),textStrokeWidth:Qt([n.textStrokeWidth,0],r,o)}},update:function(e){var t=this,n=null,r=null,i=t._index,o=t._config,s,a,l,c=Qt([o.display,!0],e,i);c&&(s=e.dataset.data[i],a=tt(jt(o.formatter,[s,e]),s),l=gt(a)?[]:bu.toTextLines(a),l.length&&(n=t._modelize(c,l,o,e),r=bj(n))),t._model=n,t._rects=r},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,r=e.ctx,i=n._model,o=n._rects,s;this.visible()&&(r.save(),i.clip&&(s=i.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=bu.bound(0,i.opacity,1),r.translate(ho(t.x),ho(t.y)),r.rotate(i.rotation),_j(r,o.frame,i),Ej(r,i.lines,o.text,i),r.restore())}});var Oj=Number.MIN_SAFE_INTEGER||-9007199254740991,Pj=Number.MAX_SAFE_INTEGER||9007199254740991;function yu(e,t,n){var r=Math.cos(n),i=Math.sin(n),o=t.x,s=t.y;return{x:o+r*(e.x-o)-i*(e.y-s),y:s+i*(e.x-o)+r*(e.y-s)}}function GE(e,t){var n=Pj,r=Oj,i=t.origin,o,s,a,l,c;for(o=0;o<e.length;++o)s=e[o],a=s.x-i.x,l=s.y-i.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function vh(e,t){var n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/i,vy:(t.y-e.y)/i,origin:e,ln:i}}var YE=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};Ai(YE.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=yu(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=[vh(t[0],t[1]),vh(t[0],t[3])],i,o,s;for(this._rotation!==e._rotation&&r.push(vh(n[0],n[1]),vh(n[0],n[3])),i=0;i<r.length;++i)if(o=GE(t,r[i]),s=GE(n,r[i]),o.max<s.min||s.max<o.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[yu({x:t.x,y:t.y},r,n),yu({x:t.x+t.w,y:t.y},r,n),yu({x:t.x+t.w,y:t.y+t.h},r,n),yu({x:t.x,y:t.y+t.h},r,n)]}});function KE(e,t,n){var r=t.positioner(e,t),i=r.vx,o=r.vy;if(!i&&!o)return{x:r.x,y:r.y};var s=n.w,a=n.h,l=t.rotation,c=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),d=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),f=1/Math.max(Math.abs(i),Math.abs(o));return c*=i*f,d*=o*f,c+=t.offset*i,d+=t.offset*o,{x:r.x+c,y:r.y+d}}function kj(e,t){var n,r,i,o;for(n=e.length-1;n>=0;--n)for(i=e[n].$layout,r=n-1;r>=0&&i._visible;--r)o=e[r].$layout,o._visible&&i._box.intersects(o._box)&&t(i,o);return e}function Mj(e){var t,n,r,i,o,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],i=r.$layout,i._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),o=r.geometry(),s=KE(a,r.model(),o),i._box.update(s,o,r.rotation()));return kj(e,function(l,c){var d=l._hidable,f=c._hidable;d&&f||f?c._visible=!1:d&&(l._visible=!1)})}var xu={prepare:function(e){var t=[],n,r,i,o,s;for(n=0,i=e.length;n<i;++n)for(r=0,o=e[n].length;r<o;++r)s=e[n][r],t.push(s),s.$layout={_box:new YE,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,d=l.$layout;return c._idx===d._idx?d._set-c._set:d._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,i,o,s;for(n=0,r=e.length;n<r;++n)i=e[n],o=i.model(),s=i.$layout,s._hidable=o&&o.display==="auto",s._visible=i.visible(),t|=s._hidable;t&&Mj(e)},lookup:function(e,t){var n,r;for(n=e.length-1;n>=0;--n)if(r=e[n].$layout,r&&r._visible&&r._box.contains(t))return e[n];return null},draw:function(e,t){var n,r,i,o,s,a;for(n=0,r=t.length;n<r;++n)i=t[n],o=i.$layout,o._visible&&(s=i.geometry(),a=KE(i._el,i.model(),s),o._box.update(a,s,i.rotation()),i.draw(e,a))}},Dj=function(e){if(gt(e))return null;var t=e,n,r,i;if(wt(e))if(!gt(e.label))t=e.label;else if(!gt(e.r))t=e.r;else for(t="",n=Object.keys(e),i=0,r=n.length;i<r;++i)t+=(i!==0?", ":"")+n[i]+": "+e[n[i]];return""+t},Tj={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:Dj,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},ur="$datalabels",XE="$default";function Aj(e,t){var n=e.datalabels,r={},i=[],o,s;return n===!1?null:(n===!0&&(n={}),t=Ai({},[t,n]),o=t.labels||{},s=Object.keys(o),delete t.labels,s.length?s.forEach(function(a){o[a]&&i.push(Ai({},[t,o[a],{_key:a}]))}):i.push(t),r=i.reduce(function(a,l){return Nt(l.listeners||{},function(c,d){a[d]=a[d]||{},a[d][l._key||XE]=c}),delete l.listeners,a},{}),{labels:i,listeners:r})}function Cb(e,t,n,r){if(t){var i=n.$context,o=n.$groups,s;t[o._set]&&(s=t[o._set][o._key],s&&jt(s,[i,r])===!0&&(e[ur]._dirty=!0,n.update(i)))}}function Ij(e,t,n,r,i){var o,s;!n&&!r||(n?r?n!==r&&(s=o=!0):s=!0:o=!0,s&&Cb(e,t.leave,n,i),o&&Cb(e,t.enter,r,i))}function Nj(e,t){var n=e[ur],r=n._listeners,i,o;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")o=xu.lookup(n._labels,t);else if(t.type!=="mouseout")return;i=n._hovered,n._hovered=o,Ij(e,r,i,o,t)}}function Rj(e,t){var n=e[ur],r=n._listeners.click,i=r&&xu.lookup(n._labels,t);i&&Cb(e,r,i,t)}var Lj={id:"datalabels",defaults:Tj,beforeInit:function(e){e[ur]={_actives:[]}},beforeUpdate:function(e){var t=e[ur];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,i=e[ur],o=i._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=Aj(a,n),c=t.meta.data||[],d=e.ctx,f,g,p,v,y,x,w,S;for(d.save(),f=0,p=c.length;f<p;++f)if(w=c[f],w[ur]=[],s&&w&&e.getDataVisibility(f)&&!w.skip)for(g=0,v=l.labels.length;g<v;++g)y=l.labels[g],x=y._key,S=new UE(y,d,w,f),S.$groups={_set:r,_key:x||XE},S.$context={active:!1,chart:e,dataIndex:f,dataset:a,datasetIndex:r},S.update(S.$context),w[ur].push(S),o.push(S);d.restore(),Ai(i._listeners,l.listeners,{merger:function(C,P,O){P[C]=P[C]||{},P[C][t.index]=O[C],i._listened=!0}})},afterUpdate:function(e){e[ur]._labels=xu.prepare(e[ur]._datasets)},afterDatasetsDraw:function(e){xu.draw(e,e[ur]._labels)},beforeEvent:function(e,t){if(e[ur]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":Nj(e,n);break;case"click":Rj(e,n);break}}},afterEvent:function(e){var t=e[ur],n=t._actives,r=t._actives=e.getActiveElements(),i=bu.arrayDiff(n,r),o,s,a,l,c,d,f;for(o=0,s=i.length;o<s;++o)if(c=i[o],c[1])for(f=c[0].element[ur]||[],a=0,l=f.length;a<l;++a)d=f[a],d.$context.active=c[1]===1,d.update(d.$context);(t._dirty||i.length)&&(xu.update(t._labels),e.render()),delete t._dirty}};Qr.register(...pj),Qr.register(Lj);function QE({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,i]=m.useState(),o=be(l=>l.themeStyle);m.useEffect(()=>{var d,f,g,p;(f=(d=o==null?void 0:o.chart)==null?void 0:d.font)!=null&&f.family&&(Qr.defaults.font={...Qr.defaults.font,...(g=o==null?void 0:o.chart)==null?void 0:g.font}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const l=(p=n==null?void 0:n.current)==null?void 0:p.getContext("2d");if(!l)return;let c;try{c=new Qr(l,e),i(c)}catch(v){console.log("error creating chart",v)}return()=>{c&&c.destroy()}},[(a=o==null?void 0:o.chart)==null?void 0:a.font]);function s(l){var d,f;if(!r)return;const c=r==null?void 0:r.getElementsAtEventForMode(l,"nearest",{intersect:!0},!0);if(c&&c.length>0){const g=c[0].datasetIndex,p=c[0].index,v=(f=(d=c[0].element)==null?void 0:d.$context)==null?void 0:f.raw;t==null||t(r,g,p,v)}}return _.jsx("div",{onClick:s,className:" relative h-[99%] xbg-red-100",children:_.jsx("canvas",{ref:n})})}function Li(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var $j=["color"],ZE=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,$j);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.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"}))}),Fj=["color"],jj=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,Fj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),zj=["color"],JE=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,zj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H7V13H3.5C3.22386 13 3 12.7761 3 12.5V2.5C3 2.22386 3.22386 2 3.5 2H4V2.25C4 2.66421 4.33579 3 4.75 3H10.25C10.6642 3 11 2.66421 11 2.25V2H11.5C11.7761 2 12 2.22386 12 2.5V7H13V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM9 8.5C9 8.77614 8.77614 9 8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5ZM10.5 9C10.7761 9 11 8.77614 11 8.5C11 8.22386 10.7761 8 10.5 8C10.2239 8 10 8.22386 10 8.5C10 8.77614 10.2239 9 10.5 9ZM13 8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5ZM14.5 9C14.7761 9 15 8.77614 15 8.5C15 8.22386 14.7761 8 14.5 8C14.2239 8 14 8.22386 14 8.5C14 8.77614 14.2239 9 14.5 9ZM15 10.5C15 10.7761 14.7761 11 14.5 11C14.2239 11 14 10.7761 14 10.5C14 10.2239 14.2239 10 14.5 10C14.7761 10 15 10.2239 15 10.5ZM14.5 13C14.7761 13 15 12.7761 15 12.5C15 12.2239 14.7761 12 14.5 12C14.2239 12 14 12.2239 14 12.5C14 12.7761 14.2239 13 14.5 13ZM14.5 15C14.7761 15 15 14.7761 15 14.5C15 14.2239 14.7761 14 14.5 14C14.2239 14 14 14.2239 14 14.5C14 14.7761 14.2239 15 14.5 15ZM8.5 11C8.77614 11 9 10.7761 9 10.5C9 10.2239 8.77614 10 8.5 10C8.22386 10 8 10.2239 8 10.5C8 10.7761 8.22386 11 8.5 11ZM9 12.5C9 12.7761 8.77614 13 8.5 13C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12C8.77614 12 9 12.2239 9 12.5ZM8.5 15C8.77614 15 9 14.7761 9 14.5C9 14.2239 8.77614 14 8.5 14C8.22386 14 8 14.2239 8 14.5C8 14.7761 8.22386 15 8.5 15ZM11 14.5C11 14.7761 10.7761 15 10.5 15C10.2239 15 10 14.7761 10 14.5C10 14.2239 10.2239 14 10.5 14C10.7761 14 11 14.2239 11 14.5ZM12.5 15C12.7761 15 13 14.7761 13 14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5C12 14.7761 12.2239 15 12.5 15Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Bj=["color"],na=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,Bj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.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"}))}),Vj=["color"],Hj=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,Vj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Wj=["color"],qj=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,Wj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.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"}))}),Uj=["color"],Gj=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,Uj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.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"}))}),Yj=["color"],e2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,Yj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Kj=["color"],Xj=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,Kj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Qj=["color"],Zj=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=Li(e,Qj);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),m.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});let bh;const Jj=new Uint8Array(16);function ez(){if(!bh&&(bh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!bh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return bh(Jj)}const Ln=[];for(let e=0;e<256;++e)Ln.push((e+256).toString(16).slice(1));function tz(e,t=0){return Ln[e[t+0]]+Ln[e[t+1]]+Ln[e[t+2]]+Ln[e[t+3]]+"-"+Ln[e[t+4]]+Ln[e[t+5]]+"-"+Ln[e[t+6]]+Ln[e[t+7]]+"-"+Ln[e[t+8]]+Ln[e[t+9]]+"-"+Ln[e[t+10]]+Ln[e[t+11]]+Ln[e[t+12]]+Ln[e[t+13]]+Ln[e[t+14]]+Ln[e[t+15]]}const t2={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function yh(e,t,n){if(t2.randomUUID&&!t&&!e)return t2.randomUUID();e=e||{};const r=e.random||(e.rng||ez)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return tz(r)}const _e=pw()(Ow((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:yh(),title:"Editor Card",description:"Desdcription",type:"bar",data:[]},actions:{setCardPreferences:n=>{e(r=>{r.card.preferences=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})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{r.card.type=n})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(i=>{i.sqlGen.measures=[...i.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setCardData:n=>{e(r=>{r.card.data=n})},setSelectedConnectionId:n=>{var r,i;e(o=>{o.selectedConnectionId=n,o.card.connectionId=n}),(i=(r=t()).onConnectionChange)==null||i.call(r,n)},setSelectedDatabaseName:n=>{var r,i;e(o=>{o.selectedDatabaseName=n,o.card.lastSelectedDatabase=n}),(i=(r=t()).onDatabaseChange)==null||i.call(r,n)},setSelectedSchemaName:n=>{var r,i;e(o=>{o.selectedSchemaName=n,o.card.lastSelectedSchema=n}),(i=(r=t()).onSchemaChange)==null||i.call(r,n)},setSelectedTableName:n=>{var r,i;e(o=>{o.selectedTableName=n,o.card.lastSelectedTable=n}),(i=(r=t()).onTableChange)==null||i.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}})));process.env.NODE_ENV==="development"&&kw("EditorStore",_e);function nz({card:e}){const t=be(y=>y.isDashboardEditing),n=be(y=>y.filterValues),r=be(y=>y.isVisualEditing),i=be(y=>y.selectedSheetId),o=be(y=>y.actions.removeCard),s=be(y=>y.actions.setIsVisualEditing),a=_e(y=>y.actions.setFilterValues),l=_e(y=>y.actions.setApplyFilters),c=_e(y=>y.actions.setCard),d=_e(y=>y.actions.setSelectedConnectionId),f=_e(y=>y.actions.setSelectedDatabaseName),g=_e(y=>y.actions.setSelectedSchemaName),p=_e(y=>y.actions.setSelectedTableName);function v(){s(!r),c(e),e!=null&&e.connectionId&&d(e==null?void 0:e.connectionId),e!=null&&e.lastSelectedDatabase&&f(e==null?void 0:e.lastSelectedDatabase),e!=null&&e.lastSelectedSchema&&g(e==null?void 0:e.lastSelectedSchema),e!=null&&e.lastSelectedTable&&p(e==null?void 0:e.lastSelectedTable),n&&(a(n),l(!0))}return _.jsx("section",{className:"absolute right-2 top-2",children:t&&_.jsxs("div",{className:"flex items-center gap-2",children:[r?_.jsx(qj,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}):_.jsx(Gj,{role:"edit-visual",onClick:v,className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}),_.jsx(na,{onClick:()=>o(i,e),className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"})]})})}function rz(e,t){var s,a,l,c;const n=be.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,i=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map((d,f)=>({label:d.charAt(0).toUpperCase()+d.slice(1),data:t.map(g=>g[d]),backgroundColor:r==null?void 0:r[f%r.length],borderColor:i==null?void 0:i[f%i.length]}))}function iz(e){var a,l,c,d;const{metricKeys:t,dimensionKeys:n}=ra(e);let r=[];const i=be.getState().themeStyle,o=(l=(a=i==null?void 0:i.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(d=(c=i==null?void 0:i.chart)==null?void 0:c.dataset)==null?void 0:d.borderColor;if((n==null?void 0:n.length)===1){const f=e.map(g=>({x:g[t[0]],y:g[t[1]],r:g[t[2]],label:g[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:f}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(g=>g[n==null?void 0:n[1]]))].map((g,p)=>{const v=e.filter(y=>y[n==null?void 0:n[1]]===g);return{label:g,data:v.map(y=>({x:y[t[0]],y:y[t[1]],r:y[t[2]],label:y[n==null?void 0:n[0]]})),backgroundColor:o==null?void 0:o[p%o.length],borderColor:s==null?void 0:s[p%s.length]}})),r}function oz(e,t){var s,a,l,c;const n=be.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,i=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(d=>({label:d.charAt(0).toUpperCase()+d.slice(1),data:t.map(f=>f[d]),backgroundColor:t.map((f,g)=>r==null?void 0:r[g%r.length]),borderColor:t.map((f,g)=>i==null?void 0:i[g%i.length])}))}function ra(e){const t=Object.keys(e[0]),n=t.filter(i=>{var o,s,a,l;return!!(typeof e[0][i]&&typeof e[0][i]=="string"||typeof((o=e==null?void 0:e[1])==null?void 0:o[i])&&typeof((s=e==null?void 0:e[1])==null?void 0:s[i])=="string"||typeof((a=e==null?void 0:e[2])==null?void 0:a[i])&&typeof((l=e==null?void 0:e[2])==null?void 0:l[i])=="string")});n.length===0&&n.push(t[0]);const r=t.filter(i=>e[0][i]===+e[0][i]);return{dimensionKeys:n,metricKeys:r}}function Eb(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((o,s)=>({...o,...n[s],data:o.data,label:o.label})):e}function n2({dataArray:e,groupKey:t,pivotKey:n,valueKey:r}){const i=e.reduce((o,s)=>{const a=s[t],l=s[n],c=s[r];return o[a]||(o[a]={[t]:a}),o[a][l]=c,o},{});return Object.values(i)}function Ob(e,t){var s;const n=be.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,i=Rs.cloneDeep(r);return Rs.merge(i,e,t)}function r2(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}function ia({data:e,cfg:t,customCfg:n}){const{dimensionKeys:r,metricKeys:i}=ra(e),o=rz(i,e),s=Eb(o,n),a=r[0],l=r2(e,a),c=Ob((t==null?void 0:t.options)||{},(n==null?void 0:n.options)||{});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:l,datasets:s},options:c}}function sz(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}}}}}function az(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function lz(e){var n,r,i,o;return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{...(r=(n=e==null?void 0:e.options)==null?void 0:n.scales)==null?void 0:r.x,display:!0,stacked:!0},y:{...(o=(i=e==null?void 0:e.options)==null?void 0:i.scales)==null?void 0:o.y,display:!0,stacked:!0}}}}}function cz(e){return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function i2(e,t){return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}}}}}function uz(e){return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}}}}}function Pb({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:i="chartjs",userSettings:o}){if(t==="bar"){const s=az(n);return ia({data:e,cfg:s,customCfg:r,cardType:t,userSettings:o,provider:i})}if(t==="horizontalBar"){const s=sz(n);return ia({data:e,cfg:s,customCfg:r,cardType:t,userSettings:o,provider:i})}if(t==="stackedBar"){const s=lz(n),{dimensionKeys:a,metricKeys:l}=ra(e),c=n2({dataArray:e,groupKey:a[0],pivotKey:a[1],valueKey:l[0]});return ia({data:c,cfg:s,customCfg:r,cardType:t,userSettings:o,provider:i})}if(t==="line"){const s=cz(n);return ia({data:e,cfg:s,customCfg:r,cardType:t,userSettings:o,provider:i})}if(t==="pie"||t==="doughnut"){const s=i2(t,n),{dimensionKeys:a,metricKeys:l}=ra(e),c=oz(l,e),d=Eb(c,r),f=a[0],g=r2(e,f),p=Ob((s==null?void 0:s.options)||{},(r==null?void 0:r.options)||{});return{type:t,data:{labels:g,datasets:d},options:p}}if(t==="radar"){const s=uz(n);return ia({data:e,cfg:s,customCfg:r,cardType:t,userSettings:o,provider:i})}if(t==="bubble"||t==="scatter"){const{metricKeys:s}=ra(e);if(s.length<3){console.log("Bubble charts require 3 numeric columns");return}const a=iz(e),l=Eb(a,r),c={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:s[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:s[1]},beginAtZero:!0,ticks:{precision:0}}}},d=Ob(c,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:l},options:d}}if(t==="polarArea"){const s=i2(t,n);return ia({data:e,cfg:s,customCfg:r,cardType:t,userSettings:o,provider:i})}return ia({data:e,cfg:n,customCfg:r,cardType:t,userSettings:o,provider:i})}var bl=1e3,yl=bl*60,xl=yl*60,oa=xl*24,dz=oa*7,fz=oa*365.25,hz=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return pz(e);if(n==="number"&&isFinite(e))return t.long?mz(e):gz(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function pz(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*fz;case"weeks":case"week":case"w":return n*dz;case"days":case"day":case"d":return n*oa;case"hours":case"hour":case"hrs":case"hr":case"h":return n*xl;case"minutes":case"minute":case"mins":case"min":case"m":return n*yl;case"seconds":case"second":case"secs":case"sec":case"s":return n*bl;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function gz(e){var t=Math.abs(e);return t>=oa?Math.round(e/oa)+"d":t>=xl?Math.round(e/xl)+"h":t>=yl?Math.round(e/yl)+"m":t>=bl?Math.round(e/bl)+"s":e+"ms"}function mz(e){var t=Math.abs(e);return t>=oa?xh(e,t,oa,"day"):t>=xl?xh(e,t,xl,"hour"):t>=yl?xh(e,t,yl,"minute"):t>=bl?xh(e,t,bl,"second"):e+" ms"}function xh(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+" "+r+(i?"s":"")}const vz=Pc(hz);function bz(e){const t=be(l=>l.bookmarkKey),n=be(l=>l.authToken),r=be(l=>l.filterValues),i=be(l=>l.isDashboardEditing),o=vz((e==null?void 0:e.refreshInterval)||"0"),s=Sr({queryKey:[e.id,e.sql],queryFn:()=>Ts("https://semaphor.cloud/api/v1/data",(n==null?void 0:n.accessToken)||"",{visual_id:e.id,active_filters:r}),refetchInterval:o,enabled:!!o&&!i}),a=Sr({queryKey:[e.id,e.sql],queryFn:()=>Ts("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:r}),refetchInterval:o,enabled:!!o&&i});return i||t!==""?a:s}function yz(e,t=globalThis==null?void 0:globalThis.document){const n=xn(e);m.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const kb="dismissableLayer.update",xz="dismissableLayer.pointerDownOutside",wz="dismissableLayer.focusOutside";let o2;const _z=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),wl=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,d=m.useContext(_z),[f,g]=m.useState(null),p=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=m.useState({}),y=et(t,L=>g(L)),x=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=x.indexOf(w),C=f?x.indexOf(f):-1,P=d.layersWithOutsidePointerEventsDisabled.size>0,O=C>=S,k=Sz(L=>{const F=L.target,z=[...d.branches].some(B=>B.contains(F));!O||z||(o==null||o(L),a==null||a(L),L.defaultPrevented||l==null||l())},p),A=Cz(L=>{const F=L.target;[...d.branches].some(B=>B.contains(F))||(s==null||s(L),a==null||a(L),L.defaultPrevented||l==null||l())},p);return yz(L=>{C===d.layers.size-1&&(i==null||i(L),!L.defaultPrevented&&l&&(L.preventDefault(),l()))},p),m.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(o2=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),s2(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=o2)}},[f,p,r,d]),m.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),s2())},[f,d]),m.useEffect(()=>{const L=()=>v({});return document.addEventListener(kb,L),()=>document.removeEventListener(kb,L)},[]),m.createElement(Be.div,le({},c,{ref:y,style:{pointerEvents:P?O?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,k.onPointerDownCapture)}))});function Sz(e,t=globalThis==null?void 0:globalThis.document){const n=xn(e),r=m.useRef(!1),i=m.useRef(()=>{});return m.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let c=function(){a2(xz,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Cz(e,t=globalThis==null?void 0:globalThis.document){const n=xn(e),r=m.useRef(!1);return m.useEffect(()=>{const i=o=>{o.target&&!r.current&&a2(wz,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function s2(){const e=new CustomEvent(kb);document.dispatchEvent(e)}function a2(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Qw(i,o):i.dispatchEvent(o)}const Ez=["top","right","bottom","left"],Ko=Math.min,kr=Math.max,wh=Math.round,_h=Math.floor,Xo=e=>({x:e,y:e}),Oz={left:"right",right:"left",bottom:"top",top:"bottom"},Pz={start:"end",end:"start"};function Mb(e,t,n){return kr(e,Ko(t,n))}function po(e,t){return typeof e=="function"?e(t):e}function go(e){return e.split("-")[0]}function _l(e){return e.split("-")[1]}function Db(e){return e==="x"?"y":"x"}function Tb(e){return e==="y"?"height":"width"}function Sl(e){return["top","bottom"].includes(go(e))?"y":"x"}function Ab(e){return Db(Sl(e))}function kz(e,t,n){n===void 0&&(n=!1);const r=_l(e),i=Ab(e),o=Tb(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Sh(s)),[s,Sh(s)]}function Mz(e){const t=Sh(e);return[Ib(e),t,Ib(t)]}function Ib(e){return e.replace(/start|end/g,t=>Pz[t])}function Dz(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function Tz(e,t,n,r){const i=_l(e);let o=Dz(go(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(Ib)))),o}function Sh(e){return e.replace(/left|right|bottom|top/g,t=>Oz[t])}function Az(e){return{top:0,right:0,bottom:0,left:0,...e}}function l2(e){return typeof e!="number"?Az(e):{top:e,right:e,bottom:e,left:e}}function Ch(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function c2(e,t,n){let{reference:r,floating:i}=e;const o=Sl(t),s=Ab(t),a=Tb(s),l=go(t),c=o==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,g=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-i.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(_l(t)){case"start":p[s]-=g*(n&&c?-1:1);break;case"end":p[s]+=g*(n&&c?-1:1);break}return p}const Iz=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:f}=c2(c,r,l),g=r,p={},v=0;for(let y=0;y<a.length;y++){const{name:x,fn:w}=a[y],{x:S,y:C,data:P,reset:O}=await w({x:d,y:f,initialPlacement:r,placement:g,strategy:i,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});if(d=S??d,f=C??f,p={...p,[x]:{...p[x],...P}},O&&v<=50){v++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(c=O.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:d,y:f}=c2(c,g,l)),y=-1;continue}}return{x:d,y:f,placement:g,strategy:i,middlewareData:p}};async function wu(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=po(t,e),v=l2(p),x=a[g?f==="floating"?"reference":"floating":f],w=Ch(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),S=f==="floating"?{...s.floating,x:r,y:i}:s.reference,C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),P=await(o.isElement==null?void 0:o.isElement(C))?await(o.getScale==null?void 0:o.getScale(C))||{x:1,y:1}:{x:1,y:1},O=Ch(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:S,offsetParent:C,strategy:l}):S);return{top:(w.top-O.top+v.top)/P.y,bottom:(O.bottom-w.bottom+v.bottom)/P.y,left:(w.left-O.left+v.left)/P.x,right:(O.right-w.right+v.right)/P.x}}const u2=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=po(e,t)||{};if(c==null)return{};const f=l2(d),g={x:n,y:r},p=Ab(i),v=Tb(p),y=await s.getDimensions(c),x=p==="y",w=x?"top":"left",S=x?"bottom":"right",C=x?"clientHeight":"clientWidth",P=o.reference[v]+o.reference[p]-g[p]-o.floating[v],O=g[p]-o.reference[p],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=k?k[C]:0;(!A||!await(s.isElement==null?void 0:s.isElement(k)))&&(A=a.floating[C]||o.floating[v]);const L=P/2-O/2,F=A/2-y[v]/2-1,z=Ko(f[w],F),B=Ko(f[S],F),V=z,X=A-y[v]-B,K=A/2-y[v]/2+L,$=Mb(V,K,X),J=!l.arrow&&_l(i)!=null&&K!=$&&o.reference[v]/2-(K<V?z:B)-y[v]/2<0,G=J?K<V?K-V:K-X:0;return{[p]:g[p]+G,data:{[p]:$,centerOffset:K-$-G,...J&&{alignmentOffset:G}},reset:J}}}),Nz=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:y=!0,...x}=po(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=go(i),S=go(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),P=g||(S||!y?[Sh(a)]:Mz(a));!g&&v!=="none"&&P.push(...Tz(a,y,v,C));const O=[a,...P],k=await wu(t,x),A=[];let L=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&A.push(k[w]),f){const V=kz(i,s,C);A.push(k[V[0]],k[V[1]])}if(L=[...L,{placement:i,overflows:A}],!A.every(V=>V<=0)){var F,z;const V=(((F=o.flip)==null?void 0:F.index)||0)+1,X=O[V];if(X)return{data:{index:V,overflows:L},reset:{placement:X}};let K=(z=L.filter($=>$.overflows[0]<=0).sort(($,J)=>$.overflows[1]-J.overflows[1])[0])==null?void 0:z.placement;if(!K)switch(p){case"bestFit":{var B;const $=(B=L.map(J=>[J.placement,J.overflows.filter(G=>G>0).reduce((G,q)=>G+q,0)]).sort((J,G)=>J[1]-G[1])[0])==null?void 0:B[0];$&&(K=$);break}case"initialPlacement":K=a;break}if(i!==K)return{reset:{placement:K}}}return{}}}};function d2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function f2(e){return Ez.some(t=>e[t]>=0)}const Rz=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=po(e,t);switch(r){case"referenceHidden":{const o=await wu(t,{...i,elementContext:"reference"}),s=d2(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:f2(s)}}}case"escaped":{const o=await wu(t,{...i,altBoundary:!0}),s=d2(o,n.floating);return{data:{escapedOffsets:s,escaped:f2(s)}}}default:return{}}}}};async function Lz(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=go(n),a=_l(n),l=Sl(n)==="y",c=["left","top"].includes(s)?-1:1,d=o&&l?-1:1,f=po(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),l?{x:p*d,y:g*c}:{x:g*c,y:p*d}}const $z=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await Lz(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},Fz=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:w,y:S}=x;return{x:w,y:S}}},...l}=po(e,t),c={x:n,y:r},d=await wu(t,l),f=Sl(go(i)),g=Db(f);let p=c[g],v=c[f];if(o){const x=g==="y"?"top":"left",w=g==="y"?"bottom":"right",S=p+d[x],C=p-d[w];p=Mb(S,p,C)}if(s){const x=f==="y"?"top":"left",w=f==="y"?"bottom":"right",S=v+d[x],C=v-d[w];v=Mb(S,v,C)}const y=a.fn({...t,[g]:p,[f]:v});return{...y,data:{x:y.x-n,y:y.y-r}}}}},jz=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=po(e,t),d={x:n,y:r},f=Sl(i),g=Db(f);let p=d[g],v=d[f];const y=po(a,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const C=g==="y"?"height":"width",P=o.reference[g]-o.floating[C]+x.mainAxis,O=o.reference[g]+o.reference[C]-x.mainAxis;p<P?p=P:p>O&&(p=O)}if(c){var w,S;const C=g==="y"?"width":"height",P=["top","left"].includes(go(i)),O=o.reference[f]-o.floating[C]+(P&&((w=s.offset)==null?void 0:w[f])||0)+(P?0:x.crossAxis),k=o.reference[f]+o.reference[C]+(P?0:((S=s.offset)==null?void 0:S[f])||0)-(P?x.crossAxis:0);v<O?v=O:v>k&&(v=k)}return{[g]:p,[f]:v}}}},zz=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:s=()=>{},...a}=po(e,t),l=await wu(t,a),c=go(n),d=_l(n),f=Sl(n)==="y",{width:g,height:p}=r.floating;let v,y;c==="top"||c==="bottom"?(v=c,y=d===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(y=c,v=d==="end"?"top":"bottom");const x=p-l[v],w=g-l[y],S=!t.middlewareData.shift;let C=x,P=w;if(f){const k=g-l.left-l.right;P=d||S?Ko(w,k):k}else{const k=p-l.top-l.bottom;C=d||S?Ko(x,k):k}if(S&&!d){const k=kr(l.left,0),A=kr(l.right,0),L=kr(l.top,0),F=kr(l.bottom,0);f?P=g-2*(k!==0||A!==0?k+A:kr(l.left,l.right)):C=p-2*(L!==0||F!==0?L+F:kr(l.top,l.bottom))}await s({...t,availableWidth:P,availableHeight:C});const O=await i.getDimensions(o.floating);return g!==O.width||p!==O.height?{reset:{rects:!0}}:{}}}};function Qo(e){return h2(e)?(e.nodeName||"").toLowerCase():"#document"}function Mr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mo(e){var t;return(t=(h2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function h2(e){return e instanceof Node||e instanceof Mr(e).Node}function vo(e){return e instanceof Element||e instanceof Mr(e).Element}function $i(e){return e instanceof HTMLElement||e instanceof Mr(e).HTMLElement}function p2(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Mr(e).ShadowRoot}function _u(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Zr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Bz(e){return["table","td","th"].includes(Qo(e))}function Nb(e){const t=Rb(),n=Zr(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Vz(e){let t=Cl(e);for(;$i(t)&&!Eh(t);){if(Nb(t))return t;t=Cl(t)}return null}function Rb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Eh(e){return["html","body","#document"].includes(Qo(e))}function Zr(e){return Mr(e).getComputedStyle(e)}function Oh(e){return vo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Cl(e){if(Qo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||p2(e)&&e.host||mo(e);return p2(t)?t.host:t}function g2(e){const t=Cl(e);return Eh(t)?e.ownerDocument?e.ownerDocument.body:e.body:$i(t)&&_u(t)?t:g2(t)}function Su(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=g2(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Mr(i);return o?t.concat(s,s.visualViewport||[],_u(i)?i:[],s.frameElement&&n?Su(s.frameElement):[]):t.concat(i,Su(i,[],n))}function m2(e){const t=Zr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=$i(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=wh(n)!==o||wh(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Lb(e){return vo(e)?e:e.contextElement}function El(e){const t=Lb(e);if(!$i(t))return Xo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=m2(t);let s=(o?wh(n.width):n.width)/r,a=(o?wh(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Hz=Xo(0);function v2(e){const t=Mr(e);return!Rb()||!t.visualViewport?Hz:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wz(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Mr(e)?!1:t}function sa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Lb(e);let s=Xo(1);t&&(r?vo(r)&&(s=El(r)):s=El(e));const a=Wz(o,n,r)?v2(o):Xo(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,d=i.width/s.x,f=i.height/s.y;if(o){const g=Mr(o),p=r&&vo(r)?Mr(r):r;let v=g.frameElement;for(;v&&r&&p!==g;){const y=El(v),x=v.getBoundingClientRect(),w=Zr(v),S=x.left+(v.clientLeft+parseFloat(w.paddingLeft))*y.x,C=x.top+(v.clientTop+parseFloat(w.paddingTop))*y.y;l*=y.x,c*=y.y,d*=y.x,f*=y.y,l+=S,c+=C,v=Mr(v).frameElement}}return Ch({width:d,height:f,x:l,y:c})}function qz(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=$i(n),o=mo(n);if(n===o)return t;let s={scrollLeft:0,scrollTop:0},a=Xo(1);const l=Xo(0);if((i||!i&&r!=="fixed")&&((Qo(n)!=="body"||_u(o))&&(s=Oh(n)),$i(n))){const c=sa(n);a=El(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}}function Uz(e){return Array.from(e.getClientRects())}function b2(e){return sa(mo(e)).left+Oh(e).scrollLeft}function Gz(e){const t=mo(e),n=Oh(e),r=e.ownerDocument.body,i=kr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=kr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+b2(e);const a=-n.scrollTop;return Zr(r).direction==="rtl"&&(s+=kr(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function Yz(e,t){const n=Mr(e),r=mo(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=Rb();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function Kz(e,t){const n=sa(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=$i(e)?El(e):Xo(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function y2(e,t,n){let r;if(t==="viewport")r=Yz(e,n);else if(t==="document")r=Gz(mo(e));else if(vo(t))r=Kz(t,n);else{const i=v2(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Ch(r)}function x2(e,t){const n=Cl(e);return n===t||!vo(n)||Eh(n)?!1:Zr(n).position==="fixed"||x2(n,t)}function Xz(e,t){const n=t.get(e);if(n)return n;let r=Su(e,[],!1).filter(a=>vo(a)&&Qo(a)!=="body"),i=null;const o=Zr(e).position==="fixed";let s=o?Cl(e):e;for(;vo(s)&&!Eh(s);){const a=Zr(s),l=Nb(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||_u(s)&&!l&&x2(e,s))?r=r.filter(d=>d!==s):i=a,s=Cl(s)}return t.set(e,r),r}function Qz(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?Xz(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,d)=>{const f=y2(t,d,i);return c.top=kr(f.top,c.top),c.right=Ko(f.right,c.right),c.bottom=Ko(f.bottom,c.bottom),c.left=kr(f.left,c.left),c},y2(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Zz(e){return m2(e)}function Jz(e,t,n){const r=$i(t),i=mo(t),o=n==="fixed",s=sa(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=Xo(0);if(r||!r&&!o)if((Qo(t)!=="body"||_u(i))&&(a=Oh(t)),r){const c=sa(t,!0,o,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else i&&(l.x=b2(i));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function w2(e,t){return!$i(e)||Zr(e).position==="fixed"?null:t?t(e):e.offsetParent}function _2(e,t){const n=Mr(e);if(!$i(e))return n;let r=w2(e,t);for(;r&&Bz(r)&&Zr(r).position==="static";)r=w2(r,t);return r&&(Qo(r)==="html"||Qo(r)==="body"&&Zr(r).position==="static"&&!Nb(r))?n:r||Vz(e)||n}const eB=async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||_2,o=this.getDimensions;return{reference:Jz(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}};function tB(e){return Zr(e).direction==="rtl"}const nB={convertOffsetParentRelativeRectToViewportRelativeRect:qz,getDocumentElement:mo,getClippingRect:Qz,getOffsetParent:_2,getElementRects:eB,getClientRects:Uz,getDimensions:Zz,getScale:El,isElement:vo,isRTL:tB};function rB(e,t){let n=null,r;const i=mo(e);function o(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:d,width:f,height:g}=e.getBoundingClientRect();if(a||t(),!f||!g)return;const p=_h(d),v=_h(i.clientWidth-(c+f)),y=_h(i.clientHeight-(d+g)),x=_h(c),S={rootMargin:-p+"px "+-v+"px "+-y+"px "+-x+"px",threshold:kr(0,Ko(1,l))||1};let C=!0;function P(O){const k=O[0].intersectionRatio;if(k!==l){if(!C)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},100)}C=!1}try{n=new IntersectionObserver(P,{...S,root:i.ownerDocument})}catch{n=new IntersectionObserver(P,S)}n.observe(e)}return s(!0),o}function iB(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Lb(e),d=i||o?[...c?Su(c):[],...Su(t)]:[];d.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const f=c&&a?rB(c,n):null;let g=-1,p=null;s&&(p=new ResizeObserver(w=>{let[S]=w;S&&S.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let v,y=l?sa(e):null;l&&x();function x(){const w=sa(e);y&&(w.x!==y.x||w.y!==y.y||w.width!==y.width||w.height!==y.height)&&n(),y=w,v=requestAnimationFrame(x)}return n(),()=>{d.forEach(w=>{i&&w.removeEventListener("scroll",n),o&&w.removeEventListener("resize",n)}),f&&f(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(v)}}const oB=(e,t,n)=>{const r=new Map,i={platform:nB,...n},o={...i.platform,_c:r};return Iz(e,t,{...i,platform:o})},sB=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?u2({element:r.current,padding:i}).fn(n):{}:r?u2({element:r,padding:i}).fn(n):{}}}};var Ph=typeof document<"u"?m.useLayoutEffect:m.useEffect;function kh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!kh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!kh(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function S2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function C2(e,t){const n=S2(e);return Math.round(t*n)/n}function E2(e){const t=ue.useRef(e);return Ph(()=>{t.current=e}),t}function aB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,f]=ue.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=ue.useState(r);kh(g,r)||p(r);const[v,y]=ue.useState(null),[x,w]=ue.useState(null),S=ue.useCallback(J=>{J!=k.current&&(k.current=J,y(J))},[y]),C=ue.useCallback(J=>{J!==A.current&&(A.current=J,w(J))},[w]),P=o||v,O=s||x,k=ue.useRef(null),A=ue.useRef(null),L=ue.useRef(d),F=E2(l),z=E2(i),B=ue.useCallback(()=>{if(!k.current||!A.current)return;const J={placement:t,strategy:n,middleware:g};z.current&&(J.platform=z.current),oB(k.current,A.current,J).then(G=>{const q={...G,isPositioned:!0};V.current&&!kh(L.current,q)&&(L.current=q,r3.flushSync(()=>{f(q)}))})},[g,t,n,z]);Ph(()=>{c===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(J=>({...J,isPositioned:!1})))},[c]);const V=ue.useRef(!1);Ph(()=>(V.current=!0,()=>{V.current=!1}),[]),Ph(()=>{if(P&&(k.current=P),O&&(A.current=O),P&&O){if(F.current)return F.current(P,O,B);B()}},[P,O,B,F]);const X=ue.useMemo(()=>({reference:k,floating:A,setReference:S,setFloating:C}),[S,C]),K=ue.useMemo(()=>({reference:P,floating:O}),[P,O]),$=ue.useMemo(()=>{const J={position:n,left:0,top:0};if(!K.floating)return J;const G=C2(K.floating,d.x),q=C2(K.floating,d.y);return a?{...J,transform:"translate("+G+"px, "+q+"px)",...S2(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:q}},[n,a,K.floating,d.x,d.y]);return ue.useMemo(()=>({...d,update:B,refs:X,elements:K,floatingStyles:$}),[d,B,X,K,$])}function Mh(e){const[t,n]=m.useState(void 0);return Vn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const O2="Popper",[P2,Fi]=Pn(O2),[lB,k2]=P2(O2),cB=e=>{const{__scopePopper:t,children:n}=e,[r,i]=m.useState(null);return m.createElement(lB,{scope:t,anchor:r,onAnchorChange:i},n)},uB="PopperAnchor",dB=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=k2(uB,n),s=m.useRef(null),a=et(t,s);return m.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.createElement(Be.div,le({},i,{ref:a}))}),M2="PopperContent",[fB,Rde]=P2(M2),hB=m.forwardRef((e,t)=>{var n,r,i,o,s,a,l,c;const{__scopePopper:d,side:f="bottom",sideOffset:g=0,align:p="center",alignOffset:v=0,arrowPadding:y=0,avoidCollisions:x=!0,collisionBoundary:w=[],collisionPadding:S=0,sticky:C="partial",hideWhenDetached:P=!1,updatePositionStrategy:O="optimized",onPlaced:k,...A}=e,L=k2(M2,d),[F,z]=m.useState(null),B=et(t,He=>z(He)),[V,X]=m.useState(null),K=Mh(V),$=(n=K==null?void 0:K.width)!==null&&n!==void 0?n:0,J=(r=K==null?void 0:K.height)!==null&&r!==void 0?r:0,G=f+(p!=="center"?"-"+p:""),q=typeof S=="number"?S:{top:0,right:0,bottom:0,left:0,...S},se=Array.isArray(w)?w:[w],D=se.length>0,W={padding:q,boundary:se.filter(pB),altBoundary:D},{refs:re,floatingStyles:N,placement:ne,isPositioned:ge,middlewareData:he}=aB({strategy:"fixed",placement:G,whileElementsMounted:(...He)=>iB(...He,{animationFrame:O==="always"}),elements:{reference:L.anchor},middleware:[$z({mainAxis:g+J,alignmentAxis:v}),x&&Fz({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?jz():void 0,...W}),x&&Nz({...W}),zz({...W,apply:({elements:He,rects:Ke,availableWidth:St,availableHeight:vt})=>{const{width:bt,height:tn}=Ke.reference,Jt=He.floating.style;Jt.setProperty("--radix-popper-available-width",`${St}px`),Jt.setProperty("--radix-popper-available-height",`${vt}px`),Jt.setProperty("--radix-popper-anchor-width",`${bt}px`),Jt.setProperty("--radix-popper-anchor-height",`${tn}px`)}}),V&&sB({element:V,padding:y}),gB({arrowWidth:$,arrowHeight:J}),P&&Rz({strategy:"referenceHidden",...W})]}),[de,ie]=D2(ne),ee=xn(k);Vn(()=>{ge&&(ee==null||ee())},[ge,ee]);const H=(i=he.arrow)===null||i===void 0?void 0:i.x,ye=(o=he.arrow)===null||o===void 0?void 0:o.y,oe=((s=he.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Te,Fe]=m.useState();return Vn(()=>{F&&Fe(window.getComputedStyle(F).zIndex)},[F]),m.createElement("div",{ref:re.setFloating,"data-radix-popper-content-wrapper":"",style:{...N,transform:ge?N.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Te,"--radix-popper-transform-origin":[(a=he.transformOrigin)===null||a===void 0?void 0:a.x,(l=he.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(fB,{scope:d,placedSide:de,onArrowChange:X,arrowX:H,arrowY:ye,shouldHideArrow:oe},m.createElement(Be.div,le({"data-side":de,"data-align":ie},A,{ref:B,style:{...A.style,animation:ge?void 0:"none",opacity:(c=he.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function pB(e){return e!==null}const gB=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,s;const{placement:a,rects:l,middlewareData:c}=t,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,g=f?0:e.arrowWidth,p=f?0:e.arrowHeight,[v,y]=D2(a),x={start:"0%",center:"50%",end:"100%"}[y],w=((r=(i=c.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+g/2,S=((o=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&o!==void 0?o:0)+p/2;let C="",P="";return v==="bottom"?(C=f?x:`${w}px`,P=`${-p}px`):v==="top"?(C=f?x:`${w}px`,P=`${l.floating.height+p}px`):v==="right"?(C=`${-p}px`,P=f?x:`${S}px`):v==="left"&&(C=`${l.floating.width+p}px`,P=f?x:`${S}px`),{data:{x:C,y:P}}}});function D2(e){const[t,n="center"]=e.split("-");return[t,n]}const Cu=cB,Eu=dB,Ou=hB,Dh=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=e;return r?kt.createPortal(m.createElement(Be.div,le({},i,{ref:t})),r):null}),T2=m.forwardRef((e,t)=>m.createElement(Be.span,le({},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}}))),mB=T2,[Th,Lde]=Pn("Tooltip",[Fi]),$b=Fi(),vB="TooltipProvider",bB=700,Fb="tooltip.open",[yB,jb]=Th(vB),xB=e=>{const{__scopeTooltip:t,delayDuration:n=bB,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[s,a]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),m.createElement(yB,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(d=>{l.current=d},[]),disableHoverableContent:i},o)},zb="Tooltip",[wB,Ah]=Th(zb),_B=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:a}=e,l=jb(zb,e.__scopeTooltip),c=$b(t),[d,f]=m.useState(null),g=or(),p=m.useRef(0),v=s??l.disableHoverableContent,y=a??l.delayDuration,x=m.useRef(!1),[w=!1,S]=Qn({prop:r,defaultProp:i,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(Fb))):l.onClose(),o==null||o(A)}}),C=m.useMemo(()=>w?x.current?"delayed-open":"instant-open":"closed",[w]),P=m.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,S(!0)},[S]),O=m.useCallback(()=>{window.clearTimeout(p.current),S(!1)},[S]),k=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,S(!0)},y)},[y,S]);return m.useEffect(()=>()=>window.clearTimeout(p.current),[]),m.createElement(Cu,c,m.createElement(wB,{scope:t,contentId:g,open:w,stateAttribute:C,trigger:d,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?k():P()},[l.isOpenDelayed,k,P]),onTriggerLeave:m.useCallback(()=>{v?O():window.clearTimeout(p.current)},[O,v]),onOpen:P,onClose:O,disableHoverableContent:v},n))},A2="TooltipTrigger",I2=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Ah(A2,n),o=jb(A2,n),s=$b(n),a=m.useRef(null),l=et(t,a,i.onTriggerChange),c=m.useRef(!1),d=m.useRef(!1),f=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.createElement(Eu,le({asChild:!0},s),m.createElement(Be.button,le({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:Ce(e.onPointerMove,g=>{g.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ce(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:Ce(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Ce(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Ce(e.onBlur,i.onClose),onClick:Ce(e.onClick,i.onClose)})))}),SB="TooltipPortal",[$de,CB]=Th(SB,{forceMount:void 0}),Pu="TooltipContent",EB=m.forwardRef((e,t)=>{const n=CB(Pu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,s=Ah(Pu,e.__scopeTooltip);return m.createElement(vn,{present:r||s.open},s.disableHoverableContent?m.createElement(N2,le({side:i},o,{ref:t})):m.createElement(OB,le({side:i},o,{ref:t})))}),OB=m.forwardRef((e,t)=>{const n=Ah(Pu,e.__scopeTooltip),r=jb(Pu,e.__scopeTooltip),i=m.useRef(null),o=et(t,i),[s,a]=m.useState(null),{trigger:l,onClose:c}=n,d=i.current,{onPointerInTransitChange:f}=r,g=m.useCallback(()=>{a(null),f(!1)},[f]),p=m.useCallback((v,y)=>{const x=v.currentTarget,w={x:v.clientX,y:v.clientY},S=kB(w,x.getBoundingClientRect()),C=MB(w,S),P=DB(y.getBoundingClientRect()),O=AB([...C,...P]);a(O),f(!0)},[f]);return m.useEffect(()=>()=>g(),[g]),m.useEffect(()=>{if(l&&d){const v=x=>p(x,d),y=x=>p(x,l);return l.addEventListener("pointerleave",v),d.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",y)}}},[l,d,p,g]),m.useEffect(()=>{if(s){const v=y=>{const x=y.target,w={x:y.clientX,y:y.clientY},S=(l==null?void 0:l.contains(x))||(d==null?void 0:d.contains(x)),C=!TB(w,s);S?g():C&&(g(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,s,c,g]),m.createElement(N2,le({},e,{ref:o}))}),[PB,Fde]=Th(zb,{isInside:!1}),N2=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...a}=e,l=Ah(Pu,n),c=$b(n),{onClose:d}=l;return m.useEffect(()=>(document.addEventListener(Fb,d),()=>document.removeEventListener(Fb,d)),[d]),m.useEffect(()=>{if(l.trigger){const f=g=>{const p=g.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),m.createElement(wl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:d},m.createElement(Ou,le({"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)"}}),m.createElement(Xw,null,r),m.createElement(PB,{scope:n,isInside:!0},m.createElement(mB,{id:l.contentId,role:"tooltip"},i||r))))});function kB(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function MB(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 DB(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function TB(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,d=t[s].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(i=!i)}return i}function AB(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),IB(t)}function IB(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const NB=xB,RB=_B,LB=I2,R2=EB,$B=NB,Bb=RB,L2=LB,Ih=ue.forwardRef(({className:e,sideOffset:t=4,...n},r)=>_.jsx(R2,{ref:r,sideOffset:t,className:Pe("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}));Ih.displayName=R2.displayName;const $2=ue.forwardRef(({className:e,...t},n)=>_.jsx("div",{className:"relative w-full overflow-auto",children:_.jsx("table",{ref:n,className:Pe("w-full caption-bottom text-sm",e),...t})}));$2.displayName="Table";const F2=ue.forwardRef(({className:e,...t},n)=>_.jsx("thead",{ref:n,className:Pe("[&_tr]:border-b",e),...t}));F2.displayName="TableHeader";const j2=ue.forwardRef(({className:e,...t},n)=>_.jsx("tbody",{ref:n,className:Pe("[&_tr:last-child]:border-0",e),...t}));j2.displayName="TableBody";const FB=ue.forwardRef(({className:e,...t},n)=>_.jsx("tfoot",{ref:n,className:Pe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));FB.displayName="TableFooter";const Nh=ue.forwardRef(({className:e,...t},n)=>_.jsx("tr",{ref:n,className:Pe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Nh.displayName="TableRow";const z2=ue.forwardRef(({className:e,...t},n)=>_.jsx("th",{ref:n,className:Pe("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));z2.displayName="TableHead";const Vb=ue.forwardRef(({className:e,...t},n)=>_.jsx("td",{ref:n,className:Pe("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Vb.displayName="TableCell";const jB=ue.forwardRef(({className:e,...t},n)=>_.jsx("caption",{ref:n,className:Pe("mt-4 text-sm text-muted-foreground",e),...t}));jB.displayName="TableCaption";/**
|
|
130
|
+
* @license lucide-react v0.298.0 - ISC
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the ISC license.
|
|
133
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/var zB={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"};/**
|
|
135
|
+
* @license lucide-react v0.298.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/const BB=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Rt=(e,t)=>{const n=m.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:o=2,absoluteStrokeWidth:s,className:a="",children:l,...c},d)=>m.createElement("svg",{ref:d,...zB,width:i,height:i,stroke:r,strokeWidth:s?Number(o)*24/Number(i):o,className:["lucide",`lucide-${BB(e)}`,a].join(" "),...c},[...t.map(([f,g])=>m.createElement(f,g)),...Array.isArray(l)?l:[l]]));return n.displayName=`${e}`,n};/**
|
|
140
|
+
* @license lucide-react v0.298.0 - ISC
|
|
141
|
+
*
|
|
142
|
+
* This source code is licensed under the ISC license.
|
|
143
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
+
*/const VB=Rt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
145
|
+
* @license lucide-react v0.298.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*/const HB=Rt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
150
|
+
* @license lucide-react v0.298.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*/const B2=Rt("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
155
|
+
* @license lucide-react v0.298.0 - ISC
|
|
156
|
+
*
|
|
157
|
+
* This source code is licensed under the ISC license.
|
|
158
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
+
*/const WB=Rt("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/**
|
|
160
|
+
* @license lucide-react v0.298.0 - ISC
|
|
161
|
+
*
|
|
162
|
+
* This source code is licensed under the ISC license.
|
|
163
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
+
*/const qB=Rt("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/**
|
|
165
|
+
* @license lucide-react v0.298.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/const Rh=Rt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
170
|
+
* @license lucide-react v0.298.0 - ISC
|
|
171
|
+
*
|
|
172
|
+
* This source code is licensed under the ISC license.
|
|
173
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
+
*/const Hb=Rt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
175
|
+
* @license lucide-react v0.298.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* This source code is licensed under the ISC license.
|
|
178
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
+
*/const UB=Rt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
180
|
+
* @license lucide-react v0.298.0 - ISC
|
|
181
|
+
*
|
|
182
|
+
* This source code is licensed under the ISC license.
|
|
183
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
+
*/const V2=Rt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
185
|
+
* @license lucide-react v0.298.0 - ISC
|
|
186
|
+
*
|
|
187
|
+
* This source code is licensed under the ISC license.
|
|
188
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
+
*/const GB=Rt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
190
|
+
* @license lucide-react v0.298.0 - ISC
|
|
191
|
+
*
|
|
192
|
+
* This source code is licensed under the ISC license.
|
|
193
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
+
*/const H2=Rt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
195
|
+
* @license lucide-react v0.298.0 - ISC
|
|
196
|
+
*
|
|
197
|
+
* This source code is licensed under the ISC license.
|
|
198
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
+
*/const YB=Rt("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
200
|
+
* @license lucide-react v0.298.0 - ISC
|
|
201
|
+
*
|
|
202
|
+
* This source code is licensed under the ISC license.
|
|
203
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
+
*/const KB=Rt("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
205
|
+
* @license lucide-react v0.298.0 - ISC
|
|
206
|
+
*
|
|
207
|
+
* This source code is licensed under the ISC license.
|
|
208
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
+
*/const W2=Rt("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
210
|
+
* @license lucide-react v0.298.0 - ISC
|
|
211
|
+
*
|
|
212
|
+
* This source code is licensed under the ISC license.
|
|
213
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
+
*/const XB=Rt("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"}]]);/**
|
|
215
|
+
* @license lucide-react v0.298.0 - ISC
|
|
216
|
+
*
|
|
217
|
+
* This source code is licensed under the ISC license.
|
|
218
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
+
*/const q2=Rt("LineChart",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/**
|
|
220
|
+
* @license lucide-react v0.298.0 - ISC
|
|
221
|
+
*
|
|
222
|
+
* This source code is licensed under the ISC license.
|
|
223
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
+
*/const ku=Rt("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
225
|
+
* @license lucide-react v0.298.0 - ISC
|
|
226
|
+
*
|
|
227
|
+
* This source code is licensed under the ISC license.
|
|
228
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
+
*/const QB=Rt("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
230
|
+
* @license lucide-react v0.298.0 - ISC
|
|
231
|
+
*
|
|
232
|
+
* This source code is licensed under the ISC license.
|
|
233
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
+
*/const ZB=Rt("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
235
|
+
* @license lucide-react v0.298.0 - ISC
|
|
236
|
+
*
|
|
237
|
+
* This source code is licensed under the ISC license.
|
|
238
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
+
*/const U2=Rt("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/**
|
|
240
|
+
* @license lucide-react v0.298.0 - ISC
|
|
241
|
+
*
|
|
242
|
+
* This source code is licensed under the ISC license.
|
|
243
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
+
*/const JB=Rt("Plug2",[["path",{d:"M9 2v6",key:"17ngun"}],["path",{d:"M15 2v6",key:"s7yy2p"}],["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M5 8h14",key:"pcz4l3"}],["path",{d:"M6 11V8h12v3a6 6 0 1 1-12 0v0Z",key:"nd4hoy"}]]);/**
|
|
245
|
+
* @license lucide-react v0.298.0 - ISC
|
|
246
|
+
*
|
|
247
|
+
* This source code is licensed under the ISC license.
|
|
248
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
+
*/const eV=Rt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
250
|
+
* @license lucide-react v0.298.0 - ISC
|
|
251
|
+
*
|
|
252
|
+
* This source code is licensed under the ISC license.
|
|
253
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
+
*/const tV=Rt("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
|
|
255
|
+
* @license lucide-react v0.298.0 - ISC
|
|
256
|
+
*
|
|
257
|
+
* This source code is licensed under the ISC license.
|
|
258
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
+
*/const G2=Rt("ScatterChart",[["circle",{cx:"7.5",cy:"7.5",r:".5",key:"1x97lo"}],["circle",{cx:"18.5",cy:"5.5",r:".5",key:"56iowl"}],["circle",{cx:"11.5",cy:"11.5",r:".5",key:"m9xkw9"}],["circle",{cx:"7.5",cy:"16.5",r:".5",key:"14ln9z"}],["circle",{cx:"17.5",cy:"14.5",r:".5",key:"14qxqt"}],["path",{d:"M3 3v18h18",key:"1s2lah"}]]);/**
|
|
260
|
+
* @license lucide-react v0.298.0 - ISC
|
|
261
|
+
*
|
|
262
|
+
* This source code is licensed under the ISC license.
|
|
263
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
+
*/const nV=Rt("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
|
|
265
|
+
* @license lucide-react v0.298.0 - ISC
|
|
266
|
+
*
|
|
267
|
+
* This source code is licensed under the ISC license.
|
|
268
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
+
*/const rV=Rt("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
270
|
+
* @license lucide-react v0.298.0 - ISC
|
|
271
|
+
*
|
|
272
|
+
* This source code is licensed under the ISC license.
|
|
273
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
+
*/const iV=Rt("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"}]]);/**
|
|
275
|
+
* @license lucide-react v0.298.0 - ISC
|
|
276
|
+
*
|
|
277
|
+
* This source code is licensed under the ISC license.
|
|
278
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
+
*/const Wb=Rt("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
|
|
280
|
+
* @license lucide-react v0.298.0 - ISC
|
|
281
|
+
*
|
|
282
|
+
* This source code is licensed under the ISC license.
|
|
283
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
+
*/const oV=Rt("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
285
|
+
* @license lucide-react v0.298.0 - ISC
|
|
286
|
+
*
|
|
287
|
+
* This source code is licensed under the ISC license.
|
|
288
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
+
*/const sV=Rt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
290
|
+
* table-core
|
|
291
|
+
*
|
|
292
|
+
* Copyright (c) TanStack
|
|
293
|
+
*
|
|
294
|
+
* This source code is licensed under the MIT license found in the
|
|
295
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
296
|
+
*
|
|
297
|
+
* @license MIT
|
|
298
|
+
*/function Zo(e,t){return typeof e=="function"?e(t):e}function Dr(e,t){return n=>{t.setState(r=>({...r,[e]:Zo(n,r[e])}))}}function Lh(e){return e instanceof Function}function aV(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function lV(e,t){const n=[],r=i=>{i.forEach(o=>{n.push(o);const s=t(o);s!=null&&s.length&&r(s)})};return r(e),n}function Qe(e,t,n){let r=[],i;return()=>{let o;n.key&&n.debug&&(o=Date.now());const s=e();if(!(s.length!==r.length||s.some((c,d)=>r[d]!==c)))return i;r=s;let l;if(n.key&&n.debug&&(l=Date.now()),i=t(...s),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-o)*100)/100,d=Math.round((Date.now()-l)*100)/100,f=d/16,g=(p,v)=>{for(p=String(p);p.length<v;)p=" "+p;return p};console.info(`%c⏱ ${g(d,5)} /${g(c,5)} ms`,`
|
|
299
|
+
font-size: .6rem;
|
|
300
|
+
font-weight: bold;
|
|
301
|
+
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function cV(e,t,n,r){var i,o;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(i=(o=a.id)!=null?o:l?l.replace(".","_"):void 0)!=null?i:typeof a.header=="string"?a.header:void 0,d;if(a.accessorFn?d=a.accessorFn:l&&(l.includes(".")?d=g=>{let p=g;for(const y of l.split(".")){var v;p=(v=p)==null?void 0:v[y],process.env.NODE_ENV!=="production"&&p===void 0&&console.warn(`"${y}" in deeply nested key "${l}" returned undefined.`)}return p}:d=g=>g[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 f={id:`${String(c)}`,accessorFn:d,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Qe(()=>[!0],()=>{var g;return[f,...(g=f.columns)==null?void 0:g.flatMap(p=>p.getFlatColumns())]},{key:process.env.NODE_ENV==="production"&&"column.getFlatColumns",debug:()=>{var g;return(g=e.options.debugAll)!=null?g:e.options.debugColumns}}),getLeafColumns:Qe(()=>[e._getOrderColumnsFn()],g=>{var p;if((p=f.columns)!=null&&p.length){let v=f.columns.flatMap(y=>y.getLeafColumns());return g(v)}return[f]},{key:process.env.NODE_ENV==="production"&&"column.getLeafColumns",debug:()=>{var g;return(g=e.options.debugAll)!=null?g:e.options.debugColumns}})};for(const g of e._features)g.createColumn==null||g.createColumn(f,e);return f}function Y2(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(o),s},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(o,e)}),o}const uV={createTable:e=>{e.getHeaderGroups=Qe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,s;const a=(o=r==null?void 0:r.map(f=>n.find(g=>g.id===f)).filter(Boolean))!=null?o:[],l=(s=i==null?void 0:i.map(f=>n.find(g=>g.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(i!=null&&i.includes(f.id)));return $h(t,[...a,...c,...l],e)},{key:process.env.NODE_ENV==="development"&&"getHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterHeaderGroups=Qe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),$h(t,n,e,"center")),{key:process.env.NODE_ENV==="development"&&"getCenterHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftHeaderGroups=Qe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?i:[];return $h(t,o,e,"left")},{key:process.env.NODE_ENV==="development"&&"getLeftHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightHeaderGroups=Qe(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?i:[];return $h(t,o,e,"right")},{key:process.env.NODE_ENV==="development"&&"getRightHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getFooterGroups=Qe(()=>[e.getHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftFooterGroups=Qe(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getLeftFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterFooterGroups=Qe(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getCenterFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightFooterGroups=Qe(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getRightFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getFlatHeaders=Qe(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftFlatHeaders=Qe(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getLeftFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterFlatHeaders=Qe(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getCenterFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightFlatHeaders=Qe(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getRightFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterLeafHeaders=Qe(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getCenterLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftLeafHeaders=Qe(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getLeftLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightLeafHeaders=Qe(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getRightLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeafHeaders=Qe(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,s,a,l,c;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(d=>d.getLeafHeaders()).flat()},{key:process.env.NODE_ENV==="development"&&"getLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})}};function $h(e,t,n,r){var i,o;let s=0;const a=function(g,p){p===void 0&&(p=1),s=Math.max(s,p),g.filter(v=>v.getIsVisible()).forEach(v=>{var y;(y=v.columns)!=null&&y.length&&a(v.columns,p+1)},0)};a(e);let l=[];const c=(g,p)=>{const v={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},y=[];g.forEach(x=>{const w=[...y].reverse()[0],S=x.column.depth===v.depth;let C,P=!1;if(S&&x.column.parent?C=x.column.parent:(C=x.column,P=!0),w&&(w==null?void 0:w.column)===C)w.subHeaders.push(x);else{const O=Y2(n,C,{id:[r,p,C.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:P,placeholderId:P?`${y.filter(k=>k.column===C).length}`:void 0,depth:p,index:y.length});O.subHeaders.push(x),y.push(O)}v.headers.push(x),x.headerGroup=v}),l.push(v),p>0&&c(y,p-1)},d=t.map((g,p)=>Y2(n,g,{depth:s,index:p}));c(d,s-1),l.reverse();const f=g=>g.filter(v=>v.column.getIsVisible()).map(v=>{let y=0,x=0,w=[0];v.subHeaders&&v.subHeaders.length?(w=[],f(v.subHeaders).forEach(C=>{let{colSpan:P,rowSpan:O}=C;y+=P,w.push(O)})):y=1;const S=Math.min(...w);return x=x+S,v.colSpan=y,v.rowSpan=x,{colSpan:y,rowSpan:x}});return f((i=(o=l[0])==null?void 0:o.headers)!=null?i:[]),l}const Fh={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},qb=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),dV={getDefaultColumnDef:()=>Fh,getInitialState:e=>({columnSizing:{},columnSizingInfo:qb(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Dr("columnSizing",e),onColumnSizingInfoChange:Dr("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,i;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Fh.minSize,(r=o??e.columnDef.size)!=null?r:Fh.size),(i=e.columnDef.maxSize)!=null?i:Fh.maxSize)},e.getStart=n=>{const r=n?n==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),i=r.findIndex(o=>o.id===e.id);if(i>0){const o=r[i-1];return o.getStart(n)+o.getSize()}return 0},e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...i}=n;return i})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var o;n+=(o=i.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),i=r==null?void 0:r.getCanResize();return o=>{if(!r||!i||(o.persist==null||o.persist(),Ub(o)&&o.touches&&o.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],l=Ub(o)?Math.round(o.touches[0].clientX):o.clientX,c={},d=(w,S)=>{typeof S=="number"&&(t.setColumnSizingInfo(C=>{var P,O;const k=t.options.columnResizeDirection==="rtl"?-1:1,A=(S-((P=C==null?void 0:C.startOffset)!=null?P:0))*k,L=Math.max(A/((O=C==null?void 0:C.startSize)!=null?O:0),-.999999);return C.columnSizingStart.forEach(F=>{let[z,B]=F;c[z]=Math.round(Math.max(B+B*L,0)*100)/100}),{...C,deltaOffset:A,deltaPercentage:L}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(C=>({...C,...c})))},f=w=>d("move",w),g=w=>{d("end",w),t.setColumnSizingInfo(S=>({...S,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,v={moveHandler:w=>f(w.clientX),upHandler:w=>{p==null||p.removeEventListener("mousemove",v.moveHandler),p==null||p.removeEventListener("mouseup",v.upHandler),g(w.clientX)}},y={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),f(w.touches[0].clientX),!1),upHandler:w=>{var S;p==null||p.removeEventListener("touchmove",y.moveHandler),p==null||p.removeEventListener("touchend",y.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),g((S=w.touches[0])==null?void 0:S.clientX)}},x=fV()?{passive:!1}:!1;Ub(o)?(p==null||p.addEventListener("touchmove",y.moveHandler,x),p==null||p.addEventListener("touchend",y.upHandler,x)):(p==null||p.addEventListener("mousemove",v.moveHandler,x),p==null||p.addEventListener("mouseup",v.upHandler,x)),t.setColumnSizingInfo(w=>({...w,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?qb():(n=e.initialState.columnSizingInfo)!=null?n:qb())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0}}};let jh=null;function fV(){if(typeof jh=="boolean")return jh;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 jh=e,jh}function Ub(e){return e.type==="touchstart"}const hV={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Dr("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var i,o;e.setExpanded(r?{}:(i=(o=e.initialState)==null?void 0:o.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const s=o.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var i;const o=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(i=n)!=null?i:!o,!o&&n)return{...s,[e.id]:!0};if(o&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},K2=(e,t,n)=>{var r;const i=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(i))};K2.autoRemove=e=>bi(e);const X2=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};X2.autoRemove=e=>bi(e);const Q2=(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())};Q2.autoRemove=e=>bi(e);const Z2=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Z2.autoRemove=e=>bi(e)||!(e!=null&&e.length);const J2=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});J2.autoRemove=e=>bi(e)||!(e!=null&&e.length);const eO=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});eO.autoRemove=e=>bi(e)||!(e!=null&&e.length);const tO=(e,t,n)=>e.getValue(t)===n;tO.autoRemove=e=>bi(e);const nO=(e,t,n)=>e.getValue(t)==n;nO.autoRemove=e=>bi(e);const Gb=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};Gb.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(i)?1/0:i;if(o>s){const a=o;o=s,s=a}return[o,s]},Gb.autoRemove=e=>bi(e)||bi(e[0])&&bi(e[1]);const bo={includesString:K2,includesStringSensitive:X2,equalsString:Q2,arrIncludes:Z2,arrIncludesAll:J2,arrIncludesSome:eO,equals:tO,weakEquals:nO,inNumberRange:Gb};function bi(e){return e==null||e===""}const pV={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Dr("columnFilters",e),onGlobalFilterChange:Dr("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,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.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?bo.includesString:typeof r=="number"?bo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?bo.equals:Array.isArray(r)?bo.arrIncludes:bo.weakEquals},e.getFilterFn=()=>{var n,r;return Lh(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:bo[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,i,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const i=e.getFilterFn(),o=r==null?void 0:r.find(d=>d.id===e.id),s=Zo(n,o?o.value:void 0);if(rO(i,s,e)){var a;return(a=r==null?void 0:r.filter(d=>d.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(o){var c;return(c=r==null?void 0:r.map(d=>d.id===e.id?l:d))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})},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()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>bo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Lh(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:bo[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=i=>{var o;return(o=Zo(t,i))==null?void 0:o.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(rO(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},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()),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()}}};function rO(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Yb={sum:(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),min:(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},max:(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r<o||r===void 0&&o>=o)&&(r=o)}),r},extent:(e,t,n)=>{let r,i;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r===void 0?s>=s&&(r=i=s):(r>s&&(r=s),i<s&&(i=s)))}),[r,i]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(i=>{let o=i.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},median:(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!aV(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((o,s)=>o-s);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},gV={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:Dr("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,i,o;return(n=(r=(i=(o=e.columnDef.enableGrouping)!=null?o:!0)!=null?i:t.options.enableGrouping)!=null?r:!0)!=null?n:!!e.accessorFn},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 Yb.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Yb.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Lh(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:Yb[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function mV(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(s=>s.id===o)).filter(Boolean),...r]}const vV={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Dr("columnOrder",e)}),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=Qe(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>i=>{let o=[];if(!(t!=null&&t.length))o=i;else{const s=[...t],a=[...i];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(d=>d.id===l);c>-1&&o.push(a.splice(c,1)[0])}o=[...o,...a]}return mV(o,n,r)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},Kb=0,Xb=10,Qb=()=>({pageIndex:Kb,pageSize:Xb}),bV={getInitialState:e=>({...e,pagination:{...Qb(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Dr("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const i=o=>Zo(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=r=>{var i;e.setPagination(r?Qb():(i=e.initialState.pagination)!=null?i:Qb())},e.setPageIndex=r=>{e.setPagination(i=>{let o=Zo(r,i.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,s)),{...i,pageIndex:o}})},e.resetPageIndex=r=>{var i,o;e.setPageIndex(r?Kb:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:Kb)},e.resetPageSize=r=>{var i,o;e.setPageSize(r?Xb:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:Xb)},e.setPageSize=r=>{e.setPagination(i=>{const o=Math.max(1,Zo(r,i.pageSize)),s=i.pageSize*i.pageIndex,a=Math.floor(s/o);return{...i,pageIndex:a,pageSize:o}})},e.setPageCount=r=>e.setPagination(i=>{var o;let s=Zo(r,(o=e.options.pageCount)!=null?o:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...i,pageCount:s}}),e.getPageOptions=Qe(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,s)=>s)),i},{key:process.env.NODE_ENV==="development"&&"getPageOptions",debug:()=>{var r;return(r=e.options.debugAll)!=null?r:e.options.debugTable}}),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:r<i-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.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.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}},Zb=()=>({left:[],right:[]}),Jb=()=>({top:[],bottom:[]}),yV={getInitialState:e=>({columnPinning:Zb(),rowPinning:Jb(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Dr("columnPinning",e),onRowPinningChange:Dr("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var o,s;if(n==="right"){var a,l;return{left:((a=i==null?void 0:i.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((l=i==null?void 0:i.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var c,d;return{left:[...((c=i==null?void 0:i.left)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((d=i==null?void 0:i.right)!=null?d:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((o=i==null?void 0:i.left)!=null?o:[]).filter(f=>!(r!=null&&r.includes(f))),right:((s=i==null?void 0:i.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var i,o,s;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((o=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>i==null?void 0:i.includes(a));return o?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();return i?(n=(r=t.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.pin=(n,r,i)=>{const o=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=i?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...o]);t.setRowPinning(l=>{var c,d;if(n==="bottom"){var f,g;return{top:((f=l==null?void 0:l.top)!=null?f:[]).filter(y=>!(a!=null&&a.has(y))),bottom:[...((g=l==null?void 0:l.bottom)!=null?g:[]).filter(y=>!(a!=null&&a.has(y))),...Array.from(a)]}}if(n==="top"){var p,v;return{top:[...((p=l==null?void 0:l.top)!=null?p:[]).filter(y=>!(a!=null&&a.has(y))),...Array.from(a)],bottom:((v=l==null?void 0:l.bottom)!=null?v:[]).filter(y=>!(a!=null&&a.has(y)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(y=>!(a!=null&&a.has(y))),bottom:((d=l==null?void 0:l.bottom)!=null?d:[]).filter(y=>!(a!=null&&a.has(y)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=t.options;return typeof r=="function"?r(e):(n=r??i)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,o=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>i==null?void 0:i.includes(a));return o?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();if(!i)return-1;const o=(n=t._getPinnedRows(i))==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=o==null?void 0:o.indexOf(e.id))!=null?r:-1},e.getCenterVisibleCells=Qe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(s=>!o.includes(s.column.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getLeftVisibleCells=Qe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),{key:process.env.NODE_ENV==="development"&&"row.getLeftVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getRightVisibleCells=Qe(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),{key:process.env.NODE_ENV==="development"&&"row.getRightVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})},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?Zb():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Zb())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var i,o;return!!((i=r.left)!=null&&i.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Qe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getLeftLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.getRightLeafColumns=Qe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getRightLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.getCenterLeafColumns=Qe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(o=>!i.includes(o.id))},{key:process.env.NODE_ENV==="development"&&"getCenterLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Jb():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Jb())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var i,o;return!!((i=r.top)!=null&&i.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=t=>Qe(()=>[e.getRowModel().rows,e.getState().rowPinning[t]],(n,r)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(r??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(r??[]).map(s=>n.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:t}))},{key:process.env.NODE_ENV==="development"&&`row.get${t==="top"?"Top":"Bottom"}Rows`,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}})(),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=Qe(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const i=new Set([...n??[],...r??[]]);return t.filter(o=>!i.has(o.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterRows",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugRows}})}},xV={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Dr("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):i.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(o=>{e0(i,o.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Qe(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?t0(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="development"&&"getSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getFilteredSelectedRowModel=Qe(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?t0(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getFilteredSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getGroupedSelectedRowModel=Qe(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?t0(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getGroupedSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(i=>!n[i.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const i=e.getIsSelected();t.setRowSelection(o=>{var s;if(n=typeof n<"u"?n:!i,e.getCanSelect()&&i===n)return o;const a={...o};return e0(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return n0(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return r0(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return r0(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var i;n&&e.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},e0=(e,t,n,r,i)=>{var o;const s=i.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=s.subRows)!=null&&o.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>e0(e,a.id,n,r,i))};function t0(e,t){const n=e.getState().rowSelection,r=[],i={},o=function(s,a){return s.map(l=>{var c;const d=n0(l,n);if(d&&(r.push(l),i[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:o(l.subRows)}),d)return l}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function n0(e,t){var n;return(n=t[e.id])!=null?n:!1}function r0(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,o=!1;return e.subRows.forEach(s=>{if(!(o&&!i)&&(s.getCanSelect()&&(n0(s,t)?o=!0:i=!1),s.subRows&&s.subRows.length)){const a=r0(s,t);a==="all"?o=!0:(a==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const i0=/([0-9]+)/gm,wV=(e,t,n)=>iO(Jo(e.getValue(n)).toLowerCase(),Jo(t.getValue(n)).toLowerCase()),_V=(e,t,n)=>iO(Jo(e.getValue(n)),Jo(t.getValue(n))),SV=(e,t,n)=>o0(Jo(e.getValue(n)).toLowerCase(),Jo(t.getValue(n)).toLowerCase()),CV=(e,t,n)=>o0(Jo(e.getValue(n)),Jo(t.getValue(n))),EV=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},OV=(e,t,n)=>o0(e.getValue(n),t.getValue(n));function o0(e,t){return e===t?0:e>t?1:-1}function Jo(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function iO(e,t){const n=e.split(i0).filter(Boolean),r=t.split(i0).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),s=parseInt(i,10),a=parseInt(o,10),l=[s,a].sort();if(isNaN(l[0])){if(i>o)return 1;if(o>i)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const Mu={alphanumeric:wV,alphanumericCaseSensitive:_V,text:SV,textCaseSensitive:CV,datetime:EV,basic:OV},oO=[uV,{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Dr("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;return(n=(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=Qe(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),{key:process.env.NODE_ENV==="production"&&"row._getAllVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getVisibleCells=Qe(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],{key:process.env.NODE_ENV==="development"&&"row.getVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})},createTable:e=>{const t=(n,r)=>Qe(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),{key:n,debug:()=>{var i;return(i=e.options.debugAll)!=null?i:e.options.debugColumns}});e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,o)=>({...i,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}},vV,yV,pV,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Dr("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const o=i==null?void 0:i.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return Mu.datetime;if(typeof o=="string"&&(r=!0,o.split(i0).length>1))return Mu.alphanumeric}return r?Mu.text:Mu.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 Lh(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:Mu[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(p=>p.id===e.id),l=s==null?void 0:s.findIndex(p=>p.id===e.id);let c=[],d,f=o?n:i==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?d="toggle":d="add":s!=null&&s.length&&l!==s.length-1?d="replace":a?d="toggle":d="replace",d==="toggle"&&(o||i||(d="remove")),d==="add"){var g;c=[...s,{id:e.id,desc:f}],c.splice(0,c.length-((g=t.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else d==="toggle"?c=s.map(p=>p.id===e.id?{...p,desc:f}:p):d==="remove"?c=s.filter(p=>p.id!==e.id):c=[{id:e.id,desc:f}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,i;const o=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:s==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},gV,hV,bV,xV,dV];function PV(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:oO};const r=n._features.reduce((d,f)=>Object.assign(d,f.getDefaultOptions==null?void 0:f.getDefaultOptions(n)),{}),i=d=>n.options.mergeOptions?n.options.mergeOptions(r,d):{...r,...d};let s={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(d=>{var f;s=(f=d.getInitialState==null?void 0:d.getInitialState(s))!=null?f:s});const a=[];let l=!1;const c={_features:oO,options:{...r,...e},initialState:s,_queue:d=>{a.push(d),l||(l=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();l=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{n.setState(n.initialState)},setOptions:d=>{const f=Zo(d,n.options);n.options=i(f)},getState:()=>n.options.state,setState:d=>{n.options.onStateChange==null||n.options.onStateChange(d)},_getRowId:(d,f,g)=>{var p;return(p=n.options.getRowId==null?void 0:n.options.getRowId(d,f,g))!=null?p:`${g?[g.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(d,f)=>{let g=(f?n.getPrePaginationRowModel():n.getRowModel()).rowsById[d];if(!g&&(g=n.getCoreRowModel().rowsById[d],!g))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${d}`):new Error;return g},_getDefaultColumnDef:Qe(()=>[n.options.defaultColumn],d=>{var f;return d=(f=d)!=null?f:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,v;return(p=(v=g.renderValue())==null||v.toString==null?void 0:v.toString())!=null?p:null},...n._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...d}},{debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns},key:process.env.NODE_ENV==="development"&&"getDefaultColumnDef"}),_getColumnDefs:()=>n.options.columns,getAllColumns:Qe(()=>[n._getColumnDefs()],d=>{const f=function(g,p,v){return v===void 0&&(v=0),g.map(y=>{const x=cV(n,y,v,p),w=y;return x.columns=w.columns?f(w.columns,x,v+1):[],x})};return f(d)},{key:process.env.NODE_ENV==="development"&&"getAllColumns",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),getAllFlatColumns:Qe(()=>[n.getAllColumns()],d=>d.flatMap(f=>f.getFlatColumns()),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumns",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),_getAllFlatColumnsById:Qe(()=>[n.getAllFlatColumns()],d=>d.reduce((f,g)=>(f[g.id]=g,f),{}),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumnsById",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),getAllLeafColumns:Qe(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(d,f)=>{let g=d.flatMap(p=>p.getLeafColumns());return f(g)},{key:process.env.NODE_ENV==="development"&&"getAllLeafColumns",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),getColumn:d=>{const f=n._getAllFlatColumnsById()[d];return process.env.NODE_ENV!=="production"&&!f&&console.error(`[Table] Column with id '${d}' does not exist.`),f}};Object.assign(n,c);for(let d=0;d<n._features.length;d++){const f=n._features[d];f==null||f.createTable==null||f.createTable(n)}return n}function kV(e,t,n,r){const i=()=>{var s;return(s=o.getValue())!=null?s:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:Qe(()=>[e,n,t,o],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),{key:process.env.NODE_ENV==="development"&&"cell.getContext",debug:()=>e.options.debugAll})};return e._features.forEach(s=>{s.createCell==null||s.createCell(o,n,t,e)},{}),o}const MV=(e,t,n,r,i,o,s)=>{let a={id:t,index:r,original:n,depth:i,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:o??[],getLeafRows:()=>lV(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const d=c.getParentRow();if(!d)break;l.push(d),c=d}return l.reverse()},getAllCells:Qe(()=>[e.getAllLeafColumns()],l=>l.map(c=>kV(e,a,c,c.id)),{key:process.env.NODE_ENV==="development"&&"row.getAllCells",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}}),_getAllCellsByColumnId:Qe(()=>[a.getAllCells()],l=>l.reduce((c,d)=>(c[d.column.id]=d,c),{}),{key:process.env.NODE_ENV==="production"&&"row.getAllCellsByColumnId",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}})};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};function DV(){return e=>Qe(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,s){o===void 0&&(o=0);const a=[];for(let c=0;c<i.length;c++){const d=MV(e,e._getRowId(i[c],c,s),i[c],c,o,void 0,s==null?void 0:s.id);if(n.flatRows.push(d),n.rowsById[d.id]=d,a.push(d),e.options.getSubRows){var l;d.originalSubRows=e.options.getSubRows(i[c],c),(l=d.originalSubRows)!=null&&l.length&&(d.subRows=r(d.originalSubRows,o+1,d))}}return a};return n.rows=r(t),n},{key:process.env.NODE_ENV==="development"&&"getRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function TV(){return e=>Qe(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,i=[],o=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};o.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(d=>({...d}));return c.sort((d,f)=>{for(let p=0;p<o.length;p+=1){var g;const v=o[p],y=s[v.id],x=(g=v==null?void 0:v.desc)!=null?g:!1;let w=0;if(y.sortUndefined){const S=d.getValue(v.id),C=f.getValue(v.id),P=S===void 0,O=C===void 0;(P||O)&&(w=P&&O?0:P?y.sortUndefined:-y.sortUndefined)}if(w===0&&(w=y.sortingFn(d,f,v.id)),w!==0)return x&&(w*=-1),y.invertSorting&&(w*=-1),w}return d.index-f.index}),c.forEach(d=>{var f;i.push(d),(f=d.subRows)!=null&&f.length&&(d.subRows=a(d.subRows))}),c};return{rows:a(n.rows),flatRows:i,rowsById:n.rowsById}},{key:process.env.NODE_ENV==="development"&&"getSortedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function AV(e){const t=[],n=r=>{var i;t.push(r),(i=r.subRows)!=null&&i.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function IV(e){return t=>Qe(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:i,pageIndex:o}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=i*o,d=c+i;s=s.slice(c,d);let f;t.options.paginateExpandedRows?f={rows:s,flatRows:a,rowsById:l}:f=AV({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const g=p=>{f.flatRows.push(p),p.subRows.length&&p.subRows.forEach(g)};return f.rows.forEach(g),f},{key:process.env.NODE_ENV==="development"&&"getPaginationRowModel",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugTable}})}/**
|
|
302
|
+
* react-table
|
|
303
|
+
*
|
|
304
|
+
* Copyright (c) TanStack
|
|
305
|
+
*
|
|
306
|
+
* This source code is licensed under the MIT license found in the
|
|
307
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
308
|
+
*
|
|
309
|
+
* @license MIT
|
|
310
|
+
*/function sO(e,t){return e?NV(e)?ue.createElement(e,t):e:null}function NV(e){return RV(e)||typeof e=="function"||LV(e)}function RV(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function LV(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function $V(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=ue.useState(()=>({current:PV(t)})),[r,i]=ue.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:s=>{i(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}function s0({data:e}){var s;const[t,n]=m.useState([]),i=Object.keys(e[0]).map(a=>({accessorKey:a,header:({column:l})=>{const c=l.getIsSorted();return _.jsxs("div",{className:"flex items-center cursor-pointer ",onClick:()=>l.toggleSorting(l.getIsSorted()==="asc"),children:[a,c==="asc"?_.jsx(HB,{className:"ml-2 h-4 w-4"}):c==="desc"?_.jsx(VB,{className:"ml-2 h-4 w-4"}):null]})}})),o=$V({data:e,columns:i,getCoreRowModel:DV(),getPaginationRowModel:IV(),onSortingChange:n,getSortedRowModel:TV(),manualPagination:!0,state:{sorting:t}});return _.jsx(_.Fragment,{children:_.jsxs($2,{children:[_.jsx(F2,{children:o.getHeaderGroups().map(a=>_.jsx(Nh,{children:a.headers.map(l=>_.jsx(z2,{className:"sticky top-0",children:l.isPlaceholder?null:sO(l.column.columnDef.header,l.getContext())},l.id))},a.id))}),_.jsx(j2,{children:(s=o.getRowModel().rows)!=null&&s.length?o.getRowModel().rows.map(a=>_.jsx(Nh,{className:"whitespace-nowrap py-2","data-state":a.getIsSelected()&&"selected",children:a.getVisibleCells().map(l=>_.jsx(Vb,{children:sO(l.column.columnDef.cell,l.getContext())},l.id))},a.id)):_.jsx(Nh,{children:_.jsx(Vb,{colSpan:i.length,className:"h-24 text-center ",children:"No results."})})})]})})}function a0(e,[t,n]){return Math.min(n,Math.max(t,e))}function FV(e,t){return m.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const aO="ScrollArea",[lO,Xde]=Pn(aO),[jV,Jr]=lO(aO),cO=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...s}=e,[a,l]=m.useState(null),[c,d]=m.useState(null),[f,g]=m.useState(null),[p,v]=m.useState(null),[y,x]=m.useState(null),[w,S]=m.useState(0),[C,P]=m.useState(0),[O,k]=m.useState(!1),[A,L]=m.useState(!1),F=et(t,B=>l(B)),z=Ls(i);return m.createElement(jV,{scope:n,type:r,dir:z,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:d,content:f,onContentChange:g,scrollbarX:p,onScrollbarXChange:v,scrollbarXEnabled:O,onScrollbarXEnabledChange:k,scrollbarY:y,onScrollbarYChange:x,scrollbarYEnabled:A,onScrollbarYEnabledChange:L,onCornerWidthChange:S,onCornerHeightChange:P},m.createElement(Be.div,le({dir:z},s,{ref:F,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})))}),zV="ScrollAreaViewport",BV=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...i}=e,o=Jr(zV,n),s=m.useRef(null),a=et(t,s,o.onViewportChange);return m.createElement(m.Fragment,null,m.createElement("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}"}}),m.createElement(Be.div,le({"data-radix-scroll-area-viewport":""},i,{ref:a,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style}}),m.createElement("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),yo="ScrollAreaScrollbar",uO=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Jr(yo,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,a=e.orientation==="horizontal";return m.useEffect(()=>(a?o(!0):s(!0),()=>{a?o(!1):s(!1)}),[a,o,s]),i.type==="hover"?m.createElement(VV,le({},r,{ref:t,forceMount:n})):i.type==="scroll"?m.createElement(HV,le({},r,{ref:t,forceMount:n})):i.type==="auto"?m.createElement(dO,le({},r,{ref:t,forceMount:n})):i.type==="always"?m.createElement(l0,le({},r,{ref:t})):null}),VV=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Jr(yo,e.__scopeScrollArea),[o,s]=m.useState(!1);return m.useEffect(()=>{const a=i.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),m.createElement(vn,{present:n||o},m.createElement(dO,le({"data-state":o?"visible":"hidden"},r,{ref:t})))}),HV=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Jr(yo,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Vh(()=>l("SCROLL_END"),100),[a,l]=FV("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 m.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,i.scrollHideDelay,l]),m.useEffect(()=>{const c=i.viewport,d=o?"scrollLeft":"scrollTop";if(c){let f=c[d];const g=()=>{const p=c[d];f!==p&&(l("SCROLL"),s()),f=p};return c.addEventListener("scroll",g),()=>c.removeEventListener("scroll",g)}},[i.viewport,o,l,s]),m.createElement(vn,{present:n||a!=="hidden"},m.createElement(l0,le({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Ce(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Ce(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),dO=m.forwardRef((e,t)=>{const n=Jr(yo,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,s]=m.useState(!1),a=e.orientation==="horizontal",l=Vh(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:d)}},10);return Ol(n.viewport,l),Ol(n.content,l),m.createElement(vn,{present:r||o},m.createElement(l0,le({"data-state":o?"visible":"hidden"},i,{ref:t})))}),l0=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=Jr(yo,e.__scopeScrollArea),o=m.useRef(null),s=m.useRef(0),[a,l]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=gO(a.viewport,a.content),d={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:g=>o.current=g,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:g=>s.current=g};function f(g,p){return QV(g,s.current,a,p)}return n==="horizontal"?m.createElement(WV,le({},d,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const g=i.viewport.scrollLeft,p=mO(g,a,i.dir);o.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollLeft=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollLeft=f(g,i.dir))}})):n==="vertical"?m.createElement(qV,le({},d,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const g=i.viewport.scrollTop,p=mO(g,a);o.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:g=>{i.viewport&&(i.viewport.scrollTop=g)},onDragScroll:g=>{i.viewport&&(i.viewport.scrollTop=f(g))}})):null}),WV=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=Jr(yo,e.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),c=et(t,l,o.onScrollbarXChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(hO,le({"data-orientation":"horizontal"},i,{ref:c,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Bh(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(o.viewport){const g=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(g),bO(g,f)&&d.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:zh(s.paddingLeft),paddingEnd:zh(s.paddingRight)}})}}))}),qV=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=Jr(yo,e.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),c=et(t,l,o.onScrollbarYChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(hO,le({"data-orientation":"vertical"},i,{ref:c,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Bh(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(o.viewport){const g=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(g),bO(g,f)&&d.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:zh(s.paddingTop),paddingEnd:zh(s.paddingBottom)}})}}))}),[UV,fO]=lO(yo),hO=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:f,...g}=e,p=Jr(yo,n),[v,y]=m.useState(null),x=et(t,F=>y(F)),w=m.useRef(null),S=m.useRef(""),C=p.viewport,P=r.content-r.viewport,O=xn(d),k=xn(l),A=Vh(f,10);function L(F){if(w.current){const z=F.clientX-w.current.left,B=F.clientY-w.current.top;c({x:z,y:B})}}return m.useEffect(()=>{const F=z=>{const B=z.target;(v==null?void 0:v.contains(B))&&O(z,P)};return document.addEventListener("wheel",F,{passive:!1}),()=>document.removeEventListener("wheel",F,{passive:!1})},[C,v,P,O]),m.useEffect(k,[r,k]),Ol(v,A),Ol(p.content,A),m.createElement(UV,{scope:n,scrollbar:v,hasThumb:i,onThumbChange:xn(o),onThumbPointerUp:xn(s),onThumbPositionChange:k,onThumbPointerDown:xn(a)},m.createElement(Be.div,le({},g,{ref:x,style:{position:"absolute",...g.style},onPointerDown:Ce(e.onPointerDown,F=>{F.button===0&&(F.target.setPointerCapture(F.pointerId),w.current=v.getBoundingClientRect(),S.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),L(F))}),onPointerMove:Ce(e.onPointerMove,L),onPointerUp:Ce(e.onPointerUp,F=>{const z=F.target;z.hasPointerCapture(F.pointerId)&&z.releasePointerCapture(F.pointerId),document.body.style.webkitUserSelect=S.current,p.viewport&&(p.viewport.style.scrollBehavior=""),w.current=null})})))}),c0="ScrollAreaThumb",GV=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=fO(c0,e.__scopeScrollArea);return m.createElement(vn,{present:n||i.hasThumb},m.createElement(YV,le({ref:t},r)))}),YV=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=Jr(c0,n),s=fO(c0,n),{onThumbPositionChange:a}=s,l=et(t,f=>s.onThumbChange(f)),c=m.useRef(),d=Vh(()=>{c.current&&(c.current(),c.current=void 0)},100);return m.useEffect(()=>{const f=o.viewport;if(f){const g=()=>{if(d(),!c.current){const p=ZV(f,a);c.current=p,a()}};return a(),f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[o.viewport,d,a]),m.createElement(Be.div,le({"data-state":s.hasThumb?"visible":"hidden"},i,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ce(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),v=f.clientX-p.left,y=f.clientY-p.top;s.onThumbPointerDown({x:v,y})}),onPointerUp:Ce(e.onPointerUp,s.onThumbPointerUp)}))}),pO="ScrollAreaCorner",KV=m.forwardRef((e,t)=>{const n=Jr(pO,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.createElement(XV,le({},e,{ref:t})):null}),XV=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Jr(pO,n),[o,s]=m.useState(0),[a,l]=m.useState(0),c=!!(o&&a);return Ol(i.scrollbarX,()=>{var d;const f=((d=i.scrollbarX)===null||d===void 0?void 0:d.offsetHeight)||0;i.onCornerHeightChange(f),l(f)}),Ol(i.scrollbarY,()=>{var d;const f=((d=i.scrollbarY)===null||d===void 0?void 0:d.offsetWidth)||0;i.onCornerWidthChange(f),s(f)}),c?m.createElement(Be.div,le({},r,{ref:t,style:{width:o,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function zh(e){return e?parseInt(e,10):0}function gO(e,t){const n=e/t;return isNaN(n)?0:n}function Bh(e){const t=gO(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function QV(e,t,n,r="ltr"){const i=Bh(n),o=i/2,s=t||o,a=i-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return vO([l,c],f)(e)}function mO(e,t,n="ltr"){const r=Bh(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,a=o-r,l=n==="ltr"?[0,s]:[s*-1,0],c=a0(e,l);return vO([0,s],[0,a])(c)}function vO(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 bO(e,t){return e>0&&e<t}const ZV=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,a=n.top!==o.top;(s||a)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Vh(e,t){const n=xn(e),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ol(e,t){const n=xn(t);Vn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}const yO=cO,JV=BV,eH=KV,Pl=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(yO,{ref:r,className:Pe("relative overflow-hidden",e),...n,children:[_.jsx(JV,{className:"h-full w-full rounded-[inherit]",children:t}),_.jsx(Hh,{}),_.jsx(eH,{})]}));Pl.displayName=yO.displayName;const Hh=ue.forwardRef(({className:e,orientation:t="vertical",...n},r)=>_.jsx(uO,{ref:r,orientation:t,className:Pe("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:_.jsx(GV,{className:"relative flex-1 rounded-full bg-border"})}));Hh.displayName=uO.displayName;function tH(e,t,n,r,i){var o,s,a,l;r?(s=(o=e==null?void 0:e.data)==null?void 0:o.datasets)==null||s.forEach(c=>{var d,f;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=(d=c==null?void 0:c.backgroundColor)==null?void 0:d.map((g,p)=>p===t?g:i),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((g,p)=>p===t?g:i)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,d)=>{var f,g,p,v,y,x;c.backgroundColor=new Array(c.data.length).fill((p=(g=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:g[d])==null?void 0:p.backgroundColor),c.borderColor=new Array(c.data.length).fill((x=(y=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:y[d])==null?void 0:x.borderColor)}),e==null||e.update()}function nH(e,t,n,r,i){var o,s,a,l;r?(s=(o=e==null?void 0:e.data)==null?void 0:o.datasets)==null||s.forEach(c=>{var d,f;console.log("clicked index",t),console.log(n.data),console.log(c),c.backgroundColor=(d=c==null?void 0:c.backgroundColor)==null?void 0:d.map((g,p)=>p===t?g:i),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((g,p)=>p===t?g:i)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,d)=>{var f,g,p,v,y,x,w,S;typeof c.backgroundColor=="string"&&(c.backgroundColor=(p=(g=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:g[d])==null?void 0:p.backgroundColor,c.borderColor=(x=(y=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:y[d])==null?void 0:x.borderColor),c.backgroundColor=(w=c==null?void 0:c.backgroundColor)==null?void 0:w.map((C,P)=>{var O;return(O=n.data.datasets[d].backgroundColor)==null?void 0:O[P]}),c.borderColor=(S=c==null?void 0:c.borderColor)==null?void 0:S.map((C,P)=>{var O;return(O=n.data.datasets[d].borderColor)==null?void 0:O[P]})}),e==null||e.update()}function rH(e,t,n,r){var i,o;try{if(!e||!e.data)return;const{dimensionKeys:s,metricKeys:a}=ra(e.data);if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const l=s[0],c=(i=e.data[n])==null?void 0:i[l];return[{columnName:l,columnValue:c,metric:a[t],value:r}]}if(e.type==="stackedBar"){const l=n2({dataArray:e.data,groupKey:s[0],pivotKey:s[1],valueKey:a[0]}),c=s[0],d=(o=l[n])==null?void 0:o[c],f=s[1],{metricKeys:g}=ra(l),p=g[t];return[{columnName:c,columnValue:d,metric:a[0],value:r},{columnName:f,columnValue:p,metric:a[0],value:r}]}if(e.type==="bubble"||e.type==="scatter"){const l=s[0],c=r.label;return[{columnName:l,columnValue:c,metric1:a[0],value1:r.x,metric2:a[1],value2:r.y,metric3:a==null?void 0:a[2],value3:r==null?void 0:r.r}]}}catch(s){console.error("Error in getAdhocFilter",s)}}function iH(e){let t=[];const n=be(ne=>ne.authToken),r=_e(ne=>ne.selectedConnectionId),i=_e(ne=>ne.selectedDatabaseName),o=_e(ne=>ne.selectedSchemaName),s=_e(ne=>ne.selectedTableName),a=_e(ne=>ne.actions.setCurrentColumns),{data:l,isLoading:c,isError:d}=Sr({queryKey:[e||"connections"],queryFn:()=>el("https://semaphor.cloud/api/v1/connections",(n==null?void 0:n.accessToken)||""),enabled:!!(n!=null&&n.accessToken)}),f=l==null?void 0:l.connections.find(ne=>ne.id===r),g=(f==null?void 0:f.type)==="API",{data:p,isLoading:v,isFetching:y,isError:x,refetch:w}=Sr({queryKey:[r],queryFn:()=>el("https://semaphor.cloud/api/v1/databases",(n==null?void 0:n.accessToken)||"",{connection_id:r}),enabled:!!r&&(f==null?void 0:f.type)!=="API"}),{data:S,isLoading:C,isFetching:P,isError:O,refetch:k}=Sr({queryKey:[r,i],queryFn:()=>el("https://semaphor.cloud/api/v1/schemas",(n==null?void 0:n.accessToken)||"",{connection_id:r,database_name:i}),enabled:!!r&&!!i&&(f==null?void 0:f.type)!=="API"}),{data:A,isLoading:L,isFetching:F,isError:z,refetch:B}=Sr({queryKey:[r,i,o],queryFn:()=>el("https://semaphor.cloud/api/v1/tables",(n==null?void 0:n.accessToken)||"",{connection_id:r,database_name:i,schema_name:o}),enabled:!!r&&!!i&&!!o&&(f==null?void 0:f.type)!=="API"}),{data:V,isLoading:X,isFetching:K,isError:$}=Sr({queryKey:[r,i,s],queryFn:()=>el("https://semaphor.cloud/api/v1/columns",(n==null?void 0:n.accessToken)||"",{connection_id:r,database_name:i,schema_name:o,table_name:s}),enabled:!!r&&!!i&&!!o&&!!s&&(f==null?void 0:f.type)!=="API"}),{data:J,isLoading:G,isFetching:q,isError:se}=Sr({queryKey:["api",r],queryFn:()=>Ts("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||"",{connection_id:r,sql:"select * from api limit 10"}),enabled:!!r&&g});m.useEffect(()=>{a(t)},[t,a]),J&&J.records.length>0&&(t=aH(J.records[0])),p&&p.databases.length>0,S&&S.schemas.length>0,V&&V.columns.length>0&&(t=V.columns.map(ne=>({...ne,data_type:ne.data_type.toLowerCase()}))),x&&(t=[]),($||d)&&(t=[]);const D=l==null?void 0:l.connections.map(ne=>({id:ne.id,name:ne.name})),W=p==null?void 0:p.databases.map(ne=>({id:ne.database_name,name:ne.database_name})),re=S==null?void 0:S.schemas.map(ne=>({id:ne.schema_name,name:ne.schema_name})),N=A==null?void 0:A.tables.map(ne=>({id:ne.table_name,name:ne.table_name}));return{connectionItems:D,isConnectionsLoading:c,isConnectionsError:d,databaseItems:W,isDatabasesLoadingOrFetching:v||y,isDatabaseError:x,schemaItems:re,isSchemaLoadingOrFetching:C||P,isSchemaError:O,tableItems:N,isTableLoadingOrFetching:L||F,isTableError:z,columns:t,isColumnsLoadingOrFetching:X||K,isColumnsError:$,isAPIConnection:g}}const oH=e=>{const t=new Date(e);return!isNaN(t.getTime())},sH=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),xO=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?oH(e)?t="date":sH(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t},aH=e=>Object.keys(e).map(t=>{const n=e[t],r=xO(n);return{column_name:t,data_type:r,is_nullable:n===null?"YES":"NO"}});function lH({card:e,className:t,...n}){const r=m.useRef(null),[i,o]=m.useState(0),[s,a]=m.useState(!1),l=be(q=>q.theme),c=be(q=>q.bookmarkKey),d=be(q=>q.themeStyle),f=be(q=>q.isVisualEditing),g=be(q=>q.selectedSheetId),p=be(q=>q.selectedCardId),v=be(q=>q.isDashboardEditing),y=be(q=>q.themeStyle),x=be(q=>q.filterValues),w=be(q=>q.actions.setCardData),S=be(q=>q.actions.setSelectedCardId),C=be(q=>q.actions.addOrUpdateFilterValue),P=be(q=>q.actions.removeFilterValue),O=be(q=>q.actions.setSelectedCard),k=be(q=>q.actions.setCardTitle),A=be(q=>q.actions.setCardDescription),{data:L,isLoading:F,isFetching:z,isError:B,refetch:V}=bz(e);m.useEffect(()=>{!L||!L.records||w(g,e.id,(L==null?void 0:L.records)||[])},[L,g,e.id,w,c]),m.useEffect(()=>{o(i+1)},[e.data,e.type,e.cfg,e.customCfg,y]),m.useEffect(()=>{p===e.id&&v&&!f&&X()},[p,e.id,v,f]),m.useEffect(()=>{e.connectionId&&!s&&V()},[x,c]);const X=()=>{const q=r.current;q==null||q.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})};function K(q,se){q.stopPropagation(),S(g,se.id),O(se)}function $(q,se,D,W,re){if(!W)return;const N=l==="dark"?"rgb(238,238,238,0.2)":"rgb(238,238,238,0.8)";["bar","line","horizontalBar","stackedBar","bubble","scatter"].includes(D)&&tH(q,se,W,re,N),["pie","doughnut","polarArea"].includes(D)&&nH(q,se,W,re,N)}function J(q,se,D,W){var ne,ge;if(!e.data)return;const re=rH(e,se,D,W);if(!((ne=e==null?void 0:e.preferences)!=null&&ne.filterOnClick))return;if(s){const he=e.id;P(he),a(!1),$(q,D,e.type,G,!1);return}if(!re)return;const N={filterId:e.id,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:re[0].columnName,expression:(ge=e.preferences)==null?void 0:ge.filterOnClickField,valueType:xO(re[0].columnValue),operation:"=",values:[re[0].columnValue]};C(N),a(!0),$(q,D,e.type,G,!0)}if(!e.id)return null;let G;return e.data&&e.data.length>0&&(G=Pb({data:e.data,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg})),_.jsxs(kv,{tabIndex:-1,ref:r,role:"dashboard-card",onClick:q=>K(q,e),className:Pe(" relative h-full flex flex-col rounded-sm border-muted ",{"border-dashed border-foreground/50 ":p===e.id&&v},t,d==null?void 0:d.dashboardCard),...n,children:[_.jsx(nz,{card:e}),_.jsxs(Mv,{className:"xbg-green-100 pb-4",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(qc,{text:e.title,onSave:q=>k(g,e.id,q),children:_.jsx(Dv,{className:"text-base",children:e.title})}),e.refreshInterval&&_.jsxs(Bb,{children:[_.jsx(L2,{className:"pr-1",children:_.jsx("div",{className:Pe("h-2 w-2 rounded-full bg-green-500",{"bg-orange-500":F||z})})}),_.jsx(Ih,{side:"right",align:"center",children:_.jsx("p",{className:"text-xs",children:`Realtime (${e==null?void 0:e.refreshInterval})`})})]}),!e.refreshInterval&&(F||z)&&_.jsx(ku,{className:"w-4 h-4 animate-spin text-muted-foreground"})]}),_.jsx(qc,{text:(e==null?void 0:e.description)||"",onSave:q=>A(g,e.id,q),children:_.jsxs(Tv,{children:[" ",e.description]})})]}),_.jsxs(Av,{className:"flex flex-col pb-6 grow relative xbg-yellow-100 overflow-auto ",children:[B&&_.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."}),!B&&G&&e.type!=="table"&&_.jsx(QE,{cfg:G,onDatapointClick:J},i),e.type==="table"&&e.data&&e.data.length>0&&_.jsx(Pl,{children:_.jsx(s0,{data:e==null?void 0:e.data})})]})]})}const cH=xS.WidthProvider(xS.Responsive);function uH(){var d,f;const e=be(g=>g.isDashboardEditing),t=be(g=>g.themeStyle),n=be(g=>g.selectedSheetId),r=be(g=>{var p,v,y;return(y=(v=(p=g.dashboard)==null?void 0:p.sheets)==null?void 0:v.find(x=>x.id===n))==null?void 0:y.cards}),{getSelectedSheet:i,getSelectedSheetLayout:o,setSheetLayout:s}=be(g=>g.actions);if(!n)return null;const a=i(),l=o(),c=(g,p)=>_.jsx(wO,{className:" after:content-none",ref:p,handleAxis:g});return _.jsx(cH,{margin:((d=t==null?void 0:t.gridLayout)==null?void 0:d.margin)||[10,10],isDraggable:e,resizeHandles:e?["sw","nw","ne","se","e","w"]:[],onLayoutChange:g=>{a!=null&&a.id&&s(a.id,g)},className:Pe((f=t==null?void 0:t.gridLayout)==null?void 0:f.className),layouts:{lg:l||[]},breakpoints:{lg:1500},cols:{lg:48},rowHeight:48,resizeHandle:c,children:r&&r.map((g,p)=>_.jsx("div",{role:"dashboard-card-container",className:Pe("group",t==null?void 0:t.dashboardCardContainer),"data-grid":a!=null&&a.layout?a==null?void 0:a.layout[p]:{x:0,y:0,w:20,h:6,minH:5,minW:10,maxH:12},children:_.jsx(lH,{card:g})},g.id))})}const wO=m.forwardRef(({className:e,handleAxis:t,...n},r)=>_.jsx("div",{ref:r,className:Pe(`z-10 react-resizable-handle react-resizable-handle-${t} absolute border-foreground/40 `,{"group-hover:border-2 group-hover:border-r-0 group-hover:border-b-0 border-foreground/40":t==="nw","group-hover:border-2 group-hover:border-l-0 group-hover:border-b-0 border-foreground/40":t==="ne","group-hover:border-2 group-hover:border-r-0 group-hover:border-t-0 border-foreground/40":t==="sw","group-hover:border-2 group-hover:border-l-0 group-hover:border-t-0 border-foreground/40":t==="se","group-hover:border-2 group-hover:border-b-0 group-hover:border-t-0 group-hover:border-l-0 border-foreground/40 ":t==="e","group-hover:border-2 group-hover:border-b-0 group-hover:border-t-0 group-hover:border-r-0 border-foreground/40":t==="w"},e),...n}));wO.displayName="ResizeHandle";/**
|
|
311
|
+
* react-virtual
|
|
312
|
+
*
|
|
313
|
+
* Copyright (c) TanStack
|
|
314
|
+
*
|
|
315
|
+
* This source code is licensed under the MIT license found in the
|
|
316
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
317
|
+
*
|
|
318
|
+
* @license MIT
|
|
319
|
+
*/function Wh(){return Wh=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},Wh.apply(this,arguments)}/**
|
|
320
|
+
* virtual-core
|
|
321
|
+
*
|
|
322
|
+
* Copyright (c) TanStack
|
|
323
|
+
*
|
|
324
|
+
* This source code is licensed under the MIT license found in the
|
|
325
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
326
|
+
*
|
|
327
|
+
* @license MIT
|
|
328
|
+
*/function qh(){return qh=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},qh.apply(this,arguments)}/**
|
|
329
|
+
* virtual-core
|
|
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 kl(e,t,n){var r,i=(r=n.initialDeps)!=null?r:[],o;return function(){var s;n.key&&n.debug!=null&&n.debug()&&(s=Date.now());var a=e(),l=a.length!==i.length||a.some(function(v,y){return i[y]!==v});if(!l)return o;i=a;var c;if(n.key&&n.debug!=null&&n.debug()&&(c=Date.now()),o=t.apply(void 0,a),n.key&&n.debug!=null&&n.debug()){var d=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-c)*100)/100,g=f/16,p=function(y,x){for(y=String(y);y.length<x;)y=" "+y;return y};console.info("%c⏱ "+p(f,5)+" /"+p(d,5)+" ms",`
|
|
338
|
+
font-size: .6rem;
|
|
339
|
+
font-weight: bold;
|
|
340
|
+
color: hsl(`+Math.max(0,Math.min(120-120*g,120))+"deg 100% 31%);",n==null?void 0:n.key)}return n==null||n.onChange==null||n.onChange(o),o}}function u0(e,t){if(e===void 0)throw new Error("Unexpected undefined"+(t?": "+t:""));return e}var dH=function(t,n){return Math.abs(t-n)<1};/**
|
|
341
|
+
* virtual-core
|
|
342
|
+
*
|
|
343
|
+
* Copyright (c) TanStack
|
|
344
|
+
*
|
|
345
|
+
* This source code is licensed under the MIT license found in the
|
|
346
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
347
|
+
*
|
|
348
|
+
* @license MIT
|
|
349
|
+
*/var fH=function(t){return t},hH=function(t){for(var n=Math.max(t.startIndex-t.overscan,0),r=Math.min(t.endIndex+t.overscan,t.count-1),i=[],o=n;o<=r;o++)i.push(o);return i},pH=function(t,n){var r=t.scrollElement;if(r){var i=function(a){var l=a.width,c=a.height;n({width:Math.round(l),height:Math.round(c)})};i(r.getBoundingClientRect());var o=new ResizeObserver(function(s){var a=s[0];if(a!=null&&a.borderBoxSize){var l=a.borderBoxSize[0];if(l){i({width:l.inlineSize,height:l.blockSize});return}}i(r.getBoundingClientRect())});return o.observe(r,{box:"border-box"}),function(){o.unobserve(r)}}},gH=function(t,n){var r=t.scrollElement;if(r){var i=function(){n(r[t.options.horizontal?"scrollLeft":"scrollTop"])};return i(),r.addEventListener("scroll",i,{passive:!0}),function(){r.removeEventListener("scroll",i)}}},mH=function(t,n,r){if(n!=null&&n.borderBoxSize){var i=n.borderBoxSize[0];if(i){var o=Math.round(i[r.options.horizontal?"inlineSize":"blockSize"]);return o}}return Math.round(t.getBoundingClientRect()[r.options.horizontal?"width":"height"])},vH=function(t,n,r){var i,o,s=n.adjustments,a=s===void 0?0:s,l=n.behavior,c=t+a;(i=r.scrollElement)==null||i.scrollTo==null||i.scrollTo((o={},o[r.options.horizontal?"left":"top"]=c,o.behavior=l,o))},bH=function(t){var n=this;this.unsubs=[],this.scrollElement=null,this.isScrolling=!1,this.isScrollingTimeoutId=null,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=function(){var r=null,i=function(){return r||(typeof ResizeObserver<"u"?r=new ResizeObserver(function(s){s.forEach(function(a){n._measureElement(a.target,a)})}):null)};return{disconnect:function(){var s;return(s=i())==null?void 0:s.disconnect()},observe:function(s){var a;return(a=i())==null?void 0:a.observe(s,{box:"border-box"})},unobserve:function(s){var a;return(a=i())==null?void 0:a.unobserve(s)}}}(),this.range=null,this.setOptions=function(r){Object.entries(r).forEach(function(i){var o=i[0],s=i[1];typeof s>"u"&&delete r[o]}),n.options=qh({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:fH,rangeExtractor:hH,onChange:function(){},measureElement:mH,initialRect:{width:0,height:0},scrollMargin:0,scrollingDelay:150,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1},r)},this.notify=function(r){n.options.onChange==null||n.options.onChange(n,r)},this.maybeNotify=kl(function(){return n.calculateRange(),[n.isScrolling,n.range?n.range.startIndex:null,n.range?n.range.endIndex:null]},function(r){n.notify(r)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:function(){return n.options.debug},initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=function(){n.unsubs.filter(Boolean).forEach(function(r){return r()}),n.unsubs=[],n.scrollElement=null},this._didMount=function(){return n.measureElementCache.forEach(n.observer.observe),function(){n.observer.disconnect(),n.cleanup()}},this._willUpdate=function(){var r=n.options.getScrollElement();n.scrollElement!==r&&(n.cleanup(),n.scrollElement=r,n._scrollToOffset(n.scrollOffset,{adjustments:void 0,behavior:void 0}),n.unsubs.push(n.options.observeElementRect(n,function(i){n.scrollRect=i,n.maybeNotify()})),n.unsubs.push(n.options.observeElementOffset(n,function(i){n.scrollAdjustments=0,n.scrollOffset!==i&&(n.isScrollingTimeoutId!==null&&(clearTimeout(n.isScrollingTimeoutId),n.isScrollingTimeoutId=null),n.isScrolling=!0,n.scrollDirection=n.scrollOffset<i?"forward":"backward",n.scrollOffset=i,n.maybeNotify(),n.isScrollingTimeoutId=setTimeout(function(){n.isScrollingTimeoutId=null,n.isScrolling=!1,n.scrollDirection=null,n.maybeNotify()},n.options.scrollingDelay))})))},this.getSize=function(){return n.scrollRect[n.options.horizontal?"width":"height"]},this.memoOptions=kl(function(){return[n.options.count,n.options.paddingStart,n.options.scrollMargin,n.options.getItemKey]},function(r,i,o,s){return n.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:i,scrollMargin:o,getItemKey:s}},{key:!1}),this.getFurthestMeasurement=function(r,i){for(var o=new Map,s=new Map,a=i-1;a>=0;a--){var l=r[a];if(!o.has(l.lane)){var c=s.get(l.lane);if(c==null||l.end>c.end?s.set(l.lane,l):l.end<c.end&&o.set(l.lane,!0),o.size===n.options.lanes)break}}return s.size===n.options.lanes?Array.from(s.values()).sort(function(d,f){return d.end-f.end})[0]:void 0},this.getMeasurements=kl(function(){return[n.memoOptions(),n.itemSizeCache]},function(r,i){var o=r.count,s=r.paddingStart,a=r.scrollMargin,l=r.getItemKey,c=n.pendingMeasuredCacheIndexes.length>0?Math.min.apply(Math,n.pendingMeasuredCacheIndexes):0;n.pendingMeasuredCacheIndexes=[];for(var d=n.measurementsCache.slice(0,c),f=c;f<o;f++){var g=l(f),p=n.options.lanes===1?d[f-1]:n.getFurthestMeasurement(d,f),v=p?p.end:s+a,y=i.get(g),x=typeof y=="number"?y:n.options.estimateSize(f),w=v+x,S=p?p.lane:f%n.options.lanes;d[f]={index:f,start:v,size:x,end:w,key:g,lane:S}}return n.measurementsCache=d,d},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:function(){return n.options.debug}}),this.calculateRange=kl(function(){return[n.getMeasurements(),n.getSize(),n.scrollOffset]},function(r,i,o){return n.range=r.length>0&&i>0?yH({measurements:r,outerSize:i,scrollOffset:o}):null},{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:function(){return n.options.debug}}),this.getIndexes=kl(function(){return[n.options.rangeExtractor,n.calculateRange(),n.options.overscan,n.options.count]},function(r,i,o,s){return i===null?[]:r(qh({},i,{overscan:o,count:s}))},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return n.options.debug}}),this.indexFromElement=function(r){var i=n.options.indexAttribute,o=r.getAttribute(i);return o?parseInt(o,10):(console.warn("Missing attribute name '"+i+"={index}' on measured element."),-1)},this._measureElement=function(r,i){var o=n.measurementsCache[n.indexFromElement(r)];if(!o||!r.isConnected){n.measureElementCache.forEach(function(l,c){l===r&&(n.observer.unobserve(r),n.measureElementCache.delete(c))});return}var s=n.measureElementCache.get(o.key);s!==r&&(s&&n.observer.unobserve(s),n.observer.observe(r),n.measureElementCache.set(o.key,r));var a=n.options.measureElement(r,i,n);n.resizeItem(o,a)},this.resizeItem=function(r,i){var o,s=(o=n.itemSizeCache.get(r.key))!=null?o:r.size,a=i-s;a!==0&&(r.start<n.scrollOffset&&(process.env.NODE_ENV!=="production"&&n.options.debug&&console.info("correction",a),n._scrollToOffset(n.scrollOffset,{adjustments:n.scrollAdjustments+=a,behavior:void 0})),n.pendingMeasuredCacheIndexes.push(r.index),n.itemSizeCache=new Map(n.itemSizeCache.set(r.key,i)),n.notify(!1))},this.measureElement=function(r){r&&n._measureElement(r,void 0)},this.getVirtualItems=kl(function(){return[n.getIndexes(),n.getMeasurements()]},function(r,i){for(var o=[],s=0,a=r.length;s<a;s++){var l=r[s],c=i[l];o.push(c)}return o},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return n.options.debug}}),this.getVirtualItemForOffset=function(r){var i=n.getMeasurements();return u0(i[_O(0,i.length-1,function(o){return u0(i[o]).start},r)])},this.getOffsetForAlignment=function(r,i){var o=n.getSize();i==="auto"&&(r<=n.scrollOffset?i="start":r>=n.scrollOffset+o?i="end":i="start"),i==="start"?r=r:i==="end"?r=r-o:i==="center"&&(r=r-o/2);var s=n.options.horizontal?"scrollWidth":"scrollHeight",a=n.scrollElement?"document"in n.scrollElement?n.scrollElement.document.documentElement[s]:n.scrollElement[s]:0,l=a-n.getSize();return Math.max(Math.min(l,r),0)},this.getOffsetForIndex=function(r,i){i===void 0&&(i="auto"),r=Math.max(0,Math.min(r,n.options.count-1));var o=u0(n.getMeasurements()[r]);if(i==="auto")if(o.end>=n.scrollOffset+n.getSize()-n.options.scrollPaddingEnd)i="end";else if(o.start<=n.scrollOffset+n.options.scrollPaddingStart)i="start";else return[n.scrollOffset,i];var s=i==="end"?o.end+n.options.scrollPaddingEnd:o.start-n.options.scrollPaddingStart;return[n.getOffsetForAlignment(s,i),i]},this.isDynamicMode=function(){return n.measureElementCache.size>0},this.cancelScrollToIndex=function(){n.scrollToIndexTimeoutId!==null&&(clearTimeout(n.scrollToIndexTimeoutId),n.scrollToIndexTimeoutId=null)},this.scrollToOffset=function(r,i){var o=i===void 0?{}:i,s=o.align,a=s===void 0?"start":s,l=o.behavior;n.cancelScrollToIndex(),l==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n._scrollToOffset(n.getOffsetForAlignment(r,a),{adjustments:void 0,behavior:l})},this.scrollToIndex=function(r,i){var o=i===void 0?{}:i,s=o.align,a=s===void 0?"auto":s,l=o.behavior;r=Math.max(0,Math.min(r,n.options.count-1)),n.cancelScrollToIndex(),l==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");var c=n.getOffsetForIndex(r,a),d=c[0],f=c[1];n._scrollToOffset(d,{adjustments:void 0,behavior:l}),l!=="smooth"&&n.isDynamicMode()&&(n.scrollToIndexTimeoutId=setTimeout(function(){n.scrollToIndexTimeoutId=null;var g=n.measureElementCache.has(n.options.getItemKey(r));if(g){var p=n.getOffsetForIndex(r,f),v=p[0];dH(v,n.scrollOffset)||n.scrollToIndex(r,{align:f,behavior:l})}else n.scrollToIndex(r,{align:f,behavior:l})}))},this.scrollBy=function(r,i){var o=i===void 0?{}:i,s=o.behavior;n.cancelScrollToIndex(),s==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n._scrollToOffset(n.scrollOffset+r,{adjustments:void 0,behavior:s})},this.getTotalSize=function(){var r;return(((r=n.getMeasurements()[n.options.count-1])==null?void 0:r.end)||n.options.paddingStart)-n.options.scrollMargin+n.options.paddingEnd},this._scrollToOffset=function(r,i){var o=i.adjustments,s=i.behavior;n.options.scrollToFn(r,{behavior:s,adjustments:o},n)},this.measure=function(){n.itemSizeCache=new Map,n.notify(!1)},this.setOptions(t),this.scrollRect=this.options.initialRect,this.scrollOffset=this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(function(r){n.itemSizeCache.set(r.key,r.size)}),this.maybeNotify()},_O=function(t,n,r,i){for(;t<=n;){var o=(t+n)/2|0,s=r(o);if(s<i)t=o+1;else if(s>i)n=o-1;else return o}return t>0?t-1:0};function yH(e){for(var t=e.measurements,n=e.outerSize,r=e.scrollOffset,i=t.length-1,o=function(c){return t[c].start},s=_O(0,i,o,r),a=s;a<i&&t[a].end<r+n;)a++;return{startIndex:s,endIndex:a}}/**
|
|
350
|
+
* react-virtual
|
|
351
|
+
*
|
|
352
|
+
* Copyright (c) TanStack
|
|
353
|
+
*
|
|
354
|
+
* This source code is licensed under the MIT license found in the
|
|
355
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
356
|
+
*
|
|
357
|
+
* @license MIT
|
|
358
|
+
*/var xH=typeof document<"u"?ue.useLayoutEffect:ue.useEffect;function wH(e){var t=ue.useReducer(function(){return{}},{})[1],n=Wh({},e,{onChange:function(s,a){a?kt.flushSync(t):t(),e.onChange==null||e.onChange(s,a)}}),r=ue.useState(function(){return new bH(n)}),i=r[0];return i.setOptions(n),ue.useEffect(function(){return i._didMount()},[]),xH(function(){return i._willUpdate()}),i}function _H(e){return wH(Wh({observeElementRect:pH,observeElementOffset:gH,scrollToFn:vH},e))}var SH=Object.defineProperty,CH=(e,t,n)=>t in e?SH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,d0=(e,t,n)=>(CH(e,typeof t!="symbol"?t+"":t,n),n);let EH=class{constructor(){d0(this,"current",this.detect()),d0(this,"handoffState","pending"),d0(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"}},aa=new EH,wn=(e,t)=>{aa.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function ji(e){let t=m.useRef(e);return wn(()=>{t.current=e},[e]),t}function f0(e,t){let[n,r]=m.useState(e),i=ji(e);return wn(()=>r(i.current),[i,r,...t]),n}let mt=function(e){let t=ji(e);return m.useCallback((...n)=>t.current(...n),[t])};function OH(e,t,n){let[r,i]=m.useState(n),o=e!==void 0,s=m.useRef(o),a=m.useRef(!1),l=m.useRef(!1);return o&&!s.current&&!a.current?(a.current=!0,s.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!o&&s.current&&!l.current&&(l.current=!0,s.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[o?e:r,mt(c=>(o||i(c),t==null?void 0:t(c)))]}function PH(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function la(){let e=[],t={addEventListener(n,r,i,o){return n.addEventListener(r,i,o),t.add(()=>n.removeEventListener(r,i,o))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return PH(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,i){let o=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:i}),this.add(()=>{Object.assign(n.style,{[r]:o})})},group(n){let r=la();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let i of e.splice(r,1))i()}},dispose(){for(let n of e.splice(0))n()}};return t}function Du(){let[e]=m.useState(la);return m.useEffect(()=>()=>e.dispose(),[e]),e}function kH(){let e=typeof document>"u";return"useSyncExternalStore"in ue?(t=>t.useSyncExternalStore)(ue)(()=>()=>{},()=>!1,()=>!e):!1}function h0(){let e=kH(),[t,n]=ue.useState(aa.isHandoffComplete);return t&&aa.isHandoffComplete===!1&&n(!1),ue.useEffect(()=>{t!==!0&&n(!0)},[t]),ue.useEffect(()=>aa.handoff(),[]),e?!1:t}var SO;let Tu=(SO=m.useId)!=null?SO:function(){let e=h0(),[t,n]=m.useState(e?()=>aa.nextId():null);return wn(()=>{t===null&&n(aa.nextId())},[t]),t!=null?""+t:void 0};function $n(e,t,...n){if(e in t){let i=t[e];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,$n),r}function p0(e){return aa.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let CO=["[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 MH=(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))(MH||{}),DH=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(DH||{}),TH=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(TH||{}),EO=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(EO||{});function AH(e,t=0){var n;return e===((n=p0(e))==null?void 0:n.body)?!1:$n(t,{0(){return e.matches(CO)},1(){let r=e;for(;r!==null;){if(r.matches(CO))return!0;r=r.parentElement}return!1}})}var IH=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(IH||{});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 NH(e,t=n=>n){return e.slice().sort((n,r)=>{let i=t(n),o=t(r);if(i===null||o===null)return 0;let s=i.compareDocumentPosition(o);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function RH(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function LH(){return/Android/gi.test(window.navigator.userAgent)}function OO(){return RH()||LH()}function Uh(e,t,n){let r=ji(t);m.useEffect(()=>{function i(o){r.current(o)}return document.addEventListener(e,i,n),()=>document.removeEventListener(e,i,n)},[e,n])}function $H(e,t,n){let r=ji(t);m.useEffect(()=>{function i(o){r.current(o)}return window.addEventListener(e,i,n),()=>window.removeEventListener(e,i,n)},[e,n])}function FH(e,t,n=!0){let r=m.useRef(!1);m.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function i(s,a){if(!r.current||s.defaultPrevented)return;let l=a(s);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let c=function d(f){return typeof f=="function"?d(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let d of c){if(d===null)continue;let f=d instanceof HTMLElement?d:d.current;if(f!=null&&f.contains(l)||s.composed&&s.composedPath().includes(f))return}return!AH(l,EO.Loose)&&l.tabIndex!==-1&&s.preventDefault(),t(s,l)}let o=m.useRef(null);Uh("pointerdown",s=>{var a,l;r.current&&(o.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),Uh("mousedown",s=>{var a,l;r.current&&(o.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),Uh("click",s=>{OO()||o.current&&(i(s,()=>o.current),o.current=null)},!0),Uh("touchend",s=>i(s,()=>s.target instanceof HTMLElement?s.target:null),!0),$H("blur",s=>i(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function jH(...e){return m.useMemo(()=>p0(...e),[...e])}function PO(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function zH(e,t){let[n,r]=m.useState(()=>PO(e));return wn(()=>{r(PO(e))},[e.type,e.as]),wn(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let BH=Symbol();function ca(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=mt(r=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return e.every(r=>r==null||(r==null?void 0:r[BH]))?void 0:n}function kO(e){return[e.screenX,e.screenY]}function VH(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=kO(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=kO(t)}}}function HH({container:e,accept:t,walk:n,enabled:r=!0}){let i=m.useRef(t),o=m.useRef(n);m.useEffect(()=>{i.current=t,o.current=n},[t,n]),wn(()=>{if(!e||!r)return;let s=p0(e);if(!s)return;let a=i.current,l=o.current,c=Object.assign(f=>a(f),{acceptNode:a}),d=s.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,c,!1);for(;d.nextNode();)l(d.currentNode)},[e,r,i,o])}function MO(e,t){let n=m.useRef([]),r=mt(e);m.useEffect(()=>{let i=[...n.current];for(let[o,s]of t.entries())if(n.current[o]!==s){let a=r(t,i);return n.current=t,a}},[r,...t])}function Gh(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Yh=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Yh||{}),es=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(es||{});function xo({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:o=!0,name:s,mergeRefs:a}){a=a??WH;let l=DO(t,e);if(o)return Kh(l,n,r,s,a);let c=i??0;if(c&2){let{static:d=!1,...f}=l;if(d)return Kh(f,n,r,s,a)}if(c&1){let{unmount:d=!0,...f}=l;return $n(d?0:1,{0(){return null},1(){return Kh({...f,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Kh(l,n,r,s,a)}function Kh(e,t={},n,r,i){let{as:o=n,children:s,refName:a="ref",...l}=m0(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},d=typeof s=="function"?s(t):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t));let f={};if(t){let g=!1,p=[];for(let[v,y]of Object.entries(t))typeof y=="boolean"&&(g=!0),y===!0&&p.push(v);g&&(f["data-headlessui-state"]=p.join(" "))}if(o===m.Fragment&&Object.keys(g0(l)).length>0){if(!m.isValidElement(d)||Array.isArray(d)&&d.length>1)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(l).map(y=>` - ${y}`).join(`
|
|
359
|
+
`),"","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(y=>` - ${y}`).join(`
|
|
360
|
+
`)].join(`
|
|
361
|
+
`));let g=d.props,p=typeof(g==null?void 0:g.className)=="function"?(...y)=>Gh(g==null?void 0:g.className(...y),l.className):Gh(g==null?void 0:g.className,l.className),v=p?{className:p}:{};return m.cloneElement(d,Object.assign({},DO(d.props,g0(m0(l,["ref"]))),f,c,{ref:i(d.ref,c.ref)},v))}return m.createElement(o,Object.assign({},m0(l,["ref"]),o!==m.Fragment&&c,o!==m.Fragment&&f),d)}function WH(...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 DO(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](i,...o){let s=n[r];for(let a of s){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...o)}}});return t}function zi(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function g0(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function m0(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let qH="div";var TO=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(TO||{});function UH(e,t){var n;let{features:r=1,...i}=e,o={ref:t,"aria-hidden":(r&2)===2?!0:(n=i["aria-hidden"])!=null?n:void 0,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 xo({ourProps:o,theirProps:i,slot:{},defaultTag:qH,name:"Hidden"})}let GH=zi(UH),v0=m.createContext(null);v0.displayName="OpenClosedContext";var Tr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Tr||{});function b0(){return m.useContext(v0)}function AO({value:e,children:t}){return m.createElement(v0.Provider,{value:e},t)}function YH(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let ua=[];YH(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&ua[0]!==t.target&&(ua.unshift(t.target),ua=ua.filter(n=>n!=null&&n.isConnected),ua.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 KH(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&&XH(n)?!1:r}function XH(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function QH(e){throw new Error("Unexpected object: "+e)}var _n=(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))(_n||{});function IO(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1;switch(e.focus){case 0:{for(let o=0;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 1:{for(let o=i-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 2:{for(let o=i+1;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 3:{for(let o=n.length-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 4:{for(let o=0;o<n.length;++o)if(t.resolveId(n[o],o,n)===e.id)return o;return r}case 5:return null;default:QH(e)}}function NO(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))LO(n,RO(t,r),i);return n}function RO(e,t){return e?e+"["+t+"]":t}function LO(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())LO(e,RO(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):NO(n,t,e)}var Ar=(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))(Ar||{}),ZH=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ZH||{}),JH=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(JH||{}),eW=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(eW||{}),tW=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualOptions=7]="UpdateVirtualOptions",e))(tW||{});function y0(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),i=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):NH(r,s=>s.dataRef.current.domRef.current),o=n?i.indexOf(n):null;return o===-1&&(o=null),{options:i,activeOptionIndex:o}}let nW={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState: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}}return{...e,comboboxState:0}},2(e,t){var n,r,i,o,s;if((n=e.dataRef.current)!=null&&n.disabled||(r=e.dataRef.current)!=null&&r.optionsRef.current&&!((i=e.dataRef.current)!=null&&i.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let d=t.focus===_n.Specific?t.idx:IO(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var g,p;return(p=(g=e.activeOptionIndex)!=null?g:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?p:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),f=(o=t.trigger)!=null?o:2;return e.activeOptionIndex===d&&e.activationTrigger===f?e:{...e,activeOptionIndex:d,activationTrigger:f}}let a=y0(e);if(a.activeOptionIndex===null){let d=a.options.findIndex(f=>!f.dataRef.current.disabled);d!==-1&&(a.activeOptionIndex=d)}let l=t.focus===_n.Specific?t.idx:IO(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled}),c=(s=t.trigger)!=null?s:2;return e.activeOptionIndex===l&&e.activationTrigger===c?e:{...e,...a,activeOptionIndex:l,activationTrigger:c}},3:(e,t)=>{var n,r,i;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let o=t.payload,s=y0(e,l=>(l.push(o),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(o));let a={...e,...s,activationTrigger:2};return(i=e.dataRef.current)!=null&&i.__demoMode&&e.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},4:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(i=>i.id!==t.id)};let r=y0(e,i=>{let o=i.findIndex(s=>s.id===t.id);return o!==-1&&i.splice(o,1),i});return{...e,...r,activationTrigger:2}},5:(e,t)=>e.labelId===t.id?e:{...e,labelId:t.id},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n;if(((n=e.virtual)==null?void 0:n.options)===t.options)return e;let r=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?r=i:r=null}return{...e,activeOptionIndex:r,virtual:Object.assign({},e.virtual,{options:t.options})}}},x0=m.createContext(null);x0.displayName="ComboboxActionsContext";function Au(e){let t=m.useContext(x0);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Au),n}return t}let $O=m.createContext(null);function rW(e){var t;let n=da("VirtualProvider"),[r,i]=m.useMemo(()=>{let l=n.optionsRef.current;if(!l)return[0,0];let c=window.getComputedStyle(l);return[parseFloat(c.paddingBlockStart||c.paddingTop),parseFloat(c.paddingBlockEnd||c.paddingBottom)]},[n.optionsRef.current]),o=_H({scrollPaddingStart:r,scrollPaddingEnd:i,count:n.virtual.options.length,estimateSize(){return 40},getScrollElement(){var l;return(l=n.optionsRef.current)!=null?l:null},overscan:12}),[s,a]=m.useState(0);return wn(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement($O.Provider,{value:o},m.createElement("div",{style:{position:"relative",width:"100%",height:`${o.getTotalSize()}px`},ref:l=>{if(l){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||n.activationTrigger===0)return;n.activeOptionIndex!==null&&n.virtual.options.length>n.activeOptionIndex&&o.scrollToIndex(n.activeOptionIndex)}}},o.getVirtualItems().map(l=>{var c;return m.createElement(m.Fragment,{key:l.key},m.cloneElement((c=e.children)==null?void 0:c.call(e,{option:n.virtual.options[l.index],open:n.comboboxState===0}),{key:`${s}-${l.key}`,"data-index":l.index,"aria-setsize":n.virtual.options.length,"aria-posinset":l.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${l.start}px)`,overflowAnchor:"none"}}))})))}let w0=m.createContext(null);w0.displayName="ComboboxDataContext";function da(e){let t=m.useContext(w0);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,da),n}return t}function iW(e,t){return $n(t.type,nW,e,t)}let oW=m.Fragment;function sW(e,t){let{value:n,defaultValue:r,onChange:i,form:o,name:s,by:a=null,disabled:l=!1,__demoMode:c=!1,nullable:d=!1,multiple:f=!1,immediate:g=!1,virtual:p=null,...v}=e,y=!1,x=null,[w=f?[]:void 0,S]=OH(n,i,r),[C,P]=m.useReducer(iW,{dataRef:m.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),O=m.useRef(!1),k=m.useRef({static:!1,hold:!1}),A=m.useRef(null),L=m.useRef(null),F=m.useRef(null),z=m.useRef(null),B=mt(typeof a=="string"?(ee,H)=>{let ye=a;return(ee==null?void 0:ee[ye])===(H==null?void 0:H[ye])}:a??((ee,H)=>ee===H)),V=mt(ee=>C.options.findIndex(H=>B(H.dataRef.current.value,ee))),X=m.useCallback(ee=>$n($.mode,{1:()=>w.some(H=>B(H,ee)),0:()=>B(w,ee)}),[w]),K=mt(ee=>C.activeOptionIndex===V(ee)),$=m.useMemo(()=>({...C,immediate:y,optionsPropsRef:k,labelRef:A,inputRef:L,buttonRef:F,optionsRef:z,value:w,defaultValue:r,disabled:l,mode:f?1:0,virtual:C.virtual,get activeOptionIndex(){if(O.current&&C.activeOptionIndex===null&&C.options.length>0){let ee=C.options.findIndex(H=>!H.dataRef.current.disabled);if(ee!==-1)return ee}return C.activeOptionIndex},calculateIndex:V,compare:B,isSelected:X,isActive:K,nullable:d,__demoMode:c}),[w,r,l,f,d,c,C,x]);wn(()=>{},[x,void 0]),wn(()=>{C.dataRef.current=$},[$]),FH([$.buttonRef,$.inputRef,$.optionsRef],()=>ge.closeCombobox(),$.comboboxState===0);let J=m.useMemo(()=>{var ee,H,ye;return{open:$.comboboxState===0,disabled:l,activeIndex:$.activeOptionIndex,activeOption:$.activeOptionIndex===null?null:$.virtual?$.virtual.options[(ee=$.activeOptionIndex)!=null?ee:0]:(ye=(H=$.options[$.activeOptionIndex])==null?void 0:H.dataRef.current.value)!=null?ye:null,value:w}},[$,l,w]),G=mt(()=>{if($.activeOptionIndex!==null){if($.virtual)N($.virtual.options[$.activeOptionIndex]);else{let{dataRef:ee}=$.options[$.activeOptionIndex];N(ee.current.value)}ge.goToOption(_n.Specific,$.activeOptionIndex)}}),q=mt(()=>{P({type:0}),O.current=!0}),se=mt(()=>{P({type:1}),O.current=!1}),D=mt((ee,H,ye)=>(O.current=!1,ee===_n.Specific?P({type:2,focus:_n.Specific,idx:H,trigger:ye}):P({type:2,focus:ee,trigger:ye}))),W=mt((ee,H)=>(P({type:3,payload:{id:ee,dataRef:H}}),()=>{$.isActive(H.current.value)&&(O.current=!0),P({type:4,id:ee})})),re=mt(ee=>(P({type:5,id:ee}),()=>P({type:5,id:null}))),N=mt(ee=>$n($.mode,{0(){return S==null?void 0:S(ee)},1(){let H=$.value.slice(),ye=H.findIndex(oe=>B(oe,ee));return ye===-1?H.push(ee):H.splice(ye,1),S==null?void 0:S(H)}})),ne=mt(ee=>{P({type:6,trigger:ee})}),ge=m.useMemo(()=>({onChange:N,registerOption:W,registerLabel:re,goToOption:D,closeCombobox:se,openCombobox:q,setActivationTrigger:ne,selectActiveOption:G}),[]),he=t===null?{}:{ref:t},de=m.useRef(null),ie=Du();return m.useEffect(()=>{de.current&&r!==void 0&&ie.addEventListener(de.current,"reset",()=>{S==null||S(r)})},[de,S]),m.createElement(x0.Provider,{value:ge},m.createElement(w0.Provider,{value:$},m.createElement(AO,{value:$n($.comboboxState,{0:Tr.Open,1:Tr.Closed})},s!=null&&w!=null&&NO({[s]:w}).map(([ee,H],ye)=>m.createElement(GH,{features:TO.Hidden,ref:ye===0?oe=>{var Te;de.current=(Te=oe==null?void 0:oe.closest("form"))!=null?Te:null}:void 0,...g0({key:ee,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:o,name:ee,value:H})})),xo({ourProps:he,theirProps:v,slot:J,defaultTag:oW,name:"Combobox"}))))}let aW="input";function lW(e,t){var n,r,i,o,s;let a=Tu(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:d,type:f="text",...g}=e,p=da("Combobox.Input"),v=Au("Combobox.Input"),y=ca(p.inputRef,t),x=jH(p.inputRef),w=m.useRef(!1),S=Du(),C=mt(()=>{v.onChange(null),p.optionsRef.current&&(p.optionsRef.current.scrollTop=0),v.goToOption(_n.Nothing)}),P=function(){var $;return typeof d=="function"&&p.value!==void 0?($=d(p.value))!=null?$:"":typeof p.value=="string"?p.value:""}();MO(([$,J],[G,q])=>{if(w.current)return;let se=p.inputRef.current;se&&((q===0&&J===1||$!==G)&&(se.value=$),requestAnimationFrame(()=>{if(w.current||!se||(x==null?void 0:x.activeElement)!==se)return;let{selectionStart:D,selectionEnd:W}=se;Math.abs((W??0)-(D??0))===0&&D===0&&se.setSelectionRange(se.value.length,se.value.length)}))},[P,p.comboboxState,x]),MO(([$],[J])=>{if($===0&&J===1){if(w.current)return;let G=p.inputRef.current;if(!G)return;let q=G.value,{selectionStart:se,selectionEnd:D,selectionDirection:W}=G;G.value="",G.value=q,W!==null?G.setSelectionRange(se,D,W):G.setSelectionRange(se,D)}},[p.comboboxState]);let O=m.useRef(!1),k=mt(()=>{O.current=!0}),A=mt(()=>{S.nextFrame(()=>{O.current=!1})}),L=mt($=>{switch(w.current=!0,$.key){case Ar.Enter:if(w.current=!1,p.comboboxState!==0||O.current)return;if($.preventDefault(),$.stopPropagation(),p.activeOptionIndex===null){v.closeCombobox();return}v.selectActiveOption(),p.mode===0&&v.closeCombobox();break;case Ar.ArrowDown:return w.current=!1,$.preventDefault(),$.stopPropagation(),$n(p.comboboxState,{0:()=>v.goToOption(_n.Next),1:()=>v.openCombobox()});case Ar.ArrowUp:return w.current=!1,$.preventDefault(),$.stopPropagation(),$n(p.comboboxState,{0:()=>v.goToOption(_n.Previous),1:()=>{v.openCombobox(),S.nextFrame(()=>{p.value||v.goToOption(_n.Last)})}});case Ar.Home:if($.shiftKey)break;return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(_n.First);case Ar.PageUp:return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(_n.First);case Ar.End:if($.shiftKey)break;return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(_n.Last);case Ar.PageDown:return w.current=!1,$.preventDefault(),$.stopPropagation(),v.goToOption(_n.Last);case Ar.Escape:return w.current=!1,p.comboboxState!==0?void 0:($.preventDefault(),p.optionsRef.current&&!p.optionsPropsRef.current.static&&$.stopPropagation(),p.nullable&&p.mode===0&&p.value===null&&C(),v.closeCombobox());case Ar.Tab:if(w.current=!1,p.comboboxState!==0)return;p.mode===0&&p.activationTrigger!==1&&v.selectActiveOption(),v.closeCombobox();break}}),F=mt($=>{c==null||c($),p.nullable&&p.mode===0&&$.target.value===""&&C(),v.openCombobox()}),z=mt($=>{var J,G,q;let se=(J=$.relatedTarget)!=null?J:ua.find(D=>D!==$.currentTarget);if(w.current=!1,!((G=p.optionsRef.current)!=null&&G.contains(se))&&!((q=p.buttonRef.current)!=null&&q.contains(se))&&p.comboboxState===0)return $.preventDefault(),p.mode===0&&(p.nullable&&p.value===null?C():p.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),B=mt($=>{var J,G,q;let se=(J=$.relatedTarget)!=null?J:ua.find(D=>D!==$.currentTarget);(G=p.buttonRef.current)!=null&&G.contains(se)||(q=p.optionsRef.current)!=null&&q.contains(se)||p.disabled||p.immediate&&p.comboboxState!==0&&(v.openCombobox(),S.nextFrame(()=>{v.setActivationTrigger(1)}))}),V=f0(()=>{if(p.labelId)return[p.labelId].join(" ")},[p.labelId]),X=m.useMemo(()=>({open:p.comboboxState===0,disabled:p.disabled}),[p]),K={ref:y,id:l,role:"combobox",type:f,"aria-controls":(n=p.optionsRef.current)==null?void 0:n.id,"aria-expanded":p.comboboxState===0,"aria-activedescendant":p.activeOptionIndex===null?void 0:p.virtual?(r=p.options.find($=>{var J;return!((J=p.virtual)!=null&&J.disabled($.dataRef.current.value))&&p.compare($.dataRef.current.value,p.virtual.options[p.activeOptionIndex])}))==null?void 0:r.id:(i=p.options[p.activeOptionIndex])==null?void 0:i.id,"aria-labelledby":V,"aria-autocomplete":"list",defaultValue:(s=(o=e.defaultValue)!=null?o:p.defaultValue!==void 0?d==null?void 0:d(p.defaultValue):null)!=null?s:p.defaultValue,disabled:p.disabled,onCompositionStart:k,onCompositionEnd:A,onKeyDown:L,onChange:F,onFocus:B,onBlur:z};return xo({ourProps:K,theirProps:g,slot:X,defaultTag:aW,name:"Combobox.Input"})}let cW="button";function uW(e,t){var n;let r=da("Combobox.Button"),i=Au("Combobox.Button"),o=ca(r.buttonRef,t),s=Tu(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,c=Du(),d=mt(y=>{switch(y.key){case Ar.ArrowDown:return y.preventDefault(),y.stopPropagation(),r.comboboxState===1&&i.openCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case Ar.ArrowUp:return y.preventDefault(),y.stopPropagation(),r.comboboxState===1&&(i.openCombobox(),c.nextFrame(()=>{r.value||i.goToOption(_n.Last)})),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case Ar.Escape:return r.comboboxState!==0?void 0:(y.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&y.stopPropagation(),i.closeCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})}));default:return}}),f=mt(y=>{if(KH(y.currentTarget))return y.preventDefault();r.comboboxState===0?i.closeCombobox():(y.preventDefault(),i.openCombobox()),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})})}),g=f0(()=>{if(r.labelId)return[r.labelId,a].join(" ")},[r.labelId,a]),p=m.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:o,id:a,type:zH(e,r.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=r.optionsRef.current)==null?void 0:n.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":g,disabled:r.disabled,onClick:f,onKeyDown:d};return xo({ourProps:v,theirProps:l,slot:p,defaultTag:cW,name:"Combobox.Button"})}let dW="label";function fW(e,t){let n=Tu(),{id:r=`headlessui-combobox-label-${n}`,...i}=e,o=da("Combobox.Label"),s=Au("Combobox.Label"),a=ca(o.labelRef,t);wn(()=>s.registerLabel(r),[r]);let l=mt(()=>{var d;return(d=o.inputRef.current)==null?void 0:d.focus({preventScroll:!0})}),c=m.useMemo(()=>({open:o.comboboxState===0,disabled:o.disabled}),[o]);return xo({ourProps:{ref:a,id:r,onClick:l},theirProps:i,slot:c,defaultTag:dW,name:"Combobox.Label"})}let hW="ul",pW=Yh.RenderStrategy|Yh.Static;function gW(e,t){let n=Tu(),{id:r=`headlessui-combobox-options-${n}`,hold:i=!1,...o}=e,s=da("Combobox.Options"),a=ca(s.optionsRef,t),l=b0(),c=l!==null?(l&Tr.Open)===Tr.Open:s.comboboxState===0;wn(()=>{var p;s.optionsPropsRef.current.static=(p=e.static)!=null?p:!1},[s.optionsPropsRef,e.static]),wn(()=>{s.optionsPropsRef.current.hold=i},[s.optionsPropsRef,i]),HH({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(p){return p.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:p.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(p){p.setAttribute("role","none")}});let d=f0(()=>{var p,v;return(v=s.labelId)!=null?v:(p=s.buttonRef.current)==null?void 0:p.id},[s.labelId,s.buttonRef.current]),f=m.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),g={"aria-labelledby":d,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:r,ref:a};return s.virtual&&s.comboboxState===0&&Object.assign(o,{children:m.createElement(rW,null,o.children)}),xo({ourProps:g,theirProps:o,slot:f,defaultTag:hW,features:pW,visible:c,name:"Combobox.Options"})}let mW="li";function vW(e,t){var n;let r=Tu(),{id:i=`headlessui-combobox-option-${r}`,disabled:o=!1,value:s,order:a=null,...l}=e,c=da("Combobox.Option"),d=Au("Combobox.Option"),f=c.virtual?c.activeOptionIndex===c.calculateIndex(s):c.activeOptionIndex===null?!1:((n=c.options[c.activeOptionIndex])==null?void 0:n.id)===i,g=c.isSelected(s),p=m.useRef(null),v=ji({disabled:o,value:s,domRef:p,order:a}),y=m.useContext($O),x=ca(t,p,y?y.measureElement:null),w=mt(()=>d.onChange(s));wn(()=>d.registerOption(i,v),[v,i]);let S=m.useRef(!(c.virtual||c.__demoMode));wn(()=>{if(!c.virtual||!c.__demoMode)return;let z=la();return z.requestAnimationFrame(()=>{S.current=!0}),z.dispose},[c.virtual,c.__demoMode]),wn(()=>{if(!S.current||c.comboboxState!==0||!f||c.activationTrigger===0)return;let z=la();return z.requestAnimationFrame(()=>{var B,V;(V=(B=p.current)==null?void 0:B.scrollIntoView)==null||V.call(B,{block:"nearest"})}),z.dispose},[p,f,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let C=mt(z=>{var B;if(o||(B=c.virtual)!=null&&B.disabled(s))return z.preventDefault();w(),OO()||requestAnimationFrame(()=>{var V;return(V=c.inputRef.current)==null?void 0:V.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>d.closeCombobox())}),P=mt(()=>{var z;if(o||(z=c.virtual)!=null&&z.disabled(s))return d.goToOption(_n.Nothing);let B=c.calculateIndex(s);d.goToOption(_n.Specific,B)}),O=VH(),k=mt(z=>O.update(z)),A=mt(z=>{var B;if(!O.wasMoved(z)||o||(B=c.virtual)!=null&&B.disabled(s)||f)return;let V=c.calculateIndex(s);d.goToOption(_n.Specific,V,0)}),L=mt(z=>{var B;O.wasMoved(z)&&(o||(B=c.virtual)!=null&&B.disabled(s)||f&&(c.optionsPropsRef.current.hold||d.goToOption(_n.Nothing)))}),F=m.useMemo(()=>({active:f,selected:g,disabled:o}),[f,g,o]);return xo({ourProps:{id:i,ref:x,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":g,disabled:void 0,onClick:C,onFocus:P,onPointerEnter:k,onMouseEnter:k,onPointerMove:A,onMouseMove:A,onPointerLeave:L,onMouseLeave:L},theirProps:l,slot:F,defaultTag:mW,name:"Combobox.Option"})}let bW=zi(sW),yW=zi(uW),xW=zi(lW),wW=zi(fW),_W=zi(gW),SW=zi(vW),Ml=Object.assign(bW,{Input:xW,Button:yW,Label:wW,Options:_W,Option:SW});function _0(){let e=m.useRef(!1);return wn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function CW(e=0){let[t,n]=m.useState(e),r=_0(),i=m.useCallback(l=>{r.current&&n(c=>c|l)},[t,r]),o=m.useCallback(l=>!!(t&l),[t]),s=m.useCallback(l=>{r.current&&n(c=>c&~l)},[n,r]),a=m.useCallback(l=>{r.current&&n(c=>c^l)},[n]);return{flags:t,addFlag:i,hasFlag:o,removeFlag:s,toggleFlag:a}}function EW(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function S0(e,...t){e&&t.length>0&&e.classList.add(...t)}function C0(e,...t){e&&t.length>0&&e.classList.remove(...t)}function OW(e,t){let n=la();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[o,s]=[r,i].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(d=>d.includes("ms")?parseFloat(d):parseFloat(d)*1e3).sort((d,f)=>f-d);return c}),a=o+s;if(a!==0){n.group(c=>{c.setTimeout(()=>{t(),c.dispose()},a),c.addEventListener(e,"transitionrun",d=>{d.target===d.currentTarget&&c.dispose()})});let l=n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),l())})}else t();return n.add(()=>t()),n.dispose}function PW(e,t,n,r){let i=n?"enter":"leave",o=la(),s=r!==void 0?EW(r):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=$n(i,{enter:()=>t.enter,leave:()=>t.leave}),l=$n(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=$n(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return C0(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),S0(e,...t.base,...a,...c),o.nextFrame(()=>{C0(e,...t.base,...a,...c),S0(e,...t.base,...a,...l),OW(e,()=>(C0(e,...t.base,...a),S0(e,...t.base,...t.entered),s()))}),o.dispose}function kW({immediate:e,container:t,direction:n,classes:r,onStart:i,onStop:o}){let s=_0(),a=Du(),l=ji(n);wn(()=>{e&&(l.current="enter")},[e]),wn(()=>{let c=la();a.add(c.dispose);let d=t.current;if(d&&l.current!=="idle"&&s.current)return c.dispose(),i.current(l.current),c.add(PW(d,r.current,l.current==="enter",()=>{c.dispose(),o.current(l.current)})),c.dispose},[n])}function ts(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Xh=m.createContext(null);Xh.displayName="TransitionContext";var MW=(e=>(e.Visible="visible",e.Hidden="hidden",e))(MW||{});function DW(){let e=m.useContext(Xh);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function TW(){let e=m.useContext(Qh);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Qh=m.createContext(null);Qh.displayName="NestingContext";function Zh(e){return"children"in e?Zh(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function FO(e,t){let n=ji(e),r=m.useRef([]),i=_0(),o=Du(),s=mt((p,v=es.Hidden)=>{let y=r.current.findIndex(({el:x})=>x===p);y!==-1&&($n(v,{[es.Unmount](){r.current.splice(y,1)},[es.Hidden](){r.current[y].state="hidden"}}),o.microTask(()=>{var x;!Zh(r)&&i.current&&((x=n.current)==null||x.call(n))}))}),a=mt(p=>{let v=r.current.find(({el:y})=>y===p);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:p,state:"visible"}),()=>s(p,es.Unmount)}),l=m.useRef([]),c=m.useRef(Promise.resolve()),d=m.useRef({enter:[],leave:[],idle:[]}),f=mt((p,v,y)=>{l.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([x])=>x!==p)),t==null||t.chains.current[v].push([p,new Promise(x=>{l.current.push(x)})]),t==null||t.chains.current[v].push([p,new Promise(x=>{Promise.all(d.current[v].map(([w,S])=>S)).then(()=>x())})]),v==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(v)):y(v)}),g=mt((p,v,y)=>{Promise.all(d.current[v].splice(0).map(([x,w])=>w)).then(()=>{var x;(x=l.current.shift())==null||x()}).then(()=>y(v))});return m.useMemo(()=>({children:r,register:a,unregister:s,onStart:f,onStop:g,wait:c,chains:d}),[a,s,r,f,g,d,c])}function AW(){}let IW=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function jO(e){var t;let n={};for(let r of IW)n[r]=(t=e[r])!=null?t:AW;return n}function NW(e){let t=m.useRef(jO(e));return m.useEffect(()=>{t.current=jO(e)},[e]),t}let RW="div",zO=Yh.RenderStrategy;function LW(e,t){var n,r;let{beforeEnter:i,afterEnter:o,beforeLeave:s,afterLeave:a,enter:l,enterFrom:c,enterTo:d,entered:f,leave:g,leaveFrom:p,leaveTo:v,...y}=e,x=m.useRef(null),w=ca(x,t),S=(n=y.unmount)==null||n?es.Unmount:es.Hidden,{show:C,appear:P,initial:O}=DW(),[k,A]=m.useState(C?"visible":"hidden"),L=TW(),{register:F,unregister:z}=L;m.useEffect(()=>F(x),[F,x]),m.useEffect(()=>{if(S===es.Hidden&&x.current){if(C&&k!=="visible"){A("visible");return}return $n(k,{hidden:()=>z(x),visible:()=>F(x)})}},[k,x,F,z,C,S]);let B=ji({base:ts(y.className),enter:ts(l),enterFrom:ts(c),enterTo:ts(d),entered:ts(f),leave:ts(g),leaveFrom:ts(p),leaveTo:ts(v)}),V=NW({beforeEnter:i,afterEnter:o,beforeLeave:s,afterLeave:a}),X=h0();m.useEffect(()=>{if(X&&k==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,k,X]);let K=O&&!P,$=P&&C&&O,J=!X||K?"idle":C?"enter":"leave",G=CW(0),q=mt(ne=>$n(ne,{enter:()=>{G.addFlag(Tr.Opening),V.current.beforeEnter()},leave:()=>{G.addFlag(Tr.Closing),V.current.beforeLeave()},idle:()=>{}})),se=mt(ne=>$n(ne,{enter:()=>{G.removeFlag(Tr.Opening),V.current.afterEnter()},leave:()=>{G.removeFlag(Tr.Closing),V.current.afterLeave()},idle:()=>{}})),D=FO(()=>{A("hidden"),z(x)},L),W=m.useRef(!1);kW({immediate:$,container:x,classes:B,direction:J,onStart:ji(ne=>{W.current=!0,D.onStart(x,ne,q)}),onStop:ji(ne=>{W.current=!1,D.onStop(x,ne,se),ne==="leave"&&!Zh(D)&&(A("hidden"),z(x))})});let re=y,N={ref:w};return $?re={...re,className:Gh(y.className,...B.current.enter,...B.current.enterFrom)}:W.current&&(re.className=Gh(y.className,(r=x.current)==null?void 0:r.className),re.className===""&&delete re.className),m.createElement(Qh.Provider,{value:D},m.createElement(AO,{value:$n(k,{visible:Tr.Open,hidden:Tr.Closed})|G.flags},xo({ourProps:N,theirProps:re,defaultTag:RW,features:zO,visible:k==="visible",name:"Transition.Child"})))}function $W(e,t){let{show:n,appear:r=!1,unmount:i=!0,...o}=e,s=m.useRef(null),a=ca(s,t);h0();let l=b0();if(n===void 0&&l!==null&&(n=(l&Tr.Open)===Tr.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,d]=m.useState(n?"visible":"hidden"),f=FO(()=>{d("hidden")}),[g,p]=m.useState(!0),v=m.useRef([n]);wn(()=>{g!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),p(!1))},[v,n]);let y=m.useMemo(()=>({show:n,appear:r,initial:g}),[n,r,g]);m.useEffect(()=>{if(n)d("visible");else if(!Zh(f))d("hidden");else{let C=s.current;if(!C)return;let P=C.getBoundingClientRect();P.x===0&&P.y===0&&P.width===0&&P.height===0&&d("hidden")}},[n,f]);let x={unmount:i},w=mt(()=>{var C;g&&p(!1),(C=e.beforeEnter)==null||C.call(e)}),S=mt(()=>{var C;g&&p(!1),(C=e.beforeLeave)==null||C.call(e)});return m.createElement(Qh.Provider,{value:f},m.createElement(Xh.Provider,{value:y},xo({ourProps:{...x,as:m.Fragment,children:m.createElement(BO,{ref:a,...x,...o,beforeEnter:w,beforeLeave:S})},theirProps:{},defaultTag:m.Fragment,features:zO,visible:c==="visible",name:"Transition"})))}function FW(e,t){let n=m.useContext(Xh)!==null,r=b0()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(E0,{ref:t,...e}):m.createElement(BO,{ref:t,...e}))}let E0=zi($W),BO=zi(LW),jW=zi(FW),zW=Object.assign(E0,{Child:jW,Root:E0});const O0=["text","varchar","nvarchar","nvarchar2","char","character","nchar","char varying","nchar varying","character varying","string"],Dl=["number","integer","int","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8"],Iu=["date","datetime","time","timestamp","timestamp without time zone"],VO=["boolean"];function HO(e,t,n){const{measures:r,dimensions:i}=e,o=r==null?void 0:r.map(c=>`${c.calc}(${c.name}) as ${c.calc}_${c.name}`).join(", "),s=(i==null?void 0:i.join(", "))||"";let a="";const l=k0(t,n);if(o&&s)return a=`SELECT ${s}, COUNT(*), ${o} FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC LIMIT 100`,a;if(!o&&s)return a=`SELECT ${s}, COUNT(*) FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC LIMIT 100`,a;if(o&&!s)return a=`SELECT ${o} FROM ${l}`,a}function WO(e,t,n="AVG"){var i,o,s,a;let r={};return O0.includes(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(e.column_name))?r={...t,dimensions:(o=t.dimensions)==null?void 0:o.filter(c=>c!==e.column_name)}:r={...t,dimensions:[...t.dimensions||[],e.column_name]}),Dl.includes(e.data_type)&&(((s=t.measures)==null?void 0:s.some(c=>c.name===e.column_name&&c.calc===n))?r={...t,measures:(a=t.measures)==null?void 0:a.filter(c=>!(c.name===e.column_name&&c.calc===n))}:r={...t,measures:[...t.measures||[],{name:e.column_name,calc:n||"SUM"}]}),r}function P0(e){return O0.includes(e.dataType)?"string":Dl.includes(e.dataType)?"number":Iu.includes(e.dataType)?"date":VO.includes(e.dataType)?"boolean":"string"}function BW(e,t){const{dimensions:n,measures:r}=t,i=n==null?void 0:n.includes(e.column_name),o=r==null?void 0:r.some(s=>s.name===e.column_name);return i||o}function k0(e,t){return e==="public"?t:e?`${e}.${t}`:`${t}`}function VW(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[i,o]=e.split(r);return{operation:r,value:o.trim()}}else return null}const qO=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,UO=Ud,GO=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return UO(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(c=>{const d=n==null?void 0:n[c],f=o==null?void 0:o[c];if(d===null)return null;const g=qO(d)||qO(f);return i[c][g]}),a=n&&Object.entries(n).reduce((c,d)=>{let[f,g]=d;return g===void 0||(c[f]=g),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:f,className:g,...p}=d;return Object.entries(p).every(v=>{let[y,x]=v;return Array.isArray(x)?x.includes({...o,...a}[y]):{...o,...a}[y]===x})?[...c,f,g]:c},[]);return UO(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},M0=GO("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"}}),it=ue.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?no:"button";return _.jsx(s,{className:Pe(M0({variant:t,size:n,className:e})),ref:o,...i})});it.displayName="Button";function HW({filter:e}){const[t,n]=m.useState([]),[r,i]=m.useState(""),[o,s]=m.useState(""),a=m.useRef(null),l=be(k=>k.authToken),c=be(k=>k.filterValues),d=be(k=>k.actions.addOrUpdateFilterValue),f=be(k=>k.actions.removeFilterValue),{data:g,isLoading:p,isFetching:v,isError:y,refetch:x}=Sr({queryKey:[e.sql],queryFn:()=>Ts("https://semaphor.cloud/api/v1/query",(l==null?void 0:l.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId&&!!e.database});m.useEffect(()=>{var k;if(c){const A=c.find(L=>L.filterId===e.id);if(!A){n([]);return}if(A.operation==="in"){const L=(k=g==null?void 0:g.records)==null?void 0:k.filter(F=>A.values.includes(F[e.column]));n(L)}else i(`${A.operation} ${A.values[0]}`)}},[]),m.useEffect(()=>{if(c&&!c.find(A=>A.filterId===e.id)){n([]);return}},[c,e.id]);const w=m.useMemo(()=>{var k;return(k=g==null?void 0:g.records)==null?void 0:k.map((A,L)=>({id:L,value:A[e.column.toLowerCase()]}))},[g,e.column]);function S(k){console.log("custom input");const A=VW(k[0].toString());if(!(A!=null&&A.value)||!(A!=null&&A.operation))return;const L={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:P0(e),name:e.column,operation:A.operation,values:[A.value]};d(L)}function C(k){if(console.log("onComboBoxChange",k),k.length===1&&w.find(L=>L.value===k[0].value)===void 0){S(k);return}if(n(k),k.length===0){f(e.id);return}const A={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:P0(e),operation:"in",values:k.map(L=>L.value)};d(A)}function P(){var k;i(""),f(e.id),console.log(e.id),(k=a.current)==null||k.click()}if(p)return _.jsx("div",{children:_.jsx(lf,{className:" bg-foreground/10 h-8 w-[180px]"})});if(y)return _.jsx("div",{className:"bg-muted h-8 w-[180px] px-2",children:"Error"});if(!g)return null;let O=[];return Dl.includes(e.dataType)?O=w:O=o===""?w:w.filter(k=>k.value.toLowerCase().replace(/\s+/g,"").includes(o.toLowerCase().replace(/\s+/g,""))),_.jsx(Ml,{value:t,onChange:C,multiple:!0,children:_.jsxs("div",{className:"relative",children:[_.jsxs("div",{className:" border relative w-full cursor-default overflow-hidden rounded-sm 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:[_.jsx(Ml.Input,{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:k=>k.map(L=>L.value).join(", ")||r,onChange:k=>{i(k.target.value),s(k.target.value)}}),_.jsx(Ml.Button,{ref:a,className:"absolute bg-background pl-1 inset-y-0 right-0 flex items-center pr-2",children:_.jsx(jj,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),_.jsx(zW,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:_.jsxs(Ml.Options,{className:" z-10 absolute mt-1 max-h-60 w-full overflow-auto rounded-sm bg-background py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm border",children:[Dl.includes(e.dataType)&&_.jsxs(Ml.Option,{value:r,className:" flex items-center px-3 justify-between gap-2 py-2",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("span",{className:" font-thin",children:"#"}),_.jsx("span",{children:r})]}),r&&_.jsx(it,{variant:"link",className:" h-4 w-3 text-foreground/50 hover:text-foreground/100 cursor-pointer",onClick:k=>{k.stopPropagation(),P()},children:"Clear"})]}),O.length===0&&o!==""?_.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):O.map(k=>_.jsx(Ml.Option,{className:({active:A})=>`relative cursor-default select-none py-2 pl-10 pr-4 ${A?"bg-muted ":"text-foreground-900"}`,value:k,children:({selected:A,active:L})=>_.jsxs(_.Fragment,{children:[_.jsx("span",{className:`block truncate ${A?"font-medium":"font-normal"}`,children:typeof k.value=="boolean"?k.value?"True":"False":k.value}),A?_.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:_.jsx(ZE,{className:"h-5 w-5","aria-hidden":"true"})}):null]})},k.id))]})})]})})}const YO=m.forwardRef((e,t)=>m.createElement(Be.label,le({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),WW=GO("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),fa=ue.forwardRef(({className:e,...t},n)=>_.jsx(YO,{ref:n,className:Pe(WW(),e),...t}));fa.displayName=YO.displayName;function Ot(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 Ir(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Jn(e,t){const n=Ot(e);return isNaN(t)?Ir(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function yi(e,t){const n=Ot(e);if(isNaN(t))return Ir(e,NaN);if(!t)return n;const r=n.getDate(),i=Ir(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const o=i.getDate();return r>=o?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}const D0=6048e5,qW=864e5;let UW={};function Nu(){return UW}function Bi(e,t){var a,l,c,d;const n=Nu(),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??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,i=Ot(e),o=i.getDay(),s=(o<r?7:0)+o-r;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function ha(e){return Bi(e,{weekStartsOn:1})}function KO(e){const t=Ot(e),n=t.getFullYear(),r=Ir(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=ha(r),o=Ir(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const s=ha(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Tl(e){const t=Ot(e);return t.setHours(0,0,0,0),t}function Jh(e){const t=Ot(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 Vi(e,t){const n=Tl(e),r=Tl(t),i=+n-Jh(n),o=+r-Jh(r);return Math.round((i-o)/qW)}function GW(e){const t=KO(e),n=Ir(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),ha(n)}function T0(e,t){const n=t*7;return Jn(e,n)}function YW(e,t){return yi(e,t*12)}function KW(e){let t;return e.forEach(function(n){const r=Ot(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function XW(e){let t;return e.forEach(n=>{const r=Ot(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function dr(e,t){const n=Tl(e),r=Tl(t);return+n==+r}function A0(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function QW(e){if(!A0(e)&&typeof e!="number")return!1;const t=Ot(e);return!isNaN(Number(t))}function Ru(e,t){const n=Ot(e),r=Ot(t),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return i*12+o}function ZW(e,t,n){const r=Bi(e,n),i=Bi(t,n),o=+r-Jh(r),s=+i-Jh(i);return Math.round((o-s)/D0)}function I0(e){const t=Ot(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function fr(e){const t=Ot(e);return t.setDate(1),t.setHours(0,0,0,0),t}function XO(e){const t=Ot(e),n=Ir(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function N0(e,t){var a,l,c,d;const n=Nu(),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??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,i=Ot(e),o=i.getDay(),s=(o<r?-7:0)+6-(o-r);return i.setDate(i.getDate()+s),i.setHours(23,59,59,999),i}function QO(e){return N0(e,{weekStartsOn:1})}const JW={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"}},e6=(e,t,n)=>{let r;const i=JW[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function R0(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const t6={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},n6={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},r6={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},i6={date:R0({formats:t6,defaultWidth:"full"}),time:R0({formats:n6,defaultWidth:"full"}),dateTime:R0({formats:r6,defaultWidth:"full"})},o6={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},s6=(e,t,n,r)=>o6[e];function Lu(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;i=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[s]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const a6={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},l6={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},c6={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"]},u6={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"]},d6={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"}},f6={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"}},h6={ordinalNumber:(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"},era:Lu({values:a6,defaultWidth:"wide"}),quarter:Lu({values:l6,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Lu({values:c6,defaultWidth:"wide"}),day:Lu({values:u6,defaultWidth:"wide"}),dayPeriod:Lu({values:d6,defaultWidth:"wide",formattingValues:f6,defaultFormattingWidth:"wide"})};function $u(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?g6(a,f=>f.test(s)):p6(a,f=>f.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(s.length);return{value:c,rest:d}}}function p6(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function g6(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function m6(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let s=e.valueCallback?e.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(i.length);return{value:s,rest:a}}}const v6=/^(\d+)(th|st|nd|rd)?/i,b6=/\d+/i,y6={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},x6={any:[/^b/i,/^(a|c)/i]},w6={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},_6={any:[/1/i,/2/i,/3/i,/4/i]},S6={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},C6={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]},E6={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},O6={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]},P6={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},k6={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}},M6={ordinalNumber:m6({matchPattern:v6,parsePattern:b6,valueCallback:e=>parseInt(e,10)}),era:$u({matchPatterns:y6,defaultMatchWidth:"wide",parsePatterns:x6,defaultParseWidth:"any"}),quarter:$u({matchPatterns:w6,defaultMatchWidth:"wide",parsePatterns:_6,defaultParseWidth:"any",valueCallback:e=>e+1}),month:$u({matchPatterns:S6,defaultMatchWidth:"wide",parsePatterns:C6,defaultParseWidth:"any"}),day:$u({matchPatterns:E6,defaultMatchWidth:"wide",parsePatterns:O6,defaultParseWidth:"any"}),dayPeriod:$u({matchPatterns:P6,defaultMatchWidth:"any",parsePatterns:k6,defaultParseWidth:"any"})},ZO={code:"en-US",formatDistance:e6,formatLong:i6,formatRelative:s6,localize:h6,match:M6,options:{weekStartsOn:0,firstWeekContainsDate:1}};function D6(e){const t=Ot(e);return Vi(t,XO(t))+1}function JO(e){const t=Ot(e),n=+ha(t)-+GW(t);return Math.round(n/D0)+1}function eP(e,t){var d,f,g,p;const n=Ot(e),r=n.getFullYear(),i=Nu(),o=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??i.firstWeekContainsDate??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.firstWeekContainsDate)??1,s=Ir(e,0);s.setFullYear(r+1,0,o),s.setHours(0,0,0,0);const a=Bi(s,t),l=Ir(e,0);l.setFullYear(r,0,o),l.setHours(0,0,0,0);const c=Bi(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function T6(e,t){var a,l,c,d;const n=Nu(),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??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,i=eP(e,t),o=Ir(e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),Bi(o,t)}function tP(e,t){const n=Ot(e),r=+Bi(n,t)-+T6(n,t);return Math.round(r/D0)+1}function $t(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ns={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return $t(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):$t(n+1,2)},d(e,t){return $t(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 $t(e.getHours()%12||12,t.length)},H(e,t){return $t(e.getHours(),t.length)},m(e,t){return $t(e.getMinutes(),t.length)},s(e,t){return $t(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return $t(i,t.length)}},Al={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},nP={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return ns.y(e,t)},Y:function(e,t,n,r){const i=eP(e,r),o=i>0?i:1-i;if(t==="YY"){const s=o%100;return $t(s,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):$t(o,t.length)},R:function(e,t){const n=KO(e);return $t(n,t.length)},u:function(e,t){const n=e.getFullYear();return $t(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 $t(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 $t(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 ns.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 $t(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=tP(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):$t(i,t.length)},I:function(e,t,n){const r=JO(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):$t(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ns.d(e,t)},D:function(e,t,n){const r=D6(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):$t(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return $t(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return $t(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return $t(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Al.noon:r===0?i=Al.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Al.evening:r>=12?i=Al.afternoon:r>=4?i=Al.morning:i=Al.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ns.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ns.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):$t(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):$t(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ns.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ns.s(e,t)},S:function(e,t){return ns.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return iP(r);case"XXXX":case"XX":return pa(r);case"XXXXX":case"XXX":default:return pa(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return iP(r);case"xxxx":case"xx":return pa(r);case"xxxxx":case"xxx":default:return pa(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+rP(r,":");case"OOOO":default:return"GMT"+pa(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+rP(r,":");case"zzzz":default:return"GMT"+pa(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return $t(r,t.length)},T:function(e,t,n){const r=e.getTime();return $t(r,t.length)}};function rP(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+$t(o,2)}function iP(e,t){return e%60===0?(e>0?"-":"+")+$t(Math.abs(e)/60,2):pa(e,t)}function pa(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=$t(Math.trunc(r/60),2),o=$t(r%60,2);return n+i+t+o}const oP=(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"})}},sP=(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"})}},A6={p:sP,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return oP(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",oP(r,t)).replace("{{time}}",sP(i,t))}},I6=/^D+$/,N6=/^Y+$/,R6=["D","DD","YY","YYYY"];function L6(e){return I6.test(e)}function $6(e){return N6.test(e)}function F6(e,t,n){const r=j6(e,t,n);if(console.warn(r),R6.includes(e))throw new RangeError(r)}function j6(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 z6=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,B6=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,V6=/^'([^]*?)'?$/,H6=/''/g,W6=/[a-zA-Z]/;function Hi(e,t,n){var d,f,g,p,v,y,x,w;const r=Nu(),i=(n==null?void 0:n.locale)??r.locale??ZO,o=(n==null?void 0:n.firstWeekContainsDate)??((f=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(g=r.locale)==null?void 0:g.options)==null?void 0:p.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((y=(v=n==null?void 0:n.locale)==null?void 0:v.options)==null?void 0:y.weekStartsOn)??r.weekStartsOn??((w=(x=r.locale)==null?void 0:x.options)==null?void 0:w.weekStartsOn)??0,a=Ot(e);if(!QW(a))throw new RangeError("Invalid time value");let l=t.match(B6).map(S=>{const C=S[0];if(C==="p"||C==="P"){const P=A6[C];return P(S,i.formatLong)}return S}).join("").match(z6).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const C=S[0];if(C==="'")return{isToken:!1,value:q6(S)};if(nP[C])return{isToken:!0,value:S};if(C.match(W6))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:S}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:i};return l.map(S=>{if(!S.isToken)return S.value;const C=S.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&$6(C)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&L6(C))&&F6(C,t,String(e));const P=nP[C[0]];return P(a,C,i.localize,c)}).join("")}function q6(e){const t=e.match(V6);return t?t[1].replace(H6,"'"):e}function U6(e){const t=Ot(e),n=t.getFullYear(),r=t.getMonth(),i=Ir(e,0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function G6(e){return Math.trunc(+Ot(e)/1e3)}function Y6(e){const t=Ot(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function K6(e,t){return ZW(Y6(e),fr(e),t)+1}function L0(e,t){const n=Ot(e),r=Ot(t);return n.getTime()>r.getTime()}function aP(e,t){const n=Ot(e),r=Ot(t);return+n<+r}function $0(e,t){const n=Ot(e),r=Ot(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function X6(e,t){const n=Ot(e),r=Ot(t);return n.getFullYear()===r.getFullYear()}function F0(e,t){return Jn(e,-t)}function j0(e,t){const n=Ot(e),r=n.getFullYear(),i=n.getDate(),o=Ir(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const s=U6(o);return n.setMonth(t,Math.min(i,s)),n}function lP(e,t){const n=Ot(e);return isNaN(+n)?Ir(e,NaN):(n.setFullYear(t),n)}var Ue=function(){return Ue=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Ue.apply(this,arguments)};function Q6(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function cP(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var z0={exports:{}},Fu={};/**
|
|
362
|
+
* @license React
|
|
363
|
+
* react-jsx-runtime.development.js
|
|
364
|
+
*
|
|
365
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
366
|
+
*
|
|
367
|
+
* This source code is licensed under the MIT license found in the
|
|
368
|
+
* LICENSE file in the root directory of this source tree.
|
|
369
|
+
*/var uP;function Z6(){return uP||(uP=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),v=Symbol.iterator,y="@@iterator";function x(M){if(M===null||typeof M!="object")return null;var Y=v&&M[v]||M[y];return typeof Y=="function"?Y:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(M){{for(var Y=arguments.length,ae=new Array(Y>1?Y-1:0),Se=1;Se<Y;Se++)ae[Se-1]=arguments[Se];C("error",M,ae)}}function C(M,Y,ae){{var Se=w.ReactDebugCurrentFrame,Re=Se.getStackAddendum();Re!==""&&(Y+="%s",ae=ae.concat([Re]));var je=ae.map(function(Ae){return String(Ae)});je.unshift("Warning: "+Y),Function.prototype.apply.call(console[M],console,je)}}var P=!1,O=!1,k=!1,A=!1,L=!1,F;F=Symbol.for("react.module.reference");function z(M){return!!(typeof M=="string"||typeof M=="function"||M===r||M===o||L||M===i||M===c||M===d||A||M===p||P||O||k||typeof M=="object"&&M!==null&&(M.$$typeof===g||M.$$typeof===f||M.$$typeof===s||M.$$typeof===a||M.$$typeof===l||M.$$typeof===F||M.getModuleId!==void 0))}function B(M,Y,ae){var Se=M.displayName;if(Se)return Se;var Re=Y.displayName||Y.name||"";return Re!==""?ae+"("+Re+")":ae}function V(M){return M.displayName||"Context"}function X(M){if(M==null)return null;if(typeof M.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case d:return"SuspenseList"}if(typeof M=="object")switch(M.$$typeof){case a:var Y=M;return V(Y)+".Consumer";case s:var ae=M;return V(ae._context)+".Provider";case l:return B(M,M.render,"ForwardRef");case f:var Se=M.displayName||null;return Se!==null?Se:X(M.type)||"Memo";case g:{var Re=M,je=Re._payload,Ae=Re._init;try{return X(Ae(je))}catch{return null}}}return null}var K=Object.assign,$=0,J,G,q,se,D,W,re;function N(){}N.__reactDisabledLog=!0;function ne(){{if($===0){J=console.log,G=console.info,q=console.warn,se=console.error,D=console.group,W=console.groupCollapsed,re=console.groupEnd;var M={configurable:!0,enumerable:!0,value:N,writable:!0};Object.defineProperties(console,{info:M,log:M,warn:M,error:M,group:M,groupCollapsed:M,groupEnd:M})}$++}}function ge(){{if($--,$===0){var M={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:K({},M,{value:J}),info:K({},M,{value:G}),warn:K({},M,{value:q}),error:K({},M,{value:se}),group:K({},M,{value:D}),groupCollapsed:K({},M,{value:W}),groupEnd:K({},M,{value:re})})}$<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var he=w.ReactCurrentDispatcher,de;function ie(M,Y,ae){{if(de===void 0)try{throw Error()}catch(Re){var Se=Re.stack.trim().match(/\n( *(at )?)/);de=Se&&Se[1]||""}return`
|
|
370
|
+
`+de+M}}var ee=!1,H;{var ye=typeof WeakMap=="function"?WeakMap:Map;H=new ye}function oe(M,Y){if(!M||ee)return"";{var ae=H.get(M);if(ae!==void 0)return ae}var Se;ee=!0;var Re=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var je;je=he.current,he.current=null,ne();try{if(Y){var Ae=function(){throw Error()};if(Object.defineProperty(Ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ae,[])}catch(nn){Se=nn}Reflect.construct(M,[],Ae)}else{try{Ae.call()}catch(nn){Se=nn}M.call(Ae.prototype)}}else{try{throw Error()}catch(nn){Se=nn}M()}}catch(nn){if(nn&&Se&&typeof nn.stack=="string"){for(var Me=nn.stack.split(`
|
|
371
|
+
`),Pt=Se.stack.split(`
|
|
372
|
+
`),Ze=Me.length-1,nt=Pt.length-1;Ze>=1&&nt>=0&&Me[Ze]!==Pt[nt];)nt--;for(;Ze>=1&&nt>=0;Ze--,nt--)if(Me[Ze]!==Pt[nt]){if(Ze!==1||nt!==1)do if(Ze--,nt--,nt<0||Me[Ze]!==Pt[nt]){var zt=`
|
|
373
|
+
`+Me[Ze].replace(" at new "," at ");return M.displayName&&zt.includes("<anonymous>")&&(zt=zt.replace("<anonymous>",M.displayName)),typeof M=="function"&&H.set(M,zt),zt}while(Ze>=1&&nt>=0);break}}}finally{ee=!1,he.current=je,ge(),Error.prepareStackTrace=Re}var Tn=M?M.displayName||M.name:"",Ha=Tn?ie(Tn):"";return typeof M=="function"&&H.set(M,Ha),Ha}function Te(M,Y,ae){return oe(M,!1)}function Fe(M){var Y=M.prototype;return!!(Y&&Y.isReactComponent)}function He(M,Y,ae){if(M==null)return"";if(typeof M=="function")return oe(M,Fe(M));if(typeof M=="string")return ie(M);switch(M){case c:return ie("Suspense");case d:return ie("SuspenseList")}if(typeof M=="object")switch(M.$$typeof){case l:return Te(M.render);case f:return He(M.type,Y,ae);case g:{var Se=M,Re=Se._payload,je=Se._init;try{return He(je(Re),Y,ae)}catch{}}}return""}var Ke=Object.prototype.hasOwnProperty,St={},vt=w.ReactDebugCurrentFrame;function bt(M){if(M){var Y=M._owner,ae=He(M.type,M._source,Y?Y.type:null);vt.setExtraStackFrame(ae)}else vt.setExtraStackFrame(null)}function tn(M,Y,ae,Se,Re){{var je=Function.call.bind(Ke);for(var Ae in M)if(je(M,Ae)){var Me=void 0;try{if(typeof M[Ae]!="function"){var Pt=Error((Se||"React class")+": "+ae+" type `"+Ae+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof M[Ae]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Pt.name="Invariant Violation",Pt}Me=M[Ae](Y,Ae,Se,ae,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ze){Me=Ze}Me&&!(Me instanceof Error)&&(bt(Re),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Se||"React class",ae,Ae,typeof Me),bt(null)),Me instanceof Error&&!(Me.message in St)&&(St[Me.message]=!0,bt(Re),S("Failed %s type: %s",ae,Me.message),bt(null))}}}var Jt=Array.isArray;function Dn(M){return Jt(M)}function fn(M){{var Y=typeof Symbol=="function"&&Symbol.toStringTag,ae=Y&&M[Symbol.toStringTag]||M.constructor.name||"Object";return ae}}function Na(M){try{return fe(M),!1}catch{return!0}}function fe(M){return""+M}function Oe(M){if(Na(M))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",fn(M)),fe(M)}var Le=w.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},yt,hn,Cn;Cn={};function Fn(M){if(Ke.call(M,"ref")){var Y=Object.getOwnPropertyDescriptor(M,"ref").get;if(Y&&Y.isReactWarning)return!1}return M.ref!==void 0}function Br(M){if(Ke.call(M,"key")){var Y=Object.getOwnPropertyDescriptor(M,"key").get;if(Y&&Y.isReactWarning)return!1}return M.key!==void 0}function Vr(M,Y){if(typeof M.ref=="string"&&Le.current&&Y&&Le.current.stateNode!==Y){var ae=X(Le.current.type);Cn[ae]||(S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',X(Le.current.type),M.ref),Cn[ae]=!0)}}function pn(M,Y){{var ae=function(){yt||(yt=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Y))};ae.isReactWarning=!0,Object.defineProperty(M,"key",{get:ae,configurable:!0})}}function mr(M,Y){{var ae=function(){hn||(hn=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Y))};ae.isReactWarning=!0,Object.defineProperty(M,"ref",{get:ae,configurable:!0})}}var jn=function(M,Y,ae,Se,Re,je,Ae){var Me={$$typeof:t,type:M,key:Y,ref:ae,props:Ae,_owner:je};return Me._store={},Object.defineProperty(Me._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Me,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Se}),Object.defineProperty(Me,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Re}),Object.freeze&&(Object.freeze(Me.props),Object.freeze(Me)),Me};function Cd(M,Y,ae,Se,Re){{var je,Ae={},Me=null,Pt=null;ae!==void 0&&(Oe(ae),Me=""+ae),Br(Y)&&(Oe(Y.key),Me=""+Y.key),Fn(Y)&&(Pt=Y.ref,Vr(Y,Re));for(je in Y)Ke.call(Y,je)&&!Xe.hasOwnProperty(je)&&(Ae[je]=Y[je]);if(M&&M.defaultProps){var Ze=M.defaultProps;for(je in Ze)Ae[je]===void 0&&(Ae[je]=Ze[je])}if(Me||Pt){var nt=typeof M=="function"?M.displayName||M.name||"Unknown":M;Me&&pn(Ae,nt),Pt&&mr(Ae,nt)}return jn(M,Me,Pt,Re,Se,Le.current,Ae)}}var So=w.ReactCurrentOwner,Ra=w.ReactDebugCurrentFrame;function Yn(M){if(M){var Y=M._owner,ae=He(M.type,M._source,Y?Y.type:null);Ra.setExtraStackFrame(ae)}else Ra.setExtraStackFrame(null)}var Zi;Zi=!1;function Co(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function La(){{if(So.current){var M=X(So.current.type);if(M)return`
|
|
374
|
+
|
|
375
|
+
Check the render method of \``+M+"`."}return""}}function Ed(M){{if(M!==void 0){var Y=M.fileName.replace(/^.*[\\\/]/,""),ae=M.lineNumber;return`
|
|
376
|
+
|
|
377
|
+
Check your code at `+Y+":"+ae+"."}return""}}var $a={};function fc(M){{var Y=La();if(!Y){var ae=typeof M=="string"?M:M.displayName||M.name;ae&&(Y=`
|
|
378
|
+
|
|
379
|
+
Check the top-level render call using <`+ae+">.")}return Y}}function Fa(M,Y){{if(!M._store||M._store.validated||M.key!=null)return;M._store.validated=!0;var ae=fc(Y);if($a[ae])return;$a[ae]=!0;var Se="";M&&M._owner&&M._owner!==So.current&&(Se=" It was passed a child from "+X(M._owner.type)+"."),Yn(M),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ae,Se),Yn(null)}}function ja(M,Y){{if(typeof M!="object")return;if(Dn(M))for(var ae=0;ae<M.length;ae++){var Se=M[ae];Co(Se)&&Fa(Se,Y)}else if(Co(M))M._store&&(M._store.validated=!0);else if(M){var Re=x(M);if(typeof Re=="function"&&Re!==M.entries)for(var je=Re.call(M),Ae;!(Ae=je.next()).done;)Co(Ae.value)&&Fa(Ae.value,Y)}}}function Od(M){{var Y=M.type;if(Y==null||typeof Y=="string")return;var ae;if(typeof Y=="function")ae=Y.propTypes;else if(typeof Y=="object"&&(Y.$$typeof===l||Y.$$typeof===f))ae=Y.propTypes;else return;if(ae){var Se=X(Y);tn(ae,M.props,"prop",Se,M)}else if(Y.PropTypes!==void 0&&!Zi){Zi=!0;var Re=X(Y);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Re||"Unknown")}typeof Y.getDefaultProps=="function"&&!Y.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function za(M){{for(var Y=Object.keys(M.props),ae=0;ae<Y.length;ae++){var Se=Y[ae];if(Se!=="children"&&Se!=="key"){Yn(M),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Se),Yn(null);break}}M.ref!==null&&(Yn(M),S("Invalid attribute `ref` supplied to `React.Fragment`."),Yn(null))}}function Ba(M,Y,ae,Se,Re,je){{var Ae=z(M);if(!Ae){var Me="";(M===void 0||typeof M=="object"&&M!==null&&Object.keys(M).length===0)&&(Me+=" 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 Pt=Ed(Re);Pt?Me+=Pt:Me+=La();var Ze;M===null?Ze="null":Dn(M)?Ze="array":M!==void 0&&M.$$typeof===t?(Ze="<"+(X(M.type)||"Unknown")+" />",Me=" Did you accidentally export a JSX literal instead of a component?"):Ze=typeof M,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ze,Me)}var nt=Cd(M,Y,ae,Re,je);if(nt==null)return nt;if(Ae){var zt=Y.children;if(zt!==void 0)if(Se)if(Dn(zt)){for(var Tn=0;Tn<zt.length;Tn++)ja(zt[Tn],M);Object.freeze&&Object.freeze(zt)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ja(zt,M)}return M===r?za(nt):Od(nt),nt}}function Va(M,Y,ae){return Ba(M,Y,ae,!0)}function Pd(M,Y,ae){return Ba(M,Y,ae,!1)}var kd=Pd,Md=Va;Fu.Fragment=r,Fu.jsx=kd,Fu.jsxs=Md}()),Fu}var ju={};/**
|
|
380
|
+
* @license React
|
|
381
|
+
* react-jsx-runtime.production.min.js
|
|
382
|
+
*
|
|
383
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
384
|
+
*
|
|
385
|
+
* This source code is licensed under the MIT license found in the
|
|
386
|
+
* LICENSE file in the root directory of this source tree.
|
|
387
|
+
*/var dP;function J6(){if(dP)return ju;dP=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var d,f={},g=null,p=null;c!==void 0&&(g=""+c),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(p=l.ref);for(d in l)r.call(l,d)&&!o.hasOwnProperty(d)&&(f[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)f[d]===void 0&&(f[d]=l[d]);return{$$typeof:t,type:a,key:g,ref:p,props:f,_owner:i.current}}return ju.Fragment=n,ju.jsx=s,ju.jsxs=s,ju}process.env.NODE_ENV==="production"?z0.exports=J6():z0.exports=Z6();var xe=z0.exports;function zu(e){return e.mode==="multiple"}function Bu(e){return e.mode==="range"}function ep(e){return e.mode==="single"}var eq={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function tq(e,t){return Hi(e,"LLLL y",t)}function nq(e,t){return Hi(e,"d",t)}function rq(e,t){return Hi(e,"LLLL",t)}function iq(e){return"".concat(e)}function oq(e,t){return Hi(e,"cccccc",t)}function sq(e,t){return Hi(e,"yyyy",t)}var aq=Object.freeze({__proto__:null,formatCaption:tq,formatDay:nq,formatMonthCaption:rq,formatWeekNumber:iq,formatWeekdayName:oq,formatYearCaption:sq}),lq=function(e,t,n){return Hi(e,"do MMMM (EEEE)",n)},cq=function(){return"Month: "},uq=function(){return"Go to next month"},dq=function(){return"Go to previous month"},fq=function(e,t){return Hi(e,"cccc",t)},hq=function(e){return"Week n. ".concat(e)},pq=function(){return"Year: "},gq=Object.freeze({__proto__:null,labelDay:lq,labelMonthDropdown:cq,labelNext:uq,labelPrevious:dq,labelWeekNumber:hq,labelWeekday:fq,labelYearDropdown:pq});function mq(){var e="buttons",t=eq,n=ZO,r={},i={},o=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:aq,labels:gq,locale:n,modifiersClassNames:r,modifiers:i,numberOfMonths:o,styles:s,today:a,mode:"default"}}function vq(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,i=e.toMonth,o=e.fromDate,s=e.toDate;return r?o=fr(r):t&&(o=new Date(t,0,1)),i?s=I0(i):n&&(s=new Date(n,11,31)),{fromDate:o?Tl(o):void 0,toDate:s?Tl(s):void 0}}var fP=m.createContext(void 0);function bq(e){var t,n=e.initialProps,r=mq(),i=vq(n),o=i.fromDate,s=i.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!o||!s)&&(a="buttons");var l;(ep(n)||zu(n)||Bu(n))&&(l=n.onSelect);var c=Ue(Ue(Ue({},r),n),{captionLayout:a,classNames:Ue(Ue({},r.classNames),n.classNames),components:Ue({},n.components),formatters:Ue(Ue({},r.formatters),n.formatters),fromDate:o,labels:Ue(Ue({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Ue(Ue({},r.modifiers),n.modifiers),modifiersClassNames:Ue(Ue({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Ue(Ue({},r.styles),n.styles),toDate:s});return xe.jsx(fP.Provider,{value:c,children:e.children})}function Vt(){var e=m.useContext(fP);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function hP(e){var t=Vt(),n=t.locale,r=t.classNames,i=t.styles,o=t.formatters.formatCaption;return xe.jsx("div",{className:r.caption_label,style:i.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:o(e.displayMonth,{locale:n})})}function yq(e){return xe.jsx("svg",Ue({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:xe.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function pP(e){var t,n,r=e.onChange,i=e.value,o=e.children,s=e.caption,a=e.className,l=e.style,c=Vt(),d=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:yq;return xe.jsxs("div",{className:a,style:l,children:[xe.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),xe.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:i,onChange:r,children:o}),xe.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,xe.jsx(d,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function xq(e){var t,n=Vt(),r=n.fromDate,i=n.toDate,o=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,d=n.labels.labelMonthDropdown;if(!r)return xe.jsx(xe.Fragment,{});if(!i)return xe.jsx(xe.Fragment,{});var f=[];if(X6(r,i))for(var g=fr(r),p=r.getMonth();p<=i.getMonth();p++)f.push(j0(g,p));else for(var g=fr(new Date),p=0;p<=11;p++)f.push(j0(g,p));var v=function(x){var w=Number(x.target.value),S=j0(fr(e.displayMonth),w);e.onChange(S)},y=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:pP;return xe.jsx(y,{name:"months","aria-label":d(),className:l.dropdown_month,style:o.dropdown_month,onChange:v,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:f.map(function(x){return xe.jsx("option",{value:x.getMonth(),children:a(x,{locale:s})},x.getMonth())})})}function wq(e){var t,n=e.displayMonth,r=Vt(),i=r.fromDate,o=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,d=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,g=[];if(!i)return xe.jsx(xe.Fragment,{});if(!o)return xe.jsx(xe.Fragment,{});for(var p=i.getFullYear(),v=o.getFullYear(),y=p;y<=v;y++)g.push(lP(XO(new Date),y));var x=function(S){var C=lP(fr(n),Number(S.target.value));e.onChange(C)},w=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:pP;return xe.jsx(w,{name:"years","aria-label":f(),className:l.dropdown_year,style:a.dropdown_year,onChange:x,value:n.getFullYear(),caption:d(n,{locale:s}),children:g.map(function(S){return xe.jsx("option",{value:S.getFullYear(),children:d(S,{locale:s})},S.getFullYear())})})}function _q(e,t){var n=m.useState(e),r=n[0],i=n[1],o=t===void 0?r:t;return[o,i]}function Sq(e){var t=e.month,n=e.defaultMonth,r=e.today,i=t||n||r||new Date,o=e.toDate,s=e.fromDate,a=e.numberOfMonths,l=a===void 0?1:a;if(o&&Ru(o,i)<0){var c=-1*(l-1);i=yi(o,c)}return s&&Ru(i,s)<0&&(i=s),fr(i)}function Cq(){var e=Vt(),t=Sq(e),n=_q(t,e.month),r=n[0],i=n[1],o=function(s){var a;if(!e.disableNavigation){var l=fr(s);i(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,o]}function Eq(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,i=fr(e),o=fr(yi(i,r)),s=Ru(o,i),a=[],l=0;l<s;l++){var c=yi(i,l);a.push(c)}return n&&(a=a.reverse()),a}function Oq(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,i=t.numberOfMonths,o=i===void 0?1:i,s=r?o:1,a=fr(e);if(!n)return yi(a,s);var l=Ru(n,e);if(!(l<o))return yi(a,s)}}function Pq(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,i=t.numberOfMonths,o=i===void 0?1:i,s=r?o:1,a=fr(e);if(!n)return yi(a,-s);var l=Ru(a,n);if(!(l<=0))return yi(a,-s)}}var gP=m.createContext(void 0);function kq(e){var t=Vt(),n=Cq(),r=n[0],i=n[1],o=Eq(r,t),s=Oq(r,t),a=Pq(r,t),l=function(f){return o.some(function(g){return $0(f,g)})},c=function(f,g){l(f)||(g&&aP(f,g)?i(yi(f,1+t.numberOfMonths*-1)):i(f))},d={currentMonth:r,displayMonths:o,goToMonth:i,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return xe.jsx(gP.Provider,{value:d,children:e.children})}function Vu(){var e=m.useContext(gP);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function mP(e){var t,n=Vt(),r=n.classNames,i=n.styles,o=n.components,s=Vu().goToMonth,a=function(d){s(yi(d,e.displayIndex?-e.displayIndex:0))},l=(t=o==null?void 0:o.CaptionLabel)!==null&&t!==void 0?t:hP,c=xe.jsx(l,{id:e.id,displayMonth:e.displayMonth});return xe.jsxs("div",{className:r.caption_dropdowns,style:i.caption_dropdowns,children:[xe.jsx("div",{className:r.vhidden,children:c}),xe.jsx(xq,{onChange:a,displayMonth:e.displayMonth}),xe.jsx(wq,{onChange:a,displayMonth:e.displayMonth})]})}function Mq(e){return xe.jsx("svg",Ue({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:xe.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Dq(e){return xe.jsx("svg",Ue({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:xe.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var tp=m.forwardRef(function(e,t){var n=Vt(),r=n.classNames,i=n.styles,o=[r.button_reset,r.button];e.className&&o.push(e.className);var s=o.join(" "),a=Ue(Ue({},i.button_reset),i.button);return e.style&&Object.assign(a,e.style),xe.jsx("button",Ue({},e,{ref:t,type:"button",className:s,style:a}))});function Tq(e){var t,n,r=Vt(),i=r.dir,o=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,d=l.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return xe.jsx(xe.Fragment,{});var g=c(e.previousMonth,{locale:o}),p=[s.nav_button,s.nav_button_previous].join(" "),v=d(e.nextMonth,{locale:o}),y=[s.nav_button,s.nav_button_next].join(" "),x=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:Dq,w=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:Mq;return xe.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&xe.jsx(tp,{name:"previous-month","aria-label":g,className:p,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:i==="rtl"?xe.jsx(x,{className:s.nav_icon,style:a.nav_icon}):xe.jsx(w,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&xe.jsx(tp,{name:"next-month","aria-label":v,className:y,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:i==="rtl"?xe.jsx(w,{className:s.nav_icon,style:a.nav_icon}):xe.jsx(x,{className:s.nav_icon,style:a.nav_icon})})]})}function vP(e){var t=Vt().numberOfMonths,n=Vu(),r=n.previousMonth,i=n.nextMonth,o=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(v){return $0(e.displayMonth,v)}),l=a===0,c=a===s.length-1,d=t>1&&(l||!c),f=t>1&&(c||!l),g=function(){r&&o(r)},p=function(){i&&o(i)};return xe.jsx(Tq,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:f,nextMonth:i,previousMonth:r,onPreviousClick:g,onNextClick:p})}function Aq(e){var t,n=Vt(),r=n.classNames,i=n.disableNavigation,o=n.styles,s=n.captionLayout,a=n.components,l=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:hP,c;return i?c=xe.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=xe.jsx(mP,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=xe.jsxs(xe.Fragment,{children:[xe.jsx(mP,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),xe.jsx(vP,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=xe.jsxs(xe.Fragment,{children:[xe.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),xe.jsx(vP,{displayMonth:e.displayMonth,id:e.id})]}),xe.jsx("div",{className:r.caption,style:o.caption,children:c})}function Iq(e){var t=Vt(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?xe.jsx("tfoot",{className:i,style:r.tfoot,children:xe.jsx("tr",{children:xe.jsx("td",{colSpan:8,children:n})})}):xe.jsx(xe.Fragment,{})}function Nq(e,t,n){for(var r=n?ha(new Date):Bi(new Date,{locale:e,weekStartsOn:t}),i=[],o=0;o<7;o++){var s=Jn(r,o);i.push(s)}return i}function Rq(){var e=Vt(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,o=e.weekStartsOn,s=e.ISOWeek,a=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=Nq(i,o,s);return xe.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&xe.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(d,f){return xe.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(d,{locale:i}),children:a(d,{locale:i})},f)})]})}function Lq(){var e,t=Vt(),n=t.classNames,r=t.styles,i=t.components,o=(e=i==null?void 0:i.HeadRow)!==null&&e!==void 0?e:Rq;return xe.jsx("thead",{style:r.head,className:n.head,children:xe.jsx(o,{})})}function $q(e){var t=Vt(),n=t.locale,r=t.formatters.formatDay;return xe.jsx(xe.Fragment,{children:r(e.date,{locale:n})})}var B0=m.createContext(void 0);function Fq(e){if(!zu(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return xe.jsx(B0.Provider,{value:t,children:e.children})}return xe.jsx(jq,{initialProps:e.initialProps,children:e.children})}function jq(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,o=t.max,s=function(c,d,f){var g,p;(g=t.onDayClick)===null||g===void 0||g.call(t,c,d,f);var v=!!(d.selected&&i&&(r==null?void 0:r.length)===i);if(!v){var y=!!(!d.selected&&o&&(r==null?void 0:r.length)===o);if(!y){var x=r?cP([],r,!0):[];if(d.selected){var w=x.findIndex(function(S){return dr(c,S)});x.splice(w,1)}else x.push(c);(p=t.onSelect)===null||p===void 0||p.call(t,x,c,d,f)}}},a={disabled:[]};r&&a.disabled.push(function(c){var d=o&&r.length>o-1,f=r.some(function(g){return dr(g,c)});return!!(d&&!f)});var l={selected:r,onDayClick:s,modifiers:a};return xe.jsx(B0.Provider,{value:l,children:n})}function V0(){var e=m.useContext(B0);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function zq(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?dr(i,e)&&dr(r,e)?void 0:dr(i,e)?{from:i,to:void 0}:dr(r,e)?void 0:L0(r,e)?{from:e,to:i}:{from:r,to:e}:i?L0(e,i)?{from:i,to:e}:{from:e,to:i}:r?aP(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var H0=m.createContext(void 0);function Bq(e){if(!Bu(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return xe.jsx(H0.Provider,{value:t,children:e.children})}return xe.jsx(Vq,{initialProps:e.initialProps,children:e.children})}function Vq(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},o=i.from,s=i.to,a=t.min,l=t.max,c=function(p,v,y){var x,w;(x=t.onDayClick)===null||x===void 0||x.call(t,p,v,y);var S=zq(p,r);(w=t.onSelect)===null||w===void 0||w.call(t,S,p,v,y)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(d.range_start=[o],s?(d.range_end=[s],dr(o,s)||(d.range_middle=[{after:o,before:s}])):d.range_end=[o]):s&&(d.range_start=[s],d.range_end=[s]),a&&(o&&!s&&d.disabled.push({after:F0(o,a-1),before:Jn(o,a-1)}),o&&s&&d.disabled.push({after:o,before:Jn(o,a-1)}),!o&&s&&d.disabled.push({after:F0(s,a-1),before:Jn(s,a-1)})),l){if(o&&!s&&(d.disabled.push({before:Jn(o,-l+1)}),d.disabled.push({after:Jn(o,l-1)})),o&&s){var f=Vi(s,o)+1,g=l-f;d.disabled.push({before:F0(o,g)}),d.disabled.push({after:Jn(s,g)})}!o&&s&&(d.disabled.push({before:Jn(s,-l+1)}),d.disabled.push({after:Jn(s,l-1)}))}return xe.jsx(H0.Provider,{value:{selected:r,onDayClick:c,modifiers:d},children:n})}function W0(){var e=m.useContext(H0);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function np(e){return Array.isArray(e)?cP([],e,!0):e!==void 0?[e]:[]}function Hq(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],i=n[1];t[r]=np(i)}),t}var xi;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(xi||(xi={}));var Wq=xi.Selected,wo=xi.Disabled,qq=xi.Hidden,Uq=xi.Today,q0=xi.RangeEnd,U0=xi.RangeMiddle,G0=xi.RangeStart,Gq=xi.Outside;function Yq(e,t,n){var r,i=(r={},r[Wq]=np(e.selected),r[wo]=np(e.disabled),r[qq]=np(e.hidden),r[Uq]=[e.today],r[q0]=[],r[U0]=[],r[G0]=[],r[Gq]=[],r);return e.fromDate&&i[wo].push({before:e.fromDate}),e.toDate&&i[wo].push({after:e.toDate}),zu(e)?i[wo]=i[wo].concat(t.modifiers[wo]):Bu(e)&&(i[wo]=i[wo].concat(n.modifiers[wo]),i[G0]=n.modifiers[G0],i[U0]=n.modifiers[U0],i[q0]=n.modifiers[q0]),i}var bP=m.createContext(void 0);function Kq(e){var t=Vt(),n=V0(),r=W0(),i=Yq(t,n,r),o=Hq(t.modifiers),s=Ue(Ue({},i),o);return xe.jsx(bP.Provider,{value:s,children:e.children})}function yP(){var e=m.useContext(bP);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Xq(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Qq(e){return!!(e&&typeof e=="object"&&"from"in e)}function Zq(e){return!!(e&&typeof e=="object"&&"after"in e)}function Jq(e){return!!(e&&typeof e=="object"&&"before"in e)}function eU(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function tU(e,t){var n,r=t.from,i=t.to;if(r&&i){var o=Vi(i,r)<0;o&&(n=[i,r],r=n[0],i=n[1]);var s=Vi(e,r)>=0&&Vi(i,e)>=0;return s}return i?dr(i,e):r?dr(r,e):!1}function nU(e){return A0(e)}function rU(e){return Array.isArray(e)&&e.every(A0)}function iU(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(nU(n))return dr(e,n);if(rU(n))return n.includes(e);if(Qq(n))return tU(e,n);if(eU(n))return n.dayOfWeek.includes(e.getDay());if(Xq(n)){var r=Vi(n.before,e),i=Vi(n.after,e),o=r>0,s=i<0,a=L0(n.before,n.after);return a?s&&o:o||s}return Zq(n)?Vi(e,n.after)>0:Jq(n)?Vi(n.before,e)>0:typeof n=="function"?n(e):!1})}function Y0(e,t,n){var r=Object.keys(t).reduce(function(o,s){var a=t[s];return iU(e,a)&&o.push(s),o},[]),i={};return r.forEach(function(o){return i[o]=!0}),n&&!$0(e,n)&&(i.outside=!0),i}function oU(e,t){for(var n=fr(e[0]),r=I0(e[e.length-1]),i,o,s=n;s<=r;){var a=Y0(s,t),l=!a.disabled&&!a.hidden;if(!l){s=Jn(s,1);continue}if(a.selected)return s;a.today&&!o&&(o=s),i||(i=s),s=Jn(s,1)}return o||i}var sU=365;function xP(e,t){var n=t.moveBy,r=t.direction,i=t.context,o=t.modifiers,s=t.retry,a=s===void 0?{count:0,lastFocused:e}:s,l=i.weekStartsOn,c=i.fromDate,d=i.toDate,f=i.locale,g={day:Jn,week:T0,month:yi,year:YW,startOfWeek:function(x){return i.ISOWeek?ha(x):Bi(x,{locale:f,weekStartsOn:l})},endOfWeek:function(x){return i.ISOWeek?QO(x):N0(x,{locale:f,weekStartsOn:l})}},p=g[n](e,r==="after"?1:-1);r==="before"&&c?p=KW([c,p]):r==="after"&&d&&(p=XW([d,p]));var v=!0;if(o){var y=Y0(p,o);v=!y.disabled&&!y.hidden}return v?p:a.count>sU?a.lastFocused:xP(p,{moveBy:n,direction:r,context:i,modifiers:o,retry:Ue(Ue({},a),{count:a.count+1})})}var wP=m.createContext(void 0);function aU(e){var t=Vu(),n=yP(),r=m.useState(),i=r[0],o=r[1],s=m.useState(),a=s[0],l=s[1],c=oU(t.displayMonths,n),d=i??(a&&t.isDateDisplayed(a))?a:c,f=function(){l(i),o(void 0)},g=function(x){o(x)},p=Vt(),v=function(x,w){if(i){var S=xP(i,{moveBy:x,direction:w,context:p,modifiers:n});dr(i,S)||(t.goToDate(S,i),g(S))}},y={focusedDay:i,focusTarget:d,blur:f,focus:g,focusDayAfter:function(){return v("day","after")},focusDayBefore:function(){return v("day","before")},focusWeekAfter:function(){return v("week","after")},focusWeekBefore:function(){return v("week","before")},focusMonthBefore:function(){return v("month","before")},focusMonthAfter:function(){return v("month","after")},focusYearBefore:function(){return v("year","before")},focusYearAfter:function(){return v("year","after")},focusStartOfWeek:function(){return v("startOfWeek","before")},focusEndOfWeek:function(){return v("endOfWeek","after")}};return xe.jsx(wP.Provider,{value:y,children:e.children})}function K0(){var e=m.useContext(wP);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function lU(e,t){var n=yP(),r=Y0(e,n,t);return r}var X0=m.createContext(void 0);function cU(e){if(!ep(e.initialProps)){var t={selected:void 0};return xe.jsx(X0.Provider,{value:t,children:e.children})}return xe.jsx(uU,{initialProps:e.initialProps,children:e.children})}function uU(e){var t=e.initialProps,n=e.children,r=function(o,s,a){var l,c,d;if((l=t.onDayClick)===null||l===void 0||l.call(t,o,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,o,s,a);return}(d=t.onSelect)===null||d===void 0||d.call(t,o,o,s,a)},i={selected:t.selected,onDayClick:r};return xe.jsx(X0.Provider,{value:i,children:n})}function _P(){var e=m.useContext(X0);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function dU(e,t){var n=Vt(),r=_P(),i=V0(),o=W0(),s=K0(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,d=s.focusWeekBefore,f=s.blur,g=s.focus,p=s.focusMonthBefore,v=s.focusMonthAfter,y=s.focusYearBefore,x=s.focusYearAfter,w=s.focusStartOfWeek,S=s.focusEndOfWeek,C=function(G){var q,se,D,W;ep(n)?(q=r.onDayClick)===null||q===void 0||q.call(r,e,t,G):zu(n)?(se=i.onDayClick)===null||se===void 0||se.call(i,e,t,G):Bu(n)?(D=o.onDayClick)===null||D===void 0||D.call(o,e,t,G):(W=n.onDayClick)===null||W===void 0||W.call(n,e,t,G)},P=function(G){var q;g(e),(q=n.onDayFocus)===null||q===void 0||q.call(n,e,t,G)},O=function(G){var q;f(),(q=n.onDayBlur)===null||q===void 0||q.call(n,e,t,G)},k=function(G){var q;(q=n.onDayMouseEnter)===null||q===void 0||q.call(n,e,t,G)},A=function(G){var q;(q=n.onDayMouseLeave)===null||q===void 0||q.call(n,e,t,G)},L=function(G){var q;(q=n.onDayPointerEnter)===null||q===void 0||q.call(n,e,t,G)},F=function(G){var q;(q=n.onDayPointerLeave)===null||q===void 0||q.call(n,e,t,G)},z=function(G){var q;(q=n.onDayTouchCancel)===null||q===void 0||q.call(n,e,t,G)},B=function(G){var q;(q=n.onDayTouchEnd)===null||q===void 0||q.call(n,e,t,G)},V=function(G){var q;(q=n.onDayTouchMove)===null||q===void 0||q.call(n,e,t,G)},X=function(G){var q;(q=n.onDayTouchStart)===null||q===void 0||q.call(n,e,t,G)},K=function(G){var q;(q=n.onDayKeyUp)===null||q===void 0||q.call(n,e,t,G)},$=function(G){var q;switch(G.key){case"ArrowLeft":G.preventDefault(),G.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":G.preventDefault(),G.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":G.preventDefault(),G.stopPropagation(),c();break;case"ArrowUp":G.preventDefault(),G.stopPropagation(),d();break;case"PageUp":G.preventDefault(),G.stopPropagation(),G.shiftKey?y():p();break;case"PageDown":G.preventDefault(),G.stopPropagation(),G.shiftKey?x():v();break;case"Home":G.preventDefault(),G.stopPropagation(),w();break;case"End":G.preventDefault(),G.stopPropagation(),S();break}(q=n.onDayKeyDown)===null||q===void 0||q.call(n,e,t,G)},J={onClick:C,onFocus:P,onBlur:O,onKeyDown:$,onKeyUp:K,onMouseEnter:k,onMouseLeave:A,onPointerEnter:L,onPointerLeave:F,onTouchCancel:z,onTouchEnd:B,onTouchMove:V,onTouchStart:X};return J}function fU(){var e=Vt(),t=_P(),n=V0(),r=W0(),i=ep(e)?t.selected:zu(e)?n.selected:Bu(e)?r.selected:void 0;return i}function hU(e){return Object.values(xi).includes(e)}function pU(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var i=e.modifiersClassNames[r];if(i)n.push(i);else if(hU(r)){var o=e.classNames["day_".concat(r)];o&&n.push(o)}}),n}function gU(e,t){var n=Ue({},e.styles.day);return Object.keys(t).forEach(function(r){var i;n=Ue(Ue({},n),(i=e.modifiersStyles)===null||i===void 0?void 0:i[r])}),n}function mU(e,t,n){var r,i,o,s=Vt(),a=K0(),l=lU(e,t),c=dU(e,l),d=fU(),f=!!(s.onDayClick||s.mode!=="default");m.useEffect(function(){var k;l.outside||a.focusedDay&&f&&dr(a.focusedDay,e)&&((k=n.current)===null||k===void 0||k.focus())},[a.focusedDay,e,n,f,l.outside]);var g=pU(s,l).join(" "),p=gU(s,l),v=!!(l.outside&&!s.showOutsideDays||l.hidden),y=(o=(i=s.components)===null||i===void 0?void 0:i.DayContent)!==null&&o!==void 0?o:$q,x=xe.jsx(y,{date:e,displayMonth:t,activeModifiers:l}),w={style:p,className:g,children:x,role:"gridcell"},S=a.focusTarget&&dr(a.focusTarget,e)&&!l.outside,C=a.focusedDay&&dr(a.focusedDay,e),P=Ue(Ue(Ue({},w),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=C||S?0:-1,r)),c),O={isButton:f,isHidden:v,activeModifiers:l,selectedDays:d,buttonProps:P,divProps:w};return O}function vU(e){var t=m.useRef(null),n=mU(e.date,e.displayMonth,t);return n.isHidden?xe.jsx("div",{role:"gridcell"}):n.isButton?xe.jsx(tp,Ue({name:"day",ref:t},n.buttonProps)):xe.jsx("div",Ue({},n.divProps))}function bU(e){var t=e.number,n=e.dates,r=Vt(),i=r.onWeekNumberClick,o=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,d=c(Number(t),{locale:a});if(!i)return xe.jsx("span",{className:s.weeknumber,style:o.weeknumber,children:d});var f=l(Number(t),{locale:a}),g=function(p){i(t,n,p)};return xe.jsx(tp,{name:"week-number","aria-label":f,className:s.weeknumber,style:o.weeknumber,onClick:g,children:d})}function yU(e){var t,n,r=Vt(),i=r.styles,o=r.classNames,s=r.showWeekNumber,a=r.components,l=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:vU,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:bU,d;return s&&(d=xe.jsx("td",{className:o.cell,style:i.cell,children:xe.jsx(c,{number:e.weekNumber,dates:e.dates})})),xe.jsxs("tr",{className:o.row,style:i.row,children:[d,e.dates.map(function(f){return xe.jsx("td",{className:o.cell,style:i.cell,role:"presentation",children:xe.jsx(l,{displayMonth:e.displayMonth,date:f})},G6(f))})]})}function SP(e,t,n){for(var r=n!=null&&n.ISOWeek?QO(t):N0(t,n),i=n!=null&&n.ISOWeek?ha(e):Bi(e,n),o=Vi(r,i),s=[],a=0;a<=o;a++)s.push(Jn(i,a));var l=s.reduce(function(c,d){var f=n!=null&&n.ISOWeek?JO(d):tP(d,n),g=c.find(function(p){return p.weekNumber===f});return g?(g.dates.push(d),c):(c.push({weekNumber:f,dates:[d]}),c)},[]);return l}function xU(e,t){var n=SP(fr(e),I0(e),t);if(t!=null&&t.useFixedWeeks){var r=K6(e,t);if(r<6){var i=n[n.length-1],o=i.dates[i.dates.length-1],s=T0(o,6-r),a=SP(T0(o,1),s,t);n.push.apply(n,a)}}return n}function wU(e){var t,n,r,i=Vt(),o=i.locale,s=i.classNames,a=i.styles,l=i.hideHead,c=i.fixedWeeks,d=i.components,f=i.weekStartsOn,g=i.firstWeekContainsDate,p=i.ISOWeek,v=xU(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:o,weekStartsOn:f,firstWeekContainsDate:g}),y=(t=d==null?void 0:d.Head)!==null&&t!==void 0?t:Lq,x=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:yU,w=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:Iq;return xe.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&xe.jsx(y,{}),xe.jsx("tbody",{className:s.tbody,style:a.tbody,children:v.map(function(S){return xe.jsx(x,{displayMonth:e.displayMonth,dates:S.dates,weekNumber:S.weekNumber},S.weekNumber)})}),xe.jsx(w,{displayMonth:e.displayMonth})]})}function _U(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var SU=_U()?m.useLayoutEffect:m.useEffect,Q0=!1,CU=0;function CP(){return"react-day-picker-".concat(++CU)}function EU(e){var t,n=e??(Q0?CP():null),r=m.useState(n),i=r[0],o=r[1];return SU(function(){i===null&&o(CP())},[]),m.useEffect(function(){Q0===!1&&(Q0=!0)},[]),(t=e??i)!==null&&t!==void 0?t:void 0}function OU(e){var t,n,r=Vt(),i=r.dir,o=r.classNames,s=r.styles,a=r.components,l=Vu().displayMonths,c=EU(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[o.month],g=s.month,p=e.displayIndex===0,v=e.displayIndex===l.length-1,y=!p&&!v;i==="rtl"&&(t=[p,v],v=t[0],p=t[1]),p&&(f.push(o.caption_start),g=Ue(Ue({},g),s.caption_start)),v&&(f.push(o.caption_end),g=Ue(Ue({},g),s.caption_end)),y&&(f.push(o.caption_between),g=Ue(Ue({},g),s.caption_between));var x=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:Aq;return xe.jsxs("div",{className:f.join(" "),style:g,children:[xe.jsx(x,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),xe.jsx(wU,{id:d,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function PU(e){var t=Vt(),n=t.classNames,r=t.styles;return xe.jsx("div",{className:n.months,style:r.months,children:e.children})}function kU(e){var t,n,r=e.initialProps,i=Vt(),o=K0(),s=Vu(),a=m.useState(!1),l=a[0],c=a[1];m.useEffect(function(){i.initialFocus&&o.focusTarget&&(l||(o.focus(o.focusTarget),c(!0)))},[i.initialFocus,l,o.focus,o.focusTarget,o]);var d=[i.classNames.root,i.className];i.numberOfMonths>1&&d.push(i.classNames.multiple_months),i.showWeekNumber&&d.push(i.classNames.with_weeknumber);var f=Ue(Ue({},i.styles.root),i.style),g=Object.keys(r).filter(function(v){return v.startsWith("data-")}).reduce(function(v,y){var x;return Ue(Ue({},v),(x={},x[y]=r[y],x))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:PU;return xe.jsx("div",Ue({className:d.join(" "),style:f,dir:i.dir,id:i.id,nonce:r.nonce,title:r.title,lang:r.lang},g,{children:xe.jsx(p,{children:s.displayMonths.map(function(v,y){return xe.jsx(OU,{displayIndex:y,displayMonth:v},y)})})}))}function MU(e){var t=e.children,n=Q6(e,["children"]);return xe.jsx(bq,{initialProps:n,children:xe.jsx(kq,{children:xe.jsx(cU,{initialProps:n,children:xe.jsx(Fq,{initialProps:n,children:xe.jsx(Bq,{initialProps:n,children:xe.jsx(Kq,{children:xe.jsx(aU,{children:t})})})})})})})}function DU(e){return xe.jsx(MU,Ue({},e,{children:xe.jsx(kU,{initialProps:e})}))}function EP({className:e,classNames:t,showOutsideDays:n=!0,...r}){return _.jsx(DU,{showOutsideDays:n,className:Pe("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:Pe(M0({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:Pe(M0({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...i})=>_.jsx(UB,{...i,className:"h-4 w-4"}),IconRight:({...i})=>_.jsx(V2,{...i,className:"h-4 w-4"})},...r})}EP.displayName="Calendar";let Z0=0;function rp(){m.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:OP()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:OP()),Z0++,()=>{Z0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Z0--}},[])}function OP(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const J0="focusScope.autoFocusOnMount",ey="focusScope.autoFocusOnUnmount",PP={bubbles:!1,cancelable:!0},ip=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=m.useState(null),c=xn(i),d=xn(o),f=m.useRef(null),g=et(t,y=>l(y)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let y=function(C){if(p.paused||!a)return;const P=C.target;a.contains(P)?f.current=P:rs(f.current,{select:!0})},x=function(C){if(p.paused||!a)return;const P=C.relatedTarget;P!==null&&(a.contains(P)||rs(f.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const O of C)O.removedNodes.length>0&&rs(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const S=new MutationObserver(w);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),S.disconnect()}}},[r,a,p.paused]),m.useEffect(()=>{if(a){DP.add(p);const y=document.activeElement;if(!a.contains(y)){const w=new CustomEvent(J0,PP);a.addEventListener(J0,c),a.dispatchEvent(w),w.defaultPrevented||(TU(LU(kP(a)),{select:!0}),document.activeElement===y&&rs(a))}return()=>{a.removeEventListener(J0,c),setTimeout(()=>{const w=new CustomEvent(ey,PP);a.addEventListener(ey,d),a.dispatchEvent(w),w.defaultPrevented||rs(y??document.body,{select:!0}),a.removeEventListener(ey,d),DP.remove(p)},0)}}},[a,c,d,p]);const v=m.useCallback(y=>{if(!n&&!r||p.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,w=document.activeElement;if(x&&w){const S=y.currentTarget,[C,P]=AU(S);C&&P?!y.shiftKey&&w===P?(y.preventDefault(),n&&rs(C,{select:!0})):y.shiftKey&&w===C&&(y.preventDefault(),n&&rs(P,{select:!0})):w===S&&y.preventDefault()}},[n,r,p.paused]);return m.createElement(Be.div,le({tabIndex:-1},s,{ref:g,onKeyDown:v}))});function TU(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(rs(r,{select:t}),document.activeElement!==n)return}function AU(e){const t=kP(e),n=MP(t,e),r=MP(t.reverse(),e);return[n,r]}function kP(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function MP(e,t){for(const n of e)if(!IU(n,{upTo:t}))return n}function IU(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 NU(e){return e instanceof HTMLInputElement&&"select"in e}function rs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&NU(e)&&t&&e.select()}}const DP=RU();function RU(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=TP(e,t),e.unshift(t)},remove(t){var n;e=TP(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function TP(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function LU(e){return e.filter(t=>t.tagName!=="A")}var $U=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Il=new WeakMap,op=new WeakMap,sp={},ty=0,AP=function(e){return e&&(e.host||AP(e.parentNode))},FU=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=AP(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})},jU=function(e,t,n,r){var i=FU(t,Array.isArray(e)?e:[e]);sp[n]||(sp[n]=new WeakMap);var o=sp[n],s=[],a=new Set,l=new Set(i),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};i.forEach(c);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(g){if(a.has(g))d(g);else{var p=g.getAttribute(r),v=p!==null&&p!=="false",y=(Il.get(g)||0)+1,x=(o.get(g)||0)+1;Il.set(g,y),o.set(g,x),s.push(g),y===1&&v&&op.set(g,!0),x===1&&g.setAttribute(n,"true"),v||g.setAttribute(r,"true")}})};return d(t),a.clear(),ty++,function(){s.forEach(function(f){var g=Il.get(f)-1,p=o.get(f)-1;Il.set(f,g),o.set(f,p),g||(op.has(f)||f.removeAttribute(r),op.delete(f)),p||f.removeAttribute(n)}),ty--,ty||(Il=new WeakMap,Il=new WeakMap,op=new WeakMap,sp={})}},ap=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||$U(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),jU(r,i,n,"aria-hidden")):function(){return null}},Wi=function(){return Wi=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Wi.apply(this,arguments)};function IP(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function zU(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var lp="right-scroll-bar-position",cp="width-before-scroll-bar",BU="with-scroll-bars-hidden",VU="--removed-body-scroll-bar-size";function HU(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function WU(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function qU(e,t){return WU(t||null,function(n){return e.forEach(function(r){return HU(r,n)})})}function UU(e){return e}function GU(e,t){t===void 0&&(t=UU);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var d=s;s=[],d.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){s.push(d),c()},filter:function(d){return s=s.filter(d),n}}}};return i}function YU(e){e===void 0&&(e={});var t=GU(null);return t.options=Wi({async:!0,ssr:!1},e),t}var NP=function(e){var t=e.sideCar,n=IP(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 ue.createElement(r,Wi({},n))};NP.isSideCarExport=!0;function KU(e,t){return e.useMedium(t),NP}var RP=YU(),ny=function(){},up=ue.forwardRef(function(e,t){var n=ue.useRef(null),r=ue.useState({onScrollCapture:ny,onWheelCapture:ny,onTouchMoveCapture:ny}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,g=e.sideCar,p=e.noIsolation,v=e.inert,y=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,S=IP(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),C=g,P=qU([n,t]),O=Wi(Wi({},S),i);return ue.createElement(ue.Fragment,null,d&&ue.createElement(C,{sideCar:RP,removeScrollBar:c,shards:f,noIsolation:p,inert:v,setCallbacks:o,allowPinchZoom:!!y,lockRef:n}),s?ue.cloneElement(ue.Children.only(a),Wi(Wi({},O),{ref:P})):ue.createElement(w,Wi({},O,{className:l,ref:P}),a))});up.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},up.classNames={fullWidth:cp,zeroRight:lp};var LP,XU=function(){if(LP)return LP;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function QU(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=XU();return t&&e.setAttribute("nonce",t),e}function ZU(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function JU(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var eG=function(){var e=0,t=null;return{add:function(n){e==0&&(t=QU())&&(ZU(t,n),JU(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tG=function(){var e=eG();return function(t,n){ue.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},$P=function(){var e=tG(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},nG={left:0,top:0,right:0,gap:0},ry=function(e){return parseInt(e||"",10)||0},rG=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[ry(n),ry(r),ry(i)]},iG=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return nG;var t=rG(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])}},oG=$P(),sG=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
388
|
+
.`.concat(BU,` {
|
|
389
|
+
overflow: hidden `).concat(r,`;
|
|
390
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
391
|
+
}
|
|
392
|
+
body {
|
|
393
|
+
overflow: hidden `).concat(r,`;
|
|
394
|
+
overscroll-behavior: contain;
|
|
395
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
396
|
+
padding-left: `.concat(i,`px;
|
|
397
|
+
padding-top: `).concat(o,`px;
|
|
398
|
+
padding-right: `).concat(s,`px;
|
|
399
|
+
margin-left:0;
|
|
400
|
+
margin-top:0;
|
|
401
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
402
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.`).concat(lp,` {
|
|
406
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.`).concat(cp,` {
|
|
410
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.`).concat(lp," .").concat(lp,` {
|
|
414
|
+
right: 0 `).concat(r,`;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.`).concat(cp," .").concat(cp,` {
|
|
418
|
+
margin-right: 0 `).concat(r,`;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
body {
|
|
422
|
+
`).concat(VU,": ").concat(a,`px;
|
|
423
|
+
}
|
|
424
|
+
`)},aG=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=ue.useMemo(function(){return iG(i)},[i]);return ue.createElement(oG,{styles:sG(o,!t,i,n?"":"!important")})},iy=!1;if(typeof window<"u")try{var dp=Object.defineProperty({},"passive",{get:function(){return iy=!0,!0}});window.addEventListener("test",dp,dp),window.removeEventListener("test",dp,dp)}catch{iy=!1}var Nl=iy?{passive:!1}:!1,lG=function(e){return e.tagName==="TEXTAREA"},FP=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!lG(e)&&n[t]==="visible")},cG=function(e){return FP(e,"overflowY")},uG=function(e){return FP(e,"overflowX")},jP=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=zP(e,n);if(r){var i=BP(e,n),o=i[1],s=i[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},dG=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},fG=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},zP=function(e,t){return e==="v"?cG(t):uG(t)},BP=function(e,t){return e==="v"?dG(t):fG(t)},hG=function(e,t){return e==="h"&&t==="rtl"?-1:1},pG=function(e,t,n,r,i){var o=hG(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),c=!1,d=s>0,f=0,g=0;do{var p=BP(e,a),v=p[0],y=p[1],x=p[2],w=y-x-o*v;(v||w)&&zP(e,a)&&(f+=w,g+=v),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(i&&f===0||!i&&s>f)||!d&&(i&&g===0||!i&&-s>g))&&(c=!0),c},fp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},VP=function(e){return[e.deltaX,e.deltaY]},HP=function(e){return e&&"current"in e?e.current:e},gG=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mG=function(e){return`
|
|
425
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
426
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
427
|
+
`)},vG=0,Rl=[];function bG(e){var t=ue.useRef([]),n=ue.useRef([0,0]),r=ue.useRef(),i=ue.useState(vG++)[0],o=ue.useState(function(){return $P()})[0],s=ue.useRef(e);ue.useEffect(function(){s.current=e},[e]),ue.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=zU([e.lockRef.current],(e.shards||[]).map(HP),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=ue.useCallback(function(y,x){if("touches"in y&&y.touches.length===2)return!s.current.allowPinchZoom;var w=fp(y),S=n.current,C="deltaX"in y?y.deltaX:S[0]-w[0],P="deltaY"in y?y.deltaY:S[1]-w[1],O,k=y.target,A=Math.abs(C)>Math.abs(P)?"h":"v";if("touches"in y&&A==="h"&&k.type==="range")return!1;var L=jP(A,k);if(!L)return!0;if(L?O=A:(O=A==="v"?"h":"v",L=jP(A,k)),!L)return!1;if(!r.current&&"changedTouches"in y&&(C||P)&&(r.current=O),!O)return!0;var F=r.current||O;return pG(F,x,y,F==="h"?C:P,!0)},[]),l=ue.useCallback(function(y){var x=y;if(!(!Rl.length||Rl[Rl.length-1]!==o)){var w="deltaY"in x?VP(x):fp(x),S=t.current.filter(function(O){return O.name===x.type&&O.target===x.target&&gG(O.delta,w)})[0];if(S&&S.should){x.cancelable&&x.preventDefault();return}if(!S){var C=(s.current.shards||[]).map(HP).filter(Boolean).filter(function(O){return O.contains(x.target)}),P=C.length>0?a(x,C[0]):!s.current.noIsolation;P&&x.cancelable&&x.preventDefault()}}},[]),c=ue.useCallback(function(y,x,w,S){var C={name:y,delta:x,target:w,should:S};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(P){return P!==C})},1)},[]),d=ue.useCallback(function(y){n.current=fp(y),r.current=void 0},[]),f=ue.useCallback(function(y){c(y.type,VP(y),y.target,a(y,e.lockRef.current))},[]),g=ue.useCallback(function(y){c(y.type,fp(y),y.target,a(y,e.lockRef.current))},[]);ue.useEffect(function(){return Rl.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",l,Nl),document.addEventListener("touchmove",l,Nl),document.addEventListener("touchstart",d,Nl),function(){Rl=Rl.filter(function(y){return y!==o}),document.removeEventListener("wheel",l,Nl),document.removeEventListener("touchmove",l,Nl),document.removeEventListener("touchstart",d,Nl)}},[]);var p=e.removeScrollBar,v=e.inert;return ue.createElement(ue.Fragment,null,v?ue.createElement(o,{styles:mG(i)}):null,p?ue.createElement(aG,{gapMode:"margin"}):null)}const yG=KU(RP,bG);var WP=ue.forwardRef(function(e,t){return ue.createElement(up,Wi({},e,{ref:t,sideCar:yG}))});WP.classNames=up.classNames;const hp=WP,qP="Popover",[UP,efe]=Pn(qP,[Fi]),oy=Fi(),[xG,Ll]=UP(qP),wG=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,a=oy(t),l=m.useRef(null),[c,d]=m.useState(!1),[f=!1,g]=Qn({prop:r,defaultProp:i,onChange:o});return m.createElement(Cu,a,m.createElement(xG,{scope:t,contentId:or(),triggerRef:l,open:f,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(p=>!p),[g]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:s},n))},_G="PopoverTrigger",SG=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Ll(_G,n),o=oy(n),s=et(t,i.triggerRef),a=m.createElement(Be.button,le({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":KP(i.open)},r,{ref:s,onClick:Ce(e.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:m.createElement(Eu,le({asChild:!0},o),a)}),GP="PopoverPortal",[CG,EG]=UP(GP,{forceMount:void 0}),OG=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=Ll(GP,t);return m.createElement(CG,{scope:t,forceMount:n},m.createElement(vn,{present:n||o.open},m.createElement(Dh,{asChild:!0,container:i},r)))},Hu="PopoverContent",PG=m.forwardRef((e,t)=>{const n=EG(Hu,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=Ll(Hu,e.__scopePopover);return m.createElement(vn,{present:r||o.open},o.modal?m.createElement(kG,le({},i,{ref:t})):m.createElement(MG,le({},i,{ref:t})))}),kG=m.forwardRef((e,t)=>{const n=Ll(Hu,e.__scopePopover),r=m.useRef(null),i=et(t,r),o=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return ap(s)},[]),m.createElement(hp,{as:no,allowPinchZoom:!0},m.createElement(YP,le({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),o.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Ce(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),MG=m.forwardRef((e,t)=>{const n=Ll(Hu,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return m.createElement(YP,le({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),YP=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...f}=e,g=Ll(Hu,n),p=oy(n);return rp(),m.createElement(ip,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},m.createElement(wl,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>g.onOpenChange(!1)},m.createElement(Ou,le({"data-state":KP(g.open),role:"dialog",id:g.contentId},p,f,{ref:t,style:{...f.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)"}}))))});function KP(e){return e?"open":"closed"}const DG=wG,TG=SG,AG=OG,XP=PG,pp=DG,gp=TG,Wu=ue.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>_.jsx(AG,{children:_.jsx(XP,{ref:i,align:t,sideOffset:n,className:Pe("z-50 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})}));Wu.displayName=XP.displayName;function IG({filter:e,className:t}){const[n,r]=m.useState(!1),[i,o]=m.useState(),[s,a]=m.useState(),l=be(C=>C.filterValues),c=be(C=>C.authToken),d=be(C=>C.actions.addOrUpdateFilterValue),f=be(C=>C.actions.removeFilterValue),{data:g,isLoading:p,isFetching:v,isError:y,refetch:x}=Sr({queryKey:[e.sql],queryFn:()=>Ts("https://semaphor.cloud/api/v1/query",(c==null?void 0:c.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId&&!!e.database});m.useEffect(()=>{var C;if(((C=g==null?void 0:g.records)==null?void 0:C.length)>0){const P=g.records[0];if(!P.min||!P.max)return;o({from:new Date(P.min),to:new Date(P.max)}),a({from:new Date(P.min),to:new Date(P.max)})}},[g]),m.useEffect(()=>{if(l&&!l.find(P=>P.filterId===e.id)){o(s);return}},[l,e.id,s]);function w(){f(e.id),o(s),r(!1)}function S(){if(!i)return;console.log(i);const C=[i==null?void 0:i.from,i==null?void 0:i.to];console.log(C);const P={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:P0(e),name:e.column,operation:"between",values:C};d(P),r(!1)}return p?_.jsx("div",{children:_.jsx(lf,{className:" bg-foreground/10 h-8 w-[250px]"})}):y?_.jsx("div",{className:"bg-muted h-8 w-[250px] px-2",children:"Error"}):g?_.jsx("div",{className:Pe("grid gap-2",t),children:_.jsxs(pp,{open:n,onOpenChange:r,children:[_.jsx(gp,{asChild:!0,children:_.jsxs(it,{size:"sm",id:"date",variant:"outline",className:Pe("w-[250px] justify-start text-left font-normal rounded-sm h-[34px]",!i&&"text-muted-foreground"),children:[_.jsx(qB,{className:"mr-2 h-4 w-4"}),i!=null&&i.from?i.to?_.jsxs(_.Fragment,{children:[Hi(i.from,"LLL dd, y")," -"," ",Hi(i.to,"LLL dd, y")]}):Hi(i.from,"LLL dd, y"):_.jsx("span",{children:"Pick a date"})]})}),_.jsxs(Wu,{className:"w-auto p-0",align:"start",children:[_.jsx(EP,{initialFocus:!0,mode:"range",defaultMonth:i==null?void 0:i.from,selected:i,onSelect:o,numberOfMonths:2}),_.jsxs("div",{className:"flex justify-end px-4 py-3 gap-2",children:[_.jsx(it,{size:"sm",variant:"outline",onClick:S,children:"Apply"}),_.jsx(it,{size:"sm",variant:"outline",onClick:w,children:"Clear"})]})]})]})}):null}function NG(){const e=be(s=>s.dashboard.filters),t=be(s=>s.isDashboardEditing),n=be(s=>s.actions.removeFilter),r=be(s=>s.actions.updateFilter),i=be(s=>s.actions.removeFilterValue);if(!e)return null;const o=s=>Iu.includes(s.dataType)?_.jsx(IG,{filter:s}):_.jsx(HW,{filter:s});return _.jsx("section",{role:"dashboard-filters",className:" px-[10px] pt-0 grow w-full items-center flex gap-2 flex-wrap ",children:e.map(s=>_.jsxs("div",{children:[_.jsx(qc,{className:" my-1 ",text:s.title||s.column,onSave:a=>r({...s,title:a}),children:_.jsxs("div",{className:"flex items-center justify-between group mb-1",children:[_.jsxs("div",{className:"flex gap-1 items-center ",children:[_.jsx(fa,{className:" inline-block text-sm ",children:s.title}),t&&_.jsx(na,{onClick:()=>{i(s.id),n(s.id)},className:"w-3 h-3 invisible text-muted-foreground group-hover:visible hover:text-foreground cursor-pointer"})]}),_.jsx("div",{onClick:()=>i(s.id),className:" text-xs invisible group-hover:visible group-hover:underline cursor-pointer text-muted-foreground hover:text-foreground",children:"Clear"})]})}),o(s)]},s.id))})}function QP(){const e=be(i=>{var o;return(o=i.dashboard)==null?void 0:o.sheets});be(i=>i.isDashboardEditing);const t=be(i=>i.themeStyle);be(i=>i.isVisualEditing);const n=be(i=>i.selectedSheetId),r=be(i=>i.actions.setSelectedSheetId);return be(i=>i.actions.setSheetTitle),e?_.jsxs(a_,{role:"dashboard-tabs-container",className:Pe(" grow bg-muted dark:bg-foreground/5 p-2 ",t==null?void 0:t.dashboardTabsContainer),onValueChange:i=>{r(i)},value:n||e[0].id,children:[_.jsx(NG,{}),e==null?void 0:e.map(i=>_.jsx(ff,{className:"mt-0",value:i.id,children:_.jsx(uH,{})},i.id))]}):null}function ZP({children:e}){const t=new MN;return _.jsx(KN,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:_.jsx($B,{delayDuration:0,children:_.jsx(NN,{client:t,children:e})})})}function JP(e){return _.jsx(ZP,{children:_.jsx(Kw,{...e,children:_.jsx(QP,{})})})}var RG=Object.defineProperty,LG=(e,t,n)=>t in e?RG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mp=(e,t,n)=>(LG(e,typeof t!="symbol"?t+"":t,n),n);const $G={stringify:e=>e,parse:e=>e},FG={stringify:e=>`${e}`,parse:e=>parseFloat(e)},jG={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},zG={stringify:e=>e.name,parse:(e,t)=>{const n=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof n=="function"?n.bind(t):void 0}},BG={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},sy={string:$G,number:FG,boolean:jG,function:zG,json:BG},ay=Symbol.for("r2wc.render"),vp=Symbol.for("r2wc.connected"),ga=Symbol.for("r2wc.context"),is=Symbol.for("r2wc.props");function VG(e,t,n){var r,i,o;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const s=(Array.isArray(t.props)?t.props.slice():Object.keys(t.props)).filter(f=>f!=="container"),a={},l={},c={};for(const f of s){a[f]=Array.isArray(t.props)?"string":t.props[f];const g=HG(f);l[f]=g,c[g]=f}class d extends HTMLElement{constructor(){super(),mp(this,r,!0),mp(this,i),mp(this,o,{}),mp(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[is].container=this.container;for(const g of s){const p=l[g],v=this.getAttribute(p),y=a[g],x=sy[y];v&&x!=null&&x.parse&&(this[is][g]=x.parse(v,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[vp]=!0,this[ay]()}disconnectedCallback(){this[vp]=!1,this[ga]&&n.unmount(this[ga]),delete this[ga]}attributeChangedCallback(g,p,v){const y=c[g],x=a[y],w=sy[x];y in a&&w!=null&&w.parse&&(this[is][y]=w.parse(v,this),this[ay]())}[(r=vp,i=ga,o=is,ay)](){this[vp]&&(this[ga]?n.update(this[ga],this[is]):this[ga]=n.mount(this.container,e,this[is]))}}for(const f of s){const g=l[f],p=a[f];Object.defineProperty(d.prototype,f,{enumerable:!0,configurable:!0,get(){return this[is][f]},set(v){this[is][f]=v;const y=sy[p];if(y!=null&&y.stringify){const x=y.stringify(v);this.getAttribute(g)!==x&&this.setAttribute(g,x)}}})}return d}function HG(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function WG(e,t,n){const r=tf(e),i=m.createElement(t,n);return r.render(i),{root:r,ReactComponent:t}}function qG({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function UG({root:e}){e.unmount()}function GG(e,t={}){return VG(e,t,{mount:WG,update:qG,unmount:UG})}const YG=GG(JP,{props:{id:"string",authToken:"json",currentTheme:"string",style:"json",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function"}}),ly=["Enter"," "],KG=["ArrowDown","PageUp","Home"],ek=["ArrowUp","PageDown","End"],XG=[...KG,...ek],QG={ltr:[...ly,"ArrowRight"],rtl:[...ly,"ArrowLeft"]},ZG={ltr:["ArrowLeft"],rtl:["ArrowRight"]},bp="Menu",[qu,JG,eY]=uf(bp),[ma,tk]=Pn(bp,[eY,Fi,il]),cy=Fi(),nk=il(),[tY,va]=ma(bp),[nY,Uu]=ma(bp),rY=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=cy(t),[l,c]=m.useState(null),d=m.useRef(!1),f=xn(o),g=Ls(i);return m.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.createElement(Cu,a,m.createElement(tY,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(nY,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:g,modal:s},r)))},rk=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=cy(n);return m.createElement(Eu,le({},i,r,{ref:t}))}),ik="MenuPortal",[iY,ok]=ma(ik,{forceMount:void 0}),oY=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=va(ik,t);return m.createElement(iY,{scope:t,forceMount:n},m.createElement(vn,{present:n||o.open},m.createElement(Dh,{asChild:!0,container:i},r)))},wi="MenuContent",[sY,uy]=ma(wi),aY=m.forwardRef((e,t)=>{const n=ok(wi,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=va(wi,e.__scopeMenu),s=Uu(wi,e.__scopeMenu);return m.createElement(qu.Provider,{scope:e.__scopeMenu},m.createElement(vn,{present:r||o.open},m.createElement(qu.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(lY,le({},i,{ref:t})):m.createElement(cY,le({},i,{ref:t})))))}),lY=m.forwardRef((e,t)=>{const n=va(wi,e.__scopeMenu),r=m.useRef(null),i=et(t,r);return m.useEffect(()=>{const o=r.current;if(o)return ap(o)},[]),m.createElement(dy,le({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ce(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),cY=m.forwardRef((e,t)=>{const n=va(wi,e.__scopeMenu);return m.createElement(dy,le({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),dy=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,onDismiss:p,disableOutsideScroll:v,...y}=e,x=va(wi,n),w=Uu(wi,n),S=cy(n),C=nk(n),P=JG(n),[O,k]=m.useState(null),A=m.useRef(null),L=et(t,A,x.onContentChange),F=m.useRef(0),z=m.useRef(""),B=m.useRef(0),V=m.useRef(null),X=m.useRef("right"),K=m.useRef(0),$=v?hp:m.Fragment,J=v?{as:no,allowPinchZoom:!0}:void 0,G=se=>{var D,W;const re=z.current+se,N=P().filter(ee=>!ee.disabled),ne=document.activeElement,ge=(D=N.find(ee=>ee.ref.current===ne))===null||D===void 0?void 0:D.textValue,he=N.map(ee=>ee.textValue),de=kY(he,re,ge),ie=(W=N.find(ee=>ee.textValue===de))===null||W===void 0?void 0:W.ref.current;(function ee(H){z.current=H,window.clearTimeout(F.current),H!==""&&(F.current=window.setTimeout(()=>ee(""),1e3))})(re),ie&&setTimeout(()=>ie.focus())};m.useEffect(()=>()=>window.clearTimeout(F.current),[]),rp();const q=m.useCallback(se=>{var D,W;return X.current===((D=V.current)===null||D===void 0?void 0:D.side)&&DY(se,(W=V.current)===null||W===void 0?void 0:W.area)},[]);return m.createElement(sY,{scope:n,searchRef:z,onItemEnter:m.useCallback(se=>{q(se)&&se.preventDefault()},[q]),onItemLeave:m.useCallback(se=>{var D;q(se)||((D=A.current)===null||D===void 0||D.focus(),k(null))},[q]),onTriggerLeave:m.useCallback(se=>{q(se)&&se.preventDefault()},[q]),pointerGraceTimerRef:B,onPointerGraceIntentChange:m.useCallback(se=>{V.current=se},[])},m.createElement($,J,m.createElement(ip,{asChild:!0,trapped:i,onMountAutoFocus:Ce(o,se=>{var D;se.preventDefault(),(D=A.current)===null||D===void 0||D.focus()}),onUnmountAutoFocus:s},m.createElement(wl,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,onDismiss:p},m.createElement(Mm,le({asChild:!0},C,{dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:k,onEntryFocus:Ce(l,se=>{w.isUsingKeyboardRef.current||se.preventDefault()})}),m.createElement(Ou,le({role:"menu","aria-orientation":"vertical","data-state":dk(x.open),"data-radix-menu-content":"",dir:w.dir},S,y,{ref:L,style:{outline:"none",...y.style},onKeyDown:Ce(y.onKeyDown,se=>{const W=se.target.closest("[data-radix-menu-content]")===se.currentTarget,re=se.ctrlKey||se.altKey||se.metaKey,N=se.key.length===1;W&&(se.key==="Tab"&&se.preventDefault(),!re&&N&&G(se.key));const ne=A.current;if(se.target!==ne||!XG.includes(se.key))return;se.preventDefault();const he=P().filter(de=>!de.disabled).map(de=>de.ref.current);ek.includes(se.key)&&he.reverse(),OY(he)}),onBlur:Ce(e.onBlur,se=>{se.currentTarget.contains(se.target)||(window.clearTimeout(F.current),z.current="")}),onPointerMove:Ce(e.onPointerMove,Gu(se=>{const D=se.target,W=K.current!==se.clientX;if(se.currentTarget.contains(D)&&W){const re=se.clientX>K.current?"right":"left";X.current=re,K.current=se.clientX}}))})))))))}),uY=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Be.div,le({role:"group"},r,{ref:t}))}),dY=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Be.div,le({},r,{ref:t}))}),fy="MenuItem",sk="menu.itemSelect",hy=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=m.useRef(null),s=Uu(fy,e.__scopeMenu),a=uy(fy,e.__scopeMenu),l=et(t,o),c=m.useRef(!1),d=()=>{const f=o.current;if(!n&&f){const g=new CustomEvent(sk,{bubbles:!0,cancelable:!0});f.addEventListener(sk,p=>r==null?void 0:r(p),{once:!0}),Qw(f,g),g.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(ak,le({},i,{ref:l,disabled:n,onClick:Ce(e.onClick,d),onPointerDown:f=>{var g;(g=e.onPointerDown)===null||g===void 0||g.call(e,f),c.current=!0},onPointerUp:Ce(e.onPointerUp,f=>{var g;c.current||(g=f.currentTarget)===null||g===void 0||g.click()}),onKeyDown:Ce(e.onKeyDown,f=>{const g=a.searchRef.current!=="";n||g&&f.key===" "||ly.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),ak=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=uy(fy,n),a=nk(n),l=m.useRef(null),c=et(t,l),[d,f]=m.useState(!1),[g,p]=m.useState("");return m.useEffect(()=>{const v=l.current;if(v){var y;p(((y=v.textContent)!==null&&y!==void 0?y:"").trim())}},[o.children]),m.createElement(qu.ItemSlot,{scope:n,disabled:r,textValue:i??g},m.createElement(Dm,le({asChild:!0},a,{focusable:!r}),m.createElement(Be.div,le({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:c,onPointerMove:Ce(e.onPointerMove,Gu(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:Ce(e.onPointerLeave,Gu(v=>s.onItemLeave(v))),onFocus:Ce(e.onFocus,()=>f(!0)),onBlur:Ce(e.onBlur,()=>f(!1))}))))}),fY=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return m.createElement(ck,{scope:e.__scopeMenu,checked:n},m.createElement(hy,le({role:"menuitemcheckbox","aria-checked":xp(n)?"mixed":n},i,{ref:t,"data-state":py(n),onSelect:Ce(i.onSelect,()=>r==null?void 0:r(xp(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),hY="MenuRadioGroup",[pY,gY]=ma(hY,{value:void 0,onValueChange:()=>{}}),mY=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=xn(r);return m.createElement(pY,{scope:e.__scopeMenu,value:n,onValueChange:o},m.createElement(uY,le({},i,{ref:t})))}),vY="MenuRadioItem",bY=m.forwardRef((e,t)=>{const{value:n,...r}=e,i=gY(vY,e.__scopeMenu),o=n===i.value;return m.createElement(ck,{scope:e.__scopeMenu,checked:o},m.createElement(hy,le({role:"menuitemradio","aria-checked":o},r,{ref:t,"data-state":py(o),onSelect:Ce(r.onSelect,()=>{var s;return(s=i.onValueChange)===null||s===void 0?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})))}),lk="MenuItemIndicator",[ck,yY]=ma(lk,{checked:!1}),xY=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=yY(lk,n);return m.createElement(vn,{present:r||xp(o.checked)||o.checked===!0},m.createElement(Be.span,le({},i,{ref:t,"data-state":py(o.checked)})))}),wY=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Be.div,le({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),_Y="MenuSub",[nfe,uk]=ma(_Y),yp="MenuSubTrigger",SY=m.forwardRef((e,t)=>{const n=va(yp,e.__scopeMenu),r=Uu(yp,e.__scopeMenu),i=uk(yp,e.__scopeMenu),o=uy(yp,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),m.createElement(rk,le({asChild:!0},c),m.createElement(ak,le({id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":dk(n.open)},e,{ref:cf(t,i.onTriggerChange),onClick:f=>{var g;(g=e.onClick)===null||g===void 0||g.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ce(e.onPointerMove,Gu(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Ce(e.onPointerLeave,Gu(f=>{var g;d();const p=(g=n.content)===null||g===void 0?void 0:g.getBoundingClientRect();if(p){var v;const y=(v=n.content)===null||v===void 0?void 0:v.dataset.side,x=y==="right",w=x?-5:5,S=p[x?"left":"right"],C=p[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+w,y:f.clientY},{x:S,y:p.top},{x:C,y:p.top},{x:C,y:p.bottom},{x:S,y:p.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ce(e.onKeyDown,f=>{const g=o.searchRef.current!=="";if(!(e.disabled||g&&f.key===" ")&&QG[r.dir].includes(f.key)){var p;n.onOpenChange(!0),(p=n.content)===null||p===void 0||p.focus(),f.preventDefault()}})})))}),CY="MenuSubContent",EY=m.forwardRef((e,t)=>{const n=ok(wi,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=va(wi,e.__scopeMenu),s=Uu(wi,e.__scopeMenu),a=uk(CY,e.__scopeMenu),l=m.useRef(null),c=et(t,l);return m.createElement(qu.Provider,{scope:e.__scopeMenu},m.createElement(vn,{present:r||o.open},m.createElement(qu.Slot,{scope:e.__scopeMenu},m.createElement(dy,le({id:a.contentId,"aria-labelledby":a.triggerId},i,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Ce(e.onFocusOutside,d=>{d.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ce(e.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:Ce(e.onKeyDown,d=>{const f=d.currentTarget.contains(d.target),g=ZG[s.dir].includes(d.key);if(f&&g){var p;o.onOpenChange(!1),(p=a.trigger)===null||p===void 0||p.focus(),d.preventDefault()}})})))))});function dk(e){return e?"open":"closed"}function xp(e){return e==="indeterminate"}function py(e){return xp(e)?"indeterminate":e?"checked":"unchecked"}function OY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function PY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function kY(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=PY(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function MY(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,d=t[s].y;l>r!=d>r&&n<(c-a)*(r-l)/(d-l)+a&&(i=!i)}return i}function DY(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return MY(n,t)}function Gu(e){return t=>t.pointerType==="mouse"?e(t):void 0}const TY=rY,AY=rk,IY=oY,NY=aY,RY=dY,LY=hy,$Y=fY,FY=mY,jY=bY,zY=xY,BY=wY,VY=SY,HY=EY,fk="DropdownMenu",[WY,rfe]=Pn(fk,[tk]),Nr=tk(),[qY,hk]=WY(fk),UY=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,l=Nr(t),c=m.useRef(null),[d=!1,f]=Qn({prop:i,defaultProp:o,onChange:s});return m.createElement(qY,{scope:t,triggerId:or(),triggerRef:c,contentId:or(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(g=>!g),[f]),modal:a},m.createElement(TY,le({},l,{open:d,onOpenChange:f,dir:r,modal:a}),n))},GY="DropdownMenuTrigger",YY=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=hk(GY,n),s=Nr(n);return m.createElement(AY,le({asChild:!0},s),m.createElement(Be.button,le({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},i,{ref:cf(t,o.triggerRef),onPointerDown:Ce(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:Ce(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),KY=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Nr(t);return m.createElement(IY,le({},r,n))},XY="DropdownMenuContent",QY=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=hk(XY,n),o=Nr(n),s=m.useRef(!1);return m.createElement(NY,le({id:i.contentId,"aria-labelledby":i.triggerId},o,r,{ref:t,onCloseAutoFocus:Ce(e.onCloseAutoFocus,a=>{var l;s.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Ce(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!i.modal||d)&&(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)"}}))}),ZY=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(RY,le({},i,r,{ref:t}))}),JY=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(LY,le({},i,r,{ref:t}))}),eK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement($Y,le({},i,r,{ref:t}))}),tK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(FY,le({},i,r,{ref:t}))}),nK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(jY,le({},i,r,{ref:t}))}),rK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(zY,le({},i,r,{ref:t}))}),iK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(BY,le({},i,r,{ref:t}))}),oK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(VY,le({},i,r,{ref:t}))}),sK=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Nr(n);return m.createElement(HY,le({},i,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),aK=UY,lK=YY,cK=KY,pk=QY,gk=ZY,mk=JY,vk=eK,uK=tK,bk=nK,yk=rK,xk=iK,wk=oK,_k=sK,Sk=aK,Ck=lK,dK=uK,fK=ue.forwardRef(({className:e,inset:t,children:n,...r},i)=>_.jsxs(wk,{ref:i,className:Pe("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,_.jsx(V2,{className:"ml-auto h-4 w-4"})]}));fK.displayName=wk.displayName;const hK=ue.forwardRef(({className:e,...t},n)=>_.jsx(_k,{ref:n,className:Pe("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}));hK.displayName=_k.displayName;const gy=ue.forwardRef(({className:e,sideOffset:t=4,...n},r)=>_.jsx(cK,{children:_.jsx(pk,{ref:r,sideOffset:t,className:Pe("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})}));gy.displayName=pk.displayName;const wp=ue.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(mk,{ref:r,className:Pe("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}));wp.displayName=mk.displayName;const pK=ue.forwardRef(({className:e,children:t,checked:n,...r},i)=>_.jsxs(vk,{ref:i,className:Pe("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:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(yk,{children:_.jsx(Rh,{className:"h-4 w-4"})})}),t]}));pK.displayName=vk.displayName;const my=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(bk,{ref:r,className:Pe("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:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(yk,{children:_.jsx(H2,{className:"h-2 w-2 fill-current"})})}),t]}));my.displayName=bk.displayName;const Ek=ue.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(gk,{ref:r,className:Pe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Ek.displayName=gk.displayName;const Ok=ue.forwardRef(({className:e,...t},n)=>_.jsx(xk,{ref:n,className:Pe("-mx-1 my-1 h-px bg-muted",e),...t}));Ok.displayName=xk.displayName;function gK(){const{setTheme:e}=Cm(),t=be(n=>n.actions.setDashboardTheme);return _.jsxs(Sk,{children:[_.jsx(Ck,{asChild:!0,children:_.jsxs(it,{className:"h-7 p-2",variant:"outline",size:"sm",children:[_.jsx(rV,{strokeWidth:1.5,className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),_.jsx(QB,{strokeWidth:1.5,className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),_.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),_.jsxs(gy,{align:"end",children:[_.jsx(wp,{onClick:()=>{e("light"),t("light")},children:"Light"}),_.jsx(wp,{onClick:()=>{e("dark"),t("dark")},children:"Dark"}),_.jsx(wp,{onClick:()=>{e("system"),t("system")},children:"System"})]})]})}function vy(e){var t;return{...e,sheets:(t=e==null?void 0:e.sheets)==null?void 0:t.map(n=>{var r;return{...n,cards:(r=n==null?void 0:n.cards)==null?void 0:r.map(i=>Pk(i))}})}}function Pk(e){var t,n,r,i;return{...e,cfg:{...e.cfg,data:{...(t=e.cfg)==null?void 0:t.data,labels:[],datasets:(i=(r=(n=e.cfg)==null?void 0:n.data)==null?void 0:r.datasets)==null?void 0:i.map(o=>({...o,data:[]}))}},customCfg:mK(e.customCfg),data:[]}}function mK(e){var t,n;return e?{...e,data:{...e==null?void 0:e.data,labels:[],datasets:(n=(t=e==null?void 0:e.data)==null?void 0:t.datasets)==null?void 0:n.map(r=>({...r,data:[]}))}}:null}function $l(e){return`semaphor:bookmark:${e}`}const kk="Dialog",[Mk,ife]=Pn(kk),[vK,_i]=Mk(kk),bK=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=m.useRef(null),l=m.useRef(null),[c=!1,d]=Qn({prop:r,defaultProp:i,onChange:o});return m.createElement(vK,{scope:t,triggerRef:a,contentRef:l,contentId:or(),titleId:or(),descriptionId:or(),open:c,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(f=>!f),[d]),modal:s},n)},yK="DialogTrigger",xK=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=_i(yK,n),o=et(t,i.triggerRef);return m.createElement(Be.button,le({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":yy(i.open)},r,{ref:o,onClick:Ce(e.onClick,i.onOpenToggle)}))}),Dk="DialogPortal",[wK,Tk]=Mk(Dk,{forceMount:void 0}),_K=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=_i(Dk,t);return m.createElement(wK,{scope:t,forceMount:n},m.Children.map(r,s=>m.createElement(vn,{present:n||o.open},m.createElement(Dh,{asChild:!0,container:i},s))))},by="DialogOverlay",SK=m.forwardRef((e,t)=>{const n=Tk(by,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=_i(by,e.__scopeDialog);return o.modal?m.createElement(vn,{present:r||o.open},m.createElement(CK,le({},i,{ref:t}))):null}),CK=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=_i(by,n);return m.createElement(hp,{as:no,allowPinchZoom:!0,shards:[i.contentRef]},m.createElement(Be.div,le({"data-state":yy(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Yu="DialogContent",EK=m.forwardRef((e,t)=>{const n=Tk(Yu,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=_i(Yu,e.__scopeDialog);return m.createElement(vn,{present:r||o.open},o.modal?m.createElement(OK,le({},i,{ref:t})):m.createElement(PK,le({},i,{ref:t})))}),OK=m.forwardRef((e,t)=>{const n=_i(Yu,e.__scopeDialog),r=m.useRef(null),i=et(t,n.contentRef,r);return m.useEffect(()=>{const o=r.current;if(o)return ap(o)},[]),m.createElement(Ak,le({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Ce(e.onFocusOutside,o=>o.preventDefault())}))}),PK=m.forwardRef((e,t)=>{const n=_i(Yu,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return m.createElement(Ak,le({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),Ak=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=_i(Yu,n),l=m.useRef(null),c=et(t,l);return rp(),m.createElement(m.Fragment,null,m.createElement(ip,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},m.createElement(wl,le({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":yy(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),kK="DialogTitle",MK=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=_i(kK,n);return m.createElement(Be.h2,le({id:i.titleId},r,{ref:t}))}),DK="DialogDescription",TK=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=_i(DK,n);return m.createElement(Be.p,le({id:i.descriptionId},r,{ref:t}))}),AK="DialogClose",IK=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=_i(AK,n);return m.createElement(Be.button,le({type:"button"},r,{ref:t,onClick:Ce(e.onClick,()=>i.onOpenChange(!1))}))});function yy(e){return e?"open":"closed"}const NK=bK,RK=xK,LK=_K,Ik=SK,Nk=EK,Rk=MK,Lk=TK,$K=IK,xy=NK,wy=RK,FK=LK,$k=ue.forwardRef(({className:e,...t},n)=>_.jsx(Ik,{ref:n,className:Pe("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}));$k.displayName=Ik.displayName;const _p=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(FK,{children:[_.jsx($k,{}),_.jsxs(Nk,{ref:r,className:Pe("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,_.jsxs($K,{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:[_.jsx(sV,{className:"h-4 w-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));_p.displayName=Nk.displayName;const Sp=({className:e,...t})=>_.jsx("div",{className:Pe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Sp.displayName="DialogHeader";const _y=({className:e,...t})=>_.jsx("div",{className:Pe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});_y.displayName="DialogFooter";const Cp=ue.forwardRef(({className:e,...t},n)=>_.jsx(Rk,{ref:n,className:Pe("text-lg font-semibold leading-none tracking-tight",e),...t}));Cp.displayName=Rk.displayName;const Ep=ue.forwardRef(({className:e,...t},n)=>_.jsx(Lk,{ref:n,className:Pe("text-sm text-muted-foreground",e),...t}));Ep.displayName=Lk.displayName;const Ku=ue.forwardRef(({className:e,type:t,...n},r)=>_.jsx("input",{type:t,className:Pe("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}));Ku.displayName="Input";function jK(){const[e,t]=m.useState(""),[n,r]=m.useState(!1),[i,o]=m.useState(!1),s=be(l=>l.dashboard);function a(){const l=vy(s),c=$l(s.id),d=JSON.parse(localStorage.getItem(c)||"[]");if(d.some(g=>g.name===e)){r(!0);return}d.push({name:e,template:l}),localStorage.setItem(c,JSON.stringify(d)),o(!1)}return _.jsxs(xy,{open:i,onOpenChange:o,children:[_.jsx(wy,{asChild:!0,children:_.jsx(it,{variant:"outline",className:"h-7 p-2",size:"sm",children:_.jsx(WB,{className:"h-4 w-4",strokeWidth:1.5})})}),_.jsxs(_p,{className:"sm:max-w-[425px]",children:[_.jsxs(Sp,{children:[_.jsx(Cp,{children:"Add a Lens"}),_.jsx(Ep,{children:"Lenses are private by default and are only visible to you."})]}),_.jsx("div",{className:"grid gap-4 py-4",children:_.jsxs("div",{className:"grid grid-cols-8 items-center gap-4",children:[_.jsx(fa,{className:"text-right",children:"Name"}),_.jsx(Ku,{value:e,onChange:l=>{n&&r(!1),t(l.target.value)},id:"name",className:"col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"})]})}),n&&_.jsx("p",{className:"text-sm",children:"The bookmark name already exists. Use a differnet name."}),_.jsx(_y,{children:_.jsx(it,{type:"submit",disabled:!e,onClick:a,children:"Save"})})]})]})}function zK(){const[e,t]=m.useState(!1),[n,r]=m.useState(""),i=be(f=>f.dashboard),[o,s]=m.useState([]),a=be(f=>f.actions.setDashboard),l=be(f=>f.actions.setBookmarkKey);m.useEffect(()=>{const f=$l(i.id),g=JSON.parse(localStorage.getItem(f)||"[]");s(g)},[e,i]);function c(f){if(f===n)return;const g=o.find(v=>v.name===f),p=g==null?void 0:g.template;p&&(a(p),l(f==="Original"?"":f)),r(f)}function d(f){const g=$l(i.id),v=JSON.parse(localStorage.getItem(g)||"[]").filter(y=>y.name!==f);localStorage.setItem(g,JSON.stringify(v)),s(v)}return _.jsxs(Sk,{open:e,onOpenChange:t,children:[_.jsx(Ck,{asChild:!0,children:_.jsx(it,{variant:"outline",className:"h-7 p-2",children:"Lenses"})}),_.jsxs(gy,{className:"w-56",children:[_.jsx(Ek,{children:"Private Lenses"}),_.jsx(Ok,{}),_.jsxs(dK,{value:n,onValueChange:c,children:[_.jsx(my,{value:"Original",children:"Original"}),o.filter(f=>f.name!="Original").map((f,g)=>_.jsxs(my,{className:"xbg-red-100 flex justify-between",value:f.name,children:[_.jsx("p",{children:f.name}),_.jsx(na,{onClick:p=>{p.preventDefault(),d(f.name)},className:"h-3 w-3 hover:cursor-pointer",strokeWidth:1.5})]},g))]})]})]})}function BK(){const e=be(C=>C.bookmarkKey),t=be(C=>C.dashboard),n=be(C=>C.selectedSheetId),r=be(C=>C.isDashboardEditing),i=be(C=>C.isVisualEditing),o=be(C=>C.showFilters),s=be(C=>C.showDashboardJSON),a=be(C=>C.actions.setShowDashboardJSON),l=be(C=>C.onSaveFunction),c=be(C=>C.actions.setShowFilters),{addCard:d,getSelectedSheet:f,setIsDashboardEditing:g,setSelectedCardId:p,setSelectedCard:v}=be(C=>C.actions),y=f(),x=()=>{if(!r||!y)return;const C={id:yh(),title:"New Card",description:"New Card Description",preferences:{filterOnClick:!0},type:"bar",sql:"select COUNT(*) from YOUR_TABLE",data:[]};d(y.id,C),p(n,C.id),v(C)},w=()=>{g(!0)};function S(){if(!e||e==="")return;const C=vy(t),P=$l(t.id),O=JSON.parse(localStorage.getItem(P)||"[]"),k=O.findIndex(A=>A.name===e);k!==-1?O[k]={name:e,template:C}:O.push({name:e,template:C}),localStorage.setItem(P,JSON.stringify(O)),l==null||l(C)}return _.jsxs("div",{className:`flex items-center justify-between gap-2 border-b-[3px]
|
|
428
|
+
border-b-muted py-2 `,role:"dashboard-controls",children:[_.jsx("div",{children:e}),_.jsxs("div",{className:"flex gap-2",children:[r&&!i&&_.jsx(jK,{}),!i&&_.jsx(zK,{}),r&&!i&&_.jsxs(it,{variant:"outline",className:"h-7 p-2",size:"sm",disabled:!r,onClick:x,children:[_.jsx(eV,{className:" mr-2 h-4 w-4",strokeWidth:1.5}),"Add Card"]}),!r&&_.jsx(it,{variant:"outline",className:"h-7 p-2",onClick:w,size:"sm",children:_.jsx(ZB,{className:"h-4 w-4",strokeWidth:1.5})}),r&&!i&&_.jsx(it,{variant:"outline",role:"close",className:"h-7 p-2",onClick:()=>g(!1),size:"sm",children:_.jsx(na,{className:"h-4 w-4",strokeWidth:1.5})}),r&&!i&&_.jsx(it,{className:"h-7 p-2",variant:"outline",onClick:S,size:"sm",children:_.jsx(tV,{className:"h-4 w-4",strokeWidth:1.5})}),!o&&!i&&r&&_.jsx(it,{className:"h-7 p-2",variant:"outline",onClick:()=>c(!0),size:"sm",children:_.jsx(W2,{className:"h-4 w-4",strokeWidth:1.5})}),!i&&r&&_.jsx("div",{className:" flex items-center space-x-2",children:_.jsx(it,{className:"h-7 p-2",onClick:()=>a(!s),size:"sm",variant:"outline",children:_.jsx(YB,{className:"h-4 w-4",strokeWidth:1.5})})}),_.jsx(gK,{})]})]})}const Fk=m.forwardRef(({className:e,...t},n)=>_.jsx("div",{role:"editor-panel",ref:n,className:Pe("flex grow min-h-[80vh]",e),...t}));Fk.displayName="EditorPanel";const jk=m.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe(" flex flex-col space-y-2 w-[270px]",e),...t}));jk.displayName="EditorAside";const zk=m.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Pe(" grow",e),...t}));zk.displayName="EditorMain";function Op(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const VK=[" ","Enter","ArrowUp","ArrowDown"],HK=[" ","Enter"],Pp="Select",[kp,Mp,WK]=uf(Pp),[Fl,ofe]=Pn(Pp,[WK,Fi]),Sy=Fi(),[qK,ba]=Fl(Pp),[UK,GK]=Fl(Pp),YK=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:f,disabled:g,required:p}=e,v=Sy(t),[y,x]=m.useState(null),[w,S]=m.useState(null),[C,P]=m.useState(!1),O=Ls(c),[k=!1,A]=Qn({prop:r,defaultProp:i,onChange:o}),[L,F]=Qn({prop:s,defaultProp:a,onChange:l}),z=m.useRef(null),B=y?!!y.closest("form"):!0,[V,X]=m.useState(new Set),K=Array.from(V).map($=>$.props.value).join(";");return m.createElement(Cu,v,m.createElement(qK,{required:p,scope:t,trigger:y,onTriggerChange:x,valueNode:w,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:P,contentId:or(),value:L,onValueChange:F,open:k,onOpenChange:A,dir:O,triggerPointerDownPosRef:z,disabled:g},m.createElement(kp.Provider,{scope:t},m.createElement(UK,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback($=>{X(J=>new Set(J).add($))},[]),onNativeOptionRemove:m.useCallback($=>{X(J=>{const G=new Set(J);return G.delete($),G})},[])},n)),B?m.createElement(Kk,{key:K,"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:L,onChange:$=>F($.target.value),disabled:g},L===void 0?m.createElement("option",{value:""}):null,Array.from(V)):null))},KK="SelectTrigger",XK=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Sy(n),s=ba(KK,n),a=s.disabled||r,l=et(t,s.onTriggerChange),c=Mp(n),[d,f,g]=Xk(v=>{const y=c().filter(S=>!S.disabled),x=y.find(S=>S.value===s.value),w=Qk(y,v,x);w!==void 0&&s.onValueChange(w.value)}),p=()=>{a||(s.onOpenChange(!0),g())};return m.createElement(Eu,le({asChild:!0},o),m.createElement(Be.button,le({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":Yk(s.value)?"":void 0},i,{ref:l,onClick:Ce(i.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Ce(i.onPointerDown,v=>{const y=v.target;y.hasPointerCapture(v.pointerId)&&y.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(p(),s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Ce(i.onKeyDown,v=>{const y=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(y&&v.key===" ")&&VK.includes(v.key)&&(p(),v.preventDefault())})})))}),QK="SelectValue",ZK=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,l=ba(QK,n),{onValueNodeHasChildrenChange:c}=l,d=o!==void 0,f=et(t,l.onValueNodeChange);return Vn(()=>{c(d)},[c,d]),m.createElement(Be.span,le({},a,{ref:f,style:{pointerEvents:"none"}}),Yk(l.value)?m.createElement(m.Fragment,null,s):o)}),JK=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return m.createElement(Be.span,le({"aria-hidden":!0},i,{ref:t}),r||"▼")}),eX=e=>m.createElement(Dh,le({asChild:!0},e)),jl="SelectContent",tX=m.forwardRef((e,t)=>{const n=ba(jl,e.__scopeSelect),[r,i]=m.useState();if(Vn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?kt.createPortal(m.createElement(Bk,{scope:e.__scopeSelect},m.createElement(kp.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),o):null}return m.createElement(nX,le({},e,{ref:t}))}),_o=10,[Bk,ya]=Fl(jl),nX=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:y,avoidCollisions:x,...w}=e,S=ba(jl,n),[C,P]=m.useState(null),[O,k]=m.useState(null),A=et(t,de=>P(de)),[L,F]=m.useState(null),[z,B]=m.useState(null),V=Mp(n),[X,K]=m.useState(!1),$=m.useRef(!1);m.useEffect(()=>{if(C)return ap(C)},[C]),rp();const J=m.useCallback(de=>{const[ie,...ee]=V().map(oe=>oe.ref.current),[H]=ee.slice(-1),ye=document.activeElement;for(const oe of de)if(oe===ye||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===ie&&O&&(O.scrollTop=0),oe===H&&O&&(O.scrollTop=O.scrollHeight),oe==null||oe.focus(),document.activeElement!==ye))return},[V,O]),G=m.useCallback(()=>J([L,C]),[J,L,C]);m.useEffect(()=>{X&&G()},[X,G]);const{onOpenChange:q,triggerPointerDownPosRef:se}=S;m.useEffect(()=>{if(C){let de={x:0,y:0};const ie=H=>{var ye,oe,Te,Fe;de={x:Math.abs(Math.round(H.pageX)-((ye=(oe=se.current)===null||oe===void 0?void 0:oe.x)!==null&&ye!==void 0?ye:0)),y:Math.abs(Math.round(H.pageY)-((Te=(Fe=se.current)===null||Fe===void 0?void 0:Fe.y)!==null&&Te!==void 0?Te:0))}},ee=H=>{de.x<=10&&de.y<=10?H.preventDefault():C.contains(H.target)||q(!1),document.removeEventListener("pointermove",ie),se.current=null};return se.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",ee,{capture:!0})}}},[C,q,se]),m.useEffect(()=>{const de=()=>q(!1);return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[q]);const[D,W]=Xk(de=>{const ie=V().filter(ye=>!ye.disabled),ee=ie.find(ye=>ye.ref.current===document.activeElement),H=Qk(ie,de,ee);H&&setTimeout(()=>H.ref.current.focus())}),re=m.useCallback((de,ie,ee)=>{const H=!$.current&&!ee;(S.value!==void 0&&S.value===ie||H)&&(F(de),H&&($.current=!0))},[S.value]),N=m.useCallback(()=>C==null?void 0:C.focus(),[C]),ne=m.useCallback((de,ie,ee)=>{const H=!$.current&&!ee;(S.value!==void 0&&S.value===ie||H)&&B(de)},[S.value]),ge=r==="popper"?Vk:rX,he=ge===Vk?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:y,avoidCollisions:x}:{};return m.createElement(Bk,{scope:n,content:C,viewport:O,onViewportChange:k,itemRefCallback:re,selectedItem:L,onItemLeave:N,itemTextRefCallback:ne,focusSelectedItem:G,selectedItemText:z,position:r,isPositioned:X,searchRef:D},m.createElement(hp,{as:no,allowPinchZoom:!0},m.createElement(ip,{asChild:!0,trapped:S.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:Ce(i,de=>{var ie;(ie=S.trigger)===null||ie===void 0||ie.focus({preventScroll:!0}),de.preventDefault()})},m.createElement(wl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>S.onOpenChange(!1)},m.createElement(ge,le({role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:de=>de.preventDefault()},w,he,{onPlaced:()=>K(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Ce(w.onKeyDown,de=>{const ie=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!ie&&de.key.length===1&&W(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let H=V().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(de.key)&&(H=H.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const ye=de.target,oe=H.indexOf(ye);H=H.slice(oe+1)}setTimeout(()=>J(H)),de.preventDefault()}})}))))))}),rX=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=ba(jl,n),s=ya(jl,n),[a,l]=m.useState(null),[c,d]=m.useState(null),f=et(t,A=>d(A)),g=Mp(n),p=m.useRef(!1),v=m.useRef(!0),{viewport:y,selectedItem:x,selectedItemText:w,focusSelectedItem:S}=s,C=m.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&y&&x&&w){const A=o.trigger.getBoundingClientRect(),L=c.getBoundingClientRect(),F=o.valueNode.getBoundingClientRect(),z=w.getBoundingClientRect();if(o.dir!=="rtl"){const ye=z.left-L.left,oe=F.left-ye,Te=A.left-oe,Fe=A.width+Te,He=Math.max(Fe,L.width),Ke=window.innerWidth-_o,St=a0(oe,[_o,Ke-He]);a.style.minWidth=Fe+"px",a.style.left=St+"px"}else{const ye=L.right-z.right,oe=window.innerWidth-F.right-ye,Te=window.innerWidth-A.right-oe,Fe=A.width+Te,He=Math.max(Fe,L.width),Ke=window.innerWidth-_o,St=a0(oe,[_o,Ke-He]);a.style.minWidth=Fe+"px",a.style.right=St+"px"}const B=g(),V=window.innerHeight-_o*2,X=y.scrollHeight,K=window.getComputedStyle(c),$=parseInt(K.borderTopWidth,10),J=parseInt(K.paddingTop,10),G=parseInt(K.borderBottomWidth,10),q=parseInt(K.paddingBottom,10),se=$+J+X+q+G,D=Math.min(x.offsetHeight*5,se),W=window.getComputedStyle(y),re=parseInt(W.paddingTop,10),N=parseInt(W.paddingBottom,10),ne=A.top+A.height/2-_o,ge=V-ne,he=x.offsetHeight/2,de=x.offsetTop+he,ie=$+J+de,ee=se-ie;if(ie<=ne){const ye=x===B[B.length-1].ref.current;a.style.bottom="0px";const oe=c.clientHeight-y.offsetTop-y.offsetHeight,Te=Math.max(ge,he+(ye?N:0)+oe+G),Fe=ie+Te;a.style.height=Fe+"px"}else{const ye=x===B[0].ref.current;a.style.top="0px";const Te=Math.max(ne,$+y.offsetTop+(ye?re:0)+he)+ee;a.style.height=Te+"px",y.scrollTop=ie-ne+y.offsetTop}a.style.margin=`${_o}px 0`,a.style.minHeight=D+"px",a.style.maxHeight=V+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[g,o.trigger,o.valueNode,a,c,y,x,w,o.dir,r]);Vn(()=>C(),[C]);const[P,O]=m.useState();Vn(()=>{c&&O(window.getComputedStyle(c).zIndex)},[c]);const k=m.useCallback(A=>{A&&v.current===!0&&(C(),S==null||S(),v.current=!1)},[C,S]);return m.createElement(iX,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:k},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P}},m.createElement(Be.div,le({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),Vk=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=_o,...o}=e,s=Sy(n);return m.createElement(Ou,le({},s,o,{ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[iX,Cy]=Fl(jl,{}),Hk="SelectViewport",oX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ya(Hk,n),o=Cy(Hk,n),s=et(t,i.onViewportChange),a=m.useRef(0);return m.createElement(m.Fragment,null,m.createElement("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}"}}),m.createElement(kp.Slot,{scope:n},m.createElement(Be.div,le({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Ce(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&d){const g=Math.abs(a.current-c.scrollTop);if(g>0){const p=window.innerHeight-_o*2,v=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),x=Math.max(v,y);if(x<p){const w=x+g,S=Math.min(p,w),C=w-S;d.style.height=S+"px",d.style.bottom==="0px"&&(c.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),sX="SelectGroup",[aX,lX]=Fl(sX),cX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=or();return m.createElement(aX,{scope:n,id:i},m.createElement(Be.div,le({role:"group","aria-labelledby":i},r,{ref:t})))}),uX="SelectLabel",dX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=lX(uX,n);return m.createElement(Be.div,le({id:i.id},r,{ref:t}))}),Ey="SelectItem",[fX,Wk]=Fl(Ey),hX=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=ba(Ey,n),l=ya(Ey,n),c=a.value===r,[d,f]=m.useState(o??""),[g,p]=m.useState(!1),v=et(t,w=>{var S;return(S=l.itemRefCallback)===null||S===void 0?void 0:S.call(l,w,r,i)}),y=or(),x=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.createElement(fX,{scope:n,value:r,disabled:i,textId:y,isSelected:c,onItemTextChange:m.useCallback(w=>{f(S=>{var C;return S||((C=w==null?void 0:w.textContent)!==null&&C!==void 0?C:"").trim()})},[])},m.createElement(kp.ItemSlot,{scope:n,value:r,disabled:i,textValue:d},m.createElement(Be.div,le({role:"option","aria-labelledby":y,"data-highlighted":g?"":void 0,"aria-selected":c&&g,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},s,{ref:v,onFocus:Ce(s.onFocus,()=>p(!0)),onBlur:Ce(s.onBlur,()=>p(!1)),onPointerUp:Ce(s.onPointerUp,x),onPointerMove:Ce(s.onPointerMove,w=>{if(i){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}else w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(s.onPointerLeave,w=>{if(w.currentTarget===document.activeElement){var S;(S=l.onItemLeave)===null||S===void 0||S.call(l)}}),onKeyDown:Ce(s.onKeyDown,w=>{var S;((S=l.searchRef)===null||S===void 0?void 0:S.current)!==""&&w.key===" "||(HK.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})}))))}),Dp="SelectItemText",pX=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=ba(Dp,n),a=ya(Dp,n),l=Wk(Dp,n),c=GK(Dp,n),[d,f]=m.useState(null),g=et(t,w=>f(w),l.onItemTextChange,w=>{var S;return(S=a.itemTextRefCallback)===null||S===void 0?void 0:S.call(a,w,l.value,l.disabled)}),p=d==null?void 0:d.textContent,v=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},p),[l.disabled,l.value,p]),{onNativeOptionAdd:y,onNativeOptionRemove:x}=c;return Vn(()=>(y(v),()=>x(v)),[y,x,v]),m.createElement(m.Fragment,null,m.createElement(Be.span,le({id:l.textId},o,{ref:g})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?kt.createPortal(o.children,s.valueNode):null)}),gX="SelectItemIndicator",mX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Wk(gX,n).isSelected?m.createElement(Be.span,le({"aria-hidden":!0},r,{ref:t})):null}),qk="SelectScrollUpButton",vX=m.forwardRef((e,t)=>{const n=ya(qk,e.__scopeSelect),r=Cy(qk,e.__scopeSelect),[i,o]=m.useState(!1),s=et(t,r.onScrollButtonChange);return Vn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollTop>0;o(c)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?m.createElement(Gk,le({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),Uk="SelectScrollDownButton",bX=m.forwardRef((e,t)=>{const n=ya(Uk,e.__scopeSelect),r=Cy(Uk,e.__scopeSelect),[i,o]=m.useState(!1),s=et(t,r.onScrollButtonChange);return Vn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)<c;o(d)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?m.createElement(Gk,le({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),Gk=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ya("SelectScrollButton",n),s=m.useRef(null),a=Mp(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),Vn(()=>{var c;const d=a().find(f=>f.ref.current===document.activeElement);d==null||(c=d.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[a]),m.createElement(Be.div,le({"aria-hidden":!0},i,{ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ce(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Ce(i.onPointerMove,()=>{var c;(c=o.onItemLeave)===null||c===void 0||c.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Ce(i.onPointerLeave,()=>{l()})}))}),yX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(Be.div,le({"aria-hidden":!0},r,{ref:t}))});function Yk(e){return e===""||e===void 0}const Kk=m.forwardRef((e,t)=>{const{value:n,...r}=e,i=m.useRef(null),o=et(t,i),s=Op(n);return m.useEffect(()=>{const a=i.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&d){const f=new Event("change",{bubbles:!0});d.call(a,n),a.dispatchEvent(f)}},[s,n]),m.createElement(T2,{asChild:!0},m.createElement("select",le({},r,{ref:o,defaultValue:n})))});Kk.displayName="BubbleSelect";function Xk(e){const t=xn(e),n=m.useRef(""),r=m.useRef(0),i=m.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function Qk(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=xX(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function xX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const wX=YK,Zk=XK,_X=ZK,SX=JK,CX=eX,Jk=tX,EX=oX,OX=cX,eM=dX,tM=hX,PX=pX,kX=mX,nM=vX,rM=bX,iM=yX,oM=wX,sM=OX,aM=_X,Oy=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(Zk,{ref:r,className:Pe("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,_.jsx(SX,{asChild:!0,children:_.jsx(Hb,{className:"h-4 w-4 opacity-50"})})]}));Oy.displayName=Zk.displayName;const lM=ue.forwardRef(({className:e,...t},n)=>_.jsx(nM,{ref:n,className:Pe("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(GB,{className:"h-4 w-4"})}));lM.displayName=nM.displayName;const cM=ue.forwardRef(({className:e,...t},n)=>_.jsx(rM,{ref:n,className:Pe("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(Hb,{className:"h-4 w-4"})}));cM.displayName=rM.displayName;const Py=ue.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>_.jsx(CX,{children:_.jsxs(Jk,{ref:i,className:Pe("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:[_.jsx(lM,{}),_.jsx(EX,{className:Pe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),_.jsx(cM,{})]})}));Py.displayName=Jk.displayName;const Tp=ue.forwardRef(({className:e,...t},n)=>_.jsx(eM,{ref:n,className:Pe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Tp.displayName=eM.displayName;const xa=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(tM,{ref:r,className:Pe("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:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(kX,{children:_.jsx(Rh,{className:"h-4 w-4"})})}),_.jsx(PX,{children:t})]}));xa.displayName=tM.displayName;const MX=ue.forwardRef(({className:e,...t},n)=>_.jsx(iM,{ref:n,className:Pe("-mx-1 my-1 h-px bg-muted",e),...t}));MX.displayName=iM.displayName;function Ap({title:e,items:t,value:n,isLoading:r,isError:i,onChange:o}){const s=r?"Loading...":i?"Error":n;function a(){if(e==="Connection")return _.jsx(JB,{className:" rotate-90",strokeWidth:1,size:16});if(e==="Database")return _.jsx(KB,{strokeWidth:1,size:16});if(e==="Schema")return _.jsx(iV,{strokeWidth:1,size:16});if(e==="Table")return _.jsx(Wb,{strokeWidth:1,size:16})}return _.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx("div",{className:" shrink-0",children:a()}),_.jsxs(oM,{value:s,onValueChange:o,children:[_.jsx(Oy,{className:"focus:ring-offset-0 focus:ring-1 h-7 w-[190px] ",children:_.jsx(aM,{placeholder:r?"Loading...":i?"Error":`Select ${e}`})}),_.jsx(Py,{children:_.jsxs(sM,{children:[r?_.jsx(Tp,{children:"Loading..."}):_.jsx(Tp,{children:e}),_.jsx(_.Fragment,{children:t&&t.map(l=>_.jsx(xa,{value:l.id,children:l.name},l.id))}),(r||i)&&_.jsx(xa,{value:s,children:s})]})})]})]})}function DX({column:e}){const[t,n]=m.useState(!1),r=_e(d=>d.selectedTableName),i=_e(d=>d.selectedSchemaName),o=_e(d=>d.sqlGen),s=_e(d=>d.actions.setSqlGen),a=_e(d=>d.actions.setCardSql),l=_e(d=>d.actions.setRunSql);function c(d,f){const g=WO(d,o,f);s(g);const p=HO(g,i||"",r);p&&(a(p),l(!0)),n(!1)}return _.jsxs(pp,{open:t,onOpenChange:n,children:[_.jsx(gp,{asChild:!0,children:_.jsx(Hj,{className:"w-3 h-3 text-foreground/40 cursor-pointer"})}),_.jsx(Wu,{align:"center",className:" p-0 w-18 rounded-none shadow-none border-muted",children:_.jsxs("ul",{className:"text-xs ",children:[_.jsx("li",{onClick:()=>c(e,"COUNT"),className:" px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Count"}),_.jsx("li",{onClick:()=>c(e,"AVG"),className:" px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Avg"}),_.jsx("li",{onClick:()=>c(e,"SUM"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Sum"}),_.jsx("li",{onClick:()=>c(e,"MAX"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Max"}),_.jsx("li",{onClick:()=>c(e,"MIN"),className:"px-3 p-1 hover:bg-muted transition-colors cursor-pointer",children:"Min"})]})})]})}function uM({column:e}){return _.jsxs(Bb,{children:[_.jsx(I2,{asChild:!0,children:O0.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"T"}):Dl.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"#"}):Iu.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"D"}):VO.includes(e.data_type.toLowerCase())?_.jsx("span",{className:" font-thin",children:"B"}):_.jsx("span",{className:" font-thin",children:"?"})}),_.jsx(Ih,{children:_.jsx("p",{className:"text-xs font-mono",children:e.data_type})})]})}function TX({schemaName:e,tableName:t,columns:n,status:r}){const i=_e(f=>f.sqlGen),o=_e(f=>f.actions.setRunSql),s=_e(f=>f.actions.setSqlGen),a=_e(f=>f.actions.setIsShowingVisual),l=_e(f=>f.actions.setCardSql);function c(f){const g=WO(f,i);s(g);const p=HO(g,e,t);p&&(l(p),o(!0))}function d(){const f=k0(e,t);a(!1),l(`SELECT * FROM ${f} LIMIT 10`),o(!0)}return _.jsxs("div",{className:"px-4",children:[_.jsx("div",{className:" font-medium px-2 pt-2 pb-3",children:_.jsxs(it,{disabled:r!=="Success",onClick:d,variant:"secondary",className:" h-7 flex w-full",children:[r!=="Success"&&_.jsx(ku,{className:" w-4 h-4 animate-spin mr-2 text-foreground/50"}),"Show top 10 rows"]})}),_.jsxs(Pl,{className:`w-full ${t==="api"?"h-[74vh]":"h-[60vh]"}`,children:[n==null?void 0:n.map(f=>_.jsxs("div",{onClick:()=>c(f),className:Pe(" text-sm flex items-center justify-between px-3 py-[6px] transition-colors hover:bg-muted/50 cursor-pointer rounded ",{" bg-muted":BW(f,i)}),children:[_.jsxs("div",{className:"flex items-center space-x-2 ",children:[_.jsx(uM,{column:f}),_.jsx("span",{children:f.column_name})]}),Dl.includes(f.data_type)&&_.jsx("div",{onClick:g=>g.stopPropagation(),className:" flex items-center justify-end ",children:_.jsx(DX,{column:f})})]},f.column_name)),_.jsx(Hh,{orientation:"vertical"}),_.jsx(Hh,{orientation:"horizontal"})]})]})}function dM({ColumnsComponent:e}){const t=_e(K=>K.selectedConnectionId);_e(K=>K.card.sql);const n=_e(K=>K.selectedDatabaseName),r=_e(K=>K.selectedSchemaName),i=_e(K=>K.selectedTableName),o=_e(K=>K.actions.setSelectedConnectionId),s=_e(K=>K.actions.setSelectedDatabaseName),a=_e(K=>K.actions.setSelectedSchemaName),l=_e(K=>K.actions.setSelectedTableName),c=_e(K=>K.actions.setCardSql),{connectionItems:d,schemaItems:f,databaseItems:g,tableItems:p,columns:v,isConnectionsLoading:y,isConnectionsError:x,isDatabasesLoadingOrFetching:w,isDatabaseError:S,isSchemaLoadingOrFetching:C,isSchemaError:P,isColumnsError:O,isColumnsLoadingOrFetching:k,isAPIConnection:A}=iH();m.useEffect(()=>{A&&(s("NA"),a(""),l("api"))},[A,c,l,a,s]);const L=A?"api":i||"",F=A?"":r||"";function z(K){a(K),l("")}function B(K){s(K),a(""),l("")}function V(K){o(K)}function X(){return e?e(F,L,v):_.jsx(TX,{schemaName:F,tableName:L,columns:v,status:k?"Loading...":O?"Error":"Success"})}return _.jsxs("aside",{className:" grow flex flex-col xbg-red-100 ",children:[_.jsxs("section",{className:"space-y-3 pt-4 pb-3 px-6",children:[_.jsx(Ap,{items:d,title:"Connection",value:t||"",onChange:V,isLoading:y,isError:x}),!A&&_.jsxs(_.Fragment,{children:[_.jsx(Ap,{onChange:B,isError:S,isLoading:w,items:g,value:n||"",title:"Database"}),_.jsx(Ap,{onChange:z,isError:P,isLoading:C,items:f,value:r||"",title:"Schema"}),_.jsx(Ap,{onChange:l,isError:S,items:p,isLoading:w,value:i||"",title:"Table"})]})]}),X(),_.jsx("div",{className:" grow justify-end flex flex-col pt-6 "})]})}const{createElement:zl,createContext:AX,createRef:sfe,forwardRef:fM,useCallback:Rr,useContext:hM,useEffect:wa,useImperativeHandle:pM,useLayoutEffect:IX,useMemo:NX,useRef:ei,useState:Ip}=ue,gM=ue.useId,Np=AX(null);Np.displayName="PanelGroupContext";const Xu=IX,RX=typeof gM=="function"?gM:()=>null;let LX=0;function ky(e=null){const t=RX(),n=ei(e||t||null);return n.current===null&&(n.current=""+LX++),e??n.current}function mM({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:d,onResize:f,order:g,style:p,tagName:v="div",...y}){const x=hM(Np);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:S,getPanelSize:C,getPanelStyle:P,groupId:O,isPanelCollapsed:k,registerPanel:A,resizePanel:L,unregisterPanel:F}=x,z=ky(s),B=ei({callbacks:{onCollapse:c,onExpand:d,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:a,minSize:l},id:z,idIsFromProps:s!==void 0,order:g});ei({didLogMissingDefaultSizeWarning:!1}),Xu(()=>{const{callbacks:X,constraints:K}=B.current;B.current.id=z,B.current.idIsFromProps=s!==void 0,B.current.order=g,X.onCollapse=c,X.onExpand=d,X.onResize=f,K.collapsedSize=n,K.collapsible=r,K.defaultSize=i,K.maxSize=a,K.minSize=l}),Xu(()=>{const X=B.current;return A(X),()=>{F(X)}},[g,z,A,F]),pM(o,()=>({collapse:()=>{w(B.current)},expand:()=>{S(B.current)},getId(){return z},getSize(){return C(B.current)},isCollapsed(){return k(B.current)},isExpanded(){return!k(B.current)},resize:X=>{L(B.current,X)}}),[w,S,C,k,z,L]);const V=P(B.current,i);return zl(v,{...y,children:e,className:t,style:{...V,...p},"data-panel":"","data-panel-id":z,"data-panel-group-id":O,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const vM=fM((e,t)=>zl(mM,{...e,forwardedRef:t}));mM.displayName="Panel",vM.displayName="forwardRef(Panel)";function st(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const bM=10;function Qu(e,t,n=bM){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function Lr(e,t,n){return Qu(e,t,n)===0}function Bl({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];st(r!=null);let{collapsedSize:i=0,collapsible:o,maxSize:s=100,minSize:a=0}=r;if(Qu(n,a)<0)if(o){const l=(i+a)/2;Qu(n,l)<0?n=i:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(bM)),n}function Zu({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:i}){if(Lr(e,0))return t;const o=[...t],[s,a]=r;st(s!=null),st(a!=null);let l=0;if(i==="keyboard"){{const d=e<0?a:s,f=n[d];if(st(f),f.collapsible){const g=t[d];st(g!=null);const p=n[d];st(p);const{collapsedSize:v=0,minSize:y=0}=p;if(Lr(g,v)){const x=y-g;Qu(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const d=e<0?s:a,f=n[d];st(f);const{collapsible:g}=f;if(g){const p=t[d];st(p!=null);const v=n[d];st(v);const{collapsedSize:y=0,minSize:x=0}=v;if(Lr(p,x)){const w=p-y;Qu(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}}{const d=e<0?1:-1;let f=e<0?a:s,g=0;for(;;){const v=t[f];st(v!=null);const x=Bl({panelConstraints:n,panelIndex:f,size:100})-v;if(g+=x,f+=d,f<0||f>=n.length)break}const p=Math.min(Math.abs(e),Math.abs(g));e=e<0?0-p:p}{let f=e<0?s:a;for(;f>=0&&f<n.length;){const g=Math.abs(e)-Math.abs(l),p=t[f];st(p!=null);const v=p-g,y=Bl({panelConstraints:n,panelIndex:f,size:v});if(!Lr(p,y)&&(l+=p-y,o[f]=y,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(Lr(l,0))return t;{const d=e<0?a:s,f=t[d];st(f!=null);const g=f+l,p=Bl({panelConstraints:n,panelIndex:d,size:g});if(o[d]=p,!Lr(p,g)){let v=g-p,x=e<0?a:s;for(;x>=0&&x<n.length;){const w=o[x];st(w!=null);const S=w+v,C=Bl({panelConstraints:n,panelIndex:x,size:S});if(Lr(w,C)||(v-=C-w,o[x]=C),Lr(v,0))break;e>0?x--:x++}}}const c=o.reduce((d,f)=>f+d,0);return Lr(c,100)?o:t}function $X({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,o=0,s=0;const a=n[0];st(a!=null),t.forEach((f,g)=>{const{constraints:p}=f,{maxSize:v=100,minSize:y=0}=p;g===a?(r=y,i=v):(o+=y,s+=v)});const l=Math.min(i,100-o),c=Math.max(r,100-s),d=e[a];return{valueMax:l,valueMin:c,valueNow:d}}function Ju(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function yM(e,t){const r=Ju(e).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return r??null}function xM(e,t){const n=yM(e,t);return n!=null?[n,n+1]:[-1,-1]}function wM(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function Rp(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function FX(e,t,n){var r,i,o,s;const a=Rp(t),l=Ju(e),c=a?l.indexOf(a):-1,d=(r=(i=n[c])===null||i===void 0?void 0:i.id)!==null&&r!==void 0?r:null,f=(o=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&o!==void 0?o:null;return[d,f]}function jX({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,setLayout:o}){ei({didWarnAboutMissingResizeHandle:!1}),Xu(()=>{const s=Ju(n);for(let a=0;a<i.length-1;a++){const{valueMax:l,valueMin:c,valueNow:d}=$X({layout:r,panelsArray:i,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const g=i[a];st(g),f.setAttribute("aria-controls",g.id),f.setAttribute("aria-valuemax",""+Math.round(l)),f.setAttribute("aria-valuemin",""+Math.round(c)),f.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{s.forEach((a,l)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,i]),wa(()=>{const s=t.current;st(s);const{panelDataArray:a}=s,l=wM(n);st(l!=null,`No group found for id "${n}"`);const c=Ju(n);st(c);const d=c.map(f=>{const g=f.getAttribute("data-panel-resize-handle-id");st(g);const[p,v]=FX(n,g,a);if(p==null||v==null)return()=>{};const y=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const w=a.findIndex(S=>S.id===p);if(w>=0){const S=a[w];st(S);const C=r[w],{collapsedSize:P=0,collapsible:O,minSize:k=0}=S.constraints;if(C!=null&&O){const A=Zu({delta:Lr(C,P)?k-P:P-C,layout:r,panelConstraints:a.map(L=>L.constraints),pivotIndices:xM(n,g),trigger:"keyboard"});r!==A&&o(A)}}break}}};return f.addEventListener("keydown",y),()=>{f.removeEventListener("keydown",y)}});return()=>{d.forEach(f=>f())}},[e,t,n,r,i,o])}function _M(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 SM(e){return e.type==="keydown"}function CM(e){return e.type.startsWith("mouse")}function EM(e){return e.type.startsWith("touch")}function OM(e,t){const n=e==="horizontal";if(CM(t))return n?t.clientX:t.clientY;if(EM(t)){const r=t.touches[0];return st(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function zX(e,t,n,r){const i=n==="horizontal",o=Rp(t);st(o);const s=o.getAttribute("data-panel-group-id");st(s);let{initialCursorPosition:a}=r;const l=OM(n,e),c=wM(s);st(c);const d=c.getBoundingClientRect(),f=i?d.width:d.height;return(l-a)/f*100}function BX(e,t,n,r,i){if(SM(e)){const o=n==="horizontal";let s=0;e.shiftKey?s=100:i!=null?s=i:s=10;let a=0;switch(e.key){case"ArrowDown":a=o?0:s;break;case"ArrowLeft":a=o?-s:0;break;case"ArrowRight":a=o?s:0;break;case"ArrowUp":a=o?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:zX(e,t,n,r)}function VX({panelDataArray:e}){const t=Array(e.length),n=e.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<e.length;o++){const s=n[o];st(s);const{defaultSize:a}=s;a!=null&&(r++,t[o]=a,i-=a)}for(let o=0;o<e.length;o++){const s=n[o];st(s);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=i/l;r++,t[o]=c,i-=c}return t}function Vl(e,t,n){t.forEach((r,i)=>{const o=e[i];st(o);const{callbacks:s,constraints:a,id:l}=o,{collapsedSize:c=0,collapsible:d}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:g,onExpand:p,onResize:v}=s;v&&v(r,f),d&&(g||p)&&(p&&(f==null||f===c)&&r!==c&&p(),g&&(f==null||f!==c)&&r===c&&g())}})}function Lp(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 HX({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:o=3}){const s=n[i];let a;return s==null?a=e??"1":r.length===1?a="1":a=s.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}let My=null,_a=null;function PM(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function WX(){_a!==null&&(document.head.removeChild(_a),My=null,_a=null)}function Dy(e){if(My===e)return;My=e;const t=PM(e);_a===null&&(_a=document.createElement("style"),document.head.appendChild(_a)),_a.innerHTML=`*{cursor: ${t}!important;}`}function qX(e,t=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}function kM(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 MM(e){return`react-resizable-panels:${e}`}function DM(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:i,order:o}=t;return i?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function TM(e,t){try{const n=MM(e),r=t.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function UX(e,t,n){var r,i;const o=(r=TM(e,n))!==null&&r!==void 0?r:{},s=DM(t);return(i=o[s])!==null&&i!==void 0?i:null}function GX(e,t,n,r,i){var o;const s=MM(e),a=DM(t),l=(o=TM(e,i))!==null&&o!==void 0?o:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function AM({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((o,s)=>o+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!Lr(r,100))for(let o=0;o<t.length;o++){const s=n[o];st(s!=null);const a=100/r*s;n[o]=a}let i=0;for(let o=0;o<t.length;o++){const s=n[o];st(s!=null);const a=Bl({panelConstraints:t,panelIndex:o,size:s});s!=a&&(i+=s-a,n[o]=a)}if(!Lr(i,0))for(let o=0;o<t.length;o++){const s=n[o];st(s!=null);const a=s+i,l=Bl({panelConstraints:t,panelIndex:o,size:a});if(s!==l&&(i-=l-s,n[o]=l,Lr(i,0)))break}return n}const YX=100,ed={getItem:e=>(kM(ed),ed.getItem(e)),setItem:(e,t)=>{kM(ed),ed.setItem(e,t)}},IM={};function NM({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=ed,style:c,tagName:d="div",...f}){const g=ky(o),[p,v]=Ip(null),[y,x]=Ip([]),w=ei({}),S=ei(new Map),C=ei(0),P=ei({autoSaveId:e,direction:r,dragState:p,id:g,keyboardResizeBy:a,onLayout:s,storage:l}),O=ei({layout:y,panelDataArray:[],panelDataArrayChanged:!1});ei({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),pM(i,()=>({getId:()=>P.current.id,getLayout:()=>{const{layout:D}=O.current;return D},setLayout:D=>{const{onLayout:W}=P.current,{layout:re,panelDataArray:N}=O.current,ne=AM({layout:D,panelConstraints:N.map(ge=>ge.constraints)});_M(re,ne)||(x(ne),O.current.layout=ne,W&&W(ne),Vl(N,ne,w.current))}}),[]),Xu(()=>{P.current.autoSaveId=e,P.current.direction=r,P.current.dragState=p,P.current.id=g,P.current.onLayout=s,P.current.storage=l}),jX({committedValuesRef:P,eagerValuesRef:O,groupId:g,layout:y,panelDataArray:O.current.panelDataArray,setLayout:x}),wa(()=>{const{panelDataArray:D}=O.current;if(e){if(y.length===0||y.length!==D.length)return;let W=IM[e];W==null&&(W=qX(GX,YX),IM[e]=W);const re=[...D],N=new Map(S.current);W(e,re,N,y,l)}},[e,y,l]),wa(()=>{});const k=Rr(D=>{const{onLayout:W}=P.current,{layout:re,panelDataArray:N}=O.current;if(D.constraints.collapsible){const ne=N.map(ie=>ie.constraints),{collapsedSize:ge=0,panelSize:he,pivotIndices:de}=Wl(N,D,re);if(st(he!=null),he!==ge){S.current.set(D.id,he);const ee=Hl(N,D)===N.length-1?he-ge:ge-he,H=Zu({delta:ee,layout:re,panelConstraints:ne,pivotIndices:de,trigger:"imperative-api"});Lp(re,H)||(x(H),O.current.layout=H,W&&W(H),Vl(N,H,w.current))}}},[]),A=Rr(D=>{const{onLayout:W}=P.current,{layout:re,panelDataArray:N}=O.current;if(D.constraints.collapsible){const ne=N.map(ee=>ee.constraints),{collapsedSize:ge=0,panelSize:he,minSize:de=0,pivotIndices:ie}=Wl(N,D,re);if(he===ge){const ee=S.current.get(D.id),H=ee!=null&&ee>=de?ee:de,oe=Hl(N,D)===N.length-1?he-H:H-he,Te=Zu({delta:oe,layout:re,panelConstraints:ne,pivotIndices:ie,trigger:"imperative-api"});Lp(re,Te)||(x(Te),O.current.layout=Te,W&&W(Te),Vl(N,Te,w.current))}}},[]),L=Rr(D=>{const{layout:W,panelDataArray:re}=O.current,{panelSize:N}=Wl(re,D,W);return st(N!=null),N},[]),F=Rr((D,W)=>{const{panelDataArray:re}=O.current,N=Hl(re,D);return HX({defaultSize:W,dragState:p,layout:y,panelData:re,panelIndex:N})},[p,y]),z=Rr(D=>{const{layout:W,panelDataArray:re}=O.current,{collapsedSize:N=0,collapsible:ne,panelSize:ge}=Wl(re,D,W);return ne===!0&&ge===N},[]),B=Rr(D=>{const{layout:W,panelDataArray:re}=O.current,{collapsedSize:N=0,collapsible:ne,panelSize:ge}=Wl(re,D,W);return st(ge!=null),!ne||ge>N},[]),V=Rr(D=>{const{panelDataArray:W}=O.current;W.push(D),W.sort((re,N)=>{const ne=re.order,ge=N.order;return ne==null&&ge==null?0:ne==null?-1:ge==null?1:ne-ge}),O.current.panelDataArrayChanged=!0},[]);Xu(()=>{if(O.current.panelDataArrayChanged){O.current.panelDataArrayChanged=!1;const{autoSaveId:D,onLayout:W,storage:re}=P.current,{layout:N,panelDataArray:ne}=O.current;let ge=null;if(D){const de=UX(D,ne,re);de&&(S.current=new Map(Object.entries(de.expandToSizes)),ge=de.layout)}ge==null&&(ge=VX({panelDataArray:ne}));const he=AM({layout:ge,panelConstraints:ne.map(de=>de.constraints)});_M(N,he)||(x(he),O.current.layout=he,W&&W(he),Vl(ne,he,w.current))}});const X=Rr(D=>function(re){re.preventDefault();const{direction:N,dragState:ne,id:ge,keyboardResizeBy:he,onLayout:de}=P.current,{layout:ie,panelDataArray:ee}=O.current,{initialLayout:H}=ne??{},ye=xM(ge,D);let oe=BX(re,D,N,ne,he);if(oe===0)return;const Te=N==="horizontal";document.dir==="rtl"&&Te&&(oe=-oe);const Fe=ee.map(St=>St.constraints),He=Zu({delta:oe,layout:H??ie,panelConstraints:Fe,pivotIndices:ye,trigger:SM(re)?"keyboard":"mouse-or-touch"}),Ke=!Lp(ie,He);(CM(re)||EM(re))&&C.current!=oe&&(C.current=oe,Dy(Ke?Te?"horizontal":"vertical":Te?oe<0?"horizontal-min":"horizontal-max":oe<0?"vertical-min":"vertical-max")),Ke&&(x(He),O.current.layout=He,de&&de(He),Vl(ee,He,w.current))},[]),K=Rr((D,W)=>{const{onLayout:re}=P.current,{layout:N,panelDataArray:ne}=O.current,ge=ne.map(ye=>ye.constraints),{panelSize:he,pivotIndices:de}=Wl(ne,D,N);st(he!=null);const ee=Hl(ne,D)===ne.length-1?he-W:W-he,H=Zu({delta:ee,layout:N,panelConstraints:ge,pivotIndices:de,trigger:"imperative-api"});Lp(N,H)||(x(H),O.current.layout=H,re&&re(H),Vl(ne,H,w.current))},[]),$=Rr((D,W)=>{const{direction:re}=P.current,{layout:N}=O.current,ne=Rp(D);st(ne);const ge=OM(re,W);v({dragHandleId:D,dragHandleRect:ne.getBoundingClientRect(),initialCursorPosition:ge,initialLayout:N})},[]),J=Rr(()=>{WX(),v(null)},[]),G=Rr(D=>{const{panelDataArray:W}=O.current,re=Hl(W,D);re>=0&&(W.splice(re,1),delete w.current[D.id],O.current.panelDataArrayChanged=!0)},[]),q=NX(()=>({collapsePanel:k,direction:r,dragState:p,expandPanel:A,getPanelSize:L,getPanelStyle:F,groupId:g,isPanelCollapsed:z,isPanelExpanded:B,registerPanel:V,registerResizeHandle:X,resizePanel:K,startDragging:$,stopDragging:J,unregisterPanel:G}),[k,p,r,A,L,F,g,z,B,V,X,K,$,J,G]),se={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return zl(Np.Provider,{value:q},zl(d,{...f,children:t,className:n,style:{...se,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":g}))}const RM=fM((e,t)=>zl(NM,{...e,forwardedRef:t}));NM.displayName="PanelGroup",RM.displayName="forwardRef(PanelGroup)";function Hl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Wl(e,t,n){const r=e.map(c=>c.constraints),i=Hl(e,t),o=r[i],a=i===e.length-1?[i-1,i]:[i,i+1],l=n[i];return{...o,panelSize:l,pivotIndices:a}}function KX({disabled:e,handleId:t,resizeHandler:n}){wa(()=>{if(e||n==null)return;const r=Rp(t);if(r==null)return;const i=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),n(o);break}case"F6":{o.preventDefault();const s=r.getAttribute("data-panel-group-id");st(s);const a=Ju(s),l=yM(s,t);st(l!==null);const c=o.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[c].focus();break}}};return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}},[e,t,n])}function LM({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:i,style:o={},tabIndex:s=0,tagName:a="div",...l}){const c=ei(null),d=ei({onDragging:i});wa(()=>{d.current.onDragging=i});const f=hM(Np);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:g,dragState:p,groupId:v,registerResizeHandle:y,startDragging:x,stopDragging:w}=f,S=ky(r),C=(p==null?void 0:p.dragHandleId)===S,[P,O]=Ip(!1),[k,A]=Ip(null),L=Rr(()=>{const z=c.current;st(z),z.blur(),w();const{onDragging:B}=d.current;B&&B(!1)},[w]);wa(()=>{if(n)A(null);else{const z=y(S);A(()=>z)}},[n,S,y]),wa(()=>{if(n||k==null||!C)return;const z=K=>{k(K)},B=K=>{k(K)},V=c.current;st(V);const X=V.ownerDocument;return X.body.addEventListener("contextmenu",L),X.body.addEventListener("mousemove",z),X.body.addEventListener("touchmove",z),X.body.addEventListener("mouseleave",B),window.addEventListener("mouseup",L),window.addEventListener("touchend",L),()=>{X.body.removeEventListener("contextmenu",L),X.body.removeEventListener("mousemove",z),X.body.removeEventListener("touchmove",z),X.body.removeEventListener("mouseleave",B),window.removeEventListener("mouseup",L),window.removeEventListener("touchend",L)}},[g,n,C,k,L]),KX({disabled:n,handleId:S,resizeHandler:k});const F={cursor:PM(g),touchAction:"none",userSelect:"none"};return zl(a,{...l,children:e,className:t,onBlur:()=>O(!1),onFocus:()=>O(!0),onMouseDown:z=>{x(S,z.nativeEvent);const B=d.current;st(B);const{onDragging:V}=B;V&&V(!0)},onMouseUp:L,onTouchCancel:L,onTouchEnd:L,onTouchStart:z=>{x(S,z.nativeEvent);const B=d.current;st(B);const{onDragging:V}=B;V&&V(!0)},ref:c,role:"separator",style:{...F,...o},tabIndex:s,"data-panel-group-direction":g,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":C?"pointer":P?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":S})}LM.displayName="PanelResizeHandle";const $M=({className:e,...t})=>_.jsx(RM,{className:Pe("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),$p=vM,FM=({withHandle:e,className:t,...n})=>_.jsx(LM,{className:Pe("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&&_.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:_.jsx(XB,{className:"h-2.5 w-2.5"})})});function XX(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jM(Object(n),!0).forEach(function(r){XX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QX(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function ZX(e,t){if(e==null)return{};var n=QX(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function JX(e,t){return eQ(e)||tQ(e,t)||nQ(e,t)||rQ()}function eQ(e){if(Array.isArray(e))return e}function tQ(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function nQ(e,t){if(e){if(typeof e=="string")return BM(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 BM(e,t)}}function BM(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 rQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
429
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iQ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function HM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VM(Object(n),!0).forEach(function(r){iQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oQ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(i,o){return o(i)},r)}}function td(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function Fp(e){return{}.toString.call(e).includes("Object")}function sQ(e){return!Object.keys(e).length}function nd(e){return typeof e=="function"}function aQ(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function lQ(e,t){return Fp(t)||os("changeType"),Object.keys(t).some(function(n){return!aQ(e,n)})&&os("changeField"),t}function cQ(e){nd(e)||os("selectorType")}function uQ(e){nd(e)||Fp(e)||os("handlerType"),Fp(e)&&Object.values(e).some(function(t){return!nd(t)})&&os("handlersType")}function dQ(e){e||os("initialIsRequired"),Fp(e)||os("initialType"),sQ(e)&&os("initialContent")}function fQ(e,t){throw new Error(e[t]||e.default)}var hQ={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"},os=td(fQ)(hQ),jp={changes:lQ,selector:cQ,handler:uQ,initial:dQ};function pQ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};jp.initial(e),jp.handler(t);var n={current:e},r=td(vQ)(n,t),i=td(mQ)(n),o=td(jp.changes)(e),s=td(gQ)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return jp.selector(c),c(n.current)}function l(c){oQ(r,i,o,s)(c)}return[a,l]}function gQ(e,t){return nd(t)?t(e.current):t}function mQ(e,t){return e.current=HM(HM({},e.current),t),t}function vQ(e,t,n){return nd(t)?t(e.current):Object.keys(n).forEach(function(r){var i;return(i=t[r])===null||i===void 0?void 0:i.call(t,e.current[r])}),n}var bQ={create:pQ},yQ={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function xQ(e){return function t(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return i.length>=e.length?e.apply(this,i):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(i,a))}}}function wQ(e){return{}.toString.call(e).includes("Object")}function _Q(e){return e||qM("configIsRequired"),wQ(e)||qM("configType"),e.urls?(SQ(),{paths:{vs:e.urls.monacoBase}}):e}function SQ(){console.warn(WM.deprecation)}function CQ(e,t){throw new Error(e[t]||e.default)}var WM={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!
|
|
430
|
+
You are using deprecated way of configuration.
|
|
431
|
+
|
|
432
|
+
Instead of using
|
|
433
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
434
|
+
use
|
|
435
|
+
monaco.config({ paths: { vs: '...' } })
|
|
436
|
+
|
|
437
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
438
|
+
`},qM=xQ(CQ)(WM),EQ={config:_Q},OQ=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,s){return s(o)},i)}};function UM(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],UM(e[n],t[n]))}),zM(zM({},e),t)}var PQ={type:"cancelation",msg:"operation is manually canceled"};function Ty(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(PQ):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var kQ=bQ.create({config:yQ,isInitialized:!1,resolve:null,reject:null,monaco:null}),GM=JX(kQ,2),rd=GM[0],zp=GM[1];function MQ(e){var t=EQ.config(e),n=t.monaco,r=ZX(t,["monaco"]);zp(function(i){return{config:UM(i.config,r),monaco:n}})}function DQ(){var e=rd(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(zp({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Ty(Ay);if(window.monaco&&window.monaco.editor)return YM(window.monaco),e.resolve(window.monaco),Ty(Ay);OQ(TQ,IQ)(NQ)}return Ty(Ay)}function TQ(e){return document.body.appendChild(e)}function AQ(e){var t=document.createElement("script");return e&&(t.src=e),t}function IQ(e){var t=rd(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=AQ("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function NQ(){var e=rd(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){YM(n),e.resolve(n)},function(n){e.reject(n)})}function YM(e){rd().monaco||zp({monaco:e})}function RQ(){return rd(function(e){var t=e.monaco;return t})}var Ay=new Promise(function(e,t){return zp({resolve:e,reject:t})}),KM={config:MQ,init:DQ,__getMonacoInstance:RQ},LQ={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Iy=LQ,$Q={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},FQ=$Q;function jQ({children:e}){return m.createElement("div",{style:FQ.container},e)}var zQ=jQ,BQ=zQ;function VQ({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:s}){return m.createElement("section",{style:{...Iy.wrapper,width:e,height:t},...s},!n&&m.createElement(BQ,null,r),m.createElement("div",{ref:i,style:{...Iy.fullWidth,...!n&&Iy.hide},className:o}))}var HQ=VQ,XM=m.memo(HQ);function WQ(e){m.useEffect(e,[])}var QM=WQ;function qQ(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var $r=qQ;function id(){}function ql(e,t,n,r){return UQ(e,r)||GQ(e,t,n,r)}function UQ(e,t){return e.editor.getModel(ZM(e,t))}function GQ(e,t,n,r){return e.editor.createModel(t,n,r?ZM(e,r):void 0)}function ZM(e,t){return e.Uri.parse(t)}function YQ({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:d="Loading...",options:f={},height:g="100%",width:p="100%",className:v,wrapperProps:y={},beforeMount:x=id,onMount:w=id}){let[S,C]=m.useState(!1),[P,O]=m.useState(!0),k=m.useRef(null),A=m.useRef(null),L=m.useRef(null),F=m.useRef(w),z=m.useRef(x),B=m.useRef(!1);QM(()=>{let $=KM.init();return $.then(J=>(A.current=J)&&O(!1)).catch(J=>(J==null?void 0:J.type)!=="cancelation"&&console.error("Monaco initialization: error:",J)),()=>k.current?K():$.cancel()}),$r(()=>{if(k.current&&A.current){let $=k.current.getOriginalEditor(),J=ql(A.current,e||"",r||n||"text",o||"");J!==$.getModel()&&$.setModel(J)}},[o],S),$r(()=>{if(k.current&&A.current){let $=k.current.getModifiedEditor(),J=ql(A.current,t||"",i||n||"text",s||"");J!==$.getModel()&&$.setModel(J)}},[s],S),$r(()=>{let $=k.current.getModifiedEditor();$.getOption(A.current.editor.EditorOption.readOnly)?$.setValue(t||""):t!==$.getValue()&&($.executeEdits("",[{range:$.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),$.pushUndoStop())},[t],S),$r(()=>{var $,J;(J=($=k.current)==null?void 0:$.getModel())==null||J.original.setValue(e||"")},[e],S),$r(()=>{let{original:$,modified:J}=k.current.getModel();A.current.editor.setModelLanguage($,r||n||"text"),A.current.editor.setModelLanguage(J,i||n||"text")},[n,r,i],S),$r(()=>{var $;($=A.current)==null||$.editor.setTheme(c)},[c],S),$r(()=>{var $;($=k.current)==null||$.updateOptions(f)},[f],S);let V=m.useCallback(()=>{var G;if(!A.current)return;z.current(A.current);let $=ql(A.current,e||"",r||n||"text",o||""),J=ql(A.current,t||"",i||n||"text",s||"");(G=k.current)==null||G.setModel({original:$,modified:J})},[n,t,i,e,r,o,s]),X=m.useCallback(()=>{var $;!B.current&&L.current&&(k.current=A.current.editor.createDiffEditor(L.current,{automaticLayout:!0,...f}),V(),($=A.current)==null||$.editor.setTheme(c),C(!0),B.current=!0)},[f,c,V]);m.useEffect(()=>{S&&F.current(k.current,A.current)},[S]),m.useEffect(()=>{!P&&!S&&X()},[P,S,X]);function K(){var J,G,q,se;let $=(J=k.current)==null?void 0:J.getModel();a||((G=$==null?void 0:$.original)==null||G.dispose()),l||((q=$==null?void 0:$.modified)==null||q.dispose()),(se=k.current)==null||se.dispose()}return m.createElement(XM,{width:p,height:g,isEditorReady:S,loading:d,_ref:L,className:v,wrapperProps:y})}var KQ=YQ;m.memo(KQ);function XQ(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var QQ=XQ,Bp=new Map;function ZQ({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:d={},saveViewState:f=!0,keepCurrentModel:g=!1,width:p="100%",height:v="100%",className:y,wrapperProps:x={},beforeMount:w=id,onMount:S=id,onChange:C,onValidate:P=id}){let[O,k]=m.useState(!1),[A,L]=m.useState(!0),F=m.useRef(null),z=m.useRef(null),B=m.useRef(null),V=m.useRef(S),X=m.useRef(w),K=m.useRef(),$=m.useRef(r),J=QQ(o),G=m.useRef(!1),q=m.useRef(!1);QM(()=>{let W=KM.init();return W.then(re=>(F.current=re)&&L(!1)).catch(re=>(re==null?void 0:re.type)!=="cancelation"&&console.error("Monaco initialization: error:",re)),()=>z.current?D():W.cancel()}),$r(()=>{var re,N,ne,ge;let W=ql(F.current,e||r||"",t||i||"",o||n||"");W!==((re=z.current)==null?void 0:re.getModel())&&(f&&Bp.set(J,(N=z.current)==null?void 0:N.saveViewState()),(ne=z.current)==null||ne.setModel(W),f&&((ge=z.current)==null||ge.restoreViewState(Bp.get(o))))},[o],O),$r(()=>{var W;(W=z.current)==null||W.updateOptions(c)},[c],O),$r(()=>{!z.current||r===void 0||(z.current.getOption(F.current.editor.EditorOption.readOnly)?z.current.setValue(r):r!==z.current.getValue()&&(q.current=!0,z.current.executeEdits("",[{range:z.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),z.current.pushUndoStop(),q.current=!1))},[r],O),$r(()=>{var re,N;let W=(re=z.current)==null?void 0:re.getModel();W&&i&&((N=F.current)==null||N.editor.setModelLanguage(W,i))},[i],O),$r(()=>{var W;a!==void 0&&((W=z.current)==null||W.revealLine(a))},[a],O),$r(()=>{var W;(W=F.current)==null||W.editor.setTheme(s)},[s],O);let se=m.useCallback(()=>{var W;if(!(!B.current||!F.current)&&!G.current){X.current(F.current);let re=o||n,N=ql(F.current,r||e||"",t||i||"",re||"");z.current=(W=F.current)==null?void 0:W.editor.create(B.current,{model:N,automaticLayout:!0,...c},d),f&&z.current.restoreViewState(Bp.get(re)),F.current.editor.setTheme(s),a!==void 0&&z.current.revealLine(a),k(!0),G.current=!0}},[e,t,n,r,i,o,c,d,f,s,a]);m.useEffect(()=>{O&&V.current(z.current,F.current)},[O]),m.useEffect(()=>{!A&&!O&&se()},[A,O,se]),$.current=r,m.useEffect(()=>{var W,re;O&&C&&((W=K.current)==null||W.dispose(),K.current=(re=z.current)==null?void 0:re.onDidChangeModelContent(N=>{q.current||C(z.current.getValue(),N)}))},[O,C]),m.useEffect(()=>{if(O){let W=F.current.editor.onDidChangeMarkers(re=>{var ne;let N=(ne=z.current.getModel())==null?void 0:ne.uri;if(N&&re.find(ge=>ge.path===N.path)){let ge=F.current.editor.getModelMarkers({resource:N});P==null||P(ge)}});return()=>{W==null||W.dispose()}}return()=>{}},[O,P]);function D(){var W,re;(W=K.current)==null||W.dispose(),g?f&&Bp.set(o,z.current.saveViewState()):(re=z.current.getModel())==null||re.dispose(),z.current.dispose()}return m.createElement(XM,{width:p,height:v,isEditorReady:O,loading:l,_ref:B,className:y,wrapperProps:x})}var JQ=ZQ,JM=m.memo(JQ),Ny=JM;function eZ(e){const t=e.toUpperCase().indexOf("WHERE"),n=e.toUpperCase().indexOf("GROUP BY"),r=e.toUpperCase().indexOf("LIMIT"),i=e.toUpperCase().indexOf("ORDER BY");let o=e.length;if(i!==-1&&(o=i),r!==-1&&r<o&&(o=r),t!==-1){const s=e.substring(0,t),a=e.substring(t);return`${s} {{ filters | where }} AND ${a.substring(7)}`}else if(n!==-1){const s=e.substring(0,n),a=e.substring(n);return`${s} {{ filters | where }} ${a}`}else{const s=e.substring(0,o),a=e.substring(o);return`${s} {{ filters | where }} ${a}`}}let Ry;const eD="HoverCard",[tD,afe]=Pn(eD,[Fi]),Ly=Fi(),[tZ,$y]=tD(eD),nZ=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:o,openDelay:s=700,closeDelay:a=300}=e,l=Ly(t),c=m.useRef(0),d=m.useRef(0),f=m.useRef(!1),g=m.useRef(!1),[p=!1,v]=Qn({prop:r,defaultProp:i,onChange:o}),y=m.useCallback(()=>{clearTimeout(d.current),c.current=window.setTimeout(()=>v(!0),s)},[s,v]),x=m.useCallback(()=>{clearTimeout(c.current),!f.current&&!g.current&&(d.current=window.setTimeout(()=>v(!1),a))},[a,v]),w=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(d.current)},[]),m.createElement(tZ,{scope:t,open:p,onOpenChange:v,onOpen:y,onClose:x,onDismiss:w,hasSelectionRef:f,isPointerDownOnContentRef:g},m.createElement(Cu,l,n))},rZ="HoverCardTrigger",iZ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=$y(rZ,n),o=Ly(n);return m.createElement(Eu,le({asChild:!0},o),m.createElement(Be.a,le({"data-state":i.open?"open":"closed"},r,{ref:t,onPointerEnter:Ce(e.onPointerEnter,Vp(i.onOpen)),onPointerLeave:Ce(e.onPointerLeave,Vp(i.onClose)),onFocus:Ce(e.onFocus,i.onOpen),onBlur:Ce(e.onBlur,i.onClose),onTouchStart:Ce(e.onTouchStart,s=>s.preventDefault())})))}),oZ="HoverCardPortal",[lfe,sZ]=tD(oZ,{forceMount:void 0}),Fy="HoverCardContent",aZ=m.forwardRef((e,t)=>{const n=sZ(Fy,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,o=$y(Fy,e.__scopeHoverCard);return m.createElement(vn,{present:r||o.open},m.createElement(lZ,le({"data-state":o.open?"open":"closed"},i,{onPointerEnter:Ce(e.onPointerEnter,Vp(o.onOpen)),onPointerLeave:Ce(e.onPointerLeave,Vp(o.onClose)),ref:t})))}),lZ=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,...a}=e,l=$y(Fy,n),c=Ly(n),d=m.useRef(null),f=et(t,d),[g,p]=m.useState(!1);return m.useEffect(()=>{if(g){const v=document.body;return Ry=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=Ry,v.style.webkitUserSelect=Ry}}},[g]),m.useEffect(()=>{if(d.current){const v=()=>{p(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var y;((y=document.getSelection())===null||y===void 0?void 0:y.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),m.useEffect(()=>{d.current&&cZ(d.current).forEach(y=>y.setAttribute("tabindex","-1"))}),m.createElement(wl,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:Ce(o,v=>{v.preventDefault()}),onDismiss:l.onDismiss},m.createElement(Ou,le({},c,a,{onPointerDown:Ce(a.onPointerDown,v=>{v.currentTarget.contains(v.target)&&p(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:f,style:{...a.style,userSelect:g?"text":void 0,WebkitUserSelect:g?"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)"}})))});function Vp(e){return t=>t.pointerType==="touch"?void 0:e()}function cZ(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}const uZ=nZ,dZ=iZ,nD=aZ,rD=uZ,iD=dZ,jy=ue.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>_.jsx(nD,{ref:i,align:t,sideOffset:n,className:Pe("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}));jy.displayName=nD.displayName;function fZ({error:e}){return _.jsxs(rD,{openDelay:0,children:[_.jsx(iD,{asChild:!0,children:_.jsx(it,{variant:"link",className:" p-0 h-5",children:_.jsx(oV,{className:"h-4 w-4 text-red-500"})})}),_.jsx(jy,{align:"start",className:"w-[600px]",children:_.jsx("div",{className:"flex justify-between space-x-4",children:_.jsx("div",{className:"space-y-1",children:_.jsx("p",{className:"text-sm",children:e})})})})]})}const oD="Checkbox",[hZ,cfe]=Pn(oD),[pZ,gZ]=hZ(oD),mZ=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...d}=e,[f,g]=m.useState(null),p=et(t,C=>g(C)),v=m.useRef(!1),y=f?!!f.closest("form"):!0,[x=!1,w]=Qn({prop:i,defaultProp:o,onChange:c}),S=m.useRef(x);return m.useEffect(()=>{const C=f==null?void 0:f.form;if(C){const P=()=>w(S.current);return C.addEventListener("reset",P),()=>C.removeEventListener("reset",P)}},[f,w]),m.createElement(pZ,{scope:n,state:x,disabled:a},m.createElement(Be.button,le({type:"button",role:"checkbox","aria-checked":Sa(x)?"mixed":x,"aria-required":s,"data-state":sD(x),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:p,onKeyDown:Ce(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:Ce(e.onClick,C=>{w(P=>Sa(P)?!0:!P),y&&(v.current=C.isPropagationStopped(),v.current||C.stopPropagation())})})),y&&m.createElement(yZ,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),vZ="CheckboxIndicator",bZ=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=gZ(vZ,n);return m.createElement(vn,{present:r||Sa(o.state)||o.state===!0},m.createElement(Be.span,le({"data-state":sD(o.state),"data-disabled":o.disabled?"":void 0},i,{ref:t,style:{pointerEvents:"none",...e.style}})))}),yZ=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=Op(n),a=Mh(t);return m.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});l.indeterminate=Sa(n),f.call(l,Sa(n)?!1:n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",le({type:"checkbox","aria-hidden":!0,defaultChecked:Sa(n)?!1:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Sa(e){return e==="indeterminate"}function sD(e){return Sa(e)?"indeterminate":e?"checked":"unchecked"}const aD=mZ,xZ=bZ,zy=ue.forwardRef(({className:e,...t},n)=>_.jsx(aD,{ref:n,className:Pe("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:_.jsx(xZ,{className:Pe("flex items-center justify-center text-current"),children:_.jsx(Rh,{className:"h-4 w-4"})})}));zy.displayName=aD.displayName;function wZ({text:e,onCheckedChange:t,checked:n}){return _.jsxs("div",{className:"flex items-center space-x-1 xbg-red-100 ml-7",children:[_.jsx(zy,{checked:n,onCheckedChange:t}),_.jsx("label",{className:"text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function _Z(){const e=be(a=>a.authToken),t=m.useRef(null),n=_e(a=>a.applyFilters),[r,i]=m.useState(""),o=_e(a=>a.filterValues),s=_e(a=>a.card.sql);return _.jsxs(rD,{openDelay:0,onOpenChange:async a=>{if(!a)return;console.log("onOpenChange");const l=await Ts("https://semaphor.cloud/api/v1/filter-sql",(e==null?void 0:e.accessToken)||"",{sql:s,active_filters:o});console.log(l),l.sql?(console.log(l.records),i(l.sql)):i("Error")},children:[_.jsx(iD,{asChild:!0,children:n&&_.jsx("p",{className:" p-0 hover:cursor-pointer text-xs",children:"| Filter Query"})}),_.jsxs(jy,{align:"end",className:"w-[600px] ",children:[_.jsx("div",{className:" flex justify-between space-x-4",children:_.jsx("div",{className:"bg-muted p-2 rounded-sm",children:_.jsxs("code",{ref:t,className:"text-sm font-mono ",children:[r,_.jsx(JE,{onClick:()=>j3(t),className:" inline-block ml-3 h-4 w-4 opacity-70 hover:opacity-100 hover:cursor-pointer"})]})})}),_.jsxs("div",{className:"flex gap-2 items-center pt-2",children:[_.jsx(e2,{className:"h-4 w-4 opacity-70"}),_.jsx("span",{className:"text-xs text-muted-foreground",children:"A preview of the query with filters applied."})]})]})]})}const By=ue.forwardRef(({className:e,...t},n)=>_.jsx("textarea",{className:Pe("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}));By.displayName="Textarea";function ufe(){}function dfe(){}function SZ(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const CZ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,EZ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OZ={};function lD(e,t){return((t||OZ).jsx?EZ:CZ).test(e)}const PZ=/[ \t\n\f\r]/g;function kZ(e){return typeof e=="object"?e.type==="text"?cD(e.value):!1:cD(e)}function cD(e){return e.replace(PZ,"")===""}class od{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}od.prototype.property={},od.prototype.normal={},od.prototype.space=null;function uD(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new od(n,r,t)}function Vy(e){return e.toLowerCase()}class ti{constructor(t,n){this.property=t,this.attribute=n}}ti.prototype.space=null,ti.prototype.boolean=!1,ti.prototype.booleanish=!1,ti.prototype.overloadedBoolean=!1,ti.prototype.number=!1,ti.prototype.commaSeparated=!1,ti.prototype.spaceSeparated=!1,ti.prototype.commaOrSpaceSeparated=!1,ti.prototype.mustUseProperty=!1,ti.prototype.defined=!1;let MZ=0;const at=Ca(),yn=Ca(),dD=Ca(),Ee=Ca(),Ht=Ca(),Ul=Ca(),Fr=Ca();function Ca(){return 2**++MZ}const Hy=Object.freeze(Object.defineProperty({__proto__:null,boolean:at,booleanish:yn,commaOrSpaceSeparated:Fr,commaSeparated:Ul,number:Ee,overloadedBoolean:dD,spaceSeparated:Ht},Symbol.toStringTag,{value:"Module"})),Wy=Object.keys(Hy);class qy extends ti{constructor(t,n,r,i){let o=-1;if(super(t,n),fD(this,"space",i),typeof r=="number")for(;++o<Wy.length;){const s=Wy[o];fD(this,Wy[o],(r&Hy[s])===Hy[s])}}}qy.prototype.defined=!0;function fD(e,t,n){n&&(e[t]=n)}const DZ={}.hasOwnProperty;function Gl(e){const t={},n={};let r;for(r in e.properties)if(DZ.call(e.properties,r)){const i=e.properties[r],o=new qy(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Vy(r)]=r,n[Vy(o.attribute)]=r}return new od(t,n,e.space)}const hD=Gl({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),pD=Gl({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function gD(e,t){return t in e?e[t]:t}function mD(e,t){return gD(e,t.toLowerCase())}const vD=Gl({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:mD,properties:{xmlns:null,xmlnsXLink:null}}),bD=Gl({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:yn,ariaAutoComplete:null,ariaBusy:yn,ariaChecked:yn,ariaColCount:Ee,ariaColIndex:Ee,ariaColSpan:Ee,ariaControls:Ht,ariaCurrent:null,ariaDescribedBy:Ht,ariaDetails:null,ariaDisabled:yn,ariaDropEffect:Ht,ariaErrorMessage:null,ariaExpanded:yn,ariaFlowTo:Ht,ariaGrabbed:yn,ariaHasPopup:null,ariaHidden:yn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ht,ariaLevel:Ee,ariaLive:null,ariaModal:yn,ariaMultiLine:yn,ariaMultiSelectable:yn,ariaOrientation:null,ariaOwns:Ht,ariaPlaceholder:null,ariaPosInSet:Ee,ariaPressed:yn,ariaReadOnly:yn,ariaRelevant:null,ariaRequired:yn,ariaRoleDescription:Ht,ariaRowCount:Ee,ariaRowIndex:Ee,ariaRowSpan:Ee,ariaSelected:yn,ariaSetSize:Ee,ariaSort:null,ariaValueMax:Ee,ariaValueMin:Ee,ariaValueNow:Ee,ariaValueText:null,role:null}}),TZ=Gl({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:mD,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ul,acceptCharset:Ht,accessKey:Ht,action:null,allow:null,allowFullScreen:at,allowPaymentRequest:at,allowUserMedia:at,alt:null,as:null,async:at,autoCapitalize:null,autoComplete:Ht,autoFocus:at,autoPlay:at,blocking:Ht,capture:null,charSet:null,checked:at,cite:null,className:Ht,cols:Ee,colSpan:null,content:null,contentEditable:yn,controls:at,controlsList:Ht,coords:Ee|Ul,crossOrigin:null,data:null,dateTime:null,decoding:null,default:at,defer:at,dir:null,dirName:null,disabled:at,download:dD,draggable:yn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:at,formTarget:null,headers:Ht,height:Ee,hidden:at,high:Ee,href:null,hrefLang:null,htmlFor:Ht,httpEquiv:Ht,id:null,imageSizes:null,imageSrcSet:null,inert:at,inputMode:null,integrity:null,is:null,isMap:at,itemId:null,itemProp:Ht,itemRef:Ht,itemScope:at,itemType:Ht,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:at,low:Ee,manifest:null,max:null,maxLength:Ee,media:null,method:null,min:null,minLength:Ee,multiple:at,muted:at,name:null,nonce:null,noModule:at,noValidate:at,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:at,optimum:Ee,pattern:null,ping:Ht,placeholder:null,playsInline:at,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:at,referrerPolicy:null,rel:Ht,required:at,reversed:at,rows:Ee,rowSpan:Ee,sandbox:Ht,scope:null,scoped:at,seamless:at,selected:at,shadowRootDelegatesFocus:at,shadowRootMode:null,shape:null,size:Ee,sizes:null,slot:null,span:Ee,spellCheck:yn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ee,step:null,style:null,tabIndex:Ee,target:null,title:null,translate:null,type:null,typeMustMatch:at,useMap:null,value:yn,width:Ee,wrap:null,align:null,aLink:null,archive:Ht,axis:null,background:null,bgColor:null,border:Ee,borderColor:null,bottomMargin:Ee,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:at,declare:at,event:null,face:null,frame:null,frameBorder:null,hSpace:Ee,leftMargin:Ee,link:null,longDesc:null,lowSrc:null,marginHeight:Ee,marginWidth:Ee,noResize:at,noHref:at,noShade:at,noWrap:at,object:null,profile:null,prompt:null,rev:null,rightMargin:Ee,rules:null,scheme:null,scrolling:yn,standby:null,summary:null,text:null,topMargin:Ee,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ee,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:at,disableRemotePlayback:at,prefix:null,property:null,results:Ee,security:null,unselectable:null}}),AZ=Gl({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:gD,properties:{about:Fr,accentHeight:Ee,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ee,amplitude:Ee,arabicForm:null,ascent:Ee,attributeName:null,attributeType:null,azimuth:Ee,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ee,by:null,calcMode:null,capHeight:Ee,className:Ht,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:Ee,diffuseConstant:Ee,direction:null,display:null,dur:null,divisor:Ee,dominantBaseline:null,download:at,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ee,enableBackground:null,end:null,event:null,exponent:Ee,externalResourcesRequired:null,fill:null,fillOpacity:Ee,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:Ul,g2:Ul,glyphName:Ul,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ee,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ee,horizOriginX:Ee,horizOriginY:Ee,id:null,ideographic:Ee,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ee,k:Ee,k1:Ee,k2:Ee,k3:Ee,k4:Ee,kernelMatrix:Fr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ee,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:Ee,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:Ee,overlineThickness:Ee,paintOrder:null,panose1:null,path:null,pathLength:Ee,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ht,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ee,pointsAtY:Ee,pointsAtZ:Ee,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Fr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Fr,rev:Fr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Fr,requiredFeatures:Fr,requiredFonts:Fr,requiredFormats:Fr,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:Ee,specularExponent:Ee,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ee,strikethroughThickness:Ee,string:null,stroke:null,strokeDashArray:Fr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ee,strokeOpacity:Ee,strokeWidth:null,style:null,surfaceScale:Ee,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Fr,tabIndex:Ee,tableValues:null,target:null,targetX:Ee,targetY:Ee,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Fr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ee,underlineThickness:Ee,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ee,values:null,vAlphabetic:Ee,vMathematical:Ee,vectorEffect:null,vHanging:Ee,vIdeographic:Ee,version:null,vertAdvY:Ee,vertOriginX:Ee,vertOriginY:Ee,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ee,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),IZ=/^data[-\w.:]+$/i,yD=/-[a-z]/g,NZ=/[A-Z]/g;function RZ(e,t){const n=Vy(t);let r=t,i=ti;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&IZ.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(yD,$Z);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!yD.test(o)){let s=o.replace(NZ,LZ);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=qy}return new i(r,t)}function LZ(e){return"-"+e.toLowerCase()}function $Z(e){return e.charAt(1).toUpperCase()}const FZ={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"},jZ=uD([pD,hD,vD,bD,TZ],"html"),Uy=uD([pD,hD,vD,bD,AZ],"svg");function zZ(e){return e.join(" ").trim()}var xD={},wD=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,BZ=/\n/g,VZ=/^\s*/,HZ=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,WZ=/^:\s*/,qZ=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,UZ=/^[;\s]*/,GZ=/^\s+|\s+$/g,YZ=`
|
|
439
|
+
`,_D="/",SD="*",Ea="",KZ="comment",XZ="declaration",QZ=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(v){var y=v.match(BZ);y&&(n+=y.length);var x=v.lastIndexOf(YZ);r=~x?v.length-x:r+v.length}function o(){var v={line:n,column:r};return function(y){return y.position=new s(v),c(),y}}function s(v){this.start=v,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(v){var y=new Error(t.source+":"+n+":"+r+": "+v);if(y.reason=v,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(v){var y=v.exec(e);if(y){var x=y[0];return i(x),e=e.slice(x.length),y}}function c(){l(VZ)}function d(v){var y;for(v=v||[];y=f();)y!==!1&&v.push(y);return v}function f(){var v=o();if(!(_D!=e.charAt(0)||SD!=e.charAt(1))){for(var y=2;Ea!=e.charAt(y)&&(SD!=e.charAt(y)||_D!=e.charAt(y+1));)++y;if(y+=2,Ea===e.charAt(y-1))return a("End of comment missing");var x=e.slice(2,y-2);return r+=2,i(x),e=e.slice(y),r+=2,v({type:KZ,comment:x})}}function g(){var v=o(),y=l(HZ);if(y){if(f(),!l(WZ))return a("property missing ':'");var x=l(qZ),w=v({type:XZ,property:CD(y[0].replace(wD,Ea)),value:x?CD(x[0].replace(wD,Ea)):Ea});return l(UZ),w}}function p(){var v=[];d(v);for(var y;y=g();)y!==!1&&(v.push(y),d(v));return v}return c(),p()};function CD(e){return e?e.replace(GZ,Ea):Ea}var ZZ=Ro&&Ro.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xD,"__esModule",{value:!0});var JZ=ZZ(QZ);function eJ(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,JZ.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var s=o.property,a=o.value;i?t(s,a,o):a&&(n=n||{},n[s]=a)}}),n}var ED=xD.default=eJ;const tJ=ED.default||ED,OD=PD("end"),Gy=PD("start");function PD(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 nJ(e){const t=Gy(e),n=OD(e);if(t&&n)return{start:t,end:n}}function sd(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?Yy(e):""}function Yy(e){return MD(e&&e.line)+":"+MD(e&&e.column)}function kD(e){return Yy(e&&e.start)+"-"+Yy(e&&e.end)}function MD(e){return e&&typeof e=="number"?e:1}class Gn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=sd(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Gn.prototype.file="",Gn.prototype.name="",Gn.prototype.reason="",Gn.prototype.message="",Gn.prototype.stack="",Gn.prototype.column=void 0,Gn.prototype.line=void 0,Gn.prototype.ancestors=void 0,Gn.prototype.cause=void 0,Gn.prototype.fatal=void 0,Gn.prototype.place=void 0,Gn.prototype.ruleId=void 0,Gn.prototype.source=void 0;const Ky={}.hasOwnProperty,rJ=new Map,iJ=/[A-Z]/g,oJ=/-([a-z])/g,sJ=new Set(["table","tbody","thead","tfoot","tr"]),aJ=new Set(["td","th"]),DD="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function lJ(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=mJ(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=gJ(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Uy:jZ,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=TD(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function TD(e,t,n){if(t.type==="element")return cJ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return uJ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return fJ(e,t,n);if(t.type==="mdxjsEsm")return dJ(e,t);if(t.type==="root")return hJ(e,t,n);if(t.type==="text")return pJ(e,t)}function cJ(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Uy,e.schema=i),e.ancestors.push(t);const o=ID(e,t.tagName,!1),s=vJ(e,t);let a=Qy(e,t);return sJ.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!kZ(l):!0})),AD(e,s,o,t),Xy(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function uJ(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)}ad(e,t.position)}function dJ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ad(e,t.position)}function fJ(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Uy,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:ID(e,t.name,!0),s=bJ(e,t),a=Qy(e,t);return AD(e,s,o,t),Xy(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function hJ(e,t,n){const r={};return Xy(r,Qy(e,t)),e.create(t,e.Fragment,r,n)}function pJ(e,t){return t.value}function AD(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Xy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function gJ(e,t,n){return r;function r(i,o,s,a){const c=Array.isArray(s.children)?n:t;return a?c(o,s,a):c(o,s)}}function mJ(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=Gy(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function vJ(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Ky.call(t.properties,i)){const o=yJ(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&aJ.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function bJ(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ad(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else ad(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Qy(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:rJ;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const c=i.get(l)||0;s=l+"-"+c,i.set(l,c+1)}}const a=TD(e,o,s);a!==void 0&&n.push(a)}return n}function yJ(e,t,n){const r=RZ(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?SZ(n):zZ(n)),r.property==="style"){let i=typeof n=="object"?n:xJ(e,String(n));return e.stylePropertyNameCase==="css"&&(i=wJ(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?FZ[r.property]||r.property:r.attribute,n]}}function xJ(e,t){const n={};try{tJ(t,r)}catch(i){if(!e.ignoreInvalidStyle){const o=i,s=new Gn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=DD+"#cannot-parse-style-attribute",s}}return n;function r(i,o){let s=i;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(oJ,SJ)),n[s]=o}}function ID(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=lD(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=lD(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Ky.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ad(e)}function ad(e,t){const n=new Gn("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=DD+"#cannot-handle-mdx-estrees-without-createevaluater",n}function wJ(e){const t={};let n;for(n in e)Ky.call(e,n)&&(t[_J(n)]=e[n]);return t}function _J(e){let t=e.replace(iJ,CJ);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function SJ(e,t){return t.toUpperCase()}function CJ(e){return"-"+e.toLowerCase()}const Zy={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"]},EJ={};function OJ(e,t){const n=t||EJ,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ND(e,r,i)}function ND(e,t,n){if(PJ(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 RD(e.children,t,n)}return Array.isArray(e)?RD(e,t,n):""}function RD(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=ND(e[i],t,n);return r.join("")}function PJ(e){return!!(e&&typeof e=="object")}const LD=document.createElement("i");function Jy(e){const t="&"+e+";";LD.innerHTML=t;const n=LD.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function qi(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function ni(e,t){return e.length>0?(qi(e,e.length,0,t),e):t}const $D={}.hasOwnProperty;function kJ(e){const t={};let n=-1;for(;++n<e.length;)MJ(t,e[n]);return t}function MJ(e,t){let n;for(n in t){const i=($D.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){$D.call(i,s)||(i[s]=[]);const a=o[s];DJ(i[s],Array.isArray(a)?a:a?[a]:[])}}}function DJ(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);qi(e,0,0,r)}function FD(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 Yl(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const TJ=ss(new RegExp("\\p{P}","u")),Ui=ss(/[A-Za-z]/),jr=ss(/[\dA-Za-z]/),AJ=ss(/[#-'*+\--9=?A-Z^-~]/);function ex(e){return e!==null&&(e<32||e===127)}const tx=ss(/\d/),IJ=ss(/[\dA-Fa-f]/),jD=ss(/[!-/:-@[-`{-~]/);function Ge(e){return e!==null&&e<-2}function hr(e){return e!==null&&(e<0||e===32)}function Dt(e){return e===-2||e===-1||e===32}function NJ(e){return jD(e)||TJ(e)}const RJ=ss(/\s/);function ss(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Kl(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&jr(e.charCodeAt(n+1))&&jr(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Wt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return Dt(l)?(e.enter(n),a(l)):t(l)}function a(l){return Dt(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const LJ={tokenize:$J};function $J(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Wt(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Ge(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const FJ={tokenize:jJ},zD={tokenize:zJ};function jJ(e){const t=this,n=[];let r=0,i,o,s;return a;function a(C){if(r<n.length){const P=n[r];return t.containerState=P[1],e.attempt(P[0].continuation,l,c)(C)}return c(C)}function l(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&S();const P=t.events.length;let O=P,k;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){k=t.events[O][1].end;break}w(r);let A=P;for(;A<t.events.length;)t.events[A][1].end=Object.assign({},k),A++;return qi(t.events,O+1,0,t.events.slice(P)),t.events.length=A,c(C)}return a(C)}function c(C){if(r===n.length){if(!i)return g(C);if(i.currentConstruct&&i.currentConstruct.concrete)return v(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(zD,d,f)(C)}function d(C){return i&&S(),w(r),g(C)}function f(C){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,v(C)}function g(C){return t.containerState={},e.attempt(zD,p,v)(C)}function p(C){return r++,n.push([t.currentConstruct,t.containerState]),g(C)}function v(C){if(C===null){i&&S(),w(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:i}),y(C)}function y(C){if(C===null){x(e.exit("chunkFlow"),!0),w(0),e.consume(C);return}return Ge(C)?(e.consume(C),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(C),y)}function x(C,P){const O=t.sliceStream(C);if(P&&O.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(O),t.parser.lazy[C.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<s&&(!i.events[k][1].end||i.events[k][1].end.offset>s))return;const A=t.events.length;let L=A,F,z;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(F){z=t.events[L][1].end;break}F=!0}for(w(r),k=A;k<t.events.length;)t.events[k][1].end=Object.assign({},z),k++;qi(t.events,L+1,0,t.events.slice(A)),t.events.length=k}}function w(C){let P=n.length;for(;P-- >C;){const O=n[P];t.containerState=O[1],O[0].exit.call(t,e)}n.length=C}function S(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function zJ(e,t,n){return Wt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function BD(e){if(e===null||hr(e)||RJ(e))return 1;if(NJ(e))return 2}function nx(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const rx={name:"attention",tokenize:VJ,resolveAll:BJ};function BJ(e,t){let n=-1,r,i,o,s,a,l,c,d;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 f=Object.assign({},e[r][1].end),g=Object.assign({},e[n][1].start);VD(f,-l),VD(g,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:g},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ni(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ni(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=ni(c,nx(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ni(c,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=ni(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,qi(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function VJ(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=BD(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const c=e.exit("attentionSequence"),d=BD(l),f=!d||d===2&&i||n.includes(l),g=!i||i===2&&d||n.includes(r);return c._open=!!(o===42?f:f&&(i||!g)),c._close=!!(o===42?g:g&&(d||!f)),t(l)}}function VD(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const HJ={name:"autolink",tokenize:WJ};function WJ(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return Ui(p)?(e.consume(p),s):c(p)}function s(p){return p===43||p===45||p===46||jr(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||jr(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||ex(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),d):AJ(p)?(e.consume(p),c):n(p)}function d(p){return jr(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):g(p)}function g(p){if((p===45||jr(p))&&r++<63){const v=p===45?g:f;return e.consume(p),v}return n(p)}}const Hp={tokenize:qJ,partial:!0};function qJ(e,t,n){return r;function r(o){return Dt(o)?Wt(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||Ge(o)?t(o):n(o)}}const HD={name:"blockQuote",tokenize:UJ,continuation:{tokenize:GJ},exit:YJ};function UJ(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return Dt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function GJ(e,t,n){const r=this;return i;function i(s){return Dt(s)?Wt(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(HD,t,n)(s)}}function YJ(e){e.exit("blockQuote")}const WD={name:"characterEscape",tokenize:KJ};function KJ(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return jD(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const qD={name:"characterReference",tokenize:XJ};function XJ(e,t,n){const r=this;let i=0,o,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,s=jr,d(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=IJ,d):(e.enter("characterReferenceValue"),o=7,s=tx,d(f))}function d(f){if(f===59&&i){const g=e.exit("characterReferenceValue");return s===jr&&!Jy(r.sliceSerialize(g))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<o?(e.consume(f),d):n(f)}}const UD={tokenize:ZJ,partial:!0},GD={name:"codeFenced",tokenize:QJ,concrete:!0};function QJ(e,t,n){const r=this,i={tokenize:O,partial:!0};let o=0,s=0,a;return l;function l(k){return c(k)}function c(k){const A=r.events[r.events.length-1];return o=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(k)}function d(k){return k===a?(s++,e.consume(k),d):s<3?n(k):(e.exit("codeFencedFenceSequence"),Dt(k)?Wt(e,f,"whitespace")(k):f(k))}function f(k){return k===null||Ge(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(UD,y,P)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===null||Ge(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(k)):Dt(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Wt(e,p,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),g)}function p(k){return k===null||Ge(k)?f(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===null||Ge(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(k)):k===96&&k===a?n(k):(e.consume(k),v)}function y(k){return e.attempt(i,P,x)(k)}function x(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),w}function w(k){return o>0&&Dt(k)?Wt(e,S,"linePrefix",o+1)(k):S(k)}function S(k){return k===null||Ge(k)?e.check(UD,y,P)(k):(e.enter("codeFlowValue"),C(k))}function C(k){return k===null||Ge(k)?(e.exit("codeFlowValue"),S(k)):(e.consume(k),C)}function P(k){return e.exit("codeFenced"),t(k)}function O(k,A,L){let F=0;return z;function z($){return k.enter("lineEnding"),k.consume($),k.exit("lineEnding"),B}function B($){return k.enter("codeFencedFence"),Dt($)?Wt(k,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):V($)}function V($){return $===a?(k.enter("codeFencedFenceSequence"),X($)):L($)}function X($){return $===a?(F++,k.consume($),X):F>=s?(k.exit("codeFencedFenceSequence"),Dt($)?Wt(k,K,"whitespace")($):K($)):L($)}function K($){return $===null||Ge($)?(k.exit("codeFencedFence"),A($)):L($)}}}function ZJ(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ix={name:"codeIndented",tokenize:eee},JJ={tokenize:tee,partial:!0};function eee(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Wt(e,o,"linePrefix",5)(c)}function o(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):Ge(c)?e.attempt(JJ,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Ge(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function tee(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ge(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Wt(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):Ge(s)?i(s):n(s)}}const nee={name:"codeText",tokenize:oee,resolve:ree,previous:iee};function ree(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function iee(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function oee(e,t,n){let r=0,i,o;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(o=e.enter("codeTextSequence"),i=0,d(f)):Ge(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||Ge(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function d(f){return f===96?(e.consume(f),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(o.type="codeTextData",c(f))}}function YD(e){const t={};let n=-1,r,i,o,s,a,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,see(e,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(s=e[o],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);i&&(r[1].end=Object.assign({},e[i][1].start),a=e.slice(i,n),a.unshift(r),qi(e,i,n-i+1,a))}}return!c}function see(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const o=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let d,f,g=-1,p=n,v=0,y=0;const x=[y];for(;p;){for(;e[++i][1]!==p;);o.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++g<a.length;)a[g][0]==="exit"&&a[g-1][0]==="enter"&&a[g][1].type===a[g-1][1].type&&a[g][1].start.line!==a[g][1].end.line&&(y=g+1,x.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),g=x.length;g--;){const w=a.slice(x[g],x[g+1]),S=o.pop();l.unshift([S,S+w.length-1]),qi(e,S,2,w)}for(g=-1;++g<l.length;)c[v+l[g][0]]=v+l[g][1],v+=l[g][1]-l[g][0]-1;return c}const aee={tokenize:uee,resolve:cee},lee={tokenize:dee,partial:!0};function cee(e){return YD(e),e}function uee(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):Ge(a)?e.check(lee,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function dee(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Wt(e,o,"linePrefix")}function o(s){if(s===null||Ge(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 KD(e,t,n,r,i,o,s,a,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(w){return w===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(w),e.exit(o),g):w===null||w===32||w===41||ex(w)?n(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),y(w))}function g(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(a),g(w)):w===null||w===60||Ge(w)?n(w):(e.consume(w),w===92?v:p)}function v(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function y(w){return!d&&(w===null||w===41||hr(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(w)):d<c&&w===40?(e.consume(w),d++,y):w===41?(e.consume(w),d--,y):w===null||w===32||w===40||ex(w)?n(w):(e.consume(w),w===92?x:y)}function x(w){return w===40||w===41||w===92?(e.consume(w),y):y(w)}}function XD(e,t,n,r,i,o){const s=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),d}function d(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):Ge(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Ge(p)||a++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!Dt(p)),p===92?g:f)}function g(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function QD(e,t,n,r,i,o){let s;return a;function a(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),s=g===40?41:g,l):n(g)}function l(g){return g===s?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(o),c(g))}function c(g){return g===s?(e.exit(o),l(s)):g===null?n(g):Ge(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Wt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===s||g===null||Ge(g)?(e.exit("chunkString"),c(g)):(e.consume(g),g===92?f:d)}function f(g){return g===s||g===92?(e.consume(g),d):d(g)}}function ld(e,t){let n;return r;function r(i){return Ge(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Dt(i)?Wt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const fee={name:"definition",tokenize:pee},hee={tokenize:gee,partial:!0};function pee(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return XD.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Yl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return hr(p)?ld(e,c)(p):c(p)}function c(p){return KD(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(hee,f,f)(p)}function f(p){return Dt(p)?Wt(e,g,"whitespace")(p):g(p)}function g(p){return p===null||Ge(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function gee(e,t,n){return r;function r(a){return hr(a)?ld(e,i)(a):n(a)}function i(a){return QD(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Dt(a)?Wt(e,s,"whitespace")(a):s(a)}function s(a){return a===null||Ge(a)?t(a):n(a)}}const mee={name:"hardBreakEscape",tokenize:vee};function vee(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Ge(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const bee={name:"headingAtx",tokenize:xee,resolve:yee};function yee(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},qi(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function xee(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||hr(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||Ge(d)?(e.exit("atxHeading"),t(d)):Dt(d)?Wt(e,a,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function c(d){return d===null||d===35||hr(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),c)}}const wee=["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"],ZD=["pre","script","style","textarea"],_ee={name:"htmlFlow",tokenize:Oee,resolveTo:Eee,concrete:!0},See={tokenize:kee,partial:!0},Cee={tokenize:Pee,partial:!0};function Eee(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 Oee(e,t,n){const r=this;let i,o,s,a,l;return c;function c(N){return d(N)}function d(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),g):N===47?(e.consume(N),o=!0,y):N===63?(e.consume(N),i=3,r.interrupt?t:D):Ui(N)?(e.consume(N),s=String.fromCharCode(N),x):n(N)}function g(N){return N===45?(e.consume(N),i=2,p):N===91?(e.consume(N),i=5,a=0,v):Ui(N)?(e.consume(N),i=4,r.interrupt?t:D):n(N)}function p(N){return N===45?(e.consume(N),r.interrupt?t:D):n(N)}function v(N){const ne="CDATA[";return N===ne.charCodeAt(a++)?(e.consume(N),a===ne.length?r.interrupt?t:V:v):n(N)}function y(N){return Ui(N)?(e.consume(N),s=String.fromCharCode(N),x):n(N)}function x(N){if(N===null||N===47||N===62||hr(N)){const ne=N===47,ge=s.toLowerCase();return!ne&&!o&&ZD.includes(ge)?(i=1,r.interrupt?t(N):V(N)):wee.includes(s.toLowerCase())?(i=6,ne?(e.consume(N),w):r.interrupt?t(N):V(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):o?S(N):C(N))}return N===45||jr(N)?(e.consume(N),s+=String.fromCharCode(N),x):n(N)}function w(N){return N===62?(e.consume(N),r.interrupt?t:V):n(N)}function S(N){return Dt(N)?(e.consume(N),S):z(N)}function C(N){return N===47?(e.consume(N),z):N===58||N===95||Ui(N)?(e.consume(N),P):Dt(N)?(e.consume(N),C):z(N)}function P(N){return N===45||N===46||N===58||N===95||jr(N)?(e.consume(N),P):O(N)}function O(N){return N===61?(e.consume(N),k):Dt(N)?(e.consume(N),O):C(N)}function k(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,A):Dt(N)?(e.consume(N),k):L(N)}function A(N){return N===l?(e.consume(N),l=null,F):N===null||Ge(N)?n(N):(e.consume(N),A)}function L(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||hr(N)?O(N):(e.consume(N),L)}function F(N){return N===47||N===62||Dt(N)?C(N):n(N)}function z(N){return N===62?(e.consume(N),B):n(N)}function B(N){return N===null||Ge(N)?V(N):Dt(N)?(e.consume(N),B):n(N)}function V(N){return N===45&&i===2?(e.consume(N),J):N===60&&i===1?(e.consume(N),G):N===62&&i===4?(e.consume(N),W):N===63&&i===3?(e.consume(N),D):N===93&&i===5?(e.consume(N),se):Ge(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(See,re,X)(N)):N===null||Ge(N)?(e.exit("htmlFlowData"),X(N)):(e.consume(N),V)}function X(N){return e.check(Cee,K,re)(N)}function K(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),$}function $(N){return N===null||Ge(N)?X(N):(e.enter("htmlFlowData"),V(N))}function J(N){return N===45?(e.consume(N),D):V(N)}function G(N){return N===47?(e.consume(N),s="",q):V(N)}function q(N){if(N===62){const ne=s.toLowerCase();return ZD.includes(ne)?(e.consume(N),W):V(N)}return Ui(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),q):V(N)}function se(N){return N===93?(e.consume(N),D):V(N)}function D(N){return N===62?(e.consume(N),W):N===45&&i===2?(e.consume(N),D):V(N)}function W(N){return N===null||Ge(N)?(e.exit("htmlFlowData"),re(N)):(e.consume(N),W)}function re(N){return e.exit("htmlFlow"),t(N)}}function Pee(e,t,n){const r=this;return i;function i(s){return Ge(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function kee(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Hp,t,n)}}const Mee={name:"htmlText",tokenize:Dee};function Dee(e,t,n){const r=this;let i,o,s;return a;function a(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),l}function l(D){return D===33?(e.consume(D),c):D===47?(e.consume(D),O):D===63?(e.consume(D),C):Ui(D)?(e.consume(D),L):n(D)}function c(D){return D===45?(e.consume(D),d):D===91?(e.consume(D),o=0,v):Ui(D)?(e.consume(D),S):n(D)}function d(D){return D===45?(e.consume(D),p):n(D)}function f(D){return D===null?n(D):D===45?(e.consume(D),g):Ge(D)?(s=f,G(D)):(e.consume(D),f)}function g(D){return D===45?(e.consume(D),p):f(D)}function p(D){return D===62?J(D):D===45?g(D):f(D)}function v(D){const W="CDATA[";return D===W.charCodeAt(o++)?(e.consume(D),o===W.length?y:v):n(D)}function y(D){return D===null?n(D):D===93?(e.consume(D),x):Ge(D)?(s=y,G(D)):(e.consume(D),y)}function x(D){return D===93?(e.consume(D),w):y(D)}function w(D){return D===62?J(D):D===93?(e.consume(D),w):y(D)}function S(D){return D===null||D===62?J(D):Ge(D)?(s=S,G(D)):(e.consume(D),S)}function C(D){return D===null?n(D):D===63?(e.consume(D),P):Ge(D)?(s=C,G(D)):(e.consume(D),C)}function P(D){return D===62?J(D):C(D)}function O(D){return Ui(D)?(e.consume(D),k):n(D)}function k(D){return D===45||jr(D)?(e.consume(D),k):A(D)}function A(D){return Ge(D)?(s=A,G(D)):Dt(D)?(e.consume(D),A):J(D)}function L(D){return D===45||jr(D)?(e.consume(D),L):D===47||D===62||hr(D)?F(D):n(D)}function F(D){return D===47?(e.consume(D),J):D===58||D===95||Ui(D)?(e.consume(D),z):Ge(D)?(s=F,G(D)):Dt(D)?(e.consume(D),F):J(D)}function z(D){return D===45||D===46||D===58||D===95||jr(D)?(e.consume(D),z):B(D)}function B(D){return D===61?(e.consume(D),V):Ge(D)?(s=B,G(D)):Dt(D)?(e.consume(D),B):F(D)}function V(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,X):Ge(D)?(s=V,G(D)):Dt(D)?(e.consume(D),V):(e.consume(D),K)}function X(D){return D===i?(e.consume(D),i=void 0,$):D===null?n(D):Ge(D)?(s=X,G(D)):(e.consume(D),X)}function K(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||hr(D)?F(D):(e.consume(D),K)}function $(D){return D===47||D===62||hr(D)?F(D):n(D)}function J(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function G(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),q}function q(D){return Dt(D)?Wt(e,se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):se(D)}function se(D){return e.enter("htmlTextData"),s(D)}}const ox={name:"labelEnd",tokenize:Lee,resolveTo:Ree,resolveAll:Nee},Tee={tokenize:$ee},Aee={tokenize:Fee},Iee={tokenize:jee};function Nee(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function Ree(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[o][1].start),end:Object.assign({},e[s][1].end)},d={type:"labelText",start:Object.assign({},e[o+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return a=[["enter",l,t],["enter",c,t]],a=ni(a,e.slice(o+1,o+r+3)),a=ni(a,[["enter",d,t]]),a=ni(a,nx(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=ni(a,[["exit",d,t],e[s-2],e[s-1],["exit",c,t]]),a=ni(a,e.slice(s+1)),a=ni(a,[["exit",l,t]]),qi(e,o,e.length,a),e}function Lee(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(g){return o?o._inactive?f(g):(s=r.parser.defined.includes(Yl(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),l):n(g)}function l(g){return g===40?e.attempt(Tee,d,s?d:f)(g):g===91?e.attempt(Aee,d,s?c:f)(g):s?d(g):f(g)}function c(g){return e.attempt(Iee,d,f)(g)}function d(g){return t(g)}function f(g){return o._balanced=!0,n(g)}}function $ee(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return hr(f)?ld(e,o)(f):o(f)}function o(f){return f===41?d(f):KD(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return hr(f)?ld(e,l)(f):d(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?QD(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function c(f){return hr(f)?ld(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function Fee(e,t,n){const r=this;return i;function i(a){return XD.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Yl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function jee(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const zee={name:"labelStartImage",tokenize:Bee,resolveAll:ox.resolveAll};function Bee(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Vee={name:"labelStartLink",tokenize:Hee,resolveAll:ox.resolveAll};function Hee(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const sx={name:"lineEnding",tokenize:Wee};function Wee(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Wt(e,t,"linePrefix")}}const Wp={name:"thematicBreak",tokenize:qee};function qee(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),s(c)}function s(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Ge(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Dt(c)?Wt(e,a,"whitespace")(c):a(c))}}const pr={name:"list",tokenize:Yee,continuation:{tokenize:Kee},exit:Qee},Uee={tokenize:Zee,partial:!0},Gee={tokenize:Xee,partial:!0};function Yee(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){const v=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:tx(p)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Wp,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return tx(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Hp,r.interrupt?n:d,e.attempt(Uee,g,f))}function d(p){return r.containerState.initialBlankLine=!0,o++,g(p)}function f(p){return Dt(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),g):n(p)}function g(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Kee(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Hp,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Wt(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Dt(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(Gee,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Wt(e,e.attempt(pr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Xee(e,t,n){const r=this;return Wt(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Qee(e){e.exit(this.containerState.type)}function Zee(e,t,n){const r=this;return Wt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!Dt(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const JD={name:"setextUnderline",tokenize:ete,resolveTo:Jee};function Jee(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function ete(e,t,n){const r=this;let i;return o;function o(c){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Dt(c)?Wt(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Ge(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const tte={tokenize:nte};function nte(e){const t=this,n=e.attempt(Hp,r,e.attempt(this.parser.constructs.flowInitial,i,Wt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(aee,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const rte={resolveAll:tT()},ite=eT("string"),ote=eT("text");function eT(e){return{tokenize:t,resolveAll:tT(e==="text"?ste:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(d){return c(d)?o(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return c(d)?(n.exit("data"),o(d)):(n.consume(d),l)}function c(d){if(d===null)return!0;const f=i[d];let g=-1;if(f)for(;++g<f.length;){const p=f[g];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function tT(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function ste(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,a=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){o++;break}}if(a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+o,_bufferIndex:o?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},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}function ate(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},o=[];let s=[],a=[];const l={consume:S,enter:C,exit:P,attempt:A(O),check:A(k),interrupt:A(k,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:g,now:v,defineSkip:y,write:f};let d=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function f(B){return s=ni(s,B),x(),s[s.length-1]!==null?[]:(L(t,0),c.events=nx(o,c.events,c),c.events)}function g(B,V){return cte(p(B),V)}function p(B){return lte(s,B)}function v(){const{line:B,column:V,offset:X,_index:K,_bufferIndex:$}=r;return{line:B,column:V,offset:X,_index:K,_bufferIndex:$}}function y(B){i[B.line]=B.column,z()}function x(){let B;for(;r._index<s.length;){const V=s[r._index];if(typeof V=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<V.length;)w(V.charCodeAt(r._bufferIndex));else w(V)}}function w(B){d=d(B)}function S(B){Ge(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,z()):B!==-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=B}function C(B,V){const X=V||{};return X.type=B,X.start=v(),c.events.push(["enter",X,c]),a.push(X),X}function P(B){const V=a.pop();return V.end=v(),c.events.push(["exit",V,c]),V}function O(B,V){L(B,V.from)}function k(B,V){V.restore()}function A(B,V){return X;function X(K,$,J){let G,q,se,D;return Array.isArray(K)?re(K):"tokenize"in K?re([K]):W(K);function W(he){return de;function de(ie){const ee=ie!==null&&he[ie],H=ie!==null&&he.null,ye=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(H)?H:H?[H]:[]];return re(ye)(ie)}}function re(he){return G=he,q=0,he.length===0?J:N(he[q])}function N(he){return de;function de(ie){return D=F(),se=he,he.partial||(c.currentConstruct=he),he.name&&c.parser.constructs.disable.null.includes(he.name)?ge():he.tokenize.call(V?Object.assign(Object.create(c),V):c,l,ne,ge)(ie)}}function ne(he){return B(se,D),$}function ge(he){return D.restore(),++q<G.length?N(G[q]):J}}}function L(B,V){B.resolveAll&&!o.includes(B)&&o.push(B),B.resolve&&qi(c.events,V,c.events.length-V,B.resolve(c.events.slice(V),c)),B.resolveTo&&(c.events=B.resolveTo(c.events,c))}function F(){const B=v(),V=c.previous,X=c.currentConstruct,K=c.events.length,$=Array.from(a);return{restore:J,from:K};function J(){r=B,c.previous=V,c.currentConstruct=X,c.events.length=K,a=$,z()}}function z(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function lte(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function cte(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
440
|
+
`;break}case-3:{s=`\r
|
|
441
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}const ute=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:fee},disable:{null:[]},document:{42:pr,43:pr,45:pr,48:pr,49:pr,50:pr,51:pr,52:pr,53:pr,54:pr,55:pr,56:pr,57:pr,62:HD},flow:{35:bee,42:Wp,45:[JD,Wp],60:_ee,61:JD,95:Wp,96:GD,126:GD},flowInitial:{[-2]:ix,[-1]:ix,32:ix},insideSpan:{null:[rx,rte]},string:{38:qD,92:WD},text:{[-5]:sx,[-4]:sx,[-3]:sx,33:zee,38:qD,42:rx,60:[HJ,Mee],91:Vee,92:[mee,WD],93:ox,95:rx,96:nee}},Symbol.toStringTag,{value:"Module"}));function dte(e){const n=kJ([ute,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(LJ),document:i(FJ),flow:i(tte),string:i(ite),text:i(ote)};return r;function i(o){return s;function s(a){return ate(r,o,a)}}}function fte(e){for(;!YD(e););return e}const nT=/[\0\t\n\r]/g;function hte(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let c,d,f,g,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,t="",n&&(o.charCodeAt(0)===65279&&f++,n=void 0);f<o.length;){if(nT.lastIndex=f,c=nT.exec(o),g=c&&c.index!==void 0?c.index:o.length,p=o.charCodeAt(g),!c){t=o.slice(f);break}if(p===10&&f===g&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<g&&(l.push(o.slice(f,g)),e+=g-f),p){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=g+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const pte=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function gte(e){return e.replace(pte,mte)}function mte(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return FD(n.slice(o?2:1),o?16:10)}return Jy(n)||e}const rT={}.hasOwnProperty;function vte(e,t,n){return typeof t!="string"&&(n=t,t=void 0),bte(n)(fte(dte(n).document().write(hte()(e,t,!0))))}function bte(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(vt),autolinkProtocol:F,autolinkEmail:F,atxHeading:o(Fe),blockQuote:o(ee),characterEscape:F,characterReference:F,codeFenced:o(H),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(H,s),codeText:o(ye,s),codeTextData:F,data:F,codeFlowValue:F,definition:o(oe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Te),hardBreakEscape:o(He),hardBreakTrailing:o(He),htmlFlow:o(Ke,s),htmlFlowData:F,htmlText:o(Ke,s),htmlTextData:F,image:o(St),label:s,link:o(vt),listItem:o(tn),listItemValue:g,listOrdered:o(bt,f),listUnordered:o(bt),paragraph:o(Jt),reference:N,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Fe),strong:o(Dn),thematicBreak:o(Na)},exit:{atxHeading:l(),atxHeadingSequence:O,autolink:l(),autolinkEmail:ie,autolinkProtocol:de,blockQuote:l(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:ge,characterReferenceMarkerNumeric:ge,characterReferenceValue:he,codeFenced:l(x),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:v,codeFlowValue:z,codeIndented:l(w),codeText:l($),codeTextData:z,data:z,definition:l(),definitionDestinationString:P,definitionLabelString:S,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(V),hardBreakTrailing:l(V),htmlFlow:l(X),htmlFlowData:z,htmlText:l(K),htmlTextData:z,image:l(G),label:se,labelText:q,lineEnding:B,link:l(J),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ne,resourceDestinationString:D,resourceTitleString:W,resource:re,setextHeading:l(L),setextHeadingLineSequence:A,setextHeadingText:k,strong:l(),thematicBreak:l()}};iT(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(fe){let Oe={type:"root",children:[]};const Le={stack:[Oe],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:d,data:n},Xe=[];let yt=-1;for(;++yt<fe.length;)if(fe[yt][1].type==="listOrdered"||fe[yt][1].type==="listUnordered")if(fe[yt][0]==="enter")Xe.push(yt);else{const hn=Xe.pop();yt=i(fe,hn,yt)}for(yt=-1;++yt<fe.length;){const hn=t[fe[yt][0]];rT.call(hn,fe[yt][1].type)&&hn[fe[yt][1].type].call(Object.assign({sliceSerialize:fe[yt][2].sliceSerialize},Le),fe[yt][1])}if(Le.tokenStack.length>0){const hn=Le.tokenStack[Le.tokenStack.length-1];(hn[1]||oT).call(Le,void 0,hn[0])}for(Oe.position={start:as(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:as(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},yt=-1;++yt<t.transforms.length;)Oe=t.transforms[yt](Oe)||Oe;return Oe}function i(fe,Oe,Le){let Xe=Oe-1,yt=-1,hn=!1,Cn,Fn,Br,Vr;for(;++Xe<=Le;){const pn=fe[Xe];switch(pn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pn[0]==="enter"?yt++:yt--,Vr=void 0;break}case"lineEndingBlank":{pn[0]==="enter"&&(Cn&&!Vr&&!yt&&!Br&&(Br=Xe),Vr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vr=void 0}if(!yt&&pn[0]==="enter"&&pn[1].type==="listItemPrefix"||yt===-1&&pn[0]==="exit"&&(pn[1].type==="listUnordered"||pn[1].type==="listOrdered")){if(Cn){let mr=Xe;for(Fn=void 0;mr--;){const jn=fe[mr];if(jn[1].type==="lineEnding"||jn[1].type==="lineEndingBlank"){if(jn[0]==="exit")continue;Fn&&(fe[Fn][1].type="lineEndingBlank",hn=!0),jn[1].type="lineEnding",Fn=mr}else if(!(jn[1].type==="linePrefix"||jn[1].type==="blockQuotePrefix"||jn[1].type==="blockQuotePrefixWhitespace"||jn[1].type==="blockQuoteMarker"||jn[1].type==="listItemIndent"))break}Br&&(!Fn||Br<Fn)&&(Cn._spread=!0),Cn.end=Object.assign({},Fn?fe[Fn][1].start:pn[1].end),fe.splice(Fn||Xe,0,["exit",Cn,pn[2]]),Xe++,Le++}if(pn[1].type==="listItemPrefix"){const mr={type:"listItem",_spread:!1,start:Object.assign({},pn[1].start),end:void 0};Cn=mr,fe.splice(Xe,0,["enter",mr,pn[2]]),Xe++,Le++,Br=void 0,Vr=!0}}}return fe[Oe][1]._spread=hn,Le}function o(fe,Oe){return Le;function Le(Xe){a.call(this,fe(Xe),Xe),Oe&&Oe.call(this,Xe)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(fe,Oe,Le){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([Oe,Le]),fe.position={start:as(Oe.start),end:void 0}}function l(fe){return Oe;function Oe(Le){fe&&fe.call(this,Le),c.call(this,Le)}}function c(fe,Oe){const Le=this.stack.pop(),Xe=this.tokenStack.pop();if(Xe)Xe[0].type!==fe.type&&(Oe?Oe.call(this,fe,Xe[0]):(Xe[1]||oT).call(this,fe,Xe[0]));else throw new Error("Cannot close `"+fe.type+"` ("+sd({start:fe.start,end:fe.end})+"): it’s not open");Le.position.end=as(fe.end)}function d(){return OJ(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function g(fe){if(this.data.expectingFirstListItemValue){const Oe=this.stack[this.stack.length-2];Oe.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function p(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.lang=fe}function v(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.meta=fe}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.value=fe.replace(/(\r?\n|\r)$/g,"")}function S(fe){const Oe=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Oe,Le.identifier=Yl(this.sliceSerialize(fe)).toLowerCase()}function C(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.title=fe}function P(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.url=fe}function O(fe){const Oe=this.stack[this.stack.length-1];if(!Oe.depth){const Le=this.sliceSerialize(fe).length;Oe.depth=Le}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function A(fe){const Oe=this.stack[this.stack.length-1];Oe.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function F(fe){const Le=this.stack[this.stack.length-1].children;let Xe=Le[Le.length-1];(!Xe||Xe.type!=="text")&&(Xe=fn(),Xe.position={start:as(fe.start),end:void 0},Le.push(Xe)),this.stack.push(Xe)}function z(fe){const Oe=this.stack.pop();Oe.value+=this.sliceSerialize(fe),Oe.position.end=as(fe.end)}function B(fe){const Oe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=Oe.children[Oe.children.length-1];Le.position.end=as(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Oe.type)&&(F.call(this,fe),z.call(this,fe))}function V(){this.data.atHardBreak=!0}function X(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.value=fe}function K(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.value=fe}function $(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.value=fe}function J(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Oe=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Oe,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function G(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Oe=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Oe,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function q(fe){const Oe=this.sliceSerialize(fe),Le=this.stack[this.stack.length-2];Le.label=gte(Oe),Le.identifier=Yl(Oe).toLowerCase()}function se(){const fe=this.stack[this.stack.length-1],Oe=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const Xe=fe.children;Le.children=Xe}else Le.alt=Oe}function D(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.url=fe}function W(){const fe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.title=fe}function re(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function ne(fe){const Oe=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Oe,Le.identifier=Yl(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function ge(fe){this.data.characterReferenceType=fe.type}function he(fe){const Oe=this.sliceSerialize(fe),Le=this.data.characterReferenceType;let Xe;Le?(Xe=FD(Oe,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Xe=Jy(Oe);const yt=this.stack.pop();yt.value+=Xe,yt.position.end=as(fe.end)}function de(fe){z.call(this,fe);const Oe=this.stack[this.stack.length-1];Oe.url=this.sliceSerialize(fe)}function ie(fe){z.call(this,fe);const Oe=this.stack[this.stack.length-1];Oe.url="mailto:"+this.sliceSerialize(fe)}function ee(){return{type:"blockquote",children:[]}}function H(){return{type:"code",lang:null,meta:null,value:""}}function ye(){return{type:"inlineCode",value:""}}function oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Te(){return{type:"emphasis",children:[]}}function Fe(){return{type:"heading",depth:0,children:[]}}function He(){return{type:"break"}}function Ke(){return{type:"html",value:""}}function St(){return{type:"image",title:null,url:"",alt:null}}function vt(){return{type:"link",title:null,url:"",children:[]}}function bt(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function tn(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function Jt(){return{type:"paragraph",children:[]}}function Dn(){return{type:"strong",children:[]}}function fn(){return{type:"text",value:""}}function Na(){return{type:"thematicBreak"}}}function as(e){return{line:e.line,column:e.column,offset:e.offset}}function iT(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?iT(e,r):yte(e,r)}}function yte(e,t){let n;for(n in t)if(rT.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 oT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+sd({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sd({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+sd({start:t.start,end:t.end})+") is still open")}function xte(e){const t=this;t.parser=n;function n(r){return vte(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function wte(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 _te(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
442
|
+
`}]}function Ste(e,t){const n=t.value?t.value+`
|
|
443
|
+
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function Cte(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ete(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ote(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Kl(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function Pte(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 kte(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function sT(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function Mte(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sT(e,t);const i={src:Kl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function Dte(e,t){const n={src:Kl(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 Tte(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 Ate(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sT(e,t);const i={href:Kl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function Ite(e,t){const n={href:Kl(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 Nte(e,t,n){const r=e.all(t),i=n?Rte(n):aT(t),o={},s=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const d=r[a];(i||a!==0||d.type!=="element"||d.tagName!=="p")&&s.push({type:"text",value:`
|
|
444
|
+
`}),d.type==="element"&&d.tagName==="p"&&!i?s.push(...d.children):s.push(d)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
|
|
445
|
+
`});const c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)}function Rte(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=aT(n[r])}return t}function aT(e){const t=e.spread;return t??e.children.length>1}function Lte(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function $te(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Fte(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function jte(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zte(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Gy(t.children[1]),l=OD(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function Bte(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const f=t.children[l],g={},p=s?s[l]:void 0;p&&(g.align=p);let v={type:"element",tagName:o,properties:g,children:[]};f&&(v.children=e.all(f),e.patch(f,v),v=e.applyData(f,v)),c.push(v)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function Vte(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const lT=9,cT=32;function Hte(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(uT(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(uT(t.slice(i),i>0,!1)),o.join("")}function uT(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===lT||o===cT;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===lT||o===cT;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Wte(e,t){const n={type:"text",value:Hte(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function qte(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Ute={blockquote:wte,break:_te,code:Ste,delete:Cte,emphasis:Ete,footnoteReference:Ote,heading:Pte,html:kte,imageReference:Mte,image:Dte,inlineCode:Tte,linkReference:Ate,link:Ite,listItem:Nte,list:Lte,paragraph:$te,root:Fte,strong:jte,table:zte,tableCell:Vte,tableRow:Bte,text:Wte,thematicBreak:qte,toml:qp,yaml:qp,definition:qp,footnoteDefinition:qp};function qp(){}const dT=-1,Up=0,Gp=1,Yp=2,ax=3,lx=4,cx=5,ux=6,fT=7,hT=8,pT=typeof self=="object"?self:globalThis,Gte=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Up:case dT:return n(s,i);case Gp:{const a=n([],i);for(const l of s)a.push(r(l));return a}case Yp:{const a=n({},i);for(const[l,c]of s)a[r(l)]=r(c);return a}case ax:return n(new Date(s),i);case lx:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case cx:{const a=n(new Map,i);for(const[l,c]of s)a.set(r(l),r(c));return a}case ux:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case fT:{const{name:a,message:l}=s;return n(new pT[a](l),i)}case hT:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new pT[o](s),i)};return r},gT=e=>Gte(new Map,e)(0),Xl="",{toString:Yte}={},{keys:Kte}=Object,cd=e=>{const t=typeof e;if(t!=="object"||!e)return[Up,t];const n=Yte.call(e).slice(8,-1);switch(n){case"Array":return[Gp,Xl];case"Object":return[Yp,Xl];case"Date":return[ax,Xl];case"RegExp":return[lx,Xl];case"Map":return[cx,Xl];case"Set":return[ux,Xl]}return n.includes("Array")?[Gp,n]:n.includes("Error")?[fT,n]:[Yp,n]},Kp=([e,t])=>e===Up&&(t==="function"||t==="symbol"),Xte=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=cd(s);switch(a){case Up:{let d=s;switch(l){case"bigint":a=hT,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return i([dT],s)}return i([a,d],s)}case Gp:{if(l)return i([l,[...s]],s);const d=[],f=i([a,d],s);for(const g of s)d.push(o(g));return f}case Yp:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const d=[],f=i([a,d],s);for(const g of Kte(s))(e||!Kp(cd(s[g])))&&d.push([o(g),o(s[g])]);return f}case ax:return i([a,s.toISOString()],s);case lx:{const{source:d,flags:f}=s;return i([a,{source:d,flags:f}],s)}case cx:{const d=[],f=i([a,d],s);for(const[g,p]of s)(e||!(Kp(cd(g))||Kp(cd(p))))&&d.push([o(g),o(p)]);return f}case ux:{const d=[],f=i([a,d],s);for(const g of s)(e||!Kp(cd(g)))&&d.push(o(g));return f}}const{message:c}=s;return i([a,{name:l,message:c}],s)};return o},mT=(e,{json:t,lossy:n}={})=>{const r=[];return Xte(!(t||n),!!t,new Map,r)(e),r},Xp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?gT(mT(e,t)):structuredClone(e):(e,t)=>gT(mT(e,t));function Qte(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 Zte(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Jte(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Qte,r=e.options.footnoteBackLabel||Zte,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const d=e.all(c),f=String(c.identifier).toUpperCase(),g=Kl(f.toLowerCase());let p=0;const v=[],y=e.footnoteCounts.get(f);for(;y!==void 0&&++p<=y;){v.length>0&&v.push({type:"text",value:" "});let S=typeof n=="string"?n:n(l,p);typeof S=="string"&&(S={type:"text",value:S}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(S)?S:[S]})}const x=d[d.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const S=x.children[x.children.length-1];S&&S.type==="text"?S.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...v)}else d.push(...v);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(d,!0)};e.patch(c,w),a.push(w)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Xp(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
446
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
447
|
+
`}]}}const vT=function(e){if(e==null)return rne;if(typeof e=="function")return Qp(e);if(typeof e=="object")return Array.isArray(e)?ene(e):tne(e);if(typeof e=="string")return nne(e);throw new Error("Expected function, string, or object as test")};function ene(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=vT(e[n]);return Qp(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function tne(e){const t=e;return Qp(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function nne(e){return Qp(t);function t(n){return n&&n.type===e}}function Qp(e){return t;function t(n,r,i){return!!(ine(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function rne(){return!0}function ine(e){return e!==null&&typeof e=="object"&&"type"in e}function wfe(e){return e}const bT=[],one=!0,yT=!1,sne="skip";function ane(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=vT(i),s=r?-1:1;a(e,void 0,[])();function a(l,c,d){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return g;function g(){let p=bT,v,y,x;if((!t||o(l,c,d[d.length-1]||void 0))&&(p=lne(n(l,d)),p[0]===yT))return p;if("children"in l&&l.children){const w=l;if(w.children&&p[0]!==sne)for(y=(r?w.children.length:-1)+s,x=d.concat(w);y>-1&&y<w.children.length;){const S=w.children[y];if(v=a(S,y,x)(),v[0]===yT)return v;y=typeof v[1]=="number"?v[1]:y+s}}return p}}}function lne(e){return Array.isArray(e)?e:typeof e=="number"?[one,e]:e==null?bT:[e]}function xT(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),ane(e,o,a,i);function a(l,c){const d=c[c.length-1],f=d?d.children.indexOf(l):void 0;return s(l,f,d)}}const dx={}.hasOwnProperty,cne={};function une(e,t){const n=t||cne,r=new Map,i=new Map,o=new Map,s={...Ute,...n.handlers},a={all:c,applyData:fne,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:dne,wrap:pne};return xT(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:i,g=String(d.identifier).toUpperCase();f.has(g)||f.set(g,d)}}),a;function l(d,f){const g=d.type,p=a.handlers[g];if(dx.call(a.handlers,g)&&p)return p(a,d,f);if(a.options.passThrough&&a.options.passThrough.includes(g)){if("children"in d){const{children:y,...x}=d,w=Xp(x);return w.children=a.all(d),w}return Xp(d)}return(a.options.unknownHandler||hne)(a,d,f)}function c(d){const f=[];if("children"in d){const g=d.children;let p=-1;for(;++p<g.length;){const v=a.one(g[p],d);if(v){if(p&&g[p-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=wT(v.value)),!Array.isArray(v)&&v.type==="element")){const y=v.children[0];y&&y.type==="text"&&(y.value=wT(y.value))}Array.isArray(v)?f.push(...v):f.push(v)}}}return f}}function dne(e,t){e.position&&(t.position=nJ(e))}function fne(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,Xp(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function hne(e,t){const n=t.data||{},r="value"in t&&!(dx.call(n,"hProperties")||dx.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 pne(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
448
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
449
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
450
|
+
`}),n}function wT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function _T(e,t){const n=une(e,t),r=n.one(e,void 0),i=Jte(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
451
|
+
`},i),o}function gne(e,t){return e&&"run"in e?async function(n,r){const i=_T(n,{file:r,...t});await e.run(i,r)}:function(n,r){return _T(n,{file:r,...t||e})}}function ST(e){if(e)throw e}var Zp=Object.prototype.hasOwnProperty,CT=Object.prototype.toString,ET=Object.defineProperty,OT=Object.getOwnPropertyDescriptor,PT=function(t){return typeof Array.isArray=="function"?Array.isArray(t):CT.call(t)==="[object Array]"},kT=function(t){if(!t||CT.call(t)!=="[object Object]")return!1;var n=Zp.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Zp.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Zp.call(t,i)},MT=function(t,n){ET&&n.name==="__proto__"?ET(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},DT=function(t,n){if(n==="__proto__")if(Zp.call(t,n)){if(OT)return OT(t,n).value}else return;return t[n]},mne=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,d=!1;for(typeof a=="boolean"&&(d=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=DT(a,n),i=DT(t,n),a!==i&&(d&&i&&(kT(i)||(o=PT(i)))?(o?(o=!1,s=r&&PT(r)?r:[]):s=r&&kT(r)?r:{},MT(a,{name:n,newValue:e(d,s,i)})):typeof i<"u"&&MT(a,{name:n,newValue:i}));return a};const fx=Pc(mne);function hx(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 vne(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...c){const d=e[++o];let f=-1;if(l){s(l);return}for(;++f<i.length;)(c[f]===null||c[f]===void 0)&&(c[f]=i[f]);i=c,d?bne(d,a)(...c):s(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function bne(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(c){const d=c;if(a&&n)throw d;return i(d)}a||(l instanceof Promise?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const Gi={basename:yne,dirname:xne,extname:wne,join:_ne,sep:"/"};function yne(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ud(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function xne(e){if(ud(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 wne(e){ud(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function _ne(...e){let t=-1,n;for(;++t<e.length;)ud(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Sne(n)}function Sne(e){ud(e);const t=e.codePointAt(0)===47;let n=Cne(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Cne(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function ud(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Ene={cwd:One};function One(){return"/"}function px(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Pne(e){if(typeof e=="string")e=new URL(e);else if(!px(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 kne(e)}function kne(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const gx=["history","path","basename","stem","extname","dirname"];class TT{constructor(t){let n;t?px(t)?n={path:t}:typeof t=="string"||Mne(t)?n={value:t}:n=t:n={},this.cwd=Ene.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<gx.length;){const o=gx[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)gx.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Gi.basename(this.path):void 0}set basename(t){vx(t,"basename"),mx(t,"basename"),this.path=Gi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Gi.dirname(this.path):void 0}set dirname(t){AT(this.basename,"dirname"),this.path=Gi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Gi.extname(this.path):void 0}set extname(t){if(mx(t,"extname"),AT(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=Gi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){px(t)&&(t=Pne(t)),vx(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Gi.basename(this.path,this.extname):void 0}set stem(t){vx(t,"stem"),mx(t,"stem"),this.path=Gi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Gn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function mx(e,t){if(e&&e.includes(Gi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Gi.sep+"`")}function vx(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function AT(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Mne(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Dne=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};Object.setPrototypeOf(o,r);const s=Object.getOwnPropertyNames(i);for(const a of s){const l=Object.getOwnPropertyDescriptor(i,a);l&&Object.defineProperty(o,a,l)}return o},Tne={}.hasOwnProperty;class bx extends Dne{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=vne()}copy(){const t=new bx;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(fx(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(wx("data",this.frozen),this.namespace[t]=n,this):Tne.call(this.namespace,t)&&this.namespace[t]||void 0:t?(wx("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Jp(t),r=this.parser||this.Parser;return yx("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),yx("process",this.parser||this.Parser),xx("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Jp(t),l=r.parse(a);r.run(l,a,function(d,f,g){if(d||!f||!g)return c(d);const p=f,v=r.stringify(p,g);Nne(v)?g.value=v:g.result=v,c(d,g)});function c(d,f){d||!f?s(d):o?o(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),yx("processSync",this.parser||this.Parser),xx("processSync",this.compiler||this.Compiler),this.process(t,i),NT("processSync","process",n),r;function i(o,s){n=!0,ST(o),r=s}}run(t,n,r){IT(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=Jp(n);i.run(t,l,c);function c(d,f,g){const p=f||t;d?a(d):s?s(p):r(void 0,p,g)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),NT("runSync","run",r),i;function o(s,a){ST(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Jp(n),i=this.compiler||this.Compiler;return xx("stringify",i),IT(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(wx("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[d,...f]=c;l(d,f)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(i.settings=fx(!0,i.settings,c.settings))}function a(c){let d=-1;if(c!=null)if(Array.isArray(c))for(;++d<c.length;){const f=c[d];o(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,d){let f=-1,g=-1;for(;++f<r.length;)if(r[f][0]===c){g=f;break}if(g===-1)r.push([c,...d]);else if(d.length>0){let[p,...v]=d;const y=r[g][1];hx(y)&&hx(p)&&(p=fx(!0,y,p)),r[g]=[c,p,...v]}}}}const Ane=new bx().freeze();function yx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function xx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function wx(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 IT(e){if(!hx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function NT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jp(e){return Ine(e)?e:new TT(e)}function Ine(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Nne(e){return typeof e=="string"||Rne(e)}function Rne(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Lne="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",RT=[],LT={allowDangerousHtml:!0},$ne=/^(https?|ircs?|mailto|xmpp)$/i,Fne=[{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 jne(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||RT,l=e.remarkPlugins||RT,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...LT}:LT,d=e.skipHtml,f=e.unwrapDisallowed,g=e.urlTransform||zne,p=Ane().use(xte).use(l).use(gne,c).use(a),v=new TT;typeof r=="string"&&(v.value=r);for(const S of Fne)Object.hasOwn(e,S.from)&&(""+S.from+(S.to?"use `"+S.to+"` instead":"remove it")+Lne+S.id,void 0);const y=p.parse(v);let x=p.runSync(y,v);return i&&(x={type:"element",tagName:"div",properties:{className:i},children:x.type==="root"?x.children:[x]}),xT(x,w),lJ(x,{Fragment:_.Fragment,components:o,ignoreInvalidStyle:!0,jsx:_.jsx,jsxs:_.jsxs,passKeys:!0,passNode:!0});function w(S,C,P){if(S.type==="raw"&&P&&typeof C=="number")return d?P.children.splice(C,1):P.children[C]={type:"text",value:S.value},C;if(S.type==="element"){let O;for(O in Zy)if(Object.hasOwn(Zy,O)&&Object.hasOwn(S.properties,O)){const k=S.properties[O],A=Zy[O];(A===null||A.includes(S.tagName))&&(S.properties[O]=g(String(k||""),O,S))}}if(S.type==="element"){let O=t?!t.includes(S.tagName):s?s.includes(S.tagName):!1;if(!O&&n&&typeof C=="number"&&(O=!n(S,C,P)),O&&P&&typeof C=="number")return f&&S.children?P.children.splice(C,1,...S.children):P.children.splice(C,1),C}}}function zne(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||$ne.test(e.slice(0,t))?e:""}const Bne=`
|
|
452
|
+
|
|
453
|
+
Use the following syntax to create a chart query. Please replace the x-axis, y-axis, stack-by, label, and measure with the actual column names of the table.
|
|
454
|
+
|
|
455
|
+
Bar / Line Chart:
|
|
456
|
+
|
|
457
|
+
SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table
|
|
458
|
+
|
|
459
|
+
- X-axis - Category
|
|
460
|
+
- Y-axis - Number
|
|
461
|
+
|
|
462
|
+
Stacked Chart:
|
|
463
|
+
|
|
464
|
+
SELECT x-axis, stack-by, y-axis FROM table
|
|
465
|
+
|
|
466
|
+
- X-axis - Category
|
|
467
|
+
- Stack by - Category
|
|
468
|
+
- Y-axis - Number
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
Scatter Chart:
|
|
472
|
+
|
|
473
|
+
SELECT label, x-axis, y-axis FROM table
|
|
474
|
+
|
|
475
|
+
- Label - Category
|
|
476
|
+
- Group (opt) - Category
|
|
477
|
+
- X-axis - Number
|
|
478
|
+
- Y-axis - Number
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
Bubble Chart:
|
|
482
|
+
|
|
483
|
+
SELECT label, x-axis, y-axis, radius FROM table
|
|
484
|
+
|
|
485
|
+
- Label - Category
|
|
486
|
+
- Bubble Group (opt) - Category
|
|
487
|
+
- X-axis - Number
|
|
488
|
+
- Y-axis - Number
|
|
489
|
+
- Radius - Number
|
|
490
|
+
|
|
491
|
+
Pie / Dougnut Chart:
|
|
492
|
+
|
|
493
|
+
SELECT label, measure FROM table
|
|
494
|
+
|
|
495
|
+
- Label - Category
|
|
496
|
+
- Measure - Number
|
|
497
|
+
`;function Vne({open:e,setOpen:t,userInput:n,setUserInput:r,triggerAIRun:i,setTriggerAIRun:o}){const s=be(X=>X.authToken),[a,l]=m.useState(!1),c=_e(X=>X.actions.setCardSql),d=_e(X=>X.actions.setRunSql),f=_e(X=>X.actions.setCardType),g=_e(X=>X.currentColumns),p=_e(X=>X.card.sql),v=_e(X=>X.selectedTableName),y=`
|
|
498
|
+
${n}
|
|
499
|
+
|
|
500
|
+
${v==="api"?"please use the alaSQL syntax to query the data":""}
|
|
501
|
+
Table: ${v}
|
|
502
|
+
Table Columns: ${g==null?void 0:g.map(X=>`${X.column_name} | ${X.data_type}`).join(", ")}
|
|
503
|
+
User SQL: ${p}
|
|
504
|
+
`,x=` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
|
|
505
|
+
Visual Query Syntax: ${Bne}`,{data:w,isLoading:S,isFetching:C,isError:P,refetch:O}=Sr({queryKey:["ai-query"],queryFn:()=>el("https://semaphor.cloud/api/v1/ai",(s==null?void 0:s.accessToken)||"",{user_content:`userContent: ${y} ${a?x:""}`}),enabled:!1});function k(X){if(X.toLowerCase().includes("bar"))f("bar");else if(X.toLowerCase().includes("line"))f("line");else if(X.toLowerCase().includes("bubble"))f("bubble");else if(X.toLowerCase().includes("scatter"))f("scatter");else if(X.toLowerCase().includes("stacked"))f("stackedBar");else if(X.toLowerCase().includes("pie"))f("pie");else if(X.toLowerCase().includes("donut")||X.toLowerCase().includes("doughnut"))f("doughnut");else if(X.toLowerCase().includes("radar"))f("radar");else return f("bar"),!1;return!0}function A(){n&&(k(n)&&l(!0),O())}m.useEffect(()=>{i&&(A(),o(!1))},[i,o]);const L={fontFamily:"Arial, sans-serif",lineHeight:1.6,fontSize:15,padding:"5px",width:"100%"},F={fontFamily:"monospace",fontSize:14,lineHeight:1.6},z={fontFamily:"Arial, sans-serif",lineHeight:1.6,fontSize:15,padding:"2px 0",marginLeft:20,listStyleType:"disc"},B={p:({node:X,...K})=>_.jsx("p",{style:L,...K}),pre:({node:X,...K})=>_.jsxs("pre",{className:" bg-muted/50 space-y-2 p-3 rounded-sm",style:F,children:[_.jsx("code",{className:" whitespace-normal",children:K.children}),_.jsxs("div",{className:" flex justify-start gap-2",children:[_.jsx(it,{onClick:V,size:"sm",variant:"outline",children:_.jsx(JE,{})}),_.jsx(it,{onClick:$=>{const J=V($);J&&(t(!1),c(J),d(!0))},size:"sm",variant:"outline",children:_.jsx(Zj,{})})]})]}),li:({node:X,...K})=>_.jsx("li",{style:z,...K})};function V(X){const K=X.currentTarget.closest("pre");if(!K)return;const $=K.textContent||K.innerText;return navigator.clipboard.writeText($).then(()=>console.log("Text copied to clipboard")).catch(J=>console.error("Error in copying text: ",J)),$}return _.jsxs(xy,{open:e,onOpenChange:t,children:[_.jsx(wy,{asChild:!0,children:_.jsx(it,{size:"sm",className:"",variant:"outline",children:_.jsx(nV,{strokeWidth:1,size:16})})}),_.jsxs(_p,{className:" border-muted sm:max-w-[425px] md:min-w-[625px] md:max-h-[625px] flex flex-col justify-between overflow-auto",children:[_.jsxs(Sp,{children:[_.jsx(Cp,{children:"Ask"}),_.jsx(Ep,{children:"Need assistance with SQL queries? Feel free to ask me any question!"})]}),_.jsx(Pl,{className:"h-[625px] w-full border-t border-t-muted ",children:(!S||!C)&&_.jsx(jne,{className:" pl-1 pr-3 py-1 w-full xbg-red-100 overflow-auto ",components:B,children:w==null?void 0:w.response})}),_.jsxs("div",{children:[_.jsx(lf,{className:Pe(" invisible h-1 w-full animate-pulse",{visible:S||C})}),_.jsxs("div",{className:" border rounded-md flex items-center w-full",children:[_.jsx(By,{onKeyDown:X=>{X.key==="Enter"&&!X.shiftKey&&(X.preventDefault(),r(""),A())},placeholder:"Type something...",onFocus:X=>{const K=X.target,$=K.value.length;K.setSelectionRange($,$)},className:" border-none resize-none min-h-7 max-h-10 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",value:n,onChange:X=>r(X.target.value)})," ",_.jsx(it,{className:"h-8",size:"sm",variant:"ghost",onClick:A,children:!S&&!C?_.jsx(Xj,{}):_.jsx(ku,{className:" w-4 h-4 animate-spin mr-2 text-foreground/50"})})]})]})]})]})}function Hne(){const{theme:e}=Cm(),t=m.useRef(),n=m.useRef(),[r,i]=m.useState(!1),[o,s]=m.useState(!1),[a,l]=m.useState(""),[c,d]=m.useState(!1);m.useState("");const f=be(H=>H.authToken),g=_e(H=>H.card),p=be(H=>H.theme),v=_e(H=>H.selectedConnectionId),y=_e(H=>H.selectedDatabaseName),x=_e(H=>H.selectedSchemaName),w=_e(H=>H.selectedTableName),S=_e(H=>H.actions.setCardSql),C=_e(H=>H.card.sql),P=_e(H=>H.selectedConnectionId),O=_e(H=>H.filterValues),k=_e(H=>H.applyFilters),A=_e(H=>H.actions.setCardCustomCfg),L=_e(H=>H.actions.setFilterValues),F=_e(H=>H.onSave),z=_e(H=>H.actions.setApplyFilters),B=_e(H=>H.onClose),V=_e(H=>H.actions.setCardData),X=_e(H=>H.actions.setSqlGen),K=_e(H=>H.runSql),$=_e(H=>H.actions.setRunSql),J=_e(H=>H.actions.setIsSqlRunning),{data:G,isLoading:q,isFetching:se,isSuccess:D,isError:W,error:re,status:N,refetch:ne}=Sr({queryKey:[C],queryFn:()=>Ts("https://semaphor.cloud/api/v1/query",(f==null?void 0:f.accessToken)||"",{connection_id:P,sql:C,active_filters:k?O:[]}),enabled:!1,retry:!1});m.useEffect(()=>{G&&(console.log("queryData",G),V(G.records))},[G,V]),m.useEffect(()=>{K&&(ne(),$(!1))},[K,ne,$]),m.useEffect(()=>{(q||se)&&J(!0),(W||D)&&J(!1)},[q,se,W,D,J]);function ge(){S(""),V([]),X({}),A("")}const he=H=>{n.current=H};function de(){if(C&&!C.includes("{{")){const H=eZ(C);S(H),F==null||F({...g,sql:H,lastSelectedSchema:x,lastSelectedDatabase:y,lastSelectedTable:w,connectionId:v})}else F==null||F(g)}function ie(){B==null||B()}m.useEffect(()=>{const H=t.current,ye=n.current;if(H){const oe=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",Te=p==="system"?oe:p;H.editor.defineTheme("default",{base:Te==="light"?"vs":"vs-dark",inherit:!0,rules:[],colors:{"editor.background":Te==="light"?"#ffffff":"#020817"}}),H.editor.setTheme("default")}return ye&&H&&ye.addCommand(H.KeyMod.Shift|H.KeyCode.Enter,function(){return console.log("Executing query..."),ne(),!1}),()=>{}},[e,p,t.current]);function ee(H){t.current=H}return _.jsxs("section",{role:"editor-section",className:"grow flex flex-col justify-end pt-3 p-1 ",children:[_.jsxs("div",{className:" grow flex relative overflow-y-scroll justify-between ",children:[_.jsx("div",{role:"editor-container",className:`flex ${r?"w-2/3":"w-[95%]"} xbg-red-100 p-1`,children:_.jsx(Ny,{theme:"default",onChange:H=>{S(H),console.log(H)},value:C,options:{minimap:{enabled:!1},wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:14,renderLineHighlight:"none"},defaultLanguage:"sql",defaultValue:"SELECT * FROM table",beforeMount:ee,onMount:he})}),r&&_.jsx("div",{className:" w-1/3 text-xs relative overflow-hidden xbg-yellow-100 p-1 ",children:_.jsxs("div",{className:"min-h-0 ",children:[_.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx(wZ,{checked:k,onCheckedChange:()=>z(!k),text:"Apply Filters"}),_.jsx(_Z,{})]}),_.jsx(Ny,{theme:"default",onChange:H=>{if(H)try{JSON.parse(H),L(JSON.parse(H))}catch{}},defaultLanguage:"json",className:"min-h-[220px] mt-1",value:JSON.stringify(O,null,2),options:{readOnly:!0,minimap:{enabled:!1},lineNumbers:"off",glyphMargin:!1,wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:12,renderLineHighlight:"none"}})]})}),O&&r&&_.jsx(na,{onClick:()=>i(!1),className:"absolute right-6 top-1 w-3 h-3 text-foreground/50 hover:text-foreground hover:cursor-pointer"}),O&&!r&&_.jsx(W2,{onClick:()=>i(!0),className:Pe("absolute right-6 top-1 w-3 h-3 text-foreground/50 hover:text-foreground hover:cursor-pointer",{"text-red-800 font-bold":k})})]}),_.jsxs("div",{className:" flex grow px-6 pt-3 pb-4 gap-2 justify-between item-center",children:[_.jsxs("div",{className:"flex grow gap-2 items-center",children:[_.jsxs(it,{disabled:q||se,onClick:()=>{ne()},className:" shrink-0",size:"sm",variant:"outline",children:[(q||se)&&_.jsx(ku,{className:"w-4 h-4 mr-2 animate-spin text-foreground/50"}),"Run"]}),W&&_.jsx(fZ,{error:re.message}),_.jsx(it,{onClick:ge,className:"",size:"sm",variant:"outline",children:"Clear"}),_.jsx(Ku,{value:a,placeholder:"Type something...",onChange:H=>{l(H.target.value)},onKeyDown:H=>{H.key==="Enter"&&(H.preventDefault(),console.log("enter pressed"),d(!0),s(!0))},className:" bg-muted border-none h-9 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"}),_.jsx(Vne,{open:o,setOpen:s,userInput:a,triggerAIRun:c,setTriggerAIRun:d,setUserInput:H=>l(H)})]}),_.jsxs("div",{className:"flex gap-2 items-end ",children:[_.jsx(it,{onClick:de,size:"sm",variant:"outline",children:_.jsx(Rh,{size:16,strokeWidth:2,className:"text-green-600 font-bold"})}),_.jsx(it,{onClick:ie,className:" w-full",size:"sm",variant:"outline",children:_.jsx(na,{className:" h-3.5 w-3.5"})})]})]})]})}const $T="Switch",[Wne,_fe]=Pn($T),[qne,Une]=Wne($T),Gne=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...d}=e,[f,g]=m.useState(null),p=et(t,S=>g(S)),v=m.useRef(!1),y=f?!!f.closest("form"):!0,[x=!1,w]=Qn({prop:i,defaultProp:o,onChange:c});return m.createElement(qne,{scope:n,checked:x,disabled:a},m.createElement(Be.button,le({type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":FT(x),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:p,onClick:Ce(e.onClick,S=>{w(C=>!C),y&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),y&&m.createElement(Xne,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),Yne="SwitchThumb",Kne=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=Une(Yne,n);return m.createElement(Be.span,le({"data-state":FT(i.checked),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),Xne=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=Op(n),a=Mh(t);return m.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",le({type:"checkbox","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function FT(e){return e?"checked":"unchecked"}const jT=Gne,Qne=Kne,zT=ue.forwardRef(({className:e,...t},n)=>_.jsx(jT,{className:Pe("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:_.jsx(Qne,{className:Pe("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")})}));zT.displayName=jT.displayName;function BT({className:e,...t}){const[n,r]=m.useState(0),i=be(l=>l.themeStyle),o=_e(l=>l.card),s=_e(l=>l.actions.setCard);if(m.useEffect(()=>{r(n+1)},[o.data,o.type,o.cfg,o.customCfg,i]),!o.id)return null;let a;return o.data&&o.data.length>0&&(a=Pb({data:o.data,cardType:o.type,cfg:o.cfg,customCfg:o.customCfg})),_.jsxs(kv,{role:"editor-visual-card",className:Pe(" relative h-full flex flex-col rounded-none",e),...t,children:[_.jsxs(Mv,{children:[_.jsx(qc,{text:o.title,onSave:l=>s({...o,title:l}),children:_.jsx(Dv,{className:"text-base",children:o.title})}),_.jsx(qc,{text:o.description||"",onSave:l=>s({...o,description:l}),children:_.jsxs(Tv,{children:[" ",o.description]})})]}),_.jsxs(Av,{className:"flex flex-col pb-3 grow",children:[o.type!=="table"&&a&&_.jsx(QE,{cfg:a},n),o.type==="table"&&o.data&&o.data.length>0&&_.jsx(cO,{children:_.jsx(s0,{data:o==null?void 0:o.data})})]})]})}function Zne(){const[e,t]=m.useState(!1),[n,r]=m.useState(""),[i,o]=m.useState(""),[s,a]=m.useState(""),l=_e(x=>x.card),c=_e(x=>x.card.customCfg),d=_e(x=>x.actions.setCardCustomCfg);function f(x){var C,P;const w={...x,data:{...x==null?void 0:x.data,datasets:(P=(C=x==null?void 0:x.data)==null?void 0:C.datasets)==null?void 0:P.map(O=>({...O,data:[]}))}};return JSON.stringify(w,null,1)}function g(){if(!l.data||l.data.length===0)return;const x=Pb({data:l.data,cardType:l.type,cfg:l.cfg});x&&(r(JSON.stringify(x,null,1)),c&&o(JSON.stringify(c,null,1)))}function p(){if(i)try{const x=JSON.parse(i);return x?(d(x),a(""),o(""),x):void 0}catch(x){console.log(x),a("Invalid JSON")}}function v(){o(""),d(null)}function y(){let x;if(c){const w=Rs.cloneDeep(l.cfg),S=Rs.merge(w,c);return x=f(S),x}return n?(x=f(JSON.parse(n)),x):""}return _.jsxs(xy,{open:e,onOpenChange:t,children:[_.jsx(wy,{asChild:!0,children:_.jsx(it,{onClick:g,className:`h-7 ${c&&"border-foreground/50 dark:border-foreground/70"}`,size:"sm",variant:"outline",children:c?"Custom Config":"Customize"})}),_.jsx(_p,{className:" sm:max-w-[425px] md:min-w-[600px] md:min-h-[700px] lg:min-w-[800px] xl:min-w-[1000px]",children:_.jsxs("div",{className:"bg-red-x100 flex flex-col gap-2 justify-between",children:[_.jsxs(Sp,{className:"",children:[_.jsx(Cp,{children:"Customize Chart"}),_.jsxs(Ep,{children:["See the configuration options and documentation",_.jsx("a",{target:"_blank",className:"ml-1 underline text-blue-500 ",href:"https://www.chartjs.org/docs/latest/samples/bar/vertical.html",children:"here."})]})]}),_.jsxs("div",{className:"grow flex flex-wrap gap-2",children:[_.jsx(BT,{className:"flex-1 rounded shadow-none"}),_.jsxs(a_,{defaultValue:"custom-config",className:" flex flex-col flex-1",children:[_.jsxs(l_,{className:" justify-start border rounded-sm rounded-b-none border-b-0 ",children:[_.jsxs(Am,{value:"custom-config",children:[c&&_.jsx(ZE,{className:"w-5 h-5 mr-1 text-green-600"}),c?"Custom Config":"Default Config"]}),_.jsx(Am,{className:"",value:"output",children:"Output"})]}),_.jsx(ff,{className:" grow mt-0 bg-red-x p-2 border border-t-0 rounded-b ",value:"output",children:_.jsx(By,{disabled:!0,value:n,className:" border-none resize-none font-mono h-full focus-visible:ring-0 focus-visible:ring-offset-0"})}),_.jsx(ff,{className:"grow mt-0 border border-t-0 rounded-b ",value:"custom-config",children:_.jsx(Ny,{className:"h-full w-full overflow-hidden",theme:"default",options:{minimap:{enabled:!1},wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:14,renderLineHighlight:"none"},defaultLanguage:"json",value:y(),onChange:x=>o(x)})})]})]}),_.jsxs(_y,{className:"flex items-center",children:[_.jsx(fa,{className:"text-red-500 mr-2",children:s}),_.jsx(it,{disabled:!c,onClick:v,variant:"outline",children:"Reset"}),_.jsx(it,{onClick:p,variant:"outline",children:"Apply"}),_.jsx(it,{onClick:()=>t(!1),variant:"outline",children:"Close"})]})]})})]})}var VT={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},HT=m.createContext&&m.createContext(VT),Jne=["attr","size","title"];function ere(e,t){if(e==null)return{};var n=tre(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tre(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function eg(){return eg=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},eg.apply(this,arguments)}function WT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WT(Object(n),!0).forEach(function(r){nre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nre(e,t,n){return t=rre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rre(e){var t=ire(e,"string");return typeof t=="symbol"?t:String(t)}function ire(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qT(e){return e&&e.map((t,n)=>m.createElement(t.tag,tg({key:n},t.attr),qT(t.child)))}function dd(e){return t=>m.createElement(ore,eg({attr:tg({},e.attr)},t),qT(e.child))}function ore(e){var t=n=>{var{attr:r,size:i,title:o}=e,s=ere(e,Jne),a=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),m.createElement("svg",eg({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:tg(tg({color:e.color||n.color},n.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&m.createElement("title",null,o),e.children)};return HT!==void 0?m.createElement(HT.Consumer,null,n=>t(n)):t(VT)}function UT(e){return dd({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z"},child:[]}]})(e)}function GT(e){return dd({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z"},child:[]}]})(e)}function YT(e){return dd({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M137,28.05a11.94,11.94,0,0,0-9.12,3.08A12.09,12.09,0,0,0,124,40V80.67a11.88,11.88,0,0,0,9.9,11.81,36,36,0,1,1-41.85,37.4c-.47-9.14,1.47-16.8,5.75-22.79h0a11.89,11.89,0,0,0-1.3-15.35L68.87,63.51a12,12,0,0,0-17.74.83A99.6,99.6,0,0,0,57.79,199.2,99.24,99.24,0,0,0,128,228h1.43A100.29,100.29,0,0,0,228,129.42C228.72,77.21,188.76,32.68,137,28.05ZM57.28,69.46A4,4,0,0,1,60.2,68h.19a3.91,3.91,0,0,1,2.79,1.14L90.81,97.36a3.93,3.93,0,0,1,.48,5.08A40.47,40.47,0,0,0,84.08,124h-48A90.36,90.36,0,0,1,57.28,69.46ZM36.09,132H84.18A44,44,0,0,0,124,171.81V219.9A92,92,0,0,1,36.09,132ZM193,193a91.43,91.43,0,0,1-61,26.92V171.82a43.51,43.51,0,0,0,26-11.63,44,44,0,0,0-22.79-75.6A4,4,0,0,1,132,80.67V40a4,4,0,0,1,1.31-3,3.89,3.89,0,0,1,3-1c47.59,4.26,84.34,45.24,83.67,93.29A91.42,91.42,0,0,1,193,193Z"},child:[]}]})(e)}function KT(e){return dd({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"},child:[]},{tag:"path",attr:{d:"M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0"},child:[]}]})(e)}function XT(e){return dd({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z"},child:[]}]})(e)}function sre(){const[e,t]=m.useState(!1),n=_e(s=>s.card.type),r=_e(s=>s.actions.setCardType),i=_e(s=>s.actions.setCardCustomCfg);function o(s){r(s),i(null),t(!1)}return _.jsxs(pp,{open:e,onOpenChange:t,children:[_.jsx(gp,{asChild:!0,children:_.jsx(it,{className:"h-7 px-2",variant:"outline",children:_.jsx(are,{className:"h-4 w-4",chartType:n})})}),_.jsx(Wu,{className:"w-50",children:_.jsxs("div",{className:"grid grid-cols-3 place-items-center ",children:[_.jsx(it,{onClick:()=>o("bar"),className:"font-normal",variant:"ghost",children:_.jsx(B2,{strokeWidth:1})}),_.jsx(it,{onClick:()=>o("line"),variant:"ghost",children:_.jsx(q2,{strokeWidth:1})}),_.jsx(it,{onClick:()=>o("stackedBar"),variant:"ghost",children:_.jsx(XT,{className:"h-6 w-6 text-foreground/50 ",strokeWidth:0})}),_.jsx(it,{onClick:()=>o("scatter"),variant:"ghost",children:_.jsx(G2,{strokeWidth:1})}),_.jsx(it,{onClick:()=>o("bubble"),variant:"ghost",children:_.jsx(KT,{strokeWidth:2})}),_.jsx(it,{onClick:()=>o("pie"),variant:"ghost",children:_.jsx(U2,{strokeWidth:1})}),_.jsx(it,{onClick:()=>o("doughnut"),variant:"ghost",children:_.jsx(YT,{className:"h-7 w-7",strokeWidth:.5})}),_.jsx(it,{onClick:()=>o("radar"),variant:"ghost",children:_.jsx(UT,{className:"h-6 w-6 text-foreground/50 font-extralight",strokeWidth:.5})}),_.jsx(it,{onClick:()=>o("polarArea"),variant:"ghost",children:_.jsx(GT,{className:"h-6 w-6 text-foreground/50",strokeWidth:1})}),_.jsx(it,{onClick:()=>o("table"),variant:"ghost",children:_.jsx(Wb,{className:"h-6 w-6 text-foreground/90",strokeWidth:1})})]})})]})}function are({chartType:e,className:t}){switch(e){case"bar":return _.jsx(B2,{className:t});case"line":return _.jsx(q2,{className:t});case"pie":return _.jsx(U2,{className:t});case"radar":return _.jsx(UT,{className:t});case"scatter":return _.jsx(G2,{className:t});case"bubble":return _.jsx(KT,{className:t});case"doughnut":return _.jsx(YT,{className:t});case"stackedBar":return _.jsx(XT,{className:"h-5 w-5 text-foreground/50 ",strokeWidth:0});case"polarArea":return _.jsx(GT,{className:t});default:return _.jsx(Wb,{className:t})}}function lre(){const e=_e(n=>n.card.refreshInterval),t=_e(n=>n.actions.setCardRefreshInterval);return _.jsxs(pp,{children:[_.jsx(gp,{asChild:!0,children:_.jsx(it,{className:"h-7",variant:"outline",children:"Realtime"})}),_.jsx(Wu,{className:"w-[200px]",children:_.jsx("div",{className:"grid gap-4",children:_.jsx("div",{className:"grid gap-2",children:_.jsxs("div",{className:"grid grid-cols-5 items-center gap-1",children:[_.jsx(fa,{className:"col-span-3",htmlFor:"width",children:"Refresh Every"}),_.jsx(Ku,{value:e||"",onChange:n=>t(n.target.value),id:"width",placeholder:"30s",className:"col-span-2 h-7 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0"})]})})})})]})}function QT(){const e=_e(r=>r.card),t=_e(r=>r.isShowingVisual),n=_e(r=>r.isSqlRunning);return _e(r=>r.onSave),_e(r=>r.onClose),_e(r=>r.actions.setCardSql),_e(r=>r.actions.setCardType),_e(r=>r.actions.setSqlGen),_.jsxs("div",{className:" h-full relative flex flex-col",children:[n&&_.jsx(ku,{className:" w-10 h-10 z-10 absolute m-auto left-0 right-0 top-0 bottom-0 animate-spin text-foreground/10 "}),_.jsxs("div",{className:" h-10 px-6 pt-6 bg-red-x100 mb-0 z-10 right-0 flex justify-end items-center gap-2",children:[t&&_.jsxs("div",{className:"bg-red-x00 flex grow gap-2",children:[_.jsx(sre,{}),_.jsx(Zne,{}),_.jsx(lre,{})]}),_.jsx(cre,{})]}),t?_.jsx(BT,{className:"grow border-none shadow-none "}):_.jsx("div",{className:"w-full mt-4 px-6 bg-red-x00 grow border-none shadow-none overflow-y-auto ",children:e.data&&e.data.length>0&&_.jsx(s0,{data:e.data})})]})}function cre(){const e=_e(n=>n.isShowingVisual),t=_e(n=>n.actions.setIsShowingVisual);return _.jsxs("div",{className:" flex items-center space-x-2",children:[_.jsx(fa,{htmlFor:"visualize",children:"Chart"}),_.jsx(zT,{checked:e,onCheckedChange:()=>t(!e),id:"visualize",className:"data-[state=checked]:bg-foreground/50"})]})}const ZT="Collapsible",[ure,JT]=Pn(ZT),[dre,_x]=ure(ZT),fre=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l=!1,c]=Qn({prop:r,defaultProp:i,onChange:s});return m.createElement(dre,{scope:n,disabled:o,contentId:or(),open:l,onOpenToggle:m.useCallback(()=>c(d=>!d),[c])},m.createElement(Be.div,le({"data-state":Sx(l),"data-disabled":o?"":void 0},a,{ref:t})))}),hre="CollapsibleTrigger",pre=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=_x(hre,n);return m.createElement(Be.button,le({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Sx(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:t,onClick:Ce(e.onClick,i.onOpenToggle)}))}),eA="CollapsibleContent",gre=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=_x(eA,e.__scopeCollapsible);return m.createElement(vn,{present:n||i.open},({present:o})=>m.createElement(mre,le({},r,{ref:t,present:o})))}),mre=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=_x(eA,n),[a,l]=m.useState(r),c=m.useRef(null),d=et(t,c),f=m.useRef(0),g=f.current,p=m.useRef(0),v=p.current,y=s.open||a,x=m.useRef(y),w=m.useRef();return m.useEffect(()=>{const S=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(S)},[]),Vn(()=>{const S=c.current;if(S){w.current=w.current||{transitionDuration:S.style.transitionDuration,animationName:S.style.animationName},S.style.transitionDuration="0s",S.style.animationName="none";const C=S.getBoundingClientRect();f.current=C.height,p.current=C.width,x.current||(S.style.transitionDuration=w.current.transitionDuration,S.style.animationName=w.current.animationName),l(r)}},[s.open,r]),m.createElement(Be.div,le({"data-state":Sx(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!y},o,{ref:d,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style}}),y&&i)});function Sx(e){return e?"open":"closed"}const vre=fre,bre=pre,yre=gre,ls="Accordion",xre=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Cx,wre,_re]=uf(ls),[ng,Sfe]=Pn(ls,[_re,JT]),Ex=JT(),tA=m.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,o=r;return m.createElement(Cx.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(Ore,le({},o,{ref:t})):m.createElement(Ere,le({},i,{ref:t})))});tA.propTypes={type(e){const t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof t=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(t)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[nA,Sre]=ng(ls),[rA,Cre]=ng(ls,{collapsible:!1}),Ere=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...s}=e,[a,l]=Qn({prop:n,defaultProp:r,onChange:i});return m.createElement(nA,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>o&&l(""),[o,l])},m.createElement(rA,{scope:e.__scopeAccordion,collapsible:o},m.createElement(iA,le({},s,{ref:t}))))}),Ore=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[s=[],a]=Qn({prop:n,defaultProp:r,onChange:i}),l=m.useCallback(d=>a((f=[])=>[...f,d]),[a]),c=m.useCallback(d=>a((f=[])=>f.filter(g=>g!==d)),[a]);return m.createElement(nA,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},m.createElement(rA,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(iA,le({},o,{ref:t}))))}),[Pre,rg]=ng(ls),iA=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:o="vertical",...s}=e,a=m.useRef(null),l=et(a,t),c=wre(n),f=Ls(i)==="ltr",g=Ce(e.onKeyDown,p=>{var v;if(!xre.includes(p.key))return;const y=p.target,x=c().filter(F=>{var z;return!((z=F.ref.current)!==null&&z!==void 0&&z.disabled)}),w=x.findIndex(F=>F.ref.current===y),S=x.length;if(w===-1)return;p.preventDefault();let C=w;const P=0,O=S-1,k=()=>{C=w+1,C>O&&(C=P)},A=()=>{C=w-1,C<P&&(C=O)};switch(p.key){case"Home":C=P;break;case"End":C=O;break;case"ArrowRight":o==="horizontal"&&(f?k():A());break;case"ArrowDown":o==="vertical"&&k();break;case"ArrowLeft":o==="horizontal"&&(f?A():k());break;case"ArrowUp":o==="vertical"&&A();break}const L=C%S;(v=x[L].ref.current)===null||v===void 0||v.focus()});return m.createElement(Pre,{scope:n,disabled:r,direction:i,orientation:o},m.createElement(Cx.Slot,{scope:n},m.createElement(Be.div,le({},s,{"data-orientation":o,ref:l,onKeyDown:r?void 0:g}))))}),Ox="AccordionItem",[kre,Px]=ng(Ox),Mre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...i}=e,o=rg(Ox,n),s=Sre(Ox,n),a=Ex(n),l=or(),c=r&&s.value.includes(r)||!1,d=o.disabled||e.disabled;return m.createElement(kre,{scope:n,open:c,disabled:d,triggerId:l},m.createElement(vre,le({"data-orientation":o.orientation,"data-state":sA(c)},a,i,{ref:t,disabled:d,open:c,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})))}),Dre="AccordionHeader",Tre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=rg(ls,n),o=Px(Dre,n);return m.createElement(Be.h3,le({"data-orientation":i.orientation,"data-state":sA(o.open),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),oA="AccordionTrigger",Are=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=rg(ls,n),o=Px(oA,n),s=Cre(oA,n),a=Ex(n);return m.createElement(Cx.ItemSlot,{scope:n},m.createElement(bre,le({"aria-disabled":o.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId},a,r,{ref:t})))}),Ire="AccordionContent",Nre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=rg(ls,n),o=Px(Ire,n),s=Ex(n);return m.createElement(yre,le({role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation},s,r,{ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function sA(e){return e?"open":"closed"}const Rre=tA,Lre=Mre,$re=Tre,aA=Are,lA=Nre,cA=Rre,cs=ue.forwardRef(({className:e,...t},n)=>_.jsx(Lre,{ref:n,className:Pe("border-b",e),...t}));cs.displayName="AccordionItem";const us=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsx($re,{className:"flex",children:_.jsxs(aA,{ref:r,className:Pe("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,_.jsx(Hb,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));us.displayName=aA.displayName;const ds=ue.forwardRef(({className:e,children:t,...n},r)=>_.jsx(lA,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:_.jsx("div",{className:Pe("pb-4 pt-0",e),children:t})}));ds.displayName=lA.displayName;const uA="Radio",[Fre,dA]=Pn(uA),[jre,zre]=Fre(uA),Bre=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:o,disabled:s,value:a="on",onCheck:l,...c}=e,[d,f]=m.useState(null),g=et(t,y=>f(y)),p=m.useRef(!1),v=d?!!d.closest("form"):!0;return m.createElement(jre,{scope:n,checked:i,disabled:s},m.createElement(Be.button,le({type:"button",role:"radio","aria-checked":i,"data-state":fA(i),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:g,onClick:Ce(e.onClick,y=>{i||l==null||l(),v&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})})),v&&m.createElement(Wre,{control:d,bubbles:!p.current,name:r,value:a,checked:i,required:o,disabled:s,style:{transform:"translateX(-100%)"}}))}),Vre="RadioIndicator",Hre=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,o=zre(Vre,n);return m.createElement(vn,{present:r||o.checked},m.createElement(Be.span,le({"data-state":fA(o.checked),"data-disabled":o.disabled?"":void 0},i,{ref:t})))}),Wre=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=m.useRef(null),s=Op(n),a=Mh(t);return m.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",le({type:"radio","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function fA(e){return e?"checked":"unchecked"}const qre=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],hA="RadioGroup",[Ure,Cfe]=Pn(hA,[il,dA]),pA=il(),gA=dA(),[Gre,Yre]=Ure(hA),Kre=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:o,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:d=!0,onValueChange:f,...g}=e,p=pA(n),v=Ls(c),[y,x]=Qn({prop:o,defaultProp:i,onChange:f});return m.createElement(Gre,{scope:n,name:r,required:s,disabled:a,value:y,onValueChange:x},m.createElement(Mm,le({asChild:!0},p,{orientation:l,dir:v,loop:d}),m.createElement(Be.div,le({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:v},g,{ref:t}))))}),Xre="RadioGroupItem",Qre=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,o=Yre(Xre,n),s=o.disabled||r,a=pA(n),l=gA(n),c=m.useRef(null),d=et(t,c),f=o.value===i.value,g=m.useRef(!1);return m.useEffect(()=>{const p=y=>{qre.includes(y.key)&&(g.current=!0)},v=()=>g.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",v)}},[]),m.createElement(Dm,le({asChild:!0},a,{focusable:!s,active:f}),m.createElement(Bre,le({disabled:s,required:o.required,checked:f},l,i,{name:o.name,ref:d,onCheck:()=>o.onValueChange(i.value),onKeyDown:Ce(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Ce(i.onFocus,()=>{var p;g.current&&((p=c.current)===null||p===void 0||p.click())})})))}),Zre=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=gA(n);return m.createElement(Hre,le({},i,r,{ref:t}))}),mA=Kre,vA=Qre,Jre=Zre,bA=ue.forwardRef(({className:e,...t},n)=>_.jsx(mA,{className:Pe("grid gap-2",e),...t,ref:n}));bA.displayName=mA.displayName;const kx=ue.forwardRef(({className:e,...t},n)=>_.jsx(vA,{ref:n,className:Pe("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:_.jsx(Jre,{className:"flex items-center justify-center",children:_.jsx(H2,{className:"h-2.5 w-2.5 fill-current text-current"})})}));kx.displayName=vA.displayName;function yA(){var i;const e=_e(o=>o.card.cfg),t=_e(o=>o.actions.setCardCfg),n=(i=e==null?void 0:e.options)==null?void 0:i.indexAxis;function r(o){const s={...e,options:{...e==null?void 0:e.options,indexAxis:o}};t(s)}return _.jsxs("div",{children:[_.jsx("p",{className:"font-semibold",children:"Orientation"}),_.jsxs(bA,{value:n,onValueChange:r,className:"flex gap-3 mt-2 ",defaultValue:"x",children:[_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(kx,{value:"x",id:"r1"}),_.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Vertical"})]}),_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx(kx,{value:"y",id:"r2"}),_.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Horizontal"})]})]})]})}function xA(){var r,i,o;const e=_e(s=>s.card.cfg),t=_e(s=>s.actions.setCardCfg);function n(s){var c;const a={datalabels:{display:s!=="none",align:s,anchor:s,clamp:!0}},l={...e,options:{...e==null?void 0:e.options,plugins:{...(c=e==null?void 0:e.options)==null?void 0:c.plugins,...a}}};t(l),console.log(s)}return _.jsxs(_.Fragment,{children:[_.jsx("label",{className:"font-medium",children:"Data Labels"}),_.jsxs(oM,{value:(o=(i=(r=e==null?void 0:e.options)==null?void 0:r.plugins)==null?void 0:i.datalabels)==null?void 0:o.anchor,onValueChange:n,defaultValue:"none",children:[_.jsx(Oy,{className:"w-[180px] mt-2 focus:ring-1 focus:ring-offset-0 h-7",children:_.jsx(aM,{placeholder:"Select position"})}),_.jsx(Py,{children:_.jsxs(sM,{children:[_.jsx(Tp,{children:"Data Labels"}),_.jsx(xa,{value:"none",children:"None"}),_.jsx(xa,{value:"start",children:"Start"}),_.jsx(xa,{value:"center",children:"Center"}),_.jsx(xa,{value:"end",children:"End"})]})})]})]})}function wA(){const e=_e(i=>i.card.preferences),t=_e(i=>i.actions.setCardPreferences),n=_e(i=>{var o;return(o=i.card.preferences)==null?void 0:o.filterOnClickField}),r=_e(i=>i.actions.setFilterOnClickField);return _.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[_.jsx(zy,{checked:!!(e!=null&&e.filterOnClick),onCheckedChange:i=>{t({...e,filterOnClick:!!i})}}),_.jsx(fa,{children:"Filter on click"})]}),(e==null?void 0:e.filterOnClick)===!0&&_.jsxs("div",{className:"flex gap-2 items-center",children:[_.jsx(Ku,{value:n||"",className:" h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",placeholder:"expression (optional)",onChange:i=>r(i.target.value)}),_.jsxs(Bb,{children:[_.jsx(L2,{children:_.jsx(e2,{className:"h-4 w-4 opacity-70"})}),_.jsx(Ih,{children:_.jsxs("div",{className:"max-w-[200px]",children:["The x-axis expression of your query. Example:",_.jsx("div",{className:" mt-1 text-xs font-mono",children:"TO_CHAR(order_date, 'YYYY-MM')"})]})})]})]})]})}const eie={datasets:[{type:"line",label:"Sum_sales",data:[]},{type:"bar",label:"Sum_profit",data:[]}]},tie={datasets:[{fill:"origin",type:"line",label:"Sum_sales",data:[]}]};function nie(){const e=_e(t=>t.card.type);return _.jsxs("div",{className:"p-6 space-y-6",children:[_.jsx(cA,{className:" ",type:"single",collapsible:!0,children:rie(e)}),_.jsx("section",{className:"",children:["line","bar"].includes(e)&&_.jsx(yA,{})}),_.jsx("div",{children:_.jsx(xA,{})}),_.jsx("div",{children:_.jsx(wA,{})})]})}function rie(e){if(["line","bar"].includes(e))return _.jsxs(_.Fragment,{children:[_.jsxs(cs,{className:"border-muted",value:"item-1",children:[_.jsx(us,{className:" font-normal",children:_.jsx("p",{children:"Chart Query"})}),_.jsxs(ds,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"X-axis - Category (ex. city)"}),_.jsx("li",{children:"Y-axis - Number (ex. population)"})]})]})]}),_.jsxs(cs,{className:"border-muted",value:"item-2",children:[_.jsx(us,{className:" font-normal",children:"Mixed Chart"}),_.jsxs(ds,{className:" text-xs space-y-2",children:[_.jsxs("p",{children:["Click ",_.jsx("b",{children:"Customize"})," and change the `type` property in the dataset."]}),_.jsx("pre",{children:JSON.stringify(eie,null,2)})]})]}),_.jsxs(cs,{className:"border-muted",value:"item-3",children:[_.jsx(us,{className:" font-normal",children:"Area Chart"}),_.jsxs(ds,{className:" text-xs space-y-2",children:[_.jsxs("p",{children:["Click ",_.jsx("b",{children:"Customize"})," and add `fill` property to the dataset. See",_.jsx("a",{className:"text-blue-500 hover:underline mx-1",href:"https://www.chartjs.org/docs/latest/samples/area/line-boundaries.html",target:"_blank",children:"docs"}),"for more options."]}),_.jsx("pre",{children:JSON.stringify(tie,null,2)})]})]})]});if(e==="bubble")return _.jsx(_.Fragment,{children:_.jsxs(cs,{className:"border-muted",value:"item-1",children:[_.jsx(us,{className:" font-normal",children:_.jsxs("p",{children:["How to create a ",_.jsx("span",{children:e})," chart query?"]})}),_.jsxs(ds,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT label, x-axis, y-axis, radius FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Label - Category (ex. city)"}),_.jsx("li",{children:"Bubble Group (opt) - Category (ex. state)"}),_.jsx("li",{children:"X-axis - Number (ex. avg. age)"}),_.jsx("li",{children:"Y-axis - Number (ex. avg. weight)"}),_.jsx("li",{children:"Radius - Number (ex. population)"})]})]})]})});if(e==="scatter")return _.jsx(_.Fragment,{children:_.jsxs(cs,{value:"item-1",children:[_.jsx(us,{className:" font-normal",children:_.jsxs("p",{children:["How to create a ",_.jsx("span",{children:e})," chart query?"]})}),_.jsxs(ds,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT label, x-axis, y-axis FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Label - Category (ex. city)"}),_.jsx("li",{children:"Group (opt) - Category (ex. state)"}),_.jsx("li",{children:"X-axis - Number (ex. avg. age)"}),_.jsx("li",{children:"Y-axis - Number (ex. avg. weight)"})]})]})]})});if(["pie","doughnut","polarArea"].includes(e))return _.jsx(_.Fragment,{children:_.jsxs(cs,{value:"item-1",children:[_.jsx(us,{className:" font-normal",children:_.jsxs("p",{children:["How to create a"," ",_.jsxs("span",{children:[e==="polarArea"?"polar":e," "]})," ","chart query?"]})}),_.jsxs(ds,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT label, measure FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"Label - Category (ex. city)"}),_.jsx("li",{children:"Measure - Number (ex. population)"})]})]})]})})}function iie(){return _.jsxs("div",{className:"px-6 py-2 space-y-6",children:[_.jsx(cA,{className:" ",type:"single",collapsible:!0,children:_.jsxs(cs,{className:"border-muted",value:"item-1",children:[_.jsx(us,{className:" font-normal",children:"Stacked chart query?"}),_.jsxs(ds,{className:" ",children:[_.jsx("div",{className:"bg-muted px-2 py-1 rounded font-mono font-semibold text-xs",children:"SELECT x-axis, stack-by, y-axis FROM table"}),_.jsxs("ul",{className:"my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs",children:[_.jsx("li",{children:"X-axis - Category (ex. country)"}),_.jsx("li",{children:"Stack by - Category (ex. city)"}),_.jsx("li",{children:"Y-axis - Number (ex. population)"})]})]})]})}),_.jsx("section",{className:"",children:_.jsx(yA,{})}),_.jsx("div",{children:_.jsx(xA,{})}),_.jsx("div",{children:_.jsx(wA,{})})]})}function oie(){const e=_e(t=>t.card.type);return _.jsx(Pl,{className:" text-sm h-full w-full ",children:e==="stackedBar"?_.jsx(iie,{}):_.jsx(nie,{})})}function sie(){const e=_e(t=>t.isShowingVisual);return _.jsxs($M,{direction:"vertical",className:"min-w-full max-w-lg min-h-[250px]",children:[_.jsx($p,{className:"flex",minSize:40,defaultSize:40,children:_.jsx(Hne,{})}),_.jsx(FM,{className:"border-[1.5px] border-muted"}),_.jsx($p,{minSize:60,defaultSize:60,children:e?_.jsxs($M,{direction:"horizontal",children:[_.jsx(_.Fragment,{children:_.jsx($p,{className:"flex min-w-[275px]",minSize:20,defaultSize:25,maxSize:30,children:_.jsx(oie,{})})}),_.jsx(FM,{className:"border-[1.5px] border-muted"}),_.jsx($p,{minSize:40,defaultSize:70,maxSize:100,children:_.jsx(QT,{})})]}):_.jsx(QT,{})})]})}function aie({authToken:e,onSave:t,onClose:n}){_e(s=>s.actions.setCard);const r=_e(s=>s.actions.setOnSave),i=_e(s=>s.actions.setOnClose),o=be(s=>s.actions.setAuthToken);return m.useEffect(()=>{t&&r(t),n&&i(n)},[t,r,n,i]),m.useEffect(()=>{e&&e.accessToken&&o(e)},[e,o]),_.jsxs(Fk,{className:"border-x border-b rounded-none border-muted ",children:[_.jsx(jk,{className:" rounded-none border-r-[3px] border-muted ",children:_.jsx(dM,{})}),_.jsx(zk,{children:_.jsx(sie,{})})]})}function lie(){be(s=>s.selectedCardId);const e=be(s=>s.selectedSheetId),t=be(s=>s.actions.setIsVisualEditing);be(s=>s.actions.setIsEditorSaveEvent);const n=be(s=>s.isVisualEditing);be(s=>s.actions.getSelectedCard());const r=be(s=>s.actions.updateCard);function i(s){e&&(r(e,s),t(!1))}function o(){t(!1)}return _.jsx("div",{className:`grow flex ${n?"block":"hidden"}`,children:_.jsx(aie,{onSave:i,onClose:o})})}function cie({columns:e,tableName:t}){const n=_e(f=>f.selectedConnectionId),r=_e(f=>f.selectedDatabaseName),i=_e(f=>f.selectedSchemaName),o=_e(f=>f.selectedTableName),s=be(f=>f.dashboard.filters)||[],a=be(f=>f.actions.addFilter),l=be(f=>f.actions.removeFilter),c=be(f=>f.actions.removeFilterValue);function d(f){const g=s==null?void 0:s.find(p=>p.column===f.column_name&&p.table===o&&p.database===r);if(g)c(g.id),l(g.id);else{const p=k0(i||"",t),v=`SELECT ${f.column_name}, COUNT(*) FROM ${p} GROUP BY ${f.column_name} ORDER BY ${f.column_name} ASC LIMIT 50`,y=`SELECT min(${f.column_name}) as min, max(${f.column_name}) as max FROM ${p}`;if(t==="api"&&n){a({id:yh(),column:f.column_name,title:f.column_name,dataType:f.data_type,table:"api",database:"NA",connectionId:n,sql:Iu.includes(f.data_type)?y:v});return}if(!n||!r||!o)throw new Error("missing connectionId, database, or table");a({id:yh(),column:f.column_name,title:f.column_name,dataType:f.data_type,table:o,database:r,connectionId:n,sql:Iu.includes(f.data_type)?y:v})}}return _.jsx(Pl,{className:" h-[70vh] mt-2 xbg-red-100 px-3",children:e==null?void 0:e.map(f=>{const g=s==null?void 0:s.find(p=>p.column===f.column_name&&p.table===o&&p.database===r);return _.jsx("div",{onClick:()=>d(f),className:Pe(" group flex text-sm items-center justify-between px-3 py-[6px] transition-colors hover:bg-muted/50 cursor-pointer border border-background border-dashed",{"bg-muted ":g}),children:_.jsxs("div",{className:"flex items-center gap-2 ",children:[_.jsx(uM,{column:f}),_.jsx("span",{children:f.column_name})]})},f.column_name)})})}function uie(){be(t=>t.showFilters);const e=be(t=>t.actions.setShowFilters);return _.jsxs("section",{className:" relative space-y-4 py-0 px-4 border-muted bg-red-x100",children:[_.jsx(it,{onClick:()=>e(!1),className:" p-0 h-7 w-7 absolute top-0 right-4",variant:"outline",children:_.jsx(na,{})}),_.jsx("p",{className:"text-md px-2",children:"Data Columns"}),_.jsx("div",{children:_.jsx(dM,{ColumnsComponent:(t,n,r)=>_.jsx(cie,{schemaName:t,tableName:n,columns:r})})})]})}function die(){const e=be(r=>r.dashboard),t=be(r=>r.showFilters),n=be(r=>r.isVisualEditing);return m.useEffect(()=>{if(e.id==="")return;const r=$l(e.id),i=JSON.parse(localStorage.getItem(r)||"[]"),o=i.find(s=>s.name==="Original");o?o.template=e:i.push({name:"Original",template:e}),localStorage.setItem(r,JSON.stringify(i))},[e.id]),_.jsxs("div",{role:"dashboard-plus-main",className:` flex grow ${n?"hidden":"block"}`,children:[_.jsx(QP,{}),t&&_.jsx("div",{role:"filter-aside-container",className:"",children:_.jsx(uie,{})})]})}function fie(){const e=be(r=>r.dashboard),t=be(r=>r.actions.setDashboard),n=be(r=>r.showDashboardJSON);return be(r=>r.actions.setShowDashboardJSON),_.jsx("div",{className:Pe(" p-2",{hidden:!n}),children:_.jsx(JM,{onChange:r=>{if(r)try{JSON.parse(r),t(JSON.parse(r))}catch{}},defaultLanguage:"json",className:"h-[550px] overflow-y-auto ",value:JSON.stringify(e,null,2),options:{minimap:{enabled:!1},glyphMargin:!1,wordWrap:"on",scrollbar:{verticalScrollbarSize:0,horizontalScrollbarSize:0},fontSize:12,renderLineHighlight:"none"}})})}function hie({showControls:e=!1,showFooter:t=!0,...n}){return be(r=>r.isVisualEditing),_.jsxs(ZP,{children:[_.jsx(fie,{}),_.jsxs(Kw,{...n,children:[e&&_.jsx(BK,{}),_.jsx(lie,{}),_.jsx(die,{})]})]})}function pie(){const e=be(t=>t.actions);return{setDashboardTitle:e.setDashboardTitle,getStyle:e.getStyle,getDashboard:e.getDashboard,setOnSaveFunction:e.setOnSaveFunction,setOnAddCard:e.setOnAddCard,setOnUpateCard:e.setOnUpdateCard,setOnRemoveCard:e.setOnRemoveCard}}ct.Dashboard=JP,ct.DashboardPlus=hie,ct.DashboardWC=YG,ct.cleanCard=Pk,ct.getBookmarkKey=$l,ct.getDashbaordStateWithoutData=vy,ct.useActions=pie,ct.useDashboardStore=be,Object.defineProperty(ct,Symbol.toStringTag,{value:"Module"})});
|