react-semaphor 0.0.40 → 0.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react-semaphor.js
CHANGED
|
@@ -4445,7 +4445,7 @@ const we = EO()(
|
|
|
4445
4445
|
selectedCardId: null,
|
|
4446
4446
|
selectedCard: null,
|
|
4447
4447
|
showFilters: !1,
|
|
4448
|
-
isDashboardEditing: !
|
|
4448
|
+
isDashboardEditing: !1,
|
|
4449
4449
|
isVisualEditing: !1,
|
|
4450
4450
|
// This should be false by defaultdashboard.
|
|
4451
4451
|
showDashboardJSON: !1,
|
|
@@ -56,7 +56,7 @@ Check the top-level render call using <`+ae+">.")}return Y}}function Fa(M,Y){{if
|
|
|
56
56
|
*
|
|
57
57
|
* This source code is licensed under the MIT license found in the
|
|
58
58
|
* LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/var uw;function q3(){if(uw)return nm;uw=1;var e=m,t=lw();function n(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return nm.useSyncExternalStoreWithSelector=function(c,d,f,g,p){var v=o(null);if(v.current===null){var y={hasValue:!1,value:null};v.current=y}else y=v.current;v=a(function(){function w(k){if(!S){if(S=!0,C=k,k=g(k),p!==void 0&&y.hasValue){var A=y.value;if(p(A,k))return O=A}return O=k}if(A=O,r(C,k))return A;var L=g(k);return p!==void 0&&p(A,L)?A:(C=k,O=L)}var S=!1,C,O,P=f===void 0?null:f;return[function(){return w(d())},P===null?void 0:function(){return w(P())}]},[d,f,g,p]);var x=i(c,v[0],v[1]);return s(function(){y.hasValue=!0,y.value=x},[x]),l(x),x},nm}process.env.NODE_ENV==="production"?Zg.exports=q3():Zg.exports=W3();var U3=Zg.exports;const G3=Oc(U3);var dw={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:Y3}=m,{useSyncExternalStoreWithSelector:K3}=G3;let fw=!1;function X3(e,t=e.getState,n){(dw?"production":void 0)!=="production"&&n&&!fw&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),fw=!0);const r=K3(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return Y3(r),r}const hw=e=>{(dw?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?B3(e):e,n=(r,i)=>X3(t,r,i);return Object.assign(n,t),n},pw=e=>e?hw(e):hw;var gw=Symbol.for("immer-nothing"),mw=Symbol.for("immer-draftable"),wr=Symbol.for("immer-state"),Q3=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function ir(e,...t){if(process.env.NODE_ENV!=="production"){const n=Q3[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var tl=Object.getPrototypeOf;function nl(e){return!!e&&!!e[wr]}function As(e){var t;return e?vw(e)||Array.isArray(e)||!!e[mw]||!!((t=e.constructor)!=null&&t[mw])||Xd(e)||Qd(e):!1}var Z3=Object.prototype.constructor.toString();function vw(e){if(!e||typeof e!="object")return!1;const t=tl(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Z3}function Ac(e,t){Kd(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Kd(e){const t=e[wr];return t?t.type_:Array.isArray(e)?1:Xd(e)?2:Qd(e)?3:0}function rm(e,t){return Kd(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function bw(e,t,n){const r=Kd(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function J3(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Xd(e){return e instanceof Map}function Qd(e){return e instanceof Set}function Is(e){return e.copy_||e.base_}function im(e,t){if(Xd(e))return new Map(e);if(Qd(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&vw(e))return tl(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[wr];let r=Reflect.ownKeys(n);for(let i=0;i<r.length;i++){const o=r[i],s=n[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(tl(e),n)}function om(e,t=!1){return Zd(e)||nl(e)||!As(e)||(Kd(e)>1&&(e.set=e.add=e.clear=e.delete=eN),Object.freeze(e),t&&Ac(e,(n,r)=>om(r,!0))),e}function eN(){ir(2)}function Zd(e){return Object.isFrozen(e)}var tN={};function Ns(e){const t=tN[e];return t||ir(0,e),t}var Ic;function yw(){return Ic}function nN(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function xw(e,t){t&&(Ns("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function sm(e){am(e),e.drafts_.forEach(rN),e.drafts_=null}function am(e){e===Ic&&(Ic=e.parent_)}function ww(e){return Ic=nN(Ic,e)}function rN(e){const t=e[wr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function _w(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[wr].modified_&&(sm(t),ir(4)),As(e)&&(e=Jd(t,e),t.parent_||ef(t,e)),t.patches_&&Ns("Patches").generateReplacementPatches_(n[wr].base_,e,t.patches_,t.inversePatches_)):e=Jd(t,n,[]),sm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==gw?e:void 0}function Jd(e,t,n){if(Zd(t))return t;const r=t[wr];if(!r)return Ac(t,(i,o)=>Sw(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return ef(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,s=!1;r.type_===3&&(o=new Set(i),i.clear(),s=!0),Ac(o,(a,l)=>Sw(e,r,i,a,l,n,s)),ef(e,i,!1),n&&e.patches_&&Ns("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Sw(e,t,n,r,i,o,s){if(process.env.NODE_ENV!=="production"&&i===n&&ir(5),nl(i)){const a=o&&t&&t.type_!==3&&!rm(t.assigned_,r)?o.concat(r):void 0,l=Jd(e,i,a);if(bw(n,r,l),nl(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(As(i)&&!Zd(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Jd(e,i),(!t||!t.scope_.parent_)&&ef(e,i)}}function ef(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&om(t,n)}function iN(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:yw(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=lm;n&&(i=[r],o=Nc);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var lm={get(e,t){if(t===wr)return e;const n=Is(e);if(!rm(n,t))return oN(e,n,t);const r=n[t];return e.finalized_||!As(r)?r:r===cm(e.base_,t)?(dm(e),e.copy_[t]=fm(r,e)):r},has(e,t){return t in Is(e)},ownKeys(e){return Reflect.ownKeys(Is(e))},set(e,t,n){const r=Cw(Is(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=cm(Is(e),t),o=i==null?void 0:i[wr];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(J3(n,i)&&(n!==void 0||rm(e.base_,t)))return!0;dm(e),um(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return cm(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,dm(e),um(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Is(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ir(11)},getPrototypeOf(e){return tl(e.base_)},setPrototypeOf(){ir(12)}},Nc={};Ac(lm,(e,t)=>{Nc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Nc.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ir(13),Nc.set.call(this,e,t,void 0)},Nc.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ir(14),lm.set.call(this,e[0],t,n,e[0])};function cm(e,t){const n=e[wr];return(n?Is(n):e)[t]}function oN(e,t,n){var i;const r=Cw(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Cw(e,t){if(!(t in e))return;let n=tl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=tl(n)}}function um(e){e.modified_||(e.modified_=!0,e.parent_&&um(e.parent_))}function dm(e){e.copy_||(e.copy_=im(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var sN=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,d=>n.call(this,d,...c))}}typeof n!="function"&&ir(6),r!==void 0&&typeof r!="function"&&ir(7);let i;if(As(t)){const o=ww(this),s=fm(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?sm(o):am(o)}return xw(o,r),_w(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===gw&&(i=void 0),this.autoFreeze_&&om(i,!0),r){const o=[],s=[];Ns("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else ir(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){As(e)||ir(8),nl(e)&&(e=aN(e));const t=ww(this),n=fm(e,void 0);return n[wr].isManual_=!0,am(t),n}finishDraft(e,t){const n=e&&e[wr];(!n||!n.isManual_)&&ir(9);const{scope_:r}=n;return xw(r,t),_w(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Ns("Patches").applyPatches_;return nl(e)?r(e,t):this.produce(e,i=>r(i,t))}};function fm(e,t){const n=Xd(e)?Ns("MapSet").proxyMap_(e,t):Qd(e)?Ns("MapSet").proxySet_(e,t):iN(e,t);return(t?t.scope_:yw()).drafts_.push(n),n}function aN(e){return nl(e)||ir(10,e),Ew(e)}function Ew(e){if(!As(e)||Zd(e))return e;const t=e[wr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=im(e,t.scope_.immer_.useStrictShallowCopy_)}else n=im(e,!0);return Ac(n,(r,i)=>{bw(n,r,Ew(i))}),t&&(t.finalized_=!1),n}var _r=new sN,lN=_r.produce;_r.produceWithPatches.bind(_r),_r.setAutoFreeze.bind(_r),_r.setUseStrictShallowCopy.bind(_r),_r.applyPatches.bind(_r),_r.createDraft.bind(_r),_r.finishDraft.bind(_r);const Pw=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?lN(i):i;return t(a,o,...s)},e(r.setState,n,r));var tf,nf=kt;if(process.env.NODE_ENV==="production")tf=nf.createRoot,nf.hydrateRoot;else{var Ow=nf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;tf=function(e,t){Ow.usingClientEntryPoint=!0;try{return nf.createRoot(e,t)}finally{Ow.usingClientEntryPoint=!1}}}function kw(e,t,n){const r={count:0},i=a=>{const l=m.useRef(r.count);return m.useEffect(()=>{l.current+=1,l.current===r.count+1&&(l.current-=1,t.setState(a))}),null};if(i.displayName=`((${e})) devtool`,typeof document>"u")return;if(!n){let a=document.getElementById(`simple-zustand-devtools-${e}`);a||(a=document.createElement("div"),a.id=`simple-zustand-devtools-${e}`),document.body.appendChild(a),n=a}const o=tf(n),s=a=>{a&&(o.render(m.createElement(i,Object.assign({},a))),r.count+=1)};s(t.getState()),t.subscribe(s)}var Mw={},Dw={},hm={exports:{}},Gt=String,Tw=function(){return{isColorSupported:!1,reset:Gt,bold:Gt,dim:Gt,italic:Gt,underline:Gt,inverse:Gt,hidden:Gt,strikethrough:Gt,black:Gt,red:Gt,green:Gt,yellow:Gt,blue:Gt,magenta:Gt,cyan:Gt,white:Gt,gray:Gt,bgBlack:Gt,bgRed:Gt,bgGreen:Gt,bgYellow:Gt,bgBlue:Gt,bgMagenta:Gt,bgCyan:Gt,bgWhite:Gt}};hm.exports=Tw(),hm.exports.createColors=Tw;var cN=hm.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var d in c)Object.defineProperty(l,d,{enumerable:!0,get:c[d]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(cN);function r(l){return l&&l.__esModule?l:{default:l}}let i=new Set;function o(l,c,d){typeof process<"u"&&process.env.JEST_WORKER_ID||d&&i.has(d)||(d&&i.add(d),console.warn(""),c.forEach(f=>console.warn(l,"-",f)))}function s(l){return n.default.dim(l)}const a={info(l,c){o(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){o(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){o(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(Dw),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const t=n(Dw);function n(o){return o&&o.__esModule?o:{default:o}}function r({version:o,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${o}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const i={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}(Mw);let pm=Mw;var uN=(pm.__esModule?pm:{default:pm}).default;const an=Oc(uN),gm={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, sans-serif"},dataset:{backgroundColor:[an.violet[400],an.red[400],an.amber[400],an.orange[400],an.rose[400]],borderColor:[an.violet[400],an.red[400],an.amber[400],an.orange[400],an.rose[400]]},options:{plugins:{datalabels:{display:!1,color:dN},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4},legend:{position:"top",align:"center",maxHeight:0}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:1,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[an.teal[100],an.purple[100],an.amber[100],an.orange[100],an.rose[100]],borderColor:[an.teal[400],an.purple[400],an.amber[400],an.orange[300],an.rose[400]]},options:{plugins:{tooltip:{backgroundColor:"#000",bodyColor:"#fff",borderWidth:.25,titleColor:"#fff",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4}},datalabels:{display:!1},scales:{x:{grid:{display:!0,color:an.slate[800]}},y:{grid:{display:!0,color:an.slate[800]}}}}}}};function dN(e){var r,i,o,s,a,l;const t=(a=(s=(o=(i=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:i._config)==null?void 0:o.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=Aw()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Aw()),fN(n)}function Aw(){return be.getState().theme==="dark"?"#000000":"#FFFFFF"}function fN(e){let t=0,n=0,r=0,i=0;const o=d=>{const f=d.replace("#",""),g=parseInt(f.substring(0,2),16),p=parseInt(f.substring(2,4),16),v=parseInt(f.substring(4,6),16);t+=g,n+=p,r+=v,i++};Array.isArray(e)?e.forEach(d=>{o(d)}):o(e);const s=t/i,a=n/i,l=r/i;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const be=pw()(Pw((e,t)=>({dashboard:{id:"",style:gm},selectedSheetId:null,selectedCardId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!0,isVisualEditing:!1,showDashboardJSON:!1,isEditorSaveEvent:!1,actions:{setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setIsEditorSaveEvent:n=>{e(()=>({isEditorSaveEvent:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setDashboardTitle:n=>{e(r=>{r.dashboard&&(r.dashboard.title=n)})},setDashboardDescription:n=>{e(r=>{r.dashboard&&(r.dashboard.description=n)})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.title=r)})},setSheetDescription:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.description=r)})},setCards:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.cards=r)})},setCardTitle:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.title=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setCardSql:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.sql=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setCardData:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.data=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setCardDescription:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.description=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setSheetLayout:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layout=r)})},setShowFilters:n=>{e(()=>({showFilters:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1?r.filterValues.splice(i,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n);i>-1&&r.filterValues.splice(i,1)}})},addFilter:n=>{e(r=>{var i;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n]})},removeFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n);console.log("index",s),s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1))}})},updateFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n.id);s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addCard:(n,r)=>{e(i=>{var s,a,l,c,d;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){(l=o.cards)==null||l.push(r);const f={i:r.id,x:0,y:1/0,w:20,h:7,minW:10};(c=o.layout)==null||c.push(f),(d=i.onAddCard)==null||d.call(i,r,n)}})},updateCard:(n,r)=>{e(i=>{var a,l,c,d,f;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(g=>g.id===r.id);o&&((d=o.cards)==null||d.splice(s,1,r),(f=i.onUpdateCard)==null||f.call(i,r,n))})},removeCard:(n,r)=>{e(i=>{var a,l,c,d,f,g;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((d=o.cards)==null||d.splice(s,1),(f=o.layout)==null||f.splice(s,1),(g=i.onRemoveCard)==null||g.call(i,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(i=>{var s,a,l;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);o&&(((l=o.cards)==null?void 0:l.find(d=>d.id===r))?i.selectedCardId=r:i.selectedCardId=null)})},setSelectedCard:n=>{e(r=>{r.selectedCard=n})},setSelectedSheetId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(i=>i.id===t().selectedSheetId)},getSelectedCard:()=>{var r,i,o;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(s=>s.id===t().selectedSheetId);return(o=n==null?void 0:n.cards)==null?void 0:o.find(s=>s.id===t().selectedCardId)},getSelectedSheetCards:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.cards},getSelectedSheetLayout:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layout},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style}}})));process.env.NODE_ENV==="development"&&kw("DashboardStore",be);var Rc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},rl=typeof window>"u"||"Deno"in window;function Kr(){}function hN(e,t){return typeof e=="function"?e(t):e}function mm(e){return typeof e=="number"&&e>=0&&e!==1/0}function Iw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Nw(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==vm(s,t.options))return!1}else if(!$c(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Rw(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Lc(t.options.mutationKey)!==Lc(o))return!1}else if(!$c(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function vm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Lc)(e)}function Lc(e){return JSON.stringify(e,(t,n)=>ym(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function $c(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!$c(e[n],t[n])):!1}function Lw(e,t){if(e===t)return e;const n=$w(e)&&$w(t);if(n||ym(e)&&ym(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const d=n?c:o[c];!n&&e[d]===void 0&&t[d]===void 0&&r.includes(d)?(a[d]=void 0,l++):(a[d]=Lw(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function bm(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function $w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ym(e){if(!Fw(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Fw(n)||!n.hasOwnProperty("isPrototypeOf"))}function Fw(e){return Object.prototype.toString.call(e)==="[object Object]"}function pN(e){return new Promise(t=>{setTimeout(t,e)})}function xm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Lw(e,t):t}function gN(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function mN(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var vN=(_A=class extends Rc{constructor(){super();ze(this,Pa,void 0);ze(this,fs,void 0);ze(this,Ql,void 0);Ie(this,Ql,t=>{if(!rl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Z(this,fs)||this.setEventListener(Z(this,Ql))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,fs))==null||t.call(this),Ie(this,fs,void 0))}setEventListener(t){var n;Ie(this,Ql,t),(n=Z(this,fs))==null||n.call(this),Ie(this,fs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Z(this,Pa)!==t&&(Ie(this,Pa,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof Z(this,Pa)=="boolean"?Z(this,Pa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Pa=new WeakMap,fs=new WeakMap,Ql=new WeakMap,_A),rf=new vN,bN=(SA=class extends Rc{constructor(){super();ze(this,Zl,!0);ze(this,hs,void 0);ze(this,Jl,void 0);Ie(this,Jl,t=>{if(!rl&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Z(this,hs)||this.setEventListener(Z(this,Jl))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,hs))==null||t.call(this),Ie(this,hs,void 0))}setEventListener(t){var n;Ie(this,Jl,t),(n=Z(this,hs))==null||n.call(this),Ie(this,hs,t(this.setOnline.bind(this)))}setOnline(t){Z(this,Zl)!==t&&(Ie(this,Zl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Z(this,Zl)}},Zl=new WeakMap,hs=new WeakMap,Jl=new WeakMap,SA),of=new bN;function yN(e){return Math.min(1e3*2**e,3e4)}function sf(e){return(e??"online")==="online"?of.isOnline():!0}var jw=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wm(e){return e instanceof jw}function zw(e){let t=!1,n=0,r=!1,i,o,s;const a=new Promise((x,w)=>{o=x,s=w}),l=x=>{var w;r||(p(new jw(x)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},d=()=>{t=!1},f=()=>!rf.isFocused()||e.networkMode!=="always"&&!of.isOnline(),g=x=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,x),i==null||i(),o(x))},p=x=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,x),i==null||i(),s(x))},v=()=>new Promise(x=>{var w;i=S=>{const C=r||!f();return C&&x(S),C},(w=e.onPause)==null||w.call(e)}).then(()=>{var x;i=void 0,r||(x=e.onContinue)==null||x.call(e)}),y=()=>{if(r)return;let x;try{x=e.fn()}catch(w){x=Promise.reject(w)}Promise.resolve(x).then(g).catch(w=>{var k;if(r)return;const S=e.retry??(rl?0:3),C=e.retryDelay??yN,O=typeof C=="function"?C(n,w):C,P=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,w);if(t||!P){p(w);return}n++,(k=e.onFail)==null||k.call(e,n,w),pN(O).then(()=>{if(f())return v()}).then(()=>{t?p(w):y()})})};return sf(e.networkMode)?y():v().then(y),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:c,continueRetry:d}}function xN(){let e=[],t=0,n=g=>{g()},r=g=>{g()},i=g=>setTimeout(g,0);const o=g=>{i=g},s=g=>{let p;t++;try{p=g()}finally{t--,t||c()}return p},a=g=>{t?e.push(g):i(()=>{n(g)})},l=g=>(...p)=>{a(()=>{g(...p)})},c=()=>{const g=e;e=[],g.length&&i(()=>{r(()=>{g.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:g=>{n=g},setBatchNotifyFunction:g=>{r=g},setScheduler:o}}var In=xN(),Bw=(CA=class{constructor(){ze(this,Oa,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mm(this.gcTime)&&Ie(this,Oa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rl?1/0:5*60*1e3))}clearGcTimeout(){Z(this,Oa)&&(clearTimeout(Z(this,Oa)),Ie(this,Oa,void 0))}},Oa=new WeakMap,CA),wN=(EA=class extends Bw{constructor(t){super();ze(this,nc);ze(this,Si);ze(this,ec,void 0);ze(this,tc,void 0);ze(this,ri,void 0);ze(this,ps,void 0);ze(this,ii,void 0);ze(this,Mn,void 0);ze(this,fd,void 0);ze(this,ka,void 0);Ie(this,ka,!1),Ie(this,fd,t.defaultOptions),xt(this,nc,Gg).call(this,t.options),Ie(this,Mn,[]),Ie(this,ri,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ie(this,ec,t.state||_N(this.options)),this.state=Z(this,ec),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!Z(this,Mn).length&&this.state.fetchStatus==="idle"&&Z(this,ri).remove(this)}setData(t,n){const r=xm(this.state.data,t,this.options);return xt(this,Si,No).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){xt(this,Si,No).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=Z(this,ps);return(r=Z(this,ii))==null||r.cancel(t),n?n.then(Kr).catch(Kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Z(this,ec))}isActive(){return Z(this,Mn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||Z(this,Mn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Iw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=Z(this,Mn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,ii))==null||n.continue()}onOnline(){var n;const t=Z(this,Mn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,ii))==null||n.continue()}addObserver(t){Z(this,Mn).includes(t)||(Z(this,Mn).push(t),this.clearGcTimeout(),Z(this,ri).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){Z(this,Mn).includes(t)&&(Ie(this,Mn,Z(this,Mn).filter(n=>n!==t)),Z(this,Mn).length||(Z(this,ii)&&(Z(this,ka)?Z(this,ii).cancel({revert:!0}):Z(this,ii).cancelRetry()),this.scheduleGc()),Z(this,ri).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return Z(this,Mn).length}invalidate(){this.state.isInvalidated||xt(this,Si,No).call(this,{type:"invalidate"})}fetch(t,n){var c,d,f,g;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Z(this,ps))return(c=Z(this,ii))==null||c.continueRetry(),Z(this,ps)}if(t&&xt(this,nc,Gg).call(this,t),!this.options.queryFn){const p=Z(this,Mn).find(v=>v.options.queryFn);p&&xt(this,nc,Gg).call(this,p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,i={queryKey:this.queryKey,meta:this.meta},o=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Ie(this,ka,!0),r.signal)})};o(i);const s=()=>this.options.queryFn?(Ie(this,ka,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};o(a),(d=this.options.behavior)==null||d.onFetch(a,this),Ie(this,tc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&xt(this,Si,No).call(this,{type:"fetch",meta:(g=a.fetchOptions)==null?void 0:g.meta});const l=p=>{var v,y,x,w;wm(p)&&p.silent||xt(this,Si,No).call(this,{type:"error",error:p}),wm(p)||((y=(v=Z(this,ri).config).onError)==null||y.call(v,p,this),(w=(x=Z(this,ri).config).onSettled)==null||w.call(x,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ie(this,ii,zw({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var v,y,x,w;if(typeof p>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(p),(y=(v=Z(this,ri).config).onSuccess)==null||y.call(v,p,this),(w=(x=Z(this,ri).config).onSettled)==null||w.call(x,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,v)=>{xt(this,Si,No).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{xt(this,Si,No).call(this,{type:"pause"})},onContinue:()=>{xt(this,Si,No).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ie(this,ps,Z(this,ii).promise),Z(this,ps)}},ec=new WeakMap,tc=new WeakMap,ri=new WeakMap,ps=new WeakMap,ii=new WeakMap,Mn=new WeakMap,fd=new WeakMap,ka=new WeakMap,nc=new WeakSet,Gg=function(t){this.options={...Z(this,fd),...t},this.updateGcTime(this.options.gcTime)},Si=new WeakSet,No=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:sf(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return wm(i)&&i.revert&&Z(this,tc)?{...Z(this,tc),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),In.batch(()=>{Z(this,Mn).forEach(r=>{r.onQueryUpdate()}),Z(this,ri).notify({query:this,type:"updated",action:t})})},EA);function _N(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var SN=(PA=class extends Rc{constructor(t={}){super();ze(this,Yi,void 0);this.config=t,Ie(this,Yi,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??vm(i,n);let s=this.get(o);return s||(s=new wN({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){Z(this,Yi).has(t.queryHash)||(Z(this,Yi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Z(this,Yi).get(t.queryHash);n&&(t.destroy(),n===t&&Z(this,Yi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){In.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Z(this,Yi).get(t)}getAll(){return[...Z(this,Yi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Nw(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Nw(t,r)):n}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){In.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){In.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Yi=new WeakMap,PA),CN=(OA=class extends Bw{constructor(t){super();ze(this,Xi);ze(this,Ki,void 0);ze(this,hd,void 0);ze(this,zr,void 0);ze(this,rc,void 0);this.mutationId=t.mutationId,Ie(this,hd,t.defaultOptions),Ie(this,zr,t.mutationCache),Ie(this,Ki,[]),this.state=t.state||EN(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...Z(this,hd),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Z(this,Ki).includes(t)||(Z(this,Ki).push(t),this.clearGcTimeout(),Z(this,zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ie(this,Ki,Z(this,Ki).filter(n=>n!==t)),this.scheduleGc(),Z(this,zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Z(this,Ki).length||(this.state.status==="pending"?this.scheduleGc():Z(this,zr).remove(this))}continue(){var t;return((t=Z(this,rc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,c,d,f,g,p,v,y,x,w,S,C,O,P,k,A;const n=()=>(Ie(this,rc,zw({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(L,F)=>{xt(this,Xi,ks).call(this,{type:"failed",failureCount:L,error:F})},onPause:()=>{xt(this,Xi,ks).call(this,{type:"pause"})},onContinue:()=>{xt(this,Xi,ks).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),Z(this,rc).promise),r=this.state.status==="pending";try{if(!r){xt(this,Xi,ks).call(this,{type:"pending",variables:t}),await((o=(i=Z(this,zr).config).onMutate)==null?void 0:o.call(i,t,this));const F=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));F!==this.state.context&&xt(this,Xi,ks).call(this,{type:"pending",context:F,variables:t})}const L=await n();return await((c=(l=Z(this,zr).config).onSuccess)==null?void 0:c.call(l,L,t,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,L,t,this.state.context)),await((p=(g=Z(this,zr).config).onSettled)==null?void 0:p.call(g,L,null,this.state.variables,this.state.context,this)),await((y=(v=this.options).onSettled)==null?void 0:y.call(v,L,null,t,this.state.context)),xt(this,Xi,ks).call(this,{type:"success",data:L}),L}catch(L){try{throw await((w=(x=Z(this,zr).config).onError)==null?void 0:w.call(x,L,t,this.state.context,this)),await((C=(S=this.options).onError)==null?void 0:C.call(S,L,t,this.state.context)),await((P=(O=Z(this,zr).config).onSettled)==null?void 0:P.call(O,void 0,L,this.state.variables,this.state.context,this)),await((A=(k=this.options).onSettled)==null?void 0:A.call(k,void 0,L,t,this.state.context)),L}finally{xt(this,Xi,ks).call(this,{type:"error",error:L})}}}},Ki=new WeakMap,hd=new WeakMap,zr=new WeakMap,rc=new WeakMap,Xi=new WeakSet,ks=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!sf(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),In.batch(()=>{Z(this,Ki).forEach(r=>{r.onMutationUpdate(t)}),Z(this,zr).notify({mutation:this,type:"updated",action:t})})},OA);function EN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var PN=(kA=class extends Rc{constructor(t={}){super();ze(this,oi,void 0);ze(this,pd,void 0);ze(this,Ma,void 0);this.config=t,Ie(this,oi,[]),Ie(this,pd,0)}build(t,n,r){const i=new CN({mutationCache:this,mutationId:++Ug(this,pd)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){Z(this,oi).push(t),this.notify({type:"added",mutation:t})}remove(t){Ie(this,oi,Z(this,oi).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){In.batch(()=>{Z(this,oi).forEach(t=>{this.remove(t)})})}getAll(){return Z(this,oi)}find(t){const n={exact:!0,...t};return Z(this,oi).find(r=>Rw(n,r))}findAll(t={}){return Z(this,oi).filter(n=>Rw(t,n))}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ie(this,Ma,(Z(this,Ma)??Promise.resolve()).then(()=>{const t=Z(this,oi).filter(n=>n.state.isPaused);return In.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Kr)),Promise.resolve()))}).then(()=>{Ie(this,Ma,void 0)})),Z(this,Ma)}},oi=new WeakMap,pd=new WeakMap,Ma=new WeakMap,kA);function ON(e){return{onFetch:(t,n)=>{const r=async()=>{var v,y,x,w,S;const i=t.options,o=(x=(y=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:y.fetchMore)==null?void 0:x.direction,s=((w=t.state.data)==null?void 0:w.pages)||[],a=((S=t.state.data)==null?void 0:S.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const d=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),g=async(C,O,P)=>{if(c)return Promise.reject();if(O==null&&C.pages.length)return Promise.resolve(C);const k={queryKey:t.queryKey,pageParam:O,direction:P?"backward":"forward",meta:t.options.meta};d(k);const A=await f(k),{maxPages:L}=t.options,F=P?mN:gN;return{pages:F(C.pages,A,L),pageParams:F(C.pageParams,O,L)}};let p;if(o&&s.length){const C=o==="backward",O=C?kN:Vw,P={pages:s,pageParams:a},k=O(i,P);p=await g(P,k,C)}else{p=await g(l,a[0]??i.initialPageParam);const C=e??s.length;for(let O=1;O<C;O++){const P=Vw(i,p);p=await g(p,P)}}return p};t.options.persister?t.fetchFn=()=>{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function Vw(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function kN(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var MN=(MA=class{constructor(e={}){ze(this,Sn,void 0);ze(this,gs,void 0);ze(this,ms,void 0);ze(this,ic,void 0);ze(this,oc,void 0);ze(this,vs,void 0);ze(this,sc,void 0);ze(this,ac,void 0);Ie(this,Sn,e.queryCache||new SN),Ie(this,gs,e.mutationCache||new PN),Ie(this,ms,e.defaultOptions||{}),Ie(this,ic,new Map),Ie(this,oc,new Map),Ie(this,vs,0)}mount(){Ug(this,vs)._++,Z(this,vs)===1&&(Ie(this,sc,rf.subscribe(()=>{rf.isFocused()&&(this.resumePausedMutations(),Z(this,Sn).onFocus())})),Ie(this,ac,of.subscribe(()=>{of.isOnline()&&(this.resumePausedMutations(),Z(this,Sn).onOnline())})))}unmount(){var e,t;Ug(this,vs)._--,Z(this,vs)===0&&((e=Z(this,sc))==null||e.call(this),Ie(this,sc,void 0),(t=Z(this,ac))==null||t.call(this),Ie(this,ac,void 0))}isFetching(e){return Z(this,Sn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Z(this,gs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=Z(this,Sn).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=Z(this,Sn).find({queryKey:e}),i=r==null?void 0:r.state.data,o=hN(t,i);if(typeof o>"u")return;const s=this.defaultQueryOptions({queryKey:e});return Z(this,Sn).build(this,s).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return In.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=Z(this,Sn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=Z(this,Sn);In.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Z(this,Sn),r={type:"active",...e};return In.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=In.batch(()=>Z(this,Sn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kr).catch(Kr)}invalidateQueries(e={},t={}){return In.batch(()=>{if(Z(this,Sn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=In.batch(()=>Z(this,Sn).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Kr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Kr)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=Z(this,Sn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kr).catch(Kr)}fetchInfiniteQuery(e){return e.behavior=ON(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kr).catch(Kr)}resumePausedMutations(){return Z(this,gs).resumePausedMutations()}getQueryCache(){return Z(this,Sn)}getMutationCache(){return Z(this,gs)}getDefaultOptions(){return Z(this,ms)}setDefaultOptions(e){Ie(this,ms,e)}setQueryDefaults(e,t){Z(this,ic).set(Lc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Z(this,ic).values()];let n={};return t.forEach(r=>{$c(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){Z(this,oc).set(Lc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Z(this,oc).values()];let n={};return t.forEach(r=>{$c(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...Z(this,ms).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=vm(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Z(this,ms).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Z(this,Sn).clear(),Z(this,gs).clear()}},Sn=new WeakMap,gs=new WeakMap,ms=new WeakMap,ic=new WeakMap,oc=new WeakMap,vs=new WeakMap,sc=new WeakMap,ac=new WeakMap,MA),DN=(DA=class extends Rc{constructor(t,n){super();ze(this,Ia);ze(this,vd);ze(this,bd);ze(this,yd);ze(this,xd);ze(this,wd);ze(this,_d);ze(this,Sd);ze(this,ig);ze(this,gr,void 0);ze(this,Zt,void 0);ze(this,gd,void 0);ze(this,er,void 0);ze(this,Da,void 0);ze(this,lc,void 0);ze(this,Qi,void 0);ze(this,md,void 0);ze(this,cc,void 0);ze(this,uc,void 0);ze(this,Ta,void 0);ze(this,Aa,void 0);ze(this,bs,void 0);ze(this,dc,new Set);this.options=n,Ie(this,gr,t),Ie(this,Qi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Z(this,Zt).addObserver(this),Hw(Z(this,Zt),this.options)?xt(this,Ia,qd).call(this):this.updateResult(),xt(this,xd,W1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _m(Z(this,Zt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _m(Z(this,Zt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,xt(this,wd,q1).call(this),xt(this,_d,U1).call(this),Z(this,Zt).removeObserver(this)}setOptions(t,n){const r=this.options,i=Z(this,Zt);if(this.options=Z(this,gr).defaultQueryOptions(t),bm(r,this.options)||Z(this,gr).getQueryCache().notify({type:"observerOptionsUpdated",query:Z(this,Zt),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),xt(this,Sd,G1).call(this);const o=this.hasListeners();o&&Ww(Z(this,Zt),i,this.options,r)&&xt(this,Ia,qd).call(this),this.updateResult(n),o&&(Z(this,Zt)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&xt(this,vd,B1).call(this);const s=xt(this,bd,V1).call(this);o&&(Z(this,Zt)!==i||this.options.enabled!==r.enabled||s!==Z(this,bs))&&xt(this,yd,H1).call(this,s)}getOptimisticResult(t){const n=Z(this,gr).getQueryCache().build(Z(this,gr),t),r=this.createResult(n,t);return AN(this,r)&&(Ie(this,er,r),Ie(this,lc,this.options),Ie(this,Da,Z(this,Zt).state)),r}getCurrentResult(){return Z(this,er)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(Z(this,dc).add(r),t[r])})}),n}getCurrentQuery(){return Z(this,Zt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Z(this,gr).defaultQueryOptions(t),r=Z(this,gr).getQueryCache().build(Z(this,gr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return xt(this,Ia,qd).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Z(this,er)))}createResult(t,n){var k;const r=Z(this,Zt),i=this.options,o=Z(this,er),s=Z(this,Da),a=Z(this,lc),c=t!==r?t.state:Z(this,gd),{state:d}=t;let{error:f,errorUpdatedAt:g,fetchStatus:p,status:v}=d,y=!1,x;if(n._optimisticResults){const A=this.hasListeners(),L=!A&&Hw(t,n),F=A&&Ww(t,r,n,i);(L||F)&&(p=sf(t.options.networkMode)?"fetching":"paused",d.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof d.data<"u")if(o&&d.data===(s==null?void 0:s.data)&&n.select===Z(this,md))x=Z(this,cc);else try{Ie(this,md,n.select),x=n.select(d.data),x=xm(o==null?void 0:o.data,x,n),Ie(this,cc,x),Ie(this,Qi,null)}catch(A){Ie(this,Qi,A)}else x=d.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let A;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))A=o.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((k=Z(this,uc))==null?void 0:k.state.data,Z(this,uc)):n.placeholderData,n.select&&typeof A<"u")try{A=n.select(A),Ie(this,Qi,null)}catch(L){Ie(this,Qi,L)}typeof A<"u"&&(v="success",x=xm(o==null?void 0:o.data,A,n),y=!0)}Z(this,Qi)&&(f=Z(this,Qi),x=Z(this,cc),g=Date.now(),v="error");const w=p==="fetching",S=v==="pending",C=v==="error",O=S&&w;return{status:v,fetchStatus:p,isPending:S,isSuccess:v==="success",isError:C,isInitialLoading:O,isLoading:O,data:x,dataUpdatedAt:d.dataUpdatedAt,error:f,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!S,isLoadingError:C&&d.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:y,isRefetchError:C&&d.dataUpdatedAt!==0,isStale:Sm(t,n),refetch:this.refetch}}updateResult(t){const n=Z(this,er),r=this.createResult(Z(this,Zt),this.options);if(Ie(this,Da,Z(this,Zt).state),Ie(this,lc,this.options),Z(this,Da).data!==void 0&&Ie(this,uc,Z(this,Zt)),bm(r,n))return;Ie(this,er,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!Z(this,dc).size)return!0;const l=new Set(a??Z(this,dc));return this.options.throwOnError&&l.add("error"),Object.keys(Z(this,er)).some(c=>{const d=c;return Z(this,er)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),xt(this,ig,n3).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&xt(this,xd,W1).call(this)}},gr=new WeakMap,Zt=new WeakMap,gd=new WeakMap,er=new WeakMap,Da=new WeakMap,lc=new WeakMap,Qi=new WeakMap,md=new WeakMap,cc=new WeakMap,uc=new WeakMap,Ta=new WeakMap,Aa=new WeakMap,bs=new WeakMap,dc=new WeakMap,Ia=new WeakSet,qd=function(t){xt(this,Sd,G1).call(this);let n=Z(this,Zt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Kr)),n},vd=new WeakSet,B1=function(){if(xt(this,wd,q1).call(this),rl||Z(this,er).isStale||!mm(this.options.staleTime))return;const n=Iw(Z(this,er).dataUpdatedAt,this.options.staleTime)+1;Ie(this,Ta,setTimeout(()=>{Z(this,er).isStale||this.updateResult()},n))},bd=new WeakSet,V1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Z(this,Zt)):this.options.refetchInterval)??!1},yd=new WeakSet,H1=function(t){xt(this,_d,U1).call(this),Ie(this,bs,t),!(rl||this.options.enabled===!1||!mm(Z(this,bs))||Z(this,bs)===0)&&Ie(this,Aa,setInterval(()=>{(this.options.refetchIntervalInBackground||rf.isFocused())&&xt(this,Ia,qd).call(this)},Z(this,bs)))},xd=new WeakSet,W1=function(){xt(this,vd,B1).call(this),xt(this,yd,H1).call(this,xt(this,bd,V1).call(this))},wd=new WeakSet,q1=function(){Z(this,Ta)&&(clearTimeout(Z(this,Ta)),Ie(this,Ta,void 0))},_d=new WeakSet,U1=function(){Z(this,Aa)&&(clearInterval(Z(this,Aa)),Ie(this,Aa,void 0))},Sd=new WeakSet,G1=function(){const t=Z(this,gr).getQueryCache().build(Z(this,gr),this.options);if(t===Z(this,Zt))return;const n=Z(this,Zt);Ie(this,Zt,t),Ie(this,gd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},ig=new WeakSet,n3=function(t){In.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Z(this,er))}),Z(this,gr).getQueryCache().notify({query:Z(this,Zt),type:"observerResultsUpdated"})})},DA);function TN(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Hw(e,t){return TN(e,t)||e.state.dataUpdatedAt>0&&_m(e,t,t.refetchOnMount)}function _m(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Sm(e,t)}return!1}function Ww(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Sm(e,n)}function Sm(e,t){return e.isStaleByTime(t.staleTime)}function AN(e,t){return!bm(e.getCurrentResult(),t)}var qw=ue.createContext(void 0),IN=e=>{const t=ue.useContext(qw);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},NN=({client:e,children:t})=>(ue.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ue.createElement(qw.Provider,{value:e},t)),Uw=ue.createContext(!1),RN=()=>ue.useContext(Uw);Uw.Provider;function LN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $N=ue.createContext(LN()),FN=()=>ue.useContext($N);function jN(e,t){return typeof e=="function"?e(...t):!!e}var zN=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},BN=e=>{ue.useEffect(()=>{e.clearReset()},[e])},VN=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&jN(n,[e.error,r]),HN=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},WN=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,qN=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function UN(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=IN(n),i=RN(),o=FN(),s=r.defaultQueryOptions(e);s._optimisticResults=i?"isRestoring":"optimistic",HN(s),zN(s,o),BN(o);const[a]=ue.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(ue.useSyncExternalStore(ue.useCallback(c=>{const d=i?()=>{}:a.subscribe(In.batchCalls(c));return a.updateResult(),d},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),ue.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),WN(s,l))throw qN(s,a,o);if(VN({result:l,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Sr(e,t){return UN(e,DN,t)}var af={exports:{}};/**
|
|
59
|
+
*/var uw;function q3(){if(uw)return nm;uw=1;var e=m,t=lw();function n(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return nm.useSyncExternalStoreWithSelector=function(c,d,f,g,p){var v=o(null);if(v.current===null){var y={hasValue:!1,value:null};v.current=y}else y=v.current;v=a(function(){function w(k){if(!S){if(S=!0,C=k,k=g(k),p!==void 0&&y.hasValue){var A=y.value;if(p(A,k))return O=A}return O=k}if(A=O,r(C,k))return A;var L=g(k);return p!==void 0&&p(A,L)?A:(C=k,O=L)}var S=!1,C,O,P=f===void 0?null:f;return[function(){return w(d())},P===null?void 0:function(){return w(P())}]},[d,f,g,p]);var x=i(c,v[0],v[1]);return s(function(){y.hasValue=!0,y.value=x},[x]),l(x),x},nm}process.env.NODE_ENV==="production"?Zg.exports=q3():Zg.exports=W3();var U3=Zg.exports;const G3=Oc(U3);var dw={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:Y3}=m,{useSyncExternalStoreWithSelector:K3}=G3;let fw=!1;function X3(e,t=e.getState,n){(dw?"production":void 0)!=="production"&&n&&!fw&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),fw=!0);const r=K3(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return Y3(r),r}const hw=e=>{(dw?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?B3(e):e,n=(r,i)=>X3(t,r,i);return Object.assign(n,t),n},pw=e=>e?hw(e):hw;var gw=Symbol.for("immer-nothing"),mw=Symbol.for("immer-draftable"),wr=Symbol.for("immer-state"),Q3=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function ir(e,...t){if(process.env.NODE_ENV!=="production"){const n=Q3[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var tl=Object.getPrototypeOf;function nl(e){return!!e&&!!e[wr]}function As(e){var t;return e?vw(e)||Array.isArray(e)||!!e[mw]||!!((t=e.constructor)!=null&&t[mw])||Xd(e)||Qd(e):!1}var Z3=Object.prototype.constructor.toString();function vw(e){if(!e||typeof e!="object")return!1;const t=tl(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Z3}function Ac(e,t){Kd(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Kd(e){const t=e[wr];return t?t.type_:Array.isArray(e)?1:Xd(e)?2:Qd(e)?3:0}function rm(e,t){return Kd(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function bw(e,t,n){const r=Kd(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function J3(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Xd(e){return e instanceof Map}function Qd(e){return e instanceof Set}function Is(e){return e.copy_||e.base_}function im(e,t){if(Xd(e))return new Map(e);if(Qd(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&vw(e))return tl(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[wr];let r=Reflect.ownKeys(n);for(let i=0;i<r.length;i++){const o=r[i],s=n[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(tl(e),n)}function om(e,t=!1){return Zd(e)||nl(e)||!As(e)||(Kd(e)>1&&(e.set=e.add=e.clear=e.delete=eN),Object.freeze(e),t&&Ac(e,(n,r)=>om(r,!0))),e}function eN(){ir(2)}function Zd(e){return Object.isFrozen(e)}var tN={};function Ns(e){const t=tN[e];return t||ir(0,e),t}var Ic;function yw(){return Ic}function nN(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function xw(e,t){t&&(Ns("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function sm(e){am(e),e.drafts_.forEach(rN),e.drafts_=null}function am(e){e===Ic&&(Ic=e.parent_)}function ww(e){return Ic=nN(Ic,e)}function rN(e){const t=e[wr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function _w(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[wr].modified_&&(sm(t),ir(4)),As(e)&&(e=Jd(t,e),t.parent_||ef(t,e)),t.patches_&&Ns("Patches").generateReplacementPatches_(n[wr].base_,e,t.patches_,t.inversePatches_)):e=Jd(t,n,[]),sm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==gw?e:void 0}function Jd(e,t,n){if(Zd(t))return t;const r=t[wr];if(!r)return Ac(t,(i,o)=>Sw(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return ef(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,s=!1;r.type_===3&&(o=new Set(i),i.clear(),s=!0),Ac(o,(a,l)=>Sw(e,r,i,a,l,n,s)),ef(e,i,!1),n&&e.patches_&&Ns("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Sw(e,t,n,r,i,o,s){if(process.env.NODE_ENV!=="production"&&i===n&&ir(5),nl(i)){const a=o&&t&&t.type_!==3&&!rm(t.assigned_,r)?o.concat(r):void 0,l=Jd(e,i,a);if(bw(n,r,l),nl(l))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(As(i)&&!Zd(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Jd(e,i),(!t||!t.scope_.parent_)&&ef(e,i)}}function ef(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&om(t,n)}function iN(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:yw(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=lm;n&&(i=[r],o=Nc);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,a}var lm={get(e,t){if(t===wr)return e;const n=Is(e);if(!rm(n,t))return oN(e,n,t);const r=n[t];return e.finalized_||!As(r)?r:r===cm(e.base_,t)?(dm(e),e.copy_[t]=fm(r,e)):r},has(e,t){return t in Is(e)},ownKeys(e){return Reflect.ownKeys(Is(e))},set(e,t,n){const r=Cw(Is(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=cm(Is(e),t),o=i==null?void 0:i[wr];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(J3(n,i)&&(n!==void 0||rm(e.base_,t)))return!0;dm(e),um(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return cm(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,dm(e),um(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Is(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ir(11)},getPrototypeOf(e){return tl(e.base_)},setPrototypeOf(){ir(12)}},Nc={};Ac(lm,(e,t)=>{Nc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Nc.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&ir(13),Nc.set.call(this,e,t,void 0)},Nc.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&ir(14),lm.set.call(this,e[0],t,n,e[0])};function cm(e,t){const n=e[wr];return(n?Is(n):e)[t]}function oN(e,t,n){var i;const r=Cw(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Cw(e,t){if(!(t in e))return;let n=tl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=tl(n)}}function um(e){e.modified_||(e.modified_=!0,e.parent_&&um(e.parent_))}function dm(e){e.copy_||(e.copy_=im(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var sN=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,d=>n.call(this,d,...c))}}typeof n!="function"&&ir(6),r!==void 0&&typeof r!="function"&&ir(7);let i;if(As(t)){const o=ww(this),s=fm(t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?sm(o):am(o)}return xw(o,r),_w(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===gw&&(i=void 0),this.autoFreeze_&&om(i,!0),r){const o=[],s=[];Ns("Patches").generateReplacementPatches_(t,i,o,s),r(o,s)}return i}else ir(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){As(e)||ir(8),nl(e)&&(e=aN(e));const t=ww(this),n=fm(e,void 0);return n[wr].isManual_=!0,am(t),n}finishDraft(e,t){const n=e&&e[wr];(!n||!n.isManual_)&&ir(9);const{scope_:r}=n;return xw(r,t),_w(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Ns("Patches").applyPatches_;return nl(e)?r(e,t):this.produce(e,i=>r(i,t))}};function fm(e,t){const n=Xd(e)?Ns("MapSet").proxyMap_(e,t):Qd(e)?Ns("MapSet").proxySet_(e,t):iN(e,t);return(t?t.scope_:yw()).drafts_.push(n),n}function aN(e){return nl(e)||ir(10,e),Ew(e)}function Ew(e){if(!As(e)||Zd(e))return e;const t=e[wr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=im(e,t.scope_.immer_.useStrictShallowCopy_)}else n=im(e,!0);return Ac(n,(r,i)=>{bw(n,r,Ew(i))}),t&&(t.finalized_=!1),n}var _r=new sN,lN=_r.produce;_r.produceWithPatches.bind(_r),_r.setAutoFreeze.bind(_r),_r.setUseStrictShallowCopy.bind(_r),_r.applyPatches.bind(_r),_r.createDraft.bind(_r),_r.finishDraft.bind(_r);const Pw=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?lN(i):i;return t(a,o,...s)},e(r.setState,n,r));var tf,nf=kt;if(process.env.NODE_ENV==="production")tf=nf.createRoot,nf.hydrateRoot;else{var Ow=nf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;tf=function(e,t){Ow.usingClientEntryPoint=!0;try{return nf.createRoot(e,t)}finally{Ow.usingClientEntryPoint=!1}}}function kw(e,t,n){const r={count:0},i=a=>{const l=m.useRef(r.count);return m.useEffect(()=>{l.current+=1,l.current===r.count+1&&(l.current-=1,t.setState(a))}),null};if(i.displayName=`((${e})) devtool`,typeof document>"u")return;if(!n){let a=document.getElementById(`simple-zustand-devtools-${e}`);a||(a=document.createElement("div"),a.id=`simple-zustand-devtools-${e}`),document.body.appendChild(a),n=a}const o=tf(n),s=a=>{a&&(o.render(m.createElement(i,Object.assign({},a))),r.count+=1)};s(t.getState()),t.subscribe(s)}var Mw={},Dw={},hm={exports:{}},Gt=String,Tw=function(){return{isColorSupported:!1,reset:Gt,bold:Gt,dim:Gt,italic:Gt,underline:Gt,inverse:Gt,hidden:Gt,strikethrough:Gt,black:Gt,red:Gt,green:Gt,yellow:Gt,blue:Gt,magenta:Gt,cyan:Gt,white:Gt,gray:Gt,bgBlack:Gt,bgRed:Gt,bgGreen:Gt,bgYellow:Gt,bgBlue:Gt,bgMagenta:Gt,bgCyan:Gt,bgWhite:Gt}};hm.exports=Tw(),hm.exports.createColors=Tw;var cN=hm.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var d in c)Object.defineProperty(l,d,{enumerable:!0,get:c[d]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(cN);function r(l){return l&&l.__esModule?l:{default:l}}let i=new Set;function o(l,c,d){typeof process<"u"&&process.env.JEST_WORKER_ID||d&&i.has(d)||(d&&i.add(d),console.warn(""),c.forEach(f=>console.warn(l,"-",f)))}function s(l){return n.default.dim(l)}const a={info(l,c){o(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){o(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){o(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(Dw),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i}});const t=n(Dw);function n(o){return o&&o.__esModule?o:{default:o}}function r({version:o,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${o}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const i={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}(Mw);let pm=Mw;var uN=(pm.__esModule?pm:{default:pm}).default;const an=Oc(uN),gm={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, sans-serif"},dataset:{backgroundColor:[an.violet[400],an.red[400],an.amber[400],an.orange[400],an.rose[400]],borderColor:[an.violet[400],an.red[400],an.amber[400],an.orange[400],an.rose[400]]},options:{plugins:{datalabels:{display:!1,color:dN},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4},legend:{position:"top",align:"center",maxHeight:0}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:1,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[an.teal[100],an.purple[100],an.amber[100],an.orange[100],an.rose[100]],borderColor:[an.teal[400],an.purple[400],an.amber[400],an.orange[300],an.rose[400]]},options:{plugins:{tooltip:{backgroundColor:"#000",bodyColor:"#fff",borderWidth:.25,titleColor:"#fff",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4}},datalabels:{display:!1},scales:{x:{grid:{display:!0,color:an.slate[800]}},y:{grid:{display:!0,color:an.slate[800]}}}}}}};function dN(e){var r,i,o,s,a,l;const t=(a=(s=(o=(i=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:i._config)==null?void 0:o.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=Aw()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Aw()),fN(n)}function Aw(){return be.getState().theme==="dark"?"#000000":"#FFFFFF"}function fN(e){let t=0,n=0,r=0,i=0;const o=d=>{const f=d.replace("#",""),g=parseInt(f.substring(0,2),16),p=parseInt(f.substring(2,4),16),v=parseInt(f.substring(4,6),16);t+=g,n+=p,r+=v,i++};Array.isArray(e)?e.forEach(d=>{o(d)}):o(e);const s=t/i,a=n/i,l=r/i;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const be=pw()(Pw((e,t)=>({dashboard:{id:"",style:gm},selectedSheetId:null,selectedCardId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,isEditorSaveEvent:!1,actions:{setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setIsEditorSaveEvent:n=>{e(()=>({isEditorSaveEvent:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setDashboardTitle:n=>{e(r=>{r.dashboard&&(r.dashboard.title=n)})},setDashboardDescription:n=>{e(r=>{r.dashboard&&(r.dashboard.description=n)})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.title=r)})},setSheetDescription:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.description=r)})},setCards:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.cards=r)})},setCardTitle:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.title=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setCardSql:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.sql=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setCardData:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.data=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setCardDescription:(n,r,i)=>{e(o=>{var a,l,c,d;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.description=i,(d=o.onUpdateCard)==null||d.call(o,f,n))}})},setSheetLayout:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layout=r)})},setShowFilters:n=>{e(()=>({showFilters:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1?r.filterValues.splice(i,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n);i>-1&&r.filterValues.splice(i,1)}})},addFilter:n=>{e(r=>{var i;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n]})},removeFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n);console.log("index",s),s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1))}})},updateFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n.id);s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addCard:(n,r)=>{e(i=>{var s,a,l,c,d;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){(l=o.cards)==null||l.push(r);const f={i:r.id,x:0,y:1/0,w:20,h:7,minW:10};(c=o.layout)==null||c.push(f),(d=i.onAddCard)==null||d.call(i,r,n)}})},updateCard:(n,r)=>{e(i=>{var a,l,c,d,f;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(g=>g.id===r.id);o&&((d=o.cards)==null||d.splice(s,1,r),(f=i.onUpdateCard)==null||f.call(i,r,n))})},removeCard:(n,r)=>{e(i=>{var a,l,c,d,f,g;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((d=o.cards)==null||d.splice(s,1),(f=o.layout)==null||f.splice(s,1),(g=i.onRemoveCard)==null||g.call(i,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(i=>{var s,a,l;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);o&&(((l=o.cards)==null?void 0:l.find(d=>d.id===r))?i.selectedCardId=r:i.selectedCardId=null)})},setSelectedCard:n=>{e(r=>{r.selectedCard=n})},setSelectedSheetId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(i=>i.id===t().selectedSheetId)},getSelectedCard:()=>{var r,i,o;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(s=>s.id===t().selectedSheetId);return(o=n==null?void 0:n.cards)==null?void 0:o.find(s=>s.id===t().selectedCardId)},getSelectedSheetCards:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.cards},getSelectedSheetLayout:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layout},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style}}})));process.env.NODE_ENV==="development"&&kw("DashboardStore",be);var Rc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},rl=typeof window>"u"||"Deno"in window;function Kr(){}function hN(e,t){return typeof e=="function"?e(t):e}function mm(e){return typeof e=="number"&&e>=0&&e!==1/0}function Iw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Nw(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==vm(s,t.options))return!1}else if(!$c(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Rw(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Lc(t.options.mutationKey)!==Lc(o))return!1}else if(!$c(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function vm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Lc)(e)}function Lc(e){return JSON.stringify(e,(t,n)=>ym(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function $c(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!$c(e[n],t[n])):!1}function Lw(e,t){if(e===t)return e;const n=$w(e)&&$w(t);if(n||ym(e)&&ym(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const d=n?c:o[c];!n&&e[d]===void 0&&t[d]===void 0&&r.includes(d)?(a[d]=void 0,l++):(a[d]=Lw(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===s&&l===i?e:a}return t}function bm(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function $w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ym(e){if(!Fw(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Fw(n)||!n.hasOwnProperty("isPrototypeOf"))}function Fw(e){return Object.prototype.toString.call(e)==="[object Object]"}function pN(e){return new Promise(t=>{setTimeout(t,e)})}function xm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Lw(e,t):t}function gN(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function mN(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var vN=(_A=class extends Rc{constructor(){super();ze(this,Pa,void 0);ze(this,fs,void 0);ze(this,Ql,void 0);Ie(this,Ql,t=>{if(!rl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Z(this,fs)||this.setEventListener(Z(this,Ql))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,fs))==null||t.call(this),Ie(this,fs,void 0))}setEventListener(t){var n;Ie(this,Ql,t),(n=Z(this,fs))==null||n.call(this),Ie(this,fs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Z(this,Pa)!==t&&(Ie(this,Pa,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof Z(this,Pa)=="boolean"?Z(this,Pa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Pa=new WeakMap,fs=new WeakMap,Ql=new WeakMap,_A),rf=new vN,bN=(SA=class extends Rc{constructor(){super();ze(this,Zl,!0);ze(this,hs,void 0);ze(this,Jl,void 0);Ie(this,Jl,t=>{if(!rl&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Z(this,hs)||this.setEventListener(Z(this,Jl))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,hs))==null||t.call(this),Ie(this,hs,void 0))}setEventListener(t){var n;Ie(this,Jl,t),(n=Z(this,hs))==null||n.call(this),Ie(this,hs,t(this.setOnline.bind(this)))}setOnline(t){Z(this,Zl)!==t&&(Ie(this,Zl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Z(this,Zl)}},Zl=new WeakMap,hs=new WeakMap,Jl=new WeakMap,SA),of=new bN;function yN(e){return Math.min(1e3*2**e,3e4)}function sf(e){return(e??"online")==="online"?of.isOnline():!0}var jw=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wm(e){return e instanceof jw}function zw(e){let t=!1,n=0,r=!1,i,o,s;const a=new Promise((x,w)=>{o=x,s=w}),l=x=>{var w;r||(p(new jw(x)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},d=()=>{t=!1},f=()=>!rf.isFocused()||e.networkMode!=="always"&&!of.isOnline(),g=x=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,x),i==null||i(),o(x))},p=x=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,x),i==null||i(),s(x))},v=()=>new Promise(x=>{var w;i=S=>{const C=r||!f();return C&&x(S),C},(w=e.onPause)==null||w.call(e)}).then(()=>{var x;i=void 0,r||(x=e.onContinue)==null||x.call(e)}),y=()=>{if(r)return;let x;try{x=e.fn()}catch(w){x=Promise.reject(w)}Promise.resolve(x).then(g).catch(w=>{var k;if(r)return;const S=e.retry??(rl?0:3),C=e.retryDelay??yN,O=typeof C=="function"?C(n,w):C,P=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,w);if(t||!P){p(w);return}n++,(k=e.onFail)==null||k.call(e,n,w),pN(O).then(()=>{if(f())return v()}).then(()=>{t?p(w):y()})})};return sf(e.networkMode)?y():v().then(y),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:c,continueRetry:d}}function xN(){let e=[],t=0,n=g=>{g()},r=g=>{g()},i=g=>setTimeout(g,0);const o=g=>{i=g},s=g=>{let p;t++;try{p=g()}finally{t--,t||c()}return p},a=g=>{t?e.push(g):i(()=>{n(g)})},l=g=>(...p)=>{a(()=>{g(...p)})},c=()=>{const g=e;e=[],g.length&&i(()=>{r(()=>{g.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:g=>{n=g},setBatchNotifyFunction:g=>{r=g},setScheduler:o}}var In=xN(),Bw=(CA=class{constructor(){ze(this,Oa,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mm(this.gcTime)&&Ie(this,Oa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rl?1/0:5*60*1e3))}clearGcTimeout(){Z(this,Oa)&&(clearTimeout(Z(this,Oa)),Ie(this,Oa,void 0))}},Oa=new WeakMap,CA),wN=(EA=class extends Bw{constructor(t){super();ze(this,nc);ze(this,Si);ze(this,ec,void 0);ze(this,tc,void 0);ze(this,ri,void 0);ze(this,ps,void 0);ze(this,ii,void 0);ze(this,Mn,void 0);ze(this,fd,void 0);ze(this,ka,void 0);Ie(this,ka,!1),Ie(this,fd,t.defaultOptions),xt(this,nc,Gg).call(this,t.options),Ie(this,Mn,[]),Ie(this,ri,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ie(this,ec,t.state||_N(this.options)),this.state=Z(this,ec),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!Z(this,Mn).length&&this.state.fetchStatus==="idle"&&Z(this,ri).remove(this)}setData(t,n){const r=xm(this.state.data,t,this.options);return xt(this,Si,No).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){xt(this,Si,No).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=Z(this,ps);return(r=Z(this,ii))==null||r.cancel(t),n?n.then(Kr).catch(Kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Z(this,ec))}isActive(){return Z(this,Mn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||Z(this,Mn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Iw(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=Z(this,Mn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,ii))==null||n.continue()}onOnline(){var n;const t=Z(this,Mn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Z(this,ii))==null||n.continue()}addObserver(t){Z(this,Mn).includes(t)||(Z(this,Mn).push(t),this.clearGcTimeout(),Z(this,ri).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){Z(this,Mn).includes(t)&&(Ie(this,Mn,Z(this,Mn).filter(n=>n!==t)),Z(this,Mn).length||(Z(this,ii)&&(Z(this,ka)?Z(this,ii).cancel({revert:!0}):Z(this,ii).cancelRetry()),this.scheduleGc()),Z(this,ri).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return Z(this,Mn).length}invalidate(){this.state.isInvalidated||xt(this,Si,No).call(this,{type:"invalidate"})}fetch(t,n){var c,d,f,g;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Z(this,ps))return(c=Z(this,ii))==null||c.continueRetry(),Z(this,ps)}if(t&&xt(this,nc,Gg).call(this,t),!this.options.queryFn){const p=Z(this,Mn).find(v=>v.options.queryFn);p&&xt(this,nc,Gg).call(this,p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,i={queryKey:this.queryKey,meta:this.meta},o=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Ie(this,ka,!0),r.signal)})};o(i);const s=()=>this.options.queryFn?(Ie(this,ka,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};o(a),(d=this.options.behavior)==null||d.onFetch(a,this),Ie(this,tc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&xt(this,Si,No).call(this,{type:"fetch",meta:(g=a.fetchOptions)==null?void 0:g.meta});const l=p=>{var v,y,x,w;wm(p)&&p.silent||xt(this,Si,No).call(this,{type:"error",error:p}),wm(p)||((y=(v=Z(this,ri).config).onError)==null||y.call(v,p,this),(w=(x=Z(this,ri).config).onSettled)==null||w.call(x,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ie(this,ii,zw({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var v,y,x,w;if(typeof p>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(p),(y=(v=Z(this,ri).config).onSuccess)==null||y.call(v,p,this),(w=(x=Z(this,ri).config).onSettled)==null||w.call(x,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,v)=>{xt(this,Si,No).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{xt(this,Si,No).call(this,{type:"pause"})},onContinue:()=>{xt(this,Si,No).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ie(this,ps,Z(this,ii).promise),Z(this,ps)}},ec=new WeakMap,tc=new WeakMap,ri=new WeakMap,ps=new WeakMap,ii=new WeakMap,Mn=new WeakMap,fd=new WeakMap,ka=new WeakMap,nc=new WeakSet,Gg=function(t){this.options={...Z(this,fd),...t},this.updateGcTime(this.options.gcTime)},Si=new WeakSet,No=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:sf(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return wm(i)&&i.revert&&Z(this,tc)?{...Z(this,tc),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),In.batch(()=>{Z(this,Mn).forEach(r=>{r.onQueryUpdate()}),Z(this,ri).notify({query:this,type:"updated",action:t})})},EA);function _N(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var SN=(PA=class extends Rc{constructor(t={}){super();ze(this,Yi,void 0);this.config=t,Ie(this,Yi,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??vm(i,n);let s=this.get(o);return s||(s=new wN({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){Z(this,Yi).has(t.queryHash)||(Z(this,Yi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Z(this,Yi).get(t.queryHash);n&&(t.destroy(),n===t&&Z(this,Yi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){In.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Z(this,Yi).get(t)}getAll(){return[...Z(this,Yi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Nw(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Nw(t,r)):n}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){In.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){In.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Yi=new WeakMap,PA),CN=(OA=class extends Bw{constructor(t){super();ze(this,Xi);ze(this,Ki,void 0);ze(this,hd,void 0);ze(this,zr,void 0);ze(this,rc,void 0);this.mutationId=t.mutationId,Ie(this,hd,t.defaultOptions),Ie(this,zr,t.mutationCache),Ie(this,Ki,[]),this.state=t.state||EN(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...Z(this,hd),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Z(this,Ki).includes(t)||(Z(this,Ki).push(t),this.clearGcTimeout(),Z(this,zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ie(this,Ki,Z(this,Ki).filter(n=>n!==t)),this.scheduleGc(),Z(this,zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Z(this,Ki).length||(this.state.status==="pending"?this.scheduleGc():Z(this,zr).remove(this))}continue(){var t;return((t=Z(this,rc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,c,d,f,g,p,v,y,x,w,S,C,O,P,k,A;const n=()=>(Ie(this,rc,zw({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(L,F)=>{xt(this,Xi,ks).call(this,{type:"failed",failureCount:L,error:F})},onPause:()=>{xt(this,Xi,ks).call(this,{type:"pause"})},onContinue:()=>{xt(this,Xi,ks).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),Z(this,rc).promise),r=this.state.status==="pending";try{if(!r){xt(this,Xi,ks).call(this,{type:"pending",variables:t}),await((o=(i=Z(this,zr).config).onMutate)==null?void 0:o.call(i,t,this));const F=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));F!==this.state.context&&xt(this,Xi,ks).call(this,{type:"pending",context:F,variables:t})}const L=await n();return await((c=(l=Z(this,zr).config).onSuccess)==null?void 0:c.call(l,L,t,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,L,t,this.state.context)),await((p=(g=Z(this,zr).config).onSettled)==null?void 0:p.call(g,L,null,this.state.variables,this.state.context,this)),await((y=(v=this.options).onSettled)==null?void 0:y.call(v,L,null,t,this.state.context)),xt(this,Xi,ks).call(this,{type:"success",data:L}),L}catch(L){try{throw await((w=(x=Z(this,zr).config).onError)==null?void 0:w.call(x,L,t,this.state.context,this)),await((C=(S=this.options).onError)==null?void 0:C.call(S,L,t,this.state.context)),await((P=(O=Z(this,zr).config).onSettled)==null?void 0:P.call(O,void 0,L,this.state.variables,this.state.context,this)),await((A=(k=this.options).onSettled)==null?void 0:A.call(k,void 0,L,t,this.state.context)),L}finally{xt(this,Xi,ks).call(this,{type:"error",error:L})}}}},Ki=new WeakMap,hd=new WeakMap,zr=new WeakMap,rc=new WeakMap,Xi=new WeakSet,ks=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!sf(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),In.batch(()=>{Z(this,Ki).forEach(r=>{r.onMutationUpdate(t)}),Z(this,zr).notify({mutation:this,type:"updated",action:t})})},OA);function EN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var PN=(kA=class extends Rc{constructor(t={}){super();ze(this,oi,void 0);ze(this,pd,void 0);ze(this,Ma,void 0);this.config=t,Ie(this,oi,[]),Ie(this,pd,0)}build(t,n,r){const i=new CN({mutationCache:this,mutationId:++Ug(this,pd)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){Z(this,oi).push(t),this.notify({type:"added",mutation:t})}remove(t){Ie(this,oi,Z(this,oi).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){In.batch(()=>{Z(this,oi).forEach(t=>{this.remove(t)})})}getAll(){return Z(this,oi)}find(t){const n={exact:!0,...t};return Z(this,oi).find(r=>Rw(n,r))}findAll(t={}){return Z(this,oi).filter(n=>Rw(t,n))}notify(t){In.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ie(this,Ma,(Z(this,Ma)??Promise.resolve()).then(()=>{const t=Z(this,oi).filter(n=>n.state.isPaused);return In.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Kr)),Promise.resolve()))}).then(()=>{Ie(this,Ma,void 0)})),Z(this,Ma)}},oi=new WeakMap,pd=new WeakMap,Ma=new WeakMap,kA);function ON(e){return{onFetch:(t,n)=>{const r=async()=>{var v,y,x,w,S;const i=t.options,o=(x=(y=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:y.fetchMore)==null?void 0:x.direction,s=((w=t.state.data)==null?void 0:w.pages)||[],a=((S=t.state.data)==null?void 0:S.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const d=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),g=async(C,O,P)=>{if(c)return Promise.reject();if(O==null&&C.pages.length)return Promise.resolve(C);const k={queryKey:t.queryKey,pageParam:O,direction:P?"backward":"forward",meta:t.options.meta};d(k);const A=await f(k),{maxPages:L}=t.options,F=P?mN:gN;return{pages:F(C.pages,A,L),pageParams:F(C.pageParams,O,L)}};let p;if(o&&s.length){const C=o==="backward",O=C?kN:Vw,P={pages:s,pageParams:a},k=O(i,P);p=await g(P,k,C)}else{p=await g(l,a[0]??i.initialPageParam);const C=e??s.length;for(let O=1;O<C;O++){const P=Vw(i,p);p=await g(p,P)}}return p};t.options.persister?t.fetchFn=()=>{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function Vw(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function kN(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var MN=(MA=class{constructor(e={}){ze(this,Sn,void 0);ze(this,gs,void 0);ze(this,ms,void 0);ze(this,ic,void 0);ze(this,oc,void 0);ze(this,vs,void 0);ze(this,sc,void 0);ze(this,ac,void 0);Ie(this,Sn,e.queryCache||new SN),Ie(this,gs,e.mutationCache||new PN),Ie(this,ms,e.defaultOptions||{}),Ie(this,ic,new Map),Ie(this,oc,new Map),Ie(this,vs,0)}mount(){Ug(this,vs)._++,Z(this,vs)===1&&(Ie(this,sc,rf.subscribe(()=>{rf.isFocused()&&(this.resumePausedMutations(),Z(this,Sn).onFocus())})),Ie(this,ac,of.subscribe(()=>{of.isOnline()&&(this.resumePausedMutations(),Z(this,Sn).onOnline())})))}unmount(){var e,t;Ug(this,vs)._--,Z(this,vs)===0&&((e=Z(this,sc))==null||e.call(this),Ie(this,sc,void 0),(t=Z(this,ac))==null||t.call(this),Ie(this,ac,void 0))}isFetching(e){return Z(this,Sn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Z(this,gs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=Z(this,Sn).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=Z(this,Sn).find({queryKey:e}),i=r==null?void 0:r.state.data,o=hN(t,i);if(typeof o>"u")return;const s=this.defaultQueryOptions({queryKey:e});return Z(this,Sn).build(this,s).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return In.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=Z(this,Sn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=Z(this,Sn);In.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Z(this,Sn),r={type:"active",...e};return In.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=In.batch(()=>Z(this,Sn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kr).catch(Kr)}invalidateQueries(e={},t={}){return In.batch(()=>{if(Z(this,Sn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=In.batch(()=>Z(this,Sn).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Kr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Kr)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=Z(this,Sn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kr).catch(Kr)}fetchInfiniteQuery(e){return e.behavior=ON(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kr).catch(Kr)}resumePausedMutations(){return Z(this,gs).resumePausedMutations()}getQueryCache(){return Z(this,Sn)}getMutationCache(){return Z(this,gs)}getDefaultOptions(){return Z(this,ms)}setDefaultOptions(e){Ie(this,ms,e)}setQueryDefaults(e,t){Z(this,ic).set(Lc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Z(this,ic).values()];let n={};return t.forEach(r=>{$c(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){Z(this,oc).set(Lc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Z(this,oc).values()];let n={};return t.forEach(r=>{$c(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...Z(this,ms).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=vm(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Z(this,ms).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Z(this,Sn).clear(),Z(this,gs).clear()}},Sn=new WeakMap,gs=new WeakMap,ms=new WeakMap,ic=new WeakMap,oc=new WeakMap,vs=new WeakMap,sc=new WeakMap,ac=new WeakMap,MA),DN=(DA=class extends Rc{constructor(t,n){super();ze(this,Ia);ze(this,vd);ze(this,bd);ze(this,yd);ze(this,xd);ze(this,wd);ze(this,_d);ze(this,Sd);ze(this,ig);ze(this,gr,void 0);ze(this,Zt,void 0);ze(this,gd,void 0);ze(this,er,void 0);ze(this,Da,void 0);ze(this,lc,void 0);ze(this,Qi,void 0);ze(this,md,void 0);ze(this,cc,void 0);ze(this,uc,void 0);ze(this,Ta,void 0);ze(this,Aa,void 0);ze(this,bs,void 0);ze(this,dc,new Set);this.options=n,Ie(this,gr,t),Ie(this,Qi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Z(this,Zt).addObserver(this),Hw(Z(this,Zt),this.options)?xt(this,Ia,qd).call(this):this.updateResult(),xt(this,xd,W1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _m(Z(this,Zt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _m(Z(this,Zt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,xt(this,wd,q1).call(this),xt(this,_d,U1).call(this),Z(this,Zt).removeObserver(this)}setOptions(t,n){const r=this.options,i=Z(this,Zt);if(this.options=Z(this,gr).defaultQueryOptions(t),bm(r,this.options)||Z(this,gr).getQueryCache().notify({type:"observerOptionsUpdated",query:Z(this,Zt),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),xt(this,Sd,G1).call(this);const o=this.hasListeners();o&&Ww(Z(this,Zt),i,this.options,r)&&xt(this,Ia,qd).call(this),this.updateResult(n),o&&(Z(this,Zt)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&xt(this,vd,B1).call(this);const s=xt(this,bd,V1).call(this);o&&(Z(this,Zt)!==i||this.options.enabled!==r.enabled||s!==Z(this,bs))&&xt(this,yd,H1).call(this,s)}getOptimisticResult(t){const n=Z(this,gr).getQueryCache().build(Z(this,gr),t),r=this.createResult(n,t);return AN(this,r)&&(Ie(this,er,r),Ie(this,lc,this.options),Ie(this,Da,Z(this,Zt).state)),r}getCurrentResult(){return Z(this,er)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(Z(this,dc).add(r),t[r])})}),n}getCurrentQuery(){return Z(this,Zt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Z(this,gr).defaultQueryOptions(t),r=Z(this,gr).getQueryCache().build(Z(this,gr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return xt(this,Ia,qd).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Z(this,er)))}createResult(t,n){var k;const r=Z(this,Zt),i=this.options,o=Z(this,er),s=Z(this,Da),a=Z(this,lc),c=t!==r?t.state:Z(this,gd),{state:d}=t;let{error:f,errorUpdatedAt:g,fetchStatus:p,status:v}=d,y=!1,x;if(n._optimisticResults){const A=this.hasListeners(),L=!A&&Hw(t,n),F=A&&Ww(t,r,n,i);(L||F)&&(p=sf(t.options.networkMode)?"fetching":"paused",d.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof d.data<"u")if(o&&d.data===(s==null?void 0:s.data)&&n.select===Z(this,md))x=Z(this,cc);else try{Ie(this,md,n.select),x=n.select(d.data),x=xm(o==null?void 0:o.data,x,n),Ie(this,cc,x),Ie(this,Qi,null)}catch(A){Ie(this,Qi,A)}else x=d.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let A;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))A=o.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((k=Z(this,uc))==null?void 0:k.state.data,Z(this,uc)):n.placeholderData,n.select&&typeof A<"u")try{A=n.select(A),Ie(this,Qi,null)}catch(L){Ie(this,Qi,L)}typeof A<"u"&&(v="success",x=xm(o==null?void 0:o.data,A,n),y=!0)}Z(this,Qi)&&(f=Z(this,Qi),x=Z(this,cc),g=Date.now(),v="error");const w=p==="fetching",S=v==="pending",C=v==="error",O=S&&w;return{status:v,fetchStatus:p,isPending:S,isSuccess:v==="success",isError:C,isInitialLoading:O,isLoading:O,data:x,dataUpdatedAt:d.dataUpdatedAt,error:f,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!S,isLoadingError:C&&d.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:y,isRefetchError:C&&d.dataUpdatedAt!==0,isStale:Sm(t,n),refetch:this.refetch}}updateResult(t){const n=Z(this,er),r=this.createResult(Z(this,Zt),this.options);if(Ie(this,Da,Z(this,Zt).state),Ie(this,lc,this.options),Z(this,Da).data!==void 0&&Ie(this,uc,Z(this,Zt)),bm(r,n))return;Ie(this,er,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!Z(this,dc).size)return!0;const l=new Set(a??Z(this,dc));return this.options.throwOnError&&l.add("error"),Object.keys(Z(this,er)).some(c=>{const d=c;return Z(this,er)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),xt(this,ig,n3).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&xt(this,xd,W1).call(this)}},gr=new WeakMap,Zt=new WeakMap,gd=new WeakMap,er=new WeakMap,Da=new WeakMap,lc=new WeakMap,Qi=new WeakMap,md=new WeakMap,cc=new WeakMap,uc=new WeakMap,Ta=new WeakMap,Aa=new WeakMap,bs=new WeakMap,dc=new WeakMap,Ia=new WeakSet,qd=function(t){xt(this,Sd,G1).call(this);let n=Z(this,Zt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Kr)),n},vd=new WeakSet,B1=function(){if(xt(this,wd,q1).call(this),rl||Z(this,er).isStale||!mm(this.options.staleTime))return;const n=Iw(Z(this,er).dataUpdatedAt,this.options.staleTime)+1;Ie(this,Ta,setTimeout(()=>{Z(this,er).isStale||this.updateResult()},n))},bd=new WeakSet,V1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Z(this,Zt)):this.options.refetchInterval)??!1},yd=new WeakSet,H1=function(t){xt(this,_d,U1).call(this),Ie(this,bs,t),!(rl||this.options.enabled===!1||!mm(Z(this,bs))||Z(this,bs)===0)&&Ie(this,Aa,setInterval(()=>{(this.options.refetchIntervalInBackground||rf.isFocused())&&xt(this,Ia,qd).call(this)},Z(this,bs)))},xd=new WeakSet,W1=function(){xt(this,vd,B1).call(this),xt(this,yd,H1).call(this,xt(this,bd,V1).call(this))},wd=new WeakSet,q1=function(){Z(this,Ta)&&(clearTimeout(Z(this,Ta)),Ie(this,Ta,void 0))},_d=new WeakSet,U1=function(){Z(this,Aa)&&(clearInterval(Z(this,Aa)),Ie(this,Aa,void 0))},Sd=new WeakSet,G1=function(){const t=Z(this,gr).getQueryCache().build(Z(this,gr),this.options);if(t===Z(this,Zt))return;const n=Z(this,Zt);Ie(this,Zt,t),Ie(this,gd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},ig=new WeakSet,n3=function(t){In.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Z(this,er))}),Z(this,gr).getQueryCache().notify({query:Z(this,Zt),type:"observerResultsUpdated"})})},DA);function TN(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Hw(e,t){return TN(e,t)||e.state.dataUpdatedAt>0&&_m(e,t,t.refetchOnMount)}function _m(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Sm(e,t)}return!1}function Ww(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Sm(e,n)}function Sm(e,t){return e.isStaleByTime(t.staleTime)}function AN(e,t){return!bm(e.getCurrentResult(),t)}var qw=ue.createContext(void 0),IN=e=>{const t=ue.useContext(qw);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},NN=({client:e,children:t})=>(ue.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ue.createElement(qw.Provider,{value:e},t)),Uw=ue.createContext(!1),RN=()=>ue.useContext(Uw);Uw.Provider;function LN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $N=ue.createContext(LN()),FN=()=>ue.useContext($N);function jN(e,t){return typeof e=="function"?e(...t):!!e}var zN=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},BN=e=>{ue.useEffect(()=>{e.clearReset()},[e])},VN=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&jN(n,[e.error,r]),HN=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},WN=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,qN=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function UN(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=IN(n),i=RN(),o=FN(),s=r.defaultQueryOptions(e);s._optimisticResults=i?"isRestoring":"optimistic",HN(s),zN(s,o),BN(o);const[a]=ue.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(ue.useSyncExternalStore(ue.useCallback(c=>{const d=i?()=>{}:a.subscribe(In.batchCalls(c));return a.updateResult(),d},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),ue.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),WN(s,l))throw qN(s,a,o);if(VN({result:l,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Sr(e,t){return UN(e,DN,t)}var af={exports:{}};/**
|
|
60
60
|
* @license
|
|
61
61
|
* Lodash <https://lodash.com/>
|
|
62
62
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"email": "support@semaphor.cloud"
|
|
6
6
|
},
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"version": "0.0.
|
|
8
|
+
"version": "0.0.41",
|
|
9
9
|
"description": "Fully interactive and customizable dashboards for your apps. Embed analytics and insights into your app with ease.",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"react",
|