@clerk/chrome-extension 2.8.2-snapshot.v20251117213621 → 2.8.2-snapshot.v20251117220746
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/background/index.js +1 -1
- package/dist/cjs/index.js +170 -160
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react/index.js +129 -119
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/esm/background/index.js +1 -1
- package/dist/esm/{chunk-2FARA3ID.js → chunk-2JO3XNSK.js} +3 -3
- package/dist/esm/{chunk-2FARA3ID.js.map → chunk-2JO3XNSK.js.map} +1 -1
- package/dist/esm/{chunk-ESIPBL55.js → chunk-PXSJ77YP.js} +112 -102
- package/dist/esm/chunk-PXSJ77YP.js.map +1 -0
- package/dist/esm/index.js +3 -3
- package/dist/esm/react/index.js +2 -2
- package/package.json +4 -4
- package/dist/esm/chunk-ESIPBL55.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __export, buildErrorThrower, createDevOrStagingUrlCache, createClerkClient, isClerkAPIResponseError, ClerkRuntimeError, isPublishableKey } from './chunk-
|
|
2
|
-
import
|
|
1
|
+
import { __export, buildErrorThrower, createDevOrStagingUrlCache, createClerkClient, isClerkAPIResponseError, ClerkRuntimeError, isPublishableKey } from './chunk-2JO3XNSK.js';
|
|
2
|
+
import React8, { createContext, useContext, useState, useRef, useEffect, createElement, useCallback, useMemo, useLayoutEffect, useDebugValue } from 'react';
|
|
3
3
|
import { useSyncExternalStore } from 'use-sync-external-store/shim/index.js';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -363,7 +363,7 @@ var defaultConfigOptions = {
|
|
|
363
363
|
initFocus,
|
|
364
364
|
initReconnect
|
|
365
365
|
};
|
|
366
|
-
var IS_REACT_LEGACY = !
|
|
366
|
+
var IS_REACT_LEGACY = !React8.useId;
|
|
367
367
|
var IS_SERVER = !isWindowDefined || isLegacyDeno;
|
|
368
368
|
var rAF = (f) => hasRequestAnimationFrame() ? window["requestAnimationFrame"](f) : setTimeout(f, 1);
|
|
369
369
|
var useIsomorphicLayoutEffect = IS_SERVER ? useEffect : useLayoutEffect;
|
|
@@ -710,7 +710,7 @@ var enableDevtools = isWindowDefined && window.__SWR_DEVTOOLS_USE__;
|
|
|
710
710
|
var use = enableDevtools ? window.__SWR_DEVTOOLS_USE__ : [];
|
|
711
711
|
var setupDevTools = () => {
|
|
712
712
|
if (enableDevtools) {
|
|
713
|
-
window.__SWR_DEVTOOLS_REACT__ =
|
|
713
|
+
window.__SWR_DEVTOOLS_REACT__ = React8;
|
|
714
714
|
}
|
|
715
715
|
};
|
|
716
716
|
var normalize = (args) => {
|
|
@@ -778,7 +778,7 @@ var withMiddleware = (useSWR2, middleware2) => {
|
|
|
778
778
|
};
|
|
779
779
|
};
|
|
780
780
|
setupDevTools();
|
|
781
|
-
var use2 =
|
|
781
|
+
var use2 = React8.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax
|
|
782
782
|
// and emitting an error.
|
|
783
783
|
// We assume that this is only for the `use(thenable)` case, not `use(context)`.
|
|
784
784
|
// https://github.com/facebook/react/blob/aed00dacfb79d17c53218404c52b1c7aa59c4a89/packages/react-server/src/ReactFizzThenable.js#L45
|
|
@@ -1537,15 +1537,15 @@ function assertContextExists(contextVal, msgOrCtx) {
|
|
|
1537
1537
|
}
|
|
1538
1538
|
var createContextAndHook = (displayName, options) => {
|
|
1539
1539
|
const { assertCtxFn = assertContextExists } = {};
|
|
1540
|
-
const Ctx =
|
|
1540
|
+
const Ctx = React8.createContext(void 0);
|
|
1541
1541
|
Ctx.displayName = displayName;
|
|
1542
1542
|
const useCtx = () => {
|
|
1543
|
-
const ctx =
|
|
1543
|
+
const ctx = React8.useContext(Ctx);
|
|
1544
1544
|
assertCtxFn(ctx, `${displayName} not found`);
|
|
1545
1545
|
return ctx.value;
|
|
1546
1546
|
};
|
|
1547
1547
|
const useCtxWithoutGuarantee = () => {
|
|
1548
|
-
const ctx =
|
|
1548
|
+
const ctx = React8.useContext(Ctx);
|
|
1549
1549
|
return ctx ? ctx.value : {};
|
|
1550
1550
|
};
|
|
1551
1551
|
return [
|
|
@@ -1555,23 +1555,23 @@ var createContextAndHook = (displayName, options) => {
|
|
|
1555
1555
|
];
|
|
1556
1556
|
};
|
|
1557
1557
|
function SWRConfigCompat({ swrConfig, children }) {
|
|
1558
|
-
return /* @__PURE__ */
|
|
1558
|
+
return /* @__PURE__ */ React8.createElement(SWRConfig2, { value: swrConfig }, children);
|
|
1559
1559
|
}
|
|
1560
1560
|
var [ClerkInstanceContext, useClerkInstanceContext] = createContextAndHook("ClerkInstanceContext");
|
|
1561
1561
|
var [UserContext, useUserContext] = createContextAndHook("UserContext");
|
|
1562
1562
|
var [ClientContext, useClientContext] = createContextAndHook("ClientContext");
|
|
1563
1563
|
var [SessionContext, useSessionContext] = createContextAndHook("SessionContext");
|
|
1564
|
-
|
|
1564
|
+
React8.createContext({});
|
|
1565
1565
|
var [CheckoutContext] = createContextAndHook("CheckoutContext");
|
|
1566
1566
|
var __experimental_CheckoutProvider = ({ children, ...rest }) => {
|
|
1567
|
-
return /* @__PURE__ */
|
|
1567
|
+
return /* @__PURE__ */ React8.createElement(CheckoutContext.Provider, { value: { value: rest } }, children);
|
|
1568
1568
|
};
|
|
1569
1569
|
var [OrganizationContextInternal, useOrganizationContext] = createContextAndHook("OrganizationContext");
|
|
1570
1570
|
var OrganizationProvider = ({ children, organization, swrConfig }) => {
|
|
1571
|
-
return /* @__PURE__ */
|
|
1571
|
+
return /* @__PURE__ */ React8.createElement(SWRConfigCompat, { swrConfig }, /* @__PURE__ */ React8.createElement(OrganizationContextInternal.Provider, { value: { value: { organization } } }, children));
|
|
1572
1572
|
};
|
|
1573
1573
|
function useAssertWrappedByClerkProvider(displayNameOrFn) {
|
|
1574
|
-
if (!
|
|
1574
|
+
if (!React8.useContext(ClerkInstanceContext)) {
|
|
1575
1575
|
if (typeof displayNameOrFn === "function") {
|
|
1576
1576
|
displayNameOrFn();
|
|
1577
1577
|
return;
|
|
@@ -2053,7 +2053,7 @@ function useOrganizationList(params) {
|
|
|
2053
2053
|
userSuggestions: suggestions
|
|
2054
2054
|
};
|
|
2055
2055
|
}
|
|
2056
|
-
var useSafeLayoutEffect = typeof window !== "undefined" ?
|
|
2056
|
+
var useSafeLayoutEffect = typeof window !== "undefined" ? React8.useLayoutEffect : React8.useEffect;
|
|
2057
2057
|
var hookName$3 = `useSession`;
|
|
2058
2058
|
var useSession = () => {
|
|
2059
2059
|
var _a;
|
|
@@ -2214,7 +2214,7 @@ var useAttachEvent = (element, event, cb) => {
|
|
|
2214
2214
|
cbRef
|
|
2215
2215
|
]);
|
|
2216
2216
|
};
|
|
2217
|
-
var ElementsContext =
|
|
2217
|
+
var ElementsContext = React8.createContext(null);
|
|
2218
2218
|
ElementsContext.displayName = "ElementsContext";
|
|
2219
2219
|
var parseElementsContext = (ctx, useCase) => {
|
|
2220
2220
|
if (!ctx) throw new Error(`Could not find Elements context; You need to wrap the part of your app that ${useCase} in an <Elements> provider.`);
|
|
@@ -2262,7 +2262,7 @@ var isEqual = (left, right) => {
|
|
|
2262
2262
|
return allKeys.every(pred);
|
|
2263
2263
|
};
|
|
2264
2264
|
var useElementsOrCheckoutSdkContextWithUseCase = (useCaseString) => {
|
|
2265
|
-
return parseElementsContext(
|
|
2265
|
+
return parseElementsContext(React8.useContext(ElementsContext), useCaseString);
|
|
2266
2266
|
};
|
|
2267
2267
|
var capitalized = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
2268
2268
|
var createElementComponent = (type, isServer) => {
|
|
@@ -2270,9 +2270,9 @@ var createElementComponent = (type, isServer) => {
|
|
|
2270
2270
|
const ClientElement = ({ id, className, fallback, options = {}, onBlur, onFocus, onReady, onChange, onEscape, onClick, onLoadError, onLoaderStart, onNetworksChange, onConfirm, onCancel, onShippingAddressChange, onShippingRateChange }) => {
|
|
2271
2271
|
const ctx = useElementsOrCheckoutSdkContextWithUseCase(`mounts <${displayName}>`);
|
|
2272
2272
|
const elements = "elements" in ctx ? ctx.elements : null;
|
|
2273
|
-
const [element, setElement] =
|
|
2274
|
-
const elementRef =
|
|
2275
|
-
const domNode =
|
|
2273
|
+
const [element, setElement] = React8.useState(null);
|
|
2274
|
+
const elementRef = React8.useRef(null);
|
|
2275
|
+
const domNode = React8.useRef(null);
|
|
2276
2276
|
const [isReady, setReady] = useState(false);
|
|
2277
2277
|
useAttachEvent(element, "blur", onBlur);
|
|
2278
2278
|
useAttachEvent(element, "focus", onFocus);
|
|
@@ -2292,7 +2292,7 @@ var createElementComponent = (type, isServer) => {
|
|
|
2292
2292
|
onReady(element);
|
|
2293
2293
|
};
|
|
2294
2294
|
useAttachEvent(element, "ready", readyCallback);
|
|
2295
|
-
|
|
2295
|
+
React8.useLayoutEffect(() => {
|
|
2296
2296
|
if (elementRef.current === null && domNode.current !== null && elements) {
|
|
2297
2297
|
let newElement = null;
|
|
2298
2298
|
if (elements) newElement = elements.create(type, options);
|
|
@@ -2302,12 +2302,12 @@ var createElementComponent = (type, isServer) => {
|
|
|
2302
2302
|
}
|
|
2303
2303
|
}, [elements, options]);
|
|
2304
2304
|
const prevOptions = usePrevious(options);
|
|
2305
|
-
|
|
2305
|
+
React8.useEffect(() => {
|
|
2306
2306
|
if (!elementRef.current) return;
|
|
2307
2307
|
const updates = extractAllowedOptionsUpdates(options, prevOptions, ["paymentRequest"]);
|
|
2308
2308
|
if (updates && "update" in elementRef.current) elementRef.current.update(updates);
|
|
2309
2309
|
}, [options, prevOptions]);
|
|
2310
|
-
|
|
2310
|
+
React8.useLayoutEffect(() => {
|
|
2311
2311
|
return () => {
|
|
2312
2312
|
if (elementRef.current && typeof elementRef.current.destroy === "function") try {
|
|
2313
2313
|
elementRef.current.destroy();
|
|
@@ -2316,7 +2316,7 @@ var createElementComponent = (type, isServer) => {
|
|
|
2316
2316
|
}
|
|
2317
2317
|
};
|
|
2318
2318
|
}, []);
|
|
2319
|
-
return /* @__PURE__ */
|
|
2319
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, !isReady && fallback, /* @__PURE__ */ React8.createElement("div", {
|
|
2320
2320
|
id,
|
|
2321
2321
|
style: {
|
|
2322
2322
|
height: isReady ? "unset" : "0px",
|
|
@@ -2329,7 +2329,7 @@ var createElementComponent = (type, isServer) => {
|
|
|
2329
2329
|
const ServerElement = (props) => {
|
|
2330
2330
|
useElementsOrCheckoutSdkContextWithUseCase(`mounts <${displayName}>`);
|
|
2331
2331
|
const { id, className } = props;
|
|
2332
|
-
return /* @__PURE__ */
|
|
2332
|
+
return /* @__PURE__ */ React8.createElement("div", {
|
|
2333
2333
|
id,
|
|
2334
2334
|
className
|
|
2335
2335
|
});
|
|
@@ -2460,8 +2460,8 @@ function useDerivedAuth(authObject, { treatPendingAsSignedOut = true } = {}) {
|
|
|
2460
2460
|
return payload;
|
|
2461
2461
|
}
|
|
2462
2462
|
function useEmailLink(resource) {
|
|
2463
|
-
const { startEmailLinkFlow, cancelEmailLinkFlow } =
|
|
2464
|
-
|
|
2463
|
+
const { startEmailLinkFlow, cancelEmailLinkFlow } = React8.useMemo(() => resource.createEmailLinkFlow(), [resource]);
|
|
2464
|
+
React8.useEffect(() => {
|
|
2465
2465
|
return cancelEmailLinkFlow;
|
|
2466
2466
|
}, []);
|
|
2467
2467
|
return {
|
|
@@ -2510,7 +2510,7 @@ var withClerk = (Component, displayNameOrOptions) => {
|
|
|
2510
2510
|
if (!clerk.loaded && !(options == null ? void 0 : options.renderWhileLoading)) {
|
|
2511
2511
|
return null;
|
|
2512
2512
|
}
|
|
2513
|
-
return /* @__PURE__ */
|
|
2513
|
+
return /* @__PURE__ */ React8.createElement(
|
|
2514
2514
|
Component,
|
|
2515
2515
|
{
|
|
2516
2516
|
...props,
|
|
@@ -2635,7 +2635,7 @@ var RedirectToSignIn = withClerk(({ clerk, ...props }) => {
|
|
|
2635
2635
|
// Compat for clerk-js<5.54.0 (which was released with the `signedInSessions` property)
|
|
2636
2636
|
client.activeSessions && client.activeSessions.length > 0
|
|
2637
2637
|
);
|
|
2638
|
-
|
|
2638
|
+
React8.useEffect(() => {
|
|
2639
2639
|
if (session === null && hasSignedInSessions) {
|
|
2640
2640
|
void clerk.redirectToAfterSignOut();
|
|
2641
2641
|
} else {
|
|
@@ -2645,33 +2645,33 @@ var RedirectToSignIn = withClerk(({ clerk, ...props }) => {
|
|
|
2645
2645
|
return null;
|
|
2646
2646
|
}, "RedirectToSignIn");
|
|
2647
2647
|
var RedirectToSignUp = withClerk(({ clerk, ...props }) => {
|
|
2648
|
-
|
|
2648
|
+
React8.useEffect(() => {
|
|
2649
2649
|
void clerk.redirectToSignUp(props);
|
|
2650
2650
|
}, []);
|
|
2651
2651
|
return null;
|
|
2652
2652
|
}, "RedirectToSignUp");
|
|
2653
2653
|
withClerk(({ clerk, ...props }) => {
|
|
2654
|
-
|
|
2654
|
+
React8.useEffect(() => {
|
|
2655
2655
|
void clerk.redirectToTasks(props);
|
|
2656
2656
|
}, []);
|
|
2657
2657
|
return null;
|
|
2658
2658
|
}, "RedirectToTasks");
|
|
2659
2659
|
var RedirectToUserProfile = withClerk(({ clerk }) => {
|
|
2660
|
-
|
|
2660
|
+
React8.useEffect(() => {
|
|
2661
2661
|
deprecated("RedirectToUserProfile", "Use the `redirectToUserProfile()` method instead.");
|
|
2662
2662
|
void clerk.redirectToUserProfile();
|
|
2663
2663
|
}, []);
|
|
2664
2664
|
return null;
|
|
2665
2665
|
}, "RedirectToUserProfile");
|
|
2666
2666
|
var RedirectToOrganizationProfile = withClerk(({ clerk }) => {
|
|
2667
|
-
|
|
2667
|
+
React8.useEffect(() => {
|
|
2668
2668
|
deprecated("RedirectToOrganizationProfile", "Use the `redirectToOrganizationProfile()` method instead.");
|
|
2669
2669
|
void clerk.redirectToOrganizationProfile();
|
|
2670
2670
|
}, []);
|
|
2671
2671
|
return null;
|
|
2672
2672
|
}, "RedirectToOrganizationProfile");
|
|
2673
2673
|
var RedirectToCreateOrganization = withClerk(({ clerk }) => {
|
|
2674
|
-
|
|
2674
|
+
React8.useEffect(() => {
|
|
2675
2675
|
deprecated("RedirectToCreateOrganization", "Use the `redirectToCreateOrganization()` method instead.");
|
|
2676
2676
|
void clerk.redirectToCreateOrganization();
|
|
2677
2677
|
}, []);
|
|
@@ -2679,7 +2679,7 @@ var RedirectToCreateOrganization = withClerk(({ clerk }) => {
|
|
|
2679
2679
|
}, "RedirectToCreateOrganization");
|
|
2680
2680
|
var AuthenticateWithRedirectCallback = withClerk(
|
|
2681
2681
|
({ clerk, ...handleRedirectCallbackParams }) => {
|
|
2682
|
-
|
|
2682
|
+
React8.useEffect(() => {
|
|
2683
2683
|
void clerk.handleRedirectCallback(handleRedirectCallbackParams);
|
|
2684
2684
|
}, []);
|
|
2685
2685
|
return null;
|
|
@@ -2705,9 +2705,13 @@ var without = (obj, ...props) => {
|
|
|
2705
2705
|
for (const prop of props) delete copy[prop];
|
|
2706
2706
|
return copy;
|
|
2707
2707
|
};
|
|
2708
|
+
var PortalContext = createContext(void 0);
|
|
2709
|
+
function usePortalConfig() {
|
|
2710
|
+
return useContext(PortalContext);
|
|
2711
|
+
}
|
|
2708
2712
|
var assertSingleChild = (children) => (name) => {
|
|
2709
2713
|
try {
|
|
2710
|
-
return
|
|
2714
|
+
return React8.Children.only(children);
|
|
2711
2715
|
} catch {
|
|
2712
2716
|
return errorThrower.throw(multipleChildrenInButtonComponent(name));
|
|
2713
2717
|
}
|
|
@@ -2717,7 +2721,7 @@ var normalizeWithDefaultValue = (children, defaultText) => {
|
|
|
2717
2721
|
children = defaultText;
|
|
2718
2722
|
}
|
|
2719
2723
|
if (typeof children === "string") {
|
|
2720
|
-
children = /* @__PURE__ */
|
|
2724
|
+
children = /* @__PURE__ */ React8.createElement("button", null, children);
|
|
2721
2725
|
}
|
|
2722
2726
|
return children;
|
|
2723
2727
|
};
|
|
@@ -2731,7 +2735,7 @@ function isConstructor(f) {
|
|
|
2731
2735
|
}
|
|
2732
2736
|
var counts = /* @__PURE__ */ new Map();
|
|
2733
2737
|
function useMaxAllowedInstancesGuard(name, error, maxCount = 1) {
|
|
2734
|
-
|
|
2738
|
+
React8.useEffect(() => {
|
|
2735
2739
|
const count = counts.get(name) || 0;
|
|
2736
2740
|
if (count == maxCount) {
|
|
2737
2741
|
return errorThrower.throw(error);
|
|
@@ -2746,7 +2750,7 @@ function withMaxAllowedInstancesGuard(WrappedComponent, name, error) {
|
|
|
2746
2750
|
const displayName = WrappedComponent.displayName || WrappedComponent.name || name || "Component";
|
|
2747
2751
|
const Hoc = (props) => {
|
|
2748
2752
|
useMaxAllowedInstancesGuard(name, error);
|
|
2749
|
-
return /* @__PURE__ */
|
|
2753
|
+
return /* @__PURE__ */ React8.createElement(WrappedComponent, { ...props });
|
|
2750
2754
|
};
|
|
2751
2755
|
Hoc.displayName = `withMaxAllowedInstancesGuard(${displayName})`;
|
|
2752
2756
|
return Hoc;
|
|
@@ -2768,7 +2772,7 @@ var useCustomElementPortal = (elements) => {
|
|
|
2768
2772
|
}));
|
|
2769
2773
|
};
|
|
2770
2774
|
var isThatComponent = (v, component) => {
|
|
2771
|
-
return !!v &&
|
|
2775
|
+
return !!v && React8.isValidElement(v) && (v == null ? void 0 : v.type) === component;
|
|
2772
2776
|
};
|
|
2773
2777
|
var useUserProfileCustomPages = (children, options) => {
|
|
2774
2778
|
const reorderItemsLabels = ["account", "security"];
|
|
@@ -2806,7 +2810,7 @@ var useSanitizedChildren = (children) => {
|
|
|
2806
2810
|
UserProfilePage,
|
|
2807
2811
|
UserProfileLink
|
|
2808
2812
|
];
|
|
2809
|
-
|
|
2813
|
+
React8.Children.forEach(children, (child) => {
|
|
2810
2814
|
if (!excludedComponents.some((component) => isThatComponent(child, component))) {
|
|
2811
2815
|
sanitizedChildren.push(child);
|
|
2812
2816
|
}
|
|
@@ -2817,7 +2821,7 @@ var useCustomPages = (params, options) => {
|
|
|
2817
2821
|
const { children, LinkComponent, PageComponent, MenuItemsComponent, reorderItemsLabels, componentName } = params;
|
|
2818
2822
|
const { allowForAnyChildren = false } = options || {};
|
|
2819
2823
|
const validChildren = [];
|
|
2820
|
-
|
|
2824
|
+
React8.Children.forEach(children, (child) => {
|
|
2821
2825
|
if (!isThatComponent(child, PageComponent) && !isThatComponent(child, LinkComponent) && !isThatComponent(child, MenuItemsComponent)) {
|
|
2822
2826
|
if (child && !allowForAnyChildren) {
|
|
2823
2827
|
logErrorInDevMode(customPagesIgnoredComponent(componentName));
|
|
@@ -2936,7 +2940,7 @@ var useCustomMenuItems = ({
|
|
|
2936
2940
|
const validChildren = [];
|
|
2937
2941
|
const customMenuItems = [];
|
|
2938
2942
|
const customMenuItemsPortals = [];
|
|
2939
|
-
|
|
2943
|
+
React8.Children.forEach(children, (child) => {
|
|
2940
2944
|
if (!isThatComponent(child, MenuItemsComponent) && !isThatComponent(child, UserProfileLinkComponent) && !isThatComponent(child, UserProfilePageComponent)) {
|
|
2941
2945
|
if (child && !allowForAnyChildren) {
|
|
2942
2946
|
logErrorInDevMode(userButtonIgnoredComponent);
|
|
@@ -2947,7 +2951,7 @@ var useCustomMenuItems = ({
|
|
|
2947
2951
|
return;
|
|
2948
2952
|
}
|
|
2949
2953
|
const { props } = child;
|
|
2950
|
-
|
|
2954
|
+
React8.Children.forEach(props.children, (child2) => {
|
|
2951
2955
|
if (!isThatComponent(child2, MenuActionComponent) && !isThatComponent(child2, MenuLinkComponent)) {
|
|
2952
2956
|
if (child2) {
|
|
2953
2957
|
logErrorInDevMode(customMenuItemsIgnoredComponent);
|
|
@@ -3139,10 +3143,10 @@ var isOpenProps = (props) => {
|
|
|
3139
3143
|
var stripMenuItemIconHandlers = (menuItems) => {
|
|
3140
3144
|
return menuItems == null ? void 0 : menuItems.map(({ mountIcon, unmountIcon, ...rest }) => rest);
|
|
3141
3145
|
};
|
|
3142
|
-
var ClerkHostRenderer = class extends
|
|
3146
|
+
var ClerkHostRenderer = class extends React8.PureComponent {
|
|
3143
3147
|
constructor() {
|
|
3144
3148
|
super(...arguments);
|
|
3145
|
-
this.rootRef =
|
|
3149
|
+
this.rootRef = React8.createRef();
|
|
3146
3150
|
}
|
|
3147
3151
|
componentDidUpdate(_prevProps) {
|
|
3148
3152
|
var _a, _b, _c, _d;
|
|
@@ -3188,12 +3192,12 @@ var ClerkHostRenderer = class extends React7.PureComponent {
|
|
|
3188
3192
|
...this.props.rootProps,
|
|
3189
3193
|
...this.props.component && { "data-clerk-component": this.props.component }
|
|
3190
3194
|
};
|
|
3191
|
-
return /* @__PURE__ */
|
|
3195
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, !hideRootHtmlElement && /* @__PURE__ */ React8.createElement("div", { ...rootAttributes }), this.props.children);
|
|
3192
3196
|
}
|
|
3193
3197
|
};
|
|
3194
3198
|
var CustomPortalsRenderer = (props) => {
|
|
3195
3199
|
var _a, _b;
|
|
3196
|
-
return /* @__PURE__ */
|
|
3200
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, (_a = props == null ? void 0 : props.customPagesPortals) == null ? void 0 : _a.map((portal, index) => createElement(portal, { key: index })), (_b = props == null ? void 0 : props.customMenuItemsPortals) == null ? void 0 : _b.map((portal, index) => createElement(portal, { key: index })));
|
|
3197
3201
|
};
|
|
3198
3202
|
var SignIn = withClerk(
|
|
3199
3203
|
({ clerk, component, fallback, ...props }) => {
|
|
@@ -3202,7 +3206,7 @@ var SignIn = withClerk(
|
|
|
3202
3206
|
const rendererRootProps = {
|
|
3203
3207
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
3204
3208
|
};
|
|
3205
|
-
return /* @__PURE__ */
|
|
3209
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(
|
|
3206
3210
|
ClerkHostRenderer,
|
|
3207
3211
|
{
|
|
3208
3212
|
component,
|
|
@@ -3223,7 +3227,7 @@ var SignUp = withClerk(
|
|
|
3223
3227
|
const rendererRootProps = {
|
|
3224
3228
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
3225
3229
|
};
|
|
3226
|
-
return /* @__PURE__ */
|
|
3230
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(
|
|
3227
3231
|
ClerkHostRenderer,
|
|
3228
3232
|
{
|
|
3229
3233
|
component,
|
|
@@ -3239,11 +3243,11 @@ var SignUp = withClerk(
|
|
|
3239
3243
|
);
|
|
3240
3244
|
function UserProfilePage({ children }) {
|
|
3241
3245
|
logErrorInDevMode(userProfilePageRenderedError);
|
|
3242
|
-
return /* @__PURE__ */
|
|
3246
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);
|
|
3243
3247
|
}
|
|
3244
3248
|
function UserProfileLink({ children }) {
|
|
3245
3249
|
logErrorInDevMode(userProfileLinkRenderedError);
|
|
3246
|
-
return /* @__PURE__ */
|
|
3250
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);
|
|
3247
3251
|
}
|
|
3248
3252
|
var _UserProfile = withClerk(
|
|
3249
3253
|
({
|
|
@@ -3254,21 +3258,23 @@ var _UserProfile = withClerk(
|
|
|
3254
3258
|
}) => {
|
|
3255
3259
|
const mountingStatus = useWaitForComponentMount(component);
|
|
3256
3260
|
const shouldShowFallback = mountingStatus === "rendering" || !clerk.loaded;
|
|
3261
|
+
const portalFromContext = usePortalConfig();
|
|
3262
|
+
const portal = props.portal !== void 0 ? props.portal : portalFromContext;
|
|
3257
3263
|
const rendererRootProps = {
|
|
3258
3264
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
3259
3265
|
};
|
|
3260
3266
|
const { customPages, customPagesPortals } = useUserProfileCustomPages(props.children);
|
|
3261
|
-
return /* @__PURE__ */
|
|
3267
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, /* @__PURE__ */ React8.createElement(
|
|
3262
3268
|
ClerkHostRenderer,
|
|
3263
3269
|
{
|
|
3264
3270
|
component,
|
|
3265
3271
|
mount: clerk.mountUserProfile,
|
|
3266
3272
|
unmount: clerk.unmountUserProfile,
|
|
3267
3273
|
updateProps: clerk.__unstable__updateProps,
|
|
3268
|
-
props: { ...props, customPages },
|
|
3274
|
+
props: { ...props, portal, customPages },
|
|
3269
3275
|
rootProps: rendererRootProps
|
|
3270
3276
|
},
|
|
3271
|
-
/* @__PURE__ */
|
|
3277
|
+
/* @__PURE__ */ React8.createElement(CustomPortalsRenderer, { customPagesPortals })
|
|
3272
3278
|
));
|
|
3273
3279
|
},
|
|
3274
3280
|
{ component: "UserProfile", renderWhileLoading: true }
|
|
@@ -3294,6 +3300,8 @@ var _UserButton = withClerk(
|
|
|
3294
3300
|
}) => {
|
|
3295
3301
|
const mountingStatus = useWaitForComponentMount(component);
|
|
3296
3302
|
const shouldShowFallback = mountingStatus === "rendering" || !clerk.loaded;
|
|
3303
|
+
const portalFromContext = usePortalConfig();
|
|
3304
|
+
const portal = props.portal !== void 0 ? props.portal : portalFromContext;
|
|
3297
3305
|
const rendererRootProps = {
|
|
3298
3306
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
3299
3307
|
};
|
|
@@ -3309,13 +3317,13 @@ var _UserButton = withClerk(
|
|
|
3309
3317
|
mount: clerk.mountUserButton,
|
|
3310
3318
|
unmount: clerk.unmountUserButton,
|
|
3311
3319
|
updateProps: clerk.__unstable__updateProps,
|
|
3312
|
-
props: { ...props, userProfileProps, customMenuItems }
|
|
3320
|
+
props: { ...props, portal, userProfileProps, customMenuItems }
|
|
3313
3321
|
};
|
|
3314
3322
|
const portalProps = {
|
|
3315
3323
|
customPagesPortals,
|
|
3316
3324
|
customMenuItemsPortals
|
|
3317
3325
|
};
|
|
3318
|
-
return /* @__PURE__ */
|
|
3326
|
+
return /* @__PURE__ */ React8.createElement(UserButtonContext.Provider, { value: passableProps }, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(
|
|
3319
3327
|
ClerkHostRenderer,
|
|
3320
3328
|
{
|
|
3321
3329
|
component,
|
|
@@ -3324,22 +3332,22 @@ var _UserButton = withClerk(
|
|
|
3324
3332
|
rootProps: rendererRootProps
|
|
3325
3333
|
},
|
|
3326
3334
|
props.__experimental_asProvider ? sanitizedChildren : null,
|
|
3327
|
-
/* @__PURE__ */
|
|
3335
|
+
/* @__PURE__ */ React8.createElement(CustomPortalsRenderer, { ...portalProps })
|
|
3328
3336
|
));
|
|
3329
3337
|
},
|
|
3330
3338
|
{ component: "UserButton", renderWhileLoading: true }
|
|
3331
3339
|
);
|
|
3332
3340
|
function MenuItems({ children }) {
|
|
3333
3341
|
logErrorInDevMode(userButtonMenuItemsRenderedError);
|
|
3334
|
-
return /* @__PURE__ */
|
|
3342
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);
|
|
3335
3343
|
}
|
|
3336
3344
|
function MenuAction({ children }) {
|
|
3337
3345
|
logErrorInDevMode(userButtonMenuActionRenderedError);
|
|
3338
|
-
return /* @__PURE__ */
|
|
3346
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);
|
|
3339
3347
|
}
|
|
3340
3348
|
function MenuLink({ children }) {
|
|
3341
3349
|
logErrorInDevMode(userButtonMenuLinkRenderedError);
|
|
3342
|
-
return /* @__PURE__ */
|
|
3350
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);
|
|
3343
3351
|
}
|
|
3344
3352
|
function UserButtonOutlet(outletProps) {
|
|
3345
3353
|
const providerProps = useContext(UserButtonContext);
|
|
@@ -3350,7 +3358,7 @@ function UserButtonOutlet(outletProps) {
|
|
|
3350
3358
|
...outletProps
|
|
3351
3359
|
}
|
|
3352
3360
|
};
|
|
3353
|
-
return /* @__PURE__ */
|
|
3361
|
+
return /* @__PURE__ */ React8.createElement(ClerkHostRenderer, { ...portalProps });
|
|
3354
3362
|
}
|
|
3355
3363
|
var UserButton = Object.assign(_UserButton, {
|
|
3356
3364
|
UserProfilePage,
|
|
@@ -3362,11 +3370,11 @@ var UserButton = Object.assign(_UserButton, {
|
|
|
3362
3370
|
});
|
|
3363
3371
|
function OrganizationProfilePage({ children }) {
|
|
3364
3372
|
logErrorInDevMode(organizationProfilePageRenderedError);
|
|
3365
|
-
return /* @__PURE__ */
|
|
3373
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);
|
|
3366
3374
|
}
|
|
3367
3375
|
function OrganizationProfileLink({ children }) {
|
|
3368
3376
|
logErrorInDevMode(organizationProfileLinkRenderedError);
|
|
3369
|
-
return /* @__PURE__ */
|
|
3377
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, children);
|
|
3370
3378
|
}
|
|
3371
3379
|
var _OrganizationProfile = withClerk(
|
|
3372
3380
|
({
|
|
@@ -3381,7 +3389,7 @@ var _OrganizationProfile = withClerk(
|
|
|
3381
3389
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
3382
3390
|
};
|
|
3383
3391
|
const { customPages, customPagesPortals } = useOrganizationProfileCustomPages(props.children);
|
|
3384
|
-
return /* @__PURE__ */
|
|
3392
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(
|
|
3385
3393
|
ClerkHostRenderer,
|
|
3386
3394
|
{
|
|
3387
3395
|
component,
|
|
@@ -3391,7 +3399,7 @@ var _OrganizationProfile = withClerk(
|
|
|
3391
3399
|
props: { ...props, customPages },
|
|
3392
3400
|
rootProps: rendererRootProps
|
|
3393
3401
|
},
|
|
3394
|
-
/* @__PURE__ */
|
|
3402
|
+
/* @__PURE__ */ React8.createElement(CustomPortalsRenderer, { customPagesPortals })
|
|
3395
3403
|
));
|
|
3396
3404
|
},
|
|
3397
3405
|
{ component: "OrganizationProfile", renderWhileLoading: true }
|
|
@@ -3407,7 +3415,7 @@ var CreateOrganization = withClerk(
|
|
|
3407
3415
|
const rendererRootProps = {
|
|
3408
3416
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
3409
3417
|
};
|
|
3410
|
-
return /* @__PURE__ */
|
|
3418
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(
|
|
3411
3419
|
ClerkHostRenderer,
|
|
3412
3420
|
{
|
|
3413
3421
|
component,
|
|
@@ -3438,6 +3446,8 @@ var _OrganizationSwitcher = withClerk(
|
|
|
3438
3446
|
}) => {
|
|
3439
3447
|
const mountingStatus = useWaitForComponentMount(component);
|
|
3440
3448
|
const shouldShowFallback = mountingStatus === "rendering" || !clerk.loaded;
|
|
3449
|
+
const portalFromContext = usePortalConfig();
|
|
3450
|
+
const portal = props.portal !== void 0 ? props.portal : portalFromContext;
|
|
3441
3451
|
const rendererRootProps = {
|
|
3442
3452
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
3443
3453
|
};
|
|
@@ -3450,19 +3460,19 @@ var _OrganizationSwitcher = withClerk(
|
|
|
3450
3460
|
mount: clerk.mountOrganizationSwitcher,
|
|
3451
3461
|
unmount: clerk.unmountOrganizationSwitcher,
|
|
3452
3462
|
updateProps: clerk.__unstable__updateProps,
|
|
3453
|
-
props: { ...props, organizationProfileProps },
|
|
3463
|
+
props: { ...props, portal, organizationProfileProps },
|
|
3454
3464
|
rootProps: rendererRootProps,
|
|
3455
3465
|
component
|
|
3456
3466
|
};
|
|
3457
3467
|
clerk.__experimental_prefetchOrganizationSwitcher();
|
|
3458
|
-
return /* @__PURE__ */
|
|
3468
|
+
return /* @__PURE__ */ React8.createElement(OrganizationSwitcherContext.Provider, { value: passableProps }, /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(
|
|
3459
3469
|
ClerkHostRenderer,
|
|
3460
3470
|
{
|
|
3461
3471
|
...passableProps,
|
|
3462
3472
|
hideRootHtmlElement: !!props.__experimental_asProvider
|
|
3463
3473
|
},
|
|
3464
3474
|
props.__experimental_asProvider ? sanitizedChildren : null,
|
|
3465
|
-
/* @__PURE__ */
|
|
3475
|
+
/* @__PURE__ */ React8.createElement(CustomPortalsRenderer, { customPagesPortals })
|
|
3466
3476
|
)));
|
|
3467
3477
|
},
|
|
3468
3478
|
{ component: "OrganizationSwitcher", renderWhileLoading: true }
|
|
@@ -3476,7 +3486,7 @@ function OrganizationSwitcherOutlet(outletProps) {
|
|
|
3476
3486
|
...outletProps
|
|
3477
3487
|
}
|
|
3478
3488
|
};
|
|
3479
|
-
return /* @__PURE__ */
|
|
3489
|
+
return /* @__PURE__ */ React8.createElement(ClerkHostRenderer, { ...portalProps });
|
|
3480
3490
|
}
|
|
3481
3491
|
var OrganizationSwitcher = Object.assign(_OrganizationSwitcher, {
|
|
3482
3492
|
OrganizationProfilePage,
|
|
@@ -3490,7 +3500,7 @@ var OrganizationList = withClerk(
|
|
|
3490
3500
|
const rendererRootProps = {
|
|
3491
3501
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
3492
3502
|
};
|
|
3493
|
-
return /* @__PURE__ */
|
|
3503
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(
|
|
3494
3504
|
ClerkHostRenderer,
|
|
3495
3505
|
{
|
|
3496
3506
|
component,
|
|
@@ -3511,7 +3521,7 @@ withClerk(
|
|
|
3511
3521
|
const rendererRootProps = {
|
|
3512
3522
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
3513
3523
|
};
|
|
3514
|
-
return /* @__PURE__ */
|
|
3524
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(
|
|
3515
3525
|
ClerkHostRenderer,
|
|
3516
3526
|
{
|
|
3517
3527
|
component,
|
|
@@ -3532,7 +3542,7 @@ var Waitlist = withClerk(
|
|
|
3532
3542
|
const rendererRootProps = {
|
|
3533
3543
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
3534
3544
|
};
|
|
3535
|
-
return /* @__PURE__ */
|
|
3545
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(
|
|
3536
3546
|
ClerkHostRenderer,
|
|
3537
3547
|
{
|
|
3538
3548
|
component,
|
|
@@ -3556,7 +3566,7 @@ var PricingTable = withClerk(
|
|
|
3556
3566
|
const rendererRootProps = {
|
|
3557
3567
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
3558
3568
|
};
|
|
3559
|
-
return /* @__PURE__ */
|
|
3569
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(
|
|
3560
3570
|
ClerkHostRenderer,
|
|
3561
3571
|
{
|
|
3562
3572
|
component,
|
|
@@ -3577,7 +3587,7 @@ var APIKeys = withClerk(
|
|
|
3577
3587
|
const rendererRootProps = {
|
|
3578
3588
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
3579
3589
|
};
|
|
3580
|
-
return /* @__PURE__ */
|
|
3590
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(
|
|
3581
3591
|
ClerkHostRenderer,
|
|
3582
3592
|
{
|
|
3583
3593
|
component,
|
|
@@ -3598,7 +3608,7 @@ var UserAvatar = withClerk(
|
|
|
3598
3608
|
const rendererRootProps = {
|
|
3599
3609
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
3600
3610
|
};
|
|
3601
|
-
return /* @__PURE__ */
|
|
3611
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(
|
|
3602
3612
|
ClerkHostRenderer,
|
|
3603
3613
|
{
|
|
3604
3614
|
component,
|
|
@@ -3619,7 +3629,7 @@ withClerk(
|
|
|
3619
3629
|
const rendererRootProps = {
|
|
3620
3630
|
...shouldShowFallback && fallback && { style: { display: "none" } }
|
|
3621
3631
|
};
|
|
3622
|
-
return /* @__PURE__ */
|
|
3632
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React8.createElement(
|
|
3623
3633
|
ClerkHostRenderer,
|
|
3624
3634
|
{
|
|
3625
3635
|
component,
|
|
@@ -3644,7 +3654,7 @@ var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError("Canno
|
|
|
3644
3654
|
var __privateSet2 = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
3645
3655
|
var __privateMethod2 = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
3646
3656
|
|
|
3647
|
-
// ../shared/dist/runtime/loadClerkJsScript-
|
|
3657
|
+
// ../shared/dist/runtime/loadClerkJsScript-C-6GgyjL.mjs
|
|
3648
3658
|
var { isDevOrStagingUrl } = createDevOrStagingUrlCache();
|
|
3649
3659
|
var errorThrower2 = buildErrorThrower({ packageName: "@clerk/shared" });
|
|
3650
3660
|
function setClerkJsLoadingErrorPackageName(packageName) {
|
|
@@ -3802,7 +3812,7 @@ var SignInButton = withClerk(
|
|
|
3802
3812
|
return clickHandler();
|
|
3803
3813
|
};
|
|
3804
3814
|
const childProps = { ...rest, onClick: wrappedChildClickHandler };
|
|
3805
|
-
return
|
|
3815
|
+
return React8.cloneElement(child, childProps);
|
|
3806
3816
|
},
|
|
3807
3817
|
{ component: "SignInButton", renderWhileLoading: true }
|
|
3808
3818
|
);
|
|
@@ -3822,7 +3832,7 @@ var SignInWithMetamaskButton = withClerk(
|
|
|
3822
3832
|
return clickHandler();
|
|
3823
3833
|
};
|
|
3824
3834
|
const childProps = { ...rest, onClick: wrappedChildClickHandler };
|
|
3825
|
-
return
|
|
3835
|
+
return React8.cloneElement(child, childProps);
|
|
3826
3836
|
},
|
|
3827
3837
|
{ component: "SignInWithMetamask", renderWhileLoading: true }
|
|
3828
3838
|
);
|
|
@@ -3837,7 +3847,7 @@ var SignOutButton = withClerk(
|
|
|
3837
3847
|
return clickHandler();
|
|
3838
3848
|
};
|
|
3839
3849
|
const childProps = { ...rest, onClick: wrappedChildClickHandler };
|
|
3840
|
-
return
|
|
3850
|
+
return React8.cloneElement(child, childProps);
|
|
3841
3851
|
},
|
|
3842
3852
|
{ component: "SignOutButton", renderWhileLoading: true }
|
|
3843
3853
|
);
|
|
@@ -3884,7 +3894,7 @@ var SignUpButton = withClerk(
|
|
|
3884
3894
|
return clickHandler();
|
|
3885
3895
|
};
|
|
3886
3896
|
const childProps = { ...rest, onClick: wrappedChildClickHandler };
|
|
3887
|
-
return
|
|
3897
|
+
return React8.cloneElement(child, childProps);
|
|
3888
3898
|
},
|
|
3889
3899
|
{ component: "SignUpButton", renderWhileLoading: true }
|
|
3890
3900
|
);
|
|
@@ -4164,7 +4174,7 @@ if (typeof globalThis.__BUILD_DISABLE_RHC__ === "undefined") {
|
|
|
4164
4174
|
}
|
|
4165
4175
|
var SDK_METADATA = {
|
|
4166
4176
|
name: "@clerk/clerk-react",
|
|
4167
|
-
version: "5.56.0-snapshot.
|
|
4177
|
+
version: "5.56.0-snapshot.v20251117220746",
|
|
4168
4178
|
environment: process.env.NODE_ENV
|
|
4169
4179
|
};
|
|
4170
4180
|
var _status;
|
|
@@ -5398,24 +5408,24 @@ var IsomorphicClerk = _IsomorphicClerk;
|
|
|
5398
5408
|
function ClerkContextProvider(props) {
|
|
5399
5409
|
const { isomorphicClerkOptions, initialState, children } = props;
|
|
5400
5410
|
const { isomorphicClerk: clerk, clerkStatus } = useLoadedIsomorphicClerk(isomorphicClerkOptions);
|
|
5401
|
-
const [state, setState] =
|
|
5411
|
+
const [state, setState] = React8.useState({
|
|
5402
5412
|
client: clerk.client,
|
|
5403
5413
|
session: clerk.session,
|
|
5404
5414
|
user: clerk.user,
|
|
5405
5415
|
organization: clerk.organization
|
|
5406
5416
|
});
|
|
5407
|
-
|
|
5417
|
+
React8.useEffect(() => {
|
|
5408
5418
|
return clerk.addListener((e) => setState({ ...e }));
|
|
5409
5419
|
}, []);
|
|
5410
5420
|
const derivedState = deriveState(clerk.loaded, state, initialState);
|
|
5411
|
-
const clerkCtx =
|
|
5421
|
+
const clerkCtx = React8.useMemo(
|
|
5412
5422
|
() => ({ value: clerk }),
|
|
5413
5423
|
[
|
|
5414
5424
|
// Only update the clerk reference on status change
|
|
5415
5425
|
clerkStatus
|
|
5416
5426
|
]
|
|
5417
5427
|
);
|
|
5418
|
-
const clientCtx =
|
|
5428
|
+
const clientCtx = React8.useMemo(() => ({ value: state.client }), [state.client]);
|
|
5419
5429
|
const {
|
|
5420
5430
|
sessionId,
|
|
5421
5431
|
sessionStatus,
|
|
@@ -5431,7 +5441,7 @@ function ClerkContextProvider(props) {
|
|
|
5431
5441
|
orgPermissions,
|
|
5432
5442
|
factorVerificationAge
|
|
5433
5443
|
} = derivedState;
|
|
5434
|
-
const authCtx =
|
|
5444
|
+
const authCtx = React8.useMemo(() => {
|
|
5435
5445
|
const value = {
|
|
5436
5446
|
sessionId,
|
|
5437
5447
|
sessionStatus,
|
|
@@ -5446,9 +5456,9 @@ function ClerkContextProvider(props) {
|
|
|
5446
5456
|
};
|
|
5447
5457
|
return { value };
|
|
5448
5458
|
}, [sessionId, sessionStatus, userId, actor, orgId, orgRole, orgSlug, factorVerificationAge, sessionClaims == null ? void 0 : sessionClaims.__raw]);
|
|
5449
|
-
const sessionCtx =
|
|
5450
|
-
const userCtx =
|
|
5451
|
-
const organizationCtx =
|
|
5459
|
+
const sessionCtx = React8.useMemo(() => ({ value: session }), [sessionId, session]);
|
|
5460
|
+
const userCtx = React8.useMemo(() => ({ value: user }), [userId, user]);
|
|
5461
|
+
const organizationCtx = React8.useMemo(() => {
|
|
5452
5462
|
const value = {
|
|
5453
5463
|
organization
|
|
5454
5464
|
};
|
|
@@ -5456,7 +5466,7 @@ function ClerkContextProvider(props) {
|
|
|
5456
5466
|
}, [orgId, organization]);
|
|
5457
5467
|
return (
|
|
5458
5468
|
// @ts-expect-error value passed is of type IsomorphicClerk where the context expects LoadedClerk
|
|
5459
|
-
/* @__PURE__ */
|
|
5469
|
+
/* @__PURE__ */ React8.createElement(IsomorphicClerkContext.Provider, { value: clerkCtx }, /* @__PURE__ */ React8.createElement(ClientContext.Provider, { value: clientCtx }, /* @__PURE__ */ React8.createElement(SessionContext.Provider, { value: sessionCtx }, /* @__PURE__ */ React8.createElement(OrganizationProvider, { ...organizationCtx.value }, /* @__PURE__ */ React8.createElement(AuthContext.Provider, { value: authCtx }, /* @__PURE__ */ React8.createElement(UserContext.Provider, { value: userCtx }, /* @__PURE__ */ React8.createElement(
|
|
5460
5470
|
__experimental_CheckoutProvider,
|
|
5461
5471
|
{
|
|
5462
5472
|
value: void 0
|
|
@@ -5466,15 +5476,15 @@ function ClerkContextProvider(props) {
|
|
|
5466
5476
|
);
|
|
5467
5477
|
}
|
|
5468
5478
|
var useLoadedIsomorphicClerk = (options) => {
|
|
5469
|
-
const isomorphicClerkRef =
|
|
5470
|
-
const [clerkStatus, setClerkStatus] =
|
|
5471
|
-
|
|
5479
|
+
const isomorphicClerkRef = React8.useRef(IsomorphicClerk.getOrCreateInstance(options));
|
|
5480
|
+
const [clerkStatus, setClerkStatus] = React8.useState(isomorphicClerkRef.current.status);
|
|
5481
|
+
React8.useEffect(() => {
|
|
5472
5482
|
void isomorphicClerkRef.current.__unstable__updateProps({ appearance: options.appearance });
|
|
5473
5483
|
}, [options.appearance]);
|
|
5474
|
-
|
|
5484
|
+
React8.useEffect(() => {
|
|
5475
5485
|
void isomorphicClerkRef.current.__unstable__updateProps({ options });
|
|
5476
5486
|
}, [options.localization]);
|
|
5477
|
-
|
|
5487
|
+
React8.useEffect(() => {
|
|
5478
5488
|
isomorphicClerkRef.current.on("status", setClerkStatus);
|
|
5479
5489
|
return () => {
|
|
5480
5490
|
if (isomorphicClerkRef.current) {
|
|
@@ -5495,7 +5505,7 @@ function ClerkProviderBase(props) {
|
|
|
5495
5505
|
errorThrower.throwInvalidPublishableKeyError({ key: publishableKey });
|
|
5496
5506
|
}
|
|
5497
5507
|
}
|
|
5498
|
-
return /* @__PURE__ */
|
|
5508
|
+
return /* @__PURE__ */ React8.createElement(
|
|
5499
5509
|
ClerkContextProvider,
|
|
5500
5510
|
{
|
|
5501
5511
|
initialState,
|
|
@@ -5511,8 +5521,8 @@ setClerkJsLoadingErrorPackageName("@clerk/clerk-react");
|
|
|
5511
5521
|
function ClerkProvider2(props) {
|
|
5512
5522
|
const { children, storageCache, syncHost, __experimental_syncHostListener, ...rest } = props;
|
|
5513
5523
|
const { publishableKey = "" } = props;
|
|
5514
|
-
const [clerkInstance, setClerkInstance] =
|
|
5515
|
-
|
|
5524
|
+
const [clerkInstance, setClerkInstance] = React8.useState(null);
|
|
5525
|
+
React8.useEffect(() => {
|
|
5516
5526
|
void (async () => {
|
|
5517
5527
|
setClerkInstance(
|
|
5518
5528
|
await createClerkClient({ publishableKey, storageCache, syncHost, __experimental_syncHostListener })
|
|
@@ -5537,5 +5547,5 @@ function ClerkProvider2(props) {
|
|
|
5537
5547
|
var GoogleOneTap2 = () => null;
|
|
5538
5548
|
|
|
5539
5549
|
export { APIKeys, AuthenticateWithRedirectCallback, ClerkDegraded, ClerkFailed, ClerkLoaded, ClerkLoading, ClerkProvider2 as ClerkProvider, CreateOrganization, GoogleOneTap2 as GoogleOneTap, OrganizationList, OrganizationProfile, OrganizationSwitcher, PricingTable, Protect, RedirectToCreateOrganization, RedirectToOrganizationProfile, RedirectToSignIn, RedirectToSignUp, RedirectToUserProfile, SignIn, SignInButton, SignInWithMetamaskButton, SignOutButton, SignUp, SignUpButton, SignedIn, SignedOut, UserAvatar, UserButton, UserProfile, Waitlist, setErrorThrowerOptions, useAuth, useClerk, useEmailLink, useOrganization, useOrganizationList, useReverification, useSession, useSessionList, useSignIn, useSignUp, useUser };
|
|
5540
|
-
//# sourceMappingURL=chunk-
|
|
5541
|
-
//# sourceMappingURL=chunk-
|
|
5550
|
+
//# sourceMappingURL=chunk-PXSJ77YP.js.map
|
|
5551
|
+
//# sourceMappingURL=chunk-PXSJ77YP.js.map
|