@perses-dev/alert-manager-plugin 0.2.0-beta.2 → 0.2.0-beta.3

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.
Files changed (98) hide show
  1. package/__mf/js/{AlertManager.42d95b33.js → AlertManager.f6767b3e.js} +5 -5
  2. package/__mf/js/async/{1299.d5af4767.js → 1299.982921a1.js} +1 -1
  3. package/__mf/js/async/{1616.0c9baa4c.js → 1616.9fc43f1b.js} +1 -1
  4. package/__mf/js/async/{1871.5e21fb62.js → 1871.6538032b.js} +1 -1
  5. package/__mf/js/async/{1969.e54f3991.js → 1969.20c05344.js} +1 -1
  6. package/__mf/js/async/{2043.4e8f2371.js → 2043.590d0b56.js} +2 -2
  7. package/__mf/js/async/2197.35bb8607.js +1 -0
  8. package/__mf/js/async/{2218.8b7e30c2.js → 2218.f9b609b1.js} +2 -2
  9. package/__mf/js/async/{2317.e656eab3.js → 2317.53a1e673.js} +2 -2
  10. package/__mf/js/async/{2377.5295b064.js → 2377.b832000f.js} +1 -1
  11. package/__mf/js/async/{2657.e6a11726.js → 2657.1d9fecb1.js} +1 -1
  12. package/__mf/js/async/2830.7365f7c5.js +22 -0
  13. package/__mf/js/async/{3222.6ad1b128.js → 3222.cced5ca3.js} +1 -1
  14. package/__mf/js/async/{3514.e71d5cb9.js → 3514.5ab6f0e6.js} +2 -2
  15. package/__mf/js/async/{3910.1bd28e15.js → 3910.60ee9c10.js} +1 -1
  16. package/__mf/js/async/{392.26ae5cc4.js → 392.e89c9a0a.js} +2 -2
  17. package/__mf/js/async/{3963.181d3782.js → 3963.bdb382cd.js} +1 -1
  18. package/__mf/js/async/{4077.91abd1da.js → 4077.229ded9e.js} +1 -1
  19. package/__mf/js/async/{4121.f9595b70.js → 4121.64cff28e.js} +2 -2
  20. package/__mf/js/async/{4133.cc678ae9.js → 4133.1b0b31ea.js} +1 -1
  21. package/__mf/js/async/{4213.005a1a65.js → 4213.69382a3d.js} +1 -1
  22. package/__mf/js/async/{4466.7cca717d.js → 4466.11e5cf55.js} +1 -1
  23. package/__mf/js/async/{4481.5bc5aa13.js → 4481.6ed8711e.js} +1 -1
  24. package/__mf/js/async/{4496.3760da2f.js → 4496.7eabf058.js} +1 -1
  25. package/__mf/js/async/{4978.f1550309.js → 4978.81fe8a09.js} +1 -1
  26. package/__mf/js/async/{5038.b1e9133a.js → 5038.fe8ba8f6.js} +2 -2
  27. package/__mf/js/async/{5071.eeb1c9b1.js → 5071.b474a0c5.js} +1 -1
  28. package/__mf/js/async/{5759.84fc4d0b.js → 5759.06d9847b.js} +5 -5
  29. package/__mf/js/async/5944.5e72d52e.js +1 -0
  30. package/__mf/js/async/{6274.9f68ee7d.js → 6274.e86d96dc.js} +2 -2
  31. package/__mf/js/async/{6390.0fd40bd8.js → 6390.c7ef7335.js} +2 -2
  32. package/__mf/js/async/{6401.7bf2c4c2.js → 6401.d90d614b.js} +1 -1
  33. package/__mf/js/async/{6594.b3a19fc1.js → 6594.39fe2d63.js} +2 -2
  34. package/__mf/js/async/{6854.f05f8da0.js → 6854.20abc22d.js} +1 -1
  35. package/__mf/js/async/{6911.bc380f0c.js → 6911.36e58efc.js} +1 -1
  36. package/__mf/js/async/7177.2deb59f0.js +1 -0
  37. package/__mf/js/async/{7192.715c4cb3.js → 7192.f36295ba.js} +1 -1
  38. package/__mf/js/async/{733.8bc3bc96.js → 733.1392f91a.js} +1 -1
  39. package/__mf/js/async/7607.0509832f.js +52 -0
  40. package/__mf/js/async/{7862.10a19eef.js → 7862.0073336d.js} +2 -2
  41. package/__mf/js/async/{7978.4ca49c3a.js → 7978.dec4f496.js} +1 -1
  42. package/__mf/js/async/{8470.7ebe8e66.js → 8470.5d67493f.js} +2 -2
  43. package/__mf/js/async/{8697.7b6d10e1.js → 8697.e521f02c.js} +1 -1
  44. package/__mf/js/async/{873.fcc6e5b7.js → 873.9a6121aa.js} +1 -1
  45. package/__mf/js/async/{8907.5d1f9505.js → 8907.3755a812.js} +1 -1
  46. package/__mf/js/async/{9040.8de751d6.js → 9040.b32c9cb1.js} +2 -2
  47. package/__mf/js/async/{9184.307e83da.js → 9184.62cff779.js} +1 -1
  48. package/__mf/js/async/{9235.1b0d1de0.js → 9235.81d32de9.js} +1 -1
  49. package/__mf/js/async/{941.36858244.js → 941.f15d1506.js} +2 -2
  50. package/__mf/js/async/{9588.31544c69.js → 9588.e03c3890.js} +1 -1
  51. package/__mf/js/async/{9836.e4cf02db.js → 9836.3cba759d.js} +1 -1
  52. package/__mf/js/async/{__federation_expose_AlertManagerAlertsExplorer.4fbf2fa1.js → __federation_expose_AlertManagerAlertsExplorer.02d5bc8d.js} +2 -2
  53. package/__mf/js/async/{__federation_expose_AlertManagerAlertsQuery.27d99dac.js → __federation_expose_AlertManagerAlertsQuery.922d9637.js} +1 -1
  54. package/__mf/js/async/__federation_expose_AlertManagerDatasource.76982b7f.js +2 -0
  55. package/__mf/js/async/{__federation_expose_AlertManagerSilencesExplorer.65e1901a.js → __federation_expose_AlertManagerSilencesExplorer.3c54ffb8.js} +2 -2
  56. package/__mf/js/async/{__federation_expose_AlertManagerSilencesQuery.f619a448.js → __federation_expose_AlertManagerSilencesQuery.40f5bea0.js} +2 -2
  57. package/__mf/js/async/{__federation_expose_AlertTable.6c37126b.js → __federation_expose_AlertTable.ae0f4d1e.js} +1 -1
  58. package/__mf/js/async/{__federation_expose_SilenceTable.3a614a2f.js → __federation_expose_SilenceTable.adfc4870.js} +1 -1
  59. package/__mf/js/async/{lib-router.20ba053c.js → lib-router.7d0dbc0c.js} +2 -2
  60. package/__mf/js/{main.babca431.js → main.9c7df2d5.js} +5 -5
  61. package/lib/model/alertmanager-selectors.d.ts +1 -1
  62. package/lib/plugins/AlertManagerDatasourceEditor.d.ts +2 -5
  63. package/lib/plugins/AlertManagerDatasourceEditor.d.ts.map +1 -1
  64. package/lib/plugins/AlertManagerDatasourceEditor.js +4 -3
  65. package/lib/plugins/AlertManagerDatasourceEditor.js.map +1 -1
  66. package/lib/plugins/alertmanager-datasource.d.ts.map +1 -1
  67. package/lib/plugins/alertmanager-datasource.js +2 -1
  68. package/lib/plugins/alertmanager-datasource.js.map +1 -1
  69. package/mf-manifest.json +294 -294
  70. package/mf-stats.json +294 -294
  71. package/package.json +6 -6
  72. package/__mf/js/async/1522.04dc197d.js +0 -22
  73. package/__mf/js/async/2197.53bcb69e.js +0 -1
  74. package/__mf/js/async/2650.0b5955b5.js +0 -3
  75. package/__mf/js/async/5428.6922d4df.js +0 -1
  76. package/__mf/js/async/7177.83345474.js +0 -1
  77. package/__mf/js/async/__federation_expose_AlertManagerDatasource.c2b36e70.js +0 -2
  78. /package/__mf/js/async/{2043.4e8f2371.js.LICENSE.txt → 2043.590d0b56.js.LICENSE.txt} +0 -0
  79. /package/__mf/js/async/{2218.8b7e30c2.js.LICENSE.txt → 2218.f9b609b1.js.LICENSE.txt} +0 -0
  80. /package/__mf/js/async/{2317.e656eab3.js.LICENSE.txt → 2317.53a1e673.js.LICENSE.txt} +0 -0
  81. /package/__mf/js/async/{1522.04dc197d.js.LICENSE.txt → 2830.7365f7c5.js.LICENSE.txt} +0 -0
  82. /package/__mf/js/async/{3514.e71d5cb9.js.LICENSE.txt → 3514.5ab6f0e6.js.LICENSE.txt} +0 -0
  83. /package/__mf/js/async/{392.26ae5cc4.js.LICENSE.txt → 392.e89c9a0a.js.LICENSE.txt} +0 -0
  84. /package/__mf/js/async/{4121.f9595b70.js.LICENSE.txt → 4121.64cff28e.js.LICENSE.txt} +0 -0
  85. /package/__mf/js/async/{5038.b1e9133a.js.LICENSE.txt → 5038.fe8ba8f6.js.LICENSE.txt} +0 -0
  86. /package/__mf/js/async/{5759.84fc4d0b.js.LICENSE.txt → 5759.06d9847b.js.LICENSE.txt} +0 -0
  87. /package/__mf/js/async/{6274.9f68ee7d.js.LICENSE.txt → 6274.e86d96dc.js.LICENSE.txt} +0 -0
  88. /package/__mf/js/async/{6390.0fd40bd8.js.LICENSE.txt → 6390.c7ef7335.js.LICENSE.txt} +0 -0
  89. /package/__mf/js/async/{6594.b3a19fc1.js.LICENSE.txt → 6594.39fe2d63.js.LICENSE.txt} +0 -0
  90. /package/__mf/js/async/{7862.10a19eef.js.LICENSE.txt → 7862.0073336d.js.LICENSE.txt} +0 -0
  91. /package/__mf/js/async/{8470.7ebe8e66.js.LICENSE.txt → 8470.5d67493f.js.LICENSE.txt} +0 -0
  92. /package/__mf/js/async/{9040.8de751d6.js.LICENSE.txt → 9040.b32c9cb1.js.LICENSE.txt} +0 -0
  93. /package/__mf/js/async/{941.36858244.js.LICENSE.txt → 941.f15d1506.js.LICENSE.txt} +0 -0
  94. /package/__mf/js/async/{__federation_expose_AlertManagerAlertsExplorer.4fbf2fa1.js.LICENSE.txt → __federation_expose_AlertManagerAlertsExplorer.02d5bc8d.js.LICENSE.txt} +0 -0
  95. /package/__mf/js/async/{__federation_expose_AlertManagerDatasource.c2b36e70.js.LICENSE.txt → __federation_expose_AlertManagerDatasource.76982b7f.js.LICENSE.txt} +0 -0
  96. /package/__mf/js/async/{__federation_expose_AlertManagerSilencesExplorer.65e1901a.js.LICENSE.txt → __federation_expose_AlertManagerSilencesExplorer.3c54ffb8.js.LICENSE.txt} +0 -0
  97. /package/__mf/js/async/{__federation_expose_AlertManagerSilencesQuery.f619a448.js.LICENSE.txt → __federation_expose_AlertManagerSilencesQuery.40f5bea0.js.LICENSE.txt} +0 -0
  98. /package/__mf/js/async/{lib-router.20ba053c.js.LICENSE.txt → lib-router.7d0dbc0c.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
- /*! For license information please see 7862.10a19eef.js.LICENSE.txt */
2
- "use strict";(self.chunk_AlertManager_0_2_0_beta_2=self.chunk_AlertManager_0_2_0_beta_2||[]).push([["7862"],{32473(t,e,s){var r=s(70451),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},n=r.useState,u=r.useEffect,a=r.useLayoutEffect,o=r.useDebugValue;function l(t){var e=t.getSnapshot;t=t.value;try{var s=e();return!i(t,s)}catch(t){return!0}}var h="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var s=e(),r=n({inst:{value:s,getSnapshot:e}}),i=r[0].inst,h=r[1];return a(function(){i.value=s,i.getSnapshot=e,l(i)&&h({inst:i})},[t,s,e]),u(function(){return l(i)&&h({inst:i}),t(function(){l(i)&&h({inst:i})})},[t]),o(s),s};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:h},43676(t,e,s){t.exports=s(32473)},76693(t,e,s){let r,i,n,u,a,o;s.r(e),s.d(e,{isError:()=>x,useQueryErrorResetBoundary:()=>tQ,IsRestoringProvider:()=>tC,dehydrate:()=>th,isServer:()=>h,parseFilterArgs:()=>m,parseMutationFilterArgs:()=>b,queryOptions:()=>tj,infiniteQueryOptions:()=>tH,useSuspenseQuery:()=>tK,QueriesObserver:()=>tn,defaultContext:()=>tp,QueryClient:()=>$,Query:()=>G,Hydrate:()=>tB,useInfiniteQuery:()=>tV,useIsMutating:()=>tG,CancelledError:()=>L,usePrefetchQuery:()=>tX,useQueryClient:()=>tm,isCancelledError:()=>j,matchQuery:()=>g,MutationCache:()=>V,MutationObserver:()=>ta,defaultShouldDehydrateQuery:()=>tl,mutationOptions:()=>tz,notifyManager:()=>B,QueryCache:()=>z,useQueries:()=>tI,parseQueryArgs:()=>y,replaceEqualDeep:()=>Q,defaultShouldDehydrateMutation:()=>to,hydrate:()=>tc,useHydrate:()=>t_,useQuery:()=>tT,onlineManager:()=>T,InfiniteQueryObserver:()=>tu,QueryClientProvider:()=>tb,hashQueryKey:()=>R,QueryObserver:()=>tt,useIsRestoring:()=>tO,useSuspenseInfiniteQuery:()=>tk,useSuspenseQueries:()=>tL,parseMutationArgs:()=>v,focusManager:()=>I,useIsFetching:()=>tN,useMutation:()=>tW,usePrefetchInfiniteQuery:()=>tY,QueryErrorResetBoundary:()=>tE});class l{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){let e={listener:t};return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}let h="u"<typeof window||"Deno"in window;function c(){}function d(t){return"number"==typeof t&&t>=0&&t!==1/0}function f(t,e){return t.filter(t=>!e.includes(t))}function p(t,e){return Math.max(t+(e||0)-Date.now(),0)}function y(t,e,s){return M(t)?"function"==typeof e?{...s,queryKey:t,queryFn:e}:{...e,queryKey:t}:t}function v(t,e,s){return M(t)?"function"==typeof e?{...s,mutationKey:t,mutationFn:e}:{...e,mutationKey:t}:"function"==typeof t?{...e,mutationFn:t}:{...t}}function m(t,e,s){return M(t)?[{...e,queryKey:t},s]:[t||{},e]}function b(t,e,s){return M(t)?[{...e,mutationKey:t},s]:[t||{},e]}function g(t,e){let{type:s="all",exact:r,fetchStatus:i,predicate:n,queryKey:u,stale:a}=t;if(M(u))if(r){if(e.queryHash!==C(u,e.options))return!1}else{var o;if(o=e.queryKey,!S(o,u))return!1}if("all"!==s){let t=e.isActive();if("active"===s&&!t||"inactive"===s&&t)return!1}return("boolean"!=typeof a||e.isStale()===a)&&(void 0===i||i===e.state.fetchStatus)&&(!n||!!n(e))}function O(t,e){let{exact:s,fetching:r,predicate:i,mutationKey:n}=t;if(M(n)){if(!e.options.mutationKey)return!1;if(s){if(R(e.options.mutationKey)!==R(n))return!1}else{var u;if(u=e.options.mutationKey,!S(u,n))return!1}}return("boolean"!=typeof r||"loading"===e.state.status===r)&&(!i||!!i(e))}function C(t,e){return((null==e?void 0:e.queryKeyHashFn)||R)(t)}function R(t){return JSON.stringify(t,(t,e)=>w(e)?Object.keys(e).sort().reduce((t,s)=>(t[s]=e[s],t),{}):e)}function S(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&!Object.keys(e).some(s=>!S(t[s],e[s]))}function Q(t,e,s=0){if(t===e)return t;if(s>500)return e;let r=q(t)&&q(e);if(r||w(t)&&w(e)){let i=r?t.length:Object.keys(t).length,n=r?e:Object.keys(e),u=n.length,a=r?[]:{},o=0;for(let i=0;i<u;i++){let u=r?i:n[i];a[u]=Q(t[u],e[u],s+1),a[u]===t[u]&&o++}return i===u&&o===i?t:a}return e}function E(t,e){if(t&&!e||e&&!t)return!1;for(let s in t)if(t[s]!==e[s])return!1;return!0}function q(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function w(t){if(!P(t))return!1;let e=t.constructor;if(void 0===e)return!0;let s=e.prototype;return!!P(s)&&!!s.hasOwnProperty("isPrototypeOf")}function P(t){return"[object Object]"===Object.prototype.toString.call(t)}function M(t){return Array.isArray(t)}function x(t){return t instanceof Error}function F(t){return new Promise(e=>{setTimeout(e,t)})}function D(t){F(0).then(t)}function A(t,e,s){return null!=s.isDataEqual&&s.isDataEqual(t,e)?t:"function"==typeof s.structuralSharing?s.structuralSharing(t,e):!1!==s.structuralSharing?Q(t,e):e}let I=new class extends l{constructor(){super(),this.setup=t=>{if(!h&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",e,!1),()=>{window.removeEventListener("visibilitychange",e),window.removeEventListener("focus",e)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;null==(t=this.cleanup)||t.call(this),this.cleanup=void 0}}setEventListener(t){var e;this.setup=t,null==(e=this.cleanup)||e.call(this),this.cleanup=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.focused!==t&&(this.focused=t,this.onFocus())}onFocus(){this.listeners.forEach(({listener:t})=>{t()})}isFocused(){return"boolean"==typeof this.focused?this.focused:"u"<typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}},U=["online","offline"],T=new class extends l{constructor(){super(),this.setup=t=>{if(!h&&window.addEventListener){let e=()=>t();return U.forEach(t=>{window.addEventListener(t,e,!1)}),()=>{U.forEach(t=>{window.removeEventListener(t,e)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;null==(t=this.cleanup)||t.call(this),this.cleanup=void 0}}setEventListener(t){var e;this.setup=t,null==(e=this.cleanup)||e.call(this),this.cleanup=t(t=>{"boolean"==typeof t?this.setOnline(t):this.onOnline()})}setOnline(t){this.online!==t&&(this.online=t,this.onOnline())}onOnline(){this.listeners.forEach(({listener:t})=>{t()})}isOnline(){return"boolean"==typeof this.online?this.online:"u"<typeof navigator||void 0===navigator.onLine||navigator.onLine}};function K(t){return Math.min(1e3*2**t,3e4)}function k(t){return(null!=t?t:"online")!=="online"||T.isOnline()}class L{constructor(t){this.revert=null==t?void 0:t.revert,this.silent=null==t?void 0:t.silent}}function j(t){return t instanceof L}function H(t){let e,s,r,i=!1,n=0,u=!1,a=new Promise((t,e)=>{s=t,r=e}),o=()=>!I.isFocused()||"always"!==t.networkMode&&!T.isOnline(),l=r=>{u||(u=!0,null==t.onSuccess||t.onSuccess(r),null==e||e(),s(r))},h=s=>{u||(u=!0,null==t.onError||t.onError(s),null==e||e(),r(s))},c=()=>new Promise(s=>{e=t=>{let e=u||!o();return e&&s(t),e},null==t.onPause||t.onPause()}).then(()=>{e=void 0,u||null==t.onContinue||t.onContinue()}),d=()=>{let e;if(!u){try{e=t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(l).catch(e=>{var s,r;if(u)return;let a=null!=(s=t.retry)?s:3,l=null!=(r=t.retryDelay)?r:K,f="function"==typeof l?l(n,e):l,p=!0===a||"number"==typeof a&&n<a||"function"==typeof a&&a(n,e);i||!p?h(e):(n++,null==t.onFail||t.onFail(n,e),F(f).then(()=>{if(o())return c()}).then(()=>{i?h(e):d()}))})}};return k(t.networkMode)?d():c().then(d),{promise:a,cancel:e=>{u||(h(new L(e)),null==t.abort||t.abort())},continue:()=>(null==e?void 0:e())?a:Promise.resolve(),cancelRetry:()=>{i=!0},continueRetry:()=>{i=!1}}}let _=console,B=(r=[],i=0,n=t=>{t()},u=t=>{t()},a=t=>{i?r.push(t):D(()=>{n(t)})},o=()=>{let t=r;r=[],t.length&&D(()=>{u(()=>{t.forEach(t=>{n(t)})})})},{batch:t=>{let e;i++;try{e=t()}finally{--i||o()}return e},batchCalls:t=>(...e)=>{a(()=>{t(...e)})},schedule:a,setNotifyFunction:t=>{n=t},setBatchNotifyFunction:t=>{u=t}});class N{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),d(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,null!=t?t:h?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class G extends N{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||_,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||function(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,s=void 0!==e,r=s?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?null!=r?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"loading",fetchStatus:"idle"}}(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.cache.remove(this)}setData(t,e){let s=A(this.state.data,t,this.options);return this.dispatch({data:s,type:"success",dataUpdatedAt:null==e?void 0:e.updatedAt,manual:null==e?void 0:e.manual}),s}setState(t,e){this.dispatch({type:"setState",state:t,setStateOptions:e})}cancel(t){var e;let s=this.promise;return null==(e=this.retryer)||e.cancel(t),s?s.then(c).catch(c):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>!1!==t.options.enabled)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!p(this.state.dataUpdatedAt,t)}onFocus(){var t;let e=this.observers.find(t=>t.shouldFetchOnWindowFocus());e&&e.refetch({cancelRefetch:!1}),null==(t=this.retryer)||t.continue()}onOnline(){var t;let e=this.observers.find(t=>t.shouldFetchOnReconnect());e&&e.refetch({cancelRefetch:!1}),null==(t=this.retryer)||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,e){var s,r,i,n;if("idle"!==this.state.fetchStatus){if(this.state.dataUpdatedAt&&null!=e&&e.cancelRefetch)this.cancel({silent:!0});else if(this.promise)return null==(i=this.retryer)||i.continueRetry(),this.promise}if(t&&this.setOptions(t),!this.options.queryFn){let t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}let u=function(){if("function"==typeof AbortController)return new AbortController}(),a={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},o=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>{if(u)return this.abortSignalConsumed=!0,u.signal}})};o(a);let l=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(a)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),h={fetchOptions:e,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:l};o(h),null==(s=this.options.behavior)||s.onFetch(h),this.revertState=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(r=h.fetchOptions)?void 0:r.meta))&&this.dispatch({type:"fetch",meta:null==(n=h.fetchOptions)?void 0:n.meta});let c=t=>{if(j(t)&&t.silent||this.dispatch({type:"error",error:t}),!j(t)){var e,s,r,i;null==(e=(s=this.cache.config).onError)||e.call(s,t,this),null==(r=(i=this.cache.config).onSettled)||r.call(i,this.state.data,t,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=H({fn:h.fetchFn,abort:null==u?void 0:u.abort.bind(u),onSuccess:t=>{var e,s,r,i;void 0===t?c(Error(this.queryHash+" data is undefined")):(this.setData(t),null==(e=(s=this.cache.config).onSuccess)||e.call(s,t,this),null==(r=(i=this.cache.config).onSettled)||r.call(i,t,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1)},onError:c,onFail:(t,e)=>{this.dispatch({type:"failed",failureCount:t,error:e})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){let e=e=>{var s,r;switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null!=(s=t.meta)?s:null,fetchStatus:k(this.options.networkMode)?"fetching":"paused",...!e.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...e,data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:null!=(r=t.dataUpdatedAt)?r:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let i=t.error;if(j(i)&&i.revert&&this.revertState)return{...this.revertState,fetchStatus:"idle"};return{...e,error:i,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}};this.state=e(this.state),B.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}class z extends l{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,e,s){var r;let i=e.queryKey,n=null!=(r=e.queryHash)?r:C(i,e),u=this.get(n);return u||(u=new G({cache:this,logger:t.getLogger(),queryKey:i,queryHash:n,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(u)),u}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){let e=this.queriesMap[t.queryHash];e&&(t.destroy(),this.queries=this.queries.filter(e=>e!==t),e===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){B.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,e){let[s]=m(t,e);return void 0===s.exact&&(s.exact=!0),this.queries.find(t=>g(s,t))}findAll(t,e){let[s]=m(t,e);return Object.keys(s).length>0?this.queries.filter(t=>g(s,t)):this.queries}notify(t){B.batch(()=>{this.listeners.forEach(({listener:e})=>{e(t)})})}onFocus(){B.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){B.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class W extends N{constructor(t){super(),this.defaultOptions=t.defaultOptions,this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||_,this.observers=[],this.state=t.state||J(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(e=>e!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,e;return null!=(t=null==(e=this.retryer)?void 0:e.continue())?t:this.execute()}async execute(){var t,e,s,r,i,n,u,a,o,l,h,c,d,f,p,y,v,m,b,g;let O=()=>{var t;return this.retryer=H({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(t,e)=>{this.dispatch({type:"failed",failureCount:t,error:e})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(t=this.options.retry)?t:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},C="loading"===this.state.status;try{if(!C){this.dispatch({type:"loading",variables:this.options.variables}),await (null==(o=(l=this.mutationCache.config).onMutate)?void 0:o.call(l,this.state.variables,this));let t=await (null==(h=(c=this.options).onMutate)?void 0:h.call(c,this.state.variables));t!==this.state.context&&this.dispatch({type:"loading",context:t,variables:this.state.variables})}let d=await O();return await (null==(t=(e=this.mutationCache.config).onSuccess)?void 0:t.call(e,d,this.state.variables,this.state.context,this)),await (null==(s=(r=this.options).onSuccess)?void 0:s.call(r,d,this.state.variables,this.state.context)),await (null==(i=(n=this.mutationCache.config).onSettled)?void 0:i.call(n,d,null,this.state.variables,this.state.context,this)),await (null==(u=(a=this.options).onSettled)?void 0:u.call(a,d,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:d}),d}catch(t){try{throw await (null==(d=(f=this.mutationCache.config).onError)?void 0:d.call(f,t,this.state.variables,this.state.context,this)),await (null==(p=(y=this.options).onError)?void 0:p.call(y,t,this.state.variables,this.state.context)),await (null==(v=(m=this.mutationCache.config).onSettled)?void 0:v.call(m,void 0,t,this.state.variables,this.state.context,this)),await (null==(b=(g=this.options).onSettled)?void 0:b.call(g,void 0,t,this.state.variables,this.state.context)),t}finally{this.dispatch({type:"error",error:t})}}}dispatch(t){let e=e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"loading":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!k(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...e,...t.state}}};this.state=e(this.state),B.batch(()=>{this.observers.forEach(e=>{e.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function J(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class V extends l{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,e,s){let r=new W({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(e),state:s,defaultOptions:e.mutationKey?t.getMutationDefaults(e.mutationKey):void 0});return this.add(r),r}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(e=>e!==t),this.notify({type:"removed",mutation:t})}clear(){B.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return void 0===t.exact&&(t.exact=!0),this.mutations.find(e=>O(t,e))}findAll(t){return this.mutations.filter(e=>O(t,e))}notify(t){B.batch(()=>{this.listeners.forEach(({listener:e})=>{e(t)})})}resumePausedMutations(){var t;return this.resuming=(null!=(t=this.resuming)?t:Promise.resolve()).then(()=>{let t=this.mutations.filter(t=>t.state.isPaused);return B.batch(()=>t.reduce((t,e)=>t.then(()=>e.continue().catch(c)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function X(){return{onFetch:t=>{t.fetchFn=()=>{var e,s,r,i,n,u;let a,o=null==(e=t.fetchOptions)||null==(s=e.meta)?void 0:s.refetchPage,l=null==(r=t.fetchOptions)||null==(i=r.meta)?void 0:i.fetchMore,h=null==l?void 0:l.pageParam,c=(null==l?void 0:l.direction)==="forward",d=(null==l?void 0:l.direction)==="backward",f=(null==(n=t.state.data)?void 0:n.pages)||[],p=(null==(u=t.state.data)?void 0:u.pageParams)||[],y=p,v=!1,m=t.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+t.options.queryHash+"'")),b=(t,e,s,r)=>(y=r?[e,...y]:[...y,e],r?[s,...t]:[...t,s]),g=(e,s,r,i)=>{if(v)return Promise.reject("Cancelled");if(void 0===r&&!s&&e.length)return Promise.resolve(e);let n={queryKey:t.queryKey,pageParam:r,meta:t.options.meta};return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>{var e,s;return null!=(e=t.signal)&&e.aborted?v=!0:null==(s=t.signal)||s.addEventListener("abort",()=>{v=!0}),t.signal}}),Promise.resolve(m(n)).then(t=>b(e,r,t,i))};if(f.length)if(c){let e=void 0!==h,s=e?h:Y(t.options,f);a=g(f,e,s)}else if(d){let e=void 0!==h,s=e?h:Z(t.options,f);a=g(f,e,s,!0)}else{y=[];let e=void 0===t.options.getNextPageParam;a=!o||!f[0]||o(f[0],0,f)?g([],e,p[0]):Promise.resolve(b([],p[0],f[0]));for(let s=1;s<f.length;s++)a=a.then(r=>{if(!o||!f[s]||o(f[s],s,f)){let i=e?p[s]:Y(t.options,r);return g(r,e,i)}return Promise.resolve(b(r,p[s],f[s]))})}else a=g([]);return a.then(t=>({pages:t,pageParams:y}))}}}}function Y(t,e){return null==t.getNextPageParam?void 0:t.getNextPageParam(e[e.length-1],e)}function Z(t,e){return null==t.getPreviousPageParam?void 0:t.getPreviousPageParam(e[0],e)}class ${constructor(t={}){this.queryCache=t.queryCache||new z,this.mutationCache=t.mutationCache||new V,this.logger=t.logger||_,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,1===this.mountCount&&(this.unsubscribeFocus=I.subscribe(()=>{I.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=T.subscribe(()=>{T.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,e;this.mountCount--,0===this.mountCount&&(null==(t=this.unsubscribeFocus)||t.call(this),this.unsubscribeFocus=void 0,null==(e=this.unsubscribeOnline)||e.call(this),this.unsubscribeOnline=void 0)}isFetching(t,e){let[s]=m(t,e);return s.fetchStatus="fetching",this.queryCache.findAll(s).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,e){var s;return null==(s=this.queryCache.find(t,e))?void 0:s.state.data}ensureQueryData(t,e,s){let r=y(t,e,s),i=this.getQueryData(r.queryKey);return i?Promise.resolve(i):this.fetchQuery(r)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){let r=this.queryCache.find(t),i=null==r?void 0:r.state.data,n="function"==typeof e?e(i):e;if(void 0===n)return;let u=y(t),a=this.defaultQueryOptions(u);return this.queryCache.build(this,a).setData(n,{...s,manual:!0})}setQueriesData(t,e,s){return B.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t,e){var s;return null==(s=this.queryCache.find(t,e))?void 0:s.state}removeQueries(t,e){let[s]=m(t,e),r=this.queryCache;B.batch(()=>{r.findAll(s).forEach(t=>{r.remove(t)})})}resetQueries(t,e,s){let[r,i]=m(t,e,s),n=this.queryCache,u={type:"active",...r};return B.batch(()=>(n.findAll(r).forEach(t=>{t.reset()}),this.refetchQueries(u,i)))}cancelQueries(t,e,s){let[r,i={}]=m(t,e,s);return void 0===i.revert&&(i.revert=!0),Promise.all(B.batch(()=>this.queryCache.findAll(r).map(t=>t.cancel(i)))).then(c).catch(c)}invalidateQueries(t,e,s){let[r,i]=m(t,e,s);return B.batch(()=>{var t,e;if(this.queryCache.findAll(r).forEach(t=>{t.invalidate()}),"none"===r.refetchType)return Promise.resolve();let s={...r,type:null!=(t=null!=(e=r.refetchType)?e:r.type)?t:"active"};return this.refetchQueries(s,i)})}refetchQueries(t,e,s){let[r,i]=m(t,e,s),n=Promise.all(B.batch(()=>this.queryCache.findAll(r).filter(t=>!t.isDisabled()).map(t=>{var e;return t.fetch(void 0,{...i,cancelRefetch:null==(e=null==i?void 0:i.cancelRefetch)||e,meta:{refetchPage:r.refetchPage}})}))).then(c);return null!=i&&i.throwOnError||(n=n.catch(c)),n}fetchQuery(t,e,s){let r=y(t,e,s),i=this.defaultQueryOptions(r);void 0===i.retry&&(i.retry=!1);let n=this.queryCache.build(this,i);return n.isStaleByTime(i.staleTime)?n.fetch(i):Promise.resolve(n.state.data)}prefetchQuery(t,e,s){return this.fetchQuery(t,e,s).then(c).catch(c)}fetchInfiniteQuery(t,e,s){let r=y(t,e,s);return r.behavior=X(),this.fetchQuery(r)}prefetchInfiniteQuery(t,e,s){return this.fetchInfiniteQuery(t,e,s).then(c).catch(c)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,e){let s=this.queryDefaults.find(e=>R(t)===R(e.queryKey));s?s.defaultOptions=e:this.queryDefaults.push({queryKey:t,defaultOptions:e})}getQueryDefaults(t){if(!t)return;let e=this.queryDefaults.find(e=>S(t,e.queryKey));return null==e?void 0:e.defaultOptions}setMutationDefaults(t,e){let s=this.mutationDefaults.find(e=>R(t)===R(e.mutationKey));s?s.defaultOptions=e:this.mutationDefaults.push({mutationKey:t,defaultOptions:e})}getMutationDefaults(t){if(!t)return;let e=this.mutationDefaults.find(e=>S(t,e.mutationKey));return null==e?void 0:e.defaultOptions}defaultQueryOptions(t){if(null!=t&&t._defaulted)return t;let e={...this.defaultOptions.queries,...this.getQueryDefaults(null==t?void 0:t.queryKey),...t,_defaulted:!0};return!e.queryHash&&e.queryKey&&(e.queryHash=C(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.useErrorBoundary&&(e.useErrorBoundary=!!e.suspense),e}defaultMutationOptions(t){return null!=t&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(null==t?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class tt extends l{constructor(t,e){super(),this.client=t,this.options=e,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(e)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.currentQuery.addObserver(this),te(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ts(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ts(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,e){let s=this.options,r=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),E(s,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=s.queryKey),this.updateQuery();let i=this.hasListeners();i&&tr(this.currentQuery,r,this.options,s)&&this.executeFetch(),this.updateResult(e),i&&(this.currentQuery!==r||this.options.enabled!==s.enabled||this.options.staleTime!==s.staleTime)&&this.updateStaleTimeout();let n=this.computeRefetchInterval();i&&(this.currentQuery!==r||this.options.enabled!==s.enabled||n!==this.currentRefetchInterval)&&this.updateRefetchInterval(n)}getOptimisticResult(t){var e,s,r;let i=this.client.getQueryCache().build(this.client,t),n=this.createResult(i,t);return e=this,s=n,(r=t).keepPreviousData||(void 0!==r.placeholderData?!s.isPlaceholderData:E(e.getCurrentResult(),s))||(this.currentResult=n,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),n}getCurrentResult(){return this.currentResult}trackResult(t){let e={};return Object.keys(t).forEach(s=>{Object.defineProperty(e,s,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(s),t[s])})}),e}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...e}={}){return this.fetch({...e,meta:{refetchPage:t}})}fetchOptimistic(t){let e=this.client.defaultQueryOptions(t),s=this.client.getQueryCache().build(this.client,e);return s.isFetchingOptimistic=!0,s.fetch().then(()=>this.createResult(s,e))}fetch(t){var e;return this.executeFetch({...t,cancelRefetch:null==(e=t.cancelRefetch)||e}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let e=this.currentQuery.fetch(this.options,t);return null!=t&&t.throwOnError||(e=e.catch(c)),e}updateStaleTimeout(){if(this.clearStaleTimeout(),h||this.currentResult.isStale||!d(this.options.staleTime))return;let t=p(this.currentResult.dataUpdatedAt,this.options.staleTime);this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},t+1)}computeRefetchInterval(){var t;return"function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.currentResult.data,this.currentQuery):null!=(t=this.options.refetchInterval)&&t}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!h&&!1!==this.options.enabled&&d(this.currentRefetchInterval)&&0!==this.currentRefetchInterval&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||I.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,e){let s,r=this.currentQuery,i=this.options,n=this.currentResult,u=this.currentResultState,a=this.currentResultOptions,o=t!==r,l=o?t.state:this.currentQueryInitialState,h=o?this.currentResult:this.previousQueryResult,{state:c}=t,{dataUpdatedAt:d,error:f,errorUpdatedAt:p,fetchStatus:y,status:v}=c,m=!1,b=!1;if(e._optimisticResults){let s=this.hasListeners(),n=!s&&te(t,e),u=s&&tr(t,r,e,i);(n||u)&&(y=k(t.options.networkMode)?"fetching":"paused",d||(v="loading")),"isRestoring"===e._optimisticResults&&(y="idle")}if(e.keepPreviousData&&!c.dataUpdatedAt&&null!=h&&h.isSuccess&&"error"!==v)s=h.data,d=h.dataUpdatedAt,v=h.status,m=!0;else if(e.select&&void 0!==c.data)if(n&&c.data===(null==u?void 0:u.data)&&e.select===this.selectFn)s=this.selectResult;else try{this.selectFn=e.select,s=e.select(c.data),s=A(null==n?void 0:n.data,s,e),this.selectResult=s,this.selectError=null}catch(t){this.selectError=t}else s=c.data;if(void 0!==e.placeholderData&&void 0===s&&"loading"===v){let t;if(null!=n&&n.isPlaceholderData&&e.placeholderData===(null==a?void 0:a.placeholderData))t=n.data;else if(t="function"==typeof e.placeholderData?e.placeholderData():e.placeholderData,e.select&&void 0!==t)try{t=e.select(t),this.selectError=null}catch(t){this.selectError=t}void 0!==t&&(v="success",s=A(null==n?void 0:n.data,t,e),b=!0)}this.selectError&&(f=this.selectError,s=this.selectResult,p=Date.now(),v="error");let g="fetching"===y,O="loading"===v,C="error"===v;return{status:v,fetchStatus:y,isLoading:O,isSuccess:"success"===v,isError:C,isInitialLoading:O&&g,data:s,dataUpdatedAt:d,error:f,errorUpdatedAt:p,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:g,isRefetching:g&&!O,isLoadingError:C&&0===c.dataUpdatedAt,isPaused:"paused"===y,isPlaceholderData:b,isPreviousData:m,isRefetchError:C&&0!==c.dataUpdatedAt,isStale:ti(t,e),refetch:this.refetch,remove:this.remove}}updateResult(t){let e=this.currentResult,s=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,E(s,e))return;this.currentResult=s;let r={cache:!0},i=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.trackedProps.size)return!0;let r=new Set(null!=s?s:this.trackedProps);return this.options.useErrorBoundary&&r.add("error"),Object.keys(this.currentResult).some(t=>this.currentResult[t]!==e[t]&&r.has(t))};(null==t?void 0:t.listeners)!==!1&&i()&&(r.listeners=!0),this.notify({...r,...t})}updateQuery(){let t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;let e=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(null==e||e.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){let e={};"success"===t.type?e.onSuccess=!t.manual:"error"!==t.type||j(t.error)||(e.onError=!0),this.updateResult(e),this.hasListeners()&&this.updateTimers()}notify(t){B.batch(()=>{var e,s,r,i,n,u,a,o;t.onSuccess?(null==(e=(s=this.options).onSuccess)||e.call(s,this.currentResult.data),null==(r=(i=this.options).onSettled)||r.call(i,this.currentResult.data,null)):t.onError&&(null==(n=(u=this.options).onError)||n.call(u,this.currentResult.error),null==(a=(o=this.options).onSettled)||a.call(o,void 0,this.currentResult.error)),t.listeners&&this.listeners.forEach(({listener:t})=>{t(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function te(t,e){return!1!==e.enabled&&!t.state.dataUpdatedAt&&("error"!==t.state.status||!1!==e.retryOnMount)||t.state.dataUpdatedAt>0&&ts(t,e,e.refetchOnMount)}function ts(t,e,s){if(!1!==e.enabled){let r="function"==typeof s?s(t):s;return"always"===r||!1!==r&&ti(t,e)}return!1}function tr(t,e,s,r){return!1!==s.enabled&&(t!==e||!1===r.enabled)&&(!s.suspense||"error"!==t.state.status)&&ti(t,s)}function ti(t,e){return t.isStaleByTime(e.staleTime)}class tn extends l{constructor(t,e){super(),this.client=t,this.queries=[],this.result=[],this.observers=[],this.observersMap={},e&&this.setQueries(e)}onSubscribe(){1===this.listeners.size&&this.observers.forEach(t=>{t.subscribe(e=>{this.onUpdate(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.observers.forEach(t=>{t.destroy()})}setQueries(t,e){this.queries=t,B.batch(()=>{let t=this.observers,s=this.findMatchingObservers(this.queries);s.forEach(t=>t.observer.setOptions(t.defaultedQueryOptions,e));let r=s.map(t=>t.observer),i=Object.fromEntries(r.map(t=>[t.options.queryHash,t])),n=r.map(t=>t.getCurrentResult()),u=r.some((e,s)=>e!==t[s]);t.length===r.length&&!u||(this.observers=r,this.observersMap=i,this.result=n,this.hasListeners()&&(f(t,r).forEach(t=>{t.destroy()}),f(r,t).forEach(t=>{t.subscribe(e=>{this.onUpdate(t,e)})}),this.notify()))})}getCurrentResult(){return this.result}getQueries(){return this.observers.map(t=>t.getCurrentQuery())}getObservers(){return this.observers}getOptimisticResult(t){return this.findMatchingObservers(t).map(t=>t.observer.getOptimisticResult(t.defaultedQueryOptions))}findMatchingObservers(t){let e=this.observers,s=new Map(e.map(t=>[t.options.queryHash,t])),r=t.map(t=>this.client.defaultQueryOptions(t)),i=r.flatMap(t=>{let e=s.get(t.queryHash);return null!=e?[{defaultedQueryOptions:t,observer:e}]:[]}),n=new Set(i.map(t=>t.defaultedQueryOptions.queryHash)),u=r.filter(t=>!n.has(t.queryHash)),a=new Set(i.map(t=>t.observer)),o=e.filter(t=>!a.has(t)),l=t=>{let e=this.client.defaultQueryOptions(t),s=this.observersMap[e.queryHash];return null!=s?s:new tt(this.client,e)},h=u.map((t,e)=>{if(t.keepPreviousData){let s=o[e];if(void 0!==s)return{defaultedQueryOptions:t,observer:s}}return{defaultedQueryOptions:t,observer:l(t)}});return i.concat(h).sort((t,e)=>r.indexOf(t.defaultedQueryOptions)-r.indexOf(e.defaultedQueryOptions))}onUpdate(t,e){let s=this.observers.indexOf(t);if(-1!==s){var r;let t;this.result=(r=this.result,(t=r.slice(0))[s]=e,t),this.notify()}}notify(){B.batch(()=>{this.listeners.forEach(({listener:t})=>{t(this.result)})})}}class tu extends tt{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t,e){super.setOptions({...t,behavior:X()},e)}getOptimisticResult(t){return t.behavior=X(),super.getOptimisticResult(t)}fetchNextPage({pageParam:t,...e}={}){return this.fetch({...e,meta:{fetchMore:{direction:"forward",pageParam:t}}})}fetchPreviousPage({pageParam:t,...e}={}){return this.fetch({...e,meta:{fetchMore:{direction:"backward",pageParam:t}}})}createResult(t,e){var s,r,i,n,u,a;let{state:o}=t,l=super.createResult(t,e),{isFetching:h,isRefetching:c}=l,d=h&&(null==(s=o.fetchMeta)||null==(r=s.fetchMore)?void 0:r.direction)==="forward",f=h&&(null==(i=o.fetchMeta)||null==(n=i.fetchMore)?void 0:n.direction)==="backward";return{...l,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:function(t,e){if(t.getNextPageParam&&Array.isArray(e)){let s=Y(t,e);return null!=s&&!1!==s}}(e,null==(u=o.data)?void 0:u.pages),hasPreviousPage:function(t,e){if(t.getPreviousPageParam&&Array.isArray(e)){let s=Z(t,e);return null!=s&&!1!==s}}(e,null==(a=o.data)?void 0:a.pages),isFetchingNextPage:d,isFetchingPreviousPage:f,isRefetching:c&&!d&&!f}}}class ta extends l{constructor(t,e){super(),this.client=t,this.setOptions(e),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var e;let s=this.options;this.options=this.client.defaultMutationOptions(t),E(s,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),null==(e=this.currentMutation)||e.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var t;null==(t=this.currentMutation)||t.removeObserver(this)}}onMutationUpdate(t){this.updateResult();let e={listeners:!0};"success"===t.type?e.onSuccess=!0:"error"===t.type&&(e.onError=!0),this.notify(e)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,e){return this.mutateOptions=e,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==t?t:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let t=this.currentMutation?this.currentMutation.state:J(),e="loading"===t.status,s={...t,isLoading:e,isPending:e,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset};this.currentResult=s}notify(t){B.batch(()=>{if(this.mutateOptions&&this.hasListeners()){var e,s,r,i,n,u,a,o;t.onSuccess?(null==(e=(s=this.mutateOptions).onSuccess)||e.call(s,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(r=(i=this.mutateOptions).onSettled)||r.call(i,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):t.onError&&(null==(n=(u=this.mutateOptions).onError)||n.call(u,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(a=(o=this.mutateOptions).onSettled)||a.call(o,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}t.listeners&&this.listeners.forEach(({listener:t})=>{t(this.currentResult)})})}}function to(t){return t.state.isPaused}function tl(t){return"success"===t.state.status}function th(t,e={}){let s=[],r=[];if(!1!==e.dehydrateMutations){let r=e.shouldDehydrateMutation||to;t.getMutationCache().getAll().forEach(t=>{r(t)&&s.push({mutationKey:t.options.mutationKey,state:t.state})})}if(!1!==e.dehydrateQueries){let s=e.shouldDehydrateQuery||tl;t.getQueryCache().getAll().forEach(t=>{s(t)&&r.push({state:t.state,queryKey:t.queryKey,queryHash:t.queryHash})})}return{mutations:s,queries:r}}function tc(t,e,s){if("object"!=typeof e||null===e)return;let r=t.getMutationCache(),i=t.getQueryCache(),n=e.mutations||[],u=e.queries||[];n.forEach(e=>{var i;r.build(t,{...null==s||null==(i=s.defaultOptions)?void 0:i.mutations,mutationKey:e.mutationKey},e.state)}),u.forEach(({queryKey:e,state:r,queryHash:n})=>{var u;let a=i.get(n);if(a){if(a.state.dataUpdatedAt<r.dataUpdatedAt){let{fetchStatus:t,...e}=r;a.setState(e)}return}i.build(t,{...null==s||null==(u=s.defaultOptions)?void 0:u.queries,queryKey:e,queryHash:n},{...r,fetchStatus:"idle"})})}var td=s(70451);let tf=s(43676).useSyncExternalStore,tp=td.createContext(void 0),ty=td.createContext(!1);function tv(t,e){return t||(e&&"u">typeof window?(window.ReactQueryClientContext||(window.ReactQueryClientContext=tp),window.ReactQueryClientContext):tp)}let tm=({context:t}={})=>{let e=td.useContext(tv(t,td.useContext(ty)));if(!e)throw Error("No QueryClient set, use QueryClientProvider to set one");return e},tb=({client:t,children:e,context:s,contextSharing:r=!1})=>{td.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]);let i=tv(s,r);return td.createElement(ty.Provider,{value:!s&&r},td.createElement(i.Provider,{value:t},e))},tg=td.createContext(!1),tO=()=>td.useContext(tg),tC=tg.Provider;function tR(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}let tS=td.createContext(tR()),tQ=()=>td.useContext(tS),tE=({children:t})=>{let[e]=td.useState(()=>tR());return td.createElement(tS.Provider,{value:e},"function"==typeof t?t(e):t)};function tq(t,e){return"function"==typeof t?t(...e):!!t}let tw=(t,e)=>{(t.suspense||t.useErrorBoundary)&&!e.isReset()&&(t.retryOnMount=!1)},tP=t=>{td.useEffect(()=>{t.clearReset()},[t])},tM=({result:t,errorResetBoundary:e,useErrorBoundary:s,query:r})=>t.isError&&!e.isReset()&&!t.isFetching&&tq(s,[t.error,r]),tx=t=>{t.suspense&&("number"!=typeof t.staleTime&&(t.staleTime=1e3),"number"==typeof t.cacheTime&&(t.cacheTime=Math.max(t.cacheTime,1e3)))},tF=(t,e)=>t.isLoading&&t.isFetching&&!e,tD=(t,e,s)=>(null==t?void 0:t.suspense)&&tF(e,s),tA=(t,e,s)=>e.fetchOptimistic(t).then(({data:e})=>{null==t.onSuccess||t.onSuccess(e),null==t.onSettled||t.onSettled(e,null)}).catch(e=>{s.clearReset(),null==t.onError||t.onError(e),null==t.onSettled||t.onSettled(void 0,e)});function tI({queries:t,context:e}){let s=tm({context:e}),r=tO(),i=tQ(),n=td.useMemo(()=>t.map(t=>{let e=s.defaultQueryOptions(t);return e._optimisticResults=r?"isRestoring":"optimistic",e}),[t,s,r]);n.forEach(t=>{tx(t),tw(t,i)}),tP(i);let[u]=td.useState(()=>new tn(s,n)),a=u.getOptimisticResult(n);tf(td.useCallback(t=>r?()=>void 0:u.subscribe(B.batchCalls(t)),[u,r]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),td.useEffect(()=>{u.setQueries(n,{listeners:!1})},[n,u]);let o=a.some((t,e)=>tD(n[e],t,r))?a.flatMap((t,e)=>{let s=n[e],a=u.getObservers()[e];if(s&&a)if(tD(s,t,r))return tA(s,a,i);else tF(t,r)&&tA(s,a,i);return[]}):[];if(o.length>0)throw Promise.all(o);let l=u.getQueries(),h=a.find((t,e)=>{var s,r;return tM({result:t,errorResetBoundary:i,useErrorBoundary:null!=(s=null==(r=n[e])?void 0:r.useErrorBoundary)&&s,query:l[e]})});if(null!=h&&h.error)throw h.error;return a}function tU(t,e){let s=tm({context:t.context}),r=tO(),i=tQ(),n=s.defaultQueryOptions(t);n._optimisticResults=r?"isRestoring":"optimistic",n.onError&&(n.onError=B.batchCalls(n.onError)),n.onSuccess&&(n.onSuccess=B.batchCalls(n.onSuccess)),n.onSettled&&(n.onSettled=B.batchCalls(n.onSettled)),tx(n),tw(n,i),tP(i);let[u]=td.useState(()=>new e(s,n)),a=u.getOptimisticResult(n);if(tf(td.useCallback(t=>{let e=r?()=>void 0:u.subscribe(B.batchCalls(t));return u.updateResult(),e},[u,r]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),td.useEffect(()=>{u.setOptions(n,{listeners:!1})},[n,u]),tD(n,a,r))throw tA(n,u,i);if(tM({result:a,errorResetBoundary:i,useErrorBoundary:n.useErrorBoundary,query:u.getCurrentQuery()}))throw a.error;return n.notifyOnChangeProps?a:u.trackResult(a)}function tT(t,e,s){return tU(y(t,e,s),tt)}function tK(t){return tU({...t,enabled:!0,useErrorBoundary:!0,suspense:!0,placeholderData:void 0,networkMode:"always",onSuccess:void 0,onError:void 0,onSettled:void 0},tt)}function tk(t){return tU({...t,enabled:!0,suspense:!0,useErrorBoundary:!0,networkMode:"always"},tu)}function tL({queries:t,context:e}){return tI({queries:t.map(t=>({...t,enabled:!0,useErrorBoundary:!0,suspense:!0,placeholderData:void 0,networkMode:"always"})),context:e})}function tj(t){return t}function tH(t){return t}function t_(t,e={}){let s=tm({context:e.context}),r=td.useRef(e);r.current=e,td.useMemo(()=>{t&&tc(s,t,r.current)},[s,t])}let tB=({children:t,options:e,state:s})=>(t_(s,e),t);function tN(t,e,s){let[r,i={}]=m(t,e,s),n=tm({context:i.context}),u=n.getQueryCache();return tf(td.useCallback(t=>u.subscribe(B.batchCalls(t)),[u]),()=>n.isFetching(r),()=>n.isFetching(r))}function tG(t,e,s){let[r,i={}]=b(t,e,s),n=tm({context:i.context}),u=n.getMutationCache();return tf(td.useCallback(t=>u.subscribe(B.batchCalls(t)),[u]),()=>n.isMutating(r),()=>n.isMutating(r))}function tz(t){return t}function tW(t,e,s){let r=v(t,e,s),i=tm({context:r.context}),[n]=td.useState(()=>new ta(i,r));td.useEffect(()=>{n.setOptions(r)},[n,r]);let u=tf(td.useCallback(t=>n.subscribe(B.batchCalls(t)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=td.useCallback((t,e)=>{n.mutate(t,e).catch(tJ)},[n]);if(u.error&&tq(n.options.useErrorBoundary,[u.error]))throw u.error;return{...u,mutate:a,mutateAsync:u.mutate}}function tJ(){}function tV(t,e,s){return tU(y(t,e,s),tu)}function tX(t){let e=tm();e.getQueryState(t.queryKey)||e.prefetchQuery(t)}function tY(t){let e=tm();e.getQueryState(t.queryKey)||e.prefetchInfiniteQuery(t)}}}]);
1
+ /*! For license information please see 7862.0073336d.js.LICENSE.txt */
2
+ "use strict";(self.chunk_AlertManager_0_2_0_beta_3=self.chunk_AlertManager_0_2_0_beta_3||[]).push([["7862"],{32473(t,e,s){var r=s(70451),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},n=r.useState,u=r.useEffect,a=r.useLayoutEffect,o=r.useDebugValue;function l(t){var e=t.getSnapshot;t=t.value;try{var s=e();return!i(t,s)}catch(t){return!0}}var h="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var s=e(),r=n({inst:{value:s,getSnapshot:e}}),i=r[0].inst,h=r[1];return a(function(){i.value=s,i.getSnapshot=e,l(i)&&h({inst:i})},[t,s,e]),u(function(){return l(i)&&h({inst:i}),t(function(){l(i)&&h({inst:i})})},[t]),o(s),s};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:h},43676(t,e,s){t.exports=s(32473)},76693(t,e,s){let r,i,n,u,a,o;s.r(e),s.d(e,{isError:()=>x,useQueryErrorResetBoundary:()=>tQ,IsRestoringProvider:()=>tC,dehydrate:()=>th,isServer:()=>h,parseFilterArgs:()=>m,parseMutationFilterArgs:()=>b,queryOptions:()=>tj,infiniteQueryOptions:()=>tH,useSuspenseQuery:()=>tK,QueriesObserver:()=>tn,defaultContext:()=>tp,QueryClient:()=>$,Query:()=>G,Hydrate:()=>tB,useInfiniteQuery:()=>tV,useIsMutating:()=>tG,CancelledError:()=>L,usePrefetchQuery:()=>tX,useQueryClient:()=>tm,isCancelledError:()=>j,matchQuery:()=>g,MutationCache:()=>V,MutationObserver:()=>ta,defaultShouldDehydrateQuery:()=>tl,mutationOptions:()=>tz,notifyManager:()=>B,QueryCache:()=>z,useQueries:()=>tI,parseQueryArgs:()=>y,replaceEqualDeep:()=>Q,defaultShouldDehydrateMutation:()=>to,hydrate:()=>tc,useHydrate:()=>t_,useQuery:()=>tT,onlineManager:()=>T,InfiniteQueryObserver:()=>tu,QueryClientProvider:()=>tb,hashQueryKey:()=>R,QueryObserver:()=>tt,useIsRestoring:()=>tO,useSuspenseInfiniteQuery:()=>tk,useSuspenseQueries:()=>tL,parseMutationArgs:()=>v,focusManager:()=>I,useIsFetching:()=>tN,useMutation:()=>tW,usePrefetchInfiniteQuery:()=>tY,QueryErrorResetBoundary:()=>tE});class l{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){let e={listener:t};return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}let h="u"<typeof window||"Deno"in window;function c(){}function d(t){return"number"==typeof t&&t>=0&&t!==1/0}function f(t,e){return t.filter(t=>!e.includes(t))}function p(t,e){return Math.max(t+(e||0)-Date.now(),0)}function y(t,e,s){return M(t)?"function"==typeof e?{...s,queryKey:t,queryFn:e}:{...e,queryKey:t}:t}function v(t,e,s){return M(t)?"function"==typeof e?{...s,mutationKey:t,mutationFn:e}:{...e,mutationKey:t}:"function"==typeof t?{...e,mutationFn:t}:{...t}}function m(t,e,s){return M(t)?[{...e,queryKey:t},s]:[t||{},e]}function b(t,e,s){return M(t)?[{...e,mutationKey:t},s]:[t||{},e]}function g(t,e){let{type:s="all",exact:r,fetchStatus:i,predicate:n,queryKey:u,stale:a}=t;if(M(u))if(r){if(e.queryHash!==C(u,e.options))return!1}else{var o;if(o=e.queryKey,!S(o,u))return!1}if("all"!==s){let t=e.isActive();if("active"===s&&!t||"inactive"===s&&t)return!1}return("boolean"!=typeof a||e.isStale()===a)&&(void 0===i||i===e.state.fetchStatus)&&(!n||!!n(e))}function O(t,e){let{exact:s,fetching:r,predicate:i,mutationKey:n}=t;if(M(n)){if(!e.options.mutationKey)return!1;if(s){if(R(e.options.mutationKey)!==R(n))return!1}else{var u;if(u=e.options.mutationKey,!S(u,n))return!1}}return("boolean"!=typeof r||"loading"===e.state.status===r)&&(!i||!!i(e))}function C(t,e){return((null==e?void 0:e.queryKeyHashFn)||R)(t)}function R(t){return JSON.stringify(t,(t,e)=>w(e)?Object.keys(e).sort().reduce((t,s)=>(t[s]=e[s],t),{}):e)}function S(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&!Object.keys(e).some(s=>!S(t[s],e[s]))}function Q(t,e,s=0){if(t===e)return t;if(s>500)return e;let r=q(t)&&q(e);if(r||w(t)&&w(e)){let i=r?t.length:Object.keys(t).length,n=r?e:Object.keys(e),u=n.length,a=r?[]:{},o=0;for(let i=0;i<u;i++){let u=r?i:n[i];a[u]=Q(t[u],e[u],s+1),a[u]===t[u]&&o++}return i===u&&o===i?t:a}return e}function E(t,e){if(t&&!e||e&&!t)return!1;for(let s in t)if(t[s]!==e[s])return!1;return!0}function q(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function w(t){if(!P(t))return!1;let e=t.constructor;if(void 0===e)return!0;let s=e.prototype;return!!P(s)&&!!s.hasOwnProperty("isPrototypeOf")}function P(t){return"[object Object]"===Object.prototype.toString.call(t)}function M(t){return Array.isArray(t)}function x(t){return t instanceof Error}function F(t){return new Promise(e=>{setTimeout(e,t)})}function D(t){F(0).then(t)}function A(t,e,s){return null!=s.isDataEqual&&s.isDataEqual(t,e)?t:"function"==typeof s.structuralSharing?s.structuralSharing(t,e):!1!==s.structuralSharing?Q(t,e):e}let I=new class extends l{constructor(){super(),this.setup=t=>{if(!h&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",e,!1),()=>{window.removeEventListener("visibilitychange",e),window.removeEventListener("focus",e)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;null==(t=this.cleanup)||t.call(this),this.cleanup=void 0}}setEventListener(t){var e;this.setup=t,null==(e=this.cleanup)||e.call(this),this.cleanup=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.focused!==t&&(this.focused=t,this.onFocus())}onFocus(){this.listeners.forEach(({listener:t})=>{t()})}isFocused(){return"boolean"==typeof this.focused?this.focused:"u"<typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}},U=["online","offline"],T=new class extends l{constructor(){super(),this.setup=t=>{if(!h&&window.addEventListener){let e=()=>t();return U.forEach(t=>{window.addEventListener(t,e,!1)}),()=>{U.forEach(t=>{window.removeEventListener(t,e)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;null==(t=this.cleanup)||t.call(this),this.cleanup=void 0}}setEventListener(t){var e;this.setup=t,null==(e=this.cleanup)||e.call(this),this.cleanup=t(t=>{"boolean"==typeof t?this.setOnline(t):this.onOnline()})}setOnline(t){this.online!==t&&(this.online=t,this.onOnline())}onOnline(){this.listeners.forEach(({listener:t})=>{t()})}isOnline(){return"boolean"==typeof this.online?this.online:"u"<typeof navigator||void 0===navigator.onLine||navigator.onLine}};function K(t){return Math.min(1e3*2**t,3e4)}function k(t){return(null!=t?t:"online")!=="online"||T.isOnline()}class L{constructor(t){this.revert=null==t?void 0:t.revert,this.silent=null==t?void 0:t.silent}}function j(t){return t instanceof L}function H(t){let e,s,r,i=!1,n=0,u=!1,a=new Promise((t,e)=>{s=t,r=e}),o=()=>!I.isFocused()||"always"!==t.networkMode&&!T.isOnline(),l=r=>{u||(u=!0,null==t.onSuccess||t.onSuccess(r),null==e||e(),s(r))},h=s=>{u||(u=!0,null==t.onError||t.onError(s),null==e||e(),r(s))},c=()=>new Promise(s=>{e=t=>{let e=u||!o();return e&&s(t),e},null==t.onPause||t.onPause()}).then(()=>{e=void 0,u||null==t.onContinue||t.onContinue()}),d=()=>{let e;if(!u){try{e=t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(l).catch(e=>{var s,r;if(u)return;let a=null!=(s=t.retry)?s:3,l=null!=(r=t.retryDelay)?r:K,f="function"==typeof l?l(n,e):l,p=!0===a||"number"==typeof a&&n<a||"function"==typeof a&&a(n,e);i||!p?h(e):(n++,null==t.onFail||t.onFail(n,e),F(f).then(()=>{if(o())return c()}).then(()=>{i?h(e):d()}))})}};return k(t.networkMode)?d():c().then(d),{promise:a,cancel:e=>{u||(h(new L(e)),null==t.abort||t.abort())},continue:()=>(null==e?void 0:e())?a:Promise.resolve(),cancelRetry:()=>{i=!0},continueRetry:()=>{i=!1}}}let _=console,B=(r=[],i=0,n=t=>{t()},u=t=>{t()},a=t=>{i?r.push(t):D(()=>{n(t)})},o=()=>{let t=r;r=[],t.length&&D(()=>{u(()=>{t.forEach(t=>{n(t)})})})},{batch:t=>{let e;i++;try{e=t()}finally{--i||o()}return e},batchCalls:t=>(...e)=>{a(()=>{t(...e)})},schedule:a,setNotifyFunction:t=>{n=t},setBatchNotifyFunction:t=>{u=t}});class N{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),d(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,null!=t?t:h?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class G extends N{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||_,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||function(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,s=void 0!==e,r=s?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?null!=r?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"loading",fetchStatus:"idle"}}(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.cache.remove(this)}setData(t,e){let s=A(this.state.data,t,this.options);return this.dispatch({data:s,type:"success",dataUpdatedAt:null==e?void 0:e.updatedAt,manual:null==e?void 0:e.manual}),s}setState(t,e){this.dispatch({type:"setState",state:t,setStateOptions:e})}cancel(t){var e;let s=this.promise;return null==(e=this.retryer)||e.cancel(t),s?s.then(c).catch(c):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>!1!==t.options.enabled)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!p(this.state.dataUpdatedAt,t)}onFocus(){var t;let e=this.observers.find(t=>t.shouldFetchOnWindowFocus());e&&e.refetch({cancelRefetch:!1}),null==(t=this.retryer)||t.continue()}onOnline(){var t;let e=this.observers.find(t=>t.shouldFetchOnReconnect());e&&e.refetch({cancelRefetch:!1}),null==(t=this.retryer)||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,e){var s,r,i,n;if("idle"!==this.state.fetchStatus){if(this.state.dataUpdatedAt&&null!=e&&e.cancelRefetch)this.cancel({silent:!0});else if(this.promise)return null==(i=this.retryer)||i.continueRetry(),this.promise}if(t&&this.setOptions(t),!this.options.queryFn){let t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}let u=function(){if("function"==typeof AbortController)return new AbortController}(),a={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},o=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>{if(u)return this.abortSignalConsumed=!0,u.signal}})};o(a);let l=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(a)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),h={fetchOptions:e,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:l};o(h),null==(s=this.options.behavior)||s.onFetch(h),this.revertState=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(r=h.fetchOptions)?void 0:r.meta))&&this.dispatch({type:"fetch",meta:null==(n=h.fetchOptions)?void 0:n.meta});let c=t=>{if(j(t)&&t.silent||this.dispatch({type:"error",error:t}),!j(t)){var e,s,r,i;null==(e=(s=this.cache.config).onError)||e.call(s,t,this),null==(r=(i=this.cache.config).onSettled)||r.call(i,this.state.data,t,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=H({fn:h.fetchFn,abort:null==u?void 0:u.abort.bind(u),onSuccess:t=>{var e,s,r,i;void 0===t?c(Error(this.queryHash+" data is undefined")):(this.setData(t),null==(e=(s=this.cache.config).onSuccess)||e.call(s,t,this),null==(r=(i=this.cache.config).onSettled)||r.call(i,t,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1)},onError:c,onFail:(t,e)=>{this.dispatch({type:"failed",failureCount:t,error:e})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){let e=e=>{var s,r;switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null!=(s=t.meta)?s:null,fetchStatus:k(this.options.networkMode)?"fetching":"paused",...!e.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...e,data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:null!=(r=t.dataUpdatedAt)?r:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let i=t.error;if(j(i)&&i.revert&&this.revertState)return{...this.revertState,fetchStatus:"idle"};return{...e,error:i,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}};this.state=e(this.state),B.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}class z extends l{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,e,s){var r;let i=e.queryKey,n=null!=(r=e.queryHash)?r:C(i,e),u=this.get(n);return u||(u=new G({cache:this,logger:t.getLogger(),queryKey:i,queryHash:n,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(u)),u}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){let e=this.queriesMap[t.queryHash];e&&(t.destroy(),this.queries=this.queries.filter(e=>e!==t),e===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){B.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,e){let[s]=m(t,e);return void 0===s.exact&&(s.exact=!0),this.queries.find(t=>g(s,t))}findAll(t,e){let[s]=m(t,e);return Object.keys(s).length>0?this.queries.filter(t=>g(s,t)):this.queries}notify(t){B.batch(()=>{this.listeners.forEach(({listener:e})=>{e(t)})})}onFocus(){B.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){B.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class W extends N{constructor(t){super(),this.defaultOptions=t.defaultOptions,this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||_,this.observers=[],this.state=t.state||J(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(e=>e!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,e;return null!=(t=null==(e=this.retryer)?void 0:e.continue())?t:this.execute()}async execute(){var t,e,s,r,i,n,u,a,o,l,h,c,d,f,p,y,v,m,b,g;let O=()=>{var t;return this.retryer=H({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(t,e)=>{this.dispatch({type:"failed",failureCount:t,error:e})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(t=this.options.retry)?t:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},C="loading"===this.state.status;try{if(!C){this.dispatch({type:"loading",variables:this.options.variables}),await (null==(o=(l=this.mutationCache.config).onMutate)?void 0:o.call(l,this.state.variables,this));let t=await (null==(h=(c=this.options).onMutate)?void 0:h.call(c,this.state.variables));t!==this.state.context&&this.dispatch({type:"loading",context:t,variables:this.state.variables})}let d=await O();return await (null==(t=(e=this.mutationCache.config).onSuccess)?void 0:t.call(e,d,this.state.variables,this.state.context,this)),await (null==(s=(r=this.options).onSuccess)?void 0:s.call(r,d,this.state.variables,this.state.context)),await (null==(i=(n=this.mutationCache.config).onSettled)?void 0:i.call(n,d,null,this.state.variables,this.state.context,this)),await (null==(u=(a=this.options).onSettled)?void 0:u.call(a,d,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:d}),d}catch(t){try{throw await (null==(d=(f=this.mutationCache.config).onError)?void 0:d.call(f,t,this.state.variables,this.state.context,this)),await (null==(p=(y=this.options).onError)?void 0:p.call(y,t,this.state.variables,this.state.context)),await (null==(v=(m=this.mutationCache.config).onSettled)?void 0:v.call(m,void 0,t,this.state.variables,this.state.context,this)),await (null==(b=(g=this.options).onSettled)?void 0:b.call(g,void 0,t,this.state.variables,this.state.context)),t}finally{this.dispatch({type:"error",error:t})}}}dispatch(t){let e=e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"loading":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!k(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...e,...t.state}}};this.state=e(this.state),B.batch(()=>{this.observers.forEach(e=>{e.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function J(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class V extends l{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,e,s){let r=new W({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(e),state:s,defaultOptions:e.mutationKey?t.getMutationDefaults(e.mutationKey):void 0});return this.add(r),r}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(e=>e!==t),this.notify({type:"removed",mutation:t})}clear(){B.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return void 0===t.exact&&(t.exact=!0),this.mutations.find(e=>O(t,e))}findAll(t){return this.mutations.filter(e=>O(t,e))}notify(t){B.batch(()=>{this.listeners.forEach(({listener:e})=>{e(t)})})}resumePausedMutations(){var t;return this.resuming=(null!=(t=this.resuming)?t:Promise.resolve()).then(()=>{let t=this.mutations.filter(t=>t.state.isPaused);return B.batch(()=>t.reduce((t,e)=>t.then(()=>e.continue().catch(c)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function X(){return{onFetch:t=>{t.fetchFn=()=>{var e,s,r,i,n,u;let a,o=null==(e=t.fetchOptions)||null==(s=e.meta)?void 0:s.refetchPage,l=null==(r=t.fetchOptions)||null==(i=r.meta)?void 0:i.fetchMore,h=null==l?void 0:l.pageParam,c=(null==l?void 0:l.direction)==="forward",d=(null==l?void 0:l.direction)==="backward",f=(null==(n=t.state.data)?void 0:n.pages)||[],p=(null==(u=t.state.data)?void 0:u.pageParams)||[],y=p,v=!1,m=t.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+t.options.queryHash+"'")),b=(t,e,s,r)=>(y=r?[e,...y]:[...y,e],r?[s,...t]:[...t,s]),g=(e,s,r,i)=>{if(v)return Promise.reject("Cancelled");if(void 0===r&&!s&&e.length)return Promise.resolve(e);let n={queryKey:t.queryKey,pageParam:r,meta:t.options.meta};return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>{var e,s;return null!=(e=t.signal)&&e.aborted?v=!0:null==(s=t.signal)||s.addEventListener("abort",()=>{v=!0}),t.signal}}),Promise.resolve(m(n)).then(t=>b(e,r,t,i))};if(f.length)if(c){let e=void 0!==h,s=e?h:Y(t.options,f);a=g(f,e,s)}else if(d){let e=void 0!==h,s=e?h:Z(t.options,f);a=g(f,e,s,!0)}else{y=[];let e=void 0===t.options.getNextPageParam;a=!o||!f[0]||o(f[0],0,f)?g([],e,p[0]):Promise.resolve(b([],p[0],f[0]));for(let s=1;s<f.length;s++)a=a.then(r=>{if(!o||!f[s]||o(f[s],s,f)){let i=e?p[s]:Y(t.options,r);return g(r,e,i)}return Promise.resolve(b(r,p[s],f[s]))})}else a=g([]);return a.then(t=>({pages:t,pageParams:y}))}}}}function Y(t,e){return null==t.getNextPageParam?void 0:t.getNextPageParam(e[e.length-1],e)}function Z(t,e){return null==t.getPreviousPageParam?void 0:t.getPreviousPageParam(e[0],e)}class ${constructor(t={}){this.queryCache=t.queryCache||new z,this.mutationCache=t.mutationCache||new V,this.logger=t.logger||_,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,1===this.mountCount&&(this.unsubscribeFocus=I.subscribe(()=>{I.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=T.subscribe(()=>{T.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,e;this.mountCount--,0===this.mountCount&&(null==(t=this.unsubscribeFocus)||t.call(this),this.unsubscribeFocus=void 0,null==(e=this.unsubscribeOnline)||e.call(this),this.unsubscribeOnline=void 0)}isFetching(t,e){let[s]=m(t,e);return s.fetchStatus="fetching",this.queryCache.findAll(s).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,e){var s;return null==(s=this.queryCache.find(t,e))?void 0:s.state.data}ensureQueryData(t,e,s){let r=y(t,e,s),i=this.getQueryData(r.queryKey);return i?Promise.resolve(i):this.fetchQuery(r)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){let r=this.queryCache.find(t),i=null==r?void 0:r.state.data,n="function"==typeof e?e(i):e;if(void 0===n)return;let u=y(t),a=this.defaultQueryOptions(u);return this.queryCache.build(this,a).setData(n,{...s,manual:!0})}setQueriesData(t,e,s){return B.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t,e){var s;return null==(s=this.queryCache.find(t,e))?void 0:s.state}removeQueries(t,e){let[s]=m(t,e),r=this.queryCache;B.batch(()=>{r.findAll(s).forEach(t=>{r.remove(t)})})}resetQueries(t,e,s){let[r,i]=m(t,e,s),n=this.queryCache,u={type:"active",...r};return B.batch(()=>(n.findAll(r).forEach(t=>{t.reset()}),this.refetchQueries(u,i)))}cancelQueries(t,e,s){let[r,i={}]=m(t,e,s);return void 0===i.revert&&(i.revert=!0),Promise.all(B.batch(()=>this.queryCache.findAll(r).map(t=>t.cancel(i)))).then(c).catch(c)}invalidateQueries(t,e,s){let[r,i]=m(t,e,s);return B.batch(()=>{var t,e;if(this.queryCache.findAll(r).forEach(t=>{t.invalidate()}),"none"===r.refetchType)return Promise.resolve();let s={...r,type:null!=(t=null!=(e=r.refetchType)?e:r.type)?t:"active"};return this.refetchQueries(s,i)})}refetchQueries(t,e,s){let[r,i]=m(t,e,s),n=Promise.all(B.batch(()=>this.queryCache.findAll(r).filter(t=>!t.isDisabled()).map(t=>{var e;return t.fetch(void 0,{...i,cancelRefetch:null==(e=null==i?void 0:i.cancelRefetch)||e,meta:{refetchPage:r.refetchPage}})}))).then(c);return null!=i&&i.throwOnError||(n=n.catch(c)),n}fetchQuery(t,e,s){let r=y(t,e,s),i=this.defaultQueryOptions(r);void 0===i.retry&&(i.retry=!1);let n=this.queryCache.build(this,i);return n.isStaleByTime(i.staleTime)?n.fetch(i):Promise.resolve(n.state.data)}prefetchQuery(t,e,s){return this.fetchQuery(t,e,s).then(c).catch(c)}fetchInfiniteQuery(t,e,s){let r=y(t,e,s);return r.behavior=X(),this.fetchQuery(r)}prefetchInfiniteQuery(t,e,s){return this.fetchInfiniteQuery(t,e,s).then(c).catch(c)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,e){let s=this.queryDefaults.find(e=>R(t)===R(e.queryKey));s?s.defaultOptions=e:this.queryDefaults.push({queryKey:t,defaultOptions:e})}getQueryDefaults(t){if(!t)return;let e=this.queryDefaults.find(e=>S(t,e.queryKey));return null==e?void 0:e.defaultOptions}setMutationDefaults(t,e){let s=this.mutationDefaults.find(e=>R(t)===R(e.mutationKey));s?s.defaultOptions=e:this.mutationDefaults.push({mutationKey:t,defaultOptions:e})}getMutationDefaults(t){if(!t)return;let e=this.mutationDefaults.find(e=>S(t,e.mutationKey));return null==e?void 0:e.defaultOptions}defaultQueryOptions(t){if(null!=t&&t._defaulted)return t;let e={...this.defaultOptions.queries,...this.getQueryDefaults(null==t?void 0:t.queryKey),...t,_defaulted:!0};return!e.queryHash&&e.queryKey&&(e.queryHash=C(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.useErrorBoundary&&(e.useErrorBoundary=!!e.suspense),e}defaultMutationOptions(t){return null!=t&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(null==t?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class tt extends l{constructor(t,e){super(),this.client=t,this.options=e,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(e)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.currentQuery.addObserver(this),te(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ts(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ts(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,e){let s=this.options,r=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),E(s,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=s.queryKey),this.updateQuery();let i=this.hasListeners();i&&tr(this.currentQuery,r,this.options,s)&&this.executeFetch(),this.updateResult(e),i&&(this.currentQuery!==r||this.options.enabled!==s.enabled||this.options.staleTime!==s.staleTime)&&this.updateStaleTimeout();let n=this.computeRefetchInterval();i&&(this.currentQuery!==r||this.options.enabled!==s.enabled||n!==this.currentRefetchInterval)&&this.updateRefetchInterval(n)}getOptimisticResult(t){var e,s,r;let i=this.client.getQueryCache().build(this.client,t),n=this.createResult(i,t);return e=this,s=n,(r=t).keepPreviousData||(void 0!==r.placeholderData?!s.isPlaceholderData:E(e.getCurrentResult(),s))||(this.currentResult=n,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),n}getCurrentResult(){return this.currentResult}trackResult(t){let e={};return Object.keys(t).forEach(s=>{Object.defineProperty(e,s,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(s),t[s])})}),e}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...e}={}){return this.fetch({...e,meta:{refetchPage:t}})}fetchOptimistic(t){let e=this.client.defaultQueryOptions(t),s=this.client.getQueryCache().build(this.client,e);return s.isFetchingOptimistic=!0,s.fetch().then(()=>this.createResult(s,e))}fetch(t){var e;return this.executeFetch({...t,cancelRefetch:null==(e=t.cancelRefetch)||e}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let e=this.currentQuery.fetch(this.options,t);return null!=t&&t.throwOnError||(e=e.catch(c)),e}updateStaleTimeout(){if(this.clearStaleTimeout(),h||this.currentResult.isStale||!d(this.options.staleTime))return;let t=p(this.currentResult.dataUpdatedAt,this.options.staleTime);this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},t+1)}computeRefetchInterval(){var t;return"function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.currentResult.data,this.currentQuery):null!=(t=this.options.refetchInterval)&&t}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!h&&!1!==this.options.enabled&&d(this.currentRefetchInterval)&&0!==this.currentRefetchInterval&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||I.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,e){let s,r=this.currentQuery,i=this.options,n=this.currentResult,u=this.currentResultState,a=this.currentResultOptions,o=t!==r,l=o?t.state:this.currentQueryInitialState,h=o?this.currentResult:this.previousQueryResult,{state:c}=t,{dataUpdatedAt:d,error:f,errorUpdatedAt:p,fetchStatus:y,status:v}=c,m=!1,b=!1;if(e._optimisticResults){let s=this.hasListeners(),n=!s&&te(t,e),u=s&&tr(t,r,e,i);(n||u)&&(y=k(t.options.networkMode)?"fetching":"paused",d||(v="loading")),"isRestoring"===e._optimisticResults&&(y="idle")}if(e.keepPreviousData&&!c.dataUpdatedAt&&null!=h&&h.isSuccess&&"error"!==v)s=h.data,d=h.dataUpdatedAt,v=h.status,m=!0;else if(e.select&&void 0!==c.data)if(n&&c.data===(null==u?void 0:u.data)&&e.select===this.selectFn)s=this.selectResult;else try{this.selectFn=e.select,s=e.select(c.data),s=A(null==n?void 0:n.data,s,e),this.selectResult=s,this.selectError=null}catch(t){this.selectError=t}else s=c.data;if(void 0!==e.placeholderData&&void 0===s&&"loading"===v){let t;if(null!=n&&n.isPlaceholderData&&e.placeholderData===(null==a?void 0:a.placeholderData))t=n.data;else if(t="function"==typeof e.placeholderData?e.placeholderData():e.placeholderData,e.select&&void 0!==t)try{t=e.select(t),this.selectError=null}catch(t){this.selectError=t}void 0!==t&&(v="success",s=A(null==n?void 0:n.data,t,e),b=!0)}this.selectError&&(f=this.selectError,s=this.selectResult,p=Date.now(),v="error");let g="fetching"===y,O="loading"===v,C="error"===v;return{status:v,fetchStatus:y,isLoading:O,isSuccess:"success"===v,isError:C,isInitialLoading:O&&g,data:s,dataUpdatedAt:d,error:f,errorUpdatedAt:p,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:g,isRefetching:g&&!O,isLoadingError:C&&0===c.dataUpdatedAt,isPaused:"paused"===y,isPlaceholderData:b,isPreviousData:m,isRefetchError:C&&0!==c.dataUpdatedAt,isStale:ti(t,e),refetch:this.refetch,remove:this.remove}}updateResult(t){let e=this.currentResult,s=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,E(s,e))return;this.currentResult=s;let r={cache:!0},i=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.trackedProps.size)return!0;let r=new Set(null!=s?s:this.trackedProps);return this.options.useErrorBoundary&&r.add("error"),Object.keys(this.currentResult).some(t=>this.currentResult[t]!==e[t]&&r.has(t))};(null==t?void 0:t.listeners)!==!1&&i()&&(r.listeners=!0),this.notify({...r,...t})}updateQuery(){let t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;let e=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(null==e||e.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){let e={};"success"===t.type?e.onSuccess=!t.manual:"error"!==t.type||j(t.error)||(e.onError=!0),this.updateResult(e),this.hasListeners()&&this.updateTimers()}notify(t){B.batch(()=>{var e,s,r,i,n,u,a,o;t.onSuccess?(null==(e=(s=this.options).onSuccess)||e.call(s,this.currentResult.data),null==(r=(i=this.options).onSettled)||r.call(i,this.currentResult.data,null)):t.onError&&(null==(n=(u=this.options).onError)||n.call(u,this.currentResult.error),null==(a=(o=this.options).onSettled)||a.call(o,void 0,this.currentResult.error)),t.listeners&&this.listeners.forEach(({listener:t})=>{t(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function te(t,e){return!1!==e.enabled&&!t.state.dataUpdatedAt&&("error"!==t.state.status||!1!==e.retryOnMount)||t.state.dataUpdatedAt>0&&ts(t,e,e.refetchOnMount)}function ts(t,e,s){if(!1!==e.enabled){let r="function"==typeof s?s(t):s;return"always"===r||!1!==r&&ti(t,e)}return!1}function tr(t,e,s,r){return!1!==s.enabled&&(t!==e||!1===r.enabled)&&(!s.suspense||"error"!==t.state.status)&&ti(t,s)}function ti(t,e){return t.isStaleByTime(e.staleTime)}class tn extends l{constructor(t,e){super(),this.client=t,this.queries=[],this.result=[],this.observers=[],this.observersMap={},e&&this.setQueries(e)}onSubscribe(){1===this.listeners.size&&this.observers.forEach(t=>{t.subscribe(e=>{this.onUpdate(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.observers.forEach(t=>{t.destroy()})}setQueries(t,e){this.queries=t,B.batch(()=>{let t=this.observers,s=this.findMatchingObservers(this.queries);s.forEach(t=>t.observer.setOptions(t.defaultedQueryOptions,e));let r=s.map(t=>t.observer),i=Object.fromEntries(r.map(t=>[t.options.queryHash,t])),n=r.map(t=>t.getCurrentResult()),u=r.some((e,s)=>e!==t[s]);t.length===r.length&&!u||(this.observers=r,this.observersMap=i,this.result=n,this.hasListeners()&&(f(t,r).forEach(t=>{t.destroy()}),f(r,t).forEach(t=>{t.subscribe(e=>{this.onUpdate(t,e)})}),this.notify()))})}getCurrentResult(){return this.result}getQueries(){return this.observers.map(t=>t.getCurrentQuery())}getObservers(){return this.observers}getOptimisticResult(t){return this.findMatchingObservers(t).map(t=>t.observer.getOptimisticResult(t.defaultedQueryOptions))}findMatchingObservers(t){let e=this.observers,s=new Map(e.map(t=>[t.options.queryHash,t])),r=t.map(t=>this.client.defaultQueryOptions(t)),i=r.flatMap(t=>{let e=s.get(t.queryHash);return null!=e?[{defaultedQueryOptions:t,observer:e}]:[]}),n=new Set(i.map(t=>t.defaultedQueryOptions.queryHash)),u=r.filter(t=>!n.has(t.queryHash)),a=new Set(i.map(t=>t.observer)),o=e.filter(t=>!a.has(t)),l=t=>{let e=this.client.defaultQueryOptions(t),s=this.observersMap[e.queryHash];return null!=s?s:new tt(this.client,e)},h=u.map((t,e)=>{if(t.keepPreviousData){let s=o[e];if(void 0!==s)return{defaultedQueryOptions:t,observer:s}}return{defaultedQueryOptions:t,observer:l(t)}});return i.concat(h).sort((t,e)=>r.indexOf(t.defaultedQueryOptions)-r.indexOf(e.defaultedQueryOptions))}onUpdate(t,e){let s=this.observers.indexOf(t);if(-1!==s){var r;let t;this.result=(r=this.result,(t=r.slice(0))[s]=e,t),this.notify()}}notify(){B.batch(()=>{this.listeners.forEach(({listener:t})=>{t(this.result)})})}}class tu extends tt{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t,e){super.setOptions({...t,behavior:X()},e)}getOptimisticResult(t){return t.behavior=X(),super.getOptimisticResult(t)}fetchNextPage({pageParam:t,...e}={}){return this.fetch({...e,meta:{fetchMore:{direction:"forward",pageParam:t}}})}fetchPreviousPage({pageParam:t,...e}={}){return this.fetch({...e,meta:{fetchMore:{direction:"backward",pageParam:t}}})}createResult(t,e){var s,r,i,n,u,a;let{state:o}=t,l=super.createResult(t,e),{isFetching:h,isRefetching:c}=l,d=h&&(null==(s=o.fetchMeta)||null==(r=s.fetchMore)?void 0:r.direction)==="forward",f=h&&(null==(i=o.fetchMeta)||null==(n=i.fetchMore)?void 0:n.direction)==="backward";return{...l,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:function(t,e){if(t.getNextPageParam&&Array.isArray(e)){let s=Y(t,e);return null!=s&&!1!==s}}(e,null==(u=o.data)?void 0:u.pages),hasPreviousPage:function(t,e){if(t.getPreviousPageParam&&Array.isArray(e)){let s=Z(t,e);return null!=s&&!1!==s}}(e,null==(a=o.data)?void 0:a.pages),isFetchingNextPage:d,isFetchingPreviousPage:f,isRefetching:c&&!d&&!f}}}class ta extends l{constructor(t,e){super(),this.client=t,this.setOptions(e),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var e;let s=this.options;this.options=this.client.defaultMutationOptions(t),E(s,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),null==(e=this.currentMutation)||e.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var t;null==(t=this.currentMutation)||t.removeObserver(this)}}onMutationUpdate(t){this.updateResult();let e={listeners:!0};"success"===t.type?e.onSuccess=!0:"error"===t.type&&(e.onError=!0),this.notify(e)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,e){return this.mutateOptions=e,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==t?t:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let t=this.currentMutation?this.currentMutation.state:J(),e="loading"===t.status,s={...t,isLoading:e,isPending:e,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset};this.currentResult=s}notify(t){B.batch(()=>{if(this.mutateOptions&&this.hasListeners()){var e,s,r,i,n,u,a,o;t.onSuccess?(null==(e=(s=this.mutateOptions).onSuccess)||e.call(s,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(r=(i=this.mutateOptions).onSettled)||r.call(i,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):t.onError&&(null==(n=(u=this.mutateOptions).onError)||n.call(u,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(a=(o=this.mutateOptions).onSettled)||a.call(o,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}t.listeners&&this.listeners.forEach(({listener:t})=>{t(this.currentResult)})})}}function to(t){return t.state.isPaused}function tl(t){return"success"===t.state.status}function th(t,e={}){let s=[],r=[];if(!1!==e.dehydrateMutations){let r=e.shouldDehydrateMutation||to;t.getMutationCache().getAll().forEach(t=>{r(t)&&s.push({mutationKey:t.options.mutationKey,state:t.state})})}if(!1!==e.dehydrateQueries){let s=e.shouldDehydrateQuery||tl;t.getQueryCache().getAll().forEach(t=>{s(t)&&r.push({state:t.state,queryKey:t.queryKey,queryHash:t.queryHash})})}return{mutations:s,queries:r}}function tc(t,e,s){if("object"!=typeof e||null===e)return;let r=t.getMutationCache(),i=t.getQueryCache(),n=e.mutations||[],u=e.queries||[];n.forEach(e=>{var i;r.build(t,{...null==s||null==(i=s.defaultOptions)?void 0:i.mutations,mutationKey:e.mutationKey},e.state)}),u.forEach(({queryKey:e,state:r,queryHash:n})=>{var u;let a=i.get(n);if(a){if(a.state.dataUpdatedAt<r.dataUpdatedAt){let{fetchStatus:t,...e}=r;a.setState(e)}return}i.build(t,{...null==s||null==(u=s.defaultOptions)?void 0:u.queries,queryKey:e,queryHash:n},{...r,fetchStatus:"idle"})})}var td=s(70451);let tf=s(43676).useSyncExternalStore,tp=td.createContext(void 0),ty=td.createContext(!1);function tv(t,e){return t||(e&&"u">typeof window?(window.ReactQueryClientContext||(window.ReactQueryClientContext=tp),window.ReactQueryClientContext):tp)}let tm=({context:t}={})=>{let e=td.useContext(tv(t,td.useContext(ty)));if(!e)throw Error("No QueryClient set, use QueryClientProvider to set one");return e},tb=({client:t,children:e,context:s,contextSharing:r=!1})=>{td.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]);let i=tv(s,r);return td.createElement(ty.Provider,{value:!s&&r},td.createElement(i.Provider,{value:t},e))},tg=td.createContext(!1),tO=()=>td.useContext(tg),tC=tg.Provider;function tR(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}let tS=td.createContext(tR()),tQ=()=>td.useContext(tS),tE=({children:t})=>{let[e]=td.useState(()=>tR());return td.createElement(tS.Provider,{value:e},"function"==typeof t?t(e):t)};function tq(t,e){return"function"==typeof t?t(...e):!!t}let tw=(t,e)=>{(t.suspense||t.useErrorBoundary)&&!e.isReset()&&(t.retryOnMount=!1)},tP=t=>{td.useEffect(()=>{t.clearReset()},[t])},tM=({result:t,errorResetBoundary:e,useErrorBoundary:s,query:r})=>t.isError&&!e.isReset()&&!t.isFetching&&tq(s,[t.error,r]),tx=t=>{t.suspense&&("number"!=typeof t.staleTime&&(t.staleTime=1e3),"number"==typeof t.cacheTime&&(t.cacheTime=Math.max(t.cacheTime,1e3)))},tF=(t,e)=>t.isLoading&&t.isFetching&&!e,tD=(t,e,s)=>(null==t?void 0:t.suspense)&&tF(e,s),tA=(t,e,s)=>e.fetchOptimistic(t).then(({data:e})=>{null==t.onSuccess||t.onSuccess(e),null==t.onSettled||t.onSettled(e,null)}).catch(e=>{s.clearReset(),null==t.onError||t.onError(e),null==t.onSettled||t.onSettled(void 0,e)});function tI({queries:t,context:e}){let s=tm({context:e}),r=tO(),i=tQ(),n=td.useMemo(()=>t.map(t=>{let e=s.defaultQueryOptions(t);return e._optimisticResults=r?"isRestoring":"optimistic",e}),[t,s,r]);n.forEach(t=>{tx(t),tw(t,i)}),tP(i);let[u]=td.useState(()=>new tn(s,n)),a=u.getOptimisticResult(n);tf(td.useCallback(t=>r?()=>void 0:u.subscribe(B.batchCalls(t)),[u,r]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),td.useEffect(()=>{u.setQueries(n,{listeners:!1})},[n,u]);let o=a.some((t,e)=>tD(n[e],t,r))?a.flatMap((t,e)=>{let s=n[e],a=u.getObservers()[e];if(s&&a)if(tD(s,t,r))return tA(s,a,i);else tF(t,r)&&tA(s,a,i);return[]}):[];if(o.length>0)throw Promise.all(o);let l=u.getQueries(),h=a.find((t,e)=>{var s,r;return tM({result:t,errorResetBoundary:i,useErrorBoundary:null!=(s=null==(r=n[e])?void 0:r.useErrorBoundary)&&s,query:l[e]})});if(null!=h&&h.error)throw h.error;return a}function tU(t,e){let s=tm({context:t.context}),r=tO(),i=tQ(),n=s.defaultQueryOptions(t);n._optimisticResults=r?"isRestoring":"optimistic",n.onError&&(n.onError=B.batchCalls(n.onError)),n.onSuccess&&(n.onSuccess=B.batchCalls(n.onSuccess)),n.onSettled&&(n.onSettled=B.batchCalls(n.onSettled)),tx(n),tw(n,i),tP(i);let[u]=td.useState(()=>new e(s,n)),a=u.getOptimisticResult(n);if(tf(td.useCallback(t=>{let e=r?()=>void 0:u.subscribe(B.batchCalls(t));return u.updateResult(),e},[u,r]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),td.useEffect(()=>{u.setOptions(n,{listeners:!1})},[n,u]),tD(n,a,r))throw tA(n,u,i);if(tM({result:a,errorResetBoundary:i,useErrorBoundary:n.useErrorBoundary,query:u.getCurrentQuery()}))throw a.error;return n.notifyOnChangeProps?a:u.trackResult(a)}function tT(t,e,s){return tU(y(t,e,s),tt)}function tK(t){return tU({...t,enabled:!0,useErrorBoundary:!0,suspense:!0,placeholderData:void 0,networkMode:"always",onSuccess:void 0,onError:void 0,onSettled:void 0},tt)}function tk(t){return tU({...t,enabled:!0,suspense:!0,useErrorBoundary:!0,networkMode:"always"},tu)}function tL({queries:t,context:e}){return tI({queries:t.map(t=>({...t,enabled:!0,useErrorBoundary:!0,suspense:!0,placeholderData:void 0,networkMode:"always"})),context:e})}function tj(t){return t}function tH(t){return t}function t_(t,e={}){let s=tm({context:e.context}),r=td.useRef(e);r.current=e,td.useMemo(()=>{t&&tc(s,t,r.current)},[s,t])}let tB=({children:t,options:e,state:s})=>(t_(s,e),t);function tN(t,e,s){let[r,i={}]=m(t,e,s),n=tm({context:i.context}),u=n.getQueryCache();return tf(td.useCallback(t=>u.subscribe(B.batchCalls(t)),[u]),()=>n.isFetching(r),()=>n.isFetching(r))}function tG(t,e,s){let[r,i={}]=b(t,e,s),n=tm({context:i.context}),u=n.getMutationCache();return tf(td.useCallback(t=>u.subscribe(B.batchCalls(t)),[u]),()=>n.isMutating(r),()=>n.isMutating(r))}function tz(t){return t}function tW(t,e,s){let r=v(t,e,s),i=tm({context:r.context}),[n]=td.useState(()=>new ta(i,r));td.useEffect(()=>{n.setOptions(r)},[n,r]);let u=tf(td.useCallback(t=>n.subscribe(B.batchCalls(t)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),a=td.useCallback((t,e)=>{n.mutate(t,e).catch(tJ)},[n]);if(u.error&&tq(n.options.useErrorBoundary,[u.error]))throw u.error;return{...u,mutate:a,mutateAsync:u.mutate}}function tJ(){}function tV(t,e,s){return tU(y(t,e,s),tu)}function tX(t){let e=tm();e.getQueryState(t.queryKey)||e.prefetchQuery(t)}function tY(t){let e=tm();e.getQueryState(t.queryKey)||e.prefetchInfiniteQuery(t)}}}]);
@@ -1 +1 @@
1
- "use strict";(self.chunk_AlertManager_0_2_0_beta_2=self.chunk_AlertManager_0_2_0_beta_2||[]).push([["7978"],{61153(e,t,n){n.r(t),n.d(t,{getTimezoneOffset:()=>Q,toDate:()=>A,toZonedTime:()=>J,format:()=>B,formatInTimeZone:()=>K,fromZonedTime:()=>L});var r=n(96962),a=n(31829);function i(e,t,n){var r,i,u,l,o;let c,s,f=(0,a.getDefaultOptions)(),d=(r=e,i=n.timeZone,u=n.locale??f.locale,new Intl.DateTimeFormat(u?[u.code,"en-US"]:void 0,{timeZone:i,timeZoneName:r}));return"formatToParts"in d?function(e,t){let n=e.formatToParts(t);for(let e=n.length-1;e>=0;--e)if("timeZoneName"===n[e].type)return n[e].value}(d,t):(l=d,o=t,c=l.format(o).replace(/\u200E/g,""),(s=/ [\w-+ ]+$/.exec(c))?s[0].substr(1):"")}let u={year:0,month:1,day:2,hour:3,minute:4,second:5},l={},o=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),c="06/25/2014, 00:00:00"===o||"‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00"===o;function s(e,t,n,r,a,i,u){let l=new Date(0);return l.setUTCFullYear(e,t,n),l.setUTCHours(r,a,i,u),l}let f=/^(Z)$/,d=/^([+-]\d{2})$/,g=/^([+-])(\d{2}):?(\d{2})$/;function m(e,t,n){let r,a;if(!e)return 0;let i=f.exec(e);if(i)return 0;if(i=d.exec(e))return h(r=parseInt(i[1],10))?-(36e5*r):NaN;if(i=g.exec(e)){r=parseInt(i[2],10);let e=parseInt(i[3],10);return h(r,e)?(a=36e5*Math.abs(r)+6e4*e,"+"===i[1]?-a:a):NaN}if(function(e){if(N[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),N[e]=!0,!0}catch(e){return!1}}(e)){var u;t=new Date(t||Date.now());let r=D(n?t:s((u=t).getFullYear(),u.getMonth(),u.getDate(),u.getHours(),u.getMinutes(),u.getSeconds(),u.getMilliseconds()),e);return-(n?r:function(e,t,n){let r=e.getTime()-t,a=D(new Date(r),n);if(t===a)return t;let i=D(new Date(r-=a-t),n);return a===i?a:Math.max(a,i)}(t,r,e))}return NaN}function D(e,t){var n,r,a;let i,o,f,d=(l[n=t]||(l[n]=c?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),"formatToParts"in(f=l[n])?function(e,t){try{let n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){let t=u[n[e].type];void 0!==t&&(r[t]=parseInt(n[e].value,10))}return r}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(f,e):(r=f,a=e,i=r.format(a),[parseInt((o=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(i))[3],10),parseInt(o[1],10),parseInt(o[2],10),parseInt(o[4],10),parseInt(o[5],10),parseInt(o[6],10)])),g=s(d[0],d[1]-1,d[2],d[3]%24,d[4],d[5],0).getTime(),m=e.getTime(),D=m%1e3;return g-(m-=D>=0?D:1e3+D)}function h(e,t){return -23<=e&&e<=23&&(null==t||0<=t&&t<=59)}let N={},p={X:function(e,t,n){let r=w(n.timeZone,e);if(0===r)return"Z";switch(t){case"X":return I(r);case"XXXX":case"XX":return x(r);default:return x(r,":")}},x:function(e,t,n){let r=w(n.timeZone,e);switch(t){case"x":return I(r);case"xxxx":case"xx":return x(r);default:return x(r,":")}},O:function(e,t,n){let r=w(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t=""){let n=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),i=r%60;return 0===i?n+String(a):n+String(a)+t+T(i,2)}(r,":");default:return"GMT"+x(r,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return i("short",e,n);default:return i("long",e,n)}}};function w(e,t){let n=e?m(e,t,!0)/6e4:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw RangeError("Invalid time zone specified: "+e);return n}function T(e,t){let n=Math.abs(e).toString();for(;n.length<t;)n="0"+n;return(e<0?"-":"")+n}function x(e,t=""){let n=Math.abs(e);return(e>0?"-":"+")+T(Math.floor(n/60),2)+t+T(Math.floor(n%60),2)}function I(e,t){return e%60==0?(e>0?"-":"+")+T(Math.abs(e)/60,2):x(e,t)}function Z(e){let t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e-t}let y=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,M=/^([0-9W+-]+)(T| )(.*)/,U=/^([0-9W+-]+)(.*)/,b=/^(\d{2})$/,C=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],F=/^(\d{4})/,S=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],$=/^-(\d{2})$/,O=/^-?(\d{3})$/,_=/^-?(\d{2})-?(\d{2})$/,z=/^-?W(\d{2})$/,Y=/^-?W(\d{2})-?(\d{1})$/,v=/^(\d{2}([.,]\d*)?)$/,X=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,j=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/;function A(e,t={}){if(arguments.length<1)throw TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);let n=null==t.additionalDigits?2:Number(t.additionalDigits);if(2!==n&&1!==n&&0!==n)throw RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);let r=function(e){let t,n={},r=M.exec(e);if(r?(n.date=r[1],t=r[3]):(r=U.exec(e))?(n.date=r[1],t=r[2]):(n.date=null,t=e),t){let e=y.exec(t);e?(n.time=t.replace(e[1],""),n.timeZone=e[1].trim()):n.time=t}return n}(e),{year:a,restDateString:i}=function(e,t){if(e){let n=C[t],r=S[t],a=F.exec(e)||r.exec(e);if(a){let t=a[1];return{year:parseInt(t,10),restDateString:e.slice(t.length)}}if(a=b.exec(e)||n.exec(e)){let t=a[1];return{year:100*parseInt(t,10),restDateString:e.slice(t.length)}}}return{year:null}}(r.date,n),u=function(e,t){let n,r,a;if(null===t)return null;if(!e||!e.length)return(n=new Date(0)).setUTCFullYear(t),n;let i=$.exec(e);if(i)return(n=new Date(0),k(t,r=parseInt(i[1],10)-1))?(n.setUTCFullYear(t,r),n):new Date(NaN);if(i=O.exec(e)){n=new Date(0);let e=parseInt(i[1],10);return!function(e,t){if(t<1)return!1;let n=W(e);return(!n||!(t>366))&&(!!n||!(t>365))}(t,e)?new Date(NaN):(n.setUTCFullYear(t,0,e),n)}if(i=_.exec(e)){n=new Date(0),r=parseInt(i[1],10)-1;let e=parseInt(i[2],10);return k(t,r,e)?(n.setUTCFullYear(t,r,e),n):new Date(NaN)}if(i=z.exec(e))return G(a=parseInt(i[1],10)-1)?H(t,a):new Date(NaN);if(i=Y.exec(e)){a=parseInt(i[1],10)-1;let e=parseInt(i[2],10)-1;return G(a,e)?H(t,a,e):new Date(NaN)}return null}(i,a);if(null===u||isNaN(u.getTime())||!u)return new Date(NaN);{let e,n=u.getTime(),a=0;if(r.time&&(null===(a=function(e){let t,n,r=v.exec(e);if(r)return R(t=parseFloat(r[1].replace(",",".")))?t%24*36e5:NaN;if(r=X.exec(e))return R(t=parseInt(r[1],10),n=parseFloat(r[2].replace(",",".")))?t%24*36e5+6e4*n:NaN;if(r=j.exec(e)){t=parseInt(r[1],10),n=parseInt(r[2],10);let e=parseFloat(r[3].replace(",","."));return R(t,n,e)?t%24*36e5+6e4*n+1e3*e:NaN}return null}(r.time))||isNaN(a)))return new Date(NaN);if(r.timeZone||t.timeZone){if(isNaN(e=m(r.timeZone||t.timeZone,new Date(n+a))))return new Date(NaN)}else e=Z(new Date(n+a)),e=Z(new Date(n+a+e));return new Date(n+a+e)}}function H(e,t,n){t=t||0,n=n||0;let r=new Date(0);r.setUTCFullYear(e,0,4);let a=7*t+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+a),r}let E=[31,28,31,30,31,30,31,31,30,31,30,31],P=[31,29,31,30,31,30,31,31,30,31,30,31];function W(e){return e%400==0||e%4==0&&e%100!=0}function k(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;let r=W(e);if(r&&n>P[t]||!r&&n>E[t])return!1}return!0}function G(e,t){return!(e<0)&&!(e>52)&&(null==t||!(t<0)&&!(t>6))}function R(e,t,n){return!(e<0)&&!(e>=25)&&(null==t||!(t<0)&&!(t>=60))&&(null==n||!(n<0)&&!(n>=60))}let q=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function B(e,t,n={}){let a=(t=String(t)).match(q);if(a){let r=A(n.originalDate||e,n);t=a.reduce(function(e,t){if("'"===t[0])return e;let a=e.indexOf(t),i="'"===e[a-1],u=e.replace(t,"'"+p[t[0]](r,t,n)+"'");return i?u.substring(0,a-1)+u.substring(a+1):u},t)}return(0,r.GP)(e,t,n)}function J(e,t,n){let r=m(t,e=A(e,n),!0),a=new Date(e.getTime()-r),i=new Date(0);return i.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),i.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),i}function K(e,t,n,r){return r={...r,timeZone:t,originalDate:e},B(J(e,t,{timeZone:r.timeZone}),n,r)}function L(e,t,n){if("string"==typeof e&&!e.match(y))return A(e,{...n,timeZone:t});let r=s((e=A(e,n)).getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),a=m(t,new Date(r));return new Date(r+a)}function Q(e,t){return-m(e,t)}}}]);
1
+ "use strict";(self.chunk_AlertManager_0_2_0_beta_3=self.chunk_AlertManager_0_2_0_beta_3||[]).push([["7978"],{61153(e,t,n){n.r(t),n.d(t,{getTimezoneOffset:()=>Q,toDate:()=>A,toZonedTime:()=>J,format:()=>B,formatInTimeZone:()=>K,fromZonedTime:()=>L});var r=n(96962),a=n(31829);function i(e,t,n){var r,i,u,l,o;let c,s,f=(0,a.getDefaultOptions)(),d=(r=e,i=n.timeZone,u=n.locale??f.locale,new Intl.DateTimeFormat(u?[u.code,"en-US"]:void 0,{timeZone:i,timeZoneName:r}));return"formatToParts"in d?function(e,t){let n=e.formatToParts(t);for(let e=n.length-1;e>=0;--e)if("timeZoneName"===n[e].type)return n[e].value}(d,t):(l=d,o=t,c=l.format(o).replace(/\u200E/g,""),(s=/ [\w-+ ]+$/.exec(c))?s[0].substr(1):"")}let u={year:0,month:1,day:2,hour:3,minute:4,second:5},l={},o=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),c="06/25/2014, 00:00:00"===o||"‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00"===o;function s(e,t,n,r,a,i,u){let l=new Date(0);return l.setUTCFullYear(e,t,n),l.setUTCHours(r,a,i,u),l}let f=/^(Z)$/,d=/^([+-]\d{2})$/,g=/^([+-])(\d{2}):?(\d{2})$/;function m(e,t,n){let r,a;if(!e)return 0;let i=f.exec(e);if(i)return 0;if(i=d.exec(e))return h(r=parseInt(i[1],10))?-(36e5*r):NaN;if(i=g.exec(e)){r=parseInt(i[2],10);let e=parseInt(i[3],10);return h(r,e)?(a=36e5*Math.abs(r)+6e4*e,"+"===i[1]?-a:a):NaN}if(function(e){if(N[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),N[e]=!0,!0}catch(e){return!1}}(e)){var u;t=new Date(t||Date.now());let r=D(n?t:s((u=t).getFullYear(),u.getMonth(),u.getDate(),u.getHours(),u.getMinutes(),u.getSeconds(),u.getMilliseconds()),e);return-(n?r:function(e,t,n){let r=e.getTime()-t,a=D(new Date(r),n);if(t===a)return t;let i=D(new Date(r-=a-t),n);return a===i?a:Math.max(a,i)}(t,r,e))}return NaN}function D(e,t){var n,r,a;let i,o,f,d=(l[n=t]||(l[n]=c?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),"formatToParts"in(f=l[n])?function(e,t){try{let n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){let t=u[n[e].type];void 0!==t&&(r[t]=parseInt(n[e].value,10))}return r}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(f,e):(r=f,a=e,i=r.format(a),[parseInt((o=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(i))[3],10),parseInt(o[1],10),parseInt(o[2],10),parseInt(o[4],10),parseInt(o[5],10),parseInt(o[6],10)])),g=s(d[0],d[1]-1,d[2],d[3]%24,d[4],d[5],0).getTime(),m=e.getTime(),D=m%1e3;return g-(m-=D>=0?D:1e3+D)}function h(e,t){return -23<=e&&e<=23&&(null==t||0<=t&&t<=59)}let N={},p={X:function(e,t,n){let r=w(n.timeZone,e);if(0===r)return"Z";switch(t){case"X":return I(r);case"XXXX":case"XX":return x(r);default:return x(r,":")}},x:function(e,t,n){let r=w(n.timeZone,e);switch(t){case"x":return I(r);case"xxxx":case"xx":return x(r);default:return x(r,":")}},O:function(e,t,n){let r=w(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t=""){let n=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),i=r%60;return 0===i?n+String(a):n+String(a)+t+T(i,2)}(r,":");default:return"GMT"+x(r,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return i("short",e,n);default:return i("long",e,n)}}};function w(e,t){let n=e?m(e,t,!0)/6e4:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw RangeError("Invalid time zone specified: "+e);return n}function T(e,t){let n=Math.abs(e).toString();for(;n.length<t;)n="0"+n;return(e<0?"-":"")+n}function x(e,t=""){let n=Math.abs(e);return(e>0?"-":"+")+T(Math.floor(n/60),2)+t+T(Math.floor(n%60),2)}function I(e,t){return e%60==0?(e>0?"-":"+")+T(Math.abs(e)/60,2):x(e,t)}function Z(e){let t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e-t}let y=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,M=/^([0-9W+-]+)(T| )(.*)/,U=/^([0-9W+-]+)(.*)/,b=/^(\d{2})$/,C=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],F=/^(\d{4})/,S=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],$=/^-(\d{2})$/,O=/^-?(\d{3})$/,_=/^-?(\d{2})-?(\d{2})$/,z=/^-?W(\d{2})$/,Y=/^-?W(\d{2})-?(\d{1})$/,v=/^(\d{2}([.,]\d*)?)$/,X=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,j=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/;function A(e,t={}){if(arguments.length<1)throw TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);let n=null==t.additionalDigits?2:Number(t.additionalDigits);if(2!==n&&1!==n&&0!==n)throw RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);let r=function(e){let t,n={},r=M.exec(e);if(r?(n.date=r[1],t=r[3]):(r=U.exec(e))?(n.date=r[1],t=r[2]):(n.date=null,t=e),t){let e=y.exec(t);e?(n.time=t.replace(e[1],""),n.timeZone=e[1].trim()):n.time=t}return n}(e),{year:a,restDateString:i}=function(e,t){if(e){let n=C[t],r=S[t],a=F.exec(e)||r.exec(e);if(a){let t=a[1];return{year:parseInt(t,10),restDateString:e.slice(t.length)}}if(a=b.exec(e)||n.exec(e)){let t=a[1];return{year:100*parseInt(t,10),restDateString:e.slice(t.length)}}}return{year:null}}(r.date,n),u=function(e,t){let n,r,a;if(null===t)return null;if(!e||!e.length)return(n=new Date(0)).setUTCFullYear(t),n;let i=$.exec(e);if(i)return(n=new Date(0),k(t,r=parseInt(i[1],10)-1))?(n.setUTCFullYear(t,r),n):new Date(NaN);if(i=O.exec(e)){n=new Date(0);let e=parseInt(i[1],10);return!function(e,t){if(t<1)return!1;let n=W(e);return(!n||!(t>366))&&(!!n||!(t>365))}(t,e)?new Date(NaN):(n.setUTCFullYear(t,0,e),n)}if(i=_.exec(e)){n=new Date(0),r=parseInt(i[1],10)-1;let e=parseInt(i[2],10);return k(t,r,e)?(n.setUTCFullYear(t,r,e),n):new Date(NaN)}if(i=z.exec(e))return G(a=parseInt(i[1],10)-1)?H(t,a):new Date(NaN);if(i=Y.exec(e)){a=parseInt(i[1],10)-1;let e=parseInt(i[2],10)-1;return G(a,e)?H(t,a,e):new Date(NaN)}return null}(i,a);if(null===u||isNaN(u.getTime())||!u)return new Date(NaN);{let e,n=u.getTime(),a=0;if(r.time&&(null===(a=function(e){let t,n,r=v.exec(e);if(r)return R(t=parseFloat(r[1].replace(",",".")))?t%24*36e5:NaN;if(r=X.exec(e))return R(t=parseInt(r[1],10),n=parseFloat(r[2].replace(",",".")))?t%24*36e5+6e4*n:NaN;if(r=j.exec(e)){t=parseInt(r[1],10),n=parseInt(r[2],10);let e=parseFloat(r[3].replace(",","."));return R(t,n,e)?t%24*36e5+6e4*n+1e3*e:NaN}return null}(r.time))||isNaN(a)))return new Date(NaN);if(r.timeZone||t.timeZone){if(isNaN(e=m(r.timeZone||t.timeZone,new Date(n+a))))return new Date(NaN)}else e=Z(new Date(n+a)),e=Z(new Date(n+a+e));return new Date(n+a+e)}}function H(e,t,n){t=t||0,n=n||0;let r=new Date(0);r.setUTCFullYear(e,0,4);let a=7*t+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+a),r}let E=[31,28,31,30,31,30,31,31,30,31,30,31],P=[31,29,31,30,31,30,31,31,30,31,30,31];function W(e){return e%400==0||e%4==0&&e%100!=0}function k(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;let r=W(e);if(r&&n>P[t]||!r&&n>E[t])return!1}return!0}function G(e,t){return!(e<0)&&!(e>52)&&(null==t||!(t<0)&&!(t>6))}function R(e,t,n){return!(e<0)&&!(e>=25)&&(null==t||!(t<0)&&!(t>=60))&&(null==n||!(n<0)&&!(n>=60))}let q=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function B(e,t,n={}){let a=(t=String(t)).match(q);if(a){let r=A(n.originalDate||e,n);t=a.reduce(function(e,t){if("'"===t[0])return e;let a=e.indexOf(t),i="'"===e[a-1],u=e.replace(t,"'"+p[t[0]](r,t,n)+"'");return i?u.substring(0,a-1)+u.substring(a+1):u},t)}return(0,r.GP)(e,t,n)}function J(e,t,n){let r=m(t,e=A(e,n),!0),a=new Date(e.getTime()-r),i=new Date(0);return i.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),i.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),i}function K(e,t,n,r){return r={...r,timeZone:t,originalDate:e},B(J(e,t,{timeZone:r.timeZone}),n,r)}function L(e,t,n){if("string"==typeof e&&!e.match(y))return A(e,{...n,timeZone:t});let r=s((e=A(e,n)).getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),a=m(t,new Date(r));return new Date(r+a)}function Q(e,t){return-m(e,t)}}}]);