react-semaphor 0.0.491 → 0.0.492

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.
@@ -1,4 +1,4 @@
1
- "use strict";var zs=t=>{throw TypeError(t)};var Ue=(t,a,n)=>a.has(t)||zs("Cannot "+n);var W=(t,a,n)=>(Ue(t,a,"read from private field"),n?n.call(t):a.get(t)),re=(t,a,n)=>a.has(t)?zs("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,n),ee=(t,a,n,r)=>(Ue(t,a,"write to private field"),r?r.call(t,n):a.set(t,n),n),ie=(t,a,n)=>(Ue(t,a,"access private method"),n);const e=require("react/jsx-runtime"),s=require("./index-Cf_bcSdd.js"),M=require("react");require("react-dom");function Rt(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(a,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return a.default=t,Object.freeze(a)}const ae=Rt(M);function Bs(t,a){return t.filter(n=>!a.includes(n))}function Pt(t,a,n){const r=t.slice(0);return r[a]=n,r}var he,te,be,ve,ne,ue,Ee,Ie,Te,Z,ts,ns,as,rs,is,Ks,Vt=(Ks=class extends s.Subscribable{constructor(a,n,r){super();re(this,Z);re(this,he);re(this,te);re(this,be);re(this,ve);re(this,ne);re(this,ue);re(this,Ee);re(this,Ie);re(this,Te,[]);ee(this,he,a),ee(this,ve,r),ee(this,be,[]),ee(this,ne,[]),ee(this,te,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&W(this,ne).forEach(a=>{a.subscribe(n=>{ie(this,Z,rs).call(this,a,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,W(this,ne).forEach(a=>{a.destroy()})}setQueries(a,n,r){if(ee(this,be,a),ee(this,ve,n),process.env.NODE_ENV!=="production"){const i=a.map(o=>W(this,he).defaultQueryOptions(o).queryHash);new Set(i).size!==i.length&&console.warn("[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.")}s.notifyManager.batch(()=>{const i=W(this,ne),o=ie(this,Z,as).call(this,W(this,be));ee(this,Te,o),o.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions,r));const c=o.map(m=>m.observer),d=c.map(m=>m.getCurrentResult()),l=c.some((m,u)=>m!==i[u]);i.length===c.length&&!l||(ee(this,ne,c),ee(this,te,d),this.hasListeners()&&(Bs(i,c).forEach(m=>{m.destroy()}),Bs(c,i).forEach(m=>{m.subscribe(u=>{ie(this,Z,rs).call(this,m,u)})}),ie(this,Z,is).call(this)))})}getCurrentResult(){return W(this,te)}getQueries(){return W(this,ne).map(a=>a.getCurrentQuery())}getObservers(){return W(this,ne)}getOptimisticResult(a,n){const r=ie(this,Z,as).call(this,a),i=r.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions));return[i,o=>ie(this,Z,ns).call(this,o??i,n),()=>ie(this,Z,ts).call(this,i,r)]}},he=new WeakMap,te=new WeakMap,be=new WeakMap,ve=new WeakMap,ne=new WeakMap,ue=new WeakMap,Ee=new WeakMap,Ie=new WeakMap,Te=new WeakMap,Z=new WeakSet,ts=function(a,n){return n.map((r,i)=>{const o=a[i];return r.defaultedQueryOptions.notifyOnChangeProps?o:r.observer.trackResult(o,c=>{n.forEach(d=>{d.observer.trackProp(c)})})})},ns=function(a,n){return n?((!W(this,ue)||W(this,te)!==W(this,Ie)||n!==W(this,Ee))&&(ee(this,Ee,n),ee(this,Ie,W(this,te)),ee(this,ue,s.replaceEqualDeep(W(this,ue),n(a)))),W(this,ue)):a},as=function(a){const n=new Map(W(this,ne).map(i=>[i.options.queryHash,i])),r=[];return a.forEach(i=>{const o=W(this,he).defaultQueryOptions(i),c=n.get(o.queryHash);c?r.push({defaultedQueryOptions:o,observer:c}):r.push({defaultedQueryOptions:o,observer:new s.QueryObserver(W(this,he),o)})}),r},rs=function(a,n){const r=W(this,ne).indexOf(a);r!==-1&&(ee(this,te,Pt(W(this,te),r,n)),ie(this,Z,is).call(this))},is=function(){var a;if(this.hasListeners()){const n=W(this,ue),r=ie(this,Z,ts).call(this,W(this,te),W(this,Te)),i=ie(this,Z,ns).call(this,r,(a=W(this,ve))==null?void 0:a.combine);n!==i&&s.notifyManager.batch(()=>{this.listeners.forEach(o=>{o(W(this,te))})})}},Ks);function qt({queries:t,...a},n){const r=s.useQueryClient(),i=s.useIsRestoring(),o=s.useQueryErrorResetBoundary(),c=ae.useMemo(()=>t.map(f=>{const S=r.defaultQueryOptions(f);return S._optimisticResults=i?"isRestoring":"optimistic",S}),[t,r,i]);c.forEach(f=>{s.ensureSuspenseTimers(f),s.ensurePreventErrorBoundaryRetry(f,o)}),s.useClearResetErrorBoundary(o);const[d]=ae.useState(()=>new Vt(r,c,a)),[l,m,u]=d.getOptimisticResult(c,a.combine),h=!i&&a.subscribed!==!1;ae.useSyncExternalStore(ae.useCallback(f=>h?d.subscribe(s.notifyManager.batchCalls(f)):s.noop,[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),ae.useEffect(()=>{d.setQueries(c,a,{listeners:!1})},[c,a,d]);const p=l.some((f,S)=>s.shouldSuspend(c[S],f))?l.flatMap((f,S)=>{const x=c[S];if(x){const N=new s.QueryObserver(r,x);if(s.shouldSuspend(x,f))return s.fetchOptimistic(x,N,o);s.willFetch(f,i)&&s.fetchOptimistic(x,N,o)}return[]}):[];if(p.length>0)throw Promise.all(p);const g=l.find((f,S)=>{const x=c[S];return x&&s.getHasError({result:f,errorResetBoundary:o,throwOnError:x.throwOnError,query:r.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(g!=null&&g.error)throw g.error;return m(u())}/**
1
+ "use strict";var zs=t=>{throw TypeError(t)};var Ue=(t,a,n)=>a.has(t)||zs("Cannot "+n);var W=(t,a,n)=>(Ue(t,a,"read from private field"),n?n.call(t):a.get(t)),re=(t,a,n)=>a.has(t)?zs("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,n),ee=(t,a,n,r)=>(Ue(t,a,"write to private field"),r?r.call(t,n):a.set(t,n),n),ie=(t,a,n)=>(Ue(t,a,"access private method"),n);const e=require("react/jsx-runtime"),s=require("./index-CRGWDg7M.js"),M=require("react");require("react-dom");function Rt(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(a,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return a.default=t,Object.freeze(a)}const ae=Rt(M);function Bs(t,a){return t.filter(n=>!a.includes(n))}function Pt(t,a,n){const r=t.slice(0);return r[a]=n,r}var he,te,be,ve,ne,ue,Ee,Ie,Te,Z,ts,ns,as,rs,is,Ks,Vt=(Ks=class extends s.Subscribable{constructor(a,n,r){super();re(this,Z);re(this,he);re(this,te);re(this,be);re(this,ve);re(this,ne);re(this,ue);re(this,Ee);re(this,Ie);re(this,Te,[]);ee(this,he,a),ee(this,ve,r),ee(this,be,[]),ee(this,ne,[]),ee(this,te,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&W(this,ne).forEach(a=>{a.subscribe(n=>{ie(this,Z,rs).call(this,a,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,W(this,ne).forEach(a=>{a.destroy()})}setQueries(a,n,r){if(ee(this,be,a),ee(this,ve,n),process.env.NODE_ENV!=="production"){const i=a.map(o=>W(this,he).defaultQueryOptions(o).queryHash);new Set(i).size!==i.length&&console.warn("[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.")}s.notifyManager.batch(()=>{const i=W(this,ne),o=ie(this,Z,as).call(this,W(this,be));ee(this,Te,o),o.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions,r));const c=o.map(m=>m.observer),d=c.map(m=>m.getCurrentResult()),l=c.some((m,u)=>m!==i[u]);i.length===c.length&&!l||(ee(this,ne,c),ee(this,te,d),this.hasListeners()&&(Bs(i,c).forEach(m=>{m.destroy()}),Bs(c,i).forEach(m=>{m.subscribe(u=>{ie(this,Z,rs).call(this,m,u)})}),ie(this,Z,is).call(this)))})}getCurrentResult(){return W(this,te)}getQueries(){return W(this,ne).map(a=>a.getCurrentQuery())}getObservers(){return W(this,ne)}getOptimisticResult(a,n){const r=ie(this,Z,as).call(this,a),i=r.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions));return[i,o=>ie(this,Z,ns).call(this,o??i,n),()=>ie(this,Z,ts).call(this,i,r)]}},he=new WeakMap,te=new WeakMap,be=new WeakMap,ve=new WeakMap,ne=new WeakMap,ue=new WeakMap,Ee=new WeakMap,Ie=new WeakMap,Te=new WeakMap,Z=new WeakSet,ts=function(a,n){return n.map((r,i)=>{const o=a[i];return r.defaultedQueryOptions.notifyOnChangeProps?o:r.observer.trackResult(o,c=>{n.forEach(d=>{d.observer.trackProp(c)})})})},ns=function(a,n){return n?((!W(this,ue)||W(this,te)!==W(this,Ie)||n!==W(this,Ee))&&(ee(this,Ee,n),ee(this,Ie,W(this,te)),ee(this,ue,s.replaceEqualDeep(W(this,ue),n(a)))),W(this,ue)):a},as=function(a){const n=new Map(W(this,ne).map(i=>[i.options.queryHash,i])),r=[];return a.forEach(i=>{const o=W(this,he).defaultQueryOptions(i),c=n.get(o.queryHash);c?r.push({defaultedQueryOptions:o,observer:c}):r.push({defaultedQueryOptions:o,observer:new s.QueryObserver(W(this,he),o)})}),r},rs=function(a,n){const r=W(this,ne).indexOf(a);r!==-1&&(ee(this,te,Pt(W(this,te),r,n)),ie(this,Z,is).call(this))},is=function(){var a;if(this.hasListeners()){const n=W(this,ue),r=ie(this,Z,ts).call(this,W(this,te),W(this,Te)),i=ie(this,Z,ns).call(this,r,(a=W(this,ve))==null?void 0:a.combine);n!==i&&s.notifyManager.batch(()=>{this.listeners.forEach(o=>{o(W(this,te))})})}},Ks);function qt({queries:t,...a},n){const r=s.useQueryClient(),i=s.useIsRestoring(),o=s.useQueryErrorResetBoundary(),c=ae.useMemo(()=>t.map(f=>{const S=r.defaultQueryOptions(f);return S._optimisticResults=i?"isRestoring":"optimistic",S}),[t,r,i]);c.forEach(f=>{s.ensureSuspenseTimers(f),s.ensurePreventErrorBoundaryRetry(f,o)}),s.useClearResetErrorBoundary(o);const[d]=ae.useState(()=>new Vt(r,c,a)),[l,m,u]=d.getOptimisticResult(c,a.combine),h=!i&&a.subscribed!==!1;ae.useSyncExternalStore(ae.useCallback(f=>h?d.subscribe(s.notifyManager.batchCalls(f)):s.noop,[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),ae.useEffect(()=>{d.setQueries(c,a,{listeners:!1})},[c,a,d]);const p=l.some((f,S)=>s.shouldSuspend(c[S],f))?l.flatMap((f,S)=>{const x=c[S];if(x){const N=new s.QueryObserver(r,x);if(s.shouldSuspend(x,f))return s.fetchOptimistic(x,N,o);s.willFetch(f,i)&&s.fetchOptimistic(x,N,o)}return[]}):[];if(p.length>0)throw Promise.all(p);const g=l.find((f,S)=>{const x=c[S];return x&&s.getHasError({result:f,errorResetBoundary:o,throwOnError:x.throwOnError,query:r.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(g!=null&&g.error)throw g.error;return m(u())}/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -4,7 +4,7 @@ var Ka = (t) => {
4
4
  var jn = (t, a, n) => a.has(t) || Ka("Cannot " + n);
5
5
  var me = (t, a, n) => (jn(t, a, "read from private field"), n ? n.call(t) : a.get(t)), Oe = (t, a, n) => a.has(t) ? Ka("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(t) : a.set(t, n), Se = (t, a, n, r) => (jn(t, a, "write to private field"), r ? r.call(t, n) : a.set(t, n), n), Ae = (t, a, n) => (jn(t, a, "access private method"), n);
6
6
  import { jsxs as s, jsx as e, Fragment as ee } from "react/jsx-runtime";
7
- import { z as $r, A as Kn, B as Gr, Q as gs, C as ys, E as Jr, F as Hr, G as Ur, H as Yr, I as Kr, J as Qr, K as Qa, L as Wa, M as Wr, N as Zr, O as P, P as ua, v as H, w as At, R as rt, T as Qt, U as ha, V as _, W as xe, X as Wt, Y as bn, Z as xn, _ as pa, $ as B, a0 as Ne, a1 as fa, a2 as vs, a3 as bs, a4 as ae, a5 as xs, a6 as Ns, a7 as Cs, a8 as Xr, a9 as Za, aa as Q, ab as ga, ac as ei, ad as le, ae as oe, af as ce, ag as de, ah as Xe, ai as Be, aj as W, ak as ws, al as Je, am as He, an as zt, ao as Ke, ap as yt, aq as Ft, ar as Zt, as as Lt, at as et, au as Ss, av as Xt, aw as ya, ax as ks, ay as vt, az as Qn, aA as Rt, x as k, aB as Ms, aC as Dt, aD as on, aE as bt, aF as Nn, aG as Cn, aH as wn, aI as Sn, aJ as kn, aK as Mn, aL as Dn, t as qe, aM as Ds, aN as Ts, aO as Es, aP as Is, l as Os, k as As, f as Ve, aQ as ti, e as Pe, aR as ni, g as pt, h as _e, aS as zs, j as ai, aT as si, aU as ri, aV as nt, aW as tt, aX as Fs, aY as ii, y as te, d as Ls, aZ as $t, a_ as Qe, a$ as li, b0 as Wn, b1 as va, b2 as ba, b3 as Tn, b4 as at, b5 as Rs, r as cn, p as Zn, b6 as Le, b7 as oi, b8 as st, b9 as ci, ba as di, bb as mi, bc as ui, bd as Vs, be as hi, bf as En, bg as pi, bh as fi, bi as gi, bj as Xa, bk as yi, bl as vi, bm as bi, bn as xi, bo as Xn, bp as ye, bq as We, br as we, bs as Ze, bt as Ni, bu as js, bv as qs, bw as Ps, bx as Ci, by as wi, bz as Si, bA as ki, bB as qn, bC as Mi, bD as es, bE as Di, bF as ts, bG as Ti, bH as Ei, bI as Ii, bJ as Oi, bK as _s, bL as Ai, bM as xa, bN as Bs, bO as In, bP as $s, bQ as St, bR as Gs, bS as zi, bT as Js, bU as On, bV as Fi, bW as Li, bX as Hs, bY as Ri, bZ as An, b_ as Us, b$ as Vi, c0 as xt, c1 as Nt, c2 as be, c3 as ct, c4 as ji, c5 as qi, c6 as Pi, c7 as Na, c8 as Ys, c9 as _i, ca as dn, cb as Ks, cc as mn, cd as Qs, ce as zn, cf as Ws, cg as Bi, ch as $i, ci as Gi, cj as Zs, ck as it, cl as pe, cm as fe, cn as ge, co as ft, cp as Ji, cq as Hi, cr as Ui, cs as Yi, q as Ki, ct as ns, cu as Xs, cv as Qi, cw as Wi, cx as Zi, cy as er, cz as Ca, cA as Vt, cB as wa, cC as Ge, cD as Xi, cE as jt, cF as tr, cG as el, cH as tl, cI as nl, cJ as al, cK as sl, cL as rl, cM as il, cN as ll, cO as ol, cP as cl, cQ as Pn, cR as qt, cS as ue, cT as De, cU as dl, cV as Gt, cW as $e, cX as Sa, cY as ml, cZ as ul, c_ as hl, c$ as Tt, d0 as pl, d1 as ea, d2 as ta, d3 as na, d4 as un, d5 as Et, d6 as Jt, d7 as fl, d8 as gl, d9 as nr, da as yl, db as vl, dc as bl, dd as xl, de as Nl, df as Cl } from "./index-BjgdaiaG.js";
7
+ import { z as $r, A as Kn, B as Gr, Q as gs, C as ys, E as Jr, F as Hr, G as Ur, H as Yr, I as Kr, J as Qr, K as Qa, L as Wa, M as Wr, N as Zr, O as P, P as ua, v as H, w as At, R as rt, T as Qt, U as ha, V as _, W as xe, X as Wt, Y as bn, Z as xn, _ as pa, $ as B, a0 as Ne, a1 as fa, a2 as vs, a3 as bs, a4 as ae, a5 as xs, a6 as Ns, a7 as Cs, a8 as Xr, a9 as Za, aa as Q, ab as ga, ac as ei, ad as le, ae as oe, af as ce, ag as de, ah as Xe, ai as Be, aj as W, ak as ws, al as Je, am as He, an as zt, ao as Ke, ap as yt, aq as Ft, ar as Zt, as as Lt, at as et, au as Ss, av as Xt, aw as ya, ax as ks, ay as vt, az as Qn, aA as Rt, x as k, aB as Ms, aC as Dt, aD as on, aE as bt, aF as Nn, aG as Cn, aH as wn, aI as Sn, aJ as kn, aK as Mn, aL as Dn, t as qe, aM as Ds, aN as Ts, aO as Es, aP as Is, l as Os, k as As, f as Ve, aQ as ti, e as Pe, aR as ni, g as pt, h as _e, aS as zs, j as ai, aT as si, aU as ri, aV as nt, aW as tt, aX as Fs, aY as ii, y as te, d as Ls, aZ as $t, a_ as Qe, a$ as li, b0 as Wn, b1 as va, b2 as ba, b3 as Tn, b4 as at, b5 as Rs, r as cn, p as Zn, b6 as Le, b7 as oi, b8 as st, b9 as ci, ba as di, bb as mi, bc as ui, bd as Vs, be as hi, bf as En, bg as pi, bh as fi, bi as gi, bj as Xa, bk as yi, bl as vi, bm as bi, bn as xi, bo as Xn, bp as ye, bq as We, br as we, bs as Ze, bt as Ni, bu as js, bv as qs, bw as Ps, bx as Ci, by as wi, bz as Si, bA as ki, bB as qn, bC as Mi, bD as es, bE as Di, bF as ts, bG as Ti, bH as Ei, bI as Ii, bJ as Oi, bK as _s, bL as Ai, bM as xa, bN as Bs, bO as In, bP as $s, bQ as St, bR as Gs, bS as zi, bT as Js, bU as On, bV as Fi, bW as Li, bX as Hs, bY as Ri, bZ as An, b_ as Us, b$ as Vi, c0 as xt, c1 as Nt, c2 as be, c3 as ct, c4 as ji, c5 as qi, c6 as Pi, c7 as Na, c8 as Ys, c9 as _i, ca as dn, cb as Ks, cc as mn, cd as Qs, ce as zn, cf as Ws, cg as Bi, ch as $i, ci as Gi, cj as Zs, ck as it, cl as pe, cm as fe, cn as ge, co as ft, cp as Ji, cq as Hi, cr as Ui, cs as Yi, q as Ki, ct as ns, cu as Xs, cv as Qi, cw as Wi, cx as Zi, cy as er, cz as Ca, cA as Vt, cB as wa, cC as Ge, cD as Xi, cE as jt, cF as tr, cG as el, cH as tl, cI as nl, cJ as al, cK as sl, cL as rl, cM as il, cN as ll, cO as ol, cP as cl, cQ as Pn, cR as qt, cS as ue, cT as De, cU as dl, cV as Gt, cW as $e, cX as Sa, cY as ml, cZ as ul, c_ as hl, c$ as Tt, d0 as pl, d1 as ea, d2 as ta, d3 as na, d4 as un, d5 as Et, d6 as Jt, d7 as fl, d8 as gl, d9 as nr, da as yl, db as vl, dc as bl, dd as xl, de as Nl, df as Cl } from "./index-bm2bUPOX.js";
8
8
  import * as Ie from "react";
9
9
  import Fe, { useState as j, useMemo as dt, useRef as gt, useCallback as ke, useEffect as ve, Suspense as wl } from "react";
10
10
  import "react-dom";
@@ -33,7 +33,7 @@
33
33
  */var O2;function HB(){return O2||(O2=1,process.env.NODE_ENV!=="production"&&function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=R,n=X1(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;W0.useSyncExternalStoreWithSelector=function(c,u,d,f,h){var p=i(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function y(w){if(!v){if(v=!0,x=w,w=f(w),h!==void 0&&m.hasValue){var _=m.value;if(h(_,w))return E=_}return E=w}if(_=E,r(x,w))return _;var k=f(w);return h!==void 0&&h(_,k)?(x=w,_):(x=w,E=k)}var v=!1,x,E,C=d===void 0?null:d;return[function(){return y(u())},C===null?void 0:function(){return y(C())}]},[u,d,f,h]);var b=o(c,p[0],p[1]);return s(function(){m.hasValue=!0,m.value=b},[b]),l(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),W0}process.env.NODE_ENV==="production"?rx.exports=VB():rx.exports=HB();var WB=rx.exports;const qB=Vs(WB),pN={},{useDebugValue:UB}=R,{useSyncExternalStoreWithSelector:GB}=qB;let j2=!1;const YB=e=>e;function KB(e,t=YB,n){(pN?"production":void 0)!=="production"&&n&&!j2&&(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"),j2=!0);const r=GB(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return UB(r),r}const F2=e=>{(pN?"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"?$B(e):e,n=(r,o)=>KB(t,r,o);return Object.assign(n,t),n},Q1=e=>e?F2(e):F2;var gN=Symbol.for("immer-nothing"),L2=Symbol.for("immer-draftable"),Hr=Symbol.for("immer-state"),XB=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 _r(e,...t){if(process.env.NODE_ENV!=="production"){const n=XB[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 jc=Object.getPrototypeOf;function Fc(e){return!!e&&!!e[Hr]}function el(e){var t;return e?mN(e)||Array.isArray(e)||!!e[L2]||!!((t=e.constructor)!=null&&t[L2])||Hm(e)||Wm(e):!1}var QB=Object.prototype.constructor.toString();function mN(e){if(!e||typeof e!="object")return!1;const t=jc(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)===QB}function wg(e,t){Vm(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Vm(e){const t=e[Hr];return t?t.type_:Array.isArray(e)?1:Hm(e)?2:Wm(e)?3:0}function ox(e,t){return Vm(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function bN(e,t,n){const r=Vm(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function ZB(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Hm(e){return e instanceof Map}function Wm(e){return e instanceof Set}function fa(e){return e.copy_||e.base_}function ix(e,t){if(Hm(e))return new Map(e);if(Wm(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=mN(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Hr];let o=Reflect.ownKeys(r);for(let i=0;i<o.length;i++){const s=o[i],a=r[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(jc(e),r)}else{const r=jc(e);if(r!==null&&n)return{...e};const o=Object.create(r);return Object.assign(o,e)}}function Z1(e,t=!1){return qm(e)||Fc(e)||!el(e)||(Vm(e)>1&&(e.set=e.add=e.clear=e.delete=JB),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>Z1(r,!0))),e}function JB(){_r(2)}function qm(e){return Object.isFrozen(e)}var eV={};function tl(e){const t=eV[e];return t||_r(0,e),t}var Kd;function yN(){return Kd}function tV(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function $2(e,t){t&&(tl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function sx(e){ax(e),e.drafts_.forEach(nV),e.drafts_=null}function ax(e){e===Kd&&(Kd=e.parent_)}function z2(e){return Kd=tV(Kd,e)}function nV(e){const t=e[Hr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function B2(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Hr].modified_&&(sx(t),_r(4)),el(e)&&(e=Sg(t,e),t.parent_||Cg(t,e)),t.patches_&&tl("Patches").generateReplacementPatches_(n[Hr].base_,e,t.patches_,t.inversePatches_)):e=Sg(t,n,[]),sx(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==gN?e:void 0}function Sg(e,t,n){if(qm(t))return t;const r=t[Hr];if(!r)return wg(t,(o,i)=>V2(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Cg(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,s=!1;r.type_===3&&(i=new Set(o),o.clear(),s=!0),wg(i,(a,l)=>V2(e,r,o,a,l,n,s)),Cg(e,o,!1),n&&e.patches_&&tl("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function V2(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&_r(5),Fc(o)){const a=i&&t&&t.type_!==3&&!ox(t.assigned_,r)?i.concat(r):void 0,l=Sg(e,o,a);if(bN(n,r,l),Fc(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(el(o)&&!qm(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Sg(e,o),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&Cg(e,o)}}function Cg(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Z1(t,n)}function rV(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:yN(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=J1;n&&(o=[r],i=Xd);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var J1={get(e,t){if(t===Hr)return e;const n=fa(e);if(!ox(n,t))return oV(e,n,t);const r=n[t];return e.finalized_||!el(r)?r:r===q0(e.base_,t)?(U0(e),e.copy_[t]=cx(r,e)):r},has(e,t){return t in fa(e)},ownKeys(e){return Reflect.ownKeys(fa(e))},set(e,t,n){const r=vN(fa(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=q0(fa(e),t),i=o==null?void 0:o[Hr];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(ZB(n,o)&&(n!==void 0||ox(e.base_,t)))return!0;U0(e),lx(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 q0(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,U0(e),lx(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=fa(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){_r(11)},getPrototypeOf(e){return jc(e.base_)},setPrototypeOf(){_r(12)}},Xd={};wg(J1,(e,t)=>{Xd[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Xd.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&_r(13),Xd.set.call(this,e,t,void 0)};Xd.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&_r(14),J1.set.call(this,e[0],t,n,e[0])};function q0(e,t){const n=e[Hr];return(n?fa(n):e)[t]}function oV(e,t,n){var o;const r=vN(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function vN(e,t){if(!(t in e))return;let n=jc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=jc(n)}}function lx(e){e.modified_||(e.modified_=!0,e.parent_&&lx(e.parent_))}function U0(e){e.copy_||(e.copy_=ix(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var iV=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&_r(6),r!==void 0&&typeof r!="function"&&_r(7);let o;if(el(t)){const i=z2(this),s=cx(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?sx(i):ax(i)}return $2(i,r),B2(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===gN&&(o=void 0),this.autoFreeze_&&Z1(o,!0),r){const i=[],s=[];tl("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else _r(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,o;return[this.produce(t,n,(s,a)=>{r=s,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){el(e)||_r(8),Fc(e)&&(e=sV(e));const t=z2(this),n=cx(e,void 0);return n[Hr].isManual_=!0,ax(t),n}finishDraft(e,t){const n=e&&e[Hr];(!n||!n.isManual_)&&_r(9);const{scope_:r}=n;return $2(r,t),B2(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=tl("Patches").applyPatches_;return Fc(e)?r(e,t):this.produce(e,o=>r(o,t))}};function cx(e,t){const n=Hm(e)?tl("MapSet").proxyMap_(e,t):Wm(e)?tl("MapSet").proxySet_(e,t):rV(e,t);return(t?t.scope_:yN()).drafts_.push(n),n}function sV(e){return Fc(e)||_r(10,e),xN(e)}function xN(e){if(!el(e)||qm(e))return e;const t=e[Hr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ix(e,t.scope_.immer_.useStrictShallowCopy_)}else n=ix(e,!0);return wg(n,(r,o)=>{bN(n,r,xN(o))}),t&&(t.finalized_=!1),n}var Wr=new iV,aV=Wr.produce;Wr.produceWithPatches.bind(Wr);Wr.setAutoFreeze.bind(Wr);Wr.setUseStrictShallowCopy.bind(Wr);Wr.applyPatches.bind(Wr);Wr.createDraft.bind(Wr);Wr.finishDraft.bind(Wr);const lV=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?aV(o):o;return t(a,i,...s)},e(r.setState,n,r)),wN=lV;var ux,Hh=un;if(process.env.NODE_ENV==="production")ux=Hh.createRoot,Hh.hydrateRoot;else{var H2=Hh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;ux=function(e,t){H2.usingClientEntryPoint=!0;try{return Hh.createRoot(e,t)}finally{H2.usingClientEntryPoint=!1}}}var SN={},CN={},eS={exports:{}},Ze=String,_N=function(){return{isColorSupported:!1,reset:Ze,bold:Ze,dim:Ze,italic:Ze,underline:Ze,inverse:Ze,hidden:Ze,strikethrough:Ze,black:Ze,red:Ze,green:Ze,yellow:Ze,blue:Ze,magenta:Ze,cyan:Ze,white:Ze,gray:Ze,bgBlack:Ze,bgRed:Ze,bgGreen:Ze,bgYellow:Ze,bgBlue:Ze,bgMagenta:Ze,bgCyan:Ze,bgWhite:Ze,blackBright:Ze,redBright:Ze,greenBright:Ze,yellowBright:Ze,blueBright:Ze,magentaBright:Ze,cyanBright:Ze,whiteBright:Ze,bgBlackBright:Ze,bgRedBright:Ze,bgGreenBright:Ze,bgYellowBright:Ze,bgBlueBright:Ze,bgMagentaBright:Ze,bgCyanBright:Ze,bgWhiteBright:Ze}};eS.exports=_N();eS.exports.createColors=_N;var cV=eS.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(cV);function r(l){return l&&l.__esModule?l:{default:l}}let o=new Set;function i(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&o.has(u)||(u&&o.add(u),console.warn(""),c.forEach(d=>console.warn(l,"-",d)))}function s(l){return n.default.dim(l)}const a={info(l,c){i(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){i(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){i(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(CN);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(CN);function n(i){return i&&i.__esModule?i:{default:i}}function r({version:i,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${i}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const o={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(SN);let G0=SN;var uV=(G0.__esModule?G0:{default:G0}).default;const _t=Vs(uV),tS=!1,nS=`import pandas as pd
34
34
  df = pd.DataFrame(data) # 'data' contains the query result
35
35
  result = df.to_dict('records') # must return 'result' as [dict] type
36
- `,EN=["_forecast"],_g="dm",dx=[{locale:"en-US",currency:"USD",currencyName:"US Dollar"},{locale:"en-GB",currency:"GBP",currencyName:"British Pound"},{locale:"en-CA",currency:"CAD",currencyName:"Canadian Dollar"},{locale:"en-AU",currency:"AUD",currencyName:"Australian Dollar"},{locale:"en-IN",currency:"INR",currencyName:"Indian Rupee"},{locale:"ja-JP",currency:"JPY",currencyName:"Japanese Yen"},{locale:"de-DE",currency:"EUR",currencyName:"Germany (Eurozone)"},{locale:"fr-FR",currency:"EUR",currencyName:"France (Eurozone)"},{locale:"es-ES",currency:"EUR",currencyName:"Spain (Eurozone)"},{locale:"it-IT",currency:"EUR",currencyName:"Italy (Eurozone)"},{locale:"fi-FI",currency:"EUR",currencyName:"Finland (Eurozone)"},{locale:"nl-NL",currency:"EUR",currencyName:"Netherlands (Eurozone)"},{locale:"zh-CN",currency:"CNY",currencyName:"Chinese Yuan"},{locale:"ru-RU",currency:"RUB",currencyName:"Russian Ruble"},{locale:"pt-BR",currency:"BRL",currencyName:"Brazilian Real"},{locale:"ko-KR",currency:"KRW",currencyName:"South Korean Won"},{locale:"ar-SA",currency:"SAR",currencyName:"Saudi Riyal"},{locale:"sv-SE",currency:"SEK",currencyName:"Swedish Krona"},{locale:"no-NO",currency:"NOK",currencyName:"Norwegian Krone"},{locale:"da-DK",currency:"DKK",currencyName:"Danish Krone"},{locale:"pl-PL",currency:"PLN",currencyName:"Polish Zloty"},{locale:"tr-TR",currency:"TRY",currencyName:"Turkish Lira"},{locale:"he-IL",currency:"ILS",currencyName:"Israeli Shekel"},{locale:"th-TH",currency:"THB",currencyName:"Thai Baht"},{locale:"vi-VN",currency:"VND",currencyName:"Vietnamese Dong"},{locale:"id-ID",currency:"IDR",currencyName:"Indonesian Rupiah"},{locale:"mx-MX",currency:"MXN",currencyName:"Mexican Peso"},{locale:"za-ZA",currency:"ZAR",currencyName:"South African Rand"},{locale:"sg-SG",currency:"SGD",currencyName:"Singapore Dollar"},{locale:"hk-HK",currency:"HKD",currencyName:"Hong Kong Dollar"},{locale:"ch-CH",currency:"CHF",currencyName:"Swiss Franc"},{locale:"my-MY",currency:"MYR",currencyName:"Malaysian Ringgit"},{locale:"ph-PH",currency:"PHP",currencyName:"Philippine Peso"},{locale:"eg-EG",currency:"EGP",currencyName:"Egyptian Pound"},{locale:"nz-NZ",currency:"NZD",currencyName:"New Zealand Dollar"}],dV=[{label:"English",locales:[{code:"en-US",name:"US English"},{code:"en-GB",name:"British English"},{code:"en-AU",name:"Australian English"},{code:"en-CA",name:"Canadian English"}]},{label:"French",locales:[{code:"fr-FR",name:"France French"},{code:"fr-CA",name:"Canadian French"}]},{label:"Spanish",locales:[{code:"es-ES",name:"Spain Spanish"},{code:"es-MX",name:"Mexican Spanish"},{code:"es-419",name:"Latin American Spanish"}]},{label:"German",locales:[{code:"de-DE",name:"Germany German"},{code:"de-CH",name:"Swiss German"}]},{label:"Chinese",locales:[{code:"zh-CN",name:"Simplified Chinese (China)"},{code:"zh-TW",name:"Traditional Chinese (Taiwan)"},{code:"zh-HK",name:"Hong Kong Chinese"}]},{label:"Japanese",locales:[{code:"ja-JP",name:"Japanese"}]},{label:"Arabic",locales:[{code:"ar-EG",name:"Egypt Arabic"},{code:"ar-SA",name:"Saudi Arabia Arabic"}]},{label:"Russian",locales:[{code:"ru-RU",name:"Russian"}]},{label:"Portuguese",locales:[{code:"pt-PT",name:"Portugal Portuguese"},{code:"pt-BR",name:"Brazil Portuguese"}]},{label:"Indian Languages",locales:[{code:"hi-IN",name:"Hindi (India)"},{code:"ta-IN",name:"Tamil (India)"}]},{label:"Korean",locales:[{code:"ko-KR",name:"Korean"}]},{label:"Italian",locales:[{code:"it-IT",name:"Italian (Italy)"}]},{label:"Dutch",locales:[{code:"nl-NL",name:"Dutch (Netherlands)"}]},{label:"Swedish",locales:[{code:"sv-SE",name:"Swedish (Sweden)"}]},{label:"Turkish",locales:[{code:"tr-TR",name:"Turkish (Turkey)"}]},{label:"Hebrew",locales:[{code:"he-IL",name:"Hebrew (Israel)"}]},{label:"Thai",locales:[{code:"th-TH",name:"Thai (Thailand)"}]},{label:"Polish",locales:[{code:"pl-PL",name:"Polish (Poland)"}]},{label:"Greek",locales:[{code:"el-GR",name:"Greek (Greece)"}]},{label:"Norwegian",locales:[{code:"no-NO",name:"Norwegian (Norway)"}]}],rS=["lg","md","sm","xs","xxs"],Eg={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[_t.teal[500],_t.teal[300],_t.gray[700],_t.gray[500],_t.gray[300]],borderColor:[_t.teal[500],_t.teal[300],_t.gray[700],_t.gray[500],_t.gray[300]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:fx},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:4,usePointStyle:!0,pointStyle:"rectRounded",boxPadding:4},legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:2,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{datalables:{color:fx},backgroundColor:[_t.teal[500],_t.teal[300],_t.gray[700],_t.gray[500],_t.gray[300]],borderColor:[_t.teal[500],_t.teal[300],_t.gray[700],_t.gray[500],_t.gray[300]]},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:_t.slate[800]}},y:{grid:{display:!0,color:_t.slate[800]}}}}}}};function fx(e){var r,o,i,s,a,l;const t=(a=(s=(i=(o=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:o._config)==null?void 0:i.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=Qd()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Qd()),Lc(n)}function Qd(){return re.getState().theme==="dark"?"#000000":"#FFFFFF"}function Lc(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return _t.gray[500];const d=u.replace("#",""),f=parseInt(d.substring(0,2),16),h=parseInt(d.substring(2,4),16),p=parseInt(d.substring(4,6),16);t+=f,n+=h,r+=p,o++};Array.isArray(e)?e.forEach(u=>{i(u)}):i(e);const s=t/o,a=n/o,l=r/o;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const fV=["text","nullable(string)","name","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],hV=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],pV=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],gV=["boolean"];function oS(e){return e.match(/[A-Z]/)?`"${e}"`:e}function Um(e){return fV.includes(e.toLowerCase())||/varchar/i.test(e)}function qf(e){return hV.includes(e.toLowerCase())||/int|decimal|float|double/i.test(e)}function wl(e){return pV.includes(e.toLowerCase())||/date|time|timestamp/i.test(e)}function iS(e){return gV.includes(e.toLowerCase())||/boolean/i.test(e)}function mV(e,t,n,r,o,i){const{measures:s,dimensions:a}=e,l=s==null?void 0:s.map(f=>`${f.calc}(${f.name}) as ${f.calc}_${f.name.replace(/"/g,"")}`).join(", "),c=(a==null?void 0:a.join(", "))||"";let u="";const d=r?`${_g}.${r}`:aS({schemaName:t,tableName:n,connectionType:o,databaseName:i});if(l&&c)return u=`SELECT ${c}, COUNT(*) as count, ${l} FROM ${d} GROUP BY ${c} ORDER BY ${c} DESC LIMIT 100`,u;if(!l&&c)return u=`SELECT ${c}, COUNT(*) as count FROM ${d} GROUP BY ${c} ORDER BY ${c} DESC LIMIT 100`,u;if(l&&!c)return u=`SELECT ${l} FROM ${d} LIMIT 100`,u}function bV(e,t,n="AVG"){var i,s,a,l;let r={};const o=oS(e.column_name);return Um(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),qf(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===o&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===o&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function cc(e){return Um(e.dataType)?"string":qf(e.dataType)?"number":wl(e.dataType)?"date":iS(e.dataType)?"boolean":"string"}function yV(e){let t;const n=e.data_type.toLowerCase();return Um(n)?t="T":qf(n)?t="#":wl(n)?t="D":iS(n)?t="B":t="?",t}function vV(e,t){const{dimensions:n,measures:r}=t,o=n==null?void 0:n.includes(e.column_name),i=r==null?void 0:r.some(s=>s.name===e.column_name);return o||i}function RN(e){return e?e!=null&&e.startsWith(`${_g}.`)?e:`${_g}.${e}`:""}function sS({schemaName:e,tableName:t,modelName:n,connectionType:r,databaseName:o}){let i=aS({schemaName:e,tableName:t,connectionType:r,databaseName:o});n&&(i=RN(n));let s=i;return(l=>/[A-Z]/.test(l))(t)&&(s=s.split(".").map(c=>`"${c}"`).join(".")),s}function aS({schemaName:e,tableName:t,connectionType:n,databaseName:r}){return t==="api"||e===oS("NA")||n==="S3"||n==="API"?t:n==="S3Tables"?`${r}.${e}.${t}`:e?`${e}.${t}`:`${t}`}const xV=e=>{const t=new Date(e);return!isNaN(t.getTime())},wV=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),Gm=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?xV(e)?t="date":wV(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function SV({get:e,dataPoint:t,card:n}){var f;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValues:i,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,d={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(f=n.preferences)==null?void 0:f.filterOnClickField,valueType:Gm(u),operation:"=",values:[u]};if(l!=null&&l.find(h=>h.id===n.id)){const h=n.id;if(u==null){a(n),i(h);return}else s(d)}o(n),r(d)}function W2({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10},l=t?{...t}:{};return rS.forEach(c=>{l[c]||(l[c]=[]);const u=l[c].reduce((d,f)=>Math.max(d,f.y+f.h),0);a.y=a.y===1/0?u:a.y,l[c].push({...a})}),l}function q2(e,t){if(!t)return;const n={...t};return rS.forEach(r=>{n[r]&&(n[r]=n[r].filter(o=>o.i!==e))}),n}function kN(e){const t=re.getState().dashboard.globalCacheConfig,{card:n,filter:r}=e;return t}const re=Q1()(wN((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:Eg},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setInitStore:()=>{e(n=>{n.isSessionExpired=!1,n.currentBreakpoint="lg",n.dashboard={id:"",style:Eg},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!0,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},setHandleOpenAssistantProfile:n=>{e(r=>{r.handleOpenAssistantProfile=n})},setFilterMode:(n,r)=>{const o=r==="exclude"?"not in":"in";e(i=>{var a,l,c;const s=(a=i.dashboard.filters)==null?void 0:a.find(u=>u.id===n);s&&(s.operation=o,i.dashboard.filters=(l=i.dashboard.filters)==null?void 0:l.map(u=>u.id===n?s:u),i.filterValues&&i.filterValues.length>0&&(i.filterValues=(c=i.filterValues)==null?void 0:c.map(u=>u.filterId===n?{...u,operation:o}:u)))})},updateEmailSettings:n=>{e(r=>{r.dashboard.emailSettings=n})},setDefaultFilterValues:n=>{e(r=>{r.dashboard.defaultFilterValues=n})},setIsDownloadingPdf:n=>{e(r=>{r.isDownloadingPdf=n})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,s,a,l,c,u,d,f;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(h=>h.id===n);if(o!==void 0&&o>-1){(s=r.dashboard.sheets)==null||s.splice(o,1);const h=(a=r.dashboard.filters)==null?void 0:a.filter(m=>m.sheetId===n),p=(l=r.filterValues)==null?void 0:l.filter(m=>h==null?void 0:h.some(b=>b.id===m.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(m=>!(p!=null&&p.some(b=>b.filterId===m.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(m=>m.sheetId!==n),r.selectedSheetId=(f=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:f.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{rS.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const s={...n,layouts:i};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},addToAIScope:n=>{e(r=>{const{connectionId:o,connectionType:i,databaseName:s,schemaName:a,tableName:l,datamodelName:c,datamodelId:u}=n,d={connectionId:o||"",connectionType:i||"",databaseName:s||"",schemaName:a||"",tableName:l||"",datamodelName:c||"",datamodelId:u||""};let h=[...r.dashboard.aiScopeTables||[],d];h=h.filter((p,m,b)=>b.findIndex(y=>y.tableName===p.tableName&&y.datamodelName===p.datamodelName)===m),r.dashboard.aiScopeTables=h})},removeFromAIScope:n=>{e(r=>{const{connectionId:o,tableName:i,datamodelName:s}=n,a=r.dashboard.aiScopeTables||[];if(s){const l=a.filter(c=>!(c.datamodelName===s&&c.connectionId===o));r.dashboard.aiScopeTables=l}else if(i){const l=a.filter(c=>!(c.tableName===i&&c.connectionId===o));r.dashboard.aiScopeTables=l}})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===o.selectedSheetId);i&&((l=i==null?void 0:i.frames)==null||l.forEach(c=>{var d;const u=(d=c.cards)==null?void 0:d.find(f=>f.id===n);u&&(u.python=r)}))})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setDashboardWithFilterValues:(n,r)=>{e(o=>{o.dashboard=n,o.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l,c;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&((c=s==null?void 0:s.frames)==null||c.forEach(u=>{var f;const d=(f=u.cards)==null?void 0:f.find(h=>h.id===r);d&&(d.title=o)}))})},setCardInfo:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===o.selectedSheetId);i&&((l=i==null?void 0:i.frames)==null||l.forEach(c=>{var d;const u=(d=c.cards)==null?void 0:d.find(f=>f.id===n);u&&(u.info=r)}))})},setCardDescription:(n,r,o)=>{e(i=>{var a,l,c;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&((c=s==null?void 0:s.frames)==null||c.forEach(u=>{var f;const d=(f=u.cards)==null?void 0:f.find(h=>h.id===r);d&&(d.description=o)}))})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){const d=(c=s.cards)==null?void 0:c.find(f=>f.id===r);d&&(d.sql=o,(u=i.onUpdateCard)==null||u.call(i,d,n))}})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l,c;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(u=>u.filterId===o.filterId);if(o.values.length===0){r.filterValues=(a=r.filterValues)==null?void 0:a.filter(u=>u.filterId!==o.filterId);return}i!==void 0&&i>-1?(l=r.filterValues)==null||l.splice(i,1,o):(c=r.filterValues)==null||c.push(o)}):r.filterValues=n})},removeFilterValues:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const o=r.dashboard.sheets;o==null||o.forEach(a=>{W2({id:n.id,layouts:a.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1),(s=r.dashboard.sheets)==null||s.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{const u=q2(n,c.layouts);c.layouts=u})}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,d,f;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(h=>h.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(h=>h.id===r);if(a){const h=(d=a.cards)==null?void 0:d.findIndex(p=>p.id===o.id);h>-1&&((f=a.cards)==null||f.splice(h,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},updateFilterId:(n,r)=>{e(o=>{var a,l;const i=(a=o.dashboard.filters)==null?void 0:a.find(c=>c.id===n),s=(l=o.dashboard.filters)==null?void 0:l.some(c=>c.id===r);i&&!s&&(i.id=r)})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let d=1/0;const f=0;o==="start"&&(d=0);const h=W2({id:r.id,layouts:s.layouts,minH:10,x:f,y:d});s.layouts=h,(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(d=>d.id===n);if(i){const d=(l=i.frames)==null?void 0:l.findIndex(f=>f.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=i.frames)==null||c.splice(d,1),(u=i.layout)==null||u.splice(d,1),q2(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r)),(d=o.onAcceptChanges)==null||d.call(o,r,o.dashboard)})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(d=o.onUpdateCard)==null||d.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,d,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(d=i.layout)==null||d.splice(s,1),(f=o.onRemoveCard)==null||f.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnAcceptChanges:n=>{e(()=>({onAcceptChanges:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getCardFrame:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{SV({card:n,dataPoint:r,get:t})}}}))),an=()=>re(e=>e.actions);async function CV(e,t){const n=t.slice(0,16),r=new TextEncoder,o=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),i=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},o,{name:"AES-GCM",length:256},!1,["encrypt"]),s=window.crypto.getRandomValues(new Uint8Array(12)),a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},i,r.encode(e)),l=new Uint8Array(s.length+a.byteLength);return l.set(s,0),l.set(new Uint8Array(a),s.length),{payload:btoa(String.fromCharCode(...l))}}async function PN(e,t){const n=t.slice(0,16),r=new TextEncoder,o=new TextDecoder,i=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),s=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["decrypt"]),a=Uint8Array.from(atob(e),f=>f.charCodeAt(0)),l=a.slice(0,12),c=a.slice(a.length-16),u=a.slice(12,a.length-16),d=new Uint8Array(u.length+c.length);d.set(u),d.set(c,u.length);try{const f=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:l},s,d);return{decryptedData:o.decode(f)}}catch(f){throw new Error(`Decryption failed: ${f}`)}}function se(...e){return OB(Ja(e))}const _V=e=>Object.keys(e).length===0;async function xs(e,t,n={}){try{const r=new URLSearchParams(n).toString(),o=`${e}?${r}`,i=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!i.ok){const a=await i.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)}return await i.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function DN(e,t,n={}){try{const r=JSON.stringify(n),o=await CV(r,t),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(o)});if(!i.ok)return i.json().then(a=>{throw console.log(a.detail||"Unknown error occurred"),new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)});const s=await i.json();if(s.payload){const a=await PN(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}async function MN(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(i=>{throw console.log(i.detail||"Unknown error occurred"),new Error((i==null?void 0:i.error)||`HTTP error! status: ${r.status}`)})}catch(r){throw console.error("Error during fetch:",r),r}}function EV(e){if(!e)return{tenantId:"",endUserId:""};const t=Bm(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function RV(e){return e?Bm(e).assistantProfileId:void 0}function kV(e){if(!e)return;const t=Bm(e);if(t.params&&t.params.currencyFormat)return t.params.currencyFormat}function AN(e){return e?Bm(e).params:void 0}function lS(e){return e.charAt(0).toUpperCase()+e.slice(1)}function PV(e){return e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substring(1).toLowerCase())}function DV(e){return e.replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())}const mr="focus:ring-1 focus:ring-offset-0 focus-visible:ring-1 focus-visible:ring-offset-0",Vi="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 focus:ring-0 focus:ring-ring focus:ring-offset-0";async function MV(){var o,i;const e=(i=(o=re.getState())==null?void 0:o.authToken)==null?void 0:i.accessToken;if(!e)return;const n=await fetch("https://semaphor.cloud/api/v1/invalidate-token",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error("Failed to invalidate token");const r=await n.json();return console.log("invalidateToken",r),r}async function AV(e,t={}){if(!e)return null;let n="https://semaphor.cloud/api/v1/dashboard";const r=Object.fromEntries(Object.entries(t).filter(([a,l])=>l!==void 0)),o=new URLSearchParams(r).toString();o&&(n+=`?${o}`);let s=await(await fetch(n,{headers:{Authorization:`Bearer ${e}`}})).json();if("payload"in s){const a=await PN(atob(s.payload),e);s=JSON.parse(a.decryptedData)}return s}async function NV(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}const IV=e=>/boolean/i.test(e)?"boolean":/date|timestamp/i.test(e)?"date":/int|decimal|float|double|num/i.test(e)?"number":/json/i.test(e)?"json":/geo|geography|geometry/i.test(e)?"geo":"string";var Rg={exports:{}};Rg.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",f="[object Error]",h="[object Function]",p="[object GeneratorFunction]",m="[object Map]",b="[object Number]",y="[object Null]",v="[object Object]",x="[object Proxy]",E="[object RegExp]",C="[object Set]",w="[object String]",_="[object Undefined]",k="[object WeakMap]",M="[object ArrayBuffer]",P="[object DataView]",A="[object Float32Array]",T="[object Float64Array]",F="[object Int8Array]",L="[object Int16Array]",I="[object Int32Array]",O="[object Uint8Array]",j="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",N=/[\\^$.*+?()[\]{}|]/g,q=/^\[object .+?Constructor\]$/,$=/^(?:0|[1-9]\d*)$/,D={};D[A]=D[T]=D[F]=D[L]=D[I]=D[O]=D[j]=D[z]=D[B]=!0,D[a]=D[l]=D[M]=D[u]=D[P]=D[d]=D[f]=D[h]=D[m]=D[b]=D[v]=D[E]=D[C]=D[w]=D[k]=!1;var V=typeof ji=="object"&&ji&&ji.Object===Object&&ji,G=typeof self=="object"&&self&&self.Object===Object&&self,U=V||G||Function("return this")(),W=t&&!t.nodeType&&t,Y=W&&!0&&e&&!e.nodeType&&e,X=Y&&Y.exports===W,J=X&&V.process,te=function(){try{var H=Y&&Y.require&&Y.require("util").types;return H||J&&J.binding&&J.binding("util")}catch{}}(),Q=te&&te.isTypedArray;function ie(H,Z,oe){switch(oe.length){case 0:return H.call(Z);case 1:return H.call(Z,oe[0]);case 2:return H.call(Z,oe[0],oe[1]);case 3:return H.call(Z,oe[0],oe[1],oe[2])}return H.apply(Z,oe)}function ee(H,Z){for(var oe=-1,Re=Array(H);++oe<H;)Re[oe]=Z(oe);return Re}function ce(H){return function(Z){return H(Z)}}function fe(H,Z){return H==null?void 0:H[Z]}function _e(H,Z){return function(oe){return H(Z(oe))}}var be=Array.prototype,ye=Function.prototype,de=Object.prototype,xe=U["__core-js_shared__"],Ae=ye.toString,Ee=de.hasOwnProperty,cn=function(){var H=/[^.]+$/.exec(xe&&xe.keys&&xe.keys.IE_PROTO||"");return H?"Symbol(src)_1."+H:""}(),kt=de.toString,ne=Ae.call(Object),le=RegExp("^"+Ae.call(Ee).replace(N,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ce=X?U.Buffer:void 0,Pe=U.Symbol,He=U.Uint8Array;Ce&&Ce.allocUnsafe;var Dt=_e(Object.getPrototypeOf,Object),En=Object.create,fn=de.propertyIsEnumerable,ge=be.splice,hn=Pe?Pe.toStringTag:void 0,Mt=function(){try{var H=A0(Object,"defineProperty");return H({},"",{}),H}catch{}}(),Yr=Ce?Ce.isBuffer:void 0,Tn=Math.max,Nl=Date.now,Js=A0(U,"Map"),vi=A0(Object,"create"),en=function(){function H(){}return function(Z){if(!na(Z))return{};if(En)return En(Z);H.prototype=Z;var oe=new H;return H.prototype=void 0,oe}}();function wt(H){var Z=-1,oe=H==null?0:H.length;for(this.clear();++Z<oe;){var Re=H[Z];this.set(Re[0],Re[1])}}function On(){this.__data__=vi?vi(null):{},this.size=0}function Me(H){var Z=this.has(H)&&delete this.__data__[H];return this.size-=Z?1:0,Z}function We(H){var Z=this.__data__;if(vi){var oe=Z[H];return oe===r?void 0:oe}return Ee.call(Z,H)?Z[H]:void 0}function tt(H){var Z=this.__data__;return vi?Z[H]!==void 0:Ee.call(Z,H)}function Gt(H,Z){var oe=this.__data__;return this.size+=this.has(H)?0:1,oe[H]=vi&&Z===void 0?r:Z,this}wt.prototype.clear=On,wt.prototype.delete=Me,wt.prototype.get=We,wt.prototype.has=tt,wt.prototype.set=Gt;function At(H){var Z=-1,oe=H==null?0:H.length;for(this.clear();++Z<oe;){var Re=H[Z];this.set(Re[0],Re[1])}}function Nt(){this.__data__=[],this.size=0}function Dn(H){var Z=this.__data__,oe=Fh(Z,H);if(oe<0)return!1;var Re=Z.length-1;return oe==Re?Z.pop():ge.call(Z,oe,1),--this.size,!0}function Yt(H){var Z=this.__data__,oe=Fh(Z,H);return oe<0?void 0:Z[oe][1]}function pn(H){return Fh(this.__data__,H)>-1}function ea(H,Z){var oe=this.__data__,Re=Fh(oe,H);return Re<0?(++this.size,oe.push([H,Z])):oe[Re][1]=Z,this}At.prototype.clear=Nt,At.prototype.delete=Dn,At.prototype.get=Yt,At.prototype.has=pn,At.prototype.set=ea;function Kr(H){var Z=-1,oe=H==null?0:H.length;for(this.clear();++Z<oe;){var Re=H[Z];this.set(Re[0],Re[1])}}function Lo(){this.size=0,this.__data__={hash:new wt,map:new(Js||At),string:new wt}}function ta(H){var Z=$h(this,H).delete(H);return this.size-=Z?1:0,Z}function Fu(H){return $h(this,H).get(H)}function gz(H){return $h(this,H).has(H)}function mz(H,Z){var oe=$h(this,H),Re=oe.size;return oe.set(H,Z),this.size+=oe.size==Re?0:1,this}Kr.prototype.clear=Lo,Kr.prototype.delete=ta,Kr.prototype.get=Fu,Kr.prototype.has=gz,Kr.prototype.set=mz;function Il(H){var Z=this.__data__=new At(H);this.size=Z.size}function bz(){this.__data__=new At,this.size=0}function yz(H){var Z=this.__data__,oe=Z.delete(H);return this.size=Z.size,oe}function vz(H){return this.__data__.get(H)}function xz(H){return this.__data__.has(H)}function wz(H,Z){var oe=this.__data__;if(oe instanceof At){var Re=oe.__data__;if(!Js||Re.length<n-1)return Re.push([H,Z]),this.size=++oe.size,this;oe=this.__data__=new Kr(Re)}return oe.set(H,Z),this.size=oe.size,this}Il.prototype.clear=bz,Il.prototype.delete=yz,Il.prototype.get=vz,Il.prototype.has=xz,Il.prototype.set=wz;function Sz(H,Z){var oe=T0(H),Re=!oe&&I0(H),ht=!oe&&!Re&&x2(H),Ot=!oe&&!Re&&!ht&&S2(H),Kt=oe||Re||ht||Ot,yt=Kt?ee(H.length,String):[],Xt=yt.length;for(var ho in H)Kt&&(ho=="length"||ht&&(ho=="offset"||ho=="parent")||Ot&&(ho=="buffer"||ho=="byteLength"||ho=="byteOffset")||y2(ho,Xt))||yt.push(ho);return yt}function D0(H,Z,oe){(oe!==void 0&&!zh(H[Z],oe)||oe===void 0&&!(Z in H))&&M0(H,Z,oe)}function Cz(H,Z,oe){var Re=H[Z];(!(Ee.call(H,Z)&&zh(Re,oe))||oe===void 0&&!(Z in H))&&M0(H,Z,oe)}function Fh(H,Z){for(var oe=H.length;oe--;)if(zh(H[oe][0],Z))return oe;return-1}function M0(H,Z,oe){Z=="__proto__"&&Mt?Mt(H,Z,{configurable:!0,enumerable:!0,value:oe,writable:!0}):H[Z]=oe}var _z=Fz();function Lh(H){return H==null?H===void 0?_:y:hn&&hn in Object(H)?Lz(H):Wz(H)}function m2(H){return Lu(H)&&Lh(H)==a}function Ez(H){if(!na(H)||Vz(H))return!1;var Z=j0(H)?le:q;return Z.test(Yz(H))}function Rz(H){return Lu(H)&&w2(H.length)&&!!D[Lh(H)]}function kz(H){if(!na(H))return Hz(H);var Z=v2(H),oe=[];for(var Re in H)Re=="constructor"&&(Z||!Ee.call(H,Re))||oe.push(Re);return oe}function b2(H,Z,oe,Re,ht){H!==Z&&_z(Z,function(Ot,Kt){if(ht||(ht=new Il),na(Ot))Pz(H,Z,Kt,oe,b2,Re,ht);else{var yt=Re?Re(N0(H,Kt),Ot,Kt+"",H,Z,ht):void 0;yt===void 0&&(yt=Ot),D0(H,Kt,yt)}},C2)}function Pz(H,Z,oe,Re,ht,Ot,Kt){var yt=N0(H,oe),Xt=N0(Z,oe),ho=Kt.get(Xt);if(ho){D0(H,oe,ho);return}var Nr=Ot?Ot(yt,Xt,oe+"",H,Z,Kt):void 0,$u=Nr===void 0;if($u){var F0=T0(Xt),L0=!F0&&x2(Xt),E2=!F0&&!L0&&S2(Xt);Nr=Xt,F0||L0||E2?T0(yt)?Nr=yt:Kz(yt)?Nr=Tz(yt):L0?($u=!1,Nr=Az(Xt)):E2?($u=!1,Nr=Iz(Xt)):Nr=[]:Xz(Xt)||I0(Xt)?(Nr=yt,I0(yt)?Nr=Qz(yt):(!na(yt)||j0(yt))&&(Nr=$z(Xt))):$u=!1}$u&&(Kt.set(Xt,Nr),ht(Nr,Xt,Re,Ot,Kt),Kt.delete(Xt)),D0(H,oe,Nr)}function Dz(H,Z){return Uz(qz(H,Z,_2),H+"")}var Mz=Mt?function(H,Z){return Mt(H,"toString",{configurable:!0,enumerable:!1,value:Jz(Z),writable:!0})}:_2;function Az(H,Z){return H.slice()}function Nz(H){var Z=new H.constructor(H.byteLength);return new He(Z).set(new He(H)),Z}function Iz(H,Z){var oe=Nz(H.buffer);return new H.constructor(oe,H.byteOffset,H.length)}function Tz(H,Z){var oe=-1,Re=H.length;for(Z||(Z=Array(Re));++oe<Re;)Z[oe]=H[oe];return Z}function Oz(H,Z,oe,Re){var ht=!oe;oe||(oe={});for(var Ot=-1,Kt=Z.length;++Ot<Kt;){var yt=Z[Ot],Xt=void 0;Xt===void 0&&(Xt=H[yt]),ht?M0(oe,yt,Xt):Cz(oe,yt,Xt)}return oe}function jz(H){return Dz(function(Z,oe){var Re=-1,ht=oe.length,Ot=ht>1?oe[ht-1]:void 0,Kt=ht>2?oe[2]:void 0;for(Ot=H.length>3&&typeof Ot=="function"?(ht--,Ot):void 0,Kt&&zz(oe[0],oe[1],Kt)&&(Ot=ht<3?void 0:Ot,ht=1),Z=Object(Z);++Re<ht;){var yt=oe[Re];yt&&H(Z,yt,Re,Ot)}return Z})}function Fz(H){return function(Z,oe,Re){for(var ht=-1,Ot=Object(Z),Kt=Re(Z),yt=Kt.length;yt--;){var Xt=Kt[++ht];if(oe(Ot[Xt],Xt,Ot)===!1)break}return Z}}function $h(H,Z){var oe=H.__data__;return Bz(Z)?oe[typeof Z=="string"?"string":"hash"]:oe.map}function A0(H,Z){var oe=fe(H,Z);return Ez(oe)?oe:void 0}function Lz(H){var Z=Ee.call(H,hn),oe=H[hn];try{H[hn]=void 0;var Re=!0}catch{}var ht=kt.call(H);return Re&&(Z?H[hn]=oe:delete H[hn]),ht}function $z(H){return typeof H.constructor=="function"&&!v2(H)?en(Dt(H)):{}}function y2(H,Z){var oe=typeof H;return Z=Z??s,!!Z&&(oe=="number"||oe!="symbol"&&$.test(H))&&H>-1&&H%1==0&&H<Z}function zz(H,Z,oe){if(!na(oe))return!1;var Re=typeof Z;return(Re=="number"?O0(oe)&&y2(Z,oe.length):Re=="string"&&Z in oe)?zh(oe[Z],H):!1}function Bz(H){var Z=typeof H;return Z=="string"||Z=="number"||Z=="symbol"||Z=="boolean"?H!=="__proto__":H===null}function Vz(H){return!!cn&&cn in H}function v2(H){var Z=H&&H.constructor,oe=typeof Z=="function"&&Z.prototype||de;return H===oe}function Hz(H){var Z=[];if(H!=null)for(var oe in Object(H))Z.push(oe);return Z}function Wz(H){return kt.call(H)}function qz(H,Z,oe){return Z=Tn(Z===void 0?H.length-1:Z,0),function(){for(var Re=arguments,ht=-1,Ot=Tn(Re.length-Z,0),Kt=Array(Ot);++ht<Ot;)Kt[ht]=Re[Z+ht];ht=-1;for(var yt=Array(Z+1);++ht<Z;)yt[ht]=Re[ht];return yt[Z]=oe(Kt),ie(H,this,yt)}}function N0(H,Z){if(!(Z==="constructor"&&typeof H[Z]=="function")&&Z!="__proto__")return H[Z]}var Uz=Gz(Mz);function Gz(H){var Z=0,oe=0;return function(){var Re=Nl(),ht=i-(Re-oe);if(oe=Re,ht>0){if(++Z>=o)return arguments[0]}else Z=0;return H.apply(void 0,arguments)}}function Yz(H){if(H!=null){try{return Ae.call(H)}catch{}try{return H+""}catch{}}return""}function zh(H,Z){return H===Z||H!==H&&Z!==Z}var I0=m2(function(){return arguments}())?m2:function(H){return Lu(H)&&Ee.call(H,"callee")&&!fn.call(H,"callee")},T0=Array.isArray;function O0(H){return H!=null&&w2(H.length)&&!j0(H)}function Kz(H){return Lu(H)&&O0(H)}var x2=Yr||eB;function j0(H){if(!na(H))return!1;var Z=Lh(H);return Z==h||Z==p||Z==c||Z==x}function w2(H){return typeof H=="number"&&H>-1&&H%1==0&&H<=s}function na(H){var Z=typeof H;return H!=null&&(Z=="object"||Z=="function")}function Lu(H){return H!=null&&typeof H=="object"}function Xz(H){if(!Lu(H)||Lh(H)!=v)return!1;var Z=Dt(H);if(Z===null)return!0;var oe=Ee.call(Z,"constructor")&&Z.constructor;return typeof oe=="function"&&oe instanceof oe&&Ae.call(oe)==ne}var S2=Q?ce(Q):Rz;function Qz(H){return Oz(H,C2(H))}function C2(H){return O0(H)?Sz(H):kz(H)}var Zz=jz(function(H,Z,oe){b2(H,Z,oe)});function Jz(H){return function(){return H}}function _2(H){return H}function eB(){return!1}e.exports=Zz})(Rg,Rg.exports);var TV=Rg.exports;const Zd=Vs(TV),OV={theme:"system",setTheme:()=>null},NN=R.createContext(OV);function jV({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=R.useState(()=>localStorage.getItem(n)||t);R.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return g.jsx(NN.Provider,{...r,value:s,children:e})}const IN=()=>{const e=R.useContext(NN);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var cu=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(){}},nl=typeof window>"u"||"Deno"in globalThis;function Zr(){}function FV(e,t){return typeof e=="function"?e(t):e}function hx(e){return typeof e=="number"&&e>=0&&e!==1/0}function TN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function uc(e,t){return typeof e=="function"?e(t):e}function vo(e,t){return typeof e=="function"?e(t):e}function U2(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==cS(s,t.options))return!1}else if(!ef(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function G2(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Jd(t.options.mutationKey)!==Jd(i))return!1}else if(!ef(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function cS(e,t){return((t==null?void 0:t.queryKeyHashFn)||Jd)(e)}function Jd(e){return JSON.stringify(e,(t,n)=>gx(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function ef(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!ef(e[n],t[n])):!1}function kg(e,t){if(e===t)return e;const n=Y2(e)&&Y2(t);if(n||gx(e)&&gx(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=kg(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function px(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Y2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function gx(e){if(!K2(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!K2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function K2(e){return Object.prototype.toString.call(e)==="[object Object]"}function LV(e){return new Promise(t=>{setTimeout(t,e)})}function mx(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return kg(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return kg(e,t)}return t}function $V(e){return e}function zV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function BV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Pg=Symbol();function ON(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Pg&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Pg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Ma,hs,Cc,JA,VV=(JA=class extends cu{constructor(){super();je(this,Ma);je(this,hs);je(this,Cc);we(this,Cc,t=>{if(!nl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){K(this,hs)||this.setEventListener(K(this,Cc))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,hs))==null||t.call(this),we(this,hs,void 0))}setEventListener(t){var n;we(this,Cc,t),(n=K(this,hs))==null||n.call(this),we(this,hs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){K(this,Ma)!==t&&(we(this,Ma,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof K(this,Ma)=="boolean"?K(this,Ma):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ma=new WeakMap,hs=new WeakMap,Cc=new WeakMap,JA),uS=new VV,_c,ps,Ec,eN,HV=(eN=class extends cu{constructor(){super();je(this,_c,!0);je(this,ps);je(this,Ec);we(this,Ec,t=>{if(!nl&&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(){K(this,ps)||this.setEventListener(K(this,Ec))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,ps))==null||t.call(this),we(this,ps,void 0))}setEventListener(t){var n;we(this,Ec,t),(n=K(this,ps))==null||n.call(this),we(this,ps,t(this.setOnline.bind(this)))}setOnline(t){K(this,_c)!==t&&(we(this,_c,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return K(this,_c)}},_c=new WeakMap,ps=new WeakMap,Ec=new WeakMap,eN),Dg=new HV;function bx(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function WV(e){return Math.min(1e3*2**e,3e4)}function jN(e){return(e??"online")==="online"?Dg.isOnline():!0}var FN=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Y0(e){return e instanceof FN}function LN(e){let t=!1,n=0,r=!1,o;const i=bx(),s=m=>{var b;r||(f(new FN(m)),(b=e.abort)==null||b.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>uS.isFocused()&&(e.networkMode==="always"||Dg.isOnline())&&e.canRun(),u=()=>jN(e.networkMode)&&e.canRun(),d=m=>{var b;r||(r=!0,(b=e.onSuccess)==null||b.call(e,m),o==null||o(),i.resolve(m))},f=m=>{var b;r||(r=!0,(b=e.onError)==null||b.call(e,m),o==null||o(),i.reject(m))},h=()=>new Promise(m=>{var b;o=y=>{(r||c())&&m(y)},(b=e.onPause)==null||b.call(e)}).then(()=>{var m;o=void 0,r||(m=e.onContinue)==null||m.call(e)}),p=()=>{if(r)return;let m;const b=n===0?e.initialPromise:void 0;try{m=b??e.fn()}catch(y){m=Promise.reject(y)}Promise.resolve(m).then(d).catch(y=>{var w;if(r)return;const v=e.retry??(nl?0:3),x=e.retryDelay??WV,E=typeof x=="function"?x(n,y):x,C=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,y);if(t||!C){f(y);return}n++,(w=e.onFail)==null||w.call(e,n,y),LV(E).then(()=>c()?void 0:h()).then(()=>{t?f(y):p()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?p():h().then(p),i)}}function qV(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var An=qV(),Aa,tN,$N=(tN=class{constructor(){je(this,Aa)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),hx(this.gcTime)&&we(this,Aa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(nl?1/0:5*60*1e3))}clearGcTimeout(){K(this,Aa)&&(clearTimeout(K(this,Aa)),we(this,Aa,void 0))}},Aa=new WeakMap,tN),Rc,kc,Qr,Na,Wn,Bf,Ia,bo,Ei,nN,UV=(nN=class extends $N{constructor(t){super();je(this,bo);je(this,Rc);je(this,kc);je(this,Qr);je(this,Na);je(this,Wn);je(this,Bf);je(this,Ia);we(this,Ia,!1),we(this,Bf,t.defaultOptions),this.setOptions(t.options),this.observers=[],we(this,Na,t.client),we(this,Qr,K(this,Na).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,we(this,Rc,GV(this.options)),this.state=t.state??K(this,Rc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=K(this,Wn))==null?void 0:t.promise}setOptions(t){this.options={...K(this,Bf),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&K(this,Qr).remove(this)}setData(t,n){const r=mx(this.state.data,t,this.options);return ut(this,bo,Ei).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ut(this,bo,Ei).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=K(this,Wn))==null?void 0:r.promise;return(o=K(this,Wn))==null||o.cancel(t),n?n.then(Zr).catch(Zr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(K(this,Rc))}isActive(){return this.observers.some(t=>vo(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Pg||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!TN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,Wn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,Wn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),K(this,Qr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(K(this,Wn)&&(K(this,Ia)?K(this,Wn).cancel({revert:!0}):K(this,Wn).cancelRetry()),this.scheduleGc()),K(this,Qr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ut(this,bo,Ei).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(K(this,Wn))return K(this,Wn).continueRetry(),K(this,Wn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(we(this,Ia,!0),r.signal)})},i=()=>{const d=ON(this.options,n),f={client:K(this,Na),queryKey:this.queryKey,meta:this.meta};return o(f),we(this,Ia,!1),this.options.persister?this.options.persister(d,f,this):d(f)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:K(this,Na),state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),we(this,kc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&ut(this,bo,Ei).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var f,h,p,m;Y0(d)&&d.silent||ut(this,bo,Ei).call(this,{type:"error",error:d}),Y0(d)||((h=(f=K(this,Qr).config).onError)==null||h.call(f,d,this),(m=(p=K(this,Qr).config).onSettled)==null||m.call(p,this.state.data,d,this)),this.scheduleGc()};return we(this,Wn,LN({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var f,h,p,m;if(d===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(b){a(b);return}(h=(f=K(this,Qr).config).onSuccess)==null||h.call(f,d,this),(m=(p=K(this,Qr).config).onSettled)==null||m.call(p,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,f)=>{ut(this,bo,Ei).call(this,{type:"failed",failureCount:d,error:f})},onPause:()=>{ut(this,bo,Ei).call(this,{type:"pause"})},onContinue:()=>{ut(this,bo,Ei).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),K(this,Wn).start()}},Rc=new WeakMap,kc=new WeakMap,Qr=new WeakMap,Na=new WeakMap,Wn=new WeakMap,Bf=new WeakMap,Ia=new WeakMap,bo=new WeakSet,Ei=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,...zN(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Y0(o)&&o.revert&&K(this,kc)?{...K(this,kc),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),An.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),K(this,Qr).notify({query:this,type:"updated",action:t})})},nN);function zN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function GV(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Vo,rN,BN=(rN=class extends cu{constructor(t={}){super();je(this,Vo);this.config=t,we(this,Vo,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??cS(o,n);let s=this.get(i);return s||(s=new UV({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){K(this,Vo).has(t.queryHash)||(K(this,Vo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=K(this,Vo).get(t.queryHash);n&&(t.destroy(),n===t&&K(this,Vo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){An.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return K(this,Vo).get(t)}getAll(){return[...K(this,Vo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>U2(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>U2(t,r)):n}notify(t){An.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){An.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){An.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Vo=new WeakMap,rN),Ho,rr,Ta,Wo,cs,oN,YV=(oN=class extends $N{constructor(t){super();je(this,Wo);je(this,Ho);je(this,rr);je(this,Ta);this.mutationId=t.mutationId,we(this,rr,t.mutationCache),we(this,Ho,[]),this.state=t.state||KV(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){K(this,Ho).includes(t)||(K(this,Ho).push(t),this.clearGcTimeout(),K(this,rr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){we(this,Ho,K(this,Ho).filter(n=>n!==t)),this.scheduleGc(),K(this,rr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){K(this,Ho).length||(this.state.status==="pending"?this.scheduleGc():K(this,rr).remove(this))}continue(){var t;return((t=K(this,Ta))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,f,h,p,m,b,y,v,x,E,C,w,_;we(this,Ta,LN({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,M)=>{ut(this,Wo,cs).call(this,{type:"failed",failureCount:k,error:M})},onPause:()=>{ut(this,Wo,cs).call(this,{type:"pause"})},onContinue:()=>{ut(this,Wo,cs).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>K(this,rr).canRun(this)}));const n=this.state.status==="pending",r=!K(this,Ta).canStart();try{if(!n){ut(this,Wo,cs).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=K(this,rr).config).onMutate)==null?void 0:i.call(o,t,this));const M=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));M!==this.state.context&&ut(this,Wo,cs).call(this,{type:"pending",context:M,variables:t,isPaused:r})}const k=await K(this,Ta).start();return await((c=(l=K(this,rr).config).onSuccess)==null?void 0:c.call(l,k,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,k,t,this.state.context)),await((h=(f=K(this,rr).config).onSettled)==null?void 0:h.call(f,k,null,this.state.variables,this.state.context,this)),await((m=(p=this.options).onSettled)==null?void 0:m.call(p,k,null,t,this.state.context)),ut(this,Wo,cs).call(this,{type:"success",data:k}),k}catch(k){try{throw await((y=(b=K(this,rr).config).onError)==null?void 0:y.call(b,k,t,this.state.context,this)),await((x=(v=this.options).onError)==null?void 0:x.call(v,k,t,this.state.context)),await((C=(E=K(this,rr).config).onSettled)==null?void 0:C.call(E,void 0,k,this.state.variables,this.state.context,this)),await((_=(w=this.options).onSettled)==null?void 0:_.call(w,void 0,k,t,this.state.context)),k}finally{ut(this,Wo,cs).call(this,{type:"error",error:k})}}finally{K(this,rr).runNext(this)}}},Ho=new WeakMap,rr=new WeakMap,Ta=new WeakMap,Wo=new WeakSet,cs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),An.batch(()=>{K(this,Ho).forEach(r=>{r.onMutationUpdate(t)}),K(this,rr).notify({mutation:this,type:"updated",action:t})})},oN);function KV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ai,yo,Vf,iN,XV=(iN=class extends cu{constructor(t={}){super();je(this,Ai);je(this,yo);je(this,Vf);this.config=t,we(this,Ai,new Set),we(this,yo,new Map),we(this,Vf,0)}build(t,n,r){const o=new YV({mutationCache:this,mutationId:++Bh(this,Vf)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){K(this,Ai).add(t);const n=Wh(t);if(typeof n=="string"){const r=K(this,yo).get(n);r?r.push(t):K(this,yo).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(K(this,Ai).delete(t)){const n=Wh(t);if(typeof n=="string"){const r=K(this,yo).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&K(this,yo).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Wh(t);if(typeof n=="string"){const r=K(this,yo).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Wh(t);if(typeof n=="string"){const o=(r=K(this,yo).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){An.batch(()=>{K(this,Ai).forEach(t=>{this.notify({type:"removed",mutation:t})}),K(this,Ai).clear(),K(this,yo).clear()})}getAll(){return Array.from(K(this,Ai))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>G2(n,r))}findAll(t={}){return this.getAll().filter(n=>G2(t,n))}notify(t){An.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return An.batch(()=>Promise.all(t.map(n=>n.continue().catch(Zr))))}},Ai=new WeakMap,yo=new WeakMap,Vf=new WeakMap,iN);function Wh(e){var t;return(t=e.options.scope)==null?void 0:t.id}function X2(e){return{onFetch:(t,n)=>{var u,d,f,h,p;const r=t.options,o=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],s=((p=t.state.data)==null?void 0:p.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let m=!1;const b=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},y=ON(t.options,t.fetchOptions),v=async(x,E,C)=>{if(m)return Promise.reject();if(E==null&&x.pages.length)return Promise.resolve(x);const w={client:t.client,queryKey:t.queryKey,pageParam:E,direction:C?"backward":"forward",meta:t.options.meta};b(w);const _=await y(w),{maxPages:k}=t.options,M=C?BV:zV;return{pages:M(x.pages,_,k),pageParams:M(x.pageParams,E,k)}};if(o&&i.length){const x=o==="backward",E=x?QV:Q2,C={pages:i,pageParams:s},w=E(r,C);a=await v(C,w,x)}else{const x=e??i.length;do{const E=l===0?s[0]??r.initialPageParam:Q2(r,a);if(l>0&&E==null)break;a=await v(a,E),l++}while(l<x)}return a};t.options.persister?t.fetchFn=()=>{var m,b;return(b=(m=t.options).persister)==null?void 0:b.call(m,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Q2(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function QV(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var tn,gs,ms,Pc,Dc,bs,Mc,Ac,sN,ZV=(sN=class{constructor(e={}){je(this,tn);je(this,gs);je(this,ms);je(this,Pc);je(this,Dc);je(this,bs);je(this,Mc);je(this,Ac);we(this,tn,e.queryCache||new BN),we(this,gs,e.mutationCache||new XV),we(this,ms,e.defaultOptions||{}),we(this,Pc,new Map),we(this,Dc,new Map),we(this,bs,0)}mount(){Bh(this,bs)._++,K(this,bs)===1&&(we(this,Mc,uS.subscribe(async e=>{e&&(await this.resumePausedMutations(),K(this,tn).onFocus())})),we(this,Ac,Dg.subscribe(async e=>{e&&(await this.resumePausedMutations(),K(this,tn).onOnline())})))}unmount(){var e,t;Bh(this,bs)._--,K(this,bs)===0&&((e=K(this,Mc))==null||e.call(this),we(this,Mc,void 0),(t=K(this,Ac))==null||t.call(this),we(this,Ac,void 0))}isFetching(e){return K(this,tn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return K(this,gs).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=K(this,tn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=K(this,tn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(uc(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return K(this,tn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=K(this,tn).get(r.queryHash),i=o==null?void 0:o.state.data,s=FV(t,i);if(s!==void 0)return K(this,tn).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return An.batch(()=>K(this,tn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=K(this,tn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=K(this,tn);An.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=K(this,tn);return An.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=An.batch(()=>K(this,tn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Zr).catch(Zr)}invalidateQueries(e,t={}){return An.batch(()=>(K(this,tn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=An.batch(()=>K(this,tn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Zr)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Zr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=K(this,tn).build(this,t);return n.isStaleByTime(uc(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Zr).catch(Zr)}fetchInfiniteQuery(e){return e.behavior=X2(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Zr).catch(Zr)}ensureInfiniteQueryData(e){return e.behavior=X2(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Dg.isOnline()?K(this,gs).resumePausedMutations():Promise.resolve()}getQueryCache(){return K(this,tn)}getMutationCache(){return K(this,gs)}getDefaultOptions(){return K(this,ms)}setDefaultOptions(e){we(this,ms,e)}setQueryDefaults(e,t){K(this,Pc).set(Jd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...K(this,Pc).values()],n={};return t.forEach(r=>{ef(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){K(this,Dc).set(Jd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...K(this,Dc).values()],n={};return t.forEach(r=>{ef(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...K(this,ms).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=cS(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Pg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...K(this,ms).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){K(this,tn).clear(),K(this,gs).clear()}},tn=new WeakMap,gs=new WeakMap,ms=new WeakMap,Pc=new WeakMap,Dc=new WeakMap,bs=new WeakMap,Mc=new WeakMap,Ac=new WeakMap,sN),xr,dt,Hf,or,Oa,Nc,ys,qo,Wf,Ic,Tc,ja,Fa,vs,Oc,Rt,id,yx,vx,xx,wx,Sx,Cx,_x,HN,aN,VN=(aN=class extends cu{constructor(t,n){super();je(this,Rt);je(this,xr);je(this,dt);je(this,Hf);je(this,or);je(this,Oa);je(this,Nc);je(this,ys);je(this,qo);je(this,Wf);je(this,Ic);je(this,Tc);je(this,ja);je(this,Fa);je(this,vs);je(this,Oc,new Set);this.options=n,we(this,xr,t),we(this,qo,null),we(this,ys,bx()),this.options.experimental_prefetchInRender||K(this,ys).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(K(this,dt).addObserver(this),Z2(K(this,dt),this.options)?ut(this,Rt,id).call(this):this.updateResult(),ut(this,Rt,wx).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ex(K(this,dt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ex(K(this,dt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ut(this,Rt,Sx).call(this),ut(this,Rt,Cx).call(this),K(this,dt).removeObserver(this)}setOptions(t,n){const r=this.options,o=K(this,dt);if(this.options=K(this,xr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof vo(this.options.enabled,K(this,dt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ut(this,Rt,_x).call(this),K(this,dt).setOptions(this.options),r._defaulted&&!px(this.options,r)&&K(this,xr).getQueryCache().notify({type:"observerOptionsUpdated",query:K(this,dt),observer:this});const i=this.hasListeners();i&&J2(K(this,dt),o,this.options,r)&&ut(this,Rt,id).call(this),this.updateResult(n),i&&(K(this,dt)!==o||vo(this.options.enabled,K(this,dt))!==vo(r.enabled,K(this,dt))||uc(this.options.staleTime,K(this,dt))!==uc(r.staleTime,K(this,dt)))&&ut(this,Rt,yx).call(this);const s=ut(this,Rt,vx).call(this);i&&(K(this,dt)!==o||vo(this.options.enabled,K(this,dt))!==vo(r.enabled,K(this,dt))||s!==K(this,vs))&&ut(this,Rt,xx).call(this,s)}getOptimisticResult(t){const n=K(this,xr).getQueryCache().build(K(this,xr),t),r=this.createResult(n,t);return eH(this,r)&&(we(this,or,r),we(this,Nc,this.options),we(this,Oa,K(this,dt).state)),r}getCurrentResult(){return K(this,or)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){K(this,Oc).add(t)}getCurrentQuery(){return K(this,dt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=K(this,xr).defaultQueryOptions(t),r=K(this,xr).getQueryCache().build(K(this,xr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ut(this,Rt,id).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),K(this,or)))}createResult(t,n){var k;const r=K(this,dt),o=this.options,i=K(this,or),s=K(this,Oa),a=K(this,Nc),c=t!==r?t.state:K(this,Hf),{state:u}=t;let d={...u},f=!1,h;if(n._optimisticResults){const M=this.hasListeners(),P=!M&&Z2(t,n),A=M&&J2(t,r,n,o);(P||A)&&(d={...d,...zN(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:b}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(s==null?void 0:s.data)&&n.select===K(this,Wf))h=K(this,Ic);else try{we(this,Wf,n.select),h=n.select(d.data),h=mx(i==null?void 0:i.data,h,n),we(this,Ic,h),we(this,qo,null)}catch(M){we(this,qo,M)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&b==="pending"){let M;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))M=i.data;else if(M=typeof n.placeholderData=="function"?n.placeholderData((k=K(this,Tc))==null?void 0:k.state.data,K(this,Tc)):n.placeholderData,n.select&&M!==void 0)try{M=n.select(M),we(this,qo,null)}catch(P){we(this,qo,P)}M!==void 0&&(b="success",h=mx(i==null?void 0:i.data,M,n),f=!0)}K(this,qo)&&(p=K(this,qo),h=K(this,Ic),m=Date.now(),b="error");const y=d.fetchStatus==="fetching",v=b==="pending",x=b==="error",E=v&&y,C=h!==void 0,_={status:b,fetchStatus:d.fetchStatus,isPending:v,isSuccess:b==="success",isError:x,isInitialLoading:E,isLoading:E,data:h,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:m,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:y,isRefetching:y&&!v,isLoadingError:x&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&C,isStale:dS(t,n),refetch:this.refetch,promise:K(this,ys)};if(this.options.experimental_prefetchInRender){const M=T=>{_.status==="error"?T.reject(_.error):_.data!==void 0&&T.resolve(_.data)},P=()=>{const T=we(this,ys,_.promise=bx());M(T)},A=K(this,ys);switch(A.status){case"pending":t.queryHash===r.queryHash&&M(A);break;case"fulfilled":(_.status==="error"||_.data!==A.value)&&P();break;case"rejected":(_.status!=="error"||_.error!==A.reason)&&P();break}}return _}updateResult(t){const n=K(this,or),r=this.createResult(K(this,dt),this.options);if(we(this,Oa,K(this,dt).state),we(this,Nc,this.options),K(this,Oa).data!==void 0&&we(this,Tc,K(this,dt)),px(r,n))return;we(this,or,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!K(this,Oc).size)return!0;const l=new Set(a??K(this,Oc));return this.options.throwOnError&&l.add("error"),Object.keys(K(this,or)).some(c=>{const u=c;return K(this,or)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),ut(this,Rt,HN).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ut(this,Rt,wx).call(this)}},xr=new WeakMap,dt=new WeakMap,Hf=new WeakMap,or=new WeakMap,Oa=new WeakMap,Nc=new WeakMap,ys=new WeakMap,qo=new WeakMap,Wf=new WeakMap,Ic=new WeakMap,Tc=new WeakMap,ja=new WeakMap,Fa=new WeakMap,vs=new WeakMap,Oc=new WeakMap,Rt=new WeakSet,id=function(t){ut(this,Rt,_x).call(this);let n=K(this,dt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Zr)),n},yx=function(){ut(this,Rt,Sx).call(this);const t=uc(this.options.staleTime,K(this,dt));if(nl||K(this,or).isStale||!hx(t))return;const r=TN(K(this,or).dataUpdatedAt,t)+1;we(this,ja,setTimeout(()=>{K(this,or).isStale||this.updateResult()},r))},vx=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(K(this,dt)):this.options.refetchInterval)??!1},xx=function(t){ut(this,Rt,Cx).call(this),we(this,vs,t),!(nl||vo(this.options.enabled,K(this,dt))===!1||!hx(K(this,vs))||K(this,vs)===0)&&we(this,Fa,setInterval(()=>{(this.options.refetchIntervalInBackground||uS.isFocused())&&ut(this,Rt,id).call(this)},K(this,vs)))},wx=function(){ut(this,Rt,yx).call(this),ut(this,Rt,xx).call(this,ut(this,Rt,vx).call(this))},Sx=function(){K(this,ja)&&(clearTimeout(K(this,ja)),we(this,ja,void 0))},Cx=function(){K(this,Fa)&&(clearInterval(K(this,Fa)),we(this,Fa,void 0))},_x=function(){const t=K(this,xr).getQueryCache().build(K(this,xr),this.options);if(t===K(this,dt))return;const n=K(this,dt);we(this,dt,t),we(this,Hf,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},HN=function(t){An.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(K(this,or))}),K(this,xr).getQueryCache().notify({query:K(this,dt),type:"observerResultsUpdated"})})},aN);function JV(e,t){return vo(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Z2(e,t){return JV(e,t)||e.state.data!==void 0&&Ex(e,t,t.refetchOnMount)}function Ex(e,t,n){if(vo(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&dS(e,t)}return!1}function J2(e,t,n,r){return(e!==t||vo(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&dS(e,n)}function dS(e,t){return vo(t.enabled,e)!==!1&&e.isStaleByTime(uc(t.staleTime,e))}function eH(e,t){return!px(e.getCurrentResult(),t)}var fS=S.createContext(void 0),uu=e=>{const t=S.useContext(fS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},tH=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(fS.Provider,{value:e,children:t})),WN=S.createContext(!1),qN=()=>S.useContext(WN);WN.Provider;function nH(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var rH=S.createContext(nH()),UN=()=>S.useContext(rH);function oH(e,t){return typeof e=="function"?e(...t):!!e}function Rx(){}var GN=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},YN=e=>{S.useEffect(()=>{e.clearReset()},[e])},KN=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||oH(n,[e.error,r])),XN=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},QN=(e,t)=>e.isLoading&&e.isFetching&&!t,ZN=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,kx=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function iH(e,t,n){var d,f,h,p,m;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=uu(),o=qN(),i=UN(),s=r.defaultQueryOptions(e);(f=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,s),process.env.NODE_ENV!=="production"&&(s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),s._optimisticResults=o?"isRestoring":"optimistic",XN(s),GN(s,i),YN(i);const a=!r.getQueryCache().get(s.queryHash),[l]=S.useState(()=>new t(r,s)),c=l.getOptimisticResult(s),u=!o&&e.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(b=>{const y=u?l.subscribe(An.batchCalls(b)):Rx;return l.updateResult(),y},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),S.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),ZN(s,c))throw kx(s,l,i);if(KN({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw c.error;if((p=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||p.call(h,s,c),s.experimental_prefetchInRender&&!nl&&QN(c,o)){const b=a?kx(s,l,i):(m=r.getQueryCache().get(s.queryHash))==null?void 0:m.promise;b==null||b.catch(Rx).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function ro(e,t){return iH(e,VN)}function sH(){const e=R.useContext(fS);if(e&&e.isSemaphorClient)return e}function JN({children:e}){const{setIsSessionExpired:t}=an(),n=sH(),[r]=R.useState(()=>{const o=new ZV({queryCache:new BN({onError:i=>{i instanceof Error?(console.error(`Something went wrong: ${i.message}`),i.message==="invalid token"&&t(!0)):console.error("Something went wrong:",i)}}),defaultOptions:{queries:{gcTime:36e5,staleTime:3e5,refetchOnWindowFocus:!1,retry:1}}});return o.isSemaphorClient=!0,o});return n?g.jsx(g.Fragment,{children:e}):g.jsx(tH,{client:r,children:e})}const Hs=R.forwardRef(({children:e,className:t,...n},r)=>g.jsx("div",{className:se("semaphor-scope",t),ref:r,...n,children:e})),aH={id:"",authToken:void 0},eI=R.createContext(aH),tI=({children:e,dashboardProps:t})=>g.jsx(JN,{children:g.jsx(eI.Provider,{value:t,children:g.jsx(Hs,{style:{height:"100%"},children:e})})});function Jn(){const e=R.useContext(eI);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function lH(){const{authToken:e,version:t}=Jn(),n=re(l=>l.selectedLensId);function r(){if(!(e!=null&&e.accessToken))return!1}const{data:o,isLoading:i,isFetching:s,isError:a}=ro({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>AV(e==null?void 0:e.accessToken,{lensId:n,version:t}),enabled:r()});return{data:o,isLoading:i,isFetching:s,isError:a}}function cH(){const{authToken:e}=Jn(),t=re(r=>r.authToken),{setAuthToken:n}=an();return R.useEffect(()=>{e&&(e==null?void 0:e.toString())!==(t==null?void 0:t.toString())&&n(e)},[e,t,n]),e}const nI=(e,t)=>{const n={};if(e===null||t===null)return t;const r=new Set([...Object.keys(e),...Object.keys(t)]);for(const o of r){if(!(o in e)&&o in t){n[o]=t[o];continue}if(o in e&&!(o in t)){n[o]=void 0;continue}const i=e[o],s=t[o];if(!Px(i,s))if(Array.isArray(i)&&Array.isArray(s))n[o]=s;else if(eR(i)&&eR(s)){const a=nI(i,s);Object.keys(a).length>0&&(n[o]=a)}else n[o]=s}return n},Px=(e,t)=>{if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((o,i)=>Px(o,t[i]));const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(o=>Px(e[o],t[o]))}return!1},eR=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),tf=e=>{if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(n=>tf(n));const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=tf(e[n]));return t};function rI(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function tR(e,t){const n=rI(e);return n==="dark"?Zd({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function uH({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,selectedSheetId:i,onFilterValuesChange:s}){const{authToken:a}=Jn();cH();const l=re(O=>O.selectedLensId),{data:c,isLoading:u,isFetching:d,isError:f}=lH(),[h,p]=R.useState(o||[]),{theme:m,setTheme:b}=IN(),y=re(O=>O.dashboard.globalStyle),{setDashboard:v,setDashboardWithFilterValues:x,setSelectedSheetId:E,setStyle:C,setOnSaveFunction:w,setLenses:_,setSelectedLensId:k,setInitStore:M}=an();re(O=>O.actions.setCustomCards);const P=re(O=>O.actions.setFilterValues),A=re(O=>O.filterValues),T=re(O=>O.actions.setThemeStyle),F=re(O=>O.actions.setDashboardTheme),L=re(O=>O.actions.setOnEvent);R.useEffect(()=>{a&&M()},[a,M]),R.useEffect(()=>{if(m){const O=rI(m);F(O)}},[m,F]),R.useEffect(()=>{t&&b(t)},[t,b]);const I=R.useCallback(()=>{const O=tf(Eg),j=Zd(O,y);if(e){const z=Zd(j,e),B=tR(m,z);T(B),C(z)}else{const z=tR(m,j);T(z),C(Eg)}},[m,e,y,T,C]);return R.useEffect(()=>{c&&c.dashboard&&I()},[m,e,y,I,c]),R.useEffect(()=>{var $,D;function O(V,G){const U=V.filters||[],W=[];for(const Y of G){const X=U.find(J=>J.id===Y.filterId);X&&W.push({filterId:Y.filterId,connectionType:X.database==="NA"?"api":"database",name:X.column,operation:X.operation,valueType:cc(X),values:Y.values})}return W}if(!c||!c.dashboard)return;const{dashboard:j,filterValues:z,defaultLensId:B,lenses:N}=c;function q(){var G;if(z&&(z==null?void 0:z.length)>0)return z;const V=O(j,h||[]);return V&&(V==null?void 0:V.length)>0?V:j.defaultFilterValues&&((G=j.defaultFilterValues)==null?void 0:G.length)>0?j.defaultFilterValues:[]}x(j,q()),N&&_(N),B&&k(B),E(i||((D=($=j==null?void 0:j.sheets)==null?void 0:$[0])==null?void 0:D.id)||null)},[c,v,E,P,l,_,x,k,h,i]),R.useEffect(()=>{s&&A&&s(A)},[A,s]),R.useEffect(()=>{n&&w(n),r&&L(r)},[n,w,r,L]),{isFetching:d,isLoading:u,isError:f}}function Hi({className:e,...t}){return g.jsx("div",{className:se("animate-pulse rounded-md bg-muted",e),...t})}const oI=S.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:se("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));oI.displayName="Card";const Ym=S.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:se("flex flex-col space-y-1.5 p-6",e),...t}));Ym.displayName="CardHeader";const du=S.forwardRef(({className:e,...t},n)=>g.jsx("h3",{ref:n,className:se("text-2xl font-semibold leading-none tracking-tight",e),...t}));du.displayName="CardTitle";const hS=S.forwardRef(({className:e,...t},n)=>g.jsx("p",{ref:n,className:se("text-sm text-muted-foreground",e),...t}));hS.displayName="CardDescription";const pS=S.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:se("px-6 pt-0",e),...t}));pS.displayName="CardContent";const iI=S.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:se("flex items-center p-6 pt-0",e),...t}));iI.displayName="CardFooter";function sI({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:f,defaultFilterValues:h,onFilterValuesChange:p,selectedSheetId:m,eventHandlers:b,...y}){const{placeholders:v}=Jn(),x=re(_=>_.themeStyle),E=re(_=>_.isSessionExpired),{isLoading:C,isError:w}=uH({customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:h,onFilterValuesChange:p,selectedSheetId:m});return C||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?g.jsx(o,{message:"loading"}):g.jsx("div",{className:"flex items-center gap-3",children:g.jsx(Hi,{className:"h-1 w-full dark:h-[2px]"})})):w?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),g.jsx(i,{})):g.jsx("div",{children:"Error"})):E?(r==null||r({type:"error",message:"Session Expired"}),v!=null&&v.SessionExpired?g.jsx("div",{className:"flex h-full items-center justify-center",children:g.jsx("div",{children:v.SessionExpired})}):g.jsx("div",{className:"flex h-full items-center justify-center",children:g.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[g.jsx(du,{children:"Session Expired"}),g.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):g.jsx("div",{className:se("isolate flex h-full flex-col justify-between",x==null?void 0:x.dashboardPanel,e),style:{},"data-role":"dashboard-panel",...y})}function ue(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function dH(e,t){const n=S.createContext(t),r=i=>{const{children:s,...a}=i,l=S.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=S.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Pn(e,t=[]){let n=[];function r(i,s){const a=S.createContext(s),l=n.length;n=[...n,s];const c=d=>{var y;const{scope:f,children:h,...p}=d,m=((y=f==null?void 0:f[e])==null?void 0:y[l])||a,b=S.useMemo(()=>p,Object.values(p));return g.jsx(m.Provider,{value:b,children:h})};c.displayName=i+"Provider";function u(d,f){var m;const h=((m=f==null?void 0:f[e])==null?void 0:m[l])||a,p=S.useContext(h);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>S.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,fH(o,...t)]}function fH(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function nR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function To(...e){return t=>{let n=!1;const r=e.map(o=>{const i=nR(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():nR(e[o],null)}}}}function Be(...e){return S.useCallback(To(...e),e)}var Dx=S.forwardRef((e,t)=>{const{children:n,...r}=e,o=S.Children.toArray(n),i=o.find(pH);if(i){const s=i.props.children,a=o.map(l=>l===i?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:l);return g.jsx(Mx,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return g.jsx(Mx,{...r,ref:t,children:n})});Dx.displayName="Slot";var Mx=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const o=mH(n),i=gH(r,n.props);return n.type!==S.Fragment&&(i.ref=t?To(t,o):o),S.cloneElement(n,i)}return S.Children.count(n)>1?S.Children.only(null):null});Mx.displayName="SlotClone";var hH=({children:e})=>g.jsx(g.Fragment,{children:e});function pH(e){return S.isValidElement(e)&&e.type===hH}function gH(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function mH(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Km(e){const t=e+"CollectionProvider",[n,r]=Pn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:p,children:m}=h,b=R.useRef(null),y=R.useRef(new Map).current;return g.jsx(o,{scope:p,itemMap:y,collectionRef:b,children:m})};s.displayName=t;const a=e+"CollectionSlot",l=R.forwardRef((h,p)=>{const{scope:m,children:b}=h,y=i(a,m),v=Be(p,y.collectionRef);return g.jsx(Dx,{ref:v,children:b})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=R.forwardRef((h,p)=>{const{scope:m,children:b,...y}=h,v=R.useRef(null),x=Be(p,v),E=i(c,m);return R.useEffect(()=>(E.itemMap.set(v,{ref:v,...y}),()=>void E.itemMap.delete(v))),g.jsx(Dx,{[u]:"",ref:x,children:b})});d.displayName=c;function f(h){const p=i(e+"CollectionConsumer",h);return R.useCallback(()=>{const b=p.collectionRef.current;if(!b)return[];const y=Array.from(b.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((E,C)=>y.indexOf(E.ref.current)-y.indexOf(C.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},f,r]}var $n=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},bH=S.useId||(()=>{}),yH=0;function Sn(e){const[t,n]=S.useState(bH());return $n(()=>{n(r=>r??String(yH++))},[e]),t?`radix-${t}`:""}var aI=S.forwardRef((e,t)=>{const{children:n,...r}=e,o=S.Children.toArray(n),i=o.find(xH);if(i){const s=i.props.children,a=o.map(l=>l===i?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:l);return g.jsx(Ax,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return g.jsx(Ax,{...r,ref:t,children:n})});aI.displayName="Slot";var Ax=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const o=SH(n),i=wH(r,n.props);return n.type!==S.Fragment&&(i.ref=t?To(t,o):o),S.cloneElement(n,i)}return S.Children.count(n)>1?S.Children.only(null):null});Ax.displayName="SlotClone";var vH=({children:e})=>g.jsx(g.Fragment,{children:e});function xH(e){return S.isValidElement(e)&&e.type===vH}function wH(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function SH(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var CH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ve=CH.reduce((e,t)=>{const n=S.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?aI:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function lI(e,t){e&&Za.flushSync(()=>e.dispatchEvent(t))}function kn(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Zn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=_H({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=kn(n),l=S.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function _H({defaultProp:e,onChange:t}){const n=S.useState(e),[r]=n,o=S.useRef(r),i=kn(t);return S.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var EH=S.createContext(void 0);function Sl(e){const t=S.useContext(EH);return e||t||"ltr"}var K0="rovingFocusGroup.onEntryFocus",RH={bubbles:!1,cancelable:!0},Xm="RovingFocusGroup",[Nx,cI,kH]=Km(Xm),[PH,fu]=Pn(Xm,[kH]),[DH,MH]=PH(Xm),uI=S.forwardRef((e,t)=>g.jsx(Nx.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Nx.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(AH,{...e,ref:t})})}));uI.displayName=Xm;var AH=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=S.useRef(null),h=Be(t,f),p=Sl(i),[m=null,b]=Zn({prop:s,defaultProp:a,onChange:l}),[y,v]=S.useState(!1),x=kn(c),E=cI(n),C=S.useRef(!1),[w,_]=S.useState(0);return S.useEffect(()=>{const k=f.current;if(k)return k.addEventListener(K0,x),()=>k.removeEventListener(K0,x)},[x]),g.jsx(DH,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:m,onItemFocus:S.useCallback(k=>b(k),[b]),onItemShiftTab:S.useCallback(()=>v(!0),[]),onFocusableItemAdd:S.useCallback(()=>_(k=>k+1),[]),onFocusableItemRemove:S.useCallback(()=>_(k=>k-1),[]),children:g.jsx(ve.div,{tabIndex:y||w===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:ue(e.onMouseDown,()=>{C.current=!0}),onFocus:ue(e.onFocus,k=>{const M=!C.current;if(k.target===k.currentTarget&&M&&!y){const P=new CustomEvent(K0,RH);if(k.currentTarget.dispatchEvent(P),!P.defaultPrevented){const A=E().filter(O=>O.focusable),T=A.find(O=>O.active),F=A.find(O=>O.id===m),I=[T,F,...A].filter(Boolean).map(O=>O.ref.current);hI(I,u)}}C.current=!1}),onBlur:ue(e.onBlur,()=>v(!1))})})}),dI="RovingFocusGroupItem",fI=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Sn(),l=i||a,c=MH(dI,n),u=c.currentTabStopId===l,d=cI(n),{onFocusableItemAdd:f,onFocusableItemRemove:h}=c;return S.useEffect(()=>{if(r)return f(),()=>h()},[r,f,h]),g.jsx(Nx.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:g.jsx(ve.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:ue(e.onMouseDown,p=>{r?c.onItemFocus(l):p.preventDefault()}),onFocus:ue(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:ue(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const m=TH(p,c.orientation,c.dir);if(m!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let y=d().filter(v=>v.focusable).map(v=>v.ref.current);if(m==="last")y.reverse();else if(m==="prev"||m==="next"){m==="prev"&&y.reverse();const v=y.indexOf(p.currentTarget);y=c.loop?OH(y,v+1):y.slice(v+1)}setTimeout(()=>hI(y))}})})})});fI.displayName=dI;var NH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function IH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function TH(e,t,n){const r=IH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return NH[r]}function hI(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function OH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var gS=uI,mS=fI;function jH(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var _n=e=>{const{present:t,children:n}=e,r=FH(t),o=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),i=Be(r.ref,LH(o));return typeof n=="function"||r.isPresent?S.cloneElement(o,{ref:i}):null};_n.displayName="Presence";function FH(e){const[t,n]=S.useState(),r=S.useRef({}),o=S.useRef(e),i=S.useRef("none"),s=e?"mounted":"unmounted",[a,l]=jH(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=qh(r.current);i.current=a==="mounted"?c:"none"},[a]),$n(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,h=qh(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),$n(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const m=qh(r.current).includes(h.animationName);if(h.target===t&&m&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},f=h=>{h.target===t&&(i.current=qh(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:S.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function qh(e){return(e==null?void 0:e.animationName)||"none"}function LH(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var bS="Tabs",[$H,xMe]=Pn(bS,[fu]),pI=fu(),[zH,yS]=$H(bS),gI=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Sl(a),[d,f]=Zn({prop:r,onChange:o,defaultProp:i});return g.jsx(zH,{scope:n,baseId:Sn(),value:d,onValueChange:f,orientation:s,dir:u,activationMode:l,children:g.jsx(ve.div,{dir:u,"data-orientation":s,...c,ref:t})})});gI.displayName=bS;var mI="TabsList",bI=S.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=yS(mI,n),s=pI(n);return g.jsx(gS,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:g.jsx(ve.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});bI.displayName=mI;var yI="TabsTrigger",vI=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=yS(yI,n),a=pI(n),l=SI(s.baseId,r),c=CI(s.baseId,r),u=r===s.value;return g.jsx(mS,{asChild:!0,...a,focusable:!o,active:u,children:g.jsx(ve.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:ue(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:ue(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:ue(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!o&&d&&s.onValueChange(r)})})})});vI.displayName=yI;var xI="TabsContent",wI=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=yS(xI,n),l=SI(a.baseId,r),c=CI(a.baseId,r),u=r===a.value,d=S.useRef(u);return S.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),g.jsx(_n,{present:o||u,children:({present:f})=>g.jsx(ve.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&i})})});wI.displayName=xI;function SI(e,t){return`${e}-trigger-${t}`}function CI(e,t){return`${e}-content-${t}`}var BH=gI,_I=bI,EI=vI,RI=wI;const Qm=BH,Uf=S.forwardRef(({className:e,...t},n)=>g.jsx(_I,{ref:n,className:se("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Uf.displayName=_I.displayName;const ws=S.forwardRef(({className:e,...t},n)=>g.jsx(EI,{ref:n,className:se("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}));ws.displayName=EI.displayName;const Sa=S.forwardRef(({className:e,...t},n)=>g.jsx(RI,{ref:n,className:se("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Sa.displayName=RI.displayName;var kI={exports:{}},Gf={},Ix={exports:{}};(function(e,t){(function(n,r){r(t)})(ji,function(n){function r(Y){return function(J,te,Q,ie,ee,ce,fe){return Y(J,te,fe)}}function o(Y){return function(J,te,Q,ie){if(!J||!te||typeof J!="object"||typeof te!="object")return Y(J,te,Q,ie);var ee=ie.get(J),ce=ie.get(te);if(ee&&ce)return ee===te&&ce===J;ie.set(J,te),ie.set(te,J);var fe=Y(J,te,Q,ie);return ie.delete(J),ie.delete(te),fe}}function i(Y,X){var J={};for(var te in Y)J[te]=Y[te];for(var te in X)J[te]=X[te];return J}function s(Y){return Y.constructor===Object||Y.constructor==null}function a(Y){return typeof Y.then=="function"}function l(Y,X){return Y===X||Y!==Y&&X!==X}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",f="[object RegExp]",h="[object Map]",p="[object Number]",m="[object Object]",b="[object Set]",y="[object String]",v=Object.prototype.toString;function x(Y){var X=Y.areArraysEqual,J=Y.areDatesEqual,te=Y.areMapsEqual,Q=Y.areObjectsEqual,ie=Y.areRegExpsEqual,ee=Y.areSetsEqual,ce=Y.createIsNestedEqual,fe=ce(_e);function _e(be,ye,de){if(be===ye)return!0;if(!be||!ye||typeof be!="object"||typeof ye!="object")return be!==be&&ye!==ye;if(s(be)&&s(ye))return Q(be,ye,fe,de);var xe=Array.isArray(be),Ae=Array.isArray(ye);if(xe||Ae)return xe===Ae&&X(be,ye,fe,de);var Ee=v.call(be);return Ee!==v.call(ye)?!1:Ee===d?J(be,ye,fe,de):Ee===f?ie(be,ye,fe,de):Ee===h?te(be,ye,fe,de):Ee===b?ee(be,ye,fe,de):Ee===m||Ee===c?a(be)||a(ye)?!1:Q(be,ye,fe,de):Ee===u||Ee===p||Ee===y?l(be.valueOf(),ye.valueOf()):!1}return _e}function E(Y,X,J,te){var Q=Y.length;if(X.length!==Q)return!1;for(;Q-- >0;)if(!J(Y[Q],X[Q],Q,Q,Y,X,te))return!1;return!0}var C=o(E);function w(Y,X){return l(Y.valueOf(),X.valueOf())}function _(Y,X,J,te){var Q=Y.size===X.size;if(!Q)return!1;if(!Y.size)return!0;var ie={},ee=0;return Y.forEach(function(ce,fe){if(Q){var _e=!1,be=0;X.forEach(function(ye,de){!_e&&!ie[be]&&(_e=J(fe,de,ee,be,Y,X,te)&&J(ce,ye,fe,de,Y,X,te))&&(ie[be]=!0),be++}),ee++,Q=_e}}),Q}var k=o(_),M="_owner",P=Object.prototype.hasOwnProperty;function A(Y,X,J,te){var Q=Object.keys(Y),ie=Q.length;if(Object.keys(X).length!==ie)return!1;for(var ee;ie-- >0;){if(ee=Q[ie],ee===M){var ce=!!Y.$$typeof,fe=!!X.$$typeof;if((ce||fe)&&ce!==fe)return!1}if(!P.call(X,ee)||!J(Y[ee],X[ee],ee,ee,Y,X,te))return!1}return!0}var T=o(A);function F(Y,X){return Y.source===X.source&&Y.flags===X.flags}function L(Y,X,J,te){var Q=Y.size===X.size;if(!Q)return!1;if(!Y.size)return!0;var ie={};return Y.forEach(function(ee,ce){if(Q){var fe=!1,_e=0;X.forEach(function(be,ye){!fe&&!ie[_e]&&(fe=J(ee,be,ce,ye,Y,X,te))&&(ie[_e]=!0),_e++}),Q=fe}}),Q}var I=o(L),O=Object.freeze({areArraysEqual:E,areDatesEqual:w,areMapsEqual:_,areObjectsEqual:A,areRegExpsEqual:F,areSetsEqual:L,createIsNestedEqual:r}),j=Object.freeze({areArraysEqual:C,areDatesEqual:w,areMapsEqual:k,areObjectsEqual:T,areRegExpsEqual:F,areSetsEqual:I,createIsNestedEqual:r}),z=x(O);function B(Y,X){return z(Y,X,void 0)}var N=x(i(O,{createIsNestedEqual:function(){return l}}));function q(Y,X){return N(Y,X,void 0)}var $=x(j);function D(Y,X){return $(Y,X,new WeakMap)}var V=x(i(j,{createIsNestedEqual:function(){return l}}));function G(Y,X){return V(Y,X,new WeakMap)}function U(Y){return x(i(O,Y(O)))}function W(Y){var X=x(i(j,Y(j)));return function(J,te,Q){return Q===void 0&&(Q=new WeakMap),X(J,te,Q)}}n.circularDeepEqual=D,n.circularShallowEqual=G,n.createCustomCircularEqual=W,n.createCustomEqual=U,n.deepEqual=B,n.sameValueZeroEqual=l,n.shallowEqual=q,Object.defineProperty(n,"__esModule",{value:!0})})})(Ix,Ix.exports);var vS=Ix.exports;const xS=K1(rB);var st={},VH=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(st,"__esModule",{value:!0});st.bottom=wS;st.childrenEqual=UH;st.cloneLayout=PI;st.cloneLayoutItem=La;st.collides=Zm;st.compact=MI;st.compactItem=AI;st.compactType=iW;st.correctBounds=NI;st.fastPositionEqual=GH;st.fastRGLPropsEqual=void 0;st.getAllCollisions=II;st.getFirstCollision=Ca;st.getLayoutItem=SS;st.getStatics=CS;st.modifyLayout=DI;st.moveElement=ad;st.moveElementAwayFromCollision=Ox;st.noop=void 0;st.perc=KH;st.resizeItemInDirection=tW;st.setTopLeft=rW;st.setTransform=nW;st.sortLayoutItems=DS;st.sortLayoutItemsByColRow=LI;st.sortLayoutItemsByRowCol=FI;st.synchronizeLayoutWithChildren=oW;st.validateLayout=$I;st.withLayoutItem=qH;var rR=vS,sd=HH(R);function HH(e){return e&&e.__esModule?e:{default:e}}const WH=process.env.NODE_ENV==="production";function wS(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function PI(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=La(e[n]);return t}function DI(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function qH(e,t,n){let r=SS(e,t);return r?(r=n(La(r)),e=DI(e,r),[e,r]):[e,null]}function La(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 UH(e,t){return(0,rR.deepEqual)(sd.default.Children.map(e,n=>n==null?void 0:n.key),sd.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,rR.deepEqual)(sd.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),sd.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}st.fastRGLPropsEqual=VH;function GH(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Zm(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 MI(e,t,n,r){const o=CS(e),i=DS(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=La(i[a]);c.static||(c=AI(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const YH={x:"w",y:"h"};function Tx(e,t,n,r){const o=YH[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Zm(t,a)&&Tx(e,a,n+t[o],r)}}t[r]=n}function AI(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(wS(e),t.y);t.y>0&&!Ca(e,t);)t.y--;else if(a)for(;t.x>0&&!Ca(e,t);)t.x--;let l;for(;(l=Ca(e,t))&&!(n===null&&i);)if(a?Tx(o,t,l.x+l.w,"x"):Tx(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ca(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function NI(e,t){const n=CS(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Ca(n,i);)i.y++}return e}function SS(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ca(e,t){for(let n=0,r=e.length;n<r;n++)if(Zm(e[n],t))return e[n]}function II(e,t){return e.filter(n=>Zm(n,t))}function CS(e){return e.filter(t=>t.static)}function ad(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=DS(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const h=II(d,t),p=h.length>0;if(p&&l)return PI(e);if(p&&i)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let m=0,b=h.length;m<b;m++){const y=h[m];`${t.i}${t.x}${t.y}${y.i}${y.x}${y.y}`,!y.moved&&(y.static?e=Ox(e,y,t,o,s):e=Ox(e,t,y,o,s))}return e}function Ox(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const d={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},f=Ca(e,d),h=f&&f.y+f.h>t.y,p=f&&t.x+t.w>f.x;if(f){if(h&&a)return ad(e,n,void 0,t.y+1,r,l,o);if(h&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(p&&s)return ad(e,t,n.x,void 0,r,l,o)}else return`${n.i}${d.x}${d.y}`,ad(e,n,s?d.x:void 0,a?d.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:ad(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function KH(e){return e*100+"%"}const TI=(e,t,n,r)=>e+n>r?t:n,OI=(e,t,n)=>e<0?t:n,jI=e=>Math.max(0,e),_S=e=>Math.max(0,e),ES=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:OI(s,e.height,o),top:_S(s)}},RS=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:TI(e.left,e.width,s,n),left:jI(o)}},kS=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:TI(e.left,e.width,i,n),top:_S(r),left:jI(s)}},PS=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:OI(r,e.height,i),top:_S(r)}},XH=function(){return ES(arguments.length<=0?void 0:arguments[0],RS(...arguments))},QH=function(){return ES(arguments.length<=0?void 0:arguments[0],kS(...arguments))},ZH=function(){return PS(arguments.length<=0?void 0:arguments[0],RS(...arguments))},JH=function(){return PS(arguments.length<=0?void 0:arguments[0],kS(...arguments))},eW={n:ES,ne:XH,e:RS,se:ZH,s:PS,sw:JH,w:kS,nw:QH};function tW(e,t,n,r){const o=eW[e];return o?o(t,{...t,...n},r):n}function nW(e){let{top:t,left:n,width:r,height:o}=e;const i=`translate(${n}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${r}px`,height:`${o}px`,position:"absolute"}}function rW(e){let{top:t,left:n,width:r,height:o}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function DS(e,t){return t==="horizontal"?LI(e):t==="vertical"?FI(e):e}function FI(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 LI(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 oW(e,t,n,r,o){e=e||[];const i=[];sd.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=SS(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(La(l)):c?(WH||$I([c],"ReactGridLayout.children"),i.push(La({...c,i:a.key}))):i.push(La({w:1,h:1,x:0,y:wS(i),i:String(a.key)}))});const s=NI(i,{cols:n});return o?s:MI(s,r,n)}function $I(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++){const a=n[s],l=i[a];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${a} must be a number! Received: ${l} (${typeof l})`)}if(typeof i.i<"u"&&typeof i.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${i.i} (${typeof i.i})`)}}function iW(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const sW=()=>{};st.noop=sW;var di={};Object.defineProperty(di,"__esModule",{value:!0});di.calcGridColWidth=Jm;di.calcGridItemPosition=aW;di.calcGridItemWHPx=jx;di.calcWH=cW;di.calcXY=lW;di.clamp=_a;function Jm(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function jx(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function aW(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=Jm(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=jx(r,c,s[0]),u.height=jx(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function lW(e,t,n,r,o){const{margin:i,containerPadding:s,cols:a,rowHeight:l,maxRows:c}=e,u=Jm(e);let d=Math.round((n-s[0])/(u+i[0])),f=Math.round((t-s[1])/(l+i[1]));return d=_a(d,0,a-r),f=_a(f,0,c-o),{x:d,y:f}}function cW(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=Jm(e);let d=Math.round((t+s[0])/(u+s[0])),f=Math.round((n+s[1])/(c+s[1])),h=_a(d,0,l-r),p=_a(f,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(h=_a(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(p=_a(f,0,a)),{w:h,h:p}}function _a(e,t,n){return Math.max(Math.min(e,n),t)}var eb={},Fx={exports:{}},Uh={exports:{}},St={};/** @license React v16.13.1
36
+ `,EN=["_forecast"],_g="dm",dx=[{locale:"en-US",currency:"USD",currencyName:"US Dollar"},{locale:"en-GB",currency:"GBP",currencyName:"British Pound"},{locale:"en-CA",currency:"CAD",currencyName:"Canadian Dollar"},{locale:"en-AU",currency:"AUD",currencyName:"Australian Dollar"},{locale:"en-IN",currency:"INR",currencyName:"Indian Rupee"},{locale:"ja-JP",currency:"JPY",currencyName:"Japanese Yen"},{locale:"de-DE",currency:"EUR",currencyName:"Germany (Eurozone)"},{locale:"fr-FR",currency:"EUR",currencyName:"France (Eurozone)"},{locale:"es-ES",currency:"EUR",currencyName:"Spain (Eurozone)"},{locale:"it-IT",currency:"EUR",currencyName:"Italy (Eurozone)"},{locale:"fi-FI",currency:"EUR",currencyName:"Finland (Eurozone)"},{locale:"nl-NL",currency:"EUR",currencyName:"Netherlands (Eurozone)"},{locale:"zh-CN",currency:"CNY",currencyName:"Chinese Yuan"},{locale:"ru-RU",currency:"RUB",currencyName:"Russian Ruble"},{locale:"pt-BR",currency:"BRL",currencyName:"Brazilian Real"},{locale:"ko-KR",currency:"KRW",currencyName:"South Korean Won"},{locale:"ar-SA",currency:"SAR",currencyName:"Saudi Riyal"},{locale:"sv-SE",currency:"SEK",currencyName:"Swedish Krona"},{locale:"no-NO",currency:"NOK",currencyName:"Norwegian Krone"},{locale:"da-DK",currency:"DKK",currencyName:"Danish Krone"},{locale:"pl-PL",currency:"PLN",currencyName:"Polish Zloty"},{locale:"tr-TR",currency:"TRY",currencyName:"Turkish Lira"},{locale:"he-IL",currency:"ILS",currencyName:"Israeli Shekel"},{locale:"th-TH",currency:"THB",currencyName:"Thai Baht"},{locale:"vi-VN",currency:"VND",currencyName:"Vietnamese Dong"},{locale:"id-ID",currency:"IDR",currencyName:"Indonesian Rupiah"},{locale:"mx-MX",currency:"MXN",currencyName:"Mexican Peso"},{locale:"za-ZA",currency:"ZAR",currencyName:"South African Rand"},{locale:"sg-SG",currency:"SGD",currencyName:"Singapore Dollar"},{locale:"hk-HK",currency:"HKD",currencyName:"Hong Kong Dollar"},{locale:"ch-CH",currency:"CHF",currencyName:"Swiss Franc"},{locale:"my-MY",currency:"MYR",currencyName:"Malaysian Ringgit"},{locale:"ph-PH",currency:"PHP",currencyName:"Philippine Peso"},{locale:"eg-EG",currency:"EGP",currencyName:"Egyptian Pound"},{locale:"nz-NZ",currency:"NZD",currencyName:"New Zealand Dollar"}],dV=[{label:"English",locales:[{code:"en-US",name:"US English"},{code:"en-GB",name:"British English"},{code:"en-AU",name:"Australian English"},{code:"en-CA",name:"Canadian English"}]},{label:"French",locales:[{code:"fr-FR",name:"France French"},{code:"fr-CA",name:"Canadian French"}]},{label:"Spanish",locales:[{code:"es-ES",name:"Spain Spanish"},{code:"es-MX",name:"Mexican Spanish"},{code:"es-419",name:"Latin American Spanish"}]},{label:"German",locales:[{code:"de-DE",name:"Germany German"},{code:"de-CH",name:"Swiss German"}]},{label:"Chinese",locales:[{code:"zh-CN",name:"Simplified Chinese (China)"},{code:"zh-TW",name:"Traditional Chinese (Taiwan)"},{code:"zh-HK",name:"Hong Kong Chinese"}]},{label:"Japanese",locales:[{code:"ja-JP",name:"Japanese"}]},{label:"Arabic",locales:[{code:"ar-EG",name:"Egypt Arabic"},{code:"ar-SA",name:"Saudi Arabia Arabic"}]},{label:"Russian",locales:[{code:"ru-RU",name:"Russian"}]},{label:"Portuguese",locales:[{code:"pt-PT",name:"Portugal Portuguese"},{code:"pt-BR",name:"Brazil Portuguese"}]},{label:"Indian Languages",locales:[{code:"hi-IN",name:"Hindi (India)"},{code:"ta-IN",name:"Tamil (India)"}]},{label:"Korean",locales:[{code:"ko-KR",name:"Korean"}]},{label:"Italian",locales:[{code:"it-IT",name:"Italian (Italy)"}]},{label:"Dutch",locales:[{code:"nl-NL",name:"Dutch (Netherlands)"}]},{label:"Swedish",locales:[{code:"sv-SE",name:"Swedish (Sweden)"}]},{label:"Turkish",locales:[{code:"tr-TR",name:"Turkish (Turkey)"}]},{label:"Hebrew",locales:[{code:"he-IL",name:"Hebrew (Israel)"}]},{label:"Thai",locales:[{code:"th-TH",name:"Thai (Thailand)"}]},{label:"Polish",locales:[{code:"pl-PL",name:"Polish (Poland)"}]},{label:"Greek",locales:[{code:"el-GR",name:"Greek (Greece)"}]},{label:"Norwegian",locales:[{code:"no-NO",name:"Norwegian (Norway)"}]}],rS=["lg","md","sm","xs","xxs"],Eg={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[_t.teal[500],_t.teal[300],_t.gray[700],_t.gray[500],_t.gray[300]],borderColor:[_t.teal[500],_t.teal[300],_t.gray[700],_t.gray[500],_t.gray[300]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:fx},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:4,usePointStyle:!0,pointStyle:"rectRounded",boxPadding:4},legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:2,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{datalables:{color:fx},backgroundColor:[_t.teal[500],_t.teal[300],_t.gray[700],_t.gray[500],_t.gray[300]],borderColor:[_t.teal[500],_t.teal[300],_t.gray[700],_t.gray[500],_t.gray[300]]},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:_t.slate[800]}},y:{grid:{display:!0,color:_t.slate[800]}}}}}}};function fx(e){var r,o,i,s,a,l;const t=(a=(s=(i=(o=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:o._config)==null?void 0:i.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=Qd()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Qd()),Lc(n)}function Qd(){return re.getState().theme==="dark"?"#000000":"#FFFFFF"}function Lc(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return _t.gray[500];const d=u.replace("#",""),f=parseInt(d.substring(0,2),16),h=parseInt(d.substring(2,4),16),p=parseInt(d.substring(4,6),16);t+=f,n+=h,r+=p,o++};Array.isArray(e)?e.forEach(u=>{i(u)}):i(e);const s=t/o,a=n/o,l=r/o;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const fV=["text","nullable(string)","name","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],hV=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],pV=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],gV=["boolean"];function oS(e){return e.match(/[A-Z]/)?`"${e}"`:e}function Um(e){return fV.includes(e.toLowerCase())||/varchar/i.test(e)}function qf(e){return hV.includes(e.toLowerCase())||/int|decimal|float|double/i.test(e)}function wl(e){return pV.includes(e.toLowerCase())||/date|time|timestamp/i.test(e)}function iS(e){return gV.includes(e.toLowerCase())||/boolean/i.test(e)}function mV(e,t,n,r,o,i){const{measures:s,dimensions:a}=e,l=s==null?void 0:s.map(f=>`${f.calc}(${f.name}) as ${f.calc}_${f.name.replace(/"/g,"")}`).join(", "),c=(a==null?void 0:a.join(", "))||"";let u="";const d=r?`${_g}.${r}`:aS({schemaName:t,tableName:n,connectionType:o,databaseName:i});if(l&&c)return u=`SELECT ${c}, COUNT(*) as count, ${l} FROM ${d} GROUP BY ${c} ORDER BY ${c} DESC LIMIT 100`,u;if(!l&&c)return u=`SELECT ${c}, COUNT(*) as count FROM ${d} GROUP BY ${c} ORDER BY ${c} DESC LIMIT 100`,u;if(l&&!c)return u=`SELECT ${l} FROM ${d} LIMIT 100`,u}function bV(e,t,n="AVG"){var i,s,a,l;let r={};const o=oS(e.column_name);return Um(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),qf(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===o&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===o&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function cc(e){return Um(e.dataType)?"string":qf(e.dataType)?"number":wl(e.dataType)?"date":iS(e.dataType)?"boolean":"string"}function yV(e){let t;const n=e.data_type.toLowerCase();return Um(n)?t="T":qf(n)?t="#":wl(n)?t="D":iS(n)?t="B":t="?",t}function vV(e,t){const{dimensions:n,measures:r}=t,o=n==null?void 0:n.includes(e.column_name),i=r==null?void 0:r.some(s=>s.name===e.column_name);return o||i}function RN(e){return e?e!=null&&e.startsWith(`${_g}.`)?e:`${_g}.${e}`:""}function sS({schemaName:e,tableName:t,modelName:n,connectionType:r,databaseName:o}){let i=aS({schemaName:e,tableName:t,connectionType:r,databaseName:o});n&&(i=RN(n));let s=i;return(l=>/[A-Z]/.test(l))(t)&&(s=s.split(".").map(c=>`"${c}"`).join(".")),s}function aS({schemaName:e,tableName:t,connectionType:n,databaseName:r}){return t==="api"||e===oS("NA")||n==="S3"||n==="API"?t:n==="S3Tables"?`${r}.${e}.${t}`:e?`${e}.${t}`:`${t}`}const xV=e=>{const t=new Date(e);return!isNaN(t.getTime())},wV=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),Gm=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?xV(e)?t="date":wV(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function SV({get:e,dataPoint:t,card:n}){var f;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValues:i,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,d={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(f=n.preferences)==null?void 0:f.filterOnClickField,valueType:Gm(u),operation:"=",values:[u]};if(l!=null&&l.find(h=>h.id===n.id)){const h=n.id;if(u==null){a(n),i(h);return}else s(d)}o(n),r(d)}function W2({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10},l=t?{...t}:{};return rS.forEach(c=>{l[c]||(l[c]=[]);const u=l[c].reduce((d,f)=>Math.max(d,f.y+f.h),0);a.y=a.y===1/0?u:a.y,l[c].push({...a})}),l}function q2(e,t){if(!t)return;const n={...t};return rS.forEach(r=>{n[r]&&(n[r]=n[r].filter(o=>o.i!==e))}),n}function kN(e){const t=re.getState().dashboard.globalCacheConfig,{card:n,filter:r}=e;return t}const re=Q1()(wN((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:Eg},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setInitStore:()=>{e(n=>{n.isSessionExpired=!1,n.currentBreakpoint="lg",n.dashboard={id:"",style:Eg},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!1,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},setHandleOpenAssistantProfile:n=>{e(r=>{r.handleOpenAssistantProfile=n})},setFilterMode:(n,r)=>{const o=r==="exclude"?"not in":"in";e(i=>{var a,l,c;const s=(a=i.dashboard.filters)==null?void 0:a.find(u=>u.id===n);s&&(s.operation=o,i.dashboard.filters=(l=i.dashboard.filters)==null?void 0:l.map(u=>u.id===n?s:u),i.filterValues&&i.filterValues.length>0&&(i.filterValues=(c=i.filterValues)==null?void 0:c.map(u=>u.filterId===n?{...u,operation:o}:u)))})},updateEmailSettings:n=>{e(r=>{r.dashboard.emailSettings=n})},setDefaultFilterValues:n=>{e(r=>{r.dashboard.defaultFilterValues=n})},setIsDownloadingPdf:n=>{e(r=>{r.isDownloadingPdf=n})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,s,a,l,c,u,d,f;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(h=>h.id===n);if(o!==void 0&&o>-1){(s=r.dashboard.sheets)==null||s.splice(o,1);const h=(a=r.dashboard.filters)==null?void 0:a.filter(m=>m.sheetId===n),p=(l=r.filterValues)==null?void 0:l.filter(m=>h==null?void 0:h.some(b=>b.id===m.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(m=>!(p!=null&&p.some(b=>b.filterId===m.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(m=>m.sheetId!==n),r.selectedSheetId=(f=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:f.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{rS.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const s={...n,layouts:i};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},addToAIScope:n=>{e(r=>{const{connectionId:o,connectionType:i,databaseName:s,schemaName:a,tableName:l,datamodelName:c,datamodelId:u}=n,d={connectionId:o||"",connectionType:i||"",databaseName:s||"",schemaName:a||"",tableName:l||"",datamodelName:c||"",datamodelId:u||""};let h=[...r.dashboard.aiScopeTables||[],d];h=h.filter((p,m,b)=>b.findIndex(y=>y.tableName===p.tableName&&y.datamodelName===p.datamodelName)===m),r.dashboard.aiScopeTables=h})},removeFromAIScope:n=>{e(r=>{const{connectionId:o,tableName:i,datamodelName:s}=n,a=r.dashboard.aiScopeTables||[];if(s){const l=a.filter(c=>!(c.datamodelName===s&&c.connectionId===o));r.dashboard.aiScopeTables=l}else if(i){const l=a.filter(c=>!(c.tableName===i&&c.connectionId===o));r.dashboard.aiScopeTables=l}})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===o.selectedSheetId);i&&((l=i==null?void 0:i.frames)==null||l.forEach(c=>{var d;const u=(d=c.cards)==null?void 0:d.find(f=>f.id===n);u&&(u.python=r)}))})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setDashboardWithFilterValues:(n,r)=>{e(o=>{o.dashboard=n,o.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l,c;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&((c=s==null?void 0:s.frames)==null||c.forEach(u=>{var f;const d=(f=u.cards)==null?void 0:f.find(h=>h.id===r);d&&(d.title=o)}))})},setCardInfo:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===o.selectedSheetId);i&&((l=i==null?void 0:i.frames)==null||l.forEach(c=>{var d;const u=(d=c.cards)==null?void 0:d.find(f=>f.id===n);u&&(u.info=r)}))})},setCardDescription:(n,r,o)=>{e(i=>{var a,l,c;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&((c=s==null?void 0:s.frames)==null||c.forEach(u=>{var f;const d=(f=u.cards)==null?void 0:f.find(h=>h.id===r);d&&(d.description=o)}))})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){const d=(c=s.cards)==null?void 0:c.find(f=>f.id===r);d&&(d.sql=o,(u=i.onUpdateCard)==null||u.call(i,d,n))}})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l,c;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(u=>u.filterId===o.filterId);if(o.values.length===0){r.filterValues=(a=r.filterValues)==null?void 0:a.filter(u=>u.filterId!==o.filterId);return}i!==void 0&&i>-1?(l=r.filterValues)==null||l.splice(i,1,o):(c=r.filterValues)==null||c.push(o)}):r.filterValues=n})},removeFilterValues:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const o=r.dashboard.sheets;o==null||o.forEach(a=>{W2({id:n.id,layouts:a.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1),(s=r.dashboard.sheets)==null||s.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{const u=q2(n,c.layouts);c.layouts=u})}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,d,f;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(h=>h.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(h=>h.id===r);if(a){const h=(d=a.cards)==null?void 0:d.findIndex(p=>p.id===o.id);h>-1&&((f=a.cards)==null||f.splice(h,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},updateFilterId:(n,r)=>{e(o=>{var a,l;const i=(a=o.dashboard.filters)==null?void 0:a.find(c=>c.id===n),s=(l=o.dashboard.filters)==null?void 0:l.some(c=>c.id===r);i&&!s&&(i.id=r)})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let d=1/0;const f=0;o==="start"&&(d=0);const h=W2({id:r.id,layouts:s.layouts,minH:10,x:f,y:d});s.layouts=h,(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(d=>d.id===n);if(i){const d=(l=i.frames)==null?void 0:l.findIndex(f=>f.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=i.frames)==null||c.splice(d,1),(u=i.layout)==null||u.splice(d,1),q2(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r)),(d=o.onAcceptChanges)==null||d.call(o,r,o.dashboard)})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(d=o.onUpdateCard)==null||d.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,d,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(d=i.layout)==null||d.splice(s,1),(f=o.onRemoveCard)==null||f.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnAcceptChanges:n=>{e(()=>({onAcceptChanges:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getCardFrame:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{SV({card:n,dataPoint:r,get:t})}}}))),an=()=>re(e=>e.actions);async function CV(e,t){const n=t.slice(0,16),r=new TextEncoder,o=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),i=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},o,{name:"AES-GCM",length:256},!1,["encrypt"]),s=window.crypto.getRandomValues(new Uint8Array(12)),a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},i,r.encode(e)),l=new Uint8Array(s.length+a.byteLength);return l.set(s,0),l.set(new Uint8Array(a),s.length),{payload:btoa(String.fromCharCode(...l))}}async function PN(e,t){const n=t.slice(0,16),r=new TextEncoder,o=new TextDecoder,i=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),s=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["decrypt"]),a=Uint8Array.from(atob(e),f=>f.charCodeAt(0)),l=a.slice(0,12),c=a.slice(a.length-16),u=a.slice(12,a.length-16),d=new Uint8Array(u.length+c.length);d.set(u),d.set(c,u.length);try{const f=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:l},s,d);return{decryptedData:o.decode(f)}}catch(f){throw new Error(`Decryption failed: ${f}`)}}function se(...e){return OB(Ja(e))}const _V=e=>Object.keys(e).length===0;async function xs(e,t,n={}){try{const r=new URLSearchParams(n).toString(),o=`${e}?${r}`,i=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!i.ok){const a=await i.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)}return await i.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function DN(e,t,n={}){try{const r=JSON.stringify(n),o=await CV(r,t),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(o)});if(!i.ok)return i.json().then(a=>{throw console.log(a.detail||"Unknown error occurred"),new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)});const s=await i.json();if(s.payload){const a=await PN(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}async function MN(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(i=>{throw console.log(i.detail||"Unknown error occurred"),new Error((i==null?void 0:i.error)||`HTTP error! status: ${r.status}`)})}catch(r){throw console.error("Error during fetch:",r),r}}function EV(e){if(!e)return{tenantId:"",endUserId:""};const t=Bm(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function RV(e){return e?Bm(e).assistantProfileId:void 0}function kV(e){if(!e)return;const t=Bm(e);if(t.params&&t.params.currencyFormat)return t.params.currencyFormat}function AN(e){return e?Bm(e).params:void 0}function lS(e){return e.charAt(0).toUpperCase()+e.slice(1)}function PV(e){return e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substring(1).toLowerCase())}function DV(e){return e.replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())}const mr="focus:ring-1 focus:ring-offset-0 focus-visible:ring-1 focus-visible:ring-offset-0",Vi="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 focus:ring-0 focus:ring-ring focus:ring-offset-0";async function MV(){var o,i;const e=(i=(o=re.getState())==null?void 0:o.authToken)==null?void 0:i.accessToken;if(!e)return;const n=await fetch("https://semaphor.cloud/api/v1/invalidate-token",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error("Failed to invalidate token");const r=await n.json();return console.log("invalidateToken",r),r}async function AV(e,t={}){if(!e)return null;let n="https://semaphor.cloud/api/v1/dashboard";const r=Object.fromEntries(Object.entries(t).filter(([a,l])=>l!==void 0)),o=new URLSearchParams(r).toString();o&&(n+=`?${o}`);let s=await(await fetch(n,{headers:{Authorization:`Bearer ${e}`}})).json();if("payload"in s){const a=await PN(atob(s.payload),e);s=JSON.parse(a.decryptedData)}return s}async function NV(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}const IV=e=>/boolean/i.test(e)?"boolean":/date|timestamp/i.test(e)?"date":/int|decimal|float|double|num/i.test(e)?"number":/json/i.test(e)?"json":/geo|geography|geometry/i.test(e)?"geo":"string";var Rg={exports:{}};Rg.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",f="[object Error]",h="[object Function]",p="[object GeneratorFunction]",m="[object Map]",b="[object Number]",y="[object Null]",v="[object Object]",x="[object Proxy]",E="[object RegExp]",C="[object Set]",w="[object String]",_="[object Undefined]",k="[object WeakMap]",M="[object ArrayBuffer]",P="[object DataView]",A="[object Float32Array]",T="[object Float64Array]",F="[object Int8Array]",L="[object Int16Array]",I="[object Int32Array]",O="[object Uint8Array]",j="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",N=/[\\^$.*+?()[\]{}|]/g,q=/^\[object .+?Constructor\]$/,$=/^(?:0|[1-9]\d*)$/,D={};D[A]=D[T]=D[F]=D[L]=D[I]=D[O]=D[j]=D[z]=D[B]=!0,D[a]=D[l]=D[M]=D[u]=D[P]=D[d]=D[f]=D[h]=D[m]=D[b]=D[v]=D[E]=D[C]=D[w]=D[k]=!1;var V=typeof ji=="object"&&ji&&ji.Object===Object&&ji,G=typeof self=="object"&&self&&self.Object===Object&&self,U=V||G||Function("return this")(),W=t&&!t.nodeType&&t,Y=W&&!0&&e&&!e.nodeType&&e,X=Y&&Y.exports===W,J=X&&V.process,te=function(){try{var H=Y&&Y.require&&Y.require("util").types;return H||J&&J.binding&&J.binding("util")}catch{}}(),Q=te&&te.isTypedArray;function ie(H,Z,oe){switch(oe.length){case 0:return H.call(Z);case 1:return H.call(Z,oe[0]);case 2:return H.call(Z,oe[0],oe[1]);case 3:return H.call(Z,oe[0],oe[1],oe[2])}return H.apply(Z,oe)}function ee(H,Z){for(var oe=-1,Re=Array(H);++oe<H;)Re[oe]=Z(oe);return Re}function ce(H){return function(Z){return H(Z)}}function fe(H,Z){return H==null?void 0:H[Z]}function _e(H,Z){return function(oe){return H(Z(oe))}}var be=Array.prototype,ye=Function.prototype,de=Object.prototype,xe=U["__core-js_shared__"],Ae=ye.toString,Ee=de.hasOwnProperty,cn=function(){var H=/[^.]+$/.exec(xe&&xe.keys&&xe.keys.IE_PROTO||"");return H?"Symbol(src)_1."+H:""}(),kt=de.toString,ne=Ae.call(Object),le=RegExp("^"+Ae.call(Ee).replace(N,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ce=X?U.Buffer:void 0,Pe=U.Symbol,He=U.Uint8Array;Ce&&Ce.allocUnsafe;var Dt=_e(Object.getPrototypeOf,Object),En=Object.create,fn=de.propertyIsEnumerable,ge=be.splice,hn=Pe?Pe.toStringTag:void 0,Mt=function(){try{var H=A0(Object,"defineProperty");return H({},"",{}),H}catch{}}(),Yr=Ce?Ce.isBuffer:void 0,Tn=Math.max,Nl=Date.now,Js=A0(U,"Map"),vi=A0(Object,"create"),en=function(){function H(){}return function(Z){if(!na(Z))return{};if(En)return En(Z);H.prototype=Z;var oe=new H;return H.prototype=void 0,oe}}();function wt(H){var Z=-1,oe=H==null?0:H.length;for(this.clear();++Z<oe;){var Re=H[Z];this.set(Re[0],Re[1])}}function On(){this.__data__=vi?vi(null):{},this.size=0}function Me(H){var Z=this.has(H)&&delete this.__data__[H];return this.size-=Z?1:0,Z}function We(H){var Z=this.__data__;if(vi){var oe=Z[H];return oe===r?void 0:oe}return Ee.call(Z,H)?Z[H]:void 0}function tt(H){var Z=this.__data__;return vi?Z[H]!==void 0:Ee.call(Z,H)}function Gt(H,Z){var oe=this.__data__;return this.size+=this.has(H)?0:1,oe[H]=vi&&Z===void 0?r:Z,this}wt.prototype.clear=On,wt.prototype.delete=Me,wt.prototype.get=We,wt.prototype.has=tt,wt.prototype.set=Gt;function At(H){var Z=-1,oe=H==null?0:H.length;for(this.clear();++Z<oe;){var Re=H[Z];this.set(Re[0],Re[1])}}function Nt(){this.__data__=[],this.size=0}function Dn(H){var Z=this.__data__,oe=Fh(Z,H);if(oe<0)return!1;var Re=Z.length-1;return oe==Re?Z.pop():ge.call(Z,oe,1),--this.size,!0}function Yt(H){var Z=this.__data__,oe=Fh(Z,H);return oe<0?void 0:Z[oe][1]}function pn(H){return Fh(this.__data__,H)>-1}function ea(H,Z){var oe=this.__data__,Re=Fh(oe,H);return Re<0?(++this.size,oe.push([H,Z])):oe[Re][1]=Z,this}At.prototype.clear=Nt,At.prototype.delete=Dn,At.prototype.get=Yt,At.prototype.has=pn,At.prototype.set=ea;function Kr(H){var Z=-1,oe=H==null?0:H.length;for(this.clear();++Z<oe;){var Re=H[Z];this.set(Re[0],Re[1])}}function Lo(){this.size=0,this.__data__={hash:new wt,map:new(Js||At),string:new wt}}function ta(H){var Z=$h(this,H).delete(H);return this.size-=Z?1:0,Z}function Fu(H){return $h(this,H).get(H)}function gz(H){return $h(this,H).has(H)}function mz(H,Z){var oe=$h(this,H),Re=oe.size;return oe.set(H,Z),this.size+=oe.size==Re?0:1,this}Kr.prototype.clear=Lo,Kr.prototype.delete=ta,Kr.prototype.get=Fu,Kr.prototype.has=gz,Kr.prototype.set=mz;function Il(H){var Z=this.__data__=new At(H);this.size=Z.size}function bz(){this.__data__=new At,this.size=0}function yz(H){var Z=this.__data__,oe=Z.delete(H);return this.size=Z.size,oe}function vz(H){return this.__data__.get(H)}function xz(H){return this.__data__.has(H)}function wz(H,Z){var oe=this.__data__;if(oe instanceof At){var Re=oe.__data__;if(!Js||Re.length<n-1)return Re.push([H,Z]),this.size=++oe.size,this;oe=this.__data__=new Kr(Re)}return oe.set(H,Z),this.size=oe.size,this}Il.prototype.clear=bz,Il.prototype.delete=yz,Il.prototype.get=vz,Il.prototype.has=xz,Il.prototype.set=wz;function Sz(H,Z){var oe=T0(H),Re=!oe&&I0(H),ht=!oe&&!Re&&x2(H),Ot=!oe&&!Re&&!ht&&S2(H),Kt=oe||Re||ht||Ot,yt=Kt?ee(H.length,String):[],Xt=yt.length;for(var ho in H)Kt&&(ho=="length"||ht&&(ho=="offset"||ho=="parent")||Ot&&(ho=="buffer"||ho=="byteLength"||ho=="byteOffset")||y2(ho,Xt))||yt.push(ho);return yt}function D0(H,Z,oe){(oe!==void 0&&!zh(H[Z],oe)||oe===void 0&&!(Z in H))&&M0(H,Z,oe)}function Cz(H,Z,oe){var Re=H[Z];(!(Ee.call(H,Z)&&zh(Re,oe))||oe===void 0&&!(Z in H))&&M0(H,Z,oe)}function Fh(H,Z){for(var oe=H.length;oe--;)if(zh(H[oe][0],Z))return oe;return-1}function M0(H,Z,oe){Z=="__proto__"&&Mt?Mt(H,Z,{configurable:!0,enumerable:!0,value:oe,writable:!0}):H[Z]=oe}var _z=Fz();function Lh(H){return H==null?H===void 0?_:y:hn&&hn in Object(H)?Lz(H):Wz(H)}function m2(H){return Lu(H)&&Lh(H)==a}function Ez(H){if(!na(H)||Vz(H))return!1;var Z=j0(H)?le:q;return Z.test(Yz(H))}function Rz(H){return Lu(H)&&w2(H.length)&&!!D[Lh(H)]}function kz(H){if(!na(H))return Hz(H);var Z=v2(H),oe=[];for(var Re in H)Re=="constructor"&&(Z||!Ee.call(H,Re))||oe.push(Re);return oe}function b2(H,Z,oe,Re,ht){H!==Z&&_z(Z,function(Ot,Kt){if(ht||(ht=new Il),na(Ot))Pz(H,Z,Kt,oe,b2,Re,ht);else{var yt=Re?Re(N0(H,Kt),Ot,Kt+"",H,Z,ht):void 0;yt===void 0&&(yt=Ot),D0(H,Kt,yt)}},C2)}function Pz(H,Z,oe,Re,ht,Ot,Kt){var yt=N0(H,oe),Xt=N0(Z,oe),ho=Kt.get(Xt);if(ho){D0(H,oe,ho);return}var Nr=Ot?Ot(yt,Xt,oe+"",H,Z,Kt):void 0,$u=Nr===void 0;if($u){var F0=T0(Xt),L0=!F0&&x2(Xt),E2=!F0&&!L0&&S2(Xt);Nr=Xt,F0||L0||E2?T0(yt)?Nr=yt:Kz(yt)?Nr=Tz(yt):L0?($u=!1,Nr=Az(Xt)):E2?($u=!1,Nr=Iz(Xt)):Nr=[]:Xz(Xt)||I0(Xt)?(Nr=yt,I0(yt)?Nr=Qz(yt):(!na(yt)||j0(yt))&&(Nr=$z(Xt))):$u=!1}$u&&(Kt.set(Xt,Nr),ht(Nr,Xt,Re,Ot,Kt),Kt.delete(Xt)),D0(H,oe,Nr)}function Dz(H,Z){return Uz(qz(H,Z,_2),H+"")}var Mz=Mt?function(H,Z){return Mt(H,"toString",{configurable:!0,enumerable:!1,value:Jz(Z),writable:!0})}:_2;function Az(H,Z){return H.slice()}function Nz(H){var Z=new H.constructor(H.byteLength);return new He(Z).set(new He(H)),Z}function Iz(H,Z){var oe=Nz(H.buffer);return new H.constructor(oe,H.byteOffset,H.length)}function Tz(H,Z){var oe=-1,Re=H.length;for(Z||(Z=Array(Re));++oe<Re;)Z[oe]=H[oe];return Z}function Oz(H,Z,oe,Re){var ht=!oe;oe||(oe={});for(var Ot=-1,Kt=Z.length;++Ot<Kt;){var yt=Z[Ot],Xt=void 0;Xt===void 0&&(Xt=H[yt]),ht?M0(oe,yt,Xt):Cz(oe,yt,Xt)}return oe}function jz(H){return Dz(function(Z,oe){var Re=-1,ht=oe.length,Ot=ht>1?oe[ht-1]:void 0,Kt=ht>2?oe[2]:void 0;for(Ot=H.length>3&&typeof Ot=="function"?(ht--,Ot):void 0,Kt&&zz(oe[0],oe[1],Kt)&&(Ot=ht<3?void 0:Ot,ht=1),Z=Object(Z);++Re<ht;){var yt=oe[Re];yt&&H(Z,yt,Re,Ot)}return Z})}function Fz(H){return function(Z,oe,Re){for(var ht=-1,Ot=Object(Z),Kt=Re(Z),yt=Kt.length;yt--;){var Xt=Kt[++ht];if(oe(Ot[Xt],Xt,Ot)===!1)break}return Z}}function $h(H,Z){var oe=H.__data__;return Bz(Z)?oe[typeof Z=="string"?"string":"hash"]:oe.map}function A0(H,Z){var oe=fe(H,Z);return Ez(oe)?oe:void 0}function Lz(H){var Z=Ee.call(H,hn),oe=H[hn];try{H[hn]=void 0;var Re=!0}catch{}var ht=kt.call(H);return Re&&(Z?H[hn]=oe:delete H[hn]),ht}function $z(H){return typeof H.constructor=="function"&&!v2(H)?en(Dt(H)):{}}function y2(H,Z){var oe=typeof H;return Z=Z??s,!!Z&&(oe=="number"||oe!="symbol"&&$.test(H))&&H>-1&&H%1==0&&H<Z}function zz(H,Z,oe){if(!na(oe))return!1;var Re=typeof Z;return(Re=="number"?O0(oe)&&y2(Z,oe.length):Re=="string"&&Z in oe)?zh(oe[Z],H):!1}function Bz(H){var Z=typeof H;return Z=="string"||Z=="number"||Z=="symbol"||Z=="boolean"?H!=="__proto__":H===null}function Vz(H){return!!cn&&cn in H}function v2(H){var Z=H&&H.constructor,oe=typeof Z=="function"&&Z.prototype||de;return H===oe}function Hz(H){var Z=[];if(H!=null)for(var oe in Object(H))Z.push(oe);return Z}function Wz(H){return kt.call(H)}function qz(H,Z,oe){return Z=Tn(Z===void 0?H.length-1:Z,0),function(){for(var Re=arguments,ht=-1,Ot=Tn(Re.length-Z,0),Kt=Array(Ot);++ht<Ot;)Kt[ht]=Re[Z+ht];ht=-1;for(var yt=Array(Z+1);++ht<Z;)yt[ht]=Re[ht];return yt[Z]=oe(Kt),ie(H,this,yt)}}function N0(H,Z){if(!(Z==="constructor"&&typeof H[Z]=="function")&&Z!="__proto__")return H[Z]}var Uz=Gz(Mz);function Gz(H){var Z=0,oe=0;return function(){var Re=Nl(),ht=i-(Re-oe);if(oe=Re,ht>0){if(++Z>=o)return arguments[0]}else Z=0;return H.apply(void 0,arguments)}}function Yz(H){if(H!=null){try{return Ae.call(H)}catch{}try{return H+""}catch{}}return""}function zh(H,Z){return H===Z||H!==H&&Z!==Z}var I0=m2(function(){return arguments}())?m2:function(H){return Lu(H)&&Ee.call(H,"callee")&&!fn.call(H,"callee")},T0=Array.isArray;function O0(H){return H!=null&&w2(H.length)&&!j0(H)}function Kz(H){return Lu(H)&&O0(H)}var x2=Yr||eB;function j0(H){if(!na(H))return!1;var Z=Lh(H);return Z==h||Z==p||Z==c||Z==x}function w2(H){return typeof H=="number"&&H>-1&&H%1==0&&H<=s}function na(H){var Z=typeof H;return H!=null&&(Z=="object"||Z=="function")}function Lu(H){return H!=null&&typeof H=="object"}function Xz(H){if(!Lu(H)||Lh(H)!=v)return!1;var Z=Dt(H);if(Z===null)return!0;var oe=Ee.call(Z,"constructor")&&Z.constructor;return typeof oe=="function"&&oe instanceof oe&&Ae.call(oe)==ne}var S2=Q?ce(Q):Rz;function Qz(H){return Oz(H,C2(H))}function C2(H){return O0(H)?Sz(H):kz(H)}var Zz=jz(function(H,Z,oe){b2(H,Z,oe)});function Jz(H){return function(){return H}}function _2(H){return H}function eB(){return!1}e.exports=Zz})(Rg,Rg.exports);var TV=Rg.exports;const Zd=Vs(TV),OV={theme:"system",setTheme:()=>null},NN=R.createContext(OV);function jV({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=R.useState(()=>localStorage.getItem(n)||t);R.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return g.jsx(NN.Provider,{...r,value:s,children:e})}const IN=()=>{const e=R.useContext(NN);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var cu=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(){}},nl=typeof window>"u"||"Deno"in globalThis;function Zr(){}function FV(e,t){return typeof e=="function"?e(t):e}function hx(e){return typeof e=="number"&&e>=0&&e!==1/0}function TN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function uc(e,t){return typeof e=="function"?e(t):e}function vo(e,t){return typeof e=="function"?e(t):e}function U2(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==cS(s,t.options))return!1}else if(!ef(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function G2(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Jd(t.options.mutationKey)!==Jd(i))return!1}else if(!ef(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function cS(e,t){return((t==null?void 0:t.queryKeyHashFn)||Jd)(e)}function Jd(e){return JSON.stringify(e,(t,n)=>gx(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function ef(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!ef(e[n],t[n])):!1}function kg(e,t){if(e===t)return e;const n=Y2(e)&&Y2(t);if(n||gx(e)&&gx(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=kg(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function px(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Y2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function gx(e){if(!K2(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!K2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function K2(e){return Object.prototype.toString.call(e)==="[object Object]"}function LV(e){return new Promise(t=>{setTimeout(t,e)})}function mx(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return kg(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return kg(e,t)}return t}function $V(e){return e}function zV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function BV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Pg=Symbol();function ON(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Pg&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Pg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Ma,hs,Cc,JA,VV=(JA=class extends cu{constructor(){super();je(this,Ma);je(this,hs);je(this,Cc);we(this,Cc,t=>{if(!nl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){K(this,hs)||this.setEventListener(K(this,Cc))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,hs))==null||t.call(this),we(this,hs,void 0))}setEventListener(t){var n;we(this,Cc,t),(n=K(this,hs))==null||n.call(this),we(this,hs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){K(this,Ma)!==t&&(we(this,Ma,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof K(this,Ma)=="boolean"?K(this,Ma):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ma=new WeakMap,hs=new WeakMap,Cc=new WeakMap,JA),uS=new VV,_c,ps,Ec,eN,HV=(eN=class extends cu{constructor(){super();je(this,_c,!0);je(this,ps);je(this,Ec);we(this,Ec,t=>{if(!nl&&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(){K(this,ps)||this.setEventListener(K(this,Ec))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,ps))==null||t.call(this),we(this,ps,void 0))}setEventListener(t){var n;we(this,Ec,t),(n=K(this,ps))==null||n.call(this),we(this,ps,t(this.setOnline.bind(this)))}setOnline(t){K(this,_c)!==t&&(we(this,_c,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return K(this,_c)}},_c=new WeakMap,ps=new WeakMap,Ec=new WeakMap,eN),Dg=new HV;function bx(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function WV(e){return Math.min(1e3*2**e,3e4)}function jN(e){return(e??"online")==="online"?Dg.isOnline():!0}var FN=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Y0(e){return e instanceof FN}function LN(e){let t=!1,n=0,r=!1,o;const i=bx(),s=m=>{var b;r||(f(new FN(m)),(b=e.abort)==null||b.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>uS.isFocused()&&(e.networkMode==="always"||Dg.isOnline())&&e.canRun(),u=()=>jN(e.networkMode)&&e.canRun(),d=m=>{var b;r||(r=!0,(b=e.onSuccess)==null||b.call(e,m),o==null||o(),i.resolve(m))},f=m=>{var b;r||(r=!0,(b=e.onError)==null||b.call(e,m),o==null||o(),i.reject(m))},h=()=>new Promise(m=>{var b;o=y=>{(r||c())&&m(y)},(b=e.onPause)==null||b.call(e)}).then(()=>{var m;o=void 0,r||(m=e.onContinue)==null||m.call(e)}),p=()=>{if(r)return;let m;const b=n===0?e.initialPromise:void 0;try{m=b??e.fn()}catch(y){m=Promise.reject(y)}Promise.resolve(m).then(d).catch(y=>{var w;if(r)return;const v=e.retry??(nl?0:3),x=e.retryDelay??WV,E=typeof x=="function"?x(n,y):x,C=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,y);if(t||!C){f(y);return}n++,(w=e.onFail)==null||w.call(e,n,y),LV(E).then(()=>c()?void 0:h()).then(()=>{t?f(y):p()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?p():h().then(p),i)}}function qV(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var An=qV(),Aa,tN,$N=(tN=class{constructor(){je(this,Aa)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),hx(this.gcTime)&&we(this,Aa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(nl?1/0:5*60*1e3))}clearGcTimeout(){K(this,Aa)&&(clearTimeout(K(this,Aa)),we(this,Aa,void 0))}},Aa=new WeakMap,tN),Rc,kc,Qr,Na,Wn,Bf,Ia,bo,Ei,nN,UV=(nN=class extends $N{constructor(t){super();je(this,bo);je(this,Rc);je(this,kc);je(this,Qr);je(this,Na);je(this,Wn);je(this,Bf);je(this,Ia);we(this,Ia,!1),we(this,Bf,t.defaultOptions),this.setOptions(t.options),this.observers=[],we(this,Na,t.client),we(this,Qr,K(this,Na).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,we(this,Rc,GV(this.options)),this.state=t.state??K(this,Rc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=K(this,Wn))==null?void 0:t.promise}setOptions(t){this.options={...K(this,Bf),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&K(this,Qr).remove(this)}setData(t,n){const r=mx(this.state.data,t,this.options);return ut(this,bo,Ei).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ut(this,bo,Ei).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=K(this,Wn))==null?void 0:r.promise;return(o=K(this,Wn))==null||o.cancel(t),n?n.then(Zr).catch(Zr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(K(this,Rc))}isActive(){return this.observers.some(t=>vo(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Pg||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!TN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,Wn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,Wn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),K(this,Qr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(K(this,Wn)&&(K(this,Ia)?K(this,Wn).cancel({revert:!0}):K(this,Wn).cancelRetry()),this.scheduleGc()),K(this,Qr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ut(this,bo,Ei).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(K(this,Wn))return K(this,Wn).continueRetry(),K(this,Wn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(we(this,Ia,!0),r.signal)})},i=()=>{const d=ON(this.options,n),f={client:K(this,Na),queryKey:this.queryKey,meta:this.meta};return o(f),we(this,Ia,!1),this.options.persister?this.options.persister(d,f,this):d(f)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:K(this,Na),state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),we(this,kc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&ut(this,bo,Ei).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var f,h,p,m;Y0(d)&&d.silent||ut(this,bo,Ei).call(this,{type:"error",error:d}),Y0(d)||((h=(f=K(this,Qr).config).onError)==null||h.call(f,d,this),(m=(p=K(this,Qr).config).onSettled)==null||m.call(p,this.state.data,d,this)),this.scheduleGc()};return we(this,Wn,LN({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var f,h,p,m;if(d===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(b){a(b);return}(h=(f=K(this,Qr).config).onSuccess)==null||h.call(f,d,this),(m=(p=K(this,Qr).config).onSettled)==null||m.call(p,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,f)=>{ut(this,bo,Ei).call(this,{type:"failed",failureCount:d,error:f})},onPause:()=>{ut(this,bo,Ei).call(this,{type:"pause"})},onContinue:()=>{ut(this,bo,Ei).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),K(this,Wn).start()}},Rc=new WeakMap,kc=new WeakMap,Qr=new WeakMap,Na=new WeakMap,Wn=new WeakMap,Bf=new WeakMap,Ia=new WeakMap,bo=new WeakSet,Ei=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,...zN(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Y0(o)&&o.revert&&K(this,kc)?{...K(this,kc),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),An.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),K(this,Qr).notify({query:this,type:"updated",action:t})})},nN);function zN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function GV(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Vo,rN,BN=(rN=class extends cu{constructor(t={}){super();je(this,Vo);this.config=t,we(this,Vo,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??cS(o,n);let s=this.get(i);return s||(s=new UV({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){K(this,Vo).has(t.queryHash)||(K(this,Vo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=K(this,Vo).get(t.queryHash);n&&(t.destroy(),n===t&&K(this,Vo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){An.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return K(this,Vo).get(t)}getAll(){return[...K(this,Vo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>U2(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>U2(t,r)):n}notify(t){An.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){An.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){An.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Vo=new WeakMap,rN),Ho,rr,Ta,Wo,cs,oN,YV=(oN=class extends $N{constructor(t){super();je(this,Wo);je(this,Ho);je(this,rr);je(this,Ta);this.mutationId=t.mutationId,we(this,rr,t.mutationCache),we(this,Ho,[]),this.state=t.state||KV(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){K(this,Ho).includes(t)||(K(this,Ho).push(t),this.clearGcTimeout(),K(this,rr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){we(this,Ho,K(this,Ho).filter(n=>n!==t)),this.scheduleGc(),K(this,rr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){K(this,Ho).length||(this.state.status==="pending"?this.scheduleGc():K(this,rr).remove(this))}continue(){var t;return((t=K(this,Ta))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,f,h,p,m,b,y,v,x,E,C,w,_;we(this,Ta,LN({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,M)=>{ut(this,Wo,cs).call(this,{type:"failed",failureCount:k,error:M})},onPause:()=>{ut(this,Wo,cs).call(this,{type:"pause"})},onContinue:()=>{ut(this,Wo,cs).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>K(this,rr).canRun(this)}));const n=this.state.status==="pending",r=!K(this,Ta).canStart();try{if(!n){ut(this,Wo,cs).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=K(this,rr).config).onMutate)==null?void 0:i.call(o,t,this));const M=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));M!==this.state.context&&ut(this,Wo,cs).call(this,{type:"pending",context:M,variables:t,isPaused:r})}const k=await K(this,Ta).start();return await((c=(l=K(this,rr).config).onSuccess)==null?void 0:c.call(l,k,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,k,t,this.state.context)),await((h=(f=K(this,rr).config).onSettled)==null?void 0:h.call(f,k,null,this.state.variables,this.state.context,this)),await((m=(p=this.options).onSettled)==null?void 0:m.call(p,k,null,t,this.state.context)),ut(this,Wo,cs).call(this,{type:"success",data:k}),k}catch(k){try{throw await((y=(b=K(this,rr).config).onError)==null?void 0:y.call(b,k,t,this.state.context,this)),await((x=(v=this.options).onError)==null?void 0:x.call(v,k,t,this.state.context)),await((C=(E=K(this,rr).config).onSettled)==null?void 0:C.call(E,void 0,k,this.state.variables,this.state.context,this)),await((_=(w=this.options).onSettled)==null?void 0:_.call(w,void 0,k,t,this.state.context)),k}finally{ut(this,Wo,cs).call(this,{type:"error",error:k})}}finally{K(this,rr).runNext(this)}}},Ho=new WeakMap,rr=new WeakMap,Ta=new WeakMap,Wo=new WeakSet,cs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),An.batch(()=>{K(this,Ho).forEach(r=>{r.onMutationUpdate(t)}),K(this,rr).notify({mutation:this,type:"updated",action:t})})},oN);function KV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ai,yo,Vf,iN,XV=(iN=class extends cu{constructor(t={}){super();je(this,Ai);je(this,yo);je(this,Vf);this.config=t,we(this,Ai,new Set),we(this,yo,new Map),we(this,Vf,0)}build(t,n,r){const o=new YV({mutationCache:this,mutationId:++Bh(this,Vf)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){K(this,Ai).add(t);const n=Wh(t);if(typeof n=="string"){const r=K(this,yo).get(n);r?r.push(t):K(this,yo).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(K(this,Ai).delete(t)){const n=Wh(t);if(typeof n=="string"){const r=K(this,yo).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&K(this,yo).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Wh(t);if(typeof n=="string"){const r=K(this,yo).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Wh(t);if(typeof n=="string"){const o=(r=K(this,yo).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){An.batch(()=>{K(this,Ai).forEach(t=>{this.notify({type:"removed",mutation:t})}),K(this,Ai).clear(),K(this,yo).clear()})}getAll(){return Array.from(K(this,Ai))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>G2(n,r))}findAll(t={}){return this.getAll().filter(n=>G2(t,n))}notify(t){An.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return An.batch(()=>Promise.all(t.map(n=>n.continue().catch(Zr))))}},Ai=new WeakMap,yo=new WeakMap,Vf=new WeakMap,iN);function Wh(e){var t;return(t=e.options.scope)==null?void 0:t.id}function X2(e){return{onFetch:(t,n)=>{var u,d,f,h,p;const r=t.options,o=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],s=((p=t.state.data)==null?void 0:p.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let m=!1;const b=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},y=ON(t.options,t.fetchOptions),v=async(x,E,C)=>{if(m)return Promise.reject();if(E==null&&x.pages.length)return Promise.resolve(x);const w={client:t.client,queryKey:t.queryKey,pageParam:E,direction:C?"backward":"forward",meta:t.options.meta};b(w);const _=await y(w),{maxPages:k}=t.options,M=C?BV:zV;return{pages:M(x.pages,_,k),pageParams:M(x.pageParams,E,k)}};if(o&&i.length){const x=o==="backward",E=x?QV:Q2,C={pages:i,pageParams:s},w=E(r,C);a=await v(C,w,x)}else{const x=e??i.length;do{const E=l===0?s[0]??r.initialPageParam:Q2(r,a);if(l>0&&E==null)break;a=await v(a,E),l++}while(l<x)}return a};t.options.persister?t.fetchFn=()=>{var m,b;return(b=(m=t.options).persister)==null?void 0:b.call(m,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Q2(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function QV(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var tn,gs,ms,Pc,Dc,bs,Mc,Ac,sN,ZV=(sN=class{constructor(e={}){je(this,tn);je(this,gs);je(this,ms);je(this,Pc);je(this,Dc);je(this,bs);je(this,Mc);je(this,Ac);we(this,tn,e.queryCache||new BN),we(this,gs,e.mutationCache||new XV),we(this,ms,e.defaultOptions||{}),we(this,Pc,new Map),we(this,Dc,new Map),we(this,bs,0)}mount(){Bh(this,bs)._++,K(this,bs)===1&&(we(this,Mc,uS.subscribe(async e=>{e&&(await this.resumePausedMutations(),K(this,tn).onFocus())})),we(this,Ac,Dg.subscribe(async e=>{e&&(await this.resumePausedMutations(),K(this,tn).onOnline())})))}unmount(){var e,t;Bh(this,bs)._--,K(this,bs)===0&&((e=K(this,Mc))==null||e.call(this),we(this,Mc,void 0),(t=K(this,Ac))==null||t.call(this),we(this,Ac,void 0))}isFetching(e){return K(this,tn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return K(this,gs).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=K(this,tn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=K(this,tn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(uc(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return K(this,tn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=K(this,tn).get(r.queryHash),i=o==null?void 0:o.state.data,s=FV(t,i);if(s!==void 0)return K(this,tn).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return An.batch(()=>K(this,tn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=K(this,tn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=K(this,tn);An.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=K(this,tn);return An.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=An.batch(()=>K(this,tn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Zr).catch(Zr)}invalidateQueries(e,t={}){return An.batch(()=>(K(this,tn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=An.batch(()=>K(this,tn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Zr)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Zr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=K(this,tn).build(this,t);return n.isStaleByTime(uc(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Zr).catch(Zr)}fetchInfiniteQuery(e){return e.behavior=X2(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Zr).catch(Zr)}ensureInfiniteQueryData(e){return e.behavior=X2(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Dg.isOnline()?K(this,gs).resumePausedMutations():Promise.resolve()}getQueryCache(){return K(this,tn)}getMutationCache(){return K(this,gs)}getDefaultOptions(){return K(this,ms)}setDefaultOptions(e){we(this,ms,e)}setQueryDefaults(e,t){K(this,Pc).set(Jd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...K(this,Pc).values()],n={};return t.forEach(r=>{ef(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){K(this,Dc).set(Jd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...K(this,Dc).values()],n={};return t.forEach(r=>{ef(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...K(this,ms).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=cS(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Pg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...K(this,ms).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){K(this,tn).clear(),K(this,gs).clear()}},tn=new WeakMap,gs=new WeakMap,ms=new WeakMap,Pc=new WeakMap,Dc=new WeakMap,bs=new WeakMap,Mc=new WeakMap,Ac=new WeakMap,sN),xr,dt,Hf,or,Oa,Nc,ys,qo,Wf,Ic,Tc,ja,Fa,vs,Oc,Rt,id,yx,vx,xx,wx,Sx,Cx,_x,HN,aN,VN=(aN=class extends cu{constructor(t,n){super();je(this,Rt);je(this,xr);je(this,dt);je(this,Hf);je(this,or);je(this,Oa);je(this,Nc);je(this,ys);je(this,qo);je(this,Wf);je(this,Ic);je(this,Tc);je(this,ja);je(this,Fa);je(this,vs);je(this,Oc,new Set);this.options=n,we(this,xr,t),we(this,qo,null),we(this,ys,bx()),this.options.experimental_prefetchInRender||K(this,ys).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(K(this,dt).addObserver(this),Z2(K(this,dt),this.options)?ut(this,Rt,id).call(this):this.updateResult(),ut(this,Rt,wx).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ex(K(this,dt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ex(K(this,dt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ut(this,Rt,Sx).call(this),ut(this,Rt,Cx).call(this),K(this,dt).removeObserver(this)}setOptions(t,n){const r=this.options,o=K(this,dt);if(this.options=K(this,xr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof vo(this.options.enabled,K(this,dt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ut(this,Rt,_x).call(this),K(this,dt).setOptions(this.options),r._defaulted&&!px(this.options,r)&&K(this,xr).getQueryCache().notify({type:"observerOptionsUpdated",query:K(this,dt),observer:this});const i=this.hasListeners();i&&J2(K(this,dt),o,this.options,r)&&ut(this,Rt,id).call(this),this.updateResult(n),i&&(K(this,dt)!==o||vo(this.options.enabled,K(this,dt))!==vo(r.enabled,K(this,dt))||uc(this.options.staleTime,K(this,dt))!==uc(r.staleTime,K(this,dt)))&&ut(this,Rt,yx).call(this);const s=ut(this,Rt,vx).call(this);i&&(K(this,dt)!==o||vo(this.options.enabled,K(this,dt))!==vo(r.enabled,K(this,dt))||s!==K(this,vs))&&ut(this,Rt,xx).call(this,s)}getOptimisticResult(t){const n=K(this,xr).getQueryCache().build(K(this,xr),t),r=this.createResult(n,t);return eH(this,r)&&(we(this,or,r),we(this,Nc,this.options),we(this,Oa,K(this,dt).state)),r}getCurrentResult(){return K(this,or)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){K(this,Oc).add(t)}getCurrentQuery(){return K(this,dt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=K(this,xr).defaultQueryOptions(t),r=K(this,xr).getQueryCache().build(K(this,xr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ut(this,Rt,id).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),K(this,or)))}createResult(t,n){var k;const r=K(this,dt),o=this.options,i=K(this,or),s=K(this,Oa),a=K(this,Nc),c=t!==r?t.state:K(this,Hf),{state:u}=t;let d={...u},f=!1,h;if(n._optimisticResults){const M=this.hasListeners(),P=!M&&Z2(t,n),A=M&&J2(t,r,n,o);(P||A)&&(d={...d,...zN(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:b}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(s==null?void 0:s.data)&&n.select===K(this,Wf))h=K(this,Ic);else try{we(this,Wf,n.select),h=n.select(d.data),h=mx(i==null?void 0:i.data,h,n),we(this,Ic,h),we(this,qo,null)}catch(M){we(this,qo,M)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&b==="pending"){let M;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))M=i.data;else if(M=typeof n.placeholderData=="function"?n.placeholderData((k=K(this,Tc))==null?void 0:k.state.data,K(this,Tc)):n.placeholderData,n.select&&M!==void 0)try{M=n.select(M),we(this,qo,null)}catch(P){we(this,qo,P)}M!==void 0&&(b="success",h=mx(i==null?void 0:i.data,M,n),f=!0)}K(this,qo)&&(p=K(this,qo),h=K(this,Ic),m=Date.now(),b="error");const y=d.fetchStatus==="fetching",v=b==="pending",x=b==="error",E=v&&y,C=h!==void 0,_={status:b,fetchStatus:d.fetchStatus,isPending:v,isSuccess:b==="success",isError:x,isInitialLoading:E,isLoading:E,data:h,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:m,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:y,isRefetching:y&&!v,isLoadingError:x&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&C,isStale:dS(t,n),refetch:this.refetch,promise:K(this,ys)};if(this.options.experimental_prefetchInRender){const M=T=>{_.status==="error"?T.reject(_.error):_.data!==void 0&&T.resolve(_.data)},P=()=>{const T=we(this,ys,_.promise=bx());M(T)},A=K(this,ys);switch(A.status){case"pending":t.queryHash===r.queryHash&&M(A);break;case"fulfilled":(_.status==="error"||_.data!==A.value)&&P();break;case"rejected":(_.status!=="error"||_.error!==A.reason)&&P();break}}return _}updateResult(t){const n=K(this,or),r=this.createResult(K(this,dt),this.options);if(we(this,Oa,K(this,dt).state),we(this,Nc,this.options),K(this,Oa).data!==void 0&&we(this,Tc,K(this,dt)),px(r,n))return;we(this,or,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!K(this,Oc).size)return!0;const l=new Set(a??K(this,Oc));return this.options.throwOnError&&l.add("error"),Object.keys(K(this,or)).some(c=>{const u=c;return K(this,or)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),ut(this,Rt,HN).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ut(this,Rt,wx).call(this)}},xr=new WeakMap,dt=new WeakMap,Hf=new WeakMap,or=new WeakMap,Oa=new WeakMap,Nc=new WeakMap,ys=new WeakMap,qo=new WeakMap,Wf=new WeakMap,Ic=new WeakMap,Tc=new WeakMap,ja=new WeakMap,Fa=new WeakMap,vs=new WeakMap,Oc=new WeakMap,Rt=new WeakSet,id=function(t){ut(this,Rt,_x).call(this);let n=K(this,dt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Zr)),n},yx=function(){ut(this,Rt,Sx).call(this);const t=uc(this.options.staleTime,K(this,dt));if(nl||K(this,or).isStale||!hx(t))return;const r=TN(K(this,or).dataUpdatedAt,t)+1;we(this,ja,setTimeout(()=>{K(this,or).isStale||this.updateResult()},r))},vx=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(K(this,dt)):this.options.refetchInterval)??!1},xx=function(t){ut(this,Rt,Cx).call(this),we(this,vs,t),!(nl||vo(this.options.enabled,K(this,dt))===!1||!hx(K(this,vs))||K(this,vs)===0)&&we(this,Fa,setInterval(()=>{(this.options.refetchIntervalInBackground||uS.isFocused())&&ut(this,Rt,id).call(this)},K(this,vs)))},wx=function(){ut(this,Rt,yx).call(this),ut(this,Rt,xx).call(this,ut(this,Rt,vx).call(this))},Sx=function(){K(this,ja)&&(clearTimeout(K(this,ja)),we(this,ja,void 0))},Cx=function(){K(this,Fa)&&(clearInterval(K(this,Fa)),we(this,Fa,void 0))},_x=function(){const t=K(this,xr).getQueryCache().build(K(this,xr),this.options);if(t===K(this,dt))return;const n=K(this,dt);we(this,dt,t),we(this,Hf,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},HN=function(t){An.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(K(this,or))}),K(this,xr).getQueryCache().notify({query:K(this,dt),type:"observerResultsUpdated"})})},aN);function JV(e,t){return vo(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Z2(e,t){return JV(e,t)||e.state.data!==void 0&&Ex(e,t,t.refetchOnMount)}function Ex(e,t,n){if(vo(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&dS(e,t)}return!1}function J2(e,t,n,r){return(e!==t||vo(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&dS(e,n)}function dS(e,t){return vo(t.enabled,e)!==!1&&e.isStaleByTime(uc(t.staleTime,e))}function eH(e,t){return!px(e.getCurrentResult(),t)}var fS=S.createContext(void 0),uu=e=>{const t=S.useContext(fS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},tH=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(fS.Provider,{value:e,children:t})),WN=S.createContext(!1),qN=()=>S.useContext(WN);WN.Provider;function nH(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var rH=S.createContext(nH()),UN=()=>S.useContext(rH);function oH(e,t){return typeof e=="function"?e(...t):!!e}function Rx(){}var GN=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},YN=e=>{S.useEffect(()=>{e.clearReset()},[e])},KN=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||oH(n,[e.error,r])),XN=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},QN=(e,t)=>e.isLoading&&e.isFetching&&!t,ZN=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,kx=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function iH(e,t,n){var d,f,h,p,m;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=uu(),o=qN(),i=UN(),s=r.defaultQueryOptions(e);(f=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,s),process.env.NODE_ENV!=="production"&&(s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),s._optimisticResults=o?"isRestoring":"optimistic",XN(s),GN(s,i),YN(i);const a=!r.getQueryCache().get(s.queryHash),[l]=S.useState(()=>new t(r,s)),c=l.getOptimisticResult(s),u=!o&&e.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(b=>{const y=u?l.subscribe(An.batchCalls(b)):Rx;return l.updateResult(),y},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),S.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),ZN(s,c))throw kx(s,l,i);if(KN({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw c.error;if((p=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||p.call(h,s,c),s.experimental_prefetchInRender&&!nl&&QN(c,o)){const b=a?kx(s,l,i):(m=r.getQueryCache().get(s.queryHash))==null?void 0:m.promise;b==null||b.catch(Rx).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function ro(e,t){return iH(e,VN)}function sH(){const e=R.useContext(fS);if(e&&e.isSemaphorClient)return e}function JN({children:e}){const{setIsSessionExpired:t}=an(),n=sH(),[r]=R.useState(()=>{const o=new ZV({queryCache:new BN({onError:i=>{i instanceof Error?(console.error(`Something went wrong: ${i.message}`),i.message==="invalid token"&&t(!0)):console.error("Something went wrong:",i)}}),defaultOptions:{queries:{gcTime:36e5,staleTime:3e5,refetchOnWindowFocus:!1,retry:1}}});return o.isSemaphorClient=!0,o});return n?g.jsx(g.Fragment,{children:e}):g.jsx(tH,{client:r,children:e})}const Hs=R.forwardRef(({children:e,className:t,...n},r)=>g.jsx("div",{className:se("semaphor-scope",t),ref:r,...n,children:e})),aH={id:"",authToken:void 0},eI=R.createContext(aH),tI=({children:e,dashboardProps:t})=>g.jsx(JN,{children:g.jsx(eI.Provider,{value:t,children:g.jsx(Hs,{style:{height:"100%"},children:e})})});function Jn(){const e=R.useContext(eI);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function lH(){const{authToken:e,version:t}=Jn(),n=re(l=>l.selectedLensId);function r(){if(!(e!=null&&e.accessToken))return!1}const{data:o,isLoading:i,isFetching:s,isError:a}=ro({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>AV(e==null?void 0:e.accessToken,{lensId:n,version:t}),enabled:r()});return{data:o,isLoading:i,isFetching:s,isError:a}}function cH(){const{authToken:e}=Jn(),t=re(r=>r.authToken),{setAuthToken:n}=an();return R.useEffect(()=>{e&&(e==null?void 0:e.toString())!==(t==null?void 0:t.toString())&&n(e)},[e,t,n]),e}const nI=(e,t)=>{const n={};if(e===null||t===null)return t;const r=new Set([...Object.keys(e),...Object.keys(t)]);for(const o of r){if(!(o in e)&&o in t){n[o]=t[o];continue}if(o in e&&!(o in t)){n[o]=void 0;continue}const i=e[o],s=t[o];if(!Px(i,s))if(Array.isArray(i)&&Array.isArray(s))n[o]=s;else if(eR(i)&&eR(s)){const a=nI(i,s);Object.keys(a).length>0&&(n[o]=a)}else n[o]=s}return n},Px=(e,t)=>{if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((o,i)=>Px(o,t[i]));const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(o=>Px(e[o],t[o]))}return!1},eR=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),tf=e=>{if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(n=>tf(n));const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=tf(e[n]));return t};function rI(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function tR(e,t){const n=rI(e);return n==="dark"?Zd({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function uH({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,selectedSheetId:i,onFilterValuesChange:s}){const{authToken:a}=Jn();cH();const l=re(O=>O.selectedLensId),{data:c,isLoading:u,isFetching:d,isError:f}=lH(),[h,p]=R.useState(o||[]),{theme:m,setTheme:b}=IN(),y=re(O=>O.dashboard.globalStyle),{setDashboard:v,setDashboardWithFilterValues:x,setSelectedSheetId:E,setStyle:C,setOnSaveFunction:w,setLenses:_,setSelectedLensId:k,setInitStore:M}=an();re(O=>O.actions.setCustomCards);const P=re(O=>O.actions.setFilterValues),A=re(O=>O.filterValues),T=re(O=>O.actions.setThemeStyle),F=re(O=>O.actions.setDashboardTheme),L=re(O=>O.actions.setOnEvent);R.useEffect(()=>{a&&M()},[a,M]),R.useEffect(()=>{if(m){const O=rI(m);F(O)}},[m,F]),R.useEffect(()=>{t&&b(t)},[t,b]);const I=R.useCallback(()=>{const O=tf(Eg),j=Zd(O,y);if(e){const z=Zd(j,e),B=tR(m,z);T(B),C(z)}else{const z=tR(m,j);T(z),C(Eg)}},[m,e,y,T,C]);return R.useEffect(()=>{c&&c.dashboard&&I()},[m,e,y,I,c]),R.useEffect(()=>{var $,D;function O(V,G){const U=V.filters||[],W=[];for(const Y of G){const X=U.find(J=>J.id===Y.filterId);X&&W.push({filterId:Y.filterId,connectionType:X.database==="NA"?"api":"database",name:X.column,operation:X.operation,valueType:cc(X),values:Y.values})}return W}if(!c||!c.dashboard)return;const{dashboard:j,filterValues:z,defaultLensId:B,lenses:N}=c;function q(){var G;if(z&&(z==null?void 0:z.length)>0)return z;const V=O(j,h||[]);return V&&(V==null?void 0:V.length)>0?V:j.defaultFilterValues&&((G=j.defaultFilterValues)==null?void 0:G.length)>0?j.defaultFilterValues:[]}x(j,q()),N&&_(N),B&&k(B),E(i||((D=($=j==null?void 0:j.sheets)==null?void 0:$[0])==null?void 0:D.id)||null)},[c,v,E,P,l,_,x,k,h,i]),R.useEffect(()=>{s&&A&&s(A)},[A,s]),R.useEffect(()=>{n&&w(n),r&&L(r)},[n,w,r,L]),{isFetching:d,isLoading:u,isError:f}}function Hi({className:e,...t}){return g.jsx("div",{className:se("animate-pulse rounded-md bg-muted",e),...t})}const oI=S.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:se("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));oI.displayName="Card";const Ym=S.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:se("flex flex-col space-y-1.5 p-6",e),...t}));Ym.displayName="CardHeader";const du=S.forwardRef(({className:e,...t},n)=>g.jsx("h3",{ref:n,className:se("text-2xl font-semibold leading-none tracking-tight",e),...t}));du.displayName="CardTitle";const hS=S.forwardRef(({className:e,...t},n)=>g.jsx("p",{ref:n,className:se("text-sm text-muted-foreground",e),...t}));hS.displayName="CardDescription";const pS=S.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:se("px-6 pt-0",e),...t}));pS.displayName="CardContent";const iI=S.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:se("flex items-center p-6 pt-0",e),...t}));iI.displayName="CardFooter";function sI({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:f,defaultFilterValues:h,onFilterValuesChange:p,selectedSheetId:m,eventHandlers:b,...y}){const{placeholders:v}=Jn(),x=re(_=>_.themeStyle),E=re(_=>_.isSessionExpired),{isLoading:C,isError:w}=uH({customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:h,onFilterValuesChange:p,selectedSheetId:m});return C||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?g.jsx(o,{message:"loading"}):g.jsx("div",{className:"flex items-center gap-3",children:g.jsx(Hi,{className:"h-1 w-full dark:h-[2px]"})})):w?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),g.jsx(i,{})):g.jsx("div",{children:"Error"})):E?(r==null||r({type:"error",message:"Session Expired"}),v!=null&&v.SessionExpired?g.jsx("div",{className:"flex h-full items-center justify-center",children:g.jsx("div",{children:v.SessionExpired})}):g.jsx("div",{className:"flex h-full items-center justify-center",children:g.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[g.jsx(du,{children:"Session Expired"}),g.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):g.jsx("div",{className:se("isolate flex h-full flex-col justify-between",x==null?void 0:x.dashboardPanel,e),style:{},"data-role":"dashboard-panel",...y})}function ue(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function dH(e,t){const n=S.createContext(t),r=i=>{const{children:s,...a}=i,l=S.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=S.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Pn(e,t=[]){let n=[];function r(i,s){const a=S.createContext(s),l=n.length;n=[...n,s];const c=d=>{var y;const{scope:f,children:h,...p}=d,m=((y=f==null?void 0:f[e])==null?void 0:y[l])||a,b=S.useMemo(()=>p,Object.values(p));return g.jsx(m.Provider,{value:b,children:h})};c.displayName=i+"Provider";function u(d,f){var m;const h=((m=f==null?void 0:f[e])==null?void 0:m[l])||a,p=S.useContext(h);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>S.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,fH(o,...t)]}function fH(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function nR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function To(...e){return t=>{let n=!1;const r=e.map(o=>{const i=nR(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():nR(e[o],null)}}}}function Be(...e){return S.useCallback(To(...e),e)}var Dx=S.forwardRef((e,t)=>{const{children:n,...r}=e,o=S.Children.toArray(n),i=o.find(pH);if(i){const s=i.props.children,a=o.map(l=>l===i?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:l);return g.jsx(Mx,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return g.jsx(Mx,{...r,ref:t,children:n})});Dx.displayName="Slot";var Mx=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const o=mH(n),i=gH(r,n.props);return n.type!==S.Fragment&&(i.ref=t?To(t,o):o),S.cloneElement(n,i)}return S.Children.count(n)>1?S.Children.only(null):null});Mx.displayName="SlotClone";var hH=({children:e})=>g.jsx(g.Fragment,{children:e});function pH(e){return S.isValidElement(e)&&e.type===hH}function gH(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function mH(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Km(e){const t=e+"CollectionProvider",[n,r]=Pn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:p,children:m}=h,b=R.useRef(null),y=R.useRef(new Map).current;return g.jsx(o,{scope:p,itemMap:y,collectionRef:b,children:m})};s.displayName=t;const a=e+"CollectionSlot",l=R.forwardRef((h,p)=>{const{scope:m,children:b}=h,y=i(a,m),v=Be(p,y.collectionRef);return g.jsx(Dx,{ref:v,children:b})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=R.forwardRef((h,p)=>{const{scope:m,children:b,...y}=h,v=R.useRef(null),x=Be(p,v),E=i(c,m);return R.useEffect(()=>(E.itemMap.set(v,{ref:v,...y}),()=>void E.itemMap.delete(v))),g.jsx(Dx,{[u]:"",ref:x,children:b})});d.displayName=c;function f(h){const p=i(e+"CollectionConsumer",h);return R.useCallback(()=>{const b=p.collectionRef.current;if(!b)return[];const y=Array.from(b.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((E,C)=>y.indexOf(E.ref.current)-y.indexOf(C.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},f,r]}var $n=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},bH=S.useId||(()=>{}),yH=0;function Sn(e){const[t,n]=S.useState(bH());return $n(()=>{n(r=>r??String(yH++))},[e]),t?`radix-${t}`:""}var aI=S.forwardRef((e,t)=>{const{children:n,...r}=e,o=S.Children.toArray(n),i=o.find(xH);if(i){const s=i.props.children,a=o.map(l=>l===i?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:l);return g.jsx(Ax,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return g.jsx(Ax,{...r,ref:t,children:n})});aI.displayName="Slot";var Ax=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const o=SH(n),i=wH(r,n.props);return n.type!==S.Fragment&&(i.ref=t?To(t,o):o),S.cloneElement(n,i)}return S.Children.count(n)>1?S.Children.only(null):null});Ax.displayName="SlotClone";var vH=({children:e})=>g.jsx(g.Fragment,{children:e});function xH(e){return S.isValidElement(e)&&e.type===vH}function wH(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function SH(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var CH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ve=CH.reduce((e,t)=>{const n=S.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?aI:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function lI(e,t){e&&Za.flushSync(()=>e.dispatchEvent(t))}function kn(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Zn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=_H({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=kn(n),l=S.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function _H({defaultProp:e,onChange:t}){const n=S.useState(e),[r]=n,o=S.useRef(r),i=kn(t);return S.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var EH=S.createContext(void 0);function Sl(e){const t=S.useContext(EH);return e||t||"ltr"}var K0="rovingFocusGroup.onEntryFocus",RH={bubbles:!1,cancelable:!0},Xm="RovingFocusGroup",[Nx,cI,kH]=Km(Xm),[PH,fu]=Pn(Xm,[kH]),[DH,MH]=PH(Xm),uI=S.forwardRef((e,t)=>g.jsx(Nx.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Nx.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(AH,{...e,ref:t})})}));uI.displayName=Xm;var AH=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=S.useRef(null),h=Be(t,f),p=Sl(i),[m=null,b]=Zn({prop:s,defaultProp:a,onChange:l}),[y,v]=S.useState(!1),x=kn(c),E=cI(n),C=S.useRef(!1),[w,_]=S.useState(0);return S.useEffect(()=>{const k=f.current;if(k)return k.addEventListener(K0,x),()=>k.removeEventListener(K0,x)},[x]),g.jsx(DH,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:m,onItemFocus:S.useCallback(k=>b(k),[b]),onItemShiftTab:S.useCallback(()=>v(!0),[]),onFocusableItemAdd:S.useCallback(()=>_(k=>k+1),[]),onFocusableItemRemove:S.useCallback(()=>_(k=>k-1),[]),children:g.jsx(ve.div,{tabIndex:y||w===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:ue(e.onMouseDown,()=>{C.current=!0}),onFocus:ue(e.onFocus,k=>{const M=!C.current;if(k.target===k.currentTarget&&M&&!y){const P=new CustomEvent(K0,RH);if(k.currentTarget.dispatchEvent(P),!P.defaultPrevented){const A=E().filter(O=>O.focusable),T=A.find(O=>O.active),F=A.find(O=>O.id===m),I=[T,F,...A].filter(Boolean).map(O=>O.ref.current);hI(I,u)}}C.current=!1}),onBlur:ue(e.onBlur,()=>v(!1))})})}),dI="RovingFocusGroupItem",fI=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Sn(),l=i||a,c=MH(dI,n),u=c.currentTabStopId===l,d=cI(n),{onFocusableItemAdd:f,onFocusableItemRemove:h}=c;return S.useEffect(()=>{if(r)return f(),()=>h()},[r,f,h]),g.jsx(Nx.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:g.jsx(ve.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:ue(e.onMouseDown,p=>{r?c.onItemFocus(l):p.preventDefault()}),onFocus:ue(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:ue(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const m=TH(p,c.orientation,c.dir);if(m!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let y=d().filter(v=>v.focusable).map(v=>v.ref.current);if(m==="last")y.reverse();else if(m==="prev"||m==="next"){m==="prev"&&y.reverse();const v=y.indexOf(p.currentTarget);y=c.loop?OH(y,v+1):y.slice(v+1)}setTimeout(()=>hI(y))}})})})});fI.displayName=dI;var NH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function IH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function TH(e,t,n){const r=IH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return NH[r]}function hI(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function OH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var gS=uI,mS=fI;function jH(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var _n=e=>{const{present:t,children:n}=e,r=FH(t),o=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),i=Be(r.ref,LH(o));return typeof n=="function"||r.isPresent?S.cloneElement(o,{ref:i}):null};_n.displayName="Presence";function FH(e){const[t,n]=S.useState(),r=S.useRef({}),o=S.useRef(e),i=S.useRef("none"),s=e?"mounted":"unmounted",[a,l]=jH(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=qh(r.current);i.current=a==="mounted"?c:"none"},[a]),$n(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,h=qh(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),$n(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const m=qh(r.current).includes(h.animationName);if(h.target===t&&m&&(l("ANIMATION_END"),!o.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},f=h=>{h.target===t&&(i.current=qh(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:S.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function qh(e){return(e==null?void 0:e.animationName)||"none"}function LH(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var bS="Tabs",[$H,xMe]=Pn(bS,[fu]),pI=fu(),[zH,yS]=$H(bS),gI=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Sl(a),[d,f]=Zn({prop:r,onChange:o,defaultProp:i});return g.jsx(zH,{scope:n,baseId:Sn(),value:d,onValueChange:f,orientation:s,dir:u,activationMode:l,children:g.jsx(ve.div,{dir:u,"data-orientation":s,...c,ref:t})})});gI.displayName=bS;var mI="TabsList",bI=S.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=yS(mI,n),s=pI(n);return g.jsx(gS,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:g.jsx(ve.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});bI.displayName=mI;var yI="TabsTrigger",vI=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=yS(yI,n),a=pI(n),l=SI(s.baseId,r),c=CI(s.baseId,r),u=r===s.value;return g.jsx(mS,{asChild:!0,...a,focusable:!o,active:u,children:g.jsx(ve.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:ue(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:ue(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:ue(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!o&&d&&s.onValueChange(r)})})})});vI.displayName=yI;var xI="TabsContent",wI=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=yS(xI,n),l=SI(a.baseId,r),c=CI(a.baseId,r),u=r===a.value,d=S.useRef(u);return S.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),g.jsx(_n,{present:o||u,children:({present:f})=>g.jsx(ve.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&i})})});wI.displayName=xI;function SI(e,t){return`${e}-trigger-${t}`}function CI(e,t){return`${e}-content-${t}`}var BH=gI,_I=bI,EI=vI,RI=wI;const Qm=BH,Uf=S.forwardRef(({className:e,...t},n)=>g.jsx(_I,{ref:n,className:se("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Uf.displayName=_I.displayName;const ws=S.forwardRef(({className:e,...t},n)=>g.jsx(EI,{ref:n,className:se("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}));ws.displayName=EI.displayName;const Sa=S.forwardRef(({className:e,...t},n)=>g.jsx(RI,{ref:n,className:se("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Sa.displayName=RI.displayName;var kI={exports:{}},Gf={},Ix={exports:{}};(function(e,t){(function(n,r){r(t)})(ji,function(n){function r(Y){return function(J,te,Q,ie,ee,ce,fe){return Y(J,te,fe)}}function o(Y){return function(J,te,Q,ie){if(!J||!te||typeof J!="object"||typeof te!="object")return Y(J,te,Q,ie);var ee=ie.get(J),ce=ie.get(te);if(ee&&ce)return ee===te&&ce===J;ie.set(J,te),ie.set(te,J);var fe=Y(J,te,Q,ie);return ie.delete(J),ie.delete(te),fe}}function i(Y,X){var J={};for(var te in Y)J[te]=Y[te];for(var te in X)J[te]=X[te];return J}function s(Y){return Y.constructor===Object||Y.constructor==null}function a(Y){return typeof Y.then=="function"}function l(Y,X){return Y===X||Y!==Y&&X!==X}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",f="[object RegExp]",h="[object Map]",p="[object Number]",m="[object Object]",b="[object Set]",y="[object String]",v=Object.prototype.toString;function x(Y){var X=Y.areArraysEqual,J=Y.areDatesEqual,te=Y.areMapsEqual,Q=Y.areObjectsEqual,ie=Y.areRegExpsEqual,ee=Y.areSetsEqual,ce=Y.createIsNestedEqual,fe=ce(_e);function _e(be,ye,de){if(be===ye)return!0;if(!be||!ye||typeof be!="object"||typeof ye!="object")return be!==be&&ye!==ye;if(s(be)&&s(ye))return Q(be,ye,fe,de);var xe=Array.isArray(be),Ae=Array.isArray(ye);if(xe||Ae)return xe===Ae&&X(be,ye,fe,de);var Ee=v.call(be);return Ee!==v.call(ye)?!1:Ee===d?J(be,ye,fe,de):Ee===f?ie(be,ye,fe,de):Ee===h?te(be,ye,fe,de):Ee===b?ee(be,ye,fe,de):Ee===m||Ee===c?a(be)||a(ye)?!1:Q(be,ye,fe,de):Ee===u||Ee===p||Ee===y?l(be.valueOf(),ye.valueOf()):!1}return _e}function E(Y,X,J,te){var Q=Y.length;if(X.length!==Q)return!1;for(;Q-- >0;)if(!J(Y[Q],X[Q],Q,Q,Y,X,te))return!1;return!0}var C=o(E);function w(Y,X){return l(Y.valueOf(),X.valueOf())}function _(Y,X,J,te){var Q=Y.size===X.size;if(!Q)return!1;if(!Y.size)return!0;var ie={},ee=0;return Y.forEach(function(ce,fe){if(Q){var _e=!1,be=0;X.forEach(function(ye,de){!_e&&!ie[be]&&(_e=J(fe,de,ee,be,Y,X,te)&&J(ce,ye,fe,de,Y,X,te))&&(ie[be]=!0),be++}),ee++,Q=_e}}),Q}var k=o(_),M="_owner",P=Object.prototype.hasOwnProperty;function A(Y,X,J,te){var Q=Object.keys(Y),ie=Q.length;if(Object.keys(X).length!==ie)return!1;for(var ee;ie-- >0;){if(ee=Q[ie],ee===M){var ce=!!Y.$$typeof,fe=!!X.$$typeof;if((ce||fe)&&ce!==fe)return!1}if(!P.call(X,ee)||!J(Y[ee],X[ee],ee,ee,Y,X,te))return!1}return!0}var T=o(A);function F(Y,X){return Y.source===X.source&&Y.flags===X.flags}function L(Y,X,J,te){var Q=Y.size===X.size;if(!Q)return!1;if(!Y.size)return!0;var ie={};return Y.forEach(function(ee,ce){if(Q){var fe=!1,_e=0;X.forEach(function(be,ye){!fe&&!ie[_e]&&(fe=J(ee,be,ce,ye,Y,X,te))&&(ie[_e]=!0),_e++}),Q=fe}}),Q}var I=o(L),O=Object.freeze({areArraysEqual:E,areDatesEqual:w,areMapsEqual:_,areObjectsEqual:A,areRegExpsEqual:F,areSetsEqual:L,createIsNestedEqual:r}),j=Object.freeze({areArraysEqual:C,areDatesEqual:w,areMapsEqual:k,areObjectsEqual:T,areRegExpsEqual:F,areSetsEqual:I,createIsNestedEqual:r}),z=x(O);function B(Y,X){return z(Y,X,void 0)}var N=x(i(O,{createIsNestedEqual:function(){return l}}));function q(Y,X){return N(Y,X,void 0)}var $=x(j);function D(Y,X){return $(Y,X,new WeakMap)}var V=x(i(j,{createIsNestedEqual:function(){return l}}));function G(Y,X){return V(Y,X,new WeakMap)}function U(Y){return x(i(O,Y(O)))}function W(Y){var X=x(i(j,Y(j)));return function(J,te,Q){return Q===void 0&&(Q=new WeakMap),X(J,te,Q)}}n.circularDeepEqual=D,n.circularShallowEqual=G,n.createCustomCircularEqual=W,n.createCustomEqual=U,n.deepEqual=B,n.sameValueZeroEqual=l,n.shallowEqual=q,Object.defineProperty(n,"__esModule",{value:!0})})})(Ix,Ix.exports);var vS=Ix.exports;const xS=K1(rB);var st={},VH=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(st,"__esModule",{value:!0});st.bottom=wS;st.childrenEqual=UH;st.cloneLayout=PI;st.cloneLayoutItem=La;st.collides=Zm;st.compact=MI;st.compactItem=AI;st.compactType=iW;st.correctBounds=NI;st.fastPositionEqual=GH;st.fastRGLPropsEqual=void 0;st.getAllCollisions=II;st.getFirstCollision=Ca;st.getLayoutItem=SS;st.getStatics=CS;st.modifyLayout=DI;st.moveElement=ad;st.moveElementAwayFromCollision=Ox;st.noop=void 0;st.perc=KH;st.resizeItemInDirection=tW;st.setTopLeft=rW;st.setTransform=nW;st.sortLayoutItems=DS;st.sortLayoutItemsByColRow=LI;st.sortLayoutItemsByRowCol=FI;st.synchronizeLayoutWithChildren=oW;st.validateLayout=$I;st.withLayoutItem=qH;var rR=vS,sd=HH(R);function HH(e){return e&&e.__esModule?e:{default:e}}const WH=process.env.NODE_ENV==="production";function wS(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function PI(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=La(e[n]);return t}function DI(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function qH(e,t,n){let r=SS(e,t);return r?(r=n(La(r)),e=DI(e,r),[e,r]):[e,null]}function La(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 UH(e,t){return(0,rR.deepEqual)(sd.default.Children.map(e,n=>n==null?void 0:n.key),sd.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,rR.deepEqual)(sd.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),sd.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}st.fastRGLPropsEqual=VH;function GH(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Zm(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 MI(e,t,n,r){const o=CS(e),i=DS(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=La(i[a]);c.static||(c=AI(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const YH={x:"w",y:"h"};function Tx(e,t,n,r){const o=YH[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Zm(t,a)&&Tx(e,a,n+t[o],r)}}t[r]=n}function AI(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(wS(e),t.y);t.y>0&&!Ca(e,t);)t.y--;else if(a)for(;t.x>0&&!Ca(e,t);)t.x--;let l;for(;(l=Ca(e,t))&&!(n===null&&i);)if(a?Tx(o,t,l.x+l.w,"x"):Tx(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ca(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function NI(e,t){const n=CS(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Ca(n,i);)i.y++}return e}function SS(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ca(e,t){for(let n=0,r=e.length;n<r;n++)if(Zm(e[n],t))return e[n]}function II(e,t){return e.filter(n=>Zm(n,t))}function CS(e){return e.filter(t=>t.static)}function ad(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=DS(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const h=II(d,t),p=h.length>0;if(p&&l)return PI(e);if(p&&i)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let m=0,b=h.length;m<b;m++){const y=h[m];`${t.i}${t.x}${t.y}${y.i}${y.x}${y.y}`,!y.moved&&(y.static?e=Ox(e,y,t,o,s):e=Ox(e,t,y,o,s))}return e}function Ox(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const d={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},f=Ca(e,d),h=f&&f.y+f.h>t.y,p=f&&t.x+t.w>f.x;if(f){if(h&&a)return ad(e,n,void 0,t.y+1,r,l,o);if(h&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(p&&s)return ad(e,t,n.x,void 0,r,l,o)}else return`${n.i}${d.x}${d.y}`,ad(e,n,s?d.x:void 0,a?d.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:ad(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function KH(e){return e*100+"%"}const TI=(e,t,n,r)=>e+n>r?t:n,OI=(e,t,n)=>e<0?t:n,jI=e=>Math.max(0,e),_S=e=>Math.max(0,e),ES=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:OI(s,e.height,o),top:_S(s)}},RS=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:TI(e.left,e.width,s,n),left:jI(o)}},kS=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:TI(e.left,e.width,i,n),top:_S(r),left:jI(s)}},PS=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:OI(r,e.height,i),top:_S(r)}},XH=function(){return ES(arguments.length<=0?void 0:arguments[0],RS(...arguments))},QH=function(){return ES(arguments.length<=0?void 0:arguments[0],kS(...arguments))},ZH=function(){return PS(arguments.length<=0?void 0:arguments[0],RS(...arguments))},JH=function(){return PS(arguments.length<=0?void 0:arguments[0],kS(...arguments))},eW={n:ES,ne:XH,e:RS,se:ZH,s:PS,sw:JH,w:kS,nw:QH};function tW(e,t,n,r){const o=eW[e];return o?o(t,{...t,...n},r):n}function nW(e){let{top:t,left:n,width:r,height:o}=e;const i=`translate(${n}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${r}px`,height:`${o}px`,position:"absolute"}}function rW(e){let{top:t,left:n,width:r,height:o}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function DS(e,t){return t==="horizontal"?LI(e):t==="vertical"?FI(e):e}function FI(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 LI(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 oW(e,t,n,r,o){e=e||[];const i=[];sd.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=SS(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(La(l)):c?(WH||$I([c],"ReactGridLayout.children"),i.push(La({...c,i:a.key}))):i.push(La({w:1,h:1,x:0,y:wS(i),i:String(a.key)}))});const s=NI(i,{cols:n});return o?s:MI(s,r,n)}function $I(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++){const a=n[s],l=i[a];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${a} must be a number! Received: ${l} (${typeof l})`)}if(typeof i.i<"u"&&typeof i.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${i.i} (${typeof i.i})`)}}function iW(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const sW=()=>{};st.noop=sW;var di={};Object.defineProperty(di,"__esModule",{value:!0});di.calcGridColWidth=Jm;di.calcGridItemPosition=aW;di.calcGridItemWHPx=jx;di.calcWH=cW;di.calcXY=lW;di.clamp=_a;function Jm(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function jx(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function aW(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=Jm(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=jx(r,c,s[0]),u.height=jx(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function lW(e,t,n,r,o){const{margin:i,containerPadding:s,cols:a,rowHeight:l,maxRows:c}=e,u=Jm(e);let d=Math.round((n-s[0])/(u+i[0])),f=Math.round((t-s[1])/(l+i[1]));return d=_a(d,0,a-r),f=_a(f,0,c-o),{x:d,y:f}}function cW(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=Jm(e);let d=Math.round((t+s[0])/(u+s[0])),f=Math.round((n+s[1])/(c+s[1])),h=_a(d,0,l-r),p=_a(f,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(h=_a(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(p=_a(f,0,a)),{w:h,h:p}}function _a(e,t,n){return Math.max(Math.min(e,n),t)}var eb={},Fx={exports:{}},Uh={exports:{}},St={};/** @license React v16.13.1
37
37
  * react-is.production.min.js
38
38
  *
39
39
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -4227,7 +4227,7 @@ const oe = Xx()(
4227
4227
  n.isSessionExpired = !1, n.currentBreakpoint = "lg", n.dashboard = {
4228
4228
  id: "",
4229
4229
  style: Ag
4230
- }, n.showContext = !1, n.selectedSheetId = null, n.selectedCardId = null, n.selectedFrameId = null, n.selectedCard = null, n.showFilters = !1, n.isDashboardEditing = !0, n.isVisualEditing = !1, n.showDashboardJSON = !1, n.filteringCards = [], n.selectedLensId = void 0, n.filterValues = void 0;
4230
+ }, n.showContext = !1, n.selectedSheetId = null, n.selectedCardId = null, n.selectedFrameId = null, n.selectedCard = null, n.showFilters = !1, n.isDashboardEditing = !1, n.isVisualEditing = !1, n.showDashboardJSON = !1, n.filteringCards = [], n.selectedLensId = void 0, n.filterValues = void 0;
4231
4231
  });
4232
4232
  },
4233
4233
  setHandleOpenAssistantProfile: (n) => {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-Cf_bcSdd.js"),r=require("../types/index.cjs");exports.Dashboard=e.Dashboard;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-CRGWDg7M.js"),r=require("../types/index.cjs");exports.Dashboard=e.Dashboard;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
@@ -1,4 +1,4 @@
1
- import { D as a } from "../chunks/index-BjgdaiaG.js";
1
+ import { D as a } from "../chunks/index-bm2bUPOX.js";
2
2
  import { EMPTY_SELECTION as e } from "../types/index.js";
3
3
  export {
4
4
  a as Dashboard,
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-Cf_bcSdd.js"),t=require("./types/index.cjs"),a=require("./chunks/dashboard-plus-CDcYeiXL.js");require("react/jsx-runtime");require("react");require("react-dom");const o=["YYYY-MM-DD","MM/DD/YYYY","DD/MM/YYYY","MMMM DD, YYYY","MMM DD, YYYY","DD MMM YYYY","YYYY-MM","MMMM YYYY","custom"];exports.Dashboard=e.Dashboard;exports.DashboardWC=e.DashboardWC;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.createSqlGenConfig=e.createSqlGenConfig;exports.fmt=e.fmt;exports.getColumnDataType=e.getColumnDataType;exports.getFilterValueType=e.getFilterValueType;exports.getFormattedTableNameForQuery=e.getFormattedTableNameForQuery;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.invalidateToken=e.invalidateToken;exports.isBooleanDataType=e.isBooleanDataType;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.isDateDataType=e.isDateDataType;exports.isNumberDataType=e.isNumberDataType;exports.isTextDataType=e.isTextDataType;exports.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.useCard=e.useCard;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardStore=e.useDashboardStore;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useTextFilterHook=e.useTextFilterHook;exports.EMPTY_SELECTION=t.EMPTY_SELECTION;exports.ScheduleDashboard=a.ScheduleDashboard;exports.SelectComponent=a.SelectComponent;exports.Surfboard=a.DashboardPlus;exports.cleanCard=a.cleanCard;exports.downloadPdf=a.downloadPdf;exports.getDashbaordStateWithoutData=a.getDashbaordStateWithoutData;exports.DATE_FORMAT_VALUES=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-CRGWDg7M.js"),t=require("./types/index.cjs"),a=require("./chunks/dashboard-plus-CHb8va6f.js");require("react/jsx-runtime");require("react");require("react-dom");const o=["YYYY-MM-DD","MM/DD/YYYY","DD/MM/YYYY","MMMM DD, YYYY","MMM DD, YYYY","DD MMM YYYY","YYYY-MM","MMMM YYYY","custom"];exports.Dashboard=e.Dashboard;exports.DashboardWC=e.DashboardWC;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.createSqlGenConfig=e.createSqlGenConfig;exports.fmt=e.fmt;exports.getColumnDataType=e.getColumnDataType;exports.getFilterValueType=e.getFilterValueType;exports.getFormattedTableNameForQuery=e.getFormattedTableNameForQuery;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.invalidateToken=e.invalidateToken;exports.isBooleanDataType=e.isBooleanDataType;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.isDateDataType=e.isDateDataType;exports.isNumberDataType=e.isNumberDataType;exports.isTextDataType=e.isTextDataType;exports.resolveDataType=e.resolveDataType;exports.resolveDatamodelName=e.resolveDatamodelName;exports.useCard=e.useCard;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardStore=e.useDashboardStore;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorActions=e.useEditorActions;exports.useEditorAside=e.useEditorAside;exports.useEditorStore=e.useEditorStore;exports.useTextFilterHook=e.useTextFilterHook;exports.EMPTY_SELECTION=t.EMPTY_SELECTION;exports.ScheduleDashboard=a.ScheduleDashboard;exports.SelectComponent=a.SelectComponent;exports.Surfboard=a.DashboardPlus;exports.cleanCard=a.cleanCard;exports.downloadPdf=a.downloadPdf;exports.getDashbaordStateWithoutData=a.getDashbaordStateWithoutData;exports.DATE_FORMAT_VALUES=o;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { D, c as Y, S as i, S as d, l, f as M, n as u, m, p as n, q as p, k as S, i as T, j as b, o as h, h as c, g as y, e as C, s as f, r as g, b as E, w as x, v as A, d as F, u as v, y as N, t as k, x as q, a as P } from "./chunks/index-BjgdaiaG.js";
1
+ import { D, c as Y, S as i, S as d, l, f as M, n as u, m, p as n, q as p, k as S, i as T, j as b, o as h, h as c, g as y, e as C, s as f, r as g, b as E, w as x, v as A, d as F, u as v, y as N, t as k, x as q, a as P } from "./chunks/index-bm2bUPOX.js";
2
2
  import { EMPTY_SELECTION as _ } from "./types/index.js";
3
- import { S as G, a as H, D as I, c as L, d as O, g as V } from "./chunks/dashboard-plus-DjdIqzup.js";
3
+ import { S as G, a as H, D as I, c as L, d as O, g as V } from "./chunks/dashboard-plus-D-o5DmiJ.js";
4
4
  import "react/jsx-runtime";
5
5
  import "react";
6
6
  import "react-dom";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/dashboard-plus-CDcYeiXL.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/dashboard-plus-CHb8va6f.js"),r=require("../types/index.cjs");exports.Surfboard=e.DashboardPlus;exports.EMPTY_SELECTION=r.EMPTY_SELECTION;
@@ -1,4 +1,4 @@
1
- import { D as f } from "../chunks/dashboard-plus-DjdIqzup.js";
1
+ import { D as f } from "../chunks/dashboard-plus-D-o5DmiJ.js";
2
2
  import { EMPTY_SELECTION as a } from "../types/index.js";
3
3
  export {
4
4
  a as EMPTY_SELECTION,
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.491",
8
+ "version": "0.0.492",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",