@clerk/astro 4.1.26-canary.v20261118155817 → 4.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { a as $isLoadedStore, c as $sessionStore, d as $userStore, i as $clientStore, l as $signInStore, n as $billingStore, o as $organizationStore, r as $clerkStore, s as $sessionListStore, t as $authStore, u as $signUpStore } from "../external-DCu8xhJk.js";
2
- import { n as updateClerkOptions } from "../create-clerk-instance-DJMC9xqR.js";
1
+ import { a as $isLoadedStore, c as $sessionStore, d as $userStore, i as $clientStore, l as $signInStore, n as $billingStore, o as $organizationStore, r as $clerkStore, s as $sessionListStore, t as $authStore, u as $signUpStore } from "../external-C5Ovv5yx.js";
2
+ import { n as updateClerkOptions } from "../create-clerk-instance-DOoYFSIx.js";
3
3
  import { getToken } from "@clerk/shared/getToken";
4
4
 
5
5
  export { $authStore, $billingStore, $clerkStore, $clientStore, $isLoadedStore, $organizationStore, $sessionListStore, $sessionStore, $signInStore, $signUpStore, $userStore, getToken, updateClerkOptions };
@@ -1,4 +1,4 @@
1
- import { f as $clerk, p as $csrState, r as $clerkStore } from "./external-DCu8xhJk.js";
1
+ import { f as $clerk, p as $csrState, r as $clerkStore } from "./external-C5Ovv5yx.js";
2
2
  import { loadClerkJSScript, loadClerkUIScript, setClerkJSLoadingErrorPackageName } from "@clerk/shared/loadClerkJsScript";
3
3
 
4
4
  //#region src/internal/invoke-clerk-astro-js-functions.ts
@@ -165,4 +165,4 @@ async function loadClerkUIEntryChunk(options) {
165
165
 
166
166
  //#endregion
167
167
  export { updateClerkOptions as n, createClerkInstance as t };
168
- //# sourceMappingURL=create-clerk-instance-DJMC9xqR.js.map
168
+ //# sourceMappingURL=create-clerk-instance-DOoYFSIx.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-clerk-instance-DJMC9xqR.js","names":[],"sources":["../src/internal/invoke-clerk-astro-js-functions.ts","../src/internal/mount-clerk-astro-js-components.ts","../src/internal/run-once.ts","../src/internal/create-clerk-instance.ts"],"sourcesContent":["import { $clerk } from '../stores/internal';\n\n/**\n * Loop through any Astro component that has requested to invoke a function and invoke it with its respective props.\n */\nconst invokeClerkAstroJSFunctions = () => {\n const functionNames = ['handleRedirectCallback'] as const;\n\n functionNames.forEach(fnName => {\n const elementsOfCategory = document.querySelectorAll(`[data-clerk-function-id^=\"clerk-${fnName}\"]`);\n elementsOfCategory.forEach(el => {\n const id = el.getAttribute('data-clerk-function-id');\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const props = window.__astro_clerk_function_props?.get(fnName)?.get(id!) ?? {};\n void $clerk.get()?.[fnName]?.(props);\n });\n });\n};\n\nexport { invokeClerkAstroJSFunctions };\n","import type { Clerk } from '@clerk/shared/types';\n\nimport { $clerk } from '../stores/internal';\nimport type { InternalUIComponentId } from '../types';\n\n/**\n * Loop through any Astro component that has requested to mount a UI component and mount it with its respective props.\n */\nconst mountAllClerkAstroJSComponents = () => {\n const mountFns = {\n 'create-organization': 'mountCreateOrganization',\n 'organization-list': 'mountOrganizationList',\n 'organization-profile': 'mountOrganizationProfile',\n 'organization-switcher': 'mountOrganizationSwitcher',\n 'user-avatar': 'mountUserAvatar',\n 'user-button': 'mountUserButton',\n 'user-profile': 'mountUserProfile',\n 'sign-in': 'mountSignIn',\n 'sign-up': 'mountSignUp',\n 'google-one-tap': 'openGoogleOneTap',\n waitlist: 'mountWaitlist',\n 'pricing-table': 'mountPricingTable',\n 'api-keys': 'mountAPIKeys',\n 'oauth-device-verification': '__internal_mountOAuthDeviceVerification',\n } as const satisfies Record<InternalUIComponentId, keyof Clerk>;\n\n Object.entries(mountFns).forEach(([category, mountFn]) => {\n const elementsOfCategory = document.querySelectorAll(`[data-clerk-id^=\"clerk-${category}\"]`);\n elementsOfCategory.forEach(el => {\n const clerkId = el.getAttribute('data-clerk-id') as string;\n const props = window.__astro_clerk_component_props?.get(category)?.get(clerkId);\n if (el) {\n $clerk.get()?.[mountFn](el as HTMLDivElement, props);\n }\n });\n });\n};\n\nexport { mountAllClerkAstroJSComponents };\n","import { invokeClerkAstroJSFunctions } from './invoke-clerk-astro-js-functions';\nimport { mountAllClerkAstroJSComponents } from './mount-clerk-astro-js-components';\nimport type { CreateClerkInstanceInternalFn } from './types';\n\n/**\n * Prevents mounting components multiple times when the `createClerkInstanceInternal` was been called twice without await first\n * This is useful as the \"integration\" may call the function twice at the same time.\n */\nconst runOnce = (onFirst: CreateClerkInstanceInternalFn) => {\n let hasRun = false;\n return (params: Parameters<CreateClerkInstanceInternalFn>[0]) => {\n if (hasRun) {\n const clerkJSInstance = window.Clerk;\n return new Promise(res => {\n if (!clerkJSInstance) {\n return res(false);\n }\n\n if (clerkJSInstance.loaded) {\n mountAllClerkAstroJSComponents();\n invokeClerkAstroJSFunctions();\n }\n return res(clerkJSInstance.loaded);\n });\n }\n /**\n * Probably html streaming has delayed the component from mounting immediately.\n * In Astro, js modules will start executing only after html streaming has ended.\n */\n hasRun = true;\n return onFirst(params);\n };\n};\n\nexport { runOnce };\n","import {\n loadClerkJSScript,\n loadClerkUIScript,\n setClerkJSLoadingErrorPackageName,\n} from '@clerk/shared/loadClerkJsScript';\nimport type { ClerkOptions } from '@clerk/shared/types';\nimport type { ClerkUIConstructor } from '@clerk/shared/ui';\nimport type { Ui } from '@clerk/ui/internal';\n\nimport { $clerkStore } from '../stores/external';\nimport { $clerk, $csrState } from '../stores/internal';\nimport type { AstroClerkCreateInstanceParams, AstroClerkUpdateOptions, InternalRuntimeOptions } from '../types';\nimport { invokeClerkAstroJSFunctions } from './invoke-clerk-astro-js-functions';\nimport { mountAllClerkAstroJSComponents } from './mount-clerk-astro-js-components';\nimport { runOnce } from './run-once';\n\nlet initOptions: ClerkOptions | undefined;\n\nsetClerkJSLoadingErrorPackageName(PACKAGE_NAME);\n\nfunction createNavigationHandler(\n windowNav: typeof window.history.pushState | typeof window.history.replaceState,\n): Exclude<ClerkOptions['routerPush'], undefined> | Exclude<ClerkOptions['routerReplace'], undefined> {\n return (to, opts) => {\n if (opts?.__internal_metadata?.navigationType === 'internal') {\n windowNav(history.state, '', to);\n } else {\n opts?.windowNavigate(to);\n }\n };\n}\n\n/**\n * Prevents firing clerk.load() multiple times\n */\nconst createClerkInstance = runOnce(createClerkInstanceInternal);\n\nasync function createClerkInstanceInternal<TUi extends Ui = Ui>(options?: AstroClerkCreateInstanceParams<TUi>) {\n // Load clerk-js and clerk-ui in parallel.\n // Both functions return early if the scripts are already loaded\n // (e.g., via middleware-injected script tags in the HTML head).\n const clerkJsChunk = getClerkJsEntryChunk(options);\n const ClerkUI = getClerkUIEntryChunk(options);\n\n await clerkJsChunk;\n\n if (!window.Clerk) {\n throw new Error('Failed to download latest ClerkJS. Contact support@clerk.com.');\n }\n\n const clerkJSInstance = window.Clerk;\n\n if (!$clerk.get()) {\n $clerk.set(clerkJSInstance);\n }\n\n const internalOptions = options as AstroClerkCreateInstanceParams<TUi> & InternalRuntimeOptions;\n const keylessClaimUrl = internalOptions.__internal_keylessClaimUrl;\n const keylessApiKeysUrl = internalOptions.__internal_keylessApiKeysUrl;\n\n const clerkOptions = {\n routerPush: createNavigationHandler(window.history.pushState.bind(window.history)),\n routerReplace: createNavigationHandler(window.history.replaceState.bind(window.history)),\n ...options,\n // Pass the clerk-ui constructor promise to clerk.load()\n ui: { ...options?.ui, ClerkUI },\n ...(keylessClaimUrl && { __internal_keyless_claimKeylessApplicationUrl: keylessClaimUrl }),\n ...(keylessApiKeysUrl && { __internal_keyless_copyInstanceKeysUrl: keylessApiKeysUrl }),\n } as unknown as ClerkOptions;\n\n initOptions = clerkOptions;\n\n return clerkJSInstance\n .load(clerkOptions)\n .then(() => {\n $csrState.setKey('isLoaded', true);\n // Notify subscribers that $clerkStore has been loaded.\n // We're doing this because nanostores uses `===` for equality\n // and just by setting the value to `window.Clerk` again won't trigger an update.\n // We notify only once as this store is for advanced users.\n $clerkStore.notify();\n\n mountAllClerkAstroJSComponents();\n invokeClerkAstroJSFunctions();\n\n clerkJSInstance.addListener(payload => {\n $csrState.setKey('client', payload.client);\n $csrState.setKey('user', payload.user);\n $csrState.setKey('session', payload.session);\n $csrState.setKey('organization', payload.organization);\n });\n })\n .catch((err: Error) => {\n console.error(err.stack || err.message || err);\n });\n}\n\nfunction updateClerkOptions<TUi extends Ui = Ui>(options: AstroClerkUpdateOptions<TUi>) {\n const clerk = $clerk.get();\n if (!clerk) {\n throw new Error('Missing clerk instance');\n }\n const updateOptions = {\n options: { ...initOptions, ...options },\n appearance: { ...initOptions?.appearance, ...options.appearance },\n } as unknown as { options: ClerkOptions; appearance?: any };\n // `__internal_updateProps` is not exposed as public API from `@clerk/types`\n void (clerk as any).__internal_updateProps(updateOptions);\n}\n\n/**\n * Loads clerk-js script if not already loaded.\n * Returns early if window.Clerk already exists.\n */\nasync function getClerkJsEntryChunk<TUi extends Ui = Ui>(options?: AstroClerkCreateInstanceParams<TUi>): Promise<void> {\n await loadClerkJSScript(options);\n}\n\n/**\n * Gets the ClerkUI constructor, either from options or by loading the script.\n * Returns early if window.__internal_ClerkUICtor already exists.\n * Returns undefined when prefetchUI={false} (no UI needed).\n */\nfunction getClerkUIEntryChunk<TUi extends Ui = Ui>(\n options?: AstroClerkCreateInstanceParams<TUi>,\n): ClerkUIConstructor | Promise<ClerkUIConstructor> | undefined {\n // Support bundled UI via ui.ClerkUI prop\n if (options?.ui?.ClerkUI) {\n return options.ui.ClerkUI;\n }\n\n // Skip CDN prefetch when ui prop is passed (bundled UI) or prefetchUI is false\n if (options?.ui || options?.prefetchUI === false) {\n return undefined;\n }\n\n return loadClerkUIEntryChunk(options);\n}\n\nasync function loadClerkUIEntryChunk<TUi extends Ui = Ui>(\n options?: AstroClerkCreateInstanceParams<TUi>,\n): Promise<ClerkUIConstructor> {\n await loadClerkUIScript(options as any);\n\n if (!window.__internal_ClerkUICtor) {\n throw new Error('Failed to download latest Clerk UI. Contact support@clerk.com.');\n }\n\n return window.__internal_ClerkUICtor;\n}\n\nexport {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BAAgB,QAAQ,YAAY;EACvD,CAAC;CACH,CAAC,CAAC,CACD,OAAO,QAAe;EACrB,QAAQ,MAAM,IAAI,SAAS,IAAI,WAAW,GAAG;CAC/C,CAAC;AACL;AAEA,SAAS,mBAAwC,SAAuC;CACtF,MAAM,QAAQ,OAAO,IAAI;CACzB,IAAI,CAAC,OACH,MAAM,IAAI,MAAM,wBAAwB;CAE1C,MAAM,gBAAgB;EACpB,SAAS;GAAE,GAAG;GAAa,GAAG;EAAQ;EACtC,YAAY;GAAE,GAAG,aAAa;GAAY,GAAG,QAAQ;EAAW;CAClE;CAEA,AAAM,MAAc,uBAAuB,aAAa;AAC1D;;;;;AAMA,eAAe,qBAA0C,SAA8D;CACrH,MAAM,kBAAkB,OAAO;AACjC;;;;;;AAOA,SAAS,qBACP,SAC8D;CAE9D,IAAI,SAAS,IAAI,SACf,OAAO,QAAQ,GAAG;CAIpB,IAAI,SAAS,MAAM,SAAS,eAAe,OACzC;CAGF,OAAO,sBAAsB,OAAO;AACtC;AAEA,eAAe,sBACb,SAC6B;CAC7B,MAAM,kBAAkB,OAAc;CAEtC,IAAI,CAAC,OAAO,wBACV,MAAM,IAAI,MAAM,gEAAgE;CAGlF,OAAO,OAAO;AAChB"}
1
+ {"version":3,"file":"create-clerk-instance-DOoYFSIx.js","names":[],"sources":["../src/internal/invoke-clerk-astro-js-functions.ts","../src/internal/mount-clerk-astro-js-components.ts","../src/internal/run-once.ts","../src/internal/create-clerk-instance.ts"],"sourcesContent":["import { $clerk } from '../stores/internal';\n\n/**\n * Loop through any Astro component that has requested to invoke a function and invoke it with its respective props.\n */\nconst invokeClerkAstroJSFunctions = () => {\n const functionNames = ['handleRedirectCallback'] as const;\n\n functionNames.forEach(fnName => {\n const elementsOfCategory = document.querySelectorAll(`[data-clerk-function-id^=\"clerk-${fnName}\"]`);\n elementsOfCategory.forEach(el => {\n const id = el.getAttribute('data-clerk-function-id');\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const props = window.__astro_clerk_function_props?.get(fnName)?.get(id!) ?? {};\n void $clerk.get()?.[fnName]?.(props);\n });\n });\n};\n\nexport { invokeClerkAstroJSFunctions };\n","import type { Clerk } from '@clerk/shared/types';\n\nimport { $clerk } from '../stores/internal';\nimport type { InternalUIComponentId } from '../types';\n\n/**\n * Loop through any Astro component that has requested to mount a UI component and mount it with its respective props.\n */\nconst mountAllClerkAstroJSComponents = () => {\n const mountFns = {\n 'create-organization': 'mountCreateOrganization',\n 'organization-list': 'mountOrganizationList',\n 'organization-profile': 'mountOrganizationProfile',\n 'organization-switcher': 'mountOrganizationSwitcher',\n 'user-avatar': 'mountUserAvatar',\n 'user-button': 'mountUserButton',\n 'user-profile': 'mountUserProfile',\n 'sign-in': 'mountSignIn',\n 'sign-up': 'mountSignUp',\n 'google-one-tap': 'openGoogleOneTap',\n waitlist: 'mountWaitlist',\n 'pricing-table': 'mountPricingTable',\n 'api-keys': 'mountAPIKeys',\n 'oauth-device-verification': '__internal_mountOAuthDeviceVerification',\n } as const satisfies Record<InternalUIComponentId, keyof Clerk>;\n\n Object.entries(mountFns).forEach(([category, mountFn]) => {\n const elementsOfCategory = document.querySelectorAll(`[data-clerk-id^=\"clerk-${category}\"]`);\n elementsOfCategory.forEach(el => {\n const clerkId = el.getAttribute('data-clerk-id') as string;\n const props = window.__astro_clerk_component_props?.get(category)?.get(clerkId);\n if (el) {\n $clerk.get()?.[mountFn](el as HTMLDivElement, props);\n }\n });\n });\n};\n\nexport { mountAllClerkAstroJSComponents };\n","import { invokeClerkAstroJSFunctions } from './invoke-clerk-astro-js-functions';\nimport { mountAllClerkAstroJSComponents } from './mount-clerk-astro-js-components';\nimport type { CreateClerkInstanceInternalFn } from './types';\n\n/**\n * Prevents mounting components multiple times when the `createClerkInstanceInternal` was been called twice without await first\n * This is useful as the \"integration\" may call the function twice at the same time.\n */\nconst runOnce = (onFirst: CreateClerkInstanceInternalFn) => {\n let hasRun = false;\n return (params: Parameters<CreateClerkInstanceInternalFn>[0]) => {\n if (hasRun) {\n const clerkJSInstance = window.Clerk;\n return new Promise(res => {\n if (!clerkJSInstance) {\n return res(false);\n }\n\n if (clerkJSInstance.loaded) {\n mountAllClerkAstroJSComponents();\n invokeClerkAstroJSFunctions();\n }\n return res(clerkJSInstance.loaded);\n });\n }\n /**\n * Probably html streaming has delayed the component from mounting immediately.\n * In Astro, js modules will start executing only after html streaming has ended.\n */\n hasRun = true;\n return onFirst(params);\n };\n};\n\nexport { runOnce };\n","import {\n loadClerkJSScript,\n loadClerkUIScript,\n setClerkJSLoadingErrorPackageName,\n} from '@clerk/shared/loadClerkJsScript';\nimport type { ClerkOptions } from '@clerk/shared/types';\nimport type { ClerkUIConstructor } from '@clerk/shared/ui';\nimport type { Ui } from '@clerk/ui/internal';\n\nimport { $clerkStore } from '../stores/external';\nimport { $clerk, $csrState } from '../stores/internal';\nimport type { AstroClerkCreateInstanceParams, AstroClerkUpdateOptions, InternalRuntimeOptions } from '../types';\nimport { invokeClerkAstroJSFunctions } from './invoke-clerk-astro-js-functions';\nimport { mountAllClerkAstroJSComponents } from './mount-clerk-astro-js-components';\nimport { runOnce } from './run-once';\n\nlet initOptions: ClerkOptions | undefined;\n\nsetClerkJSLoadingErrorPackageName(PACKAGE_NAME);\n\nfunction createNavigationHandler(\n windowNav: typeof window.history.pushState | typeof window.history.replaceState,\n): Exclude<ClerkOptions['routerPush'], undefined> | Exclude<ClerkOptions['routerReplace'], undefined> {\n return (to, opts) => {\n if (opts?.__internal_metadata?.navigationType === 'internal') {\n windowNav(history.state, '', to);\n } else {\n opts?.windowNavigate(to);\n }\n };\n}\n\n/**\n * Prevents firing clerk.load() multiple times\n */\nconst createClerkInstance = runOnce(createClerkInstanceInternal);\n\nasync function createClerkInstanceInternal<TUi extends Ui = Ui>(options?: AstroClerkCreateInstanceParams<TUi>) {\n // Load clerk-js and clerk-ui in parallel.\n // Both functions return early if the scripts are already loaded\n // (e.g., via middleware-injected script tags in the HTML head).\n const clerkJsChunk = getClerkJsEntryChunk(options);\n const ClerkUI = getClerkUIEntryChunk(options);\n\n await clerkJsChunk;\n\n if (!window.Clerk) {\n throw new Error('Failed to download latest ClerkJS. Contact support@clerk.com.');\n }\n\n const clerkJSInstance = window.Clerk;\n\n if (!$clerk.get()) {\n $clerk.set(clerkJSInstance);\n }\n\n const internalOptions = options as AstroClerkCreateInstanceParams<TUi> & InternalRuntimeOptions;\n const keylessClaimUrl = internalOptions.__internal_keylessClaimUrl;\n const keylessApiKeysUrl = internalOptions.__internal_keylessApiKeysUrl;\n\n const clerkOptions = {\n routerPush: createNavigationHandler(window.history.pushState.bind(window.history)),\n routerReplace: createNavigationHandler(window.history.replaceState.bind(window.history)),\n ...options,\n // Pass the clerk-ui constructor promise to clerk.load()\n ui: { ...options?.ui, ClerkUI },\n ...(keylessClaimUrl && { __internal_keyless_claimKeylessApplicationUrl: keylessClaimUrl }),\n ...(keylessApiKeysUrl && { __internal_keyless_copyInstanceKeysUrl: keylessApiKeysUrl }),\n } as unknown as ClerkOptions;\n\n initOptions = clerkOptions;\n\n return clerkJSInstance\n .load(clerkOptions)\n .then(() => {\n $csrState.setKey('isLoaded', true);\n // Notify subscribers that $clerkStore has been loaded.\n // We're doing this because nanostores uses `===` for equality\n // and just by setting the value to `window.Clerk` again won't trigger an update.\n // We notify only once as this store is for advanced users.\n $clerkStore.notify();\n\n mountAllClerkAstroJSComponents();\n invokeClerkAstroJSFunctions();\n\n clerkJSInstance.addListener(payload => {\n $csrState.setKey('client', payload.client);\n $csrState.setKey('user', payload.user);\n $csrState.setKey('session', payload.session);\n $csrState.setKey('organization', payload.organization);\n });\n })\n .catch((err: Error) => {\n console.error(err.stack || err.message || err);\n });\n}\n\nfunction updateClerkOptions<TUi extends Ui = Ui>(options: AstroClerkUpdateOptions<TUi>) {\n const clerk = $clerk.get();\n if (!clerk) {\n throw new Error('Missing clerk instance');\n }\n const updateOptions = {\n options: { ...initOptions, ...options },\n appearance: { ...initOptions?.appearance, ...options.appearance },\n } as unknown as { options: ClerkOptions; appearance?: any };\n // `__internal_updateProps` is not exposed as public API from `@clerk/types`\n void (clerk as any).__internal_updateProps(updateOptions);\n}\n\n/**\n * Loads clerk-js script if not already loaded.\n * Returns early if window.Clerk already exists.\n */\nasync function getClerkJsEntryChunk<TUi extends Ui = Ui>(options?: AstroClerkCreateInstanceParams<TUi>): Promise<void> {\n await loadClerkJSScript(options);\n}\n\n/**\n * Gets the ClerkUI constructor, either from options or by loading the script.\n * Returns early if window.__internal_ClerkUICtor already exists.\n * Returns undefined when prefetchUI={false} (no UI needed).\n */\nfunction getClerkUIEntryChunk<TUi extends Ui = Ui>(\n options?: AstroClerkCreateInstanceParams<TUi>,\n): ClerkUIConstructor | Promise<ClerkUIConstructor> | undefined {\n // Support bundled UI via ui.ClerkUI prop\n if (options?.ui?.ClerkUI) {\n return options.ui.ClerkUI;\n }\n\n // Skip CDN prefetch when ui prop is passed (bundled UI) or prefetchUI is false\n if (options?.ui || options?.prefetchUI === false) {\n return undefined;\n }\n\n return loadClerkUIEntryChunk(options);\n}\n\nasync function loadClerkUIEntryChunk<TUi extends Ui = Ui>(\n options?: AstroClerkCreateInstanceParams<TUi>,\n): Promise<ClerkUIConstructor> {\n await loadClerkUIScript(options as any);\n\n if (!window.__internal_ClerkUICtor) {\n throw new Error('Failed to download latest Clerk UI. Contact support@clerk.com.');\n }\n\n return window.__internal_ClerkUICtor;\n}\n\nexport { createClerkInstance, updateClerkOptions };\n"],"mappings":";;;;;;;AAKA,MAAM,oCAAoC;CAGxC,CAFuB,wBAEX,CAAC,CAAC,SAAQ,WAAU;EAE9B,AAD2B,SAAS,iBAAiB,mCAAmC,OAAO,GAC9E,CAAC,CAAC,SAAQ,OAAM;GAC/B,MAAM,KAAK,GAAG,aAAa,wBAAwB;GAEnD,MAAM,QAAQ,OAAO,8BAA8B,IAAI,MAAM,CAAC,EAAE,IAAI,EAAG,KAAK,CAAC;GAC7E,AAAK,OAAO,IAAI,CAAC,GAAG,OAAO,GAAG,KAAK;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;CAClE;CAEA,AAAM,MAAc,uBAAuB,aAAa;AAC1D;;;;;AAMA,eAAe,qBAA0C,SAA8D;CACrH,MAAM,kBAAkB,OAAO;AACjC;;;;;;AAOA,SAAS,qBACP,SAC8D;CAE9D,IAAI,SAAS,IAAI,SACf,OAAO,QAAQ,GAAG;CAIpB,IAAI,SAAS,MAAM,SAAS,eAAe,OACzC;CAGF,OAAO,sBAAsB,OAAO;AACtC;AAEA,eAAe,sBACb,SAC6B;CAC7B,MAAM,kBAAkB,OAAc;CAEtC,IAAI,CAAC,OAAO,wBACV,MAAM,IAAI,MAAM,gEAAgE;CAGlF,OAAO,OAAO;AAChB"}
@@ -117,7 +117,7 @@ const $signUpStore = computed([$clientStore], (client) => client?.signUp);
117
117
  * @example
118
118
  * $billingStore.subscribe((billing) => billing.getPlans().then((plans) => console.log(plans.data.length)))
119
119
  */
120
- const $billingStore = computed([$clerk], (clerk) => clerk?.billing);
120
+ const $billingStore = computed([$clerk, $isLoadedStore], (clerk, isLoaded) => isLoaded ? clerk?.billing : void 0);
121
121
  /**
122
122
  * Records a telemetry event when a store is used to match React hooks telemetry.
123
123
  *
@@ -135,4 +135,4 @@ recordTelemetryEvent($organizationStore, "$organizationStore");
135
135
 
136
136
  //#endregion
137
137
  export { $isLoadedStore as a, $sessionStore as c, $userStore as d, $clerk as f, $clientStore as i, $signInStore as l, $initialState as m, $billingStore as n, $organizationStore as o, $csrState as p, $clerkStore as r, $sessionListStore as s, $authStore as t, $signUpStore as u };
138
- //# sourceMappingURL=external-DCu8xhJk.js.map
138
+ //# sourceMappingURL=external-C5Ovv5yx.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"external-DCu8xhJk.js","names":[],"sources":["../src/stores/internal.ts","../src/stores/external.ts"],"sourcesContent":["import type {\n Clerk,\n ClientResource,\n InitialState,\n OrganizationResource,\n SignedInSessionResource,\n UserResource,\n} from '@clerk/shared/types';\nimport { atom, map } from 'nanostores';\n\nexport const $csrState = map<{\n isLoaded: boolean;\n client: ClientResource | undefined | null;\n user: UserResource | undefined | null;\n session: SignedInSessionResource | undefined | null;\n organization: OrganizationResource | undefined | null;\n}>({\n isLoaded: false,\n client: undefined,\n user: undefined,\n session: undefined,\n organization: undefined,\n});\n\nexport const $initialState = map<InitialState>({} as InitialState);\n\n// Use atom instead of `map` to prohibit key changes and allow only replacing the whole object\nexport const $clerk = atom<Clerk | null>(null);\n","import { deriveState } from '@clerk/shared/deriveState';\nimport { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type { SignedInSessionResource } from '@clerk/shared/types';\nimport { batched, computed, onMount, type Store } from 'nanostores';\n\nimport { $clerk, $csrState, $initialState } from './internal';\n\n/**\n * A client side store that returns the loaded state of clerk-js.\n *\n * @example\n * $isLoadedStore.subscribe((authloaded => console.log(loaded))\n */\nexport const $isLoadedStore = computed([$csrState], state => state.isLoaded);\n\n/**\n * A client side store that is prepopulated with the authentication context during SSR.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $authStore.subscribe((auth) => console.log(auth.userId))\n */\nexport const $authStore = batched([$csrState, $initialState], (state, initialState) => {\n return deriveState(\n state.isLoaded,\n {\n session: state.session,\n user: state.user,\n organization: state.organization,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n client: state.client!,\n },\n initialState,\n );\n});\n\n/**\n * A client side store that is populated after clerk-js has loaded.\n * The store returns back the authenticated user or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $userStore.subscribe((user) => console.log(user.id))\n */\nexport const $userStore = computed([$authStore], auth => auth.user);\n\n/**\n * A client side store that is populated after clerk-js has loaded.\n * The store returns the session of the authenticated user or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $sessionStore.subscribe((session) => console.log(session.id))\n */\nexport const $sessionStore = computed([$authStore], auth => auth.session as SignedInSessionResource | null | undefined);\n\n/**\n * A client side store that is populated after clerk-js has loaded.\n * The store returns the Active Organization of the authenticated user or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $organizationStore.subscribe((org) => console.log(org.id))\n */\nexport const $organizationStore = computed([$authStore], auth => auth.organization);\n\n/**\n * A client side store that is populated after clerk-js has loaded.\n * The store returns the clerk client or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $clientStore.subscribe((client) => console.log(client?.signedInSessions?.length))\n */\nexport const $clientStore = computed([$csrState], csr => csr.client);\n\n/**\n * A client side store that is populated after clerk-js is instanciated.\n * The store returns the clerk instance or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $clerkStore.subscribe((clerk) => console.log(clerk.publishableKey))\n */\nexport const $clerkStore = computed([$clerk], clerk => clerk);\n\n/**\n * A client side store that is populated after clerk-js has loaded.\n * The store returns all the sessions of the current clerk client or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $sessionListStore.subscribe((sessionList) => sessionList.map((session) => console.log('Session id:', sessino.id) ))\n */\nexport const $sessionListStore = computed([$clientStore], client => client?.sessions);\n\n/**\n * A client side store that is populated after clerk-js has loaded.\n * The store returns a `SignInResource` or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $signInStore.subscribe((signIn) => console.log(signIn.status))\n */\nexport const $signInStore = computed([$clientStore], client => client?.signIn);\n\n/**\n * A client side store that is populated after clerk-js has loaded.\n * The store returns a `SignUpResource` or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $signUpStore.subscribe((signUp) => console.log(signUp.status))\n */\nexport const $signUpStore = computed([$clientStore], client => client?.signUp);\n\n/**\n * A client side store that is populated after clerk-js has loaded.\n * The store returns a `BillingNamespace` or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $billingStore.subscribe((billing) => billing.getPlans().then((plans) => console.log(plans.data.length)))\n */\nexport const $billingStore = computed([$clerk], clerk => clerk?.billing);\n\n/**\n * Records a telemetry event when a store is used to match React hooks telemetry.\n *\n * @param {Store} store - The nanostore instance to monitor.\n * @param {string} method - The name of the method associated with the store usage.\n */\nconst recordTelemetryEvent = (store: Store, method: string) => {\n onMount(store, () => {\n $clerk.get()?.telemetry?.record(eventMethodCalled(method));\n });\n};\n\nrecordTelemetryEvent($signInStore, '$signInStore');\nrecordTelemetryEvent($signUpStore, '$signUpStore');\nrecordTelemetryEvent($organizationStore, '$organizationStore');\n"],"mappings":";;;;;AAUA,MAAa,YAAY,IAMtB;CACD,UAAU;CACV,QAAQ;CACR,MAAM;CACN,SAAS;CACT,cAAc;AAChB,CAAC;AAED,MAAa,gBAAgB,IAAkB,CAAC,CAAiB;AAGjE,MAAa,SAAS,KAAmB,IAAI;;;;;;;;;;ACd7C,MAAa,iBAAiB,SAAS,CAAC,SAAS,IAAG,UAAS,MAAM,QAAQ;;;;;;;;AAS3E,MAAa,aAAa,QAAQ,CAAC,WAAW,aAAa,IAAI,OAAO,iBAAiB;CACrF,OAAO,YACL,MAAM,UACN;EACE,SAAS,MAAM;EACf,MAAM,MAAM;EACZ,cAAc,MAAM;EAEpB,QAAQ,MAAM;CAChB,GACA,YACF;AACF,CAAC;;;;;;;;;AAUD,MAAa,aAAa,SAAS,CAAC,UAAU,IAAG,SAAQ,KAAK,IAAI;;;;;;;;;AAUlE,MAAa,gBAAgB,SAAS,CAAC,UAAU,IAAG,SAAQ,KAAK,OAAqD;;;;;;;;;AAUtH,MAAa,qBAAqB,SAAS,CAAC,UAAU,IAAG,SAAQ,KAAK,YAAY;;;;;;;;;AAUlF,MAAa,eAAe,SAAS,CAAC,SAAS,IAAG,QAAO,IAAI,MAAM;;;;;;;;;AAUnE,MAAa,cAAc,SAAS,CAAC,MAAM,IAAG,UAAS,KAAK;;;;;;;;;AAU5D,MAAa,oBAAoB,SAAS,CAAC,YAAY,IAAG,WAAU,QAAQ,QAAQ;;;;;;;;;AAUpF,MAAa,eAAe,SAAS,CAAC,YAAY,IAAG,WAAU,QAAQ,MAAM;;;;;;;;;AAU7E,MAAa,eAAe,SAAS,CAAC,YAAY,IAAG,WAAU,QAAQ,MAAM;;;;;;;;;AAU7E,MAAa,gBAAgB,SAAS,CAAC,MAAM,IAAG,UAAS,OAAO,OAAO;;;;;;;AAQvE,MAAM,wBAAwB,OAAc,WAAmB;CAC7D,QAAQ,aAAa;EACnB,OAAO,IAAI,CAAC,EAAE,WAAW,OAAO,kBAAkB,MAAM,CAAC;CAC3D,CAAC;AACH;AAEA,qBAAqB,cAAc,cAAc;AACjD,qBAAqB,cAAc,cAAc;AACjD,qBAAqB,oBAAoB,oBAAoB"}
1
+ {"version":3,"file":"external-C5Ovv5yx.js","names":[],"sources":["../src/stores/internal.ts","../src/stores/external.ts"],"sourcesContent":["import type {\n Clerk,\n ClientResource,\n InitialState,\n OrganizationResource,\n SignedInSessionResource,\n UserResource,\n} from '@clerk/shared/types';\nimport { atom, map } from 'nanostores';\n\nexport const $csrState = map<{\n isLoaded: boolean;\n client: ClientResource | undefined | null;\n user: UserResource | undefined | null;\n session: SignedInSessionResource | undefined | null;\n organization: OrganizationResource | undefined | null;\n}>({\n isLoaded: false,\n client: undefined,\n user: undefined,\n session: undefined,\n organization: undefined,\n});\n\nexport const $initialState = map<InitialState>({} as InitialState);\n\n// Use atom instead of `map` to prohibit key changes and allow only replacing the whole object\nexport const $clerk = atom<Clerk | null>(null);\n","import { deriveState } from '@clerk/shared/deriveState';\nimport { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type { SignedInSessionResource } from '@clerk/shared/types';\nimport { batched, computed, onMount, type Store } from 'nanostores';\n\nimport { $clerk, $csrState, $initialState } from './internal';\n\n/**\n * A client side store that returns the loaded state of clerk-js.\n *\n * @example\n * $isLoadedStore.subscribe((authloaded => console.log(loaded))\n */\nexport const $isLoadedStore = computed([$csrState], state => state.isLoaded);\n\n/**\n * A client side store that is prepopulated with the authentication context during SSR.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $authStore.subscribe((auth) => console.log(auth.userId))\n */\nexport const $authStore = batched([$csrState, $initialState], (state, initialState) => {\n return deriveState(\n state.isLoaded,\n {\n session: state.session,\n user: state.user,\n organization: state.organization,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n client: state.client!,\n },\n initialState,\n );\n});\n\n/**\n * A client side store that is populated after clerk-js has loaded.\n * The store returns back the authenticated user or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $userStore.subscribe((user) => console.log(user.id))\n */\nexport const $userStore = computed([$authStore], auth => auth.user);\n\n/**\n * A client side store that is populated after clerk-js has loaded.\n * The store returns the session of the authenticated user or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $sessionStore.subscribe((session) => console.log(session.id))\n */\nexport const $sessionStore = computed([$authStore], auth => auth.session as SignedInSessionResource | null | undefined);\n\n/**\n * A client side store that is populated after clerk-js has loaded.\n * The store returns the Active Organization of the authenticated user or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $organizationStore.subscribe((org) => console.log(org.id))\n */\nexport const $organizationStore = computed([$authStore], auth => auth.organization);\n\n/**\n * A client side store that is populated after clerk-js has loaded.\n * The store returns the clerk client or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $clientStore.subscribe((client) => console.log(client?.signedInSessions?.length))\n */\nexport const $clientStore = computed([$csrState], csr => csr.client);\n\n/**\n * A client side store that is populated after clerk-js is instanciated.\n * The store returns the clerk instance or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $clerkStore.subscribe((clerk) => console.log(clerk.publishableKey))\n */\nexport const $clerkStore = computed([$clerk], clerk => clerk);\n\n/**\n * A client side store that is populated after clerk-js has loaded.\n * The store returns all the sessions of the current clerk client or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $sessionListStore.subscribe((sessionList) => sessionList.map((session) => console.log('Session id:', sessino.id) ))\n */\nexport const $sessionListStore = computed([$clientStore], client => client?.sessions);\n\n/**\n * A client side store that is populated after clerk-js has loaded.\n * The store returns a `SignInResource` or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $signInStore.subscribe((signIn) => console.log(signIn.status))\n */\nexport const $signInStore = computed([$clientStore], client => client?.signIn);\n\n/**\n * A client side store that is populated after clerk-js has loaded.\n * The store returns a `SignUpResource` or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $signUpStore.subscribe((signUp) => console.log(signUp.status))\n */\nexport const $signUpStore = computed([$clientStore], client => client?.signUp);\n\n/**\n * A client side store that is populated after clerk-js has loaded.\n * The store returns a `BillingNamespace` or `null`.\n * It is a nanostore, for instructions on how to use nanostores please review the [documentation](https://github.com/nanostores/nanostores)\n *\n * @example\n * $billingStore.subscribe((billing) => billing.getPlans().then((plans) => console.log(plans.data.length)))\n */\nexport const $billingStore = computed([$clerk, $isLoadedStore], (clerk, isLoaded) =>\n isLoaded ? clerk?.billing : undefined,\n);\n\n/**\n * Records a telemetry event when a store is used to match React hooks telemetry.\n *\n * @param {Store} store - The nanostore instance to monitor.\n * @param {string} method - The name of the method associated with the store usage.\n */\nconst recordTelemetryEvent = (store: Store, method: string) => {\n onMount(store, () => {\n $clerk.get()?.telemetry?.record(eventMethodCalled(method));\n });\n};\n\nrecordTelemetryEvent($signInStore, '$signInStore');\nrecordTelemetryEvent($signUpStore, '$signUpStore');\nrecordTelemetryEvent($organizationStore, '$organizationStore');\n"],"mappings":";;;;;AAUA,MAAa,YAAY,IAMtB;CACD,UAAU;CACV,QAAQ;CACR,MAAM;CACN,SAAS;CACT,cAAc;AAChB,CAAC;AAED,MAAa,gBAAgB,IAAkB,CAAC,CAAiB;AAGjE,MAAa,SAAS,KAAmB,IAAI;;;;;;;;;;ACd7C,MAAa,iBAAiB,SAAS,CAAC,SAAS,IAAG,UAAS,MAAM,QAAQ;;;;;;;;AAS3E,MAAa,aAAa,QAAQ,CAAC,WAAW,aAAa,IAAI,OAAO,iBAAiB;CACrF,OAAO,YACL,MAAM,UACN;EACE,SAAS,MAAM;EACf,MAAM,MAAM;EACZ,cAAc,MAAM;EAEpB,QAAQ,MAAM;CAChB,GACA,YACF;AACF,CAAC;;;;;;;;;AAUD,MAAa,aAAa,SAAS,CAAC,UAAU,IAAG,SAAQ,KAAK,IAAI;;;;;;;;;AAUlE,MAAa,gBAAgB,SAAS,CAAC,UAAU,IAAG,SAAQ,KAAK,OAAqD;;;;;;;;;AAUtH,MAAa,qBAAqB,SAAS,CAAC,UAAU,IAAG,SAAQ,KAAK,YAAY;;;;;;;;;AAUlF,MAAa,eAAe,SAAS,CAAC,SAAS,IAAG,QAAO,IAAI,MAAM;;;;;;;;;AAUnE,MAAa,cAAc,SAAS,CAAC,MAAM,IAAG,UAAS,KAAK;;;;;;;;;AAU5D,MAAa,oBAAoB,SAAS,CAAC,YAAY,IAAG,WAAU,QAAQ,QAAQ;;;;;;;;;AAUpF,MAAa,eAAe,SAAS,CAAC,YAAY,IAAG,WAAU,QAAQ,MAAM;;;;;;;;;AAU7E,MAAa,eAAe,SAAS,CAAC,YAAY,IAAG,WAAU,QAAQ,MAAM;;;;;;;;;AAU7E,MAAa,gBAAgB,SAAS,CAAC,QAAQ,cAAc,IAAI,OAAO,aACtE,WAAW,OAAO,UAAU,MAC9B;;;;;;;AAQA,MAAM,wBAAwB,OAAc,WAAmB;CAC7D,QAAQ,aAAa;EACnB,OAAO,IAAI,CAAC,EAAE,WAAW,OAAO,kBAAkB,MAAM,CAAC;CAC3D,CAAC;AACH;AAEA,qBAAqB,cAAc,cAAc;AACjD,qBAAqB,cAAc,cAAc;AACjD,qBAAqB,oBAAoB,oBAAoB"}
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { envField } from "astro/config";
2
2
 
3
3
  //#region package.json
4
4
  var name = "@clerk/astro";
5
- var version = "4.1.26-canary.v20261118155817";
5
+ var version = "4.1.26";
6
6
 
7
7
  //#endregion
8
8
  //#region src/integration/snippets.ts
@@ -1,5 +1,5 @@
1
- import { m as $initialState } from "../external-DCu8xhJk.js";
2
- import { t as createClerkInstance } from "../create-clerk-instance-DJMC9xqR.js";
1
+ import { m as $initialState } from "../external-C5Ovv5yx.js";
2
+ import { t as createClerkInstance } from "../create-clerk-instance-DOoYFSIx.js";
3
3
  import { i as readHeadData, n as CLERK_ASTRO_SAFE_VARS, t as CLERK_ASTRO_DATA } from "../head-data-DHdj_b8j.js";
4
4
  import { isTruthy } from "@clerk/shared/underscore";
5
5
  import { customAlphabet, urlAlphabet } from "nanoid";
@@ -1,4 +1,4 @@
1
- import { f as $clerk, p as $csrState, t as $authStore } from "../external-DCu8xhJk.js";
1
+ import { f as $clerk, p as $csrState, t as $authStore } from "../external-C5Ovv5yx.js";
2
2
  import React, { useCallback, useEffect, useMemo, useState, useSyncExternalStore } from "react";
3
3
  import { computed } from "nanostores";
4
4
  import { Fragment, jsx } from "react/jsx-runtime";
@@ -155,10 +155,10 @@ const createClerkClientWithOptions = (context, options) => createClerkClient$1({
155
155
  proxyUrl: getSafeEnv(context).proxyUrl,
156
156
  domain: getSafeEnv(context).domain,
157
157
  isSatellite: getSafeEnv(context).isSatellite,
158
- userAgent: `@clerk/astro@4.1.26-canary.v20261118155817`,
158
+ userAgent: `@clerk/astro@4.1.26`,
159
159
  sdkMetadata: {
160
160
  name: "@clerk/astro",
161
- version: "4.1.26-canary.v20261118155817",
161
+ version: "4.1.26",
162
162
  environment: import.meta.env.MODE
163
163
  },
164
164
  telemetry: {
@@ -1 +1 @@
1
- {"version":3,"file":"external.d.ts","sourceRoot":"","sources":["../../../src/stores/external.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAKnE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,4CAAiD,CAAC;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;EAYrB,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,kGAA4C,CAAC;AAEpE;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,kKAA6F,CAAC;AAExH;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,0GAAoD,CAAC;AAEpF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,oGAA2C,CAAC;AAErE;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,+EAAqC,CAAC;AAE9D;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,gGAAuD,CAAC;AAEtF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,6FAAqD,CAAC;AAE/E;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,6FAAqD,CAAC;AAE/E;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,+FAA8C,CAAC"}
1
+ {"version":3,"file":"external.d.ts","sourceRoot":"","sources":["../../../src/stores/external.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAKnE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,4CAAiD,CAAC;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;EAYrB,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,kGAA4C,CAAC;AAEpE;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,kKAA6F,CAAC;AAExH;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,0GAAoD,CAAC;AAEpF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,oGAA2C,CAAC;AAErE;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,+EAAqC,CAAC;AAE9D;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,gGAAuD,CAAC;AAEtF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,6FAAqD,CAAC;AAE/E;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,6FAAqD,CAAC;AAE/E;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,+FAEzB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerk/astro",
3
- "version": "4.1.26-canary.v20261118155817",
3
+ "version": "4.1.26",
4
4
  "description": "Clerk SDK for Astro",
5
5
  "keywords": [
6
6
  "auth",
@@ -77,13 +77,13 @@
77
77
  "types.ts"
78
78
  ],
79
79
  "dependencies": {
80
- "@clerk/backend": "3.31.0-canary.v20261118155817",
81
- "@clerk/shared": "4.47.0-canary.v20261118155817",
80
+ "@clerk/backend": "^3.31.0",
81
+ "@clerk/shared": "^4.47.0",
82
82
  "nanoid": "5.1.16",
83
83
  "nanostores": "1.5.1"
84
84
  },
85
85
  "devDependencies": {
86
- "@clerk/ui": "1.43.1-canary.v20261118155817",
86
+ "@clerk/ui": "^1.43.1",
87
87
  "astro": "^7.0.0"
88
88
  },
89
89
  "peerDependencies": {