1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`production-pr13737-c504d19`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`0cf92761-269e-4eda-ba85-d98dd78fb0b1`,e._sentryDebugIdIdentifier=`sentry-dbid-0cf92761-269e-4eda-ba85-d98dd78fb0b1`)}catch{}})();import{o as e}from"./chunk-tka67DF4.js";import{S as t,T as n,_ as r,b as i,c as a,d as o,f as s,g as c,l,m as u,n as d,p as f,s as p,t as m,u as h,v as g,w as _,x as v,y}from"./tanstackReactQueryClient-X_DsJsbx.js";import{D as b,M as x,O as S,S as C,_ as w,c as T,g as E,i as D,j as ee,k as O,n as te,o as k,p as A,r as j,w as M,y as N}from"./zod-BOi56eC9.js";var P=class extends n{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=h(),this.options.experimental_prefetchInRender||this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`)),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),re(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ie(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ie(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof y(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!v(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&ae(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||y(this.options.enabled,this.#t)!==y(t.enabled,this.#t)||i(this.options.staleTime,this.#t)!==i(t.staleTime,this.#t))&&this.#g();let a=this.#_();r&&(this.#t!==n||y(this.options.enabled,this.#t)!==y(t.enabled,this.#t)||a!==this.#p)&&this.#v(a)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return se(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c)),t}#g(){this.#b();let e=i(this.options.staleTime,this.#t);if(f||this.#r.isStale||!u(e))return;let t=_(this.#r.dataUpdatedAt,e)+1;this.#d=setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(f||y(this.options.enabled,this.#t)===!1||!u(this.#p)||this.#p===0)&&(this.#f=setInterval(()=>{(this.options.refetchIntervalInBackground||o.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(clearTimeout(this.#d),void 0)}#x(){this.#f&&=(clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,i=this.options,o=this.#r,s=this.#i,c=this.#a,l=e===n?this.#n:e.state,{state:u}=e,d={...u},f=!1,p;if(t._optimisticResults){let r=this.hasListeners(),o=!r&&re(e,t),s=r&&ae(e,n,t,i);(o||s)&&(d={...d,...a(u.data,e.options)}),t._optimisticResults===`isRestoring`&&(d.fetchStatus=`idle`)}let{error:m,errorUpdatedAt:g,status:_}=d;p=d.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&_===`pending`){let e;o?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=
1o.data,v=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(_=`success`,p=r(o?.data,e,t),f=!0)}if(t.select&&p!==void 0&&!v)if(o&&p===s?.data&&t.select===this.#c)p=this.#l;else try{this.#c=t.select,p=t.select(p),p=r(o?.data,p,t),this.#l=p,this.#s=null}catch(e){this.#s=e}this.#s&&(m=this.#s,p=this.#l,g=Date.now(),_=`error`);let b=d.fetchStatus===`fetching`,x=_===`pending`,S=_===`error`,C=x&&b,w=p!==void 0,T={status:_,fetchStatus:d.fetchStatus,isPending:x,isSuccess:_===`success`,isError:S,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:S&&!w,isPaused:d.fetchStatus===`paused`,isPlaceholderData:f,isRefetchError:S&&w,isStale:oe(e,t),refetch:this.refetch,promise:this.#o,isEnabled:y(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=e=>{T.status===`error`?e.reject(T.error):T.data!==void 0&&e.resolve(T.data)},r=()=>{t(this.#o=T.promise=h())},i=this.#o;switch(i.status){case`pending`:e.queryHash===n.queryHash&&t(i);break;case`fulfilled`:(T.status===`error`||T.data!==i.value)&&r();break;case`rejected`:(T.status!==`error`||T.error!==i.reason)&&r();break}}return T}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!v(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){l.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function ne(e,t){return y(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function re(e,t){return ne(e,t)||e.state.data!==void 0&&ie(e,t,t.refetchOnMount)}function ie(e,t,n){if(y(t.enabled,e)!==!1&&i(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&oe(e,t)}return!1}function ae(e,t,n,r){return(e!==t||y(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&oe(e,n)}function oe(e,t){return y(t.enabled,e)!==!1&&e.isStaleByTime(i(t.staleTime,e))}function se(e,t){return!v(e.getCurrentResult(),t)}var ce=class extends n{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),v(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&s(t.mutationKey)!==s(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??p();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){l.batch(()=>
1{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context;e?.type===`success`?(this.#r.onSuccess?.(e.data,t,n),this.#r.onSettled?.(e.data,null,t,n)):e?.type===`error`&&(this.#r.onError?.(e.error,t,n),this.#r.onSettled?.(void 0,e.error,t,n))}this.listeners.forEach(e=>{e(this.#t)})})}},F=e(x(),1),le=ee(),ue=F.createContext(void 0),I=e=>{let t=F.useContext(ue);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},de=({client:e,children:t})=>(F.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,le.jsx)(ue.Provider,{value:e,children:t})),fe=F.createContext(!1),pe=()=>F.useContext(fe);fe.Provider;function me(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var he=F.createContext(me()),ge=()=>F.useContext(he),_e=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},ve=e=>{F.useEffect(()=>{e.clearReset()},[e])},ye=({result:e,errorResetBoundary:n,throwOnError:r,query:i,suspense:a})=>e.isError&&!n.isReset()&&!e.isFetching&&i&&(a&&e.data===void 0||t(r,[e.error,i])),be=(e,t)=>t.state.data===void 0,xe=e=>{if(e.suspense){let t=e=>e===`static`?e:Math.max(e??1e3,1e3),n=e.staleTime;e.staleTime=typeof n==`function`?(...e)=>t(n(...e)):t(n),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,1e3))}},Se=(e,t)=>e.isLoading&&e.isFetching&&!t,Ce=(e,t)=>e?.suspense&&t.isPending,L=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function R(e,t,n){let r=pe(),i=ge(),a=I(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=r?`isRestoring`:`optimistic`,xe(o),_e(o,i),ve(i);let s=!a.getQueryCache().get(o.queryHash),[u]=F.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),p=!r&&e.subscribed!==!1;if(F.useSyncExternalStore(F.useCallback(e=>{let t=p?u.subscribe(l.batchCalls(e)):c;return u.updateResult(),t},[u,p]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),F.useEffect(()=>{u.setOptions(o)},[o,u]),Ce(o,d))throw L(o,u,i);if(ye({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!f&&Se(d,r)&&(s?L(o,u,i):a.getQueryCache().get(o.queryHash)?.promise)?.catch(c).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function we(e,t){return R(e,P,t)}function Te(e,t){return R({...e,enabled:!0,suspense:!0,throwOnError:be,placeholderData:void 0},P,t)}function Ee(e,t){let n=I(t);return Oe({filters:{...e,status:`pending`}},n).length}function De(e,t){return e.findAll(t.filters).map(e=>t.select?t.select(e):e.state)}function Oe(e={},t){let n=I(t).getMutationCache(),r=F.useRef(e),i=F.useRef(null);return i.current||=De(n,e),F.useEffect(()=>{r.current=e}),F.useSyncExternalStore(F.useCallback(e=>n.subscribe(()=>{let t=g(i.current,De(n,r.current));i.current!==t&&(i.current=t,l.schedule(e))}),[n]),()=>i.current,()=>i.current)}function ke(e,n){let r=I(n),[i]=F.useState(()=>new ce(r,e));F.useEffect(()=>{i.setOptions(e)},[i,e]);let a=F.useSyncExternalStore(F.useCallback(e=>i.subscribe(l.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),o=F.useCallback((e,t)=>{i.mutate(e,t).catch(c)},[i]);if(a.error&&t(i.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}function z(e){return`init`in e}function Ae(e){return!!e.write}function B(e){return`v`in e||`e`in e}function V(e){if(`e`in e)throw e.e;return e.v}var H=new WeakMap;function je(e){return W(e)&&!!H.get(e)?.[0]}function Me(e){let t=H.get(e);t?.[0]&&(t[0]=!1,t[1].forEach(e=>e()))}function U(e,t){let n=H.get(e);if(!n){n=[!0,new Set],H.set(e,n);let t=()=>{n[0]=!1};e.then(t,t)}n[1].add(t)}function W(e){return typeof e?.then==`function`}function Ne(e,t,n){if(!n.p.has(e)){n.p.add(e);let r=()=>n.p.delete(e);t.then(r,r)}}function Pe(e,t,n){let r=new Set;for(let t of n.get(e)?.t||[])n.has(t)&&r.add(t);for(let e of t.p)r.add(e);return r}var Fe=()=>{let e=new Set,t=()=>
1e.forEach(e=>e());return t.add=t=>(e.add(t),()=>e.delete(t)),t},G=()=>{let e={},t=new WeakMap,n=n=>{var r,i;(r=t.get(e))==null||r.forEach(e=>e(n)),(i=t.get(n))==null||i.forEach(e=>e())};return n.add=(n,r)=>{let i=n||e,a=(t.has(i)?t:t.set(i,new Set)).get(i);return a.add(r),()=>{a?.delete(r),a.size||t.delete(i)}},n};function Ie(e){return e.r||=G(),e.c||=G(),e.m||=G(),e.u||=G(),e.f||=Fe(),e}var Le=(e,t,...n)=>t.read(...n),Re=(e,t,...n)=>t.write(...n),ze=(e,t)=>t.unstable_onInit?.call(t,e),Be=(e,t,n)=>t.onMount?.call(t,n),Ve=(e,t)=>{let n=q(e),r=n[0],i=n[9],a=r.get(t);return a||(a={d:new Map,p:new Set,n:0},r.set(t,a),i?.(e,t)),a},He=e=>{let t=q(e),n=t[1],r=t[3],i=t[4],a=t[5],o=t[6],s=t[13],c=[],l=e=>{try{e()}catch(e){c.push(e)}};do{o.f&&l(o.f);let t=new Set,c=t.add.bind(t);r.forEach(e=>n.get(e)?.l.forEach(c)),r.clear(),a.forEach(c),a.clear(),i.forEach(c),i.clear(),t.forEach(l),r.size&&s(e)}while(r.size||a.size||i.size);if(c.length)throw AggregateError(c)},Ue=e=>{let t=q(e),n=t[1],r=t[2],i=t[3],a=t[11],o=t[14],s=t[17],c=[],l=new WeakSet,u=new WeakSet,d=Array.from(i);for(;d.length;){let t=d[d.length-1],i=a(e,t);if(u.has(t)){d.pop();continue}if(l.has(t)){r.get(t)===i.n&&c.push([t,i]),u.add(t),d.pop();continue}l.add(t);for(let e of Pe(t,i,n))l.has(e)||d.push(e)}for(let t=c.length-1;t>=0;--t){let[n,a]=c[t],l=!1;for(let e of a.d.keys())if(e!==n&&i.has(e)){l=!0;break}l&&(o(e,n),s(e,n)),r.delete(n)}},We=(e,t)=>{var n,r;let i=q(e),a=i[1],o=i[2],s=i[3],c=i[6],l=i[7],u=i[11],d=i[12],f=i[13],p=i[14],m=i[16],h=i[17],g=u(e,t);if(B(g)&&(a.has(t)&&o.get(t)!==g.n||Array.from(g.d).every(([t,n])=>p(e,t).n===n)))return g;g.d.clear();let _=!0;function v(){a.has(t)&&(h(e,t),f(e),d(e))}function y(n){var r;if(n===t){let t=u(e,n);if(!B(t))if(z(n))K(e,n,n.init);else throw Error(`no atom init`);return V(t)}let i=p(e,n);try{return V(i)}finally{g.d.set(n,i.n),je(g.v)&&Ne(t,g.v,i),(r=a.get(n))==null||r.t.add(t),_||v()}}let b,x,S={get signal(){return b||=new AbortController,b.signal},get setSelf(){return!x&&Ae(t)&&(x=(...n)=>{if(!_)try{return m(e,t,...n)}finally{f(e),d(e)}}),x}},C=g.n;try{let r=l(e,t,y,S);return K(e,t,r),W(r)&&(U(r,()=>b?.abort()),r.then(v,v)),(n=c.r)==null||n.call(c,t),g}catch(e){return delete g.v,g.e=e,++g.n,g}finally{_=!1,C!==g.n&&o.get(t)===C&&(o.set(t,g.n),s.add(t),(r=c.c)==null||r.call(c,t))}},Ge=(e,t)=>{let n=q(e),r=n[1],i=n[2],a=n[11],o=[t];for(;o.length;){let t=o.pop(),n=a(e,t);for(let s of Pe(t,n,r)){let t=a(e,s);i.set(s,t.n),o.push(s)}}},Ke=(e,t,...n)=>{let r=q(e),i=r[3],a=r[6],o=r[8],s=r[11],c=r[12],l=r[13],u=r[14],d=r[15],f=r[17],p=!0,m=t=>V(u(e,t)),h=(n,...r)=>{var o;let u=s(e,n);try{if(n===t){if(!z(n))throw Error(`atom not writable`);let t=u.n,s=r[0];K(e,n,s),f(e,n),t!==u.n&&(i.add(n),(o=a.c)==null||o.call(a,n),d(e,n));return}else return Ke(e,n,...r)}finally{p||(l(e),c(e))}};try{return o(e,t,m,h,...n)}finally{p=!1}},qe=(e,t)=>{var n;let r=q(e),i=r[1],a=r[3],o=r[6],s=r[11],c=r[15],l=r[18],u=r[19],d=s(e,t),f=i.get(t);if(f&&!je(d.v)){for(let[r,i]of d.d)if(!f.d.has(r)){let u=s(e,r);l(e,r).t.add(t),f.d.add(r),i!==u.n&&(a.add(r),(n=o.c)==null||n.call(o,r),c(e,r))}for(let n of f.d||[])d.d.has(n)||(f.d.delete(n),u(e,n)?.t.delete(t))}},Je=(e,t)=>{var n;let r=q(e),i=r[1],a=r[4],o=r[6],s=r[10],c=r[11],l=r[12],u=r[13],d=r[14],f=r[16],p=c(e,t),m=i.get(t);if(!m){d(e,t);for(let n of p.d.keys())Je(e,n).t.add(t);m={l:new Set,d:new Set(p.d.keys()),t:new Set},i.set(t,m),(n=o.m)==null||n.call(o,t),Ae(t)&&a.add(()=>{let n=!0,r=(...r)=>{try{return f(e,t,...r)}finally{n||(u(e),l(e))}};try{let i=s(e,t,r);i&&(m.u=()=>{n=!0;try{i()}finally{n=!1}})}finally{n=!1}})}return m},Ye=(e,t)=>{var n;let r=q(e),i=r[1],a=r[5],o=r[6],s=r[11],c=r[19],l=s(e,t),u=i.get(t);if(u&&!u.l.size&&!Array.from(u.t).some(e=>i.get(e)?.d.has(t))){u.u&&a.add(u.u),u=void 0,i.delete(t),(n=o.u)==null||n.call(o,t);for(let n of l.d.keys())c(e,n)?.t.delete(t);return}return u},K=(e,t,n)=>{let r=q(e)[11],i=r(e,t),a=`v`in i,o=i.v;if(W(n))for(let a of i.d.keys())Ne(t,n,r(e,a));i.v=n,delete i.e,(!a||!Object.is(o,i.v))&&(++i.n,W(o)&&Me(o))},Xe=(e,t)=>{let n=q(e)[14];return V(n(e,t))},Ze=(e,t,...n)=>{let r=q(e),i=r[12],a=r[13],o=r[16];try{return o(e,t,...n)}finally{a(e),i(e)}},Qe=(e,t,n)=>{let r=q(e),i=r[12],a=r[18],o=r[19],s=a(e,t).l;return s.add(n),i(e),()=>{s.delete(n),o(e,t),i(e)}},$e=new WeakMap,q=e=>$e.get(e);function et(e){let t=q(e),n=t[24];return n?n(t):t}function tt(...e){let t={get(e){let n=q(t)[21];return n(t,e)},set(e,...n){let r=q(t)[22];return r(t,e,...n)},sub(e,n){let r=q(t)[23];return r(t,e,n)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},Le,Re,ze,Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,K,Xe,Ze,Qe,void 0].map((t,n)=>e[n]||t);return $e.set(t,Object.freeze(n)),t}var nt=0;function rt(e,t){let n=`atom${++nt}`,r={toString(){return n}};return typeof e==`function`?r.read=e:(r.init=e,r.read=it,r.write=at),t&&(r.write=t),r}function it(e){return e(this)}function at(e,t,n){return t(this,typeof n==`function`?n(e(this)):n)}var ot;function J(){return ot?ot():tt()}var st;function ct(){return st||=J(),st}var lt=(0,F.createContext)(void 0);function Y(e){let t=(0,F.useContext)(lt);return e?.store||t||ct()}function ut({children:e,store:t}){let n=(0,F.useRef)(void 0);return!t&&!n.current&&(n.current=J()),(0,F.createElement)(lt.Provider,{value:t||n.current},e)}var X=e=>typeof e?.then==`function`,dt=e=>{e.status||(e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}))},ft=F.use||(e=>
1{if(e.status===`pending`)throw e;if(e.status===`fulfilled`)return e.value;throw e.status===`rejected`?e.reason:(dt(e),e)}),pt=new WeakMap,mt=(e,t)=>{let n=pt.get(e);return n||(n=new Promise((r,i)=>{let a=e,o=e=>t=>{a===e&&r(t)},s=e=>t=>{a===e&&i(t)},c=()=>{try{let e=t();X(e)?(pt.set(e,n),a=e,e.then(o(e),s(e)),U(e,c)):r(e)}catch(e){i(e)}};e.then(o(e),s(e)),U(e,c)}),pt.set(e,n)),n};function ht(e,t){let{delay:n,unstable_promiseStatus:r=!F.use}=t||{},i=Y(t),[[a,o,s],c]=(0,F.useReducer)(t=>{let n=i.get(e);return Object.is(t[0],n)&&t[1]===i&&t[2]===e?t:[n,i,e]},void 0,()=>[i.get(e),i,e]),l=a;if((o!==i||s!==e)&&(c(),l=i.get(e)),(0,F.useEffect)(()=>{let t=i.sub(e,()=>{if(r)try{let t=i.get(e);X(t)&&dt(mt(t,()=>i.get(e)))}catch{}if(typeof n==`number`){setTimeout(c,n);return}c()});return c(),t},[i,e,n,r]),(0,F.useDebugValue)(l),X(l)){let t=mt(l,()=>i.get(e));return r&&dt(t),ft(t)}return l}function gt(e,t){let n=Y(t);return(0,F.useCallback)((...t)=>n.set(e,...t),[n,e])}function _t(e,t){return[ht(e,t),gt(e,t)]}var vt=Error(`request for lock canceled`),yt=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},bt=class{constructor(e,t=vt){this._value=e,this._cancelError=t,this._queue=[],this._weightedWaiters=[]}acquire(e=1,t=0){if(e<=0)throw Error(`invalid weight ${e}: must be positive`);return new Promise((n,r)=>{let i={resolve:n,reject:r,weight:e,priority:t},a=St(this._queue,e=>t<=e.priority);a===-1&&e<=this._value?this._dispatchItem(i):this._queue.splice(a+1,0,i)})}runExclusive(e){return yt(this,arguments,void 0,function*(e,t=1,n=0){let[r,i]=yield this.acquire(t,n);try{return yield e(r)}finally{i()}})}waitForUnlock(e=1,t=0){if(e<=0)throw Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,t)?Promise.resolve():new Promise(n=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),xt(this._weightedWaiters[e-1],{resolve:n,priority:t})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach(e=>e.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){let t=this._value;this._value-=e.weight,e.resolve([t,this._newReleaser(e.weight)])}_newReleaser(e){let t=!1;return()=>{t||(t=!0,this.release(e))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let e=this._value;e>0;e--){let t=this._weightedWaiters[e-1];t&&(t.forEach(e=>e.resolve()),this._weightedWaiters[e-1]=[])}else{let e=this._queue[0].priority;for(let t=this._value;t>0;t--){let n=this._weightedWaiters[t-1];if(!n)continue;let r=n.findIndex(t=>t.priority<=e);(r===-1?n:n.splice(0,r)).forEach((e=>e.resolve()))}}}_couldLockImmediately(e,t){return(this._queue.length===0||this._queue[0].priority<t)&&e<=this._value}};function xt(e,t){let n=St(e,e=>t.priority<=e.priority);e.splice(n+1,0,t)}function St(e,t){for(let n=e.length-1;n>=0;n--)if(t(e[n]))return n;return-1}var Ct=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},wt=class{constructor(e){this._semaphore=new bt(1,e)}acquire(){return Ct(this,arguments,void 0,function*(e=0){let[,t]=yield this._semaphore.acquire(1,e);return t})}runExclusive(e,t=0){return this._semaphore.runExclusive(()=>e(),1,t)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}},Tt=O({local:!0}),Et=O({local:!0}).transform(e=>e.endsWith(`Z`)?e:`${e}
1Z`).pipe(O()),Dt=e=>e===``||e===void 0?null:e;function Ot(e){if(typeof e!=`object`||!e||!(`coordinates`in e))return e;let t=e;return{...t,coordinates:kt(t.coordinates)}}function kt(e){if(!Array.isArray(e)||e.length===0)return e;if(!Array.isArray(e[0])){let t=e.findIndex(e=>typeof e!=`number`||Number.isNaN(e));return t===-1?e:e.slice(0,t)}return e.map(kt)}var At=(e,t)=>n=>Math.max(e,Math.min(t,n)),jt=e=>t=>Math.max(e,t),Mt=e=>Math.max(0,e),Nt=e=>Math.max(1,e),Pt=j([`dd`,`ddm`,`dms`,`utm`]),Ft=j([`metric`,`imperial`]),It=E().positive().int(),Lt=w({experiment:C(),bucket:C().nullable()}),Rt=j([`EVERYONE`,`FRIENDS`,`JUST_ME`]),zt=w({id:E(),link:C(),displayName:C(),image:C().nullable()}),Bt=E().transform(jt(Date.parse(`2001-01-01`)));w({coordinateFormat:M([A(``),Pt]),corsProxyUrl:N(Dt,M([D(),C().startsWith(`https://staging-cors-proxy.gaiagps.xyz`),C().startsWith(`https://cors-proxy.gaiagps.com/?jwt=`)])),hasPremiumSubscription:T(),hasSubscription:T(),isAuthenticated:T(),unitSystem:M([A(``),Ft]),amplitudeDeviceId:C().nonempty(),dateJoined:M([A(0),Bt]),discoverAnalyticsEnabled:T().nullable().transform(e=>e??!0),displayName:C(),email:C(),experiments:k(Lt),hasMobileApp:T(),hasOutsidePlusSubscription:T(),id:It.nullable(),image:C().nullable(),isEligibleForTrial:T(),isHijacked:te(),isRanger:te(),isStaff:T(),isTeamAdmin:T(),publicStatsSetting:Rt.nullable(),rivtUniqueId:b().nullable(),webAnalyticsEnabled:T()}).pick({coordinateFormat:!0,corsProxyUrl:!0,hasPremiumSubscription:!0,hasSubscription:!0,isAuthenticated:!0,unitSystem:!0}).transform(e=>{let t=e.isAuthenticated?e.unitSystem||`imperial`:navigator.language===`en-US`?`imperial`:`metric`,n=e.coordinateFormat||`dd`;return{...e,coordinateFormat:n,unitSystem:t}});var Vt=w({id:C(),algorithm:C(),secret_id:C(),digest:C()}),Ht=j([`OWNER`,`ADMIN`,`WRITE`,`READ`]).readonly(),Ut=w({id:E(),link:C(),display_name:C(),image:C().nullable()}),Wt=j([`public`,`followers`,`private`]).nullable(),Gt=N(e=>e===null?!0:e,T()),Kt=w({public:T(),posts_visible_to:M([A(`public`),A(`followers`),A(`private`)])}),qt=N(e=>e===``?navigator.language===`en-US`?`imperial`:`metric`:e,Ft),Jt=j([`free`,`member`,`premium`,`outside_plus`]),Yt=w({amplitude_device_id:C().nonempty(),avatar:C().nullable(),bio:C().nullable(),coordinate_format:Pt,cors_proxy_url:N(Dt,M([D(),C().startsWith(`https://staging-cors-proxy.gaiagps.xyz`),C().startsWith(`https://cors-proxy.gaiagps.com/?jwt=`)])),date_joined:Bt,didomi_auth:Vt.nullable(),discover_analytics_enabled:Gt.nullable(),display_name:C(),distance_units:qt,email:C().nullable(),experiments:k(Lt),has_mobile_app:T(),id:It,is_authenticated:A(!0),is_eligible_for_trial:T(),is_hijacked:T(),is_ranger:T().nullable(),is_staff:T(),is_team_admin:T(),location:C().nullable(),privacy_policy_acknowledged_at:Tt.nullable(),privacy_settings:Kt,rivt_unique_id:b().nullable(),subscription_level:Jt,web_analytics_enabled:T().nullable()}),Xt=w({amplitude_device_id:C().nonempty(),avatar:D(),bio:D(),coordinate_format:A(`dd`),cors_proxy_url:D(),date_joined:D(),didomi_auth:D(),discover_analytics_enabled:A(!0),display_name:D(),distance_units:qt,email:D(),experiments:k(Lt),has_mobile_app:A(!1),id:D(),is_authenticated:A(!1),is_eligible_for_trial:A(!0),is_hijacked:A(!1),is_ranger:A(!1),is_staff:A(!1),is_team_admin:A(!1),location:D(),privacy_policy_acknowledged_at:D(),privacy_settings:D(),rivt_unique_id:D(),subscription_level:A(`free`),web_analytics_enabled:A(!0)}),Zt=M([Yt.transform(e=>({amplitudeDeviceId:e.amplitude_device_id,bio:e.bio??``,coordinateFormat:e.coordinate_format,corsProxyUrl:e.cors_proxy_url,dateJoined:e.date_joined,didomiAuth:e.didomi_auth,discoverAnalyticsEnabled:e.discover_analytics_enabled??!0,displayName:e.display_name,email:e.email??``,experiments:e.experiments,hasMobileApp:e.has_mobile_app,id:e.id,image:e.avatar,isAuthenticated:e.is_authenticated,isEligibleForTrial:e.is_eligible_for_trial,isHijacked:e.is_hijacked,isRanger:e.is_ranger??!1,isStaff:e.is_staff,isTeamAdmin:e.is_team_admin,location:e.location??``,privacyPolicyAcknowledgedAt:e.privacy_policy_acknowledged_at,privacySettings:e.privacy_settings,rivtUniqueId:e.rivt_unique_id,subscriptionLevel:e.subscription_level,unitSystem:e.distance_units,webAnalyticsEnabled:e.web_analytics_enabled??!0})),Xt.transform(e=>({amplitudeDeviceId:e.amplitude_device_id,bio:e.bio,coordinateFormat:e.co
1ordinate_format,corsProxyUrl:e.cors_proxy_url,dateJoined:e.date_joined,didomiAuth:e.didomi_auth,discoverAnalyticsEnabled:e.discover_analytics_enabled,displayName:e.display_name,email:e.email,experiments:e.experiments,hasMobileApp:e.has_mobile_app,id:e.id,image:e.avatar,isAuthenticated:e.is_authenticated,isEligibleForTrial:e.is_eligible_for_trial,isHijacked:e.is_hijacked,isRanger:e.is_ranger,isStaff:e.is_staff,isTeamAdmin:e.is_team_admin,location:e.location,privacyPolicyAcknowledgedAt:e.privacy_policy_acknowledged_at,privacySettings:e.privacy_settings,rivtUniqueId:e.rivt_unique_id,subscriptionLevel:e.subscription_level,unitSystem:e.distance_units,webAnalyticsEnabled:e.web_analytics_enabled}))]),Qt=Error(`Missing CSRF token`);function $t(){if(typeof window>`u`)throw Error(`Can't get CSRF token in SSR`);try{let e=window.document.cookie.split(`;`).map(e=>e.trim()).find(e=>e.startsWith(`csrftoken=`))?.split(`=`).at(1)||window.document.querySelector(`[name=csrfmiddlewaretoken]`)?.getAttribute(`value`);if(!e)throw Qt;return decodeURIComponent(e)}catch(e){throw console.error(e===Qt?`CSRF cookie not found`:`error parsing CSRF token`,e),Qt}}function en(){return{"X-CSRFToken":$t()}}function tn(e={}){return{...e,...en()}}function nn(e){return e!==`free`}function rn(e){return e===`premium`||e===`outside_plus`}function an(e){return e===`outside_plus`}var Z={all:[`user`],profile:()=>[...Z.all,`profile`],subscriptionStatus:()=>[...Z.all,`subscriptionStatus`],mutations:{profile:()=>[`mutate`,...Z.profile()]}},on=async({signal:e})=>{let t=await fetch(`/api/v3/user/`,{signal:e,headers:{"cache-control":`no-store`},credentials:`include`});if(!t.ok)throw Error(`Failed to fetch user profile`,{cause:t});return Zt.parse(await t.json())},sn=typeof window<`u`&&typeof window.getServerSideProps==`function`?getServerSideProps?.()?.user:void 0;function Q(){return d({queryKey:Z.profile(),queryFn:on,staleTime:1/0,retry:(e,t)=>!(t instanceof S),initialData:sn?Zt.parse(sn):void 0})}function $(){return Te(Q()).data??{isAuthenticated:!1}}function cn(){let e=$();if(!e.isAuthenticated)throw Error(`Expected an authed user`);return e}function ln(){return $().isAuthenticated}function un(){return rn($().subscriptionLevel)}function dn(){return nn($().subscriptionLevel)}function fn(){return we(Q()).data?.isAuthenticated??!1}function pn(){let{unitSystem:e}=$();return(0,F.useMemo)(()=>({unitSystem:e,units:e===`imperial`?`feet`:`meters`,distanceUnits:e===`imperial`?`miles`:`kilometers`,intlUnit:e===`metric`?`meter`:`foot`,intlDistanceUnit:e===`metric`?`kilometer`:`mile`,unitsAbbr:e===`imperial`?`ft`:`m`,distanceUnitsAbbr:e===`imperial`?`mi`:`km`}),[e])}var mn=new wt;function hn(){return ke({mutationKey:Z.mutations.profile(),async mutationFn(e){await mn.acquire();let t;if(`avatar`in e){let n=new FormData;n.append(`avatar`,e.avatar),t=await fetch(`/api/v3/user/`,{method:`PATCH`,headers:en(),body:n})}else t=await fetch(`/api/v3/user/`,{method:`PATCH`,headers:tn({"Content-Type":`application/json`}),body:JSON.stringify(e)});if(!t.ok)throw Error(`Failed to update user properties`,{cause:t});return Zt.parse(await t.json())},onError:e=>reportError(e),onSuccess:e=>m.setQueryData(Z.profile(),e),onSettled:()=>mn.release()})}function gn(){return Ee({mutationKey:Z.mutations.profile()})>0}var _n=new P(m,Q());function vn(e){return _n.subscribe(e)}async function yn(){return await m.fetchQuery(Q())}export{R as $,Ot as A,Y as B,zt as C,Mt as D,jt as E,bt as F,Ie as G,J as H,ut as I,ke as J,B as K,_t as L,Tt as M,Et as N,Nt as O,wt as P,we as Q,ht as R,Wt as S,It as T,et as U,rt as V,z as W,Oe as X,Ee as Y,Te as Z,en as _,hn as a,_e as at,Ht as b,dn as c,ge as ct,pn as d,I as dt,be as et,Q as f,P as ft,nn as g,rn as h,gn as i,Se as it,Dt as j,At as k,ln as l,pe as lt,an as m,vn as n,L as nt,$ as o,ye as ot,Z as p,V as q,cn as r,Ce as rt,un as s,ve as st,yn as t,xe as tt,fn as u,de as ut,$t as v,Ft as w,Ut as x,tn as y,gt as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.