UNPKG

@elizaos/plugin-knowledge

Version:
33 lines 409 kB
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function i(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(a){if(a.ep)return;a.ep=!0;const u=i(a);fetch(a.href,u)}})();function Qp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hu={exports:{}},no={},du={exports:{}},Ce={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ad;function fy(){if(ad)return Ce;ad=1;var e=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),m=Symbol.iterator;function x(M){return M===null||typeof M!="object"?null:(M=m&&M[m]||M["@@iterator"],typeof M=="function"?M:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,C={};function S(M,q,ue){this.props=M,this.context=q,this.refs=C,this.updater=ue||w}S.prototype.isReactComponent={},S.prototype.setState=function(M,q){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,q,"setState")},S.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function k(){}k.prototype=S.prototype;function O(M,q,ue){this.props=M,this.context=q,this.refs=C,this.updater=ue||w}var D=O.prototype=new k;D.constructor=O,b(D,S.prototype),D.isPureReactComponent=!0;var P=Array.isArray,T=Object.prototype.hasOwnProperty,z={current:null},A={key:!0,ref:!0,__self:!0,__source:!0};function L(M,q,ue){var fe,ve={},xe=null,Se=null;if(q!=null)for(fe in q.ref!==void 0&&(Se=q.ref),q.key!==void 0&&(xe=""+q.key),q)T.call(q,fe)&&!A.hasOwnProperty(fe)&&(ve[fe]=q[fe]);var be=arguments.length-2;if(be===1)ve.children=ue;else if(1<be){for(var Pe=Array(be),lt=0;lt<be;lt++)Pe[lt]=arguments[lt+2];ve.children=Pe}if(M&&M.defaultProps)for(fe in be=M.defaultProps,be)ve[fe]===void 0&&(ve[fe]=be[fe]);return{$$typeof:e,type:M,key:xe,ref:Se,props:ve,_owner:z.current}}function W(M,q){return{$$typeof:e,type:M.type,key:q,ref:M.ref,props:M.props,_owner:M._owner}}function X(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function Z(M){var q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(ue){return q[ue]})}var oe=/\/+/g;function de(M,q){return typeof M=="object"&&M!==null&&M.key!=null?Z(""+M.key):q.toString(36)}function F(M,q,ue,fe,ve){var xe=typeof M;(xe==="undefined"||xe==="boolean")&&(M=null);var Se=!1;if(M===null)Se=!0;else switch(xe){case"string":case"number":Se=!0;break;case"object":switch(M.$$typeof){case e:case n:Se=!0}}if(Se)return Se=M,ve=ve(Se),M=fe===""?"."+de(Se,0):fe,P(ve)?(ue="",M!=null&&(ue=M.replace(oe,"$&/")+"/"),F(ve,q,ue,"",function(lt){return lt})):ve!=null&&(X(ve)&&(ve=W(ve,ue+(!ve.key||Se&&Se.key===ve.key?"":(""+ve.key).replace(oe,"$&/")+"/")+M)),q.push(ve)),1;if(Se=0,fe=fe===""?".":fe+":",P(M))for(var be=0;be<M.length;be++){xe=M[be];var Pe=fe+de(xe,be);Se+=F(xe,q,ue,Pe,ve)}else if(Pe=x(M),typeof Pe=="function")for(M=Pe.call(M),be=0;!(xe=M.next()).done;)xe=xe.value,Pe=fe+de(xe,be++),Se+=F(xe,q,ue,Pe,ve);else if(xe==="object")throw q=String(M),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.");return Se}function ee(M,q,ue){if(M==null)return M;var fe=[],ve=0;return F(M,fe,"","",function(xe){return q.call(ue,xe,ve++)}),fe}function Q(M){if(M._status===-1){var q=M._result;q=q(),q.then(function(ue){(M._status===0||M._status===-1)&&(M._status=1,M._result=ue)},function(ue){(M._status===0||M._status===-1)&&(M._status=2,M._result=ue)}),M._status===-1&&(M._status=0,M._result=q)}if(M._status===1)return M._result.default;throw M._result}var ne={current:null},V={transition:null},Y={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:V,ReactCurrentOwner:z};function B(){throw Error("act(...) is not supported in production builds of React.")}return Ce.Children={map:ee,forEach:function(M,q,ue){ee(M,function(){q.apply(this,arguments)},ue)},count:function(M){var q=0;return ee(M,function(){q++}),q},toArray:function(M){return ee(M,function(q){return q})||[]},only:function(M){if(!X(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},Ce.Component=S,Ce.Fragment=i,Ce.Profiler=a,Ce.PureComponent=O,Ce.StrictMode=s,Ce.Suspense=p,Ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,Ce.act=B,Ce.cloneElement=function(M,q,ue){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var fe=b({},M.props),ve=M.key,xe=M.ref,Se=M._owner;if(q!=null){if(q.ref!==void 0&&(xe=q.ref,Se=z.current),q.key!==void 0&&(ve=""+q.key),M.type&&M.type.defaultProps)var be=M.type.defaultProps;for(Pe in q)T.call(q,Pe)&&!A.hasOwnProperty(Pe)&&(fe[Pe]=q[Pe]===void 0&&be!==void 0?be[Pe]:q[Pe])}var Pe=arguments.length-2;if(Pe===1)fe.children=ue;else if(1<Pe){be=Array(Pe);for(var lt=0;lt<Pe;lt++)be[lt]=arguments[lt+2];fe.children=be}return{$$typeof:e,type:M.type,key:ve,ref:xe,props:fe,_owner:Se}},Ce.createContext=function(M){return M={$$typeof:f,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:u,_context:M},M.Consumer=M},Ce.createElement=L,Ce.createFactory=function(M){var q=L.bind(null,M);return q.type=M,q},Ce.createRef=function(){return{current:null}},Ce.forwardRef=function(M){return{$$typeof:h,render:M}},Ce.isValidElement=X,Ce.lazy=function(M){return{$$typeof:v,_payload:{_status:-1,_result:M},_init:Q}},Ce.memo=function(M,q){return{$$typeof:g,type:M,compare:q===void 0?null:q}},Ce.startTransition=function(M){var q=V.transition;V.transition={};try{M()}finally{V.transition=q}},Ce.unstable_act=B,Ce.useCallback=function(M,q){return ne.current.useCallback(M,q)},Ce.useContext=function(M){return ne.current.useContext(M)},Ce.useDebugValue=function(){},Ce.useDeferredValue=function(M){return ne.current.useDeferredValue(M)},Ce.useEffect=function(M,q){return ne.current.useEffect(M,q)},Ce.useId=function(){return ne.current.useId()},Ce.useImperativeHandle=function(M,q,ue){return ne.current.useImperativeHandle(M,q,ue)},Ce.useInsertionEffect=function(M,q){return ne.current.useInsertionEffect(M,q)},Ce.useLayoutEffect=function(M,q){return ne.current.useLayoutEffect(M,q)},Ce.useMemo=function(M,q){return ne.current.useMemo(M,q)},Ce.useReducer=function(M,q,ue){return ne.current.useReducer(M,q,ue)},Ce.useRef=function(M){return ne.current.useRef(M)},Ce.useState=function(M){return ne.current.useState(M)},Ce.useSyncExternalStore=function(M,q,ue){return ne.current.useSyncExternalStore(M,q,ue)},Ce.useTransition=function(){return ne.current.useTransition()},Ce.version="18.3.1",Ce}var ud;function sc(){return ud||(ud=1,du.exports=fy()),du.exports}/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var cd;function hy(){if(cd)return no;cd=1;var e=sc(),n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function f(h,p,g){var v,m={},x=null,w=null;g!==void 0&&(x=""+g),p.key!==void 0&&(x=""+p.key),p.ref!==void 0&&(w=p.ref);for(v in p)s.call(p,v)&&!u.hasOwnProperty(v)&&(m[v]=p[v]);if(h&&h.defaultProps)for(v in p=h.defaultProps,p)m[v]===void 0&&(m[v]=p[v]);return{$$typeof:n,type:h,key:x,ref:w,props:m,_owner:a.current}}return no.Fragment=i,no.jsx=f,no.jsxs=f,no}var fd;function dy(){return fd||(fd=1,hu.exports=hy()),hu.exports}var N=dy(),ui=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(){}},Nr=typeof window>"u"||"Deno"in globalThis;function ct(){}function py(e,n){return typeof e=="function"?e(n):e}function Au(e){return typeof e=="number"&&e>=0&&e!==1/0}function Bp(e,n){return Math.max(e+(n||0)-Date.now(),0)}function sr(e,n){return typeof e=="function"?e(n):e}function Gt(e,n){return typeof e=="function"?e(n):e}function hd(e,n){const{type:i="all",exact:s,fetchStatus:a,predicate:u,queryKey:f,stale:h}=e;if(f){if(s){if(n.queryHash!==lc(f,n.options))return!1}else if(!_o(n.queryKey,f))return!1}if(i!=="all"){const p=n.isActive();if(i==="active"&&!p||i==="inactive"&&p)return!1}return!(typeof h=="boolean"&&n.isStale()!==h||a&&a!==n.state.fetchStatus||u&&!u(n))}function dd(e,n){const{exact:i,status:s,predicate:a,mutationKey:u}=e;if(u){if(!n.options.mutationKey)return!1;if(i){if(Pr(n.options.mutationKey)!==Pr(u))return!1}else if(!_o(n.options.mutationKey,u))return!1}return!(s&&n.state.status!==s||a&&!a(n))}function lc(e,n){return(n?.queryKeyHashFn||Pr)(e)}function Pr(e){return JSON.stringify(e,(n,i)=>zu(i)?Object.keys(i).sort().reduce((s,a)=>(s[a]=i[a],s),{}):i)}function _o(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(i=>_o(e[i],n[i])):!1}function Wp(e,n){if(e===n)return e;const i=pd(e)&&pd(n);if(i||zu(e)&&zu(n)){const s=i?e:Object.keys(e),a=s.length,u=i?n:Object.keys(n),f=u.length,h=i?[]:{},p=new Set(s);let g=0;for(let v=0;v<f;v++){const m=i?v:u[v];(!i&&p.has(m)||i)&&e[m]===void 0&&n[m]===void 0?(h[m]=void 0,g++):(h[m]=Wp(e[m],n[m]),h[m]===e[m]&&e[m]!==void 0&&g++)}return a===f&&g===a?e:h}return n}function al(e,n){if(!n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const i in e)if(e[i]!==n[i])return!1;return!0}function pd(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function zu(e){if(!gd(e))return!1;const n=e.constructor;if(n===void 0)return!0;const i=n.prototype;return!(!gd(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function gd(e){return Object.prototype.toString.call(e)==="[object Object]"}function gy(e){return new Promise(n=>{setTimeout(n,e)})}function Du(e,n,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,n):i.structuralSharing!==!1?Wp(e,n):n}function my(e,n,i=0){const s=[...e,n];return i&&s.length>i?s.slice(1):s}function yy(e,n,i=0){const s=[n,...e];return i&&s.length>i?s.slice(0,-1):s}var ac=Symbol();function Kp(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===ac?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gp(e,n){return typeof e=="function"?e(...n):!!e}var vy=class extends ui{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Nr&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},uc=new vy,xy=class extends ui{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Nr&&window.addEventListener){const n=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#t}},ul=new xy;function Iu(){let e,n;const i=new Promise((a,u)=>{e=a,n=u});i.status="pending",i.catch(()=>{});function s(a){Object.assign(i,a),delete i.resolve,delete i.reject}return i.resolve=a=>{s({status:"fulfilled",value:a}),e(a)},i.reject=a=>{s({status:"rejected",reason:a}),n(a)},i}function _y(e){return Math.min(1e3*2**e,3e4)}function Xp(e){return(e??"online")==="online"?ul.isOnline():!0}var Yp=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function pu(e){return e instanceof Yp}function Zp(e){let n=!1,i=0,s=!1,a;const u=Iu(),f=C=>{s||(x(new Yp(C)),e.abort?.())},h=()=>{n=!0},p=()=>{n=!1},g=()=>uc.isFocused()&&(e.networkMode==="always"||ul.isOnline())&&e.canRun(),v=()=>Xp(e.networkMode)&&e.canRun(),m=C=>{s||(s=!0,e.onSuccess?.(C),a?.(),u.resolve(C))},x=C=>{s||(s=!0,e.onError?.(C),a?.(),u.reject(C))},w=()=>new Promise(C=>{a=S=>{(s||g())&&C(S)},e.onPause?.()}).then(()=>{a=void 0,s||e.onContinue?.()}),b=()=>{if(s)return;let C;const S=i===0?e.initialPromise:void 0;try{C=S??e.fn()}catch(k){C=Promise.reject(k)}Promise.resolve(C).then(m).catch(k=>{if(s)return;const O=e.retry??(Nr?0:3),D=e.retryDelay??_y,P=typeof D=="function"?D(i,k):D,T=O===!0||typeof O=="number"&&i<O||typeof O=="function"&&O(i,k);if(n||!T){x(k);return}i++,e.onFail?.(i,k),gy(P).then(()=>g()?void 0:w()).then(()=>{n?x(k):b()})})};return{promise:u,cancel:f,continue:()=>(a?.(),u),cancelRetry:h,continueRetry:p,canStart:v,start:()=>(v()?b():w().then(b),u)}}var wy=e=>setTimeout(e,0);function ky(){let e=[],n=0,i=h=>{h()},s=h=>{h()},a=wy;const u=h=>{n?e.push(h):a(()=>{i(h)})},f=()=>{const h=e;e=[],h.length&&a(()=>{s(()=>{h.forEach(p=>{i(p)})})})};return{batch:h=>{let p;n++;try{p=h()}finally{n--,n||f()}return p},batchCalls:h=>(...p)=>{u(()=>{h(...p)})},schedule:u,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{s=h},setScheduler:h=>{a=h}}}var Ke=ky(),Jp=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Au(this.gcTime)&&(this.#t=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Nr?1/0:5*60*1e3))}clearGcTimeout(){this.#t&&(clearTimeout(this.#t),this.#t=void 0)}},Sy=class extends Jp{#t;#e;#n;#r;#i;#s;#l;constructor(e){super(),this.#l=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=by(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,n){const i=Du(this.state.data,e,this.options);return this.#o({data:i,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),i}setState(e,n){this.#o({type:"setState",state:e,setStateOptions:n})}cancel(e){const n=this.#i?.promise;return this.#i?.cancel(e),n?n.then(ct).catch(ct):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Gt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ac||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>sr(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Bp(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#i&&(this.#l?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}fetch(e,n){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const p=this.observers.find(g=>g.options.queryFn);p&&this.setOptions(p.options)}const i=new AbortController,s=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(this.#l=!0,i.signal)})},a=()=>{const p=Kp(this.options,n),v=(()=>{const m={client:this.#r,queryKey:this.queryKey,meta:this.meta};return s(m),m})();return this.#l=!1,this.options.persister?this.options.persister(p,v,this):p(v)},f=(()=>{const p={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:a};return s(p),p})();this.options.behavior?.onFetch(f,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#o({type:"fetch",meta:f.fetchOptions?.meta});const h=p=>{pu(p)&&p.silent||this.#o({type:"error",error:p}),pu(p)||(this.#n.config.onError?.(p,this),this.#n.config.onSettled?.(this.state.data,p,this)),this.scheduleGc()};return this.#i=Zp({initialPromise:n?.initialPromise,fn:f.fetchFn,abort:i.abort.bind(i),onSuccess:p=>{if(p===void 0){h(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(g){h(g);return}this.#n.config.onSuccess?.(p,this),this.#n.config.onSettled?.(p,this.state.error,this),this.scheduleGc()},onError:h,onFail:(p,g)=>{this.#o({type:"failed",failureCount:p,error:g})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}),this.#i.start()}#o(e){const n=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...eg(i.data,this.options),fetchMeta:e.meta??null};case"success":return this.#e=void 0,{...i,data:e.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return pu(s)&&s.revert&&this.#e?{...this.#e,fetchStatus:"idle"}:{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=n(this.state),Ke.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function eg(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Xp(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function by(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,i=n!==void 0,s=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:i?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var Cy=class extends ui{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,n,i){const s=n.queryKey,a=n.queryHash??lc(s,n);let u=this.get(a);return u||(u=new Sy({client:e,queryKey:s,queryHash:a,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(s)}),this.add(u)),u}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#t.get(e.queryHash);n&&(e.destroy(),n===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ke.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(i=>hd(n,i))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(i=>hd(e,i)):n}notify(e){Ke.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Ke.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ke.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ey=class extends Jp{#t;#e;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#e=e.mutationCache,this.#t=[],this.state=e.state||tg(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(n=>n!==e),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#e.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#r({type:"continue"})};this.#n=Zp({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(a,u)=>{this.#r({type:"failed",failureCount:a,error:u})},onPause:()=>{this.#r({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const i=this.state.status==="pending",s=!this.#n.canStart();try{if(i)n();else{this.#r({type:"pending",variables:e,isPaused:s}),await this.#e.config.onMutate?.(e,this);const u=await this.options.onMutate?.(e);u!==this.state.context&&this.#r({type:"pending",context:u,variables:e,isPaused:s})}const a=await this.#n.start();return await this.#e.config.onSuccess?.(a,e,this.state.context,this),await this.options.onSuccess?.(a,e,this.state.context),await this.#e.config.onSettled?.(a,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(a,null,e,this.state.context),this.#r({type:"success",data:a}),a}catch(a){try{throw await this.#e.config.onError?.(a,e,this.state.context,this),await this.options.onError?.(a,e,this.state.context),await this.#e.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,a,e,this.state.context),a}finally{this.#r({type:"error",error:a})}}finally{this.#e.runNext(this)}}#r(e){const n=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ke.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(e)}),this.#e.notify({mutation:this,type:"updated",action:e})})}};function tg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ny=class extends ui{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,n,i){const s=new Ey({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:i});return this.add(s),s}add(e){this.#t.add(e);const n=Ks(e);if(typeof n=="string"){const i=this.#e.get(n);i?i.push(e):this.#e.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const n=Ks(e);if(typeof n=="string"){const i=this.#e.get(n);if(i)if(i.length>1){const s=i.indexOf(e);s!==-1&&i.splice(s,1)}else i[0]===e&&this.#e.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Ks(e);if(typeof n=="string"){const s=this.#e.get(n)?.find(a=>a.state.status==="pending");return!s||s===e}else return!0}runNext(e){const n=Ks(e);return typeof n=="string"?this.#e.get(n)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ke.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const n={exact:!0,...e};return this.getAll().find(i=>dd(n,i))}findAll(e={}){return this.getAll().filter(n=>dd(e,n))}notify(e){Ke.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Ke.batch(()=>Promise.all(e.map(n=>n.continue().catch(ct))))}};function Ks(e){return e.options.scope?.id}function md(e){return{onFetch:(n,i)=>{const s=n.options,a=n.fetchOptions?.meta?.fetchMore?.direction,u=n.state.data?.pages||[],f=n.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const g=async()=>{let v=!1;const m=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(n.signal.aborted?v=!0:n.signal.addEventListener("abort",()=>{v=!0}),n.signal)})},x=Kp(n.options,n.fetchOptions),w=async(b,C,S)=>{if(v)return Promise.reject();if(C==null&&b.pages.length)return Promise.resolve(b);const O=(()=>{const z={client:n.client,queryKey:n.queryKey,pageParam:C,direction:S?"backward":"forward",meta:n.options.meta};return m(z),z})(),D=await x(O),{maxPages:P}=n.options,T=S?yy:my;return{pages:T(b.pages,D,P),pageParams:T(b.pageParams,C,P)}};if(a&&u.length){const b=a==="backward",C=b?Py:yd,S={pages:u,pageParams:f},k=C(s,S);h=await w(S,k,b)}else{const b=e??u.length;do{const C=p===0?f[0]??s.initialPageParam:yd(s,h);if(p>0&&C==null)break;h=await w(h,C),p++}while(p<b)}return h};n.options.persister?n.fetchFn=()=>n.options.persister?.(g,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},i):n.fetchFn=g}}}function yd(e,{pages:n,pageParams:i}){const s=n.length-1;return n.length>0?e.getNextPageParam(n[s],n,i[s],i):void 0}function Py(e,{pages:n,pageParams:i}){return n.length>0?e.getPreviousPageParam?.(n[0],n,i[0],i):void 0}var Ty=class{#t;#e;#n;#r;#i;#s;#l;#o;constructor(e={}){this.#t=e.queryCache||new Cy,this.#e=e.mutationCache||new Ny,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#l=uc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#o=ul.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#l?.(),this.#l=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#t.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),i=this.#t.build(this,n),s=i.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(sr(n.staleTime,i))&&this.prefetchQuery(n),Promise.resolve(s))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:n,state:i})=>{const s=i.data;return[n,s]})}setQueryData(e,n,i){const s=this.defaultQueryOptions({queryKey:e}),u=this.#t.get(s.queryHash)?.state.data,f=py(n,u);if(f!==void 0)return this.#t.build(this,s).setData(f,{...i,manual:!0})}setQueriesData(e,n,i){return Ke.batch(()=>this.#t.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,n,i)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#t.get(n.queryHash)?.state}removeQueries(e){const n=this.#t;Ke.batch(()=>{n.findAll(e).forEach(i=>{n.remove(i)})})}resetQueries(e,n){const i=this.#t;return Ke.batch(()=>(i.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const i={revert:!0,...n},s=Ke.batch(()=>this.#t.findAll(e).map(a=>a.cancel(i)));return Promise.all(s).then(ct).catch(ct)}invalidateQueries(e,n={}){return Ke.batch(()=>(this.#t.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const i={...n,cancelRefetch:n.cancelRefetch??!0},s=Ke.batch(()=>this.#t.findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let u=a.fetch(void 0,i);return i.throwOnError||(u=u.catch(ct)),a.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(s).then(ct)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const i=this.#t.build(this,n);return i.isStaleByTime(sr(n.staleTime,i))?i.fetch(n):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ct).catch(ct)}fetchInfiniteQuery(e){return e.behavior=md(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ct).catch(ct)}ensureInfiniteQueryData(e){return e.behavior=md(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ul.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#r.set(Pr(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#r.values()],i={};return n.forEach(s=>{_o(e,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(e,n){this.#i.set(Pr(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#i.values()],i={};return n.forEach(s=>{_o(e,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=lc(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===ac&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},My=class extends ui{constructor(e,n){super(),this.options=n,this.#t=e,this.#o=null,this.#l=Iu(),this.options.experimental_prefetchInRender||this.#l.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}#t;#e=void 0;#n=void 0;#r=void 0;#i;#s;#l;#o;#g;#h;#d;#u;#c;#a;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),vd(this.#e,this.options)?this.#f():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Lu(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Lu(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#_(),this.#w(),this.#e.removeObserver(this)}setOptions(e){const n=this.options,i=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Gt(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#k(),this.#e.setOptions(this.options),n._defaulted&&!al(this.options,n)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const s=this.hasListeners();s&&xd(this.#e,i,this.options,n)&&this.#f(),this.updateResult(),s&&(this.#e!==i||Gt(this.options.enabled,this.#e)!==Gt(n.enabled,this.#e)||sr(this.options.staleTime,this.#e)!==sr(n.staleTime,this.#e))&&this.#m();const a=this.#y();s&&(this.#e!==i||Gt(this.options.enabled,this.#e)!==Gt(n.enabled,this.#e)||a!==this.#a)&&this.#v(a)}getOptimisticResult(e){const n=this.#t.getQueryCache().build(this.#t,e),i=this.createResult(n,e);return Oy(this,i)&&(this.#r=i,this.#s=this.options,this.#i=this.#e.state),i}getCurrentResult(){return this.#r}trackResult(e,n){return new Proxy(e,{get:(i,s)=>(this.trackProp(s),n?.(s),Reflect.get(i,s))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=this.#t.defaultQueryOptions(e),i=this.#t.getQueryCache().build(this.#t,n);return i.fetch().then(()=>this.createResult(i,n))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(e){this.#k();let n=this.#e.fetch(this.options,e);return e?.throwOnError||(n=n.catch(ct)),n}#m(){this.#_();const e=sr(this.options.staleTime,this.#e);if(Nr||this.#r.isStale||!Au(e))return;const i=Bp(this.#r.dataUpdatedAt,e)+1;this.#u=setTimeout(()=>{this.#r.isStale||this.updateResult()},i)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#a=e,!(Nr||Gt(this.options.enabled,this.#e)===!1||!Au(this.#a)||this.#a===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||uc.isFocused())&&this.#f()},this.#a))}#x(){this.#m(),this.#v(this.#y())}#_(){this.#u&&(clearTimeout(this.#u),this.#u=void 0)}#w(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(e,n){const i=this.#e,s=this.options,a=this.#r,u=this.#i,f=this.#s,p=e!==i?e.state:this.#n,{state:g}=e;let v={...g},m=!1,x;if(n._optimisticResults){const L=this.hasListeners(),W=!L&&vd(e,n),X=L&&xd(e,i,n,s);(W||X)&&(v={...v,...eg(g.data,e.options)}),n._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:w,errorUpdatedAt:b,status:C}=v;x=v.data;let S=!1;if(n.placeholderData!==void 0&&x===void 0&&C==="pending"){let L;a?.isPlaceholderData&&n.placeholderData===f?.placeholderData?(L=a.data,S=!0):L=typeof n.placeholderData=="function"?n.placeholderData(this.#d?.state.data,this.#d):n.placeholderData,L!==void 0&&(C="success",x=Du(a?.data,L,n),m=!0)}if(n.select&&x!==void 0&&!S)if(a&&x===u?.data&&n.select===this.#g)x=this.#h;else try{this.#g=n.select,x=n.select(x),x=Du(a?.data,x,n),this.#h=x,this.#o=null}catch(L){this.#o=L}this.#o&&(w=this.#o,x=this.#h,b=Date.now(),C="error");const k=v.fetchStatus==="fetching",O=C==="pending",D=C==="error",P=O&&k,T=x!==void 0,A={status:C,fetchStatus:v.fetchStatus,isPending:O,isSuccess:C==="success",isError:D,isInitialLoading:P,isLoading:P,data:x,dataUpdatedAt:v.dataUpdatedAt,error:w,errorUpdatedAt:b,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:k,isRefetching:k&&!O,isLoadingError:D&&!T,isPaused:v.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:D&&T,isStale:cc(e,n),refetch:this.refetch,promise:this.#l};if(this.options.experimental_prefetchInRender){const L=Z=>{A.status==="error"?Z.reject(A.error):A.data!==void 0&&Z.resolve(A.data)},W=()=>{const Z=this.#l=A.promise=Iu();L(Z)},X=this.#l;switch(X.status){case"pending":e.queryHash===i.queryHash&&L(X);break;case"fulfilled":(A.status==="error"||A.data!==X.value)&&W();break;case"rejected":(A.status!=="error"||A.error!==X.reason)&&W();break}}return A}updateResult(){const e=this.#r,n=this.createResult(this.#e,this.options);if(this.#i=this.#e.state,this.#s=this.options,this.#i.data!==void 0&&(this.#d=this.#e),al(n,e))return;this.#r=n;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!this.#p.size)return!0;const u=new Set(a??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#r).some(f=>{const h=f;return this.#r[h]!==e[h]&&u.has(h)})};this.#S({listeners:i()})}#k(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const n=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(n?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#S(e){Ke.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(this.#r)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function jy(e,n){return Gt(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&n.retryOnMount===!1)}function vd(e,n){return jy(e,n)||e.state.data!==void 0&&Lu(e,n,n.refetchOnMount)}function Lu(e,n,i){if(Gt(n.enabled,e)!==!1&&sr(n.staleTime,e)!=="static"){const s=typeof i=="function"?i(e):i;return s==="always"||s!==!1&&cc(e,n)}return!1}function xd(e,n,i,s){return(e!==n||Gt(s.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&cc(e,i)}function cc(e,n){return Gt(n.enabled,e)!==!1&&e.isStaleByTime(sr(n.staleTime,e))}function Oy(e,n){return!al(e.getCurrentResult(),n)}var Ry=class extends ui{#t;#e=void 0;#n;#r;constructor(n,i){super(),this.#t=n,this.setOptions(i),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){const i=this.options;this.options=this.#t.defaultMutationOptions(n),al(this.options,i)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),i?.mutationKey&&this.options.mutationKey&&Pr(i.mutationKey)!==Pr(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(n){this.#i(),this.#s(n)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#s()}mutate(n,i){return this.#r=i,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(n)}#i(){const n=this.#n?.state??tg();this.#e={...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset}}#s(n){Ke.batch(()=>{if(this.#r&&this.hasListeners()){const i=this.#e.variables,s=this.#e.context;n?.type==="success"?(this.#r.onSuccess?.(n.data,i,s),this.#r.onSettled?.(n.data,null,i,s)):n?.type==="error"&&(this.#r.onError?.(n.error,i,s),this.#r.onSettled?.(void 0,n.error,i,s))}this.listeners.forEach(i=>{i(this.#e)})})}},se=sc();const fc=Qp(se);var ng=se.createContext(void 0),kl=e=>{const n=se.useContext(ng);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},Ay=({client:e,children:n})=>(se.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),N.jsx(ng.Provider,{value:e,children:n})),rg=se.createContext(!1),zy=()=>se.useContext(rg);rg.Provider;function Dy(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Iy=se.createContext(Dy()),Ly=()=>se.useContext(Iy),Fy=(e,n)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(n.isReset()||(e.retryOnMount=!1))},$y=e=>{se.useEffect(()=>{e.clearReset()},[e])},Uy=({result:e,errorResetBoundary:n,throwOnError:i,query:s,suspense:a})=>e.isError&&!n.isReset()&&!e.isFetching&&s&&(a&&e.data===void 0||Gp(i,[e.error,s])),Hy=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...s)=>n(i(...s)):n(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},qy=(e,n)=>e.isLoading&&e.isFetching&&!n,Vy=(e,n)=>e?.suspense&&n.isPending,_d=(e,n,i)=>n.fetchOptimistic(e).catch(()=>{i.clearReset()});function Qy(e,n,i){const s=zy(),a=Ly(),u=kl(),f=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(f),f._optimisticResults=s?"isRestoring":"optimistic",Hy(f),Fy(f,a),$y(a);const h=!u.getQueryCache().get(f.queryHash),[p]=se.useState(()=>new n(u,f)),g=p.getOptimisticResult(f),v=!s&&e.subscribed!==!1;if(se.useSyncExternalStore(se.useCallback(m=>{const x=v?p.subscribe(Ke.batchCalls(m)):ct;return p.updateResult(),x},[p,v]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),se.useEffect(()=>{p.setOptions(f)},[f,p]),Vy(f,g))throw _d(f,p,a);if(Uy({result:g,errorResetBoundary:a,throwOnError:f.throwOnError,query:u.getQueryCache().get(f.queryHash),suspense:f.suspense}))throw g.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(f,g),f.experimental_prefetchInRender&&!Nr&&qy(g,s)&&(h?_d(f,p,a):u.getQueryCache().get(f.queryHash)?.promise)?.catch(ct).finally(()=>{p.updateResult()}),f.notifyOnChangeProps?g:p.trackResult(g)}function Fu(e,n){return Qy(e,My)}function By(e,n){const i=kl(),[s]=se.useState(()=>new Ry(i,e));se.useEffect(()=>{s.setOptions(e)},[s,e]);const a=se.useSyncExternalStore(se.useCallback(f=>s.subscribe(Ke.batchCalls(f)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),u=se.useCallback((f,h)=>{s.mutate(f,h).catch(ct)},[s]);if(a.error&&Gp(s.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:u,mutateAsync:a.mutate}}var Gs={},gu={exports:{}},xt={},mu={exports:{}},yu={};/** * @license React * scheduler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var wd;function Wy(){return wd||(wd=1,function(e){function n(V,Y){var B=V.length;V.push(Y);e:for(;0<B;){var M=B-1>>>1,q=V[M];if(0<a(q,Y))V[M]=Y,V[B]=q,B=M;else break e}}function i(V){return V.length===0?null:V[0]}function s(V){if(V.length===0)return null;var Y=V[0],B=V.pop();if(B!==Y){V[0]=B;e:for(var M=0,q=V.length,ue=q>>>1;M<ue;){var fe=2*(M+1)-1,ve=V[fe],xe=fe+1,Se=V[xe];if(0>a(ve,B))xe<q&&0>a(Se,ve)?(V[M]=Se,V[xe]=B,M=xe):(V[M]=ve,V[fe]=B,M=fe);else if(xe<q&&0>a(Se,B))V[M]=Se,V[xe]=B,M=xe;else break e}}return Y}function a(V,Y){var B=V.sortIndex-Y.sortIndex;return B!==0?B:V.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var f=Date,h=f.now();e.unstable_now=function(){return f.now()-h}}var p=[],g=[],v=1,m=null,x=3,w=!1,b=!1,C=!1,S=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function D(V){for(var Y=i(g);Y!==null;){if(Y.callback===null)s(g);else if(Y.startTime<=V)s(g),Y.sortIndex=Y.expirationTime,n(p,Y);else break;Y=i(g)}}function P(V){if(C=!1,D(V),!b)if(i(p)!==null)b=!0,Q(T);else{var Y=i(g);Y!==null&&ne(P,Y.startTime-V)}}function T(V,Y){b=!1,C&&(C=!1,k(L),L=-1),w=!0;var B=x;try{for(D(Y),m=i(p);m!==null&&(!(m.expirationTime>Y)||V&&!Z());){var M=m.callback;if(typeof M=="function"){m.callback=null,x=m.priorityLevel;var q=M(m.expirationTime<=Y);Y=e.unstable_now(),typeof q=="function"?m.callback=q:m===i(p)&&s(p),D(Y)}else s(p);m=i(p)}if(m!==null)var ue=!0;else{var fe=i(g);fe!==null&&ne(P,fe.startTime-Y),ue=!1}return ue}finally{m=null,x=B,w=!1}}var z=!1,A=null,L=-1,W=5,X=-1;function Z(){return!(e.unstable_now()-X<W)}function oe(){if(A!==null){var V=e.unstable_now();X=V;var Y=!0;try{Y=A(!0,V)}finally{Y?de():(z=!1,A=null)}}else z=!1}var de;if(typeof O=="function")de=function(){O(oe)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,ee=F.port2;F.port1.onmessage=oe,de=function(){ee.postMessage(null)}}else de=function(){S(oe,0)};function Q(V){A=V,z||(z=!0,de())}function ne(V,Y){L=S(function(){V(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(V){V.callback=null},e.unstable_continueExecution=function(){b||w||(b=!0,Q(T))},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return i(p)},e.unstable_next=function(V){switch(x){case 1:case 2:case 3:var Y=3;break;default:Y=x}var B=x;x=Y;try{return V()}finally{x=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(V,Y){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var B=x;x=V;try{return Y()}finally{x=B}},e.unstable_scheduleCallback=function(V,Y,B){var M=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?M+B:M):B=M,V){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=B+q,V={id:v++,callback:Y,priorityLevel:V,startTime:B,expirationTime:q,sortIndex:-1},B>M?(V.sortIndex=B,n(g,V),i(p)===null&&V===i(g)&&(C?(k(L),L=-1):C=!0,ne(P,B-M))):(V.sortIndex=q,n(p,V),b||w||(b=!0,Q(T))),V},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(V){var Y=x;return function(){var B=x;x=Y;try{return V.apply(this,arguments)}finally{x=B}}}}(yu)),yu}var kd;function Ky(){return kd||(kd=1,mu.exports=Wy()),mu.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Sd;function Gy(){if(Sd)return xt;Sd=1;var e=sc(),n=Ky();function i(r){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+r,l=1;l<arguments.length;l++)o+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,a={};function u(r,o){f(r,o),f(r+"Capture",o)}function f(r,o){for(a[r]=o,r=0;r<o.length;r++)s.add(o[r])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v={},m={};function x(r){return p.call(m,r)?!0:p.call(v,r)?!1:g.test(r)?m[r]=!0:(v[r]=!0,!1)}function w(r,o,l,c){if(l!==null&&l.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return c?!1:l!==null?!l.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function b(r,o,l,c){if(o===null||typeof o>"u"||w(r,o,l,c))return!0;if(c)return!1;if(l!==null)switch(l.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function C(r,o,l,c,d,y,_){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=c,this.attributeNamespace=d,this.mustUseProperty=l,this.propertyName=r,this.type=o,this.sanitizeURL=y,this.removeEmptyString=_}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){S[r]=new C(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var o=r[0];S[o]=new C(o,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){S[r]=new C(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){S[r]=new C(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){S[r]=new C(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){S[r]=new C(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){S[r]=new C(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){S[r]=ne