@clerk/chrome-extension 2.8.2-snapshot.v20251113231557 → 2.8.2-snapshot.v20251117183539

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  var React7 = require('react');
4
- var jsxRuntime = require('react/jsx-runtime');
5
4
  var index_js = require('use-sync-external-store/shim/index.js');
6
5
  var reactDom = require('react-dom');
7
6
  var noRhc = require('@clerk/clerk-js/no-rhc');
8
7
  var browser = require('webextension-polyfill');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
9
 
10
10
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
11
 
@@ -367,7 +367,7 @@ var isomorphicAtob = (data) => {
367
367
  return data;
368
368
  };
369
369
 
370
- // ../shared/dist/runtime/keys-Dcilj3cS.mjs
370
+ // ../shared/dist/runtime/keys-YNv6yjKk.mjs
371
371
  var PUBLISHABLE_KEY_LIVE_PREFIX = "pk_live_";
372
372
  var PUBLISHABLE_KEY_TEST_PREFIX = "pk_test_";
373
373
  function isValidDecodedPublishableKey(decoded) {
@@ -405,20 +405,18 @@ function parsePublishableKey(key, options = {}) {
405
405
  }
406
406
  function isPublishableKey(key = "") {
407
407
  try {
408
- const hasValidPrefix = key.startsWith(PUBLISHABLE_KEY_LIVE_PREFIX) || key.startsWith(PUBLISHABLE_KEY_TEST_PREFIX);
409
- if (!hasValidPrefix) return false;
408
+ if (!(key.startsWith(PUBLISHABLE_KEY_LIVE_PREFIX) || key.startsWith(PUBLISHABLE_KEY_TEST_PREFIX))) return false;
410
409
  const parts = key.split("_");
411
410
  if (parts.length !== 3) return false;
412
411
  const encodedPart = parts[2];
413
412
  if (!encodedPart) return false;
414
- const decoded = isomorphicAtob(encodedPart);
415
- return isValidDecodedPublishableKey(decoded);
413
+ return isValidDecodedPublishableKey(isomorphicAtob(encodedPart));
416
414
  } catch {
417
415
  return false;
418
416
  }
419
417
  }
420
418
 
421
- // ../shared/dist/runtime/telemetry-x9LpQpc1.mjs
419
+ // ../shared/dist/runtime/telemetry-wqMDWlvR.mjs
422
420
  var EVENT_METHOD_CALLED = "METHOD_CALLED";
423
421
  var EVENT_SAMPLING_RATE$2 = 0.1;
424
422
  function eventMethodCalled(method, payload) {
@@ -444,20 +442,19 @@ var isReverificationHint = (result) => {
444
442
  return result && typeof result === "object" && "clerk_error" in result && ((_a5 = result.clerk_error) == null ? void 0 : _a5.type) === "forbidden" && ((_b = result.clerk_error) == null ? void 0 : _b.reason) === REVERIFICATION_REASON;
445
443
  };
446
444
 
447
- // ../shared/dist/runtime/noop-8bk75rVj.mjs
445
+ // ../shared/dist/runtime/noop-B3MbDAfb.mjs
448
446
  var noop = (..._args) => {
449
447
  };
450
448
 
451
- // ../shared/dist/runtime/createDeferredPromise-UKTFg5ib.mjs
449
+ // ../shared/dist/runtime/createDeferredPromise-CjYZzUuU.mjs
452
450
  var createDeferredPromise = () => {
453
451
  let resolve = noop;
454
452
  let reject = noop;
455
- const promise = new Promise((res, rej) => {
456
- resolve = res;
457
- reject = rej;
458
- });
459
453
  return {
460
- promise,
454
+ promise: new Promise((res, rej) => {
455
+ resolve = res;
456
+ reject = rej;
457
+ }),
461
458
  resolve,
462
459
  reject
463
460
  };
@@ -1774,7 +1771,7 @@ function dequal2(foo, bar) {
1774
1771
 
1775
1772
  // ../shared/dist/runtime/react/index.mjs
1776
1773
  function assertContextExists(contextVal, msgOrCtx) {
1777
- if (!contextVal) throw typeof msgOrCtx === "string" ? new Error(msgOrCtx) : new Error(`${msgOrCtx.displayName} not found`);
1774
+ if (!contextVal) throw typeof msgOrCtx === "string" ? new Error(msgOrCtx) : /* @__PURE__ */ new Error(`${msgOrCtx.displayName} not found`);
1778
1775
  }
1779
1776
  var createContextAndHook = (displayName, options) => {
1780
1777
  const { assertCtxFn = assertContextExists } = {};
@@ -1796,10 +1793,7 @@ var createContextAndHook = (displayName, options) => {
1796
1793
  ];
1797
1794
  };
1798
1795
  function SWRConfigCompat({ swrConfig, children }) {
1799
- return /* @__PURE__ */ jsxRuntime.jsx(SWRConfig2, {
1800
- value: swrConfig,
1801
- children
1802
- });
1796
+ return /* @__PURE__ */ React7__default.default.createElement(SWRConfig2, { value: swrConfig }, children);
1803
1797
  }
1804
1798
  var [ClerkInstanceContext, useClerkInstanceContext] = createContextAndHook("ClerkInstanceContext");
1805
1799
  var [UserContext, useUserContext] = createContextAndHook("UserContext");
@@ -1808,24 +1802,14 @@ var [SessionContext, useSessionContext] = createContextAndHook("SessionContext")
1808
1802
  React7__default.default.createContext({});
1809
1803
  var [CheckoutContext] = createContextAndHook("CheckoutContext");
1810
1804
  var __experimental_CheckoutProvider = ({ children, ...rest }) => {
1811
- return /* @__PURE__ */ jsxRuntime.jsx(CheckoutContext.Provider, {
1812
- value: { value: rest },
1813
- children
1814
- });
1805
+ return /* @__PURE__ */ React7__default.default.createElement(CheckoutContext.Provider, { value: { value: rest } }, children);
1815
1806
  };
1816
1807
  var [OrganizationContextInternal, useOrganizationContext] = createContextAndHook("OrganizationContext");
1817
1808
  var OrganizationProvider = ({ children, organization, swrConfig }) => {
1818
- return /* @__PURE__ */ jsxRuntime.jsx(SWRConfigCompat, {
1819
- swrConfig,
1820
- children: /* @__PURE__ */ jsxRuntime.jsx(OrganizationContextInternal.Provider, {
1821
- value: { value: { organization } },
1822
- children
1823
- })
1824
- });
1809
+ return /* @__PURE__ */ React7__default.default.createElement(SWRConfigCompat, { swrConfig }, /* @__PURE__ */ React7__default.default.createElement(OrganizationContextInternal.Provider, { value: { value: { organization } } }, children));
1825
1810
  };
1826
1811
  function useAssertWrappedByClerkProvider(displayNameOrFn) {
1827
- const ctx = React7__default.default.useContext(ClerkInstanceContext);
1828
- if (!ctx) {
1812
+ if (!React7__default.default.useContext(ClerkInstanceContext)) {
1829
1813
  if (typeof displayNameOrFn === "function") {
1830
1814
  displayNameOrFn();
1831
1815
  return;
@@ -1839,6 +1823,23 @@ Possible fixes:
1839
1823
  Learn more: https://clerk.com/docs/components/clerk-provider`.trim());
1840
1824
  }
1841
1825
  }
1826
+ function createCacheKeys(params) {
1827
+ return {
1828
+ queryKey: [
1829
+ params.stablePrefix,
1830
+ params.authenticated,
1831
+ params.tracked,
1832
+ params.untracked
1833
+ ],
1834
+ invalidationKey: [
1835
+ params.stablePrefix,
1836
+ params.authenticated,
1837
+ params.tracked
1838
+ ],
1839
+ stableKey: params.stablePrefix,
1840
+ authenticated: params.authenticated
1841
+ };
1842
+ }
1842
1843
  var useWithSafeValues = (params, defaultValues) => {
1843
1844
  var _a5, _b, _c;
1844
1845
  const shouldUseDefaults = typeof params === "boolean" && params;
@@ -1875,51 +1876,51 @@ var cachingSWRInfiniteOptions = {
1875
1876
  ...cachingSWROptions,
1876
1877
  revalidateFirstPage: false
1877
1878
  };
1878
- var usePagesOrInfinite = (params, fetcher, config, cacheKeys) => {
1879
+ var usePagesOrInfinite = (params) => {
1879
1880
  var _a5, _b, _c, _d, _e, _f, _g;
1880
- const [paginatedPage, setPaginatedPage] = React7.useState((_a5 = params.initialPage) != null ? _a5 : 1);
1881
- const initialPageRef = React7.useRef((_b = params.initialPage) != null ? _b : 1);
1882
- const pageSizeRef = React7.useRef((_c = params.pageSize) != null ? _c : 10);
1881
+ const { fetcher, config, keys } = params;
1882
+ const [paginatedPage, setPaginatedPage] = React7.useState((_a5 = config.initialPage) != null ? _a5 : 1);
1883
+ const initialPageRef = React7.useRef((_b = config.initialPage) != null ? _b : 1);
1884
+ const pageSizeRef = React7.useRef((_c = config.pageSize) != null ? _c : 10);
1883
1885
  const enabled = (_d = config.enabled) != null ? _d : true;
1884
1886
  const cacheMode = config.__experimental_mode === "cache";
1885
1887
  const triggerInfinite = (_e = config.infinite) != null ? _e : false;
1886
1888
  const keepPreviousData = (_f = config.keepPreviousData) != null ? _f : false;
1887
1889
  const isSignedIn = config.isSignedIn;
1888
1890
  const pagesCacheKey = {
1889
- ...cacheKeys,
1890
- ...params,
1891
+ type: keys.queryKey[0],
1892
+ ...keys.queryKey[2],
1893
+ ...keys.queryKey[3].args,
1891
1894
  initialPage: paginatedPage,
1892
1895
  pageSize: pageSizeRef.current
1893
1896
  };
1894
1897
  const previousIsSignedIn = usePreviousValue(isSignedIn);
1895
1898
  const shouldFetch = !triggerInfinite && enabled && (!cacheMode ? !!fetcher : true);
1896
- const swrKey = typeof isSignedIn === "boolean" ? previousIsSignedIn === true && isSignedIn === false ? pagesCacheKey : isSignedIn ? shouldFetch ? pagesCacheKey : null : null : shouldFetch ? pagesCacheKey : null;
1897
- const swrFetcher = !cacheMode && !!fetcher ? (cacheKeyParams) => {
1899
+ const { data: swrData, isValidating: swrIsValidating, isLoading: swrIsLoading, error: swrError, mutate: swrMutate } = useSWR(typeof isSignedIn === "boolean" ? previousIsSignedIn === true && isSignedIn === false ? pagesCacheKey : isSignedIn ? shouldFetch ? pagesCacheKey : null : null : shouldFetch ? pagesCacheKey : null, !cacheMode && !!fetcher ? (cacheKeyParams) => {
1898
1900
  if (isSignedIn === false || shouldFetch === false) return null;
1899
- const requestParams = getDifferentKeys(cacheKeyParams, cacheKeys);
1900
- return fetcher({
1901
- ...params,
1902
- ...requestParams
1903
- });
1904
- } : null;
1905
- const { data: swrData, isValidating: swrIsValidating, isLoading: swrIsLoading, error: swrError, mutate: swrMutate } = useSWR(swrKey, swrFetcher, {
1901
+ return fetcher(getDifferentKeys(cacheKeyParams, {
1902
+ type: keys.queryKey[0],
1903
+ ...keys.queryKey[2]
1904
+ }));
1905
+ } : null, {
1906
1906
  keepPreviousData,
1907
1907
  ...cachingSWROptions
1908
1908
  });
1909
1909
  const { data: swrInfiniteData, isLoading: swrInfiniteIsLoading, isValidating: swrInfiniteIsValidating, error: swrInfiniteError, size, setSize, mutate: swrInfiniteMutate } = useSWRInfinite((pageIndex) => {
1910
1910
  if (!triggerInfinite || !enabled || isSignedIn === false) return null;
1911
1911
  return {
1912
- ...params,
1913
- ...cacheKeys,
1912
+ type: keys.queryKey[0],
1913
+ ...keys.queryKey[2],
1914
+ ...keys.queryKey[3].args,
1914
1915
  initialPage: initialPageRef.current + pageIndex,
1915
1916
  pageSize: pageSizeRef.current
1916
1917
  };
1917
1918
  }, (cacheKeyParams) => {
1918
- const requestParams = getDifferentKeys(cacheKeyParams, cacheKeys);
1919
- return fetcher == null ? void 0 : fetcher({
1920
- ...params,
1921
- ...requestParams
1919
+ const requestParams = getDifferentKeys(cacheKeyParams, {
1920
+ type: keys.queryKey[0],
1921
+ ...keys.queryKey[2]
1922
1922
  });
1923
+ return fetcher == null ? void 0 : fetcher(requestParams);
1923
1924
  }, cachingSWRInfiniteOptions);
1924
1925
  const page = React7.useMemo(() => {
1925
1926
  if (triggerInfinite) return size;
@@ -1965,11 +1966,6 @@ var usePagesOrInfinite = (params, fetcher, config, cacheKeys) => {
1965
1966
  fetchPage((n) => Math.max(0, n - 1));
1966
1967
  }, [fetchPage]);
1967
1968
  const offsetCount = (initialPageRef.current - 1) * pageSizeRef.current;
1968
- const pageCount = Math.ceil((count - offsetCount) / pageSizeRef.current);
1969
- const hasNextPage = count - offsetCount * pageSizeRef.current > page * pageSizeRef.current;
1970
- const hasPreviousPage = (page - 1) * pageSizeRef.current > offsetCount * pageSizeRef.current;
1971
- const setData = triggerInfinite ? (value) => swrInfiniteMutate(value, { revalidate: false }) : (value) => swrMutate(value, { revalidate: false });
1972
- const revalidate = triggerInfinite ? () => swrInfiniteMutate() : () => swrMutate();
1973
1969
  return {
1974
1970
  data,
1975
1971
  count,
@@ -1978,14 +1974,14 @@ var usePagesOrInfinite = (params, fetcher, config, cacheKeys) => {
1978
1974
  isFetching,
1979
1975
  isError,
1980
1976
  page,
1981
- pageCount,
1977
+ pageCount: Math.ceil((count - offsetCount) / pageSizeRef.current),
1982
1978
  fetchPage,
1983
1979
  fetchNext,
1984
1980
  fetchPrevious,
1985
- hasNextPage,
1986
- hasPreviousPage,
1987
- revalidate,
1988
- setData
1981
+ hasNextPage: count - offsetCount * pageSizeRef.current > page * pageSizeRef.current,
1982
+ hasPreviousPage: (page - 1) * pageSizeRef.current > offsetCount * pageSizeRef.current,
1983
+ revalidate: triggerInfinite ? () => swrInfiniteMutate() : () => swrMutate(),
1984
+ setData: triggerInfinite ? (value) => swrInfiniteMutate(value, { revalidate: false }) : (value) => swrMutate(value, { revalidate: false })
1989
1985
  };
1990
1986
  };
1991
1987
  var undefinedPaginatedResource$1 = {
@@ -2063,37 +2059,73 @@ function useOrganization(params) {
2063
2059
  pageSize: invitationsSafeValues.pageSize,
2064
2060
  status: invitationsSafeValues.status
2065
2061
  };
2066
- const domains = usePagesOrInfinite({ ...domainParams }, organization == null ? void 0 : organization.getDomains, {
2067
- keepPreviousData: domainSafeValues.keepPreviousData,
2068
- infinite: domainSafeValues.infinite,
2069
- enabled: !!domainParams
2070
- }, {
2071
- type: "domains",
2072
- organizationId: organization == null ? void 0 : organization.id
2062
+ const domains = usePagesOrInfinite({
2063
+ fetcher: organization == null ? void 0 : organization.getDomains,
2064
+ config: {
2065
+ keepPreviousData: domainSafeValues.keepPreviousData,
2066
+ infinite: domainSafeValues.infinite,
2067
+ enabled: !!domainParams,
2068
+ isSignedIn: Boolean(organization),
2069
+ initialPage: domainSafeValues.initialPage,
2070
+ pageSize: domainSafeValues.pageSize
2071
+ },
2072
+ keys: createCacheKeys({
2073
+ stablePrefix: "domains",
2074
+ authenticated: Boolean(organization),
2075
+ tracked: { organizationId: organization == null ? void 0 : organization.id },
2076
+ untracked: { args: domainParams }
2077
+ })
2073
2078
  });
2074
- const membershipRequests = usePagesOrInfinite({ ...membershipRequestParams }, organization == null ? void 0 : organization.getMembershipRequests, {
2075
- keepPreviousData: membershipRequestSafeValues.keepPreviousData,
2076
- infinite: membershipRequestSafeValues.infinite,
2077
- enabled: !!membershipRequestParams
2078
- }, {
2079
- type: "membershipRequests",
2080
- organizationId: organization == null ? void 0 : organization.id
2079
+ const membershipRequests = usePagesOrInfinite({
2080
+ fetcher: organization == null ? void 0 : organization.getMembershipRequests,
2081
+ config: {
2082
+ keepPreviousData: membershipRequestSafeValues.keepPreviousData,
2083
+ infinite: membershipRequestSafeValues.infinite,
2084
+ enabled: !!membershipRequestParams,
2085
+ isSignedIn: Boolean(organization),
2086
+ initialPage: membershipRequestSafeValues.initialPage,
2087
+ pageSize: membershipRequestSafeValues.pageSize
2088
+ },
2089
+ keys: createCacheKeys({
2090
+ stablePrefix: "membershipRequests",
2091
+ authenticated: Boolean(organization),
2092
+ tracked: { organizationId: organization == null ? void 0 : organization.id },
2093
+ untracked: { args: membershipRequestParams }
2094
+ })
2081
2095
  });
2082
- const memberships = usePagesOrInfinite(membersParams || {}, organization == null ? void 0 : organization.getMemberships, {
2083
- keepPreviousData: membersSafeValues.keepPreviousData,
2084
- infinite: membersSafeValues.infinite,
2085
- enabled: !!membersParams
2086
- }, {
2087
- type: "members",
2088
- organizationId: organization == null ? void 0 : organization.id
2096
+ const memberships = usePagesOrInfinite({
2097
+ fetcher: organization == null ? void 0 : organization.getMemberships,
2098
+ config: {
2099
+ keepPreviousData: membersSafeValues.keepPreviousData,
2100
+ infinite: membersSafeValues.infinite,
2101
+ enabled: !!membersParams,
2102
+ isSignedIn: Boolean(organization),
2103
+ initialPage: membersSafeValues.initialPage,
2104
+ pageSize: membersSafeValues.pageSize
2105
+ },
2106
+ keys: createCacheKeys({
2107
+ stablePrefix: "members",
2108
+ authenticated: Boolean(organization),
2109
+ tracked: { organizationId: organization == null ? void 0 : organization.id },
2110
+ untracked: { args: membersParams }
2111
+ })
2089
2112
  });
2090
- const invitations = usePagesOrInfinite({ ...invitationsParams }, organization == null ? void 0 : organization.getInvitations, {
2091
- keepPreviousData: invitationsSafeValues.keepPreviousData,
2092
- infinite: invitationsSafeValues.infinite,
2093
- enabled: !!invitationsParams
2094
- }, {
2095
- type: "invitations",
2096
- organizationId: organization == null ? void 0 : organization.id
2113
+ const invitations = usePagesOrInfinite({
2114
+ fetcher: organization == null ? void 0 : organization.getInvitations,
2115
+ config: {
2116
+ keepPreviousData: invitationsSafeValues.keepPreviousData,
2117
+ infinite: invitationsSafeValues.infinite,
2118
+ enabled: !!invitationsParams,
2119
+ isSignedIn: Boolean(organization),
2120
+ initialPage: invitationsSafeValues.initialPage,
2121
+ pageSize: invitationsSafeValues.pageSize
2122
+ },
2123
+ keys: createCacheKeys({
2124
+ stablePrefix: "invitations",
2125
+ authenticated: Boolean(organization),
2126
+ tracked: { organizationId: organization == null ? void 0 : organization.id },
2127
+ untracked: { args: invitationsParams }
2128
+ })
2097
2129
  });
2098
2130
  if (organization === void 0) return {
2099
2131
  isLoaded: false,
@@ -2191,29 +2223,56 @@ function useOrganizationList(params) {
2191
2223
  status: userSuggestionsSafeValues.status
2192
2224
  };
2193
2225
  const isClerkLoaded = !!(clerk2.loaded && user);
2194
- const memberships = usePagesOrInfinite(userMembershipsParams || {}, user == null ? void 0 : user.getOrganizationMemberships, {
2195
- keepPreviousData: userMembershipsSafeValues.keepPreviousData,
2196
- infinite: userMembershipsSafeValues.infinite,
2197
- enabled: !!userMembershipsParams
2198
- }, {
2199
- type: "userMemberships",
2200
- userId: user == null ? void 0 : user.id
2226
+ const memberships = usePagesOrInfinite({
2227
+ fetcher: user == null ? void 0 : user.getOrganizationMemberships,
2228
+ config: {
2229
+ keepPreviousData: userMembershipsSafeValues.keepPreviousData,
2230
+ infinite: userMembershipsSafeValues.infinite,
2231
+ enabled: !!userMembershipsParams,
2232
+ isSignedIn: Boolean(user),
2233
+ initialPage: userMembershipsSafeValues.initialPage,
2234
+ pageSize: userMembershipsSafeValues.pageSize
2235
+ },
2236
+ keys: createCacheKeys({
2237
+ stablePrefix: "userMemberships",
2238
+ authenticated: Boolean(user),
2239
+ tracked: { userId: user == null ? void 0 : user.id },
2240
+ untracked: { args: userMembershipsParams }
2241
+ })
2201
2242
  });
2202
- const invitations = usePagesOrInfinite({ ...userInvitationsParams }, user == null ? void 0 : user.getOrganizationInvitations, {
2203
- keepPreviousData: userInvitationsSafeValues.keepPreviousData,
2204
- infinite: userInvitationsSafeValues.infinite,
2205
- enabled: !!userInvitationsParams
2206
- }, {
2207
- type: "userInvitations",
2208
- userId: user == null ? void 0 : user.id
2243
+ const invitations = usePagesOrInfinite({
2244
+ fetcher: user == null ? void 0 : user.getOrganizationInvitations,
2245
+ config: {
2246
+ keepPreviousData: userInvitationsSafeValues.keepPreviousData,
2247
+ infinite: userInvitationsSafeValues.infinite,
2248
+ enabled: !!userInvitationsParams,
2249
+ isSignedIn: Boolean(user),
2250
+ initialPage: userInvitationsSafeValues.initialPage,
2251
+ pageSize: userInvitationsSafeValues.pageSize
2252
+ },
2253
+ keys: createCacheKeys({
2254
+ stablePrefix: "userInvitations",
2255
+ authenticated: Boolean(user),
2256
+ tracked: { userId: user == null ? void 0 : user.id },
2257
+ untracked: { args: userInvitationsParams }
2258
+ })
2209
2259
  });
2210
- const suggestions = usePagesOrInfinite({ ...userSuggestionsParams }, user == null ? void 0 : user.getOrganizationSuggestions, {
2211
- keepPreviousData: userSuggestionsSafeValues.keepPreviousData,
2212
- infinite: userSuggestionsSafeValues.infinite,
2213
- enabled: !!userSuggestionsParams
2214
- }, {
2215
- type: "userSuggestions",
2216
- userId: user == null ? void 0 : user.id
2260
+ const suggestions = usePagesOrInfinite({
2261
+ fetcher: user == null ? void 0 : user.getOrganizationSuggestions,
2262
+ config: {
2263
+ keepPreviousData: userSuggestionsSafeValues.keepPreviousData,
2264
+ infinite: userSuggestionsSafeValues.infinite,
2265
+ enabled: !!userSuggestionsParams,
2266
+ isSignedIn: Boolean(user),
2267
+ initialPage: userSuggestionsSafeValues.initialPage,
2268
+ pageSize: userSuggestionsSafeValues.pageSize
2269
+ },
2270
+ keys: createCacheKeys({
2271
+ stablePrefix: "userSuggestions",
2272
+ authenticated: Boolean(user),
2273
+ tracked: { userId: user == null ? void 0 : user.id },
2274
+ untracked: { args: userSuggestionsParams }
2275
+ })
2217
2276
  });
2218
2277
  if (!isClerkLoaded) return {
2219
2278
  isLoaded: false,
@@ -2262,8 +2321,7 @@ var useSessionList = () => {
2262
2321
  useAssertWrappedByClerkProvider(hookName$2);
2263
2322
  const isomorphicClerk = useClerkInstanceContext();
2264
2323
  const client = useClientContext();
2265
- const clerk2 = useClerkInstanceContext();
2266
- (_a5 = clerk2.telemetry) == null ? void 0 : _a5.record(eventMethodCalled(hookName$2));
2324
+ (_a5 = useClerkInstanceContext().telemetry) == null ? void 0 : _a5.record(eventMethodCalled(hookName$2));
2267
2325
  if (!client) return {
2268
2326
  isLoaded: false,
2269
2327
  sessions: void 0,
@@ -2280,8 +2338,7 @@ function useUser() {
2280
2338
  var _a5;
2281
2339
  useAssertWrappedByClerkProvider(hookName$1);
2282
2340
  const user = useUserContext();
2283
- const clerk2 = useClerkInstanceContext();
2284
- (_a5 = clerk2.telemetry) == null ? void 0 : _a5.record(eventMethodCalled(hookName$1));
2341
+ (_a5 = useClerkInstanceContext().telemetry) == null ? void 0 : _a5.record(eventMethodCalled(hookName$1));
2285
2342
  if (user === void 0) return {
2286
2343
  isLoaded: false,
2287
2344
  isSignedIn: void 0,
@@ -2316,7 +2373,7 @@ async function resolveResult(result) {
2316
2373
  }
2317
2374
  function createReverificationHandler(params) {
2318
2375
  function assertReverification(fetcher) {
2319
- return async (...args) => {
2376
+ return (async (...args) => {
2320
2377
  var _a5, _b;
2321
2378
  let result = await resolveResult(fetcher(...args));
2322
2379
  if (isReverificationHint(result)) {
@@ -2344,7 +2401,7 @@ function createReverificationHandler(params) {
2344
2401
  result = await resolveResult(fetcher(...args));
2345
2402
  }
2346
2403
  return result;
2347
- };
2404
+ });
2348
2405
  }
2349
2406
  return assertReverification;
2350
2407
  }
@@ -2358,12 +2415,11 @@ var useReverification = (fetcher, options) => {
2358
2415
  optionsRef.current = options;
2359
2416
  });
2360
2417
  return React7.useCallback((...args) => {
2361
- const handler = createReverificationHandler({
2418
+ return createReverificationHandler({
2362
2419
  openUIComponent: __internal_openReverification,
2363
2420
  telemetry,
2364
2421
  ...optionsRef.current
2365
- })(fetcherRef.current);
2366
- return handler(...args);
2422
+ })(fetcherRef.current)(...args);
2367
2423
  }, [__internal_openReverification, telemetry]);
2368
2424
  };
2369
2425
  var usePrevious = (value) => {
@@ -2424,11 +2480,9 @@ var PLAIN_OBJECT_STR = "[object Object]";
2424
2480
  var isEqual = (left, right) => {
2425
2481
  if (!isUnknownObject(left) || !isUnknownObject(right)) return left === right;
2426
2482
  const leftArray = Array.isArray(left);
2427
- const rightArray = Array.isArray(right);
2428
- if (leftArray !== rightArray) return false;
2483
+ if (leftArray !== Array.isArray(right)) return false;
2429
2484
  const leftPlainObject = Object.prototype.toString.call(left) === PLAIN_OBJECT_STR;
2430
- const rightPlainObject = Object.prototype.toString.call(right) === PLAIN_OBJECT_STR;
2431
- if (leftPlainObject !== rightPlainObject) return false;
2485
+ if (leftPlainObject !== (Object.prototype.toString.call(right) === PLAIN_OBJECT_STR)) return false;
2432
2486
  if (!leftPlainObject && !leftArray) return left === right;
2433
2487
  const leftKeys = Object.keys(left);
2434
2488
  const rightKeys = Object.keys(right);
@@ -2446,11 +2500,10 @@ var isEqual = (left, right) => {
2446
2500
  return allKeys.every(pred);
2447
2501
  };
2448
2502
  var useElementsOrCheckoutSdkContextWithUseCase = (useCaseString) => {
2449
- const elementsContext = React7__default.default.useContext(ElementsContext);
2450
- return parseElementsContext(elementsContext, useCaseString);
2503
+ return parseElementsContext(React7__default.default.useContext(ElementsContext), useCaseString);
2451
2504
  };
2452
2505
  var capitalized = (str) => str.charAt(0).toUpperCase() + str.slice(1);
2453
- var createElementComponent = (type, isServer$1) => {
2506
+ var createElementComponent = (type, isServer) => {
2454
2507
  const displayName = `${capitalized(type)}Element`;
2455
2508
  const ClientElement = ({ id, className, fallback, options = {}, onBlur, onFocus, onReady, onChange, onEscape, onClick, onLoadError, onLoaderStart, onNetworksChange, onConfirm, onCancel, onShippingAddressChange, onShippingRateChange }) => {
2456
2509
  const ctx = useElementsOrCheckoutSdkContextWithUseCase(`mounts <${displayName}>`);
@@ -2501,7 +2554,7 @@ var createElementComponent = (type, isServer$1) => {
2501
2554
  }
2502
2555
  };
2503
2556
  }, []);
2504
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!isReady && fallback, /* @__PURE__ */ jsxRuntime.jsx("div", {
2557
+ return /* @__PURE__ */ React7__default.default.createElement(React7__default.default.Fragment, null, !isReady && fallback, /* @__PURE__ */ React7__default.default.createElement("div", {
2505
2558
  id,
2506
2559
  style: {
2507
2560
  height: isReady ? "unset" : "0px",
@@ -2509,23 +2562,22 @@ var createElementComponent = (type, isServer$1) => {
2509
2562
  },
2510
2563
  className,
2511
2564
  ref: domNode
2512
- })] });
2565
+ }));
2513
2566
  };
2514
2567
  const ServerElement = (props) => {
2515
2568
  useElementsOrCheckoutSdkContextWithUseCase(`mounts <${displayName}>`);
2516
2569
  const { id, className } = props;
2517
- return /* @__PURE__ */ jsxRuntime.jsx("div", {
2570
+ return /* @__PURE__ */ React7__default.default.createElement("div", {
2518
2571
  id,
2519
2572
  className
2520
2573
  });
2521
2574
  };
2522
- const Element = isServer$1 ? ServerElement : ClientElement;
2575
+ const Element = isServer ? ServerElement : ClientElement;
2523
2576
  Element.displayName = displayName;
2524
2577
  Element.__elementType = type;
2525
2578
  return Element;
2526
2579
  };
2527
- var isServer = typeof window === "undefined";
2528
- createElementComponent("payment", isServer);
2580
+ createElementComponent("payment", typeof window === "undefined");
2529
2581
  createContextAndHook("StripeLibsContext");
2530
2582
  createContextAndHook("PaymentElementContext");
2531
2583
  createContextAndHook("StripeUtilsContext");
@@ -2709,7 +2761,7 @@ var withClerk = (Component, displayNameOrOptions) => {
2709
2761
  return HOC;
2710
2762
  };
2711
2763
 
2712
- // ../shared/dist/runtime/runtimeEnvironment-aTp6aZUT.mjs
2764
+ // ../shared/dist/runtime/runtimeEnvironment-BB2sO-19.mjs
2713
2765
  var isDevelopmentEnvironment = () => {
2714
2766
  try {
2715
2767
  return process.env.NODE_ENV === "development";
@@ -2732,7 +2784,7 @@ var isProductionEnvironment = () => {
2732
2784
  return false;
2733
2785
  };
2734
2786
 
2735
- // ../shared/dist/runtime/deprecated-CFM4jPRM.mjs
2787
+ // ../shared/dist/runtime/deprecated-BqlFbLHj.mjs
2736
2788
  var displayedWarnings = /* @__PURE__ */ new Set();
2737
2789
  var deprecated = (fnName, warning, key) => {
2738
2790
  const hideWarning = isTestEnvironment() || isProductionEnvironment();
@@ -2873,15 +2925,14 @@ var AuthenticateWithRedirectCallback = withClerk(
2873
2925
  "AuthenticateWithRedirectCallback"
2874
2926
  );
2875
2927
 
2876
- // ../shared/dist/runtime/handleValueOrFn-C3bdLKGZ.mjs
2928
+ // ../shared/dist/runtime/handleValueOrFn-CcwnRX-K.mjs
2877
2929
  function handleValueOrFn(value, url, defaultValue) {
2878
2930
  if (typeof value === "function") return value(url);
2879
2931
  if (typeof value !== "undefined") return value;
2880
2932
  if (typeof defaultValue !== "undefined") return defaultValue;
2881
- return void 0;
2882
2933
  }
2883
2934
 
2884
- // ../shared/dist/runtime/utils-DFvkL3Ii.mjs
2935
+ // ../shared/dist/runtime/utils-DnE51LOo.mjs
2885
2936
  var logErrorInDevMode = (message) => {
2886
2937
  if (isDevelopmentEnvironment()) console.error(`Clerk: ${message}`);
2887
2938
  };
@@ -3768,8 +3819,8 @@ var APIKeys = withClerk(
3768
3819
  ClerkHostRenderer,
3769
3820
  {
3770
3821
  component,
3771
- mount: clerk2.mountApiKeys,
3772
- unmount: clerk2.unmountApiKeys,
3822
+ mount: clerk2.mountAPIKeys,
3823
+ unmount: clerk2.unmountAPIKeys,
3773
3824
  updateProps: clerk2.__unstable__updateProps,
3774
3825
  props,
3775
3826
  rootProps: rendererRootProps
@@ -3835,7 +3886,7 @@ function setClerkJsLoadingErrorPackageName(packageName) {
3835
3886
  errorThrower2.setPackageName({ packageName });
3836
3887
  }
3837
3888
 
3838
- // ../shared/dist/runtime/deriveState-BwW5Y_o5.mjs
3889
+ // ../shared/dist/runtime/deriveState-ChDqlleE.mjs
3839
3890
  var deriveState = (clerkOperational, state, initialState) => {
3840
3891
  if (!clerkOperational && initialState) return deriveFromSsrInitialState(initialState);
3841
3892
  return deriveFromClientSideState(state);
@@ -3846,28 +3897,20 @@ var deriveFromSsrInitialState = (initialState) => {
3846
3897
  const sessionId = initialState.sessionId;
3847
3898
  const sessionStatus = initialState.sessionStatus;
3848
3899
  const sessionClaims = initialState.sessionClaims;
3849
- const session = initialState.session;
3850
- const organization = initialState.organization;
3851
- const orgId = initialState.orgId;
3852
- const orgRole = initialState.orgRole;
3853
- const orgPermissions = initialState.orgPermissions;
3854
- const orgSlug = initialState.orgSlug;
3855
- const actor = initialState.actor;
3856
- const factorVerificationAge = initialState.factorVerificationAge;
3857
3900
  return {
3858
3901
  userId,
3859
3902
  user,
3860
3903
  sessionId,
3861
- session,
3904
+ session: initialState.session,
3862
3905
  sessionStatus,
3863
3906
  sessionClaims,
3864
- organization,
3865
- orgId,
3866
- orgRole,
3867
- orgPermissions,
3868
- orgSlug,
3869
- actor,
3870
- factorVerificationAge
3907
+ organization: initialState.organization,
3908
+ orgId: initialState.orgId,
3909
+ orgRole: initialState.orgRole,
3910
+ orgPermissions: initialState.orgPermissions,
3911
+ orgSlug: initialState.orgSlug,
3912
+ actor: initialState.actor,
3913
+ factorVerificationAge: initialState.factorVerificationAge
3871
3914
  };
3872
3915
  };
3873
3916
  var deriveFromClientSideState = (state) => {
@@ -3885,7 +3928,6 @@ var deriveFromClientSideState = (state) => {
3885
3928
  const orgSlug = organization == null ? void 0 : organization.slug;
3886
3929
  const membership = organization ? (_d = user == null ? void 0 : user.organizationMemberships) == null ? void 0 : _d.find((om) => om.organization.id === orgId) : organization;
3887
3930
  const orgPermissions = membership ? membership.permissions : membership;
3888
- const orgRole = membership ? membership.role : membership;
3889
3931
  return {
3890
3932
  userId,
3891
3933
  user,
@@ -3895,7 +3937,7 @@ var deriveFromClientSideState = (state) => {
3895
3937
  sessionClaims,
3896
3938
  organization,
3897
3939
  orgId,
3898
- orgRole,
3940
+ orgRole: membership ? membership.role : membership,
3899
3941
  orgSlug,
3900
3942
  orgPermissions,
3901
3943
  actor,
@@ -3903,12 +3945,12 @@ var deriveFromClientSideState = (state) => {
3903
3945
  };
3904
3946
  };
3905
3947
 
3906
- // ../shared/dist/runtime/browser-hvvxjQRr.mjs
3948
+ // ../shared/dist/runtime/browser-D5e8obql.mjs
3907
3949
  function inBrowser() {
3908
3950
  return typeof window !== "undefined";
3909
3951
  }
3910
3952
 
3911
- // ../shared/dist/runtime/eventBus-BcGgxxPn.mjs
3953
+ // ../shared/dist/runtime/eventBus-UpdW-1JB.mjs
3912
3954
  var _on = (eventToHandlersMap, latestPayloadMap, event, handler, opts) => {
3913
3955
  const { notify } = opts || {};
3914
3956
  let handlers = eventToHandlersMap.get(event);
@@ -3949,8 +3991,6 @@ var clerkEvents = { Status: "status" };
3949
3991
  var createClerkEventBus = () => {
3950
3992
  return createEventBus();
3951
3993
  };
3952
-
3953
- // ../react/dist/index.mjs
3954
3994
  if (typeof window !== "undefined" && !window.global) {
3955
3995
  window.global = typeof global === "undefined" ? window : global;
3956
3996
  }
@@ -4357,7 +4397,7 @@ if (typeof globalThis.__BUILD_DISABLE_RHC__ === "undefined") {
4357
4397
  }
4358
4398
  var SDK_METADATA = {
4359
4399
  name: "@clerk/clerk-react",
4360
- version: "5.55.1-snapshot.v20251113231557",
4400
+ version: "5.56.0-snapshot.v20251117183539",
4361
4401
  environment: process.env.NODE_ENV
4362
4402
  };
4363
4403
  var _status;
@@ -4396,7 +4436,7 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
4396
4436
  this.premountMethodCalls = /* @__PURE__ */ new Map();
4397
4437
  this.premountWaitlistNodes = /* @__PURE__ */ new Map();
4398
4438
  this.premountPricingTableNodes = /* @__PURE__ */ new Map();
4399
- this.premountApiKeysNodes = /* @__PURE__ */ new Map();
4439
+ this.premountAPIKeysNodes = /* @__PURE__ */ new Map();
4400
4440
  this.premountOAuthConsentNodes = /* @__PURE__ */ new Map();
4401
4441
  this.premountTaskChooseOrganizationNodes = /* @__PURE__ */ new Map();
4402
4442
  this.premountAddListenerCalls = /* @__PURE__ */ new Map();
@@ -4665,8 +4705,8 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
4665
4705
  this.premountPricingTableNodes.forEach((props, node) => {
4666
4706
  clerkjs.mountPricingTable(node, props);
4667
4707
  });
4668
- this.premountApiKeysNodes.forEach((props, node) => {
4669
- clerkjs.mountApiKeys(node, props);
4708
+ this.premountAPIKeysNodes.forEach((props, node) => {
4709
+ clerkjs.mountAPIKeys(node, props);
4670
4710
  });
4671
4711
  this.premountOAuthConsentNodes.forEach((props, node) => {
4672
4712
  clerkjs.__internal_mountOAuthConsent(node, props);
@@ -5016,18 +5056,18 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
5016
5056
  this.premountPricingTableNodes.delete(node);
5017
5057
  }
5018
5058
  };
5019
- this.mountApiKeys = (node, props) => {
5059
+ this.mountAPIKeys = (node, props) => {
5020
5060
  if (this.clerkjs && this.loaded) {
5021
- this.clerkjs.mountApiKeys(node, props);
5061
+ this.clerkjs.mountAPIKeys(node, props);
5022
5062
  } else {
5023
- this.premountApiKeysNodes.set(node, props);
5063
+ this.premountAPIKeysNodes.set(node, props);
5024
5064
  }
5025
5065
  };
5026
- this.unmountApiKeys = (node) => {
5066
+ this.unmountAPIKeys = (node) => {
5027
5067
  if (this.clerkjs && this.loaded) {
5028
- this.clerkjs.unmountApiKeys(node);
5068
+ this.clerkjs.unmountAPIKeys(node);
5029
5069
  } else {
5030
- this.premountApiKeysNodes.delete(node);
5070
+ this.premountAPIKeysNodes.delete(node);
5031
5071
  }
5032
5072
  };
5033
5073
  this.__internal_mountOAuthConsent = (node, props) => {
@@ -5699,10 +5739,11 @@ function ClerkProviderBase(props) {
5699
5739
  }
5700
5740
  var ClerkProvider = withMaxAllowedInstancesGuard(ClerkProviderBase, "ClerkProvider", multipleClerkProvidersError);
5701
5741
  ClerkProvider.displayName = "ClerkProvider";
5742
+ React7.createContext(null);
5702
5743
  setErrorThrowerOptions({ packageName: "@clerk/clerk-react" });
5703
5744
  setClerkJsLoadingErrorPackageName("@clerk/clerk-react");
5704
5745
 
5705
- // ../shared/dist/runtime/devBrowser-tYnimKYY.mjs
5746
+ // ../shared/dist/runtime/devBrowser-Dm-lbUnV.mjs
5706
5747
  var DEV_BROWSER_JWT_KEY = "__clerk_db_jwt";
5707
5748
 
5708
5749
  // src/types.ts
@@ -5901,7 +5942,7 @@ var BrowserStorageCache = createBrowserStorageCache();
5901
5942
  var clerk;
5902
5943
  noRhc.Clerk.sdkMetadata = {
5903
5944
  name: "@clerk/chrome-extension",
5904
- version: "2.8.2-snapshot.v20251113231557"
5945
+ version: "2.8.2-snapshot.v20251117183539"
5905
5946
  };
5906
5947
  async function createClerkClient({
5907
5948
  __experimental_syncHostListener = false,