1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`1b9af1b4240506c19e8bab89a5f49138bc87fa9a`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`993c0aa4-38ce-4785-961e-977a5f72237e`,e._sentryDebugIdIdentifier=`sentry-dbid-993c0aa4-38ce-4785-961e-977a5f72237e`)}catch{}})();import{n as e,s as t,t as n}from"./jsx-runtime-BAlirEoR.js";import{t as r}from"./client-DyjG1WOb.js";import{t as i}from"./react-dom-NC2T6g-y.js";import{g as a,m as o,p as s}from"./trpc-Dd9hbMqp.js";var c=class e extends Error{static kind=`ClerkError`;clerkError=!0;code;longMessage;docsUrl;cause;get name(){return this.constructor.name}constructor(t){super(new.target.formatMessage(new.target.kind,t.message,t.code,t.docsUrl),{cause:t.cause}),Object.setPrototypeOf(this,e.prototype),this.code=t.code,this.docsUrl=t.docsUrl,this.longMessage=t.longMessage,this.cause=t.cause}toString(){return`[${this.name}]\nMessage:${this.message}`}static formatMessage(e,t,n,r){let i=`Clerk:`,a=new RegExp(i.replace(` `,`\\s*`),`i`);return t=t.replace(a,``),t=`${i} ${t.trim()}\n\n(code="${n}")\n\n`,r&&(t+=`\n\nDocs: ${r}`),t}},l=class e extends c{static kind=`ClerkRuntimeError`;clerkRuntimeError=!0;constructor(t,n){super({...n,message:t}),Object.setPrototypeOf(this,e.prototype)}},u=Object.freeze({InvalidProxyUrlErrorMessage:`The proxyUrl passed to Clerk is invali
1d. 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 (key={{key}}, expected format: pk_test_... or pk_live_...). To create a Clerk application with valid keys, in your terminal run: 2 3 npx clerk@latest init 4 5It creates a Clerk application and writes keys to your .env file. Requires no Clerk account or login and the command is non-interactive. 6 7If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys (\`--instance prod\` for production keys). Or copy its Publishable key from https://dashboard.clerk.com/last-active?path=api-keys.`,MissingPublishableKeyErrorMessage:`Missing publishableKey. To set up Clerk for this project, in your terminal run: 8 9 npx clerk@latest init 10 11It creates a Clerk application and writes keys to your .env file. Requires no Clerk account or login and the command is non-interactive. 12 13If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com/last-active?path=api-keys. Deploy a production instance by running \`npx clerk@latest deploy\`, or \`npx clerk@latest env pull --instance prod\` to use an existing one.`,MissingSecretKeyErrorMessage:`Missing secretKey. To set up Clerk for this project, in your terminal run: 14 15 npx clerk@latest init 16 17It creates a Clerk application and writes keys to your .env file. Requires no Clerk account or login and the command is non-interactive. 18 19If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys. Or copy them from https://dashboard.clerk.com/last-active?path=api-keys. Deploy a production instance by running \`npx clerk@latest deploy\`, or \`npx clerk@latest env pull --instance prod\` to use an existing one.`,MissingClerkProvider:`{{source}} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider`});function d({packageName:e,customMessages:t}){let n=e;function r(e,t){if(!t)return`${n}: ${e}`;let r=e,i=e.matchAll(/{{([a-zA-Z0-9-_]+)}}/g);for(let e of i){let n=(t[e[1]]||``).toString();r=r.replace(`{{${e[1]}}}`,n)}return`${n}: ${r}`}let i={...u,...t};return{setPackageName({packageName:e}){return typeof e==`string`&&(n=e),this},setMessages({customMessages:e}){return Object.assign(i,e||{}),this},throwInvalidPublishableKeyError(e){throw Error(r(i.InvalidPublishableKeyErrorMessage,e))},throwInvalidProxyUrl(e){throw Error(r(i.InvalidProxyUrlErrorMessage,e))},throwMissingPublishableKeyError(){throw Error(r(i.MissingPublishableKeyErrorMessage))},throwMissingSecretKeyError(){throw Error(r(i.MissingSecretKeyErrorMessage))},throwMissingClerkProviderError(e){throw Error(r(i.MissingClerkProvider,e))},throw(e){throw Error(r(e))}}}var f=e=>!!e?.cloudflare?.env,p=e=>!!e?.env,m=(e,t)=>{if(typeof process<`u`&&typeof{}[e]==`string`)return{}[e];if(typeof{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_DEV_SERVER:`false`,TSS_DEV_SSR_STYLES_BASEPATH:`/`,TSS_DEV_SSR_STYLES_ENABLED:`true`,TSS_DISABLE_CSRF_MIDDLEWARE_WARNING:`false`,TSS_INLINE_CSS_ENABLED:`false`,TSS_ROUTER_BASEPATH:``,TSS_SERVER_FN_BASE:`/_serverFn/`,VITE_API_URL:`https://api.tabl.no/trpc`,VITE_CLERK_PUBLISHABLE_KEY:`pk_live_Y2xlcmsudGFibC5ubyQ`,VITE_NODE_ENV:`production`,VITE_SANITY_DATASET:`prod`,VITE_SENTRY_ENV:`staging`}[e]==`string`)return{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_DEV_SERVER:`false`,TSS_DEV_SSR_STYLES_BASEPATH:`/`,TSS_DEV_SSR_STYLES_ENABLED:`true`,TSS_DISABLE_CSRF_MIDDLEWARE_WARNING:`false`,TSS_INLINE_CSS_ENABLED:`false`,TSS_ROUTER_BASEPATH:``,TSS_SERVER_FN_BASE:`/_serverFn/`,VITE_API_URL:`https://api.tabl.no/trpc`,VITE_CLERK_PUBLISHABLE_KEY:`pk_live_Y2xlcmsudGFibC5ubyQ`,VITE_NODE_ENV:`production`,VITE_SANITY_DATASET:`prod`,VITE_SENTRY_ENV:`staging`}[e];if(f(t))return t.cloudflare.env[e]||``;if(p(t))return t.env[e]||``;if(t&&typeof t[e]==`string`)return t[e];try{return globalThis[e]}catch{}return``},h=()=>{try{return!1}catch{}return!1},g=()=>{try{return!1}catch{}return!1},_=()=>{try{return!0}catch{}return!1}
19,v=t(e(),1),y=t(i(),1),b=new Set,x=(e,t,n)=>{let r=g()||_(),i=n??e;b.has(i)||r||(b.add(i),console.warn(`Clerk - DEPRECATION WARNING: "${e}" is deprecated and will be removed in the next major release.\n${t}`))},S=[`.lcl.dev`,`.stg.dev`,`.lclstage.dev`,`.stgstage.dev`,`.dev.lclclerk.com`,`.stg.lclclerk.com`,`.accounts.lclclerk.com`,`accountsstage.dev`,`accounts.dev`],ee=e=>typeof atob<`u`&&typeof atob==`function`?atob(e):globalThis.Buffer===void 0?e:globalThis.Buffer.from(e,`base64`).toString(),C=`pk_live_`,w=`pk_test_`;function T(e){if(!e.endsWith(`$`))return!1;let t=e.slice(0,-1);return!t.includes(`$`)&&t.includes(`.`)}var E=`To create a Clerk application with valid keys, in your terminal run: 20 21 npx clerk@latest init 22 23It creates a Clerk application and writes keys to your .env file. Requires no Clerk account or login and the command is non-interactive. 24 25If you have a Clerk application, run \`npx clerk@latest env pull\` to write the keys (\`--instance prod\` for production keys). Or copy them from https://dashboard.clerk.com/last-active?path=api-keys.`;function D(e,t={}){if(e||=``,!e||!O(e)){if(t.fatal&&!e)throw Error(`Publishable key is missing. ${E}`);if(t.fatal&&!O(e))throw Error(`Publishable key not valid (expected format: pk_test_... or pk_live_...). ${E}`);return null}let n=e.startsWith(C)?`production`:`development`,r;try{r=ee(e.split(`_`)[2])}catch{if(t.fatal)throw Error(`Publishable key not valid: Failed to decode key. ${E}`);return null}if(!T(r)){if(t.fatal)throw Error(`Publishable key not valid: Decoded key has invalid format. ${E}`);return null}let i=r.slice(0,-1);return t.proxyUrl?i=t.proxyUrl:n!==`development`&&t.domain&&t.isSatellite&&(i=`clerk.${t.domain}`),{instanceType:n,frontendApi:i}}function O(e=``){try{if(!(e.startsWith(C)||e.startsWith(w)))return!1;let t=e.split(`_`);if(t.length!==3)return!1;let n=t[2];return n?T(ee(n)):!1}catch{return!1}}function te(){let e=new Map;return{isDevOrStagingUrl:t=>{if(!t)return!1;let n=typeof t==`string`?t:t.hostname,r=e.get(n);return r===void 0&&(r=S.some(e=>n.endsWith(e)),e.set(n,r)),r}}}var ne={initialDelay:125,maxDelayBetweenRetries:0,factor:2,shouldRetry:(e,t)=>t<5,retryImmediately:!1,jitter:!0},re=100,k=async e=>new Promise(t=>setTimeout(t,e)),ie=(e,t)=>t?e*(1+Math.random()):e,ae=e=>{let t=0,n=()=>{let n=e.initialDelay*e.factor**+t;return n=ie(n,e.jitter),Math.min(e.maxDelayBetweenRetries||n,n)};return async()=>{await k(n()),t++}},oe=async(e,t={})=>{let n=0,{shouldRetry:r,initialDelay:i,maxDelayBetweenRetries:a,factor:o,retryImmediately:s,jitter:c,onBeforeRetry:l}={...ne,...t},u=ae({initialDelay:i,maxDelayBetweenRetries:a,factor:o,jitter:c});for(;;)try{return await e()}catch(e){if(n++,!r(e,n))throw e;l&&await l(n),s&&n===1?await k(ie(re,c)):await u()}};function se(e){if(!e)return``;let t;if(e.match(/^(clerk\.)+\w*$/))t=/(clerk\.)*(?=clerk\.)/;else if(e.match(/\.clerk.accounts/))return e;else t=/^(clerk\.)*/gi;return`clerk.${e.replace(t,``)}`}function ce(e){if(typeof e==`boolean`)return e;if(e==null)return!1;if(typeof e==`string`){if(e.toLowerCase()===`true`)return!0;if(e.toLowerCase()===`false`)return!1}let t=parseInt(e,10);return!isNaN(t)&&t>0}function le(e){return!e||ue(e)||A(e)}function ue(e){return/^http(s)?:\/\//.test(e||``)}function A(e){return e.startsWith(`/`)}function de(e){return e?!A(e)||typeof window>`u`||!window.location?.origin?e:new URL(e,window.location.origin).toString():``}var fe={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`}},pe=new Set([`first_factor`,`second_factor`,`multi_factor`]),me=new Set([`strict_mfa`,`strict`,`moderate`,`lax`]),he=new Set([`o`,`org`,`organization`]),ge=new Set([`u`,`user`]),_e=e=>typeof e==`number`&&e>0,ve=e=>pe.has(e),ye=e=>me.has(e),be=e=>typeof e==`number`&&Number.isFinite(e)&&(e===-1||e>=0),xe=e=>e.replace(/^(org:)*/,`org:`),Se=(e,t)=>{let{orgId:n,orgRole:r,orgPermissions:i}=t,a=e.role!==void 0,o=e.permission!==void 0;return!a&&!o?`skip`:a&&typeof e.role!=`string`||o&&typeof e.permission!=`string`||!n||a&&(typeof r!=`string`||!r||xe(r)!==xe(e.role))||o&&(!Array.isArray(i)||!i.includes(xe(e.permission)))?`fail`:`pass`},Ce=(e,t)=>{let{org:n,user:r}=Te(e),[i,a]=t.split(`:`),o=a!==void 0,s=i,c=a||i;if(o&&!he.has(s)&&!ge.has(s))throw Error(`Invalid scope: ${s}`);if(o){if(he.has(s))return n.includes(c);if(ge.has(s))return r.includes(c)}return[...n,...r].includes(c)},we=(e,t)=>{let{features:n,plans:r}=t,i=e.feature!==void 0,a=e.plan!==void 0;if(!i&&!a)return`skip`;if(i&&typeof e.feature!=`string`||a&&typeof e.plan!=`string`)return`fail`;if(i){if(typeof n!=`string`||!n)return`fail`;try{if(!Ce(n,e.feature))return`fail`}catch{return`fail`}}if(a){if(typeof r!=`string`||!r)return`fail`;try{if(!Ce(r,e.plan))return`fail`}catch{return`fail`}}return`pass`},Te=e=>{let t=[],n=[];if(!e)return{org:t,user:n};let r=e.split(`,`);for(let e=0;e<r.length;e++){let i=r[e].trim(),a=i.indexOf(`:`);
25if(a===-1)throw Error(`Invalid claim element (missing colon): ${i}`);let o=i.slice(0,a),s=i.slice(a+1);o===`o`?t.push(s):o===`u`?n.push(s):(o===`ou`||o===`uo`)&&(t.push(s),n.push(s))}return{org:t,user:n}},Ee=e=>{if(!e)return!1;let t=e=>typeof e==`string`?fe[e]:e,n=typeof e==`string`&&ye(e),r=typeof e==`object`&&ve(e.level)&&_e(e.afterMinutes);return n||r?t.bind(null,e):!1},De=(e,{factorVerificationAge:t})=>{if(e.reverification===void 0)return`skip`;if(!t||!Array.isArray(t)||t.length!==2||!be(t[0])||!be(t[1]))return`fail`;let n=Ee(e.reverification);if(!n)return`fail`;let{level:r,afterMinutes:i}=n(),[a,o]=t;if(a===-1&&o===-1)return`fail`;let s=a!==-1&&i>a,c=o!==-1&&i>o;switch(r){case`first_factor`:return s?`pass`:`fail`;case`second_factor`:return o===-1?s?`pass`:`fail`:c?`pass`:`fail`;case`multi_factor`:return o===-1?s?`pass`:`fail`:a===-1?`fail`:s&&c?`pass`:`fail`}},Oe=e=>e.some(e=>e===`pass`)&&e.every(e=>e===`pass`||e===`skip`),ke=e=>t=>e.userId?Oe([Se(t,e),we(t,e),De(t,e)]):!1,Ae=({authObject:{sessionId:e,sessionStatus:t,userId:n,actor:r,orgId:i,orgRole:a,orgSlug:o,signOut:s,getToken:c,has:l,sessionClaims:u},options:{treatPendingAsSignedOut:d=!0}})=>{if(e===void 0&&n===void 0)return{actor:void 0,getToken:c,has:()=>!1,isLoaded:!1,isSignedIn:void 0,orgId:void 0,orgRole:void 0,orgSlug:void 0,sessionClaims:void 0,sessionId:e,signOut:s,userId:n};if(e===null&&n===null)return{actor:null,getToken:c,has:()=>!1,isLoaded:!0,isSignedIn:!1,orgId:null,orgRole:null,orgSlug:null,sessionClaims:null,sessionId:e,signOut:s,userId:n};if(d&&t===`pending`)return{actor:null,getToken:c,has:()=>!1,isLoaded:!0,isSignedIn:!1,orgId:null,orgRole:null,orgSlug:null,sessionClaims:null,sessionId:null,
25signOut:s,userId:null};if(e&&u&&n&&i&&a)return{actor:r||null,getToken:c,has:l,isLoaded:!0,isSignedIn:!0,orgId:i,orgRole:a,orgSlug:o||null,sessionClaims:u,sessionId:e,signOut:s,userId:n};if(e&&u&&n&&!i)return{actor:r||null,getToken:c,has:l,isLoaded:!0,isSignedIn:!0,orgId:null,orgRole:null,orgSlug:null,sessionClaims:u,sessionId:e,signOut:s,userId:n}},je=`METHOD_CALLED`,Me=.1;function Ne(e,t){return{event:je,eventSamplingRate:Me,payload:{method:e,...t}}}var Pe=class extends s{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Fe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=o({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),a.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Fe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ie=(e,t,n)=>!e&&n?Le(n):Re(t),Le=e=>{let t=e.userId,n=e.user,r=e.sessionId,i=e.sessionStatus,a=e.sessionClaims;return{userId:t,user:n,sessionId:r,session:e.session,sessionStatus:i,sessionClaims:a,organization:e.organization,orgId:e.orgId,orgRole:e.orgRole,orgPermissions:e.orgPermissions,orgSlug:e.orgSlug,actor:e.actor,factorVerificationAge:e.factorVerificationAge}},Re=e=>{let t=e.user?e.user.id:e.user,n=e.user,r=e.session?e.session.id:e.session,i=e.session,a=e.session?.status,o=e.session?e.session.lastActiveToken?.jwt?.claims:null,
25s=e.session?e.session.factorVerificationAge:null,c=i?.actor,l=e.organization,u=e.organization?e.organization.id:e.organization,d=l?.slug,f=l&&n?.organizationMemberships?.find(e=>e.organization.id===u),p=f&&f.permissions;return{userId:t,user:n,sessionId:r,session:i,sessionStatus:a,sessionClaims:o,organization:l,orgId:u,orgRole:f&&f.role,orgSlug:d,orgPermissions:p,actor:c,factorVerificationAge:s}},ze=`ClerkJS:`;function Be(){throw Error(`${ze} Clerk instance not found. Make sure Clerk is initialized before using any Clerk components.`)}var j=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ve=new class extends j{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},He={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},M=new class{#e=He;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Ue(e){setTimeout(e,0)}var We=typeof window>`u`||`Deno`in globalThis;function N(){}function Ge(e,t){return typeof e==`function`?e(t):e}function Ke(e){return typeof e==`number`&&e>=0&&e!==1/0}function qe(e,t){return Math.max(e+(t||0)-Date.now(),0)}function P(e,t){return typeof e==`function`?e(t):e}function F(e,t){return typeof e==`function`?e(t):e}function Je(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Xe(o,t.options))return!1}else if(!Ze(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ye(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(I(t.options.mutationKey)!==I(a))return!1}else if(!Ze(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Xe(e,t){return(t?.queryKeyHashFn||I)(e)}function I(e){return JSON.stringify(e,(e,t)=>nt(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Ze(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Ze(e[n],t[n])):!1}var Qe=Object.prototype.hasOwnProperty;function $e(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=tt(e)&&tt(t);if(!r&&!(nt(e)&&nt(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Qe.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=$e(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function et(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function tt(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function nt(e){if(!rt(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!rt(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function rt(e){return Object.prototype.toString.call(e)===`[object Object]`}function it(e){return new Promise(t=>{M.setTimeout(t,e)})}function at(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:$e(e,t)}function ot(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function st(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ct=Symbol();function lt(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ct?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ut(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var dt=(()=>{let e=()=>We;return{isServer(){return e()},setIsServer(t){e=t}}})();function ft(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var pt=Ue;function mt(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=pt,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>
25{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var L=mt(),ht=new class extends j{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function gt(e){return Math.min(1e3*2**e,3e4)}function _t(e){return(e??`online`)!==`online`||ht.isOnline()}var vt=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function yt(e){let t=!1,n=0,r,i=ft(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new vt(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Ve.isFocused()&&(e.networkMode===`always`||ht.isOnline())&&e.canRun(),u=()=>_t(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(dt.isServer()?0:3),o=e.retryDelay??gt,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),it(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var bt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ke(this.gcTime)&&(this.#e=M.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(dt.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(M.clearTimeout(this.#e),this.#e=void 0)}};function xt(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ut(e,()=>t.signal,()=>n=!0)},u=lt(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?st:ot;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Ct:St,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:St(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function St(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ct(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function wt(e,t){return t?St(e,t)!=null:!1}function Tt(e,t){return!t||!e.getPreviousPageParam?!1:Ct(e,t)!=null}var Et=class extends bt{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=kt(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=kt(this.options);e.data!==void 0&&(this.setState(Ot(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=at(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(N).catch(N):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>F(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ct||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdate
25Count>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>P(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!qe(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.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.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=lt(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?xt(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=yt({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof vt&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof vt){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Dt(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ot(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),L.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Dt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_t(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ot(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function kt(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdate
vendor: 4,622 bytes, line 25
25Count:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var At=class extends j{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=ft(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Mt(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Nt(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Nt(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof F(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!et(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Pt(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||F(this.options.enabled,this.#t)!==F(t.enabled,this.#t)||P(this.options.staleTime,this.#t)!==P(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||F(this.options.enabled,this.#t)!==F(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return It(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(N)),t}#g(){this.#b();let e=P(this.options.staleTime,this.#t);if(dt.isServer()||this.#r.isStale||!Ke(e))return;let t=qe(this.#r.dataUpdatedAt,e)+1;this.#d=M.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(dt.isServer()||F(this.options.enabled,this.#t)===!1||!Ke(this.#p)||this.#p===0)&&(this.#f=M.setInterval(()=>{(this.options.refetchIntervalInBackground||Ve.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(M.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(M.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Mt(e,t),o=i&&Pt(e,n,t,r);(a||o)&&(l={...l,...Dt(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=at(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=at(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdate
25Count:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Ft(e,t),refetch:this.refetch,promise:this.#o,isEnabled:F(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=ft();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a()}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!et(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){L.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function jt(e,t){return F(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||F(t.retryOnMount,e)!==!1)}function Mt(e,t){return jt(e,t)||e.state.data!==void 0&&Nt(e,t,t.refetchOnMount)}function Nt(e,t,n){if(F(t.enabled,e)!==!1&&P(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Ft(e,t)}return!1}function Pt(e,t,n,r){return(e!==t||F(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ft(e,n)}function Ft(e,t){return F(t.enabled,e)!==!1&&e.isStaleByTime(P(t.staleTime,e))}function It(e,t){return!et(e.getCurrentResult(),t)}var Lt=class extends At{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:wt(t,n.data),hasPreviousPage:Tt(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Rt=class extends bt{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||zt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=yt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});
25let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),L.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function zt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Bt=class extends j{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Rt({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Vt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Vt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Vt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Vt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>
vendor: 5,738 bytes, line 25
25t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){L.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ye(t,e))}findAll(e={}){return this.getAll().filter(t=>Ye(e,t))}notify(e){L.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return L.batch(()=>Promise.all(e.map(e=>e.continue().catch(N))))}};function Vt(e){return e.options.scope?.id}var Ht=class extends j{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Xe(r,t),a=this.get(i);return a||(a=new Et({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){L.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Je(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Je(e,t)):t}notify(e){L.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){L.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){L.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ut=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ht,this.#t=e.mutationCache||new Bt,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Ve.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ht.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(P(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Ge(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return L.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;L.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return L.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=L.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(N).catch(N)}invalidateQueries(e,t={}){return L.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=L.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(N)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(N)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(P(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(N).catch(N)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(N).catch(N)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ht.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(I(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Ze(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(I(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Ze(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Xe(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===ct&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Wt=Object.prototype.hasOwnProperty;function Gt(e,t,n){for(n of e.keys())if(R(n,t))return n}function R(e,t){var n,r,i;if(e===t)return!0;
25if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&R(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i==`object`&&(i=Gt(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i==`object`&&(i=Gt(t,i),!i)||!R(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e==`object`){for(n in r=0,e)if(Wt.call(e,n)&&++r&&!Wt.call(t,n)||!(n in t)||!R(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function Kt(e,t){if(!e)throw Error(typeof t==`string`?t:`${t.displayName} not found`)}var z=(e,t)=>{let{assertCtxFn:n=Kt}=t||{},r=v.createContext(void 0);return r.displayName=e,[r,()=>{let t=v.useContext(r);return n(t,`${e} not found`),t.value},()=>{let e=v.useContext(r);return e?e.value:{}}]},[qt,B]=z(`ClerkInstanceContext`),[Jt,Yt]=z(`InitialStateContext`);function Xt({children:e,initialState:t}){let[n]=(0,v.useState)(t),r=v.useMemo(()=>({value:n}),[n]);return v.createElement(Jt.Provider,{value:r},e)}function Zt(){let e=Yt();if(e instanceof Promise){if(`use`in v.default&&typeof v.use==`function`)return v.use(e);throw Error(`initialState cannot be a promise if React version is less than 19`)}return e}v.createContext({});var[Qt,$t]=z(`CheckoutContext`),en=({children:e,...t})=>v.createElement(Qt.Provider,{value:{value:t}},e);function tn(e){if(!v.useContext(qt)){if(typeof e==`function`){e();return}throw Error(`${e} can only be used within the <ClerkProvider /> component. 26 27Possible fixes: 281. Ensure that the <ClerkProvider /> is correctly wrapping your application where this component is used. 292. 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. 30 31Learn more: https://clerk.com/docs/components/clerk-provider`.trim())}}var nn={USER_MEMBERSHIPS_KEY:`userMemberships`,USER_INVITATIONS_KEY:`userInvitations`,USER_SUGGESTIONS_KEY:`userSuggestions`,DOMAINS_KEY:`domains`,MEMBERSHIP_REQUESTS_KEY:`membershipRequests`,MEMBERSHIPS_KEY:`memberships`,INVITATIONS_KEY:`invitations`,PLANS_KEY:`billing-plans`,SUBSCRIPTION_KEY:`billing-subscription`,PAYMENT_METHODS_KEY:`billing-payment-methods`,PAYMENT_ATTEMPTS_KEY:`billing-payment-attempts`,STATEMENTS_KEY:`billing-statements`,API_KEYS_KEY:`apiKeys`,ORGANIZATION_CREATION_DEFAULTS_KEY:`organizationCreationDefaults`,OAUTH_CONSENT_INFO_KEY:`oauthConsentInfo`,CREDIT_BALANCE_KEY:`billing-credit-balance`};function rn(e){return{queryKey:[e.stablePrefix,e.authenticated,e.tracked,e.untracked],invalidationKey:[e.stablePrefix,e.authenticated,e.tracked],stableKey:e.stablePrefix,authenticated:e.authenticated}}function an(e){if(e)return function(e){return e}}var on,sn=!1;function cn(){if(!(typeof window>`u`))return sn||=(on=new Ut,!0),on}function ln(e){let t=function(){},n;return n=new Proxy(t,{get(t,r){if(r!==`then`)return r===`toString`?()=>`[${e}]`:r===Symbol.toPrimitive?()=>0:n},apply(){return n},construct(){return n},has(){return!1},set(){return!1}}),n}var un=ln(`ClerkMockQueryClient`),dn=()=>{let e=cn();return[e??un,!!e]};function fn(e,t){let[n,r]=dn(),i=r?n.defaultQueryOptions(e):e;i._optimisticResults=`optimistic`;let a=v.useMemo(()=>new t(n,i),[n]),o=a.getOptimisticResult(i),s=e.subscribed!==!1;return v.useSyncExternalStore(v.useCallback(e=>{let t=s?a.subscribe(L.batchCalls(e)):N;return a.updateResult(),t},[a,s]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),v.useEffect(()=>{a.setOptions(i)},[i,a]),r?i.notifyOnChangeProps?o:a.trackResult(o):{data:void 0,error:null,isLoading:e.enabled!==!1,isFetching:!1,status:`pending`}}function pn(e){return fn(e,Lt)}function mn(e){return fn(e,At)}function hn(e){let t=(0,v.useRef)(e),n=(0,v.useRef)(null);return t.current!==e&&(n.current=t.current,t.current=e),n.current}var gn=e=>[e,`${e}-inf`];function _n(e){let{isSignedOut:t,stableKeys:n,authenticated:r=!0,onCleanup:i}
31=e,a=(0,v.useRef)(n),[o]=dn(),s=hn(!t);(0,v.useEffect)(()=>{r===!0&&s&&t===!0&&(o.removeQueries({predicate:e=>{let[t,n]=e.queryKey;return n===!0&&typeof t==`string`&&(Array.isArray(a.current)?a.current.includes(t):a.current===t)}}),i?.())},[r,t,s,o])}var vn=(e,t)=>{let n=typeof e==`boolean`&&e,r=(0,v.useRef)(n?t.initialPage:e?.initialPage??t.initialPage),i=(0,v.useRef)(n?t.pageSize:e?.pageSize??t.pageSize),a={};for(let r of Object.keys(t))a[r]=n?t[r]:e?.[r]??t[r];return{...a,initialPage:r.current,pageSize:i.current}};function yn(e,t){return(e-1)*t}function bn(e,t,n){return Math.ceil((e-t)/n)}function xn(e,t,n,r){return e-t>n*r}function Sn(e,t,n){return(e-1)*t>n}var Cn=e=>{let{fetcher:t,config:n,keys:r}=e,[i,a]=(0,v.useState)(n.initialPage??1),o=(0,v.useRef)(n.initialPage??1),s=(0,v.useRef)(n.pageSize??10),c=n.enabled??!0,l=n.isSignedIn,u=n.infinite??!1,d=n.__experimental_mode===`cache`,f=n.keepPreviousData??!1,[p]=dn(),m=c&&!!t&&!d&&l!==!1,[h,g]=(0,v.useState)(0),_=(0,v.useCallback)(e=>{g(e)},[]),y=(0,v.useMemo)(()=>{let[e,t,n,a]=r.queryKey;return[e,t,n,{...a,args:{...a.args,initialPage:i,pageSize:s.current}}]},[r.queryKey,i]),b=mn({queryKey:y,queryFn:({queryKey:e})=>{let{args:n}=e[3];if(t)return t(n)},staleTime:6e4,enabled:m&&!u,placeholderData:an(f)}),x=(0,v.useMemo)(()=>{let[e,t,n,i]=r.queryKey;return[e+`-inf`,t,n,i]},[r.queryKey]),S=pn({queryKey:x,initialPageParam:n.initialPage??1,getNextPageParam:(e,t,r)=>{let i=e?.total_count??0;return(t.length+(n.initialPage?n.initialPage-1:0))*(n.pageSize??10)<i?r+1:void 0},queryFn:({pageParam:e,queryKey:n})=>{let{args:r}=n[3];if(t)return t({...r,initialPage:e,pageSize:s.current})},staleTime:6e4,enabled:m&&u});_n({isSignedOut:l===!1,authenticated:r.authenticated,stableKeys:gn(r.stableKey),onCleanup:()=>{a(o.current),Promise.resolve().then(()=>_(e=>e+1))}});let{data:ee,count:C,page:w}=(0,v.useMemo)(()=>{if(u){let e=p.getQueryData(x),t=m?S.data?.pages??e?.pages??[]:e?.pages??[],n=Array.isArray(t)?t.filter(Boolean):[];return{data:n.map(e=>e?.data).flat().filter(Boolean)??[],count:n[n.length-1]?.total_count??0,page:n.length>0?n.length:o.current}}let e=m?b.data??p.getQueryData(y):p.getQueryData(y);return{data:Array.isArray(e?.data)?e.data:[],count:typeof e?.total_count==`number`?e.total_count:0,page:i}},[m,h,u,S.data?.pages,b.data,p,x,y,i]),T=(0,v.useCallback)(e=>{if(u){let t=typeof e==`function`?e(w):e,n=Math.max(0,t),r=p.getQueryData(x);n-(S.data?.pages??r?.pages??[]).length>0&&S.fetchNextPage({cancelRefetch:!1});return}return a(e)},[S,w,u,p,x]),E=u?S.isLoading:b.isLoading,D=u?S.isFetching:b.isFetching,O=(u?S.error:b.error)??null,te=!!O,ne=(0,v.useCallback)(()=>{if(u){S.fetchNextPage({cancelRefetch:!1});return}a(e=>Math.max(0,e+1))},[S,u]),re=(0,v.useCallback)(()=>{u||a(e=>Math.max(0,e-1))},[u]),k=yn(o.current,s.current);return{data:ee,count:C,error:O,isLoading:E,isFetching:D,isError:te,page:w,pageCount:bn(C,k,s.current),fetchPage:T,fetchNext:ne,fetchPrevious:re,hasNextPage:u?!!S.hasNextPage:xn(C,k,w,s.current),hasPreviousPage:u?!!S.hasPreviousPage:Sn(w,s.current,k),revalidate:async()=>{await p.invalidateQueries({queryKey:r.invalidationKey});let[e,...t]=r.invalidationKey;return p.invalidateQueries({queryKey:[e+`-inf`,...t]})},setData:e=>u?(p.setQueryData(x,(t={})=>{let n=Array.isArray(t?.pages)?t.pages:[],r=typeof e==`function`?e(n):e;return{...t,pages:r}}),_(e=>e+1),Promise.resolve()):(p.setQueryData(y,(t={data:[],total_count:0})=>typeof e==`function`?e(t):e),_(e=>e+1),Promise.resolve())}};function wn(){let e=B(),t=Zt(),n=(0,v.useCallback)(()=>t?.user,[t?.user]);return(0,v.useSyncExternalStore)((0,v.useCallback)(t=>e.addListener(t,{skipInitialEmit:!0}),[e]),(0,v.useCallback)(()=>!e.loaded||!e.__internal_lastEmittedResources?n():e.__internal_lastEmittedResources.user,[e,n]),n)}function Tn(){let e=B(),t=Zt(),n=(0,v.useCallback)(()=>t?.organization,[t?.organization]);return(0,v.useSyncExternalStore)((0,v.useCallback)(t=>e.addListener(t,{skipInitialEmit:!0}),[e]),(0,v.useCallback)(()=>!e.loaded||!e.__internal_lastEmittedResources?n():e.__internal_lastEmittedResources.organization,[e,n]),n)}typeof window<`u`?v.useLayoutEffect:v.useEffect;var En=`useUser`;function Dn(){tn(En);let e=wn();return B().telemetry?.record(Ne(En)),e===void 0?{isLoaded:!1,isSignedIn:void 0,user:void 0}:e===null?{isLoaded:!0,isSignedIn:!1,user:null}:{isLoaded:!0,isSignedIn:!0,user:e}}var On=R;function kn(e){let t=B(),n=e?.enabled??!0,r=t.__internal_environment,i=wn(),a=Tn(),o=r?.commerceSettings.billing.user.enabled,s=r?.commerceSettings.billing.organization.enabled,c=e?.for===`organization`?s:e?.for===`user`?o:o||s,l=e?.for===`organization`,u=e?.authenticated??!0?(!l||!!a?.id)&&!!i?.id:!0;return c&&n&&t.loaded&&u}function An({hookName:e,resourceType:t,useFetcher:n,options:r}){return function(i){let{for:a,enabled:o,...s}=i||{},c=a||`user`;tn(e);let l=n(c),u=vn(s,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1,__experimental_mode:void 0}),d=B(),f=wn(),p=Tn();d.telemetry?.record(Ne(e));let m=c===`organization`,h=kn({for:c,enabled:o,authenticated:!r?.unauthenticated}),g=s===void 0?void 0:{initialPage:u.initialPage,pageSize:u.pageSize,...r?.unauthenticated?{}:m?{orgId:p?.id}:{}},_=!!g&&d.loaded&&!!h;return Cn({fetcher:l,config:{keepPreviousData:u.keepPreviousData,infinite:u.infinite,enabled:_,...r?.unauthenticated?{}:{isSignedIn:f!==null},__experimental_mode:u.__experimental_mode,initialPage:u.initialPage,pageSize:u.pageSize},keys:rn({stablePrefix:t,authenticated:!r?.unauthenticated,tracked:r?.unauthenticated?{for:c}:{userId:f?.id,...m?{orgId:p?.id}:{}},untracked:{args:g}})})}}
31An({hookName:`useStatements`,resourceType:nn.STATEMENTS_KEY,useFetcher:()=>{let e=B();if(e.loaded)return e.billing.getStatements}}),An({hookName:`usePaymentAttempts`,resourceType:nn.PAYMENT_ATTEMPTS_KEY,useFetcher:()=>{let e=B();if(e.loaded)return e.billing.getPaymentAttempts}}),An({hookName:`usePaymentMethods`,resourceType:nn.PAYMENT_METHODS_KEY,useFetcher:e=>{let t=Tn(),n=wn();return e===`organization`?t?.getPaymentMethods:n?.getPaymentMethods}}),An({hookName:`usePlans`,resourceType:nn.PLANS_KEY,useFetcher:e=>{let t=B();if(t.loaded)return n=>t.billing.getPlans({...n,for:e})},options:{unauthenticated:!0}});function jn(e){e||Be()}function Mn(e){let t=e.clerk;if(jn(t),e.initialState instanceof Promise&&!(`use`in v.default&&typeof v.use==`function`))throw Error(`initialState cannot be a promise if React version is less than 19`);let n=v.useMemo(()=>({value:t}),[e.clerkStatus]);return v.createElement(Xt,{initialState:e.initialState},v.createElement(qt.Provider,{value:n},v.createElement(en,{value:void 0},e.children)))}var Nn=e=>{let t=(0,v.useRef)(e);return(0,v.useEffect)(()=>{t.current=e},[e]),t.current},V=(e,t,n)=>{let r=!!n,i=(0,v.useRef)(n);(0,v.useEffect)(()=>{i.current=n},[n]),(0,v.useEffect)(()=>{if(!r||!e)return()=>{};let n=(...e)=>{i.current&&i.current(...e)};return e.on(t,n),()=>{e.off(t,n)}},[r,t,e,i])},Pn=v.createContext(null);Pn.displayName=`ElementsContext`;var Fn=(e,t)=>{if(!e)throw Error(`Could not find Elements context; You need to wrap the part of your app that ${t} in an <Elements> provider.`);return e},In=e=>typeof e==`object`&&!!e,Ln=(e,t,n)=>In(e)?Object.keys(e).reduce((r,i)=>{let a=!In(t)||!zn(e[i],t[i]);return n.includes(i)?(a&&console.warn(`Unsupported prop change: options.${i} is not a mutable property.`),r):a?{...r||{},[i]:e[i]}:r},null):null,Rn=`[object Object]`,zn=(e,t)=>{if(!In(e)||!In(t))return e===t;let n=Array.isArray(e);if(n!==Array.isArray(t))return!1;let r=Object.prototype.toString.call(e)===Rn;if(r!==(Object.prototype.toString.call(t)===Rn))return!1;if(!r&&!n)return e===t;let i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;let o={};for(let e=0;e<i.length;e+=1)o[i[e]]=!0;for(let e=0;e<a.length;e+=1)o[a[e]]=!0;let s=Object.keys(o);if(s.length!==i.length)return!1;let c=e,l=t;return s.every(e=>zn(c[e],l[e]))},Bn=e=>Fn(v.useContext(Pn),e),Vn=e=>e.charAt(0).toUpperCase()+e.slice(1);((e,t)=>{let n=`${Vn(e)}Element`,r=t?e=>{Bn(`mounts <${n}>`);let{id:t,className:r}=e;return v.createElement(`div`,{id:t,className:r})}:({id:t,className:r,fallback:i,options:a={},onBlur:o,onFocus:s,onReady:c,onChange:l,onEscape:u,onClick:d,onLoadError:f,onLoaderStart:p,onNetworksChange:m,onConfirm:h,onCancel:g,onShippingAddressChange:_,onShippingRateChange:y})=>{let b=Bn(`mounts <${n}>`),x=`elements`in b?b.elements:null,[S,ee]=v.useState(null),C=v.useRef(null),w=v.useRef(null),[T,E]=(0,v.useState)(!1);V(S,`blur`,o),V(S,`focus`,s),V(S,`escape`,u),V(S,`click`,d),V(S,`loaderror`,f),V(S,`loaderstart`,p),V(S,`networkschange`,m),V(S,`confirm`,h),V(S,`cancel`,g),V(S,`shippingaddresschange`,_),V(S,`shippingratechange`,y),V(S,`change`,l);let D;c&&(D=()=>{E(!0),c(S)}),V(S,`ready`,D),v.useLayoutEffect(()=>{if(C.current===null&&w.current!==null&&x){let t=null;x&&(t=x.create(e,a)),C.current=t,ee(t),t&&t.mount(w.current)}},[x,a]);let O=Nn(a);return v.useEffect(()=>{if(!C.current)return;let e=Ln(a,O,[`paymentRequest`]);e&&`update`in C.current&&C.current.update(e)},[a,O]),v.useLayoutEffect(()=>()=>{if(C.current&&typeof C.current.destroy==`function`)try{C.current.destroy(),C.current=null}catch{}},[]),v.createElement(v.Fragment,null,!T&&i,v.createElement(`div`,{id:t,style:{height:T?`unset`:`0px`,visibility:T?`visible`:`hidden`},className:r,ref:w}))};return r.displayName=n,r.__elementType=e,r})(`payment`,typeof window>`u`);var[Hn,Un]=z(`PaymentElementContext`),[Wn,Gn]=z(`StripeUtilsContext`),[Kn,,qn]=z(`PortalProvider`),Jn=()=>{let e=qn();return e&&`getContainer`in e&&e.getContainer?e.getContainer:()=>null},H=d({packageName:`@clerk/react`});function Yn(e){H.setMessages(e).setPackageName(e)}var Xn=B,Zn=e=>{tn(()=>{H.throwMissingClerkProviderError({source:e})})};function Qn(e,t,n){if(typeof e==`function`)return e(t);if(e!==void 0)return e;if(n!==void 0)return n}var U=e=>{h()&&console.error(`Clerk: ${e}`)},$n=(e,...t)=>{let n={...e};for(let e of t)delete n[e];return n};function W(){return typeof window<`u`}new 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`.split(`.`).join(`|`),`i`);var er=`You've added multiple <ClerkProvider> components in your React component tree. Wrap your components in a single <ClerkProvider>.`,tr=e=>`You've passed multiple children components to <${e}/>. You can only pass a single child component or text.`,nr=`Invalid state. Feel free to submit a bug or reach out to supp
31ort here: https://clerk.com/contact/support`,rr=`Unsupported usage of isSatellite, domain or proxyUrl. The usage of isSatellite, domain or proxyUrl as function is not supported in non-browser environments.`,ir="<UserProfile.Page /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.",ar="<UserProfile.Link /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.",or="<OrganizationProfile.Page /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.",sr="<OrganizationProfile.Link /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.",cr=e=>`<${e} /> can only accept <${e}.Page /> and <${e}.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`,lr=e=>`Missing props. <${e}.Page /> component requires the following props: url, label, labelIcon, alongside with children to be rendered inside the page.`,ur=e=>`Missing props. <${e}.Link /> component requires the following props: url, label and labelIcon.`,dr=`<UserButton /> can only accept <UserButton.UserProfilePage />, <UserButton.UserProfileLink /> and <UserButton.MenuItems /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`,fr=`<UserButton.MenuItems /> component can only accept <UserButton.Action /> and <UserButton.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`,pr="<UserButton.MenuItems /> component needs to be a direct child of `<UserButton />`.",mr="<UserButton.Action /> component needs to be a direct child of `<UserButton.MenuItems />`.",hr="<UserButton.Link /> component needs to be a direct child of `<UserButton.MenuItems />`.",gr=`Missing props. <UserButton.Link /> component requires the following props: href, label and labelIcon.`,_r=`Missing props. <UserButton.Action /> component requires the following props: label.`,G=e=>t=>{try{return v.Children.only(e)}catch{let n=v.Children.toArray(e);return n.length===1&&v.isValidElement(n[0])?n[0]:H.throw(tr(t))}},K=(e,t)=>(e||=t,typeof e==`string`&&(e=v.createElement(`button`,null,e)),e),q=e=>(...t)=>{if(e&&typeof e==`function`)return e(...t)},vr=e=>m(`VITE_${e}`)||m(e),yr=(e,t)=>
31e===void 0?vr(t)||void 0:e,br=e=>{let t=yr(e.publishableKey,`CLERK_PUBLISHABLE_KEY`);return{...e,...t!==void 0&&{publishableKey:t}}};function xr(e){return typeof e==`function`}var J=e=>{let[t,n]=(0,v.useState)(new Map),r=(0,v.useRef)(t),i=(0,v.useRef)(new Map),a=(0,v.useRef)(new Map);r.current=t,i.current=new Map(e.map(e=>[e.id,e.component]));let o=new Set(e.map(e=>e.id));return a.current.forEach((e,t)=>{o.has(t)||a.current.delete(t)}),e.map(e=>{let t=e.id,o=a.current.get(t);if(o)return o;let s={id:e.id,mount:e=>n(n=>new Map(n).set(t,e)),unmount:()=>n(e=>{let n=new Map(e);return n.set(t,null),n}),portal:()=>{let e=r.current.get(t),n=i.current.get(t);return e?(0,y.createPortal)(n,e):null}};return a.current.set(t,s),s})},Y=(e,t)=>!!e&&v.isValidElement(e)&&e?.type===t,Sr=(e,t)=>Tr({children:e,reorderItemsLabels:[`account`,`security`,`billing`,`apiKeys`],LinkComponent:Hr,PageComponent:Vr,MenuItemsComponent:Kr,componentName:`UserProfile`},t),Cr=(e,t)=>Tr({children:e,reorderItemsLabels:[`general`,`members`,`billing`,`apiKeys`],LinkComponent:Qr,PageComponent:Zr,componentName:`OrganizationProfile`},t),wr=e=>{let t=[],n=[Qr,Zr,Kr,Vr,Hr];return v.Children.forEach(e,e=>{n.some(t=>Y(e,t))||t.push(e)}),t},Tr=(e,t)=>{let{children:n,LinkComponent:r,PageComponent:i,MenuItemsComponent:a,reorderItemsLabels:o,componentName:s}=e,{allowForAnyChildren:c=!1}=t||{},l=[],u=new Map;v.Children.forEach(n,e=>{if(!Y(e,i)&&!Y(e,r)&&!Y(e,a)){e&&!c&&U(cr(s));return}let{props:t}=e,{children:n,label:d,url:f,labelIcon:p}=t,m=e.key;if(Y(e,i)){if(Dr(t,o))l.push({label:d});else if(Or(t))l.push({label:d,labelIcon:p,children:n,url:f,portalId:Er(`page`,t,m,u)});else{U(lr(s));return}}if(Y(e,r)){if(kr(t))l.push({label:d,labelIcon:p,url:f,portalId:Er(`link`,t,m,u)});else{U(ur(s));return}}});let d=[],f=[],p=[];l.forEach((e,t)=>{if(Or(e)){d.push({component:e.children,id:e.portalId||t}),f.push({component:e.labelIcon,id:e.portalId||t});return}kr(e)&&p.push({component:e.labelIcon,id:e.portalId||t})});let m=J(d),h=J(f),g=J(p),_=[],y=[];return l.forEach((e,t)=>{if(Dr(e,o)){_.push({label:e.label});return}if(Or(e)){let{portal:n,mount:r,unmount:i}=m.find(n=>n.id===(e.portalId||t)),{portal:a,mount:o,unmount:s}=h.find(n=>n.id===(e.portalId||t));_.push({label:e.label,url:e.url,mount:r,unmount:i,mountIcon:o,unmountIcon:s}),y.push({key:`content:${e.portalId||t}`,portal:n}),y.push({key:`label:${e.portalId||t}`,portal:a});return}if(kr(e)){let{portal:n,mount:r,unmount:i}=g.find(n=>n.id===(e.portalId||t));_.push({label:e.label,url:e.url,mountIcon:r,unmountIcon:i}),y.push({key:`label:${e.portalId||t}`,portal:n});return}}),{customPages:_,customPagesPortals:y}},Er=(e,t,n,r)=>{if(n!=null)return`${e}:key:${n}`;let i=`${e}:${t.label}:${t.url}`,a=r.get(i)??0;return r.set(i,a+1),`${i}:${a}`},Dr=(e,t)=>{let{children:n,label:r,url:i,labelIcon:a}=e;return!n&&!i&&!a&&t.some(e=>e===r)},Or=e=>{let{children:t,label:n,url:r,labelIcon:i}=e;return!!t&&!!r&&!!i&&!!n},kr=e=>{let{children:t,label:n,url:r,labelIcon:i}=e;return!t&&!!r&&!!i&&!!n},Ar=(e,t)=>jr({children:e,reorderItemsLabels:[`manageAccount`,`signOut`],MenuItemsComponent:Kr,MenuActionComponent:qr,MenuLinkComponent:Jr,UserProfileLinkComponent:Hr,UserProfilePageComponent:Vr,allowForAnyChildren:t?.allowForAnyChildren??!1}),jr=({children:e,MenuItemsComponent:t,MenuActionComponent:n,MenuLinkComponent:r,UserProfileLinkComponent:i,UserProfilePageComponent:a,reorderItemsLabels:o,allowForAnyChildren:s=!1})=>{let c=[],l=[],u=[],d=new Map;v.Children.forEach(e,e=>{if(!Y(e,t)&&!Y(e,i)&&!Y(e,a)){e&&!s&&U(dr);return}if(Y(e,i)||Y(e,a))return;let{props:l}=e;v.Children.forEach(l.children,e=>{if(!Y(e,n)&&!Y(e,r)){e&&U(fr);return}let{props:t}=e,i=e.key,{label:a,labelIcon:s,href:l,onClick:u,open:f}=t;if(Y(e,n)){if(Nr(t,o))c.push({label:a});else if(Pr(t)){let e={label:a,labelIcon:s};if(u!==void 0)c.push({...e,onClick:u,portalId:Mr(`action`,t,i,d)});else if(f!==void 0)c.push({...e,open:f.startsWith(`/`)?f:`/${f}`,portalId:Mr(`action`,t,i,d)});else{U(`Custom menu item must have either onClick or open property`);return}}else{U(_r);return}}if(Y(e,r)){if(Fr(t))c.push({label:a,labelIcon:s,href:l,portalId:Mr(`link`,t,i,d)});else{U(gr);return}}})});let f=[],p=[];
31c.forEach((e,t)=>{Pr(e)&&f.push({component:e.labelIcon,id:e.portalId||t}),Fr(e)&&p.push({component:e.labelIcon,id:e.portalId||t})});let m=J(f),h=J(p);return c.forEach((e,t)=>{if(Nr(e,o)&&l.push({label:e.label}),Pr(e)){let{portal:n,mount:r,unmount:i}=m.find(n=>n.id===(e.portalId||t)),a={label:e.label,mountIcon:r,unmountIcon:i};`onClick`in e?a.onClick=e.onClick:`open`in e&&(a.open=e.open),l.push(a),u.push({key:`icon:${e.portalId||t}`,portal:n})}if(Fr(e)){let{portal:n,mount:r,unmount:i}=h.find(n=>n.id===(e.portalId||t));l.push({label:e.label,href:e.href,mountIcon:r,unmountIcon:i}),u.push({key:`icon:${e.portalId||t}`,portal:n})}}),{customMenuItems:l,customMenuItemsPortals:u}},Mr=(e,t,n,r)=>{if(n!=null)return`${e}:key:${n}`;let i=t.href||t.open||``,a=`${e}:${t.label}:${i}`,o=r.get(a)??0;return r.set(a,o+1),`${a}:${o}`},Nr=(e,t)=>{let{children:n,label:r,onClick:i,labelIcon:a}=e;return!n&&!i&&!a&&t.some(e=>e===r)},Pr=e=>{let{label:t,labelIcon:n,onClick:r,open:i}=e;return!!n&&!!t&&(typeof r==`function`||typeof i==`string`)},Fr=e=>{let{label:t,href:n,labelIcon:r}=e;return!!n&&!!r&&!!t},Ir=(e=>{let t=e?.isReady;return n=>new Promise((r,i)=>{let{root:a=document?.body,selector:o,timeout:s=0}=n;if(!a){i(Error(`No root element provided`));return}let c=a;if(o&&(c=a?.querySelector(o)),t(c,o)){r();return}let l=new MutationObserver(n=>{for(let i of n)if(!c&&o&&(c=a?.querySelector(o)),(e.childList&&i.type===`childList`||e.attributes&&i.type===`attributes`)&&t(c,o)){l.disconnect(),r();return}});l.observe(a,e),s>0&&setTimeout(()=>{l.disconnect(),i(Error(`Timeout waiting for ${o}`))},s)})})({childList:!0,subtree:!0,isReady:(e,t)=>!!e?.childElementCount&&e?.matches?.(t)&&e.childElementCount>0});function X(e,t){let n=(0,v.useRef)(),[r,i]=(0,v.useState)(`rendering`);return(0,v.useEffect)(()=>{if(!e)throw Error(`Clerk: no component name provided, unable to detect mount.`);if(typeof window<`u`&&!n.current){let r=`[data-clerk-component="${e}"]`,a=t?.selector;n.current=Ir({selector:a?r+a:r}).then(()=>{i(`rendered`)}).catch(()=>{i(`error`)})}},[e,t?.selector]),r}var Lr=e=>`mount`in e,Rr=e=>`open`in e,zr=e=>e?.map(({mountIcon:e,unmountIcon:t,...n})=>n),Z=class extends v.PureComponent{constructor(...e){super(...e),this.rootRef=v.createRef()}componentDidUpdate(e){if(!Lr(e)||!Lr(this.props))return;let t=$n(e.props||{},`customPages`,`customMenuItems`,`children`),n=$n(this.props.props||{},`customPages`,`customMenuItems`,`children`),r=e.props?.customPages?.length!==this.props.props?.customPages?.length,i=e.props?.customMenuItems?.length!==this.props.props?.customMenuItems?.length,a=zr(e.props?.customMenuItems),o=zr(this.props.props?.customMenuItems);(!On(t,n)||!On(a,o)||r||i)&&this.rootRef.current&&this.props.updateProps({node:this.rootRef.current,props:this.props.props})}componentDidMount(){this.rootRef.current&&(Lr(this.props)&&this.props.mount(this.rootRef.current,this.props.props),Rr(this.props)&&this.props.open(this.props.props))}componentWillUnmount(){this.rootRef.current&&(Lr(this.props)&&this.props.unmount(this.rootRef.current),Rr(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 v.createElement(v.Fragment,null,!e&&v.createElement(`div`,t),this.props.children)}},Q=(e,t)=>{let n=(typeof t==`string`?t:t?.component)||e.displayName||e.name||`Component`;e.displayName=n;let r=typeof t==`string`?void 0:t,i=t=>{Zn(n||`withClerk`);let i=Xn(),a=Jn();return!i.loaded&&!r?.renderWhileLoading?null:v.createElement(e,{getContainer:a,...t,component:n,clerk:i})};return i.displayName=`withClerk(${n})`,i},Br=e=>v.createElement(v.Fragment,null,e?.customPagesPortals?.map(({key:e,portal:t})=>(0,v.createElement)(t,{key:e})),e?.customMenuItemsPortals?.map(({key:e,portal:t})=>(0,v.createElement)(t,{key:e})));Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return v.createElement(v.Fragment,null,i&&n,e.loaded&&v.createElement(Z,{component:t,mount:e.mountSign
31In,unmount:e.unmountSignIn,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`SignIn`,renderWhileLoading:!0}),Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return v.createElement(v.Fragment,null,i&&n,e.loaded&&v.createElement(Z,{component:t,mount:e.mountSignUp,unmount:e.unmountSignUp,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`SignUp`,renderWhileLoading:!0});function Vr({children:e}){return U(ir),v.createElement(v.Fragment,null,e)}function Hr({children:e}){return U(ar),v.createElement(v.Fragment,null,e)}var Ur=Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}},{customPages:o,customPagesPortals:s}=Sr(r.children);return v.createElement(v.Fragment,null,i&&n,v.createElement(Z,{component:t,mount:e.mountUserProfile,unmount:e.unmountUserProfile,updateProps:e.__internal_updateProps,props:{...r,customPages:o},rootProps:a},v.createElement(Br,{customPagesPortals:s})))},{component:`UserProfile`,renderWhileLoading:!0});Object.assign(Ur,{Page:Vr,Link:Hr});var Wr=(0,v.createContext)({mount:()=>{},unmount:()=>{},updateProps:()=>{}}),Gr=Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}},{customPages:o,customPagesPortals:s}=Sr(r.children,{allowForAnyChildren:!!r.__experimental_asProvider}),c={...r.userProfileProps,customPages:o},{customMenuItems:l,customMenuItemsPortals:u}=Ar(r.children,{allowForAnyChildren:!!r.__experimental_asProvider}),d=wr(r.children),f={mount:e.mountUserButton,unmount:e.unmountUserButton,updateProps:e.__internal_updateProps,props:{...r,userProfileProps:c,customMenuItems:l}},p={customPagesPortals:s,customMenuItemsPortals:u};return v.createElement(Wr.Provider,{value:f},i&&n,e.loaded&&v.createElement(Z,{component:t,...f,hideRootHtmlElement:!!r.__experimental_asProvider,rootProps:a},r.__experimental_asProvider?d:null,v.createElement(Br,p)))},{component:`UserButton`,renderWhileLoading:!0});function Kr({children:e}){return U(pr),v.createElement(v.Fragment,null,e)}function qr({children:e}){return U(mr),v.createElement(v.Fragment,null,e)}function Jr({children:e}){return U(hr),v.createElement(v.Fragment,null,e)}function Yr(e){let t=(0,v.useContext)(Wr),n={...t,props:{...t.props,...e}};return v.createElement(Z,n)}var Xr=Object.assign(Gr,{UserProfilePage:Vr,UserProfileLink:Hr,MenuItems:Kr,Action:qr,Link:Jr,__experimental_Outlet:Yr});function Zr({children:e}){return U(or),v.createElement(v.Fragment,null,e)}function Qr({children:e}){return U(sr),v.createElement(v.Fragment,null,e)}var $r=Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}},{customPages:o,customPagesPortals:s}=Cr(r.children);return v.createElement(v.Fragment,null,i&&n,e.loaded&&v.createElement(Z,{component:t,mount:e.mountOrganizationProfile,unmount:e.unmountOrganizationProfile,updateProps:e.__internal_updateProps,props:{...r,customPages:o},rootProps:a},v.createElement(Br,{customPagesPortals:s})))},{component:`OrganizationProfile`,renderWhileLoading:!0});Object.assign($r,{Page:Zr,Link:Qr}),Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return v.createElement(v.Fragment,null,i&&n,e.loaded&&v.createElement(Z,{component:t,mount:e.mountCreateOrganization,unmount:e.unmountCreateOrganization,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`CreateOrganization`,renderWhileLoading:!0});var ei=(0,v.createContext)({mount:()=>{},unmount:()=>{},updateProps:()=>{}}),ti=Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}},{customPages:o,customPagesPortals:s}=Cr(r.children,{allowForAnyChildren:!!r.__experimental_asProvider}),c={...r.organizationProfileProps,customPages:o},l=wr(r.children),u={mount:e.mountOrganizationSwitcher,unmount:e.unmountOrganizationSwitcher,updateProps:e.__internal_updateProps,props:{...r,organizationProfileProps:c},rootProps:a,component:t};return e.__experimental_prefetchOrganizationSwitcher(),v.createElement(ei.Provider,{value:u},v.createElement(v.Fragment,null,i&&n,e.loaded&&v.createElement(Z,{...u,hideRootHtmlElement:!!r.__experimental_asProvider},r.__experimental_asProvider?l:null,v.createElement(Br,{customPagesPortals:s}))))},{component:`OrganizationSwitcher`,renderWhileLoading:!0});function ni(e){let t=(0,v.useContext)(ei),n={...t,props:{...t.props,...e}};return v.createElement(Z,n)}Object.assign(ti,{OrganizationProfilePage:Zr,OrganizationProfileLink:Qr,__experimental_Outlet:ni}),Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return v.createElement(v.Fragment,null,i&&n,e.loaded&&v.createElement(Z,{component:t,mount:e.mountOrganizationList,unmount:e.unmountOrganizationList,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`OrganizationList`,renderWhileLoading:!0}),Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return v.createElement(v.Fragment,null,i&&n,e.loaded&&v.createElement(Z,{component:t,open:e.openGoogleOneTap,close:e.closeGoogleOneTap,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`GoogleOneTap`,renderWhileLoading:!0}),Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return v.createElement(v.Fragment,null,i&&n,e.loaded&&v.createElement(Z,{component:t,mount:e.mountWaitlist,unmount:e.unmountWaitlist,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`Waitlist`,renderWhileLoading:!0}),Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t,{selector:`[data-component-status="ready"]`})===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return v.createElement(v.Fragment,null,i&&n,e.loaded&&v.createElement(Z,{component:t,mount:e.mountPricingTable,unmount:e.unmountPricingTable,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`PricingTable`,renderWhileLoading:!0}),Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return v.createElement(v.Fragment,null,i&&n,e.loaded&&v.createElement(Z,{component:t,mount:e.mountAPIKeys,unmount:e.unmountAPIKeys,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`ApiKeys`,renderWhileLoading:!0}),Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return v.createElement(v.Fragment,null,i&&n,e.loaded&&v.createElement(Z,{component:t,mount:e.__internal_mountOAuthConsent,unmount:e.__internal_unmountOAuthConsent,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`OAuthConsent`,renderWhileLoading:!0}),Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return v.createElement(v.Fragment,null,i&&n,e.loaded&&v.createElement(Z,{component:t,mount:e.mountUserAvatar,unmount:e.unmountUserAvatar,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`UserAvatar`,renderWhileLoading:!0}),Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return v.createElement(v.Fragment,null,i&&n,e.loaded&&v.createElement(Z,{component:t,mount:e.mountTaskChooseOrganization,unmount:e.unmountTaskChooseOrganization,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`TaskChooseOrganization`,renderWhileLoading:!0}),Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return v.createElement(v.Fragment,null,i&&n,e.loaded&&v.createElement(Z,{component:t,mount:e.mountTaskResetPassword,unmount:e.unmountTaskResetPassword,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`TaskResetPassword`,renderWhileLoading:!0}),Q(({clerk:e,component:t,fallback:n,...r})=>{let i=X(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return v.createElement(v.Fragment,null,i&&n,e.loaded&&v.createElement(Z,{component:t,mount:e.mountTaskSetupMFA,unmount:e.unmountTaskSetupMFA,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`TaskSetupMFA`,renderWhileLoading:!0});var ri={actor:void 0,factorVerificationAge:null,orgId:void 0,orgPermissions:void 0,orgRole:void 0,orgSlug:void 0,sessionClaims:void 0,sessionId:void 0,sessionStatus:void 0,userId:void 0};function ii(){let e=B(),t=Zt(),n=(0,v.useCallback)(()=>t,[t]),r=(0,v.useSyncExternalStore)((0,v.useCallback)(t=>e.addListener(t,{skipInitialEmit:!0}),[e]),(0,v.useCallback)(()=>!e.loaded||!e.__internal_lastEmittedResources?n():e.__internal_lastEmittedResources,[e,n]),n);return(0,v.useMemo)(()=>r?ai(oi(r)?Ie(!1,{},r):Ie(!0,r,void 0)):ri,[r])}function ai(e){return{sessionId:e.sessionId,sessionStatus:e.sessionStatus,sessionClaims:e.sessionClaims,userId:e.userId,actor:e.actor,orgId:e.orgId,orgRole:e.orgRole,orgSlug:e.orgSlug,orgPermissions:e.orgPermissions,factorVerificationAge:e.factorVerificationAge}}function oi(e){return!(`client`in e)}var si=e=>new Promise(t=>{let n=r=>{[`ready`,`degraded`].includes(r)&&(t(),e.off(`status`,n))};e.on(`status`,n,{notify:!0})}),ci=e=>async t=>{if(!W())throw new l(`useAuth().getToken() can only be used in browser environments. To access auth data server-side, see the Auth object reference doc: https://clerk.c
31om/docs/reference/backend/types/auth-object`,{code:`clerk_runtime_not_browser`});return await si(e),e.session?e.session.getToken(t):null},li=e=>async(...t)=>(await si(e),e.signOut(...t)),ui=(e={})=>{Zn(`useAuth`);let{treatPendingAsSignedOut:t}=e??{},n=ii(),r=Xn(),i=(0,v.useCallback)(ci(r),[r]),a=(0,v.useCallback)(li(r),[r]);return r.telemetry?.record(Ne(`useAuth`,{treatPendingAsSignedOut:t})),di({...n,getToken:i,signOut:a},{treatPendingAsSignedOut:t})};function di(e,{treatPendingAsSignedOut:t=!0}={}){let{userId:n,orgId:r,orgRole:i,has:a,signOut:o,getToken:s,orgPermissions:c,factorVerificationAge:l,sessionClaims:u}=e??{},d=(0,v.useCallback)(e=>a?a(e):ke({userId:n,orgId:r,orgRole:i,orgPermissions:c,factorVerificationAge:l,features:u?.fea||``,plans:u?.pla||``})(e),[a,n,r,i,c,l,u]);return Ae({authObject:{...e,getToken:s,signOut:o,has:d},options:{treatPendingAsSignedOut:t}})||H.throw(nr)}var fi=`loadScript cannot be called when document does not exist`,pi=`loadScript cannot be called without a src`;async function mi(e=``,t){let{async:n,defer:r,beforeLoad:i,crossOrigin:a,nonce:o}=t||{};return oe(()=>new Promise((t,s)=>{e||s(Error(pi)),(!document||!document.body)&&s(Error(fi));let c=document.createElement(`script`);a&&c.setAttribute(`crossorigin`,a),c.async=n||!1,c.defer=r||!1,c.addEventListener(`load`,()=>{c.remove(),t(c)}),c.addEventListener(`error`,t=>{c.remove(),s(t.error??Error(`failed to load script: ${e}`))}),c.src=e,o&&(c.nonce=o),i?.(c),document.body.appendChild(c)}),{shouldRetry:(e,t)=>t<=5})}var hi=(e,t=`6.29.3`)=>{if(e)return e;let n=gi(t);return n?n===`snapshot`?t:n:_i(t)},gi=e=>e.trim().replace(/^v/,``).match(/-(.+?)(\.|$)/)?.[1],_i=e=>e.trim().replace(/^v/,``).split(`.`)[0],{isDevOrStagingUrl:vi}=te(),yi=d({packageName:`@clerk/shared`});function bi(e){return typeof window>`u`||!window[e]?!1:!!window[e]}var xi=()=>bi(`Clerk`),Si=()=>bi(`__internal_ClerkUICtor`);function Ci(e){if(typeof window>`u`||!window.performance)return!1;let t=performance.getEntriesByName(e,`resource`);if(t.length===0)return!1;let n=t[t.length-1];return n.transferSize===0&&n.decodedBodySize===0&&(n.responseEnd===0||n.responseEnd>0&&n.responseStart>0||`responseStatus`in n&&(n.responseStatus>=400||n.responseStatus===0))}var wi=async e=>{let t=e?.scriptLoadTimeout??15e3,n=e=>
31new l(`Failed to load Clerk JS`+(e?.message?`, ${e.message}`:``),{code:`failed_to_load_clerk_js`,cause:e});if(xi())return null;if(!e?.publishableKey)return yi.throwMissingPublishableKeyError(),null;let r=Ei(e),i=document.querySelector(`script[data-clerk-js-script]`);if(i){if(Ci(r))i.remove();else try{return await Pi(t,xi,n(),i),null}catch{i.remove()}}let a=Pi(t,xi,n());return mi(r,{async:!0,crossOrigin:`anonymous`,nonce:e.nonce,beforeLoad:Ai(Oi(e))}).catch(e=>{throw n(e)}),a},Ti=async e=>{let t=e?.scriptLoadTimeout??15e3,n=e=>new l(`Failed to load Clerk UI`+(e?.message?`, ${e.message}`:``),{code:`failed_to_load_clerk_ui`,cause:e});if(Si())return null;if(!e?.publishableKey)return yi.throwMissingPublishableKeyError(),null;let r=Di(e),i=document.querySelector(`script[data-clerk-ui-script]`);if(i){if(Ci(r))i.remove();else try{return await Pi(t,Si,n(),i),null}catch{i.remove()}}let a=Pi(t,Si,n());return mi(r,{async:!0,crossOrigin:`anonymous`,nonce:e.nonce,beforeLoad:Ai(ki(e))}).catch(e=>{throw n(e)}),a},Ei=e=>{let{__internal_clerkJSUrl:t,__internal_clerkJSVersion:n,proxyUrl:r,domain:i,publishableKey:a}=e;if(t)return t;let o=hi(n);return r&&A(r)?Mi(r,`clerk-js`,o,`clerk.browser.js`):`https://${Ni({publishableKey:a,proxyUrl:r,domain:i})}/npm/@clerk/clerk-js@${o}/dist/clerk.browser.js`},Di=e=>{let{__internal_clerkUIUrl:t,__internal_clerkUIVersion:n,proxyUrl:r,domain:i,publishableKey:a}=e;if(t)return t;let o=hi(n,`1.30.6`);return r&&A(r)?Mi(r,`ui`,o,`ui.browser.js`):`https://${Ni({publishableKey:a,proxyUrl:r,domain:i})}/npm/@clerk/ui@${o}/dist/ui.browser.js`},Oi=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},ki=e=>Oi(e),Ai=e=>t=>{for(let n in e)t.setAttribute(n,e[n])},ji=e=>{for(;e.endsWith(`/`);)e=e.slice(0,-1);return e},Mi=(e,t,n,r)=>`${ji(e)}/npm/@clerk/${t}@${n}/dist/${r}`,Ni=e=>{let{proxyUrl:t,domain:n,publishableKey:r}=e;if(t&&le(t)){let e=de(t);return A(e)?D(r)?.frontendApi||``:e.replace(/http(s)?:\/\//,``)}return n&&!vi(D(r)?.frontendApi||``)?se(n):D(r)?.frontendApi||``};function Pi(e,t,n,r){return new Promise((i,a)=>{let o=!1,s=(e,t)=>{clearTimeout(e),clearInterval(t)};r?.addEventListener(`error`,()=>{s(l,u),a(n)});let c=()=>{o||t()&&(o=!0,s(l,u),i(null))},l=setTimeout(()=>{o||(o=!0,s(l,u),t()?i(null):a(n))},e);c();let u=setInterval(()=>{if(o){clearInterval(u);return}c()},100)})}function Fi(e){yi.setPackageName({packageName:e})}var Ii=(e,t,n,r,i)=>{let{notify:a}=i||{},o=e.get(n);o||(o=[],e.set(n,o)),o.push(r),a&&t.has(n)&&r(t.get(n))},Li=(e,t,n)=>(e.get(t)||[]).map(e=>e(n)),Ri=(e,t,n)=>{let r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},zi=()=>{let e=new Map,t=new Map,n=new Map;return{on:(...n)=>Ii(e,t,...n),prioritizedOn:(...e)=>Ii(n,t,...e),emit:(r,i)=>{t.set(r,i),Li(n,r,i),Li(e,r,i)},off:(...t)=>Ri(e,...t),prioritizedOff:(...e)=>Ri(n,...e),internal:{retrieveListeners:t=>e.get(t)||[]}}},$={Status:`status`},Bi=()=>zi(),Vi=`clerk:beforeunload`,Hi=[`http:`,`https:`,`wails:`,`chrome-extension:`],Ui=/^[/\\][/\\]/;function Wi(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;let n=``;for(let r=t;r<e.length;r++){let t=e.charCodeAt(r);t!==9&&t!==10&&t!==13&&(n+=e[r])}return n}function Gi(e,t){if(typeof e==`string`&&Ui.test(Wi(e))){console.warn(`Clerk: scheme-relative navigation to "${e}" is not allowed. Provide a same-origin path or an absolute URL.`);return}let n=new URL(e,window.location.href);if(!(t?.allowedProtocols??Hi).includes(n.protocol)){console.warn(`Clerk: "${n.protocol}" is not a valid navigation protocol. Aborting navigation. If you think this is a mistake, please open an issue.`);return}window.dispatchEvent(new CustomEvent(Vi)),window.location.href=n.href}function Ki(e){let t=e.match(/^(\d+)\.(\d+)\.(\d+)/);if(!t)return null;let[,n,r,i]=t;return{major:parseInt(n,10),minor:parseInt(r,10),patch:parseInt(i,10)}}function qi(e,t){let{major:n,minor:r,patch:i}=e;return t.some(([e,t,a,o])=>n===e?a===-1?r>t||r===t&&i>=o:r===a&&i>=o:!1)}function Ji(e,t){let n=Ki(e);return n?qi(n,t):!1}var Yi=({children:e})=>(Zn(`ClerkLoaded`),Xn().loaded?e:null),Xi=({children:e})=>(Zn(`ClerkLoading`),Xn().status===`loading`?e:null),Zi=({children:e,fallback:t,treatPendingAsSignedOut:n,when:r})=>{Zn(`Show`);let{has:i,isLoaded:a,userId:o}=ui({treatPendingAsSignedOut:n});if(!a)return null;let s=r,c=e,l=t??null;return s===`signed-out`?o?l:c:o&&(s===`signed-in`||Qi(s,i))?c:l};function Qi(e,t){return typeof e==`function`?e(t):t(e)}Q(({clerk:e,...t})=>{let{client:n,session:r}=e,i=(n.signedInSessions?.length??0)>0;return v.useEffect(()=>{r===null&&i?e.redirectToAfterSignOut():e.redirectToSignIn(t)},[]),null},`RedirectToSignIn`),Q(({clerk:e,...t})=>(v.useEffect(()=>{e.redirectToSignUp(t)},[]),null),`RedirectToSignUp`),Q(({clerk:e,...t})=>(v.useEffect(()=>{e.redirectToTasks(t)},[]),null),`RedirectToTasks`),Q(({clerk:e})=>(v.useEffect(()=>{x(`RedirectToUserProfile`,"Use the `redirectToUserProfile()` method instead."),e.redirectToUserProfile()},[]),null),`RedirectToUserProfile`),Q(({clerk:e})=>(v.useEffect(()=>{x(`RedirectToOrganizationProfile`,"Use the `redirectToOrganizationProfile()` method instead."),e.redirectToOrganizationProfile()},[]),null),`RedirectToOrganizationProfile`),Q(({clerk:e})=>(v.useEffect(()=>{x(`RedirectToCreateOrganization`,"Use the `redirectToCreateOrganization()` method instead."),e.redirectToCreateOrganization()},[]),null),`RedirectToCreateOrganization`),Q(({clerk:e,...t})=>(v.useEffect(()=>{e.handleRedirectCallback(t)},[]),null),`AuthenticateWithRedirectCallback`);var $i=()=>({fields:{identifier:null,password:null,code:null},raw:null,global:null}),ea=()=>({fields:{firstName:null,lastName:null,emailAddress:null,phoneNumber:null,password:null,username:null,code:null,captcha:null,legalAccepted:null},raw:null,global:null}),ta=()=>({fields:{emailAddress:null},raw:null,global:null}),na=()=>({pathRoot:``,attempts:null,error:null,expireAt:null,externalVerificationRedirectURL:null,nonce:null,message:null,status:null,strategy:null,verifiedAtClient:null,verifiedFromTheSameClient(){return!1},reload(){throw Error(`reload() called before Clerk is loaded`)},__internal_toSnapshot(){return{object:`verification`,id:``,attempts:null,error:{code:``,message:``},expire_at:null,externalVerificationRedirectURL:null,nonce:null,message:null,status:null,strategy:null,verified_at_client:null}}}),ra=()=>({...na(),supportedStrategies:[],nextAction:``,reload(){throw Error(`reload() called before Clerk is loaded`)},__internal_toSnapshot(){return{...na().__internal_toSnapshot(),next_action:this.nextAction,supported_strategies:this.supportedStrategies}}}),ia=class{constructor(e){this.isomorphicClerk=e,this.signInSignalProxy=this.buildSignInProxy(),this.signUpSignalProxy=this.buildSignUpProxy(),this.waitlistSignalProxy=this.buildWaitlistProxy()}signInSignal(){return this.signInSignalProxy}signUpSignal(){return this.signUpSignalProxy}waitlistSignal(){return this.waitlistSignalProxy}get __internal_waitlist(){return this.state.__internal_waitlist}checkoutSignal(e){return this.buildCheckoutProxy(e)}buildSignInProxy(){let e=this.gateProperty.bind(this),t=()=>this.client.signIn.__internal_future;return{errors:$i(),fetchStatus:`idle`,signIn:{status:`needs_identifier`,availableStrategies:[],get isTransferable(){return e(t,`isTransferable`,!1)},get id(){return e(t,`id`,void 0)},get supportedFirstFactors(){return e(t,`supportedFirstFactors`,[])},get supportedSecondFactors(){return e(t,`supportedSecondFactors`,[])},get secondFactorVerification(){return e(t,`secondFactorVerification`,{status:null,error:null,expireAt:null,externalVerificationRedirectURL:null,nonce:null,attempts:null,message:null,strategy:null,verifiedAtClient:null,verifiedFromTheSameClient:()=>!1,__internal_toSnapshot:()=>{throw Error(`__internal_toSnapshot called before Clerk is loaded`)},pathRoot:``,reload:()=>{throw Error(`__internal_toSnapshot called before Clerk is loaded`)}})},get identifier(){return e(t,`identifier`,null)}
31,get createdSessionId(){return e(t,`createdSessionId`,null)},get userData(){return e(t,`userData`,{})},get firstFactorVerification(){return e(t,`firstFactorVerification`,{status:null,error:null,expireAt:null,externalVerificationRedirectURL:null,nonce:null,attempts:null,message:null,strategy:null,verifiedAtClient:null,verifiedFromTheSameClient:()=>!1,__internal_toSnapshot:()=>{throw Error(`__internal_toSnapshot called before Clerk is loaded`)},pathRoot:``,reload:()=>{throw Error(`__internal_toSnapshot called before Clerk is loaded`)}})},get canBeDiscarded(){return e(t,`canBeDiscarded`,!1)},get protectCheck(){return e(t,`protectCheck`,null)},create:this.gateMethod(t,`create`),password:this.gateMethod(t,`password`),sso:this.gateMethod(t,`sso`),finalize:this.gateMethod(t,`finalize`),reset:this.gateMethod(t,`reset`),submitProtectCheck:this.gateMethod(t,`submitProtectCheck`),emailCode:this.wrapMethods(()=>t().emailCode,[`sendCode`,`verifyCode`]),emailLink:this.wrapStruct(()=>t().emailLink,[`sendLink`,`waitForVerification`],[`verification`],{verification:null}),resetPasswordEmailCode:this.wrapMethods(()=>t().resetPasswordEmailCode,[`sendCode`,`verifyCode`,`submitPassword`]),resetPasswordPhoneCode:this.wrapMethods(()=>t().resetPasswordPhoneCode,[`sendCode`,`verifyCode`,`submitPassword`]),phoneCode:this.wrapMethods(()=>t().phoneCode,[`sendCode`,`verifyCode`]),mfa:this.wrapMethods(()=>t().mfa,[`sendPhoneCode`,`verifyPhoneCode`,`sendEmailCode`,`verifyEmailCode`,`verifyTOTP`,`verifyBackupCode`]),ticket:this.gateMethod(t,`ticket`),passkey:this.gateMethod(t,`passkey`),web3:this.gateMethod(t,`web3`)}}}buildSignUpProxy(){let e=this.gateProperty.bind(this),t=this.gateMethod.bind(this),n=()=>this.client.signUp.__internal_future;return{errors:ea(),fetchStatus:`idle`,signUp:{get id(){return e(n,`id`,void 0)},get requiredFields(){return e(n,`requiredFields`,[])},get optionalFields(){return e(n,`optionalFields`,[])},get missingFields(){return e(n,`missingFields`,[])},get username(){return e(n,`username`,null)},get firstName(){return e(n,`firstName`,null)},get lastName(){return e(n,`lastName`,null)},get emailAddress(){return e(n,`emailAddress`,null)},get phoneNumber(){return e(n,`phoneNumber`,null)},get web3Wallet(){return e(n,`web3Wallet`,null)},get hasPassword(){return e(n,`hasPassword`,!1)},get unsafeMetadata(){return e(n,`unsafeMetadata`,{})},get createdSessionId(){return e(n,`createdSessionId`,null)},get createdUserId(){return e(n,`createdUserId`,null)},get abandonAt(){return e(n,`abandonAt`,null)},get legalAcceptedAt(){return e(n,`legalAcceptedAt`,null)},get locale(){return e(n,`locale`,null)},get status(){return e(n,`status`,`missing_requirements`)},get unverifiedFields(){return e(n,`unverifiedFields`,[])},get isTransferable(){return e(n,`isTransferable`,!1)},get canBeDiscarded(){return e(n,`canBeDiscarded`,!1)},get protectCheck(){return e(n,`protectCheck`,null)},create:t(n,`create`),update:t(n,`update`),sso:t(n,`sso`),password:t(n,`password`),ticket:t(n,`ticket`),web3:t(n,`web3`),finalize:t(n,`finalize`),reset:t(n,`reset`),submitProtectCheck:t(n,`submitProtectCheck`),verifications:this.wrapStruct(()=>n().verifications,[`sendEmailCode`,`verifyEmailCode`,`sendEmailLink`,`waitForEmailLinkVerification`,`sendPhoneCode`,`verifyPhoneCode`],[`emailAddress`,`phoneNumber`,`web3Wallet`,`externalAccount`,`emailLinkVerification`],{emailAddress:ra(),phoneNumber:ra(),web3Wallet:ra(),externalAccount:ra(),emailLinkVerification:null})}}}buildWaitlistProxy(){let e=this.gateProperty.bind(this),t=this.gateMethod.bind(this),n=()=>this.state.__internal_waitlist;return{errors:ta(),fetchStatus:`idle`,waitlist:{pathRoot:`/waitlist`,get id(){return e(n,`id`,``)},get createdAt(){return e(n,`createdAt`,null)},get updatedAt(){return e(n,`updatedAt`,null)},join:t(n,`join`),reload:t(n,`reload`)}}}buildCheckoutProxy(e){let t=this.gateProperty.bind(this),n=()=>this.checkout(e),r=()=>n().checkout;return{errors:{raw:null,global:null},fetchStatus:`idle`,checkout:{get status(){return t(r,`status`,`needs_initialization`)},get externalClientSecret(){return t(r,`externalClientSecret`,null)},get externalGatewayId(){return t(r,`externalGatewayId`,null)},get paymentMethod(){return t(r,`paymentMethod`,null)},get plan(){return t(r,`plan`,null)},get planPeriod(){return t(r,`planPeriod`,null)},get totals(){return t(r,`totals`,null)},get isImmediatePlanChange(){return t(r,`isImmediatePlanChange`,!1)},get freeTrialEndsAt(){return t(r,`freeTrialEndsAt`,null)},get payer(){return t(r,`payer`,null)},get planPeriodStart(){return t(r,`planPeriodStart`,null)},get needsPaymentMethod(){return t(r,`needsPaymentMethod`,null)},start:this.gateMethod(r,`start`),update:this.gateMethod(r,`update`),confirm:this.gateMethod(r,`confirm`),finalize:this.gateMethod(r,`finalize`)}}}__internal_effect(e){throw Error(`__internal_effect called before Clerk is loaded`)}__internal_computed(e){throw Error(`__internal_computed called before Clerk is loaded`)}get state(){let e=this.isomorphicClerk.__internal_state;if(!e)throw Error(`Clerk state not ready`);return e}get client(){let e=this.isomorphicClerk.client;if(!e)throw Error(`Clerk client not ready`);return e}get checkout(){let e=this.isomorphicClerk.__experimental_checkout;if(!e)throw Error(`Clerk checkout not ready`);return e}gateProperty(e,t,n){return!W()||!this.isomorphicClerk.loaded?n:e()[t]}gateMethod(e,t){return(async(...n)=>{if(!W())return H.throw(`Attempted to call a method (${t}) that is not supported on the server.`);this.isomorphicClerk.loaded||await new Promise(e=>this.isomorphicClerk.addOnLoaded(e));let r=e();return r[t].apply(r,n)})}wrapMethods(e,t){return Object.fromEntries(t.map(t=>[t,this.gateMethod(e,t)]))}wrapStruct(e,t,n,r){let i={};for(let n of t)i[n]=this.gateMethod(e,n);for(let t of n)Object.defineProperty(i,t,{get:()=>this.gateProperty(e,t,r[t]),enumerable:!0});return i}};globalThis.__BUILD_DISABLE_RHC__===void 0&&(globalThis.__BUILD_DISABLE_RHC__=!1);
31var aa={name:`@clerk/react`,version:`6.14.5`,environment:`production`},oa=class e{#e;#t;#n;#r;#i;#a;get publishableKey(){return this.#r}get loaded(){return this.clerkjs?.loaded||!1}get status(){return this.clerkjs?this.clerkjs?.status||(this.clerkjs.loaded?`ready`:`loading`):this.#e}static#o;static getOrCreateInstance(t){return(!W()||!this.#o||t.Clerk&&this.#o.Clerk!==t.Clerk||this.#o.publishableKey!==t.publishableKey)&&(this.#o=new e(t)),this.#o}static clearInstance(){this.#o=null}get domain(){return typeof window<`u`&&window.location?Qn(this.#t,new URL(window.location.href),``):typeof this.#t==`function`?H.throw(rr):this.#t||``}get proxyUrl(){return typeof window<`u`&&window.location?Qn(this.#n,new URL(window.location.href),``):typeof this.#n==`function`?H.throw(rr):this.#n||``}__internal_getOption(e){return this.clerkjs?.__internal_getOption?this.clerkjs?.__internal_getOption(e):this.options[e]}get __internal_moduleManager(){return this.clerkjs?.__internal_moduleManager}constructor(e){this.clerkjs=null,this.preopenOneTap=null,this.preopenUserVerification=null,this.preopenEnableOrganizationsPrompt=null,this.preopenSignIn=null,this.preopenCheckout=null,this.preopenPlanDetails=null,this.preopenSubscriptionDetails=null,this.preopenSignUp=null,this.preopenUserProfile=null,this.preopenOrganizationProfile=null,this.preopenInviteMembers=null,this.preopenCreateOrganization=null,this.preOpenWaitlist=null,this.premountSignInNodes=new Map,this.premountSignUpNodes=new Map,this.premountUserAvatarNodes=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.premountPricingTableNodes=new Map,this.premountAPIKeysNodes=new Map,this.premountConfigureSSONodes=new Map,this.premountOAuthConsentNodes=new Map,this.premountTaskChooseOrganizationNodes=new Map,this.premountTaskResetPasswordNodes=new Map,this.premountTaskSetupMFANodes=new Map,this.premountAddListenerCalls=new Map,this.loadedListeners=[],this.#e=`loading`,this.#i=Bi(),this.__internal_windowNavigate=(e,t)=>{let n=this.clerkjs;if(typeof n?.__internal_windowNavigate==`function`){n.__internal_windowNavigate(e,t);return}W()&&Gi(e,{allowedProtocols:t?.useStaticAllowlistOnly?Hi:[...Hi,...this.options.allowedRedirectProtocols??[]]})},this.setProtectAssertion=e=>{let t=()=>this.clerkjs?.setProtectAssertion(e);this.clerkjs&&this.loaded?t():this.premountMethodCalls.set(`setProtectAssertion`,t)},this.buildSignInUrl=e=>{let t=()=>this.clerkjs?.buildSignInUrl(e)||``;if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`buildSignInUrl`,t)},this.buildSignUpUrl=e=>{let t=()=>this.clerkjs?.buildSignUpUrl(e)||``;if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`buildSignUpUrl`,t)},this.buildAfterSignInUrl=(...e)=>{let t=()=>this.clerkjs?.buildAfterSignInUrl(...e)||``;if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`buildAfterSignInUrl`,t)},this.buildAfterSignUpUrl=(...e)=>{let t=()=>this.clerkjs?.buildAfterSignUpUrl(...e)||``;if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`buildAfterSignUpUrl`,t)},this.buildAfterSignOutUrl=()=>{let e=()=>this.clerkjs?.buildAfterSignOutUrl()||``;if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`buildAfterSignOutUrl`,e)},this.buildNewSubscriptionRedirectUrl=()=>{let e=()=>this.clerkjs?.buildNewSubscriptionRedirectUrl()||``;if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`buildNewSubscriptionRedirectUrl`,e)},this.buildAfterMultiSessionSingleSignOutUrl=()=>{let e=()=>this.clerkjs?.buildAfterMultiSessionSingleSignOutUrl()||``;if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`buildAfterMultiSessionSingleSignOutUrl`,e)},this.buildUserProfileUrl=()=>{let e=()=>this.clerkjs?.buildUserProfileUrl()||``;if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`buildUserProfileUrl`,e)},this.buildCreateOrganizationUrl=()=>{let e=()=>this.clerkjs?.buildCreateOrganizationUrl()||``;if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`buildCreateOrganizationUrl`,e)},this.buildOrganizationProfileUrl=()=>{let e=()=>this.clerkjs?.buildOrganizationProfileUrl()||``;if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`buildOrganizationProfileUrl`,e)},this.buildWaitlistUrl=()=>{let e=()=>this.clerkjs?.buildWaitlistUrl()||``;if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`buildWaitlistUrl`,e)},this.buildTasksUrl=()=>{let e=()=>this.clerkjs?.buildTasksUrl()||``;if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`buildTasksUrl`,e)},this.buildUrlWithAuth=e=>{let t=()=>this.clerkjs?.buildUrlWithAuth(e)||``;if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`buildUrlWithAuth`,t)},this.handleUnauthenticated=async()=>{let e=()=>this.clerkjs?.handleUnauthenticated();this.clerkjs&&this.loaded?e():this.premountMethodCalls.set(`handleUnauthenticated`,e)},this.on=(...e)=>{if(this.clerkjs?.on)return this.clerkjs.on(...e);this.#i.on(...e)}
31,this.off=(...e)=>{if(this.clerkjs?.off)return this.clerkjs.off(...e);this.#i.off(...e)},this.addOnLoaded=e=>{this.loadedListeners.push(e),this.loaded&&this.emitLoaded()},this.emitLoaded=()=>{this.loadedListeners.forEach(e=>e()),this.loadedListeners=[]},this.beforeLoad=e=>{if(!e)throw Error(`Failed to hydrate latest Clerk JS`)},this.replayInterceptedInvocations=e=>{if(!e)throw Error(`Failed to hydrate latest Clerk JS`);return this.clerkjs=e,this.premountMethodCalls.forEach(e=>e()),this.premountAddListenerCalls.forEach((t,n)=>{t.handlers.nativeUnsubscribe=e.addListener(n,t.options)}),this.#i.internal.retrieveListeners(`status`)?.forEach(e=>{this.on(`status`,e,{notify:!0})}),this.preopenSignIn!==null&&e.openSignIn(this.preopenSignIn),this.preopenCheckout!==null&&e.__internal_openCheckout(this.preopenCheckout),this.preopenPlanDetails!==null&&e.__internal_openPlanDetails(this.preopenPlanDetails),this.preopenSubscriptionDetails!==null&&e.__internal_openSubscriptionDetails(this.preopenSubscriptionDetails),this.preopenSignUp!==null&&e.openSignUp(this.preopenSignUp),this.preopenUserProfile!==null&&e.openUserProfile(this.preopenUserProfile),this.preopenUserVerification!==null&&e.__internal_openReverification(this.preopenUserVerification),this.preopenOneTap!==null&&e.openGoogleOneTap(this.preopenOneTap),this.preopenOrganizationProfile!==null&&e.openOrganizationProfile(this.preopenOrganizationProfile),this.preopenInviteMembers!==null&&e.openInviteMembers(this.preopenInviteMembers),this.preopenCreateOrganization!==null&&e.openCreateOrganization(this.preopenCreateOrganization),this.preOpenWaitlist!==null&&e.openWaitlist(this.preOpenWaitlist),this.preopenEnableOrganizationsPrompt&&e.__internal_openEnableOrganizationsPrompt(this.preopenEnableOrganizationsPrompt),this.premountSignInNodes.forEach((t,n)=>{e.mountSignIn(n,t)}),this.premountSignUpNodes.forEach((t,n)=>{e.mountSignUp(n,t)}),this.premountUserProfileNodes.forEach((t,n)=>{e.mountUserProfile(n,t)}),this.premountUserAvatarNodes.forEach((t,n)=>{e.mountUserAvatar(n,t)}),this.premountUserButtonNodes.forEach((t,n)=>{e.mountUserButton(n,t)}),this.premountOrganizationListNodes.forEach((t,n)=>{e.mountOrganizationList(n,t)}),this.premountWaitlistNodes.forEach((t,n)=>{e.mountWaitlist(n,t)}),this.premountPricingTableNodes.forEach((t,n)=>{e.mountPricingTable(n,t)}),this.premountAPIKeysNodes.forEach((t,n)=>{e.mountAPIKeys(n,t)}),this.premountConfigureSSONodes.forEach((t,n)=>{e.__internal_mountConfigureSSO(n,t)}),this.premountOAuthConsentNodes.forEach((t,n)=>{e.__internal_mountOAuthConsent(n,t)}),this.premountTaskChooseOrganizationNodes.forEach((t,n)=>{e.mountTaskChooseOrganization(n,t)}),this.premountTaskResetPasswordNodes.forEach((t,n)=>{e.mountTaskResetPassword(n,t)}),this.premountTaskSetupMFANodes.forEach((t,n)=>{e.mountTaskSetupMFA(n,t)}),this.clerkjs.status===void 0&&this.#i.emit($.Status,`ready`),this.emitLoaded(),this.clerkjs},this.__experimental_checkout=(...e)=>this.loaded&&this.clerkjs?this.clerkjs.__experimental_checkout(...e):this.#a.checkoutSignal(...e),this.__internal_updateProps=async e=>{let t=await this.#s();if(t&&`__internal_updateProps`in t)return t.__internal_updateProps(e)},this.setActive=e=>this.clerkjs?this.clerkjs.setActive(e):Promise.reject(),this.openSignIn=e=>{this.clerkjs&&this.loaded?this.clerkjs.openSignIn(e):this.preopenSignIn=e},this.closeSignIn=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeSignIn():this.preopenSignIn=null},this.__internal_openCheckout=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openCheckout(e):this.preopenCheckout=e},this.__internal_closeCheckout=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeCheckout():this.preopenCheckout=null},this.__internal_openPlanDetails=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openPlanDetails(e):this.preopenPlanDetails=e},this.__internal_closePlanDetails=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closePlanDetails():this.preopenPlanDetails=null},this.__internal_openSubscriptionDetails=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openSubscriptionDetails(e):this.preopenSubscriptionDetail
31s=e??null},this.__internal_closeSubscriptionDetails=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeSubscriptionDetails():this.preopenSubscriptionDetails=null},this.__internal_openReverification=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openReverification(e):this.preopenUserVerification=e},this.__internal_closeReverification=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeReverification():this.preopenUserVerification=null},this.__internal_openEnableOrganizationsPrompt=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openEnableOrganizationsPrompt(e):this.preopenEnableOrganizationsPrompt=e},this.__internal_closeEnableOrganizationsPrompt=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeEnableOrganizationsPrompt():this.preopenEnableOrganizationsPrompt=null},this.openGoogleOneTap=e=>{this.clerkjs&&this.loaded?this.clerkjs.openGoogleOneTap(e):this.preopenOneTap=e},this.closeGoogleOneTap=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeGoogleOneTap():this.preopenOneTap=null},this.openUserProfile=e=>{this.clerkjs&&this.loaded?this.clerkjs.openUserProfile(e):this.preopenUserProfile=e},this.closeUserProfile=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeUserProfile():this.preopenUserProfile=null},this.openOrganizationProfile=e=>{this.clerkjs&&this.loaded?this.clerkjs.openOrganizationProfile(e):this.preopenOrganizationProfile=e},this.closeOrganizationProfile=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeOrganizationProfile():this.preopenOrganizationProfile=null},this.openInviteMembers=e=>{this.clerkjs&&this.loaded?this.clerkjs.openInviteMembers(e):this.preopenInviteMembers=e},this.closeInviteMembers=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeInviteMembers():this.preopenInviteMembers=null},this.openCreateOrganization=e=>{this.clerkjs&&this.loaded?this.clerkjs.openCreateOrganization(e):this.preopenCreateOrganization=e},this.closeCreateOrganization=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeCreateOrganization():this.preopenCreateOrganization=null},this.openWaitlist=e=>{this.clerkjs&&this.loaded?this.clerkjs.openWaitlist(e):this.preOpenWaitlist=e},this.closeWaitlist=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeWaitlist():this.preOpenWaitlist=null},this.openSignUp=e=>{this.clerkjs&&this.loaded?this.clerkjs.openSignUp(e):this.preopenSignUp=e},this.closeSignUp=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeSignUp():this.preopenSignUp=null},this.mountSignIn=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountSignIn(e,t):this.premountSignInNodes.set(e,t)},this.unmountSignIn=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountSignIn(e):this.premountSignInNodes.delete(e)},this.mountSignUp=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountSignUp(e,t):this.premountSignUpNodes.set(e,t)},this.unmountSignUp=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountSignUp(e):this.premountSignUpNodes.delete(e)},this.mountUserAvatar=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserAvatar(e,t):this.premountUserAvatarNodes.set(e,t)},this.unmountUserAvatar=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserAvatar(e):this.premountUserAvatarNodes.delete(e)},this.mountUserProfile=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserProfile(e,t):this.premountUserProfileNodes.set(e,t)},this.unmountUserProfile=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserProfile(e):this.premountUserProfileNodes.delete(e)},this.mountOrganizationProfile=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationProfile(e,t):this.premountOrganizationProfileNodes.set(e,t)},this.unmountOrganizationProfile=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationProfile(e):this.premountOrganizationProfileNodes.delete(e)},this.mountCreateOrganization=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountCreateOrganization(e,t):this.premountCreateOrganizationNodes.set(e,t)},this.unmountCreateOrganization=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountCreateOrganization(e):this.premountCreateOrganizationNodes.delete(e)},this.mountOrganizationSwitcher=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationSwitcher(e,t):this.premountOrganizationSwitcherNodes.set(e,t)},this.unmountOrganizationSwitcher=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationSwitcher(e):this.premountOrganizationSwitcherNodes.delete(e)},this.__experimental_prefetchOrganizationSwitcher=()=>{let e=()=>this.clerkjs?.__experimental_prefetchOrganizationSwitcher();this.clerkjs&&this.loaded?e():this.premountMethodCalls.set(`__experimental_prefetchOrganizationSwitcher`,e)},this.mountOrganizationList=(e,t)=>
31{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationList(e,t):this.premountOrganizationListNodes.set(e,t)},this.unmountOrganizationList=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationList(e):this.premountOrganizationListNodes.delete(e)},this.mountUserButton=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserButton(e,t):this.premountUserButtonNodes.set(e,t)},this.unmountUserButton=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserButton(e):this.premountUserButtonNodes.delete(e)},this.mountWaitlist=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountWaitlist(e,t):this.premountWaitlistNodes.set(e,t)},this.unmountWaitlist=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountWaitlist(e):this.premountWaitlistNodes.delete(e)},this.mountPricingTable=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountPricingTable(e,t):this.premountPricingTableNodes.set(e,t)},this.unmountPricingTable=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountPricingTable(e):this.premountPricingTableNodes.delete(e)},this.mountAPIKeys=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountAPIKeys(e,t):this.premountAPIKeysNodes.set(e,t)},this.unmountAPIKeys=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountAPIKeys(e):this.premountAPIKeysNodes.delete(e)},this.__internal_mountConfigureSSO=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_mountConfigureSSO(e,t):this.premountConfigureSSONodes.set(e,t)},this.__internal_unmountConfigureSSO=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_unmountConfigureSSO(e):this.premountConfigureSSONodes.delete(e)},this.__internal_mountOAuthConsent=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_mountOAuthConsent(e,t):this.premountOAuthConsentNodes.set(e,t)},this.__internal_unmountOAuthConsent=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_unmountOAuthConsent(e):this.premountOAuthConsentNodes.delete(e)},this.mountOAuthConsent=(e,t)=>{this.__internal_mountOAuthConsent(e,t)},this.unmountOAuthConsent=e=>{this.__internal_unmountOAuthConsent(e)},this.mountTaskChooseOrganization=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountTaskChooseOrganization(e,t):this.premountTaskChooseOrganizationNodes.set(e,t)},this.unmountTaskChooseOrganization=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountTaskChooseOrganization(e):this.premountTaskChooseOrganizationNodes.delete(e)},this.mountTaskResetPassword=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountTaskResetPassword(e,t):this.premountTaskResetPasswordNodes.set(e,t)},this.unmountTaskResetPassword=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountTaskResetPassword(e):this.premountTaskResetPasswordNodes.delete(e)},this.mountTaskSetupMFA=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountTaskSetupMFA(e,t):this.premountTaskSetupMFANodes.set(e,t)},this.unmountTaskSetupMFA=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountTaskSetupMFA(e):this.premountTaskSetupMFANodes.delete(e)},this.addListener=(e,t)=>{if(this.clerkjs)return this.clerkjs.addListener(e,t);{let n=()=>{let t=this.premountAddListenerCalls.get(e);t?.handlers&&(t?.handlers.nativeUnsubscribe?.(),this.premountAddListenerCalls.delete(e))};return this.premountAddListenerCalls.set(e,{options:t,handlers:{unsubscribe:n,nativeUnsubscribe:void 0}}),n}},this.navigate=e=>{let t=()=>this.clerkjs?.navigate(e);this.clerkjs&&this.loaded?t():this.premountMethodCalls.set(`navigate`,t)},this.redirectWithAuth=async(...e)=>{let t=()=>this.clerkjs?.redirectWithAuth(...e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`redirectWithAuth`,t)},this.redirectToSignIn=async e=>{let t=()=>this.clerkjs?.redirectToSignIn(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`redirectToSignIn`,t)},this.redirectToSignUp=async e=>{let t=()=>this.clerkjs?.redirectToSignUp(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`redirectToSignUp`,t)},this.redirectToUserProfile=async()=>{let e=()=>this.clerkjs?.redirectToUserProfile();if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`redirectToUserProfile`,e)},this.redirectToAfterSignUp=()=>{let e=()=>this.clerkjs?.redirectToAfterSignUp();if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`redirectToAfterSignUp`,e)},this.redirectToAfterSignIn=()=>{let e=()=>this.clerkjs?.redirectToAfterSignIn();this.clerkjs&&this.loaded?e():this.premountMethodCalls.set(`redirectToAfterSignIn`,e)},this.redirectToAfterSignOut=()=>{let e=()=>this.clerkjs?.redirectToAfterSignOut();this.clerkjs&&this.loaded?e():this.premountMethodCalls.set(`redirectToAfterSignOut`,e)},this.redirectToOrganizationProfile=async()=>{let e=()=>this.clerkjs?.redirectToOrganizationProfile();if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`redirectToOrganizationProfile`,e)},this.redirectToCreateOrganization=async()=>{let e=()=>this.clerkjs?.redirectToCreateOrganization();if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`redirectToCreateOrganization`,e)},this.redirectToWaitlist=async()=>{let e=()=>this.clerkjs?.redirectToWaitlist();if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`redirectToWaitlist`,e)},this.redirectToTasks=async e=>{let t=()=>this.clerkjs?.redirectToTasks(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`redirectToTasks`,t)},this.handleRedirectCallback=async e=>{let t=()=>this.clerkjs?.handleRedirectCallback(e);this.clerkjs&&this.loaded?t()?.catch(()=>{}):this.premountMethodCalls.set(`handleRedirectCallback`,t)},this.handleGoogleOneTapCallback=async(e,t)=>{let n=()=>this.clerkjs?.handleGoogleOneTapCallback(e,t);this.clerkjs&&this.loaded?n()?.catch(()=>{}):this.premountMethodCalls.set(`handleGoogleOneTapCallback`,n)},this.__internal_handleResourceCallback=async(e,t,n)=>{let r=()=>this.clerkjs?.__internal_handleResourceCallback(e,t,n);if(this.clerkjs&&this.loaded)return r();this.premountMethodCalls.set(`__internal_handleResourceCallback`,r)},this.handleEmailLinkVerification=async e=>{let t=()=>this.clerkjs?.handleEmailLinkVerification(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`handleEmailLinkVerification`,t)},this.authenticateWithMetamask=async e=>{let t=()=>this.clerkjs?.authenticateWithMetamask(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`authenticateWithMetamask`,t)},this.authenticateWithCoinbaseWallet=async e=>{let t=()=>this.clerkjs?.authenticateWithCoinbaseWallet(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`authenticateWithCoinbaseWallet`,t)},this.authenticateWithBase=async e=>{let t=()=>this.clerkjs?.authenticateWithBase(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`authenticateWithBase`,t)},this.authenticateWithOKXWallet=async e=>{let t=()=>this.clerkjs?.authenticateWithOKXWallet(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`authenticateWithOKXWallet`,t)},this.authenticateWithSolana=async e=>{let t=()=>this.clerkjs?.authenticateWithSolana(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`authenticateWithSolana`,t)},this.authenticateWithWeb3=async e=>{let t=()=>this.clerkjs?.authenticateWithWeb3(e);
31if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`authenticateWithWeb3`,t)},this.authenticateWithGoogleOneTap=async e=>(await this.#s()).authenticateWithGoogleOneTap(e),this.__internal_loadStripeJs=async()=>(await this.#s()).__internal_loadStripeJs(),this.createOrganization=async e=>{let t=()=>this.clerkjs?.createOrganization(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`createOrganization`,t)},this.getOrganization=async e=>{let t=()=>this.clerkjs?.getOrganization(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`getOrganization`,t)},this.joinWaitlist=async e=>{let t=()=>this.clerkjs?.joinWaitlist(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`joinWaitlist`,t)},this.signOut=async(...e)=>{let t=()=>this.clerkjs?.signOut(...e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`signOut`,t)},this.__internal_attemptToEnableEnvironmentSetting=e=>{let t=()=>this.clerkjs?.__internal_attemptToEnableEnvironmentSetting(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`__internal_attemptToEnableEnvironmentSetting`,t)},this.#r=e?.publishableKey,this.#n=e?.proxyUrl,this.#t=e?.domain,this.options=e,this.Clerk=e?.Clerk||null,this.mode=W()?`browser`:`server`,this.#a=new ia(this),this.options.sdkMetadata||(this.options.sdkMetadata=aa),this.#i.emit($.Status,`loading`),this.#i.prioritizedOn($.Status,e=>this.#e=e),this.#r&&this.options.experimental?.runtimeEnvironment===`headless`&&this.options.Clerk?this.loadHeadlessClerk():this.#r&&this.getEntryChunks()}loadHeadlessClerk(){let e=xr(this.options.Clerk)?new this.options.Clerk(this.#r,{proxyUrl:this.proxyUrl,domain:this.domain}):this.options.Clerk;if(!e){this.#i.emit($.Status,`error`);return}let t=()=>{this.replayInterceptedInvocations(e)};e.loaded?t():e.load(this.options).then(()=>t()).catch(e=>{this.#i.emit($.Status,`error`),this.emitLoaded()})}get sdkMetadata(){return this.clerkjs?.sdkMetadata||this.options.sdkMetadata||void 0}get instanceType(){return this.clerkjs?.instanceType}get frontendApi(){return this.clerkjs?.frontendApi||``}get isStandardBrowser(){return this.clerkjs?.isStandardBrowser||this.options.standardBrowser||!1}get isSatellite(){return typeof window<`u`&&window.location?Qn(this.options.isSatellite,new URL(window.location.href),!1):typeof this.options.isSatellite==`function`&&H.throw(rr)}#s(){return new Promise(e=>{this.addOnLoaded(()=>e(this.clerkjs))})}async getEntryChunks(){if(!(this.mode!==`browser`||this.loaded)){typeof window<`u`&&(window.__clerk_publishable_key=this.#r,window.__clerk_proxy_url=this.proxyUrl,window.__clerk_domain=this.domain);try{let e=await this.getClerkJsEntryChunk();if(!e.loaded){this.beforeLoad(e);let t=this.options.standardBrowser!==!1&&!this.options.Clerk||this.options.ui?.ClerkUI?await this.getClerkUIEntryChunk():void 0;await e.load({...this.options,ui:{...this.options.ui,ClerkUI:t}})}e.loaded&&this.replayInterceptedInvocations(e)}catch(e){let t=e;this.#i.emit($.Status,`error`),console.error(t.stack||t.message||t);return}}}async getClerkJsEntryChunk(){if((!this.options.Clerk||this.options.__internal_clerkJSUrl)&&!__BUILD_DISABLE_RHC__&&await wi({...this.options,publishableKey:this.#r,proxyUrl:this.proxyUrl,domain:this.domain,nonce:this.options.nonce}),this.options.Clerk&&!this.options.__internal_clerkJSUrl&&(globalThis.Clerk=xr(this.options.Clerk)?new this.options.Clerk(this.#r,{proxyUrl:this.proxyUrl,domain:this.domain}):this.options.Clerk),!globalThis.Clerk)throw Error(`Failed to download latest ClerkJS. Contact [email protected].`);return globalThis.Clerk}async getClerkUIEntryChunk(){let e=this.options.ui,t=!!this.options.__internal_clerkUIUrl;if(e?.ClerkUI&&!t)return e.ClerkUI;if(!((e||this.options.prefetchUI===!1)&&!t)&&!__BUILD_DISABLE_RHC__){if(await Ti({...this.options,publishableKey:this.#r,proxyUrl:this.proxyUrl,domain:this.domain,nonce:this.options.nonce}),!globalThis.__internal_ClerkUICtor)throw Error(`Failed to download latest Clerk UI. Contact [email protected].`);return globalThis.__internal_ClerkUICtor}}get version(){return this.clerkjs?.version}get uiVersion(){return this.clerkjs?.uiVersion}get client(){if(this.clerkjs)return this.clerkjs.client}get session(){if(this.clerkjs)return this.clerkjs.session}
31get user(){if(this.clerkjs)return this.clerkjs.user}get organization(){if(this.clerkjs)return this.clerkjs.organization}get telemetry(){if(this.clerkjs)return this.clerkjs.telemetry}get __internal_environment(){if(this.clerkjs)return this.clerkjs.__internal_environment}get isSignedIn(){return this.clerkjs?this.clerkjs.isSignedIn:!1}get billing(){return this.clerkjs?.billing}get __internal_state(){return this.loaded&&this.clerkjs?this.clerkjs.__internal_state:this.#a}get apiKeys(){return this.clerkjs?.apiKeys}get oauthApplication(){return this.clerkjs?.oauthApplication}__internal_setEnvironment(...e){if(this.clerkjs&&`__internal_setEnvironment`in this.clerkjs)this.clerkjs.__internal_setEnvironment(e);else return}get __internal_lastEmittedResources(){return this.clerkjs?.__internal_lastEmittedResources}get __internal_hasOAuthTransport(){return this.clerkjs?.__internal_hasOAuthTransport||!1}get __internal_oauthTransport(){return this.clerkjs?.__internal_oauthTransport||null}};function sa(){try{return Ji(`19.2.7`,[[18,0,-1,0],[19,0,0,3],[19,1,1,4],[19,2,2,3],[19,3,3,0]])}catch{return!1}}var ca=sa();function la(e){let{initialState:t,children:n,...r}=e,{isomorphicClerk:i,clerkStatus:a}=pa(br(r));return v.createElement(Mn,{initialState:t,clerk:i,clerkStatus:a},n)}function ua(e){return v.useContext(qt)&&H.throw(er),v.createElement(la,e)}var da=ua;da.displayName=`ClerkProvider`;var fa=ca?`shared`:``,pa=e=>{let t=v.useMemo(()=>({clerkUIVariant:fa,...e}),[e]),n=v.useRef(oa.getOrCreateInstance(t)),[r,i]=v.useState(n.current.status);return v.useEffect(()=>{n.current.__internal_updateProps({appearance:e.appearance})},[e.appearance]),v.useEffect(()=>{n.current.__internal_updateProps({options:e})},[e.localization]),v.useEffect(()=>(n.current.on(`status`,i),()=>{n.current&&n.current.off(`status`,i),oa.clearInstance()}),[]),{isomorphicClerk:n.current,clerkStatus:r}},ma=t(r(),1),ha=t(n(),1),ga=1e4;function _a(){if(W()&&`Clerk`in window){let e=window.Clerk;if(e&&(e.status===`ready`||e.status===`degraded`)||e?.loaded&&!e.status)return e}}async function va(){if(!W())throw new l(`getToken can only be used in browser environments. To access auth data server-side, see the Auth object reference doc: https://clerk.com/docs/reference/backend/types/auth-object`,{code:`clerk_runtime_not_browser`});let e=_a();if(e)return e;let t=window;if(!t.__clerk_internal_ready){let e,n,r=new Promise((t,r)=>{e=t,n=r});r.__resolve=e,r.__reject=n,t.__clerk_internal_ready=r}let n=t.__clerk_internal_ready,r,i=new Promise((e,t)=>{r=setTimeout(()=>t(new l(`Timeout waiting for Clerk to load.`,{code:`clerk_runtime_load_timeout`})),ga)});return Promise.race([n,i]).finally(()=>{clearTimeout(r)})}async function ya(e){let t=await va();return t.session?t.session.getToken(e):null}if(typeof window<`u`&&!window.global&&(window.global=typeof global>`u`?window:global),globalThis.__clerkSharedModules){let e=globalThis.__clerkSharedModules.react?.version;e&&e!==`19.2.7`&&console.warn(`[@clerk/ui/register] React version mismatch detected. Already registered: ${e}, current import: 19.2.7. This may cause issues with the shared @clerk/ui variant.`)}else globalThis.__clerkSharedModules={react:v,"react-dom":y,"react-dom/client":ma,"react/jsx-runtime":ha};Q(({clerk:e,children:t,...n})=>{let{appearance:r,getContainer:i,component:a,...o}=n;t=K(t,`Invite members`);let s=G(t)(`InviteMembersButton`),c=()=>e.openInviteMembers({appearance:r,getContainer:i}),l=async e=>(s&&typeof s==`object`&&`props`in s&&await q(s.props.onClick)(e),c()),u={...o,onClick:l};return v.cloneElement(s,u)},{component:`InviteMembersButton`,renderWhileLoading:!0});var ba=Q(({clerk:e,children:t,...n})=>{let{appearance:r,getContainer:i,component:a,signUpFallbackRedirectUrl:o,forceRedirectUrl:s,fallbackRedirectUrl:c,signUpForceRedirectUrl:l,mode:u,initialValues:d,withSignUp:f,oauthFlow:p,...m}=n;t=K(t,`Sign in`);let h=G(t)(`SignInButton`),g=()=>{let t={forceRedirectUrl:s,fallbackRedirectUrl:c,signUpFallbackRedirectUrl:o,signUpForceRedirectUrl:l,initialValues:d,withSignUp:f,oauthFlow:p};return u===`modal`?e.openSignIn({...t,appearance:r,getContainer:i}):e.redirectToSignIn({...t,signInFallbackRedirectUrl:c,signInForceRedirectUrl:s})},_=async e=>(h&&typeof h==`object`&&`props`in h&&await q(h.props.onClick)(e),g()),y={...m,onClick:_};return v.cloneElement(h,y)},{component:`SignInButton`,renderWhileLoading:!0});Q(({clerk:e,children:t,...n})=>{let{redirectUrl:r,getContainer:i,component:a,...o}=n;t=K(t,`Sign in with Metamask`);let s=G(t)(`SignInWithMetamaskButton`),c=async()=>{async function t(){await e.authenticateWithMetamask({redirectUrl:r||void 0})}t()},l=async e=>(await q(s.props.onClick)(e),c()),u={...o,onClick:l};return v.cloneElement(s,u)},{component:`SignInWithMetamask`,renderWhileLoading:!0}),Q(({clerk:e,children:t,...n})=>{let{redirectUrl:r=`/`,sessionId:i,signOutOptions:a,getContainer:o,component:s,...c}=n;a&&x("SignOutButton `signOutOptions`","Use the `redirectUrl` and `sessionId` props directly instead."),t=K(t,`Sign out`);let l=G(t)(`SignOutButton`),u=()=>e.signOut({redirectUrl:r,...i!==void 0&&{sessionId:i},...a}
31),d=async e=>(await q(l.props.onClick)(e),u()),f={...c,onClick:d};return v.cloneElement(l,f)},{component:`SignOutButton`,renderWhileLoading:!0}),Q(({clerk:e,children:t,...n})=>{let{appearance:r,unsafeMetadata:i,getContainer:a,component:o,fallbackRedirectUrl:s,forceRedirectUrl:c,signInFallbackRedirectUrl:l,signInForceRedirectUrl:u,mode:d,initialValues:f,oauthFlow:p,...m}=n;t=K(t,`Sign up`);let h=G(t)(`SignUpButton`),g=()=>{let t={fallbackRedirectUrl:s,forceRedirectUrl:c,signInFallbackRedirectUrl:l,signInForceRedirectUrl:u,initialValues:f,oauthFlow:p};return d===`modal`?e.openSignUp({...t,appearance:r,unsafeMetadata:i,getContainer:a}):e.redirectToSignUp({...t,signUpFallbackRedirectUrl:s,signUpForceRedirectUrl:c})},_=async e=>(h&&typeof h==`object`&&`props`in h&&await q(h.props.onClick)(e),g()),y={...m,onClick:_};return v.cloneElement(h,y)},{component:`SignUpButton`,renderWhileLoading:!0}),Yn({packageName:`@clerk/react`}),Fi(`@clerk/react`);export{c as _,da as a,Dn as c,ce as d,oe as f,d as g,m as h,Xi as i,Pe as l,ee as m,ya as n,Zi as o,te as p,Yi as r,Xr as s,ba as t,Fe as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.