@qratilabs/qrati-connect 2.7.0-beta.21 → 2.7.0-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/element/ApyjFWKp.js +1 -0
- package/element/B4hg-Jzn.js +1 -0
- package/element/{DGuOrd-J.js → Bu-UssyO.js} +3 -3
- package/element/C73GNwh3.js +8 -0
- package/element/CoFGfneL.js +1 -0
- package/element/D8g89do5.js +46 -0
- package/element/DJSvG_Nj.js +4 -0
- package/element/DKsx0Y8e.js +1 -0
- package/element/Dp3VaoZ-.js +3 -0
- package/element/Dp5jqmjn.js +4 -0
- package/element/M8Us9cU9.js +2 -0
- package/element/Nlxbxype.js +19 -0
- package/element/V5NTL9Q8.js +8 -0
- package/element/ts3zQh2I.js +3 -0
- package/element/web.es.js +426 -421
- package/element/zVkCODn-.js +1 -0
- package/package.json +1 -1
- package/react/{BiCzDvPj.js → AapCUC-0.js} +1 -1
- package/react/{BMKU_9Dv.js → BA-rmyyP.js} +1 -1
- package/react/{1Ikk7UFc.js → BFeys-t9.js} +1 -1
- package/react/{DE1Dpj--.js → BJuTpMwr.js} +1 -1
- package/react/{B6PQAfDy.js → BNq5z2O6.js} +1 -1
- package/react/{rdtnGUzO.js → BSqusAcm.js} +1 -1
- package/react/{De1I5osG.js → BWSvzAIN.js} +1 -1
- package/react/{lO7A5UtA.js → CH6vqA5t.js} +1 -1
- package/react/{DBByV_MA.js → CIMTZgx2.js} +1 -1
- package/react/{B4OqjpeZ.js → CMNwX5MM.js} +3 -3
- package/react/{DEml42Wf.js → CRqKn_Cg.js} +1 -1
- package/react/CS1Kg8-a.js +1 -0
- package/react/CWGMt62d.js +1 -0
- package/react/{DZCz7kl3.js → CdVkPkqy.js} +1 -1
- package/react/Cn5QS0_5.js +1 -0
- package/react/Cqdhu1W9.js +1 -0
- package/react/{Bv-1NjQE.js → CwlQ8z66.js} +1 -1
- package/react/{Dnp2RfXx.js → DEsmg9S6.js} +1 -1
- package/react/{DDcelZeN.js → DMmZTL_c.js} +1 -1
- package/react/DSiikjS9.js +1 -0
- package/react/{BjBT1ihN.js → DZ_wJszu.js} +1 -1
- package/react/{DJtDMWy2.js → DsQDSY49.js} +1 -1
- package/react/{Bg0TKkPl.js → DyShHlxS.js} +1 -1
- package/react/K73cs4am.js +1 -0
- package/react/RkYXaQ5u.js +1 -0
- package/react/{BNYjlts5.js → Y9MAVRwK.js} +1 -1
- package/react/{CM-f5bOF.js → bAxGEsnX.js} +1 -1
- package/react/{BSXFijrL.js → bia7_YIN.js} +1 -1
- package/react/index.cjs +1 -1
- package/react/index.mjs +114 -109
- package/umd/web.umd.js +1 -1
- package/element/Bl3RFWpg.js +0 -3
- package/element/Bmvot7Mx.js +0 -3
- package/element/C0wQndW7.js +0 -19
- package/element/CCEtowI9.js +0 -46
- package/element/CUGl86v2.js +0 -8
- package/element/CUfhicE8.js +0 -1
- package/element/DCFrvyiS.js +0 -2
- package/element/DCbRXtK8.js +0 -4
- package/element/DI_rRNLa.js +0 -4
- package/element/dcV4od5T.js +0 -8
- package/react/BarCxWTX.js +0 -1
- /package/element/{CMbOX_GS.js → BAMB7Uoo.js} +0 -0
- /package/element/{C6TX_i0I.js → BzIJspY1.js} +0 -0
- /package/element/{DgGPkDRT.js → CjmNvKgB.js} +0 -0
- /package/element/{BxbCvlCo.js → D1zX23l-.js} +0 -0
- /package/element/{CzSmu5XM.js → DUJAMyRv.js} +0 -0
- /package/element/{CIcND0Dg.js → PPVqva_9.js} +0 -0
- /package/element/{Cdux6g1i.js → tPk8Ov5I.js} +0 -0
- /package/react/{Cdux6g1i.js → BJ85RnFv.js} +0 -0
- /package/react/{BvVjd_UK.js → Bp3BRlhW.js} +0 -0
- /package/react/{BCc5Yj_f.js → BszowxAR.js} +0 -0
- /package/react/{BH8UJKb5.js → BtTYXVAR.js} +0 -0
- /package/react/{DJTeOMQR.js → BvT0jQ3V.js} +0 -0
- /package/react/{BAKN93OB.js → Byq3TC8k.js} +0 -0
- /package/react/{qy2OAEht.js → C5dmblnS.js} +0 -0
- /package/react/{fwmxAw7l.js → D2h6qyms.js} +0 -0
- /package/react/{DlCuoz_e.js → D7BzZEsL.js} +0 -0
- /package/react/{C8D6WaBQ.js → DSaIeQ30.js} +0 -0
- /package/react/{DiysJlOc.js → DYeIUbVU.js} +0 -0
- /package/react/{I7IwY3sd.js → Y-mDLYqW.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as t,_t as e,at as s,ct as i,dt as a,et as r,ft as n,gt as o,ht as u,it as h,lt as c,mt as l,nt as d,ot as f,pt as y,rt as p,st as m,tt as g,ut as v,vt as b}from"./D8g89do5.js";function q(t){return{onFetch:(e,i)=>{const a=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,n=e.state.data?.pages||[],o=e.state.data?.pageParams||[];let u={pages:[],pageParams:[]},c=0;const l=async()=>{let i=!1;const l=m(e.options,e.fetchOptions),d=async(t,a,r)=>{if(i)return Promise.reject();if(null==a&&t.pages.length)return Promise.resolve(t);const n=await l((()=>{const t={client:e.client,queryKey:e.queryKey,pageParam:a,direction:r?"backward":"forward",meta:e.options.meta};return h(t,()=>e.signal,()=>i=!0),t})()),{maxPages:o}=e.options,u=r?f:s;return{pages:u(t.pages,n,o),pageParams:u(t.pageParams,a,o)}};if(r&&n.length){const t="backward"===r,e=t?P:C,s={pages:n,pageParams:o};u=await d(s,e(a,s),t)}else{const e=t??n.length;do{const t=0===c?o[0]??a.initialPageParam:C(a,u);if(c>0&&null==t)break;u=await d(u,t),c++}while(c<e)}return u};e.options.persister?e.fetchFn=()=>e.options.persister?.(l,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},i):e.fetchFn=l}}}function C(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function P(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}function O(t,e){return!!e&&null!=C(t,e)}function w(t,e){return!(!e||!t.getPreviousPageParam)&&null!=P(t,e)}var Q=class extends r{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#a({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=g({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(/* @__PURE__ */new Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const i="pending"===this.state.status,a=!this.#i.canStart();try{if(i)e();else{this.#a({type:"pending",variables:t,isPaused:a}),this.#s.config.onMutate&&await this.#s.config.onMutate(t,this,s);const e=await(this.options.onMutate?.(t,s));e!==this.state.context&&this.#a({type:"pending",context:e,variables:t,isPaused:a})}const r=await this.#i.start();return await(this.#s.config.onSuccess?.(r,t,this.state.context,this,s)),await(this.options.onSuccess?.(r,t,this.state.context,s)),await(this.#s.config.onSettled?.(r,null,this.state.variables,this.state.context,this,s)),await(this.options.onSettled?.(r,null,t,this.state.context,s)),this.#a({type:"success",data:r}),r}catch(r){try{await(this.#s.config.onError?.(r,t,this.state.context,this,s))}catch(n){Promise.reject(n)}try{await(this.options.onError?.(r,t,this.state.context,s))}catch(n){Promise.reject(n)}try{await(this.#s.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,s))}catch(n){Promise.reject(n)}try{await(this.options.onSettled?.(void 0,r,t,this.state.context,s))}catch(n){Promise.reject(n)}throw this.#a({type:"error",error:r}),r}finally{this.#s.runNext(this)}}#a(t){this.state=(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"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...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"}}})(this.state),p.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}},D=class extends b{constructor(t={}){super(),this.config=t,this.#r=/* @__PURE__ */new Set,this.#n=/* @__PURE__ */new Map,this.#o=0}#r;#n;#o;build(t,e,s){const i=new Q({client:t,mutationCache:this,mutationId:++this.#o,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#r.add(t);const e=x(t);if("string"==typeof e){const s=this.#n.get(e);s?s.push(t):this.#n.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#r.delete(t)){const e=x(t);if("string"==typeof e){const s=this.#n.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#n.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=x(t);if("string"==typeof e){const s=this.#n.get(e)?.find(t=>"pending"===t.state.status);return!s||s===t}return!0}runNext(t){const e=x(t);return"string"==typeof e?(this.#n.get(e)?.find(e=>e!==t&&e.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){p.batch(()=>{this.#r.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#r.clear(),this.#n.clear()})}getAll(){return Array.from(this.#r)}find(t){const e={exact:!0,...t};return this.getAll().find(t=>a(e,t))}findAll(t={}){return this.getAll().filter(e=>a(t,e))}notify(t){p.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return p.batch(()=>Promise.all(t.map(t=>t.continue().catch(y))))}};function x(t){return t.options.scope?.id}var M=class extends b{constructor(t={}){super(),this.config=t,this.#u=/* @__PURE__ */new Map}#u;build(e,s,i){const a=s.queryKey,r=s.queryHash??v(a,s);let n=this.get(r);return n||(n=new t({client:e,queryKey:a,queryHash:r,options:e.defaultQueryOptions(s),state:i,defaultOptions:e.getQueryDefaults(a)}),this.add(n)),n}add(t){this.#u.has(t.queryHash)||(this.#u.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#u.get(t.queryHash);e&&(t.destroy(),e===t&&this.#u.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){p.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#u.get(t)}getAll(){return[...this.#u.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(t=>n(e,t))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(e=>n(t,e)):e}notify(t){p.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){p.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){p.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},A=class{#h;#s;#c;#l;#d;#f;#y;#p;constructor(t={}){this.#h=t.queryCache||new M,this.#s=t.mutationCache||new D,this.#c=t.defaultOptions||{},this.#l=/* @__PURE__ */new Map,this.#d=/* @__PURE__ */new Map,this.#f=0}mount(){this.#f++,1===this.#f&&(this.#y=e.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onFocus())}),this.#p=d.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onOnline())}))}unmount(){this.#f--,0===this.#f&&(this.#y?.(),this.#y=void 0,this.#p?.(),this.#p=void 0)}isFetching(t){return this.#h.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#s.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#h.build(this,e),i=s.state.data;return void 0===i?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(u(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#h.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){const a=this.defaultQueryOptions({queryKey:t}),r=this.#h.get(a.queryHash)?.state.data,n=i(e,r);if(void 0!==n)return this.#h.build(this,a).setData(n,{...s,manual:!0})}setQueriesData(t,e,s){return p.batch(()=>this.#h.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state}removeQueries(t){const e=this.#h;p.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){const s=this.#h;return p.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=p.batch(()=>this.#h.findAll(t).map(t=>t.cancel(s)));return Promise.all(i).then(y).catch(y)}invalidateQueries(t,e={}){return p.batch(()=>(this.#h.findAll(t).forEach(t=>{t.invalidate()}),"none"===t?.refetchType?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=p.batch(()=>this.#h.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(y)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(i).then(y)}fetchQuery(t){const e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);const s=this.#h.build(this,e);return s.isStaleByTime(u(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(y).catch(y)}fetchInfiniteQuery(t){return t.behavior=q(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(y).catch(y)}ensureInfiniteQueryData(t){return t.behavior=q(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return d.isOnline()?this.#s.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#h}getMutationCache(){return this.#s}getDefaultOptions(){return this.#c}setDefaultOptions(t){this.#c=t}setQueryDefaults(t,e){this.#l.set(c(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#l.values()],s={};return e.forEach(e=>{l(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#d.set(c(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#d.values()],s={};return e.forEach(e=>{l(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#c.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=v(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===o&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#c.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#h.clear(),this.#s.clear()}};export{q as i,O as n,w as r,A as t};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./CH5eh9L8.js"),t=require("./BarCxWTX.js"),r=require("./B6PQAfDy.js"),n=require("./DDcelZeN.js");var o={top:60,bottom:60,left:276,right:60},i="#fb8500",s=new r.QueryClient,l=(e,r,o)=>{t.R(t.u(t.QueryClientProvider,{client:s,children:t.u(t.MemoryRouter,{children:t.u(n.EventPreviewCard,{event:e,onExplore:o})})}),r)},c=e=>{const t=document.createElement("div");t.style.cssText=`\n background:${n.safeCssColor(e.color,"#fb8500")};color:#fff;border-radius:20px;padding:5px 10px;\n font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer;\n box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);\n display:inline-flex;align-items:center;gap:6px;\n `;const r=document.createElement("span");r.textContent=e.folder.name;const o=document.createElement("span");return o.style.cssText="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;",o.textContent=String(e.eventCount),t.appendChild(r),t.appendChild(o),t};exports.default=({apiKey:r,is3D:s,onExplore:a,logoUrl:u})=>{const d=t.A(null),p=t.A(null),m=t.A(null),f=t.A(s),g=t.A([]),y=t.A([]),h=t.A(null),b=t.A(!1),v=t.A(!1),x=t.A(null),[w,E]=t.d(s),_=t.T(()=>(()=>{try{const e=sessionStorage.getItem(t.MAP_STATE_SESSION_STORAGE_PARAM);if(!e)return null;const r=JSON.parse(e);if(Array.isArray(r?.center)&&"number"==typeof r.zoom)return r}catch{}return null})(),[]),[C,L]=t.d(!1),[S,A]=t.d(!0),{folderTree:T,activeFolderId:z,activeFolder:k,visibleEvents:j,setActiveFolderId:F,isLoadingEvents:M}=n.useFolderMap(),{organization:P}=t.useSession(),O=()=>{g.current.forEach(e=>e.remove()),g.current=[]},B=()=>{y.current.forEach(e=>e.remove()),y.current=[]},I=(e,t)=>{const r=t?"visible":"none";for(const n of["heatmap","event-clusters","cluster-count","unclustered-point"])e.getLayer(n)&&e.setLayoutProperty(n,"visibility",r)};return t.y(()=>{if(!d.current||p.current)return;let n,o=!1;return(async()=>{try{const s=(await Promise.resolve().then(()=>e.__toESM(require("./I7IwY3sd.js").default,1))).default;if(o)return;if(!d.current)return;s.accessToken=r;const c=_?.center??[0,20],u=_?.zoom??3,g=new s.Map({container:d.current,style:"mapbox://styles/mapbox/streets-v12",center:c,zoom:u,minZoom:0,pitch:0,bearing:0,renderWorldCopies:!1,antialias:!0,projection:f.current?"globe":"mercator"});p.current=g,m.current=s,g.on("load",()=>{if(o)return;const e=g.getStyle()?.layers??[];let t,r;for(const n of e){const e=n;"symbol"===e.type&&e.layout?.["text-field"]&&!t&&(t=n.id),"building"!==e["source-layer"]||r||(r=e.source)}r&&!g.getLayer("3d-buildings")&&g.addLayer({id:"3d-buildings",source:r,"source-layer":"building",filter:["has","render_height"],type:"fill-extrusion",minzoom:14,paint:{"fill-extrusion-color":["interpolate",["linear"],["get","render_height"],0,"lightgray",200,"royalblue",400,"lightblue"],"fill-extrusion-height":["interpolate",["linear"],["zoom"],14,0,15,["get","render_height"]],"fill-extrusion-base":["case",["has","render_min_height"],["get","render_min_height"],0],"fill-extrusion-opacity":.6}},t),g.addSource("all-events",{type:"geojson",data:{type:"FeatureCollection",features:[]},cluster:!0,clusterRadius:50,clusterMaxZoom:14}),g.addSource("heat-events",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),g.addLayer({id:"heatmap",type:"heatmap",source:"heat-events",layout:{visibility:"none"},paint:{"heatmap-weight":["interpolate",["linear"],["get","views"],0,0,200,1],"heatmap-intensity":["interpolate",["linear"],["zoom"],0,1,9,3],"heatmap-color":["interpolate",["linear"],["heatmap-density"],0,"rgba(33,102,172,0)",.2,"rgb(103,169,207)",.4,"rgb(209,229,240)",.6,"rgb(253,219,199)",.8,"rgb(239,138,98)",1,"rgb(178,24,43)"],"heatmap-radius":["interpolate",["linear"],["zoom"],0,4,9,30],"heatmap-opacity":["interpolate",["linear"],["zoom"],6,.85,11,0]}}),g.addLayer({id:"event-clusters",type:"circle",source:"all-events",layout:{visibility:"none"},filter:["has","point_count"],paint:{"circle-color":["step",["get","point_count"],i,10,"#e63946",30,"#9b2226"],"circle-radius":["step",["get","point_count"],16,10,20,30,26],"circle-stroke-width":2,"circle-stroke-color":"#fff"}}),g.addLayer({id:"cluster-count",type:"symbol",source:"all-events",layout:{visibility:"none","text-field":"{point_count_abbreviated}","text-size":12},paint:{"text-color":"#fff"}}),g.addLayer({id:"unclustered-point",type:"circle",source:"all-events",layout:{visibility:"none"},filter:["!",["has","point_count"]],paint:{"circle-radius":7,"circle-color":i,"circle-stroke-color":"#fff","circle-stroke-width":2}}),g.on("click","event-clusters",e=>{const t=g.queryRenderedFeatures(e.point,{layers:["event-clusters"]});if(!t.length)return;const r=t[0].properties?.cluster_id,n=g.getSource("all-events");r&&n?.getClusterExpansionZoom&&n.getClusterExpansionZoom(r,(e,r)=>{e||"number"!=typeof r||g.easeTo({center:t[0].geometry.coordinates,zoom:r,duration:600})})}),g.on("click","unclustered-point",e=>{const t=e.features?.[0];if(!t)return;const r=t.geometry.coordinates.slice(0,2),n=t.properties??{},o={_id:n._id,slug:n.slug,name:n.name,views:n.views,location:{x:r[0],y:r[1],label:n.label},contents:n.thumbnailUrl?[{thumbnailUrl:n.thumbnailUrl}]:[]};x.current&&(x.current.remove(),x.current=null);const i=document.createElement("div");l(o,i,a);const c=new s.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-10]}).setLngLat(r).setDOMContent(i).addTo(g);x.current=c,c.on("close",()=>{x.current===c&&(x.current=null)})}),g.on("click",e=>{!g.queryRenderedFeatures(e.point,{layers:["event-clusters","unclustered-point"]}).length&&x.current&&(x.current.remove(),x.current=null)}),g.on("mouseenter","event-clusters",()=>{g.getCanvas().style.cursor="pointer"}),g.on("mouseleave","event-clusters",()=>{g.getCanvas().style.cursor=""}),g.on("mouseenter","unclustered-point",()=>{g.getCanvas().style.cursor="pointer"}),g.on("mouseleave","unclustered-point",()=>{g.getCanvas().style.cursor=""}),L(!0),A(!1)});const y=()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{try{const e=g.getCenter();sessionStorage.setItem(t.MAP_STATE_SESSION_STORAGE_PARAM,JSON.stringify({center:[e.lng,e.lat],zoom:g.getZoom()}))}catch{}},250)};g.on("zoomend",y),g.on("moveend",y),n=()=>{O(),B(),x.current&&(x.current.remove(),x.current=null),h.current&&clearTimeout(h.current),g.off("zoomend",y),g.off("moveend",y),g.remove(),p.current=null,m.current=null}}finally{o||A(!1)}})(),()=>{o=!0,n?.()}},[r]),t.y(()=>{if(!C)return;const e=p.current,t=m.current;if(e&&t)if(O(),B(),null===z&&T.length>0){I(e,!1);const r=n=>{for(const o of n)if(o.centroid){const r=c(o);r.addEventListener("click",()=>F(o.folder._id));const n=new t.Marker({element:r,anchor:"center"}).setLngLat([o.centroid[0],o.centroid[1]]).addTo(e);g.current.push(n)}else o.children.length>0&&r(o.children)};r(T)}else if(0===T.length&&null===z){if(0===j.length)return;const r=j.map(e=>({type:"Feature",geometry:{type:"Point",coordinates:[e.location.x,e.location.y]},properties:{_id:e._id,slug:e.slug,name:e.name,views:e.views??0,label:e.location?.label??"",thumbnailUrl:e.contents?.[0]?.thumbnailUrl??""}})),n={type:"FeatureCollection",features:r};if(e.getSource("all-events")?.setData(n),e.getSource("heat-events")?.setData({...n,features:r.map(e=>({...e,properties:{views:e.properties.views}}))}),I(e,!0),!v.current&&(v.current=!0,!_)){const r=new t.LngLatBounds;j.forEach(e=>r.extend([e.location.x,e.location.y])),r.isEmpty()||e.fitBounds(r,{padding:o,maxZoom:8,duration:800})}}else{if(0===j.length)return;I(e,!1);const r=k?.color||i,o=new t.LngLatBounds;j.forEach(i=>{const s=i.location.x,c=i.location.y;o.extend([s,c]);const d=((e,t)=>{const r=document.createElement("div");if(r.style.cssText=`\n width:36px;height:36px;cursor:pointer;\n background:${e};border-radius:50% 50% 50% 0;transform:rotate(-45deg);\n border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);\n display:flex;align-items:center;justify-content:center;overflow:hidden;\n `,t){const e=document.createElement("img");e.src=n.safeImageUrl(t)??"",e.style.cssText="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);",r.appendChild(e)}return r})(r,u);d.addEventListener("click",()=>{x.current&&(x.current.remove(),x.current=null);const r=document.createElement("div");l(i,r,a);const n=new t.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-40]}).setLngLat([s,c]).setDOMContent(r).addTo(e);x.current=n,n.on("close",()=>{x.current===n&&(x.current=null)})});const p=new t.Marker({element:d}).setLngLat([s,c]).addTo(e);y.current.push(p)})}},[z,T,j,C,a,u,F,k,_]),t.y(()=>{if(!C)return;const e=p.current;if(!e)return;if(!b.current&&_)return void(b.current=!0);b.current=!0;const t={padding:o,duration:3e3,essential:!0},r=m.current;if(r)if(z){const o=n.findNodeById(T,z);if(!o?.folder.boundary?.length)return;const i=new r.LngLatBounds;for(const e of o.folder.boundary)i.extend([e.x,e.y]);i.isEmpty()||e.fitBounds(i,{...t,maxZoom:14})}else if(T.length>0){const n=new r.LngLatBounds,o=e=>{for(const t of e)t.centroid?n.extend([t.centroid[0],t.centroid[1]]):o(t.children)};o(T),n.isEmpty()||e.fitBounds(n,{...t,maxZoom:8})}},[z,T,C,_]),t.y(()=>{p.current&&(f.current=w,p.current.setProjection(w?"globe":"mercator"),p.current.easeTo({pitch:0,bearing:0,duration:600}))},[w]),t.u("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:t.getStyleObject(P),children:[t.u(n.FolderTreeSidebar,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:T,activeFolderId:z,setActiveFolderId:F}),t.u("button",{type:"button",onClick:()=>E(e=>!e),class:"bg-background hover:bg-foreground/10 absolute top-4 right-4 z-[1000] rounded-xl px-3 py-2 text-xs font-semibold shadow-lg backdrop-blur-sm",children:w?"2D":"3D"}),M&&t.u("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:t.u("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),S&&t.u("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:t.u("div",{class:"flex flex-col items-center gap-3",children:[t.u("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),t.u("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),t.u("div",{ref:d,class:"size-full"})]})};
|
|
1
|
+
const e=require("./CH5eh9L8.js"),t=require("./Cn5QS0_5.js"),r=require("./BNq5z2O6.js"),n=require("./DMmZTL_c.js");var o={top:60,bottom:60,left:276,right:60},i="#fb8500",s=new r.QueryClient,l=(e,r,o)=>{t.R(t.u(t.QueryClientProvider,{client:s,children:t.u(t.MemoryRouter,{children:t.u(n.EventPreviewCard,{event:e,onExplore:o})})}),r)},c=e=>{const t=document.createElement("div");t.style.cssText=`\n background:${n.safeCssColor(e.color,"#fb8500")};color:#fff;border-radius:20px;padding:5px 10px;\n font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer;\n box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);\n display:inline-flex;align-items:center;gap:6px;\n `;const r=document.createElement("span");r.textContent=e.folder.name;const o=document.createElement("span");return o.style.cssText="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;",o.textContent=String(e.eventCount),t.appendChild(r),t.appendChild(o),t};exports.default=({apiKey:r,is3D:s,onExplore:a,logoUrl:u})=>{const d=t.A(null),p=t.A(null),m=t.A(null),f=t.A(s),g=t.A([]),y=t.A([]),h=t.A(null),b=t.A(!1),v=t.A(!1),x=t.A(null),[w,E]=t.d(s),_=t.T(()=>(()=>{try{const e=sessionStorage.getItem(t.MAP_STATE_SESSION_STORAGE_PARAM);if(!e)return null;const r=JSON.parse(e);if(Array.isArray(r?.center)&&"number"==typeof r.zoom)return r}catch{}return null})(),[]),[C,L]=t.d(!1),[S,A]=t.d(!0),{folderTree:T,activeFolderId:z,activeFolder:k,visibleEvents:j,setActiveFolderId:F,isLoadingEvents:M}=n.useFolderMap(),{organization:P}=t.useSession(),O=()=>{g.current.forEach(e=>e.remove()),g.current=[]},B=()=>{y.current.forEach(e=>e.remove()),y.current=[]},I=(e,t)=>{const r=t?"visible":"none";for(const n of["heatmap","event-clusters","cluster-count","unclustered-point"])e.getLayer(n)&&e.setLayoutProperty(n,"visibility",r)};return t.y(()=>{if(!d.current||p.current)return;let n,o=!1;return(async()=>{try{const s=(await Promise.resolve().then(()=>e.__toESM(require("./Y-mDLYqW.js").default,1))).default;if(o)return;if(!d.current)return;s.accessToken=r;const c=_?.center??[0,20],u=_?.zoom??3,g=new s.Map({container:d.current,style:"mapbox://styles/mapbox/streets-v12",center:c,zoom:u,minZoom:0,pitch:0,bearing:0,renderWorldCopies:!1,antialias:!0,projection:f.current?"globe":"mercator"});p.current=g,m.current=s,g.on("load",()=>{if(o)return;const e=g.getStyle()?.layers??[];let t,r;for(const n of e){const e=n;"symbol"===e.type&&e.layout?.["text-field"]&&!t&&(t=n.id),"building"!==e["source-layer"]||r||(r=e.source)}r&&!g.getLayer("3d-buildings")&&g.addLayer({id:"3d-buildings",source:r,"source-layer":"building",filter:["has","render_height"],type:"fill-extrusion",minzoom:14,paint:{"fill-extrusion-color":["interpolate",["linear"],["get","render_height"],0,"lightgray",200,"royalblue",400,"lightblue"],"fill-extrusion-height":["interpolate",["linear"],["zoom"],14,0,15,["get","render_height"]],"fill-extrusion-base":["case",["has","render_min_height"],["get","render_min_height"],0],"fill-extrusion-opacity":.6}},t),g.addSource("all-events",{type:"geojson",data:{type:"FeatureCollection",features:[]},cluster:!0,clusterRadius:50,clusterMaxZoom:14}),g.addSource("heat-events",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),g.addLayer({id:"heatmap",type:"heatmap",source:"heat-events",layout:{visibility:"none"},paint:{"heatmap-weight":["interpolate",["linear"],["get","views"],0,0,200,1],"heatmap-intensity":["interpolate",["linear"],["zoom"],0,1,9,3],"heatmap-color":["interpolate",["linear"],["heatmap-density"],0,"rgba(33,102,172,0)",.2,"rgb(103,169,207)",.4,"rgb(209,229,240)",.6,"rgb(253,219,199)",.8,"rgb(239,138,98)",1,"rgb(178,24,43)"],"heatmap-radius":["interpolate",["linear"],["zoom"],0,4,9,30],"heatmap-opacity":["interpolate",["linear"],["zoom"],6,.85,11,0]}}),g.addLayer({id:"event-clusters",type:"circle",source:"all-events",layout:{visibility:"none"},filter:["has","point_count"],paint:{"circle-color":["step",["get","point_count"],i,10,"#e63946",30,"#9b2226"],"circle-radius":["step",["get","point_count"],16,10,20,30,26],"circle-stroke-width":2,"circle-stroke-color":"#fff"}}),g.addLayer({id:"cluster-count",type:"symbol",source:"all-events",layout:{visibility:"none","text-field":"{point_count_abbreviated}","text-size":12},paint:{"text-color":"#fff"}}),g.addLayer({id:"unclustered-point",type:"circle",source:"all-events",layout:{visibility:"none"},filter:["!",["has","point_count"]],paint:{"circle-radius":7,"circle-color":i,"circle-stroke-color":"#fff","circle-stroke-width":2}}),g.on("click","event-clusters",e=>{const t=g.queryRenderedFeatures(e.point,{layers:["event-clusters"]});if(!t.length)return;const r=t[0].properties?.cluster_id,n=g.getSource("all-events");r&&n?.getClusterExpansionZoom&&n.getClusterExpansionZoom(r,(e,r)=>{e||"number"!=typeof r||g.easeTo({center:t[0].geometry.coordinates,zoom:r,duration:600})})}),g.on("click","unclustered-point",e=>{const t=e.features?.[0];if(!t)return;const r=t.geometry.coordinates.slice(0,2),n=t.properties??{},o={_id:n._id,slug:n.slug,name:n.name,views:n.views,location:{x:r[0],y:r[1],label:n.label},contents:n.thumbnailUrl?[{thumbnailUrl:n.thumbnailUrl}]:[]};x.current&&(x.current.remove(),x.current=null);const i=document.createElement("div");l(o,i,a);const c=new s.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-10]}).setLngLat(r).setDOMContent(i).addTo(g);x.current=c,c.on("close",()=>{x.current===c&&(x.current=null)})}),g.on("click",e=>{!g.queryRenderedFeatures(e.point,{layers:["event-clusters","unclustered-point"]}).length&&x.current&&(x.current.remove(),x.current=null)}),g.on("mouseenter","event-clusters",()=>{g.getCanvas().style.cursor="pointer"}),g.on("mouseleave","event-clusters",()=>{g.getCanvas().style.cursor=""}),g.on("mouseenter","unclustered-point",()=>{g.getCanvas().style.cursor="pointer"}),g.on("mouseleave","unclustered-point",()=>{g.getCanvas().style.cursor=""}),L(!0),A(!1)});const y=()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{try{const e=g.getCenter();sessionStorage.setItem(t.MAP_STATE_SESSION_STORAGE_PARAM,JSON.stringify({center:[e.lng,e.lat],zoom:g.getZoom()}))}catch{}},250)};g.on("zoomend",y),g.on("moveend",y),n=()=>{O(),B(),x.current&&(x.current.remove(),x.current=null),h.current&&clearTimeout(h.current),g.off("zoomend",y),g.off("moveend",y),g.remove(),p.current=null,m.current=null}}finally{o||A(!1)}})(),()=>{o=!0,n?.()}},[r]),t.y(()=>{if(!C)return;const e=p.current,t=m.current;if(e&&t)if(O(),B(),null===z&&T.length>0){I(e,!1);const r=n=>{for(const o of n)if(o.centroid){const r=c(o);r.addEventListener("click",()=>F(o.folder._id));const n=new t.Marker({element:r,anchor:"center"}).setLngLat([o.centroid[0],o.centroid[1]]).addTo(e);g.current.push(n)}else o.children.length>0&&r(o.children)};r(T)}else if(0===T.length&&null===z){if(0===j.length)return;const r=j.map(e=>({type:"Feature",geometry:{type:"Point",coordinates:[e.location.x,e.location.y]},properties:{_id:e._id,slug:e.slug,name:e.name,views:e.views??0,label:e.location?.label??"",thumbnailUrl:e.contents?.[0]?.thumbnailUrl??""}})),n={type:"FeatureCollection",features:r};if(e.getSource("all-events")?.setData(n),e.getSource("heat-events")?.setData({...n,features:r.map(e=>({...e,properties:{views:e.properties.views}}))}),I(e,!0),!v.current&&(v.current=!0,!_)){const r=new t.LngLatBounds;j.forEach(e=>r.extend([e.location.x,e.location.y])),r.isEmpty()||e.fitBounds(r,{padding:o,maxZoom:8,duration:800})}}else{if(0===j.length)return;I(e,!1);const r=k?.color||i,o=new t.LngLatBounds;j.forEach(i=>{const s=i.location.x,c=i.location.y;o.extend([s,c]);const d=((e,t)=>{const r=document.createElement("div");if(r.style.cssText=`\n width:36px;height:36px;cursor:pointer;\n background:${e};border-radius:50% 50% 50% 0;transform:rotate(-45deg);\n border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);\n display:flex;align-items:center;justify-content:center;overflow:hidden;\n `,t){const e=document.createElement("img");e.src=n.safeImageUrl(t)??"",e.style.cssText="width:24px;height:24px;border-radius:50%;object-fit:cover;transform:rotate(45deg);",r.appendChild(e)}return r})(r,u);d.addEventListener("click",()=>{x.current&&(x.current.remove(),x.current=null);const r=document.createElement("div");l(i,r,a);const n=new t.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-40]}).setLngLat([s,c]).setDOMContent(r).addTo(e);x.current=n,n.on("close",()=>{x.current===n&&(x.current=null)})});const p=new t.Marker({element:d}).setLngLat([s,c]).addTo(e);y.current.push(p)})}},[z,T,j,C,a,u,F,k,_]),t.y(()=>{if(!C)return;const e=p.current;if(!e)return;if(!b.current&&_)return void(b.current=!0);b.current=!0;const t={padding:o,duration:3e3,essential:!0},r=m.current;if(r)if(z){const o=n.findNodeById(T,z);if(!o?.folder.boundary?.length)return;const i=new r.LngLatBounds;for(const e of o.folder.boundary)i.extend([e.x,e.y]);i.isEmpty()||e.fitBounds(i,{...t,maxZoom:14})}else if(T.length>0){const n=new r.LngLatBounds,o=e=>{for(const t of e)t.centroid?n.extend([t.centroid[0],t.centroid[1]]):o(t.children)};o(T),n.isEmpty()||e.fitBounds(n,{...t,maxZoom:8})}},[z,T,C,_]),t.y(()=>{p.current&&(f.current=w,p.current.setProjection(w?"globe":"mercator"),p.current.easeTo({pitch:0,bearing:0,duration:600}))},[w]),t.u("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:t.getStyleObject(P),children:[t.u(n.FolderTreeSidebar,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:T,activeFolderId:z,setActiveFolderId:F}),t.u("button",{type:"button",onClick:()=>E(e=>!e),class:"bg-background hover:bg-foreground/10 absolute top-4 right-4 z-[1000] rounded-xl px-3 py-2 text-xs font-semibold shadow-lg backdrop-blur-sm",children:w?"2D":"3D"}),M&&t.u("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:t.u("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),S&&t.u("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:t.u("div",{class:"flex flex-col items-center gap-3",children:[t.u("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),t.u("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),t.u("div",{ref:d,class:"size-full"})]})};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as e from"react";import{jsx as t}from"react/jsx-runtime";var r,n,o,a,s,i,l,c,u,d,h,p,f,m,g,y={},_=[],b=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function w(e,t){for(var r in t)e[r]=t[r];return e}function E(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function R(e,t,n){var o,a,s,i={};for(s in t)"key"==s?o=t[s]:"ref"==s?a=t[s]:i[s]=t[s];if(arguments.length>2&&(i.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===i[s]&&(i[s]=e.defaultProps[s]);return S(e,i,o,a,null)}function S(e,t,r,a,s){var i={type:e,props:t,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++o:s,__i:-1,__u:0};return null==s&&null!=n.vnode&&n.vnode(i),i}function x(e){return e.children}function k(e,t){this.props=e,this.context=t}function T(e,t){if(null==t)return e.__?T(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?T(e):null}function C(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,o=[],a=[],s=w({},t);s.__v=t.__v+1,n.vnode&&n.vnode(s),F(e.__P,s,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,o,null==r?T(t):r,!!(32&t.__u),a),s.__v=t.__v,s.__.__k[s.__i]=s,j(o,s,a),t.__e=t.__=null,s.__e!=r&&O(s)}}function O(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),O(e)}function A(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!N.__r++||s!=n.debounceRendering)&&((s=n.debounceRendering)||i)(N)}function N(){try{for(var e,t=1;a.length;)a.length>t&&a.sort(l),e=a.shift(),t=a.length,C(e)}finally{a.length=N.__r=0}}function P(e,t,r,n,o,a,s,i,l,c,u){var d,h,p,f,m,g,b,w=n&&n.__k||_,E=t.length;for(l=function(e,t,r,n,o){var a,s,i,l,c,u=r.length,d=u,h=0;for(e.__k=new Array(o),a=0;a<o;a++)null!=(s=t[a])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=e.__k[a]=S(null,s,null,null,null):v(s)?s=e.__k[a]=S(x,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=e.__k[a]=S(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[a]=s,l=a+h,s.__=e,s.__b=e.__b+1,i=null,-1!=(c=s.__i=L(s,r,l,d))&&(d--,(i=r[c])&&(i.__u|=2)),null==i||null==i.__v?(-1==c&&(o>u?h--:o<u&&h++),"function"!=typeof s.type&&(s.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,s.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)null!=(i=r[a])&&!(2&i.__u)&&(i.__e==n&&(n=T(i)),G(i,i));return n}(r,t,w,l,E),d=0;d<E;d++)null!=(p=r.__k[d])&&(h=-1!=p.__i&&w[p.__i]||y,p.__i=d,g=F(e,p,h,o,a,s,i,l,c,u),f=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&H(h.ref,null,p),u.push(p.ref,p.__c||f,p)),null==m&&null!=f&&(m=f),(b=!!(4&p.__u))||h.__k===p.__k?(l=I(p,l,e,b),b&&h.__e&&(h.__e=null)):"function"==typeof p.type&&void 0!==g?l=g:f&&(l=f.nextSibling),p.__u&=-7);return r.__e=m,l}function I(e,t,r,n){var o,a;if("function"==typeof e.type){for(o=e.__k,a=0;o&&a<o.length;a++)o[a]&&(o[a].__=e,t=I(o[a],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=T(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function D(e,t){return t=t||[],null==e||"boolean"==typeof e||(v(e)?e.some(function(e){D(e,t)}):t.push(e)),t}function L(e,t,r,n){var o,a,s,i=e.key,l=e.type,c=t[r],u=null!=c&&!(2&c.__u);if(null===c&&null==i||u&&i==c.key&&l==c.type)return r;if(n>(u?1:0))for(o=r-1,a=r+1;o>=0||a<t.length;)if(null!=(c=t[s=o>=0?o--:a++])&&!(2&c.__u)&&i==c.key&&l==c.type)return s;return-1}function $(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||b.test(t)?r:r+"px"}function U(e,t,r,n,o){var a,s;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||$(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||$(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])a=t!=(t=t.replace(h,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?n?r[d]=n[d]:(r[d]=p,e.addEventListener(t,a?m:f,a)):e.removeEventListener(t,a?m:f,a);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function M(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t[u])t[u]=p++;else if(t[u]<r[d])return;return r(n.event?n.event(t):t)}}}function F(e,t,r,o,a,s,i,l,c,u){var d,h,p,f,m,g,y,b,R,S,T,C,O,A,N,I=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(c=!!(32&r.__u),s=[l=t.__e=r.__e]),(d=n.__b)&&d(t);e:if("function"==typeof I)try{if(b=t.props,R=I.prototype&&I.prototype.render,S=(d=I.contextType)&&o[d.__c],T=d?S?S.props.value:d.__:o,r.__c?y=(h=t.__c=r.__c).__=h.__E:(R?t.__c=h=new I(b,T):(t.__c=h=new k(b,T),h.constructor=I,h.render=V),S&&S.sub(h),h.state||(h.state={}),h.__n=o,p=h.__d=!0,h.__h=[],h._sb=[]),R&&null==h.__s&&(h.__s=h.state),R&&null!=I.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=w({},h.__s)),w(h.__s,I.getDerivedStateFromProps(b,h.__s))),f=h.props,m=h.state,h.__v=t,p)R&&null==I.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),R&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(R&&null==I.getDerivedStateFromProps&&b!==f&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,T),t.__v==r.__v||!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,T)){t.__v!=r.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(e){e&&(e.__=t)}),_.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&i.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,T),R&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(f,m,g)})}if(h.context=T,h.props=b,h.__P=e,h.__e=!1,C=n.__r,O=0,R)h.state=h.__s,h.__d=!1,C&&C(t),d=h.render(h.props,h.state,h.context),_.push.apply(h.__h,h._sb),h._sb=[];else do{h.__d=!1,C&&C(t),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++O<25);h.state=h.__s,null!=h.getChildContext&&(o=w(w({},o),h.getChildContext())),R&&!p&&null!=h.getSnapshotBeforeUpdate&&(g=h.getSnapshotBeforeUpdate(f,m)),A=null!=d&&d.type===x&&null==d.key?z(d.props.children):d,l=P(e,v(A)?A:[A],t,r,o,a,s,i,l,c,u),h.base=t.__e,t.__u&=-161,h.__h.length&&i.push(h),y&&(h.__E=h.__=null)}catch(e){if(t.__v=null,c||null!=s)if(e.then){for(t.__u|=c?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;s[s.indexOf(l)]=null,t.__e=l}else{for(N=s.length;N--;)E(s[N]);q(t)}else t.__e=r.__e,t.__k=r.__k,e.then||q(t);n.__e(e,t,r)}else null==s&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):l=t.__e=W(r.__e,t,r,o,a,s,i,c,u);return(d=n.diffed)&&d(t),128&t.__u?void 0:l}function q(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(q))}function j(e,t,r){for(var o=0;o<r.length;o++)H(r[o],r[++o],r[++o]);n.__c&&n.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){n.__e(e,t.__v)}})}function z(e){return"object"!=typeof e||null==e||e.__b>0?e:v(e)?e.map(z):w({},e)}function W(e,t,o,a,s,i,l,c,u){var d,h,p,f,m,g,_,b=o.props||y,w=t.props,R=t.type;if("svg"==R?s="http://www.w3.org/2000/svg":"math"==R?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=i)for(d=0;d<i.length;d++)if((m=i[d])&&"setAttribute"in m==!!R&&(R?m.localName==R:3==m.nodeType)){e=m,i[d]=null;break}if(null==e){if(null==R)return document.createTextNode(w);e=document.createElementNS(s,R,w.is&&w),c&&(n.__m&&n.__m(t,i),c=!1),i=null}if(null==R)b===w||c&&e.data==w||(e.data=w);else{if(i=i&&r.call(e.childNodes),!c&&null!=i)for(b={},d=0;d<e.attributes.length;d++)b[(m=e.attributes[d]).name]=m.value;for(d in b)m=b[d],"dangerouslySetInnerHTML"==d?p=m:"children"==d||d in w||"value"==d&&"defaultValue"in w||"checked"==d&&"defaultChecked"in w||U(e,d,null,m,s);for(d in w)m=w[d],"children"==d?f=m:"dangerouslySetInnerHTML"==d?h=m:"value"==d?g=m:"checked"==d?_=m:c&&"function"!=typeof m||b[d]===m||U(e,d,m,b[d],s);if(h)c||p&&(h.__html==p.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(p&&(e.innerHTML=""),P("template"==t.type?e.content:e,v(f)?f:[f],t,o,a,"foreignObject"==R?"http://www.w3.org/1999/xhtml":s,i,l,i?i[0]:o.__k&&T(o,0),c,u),null!=i)for(d=i.length;d--;)E(i[d]);c||(d="value","progress"==R&&null==g?e.removeAttribute("value"):null!=g&&(g!==e[d]||"progress"==R&&!g||"option"==R&&g!=b[d])&&U(e,d,g,b[d],s),d="checked",null!=_&&_!=e[d]&&U(e,d,_,b[d],s))}return e}function H(e,t,r){try{if("function"==typeof e){var o="function"==typeof e.__u;o&&e.__u(),o&&null==t||(e.__u=e(t))}else e.current=t}catch(e){n.__e(e,r)}}function G(e,t,r){var o,a;if(n.unmount&&n.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||H(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){n.__e(e,t)}o.base=o.__P=null}if(o=e.__k)for(a=0;a<o.length;a++)o[a]&&G(o[a],t,r||"function"!=typeof e.type);r||E(e.__e),e.__c=e.__=e.__e=void 0}function V(e,t,r){return this.constructor(e,r)}function B(e,t,o){var a,s,i,l;t==document&&(t=document.documentElement),n.__&&n.__(e,t),s=(a="function"==typeof o)?null:o&&o.__k||t.__k,i=[],l=[],F(t,e=(!a&&o||t).__k=R(x,null,[e]),s||y,y,t.namespaceURI,!a&&o?[o]:s?null:t.firstChild?r.call(t.childNodes):null,i,!a&&o?o:s?s.__e:t.firstChild,a,l),j(i,e,l)}function Q(e,t,n){var o,a,s,i,l=w({},e.props);for(s in e.type&&e.type.defaultProps&&(i=e.type.defaultProps),t)"key"==s?o=t[s]:"ref"==s?a=t[s]:l[s]=void 0===t[s]&&null!=i?i[s]:t[s];return arguments.length>2&&(l.children=arguments.length>3?r.call(arguments,2):n),S(e.type,l,o||e.key,a||e.ref,null)}function Z(e){function t(e){var r,n;return this.getChildContext||(r=/* @__PURE__ */new Set,(n={})[t.__c]=this,this.getChildContext=function(){return n},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach(function(e){e.__e=!0,A(e)})},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+g++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}r=_.slice,n={__e:function(e,t,r,n){for(var o,a,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((a=o.constructor)&&null!=a.getDerivedStateFromError&&(o.setState(a.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,n||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},o=0,k.prototype.setState=function(e,t){var r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=w({},this.state);"function"==typeof e&&(e=e(w({},r),this.props)),e&&w(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),A(this))},k.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),A(this))},k.prototype.render=x,a=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},N.__r=0,c=Math.random().toString(8),u="__d"+c,d="__a"+c,h=/(PointerCapture)$|Capture$/i,p=0,f=M(!1),m=M(!0),g=0;var K,J,Y,X,ee=0,te=[],re=n,ne=re.__b,oe=re.__r,ae=re.diffed,se=re.__c,ie=re.unmount,le=re.__;function ce(e,t){re.__h&&re.__h(J,e,ee||t),ee=0;var r=J.__H||(J.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function ue(e){return ee=1,function(e,t){var r=ce(K++,2);if(r.t=e,!r.__c&&(r.__=[Se(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=J,!J.__f)){var n=function(e,t,n){if(!r.__c.__H)return!0;var a=r.__c.__H.__.filter(function(e){return e.__c});if(a.every(function(e){return!e.__N}))return!o||o.call(this,e,t,n);var s=r.__c.props!==e;return a.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}}),o&&o.call(this,e,t,n)||s};J.__f=!0;var o=J.shouldComponentUpdate,a=J.componentWillUpdate;J.componentWillUpdate=function(e,t,r){if(this.__e){var s=o;o=void 0,n(e,t,r),o=s}a&&a.call(this,e,t,r)},J.shouldComponentUpdate=n}return r.__N||r.__}(Se,e)}function de(e,t){var r=ce(K++,3);!re.__s&&Re(r.__H,t)&&(r.__=e,r.u=t,J.__H.__h.push(r))}function he(e,t){var r=ce(K++,4);!re.__s&&Re(r.__H,t)&&(r.__=e,r.u=t,J.__h.push(r))}function pe(e){return ee=5,fe(function(){return{current:e}},[])}function fe(e,t){var r=ce(K++,7);return Re(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function me(e,t){return ee=8,fe(function(){return e},t)}function ge(e){var t=J.context[e.__c],r=ce(K++,9);return r.c=e,t?(r.__??(r.__=!0,t.sub(J)),t.props.value):e.__}function ye(){var e=ce(K++,11);if(!e.__){for(var t=J.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function _e(){for(var e;e=te.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(we),t.__h.some(Ee),t.__h=[]}catch(yn){t.__h=[],re.__e(yn,e.__v)}}}re.__b=function(e){J=null,ne&&ne(e)},re.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),le&&le(e,t)},re.__r=function(e){oe&&oe(e),K=0;var t=(J=e.__c).__H;t&&(Y===J?(t.__h=[],J.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(we),t.__h.some(Ee),t.__h=[],K=0)),Y=J},re.diffed=function(e){ae&&ae(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==te.push(t)&&X===re.requestAnimationFrame||((X=re.requestAnimationFrame)||ve)(_e)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Y=J=null},re.__c=function(e,t){t.some(function(e){try{e.__h.some(we),e.__h=e.__h.filter(function(e){return!e.__||Ee(e)})}catch(yn){t.some(function(e){e.__h&&(e.__h=[])}),t=[],re.__e(yn,e.__v)}}),se&&se(e,t)},re.unmount=function(e){ie&&ie(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(e){try{we(e)}catch(e){t=e}}),r.__H=void 0,t&&re.__e(t,r.__v))};var be="function"==typeof requestAnimationFrame;function ve(e){var t,r=function(){clearTimeout(n),be&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);be&&(t=requestAnimationFrame(r))}function we(e){var t=J,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),J=t}function Ee(e){var t=J;e.__c=e.__(),J=t}function Re(e,t){return!e||e.length!==t.length||t.some(function(t,r){return t!==e[r]})}function Se(e,t){return"function"==typeof t?t(e):t}var xe=class{constructor(){this.listeners=/* @__PURE__ */new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ke=new class extends xe{#e;#t;#r;constructor(){super(),this.#r=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}},Te={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ce=new class{#n=Te;#o=!1;setTimeoutProvider(e){"production"!==process.env.NODE_ENV&&this.#o&&e!==this.#n&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#n,provider:e}),this.#n=e,"production"!==process.env.NODE_ENV&&(this.#o=!1)}setTimeout(e,t){return"production"!==process.env.NODE_ENV&&(this.#o=!0),this.#n.setTimeout(e,t)}clearTimeout(e){this.#n.clearTimeout(e)}setInterval(e,t){return"production"!==process.env.NODE_ENV&&(this.#o=!0),this.#n.setInterval(e,t)}clearInterval(e){this.#n.clearInterval(e)}},Oe="undefined"==typeof window||"Deno"in globalThis;function Ae(){}function Ne(e,t){return"function"==typeof e?e(t):e}function Pe(e){return"number"==typeof e&&e>=0&&e!==1/0}function Ie(e,t){return Math.max(e+(t||0)-Date.now(),0)}function De(e,t){return"function"==typeof e?e(t):e}function Le(e,t){return"function"==typeof e?e(t):e}function $e(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:a,queryKey:s,stale:i}=e;if(s)if(n){if(t.queryHash!==Me(s,t.options))return!1}else if(!qe(t.queryKey,s))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return!("boolean"==typeof i&&t.isStale()!==i||o&&o!==t.state.fetchStatus||a&&!a(t))}function Ue(e,t){const{exact:r,status:n,predicate:o,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(Fe(t.options.mutationKey)!==Fe(a))return!1}else if(!qe(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function Me(e,t){return(t?.queryKeyHashFn||Fe)(e)}function Fe(e){return JSON.stringify(e,(e,t)=>Ge(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function qe(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>qe(e[r],t[r]))}var je=Object.prototype.hasOwnProperty;function ze(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=He(e)&&He(t);if(!(n||Ge(e)&&Ge(t)))return t;const o=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),s=a.length,i=n?new Array(s):{};let l=0;for(let c=0;c<s;c++){const s=n?c:a[c],u=e[s],d=t[s];if(u===d){i[s]=u,(n?c<o:je.call(e,s))&&l++;continue}if(null===u||null===d||"object"!=typeof u||"object"!=typeof d){i[s]=d;continue}const h=ze(u,d,r+1);i[s]=h,h===u&&l++}return o===s&&l===o?e:i}function We(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function He(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ge(e){if(!Ve(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!Ve(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function Ve(e){return"[object Object]"===Object.prototype.toString.call(e)}function Be(e,t,r){if("function"==typeof r.structuralSharing)return r.structuralSharing(e,t);if(!1!==r.structuralSharing){if("production"!==process.env.NODE_ENV)try{return ze(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return ze(e,t)}return t}function Qe(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Ze(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Ke=/* @__PURE__ */Symbol();function Je(e,t){return"production"!==process.env.NODE_ENV&&e.queryFn===Ke&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==Ke?e.queryFn:()=>Promise.reject(/* @__PURE__ */new Error(`Missing queryFn: '${e.queryHash}'`))}function Ye(e,t){return"function"==typeof e?e(...t):!!e}function Xe(e,t,r){let n,o=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??=t(),o||(o=!0,n.aborted?r():n.addEventListener("abort",r,{once:!0})),n)}),e}var et=/* @__PURE__ */(()=>{let e=()=>Oe;return{isServer:()=>e(),setIsServer(t){e=t}}})();function tt(){let e,t;const r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}var rt=function(e){setTimeout(e,0)},nt=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},o=rt;const a=n=>{t?e.push(n):o(()=>{r(n)})};return{batch:a=>{let s;t++;try{s=a()}finally{t--,t||(()=>{const t=e;e=[],t.length&&o(()=>{n(()=>{t.forEach(e=>{r(e)})})})})()}return s},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{o=e}}}(),ot=new class extends xe{#a=!0;#t;#r;constructor(){super(),this.#r=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#a!==e&&(this.#a=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#a}};function at(e){return Math.min(1e3*2**e,3e4)}function st(e){return"online"!==(e??"online")||ot.isOnline()}var it=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function lt(e){let t,r=!1,n=0;const o=tt(),a=()=>"pending"!==o.status,s=()=>ke.isFocused()&&("always"===e.networkMode||ot.isOnline())&&e.canRun(),i=()=>st(e.networkMode)&&e.canRun(),l=e=>{a()||(t?.(),o.resolve(e))},c=e=>{a()||(t?.(),o.reject(e))},u=()=>new Promise(r=>{t=e=>{(a()||s())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,a()||e.onContinue?.()}),d=()=>{if(a())return;let t;const o=0===n?e.initialPromise:void 0;try{t=o??e.fn()}catch(i){t=Promise.reject(i)}Promise.resolve(t).then(l).catch(t=>{if(a())return;const o=e.retry??(et.isServer()?0:3),i=e.retryDelay??at,l="function"==typeof i?i(n,t):i,h=!0===o||"number"==typeof o&&n<o||"function"==typeof o&&o(n,t);var p;!r&&h?(n++,e.onFail?.(n,t),(p=l,new Promise(e=>{Ce.setTimeout(e,p)})).then(()=>s()?void 0:u()).then(()=>{r?c(t):d()})):c(t)})};return{promise:o,status:()=>o.status,cancel:t=>{if(!a()){const r=new it(t);c(r),e.onCancel?.(r)}},continue:()=>(t?.(),o),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:i,start:()=>(i()?d():u().then(d),o)}}var ct=class{#s;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Pe(this.gcTime)&&(this.#s=Ce.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(et.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#s&&(Ce.clearTimeout(this.#s),this.#s=void 0)}},ut=class extends ct{#i;#l;#c;#u;#d;#h;#p;constructor(e){super(),this.#p=!1,this.#h=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#u=e.client,this.#c=this.#u.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#i=pt(this.options),this.state=e.state??this.#i,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#h,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=pt(this.options);void 0!==e.data&&(this.setState(ht(e.data,e.dataUpdatedAt)),this.#i=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(e,t){const r=Be(this.state.data,e,this.options);return this.#f({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#d?.promise;return this.#d?.cancel(e),t?t.then(Ae).catch(Ae):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#i}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==Le(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ke||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===De(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!Ie(this.state.dataUpdatedAt,e))}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#c.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#d&&(this.#p||this.#m()?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#m(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#d?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}"production"!==process.env.NODE_ENV&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,r.signal)})},o=()=>{const e=Je(this.options,t),r=(()=>{const e={client:this.#u,queryKey:this.queryKey,meta:this.meta};return n(e),e})();return this.#p=!1,this.options.persister?this.options.persister(e,r,this):e(r)},a=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#u,state:this.state,fetchFn:o};return n(e),e})();this.options.behavior?.onFetch(a,this),this.#l=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===a.fetchOptions?.meta||this.#f({type:"fetch",meta:a.fetchOptions?.meta}),this.#d=lt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof it&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const e=await this.#d.start();if(void 0===e)throw"production"!==process.env.NODE_ENV&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#c.config.onSuccess?.(e,this),this.#c.config.onSettled?.(e,this.state.error,this),e}catch(s){if(s instanceof it){if(s.silent)return this.#d.promise;if(s.revert){if(void 0===this.state.data)throw s;return this.state.data}}throw this.#f({type:"error",error:s}),this.#c.config.onError?.(s,this),this.#c.config.onSettled?.(this.state.data,s,this),s}finally{this.scheduleGc()}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...dt(t.data,this.options),fetchMeta:e.meta??null};case"success":const r={...t,...ht(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":const n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),nt.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#c.notify({query:this,type:"updated",action:e})})}};function dt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:st(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function ht(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function pt(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var ft=class extends xe{constructor(e,t){super(),this.options=t,this.#u=e,this.#g=null,this.#y=tt(),this.bindMethods(),this.setOptions(t)}#u;#_=void 0;#b=void 0;#v=void 0;#w;#E;#y;#g;#R;#S;#x;#k;#T;#C;#O=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#_.addObserver(this),mt(this.#_,this.options)?this.#A():this.updateResult(),this.#N())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return gt(this.#_,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return gt(this.#_,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#P(),this.#I(),this.#_.removeObserver(this)}setOptions(e){const t=this.options,r=this.#_;if(this.options=this.#u.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof Le(this.options.enabled,this.#_))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#D(),this.#_.setOptions(this.options),t._defaulted&&!We(this.options,t)&&this.#u.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#_,observer:this});const n=this.hasListeners();n&&yt(this.#_,r,this.options,t)&&this.#A(),this.updateResult(),!n||this.#_===r&&Le(this.options.enabled,this.#_)===Le(t.enabled,this.#_)&&De(this.options.staleTime,this.#_)===De(t.staleTime,this.#_)||this.#L();const o=this.#$();!n||this.#_===r&&Le(this.options.enabled,this.#_)===Le(t.enabled,this.#_)&&o===this.#C||this.#U(o)}getOptimisticResult(e){const t=this.#u.getQueryCache().build(this.#u,e),r=this.createResult(t,e);var n;return n=r,We(this.getCurrentResult(),n)||(this.#v=r,this.#E=this.options,this.#w=this.#_.state),r}getCurrentResult(){return this.#v}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#y.status||this.#y.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#O.add(e)}getCurrentQuery(){return this.#_}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#u.defaultQueryOptions(e),r=this.#u.getQueryCache().build(this.#u,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#A({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#v))}#A(e){this.#D();let t=this.#_.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Ae)),t}#L(){this.#P();const e=De(this.options.staleTime,this.#_);if(et.isServer()||this.#v.isStale||!Pe(e))return;const t=Ie(this.#v.dataUpdatedAt,e)+1;this.#k=Ce.setTimeout(()=>{this.#v.isStale||this.updateResult()},t)}#$(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#_):this.options.refetchInterval)??!1}#U(e){this.#I(),this.#C=e,!et.isServer()&&!1!==Le(this.options.enabled,this.#_)&&Pe(this.#C)&&0!==this.#C&&(this.#T=Ce.setInterval(()=>{(this.options.refetchIntervalInBackground||ke.isFocused())&&this.#A()},this.#C))}#N(){this.#L(),this.#U(this.#$())}#P(){void 0!==this.#k&&(Ce.clearTimeout(this.#k),this.#k=void 0)}#I(){void 0!==this.#T&&(Ce.clearInterval(this.#T),this.#T=void 0)}createResult(e,t){const r=this.#_,n=this.options,o=this.#v,a=this.#w,s=this.#E,i=e!==r?e.state:this.#b,{state:l}=e;let c,u={...l},d=!1;if(t._optimisticResults){const o=this.hasListeners(),a=!o&&mt(e,t),s=o&&yt(e,r,t,n);(a||s)&&(u={...u,...dt(l.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:h,errorUpdatedAt:p,status:f}=u;c=u.data;let m=!1;if(void 0!==t.placeholderData&&void 0===c&&"pending"===f){let e;o?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=o.data,m=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#x?.state.data,this.#x):t.placeholderData,void 0!==e&&(f="success",c=Be(o?.data,e,t),d=!0)}if(t.select&&void 0!==c&&!m)if(o&&c===a?.data&&t.select===this.#R)c=this.#S;else try{this.#R=t.select,c=t.select(c),c=Be(o?.data,c,t),this.#S=c,this.#g=null}catch(E){this.#g=E}this.#g&&(h=this.#g,c=this.#S,p=Date.now(),f="error");const g="fetching"===u.fetchStatus,y="pending"===f,_="error"===f,b=y&&g,v=void 0!==c,w={status:f,fetchStatus:u.fetchStatus,isPending:y,isSuccess:"success"===f,isError:_,isInitialLoading:b,isLoading:b,data:c,dataUpdatedAt:u.dataUpdatedAt,error:h,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>i.dataUpdateCount||u.errorUpdateCount>i.errorUpdateCount,isFetching:g,isRefetching:g&&!y,isLoadingError:_&&!v,isPaused:"paused"===u.fetchStatus,isPlaceholderData:d,isRefetchError:_&&v,isStale:_t(e,t),refetch:this.refetch,promise:this.#y,isEnabled:!1!==Le(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==w.data,n="error"===w.status&&!t,o=e=>{n?e.reject(w.error):t&&e.resolve(w.data)},a=()=>{o(this.#y=w.promise=tt())},s=this.#y;switch(s.status){case"pending":e.queryHash===r.queryHash&&o(s);break;case"fulfilled":(n||w.data!==s.value)&&a();break;case"rejected":n&&w.error===s.reason||a()}}return w}updateResult(){const e=this.#v,t=this.createResult(this.#_,this.options);this.#w=this.#_.state,this.#E=this.options,void 0!==this.#w.data&&(this.#x=this.#_),We(t,e)||(this.#v=t,this.#M({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#O.size)return!0;const n=new Set(r??this.#O);return this.options.throwOnError&&n.add("error"),Object.keys(this.#v).some(t=>{const r=t;return this.#v[r]!==e[r]&&n.has(r)})})()}))}#D(){const e=this.#u.getQueryCache().build(this.#u,this.options);if(e===this.#_)return;const t=this.#_;this.#_=e,this.#b=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#N()}#M(e){nt.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#v)}),this.#u.getQueryCache().notify({query:this.#_,type:"observerResultsUpdated"})})}};function mt(e,t){return function(e,t){return!1!==Le(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&>(e,t,t.refetchOnMount)}function gt(e,t,r){if(!1!==Le(t.enabled,e)&&"static"!==De(t.staleTime,e)){const n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&_t(e,t)}return!1}function yt(e,t,r,n){return(e!==t||!1===Le(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&_t(e,r)}function _t(e,t){return!1!==Le(t.enabled,e)&&e.isStaleByTime(De(t.staleTime,e))}var bt=e.createContext(void 0),vt=t=>{const r=e.useContext(bt);if(t)return t;if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},wt=({client:r,children:n})=>(e.useEffect(()=>(r.mount(),()=>{r.unmount()}),[r]),/* @__PURE__ */t(bt.Provider,{value:r,children:n})),Et=e.createContext(!1);Et.Provider;var Rt=e.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),St=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function xt(t,r,n){if("production"!==process.env.NODE_ENV&&("object"!=typeof t||Array.isArray(t)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const o=e.useContext(Et),a=e.useContext(Rt),s=vt(n),i=s.defaultQueryOptions(t);s.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const l=s.getQueryCache().get(i.queryHash);"production"!==process.env.NODE_ENV&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),i._optimisticResults=o?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(e??t,t),n=e.staleTime;e.staleTime="function"==typeof n?(...e)=>r(n(...e)):r(n),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(i),((e,t,r)=>{const n=r?.state.error&&"function"==typeof e.throwOnError?Ye(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))})(i,a,l),(t=>{e.useEffect(()=>{t.clearReset()},[t])})(a);const c=!s.getQueryCache().get(i.queryHash),[u]=e.useState(()=>new r(s,i)),d=u.getOptimisticResult(i),h=!o&&!1!==t.subscribed;if(e.useSyncExternalStore(e.useCallback(e=>{const t=h?u.subscribe(nt.batchCalls(e)):Ae;return u.updateResult(),t},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),e.useEffect(()=>{u.setOptions(i)},[i,u]),((e,t)=>e?.suspense&&t.isPending)(i,d))throw St(i,u,a);if((({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(o&&void 0===e.data||Ye(r,[e.error,n])))({result:d,errorResetBoundary:a,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw d.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(i,d),i.experimental_prefetchInRender&&!et.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(d,o)&&(c?St(i,u,a):l?.promise)?.catch(Ae).finally(()=>{u.updateResult()}),i.notifyOnChangeProps?d:u.trackResult(d)}function kt(e,t){return xt(e,ft,t)}function Tt(e,t){for(var r in e)if("__source"!==r&&!(r in t))return!0;for(var n in t)if("__source"!==n&&e[n]!==t[n])return!0;return!1}function Ct(e,t){this.props=e,this.context=t}(Ct.prototype=new k).isPureReactComponent=!0,Ct.prototype.shouldComponentUpdate=function(e,t){return Tt(this.props,e)||Tt(this.state,t)};var Ot=n.__b;n.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ot&&Ot(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var At=n.__e;n.__e=function(e,t,r,n){if(e.then)for(var o,a=t;a=a.__;)if((o=a.__c)&&o.__c)return t.__e??(t.__e=r.__e,t.__k=r.__k),o.__c(e,t);At(e,t,r,n)};var Nt=n.unmount;function Pt(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=function(e,t){for(var r in t)e[r]=t[r];return e}({},e)).__c&&(e.__c.__P===r&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Pt(e,t,r)})),e}function It(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return It(e,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function Dt(){this.__u=0,this.o=null,this.__b=null}function Lt(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function $t(e){var t,r,n,o=null;function a(a){if(t||(t=e()).then(function(e){e&&(o=e.default||e),n=!0},function(e){r=e,n=!0}),r)throw r;if(!n)throw t;return o?R(o,a):null}return a.displayName="Lazy",a.__f=!0,a}function Ut(){this.i=null,this.l=null}n.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Nt&&Nt(e)},(Dt.prototype=new k).__c=function(e,t){var r=t.__c,n=this;n.o??=[],n.o.push(r);var o=Lt(n.__v),a=!1,s=function(){a||n.__z||(a=!0,r.__R=null,o?o(l):l())};r.__R=s;var i=r.__P;r.__P=null;var l=function(){if(! --n.__u){if(n.state.__a){var e=n.state.__a;n.__v.__k[0]=It(e,e.__c.__P,e.__c.__O)}var t;for(n.setState({__a:n.__b=null});t=n.o.pop();)t.__P=i,t.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(s,s)},Dt.prototype.componentWillUnmount=function(){this.o=[]},Dt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Pt(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&R(x,null,e.fallback);return o&&(o.__u&=-33),[R(x,null,t.__a?null:e.children),o]};var Mt=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};function Ft(e){return this.getChildContext=function(){return e.context},e.children}function qt(e){var t=this,r=e.h;if(t.componentWillUnmount=function(){B(null,t.v),t.v=null,t.h=null},t.h&&t.h!==r&&t.componentWillUnmount(),!t.v){for(var n=t.__v;null!==n&&!n.__m&&null!==n.__;)n=n.__;t.h=r,t.v={nodeType:1,parentNode:r,childNodes:[],__k:{__m:n.__m},contains:function(){return!0},namespaceURI:r.namespaceURI,insertBefore:function(e,r){this.childNodes.push(e),t.h.insertBefore(e,r)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}B(R(Ft,{context:t.context},e.__v),t.v)}function jt(e,t){var r=R(qt,{__v:e,h:t});return r.containerInfo=t,r}(Ut.prototype=new k).__a=function(e){var t=this,r=Lt(t.__v),n=t.l.get(e);return n[0]++,function(o){var a=function(){t.props.revealOrder?(n.push(o),Mt(t,e,n)):o()};r?r(a):a()}},Ut.prototype.render=function(e){this.i=null,this.l=/* @__PURE__ */new Map;var t=D(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},Ut.prototype.componentDidUpdate=Ut.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Mt(e,r,t)})};var zt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Wt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ht=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Gt=/[A-Z0-9]/g,Vt="undefined"!=typeof document,Bt=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};k.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(k.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Qt=n.event;n.event=function(e){return Qt&&(e=Qt(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Zt={configurable:!0,get:function(){return this.class}},Kt=n.vnode;n.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,r=e.type,n={},o=-1==r.indexOf("-");for(var a in t){var s=t[a];if(!("value"===a&&"defaultValue"in t&&null==s||Vt&&"children"===a&&"noscript"===r||"class"===a||"className"===a)){var i=a.toLowerCase();"defaultValue"===a&&"value"in t&&null==t.value?a="value":"download"===a&&!0===s?s="":"translate"===i&&"no"===s?s=!1:"o"===i[0]&&"n"===i[1]?"ondoubleclick"===i?a="ondblclick":"onchange"!==i||"input"!==r&&"textarea"!==r||Bt(t.type)?"onfocus"===i?a="onfocusin":"onblur"===i?a="onfocusout":Ht.test(a)&&(a=i):i=a="oninput":o&&Wt.test(a)?a=a.replace(Gt,"-$&").toLowerCase():null===s&&(s=void 0),"oninput"===i&&n[a=i]&&(a="oninputCapture"),n[a]=s}}"select"==r&&(n.multiple&&Array.isArray(n.value)&&(n.value=D(t.children).forEach(function(e){e.props.selected=-1!=n.value.indexOf(e.props.value)})),null!=n.defaultValue&&(n.value=D(t.children).forEach(function(e){e.props.selected=n.multiple?-1!=n.defaultValue.indexOf(e.props.value):n.defaultValue==e.props.value}))),t.class&&!t.className?(n.class=t.class,Object.defineProperty(n,"className",Zt)):t.className&&(n.class=n.className=t.className),e.props=n}(e),e.$$typeof=zt,Kt&&Kt(e)};var Jt=n.__r;n.__r=function(e){Jt&&Jt(e),e.__c};var Yt=n.diffed;n.diffed=function(e){Yt&&Yt(e);var t=e.props,r=e.__e;null!=r&&"textarea"===e.type&&"value"in t&&t.value!==r.value&&(r.value=null==t.value?"":t.value)};var Xt=class extends Error{response;request;options;constructor(e,t,r){const n=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${n?`status code ${n}`:"an unknown error"}: ${t.method} ${t.url}`),this.name="HTTPError",this.response=e,this.request=t,this.options=r}},er=class extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}},tr=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new er(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},rr=(()=>{let e=!1,t=!1;const r="function"==typeof globalThis.ReadableStream,n="function"==typeof globalThis.Request;if(r&&n)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(o){if(o instanceof Error&&"unsupported BodyInit type"===o.message)return!1;throw o}return e&&!t})(),nr="function"==typeof globalThis.AbortController,or="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,ar="function"==typeof globalThis.ReadableStream,sr="function"==typeof globalThis.FormData,ir=["get","post","put","patch","head","delete"],lr={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},cr=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,ur=Symbol("stop"),dr=class{options;constructor(e){this.options=e}},hr=e=>new dr(e),pr={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},fr={next:!0},mr={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},gr=(e,t,r)=>{let n,o=0;return e.pipeThrough(new TransformStream({transform(e,a){if(a.enqueue(e),n){o+=n.byteLength;let e=0===t?0:o/t;e>=1&&(e=1-Number.EPSILON),r?.({percent:e,totalBytes:Math.max(t,o),transferredBytes:o},n)}n=e},flush(){n&&(o+=n.byteLength,r?.({percent:1,totalBytes:Math.max(t,o),transferredBytes:o},n))}}))},yr=e=>null!==e&&"object"==typeof e,_r=(...e)=>{for(const t of e)if((!yr(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return Rr({},...e)},br=(e={},t={})=>{const r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,o=new globalThis.Headers(t);for(const[a,s]of o.entries())n&&"undefined"===s||void 0===s?r.delete(a):r.set(a,s);return r};function vr(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:Rr(e[r]??[],t[r]??[])}var wr=(e={},t={})=>({beforeRequest:vr(e,t,"beforeRequest"),beforeRetry:vr(e,t,"beforeRetry"),afterResponse:vr(e,t,"afterResponse"),beforeError:vr(e,t,"beforeError")}),Er=(e,t)=>{const r=new URLSearchParams;for(const n of[e,t])if(void 0!==n)if(n instanceof URLSearchParams)for(const[e,t]of n.entries())r.append(e,t);else if(Array.isArray(n))for(const e of n){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(e[0]),String(e[1]))}else if(yr(n))for(const[e,t]of Object.entries(n))void 0!==t&&r.append(e,String(t));else{const e=new URLSearchParams(n);for(const[t,n]of e.entries())r.append(t,n)}return r},Rr=(...e)=>{let t,r={},n={},o={};const a=[];for(const s of e)if(Array.isArray(s))Array.isArray(r)||(r=[]),r=[...r,...s];else if(yr(s)){for(let[e,n]of Object.entries(s))if("signal"===e&&n instanceof globalThis.AbortSignal)a.push(n);else if("context"!==e)"searchParams"!==e?(yr(n)&&e in r&&(n=Rr(r[e],n)),r={...r,[e]:n}):t=null==n?void 0:void 0===t?n:Er(t,n);else{if(null!=n&&(!yr(n)||Array.isArray(n)))throw new TypeError("The `context` option must be an object");r={...r,context:null==n?{}:{...r.context,...n}}}yr(s.hooks)&&(o=wr(o,s.hooks),r.hooks=o),yr(s.headers)&&(n=br(n,s.headers),r.headers=n)}return void 0!==t&&(r.searchParams=t),a.length>0&&(1===a.length?r.signal=a[0]:r.signal=or?AbortSignal.any(a):a.at(-1)),r},Sr=e=>ir.includes(e)?e.toUpperCase():e,xr={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},kr=(e={})=>{if("number"==typeof e)return{...xr,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&=e.methods.map(e=>e.toLowerCase()),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e));return{...xr,...t}},Tr=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}},Cr=class e{static create(t,r){const n=new e(t,r),o=n.#F(async()=>{if("number"==typeof n.#q.timeout&&n.#q.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await n.#j();for(const r of n.#q.hooks.afterResponse){const o=n.#z(e.clone());let a;try{a=await r(n.request,n.#W(),o,{retryCount:n.#H})}catch(t){throw n.#G(o),n.#G(e),t}if(a instanceof dr)throw n.#G(o),n.#G(e),new tr(a.options);const s=a instanceof globalThis.Response?a:e;o!==s&&n.#G(o),e!==s&&n.#G(e),e=s}if(n.#z(e),!e.ok&&("function"==typeof n.#q.throwHttpErrors?n.#q.throwHttpErrors(e.status):n.#q.throwHttpErrors)){let t=new Xt(e,n.request,n.#W());for(const e of n.#q.hooks.beforeError)t=await e(t,{retryCount:n.#H});throw t}if(n.#q.onDownloadProgress){if("function"!=typeof n.#q.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!ar)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const t=e.clone();return n.#G(e),((e,t)=>{if(!e.body)return e;if(204===e.status)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});const r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(gr(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})})(t,n.#q.onDownloadProgress)}return e}).finally(()=>{const e=n.#V;n.#B(e?.body??void 0),n.#B(n.request.body??void 0)});for(const[e,a]of Object.entries(lr))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(o[e]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||a);const t=await o;if("json"===e){if(204===t.status)return"";const e=await t.text();return""===e?"":r.parseJson?r.parseJson(e):JSON.parse(e)}return t[e]()});return o}static#Q(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#Z;#H=0;#K;#q;#V;#J;#Y;constructor(t,r={}){if(this.#K=t,this.#q={...r,headers:br(this.#K.headers,r.headers),hooks:wr({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Sr(r.method??this.#K.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:kr(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},"string"!=typeof this.#K&&!(this.#K instanceof URL||this.#K instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#q.prefixUrl&&"string"==typeof this.#K){if(this.#K.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#q.prefixUrl.endsWith("/")||(this.#q.prefixUrl+="/"),this.#K=this.#q.prefixUrl+this.#K}nr&&or&&(this.#J=this.#q.signal??this.#K.signal,this.#Z=new globalThis.AbortController,this.#q.signal=this.#J?AbortSignal.any([this.#J,this.#Z.signal]):this.#Z.signal),rr&&(this.#q.duplex="half"),void 0!==this.#q.json&&(this.#q.body=this.#q.stringifyJson?.(this.#q.json)??JSON.stringify(this.#q.json),this.#q.headers.set("content-type",this.#q.headers.get("content-type")??"application/json"));const n=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#K instanceof globalThis.Request&&(sr&&this.#q.body instanceof globalThis.FormData||this.#q.body instanceof URLSearchParams)&&!n&&this.#q.headers.delete("content-type"),this.request=new globalThis.Request(this.#K,this.#q),void 0!==(o=this.#q.searchParams)&&(Array.isArray(o)?o.length>0:o instanceof URLSearchParams?o.size>0:"object"==typeof o?Object.keys(o).length>0:"string"==typeof o?o.trim().length>0:Boolean(o))){const t="?"+("string"==typeof this.#q.searchParams?this.#q.searchParams.replace(/^\?/,""):new URLSearchParams(e.#Q(this.#q.searchParams)).toString()),r=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);this.request=new globalThis.Request(r,this.#q)}var o;if(this.#q.onUploadProgress){if("function"!=typeof this.#q.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!rr)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#X(this.request,this.#q.body??void 0)}}#ee(){const e=this.#q.retry.delay(this.#H);let t=e;!0===this.#q.retry.jitter?t=Math.random()*e:"function"==typeof this.#q.retry.jitter&&(t=this.#q.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e));const r=this.#q.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,t)}async#te(e){if(this.#H++,this.#H>this.#q.retry.limit)throw e;const t=e instanceof Error?e:new er(e);if(t instanceof tr)return t.customDelay??this.#ee();if(!this.#q.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#q.retry.shouldRetry){const r=await this.#q.retry.shouldRetry({error:t,retryCount:this.#H});if(!1===r)throw e;if(!0===r)return this.#ee()}if(function(e){return e instanceof Tr||e?.name===Tr.name}(e)&&!this.#q.retry.retryOnTimeout)throw e;if(function(e){return e instanceof Xt||e?.name===Xt.name}(e)){if(!this.#q.retry.statusCodes.includes(e.response.status))throw e;const t=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(t&&this.#q.retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now());const r=this.#q.retry.maxRetryAfter??e;return e<r?e:r}if(413===e.response.status)throw e}return this.#ee()}#z(e){return this.#q.parseJson&&(e.json=async()=>this.#q.parseJson(await e.text())),e}#B(e){e&&e.cancel().catch(()=>{})}#G(e){this.#B(e.body??void 0)}async#F(e){try{return await e()}catch(t){const r=Math.min(await this.#te(t),2147483647);if(this.#H<1)throw t;if(await async function(e,{signal:t}){return new Promise((r,n)=>{function o(){clearTimeout(a),n(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));const a=setTimeout(()=>{t?.removeEventListener("abort",o),r()},e)})}(r,this.#J?{signal:this.#J}:{}),t instanceof tr&&t.customRequest){const e=this.#q.signal?new globalThis.Request(t.customRequest,{signal:this.#q.signal}):new globalThis.Request(t.customRequest);this.#re(e)}for(const e of this.#q.hooks.beforeRetry){const r=await e({request:this.request,options:this.#W(),error:t,retryCount:this.#H});if(r instanceof globalThis.Request){this.#re(r);break}if(r instanceof globalThis.Response)return r;if(r===ur)return}return this.#F(e)}}async#j(){this.#Z?.signal.aborted&&(this.#Z=new globalThis.AbortController,this.#q.signal=this.#J?AbortSignal.any([this.#J,this.#Z.signal]):this.#Z.signal,this.request=new globalThis.Request(this.request,{signal:this.#q.signal}));for(const t of this.#q.hooks.beforeRequest){const e=await t(this.request,this.#W(),{retryCount:this.#H});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#re(e);break}}const e=((e,t)=>{const r={};for(const n in t)Object.hasOwn(t,n)&&(n in mr||n in pr||n in e&&!(n in fr)||(r[n]=t[n]));return r})(this.request,this.#q);return this.#V=this.request,this.request=this.#V.clone(),!1===this.#q.timeout?this.#q.fetch(this.#V,e):async function(e,t,r,n){return new Promise((o,a)=>{const s=setTimeout(()=>{r&&r.abort(),a(new Tr(e))},n.timeout);n.fetch(e,t).then(o).catch(a).then(()=>{clearTimeout(s)})})}(this.#V,e,this.#Z,this.#q)}#W(){if(!this.#Y){const{hooks:e,...t}=this.#q;this.#Y=Object.freeze(t)}return this.#Y}#re(e){this.#Y=void 0,this.request=this.#X(e)}#X(e,t){return this.#q.onUploadProgress&&e.body?((e,t,r)=>{if(!e.body)return e;const n=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,n]of e)t+=cr,t+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${r}"`).length,t+="string"==typeof n?(new TextEncoder).encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if("string"==typeof e)return(new TextEncoder).encode(e).length;if(e instanceof URLSearchParams)return(new TextEncoder).encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if("object"==typeof e&&null!==e)try{const t=JSON.stringify(e);return(new TextEncoder).encode(t).length}catch{return 0}return 0})(r??e.body);return new Request(e,{duplex:"half",body:gr(e.body,n,t)})})(e,this.#q.onUploadProgress,t??this.#q.body??void 0):e}},Or=e=>{const t=(t,r)=>Cr.create(t,_r(e,r));for(const r of ir)t[r]=(t,n)=>Cr.create(t,_r(e,n,{method:r}));return t.create=e=>Or(_r(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),Or(_r(e,t))),t.stop=ur,t.retry=hr,t},Ar=Or(),Nr={PUBLIC_EVENTS:"/",FOLDER_EVENTS:e=>`/${e}`,LOGIN:"/auth/login",REGISTER:"/auth/register",FORGOT_PASSWORD:"/auth/forgot-password",RESET_PASSWORD:"/auth/reset-password",VERIFY_EMAIL:"/auth/verify-email",GALLERY:e=>`/event/${e}`,UPLOAD:e=>`/event/${e}/upload`,CURATE:e=>`/event/${e}/curate`,LEADERBOARD:e=>`/event/${e}/leaderboard`},Pr={ORGANIZATION_SETTINGS:e=>`https://beta.qratilabs.com/org/${e}/settings`,ORGANIZATION_SETTINGS_INTEGRATION:e=>`https://beta.qratilabs.com/org/${e}/settings/integration`,ORGANIZATION_DASHBOARD:e=>`https://beta.qratilabs.com/org/${e}/dashboard`,ORGANIZATION_ADMINS:e=>`https://beta.qratilabs.com/org/${e}/admins`,EVENT_SETTINGS_BASIC_DETAILS:e=>`https://beta.qratilabs.com/event/${e}/settings`,EVENT_REVIEW_CONTENTS:e=>`https://beta.qratilabs.com/event/${e}/review-contents`,EVENT_DEEP_SEARCH:e=>`https://beta.qratilabs.com/event/${e}/deep-search`,EVENT_GENERATE_ARTICLE:e=>`https://beta.qratilabs.com/event/${e}/generate-article`,EVENT_ACCESS_REQUESTS:e=>`https://beta.qratilabs.com/event/${e}/access-requests`,EVENT_SHOT_INSPECTOR:e=>`https://beta.qratilabs.com/event/${e}/shot-inspector`,EVENT_CURATION_DETAILS:e=>`https://beta.qratilabs.com/event/${e}/curation-details`},Ir={PUBLIC:"PUBLIC",PRIVATE:"PRIVATE",SECRET:"SECRET"},Dr="https://beta.qratilabs.com/api/connect",Lr={INITIALIZE_SESSION:`${Dr}/session/initialize`,REGISTER:`${Dr}/auth/register`,LOGIN:`${Dr}/auth/login`,LOGOUT:`${Dr}/auth/logout`,UPDATE_SESSION:`${Dr}/session/update`,ACCEPT_TERMS:`${Dr}/auth/accept-terms`,EXTERNAL_LOGIN:`${Dr}/auth/external-login`,PUBLIC_EVENTS:`${Dr}/event/public-events`,SEARCH_EVENTS:`${Dr}/event/search`,FOLDER_DETAILS:`${Dr}/folder/details`,NESTED_FOLDERS:`${Dr}/folder/nested-folders`,GET_EVENT_POINTS:`${Dr}/event/points`,ELIGIBLE_TO_CURATE:`${Dr}/content/curation-eligibility`,CONTENT_FOR_CURATION:`${Dr}/content/for-curation`,CURATE_CONTENT:`${Dr}/content/curate`,GET_LEADERBOARD:`${Dr}/event/leaderboard`,GET_UPLOAD_COUNT:`${Dr}/event/upload-count`,SINGLE_UPLOAD:`${Dr}/content/single-upload`,UPDATE_REACTION:`${Dr}/content/update-reaction`,EVENT_DATA:`${Dr}/event/details-with-ads-parameters`,UPDATE_EVENT_LAYOUT:`${Dr}/event/update-layout`,GET_EVENT_STATISTICS:`${Dr}/event/statistics`,GET_CONTENTS:`${Dr}/content/for-gallery`,SEARCH_CONTENTS:`${Dr}/content/search`,GET_CONTENTS_COUNT:`${Dr}/content/count`,UPDATE_AD_ANALYTICS:`${Dr}/event/update-ad-analytics`,UPDATE_GAM_ANALYTICS:`${Dr}/event/update-gam-analytics`,INCREMENT_EVENT_VIEW:`${Dr}/event/increment-view`,SEND_PASSWORD_RESET_CODE:`${Dr}/auth/send-password-reset-code`,VERIFY_PASSWORD_RESET_CODE:`${Dr}/auth/verify-password-reset-code`,RESET_PASSWORD:`${Dr}/auth/reset-password`,REPORT_ERROR:`${Dr}/session/report-error`},$r={OWNER:"owner",ADMIN:"admin",MODERATOR:"moderator"},Ur={IMAGE:"IMAGE",VIDEO:"VIDEO",AD:"AD",GAM_AD:"GAM_AD"},Mr={GAM_IMPRESSION:"gam_impression",GAM_VIEWABLE:"gam_viewable",GAM_CLICK:"gam_click"},Fr={ROW:"ROW",COLUMN:"COLUMN",MASONRY:"MASONRY"},qr={IN_REVIEW:"IN_REVIEW",APPROVED:"APPROVED",REJECTED:"REJECTED"},jr={WAITING:"Waiting",UPLOADING:"Uploading",RETRYING:"Retrying",DONE:"Done",FAILED:"Failed",ERROR:"Error"},zr=1048576,Wr={CLOSED:"CLOSED",OPEN:"OPEN",UPCOMING:"UPCOMING"},Hr={WAITING:"Waiting",PROCESSING:"Processing",DONE:"Done"},Gr={TEXT:"text",IMAGE:"image",LOTTIE:"lottie"},Vr={CONTEST:"CONTEST",REACTION:"REACTION"},Br={GRID:"grid",SINGLE:"single"},Qr={POPULAR:"popular",UPLOAD_TIME:"upload",CAPTURE_TIME:"capture"},Zr={[Qr.POPULAR]:{label:"Popular",sortField:"score"},[Qr.UPLOAD_TIME]:{label:"Uploaded",sortField:"createdAt"},[Qr.CAPTURE_TIME]:{label:"Captured",sortField:"capturedAt"}},Kr="map-view-state",Jr=Qr.UPLOAD_TIME,Yr={ASC:"asc",DESC:"desc"},Xr={[Yr.ASC]:{label:"Ascending",sortOrder:""},[Yr.DESC]:{label:"Descending",sortOrder:"-"}},en=Yr.DESC,tn={OWN:"own",CURATED:"curated",ELIGIBLE:"eligible"},rn={NONE:null,LINK:"LINK",EMAIL:"EMAIL",PHONE:"PHONE",SMS:"SMS",WHATSAPP:"WHATSAPP",MESSENGER:"MESSENGER"},nn={[rn.LINK]:"material-symbols:open-in-new-rounded",[rn.EMAIL]:"material-symbols:alternate-email-rounded",[rn.PHONE]:"material-symbols:call-outline",[rn.SMS]:"material-symbols:sms-outline-rounded",[rn.WHATSAPP]:"logos:whatsapp-icon",[rn.MESSENGER]:"logos:messenger"},on={AD_IMPRESSION:"impression",AD_ENGAGEMENT:"engagement",AD_CLICK:"click"},an={QRATI_CONNECT_SESSION:"qrati-connect-session",EVENT_IN_REVIEW_COUNT:e=>`in-review-count-${e}`,CONTENTS_BY_EVENT:e=>`contents-by-event-${e}`},sn=0;function ln(e,t,r,o,a,s){t||(t={});var i,l,c=t;if("ref"in c)for(l in c={},t)"ref"==l?i=t[l]:c[l]=t[l];var u={type:e,props:c,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--sn,__i:-1,__u:0,__source:a,__self:s};if("function"==typeof e&&(i=e.defaultProps))for(l in i)void 0===c[l]&&(c[l]=i[l]);return n.vnode&&n.vnode(u),u}function cn({title:e,children:t}){/* @__PURE__ */
|
|
1
|
+
import*as e from"react";import{jsx as t}from"react/jsx-runtime";var r,n,o,a,s,i,l,c,u,d,h,p,f,m,g,y={},_=[],b=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function w(e,t){for(var r in t)e[r]=t[r];return e}function E(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function R(e,t,n){var o,a,s,i={};for(s in t)"key"==s?o=t[s]:"ref"==s?a=t[s]:i[s]=t[s];if(arguments.length>2&&(i.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===i[s]&&(i[s]=e.defaultProps[s]);return S(e,i,o,a,null)}function S(e,t,r,a,s){var i={type:e,props:t,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++o:s,__i:-1,__u:0};return null==s&&null!=n.vnode&&n.vnode(i),i}function x(e){return e.children}function k(e,t){this.props=e,this.context=t}function T(e,t){if(null==t)return e.__?T(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?T(e):null}function C(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,o=[],a=[],s=w({},t);s.__v=t.__v+1,n.vnode&&n.vnode(s),F(e.__P,s,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,o,null==r?T(t):r,!!(32&t.__u),a),s.__v=t.__v,s.__.__k[s.__i]=s,j(o,s,a),t.__e=t.__=null,s.__e!=r&&O(s)}}function O(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),O(e)}function A(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!N.__r++||s!=n.debounceRendering)&&((s=n.debounceRendering)||i)(N)}function N(){try{for(var e,t=1;a.length;)a.length>t&&a.sort(l),e=a.shift(),t=a.length,C(e)}finally{a.length=N.__r=0}}function P(e,t,r,n,o,a,s,i,l,c,u){var d,h,p,f,m,g,b,w=n&&n.__k||_,E=t.length;for(l=function(e,t,r,n,o){var a,s,i,l,c,u=r.length,d=u,h=0;for(e.__k=new Array(o),a=0;a<o;a++)null!=(s=t[a])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=e.__k[a]=S(null,s,null,null,null):v(s)?s=e.__k[a]=S(x,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=e.__k[a]=S(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[a]=s,l=a+h,s.__=e,s.__b=e.__b+1,i=null,-1!=(c=s.__i=L(s,r,l,d))&&(d--,(i=r[c])&&(i.__u|=2)),null==i||null==i.__v?(-1==c&&(o>u?h--:o<u&&h++),"function"!=typeof s.type&&(s.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,s.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)null!=(i=r[a])&&!(2&i.__u)&&(i.__e==n&&(n=T(i)),G(i,i));return n}(r,t,w,l,E),d=0;d<E;d++)null!=(p=r.__k[d])&&(h=-1!=p.__i&&w[p.__i]||y,p.__i=d,g=F(e,p,h,o,a,s,i,l,c,u),f=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&H(h.ref,null,p),u.push(p.ref,p.__c||f,p)),null==m&&null!=f&&(m=f),(b=!!(4&p.__u))||h.__k===p.__k?(l=I(p,l,e,b),b&&h.__e&&(h.__e=null)):"function"==typeof p.type&&void 0!==g?l=g:f&&(l=f.nextSibling),p.__u&=-7);return r.__e=m,l}function I(e,t,r,n){var o,a;if("function"==typeof e.type){for(o=e.__k,a=0;o&&a<o.length;a++)o[a]&&(o[a].__=e,t=I(o[a],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=T(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function D(e,t){return t=t||[],null==e||"boolean"==typeof e||(v(e)?e.some(function(e){D(e,t)}):t.push(e)),t}function L(e,t,r,n){var o,a,s,i=e.key,l=e.type,c=t[r],u=null!=c&&!(2&c.__u);if(null===c&&null==i||u&&i==c.key&&l==c.type)return r;if(n>(u?1:0))for(o=r-1,a=r+1;o>=0||a<t.length;)if(null!=(c=t[s=o>=0?o--:a++])&&!(2&c.__u)&&i==c.key&&l==c.type)return s;return-1}function $(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||b.test(t)?r:r+"px"}function U(e,t,r,n,o){var a,s;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||$(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||$(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])a=t!=(t=t.replace(h,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?n?r[d]=n[d]:(r[d]=p,e.addEventListener(t,a?m:f,a)):e.removeEventListener(t,a?m:f,a);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function M(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t[u])t[u]=p++;else if(t[u]<r[d])return;return r(n.event?n.event(t):t)}}}function F(e,t,r,o,a,s,i,l,c,u){var d,h,p,f,m,g,y,b,R,S,T,C,O,A,N,I=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(c=!!(32&r.__u),s=[l=t.__e=r.__e]),(d=n.__b)&&d(t);e:if("function"==typeof I)try{if(b=t.props,R=I.prototype&&I.prototype.render,S=(d=I.contextType)&&o[d.__c],T=d?S?S.props.value:d.__:o,r.__c?y=(h=t.__c=r.__c).__=h.__E:(R?t.__c=h=new I(b,T):(t.__c=h=new k(b,T),h.constructor=I,h.render=V),S&&S.sub(h),h.state||(h.state={}),h.__n=o,p=h.__d=!0,h.__h=[],h._sb=[]),R&&null==h.__s&&(h.__s=h.state),R&&null!=I.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=w({},h.__s)),w(h.__s,I.getDerivedStateFromProps(b,h.__s))),f=h.props,m=h.state,h.__v=t,p)R&&null==I.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),R&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(R&&null==I.getDerivedStateFromProps&&b!==f&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,T),t.__v==r.__v||!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,T)){t.__v!=r.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(e){e&&(e.__=t)}),_.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&i.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,T),R&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(f,m,g)})}if(h.context=T,h.props=b,h.__P=e,h.__e=!1,C=n.__r,O=0,R)h.state=h.__s,h.__d=!1,C&&C(t),d=h.render(h.props,h.state,h.context),_.push.apply(h.__h,h._sb),h._sb=[];else do{h.__d=!1,C&&C(t),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++O<25);h.state=h.__s,null!=h.getChildContext&&(o=w(w({},o),h.getChildContext())),R&&!p&&null!=h.getSnapshotBeforeUpdate&&(g=h.getSnapshotBeforeUpdate(f,m)),A=null!=d&&d.type===x&&null==d.key?z(d.props.children):d,l=P(e,v(A)?A:[A],t,r,o,a,s,i,l,c,u),h.base=t.__e,t.__u&=-161,h.__h.length&&i.push(h),y&&(h.__E=h.__=null)}catch(e){if(t.__v=null,c||null!=s)if(e.then){for(t.__u|=c?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;s[s.indexOf(l)]=null,t.__e=l}else{for(N=s.length;N--;)E(s[N]);q(t)}else t.__e=r.__e,t.__k=r.__k,e.then||q(t);n.__e(e,t,r)}else null==s&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):l=t.__e=W(r.__e,t,r,o,a,s,i,c,u);return(d=n.diffed)&&d(t),128&t.__u?void 0:l}function q(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(q))}function j(e,t,r){for(var o=0;o<r.length;o++)H(r[o],r[++o],r[++o]);n.__c&&n.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){n.__e(e,t.__v)}})}function z(e){return"object"!=typeof e||null==e||e.__b>0?e:v(e)?e.map(z):w({},e)}function W(e,t,o,a,s,i,l,c,u){var d,h,p,f,m,g,_,b=o.props||y,w=t.props,R=t.type;if("svg"==R?s="http://www.w3.org/2000/svg":"math"==R?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=i)for(d=0;d<i.length;d++)if((m=i[d])&&"setAttribute"in m==!!R&&(R?m.localName==R:3==m.nodeType)){e=m,i[d]=null;break}if(null==e){if(null==R)return document.createTextNode(w);e=document.createElementNS(s,R,w.is&&w),c&&(n.__m&&n.__m(t,i),c=!1),i=null}if(null==R)b===w||c&&e.data==w||(e.data=w);else{if(i=i&&r.call(e.childNodes),!c&&null!=i)for(b={},d=0;d<e.attributes.length;d++)b[(m=e.attributes[d]).name]=m.value;for(d in b)m=b[d],"dangerouslySetInnerHTML"==d?p=m:"children"==d||d in w||"value"==d&&"defaultValue"in w||"checked"==d&&"defaultChecked"in w||U(e,d,null,m,s);for(d in w)m=w[d],"children"==d?f=m:"dangerouslySetInnerHTML"==d?h=m:"value"==d?g=m:"checked"==d?_=m:c&&"function"!=typeof m||b[d]===m||U(e,d,m,b[d],s);if(h)c||p&&(h.__html==p.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(p&&(e.innerHTML=""),P("template"==t.type?e.content:e,v(f)?f:[f],t,o,a,"foreignObject"==R?"http://www.w3.org/1999/xhtml":s,i,l,i?i[0]:o.__k&&T(o,0),c,u),null!=i)for(d=i.length;d--;)E(i[d]);c||(d="value","progress"==R&&null==g?e.removeAttribute("value"):null!=g&&(g!==e[d]||"progress"==R&&!g||"option"==R&&g!=b[d])&&U(e,d,g,b[d],s),d="checked",null!=_&&_!=e[d]&&U(e,d,_,b[d],s))}return e}function H(e,t,r){try{if("function"==typeof e){var o="function"==typeof e.__u;o&&e.__u(),o&&null==t||(e.__u=e(t))}else e.current=t}catch(e){n.__e(e,r)}}function G(e,t,r){var o,a;if(n.unmount&&n.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||H(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){n.__e(e,t)}o.base=o.__P=null}if(o=e.__k)for(a=0;a<o.length;a++)o[a]&&G(o[a],t,r||"function"!=typeof e.type);r||E(e.__e),e.__c=e.__=e.__e=void 0}function V(e,t,r){return this.constructor(e,r)}function B(e,t,o){var a,s,i,l;t==document&&(t=document.documentElement),n.__&&n.__(e,t),s=(a="function"==typeof o)?null:o&&o.__k||t.__k,i=[],l=[],F(t,e=(!a&&o||t).__k=R(x,null,[e]),s||y,y,t.namespaceURI,!a&&o?[o]:s?null:t.firstChild?r.call(t.childNodes):null,i,!a&&o?o:s?s.__e:t.firstChild,a,l),j(i,e,l)}function Q(e,t,n){var o,a,s,i,l=w({},e.props);for(s in e.type&&e.type.defaultProps&&(i=e.type.defaultProps),t)"key"==s?o=t[s]:"ref"==s?a=t[s]:l[s]=void 0===t[s]&&null!=i?i[s]:t[s];return arguments.length>2&&(l.children=arguments.length>3?r.call(arguments,2):n),S(e.type,l,o||e.key,a||e.ref,null)}function Z(e){function t(e){var r,n;return this.getChildContext||(r=/* @__PURE__ */new Set,(n={})[t.__c]=this,this.getChildContext=function(){return n},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach(function(e){e.__e=!0,A(e)})},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+g++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}r=_.slice,n={__e:function(e,t,r,n){for(var o,a,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((a=o.constructor)&&null!=a.getDerivedStateFromError&&(o.setState(a.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,n||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},o=0,k.prototype.setState=function(e,t){var r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=w({},this.state);"function"==typeof e&&(e=e(w({},r),this.props)),e&&w(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),A(this))},k.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),A(this))},k.prototype.render=x,a=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},N.__r=0,c=Math.random().toString(8),u="__d"+c,d="__a"+c,h=/(PointerCapture)$|Capture$/i,p=0,f=M(!1),m=M(!0),g=0;var K,J,Y,X,ee=0,te=[],re=n,ne=re.__b,oe=re.__r,ae=re.diffed,se=re.__c,ie=re.unmount,le=re.__;function ce(e,t){re.__h&&re.__h(J,e,ee||t),ee=0;var r=J.__H||(J.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function ue(e){return ee=1,function(e,t){var r=ce(K++,2);if(r.t=e,!r.__c&&(r.__=[Se(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=J,!J.__f)){var n=function(e,t,n){if(!r.__c.__H)return!0;var a=r.__c.__H.__.filter(function(e){return e.__c});if(a.every(function(e){return!e.__N}))return!o||o.call(this,e,t,n);var s=r.__c.props!==e;return a.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}}),o&&o.call(this,e,t,n)||s};J.__f=!0;var o=J.shouldComponentUpdate,a=J.componentWillUpdate;J.componentWillUpdate=function(e,t,r){if(this.__e){var s=o;o=void 0,n(e,t,r),o=s}a&&a.call(this,e,t,r)},J.shouldComponentUpdate=n}return r.__N||r.__}(Se,e)}function de(e,t){var r=ce(K++,3);!re.__s&&Re(r.__H,t)&&(r.__=e,r.u=t,J.__H.__h.push(r))}function he(e,t){var r=ce(K++,4);!re.__s&&Re(r.__H,t)&&(r.__=e,r.u=t,J.__h.push(r))}function pe(e){return ee=5,fe(function(){return{current:e}},[])}function fe(e,t){var r=ce(K++,7);return Re(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function me(e,t){return ee=8,fe(function(){return e},t)}function ge(e){var t=J.context[e.__c],r=ce(K++,9);return r.c=e,t?(r.__??(r.__=!0,t.sub(J)),t.props.value):e.__}function ye(){var e=ce(K++,11);if(!e.__){for(var t=J.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function _e(){for(var e;e=te.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(we),t.__h.some(Ee),t.__h=[]}catch(yn){t.__h=[],re.__e(yn,e.__v)}}}re.__b=function(e){J=null,ne&&ne(e)},re.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),le&&le(e,t)},re.__r=function(e){oe&&oe(e),K=0;var t=(J=e.__c).__H;t&&(Y===J?(t.__h=[],J.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(we),t.__h.some(Ee),t.__h=[],K=0)),Y=J},re.diffed=function(e){ae&&ae(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==te.push(t)&&X===re.requestAnimationFrame||((X=re.requestAnimationFrame)||ve)(_e)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Y=J=null},re.__c=function(e,t){t.some(function(e){try{e.__h.some(we),e.__h=e.__h.filter(function(e){return!e.__||Ee(e)})}catch(yn){t.some(function(e){e.__h&&(e.__h=[])}),t=[],re.__e(yn,e.__v)}}),se&&se(e,t)},re.unmount=function(e){ie&&ie(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(e){try{we(e)}catch(e){t=e}}),r.__H=void 0,t&&re.__e(t,r.__v))};var be="function"==typeof requestAnimationFrame;function ve(e){var t,r=function(){clearTimeout(n),be&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);be&&(t=requestAnimationFrame(r))}function we(e){var t=J,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),J=t}function Ee(e){var t=J;e.__c=e.__(),J=t}function Re(e,t){return!e||e.length!==t.length||t.some(function(t,r){return t!==e[r]})}function Se(e,t){return"function"==typeof t?t(e):t}var xe=class{constructor(){this.listeners=/* @__PURE__ */new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ke=new class extends xe{#e;#t;#r;constructor(){super(),this.#r=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}},Te={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ce=new class{#n=Te;#o=!1;setTimeoutProvider(e){"production"!==process.env.NODE_ENV&&this.#o&&e!==this.#n&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#n,provider:e}),this.#n=e,"production"!==process.env.NODE_ENV&&(this.#o=!1)}setTimeout(e,t){return"production"!==process.env.NODE_ENV&&(this.#o=!0),this.#n.setTimeout(e,t)}clearTimeout(e){this.#n.clearTimeout(e)}setInterval(e,t){return"production"!==process.env.NODE_ENV&&(this.#o=!0),this.#n.setInterval(e,t)}clearInterval(e){this.#n.clearInterval(e)}},Oe="undefined"==typeof window||"Deno"in globalThis;function Ae(){}function Ne(e,t){return"function"==typeof e?e(t):e}function Pe(e){return"number"==typeof e&&e>=0&&e!==1/0}function Ie(e,t){return Math.max(e+(t||0)-Date.now(),0)}function De(e,t){return"function"==typeof e?e(t):e}function Le(e,t){return"function"==typeof e?e(t):e}function $e(e,t){const{type:r="all",exact:n,fetchStatus:o,predicate:a,queryKey:s,stale:i}=e;if(s)if(n){if(t.queryHash!==Me(s,t.options))return!1}else if(!qe(t.queryKey,s))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return!("boolean"==typeof i&&t.isStale()!==i||o&&o!==t.state.fetchStatus||a&&!a(t))}function Ue(e,t){const{exact:r,status:n,predicate:o,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(Fe(t.options.mutationKey)!==Fe(a))return!1}else if(!qe(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||o&&!o(t))}function Me(e,t){return(t?.queryKeyHashFn||Fe)(e)}function Fe(e){return JSON.stringify(e,(e,t)=>Ge(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function qe(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>qe(e[r],t[r]))}var je=Object.prototype.hasOwnProperty;function ze(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=He(e)&&He(t);if(!(n||Ge(e)&&Ge(t)))return t;const o=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),s=a.length,i=n?new Array(s):{};let l=0;for(let c=0;c<s;c++){const s=n?c:a[c],u=e[s],d=t[s];if(u===d){i[s]=u,(n?c<o:je.call(e,s))&&l++;continue}if(null===u||null===d||"object"!=typeof u||"object"!=typeof d){i[s]=d;continue}const h=ze(u,d,r+1);i[s]=h,h===u&&l++}return o===s&&l===o?e:i}function We(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function He(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ge(e){if(!Ve(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!Ve(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function Ve(e){return"[object Object]"===Object.prototype.toString.call(e)}function Be(e,t,r){if("function"==typeof r.structuralSharing)return r.structuralSharing(e,t);if(!1!==r.structuralSharing){if("production"!==process.env.NODE_ENV)try{return ze(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return ze(e,t)}return t}function Qe(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Ze(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Ke=/* @__PURE__ */Symbol();function Je(e,t){return"production"!==process.env.NODE_ENV&&e.queryFn===Ke&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==Ke?e.queryFn:()=>Promise.reject(/* @__PURE__ */new Error(`Missing queryFn: '${e.queryHash}'`))}function Ye(e,t){return"function"==typeof e?e(...t):!!e}function Xe(e,t,r){let n,o=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??=t(),o||(o=!0,n.aborted?r():n.addEventListener("abort",r,{once:!0})),n)}),e}var et=/* @__PURE__ */(()=>{let e=()=>Oe;return{isServer:()=>e(),setIsServer(t){e=t}}})();function tt(){let e,t;const r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}var rt=function(e){setTimeout(e,0)},nt=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},o=rt;const a=n=>{t?e.push(n):o(()=>{r(n)})};return{batch:a=>{let s;t++;try{s=a()}finally{t--,t||(()=>{const t=e;e=[],t.length&&o(()=>{n(()=>{t.forEach(e=>{r(e)})})})})()}return s},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{o=e}}}(),ot=new class extends xe{#a=!0;#t;#r;constructor(){super(),this.#r=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#a!==e&&(this.#a=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#a}};function at(e){return Math.min(1e3*2**e,3e4)}function st(e){return"online"!==(e??"online")||ot.isOnline()}var it=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function lt(e){let t,r=!1,n=0;const o=tt(),a=()=>"pending"!==o.status,s=()=>ke.isFocused()&&("always"===e.networkMode||ot.isOnline())&&e.canRun(),i=()=>st(e.networkMode)&&e.canRun(),l=e=>{a()||(t?.(),o.resolve(e))},c=e=>{a()||(t?.(),o.reject(e))},u=()=>new Promise(r=>{t=e=>{(a()||s())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,a()||e.onContinue?.()}),d=()=>{if(a())return;let t;const o=0===n?e.initialPromise:void 0;try{t=o??e.fn()}catch(i){t=Promise.reject(i)}Promise.resolve(t).then(l).catch(t=>{if(a())return;const o=e.retry??(et.isServer()?0:3),i=e.retryDelay??at,l="function"==typeof i?i(n,t):i,h=!0===o||"number"==typeof o&&n<o||"function"==typeof o&&o(n,t);var p;!r&&h?(n++,e.onFail?.(n,t),(p=l,new Promise(e=>{Ce.setTimeout(e,p)})).then(()=>s()?void 0:u()).then(()=>{r?c(t):d()})):c(t)})};return{promise:o,status:()=>o.status,cancel:t=>{if(!a()){const r=new it(t);c(r),e.onCancel?.(r)}},continue:()=>(t?.(),o),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:i,start:()=>(i()?d():u().then(d),o)}}var ct=class{#s;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Pe(this.gcTime)&&(this.#s=Ce.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(et.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#s&&(Ce.clearTimeout(this.#s),this.#s=void 0)}},ut=class extends ct{#i;#l;#c;#u;#d;#h;#p;constructor(e){super(),this.#p=!1,this.#h=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#u=e.client,this.#c=this.#u.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#i=pt(this.options),this.state=e.state??this.#i,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#h,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=pt(this.options);void 0!==e.data&&(this.setState(ht(e.data,e.dataUpdatedAt)),this.#i=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(e,t){const r=Be(this.state.data,e,this.options);return this.#f({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#d?.promise;return this.#d?.cancel(e),t?t.then(Ae).catch(Ae):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#i}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==Le(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ke||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===De(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!Ie(this.state.dataUpdatedAt,e))}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#c.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#d&&(this.#p||this.#m()?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#m(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#d?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}"production"!==process.env.NODE_ENV&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,r.signal)})},o=()=>{const e=Je(this.options,t),r=(()=>{const e={client:this.#u,queryKey:this.queryKey,meta:this.meta};return n(e),e})();return this.#p=!1,this.options.persister?this.options.persister(e,r,this):e(r)},a=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#u,state:this.state,fetchFn:o};return n(e),e})();this.options.behavior?.onFetch(a,this),this.#l=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===a.fetchOptions?.meta||this.#f({type:"fetch",meta:a.fetchOptions?.meta}),this.#d=lt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof it&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const e=await this.#d.start();if(void 0===e)throw"production"!==process.env.NODE_ENV&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#c.config.onSuccess?.(e,this),this.#c.config.onSettled?.(e,this.state.error,this),e}catch(s){if(s instanceof it){if(s.silent)return this.#d.promise;if(s.revert){if(void 0===this.state.data)throw s;return this.state.data}}throw this.#f({type:"error",error:s}),this.#c.config.onError?.(s,this),this.#c.config.onSettled?.(this.state.data,s,this),s}finally{this.scheduleGc()}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...dt(t.data,this.options),fetchMeta:e.meta??null};case"success":const r={...t,...ht(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":const n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),nt.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#c.notify({query:this,type:"updated",action:e})})}};function dt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:st(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function ht(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function pt(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var ft=class extends xe{constructor(e,t){super(),this.options=t,this.#u=e,this.#g=null,this.#y=tt(),this.bindMethods(),this.setOptions(t)}#u;#_=void 0;#b=void 0;#v=void 0;#w;#E;#y;#g;#R;#S;#x;#k;#T;#C;#O=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#_.addObserver(this),mt(this.#_,this.options)?this.#A():this.updateResult(),this.#N())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return gt(this.#_,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return gt(this.#_,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#P(),this.#I(),this.#_.removeObserver(this)}setOptions(e){const t=this.options,r=this.#_;if(this.options=this.#u.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof Le(this.options.enabled,this.#_))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#D(),this.#_.setOptions(this.options),t._defaulted&&!We(this.options,t)&&this.#u.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#_,observer:this});const n=this.hasListeners();n&&yt(this.#_,r,this.options,t)&&this.#A(),this.updateResult(),!n||this.#_===r&&Le(this.options.enabled,this.#_)===Le(t.enabled,this.#_)&&De(this.options.staleTime,this.#_)===De(t.staleTime,this.#_)||this.#L();const o=this.#$();!n||this.#_===r&&Le(this.options.enabled,this.#_)===Le(t.enabled,this.#_)&&o===this.#C||this.#U(o)}getOptimisticResult(e){const t=this.#u.getQueryCache().build(this.#u,e),r=this.createResult(t,e);var n;return n=r,We(this.getCurrentResult(),n)||(this.#v=r,this.#E=this.options,this.#w=this.#_.state),r}getCurrentResult(){return this.#v}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#y.status||this.#y.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#O.add(e)}getCurrentQuery(){return this.#_}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#u.defaultQueryOptions(e),r=this.#u.getQueryCache().build(this.#u,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#A({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#v))}#A(e){this.#D();let t=this.#_.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Ae)),t}#L(){this.#P();const e=De(this.options.staleTime,this.#_);if(et.isServer()||this.#v.isStale||!Pe(e))return;const t=Ie(this.#v.dataUpdatedAt,e)+1;this.#k=Ce.setTimeout(()=>{this.#v.isStale||this.updateResult()},t)}#$(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#_):this.options.refetchInterval)??!1}#U(e){this.#I(),this.#C=e,!et.isServer()&&!1!==Le(this.options.enabled,this.#_)&&Pe(this.#C)&&0!==this.#C&&(this.#T=Ce.setInterval(()=>{(this.options.refetchIntervalInBackground||ke.isFocused())&&this.#A()},this.#C))}#N(){this.#L(),this.#U(this.#$())}#P(){void 0!==this.#k&&(Ce.clearTimeout(this.#k),this.#k=void 0)}#I(){void 0!==this.#T&&(Ce.clearInterval(this.#T),this.#T=void 0)}createResult(e,t){const r=this.#_,n=this.options,o=this.#v,a=this.#w,s=this.#E,i=e!==r?e.state:this.#b,{state:l}=e;let c,u={...l},d=!1;if(t._optimisticResults){const o=this.hasListeners(),a=!o&&mt(e,t),s=o&&yt(e,r,t,n);(a||s)&&(u={...u,...dt(l.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:h,errorUpdatedAt:p,status:f}=u;c=u.data;let m=!1;if(void 0!==t.placeholderData&&void 0===c&&"pending"===f){let e;o?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=o.data,m=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#x?.state.data,this.#x):t.placeholderData,void 0!==e&&(f="success",c=Be(o?.data,e,t),d=!0)}if(t.select&&void 0!==c&&!m)if(o&&c===a?.data&&t.select===this.#R)c=this.#S;else try{this.#R=t.select,c=t.select(c),c=Be(o?.data,c,t),this.#S=c,this.#g=null}catch(E){this.#g=E}this.#g&&(h=this.#g,c=this.#S,p=Date.now(),f="error");const g="fetching"===u.fetchStatus,y="pending"===f,_="error"===f,b=y&&g,v=void 0!==c,w={status:f,fetchStatus:u.fetchStatus,isPending:y,isSuccess:"success"===f,isError:_,isInitialLoading:b,isLoading:b,data:c,dataUpdatedAt:u.dataUpdatedAt,error:h,errorUpdatedAt:p,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>i.dataUpdateCount||u.errorUpdateCount>i.errorUpdateCount,isFetching:g,isRefetching:g&&!y,isLoadingError:_&&!v,isPaused:"paused"===u.fetchStatus,isPlaceholderData:d,isRefetchError:_&&v,isStale:_t(e,t),refetch:this.refetch,promise:this.#y,isEnabled:!1!==Le(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==w.data,n="error"===w.status&&!t,o=e=>{n?e.reject(w.error):t&&e.resolve(w.data)},a=()=>{o(this.#y=w.promise=tt())},s=this.#y;switch(s.status){case"pending":e.queryHash===r.queryHash&&o(s);break;case"fulfilled":(n||w.data!==s.value)&&a();break;case"rejected":n&&w.error===s.reason||a()}}return w}updateResult(){const e=this.#v,t=this.createResult(this.#_,this.options);this.#w=this.#_.state,this.#E=this.options,void 0!==this.#w.data&&(this.#x=this.#_),We(t,e)||(this.#v=t,this.#M({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#O.size)return!0;const n=new Set(r??this.#O);return this.options.throwOnError&&n.add("error"),Object.keys(this.#v).some(t=>{const r=t;return this.#v[r]!==e[r]&&n.has(r)})})()}))}#D(){const e=this.#u.getQueryCache().build(this.#u,this.options);if(e===this.#_)return;const t=this.#_;this.#_=e,this.#b=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#N()}#M(e){nt.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#v)}),this.#u.getQueryCache().notify({query:this.#_,type:"observerResultsUpdated"})})}};function mt(e,t){return function(e,t){return!1!==Le(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&>(e,t,t.refetchOnMount)}function gt(e,t,r){if(!1!==Le(t.enabled,e)&&"static"!==De(t.staleTime,e)){const n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&_t(e,t)}return!1}function yt(e,t,r,n){return(e!==t||!1===Le(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&_t(e,r)}function _t(e,t){return!1!==Le(t.enabled,e)&&e.isStaleByTime(De(t.staleTime,e))}var bt=e.createContext(void 0),vt=t=>{const r=e.useContext(bt);if(t)return t;if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},wt=({client:r,children:n})=>(e.useEffect(()=>(r.mount(),()=>{r.unmount()}),[r]),/* @__PURE__ */t(bt.Provider,{value:r,children:n})),Et=e.createContext(!1);Et.Provider;var Rt=e.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),St=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function xt(t,r,n){if("production"!==process.env.NODE_ENV&&("object"!=typeof t||Array.isArray(t)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const o=e.useContext(Et),a=e.useContext(Rt),s=vt(n),i=s.defaultQueryOptions(t);s.getDefaultOptions().queries?._experimental_beforeQuery?.(i);const l=s.getQueryCache().get(i.queryHash);"production"!==process.env.NODE_ENV&&(i.queryFn||console.error(`[${i.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),i._optimisticResults=o?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(e??t,t),n=e.staleTime;e.staleTime="function"==typeof n?(...e)=>r(n(...e)):r(n),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(i),((e,t,r)=>{const n=r?.state.error&&"function"==typeof e.throwOnError?Ye(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))})(i,a,l),(t=>{e.useEffect(()=>{t.clearReset()},[t])})(a);const c=!s.getQueryCache().get(i.queryHash),[u]=e.useState(()=>new r(s,i)),d=u.getOptimisticResult(i),h=!o&&!1!==t.subscribed;if(e.useSyncExternalStore(e.useCallback(e=>{const t=h?u.subscribe(nt.batchCalls(e)):Ae;return u.updateResult(),t},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),e.useEffect(()=>{u.setOptions(i)},[i,u]),((e,t)=>e?.suspense&&t.isPending)(i,d))throw St(i,u,a);if((({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(o&&void 0===e.data||Ye(r,[e.error,n])))({result:d,errorResetBoundary:a,throwOnError:i.throwOnError,query:l,suspense:i.suspense}))throw d.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(i,d),i.experimental_prefetchInRender&&!et.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(d,o)&&(c?St(i,u,a):l?.promise)?.catch(Ae).finally(()=>{u.updateResult()}),i.notifyOnChangeProps?d:u.trackResult(d)}function kt(e,t){return xt(e,ft,t)}function Tt(e,t){for(var r in e)if("__source"!==r&&!(r in t))return!0;for(var n in t)if("__source"!==n&&e[n]!==t[n])return!0;return!1}function Ct(e,t){this.props=e,this.context=t}(Ct.prototype=new k).isPureReactComponent=!0,Ct.prototype.shouldComponentUpdate=function(e,t){return Tt(this.props,e)||Tt(this.state,t)};var Ot=n.__b;n.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ot&&Ot(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var At=n.__e;n.__e=function(e,t,r,n){if(e.then)for(var o,a=t;a=a.__;)if((o=a.__c)&&o.__c)return t.__e??(t.__e=r.__e,t.__k=r.__k),o.__c(e,t);At(e,t,r,n)};var Nt=n.unmount;function Pt(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=function(e,t){for(var r in t)e[r]=t[r];return e}({},e)).__c&&(e.__c.__P===r&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Pt(e,t,r)})),e}function It(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return It(e,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function Dt(){this.__u=0,this.o=null,this.__b=null}function Lt(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function $t(e){var t,r,n,o=null;function a(a){if(t||(t=e()).then(function(e){e&&(o=e.default||e),n=!0},function(e){r=e,n=!0}),r)throw r;if(!n)throw t;return o?R(o,a):null}return a.displayName="Lazy",a.__f=!0,a}function Ut(){this.i=null,this.l=null}n.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Nt&&Nt(e)},(Dt.prototype=new k).__c=function(e,t){var r=t.__c,n=this;n.o??=[],n.o.push(r);var o=Lt(n.__v),a=!1,s=function(){a||n.__z||(a=!0,r.__R=null,o?o(l):l())};r.__R=s;var i=r.__P;r.__P=null;var l=function(){if(! --n.__u){if(n.state.__a){var e=n.state.__a;n.__v.__k[0]=It(e,e.__c.__P,e.__c.__O)}var t;for(n.setState({__a:n.__b=null});t=n.o.pop();)t.__P=i,t.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(s,s)},Dt.prototype.componentWillUnmount=function(){this.o=[]},Dt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Pt(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&R(x,null,e.fallback);return o&&(o.__u&=-33),[R(x,null,t.__a?null:e.children),o]};var Mt=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};function Ft(e){return this.getChildContext=function(){return e.context},e.children}function qt(e){var t=this,r=e.h;if(t.componentWillUnmount=function(){B(null,t.v),t.v=null,t.h=null},t.h&&t.h!==r&&t.componentWillUnmount(),!t.v){for(var n=t.__v;null!==n&&!n.__m&&null!==n.__;)n=n.__;t.h=r,t.v={nodeType:1,parentNode:r,childNodes:[],__k:{__m:n.__m},contains:function(){return!0},namespaceURI:r.namespaceURI,insertBefore:function(e,r){this.childNodes.push(e),t.h.insertBefore(e,r)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}B(R(Ft,{context:t.context},e.__v),t.v)}function jt(e,t){var r=R(qt,{__v:e,h:t});return r.containerInfo=t,r}(Ut.prototype=new k).__a=function(e){var t=this,r=Lt(t.__v),n=t.l.get(e);return n[0]++,function(o){var a=function(){t.props.revealOrder?(n.push(o),Mt(t,e,n)):o()};r?r(a):a()}},Ut.prototype.render=function(e){this.i=null,this.l=/* @__PURE__ */new Map;var t=D(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},Ut.prototype.componentDidUpdate=Ut.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Mt(e,r,t)})};var zt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Wt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ht=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Gt=/[A-Z0-9]/g,Vt="undefined"!=typeof document,Bt=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};k.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(k.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Qt=n.event;n.event=function(e){return Qt&&(e=Qt(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Zt={configurable:!0,get:function(){return this.class}},Kt=n.vnode;n.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,r=e.type,n={},o=-1==r.indexOf("-");for(var a in t){var s=t[a];if(!("value"===a&&"defaultValue"in t&&null==s||Vt&&"children"===a&&"noscript"===r||"class"===a||"className"===a)){var i=a.toLowerCase();"defaultValue"===a&&"value"in t&&null==t.value?a="value":"download"===a&&!0===s?s="":"translate"===i&&"no"===s?s=!1:"o"===i[0]&&"n"===i[1]?"ondoubleclick"===i?a="ondblclick":"onchange"!==i||"input"!==r&&"textarea"!==r||Bt(t.type)?"onfocus"===i?a="onfocusin":"onblur"===i?a="onfocusout":Ht.test(a)&&(a=i):i=a="oninput":o&&Wt.test(a)?a=a.replace(Gt,"-$&").toLowerCase():null===s&&(s=void 0),"oninput"===i&&n[a=i]&&(a="oninputCapture"),n[a]=s}}"select"==r&&(n.multiple&&Array.isArray(n.value)&&(n.value=D(t.children).forEach(function(e){e.props.selected=-1!=n.value.indexOf(e.props.value)})),null!=n.defaultValue&&(n.value=D(t.children).forEach(function(e){e.props.selected=n.multiple?-1!=n.defaultValue.indexOf(e.props.value):n.defaultValue==e.props.value}))),t.class&&!t.className?(n.class=t.class,Object.defineProperty(n,"className",Zt)):t.className&&(n.class=n.className=t.className),e.props=n}(e),e.$$typeof=zt,Kt&&Kt(e)};var Jt=n.__r;n.__r=function(e){Jt&&Jt(e),e.__c};var Yt=n.diffed;n.diffed=function(e){Yt&&Yt(e);var t=e.props,r=e.__e;null!=r&&"textarea"===e.type&&"value"in t&&t.value!==r.value&&(r.value=null==t.value?"":t.value)};var Xt=class extends Error{response;request;options;constructor(e,t,r){const n=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${n?`status code ${n}`:"an unknown error"}: ${t.method} ${t.url}`),this.name="HTTPError",this.response=e,this.request=t,this.options=r}},er=class extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}},tr=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new er(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},rr=(()=>{let e=!1,t=!1;const r="function"==typeof globalThis.ReadableStream,n="function"==typeof globalThis.Request;if(r&&n)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(o){if(o instanceof Error&&"unsupported BodyInit type"===o.message)return!1;throw o}return e&&!t})(),nr="function"==typeof globalThis.AbortController,or="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,ar="function"==typeof globalThis.ReadableStream,sr="function"==typeof globalThis.FormData,ir=["get","post","put","patch","head","delete"],lr={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},cr=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,ur=Symbol("stop"),dr=class{options;constructor(e){this.options=e}},hr=e=>new dr(e),pr={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},fr={next:!0},mr={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},gr=(e,t,r)=>{let n,o=0;return e.pipeThrough(new TransformStream({transform(e,a){if(a.enqueue(e),n){o+=n.byteLength;let e=0===t?0:o/t;e>=1&&(e=1-Number.EPSILON),r?.({percent:e,totalBytes:Math.max(t,o),transferredBytes:o},n)}n=e},flush(){n&&(o+=n.byteLength,r?.({percent:1,totalBytes:Math.max(t,o),transferredBytes:o},n))}}))},yr=e=>null!==e&&"object"==typeof e,_r=(...e)=>{for(const t of e)if((!yr(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return Rr({},...e)},br=(e={},t={})=>{const r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,o=new globalThis.Headers(t);for(const[a,s]of o.entries())n&&"undefined"===s||void 0===s?r.delete(a):r.set(a,s);return r};function vr(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:Rr(e[r]??[],t[r]??[])}var wr=(e={},t={})=>({beforeRequest:vr(e,t,"beforeRequest"),beforeRetry:vr(e,t,"beforeRetry"),afterResponse:vr(e,t,"afterResponse"),beforeError:vr(e,t,"beforeError")}),Er=(e,t)=>{const r=new URLSearchParams;for(const n of[e,t])if(void 0!==n)if(n instanceof URLSearchParams)for(const[e,t]of n.entries())r.append(e,t);else if(Array.isArray(n))for(const e of n){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(e[0]),String(e[1]))}else if(yr(n))for(const[e,t]of Object.entries(n))void 0!==t&&r.append(e,String(t));else{const e=new URLSearchParams(n);for(const[t,n]of e.entries())r.append(t,n)}return r},Rr=(...e)=>{let t,r={},n={},o={};const a=[];for(const s of e)if(Array.isArray(s))Array.isArray(r)||(r=[]),r=[...r,...s];else if(yr(s)){for(let[e,n]of Object.entries(s))if("signal"===e&&n instanceof globalThis.AbortSignal)a.push(n);else if("context"!==e)"searchParams"!==e?(yr(n)&&e in r&&(n=Rr(r[e],n)),r={...r,[e]:n}):t=null==n?void 0:void 0===t?n:Er(t,n);else{if(null!=n&&(!yr(n)||Array.isArray(n)))throw new TypeError("The `context` option must be an object");r={...r,context:null==n?{}:{...r.context,...n}}}yr(s.hooks)&&(o=wr(o,s.hooks),r.hooks=o),yr(s.headers)&&(n=br(n,s.headers),r.headers=n)}return void 0!==t&&(r.searchParams=t),a.length>0&&(1===a.length?r.signal=a[0]:r.signal=or?AbortSignal.any(a):a.at(-1)),r},Sr=e=>ir.includes(e)?e.toUpperCase():e,xr={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},kr=(e={})=>{if("number"==typeof e)return{...xr,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&=e.methods.map(e=>e.toLowerCase()),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e));return{...xr,...t}},Tr=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}},Cr=class e{static create(t,r){const n=new e(t,r),o=n.#F(async()=>{if("number"==typeof n.#q.timeout&&n.#q.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await n.#j();for(const r of n.#q.hooks.afterResponse){const o=n.#z(e.clone());let a;try{a=await r(n.request,n.#W(),o,{retryCount:n.#H})}catch(t){throw n.#G(o),n.#G(e),t}if(a instanceof dr)throw n.#G(o),n.#G(e),new tr(a.options);const s=a instanceof globalThis.Response?a:e;o!==s&&n.#G(o),e!==s&&n.#G(e),e=s}if(n.#z(e),!e.ok&&("function"==typeof n.#q.throwHttpErrors?n.#q.throwHttpErrors(e.status):n.#q.throwHttpErrors)){let t=new Xt(e,n.request,n.#W());for(const e of n.#q.hooks.beforeError)t=await e(t,{retryCount:n.#H});throw t}if(n.#q.onDownloadProgress){if("function"!=typeof n.#q.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!ar)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const t=e.clone();return n.#G(e),((e,t)=>{if(!e.body)return e;if(204===e.status)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});const r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(gr(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})})(t,n.#q.onDownloadProgress)}return e}).finally(()=>{const e=n.#V;n.#B(e?.body??void 0),n.#B(n.request.body??void 0)});for(const[e,a]of Object.entries(lr))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(o[e]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||a);const t=await o;if("json"===e){if(204===t.status)return"";const e=await t.text();return""===e?"":r.parseJson?r.parseJson(e):JSON.parse(e)}return t[e]()});return o}static#Q(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#Z;#H=0;#K;#q;#V;#J;#Y;constructor(t,r={}){if(this.#K=t,this.#q={...r,headers:br(this.#K.headers,r.headers),hooks:wr({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Sr(r.method??this.#K.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:kr(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},"string"!=typeof this.#K&&!(this.#K instanceof URL||this.#K instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#q.prefixUrl&&"string"==typeof this.#K){if(this.#K.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#q.prefixUrl.endsWith("/")||(this.#q.prefixUrl+="/"),this.#K=this.#q.prefixUrl+this.#K}nr&&or&&(this.#J=this.#q.signal??this.#K.signal,this.#Z=new globalThis.AbortController,this.#q.signal=this.#J?AbortSignal.any([this.#J,this.#Z.signal]):this.#Z.signal),rr&&(this.#q.duplex="half"),void 0!==this.#q.json&&(this.#q.body=this.#q.stringifyJson?.(this.#q.json)??JSON.stringify(this.#q.json),this.#q.headers.set("content-type",this.#q.headers.get("content-type")??"application/json"));const n=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#K instanceof globalThis.Request&&(sr&&this.#q.body instanceof globalThis.FormData||this.#q.body instanceof URLSearchParams)&&!n&&this.#q.headers.delete("content-type"),this.request=new globalThis.Request(this.#K,this.#q),void 0!==(o=this.#q.searchParams)&&(Array.isArray(o)?o.length>0:o instanceof URLSearchParams?o.size>0:"object"==typeof o?Object.keys(o).length>0:"string"==typeof o?o.trim().length>0:Boolean(o))){const t="?"+("string"==typeof this.#q.searchParams?this.#q.searchParams.replace(/^\?/,""):new URLSearchParams(e.#Q(this.#q.searchParams)).toString()),r=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);this.request=new globalThis.Request(r,this.#q)}var o;if(this.#q.onUploadProgress){if("function"!=typeof this.#q.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!rr)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#X(this.request,this.#q.body??void 0)}}#ee(){const e=this.#q.retry.delay(this.#H);let t=e;!0===this.#q.retry.jitter?t=Math.random()*e:"function"==typeof this.#q.retry.jitter&&(t=this.#q.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e));const r=this.#q.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,t)}async#te(e){if(this.#H++,this.#H>this.#q.retry.limit)throw e;const t=e instanceof Error?e:new er(e);if(t instanceof tr)return t.customDelay??this.#ee();if(!this.#q.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#q.retry.shouldRetry){const r=await this.#q.retry.shouldRetry({error:t,retryCount:this.#H});if(!1===r)throw e;if(!0===r)return this.#ee()}if(function(e){return e instanceof Tr||e?.name===Tr.name}(e)&&!this.#q.retry.retryOnTimeout)throw e;if(function(e){return e instanceof Xt||e?.name===Xt.name}(e)){if(!this.#q.retry.statusCodes.includes(e.response.status))throw e;const t=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(t&&this.#q.retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now());const r=this.#q.retry.maxRetryAfter??e;return e<r?e:r}if(413===e.response.status)throw e}return this.#ee()}#z(e){return this.#q.parseJson&&(e.json=async()=>this.#q.parseJson(await e.text())),e}#B(e){e&&e.cancel().catch(()=>{})}#G(e){this.#B(e.body??void 0)}async#F(e){try{return await e()}catch(t){const r=Math.min(await this.#te(t),2147483647);if(this.#H<1)throw t;if(await async function(e,{signal:t}){return new Promise((r,n)=>{function o(){clearTimeout(a),n(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));const a=setTimeout(()=>{t?.removeEventListener("abort",o),r()},e)})}(r,this.#J?{signal:this.#J}:{}),t instanceof tr&&t.customRequest){const e=this.#q.signal?new globalThis.Request(t.customRequest,{signal:this.#q.signal}):new globalThis.Request(t.customRequest);this.#re(e)}for(const e of this.#q.hooks.beforeRetry){const r=await e({request:this.request,options:this.#W(),error:t,retryCount:this.#H});if(r instanceof globalThis.Request){this.#re(r);break}if(r instanceof globalThis.Response)return r;if(r===ur)return}return this.#F(e)}}async#j(){this.#Z?.signal.aborted&&(this.#Z=new globalThis.AbortController,this.#q.signal=this.#J?AbortSignal.any([this.#J,this.#Z.signal]):this.#Z.signal,this.request=new globalThis.Request(this.request,{signal:this.#q.signal}));for(const t of this.#q.hooks.beforeRequest){const e=await t(this.request,this.#W(),{retryCount:this.#H});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#re(e);break}}const e=((e,t)=>{const r={};for(const n in t)Object.hasOwn(t,n)&&(n in mr||n in pr||n in e&&!(n in fr)||(r[n]=t[n]));return r})(this.request,this.#q);return this.#V=this.request,this.request=this.#V.clone(),!1===this.#q.timeout?this.#q.fetch(this.#V,e):async function(e,t,r,n){return new Promise((o,a)=>{const s=setTimeout(()=>{r&&r.abort(),a(new Tr(e))},n.timeout);n.fetch(e,t).then(o).catch(a).then(()=>{clearTimeout(s)})})}(this.#V,e,this.#Z,this.#q)}#W(){if(!this.#Y){const{hooks:e,...t}=this.#q;this.#Y=Object.freeze(t)}return this.#Y}#re(e){this.#Y=void 0,this.request=this.#X(e)}#X(e,t){return this.#q.onUploadProgress&&e.body?((e,t,r)=>{if(!e.body)return e;const n=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,n]of e)t+=cr,t+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${r}"`).length,t+="string"==typeof n?(new TextEncoder).encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if("string"==typeof e)return(new TextEncoder).encode(e).length;if(e instanceof URLSearchParams)return(new TextEncoder).encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if("object"==typeof e&&null!==e)try{const t=JSON.stringify(e);return(new TextEncoder).encode(t).length}catch{return 0}return 0})(r??e.body);return new Request(e,{duplex:"half",body:gr(e.body,n,t)})})(e,this.#q.onUploadProgress,t??this.#q.body??void 0):e}},Or=e=>{const t=(t,r)=>Cr.create(t,_r(e,r));for(const r of ir)t[r]=(t,n)=>Cr.create(t,_r(e,n,{method:r}));return t.create=e=>Or(_r(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),Or(_r(e,t))),t.stop=ur,t.retry=hr,t},Ar=Or(),Nr={PUBLIC_EVENTS:"/",FOLDER_EVENTS:e=>`/${e}`,LOGIN:"/auth/login",REGISTER:"/auth/register",FORGOT_PASSWORD:"/auth/forgot-password",RESET_PASSWORD:"/auth/reset-password",VERIFY_EMAIL:"/auth/verify-email",GALLERY:e=>`/event/${e}`,UPLOAD:e=>`/event/${e}/upload`,CURATE:e=>`/event/${e}/curate`,LEADERBOARD:e=>`/event/${e}/leaderboard`},Pr={ORGANIZATION_SETTINGS:e=>`https://beta.qratilabs.com/org/${e}/settings`,ORGANIZATION_SETTINGS_INTEGRATION:e=>`https://beta.qratilabs.com/org/${e}/settings/integration`,ORGANIZATION_DASHBOARD:e=>`https://beta.qratilabs.com/org/${e}/dashboard`,ORGANIZATION_ADMINS:e=>`https://beta.qratilabs.com/org/${e}/admins`,EVENT_SETTINGS_BASIC_DETAILS:e=>`https://beta.qratilabs.com/event/${e}/settings`,EVENT_REVIEW_CONTENTS:e=>`https://beta.qratilabs.com/event/${e}/review-contents`,EVENT_DEEP_SEARCH:e=>`https://beta.qratilabs.com/event/${e}/deep-search`,EVENT_GENERATE_ARTICLE:e=>`https://beta.qratilabs.com/event/${e}/generate-article`,EVENT_ACCESS_REQUESTS:e=>`https://beta.qratilabs.com/event/${e}/access-requests`,EVENT_SHOT_INSPECTOR:e=>`https://beta.qratilabs.com/event/${e}/shot-inspector`,EVENT_CURATION_DETAILS:e=>`https://beta.qratilabs.com/event/${e}/curation-details`},Ir={PUBLIC:"PUBLIC",PRIVATE:"PRIVATE",SECRET:"SECRET"},Dr="https://beta.qratilabs.com/api/connect",Lr={INITIALIZE_SESSION:`${Dr}/session/initialize`,REGISTER:`${Dr}/auth/register`,LOGIN:`${Dr}/auth/login`,LOGOUT:`${Dr}/auth/logout`,UPDATE_SESSION:`${Dr}/session/update`,ACCEPT_TERMS:`${Dr}/auth/accept-terms`,EXTERNAL_LOGIN:`${Dr}/auth/external-login`,PUBLIC_EVENTS:`${Dr}/event/public-events`,SEARCH_EVENTS:`${Dr}/event/search`,FOLDER_DETAILS:`${Dr}/folder/details`,NESTED_FOLDERS:`${Dr}/folder/nested-folders`,GET_EVENT_POINTS:`${Dr}/event/points`,ELIGIBLE_TO_CURATE:`${Dr}/content/curation-eligibility`,CONTENT_FOR_CURATION:`${Dr}/content/for-curation`,CURATE_CONTENT:`${Dr}/content/curate`,GET_LEADERBOARD:`${Dr}/event/leaderboard`,GET_UPLOAD_COUNT:`${Dr}/event/upload-count`,SINGLE_UPLOAD:`${Dr}/content/single-upload`,UPDATE_REACTION:`${Dr}/content/update-reaction`,EVENT_DATA:`${Dr}/event/details-with-ads-parameters`,UPDATE_EVENT_LAYOUT:`${Dr}/event/update-layout`,GET_EVENT_STATISTICS:`${Dr}/event/statistics`,GET_CONTENTS:`${Dr}/content/for-gallery`,SEARCH_CONTENTS:`${Dr}/content/search`,GET_CONTENTS_COUNT:`${Dr}/content/count`,UPDATE_AD_ANALYTICS:`${Dr}/event/update-ad-analytics`,UPDATE_GAM_ANALYTICS:`${Dr}/event/update-gam-analytics`,INCREMENT_EVENT_VIEW:`${Dr}/event/increment-view`,SEND_PASSWORD_RESET_CODE:`${Dr}/auth/send-password-reset-code`,VERIFY_PASSWORD_RESET_CODE:`${Dr}/auth/verify-password-reset-code`,RESET_PASSWORD:`${Dr}/auth/reset-password`,REPORT_ERROR:`${Dr}/session/report-error`,GET_POST_PROCESSING_SETTINGS:`${Dr}/event/post-processing-settings`},$r={OWNER:"owner",ADMIN:"admin",MODERATOR:"moderator"},Ur={IMAGE:"IMAGE",VIDEO:"VIDEO",AD:"AD",GAM_AD:"GAM_AD"},Mr={GAM_IMPRESSION:"gam_impression",GAM_VIEWABLE:"gam_viewable",GAM_CLICK:"gam_click"},Fr={ROW:"ROW",COLUMN:"COLUMN",MASONRY:"MASONRY"},qr={IN_REVIEW:"IN_REVIEW",APPROVED:"APPROVED",REJECTED:"REJECTED"},jr={WAITING:"Waiting",UPLOADING:"Uploading",RETRYING:"Retrying",DONE:"Done",FAILED:"Failed",ERROR:"Error"},zr=1048576,Wr={CLOSED:"CLOSED",OPEN:"OPEN",UPCOMING:"UPCOMING"},Hr={WAITING:"Waiting",PROCESSING:"Processing",DONE:"Done"},Gr={TEXT:"text",IMAGE:"image",LOTTIE:"lottie"},Vr={CONTEST:"CONTEST",REACTION:"REACTION"},Br={GRID:"grid",SINGLE:"single"},Qr={POPULAR:"popular",UPLOAD_TIME:"upload",CAPTURE_TIME:"capture"},Zr={[Qr.POPULAR]:{label:"Popular",sortField:"score"},[Qr.UPLOAD_TIME]:{label:"Uploaded",sortField:"createdAt"},[Qr.CAPTURE_TIME]:{label:"Captured",sortField:"capturedAt"}},Kr="map-view-state",Jr=Qr.UPLOAD_TIME,Yr={ASC:"asc",DESC:"desc"},Xr={[Yr.ASC]:{label:"Ascending",sortOrder:""},[Yr.DESC]:{label:"Descending",sortOrder:"-"}},en=Yr.DESC,tn={OWN:"own",CURATED:"curated",ELIGIBLE:"eligible"},rn={NONE:null,LINK:"LINK",EMAIL:"EMAIL",PHONE:"PHONE",SMS:"SMS",WHATSAPP:"WHATSAPP",MESSENGER:"MESSENGER"},nn={[rn.LINK]:"material-symbols:open-in-new-rounded",[rn.EMAIL]:"material-symbols:alternate-email-rounded",[rn.PHONE]:"material-symbols:call-outline",[rn.SMS]:"material-symbols:sms-outline-rounded",[rn.WHATSAPP]:"logos:whatsapp-icon",[rn.MESSENGER]:"logos:messenger"},on={AD_IMPRESSION:"impression",AD_ENGAGEMENT:"engagement",AD_CLICK:"click"},an={QRATI_CONNECT_SESSION:"qrati-connect-session",EVENT_IN_REVIEW_COUNT:e=>`in-review-count-${e}`,CONTENTS_BY_EVENT:e=>`contents-by-event-${e}`},sn=0;function ln(e,t,r,o,a,s){t||(t={});var i,l,c=t;if("ref"in c)for(l in c={},t)"ref"==l?i=t[l]:c[l]=t[l];var u={type:e,props:c,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--sn,__i:-1,__u:0,__source:a,__self:s};if("function"==typeof e&&(i=e.defaultProps))for(l in i)void 0===c[l]&&(c[l]=i[l]);return n.vnode&&n.vnode(u),u}function cn({title:e,children:t}){/* @__PURE__ */
|
|
2
2
|
return ln("div",{className:"mx-auto mt-24 w-fit max-w-xl space-y-8",children:[/* @__PURE__ */ln("svg",{xmlns:"http://www.w3.org/2000/svg",className:"mx-auto h-64 w-fit text-[#ff4800]",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-label":"Error illustration",children:/* @__PURE__ */ln("g",{transform:"translate(-443.142 -257.876)",children:[
|
|
3
3
|
/* @__PURE__ */ln("path",{d:"M898.247,664.1H371.155a30.276,30.276,0,0,1-30.241-30.241V352.525a30.276,30.276,0,0,1,30.241-30.241H898.247a30.276,30.276,0,0,1,30.241,30.241V633.862A30.276,30.276,0,0,1,898.247,664.1Z",transform:"translate(308.867 25.517)",fill:"#fff"}),
|
|
4
4
|
/* @__PURE__ */ln("path",{d:"M557.334,341.82H30.241A30.276,30.276,0,0,1,0,311.578V30.241A30.276,30.276,0,0,1,30.241,0H557.334a30.276,30.276,0,0,1,30.241,30.241V311.578A30.276,30.276,0,0,1,557.334,341.82ZM30.241,1.833A28.441,28.441,0,0,0,1.833,30.241V311.578a28.441,28.441,0,0,0,28.409,28.409H557.334a28.441,28.441,0,0,0,28.409-28.409V30.241A28.441,28.441,0,0,0,557.334,1.833Z",transform:"matrix(0.999, -0.035, 0.035, 0.999, 643.995, 358.158)",fill:"#d6d6e3"}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./CH5eh9L8.js"),t=require("./
|
|
1
|
+
const e=require("./CH5eh9L8.js"),t=require("./Cn5QS0_5.js");let r=require("react");r=e.__toESM(r);var n=({as:e="div",className:r,threshold:n=.5,rootMargin:o="0px",triggerOnce:a,onChange:s,onClick:i,children:l})=>{const h=t.A(null),c=t.A(!1);return t.y(()=>{const e=h.current;if(!e)return;const t=new IntersectionObserver(e=>{e.forEach(e=>{a&&c.current||(e.isIntersecting&&(c.current=!0),s?.(e.isIntersecting))})},{threshold:n,rootMargin:o});return t.observe(e),()=>t.disconnect()},[n,o,s,a]),t.u(e,{ref:h,className:r,onClick:i,children:l})},o=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],a=e=>{let t=0;for(let r=0;r<e.length;r++){let n=e[r];t=83*t+o.indexOf(n)}return t},s=e=>{let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},i=e=>{let t=Math.max(0,Math.min(1,e));return t<=.0031308?Math.trunc(12.92*t*255+.5):Math.trunc(255*(1.055*Math.pow(t,.4166666666666667)-.055)+.5)},l=(e,t)=>(e=>e<0?-1:1)(e)*Math.pow(Math.abs(e),t),h=class extends Error{constructor(e){super(e),this.name="ValidationError",this.message=e}},c=e=>{let t=e>>8&255,r=255&e;return[s(e>>16),s(t),s(r)]},u=(e,t)=>{let r=Math.floor(e/361),n=Math.floor(e/19)%19,o=e%19;return[l((r-9)/9,2)*t,l((n-9)/9,2)*t,l((o-9)/9,2)*t]},d=(e,t,r,n)=>{(e=>{if(!e||e.length<6)throw new h("The blurhash string must be at least 6 characters");let t=a(e[0]),r=Math.floor(t/9)+1,n=t%9+1;if(e.length!==4+2*n*r)throw new h(`blurhash length mismatch: length is ${e.length} but it should be ${4+2*n*r}`)})(e),n|=1;let o=a(e[0]),s=Math.floor(o/9)+1,l=o%9+1,d=(a(e[1])+1)/166,p=new Array(l*s);for(let i=0;i<p.length;i++)p[i]=0===i?c(a(e.substring(2,6))):u(a(e.substring(4+2*i,6+2*i)),d*n);let f=4*t,g=new Uint8ClampedArray(f*r);for(let a=0;a<r;a++)for(let e=0;e<t;e++){let n=0,o=0,h=0;for(let i=0;i<s;i++)for(let s=0;s<l;s++){let c=Math.cos(Math.PI*e*s/t)*Math.cos(Math.PI*a*i/r),u=p[s+i*l];n+=u[0]*c,o+=u[1]*c,h+=u[2]*c}let c=i(n),u=i(o),d=i(h);g[4*e+0+a*f]=c,g[4*e+1+a*f]=u,g[4*e+2+a*f]=d,g[4*e+3+a*f]=255}return g},p=Object.defineProperty,f=Object.defineProperties,g=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,y=(e,t,r)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t)=>{for(var r in t||(t={}))m.call(t,r)&&y(e,r,t[r]);if(b)for(var r of b(t))w.call(t,r)&&y(e,r,t[r]);return e},M=(e,t)=>f(e,g(t)),j=(e,t)=>{var r={};for(var n in e)m.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&b)for(var n of b(e))t.indexOf(n)<0&&w.call(e,n)&&(r[n]=e[n]);return r},O=class extends r.PureComponent{constructor(){super(...arguments),this.canvas=null,this.handleRef=e=>{this.canvas=e,this.draw()},this.draw=()=>{let{hash:e,height:t,punch:r,width:n}=this.props;if(this.canvas){let o=d(e,n,t,r),a=this.canvas.getContext("2d"),s=a.createImageData(n,t);s.data.set(o),a.putImageData(s,0,0)}}}componentDidUpdate(){this.draw()}render(){let e=this.props,{hash:t,height:n,width:o}=e,a=j(e,["hash","height","width"]);return r.createElement("canvas",M(v({},a),{height:n,width:o,ref:this.handleRef}))}};O.defaultProps={height:128,width:128};var x={position:"absolute",top:0,bottom:0,left:0,right:0,width:"100%",height:"100%"},C=class extends r.PureComponent{componentDidUpdate(){if(this.props.resolutionX<=0)throw new Error("resolutionX must be larger than zero");if(this.props.resolutionY<=0)throw new Error("resolutionY must be larger than zero")}render(){let e=this.props,{hash:t,height:n,width:o,punch:a,resolutionX:s,resolutionY:i,style:l}=e,h=j(e,["hash","height","width","punch","resolutionX","resolutionY","style"]);return r.createElement("div",M(v({},h),{style:M(v({display:"inline-block",height:n,width:o},l),{position:"relative"})}),r.createElement(O,{hash:t,height:i,width:s,punch:a,style:x}))}};C.defaultProps={height:128,width:128,resolutionX:32,resolutionY:32};var P=O,E=({src:e,alt:r,threshold:o=.1,rootMargin:a="200px 0px",blurhash:s,containerClassName:i="size-full",wrapperClassName:l,imgClassName:h="",sizeMode:c="cover",position:u="center",delayMs:d=100,delayTime:p,onClick:f})=>{const g=s&&s.length>=6?s:"LEHV6nWB2yk8pyo0adR*.7kCMdnj",[b,m]=t.d(!1),[w,y]=t.d(!1),[v,M]=t.d(!1),j=t.A(null),O="number"==typeof p?p:d,x=l??i;t.y(()=>{if(!b)return v?j.current=window.setTimeout(()=>{y(!0)},O):j.current&&(clearTimeout(j.current),j.current=null),()=>{j.current&&clearTimeout(j.current)}},[v,b,O]);const C=w&&v||b;return t.u(n,{as:"div",className:t.cn(x,"relative overflow-hidden"),threshold:o,rootMargin:a,onChange:e=>M(e),children:[!b&&t.u(P,{className:"size-full blur-2xl",hash:g}),C&&e&&t.u("img",{alt:r,src:e,onLoad:()=>m(!0),className:t.cn("absolute top-0 left-0 size-full object-center transition-all duration-300",b?"scale-100 opacity-100":"scale-95 opacity-0","contain"===c?"object-contain":"object-cover","top"===u?"object-top":"bottom"===u?"object-bottom":"object-center",h),onClick:e=>f?.(e)})]})};Object.defineProperty(exports,"InView",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"LazyLoadImage",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return d}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{At as e,Et as t,J as l,Mt as n,Ot as r,Q as a,h as o,p as s,w as i,wt as d,y as c}from"./
|
|
1
|
+
import{At as e,Et as t,J as l,Mt as n,Ot as r,Q as a,h as o,p as s,w as i,wt as d,y as c}from"./BA-rmyyP.js";import{t as u}from"./CdVkPkqy.js";var h=(e,t)=>e.filter(e=>(e.parentFolderId??null)===t).map(t=>{return{folder:t,children:h(e,t._id),eventCount:t.boundary?.length??0,centroid:(l=t.boundary,l?.length?[l.reduce((e,t)=>e+t.x,0)/l.length,l.reduce((e,t)=>e+t.y,0)/l.length]:null),color:t.color||"#fb8500"};var l}).filter(e=>e.eventCount>0||e.children.length>0),f=e=>e.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y),m=()=>{const{folders:n,organization:o}=s(),[c,u]=t(null),m=Boolean(o?.integrationSettings?.enableFolderView),p=d(()=>m?h(n??[],null):[],[n,m]),b=a({queryKey:["map-all-events",o?._id],queryFn:async()=>f((await l.get(i.PUBLIC_EVENTS,{headers:{"x-org-id":o?._id??""},searchParams:{includeAllFolders:!0,limit:500,sort:"-views",contentLimit:3}}).json()).data??[]),enabled:Boolean(o?._id)&&!m,staleTime:3e5,retry:!1}),g=a({queryKey:["map-folder-events",o?._id,c],queryFn:async()=>f((await l.get(i.PUBLIC_EVENTS,{headers:{"x-org-id":o?._id??""},searchParams:{folderId:c,limit:500,sort:"-views",contentLimit:3}}).json()).data??[]),enabled:Boolean(o?._id)&&m&&Boolean(c),staleTime:3e5,retry:!1}),v=d(()=>(n??[]).find(e=>e._id===c)??null,[n,c]);e(()=>{m||u(null)},[m]);const x=r(e=>{u(e)},[]);return{folderTree:p,activeFolderId:c,activeFolder:v,visibleEvents:m?g.data??[]:b.data??[],setActiveFolderId:x,isLoadingEvents:m?Boolean(c)&&(g.isLoading||g.isFetching):b.isLoading||b.isFetching}},p=()=>/* @__PURE__ */c("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */c("path",{d:"m15 18-6-6 6-6"})}),b=()=>/* @__PURE__ */c("svg",{className:"size-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:/* @__PURE__ */c("path",{d:"m9 18 6-6-6-6"})});function g({items:l,autoplayInterval:r=3e3,showControls:a=!1,className:s}){const[i,d]=t(0);return e(()=>{if(l.length<=1)return;const e=setInterval(()=>d(e=>(e+1)%l.length),r);return()=>clearInterval(e)},[l.length,r]),0===l.length?null:/* @__PURE__ */c("div",{className:o("relative size-full overflow-hidden",s),children:[l.map((e,t)=>/* @__PURE__ */c("div",{className:o("absolute inset-0 transition-opacity duration-500",t===i?"opacity-100":"opacity-0"),children:e},t)),l.length>1&&/* @__PURE__ */c("div",{className:"absolute bottom-2 left-1/2 z-10 flex -translate-x-1/2 gap-1",children:l.map((e,t)=>/* @__PURE__ */c("button",{onClick:()=>d(t),className:o("h-1.5 rounded-full transition-all",t===i?"w-4 bg-white":"w-1.5 bg-white/50 hover:bg-white/75"),"aria-label":`Go to slide ${t+1}`},t))}),a&&l.length>1&&/* @__PURE__ */c(n,{children:[/* @__PURE__ */c("button",{onClick:()=>d(e=>0===e?l.length-1:e-1),className:"absolute top-1/2 left-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Previous",children:/* @__PURE__ */c(p,{})}),/* @__PURE__ */c("button",{onClick:()=>d(e=>(e+1)%l.length),className:"absolute top-1/2 right-2 z-10 flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60","aria-label":"Next",children:/* @__PURE__ */c(b,{})})]})]})}var v=({event:e,onExplore:t})=>/* @__PURE__ */c("div",{className:"w-40 rounded pt-2 pl-1",children:[
|
|
2
2
|
/* @__PURE__ */c("div",{className:"h-32 w-full overflow-hidden rounded",children:/* @__PURE__ */c(g,{items:(e.contents||[]).map(t=>/* @__PURE__ */c(u,{alt:e.name,src:t.thumbnailUrl||t.url,containerClassName:"size-full",imgClassName:"rounded"},t._id)),autoplayInterval:3e3})}),
|
|
3
3
|
/* @__PURE__ */c("div",{className:"line-clamp-2 pt-2 pb-0.5 text-sm font-medium text-black",children:e.name}),
|
|
4
4
|
/* @__PURE__ */c("div",{className:"pb-2 text-xs text-gray-600",children:e.location?.label}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=require("./BarCxWTX.js");function e(e){return{onFetch:(a,n)=>{const r=a.options,o=a.fetchOptions?.meta?.fetchMore?.direction,u=a.state.data?.pages||[],h=a.state.data?.pageParams||[];let c={pages:[],pageParams:[]},l=0;const y=async()=>{let n=!1;const y=t.ensureQueryFn(a.options,a.fetchOptions),d=async(e,s,i)=>{if(n)return Promise.reject();if(null==s&&e.pages.length)return Promise.resolve(e);const r=await y((()=>{const e={client:a.client,queryKey:a.queryKey,pageParam:s,direction:i?"backward":"forward",meta:a.options.meta};var r;return r=e,t.addConsumeAwareSignal(r,()=>a.signal,()=>n=!0),e})()),{maxPages:o}=a.options,u=i?t.addToStart:t.addToEnd;return{pages:u(e.pages,r,o),pageParams:u(e.pageParams,s,o)}};if(o&&u.length){const t="backward"===o,e=t?i:s,a={pages:u,pageParams:h};c=await d(a,e(r,a),t)}else{const t=e??u.length;do{const t=0===l?h[0]??r.initialPageParam:s(r,c);if(l>0&&null==t)break;c=await d(c,t),l++}while(l<t)}return c};a.options.persister?a.fetchFn=()=>a.options.persister?.(y,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},n):a.fetchFn=y}}}function s(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function i(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}function a(t,e){return!!e&&null!=s(t,e)}function n(t,e){return!(!e||!t.getPreviousPageParam)&&null!=i(t,e)}var r=class extends t.Removable{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const s=()=>{this.#a({type:"continue"})},i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=t.createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const a="pending"===this.state.status,n=!this.#i.canStart();try{if(a)s();else{this.#a({type:"pending",variables:e,isPaused:n}),this.#s.config.onMutate&&await this.#s.config.onMutate(e,this,i);const t=await(this.options.onMutate?.(e,i));t!==this.state.context&&this.#a({type:"pending",context:t,variables:e,isPaused:n})}const t=await this.#i.start();return await(this.#s.config.onSuccess?.(t,e,this.state.context,this,i)),await(this.options.onSuccess?.(t,e,this.state.context,i)),await(this.#s.config.onSettled?.(t,null,this.state.variables,this.state.context,this,i)),await(this.options.onSettled?.(t,null,e,this.state.context,i)),this.#a({type:"success",data:t}),t}catch(r){try{await(this.#s.config.onError?.(r,e,this.state.context,this,i))}catch(o){Promise.reject(o)}try{await(this.options.onError?.(r,e,this.state.context,i))}catch(o){Promise.reject(o)}try{await(this.#s.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,i))}catch(o){Promise.reject(o)}try{await(this.options.onSettled?.(void 0,r,e,this.state.context,i))}catch(o){Promise.reject(o)}throw this.#a({type:"error",error:r}),r}finally{this.#s.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),t.notifyManager.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#s.notify({mutation:this,type:"updated",action:e})})}},o=class extends t.Subscribable{constructor(t={}){super(),this.config=t,this.#n=new Set,this.#r=new Map,this.#o=0}#n;#r;#o;build(t,e,s){const i=new r({client:t,mutationCache:this,mutationId:++this.#o,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#n.add(t);const e=u(t);if("string"==typeof e){const s=this.#r.get(e);s?s.push(t):this.#r.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#n.delete(t)){const e=u(t);if("string"==typeof e){const s=this.#r.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#r.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=u(t);if("string"==typeof e){const s=this.#r.get(e)?.find(t=>"pending"===t.state.status);return!s||s===t}return!0}runNext(t){const e=u(t);return"string"==typeof e?(this.#r.get(e)?.find(e=>e!==t&&e.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){t.notifyManager.batch(()=>{this.#n.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#n.clear(),this.#r.clear()})}getAll(){return Array.from(this.#n)}find(e){const s={exact:!0,...e};return this.getAll().find(e=>t.matchMutation(s,e))}findAll(e={}){return this.getAll().filter(s=>t.matchMutation(e,s))}notify(e){t.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return t.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(t.noop))))}};function u(t){return t.options.scope?.id}var h=class extends t.Subscribable{constructor(t={}){super(),this.config=t,this.#u=new Map}#u;build(e,s,i){const a=s.queryKey,n=s.queryHash??t.hashQueryKeyByOptions(a,s);let r=this.get(n);return r||(r=new t.Query({client:e,queryKey:a,queryHash:n,options:e.defaultQueryOptions(s),state:i,defaultOptions:e.getQueryDefaults(a)}),this.add(r)),r}add(t){this.#u.has(t.queryHash)||(this.#u.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#u.get(t.queryHash);e&&(t.destroy(),e===t&&this.#u.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){t.notifyManager.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#u.get(t)}getAll(){return[...this.#u.values()]}find(e){const s={exact:!0,...e};return this.getAll().find(e=>t.matchQuery(s,e))}findAll(e={}){const s=this.getAll();return Object.keys(e).length>0?s.filter(s=>t.matchQuery(e,s)):s}notify(e){t.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){t.notifyManager.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){t.notifyManager.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},c=class{#h;#s;#c;#l;#y;#d;#f;#p;constructor(t={}){this.#h=t.queryCache||new h,this.#s=t.mutationCache||new o,this.#c=t.defaultOptions||{},this.#l=new Map,this.#y=new Map,this.#d=0}mount(){this.#d++,1===this.#d&&(this.#f=t.focusManager.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onFocus())}),this.#p=t.onlineManager.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onOnline())}))}unmount(){this.#d--,0===this.#d&&(this.#f?.(),this.#f=void 0,this.#p?.(),this.#p=void 0)}isFetching(t){return this.#h.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#s.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state.data}ensureQueryData(e){const s=this.defaultQueryOptions(e),i=this.#h.build(this,s),a=i.state.data;return void 0===a?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(t.resolveStaleTime(s.staleTime,i))&&this.prefetchQuery(s),Promise.resolve(a))}getQueriesData(t){return this.#h.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(e,s,i){const a=this.defaultQueryOptions({queryKey:e}),n=this.#h.get(a.queryHash)?.state.data,r=t.functionalUpdate(s,n);if(void 0!==r)return this.#h.build(this,a).setData(r,{...i,manual:!0})}setQueriesData(e,s,i){return t.notifyManager.batch(()=>this.#h.findAll(e).map(({queryKey:t})=>[t,this.setQueryData(t,s,i)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state}removeQueries(e){const s=this.#h;t.notifyManager.batch(()=>{s.findAll(e).forEach(t=>{s.remove(t)})})}resetQueries(e,s){const i=this.#h;return t.notifyManager.batch(()=>(i.findAll(e).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...e},s)))}cancelQueries(e,s={}){const i={revert:!0,...s},a=t.notifyManager.batch(()=>this.#h.findAll(e).map(t=>t.cancel(i)));return Promise.all(a).then(t.noop).catch(t.noop)}invalidateQueries(e,s={}){return t.notifyManager.batch(()=>(this.#h.findAll(e).forEach(t=>{t.invalidate()}),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},s)))}refetchQueries(e,s={}){const i={...s,cancelRefetch:s.cancelRefetch??!0},a=t.notifyManager.batch(()=>this.#h.findAll(e).filter(t=>!t.isDisabled()&&!t.isStatic()).map(e=>{let s=e.fetch(void 0,i);return i.throwOnError||(s=s.catch(t.noop)),"paused"===e.state.fetchStatus?Promise.resolve():s}));return Promise.all(a).then(t.noop)}fetchQuery(e){const s=this.defaultQueryOptions(e);void 0===s.retry&&(s.retry=!1);const i=this.#h.build(this,s);return i.isStaleByTime(t.resolveStaleTime(s.staleTime,i))?i.fetch(s):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t.noop).catch(t.noop)}fetchInfiniteQuery(t){return t.behavior=e(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t.noop).catch(t.noop)}ensureInfiniteQueryData(t){return t.behavior=e(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return t.onlineManager.isOnline()?this.#s.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#h}getMutationCache(){return this.#s}getDefaultOptions(){return this.#c}setDefaultOptions(t){this.#c=t}setQueryDefaults(e,s){this.#l.set(t.hashKey(e),{queryKey:e,defaultOptions:s})}getQueryDefaults(e){const s=[...this.#l.values()],i={};return s.forEach(s=>{t.partialMatchKey(e,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(e,s){this.#y.set(t.hashKey(e),{mutationKey:e,defaultOptions:s})}getMutationDefaults(e){const s=[...this.#y.values()],i={};return s.forEach(s=>{t.partialMatchKey(e,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const s={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return s.queryHash||(s.queryHash=t.hashQueryKeyByOptions(s.queryKey,s)),void 0===s.refetchOnReconnect&&(s.refetchOnReconnect="always"!==s.networkMode),void 0===s.throwOnError&&(s.throwOnError=!!s.suspense),!s.networkMode&&s.persister&&(s.networkMode="offlineFirst"),s.queryFn===t.skipToken&&(s.enabled=!1),s}defaultMutationOptions(t){return t?._defaulted?t:{...this.#c.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#h.clear(),this.#s.clear()}};Object.defineProperty(exports,"QueryClient",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"hasNextPage",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"hasPreviousPage",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"infiniteQueryBehavior",{enumerable:!0,get:function(){return e}});
|
|
1
|
+
const t=require("./Cn5QS0_5.js");function e(e){return{onFetch:(a,n)=>{const r=a.options,o=a.fetchOptions?.meta?.fetchMore?.direction,u=a.state.data?.pages||[],h=a.state.data?.pageParams||[];let c={pages:[],pageParams:[]},l=0;const y=async()=>{let n=!1;const y=t.ensureQueryFn(a.options,a.fetchOptions),d=async(e,s,i)=>{if(n)return Promise.reject();if(null==s&&e.pages.length)return Promise.resolve(e);const r=await y((()=>{const e={client:a.client,queryKey:a.queryKey,pageParam:s,direction:i?"backward":"forward",meta:a.options.meta};var r;return r=e,t.addConsumeAwareSignal(r,()=>a.signal,()=>n=!0),e})()),{maxPages:o}=a.options,u=i?t.addToStart:t.addToEnd;return{pages:u(e.pages,r,o),pageParams:u(e.pageParams,s,o)}};if(o&&u.length){const t="backward"===o,e=t?i:s,a={pages:u,pageParams:h};c=await d(a,e(r,a),t)}else{const t=e??u.length;do{const t=0===l?h[0]??r.initialPageParam:s(r,c);if(l>0&&null==t)break;c=await d(c,t),l++}while(l<t)}return c};a.options.persister?a.fetchFn=()=>a.options.persister?.(y,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},n):a.fetchFn=y}}}function s(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function i(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}function a(t,e){return!!e&&null!=s(t,e)}function n(t,e){return!(!e||!t.getPreviousPageParam)&&null!=i(t,e)}var r=class extends t.Removable{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const s=()=>{this.#a({type:"continue"})},i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=t.createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const a="pending"===this.state.status,n=!this.#i.canStart();try{if(a)s();else{this.#a({type:"pending",variables:e,isPaused:n}),this.#s.config.onMutate&&await this.#s.config.onMutate(e,this,i);const t=await(this.options.onMutate?.(e,i));t!==this.state.context&&this.#a({type:"pending",context:t,variables:e,isPaused:n})}const t=await this.#i.start();return await(this.#s.config.onSuccess?.(t,e,this.state.context,this,i)),await(this.options.onSuccess?.(t,e,this.state.context,i)),await(this.#s.config.onSettled?.(t,null,this.state.variables,this.state.context,this,i)),await(this.options.onSettled?.(t,null,e,this.state.context,i)),this.#a({type:"success",data:t}),t}catch(r){try{await(this.#s.config.onError?.(r,e,this.state.context,this,i))}catch(o){Promise.reject(o)}try{await(this.options.onError?.(r,e,this.state.context,i))}catch(o){Promise.reject(o)}try{await(this.#s.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,i))}catch(o){Promise.reject(o)}try{await(this.options.onSettled?.(void 0,r,e,this.state.context,i))}catch(o){Promise.reject(o)}throw this.#a({type:"error",error:r}),r}finally{this.#s.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),t.notifyManager.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#s.notify({mutation:this,type:"updated",action:e})})}},o=class extends t.Subscribable{constructor(t={}){super(),this.config=t,this.#n=new Set,this.#r=new Map,this.#o=0}#n;#r;#o;build(t,e,s){const i=new r({client:t,mutationCache:this,mutationId:++this.#o,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#n.add(t);const e=u(t);if("string"==typeof e){const s=this.#r.get(e);s?s.push(t):this.#r.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#n.delete(t)){const e=u(t);if("string"==typeof e){const s=this.#r.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#r.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=u(t);if("string"==typeof e){const s=this.#r.get(e)?.find(t=>"pending"===t.state.status);return!s||s===t}return!0}runNext(t){const e=u(t);return"string"==typeof e?(this.#r.get(e)?.find(e=>e!==t&&e.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){t.notifyManager.batch(()=>{this.#n.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#n.clear(),this.#r.clear()})}getAll(){return Array.from(this.#n)}find(e){const s={exact:!0,...e};return this.getAll().find(e=>t.matchMutation(s,e))}findAll(e={}){return this.getAll().filter(s=>t.matchMutation(e,s))}notify(e){t.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return t.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(t.noop))))}};function u(t){return t.options.scope?.id}var h=class extends t.Subscribable{constructor(t={}){super(),this.config=t,this.#u=new Map}#u;build(e,s,i){const a=s.queryKey,n=s.queryHash??t.hashQueryKeyByOptions(a,s);let r=this.get(n);return r||(r=new t.Query({client:e,queryKey:a,queryHash:n,options:e.defaultQueryOptions(s),state:i,defaultOptions:e.getQueryDefaults(a)}),this.add(r)),r}add(t){this.#u.has(t.queryHash)||(this.#u.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#u.get(t.queryHash);e&&(t.destroy(),e===t&&this.#u.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){t.notifyManager.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#u.get(t)}getAll(){return[...this.#u.values()]}find(e){const s={exact:!0,...e};return this.getAll().find(e=>t.matchQuery(s,e))}findAll(e={}){const s=this.getAll();return Object.keys(e).length>0?s.filter(s=>t.matchQuery(e,s)):s}notify(e){t.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){t.notifyManager.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){t.notifyManager.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},c=class{#h;#s;#c;#l;#y;#d;#f;#p;constructor(t={}){this.#h=t.queryCache||new h,this.#s=t.mutationCache||new o,this.#c=t.defaultOptions||{},this.#l=new Map,this.#y=new Map,this.#d=0}mount(){this.#d++,1===this.#d&&(this.#f=t.focusManager.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onFocus())}),this.#p=t.onlineManager.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onOnline())}))}unmount(){this.#d--,0===this.#d&&(this.#f?.(),this.#f=void 0,this.#p?.(),this.#p=void 0)}isFetching(t){return this.#h.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#s.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state.data}ensureQueryData(e){const s=this.defaultQueryOptions(e),i=this.#h.build(this,s),a=i.state.data;return void 0===a?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(t.resolveStaleTime(s.staleTime,i))&&this.prefetchQuery(s),Promise.resolve(a))}getQueriesData(t){return this.#h.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(e,s,i){const a=this.defaultQueryOptions({queryKey:e}),n=this.#h.get(a.queryHash)?.state.data,r=t.functionalUpdate(s,n);if(void 0!==r)return this.#h.build(this,a).setData(r,{...i,manual:!0})}setQueriesData(e,s,i){return t.notifyManager.batch(()=>this.#h.findAll(e).map(({queryKey:t})=>[t,this.setQueryData(t,s,i)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state}removeQueries(e){const s=this.#h;t.notifyManager.batch(()=>{s.findAll(e).forEach(t=>{s.remove(t)})})}resetQueries(e,s){const i=this.#h;return t.notifyManager.batch(()=>(i.findAll(e).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...e},s)))}cancelQueries(e,s={}){const i={revert:!0,...s},a=t.notifyManager.batch(()=>this.#h.findAll(e).map(t=>t.cancel(i)));return Promise.all(a).then(t.noop).catch(t.noop)}invalidateQueries(e,s={}){return t.notifyManager.batch(()=>(this.#h.findAll(e).forEach(t=>{t.invalidate()}),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},s)))}refetchQueries(e,s={}){const i={...s,cancelRefetch:s.cancelRefetch??!0},a=t.notifyManager.batch(()=>this.#h.findAll(e).filter(t=>!t.isDisabled()&&!t.isStatic()).map(e=>{let s=e.fetch(void 0,i);return i.throwOnError||(s=s.catch(t.noop)),"paused"===e.state.fetchStatus?Promise.resolve():s}));return Promise.all(a).then(t.noop)}fetchQuery(e){const s=this.defaultQueryOptions(e);void 0===s.retry&&(s.retry=!1);const i=this.#h.build(this,s);return i.isStaleByTime(t.resolveStaleTime(s.staleTime,i))?i.fetch(s):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t.noop).catch(t.noop)}fetchInfiniteQuery(t){return t.behavior=e(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t.noop).catch(t.noop)}ensureInfiniteQueryData(t){return t.behavior=e(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return t.onlineManager.isOnline()?this.#s.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#h}getMutationCache(){return this.#s}getDefaultOptions(){return this.#c}setDefaultOptions(t){this.#c=t}setQueryDefaults(e,s){this.#l.set(t.hashKey(e),{queryKey:e,defaultOptions:s})}getQueryDefaults(e){const s=[...this.#l.values()],i={};return s.forEach(s=>{t.partialMatchKey(e,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(e,s){this.#y.set(t.hashKey(e),{mutationKey:e,defaultOptions:s})}getMutationDefaults(e){const s=[...this.#y.values()],i={};return s.forEach(s=>{t.partialMatchKey(e,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const s={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return s.queryHash||(s.queryHash=t.hashQueryKeyByOptions(s.queryKey,s)),void 0===s.refetchOnReconnect&&(s.refetchOnReconnect="always"!==s.networkMode),void 0===s.throwOnError&&(s.throwOnError=!!s.suspense),!s.networkMode&&s.persister&&(s.networkMode="offlineFirst"),s.queryFn===t.skipToken&&(s.enabled=!1),s}defaultMutationOptions(t){return t?._defaulted?t:{...this.#c.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#h.clear(),this.#s.clear()}};Object.defineProperty(exports,"QueryClient",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"hasNextPage",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"hasPreviousPage",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"infiniteQueryBehavior",{enumerable:!0,get:function(){return e}});
|