@ory/elements-react 0.0.0-pr.3a98de9

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 (62) hide show
  1. package/CHANGELOG.md +455 -0
  2. package/DEVELOPMENT.md +94 -0
  3. package/LICENSE +201 -0
  4. package/README.md +254 -0
  5. package/babel.config.js +10 -0
  6. package/dist/client/config.d.mts +21 -0
  7. package/dist/client/config.d.ts +21 -0
  8. package/dist/client/config.js +77 -0
  9. package/dist/client/config.js.map +1 -0
  10. package/dist/client/config.mjs +51 -0
  11. package/dist/client/config.mjs.map +1 -0
  12. package/dist/client/frontendClient.d.mts +7 -0
  13. package/dist/client/frontendClient.d.ts +7 -0
  14. package/dist/client/frontendClient.js +52 -0
  15. package/dist/client/frontendClient.js.map +1 -0
  16. package/dist/client/frontendClient.mjs +31 -0
  17. package/dist/client/frontendClient.mjs.map +1 -0
  18. package/dist/client/index.d.mts +5 -0
  19. package/dist/client/index.d.ts +5 -0
  20. package/dist/client/index.js +33 -0
  21. package/dist/client/index.js.map +1 -0
  22. package/dist/client/index.mjs +10 -0
  23. package/dist/client/index.mjs.map +1 -0
  24. package/dist/client/session-provider.d.mts +62 -0
  25. package/dist/client/session-provider.d.ts +62 -0
  26. package/dist/client/session-provider.js +96 -0
  27. package/dist/client/session-provider.js.map +1 -0
  28. package/dist/client/session-provider.mjs +71 -0
  29. package/dist/client/session-provider.mjs.map +1 -0
  30. package/dist/client/useSession.d.mts +32 -0
  31. package/dist/client/useSession.d.ts +32 -0
  32. package/dist/client/useSession.js +37 -0
  33. package/dist/client/useSession.js.map +1 -0
  34. package/dist/client/useSession.mjs +13 -0
  35. package/dist/client/useSession.mjs.map +1 -0
  36. package/dist/index.d.mts +596 -0
  37. package/dist/index.d.ts +596 -0
  38. package/dist/index.js +3898 -0
  39. package/dist/index.js.map +1 -0
  40. package/dist/index.mjs +3876 -0
  41. package/dist/index.mjs.map +1 -0
  42. package/dist/theme/default/index.css +1530 -0
  43. package/dist/theme/default/index.css.map +1 -0
  44. package/dist/theme/default/index.d.mts +78 -0
  45. package/dist/theme/default/index.d.ts +78 -0
  46. package/dist/theme/default/index.js +2861 -0
  47. package/dist/theme/default/index.js.map +1 -0
  48. package/dist/theme/default/index.mjs +2859 -0
  49. package/dist/theme/default/index.mjs.map +1 -0
  50. package/dist/theme/default/tailwind/defaults.d.mts +737 -0
  51. package/dist/theme/default/tailwind/defaults.d.ts +737 -0
  52. package/dist/theme/default/tailwind/defaults.js +219 -0
  53. package/dist/theme/default/tailwind/defaults.js.map +1 -0
  54. package/dist/theme/default/tailwind/defaults.mjs +196 -0
  55. package/dist/theme/default/tailwind/defaults.mjs.map +1 -0
  56. package/package.json +95 -0
  57. package/tailwind/defaults.ts +34 -0
  58. package/tailwind/generated/README.md +2 -0
  59. package/tailwind/generated/default-variables.css +216 -0
  60. package/tailwind/generated/variables-processed.json +161 -0
  61. package/tsconfig.json +35 -0
  62. package/tsconfig.runtime.json +4 -0
@@ -0,0 +1,2859 @@
1
+ "use client"
2
+
3
+ // src/theme/default/assets/ory-badge-horizontal.svg
4
+ import * as React from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var SvgOryBadgeHorizontal = (props) => {
7
+ var _a, _b;
8
+ return /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, fill: "none", ...props, children: [
9
+ /* @__PURE__ */ jsx("path", { fill: "#0F172A", d: "M18.007 8h-1.71l2.007-3.996L16.296 0h1.711l1.145 2.301L20.327 0H22z" }),
10
+ /* @__PURE__ */ jsx("path", { fill: "#0F172A", fillRule: "evenodd", d: "M12.902 4.86a2.47 2.47 0 0 0 1.796-2.365v-.038C14.687 1.097 13.592 0 12.245 0H9.037v1.44l1.208 1.985H9.04V8h1.51V4.949h.633L13.04 8h1.775zm-.876-1.431h.223c.52 0 .943-.427.943-.953a.95.95 0 0 0-.943-.952h-1.39zM4 0a4 4 0 1 0-.001 7.999A4 4 0 0 0 4 0M1.524 4a2.476 2.476 0 1 0 4.952 0 2.476 2.476 0 0 0-4.952 0", clipRule: "evenodd" })
11
+ ] });
12
+ };
13
+ var ory_badge_horizontal_default = SvgOryBadgeHorizontal;
14
+
15
+ // src/theme/default/assets/ory-badge-vertical.svg
16
+ import * as React2 from "react";
17
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
18
+ var SvgOryBadgeVertical = (props) => {
19
+ var _a, _b;
20
+ return /* @__PURE__ */ jsxs2("svg", { xmlns: "http://www.w3.org/2000/svg", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, fill: "none", ...props, children: [
21
+ /* @__PURE__ */ jsx2("path", { fill: "#0F172A", d: "M8 3.993v1.71L4.004 3.697 0 5.704V3.993l2.301-1.145L0 1.673V0z" }),
22
+ /* @__PURE__ */ jsx2("path", { fill: "#0F172A", fillRule: "evenodd", d: "M4.86 9.099a2.47 2.47 0 0 0-2.365-1.797h-.038C1.097 7.313 0 8.408 0 9.755v3.208h1.44l1.985-1.208v1.204H8v-1.51H4.949v-.633L8 8.96V7.185zm-1.431.875v-.223a.95.95 0 0 0-.953-.943.95.95 0 0 0-.952.943v1.39zM0 18a4 4 0 1 0 8 0 4 4 0 0 0-8 0m4 2.476a2.476 2.476 0 1 0 0-4.952 2.476 2.476 0 0 0 0 4.952", clipRule: "evenodd" })
23
+ ] });
24
+ };
25
+ var ory_badge_vertical_default = SvgOryBadgeVertical;
26
+
27
+ // src/theme/default/components/card/badge.tsx
28
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
29
+ function Badge() {
30
+ return /* @__PURE__ */ jsxs3("div", { className: "absolute bg-ory-background-default p-2 font-bold max-sm:bottom-0 max-sm:left-8 max-sm:translate-y-full max-sm:rounded-b-branding sm:right-0 sm:top-8 sm:translate-x-full sm:rounded-r-branding border-ory-border-default border max-sm:py-[7px] sm:pl-[7px]", children: [
31
+ /* @__PURE__ */ jsx3(ory_badge_horizontal_default, { width: 22, height: 8, className: "sm:hidden" }),
32
+ /* @__PURE__ */ jsx3(ory_badge_vertical_default, { width: 8, height: 22, className: "max-sm:hidden" })
33
+ ] });
34
+ }
35
+
36
+ // src/theme/default/components/card/content.tsx
37
+ function DefaultCardContent({ children }) {
38
+ return children;
39
+ }
40
+
41
+ // src/theme/default/components/card/footer.tsx
42
+ import { FlowType } from "@ory/client-fetch";
43
+ import { useOryFlow } from "@ory/elements-react";
44
+ import { useFormContext } from "react-hook-form";
45
+ import { useIntl } from "react-intl";
46
+
47
+ // src/theme/default/utils/url.ts
48
+ function restartFlowUrl(flow, fallback) {
49
+ if (flow.requested_aal === "aal2")
50
+ return appendRefresh(appendAal(fallback, "aal1"), true);
51
+ return flow.request_url || appendReturnTo(fallback, flow.return_to);
52
+ }
53
+ function initFlowUrl(sdkUrl, flowType, flow) {
54
+ const result = `${sdkUrl}/self-service/${flowType}/browser`;
55
+ const qs = new URLSearchParams();
56
+ if (flow.oauth2_login_challenge) {
57
+ qs.set("login_challenge", flow.oauth2_login_challenge);
58
+ }
59
+ if (flow.return_to) {
60
+ qs.set("return_to", flow.return_to);
61
+ } else if (typeof window !== "undefined") {
62
+ const searchParams = new URLSearchParams(window.location.search);
63
+ if (searchParams.has("return_to")) {
64
+ qs.set("return_to", searchParams.get("return_to") || "");
65
+ }
66
+ }
67
+ if (qs.toString().length === 0) {
68
+ return result;
69
+ }
70
+ return result + "?" + qs.toString();
71
+ }
72
+ function appendReturnTo(url, returnTo) {
73
+ if (!returnTo) {
74
+ return url;
75
+ }
76
+ const urlObj = new URL(url);
77
+ urlObj.searchParams.set("return_to", returnTo);
78
+ return urlObj.toString();
79
+ }
80
+ function appendAal(url, aal) {
81
+ const urlObj = new URL(url);
82
+ urlObj.searchParams.set("aal", aal);
83
+ return urlObj.toString();
84
+ }
85
+ function appendRefresh(url, refresh) {
86
+ const urlObj = new URL(url);
87
+ urlObj.searchParams.set("refresh", refresh ? "true" : "false");
88
+ return urlObj.toString();
89
+ }
90
+
91
+ // src/util/ui/index.ts
92
+ import { UiNodeGroupEnum as UiNodeGroupEnum2 } from "@ory/client-fetch";
93
+ import { useMemo } from "react";
94
+
95
+ // src/context/component.tsx
96
+ import {
97
+ isUiNodeInputAttributes,
98
+ UiNodeGroupEnum
99
+ } from "@ory/client-fetch";
100
+ import { createContext, useContext } from "react";
101
+ import { jsx as jsx4 } from "react/jsx-runtime";
102
+ var ComponentContext = createContext({
103
+ components: null,
104
+ // fine because we throw an error if it's not provided
105
+ nodeSorter: () => 0,
106
+ groupSorter: () => 0
107
+ });
108
+ var defaultGroupOrder = [
109
+ UiNodeGroupEnum.Default,
110
+ UiNodeGroupEnum.Profile,
111
+ UiNodeGroupEnum.Password,
112
+ UiNodeGroupEnum.Oidc,
113
+ UiNodeGroupEnum.Code,
114
+ UiNodeGroupEnum.LookupSecret,
115
+ UiNodeGroupEnum.Passkey,
116
+ UiNodeGroupEnum.Webauthn,
117
+ UiNodeGroupEnum.Totp
118
+ ];
119
+
120
+ // src/util/ui/index.ts
121
+ function nodesToAuthMethodGroups(nodes, excludeAuthMethods = []) {
122
+ var _a;
123
+ const groups = {};
124
+ for (const node of nodes) {
125
+ if (node.type === "script") {
126
+ continue;
127
+ }
128
+ const groupNodes = (_a = groups[node.group]) != null ? _a : [];
129
+ groupNodes.push(node);
130
+ groups[node.group] = groupNodes;
131
+ }
132
+ return Object.values(UiNodeGroupEnum2).filter((group) => {
133
+ var _a2;
134
+ return (_a2 = groups[group]) == null ? void 0 : _a2.length;
135
+ }).filter(
136
+ (group) => ![
137
+ UiNodeGroupEnum2.Default,
138
+ UiNodeGroupEnum2.IdentifierFirst,
139
+ UiNodeGroupEnum2.Profile,
140
+ UiNodeGroupEnum2.Captcha,
141
+ ...excludeAuthMethods
142
+ ].includes(group)
143
+ );
144
+ }
145
+
146
+ // src/theme/default/components/card/footer.tsx
147
+ import { Fragment, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
148
+ function DefaultCardFooter() {
149
+ const { flowType } = useOryFlow();
150
+ switch (flowType) {
151
+ case FlowType.Login:
152
+ return /* @__PURE__ */ jsx5(LoginCardFooter, {});
153
+ case FlowType.Registration:
154
+ return /* @__PURE__ */ jsx5(RegistrationCardFooter, {});
155
+ case FlowType.Recovery:
156
+ return /* @__PURE__ */ jsx5(RecoveryCardFooter, {});
157
+ case FlowType.Verification:
158
+ return /* @__PURE__ */ jsx5(VerificationCardFooter, {});
159
+ default:
160
+ return null;
161
+ }
162
+ }
163
+ function LoginCardFooter() {
164
+ const { config, formState, flow, flowType } = useOryFlow();
165
+ const intl = useIntl();
166
+ const authMethods = nodesToAuthMethodGroups(flow.ui.nodes);
167
+ if (flowType === FlowType.Login && flow.refresh) {
168
+ return null;
169
+ }
170
+ return /* @__PURE__ */ jsxs4(Fragment, { children: [
171
+ formState.current === "provide_identifier" && /* @__PURE__ */ jsxs4("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: [
172
+ intl.formatMessage({
173
+ id: "login.registration-label",
174
+ defaultMessage: "No account?"
175
+ }),
176
+ " ",
177
+ /* @__PURE__ */ jsx5(
178
+ "a",
179
+ {
180
+ className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
181
+ href: initFlowUrl(config.sdk.url, "registration", flow),
182
+ "data-testid": "ory/screen/registration/action/login",
183
+ children: intl.formatMessage({
184
+ id: "login.registration-button",
185
+ defaultMessage: "Sign up"
186
+ })
187
+ }
188
+ )
189
+ ] }),
190
+ authMethods.length > 1 && formState.current === "method_active" && /* @__PURE__ */ jsx5("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: /* @__PURE__ */ jsx5(
191
+ "a",
192
+ {
193
+ className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
194
+ href: "",
195
+ "data-testid": "ory/screen/login/mfa/action/selectMethod",
196
+ children: intl.formatMessage({
197
+ id: "login.2fa.method.go-back"
198
+ })
199
+ }
200
+ ) }),
201
+ authMethods.length === 1 && authMethods[0] === "code" && formState.current === "method_active" && /* @__PURE__ */ jsx5("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: /* @__PURE__ */ jsx5(
202
+ "a",
203
+ {
204
+ className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
205
+ href: restartFlowUrl(
206
+ flow,
207
+ `${config.sdk.url}/self-service/${flowType}/browser`
208
+ ),
209
+ "data-testid": "ory/screen/login/mfa/action/reauthenticate",
210
+ children: intl.formatMessage({
211
+ id: "login.2fa.go-back.link"
212
+ })
213
+ }
214
+ ) }),
215
+ flowType === FlowType.Login && flow.requested_aal === "aal2" && (formState.current === "select_method" || authMethods.length === 0) && /* @__PURE__ */ jsxs4("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: [
216
+ intl.formatMessage({
217
+ id: "login.2fa.go-back"
218
+ }),
219
+ " ",
220
+ /* @__PURE__ */ jsx5(
221
+ "a",
222
+ {
223
+ className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
224
+ href: restartFlowUrl(
225
+ flow,
226
+ `${config.sdk.url}/self-service/${flowType}/browser`
227
+ ),
228
+ "data-testid": "ory/screen/login/mfa/action/reauthenticate",
229
+ children: intl.formatMessage({
230
+ id: "login.2fa.go-back.link"
231
+ })
232
+ }
233
+ )
234
+ ] })
235
+ ] });
236
+ }
237
+ function findScreenSelectionButton(nodes) {
238
+ return nodes.find(
239
+ (node) => node.attributes.node_type === "input" && node.attributes.type === "submit" && node.attributes.name === "screen"
240
+ );
241
+ }
242
+ function RegistrationCardFooter() {
243
+ const intl = useIntl();
244
+ const { config, flow, formState } = useOryFlow();
245
+ const { setValue } = useFormContext();
246
+ if (formState.current === "select_method") {
247
+ return null;
248
+ }
249
+ const screenSelectionNode = findScreenSelectionButton(flow.ui.nodes);
250
+ function handleScreenSelection() {
251
+ setValue("method", "profile");
252
+ if (screenSelectionNode) {
253
+ setValue(
254
+ screenSelectionNode.attributes.name,
255
+ screenSelectionNode.attributes.value
256
+ );
257
+ }
258
+ }
259
+ return /* @__PURE__ */ jsx5("span", { className: "font-normal leading-normal antialiased", children: formState.current === "method_active" ? /* @__PURE__ */ jsx5(Fragment, { children: screenSelectionNode && /* @__PURE__ */ jsx5(
260
+ "button",
261
+ {
262
+ className: "font-medium text-button-link-brand-brand hover:text-button-link-brand-brand-hover",
263
+ type: "submit",
264
+ name: screenSelectionNode.attributes.name,
265
+ value: screenSelectionNode.attributes.value,
266
+ onClick: handleScreenSelection,
267
+ children: intl.formatMessage({
268
+ id: "card.footer.select-another-method",
269
+ defaultMessage: "Select another method"
270
+ })
271
+ }
272
+ ) }) : /* @__PURE__ */ jsxs4(Fragment, { children: [
273
+ intl.formatMessage({
274
+ id: "registration.login-label",
275
+ defaultMessage: "Already have an account?"
276
+ }),
277
+ " ",
278
+ /* @__PURE__ */ jsx5(
279
+ "a",
280
+ {
281
+ className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
282
+ href: initFlowUrl(config.sdk.url, "login", flow),
283
+ "data-testid": "ory/screen/registration/action/login",
284
+ children: intl.formatMessage({
285
+ id: "registration.login-button",
286
+ defaultMessage: "Sign in"
287
+ })
288
+ }
289
+ )
290
+ ] }) });
291
+ }
292
+ function RecoveryCardFooter() {
293
+ return null;
294
+ }
295
+ function VerificationCardFooter() {
296
+ return null;
297
+ }
298
+
299
+ // src/theme/default/components/card/header.tsx
300
+ import { useComponents, useOryFlow as useOryFlow3 } from "@ory/elements-react";
301
+
302
+ // src/theme/default/utils/constructCardHeader.ts
303
+ import {
304
+ FlowType as FlowType2,
305
+ isUiNodeInputAttributes as isUiNodeInputAttributes2
306
+ } from "@ory/client-fetch";
307
+ import { useIntl as useIntl2 } from "react-intl";
308
+ function joinWithCommaOr(list, orText = "or") {
309
+ if (list.length === 0) {
310
+ return ".";
311
+ } else if (list.length === 1) {
312
+ return list[0];
313
+ } else {
314
+ const last = list.pop();
315
+ return `${list.join(", ")} ${orText} ${last}`;
316
+ }
317
+ }
318
+ function useCardHeaderText(container, opts) {
319
+ var _a, _b, _c;
320
+ const nodes = container.nodes;
321
+ const intl = useIntl2();
322
+ switch (opts.flowType) {
323
+ case FlowType2.Recovery:
324
+ if (nodes.find(
325
+ (node) => "name" in node.attributes && node.attributes.name === "code"
326
+ )) {
327
+ return {
328
+ title: intl.formatMessage({
329
+ id: "recovery.title"
330
+ }),
331
+ description: intl.formatMessage({
332
+ id: "identities.messages.1060003"
333
+ })
334
+ };
335
+ }
336
+ return {
337
+ title: intl.formatMessage({
338
+ id: "recovery.title"
339
+ }),
340
+ description: intl.formatMessage({
341
+ id: "recovery.subtitle"
342
+ })
343
+ };
344
+ case FlowType2.Settings:
345
+ return {
346
+ title: intl.formatMessage({
347
+ id: "settings.title"
348
+ }),
349
+ description: intl.formatMessage({
350
+ id: "settings.subtitle"
351
+ })
352
+ };
353
+ case FlowType2.Verification:
354
+ if (nodes.find(
355
+ (node) => "name" in node.attributes && node.attributes.name === "code"
356
+ )) {
357
+ return {
358
+ title: intl.formatMessage({
359
+ id: "verification.title"
360
+ }),
361
+ description: intl.formatMessage({
362
+ id: "identities.messages.1080003"
363
+ })
364
+ };
365
+ }
366
+ return {
367
+ title: intl.formatMessage({
368
+ id: "verification.title"
369
+ }),
370
+ description: intl.formatMessage({
371
+ id: "verification.subtitle"
372
+ })
373
+ };
374
+ case FlowType2.Login: {
375
+ const accountLinkingMessage = (_a = container.messages) == null ? void 0 : _a.find(
376
+ (m) => m.id === 1010016
377
+ );
378
+ if (accountLinkingMessage) {
379
+ return {
380
+ title: intl.formatMessage({
381
+ id: "account-linking.title"
382
+ }),
383
+ description: intl.formatMessage(
384
+ {
385
+ id: "identities.messages.1010016"
386
+ },
387
+ accountLinkingMessage.context
388
+ )
389
+ };
390
+ }
391
+ }
392
+ }
393
+ const parts = [];
394
+ if (nodes.find((node) => node.group === "password")) {
395
+ switch (opts.flowType) {
396
+ case FlowType2.Registration:
397
+ parts.push(
398
+ intl.formatMessage(
399
+ { id: "card.header.parts.password.registration" },
400
+ // TODO: make this generic for other labels
401
+ { identifierLabel: "email" }
402
+ )
403
+ );
404
+ break;
405
+ default:
406
+ parts.push(
407
+ intl.formatMessage(
408
+ { id: "card.header.parts.password.login" },
409
+ // TODO: make this generic for other labels
410
+ { identifierLabel: "email" }
411
+ )
412
+ );
413
+ }
414
+ }
415
+ if (nodes.find((node) => node.group === "oidc")) {
416
+ parts.push(
417
+ intl.formatMessage({
418
+ id: "card.header.parts.oidc"
419
+ })
420
+ );
421
+ }
422
+ if (nodes.find((node) => node.group === "code")) {
423
+ parts.push(intl.formatMessage({ id: "card.header.parts.code" }));
424
+ }
425
+ if (nodes.find((node) => node.group === "passkey")) {
426
+ parts.push(intl.formatMessage({ id: "card.header.parts.passkey" }));
427
+ }
428
+ if (nodes.find((node) => node.group === "webauthn")) {
429
+ parts.push(intl.formatMessage({ id: "card.header.parts.webauthn" }));
430
+ }
431
+ if (nodes.find((node) => node.group === "identifier_first")) {
432
+ const identifier = nodes.find(
433
+ (node) => isUiNodeInputAttributes2(node.attributes) && node.attributes.name.startsWith("identifier") && node.attributes.type !== "hidden"
434
+ );
435
+ if (identifier) {
436
+ parts.push(
437
+ intl.formatMessage(
438
+ {
439
+ id: "card.header.parts.identifier-first"
440
+ },
441
+ {
442
+ identifierLabel: (_b = identifier.meta.label) == null ? void 0 : _b.text
443
+ }
444
+ )
445
+ );
446
+ }
447
+ }
448
+ switch (opts.flowType) {
449
+ case FlowType2.Login:
450
+ if (opts.flow.refresh) {
451
+ return {
452
+ title: intl.formatMessage({
453
+ id: "login.title-refresh"
454
+ }),
455
+ description: intl.formatMessage(
456
+ {
457
+ id: "login.subtitle-refresh"
458
+ },
459
+ {
460
+ parts: joinWithCommaOr(parts)
461
+ }
462
+ )
463
+ };
464
+ } else if (opts.flow.requested_aal === "aal2") {
465
+ return {
466
+ title: intl.formatMessage({
467
+ id: "login.title-aal2"
468
+ }),
469
+ description: intl.formatMessage({
470
+ id: ((_c = opts.formState) == null ? void 0 : _c.current) === "method_active" ? `login.${opts.formState.method}.subtitle` : "login.subtitle-aal2"
471
+ })
472
+ };
473
+ }
474
+ return {
475
+ title: intl.formatMessage({
476
+ id: "login.title"
477
+ }),
478
+ description: parts.length > 0 ? intl.formatMessage(
479
+ {
480
+ id: "login.subtitle"
481
+ },
482
+ {
483
+ parts: joinWithCommaOr(
484
+ parts,
485
+ intl.formatMessage({ id: "misc.or" })
486
+ )
487
+ }
488
+ ) : ""
489
+ };
490
+ case FlowType2.Registration:
491
+ return {
492
+ title: intl.formatMessage({
493
+ id: "registration.title"
494
+ }),
495
+ description: parts.length > 0 ? intl.formatMessage(
496
+ {
497
+ id: "registration.subtitle"
498
+ },
499
+ {
500
+ parts: joinWithCommaOr(
501
+ parts,
502
+ intl.formatMessage({ id: "misc.or" })
503
+ )
504
+ }
505
+ ) : ""
506
+ };
507
+ }
508
+ return {
509
+ title: "Error",
510
+ description: "An error occurred"
511
+ };
512
+ }
513
+
514
+ // src/theme/default/components/card/current-identifier-button.tsx
515
+ import { FlowType as FlowType3 } from "@ory/client-fetch";
516
+ import { useOryFlow as useOryFlow2 } from "@ory/elements-react";
517
+
518
+ // src/theme/default/assets/icons/arrow-left.svg
519
+ import * as React3 from "react";
520
+ import { jsx as jsx6 } from "react/jsx-runtime";
521
+ var SvgArrowLeft = (props) => {
522
+ var _a, _b;
523
+ return /* @__PURE__ */ jsx6("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 25", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsx6("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12.325h14m-14 0 6 6m-6-6 6-6" }) });
524
+ };
525
+ var arrow_left_default = SvgArrowLeft;
526
+
527
+ // src/theme/default/utils/attributes.ts
528
+ function omit(obj, keys) {
529
+ const ret = { ...obj };
530
+ for (const key of keys) {
531
+ delete ret[key];
532
+ }
533
+ return ret;
534
+ }
535
+
536
+ // src/theme/default/components/card/current-identifier-button.tsx
537
+ import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
538
+ function DefaultCurrentIdentifierButton() {
539
+ const { flow, flowType, config, formState } = useOryFlow2();
540
+ const ui = flow.ui;
541
+ if (formState.current === "provide_identifier") {
542
+ return null;
543
+ }
544
+ if (flowType === FlowType3.Login && flow.requested_aal === "aal2") {
545
+ return null;
546
+ }
547
+ const nodeBackButton = getBackButtonNode(flowType, ui.nodes);
548
+ if ((nodeBackButton == null ? void 0 : nodeBackButton.attributes.node_type) !== "input" || !nodeBackButton.attributes.value) {
549
+ return null;
550
+ }
551
+ const initFlowUrl2 = restartFlowUrl(
552
+ flow,
553
+ `${config.sdk.url}/self-service/${flowType}/browser`
554
+ );
555
+ const attributes = omit(nodeBackButton.attributes, [
556
+ "autocomplete",
557
+ "node_type",
558
+ "maxlength"
559
+ ]);
560
+ return /* @__PURE__ */ jsx7(
561
+ "a",
562
+ {
563
+ className: "group inline-flex max-w-full cursor-pointer items-center gap-1 self-start rounded-identifier border px-[11px] py-[5px] transition-colors border-button-identifier-border-border-default bg-button-identifier-background-default hover:border-button-identifier-border-border-hover hover:bg-button-identifier-background-hover",
564
+ ...attributes,
565
+ href: initFlowUrl2,
566
+ title: `Adjust ${nodeBackButton == null ? void 0 : nodeBackButton.attributes.value}`,
567
+ "data-testid": "ory/screen/login/action/restart",
568
+ children: /* @__PURE__ */ jsxs5("span", { className: "inline-flex min-h-5 items-center gap-2 overflow-hidden text-ellipsis", children: [
569
+ /* @__PURE__ */ jsx7(
570
+ arrow_left_default,
571
+ {
572
+ size: 16,
573
+ stroke: "1",
574
+ className: "shrink-0 text-button-identifier-foreground-default group-hover:text-button-identifier-foreground-hover"
575
+ }
576
+ ),
577
+ /* @__PURE__ */ jsx7("span", { className: "overflow-hidden text-ellipsis text-nowrap text-sm font-medium text-button-identifier-foreground-default group-hover:text-button-identifier-foreground-hover", children: nodeBackButton == null ? void 0 : nodeBackButton.attributes.value })
578
+ ] })
579
+ }
580
+ );
581
+ }
582
+ function getBackButtonNode(flowType, nodes) {
583
+ let nodeBackButton;
584
+ switch (flowType) {
585
+ case FlowType3.Login:
586
+ nodeBackButton = nodes.find(
587
+ (node) => "name" in node.attributes && node.attributes.name === "identifier" && ["default", "identifier_first"].includes(node.group)
588
+ );
589
+ break;
590
+ case FlowType3.Registration:
591
+ nodeBackButton = guessRegistrationBackButton(nodes);
592
+ break;
593
+ case FlowType3.Recovery:
594
+ case FlowType3.Verification:
595
+ nodeBackButton = nodes.find(
596
+ (n) => "name" in n.attributes && n.attributes.name === "email"
597
+ );
598
+ break;
599
+ }
600
+ return nodeBackButton;
601
+ }
602
+ var backButtonCandiates = [
603
+ "traits.email",
604
+ "traits.username",
605
+ "traits.phone_number"
606
+ ];
607
+ function guessRegistrationBackButton(uiNodes) {
608
+ return uiNodes.find(
609
+ (node) => "name" in node.attributes && backButtonCandiates.includes(node.attributes.name) && node.group === "default"
610
+ );
611
+ }
612
+
613
+ // src/theme/default/components/card/header.tsx
614
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
615
+ function InnerCardHeader({ title, text }) {
616
+ const { Card } = useComponents();
617
+ return /* @__PURE__ */ jsxs6("header", { className: "flex flex-col gap-8 antialiased", children: [
618
+ /* @__PURE__ */ jsx8(Card.Logo, {}),
619
+ /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-2", children: [
620
+ /* @__PURE__ */ jsx8("h2", { className: "text-lg font-semibold leading-normal text-interface-foreground-default-primary", children: title }),
621
+ /* @__PURE__ */ jsx8("p", { className: "leading-normal text-interface-foreground-default-secondary", children: text }),
622
+ /* @__PURE__ */ jsx8(DefaultCurrentIdentifierButton, {})
623
+ ] })
624
+ ] });
625
+ }
626
+ function DefaultCardHeader() {
627
+ const context = useOryFlow3();
628
+ const { title, description } = useCardHeaderText(context.flow.ui, context);
629
+ return /* @__PURE__ */ jsx8(InnerCardHeader, { title, text: description });
630
+ }
631
+
632
+ // src/theme/default/components/card/logo.tsx
633
+ import { useOryFlow as useOryFlow4 } from "@ory/elements-react";
634
+ import { jsx as jsx9 } from "react/jsx-runtime";
635
+ function DefaultCardLogo() {
636
+ const flow = useOryFlow4();
637
+ if (flow.config.logoUrl) {
638
+ return /* @__PURE__ */ jsx9("img", { src: flow.config.logoUrl, width: 100, height: 36, alt: "Logo" });
639
+ }
640
+ return /* @__PURE__ */ jsx9("h1", { className: "text-xl font-semibold leading-normal text-interface-foreground-default-primary", children: flow.config.name });
641
+ }
642
+
643
+ // src/theme/default/components/card/layout.tsx
644
+ import { jsx as jsx10 } from "react/jsx-runtime";
645
+ function DefaultCardLayout({ children }) {
646
+ return /* @__PURE__ */ jsx10("main", { className: "p-4 pb-8 flex items-center justify-center flex-col gap-8 min-h-screen", children });
647
+ }
648
+
649
+ // src/theme/default/components/card/index.tsx
650
+ import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
651
+ function DefaultCard({ children }) {
652
+ return /* @__PURE__ */ jsx11("div", { className: "flex flex-1 sm:items-center justify-center font-sans items-start w-full sm:w-[480px] sm:max-w-[480px]", children: /* @__PURE__ */ jsxs7("div", { className: "relative grid grid-cols-1 gap-8 sm:rounded-cards sm:border border-form-border-default bg-form-background-default px-8 py-12 sm:px-12 sm:py-14 border-b w-full", children: [
653
+ children,
654
+ /* @__PURE__ */ jsx11(Badge, {})
655
+ ] }) });
656
+ }
657
+
658
+ // src/theme/default/utils/cn.ts
659
+ import { clsx } from "clsx";
660
+ import { twMerge } from "tailwind-merge";
661
+ function cn(...inputs) {
662
+ return twMerge(clsx(inputs));
663
+ }
664
+
665
+ // src/theme/default/components/form/index.tsx
666
+ import { useIntl as useIntl4 } from "react-intl";
667
+ import {
668
+ messageTestId,
669
+ uiTextToFormattedMessage as uiTextToFormattedMessage2,
670
+ useOryFlow as useOryFlow6
671
+ } from "@ory/elements-react";
672
+ import { FlowType as FlowType4 } from "@ory/client-fetch";
673
+
674
+ // src/theme/default/components/form/social.tsx
675
+ import {
676
+ uiTextToFormattedMessage,
677
+ useOryFlow as useOryFlow5
678
+ } from "@ory/elements-react";
679
+ import { useEffect } from "react";
680
+ import { useFormContext as useFormContext2 } from "react-hook-form";
681
+ import { useIntl as useIntl3 } from "react-intl";
682
+ import { useDebounceValue } from "usehooks-ts";
683
+
684
+ // src/theme/default/provider-logos/apple.svg
685
+ import * as React4 from "react";
686
+ import { jsx as jsx12 } from "react/jsx-runtime";
687
+ var SvgApple = (props) => {
688
+ var _a, _b;
689
+ return /* @__PURE__ */ jsx12("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsx12("path", { fill: "#283544", d: "M27.734 11.55c-.134.078-3.317 1.724-3.317 5.374.15 4.162 4.017 5.621 4.083 5.621-.066.078-.584 1.988-2.116 3.991C25.167 28.261 23.817 30 21.767 30c-1.95 0-2.65-1.15-4.9-1.15-2.416 0-3.1 1.15-4.95 1.15-2.05 0-3.5-1.832-4.782-3.541-1.667-2.236-3.083-5.746-3.133-9.116-.034-1.786.334-3.54 1.266-5.032 1.317-2.081 3.667-3.494 6.233-3.54 1.966-.063 3.716 1.257 4.916 1.257 1.15 0 3.3-1.258 5.733-1.258 1.05.001 3.85.296 5.584 2.78M16.25 8.414c-.35-1.631.616-3.262 1.516-4.302C18.917 2.854 20.734 2 22.3 2c.1 1.63-.534 3.23-1.666 4.395-1.017 1.258-2.767 2.205-4.383 2.019" }) });
690
+ };
691
+ var apple_default = SvgApple;
692
+
693
+ // src/theme/default/provider-logos/auth0.svg
694
+ import * as React5 from "react";
695
+ import { jsx as jsx13 } from "react/jsx-runtime";
696
+ var SvgAuth0 = (props) => {
697
+ var _a, _b;
698
+ return /* @__PURE__ */ jsx13("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsx13("path", { fill: "#eb5424", d: "M49.012 51.774 42.514 32l17.008-12.22h-21.02L32.005 0h21.032l6.506 19.78c3.767 11.468-.118 24.52-10.53 31.993zm-34.023 0L31.998 64l17.015-12.226-17.008-12.22zm-10.516-32c-3.976 12.1.64 24.917 10.5 32.007v-.007L21.482 32 4.474 19.774l21.025.007L31.998 0H10.972z" }) });
699
+ };
700
+ var auth0_default = SvgAuth0;
701
+
702
+ // src/theme/default/provider-logos/discord.svg
703
+ import * as React6 from "react";
704
+ import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
705
+ var SvgDiscord = (props) => {
706
+ var _a, _b;
707
+ return /* @__PURE__ */ jsxs8("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
708
+ /* @__PURE__ */ jsx14("path", { d: "M2 11.6c0-3.36 0-5.04.654-6.324a6 6 0 0 1 2.622-2.622C6.56 2 8.24 2 11.6 2h8.8c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C30 6.56 30 8.24 30 11.6v8.8c0 3.36 0 5.04-.654 6.324a6 6 0 0 1-2.622 2.622C25.44 30 23.76 30 20.4 30h-8.8c-3.36 0-5.04 0-6.324-.654a6 6 0 0 1-2.622-2.622C2 25.44 2 23.76 2 20.4z" }),
709
+ /* @__PURE__ */ jsx14("path", { fill: "#5865F2", d: "M23.636 9.34A18.8 18.8 0 0 0 19.097 8c-.195.332-.424.779-.581 1.134a17.7 17.7 0 0 0-5.03 0A12 12 0 0 0 12.897 8a18.7 18.7 0 0 0-4.542 1.343c-2.872 4.078-3.65 8.055-3.262 11.975a18.6 18.6 0 0 0 5.567 2.68c.448-.58.848-1.195 1.192-1.844a12 12 0 0 1-1.877-.859 9 9 0 0 0 .46-.342c3.62 1.59 7.553 1.59 11.13 0q.225.178.46.342c-.595.337-1.225.626-1.88.86q.516.974 1.191 1.845a18.6 18.6 0 0 0 5.57-2.682c.457-4.544-.78-8.484-3.27-11.978m-11.29 9.567c-1.087 0-1.978-.953-1.978-2.113s.872-2.116 1.977-2.116c1.106 0 1.997.953 1.978 2.116.002 1.16-.872 2.113-1.978 2.113m7.308 0c-1.086 0-1.977-.953-1.977-2.113s.872-2.116 1.977-2.116c1.106 0 1.997.953 1.978 2.116 0 1.16-.872 2.113-1.978 2.113" })
710
+ ] });
711
+ };
712
+ var discord_default = SvgDiscord;
713
+
714
+ // src/theme/default/provider-logos/facebook.svg
715
+ import * as React7 from "react";
716
+ import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
717
+ var SvgFacebook = (props) => {
718
+ var _a, _b;
719
+ return /* @__PURE__ */ jsxs9("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
720
+ /* @__PURE__ */ jsx15("circle", { cx: 16, cy: 16, r: 14, fill: "url(#facebook_svg__a)" }),
721
+ /* @__PURE__ */ jsx15("path", { fill: "#fff", d: "m21.214 20.282.622-3.952h-3.89v-2.563c0-1.081.542-2.136 2.284-2.136H22V8.267S20.395 8 18.86 8c-3.205 0-5.298 1.893-5.298 5.318v3.012H10v3.952h3.562v9.552q1.073.165 2.191.166 1.12 0 2.192-.166v-9.552z" }),
722
+ /* @__PURE__ */ jsx15("defs", { children: /* @__PURE__ */ jsxs9("linearGradient", { id: "facebook_svg__a", x1: 16, x2: 16, y1: 2, y2: 29.917, gradientUnits: "userSpaceOnUse", children: [
723
+ /* @__PURE__ */ jsx15("stop", { stopColor: "#18ACFE" }),
724
+ /* @__PURE__ */ jsx15("stop", { offset: 1, stopColor: "#0163E0" })
725
+ ] }) })
726
+ ] });
727
+ };
728
+ var facebook_default = SvgFacebook;
729
+
730
+ // src/theme/default/provider-logos/generic.svg
731
+ import * as React8 from "react";
732
+ import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
733
+ var SvgGeneric = (props) => {
734
+ var _a, _b;
735
+ return /* @__PURE__ */ jsxs10("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, className: "generic_svg__icon generic_svg__icon-tabler generic_svg__icon-tabler-brand-oauth", viewBox: "0 0 24 24", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
736
+ /* @__PURE__ */ jsx16("path", { stroke: "none", d: "M0 0h24v24H0z" }),
737
+ /* @__PURE__ */ jsx16("path", { d: "M2 12a10 10 0 1 0 20 0 10 10 0 1 0-20 0" }),
738
+ /* @__PURE__ */ jsx16("path", { d: "M12.556 6c.65 0 1.235.373 1.508.947l2.839 7.848a1.646 1.646 0 0 1-1.01 2.108 1.673 1.673 0 0 1-2.068-.851L13.365 15h-2.73l-.398.905A1.67 1.67 0 0 1 8.26 16.95l-.153-.047a1.647 1.647 0 0 1-1.056-1.956l2.824-7.852a1.66 1.66 0 0 1 1.409-1.087z" })
739
+ ] });
740
+ };
741
+ var generic_default = SvgGeneric;
742
+
743
+ // src/theme/default/provider-logos/github.svg
744
+ import * as React9 from "react";
745
+ import { jsx as jsx17 } from "react/jsx-runtime";
746
+ var SvgGithub = (props) => {
747
+ var _a, _b;
748
+ return /* @__PURE__ */ jsx17("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsx17("path", { d: "M12 0C5.374 0 0 5.373 0 12c0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23A11.5 11.5 0 0 1 12 5.803c1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576C20.566 21.797 24 17.3 24 12c0-6.627-5.373-12-12-12" }) });
749
+ };
750
+ var github_default = SvgGithub;
751
+
752
+ // src/theme/default/provider-logos/gitlab.svg
753
+ import * as React10 from "react";
754
+ import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
755
+ var SvgGitlab = (props) => {
756
+ var _a, _b;
757
+ return /* @__PURE__ */ jsxs11("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
758
+ /* @__PURE__ */ jsx18("path", { fill: "#E24329", d: "m22.708 10.691-.031-.072-3.015-7.167a.74.74 0 0 0-.31-.34.87.87 0 0 0-.923.045.73.73 0 0 0-.268.37L16.125 9.2H7.881L5.845 3.527a.72.72 0 0 0-.268-.371.87.87 0 0 0-.923-.045.74.74 0 0 0-.31.34l-3.021 7.164-.03.072a4.67 4.67 0 0 0-.153 3.23c.335 1.063 1.04 1.998 2.01 2.664l.01.007.028.018 4.594 3.132 2.272 1.567 1.384.952c.162.112.36.172.563.172s.401-.06.563-.172l1.384-.952 2.273-1.567 4.62-3.151.012-.009c.968-.666 1.671-1.6 2.006-2.661a4.67 4.67 0 0 0-.15-3.226" }),
759
+ /* @__PURE__ */ jsx18("path", { fill: "#FC6D26", d: "m22.708 10.691-.031-.072a10.7 10.7 0 0 0-4.055 1.66L12 16.839l4.218 2.904 4.621-3.152.012-.008c.969-.666 1.674-1.601 2.008-2.664a4.67 4.67 0 0 0-.15-3.228" }),
760
+ /* @__PURE__ */ jsx18("path", { fill: "#FCA326", d: "m7.781 19.743 2.273 1.566 1.384.952c.162.112.36.172.563.172s.401-.06.563-.172l1.384-.952 2.273-1.566S14.255 18.389 12 16.839c-2.255 1.55-4.219 2.904-4.219 2.904" }),
761
+ /* @__PURE__ */ jsx18("path", { fill: "#FC6D26", d: "M5.376 12.279a10.7 10.7 0 0 0-4.053-1.664l-.03.072a4.67 4.67 0 0 0-.153 3.23c.335 1.063 1.04 1.998 2.01 2.664l.01.007.028.018 4.594 3.132L12 16.836z" })
762
+ ] });
763
+ };
764
+ var gitlab_default = SvgGitlab;
765
+
766
+ // src/theme/default/provider-logos/google.svg
767
+ import * as React11 from "react";
768
+ import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
769
+ var SvgGoogle = (props) => {
770
+ var _a, _b;
771
+ return /* @__PURE__ */ jsxs12("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
772
+ /* @__PURE__ */ jsx19("path", { fill: "#4285F4", d: "M30.001 16.31c0-1.15-.095-1.99-.301-2.861H16.287v5.195h7.873c-.159 1.291-1.016 3.236-2.92 4.542l-.027.174 4.24 3.22.294.029c2.699-2.443 4.254-6.036 4.254-10.298" }),
773
+ /* @__PURE__ */ jsx19("path", { fill: "#34A853", d: "M16.286 30c3.857 0 7.095-1.244 9.46-3.391l-4.507-3.423c-1.207.825-2.826 1.4-4.953 1.4A8.58 8.58 0 0 1 8.16 18.77l-.167.014-4.41 3.344-.058.157C5.874 26.858 10.7 30 16.286 30" }),
774
+ /* @__PURE__ */ jsx19("path", { fill: "#FBBC05", d: "M8.16 18.769a8.5 8.5 0 0 1-.476-2.77c0-.964.174-1.897.46-2.768l-.008-.185-4.465-3.399-.146.068A13.8 13.8 0 0 0 2.001 16c0 2.256.556 4.387 1.524 6.284z" }),
775
+ /* @__PURE__ */ jsx19("path", { fill: "#EB4335", d: "M16.286 7.413c2.683 0 4.492 1.136 5.524 2.085l4.032-3.858C23.366 3.384 20.143 2 16.286 2 10.7 2 5.874 5.142 3.524 9.715l4.62 3.516c1.158-3.375 4.365-5.818 8.142-5.818" })
776
+ ] });
777
+ };
778
+ var google_default = SvgGoogle;
779
+
780
+ // src/theme/default/provider-logos/linkedin.svg
781
+ import * as React12 from "react";
782
+ import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
783
+ var SvgLinkedin = (props) => {
784
+ var _a, _b;
785
+ return /* @__PURE__ */ jsxs13("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
786
+ /* @__PURE__ */ jsx20("rect", { width: 28, height: 28, x: 2, y: 2, fill: "#1275B1", rx: 14 }),
787
+ /* @__PURE__ */ jsx20("path", { fill: "#fff", d: "M12.619 9.692c0 .935-.81 1.692-1.81 1.692C9.81 11.384 9 10.627 9 9.692S9.81 8 10.81 8c.999 0 1.809.758 1.809 1.692M9.247 12.628h3.093V22H9.247zM17.32 12.628h-3.093V22h3.093v-4.795c0-1.107.378-2.22 1.886-2.22 1.705 0 1.695 1.45 1.687 2.572-.01 1.467.014 2.965.014 4.443H24v-4.946c-.026-3.159-.85-4.614-3.557-4.614-1.608 0-2.604.73-3.123 1.39z" })
788
+ ] });
789
+ };
790
+ var linkedin_default = SvgLinkedin;
791
+
792
+ // src/theme/default/provider-logos/microsoft.svg
793
+ import * as React13 from "react";
794
+ import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
795
+ var SvgMicrosoft = (props) => {
796
+ var _a, _b;
797
+ return /* @__PURE__ */ jsxs14("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 23 23", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
798
+ /* @__PURE__ */ jsx21("path", { fill: "#F35325", d: "M1 1h10v10H1z" }),
799
+ /* @__PURE__ */ jsx21("path", { fill: "#81BC06", d: "M12 1h10v10H12z" }),
800
+ /* @__PURE__ */ jsx21("path", { fill: "#05A6F0", d: "M1 12h10v10H1z" }),
801
+ /* @__PURE__ */ jsx21("path", { fill: "#FFBA08", d: "M12 12h10v10H12z" })
802
+ ] });
803
+ };
804
+ var microsoft_default = SvgMicrosoft;
805
+
806
+ // src/theme/default/provider-logos/slack.svg
807
+ import * as React14 from "react";
808
+ import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
809
+ var SvgSlack = (props) => {
810
+ var _a, _b;
811
+ return /* @__PURE__ */ jsxs15("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
812
+ /* @__PURE__ */ jsx22("path", { fill: "#2EB67D", d: "M26.5 15a2.5 2.5 0 1 0-2.5-2.5V15zm-7 0a2.5 2.5 0 0 0 2.5-2.5v-7a2.5 2.5 0 0 0-5 0v7a2.5 2.5 0 0 0 2.5 2.5" }),
813
+ /* @__PURE__ */ jsx22("path", { fill: "#E01E5A", d: "M5.5 17A2.5 2.5 0 1 0 8 19.5V17zm7 0a2.5 2.5 0 0 0-2.5 2.5v7a2.5 2.5 0 0 0 5 0v-7a2.5 2.5 0 0 0-2.5-2.5" }),
814
+ /* @__PURE__ */ jsx22("path", { fill: "#ECB22E", d: "M17 26.5a2.5 2.5 0 1 0 2.5-2.5H17zm0-7a2.5 2.5 0 0 0 2.5 2.5h7a2.5 2.5 0 0 0 0-5h-7a2.5 2.5 0 0 0-2.5 2.5" }),
815
+ /* @__PURE__ */ jsx22("path", { fill: "#36C5F0", d: "M15 5.5A2.5 2.5 0 1 0 12.5 8H15zm0 7a2.5 2.5 0 0 0-2.5-2.5h-7a2.5 2.5 0 0 0 0 5h7a2.5 2.5 0 0 0 2.5-2.5" })
816
+ ] });
817
+ };
818
+ var slack_default = SvgSlack;
819
+
820
+ // src/theme/default/provider-logos/spotify.svg
821
+ import * as React15 from "react";
822
+ import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
823
+ var SvgSpotify = (props) => {
824
+ var _a, _b;
825
+ return /* @__PURE__ */ jsxs16("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
826
+ /* @__PURE__ */ jsx23("circle", { cx: 16, cy: 16, r: 14, fill: "#1ED760" }),
827
+ /* @__PURE__ */ jsx23("path", { fill: "#fff", d: "M22.364 21.623c-.239.38-.75.486-1.148.258-3.141-1.822-7.08-2.232-11.736-1.23-.446.091-.893-.167-.988-.592a.786.786 0 0 1 .621-.94c5.087-1.11 9.456-.639 12.964 1.41a.77.77 0 0 1 .287 1.094m1.627-3.461c-.303.47-.941.607-1.435.334-3.588-2.11-9.058-2.718-13.299-1.488-.558.152-1.132-.137-1.292-.653-.16-.531.144-1.078.702-1.23 4.848-1.396 10.875-.728 15.005 1.686.462.273.622.88.319 1.35m.143-3.613c-4.305-2.43-11.4-2.657-15.515-1.473-.654.197-1.355-.152-1.563-.79-.207-.622.176-1.29.83-1.487 4.72-1.366 12.565-1.093 17.508 1.7.59.334.781 1.063.43 1.625-.334.576-1.1.774-1.69.425" })
828
+ ] });
829
+ };
830
+ var spotify_default = SvgSpotify;
831
+
832
+ // src/theme/default/provider-logos/yandex.svg
833
+ import * as React16 from "react";
834
+ import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
835
+ var SvgYandex = (props) => {
836
+ var _a, _b;
837
+ return /* @__PURE__ */ jsxs17("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
838
+ /* @__PURE__ */ jsx24("circle", { cx: 16, cy: 16, r: 14, fill: "#fff" }),
839
+ /* @__PURE__ */ jsx24("path", { fill: "#FC3F1D", d: "M21 25h-3.143V9.435h-1.402c-2.572 0-3.922 1.294-3.922 3.211 0 2.175.935 3.185 2.857 4.48l1.584 1.063L12.403 25H9l4.104-6.086c-2.363-1.684-3.688-3.316-3.688-6.087C9.416 9.357 11.83 7 16.429 7H21z" })
840
+ ] });
841
+ };
842
+ var yandex_default = SvgYandex;
843
+
844
+ // src/theme/default/provider-logos/x.svg
845
+ import * as React17 from "react";
846
+ import { jsx as jsx25 } from "react/jsx-runtime";
847
+ var SvgX = (props) => {
848
+ var _a, _b;
849
+ return /* @__PURE__ */ jsx25("svg", { xmlns: "http://www.w3.org/2000/svg", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, fill: "none", ...props, children: /* @__PURE__ */ jsx25("path", { fill: "#0F172A", d: "M24.122 3h4.292L18.99 13.73 30 28.285h-8.64l-6.764-8.845-7.744 8.845H2.56l9.983-11.476L2 3h8.854l6.112 8.08zM22.62 25.766h2.379L9.604 5.426H7.048z" }) });
850
+ };
851
+ var x_default = SvgX;
852
+
853
+ // src/theme/default/provider-logos/index.ts
854
+ var logos = {
855
+ apple: apple_default,
856
+ auth0: auth0_default,
857
+ discord: discord_default,
858
+ facebook: facebook_default,
859
+ generic: generic_default,
860
+ github: github_default,
861
+ gitlab: gitlab_default,
862
+ google: google_default,
863
+ linkedin: linkedin_default,
864
+ microsoft: microsoft_default,
865
+ slack: slack_default,
866
+ spotify: spotify_default,
867
+ yandex: yandex_default,
868
+ x: x_default
869
+ };
870
+ var provider_logos_default = logos;
871
+
872
+ // src/theme/default/components/form/spinner.tsx
873
+ import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
874
+ function Spinner({ className }) {
875
+ return /* @__PURE__ */ jsxs18(
876
+ "svg",
877
+ {
878
+ "aria-hidden": "true",
879
+ role: "status",
880
+ className: cn(
881
+ "absolute pointer-events-none inset-0 m-auto size-8 animate-spin",
882
+ className
883
+ ),
884
+ viewBox: "0 0 34 34",
885
+ fill: "none",
886
+ xmlns: "http://www.w3.org/2000/svg",
887
+ children: [
888
+ /* @__PURE__ */ jsx26("g", { clipPath: "url(#clip0_2572_1748)", children: /* @__PURE__ */ jsx26(
889
+ "path",
890
+ {
891
+ d: "M23.364 10.6362C22.1053 9.37751 20.5016 8.52034 18.7558 8.17307C17.01 7.82581 15.2004 8.00404 13.5559 8.68523C11.9113 9.36641 10.5057 10.52 9.51678 12C8.52784 13.4801 8 15.2201 8 17.0001C8 18.7802 8.52784 20.5202 9.51678 22.0003C10.5057 23.4803 11.9113 24.6339 13.5559 25.3151C15.2004 25.9962 17.01 26.1745 18.7558 25.8272C20.5016 25.4799 22.1053 24.6228 23.364 23.3641",
892
+ stroke: "currentColor",
893
+ strokeLinecap: "round",
894
+ strokeLinejoin: "round"
895
+ }
896
+ ) }),
897
+ /* @__PURE__ */ jsx26("defs", { children: /* @__PURE__ */ jsx26("clipPath", { id: "clip0_2572_1748", children: /* @__PURE__ */ jsx26(
898
+ "rect",
899
+ {
900
+ width: "24",
901
+ height: "24",
902
+ fill: "currentColor",
903
+ transform: "translate(17 0.029541) rotate(45)"
904
+ }
905
+ ) }) })
906
+ ]
907
+ }
908
+ );
909
+ }
910
+
911
+ // src/theme/default/components/form/social.tsx
912
+ import { Fragment as Fragment2, jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
913
+ function extractProvider(context) {
914
+ if (context && typeof context === "object" && "provider" in context && typeof context.provider === "string") {
915
+ return context.provider;
916
+ }
917
+ return void 0;
918
+ }
919
+ function DefaultButtonSocial({
920
+ attributes,
921
+ node,
922
+ onClick,
923
+ showLabel: _showLabel,
924
+ logos: providedLogos
925
+ }) {
926
+ var _a, _b, _c;
927
+ const logos2 = { ...provider_logos_default, ...providedLogos };
928
+ const {
929
+ node_type: _ignoredNodeType,
930
+ type: _ignoredType,
931
+ name: _ignoredName,
932
+ ...props
933
+ } = attributes;
934
+ const {
935
+ flow: { ui }
936
+ } = useOryFlow5();
937
+ const [clicked, setClicked] = useDebounceValue(false, 100);
938
+ const intl = useIntl3();
939
+ const {
940
+ formState: { isSubmitting }
941
+ } = useFormContext2();
942
+ const oidcNodeCount = (_a = ui.nodes.filter((node2) => node2.group === "oidc").length) != null ? _a : 0;
943
+ const Logo = logos2[attributes.value.split("-")[0]];
944
+ const showLabel = _showLabel != null ? _showLabel : oidcNodeCount % 3 !== 0 && oidcNodeCount % 4 !== 0;
945
+ const provider = (_c = extractProvider((_b = node.meta.label) == null ? void 0 : _b.context)) != null ? _c : "";
946
+ const localOnClick = () => {
947
+ onClick == null ? void 0 : onClick();
948
+ setClicked(true);
949
+ };
950
+ useEffect(() => {
951
+ if (!isSubmitting) {
952
+ setClicked(false);
953
+ }
954
+ }, [isSubmitting, setClicked]);
955
+ return /* @__PURE__ */ jsxs19(
956
+ "button",
957
+ {
958
+ className: "gap-3 border border-button-social-border-default bg-button-social-background-default hover:bg-button-social-background-hover transition-colors rounded-buttons flex items-center justify-center px-4 py-[13px] loading:bg-button-social-background-disabled loading:border-button-social-border-disabled loading:text-button-social-foreground-disabled hover:text-button-social-foreground-hover",
959
+ value: attributes.value,
960
+ type: "submit",
961
+ name: "provider",
962
+ "data-testid": `ory/form/node/input/${attributes.name}`,
963
+ ...props,
964
+ onClick: localOnClick,
965
+ "data-loading": clicked,
966
+ disabled: isSubmitting,
967
+ children: [
968
+ /* @__PURE__ */ jsx27("span", { className: "size-5 relative", children: !clicked ? Logo ? /* @__PURE__ */ jsx27(Logo, { size: 20 }) : /* @__PURE__ */ jsx27("span", { className: "flex aspect-square items-center justify-center rounded-[999px] border text-xs", children: provider.slice(0, 2) }) : /* @__PURE__ */ jsx27(Spinner, { className: "size-5" }) }),
969
+ showLabel && node.meta.label ? /* @__PURE__ */ jsxs19(Fragment2, { children: [
970
+ /* @__PURE__ */ jsx27("span", { className: "grow text-center font-medium leading-none text-button-social-foreground-default", children: uiTextToFormattedMessage(node.meta.label, intl) }),
971
+ /* @__PURE__ */ jsx27("span", { className: "size-5 block" })
972
+ ] }) : null
973
+ ]
974
+ }
975
+ );
976
+ }
977
+ DefaultButtonSocial.WithLogos = (logos2) => (props) => /* @__PURE__ */ jsx27(DefaultButtonSocial, { ...props, logos: logos2 });
978
+ function DefaultSocialButtonContainer({
979
+ children,
980
+ nodes
981
+ }) {
982
+ return /* @__PURE__ */ jsx27(
983
+ "div",
984
+ {
985
+ className: cn("grid gap-3", {
986
+ // needed because tailwind is not compiling dynamic classes
987
+ "grid-cols-1": nodes.length % 4 <= 2,
988
+ "grid-cols-3": nodes.length % 3 === 0,
989
+ "grid-cols-4": nodes.length > 1 && nodes.length % 4 === 0
990
+ }),
991
+ children
992
+ }
993
+ );
994
+ }
995
+
996
+ // src/theme/default/components/form/index.tsx
997
+ import { jsx as jsx28 } from "react/jsx-runtime";
998
+ function DefaultFormContainer({
999
+ children,
1000
+ onSubmit,
1001
+ action,
1002
+ method
1003
+ }) {
1004
+ return /* @__PURE__ */ jsx28(
1005
+ "form",
1006
+ {
1007
+ onSubmit,
1008
+ noValidate: true,
1009
+ action,
1010
+ method,
1011
+ className: "grid gap-8",
1012
+ children
1013
+ }
1014
+ );
1015
+ }
1016
+ function DefaultMessageContainer({ children }) {
1017
+ const { flowType } = useOryFlow6();
1018
+ if (!children || Array.isArray(children) && children.length === 0) {
1019
+ return null;
1020
+ }
1021
+ return /* @__PURE__ */ jsx28(
1022
+ "section",
1023
+ {
1024
+ className: cn(
1025
+ flowType === FlowType4.Settings ? "text-center" : "text-left"
1026
+ ),
1027
+ children
1028
+ }
1029
+ );
1030
+ }
1031
+ function DefaultMessage({ message }) {
1032
+ const intl = useIntl4();
1033
+ return /* @__PURE__ */ jsx28(
1034
+ "span",
1035
+ {
1036
+ className: cn(
1037
+ "leading-normal",
1038
+ message.type === "error" && "text-interface-foreground-validation-danger",
1039
+ message.type === "info" && "text-interface-foreground-default-secondary",
1040
+ message.type === "success" && "text-interface-foreground-validation-success"
1041
+ ),
1042
+ ...messageTestId(message),
1043
+ children: uiTextToFormattedMessage2(message, intl)
1044
+ }
1045
+ );
1046
+ }
1047
+
1048
+ // src/theme/default/components/card/auth-method-list-item.tsx
1049
+ import { useIntl as useIntl5 } from "react-intl";
1050
+
1051
+ // src/theme/default/assets/icons/code.svg
1052
+ import * as React18 from "react";
1053
+ import { jsx as jsx29 } from "react/jsx-runtime";
1054
+ var SvgCode = (props) => {
1055
+ var _a, _b;
1056
+ return /* @__PURE__ */ jsx29("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 15 13", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsx29("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M6.333 10.666h-4A1.333 1.333 0 0 1 1 9.333V2.666m0 0a1.333 1.333 0 0 1 1.333-1.333h9.334A1.333 1.333 0 0 1 13 2.666m-12 0 6 4 6-4m0 0v4M12.333 12l1.334-1.334-1.334-1.333m-2 0L9 10.666 10.333 12" }) });
1057
+ };
1058
+ var code_default = SvgCode;
1059
+
1060
+ // src/theme/default/assets/icons/passkey.svg
1061
+ import * as React19 from "react";
1062
+ import { jsx as jsx30 } from "react/jsx-runtime";
1063
+ var SvgPasskey = (props) => {
1064
+ var _a, _b;
1065
+ return /* @__PURE__ */ jsx30("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 13 14", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsx30("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M10.602 3.667c.603 1 .86 2.171.733 3.333v.667a4 4 0 0 0 .533 2M3.335 6.333a2.667 2.667 0 0 1 5.333 0V7c0 1.442.468 2.846 1.334 4m-4-4.667v1.334A9.33 9.33 0 0 0 7.668 13M3.335 9a12 12 0 0 0 1.2 4m-3.267-1.333A14.7 14.7 0 0 1 .668 7v-.667a5.333 5.333 0 0 1 8-4.633" }) });
1066
+ };
1067
+ var passkey_default = SvgPasskey;
1068
+
1069
+ // src/theme/default/assets/icons/password.svg
1070
+ import * as React20 from "react";
1071
+ import { jsx as jsx31 } from "react/jsx-runtime";
1072
+ var SvgPassword = (props) => {
1073
+ var _a, _b;
1074
+ return /* @__PURE__ */ jsx31("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 14 4", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsx31("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M7 .667v2.667m-1.333-.667 2.666-1.333m-2.666 0 2.666 1.333m-6-2v2.667M1 2.667l2.667-1.333M1 1.334l2.667 1.333m8-2v2.667m-1.334-.667L13 1.334m-2.667 0L13 2.667" }) });
1075
+ };
1076
+ var password_default = SvgPassword;
1077
+
1078
+ // src/theme/default/assets/icons/webauthn.svg
1079
+ import * as React21 from "react";
1080
+ import { jsx as jsx32 } from "react/jsx-runtime";
1081
+ var SvgWebauthn = (props) => {
1082
+ var _a, _b;
1083
+ return /* @__PURE__ */ jsx32("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 14 14", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsx32("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5h.007m1.03-3.438 2.401 2.401a1.92 1.92 0 0 1 0 2.713l-1.762 1.762a1.92 1.92 0 0 1-2.713 0l-.2-.2-4.372 4.371a1.33 1.33 0 0 1-.826.386L2.448 13h-.781a.667.667 0 0 1-.662-.589L1 12.333v-.781c0-.313.11-.616.311-.856l.08-.087.276-.276H3V9h1.333V7.667l1.43-1.43-.201-.2a1.92 1.92 0 0 1 0-2.713l1.762-1.762a1.92 1.92 0 0 1 2.713 0" }) });
1084
+ };
1085
+ var webauthn_default = SvgWebauthn;
1086
+
1087
+ // src/theme/default/assets/icons/totp.svg
1088
+ import * as React22 from "react";
1089
+ import { jsx as jsx33 } from "react/jsx-runtime";
1090
+ var SvgTotp = (props) => {
1091
+ var _a, _b;
1092
+ return /* @__PURE__ */ jsx33("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsx33("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9.333 22.667v.013m0-13.346v.013m13.333-.013v.013m0 9.32h-4v4m8-4v.013m-8 7.987h4m0-4h4v4m-21.333-20a1.333 1.333 0 0 1 1.333-1.333H12a1.333 1.333 0 0 1 1.333 1.333V12A1.334 1.334 0 0 1 12 13.334H6.666A1.334 1.334 0 0 1 5.333 12zm13.333 0A1.333 1.333 0 0 1 20 5.334h5.333a1.333 1.333 0 0 1 1.333 1.333V12a1.333 1.333 0 0 1-1.333 1.334H20A1.333 1.333 0 0 1 18.666 12zM5.333 20a1.333 1.333 0 0 1 1.333-1.333H12A1.333 1.333 0 0 1 13.333 20v5.334A1.333 1.333 0 0 1 12 26.667H6.666a1.333 1.333 0 0 1-1.333-1.334z" }) });
1093
+ };
1094
+ var totp_default = SvgTotp;
1095
+
1096
+ // src/theme/default/assets/icons/code-asterix.svg
1097
+ import * as React23 from "react";
1098
+ import { jsx as jsx34 } from "react/jsx-runtime";
1099
+ var SvgCodeAsterix = (props) => {
1100
+ var _a, _b;
1101
+ return /* @__PURE__ */ jsx34("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 25", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsx34("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 19.325a2 2 0 0 1-2-2v-4l-1-1 1-1v-4a2 2 0 0 1 2-2m6 6.875 3-1.687M12 12.2v3.375m0-3.375-3-1.687m3 1.687 3 1.688M12 12.2V8.825m0 3.375-3 1.688m9 5.437a2 2 0 0 0 2-2v-4l1-1-1-1v-4a2 2 0 0 0-2-2" }) });
1102
+ };
1103
+ var code_asterix_default = SvgCodeAsterix;
1104
+
1105
+ // src/theme/default/utils/form.ts
1106
+ function isGroupImmediateSubmit(group) {
1107
+ return group === "code";
1108
+ }
1109
+
1110
+ // src/theme/default/components/card/auth-method-list-item.tsx
1111
+ import { jsx as jsx35, jsxs as jsxs20 } from "react/jsx-runtime";
1112
+ var iconsMap = {
1113
+ code: code_default,
1114
+ passkey: passkey_default,
1115
+ password: password_default,
1116
+ webauthn: webauthn_default,
1117
+ hardware_token: passkey_default,
1118
+ totp: totp_default,
1119
+ lookup_secret: code_asterix_default,
1120
+ ...provider_logos_default
1121
+ };
1122
+ function DefaultAuthMethodListItem({
1123
+ onClick,
1124
+ group,
1125
+ title
1126
+ }) {
1127
+ var _a;
1128
+ const intl = useIntl5();
1129
+ const Icon = iconsMap[group] || null;
1130
+ return /* @__PURE__ */ jsxs20(
1131
+ "button",
1132
+ {
1133
+ className: "flex cursor-pointer gap-3 text-left items-start w-full rounded-buttons p-2 hover:bg-interface-background-default-primary-hover",
1134
+ onClick,
1135
+ type: isGroupImmediateSubmit(group) ? "submit" : "button",
1136
+ "data-testid": `ory/form/auth-picker/${group}`,
1137
+ children: [
1138
+ /* @__PURE__ */ jsx35("span", { className: "mt-1", children: Icon && /* @__PURE__ */ jsx35(Icon, { size: 16, className: "text-interface-foreground-brand-primary" }) }),
1139
+ /* @__PURE__ */ jsxs20("span", { className: "flex-1 leading-normal inline-flex flex-col w-full", children: [
1140
+ /* @__PURE__ */ jsxs20("span", { className: "text-interface-foreground-default-primary truncate mr-6", children: [
1141
+ intl.formatMessage(
1142
+ { id: (_a = title == null ? void 0 : title.id) != null ? _a : `two-step.${group}.title` },
1143
+ title == null ? void 0 : title.values
1144
+ ),
1145
+ " "
1146
+ ] }),
1147
+ /* @__PURE__ */ jsx35("span", { className: "text-interface-foreground-default-secondary", children: intl.formatMessage({
1148
+ id: `two-step.${group}.description`
1149
+ }) })
1150
+ ] })
1151
+ ]
1152
+ }
1153
+ );
1154
+ }
1155
+
1156
+ // src/theme/default/components/form/button.tsx
1157
+ import { getNodeLabel } from "@ory/client-fetch";
1158
+ import {
1159
+ uiTextToFormattedMessage as uiTextToFormattedMessage3
1160
+ } from "@ory/elements-react";
1161
+ import { cva } from "class-variance-authority";
1162
+ import { useFormContext as useFormContext3 } from "react-hook-form";
1163
+ import { useIntl as useIntl6 } from "react-intl";
1164
+ import { useEffect as useEffect2, useState } from "react";
1165
+ import { jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
1166
+ var buttonStyles = cva(
1167
+ [
1168
+ "relative flex justify-center gap-3 overflow-hidden rounded-buttons leading-none ring-1 ring-inset font-medium",
1169
+ "disabled:cursor-not-allowed loading:cursor-wait loading:before:pointer-events-none",
1170
+ "transition-colors duration-100 ease-linear",
1171
+ "p-4 max-w-[488px]"
1172
+ ],
1173
+ {
1174
+ variants: {
1175
+ intent: {
1176
+ primary: [
1177
+ "bg-button-primary-background-default text-button-primary-foreground-default ring-button-primary-border-default",
1178
+ "hover:bg-button-primary-background-hover hover:text-button-primary-foreground-hover hover:ring-button-primary-border-hover",
1179
+ "disabled:bg-button-primary-background-disabled disabled:text-button-primary-foreground-disabled disabled:ring-button-primary-border-disabled",
1180
+ "loading:bg-button-primary-background-default loading:text-button-primary-foreground-default loading:ring-button-primary-border-default",
1181
+ "loading:before:absolute loading:before:inset-0 loading:before:bg-button-primary-background-default loading:before:opacity-80 loading:before:content-['']",
1182
+ "disabled:bg-button-primary-background-disabled disabled:text-button-primary-foreground-disabled disabled:ring-button-primary-border-disabled"
1183
+ ],
1184
+ secondary: [
1185
+ "bg-button-secondary-background-default text-button-secondary-foreground-default ring-button-secondary-border-default",
1186
+ "hover:bg-button-secondary-background-hover hover:text-button-secondary-foreground-hover hover:ring-button-secondary-border-hover",
1187
+ "disabled:bg-button-secondary-background-disabled disabled:text-button-secondary-foreground-disabled disabled:ring-button-secondary-border-disabled",
1188
+ "loading:bg-button-secondary-background-default loading:text-button-secondary-foreground-default loading:ring-button-secondary-border-default",
1189
+ "loading:before:absolute loading:before:inset-0 loading:before:bg-button-secondary-background-default loading:before:opacity-80 loading:before:content-['']"
1190
+ ]
1191
+ },
1192
+ defaultVariants: {
1193
+ intent: "primary"
1194
+ }
1195
+ }
1196
+ }
1197
+ );
1198
+ var DefaultButton = ({
1199
+ attributes,
1200
+ node,
1201
+ onClick
1202
+ }) => {
1203
+ var _a;
1204
+ const {
1205
+ type,
1206
+ name,
1207
+ value,
1208
+ // Button does not support these attributes, so we skip them
1209
+ autocomplete: _ignoredAutocomplete,
1210
+ label: _ignoredLabel,
1211
+ node_type: _ignoredNodeType,
1212
+ maxlength: _ignoredMaxLength,
1213
+ // End of skipped attributes
1214
+ ...rest
1215
+ } = attributes;
1216
+ const [clicked, setClicked] = useState(false);
1217
+ const intl = useIntl6();
1218
+ const label = getNodeLabel(node);
1219
+ const {
1220
+ formState: { isSubmitting },
1221
+ setValue
1222
+ } = useFormContext3();
1223
+ useEffect2(() => {
1224
+ if (!isSubmitting) {
1225
+ setClicked(false);
1226
+ }
1227
+ }, [isSubmitting]);
1228
+ const isPrimary = attributes.name === "method" || attributes.name.includes("passkey") || attributes.name.includes("webauthn") || attributes.name.includes("lookup_secret");
1229
+ return /* @__PURE__ */ jsxs21(
1230
+ "button",
1231
+ {
1232
+ ...rest,
1233
+ value,
1234
+ name,
1235
+ type: type === "button" ? "button" : "submit",
1236
+ onClick: (e) => {
1237
+ onClick == null ? void 0 : onClick(e);
1238
+ setClicked(true);
1239
+ if (type !== "button") {
1240
+ setValue(name, value);
1241
+ }
1242
+ },
1243
+ className: buttonStyles({
1244
+ intent: isPrimary ? "primary" : "secondary"
1245
+ }),
1246
+ disabled: (_a = rest.disabled) != null ? _a : isSubmitting,
1247
+ "data-loading": clicked,
1248
+ children: [
1249
+ clicked ? /* @__PURE__ */ jsx36(Spinner, {}) : null,
1250
+ label ? /* @__PURE__ */ jsx36("span", { children: uiTextToFormattedMessage3(label, intl) }) : ""
1251
+ ]
1252
+ }
1253
+ );
1254
+ };
1255
+ DefaultButton.displayName = "DefaultButton";
1256
+
1257
+ // src/theme/default/components/form/checkbox.tsx
1258
+ import { getNodeLabel as getNodeLabel2 } from "@ory/client-fetch";
1259
+ import {
1260
+ messageTestId as messageTestId2,
1261
+ uiTextToFormattedMessage as uiTextToFormattedMessage5
1262
+ } from "@ory/elements-react";
1263
+ import { useForm } from "react-hook-form";
1264
+ import { useIntl as useIntl8 } from "react-intl";
1265
+
1266
+ // src/theme/default/components/ui/checkbox-label.tsx
1267
+ import { useIntl as useIntl7 } from "react-intl";
1268
+
1269
+ // src/util/i18n/index.ts
1270
+ var uiTextToFormattedMessage4 = ({ id, context = {}, text }, intl) => {
1271
+ const contextInjectedMessage = Object.entries(context).reduce(
1272
+ (accumulator, [key, value]) => {
1273
+ if (Array.isArray(value)) {
1274
+ return {
1275
+ ...accumulator,
1276
+ [key]: value,
1277
+ [key + "_list"]: intl.formatList(value)
1278
+ };
1279
+ } else if (key.endsWith("_unix")) {
1280
+ if (typeof value === "number") {
1281
+ return {
1282
+ ...accumulator,
1283
+ [key]: intl.formatDate(new Date(value * 1e3)),
1284
+ [key + "_since"]: intl.formatDateTimeRange(
1285
+ new Date(value),
1286
+ /* @__PURE__ */ new Date()
1287
+ ),
1288
+ [key + "_since_minutes"]: Math.ceil(
1289
+ (value - (/* @__PURE__ */ new Date()).getTime() / 1e3) / 60
1290
+ ).toFixed(0),
1291
+ [key + "_until"]: intl.formatDateTimeRange(
1292
+ /* @__PURE__ */ new Date(),
1293
+ new Date(value)
1294
+ ),
1295
+ [key + "_until_minutes"]: Math.ceil(
1296
+ ((/* @__PURE__ */ new Date()).getTime() / 1e3 - value) / 60
1297
+ ).toFixed(0)
1298
+ };
1299
+ }
1300
+ } else if (key === "property") {
1301
+ return {
1302
+ ...accumulator,
1303
+ [key]: intl.formatMessage({
1304
+ id: `property.${value}`,
1305
+ defaultMessage: value
1306
+ })
1307
+ };
1308
+ }
1309
+ return {
1310
+ ...accumulator,
1311
+ [key]: value
1312
+ };
1313
+ },
1314
+ {}
1315
+ );
1316
+ return intl.formatMessage(
1317
+ {
1318
+ id: `identities.messages.${id}`,
1319
+ defaultMessage: text
1320
+ },
1321
+ contextInjectedMessage
1322
+ );
1323
+ };
1324
+
1325
+ // src/theme/default/components/ui/checkbox-label.tsx
1326
+ import { Fragment as Fragment3, jsx as jsx37 } from "react/jsx-runtime";
1327
+ var linkRegex = /\[([^\]]+)\]\(([^)]+)\)/g;
1328
+ function computeLabelElements(labelText) {
1329
+ const elements = [];
1330
+ let lastIndex = 0;
1331
+ for (const match of labelText.matchAll(linkRegex)) {
1332
+ const linkText = match[1];
1333
+ const url = match[2];
1334
+ const matchStart = match.index;
1335
+ if (typeof matchStart === "undefined") {
1336
+ continue;
1337
+ }
1338
+ if (matchStart > lastIndex) {
1339
+ elements.push(labelText.slice(lastIndex, matchStart));
1340
+ }
1341
+ elements.push(
1342
+ /* @__PURE__ */ jsx37(
1343
+ "a",
1344
+ {
1345
+ href: url,
1346
+ target: "_blank",
1347
+ rel: "noopener noreferrer",
1348
+ className: "text-button-link-brand-brand hover:text-button-link-brand-brand-hover underline",
1349
+ children: linkText
1350
+ },
1351
+ matchStart
1352
+ )
1353
+ );
1354
+ lastIndex = matchStart + match[0].length;
1355
+ }
1356
+ if (lastIndex < labelText.length) {
1357
+ elements.push(labelText.slice(lastIndex));
1358
+ }
1359
+ return elements;
1360
+ }
1361
+ function CheckboxLabel({ label }) {
1362
+ const intl = useIntl7();
1363
+ if (!label) {
1364
+ return null;
1365
+ }
1366
+ const labelText = uiTextToFormattedMessage4(label, intl);
1367
+ return /* @__PURE__ */ jsx37(Fragment3, { children: computeLabelElements(labelText) });
1368
+ }
1369
+
1370
+ // src/theme/default/components/form/checkbox.tsx
1371
+ import { jsx as jsx38, jsxs as jsxs22 } from "react/jsx-runtime";
1372
+ function CheckboxSVG() {
1373
+ return /* @__PURE__ */ jsx38(
1374
+ "svg",
1375
+ {
1376
+ className: "absolute hidden size-4 peer-checked:block fill-checkbox-foreground-checked",
1377
+ xmlns: "http://www.w3.org/2000/svg",
1378
+ width: "16",
1379
+ height: "16",
1380
+ viewBox: "0 0 16 16",
1381
+ fill: "none",
1382
+ children: /* @__PURE__ */ jsx38(
1383
+ "path",
1384
+ {
1385
+ fillRule: "evenodd",
1386
+ clipRule: "evenodd",
1387
+ d: "M11.6464 5.14645C11.8417 4.95118 12.1583 4.95118 12.3536 5.14645C12.5338 5.32669 12.5477 5.6103 12.3951 5.80645L12.3536 5.85355L7.35355 10.8536C7.17331 11.0338 6.8897 11.0477 6.69355 10.8951L6.64645 10.8536L4.14645 8.35355C3.95118 8.15829 3.95118 7.84171 4.14645 7.64645C4.32669 7.4662 4.6103 7.45234 4.80645 7.60485L4.85355 7.64645L7 9.7925L11.6464 5.14645Z"
1388
+ }
1389
+ )
1390
+ }
1391
+ );
1392
+ }
1393
+ var DefaultCheckbox = ({
1394
+ attributes: initialAttributes,
1395
+ node
1396
+ }) => {
1397
+ const {
1398
+ value,
1399
+ name,
1400
+ // Button does not support these attributes, so we skip them
1401
+ autocomplete: _autocomplete,
1402
+ onclick: _onclick,
1403
+ maxlength: _max,
1404
+ // End of skipped attributes
1405
+ ...attributes
1406
+ } = initialAttributes;
1407
+ const intl = useIntl8();
1408
+ const label = getNodeLabel2(node);
1409
+ const { register } = useForm();
1410
+ const hasError = node.messages.some((m) => m.type === "error");
1411
+ return /* @__PURE__ */ jsxs22("label", { className: "flex items-start gap-3 self-stretch antialiased", children: [
1412
+ /* @__PURE__ */ jsxs22("span", { className: "flex h-5 items-center", children: [
1413
+ /* @__PURE__ */ jsx38(
1414
+ "input",
1415
+ {
1416
+ ...attributes,
1417
+ value: 1,
1418
+ defaultChecked: Boolean(value),
1419
+ type: "checkbox",
1420
+ className: cn(
1421
+ "peer size-4 border appearance-none rounded-forms bg-checkbox-background-default border-checkbox-border-checkbox-border-default checked:bg-checkbox-background-checked checked:border-checkbox-border-checkbox-border-checked",
1422
+ hasError && "border-interface-border-validation-danger"
1423
+ ),
1424
+ ...register(name, { value })
1425
+ }
1426
+ ),
1427
+ /* @__PURE__ */ jsx38(CheckboxSVG, {})
1428
+ ] }),
1429
+ /* @__PURE__ */ jsxs22("span", { className: "flex flex-col", children: [
1430
+ /* @__PURE__ */ jsx38("span", { className: "font-normal leading-tight text-interface-foreground-default-primary", children: /* @__PURE__ */ jsx38(CheckboxLabel, { label }) }),
1431
+ node.messages.map((message) => /* @__PURE__ */ jsx38(
1432
+ "span",
1433
+ {
1434
+ className: cn(
1435
+ "mt-1",
1436
+ message.type === "error" ? "text-interface-foreground-validation-danger" : "text-interface-foreground-default-secondary"
1437
+ ),
1438
+ ...messageTestId2(message),
1439
+ children: uiTextToFormattedMessage5(message, intl)
1440
+ },
1441
+ message.id
1442
+ ))
1443
+ ] })
1444
+ ] });
1445
+ };
1446
+
1447
+ // src/theme/default/components/form/group-container.tsx
1448
+ import { jsx as jsx39 } from "react/jsx-runtime";
1449
+ function DefaultGroupContainer({ children }) {
1450
+ return /* @__PURE__ */ jsx39("div", { className: "grid grid-cols-1 gap-8", children });
1451
+ }
1452
+
1453
+ // src/theme/default/components/form/horizontal-divider.tsx
1454
+ import { jsx as jsx40 } from "react/jsx-runtime";
1455
+ function DefaultHorizontalDivider() {
1456
+ return /* @__PURE__ */ jsx40("hr", { className: "border-interface-border-default-primary" });
1457
+ }
1458
+
1459
+ // src/theme/default/components/form/image.tsx
1460
+ import { jsx as jsx41 } from "react/jsx-runtime";
1461
+ function DefaultImage({ attributes }) {
1462
+ return /* @__PURE__ */ jsx41("figure", { children: /* @__PURE__ */ jsx41("img", { ...attributes }) });
1463
+ }
1464
+
1465
+ // src/theme/default/components/form/input.tsx
1466
+ import { FlowType as FlowType5, getNodeLabel as getNodeLabel3 } from "@ory/client-fetch";
1467
+ import {
1468
+ uiTextToFormattedMessage as uiTextToFormattedMessage6,
1469
+ useOryFlow as useOryFlow7
1470
+ } from "@ory/elements-react";
1471
+ import { useRef, useState as useState2 } from "react";
1472
+ import { useFormContext as useFormContext4 } from "react-hook-form";
1473
+ import { useIntl as useIntl9 } from "react-intl";
1474
+
1475
+ // src/theme/default/assets/icons/eye-off.svg
1476
+ import * as React24 from "react";
1477
+ import { jsx as jsx42 } from "react/jsx-runtime";
1478
+ var SvgEyeOff = (props) => {
1479
+ var _a, _b;
1480
+ return /* @__PURE__ */ jsx42("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsx42("path", { stroke: "#000", strokeLinecap: "round", strokeLinejoin: "round", d: "M10.585 10.587a2 2 0 0 0 2.829 2.828m3.267 3.258A8.7 8.7 0 0 1 12 18q-5.4 0-9-6 1.908-3.18 4.32-4.674m2.86-1.146A9 9 0 0 1 12 6q5.4 0 9 6-1 1.665-2.138 2.87M3 3l18 18" }) });
1481
+ };
1482
+ var eye_off_default = SvgEyeOff;
1483
+
1484
+ // src/theme/default/assets/icons/eye.svg
1485
+ import * as React25 from "react";
1486
+ import { jsx as jsx43, jsxs as jsxs23 } from "react/jsx-runtime";
1487
+ var SvgEye = (props) => {
1488
+ var _a, _b;
1489
+ return /* @__PURE__ */ jsx43("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsxs23("g", { strokeLinecap: "round", strokeLinejoin: "round", children: [
1490
+ /* @__PURE__ */ jsx43("path", { stroke: "currentColor", d: "M10 12a2 2 0 1 0 4 0 2 2 0 0 0-4 0" }),
1491
+ /* @__PURE__ */ jsx43("path", { stroke: "#64748B", d: "M21 12q-3.6 6-9 6t-9-6q3.6-6 9-6t9 6" })
1492
+ ] }) });
1493
+ };
1494
+ var eye_default = SvgEye;
1495
+
1496
+ // src/theme/default/components/form/input.tsx
1497
+ import { jsx as jsx44, jsxs as jsxs24 } from "react/jsx-runtime";
1498
+ var DefaultInput = ({
1499
+ node,
1500
+ attributes,
1501
+ onClick
1502
+ }) => {
1503
+ const label = getNodeLabel3(node);
1504
+ const { register } = useFormContext4();
1505
+ const {
1506
+ value,
1507
+ autocomplete,
1508
+ name,
1509
+ maxlength,
1510
+ node_type: _,
1511
+ ...rest
1512
+ } = attributes;
1513
+ const intl = useIntl9();
1514
+ const { flowType } = useOryFlow7();
1515
+ const inputRef = useRef(null);
1516
+ const formattedLabel = label ? intl.formatMessage(
1517
+ {
1518
+ id: "input.placeholder",
1519
+ defaultMessage: "Enter your {placeholder}"
1520
+ },
1521
+ {
1522
+ placeholder: uiTextToFormattedMessage6(label, intl)
1523
+ }
1524
+ ) : "";
1525
+ if (rest.type === "hidden") {
1526
+ return /* @__PURE__ */ jsx44(
1527
+ "input",
1528
+ {
1529
+ ...rest,
1530
+ onClick,
1531
+ maxLength: maxlength,
1532
+ autoComplete: autocomplete,
1533
+ placeholder: formattedLabel,
1534
+ "data-testid": `ory/form/node/input/${name}`,
1535
+ ...register(name, { value })
1536
+ }
1537
+ );
1538
+ }
1539
+ const { ref, ...restRegister } = register(name, { value });
1540
+ return /* @__PURE__ */ jsxs24(
1541
+ "div",
1542
+ {
1543
+ className: cn(
1544
+ "relative flex justify-stretch",
1545
+ // The settings flow input fields are supposed to be dense, so we don't need the extra padding we want on the user flows.
1546
+ flowType === FlowType5.Settings && "max-w-[488px]"
1547
+ ),
1548
+ children: [
1549
+ /* @__PURE__ */ jsx44(
1550
+ "input",
1551
+ {
1552
+ ...rest,
1553
+ onClick,
1554
+ maxLength: maxlength,
1555
+ autoComplete: autocomplete,
1556
+ placeholder: formattedLabel,
1557
+ "data-testid": `ory/form/node/input/${name}`,
1558
+ className: cn(
1559
+ "antialiased rounded-forms border leading-tight transition-colors placeholder:h-[20px] placeholder:text-input-foreground-tertiary focus-visible:outline-none focus:ring-0 w-full",
1560
+ "bg-input-background-default border-input-border-default text-input-foreground-primary",
1561
+ "disabled:bg-input-background-disabled disabled:border-input-border-disabled disabled:text-input-foreground-disabled",
1562
+ "focus:border-input-border-focus focus-visible:border-input-border-focus",
1563
+ "hover:bg-input-background-hover hover:border-input-border-hover",
1564
+ "px-4 py-[13px]"
1565
+ ),
1566
+ ref: (e) => {
1567
+ inputRef.current = e;
1568
+ ref(e);
1569
+ },
1570
+ ...restRegister
1571
+ }
1572
+ ),
1573
+ rest.type === "password" && /* @__PURE__ */ jsx44(PasswordToggle, { inputRef })
1574
+ ]
1575
+ }
1576
+ );
1577
+ };
1578
+ function PasswordToggle({
1579
+ inputRef
1580
+ }) {
1581
+ const [shown, setShown] = useState2(false);
1582
+ const handleClick = () => {
1583
+ setShown(!shown);
1584
+ if (inputRef.current) {
1585
+ inputRef.current.type = shown ? "password" : "text";
1586
+ }
1587
+ };
1588
+ return /* @__PURE__ */ jsx44(
1589
+ "button",
1590
+ {
1591
+ onClick: handleClick,
1592
+ className: "absolute right-0 h-full w-12 flex items-center justify-center",
1593
+ type: "button",
1594
+ children: shown ? /* @__PURE__ */ jsx44(eye_off_default, {}) : /* @__PURE__ */ jsx44(eye_default, {})
1595
+ }
1596
+ );
1597
+ }
1598
+
1599
+ // src/theme/default/components/form/label.tsx
1600
+ import {
1601
+ FlowType as FlowType6,
1602
+ getNodeLabel as getNodeLabel4,
1603
+ instanceOfUiText
1604
+ } from "@ory/client-fetch";
1605
+ import {
1606
+ messageTestId as messageTestId3,
1607
+ uiTextToFormattedMessage as uiTextToFormattedMessage7,
1608
+ useComponents as useComponents2,
1609
+ useOryFlow as useOryFlow8
1610
+ } from "@ory/elements-react";
1611
+ import { useFormContext as useFormContext5 } from "react-hook-form";
1612
+ import { useIntl as useIntl10 } from "react-intl";
1613
+ import { jsx as jsx45, jsxs as jsxs25 } from "react/jsx-runtime";
1614
+ function findResendNode(nodes) {
1615
+ return nodes.find(
1616
+ (n) => "name" in n.attributes && (n.attributes.name === "email" && n.attributes.type === "submit" || n.attributes.name === "resend")
1617
+ );
1618
+ }
1619
+ function DefaultLabel({
1620
+ node,
1621
+ children,
1622
+ attributes,
1623
+ ...rest
1624
+ }) {
1625
+ const intl = useIntl10();
1626
+ const label = getNodeLabel4(node);
1627
+ const { Message } = useComponents2();
1628
+ const { config, flowType, flow } = useOryFlow8();
1629
+ const { setValue, formState } = useFormContext5();
1630
+ const isPassword = attributes.type === "password";
1631
+ const resendNode = findResendNode(flow.ui.nodes);
1632
+ const handleResend = () => {
1633
+ if ((resendNode == null ? void 0 : resendNode.attributes) && "name" in resendNode.attributes) {
1634
+ setValue(resendNode.attributes.name, resendNode.attributes.value);
1635
+ }
1636
+ };
1637
+ const fieldError = formState.errors[attributes.name];
1638
+ return /* @__PURE__ */ jsxs25("div", { className: "flex flex-col gap-1 antialiased", children: [
1639
+ label && /* @__PURE__ */ jsxs25("span", { className: "inline-flex justify-between", children: [
1640
+ /* @__PURE__ */ jsx45(
1641
+ "label",
1642
+ {
1643
+ ...messageTestId3(label),
1644
+ className: "leading-normal text-input-foreground-primary",
1645
+ htmlFor: attributes.name,
1646
+ "data-testid": `ory/form/node/input/label/${attributes.name}`,
1647
+ ...rest,
1648
+ children: uiTextToFormattedMessage7(label, intl)
1649
+ }
1650
+ ),
1651
+ isPassword && config.project.recovery_enabled && flowType === FlowType6.Login && // TODO: make it possible to override with a custom component
1652
+ /* @__PURE__ */ jsx45(
1653
+ "a",
1654
+ {
1655
+ href: initFlowUrl(config.sdk.url, "recovery", flow),
1656
+ className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
1657
+ children: intl.formatMessage({
1658
+ id: "forms.label.forgot-password",
1659
+ defaultMessage: "Forgot password?"
1660
+ })
1661
+ }
1662
+ ),
1663
+ (resendNode == null ? void 0 : resendNode.attributes.node_type) === "input" && /* @__PURE__ */ jsx45(
1664
+ "button",
1665
+ {
1666
+ type: "submit",
1667
+ name: resendNode.attributes.name,
1668
+ value: resendNode.attributes.value,
1669
+ onClick: handleResend,
1670
+ className: "cursor-pointer text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
1671
+ children: intl.formatMessage({ id: "identities.messages.1070008" })
1672
+ }
1673
+ )
1674
+ ] }),
1675
+ children,
1676
+ node.messages.map((message) => /* @__PURE__ */ jsx45(Message.Content, { message }, message.id)),
1677
+ fieldError && instanceOfUiText(fieldError) && /* @__PURE__ */ jsx45(Message.Content, { message: fieldError })
1678
+ ] });
1679
+ }
1680
+
1681
+ // src/theme/default/components/form/link-button.tsx
1682
+ import { getNodeLabel as getNodeLabel5 } from "@ory/client-fetch";
1683
+ import {
1684
+ uiTextToFormattedMessage as uiTextToFormattedMessage8
1685
+ } from "@ory/elements-react";
1686
+ import { forwardRef } from "react";
1687
+ import { useIntl as useIntl11 } from "react-intl";
1688
+ import { jsx as jsx46 } from "react/jsx-runtime";
1689
+ var DefaultLinkButton = forwardRef(({ attributes, node }, ref) => {
1690
+ const intl = useIntl11();
1691
+ const label = getNodeLabel5(node);
1692
+ return /* @__PURE__ */ jsx46(
1693
+ "a",
1694
+ {
1695
+ ...attributes,
1696
+ ref,
1697
+ title: label ? uiTextToFormattedMessage8(label, intl) : "",
1698
+ "data-testid": `ory/form/node/link/${attributes.id}`,
1699
+ className: cn(
1700
+ "antialiased rounded cursor-pointer text-center border gap-3 leading-none bg-button-primary-background-default hover:bg-button-primary-background-hover transition-colors text-button-primary-foreground-default hover:text-button-primary-foreground-hover p-4 font-medium"
1701
+ ),
1702
+ children: label ? uiTextToFormattedMessage8(label, intl) : ""
1703
+ }
1704
+ );
1705
+ });
1706
+ DefaultLinkButton.displayName = "DefaultLinkButton";
1707
+
1708
+ // src/theme/default/components/form/pin-code-input.tsx
1709
+ import { useFormContext as useFormContext6 } from "react-hook-form";
1710
+
1711
+ // src/theme/default/components/form/shadcn/otp-input.tsx
1712
+ import { OTPInput, OTPInputContext } from "input-otp";
1713
+ import * as React26 from "react";
1714
+ import { jsx as jsx47, jsxs as jsxs26 } from "react/jsx-runtime";
1715
+ var InputOTP = React26.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx47(
1716
+ OTPInput,
1717
+ {
1718
+ ref,
1719
+ containerClassName: cn(
1720
+ "flex items-center gap-2 has-[:disabled]:opacity-50",
1721
+ containerClassName
1722
+ ),
1723
+ className: cn("disabled:cursor-not-allowed", className),
1724
+ ...props
1725
+ }
1726
+ ));
1727
+ InputOTP.displayName = "InputOTP";
1728
+ var InputOTPGroup = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx47("div", { ref, className: cn("flex items-center", className), ...props }));
1729
+ InputOTPGroup.displayName = "InputOTPGroup";
1730
+ var InputOTPSlot = React26.forwardRef(({ index, className, ...props }, ref) => {
1731
+ const inputOTPContext = React26.useContext(OTPInputContext);
1732
+ const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
1733
+ return /* @__PURE__ */ jsxs26(
1734
+ "div",
1735
+ {
1736
+ ref,
1737
+ className: cn(
1738
+ "rounded-forms border border-solid bg-input-background-default py-[15px] text-center focus-visible:outline-none w-full",
1739
+ "relative flex items-center justify-center transition-all leading-none",
1740
+ isActive ? "border-input-border-focus" : "border-input-border-default",
1741
+ className
1742
+ ),
1743
+ ...props,
1744
+ children: [
1745
+ /* @__PURE__ */ jsx47("span", { className: "inline-block size-4", children: char }),
1746
+ hasFakeCaret && /* @__PURE__ */ jsx47("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx47("div", { className: "h-4 w-px animate-caret-blink bg-interface-background-brand-primary duration-700" }) })
1747
+ ]
1748
+ }
1749
+ );
1750
+ });
1751
+ InputOTPSlot.displayName = "InputOTPSlot";
1752
+
1753
+ // src/theme/default/components/form/pin-code-input.tsx
1754
+ import { useOryFlow as useOryFlow9 } from "@ory/elements-react";
1755
+ import { FlowType as FlowType7 } from "@ory/client-fetch";
1756
+ import { jsx as jsx48 } from "react/jsx-runtime";
1757
+ var DefaultPinCodeInput = ({ attributes }) => {
1758
+ const { setValue, watch } = useFormContext6();
1759
+ const { maxlength, name } = attributes;
1760
+ const elements = maxlength != null ? maxlength : 6;
1761
+ const { flowType } = useOryFlow9();
1762
+ const handleInputChange = (v) => {
1763
+ setValue(name, v);
1764
+ };
1765
+ const value = watch(name);
1766
+ return /* @__PURE__ */ jsx48(
1767
+ InputOTP,
1768
+ {
1769
+ maxLength: maxlength != null ? maxlength : 6,
1770
+ onChange: handleInputChange,
1771
+ name,
1772
+ value,
1773
+ children: /* @__PURE__ */ jsx48(
1774
+ InputOTPGroup,
1775
+ {
1776
+ className: cn(
1777
+ "w-full flex gap-2 justify-stretch",
1778
+ // The settings flow input fields are supposed to be dense, so we don't need the extra padding we want on the user flows.
1779
+ flowType === FlowType7.Settings && "max-w-[488px]"
1780
+ ),
1781
+ children: [...Array(elements)].map((_, index) => /* @__PURE__ */ jsx48(InputOTPSlot, { index }, index))
1782
+ }
1783
+ )
1784
+ }
1785
+ );
1786
+ };
1787
+
1788
+ // src/theme/default/components/form/section.tsx
1789
+ import { jsx as jsx49, jsxs as jsxs27 } from "react/jsx-runtime";
1790
+ var DefaultFormSection = ({
1791
+ children,
1792
+ nodes: _nodes,
1793
+ ...rest
1794
+ }) => {
1795
+ return /* @__PURE__ */ jsx49(
1796
+ "form",
1797
+ {
1798
+ className: "flex w-full max-w-screen-sm flex-col md:max-w-[712px] lg:max-w-[802px] xl:max-w-[896px] px-4",
1799
+ ...rest,
1800
+ children
1801
+ }
1802
+ );
1803
+ };
1804
+ var DefaultFormSectionContent = ({
1805
+ title,
1806
+ description,
1807
+ children
1808
+ }) => {
1809
+ return /* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-8 rounded-t-cards border border-b-0 border-interface-border-default-primary bg-interface-background-default-primary px-6 py-8", children: [
1810
+ /* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-2", children: [
1811
+ /* @__PURE__ */ jsx49("h3", { className: "font-medium text-interface-foreground-default-primary", children: title }),
1812
+ /* @__PURE__ */ jsx49("span", { className: "text-interface-foreground-default-secondary", children: description })
1813
+ ] }),
1814
+ children
1815
+ ] });
1816
+ };
1817
+ var DefaultFormSectionFooter = ({
1818
+ children,
1819
+ text
1820
+ }) => {
1821
+ return /* @__PURE__ */ jsxs27(
1822
+ "div",
1823
+ {
1824
+ className: cn(
1825
+ "flex min-h-[72px] items-center justify-between gap-2 rounded-b-cards border border-interface-border-default-primary bg-interface-background-default-secondary px-6 py-4 text-interface-foreground-default-tertiary"
1826
+ ),
1827
+ children: [
1828
+ /* @__PURE__ */ jsx49("span", { children: text }),
1829
+ children
1830
+ ]
1831
+ }
1832
+ );
1833
+ };
1834
+
1835
+ // src/theme/default/components/form/text.tsx
1836
+ import { uiTextToFormattedMessage as uiTextToFormattedMessage9 } from "@ory/elements-react";
1837
+ import { useIntl as useIntl12 } from "react-intl";
1838
+ import { Fragment as Fragment4, jsx as jsx50, jsxs as jsxs28 } from "react/jsx-runtime";
1839
+ function DefaultText({ node, attributes }) {
1840
+ var _a;
1841
+ const intl = useIntl12();
1842
+ const lookup = (_a = attributes.text.context) == null ? void 0 : _a.secrets;
1843
+ if (lookup) {
1844
+ return /* @__PURE__ */ jsxs28(Fragment4, { children: [
1845
+ /* @__PURE__ */ jsx50("p", { "data-testid": `ory/form/node/text/${attributes.id}/label`, children: node.meta.label ? uiTextToFormattedMessage9(node.meta.label, intl) : "" }),
1846
+ lookup.map((text, index) => /* @__PURE__ */ jsx50(
1847
+ "pre",
1848
+ {
1849
+ "data-testid": `ory/form/node/text/lookup_secret_codes/text`,
1850
+ children: /* @__PURE__ */ jsx50("code", { children: text ? uiTextToFormattedMessage9(text, intl) : "" })
1851
+ },
1852
+ index
1853
+ ))
1854
+ ] });
1855
+ }
1856
+ return /* @__PURE__ */ jsx50(Fragment4, { children: /* @__PURE__ */ jsxs28(
1857
+ "p",
1858
+ {
1859
+ "data-testid": `ory/form/node/text/${attributes.id}/label`,
1860
+ id: attributes.id,
1861
+ children: [
1862
+ node.meta.label ? /* @__PURE__ */ jsx50("label", { children: uiTextToFormattedMessage9(node.meta.label, intl) }) : null,
1863
+ attributes.text ? uiTextToFormattedMessage9(attributes.text, intl) : ""
1864
+ ]
1865
+ }
1866
+ ) });
1867
+ }
1868
+
1869
+ // src/theme/default/components/generic/page-header.tsx
1870
+ import { useComponents as useComponents3 } from "@ory/elements-react";
1871
+
1872
+ // src/theme/default/components/ui/user-menu.tsx
1873
+ import { DropdownMenuLabel as DropdownMenuLabel2 } from "@radix-ui/react-dropdown-menu";
1874
+ import { useCallback, useEffect as useEffect3, useState as useState3 } from "react";
1875
+ import { useOryFlow as useOryFlow10 } from "@ory/elements-react";
1876
+
1877
+ // src/util/client.ts
1878
+ import {
1879
+ Configuration,
1880
+ FrontendApi
1881
+ } from "@ory/client-fetch";
1882
+ function frontendClient(sdkUrl, opts = {}) {
1883
+ const config = new Configuration({
1884
+ ...opts,
1885
+ basePath: sdkUrl,
1886
+ headers: {
1887
+ Accept: "application/json",
1888
+ ...opts.headers
1889
+ }
1890
+ });
1891
+ return new FrontendApi(config);
1892
+ }
1893
+
1894
+ // src/theme/default/assets/icons/logout.svg
1895
+ import * as React27 from "react";
1896
+ import { jsx as jsx51 } from "react/jsx-runtime";
1897
+ var SvgLogout = (props) => {
1898
+ var _a, _b;
1899
+ return /* @__PURE__ */ jsx51("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsx51("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M9.333 5.334V4A1.333 1.333 0 0 0 8 2.667H3.333A1.333 1.333 0 0 0 2 4v8a1.333 1.333 0 0 0 1.333 1.334H8A1.333 1.333 0 0 0 9.333 12v-1.333M4.667 8H14m0 0-2-2m2 2-2 2" }) });
1900
+ };
1901
+ var logout_default = SvgLogout;
1902
+
1903
+ // src/theme/default/assets/icons/settings.svg
1904
+ import * as React28 from "react";
1905
+ import { jsx as jsx52, jsxs as jsxs29 } from "react/jsx-runtime";
1906
+ var SvgSettings = (props) => {
1907
+ var _a, _b;
1908
+ return /* @__PURE__ */ jsx52("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsxs29("g", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", children: [
1909
+ /* @__PURE__ */ jsx52("path", { d: "M6.883 2.878c.284-1.17 1.95-1.17 2.234 0a1.15 1.15 0 0 0 1.715.71c1.029-.626 2.207.551 1.58 1.58a1.148 1.148 0 0 0 .71 1.715c1.17.284 1.17 1.95 0 2.234a1.15 1.15 0 0 0-.71 1.715c.626 1.029-.551 2.207-1.58 1.58a1.148 1.148 0 0 0-1.715.71c-.284 1.17-1.95 1.17-2.234 0a1.15 1.15 0 0 0-1.715-.71c-1.029.626-2.207-.551-1.58-1.58a1.15 1.15 0 0 0-.71-1.715c-1.17-.284-1.17-1.95 0-2.234a1.15 1.15 0 0 0 .71-1.715c-.626-1.029.551-2.207 1.58-1.58.667.405 1.531.047 1.715-.71" }),
1910
+ /* @__PURE__ */ jsx52("path", { d: "M6 8a2 2 0 1 0 4 0 2 2 0 0 0-4 0" })
1911
+ ] }) });
1912
+ };
1913
+ var settings_default = SvgSettings;
1914
+
1915
+ // src/theme/default/utils/user.ts
1916
+ function isTraitsIndexable(traits) {
1917
+ return typeof traits === "object" && traits !== null;
1918
+ }
1919
+ var getUserInitials = (session) => {
1920
+ var _a, _b;
1921
+ const avatar = "";
1922
+ let primary = "";
1923
+ let secondary = "";
1924
+ if (!((_a = session == null ? void 0 : session.identity) == null ? void 0 : _a.traits) || !isTraitsIndexable(session.identity.traits)) {
1925
+ return {
1926
+ primary,
1927
+ secondary,
1928
+ avatar
1929
+ };
1930
+ }
1931
+ const traits = (_b = session.identity) == null ? void 0 : _b.traits;
1932
+ if (traits.email && typeof traits.email === "string") {
1933
+ secondary = traits.email;
1934
+ }
1935
+ if (traits.name) {
1936
+ if (typeof traits.name === "string") {
1937
+ primary = traits.name;
1938
+ }
1939
+ if (typeof traits.name === "object" && traits.name && traits.name.first && traits.name.last) {
1940
+ primary = traits.name.first + " " + traits.name.last;
1941
+ }
1942
+ }
1943
+ if (primary === "") {
1944
+ primary = secondary;
1945
+ secondary = "";
1946
+ }
1947
+ return {
1948
+ primary,
1949
+ secondary,
1950
+ avatar
1951
+ };
1952
+ };
1953
+
1954
+ // src/theme/default/components/ui/dropdown-menu.tsx
1955
+ import { forwardRef as forwardRef3 } from "react";
1956
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
1957
+ import { jsx as jsx53 } from "react/jsx-runtime";
1958
+ var DropdownMenu = DropdownMenuPrimitive.Root;
1959
+ var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
1960
+ var DropdownMenuContent = forwardRef3(({ className, sideOffset = 16, ...props }, ref) => /* @__PURE__ */ jsx53(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx53(
1961
+ DropdownMenuPrimitive.Content,
1962
+ {
1963
+ ref,
1964
+ sideOffset,
1965
+ align: "end",
1966
+ className: cn(
1967
+ "z-50 min-w-[19rem] overflow-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1968
+ "border border-interface-border-default-primary bg-interface-background-default-primary rounded-cards",
1969
+ className
1970
+ ),
1971
+ ...props
1972
+ }
1973
+ ) }));
1974
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
1975
+ var DropdownMenuItem = forwardRef3(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx53(
1976
+ DropdownMenuPrimitive.Item,
1977
+ {
1978
+ ref,
1979
+ className: cn(
1980
+ "relative flex cursor-pointer select-none items-center outline-none transition-colors data-[disabled]:pointer-events-none",
1981
+ "px-8 py-3 lg:py-4.5 text-sm gap-6",
1982
+ "first:border-0 border-t border-button-secondary-border-default hover:border-button-social-border-hover",
1983
+ "text-button-secondary-foreground-default bg-button-secondary-background-default",
1984
+ "hover:text-button-secondary-foreground-hover hover:bg-button-secondary-background-hover",
1985
+ "data-[disabled]:text-button-secondary-foreground-disabled data-[disabled]:bg-button-secondary-background-disabled",
1986
+ inset && "pl-8",
1987
+ className
1988
+ ),
1989
+ ...props
1990
+ }
1991
+ ));
1992
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
1993
+ var DropdownMenuLabel = forwardRef3(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx53(
1994
+ DropdownMenuPrimitive.Label,
1995
+ {
1996
+ ref,
1997
+ className: cn(
1998
+ "px-2 py-1.5 text-sm font-semibold",
1999
+ inset && "pl-8",
2000
+ className
2001
+ ),
2002
+ ...props
2003
+ }
2004
+ ));
2005
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
2006
+
2007
+ // src/theme/default/components/ui/user-avater.tsx
2008
+ import { forwardRef as forwardRef4 } from "react";
2009
+
2010
+ // src/theme/default/assets/icons/user.svg
2011
+ import * as React29 from "react";
2012
+ import { jsx as jsx54 } from "react/jsx-runtime";
2013
+ var SvgUser = (props) => {
2014
+ var _a, _b;
2015
+ return /* @__PURE__ */ jsx54("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsx54("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M6 21v-2a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v2M8 7a4 4 0 1 0 8 0 4 4 0 0 0-8 0" }) });
2016
+ };
2017
+ var user_default = SvgUser;
2018
+
2019
+ // src/theme/default/components/ui/user-avater.tsx
2020
+ import { jsx as jsx55 } from "react/jsx-runtime";
2021
+ var UserAvatar = forwardRef4(
2022
+ ({ initials, ...rest }, ref) => {
2023
+ return /* @__PURE__ */ jsx55(
2024
+ "button",
2025
+ {
2026
+ ref,
2027
+ className: "relative flex size-10 items-center justify-center overflow-hidden rounded-[999px] bg-button-primary-background-default hover:bg-button-primary-background-hover",
2028
+ ...rest,
2029
+ children: /* @__PURE__ */ jsx55("div", { className: "relative flex size-full items-center justify-center", children: initials.avatar ? /* @__PURE__ */ jsx55(
2030
+ "img",
2031
+ {
2032
+ src: initials.avatar,
2033
+ alt: initials.primary,
2034
+ className: "w-full object-contain"
2035
+ }
2036
+ ) : /* @__PURE__ */ jsx55(
2037
+ user_default,
2038
+ {
2039
+ size: 24,
2040
+ className: "text-button-primary-foreground-default"
2041
+ }
2042
+ ) })
2043
+ }
2044
+ );
2045
+ }
2046
+ );
2047
+ UserAvatar.displayName = "UserAvatar";
2048
+
2049
+ // src/theme/default/components/ui/user-menu.tsx
2050
+ import { jsx as jsx56, jsxs as jsxs30 } from "react/jsx-runtime";
2051
+ var UserMenu = ({ session }) => {
2052
+ const { config } = useOryFlow10();
2053
+ const initials = getUserInitials(session);
2054
+ const [logoutFlow, setLogoutFlow] = useState3();
2055
+ const fetchLogoutFlow = useCallback(async () => {
2056
+ const flow = await frontendClient(config.sdk.url).createBrowserLogoutFlow();
2057
+ setLogoutFlow(flow);
2058
+ }, [config.sdk.url]);
2059
+ useEffect3(() => {
2060
+ void fetchLogoutFlow();
2061
+ }, [fetchLogoutFlow]);
2062
+ return /* @__PURE__ */ jsxs30(DropdownMenu, { children: [
2063
+ /* @__PURE__ */ jsx56(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx56(UserAvatar, { initials }) }),
2064
+ /* @__PURE__ */ jsxs30(DropdownMenuContent, { children: [
2065
+ /* @__PURE__ */ jsxs30(DropdownMenuLabel2, { className: "flex gap-3 px-5 py-4.5", children: [
2066
+ /* @__PURE__ */ jsx56(UserAvatar, { disabled: true, initials }),
2067
+ /* @__PURE__ */ jsxs30("div", { className: "flex flex-col justify-center text-sm leading-tight", children: [
2068
+ /* @__PURE__ */ jsx56("div", { className: "text-interface-foreground-default-primary leading-tight font-medium", children: initials.primary }),
2069
+ initials.secondary && /* @__PURE__ */ jsx56("div", { className: "text-interface-foreground-default-tertiary leading-tight", children: initials.secondary })
2070
+ ] })
2071
+ ] }),
2072
+ /* @__PURE__ */ jsx56(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs30("a", { href: "/settings", children: [
2073
+ /* @__PURE__ */ jsx56(settings_default, { size: 16 }),
2074
+ " User settings"
2075
+ ] }) }),
2076
+ /* @__PURE__ */ jsx56(DropdownMenuItem, { asChild: true, disabled: !(logoutFlow == null ? void 0 : logoutFlow.logout_url), children: /* @__PURE__ */ jsxs30("a", { href: logoutFlow == null ? void 0 : logoutFlow.logout_url, children: [
2077
+ /* @__PURE__ */ jsx56(logout_default, { size: 16 }),
2078
+ " Logout"
2079
+ ] }) })
2080
+ ] })
2081
+ ] });
2082
+ };
2083
+
2084
+ // src/theme/default/components/generic/page-header.tsx
2085
+ import { useSession } from "@ory/elements-react/client";
2086
+ import { jsx as jsx57, jsxs as jsxs31 } from "react/jsx-runtime";
2087
+ var DefaultPageHeader = (_props) => {
2088
+ const { Card } = useComponents3();
2089
+ const { session } = useSession();
2090
+ return /* @__PURE__ */ jsx57("div", { className: "mt-16 flex max-w-screen-sm w-full md:max-w-[712px] lg:max-w-[802px] xl:max-w-[896px] flex-col gap-3 px-4", children: /* @__PURE__ */ jsx57("div", { className: "flex flex-col gap-12", children: /* @__PURE__ */ jsxs31("div", { className: "flex max-h-10 flex-1 justify-between gap-2", children: [
2091
+ /* @__PURE__ */ jsx57("div", { className: "relative h-10 flex-1", children: /* @__PURE__ */ jsx57(Card.Logo, {}) }),
2092
+ /* @__PURE__ */ jsx57(UserMenu, { session })
2093
+ ] }) }) });
2094
+ };
2095
+
2096
+ // src/theme/default/components/settings/settings-oidc.tsx
2097
+ import { useEffect as useEffect4 } from "react";
2098
+ import { useFormContext as useFormContext7 } from "react-hook-form";
2099
+ import { useDebounceValue as useDebounceValue2 } from "usehooks-ts";
2100
+
2101
+ // src/theme/default/assets/icons/trash.svg
2102
+ import * as React30 from "react";
2103
+ import { jsx as jsx58 } from "react/jsx-runtime";
2104
+ var SvgTrash = (props) => {
2105
+ var _a, _b;
2106
+ return /* @__PURE__ */ jsx58("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsx58("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M4 7h16m-10 4v6m4-6v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3" }) });
2107
+ };
2108
+ var trash_default = SvgTrash;
2109
+
2110
+ // src/theme/default/components/settings/settings-oidc.tsx
2111
+ import { jsx as jsx59, jsxs as jsxs32 } from "react/jsx-runtime";
2112
+ function DefaultSettingsOidc({
2113
+ linkButtons,
2114
+ unlinkButtons
2115
+ }) {
2116
+ const hasLinkButtons = linkButtons.length > 0;
2117
+ const hasUnlinkButtons = unlinkButtons.length > 0;
2118
+ return /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-8", children: [
2119
+ hasLinkButtons && /* @__PURE__ */ jsx59("div", { className: "grid items-start gap-3 grid-cols-1 sm:grid-cols-2 md:grid-cols-3", children: linkButtons.map((button) => {
2120
+ const attrs = button.attributes;
2121
+ return /* @__PURE__ */ jsx59(
2122
+ DefaultButtonSocial,
2123
+ {
2124
+ showLabel: true,
2125
+ node: button,
2126
+ attributes: attrs,
2127
+ onClick: button.onClick
2128
+ },
2129
+ attrs.value
2130
+ );
2131
+ }) }),
2132
+ hasUnlinkButtons && hasLinkButtons ? /* @__PURE__ */ jsx59(DefaultHorizontalDivider, {}) : null,
2133
+ unlinkButtons.map((button) => {
2134
+ if (button.attributes.node_type !== "input") {
2135
+ return null;
2136
+ }
2137
+ return /* @__PURE__ */ jsx59(UnlinkRow, { button }, button.attributes.value);
2138
+ })
2139
+ ] });
2140
+ }
2141
+ function UnlinkRow({ button }) {
2142
+ var _a, _b;
2143
+ const [clicked, setClicked] = useDebounceValue2(false, 100);
2144
+ const {
2145
+ formState: { isSubmitting }
2146
+ } = useFormContext7();
2147
+ const attrs = button.attributes;
2148
+ const provider = (_b = extractProvider((_a = button.meta.label) == null ? void 0 : _a.context)) != null ? _b : "";
2149
+ const Logo = provider_logos_default[attrs.value.split("-")[0]];
2150
+ const localOnClick = () => {
2151
+ button.onClick();
2152
+ setClicked(true);
2153
+ };
2154
+ useEffect4(() => {
2155
+ if (!isSubmitting) {
2156
+ setClicked(false);
2157
+ }
2158
+ }, [isSubmitting, setClicked]);
2159
+ return /* @__PURE__ */ jsxs32("div", { className: "flex justify-between", children: [
2160
+ /* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-6", children: [
2161
+ Logo ? /* @__PURE__ */ jsx59(Logo, { size: 32 }) : /* @__PURE__ */ jsx59(provider_logos_default.generic, { size: 32 }),
2162
+ /* @__PURE__ */ jsx59("p", { className: "text-sm font-medium text-interface-foreground-default-secondary", children: provider })
2163
+ ] }),
2164
+ /* @__PURE__ */ jsx59(
2165
+ "button",
2166
+ {
2167
+ ...attrs,
2168
+ type: "submit",
2169
+ onClick: localOnClick,
2170
+ disabled: isSubmitting,
2171
+ className: "relative",
2172
+ title: `Unlink ${provider}`,
2173
+ children: clicked ? /* @__PURE__ */ jsx59(Spinner, { className: "relative" }) : /* @__PURE__ */ jsx59(
2174
+ trash_default,
2175
+ {
2176
+ className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
2177
+ size: 24
2178
+ }
2179
+ )
2180
+ }
2181
+ )
2182
+ ] }, attrs.value);
2183
+ }
2184
+
2185
+ // src/theme/default/components/settings/settings-passkey.tsx
2186
+ import { useComponents as useComponents4 } from "@ory/elements-react";
2187
+ import { useFormContext as useFormContext8 } from "react-hook-form";
2188
+ import { jsx as jsx60, jsxs as jsxs33 } from "react/jsx-runtime";
2189
+ function DefaultSettingsPasskey({
2190
+ triggerButton,
2191
+ removeButtons
2192
+ }) {
2193
+ const {
2194
+ formState: { isSubmitting }
2195
+ } = useFormContext8();
2196
+ const { Node } = useComponents4();
2197
+ const hasRemoveButtons = removeButtons.length > 0;
2198
+ return /* @__PURE__ */ jsxs33("div", { className: "flex flex-col gap-8", children: [
2199
+ /* @__PURE__ */ jsx60("div", { className: "flex max-w-[60%] items-end gap-3", children: triggerButton && /* @__PURE__ */ jsx60(
2200
+ Node.Button,
2201
+ {
2202
+ node: triggerButton,
2203
+ attributes: triggerButton.attributes,
2204
+ onClick: triggerButton.onClick
2205
+ }
2206
+ ) }),
2207
+ hasRemoveButtons ? /* @__PURE__ */ jsxs33("div", { className: "flex flex-col gap-8", children: [
2208
+ /* @__PURE__ */ jsx60(DefaultHorizontalDivider, {}),
2209
+ /* @__PURE__ */ jsx60("div", { className: "flex flex-col gap-2", children: removeButtons.map((node, i) => {
2210
+ var _a, _b;
2211
+ const context = (_b = (_a = node.meta.label) == null ? void 0 : _a.context) != null ? _b : {};
2212
+ const addedAt = "added_at" in context ? context.added_at : null;
2213
+ const displayName = "display_name" in context ? context.display_name : null;
2214
+ const keyId = "value" in node.attributes ? node.attributes.value : null;
2215
+ return /* @__PURE__ */ jsxs33(
2216
+ "div",
2217
+ {
2218
+ className: "flex justify-between gap-6 md:items-center",
2219
+ children: [
2220
+ /* @__PURE__ */ jsxs33("div", { className: "flex gap-2 items-center flex-1 truncate", children: [
2221
+ /* @__PURE__ */ jsx60(
2222
+ passkey_default,
2223
+ {
2224
+ size: 32,
2225
+ className: "text-interface-foreground-default-primary"
2226
+ }
2227
+ ),
2228
+ /* @__PURE__ */ jsxs33("div", { className: "flex-1 flex-col md:flex-row md:items-center flex md:justify-between gap-4 truncate", children: [
2229
+ /* @__PURE__ */ jsxs33("div", { className: "flex-1 flex-col truncate", children: [
2230
+ /* @__PURE__ */ jsx60("p", { className: "text-sm font-medium text-interface-foreground-default-secondary truncate", children: displayName }),
2231
+ /* @__PURE__ */ jsx60("span", { className: "text-sm text-interface-foreground-default-tertiary hidden sm:block truncate", children: keyId })
2232
+ ] }),
2233
+ addedAt && /* @__PURE__ */ jsx60("p", { className: "text-sm text-interface-foreground-default-tertiary", children: new Intl.DateTimeFormat(void 0, {
2234
+ dateStyle: "long"
2235
+ }).format(new Date(addedAt)) })
2236
+ ] })
2237
+ ] }),
2238
+ /* @__PURE__ */ jsx60(
2239
+ "button",
2240
+ {
2241
+ ...node.attributes,
2242
+ type: "submit",
2243
+ onClick: node.onClick,
2244
+ disabled: isSubmitting,
2245
+ className: "relative",
2246
+ children: isSubmitting ? /* @__PURE__ */ jsx60(Spinner, { className: "relative" }) : /* @__PURE__ */ jsx60(
2247
+ trash_default,
2248
+ {
2249
+ className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
2250
+ size: 24
2251
+ }
2252
+ )
2253
+ }
2254
+ )
2255
+ ]
2256
+ },
2257
+ `passkey-remove-button-${i}`
2258
+ );
2259
+ }) })
2260
+ ] }) : null
2261
+ ] });
2262
+ }
2263
+
2264
+ // src/theme/default/assets/icons/download.svg
2265
+ import * as React31 from "react";
2266
+ import { jsx as jsx61 } from "react/jsx-runtime";
2267
+ var SvgDownload = (props) => {
2268
+ var _a, _b;
2269
+ return /* @__PURE__ */ jsx61("svg", { xmlns: "http://www.w3.org/2000/svg", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, fill: "none", ...props, children: /* @__PURE__ */ jsx61("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5m0 0 5-5m-5 5V4" }) });
2270
+ };
2271
+ var download_default = SvgDownload;
2272
+
2273
+ // src/theme/default/assets/icons/refresh.svg
2274
+ import * as React32 from "react";
2275
+ import { jsx as jsx62 } from "react/jsx-runtime";
2276
+ var SvgRefresh = (props) => {
2277
+ var _a, _b;
2278
+ return /* @__PURE__ */ jsx62("svg", { xmlns: "http://www.w3.org/2000/svg", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, fill: "none", ...props, children: /* @__PURE__ */ jsx62("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4" }) });
2279
+ };
2280
+ var refresh_default = SvgRefresh;
2281
+
2282
+ // src/theme/default/components/settings/settings-recovery-codes.tsx
2283
+ import { useFormContext as useFormContext9 } from "react-hook-form";
2284
+ import { Fragment as Fragment5, jsx as jsx63, jsxs as jsxs34 } from "react/jsx-runtime";
2285
+ function DefaultSettingsRecoveryCodes({
2286
+ codes,
2287
+ regnerateButton,
2288
+ revealButton,
2289
+ onRegenerate,
2290
+ onReveal
2291
+ }) {
2292
+ const {
2293
+ formState: { isSubmitting }
2294
+ } = useFormContext9();
2295
+ const onDownload = () => {
2296
+ const element = document.createElement("a");
2297
+ const file = new Blob([codes.join("\n")], {
2298
+ type: "text/plain"
2299
+ });
2300
+ element.href = URL.createObjectURL(file);
2301
+ element.download = "recovery-codes.txt";
2302
+ document.body.appendChild(element);
2303
+ element.click();
2304
+ };
2305
+ const hasCodes = codes.length >= 1;
2306
+ return /* @__PURE__ */ jsxs34("div", { className: "flex flex-col gap-8", children: [
2307
+ codes.length > 0 && /* @__PURE__ */ jsx63(DefaultHorizontalDivider, {}),
2308
+ /* @__PURE__ */ jsxs34("div", { className: "flex gap-4 justify-between", children: [
2309
+ /* @__PURE__ */ jsx63("span", { className: "text-interface-foreground-default-tertiary", children: revealButton && "Reveal recovery codes" }),
2310
+ /* @__PURE__ */ jsxs34("div", { className: "flex gap-2", children: [
2311
+ regnerateButton && codes.length > 0 && /* @__PURE__ */ jsx63(
2312
+ "button",
2313
+ {
2314
+ ...regnerateButton.attributes,
2315
+ type: "submit",
2316
+ className: "ml-auto",
2317
+ onClick: onRegenerate,
2318
+ disabled: isSubmitting,
2319
+ "data-loading": isSubmitting,
2320
+ children: /* @__PURE__ */ jsx63(
2321
+ refresh_default,
2322
+ {
2323
+ size: 24,
2324
+ className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover"
2325
+ }
2326
+ )
2327
+ }
2328
+ ),
2329
+ revealButton && /* @__PURE__ */ jsx63(Fragment5, { children: /* @__PURE__ */ jsx63(
2330
+ "button",
2331
+ {
2332
+ ...revealButton.attributes,
2333
+ type: "submit",
2334
+ className: "ml-auto",
2335
+ onClick: onReveal,
2336
+ title: "Reveal recovery codes",
2337
+ children: /* @__PURE__ */ jsx63(
2338
+ eye_default,
2339
+ {
2340
+ size: 24,
2341
+ className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover"
2342
+ }
2343
+ )
2344
+ }
2345
+ ) }),
2346
+ hasCodes && /* @__PURE__ */ jsx63(
2347
+ "button",
2348
+ {
2349
+ onClick: onDownload,
2350
+ type: "button",
2351
+ className: "ml-auto",
2352
+ "data-testid": "ory/screen/settings/group/recovery_code/download",
2353
+ title: "Download recovery codes",
2354
+ children: /* @__PURE__ */ jsx63(
2355
+ download_default,
2356
+ {
2357
+ size: 24,
2358
+ className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover"
2359
+ }
2360
+ )
2361
+ }
2362
+ )
2363
+ ] })
2364
+ ] }),
2365
+ hasCodes ? /* @__PURE__ */ jsx63("div", { className: "rounded-general p-6 bg-interface-background-default-secondary border-interface-border-default-primary", children: /* @__PURE__ */ jsx63(
2366
+ "div",
2367
+ {
2368
+ className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 flex-wrap gap-4 text-sm text-interface-foreground-default-primary",
2369
+ "data-testid": "ory/screen/settings/group/recovery_code/codes",
2370
+ children: codes.map((code) => /* @__PURE__ */ jsx63("p", { children: code }, code))
2371
+ }
2372
+ ) }) : null
2373
+ ] });
2374
+ }
2375
+
2376
+ // src/theme/default/components/settings/settings-totp.tsx
2377
+ import { useComponents as useComponents5 } from "@ory/elements-react";
2378
+
2379
+ // src/theme/default/assets/icons/qrcode.svg
2380
+ import * as React33 from "react";
2381
+ import { jsx as jsx64 } from "react/jsx-runtime";
2382
+ var SvgQrcode = (props) => {
2383
+ var _a, _b;
2384
+ return /* @__PURE__ */ jsx64("svg", { xmlns: "http://www.w3.org/2000/svg", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, fill: "none", ...props, children: /* @__PURE__ */ jsx64("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M9.333 22.667v.013m0-13.346v.013m13.333-.013v.013m0 9.32h-4v4m8-4v.013m-8 7.987h4m0-4h4v4m-21.333-20a1.333 1.333 0 0 1 1.333-1.333H12a1.333 1.333 0 0 1 1.333 1.333V12A1.334 1.334 0 0 1 12 13.334H6.666A1.334 1.334 0 0 1 5.333 12zm13.333 0A1.333 1.333 0 0 1 20 5.334h5.333a1.333 1.333 0 0 1 1.333 1.333V12a1.333 1.333 0 0 1-1.333 1.334H20A1.333 1.333 0 0 1 18.666 12zM5.333 20a1.333 1.333 0 0 1 1.333-1.333H12A1.333 1.333 0 0 1 13.333 20v5.334A1.333 1.333 0 0 1 12 26.667H6.666a1.333 1.333 0 0 1-1.333-1.334z" }) });
2385
+ };
2386
+ var qrcode_default = SvgQrcode;
2387
+
2388
+ // src/theme/default/components/settings/settings-totp.tsx
2389
+ import { useFormContext as useFormContext10 } from "react-hook-form";
2390
+ import { jsx as jsx65, jsxs as jsxs35 } from "react/jsx-runtime";
2391
+ function DefaultSettingsTotp({
2392
+ totpImage,
2393
+ totpInput,
2394
+ totpSecret,
2395
+ totpUnlink,
2396
+ onUnlink
2397
+ }) {
2398
+ const { Node, Card } = useComponents5();
2399
+ const {
2400
+ formState: { isSubmitting }
2401
+ } = useFormContext10();
2402
+ if (totpUnlink) {
2403
+ const {
2404
+ type,
2405
+ autocomplete: _ignoredAutocomplete,
2406
+ label: _ignoredLabel,
2407
+ node_type: _ignoredNodeType,
2408
+ ...buttonAttrs
2409
+ } = totpUnlink.attributes;
2410
+ return /* @__PURE__ */ jsxs35("div", { className: "grid grid-cols-1 gap-8 md:grid-cols-2", children: [
2411
+ /* @__PURE__ */ jsx65("div", { className: "col-span-full", children: /* @__PURE__ */ jsx65(Card.Divider, {}) }),
2412
+ /* @__PURE__ */ jsxs35("div", { className: "col-span-full flex items-center gap-6", children: [
2413
+ /* @__PURE__ */ jsx65("div", { className: "aspect-square size-8 ", children: /* @__PURE__ */ jsx65(qrcode_default, { size: 32 }) }),
2414
+ /* @__PURE__ */ jsx65("div", { className: "mr-auto flex flex-col", children: /* @__PURE__ */ jsx65("p", { className: "text-sm font-medium text-interface-foreground-default-primary", children: "Authenticator app" }) }),
2415
+ /* @__PURE__ */ jsx65(
2416
+ "button",
2417
+ {
2418
+ type: type === "button" ? "button" : "submit",
2419
+ ...buttonAttrs,
2420
+ onClick: onUnlink,
2421
+ disabled: isSubmitting,
2422
+ children: isSubmitting ? /* @__PURE__ */ jsx65(Spinner, { className: "relative" }) : /* @__PURE__ */ jsx65(
2423
+ trash_default,
2424
+ {
2425
+ className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
2426
+ size: 24
2427
+ }
2428
+ )
2429
+ }
2430
+ )
2431
+ ] })
2432
+ ] });
2433
+ }
2434
+ if (totpImage && totpSecret && totpInput) {
2435
+ return /* @__PURE__ */ jsxs35("div", { className: "grid grid-cols-1 gap-8 md:grid-cols-2", children: [
2436
+ /* @__PURE__ */ jsx65("div", { className: "col-span-full", children: /* @__PURE__ */ jsx65(DefaultHorizontalDivider, {}) }),
2437
+ /* @__PURE__ */ jsx65("div", { className: "flex justify-center rounded-cards bg-interface-background-default-secondary p-8", children: /* @__PURE__ */ jsx65("div", { className: "aspect-square h-44 rounded bg-[white]", children: /* @__PURE__ */ jsx65("div", { className: "-m-3 antialiased mix-blend-multiply", children: /* @__PURE__ */ jsx65(
2438
+ Node.Image,
2439
+ {
2440
+ node: totpImage,
2441
+ attributes: {
2442
+ ...totpImage.attributes
2443
+ }
2444
+ }
2445
+ ) }) }) }),
2446
+ /* @__PURE__ */ jsxs35("div", { className: "flex flex-col gap-6", children: [
2447
+ /* @__PURE__ */ jsx65(
2448
+ Node.Label,
2449
+ {
2450
+ node: totpSecret,
2451
+ attributes: totpSecret.attributes,
2452
+ children: /* @__PURE__ */ jsx65(
2453
+ Node.Input,
2454
+ {
2455
+ node: totpSecret,
2456
+ attributes: {
2457
+ disabled: true,
2458
+ name: "totp_secret_key",
2459
+ node_type: "input",
2460
+ type: "text",
2461
+ value: totpSecret.attributes.text.text
2462
+ }
2463
+ }
2464
+ )
2465
+ }
2466
+ ),
2467
+ /* @__PURE__ */ jsx65(
2468
+ Node.Label,
2469
+ {
2470
+ attributes: totpInput.attributes,
2471
+ node: totpInput,
2472
+ children: /* @__PURE__ */ jsx65(
2473
+ Node.CodeInput,
2474
+ {
2475
+ node: totpInput,
2476
+ attributes: totpInput.attributes
2477
+ }
2478
+ )
2479
+ }
2480
+ )
2481
+ ] })
2482
+ ] });
2483
+ }
2484
+ }
2485
+
2486
+ // src/theme/default/components/settings/settings-webauthn.tsx
2487
+ import { useComponents as useComponents6 } from "@ory/elements-react";
2488
+
2489
+ // src/theme/default/assets/icons/key.svg
2490
+ import * as React34 from "react";
2491
+ import { jsx as jsx66 } from "react/jsx-runtime";
2492
+ var SvgKey = (props) => {
2493
+ var _a, _b;
2494
+ return /* @__PURE__ */ jsx66("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ jsx66("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M20 12h.013m2.06-6.876 4.803 4.803a3.836 3.836 0 0 1 0 5.425l-3.524 3.524a3.835 3.835 0 0 1-5.425 0l-.402-.401-8.744 8.744a2.67 2.67 0 0 1-1.652.77L6.896 28H5.333a1.334 1.334 0 0 1-1.324-1.177L4 26.667v-1.563c0-.626.22-1.232.623-1.712l.158-.173.552-.552H8V20h2.667v-2.667l2.858-2.858-.401-.402a3.835 3.835 0 0 1 0-5.425l3.524-3.524a3.835 3.835 0 0 1 5.425 0" }) });
2495
+ };
2496
+ var key_default = SvgKey;
2497
+
2498
+ // src/theme/default/components/settings/settings-webauthn.tsx
2499
+ import { useFormContext as useFormContext11 } from "react-hook-form";
2500
+ import { jsx as jsx67, jsxs as jsxs36 } from "react/jsx-runtime";
2501
+ function DefaultSettingsWebauthn({
2502
+ nameInput,
2503
+ triggerButton,
2504
+ removeButtons
2505
+ }) {
2506
+ const {
2507
+ formState: { isSubmitting }
2508
+ } = useFormContext11();
2509
+ const { Node, Card } = useComponents6();
2510
+ const hasRemoveButtons = removeButtons.length > 0;
2511
+ return /* @__PURE__ */ jsxs36("div", { className: "flex flex-col gap-8", children: [
2512
+ /* @__PURE__ */ jsxs36("div", { className: "flex md:max-w-96 sm:items-end gap-3 flex-col sm:flex-row", children: [
2513
+ /* @__PURE__ */ jsx67("div", { className: "flex-1", children: /* @__PURE__ */ jsx67(
2514
+ Node.Label,
2515
+ {
2516
+ node: nameInput,
2517
+ attributes: nameInput.attributes,
2518
+ children: /* @__PURE__ */ jsx67(
2519
+ Node.Input,
2520
+ {
2521
+ node: nameInput,
2522
+ attributes: nameInput.attributes
2523
+ }
2524
+ )
2525
+ }
2526
+ ) }),
2527
+ triggerButton ? /* @__PURE__ */ jsx67(
2528
+ Node.Button,
2529
+ {
2530
+ node: triggerButton,
2531
+ attributes: triggerButton.attributes,
2532
+ onClick: triggerButton.onClick
2533
+ }
2534
+ ) : null
2535
+ ] }),
2536
+ hasRemoveButtons ? /* @__PURE__ */ jsxs36("div", { className: "flex flex-col gap-8", children: [
2537
+ /* @__PURE__ */ jsx67(Card.Divider, {}),
2538
+ /* @__PURE__ */ jsx67("div", { className: "flex flex-col gap-4", children: removeButtons.map((node, i) => {
2539
+ var _a, _b;
2540
+ const context = (_b = (_a = node.meta.label) == null ? void 0 : _a.context) != null ? _b : {};
2541
+ const addedAt = "added_at" in context ? context.added_at : null;
2542
+ const displayName = "display_name" in context ? context.display_name : null;
2543
+ const keyId = "value" in node.attributes ? node.attributes.value : null;
2544
+ return /* @__PURE__ */ jsxs36(
2545
+ "div",
2546
+ {
2547
+ className: "flex justify-between gap-6 md:items-center",
2548
+ children: [
2549
+ /* @__PURE__ */ jsxs36("div", { className: "flex gap-2 items-center flex-1 truncate", children: [
2550
+ /* @__PURE__ */ jsx67(
2551
+ key_default,
2552
+ {
2553
+ size: 32,
2554
+ className: "text-interface-foreground-default-primary"
2555
+ }
2556
+ ),
2557
+ /* @__PURE__ */ jsxs36("div", { className: "flex-1 flex-col md:flex-row md:items-center flex md:justify-between gap-4 truncate", children: [
2558
+ /* @__PURE__ */ jsxs36("div", { className: "flex-1 flex-col truncate", children: [
2559
+ /* @__PURE__ */ jsx67("p", { className: "text-sm font-medium text-interface-foreground-default-secondary truncate", children: displayName }),
2560
+ /* @__PURE__ */ jsx67("span", { className: "text-sm text-interface-foreground-default-tertiary hidden sm:block truncate", children: keyId })
2561
+ ] }),
2562
+ addedAt && /* @__PURE__ */ jsx67("p", { className: "text-sm text-interface-foreground-default-tertiary", children: new Intl.DateTimeFormat(void 0, {
2563
+ dateStyle: "long"
2564
+ }).format(new Date(addedAt)) })
2565
+ ] })
2566
+ ] }),
2567
+ /* @__PURE__ */ jsx67(
2568
+ "button",
2569
+ {
2570
+ ...node.attributes,
2571
+ type: "submit",
2572
+ onClick: node.onClick,
2573
+ disabled: isSubmitting,
2574
+ className: "relative",
2575
+ children: isSubmitting ? /* @__PURE__ */ jsx67(Spinner, { className: "relative" }) : /* @__PURE__ */ jsx67(
2576
+ trash_default,
2577
+ {
2578
+ className: "text-button-link-default-secondary hover:text-button-link-default-secondary-hover",
2579
+ size: 24
2580
+ }
2581
+ )
2582
+ }
2583
+ )
2584
+ ]
2585
+ },
2586
+ `webauthn-remove-button-${i}`
2587
+ );
2588
+ }) })
2589
+ ] }) : null
2590
+ ] });
2591
+ }
2592
+
2593
+ // src/theme/default/components/card/auth-method-list-container.tsx
2594
+ import { jsx as jsx68 } from "react/jsx-runtime";
2595
+ function DefaultAuthMethodListContainer({
2596
+ children
2597
+ }) {
2598
+ return /* @__PURE__ */ jsx68("div", { className: "grid grid-cols-1 gap-2", children });
2599
+ }
2600
+
2601
+ // src/theme/default/components/form/captcha.tsx
2602
+ import { isUiNodeInputAttributes as isUiNodeInputAttributes3 } from "@ory/client-fetch";
2603
+ import { Turnstile } from "@marsidev/react-turnstile";
2604
+ import { useRef as useRef2 } from "react";
2605
+ import { useFormContext as useFormContext12 } from "react-hook-form";
2606
+ import { jsx as jsx69 } from "react/jsx-runtime";
2607
+ var DefaultCaptcha = ({ node }) => {
2608
+ const { setValue } = useFormContext12();
2609
+ const ref = useRef2();
2610
+ const nodes = [];
2611
+ if (isUiNodeInputAttributes3(node.attributes)) {
2612
+ if (node.attributes.name === "transient_payload.captcha_turnstile_response") {
2613
+ nodes.push(
2614
+ /* @__PURE__ */ jsx69(DefaultInput, { node, attributes: node.attributes }, 1)
2615
+ );
2616
+ }
2617
+ }
2618
+ if (isUiNodeInputAttributes3(node.attributes) && node.attributes.name === "captcha_turnstile_options") {
2619
+ const options = JSON.parse(node.attributes.value);
2620
+ nodes.push(
2621
+ /* @__PURE__ */ jsx69(
2622
+ Turnstile,
2623
+ {
2624
+ ref,
2625
+ siteKey: options.sitekey,
2626
+ options: {
2627
+ action: options.action,
2628
+ size: "flexible",
2629
+ theme: options.theme,
2630
+ responseField: false,
2631
+ responseFieldName: options.response_field_name
2632
+ },
2633
+ onExpire: () => {
2634
+ var _a;
2635
+ return (_a = ref.current) == null ? void 0 : _a.reset();
2636
+ },
2637
+ onSuccess: (token) => {
2638
+ setValue(options.response_field_name, token);
2639
+ }
2640
+ },
2641
+ 2
2642
+ )
2643
+ );
2644
+ }
2645
+ return nodes;
2646
+ };
2647
+
2648
+ // src/theme/default/components/default-components.tsx
2649
+ function getOryComponents(overrides) {
2650
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja;
2651
+ return {
2652
+ Card: {
2653
+ Root: (_b = (_a = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _a.Root) != null ? _b : DefaultCard,
2654
+ Footer: (_d = (_c = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _c.Footer) != null ? _d : DefaultCardFooter,
2655
+ Header: (_f = (_e = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _e.Header) != null ? _f : DefaultCardHeader,
2656
+ Content: (_h = (_g = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _g.Content) != null ? _h : DefaultCardContent,
2657
+ Logo: (_j = (_i = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _i.Logo) != null ? _j : DefaultCardLogo,
2658
+ Divider: (_l = (_k = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _k.Divider) != null ? _l : DefaultHorizontalDivider,
2659
+ AuthMethodListContainer: (_n = (_m = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _m.AuthMethodListContainer) != null ? _n : DefaultAuthMethodListContainer,
2660
+ AuthMethodListItem: (_p = (_o = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _o.AuthMethodListItem) != null ? _p : DefaultAuthMethodListItem,
2661
+ SettingsSection: (_r = (_q = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _q.SettingsSection) != null ? _r : DefaultFormSection,
2662
+ SettingsSectionContent: (_t = (_s = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _s.SettingsSectionContent) != null ? _t : DefaultFormSectionContent,
2663
+ SettingsSectionFooter: (_v = (_u = overrides == null ? void 0 : overrides.Card) == null ? void 0 : _u.SettingsSectionFooter) != null ? _v : DefaultFormSectionFooter
2664
+ },
2665
+ Node: {
2666
+ Button: (_x = (_w = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _w.Button) != null ? _x : DefaultButton,
2667
+ OidcButton: (_z = (_y = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _y.OidcButton) != null ? _z : DefaultButtonSocial,
2668
+ Input: (_B = (_A = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _A.Input) != null ? _B : DefaultInput,
2669
+ CodeInput: (_D = (_C = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _C.CodeInput) != null ? _D : DefaultPinCodeInput,
2670
+ Image: (_F = (_E = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _E.Image) != null ? _F : DefaultImage,
2671
+ Label: (_H = (_G = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _G.Label) != null ? _H : DefaultLabel,
2672
+ Checkbox: (_J = (_I = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _I.Checkbox) != null ? _J : DefaultCheckbox,
2673
+ Text: (_L = (_K = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _K.Text) != null ? _L : DefaultText,
2674
+ Anchor: (_N = (_M = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _M.Anchor) != null ? _N : DefaultLinkButton,
2675
+ Captcha: (_P = (_O = overrides == null ? void 0 : overrides.Node) == null ? void 0 : _O.Captcha) != null ? _P : DefaultCaptcha
2676
+ },
2677
+ Form: {
2678
+ Root: (_R = (_Q = overrides == null ? void 0 : overrides.Form) == null ? void 0 : _Q.Root) != null ? _R : DefaultFormContainer,
2679
+ Group: (_T = (_S = overrides == null ? void 0 : overrides.Form) == null ? void 0 : _S.Group) != null ? _T : DefaultGroupContainer,
2680
+ OidcRoot: (_V = (_U = overrides == null ? void 0 : overrides.Form) == null ? void 0 : _U.OidcRoot) != null ? _V : DefaultSocialButtonContainer,
2681
+ RecoveryCodesSettings: (_X = (_W = overrides == null ? void 0 : overrides.Form) == null ? void 0 : _W.RecoveryCodesSettings) != null ? _X : DefaultSettingsRecoveryCodes,
2682
+ TotpSettings: (_Z = (_Y = overrides == null ? void 0 : overrides.Form) == null ? void 0 : _Y.TotpSettings) != null ? _Z : DefaultSettingsTotp,
2683
+ OidcSettings: (_$ = (__ = overrides == null ? void 0 : overrides.Form) == null ? void 0 : __.OidcSettings) != null ? _$ : DefaultSettingsOidc,
2684
+ WebauthnSettings: (_ba = (_aa = overrides == null ? void 0 : overrides.Form) == null ? void 0 : _aa.WebauthnSettings) != null ? _ba : DefaultSettingsWebauthn,
2685
+ PasskeySettings: (_da = (_ca = overrides == null ? void 0 : overrides.Form) == null ? void 0 : _ca.PasskeySettings) != null ? _da : DefaultSettingsPasskey
2686
+ },
2687
+ Message: {
2688
+ Root: (_fa = (_ea = overrides == null ? void 0 : overrides.Message) == null ? void 0 : _ea.Root) != null ? _fa : DefaultMessageContainer,
2689
+ Content: (_ha = (_ga = overrides == null ? void 0 : overrides.Message) == null ? void 0 : _ga.Content) != null ? _ha : DefaultMessage
2690
+ },
2691
+ Page: {
2692
+ Header: (_ja = (_ia = overrides == null ? void 0 : overrides.Page) == null ? void 0 : _ia.Header) != null ? _ja : DefaultPageHeader
2693
+ }
2694
+ };
2695
+ }
2696
+
2697
+ // src/theme/default/flows/error.tsx
2698
+ import { jsx as jsx70 } from "react/jsx-runtime";
2699
+ function Error2({
2700
+ error,
2701
+ children
2702
+ }) {
2703
+ return /* @__PURE__ */ jsx70("div", { "data-testid": "ory/screen/error/raw", children: JSON.stringify(error) || children });
2704
+ }
2705
+
2706
+ // src/theme/default/flows/login.tsx
2707
+ import { FlowType as FlowType8 } from "@ory/client-fetch";
2708
+ import {
2709
+ OryProvider,
2710
+ OryTwoStepCard
2711
+ } from "@ory/elements-react";
2712
+ import { jsx as jsx71 } from "react/jsx-runtime";
2713
+ function Login({
2714
+ flow,
2715
+ config,
2716
+ children,
2717
+ components: flowOverrideComponents
2718
+ }) {
2719
+ const components = getOryComponents(flowOverrideComponents);
2720
+ return /* @__PURE__ */ jsx71(
2721
+ OryProvider,
2722
+ {
2723
+ config,
2724
+ flow,
2725
+ flowType: FlowType8.Login,
2726
+ components,
2727
+ children: children != null ? children : /* @__PURE__ */ jsx71(OryTwoStepCard, {})
2728
+ }
2729
+ );
2730
+ }
2731
+
2732
+ // src/theme/default/flows/recovery.tsx
2733
+ import { FlowType as FlowType9 } from "@ory/client-fetch";
2734
+ import {
2735
+ OryProvider as OryProvider2,
2736
+ OryTwoStepCard as OryTwoStepCard2
2737
+ } from "@ory/elements-react";
2738
+ import { jsx as jsx72 } from "react/jsx-runtime";
2739
+ function Recovery({
2740
+ flow,
2741
+ config,
2742
+ children,
2743
+ components: flowOverrideComponents
2744
+ }) {
2745
+ const components = getOryComponents(flowOverrideComponents);
2746
+ return /* @__PURE__ */ jsx72(
2747
+ OryProvider2,
2748
+ {
2749
+ config,
2750
+ flow,
2751
+ flowType: FlowType9.Recovery,
2752
+ components,
2753
+ children: children != null ? children : /* @__PURE__ */ jsx72(OryTwoStepCard2, {})
2754
+ }
2755
+ );
2756
+ }
2757
+
2758
+ // src/theme/default/flows/registration.tsx
2759
+ import { FlowType as FlowType10 } from "@ory/client-fetch";
2760
+ import {
2761
+ OryProvider as OryProvider3,
2762
+ OryTwoStepCard as OryTwoStepCard3
2763
+ } from "@ory/elements-react";
2764
+ import { jsx as jsx73 } from "react/jsx-runtime";
2765
+ function Registration({
2766
+ flow,
2767
+ children,
2768
+ components: flowOverrideComponents,
2769
+ config
2770
+ }) {
2771
+ const components = getOryComponents(flowOverrideComponents);
2772
+ return /* @__PURE__ */ jsx73(
2773
+ OryProvider3,
2774
+ {
2775
+ config,
2776
+ flow,
2777
+ flowType: FlowType10.Registration,
2778
+ components,
2779
+ children: children != null ? children : /* @__PURE__ */ jsx73(OryTwoStepCard3, {})
2780
+ }
2781
+ );
2782
+ }
2783
+
2784
+ // src/theme/default/flows/settings.tsx
2785
+ import { FlowType as FlowType11 } from "@ory/client-fetch";
2786
+ import {
2787
+ HeadlessPageHeader,
2788
+ OryProvider as OryProvider4,
2789
+ OrySettingsCard
2790
+ } from "@ory/elements-react";
2791
+ import { Fragment as Fragment6, jsx as jsx74, jsxs as jsxs37 } from "react/jsx-runtime";
2792
+ function Settings({
2793
+ flow,
2794
+ config,
2795
+ children,
2796
+ components: flowOverrideComponents
2797
+ }) {
2798
+ const components = getOryComponents(flowOverrideComponents);
2799
+ return /* @__PURE__ */ jsx74(
2800
+ OryProvider4,
2801
+ {
2802
+ config,
2803
+ flow,
2804
+ flowType: FlowType11.Settings,
2805
+ components,
2806
+ children: children != null ? children : /* @__PURE__ */ jsxs37(Fragment6, { children: [
2807
+ /* @__PURE__ */ jsx74(HeadlessPageHeader, {}),
2808
+ /* @__PURE__ */ jsx74(OrySettingsCard, {})
2809
+ ] })
2810
+ }
2811
+ );
2812
+ }
2813
+
2814
+ // src/theme/default/flows/verification.tsx
2815
+ import { FlowType as FlowType12 } from "@ory/client-fetch";
2816
+ import {
2817
+ OryProvider as OryProvider5,
2818
+ OryTwoStepCard as OryTwoStepCard4
2819
+ } from "@ory/elements-react";
2820
+ import { jsx as jsx75 } from "react/jsx-runtime";
2821
+ function Verification({
2822
+ flow,
2823
+ config,
2824
+ children,
2825
+ components: flowOverrideComponents
2826
+ }) {
2827
+ const components = getOryComponents(flowOverrideComponents);
2828
+ return /* @__PURE__ */ jsx75(
2829
+ OryProvider5,
2830
+ {
2831
+ config,
2832
+ flow,
2833
+ flowType: FlowType12.Verification,
2834
+ components,
2835
+ children: children != null ? children : /* @__PURE__ */ jsx75(OryTwoStepCard4, {})
2836
+ }
2837
+ );
2838
+ }
2839
+ export {
2840
+ DefaultButtonSocial,
2841
+ DefaultCard,
2842
+ DefaultCardContent,
2843
+ DefaultCardFooter,
2844
+ DefaultCardHeader,
2845
+ DefaultCardLayout,
2846
+ DefaultCardLogo,
2847
+ DefaultCurrentIdentifierButton,
2848
+ DefaultFormContainer,
2849
+ DefaultMessage,
2850
+ DefaultMessageContainer,
2851
+ Error2 as Error,
2852
+ Login,
2853
+ Recovery,
2854
+ Registration,
2855
+ Settings,
2856
+ Verification,
2857
+ getOryComponents
2858
+ };
2859
+ //# sourceMappingURL=index.mjs.map