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

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,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  var React7 = require('react');
4
- var jsxRuntime = require('react/jsx-runtime');
5
4
  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
 
@@ -190,7 +190,7 @@ var isomorphicAtob = (data) => {
190
190
  return data;
191
191
  };
192
192
 
193
- // ../shared/dist/runtime/keys-Dcilj3cS.mjs
193
+ // ../shared/dist/runtime/keys-YNv6yjKk.mjs
194
194
  var PUBLISHABLE_KEY_LIVE_PREFIX = "pk_live_";
195
195
  var PUBLISHABLE_KEY_TEST_PREFIX = "pk_test_";
196
196
  function isValidDecodedPublishableKey(decoded) {
@@ -228,14 +228,12 @@ function parsePublishableKey(key, options = {}) {
228
228
  }
229
229
  function isPublishableKey(key = "") {
230
230
  try {
231
- const hasValidPrefix = key.startsWith(PUBLISHABLE_KEY_LIVE_PREFIX) || key.startsWith(PUBLISHABLE_KEY_TEST_PREFIX);
232
- if (!hasValidPrefix) return false;
231
+ if (!(key.startsWith(PUBLISHABLE_KEY_LIVE_PREFIX) || key.startsWith(PUBLISHABLE_KEY_TEST_PREFIX))) return false;
233
232
  const parts = key.split("_");
234
233
  if (parts.length !== 3) return false;
235
234
  const encodedPart = parts[2];
236
235
  if (!encodedPart) return false;
237
- const decoded = isomorphicAtob(encodedPart);
238
- return isValidDecodedPublishableKey(decoded);
236
+ return isValidDecodedPublishableKey(isomorphicAtob(encodedPart));
239
237
  } catch {
240
238
  return false;
241
239
  }
@@ -848,7 +846,7 @@ function dequal2(foo, bar) {
848
846
 
849
847
  // ../shared/dist/runtime/react/index.mjs
850
848
  function assertContextExists(contextVal, msgOrCtx) {
851
- if (!contextVal) throw typeof msgOrCtx === "string" ? new Error(msgOrCtx) : new Error(`${msgOrCtx.displayName} not found`);
849
+ if (!contextVal) throw typeof msgOrCtx === "string" ? new Error(msgOrCtx) : /* @__PURE__ */ new Error(`${msgOrCtx.displayName} not found`);
852
850
  }
853
851
  var createContextAndHook = (displayName, options) => {
854
852
  const { assertCtxFn = assertContextExists } = {};
@@ -870,10 +868,7 @@ var createContextAndHook = (displayName, options) => {
870
868
  ];
871
869
  };
872
870
  function SWRConfigCompat({ swrConfig, children }) {
873
- return /* @__PURE__ */ jsxRuntime.jsx(SWRConfig2, {
874
- value: swrConfig,
875
- children
876
- });
871
+ return /* @__PURE__ */ React7__default.default.createElement(SWRConfig2, { value: swrConfig }, children);
877
872
  }
878
873
  var [ClerkInstanceContext, useClerkInstanceContext] = createContextAndHook("ClerkInstanceContext");
879
874
  var [UserContext] = createContextAndHook("UserContext");
@@ -882,24 +877,14 @@ var [SessionContext] = createContextAndHook("SessionContext");
882
877
  React7__default.default.createContext({});
883
878
  var [CheckoutContext] = createContextAndHook("CheckoutContext");
884
879
  var __experimental_CheckoutProvider = ({ children, ...rest }) => {
885
- return /* @__PURE__ */ jsxRuntime.jsx(CheckoutContext.Provider, {
886
- value: { value: rest },
887
- children
888
- });
880
+ return /* @__PURE__ */ React7__default.default.createElement(CheckoutContext.Provider, { value: { value: rest } }, children);
889
881
  };
890
882
  var [OrganizationContextInternal] = createContextAndHook("OrganizationContext");
891
883
  var OrganizationProvider = ({ children, organization, swrConfig }) => {
892
- return /* @__PURE__ */ jsxRuntime.jsx(SWRConfigCompat, {
893
- swrConfig,
894
- children: /* @__PURE__ */ jsxRuntime.jsx(OrganizationContextInternal.Provider, {
895
- value: { value: { organization } },
896
- children
897
- })
898
- });
884
+ return /* @__PURE__ */ React7__default.default.createElement(SWRConfigCompat, { swrConfig }, /* @__PURE__ */ React7__default.default.createElement(OrganizationContextInternal.Provider, { value: { value: { organization } } }, children));
899
885
  };
900
886
  function useAssertWrappedByClerkProvider(displayNameOrFn) {
901
- const ctx = React7__default.default.useContext(ClerkInstanceContext);
902
- if (!ctx) {
887
+ if (!React7__default.default.useContext(ClerkInstanceContext)) {
903
888
  if (typeof displayNameOrFn === "function") {
904
889
  displayNameOrFn();
905
890
  return;
@@ -973,11 +958,9 @@ var PLAIN_OBJECT_STR = "[object Object]";
973
958
  var isEqual = (left, right) => {
974
959
  if (!isUnknownObject(left) || !isUnknownObject(right)) return left === right;
975
960
  const leftArray = Array.isArray(left);
976
- const rightArray = Array.isArray(right);
977
- if (leftArray !== rightArray) return false;
961
+ if (leftArray !== Array.isArray(right)) return false;
978
962
  const leftPlainObject = Object.prototype.toString.call(left) === PLAIN_OBJECT_STR;
979
- const rightPlainObject = Object.prototype.toString.call(right) === PLAIN_OBJECT_STR;
980
- if (leftPlainObject !== rightPlainObject) return false;
963
+ if (leftPlainObject !== (Object.prototype.toString.call(right) === PLAIN_OBJECT_STR)) return false;
981
964
  if (!leftPlainObject && !leftArray) return left === right;
982
965
  const leftKeys = Object.keys(left);
983
966
  const rightKeys = Object.keys(right);
@@ -995,11 +978,10 @@ var isEqual = (left, right) => {
995
978
  return allKeys.every(pred);
996
979
  };
997
980
  var useElementsOrCheckoutSdkContextWithUseCase = (useCaseString) => {
998
- const elementsContext = React7__default.default.useContext(ElementsContext);
999
- return parseElementsContext(elementsContext, useCaseString);
981
+ return parseElementsContext(React7__default.default.useContext(ElementsContext), useCaseString);
1000
982
  };
1001
983
  var capitalized = (str) => str.charAt(0).toUpperCase() + str.slice(1);
1002
- var createElementComponent = (type, isServer$1) => {
984
+ var createElementComponent = (type, isServer) => {
1003
985
  const displayName = `${capitalized(type)}Element`;
1004
986
  const ClientElement = ({ id, className, fallback, options = {}, onBlur, onFocus, onReady, onChange, onEscape, onClick, onLoadError, onLoaderStart, onNetworksChange, onConfirm, onCancel, onShippingAddressChange, onShippingRateChange }) => {
1005
987
  const ctx = useElementsOrCheckoutSdkContextWithUseCase(`mounts <${displayName}>`);
@@ -1050,7 +1032,7 @@ var createElementComponent = (type, isServer$1) => {
1050
1032
  }
1051
1033
  };
1052
1034
  }, []);
1053
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!isReady && fallback, /* @__PURE__ */ jsxRuntime.jsx("div", {
1035
+ return /* @__PURE__ */ React7__default.default.createElement(React7__default.default.Fragment, null, !isReady && fallback, /* @__PURE__ */ React7__default.default.createElement("div", {
1054
1036
  id,
1055
1037
  style: {
1056
1038
  height: isReady ? "unset" : "0px",
@@ -1058,23 +1040,22 @@ var createElementComponent = (type, isServer$1) => {
1058
1040
  },
1059
1041
  className,
1060
1042
  ref: domNode
1061
- })] });
1043
+ }));
1062
1044
  };
1063
1045
  const ServerElement = (props) => {
1064
1046
  useElementsOrCheckoutSdkContextWithUseCase(`mounts <${displayName}>`);
1065
1047
  const { id, className } = props;
1066
- return /* @__PURE__ */ jsxRuntime.jsx("div", {
1048
+ return /* @__PURE__ */ React7__default.default.createElement("div", {
1067
1049
  id,
1068
1050
  className
1069
1051
  });
1070
1052
  };
1071
- const Element = isServer$1 ? ServerElement : ClientElement;
1053
+ const Element = isServer ? ServerElement : ClientElement;
1072
1054
  Element.displayName = displayName;
1073
1055
  Element.__elementType = type;
1074
1056
  return Element;
1075
1057
  };
1076
- var isServer = typeof window === "undefined";
1077
- createElementComponent("payment", isServer);
1058
+ createElementComponent("payment", typeof window === "undefined");
1078
1059
  createContextAndHook("StripeLibsContext");
1079
1060
  createContextAndHook("PaymentElementContext");
1080
1061
  createContextAndHook("StripeUtilsContext");
@@ -1131,7 +1112,7 @@ var withClerk = (Component, displayNameOrOptions) => {
1131
1112
  return HOC;
1132
1113
  };
1133
1114
 
1134
- // ../shared/dist/runtime/runtimeEnvironment-aTp6aZUT.mjs
1115
+ // ../shared/dist/runtime/runtimeEnvironment-BB2sO-19.mjs
1135
1116
  var isDevelopmentEnvironment = () => {
1136
1117
  try {
1137
1118
  return process.env.NODE_ENV === "development";
@@ -1154,7 +1135,7 @@ var isProductionEnvironment = () => {
1154
1135
  return false;
1155
1136
  };
1156
1137
 
1157
- // ../shared/dist/runtime/deprecated-CFM4jPRM.mjs
1138
+ // ../shared/dist/runtime/deprecated-BqlFbLHj.mjs
1158
1139
  var displayedWarnings = /* @__PURE__ */ new Set();
1159
1140
  var deprecated = (fnName, warning, key) => {
1160
1141
  const hideWarning = isTestEnvironment() || isProductionEnvironment();
@@ -1222,15 +1203,14 @@ withClerk(
1222
1203
  "AuthenticateWithRedirectCallback"
1223
1204
  );
1224
1205
 
1225
- // ../shared/dist/runtime/handleValueOrFn-C3bdLKGZ.mjs
1206
+ // ../shared/dist/runtime/handleValueOrFn-CcwnRX-K.mjs
1226
1207
  function handleValueOrFn(value, url, defaultValue) {
1227
1208
  if (typeof value === "function") return value(url);
1228
1209
  if (typeof value !== "undefined") return value;
1229
1210
  if (typeof defaultValue !== "undefined") return defaultValue;
1230
- return void 0;
1231
1211
  }
1232
1212
 
1233
- // ../shared/dist/runtime/utils-DFvkL3Ii.mjs
1213
+ // ../shared/dist/runtime/utils-DnE51LOo.mjs
1234
1214
  var logErrorInDevMode = (message) => {
1235
1215
  if (isDevelopmentEnvironment()) console.error(`Clerk: ${message}`);
1236
1216
  };
@@ -2117,8 +2097,8 @@ withClerk(
2117
2097
  ClerkHostRenderer,
2118
2098
  {
2119
2099
  component,
2120
- mount: clerk2.mountApiKeys,
2121
- unmount: clerk2.unmountApiKeys,
2100
+ mount: clerk2.mountAPIKeys,
2101
+ unmount: clerk2.unmountAPIKeys,
2122
2102
  updateProps: clerk2.__unstable__updateProps,
2123
2103
  props,
2124
2104
  rootProps: rendererRootProps
@@ -2184,7 +2164,7 @@ function setClerkJsLoadingErrorPackageName(packageName) {
2184
2164
  errorThrower2.setPackageName({ packageName });
2185
2165
  }
2186
2166
 
2187
- // ../shared/dist/runtime/deriveState-BwW5Y_o5.mjs
2167
+ // ../shared/dist/runtime/deriveState-ChDqlleE.mjs
2188
2168
  var deriveState = (clerkOperational, state, initialState) => {
2189
2169
  if (!clerkOperational && initialState) return deriveFromSsrInitialState(initialState);
2190
2170
  return deriveFromClientSideState(state);
@@ -2195,28 +2175,20 @@ var deriveFromSsrInitialState = (initialState) => {
2195
2175
  const sessionId = initialState.sessionId;
2196
2176
  const sessionStatus = initialState.sessionStatus;
2197
2177
  const sessionClaims = initialState.sessionClaims;
2198
- const session = initialState.session;
2199
- const organization = initialState.organization;
2200
- const orgId = initialState.orgId;
2201
- const orgRole = initialState.orgRole;
2202
- const orgPermissions = initialState.orgPermissions;
2203
- const orgSlug = initialState.orgSlug;
2204
- const actor = initialState.actor;
2205
- const factorVerificationAge = initialState.factorVerificationAge;
2206
2178
  return {
2207
2179
  userId,
2208
2180
  user,
2209
2181
  sessionId,
2210
- session,
2182
+ session: initialState.session,
2211
2183
  sessionStatus,
2212
2184
  sessionClaims,
2213
- organization,
2214
- orgId,
2215
- orgRole,
2216
- orgPermissions,
2217
- orgSlug,
2218
- actor,
2219
- factorVerificationAge
2185
+ organization: initialState.organization,
2186
+ orgId: initialState.orgId,
2187
+ orgRole: initialState.orgRole,
2188
+ orgPermissions: initialState.orgPermissions,
2189
+ orgSlug: initialState.orgSlug,
2190
+ actor: initialState.actor,
2191
+ factorVerificationAge: initialState.factorVerificationAge
2220
2192
  };
2221
2193
  };
2222
2194
  var deriveFromClientSideState = (state) => {
@@ -2234,7 +2206,6 @@ var deriveFromClientSideState = (state) => {
2234
2206
  const orgSlug = organization == null ? void 0 : organization.slug;
2235
2207
  const membership = organization ? (_d = user == null ? void 0 : user.organizationMemberships) == null ? void 0 : _d.find((om) => om.organization.id === orgId) : organization;
2236
2208
  const orgPermissions = membership ? membership.permissions : membership;
2237
- const orgRole = membership ? membership.role : membership;
2238
2209
  return {
2239
2210
  userId,
2240
2211
  user,
@@ -2244,7 +2215,7 @@ var deriveFromClientSideState = (state) => {
2244
2215
  sessionClaims,
2245
2216
  organization,
2246
2217
  orgId,
2247
- orgRole,
2218
+ orgRole: membership ? membership.role : membership,
2248
2219
  orgSlug,
2249
2220
  orgPermissions,
2250
2221
  actor,
@@ -2252,12 +2223,12 @@ var deriveFromClientSideState = (state) => {
2252
2223
  };
2253
2224
  };
2254
2225
 
2255
- // ../shared/dist/runtime/browser-hvvxjQRr.mjs
2226
+ // ../shared/dist/runtime/browser-D5e8obql.mjs
2256
2227
  function inBrowser() {
2257
2228
  return typeof window !== "undefined";
2258
2229
  }
2259
2230
 
2260
- // ../shared/dist/runtime/eventBus-BcGgxxPn.mjs
2231
+ // ../shared/dist/runtime/eventBus-UpdW-1JB.mjs
2261
2232
  var _on = (eventToHandlersMap, latestPayloadMap, event, handler, opts) => {
2262
2233
  const { notify } = opts || {};
2263
2234
  let handlers = eventToHandlersMap.get(event);
@@ -2706,7 +2677,7 @@ if (typeof globalThis.__BUILD_DISABLE_RHC__ === "undefined") {
2706
2677
  }
2707
2678
  var SDK_METADATA = {
2708
2679
  name: "@clerk/clerk-react",
2709
- version: "5.55.1-snapshot.v20251113231557",
2680
+ version: "5.56.0-snapshot.v20251117155136",
2710
2681
  environment: process.env.NODE_ENV
2711
2682
  };
2712
2683
  var _status;
@@ -2745,7 +2716,7 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
2745
2716
  this.premountMethodCalls = /* @__PURE__ */ new Map();
2746
2717
  this.premountWaitlistNodes = /* @__PURE__ */ new Map();
2747
2718
  this.premountPricingTableNodes = /* @__PURE__ */ new Map();
2748
- this.premountApiKeysNodes = /* @__PURE__ */ new Map();
2719
+ this.premountAPIKeysNodes = /* @__PURE__ */ new Map();
2749
2720
  this.premountOAuthConsentNodes = /* @__PURE__ */ new Map();
2750
2721
  this.premountTaskChooseOrganizationNodes = /* @__PURE__ */ new Map();
2751
2722
  this.premountAddListenerCalls = /* @__PURE__ */ new Map();
@@ -3014,8 +2985,8 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
3014
2985
  this.premountPricingTableNodes.forEach((props, node) => {
3015
2986
  clerkjs.mountPricingTable(node, props);
3016
2987
  });
3017
- this.premountApiKeysNodes.forEach((props, node) => {
3018
- clerkjs.mountApiKeys(node, props);
2988
+ this.premountAPIKeysNodes.forEach((props, node) => {
2989
+ clerkjs.mountAPIKeys(node, props);
3019
2990
  });
3020
2991
  this.premountOAuthConsentNodes.forEach((props, node) => {
3021
2992
  clerkjs.__internal_mountOAuthConsent(node, props);
@@ -3365,18 +3336,18 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
3365
3336
  this.premountPricingTableNodes.delete(node);
3366
3337
  }
3367
3338
  };
3368
- this.mountApiKeys = (node, props) => {
3339
+ this.mountAPIKeys = (node, props) => {
3369
3340
  if (this.clerkjs && this.loaded) {
3370
- this.clerkjs.mountApiKeys(node, props);
3341
+ this.clerkjs.mountAPIKeys(node, props);
3371
3342
  } else {
3372
- this.premountApiKeysNodes.set(node, props);
3343
+ this.premountAPIKeysNodes.set(node, props);
3373
3344
  }
3374
3345
  };
3375
- this.unmountApiKeys = (node) => {
3346
+ this.unmountAPIKeys = (node) => {
3376
3347
  if (this.clerkjs && this.loaded) {
3377
- this.clerkjs.unmountApiKeys(node);
3348
+ this.clerkjs.unmountAPIKeys(node);
3378
3349
  } else {
3379
- this.premountApiKeysNodes.delete(node);
3350
+ this.premountAPIKeysNodes.delete(node);
3380
3351
  }
3381
3352
  };
3382
3353
  this.__internal_mountOAuthConsent = (node, props) => {
@@ -4051,7 +4022,7 @@ ClerkProvider.displayName = "ClerkProvider";
4051
4022
  setErrorThrowerOptions({ packageName: "@clerk/clerk-react" });
4052
4023
  setClerkJsLoadingErrorPackageName("@clerk/clerk-react");
4053
4024
 
4054
- // ../shared/dist/runtime/devBrowser-tYnimKYY.mjs
4025
+ // ../shared/dist/runtime/devBrowser-Dm-lbUnV.mjs
4055
4026
  var DEV_BROWSER_JWT_KEY = "__clerk_db_jwt";
4056
4027
 
4057
4028
  // src/types.ts
@@ -4250,7 +4221,7 @@ var BrowserStorageCache = createBrowserStorageCache();
4250
4221
  var clerk;
4251
4222
  noRhc.Clerk.sdkMetadata = {
4252
4223
  name: "@clerk/chrome-extension",
4253
- version: "2.8.2-snapshot.v20251113231557"
4224
+ version: "2.8.2-snapshot.v20251117155136"
4254
4225
  };
4255
4226
  async function createClerkClient({
4256
4227
  __experimental_syncHostListener = false,