1 line
30 KiB
JavaScript
1 line
30 KiB
JavaScript
|
!function(){"use strict";var t={d:function(e,s){for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{QueryClient:function(){return K},QueryClientProvider:function(){return G},createQueryClient:function(){return ut},useMutation:function(){return W},useQuery:function(){return ot},useQueryClient:function(){return j}});var s="undefined"==typeof window||"Deno"in window;function i(){}function r(t){return"number"==typeof t&&t>=0&&t!==1/0}function n(t,e){return Math.max(t+(e||0)-Date.now(),0)}function a(t,e){const{type:s="all",exact:i,fetchStatus:r,predicate:n,queryKey:a,stale:o}=t;if(a)if(i){if(e.queryHash!==u(a,e.options))return!1}else if(!c(e.queryKey,a))return!1;if("all"!==s){const t=e.isActive();if("active"===s&&!t)return!1;if("inactive"===s&&t)return!1}return!("boolean"==typeof o&&e.isStale()!==o||void 0!==r&&r!==e.state.fetchStatus||n&&!n(e))}function o(t,e){const{exact:s,status:i,predicate:r,mutationKey:n}=t;if(n){if(!e.options.mutationKey)return!1;if(s){if(h(e.options.mutationKey)!==h(n))return!1}else if(!c(e.options.mutationKey,n))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function u(t,e){return(e?.queryKeyHashFn||h)(t)}function h(t){return JSON.stringify(t,((t,e)=>p(e)?Object.keys(e).sort().reduce(((t,s)=>(t[s]=e[s],t)),{}):e))}function c(t,e){return t===e||typeof t==typeof e&&!(!t||!e||"object"!=typeof t||"object"!=typeof e)&&!Object.keys(e).some((s=>!c(t[s],e[s])))}function l(t,e){if(t===e)return t;const s=f(t)&&f(e);if(s||p(t)&&p(e)){const i=s?t.length:Object.keys(t).length,r=s?e:Object.keys(e),n=r.length,a=s?[]:{};let o=0;for(let i=0;i<n;i++){const n=s?i:r[i];a[n]=l(t[n],e[n]),a[n]===t[n]&&o++}return i===n&&o===i?t:a}return e}function d(t,e){if(t&&!e||e&&!t)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function f(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function p(t){if(!y(t))return!1;const e=t.constructor;if(void 0===e)return!0;const s=e.prototype;return!!y(s)&&!!s.hasOwnProperty("isPrototypeOf")}function y(t){return"[object Object]"===Object.prototype.toString.call(t)}function m(t){return new Promise((e=>{setTimeout(e,t)}))}function v(t){m(0).then(t)}function b(t,e,s){return"function"==typeof s.structuralSharing?s.structuralSharing(t,e):!1!==s.structuralSharing?l(t,e):e}function g(t,e,s=0){const i=[...t,e];return s&&i.length>s?i.slice(1):i}function O(t,e,s=0){const i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var R=function(){let t=[],e=0,s=t=>{t()},i=t=>{t()};const r=i=>{e?t.push(i):v((()=>{s(i)}))};return{batch:r=>{let n;e++;try{n=r()}finally{e--,e||(()=>{const e=t;t=[],e.length&&v((()=>{i((()=>{e.forEach((t=>{s(t)}))}))}))})()}return n},batchCalls:t=>(...e)=>{r((()=>{t(...e)}))},schedule:r,setNotifyFunction:t=>{s=t},setBatchNotifyFunction:t=>{i=t}}}(),C=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},w=new class extends C{#t;#e;#s;constructor(){super(),this.#s=t=>{if(!s&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#s=t,this.#e?.(),this.#e=t((t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()}))}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){this.listeners.forEach((t=>{t()}))}isFocused(){return"boolean"==typeof this.#t?this.#t:"hidden"!==globalThis.document?.visibilityState}},S=new class extends C{#i=!0;#e;#s;constructor(){super(),this.#s=t=>{if(!s&&window.addEventListener){const e
|