(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{3576:function(e,t,r){"use strict";r.d(t,{El:function(){return q},CH:function(){return z},tj:function(){return F}});var n=r(4343),i=r(7294),o=r(2266),s=r(7334),a=new Set,u={warnOnce:e=>{a.has(e)||(a.add(e),console.warn(e))},logOnce:e=>{a.has(e)||(console.log(e),a.add(e))}};r(674);var l=r(5152),c=r.n(l),d=r(9332),f=r(7587);let h="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,p=i.createContext(void 0);p.displayName="ClerkNextOptionsCtx";let m=()=>{let e=i.useContext(p);return null==e?void 0:e.value},y=e=>{let{children:t,options:r}=e;return i.createElement(p.Provider,{value:{value:r}},t)};var g=r(7183),v=r(4298),b=r.n(v);function w(e){let{publishableKey:t,clerkJSUrl:r,clerkJSVersion:n,clerkJSVariant:s,nonce:a}=m(),{domain:u,proxyUrl:l}=(0,o.ll)();if(!t)return null;let c={domain:u,proxyUrl:l,publishableKey:t,clerkJSUrl:r,clerkJSVersion:n,clerkJSVariant:s,nonce:a},d=(0,g.wE)(c),f="app"===e.router?"script":b();return i.createElement(f,{src:d,"data-clerk-js-script":!0,async:!0,defer:"pages"!==e.router&&void 0,crossOrigin:"anonymous",strategy:"pages"===e.router?"beforeInteractive":void 0,...(0,g.iv)(c)})}var _=r(4524),k=r(3185),E=r(5656),C=r(3454);let S=e=>{var t;return{...e,publishableKey:e.publishableKey||"pk_test_bW9yYWwtZHJ1bS03Ni5jbGVyay5hY2NvdW50cy5kZXYk",clerkJSUrl:e.clerkJSUrl||C.env.NEXT_PUBLIC_CLERK_JS_URL,clerkJSVersion:e.clerkJSVersion||C.env.NEXT_PUBLIC_CLERK_JS_VERSION,proxyUrl:e.proxyUrl||C.env.NEXT_PUBLIC_CLERK_PROXY_URL||"",domain:e.domain||C.env.NEXT_PUBLIC_CLERK_DOMAIN||"",isSatellite:e.isSatellite||(0,k.fQ)(C.env.NEXT_PUBLIC_CLERK_IS_SATELLITE),signInUrl:e.signInUrl||C.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL||"",signUpUrl:e.signUpUrl||C.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL||"",signInForceRedirectUrl:e.signInForceRedirectUrl||C.env.NEXT_PUBLIC_CLERK_SIGN_IN_FORCE_REDIRECT_URL||"",signUpForceRedirectUrl:e.signUpForceRedirectUrl||C.env.NEXT_PUBLIC_CLERK_SIGN_UP_FORCE_REDIRECT_URL||"",signInFallbackRedirectUrl:e.signInFallbackRedirectUrl||C.env.NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL||"",signUpFallbackRedirectUrl:e.signUpFallbackRedirectUrl||C.env.NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL||"",afterSignInUrl:e.afterSignInUrl||C.env.NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL||"",afterSignUpUrl:e.afterSignUpUrl||C.env.NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL||"",telemetry:null!=(t=e.telemetry)?t:{disabled:(0,k.fQ)(C.env.NEXT_PUBLIC_CLERK_TELEMETRY_DISABLED),debug:(0,k.fQ)(C.env.NEXT_PUBLIC_CLERK_TELEMETRY_DEBUG)},sdkMetadata:E.nE}};var O=r(8789),P=r(4970);async function R(){(await (0,P.cookies)()).delete(`__clerk_invalidate_cache_cookie_${Date.now()}`)}let x=e=>{var t;return null!=window.__clerk_internal_navigations||(window.__clerk_internal_navigations={}),null!=(t=window.__clerk_internal_navigations)[e]||(t[e]={}),window.__clerk_internal_navigations[e]},j=e=>{let{windowNav:t,routerNav:r,name:n}=e,o=(0,d.usePathname)(),[s,a]=(0,i.useTransition)();t&&(x(n).fun=(e,i)=>new Promise(o=>{var s,u;null!=(s=x(n)).promisesBuffer||(s.promisesBuffer=[]),null==(u=x(n).promisesBuffer)||u.push(o),a(()=>{var n,o,s;(null==(n=null==i?void 0:i.__internal_metadata)?void 0:n.navigationType)==="internal"?t((null!=(s=null==(o=window.next)?void 0:o.version)?s:"")<"14.1.0"?history.state:null,"",e):r(e)})}));let u=()=>{var e;null==(e=x(n).promisesBuffer)||e.forEach(e=>e()),x(n).promisesBuffer=[]};return(0,i.useEffect)(()=>(u(),u),[]),(0,i.useEffect)(()=>{s||u()},[o,s]),(0,i.useCallback)(e=>x(n).fun(e),[])},U=()=>{let e=(0,d.useRouter)();return j({windowNav:"undefined"!=typeof window?window.history.pushState.bind(window.history):void 0,routerNav:e.push.bind(e),name:"push"})},M=()=>{let e=(0,d.useRouter)();return j({windowNav:"undefined"!=typeof window?window.history.replaceState.bind(window.history):void 0,routerNav:e.replace.bind(e),name:"replace"})},T=c()(()=>r.e(325).then(r.bind(r,8325)).then(e=>e.KeylessCreatorOrReader)),A=e=>{if(O.F){let e=`Clerk:
Your current Next.js version (${f.i8}) will be deprecated in the next major release of "@clerk/nextjs". Please upgrade to next@14.1.0 or later.`;(0,s._f)()?u.warnOnce(e):u.logOnce(`
\x1b[43m----------
${e}
----------\x1b[0m
`)}let{__unstable_invokeMiddlewareOnAuthStateChange:t=!0,children:r}=e,n=(0,d.useRouter)(),a=U(),l=M(),[c,p]=(0,i.useTransition)();if(m())return e.children;(0,i.useEffect)(()=>{var e;c||null==(e=window.__clerk_internal_invalidateCachePromise)||e.call(window)},[c]),h(()=>{window.__unstable__onBeforeSetActive=()=>new Promise(e=>{var t;window.__clerk_internal_invalidateCachePromise=e,(null==(t=window.next)?void 0:t.version)&&"string"==typeof window.next.version&&window.next.version.startsWith("13")?p(()=>{n.refresh()}):R().then(()=>e())}),window.__unstable__onAfterSetActive=()=>{if(t)return n.refresh()}},[]);let g=S({...e,routerPush:a,routerReplace:l});return i.createElement(y,{options:g},i.createElement(o.El,{...g},i.createElement(w,{router:"app"}),r))},I=e=>{let{children:t,disableKeyless:r=!1,...n}=e;return S(n).publishableKey||!_.h||r?i.createElement(A,{...n},t):i.createElement(T,null,i.createElement(A,{...n},t))};var L=r(1163);let N=()=>{if("undefined"==typeof window)return;let e=e=>{Object.keys(e).forEach(t=>{delete e[t]})};try{e(window.next.router.sdc),e(window.next.router.sbc)}catch{return}};function D({children:e,...t}){var r;let{__unstable_invokeMiddlewareOnAuthStateChange:n=!0}=t,{push:s,replace:a}=(0,L.useRouter)();o.El.displayName="ReactClerkProvider",h(()=>{window.__unstable__onBeforeSetActive=N},[]),h(()=>{window.__unstable__onAfterSetActive=()=>{n&&s(window.location.href)}},[]);let u=S({...t,routerPush:e=>s(e),routerReplace:e=>a(e)}),l=(null==(r=t.authServerSideProps)?void 0:r.__clerk_ssr_state)||t.__clerk_ssr_state;return i.createElement(y,{options:u},i.createElement(o.El,{...u,initialState:l},i.createElement(w,{router:"pages"}),e))}(0,g.JM)({packageName:"@clerk/nextjs"}),(0,g.Aw)("@clerk/nextjs");let q=function(e){let t=(0,n.useRouter)();return i.createElement(t?D:I,{...e})},z=o.CH,F=o.tj;o.Cv},5656:function(e,t,r){"use strict";r.d(t,{T5:function(){return c},Gn:function(){return a},yK:function(){return d},lo:function(){return h},tH:function(){return g},NM:function(){return f},Am:function(){return l},nE:function(){return p},Cn:function(){return u},w4:function(){return y},CY:function(){return m}});var n=r(7362),i=r(8749);r(674);var o=r(3185),s=r(3454);s.env.NEXT_PUBLIC_CLERK_JS_VERSION,s.env.NEXT_PUBLIC_CLERK_JS_URL;let a=s.env.CLERK_API_VERSION||"v1",u=s.env.CLERK_SECRET_KEY||"",l="pk_test_bW9yYWwtZHJ1bS03Ni5jbGVyay5hY2NvdW50cy5kZXYk";s.env.CLERK_ENCRYPTION_KEY;let c=s.env.CLERK_API_URL||(e=>{let t=n.nQ(e)?.frontendApi;return t?.startsWith("clerk.")&&i.mv.some(e=>t?.endsWith(e))?i.Xv:i.iF.some(e=>t?.endsWith(e))?i.Fo:i.cM.some(e=>t?.endsWith(e))?i.Iq:i.Xv})(l),d=s.env.NEXT_PUBLIC_CLERK_DOMAIN||"",f=s.env.NEXT_PUBLIC_CLERK_PROXY_URL||"",h=(0,o.fQ)(s.env.NEXT_PUBLIC_CLERK_IS_SATELLITE)||!1;s.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL,s.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL;let p={name:"@clerk/nextjs",version:"6.11.3",environment:"production"},m=(0,o.fQ)(s.env.NEXT_PUBLIC_CLERK_TELEMETRY_DISABLED),y=(0,o.fQ)(s.env.NEXT_PUBLIC_CLERK_TELEMETRY_DEBUG),g=(0,o.fQ)(s.env.NEXT_PUBLIC_CLERK_KEYLESS_DISABLED)||!1},4524:function(e,t,r){"use strict";r.d(t,{h:function(){return o}});var n=r(6922),i=r(5656);let o=!r(8789).F&&(0,n.vf)()&&!i.tH},8789:function(e,t,r){"use strict";r.d(t,{F:function(){return i}});var n=r(7587);let i=n.i8.startsWith("13.")||n.i8.startsWith("14.0")},4343:function(e,t,r){e.exports=r(7171)},3454:function(e,t,r){"use strict";var n,i;e.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(i=r.g.process)?void 0:i.env)?r.g.process:r(7663)},6840:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return r(5545)}])},7171:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useRouter",{enumerable:!0,get:function(){return o}});let n=r(7294),i=r(1928);function o(){return(0,n.useContext)(i.RouterContext)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3525:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"actionAsyncStorage",{enumerable:!0,get:function(){return n}});let n=(0,r(4001).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6361:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"actionAsyncStorage",{enumerable:!0,get:function(){return n.actionAsyncStorage}});let n=r(3525);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4001:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createAsyncLocalStorage",{enumerable:!0,get:function(){return o}});let r=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class n{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}}let i=globalThis.AsyncLocalStorage;function o(){return i?new i:new n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4818:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraftMode",{enumerable:!0,get:function(){return o}});let n=r(8119),i=r(7325);class o{get isEnabled(){return this._provider.isEnabled}enable(){let e=n.staticGenerationAsyncStorage.getStore();return e&&(0,i.trackDynamicDataAccessed)(e,"draftMode().enable()"),this._provider.enable()}disable(){let e=n.staticGenerationAsyncStorage.getStore();return e&&(0,i.trackDynamicDataAccessed)(e,"draftMode().disable()"),this._provider.disable()}constructor(e){this._provider=e}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6849:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{cookies:function(){return f},draftMode:function(){return h},headers:function(){return d}});let n=r(9407),i=r(4042),o=r(255),s=r(6361),a=r(4818),u=r(7325),l=r(8119),c=r(2595);function d(){let e="headers",t=l.staticGenerationAsyncStorage.getStore();if(t){if(t.forceStatic)return i.HeadersAdapter.seal(new Headers({}));(0,u.trackDynamicDataAccessed)(t,e)}return(0,c.getExpectedRequestStore)(e).headers}function f(){let e="cookies",t=l.staticGenerationAsyncStorage.getStore();if(t){if(t.forceStatic)return n.RequestCookiesAdapter.seal(new o.RequestCookies(new Headers({})));(0,u.trackDynamicDataAccessed)(t,e)}let r=(0,c.getExpectedRequestStore)(e),i=s.actionAsyncStorage.getStore();return(null==i?void 0:i.isAction)||(null==i?void 0:i.isAppRoute)?r.mutableCookies:r.cookies}function h(){let e=(0,c.getExpectedRequestStore)("draftMode");return new a.DraftMode(e.draftMode)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1539:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DynamicServerError:function(){return n},isDynamicServerError:function(){return i}});let r="DYNAMIC_SERVER_USAGE";class n extends Error{constructor(e){super("Dynamic server usage: "+e),this.description=e,this.digest=r}}function i(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8199:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ReadonlyURLSearchParams:function(){return u.ReadonlyURLSearchParams},RedirectType:function(){return u.RedirectType},ServerInsertedHTMLContext:function(){return l.ServerInsertedHTMLContext},notFound:function(){return u.notFound},permanentRedirect:function(){return u.permanentRedirect},redirect:function(){return u.redirect},useParams:function(){return h},usePathname:function(){return d},useRouter:function(){return f},useSearchParams:function(){return c},useSelectedLayoutSegment:function(){return m},useSelectedLayoutSegments:function(){return p},useServerInsertedHTML:function(){return l.useServerInsertedHTML}});let n=r(7294),i=r(257),o=r(2608),s=r(1288),a=r(6406),u=r(2717),l=r(5988);function c(){let e=(0,n.useContext)(o.SearchParamsContext);return(0,n.useMemo)(()=>e?new u.ReadonlyURLSearchParams(e):null,[e])}function d(){return(0,n.useContext)(o.PathnameContext)}function f(){let e=(0,n.useContext)(i.AppRouterContext);if(null===e)throw Error("invariant expected app router to be mounted");return e}function h(){return(0,n.useContext)(o.PathParamsContext)}function p(e){void 0===e&&(e="children");let t=(0,n.useContext)(i.LayoutRouterContext);return t?function e(t,r,n,i){let o;if(void 0===n&&(n=!0),void 0===i&&(i=[]),n)o=t[1][r];else{var u;let e=t[1];o=null!=(u=e.children)?u:Object.values(e)[0]}if(!o)return i;let l=o[0],c=(0,s.getSegmentValue)(l);return!c||c.startsWith(a.PAGE_SEGMENT_KEY)?i:(i.push(c),e(o,r,!1,i))}(t.tree,e):null}function m(e){void 0===e&&(e="children");let t=p(e);if(!t||0===t.length)return null;let r="children"===e?t[0]:t[t.length-1];return r===a.DEFAULT_SEGMENT_KEY?null:r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2717:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ReadonlyURLSearchParams:function(){return s},RedirectType:function(){return n.RedirectType},notFound:function(){return i.notFound},permanentRedirect:function(){return n.permanentRedirect},redirect:function(){return n.redirect}});let n=r(7511),i=r(3394);class o extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class s extends URLSearchParams{append(){throw new o}delete(){throw new o}set(){throw new o}sort(){throw new o}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3394:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{isNotFoundError:function(){return i},notFound:function(){return n}});let r="NEXT_NOT_FOUND";function n(){let e=Error(r);throw e.digest=r,e}function i(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4234:function(e,t){"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RedirectStatusCode",{enumerable:!0,get:function(){return r}}),(n=r||(r={}))[n.SeeOther=303]="SeeOther",n[n.TemporaryRedirect=307]="TemporaryRedirect",n[n.PermanentRedirect=308]="PermanentRedirect",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7511:function(e,t,r){"use strict";var n,i;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{RedirectType:function(){return n},getRedirectError:function(){return l},getRedirectStatusCodeFromError:function(){return m},getRedirectTypeFromError:function(){return p},getURLFromRedirectError:function(){return h},isRedirectError:function(){return f},permanentRedirect:function(){return d},redirect:function(){return c}});let o=r(2595),s=r(6361),a=r(4234),u="NEXT_REDIRECT";function l(e,t,r){void 0===r&&(r=a.RedirectStatusCode.TemporaryRedirect);let n=Error(u);n.digest=u+";"+t+";"+e+";"+r+";";let i=o.requestAsyncStorage.getStore();return i&&(n.mutableCookies=i.mutableCookies),n}function c(e,t){void 0===t&&(t="replace");let r=s.actionAsyncStorage.getStore();throw l(e,t,(null==r?void 0:r.isAction)?a.RedirectStatusCode.SeeOther:a.RedirectStatusCode.TemporaryRedirect)}function d(e,t){void 0===t&&(t="replace");let r=s.actionAsyncStorage.getStore();throw l(e,t,(null==r?void 0:r.isAction)?a.RedirectStatusCode.SeeOther:a.RedirectStatusCode.PermanentRedirect)}function f(e){if("object"!=typeof e||null===e||!("digest"in e)||"string"!=typeof e.digest)return!1;let[t,r,n,i]=e.digest.split(";",4),o=Number(i);return t===u&&("replace"===r||"push"===r)&&"string"==typeof n&&!isNaN(o)&&o in a.RedirectStatusCode}function h(e){return f(e)?e.digest.split(";",3)[2]:null}function p(e){if(!f(e))throw Error("Not a redirect error");return e.digest.split(";",2)[1]}function m(e){if(!f(e))throw Error("Not a redirect error");return Number(e.digest.split(";",4)[3])}(i=n||(n={})).push="push",i.replace="replace",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5329:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"requestAsyncStorage",{enumerable:!0,get:function(){return n}});let n=(0,r(4001).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2595:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getExpectedRequestStore:function(){return i},requestAsyncStorage:function(){return n.requestAsyncStorage}});let n=r(5329);function i(e){let t=n.requestAsyncStorage.getStore();if(t)return t;throw Error("`"+e+"` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1288:function(e,t){"use strict";function r(e){return Array.isArray(e)?e[1]:e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentValue",{enumerable:!0,get:function(){return r}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5196:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"staticGenerationAsyncStorage",{enumerable:!0,get:function(){return n}});let n=(0,r(4001).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8119:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"staticGenerationAsyncStorage",{enumerable:!0,get:function(){return n.staticGenerationAsyncStorage}});let n=r(5196);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2700:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{StaticGenBailoutError:function(){return n},isStaticGenBailoutError:function(){return i}});let r="NEXT_STATIC_GEN_BAILOUT";class n extends Error{constructor(...e){super(...e),this.code=r}}function i(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2602:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return a},noSSR:function(){return s}});let n=r(8754);r(5893),r(7294);let i=n._(r(5491));function o(e){return{default:(null==e?void 0:e.default)||e}}function s(e,t){return delete t.webpack,delete t.modules,e(t)}function a(e,t){let r=i.default,n={loading:e=>{let{error:t,isLoading:r,pastDelay:n}=e;return null}};e instanceof Promise?n.loader=()=>e:"function"==typeof e?n.loader=e:"object"==typeof e&&(n={...n,...e});let a=(n={...n,...t}).loader;return(n.loadableGenerated&&(n={...n,...n.loadableGenerated},delete n.loadableGenerated),"boolean"!=typeof n.ssr||n.ssr)?r({...n,loader:()=>null!=a?a().then(o):Promise.resolve(o(()=>null))}):(delete n.webpack,delete n.modules,s(r,n))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1159:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return n}});let n=r(8754)._(r(7294)).default.createContext(null)},5491:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return f}});let n=r(8754)._(r(7294)),i=r(1159),o=[],s=[],a=!1;function u(e){let t=e(),r={loading:!0,loaded:null,error:null};return r.promise=t.then(e=>(r.loading=!1,r.loaded=e,e)).catch(e=>{throw r.loading=!1,r.error=e,e}),r}class l{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function c(e){return function(e,t){let r=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),o=null;function u(){if(!o){let t=new l(e,r);o={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return o.promise()}if(!a){let e=r.webpack?r.webpack():r.modules;e&&s.push(t=>{for(let r of e)if(t.includes(r))return u()})}function c(e,t){!function(){u();let e=n.default.useContext(i.LoadableContext);e&&Array.isArray(r.modules)&&r.modules.forEach(t=>{e(t)})}();let s=n.default.useSyncExternalStore(o.subscribe,o.getCurrentValue,o.getCurrentValue);return n.default.useImperativeHandle(t,()=>({retry:o.retry}),[]),n.default.useMemo(()=>{var t;return s.loading||s.error?n.default.createElement(r.loading,{isLoading:s.loading,pastDelay:s.pastDelay,timedOut:s.timedOut,error:s.error,retry:o.retry}):s.loaded?n.default.createElement((t=s.loaded)&&t.default?t.default:t,e):null},[e,s])}return c.preload=()=>u(),c.displayName="LoadableComponent",n.default.forwardRef(c)}(u,e)}function d(e,t){let r=[];for(;e.length;){let n=e.pop();r.push(n(t))}return Promise.all(r).then(()=>{if(e.length)return d(e,t)})}c.preloadAll=()=>new Promise((e,t)=>{d(o).then(e,t)}),c.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let r=()=>(a=!0,t());d(s,e).then(r,r)})),window.__NEXT_PRELOADREADY=c.preloadReady;let f=c},5988:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ServerInsertedHTMLContext:function(){return i},useServerInsertedHTML:function(){return o}});let n=r(1757)._(r(7294)),i=n.default.createContext(null);function o(e){let t=(0,n.useContext)(i);t&&t(e)}},5545:function(e,t,r){"use strict";r.r(t);var n=r(5893),i=r(928);r(876);var o=r(3576),s=r(4712);t.default=i.h.withTRPC(e=>{let{Component:t,pageProps:r}=e;return(0,n.jsxs)(o.El,{...r,children:[(0,n.jsx)(s.x,{richColors:!0}),(0,n.jsx)(t,{...r})]})})},928:function(e,t,r){"use strict";function n(e){let t={subscribe(t){let r=null,n=!1,i=!1,o=!1;function s(){if(null===r){o=!0;return}!i&&(i=!0,"function"==typeof r?r():r&&r.unsubscribe())}return r=e({next(e){n||t.next?.(e)},error(e){n||(n=!0,t.error?.(e),s())},complete(){n||(n=!0,t.complete?.(),s())}}),o&&s(),{unsubscribe:s}},pipe:(...e)=>(0===e.length?function(e){return e}:1===e.length?e[0]:function(t){return e.reduce((e,t)=>t(e),t)})(t)};return t}r.d(t,{h:function(){return tv}});class i extends Error{constructor(e){super(e),this.name="ObservableAbortError",Object.setPrototypeOf(this,i.prototype)}}function o(e){let t=Object.create(null);for(let r in e)t[e[r]]=r;return t}let s={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,UNAUTHORIZED:-32001,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNPROCESSABLE_CONTENT:-32022,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};o(s),o(s);let a=()=>{},u=e=>(function e(t,r){return new Proxy(a,{get(n,i){if("string"==typeof i&&"then"!==i)return e(t,[...r,i])},apply(e,n,i){let o="apply"===r[r.length-1];return t({args:o?i.length>=2?i[1]:[]:i,path:o?r.slice(0,-1):r})}})})(e,[]),l=e=>new Proxy(a,{get(t,r){if("string"==typeof r&&"then"!==r)return e(r)}});class c extends Error{}function d(e){return!!e&&!Array.isArray(e)&&"object"==typeof e}class f extends Error{constructor(){super("Unable to transform response from server")}}function h(e,t){let r;try{r=function(e,t){if("error"in e){let r=t.transformer.deserialize(e.error);return{ok:!1,error:{...e,error:r}}}return{ok:!0,result:{...e.result,...(!e.result.type||"data"===e.result.type)&&{type:"data",data:t.transformer.deserialize(e.result.data)}}}}(e,t)}catch(e){throw new f}if(!r.ok&&(!d(r.error.error)||"number"!=typeof r.error.error.code)||r.ok&&!d(r.result))throw new f;return r}class p extends Error{static from(e,t={}){return e instanceof p||e instanceof Error&&"TRPCClientError"===e.name?(t.meta&&(e.meta={...e.meta,...t.meta}),e):d(e)&&d(e.error)&&"number"==typeof e.error.code&&"string"==typeof e.error.message?new p(e.error.message,{...t,result:e}):e instanceof Error?new p(e.message,{...t,cause:function(e){if(e instanceof Error)return e;let t=typeof e;if("undefined"!==t&&"function"!==t&&null!==e){if("object"!==t)return Error(String(e));if(e&&!Array.isArray(e)&&"object"==typeof e){let t=new c;for(let r in e)t[r]=e[r];return t}}}(e)}):new p("Unknown error",{...t,cause:e})}constructor(e,t){let r=t?.cause;super(e,{cause:r}),this.meta=t?.meta,this.cause=r,this.shape=t?.result?.error,this.data=t?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,p.prototype)}}let m=e=>"function"==typeof e;function y(e){var t;return{url:e.url.toString().replace(/\/$/,""),fetch:e.fetch,AbortController:(t=e.AbortController)?t:"undefined"!=typeof window&&window.AbortController?window.AbortController:"undefined"!=typeof globalThis&&globalThis.AbortController?globalThis.AbortController:null}}let g={query:"GET",mutation:"POST"};function v(e){return"input"in e?e.runtime.transformer.serialize(e.input):function(e){let t={};for(let r=0;r<e.length;r++){let n=e[r];t[r]=n}return t}(e.inputs.map(t=>e.runtime.transformer.serialize(t)))}let b=e=>{let t=e.url+"/"+e.path,r=[];if("inputs"in e&&r.push("batch=1"),"query"===e.type){let t=v(e);void 0!==t&&r.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return r.length&&(t+="?"+r.join("&")),t},w=e=>{if("query"===e.type)return;let t=v(e);return void 0!==t?JSON.stringify(t):void 0},_=e=>E({...e,contentTypeHeader:"application/json",getUrl:b,getBody:w});async function k(e,t){let r=e.getUrl(e),n=e.getBody(e),{type:i}=e,o=await e.headers();if("subscription"===i)throw Error("Subscriptions should use wsLink");let s={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.batchModeHeader?{"trpc-batch-mode":e.batchModeHeader}:{},...o};return(function(e){if(e)return e;if("undefined"!=typeof window&&m(window.fetch))return window.fetch;if("undefined"!=typeof globalThis&&m(globalThis.fetch))return globalThis.fetch;throw Error("No fetch implementation found")})(e.fetch)(r,{method:g[i],signal:t?.signal,body:n,headers:s})}function E(e){let t=e.AbortController?new e.AbortController:null,r={},n=!1;return{promise:new Promise((i,o)=>{k(e,t).then(e=>(r.response=e,n=!0,e.json())).then(e=>{r.responseJSON=e,i({json:e,meta:r})}).catch(e=>{n=!0,o(p.from(e,{meta:r}))})}),cancel:()=>{n||t?.abort()}}}let C=()=>{throw Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function S(e){let t=null,r=null,n=()=>{clearTimeout(r),r=null,t=null};function i(){let r=function(t){let r=[[]],n=0;for(;;){let i=t[n];if(!i)break;let o=r[r.length-1];if(i.aborted){i.reject?.(Error("Aborted")),n++;continue}if(e.validate(o.concat(i).map(e=>e.key))){o.push(i),n++;continue}if(0===o.length){i.reject?.(Error("Input is too big for a single dispatch")),n++;continue}r.push([])}return r}(t);for(let t of(n(),r)){if(!t.length)continue;let r={items:t,cancel:C};for(let e of t)e.batch=r;let n=(e,t)=>{let n=r.items[e];n.resolve?.(t),n.batch=null,n.reject=null,n.resolve=null},{promise:i,cancel:o}=e.fetch(r.items.map(e=>e.key),n);r.cancel=o,i.then(e=>{for(let t=0;t<e.length;t++){let r=e[t];n(t,r)}for(let e of r.items)e.reject?.(Error("Missing result")),e.batch=null}).catch(e=>{for(let t of r.items)t.reject?.(e),t.batch=null})}}return{load:function(e){let n={aborted:!1,key:e,batch:null,resolve:C,reject:C},o=new Promise((e,r)=>{n.reject=r,n.resolve=e,t||(t=[]),t.push(n)});return r||(r=setTimeout(i)),{promise:o,cancel:()=>{n.aborted=!0,n.batch?.items.every(e=>e.aborted)&&(n.batch.cancel(),n.batch=null)}}}}}function O(e){return function(t){let r=y(t),i=t.maxURLLength??1/0;return o=>{let s=n=>({validate:e=>{if(i===1/0)return!0;let t=e.map(e=>e.path).join(","),s=e.map(e=>e.input);return b({...r,runtime:o,type:n,path:t,inputs:s}).length<=i},fetch:e({...r,runtime:o,type:n,opts:t})}),a=S(s("query")),u=S(s("mutation")),l={query:a,subscription:S(s("subscription")),mutation:u};return({op:e})=>n(t=>{let r;let{promise:n,cancel:i}=l[e.type].load(e);return n.then(e=>{r=e;let n=h(e.json,o);if(!n.ok){t.error(p.from(n.error,{meta:e.meta}));return}t.next({context:e.meta,result:n.result}),t.complete()}).catch(e=>{t.error(p.from(e,{meta:r?.meta}))}),()=>{i()}})}}}let P=O(e=>t=>{let r=t.map(e=>e.path).join(","),n=t.map(e=>e.input),{promise:i,cancel:o}=_({...e,path:r,inputs:n,headers:()=>e.opts.headers?"function"==typeof e.opts.headers?e.opts.headers({opList:t}):e.opts.headers:{}});return{promise:i.then(e=>(Array.isArray(e.json)?e.json:t.map(()=>e.json)).map(t=>({meta:e.meta,json:t}))),cancel:o}});function R(e){return t=>{let r=y(t);return i=>({op:o})=>n(n=>{let s;let{path:a,input:u,type:l}=o,{promise:c,cancel:d}=e.requester({...r,runtime:i,type:l,path:a,input:u,headers:()=>t.headers?"function"==typeof t.headers?t.headers({op:o}):t.headers:{}});return c.then(e=>{s=e.meta;let t=h(e.json,i);if(!t.ok){n.error(p.from(t.error,{meta:s}));return}n.next({context:e.meta,result:t.result}),n.complete()}).catch(e=>{n.error(p.from(e,{meta:s}))}),()=>{d()}})}}R({requester:_});let x={css:{query:["72e3ff","3fb0d8"],mutation:["c5a3fc","904dfc"],subscription:["ff49e1","d83fbe"]},ansi:{regular:{query:["\x1b[30;46m","\x1b[97;46m"],mutation:["\x1b[30;45m","\x1b[97;45m"],subscription:["\x1b[30;42m","\x1b[97;42m"]},bold:{query:["\x1b[1;30;46m","\x1b[1;97;46m"],mutation:["\x1b[1;30;45m","\x1b[1;97;45m"],subscription:["\x1b[1;30;42m","\x1b[1;97;42m"]}}},j=({c:e=console,colorMode:t="css"})=>r=>{let n=r.input,i="undefined"!=typeof FormData&&n instanceof FormData?Object.fromEntries(n):n,{parts:o,args:s}=function(e){let{direction:t,type:r,path:n,id:i,input:o}=e,s=[],a=[];if("ansi"===e.colorMode){let[o,u]=x.ansi.regular[r],[l,c]=x.ansi.bold[r];return s.push("up"===t?o:u,"up"===t?">>":"<<",r,"up"===t?l:c,`#${i}`,n,"\x1b[0m"),"up"===t?a.push({input:e.input}):a.push({input:e.input,result:"result"in e.result?e.result.result:e.result,elapsedMs:e.elapsedMs}),{parts:s,args:a}}let[u,l]=x.css[r],c=`
    background-color: #${"up"===t?u:l}; 
    color: ${"up"===t?"black":"white"};
    padding: 2px;
  `;return s.push("%c","up"===t?">>":"<<",r,`#${i}`,`%c${n}%c`,"%O"),a.push(c,`${c}; font-weight: bold;`,`${c}; font-weight: normal;`),"up"===t?a.push({input:o,context:e.context}):a.push({input:o,result:e.result,elapsedMs:e.elapsedMs,context:e.context}),{parts:s,args:a}}({...r,colorMode:t,input:i});e["down"===r.direction&&r.result&&(r.result instanceof Error||"error"in r.result.result)?"error":"log"].apply(null,[o.join(" ")].concat(s))};class U{$request({type:e,input:t,path:r,context:i={}}){var o;return(o={links:this.links,op:{id:++this.requestId,type:e,path:r,input:t,context:i}},n(e=>(function e(t=0,r=o.op){let n=o.links[t];if(!n)throw Error("No more links to execute - did you forget to add an ending link?");return n({op:r,next:r=>e(t+1,r)})})().subscribe(e))).pipe(e=>{let t=0,r=null,n=[];return{subscribe:i=>(t++,n.push(i),r||(r=e.subscribe({next(e){for(let t of n)t.next?.(e)},error(e){for(let t of n)t.error?.(e)},complete(){for(let e of n)e.complete?.()}})),{unsubscribe(){t--,function(){if(0===t&&r){let e=r;r=null,e.unsubscribe()}}();let e=n.findIndex(e=>e===i);e>-1&&n.splice(e,1)}})}})}requestAsPromise(e){var t;let r;let{promise:n,abort:o}=(t=this.$request(e),{promise:new Promise((e,n)=>{let o=!1;function s(){o||(o=!0,n(new i("This operation was aborted.")),a.unsubscribe())}let a=t.subscribe({next(t){o=!0,e(t),s()},error(e){o=!0,n(e),s()},complete(){o=!0,s()}});r=s}),abort:r});return new Promise((t,r)=>{e.signal?.addEventListener("abort",o),n.then(e=>{t(e.result.data)}).catch(e=>{r(p.from(e))})})}query(e,t,r){return this.requestAsPromise({type:"query",path:e,input:t,context:r?.context,signal:r?.signal})}mutation(e,t,r){return this.requestAsPromise({type:"mutation",path:e,input:t,context:r?.context,signal:r?.signal})}subscription(e,t,r){return this.$request({type:"subscription",path:e,input:t,context:r?.context}).subscribe({next(e){"started"===e.result.type?r.onStarted?.():"stopped"===e.result.type?r.onStopped?.():r.onData?.(e.result.data)},error(e){r.onError?.(e)},complete(){r.onComplete?.()}})}constructor(e){this.requestId=0;let t=(()=>{let t=e.transformer;return t?"input"in t?e.transformer:{input:t,output:t}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}}})();this.runtime={transformer:{serialize:e=>t.input.serialize(e),deserialize:e=>t.output.deserialize(e)},combinedTransformer:t},this.links=e.links.map(e=>e(this.runtime))}}let M={query:"query",mutate:"mutation",subscribe:"subscription"},T=e=>M[e];async function A(e){let t=e.parse??JSON.parse;await I(e.readableStream,r=>{if(e.signal?.aborted||!r||"}"===r)return;let n=r.indexOf(":"),i=r.substring(2,n-1),o=r.substring(n+1);e.onSingle(Number(i),t(o))},e.textDecoder)}async function I(e,t,r){let n="",i=e=>{let i=r.decode(e).split("\n");if(1===i.length)n+=i[0];else if(i.length>1){t(n+i[0]);for(let e=1;e<i.length-1;e++)t(i[e]);n=i[i.length-1]}};"getReader"in e?await L(e,i):await new Promise(t=>{e.on("data",i),e.on("end",t)}),t(n)}async function L(e,t){let r=e.getReader(),n=await r.read();for(;!n.done;)t(n.value),n=await r.read()}let N=(e,t)=>{let r=e.AbortController?new e.AbortController:null;return{cancel:()=>r?.abort(),promise:k({...e,contentTypeHeader:"application/json",batchModeHeader:"stream",getUrl:b,getBody:w},r).then(async n=>{if(!n.body)throw Error("Received response without body");let i={response:n};return A({readableStream:n.body,onSingle:t,parse:e=>({json:JSON.parse(e),meta:i}),signal:r?.signal,textDecoder:e.textDecoder})})}};O(e=>{let t=function(e){if(e)return e;if("undefined"!=typeof window&&window.TextDecoder)return new window.TextDecoder;if("undefined"!=typeof globalThis&&globalThis.TextDecoder)return new globalThis.TextDecoder;throw Error("No TextDecoder implementation found")}(e.opts.textDecoder);return(r,n)=>{let i=r.map(e=>e.path).join(","),o=r.map(e=>e.input),{cancel:s,promise:a}=N({...e,textDecoder:t,path:i,inputs:o,headers:()=>e.opts.headers?"function"==typeof e.opts.headers?e.opts.headers({opList:r}):e.opts.headers:{}},(e,t)=>{n(e,t)});return{promise:a.then(()=>[]),cancel:s}}});let D=e=>{if("input"in e){if(!(e.input instanceof FormData))throw Error("Input is not FormData");return e.input}};R({requester:e=>{if("mutation"!==e.type)throw Error("We only handle mutations with formdata");return E({...e,getUrl:()=>`${e.url}/${e.path}`,getBody:D})}});var q,z=r(5945),F=r(7294);function Q(e){return e.state.isPaused}function K(e){return"success"===e.state.status}let B=({children:e,options:t,state:r})=>(!function(e,t={}){let r=(0,z.NL)({context:t.context}),n=F.useRef(t);n.current=t,F.useMemo(()=>{e&&function(e,t,r){if("object"!=typeof t||null===t)return;let n=e.getMutationCache(),i=e.getQueryCache(),o=t.mutations||[],s=t.queries||[];o.forEach(t=>{var i;n.build(e,{...null==r?void 0:null==(i=r.defaultOptions)?void 0:i.mutations,mutationKey:t.mutationKey},t.state)}),s.forEach(({queryKey:t,state:n,queryHash:o})=>{var s;let a=i.get(o);if(a){if(a.state.dataUpdatedAt<n.dataUpdatedAt){let{fetchStatus:e,...t}=n;a.setState(t)}return}i.build(e,{...null==r?void 0:null==(s=r.defaultOptions)?void 0:s.queries,queryKey:t,queryHash:o},{...n,fetchStatus:"idle"})})}(r,e,n.current)},[r,e])}(r,t),e);function W(e,t){let[r,n]=Array.isArray(e)?e:[e],i="string"!=typeof r||""===r?[]:r.split(".");return n||t&&"any"!==t?[i,{...void 0!==n&&{input:n},...t&&"any"!==t&&{type:t}}]:i.length?[i]:[]}var V=r(6492),$=r(2161);let G=console;var H=r(81);class J{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,$.PN)(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,null!=e?e:$.sk?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}var Y=r(2379);class X extends J{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||G,this.observers=[],this.state=e.state||Z(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(t=>t!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,t;return null!=(e=null==(t=this.retryer)?void 0:t.continue())?e:this.execute()}async execute(){var e,t,r,n,i,o,s,a,u,l,c,d,f,h,p,m,y,g,v,b;let w="loading"===this.state.status;try{if(!w){this.dispatch({type:"loading",variables:this.options.variables}),await (null==(u=(l=this.mutationCache.config).onMutate)?void 0:u.call(l,this.state.variables,this));let e=await (null==(c=(d=this.options).onMutate)?void 0:c.call(d,this.state.variables));e!==this.state.context&&this.dispatch({type:"loading",context:e,variables:this.state.variables})}let f=await (()=>{var e;return this.retryer=(0,Y.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(e=this.options.retry)?e:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise})();return await (null==(e=(t=this.mutationCache.config).onSuccess)?void 0:e.call(t,f,this.state.variables,this.state.context,this)),await (null==(r=(n=this.options).onSuccess)?void 0:r.call(n,f,this.state.variables,this.state.context)),await (null==(i=(o=this.mutationCache.config).onSettled)?void 0:i.call(o,f,null,this.state.variables,this.state.context,this)),await (null==(s=(a=this.options).onSettled)?void 0:s.call(a,f,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:f}),f}catch(e){try{throw await (null==(f=(h=this.mutationCache.config).onError)?void 0:f.call(h,e,this.state.variables,this.state.context,this)),await (null==(p=(m=this.options).onError)?void 0:p.call(m,e,this.state.variables,this.state.context)),await (null==(y=(g=this.mutationCache.config).onSettled)?void 0:y.call(g,void 0,e,this.state.variables,this.state.context,this)),await (null==(v=(b=this.options).onSettled)?void 0:v.call(b,void 0,e,this.state.variables,this.state.context)),e}finally{this.dispatch({type:"error",error:e})}}}dispatch(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"loading":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!(0,Y.Kw)(this.options.networkMode),status:"loading",variables:e.variables};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"};case"setState":return{...t,...e.state}}})(this.state),H.V.batch(()=>{this.observers.forEach(t=>{t.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function Z(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}var ee=r(3989);class et extends ee.l{constructor(e,t){super(),this.client=e,this.setOptions(t),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;let r=this.options;this.options=this.client.defaultMutationOptions(e),(0,$.VS)(r,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),null==(t=this.currentMutation)||t.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.currentMutation)||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();let t={listeners:!0};"success"===e.type?t.onSuccess=!0:"error"===e.type&&(t.onError=!0),this.notify(t)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,t){return this.mutateOptions=t,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==e?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let e=this.currentMutation?this.currentMutation.state:Z(),t={...e,isLoading:"loading"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset};this.currentResult=t}notify(e){H.V.batch(()=>{if(this.mutateOptions&&this.hasListeners()){var t,r,n,i,o,s,a,u;e.onSuccess?(null==(t=(r=this.mutateOptions).onSuccess)||t.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(n=(i=this.mutateOptions).onSettled)||n.call(i,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):e.onError&&(null==(o=(s=this.mutateOptions).onError)||o.call(s,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(a=(u=this.mutateOptions).onSettled)||a.call(u,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}e.listeners&&this.listeners.forEach(({listener:e})=>{e(this.currentResult)})})}}var er=r(464),en=r(4798);function ei(){}var eo=r(2924);function es(){return{onFetch:e=>{e.fetchFn=()=>{var t,r,n,i,o,s;let a;let u=null==(t=e.fetchOptions)?void 0:null==(r=t.meta)?void 0:r.refetchPage,l=null==(n=e.fetchOptions)?void 0:null==(i=n.meta)?void 0:i.fetchMore,c=null==l?void 0:l.pageParam,d=(null==l?void 0:l.direction)==="forward",f=(null==l?void 0:l.direction)==="backward",h=(null==(o=e.state.data)?void 0:o.pages)||[],p=(null==(s=e.state.data)?void 0:s.pageParams)||[],m=p,y=!1,g=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>{var t,r;return null!=(t=e.signal)&&t.aborted?y=!0:null==(r=e.signal)||r.addEventListener("abort",()=>{y=!0}),e.signal}})},v=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),b=(e,t,r,n)=>(m=n?[t,...m]:[...m,t],n?[r,...e]:[...e,r]),w=(t,r,n,i)=>{if(y)return Promise.reject("Cancelled");if(void 0===n&&!r&&t.length)return Promise.resolve(t);let o={queryKey:e.queryKey,pageParam:n,meta:e.options.meta};return g(o),Promise.resolve(v(o)).then(e=>b(t,n,e,i))};if(h.length){if(d){let t=void 0!==c,r=t?c:ea(e.options,h);a=w(h,t,r)}else if(f){let t=void 0!==c,r=t?c:eu(e.options,h);a=w(h,t,r,!0)}else{m=[];let t=void 0===e.options.getNextPageParam;a=!u||!h[0]||u(h[0],0,h)?w([],t,p[0]):Promise.resolve(b([],p[0],h[0]));for(let r=1;r<h.length;r++)a=a.then(n=>{if(!u||!h[r]||u(h[r],r,h)){let i=t?p[r]:ea(e.options,n);return w(n,t,i)}return Promise.resolve(b(n,p[r],h[r]))})}}else a=w([]);return a.then(e=>({pages:e,pageParams:m}))}}}}function ea(e,t){return null==e.getNextPageParam?void 0:e.getNextPageParam(t[t.length-1],t)}function eu(e,t){return null==e.getPreviousPageParam?void 0:e.getPreviousPageParam(t[0],t)}class el extends eo.z{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,t){super.setOptions({...e,behavior:es()},t)}getOptimisticResult(e){return e.behavior=es(),super.getOptimisticResult(e)}fetchNextPage({pageParam:e,...t}={}){return this.fetch({...t,meta:{fetchMore:{direction:"forward",pageParam:e}}})}fetchPreviousPage({pageParam:e,...t}={}){return this.fetch({...t,meta:{fetchMore:{direction:"backward",pageParam:e}}})}createResult(e,t){var r,n,i,o,s,a;let{state:u}=e,l=super.createResult(e,t),{isFetching:c,isRefetching:d}=l,f=c&&(null==(r=u.fetchMeta)?void 0:null==(n=r.fetchMore)?void 0:n.direction)==="forward",h=c&&(null==(i=u.fetchMeta)?void 0:null==(o=i.fetchMore)?void 0:o.direction)==="backward";return{...l,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:function(e,t){if(e.getNextPageParam&&Array.isArray(t)){let r=ea(e,t);return null!=r&&!1!==r}}(t,null==(s=u.data)?void 0:s.pages),hasPreviousPage:function(e,t){if(e.getPreviousPageParam&&Array.isArray(t)){let r=eu(e,t);return null!=r&&!1!==r}}(t,null==(a=u.data)?void 0:a.pages),isFetchingNextPage:f,isFetchingPreviousPage:h,isRefetching:d&&!f&&!h}}}var ec=r(7687);class ed extends ee.l{constructor(e,t){super(),this.client=e,this.queries=[],this.result=[],this.observers=[],this.observersMap={},t&&this.setQueries(t)}onSubscribe(){1===this.listeners.size&&this.observers.forEach(e=>{e.subscribe(t=>{this.onUpdate(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.observers.forEach(e=>{e.destroy()})}setQueries(e,t){this.queries=e,H.V.batch(()=>{let e=this.observers,r=this.findMatchingObservers(this.queries);r.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions,t));let n=r.map(e=>e.observer),i=Object.fromEntries(n.map(e=>[e.options.queryHash,e])),o=n.map(e=>e.getCurrentResult()),s=n.some((t,r)=>t!==e[r]);(e.length!==n.length||s)&&(this.observers=n,this.observersMap=i,this.result=o,this.hasListeners()&&((0,$.e5)(e,n).forEach(e=>{e.destroy()}),(0,$.e5)(n,e).forEach(e=>{e.subscribe(t=>{this.onUpdate(e,t)})}),this.notify()))})}getCurrentResult(){return this.result}getQueries(){return this.observers.map(e=>e.getCurrentQuery())}getObservers(){return this.observers}getOptimisticResult(e){return this.findMatchingObservers(e).map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions))}findMatchingObservers(e){let t=this.observers,r=new Map(t.map(e=>[e.options.queryHash,e])),n=e.map(e=>this.client.defaultQueryOptions(e)),i=n.flatMap(e=>{let t=r.get(e.queryHash);return null!=t?[{defaultedQueryOptions:e,observer:t}]:[]}),o=new Set(i.map(e=>e.defaultedQueryOptions.queryHash)),s=n.filter(e=>!o.has(e.queryHash)),a=new Set(i.map(e=>e.observer)),u=t.filter(e=>!a.has(e)),l=e=>{let t=this.client.defaultQueryOptions(e),r=this.observersMap[t.queryHash];return null!=r?r:new eo.z(this.client,t)},c=s.map((e,t)=>{if(e.keepPreviousData){let r=u[t];if(void 0!==r)return{defaultedQueryOptions:e,observer:r}}return{defaultedQueryOptions:e,observer:l(e)}});return i.concat(c).sort((e,t)=>n.indexOf(e.defaultedQueryOptions)-n.indexOf(t.defaultedQueryOptions))}onUpdate(e,t){let r=this.observers.indexOf(e);-1!==r&&(this.result=(0,$.Rc)(this.result,r,t),this.notify())}notify(){H.V.batch(()=>{this.listeners.forEach(({listener:e})=>{e(this.result)})})}}var ef=r(7122),eh=r(1784),ep=r(1670),em=r(8381);function ey(e,t){return e.length?void 0===t?[e]:[e,t]:[]}function eg(e,t){return u(r=>{let n=r.args,i=[e,...r.path],o=i.pop(),s=i.join(".");if("useMutation"===o)return t[o](s,...n);let[a,...u]=n,l=ey(s,a);if("getQueryKey"===o)return W(l,u[0]??"any");if("_def"===o)return{path:i};if(o.startsWith("useSuspense")){let e=u[0]||{},r=t["useSuspenseQuery"===o?"useQuery":"useInfiniteQuery"](l,{...e,suspense:!0,enabled:!0});return[r.data,r]}return t[o](l,...u)})}let ev=["client","ssrContext","ssrState","abortOnUnmount"],eb=(0,F.createContext)(null);function ew(e){return l(t=>{if("client"===t){var r;return r=e.client,l(e=>r.hasOwnProperty(e)?r[e]:"__untypedClient"===e?r:u(({path:t,args:n})=>{let i=[e,...t],o=T(i.pop()),s=i.join(".");return r[o](s,...n)}))}return ev.includes(t)?e[t]:u(({path:r,args:n})=>{let i=[t,...r],o=i.pop(),s=i.join("."),{queryKey:a,rest:u,updater:l}=(e=>{if(["setData","setInfiniteData"].includes(e)){let[e,t,...r]=n;return{queryKey:ey(s,e),updater:t,rest:r}}let[t,...r]=n;return{queryKey:ey(s,t),rest:r}})(o);return({fetch:()=>e.fetchQuery(a,...u),fetchInfinite:()=>e.fetchInfiniteQuery(a,...u),prefetch:()=>e.prefetchQuery(a,...u),prefetchInfinite:()=>e.prefetchInfiniteQuery(a,...u),ensureData:()=>e.ensureQueryData(a,...u),invalidate:()=>e.invalidateQueries(a,...u),reset:()=>e.resetQueries(a,...u),refetch:()=>e.refetchQueries(a,...u),cancel:()=>e.cancelQuery(a,...u),setData:()=>{e.setQueryData(a,l,...u)},setInfiniteData:()=>{e.setInfiniteQueryData(a,l,...u)},getData:()=>e.getQueryData(a),getInfiniteData:()=>e.getInfiniteQueryData(a)})[o]()})})}function e_(e,t){let[r,n]=e;return[r,n,t?.trpc]}function ek(e){let{path:t}=e;return(0,F.useMemo)(()=>({path:t}),[t])}function eE(e){return function(e){let t=(e?.overrides??e?.unstable_overrides)?.useMutation?.onSuccess??(e=>e.originalFn()),r=e?.context??eb,n=e?.reactQueryContext;function i(){return F.useContext(r)}function o(e,t,r){let{queryClient:n,ssrState:o}=i();return o&&"mounted"!==o&&n.getQueryCache().find(W(e,t))?.state.status==="error"?{retryOnMount:!1,...r}:r}return{Provider:e=>{let{abortOnUnmount:t=!1,client:n,queryClient:i,ssrContext:o}=e,[s,a]=(0,F.useState)(e.ssrState??!1);return(0,F.useEffect)(()=>{a(e=>!!e&&"mounted")},[]),F.createElement(r.Provider,{value:{abortOnUnmount:t,queryClient:i,client:n,ssrContext:o??null,ssrState:s,fetchQuery:(0,F.useCallback)((e,t)=>i.fetchQuery({...t,queryKey:W(e,"query"),queryFn:()=>n.query(...e_(e,t))}),[n,i]),fetchInfiniteQuery:(0,F.useCallback)((e,t)=>i.fetchInfiniteQuery({...t,queryKey:W(e,"infinite"),queryFn:({pageParam:r})=>{let[i,o]=e,s={...o,cursor:r};return n.query(...e_([i,s],t))}}),[n,i]),prefetchQuery:(0,F.useCallback)((e,t)=>i.prefetchQuery({...t,queryKey:W(e,"query"),queryFn:()=>n.query(...e_(e,t))}),[n,i]),prefetchInfiniteQuery:(0,F.useCallback)((e,t)=>i.prefetchInfiniteQuery({...t,queryKey:W(e,"infinite"),queryFn:({pageParam:r})=>{let[i,o]=e,s={...o,cursor:r};return n.query(...e_([i,s],t))}}),[n,i]),ensureQueryData:(0,F.useCallback)((e,t)=>i.ensureQueryData({...t,queryKey:W(e,"query"),queryFn:()=>n.query(...e_(e,t))}),[n,i]),invalidateQueries:(0,F.useCallback)((e,t,r)=>i.invalidateQueries({...t,queryKey:W(e,"any")},r),[i]),resetQueries:(0,F.useCallback)((...e)=>{let[t,r,n]=e;return i.resetQueries({...r,queryKey:W(t,"any")},n)},[i]),refetchQueries:(0,F.useCallback)((...e)=>{let[t,r,n]=e;return i.refetchQueries({...r,queryKey:W(t,"any")},n)},[i]),cancelQuery:(0,F.useCallback)(e=>i.cancelQueries({queryKey:W(e,"any")}),[i]),setQueryData:(0,F.useCallback)((...e)=>{let[t,...r]=e;return i.setQueryData(W(t,"query"),...r)},[i]),getQueryData:(0,F.useCallback)((...e)=>{let[t,...r]=e;return i.getQueryData(W(t,"query"),...r)},[i]),setInfiniteQueryData:(0,F.useCallback)((...e)=>{let[t,...r]=e;return i.setQueryData(W(t,"infinite"),...r)},[i]),getInfiniteQueryData:(0,F.useCallback)((...e)=>{let[t,...r]=e;return i.getQueryData(W(t,"infinite"),...r)},[i])}},e.children)},createClient:e=>new U(e),useContext:i,useUtils:i,useQuery:function(t,r){let s=i();if(!s)throw Error("Unable to retrieve application context. Did you forget to wrap your App inside `withTRPC` HoC?");let{abortOnUnmount:a,client:u,ssrState:l,queryClient:c,prefetchQuery:d}=s,f=c.getQueryDefaults(W(t,"query"));"undefined"!=typeof window||"prepass"!==l||r?.trpc?.ssr===!1||(r?.enabled??f?.enabled)===!1||c.getQueryCache().find(W(t,"query"))||d(t,r);let h=o(t,"query",{...f,...r}),p=r?.trpc?.abortOnUnmount??e?.abortOnUnmount??a,m=(0,V.a)({...h,queryKey:W(t,"query"),queryFn:e=>{let r={...h,trpc:{...h?.trpc,...p?{signal:e.signal}:{}}};return u.query(...e_(t,r))},context:n});return m.trpc=ek({path:t[0]}),m},useQueries:(e,t)=>{let{ssrState:r,queryClient:n,prefetchQuery:o,client:s}=i(),a=e(u(e=>{let t=e.path.join("."),[r,n]=e.args;return{queryKey:ey(t,r),queryFn:()=>s.query(t,r,n?.trpc),...n}}));if("undefined"==typeof window&&"prepass"===r)for(let e of a)e.trpc?.ssr===!1||n.getQueryCache().find(W(e.queryKey,"query"))||o(e.queryKey,e);return function({queries:e,context:t}){let r=(0,z.NL)({context:t}),n=(0,ef.S)(),i=(0,eh._)(),o=F.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=n?"isRestoring":"optimistic",t}),[e,r,n]);o.forEach(e=>{(0,em.Fb)(e),(0,ep.pf)(e,i)}),(0,ep.JN)(i);let[s]=F.useState(()=>new ed(r,o)),a=s.getOptimisticResult(o);(0,er.$)(F.useCallback(e=>n?()=>void 0:s.subscribe(H.V.batchCalls(e)),[s,n]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),F.useEffect(()=>{s.setQueries(o,{listeners:!1})},[o,s]);let u=a.some((e,t)=>(0,em.SB)(o[t],e,n))?a.flatMap((e,t)=>{let r=o[t],a=s.getObservers()[t];if(r&&a){if((0,em.SB)(r,e,n))return(0,em.j8)(r,a,i);(0,em.Z$)(e,n)&&(0,em.j8)(r,a,i)}return[]}):[];if(u.length>0)throw Promise.all(u);let l=s.getQueries(),c=a.find((e,t)=>{var r,n;return(0,ep.KJ)({result:e,errorResetBoundary:i,useErrorBoundary:null!=(r=null==(n=o[t])?void 0:n.useErrorBoundary)&&r,query:l[t]})});if(null!=c&&c.error)throw c.error;return a}({queries:a.map(e=>({...e,queryKey:W(e.queryKey,"query")})),context:t})},useMutation:function(e,r){let{client:o}=i(),s=(0,z.NL)({context:n}),a=Array.isArray(e)?e[0]:e,u=s.getMutationDefaults([a.split(".")]),l=function(e,t,r){let n=(0,$.lV)(e,void 0,void 0),i=(0,z.NL)({context:n.context}),[o]=F.useState(()=>new et(i,n));F.useEffect(()=>{o.setOptions(n)},[o,n]);let s=(0,er.$)(F.useCallback(e=>o.subscribe(H.V.batchCalls(e)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),a=F.useCallback((e,t)=>{o.mutate(e,t).catch(ei)},[o]);if(s.error&&(0,en.L)(o.options.useErrorBoundary,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}({...r,mutationKey:[a.split(".")],mutationFn:e=>o.mutation(...e_([a,e],r)),context:n,onSuccess:(...e)=>t({originalFn:()=>r?.onSuccess?.(...e)??u?.onSuccess?.(...e),queryClient:s,meta:r?.meta??u?.meta??{}})});return l.trpc=ek({path:a}),l},useSubscription:function(e,t){let r=t?.enabled??!0,n=(0,$.yF)(e),{client:o}=i(),s=(0,F.useRef)(t);s.current=t,(0,F.useEffect)(()=>{if(!r)return;let[t,n]=e,i=!1,a=o.subscription(t,n??void 0,{onStarted:()=>{i||s.current.onStarted?.()},onData:e=>{i||s.current.onData(e)},onError:e=>{i||s.current.onError?.(e)}});return()=>{i=!0,a.unsubscribe()}},[n,r])},useDehydratedState:(e,t)=>(0,F.useMemo)(()=>t?e.runtime.transformer.deserialize(t):t,[t,e]),useInfiniteQuery:function(e,t){let[r,s]=e,{client:a,ssrState:u,prefetchInfiniteQuery:l,queryClient:c,abortOnUnmount:d}=i(),f=c.getQueryDefaults(W(e,"infinite"));"undefined"!=typeof window||"prepass"!==u||t?.trpc?.ssr===!1||(t?.enabled??f?.enabled)===!1||c.getQueryCache().find(W(e,"infinite"))||l(e,{...f,...t});let h=o(e,"infinite",{...f,...t}),p=t?.trpc?.abortOnUnmount??d,m=function(e,t,r){let n=(0,$._v)(e,void 0,void 0);return(0,ec.r)(n,el)}({...h,queryKey:W(e,"infinite"),queryFn:e=>{let n={...h,trpc:{...h?.trpc,...p?{signal:e.signal}:{}}},i={...s??{},cursor:e.pageParam??t?.initialCursor};return a.query(...e_([r,i],n))},context:n});return m.trpc=ek({path:r}),m}}}(e)}class eC extends J{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||G,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||function(e){let 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?null!=n?n:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.cache.remove(this)}setData(e,t){let r=(0,$.oE)(this.state.data,e,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),r}setState(e,t){this.dispatch({type:"setState",state:e,setStateOptions:t})}cancel(e){var t;let r=this.promise;return null==(t=this.retryer)||t.cancel(e),r?r.then($.ZT).catch($.ZT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>!1!==e.options.enabled)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!(0,$.Kp)(this.state.dataUpdatedAt,e)}onFocus(){var e;let t=this.observers.find(e=>e.shouldFetchOnWindowFocus());t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}onOnline(){var e;let t=this.observers.find(e=>e.shouldFetchOnReconnect());t&&t.refetch({cancelRefetch:!1}),null==(e=this.retryer)||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.cache.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.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,t){var r,n,i,o;if("idle"!==this.state.fetchStatus){if(this.state.dataUpdatedAt&&null!=t&&t.cancelRefetch)this.cancel({silent:!0});else if(this.promise)return null==(i=this.retryer)||i.continueRetry(),this.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let s=(0,$.G9)(),a={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},u=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>{if(s)return this.abortSignalConsumed=!0,s.signal}})};u(a);let l={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(a)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'")};u(l),null==(r=this.options.behavior)||r.onFetch(l),this.revertState=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(n=l.fetchOptions)?void 0:n.meta))&&this.dispatch({type:"fetch",meta:null==(o=l.fetchOptions)?void 0:o.meta});let c=e=>{if((0,Y.DV)(e)&&e.silent||this.dispatch({type:"error",error:e}),!(0,Y.DV)(e)){var t,r,n,i;null==(t=(r=this.cache.config).onError)||t.call(r,e,this),null==(n=(i=this.cache.config).onSettled)||n.call(i,this.state.data,e,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=(0,Y.Mz)({fn:l.fetchFn,abort:null==s?void 0:s.abort.bind(s),onSuccess:e=>{var t,r,n,i;if(void 0===e){c(Error(this.queryHash+" data is undefined"));return}this.setData(e),null==(t=(r=this.cache.config).onSuccess)||t.call(r,e,this),null==(n=(i=this.cache.config).onSettled)||n.call(i,e,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:c,onFail:(e,t)=>{this.dispatch({type:"failed",failureCount:e,error:t})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){this.state=(t=>{var r,n;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,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null!=(r=e.meta)?r:null,fetchStatus:(0,Y.Kw)(this.options.networkMode)?"fetching":"paused",...!t.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:null!=(n=e.dataUpdatedAt)?n:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let i=e.error;if((0,Y.DV)(i)&&i.revert&&this.revertState)return{...this.revertState,fetchStatus:"idle"};return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),H.V.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}class eS extends ee.l{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,t,r){var n;let i=t.queryKey,o=null!=(n=t.queryHash)?n:(0,$.Rm)(i,t),s=this.get(o);return s||(s=new eC({cache:this,logger:e.getLogger(),queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(s)),s}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){let t=this.queriesMap[e.queryHash];t&&(e.destroy(),this.queries=this.queries.filter(t=>t!==e),t===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){H.V.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,t){let[r]=(0,$.I6)(e,t);return void 0===r.exact&&(r.exact=!0),this.queries.find(e=>(0,$._x)(r,e))}findAll(e,t){let[r]=(0,$.I6)(e,t);return Object.keys(r).length>0?this.queries.filter(e=>(0,$._x)(r,e)):this.queries}notify(e){H.V.batch(()=>{this.listeners.forEach(({listener:t})=>{t(e)})})}onFocus(){H.V.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){H.V.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class eO extends ee.l{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,t,r){let n=new X({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(t),state:r,defaultOptions:t.mutationKey?e.getMutationDefaults(t.mutationKey):void 0});return this.add(n),n}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(t=>t!==e),this.notify({type:"removed",mutation:e})}clear(){H.V.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return void 0===e.exact&&(e.exact=!0),this.mutations.find(t=>(0,$.X7)(e,t))}findAll(e){return this.mutations.filter(t=>(0,$.X7)(e,t))}notify(e){H.V.batch(()=>{this.listeners.forEach(({listener:t})=>{t(e)})})}resumePausedMutations(){var e;return this.resuming=(null!=(e=this.resuming)?e:Promise.resolve()).then(()=>{let e=this.mutations.filter(e=>e.state.isPaused);return H.V.batch(()=>e.reduce((e,t)=>e.then(()=>t.continue().catch($.ZT)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}var eP=r(5761),eR=r(6474);class ex{constructor(e={}){this.queryCache=e.queryCache||new eS,this.mutationCache=e.mutationCache||new eO,this.logger=e.logger||G,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,1===this.mountCount&&(this.unsubscribeFocus=eP.j.subscribe(()=>{eP.j.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=eR.N.subscribe(()=>{eR.N.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,t;this.mountCount--,0===this.mountCount&&(null==(e=this.unsubscribeFocus)||e.call(this),this.unsubscribeFocus=void 0,null==(t=this.unsubscribeOnline)||t.call(this),this.unsubscribeOnline=void 0)}isFetching(e,t){let[r]=(0,$.I6)(e,t);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,t){var r;return null==(r=this.queryCache.find(e,t))?void 0:r.state.data}ensureQueryData(e,t,r){let n=(0,$._v)(e,t,r),i=this.getQueryData(n.queryKey);return i?Promise.resolve(i):this.fetchQuery(n)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let n=this.queryCache.find(e),i=null==n?void 0:n.state.data,o=(0,$.SE)(t,i);if(void 0===o)return;let s=(0,$._v)(e),a=this.defaultQueryOptions(s);return this.queryCache.build(this,a).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return H.V.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e,t){var r;return null==(r=this.queryCache.find(e,t))?void 0:r.state}removeQueries(e,t){let[r]=(0,$.I6)(e,t),n=this.queryCache;H.V.batch(()=>{n.findAll(r).forEach(e=>{n.remove(e)})})}resetQueries(e,t,r){let[n,i]=(0,$.I6)(e,t,r),o=this.queryCache,s={type:"active",...n};return H.V.batch(()=>(o.findAll(n).forEach(e=>{e.reset()}),this.refetchQueries(s,i)))}cancelQueries(e,t,r){let[n,i={}]=(0,$.I6)(e,t,r);return void 0===i.revert&&(i.revert=!0),Promise.all(H.V.batch(()=>this.queryCache.findAll(n).map(e=>e.cancel(i)))).then($.ZT).catch($.ZT)}invalidateQueries(e,t,r){let[n,i]=(0,$.I6)(e,t,r);return H.V.batch(()=>{var e,t;if(this.queryCache.findAll(n).forEach(e=>{e.invalidate()}),"none"===n.refetchType)return Promise.resolve();let r={...n,type:null!=(e=null!=(t=n.refetchType)?t:n.type)?e:"active"};return this.refetchQueries(r,i)})}refetchQueries(e,t,r){let[n,i]=(0,$.I6)(e,t,r),o=Promise.all(H.V.batch(()=>this.queryCache.findAll(n).filter(e=>!e.isDisabled()).map(e=>{var t;return e.fetch(void 0,{...i,cancelRefetch:null==(t=null==i?void 0:i.cancelRefetch)||t,meta:{refetchPage:n.refetchPage}})}))).then($.ZT);return null!=i&&i.throwOnError||(o=o.catch($.ZT)),o}fetchQuery(e,t,r){let n=(0,$._v)(e,t,r),i=this.defaultQueryOptions(n);void 0===i.retry&&(i.retry=!1);let o=this.queryCache.build(this,i);return o.isStaleByTime(i.staleTime)?o.fetch(i):Promise.resolve(o.state.data)}prefetchQuery(e,t,r){return this.fetchQuery(e,t,r).then($.ZT).catch($.ZT)}fetchInfiniteQuery(e,t,r){let n=(0,$._v)(e,t,r);return n.behavior=es(),this.fetchQuery(n)}prefetchInfiniteQuery(e,t,r){return this.fetchInfiniteQuery(e,t,r).then($.ZT).catch($.ZT)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,t){let r=this.queryDefaults.find(t=>(0,$.yF)(e)===(0,$.yF)(t.queryKey));r?r.defaultOptions=t:this.queryDefaults.push({queryKey:e,defaultOptions:t})}getQueryDefaults(e){if(!e)return;let t=this.queryDefaults.find(t=>(0,$.to)(e,t.queryKey));return null==t?void 0:t.defaultOptions}setMutationDefaults(e,t){let r=this.mutationDefaults.find(t=>(0,$.yF)(e)===(0,$.yF)(t.mutationKey));r?r.defaultOptions=t:this.mutationDefaults.push({mutationKey:e,defaultOptions:t})}getMutationDefaults(e){if(!e)return;let t=this.mutationDefaults.find(t=>(0,$.to)(e,t.mutationKey));return null==t?void 0:t.defaultOptions}defaultQueryOptions(e){if(null!=e&&e._defaulted)return e;let t={...this.defaultOptions.queries,...this.getQueryDefaults(null==e?void 0:e.queryKey),...e,_defaulted:!0};return!t.queryHash&&t.queryKey&&(t.queryHash=(0,$.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.useErrorBoundary&&(t.useErrorBoundary=!!t.suspense),t}defaultMutationOptions(e){return null!=e&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(null==e?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}let ej=e=>e.queryClient??new ex(e.queryClientConfig);function eU(e){let t=e.state.error;if(t instanceof Error&&"TRPCClientError"===t.name){let r={message:t.message,data:t.data,shape:t.shape};return{...e,state:{...e.state,error:r}}}return e}var eM=function(){function e(){this.keyToValue=new Map,this.valueToKey=new Map}return e.prototype.set=function(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)},e.prototype.getByKey=function(e){return this.keyToValue.get(e)},e.prototype.getByValue=function(e){return this.valueToKey.get(e)},e.prototype.clear=function(){this.keyToValue.clear(),this.valueToKey.clear()},e}(),eT=function(){function e(e){this.generateIdentifier=e,this.kv=new eM}return e.prototype.register=function(e,t){this.kv.getByValue(e)||(t||(t=this.generateIdentifier(e)),this.kv.set(t,e))},e.prototype.clear=function(){this.kv.clear()},e.prototype.getIdentifier=function(e){return this.kv.getByValue(e)},e.prototype.getValue=function(e){return this.kv.getByKey(e)},e}(),eA=(q=function(e,t){return(q=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}q(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),eI=function(e){function t(){var t=e.call(this,function(e){return e.name})||this;return t.classToAllowedProps=new Map,t}return eA(t,e),t.prototype.register=function(t,r){"object"==typeof r?(r.allowProps&&this.classToAllowedProps.set(t,r.allowProps),e.prototype.register.call(this,t,r.identifier)):e.prototype.register.call(this,t,r)},t.prototype.getAllowedProps=function(e){return this.classToAllowedProps.get(e)},t}(eT),eL=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s};function eN(e,t){Object.entries(e).forEach(function(e){var r=eL(e,2),n=r[0];return t(r[1],n)})}function eD(e,t){return -1!==e.indexOf(t)}function eq(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(t(n))return n}}var ez=function(){function e(){this.transfomers={}}return e.prototype.register=function(e){this.transfomers[e.name]=e},e.prototype.findApplicable=function(e){return function(e,t){var r=function(e){if("values"in Object)return Object.values(e);var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t}(e);if("find"in r)return r.find(t);for(var n=0;n<r.length;n++){var i=r[n];if(t(i))return i}}(this.transfomers,function(t){return t.isApplicable(e)})},e.prototype.findByName=function(e){return this.transfomers[e]},e}(),eF=function(e){return void 0===e},eQ=function(e){return"object"==typeof e&&null!==e&&e!==Object.prototype&&(null===Object.getPrototypeOf(e)||Object.getPrototypeOf(e)===Object.prototype)},eK=function(e){return eQ(e)&&0===Object.keys(e).length},eB=function(e){return Array.isArray(e)},eW=function(e){return e instanceof Map},eV=function(e){return e instanceof Set},e$=function(e){return"Symbol"===Object.prototype.toString.call(e).slice(8,-1)},eG=function(e){return"number"==typeof e&&isNaN(e)},eH=function(e){return e.replace(/\./g,"\\.")},eJ=function(e){return e.map(String).map(eH).join(".")},eY=function(e){for(var t=[],r="",n=0;n<e.length;n++){var i=e.charAt(n);if("\\"===i&&"."===e.charAt(n+1)){r+=".",n++;continue}if("."===i){t.push(r),r="";continue}r+=i}var o=r;return t.push(o),t},eX=function(){return(eX=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},eZ=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},e0=function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};function e1(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}var e2=[e1(eF,"undefined",function(){return null},function(){}),e1(function(e){return"bigint"==typeof e},"bigint",function(e){return e.toString()},function(e){return"undefined"!=typeof BigInt?BigInt(e):(console.error("Please add a BigInt polyfill."),e)}),e1(function(e){return e instanceof Date&&!isNaN(e.valueOf())},"Date",function(e){return e.toISOString()},function(e){return new Date(e)}),e1(function(e){return e instanceof Error},"Error",function(e,t){var r={name:e.name,message:e.message};return t.allowedErrorProps.forEach(function(t){r[t]=e[t]}),r},function(e,t){var r=Error(e.message);return r.name=e.name,r.stack=e.stack,t.allowedErrorProps.forEach(function(t){r[t]=e[t]}),r}),e1(function(e){return e instanceof RegExp},"regexp",function(e){return""+e},function(e){return new RegExp(e.slice(1,e.lastIndexOf("/")),e.slice(e.lastIndexOf("/")+1))}),e1(eV,"set",function(e){return e0([],eZ(e.values()))},function(e){return new Set(e)}),e1(eW,"map",function(e){return e0([],eZ(e.entries()))},function(e){return new Map(e)}),e1(function(e){var t;return eG(e)||(t=e)===1/0||t===-1/0},"number",function(e){return eG(e)?"NaN":e>0?"Infinity":"-Infinity"},Number),e1(function(e){return 0===e&&1/e==-1/0},"number",function(){return"-0"},Number),e1(function(e){return e instanceof URL},"URL",function(e){return e.toString()},function(e){return new URL(e)})];function e4(e,t,r,n){return{isApplicable:e,annotation:t,transform:r,untransform:n}}var e5=e4(function(e,t){return!!e$(e)&&!!t.symbolRegistry.getIdentifier(e)},function(e,t){return["symbol",t.symbolRegistry.getIdentifier(e)]},function(e){return e.description},function(e,t,r){var n=r.symbolRegistry.getValue(t[1]);if(!n)throw Error("Trying to deserialize unknown symbol");return n}),e3=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(function(e,t){return e[t.name]=t,e},{}),e7=e4(function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},function(e){return["typed-array",e.constructor.name]},function(e){return e0([],eZ(e))},function(e,t){var r=e3[t[1]];if(!r)throw Error("Trying to deserialize unknown typed array");return new r(e)});function e9(e,t){return null!=e&&!!e.constructor&&!!t.classRegistry.getIdentifier(e.constructor)}var e6=e4(e9,function(e,t){return["class",t.classRegistry.getIdentifier(e.constructor)]},function(e,t){var r=t.classRegistry.getAllowedProps(e.constructor);if(!r)return eX({},e);var n={};return r.forEach(function(t){n[t]=e[t]}),n},function(e,t,r){var n=r.classRegistry.getValue(t[1]);if(!n)throw Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(n.prototype),e)}),e8=e4(function(e,t){return!!t.customTransformerRegistry.findApplicable(e)},function(e,t){return["custom",t.customTransformerRegistry.findApplicable(e).name]},function(e,t){return t.customTransformerRegistry.findApplicable(e).serialize(e)},function(e,t,r){var n=r.customTransformerRegistry.findByName(t[1]);if(!n)throw Error("Trying to deserialize unknown custom value");return n.deserialize(e)}),te=[e6,e5,e8,e7],tt=function(e,t){var r=eq(te,function(r){return r.isApplicable(e,t)});if(r)return{value:r.transform(e,t),type:r.annotation(e,t)};var n=eq(e2,function(r){return r.isApplicable(e,t)});if(n)return{value:n.transform(e,t),type:n.annotation}},tr={};e2.forEach(function(e){tr[e.annotation]=e});var tn=function(e,t,r){if(eB(t))switch(t[0]){case"symbol":return e5.untransform(e,t,r);case"class":return e6.untransform(e,t,r);case"custom":return e8.untransform(e,t,r);case"typed-array":return e7.untransform(e,t,r);default:throw Error("Unknown transformation: "+t)}else{var n=tr[t];if(!n)throw Error("Unknown transformation: "+t);return n.untransform(e,r)}},ti=function(e,t){for(var r=e.keys();t>0;)r.next(),t--;return r.next().value};function to(e){if(eD(e,"__proto__"))throw Error("__proto__ is not allowed as a property");if(eD(e,"prototype"))throw Error("prototype is not allowed as a property");if(eD(e,"constructor"))throw Error("constructor is not allowed as a property")}var ts=function(e,t){to(t);for(var r=0;r<t.length;r++){var n=t[r];if(eV(e))e=ti(e,+n);else if(eW(e)){var i=+n,o=0==+t[++r]?"key":"value",s=ti(e,i);switch(o){case"key":e=s;break;case"value":e=e.get(s)}}else e=e[n]}return e},ta=function(e,t,r){if(to(t),0===t.length)return r(e);for(var n=e,i=0;i<t.length-1;i++){var o=t[i];if(eB(n))n=n[+o];else if(eQ(n))n=n[o];else if(eV(n)){var s=+o;n=ti(n,s)}else if(eW(n)){if(i===t.length-2)break;var s=+o,a=0==+t[++i]?"key":"value",u=ti(n,s);switch(a){case"key":n=u;break;case"value":n=n.get(u)}}}var l=t[t.length-1];if(eB(n)?n[+l]=r(n[+l]):eQ(n)&&(n[l]=r(n[l])),eV(n)){var c=ti(n,+l),d=r(c);c!==d&&(n.delete(c),n.add(d))}if(eW(n)){var s=+t[t.length-2],f=ti(n,s),a=0==+l?"key":"value";switch(a){case"key":var h=r(f);n.set(h,n.get(f)),h!==f&&n.delete(f);break;case"value":n.set(f,r(n.get(f)))}}return e},tu=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},tl=function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e},tc=function(e,t,r,n,i,o,s){void 0===i&&(i=[]),void 0===o&&(o=[]),void 0===s&&(s=new Map);var a,u,l="boolean"==typeof(a=e)||null===a||eF(a)||"number"==typeof a&&!isNaN(a)||"string"==typeof a||e$(a);if(!l){c=i,(d=t.get(e))?d.push(c):t.set(e,[c]);var c,d,f=s.get(e);if(f)return n?{transformedValue:null}:f}if(!(eQ(e)||eB(e)||eW(e)||eV(e)||e9(e,r))){var h=tt(e,r),p=h?{transformedValue:h.value,annotations:[h.type]}:{transformedValue:e};return l||s.set(e,p),p}if(eD(o,e))return{transformedValue:null};var m=tt(e,r),y=null!==(u=null==m?void 0:m.value)&&void 0!==u?u:e,g=eB(y)?[]:{},v={};eN(y,function(a,u){var l=tc(a,t,r,n,tl(tl([],tu(i)),[u]),tl(tl([],tu(o)),[e]),s);g[u]=l.transformedValue,eB(l.annotations)?v[u]=l.annotations:eQ(l.annotations)&&eN(l.annotations,function(e,t){v[eH(u)+"."+t]=e})});var b=eK(v)?{transformedValue:g,annotations:m?[m.type]:void 0}:{transformedValue:g,annotations:m?[m.type,v]:v};return l||s.set(e,b),b};function td(e){return Object.prototype.toString.call(e).slice(8,-1)}function tf(e){return"Array"===td(e)}var th=function(){return(th=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},tp=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},tm=function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e},ty=function(){function e(e){var t=(void 0===e?{}:e).dedupe;this.classRegistry=new eI,this.symbolRegistry=new eT(function(e){var t;return null!==(t=e.description)&&void 0!==t?t:""}),this.customTransformerRegistry=new ez,this.allowedErrorProps=[],this.dedupe=void 0!==t&&t}return e.prototype.serialize=function(e){var t,r,n,i=new Map,o=tc(e,i,this,this.dedupe),s={json:o.transformedValue};o.annotations&&(s.meta=th(th({},s.meta),{values:o.annotations}));var a=(t=this.dedupe,r={},n=void 0,(i.forEach(function(e){if(!(e.length<=1)){t||(e=e.map(function(e){return e.map(String)}).sort(function(e,t){return e.length-t.length}));var i=tu(e),o=i[0],s=i.slice(1);0===o.length?n=s.map(eJ):r[eJ(o)]=s.map(eJ)}}),n)?eK(r)?[n]:[n,r]:eK(r)?void 0:r);return a&&(s.meta=th(th({},s.meta),{referentialEqualities:a})),s},e.prototype.deserialize=function(e){var t,r,n,i=e.json,o=e.meta,s=function e(t,r={}){return tf(t)?t.map(t=>e(t,r)):!function(e){if("Object"!==td(e))return!1;let t=Object.getPrototypeOf(e);return t.constructor===Object&&t===Object.prototype}(t)?t:[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)].reduce((n,i)=>{if(tf(r.props)&&!r.props.includes(i))return n;let o=e(t[i],r);return function(e,t,r,n,i){let o=({}).propertyIsEnumerable.call(n,t)?"enumerable":"nonenumerable";"enumerable"===o&&(e[t]=r),i&&"nonenumerable"===o&&Object.defineProperty(e,t,{value:r,enumerable:!1,writable:!0,configurable:!0})}(n,i,o,t,r.nonenumerable),n},{})}(i);return(null==o?void 0:o.values)&&(t=s,r=o.values,n=this,function e(t,r,n){if(void 0===n&&(n=[]),t){if(!eB(t)){eN(t,function(t,i){return e(t,r,tl(tl([],tu(n)),tu(eY(i))))});return}var i=tu(t,2),o=i[0],s=i[1];s&&eN(s,function(t,i){e(t,r,tl(tl([],tu(n)),tu(eY(i))))}),r(o,n)}}(r,function(e,r){t=ta(t,r,function(t){return tn(t,e,n)})}),s=t),(null==o?void 0:o.referentialEqualities)&&(s=function(e,t){function r(t,r){var n=ts(e,eY(r));t.map(eY).forEach(function(t){e=ta(e,t,function(){return n})})}if(eB(t)){var n=tu(t,2),i=n[0],o=n[1];i.forEach(function(t){e=ta(e,eY(t),function(){return e})}),o&&eN(o,r)}else eN(t,r);return e}(s,o.referentialEqualities)),s},e.prototype.stringify=function(e){return JSON.stringify(this.serialize(e))},e.prototype.parse=function(e){return this.deserialize(JSON.parse(e))},e.prototype.registerClass=function(e,t){this.classRegistry.register(e,t)},e.prototype.registerSymbol=function(e,t){this.symbolRegistry.register(e,t)},e.prototype.registerCustom=function(e,t){this.customTransformerRegistry.register(th({name:t},e))},e.prototype.allowErrorProps=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];(e=this.allowedErrorProps).push.apply(e,tm([],tp(t)))},e.defaultInstance=new e,e.serialize=e.defaultInstance.serialize.bind(e.defaultInstance),e.deserialize=e.defaultInstance.deserialize.bind(e.defaultInstance),e.stringify=e.defaultInstance.stringify.bind(e.defaultInstance),e.parse=e.defaultInstance.parse.bind(e.defaultInstance),e.registerClass=e.defaultInstance.registerClass.bind(e.defaultInstance),e.registerSymbol=e.defaultInstance.registerSymbol.bind(e.defaultInstance),e.registerCustom=e.defaultInstance.registerCustom.bind(e.defaultInstance),e.allowErrorProps=e.defaultInstance.allowErrorProps.bind(e.defaultInstance),e}();ty.serialize,ty.deserialize,ty.stringify,ty.parse,ty.registerClass,ty.registerCustom,ty.registerSymbol,ty.allowErrorProps,r(3454);let tg=()=>"",tv=function(e){let t=eE(e),n=function(e){let{config:t}=e;return n=>{let i=function(e){let t=eE(e),r=l(e=>"useContext"===e||"useUtils"===e?()=>{let e=t.useUtils();return(0,F.useMemo)(()=>ew(e),[e])}:t.hasOwnProperty(e)?t[e]:eg(e,t));return{...t,proxy:r}}(e),o=r=>{let[o]=(0,F.useState)(()=>{if(r.trpc)return r.trpc;let n=t({}),o=ej(n),s=i.createClient(n);return{abortOnUnmount:n.abortOnUnmount,queryClient:o,trpcClient:s,ssrState:!!e.ssr&&"mounting",ssrContext:null}}),{queryClient:s,trpcClient:a,ssrState:u,ssrContext:l}=o,c=i.useDehydratedState(a,r.pageProps?.trpcState);return F.createElement(i.Provider,{abortOnUnmount:o.abortOnUnmount??!1,client:a,queryClient:s,ssrState:u,ssrContext:l},F.createElement(z.aH,{client:s},F.createElement(B,{state:c},F.createElement(n,Object.assign({},r)))))};(n.getInitialProps??e.ssr)&&(o.getInitialProps=async i=>{let o=async()=>{if("function"==typeof e.ssr){if("undefined"!=typeof window)return!1;try{return await e.ssr({ctx:i.ctx})}catch(e){return!1}}return e.ssr},s=await o(),a=i.AppTree,u=!!i.Component,l=u?i.ctx:i,c={};if(n.getInitialProps){let e=await n.getInitialProps(i);c={...u?e.pageProps??{}:e,...c}}let d=e=>u?{pageProps:e}:e;if("undefined"!=typeof window||!s)return d(c);let f=t({ctx:l}),h=new U(f),p=ej(f),m={pageProps:c,trpc:{config:f,trpcClient:h,queryClient:p,ssrState:"prepass",ssrContext:l}},y=await r.e(774).then(r.t.bind(r,7762,19));for(;y.renderToString((0,F.createElement)(a,m)),p.isFetching();)await new Promise(e=>{let t=p.getQueryCache().subscribe(r=>{r?.query.getObserversCount()===0&&(e(),t())})});let g=function(e,t={}){let r=[],n=[];if(!1!==t.dehydrateMutations){let n=t.shouldDehydrateMutation||Q;e.getMutationCache().getAll().forEach(e=>{n(e)&&r.push({mutationKey:e.options.mutationKey,state:e.state})})}if(!1!==t.dehydrateQueries){let r=t.shouldDehydrateQuery||K;e.getQueryCache().getAll().forEach(e=>{r(e)&&n.push({state:e.state,queryKey:e.queryKey,queryHash:e.queryHash})})}return{mutations:r,queries:n}}(p,{shouldDehydrateQuery:e=>!("idle"===e.state.fetchStatus&&"loading"===e.state.status)}),v={...g,queries:g.queries.map(eU),mutations:g.mutations.map(eU)};c.trpcState=h.runtime.combinedTransformer.output.serialize(v);let b=d(c);if("responseMeta"in e){let t=e.responseMeta?.({ctx:l,clientErrors:[...g.queries,...g.mutations].map(e=>e.state.error).flatMap(e=>e instanceof Error&&"TRPCClientError"===e.name?[e]:[])})??{};for(let[e,r]of Object.entries(t.headers??{}))"string"==typeof r&&l.res?.setHeader(e,r);t.status&&l.res&&(l.res.statusCode=t.status)}return b});let s=n.displayName??n.name??"Component";return o.displayName=`withTRPC(${s})`,o}}(e);return l(e=>"useContext"===e||"useUtils"===e?()=>{let e=t.useUtils();return(0,F.useMemo)(()=>ew(e),[e])}:"useQueries"===e?t.useQueries:"withTRPC"===e?n:eg(e,t))}({config:()=>({transformer:ty,queryClientConfig:{defaultOptions:{queries:{refetchOnWindowFocus:!1}}},links:[function(e={}){let{enabled:t=()=>!0}=e,r=e.colorMode??("undefined"==typeof window?"ansi":"css"),{logger:i=j({c:e.console,colorMode:r})}=e;return()=>({op:e,next:r})=>n(n=>{var o;t({...e,direction:"up"})&&i({...e,direction:"up"});let s=Date.now();function a(r){let n=Date.now()-s;t({...e,direction:"down",result:r})&&i({...e,direction:"down",elapsedMs:n,result:r})}return r(e).pipe((o={next(e){a(e)},error(e){a(e)}},e=>({subscribe:t=>e.subscribe({next(e){o.next?.(e),t.next?.(e)},error(e){o.error?.(e),t.error?.(e)},complete(){o.complete?.(),t.complete?.()}})}))).subscribe(n)})}({enabled:e=>"down"===e.direction&&e.result instanceof Error}),P({url:"".concat(tg(),"/api/trpc")})]}),ssr:!1})},9079:function(e){"use strict";var t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o={};function s(e){var t;let r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===r.length?n:`${n}; ${r.join("; ")}`}function a(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[n,i]=[r.slice(0,e),r.slice(e+1)];try{t.set(n,decodeURIComponent(null!=i?i:"true"))}catch{}}return t}function u(e){var t,r;if(!e)return;let[[n,i],...o]=a(e),{domain:s,expires:u,httponly:d,maxage:f,path:h,samesite:p,secure:m,partitioned:y,priority:g}=Object.fromEntries(o.map(([e,t])=>[e.toLowerCase(),t]));return function(e){let t={};for(let r in e)e[r]&&(t[r]=e[r]);return t}({name:n,value:decodeURIComponent(i),domain:s,...u&&{expires:new Date(u)},...d&&{httpOnly:!0},..."string"==typeof f&&{maxAge:Number(f)},path:h,...p&&{sameSite:l.includes(t=(t=p).toLowerCase())?t:void 0},...m&&{secure:!0},...g&&{priority:c.includes(r=(r=g).toLowerCase())?r:void 0},...y&&{partitioned:!0}})}((e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})})(o,{RequestCookies:()=>d,ResponseCookies:()=>f,parseCookie:()=>a,parseSetCookie:()=>u,stringifyCookie:()=>s}),e.exports=((e,o,s,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let u of n(o))i.call(e,u)||u===s||t(e,u,{get:()=>o[u],enumerable:!(a=r(o,u))||a.enumerable});return e})(t({},"__esModule",{value:!0}),o);var l=["strict","lax","none"],c=["low","medium","high"],d=class{constructor(e){this._parsed=new Map,this._headers=e;let t=e.get("cookie");if(t)for(let[e,r]of a(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===n).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([e,t])=>s(t)).join("; ")),this}delete(e){let t=this._parsed,r=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>s(t)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},f=class{constructor(e){var t,r,n;this._parsed=new Map,this._headers=e;let i=null!=(n=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?n:[];for(let e of Array.isArray(i)?i:function(e){if(!e)return[];var t,r,n,i,o,s=[],a=0;function u(){for(;a<e.length&&/\s/.test(e.charAt(a));)a+=1;return a<e.length}for(;a<e.length;){for(t=a,o=!1;u();)if(","===(r=e.charAt(a))){for(n=a,a+=1,u(),i=a;a<e.length&&"="!==(r=e.charAt(a))&&";"!==r&&","!==r;)a+=1;a<e.length&&"="===e.charAt(a)?(o=!0,a=i,s.push(e.substring(t,n)),t=a):a=n+1}else a+=1;(!o||a>=e.length)&&s.push(e.substring(t,e.length))}return s}(i)){let t=u(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed.values());if(!e.length)return r;let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,r,n]=1===e.length?[e[0].name,e[0].value,e[0]]:e,i=this._parsed;return i.set(t,function(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}({name:t,value:r,...n})),function(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=s(r);t.append("set-cookie",e)}}(i,this._headers),this}delete(...e){let[t,r,n]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0].path,e[0].domain];return this.set({name:t,path:r,domain:n,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(s).join("; ")}}},876:function(){},7663:function(e){!function(){var t={229:function(e){var t,r,n,i=e.exports={};function o(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var u=[],l=!1,c=-1;function d(){l&&n&&(l=!1,n.length?u=n.concat(u):c=-1,u.length&&f())}function f(){if(!l){var e=a(d);l=!0;for(var t=u.length;t;){for(n=u,u=[];++c<t;)n&&n[c].run();c=-1,t=u.length}n=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new h(e,t)),1!==u.length||l||a(f)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={exports:{}},s=!0;try{t[e](o,o.exports,n),s=!1}finally{s&&delete r[e]}return o.exports}n.ab="//";var i=n(229);e.exports=i}()},4040:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getPathname:function(){return n},isFullStringUrl:function(){return i},parseUrl:function(){return o}});let r="http://n";function n(e){return new URL(e,r).pathname}function i(e){return/https?:\/\//.test(e)}function o(e){let t;try{t=new URL(e,r)}catch{}return t}},7325:function(e,t,r){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{Postpone:function(){return f},createPostponedAbortSignal:function(){return v},createPrerenderState:function(){return l},formatDynamicAPIAccesses:function(){return y},markCurrentScopeAsDynamic:function(){return c},trackDynamicDataAccessed:function(){return d},trackDynamicFetch:function(){return h},usedDynamicAPIs:function(){return m}});let i=(n=r(7294))&&n.__esModule?n:{default:n},o=r(1539),s=r(2700),a=r(4040),u="function"==typeof i.default.unstable_postpone;function l(e){return{isDebugSkeleton:e,dynamicAccesses:[]}}function c(e,t){let r=(0,a.getPathname)(e.urlPathname);if(!e.isUnstableCacheCallback){if(e.dynamicShouldError)throw new s.StaticGenBailoutError(`Route ${r} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(e.prerenderState)p(e.prerenderState,t,r);else if(e.revalidate=0,e.isStaticGeneration){let n=new o.DynamicServerError(`Route ${r} couldn't be rendered statically because it used ${t}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);throw e.dynamicUsageDescription=t,e.dynamicUsageStack=n.stack,n}}}function d(e,t){let r=(0,a.getPathname)(e.urlPathname);if(e.isUnstableCacheCallback)throw Error(`Route ${r} used "${t}" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "${t}" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`);if(e.dynamicShouldError)throw new s.StaticGenBailoutError(`Route ${r} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(e.prerenderState)p(e.prerenderState,t,r);else if(e.revalidate=0,e.isStaticGeneration){let n=new o.DynamicServerError(`Route ${r} couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);throw e.dynamicUsageDescription=t,e.dynamicUsageStack=n.stack,n}}function f({reason:e,prerenderState:t,pathname:r}){p(t,e,r)}function h(e,t){e.prerenderState&&p(e.prerenderState,t,e.urlPathname)}function p(e,t,r){g();let n=`Route ${r} needs to bail out of prerendering at this point because it used ${t}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`;e.dynamicAccesses.push({stack:e.isDebugSkeleton?Error().stack:void 0,expression:t}),i.default.unstable_postpone(n)}function m(e){return e.dynamicAccesses.length>0}function y(e){return e.dynamicAccesses.filter(e=>"string"==typeof e.stack&&e.stack.length>0).map(({expression:e,stack:t})=>(t=t.split("\n").slice(4).filter(e=>!(e.includes("node_modules/next/")||e.includes(" (<anonymous>)")||e.includes(" (node:"))).join("\n"),`Dynamic API Usage Debug - ${e}:
${t}`))}function g(){if(!u)throw Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js")}function v(e){g();let t=new AbortController;try{i.default.unstable_postpone(e)}catch(e){t.abort(e)}return t.signal}},4042:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{HeadersAdapter:function(){return o},ReadonlyHeadersError:function(){return i}});let n=r(7246);class i extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new i}}class o extends Headers{constructor(e){super(),this.headers=new Proxy(e,{get(t,r,i){if("symbol"==typeof r)return n.ReflectAdapter.get(t,r,i);let o=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===o);if(void 0!==s)return n.ReflectAdapter.get(t,s,i)},set(t,r,i,o){if("symbol"==typeof r)return n.ReflectAdapter.set(t,r,i,o);let s=r.toLowerCase(),a=Object.keys(e).find(e=>e.toLowerCase()===s);return n.ReflectAdapter.set(t,a??r,i,o)},has(t,r){if("symbol"==typeof r)return n.ReflectAdapter.has(t,r);let i=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===i);return void 0!==o&&n.ReflectAdapter.has(t,o)},deleteProperty(t,r){if("symbol"==typeof r)return n.ReflectAdapter.deleteProperty(t,r);let i=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===i);return void 0===o||n.ReflectAdapter.deleteProperty(t,o)}})}static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"append":case"delete":case"set":return i.callable;default:return n.ReflectAdapter.get(e,t,r)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new o(e)}append(e,t){let r=this.headers[e];"string"==typeof r?this.headers[e]=[r,t]:Array.isArray(r)?r.push(t):this.headers[e]=t}delete(e){delete this.headers[e]}get(e){let t=this.headers[e];return void 0!==t?this.merge(t):null}has(e){return void 0!==this.headers[e]}set(e,t){this.headers[e]=t}forEach(e,t){for(let[r,n]of this.entries())e.call(t,n,r,this)}*entries(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase(),r=this.get(t);yield[t,r]}}*keys(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase();yield t}}*values(){for(let e of Object.keys(this.headers)){let t=this.get(e);yield t}}[Symbol.iterator](){return this.entries()}}},7246:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ReflectAdapter",{enumerable:!0,get:function(){return r}});class r{static get(e,t,r){let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n}static set(e,t,r,n){return Reflect.set(e,t,r,n)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}},9407:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{MutableRequestCookiesAdapter:function(){return d},ReadonlyRequestCookiesError:function(){return s},RequestCookiesAdapter:function(){return a},appendMutableCookies:function(){return c},getModifiedCookieValues:function(){return l}});let n=r(255),i=r(7246),o=r(8119);class s extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#cookiessetname-value-options")}static callable(){throw new s}}class a{static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"clear":case"delete":case"set":return s.callable;default:return i.ReflectAdapter.get(e,t,r)}}})}}let u=Symbol.for("next.mutated.cookies");function l(e){let t=e[u];return t&&Array.isArray(t)&&0!==t.length?t:[]}function c(e,t){let r=l(t);if(0===r.length)return!1;let i=new n.ResponseCookies(e),o=i.getAll();for(let e of r)i.set(e);for(let e of o)i.set(e);return!0}class d{static wrap(e,t){let r=new n.ResponseCookies(new Headers);for(let t of e.getAll())r.set(t);let s=[],a=new Set,l=()=>{let e=o.staticGenerationAsyncStorage.getStore();if(e&&(e.pathWasRevalidated=!0),s=r.getAll().filter(e=>a.has(e.name)),t){let e=[];for(let t of s){let r=new n.ResponseCookies(new Headers);r.set(t),e.push(r.toString())}t(e)}};return new Proxy(r,{get(e,t,r){switch(t){case u:return s;case"delete":return function(...t){a.add("string"==typeof t[0]?t[0]:t[0].name);try{e.delete(...t)}finally{l()}};case"set":return function(...t){a.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.set(...t)}finally{l()}};default:return i.ReflectAdapter.get(e,t,r)}}})}}},255:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{RequestCookies:function(){return n.RequestCookies},ResponseCookies:function(){return n.ResponseCookies},stringifyCookie:function(){return n.stringifyCookie}});let n=r(9079)},5152:function(e,t,r){e.exports=r(2602)},4970:function(e,t,r){e.exports=r(6849)},9332:function(e,t,r){e.exports=r(8199)},1163:function(e,t,r){e.exports=r(3079)},4298:function(e,t,r){e.exports=r(3381)},83:function(e,t,r){"use strict";var n=r(7294),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useState,s=n.useEffect,a=n.useLayoutEffect,u=n.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=o({inst:{value:r,getSnapshot:t}}),i=n[0].inst,c=n[1];return a(function(){i.value=r,i.getSnapshot=t,l(i)&&c({inst:i})},[e,r,t]),s(function(){return l(i)&&c({inst:i}),e(function(){l(i)&&c({inst:i})})},[e]),u(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:c},1688:function(e,t,r){"use strict";e.exports=r(83)},4903:function(e,t,r){"use strict";r.d(t,{B$:function(){return x},CH:function(){return q},Cv:function(){return F},E7:function(){return _},Gl:function(){return E},Gv:function(){return C},HZ:function(){return U},JM:function(){return l},KQ:function(){return p},Kr:function(){return O},Lu:function(){return M},Mp:function(){return v},RE:function(){return S},RM:function(){return u},Rl:function(){return w},Vo:function(){return c},X:function(){return R},aF:function(){return s.aF},cL:function(){return s.cL},ej:function(){return b},ge:function(){return g},iz:function(){return f},kP:function(){return s.kP},oG:function(){return k},qH:function(){return j},qq:function(){return y},r0:function(){return D},tF:function(){return m},tL:function(){return P},tj:function(){return z}});var n=r(7703),i=r(484),o=r(7294),s=r(864);r(2905);var a=r(9476),u=(0,n.t5)({packageName:"@clerk/clerk-react"});function l(e){u.setMessages(e).setPackageName(e)}var[c,d]=(0,s.uH)("AuthContext"),f=s.b5,h=s.rI,p="You've added multiple <ClerkProvider> components in your React component tree. Wrap your components in a single <ClerkProvider>.",m=e=>`You've passed multiple children components to <${e}/>. You can only pass a single child component or text.`,y="Unsupported usage of isSatellite, domain or proxyUrl. The usage of isSatellite, domain or proxyUrl as function is not supported in non-browser environments.",g="<UserProfile.Page /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.",v="<UserProfile.Link /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.",b="<OrganizationProfile.Page /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.",w="<OrganizationProfile.Link /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.",_=e=>`<${e} /> can only accept <${e}.Page /> and <${e}.Link /> as its children. Any other provided component will be ignored.`,k=e=>`Missing props. <${e}.Page /> component requires the following props: url, label, labelIcon, alongside with children to be rendered inside the page.`,E=e=>`Missing props. <${e}.Link /> component requires the following props: url, label and labelIcon.`,C=e=>`The <${e}/> component uses path-based routing by default unless a different routing strategy is provided using the \`routing\` prop. When path-based routing is used, you need to provide the path where the component is mounted on by using the \`path\` prop. Example: <${e} path={'/my-path'} />`,S=e=>`The \`path\` prop will only be respected when the Clerk component uses path-based routing. To resolve this error, pass \`routing='path'\` to the <${e}/> component, or drop the \`path\` prop to switch to hash-based routing. For more details please refer to our docs: https://clerk.com/docs`,O="<UserButton /> can only accept <UserButton.UserProfilePage />, <UserButton.UserProfileLink /> and <UserButton.MenuItems /> as its children. Any other provided component will be ignored.",P="<UserButton.MenuItems /> component can only accept <UserButton.Action /> and <UserButton.Link /> as its children. Any other provided component will be ignored.",R="<UserButton.MenuItems /> component needs to be a direct child of `<UserButton />`.",x="<UserButton.Action /> component needs to be a direct child of `<UserButton.MenuItems />`.",j="<UserButton.Link /> component needs to be a direct child of `<UserButton.MenuItems />`.",U="Missing props. <UserButton.Link /> component requires the following props: href, label and labelIcon.",M="Missing props. <UserButton.Action /> component requires the following props: label.",T=e=>{(0,s.Rm)(()=>{u.throwMissingClerkProviderError({source:e})})},A=e=>new Promise(t=>{e.loaded&&t(),e.addOnLoaded(t)}),I=e=>async t=>(await A(e),e.session)?e.session.getToken(t):null,L=e=>async(...t)=>(await A(e),e.signOut(...t)),N=(e={})=>{T("useAuth");let t=d();void 0===t.sessionId&&void 0===t.userId&&(t=null!=e?e:{});let{sessionId:r,userId:n,actor:s,orgId:a,orgRole:l,orgSlug:c,orgPermissions:f,factorVerificationAge:p}=t,m=h();return function(e){let{sessionId:t,userId:r,actor:n,orgId:s,orgSlug:a,orgRole:l,has:c,signOut:d,getToken:f,orgPermissions:h,factorVerificationAge:p}=null!=e?e:{},m=(0,o.useCallback)(e=>c?c(e):(0,i.Q)({userId:r,orgId:s,orgRole:l,orgPermissions:h,factorVerificationAge:p})(e),[r,p,s,l,h]);return void 0===t&&void 0===r?{isLoaded:!1,isSignedIn:void 0,sessionId:t,userId:r,actor:void 0,orgId:void 0,orgRole:void 0,orgSlug:void 0,has:void 0,signOut:d,getToken:f}:null===t&&null===r?{isLoaded:!0,isSignedIn:!1,sessionId:t,userId:r,actor:null,orgId:null,orgRole:null,orgSlug:null,has:()=>!1,signOut:d,getToken:f}:t&&r&&s&&l?{isLoaded:!0,isSignedIn:!0,sessionId:t,userId:r,actor:n||null,orgId:s,orgRole:l,orgSlug:a||null,has:m,signOut:d,getToken:f}:t&&r&&!s?{isLoaded:!0,isSignedIn:!0,sessionId:t,userId:r,actor:n||null,orgId:null,orgRole:null,orgSlug:null,has:m,signOut:d,getToken:f}:u.throw("Invalid state. Feel free to submit a bug or reach out to support here: https://clerk.com/support")}({sessionId:r,userId:n,actor:s,orgId:a,orgSlug:c,orgRole:l,getToken:(0,o.useCallback)(I(m),[m]),signOut:(0,o.useCallback)(L(m),[m]),orgPermissions:f,factorVerificationAge:p})},D=(e,t)=>{let r=("string"==typeof t?t:null==t?void 0:t.component)||e.displayName||e.name||"Component";e.displayName=r;let n="string"==typeof t?void 0:t,i=t=>{T(r||"withClerk");let i=h();return i.loaded||(null==n?void 0:n.renderWhileLoading)?o.createElement(e,{...t,component:r,clerk:i}):null};return i.displayName=`withClerk(${r})`,i},q=({children:e})=>{T("SignedIn");let{userId:t}=d();return t?e:null},z=({children:e})=>{T("SignedOut");let{userId:t}=d();return null===t?e:null},F=({children:e,fallback:t,...r})=>{T("Protect");let{isLoaded:n,has:i,userId:o}=N();if(!n)return null;let s=null!=t?t:null;return o?"function"==typeof r.condition?r.condition(i)?e:s:r.role||r.permission?i(r)?e:s:e:s};D(({clerk:e,...t})=>{let{client:r,session:n}=e,i=r.activeSessions&&r.activeSessions.length>0;return o.useEffect(()=>{null===n&&i?e.redirectToAfterSignOut():e.redirectToSignIn(t)},[]),null},"RedirectToSignIn"),D(({clerk:e,...t})=>(o.useEffect(()=>{e.redirectToSignUp(t)},[]),null),"RedirectToSignUp"),D(({clerk:e})=>(o.useEffect(()=>{(0,a.x9)("RedirectToUserProfile","Use the `redirectToUserProfile()` method instead."),e.redirectToUserProfile()},[]),null),"RedirectToUserProfile"),D(({clerk:e})=>(o.useEffect(()=>{(0,a.x9)("RedirectToOrganizationProfile","Use the `redirectToOrganizationProfile()` method instead."),e.redirectToOrganizationProfile()},[]),null),"RedirectToOrganizationProfile"),D(({clerk:e})=>(o.useEffect(()=>{(0,a.x9)("RedirectToCreateOrganization","Use the `redirectToCreateOrganization()` method instead."),e.redirectToCreateOrganization()},[]),null),"RedirectToCreateOrganization"),D(({clerk:e,...t})=>(o.useEffect(()=>{e.handleRedirectCallback(t)},[]),null),"AuthenticateWithRedirectCallback")},2266:function(e,t,r){"use strict";r.d(t,{El:function(){return ep},A:function(){return eu},Cv:function(){return c.Cv},cL:function(){return Y},Mo:function(){return X},CH:function(){return c.CH},tj:function(){return c.tj},Iw:function(){return et},ll:function(){return c.cL},kP:function(){return c.kP},aF:function(){return c.aF}});var n,i,o,s,a,u,l,c=r(4903),d=e=>{throw TypeError(e)},f=(e,t,r)=>t.has(e)||d("Cannot "+r),h=(e,t,r)=>(f(e,t,"read from private field"),r?r.call(e):t.get(e)),p=(e,t,r)=>t.has(e)?d("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),m=(e,t,r,n)=>(f(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),y=(e,t,r)=>(f(e,t,"access private method"),r),g=r(4965),v=r(6922),b=r(7294),w=r(3935),_=(e,...t)=>{let r={...e};for(let e of t)delete r[e];return r};r(674);var k=r(864),E=r(4540),C=(e,t,r)=>!e&&r?S(r):O(t),S=e=>{let t=e.userId,r=e.user,n=e.sessionId,i=e.session,o=e.organization,s=e.orgId,a=e.orgRole,u=e.orgPermissions;return{userId:t,user:r,sessionId:n,session:i,organization:o,orgId:s,orgRole:a,orgPermissions:u,orgSlug:e.orgSlug,actor:e.actor,factorVerificationAge:e.factorVerificationAge}},O=e=>{let t=e.user?e.user.id:e.user,r=e.user,n=e.session?e.session.id:e.session,i=e.session,o=e.session?e.session.factorVerificationAge:null,s=i?.actor,a=e.organization,u=e.organization?e.organization.id:e.organization,l=a?.slug,c=a?r?.organizationMemberships?.find(e=>e.organization.id===u):a,d=c?c.permissions:c;return{userId:t,user:r,sessionId:n,session:i,organization:a,orgId:u,orgRole:c?c.role:c,orgSlug:l,orgPermissions:d,actor:s,factorVerificationAge:o}},P=r(7334);"undefined"==typeof window||window.global||(window.global="undefined"==typeof global?window:global);var R=e=>t=>{try{return b.Children.only(e)}catch{return c.RM.throw((0,c.tF)(t))}},x=(e,t)=>(e||(e=t),"string"==typeof e&&(e=b.createElement("button",null,e)),e),j=e=>(...t)=>{if(e&&"function"==typeof e)return e(...t)},U=new Map,M=e=>{let t=Array(e.length).fill(null),[r,n]=(0,b.useState)(t);return e.map((e,t)=>({id:e.id,mount:e=>n(r=>r.map((r,n)=>n===t?e:r)),unmount:()=>n(e=>e.map((e,r)=>r===t?null:e)),portal:()=>b.createElement(b.Fragment,null,r[t]?(0,w.createPortal)(e.component,r[t]):null)}))},T=(e,t)=>!!e&&b.isValidElement(e)&&(null==e?void 0:e.type)===t,A=(e,t)=>N({children:e,reorderItemsLabels:["account","security"],LinkComponent:ee,PageComponent:Z,MenuItemsComponent:en,componentName:"UserProfile"},t),I=(e,t)=>N({children:e,reorderItemsLabels:["general","members"],LinkComponent:ea,PageComponent:es,componentName:"OrganizationProfile"},t),L=e=>{let t=[],r=[ea,es,en,Z,ee];return b.Children.forEach(e,e=>{r.some(t=>T(e,t))||t.push(e)}),t},N=(e,t)=>{let{children:r,LinkComponent:n,PageComponent:i,MenuItemsComponent:o,reorderItemsLabels:s,componentName:a}=e,{allowForAnyChildren:u=!1}=t||{},l=[];b.Children.forEach(r,e=>{if(!T(e,i)&&!T(e,n)&&!T(e,o)){e&&!u&&(0,v.yJ)((0,c.E7)(a));return}let{props:t}=e,{children:r,label:d,url:f,labelIcon:h}=t;if(T(e,i)){if(D(t,s))l.push({label:d});else if(q(t))l.push({label:d,labelIcon:h,children:r,url:f});else{(0,v.yJ)((0,c.oG)(a));return}}if(T(e,n)){if(z(t))l.push({label:d,labelIcon:h,url:f});else{(0,v.yJ)((0,c.Gl)(a));return}}});let d=[],f=[],h=[];l.forEach((e,t)=>{if(q(e)){d.push({component:e.children,id:t}),f.push({component:e.labelIcon,id:t});return}z(e)&&h.push({component:e.labelIcon,id:t})});let p=M(d),m=M(f),y=M(h),g=[],w=[];return l.forEach((e,t)=>{if(D(e,s)){g.push({label:e.label});return}if(q(e)){let{portal:r,mount:n,unmount:i}=p.find(e=>e.id===t),{portal:o,mount:s,unmount:a}=m.find(e=>e.id===t);g.push({label:e.label,url:e.url,mount:n,unmount:i,mountIcon:s,unmountIcon:a}),w.push(r),w.push(o);return}if(z(e)){let{portal:r,mount:n,unmount:i}=y.find(e=>e.id===t);g.push({label:e.label,url:e.url,mountIcon:n,unmountIcon:i}),w.push(r);return}}),{customPages:g,customPagesPortals:w}},D=(e,t)=>{let{children:r,label:n,url:i,labelIcon:o}=e;return!r&&!i&&!o&&t.some(e=>e===n)},q=e=>{let{children:t,label:r,url:n,labelIcon:i}=e;return!!t&&!!n&&!!i&&!!r},z=e=>{let{children:t,label:r,url:n,labelIcon:i}=e;return!t&&!!n&&!!i&&!!r},F=e=>Q({children:e,reorderItemsLabels:["manageAccount","signOut"],MenuItemsComponent:en,MenuActionComponent:ei,MenuLinkComponent:eo,UserProfileLinkComponent:ee,UserProfilePageComponent:Z}),Q=({children:e,MenuItemsComponent:t,MenuActionComponent:r,MenuLinkComponent:n,UserProfileLinkComponent:i,UserProfilePageComponent:o,reorderItemsLabels:s})=>{let a=[],u=[],l=[];b.Children.forEach(e,e=>{if(!T(e,t)&&!T(e,i)&&!T(e,o)){e&&(0,v.yJ)(c.Kr);return}if(T(e,i)||T(e,o))return;let{props:u}=e;b.Children.forEach(u.children,e=>{if(!T(e,r)&&!T(e,n)){e&&(0,v.yJ)(c.tL);return}let{props:t}=e,{label:i,labelIcon:o,href:u,onClick:l,open:d}=t;if(T(e,r)){if(K(t,s))a.push({label:i});else if(B(t)){let e={label:i,labelIcon:o};if(void 0!==l)a.push({...e,onClick:l});else if(void 0!==d)a.push({...e,open:d.startsWith("/")?d:`/${d}`});else{(0,v.yJ)("Custom menu item must have either onClick or open property");return}}else{(0,v.yJ)(c.Lu);return}}if(T(e,n)){if(W(t))a.push({label:i,labelIcon:o,href:u});else{(0,v.yJ)(c.HZ);return}}})});let d=[],f=[];a.forEach((e,t)=>{B(e)&&d.push({component:e.labelIcon,id:t}),W(e)&&f.push({component:e.labelIcon,id:t})});let h=M(d),p=M(f);return a.forEach((e,t)=>{if(K(e,s)&&u.push({label:e.label}),B(e)){let{portal:r,mount:n,unmount:i}=h.find(e=>e.id===t),o={label:e.label,mountIcon:n,unmountIcon:i};"onClick"in e?o.onClick=e.onClick:"open"in e&&(o.open=e.open),u.push(o),l.push(r)}if(W(e)){let{portal:r,mount:n,unmount:i}=p.find(e=>e.id===t);u.push({label:e.label,href:e.href,mountIcon:n,unmountIcon:i}),l.push(r)}}),{customMenuItems:u,customMenuItemsPortals:l}},K=(e,t)=>{let{children:r,label:n,onClick:i,labelIcon:o}=e;return!r&&!i&&!o&&t.some(e=>e===n)},B=e=>{let{label:t,labelIcon:r,onClick:n,open:i}=e;return!!r&&!!t&&("function"==typeof n||"string"==typeof i)},W=e=>{let{label:t,href:r,labelIcon:n}=e;return!!r&&!!n&&!!t};function V(e){let t=(0,b.useRef)(),[r,n]=(0,b.useState)("rendering");return(0,b.useEffect)(()=>{if(!e)throw Error("Clerk: no component name provided, unable to detect mount.");"undefined"==typeof window||t.current||(t.current=(function(e){let{root:t=null==document?void 0:document.body,selector:r,timeout:n=0}=e;return new Promise((e,i)=>{if(!t){i(Error("No root element provided"));return}let o=t;if(r&&(o=null==t?void 0:t.querySelector(r)),(null==o?void 0:o.childElementCount)&&o.childElementCount>0){e();return}let s=new MutationObserver(n=>{for(let i of n)if("childList"===i.type&&(!o&&r&&(o=null==t?void 0:t.querySelector(r)),(null==o?void 0:o.childElementCount)&&o.childElementCount>0)){s.disconnect(),e();return}});s.observe(t,{childList:!0,subtree:!0}),n>0&&setTimeout(()=>{s.disconnect(),i(Error("Timeout waiting for element children"))},n)})})({selector:`[data-clerk-component="${e}"]`}).then(()=>{n("rendered")}).catch(()=>{n("error")}))},[e]),r}var $=e=>"mount"in e,G=e=>"open"in e,H=class extends b.PureComponent{constructor(){super(...arguments),this.rootRef=b.createRef()}componentDidUpdate(e){var t,r,n,i;if(!$(e)||!$(this.props))return;let o=_(e.props,"customPages","children"),s=_(this.props.props,"customPages","children"),a=(null==(t=o.customPages)?void 0:t.length)!==(null==(r=s.customPages)?void 0:r.length),u=(null==(n=o.customMenuItems)?void 0:n.length)!==(null==(i=s.customMenuItems)?void 0:i.length);(!(0,k.c1)(o,s)||a||u)&&this.rootRef.current&&this.props.updateProps({node:this.rootRef.current,props:this.props.props})}componentDidMount(){this.rootRef.current&&($(this.props)&&this.props.mount(this.rootRef.current,this.props.props),G(this.props)&&this.props.open(this.props.props))}componentWillUnmount(){this.rootRef.current&&($(this.props)&&this.props.unmount(this.rootRef.current),G(this.props)&&this.props.close())}render(){let{hideRootHtmlElement:e=!1}=this.props,t={ref:this.rootRef,...this.props.rootProps,...this.props.component&&{"data-clerk-component":this.props.component}};return b.createElement(b.Fragment,null,!e&&b.createElement("div",{...t}),this.props.children)}},J=e=>{var t,r;return b.createElement(b.Fragment,null,null==(t=null==e?void 0:e.customPagesPortals)?void 0:t.map((e,t)=>(0,b.createElement)(e,{key:t})),null==(r=null==e?void 0:e.customMenuItemsPortals)?void 0:r.map((e,t)=>(0,b.createElement)(e,{key:t})))},Y=(0,c.r0)(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===V(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return b.createElement(b.Fragment,null,i&&r,e.loaded&&b.createElement(H,{component:t,mount:e.mountSignIn,unmount:e.unmountSignIn,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"SignIn",renderWhileLoading:!0}),X=(0,c.r0)(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===V(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return b.createElement(b.Fragment,null,i&&r,e.loaded&&b.createElement(H,{component:t,mount:e.mountSignUp,unmount:e.unmountSignUp,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"SignUp",renderWhileLoading:!0});function Z({children:e}){return(0,v.yJ)(c.ge),b.createElement(b.Fragment,null,e)}function ee({children:e}){return(0,v.yJ)(c.Mp),b.createElement(b.Fragment,null,e)}var et=Object.assign((0,c.r0)(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===V(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}},{customPages:s,customPagesPortals:a}=A(n.children);return b.createElement(b.Fragment,null,i&&r,b.createElement(H,{component:t,mount:e.mountUserProfile,unmount:e.unmountUserProfile,updateProps:e.__unstable__updateProps,props:{...n,customPages:s},rootProps:o},b.createElement(J,{customPagesPortals:a})))},{component:"UserProfile",renderWhileLoading:!0}),{Page:Z,Link:ee}),er=(0,b.createContext)({mount:()=>{},unmount:()=>{},updateProps:()=>{}});function en({children:e}){return(0,v.yJ)(c.X),b.createElement(b.Fragment,null,e)}function ei({children:e}){return(0,v.yJ)(c.B$),b.createElement(b.Fragment,null,e)}function eo({children:e}){return(0,v.yJ)(c.qH),b.createElement(b.Fragment,null,e)}function es({children:e}){return(0,v.yJ)(c.ej),b.createElement(b.Fragment,null,e)}function ea({children:e}){return(0,v.yJ)(c.Rl),b.createElement(b.Fragment,null,e)}Object.assign((0,c.r0)(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===V(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}},{customPages:s,customPagesPortals:a}=A(n.children,{allowForAnyChildren:!!n.__experimental_asProvider}),u=Object.assign(n.userProfileProps||{},{customPages:s}),{customMenuItems:l,customMenuItemsPortals:c}=F(n.children),d=L(n.children),f={mount:e.mountUserButton,unmount:e.unmountUserButton,updateProps:e.__unstable__updateProps,props:{...n,userProfileProps:u,customMenuItems:l}};return b.createElement(er.Provider,{value:f},i&&r,e.loaded&&b.createElement(H,{component:t,...f,hideRootHtmlElement:!!n.__experimental_asProvider,rootProps:o},n.__experimental_asProvider?d:null,b.createElement(J,{customPagesPortals:a,customMenuItemsPortals:c})))},{component:"UserButton",renderWhileLoading:!0}),{UserProfilePage:Z,UserProfileLink:ee,MenuItems:en,Action:ei,Link:eo,__experimental_Outlet:function(e){let t=(0,b.useContext)(er),r={...t,props:{...t.props,...e}};return b.createElement(H,{...r})}});var eu=Object.assign((0,c.r0)(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===V(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}},{customPages:s,customPagesPortals:a}=I(n.children);return b.createElement(b.Fragment,null,i&&r,e.loaded&&b.createElement(H,{component:t,mount:e.mountOrganizationProfile,unmount:e.unmountOrganizationProfile,updateProps:e.__unstable__updateProps,props:{...n,customPages:s},rootProps:o},b.createElement(J,{customPagesPortals:a})))},{component:"OrganizationProfile",renderWhileLoading:!0}),{Page:es,Link:ea});(0,c.r0)(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===V(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return b.createElement(b.Fragment,null,i&&r,e.loaded&&b.createElement(H,{component:t,mount:e.mountCreateOrganization,unmount:e.unmountCreateOrganization,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"CreateOrganization",renderWhileLoading:!0});var el=(0,b.createContext)({mount:()=>{},unmount:()=>{},updateProps:()=>{}});Object.assign((0,c.r0)(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===V(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}},{customPages:s,customPagesPortals:a}=I(n.children,{allowForAnyChildren:!!n.__experimental_asProvider}),u=Object.assign(n.organizationProfileProps||{},{customPages:s}),l=L(n.children),c={mount:e.mountOrganizationSwitcher,unmount:e.unmountOrganizationSwitcher,updateProps:e.__unstable__updateProps,props:{...n,organizationProfileProps:u},rootProps:o,component:t};return e.__experimental_prefetchOrganizationSwitcher(),b.createElement(el.Provider,{value:c},b.createElement(b.Fragment,null,i&&r,e.loaded&&b.createElement(H,{...c,hideRootHtmlElement:!!n.__experimental_asProvider},n.__experimental_asProvider?l:null,b.createElement(J,{customPagesPortals:a}))))},{component:"OrganizationSwitcher",renderWhileLoading:!0}),{OrganizationProfilePage:es,OrganizationProfileLink:ea,__experimental_Outlet:function(e){let t=(0,b.useContext)(el),r={...t,props:{...t.props,...e}};return b.createElement(H,{...r})}}),(0,c.r0)(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===V(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return b.createElement(b.Fragment,null,i&&r,e.loaded&&b.createElement(H,{component:t,mount:e.mountOrganizationList,unmount:e.unmountOrganizationList,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"OrganizationList",renderWhileLoading:!0}),(0,c.r0)(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===V(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return b.createElement(b.Fragment,null,i&&r,e.loaded&&b.createElement(H,{component:t,open:e.openGoogleOneTap,close:e.closeGoogleOneTap,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"GoogleOneTap",renderWhileLoading:!0}),(0,c.r0)(({clerk:e,component:t,fallback:r,...n})=>{let i="rendering"===V(t)||!e.loaded,o={...i&&r&&{style:{display:"none"}}};return b.createElement(b.Fragment,null,i&&r,e.loaded&&b.createElement(H,{component:t,mount:e.mountWaitlist,unmount:e.unmountWaitlist,updateProps:e.__unstable__updateProps,props:n,rootProps:o}))},{component:"Waitlist",renderWhileLoading:!0}),(0,c.r0)(({clerk:e,children:t,...r})=>{let{signUpFallbackRedirectUrl:n,forceRedirectUrl:i,fallbackRedirectUrl:o,signUpForceRedirectUrl:s,mode:a,initialValues:u,withSignUp:l,...c}=r,d=R(t=x(t,"Sign in"))("SignInButton"),f=()=>{let t={forceRedirectUrl:i,fallbackRedirectUrl:o,signUpFallbackRedirectUrl:n,signUpForceRedirectUrl:s,initialValues:u,withSignUp:l};return"modal"===a?e.openSignIn({...t,appearance:r.appearance}):e.redirectToSignIn({...t,signInFallbackRedirectUrl:o,signInForceRedirectUrl:i})},h=async e=>(d&&"object"==typeof d&&"props"in d&&await j(d.props.onClick)(e),f()),p={...c,onClick:h};return b.cloneElement(d,p)},{component:"SignInButton",renderWhileLoading:!0}),(0,c.r0)(({clerk:e,children:t,...r})=>{let{fallbackRedirectUrl:n,forceRedirectUrl:i,signInFallbackRedirectUrl:o,signInForceRedirectUrl:s,mode:a,unsafeMetadata:u,initialValues:l,...c}=r,d=R(t=x(t,"Sign up"))("SignUpButton"),f=()=>{let t={fallbackRedirectUrl:n,forceRedirectUrl:i,signInFallbackRedirectUrl:o,signInForceRedirectUrl:s,unsafeMetadata:u,initialValues:l};return"modal"===a?e.openSignUp({...t,appearance:r.appearance}):e.redirectToSignUp({...t,signUpFallbackRedirectUrl:n,signUpForceRedirectUrl:i})},h=async e=>(d&&"object"==typeof d&&"props"in d&&await j(d.props.onClick)(e),f()),p={...c,onClick:h};return b.cloneElement(d,p)},{component:"SignUpButton",renderWhileLoading:!0}),(0,c.r0)(({clerk:e,children:t,...r})=>{let{redirectUrl:n="/",signOutOptions:i,...o}=r,s=R(t=x(t,"Sign out"))("SignOutButton"),a=()=>e.signOut({redirectUrl:n,...i}),u=async e=>(await j(s.props.onClick)(e),a()),l={...o,onClick:u};return b.cloneElement(s,l)},{component:"SignOutButton",renderWhileLoading:!0}),(0,c.r0)(({clerk:e,children:t,...r})=>{let{redirectUrl:n,...i}=r,o=R(t=x(t,"Sign in with Metamask"))("SignInWithMetamaskButton"),s=async()=>{(async function(){await e.authenticateWithMetamask({redirectUrl:n||void 0})})()},a=async e=>(await j(o.props.onClick)(e),s()),u={...i,onClick:a};return b.cloneElement(o,u)},{component:"SignInWithMetamask",renderWhileLoading:!0}),void 0===globalThis.__BUILD_DISABLE_RHC__&&(globalThis.__BUILD_DISABLE_RHC__=!1);var ec={name:"@clerk/clerk-react",version:"5.22.13",environment:"production"},ed=class e{constructor(e){p(this,u),this.clerkjs=null,this.preopenOneTap=null,this.preopenUserVerification=null,this.preopenSignIn=null,this.preopenSignUp=null,this.preopenUserProfile=null,this.preopenOrganizationProfile=null,this.preopenCreateOrganization=null,this.preOpenWaitlist=null,this.premountSignInNodes=new Map,this.premountSignUpNodes=new Map,this.premountUserProfileNodes=new Map,this.premountUserButtonNodes=new Map,this.premountOrganizationProfileNodes=new Map,this.premountCreateOrganizationNodes=new Map,this.premountOrganizationSwitcherNodes=new Map,this.premountOrganizationListNodes=new Map,this.premountMethodCalls=new Map,this.premountWaitlistNodes=new Map,this.premountAddListenerCalls=new Map,this.loadedListeners=[],p(this,n,!1),p(this,i),p(this,o),p(this,s),this.buildSignInUrl=e=>{let t=()=>{var t;return(null==(t=this.clerkjs)?void 0:t.buildSignInUrl(e))||""};if(this.clerkjs&&h(this,n))return t();this.premountMethodCalls.set("buildSignInUrl",t)},this.buildSignUpUrl=e=>{let t=()=>{var t;return(null==(t=this.clerkjs)?void 0:t.buildSignUpUrl(e))||""};if(this.clerkjs&&h(this,n))return t();this.premountMethodCalls.set("buildSignUpUrl",t)},this.buildAfterSignInUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildAfterSignInUrl())||""};if(this.clerkjs&&h(this,n))return e();this.premountMethodCalls.set("buildAfterSignInUrl",e)},this.buildAfterSignUpUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildAfterSignUpUrl())||""};if(this.clerkjs&&h(this,n))return e();this.premountMethodCalls.set("buildAfterSignUpUrl",e)},this.buildAfterSignOutUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildAfterSignOutUrl())||""};if(this.clerkjs&&h(this,n))return e();this.premountMethodCalls.set("buildAfterSignOutUrl",e)},this.buildAfterMultiSessionSingleSignOutUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildAfterMultiSessionSingleSignOutUrl())||""};if(this.clerkjs&&h(this,n))return e();this.premountMethodCalls.set("buildAfterMultiSessionSingleSignOutUrl",e)},this.buildUserProfileUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildUserProfileUrl())||""};if(this.clerkjs&&h(this,n))return e();this.premountMethodCalls.set("buildUserProfileUrl",e)},this.buildCreateOrganizationUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildCreateOrganizationUrl())||""};if(this.clerkjs&&h(this,n))return e();this.premountMethodCalls.set("buildCreateOrganizationUrl",e)},this.buildOrganizationProfileUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildOrganizationProfileUrl())||""};if(this.clerkjs&&h(this,n))return e();this.premountMethodCalls.set("buildOrganizationProfileUrl",e)},this.buildWaitlistUrl=()=>{let e=()=>{var e;return(null==(e=this.clerkjs)?void 0:e.buildWaitlistUrl())||""};if(this.clerkjs&&h(this,n))return e();this.premountMethodCalls.set("buildWaitlistUrl",e)},this.buildUrlWithAuth=e=>{let t=()=>{var t;return(null==(t=this.clerkjs)?void 0:t.buildUrlWithAuth(e))||""};if(this.clerkjs&&h(this,n))return t();this.premountMethodCalls.set("buildUrlWithAuth",t)},this.handleUnauthenticated=()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.handleUnauthenticated()};this.clerkjs&&h(this,n)?e():this.premountMethodCalls.set("handleUnauthenticated",e)},this.addOnLoaded=e=>{this.loadedListeners.push(e),this.loaded&&this.emitLoaded()},this.emitLoaded=()=>{this.loadedListeners.forEach(e=>e()),this.loadedListeners=[]},this.hydrateClerkJS=e=>{if(!e)throw Error("Failed to hydrate latest Clerk JS");return this.clerkjs=e,this.premountMethodCalls.forEach(e=>e()),this.premountAddListenerCalls.forEach((t,r)=>{t.nativeUnsubscribe=e.addListener(r)}),null!==this.preopenSignIn&&e.openSignIn(this.preopenSignIn),null!==this.preopenSignUp&&e.openSignUp(this.preopenSignUp),null!==this.preopenUserProfile&&e.openUserProfile(this.preopenUserProfile),null!==this.preopenUserVerification&&e.__internal_openReverification(this.preopenUserVerification),null!==this.preopenOneTap&&e.openGoogleOneTap(this.preopenOneTap),null!==this.preopenOrganizationProfile&&e.openOrganizationProfile(this.preopenOrganizationProfile),null!==this.preopenCreateOrganization&&e.openCreateOrganization(this.preopenCreateOrganization),null!==this.preOpenWaitlist&&e.openWaitlist(this.preOpenWaitlist),this.premountSignInNodes.forEach((t,r)=>{e.mountSignIn(r,t)}),this.premountSignUpNodes.forEach((t,r)=>{e.mountSignUp(r,t)}),this.premountUserProfileNodes.forEach((t,r)=>{e.mountUserProfile(r,t)}),this.premountUserButtonNodes.forEach((t,r)=>{e.mountUserButton(r,t)}),this.premountOrganizationListNodes.forEach((t,r)=>{e.mountOrganizationList(r,t)}),this.premountWaitlistNodes.forEach((t,r)=>{e.mountWaitlist(r,t)}),m(this,n,!0),this.emitLoaded(),this.clerkjs},this.__unstable__updateProps=async e=>{let t=await y(this,u,l).call(this);if(t&&"__unstable__updateProps"in t)return t.__unstable__updateProps(e)},this.setActive=({session:e,organization:t,beforeEmit:r,redirectUrl:n})=>this.clerkjs?this.clerkjs.setActive({session:e,organization:t,beforeEmit:r,redirectUrl:n}):Promise.reject(),this.openSignIn=e=>{this.clerkjs&&h(this,n)?this.clerkjs.openSignIn(e):this.preopenSignIn=e},this.closeSignIn=()=>{this.clerkjs&&h(this,n)?this.clerkjs.closeSignIn():this.preopenSignIn=null},this.__internal_openReverification=e=>{this.clerkjs&&h(this,n)?this.clerkjs.__internal_openReverification(e):this.preopenUserVerification=e},this.__internal_closeReverification=()=>{this.clerkjs&&h(this,n)?this.clerkjs.__internal_closeReverification():this.preopenUserVerification=null},this.openGoogleOneTap=e=>{this.clerkjs&&h(this,n)?this.clerkjs.openGoogleOneTap(e):this.preopenOneTap=e},this.closeGoogleOneTap=()=>{this.clerkjs&&h(this,n)?this.clerkjs.closeGoogleOneTap():this.preopenOneTap=null},this.openUserProfile=e=>{this.clerkjs&&h(this,n)?this.clerkjs.openUserProfile(e):this.preopenUserProfile=e},this.closeUserProfile=()=>{this.clerkjs&&h(this,n)?this.clerkjs.closeUserProfile():this.preopenUserProfile=null},this.openOrganizationProfile=e=>{this.clerkjs&&h(this,n)?this.clerkjs.openOrganizationProfile(e):this.preopenOrganizationProfile=e},this.closeOrganizationProfile=()=>{this.clerkjs&&h(this,n)?this.clerkjs.closeOrganizationProfile():this.preopenOrganizationProfile=null},this.openCreateOrganization=e=>{this.clerkjs&&h(this,n)?this.clerkjs.openCreateOrganization(e):this.preopenCreateOrganization=e},this.closeCreateOrganization=()=>{this.clerkjs&&h(this,n)?this.clerkjs.closeCreateOrganization():this.preopenCreateOrganization=null},this.openWaitlist=e=>{this.clerkjs&&h(this,n)?this.clerkjs.openWaitlist(e):this.preOpenWaitlist=e},this.closeWaitlist=()=>{this.clerkjs&&h(this,n)?this.clerkjs.closeWaitlist():this.preOpenWaitlist=null},this.openSignUp=e=>{this.clerkjs&&h(this,n)?this.clerkjs.openSignUp(e):this.preopenSignUp=e},this.closeSignUp=()=>{this.clerkjs&&h(this,n)?this.clerkjs.closeSignUp():this.preopenSignUp=null},this.mountSignIn=(e,t)=>{this.clerkjs&&h(this,n)?this.clerkjs.mountSignIn(e,t):this.premountSignInNodes.set(e,t)},this.unmountSignIn=e=>{this.clerkjs&&h(this,n)?this.clerkjs.unmountSignIn(e):this.premountSignInNodes.delete(e)},this.mountSignUp=(e,t)=>{this.clerkjs&&h(this,n)?this.clerkjs.mountSignUp(e,t):this.premountSignUpNodes.set(e,t)},this.unmountSignUp=e=>{this.clerkjs&&h(this,n)?this.clerkjs.unmountSignUp(e):this.premountSignUpNodes.delete(e)},this.mountUserProfile=(e,t)=>{this.clerkjs&&h(this,n)?this.clerkjs.mountUserProfile(e,t):this.premountUserProfileNodes.set(e,t)},this.unmountUserProfile=e=>{this.clerkjs&&h(this,n)?this.clerkjs.unmountUserProfile(e):this.premountUserProfileNodes.delete(e)},this.mountOrganizationProfile=(e,t)=>{this.clerkjs&&h(this,n)?this.clerkjs.mountOrganizationProfile(e,t):this.premountOrganizationProfileNodes.set(e,t)},this.unmountOrganizationProfile=e=>{this.clerkjs&&h(this,n)?this.clerkjs.unmountOrganizationProfile(e):this.premountOrganizationProfileNodes.delete(e)},this.mountCreateOrganization=(e,t)=>{this.clerkjs&&h(this,n)?this.clerkjs.mountCreateOrganization(e,t):this.premountCreateOrganizationNodes.set(e,t)},this.unmountCreateOrganization=e=>{this.clerkjs&&h(this,n)?this.clerkjs.unmountCreateOrganization(e):this.premountCreateOrganizationNodes.delete(e)},this.mountOrganizationSwitcher=(e,t)=>{this.clerkjs&&h(this,n)?this.clerkjs.mountOrganizationSwitcher(e,t):this.premountOrganizationSwitcherNodes.set(e,t)},this.unmountOrganizationSwitcher=e=>{this.clerkjs&&h(this,n)?this.clerkjs.unmountOrganizationSwitcher(e):this.premountOrganizationSwitcherNodes.delete(e)},this.__experimental_prefetchOrganizationSwitcher=()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.__experimental_prefetchOrganizationSwitcher()};this.clerkjs&&h(this,n)?e():this.premountMethodCalls.set("__experimental_prefetchOrganizationSwitcher",e)},this.mountOrganizationList=(e,t)=>{this.clerkjs&&h(this,n)?this.clerkjs.mountOrganizationList(e,t):this.premountOrganizationListNodes.set(e,t)},this.unmountOrganizationList=e=>{this.clerkjs&&h(this,n)?this.clerkjs.unmountOrganizationList(e):this.premountOrganizationListNodes.delete(e)},this.mountUserButton=(e,t)=>{this.clerkjs&&h(this,n)?this.clerkjs.mountUserButton(e,t):this.premountUserButtonNodes.set(e,t)},this.unmountUserButton=e=>{this.clerkjs&&h(this,n)?this.clerkjs.unmountUserButton(e):this.premountUserButtonNodes.delete(e)},this.mountWaitlist=(e,t)=>{this.clerkjs&&h(this,n)?this.clerkjs.mountWaitlist(e,t):this.premountWaitlistNodes.set(e,t)},this.unmountWaitlist=e=>{this.clerkjs&&h(this,n)?this.clerkjs.unmountWaitlist(e):this.premountWaitlistNodes.delete(e)},this.addListener=e=>{if(this.clerkjs)return this.clerkjs.addListener(e);{let t=()=>{var t;let r=this.premountAddListenerCalls.get(e);r&&(null==(t=r.nativeUnsubscribe)||t.call(r),this.premountAddListenerCalls.delete(e))};return this.premountAddListenerCalls.set(e,{unsubscribe:t,nativeUnsubscribe:void 0}),t}},this.navigate=e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.navigate(e)};this.clerkjs&&h(this,n)?t():this.premountMethodCalls.set("navigate",t)},this.redirectWithAuth=async(...e)=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.redirectWithAuth(...e)};if(this.clerkjs&&h(this,n))return t();this.premountMethodCalls.set("redirectWithAuth",t)},this.redirectToSignIn=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.redirectToSignIn(e)};if(this.clerkjs&&h(this,n))return t();this.premountMethodCalls.set("redirectToSignIn",t)},this.redirectToSignUp=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.redirectToSignUp(e)};if(this.clerkjs&&h(this,n))return t();this.premountMethodCalls.set("redirectToSignUp",t)},this.redirectToUserProfile=async()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToUserProfile()};if(this.clerkjs&&h(this,n))return e();this.premountMethodCalls.set("redirectToUserProfile",e)},this.redirectToAfterSignUp=()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToAfterSignUp()};if(this.clerkjs&&h(this,n))return e();this.premountMethodCalls.set("redirectToAfterSignUp",e)},this.redirectToAfterSignIn=()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToAfterSignIn()};this.clerkjs&&h(this,n)?e():this.premountMethodCalls.set("redirectToAfterSignIn",e)},this.redirectToAfterSignOut=()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToAfterSignOut()};this.clerkjs&&h(this,n)?e():this.premountMethodCalls.set("redirectToAfterSignOut",e)},this.redirectToOrganizationProfile=async()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToOrganizationProfile()};if(this.clerkjs&&h(this,n))return e();this.premountMethodCalls.set("redirectToOrganizationProfile",e)},this.redirectToCreateOrganization=async()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToCreateOrganization()};if(this.clerkjs&&h(this,n))return e();this.premountMethodCalls.set("redirectToCreateOrganization",e)},this.redirectToWaitlist=async()=>{let e=()=>{var e;return null==(e=this.clerkjs)?void 0:e.redirectToWaitlist()};if(this.clerkjs&&h(this,n))return e();this.premountMethodCalls.set("redirectToWaitlist",e)},this.handleRedirectCallback=e=>{var t;let r=()=>{var t;return null==(t=this.clerkjs)?void 0:t.handleRedirectCallback(e)};this.clerkjs&&h(this,n)?null==(t=r())||t.catch(()=>{}):this.premountMethodCalls.set("handleRedirectCallback",r)},this.handleGoogleOneTapCallback=(e,t)=>{var r;let i=()=>{var r;return null==(r=this.clerkjs)?void 0:r.handleGoogleOneTapCallback(e,t)};this.clerkjs&&h(this,n)?null==(r=i())||r.catch(()=>{}):this.premountMethodCalls.set("handleGoogleOneTapCallback",i)},this.handleEmailLinkVerification=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.handleEmailLinkVerification(e)};if(this.clerkjs&&h(this,n))return t();this.premountMethodCalls.set("handleEmailLinkVerification",t)},this.authenticateWithMetamask=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.authenticateWithMetamask(e)};if(this.clerkjs&&h(this,n))return t();this.premountMethodCalls.set("authenticateWithMetamask",t)},this.authenticateWithCoinbaseWallet=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.authenticateWithCoinbaseWallet(e)};if(this.clerkjs&&h(this,n))return t();this.premountMethodCalls.set("authenticateWithCoinbaseWallet",t)},this.authenticateWithOKXWallet=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.authenticateWithOKXWallet(e)};if(this.clerkjs&&h(this,n))return t();this.premountMethodCalls.set("authenticateWithOKXWallet",t)},this.authenticateWithWeb3=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.authenticateWithWeb3(e)};if(this.clerkjs&&h(this,n))return t();this.premountMethodCalls.set("authenticateWithWeb3",t)},this.authenticateWithGoogleOneTap=async e=>(await y(this,u,l).call(this)).authenticateWithGoogleOneTap(e),this.createOrganization=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.createOrganization(e)};if(this.clerkjs&&h(this,n))return t();this.premountMethodCalls.set("createOrganization",t)},this.getOrganization=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.getOrganization(e)};if(this.clerkjs&&h(this,n))return t();this.premountMethodCalls.set("getOrganization",t)},this.joinWaitlist=async e=>{let t=()=>{var t;return null==(t=this.clerkjs)?void 0:t.joinWaitlist(e)};if(this.clerkjs&&h(this,n))return t();this.premountMethodCalls.set("joinWaitlist",t)},this.signOut=async(e,t)=>{let r=()=>{var r;return null==(r=this.clerkjs)?void 0:r.signOut(e,t)};if(this.clerkjs&&h(this,n))return r();this.premountMethodCalls.set("signOut",r)};let{Clerk:t=null,publishableKey:r}=e||{};m(this,s,r),m(this,o,null==e?void 0:e.proxyUrl),m(this,i,null==e?void 0:e.domain),this.options=e,this.Clerk=t,this.mode=(0,P._f)()?"browser":"server",this.options.sdkMetadata||(this.options.sdkMetadata=ec),h(this,s)&&this.loadClerkJS()}get publishableKey(){return h(this,s)}get loaded(){return h(this,n)}static getOrCreateInstance(t){return(0,P._f)()&&h(this,a)&&(!t.Clerk||h(this,a).Clerk===t.Clerk)&&h(this,a).publishableKey===t.publishableKey||m(this,a,new e(t)),h(this,a)}static clearInstance(){m(this,a,null)}get domain(){return"undefined"!=typeof window&&window.location?(0,v.YZ)(h(this,i),new URL(window.location.href),""):"function"==typeof h(this,i)?c.RM.throw(c.qq):h(this,i)||""}get proxyUrl(){return"undefined"!=typeof window&&window.location?(0,v.YZ)(h(this,o),new URL(window.location.href),""):"function"==typeof h(this,o)?c.RM.throw(c.qq):h(this,o)||""}__internal_getOption(e){var t;return null==(t=this.clerkjs)?void 0:t.__internal_getOption(e)}get sdkMetadata(){var e;return(null==(e=this.clerkjs)?void 0:e.sdkMetadata)||this.options.sdkMetadata||void 0}get instanceType(){var e;return null==(e=this.clerkjs)?void 0:e.instanceType}get frontendApi(){var e;return(null==(e=this.clerkjs)?void 0:e.frontendApi)||""}get isStandardBrowser(){var e;return(null==(e=this.clerkjs)?void 0:e.isStandardBrowser)||this.options.standardBrowser||!1}get isSatellite(){return"undefined"!=typeof window&&window.location?(0,v.YZ)(this.options.isSatellite,new URL(window.location.href),!1):"function"==typeof this.options.isSatellite&&c.RM.throw(c.qq)}async loadClerkJS(){var e,t;if(!("browser"!==this.mode||h(this,n))){"undefined"!=typeof window&&(window.__clerk_publishable_key=h(this,s),window.__clerk_proxy_url=this.proxyUrl,window.__clerk_domain=this.domain);try{if(this.Clerk){let e;(t=this.Clerk,"function"==typeof t)?(e=new this.Clerk(h(this,s),{proxyUrl:this.proxyUrl,domain:this.domain}),await e.load(this.options)):(e=this.Clerk).loaded||await e.load(this.options),global.Clerk=e}else if(!__BUILD_DISABLE_RHC__){if(global.Clerk||await (0,g.YJ)({...this.options,publishableKey:h(this,s),proxyUrl:this.proxyUrl,domain:this.domain,nonce:this.options.nonce}),!global.Clerk)throw Error("Failed to download latest ClerkJS. Contact support@clerk.com.");await global.Clerk.load(this.options)}if(null==(e=global.Clerk)?void 0:e.loaded)return this.hydrateClerkJS(global.Clerk);return}catch(e){console.error(e.stack||e.message||e);return}}}get version(){var e;return null==(e=this.clerkjs)?void 0:e.version}get client(){return this.clerkjs?this.clerkjs.client:void 0}get session(){return this.clerkjs?this.clerkjs.session:void 0}get user(){return this.clerkjs?this.clerkjs.user:void 0}get organization(){return this.clerkjs?this.clerkjs.organization:void 0}get telemetry(){return this.clerkjs?this.clerkjs.telemetry:void 0}get __unstable__environment(){return this.clerkjs?this.clerkjs.__unstable__environment:void 0}__unstable__setEnvironment(...e){this.clerkjs&&"__unstable__setEnvironment"in this.clerkjs&&this.clerkjs.__unstable__setEnvironment(e)}};function ef(e){let{isomorphicClerkOptions:t,initialState:r,children:n}=e,{isomorphicClerk:i,loaded:o}=eh(t),[s,a]=b.useState({client:i.client,session:i.session,user:i.user,organization:i.organization});b.useEffect(()=>i.addListener(e=>a({...e})),[]);let u=C(o,s,r),l=b.useMemo(()=>({value:i}),[o]),d=b.useMemo(()=>({value:s.client}),[s.client]),{sessionId:f,session:h,userId:p,user:m,orgId:y,actor:g,organization:v,orgRole:w,orgSlug:_,orgPermissions:E,factorVerificationAge:S}=u,O=b.useMemo(()=>({value:{sessionId:f,userId:p,actor:g,orgId:y,orgRole:w,orgSlug:_,orgPermissions:E,factorVerificationAge:S}}),[f,p,g,y,w,_,S]),P=b.useMemo(()=>({value:h}),[f,h]),R=b.useMemo(()=>({value:m}),[p,m]),x=b.useMemo(()=>({value:{organization:v}}),[y,v]);return b.createElement(c.iz.Provider,{value:l},b.createElement(k.RY.Provider,{value:d},b.createElement(k.B3.Provider,{value:P},b.createElement(k.f0,{...x.value},b.createElement(c.Vo.Provider,{value:O},b.createElement(k.St.Provider,{value:R},n))))))}n=new WeakMap,i=new WeakMap,o=new WeakMap,s=new WeakMap,a=new WeakMap,u=new WeakSet,l=function(){return new Promise(e=>{this.addOnLoaded(()=>e(this.clerkjs))})},p(ed,a);var eh=e=>{let[t,r]=b.useState(!1),n=b.useMemo(()=>ed.getOrCreateInstance(e),[]);return b.useEffect(()=>{n.__unstable__updateProps({appearance:e.appearance})},[e.appearance]),b.useEffect(()=>{n.__unstable__updateProps({options:e})},[e.localization]),b.useEffect(()=>{n.addOnLoaded(()=>r(!0))},[]),b.useEffect(()=>()=>{ed.clearInstance(),r(!1)},[]),{isomorphicClerk:n,loaded:t}},ep=function(e,t,r){let n=e.displayName||e.name||t||"Component",i=n=>(!function(e,t,r=1){b.useEffect(()=>{let n=U.get(e)||0;return n==r?c.RM.throw(t):(U.set(e,n+1),()=>{U.set(e,(U.get(e)||1)-1)})},[])}(t,r),b.createElement(e,{...n}));return i.displayName=`withMaxAllowedInstancesGuard(${n})`,i}(function(e){let{initialState:t,children:r,__internal_bypassMissingPublishableKey:n,...i}=e,{publishableKey:o="",Clerk:s}=i;return s||n||(o?o&&!(0,E.x9)(o)&&c.RM.throwInvalidPublishableKeyError({key:o}):c.RM.throwMissingPublishableKeyError()),b.createElement(ef,{initialState:t,isomorphicClerkOptions:i},r)},"ClerkProvider",c.KQ);ep.displayName="ClerkProvider",(0,c.JM)({packageName:"@clerk/clerk-react"}),(0,g.Aw)("@clerk/clerk-react")},7183:function(e,t,r){"use strict";r.d(t,{Aw:function(){return i.Aw},EJ:function(){return o},JM:function(){return n.JM},iv:function(){return i.iv},wE:function(){return i.wE}});var n=r(4903),i=r(4965);function o(e,t,r){let i=t.path||(null==r?void 0:r.path);return"path"===(t.routing||(null==r?void 0:r.routing)||"path")?i?{...r,...t,routing:"path"}:n.RM.throw((0,n.Gv)(e)):t.path?n.RM.throw((0,n.RE)(e)):{...r,...t,path:void 0}}},484:function(e,t,r){"use strict";r.d(t,{Q:function(){return n.Q}});var n=r(6128);r(674)},7334:function(e,t,r){"use strict";function n(){return"undefined"!=typeof window}r.d(t,{_f:function(){return n}}),RegExp("bot|spider|crawl|APIs-Google|AdsBot|Googlebot|mediapartners|Google Favicon|FeedFetcher|Google-Read-Aloud|DuplexWeb-Google|googleweblight|bing|yandex|baidu|duckduck|yahoo|ecosia|ia_archiver|facebook|instagram|pinterest|reddit|slack|twitter|whatsapp|youtube|semrush","i"),r(674)},674:function(e,t,r){"use strict";r.d(t,{Ko:function(){return h},U9:function(){return m},ac:function(){return f},qx:function(){return p},r2:function(){return u},yA:function(){return c}});var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,a=e=>{throw TypeError(e)},u=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},l=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let u of o(t))s.call(e,u)||u===r||n(e,u,{get:()=>t[u],enumerable:!(a=i(t,u))||a.enumerable});return e},c=(e,t,r)=>(l(e,t,"default"),r&&l(r,t,"default")),d=(e,t,r)=>t.has(e)||a("Cannot "+r),f=(e,t,r)=>(d(e,t,"read from private field"),r?r.call(e):t.get(e)),h=(e,t,r)=>t.has(e)?a("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),p=(e,t,r,n)=>(d(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),m=(e,t,r)=>(d(e,t,"access private method"),r)},740:function(e,t,r){"use strict";r.d(t,{rx:function(){return o},uB:function(){return i},vf:function(){return n}});var n=()=>!1,i=()=>!1,o=()=>{try{return!0}catch{}return!1}},3457:function(e,t,r){"use strict";function n(e){return{code:e.code,message:e.message,longMessage:e.long_message,meta:{paramName:e?.meta?.param_name,sessionId:e?.meta?.session_id,emailAddresses:e?.meta?.email_addresses,identifiers:e?.meta?.identifiers,zxcvbn:e?.meta?.zxcvbn}}}r.d(t,{gO:function(){return i},nU:function(){return n},t5:function(){return s}});var i=class e extends Error{constructor(t,{data:r,status:i,clerkTraceId:o}){super(t),this.toString=()=>{let e=`[${this.name}]
Message:${this.message}
Status:${this.status}
Serialized errors: ${this.errors.map(e=>JSON.stringify(e))}`;return this.clerkTraceId&&(e+=`
Clerk Trace ID: ${this.clerkTraceId}`),e},Object.setPrototypeOf(this,e.prototype),this.status=i,this.message=t,this.clerkTraceId=o,this.clerkError=!0,this.errors=function(e=[]){return e.length>0?e.map(n):[]}(r)}},o=Object.freeze({InvalidProxyUrlErrorMessage:"The proxyUrl passed to Clerk is invalid. The expected value for proxyUrl is an absolute URL or a relative path with a leading '/'. (key={{url}})",InvalidPublishableKeyErrorMessage:"The publishableKey passed to Clerk is invalid. You can get your Publishable key at https://dashboard.clerk.com/last-active?path=api-keys. (key={{key}})",MissingPublishableKeyErrorMessage:"Missing publishableKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.",MissingSecretKeyErrorMessage:"Missing secretKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.",MissingClerkProvider:"{{source}} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider"});function s({packageName:e,customMessages:t}){let r=e,n={...o,...t};function i(e,t){if(!t)return`${r}: ${e}`;let n=e;for(let r of e.matchAll(/{{([a-zA-Z0-9-_]+)}}/g)){let e=(t[r[1]]||"").toString();n=n.replace(`{{${r[1]}}}`,e)}return`${r}: ${n}`}return{setPackageName({packageName:e}){return"string"==typeof e&&(r=e),this},setMessages({customMessages:e}){return Object.assign(n,e||{}),this},throwInvalidPublishableKeyError(e){throw Error(i(n.InvalidPublishableKeyErrorMessage,e))},throwInvalidProxyUrl(e){throw Error(i(n.InvalidProxyUrlErrorMessage,e))},throwMissingPublishableKeyError(){throw Error(i(n.MissingPublishableKeyErrorMessage))},throwMissingSecretKeyError(){throw Error(i(n.MissingSecretKeyErrorMessage))},throwMissingClerkProviderError(e){throw Error(i(n.MissingClerkProvider,e))},throw(e){throw Error(i(e))}}}},7362:function(e,t,r){"use strict";r.d(t,{MY:function(){return l},P:function(){return d},_d:function(){return f},CY:function(){return c},x9:function(){return u},nQ:function(){return a}});var n=r(2290),i=e=>"undefined"!=typeof btoa&&"function"==typeof btoa?btoa(e):"undefined"!=typeof global&&global.Buffer?new global.Buffer(e).toString("base64"):e,o=r(8749),s="pk_live_";function a(e,t={}){if(!(e=e||"")||!u(e)){if(t.fatal&&!e)throw Error("Publishable key is missing. Ensure that your publishable key is correctly configured. Double-check your environment configuration for your keys, or access them here: https://dashboard.clerk.com/last-active?path=api-keys");if(t.fatal&&!u(e))throw Error("Publishable key not valid.");return null}let r=e.startsWith(s)?"production":"development",i=(0,n.S)(e.split("_")[2]);return i=i.slice(0,-1),t.proxyUrl?i=t.proxyUrl:"development"!==r&&t.domain&&(i=`clerk.${t.domain}`),{instanceType:r,frontendApi:i}}function u(e=""){try{let t=e.startsWith(s)||e.startsWith("pk_test_"),r=(0,n.S)(e.split("_")[2]||"").endsWith("$");return t&&r}catch{return!1}}function l(){let e=new Map;return{isDevOrStagingUrl:t=>{if(!t)return!1;let r="string"==typeof t?t:t.hostname,n=e.get(r);return void 0===n&&(n=o.vO.some(e=>r.endsWith(e)),e.set(r,n)),n}}}function c(e){return e.startsWith("test_")||e.startsWith("sk_test_")}async function d(e,t=globalThis.crypto.subtle){let r=new TextEncoder().encode(e);return i(String.fromCharCode(...new Uint8Array(await t.digest("sha-1",r)))).replace(/\+/gi,"-").replace(/\//gi,"_").substring(0,8)}var f=(e,t)=>`${e}_${t}`},8749:function(e,t,r){"use strict";r.d(t,{Fo:function(){return a},Iq:function(){return u},Xv:function(){return l},cM:function(){return s},iF:function(){return o},mv:function(){return n},vO:function(){return i}});var n=[".lcl.dev",".lclstage.dev",".lclclerk.com"],i=[".lcl.dev",".stg.dev",".lclstage.dev",".stgstage.dev",".dev.lclclerk.com",".stg.lclclerk.com",".accounts.lclclerk.com","accountsstage.dev","accounts.dev"],o=[".lcl.dev","lclstage.dev",".lclclerk.com",".accounts.lclclerk.com"],s=[".accountsstage.dev"],a="https://api.lclclerk.com",u="https://api.clerkstage.dev",l="https://api.clerk.com"},6170:function(e,t,r){"use strict";r.d(t,{fQ:function(){return i}});var n=e=>{let t=r=>{if(!r)return r;if(Array.isArray(r))return r.map(e=>"object"==typeof e||Array.isArray(e)?t(e):e);let n={...r};for(let r of Object.keys(n)){let i=e(r.toString());i!==r&&(n[i]=n[r],delete n[r]),"object"==typeof n[i]&&(n[i]=t(n[i]))}return n};return t};function i(e){if("boolean"==typeof e)return e;if(null==e)return!1;if("string"==typeof e){if("true"===e.toLowerCase())return!0;if("false"===e.toLowerCase())return!1}let t=parseInt(e,10);return!isNaN(t)&&t>0}n(function(e){return e?e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`):""}),n(function(e){return e?e.replace(/([-_][a-z])/g,e=>e.toUpperCase().replace(/-|_/,"")):""})},2290:function(e,t,r){"use strict";r.d(t,{S:function(){return n}});var n=e=>"undefined"!=typeof atob&&"function"==typeof atob?atob(e):"undefined"!=typeof global&&global.Buffer?new global.Buffer(e,"base64").toString():e},6128:function(e,t,r){"use strict";r.d(t,{Q:function(){return f}});var n={strict_mfa:{afterMinutes:10,level:"multi_factor"},strict:{afterMinutes:10,level:"second_factor"},moderate:{afterMinutes:60,level:"second_factor"},lax:{afterMinutes:1440,level:"second_factor"}},i=new Set(["first_factor","second_factor","multi_factor"]),o=new Set(["strict_mfa","strict","moderate","lax"]),s=e=>"number"==typeof e&&e>0,a=e=>i.has(e),u=e=>o.has(e),l=(e,t)=>{let{orgId:r,orgRole:n,orgPermissions:i}=t;return(e.role||e.permission)&&r&&n&&i?e.permission?i.includes(e.permission):e.role?n===e.role:null:null},c=e=>{if(!e)return!1;let t="string"==typeof e&&u(e),r="object"==typeof e&&a(e.level)&&s(e.afterMinutes);return(!!t||!!r)&&(e=>"string"==typeof e?n[e]:e).bind(null,e)},d=(e,{factorVerificationAge:t})=>{if(!e.reverification||!t)return null;let r=c(e.reverification);if(!r)return null;let{level:n,afterMinutes:i}=r(),[o,s]=t,a=-1!==o?i>o:null,u=-1!==s?i>s:null;switch(n){case"first_factor":return a;case"second_factor":return -1!==s?u:a;case"multi_factor":return -1===s?a:a&&u}},f=e=>t=>{if(!e.userId)return!1;let r=l(t,e),n=d(t,e);return[r,n].some(e=>null===e)?[r,n].some(e=>!0===e):[r,n].every(e=>!0===e)}},5731:function(e,t,r){"use strict";r.d(t,{$V:function(){return u},yJ:function(){return i}});var n=r(740),i=e=>{(0,n.vf)()&&console.error(`Clerk: ${e}`)},o={firstDelay:125,maxDelay:0,timeMultiple:2,shouldRetry:()=>!0},s=async e=>new Promise(t=>setTimeout(t,e)),a=e=>{let t=0,r=()=>{let r=e.firstDelay*Math.pow(e.timeMultiple,t);return Math.min(e.maxDelay||r,r)};return async()=>{await s(r()),t++}},u=async(e,t={})=>{let r=0,{shouldRetry:n,firstDelay:i,maxDelay:s,timeMultiple:u}={...o,...t},l=a({firstDelay:i,maxDelay:s,timeMultiple:u});for(;;)try{return await e()}catch(e){if(!n(e,++r))throw e;await l()}}},9476:function(e,t,r){"use strict";r.d(t,{x9:function(){return o}});var n=r(740),i=new Set,o=(e,t,r)=>{let o=(0,n.uB)()||(0,n.rx)(),s=r??e;i.has(s)||o||(i.add(s),console.warn(`Clerk - DEPRECATION WARNING: "${e}" is deprecated and will be removed in the next major release.
${t}`))};r(674)},7703:function(e,t,r){"use strict";r.d(t,{gO:function(){return n.gO},nU:function(){return n.nU},t5:function(){return n.t5}});var n=r(3457);r(674)},4540:function(e,t,r){"use strict";r.d(t,{CY:function(){return n.CY},MY:function(){return n.MY},P:function(){return n.P},_d:function(){return n._d},nQ:function(){return n.nQ},x9:function(){return n.x9}});var n=r(7362);r(674)},4965:function(e,t,r){"use strict";r.d(t,{iv:function(){return g},wE:function(){return y},YJ:function(){return m},Aw:function(){return p}});var n=(e,t="5.52.3")=>{if(e)return e;let r=i(t);return r?"snapshot"===r?"5.52.3":r:o(t)},i=e=>e.trim().replace(/^v/,"").match(/-(.+?)(\.|$)/)?.[1],o=e=>e.trim().replace(/^v/,"").split(".")[0];function s(e){return e.startsWith("/")}var a=r(5731);async function u(e="",t){let{async:r,defer:n,beforeLoad:i,crossOrigin:o,nonce:s}=t||{};return(0,a.$V)(()=>new Promise((t,a)=>{e||a(Error("loadScript cannot be called without a src")),document&&document.body||a("loadScript cannot be called when document does not exist");let u=document.createElement("script");o&&u.setAttribute("crossorigin",o),u.async=r||!1,u.defer=n||!1,u.addEventListener("load",()=>{u.remove(),t(u)}),u.addEventListener("error",()=>{u.remove(),a()}),u.src=e,u.nonce=s,i?.(u),document.body.appendChild(u)}),{shouldRetry:(e,t)=>t<5})}var l=r(3457),c=r(7362),d="Clerk: Failed to load Clerk",{isDevOrStagingUrl:f}=(0,c.MY)(),h=(0,l.t5)({packageName:"@clerk/shared"});function p(e){h.setPackageName({packageName:e})}var m=async e=>{let t=document.querySelector("script[data-clerk-js-script]");if(t)return new Promise((e,r)=>{t.addEventListener("load",()=>{e(t)}),t.addEventListener("error",()=>{r(d)})});if(!e?.publishableKey){h.throwMissingPublishableKeyError();return}return u(y(e),{async:!0,crossOrigin:"anonymous",nonce:e.nonce,beforeLoad:v(e)}).catch(()=>{throw Error(d)})},y=e=>{let{clerkJSUrl:t,clerkJSVariant:r,clerkJSVersion:i,proxyUrl:o,domain:a,publishableKey:u}=e;if(t)return t;let l="";l=o&&(!o||/^http(s)?:\/\//.test(o||"")||s(o))?(o?s(o)?new URL(o,window.location.origin).toString():o:"").replace(/http(s)?:\/\//,""):a&&!f(c.nQ(u)?.frontendApi||"")?function(e){let t;if(!e)return"";if(e.match(/^(clerk\.)+\w*$/))t=/(clerk\.)*(?=clerk\.)/;else{if(e.match(/\.clerk.accounts/))return e;t=/^(clerk\.)*/gi}let r=e.replace(t,"");return`clerk.${r}`}(a):c.nQ(u)?.frontendApi||"";let d=r?`${r.replace(/\.+$/,"")}.`:"",h=n(i);return`https://${l}/npm/@clerk/clerk-js@${h}/dist/clerk.${d}browser.js`},g=e=>{let t={};return e.publishableKey&&(t["data-clerk-publishable-key"]=e.publishableKey),e.proxyUrl&&(t["data-clerk-proxy-url"]=e.proxyUrl),e.domain&&(t["data-clerk-domain"]=e.domain),e.nonce&&(t.nonce=e.nonce),t},v=e=>t=>{let r=g(e);for(let e in r)t.setAttribute(e,r[e])};r(674)},864:function(e,t,r){"use strict";let n,i;r.d(t,{b5:function(){return eq},RY:function(){return eK},f0:function(){return eH},B3:function(){return eW},St:function(){return eF},uH:function(){return eN},c1:function(){return e0},Rm:function(){return eJ},cL:function(){return eZ},rI:function(){return ez},kP:function(){return eY},aF:function(){return eX}});var o={};r.r(o),r.d(o,{SWRConfig:function(){return ev},default:function(){return eb},mutate:function(){return $},preload:function(){return er},unstable_serialize:function(){return em},useSWRConfig:function(){return et}}),r(3457),r(6128);var s=r(674),a=r(7294),u=r(1688),l=Object.prototype.hasOwnProperty;let c=new WeakMap,d=()=>{},f=d(),h=Object,p=e=>e===f,m=e=>"function"==typeof e,y=(e,t)=>({...e,...t}),g=e=>m(e.then),v={},b={},w="undefined",_=typeof window!=w,k=typeof document!=w,E=_&&"Deno"in window,C=()=>_&&typeof window.requestAnimationFrame!=w,S=(e,t)=>{let r=c.get(e);return[()=>!p(t)&&e.get(t)||v,n=>{if(!p(t)){let i=e.get(t);t in b||(b[t]=i),r[5](t,y(i,n),i||v)}},r[6],()=>!p(t)&&t in b?b[t]:!p(t)&&e.get(t)||v]},O=!0,[P,R]=_&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[d,d],x={initFocus:e=>(k&&document.addEventListener("visibilitychange",e),P("focus",e),()=>{k&&document.removeEventListener("visibilitychange",e),R("focus",e)}),initReconnect:e=>{let t=()=>{O=!0,e()},r=()=>{O=!1};return P("online",t),P("offline",r),()=>{R("online",t),R("offline",r)}}},j=!a.useId,U=!_||E,M=e=>C()?window.requestAnimationFrame(e):setTimeout(e,1),T=U?a.useEffect:a.useLayoutEffect,A="undefined"!=typeof navigator&&navigator.connection,I=!U&&A&&(["slow-2g","2g"].includes(A.effectiveType)||A.saveData),L=new WeakMap,N=(e,t)=>h.prototype.toString.call(e)===`[object ${t}]`,D=0,q=e=>{let t,r;let n=typeof e,i=N(e,"Date"),o=N(e,"RegExp"),s=N(e,"Object");if(h(e)!==e||i||o)t=i?e.toJSON():"symbol"==n?e.toString():"string"==n?JSON.stringify(e):""+e;else{if(t=L.get(e))return t;if(t=++D+"~",L.set(e,t),Array.isArray(e)){for(r=0,t="@";r<e.length;r++)t+=q(e[r])+",";L.set(e,t)}if(s){t="#";let n=h.keys(e).sort();for(;!p(r=n.pop());)p(e[r])||(t+=r+":"+q(e[r])+",");L.set(e,t)}}return t},z=e=>{if(m(e))try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?q(e):"",t]},F=0,Q=()=>++F;async function K(...e){let[t,r,n,i]=e,o=y({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{}),s=o.populateCache,a=o.rollbackOnError,u=o.optimisticData,l=e=>"function"==typeof a?a(e):!1!==a,d=o.throwOnError;if(m(r)){let e=[];for(let n of t.keys())!/^\$(inf|sub)\$/.test(n)&&r(t.get(n)._k)&&e.push(n);return Promise.all(e.map(h))}return h(r);async function h(r){let i;let[a]=z(r);if(!a)return;let[h,y]=S(t,a),[v,b,w,_]=c.get(t),k=()=>{let e=v[a];return(m(o.revalidate)?o.revalidate(h().data,r):!1!==o.revalidate)&&(delete w[a],delete _[a],e&&e[0])?e[0](2).then(()=>h().data):h().data};if(e.length<3)return k();let E=n,C=Q();b[a]=[C,0];let O=!p(u),P=h(),R=P.data,x=P._c,j=p(x)?R:x;if(O&&y({data:u=m(u)?u(j,R):u,_c:j}),m(E))try{E=E(j)}catch(e){i=e}if(E&&g(E)){if(E=await E.catch(e=>{i=e}),C!==b[a][0]){if(i)throw i;return E}i&&O&&l(i)&&(s=!0,y({data:j,_c:f}))}if(s&&!i&&(m(s)?y({data:s(E,j),error:f,_c:f}):y({data:E,error:f,_c:f})),b[a][1]=Q(),Promise.resolve(k()).then(()=>{y({_c:f})}),i){if(d)throw i;return}return E}}let B=(e,t)=>{for(let r in e)e[r][0]&&e[r][0](t)},W=(e,t)=>{if(!c.has(e)){let r=y(x,t),n={},i=K.bind(f,e),o=d,s={},a=(e,t)=>{let r=s[e]||[];return s[e]=r,r.push(t),()=>r.splice(r.indexOf(t),1)},u=(t,r,n)=>{e.set(t,r);let i=s[t];if(i)for(let e of i)e(r,n)},l=()=>{if(!c.has(e)&&(c.set(e,[n,{},{},{},i,u,a]),!U)){let t=r.initFocus(setTimeout.bind(f,B.bind(f,n,0))),i=r.initReconnect(setTimeout.bind(f,B.bind(f,n,1)));o=()=>{t&&t(),i&&i(),c.delete(e)}}};return l(),[e,i,l,o]}return[e,c.get(e)[4]]},[V,$]=W(new Map),G=y({onLoadingSlow:d,onSuccess:d,onError:d,onErrorRetry:(e,t,r,n,i)=>{let o=r.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*r.errorRetryInterval;(p(o)||!(s>o))&&setTimeout(n,a,i)},onDiscarded:d,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:I?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:I?5e3:3e3,compare:function e(t,r){var n,i;if(t===r)return!0;if(t&&r&&(n=t.constructor)===r.constructor){if(n===Date)return t.getTime()===r.getTime();if(n===RegExp)return t.toString()===r.toString();if(n===Array){if((i=t.length)===r.length)for(;i--&&e(t[i],r[i]););return -1===i}if(!n||"object"==typeof t){for(n in i=0,t)if(l.call(t,n)&&++i&&!l.call(r,n)||!(n in r)||!e(t[n],r[n]))return!1;return Object.keys(r).length===i}}return t!=t&&r!=r},isPaused:()=>!1,cache:V,mutate:$,fallback:{}},{isOnline:()=>O,isVisible:()=>{let e=k&&document.visibilityState;return p(e)||"hidden"!==e}}),H=(e,t)=>{let r=y(e,t);if(t){let{use:n,fallback:i}=e,{use:o,fallback:s}=t;n&&o&&(r.use=n.concat(o)),i&&s&&(r.fallback=y(i,s))}return r},J=(0,a.createContext)({}),Y="$inf$",X=_&&window.__SWR_DEVTOOLS_USE__,Z=X?window.__SWR_DEVTOOLS_USE__:[],ee=e=>m(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],et=()=>y(G,(0,a.useContext)(J)),er=(e,t)=>{let[r,n]=z(e),[,,,i]=c.get(V);if(i[r])return i[r];let o=t(n);return i[r]=o,o},en=Z.concat(e=>(t,r,n)=>{let i=r&&((...e)=>{let[n]=z(t),[,,,i]=c.get(V);if(n.startsWith(Y))return r(...e);let o=i[n];return p(o)?r(...e):(delete i[n],o)});return e(t,i,n)}),ei=(e,t,r)=>{let n=t[e]||(t[e]=[]);return n.push(r),()=>{let e=n.indexOf(r);e>=0&&(n[e]=n[n.length-1],n.pop())}};X&&(window.__SWR_DEVTOOLS_REACT__=a);let eo=()=>{},es=eo(),ea=Object,eu=e=>e===es,el=e=>"function"==typeof e,ec=new WeakMap,ed=(e,t)=>ea.prototype.toString.call(e)===`[object ${t}]`,ef=0,eh=e=>{let t,r;let n=typeof e,i=ed(e,"Date"),o=ed(e,"RegExp"),s=ed(e,"Object");if(ea(e)!==e||i||o)t=i?e.toJSON():"symbol"==n?e.toString():"string"==n?JSON.stringify(e):""+e;else{if(t=ec.get(e))return t;if(t=++ef+"~",ec.set(e,t),Array.isArray(e)){for(r=0,t="@";r<e.length;r++)t+=eh(e[r])+",";ec.set(e,t)}if(s){t="#";let n=ea.keys(e).sort();for(;!eu(r=n.pop());)eu(e[r])||(t+=r+":"+eh(e[r])+",");ec.set(e,t)}}return t},ep=e=>{if(el(e))try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?eh(e):"",t]},em=e=>ep(e)[0],ey=a.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),eg={dedupe:!0},ev=h.defineProperty(e=>{let{value:t}=e,r=(0,a.useContext)(J),n=m(t),i=(0,a.useMemo)(()=>n?t(r):t,[n,r,t]),o=(0,a.useMemo)(()=>n?i:H(r,i),[n,r,i]),s=i&&i.provider,u=(0,a.useRef)(f);s&&!u.current&&(u.current=W(s(o.cache||V),i));let l=u.current;return l&&(o.cache=l[0],o.mutate=l[1]),T(()=>{if(l)return l[2]&&l[2](),l[3]},[]),(0,a.createElement)(J.Provider,y(e,{value:o}))},"defaultValue",{value:G}),eb=(n=(e,t,r)=>{let{cache:n,compare:i,suspense:o,fallbackData:s,revalidateOnMount:l,revalidateIfStale:d,refreshInterval:h,refreshWhenHidden:v,refreshWhenOffline:b,keepPreviousData:w}=r,[_,k,E,C]=c.get(n),[O,P]=z(e),R=(0,a.useRef)(!1),x=(0,a.useRef)(!1),A=(0,a.useRef)(O),I=(0,a.useRef)(t),L=(0,a.useRef)(r),N=()=>L.current,D=()=>N().isVisible()&&N().isOnline(),[q,F,B,W]=S(n,O),V=(0,a.useRef)({}).current,$=p(s)?p(r.fallback)?f:r.fallback[O]:s,G=(e,t)=>{for(let r in V)if("data"===r){if(!i(e[r],t[r])&&(!p(e[r])||!i(en,t[r])))return!1}else if(t[r]!==e[r])return!1;return!0},H=(0,a.useMemo)(()=>{let e=!!O&&!!t&&(p(l)?!N().isPaused()&&!o&&!1!==d:l),r=t=>{let r=y(t);return(delete r._k,e)?{isValidating:!0,isLoading:!0,...r}:r},n=q(),i=W(),s=r(n),a=n===i?s:r(i),u=s;return[()=>{let e=r(q());return G(e,u)?(u.data=e.data,u.isLoading=e.isLoading,u.isValidating=e.isValidating,u.error=e.error,u):(u=e,e)},()=>a]},[n,O]),J=(0,u.useSyncExternalStore)((0,a.useCallback)(e=>B(O,(t,r)=>{G(r,t)||e()}),[n,O]),H[0],H[1]),Y=!R.current,X=_[O]&&_[O].length>0,Z=J.data,ee=p(Z)?$&&g($)?ey($):$:Z,et=J.error,er=(0,a.useRef)(ee),en=w?p(Z)?p(er.current)?ee:er.current:Z:ee,eo=(!X||!!p(et))&&(Y&&!p(l)?l:!N().isPaused()&&(o?!p(ee)&&d:p(ee)||d)),es=!!(O&&t&&Y&&eo),ea=p(J.isValidating)?es:J.isValidating,eu=p(J.isLoading)?es:J.isLoading,el=(0,a.useCallback)(async e=>{let t,n;let o=I.current;if(!O||!o||x.current||N().isPaused())return!1;let s=!0,a=e||{},u=!E[O]||!a.dedupe,l=()=>j?!x.current&&O===A.current&&R.current:O===A.current,c={isValidating:!1,isLoading:!1},d=()=>{F(c)},h=()=>{let e=E[O];e&&e[1]===n&&delete E[O]},y={isValidating:!0};p(q().data)&&(y.isLoading=!0);try{if(u&&(F(y),r.loadingTimeout&&p(q().data)&&setTimeout(()=>{s&&l()&&N().onLoadingSlow(O,r)},r.loadingTimeout),E[O]=[o(P),Q()]),[t,n]=E[O],t=await t,u&&setTimeout(h,r.dedupingInterval),!E[O]||E[O][1]!==n)return u&&l()&&N().onDiscarded(O),!1;c.error=f;let e=k[O];if(!p(e)&&(n<=e[0]||n<=e[1]||0===e[1]))return d(),u&&l()&&N().onDiscarded(O),!1;let a=q().data;c.data=i(a,t)?a:t,u&&l()&&N().onSuccess(t,O,r)}catch(r){h();let e=N(),{shouldRetryOnError:t}=e;!e.isPaused()&&(c.error=r,u&&l()&&(e.onError(r,O,e),(!0===t||m(t)&&t(r))&&(!N().revalidateOnFocus||!N().revalidateOnReconnect||D())&&e.onErrorRetry(r,O,e,e=>{let t=_[O];t&&t[0]&&t[0](3,e)},{retryCount:(a.retryCount||0)+1,dedupe:!0})))}return s=!1,d(),!0},[O,n]),ec=(0,a.useCallback)((...e)=>K(n,A.current,...e),[]);if(T(()=>{I.current=t,L.current=r,p(Z)||(er.current=Z)}),T(()=>{if(!O)return;let e=el.bind(f,eg),t=0,r=ei(O,_,(r,n={})=>{if(0==r){let r=Date.now();N().revalidateOnFocus&&r>t&&D()&&(t=r+N().focusThrottleInterval,e())}else if(1==r)N().revalidateOnReconnect&&D()&&e();else if(2==r)return el();else if(3==r)return el(n)});return x.current=!1,A.current=O,R.current=!0,F({_k:P}),eo&&(p(ee)||U?e():M(e)),()=>{x.current=!0,r()}},[O]),T(()=>{let e;function t(){let t=m(h)?h(q().data):h;t&&-1!==e&&(e=setTimeout(r,t))}function r(){!q().error&&(v||N().isVisible())&&(b||N().isOnline())?el(eg).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[h,v,b,O]),(0,a.useDebugValue)(en),o&&p(ee)&&O){if(!j&&U)throw Error("Fallback data is required when using Suspense in SSR.");I.current=t,L.current=r,x.current=!1;let e=C[O];if(p(e)||ey(ec(e)),p(et)){let e=el(eg);p(en)||(e.status="fulfilled",e.value=!0),ey(e)}else throw et}return{mutate:ec,get data(){return V.data=!0,en},get error(){return V.error=!0,et},get isValidating(){return V.isValidating=!0,ea},get isLoading(){return V.isLoading=!0,eu}}},function(...e){let t=et(),[r,i,o]=ee(e),s=H(t,o),a=n,{use:u}=s,l=(u||[]).concat(en);for(let e=l.length;e--;)a=l[e](a);return a(r,i||s.fetcher||null,s)}),ew=()=>{},e_=ew(),ek=Object,eE=e=>e===e_,eC=e=>"function"==typeof e,eS=new WeakMap,eO=(e,t)=>ek.prototype.toString.call(e)===`[object ${t}]`,eP=0,eR=e=>{let t,r;let n=typeof e,i=eO(e,"Date"),o=eO(e,"RegExp"),s=eO(e,"Object");if(ek(e)!==e||i||o)t=i?e.toJSON():"symbol"==n?e.toString():"string"==n?JSON.stringify(e):""+e;else{if(t=eS.get(e))return t;if(t=++eP+"~",eS.set(e,t),Array.isArray(e)){for(r=0,t="@";r<e.length;r++)t+=eR(e[r])+",";eS.set(e,t)}if(s){t="#";let n=ek.keys(e).sort();for(;!eE(r=n.pop());)eE(e[r])||(t+=r+":"+eR(e[r])+",");eS.set(e,t)}}return t},ex=e=>{if(eC(e))try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?eR(e):"",t]},ej=e=>ex(e?e(0,null):null)[0],eU=Promise.resolve(),eM=(i=e=>(t,r,n)=>{let i;let o=(0,a.useRef)(!1),{cache:s,initialSize:l=1,revalidateAll:d=!1,persistSize:h=!1,revalidateFirstPage:y=!0,revalidateOnMount:g=!1,parallel:v=!1}=n,[,,,b]=c.get(V);try{(i=ej(t))&&(i=Y+i)}catch(e){}let[w,_,k]=S(s,i),E=(0,a.useCallback)(()=>p(w()._l)?l:w()._l,[s,i,l]);(0,u.useSyncExternalStore)((0,a.useCallback)(e=>i?k(i,()=>{e()}):()=>{},[s,i]),E,E);let C=(0,a.useCallback)(()=>{let e=w()._l;return p(e)?l:e},[i,l]),O=(0,a.useRef)(C());T(()=>{if(!o.current){o.current=!0;return}i&&_({_l:h?O.current:C()})},[i,s]);let P=g&&!o.current,R=e(i,async e=>{let i=w()._i,o=w()._r;_({_r:f});let a=[],u=C(),[l]=S(s,e),c=l().data,h=[],m=null;for(let e=0;e<u;++e){let[u,l]=z(t(e,v?null:m));if(!u)break;let[f,g]=S(s,u),w=f().data,_=d||i||p(w)||y&&!e&&!p(c)||P||c&&!p(c[e])&&!n.compare(c[e],w);if(r&&("function"==typeof o?o(w,l):_)){let t=async()=>{if(u in b){let e=b[u];delete b[u],w=await e}else w=await r(l);g({data:w,_k:l}),a[e]=w};v?h.push(t):await t()}else a[e]=w;v||(m=w)}return v&&await Promise.all(h.map(e=>e())),_({_i:f}),a},n),x=(0,a.useCallback)(function(e,t){let r="boolean"==typeof t?{revalidate:t}:t||{},n=!1!==r.revalidate;return i?(n&&(p(e)?_({_i:!0,_r:r.revalidate}):_({_i:!1,_r:r.revalidate})),arguments.length?R.mutate(e,{...r,revalidate:n}):R.mutate()):eU},[i,s]),j=(0,a.useCallback)(e=>{let r;if(!i)return eU;let[,n]=S(s,i);if(m(e)?r=e(C()):"number"==typeof e&&(r=e),"number"!=typeof r)return eU;n({_l:r}),O.current=r;let o=[],[a]=S(s,i),u=null;for(let e=0;e<r;++e){let[r]=z(t(e,u)),[n]=S(s,r),i=r?n().data:f;if(p(i))return x(a().data);o.push(i),u=i}return x(o)},[i,s,x,C]);return{size:C(),setSize:j,mutate:x,get data(){return R.data},get error(){return R.error},get isValidating(){return R.isValidating},get isLoading(){return R.isLoading}}},(...e)=>{let[t,r,n]=ee(e),o=(n.use||[]).concat(i);return eb(t,r,{...n,use:o})});var eT=Object.prototype.hasOwnProperty;function eA(e,t,r){for(r of e.keys())if(eI(r,t))return r}function eI(e,t){var r,n,i;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&eI(e[n],t[n]););return -1===n}if(r===Set){if(e.size!==t.size)return!1;for(n of e)if((i=n)&&"object"==typeof i&&!(i=eA(t,i))||!t.has(i))return!1;return!0}if(r===Map){if(e.size!==t.size)return!1;for(n of e)if((i=n[0])&&"object"==typeof i&&!(i=eA(t,i))||!eI(n[1],t.get(i)))return!1;return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return -1===n}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return -1===n}if(!r||"object"==typeof e){for(r in n=0,e)if(eT.call(e,r)&&++n&&!eT.call(t,r)||!(r in t)||!eI(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!=e&&t!=t}function eL(e,t){if(!e)throw"string"==typeof t?Error(t):Error(`${t.displayName} not found`)}var eN=(e,t)=>{let{assertCtxFn:r=eL}=t||{},n=a.createContext(void 0);return n.displayName=e,[n,()=>{let t=a.useContext(n);return r(t,`${e} not found`),t.value},()=>{let e=a.useContext(n);return e?e.value:{}}]},eD={};(0,s.r2)(eD,{useSWR:()=>eb,useSWRInfinite:()=>eM}),(0,s.yA)(eD,o);var[eq,ez]=eN("ClerkInstanceContext"),[eF,eQ]=eN("UserContext"),[eK,eB]=eN("ClientContext"),[eW,eV]=eN("SessionContext");a.createContext({});var[e$,eG]=eN("OrganizationContext"),eH=({children:e,organization:t,swrConfig:r})=>a.createElement(eD.SWRConfig,{value:r},a.createElement(e$.Provider,{value:{value:{organization:t}}},e));function eJ(e){if(!a.useContext(eq)){if("function"==typeof e){e();return}throw Error(`${e} can only be used within the <ClerkProvider /> component.

Possible fixes:
1. Ensure that the <ClerkProvider /> is correctly wrapping your application where this component is used.
2. Check for multiple versions of the \`@clerk/shared\` package in your project. Use a tool like \`npm ls @clerk/shared\` to identify multiple versions, and update your dependencies to only rely on one.

Learn more: https://clerk.com/docs/components/clerk-provider`.trim())}}"undefined"!=typeof window?a.useLayoutEffect:a.useEffect;var eY=()=>{eJ("useSession");let e=eV();return void 0===e?{isLoaded:!1,isSignedIn:void 0,session:void 0}:null===e?{isLoaded:!0,isSignedIn:!1,session:null}:{isLoaded:!0,isSignedIn:!0,session:e}};function eX(){eJ("useUser");let e=eQ();return void 0===e?{isLoaded:!1,isSignedIn:void 0,user:void 0}:null===e?{isLoaded:!0,isSignedIn:!1,user:null}:{isLoaded:!0,isSignedIn:!0,user:e}}var eZ=()=>(eJ("useClerk"),ez()),e0=eI},2905:function(e,t,r){"use strict";r.d(t,{NS:function(){return R}});var n,i,o,s,a,u,l,c,d,f,h,p,m,y,g,v,b,w,_,k=r(6170),E=r(7362),C=r(674),S=r(3454),O=class{constructor(){(0,C.Ko)(this,o),(0,C.Ko)(this,n,"clerk_telemetry_throttler"),(0,C.Ko)(this,i,864e5)}isEventThrottled(e){if(!(0,C.ac)(this,o,u))return!1;let t=Date.now(),r=(0,C.U9)(this,o,s).call(this,e),l=C.ac(this,o,a)?.[r];if(!l){let e={...(0,C.ac)(this,o,a),[r]:t};localStorage.setItem((0,C.ac)(this,n),JSON.stringify(e))}if(l&&t-l>(0,C.ac)(this,i)){let e=(0,C.ac)(this,o,a);delete e[r],localStorage.setItem((0,C.ac)(this,n),JSON.stringify(e))}return!!l}};n=new WeakMap,i=new WeakMap,o=new WeakSet,s=function(e){let{sk:t,pk:r,payload:n,...i}=e,o={...n,...i};return JSON.stringify(Object.keys({...n,...i}).sort().map(e=>o[e]))},a=function(){let e=localStorage.getItem((0,C.ac)(this,n));return e?JSON.parse(e):{}},u=function(){if("undefined"==typeof window)return!1;let e=window.localStorage;if(!e)return!1;try{let t="test";return e.setItem(t,t),e.removeItem(t),!0}catch(t){return t instanceof DOMException&&("QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&e.length>0&&e.removeItem((0,C.ac)(this,n)),!1}};var P={samplingRate:1,maxBufferSize:5,endpoint:"https://clerk-telemetry.com"},R=class{constructor(e){(0,C.Ko)(this,p),(0,C.Ko)(this,l),(0,C.Ko)(this,c),(0,C.Ko)(this,d,{}),(0,C.Ko)(this,f,[]),(0,C.Ko)(this,h),(0,C.qx)(this,l,{maxBufferSize:e.maxBufferSize??P.maxBufferSize,samplingRate:e.samplingRate??P.samplingRate,disabled:e.disabled??!1,debug:e.debug??!1,endpoint:P.endpoint}),e.clerkVersion||"undefined"!=typeof window?(0,C.ac)(this,d).clerkVersion=e.clerkVersion??"":(0,C.ac)(this,d).clerkVersion="",(0,C.ac)(this,d).sdk=e.sdk,(0,C.ac)(this,d).sdkVersion=e.sdkVersion,(0,C.ac)(this,d).publishableKey=e.publishableKey??"";let t=(0,E.nQ)(e.publishableKey);t&&((0,C.ac)(this,d).instanceType=t.instanceType),e.secretKey&&((0,C.ac)(this,d).secretKey=e.secretKey.substring(0,16)),(0,C.qx)(this,c,new O)}get isEnabled(){return!("development"!==(0,C.ac)(this,d).instanceType||(0,C.ac)(this,l).disabled||void 0!==S&&(0,k.fQ)(S.env.CLERK_TELEMETRY_DISABLED)||"undefined"!=typeof window&&window?.navigator?.webdriver)}get isDebug(){return(0,C.ac)(this,l).debug||void 0!==S&&(0,k.fQ)(S.env.CLERK_TELEMETRY_DEBUG)}record(e){let t=(0,C.U9)(this,p,_).call(this,e.event,e.payload);(0,C.U9)(this,p,b).call(this,t.event,t),(0,C.U9)(this,p,m).call(this,t,e.eventSamplingRate)&&((0,C.ac)(this,f).push(t),(0,C.U9)(this,p,g).call(this))}};l=new WeakMap,c=new WeakMap,d=new WeakMap,f=new WeakMap,h=new WeakMap,p=new WeakSet,m=function(e,t){return this.isEnabled&&!this.isDebug&&(0,C.U9)(this,p,y).call(this,e,t)},y=function(e,t){let r=Math.random();return!(0,C.ac)(this,c).isEventThrottled(e)&&r<=(0,C.ac)(this,l).samplingRate&&(void 0===t||r<=t)},g=function(){if("undefined"==typeof window){(0,C.U9)(this,p,v).call(this);return}if((0,C.ac)(this,f).length>=(0,C.ac)(this,l).maxBufferSize){(0,C.ac)(this,h)&&("undefined"!=typeof cancelIdleCallback?cancelIdleCallback:clearTimeout)((0,C.ac)(this,h)),(0,C.U9)(this,p,v).call(this);return}(0,C.ac)(this,h)||("requestIdleCallback"in window?(0,C.qx)(this,h,requestIdleCallback(()=>{(0,C.U9)(this,p,v).call(this)})):(0,C.qx)(this,h,setTimeout(()=>{(0,C.U9)(this,p,v).call(this)},0)))},v=function(){fetch(new URL("/v1/event",(0,C.ac)(this,l).endpoint),{method:"POST",body:JSON.stringify({events:(0,C.ac)(this,f)}),headers:{"Content-Type":"application/json"}}).catch(()=>void 0).then(()=>{(0,C.qx)(this,f,[])}).catch(()=>void 0)},b=function(e,t){this.isDebug&&(void 0!==console.groupCollapsed?(console.groupCollapsed("[clerk/telemetry]",e),console.log(t),console.groupEnd()):console.log("[clerk/telemetry]",e,t))},w=function(){let e={name:(0,C.ac)(this,d).sdk,version:(0,C.ac)(this,d).sdkVersion};return"undefined"!=typeof window&&window.Clerk&&(e={...e,...window.Clerk.constructor.sdkMetadata}),e},_=function(e,t){let r=(0,C.U9)(this,p,w).call(this);return{event:e,cv:(0,C.ac)(this,d).clerkVersion??"",it:(0,C.ac)(this,d).instanceType??"",sdk:r.name,sdkv:r.version,...(0,C.ac)(this,d).publishableKey?{pk:(0,C.ac)(this,d).publishableKey}:{},...(0,C.ac)(this,d).secretKey?{sk:(0,C.ac)(this,d).secretKey}:{},payload:t}}},3185:function(e,t,r){"use strict";r.d(t,{fQ:function(){return n.fQ}});var n=r(6170);r(674)},6922:function(e,t,r){"use strict";r.d(t,{YZ:function(){return i},vf:function(){return o.vf},rx:function(){return o.rx},yJ:function(){return n.yJ}});var n=r(5731);function i(e,t,r){return"function"==typeof e?e(t):void 0!==e?e:void 0!==r?r:void 0}var o=r(740);r(674)},5761:function(e,t,r){"use strict";r.d(t,{j:function(){return s}});var n=r(3989),i=r(2161);class o extends n.l{constructor(){super(),this.setup=e=>{if(!i.sk&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),window.addEventListener("focus",t,!1),()=>{window.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.cleanup)||e.call(this),this.cleanup=void 0}}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.focused!==e&&(this.focused=e,this.onFocus())}onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return"boolean"==typeof this.focused?this.focused:"undefined"==typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}}let s=new o},81:function(e,t,r){"use strict";r.d(t,{V:function(){return i}});var n=r(2161);let i=function(){let e=[],t=0,r=e=>{e()},i=e=>{e()},o=i=>{t?e.push(i):(0,n.A4)(()=>{r(i)})},s=()=>{let t=e;e=[],t.length&&(0,n.A4)(()=>{i(()=>{t.forEach(e=>{r(e)})})})};return{batch:e=>{let r;t++;try{r=e()}finally{--t||s()}return r},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{i=e}}}()},6474:function(e,t,r){"use strict";r.d(t,{N:function(){return a}});var n=r(3989),i=r(2161);let o=["online","offline"];class s extends n.l{constructor(){super(),this.setup=e=>{if(!i.sk&&window.addEventListener){let t=()=>e();return o.forEach(e=>{window.addEventListener(e,t,!1)}),()=>{o.forEach(e=>{window.removeEventListener(e,t)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.cleanup)||e.call(this),this.cleanup=void 0}}setEventListener(e){var t;this.setup=e,null==(t=this.cleanup)||t.call(this),this.cleanup=e(e=>{"boolean"==typeof e?this.setOnline(e):this.onOnline()})}setOnline(e){this.online!==e&&(this.online=e,this.onOnline())}onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return"boolean"==typeof this.online?this.online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine}}let a=new s},2924:function(e,t,r){"use strict";r.d(t,{z:function(){return u}});var n=r(2161),i=r(81),o=r(5761),s=r(3989),a=r(2379);class u extends s.l{constructor(e,t){super(),this.client=e,this.options=t,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.currentQuery.addObserver(this),l(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return c(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return c(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,t){let r=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),(0,n.VS)(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();let o=this.hasListeners();o&&d(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(t),o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();let s=this.computeRefetchInterval();o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||s!==this.currentRefetchInterval)&&this.updateRefetchInterval(s)}getOptimisticResult(e){let t=this.client.getQueryCache().build(this.client,e),r=this.createResult(t,e);return e.keepPreviousData||(void 0!==e.placeholderData?!r.isPlaceholderData:(0,n.VS)(this.getCurrentResult(),r))||(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}getCurrentResult(){return this.currentResult}trackResult(e){let t={};return Object.keys(e).forEach(r=>{Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),e[r])})}),t}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...t}={}){return this.fetch({...t,meta:{refetchPage:e}})}fetchOptimistic(e){let t=this.client.defaultQueryOptions(e),r=this.client.getQueryCache().build(this.client,t);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,t))}fetch(e){var t;return this.executeFetch({...e,cancelRefetch:null==(t=e.cancelRefetch)||t}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let t=this.currentQuery.fetch(this.options,e);return null!=e&&e.throwOnError||(t=t.catch(n.ZT)),t}updateStaleTimeout(){if(this.clearStaleTimeout(),n.sk||this.currentResult.isStale||!(0,n.PN)(this.options.staleTime))return;let e=(0,n.Kp)(this.currentResult.dataUpdatedAt,this.options.staleTime);this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},e+1)}computeRefetchInterval(){var e;return"function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.currentResult.data,this.currentQuery):null!=(e=this.options.refetchInterval)&&e}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!n.sk&&!1!==this.options.enabled&&(0,n.PN)(this.currentRefetchInterval)&&0!==this.currentRefetchInterval&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||o.j.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,t){let r;let i=this.currentQuery,o=this.options,s=this.currentResult,u=this.currentResultState,c=this.currentResultOptions,h=e!==i,p=h?e.state:this.currentQueryInitialState,m=h?this.currentResult:this.previousQueryResult,{state:y}=e,{dataUpdatedAt:g,error:v,errorUpdatedAt:b,fetchStatus:w,status:_}=y,k=!1,E=!1;if(t._optimisticResults){let r=this.hasListeners(),n=!r&&l(e,t),s=r&&d(e,i,t,o);(n||s)&&(w=(0,a.Kw)(e.options.networkMode)?"fetching":"paused",g||(_="loading")),"isRestoring"===t._optimisticResults&&(w="idle")}if(t.keepPreviousData&&!y.dataUpdatedAt&&null!=m&&m.isSuccess&&"error"!==_)r=m.data,g=m.dataUpdatedAt,_=m.status,k=!0;else if(t.select&&void 0!==y.data){if(s&&y.data===(null==u?void 0:u.data)&&t.select===this.selectFn)r=this.selectResult;else try{this.selectFn=t.select,r=t.select(y.data),r=(0,n.oE)(null==s?void 0:s.data,r,t),this.selectResult=r,this.selectError=null}catch(e){this.selectError=e}}else r=y.data;if(void 0!==t.placeholderData&&void 0===r&&"loading"===_){let e;if(null!=s&&s.isPlaceholderData&&t.placeholderData===(null==c?void 0:c.placeholderData))e=s.data;else if(e="function"==typeof t.placeholderData?t.placeholderData():t.placeholderData,t.select&&void 0!==e)try{e=t.select(e),this.selectError=null}catch(e){this.selectError=e}void 0!==e&&(_="success",r=(0,n.oE)(null==s?void 0:s.data,e,t),E=!0)}this.selectError&&(v=this.selectError,r=this.selectResult,b=Date.now(),_="error");let C="fetching"===w,S="loading"===_,O="error"===_;return{status:_,fetchStatus:w,isLoading:S,isSuccess:"success"===_,isError:O,isInitialLoading:S&&C,data:r,dataUpdatedAt:g,error:v,errorUpdatedAt:b,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>p.dataUpdateCount||y.errorUpdateCount>p.errorUpdateCount,isFetching:C,isRefetching:C&&!S,isLoadingError:O&&0===y.dataUpdatedAt,isPaused:"paused"===w,isPlaceholderData:E,isPreviousData:k,isRefetchError:O&&0!==y.dataUpdatedAt,isStale:f(e,t),refetch:this.refetch,remove:this.remove}}updateResult(e){let t=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,(0,n.VS)(r,t))return;this.currentResult=r;let i={cache:!0};(null==e?void 0:e.listeners)!==!1&&(()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options,r="function"==typeof e?e():e;if("all"===r||!r&&!this.trackedProps.size)return!0;let n=new Set(null!=r?r:this.trackedProps);return this.options.useErrorBoundary&&n.add("error"),Object.keys(this.currentResult).some(e=>this.currentResult[e]!==t[e]&&n.has(e))})()&&(i.listeners=!0),this.notify({...i,...e})}updateQuery(){let e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;let t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){let t={};"success"===e.type?t.onSuccess=!e.manual:"error"!==e.type||(0,a.DV)(e.error)||(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()}notify(e){i.V.batch(()=>{var t,r,n,i,o,s,a,u;e.onSuccess?(null==(t=(r=this.options).onSuccess)||t.call(r,this.currentResult.data),null==(n=(i=this.options).onSettled)||n.call(i,this.currentResult.data,null)):e.onError&&(null==(o=(s=this.options).onError)||o.call(s,this.currentResult.error),null==(a=(u=this.options).onSettled)||a.call(u,void 0,this.currentResult.error)),e.listeners&&this.listeners.forEach(({listener:e})=>{e(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function l(e,t){return!1!==t.enabled&&!e.state.dataUpdatedAt&&!("error"===e.state.status&&!1===t.retryOnMount)||e.state.dataUpdatedAt>0&&c(e,t,t.refetchOnMount)}function c(e,t,r){if(!1!==t.enabled){let n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&f(e,t)}return!1}function d(e,t,r,n){return!1!==r.enabled&&(e!==t||!1===n.enabled)&&(!r.suspense||"error"!==e.state.status)&&f(e,r)}function f(e,t){return e.isStaleByTime(t.staleTime)}},2379:function(e,t,r){"use strict";r.d(t,{DV:function(){return l},Kw:function(){return a},Mz:function(){return c}});var n=r(5761),i=r(6474),o=r(2161);function s(e){return Math.min(1e3*2**e,3e4)}function a(e){return(null!=e?e:"online")!=="online"||i.N.isOnline()}class u{constructor(e){this.revert=null==e?void 0:e.revert,this.silent=null==e?void 0:e.silent}}function l(e){return e instanceof u}function c(e){let t,r,l,c=!1,d=0,f=!1,h=new Promise((e,t)=>{r=e,l=t}),p=()=>!n.j.isFocused()||"always"!==e.networkMode&&!i.N.isOnline(),m=n=>{f||(f=!0,null==e.onSuccess||e.onSuccess(n),null==t||t(),r(n))},y=r=>{f||(f=!0,null==e.onError||e.onError(r),null==t||t(),l(r))},g=()=>new Promise(r=>{t=e=>{let t=f||!p();return t&&r(e),t},null==e.onPause||e.onPause()}).then(()=>{t=void 0,f||null==e.onContinue||e.onContinue()}),v=()=>{let t;if(!f){try{t=e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(m).catch(t=>{var r,n;if(f)return;let i=null!=(r=e.retry)?r:3,a=null!=(n=e.retryDelay)?n:s,u="function"==typeof a?a(d,t):a,l=!0===i||"number"==typeof i&&d<i||"function"==typeof i&&i(d,t);if(c||!l){y(t);return}d++,null==e.onFail||e.onFail(d,t),(0,o.Gh)(u).then(()=>{if(p())return g()}).then(()=>{c?y(t):v()})})}};return a(e.networkMode)?v():g().then(v),{promise:h,cancel:t=>{f||(y(new u(t)),null==e.abort||e.abort())},continue:()=>(null==t?void 0:t())?h:Promise.resolve(),cancelRetry:()=>{c=!0},continueRetry:()=>{c=!1}}}},3989:function(e,t,r){"use strict";r.d(t,{l:function(){return n}});class n{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){let t={listener:e};return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},2161:function(e,t,r){"use strict";r.d(t,{A4:function(){return S},G9:function(){return O},Gh:function(){return C},I6:function(){return f},Kp:function(){return l},PN:function(){return s},Rc:function(){return u},Rm:function(){return m},SE:function(){return o},VS:function(){return b},X7:function(){return p},ZT:function(){return i},_v:function(){return c},_x:function(){return h},e5:function(){return a},lV:function(){return d},oE:function(){return P},sk:function(){return n},to:function(){return g},yF:function(){return y}});let n="undefined"==typeof window||"Deno"in window;function i(){}function o(e,t){return"function"==typeof e?e(t):e}function s(e){return"number"==typeof e&&e>=0&&e!==1/0}function a(e,t){return e.filter(e=>!t.includes(e))}function u(e,t,r){let n=e.slice(0);return n[t]=r,n}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function c(e,t,r){return E(e)?"function"==typeof t?{...r,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function d(e,t,r){return E(e)?"function"==typeof t?{...r,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:"function"==typeof e?{...t,mutationFn:e}:{...e}}function f(e,t,r){return E(e)?[{...t,queryKey:e},r]:[e||{},t]}function h(e,t){let{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(E(s)){if(n){if(t.queryHash!==m(s,t.options))return!1}else{if(!v(t.queryKey,s))return!1}}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof a||t.isStale()===a)&&(void 0===i||i===t.state.fetchStatus)&&(!o||!!o(t))}function p(e,t){let{exact:r,fetching:n,predicate:i,mutationKey:o}=e;if(E(o)){if(!t.options.mutationKey)return!1;if(r){if(y(t.options.mutationKey)!==y(o))return!1}else{if(!v(t.options.mutationKey,o))return!1}}return("boolean"!=typeof n||"loading"===t.state.status===n)&&(!i||!!i(t))}function m(e,t){return((null==t?void 0:t.queryKeyHashFn)||y)(e)}function y(e){return JSON.stringify(e,(e,t)=>_(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function g(e,t){return v(e,t)}function v(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&!Object.keys(t).some(r=>!v(e[r],t[r]))}function b(e,t){if(e&&!t||t&&!e)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function _(e){if(!k(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!(k(r)&&r.hasOwnProperty("isPrototypeOf"))}function k(e){return"[object Object]"===Object.prototype.toString.call(e)}function E(e){return Array.isArray(e)}function C(e){return new Promise(t=>{setTimeout(t,e)})}function S(e){C(0).then(e)}function O(){if("function"==typeof AbortController)return new AbortController}function P(e,t,r){return null!=r.isDataEqual&&r.isDataEqual(e,t)?e:"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r){if(t===r)return t;let n=w(t)&&w(r);if(n||_(t)&&_(r)){let i=n?t.length:Object.keys(t).length,o=n?r:Object.keys(r),s=o.length,a=n?[]:{},u=0;for(let i=0;i<s;i++){let s=n?i:o[i];a[s]=e(t[s],r[s]),a[s]===t[s]&&u++}return i===s&&u===i?t:a}return r}(e,t):t}},5945:function(e,t,r){"use strict";r.d(t,{NL:function(){return a},aH:function(){return u}});var n=r(7294);let i=n.createContext(void 0),o=n.createContext(!1);function s(e,t){return e||(t&&"undefined"!=typeof window?(window.ReactQueryClientContext||(window.ReactQueryClientContext=i),window.ReactQueryClientContext):i)}let a=({context:e}={})=>{let t=n.useContext(s(e,n.useContext(o)));if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},u=({client:e,children:t,context:r,contextSharing:i=!1})=>{n.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);let a=s(r,i);return n.createElement(o.Provider,{value:!r&&i},n.createElement(a.Provider,{value:e},t))}},1784:function(e,t,r){"use strict";let n;r.d(t,{_:function(){return s}});var i=r(7294);let o=i.createContext((n=!1,{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n})),s=()=>i.useContext(o)},1670:function(e,t,r){"use strict";r.d(t,{JN:function(){return s},KJ:function(){return a},pf:function(){return o}});var n=r(7294),i=r(4798);let o=(e,t)=>{(e.suspense||e.useErrorBoundary)&&!t.isReset()&&(e.retryOnMount=!1)},s=e=>{n.useEffect(()=>{e.clearReset()},[e])},a=({result:e,errorResetBoundary:t,useErrorBoundary:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&(0,i.L)(r,[e.error,n])},7122:function(e,t,r){"use strict";r.d(t,{S:function(){return o}});var n=r(7294);let i=n.createContext(!1),o=()=>n.useContext(i);i.Provider},8381:function(e,t,r){"use strict";r.d(t,{Fb:function(){return n},SB:function(){return o},Z$:function(){return i},j8:function(){return s}});let n=e=>{e.suspense&&"number"!=typeof e.staleTime&&(e.staleTime=1e3)},i=(e,t)=>e.isLoading&&e.isFetching&&!t,o=(e,t,r)=>(null==e?void 0:e.suspense)&&i(t,r),s=(e,t,r)=>t.fetchOptimistic(e).then(({data:t})=>{null==e.onSuccess||e.onSuccess(t),null==e.onSettled||e.onSettled(t,null)}).catch(t=>{r.clearReset(),null==e.onError||e.onError(t),null==e.onSettled||e.onSettled(void 0,t)})},7687:function(e,t,r){"use strict";r.d(t,{r:function(){return d}});var n=r(7294),i=r(81),o=r(464),s=r(1784),a=r(5945),u=r(7122),l=r(1670),c=r(8381);function d(e,t){let r=(0,a.NL)({context:e.context}),d=(0,u.S)(),f=(0,s._)(),h=r.defaultQueryOptions(e);h._optimisticResults=d?"isRestoring":"optimistic",h.onError&&(h.onError=i.V.batchCalls(h.onError)),h.onSuccess&&(h.onSuccess=i.V.batchCalls(h.onSuccess)),h.onSettled&&(h.onSettled=i.V.batchCalls(h.onSettled)),(0,c.Fb)(h),(0,l.pf)(h,f),(0,l.JN)(f);let[p]=n.useState(()=>new t(r,h)),m=p.getOptimisticResult(h);if((0,o.$)(n.useCallback(e=>{let t=d?()=>void 0:p.subscribe(i.V.batchCalls(e));return p.updateResult(),t},[p,d]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),n.useEffect(()=>{p.setOptions(h,{listeners:!1})},[h,p]),(0,c.SB)(h,m,d))throw(0,c.j8)(h,p,f);if((0,l.KJ)({result:m,errorResetBoundary:f,useErrorBoundary:h.useErrorBoundary,query:p.getCurrentQuery()}))throw m.error;return h.notifyOnChangeProps?m:p.trackResult(m)}},6492:function(e,t,r){"use strict";r.d(t,{a:function(){return s}});var n=r(2161),i=r(2924),o=r(7687);function s(e,t,r){let s=(0,n._v)(e,t,r);return(0,o.r)(s,i.z)}},464:function(e,t,r){"use strict";r.d(t,{$:function(){return n}});let n=r(1688).useSyncExternalStore},4798:function(e,t,r){"use strict";function n(e,t){return"function"==typeof e?e(...t):!!e}r.d(t,{L:function(){return n}})},4712:function(e,t,r){"use strict";r.d(t,{A:function(){return f},x:function(){return m}});var n=r(7294),i=r(3935);!function(e,{insertAt:t}={}){if(!e||"undefined"==typeof document)return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(`[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 6px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}[data-sonner-toaster][data-x-position=right]{right:max(var(--offset),env(safe-area-inset-right))}[data-sonner-toaster][data-x-position=left]{left:max(var(--offset),env(safe-area-inset-left))}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:max(var(--offset),env(safe-area-inset-top))}[data-sonner-toaster][data-y-position=bottom]{bottom:max(var(--offset),env(safe-area-inset-bottom))}[data-sonner-toast]{--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;will-change:transform,opacity,height;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}[data-sonner-toast] [data-description]{font-weight:400;line-height:1.4;color:inherit}[data-sonner-toast] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:-3px;margin-right:4px}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast] [data-icon]>*{flex-shrink:0}[data-sonner-toast] [data-icon] svg{margin-left:-1px}[data-sonner-toast] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:auto;border:none;cursor:pointer;outline:none;transition:opacity .4s,box-shadow .2s}[data-sonner-toast] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast] [data-button]:first-of-type{margin-left:auto}[data-sonner-toast] [data-cancel]{color:var(--color);background:var(--border-color)}[data-sonner-toast] [data-close-button]{position:absolute;left:0;top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:translate(-35%,-35%);border-radius:50%;opacity:0;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast]:hover [data-close-button]{opacity:1}[data-sonner-toast]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";position:absolute;left:0;right:0;height:100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]:after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y: translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y: translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toast]{left:0;right:0;width:calc(100% - 32px)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true] [data-sonner-toast][data-type=success],[data-rich-colors=true] [data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true] [data-sonner-toast][data-type=error],[data-rich-colors=true] [data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}
`);var o=e=>{switch(e){case"success":return u;case"error":return l}},s=Array(12).fill(0),a=({visible:e})=>n.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},n.createElement("div",{className:"sonner-spinner"},s.map((e,t)=>n.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),u=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),l=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),c=0,d=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e)),this.toasts=[...this.toasts,e]},this.dismiss=e=>(e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>{let r=(null==t?void 0:t.id)||c++;return this.publish({...t,id:r,title:e}),r},this.error=(e,t)=>{let r=(null==t?void 0:t.id)||c++;return this.publish({...t,id:r,type:"error",title:e}),r},this.success=(e,t)=>{let r=(null==t?void 0:t.id)||c++;return this.publish({...t,id:r,type:"success",title:e}),r},this.promise=(e,t)=>{let r=(null==t?void 0:t.id)||c++;return this.publish({...t,promise:e,id:r}),r},this.custom=(e,t)=>{let r=(null==t?void 0:t.id)||c++;this.publish({jsx:e(r),id:r,...t})},this.subscribers=[],this.toasts=[]}},f=Object.assign((e,t)=>{let r=(null==t?void 0:t.id)||c++;return d.publish({title:e,...t,id:r}),r},{success:d.success,error:d.error,custom:d.custom,message:d.message,promise:d.promise,dismiss:d.dismiss}),h=e=>!!e.promise,p=e=>{var t;let{invert:r,toast:i,interacting:s,setHeights:u,visibleToasts:l,heights:c,index:d,toasts:f,expanded:p,removeToast:m,closeButton:y,style:g,className:v="",descriptionClassName:b="",duration:w,position:_,expandByDefault:k}=e,[E,C]=n.useState(!1),[S,O]=n.useState(!1),[P,R]=n.useState(!1),[x,j]=n.useState(!1),[U,M]=n.useState(null),[T,A]=n.useState(0),[I,L]=n.useState(0),[N,D]=n.useState(null),q=n.useRef(null),z=0===d,F=d+1<=l,Q=i.type,K=i.className||"",B=i.descriptionClassName||"",W=n.useMemo(()=>c.findIndex(e=>e.toastId===i.id)||0,[c,i.id]),V=n.useMemo(()=>i.duration||w||4e3,[i.duration,w]),$=n.useRef(0),G=n.useRef(0),H=n.useRef(V),J=n.useRef(0),Y=n.useRef(null),[X,Z]=_.split("-"),ee=n.useMemo(()=>c.reduce((e,t,r)=>r>=W?e:e+t.height,0),[c,W]),et=i.invert||r,er="loading"===U;G.current=n.useMemo(()=>14*W+ee,[W,ee]),n.useEffect(()=>{C(!0)},[]),n.useEffect(()=>{if(h(i)){M("loading");let e=e=>{e.then(e=>{i.success&&"function"==typeof i.success&&D(i.success(e)),M("success")}).catch(e=>{M("error"),i.error&&"function"==typeof i.error&&D(i.error(e))})};i.promise instanceof Promise?e(i.promise):"function"==typeof i.promise&&e(i.promise())}},[i]);let en=n.useCallback(()=>{O(!0),A(G.current),u(e=>e.filter(e=>e.toastId!==i.id)),setTimeout(()=>{m(i)},200)},[i,m,u,G]);n.useEffect(()=>{let e;if((!i.promise||"loading"!==U)&&i.duration!==1/0)return p||s?(()=>{if(J.current<$.current){let e=new Date().getTime()-$.current;H.current=H.current-e}J.current=new Date().getTime()})():($.current=new Date().getTime(),e=setTimeout(()=>{var e;null==(e=i.onAutoClose)||e.call(i,i),en()},H.current)),()=>clearTimeout(e)},[p,s,k,i,V,en,i.promise,U]),n.useEffect(()=>{let e=q.current;if(e){let t=e.getBoundingClientRect().height;return L(t),u(e=>[{toastId:i.id,height:t},...e]),()=>u(e=>e.filter(e=>e.toastId!==i.id))}},[u,i.id]),n.useEffect(()=>{i.delete&&en()},[i.delete]);let ei=n.useMemo(()=>{if(!h(i))return null;switch(U){case"loading":return i.loading;case"success":return"function"==typeof i.success?N:i.success;case"error":return"function"==typeof i.error?N:i.error;default:return null}},[U,N]);return n.createElement("li",{"aria-live":i.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:q,className:v+" "+K,"data-sonner-toast":"","data-styled":!i.jsx,"data-mounted":E,"data-promise":!!i.promise,"data-removed":S,"data-visible":F,"data-y-position":X,"data-x-position":Z,"data-index":d,"data-front":z,"data-swiping":P,"data-type":"loading"!==U&&U?U:Q,"data-invert":et,"data-swipe-out":x,"data-expanded":!!(p||k&&E),style:{"--index":d,"--toasts-before":d,"--z-index":f.length-d,"--offset":`${S?T:G.current}px`,"--initial-height":k?"auto":`${I}px`,...g,...i.style},onPointerDown:e=>{er||(A(G.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(R(!0),Y.current=e.clientY))},onPointerUp:()=>{var e,t,r;if(!x){if(Math.abs(Number((null==(e=q.current)?void 0:e.style.getPropertyValue("--swipe-amount").replace("px",""))||0))>=20){A(G.current),null==(t=i.onDismiss)||t.call(i,i),en(),j(!0);return}null==(r=q.current)||r.style.setProperty("--swipe-amount","0px"),Y.current=null,R(!1)}},onPointerMove:e=>{var t,r;if(!Y.current)return;let n=e.clientY-Y.current;if(!("top"===X?n<0:n>0)){null==(t=q.current)||t.style.setProperty("--swipe-amount","0px");return}null==(r=q.current)||r.style.setProperty("--swipe-amount",`${n}px`)}},y&&!i.jsx?n.createElement("button",{"aria-label":"Close toast","data-disabled":er,"data-close-button":!0,onClick:er?void 0:()=>{var e;en(),null==(e=i.onDismiss)||e.call(i,i)}},n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,i.jsx||n.isValidElement(i.title)?i.jsx||i.title:n.createElement(n.Fragment,null,Q||i.icon||i.promise?n.createElement("div",{"data-icon":""},i.promise?n.createElement(a,{visible:"loading"===U}):null,i.icon||o(null!=U?U:i.type)):null,n.createElement("div",{"data-content":""},n.createElement("div",{"data-title":""},n.createElement(n.Fragment,null,null!=(t=i.title)?t:ei)),i.description?n.createElement("div",{"data-description":"",className:b+B},i.description):null),i.cancel?n.createElement("button",{"data-button":!0,"data-cancel":!0,onClick:()=>{var e;en(),null!=(e=i.cancel)&&e.onClick&&i.cancel.onClick()}},i.cancel.label):null,i.action?n.createElement("button",{"data-button":"",onClick:()=>{var e;en(),null==(e=i.action)||e.onClick()}},i.action.label):null))},m=e=>{var t;let{invert:r,position:o="bottom-right",hotkey:s=["altKey","KeyT"],expand:a,closeButton:u,className:l,offset:c,theme:f="light",richColors:h,duration:m,style:y,visibleToasts:g=3,toastOptions:v}=e,[b,w]=n.useState([]),[_,k]=n.useState([]),[E,C]=n.useState(!1),[S,O]=n.useState(!1),[P,R]=o.split("-"),x=n.useRef(null),j=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),U=n.useCallback(e=>w(t=>t.filter(({id:t})=>t!==e.id)),[]);return n.useEffect(()=>d.subscribe(e=>{if(e.dismiss){w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t));return}setTimeout(()=>{i.flushSync(()=>{w(t=>[e,...t])})})}),[]),n.useEffect(()=>{b.length<=1&&C(!1)},[b]),n.useEffect(()=>{let e=e=>{var t,r;s.every(t=>e[t]||e.code===t)&&(C(!0),null==(t=x.current)||t.focus()),"Escape"===e.code&&(document.activeElement===x.current||(null==(r=x.current)?void 0:r.contains(document.activeElement)))&&C(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s]),b.length?n.createElement("section",{"aria-label":`Notifications ${j}`,tabIndex:-1},n.createElement("ol",{tabIndex:-1,ref:x,className:l,"data-sonner-toaster":!0,"data-theme":f,"data-rich-colors":h,"data-y-position":P,"data-x-position":R,style:{"--front-toast-height":`${null==(t=_[0])?void 0:t.height}px`,"--offset":"number"==typeof c?`${c}px`:c||"32px","--width":"356px","--gap":"14px",...y},onMouseEnter:()=>C(!0),onMouseMove:()=>C(!0),onMouseLeave:()=>{S||C(!1)},onPointerDown:()=>{O(!0)},onPointerUp:()=>O(!1)},b.map((e,t)=>n.createElement(p,{key:e.id,index:t,toast:e,duration:m,className:null==v?void 0:v.className,descriptionClassName:null==v?void 0:v.descriptionClassName,invert:r,visibleToasts:g,closeButton:u,interacting:S,position:o,style:null==v?void 0:v.style,removeToast:U,toasts:b,heights:_,setHeights:k,expandByDefault:a,expanded:E})))):null}},7587:function(e){"use strict";e.exports={i8:"14.2.23"}}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[774,179],function(){return t(6840),t(3079)}),_N_E=e.O()}]);