@clerk/ui 1.0.0-snapshot.v20251217165918 → 1.0.0-snapshot.v20251218165926

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.
Files changed (99) hide show
  1. package/dist/573_ui_17c90e_1.0.0-snapshot.v20251218165926.js +1 -0
  2. package/dist/ClerkUi.js +2 -2
  3. package/dist/common/WalletInitialIcon.js +36 -0
  4. package/dist/common/WalletInitialIcon.js.map +1 -0
  5. package/dist/components/OrganizationProfile/MemberListTable.js +3 -1
  6. package/dist/components/OrganizationProfile/MemberListTable.js.map +1 -1
  7. package/dist/components/SessionTasks/tasks/TaskChooseOrganization/index.js +50 -21
  8. package/dist/components/SessionTasks/tasks/TaskChooseOrganization/index.js.map +1 -1
  9. package/dist/components/SignIn/AlternativeMethods.js +1 -1
  10. package/dist/components/SignIn/SignInFactorOneSolanaWalletsCard.js +79 -0
  11. package/dist/components/SignIn/SignInFactorOneSolanaWalletsCard.js.map +1 -0
  12. package/dist/components/SignIn/SignInSocialButtons.js +2 -1
  13. package/dist/components/SignIn/SignInSocialButtons.js.map +1 -1
  14. package/dist/components/SignIn/index.js +5 -0
  15. package/dist/components/SignIn/index.js.map +1 -1
  16. package/dist/components/SignUp/SignUpSocialButtons.js +2 -1
  17. package/dist/components/SignUp/SignUpSocialButtons.js.map +1 -1
  18. package/dist/components/SignUp/SignUpStartSolanaWalletsCard.js +79 -0
  19. package/dist/components/SignUp/SignUpStartSolanaWalletsCard.js.map +1 -0
  20. package/dist/components/SignUp/index.js +5 -0
  21. package/dist/components/SignUp/index.js.map +1 -1
  22. package/dist/components/UserProfile/Web3Form.js +62 -41
  23. package/dist/components/UserProfile/Web3Form.js.map +1 -1
  24. package/dist/components/UserProfile/Web3Section.js +1 -1
  25. package/dist/components/UserProfile/Web3Section.js.map +1 -1
  26. package/dist/components/UserProfile/Web3SelectSolanaWalletScreen.js +73 -0
  27. package/dist/components/UserProfile/Web3SelectSolanaWalletScreen.js.map +1 -0
  28. package/dist/components/devPrompts/EnableOrganizationsPrompt/index.js +173 -110
  29. package/dist/components/devPrompts/EnableOrganizationsPrompt/index.js.map +1 -1
  30. package/dist/customizables/elementDescriptors.js +10 -1
  31. package/dist/customizables/elementDescriptors.js.map +1 -1
  32. package/dist/elements/Web3SolanaWalletButtons.js +182 -0
  33. package/dist/elements/Web3SolanaWalletButtons.js.map +1 -0
  34. package/dist/elements/contexts/index.js.map +1 -1
  35. package/dist/{enableOrganizationsPrompt_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → enableOrganizationsPrompt_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +108 -22
  36. package/dist/foundations/defaultFoundations.d.ts +153 -153
  37. package/dist/index.js +1 -1
  38. package/dist/internal/appearance.d.ts +9 -0
  39. package/dist/internal/appearance.d.ts.map +1 -1
  40. package/dist/internal/index.js +1 -1
  41. package/dist/lazyModules/components.d.ts +20 -20
  42. package/dist/sessionTasks_ui_17c90e_1.0.0-snapshot.v20251218165926.js +1 -0
  43. package/dist/signin_ui_17c90e_1.0.0-snapshot.v20251218165926.js +1 -0
  44. package/dist/signup_ui_17c90e_1.0.0-snapshot.v20251218165926.js +1 -0
  45. package/dist/taskChooseOrganization_ui_17c90e_1.0.0-snapshot.v20251218165926.js +1 -0
  46. package/dist/taskResetPassword_ui_17c90e_1.0.0-snapshot.v20251218165926.js +1 -0
  47. package/dist/themes/shadcn.js +2 -2
  48. package/dist/themes/shadcn.js.map +1 -1
  49. package/dist/ui-common_ui_17c90e_1.0.0-snapshot.v20251218165926.js +139 -0
  50. package/dist/ui.browser.js +3 -3
  51. package/dist/{userprofile_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → userprofile_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +2 -2
  52. package/dist/utils/web3CallbackErrorHandler.js +1 -1
  53. package/dist/utils/web3CallbackErrorHandler.js.map +1 -1
  54. package/dist/vendors_ui_17c90e_1.0.0-snapshot.v20251218165926.js +20 -0
  55. package/dist/web3-solana-wallet-buttons_ui_17c90e_1.0.0-snapshot.v20251218165926.js +143 -0
  56. package/package.json +10 -4
  57. package/dist/573_ui_7e9f20_1.0.0-snapshot.v20251217165918.js +0 -1
  58. package/dist/sessionTasks_ui_7e9f20_1.0.0-snapshot.v20251217165918.js +0 -1
  59. package/dist/signin_ui_7e9f20_1.0.0-snapshot.v20251217165918.js +0 -1
  60. package/dist/signup_ui_7e9f20_1.0.0-snapshot.v20251217165918.js +0 -1
  61. package/dist/taskChooseOrganization_ui_7e9f20_1.0.0-snapshot.v20251217165918.js +0 -1
  62. package/dist/taskResetPassword_ui_7e9f20_1.0.0-snapshot.v20251217165918.js +0 -1
  63. package/dist/ui-common_ui_7e9f20_1.0.0-snapshot.v20251217165918.js +0 -139
  64. package/dist/vendors_ui_7e9f20_1.0.0-snapshot.v20251217165918.js +0 -20
  65. /package/dist/{207_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → 207_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  66. /package/dist/{217_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → 217_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  67. /package/dist/{360_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → 360_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  68. /package/dist/{444_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → 444_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  69. /package/dist/{970_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → 970_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  70. /package/dist/{apiKeys_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → apiKeys_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  71. /package/dist/{blankcaptcha_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → blankcaptcha_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  72. /package/dist/{checkout_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → checkout_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  73. /package/dist/{copy-api-key-modal_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → copy-api-key-modal_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  74. /package/dist/{createorganization_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → createorganization_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  75. /package/dist/{framework_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → framework_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  76. /package/dist/{impersonationfab_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → impersonationfab_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  77. /package/dist/{keylessPrompt_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → keylessPrompt_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  78. /package/dist/{oauthConsent_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → oauthConsent_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  79. /package/dist/{onetap_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → onetap_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  80. /package/dist/{op-api-keys-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → op-api-keys-page_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  81. /package/dist/{op-billing-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → op-billing-page_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  82. /package/dist/{op-plans-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → op-plans-page_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  83. /package/dist/{organizationlist_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → organizationlist_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  84. /package/dist/{organizationprofile_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → organizationprofile_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  85. /package/dist/{organizationswitcher_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → organizationswitcher_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  86. /package/dist/{payment-attempt-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → payment-attempt-page_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  87. /package/dist/{planDetails_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → planDetails_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  88. /package/dist/{prefetchorganizationlist_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → prefetchorganizationlist_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  89. /package/dist/{pricingTable_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → pricingTable_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  90. /package/dist/{revoke-api-key-modal_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → revoke-api-key-modal_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  91. /package/dist/{statement-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → statement-page_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  92. /package/dist/{subscriptionDetails_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → subscriptionDetails_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  93. /package/dist/{up-api-keys-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → up-api-keys-page_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  94. /package/dist/{up-billing-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → up-billing-page_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  95. /package/dist/{up-plans-page_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → up-plans-page_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  96. /package/dist/{useravatar_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → useravatar_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  97. /package/dist/{userbutton_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → userbutton_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  98. /package/dist/{userverification_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → userverification_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
  99. /package/dist/{waitlist_ui_7e9f20_1.0.0-snapshot.v20251217165918.js → waitlist_ui_17c90e_1.0.0-snapshot.v20251218165926.js} +0 -0
@@ -0,0 +1,182 @@
1
+ import { localizationKeys } from "../localization/localizationKeys.js";
2
+ import { useLocalizations } from "../localization/makeLocalizable.js";
3
+ import { mqu } from "../styledSystem/breakpoints.js";
4
+ import { descriptors } from "../customizables/elementDescriptors.js";
5
+ import { useCardState } from "./contexts/index.js";
6
+ import { Button, Flex, Grid, Icon, Image, SimpleButton, Spinner, Text } from "../customizables/index.js";
7
+ import { Card } from "./Card/index.js";
8
+ import { sleep } from "../utils/sleep.js";
9
+ import { distributeStrategiesIntoRows } from "./utils.js";
10
+ import { LinkRenderer } from "./LinkRenderer.js";
11
+ import { WalletInitialIcon } from "../common/WalletInitialIcon.js";
12
+ import React, { forwardRef, isValidElement, useMemo } from "react";
13
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
14
+ import { WalletReadyState } from "@solana/wallet-adapter-base";
15
+ import { ConnectionProvider, WalletProvider, useWallet } from "@solana/wallet-adapter-react";
16
+ import { MAINNET_ENDPOINT } from "@solana/wallet-standard";
17
+
18
+ //#region src/elements/Web3SolanaWalletButtons.tsx
19
+ const SOCIAL_BUTTON_BLOCK_THRESHOLD = 2;
20
+ const SOCIAL_BUTTON_PRE_TEXT_THRESHOLD = 1;
21
+ const MAX_STRATEGIES_PER_ROW = 5;
22
+ const Web3SolanaWalletButtonsInner = ({ web3AuthCallback }) => {
23
+ const card = useCardState();
24
+ const { wallets } = useWallet();
25
+ const { t } = useLocalizations();
26
+ const installedWallets = React.useMemo(() => wallets.filter((w) => {
27
+ return w.readyState === WalletReadyState.Installed;
28
+ }).map((wallet) => {
29
+ return {
30
+ name: wallet.adapter.name,
31
+ icon: wallet.adapter.icon
32
+ };
33
+ }), [wallets]);
34
+ const startWeb3AuthFlow = (walletName) => async () => {
35
+ card.setLoading(walletName);
36
+ try {
37
+ await web3AuthCallback({ walletName });
38
+ } catch {
39
+ await sleep(1e3);
40
+ } finally {
41
+ card.setIdle();
42
+ }
43
+ };
44
+ const { strategyRows } = distributeStrategiesIntoRows(installedWallets, MAX_STRATEGIES_PER_ROW, void 0);
45
+ const strategyRowOneLength = strategyRows.at(0)?.length ?? 0;
46
+ const shouldForceSingleColumnOnMobile = installedWallets.length === 2;
47
+ const ButtonElement = installedWallets.length <= SOCIAL_BUTTON_BLOCK_THRESHOLD ? WalletButtonBlock : WalletButtonIcon;
48
+ if (installedWallets.length === 0) return /* @__PURE__ */ jsx(Card.Alert, { children: /* @__PURE__ */ jsx(LinkRenderer, {
49
+ text: t(localizationKeys("web3SolanaWalletButtons.noneAvailable", { solanaWalletsLink: "https://solana.com/solana-wallets" })),
50
+ isExternal: true,
51
+ sx: (t$1) => ({
52
+ textDecoration: "underline",
53
+ textUnderlineOffset: t$1.space.$1,
54
+ color: "inherit"
55
+ })
56
+ }) });
57
+ return /* @__PURE__ */ jsx(Flex, {
58
+ direction: "col",
59
+ gap: 2,
60
+ elementDescriptor: descriptors.web3SolanaWalletButtonsRoot,
61
+ children: strategyRows.map((row, rowIndex) => /* @__PURE__ */ jsx(Grid, {
62
+ elementDescriptor: descriptors.web3SolanaWalletButtons,
63
+ gap: 2,
64
+ sx: (t$1) => ({
65
+ justifyContent: "center",
66
+ [mqu.sm]: { gridTemplateColumns: shouldForceSingleColumnOnMobile ? "repeat(1, minmax(0, 1fr))" : void 0 },
67
+ gridTemplateColumns: wallets.length < 1 ? `repeat(1, minmax(0, 1fr))` : `repeat(${row.length}, ${rowIndex === 0 ? `minmax(0, 1fr)` : `minmax(0, calc((100% - (${strategyRowOneLength} - 1) * ${t$1.sizes.$2}) / ${strategyRowOneLength}))`})`
68
+ }),
69
+ children: row.map((w) => {
70
+ const label = installedWallets.length === SOCIAL_BUTTON_PRE_TEXT_THRESHOLD ? localizationKeys("web3SolanaWalletButtons.continue", { walletName: w.name }) : w.name;
71
+ const imageOrInitial = w.icon ? /* @__PURE__ */ jsx(Image, {
72
+ elementDescriptor: [descriptors.walletIcon, descriptors.web3SolanaWalletButtonsWalletInitialIcon],
73
+ isDisabled: card.isLoading,
74
+ isLoading: card.loadingMetadata === w.name,
75
+ src: w.icon,
76
+ alt: t(localizationKeys("web3SolanaWalletButtons.connect", { walletName: w.name })),
77
+ sx: (theme) => ({
78
+ width: theme.sizes.$4,
79
+ height: "auto",
80
+ maxWidth: "100%"
81
+ })
82
+ }) : /* @__PURE__ */ jsx(WalletInitialIcon, {
83
+ value: w.name,
84
+ isDisabled: card.isLoading,
85
+ id: w.name
86
+ });
87
+ return /* @__PURE__ */ jsx(ButtonElement, {
88
+ id: w.name,
89
+ onClick: startWeb3AuthFlow(w.name),
90
+ isLoading: card.loadingMetadata === w.name,
91
+ isDisabled: card.isLoading,
92
+ label: t(label),
93
+ icon: imageOrInitial
94
+ }, w.name);
95
+ })
96
+ }, row.map((r) => {
97
+ return r.name;
98
+ }).join("-")))
99
+ });
100
+ };
101
+ const WalletButtonIcon = forwardRef((props, ref) => {
102
+ const { icon, label, id,...rest } = props;
103
+ return /* @__PURE__ */ jsx(Button, {
104
+ ref,
105
+ "aria-label": label,
106
+ textVariant: "buttonLarge",
107
+ variant: "outline",
108
+ colorScheme: "neutral",
109
+ hoverAsFocus: true,
110
+ sx: (t) => ({
111
+ minHeight: t.sizes.$8,
112
+ width: "100%"
113
+ }),
114
+ ...rest,
115
+ children: icon
116
+ });
117
+ });
118
+ const WalletButtonBlock = forwardRef((props, ref) => {
119
+ const { id, icon, isLoading, label,...rest } = props;
120
+ const isIconElement = isValidElement(icon);
121
+ return /* @__PURE__ */ jsx(SimpleButton, {
122
+ variant: "outline",
123
+ block: true,
124
+ isLoading,
125
+ hoverAsFocus: true,
126
+ ref,
127
+ ...rest,
128
+ sx: (theme) => [{
129
+ gap: theme.space.$4,
130
+ position: "relative",
131
+ justifyContent: "flex-start"
132
+ }, props.sx],
133
+ children: /* @__PURE__ */ jsxs(Flex, {
134
+ justify: "center",
135
+ align: "center",
136
+ as: "span",
137
+ gap: 3,
138
+ sx: {
139
+ width: "100%",
140
+ overflow: "hidden"
141
+ },
142
+ children: [(isLoading || icon) && /* @__PURE__ */ jsx(Flex, {
143
+ as: "span",
144
+ center: true,
145
+ sx: (theme) => ({ flex: `0 0 ${theme.space.$4}` }),
146
+ children: isLoading ? /* @__PURE__ */ jsx(Spinner, {
147
+ size: "sm",
148
+ elementDescriptor: descriptors.spinner
149
+ }) : !isIconElement && icon ? /* @__PURE__ */ jsx(Icon, {
150
+ icon,
151
+ sx: [(theme) => ({
152
+ color: theme.colors.$neutralAlpha600,
153
+ width: theme.sizes.$4,
154
+ position: "absolute"
155
+ })]
156
+ }) : icon
157
+ }), /* @__PURE__ */ jsx(Text, {
158
+ as: "span",
159
+ truncate: true,
160
+ variant: "buttonLarge",
161
+ children: label
162
+ })]
163
+ })
164
+ });
165
+ });
166
+ const Web3SolanaWalletButtons = (props) => {
167
+ const network = MAINNET_ENDPOINT;
168
+ return /* @__PURE__ */ jsx(ConnectionProvider, {
169
+ endpoint: network,
170
+ children: /* @__PURE__ */ jsx(WalletProvider, {
171
+ wallets: useMemo(() => [], [network]),
172
+ onError: (err) => {
173
+ console.error(err);
174
+ },
175
+ children: /* @__PURE__ */ jsx(Web3SolanaWalletButtonsInner, { web3AuthCallback: props.web3AuthCallback })
176
+ })
177
+ });
178
+ };
179
+
180
+ //#endregion
181
+ export { Web3SolanaWalletButtons };
182
+ //# sourceMappingURL=Web3SolanaWalletButtons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Web3SolanaWalletButtons.js","names":["t"],"sources":["../../src/elements/Web3SolanaWalletButtons.tsx"],"sourcesContent":["import { WalletReadyState } from '@solana/wallet-adapter-base';\nimport { ConnectionProvider, useWallet, WalletProvider } from '@solana/wallet-adapter-react';\nimport { MAINNET_ENDPOINT } from '@solana/wallet-standard';\nimport type { Ref } from 'react';\nimport React, { forwardRef, isValidElement, useMemo } from 'react';\n\nimport { WalletInitialIcon } from '@/ui/common/WalletInitialIcon';\nimport {\n Button,\n descriptors,\n Flex,\n Grid,\n Icon,\n Image,\n localizationKeys,\n SimpleButton,\n Spinner,\n Text,\n useLocalizations,\n} from '@/ui/customizables';\nimport { Card } from '@/ui/elements/Card';\nimport { useCardState } from '@/ui/elements/contexts';\nimport { LinkRenderer } from '@/ui/elements/LinkRenderer';\nimport { distributeStrategiesIntoRows } from '@/ui/elements/utils';\nimport { mqu, type PropsOfComponent } from '@/ui/styledSystem';\nimport { sleep } from '@/ui/utils/sleep';\n\ntype Web3WalletButtonsProps = {\n web3AuthCallback: ({ walletName }: { walletName: string }) => Promise<unknown>;\n};\n\nconst SOCIAL_BUTTON_BLOCK_THRESHOLD = 2;\nconst SOCIAL_BUTTON_PRE_TEXT_THRESHOLD = 1;\nconst MAX_STRATEGIES_PER_ROW = 5;\n\nconst Web3SolanaWalletButtonsInner = ({ web3AuthCallback }: Web3WalletButtonsProps) => {\n const card = useCardState();\n const { wallets } = useWallet();\n const { t } = useLocalizations();\n\n // Filter to only show installed wallets\n const installedWallets = React.useMemo(\n () =>\n wallets\n .filter(w => {\n return w.readyState === WalletReadyState.Installed;\n })\n .map(wallet => {\n return {\n name: wallet.adapter.name,\n icon: wallet.adapter.icon,\n };\n }),\n [wallets],\n );\n\n const startWeb3AuthFlow = (walletName: string) => async () => {\n card.setLoading(walletName);\n try {\n await web3AuthCallback({ walletName });\n } catch {\n await sleep(1000);\n } finally {\n card.setIdle();\n }\n };\n\n const { strategyRows } = distributeStrategiesIntoRows(installedWallets, MAX_STRATEGIES_PER_ROW, undefined);\n const strategyRowOneLength = strategyRows.at(0)?.length ?? 0;\n const shouldForceSingleColumnOnMobile = installedWallets.length === 2;\n const ButtonElement = installedWallets.length <= SOCIAL_BUTTON_BLOCK_THRESHOLD ? WalletButtonBlock : WalletButtonIcon;\n\n if (installedWallets.length === 0) {\n return (\n <Card.Alert>\n <LinkRenderer\n text={t(\n localizationKeys('web3SolanaWalletButtons.noneAvailable', {\n solanaWalletsLink: 'https://solana.com/solana-wallets',\n }),\n )}\n isExternal\n sx={t => ({\n textDecoration: 'underline',\n textUnderlineOffset: t.space.$1,\n color: 'inherit',\n })}\n />\n </Card.Alert>\n );\n }\n\n return (\n <Flex\n direction='col'\n gap={2}\n elementDescriptor={descriptors.web3SolanaWalletButtonsRoot}\n >\n {strategyRows.map((row, rowIndex) => (\n <Grid\n key={row\n .map(r => {\n return r.name;\n })\n .join('-')}\n elementDescriptor={descriptors.web3SolanaWalletButtons}\n gap={2}\n sx={t => ({\n justifyContent: 'center',\n [mqu.sm]: {\n // Force single-column on mobile when 2 strategies are present (without last auth) to prevent\n // label overflow. When last auth is present, only 1 strategy remains here, so overflow isn't a concern.\n gridTemplateColumns: shouldForceSingleColumnOnMobile ? 'repeat(1, minmax(0, 1fr))' : undefined,\n },\n gridTemplateColumns:\n wallets.length < 1\n ? `repeat(1, minmax(0, 1fr))`\n : `repeat(${row.length}, ${\n rowIndex === 0\n ? `minmax(0, 1fr)`\n : // Calculate the width of each button based on the width of the buttons within the first row.\n // t.sizes.$2 is used here to represent the gap defined on the Grid component.\n `minmax(0, calc((100% - (${strategyRowOneLength} - 1) * ${t.sizes.$2}) / ${strategyRowOneLength}))`\n })`,\n })}\n >\n {row.map(w => {\n const shouldShowPreText = installedWallets.length === SOCIAL_BUTTON_PRE_TEXT_THRESHOLD;\n const label = shouldShowPreText\n ? localizationKeys('web3SolanaWalletButtons.continue', { walletName: w.name })\n : w.name;\n\n const imageOrInitial = w.icon ? (\n <Image\n elementDescriptor={[descriptors.walletIcon, descriptors.web3SolanaWalletButtonsWalletInitialIcon]}\n isDisabled={card.isLoading}\n isLoading={card.loadingMetadata === w.name}\n src={w.icon}\n alt={t(localizationKeys('web3SolanaWalletButtons.connect', { walletName: w.name }))}\n sx={theme => ({ width: theme.sizes.$4, height: 'auto', maxWidth: '100%' })}\n />\n ) : (\n <WalletInitialIcon\n value={w.name}\n isDisabled={card.isLoading}\n id={w.name}\n />\n );\n\n return (\n <ButtonElement\n key={w.name}\n id={w.name}\n onClick={startWeb3AuthFlow(w.name)}\n isLoading={card.loadingMetadata === w.name}\n isDisabled={card.isLoading}\n label={t(label)}\n icon={imageOrInitial}\n />\n );\n })}\n </Grid>\n ))}\n </Flex>\n );\n};\n\ntype WalletButtonProps = PropsOfComponent<typeof Button> & {\n icon: React.ReactElement;\n id: string;\n label: string;\n};\n\nconst WalletButtonIcon = forwardRef((props: WalletButtonProps, ref: Ref<HTMLButtonElement> | null): JSX.Element => {\n const { icon, label, id, ...rest } = props;\n\n return (\n <Button\n ref={ref}\n aria-label={label}\n textVariant='buttonLarge'\n variant='outline'\n colorScheme='neutral'\n hoverAsFocus\n sx={t => ({\n minHeight: t.sizes.$8,\n width: '100%',\n })}\n {...rest}\n >\n {icon}\n </Button>\n );\n});\n\nconst WalletButtonBlock = forwardRef((props: WalletButtonProps, ref: Ref<HTMLButtonElement> | null): JSX.Element => {\n const { id, icon, isLoading, label, ...rest } = props;\n const isIconElement = isValidElement(icon);\n\n return (\n <SimpleButton\n variant='outline'\n block\n isLoading={isLoading}\n hoverAsFocus\n ref={ref}\n {...rest}\n sx={theme => [\n {\n gap: theme.space.$4,\n position: 'relative',\n justifyContent: 'flex-start',\n },\n props.sx,\n ]}\n >\n <Flex\n justify='center'\n align='center'\n as='span'\n gap={3}\n sx={{\n width: '100%',\n overflow: 'hidden',\n }}\n >\n {(isLoading || icon) && (\n <Flex\n as='span'\n center\n sx={theme => ({ flex: `0 0 ${theme.space.$4}` })}\n >\n {isLoading ? (\n <Spinner\n size='sm'\n elementDescriptor={descriptors.spinner}\n />\n ) : !isIconElement && icon ? (\n <Icon\n icon={icon as unknown as React.ComponentType}\n sx={[\n theme => ({\n color: theme.colors.$neutralAlpha600,\n width: theme.sizes.$4,\n position: 'absolute',\n }),\n ]}\n />\n ) : (\n icon\n )}\n </Flex>\n )}\n <Text\n as='span'\n truncate\n variant='buttonLarge'\n >\n {label}\n </Text>\n </Flex>\n </SimpleButton>\n );\n});\n\nexport const Web3SolanaWalletButtons = (props: Web3WalletButtonsProps) => {\n const network = MAINNET_ENDPOINT;\n const wallets = useMemo(() => [], [network]);\n return (\n <ConnectionProvider endpoint={network}>\n <WalletProvider\n wallets={wallets}\n onError={err => {\n console.error(err);\n }}\n >\n <Web3SolanaWalletButtonsInner web3AuthCallback={props.web3AuthCallback} />\n </WalletProvider>\n </ConnectionProvider>\n );\n};\n"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/elements/contexts/index.tsx"],"sourcesContent":["import { createContextAndHook } from '@clerk/shared/react';\nimport type { ClerkAPIError, ClerkRuntimeError } from '@clerk/shared/types';\nimport { FloatingTree, useFloatingParentNodeId } from '@floating-ui/react';\nimport React from 'react';\n\nimport { useRouter } from '@/ui/router';\n\nimport { useLocalizations } from '../../customizables';\n\ntype Status = 'idle' | 'loading' | 'error';\ntype Metadata = string | undefined;\ntype State = { status: Status; metadata: Metadata; error: string | undefined };\ntype CardStateCtxValue = {\n state: State;\n setState: React.Dispatch<React.SetStateAction<State>>;\n};\n\nconst [CardStateCtx, _useCardState] = createContextAndHook<CardStateCtxValue>('CardState');\n\nexport const CardStateProvider = (props: React.PropsWithChildren<any>) => {\n const { translateError } = useLocalizations();\n const router = useRouter();\n\n const [state, setState] = React.useState<State>(() => ({\n status: 'idle',\n metadata: undefined,\n error: translateError(window?.Clerk?.__internal_last_error || undefined),\n }));\n\n React.useEffect(() => {\n const error = window?.Clerk?.__internal_last_error;\n\n if (error) {\n setState(s => ({ ...s, error: translateError(error) }));\n }\n }, [translateError, setState, router.currentPath]);\n\n const value = React.useMemo(() => ({ value: { state, setState } }), [state, setState]);\n return <CardStateCtx.Provider value={value}>{props.children}</CardStateCtx.Provider>;\n};\n\nexport const useCardState = () => {\n const { state, setState } = _useCardState();\n const { translateError } = useLocalizations();\n\n const setIdle = (metadata?: Metadata) => setState(s => ({ ...s, status: 'idle', metadata }));\n const setError = (metadata: ClerkRuntimeError | ClerkAPIError | Metadata | string) =>\n setState(s => ({ ...s, error: translateError(metadata) }));\n const setLoading = (metadata?: Metadata) => setState(s => ({ ...s, status: 'loading', metadata }));\n const runAsync = async <T = unknown,>(cb: Promise<T> | (() => Promise<T>), metadata?: Metadata) => {\n setLoading(metadata);\n return (typeof cb === 'function' ? cb() : cb)\n .then(res => {\n return res;\n })\n .finally(() => setIdle(metadata));\n };\n\n return {\n setIdle,\n setError,\n setLoading,\n runAsync,\n loadingMetadata: state.status === 'loading' ? state.metadata : undefined,\n error: state.error ? state.error : undefined,\n isLoading: state.status === 'loading',\n isIdle: state.status === 'idle',\n state,\n };\n};\n\nexport const withCardStateProvider = <T,>(Component: React.ComponentType<T>) => {\n return (props: T) => {\n return (\n <CardStateProvider>\n {/* @ts-expect-error */}\n <Component {...props} />\n </CardStateProvider>\n );\n };\n};\n\nexport type FlowMetadata = {\n flow:\n | 'signIn'\n | 'signUp'\n | 'userButton'\n | 'userProfile'\n | 'userVerification'\n | 'organizationProfile'\n | 'createOrganization'\n | 'organizationSwitcher'\n | 'organizationList'\n | 'oneTap'\n | 'blankCaptcha'\n | 'waitlist'\n | 'checkout'\n | 'planDetails'\n | 'pricingTable'\n | 'apiKeys'\n | 'oauthConsent'\n | 'subscriptionDetails'\n | 'tasks'\n | 'taskChooseOrganization'\n | 'enableOrganizations'\n | 'taskResetPassword';\n part?:\n | 'start'\n | 'emailCode'\n | 'emailCode2Fa'\n | 'phoneCode'\n | 'phoneCode2Fa'\n | 'totp2Fa'\n | 'backupCode2Fa'\n | 'password'\n | 'resetPassword'\n | 'emailLink'\n | 'emailLinkVerify'\n | 'emailLinkStatus'\n | 'alternativeMethods'\n | 'forgotPasswordMethods'\n | 'passwordPwnedMethods'\n | 'passwordCompromisedMethods'\n | 'havingTrouble'\n | 'ssoCallback'\n | 'popupCallback'\n | 'popover'\n | 'complete'\n | 'accountSwitcher'\n | 'chooseOrganization'\n | 'enterpriseConnections';\n};\n\nconst [FlowMetadataCtx, useFlowMetadata] = createContextAndHook<FlowMetadata>('FlowMetadata');\n\nexport const FlowMetadataProvider = (props: React.PropsWithChildren<FlowMetadata>) => {\n const { flow, part } = props;\n const value = React.useMemo(() => ({ value: props }), [flow, part]);\n return <FlowMetadataCtx.Provider value={value}>{props.children}</FlowMetadataCtx.Provider>;\n};\n\nexport const withFloatingTree = <T,>(Component: React.ComponentType<T>): React.ComponentType<T> => {\n return (props: T) => {\n const parentId = useFloatingParentNodeId();\n if (parentId == null) {\n return (\n <FloatingTree>\n {/* @ts-expect-error */}\n <Component {...props} />\n </FloatingTree>\n );\n }\n\n /* @ts-expect-error */\n return <Component {...props} />;\n };\n};\n\nexport { useFlowMetadata };\n"],"mappings":";;;;;;;;AAiBA,MAAM,CAAC,cAAc,iBAAiB,qBAAwC,YAAY;AAE1F,MAAa,qBAAqB,UAAwC;CACxE,MAAM,EAAE,mBAAmB,kBAAkB;CAC7C,MAAM,SAAS,WAAW;CAE1B,MAAM,CAAC,OAAO,YAAY,MAAM,gBAAuB;EACrD,QAAQ;EACR,UAAU;EACV,OAAO,eAAe,QAAQ,OAAO,yBAAyB,OAAU;EACzE,EAAE;AAEH,OAAM,gBAAgB;EACpB,MAAM,QAAQ,QAAQ,OAAO;AAE7B,MAAI,MACF,WAAS,OAAM;GAAE,GAAG;GAAG,OAAO,eAAe,MAAM;GAAE,EAAE;IAExD;EAAC;EAAgB;EAAU,OAAO;EAAY,CAAC;CAElD,MAAM,QAAQ,MAAM,eAAe,EAAE,OAAO;EAAE;EAAO;EAAU,EAAE,GAAG,CAAC,OAAO,SAAS,CAAC;AACtF,QAAO,oBAAC,aAAa;EAAgB;YAAQ,MAAM;GAAiC;;AAGtF,MAAa,qBAAqB;CAChC,MAAM,EAAE,OAAO,aAAa,eAAe;CAC3C,MAAM,EAAE,mBAAmB,kBAAkB;CAE7C,MAAM,WAAW,aAAwB,UAAS,OAAM;EAAE,GAAG;EAAG,QAAQ;EAAQ;EAAU,EAAE;CAC5F,MAAM,YAAY,aAChB,UAAS,OAAM;EAAE,GAAG;EAAG,OAAO,eAAe,SAAS;EAAE,EAAE;CAC5D,MAAM,cAAc,aAAwB,UAAS,OAAM;EAAE,GAAG;EAAG,QAAQ;EAAW;EAAU,EAAE;CAClG,MAAM,WAAW,OAAqB,IAAqC,aAAwB;AACjG,aAAW,SAAS;AACpB,UAAQ,OAAO,OAAO,aAAa,IAAI,GAAG,IACvC,MAAK,QAAO;AACX,UAAO;IACP,CACD,cAAc,QAAQ,SAAS,CAAC;;AAGrC,QAAO;EACL;EACA;EACA;EACA;EACA,iBAAiB,MAAM,WAAW,YAAY,MAAM,WAAW;EAC/D,OAAO,MAAM,QAAQ,MAAM,QAAQ;EACnC,WAAW,MAAM,WAAW;EAC5B,QAAQ,MAAM,WAAW;EACzB;EACD;;AAGH,MAAa,yBAA6B,cAAsC;AAC9E,SAAQ,UAAa;AACnB,SACE,oBAAC,+BAEC,oBAAC,aAAU,GAAI,QAAS,GACN;;;AAwD1B,MAAM,CAAC,iBAAiB,mBAAmB,qBAAmC,eAAe;AAE7F,MAAa,wBAAwB,UAAiD;CACpF,MAAM,EAAE,MAAM,SAAS;CACvB,MAAM,QAAQ,MAAM,eAAe,EAAE,OAAO,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC;AACnE,QAAO,oBAAC,gBAAgB;EAAgB;YAAQ,MAAM;GAAoC;;AAG5F,MAAa,oBAAwB,cAA8D;AACjG,SAAQ,UAAa;AAEnB,MADiB,yBAAyB,IAC1B,KACd,QACE,oBAAC,0BAEC,oBAAC,aAAU,GAAI,QAAS,GACX;AAKnB,SAAO,oBAAC,aAAU,GAAI,QAAS"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/elements/contexts/index.tsx"],"sourcesContent":["import { createContextAndHook } from '@clerk/shared/react';\nimport type { ClerkAPIError, ClerkRuntimeError } from '@clerk/shared/types';\nimport { FloatingTree, useFloatingParentNodeId } from '@floating-ui/react';\nimport React from 'react';\n\nimport { useRouter } from '@/ui/router';\n\nimport { useLocalizations } from '../../customizables';\n\ntype Status = 'idle' | 'loading' | 'error';\ntype Metadata = string | undefined;\ntype State = { status: Status; metadata: Metadata; error: string | undefined };\ntype CardStateCtxValue = {\n state: State;\n setState: React.Dispatch<React.SetStateAction<State>>;\n};\n\nconst [CardStateCtx, _useCardState] = createContextAndHook<CardStateCtxValue>('CardState');\n\nexport const CardStateProvider = (props: React.PropsWithChildren<any>) => {\n const { translateError } = useLocalizations();\n const router = useRouter();\n\n const [state, setState] = React.useState<State>(() => ({\n status: 'idle',\n metadata: undefined,\n error: translateError(window?.Clerk?.__internal_last_error || undefined),\n }));\n\n React.useEffect(() => {\n const error = window?.Clerk?.__internal_last_error;\n\n if (error) {\n setState(s => ({ ...s, error: translateError(error) }));\n }\n }, [translateError, setState, router.currentPath]);\n\n const value = React.useMemo(() => ({ value: { state, setState } }), [state, setState]);\n return <CardStateCtx.Provider value={value}>{props.children}</CardStateCtx.Provider>;\n};\n\nexport const useCardState = () => {\n const { state, setState } = _useCardState();\n const { translateError } = useLocalizations();\n\n const setIdle = (metadata?: Metadata) => setState(s => ({ ...s, status: 'idle', metadata }));\n const setError = (metadata: ClerkRuntimeError | ClerkAPIError | Metadata | string) =>\n setState(s => ({ ...s, error: translateError(metadata) }));\n const setLoading = (metadata?: Metadata) => setState(s => ({ ...s, status: 'loading', metadata }));\n const runAsync = async <T = unknown,>(cb: Promise<T> | (() => Promise<T>), metadata?: Metadata) => {\n setLoading(metadata);\n return (typeof cb === 'function' ? cb() : cb)\n .then(res => {\n return res;\n })\n .finally(() => setIdle(metadata));\n };\n\n return {\n setIdle,\n setError,\n setLoading,\n runAsync,\n loadingMetadata: state.status === 'loading' ? state.metadata : undefined,\n error: state.error ? state.error : undefined,\n isLoading: state.status === 'loading',\n isIdle: state.status === 'idle',\n state,\n };\n};\n\nexport const withCardStateProvider = <T,>(Component: React.ComponentType<T>) => {\n return (props: T) => {\n return (\n <CardStateProvider>\n {/* @ts-expect-error */}\n <Component {...props} />\n </CardStateProvider>\n );\n };\n};\n\nexport type FlowMetadata = {\n flow:\n | 'signIn'\n | 'signUp'\n | 'userButton'\n | 'userProfile'\n | 'userVerification'\n | 'organizationProfile'\n | 'createOrganization'\n | 'organizationSwitcher'\n | 'organizationList'\n | 'oneTap'\n | 'blankCaptcha'\n | 'waitlist'\n | 'checkout'\n | 'planDetails'\n | 'pricingTable'\n | 'apiKeys'\n | 'oauthConsent'\n | 'subscriptionDetails'\n | 'tasks'\n | 'taskChooseOrganization'\n | 'enableOrganizations'\n | 'taskResetPassword';\n part?:\n | 'start'\n | 'emailCode'\n | 'emailCode2Fa'\n | 'phoneCode'\n | 'phoneCode2Fa'\n | 'totp2Fa'\n | 'backupCode2Fa'\n | 'password'\n | 'resetPassword'\n | 'emailLink'\n | 'emailLinkVerify'\n | 'emailLinkStatus'\n | 'alternativeMethods'\n | 'forgotPasswordMethods'\n | 'passwordPwnedMethods'\n | 'passwordCompromisedMethods'\n | 'havingTrouble'\n | 'ssoCallback'\n | 'popupCallback'\n | 'popover'\n | 'complete'\n | 'accountSwitcher'\n | 'chooseOrganization'\n | 'chooseWallet'\n | 'enterpriseConnections'\n | 'organizationCreationDisabled';\n};\n\nconst [FlowMetadataCtx, useFlowMetadata] = createContextAndHook<FlowMetadata>('FlowMetadata');\n\nexport const FlowMetadataProvider = (props: React.PropsWithChildren<FlowMetadata>) => {\n const { flow, part } = props;\n const value = React.useMemo(() => ({ value: props }), [flow, part]);\n return <FlowMetadataCtx.Provider value={value}>{props.children}</FlowMetadataCtx.Provider>;\n};\n\nexport const withFloatingTree = <T,>(Component: React.ComponentType<T>): React.ComponentType<T> => {\n return (props: T) => {\n const parentId = useFloatingParentNodeId();\n if (parentId == null) {\n return (\n <FloatingTree>\n {/* @ts-expect-error */}\n <Component {...props} />\n </FloatingTree>\n );\n }\n\n /* @ts-expect-error */\n return <Component {...props} />;\n };\n};\n\nexport { useFlowMetadata };\n"],"mappings":";;;;;;;;AAiBA,MAAM,CAAC,cAAc,iBAAiB,qBAAwC,YAAY;AAE1F,MAAa,qBAAqB,UAAwC;CACxE,MAAM,EAAE,mBAAmB,kBAAkB;CAC7C,MAAM,SAAS,WAAW;CAE1B,MAAM,CAAC,OAAO,YAAY,MAAM,gBAAuB;EACrD,QAAQ;EACR,UAAU;EACV,OAAO,eAAe,QAAQ,OAAO,yBAAyB,OAAU;EACzE,EAAE;AAEH,OAAM,gBAAgB;EACpB,MAAM,QAAQ,QAAQ,OAAO;AAE7B,MAAI,MACF,WAAS,OAAM;GAAE,GAAG;GAAG,OAAO,eAAe,MAAM;GAAE,EAAE;IAExD;EAAC;EAAgB;EAAU,OAAO;EAAY,CAAC;CAElD,MAAM,QAAQ,MAAM,eAAe,EAAE,OAAO;EAAE;EAAO;EAAU,EAAE,GAAG,CAAC,OAAO,SAAS,CAAC;AACtF,QAAO,oBAAC,aAAa;EAAgB;YAAQ,MAAM;GAAiC;;AAGtF,MAAa,qBAAqB;CAChC,MAAM,EAAE,OAAO,aAAa,eAAe;CAC3C,MAAM,EAAE,mBAAmB,kBAAkB;CAE7C,MAAM,WAAW,aAAwB,UAAS,OAAM;EAAE,GAAG;EAAG,QAAQ;EAAQ;EAAU,EAAE;CAC5F,MAAM,YAAY,aAChB,UAAS,OAAM;EAAE,GAAG;EAAG,OAAO,eAAe,SAAS;EAAE,EAAE;CAC5D,MAAM,cAAc,aAAwB,UAAS,OAAM;EAAE,GAAG;EAAG,QAAQ;EAAW;EAAU,EAAE;CAClG,MAAM,WAAW,OAAqB,IAAqC,aAAwB;AACjG,aAAW,SAAS;AACpB,UAAQ,OAAO,OAAO,aAAa,IAAI,GAAG,IACvC,MAAK,QAAO;AACX,UAAO;IACP,CACD,cAAc,QAAQ,SAAS,CAAC;;AAGrC,QAAO;EACL;EACA;EACA;EACA;EACA,iBAAiB,MAAM,WAAW,YAAY,MAAM,WAAW;EAC/D,OAAO,MAAM,QAAQ,MAAM,QAAQ;EACnC,WAAW,MAAM,WAAW;EAC5B,QAAQ,MAAM,WAAW;EACzB;EACD;;AAGH,MAAa,yBAA6B,cAAsC;AAC9E,SAAQ,UAAa;AACnB,SACE,oBAAC,+BAEC,oBAAC,aAAU,GAAI,QAAS,GACN;;;AA0D1B,MAAM,CAAC,iBAAiB,mBAAmB,qBAAmC,eAAe;AAE7F,MAAa,wBAAwB,UAAiD;CACpF,MAAM,EAAE,MAAM,SAAS;CACvB,MAAM,QAAQ,MAAM,eAAe,EAAE,OAAO,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC;AACnE,QAAO,oBAAC,gBAAgB;EAAgB;YAAQ,MAAM;GAAoC;;AAG5F,MAAa,oBAAwB,cAA8D;AACjG,SAAQ,UAAa;AAEnB,MADiB,yBAAyB,IAC1B,KACd,QACE,oBAAC,0BAEC,oBAAC,aAAU,GAAI,QAAS,GACX;AAKnB,SAAO,oBAAC,aAAU,GAAI,QAAS"}
@@ -1,32 +1,32 @@
1
- "use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["533"],{7334:function(e,i,n){n.r(i),n.d(i,{EnableOrganizationsPrompt:()=>f});var r=n(4518),t=n(1210),o=n(8802),a=n(5074),s=n(7697),l=n(6705),d=n(9406),c=n(1464),p=n(8272),h=n(1986),g=n(8307);let u=({caller:e,onSuccess:i,onClose:n})=>{let d=(0,t.ho)(),[c,u]=(0,a.useState)(!1),[f,b]=(0,a.useState)(!1),[x,v]=(0,a.useState)(!1),k=(0,a.useRef)(null),y=(0,s.O)(),z=!e.startsWith("use"),$=void 0!==y?.organizationSettings.forceOrganizationSelection;return(0,r.Y)(h.Z,{children:(0,r.Y)(l.Modal,{canCloseModal:!1,containerSx:()=>({alignItems:"center"}),initialFocusRef:k,children:(0,r.FD)(g.Uw,{sx:()=>({display:"flex",flexDirection:"column",width:"30rem",maxWidth:"calc(100vw - 2rem)"}),children:[(0,r.FD)(p.so,{direction:"col",sx:e=>({padding:`${e.sizes.$4} ${e.sizes.$6}`,paddingBottom:e.sizes.$4,gap:e.sizes.$2}),children:[(0,r.FD)(p.so,{as:"header",align:"center",sx:e=>({gap:e.sizes.$2}),children:[(0,r.Y)(Y,{isEnabled:f}),(0,r.Y)("h1",{css:[g.mk,(0,o.AH)`
1
+ "use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["533"],{7334:function(e,i,r){r.r(i),r.d(i,{EnableOrganizationsPrompt:()=>u});var n=r(4518),t=r(1210),o=r(8802),a=r(5074),s=r(7697),l=r(6705),d=r(9406),c=r(8272),p=r(1986),h=r(8307);let g=({caller:e,onSuccess:i,onClose:r})=>{let d=(0,t.ho)(),[g,u]=(0,a.useState)(!1),[f,b]=(0,a.useState)(!1),[w,C]=(0,a.useState)(!1),k=(0,a.useRef)(null),Y=(0,s.O)(),$=(0,a.useId)(),_=!e.startsWith("use"),A=void 0!==Y?.organizationSettings.forceOrganizationSelection;return(0,n.Y)(p.Z,{children:(0,n.Y)(l.Modal,{canCloseModal:!1,containerSx:()=>({alignItems:"center"}),initialFocusRef:k,children:(0,n.FD)(h.Uw,{sx:()=>({display:"flex",flexDirection:"column",width:"30rem",maxWidth:"calc(100vw - 2rem)"}),children:[(0,n.FD)(c.so,{direction:"col",sx:e=>({padding:`${e.sizes.$4} ${e.sizes.$6}`,paddingBottom:e.sizes.$4,gap:e.sizes.$2}),children:[(0,n.FD)(c.so,{as:"header",align:"center",sx:e=>({gap:e.sizes.$2}),children:[(0,n.Y)(F,{isEnabled:f}),(0,n.Y)("h1",{css:[h.mk,(0,o.AH)`
2
2
  color: white;
3
3
  font-size: 0.875rem;
4
4
  font-weight: 500;
5
5
  outline: none;
6
- `],tabIndex:-1,ref:k,children:f?"Organizations feature enabled":"Organizations feature required"})]}),(0,r.Y)(p.so,{direction:"col",align:"start",sx:e=>({gap:e.sizes.$0x5}),children:f?(0,r.FD)("p",{css:[g.mk,(0,o.AH)`
6
+ `],tabIndex:-1,ref:k,children:f?"Organizations feature enabled":"Organizations feature required"})]}),(0,n.Y)(c.so,{direction:"col",align:"start",sx:e=>({gap:e.sizes.$0x5}),children:f?(0,n.FD)("p",{css:[h.mk,(0,o.AH)`
7
7
  color: #b4b4b4;
8
8
  font-size: 0.8125rem;
9
9
  font-weight: 400;
10
10
  line-height: 1.3;
11
- `],children:[d.user?'The Organizations feature has been enabled for your application. A default organization named "My Organization" was created automatically. You can manage or rename it in your':"The Organizations feature has been enabled for your application. You can manage it in your"," ",(0,r.Y)(w,{href:"https://dashboard.clerk.com/~/organizations-settings",target:"_blank",rel:"noopener noreferrer",children:"dashboard"}),"."]}):(0,r.FD)(r.FK,{children:[(0,r.FD)("p",{css:[g.mk,(0,o.AH)`
11
+ `],children:[d.user?'The Organizations feature has been enabled for your application. A default organization named "My Organization" was created automatically. You can manage or rename it in your':"The Organizations feature has been enabled for your application. You can manage it in your"," ",(0,n.Y)(z,{href:"https://dashboard.clerk.com/~/organizations-settings",target:"_blank",rel:"noopener noreferrer",children:"dashboard"}),"."]}):(0,n.FD)(n.FK,{children:[(0,n.FD)("p",{id:$,css:[h.mk,(0,o.AH)`
12
12
  color: #b4b4b4;
13
13
  font-size: 0.8125rem;
14
14
  font-weight: 400;
15
15
  line-height: 1.23;
16
- `],children:["Enable Organizations to use"," ",(0,r.Y)("code",{css:[g.mk,(0,o.AH)`
16
+ `],children:["Enable Organizations to use"," ",(0,n.Y)("code",{css:[h.mk,(0,o.AH)`
17
17
  font-size: 0.75rem;
18
18
  color: white;
19
19
  font-family: monospace;
20
20
  line-height: 1.23;
21
- `],children:z?`<${e} />`:e})," "]}),(0,r.Y)(w,{href:"https://clerk.com/docs/guides/organizations/overview",target:"_blank",rel:"noopener noreferrer",children:"Learn more"})]})}),$&&(0,r.Y)(p.az,{sx:e=>({display:"grid",gridTemplateRows:f?"0fr":"1fr",transition:`grid-template-rows ${e.transitionDuration.$slower} ${e.transitionTiming.$slowBezier}`,marginInline:"-0.5rem",overflow:"hidden"}),...f&&{inert:""},children:(0,r.Y)(p.so,{sx:e=>({minHeight:0,paddingInline:"0.5rem",opacity:+!f,transition:`opacity ${e.transitionDuration.$slower} ${e.transitionTiming.$slowBezier}`}),children:(0,r.Y)(p.so,{sx:e=>({marginTop:e.sizes.$2}),children:(0,r.Y)(C,{label:"Allow personal account",description:"Allow users to work outside of an organization by providing a personal account. We do not recommend for B2B SaaS apps.",checked:x,onChange:()=>v(e=>!e)})})})})]}),(0,r.Y)("span",{css:(0,o.AH)`
21
+ `],children:_?`<${e} />`:e})," "]}),(0,n.Y)(z,{href:"https://clerk.com/docs/guides/organizations/overview",target:"_blank",rel:"noopener noreferrer",children:"Learn more"})]})}),A&&!f&&(0,n.Y)(c.so,{sx:e=>({marginTop:e.sizes.$2}),direction:"col",children:(0,n.FD)(v,{value:w?"optional":"required",onChange:e=>C("optional"===e),labelledBy:$,children:[(0,n.Y)(y,{value:"required",label:(0,n.FD)(c.so,{wrap:"wrap",sx:e=>({columnGap:e.sizes.$2,rowGap:e.sizes.$1}),children:[(0,n.Y)("span",{children:"Membership required"}),(0,n.Y)(x,{children:"Standard"})]}),description:(0,n.FD)(n.FK,{children:[(0,n.Y)("span",{className:"block",children:"Users need to belong to at least one organization."}),(0,n.Y)("span",{children:"Common for most B2B SaaS applications"})]})}),(0,n.Y)(y,{value:"optional",label:"Membership optional",description:"Users can work outside of an organization with a personal account"})]})})]}),(0,n.Y)("span",{css:(0,o.AH)`
22
22
  height: 1px;
23
23
  display: block;
24
24
  width: calc(100% - 2px);
25
25
  margin-inline: auto;
26
26
  background-color: #151515;
27
27
  box-shadow: 0px 1px 0px 0px #424242;
28
- `}),(0,r.Y)(p.so,{justify:"center",sx:e=>({padding:`${e.sizes.$4} ${e.sizes.$6}`,gap:e.sizes.$3,justifyContent:"flex-end"}),children:f?(0,r.Y)(m,{variant:"solid",onClick:()=>{d.user?i?.():(d.redirectToSignIn(),d.__internal_closeEnableOrganizationsPrompt?.())},children:d.user?"Continue":"Sign in to continue"}):(0,r.FD)(r.FK,{children:[(0,r.Y)(m,{variant:"outline",onClick:()=>{d?.__internal_closeEnableOrganizationsPrompt?.(),n?.()},children:"I'll remove it myself"}),(0,r.Y)(m,{variant:"solid",onClick:()=>{u(!0);let e={enable_organizations:!0};$&&(e.organization_allow_personal_accounts=x),y.__internal_enableEnvironmentSetting(e).then(()=>{b(!0),u(!1)}).catch(()=>{u(!1)})},disabled:c,children:"Enable Organizations"})]})})]})})})},f=e=>(0,r.Y)(d.S,{children:(0,r.Y)(u,{...e})}),b=(0,o.AH)`
29
- ${g.mk};
28
+ `}),(0,n.Y)(c.so,{justify:"center",sx:e=>({padding:`${e.sizes.$4} ${e.sizes.$6}`,gap:e.sizes.$3,justifyContent:"flex-end"}),children:f?(0,n.Y)(m,{variant:"solid",onClick:()=>{d.user?i?.():(d.redirectToSignIn(),d.__internal_closeEnableOrganizationsPrompt?.())},children:d.user?"Continue":"Sign in to continue"}):(0,n.FD)(n.FK,{children:[(0,n.Y)(m,{variant:"outline",onClick:()=>{d?.__internal_closeEnableOrganizationsPrompt?.(),r?.()},children:"I'll remove it myself"}),(0,n.Y)(m,{variant:"solid",onClick:()=>{u(!0);let e={enable_organizations:!0};A&&(e.organization_allow_personal_accounts=w),Y.__internal_enableEnvironmentSetting(e).then(()=>{b(!0),u(!1)}).catch(()=>{u(!1)})},disabled:g,children:"Enable Organizations"})]})})]})})})},u=e=>(0,n.Y)(d.S,{children:(0,n.Y)(g,{...e})}),f=(0,o.AH)`
29
+ ${h.mk};
30
30
  cursor: pointer;
31
31
  display: flex;
32
32
  align-items: center;
@@ -58,7 +58,7 @@
58
58
  outline: 2px solid white;
59
59
  outline-offset: 2px;
60
60
  }
61
- `,x={solid:(0,o.AH)`
61
+ `,b={solid:(0,o.AH)`
62
62
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30.5%, rgba(0, 0, 0, 0.05) 100%), #454545;
63
63
  box-shadow:
64
64
  0 0 3px 0 rgba(253, 224, 71, 0) inset,
@@ -83,29 +83,115 @@
83
83
  &:hover:not(:disabled) {
84
84
  border-color: rgba(118, 118, 132, 0.5);
85
85
  }
86
- `},m=(0,a.forwardRef)(({variant:e="solid",...i},n)=>(0,r.Y)("button",{ref:n,type:"button",css:[b,x[e]],...i})),C=(0,a.forwardRef)(({label:e,description:i,checked:n,defaultChecked:t,onChange:s,...l},d)=>{let h=(0,a.useId)(),u=void 0!==n,[f,b]=(0,a.useState)(!!t),x=u?n:f;return(0,r.FD)(p.so,{direction:"col",gap:1,children:[(0,r.FD)(p.so,{as:"label",gap:2,align:"center",sx:{isolation:"isolate",userSelect:"none","&:has(input:focus-visible) > input + span":{outline:"2px solid white",outlineOffset:"2px"},"&:has(input:disabled) > input + span":{opacity:.6,cursor:"not-allowed",pointerEvents:"none"}},children:[(0,r.Y)("input",{type:"checkbox",...l,ref:d,role:"switch",...u?{checked:x}:{defaultChecked:t},onChange:e=>{u||b(e.target.checked),s?.(e)},css:{...c.s.visuallyHidden()},"aria-describedby":i?h:void 0}),(0,r.Y)(p.L9,{sx:e=>({display:"flex",alignItems:"center",paddingInline:"2px",width:`calc(${e.sizes.$6} + 2px + 2px)`,height:`calc(${e.sizes.$4} + 2px)`,border:"1px solid rgba(255, 255, 255, 0.2)",backgroundColor:x?"#6C47FF":"rgba(0, 0, 0, 0.2)",borderRadius:999,transition:"background-color 0.2s ease-in-out"}),children:(0,r.Y)(p.L9,{sx:e=>{let i=e.sizes.$3,n=`calc(${e.sizes.$6} - ${i} - 2px)`;return{width:i,height:i,borderRadius:9999,backgroundColor:"white",boxShadow:"0px 0px 0px 1px rgba(0, 0, 0, 0.1)",transform:`translateX(${x?n:"0"})`,transition:"transform 0.2s ease-in-out","@media (prefers-reduced-motion: reduce)":{transition:"none"}}}})}),(0,r.Y)("span",{css:[g.mk,(0,o.AH)`
87
- font-size: 0.875rem;
88
- font-weight: 500;
89
- line-height: 1.25;
90
- color: white;
91
- `],children:e})]}),i?(0,r.Y)(p.L9,{id:h,sx:e=>[g.mk,{display:"block",paddingInlineStart:`calc(${e.sizes.$6} + 2px + 2px + ${e.sizes.$2})`,fontSize:"0.75rem",lineHeight:"1.3333333333",color:"#c3c3c6",textWrap:"pretty"}],children:i}):null]})}),w=(0,a.forwardRef)(({children:e,css:i,...n},t)=>(0,r.Y)("a",{ref:t,...n,css:[g.mk,(0,o.AH)`
86
+ `},m=(0,a.forwardRef)(({variant:e="solid",...i},r)=>(0,n.Y)("button",{ref:r,type:"button",css:[f,b[e]],...i})),x=({children:e})=>(0,n.Y)("span",{css:(0,o.AH)`
87
+ ${h.mk};
88
+ display: inline-flex;
89
+ align-items: center;
90
+ padding: 0.125rem 0.375rem;
91
+ border-radius: 0.25rem;
92
+ font-size: 0.6875rem;
93
+ font-weight: 500;
94
+ line-height: 1.23;
95
+ background-color: #ebebeb;
96
+ color: #2b2b34;
97
+ white-space: nowrap;
98
+ `,children:e}),[w,C]=(0,t.e3)("RadioGroupContext"),v=({value:e,onChange:i,children:r,labelledBy:t})=>{let o=(0,a.useId)(),s=a.useMemo(()=>({value:{name:o,value:e,onChange:i}}),[o,e,i]);return(0,n.Y)(w.Provider,{value:s,children:(0,n.Y)(c.so,{role:"radiogroup",direction:"col",gap:3,"aria-orientation":"vertical","aria-labelledby":t,children:r})})},k="1rem",Y="0.5rem",y=({value:e,label:i,description:r})=>{let{name:t,value:s,onChange:l}=C(),d=(0,a.useId)(),p=e===s;return(0,n.FD)(c.so,{direction:"col",gap:1,children:[(0,n.FD)("label",{css:(0,o.AH)`
99
+ ${h.mk};
100
+ display: flex;
101
+ align-items: flex-start;
102
+ gap: ${Y};
103
+ cursor: pointer;
104
+ user-select: none;
105
+
106
+ &:has(input:focus-visible) > span:first-of-type {
107
+ outline: 2px solid white;
108
+ outline-offset: 2px;
109
+ }
110
+
111
+ &:hover:has(input:not(:checked)) > span:first-of-type {
112
+ background-color: rgba(255, 255, 255, 0.08);
113
+ }
114
+
115
+ &:hover:has(input:checked) > span:first-of-type {
116
+ background-color: rgba(108, 71, 255, 0.8);
117
+ background-color: color-mix(in srgb, #6c47ff 80%, transparent);
118
+ }
119
+ `,children:[(0,n.Y)("input",{type:"radio",name:t,value:e,checked:p,onChange:()=>l(e),"aria-describedby":r?d:void 0,css:(0,o.AH)`
120
+ ${h.mk};
121
+ position: absolute;
122
+ width: 1px;
123
+ height: 1px;
124
+ padding: 0;
125
+ margin: -1px;
126
+ overflow: hidden;
127
+ clip: rect(0, 0, 0, 0);
128
+ white-space: nowrap;
129
+ border-width: 0;
130
+ `}),(0,n.Y)("span",{"aria-hidden":"true",css:(0,o.AH)`
131
+ ${h.mk};
132
+ position: relative;
133
+ display: inline-flex;
134
+ align-items: center;
135
+ justify-content: center;
136
+ width: ${k};
137
+ height: ${k};
138
+ margin-top: 0.125rem;
139
+ flex-shrink: 0;
140
+ border-radius: 50%;
141
+ border: 1px solid rgba(255, 255, 255, 0.3);
142
+ background-color: transparent;
143
+ transition: 120ms ease-in-out;
144
+ transition-property: border-color, background-color, box-shadow;
145
+
146
+ ${p&&(0,o.AH)`
147
+ border-width: 2px;
148
+ border-color: #6c47ff;
149
+ background-color: #6c47ff;
150
+ background-color: color-mix(in srgb, #6c47ff 100%, transparent);
151
+ box-shadow: 0 0 0 2px rgba(108, 71, 255, 0.2);
152
+ `}
153
+
154
+ &::after {
155
+ content: '';
156
+ position: absolute;
157
+ width: 0.375rem;
158
+ height: 0.375rem;
159
+ border-radius: 50%;
160
+ background-color: white;
161
+ opacity: ${+!!p};
162
+ transform: scale(${+!!p});
163
+ transition: 120ms ease-in-out;
164
+ transition-property: opacity, transform;
165
+ }
166
+ `}),(0,n.Y)("span",{css:[h.mk,(0,o.AH)`
167
+ font-size: 0.875rem;
168
+ font-weight: 500;
169
+ line-height: 1.25;
170
+ color: white;
171
+ `],children:i})]}),r&&(0,n.Y)("span",{id:d,css:[h.mk,(0,o.AH)`
172
+ padding-inline-start: calc(${k} + ${Y});
173
+ font-size: 0.75rem;
174
+ line-height: 1.33;
175
+ color: #c3c3c6;
176
+ text-wrap: pretty;
177
+ `],children:r})]})},z=(0,a.forwardRef)(({children:e,css:i,...r},t)=>(0,n.Y)("a",{ref:t,...r,css:[h.mk,(0,o.AH)`
92
178
  color: #a8a8ff;
93
179
  font-size: inherit;
94
180
  font-weight: 500;
95
181
  line-height: 1.3;
96
182
  font-size: 0.8125rem;
97
183
  min-width: 0;
98
- `,i],children:e})),Y=({isEnabled:e})=>{let[i,n]=(0,a.useState)(0);(0,a.useLayoutEffect)(()=>{if(e)return void n(e=>180*(0===e));let i=setInterval(()=>{n(e=>180*(0===e))},2e3);return()=>clearInterval(i)},[e]);let t="idle",s="warning";e&&(0===i?(t="success",s="warning"):(s="success",t="idle"));let l=e=>{switch(e){case"idle":return(0,r.Y)(g.MF,{});case"success":return(0,r.Y)(g.F3,{css:(0,o.AH)`
184
+ `,i],children:e})),F=({isEnabled:e})=>{let[i,r]=(0,a.useState)(0);(0,a.useLayoutEffect)(()=>{if(e)return void r(e=>180*(0===e));let i=setInterval(()=>{r(e=>180*(0===e))},2e3);return()=>clearInterval(i)},[e]);let t="idle",s="warning";e&&(0===i?(t="success",s="warning"):(s="success",t="idle"));let l=e=>{switch(e){case"idle":return(0,n.Y)(h.MF,{});case"success":return(0,n.Y)(h.F3,{css:(0,o.AH)`
99
185
  width: 1.25rem;
100
186
  height: 1.25rem;
101
- `});case"warning":return(0,r.FD)("svg",{css:(0,o.AH)`
187
+ `});case"warning":return(0,n.FD)("svg",{css:(0,o.AH)`
102
188
  width: 1.25rem;
103
189
  height: 1.25rem;
104
- `,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.Y)("path",{opacity:"0.2",d:"M17.25 10C17.25 14.0041 14.0041 17.25 10 17.25C5.99594 17.25 2.75 14.0041 2.75 10C2.75 5.99594 5.99594 2.75 10 2.75C14.0041 2.75 17.25 5.99594 17.25 10Z",fill:"#EAB308"}),(0,r.Y)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 3.5C6.41015 3.5 3.5 6.41015 3.5 10C3.5 13.5899 6.41015 16.5 10 16.5C13.5899 16.5 16.5 13.5899 16.5 10C16.5 6.41015 13.5899 3.5 10 3.5ZM2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10C18 14.4183 14.4183 18 10 18C5.58172 18 2 14.4183 2 10Z",fill:"#EAB308"}),(0,r.Y)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 6C10.5523 6 11 6.44772 11 7V9C11 9.55228 10.5523 10 10 10C9.44772 10 9 9.55228 9 9V7C9 6.44772 9.44772 6 10 6Z",fill:"#EAB308"}),(0,r.Y)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 12C10.5523 12 11 12.4477 11 13V13.01C11 13.5623 10.5523 14.01 10 14.01C9.44772 14.01 9 13.5623 9 13.01V13C9 12.4477 9.44772 12 10 12Z",fill:"#EAB308"})]})}};return(0,r.Y)("div",{css:(0,o.AH)`
190
+ `,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.Y)("path",{opacity:"0.2",d:"M17.25 10C17.25 14.0041 14.0041 17.25 10 17.25C5.99594 17.25 2.75 14.0041 2.75 10C2.75 5.99594 5.99594 2.75 10 2.75C14.0041 2.75 17.25 5.99594 17.25 10Z",fill:"#EAB308"}),(0,n.Y)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 3.5C6.41015 3.5 3.5 6.41015 3.5 10C3.5 13.5899 6.41015 16.5 10 16.5C13.5899 16.5 16.5 13.5899 16.5 10C16.5 6.41015 13.5899 3.5 10 3.5ZM2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10C18 14.4183 14.4183 18 10 18C5.58172 18 2 14.4183 2 10Z",fill:"#EAB308"}),(0,n.Y)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 6C10.5523 6 11 6.44772 11 7V9C11 9.55228 10.5523 10 10 10C9.44772 10 9 9.55228 9 9V7C9 6.44772 9.44772 6 10 6Z",fill:"#EAB308"}),(0,n.Y)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 12C10.5523 12 11 12.4477 11 13V13.01C11 13.5623 10.5523 14.01 10 14.01C9.44772 14.01 9 13.5623 9 13.01V13C9 12.4477 9.44772 12 10 12Z",fill:"#EAB308"})]})}};return(0,n.Y)("div",{css:(0,o.AH)`
105
191
  perspective: 1000px;
106
192
  width: 1.25rem;
107
193
  height: 1.25rem;
108
- `,children:(0,r.FD)("div",{css:(0,o.AH)`
194
+ `,children:(0,n.FD)("div",{css:(0,o.AH)`
109
195
  position: relative;
110
196
  width: 100%;
111
197
  height: 100%;
@@ -116,7 +202,7 @@
116
202
  @media (prefers-reduced-motion: reduce) {
117
203
  transition: none;
118
204
  }
119
- `,children:[(0,r.Y)("span",{"aria-hidden":!0,css:(0,o.AH)`
205
+ `,children:[(0,n.Y)("span",{"aria-hidden":!0,css:(0,o.AH)`
120
206
  position: absolute;
121
207
  width: 100%;
122
208
  height: 100%;
@@ -126,7 +212,7 @@
126
212
  justify-content: center;
127
213
  -webkit-font-smoothing: antialiased;
128
214
  transform: rotateY(0deg);
129
- `,children:l(t)}),(0,r.Y)("span",{"aria-hidden":!0,css:(0,o.AH)`
215
+ `,children:l(t)}),(0,n.Y)("span",{"aria-hidden":!0,css:(0,o.AH)`
130
216
  position: absolute;
131
217
  width: 100%;
132
218
  height: 100%;
@@ -136,7 +222,7 @@
136
222
  align-items: center;
137
223
  justify-content: center;
138
224
  -webkit-font-smoothing: antialiased;
139
- `,children:l(s)})]})})}},8307:function(e,i,n){n.d(i,{CB:()=>d,F3:()=>l,MF:()=>c,Uw:()=>a,mk:()=>s});var r=n(4518),t=n(8802),o=n(8272);function a({children:e,sx:i,...n}){return(0,r.Y)(o.so,{sx:e=>[{borderRadius:"1.25rem",fontFamily:e.fonts.$main,background:"linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 100%), #1f1f1f",boxShadow:"0px 0px 0px 0.5px #2F3037 inset, 0px 1px 0px 0px rgba(255, 255, 255, 0.08) inset, 0px 0px 0.8px 0.8px rgba(255, 255, 255, 0.20) inset, 0px 0px 0px 0px rgba(255, 255, 255, 0.72), 0px 16px 36px -6px rgba(0, 0, 0, 0.36), 0px 6px 16px -2px rgba(0, 0, 0, 0.20);"},i],...n,children:e})}let s=(0,t.AH)`
225
+ `,children:l(s)})]})})}},8307:function(e,i,r){r.d(i,{CB:()=>d,F3:()=>l,MF:()=>c,Uw:()=>a,mk:()=>s});var n=r(4518),t=r(8802),o=r(8272);function a({children:e,sx:i,...r}){return(0,n.Y)(o.so,{sx:e=>[{borderRadius:"1.25rem",fontFamily:e.fonts.$main,background:"linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 100%), #1f1f1f",boxShadow:"0px 0px 0px 0.5px #2F3037 inset, 0px 1px 0px 0px rgba(255, 255, 255, 0.08) inset, 0px 0px 0.8px 0.8px rgba(255, 255, 255, 0.20) inset, 0px 0px 0px 0px rgba(255, 255, 255, 0.72), 0px 16px 36px -6px rgba(0, 0, 0, 0.36), 0px 6px 16px -2px rgba(0, 0, 0, 0.20);"},i],...r,children:e})}let s=(0,t.AH)`
140
226
  box-sizing: border-box;
141
227
  padding: 0;
142
228
  margin: 0;
@@ -158,4 +244,4 @@
158
244
  arial,
159
245
  sans-serif;
160
246
  text-decoration: none;
161
- `;function l(e){return(0,r.Y)("svg",{...e,viewBox:"0 0 16 17",fill:"none","aria-hidden":!0,xmlns:"http://www.w3.org/2000/svg",children:(0,r.FD)("g",{opacity:"0.88",children:[(0,r.Y)("path",{d:"M13.8002 8.20039C13.8002 8.96206 13.6502 9.71627 13.3587 10.42C13.0672 11.1236 12.64 11.763 12.1014 12.3016C11.5628 12.8402 10.9234 13.2674 10.2198 13.5589C9.51607 13.8504 8.76186 14.0004 8.0002 14.0004C7.23853 14.0004 6.48432 13.8504 5.78063 13.5589C5.07694 13.2674 4.43756 12.8402 3.89898 12.3016C3.3604 11.763 2.93317 11.1236 2.64169 10.42C2.35022 9.71627 2.2002 8.96206 2.2002 8.20039C2.2002 6.66214 2.81126 5.18688 3.89898 4.09917C4.98669 3.01146 6.46194 2.40039 8.0002 2.40039C9.53845 2.40039 11.0137 3.01146 12.1014 4.09917C13.1891 5.18688 13.8002 6.66214 13.8002 8.20039Z",fill:"#22C543",fillOpacity:"0.16"}),(0,r.Y)("path",{d:"M6.06686 8.68372L7.51686 10.1337L9.93353 6.75039M13.8002 8.20039C13.8002 8.96206 13.6502 9.71627 13.3587 10.42C13.0672 11.1236 12.64 11.763 12.1014 12.3016C11.5628 12.8402 10.9234 13.2674 10.2198 13.5589C9.51607 13.8504 8.76186 14.0004 8.0002 14.0004C7.23853 14.0004 6.48432 13.8504 5.78063 13.5589C5.07694 13.2674 4.43756 12.8402 3.89898 12.3016C3.3604 11.763 2.93317 11.1236 2.64169 10.42C2.35022 9.71627 2.2002 8.96206 2.2002 8.20039C2.2002 6.66214 2.81126 5.18688 3.89898 4.09917C4.98669 3.01146 6.46194 2.40039 8.0002 2.40039C9.53845 2.40039 11.0137 3.01146 12.1014 4.09917C13.1891 5.18688 13.8002 6.66214 13.8002 8.20039Z",stroke:"#22C543",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function d(e){let i=new URL(e).href.match(/^https?:\/\/(.*?)\/apps\/app_(.+?)\/instances\/ins_(.+?)(?:\/.*)?$/);if(!i)throw Error("Invalid value Dashboard URL structure");return{baseDomain:`https://${i[1]}`,appId:`app_${i[2]}`,instanceId:`ins_${i[3]}`}}function c(){return(0,r.FD)("svg",{width:"1rem",height:"1.25rem",viewBox:"0 0 16 20",fill:"none","aria-hidden":!0,xmlns:"http://www.w3.org/2000/svg",children:[(0,r.FD)("g",{filter:"url(#filter0_i_438_501)",children:[(0,r.Y)("path",{d:"M10.4766 9.99979C10.4766 11.3774 9.35978 12.4942 7.98215 12.4942C6.60452 12.4942 5.48773 11.3774 5.48773 9.99979C5.48773 8.62216 6.60452 7.50537 7.98215 7.50537C9.35978 7.50537 10.4766 8.62216 10.4766 9.99979Z",fill:"#BBBBBB"}),(0,r.Y)("path",{d:"M12.4176 3.36236C12.6676 3.52972 12.6889 3.88187 12.4762 4.09457L10.6548 5.91595C10.4897 6.08107 10.2336 6.10714 10.0257 6.00071C9.41273 5.68684 8.71811 5.50976 7.98214 5.50976C5.5024 5.50976 3.49219 7.51998 3.49219 9.99972C3.49219 10.7357 3.66926 11.4303 3.98314 12.0433C4.08957 12.2511 4.06349 12.5073 3.89837 12.6724L2.07699 14.4938C1.86429 14.7065 1.51215 14.6851 1.34479 14.4352C0.495381 13.1666 0 11.641 0 9.99972C0 5.5913 3.57373 2.01758 7.98214 2.01758C9.62345 2.01758 11.1491 2.51296 12.4176 3.36236Z",fill:"#8F8F8F"}),(0,r.Y)("path",{d:"M12.4762 15.905C12.6889 16.1177 12.6675 16.4698 12.4176 16.6372C11.149 17.4866 9.62342 17.982 7.9821 17.982C6.34078 17.982 4.81516 17.4866 3.54661 16.6372C3.29666 16.4698 3.27531 16.1177 3.48801 15.905L5.30938 14.0836C5.4745 13.9185 5.73066 13.8924 5.93851 13.9988C6.55149 14.3127 7.24612 14.4898 7.9821 14.4898C8.71808 14.4898 9.4127 14.3127 10.0257 13.9988C10.2335 13.8924 10.4897 13.9185 10.6548 14.0836L12.4762 15.905Z",fill:"#BBBBBB"})]}),(0,r.Y)("defs",{children:(0,r.FD)("filter",{id:"filter0_i_438_501",x:"0",y:"1.86758",width:"12.6217",height:"16.1144",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,r.Y)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,r.Y)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,r.Y)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,r.Y)("feOffset",{dy:"-0.15"}),(0,r.Y)("feGaussianBlur",{stdDeviation:"0.15"}),(0,r.Y)("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),(0,r.Y)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),(0,r.Y)("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_438_501"})]})})]})}}}]);
247
+ `;function l(e){return(0,n.Y)("svg",{...e,viewBox:"0 0 16 17",fill:"none","aria-hidden":!0,xmlns:"http://www.w3.org/2000/svg",children:(0,n.FD)("g",{opacity:"0.88",children:[(0,n.Y)("path",{d:"M13.8002 8.20039C13.8002 8.96206 13.6502 9.71627 13.3587 10.42C13.0672 11.1236 12.64 11.763 12.1014 12.3016C11.5628 12.8402 10.9234 13.2674 10.2198 13.5589C9.51607 13.8504 8.76186 14.0004 8.0002 14.0004C7.23853 14.0004 6.48432 13.8504 5.78063 13.5589C5.07694 13.2674 4.43756 12.8402 3.89898 12.3016C3.3604 11.763 2.93317 11.1236 2.64169 10.42C2.35022 9.71627 2.2002 8.96206 2.2002 8.20039C2.2002 6.66214 2.81126 5.18688 3.89898 4.09917C4.98669 3.01146 6.46194 2.40039 8.0002 2.40039C9.53845 2.40039 11.0137 3.01146 12.1014 4.09917C13.1891 5.18688 13.8002 6.66214 13.8002 8.20039Z",fill:"#22C543",fillOpacity:"0.16"}),(0,n.Y)("path",{d:"M6.06686 8.68372L7.51686 10.1337L9.93353 6.75039M13.8002 8.20039C13.8002 8.96206 13.6502 9.71627 13.3587 10.42C13.0672 11.1236 12.64 11.763 12.1014 12.3016C11.5628 12.8402 10.9234 13.2674 10.2198 13.5589C9.51607 13.8504 8.76186 14.0004 8.0002 14.0004C7.23853 14.0004 6.48432 13.8504 5.78063 13.5589C5.07694 13.2674 4.43756 12.8402 3.89898 12.3016C3.3604 11.763 2.93317 11.1236 2.64169 10.42C2.35022 9.71627 2.2002 8.96206 2.2002 8.20039C2.2002 6.66214 2.81126 5.18688 3.89898 4.09917C4.98669 3.01146 6.46194 2.40039 8.0002 2.40039C9.53845 2.40039 11.0137 3.01146 12.1014 4.09917C13.1891 5.18688 13.8002 6.66214 13.8002 8.20039Z",stroke:"#22C543",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function d(e){let i=new URL(e).href.match(/^https?:\/\/(.*?)\/apps\/app_(.+?)\/instances\/ins_(.+?)(?:\/.*)?$/);if(!i)throw Error("Invalid value Dashboard URL structure");return{baseDomain:`https://${i[1]}`,appId:`app_${i[2]}`,instanceId:`ins_${i[3]}`}}function c(){return(0,n.FD)("svg",{width:"1rem",height:"1.25rem",viewBox:"0 0 16 20",fill:"none","aria-hidden":!0,xmlns:"http://www.w3.org/2000/svg",children:[(0,n.FD)("g",{filter:"url(#filter0_i_438_501)",children:[(0,n.Y)("path",{d:"M10.4766 9.99979C10.4766 11.3774 9.35978 12.4942 7.98215 12.4942C6.60452 12.4942 5.48773 11.3774 5.48773 9.99979C5.48773 8.62216 6.60452 7.50537 7.98215 7.50537C9.35978 7.50537 10.4766 8.62216 10.4766 9.99979Z",fill:"#BBBBBB"}),(0,n.Y)("path",{d:"M12.4176 3.36236C12.6676 3.52972 12.6889 3.88187 12.4762 4.09457L10.6548 5.91595C10.4897 6.08107 10.2336 6.10714 10.0257 6.00071C9.41273 5.68684 8.71811 5.50976 7.98214 5.50976C5.5024 5.50976 3.49219 7.51998 3.49219 9.99972C3.49219 10.7357 3.66926 11.4303 3.98314 12.0433C4.08957 12.2511 4.06349 12.5073 3.89837 12.6724L2.07699 14.4938C1.86429 14.7065 1.51215 14.6851 1.34479 14.4352C0.495381 13.1666 0 11.641 0 9.99972C0 5.5913 3.57373 2.01758 7.98214 2.01758C9.62345 2.01758 11.1491 2.51296 12.4176 3.36236Z",fill:"#8F8F8F"}),(0,n.Y)("path",{d:"M12.4762 15.905C12.6889 16.1177 12.6675 16.4698 12.4176 16.6372C11.149 17.4866 9.62342 17.982 7.9821 17.982C6.34078 17.982 4.81516 17.4866 3.54661 16.6372C3.29666 16.4698 3.27531 16.1177 3.48801 15.905L5.30938 14.0836C5.4745 13.9185 5.73066 13.8924 5.93851 13.9988C6.55149 14.3127 7.24612 14.4898 7.9821 14.4898C8.71808 14.4898 9.4127 14.3127 10.0257 13.9988C10.2335 13.8924 10.4897 13.9185 10.6548 14.0836L12.4762 15.905Z",fill:"#BBBBBB"})]}),(0,n.Y)("defs",{children:(0,n.FD)("filter",{id:"filter0_i_438_501",x:"0",y:"1.86758",width:"12.6217",height:"16.1144",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[(0,n.Y)("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),(0,n.Y)("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),(0,n.Y)("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),(0,n.Y)("feOffset",{dy:"-0.15"}),(0,n.Y)("feGaussianBlur",{stdDeviation:"0.15"}),(0,n.Y)("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),(0,n.Y)("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),(0,n.Y)("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_438_501"})]})})]})}}}]);