@ory/elements-react 1.0.0-next.31 → 1.0.0-next.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/DEVELOPMENT.md +0 -2
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +215 -73
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +215 -73
- package/dist/index.mjs.map +1 -1
- package/dist/theme/default/index.css +17 -0
- package/dist/theme/default/index.css.map +1 -1
- package/dist/theme/default/index.js +743 -553
- package/dist/theme/default/index.js.map +1 -1
- package/dist/theme/default/index.mjs +702 -511
- package/dist/theme/default/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/theme/default/assets/ory-badge-horizontal.svg","../../../src/theme/default/assets/ory-badge-vertical.svg","../../../src/theme/default/components/card/badge.tsx","../../../src/theme/default/components/card/content.tsx","../../../src/theme/default/components/card/footer.tsx","../../../src/theme/default/utils/url.ts","../../../src/theme/default/components/card/header.tsx","../../../src/theme/default/utils/constructCardHeader.ts","../../../src/theme/default/components/card/current-identifier-button.tsx","../../../src/theme/default/assets/icons/arrow-left.svg","../../../src/theme/default/utils/attributes.ts","../../../src/theme/default/components/card/logo.tsx","../../../src/theme/default/components/card/layout.tsx","../../../src/theme/default/components/card/index.tsx","../../../src/theme/default/utils/cn.ts","../../../src/theme/default/components/form/index.tsx","../../../src/theme/default/components/form/social.tsx","../../../src/theme/default/provider-logos/apple.svg","../../../src/theme/default/provider-logos/auth0.svg","../../../src/theme/default/provider-logos/discord.svg","../../../src/theme/default/provider-logos/facebook.svg","../../../src/theme/default/provider-logos/generic.svg","../../../src/theme/default/provider-logos/github.svg","../../../src/theme/default/provider-logos/gitlab.svg","../../../src/theme/default/provider-logos/google.svg","../../../src/theme/default/provider-logos/linkedin.svg","../../../src/theme/default/provider-logos/microsoft.svg","../../../src/theme/default/provider-logos/slack.svg","../../../src/theme/default/provider-logos/spotify.svg","../../../src/theme/default/provider-logos/yandex.svg","../../../src/theme/default/provider-logos/x.svg","../../../src/theme/default/provider-logos/index.ts","../../../src/theme/default/components/form/spinner.tsx","../../../src/theme/default/components/card/auth-method-list-item.tsx","../../../src/theme/default/assets/icons/code.svg","../../../src/theme/default/assets/icons/passkey.svg","../../../src/theme/default/assets/icons/password.svg","../../../src/theme/default/assets/icons/webauthn.svg","../../../src/theme/default/utils/form.ts","../../../src/theme/default/components/form/button.tsx","../../../src/theme/default/components/form/checkbox.tsx","../../../src/theme/default/components/ui/checkbox-label.tsx","../../../src/util/i18n/index.ts","../../../src/theme/default/components/form/group-container.tsx","../../../src/theme/default/components/form/horizontal-divider.tsx","../../../src/theme/default/components/form/image.tsx","../../../src/theme/default/components/form/input.tsx","../../../src/theme/default/components/form/label.tsx","../../../src/theme/default/components/form/link-button.tsx","../../../src/theme/default/components/form/pin-code-input.tsx","../../../src/theme/default/components/form/shadcn/otp-input.tsx","../../../src/theme/default/components/form/section.tsx","../../../src/theme/default/components/form/text.tsx","../../../src/theme/default/components/generic/page-header.tsx","../../../src/theme/default/components/ui/user-menu.tsx","../../../src/util/client.ts","../../../src/theme/default/assets/icons/logout.svg","../../../src/theme/default/assets/icons/settings.svg","../../../src/theme/default/utils/user.ts","../../../src/theme/default/components/ui/dropdown-menu.tsx","../../../src/theme/default/components/ui/user-avater.tsx","../../../src/theme/default/assets/icons/user.svg","../../../src/theme/default/components/settings/settings-oidc.tsx","../../../src/theme/default/assets/icons/trash.svg","../../../src/theme/default/components/settings/settings-passkey.tsx","../../../src/theme/default/assets/icons/download.svg","../../../src/theme/default/assets/icons/eye.svg","../../../src/theme/default/assets/icons/refresh.svg","../../../src/theme/default/components/settings/settings-recovery-codes.tsx","../../../src/theme/default/components/settings/settings-totp.tsx","../../../src/theme/default/assets/icons/qrcode.svg","../../../src/theme/default/components/settings/settings-webauthn.tsx","../../../src/theme/default/assets/icons/key.svg","../../../src/theme/default/components/card/auth-method-list-container.tsx","../../../src/theme/default/components/form/captcha.tsx","../../../src/context/component.tsx","../../../src/context/flow-context.tsx","../../../src/context/form-state.ts","../../../src/components/card/card-two-step.utils.ts","../../../src/util/ui/index.ts","../../../src/context/intl-context.tsx","../../../src/components/card/header.tsx","../../../src/components/form/form-provider.tsx","../../../src/components/form/form-helpers.ts","../../../src/components/form/form-resolver.ts","../../../src/components/card/card.tsx","../../../src/components/card/footer.tsx","../../../src/components/card/content.tsx","../../../src/components/card/card-two-step.tsx","../../../src/components/form/form.tsx","../../../src/components/form/useOryFormSubmit.ts","../../../src/util/onSubmitLogin.ts","../../../src/util/onSubmitRecovery.ts","../../../src/util/onSubmitRegistration.ts","../../../src/util/onSubmitSettings.ts","../../../src/util/onSubmitVerification.ts","../../../src/components/form/messages.tsx","../../../src/components/form/nodes/node.tsx","../../../src/components/form/social.tsx","../../../src/components/form/groups.tsx","../../../src/components/form/section.tsx","../../../src/components/generic/divider.tsx","../../../src/components/generic/page-header.tsx","../../../src/components/settings/settings-card.tsx","../../../src/components/settings/oidc-settings.tsx","../../../src/components/settings/passkey-settings.tsx","../../../src/components/settings/recovery-codes-settings.tsx","../../../src/components/settings/totp-settings.tsx","../../../src/components/settings/webauthn-settings.tsx","../../../src/context/provider.tsx","../../../src/components/form/nodes/input.tsx","../../../src/theme/default/components/default-components.tsx","../../../src/theme/default/flows/error.tsx","../../../src/theme/default/flows/login.tsx","../../../src/theme/default/flows/recovery.tsx","../../../src/theme/default/flows/registration.tsx","../../../src/theme/default/flows/settings.tsx","../../../src/theme/default/flows/verification.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgOryBadgeHorizontal = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} fill=\"none\" {...props}><path fill=\"#0F172A\" d=\"M18.007 8h-1.71l2.007-3.996L16.296 0h1.711l1.145 2.301L20.327 0H22z\" /><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\" /></svg>;\nexport default SvgOryBadgeHorizontal;","import * as React from \"react\";\nconst SvgOryBadgeVertical = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} fill=\"none\" {...props}><path fill=\"#0F172A\" d=\"M8 3.993v1.71L4.004 3.697 0 5.704V3.993l2.301-1.145L0 1.673V0z\" /><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\" /></svg>;\nexport default SvgOryBadgeVertical;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport OryLogoHorizontal from \"../../assets/ory-badge-horizontal.svg\"\nimport OryLogoVertical from \"../../assets/ory-badge-vertical.svg\"\n\nexport function Badge() {\n return (\n <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]\">\n <OryLogoHorizontal width={22} height={8} className=\"sm:hidden\" />\n <OryLogoVertical width={8} height={22} className=\"max-sm:hidden\" />\n </div>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { OryCardContentProps } from \"@ory/elements-react\"\n\nexport function DefaultCardContent({ children }: OryCardContentProps) {\n return children\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { FlowType, UiNode, UiNodeInputAttributes } from \"@ory/client-fetch\"\nimport { useOryFlow } from \"@ory/elements-react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { initFlowUrl } from \"../../utils/url\"\n\nexport function DefaultCardFooter() {\n const { flowType } = useOryFlow()\n switch (flowType) {\n case FlowType.Login:\n return <LoginCardFooter />\n case FlowType.Registration:\n return <RegistrationCardFooter />\n case FlowType.Recovery:\n return <RecoveryCardFooter />\n case FlowType.Verification:\n return <VerificationCardFooter />\n default:\n return null\n }\n}\n\nexport function getReturnToQueryParam(flow: { return_to?: string }) {\n if (flow.return_to) {\n return flow.return_to\n }\n if (typeof window !== \"undefined\") {\n const searchParams = new URLSearchParams(window.location.search)\n return searchParams.get(\"return_to\")\n }\n}\n\nfunction LoginCardFooter() {\n const { config, formState, flow } = useOryFlow()\n const intl = useIntl()\n\n if (\n !config.project.registration_enabled ||\n formState.current !== \"provide_identifier\"\n ) {\n // The two-step login flow does not support the \"navigation\" between steps, so we don't have\n // anything to render on the footer in those steps\n return null\n }\n\n return (\n <span className=\"font-normal leading-normal antialiased text-interface-foreground-default-primary\">\n {intl.formatMessage({\n id: \"login.registration-label\",\n defaultMessage: \"No account?\",\n })}{\" \"}\n <a\n className=\"text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline\"\n href={initFlowUrl(config.sdk.url, \"registration\", flow)}\n data-testid={\"ory/screen/registration/action/login\"}\n >\n {intl.formatMessage({\n id: \"login.registration-button\",\n defaultMessage: \"Sign up\",\n })}\n </a>\n </span>\n )\n}\n\nfunction findScreenSelectionButton(\n nodes: UiNode[],\n): { attributes: UiNodeInputAttributes } | undefined {\n return nodes.find(\n (node) =>\n node.attributes.node_type === \"input\" &&\n node.attributes.type === \"submit\" &&\n node.attributes.name === \"screen\",\n ) as { attributes: UiNodeInputAttributes }\n}\n\nfunction RegistrationCardFooter() {\n const intl = useIntl()\n const { config, flow, formState } = useOryFlow()\n const { setValue } = useFormContext()\n\n if (formState.current === \"select_method\") {\n return null\n }\n const screenSelectionNode = findScreenSelectionButton(flow.ui.nodes)\n\n function handleScreenSelection() {\n setValue(\"method\", \"profile\")\n if (screenSelectionNode) {\n setValue(\n screenSelectionNode.attributes.name,\n screenSelectionNode.attributes.value,\n )\n }\n }\n\n return (\n <span className=\"font-normal leading-normal antialiased\">\n {formState.current === \"method_active\" ? (\n <>\n {screenSelectionNode && (\n <button\n className=\"font-medium text-button-link-brand-brand hover:text-button-link-brand-brand-hover\"\n type=\"submit\"\n name={screenSelectionNode.attributes.name}\n value={screenSelectionNode.attributes.value}\n onClick={handleScreenSelection}\n >\n {intl.formatMessage({\n id: \"card.footer.select-another-method\",\n defaultMessage: \"Select another method\",\n })}\n </button>\n )}\n </>\n ) : (\n <>\n {intl.formatMessage({\n id: \"registration.login-label\",\n defaultMessage: \"Already have an account?\",\n })}{\" \"}\n <a\n className=\"text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline\"\n href={initFlowUrl(config.sdk.url, \"login\", flow)}\n data-testid={\"ory/screen/registration/action/login\"}\n >\n {intl.formatMessage({\n id: \"registration.login-button\",\n defaultMessage: \"Sign in\",\n })}\n </a>\n </>\n )}\n </span>\n )\n}\n\nfunction RecoveryCardFooter() {\n return null\n}\n\nfunction VerificationCardFooter() {\n return null\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nexport function restartFlowUrl(\n flow: { request_url?: string; return_to?: string },\n fallback: string,\n) {\n return flow.request_url || appendReturnTo(fallback, flow.return_to)\n}\n\nexport function initFlowUrl(\n sdkUrl: string,\n flowType: string,\n flow: {\n return_to?: string\n oauth2_login_challenge?: string\n },\n) {\n const result = `${sdkUrl}/self-service/${flowType}/browser`\n const qs = new URLSearchParams()\n\n if (flow.oauth2_login_challenge) {\n qs.set(\"login_challenge\", flow.oauth2_login_challenge)\n }\n if (flow.return_to) {\n qs.set(\"return_to\", flow.return_to)\n } else if (typeof window !== \"undefined\") {\n const searchParams = new URLSearchParams(window.location.search)\n if (searchParams.has(\"return_to\")) {\n qs.set(\"return_to\", searchParams.get(\"return_to\") || \"\")\n }\n }\n\n if (qs.toString().length === 0) {\n return result\n }\n\n return result + \"?\" + qs.toString()\n}\n\nfunction appendReturnTo(url: string, returnTo?: string) {\n if (!returnTo) {\n return url\n }\n\n const urlObj = new URL(url)\n urlObj.searchParams.set(\"return_to\", returnTo)\n return urlObj.toString()\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useComponents, useOryFlow } from \"@ory/elements-react\"\nimport { useCardHeaderText } from \"../../utils/constructCardHeader\"\nimport { DefaultCurrentIdentifierButton } from \"./current-identifier-button\"\n\nfunction InnerCardHeader({ title, text }: { title: string; text?: string }) {\n const { Card } = useComponents()\n return (\n <header className=\"flex flex-col gap-8 antialiased\">\n <Card.Logo />\n <div className=\"flex flex-col gap-2\">\n <h2 className=\"text-lg font-semibold leading-normal text-interface-foreground-default-primary\">\n {title}\n </h2>\n <p className=\"leading-normal text-interface-foreground-default-secondary\">\n {text}\n </p>\n <DefaultCurrentIdentifierButton />\n </div>\n </header>\n )\n}\n\nexport function DefaultCardHeader() {\n const context = useOryFlow()\n const { title, description } = useCardHeaderText(context.flow.ui, context)\n\n return <InnerCardHeader title={title} text={description} />\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowType,\n isUiNodeInputAttributes,\n UiContainer,\n} from \"@ory/client-fetch\"\nimport { useIntl } from \"react-intl\"\n\nfunction joinWithCommaOr(list: string[], orText = \"or\"): string {\n if (list.length === 0) {\n return \".\"\n } else if (list.length === 1) {\n return list[0]\n } else {\n const last = list.pop()\n return `${list.join(\", \")} ${orText} ${last}`\n }\n}\n\ntype opts =\n | {\n flowType: FlowType.Login\n flow: {\n refresh?: boolean\n }\n }\n | {\n flowType:\n | FlowType.Error\n | FlowType.Registration\n | FlowType.Verification\n | FlowType.Recovery\n | FlowType.Settings\n }\n\n/**\n * Constructs a title and a description for the card header.\n *\n * The title is a title suitable for the current flow, e.g. \"Sign in\" or \"Update your account\".\n *\n * The description for a login & registration flow, is a collection of the labels of the input fields.\n * For example, if the user has a password and an email address, the description will be \"Sign in with your email and password\".\n * And for registration, the listed options depend on the project configuration.\n *\n * For verification, recovery and settings flows, the description is a generic one, e.g. \"Enter the email address associated with your account to verify it\".\n *\n *\n * @param nodes - the UI nodes of the current flow\n * @param opts - can be a flow object, only needed for the refresh login flow\n * @returns a title and a description for the card header\n */\nexport function useCardHeaderText(\n container: UiContainer,\n opts: opts,\n): { title: string; description: string } {\n const nodes = container.nodes\n const intl = useIntl()\n switch (opts.flowType) {\n case FlowType.Recovery:\n if (\n nodes.find(\n (node) =>\n \"name\" in node.attributes && node.attributes.name === \"code\",\n )\n ) {\n return {\n title: intl.formatMessage({\n id: \"recovery.title\",\n }),\n description: intl.formatMessage({\n id: \"identities.messages.1060003\",\n }),\n }\n }\n return {\n title: intl.formatMessage({\n id: \"recovery.title\",\n }),\n description: intl.formatMessage({\n id: \"recovery.subtitle\",\n }),\n }\n case FlowType.Settings:\n return {\n title: intl.formatMessage({\n id: \"settings.title\",\n }),\n description: intl.formatMessage({\n id: \"settings.subtitle\",\n }),\n }\n case FlowType.Verification:\n if (\n nodes.find(\n (node) =>\n \"name\" in node.attributes && node.attributes.name === \"code\",\n )\n ) {\n return {\n title: intl.formatMessage({\n id: \"verification.title\",\n }),\n description: intl.formatMessage({\n id: \"identities.messages.1080003\",\n }),\n }\n }\n return {\n title: intl.formatMessage({\n id: \"verification.title\",\n }),\n description: intl.formatMessage({\n id: \"verification.subtitle\",\n }),\n }\n case FlowType.Login: {\n // account linking\n const accountLinkingMessage = container.messages?.find(\n (m) => m.id === 1010016,\n )\n if (accountLinkingMessage) {\n return {\n title: intl.formatMessage({\n id: \"account-linking.title\",\n }),\n description: intl.formatMessage(\n {\n id: \"identities.messages.1010016\",\n },\n accountLinkingMessage.context as Record<string, string>,\n ),\n }\n }\n }\n }\n\n const parts = []\n\n if (nodes.find((node) => node.group === \"password\")) {\n switch (opts.flowType) {\n case FlowType.Registration:\n parts.push(\n intl.formatMessage(\n { id: \"card.header.parts.password.registration\" },\n // TODO: make this generic for other labels\n { identifierLabel: \"email\" },\n ),\n )\n break\n default:\n parts.push(\n intl.formatMessage(\n { id: \"card.header.parts.password.login\" },\n // TODO: make this generic for other labels\n { identifierLabel: \"email\" },\n ),\n )\n }\n }\n\n if (nodes.find((node) => node.group === \"oidc\")) {\n parts.push(\n intl.formatMessage({\n id: \"card.header.parts.oidc\",\n }),\n )\n }\n\n if (nodes.find((node) => node.group === \"code\")) {\n parts.push(intl.formatMessage({ id: \"card.header.parts.code\" }))\n }\n\n if (nodes.find((node) => node.group === \"passkey\")) {\n parts.push(intl.formatMessage({ id: \"card.header.parts.passkey\" }))\n }\n\n if (nodes.find((node) => node.group === \"webauthn\")) {\n parts.push(intl.formatMessage({ id: \"card.header.parts.webauthn\" }))\n }\n\n if (nodes.find((node) => node.group === \"identifier_first\")) {\n const identifier = nodes.find(\n (node) =>\n isUiNodeInputAttributes(node.attributes) &&\n node.attributes.name.startsWith(\"identifier\") &&\n node.attributes.type !== \"hidden\",\n )\n\n if (identifier) {\n parts.push(\n intl.formatMessage(\n {\n id: \"card.header.parts.identifier-first\",\n },\n {\n identifierLabel: identifier.meta.label?.text,\n },\n ),\n )\n }\n }\n\n switch (opts.flowType) {\n case FlowType.Login:\n if (opts.flow.refresh) {\n return {\n title: intl.formatMessage({\n id: \"login.title-refresh\",\n }),\n description: intl.formatMessage(\n {\n id: \"login.subtitle-refresh\",\n },\n {\n parts: joinWithCommaOr(parts),\n },\n ),\n }\n }\n return {\n title: intl.formatMessage({\n id: \"login.title\",\n }),\n description:\n parts.length > 0\n ? intl.formatMessage(\n {\n id: \"login.subtitle\",\n },\n {\n parts: joinWithCommaOr(\n parts,\n intl.formatMessage({ id: \"misc.or\" }),\n ),\n },\n )\n : \"\",\n }\n case FlowType.Registration:\n return {\n title: intl.formatMessage({\n id: \"registration.title\",\n }),\n description:\n parts.length > 0\n ? intl.formatMessage(\n {\n id: \"registration.subtitle\",\n },\n {\n parts: joinWithCommaOr(\n parts,\n intl.formatMessage({ id: \"misc.or\" }),\n ),\n },\n )\n : \"\",\n }\n }\n\n // TODO: This should not happen, as the switch is exhaustive, but typescript doesn't think so\n return {\n title: \"Error\",\n description: \"An error occurred\",\n }\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { FlowType, UiNode } from \"@ory/client-fetch\"\nimport { useOryFlow } from \"@ory/elements-react\"\nimport IconArrowLeft from \"../../assets/icons/arrow-left.svg\"\nimport { omit } from \"../../utils/attributes\"\nimport { restartFlowUrl } from \"../../utils/url\"\n\nexport function DefaultCurrentIdentifierButton() {\n const { flow, flowType, config, formState } = useOryFlow()\n const ui = flow.ui\n\n if (formState.current === \"provide_identifier\") {\n return null\n }\n\n const nodeBackButton = getBackButtonNode(flowType, ui.nodes)\n\n if (\n nodeBackButton?.attributes.node_type !== \"input\" ||\n !nodeBackButton.attributes.value\n ) {\n return null\n }\n\n const initFlowUrl = restartFlowUrl(\n flow,\n `${config.sdk.url}/self-service/${flowType}/browser`,\n )\n\n const attributes = omit(nodeBackButton.attributes, [\n \"autocomplete\",\n \"node_type\",\n \"maxlength\",\n ])\n\n return (\n <a\n className={\n \"group inline-flex max-w-full cursor-pointer items-center gap-1 self-start rounded-identifier border px-[11px] py-[5px] transition-colors \" +\n \"border-button-identifier-border-border-default bg-button-identifier-background-default hover:border-button-identifier-border-border-hover hover:bg-button-identifier-background-hover\"\n }\n {...attributes}\n href={initFlowUrl}\n title={`Adjust ${nodeBackButton?.attributes.value}`}\n data-testid={\"ory/screen/login/action/restart\"}\n >\n <span className=\"inline-flex min-h-5 items-center gap-2 overflow-hidden text-ellipsis\">\n <IconArrowLeft\n size={16}\n stroke=\"1\"\n className=\"shrink-0 text-button-identifier-foreground-default group-hover:text-button-identifier-foreground-hover\"\n />\n <span className=\"overflow-hidden text-ellipsis text-nowrap text-sm font-medium text-button-identifier-foreground-default group-hover:text-button-identifier-foreground-hover\">\n {nodeBackButton?.attributes.value}\n </span>\n </span>\n </a>\n )\n}\n\nexport function getBackButtonNode(\n flowType: FlowType,\n nodes: UiNode[],\n): UiNode | undefined {\n let nodeBackButton: UiNode | undefined\n switch (flowType) {\n case FlowType.Login:\n nodeBackButton = nodes.find(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"identifier\" &&\n [\"default\", \"identifier_first\"].includes(node.group),\n )\n break\n case FlowType.Registration:\n nodeBackButton = guessRegistrationBackButton(nodes)\n break\n case FlowType.Recovery:\n case FlowType.Verification:\n // Re-use the email node for displaying the email\n nodeBackButton = nodes.find(\n (n) => \"name\" in n.attributes && n.attributes.name === \"email\",\n )\n break\n }\n return nodeBackButton\n}\n\nconst backButtonCandiates = [\n \"traits.email\",\n \"traits.username\",\n \"traits.phone_number\",\n]\n/**\n * Guesses the back button for registration flows\n *\n * This is based on the list above, and the first node that matches the criteria is returned.\n *\n * The list is most likely not exhaustive yet, and may need to be updated in the future.\n *\n */\nfunction guessRegistrationBackButton(uiNodes: UiNode[]): UiNode | undefined {\n return uiNodes.find(\n (node) =>\n \"name\" in node.attributes &&\n backButtonCandiates.includes(node.attributes.name) &&\n node.group === \"default\",\n )\n}\n","import * as React from \"react\";\nconst SvgArrowLeft = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 25\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><path stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 12.325h14m-14 0 6 6m-6-6 6-6\" /></svg>;\nexport default SvgArrowLeft;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nexport function omit<OBJ extends object>(\n obj: OBJ,\n keys: (keyof OBJ)[],\n): Omit<typeof obj, (typeof keys)[number]> {\n const ret = { ...obj }\n for (const key of keys) {\n delete ret[key]\n }\n return ret\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useOryFlow } from \"@ory/elements-react\"\n\nexport function DefaultCardLogo() {\n const flow = useOryFlow()\n\n if (flow.config.logoUrl) {\n return <img src={flow.config.logoUrl} width={100} height={36} alt=\"Logo\" />\n }\n\n return (\n <h1 className=\"text-xl font-semibold leading-normal text-interface-foreground-default-primary\">\n {flow.config.name}\n </h1>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PropsWithChildren } from \"react\"\n\nexport function DefaultCardLayout({ children }: PropsWithChildren) {\n return (\n <main className=\"p-4 pb-8 flex items-center justify-center flex-col gap-8 min-h-screen\">\n {children}\n </main>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { OryCardProps } from \"@ory/elements-react\"\nimport { Badge } from \"./badge\"\nimport { DefaultCardContent } from \"./content\"\nimport { DefaultCardFooter } from \"./footer\"\nimport { DefaultCardHeader } from \"./header\"\nimport { DefaultCardLogo } from \"./logo\"\nimport { DefaultCurrentIdentifierButton } from \"./current-identifier-button\"\nimport { DefaultCardLayout } from \"./layout\"\n\nexport function DefaultCard({ children }: OryCardProps) {\n return (\n <div className=\"flex flex-1 sm:items-center justify-center font-sans items-start w-full sm:w-[480px] sm:max-w-[480px]\">\n <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\">\n {children}\n <Badge />\n </div>\n </div>\n )\n}\n\nexport {\n DefaultCardContent,\n DefaultCardFooter,\n DefaultCardHeader,\n DefaultCardLogo,\n DefaultCardLayout,\n DefaultCurrentIdentifierButton,\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PropsWithChildren } from \"react\"\nimport { cn } from \"../../utils/cn\"\nimport { useIntl } from \"react-intl\"\nimport {\n messageTestId,\n OryFormRootProps,\n uiTextToFormattedMessage,\n useOryFlow,\n} from \"@ory/elements-react\"\nimport { OryMessageContentProps } from \"@ory/elements-react\"\nimport { FlowType } from \"@ory/client-fetch\"\n\nexport function DefaultFormContainer({\n children,\n onSubmit,\n action,\n method,\n}: PropsWithChildren<OryFormRootProps>) {\n return (\n <form\n onSubmit={onSubmit}\n noValidate\n action={action}\n method={method}\n className={\"grid gap-8\"}\n >\n {children}\n </form>\n )\n}\n\nexport function DefaultMessageContainer({ children }: PropsWithChildren) {\n const { flowType } = useOryFlow()\n if (!children || (Array.isArray(children) && children.length === 0)) {\n return null\n }\n\n return (\n <section\n className={cn(\n flowType === FlowType.Settings ? \"text-center\" : \"text-left\",\n )}\n >\n {children}\n </section>\n )\n}\n\nexport function DefaultMessage({ message }: OryMessageContentProps) {\n const intl = useIntl()\n return (\n <span\n className={cn(\n \"leading-normal\",\n message.type === \"error\" &&\n \"text-interface-foreground-validation-danger\",\n message.type === \"info\" &&\n \"text-interface-foreground-default-secondary\",\n message.type === \"success\" &&\n \"text-interface-foreground-validation-success\",\n )}\n {...messageTestId(message)}\n >\n {uiTextToFormattedMessage(message, intl)}\n </span>\n )\n}\n\nexport { DefaultButtonSocial } from \"./social\"\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n OryFormOidcRootProps,\n OryNodeOidcButtonProps,\n uiTextToFormattedMessage,\n useOryFlow,\n} from \"@ory/elements-react\"\nimport { ElementType, useEffect } from \"react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { useDebounceValue } from \"usehooks-ts\"\nimport defaultLogos from \"../../provider-logos\"\nimport { cn } from \"../../utils/cn\"\nimport { Spinner } from \"./spinner\"\n\nexport function extractProvider(\n context: object | undefined,\n): string | undefined {\n if (\n context &&\n typeof context === \"object\" &&\n \"provider\" in context &&\n typeof context.provider === \"string\"\n ) {\n return context.provider\n }\n return undefined\n}\n\ntype DefaultSocialButtonProps = OryNodeOidcButtonProps & {\n showLabel?: boolean\n logos?: Record<string, ElementType>\n}\n\nexport function DefaultButtonSocial({\n attributes,\n node,\n onClick,\n showLabel: _showLabel,\n logos: providedLogos,\n}: DefaultSocialButtonProps) {\n const logos = { ...defaultLogos, ...providedLogos }\n const {\n node_type: _ignoredNodeType,\n type: _ignoredType,\n name: _ignoredName,\n ...props\n } = attributes\n const {\n flow: { ui },\n } = useOryFlow()\n // Safari cancels form submission events, if we do a state update in the same tick\n // so we delay the state update by 100ms\n const [clicked, setClicked] = useDebounceValue(false, 100)\n const intl = useIntl()\n const {\n formState: { isSubmitting },\n } = useFormContext()\n\n const oidcNodeCount =\n ui.nodes.filter((node) => node.group === \"oidc\").length ?? 0\n\n // Ideally, kratos would return the provider name in the context\n // At the moment it only returns the label (misleadingly named `provider`).\n // But changing that would be a breaking change.\n // So we have to extract the provider name from the id, which sometimes might contain a - followed by a unique ID.\n // TODO(kratos): Add provider to the context\n const Logo = logos[(attributes.value as string).split(\"-\")[0]]\n\n const showLabel =\n _showLabel ?? (oidcNodeCount % 3 !== 0 && oidcNodeCount % 4 !== 0)\n\n const provider = extractProvider(node.meta.label?.context) ?? \"\"\n\n const localOnClick = () => {\n onClick?.()\n setClicked(true)\n }\n\n useEffect(() => {\n if (!isSubmitting) {\n setClicked(false)\n }\n }, [isSubmitting, setClicked])\n\n return (\n <button\n 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\"\n value={attributes.value}\n type=\"submit\"\n name=\"provider\"\n data-testid={`ory/form/node/input/${attributes.name}`}\n {...props}\n onClick={localOnClick}\n data-loading={clicked}\n disabled={isSubmitting}\n >\n <span className=\"size-5 relative\">\n {!clicked ? (\n Logo ? (\n <Logo size={20} />\n ) : (\n <span className=\"flex aspect-square items-center justify-center rounded-[999px] border text-xs\">\n {provider.slice(0, 2)}\n </span>\n )\n ) : (\n <Spinner className=\"size-5\" />\n )}\n </span>\n {showLabel && node.meta.label ? (\n <>\n <span className=\"grow text-center font-medium leading-none text-button-social-foreground-default\">\n {uiTextToFormattedMessage(node.meta.label, intl)}\n </span>\n <span className=\"size-5 block\"></span>\n </>\n ) : null}\n </button>\n )\n}\n\n/**\n * Returns a variant of DefaultButtonSocial that can use your own logos\n *\n * @param logos - a record of provider names and their respective logos\n * @returns a variant of DefaultButtonSocial that uses the provided logos\n */\nDefaultButtonSocial.WithLogos =\n (logos: Record<string, ElementType>) => (props: DefaultSocialButtonProps) => (\n <DefaultButtonSocial {...props} logos={logos} />\n )\n\nexport function DefaultSocialButtonContainer({\n children,\n nodes,\n}: OryFormOidcRootProps) {\n return (\n <div\n className={cn(\"grid gap-3\", {\n // needed because tailwind is not compiling dynamic classes\n \"grid-cols-1\": nodes.length % 4 <= 2,\n \"grid-cols-3\": nodes.length % 3 === 0,\n \"grid-cols-4\": nodes.length > 1 && nodes.length % 4 === 0,\n })}\n >\n {children}\n </div>\n )\n}\n","import * as React from \"react\";\nconst SvgApple = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgApple;","import * as React from \"react\";\nconst SvgAuth0 = props => <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgAuth0;","import * as React from \"react\";\nconst SvgDiscord = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /><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\" /></svg>;\nexport default SvgDiscord;","import * as React from \"react\";\nconst SvgFacebook = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><circle cx={16} cy={16} r={14} fill=\"url(#facebook_svg__a)\" /><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\" /><defs><linearGradient id=\"facebook_svg__a\" x1={16} x2={16} y1={2} y2={29.917} gradientUnits=\"userSpaceOnUse\"><stop stopColor=\"#18ACFE\" /><stop offset={1} stopColor=\"#0163E0\" /></linearGradient></defs></svg>;\nexport default SvgFacebook;","import * as React from \"react\";\nconst SvgGeneric = props => <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?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><path stroke=\"none\" d=\"M0 0h24v24H0z\" /><path d=\"M2 12a10 10 0 1 0 20 0 10 10 0 1 0-20 0\" /><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\" /></svg>;\nexport default SvgGeneric;","import * as React from \"react\";\nconst SvgGithub = props => <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgGithub;","import * as React from \"react\";\nconst SvgGitlab = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /><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\" /><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\" /><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\" /></svg>;\nexport default SvgGitlab;","import * as React from \"react\";\nconst SvgGoogle = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /><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\" /><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\" /><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\" /></svg>;\nexport default SvgGoogle;","import * as React from \"react\";\nconst SvgLinkedin = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><rect width={28} height={28} x={2} y={2} fill=\"#1275B1\" rx={14} /><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\" /></svg>;\nexport default SvgLinkedin;","import * as React from \"react\";\nconst SvgMicrosoft = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 23 23\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><path fill=\"#F35325\" d=\"M1 1h10v10H1z\" /><path fill=\"#81BC06\" d=\"M12 1h10v10H12z\" /><path fill=\"#05A6F0\" d=\"M1 12h10v10H1z\" /><path fill=\"#FFBA08\" d=\"M12 12h10v10H12z\" /></svg>;\nexport default SvgMicrosoft;","import * as React from \"react\";\nconst SvgSlack = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /><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\" /><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\" /><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\" /></svg>;\nexport default SvgSlack;","import * as React from \"react\";\nconst SvgSpotify = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><circle cx={16} cy={16} r={14} fill=\"#1ED760\" /><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\" /></svg>;\nexport default SvgSpotify;","import * as React from \"react\";\nconst SvgYandex = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><circle cx={16} cy={16} r={14} fill=\"#fff\" /><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\" /></svg>;\nexport default SvgYandex;","import * as React from \"react\";\nconst SvgX = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} fill=\"none\" {...props}><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\" /></svg>;\nexport default SvgX;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport apple from \"./apple.svg\"\nimport auth0 from \"./auth0.svg\"\nimport discord from \"./discord.svg\"\nimport facebook from \"./facebook.svg\"\nimport generic from \"./generic.svg\"\nimport github from \"./github.svg\"\nimport gitlab from \"./gitlab.svg\"\nimport google from \"./google.svg\"\nimport linkedin from \"./linkedin.svg\"\nimport microsoft from \"./microsoft.svg\"\nimport slack from \"./slack.svg\"\nimport spotify from \"./spotify.svg\"\nimport yandex from \"./yandex.svg\"\nimport x from \"./x.svg\"\n\nconst logos: Record<string, typeof apple> = {\n apple,\n auth0,\n discord,\n facebook,\n generic,\n github,\n gitlab,\n google,\n linkedin,\n microsoft,\n slack,\n spotify,\n yandex,\n x,\n}\nexport default logos\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { cn } from \"../../utils/cn\"\n\nexport function Spinner({ className }: { className?: string }) {\n return (\n <svg\n aria-hidden=\"true\"\n role=\"status\"\n className={cn(\n \"absolute pointer-events-none inset-0 m-auto size-8 animate-spin\",\n className,\n )}\n viewBox=\"0 0 34 34\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g clipPath=\"url(#clip0_2572_1748)\">\n <path\n 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\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_2572_1748\">\n <rect\n width=\"24\"\n height=\"24\"\n fill=\"currentColor\"\n transform=\"translate(17 0.029541) rotate(45)\"\n />\n </clipPath>\n </defs>\n </svg>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { OryCardAuthMethodListItemProps } from \"@ory/elements-react\"\nimport { useIntl } from \"react-intl\"\nimport code from \"../../assets/icons/code.svg\"\nimport passkey from \"../../assets/icons/passkey.svg\"\nimport password from \"../../assets/icons/password.svg\"\nimport webauthn from \"../../assets/icons/webauthn.svg\"\nimport logos from \"../../provider-logos\"\nimport { isGroupImmediateSubmit } from \"../../utils/form\"\n\nconst iconsMap: Record<string, typeof code> = {\n code,\n passkey,\n password,\n webauthn,\n ...logos,\n}\n\nexport function DefaultAuthMethodListItem({\n onClick,\n group,\n}: OryCardAuthMethodListItemProps) {\n const intl = useIntl()\n const Icon = iconsMap[group] || null\n\n return (\n <button\n className=\"flex cursor-pointer gap-3 text-left items-start w-full rounded-buttons p-2 hover:bg-interface-background-default-primary-hover\"\n onClick={onClick}\n type={isGroupImmediateSubmit(group) ? \"submit\" : \"button\"}\n data-testid={`ory/form/auth-picker/${group}`}\n >\n <span className=\"mt-1\">\n {Icon && (\n <Icon size={16} className=\"text-interface-foreground-brand-primary\" />\n )}\n </span>\n <span className=\"flex-1 leading-normal inline-flex flex-col\">\n <span className=\"text-interface-foreground-default-primary\">\n {intl.formatMessage({ id: `two-step.${group}.title` })}\n </span>\n <span className=\"text-interface-foreground-default-secondary\">\n {intl.formatMessage({\n id: `two-step.${group}.description`,\n })}\n </span>\n </span>\n </button>\n )\n}\n","import * as React from \"react\";\nconst SvgCode = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 15 13\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgCode;","import * as React from \"react\";\nconst SvgPasskey = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 13 14\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgPasskey;","import * as React from \"react\";\nconst SvgPassword = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 14 4\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgPassword;","import * as React from \"react\";\nconst SvgWebauthn = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 14 14\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgWebauthn;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nexport function isGroupImmediateSubmit(group: string) {\n // TODO: Other methods might also benefit from this.\n return group === \"code\"\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getNodeLabel } from \"@ory/client-fetch\"\nimport {\n OryNodeButtonProps,\n uiTextToFormattedMessage,\n} from \"@ory/elements-react\"\nimport { cva, VariantProps } from \"class-variance-authority\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { Spinner } from \"./spinner\"\nimport { useEffect, useState } from \"react\"\n\nconst buttonStyles = cva(\n [\n \"relative flex justify-center gap-3 overflow-hidden rounded-buttons leading-none ring-1 ring-inset font-medium\",\n \"disabled:cursor-not-allowed loading:cursor-wait loading:before:pointer-events-none\",\n \"transition-colors duration-100 ease-linear\",\n \"p-4 max-w-[488px]\",\n ],\n {\n variants: {\n intent: {\n primary: [\n \"bg-button-primary-background-default text-button-primary-foreground-default ring-button-primary-border-default\",\n \"hover:bg-button-primary-background-hover hover:text-button-primary-foreground-hover hover:ring-button-primary-border-hover\",\n \"disabled:bg-button-primary-background-disabled disabled:text-button-primary-foreground-disabled disabled:ring-button-primary-border-disabled\",\n \"loading:bg-button-primary-background-default loading:text-button-primary-foreground-default loading:ring-button-primary-border-default\",\n \"loading:before:absolute loading:before:inset-0 loading:before:bg-button-primary-background-default loading:before:opacity-80 loading:before:content-['']\",\n \"disabled:bg-button-primary-background-disabled disabled:text-button-primary-foreground-disabled disabled:ring-button-primary-border-disabled\",\n ],\n secondary: [\n \"bg-button-secondary-background-default text-button-secondary-foreground-default ring-button-secondary-border-default\",\n \"hover:bg-button-secondary-background-hover hover:text-button-secondary-foreground-hover hover:ring-button-secondary-border-hover\",\n \"disabled:bg-button-secondary-background-disabled disabled:text-button-secondary-foreground-disabled disabled:ring-button-secondary-border-disabled\",\n \"loading:bg-button-secondary-background-default loading:text-button-secondary-foreground-default loading:ring-button-secondary-border-default\",\n \"loading:before:absolute loading:before:inset-0 loading:before:bg-button-secondary-background-default loading:before:opacity-80 loading:before:content-['']\",\n ],\n },\n defaultVariants: {\n intent: \"primary\",\n },\n },\n },\n)\n\nexport type ButtonVariants = VariantProps<typeof buttonStyles>\n\nexport const DefaultButton = ({\n attributes,\n node,\n onClick,\n}: OryNodeButtonProps) => {\n const {\n type,\n name,\n value,\n // Button does not support these attributes, so we skip them\n autocomplete: _ignoredAutocomplete,\n label: _ignoredLabel,\n node_type: _ignoredNodeType,\n maxlength: _ignoredMaxLength,\n // End of skipped attributes\n ...rest\n } = attributes\n const [clicked, setClicked] = useState(false)\n const intl = useIntl()\n const label = getNodeLabel(node)\n const {\n formState: { isSubmitting },\n setValue,\n } = useFormContext()\n\n useEffect(() => {\n if (!isSubmitting) {\n setClicked(false)\n }\n }, [isSubmitting])\n\n const isPrimary =\n attributes.name === \"method\" ||\n attributes.name.includes(\"passkey\") ||\n attributes.name.includes(\"webauthn\") ||\n attributes.name.includes(\"lookup_secret\")\n\n return (\n <button\n {...rest}\n value={value}\n name={name}\n type={type === \"button\" ? \"button\" : \"submit\"} // TODO\n onClick={(e) => {\n onClick?.(e)\n setClicked(true)\n\n if (type !== \"button\") {\n setValue(name, value)\n }\n }}\n className={buttonStyles({\n intent: isPrimary ? \"primary\" : \"secondary\",\n })}\n disabled={rest.disabled ?? isSubmitting}\n data-loading={clicked}\n >\n {clicked ? <Spinner /> : null}\n {label ? <span>{uiTextToFormattedMessage(label, intl)}</span> : \"\"}\n </button>\n )\n}\n\nDefaultButton.displayName = \"DefaultButton\"\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { getNodeLabel } from \"@ory/client-fetch\"\nimport {\n messageTestId,\n OryNodeInputProps,\n uiTextToFormattedMessage,\n} from \"@ory/elements-react\"\nimport { useForm } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { cn } from \"../../utils/cn\"\nimport { CheckboxLabel } from \"../ui/checkbox-label\"\n\nfunction CheckboxSVG() {\n return (\n <svg\n className=\"absolute hidden size-4 peer-checked:block fill-checkbox-foreground-checked\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n 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\"\n />\n </svg>\n )\n}\n\nexport const DefaultCheckbox = ({\n attributes: initialAttributes,\n node,\n}: OryNodeInputProps) => {\n const {\n value,\n name,\n // Button does not support these attributes, so we skip them\n autocomplete: _autocomplete,\n onclick: _onclick,\n maxlength: _max,\n // End of skipped attributes\n ...attributes\n } = initialAttributes\n\n const intl = useIntl()\n const label = getNodeLabel(node)\n const { register } = useForm()\n const hasError = node.messages.some((m) => m.type === \"error\")\n\n return (\n <label className=\"flex items-start gap-3 self-stretch antialiased\">\n <span className=\"flex h-5 items-center\">\n <input\n {...attributes}\n value={1}\n defaultChecked={Boolean(value)}\n type=\"checkbox\"\n className={cn(\n \"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\",\n hasError && \"border-interface-border-validation-danger\",\n )}\n {...register(name, { value })}\n />\n <CheckboxSVG />\n </span>\n <span className=\"flex flex-col\">\n <span className=\"font-normal leading-tight text-interface-foreground-default-primary\">\n <CheckboxLabel label={label} />\n </span>\n {node.messages.map((message) => (\n <span\n key={message.id}\n className={cn(\n \"mt-1\",\n message.type === \"error\"\n ? \"text-interface-foreground-validation-danger\"\n : \"text-interface-foreground-default-secondary\",\n )}\n {...messageTestId(message)}\n >\n {uiTextToFormattedMessage(message, intl)}\n </span>\n ))}\n </span>\n </label>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiText } from \"@ory/client-fetch\"\nimport { useIntl } from \"react-intl\"\nimport { uiTextToFormattedMessage } from \"../../../../util\"\n\ntype CheckboxLabelProps = {\n label?: UiText\n}\n\nconst linkRegex = /\\[([^\\]]+)\\]\\(([^)]+)\\)/g\n\nexport function computeLabelElements(labelText: string) {\n const elements = []\n let lastIndex = 0\n\n // Use matchAll to find all markdown links\n for (const match of labelText.matchAll(linkRegex)) {\n const linkText = match[1]\n const url = match[2]\n const matchStart = match.index\n if (typeof matchStart === \"undefined\") {\n // Some types seem to be wrong somewhere, eslint complains that matchStart can be undefined, but it can't?\n // So we just skip this match, if it is undefined\n continue\n }\n\n // Push the text before the match\n if (matchStart > lastIndex) {\n elements.push(labelText.slice(lastIndex, matchStart))\n }\n\n // Push the <a> tag for the markdown link\n elements.push(\n <a\n key={matchStart}\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-button-link-brand-brand hover:text-button-link-brand-brand-hover underline\"\n >\n {linkText}\n </a>,\n )\n\n // Update lastIndex to the end of the current match\n lastIndex = matchStart + match[0].length\n }\n\n // Push any remaining text after the last match\n if (lastIndex < labelText.length) {\n elements.push(labelText.slice(lastIndex))\n }\n return elements\n}\n\nexport function CheckboxLabel({ label }: CheckboxLabelProps) {\n const intl = useIntl()\n if (!label) {\n return null\n }\n\n const labelText = uiTextToFormattedMessage(label, intl)\n\n return <>{computeLabelElements(labelText)}</>\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiText } from \"@ory/client-fetch\"\nimport { IntlShape } from \"react-intl\"\n\n/**\n * Converts a UiText to a FormattedMessage.\n * The UiText contains the id of the message and the context.\n * The context is used to inject values into the message from Ory, e.g. a timestamp.\n * For example a UI Node from Ory might look like this:\n *\n * \\{\n * \"type\":\"input\",\n * \"group\":\"default\",\n * \"attributes\": \\{\n * \"name\":\"traits.email\",\n * \"type\":\"email\",\n * \"required\":true,\n * \"autocomplete\":\"email\",\n * \"disabled\":false,\n * \"node_type\":\"input\"\n * \\},\n * \"messages\":[],\n * \"meta\": \\{\n * \"label\": \\{\n * \"id\":1070002,\n * \"text\":\"E-Mail\",\n * \"type\":\"info\",\n * \"context\":\\{\n * \"title\":\"E-Mail\"\n * \\},\n * \\}\n * \\}\n * \\}\n *\n * The context has the key \"title\" which matches the formatter template name \"\\{title\\}\"\n * An example translation file would look like this:\n * \\{\n * \"identities.messages.1070002\": \"\\{title\\}\"\n * \\}\n *\n * The formatter would then take the meta.label.id and look for the translation with the key matching the id.\n * It would then replace the template \"\\{title\\}\" with the value from the context with the key \"title\".\n *\n * @param uiText - The UiText is part of the UiNode object sent by Kratos when performing a flow.\n * @param intl - The intl object from react-intl\n */\nexport const uiTextToFormattedMessage = (\n { id, context = {}, text }: Omit<UiText, \"type\">,\n intl: IntlShape,\n) => {\n const contextInjectedMessage = Object.entries(context).reduce(\n (accumulator, [key, value]) => {\n // context might provide an array of objects instead of a single object\n // for example when looking up a recovery code\n if (Array.isArray(value)) {\n return {\n ...accumulator,\n [key]: value,\n [key + \"_list\"]: intl.formatList<string>(value),\n }\n } else if (key.endsWith(\"_unix\")) {\n if (typeof value === \"number\") {\n return {\n ...accumulator,\n [key]: intl.formatDate(new Date(value * 1000)),\n [key + \"_since\"]: intl.formatDateTimeRange(\n new Date(value),\n new Date(),\n ),\n [key + \"_since_minutes\"]: Math.ceil(\n (value - new Date().getTime() / 1000) / 60,\n ).toFixed(0),\n [key + \"_until\"]: intl.formatDateTimeRange(\n new Date(),\n new Date(value),\n ),\n [key + \"_until_minutes\"]: Math.ceil(\n (new Date().getTime() / 1000 - value) / 60,\n ).toFixed(0),\n }\n }\n } else if (key === \"property\") {\n return {\n ...accumulator,\n [key]: intl.formatMessage({\n id: `property.${value}`,\n defaultMessage: value,\n }),\n }\n }\n return {\n ...accumulator,\n [key]: value as string | number,\n }\n },\n {},\n )\n\n return intl.formatMessage(\n {\n id: `identities.messages.${id}`,\n defaultMessage: text,\n },\n contextInjectedMessage,\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { OryFormGroupProps } from \"@ory/elements-react\"\n\nexport function DefaultGroupContainer({ children }: OryFormGroupProps) {\n return <div className=\"grid grid-cols-1 gap-8\">{children}</div>\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nexport function DefaultHorizontalDivider() {\n return <hr className=\"border-interface-border-default-primary\" />\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { OryNodeImageProps } from \"@ory/elements-react\"\n\nexport function DefaultImage({ attributes }: OryNodeImageProps) {\n return (\n <figure>\n <img {...attributes} />\n </figure>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { FlowType, getNodeLabel } from \"@ory/client-fetch\"\nimport {\n OryNodeInputProps,\n uiTextToFormattedMessage,\n useOryFlow,\n} from \"@ory/elements-react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { cn } from \"../../utils/cn\"\n\nexport const DefaultInput = ({\n node,\n attributes,\n onClick,\n}: OryNodeInputProps) => {\n const label = getNodeLabel(node)\n const { register } = useFormContext()\n const {\n value,\n autocomplete,\n name,\n maxlength,\n node_type: _,\n ...rest\n } = attributes\n const intl = useIntl()\n const { flowType } = useOryFlow()\n\n const formattedLabel = label\n ? intl.formatMessage(\n {\n id: \"input.placeholder\",\n defaultMessage: \"Enter your {placeholder}\",\n },\n {\n placeholder: uiTextToFormattedMessage(label, intl),\n },\n )\n : \"\"\n\n return (\n <input\n {...rest}\n onClick={onClick}\n maxLength={maxlength}\n autoComplete={autocomplete}\n placeholder={formattedLabel}\n data-testid={`ory/form/node/input/${name}`}\n className={cn(\n \"antialiased rounded-forms border leading-tight transition-colors placeholder:h-[20px] placeholder:text-input-foreground-tertiary focus-visible:outline-none focus:ring-0\",\n \"bg-input-background-default border-input-border-default text-input-foreground-primary\",\n \"disabled:bg-input-background-disabled disabled:border-input-border-disabled disabled:text-input-foreground-disabled\",\n \"focus:border-input-border-focus focus-visible:border-input-border-focus\",\n \"hover:bg-input-background-hover hover:border-input-border-hover\",\n \"px-4 py-[13px]\",\n // The settings flow input fields are supposed to be dense, so we don't need the extra padding we want on the user flows.\n flowType === FlowType.Settings && \"max-w-[488px]\",\n )}\n {...register(name, { value })}\n />\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowType,\n getNodeLabel,\n instanceOfUiText,\n UiNode,\n} from \"@ory/client-fetch\"\nimport {\n OryNodeLabelProps,\n messageTestId,\n uiTextToFormattedMessage,\n useComponents,\n useOryFlow,\n} from \"@ory/elements-react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { initFlowUrl } from \"../../utils/url\"\n\nfunction findResendNode(nodes: UiNode[]) {\n return nodes.find(\n (n) =>\n \"name\" in n.attributes &&\n ((n.attributes.name === \"email\" && n.attributes.type === \"submit\") ||\n n.attributes.name === \"resend\"),\n )\n}\n\nexport function DefaultLabel({\n node,\n children,\n attributes,\n ...rest\n}: OryNodeLabelProps) {\n const intl = useIntl()\n const label = getNodeLabel(node)\n const { Message } = useComponents()\n const { config, flowType, flow } = useOryFlow()\n const { setValue, formState } = useFormContext()\n\n const isPassword = attributes.type === \"password\"\n\n const resendNode = findResendNode(flow.ui.nodes)\n\n const handleResend = () => {\n if (resendNode?.attributes && \"name\" in resendNode.attributes) {\n setValue(resendNode.attributes.name, resendNode.attributes.value)\n }\n }\n\n const fieldError = formState.errors[attributes.name]\n return (\n <div className=\"flex flex-col gap-1 antialiased\">\n {label && (\n <span className=\"inline-flex justify-between\">\n <label\n {...messageTestId(label)}\n className=\"leading-normal text-input-foreground-primary\"\n htmlFor={attributes.name}\n data-testid={`ory/form/node/input/label/${attributes.name}`}\n {...rest}\n >\n {uiTextToFormattedMessage(label, intl)}\n </label>\n {isPassword &&\n config.project.recovery_enabled &&\n flowType === FlowType.Login && (\n // TODO: make it possible to override with a custom component\n <a\n href={initFlowUrl(config.sdk.url, \"recovery\", flow)}\n className=\"text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline\"\n >\n {intl.formatMessage({\n id: \"forms.label.forgot-password\",\n defaultMessage: \"Forgot password?\",\n })}\n </a>\n )}\n {resendNode?.attributes.node_type === \"input\" && (\n <button\n type=\"submit\"\n name={resendNode.attributes.name}\n value={resendNode.attributes.value}\n onClick={handleResend}\n className=\"cursor-pointer text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline\"\n >\n {intl.formatMessage({ id: \"identities.messages.1070008\" })}\n </button>\n )}\n </span>\n )}\n {children}\n {node.messages.map((message) => (\n <Message.Content key={message.id} message={message} />\n ))}\n {fieldError && instanceOfUiText(fieldError) && (\n <Message.Content message={fieldError} />\n )}\n </div>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getNodeLabel } from \"@ory/client-fetch\"\nimport {\n OryNodeAnchorProps,\n uiTextToFormattedMessage,\n} from \"@ory/elements-react\"\nimport { forwardRef } from \"react\"\nimport { useIntl } from \"react-intl\"\nimport { cn } from \"../../utils/cn\"\n\nexport const DefaultLinkButton = forwardRef<\n HTMLAnchorElement,\n OryNodeAnchorProps\n>(({ attributes, node }, ref) => {\n const intl = useIntl()\n const label = getNodeLabel(node)\n return (\n <a\n {...attributes}\n ref={ref}\n title={label ? uiTextToFormattedMessage(label, intl) : \"\"}\n data-testid={`ory/form/node/link/${attributes.id}`}\n className={cn(\n \"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\",\n )}\n >\n {label ? uiTextToFormattedMessage(label, intl) : \"\"}\n </a>\n )\n})\n\nDefaultLinkButton.displayName = \"DefaultLinkButton\"\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { useFormContext } from \"react-hook-form\"\nimport { InputOTP, InputOTPGroup, InputOTPSlot } from \"./shadcn/otp-input\"\nimport { OryNodeInputProps, useOryFlow } from \"@ory/elements-react\"\nimport { FlowType } from \"@ory/client-fetch\"\nimport { cn } from \"../../utils/cn\"\n\nexport const DefaultPinCodeInput = ({ attributes }: OryNodeInputProps) => {\n const { setValue, watch } = useFormContext()\n const { maxlength, name } = attributes\n const elements = maxlength ?? 6\n const { flowType } = useOryFlow()\n\n const handleInputChange = (v: string) => {\n setValue(name, v)\n }\n\n const value = watch(name) as string\n\n return (\n <InputOTP\n maxLength={maxlength ?? 6}\n onChange={handleInputChange}\n name={name}\n value={value}\n >\n <InputOTPGroup\n className={cn(\n \"w-full flex gap-2 justify-stretch\",\n // The settings flow input fields are supposed to be dense, so we don't need the extra padding we want on the user flows.\n flowType === FlowType.Settings && \"max-w-[488px]\",\n )}\n >\n {[...Array(elements)].map((_, index) => (\n <InputOTPSlot index={index} key={index} />\n ))}\n </InputOTPGroup>\n </InputOTP>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { cn } from \"../../../utils/cn\"\nimport { OTPInput, OTPInputContext } from \"input-otp\"\nimport * as React from \"react\"\n\n// This file is a copy from https://ui.shadcn.com/docs/components/input-otp\n\nconst InputOTP = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"flex items-center gap-2 has-[:disabled]:opacity-50\",\n containerClassName,\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n))\nInputOTP.displayName = \"InputOTP\"\n\nconst InputOTPGroup = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center\", className)} {...props} />\n))\nInputOTPGroup.displayName = \"InputOTPGroup\"\n\nconst InputOTPSlot = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\"> & { index: number }\n>(({ index, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]\n\n return (\n <div\n ref={ref}\n className={cn(\n \"rounded-forms border border-solid bg-input-background-default py-[15px] text-center focus-visible:outline-none w-full\",\n \"relative flex items-center justify-center transition-all leading-none\",\n isActive ? \"border-input-border-focus\" : \"border-input-border-default\",\n className,\n )}\n {...props}\n >\n <span className=\"inline-block size-4\">{char}</span>\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"h-4 w-px animate-caret-blink bg-interface-background-brand-primary duration-700\" />\n </div>\n )}\n </div>\n )\n})\nInputOTPSlot.displayName = \"InputOTPSlot\"\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot }\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n OryFormSectionContentProps,\n OryFormSectionFooterProps,\n OryFormSectionProps,\n} from \"@ory/elements-react\"\nimport { cn } from \"../../utils/cn\"\n\nconst DefaultFormSection = ({\n children,\n nodes: _nodes,\n ...rest\n}: OryFormSectionProps) => {\n return (\n <form\n className=\"flex w-full max-w-screen-sm flex-col md:max-w-[712px] lg:max-w-[802px] xl:max-w-[896px] px-4\"\n {...rest}\n >\n {children}\n </form>\n )\n}\n\nconst DefaultFormSectionContent = ({\n title,\n description,\n children,\n}: OryFormSectionContentProps) => {\n return (\n <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\">\n <div className=\"flex flex-col gap-2\">\n <h3 className=\"font-medium text-interface-foreground-default-primary\">\n {title}\n </h3>\n <span className=\"text-interface-foreground-default-secondary\">\n {description}\n </span>\n </div>\n {children}\n </div>\n )\n}\n\nconst DefaultFormSectionFooter = ({\n children,\n text,\n}: OryFormSectionFooterProps) => {\n return (\n <div\n className={cn(\n \"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\",\n )}\n >\n <span>{text}</span>\n {children}\n </div>\n )\n}\n\nexport {\n DefaultFormSection,\n DefaultFormSectionContent,\n DefaultFormSectionFooter,\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiText } from \"@ory/client-fetch\"\nimport { OryNodeTextProps, uiTextToFormattedMessage } from \"@ory/elements-react\"\nimport { useIntl } from \"react-intl\"\n\nexport function DefaultText({ node, attributes }: OryNodeTextProps) {\n const intl = useIntl()\n\n // There is a special case where this node is the lookup secrets code node. In that case we need special formatting:\n const lookup = (\n attributes.text.context as {\n secrets: UiText[]\n }\n )?.secrets\n\n if (lookup) {\n return (\n <>\n <p data-testid={`ory/form/node/text/${attributes.id}/label`}>\n {node.meta.label\n ? uiTextToFormattedMessage(node.meta.label, intl)\n : \"\"}\n </p>\n {lookup.map((text: UiText, index) => (\n <pre\n data-testid={`ory/form/node/text/lookup_secret_codes/text`}\n key={index}\n >\n <code>{text ? uiTextToFormattedMessage(text, intl) : \"\"}</code>\n </pre>\n ))}\n </>\n )\n }\n\n return (\n <>\n <p\n data-testid={`ory/form/node/text/${attributes.id}/label`}\n id={attributes.id}\n >\n {node.meta.label ? (\n <label>{uiTextToFormattedMessage(node.meta.label, intl)}</label>\n ) : null}\n {attributes.text ? uiTextToFormattedMessage(attributes.text, intl) : \"\"}\n </p>\n </>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { OryPageHeaderProps, useComponents } from \"@ory/elements-react\"\nimport { UserMenu } from \"../ui/user-menu\"\nimport { useSession } from \"@ory/elements-react/client\"\n\nexport const DefaultPageHeader = (_props: OryPageHeaderProps) => {\n const { Card } = useComponents()\n const { session } = useSession()\n\n return (\n <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\">\n <div className=\"flex flex-col gap-12\">\n <div className=\"flex max-h-10 flex-1 justify-between gap-2\">\n <div className=\"relative h-10 flex-1\">\n <Card.Logo />\n </div>\n <UserMenu session={session} />\n </div>\n </div>\n </div>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LogoutFlow, Session } from \"@ory/client-fetch\"\nimport { DropdownMenuLabel } from \"@radix-ui/react-dropdown-menu\"\nimport { useCallback, useEffect, useState } from \"react\"\nimport { useOryFlow } from \"@ory/elements-react\"\nimport { frontendClient } from \"../../../../util/client\"\nimport IconLogout from \"../../assets/icons/logout.svg\"\nimport IconSettings from \"../../assets/icons/settings.svg\"\nimport { getUserInitials } from \"../../utils/user\"\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"./dropdown-menu\"\nimport { UserAvatar } from \"./user-avater\"\n\ntype UserMenuProps = {\n session: Session | null\n logoutFlow?: LogoutFlow\n}\n\nexport const UserMenu = ({ session }: UserMenuProps) => {\n const { config } = useOryFlow()\n const initials = getUserInitials(session)\n const [logoutFlow, setLogoutFlow] = useState<LogoutFlow | undefined>()\n\n const fetchLogoutFlow = useCallback(async () => {\n const flow = await frontendClient(config.sdk.url).createBrowserLogoutFlow()\n setLogoutFlow(flow)\n }, [config.sdk.url])\n\n useEffect(() => {\n void fetchLogoutFlow()\n }, [fetchLogoutFlow])\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <UserAvatar initials={initials} />\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuLabel className=\"flex gap-3 px-5 py-4.5\">\n <UserAvatar disabled initials={initials} />\n <div className=\"flex flex-col justify-center text-sm leading-tight\">\n <div className=\"text-interface-foreground-default-primary leading-tight font-medium\">\n {initials.primary}\n </div>\n {initials.secondary && (\n <div className=\"text-interface-foreground-default-tertiary leading-tight\">\n {initials.secondary}\n </div>\n )}\n </div>\n </DropdownMenuLabel>\n <DropdownMenuItem asChild>\n <a href=\"/settings\">\n <IconSettings size={16} /> User settings\n </a>\n </DropdownMenuItem>\n <DropdownMenuItem asChild disabled={!logoutFlow?.logout_url}>\n <a href={logoutFlow?.logout_url}>\n <IconLogout size={16} /> Logout\n </a>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n Configuration,\n ConfigurationParameters,\n FrontendApi,\n} from \"@ory/client-fetch\"\n\nexport function frontendClient(\n sdkUrl: string,\n opts: Partial<ConfigurationParameters> = {},\n) {\n const config = new Configuration({\n ...opts,\n basePath: sdkUrl,\n headers: {\n Accept: \"application/json\",\n ...opts.headers,\n },\n })\n return new FrontendApi(config)\n}\n","import * as React from \"react\";\nconst SvgLogout = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 16 16\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgLogout;","import * as React from \"react\";\nconst SvgSettings = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 16 16\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><g stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><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\" /><path d=\"M6 8a2 2 0 1 0 4 0 2 2 0 0 0-4 0\" /></g></svg>;\nexport default SvgSettings;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Session } from \"@ory/client-fetch\"\n\nexport type UserInitials = {\n primary: string\n secondary?: string\n avatar?: string\n}\n\nfunction isTraitsIndexable(\n traits: unknown,\n): traits is Record<string, string | Record<string, string>> {\n return typeof traits === \"object\" && traits !== null\n}\n\nexport const getUserInitials = (session: Session | null): UserInitials => {\n const avatar = \"\"\n let primary = \"\"\n let secondary = \"\"\n\n if (\n !session?.identity?.traits ||\n !isTraitsIndexable(session.identity.traits)\n ) {\n return {\n primary,\n secondary,\n avatar,\n }\n }\n\n const traits = session.identity?.traits\n\n if (traits.email && typeof traits.email === \"string\") {\n secondary = traits.email\n }\n\n if (traits.name) {\n if (typeof traits.name === \"string\") {\n primary = traits.name\n }\n\n if (\n typeof traits.name === \"object\" &&\n traits.name &&\n traits.name.first &&\n traits.name.last\n ) {\n primary = traits.name.first + \" \" + traits.name.last\n }\n }\n\n if (primary === \"\") {\n primary = secondary\n secondary = \"\"\n }\n\n return {\n primary,\n secondary,\n avatar,\n }\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\n\nimport { ComponentPropsWithoutRef, ElementRef, forwardRef } from \"react\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport { cn } from \"../../utils/cn\"\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\n\nconst DropdownMenuContent = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.Content>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 16, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n align=\"end\"\n className={cn(\n \"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\",\n \"border border-interface-border-default-primary bg-interface-background-default-primary rounded-cards\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownMenuItem = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.Item>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-pointer select-none items-center outline-none transition-colors data-[disabled]:pointer-events-none\",\n \"px-8 py-3 lg:py-4.5 text-sm gap-6\",\n \"first:border-0 border-t border-button-secondary-border-default hover:border-button-social-border-hover\",\n \"text-button-secondary-foreground-default bg-button-secondary-background-default\",\n \"hover:text-button-secondary-foreground-hover hover:bg-button-secondary-background-hover\",\n \"data-[disabled]:text-button-secondary-foreground-disabled data-[disabled]:bg-button-secondary-background-disabled\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuLabel = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.Label>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"px-2 py-1.5 text-sm font-semibold\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ComponentPropsWithoutRef, forwardRef } from \"react\"\nimport { UserInitials } from \"../../utils/user\"\nimport IconUser from \"../../assets/icons/user.svg\"\n\ntype UserAvatarProps = {\n initials: UserInitials\n} & ComponentPropsWithoutRef<\"button\">\n\nexport const UserAvatar = forwardRef<HTMLButtonElement, UserAvatarProps>(\n ({ initials, ...rest }, ref) => {\n return (\n <button\n ref={ref}\n className=\"relative flex size-10 items-center justify-center overflow-hidden rounded-[999px] bg-button-primary-background-default hover:bg-button-primary-background-hover\"\n {...rest}\n >\n <div className=\"relative flex size-full items-center justify-center\">\n {initials.avatar ? (\n <img\n src={initials.avatar}\n alt={initials.primary}\n className=\"w-full object-contain\"\n />\n ) : (\n <IconUser\n size={24}\n className=\"text-button-primary-foreground-default\"\n />\n )}\n </div>\n </button>\n )\n },\n)\nUserAvatar.displayName = \"UserAvatar\"\n","import * as React from \"react\";\nconst SvgUser = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgUser;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode, UiNodeInputAttributes } from \"@ory/client-fetch\"\nimport { OrySettingsOidcProps } from \"@ory/elements-react\"\nimport { useEffect } from \"react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useDebounceValue } from \"usehooks-ts\"\nimport Trash from \"../../assets/icons/trash.svg\"\nimport logos from \"../../provider-logos\"\nimport { DefaultHorizontalDivider } from \"../form/horizontal-divider\"\nimport { DefaultButtonSocial, extractProvider } from \"../form/social\"\nimport { Spinner } from \"../form/spinner\"\n\nexport function DefaultSettingsOidc({\n linkButtons,\n unlinkButtons,\n}: OrySettingsOidcProps) {\n const hasLinkButtons = linkButtons.length > 0\n const hasUnlinkButtons = unlinkButtons.length > 0\n\n return (\n <div className=\"flex flex-col gap-8\">\n {hasLinkButtons && (\n <div className=\"grid items-start gap-3 grid-cols-1 sm:grid-cols-2 md:grid-cols-3\">\n {linkButtons.map((button) => {\n const attrs = button.attributes as UiNodeInputAttributes\n\n return (\n <DefaultButtonSocial\n showLabel\n key={attrs.value}\n node={button}\n attributes={attrs}\n onClick={button.onClick}\n />\n )\n })}\n </div>\n )}\n {hasUnlinkButtons && hasLinkButtons ? <DefaultHorizontalDivider /> : null}\n {unlinkButtons.map((button) => {\n if (button.attributes.node_type !== \"input\") {\n return null\n }\n return <UnlinkRow key={button.attributes.value} button={button} />\n })}\n </div>\n )\n}\n\ntype UnlinkRowProps = {\n button: UiNode & { onClick: () => void }\n}\n\nfunction UnlinkRow({ button }: UnlinkRowProps) {\n // Safari cancels form submission events, if we do a state update in the same tick\n // so we delay the state update by 100ms\n const [clicked, setClicked] = useDebounceValue(false, 100)\n const {\n formState: { isSubmitting },\n } = useFormContext()\n const attrs = button.attributes as UiNodeInputAttributes\n const provider = extractProvider(button.meta.label?.context) ?? \"\"\n const Logo = logos[(attrs.value as string).split(\"-\")[0]]\n\n const localOnClick = () => {\n button.onClick()\n setClicked(true)\n }\n\n useEffect(() => {\n if (!isSubmitting) {\n setClicked(false)\n }\n }, [isSubmitting, setClicked])\n\n return (\n <div key={attrs.value} className=\"flex justify-between\">\n <div className=\"flex items-center gap-6\">\n {Logo ? <Logo size={32} /> : <logos.generic size={32} />}\n <p className=\"text-sm font-medium text-interface-foreground-default-secondary\">\n {provider}\n </p>\n </div>\n <button\n {...attrs}\n type=\"submit\"\n onClick={localOnClick}\n disabled={isSubmitting}\n className=\"relative\"\n title={`Unlink ${provider}`}\n >\n {clicked ? (\n <Spinner className=\"relative\" />\n ) : (\n <Trash\n className=\"text-button-link-default-secondary hover:text-button-link-default-secondary-hover\"\n size={24}\n />\n )}\n </button>\n </div>\n )\n}\n","import * as React from \"react\";\nconst SvgTrash = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgTrash;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNodeInputAttributes } from \"@ory/client-fetch\"\nimport { OrySettingsPasskeyProps, useComponents } from \"@ory/elements-react\"\nimport Passkey from \"../../assets/icons/passkey.svg\"\nimport Trash from \"../../assets/icons/trash.svg\"\nimport { DefaultHorizontalDivider } from \"../form/horizontal-divider\"\nimport { useFormContext } from \"react-hook-form\"\nimport { Spinner } from \"../form/spinner\"\n\nexport function DefaultSettingsPasskey({\n triggerButton,\n removeButtons,\n}: OrySettingsPasskeyProps) {\n const {\n formState: { isSubmitting },\n } = useFormContext()\n const { Node } = useComponents()\n\n const hasRemoveButtons = removeButtons.length > 0\n\n return (\n <div className=\"flex flex-col gap-8\">\n <div className=\"flex max-w-[60%] items-end gap-3\">\n {triggerButton && (\n <Node.Button\n node={triggerButton}\n attributes={triggerButton.attributes as UiNodeInputAttributes}\n onClick={triggerButton.onClick}\n />\n )}\n </div>\n {hasRemoveButtons ? (\n <div className=\"flex flex-col gap-8\">\n <DefaultHorizontalDivider />\n <div className=\"flex flex-col gap-2\">\n {removeButtons.map((node, i) => {\n const context = node.meta.label?.context ?? {}\n const addedAt =\n \"added_at\" in context ? (context.added_at as string) : null\n const displayName =\n \"display_name\" in context\n ? (context.display_name as string)\n : null\n const keyId =\n \"value\" in node.attributes ? node.attributes.value : null\n\n return (\n <div\n className=\"flex justify-between gap-6 md:items-center\"\n key={`passkey-remove-button-${i}`}\n >\n <div className=\"flex gap-2 items-center flex-1\">\n <Passkey\n size={32}\n className=\"text-interface-foreground-default-primary\"\n />\n <div className=\"flex-1 flex-col md:flex-row md:items-center flex md:justify-between gap-4\">\n <div className=\"flex-1 flex-col\">\n <p className=\"text-sm font-medium text-interface-foreground-default-secondary\">\n {displayName}\n </p>\n <span className=\"text-sm text-interface-foreground-default-tertiary hidden sm:block\">\n {keyId}\n </span>\n </div>\n {addedAt && (\n <p className=\"text-sm text-interface-foreground-default-tertiary\">\n {new Intl.DateTimeFormat(undefined, {\n dateStyle: \"long\",\n }).format(new Date(addedAt))}\n </p>\n )}\n </div>\n </div>\n <button\n {...(node.attributes as UiNodeInputAttributes)}\n type=\"submit\"\n onClick={node.onClick}\n disabled={isSubmitting}\n className=\"relative\"\n >\n {isSubmitting ? (\n <Spinner className=\"relative\" />\n ) : (\n <Trash\n className=\"text-button-link-default-secondary hover:text-button-link-default-secondary-hover\"\n size={24}\n />\n )}\n </button>\n </div>\n )\n })}\n </div>\n </div>\n ) : null}\n </div>\n )\n}\n","import * as React from \"react\";\nconst SvgDownload = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} fill=\"none\" {...props}><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\" /></svg>;\nexport default SvgDownload;","import * as React from \"react\";\nconst SvgEye = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} fill=\"none\" {...props}><g strokeLinecap=\"round\" strokeLinejoin=\"round\"><path stroke=\"currentColor\" d=\"M10 12a2 2 0 1 0 4 0 2 2 0 0 0-4 0\" /><path stroke=\"#64748B\" d=\"M21 12q-3.6 6-9 6t-9-6q3.6-6 9-6t9 6\" /></g></svg>;\nexport default SvgEye;","import * as React from \"react\";\nconst SvgRefresh = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} fill=\"none\" {...props}><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\" /></svg>;\nexport default SvgRefresh;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNodeInputAttributes } from \"@ory/client-fetch\"\nimport { OrySettingsRecoveryCodesProps } from \"@ory/elements-react\"\nimport Download from \"../../assets/icons/download.svg\"\nimport Eye from \"../../assets/icons/eye.svg\"\nimport Refresh from \"../../assets/icons/refresh.svg\"\nimport { DefaultHorizontalDivider } from \"../form/horizontal-divider\"\nimport { useFormContext } from \"react-hook-form\"\n\nexport function DefaultSettingsRecoveryCodes({\n codes,\n regnerateButton,\n revealButton,\n onRegenerate,\n onReveal,\n}: OrySettingsRecoveryCodesProps) {\n const {\n formState: { isSubmitting },\n } = useFormContext()\n const onDownload = () => {\n const element = document.createElement(\"a\")\n const file = new Blob([codes.join(\"\\n\")], {\n type: \"text/plain\",\n })\n element.href = URL.createObjectURL(file)\n element.download = \"recovery-codes.txt\"\n document.body.appendChild(element)\n element.click()\n }\n\n const hasCodes = codes.length >= 1\n\n return (\n <div className=\"flex flex-col gap-8\">\n {codes.length > 0 && <DefaultHorizontalDivider />}\n <div className=\"flex gap-4 justify-between\">\n <span className=\"text-interface-foreground-default-tertiary\">\n {revealButton && \"Reveal recovery codes\"}\n </span>\n <div className=\"flex gap-2\">\n {regnerateButton && codes.length > 0 && (\n <button\n {...(regnerateButton.attributes as UiNodeInputAttributes)}\n type=\"submit\"\n className=\"ml-auto\"\n onClick={onRegenerate}\n disabled={isSubmitting}\n data-loading={isSubmitting}\n >\n <Refresh\n size={24}\n className=\"text-button-link-default-secondary hover:text-button-link-default-secondary-hover\"\n />\n </button>\n )}\n {revealButton && (\n <>\n <button\n {...(revealButton.attributes as UiNodeInputAttributes)}\n type=\"submit\"\n className=\"ml-auto\"\n onClick={onReveal}\n title=\"Reveal recovery codes\"\n >\n <Eye\n size={24}\n className=\"text-button-link-default-secondary hover:text-button-link-default-secondary-hover\"\n />\n </button>\n </>\n )}\n {hasCodes && (\n <button\n onClick={onDownload}\n type=\"button\"\n className=\"ml-auto\"\n data-testid=\"ory/screen/settings/group/recovery_code/download\"\n title=\"Download recovery codes\"\n >\n <Download\n size={24}\n className=\"text-button-link-default-secondary hover:text-button-link-default-secondary-hover\"\n />\n </button>\n )}\n </div>\n </div>\n {hasCodes ? (\n <div className=\"rounded-general p-6 bg-interface-background-default-secondary border-interface-border-default-primary\">\n <div\n className=\"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 flex-wrap gap-4 text-sm text-interface-foreground-default-primary\"\n data-testid=\"ory/screen/settings/group/recovery_code/codes\"\n >\n {codes.map((code) => (\n <p key={code}>{code}</p>\n ))}\n </div>\n </div>\n ) : null}\n </div>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n UiNodeImageAttributes,\n UiNodeInputAttributes,\n UiNodeTextAttributes,\n} from \"@ory/client-fetch\"\nimport { OrySettingsTotpProps, useComponents } from \"@ory/elements-react\"\nimport QrCode from \"../../assets/icons/qrcode.svg\"\nimport Trash from \"../../assets/icons/trash.svg\"\nimport { DefaultHorizontalDivider } from \"../form/horizontal-divider\"\nimport { useFormContext } from \"react-hook-form\"\nimport { Spinner } from \"../form/spinner\"\n\nexport function DefaultSettingsTotp({\n totpImage,\n totpInput,\n totpSecret,\n totpUnlink,\n onUnlink,\n}: OrySettingsTotpProps) {\n const { Node, Card } = useComponents()\n const {\n formState: { isSubmitting },\n } = useFormContext()\n if (totpUnlink) {\n const {\n type,\n autocomplete: _ignoredAutocomplete,\n label: _ignoredLabel,\n node_type: _ignoredNodeType,\n ...buttonAttrs\n } = totpUnlink.attributes as UiNodeInputAttributes\n\n return (\n <div className=\"grid grid-cols-1 gap-8 md:grid-cols-2\">\n <div className=\"col-span-full\">\n <Card.Divider />\n </div>\n <div className=\"col-span-full flex items-center gap-6\">\n <div className=\"aspect-square size-8 \">\n <QrCode size={32} />\n </div>\n <div className=\"mr-auto flex flex-col\">\n <p className=\"text-sm font-medium text-interface-foreground-default-primary\">\n Authenticator app\n </p>\n </div>\n <button\n type={type === \"button\" ? \"button\" : \"submit\"}\n {...buttonAttrs}\n onClick={onUnlink}\n disabled={isSubmitting}\n >\n {isSubmitting ? (\n <Spinner className=\"relative\" />\n ) : (\n <Trash\n className=\"text-button-link-default-secondary hover:text-button-link-default-secondary-hover\"\n size={24}\n />\n )}\n </button>\n </div>\n </div>\n )\n }\n\n if (totpImage && totpSecret && totpInput) {\n return (\n <div className=\"grid grid-cols-1 gap-8 md:grid-cols-2\">\n <div className=\"col-span-full\">\n <DefaultHorizontalDivider />\n </div>\n <div className=\"flex justify-center rounded-cards bg-interface-background-default-secondary p-8\">\n <div className=\"aspect-square h-44 rounded bg-[white]\">\n <div className=\"-m-3 antialiased mix-blend-multiply\">\n <Node.Image\n node={totpImage}\n attributes={{\n ...(totpImage.attributes as UiNodeImageAttributes),\n }}\n />\n </div>\n </div>\n </div>\n <div className=\"flex flex-col gap-6\">\n <Node.Label\n node={totpSecret}\n attributes={totpSecret.attributes as UiNodeInputAttributes}\n >\n <Node.Input\n node={totpSecret}\n attributes={{\n disabled: true,\n name: \"totp_secret_key\",\n node_type: \"input\",\n type: \"text\",\n value: (totpSecret.attributes as UiNodeTextAttributes).text\n .text,\n }}\n />\n </Node.Label>\n <Node.Label\n attributes={totpInput.attributes as UiNodeInputAttributes}\n node={totpInput}\n >\n <Node.CodeInput\n node={totpInput}\n attributes={totpInput.attributes as UiNodeInputAttributes}\n />\n </Node.Label>\n </div>\n </div>\n )\n }\n}\n","import * as React from \"react\";\nconst SvgQrcode = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} fill=\"none\" {...props}><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\" /></svg>;\nexport default SvgQrcode;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNodeInputAttributes } from \"@ory/client-fetch\"\nimport { OrySettingsWebauthnProps, useComponents } from \"@ory/elements-react\"\nimport Key from \"../../assets/icons/key.svg\"\nimport Trash from \"../../assets/icons/trash.svg\"\nimport { useFormContext } from \"react-hook-form\"\nimport { Spinner } from \"../form/spinner\"\n\nexport function DefaultSettingsWebauthn({\n nameInput,\n triggerButton,\n removeButtons,\n}: OrySettingsWebauthnProps) {\n const {\n formState: { isSubmitting },\n } = useFormContext()\n const { Node, Card } = useComponents()\n const hasRemoveButtons = removeButtons.length > 0\n\n return (\n <div className=\"flex flex-col gap-8\">\n <div className=\"flex md:max-w-96 sm:items-end gap-3 flex-col sm:flex-row\">\n <div className=\"flex-1\">\n <Node.Label\n node={nameInput}\n attributes={nameInput.attributes as UiNodeInputAttributes}\n >\n <Node.Input\n node={nameInput}\n attributes={nameInput.attributes as UiNodeInputAttributes}\n />\n </Node.Label>\n </div>\n {triggerButton ? (\n <Node.Button\n node={triggerButton}\n attributes={triggerButton.attributes as UiNodeInputAttributes}\n onClick={triggerButton.onClick}\n />\n ) : null}\n </div>\n {hasRemoveButtons ? (\n <div className=\"flex flex-col gap-8\">\n <Card.Divider />\n <div className=\"flex flex-col gap-4\">\n {removeButtons.map((node, i) => {\n const context = node.meta.label?.context ?? {}\n const addedAt =\n \"added_at\" in context ? (context.added_at as string) : null\n const displayName =\n \"display_name\" in context\n ? (context.display_name as string)\n : null\n const keyId =\n \"value\" in node.attributes ? node.attributes.value : null\n\n return (\n <div\n className=\"flex justify-between gap-6 md:items-center\"\n key={`webauthn-remove-button-${i}`}\n >\n <div className=\"flex gap-2 items-center flex-1\">\n <Key\n size={32}\n className=\"text-interface-foreground-default-primary\"\n />\n <div className=\"flex-1 flex-col md:flex-row md:items-center flex md:justify-between gap-4\">\n <div className=\"flex-1 flex-col\">\n <p className=\"text-sm font-medium text-interface-foreground-default-secondary\">\n {displayName}\n </p>\n <span className=\"text-sm text-interface-foreground-default-tertiary hidden sm:block\">\n {keyId}\n </span>\n </div>\n {addedAt && (\n <p className=\"text-sm text-interface-foreground-default-tertiary\">\n {new Intl.DateTimeFormat(undefined, {\n dateStyle: \"long\",\n }).format(new Date(addedAt))}\n </p>\n )}\n </div>\n </div>\n <button\n {...(node.attributes as UiNodeInputAttributes)}\n type=\"submit\"\n onClick={node.onClick}\n disabled={isSubmitting}\n className=\"relative\"\n >\n {isSubmitting ? (\n <Spinner className=\"relative\" />\n ) : (\n <Trash\n className=\"text-button-link-default-secondary hover:text-button-link-default-secondary-hover\"\n size={24}\n />\n )}\n </button>\n </div>\n )\n })}\n </div>\n </div>\n ) : null}\n </div>\n )\n}\n","import * as React from \"react\";\nconst SvgKey = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgKey;","// Copyright © 2025 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PropsWithChildren } from \"react\"\n\nexport function DefaultAuthMethodListContainer({\n children,\n}: PropsWithChildren) {\n return <div className=\"grid grid-cols-1 gap-2\">{children}</div>\n}\n","// Copyright © 2025 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { isUiNodeInputAttributes } from \"@ory/client-fetch\"\nimport { NodeProps } from \"../../../../components/form/nodes/node\"\nimport { Turnstile, TurnstileInstance } from \"@marsidev/react-turnstile\"\nimport { ReactElement, useRef } from \"react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { NodeInput } from \"../../../../components/form/nodes/input\"\n\ntype Config = {\n sitekey: string\n action: string\n theme: \"auto\" | \"light\" | \"dark\"\n response_field_name: string\n}\n\nexport const DefaultCaptcha = ({ node }: NodeProps) => {\n const { setValue } = useFormContext()\n const ref = useRef<TurnstileInstance>()\n // In this node, we only care about the `captcha-turnstile-options` node as that contains\n // all required information to render the captcha.\n const nodes: ReactElement[] = []\n\n // Special case for CAPTCHA handling as we need to render a different component\n if (isUiNodeInputAttributes(node.attributes)) {\n if (\n node.attributes.name === \"transient_payload.captcha_turnstile_response\"\n ) {\n nodes.push(<NodeInput key={1} node={node} attributes={node.attributes} />)\n }\n }\n\n if (\n isUiNodeInputAttributes(node.attributes) &&\n node.attributes.name === \"captcha_turnstile_options\"\n ) {\n const options: Config = JSON.parse(node.attributes.value as string)\n nodes.push(\n <Turnstile\n key={2}\n ref={ref}\n siteKey={options.sitekey}\n options={{\n action: options.action,\n size: \"flexible\",\n theme: options.theme,\n responseField: false,\n responseFieldName: options.response_field_name,\n }}\n onExpire={() => ref.current?.reset()}\n onSuccess={(token) => {\n setValue(options.response_field_name, token)\n }}\n />,\n )\n }\n\n return nodes\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n isUiNodeInputAttributes,\n UiNode,\n UiNodeGroupEnum,\n} from \"@ory/client-fetch\"\nimport { PropsWithChildren, createContext, useContext } from \"react\"\nimport { OryFlowComponents } from \"../components\"\n\ntype ComponentContextValue = {\n components: OryFlowComponents\n nodeSorter: (a: UiNode, b: UiNode, ctx: { flowType: string }) => number\n groupSorter: (a: UiNodeGroupEnum, b: UiNodeGroupEnum) => number\n}\n\nconst ComponentContext = createContext<ComponentContextValue>({\n components: null!, // fine because we throw an error if it's not provided\n nodeSorter: () => 0,\n groupSorter: () => 0,\n})\n\nexport function useComponents() {\n const ctx = useContext(ComponentContext)\n if (!ctx) {\n throw new Error(\"useComponents must be used within a ComponentProvider\")\n }\n return ctx.components\n}\n\nexport function useNodeSorter() {\n const ctx = useContext(ComponentContext)\n if (!ctx) {\n throw new Error(\"useNodeSorter must be used within a ComponentProvider\")\n }\n return ctx.nodeSorter\n}\n\nexport function useGroupSorter() {\n const ctx = useContext(ComponentContext)\n if (!ctx) {\n throw new Error(\"useGroupSorter must be used within a ComponentProvider\")\n }\n return ctx.groupSorter\n}\n\nconst defaultNodeOrder = [\n \"oidc\",\n \"identifier_first\",\n \"default\",\n \"profile\",\n \"password\",\n // CAPTCHA is below password because otherwise the password input field\n // would be above the captcha. Somehow, we sort the password sign up button somewhere else to be always at the bottom.\n \"captcha\",\n \"passkey\",\n \"code\",\n \"webauthn\",\n]\n\nfunction defaultNodeSorter(\n a: UiNode,\n b: UiNode,\n // ctx: { flowType: string },\n): number {\n const aGroupWeight = defaultNodeOrder.indexOf(a.group) ?? 999\n const bGroupWeight = defaultNodeOrder.indexOf(b.group) ?? 999\n\n if (\n b.group === \"captcha\" &&\n isUiNodeInputAttributes(a.attributes) &&\n a.attributes.type === \"submit\"\n ) {\n // If the current node is a submit button and the next node is CAPTCHA; we sort the captcha before the submit button.\n return aGroupWeight - (bGroupWeight - 2)\n } else if (\n a.group === \"captcha\" &&\n isUiNodeInputAttributes(b.attributes) &&\n b.attributes.type === \"submit\"\n ) {\n // If one node is a submit button and the other is CAPTCHA, we sort the captcha before the submit button.\n return aGroupWeight - 2 - bGroupWeight\n }\n\n return aGroupWeight - bGroupWeight\n}\n\nconst defaultGroupOrder: UiNodeGroupEnum[] = [\n UiNodeGroupEnum.Default,\n UiNodeGroupEnum.Profile,\n UiNodeGroupEnum.Password,\n UiNodeGroupEnum.Oidc,\n UiNodeGroupEnum.Code,\n UiNodeGroupEnum.LookupSecret,\n UiNodeGroupEnum.Passkey,\n UiNodeGroupEnum.Webauthn,\n UiNodeGroupEnum.Totp,\n]\n\nfunction defaultGroupSorter(a: UiNodeGroupEnum, b: UiNodeGroupEnum): number {\n const aGroupWeight = defaultGroupOrder.indexOf(a) ?? 999\n const bGroupWeight = defaultGroupOrder.indexOf(b) ?? 999\n\n return aGroupWeight - bGroupWeight\n}\n\ntype ComponentProviderProps = {\n components: OryFlowComponents\n nodeSorter?: (a: UiNode, b: UiNode, ctx: { flowType: string }) => number\n groupSorter?: (a: UiNodeGroupEnum, b: UiNodeGroupEnum) => number\n}\n\nexport function OryComponentProvider({\n children,\n components,\n nodeSorter = defaultNodeSorter,\n groupSorter = defaultGroupSorter,\n}: PropsWithChildren<ComponentProviderProps>) {\n return (\n <ComponentContext.Provider\n value={{\n components,\n nodeSorter,\n groupSorter,\n }}\n >\n {children}\n </ComponentContext.Provider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n Dispatch,\n PropsWithChildren,\n createContext,\n useContext,\n useState,\n} from \"react\"\nimport { OryFlowContainer } from \"../util/flowContainer\"\nimport { FormState, FormStateAction, useFormStateReducer } from \"./form-state\"\n\n/**\n * Returns an object that contains the current flow and the flow type, as well as the configuration.\n *\n * @returns The current flow container\n */\nexport function useOryFlow() {\n const ctx = useContext(OryFlowContext)\n if (!ctx) {\n throw new Error(\"useOryFlow must be used within a OryFlowProvider\")\n }\n\n return ctx\n}\n\n/**\n * Function to set the flow container.\n */\nexport type FlowContainerSetter = Dispatch<OryFlowContainer>\n\n/**\n * The return value of the OryFlowContext.\n */\nexport type FlowContextValue = OryFlowContainer & {\n /**\n * Function to set the flow container.\n */\n setFlowContainer: FlowContainerSetter\n\n /**\n * The current form state.\n * @see FormState\n */\n formState: FormState\n\n /**\n * Dispatch function to update the form state.\n */\n dispatchFormState: Dispatch<FormStateAction>\n}\n\n// This is fine, because we don't export the context itself and guard from it being null in useOryFlow\nconst OryFlowContext = createContext<FlowContextValue>(null!)\n\nexport type OryFlowProviderProps = PropsWithChildren<OryFlowContainer>\n\nexport function OryFlowProvider({\n children,\n ...container\n}: OryFlowProviderProps) {\n const [flowContainer, setFlowContainer] = useState(container)\n const [formState, dispatchFormState] = useFormStateReducer(container)\n\n return (\n <OryFlowContext.Provider\n value={\n {\n ...flowContainer,\n setFlowContainer: (flowContainer) => {\n setFlowContainer(flowContainer)\n dispatchFormState({\n type: \"action_flow_update\",\n flow: flowContainer,\n })\n },\n formState,\n dispatchFormState,\n } as FlowContextValue\n }\n >\n {children}\n </OryFlowContext.Provider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { FlowType, UiNode, UiNodeGroupEnum } from \"@ory/client-fetch\"\nimport { useReducer } from \"react\"\nimport { isChoosingMethod } from \"../components/card/card-two-step.utils\"\nimport { OryFlowContainer } from \"../util\"\nimport { nodesToAuthMethodGroups } from \"../util/ui\"\n\nexport type FormState =\n | { current: \"provide_identifier\" }\n | { current: \"select_method\" }\n | { current: \"method_active\"; method: UiNodeGroupEnum }\n | { current: \"success_screen\" }\n | { current: \"settings\" }\n\nexport type FormStateAction =\n | {\n type: \"action_flow_update\"\n flow: OryFlowContainer\n }\n | {\n type: \"action_select_method\"\n method: UiNodeGroupEnum\n }\n\nfunction findMethodWithMessage(nodes?: UiNode[]) {\n return nodes\n ?.filter((n) => ![\"default\", \"identifier_first\"].includes(n.group))\n ?.find((node) => node.messages?.length > 0)\n}\n\nfunction parseStateFromFlow(flow: OryFlowContainer): FormState {\n switch (flow.flowType) {\n case FlowType.Registration:\n case FlowType.Login: {\n const methodWithMessage = findMethodWithMessage(flow.flow.ui.nodes)\n if (flow.flow.active == \"link_recovery\") {\n return { current: \"method_active\", method: \"link\" }\n } else if (flow.flow.active == \"code_recovery\") {\n return { current: \"method_active\", method: \"code\" }\n } else if (methodWithMessage) {\n return { current: \"method_active\", method: methodWithMessage.group }\n } else if (\n flow.flow.active &&\n ![\"default\", \"identifier_first\", \"oidc\"].includes(flow.flow.active)\n ) {\n return { current: \"method_active\", method: flow.flow.active }\n } else if (isChoosingMethod(flow.flow.ui.nodes)) {\n // Login has a special case where we only have one method. Here, we\n // do not want to display the chooser.\n const authMethods = nodesToAuthMethodGroups(flow.flow.ui.nodes)\n // TODO: https://github.com/ory/kratos/issues/4271 - once this is fixed in Kratos, we can remove the check for \"code\"\n if (authMethods.length === 1 && authMethods[0] !== \"code\") {\n return { current: \"method_active\", method: authMethods[0] }\n }\n return { current: \"select_method\" }\n } else if (flow.flow.ui.messages?.some((m) => m.id === 1010016)) {\n // Account linking edge case\n return { current: \"select_method\" }\n }\n return { current: \"provide_identifier\" }\n }\n case FlowType.Recovery:\n case FlowType.Verification:\n // The API does not provide types for the active field of the recovery flow\n // TODO: Add types for the recovery flow in Kratos\n if (flow.flow.active === \"code\" || flow.flow.active === \"link\") {\n if (flow.flow.state === \"choose_method\") {\n return { current: \"provide_identifier\" }\n }\n return { current: \"method_active\", method: flow.flow.active }\n }\n break\n case FlowType.Settings:\n return { current: \"settings\" }\n }\n console.warn(\n `[Ory/Elements React] Encountered an unknown form state on ${flow.flowType} flow with ID ${flow.flow.id}`,\n )\n throw new Error(\"Unknown form state\")\n}\n\nexport function formStateReducer(\n state: FormState,\n action: FormStateAction,\n): FormState {\n switch (action.type) {\n case \"action_flow_update\":\n return parseStateFromFlow(action.flow)\n case \"action_select_method\":\n return { current: \"method_active\", method: action.method }\n }\n return state\n}\n\nexport function useFormStateReducer(flow: OryFlowContainer) {\n return useReducer(formStateReducer, parseStateFromFlow(flow))\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode, UiNodeGroupEnum } from \"@ory/client-fetch\"\n\nexport function isChoosingMethod(uiNodes: UiNode[]): boolean {\n return (\n uiNodes.some(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"screen\" &&\n \"value\" in node.attributes &&\n node.attributes.value === \"previous\",\n ) ||\n uiNodes.some(\n (node) =>\n node.group === UiNodeGroupEnum.IdentifierFirst &&\n \"name\" in node.attributes &&\n node.attributes.name === \"identifier\" &&\n node.attributes.type === \"hidden\",\n )\n )\n}\n\nexport function filterOidcOut(nodes: UiNode[]): UiNode[] {\n return nodes.filter((node) => node.group !== UiNodeGroupEnum.Oidc)\n}\n\nexport function getFinalNodes(\n uniqueGroups: Partial<Record<UiNodeGroupEnum, UiNode[]>>,\n selectedGroup: UiNodeGroupEnum | undefined,\n): UiNode[] {\n const selectedNodes: UiNode[] = selectedGroup\n ? (uniqueGroups[selectedGroup] ?? [])\n : []\n\n return [\n ...(uniqueGroups?.identifier_first ?? []),\n ...(uniqueGroups?.default ?? []),\n ...(uniqueGroups?.captcha ?? []),\n ]\n .flat()\n .filter(\n (node) => \"type\" in node.attributes && node.attributes.type === \"hidden\",\n )\n .concat(selectedNodes)\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode } from \"@ory/client-fetch\"\n\nimport type {\n UiNodeInputAttributesOnclickTriggerEnum,\n UiNodeInputAttributesOnloadTriggerEnum,\n UiNodeInputAttributesTypeEnum,\n} from \"@ory/client-fetch\"\nimport { UiNodeGroupEnum } from \"@ory/client-fetch\"\nimport { useMemo } from \"react\"\nimport { useGroupSorter } from \"../../context/component\"\n\nexport function capitalize(s: string) {\n if (!s) {\n return s\n }\n return s.charAt(0).toUpperCase() + s.slice(1)\n}\n\nexport type FilterNodesByGroups = {\n nodes: UiNode[]\n groups?: UiNodeGroupEnum[] | UiNodeGroupEnum\n withoutDefaultGroup?: boolean\n attributes?: UiNodeInputAttributesTypeEnum[] | UiNodeInputAttributesTypeEnum\n withoutDefaultAttributes?: boolean\n excludeAttributes?:\n | UiNodeInputAttributesTypeEnum[]\n | UiNodeInputAttributesTypeEnum\n}\n\nexport function triggerToWindowCall(\n trigger:\n | UiNodeInputAttributesOnclickTriggerEnum\n | UiNodeInputAttributesOnloadTriggerEnum\n | undefined,\n) {\n if (!trigger) {\n return\n }\n\n const fn = triggerToFunction(trigger)\n if (fn) {\n fn()\n return\n }\n\n // Retry every 100ms for 10 seconds\n let i = 0\n const ms = 100\n const interval = setInterval(() => {\n i++\n if (i > 100) {\n clearInterval(interval)\n throw new Error(\n \"Unable to load Ory's WebAuthn script. Is it being blocked or otherwise failing to load? If you are running an old version of Ory Elements, please upgrade. For more information, please check your browser's developer console.\",\n )\n }\n\n const fn = triggerToFunction(trigger)\n if (fn) {\n clearInterval(interval)\n return fn()\n }\n }, ms)\n return\n}\n\nfunction triggerToFunction(\n trigger:\n | UiNodeInputAttributesOnclickTriggerEnum\n | UiNodeInputAttributesOnloadTriggerEnum,\n) {\n if (typeof window === \"undefined\") {\n console.debug(\n \"The Ory SDK is missing a required function: window is undefined.\",\n )\n return undefined\n }\n\n const typedWindow = window as { [key: string]: any } // eslint-disable-line @typescript-eslint/no-explicit-any\n if (!(trigger in typedWindow) || !typedWindow[trigger]) {\n console.debug(`The Ory SDK is missing a required function: ${trigger}.`)\n return undefined\n }\n const triggerFn = typedWindow[trigger]\n if (typeof triggerFn !== \"function\") {\n console.debug(\n `The Ory SDK is missing a required function: ${trigger}. It is not a function.`,\n )\n return undefined\n }\n return triggerFn as () => void\n}\n\ntype Entries<T> = {\n [K in keyof T]: [K, T[K]]\n}[keyof T][]\n\n/**\n * Returns a list of auth methods from a list of nodes. For example,\n * if Password and Passkey are present, it will return [password, passkey].\n *\n * Please note that OIDC is not considered an auth method because it is\n * usually shown as a separate auth method\n *\n * This method the default, identifier_first, and profile groups.\n *\n * @param nodes - The nodes to extract the auth methods from\n * @param excludeAuthMethods - A list of auth methods to exclude\n */\nexport function nodesToAuthMethodGroups(\n nodes: Array<UiNode>,\n excludeAuthMethods = [],\n): UiNodeGroupEnum[] {\n const groups: Partial<Record<UiNodeGroupEnum, UiNode[]>> = {}\n\n for (const node of nodes) {\n if (node.type === \"script\") {\n // We always render all scripts, because the scripts for passkeys are part of the webauthn group,\n // which leads to this hook returning a webauthn group on passkey flows (which it should not - webauthn is the \"legacy\" passkey implementation).\n continue\n }\n const groupNodes = groups[node.group] ?? []\n groupNodes.push(node)\n groups[node.group] = groupNodes\n }\n\n return Object.values(UiNodeGroupEnum)\n .filter((group) => groups[group]?.length)\n .filter(\n (group) =>\n !(\n [\n UiNodeGroupEnum.Default,\n UiNodeGroupEnum.IdentifierFirst,\n UiNodeGroupEnum.Profile,\n UiNodeGroupEnum.Captcha,\n ...excludeAuthMethods,\n ] as UiNodeGroupEnum[]\n ).includes(group),\n )\n}\n\n/**\n * Groups nodes by their group and returns an object with the groups and entries.\n *\n * @param nodes - The nodes to group\n */\nexport function useNodesGroups(nodes: UiNode[]) {\n const groupSorter = useGroupSorter()\n\n const groups = useMemo(() => {\n const groups: Partial<Record<UiNodeGroupEnum, UiNode[]>> = {}\n\n for (const node of nodes) {\n if (node.type === \"script\") {\n // We always render all scripts, because the scripts for passkeys are part of the webauthn group,\n // which leads to this hook returning a webauthn group on passkey flows (which it should not - webauthn is the \"legacy\" passkey implementation).\n continue\n }\n const groupNodes = groups[node.group] ?? []\n groupNodes.push(node)\n groups[node.group] = groupNodes\n }\n\n return groups\n }, [nodes])\n\n const entries = useMemo(\n () =>\n (\n Object.entries(groups) as Entries<Record<UiNodeGroupEnum, UiNode[]>>\n ).sort(([a], [b]) => groupSorter(a, b)),\n [groups, groupSorter],\n )\n\n return {\n groups,\n entries,\n }\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PropsWithChildren } from \"react\"\nimport { IntlProvider as OriginalIntlProvider } from \"react-intl\"\nimport { OryLocales } from \"..\"\nimport { LocaleMap } from \"../locales\"\n\n// ISO 639-1 language codes\n// https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\nexport const LanguageCodes = [\n \"ab\",\n \"aa\",\n \"af\",\n \"sq\",\n \"am\",\n \"ar\",\n \"hy\",\n \"as\",\n \"ay\",\n \"az\",\n \"ba\",\n \"eu\",\n \"bn\",\n \"dz\",\n \"bh\",\n \"bi\",\n \"br\",\n \"bg\",\n \"my\",\n \"be\",\n \"km\",\n \"ca\",\n \"zh\",\n \"co\",\n \"hr\",\n \"cs\",\n \"da\",\n \"nl\",\n \"en\",\n \"eo\",\n \"et\",\n \"fo\",\n \"fj\",\n \"fi\",\n \"fr\",\n \"fy\",\n \"gd\",\n \"gl\",\n \"ka\",\n \"de\",\n \"el\",\n \"kl\",\n \"gn\",\n \"gu\",\n \"ha\",\n \"iw\",\n \"hi\",\n \"hu\",\n \"is\",\n \"in\",\n \"ia\",\n \"ie\",\n \"ik\",\n \"ga\",\n \"it\",\n \"ja\",\n \"jw\",\n \"kn\",\n \"ks\",\n \"kk\",\n \"rw\",\n \"ky\",\n \"rn\",\n \"ko\",\n \"ku\",\n \"lo\",\n \"la\",\n \"lv\",\n \"ln\",\n \"lt\",\n \"mk\",\n \"mg\",\n \"ms\",\n \"ml\",\n \"mt\",\n \"mi\",\n \"mr\",\n \"mo\",\n \"mn\",\n \"na\",\n \"ne\",\n \"no\",\n \"oc\",\n \"or\",\n \"om\",\n \"ps\",\n \"fa\",\n \"pl\",\n \"pt\",\n \"pa\",\n \"qu\",\n \"rm\",\n \"ro\",\n \"ru\",\n \"sm\",\n \"sg\",\n \"sa\",\n \"sr\",\n \"sh\",\n \"st\",\n \"tn\",\n \"sn\",\n \"sd\",\n \"si\",\n \"ss\",\n \"sk\",\n \"sl\",\n \"so\",\n \"es\",\n \"su\",\n \"sw\",\n \"sv\",\n \"tl\",\n \"tg\",\n \"ta\",\n \"tt\",\n \"te\",\n \"th\",\n \"bo\",\n \"ti\",\n \"to\",\n \"ts\",\n \"tr\",\n \"tk\",\n \"tw\",\n \"uk\",\n \"ur\",\n \"uz\",\n \"vi\",\n \"vo\",\n \"cy\",\n \"wo\",\n \"xh\",\n \"ji\",\n \"yo\",\n \"zu\",\n] as const\n\nexport type Locale = keyof typeof OryLocales\n\nexport type IntlContextProps = {\n locale: Locale\n customTranslations?: Partial<LocaleMap>\n}\n\nfunction mergeTranslations(customTranslations: Partial<LocaleMap>) {\n return Object.keys(customTranslations).reduce((acc, key) => {\n acc[key] = { ...OryLocales[key], ...customTranslations[key] }\n return acc\n }, OryLocales)\n}\n\nexport const IntlProvider = ({\n children,\n locale,\n customTranslations,\n}: PropsWithChildren<IntlContextProps>) => {\n const messages = mergeTranslations(customTranslations ?? {})\n\n return (\n <OriginalIntlProvider\n onWarn={() => ({})}\n defaultRichTextElements={{\n del: (chunks) => <del>{chunks}</del>,\n }}\n locale={locale}\n messages={messages[locale]}\n defaultLocale=\"en\"\n >\n {children}\n </OriginalIntlProvider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useComponents } from \"../../context\"\n\nexport type OryCardHeaderProps = Record<string, never>\n\nexport function OryCardHeader() {\n const { Card } = useComponents()\n return <Card.Header />\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode, UiNodeGroupEnum } from \"@ory/client-fetch\"\nimport { PropsWithChildren } from \"react\"\nimport { FormProvider, useForm } from \"react-hook-form\"\nimport { useOryFlow } from \"../../context\"\nimport { computeDefaultValues } from \"./form-helpers\"\nimport { useOryFormResolver } from \"./form-resolver\"\n\nexport function OryFormProvider({\n children,\n nodes,\n}: PropsWithChildren & { nodes?: UiNode[] }) {\n const flowContainer = useOryFlow()\n const defaultNodes = nodes\n ? flowContainer.flow.ui.nodes\n .filter((node) => node.group === UiNodeGroupEnum.Default)\n .concat(nodes)\n : flowContainer.flow.ui.nodes\n\n const methods = useForm({\n // TODO: Generify this, so we have typesafety in the submit handler.\n defaultValues: computeDefaultValues(defaultNodes),\n resolver: useOryFormResolver(),\n })\n\n return <FormProvider {...methods}>{children}</FormProvider>\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { isUiNodeInputAttributes, UiNode } from \"@ory/client-fetch\"\nimport { FormValues } from \"../../types\"\n\nexport function computeDefaultValues(nodes: UiNode[]): FormValues {\n return nodes.reduce<FormValues>((acc, node) => {\n const attrs = node.attributes\n\n if (isUiNodeInputAttributes(attrs)) {\n // TODO: Kratos should return false for the value here, and not undefined.\n if (attrs.type === \"checkbox\" && typeof attrs.value === \"undefined\") {\n attrs.value = false\n }\n // Skip the \"method\" field and \"submit\" button\n if (\n attrs.name === \"method\" ||\n attrs.type === \"submit\" ||\n typeof attrs.value === \"undefined\"\n ) {\n return acc\n }\n\n // Unroll nested traits or assign default values\n return unrollTrait(\n {\n name: attrs.name,\n value: attrs.value,\n },\n acc,\n )\n }\n\n return acc\n }, {})\n}\n\nexport function unrollTrait<T extends string, V>(\n input: { name: T; value: V },\n output: Partial<UnrollTrait<T, V>> = {},\n): UnrollTrait<T, V> {\n const keys = input.name.split(\".\")\n\n // It's challenging to type this for deeply nested structures because the shape\n // of current changes dynamically as we navigate through levels.\n // TODO(jonas): This is not ideal. We should be able to type this properly.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let current: any = output\n keys.forEach((key, index) => {\n if (!key) return\n current = current[key] =\n index === keys.length - 1 ? input.value : current[key] || {}\n })\n\n return output as UnrollTrait<T, V>\n}\n\ntype UnrollTrait<T extends string, V> = T extends `${infer Head}.${infer Tail}`\n ? { [K in Head]: UnrollTrait<Tail, V> }\n : { [K in T]: V }\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useOryFlow } from \"../../context\"\nimport { FormValues } from \"../../types\"\nimport { isUiNodeInputAttributes } from \"@ory/client-fetch\"\n\nfunction isCodeResendRequest(data: FormValues) {\n // There are two types of resend - one\n return data.email ?? data.resend\n}\n\n/**\n * Creates a resolver for the Ory form\n *\n * The resolver does form validation for missing fields in the form.\n *\n * @returns a react-hook-form resolver for the Ory form\n */\nexport function useOryFormResolver() {\n const flowContainer = useOryFlow()\n\n return (data: FormValues) => {\n if (flowContainer.formState.current === \"method_active\") {\n // This is a workaround which prevents the flow from being submitted without a code,\n // which in some cases can cause issues in Ory Kratos' resend detection.\n if (\n // When we submit a code\n data.method === \"code\" &&\n // And the code is not present\n !data.code &&\n // And the flow is not a code resend request\n !isCodeResendRequest(data) &&\n // And the flow has a code input node\n flowContainer.flow.ui.nodes.find(({ attributes, group }) => {\n if (!isUiNodeInputAttributes(attributes)) {\n return false\n }\n\n return (\n group === \"code\" &&\n attributes.name === \"code\" &&\n attributes.type !== \"hidden\"\n )\n })\n ) {\n return {\n values: data,\n errors: {\n // We know the code node exists, so we can safely hardcode the ID.\n code: {\n id: 4000002,\n context: {\n property: \"code\",\n },\n type: \"error\",\n text: \"Property code is missing\",\n },\n },\n }\n }\n }\n return {\n values: data,\n errors: {},\n }\n }\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PropsWithChildren } from \"react\"\nimport { useComponents } from \"../../context\"\nimport { OryFormProvider } from \"../form/form-provider\"\n\nexport type OryCardRootProps = PropsWithChildren\n\n/**\n * The root component of the Ory Card.\n *\n * This can be used to build fully custom implementations of the Ory Flows.\n *\n * However, you most likely want to override the individual components instead.\n *\n * @param props - pass children to render instead of the default Ory Card components\n * @returns\n */\nexport function OryCard({ children }: PropsWithChildren) {\n const { Card } = useComponents()\n return (\n <Card.Root>\n <OryFormProvider>{children}</OryFormProvider>\n </Card.Root>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useComponents } from \"../../context\"\n\nexport type OryCardFooterProps = Record<string, never>\n\nexport function OryCardFooter() {\n const { Card } = useComponents()\n return <Card.Footer />\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PropsWithChildren } from \"react\"\nimport { useComponents } from \"../../context\"\n\n/**\n * Props for the OryCardContent component.\n */\nexport type OryCardContentProps = PropsWithChildren\n\n/**\n * A component that renders the content of the Ory Card.\n * This is the main content of the card, such as the flow's form, with it's input fields and messages.\n *\n * You can use this component to build fully custom implementations of the Ory Flows.\n *\n * However, you most likely want to override the individual components instead.\n *\n * @param props - pass children to render instead of the default Ory Card components\n * @returns\n */\nexport function OryCardContent({ children }: OryCardContentProps) {\n const { Card } = useComponents()\n\n return <Card.Content>{children}</Card.Content>\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode, UiNodeGroupEnum } from \"@ory/client-fetch\"\nimport { useFormContext } from \"react-hook-form\"\nimport { OryCard, OryCardContent, OryCardFooter } from \".\"\nimport { useComponents, useNodeSorter, useOryFlow } from \"../../context\"\nimport { isGroupImmediateSubmit } from \"../../theme/default/utils/form\"\nimport { useNodesGroups } from \"../../util/ui\"\nimport { OryForm } from \"../form/form\"\nimport { OryCardValidationMessages } from \"../form/messages\"\nimport { Node } from \"../form/nodes/node\"\nimport { OryFormSocialButtonsForm } from \"../form/social\"\nimport { filterOidcOut, getFinalNodes } from \"./card-two-step.utils\"\nimport { OryCardHeader } from \"./header\"\n\nfunction isUINodeGroupEnum(method: string): method is UiNodeGroupEnum {\n // @ts-expect-error it's a string array, but typescript thinks the argument must be validated stricter\n return Object.values(UiNodeGroupEnum).includes(method)\n}\n\nexport function OryTwoStepCard() {\n const {\n flow: { ui },\n flowType,\n formState,\n dispatchFormState,\n } = useOryFlow()\n\n const { Form, Card } = useComponents()\n\n const nodeSorter = useNodeSorter()\n const sortNodes = (a: UiNode, b: UiNode) => nodeSorter(a, b, { flowType })\n\n const uniqueGroups = useNodesGroups(ui.nodes)\n\n const options: UiNodeGroupEnum[] = Object.values(UiNodeGroupEnum)\n .filter((group) => uniqueGroups.groups[group]?.length)\n .filter(\n (group) =>\n !(\n [\n UiNodeGroupEnum.Oidc,\n UiNodeGroupEnum.Default,\n UiNodeGroupEnum.IdentifierFirst,\n UiNodeGroupEnum.Profile,\n UiNodeGroupEnum.Captcha,\n ] as UiNodeGroupEnum[]\n ).includes(group),\n )\n\n const nonOidcNodes = filterOidcOut(ui.nodes)\n const finalNodes =\n formState.current === \"method_active\"\n ? getFinalNodes(uniqueGroups.groups, formState.method)\n : []\n\n const handleAfterFormSubmit = (method: unknown) => {\n if (typeof method !== \"string\" || !isUINodeGroupEnum(method)) {\n return\n }\n if (isGroupImmediateSubmit(method)) {\n dispatchFormState({\n type: \"action_select_method\",\n method: method,\n })\n }\n }\n const hasOidc = ui.nodes.some((node) => node.group === UiNodeGroupEnum.Oidc)\n\n // We want to show the OIDC buttons on all screens, except when the user has selected a different method.\n const showOidc = !(\n formState.current === \"method_active\" && formState.method !== \"oidc\"\n )\n\n return (\n <OryCard>\n <OryCardHeader />\n <OryCardContent>\n <OryCardValidationMessages />\n {showOidc && <OryFormSocialButtonsForm />}\n <OryForm onAfterSubmit={handleAfterFormSubmit}>\n <Form.Group>\n {formState.current === \"provide_identifier\" && (\n <>\n {hasOidc && <Card.Divider />}\n {nonOidcNodes.sort(sortNodes).map((node, k) => (\n <Node node={node} key={k} />\n ))}\n </>\n )}\n {formState.current === \"select_method\" && (\n <>\n <Card.Divider />\n <AuthMethodList\n options={options}\n setSelectedGroup={(group) =>\n dispatchFormState({\n type: \"action_select_method\",\n method: group,\n })\n }\n />\n {ui.nodes\n .filter((n) => n.group === UiNodeGroupEnum.Captcha)\n .map((node, k) => (\n <Node node={node} key={k} />\n ))}\n </>\n )}\n {formState.current === \"method_active\" && (\n <>\n {ui.nodes\n .filter((n) => n.type === \"script\")\n .map((node, k) => (\n <Node node={node} key={k} />\n ))}\n {finalNodes.sort(sortNodes).map((node, k) => (\n <Node node={node} key={k} />\n ))}\n </>\n )}\n </Form.Group>\n <OryCardFooter />\n </OryForm>\n </OryCardContent>\n </OryCard>\n )\n}\n\ntype AuthMethodListProps = {\n options: UiNodeGroupEnum[]\n setSelectedGroup: (group: UiNodeGroupEnum) => void\n}\n\nfunction AuthMethodList({ options, setSelectedGroup }: AuthMethodListProps) {\n const { Card } = useComponents()\n const { setValue } = useFormContext()\n\n const handleClick = (group: UiNodeGroupEnum) => {\n if (isGroupImmediateSubmit(group)) {\n // If the method is \"immediate submit\" (e.g. the method's submit button should be triggered immediately)\n // then the method needs to be added to the form data.\n setValue(\"method\", group)\n } else {\n setSelectedGroup(group)\n }\n }\n return (\n <Card.AuthMethodListContainer>\n {options.map((option) => (\n <Card.AuthMethodListItem\n key={option}\n group={option}\n onClick={() => handleClick(option)}\n />\n ))}\n </Card.AuthMethodListContainer>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n isUiNodeAnchorAttributes,\n isUiNodeImageAttributes,\n isUiNodeInputAttributes,\n isUiNodeScriptAttributes,\n} from \"@ory/client-fetch\"\nimport { ComponentType, PropsWithChildren } from \"react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { useComponents, useOryFlow } from \"../../context\"\nimport {\n OryCardAuthMethodListItemProps,\n OryCardLogoProps,\n OryFormRootProps,\n OryFormSectionContentProps,\n OryFormSectionFooterProps,\n OryNodeAnchorProps,\n OryNodeButtonProps,\n OryNodeCaptchaProps,\n OryNodeImageProps,\n OryNodeInputProps,\n OryNodeLabelProps,\n OryNodeTextProps,\n} from \"../../types\"\nimport { OryCardFooterProps } from \"../card\"\nimport { OryCardRootProps } from \"../card/card\"\nimport { OryCardContentProps } from \"../card/content\"\nimport { OryPageHeaderProps } from \"../generic\"\nimport { OryCardDividerProps } from \"../generic/divider\"\nimport {\n OrySettingsOidcProps,\n OrySettingsPasskeyProps,\n OrySettingsRecoveryCodesProps,\n OrySettingsTotpProps,\n OrySettingsWebauthnProps,\n} from \"../settings\"\nimport { OryFormGroupProps } from \"./groups\"\nimport { OryMessageContentProps, OryMessageRootProps } from \"./messages\"\nimport { OryCardSettingsSectionProps } from \"./section\"\nimport { OryFormOidcRootProps, OryNodeOidcButtonProps } from \"./social\"\nimport { useOryFormSubmit } from \"./useOryFormSubmit\"\n\n/**\n * A record of all the components that are used in the OryForm component.\n */\nexport type OryFlowComponents = {\n Node: {\n /**\n * Button component, rendered whenever a button is encountered in the Ory UI Nodes.\n */\n Button: ComponentType<OryNodeButtonProps>\n /**\n * The SocialButton component is rendered whenever a button of group \"oidc\" node is encountered.\n *\n * It renders the \"Login with Google\", \"Login with Facebook\" etc. buttons.\n */\n OidcButton: ComponentType<OryNodeOidcButtonProps>\n /**\n * Anchor component, rendered whenever an \"anchor\" node is encountered\n */\n Anchor: ComponentType<OryNodeAnchorProps>\n /**\n * The Input component is rendered whenever a \"input\" node is encountered.\n */\n Input: ComponentType<OryNodeInputProps>\n /**\n * Special version of the Input component for OTP codes.\n */\n CodeInput: ComponentType<OryNodeInputProps>\n /**\n * The Image component is rendered whenever an \"image\" node is encountered.\n *\n * For example used in the \"Logo\" node.\n */\n Image: ComponentType<OryNodeImageProps>\n /**\n * The Label component is rendered around Input components and is used to render form labels.\n */\n Label: ComponentType<OryNodeLabelProps>\n /**\n * The Checkbox component is rendered whenever an input node with of boolean type is encountered.\n */\n Checkbox: ComponentType<OryNodeInputProps>\n /**\n * The Text component is rendered whenever a \"text\" node is encountered.\n */\n Text: ComponentType<OryNodeTextProps>\n /**\n * The Captcha component is rendered whenever a \"captcha\" group is encountered.\n */\n Captcha: ComponentType<OryNodeCaptchaProps>\n }\n Card: {\n /**\n * The card container is the main container of the card.\n */\n Root: ComponentType<OryCardRootProps>\n /**\n * The card footer is the footer of the card container.\n */\n Footer: ComponentType<OryCardFooterProps>\n /**\n * The card header is the header of the card container.\n */\n Header: ComponentType<OryCardRootProps>\n /**\n * The card content is the main content of the card container.\n */\n Content: ComponentType<OryCardContentProps>\n /**\n * The card logo is the logo of the card container.\n */\n Logo: ComponentType<OryCardLogoProps>\n /**\n * The HorizontalDivider component is rendered between groups.\n */\n Divider: ComponentType<OryCardDividerProps>\n\n /**\n * The AuthMethodListContainer component is rendered around the \"method\" chooser step in the identifier_first login flow.\n *\n * This is only used, if login is configured to use identifier_first authentication.\n */\n AuthMethodListContainer: ComponentType<PropsWithChildren>\n /**\n * The AuthMethodListItem component is rendered on the \"method\" chooser step in the identifier_first login flow.\n *\n * This is only used, if login is configured to use identifier_first authentication.\n */\n AuthMethodListItem: ComponentType<OryCardAuthMethodListItemProps>\n\n /**\n * The SettingsSection component is rendered around each section of the settings.\n */\n SettingsSection: ComponentType<OryCardSettingsSectionProps>\n /**\n * The SettingsSectionContent component is rendered around the content of each section of the settings.\n */\n SettingsSectionContent: ComponentType<OryFormSectionContentProps>\n /**\n * The SettingsSectionFooter component is rendered around the footer of each section of the settings.\n */\n SettingsSectionFooter: ComponentType<OryFormSectionFooterProps>\n }\n Form: {\n /**\n * The FormContainer component is the main container of the form.\n *\n * It should render its children.\n *\n * You most likely don't want to override this component directly.\n */\n Root: ComponentType<OryFormRootProps>\n /**\n * A special form group container for the social buttons.\n *\n * This is required, because the social buttons need to be in its form, to not influence the other form groups.\n *\n * You most likely don't want to override this component directly.\n */\n OidcRoot: ComponentType<OryFormOidcRootProps>\n\n /**\n * The FormGroup is rendered around each group of nodes in the UI nodes.\n */\n Group: ComponentType<OryFormGroupProps>\n\n /**\n * The section on the settings page, rendering the OIDC settings\n */\n OidcSettings: ComponentType<OrySettingsOidcProps>\n\n /**\n * The section on the settings page, rendering the Webauthn settings\n */\n WebauthnSettings: ComponentType<OrySettingsWebauthnProps>\n\n /**\n * The section on the settings page, rendering the Passkey settings\n */\n PasskeySettings: ComponentType<OrySettingsPasskeyProps>\n\n /**\n * The section on the settings page, rendering the TOTP settings\n */\n TotpSettings: ComponentType<OrySettingsTotpProps>\n\n /**\n * The section on the settings page, rendering the recovery code settings\n */\n RecoveryCodesSettings: ComponentType<OrySettingsRecoveryCodesProps>\n }\n Message: {\n /**\n * The MessageContainer is rendered around the messages.\n */\n Root: ComponentType<OryMessageRootProps>\n\n /**\n * The Message component is rendered whenever a message is encountered.\n */\n Content: ComponentType<OryMessageContentProps>\n }\n Page: {\n Header: ComponentType<OryPageHeaderProps>\n }\n}\n\ntype DeepPartialTwoLevels<T> = {\n [P in keyof T]?: T[P] extends object ? { [K in keyof T[P]]?: T[P][K] } : T[P]\n}\n\nexport type OryFlowComponentOverrides = DeepPartialTwoLevels<OryFlowComponents>\n\nexport type OryFormProps = PropsWithChildren<{\n onAfterSubmit?: (method: string | number | boolean | undefined) => void\n}>\n\nexport function OryForm({ children, onAfterSubmit }: OryFormProps) {\n const { Form } = useComponents()\n const flowContainer = useOryFlow()\n const methods = useFormContext()\n\n const intl = useIntl()\n\n const onSubmit = useOryFormSubmit(onAfterSubmit)\n\n const hasMethods = flowContainer.flow.ui.nodes.some((node) => {\n if (isUiNodeInputAttributes(node.attributes)) {\n return node.attributes.name !== \"csrf_token\"\n } else if (isUiNodeAnchorAttributes(node.attributes)) {\n return true\n } else if (isUiNodeImageAttributes(node.attributes)) {\n return true\n } else if (isUiNodeScriptAttributes(node.attributes)) {\n return true\n }\n\n return false\n })\n\n if (!hasMethods && (flowContainer.flow.ui.messages ?? []).length === 0) {\n // This is defined in Ory Kratos as well.\n return intl.formatMessage({\n id: `identities.messages.${5000002}`,\n defaultMessage:\n \"No authentication methods are available for this request. Please contact the site or app owner.\",\n })\n }\n\n return (\n <Form.Root\n action={flowContainer.flow.ui.action}\n method={flowContainer.flow.ui.method}\n onSubmit={(e) => void methods.handleSubmit(onSubmit)(e)}\n >\n {children}\n </Form.Root>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowType,\n OnRedirectHandler,\n UpdateLoginFlowBody,\n UpdateRecoveryFlowBody,\n UpdateRegistrationFlowBody,\n UpdateSettingsFlowBody,\n UpdateVerificationFlowBody,\n} from \"@ory/client-fetch\"\nimport { SubmitHandler, useFormContext } from \"react-hook-form\"\nimport { useOryFlow } from \"../../context\"\nimport { FormValues } from \"../../types\"\nimport { OryFlowContainer } from \"../../util\"\nimport { onSubmitLogin } from \"../../util/onSubmitLogin\"\nimport { onSubmitRecovery } from \"../../util/onSubmitRecovery\"\nimport { onSubmitRegistration } from \"../../util/onSubmitRegistration\"\nimport { onSubmitSettings } from \"../../util/onSubmitSettings\"\nimport { onSubmitVerification } from \"../../util/onSubmitVerification\"\nimport { computeDefaultValues } from \"./form-helpers\"\n\n// The \"select_account\" prompt is supported by the following providers.\n// This prompt forces the user to select an account, even if they are already logged in.\n// This is useful when the user wants to link an account, for example.\n// TODO: this list could likely be extended, but the parameter is poorly documented.\nconst supportsSelectAccountPrompt = [\"google\", \"github\"]\n\nexport function useOryFormSubmit(\n onAfterSubmit?: (method: string | number | boolean | undefined) => void,\n) {\n const flowContainer = useOryFlow()\n const methods = useFormContext()\n\n const handleSuccess = (flow: OryFlowContainer) => {\n flowContainer.setFlowContainer(flow)\n methods.reset(computeDefaultValues(flow.flow.ui.nodes))\n }\n\n const onRedirect: OnRedirectHandler = (url, _external) => {\n window.location.assign(url)\n }\n\n const onSubmit: SubmitHandler<FormValues> = async (data) => {\n switch (flowContainer.flowType) {\n case FlowType.Login: {\n const submitData: UpdateLoginFlowBody = {\n ...(data as unknown as UpdateLoginFlowBody),\n }\n if (submitData.method === \"code\" && data.code) {\n submitData.resend = \"\"\n }\n\n await onSubmitLogin(flowContainer, {\n onRedirect,\n setFlowContainer: handleSuccess,\n body: submitData,\n })\n break\n }\n case FlowType.Registration: {\n const submitData: UpdateRegistrationFlowBody = {\n ...(data as unknown as UpdateRegistrationFlowBody),\n }\n\n if (submitData.method === \"code\" && submitData.code) {\n submitData.resend = \"\"\n }\n\n await onSubmitRegistration(flowContainer, {\n onRedirect,\n setFlowContainer: handleSuccess,\n body: submitData,\n })\n break\n }\n case FlowType.Verification:\n await onSubmitVerification(flowContainer, {\n onRedirect,\n setFlowContainer: handleSuccess,\n body: data as unknown as UpdateVerificationFlowBody,\n })\n break\n case FlowType.Recovery: {\n const submitData: UpdateRecoveryFlowBody = {\n ...(data as unknown as UpdateRecoveryFlowBody),\n }\n // TODO: We should probably fix this in Kratos, and give the code priority over the email. However, that would be breaking :(\n if (data.code) {\n submitData.email = \"\"\n }\n await onSubmitRecovery(flowContainer, {\n onRedirect,\n setFlowContainer: handleSuccess,\n body: submitData,\n })\n break\n }\n case FlowType.Settings: {\n const submitData: UpdateSettingsFlowBody = {\n ...(data as unknown as UpdateSettingsFlowBody),\n }\n\n if (\"totp_unlink\" in submitData) {\n submitData.method = \"totp\"\n }\n\n if (\n \"lookup_secret_confirm\" in submitData ||\n \"lookup_secret_reveal\" in submitData ||\n \"lookup_secret_regenerate\" in submitData ||\n \"lookup_secret_disable\" in submitData\n ) {\n submitData.method = \"lookup_secret\"\n }\n\n // Force the account selection screen on link to provide a better use experience.\n // https://github.com/ory/elements/issues/268\n // TODO: Maybe this needs to be configurable in the configuration\n if (\n submitData.method === \"oidc\" &&\n submitData.link &&\n supportsSelectAccountPrompt.includes(submitData.link)\n ) {\n submitData.upstream_parameters = {\n prompt: \"select_account\",\n }\n }\n\n if (\"webauthn_remove\" in submitData) {\n submitData.method = \"webauthn\"\n }\n\n if (\"passkey_remove\" in submitData) {\n submitData.method = \"passkey\"\n }\n\n await onSubmitSettings(flowContainer, {\n onRedirect,\n setFlowContainer: handleSuccess,\n body: submitData,\n })\n break\n }\n }\n if (\"password\" in data) {\n methods.setValue(\"password\", \"\")\n }\n if (\"code\" in data) {\n methods.setValue(\"code\", \"\")\n }\n if (\"totp_code\" in data) {\n methods.setValue(\"totp_code\", \"\")\n }\n onAfterSubmit?.(data.method)\n }\n\n return onSubmit\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowType,\n handleFlowError,\n LoginFlow,\n loginUrl,\n UpdateLoginFlowBody,\n} from \"@ory/client-fetch\"\nimport { OnSubmitHandlerProps } from \"./submitHandler\"\nimport { OryFlowContainer } from \"./flowContainer\"\nimport { frontendClient } from \"./client\"\nimport { replaceWindowFlowId } from \"./internal\"\n\n/**\n * Use this method to submit a login flow. This method is used in the `onSubmit` handler of the login form.\n *\n * @param config - The configuration object.\n * @param flow - The flow object.\n * @param setFlowContainer - This method is used to update the flow container when a validation error occurs, for example.\n * @param body - The form values to submit.\n * @param onRedirect - This method is used to redirect the user to a different page.\n */\nexport async function onSubmitLogin(\n { config, flow }: OryFlowContainer,\n {\n setFlowContainer,\n body,\n onRedirect,\n }: OnSubmitHandlerProps<UpdateLoginFlowBody>,\n) {\n if (!config.sdk.url) {\n throw new Error(\n `Please supply your Ory Network SDK url to the Ory Elements configuration.`,\n )\n }\n\n await frontendClient(config.sdk.url, config.sdk.options ?? {})\n .updateLoginFlowRaw({\n flow: flow.id,\n updateLoginFlowBody: body,\n })\n .then(() => {\n // TODO Remove this workaround. If the return_to value is missing we redirect to the browser endpoint which will redirect us\n // TODO to the default_redirect_url. Ideally, this value comes from the project config.\n window.location.href =\n // eslint-disable-next-line promise/always-return\n flow.return_to ?? config.sdk.url + \"/self-service/login/browser\"\n })\n .catch(\n handleFlowError({\n onRestartFlow: (useFlowId?: string) => {\n if (useFlowId) {\n replaceWindowFlowId(useFlowId)\n } else {\n onRedirect(loginUrl(config), true)\n }\n },\n onValidationError: (body: LoginFlow) => {\n setFlowContainer({\n config,\n flow: body,\n flowType: FlowType.Login,\n })\n },\n onRedirect,\n }),\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n ContinueWith,\n FlowType,\n GenericError,\n handleContinueWith,\n handleFlowError,\n instanceOfContinueWithRecoveryUi,\n OnRedirectHandler,\n RecoveryFlow,\n recoveryUrl,\n UpdateRecoveryFlowBody,\n} from \"@ory/client-fetch\"\nimport { frontendClient } from \"./client\"\nimport { OryClientConfiguration } from \"./clientConfiguration\"\nimport { OryFlowContainer } from \"./flowContainer\"\nimport { OnSubmitHandlerProps } from \"./submitHandler\"\nimport { replaceWindowFlowId } from \"./internal\"\n\n/**\n * Use this method to submit a recovery flow. This method is used in the `onSubmit` handler of the recovery form.\n *\n * @param config - The configuration object.\n * @param flow - The flow object.\n * @param setFlowContainer - This method is used to update the flow container when a validation error occurs, for example.\n * @param body - The form values to submit.\n * @param onRedirect - This method is used to redirect the user to a different page.\n */\nexport async function onSubmitRecovery(\n { config, flow }: OryFlowContainer,\n {\n setFlowContainer,\n body,\n onRedirect,\n }: OnSubmitHandlerProps<UpdateRecoveryFlowBody>,\n) {\n if (!config.sdk.url) {\n throw new Error(\n `Please supply your Ory Network SDK url to the Ory Elements configuration.`,\n )\n }\n\n await frontendClient(config.sdk.url, config.sdk.options ?? {})\n .updateRecoveryFlowRaw({\n flow: flow.id,\n updateRecoveryFlowBody: body,\n })\n .then(async (res) => {\n const flow = await res.value()\n\n const didContinueWith = handleContinueWith(flow.continue_with, {\n onRedirect,\n })\n\n // eslint-disable-next-line promise/always-return\n if (didContinueWith) {\n return\n }\n\n setFlowContainer({\n flow,\n flowType: FlowType.Recovery,\n config,\n })\n })\n .catch(\n handleFlowError({\n onRestartFlow: (useFlowId) => {\n if (useFlowId) {\n replaceWindowFlowId(useFlowId)\n } else {\n onRedirect(recoveryUrl(config), true)\n }\n },\n onValidationError: (body: RecoveryFlow | { error: GenericError }) => {\n if (\"error\" in body) {\n handleContinueWithRecoveryUIError(body.error, config, onRedirect)\n return\n } else {\n setFlowContainer({\n flow: body,\n flowType: FlowType.Recovery,\n config,\n })\n }\n },\n onRedirect,\n }),\n )\n}\n\nfunction handleContinueWithRecoveryUIError(\n error: GenericError,\n config: OryClientConfiguration,\n onRedirect: OnRedirectHandler,\n) {\n if (\n \"continue_with\" in error.details &&\n Array.isArray(error.details.continue_with)\n ) {\n const continueWithRecovery = (\n error.details.continue_with as ContinueWith[]\n ).find(instanceOfContinueWithRecoveryUi)\n if (continueWithRecovery?.action === \"show_recovery_ui\") {\n onRedirect(\n config.project.recovery_ui_url +\n \"?flow=\" +\n continueWithRecovery?.flow.id,\n false,\n )\n return\n }\n }\n onRedirect(recoveryUrl(config), true)\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowType,\n handleContinueWith,\n handleFlowError,\n RegistrationFlow,\n registrationUrl,\n UpdateRegistrationFlowBody,\n} from \"@ory/client-fetch\"\nimport { OryFlowContainer } from \"./flowContainer\"\nimport { OnSubmitHandlerProps } from \"./submitHandler\"\nimport { frontendClient } from \"./client\"\nimport { replaceWindowFlowId } from \"./internal\"\n\n/**\n * Use this method to submit a registration flow. This method is used in the `onSubmit` handler of the registration form.\n *\n * @param config - The configuration object.\n * @param flow - The flow object.\n * @param setFlowContainer - This method is used to update the flow container when a validation error occurs, for example.\n * @param body - The form values to submit.\n * @param onRedirect - This method is used to redirect the user to a different page.\n */\nexport async function onSubmitRegistration(\n { config, flow }: OryFlowContainer,\n {\n setFlowContainer,\n body,\n onRedirect,\n }: OnSubmitHandlerProps<UpdateRegistrationFlowBody>,\n) {\n if (!config.sdk.url) {\n throw new Error(\n `Please supply your Ory Network SDK url to the Ory Elements configuration.`,\n )\n }\n\n const client = frontendClient(config.sdk.url, config.sdk.options ?? {})\n await client\n .updateRegistrationFlowRaw({\n flow: flow.id,\n updateRegistrationFlowBody: body,\n })\n .then(async (res) => {\n const body = await res.value()\n\n const didContinueWith = handleContinueWith(body.continue_with, {\n onRedirect,\n })\n\n // eslint-disable-next-line promise/always-return\n if (didContinueWith) {\n return\n }\n\n // We did not receive a valid continue_with, but the state flow is still a success. In this case we re-initialize\n // the registration flow which will redirect the user to the default url.\n onRedirect(registrationUrl(config), true)\n })\n .catch(\n handleFlowError({\n onRestartFlow: (useFlowId) => {\n if (useFlowId) {\n replaceWindowFlowId(useFlowId)\n } else {\n onRedirect(registrationUrl(config), true)\n }\n },\n onValidationError: (body: RegistrationFlow) => {\n setFlowContainer({\n flow: body,\n flowType: FlowType.Registration,\n config,\n })\n },\n onRedirect,\n }),\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowType,\n handleContinueWith,\n handleFlowError,\n isResponseError,\n loginUrl,\n SettingsFlow,\n settingsUrl,\n UpdateSettingsFlowBody,\n} from \"@ory/client-fetch\"\nimport { OryFlowContainer } from \"./flowContainer\"\nimport { OnSubmitHandlerProps } from \"./submitHandler\"\nimport { frontendClient } from \"./client\"\nimport { replaceWindowFlowId } from \"./internal\"\n\n/**\n * Use this method to submit a settings flow. This method is used in the `onSubmit` handler of the settings form.\n *\n * @param config - The configuration object.\n * @param flow - The flow object.\n * @param setFlowContainer - This method is used to update the flow container when a validation error occurs, for example.\n * @param body - The form values to submit.\n * @param onRedirect - This method is used to redirect the user to a different page.\n */\nexport async function onSubmitSettings(\n { config, flow }: OryFlowContainer,\n {\n setFlowContainer,\n body,\n onRedirect,\n }: OnSubmitHandlerProps<UpdateSettingsFlowBody>,\n) {\n if (!config.sdk.url) {\n throw new Error(\n `Please supply your Ory Network SDK url to the Ory Elements configuration.`,\n )\n }\n\n const client = frontendClient(config.sdk.url, config.sdk.options ?? {})\n await client\n .updateSettingsFlowRaw({\n flow: flow.id,\n updateSettingsFlowBody: body,\n })\n .then(async (res) => {\n const body = await res.value()\n\n const didContinueWith = handleContinueWith(body.continue_with, {\n onRedirect,\n })\n\n // eslint-disable-next-line promise/always-return\n if (didContinueWith) {\n return\n }\n\n setFlowContainer({\n flow: body,\n flowType: FlowType.Settings,\n config,\n })\n })\n .catch(\n handleFlowError({\n onRestartFlow: (useFlowId) => {\n if (useFlowId) {\n replaceWindowFlowId(useFlowId)\n } else {\n onRedirect(settingsUrl(config), true)\n }\n },\n onValidationError: (body: SettingsFlow) => {\n setFlowContainer({\n flow: body,\n flowType: FlowType.Settings,\n config,\n })\n },\n onRedirect,\n }),\n )\n .catch((err) => {\n if (isResponseError(err)) {\n if (err.response.status === 401) {\n return onRedirect(\n loginUrl(config) + \"?return_to=\" + settingsUrl(config),\n true,\n )\n }\n throw err\n }\n })\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowType,\n handleFlowError,\n UpdateVerificationFlowBody,\n VerificationFlow,\n verificationUrl,\n} from \"@ory/client-fetch\"\nimport { OryFlowContainer } from \"./flowContainer\"\nimport { OnSubmitHandlerProps } from \"./submitHandler\"\nimport { frontendClient } from \"./client\"\nimport { replaceWindowFlowId } from \"./internal\"\n\n/**\n * Use this method to submit a verification flow. This method is used in the `onSubmit` handler of the verification form.\n *\n * @param config - The configuration object.\n * @param flow - The flow object.\n * @param setFlowContainer - This method is used to update the flow container when a validation error occurs, for example.\n * @param body - The form values to submit.\n * @param onRedirect - This method is used to redirect the user to a different page.\n */\nexport async function onSubmitVerification(\n { config, flow }: OryFlowContainer,\n {\n setFlowContainer,\n body,\n onRedirect,\n }: OnSubmitHandlerProps<UpdateVerificationFlowBody>,\n) {\n if (!config.sdk.url) {\n throw new Error(\n `Please supply your Ory Network SDK URL to the Ory Elements configuration.`,\n )\n }\n\n await frontendClient(config.sdk.url, config.sdk.options ?? {})\n .updateVerificationFlowRaw({\n flow: flow.id,\n updateVerificationFlowBody: body,\n })\n .then(async (res) =>\n setFlowContainer({\n flow: await res.value(),\n flowType: FlowType.Verification,\n config,\n }),\n )\n .catch(\n handleFlowError({\n onRestartFlow: (useFlowId) => {\n if (useFlowId) {\n replaceWindowFlowId(useFlowId)\n } else {\n onRedirect(verificationUrl(config), true)\n }\n },\n onValidationError: (body: VerificationFlow) => {\n setFlowContainer({\n flow: body,\n flowType: FlowType.Verification,\n config,\n })\n },\n onRedirect,\n }),\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useOryFlow, useComponents } from \"../../context\"\nimport { UiText } from \"@ory/client-fetch\"\nimport { DetailedHTMLProps, HTMLAttributes } from \"react\"\n\nexport type OryMessageContentProps = {\n message: UiText\n}\n\nexport type OryMessageRootProps = DetailedHTMLProps<\n HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>\n\n// This is a list of message IDs that should not be shown to the user.\n// They're returned by the API, but they don't work well in the two step flows.\nconst messageIdsToHide = [1040009, 1060003, 1080003, 1010014, 1040005, 1010016]\n\nexport function OryCardValidationMessages({ ...props }: OryMessageRootProps) {\n const { flow } = useOryFlow()\n const messages = flow.ui.messages?.filter(\n (m) => !messageIdsToHide.includes(m.id),\n )\n const { Message } = useComponents()\n\n if (!messages) {\n return null\n }\n\n return (\n <Message.Root {...props}>\n {messages?.map((message) => (\n <Message.Content key={message.id} message={message} />\n ))}\n </Message.Root>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { NodeInput } from \"./input\"\nimport {\n UiNode,\n isUiNodeAnchorAttributes,\n isUiNodeImageAttributes,\n isUiNodeInputAttributes,\n isUiNodeScriptAttributes,\n isUiNodeTextAttributes,\n UiNodeGroupEnum,\n} from \"@ory/client-fetch\"\nimport { MouseEventHandler, ReactNode } from \"react\"\nimport { useComponents } from \"../../../context\"\n\nexport type NodeProps = {\n node: UiNode\n className?: string\n onClick?: MouseEventHandler\n}\n\nexport const Node = ({ node, onClick }: NodeProps): ReactNode => {\n const { Node } = useComponents()\n\n // Special case for CAPTCHA handling as we need to render a different component\n if (node.group === UiNodeGroupEnum.Captcha) {\n return <Node.Captcha node={node} />\n }\n\n if (isUiNodeImageAttributes(node.attributes)) {\n return <Node.Image node={node} attributes={node.attributes} />\n } else if (isUiNodeTextAttributes(node.attributes)) {\n const attrs = node.attributes\n return <Node.Text attributes={attrs} node={node} />\n } else if (isUiNodeInputAttributes(node.attributes)) {\n return (\n <NodeInput node={node} attributes={node.attributes} onClick={onClick} />\n )\n } else if (isUiNodeAnchorAttributes(node.attributes)) {\n return <Node.Anchor attributes={node.attributes} node={node} />\n } else if (isUiNodeScriptAttributes(node.attributes)) {\n const {\n crossorigin,\n referrerpolicy,\n node_type: _nodeType,\n ...attributes\n } = node.attributes\n\n return (\n <script\n crossOrigin={\n crossorigin as \"anonymous\" | \"use-credentials\" | \"\" | undefined\n }\n referrerPolicy={referrerpolicy as React.HTMLAttributeReferrerPolicy}\n {...attributes}\n />\n )\n }\n return null\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useComponents } from \"../../context\"\nimport { useOryFlow } from \"../../context\"\nimport { UiNode, UiNodeInputAttributes } from \"@ory/client-fetch\"\nimport { PropsWithChildren } from \"react\"\nimport { OryForm } from \"./form\"\nimport { useFormContext } from \"react-hook-form\"\nimport { OryFormProvider } from \"./form-provider\"\n\nexport type OryFormOidcRootProps = PropsWithChildren<{\n nodes: UiNode[]\n}>\n\nexport type OryNodeOidcButtonProps = {\n node: UiNode\n attributes: UiNodeInputAttributes\n onClick?: () => void\n}\n\nexport function OryFormOidcButtons() {\n const {\n flow: { ui },\n } = useOryFlow()\n const { setValue } = useFormContext()\n\n // Only get the oidc nodes.\n const filteredNodes = ui.nodes.filter((node) => node.group === \"oidc\")\n\n const { Form, Node } = useComponents()\n\n if (filteredNodes.length === 0) {\n return null\n }\n\n return (\n <Form.OidcRoot nodes={filteredNodes}>\n {filteredNodes.map((node, k) => (\n <Node.OidcButton\n node={node}\n key={k}\n attributes={node.attributes as UiNodeInputAttributes}\n onClick={() => {\n setValue(\n \"provider\",\n (node.attributes as UiNodeInputAttributes).value,\n )\n setValue(\"method\", \"oidc\")\n }}\n />\n ))}\n </Form.OidcRoot>\n )\n}\n\nexport function OryFormSocialButtonsForm() {\n const {\n flow: { ui },\n } = useOryFlow()\n\n // Only get the oidc nodes.\n const filteredNodes = ui.nodes.filter((node) => node.group === \"oidc\")\n\n if (filteredNodes.length === 0) {\n return null\n }\n\n return (\n <OryFormProvider>\n <OryForm>\n <OryFormOidcButtons />\n </OryForm>\n </OryFormProvider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useComponents, useNodeSorter } from \"../../context\"\nimport { useOryFlow } from \"../../context\"\nimport { UiNodeGroupEnum } from \"@ory/client-fetch\"\nimport { PropsWithChildren } from \"react\"\nimport { Node } from \"./nodes/node\"\n\nexport type OryFormGroupsProps = PropsWithChildren<{\n groups: UiNodeGroupEnum[]\n}>\n\nexport type OryFormGroupProps = PropsWithChildren\n\nexport function OryFormGroups({ groups }: OryFormGroupsProps) {\n const {\n flow: { ui },\n } = useOryFlow()\n const nodeSorter = useNodeSorter()\n const { flowType } = useOryFlow()\n const { Form } = useComponents()\n const nodes = ui.nodes\n .filter((node) => groups.indexOf(node.group) > -1)\n .sort((a, b) => nodeSorter(a, b, { flowType }))\n\n return (\n <Form.Group>\n {nodes.map((node, k) => {\n return <Node node={node} key={k} />\n })}\n </Form.Group>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode } from \"@ory/client-fetch\"\nimport {\n ComponentPropsWithoutRef,\n FormEventHandler,\n PropsWithChildren,\n} from \"react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useComponents } from \"../../context/component\"\nimport { OryFormProvider } from \"./form-provider\"\nimport { useOryFormSubmit } from \"./useOryFormSubmit\"\nimport { useOryFlow } from \"../../context\"\n\ntype OryFormProps = Omit<\n ComponentPropsWithoutRef<\"form\">,\n \"action\" | \"method\" | \"onSubmit\"\n>\n\nexport type OryFormSectionProps = PropsWithChildren<\n OryFormProps & {\n nodes?: UiNode[]\n }\n>\n\nexport type OryCardSettingsSectionProps = PropsWithChildren & {\n action: string\n method: string\n onSubmit: FormEventHandler<HTMLFormElement>\n}\n\nexport function OryFormSection({\n children,\n nodes,\n ...rest\n}: OryFormSectionProps) {\n return (\n <OryFormProvider nodes={nodes}>\n <OryFormSectionInner {...rest}>{children}</OryFormSectionInner>\n </OryFormProvider>\n )\n}\n\nfunction OryFormSectionInner({\n children,\n ...rest\n}: PropsWithChildren<OryFormProps>) {\n const { Card } = useComponents()\n const flowContainer = useOryFlow()\n const onSubmit = useOryFormSubmit()\n const methods = useFormContext()\n\n return (\n <Card.SettingsSection\n action={flowContainer.flow.ui.action}\n method={flowContainer.flow.ui.method}\n onSubmit={(e) => void methods.handleSubmit(onSubmit)(e)}\n {...rest}\n >\n {children}\n </Card.SettingsSection>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useComponents } from \"../../context\"\nimport { useOryFlow } from \"../../context\"\n\n/**\n * Props type for the Form Group Divider component.\n */\nexport type OryCardDividerProps = Record<string, never>\n\n/**\n * Renders the @see Card.Divider between the groups of nodes in the Ory Form.\n *\n * You can use this component to build fully custom implementations of the Ory Flows.\n *\n * However, you most likely want to override the individual components instead.\n *\n * @returns\n */\nexport function OryFormGroupDivider() {\n const { Card } = useComponents()\n const {\n flow: { ui },\n } = useOryFlow()\n\n // Only get the oidc nodes.\n const filteredNodes = ui.nodes.filter((node) => node.group === \"oidc\")\n\n // Are there other first-factor nodes available?\n const otherNodes = ui.nodes.filter(\n (node) => node.group !== \"oidc\" && node.group !== \"default\",\n )\n\n if (filteredNodes.length > 0 && otherNodes.length > 0) {\n return <Card.Divider />\n }\n return null\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useComponents } from \"../../context\"\n\nexport type OryPageHeaderProps = Record<never, never>\n\nexport const HeadlessPageHeader = () => {\n const { Page } = useComponents()\n\n return <Page.Header />\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode, UiNodeGroupEnum } from \"@ory/client-fetch\"\nimport { useIntl } from \"react-intl\"\nimport { useComponents, useOryFlow } from \"../../context\"\nimport { useNodesGroups } from \"../../util/ui\"\nimport { OryCardValidationMessages } from \"../form\"\nimport { Node } from \"../form/nodes/node\"\nimport { OryFormSection } from \"../form/section\"\nimport { OrySettingsOidc } from \"./oidc-settings\"\nimport { OrySettingsPasskey } from \"./passkey-settings\"\nimport { OrySettingsRecoveryCodes } from \"./recovery-codes-settings\"\nimport { OrySettingsTotp } from \"./totp-settings\"\nimport { OrySettingsWebauthn } from \"./webauthn-settings\"\n\ntype SettingsSectionProps = {\n group: UiNodeGroupEnum\n nodes: UiNode[]\n}\n\nfunction SettingsSectionContent({ group, nodes }: SettingsSectionProps) {\n const { Card } = useComponents()\n const intl = useIntl()\n const { flow } = useOryFlow()\n const uniqueGroups = useNodesGroups(flow.ui.nodes)\n\n if (group === UiNodeGroupEnum.Totp) {\n return (\n <OryFormSection\n nodes={uniqueGroups.groups.totp}\n data-testid=\"ory/screen/settings/group/totp\"\n >\n <OrySettingsTotp nodes={uniqueGroups.groups.totp ?? []} />\n {uniqueGroups.groups.default?.map((node, k) => (\n <Node key={k} node={node} />\n ))}\n </OryFormSection>\n )\n }\n\n if (group === UiNodeGroupEnum.LookupSecret) {\n return (\n <OryFormSection\n nodes={uniqueGroups.groups.lookup_secret}\n data-testid=\"ory/screen/settings/group/lookup_secret\"\n >\n <OrySettingsRecoveryCodes\n nodes={uniqueGroups.groups.lookup_secret ?? []}\n />\n {uniqueGroups.groups.default?.map((node, k) => (\n <Node key={k} node={node} />\n ))}\n </OryFormSection>\n )\n }\n\n if (group === UiNodeGroupEnum.Oidc) {\n return (\n <OryFormSection\n nodes={uniqueGroups.groups.oidc}\n data-testid=\"ory/screen/settings/group/oidc\"\n >\n <OrySettingsOidc nodes={uniqueGroups.groups.oidc ?? []} />\n {uniqueGroups.groups.default?.map((node, k) => (\n <Node key={k} node={node} />\n ))}\n </OryFormSection>\n )\n }\n\n if (group === UiNodeGroupEnum.Webauthn) {\n return (\n <OryFormSection\n nodes={uniqueGroups.groups.webauthn}\n data-testid=\"ory/screen/settings/group/webauthn\"\n >\n <OrySettingsWebauthn nodes={uniqueGroups.groups.webauthn ?? []} />\n {uniqueGroups.groups.default?.map((node, k) => (\n <Node key={k} node={node} />\n ))}\n </OryFormSection>\n )\n }\n\n if (group === UiNodeGroupEnum.Passkey) {\n return (\n <OryFormSection\n nodes={uniqueGroups.groups.passkey}\n data-testid=\"ory/screen/settings/group/passkey\"\n >\n <OrySettingsPasskey nodes={uniqueGroups.groups.passkey ?? []} />\n {uniqueGroups.groups.default?.map((node, k) => (\n <Node key={k} node={node} />\n ))}\n </OryFormSection>\n )\n }\n\n return (\n <OryFormSection\n nodes={nodes}\n data-testid={`ory/screen/settings/group/${group}`}\n >\n <Card.SettingsSectionContent\n title={intl.formatMessage({\n id: `settings.${group}.title`,\n })}\n description={intl.formatMessage({\n id: `settings.${group}.description`,\n })}\n >\n {uniqueGroups.groups.default?.map((node, k) => (\n <Node key={k} node={node} />\n ))}\n {nodes\n .filter(\n (node) =>\n \"type\" in node.attributes && node.attributes.type !== \"submit\",\n )\n .map((node, k) => (\n <Node key={k} node={node} />\n ))}\n </Card.SettingsSectionContent>\n <Card.SettingsSectionFooter>\n {nodes\n .filter(\n (node) =>\n \"type\" in node.attributes && node.attributes.type === \"submit\",\n )\n .map((node, k) => (\n <Node key={k} node={node} />\n ))}\n </Card.SettingsSectionFooter>\n </OryFormSection>\n )\n}\n\nconst getScriptNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"id\" in node.attributes && node.attributes.id === \"webauthn_script\",\n )\n\nexport function OrySettingsCard() {\n const { flow } = useOryFlow()\n const uniqueGroups = useNodesGroups(flow.ui.nodes)\n const scriptNode = getScriptNode(flow.ui.nodes)\n\n return (\n <>\n <OryCardValidationMessages />\n {scriptNode && <Node node={scriptNode} />}\n {uniqueGroups.entries.map(([group, nodes]) => {\n if (group === UiNodeGroupEnum.Default) {\n return null\n }\n\n return (\n <SettingsSectionContent key={group} group={group} nodes={nodes} />\n )\n })}\n </>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode } from \"@ory/client-fetch\"\nimport { useComponents } from \"../../context\"\nimport { useIntl } from \"react-intl\"\nimport { useFormContext } from \"react-hook-form\"\n\nconst getLinkButtons = (nodes: UiNode[]): UiNode[] =>\n nodes.filter(\n (node) => \"name\" in node.attributes && node.attributes.name === \"link\",\n )\n\nconst getUnlinkButtons = (nodes: UiNode[]): UiNode[] =>\n nodes.filter(\n (node) => \"name\" in node.attributes && node.attributes.name === \"unlink\",\n )\n\nexport interface HeadlessSettingsOidcProps {\n nodes: UiNode[]\n}\n\nexport function OrySettingsOidc({ nodes }: HeadlessSettingsOidcProps) {\n const { Card, Form } = useComponents()\n const intl = useIntl()\n const { setValue } = useFormContext()\n\n const linkButtons = getLinkButtons(nodes).map((node) => ({\n ...node,\n onClick: () => {\n if (node.attributes.node_type === \"input\") {\n setValue(\"link\", node.attributes.value)\n setValue(\"method\", \"oidc\")\n }\n },\n }))\n const unlinkButtons = getUnlinkButtons(nodes).map((node) => ({\n ...node,\n onClick: () => {\n if (node.attributes.node_type === \"input\") {\n setValue(\"unlink\", node.attributes.value)\n setValue(\"method\", \"oidc\")\n }\n },\n }))\n\n return (\n <>\n <Card.SettingsSectionContent\n title={intl.formatMessage({ id: \"settings.oidc.title\" })}\n description={intl.formatMessage({ id: \"settings.oidc.description\" })}\n >\n <Form.OidcSettings\n linkButtons={linkButtons}\n unlinkButtons={unlinkButtons}\n />\n </Card.SettingsSectionContent>\n <Card.SettingsSectionFooter\n text={intl.formatMessage({ id: \"settings.oidc.info\" })}\n ></Card.SettingsSectionFooter>\n </>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n UiNode,\n UiNodeAttributes,\n UiNodeInputAttributes,\n} from \"@ory/client-fetch\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { useComponents } from \"../../context\"\nimport { triggerToWindowCall } from \"../../util/ui\"\nimport { Node } from \"../form/nodes/node\"\n\nconst getTriggerNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"passkey_register_trigger\",\n )\n\nconst getSettingsNodes = (nodes: UiNode[]): UiNode[] =>\n nodes.filter(\n (node) =>\n \"name\" in node.attributes &&\n (node.attributes.name === \"passkey_settings_register\" ||\n node.attributes.name === \"passkey_create_data\"),\n )\n\nconst getRemoveNodes = (nodes: UiNode[]): UiNode[] =>\n nodes.filter(\n (node) =>\n \"name\" in node.attributes && node.attributes.name === \"passkey_remove\",\n )\n\ninterface HeadlessSettingsPasskeyProps {\n nodes: UiNode[]\n}\n\nexport function OrySettingsPasskey({ nodes }: HeadlessSettingsPasskeyProps) {\n const { Card, Form } = useComponents()\n const intl = useIntl()\n const { setValue } = useFormContext()\n\n const triggerButton = getTriggerNode(nodes)\n const settingsNodes = getSettingsNodes(nodes)\n const removeNodes = getRemoveNodes(nodes)\n\n if (!triggerButton) {\n return null\n }\n\n const {\n onclick: _onClick,\n onclickTrigger,\n ...triggerAttributes\n } = triggerButton.attributes as UiNodeInputAttributes\n\n const onTriggerClick = () => {\n triggerToWindowCall(onclickTrigger)\n }\n\n const removePasskeyHandler = (value: string) => {\n return () => {\n setValue(\"passkey_remove\", value)\n setValue(\"method\", \"passkey\")\n }\n }\n\n return (\n <>\n <Card.SettingsSectionContent\n title={intl.formatMessage({ id: \"settings.passkey.title\" })}\n description={intl.formatMessage({\n id: \"settings.passkey.description\",\n })}\n >\n {settingsNodes.map((node, i) => (\n <Node key={`passkey-settings-nodes-${i}`} node={node} />\n ))}\n <Form.PasskeySettings\n triggerButton={{\n ...triggerButton,\n attributes: triggerAttributes as UiNodeAttributes,\n onClick: onTriggerClick,\n }}\n removeButtons={removeNodes.map((node) => ({\n ...node,\n onClick:\n node.attributes.node_type === \"input\"\n ? removePasskeyHandler(node.attributes.value as string)\n : () => {},\n }))}\n />\n </Card.SettingsSectionContent>\n <Card.SettingsSectionFooter\n text={intl.formatMessage({ id: \"settings.passkey.info\" })}\n ></Card.SettingsSectionFooter>\n </>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n UiNode,\n UiNodeInputAttributes,\n UiNodeTextAttributes,\n} from \"@ory/client-fetch\"\nimport { useIntl } from \"react-intl\"\nimport { useComponents } from \"../../context\"\nimport { useFormContext } from \"react-hook-form\"\n\nconst getRegenerateNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"lookup_secret_regenerate\",\n )\n\nconst getRevealNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"lookup_secret_reveal\",\n )\n\nconst getRecoveryCodes = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"id\" in node.attributes && node.attributes.id === \"lookup_secret_codes\",\n )\n\nconst getDisableNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"lookup_secret_disable\",\n )\n\nconst getConfirmNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"lookup_secret_confirm\",\n )\n\ninterface HeadlessSettingsRecoveryCodesProps {\n nodes: UiNode[]\n}\n\nexport function OrySettingsRecoveryCodes({\n nodes,\n}: HeadlessSettingsRecoveryCodesProps) {\n const { Card, Form, Node } = useComponents()\n const intl = useIntl()\n\n const codesNode = getRecoveryCodes(nodes)\n const revealNode = getRevealNode(nodes)\n const regenerateNode = getRegenerateNode(nodes)\n const disableNode = getDisableNode(nodes)\n const confirmNode = getConfirmNode(nodes)\n const { setValue } = useFormContext()\n\n const codesContext =\n ((codesNode?.attributes as UiNodeTextAttributes)?.text.context as {\n secrets?: { text: string }[]\n }) ?? {}\n const secrets = codesContext.secrets\n ? codesContext.secrets.map((i) => i.text)\n : []\n\n const onRegenerate = () => {\n if (regenerateNode?.attributes.node_type === \"input\") {\n setValue(regenerateNode?.attributes.name, \"true\")\n setValue(\"method\", \"lookup_secret\")\n }\n }\n\n const onReveal = () => {\n if (revealNode?.attributes.node_type === \"input\") {\n setValue(revealNode?.attributes.name, \"true\")\n setValue(\"method\", \"lookup_secret\")\n }\n }\n\n const footerNode = disableNode ?? regenerateNode ?? confirmNode\n\n return (\n <>\n <Card.SettingsSectionContent\n title={intl.formatMessage({ id: \"settings.lookup_secret.title\" })}\n description={intl.formatMessage({\n id: \"settings.lookup_secret.description\",\n })}\n >\n <Form.RecoveryCodesSettings\n codes={secrets}\n revealButton={revealNode}\n regnerateButton={regenerateNode}\n onRegenerate={onRegenerate}\n onReveal={onReveal}\n />\n </Card.SettingsSectionContent>\n <Card.SettingsSectionFooter>\n {footerNode && (\n <Node.Button\n node={footerNode}\n attributes={footerNode.attributes as UiNodeInputAttributes}\n />\n )}\n </Card.SettingsSectionFooter>\n </>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode, UiNodeInputAttributes } from \"@ory/client-fetch\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { useComponents } from \"../../context\"\n\nconst getQrCodeNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) => \"id\" in node.attributes && node.attributes.id === \"totp_qr\",\n )\n\nconst getTotpSecretNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"id\" in node.attributes && node.attributes.id === \"totp_secret_key\",\n )\n\nconst getTotpInputNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) => \"name\" in node.attributes && node.attributes.name === \"totp_code\",\n )\n\nconst getTotpUnlinkInput = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes && node.attributes.name === \"totp_unlink\",\n )\n\nconst getTotpLinkButton = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) => \"name\" in node.attributes && node.attributes.name === \"method\",\n )\n\ninterface HeadlessSettingsTotpProps {\n nodes: UiNode[]\n}\n\nexport function OrySettingsTotp({ nodes }: HeadlessSettingsTotpProps) {\n const { Card, Form, Node } = useComponents()\n const intl = useIntl()\n const { setValue } = useFormContext()\n\n const totpUnlink = getTotpUnlinkInput(nodes)\n const qrNode = getQrCodeNode(nodes)\n const secretNode = getTotpSecretNode(nodes)\n const totpCodeNode = getTotpInputNode(nodes)\n const totpLinkButton = getTotpLinkButton(nodes)\n\n const handleUnlink = () => {\n if (totpUnlink?.attributes.node_type === \"input\") {\n setValue(totpUnlink.attributes.name, totpUnlink.attributes.value)\n setValue(\"method\", \"totp\")\n }\n }\n\n return (\n <>\n <Card.SettingsSectionContent\n title={intl.formatMessage({ id: \"settings.totp.title\" })}\n description={intl.formatMessage({ id: \"settings.totp.description\" })}\n >\n <Form.TotpSettings\n totpImage={qrNode}\n totpSecret={secretNode}\n totpInput={totpCodeNode}\n totpUnlink={totpUnlink}\n onUnlink={handleUnlink}\n />\n </Card.SettingsSectionContent>\n <Card.SettingsSectionFooter\n text={\n totpUnlink\n ? intl.formatMessage({ id: \"settings.totp.info.linked\" })\n : intl.formatMessage({ id: \"settings.totp.info.not-linked\" })\n }\n >\n {totpLinkButton && (\n <Node.Button\n node={totpLinkButton}\n attributes={totpLinkButton.attributes as UiNodeInputAttributes}\n />\n )}\n </Card.SettingsSectionFooter>\n </>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n UiNode,\n UiNodeAttributes,\n UiNodeInputAttributes,\n} from \"@ory/client-fetch\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { useComponents } from \"../../context\"\nimport { triggerToWindowCall } from \"../../util/ui\"\nimport { Node } from \"../form/nodes/node\"\n\nconst getInputNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"webauthn_register_displayname\",\n )\n\nconst getTriggerNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"webauthn_register_trigger\",\n )\n\nconst getRemoveButtons = (nodes: UiNode[]): UiNode[] =>\n nodes.filter(\n (node) =>\n \"name\" in node.attributes && node.attributes.name === \"webauthn_remove\",\n )\n\nconst getRegisterNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes && node.attributes.name === \"webauthn_register\",\n )\n\ninterface HeadlessSettingsWebauthnProps {\n nodes: UiNode[]\n}\n\nexport function OrySettingsWebauthn({ nodes }: HeadlessSettingsWebauthnProps) {\n const { Card, Form } = useComponents()\n const intl = useIntl()\n const { setValue } = useFormContext()\n\n const triggerButton = getTriggerNode(nodes)\n const inputNode = getInputNode(nodes)\n const removeButtons = getRemoveButtons(nodes)\n const registerNode = getRegisterNode(nodes)\n\n if (!inputNode || !triggerButton) {\n return null\n }\n\n const {\n onclick: _onClick,\n onclickTrigger,\n ...triggerAttributes\n } = triggerButton.attributes as UiNodeInputAttributes\n\n const onTriggerClick = () => {\n triggerToWindowCall(onclickTrigger)\n }\n const removeWebauthnKeyHandler = (value: string) => {\n return () => {\n setValue(\"webauthn_remove\", value)\n setValue(\"method\", \"webauthn\")\n }\n }\n\n return (\n <>\n <Card.SettingsSectionContent\n title={intl.formatMessage({ id: \"settings.webauthn.title\" })}\n description={intl.formatMessage({\n id: \"settings.webauthn.description\",\n })}\n >\n <Form.WebauthnSettings\n nameInput={inputNode}\n triggerButton={{\n ...triggerButton,\n attributes: triggerAttributes as UiNodeAttributes,\n onClick: onTriggerClick,\n }}\n removeButtons={removeButtons.map((node) => ({\n ...node,\n onClick:\n node.attributes.node_type === \"input\"\n ? removeWebauthnKeyHandler(node.attributes.value as string)\n : () => {},\n }))}\n />\n {registerNode && <Node node={registerNode} />}\n </Card.SettingsSectionContent>\n <Card.SettingsSectionFooter\n text={intl.formatMessage({ id: \"settings.webauthn.info\" })}\n ></Card.SettingsSectionFooter>\n </>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { PropsWithChildren } from \"react\"\n\nimport { OryFlowComponents } from \"../components\"\nimport { OryFlowContainer } from \"../util/flowContainer\"\nimport { OryComponentProvider } from \"./component\"\nimport { OryFlowProvider } from \"./flow-context\"\nimport { IntlProvider } from \"./intl-context\"\n\nexport type OryProviderProps = {\n components: OryFlowComponents\n} & OryFlowContainer &\n PropsWithChildren\n\nexport function OryProvider({\n children,\n components: Components,\n ...oryFlowProps\n}: OryProviderProps) {\n return (\n <IntlProvider\n locale={oryFlowProps.config.intl?.locale ?? \"en\"}\n customTranslations={oryFlowProps.config.intl?.customTranslations}\n >\n <OryFlowProvider {...oryFlowProps}>\n <OryComponentProvider components={Components}>\n {children}\n </OryComponentProvider>\n </OryFlowProvider>\n </IntlProvider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { NodeProps } from \"./node\"\nimport { useComponents } from \"../../../context\"\nimport { triggerToWindowCall } from \"../../../util/ui\"\nimport {\n UiNodeInputAttributes,\n UiNodeInputAttributesTypeEnum,\n} from \"@ory/client-fetch\"\nimport { MouseEventHandler, ReactNode, useEffect, useRef } from \"react\"\nimport { useFormContext } from \"react-hook-form\"\n\nexport const NodeInput = ({\n node,\n attributes,\n}: NodeProps & {\n attributes: UiNodeInputAttributes\n onClick?: MouseEventHandler\n}): ReactNode => {\n const { Node } = useComponents()\n const { setValue } = useFormContext()\n\n const {\n onloadTrigger: onloadTrigger,\n onclickTrigger,\n // These properties do not exist on input fields so we remove them (as we already have handled them).\n onclick: _ignoredOnclick,\n onload: _ignoredOnload,\n //\n ...attrs\n } = attributes\n const isResendNode = node.meta.label?.id === 1070008\n const isScreenSelectionNode =\n \"name\" in node.attributes && node.attributes.name === \"screen\"\n\n const setFormValue = () => {\n if (attrs.value && !(isResendNode || isScreenSelectionNode)) {\n setValue(attrs.name, attrs.value)\n }\n }\n\n const hasRun = useRef(false)\n useEffect(\n () => {\n setFormValue()\n if (!hasRun.current && onloadTrigger) {\n hasRun.current = true\n triggerToWindowCall(onloadTrigger)\n }\n },\n // TODO(jonas): make sure onloadTrigger is stable\n // eslint-disable-next-line react-hooks/exhaustive-deps -- ignore onloadTrigger for now, until we make sure this is stable\n [],\n )\n\n const handleClick: MouseEventHandler = () => {\n setFormValue()\n if (onclickTrigger) {\n triggerToWindowCall(onclickTrigger)\n }\n }\n\n const isSocial =\n (attrs.name === \"provider\" || attrs.name === \"link\") &&\n node.group === \"oidc\"\n const isPinCodeInput =\n (attrs.name === \"code\" && node.group === \"code\") ||\n (attrs.name === \"totp_code\" && node.group === \"totp\")\n\n switch (attributes.type) {\n case UiNodeInputAttributesTypeEnum.Submit:\n case UiNodeInputAttributesTypeEnum.Button:\n if (isSocial) {\n return null\n }\n if (isResendNode || isScreenSelectionNode) {\n return null\n }\n\n return (\n <Node.Label\n // The label is rendered in the button component\n attributes={{ ...attrs, label: undefined }}\n node={{ ...node, meta: { ...node.meta, label: undefined } }}\n >\n <Node.Button attributes={attrs} node={node} onClick={handleClick} />\n </Node.Label>\n )\n case UiNodeInputAttributesTypeEnum.DatetimeLocal:\n throw new Error(\"Not implemented\")\n case UiNodeInputAttributesTypeEnum.Checkbox:\n return (\n <Node.Label\n // The label is rendered in the checkbox component\n attributes={{ ...attrs, label: undefined }}\n node={{ ...node, meta: { ...node.meta, label: undefined } }}\n >\n <Node.Checkbox attributes={attrs} node={node} onClick={handleClick} />\n </Node.Label>\n )\n case UiNodeInputAttributesTypeEnum.Hidden:\n return <Node.Input attributes={attrs} node={node} onClick={handleClick} />\n default:\n if (isPinCodeInput) {\n return (\n <Node.Label attributes={attrs} node={node}>\n <Node.CodeInput\n attributes={attrs}\n node={node}\n onClick={handleClick}\n />\n </Node.Label>\n )\n }\n\n return (\n <Node.Label attributes={attrs} node={node}>\n <Node.Input attributes={attrs} node={node} onClick={handleClick} />\n </Node.Label>\n )\n }\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n OryFlowComponentOverrides,\n OryFlowComponents,\n} from \"@ory/elements-react\"\nimport {\n DefaultCard,\n DefaultCardContent,\n DefaultCardFooter,\n DefaultCardHeader,\n DefaultCardLogo,\n} from \"./card\"\nimport { DefaultAuthMethodListItem } from \"./card/auth-method-list-item\"\nimport {\n DefaultFormContainer,\n DefaultMessage,\n DefaultMessageContainer,\n} from \"./form\"\nimport { DefaultButton } from \"./form/button\"\nimport { DefaultCheckbox } from \"./form/checkbox\"\nimport { DefaultGroupContainer } from \"./form/group-container\"\nimport { DefaultHorizontalDivider } from \"./form/horizontal-divider\"\nimport { DefaultImage } from \"./form/image\"\nimport { DefaultInput } from \"./form/input\"\nimport { DefaultLabel } from \"./form/label\"\nimport { DefaultLinkButton } from \"./form/link-button\"\nimport { DefaultPinCodeInput } from \"./form/pin-code-input\"\nimport {\n DefaultFormSection,\n DefaultFormSectionContent,\n DefaultFormSectionFooter,\n} from \"./form/section\"\nimport {\n DefaultButtonSocial,\n DefaultSocialButtonContainer,\n} from \"./form/social\"\nimport { DefaultText } from \"./form/text\"\nimport { DefaultPageHeader } from \"./generic/page-header\"\nimport { DefaultSettingsOidc } from \"./settings/settings-oidc\"\nimport { DefaultSettingsPasskey } from \"./settings/settings-passkey\"\nimport { DefaultSettingsRecoveryCodes } from \"./settings/settings-recovery-codes\"\nimport { DefaultSettingsTotp } from \"./settings/settings-totp\"\nimport { DefaultSettingsWebauthn } from \"./settings/settings-webauthn\"\nimport { DefaultAuthMethodListContainer } from \"./card/auth-method-list-container\"\nimport { DefaultCaptcha } from \"./form/captcha\"\n\nexport function getOryComponents(\n overrides?: OryFlowComponentOverrides,\n): OryFlowComponents {\n // Yes, this could probably be easier by using lodash or a custom merge function.\n // But, this makes it very explicit what can be overridden, and does not introduce issues with merging nested fields.\n return {\n Card: {\n Root: overrides?.Card?.Root ?? DefaultCard,\n Footer: overrides?.Card?.Footer ?? DefaultCardFooter,\n Header: overrides?.Card?.Header ?? DefaultCardHeader,\n Content: overrides?.Card?.Content ?? DefaultCardContent,\n Logo: overrides?.Card?.Logo ?? DefaultCardLogo,\n Divider: overrides?.Card?.Divider ?? DefaultHorizontalDivider,\n AuthMethodListContainer:\n overrides?.Card?.AuthMethodListContainer ??\n DefaultAuthMethodListContainer,\n AuthMethodListItem:\n overrides?.Card?.AuthMethodListItem ?? DefaultAuthMethodListItem,\n SettingsSection: overrides?.Card?.SettingsSection ?? DefaultFormSection,\n SettingsSectionContent:\n overrides?.Card?.SettingsSectionContent ?? DefaultFormSectionContent,\n SettingsSectionFooter:\n overrides?.Card?.SettingsSectionFooter ?? DefaultFormSectionFooter,\n },\n Node: {\n Button: overrides?.Node?.Button ?? DefaultButton,\n OidcButton: overrides?.Node?.OidcButton ?? DefaultButtonSocial,\n Input: overrides?.Node?.Input ?? DefaultInput,\n CodeInput: overrides?.Node?.CodeInput ?? DefaultPinCodeInput,\n Image: overrides?.Node?.Image ?? DefaultImage,\n Label: overrides?.Node?.Label ?? DefaultLabel,\n Checkbox: overrides?.Node?.Checkbox ?? DefaultCheckbox,\n Text: overrides?.Node?.Text ?? DefaultText,\n Anchor: overrides?.Node?.Anchor ?? DefaultLinkButton,\n Captcha: overrides?.Node?.Captcha ?? DefaultCaptcha,\n },\n Form: {\n Root: overrides?.Form?.Root ?? DefaultFormContainer,\n Group: overrides?.Form?.Group ?? DefaultGroupContainer,\n OidcRoot: overrides?.Form?.OidcRoot ?? DefaultSocialButtonContainer,\n RecoveryCodesSettings:\n overrides?.Form?.RecoveryCodesSettings ?? DefaultSettingsRecoveryCodes,\n TotpSettings: overrides?.Form?.TotpSettings ?? DefaultSettingsTotp,\n OidcSettings: overrides?.Form?.OidcSettings ?? DefaultSettingsOidc,\n WebauthnSettings:\n overrides?.Form?.WebauthnSettings ?? DefaultSettingsWebauthn,\n PasskeySettings:\n overrides?.Form?.PasskeySettings ?? DefaultSettingsPasskey,\n },\n Message: {\n Root: overrides?.Message?.Root ?? DefaultMessageContainer,\n Content: overrides?.Message?.Content ?? DefaultMessage,\n },\n Page: {\n Header: overrides?.Page?.Header ?? DefaultPageHeader,\n },\n }\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { FlowError } from \"@ory/client-fetch\"\nimport {\n OryClientConfiguration,\n OryFlowComponentOverrides,\n} from \"@ory/elements-react\"\nimport { PropsWithChildren } from \"react\"\n\nexport type ErrorFlowContextProps = {\n error: FlowError\n components?: OryFlowComponentOverrides\n config: OryClientConfiguration\n}\n\nexport function Error({\n error,\n children,\n}: PropsWithChildren<ErrorFlowContextProps>) {\n return (\n <div data-testid={\"ory/screen/error/raw\"}>\n {JSON.stringify(error) || children}\n </div>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { FlowType, LoginFlow } from \"@ory/client-fetch\"\nimport {\n OryClientConfiguration,\n OryFlowComponentOverrides,\n OryProvider,\n OryTwoStepCard,\n} from \"@ory/elements-react\"\nimport { PropsWithChildren } from \"react\"\nimport { getOryComponents } from \"../components\"\n\nexport type LoginFlowContextProps = {\n flow: LoginFlow\n components?: OryFlowComponentOverrides\n config: OryClientConfiguration\n}\n\nexport function Login({\n flow,\n config,\n children,\n components: flowOverrideComponents,\n}: PropsWithChildren<LoginFlowContextProps>) {\n const components = getOryComponents(flowOverrideComponents)\n return (\n <OryProvider\n config={config}\n flow={flow}\n flowType={FlowType.Login}\n components={components}\n >\n {children ?? <OryTwoStepCard />}\n </OryProvider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { FlowType, RecoveryFlow } from \"@ory/client-fetch\"\nimport {\n OryClientConfiguration,\n OryFlowComponentOverrides,\n OryProvider,\n OryTwoStepCard,\n} from \"@ory/elements-react\"\nimport { PropsWithChildren } from \"react\"\nimport { getOryComponents } from \"../components\"\n\nexport type RecoveryFlowContextProps = {\n flow: RecoveryFlow\n components?: OryFlowComponentOverrides\n config: OryClientConfiguration\n}\n\nexport function Recovery({\n flow,\n config,\n children,\n components: flowOverrideComponents,\n}: PropsWithChildren<RecoveryFlowContextProps>) {\n const components = getOryComponents(flowOverrideComponents)\n return (\n <OryProvider\n config={config}\n flow={flow}\n flowType={FlowType.Recovery}\n components={components}\n >\n {children ?? <OryTwoStepCard />}\n </OryProvider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { FlowType, RegistrationFlow } from \"@ory/client-fetch\"\nimport {\n OryClientConfiguration,\n OryFlowComponentOverrides,\n OryProvider,\n OryTwoStepCard,\n} from \"@ory/elements-react\"\nimport { PropsWithChildren } from \"react\"\nimport { getOryComponents } from \"../components\"\n\ntype RegistrationFlowContextProps = {\n flow: RegistrationFlow\n components?: OryFlowComponentOverrides\n config: OryClientConfiguration\n}\n\nexport function Registration({\n flow,\n children,\n components: flowOverrideComponents,\n config,\n}: PropsWithChildren<RegistrationFlowContextProps>) {\n const components = getOryComponents(flowOverrideComponents)\n return (\n <OryProvider\n config={config}\n flow={flow}\n flowType={FlowType.Registration}\n components={components}\n >\n {children ?? <OryTwoStepCard />}\n </OryProvider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { FlowType, SettingsFlow } from \"@ory/client-fetch\"\nimport {\n HeadlessPageHeader,\n OryClientConfiguration,\n OryFlowComponentOverrides,\n OryProvider,\n OrySettingsCard,\n} from \"@ory/elements-react\"\nimport { PropsWithChildren } from \"react\"\nimport { getOryComponents } from \"../components\"\n\nexport type SettingsFlowContextProps = {\n flow: SettingsFlow\n components?: OryFlowComponentOverrides\n config: OryClientConfiguration\n}\n\nexport function Settings({\n flow,\n config,\n children,\n components: flowOverrideComponents,\n}: PropsWithChildren<SettingsFlowContextProps>) {\n const components = getOryComponents(flowOverrideComponents)\n\n return (\n <OryProvider\n config={config}\n flow={flow}\n flowType={FlowType.Settings}\n components={components}\n >\n {children ?? (\n <>\n <HeadlessPageHeader />\n <OrySettingsCard />\n </>\n )}\n </OryProvider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { FlowType, VerificationFlow } from \"@ory/client-fetch\"\nimport {\n OryClientConfiguration,\n OryFlowComponentOverrides,\n OryProvider,\n OryTwoStepCard,\n} from \"@ory/elements-react\"\nimport { PropsWithChildren } from \"react\"\nimport { getOryComponents } from \"../components\"\n\nexport type VerificationFlowContextProps = {\n flow: VerificationFlow\n components?: OryFlowComponentOverrides\n config: OryClientConfiguration\n}\n\nexport function Verification({\n flow,\n config,\n children,\n components: flowOverrideComponents,\n}: PropsWithChildren<VerificationFlowContextProps>) {\n const components = getOryComponents(flowOverrideComponents)\n return (\n <OryProvider\n config={config}\n flow={flow}\n flowType={FlowType.Verification}\n components={components}\n >\n {children ?? <OryTwoStepCard />}\n </OryProvider>\n )\n}\n"],"mappings":";;;AAAA,YAAY,WAAW;AACgB,SAAgL,KAAhL;AAAvC,IAAM,wBAAwB,WAAM;AADpC;AACuC,8BAAC,SAAI,OAAM,8BAA6B,QAAO,+BAAO,SAAQ,MAAM,SAAQ,oCAAO,SAAP,YAAe,IAAI,SAAQ,+BAAO,UAAS,MAAM,UAAS,oCAAO,SAAP,YAAe,IAAI,MAAK,QAAQ,GAAG,OAAO;AAAA,wBAAC,UAAK,MAAK,WAAU,GAAE,uEAAsE;AAAA,IAAE,oBAAC,UAAK,MAAK,WAAU,UAAS,WAAU,GAAE,yTAAwT,UAAS,WA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AEJ;","names":["React","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsxs","jsx","useOryFlow","FlowType","useIntl","FlowType","useOryFlow","React","jsx","jsx","jsxs","useOryFlow","initFlowUrl","FlowType","jsx","jsxs","useOryFlow","useOryFlow","jsx","jsx","jsx","jsxs","useIntl","uiTextToFormattedMessage","useOryFlow","FlowType","useOryFlow","useFormContext","useIntl","React","jsx","React","jsx","React","jsx","jsxs","React","jsx","jsxs","React","jsx","jsxs","React","jsx","React","jsx","jsxs","React","jsx","jsxs","React","jsx","jsxs","React","jsx","jsxs","React","jsx","jsxs","React","jsx","jsxs","React","jsx","jsxs","React","jsx","jsx","jsxs","Fragment","jsx","jsxs","logos","useOryFlow","useIntl","useFormContext","node","jsx","useOryFlow","FlowType","useIntl","uiTextToFormattedMessage","useIntl","React","jsx","React","jsx","React","jsx","React","jsx","jsx","jsxs","useIntl","uiTextToFormattedMessage","useFormContext","useIntl","useEffect","jsx","jsxs","useIntl","useFormContext","uiTextToFormattedMessage","getNodeLabel","messageTestId","uiTextToFormattedMessage","useIntl","useIntl","uiTextToFormattedMessage","Fragment","jsx","useIntl","uiTextToFormattedMessage","jsx","jsxs","useIntl","getNodeLabel","messageTestId","uiTextToFormattedMessage","jsx","jsx","jsx","FlowType","getNodeLabel","uiTextToFormattedMessage","useOryFlow","useFormContext","useIntl","jsx","getNodeLabel","useFormContext","useIntl","useOryFlow","uiTextToFormattedMessage","FlowType","FlowType","getNodeLabel","messageTestId","uiTextToFormattedMessage","useComponents","useOryFlow","useFormContext","useIntl","jsx","jsxs","useIntl","getNodeLabel","useComponents","useOryFlow","useFormContext","messageTestId","uiTextToFormattedMessage","FlowType","getNodeLabel","uiTextToFormattedMessage","useIntl","jsx","useIntl","getNodeLabel","uiTextToFormattedMessage","useFormContext","React","jsx","jsxs","useOryFlow","FlowType","jsx","useFormContext","useOryFlow","FlowType","jsx","jsxs","uiTextToFormattedMessage","useIntl","Fragment","jsx","jsxs","useComponents","DropdownMenuLabel","useEffect","useState","useOryFlow","React","jsx","React","jsx","jsxs","forwardRef","jsx","forwardRef","jsx","forwardRef","React","jsx","jsx","forwardRef","jsx","jsxs","useOryFlow","useState","useEffect","DropdownMenuLabel","jsx","jsxs","useComponents","useEffect","useFormContext","useDebounceValue","React","jsx","jsx","jsxs","useDebounceValue","useFormContext","useEffect","useComponents","useFormContext","jsx","jsxs","useFormContext","Node","useComponents","React","jsx","React","jsx","jsxs","React","jsx","useFormContext","Fragment","jsx","jsxs","useComponents","React","jsx","useFormContext","jsx","jsxs","Node","useComponents","useFormContext","useComponents","React","jsx","useFormContext","jsx","jsxs","useFormContext","Node","useComponents","jsx","isUiNodeInputAttributes","useRef","useFormContext","isUiNodeInputAttributes","useContext","jsx","useComponents","createContext","useContext","useState","FlowType","UiNodeGroupEnum","UiNodeGroupEnum","fn","jsx","createContext","jsx","UiNodeGroupEnum","useForm","isUiNodeInputAttributes","isUiNodeInputAttributes","jsx","jsx","jsx","jsx","UiNodeGroupEnum","useFormContext","isUiNodeInputAttributes","useFormContext","useIntl","FlowType","useFormContext","FlowType","FlowType","handleFlowError","FlowType","handleContinueWith","handleFlowError","FlowType","handleContinueWith","handleFlowError","loginUrl","FlowType","handleFlowError","jsx","jsx","isUiNodeAnchorAttributes","isUiNodeImageAttributes","isUiNodeInputAttributes","isUiNodeScriptAttributes","UiNodeGroupEnum","jsx","useFormContext","jsx","Fragment","jsx","jsxs","jsx","useFormContext","jsx","jsx","jsx","UiNodeGroupEnum","useIntl","useIntl","useFormContext","Fragment","jsx","jsxs","useFormContext","useIntl","Fragment","jsx","jsxs","useIntl","useFormContext","Fragment","jsx","jsxs","useFormContext","useIntl","Fragment","jsx","jsxs","useFormContext","useIntl","Fragment","jsx","jsxs","Fragment","jsx","jsxs","jsx","jsx","useEffect","useFormContext","jsx","Node","useComponents","jsx","useFormContext","useRef","isUiNodeInputAttributes","jsx","Error","FlowType","OryTwoStepCard","jsx","FlowType","OryTwoStepCard","FlowType","OryProvider","OryTwoStepCard","jsx","OryProvider","FlowType","OryTwoStepCard","FlowType","OryProvider","OryTwoStepCard","jsx","OryProvider","FlowType","OryTwoStepCard","FlowType","OryProvider","Fragment","jsx","jsxs","OryProvider","FlowType","FlowType","OryProvider","OryTwoStepCard","jsx","OryProvider","FlowType","OryTwoStepCard"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/theme/default/assets/ory-badge-horizontal.svg","../../../src/theme/default/assets/ory-badge-vertical.svg","../../../src/theme/default/components/card/badge.tsx","../../../src/theme/default/components/card/content.tsx","../../../src/theme/default/components/card/footer.tsx","../../../src/theme/default/utils/url.ts","../../../src/util/ui/index.ts","../../../src/context/component.tsx","../../../src/theme/default/components/card/header.tsx","../../../src/theme/default/utils/constructCardHeader.ts","../../../src/theme/default/components/card/current-identifier-button.tsx","../../../src/theme/default/assets/icons/arrow-left.svg","../../../src/theme/default/utils/attributes.ts","../../../src/theme/default/components/card/logo.tsx","../../../src/theme/default/components/card/layout.tsx","../../../src/theme/default/components/card/index.tsx","../../../src/theme/default/utils/cn.ts","../../../src/theme/default/components/form/index.tsx","../../../src/theme/default/components/form/social.tsx","../../../src/theme/default/provider-logos/apple.svg","../../../src/theme/default/provider-logos/auth0.svg","../../../src/theme/default/provider-logos/discord.svg","../../../src/theme/default/provider-logos/facebook.svg","../../../src/theme/default/provider-logos/generic.svg","../../../src/theme/default/provider-logos/github.svg","../../../src/theme/default/provider-logos/gitlab.svg","../../../src/theme/default/provider-logos/google.svg","../../../src/theme/default/provider-logos/linkedin.svg","../../../src/theme/default/provider-logos/microsoft.svg","../../../src/theme/default/provider-logos/slack.svg","../../../src/theme/default/provider-logos/spotify.svg","../../../src/theme/default/provider-logos/yandex.svg","../../../src/theme/default/provider-logos/x.svg","../../../src/theme/default/provider-logos/index.ts","../../../src/theme/default/components/form/spinner.tsx","../../../src/theme/default/components/card/auth-method-list-item.tsx","../../../src/theme/default/assets/icons/code.svg","../../../src/theme/default/assets/icons/passkey.svg","../../../src/theme/default/assets/icons/password.svg","../../../src/theme/default/assets/icons/webauthn.svg","../../../src/theme/default/assets/icons/totp.svg","../../../src/theme/default/assets/icons/code-asterix.svg","../../../src/theme/default/utils/form.ts","../../../src/theme/default/components/form/button.tsx","../../../src/theme/default/components/form/checkbox.tsx","../../../src/theme/default/components/ui/checkbox-label.tsx","../../../src/util/i18n/index.ts","../../../src/theme/default/components/form/group-container.tsx","../../../src/theme/default/components/form/horizontal-divider.tsx","../../../src/theme/default/components/form/image.tsx","../../../src/theme/default/components/form/input.tsx","../../../src/theme/default/assets/icons/eye-off.svg","../../../src/theme/default/assets/icons/eye.svg","../../../src/theme/default/components/form/label.tsx","../../../src/theme/default/components/form/link-button.tsx","../../../src/theme/default/components/form/pin-code-input.tsx","../../../src/theme/default/components/form/shadcn/otp-input.tsx","../../../src/theme/default/components/form/section.tsx","../../../src/theme/default/components/form/text.tsx","../../../src/theme/default/components/generic/page-header.tsx","../../../src/theme/default/components/ui/user-menu.tsx","../../../src/util/client.ts","../../../src/theme/default/assets/icons/logout.svg","../../../src/theme/default/assets/icons/settings.svg","../../../src/theme/default/utils/user.ts","../../../src/theme/default/components/ui/dropdown-menu.tsx","../../../src/theme/default/components/ui/user-avater.tsx","../../../src/theme/default/assets/icons/user.svg","../../../src/theme/default/components/settings/settings-oidc.tsx","../../../src/theme/default/assets/icons/trash.svg","../../../src/theme/default/components/settings/settings-passkey.tsx","../../../src/theme/default/assets/icons/download.svg","../../../src/theme/default/assets/icons/refresh.svg","../../../src/theme/default/components/settings/settings-recovery-codes.tsx","../../../src/theme/default/components/settings/settings-totp.tsx","../../../src/theme/default/assets/icons/qrcode.svg","../../../src/theme/default/components/settings/settings-webauthn.tsx","../../../src/theme/default/assets/icons/key.svg","../../../src/theme/default/components/card/auth-method-list-container.tsx","../../../src/theme/default/components/form/captcha.tsx","../../../src/context/flow-context.tsx","../../../src/context/form-state.ts","../../../src/components/card/card-two-step.utils.ts","../../../src/context/intl-context.tsx","../../../src/components/card/header.tsx","../../../src/components/form/form-provider.tsx","../../../src/components/form/form-helpers.ts","../../../src/components/form/form-resolver.ts","../../../src/components/card/card.tsx","../../../src/components/card/footer.tsx","../../../src/components/card/content.tsx","../../../src/components/card/card-two-step.tsx","../../../src/components/form/form.tsx","../../../src/components/form/useOryFormSubmit.ts","../../../src/util/onSubmitLogin.ts","../../../src/util/onSubmitRecovery.ts","../../../src/util/onSubmitRegistration.ts","../../../src/util/onSubmitSettings.ts","../../../src/util/onSubmitVerification.ts","../../../src/components/form/messages.tsx","../../../src/components/form/nodes/node.tsx","../../../src/components/form/social.tsx","../../../src/components/form/groups.tsx","../../../src/components/form/section.tsx","../../../src/components/generic/divider.tsx","../../../src/components/generic/page-header.tsx","../../../src/components/settings/settings-card.tsx","../../../src/components/settings/oidc-settings.tsx","../../../src/components/settings/passkey-settings.tsx","../../../src/components/settings/recovery-codes-settings.tsx","../../../src/components/settings/totp-settings.tsx","../../../src/components/settings/webauthn-settings.tsx","../../../src/context/provider.tsx","../../../src/components/form/nodes/input.tsx","../../../src/theme/default/components/default-components.tsx","../../../src/theme/default/flows/error.tsx","../../../src/theme/default/flows/login.tsx","../../../src/theme/default/flows/recovery.tsx","../../../src/theme/default/flows/registration.tsx","../../../src/theme/default/flows/settings.tsx","../../../src/theme/default/flows/verification.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgOryBadgeHorizontal = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} fill=\"none\" {...props}><path fill=\"#0F172A\" d=\"M18.007 8h-1.71l2.007-3.996L16.296 0h1.711l1.145 2.301L20.327 0H22z\" /><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\" /></svg>;\nexport default SvgOryBadgeHorizontal;","import * as React from \"react\";\nconst SvgOryBadgeVertical = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} fill=\"none\" {...props}><path fill=\"#0F172A\" d=\"M8 3.993v1.71L4.004 3.697 0 5.704V3.993l2.301-1.145L0 1.673V0z\" /><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\" /></svg>;\nexport default SvgOryBadgeVertical;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport OryLogoHorizontal from \"../../assets/ory-badge-horizontal.svg\"\nimport OryLogoVertical from \"../../assets/ory-badge-vertical.svg\"\n\nexport function Badge() {\n return (\n <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]\">\n <OryLogoHorizontal width={22} height={8} className=\"sm:hidden\" />\n <OryLogoVertical width={8} height={22} className=\"max-sm:hidden\" />\n </div>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { OryCardContentProps } from \"@ory/elements-react\"\n\nexport function DefaultCardContent({ children }: OryCardContentProps) {\n return children\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { FlowType, UiNode, UiNodeInputAttributes } from \"@ory/client-fetch\"\nimport { useOryFlow } from \"@ory/elements-react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { initFlowUrl, restartFlowUrl } from \"../../utils/url\"\nimport { nodesToAuthMethodGroups } from \"../../../../util/ui\"\n\nexport function DefaultCardFooter() {\n const { flowType } = useOryFlow()\n switch (flowType) {\n case FlowType.Login:\n return <LoginCardFooter />\n case FlowType.Registration:\n return <RegistrationCardFooter />\n case FlowType.Recovery:\n return <RecoveryCardFooter />\n case FlowType.Verification:\n return <VerificationCardFooter />\n default:\n return null\n }\n}\n\nexport function getReturnToQueryParam(flow: { return_to?: string }) {\n if (flow.return_to) {\n return flow.return_to\n }\n if (typeof window !== \"undefined\") {\n const searchParams = new URLSearchParams(window.location.search)\n return searchParams.get(\"return_to\")\n }\n}\n\nfunction LoginCardFooter() {\n const { config, formState, flow, flowType } = useOryFlow()\n const intl = useIntl()\n\n const authMethods = nodesToAuthMethodGroups(flow.ui.nodes)\n\n if (flowType === FlowType.Login && flow.refresh) {\n return null\n }\n\n return (\n <>\n {formState.current === \"provide_identifier\" && (\n <span className=\"font-normal leading-normal antialiased text-interface-foreground-default-primary\">\n {intl.formatMessage({\n id: \"login.registration-label\",\n defaultMessage: \"No account?\",\n })}{\" \"}\n <a\n className=\"text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline\"\n href={initFlowUrl(config.sdk.url, \"registration\", flow)}\n data-testid={\"ory/screen/registration/action/login\"}\n >\n {intl.formatMessage({\n id: \"login.registration-button\",\n defaultMessage: \"Sign up\",\n })}\n </a>\n </span>\n )}\n {authMethods.length > 1 && formState.current === \"method_active\" && (\n <span className=\"font-normal leading-normal antialiased text-interface-foreground-default-primary\">\n <a\n className=\"text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline\"\n href=\"\"\n data-testid={\"ory/screen/login/mfa/action/selectMethod\"}\n >\n {intl.formatMessage({\n id: \"login.2fa.method.go-back\",\n })}\n </a>\n </span>\n )}\n {/* special case for code auth method */}\n {authMethods.length === 1 &&\n authMethods[0] === \"code\" &&\n formState.current === \"method_active\" && (\n <span className=\"font-normal leading-normal antialiased text-interface-foreground-default-primary\">\n <a\n className=\"text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline\"\n href={restartFlowUrl(\n flow,\n `${config.sdk.url}/self-service/${flowType}/browser`,\n )}\n data-testid={\"ory/screen/login/mfa/action/reauthenticate\"}\n >\n {intl.formatMessage({\n id: \"login.2fa.go-back.link\",\n })}\n </a>\n </span>\n )}\n {flowType === FlowType.Login &&\n flow.requested_aal === \"aal2\" &&\n (formState.current === \"select_method\" || authMethods.length === 0) && (\n <span className=\"font-normal leading-normal antialiased text-interface-foreground-default-primary\">\n {intl.formatMessage({\n id: \"login.2fa.go-back\",\n })}{\" \"}\n <a\n className=\"text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline\"\n href={restartFlowUrl(\n flow,\n `${config.sdk.url}/self-service/${flowType}/browser`,\n )}\n data-testid={\"ory/screen/login/mfa/action/reauthenticate\"}\n >\n {intl.formatMessage({\n id: \"login.2fa.go-back.link\",\n })}\n </a>\n </span>\n )}\n </>\n )\n}\n\nfunction findScreenSelectionButton(\n nodes: UiNode[],\n): { attributes: UiNodeInputAttributes } | undefined {\n return nodes.find(\n (node) =>\n node.attributes.node_type === \"input\" &&\n node.attributes.type === \"submit\" &&\n node.attributes.name === \"screen\",\n ) as { attributes: UiNodeInputAttributes }\n}\n\nfunction RegistrationCardFooter() {\n const intl = useIntl()\n const { config, flow, formState } = useOryFlow()\n const { setValue } = useFormContext()\n\n if (formState.current === \"select_method\") {\n return null\n }\n const screenSelectionNode = findScreenSelectionButton(flow.ui.nodes)\n\n function handleScreenSelection() {\n setValue(\"method\", \"profile\")\n if (screenSelectionNode) {\n setValue(\n screenSelectionNode.attributes.name,\n screenSelectionNode.attributes.value,\n )\n }\n }\n\n return (\n <span className=\"font-normal leading-normal antialiased\">\n {formState.current === \"method_active\" ? (\n <>\n {screenSelectionNode && (\n <button\n className=\"font-medium text-button-link-brand-brand hover:text-button-link-brand-brand-hover\"\n type=\"submit\"\n name={screenSelectionNode.attributes.name}\n value={screenSelectionNode.attributes.value}\n onClick={handleScreenSelection}\n >\n {intl.formatMessage({\n id: \"card.footer.select-another-method\",\n defaultMessage: \"Select another method\",\n })}\n </button>\n )}\n </>\n ) : (\n <>\n {intl.formatMessage({\n id: \"registration.login-label\",\n defaultMessage: \"Already have an account?\",\n })}{\" \"}\n <a\n className=\"text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline\"\n href={initFlowUrl(config.sdk.url, \"login\", flow)}\n data-testid={\"ory/screen/registration/action/login\"}\n >\n {intl.formatMessage({\n id: \"registration.login-button\",\n defaultMessage: \"Sign in\",\n })}\n </a>\n </>\n )}\n </span>\n )\n}\n\nfunction RecoveryCardFooter() {\n return null\n}\n\nfunction VerificationCardFooter() {\n return null\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AuthenticatorAssuranceLevel } from \"@ory/client-fetch\"\n\nexport function restartFlowUrl(\n flow: { request_url?: string; requested_aal?: string; return_to?: string },\n fallback: string,\n) {\n if (flow.requested_aal === \"aal2\")\n return appendRefresh(appendAal(fallback, \"aal1\"), true)\n return flow.request_url || appendReturnTo(fallback, flow.return_to)\n}\n\nexport function initFlowUrl(\n sdkUrl: string,\n flowType: string,\n flow: {\n return_to?: string\n oauth2_login_challenge?: string\n },\n) {\n const result = `${sdkUrl}/self-service/${flowType}/browser`\n const qs = new URLSearchParams()\n\n if (flow.oauth2_login_challenge) {\n qs.set(\"login_challenge\", flow.oauth2_login_challenge)\n }\n if (flow.return_to) {\n qs.set(\"return_to\", flow.return_to)\n } else if (typeof window !== \"undefined\") {\n const searchParams = new URLSearchParams(window.location.search)\n if (searchParams.has(\"return_to\")) {\n qs.set(\"return_to\", searchParams.get(\"return_to\") || \"\")\n }\n }\n\n if (qs.toString().length === 0) {\n return result\n }\n\n return result + \"?\" + qs.toString()\n}\n\nfunction appendReturnTo(url: string, returnTo?: string) {\n if (!returnTo) {\n return url\n }\n\n const urlObj = new URL(url)\n urlObj.searchParams.set(\"return_to\", returnTo)\n return urlObj.toString()\n}\n\nfunction appendAal(url: string, aal: AuthenticatorAssuranceLevel) {\n const urlObj = new URL(url)\n urlObj.searchParams.set(\"aal\", aal)\n return urlObj.toString()\n}\n\nfunction appendRefresh(url: string, refresh: boolean) {\n const urlObj = new URL(url)\n urlObj.searchParams.set(\"refresh\", refresh ? \"true\" : \"false\")\n return urlObj.toString()\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode } from \"@ory/client-fetch\"\n\nimport type {\n UiNodeAttributes,\n UiNodeInputAttributesOnclickTriggerEnum,\n UiNodeInputAttributesOnloadTriggerEnum,\n UiNodeInputAttributesTypeEnum,\n} from \"@ory/client-fetch\"\nimport { UiNodeGroupEnum } from \"@ory/client-fetch\"\nimport { useMemo } from \"react\"\nimport { useGroupSorter } from \"../../context/component\"\n\nexport function capitalize(s: string) {\n if (!s) {\n return s\n }\n return s.charAt(0).toUpperCase() + s.slice(1)\n}\n\nexport type FilterNodesByGroups = {\n nodes: UiNode[]\n groups?: UiNodeGroupEnum[] | UiNodeGroupEnum\n withoutDefaultGroup?: boolean\n attributes?: UiNodeInputAttributesTypeEnum[] | UiNodeInputAttributesTypeEnum\n withoutDefaultAttributes?: boolean\n excludeAttributes?:\n | UiNodeInputAttributesTypeEnum[]\n | UiNodeInputAttributesTypeEnum\n}\n\nexport function triggerToWindowCall(\n trigger:\n | UiNodeInputAttributesOnclickTriggerEnum\n | UiNodeInputAttributesOnloadTriggerEnum\n | undefined,\n) {\n if (!trigger) {\n return\n }\n\n const fn = triggerToFunction(trigger)\n if (fn) {\n fn()\n return\n }\n\n // Retry every 100ms for 10 seconds\n let i = 0\n const ms = 100\n const interval = setInterval(() => {\n i++\n if (i > 100) {\n clearInterval(interval)\n throw new Error(\n \"Unable to load Ory's WebAuthn script. Is it being blocked or otherwise failing to load? If you are running an old version of Ory Elements, please upgrade. For more information, please check your browser's developer console.\",\n )\n }\n\n const fn = triggerToFunction(trigger)\n if (fn) {\n clearInterval(interval)\n return fn()\n }\n }, ms)\n return\n}\n\nfunction triggerToFunction(\n trigger:\n | UiNodeInputAttributesOnclickTriggerEnum\n | UiNodeInputAttributesOnloadTriggerEnum,\n) {\n if (typeof window === \"undefined\") {\n console.debug(\n \"The Ory SDK is missing a required function: window is undefined.\",\n )\n return undefined\n }\n\n const typedWindow = window as { [key: string]: any } // eslint-disable-line @typescript-eslint/no-explicit-any\n if (!(trigger in typedWindow) || !typedWindow[trigger]) {\n console.debug(`The Ory SDK is missing a required function: ${trigger}.`)\n return undefined\n }\n const triggerFn = typedWindow[trigger]\n if (typeof triggerFn !== \"function\") {\n console.debug(\n `The Ory SDK is missing a required function: ${trigger}. It is not a function.`,\n )\n return undefined\n }\n return triggerFn as () => void\n}\n\ntype Entries<T> = {\n [K in keyof T]: [K, T[K]]\n}[keyof T][]\n\n/**\n * Returns a list of auth methods from a list of nodes. For example,\n * if Password and Passkey are present, it will return [password, passkey].\n *\n * Please note that OIDC is not considered an auth method because it is\n * usually shown as a separate auth method\n *\n * This method the default, identifier_first, and profile groups.\n *\n * @param nodes - The nodes to extract the auth methods from\n * @param excludeAuthMethods - A list of auth methods to exclude\n */\nexport function nodesToAuthMethodGroups(\n nodes: Array<UiNode>,\n excludeAuthMethods = [],\n): UiNodeGroupEnum[] {\n const groups: Partial<Record<UiNodeGroupEnum, UiNode[]>> = {}\n\n for (const node of nodes) {\n if (node.type === \"script\") {\n // We always render all scripts, because the scripts for passkeys are part of the webauthn group,\n // which leads to this hook returning a webauthn group on passkey flows (which it should not - webauthn is the \"legacy\" passkey implementation).\n continue\n }\n const groupNodes = groups[node.group] ?? []\n groupNodes.push(node)\n groups[node.group] = groupNodes\n }\n\n return Object.values(UiNodeGroupEnum)\n .filter((group) => groups[group]?.length)\n .filter(\n (group) =>\n !(\n [\n UiNodeGroupEnum.Default,\n UiNodeGroupEnum.IdentifierFirst,\n UiNodeGroupEnum.Profile,\n UiNodeGroupEnum.Captcha,\n ...excludeAuthMethods,\n ] as UiNodeGroupEnum[]\n ).includes(group),\n )\n}\n\n/**\n * Groups nodes by their group and returns an object with the groups and entries.\n *\n * @param nodes - The nodes to group\n */\nexport function useNodesGroups(nodes: UiNode[]) {\n const groupSorter = useGroupSorter()\n\n const groups = useMemo(() => {\n const groups: Partial<Record<UiNodeGroupEnum, UiNode[]>> = {}\n\n for (const node of nodes) {\n if (node.type === \"script\") {\n // We always render all scripts, because the scripts for passkeys are part of the webauthn group,\n // which leads to this hook returning a webauthn group on passkey flows (which it should not - webauthn is the \"legacy\" passkey implementation).\n continue\n }\n const groupNodes = groups[node.group] ?? []\n groupNodes.push(node)\n groups[node.group] = groupNodes\n }\n\n return groups\n }, [nodes])\n\n const entries = useMemo(\n () =>\n (\n Object.entries(groups) as Entries<Record<UiNodeGroupEnum, UiNode[]>>\n ).sort(([a], [b]) => groupSorter(a, b)),\n [groups, groupSorter],\n )\n\n return {\n groups,\n entries,\n }\n}\n\n/**\n * Find a node\n * @param nodes - The list of nodes to search\n * @param opt - The matching options\n * @returns The first matching node\n */\nexport const findNode = <T extends UiNodeAttributes[\"node_type\"]>(\n nodes: UiNode[],\n opt: {\n node_type: T\n group: UiNodeGroupEnum | RegExp\n name?: string | RegExp\n },\n) =>\n nodes.find((n) => {\n return (\n n.attributes.node_type === opt.node_type &&\n (opt.group instanceof RegExp\n ? n.group.match(opt.group)\n : n.group === opt.group) &&\n (opt.name && n.attributes.node_type === \"input\"\n ? opt.name instanceof RegExp\n ? n.attributes.name.match(opt.name)\n : n.attributes.name === opt.name\n : !opt.name)\n )\n }) as\n | (UiNode & { attributes: UiNodeAttributes & { node_type: T } })\n | undefined\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n isUiNodeInputAttributes,\n UiNode,\n UiNodeGroupEnum,\n} from \"@ory/client-fetch\"\nimport { PropsWithChildren, createContext, useContext } from \"react\"\nimport { OryFlowComponents } from \"../components\"\n\ntype ComponentContextValue = {\n components: OryFlowComponents\n nodeSorter: (a: UiNode, b: UiNode, ctx: { flowType: string }) => number\n groupSorter: (a: UiNodeGroupEnum, b: UiNodeGroupEnum) => number\n}\n\nconst ComponentContext = createContext<ComponentContextValue>({\n components: null!, // fine because we throw an error if it's not provided\n nodeSorter: () => 0,\n groupSorter: () => 0,\n})\n\nexport function useComponents() {\n const ctx = useContext(ComponentContext)\n if (!ctx) {\n throw new Error(\"useComponents must be used within a ComponentProvider\")\n }\n return ctx.components\n}\n\nexport function useNodeSorter() {\n const ctx = useContext(ComponentContext)\n if (!ctx) {\n throw new Error(\"useNodeSorter must be used within a ComponentProvider\")\n }\n return ctx.nodeSorter\n}\n\nexport function useGroupSorter() {\n const ctx = useContext(ComponentContext)\n if (!ctx) {\n throw new Error(\"useGroupSorter must be used within a ComponentProvider\")\n }\n return ctx.groupSorter\n}\n\nconst defaultNodeOrder = [\n \"oidc\",\n \"identifier_first\",\n \"default\",\n \"profile\",\n \"password\",\n // CAPTCHA is below password because otherwise the password input field\n // would be above the captcha. Somehow, we sort the password sign up button somewhere else to be always at the bottom.\n \"captcha\",\n \"passkey\",\n \"code\",\n \"webauthn\",\n]\n\nfunction defaultNodeSorter(\n a: UiNode,\n b: UiNode,\n // ctx: { flowType: string },\n): number {\n const aGroupWeight = defaultNodeOrder.indexOf(a.group) ?? 999\n const bGroupWeight = defaultNodeOrder.indexOf(b.group) ?? 999\n\n if (\n b.group === \"captcha\" &&\n isUiNodeInputAttributes(a.attributes) &&\n a.attributes.type === \"submit\"\n ) {\n // If the current node is a submit button and the next node is CAPTCHA; we sort the captcha before the submit button.\n return aGroupWeight - (bGroupWeight - 2)\n } else if (\n a.group === \"captcha\" &&\n isUiNodeInputAttributes(b.attributes) &&\n b.attributes.type === \"submit\"\n ) {\n // If one node is a submit button and the other is CAPTCHA, we sort the captcha before the submit button.\n return aGroupWeight - 2 - bGroupWeight\n }\n\n return aGroupWeight - bGroupWeight\n}\n\nconst defaultGroupOrder: UiNodeGroupEnum[] = [\n UiNodeGroupEnum.Default,\n UiNodeGroupEnum.Profile,\n UiNodeGroupEnum.Password,\n UiNodeGroupEnum.Oidc,\n UiNodeGroupEnum.Code,\n UiNodeGroupEnum.LookupSecret,\n UiNodeGroupEnum.Passkey,\n UiNodeGroupEnum.Webauthn,\n UiNodeGroupEnum.Totp,\n]\n\nfunction defaultGroupSorter(a: UiNodeGroupEnum, b: UiNodeGroupEnum): number {\n const aGroupWeight = defaultGroupOrder.indexOf(a) ?? 999\n const bGroupWeight = defaultGroupOrder.indexOf(b) ?? 999\n\n return aGroupWeight - bGroupWeight\n}\n\ntype ComponentProviderProps = {\n components: OryFlowComponents\n nodeSorter?: (a: UiNode, b: UiNode, ctx: { flowType: string }) => number\n groupSorter?: (a: UiNodeGroupEnum, b: UiNodeGroupEnum) => number\n}\n\nexport function OryComponentProvider({\n children,\n components,\n nodeSorter = defaultNodeSorter,\n groupSorter = defaultGroupSorter,\n}: PropsWithChildren<ComponentProviderProps>) {\n return (\n <ComponentContext.Provider\n value={{\n components,\n nodeSorter,\n groupSorter,\n }}\n >\n {children}\n </ComponentContext.Provider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useComponents, useOryFlow } from \"@ory/elements-react\"\nimport { useCardHeaderText } from \"../../utils/constructCardHeader\"\nimport { DefaultCurrentIdentifierButton } from \"./current-identifier-button\"\n\nfunction InnerCardHeader({ title, text }: { title: string; text?: string }) {\n const { Card } = useComponents()\n return (\n <header className=\"flex flex-col gap-8 antialiased\">\n <Card.Logo />\n <div className=\"flex flex-col gap-2\">\n <h2 className=\"text-lg font-semibold leading-normal text-interface-foreground-default-primary\">\n {title}\n </h2>\n <p className=\"leading-normal text-interface-foreground-default-secondary\">\n {text}\n </p>\n <DefaultCurrentIdentifierButton />\n </div>\n </header>\n )\n}\n\nexport function DefaultCardHeader() {\n const context = useOryFlow()\n const { title, description } = useCardHeaderText(context.flow.ui, context)\n\n return <InnerCardHeader title={title} text={description} />\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n AuthenticatorAssuranceLevel,\n FlowType,\n isUiNodeInputAttributes,\n UiContainer,\n} from \"@ory/client-fetch\"\nimport { useIntl } from \"react-intl\"\nimport { FormState } from \"../../../context\"\n\nfunction joinWithCommaOr(list: string[], orText = \"or\"): string {\n if (list.length === 0) {\n return \".\"\n } else if (list.length === 1) {\n return list[0]\n } else {\n const last = list.pop()\n return `${list.join(\", \")} ${orText} ${last}`\n }\n}\n\ntype opts =\n | {\n flowType: FlowType.Login\n flow: {\n refresh?: boolean\n requested_aal?: AuthenticatorAssuranceLevel\n }\n formState?: FormState\n }\n | {\n flowType:\n | FlowType.Error\n | FlowType.Registration\n | FlowType.Verification\n | FlowType.Recovery\n | FlowType.Settings\n }\n\n/**\n * Constructs a title and a description for the card header.\n *\n * The title is a title suitable for the current flow, e.g. \"Sign in\" or \"Update your account\".\n *\n * The description for a login & registration flow, is a collection of the labels of the input fields.\n * For example, if the user has a password and an email address, the description will be \"Sign in with your email and password\".\n * And for registration, the listed options depend on the project configuration.\n *\n * For verification, recovery and settings flows, the description is a generic one, e.g. \"Enter the email address associated with your account to verify it\".\n *\n *\n * @param nodes - the UI nodes of the current flow\n * @param opts - can be a flow object, only needed for the refresh login flow\n * @returns a title and a description for the card header\n */\nexport function useCardHeaderText(\n container: UiContainer,\n opts: opts,\n): { title: string; description: string } {\n const nodes = container.nodes\n const intl = useIntl()\n switch (opts.flowType) {\n case FlowType.Recovery:\n if (\n nodes.find(\n (node) =>\n \"name\" in node.attributes && node.attributes.name === \"code\",\n )\n ) {\n return {\n title: intl.formatMessage({\n id: \"recovery.title\",\n }),\n description: intl.formatMessage({\n id: \"identities.messages.1060003\",\n }),\n }\n }\n return {\n title: intl.formatMessage({\n id: \"recovery.title\",\n }),\n description: intl.formatMessage({\n id: \"recovery.subtitle\",\n }),\n }\n case FlowType.Settings:\n return {\n title: intl.formatMessage({\n id: \"settings.title\",\n }),\n description: intl.formatMessage({\n id: \"settings.subtitle\",\n }),\n }\n case FlowType.Verification:\n if (\n nodes.find(\n (node) =>\n \"name\" in node.attributes && node.attributes.name === \"code\",\n )\n ) {\n return {\n title: intl.formatMessage({\n id: \"verification.title\",\n }),\n description: intl.formatMessage({\n id: \"identities.messages.1080003\",\n }),\n }\n }\n return {\n title: intl.formatMessage({\n id: \"verification.title\",\n }),\n description: intl.formatMessage({\n id: \"verification.subtitle\",\n }),\n }\n case FlowType.Login: {\n // account linking\n const accountLinkingMessage = container.messages?.find(\n (m) => m.id === 1010016,\n )\n if (accountLinkingMessage) {\n return {\n title: intl.formatMessage({\n id: \"account-linking.title\",\n }),\n description: intl.formatMessage(\n {\n id: \"identities.messages.1010016\",\n },\n accountLinkingMessage.context as Record<string, string>,\n ),\n }\n }\n }\n }\n\n const parts = []\n\n if (nodes.find((node) => node.group === \"password\")) {\n switch (opts.flowType) {\n case FlowType.Registration:\n parts.push(\n intl.formatMessage(\n { id: \"card.header.parts.password.registration\" },\n // TODO: make this generic for other labels\n { identifierLabel: \"email\" },\n ),\n )\n break\n default:\n parts.push(\n intl.formatMessage(\n { id: \"card.header.parts.password.login\" },\n // TODO: make this generic for other labels\n { identifierLabel: \"email\" },\n ),\n )\n }\n }\n\n if (nodes.find((node) => node.group === \"oidc\")) {\n parts.push(\n intl.formatMessage({\n id: \"card.header.parts.oidc\",\n }),\n )\n }\n\n if (nodes.find((node) => node.group === \"code\")) {\n parts.push(intl.formatMessage({ id: \"card.header.parts.code\" }))\n }\n\n if (nodes.find((node) => node.group === \"passkey\")) {\n parts.push(intl.formatMessage({ id: \"card.header.parts.passkey\" }))\n }\n\n if (nodes.find((node) => node.group === \"webauthn\")) {\n parts.push(intl.formatMessage({ id: \"card.header.parts.webauthn\" }))\n }\n\n if (nodes.find((node) => node.group === \"identifier_first\")) {\n const identifier = nodes.find(\n (node) =>\n isUiNodeInputAttributes(node.attributes) &&\n node.attributes.name.startsWith(\"identifier\") &&\n node.attributes.type !== \"hidden\",\n )\n\n if (identifier) {\n parts.push(\n intl.formatMessage(\n {\n id: \"card.header.parts.identifier-first\",\n },\n {\n identifierLabel: identifier.meta.label?.text,\n },\n ),\n )\n }\n }\n\n switch (opts.flowType) {\n case FlowType.Login:\n if (opts.flow.refresh) {\n return {\n title: intl.formatMessage({\n id: \"login.title-refresh\",\n }),\n description: intl.formatMessage(\n {\n id: \"login.subtitle-refresh\",\n },\n {\n parts: joinWithCommaOr(parts),\n },\n ),\n }\n } else if (opts.flow.requested_aal === \"aal2\") {\n return {\n title: intl.formatMessage({\n id: \"login.title-aal2\",\n }),\n description: intl.formatMessage({\n id:\n opts.formState?.current === \"method_active\"\n ? `login.${opts.formState.method}.subtitle`\n : \"login.subtitle-aal2\",\n }),\n }\n }\n return {\n title: intl.formatMessage({\n id: \"login.title\",\n }),\n description:\n parts.length > 0\n ? intl.formatMessage(\n {\n id: \"login.subtitle\",\n },\n {\n parts: joinWithCommaOr(\n parts,\n intl.formatMessage({ id: \"misc.or\" }),\n ),\n },\n )\n : \"\",\n }\n case FlowType.Registration:\n return {\n title: intl.formatMessage({\n id: \"registration.title\",\n }),\n description:\n parts.length > 0\n ? intl.formatMessage(\n {\n id: \"registration.subtitle\",\n },\n {\n parts: joinWithCommaOr(\n parts,\n intl.formatMessage({ id: \"misc.or\" }),\n ),\n },\n )\n : \"\",\n }\n }\n\n // TODO: This should not happen, as the switch is exhaustive, but typescript doesn't think so\n return {\n title: \"Error\",\n description: \"An error occurred\",\n }\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { FlowType, UiNode } from \"@ory/client-fetch\"\nimport { useOryFlow } from \"@ory/elements-react\"\nimport IconArrowLeft from \"../../assets/icons/arrow-left.svg\"\nimport { omit } from \"../../utils/attributes\"\nimport { restartFlowUrl } from \"../../utils/url\"\n\nexport function DefaultCurrentIdentifierButton() {\n const { flow, flowType, config, formState } = useOryFlow()\n const ui = flow.ui\n\n if (formState.current === \"provide_identifier\") {\n return null\n }\n\n if (flowType === FlowType.Login && flow.requested_aal === \"aal2\") {\n return null\n }\n\n const nodeBackButton = getBackButtonNode(flowType, ui.nodes)\n\n if (\n nodeBackButton?.attributes.node_type !== \"input\" ||\n !nodeBackButton.attributes.value\n ) {\n return null\n }\n\n const initFlowUrl = restartFlowUrl(\n flow,\n `${config.sdk.url}/self-service/${flowType}/browser`,\n )\n\n const attributes = omit(nodeBackButton.attributes, [\n \"autocomplete\",\n \"node_type\",\n \"maxlength\",\n ])\n\n return (\n <a\n className={\n \"group inline-flex max-w-full cursor-pointer items-center gap-1 self-start rounded-identifier border px-[11px] py-[5px] transition-colors \" +\n \"border-button-identifier-border-border-default bg-button-identifier-background-default hover:border-button-identifier-border-border-hover hover:bg-button-identifier-background-hover\"\n }\n {...attributes}\n href={initFlowUrl}\n title={`Adjust ${nodeBackButton?.attributes.value}`}\n data-testid={\"ory/screen/login/action/restart\"}\n >\n <span className=\"inline-flex min-h-5 items-center gap-2 overflow-hidden text-ellipsis\">\n <IconArrowLeft\n size={16}\n stroke=\"1\"\n className=\"shrink-0 text-button-identifier-foreground-default group-hover:text-button-identifier-foreground-hover\"\n />\n <span className=\"overflow-hidden text-ellipsis text-nowrap text-sm font-medium text-button-identifier-foreground-default group-hover:text-button-identifier-foreground-hover\">\n {nodeBackButton?.attributes.value}\n </span>\n </span>\n </a>\n )\n}\n\nexport function getBackButtonNode(\n flowType: FlowType,\n nodes: UiNode[],\n): UiNode | undefined {\n let nodeBackButton: UiNode | undefined\n switch (flowType) {\n case FlowType.Login:\n nodeBackButton = nodes.find(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"identifier\" &&\n [\"default\", \"identifier_first\"].includes(node.group),\n )\n break\n case FlowType.Registration:\n nodeBackButton = guessRegistrationBackButton(nodes)\n break\n case FlowType.Recovery:\n case FlowType.Verification:\n // Re-use the email node for displaying the email\n nodeBackButton = nodes.find(\n (n) => \"name\" in n.attributes && n.attributes.name === \"email\",\n )\n break\n }\n return nodeBackButton\n}\n\nconst backButtonCandiates = [\n \"traits.email\",\n \"traits.username\",\n \"traits.phone_number\",\n]\n/**\n * Guesses the back button for registration flows\n *\n * This is based on the list above, and the first node that matches the criteria is returned.\n *\n * The list is most likely not exhaustive yet, and may need to be updated in the future.\n *\n */\nfunction guessRegistrationBackButton(uiNodes: UiNode[]): UiNode | undefined {\n return uiNodes.find(\n (node) =>\n \"name\" in node.attributes &&\n backButtonCandiates.includes(node.attributes.name) &&\n node.group === \"default\",\n )\n}\n","import * as React from \"react\";\nconst SvgArrowLeft = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 25\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><path stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 12.325h14m-14 0 6 6m-6-6 6-6\" /></svg>;\nexport default SvgArrowLeft;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nexport function omit<OBJ extends object>(\n obj: OBJ,\n keys: (keyof OBJ)[],\n): Omit<typeof obj, (typeof keys)[number]> {\n const ret = { ...obj }\n for (const key of keys) {\n delete ret[key]\n }\n return ret\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useOryFlow } from \"@ory/elements-react\"\n\nexport function DefaultCardLogo() {\n const flow = useOryFlow()\n\n if (flow.config.logoUrl) {\n return <img src={flow.config.logoUrl} width={100} height={36} alt=\"Logo\" />\n }\n\n return (\n <h1 className=\"text-xl font-semibold leading-normal text-interface-foreground-default-primary\">\n {flow.config.name}\n </h1>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PropsWithChildren } from \"react\"\n\nexport function DefaultCardLayout({ children }: PropsWithChildren) {\n return (\n <main className=\"p-4 pb-8 flex items-center justify-center flex-col gap-8 min-h-screen\">\n {children}\n </main>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { OryCardProps } from \"@ory/elements-react\"\nimport { Badge } from \"./badge\"\nimport { DefaultCardContent } from \"./content\"\nimport { DefaultCardFooter } from \"./footer\"\nimport { DefaultCardHeader } from \"./header\"\nimport { DefaultCardLogo } from \"./logo\"\nimport { DefaultCurrentIdentifierButton } from \"./current-identifier-button\"\nimport { DefaultCardLayout } from \"./layout\"\n\nexport function DefaultCard({ children }: OryCardProps) {\n return (\n <div className=\"flex flex-1 sm:items-center justify-center font-sans items-start w-full sm:w-[480px] sm:max-w-[480px]\">\n <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\">\n {children}\n <Badge />\n </div>\n </div>\n )\n}\n\nexport {\n DefaultCardContent,\n DefaultCardFooter,\n DefaultCardHeader,\n DefaultCardLogo,\n DefaultCardLayout,\n DefaultCurrentIdentifierButton,\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PropsWithChildren } from \"react\"\nimport { cn } from \"../../utils/cn\"\nimport { useIntl } from \"react-intl\"\nimport {\n messageTestId,\n OryFormRootProps,\n uiTextToFormattedMessage,\n useOryFlow,\n} from \"@ory/elements-react\"\nimport { OryMessageContentProps } from \"@ory/elements-react\"\nimport { FlowType } from \"@ory/client-fetch\"\n\nexport function DefaultFormContainer({\n children,\n onSubmit,\n action,\n method,\n}: PropsWithChildren<OryFormRootProps>) {\n return (\n <form\n onSubmit={onSubmit}\n noValidate\n action={action}\n method={method}\n className={\"grid gap-8\"}\n >\n {children}\n </form>\n )\n}\n\nexport function DefaultMessageContainer({ children }: PropsWithChildren) {\n const { flowType } = useOryFlow()\n if (!children || (Array.isArray(children) && children.length === 0)) {\n return null\n }\n\n return (\n <section\n className={cn(\n flowType === FlowType.Settings ? \"text-center\" : \"text-left\",\n )}\n >\n {children}\n </section>\n )\n}\n\nexport function DefaultMessage({ message }: OryMessageContentProps) {\n const intl = useIntl()\n return (\n <span\n className={cn(\n \"leading-normal\",\n message.type === \"error\" &&\n \"text-interface-foreground-validation-danger\",\n message.type === \"info\" &&\n \"text-interface-foreground-default-secondary\",\n message.type === \"success\" &&\n \"text-interface-foreground-validation-success\",\n )}\n {...messageTestId(message)}\n >\n {uiTextToFormattedMessage(message, intl)}\n </span>\n )\n}\n\nexport { DefaultButtonSocial } from \"./social\"\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n OryFormOidcRootProps,\n OryNodeOidcButtonProps,\n uiTextToFormattedMessage,\n useOryFlow,\n} from \"@ory/elements-react\"\nimport { ElementType, useEffect } from \"react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { useDebounceValue } from \"usehooks-ts\"\nimport defaultLogos from \"../../provider-logos\"\nimport { cn } from \"../../utils/cn\"\nimport { Spinner } from \"./spinner\"\n\nexport function extractProvider(\n context: object | undefined,\n): string | undefined {\n if (\n context &&\n typeof context === \"object\" &&\n \"provider\" in context &&\n typeof context.provider === \"string\"\n ) {\n return context.provider\n }\n return undefined\n}\n\ntype DefaultSocialButtonProps = OryNodeOidcButtonProps & {\n showLabel?: boolean\n logos?: Record<string, ElementType>\n}\n\nexport function DefaultButtonSocial({\n attributes,\n node,\n onClick,\n showLabel: _showLabel,\n logos: providedLogos,\n}: DefaultSocialButtonProps) {\n const logos = { ...defaultLogos, ...providedLogos }\n const {\n node_type: _ignoredNodeType,\n type: _ignoredType,\n name: _ignoredName,\n ...props\n } = attributes\n const {\n flow: { ui },\n } = useOryFlow()\n // Safari cancels form submission events, if we do a state update in the same tick\n // so we delay the state update by 100ms\n const [clicked, setClicked] = useDebounceValue(false, 100)\n const intl = useIntl()\n const {\n formState: { isSubmitting },\n } = useFormContext()\n\n const oidcNodeCount =\n ui.nodes.filter((node) => node.group === \"oidc\").length ?? 0\n\n // Ideally, kratos would return the provider name in the context\n // At the moment it only returns the label (misleadingly named `provider`).\n // But changing that would be a breaking change.\n // So we have to extract the provider name from the id, which sometimes might contain a - followed by a unique ID.\n // TODO(kratos): Add provider to the context\n const Logo = logos[(attributes.value as string).split(\"-\")[0]]\n\n const showLabel =\n _showLabel ?? (oidcNodeCount % 3 !== 0 && oidcNodeCount % 4 !== 0)\n\n const provider = extractProvider(node.meta.label?.context) ?? \"\"\n\n const localOnClick = () => {\n onClick?.()\n setClicked(true)\n }\n\n useEffect(() => {\n if (!isSubmitting) {\n setClicked(false)\n }\n }, [isSubmitting, setClicked])\n\n return (\n <button\n 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\"\n value={attributes.value}\n type=\"submit\"\n name=\"provider\"\n data-testid={`ory/form/node/input/${attributes.name}`}\n {...props}\n onClick={localOnClick}\n data-loading={clicked}\n disabled={isSubmitting}\n >\n <span className=\"size-5 relative\">\n {!clicked ? (\n Logo ? (\n <Logo size={20} />\n ) : (\n <span className=\"flex aspect-square items-center justify-center rounded-[999px] border text-xs\">\n {provider.slice(0, 2)}\n </span>\n )\n ) : (\n <Spinner className=\"size-5\" />\n )}\n </span>\n {showLabel && node.meta.label ? (\n <>\n <span className=\"grow text-center font-medium leading-none text-button-social-foreground-default\">\n {uiTextToFormattedMessage(node.meta.label, intl)}\n </span>\n <span className=\"size-5 block\"></span>\n </>\n ) : null}\n </button>\n )\n}\n\n/**\n * Returns a variant of DefaultButtonSocial that can use your own logos\n *\n * @param logos - a record of provider names and their respective logos\n * @returns a variant of DefaultButtonSocial that uses the provided logos\n */\nDefaultButtonSocial.WithLogos =\n (logos: Record<string, ElementType>) => (props: DefaultSocialButtonProps) => (\n <DefaultButtonSocial {...props} logos={logos} />\n )\n\nexport function DefaultSocialButtonContainer({\n children,\n nodes,\n}: OryFormOidcRootProps) {\n return (\n <div\n className={cn(\"grid gap-3\", {\n // needed because tailwind is not compiling dynamic classes\n \"grid-cols-1\": nodes.length % 4 <= 2,\n \"grid-cols-3\": nodes.length % 3 === 0,\n \"grid-cols-4\": nodes.length > 1 && nodes.length % 4 === 0,\n })}\n >\n {children}\n </div>\n )\n}\n","import * as React from \"react\";\nconst SvgApple = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgApple;","import * as React from \"react\";\nconst SvgAuth0 = props => <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgAuth0;","import * as React from \"react\";\nconst SvgDiscord = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /><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\" /></svg>;\nexport default SvgDiscord;","import * as React from \"react\";\nconst SvgFacebook = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><circle cx={16} cy={16} r={14} fill=\"url(#facebook_svg__a)\" /><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\" /><defs><linearGradient id=\"facebook_svg__a\" x1={16} x2={16} y1={2} y2={29.917} gradientUnits=\"userSpaceOnUse\"><stop stopColor=\"#18ACFE\" /><stop offset={1} stopColor=\"#0163E0\" /></linearGradient></defs></svg>;\nexport default SvgFacebook;","import * as React from \"react\";\nconst SvgGeneric = props => <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?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><path stroke=\"none\" d=\"M0 0h24v24H0z\" /><path d=\"M2 12a10 10 0 1 0 20 0 10 10 0 1 0-20 0\" /><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\" /></svg>;\nexport default SvgGeneric;","import * as React from \"react\";\nconst SvgGithub = props => <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgGithub;","import * as React from \"react\";\nconst SvgGitlab = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /><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\" /><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\" /><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\" /></svg>;\nexport default SvgGitlab;","import * as React from \"react\";\nconst SvgGoogle = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /><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\" /><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\" /><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\" /></svg>;\nexport default SvgGoogle;","import * as React from \"react\";\nconst SvgLinkedin = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><rect width={28} height={28} x={2} y={2} fill=\"#1275B1\" rx={14} /><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\" /></svg>;\nexport default SvgLinkedin;","import * as React from \"react\";\nconst SvgMicrosoft = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 23 23\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><path fill=\"#F35325\" d=\"M1 1h10v10H1z\" /><path fill=\"#81BC06\" d=\"M12 1h10v10H12z\" /><path fill=\"#05A6F0\" d=\"M1 12h10v10H1z\" /><path fill=\"#FFBA08\" d=\"M12 12h10v10H12z\" /></svg>;\nexport default SvgMicrosoft;","import * as React from \"react\";\nconst SvgSlack = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /><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\" /><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\" /><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\" /></svg>;\nexport default SvgSlack;","import * as React from \"react\";\nconst SvgSpotify = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><circle cx={16} cy={16} r={14} fill=\"#1ED760\" /><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\" /></svg>;\nexport default SvgSpotify;","import * as React from \"react\";\nconst SvgYandex = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><circle cx={16} cy={16} r={14} fill=\"#fff\" /><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\" /></svg>;\nexport default SvgYandex;","import * as React from \"react\";\nconst SvgX = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} fill=\"none\" {...props}><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\" /></svg>;\nexport default SvgX;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport apple from \"./apple.svg\"\nimport auth0 from \"./auth0.svg\"\nimport discord from \"./discord.svg\"\nimport facebook from \"./facebook.svg\"\nimport generic from \"./generic.svg\"\nimport github from \"./github.svg\"\nimport gitlab from \"./gitlab.svg\"\nimport google from \"./google.svg\"\nimport linkedin from \"./linkedin.svg\"\nimport microsoft from \"./microsoft.svg\"\nimport slack from \"./slack.svg\"\nimport spotify from \"./spotify.svg\"\nimport yandex from \"./yandex.svg\"\nimport x from \"./x.svg\"\n\nconst logos: Record<string, typeof apple> = {\n apple,\n auth0,\n discord,\n facebook,\n generic,\n github,\n gitlab,\n google,\n linkedin,\n microsoft,\n slack,\n spotify,\n yandex,\n x,\n}\nexport default logos\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { cn } from \"../../utils/cn\"\n\nexport function Spinner({ className }: { className?: string }) {\n return (\n <svg\n aria-hidden=\"true\"\n role=\"status\"\n className={cn(\n \"absolute pointer-events-none inset-0 m-auto size-8 animate-spin\",\n className,\n )}\n viewBox=\"0 0 34 34\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g clipPath=\"url(#clip0_2572_1748)\">\n <path\n 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\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_2572_1748\">\n <rect\n width=\"24\"\n height=\"24\"\n fill=\"currentColor\"\n transform=\"translate(17 0.029541) rotate(45)\"\n />\n </clipPath>\n </defs>\n </svg>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { OryCardAuthMethodListItemProps } from \"@ory/elements-react\"\nimport { useIntl } from \"react-intl\"\nimport code from \"../../assets/icons/code.svg\"\nimport passkey from \"../../assets/icons/passkey.svg\"\nimport password from \"../../assets/icons/password.svg\"\nimport webauthn from \"../../assets/icons/webauthn.svg\"\nimport hardware_token from \"../../assets/icons/passkey.svg\"\nimport totp from \"../../assets/icons/totp.svg\"\nimport lookup_secret from \"../../assets/icons/code-asterix.svg\"\nimport logos from \"../../provider-logos\"\nimport { isGroupImmediateSubmit } from \"../../utils/form\"\n\nconst iconsMap: Record<string, typeof code> = {\n code,\n passkey,\n password,\n webauthn,\n hardware_token,\n totp,\n lookup_secret,\n ...logos,\n}\n\nexport function DefaultAuthMethodListItem({\n onClick,\n group,\n title,\n}: OryCardAuthMethodListItemProps) {\n const intl = useIntl()\n const Icon = iconsMap[group] || null\n\n return (\n <button\n className=\"flex cursor-pointer gap-3 text-left items-start w-full rounded-buttons p-2 hover:bg-interface-background-default-primary-hover\"\n onClick={onClick}\n type={isGroupImmediateSubmit(group) ? \"submit\" : \"button\"}\n data-testid={`ory/form/auth-picker/${group}`}\n >\n <span className=\"mt-1\">\n {Icon && (\n <Icon size={16} className=\"text-interface-foreground-brand-primary\" />\n )}\n </span>\n <span className=\"flex-1 leading-normal inline-flex flex-col w-full\">\n <span className=\"text-interface-foreground-default-primary truncate mr-6\">\n {intl.formatMessage(\n { id: title?.id ?? `two-step.${group}.title` },\n title?.values,\n )}{\" \"}\n </span>\n <span className=\"text-interface-foreground-default-secondary\">\n {intl.formatMessage({\n id: `two-step.${group}.description`,\n })}\n </span>\n </span>\n </button>\n )\n}\n","import * as React from \"react\";\nconst SvgCode = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 15 13\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgCode;","import * as React from \"react\";\nconst SvgPasskey = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 13 14\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgPasskey;","import * as React from \"react\";\nconst SvgPassword = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 14 4\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgPassword;","import * as React from \"react\";\nconst SvgWebauthn = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 14 14\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgWebauthn;","import * as React from \"react\";\nconst SvgTotp = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgTotp;","import * as React from \"react\";\nconst SvgCodeAsterix = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 25\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgCodeAsterix;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nexport function isGroupImmediateSubmit(group: string) {\n // TODO: Other methods might also benefit from this.\n return group === \"code\"\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getNodeLabel } from \"@ory/client-fetch\"\nimport {\n OryNodeButtonProps,\n uiTextToFormattedMessage,\n} from \"@ory/elements-react\"\nimport { cva, VariantProps } from \"class-variance-authority\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { Spinner } from \"./spinner\"\nimport { useEffect, useState } from \"react\"\n\nconst buttonStyles = cva(\n [\n \"relative flex justify-center gap-3 overflow-hidden rounded-buttons leading-none ring-1 ring-inset font-medium\",\n \"disabled:cursor-not-allowed loading:cursor-wait loading:before:pointer-events-none\",\n \"transition-colors duration-100 ease-linear\",\n \"p-4 max-w-[488px]\",\n ],\n {\n variants: {\n intent: {\n primary: [\n \"bg-button-primary-background-default text-button-primary-foreground-default ring-button-primary-border-default\",\n \"hover:bg-button-primary-background-hover hover:text-button-primary-foreground-hover hover:ring-button-primary-border-hover\",\n \"disabled:bg-button-primary-background-disabled disabled:text-button-primary-foreground-disabled disabled:ring-button-primary-border-disabled\",\n \"loading:bg-button-primary-background-default loading:text-button-primary-foreground-default loading:ring-button-primary-border-default\",\n \"loading:before:absolute loading:before:inset-0 loading:before:bg-button-primary-background-default loading:before:opacity-80 loading:before:content-['']\",\n \"disabled:bg-button-primary-background-disabled disabled:text-button-primary-foreground-disabled disabled:ring-button-primary-border-disabled\",\n ],\n secondary: [\n \"bg-button-secondary-background-default text-button-secondary-foreground-default ring-button-secondary-border-default\",\n \"hover:bg-button-secondary-background-hover hover:text-button-secondary-foreground-hover hover:ring-button-secondary-border-hover\",\n \"disabled:bg-button-secondary-background-disabled disabled:text-button-secondary-foreground-disabled disabled:ring-button-secondary-border-disabled\",\n \"loading:bg-button-secondary-background-default loading:text-button-secondary-foreground-default loading:ring-button-secondary-border-default\",\n \"loading:before:absolute loading:before:inset-0 loading:before:bg-button-secondary-background-default loading:before:opacity-80 loading:before:content-['']\",\n ],\n },\n defaultVariants: {\n intent: \"primary\",\n },\n },\n },\n)\n\nexport type ButtonVariants = VariantProps<typeof buttonStyles>\n\nexport const DefaultButton = ({\n attributes,\n node,\n onClick,\n}: OryNodeButtonProps) => {\n const {\n type,\n name,\n value,\n // Button does not support these attributes, so we skip them\n autocomplete: _ignoredAutocomplete,\n label: _ignoredLabel,\n node_type: _ignoredNodeType,\n maxlength: _ignoredMaxLength,\n // End of skipped attributes\n ...rest\n } = attributes\n const [clicked, setClicked] = useState(false)\n const intl = useIntl()\n const label = getNodeLabel(node)\n const {\n formState: { isSubmitting },\n setValue,\n } = useFormContext()\n\n useEffect(() => {\n if (!isSubmitting) {\n setClicked(false)\n }\n }, [isSubmitting])\n\n const isPrimary =\n attributes.name === \"method\" ||\n attributes.name.includes(\"passkey\") ||\n attributes.name.includes(\"webauthn\") ||\n attributes.name.includes(\"lookup_secret\")\n\n return (\n <button\n {...rest}\n value={value}\n name={name}\n type={type === \"button\" ? \"button\" : \"submit\"} // TODO\n onClick={(e) => {\n onClick?.(e)\n setClicked(true)\n\n if (type !== \"button\") {\n setValue(name, value)\n }\n }}\n className={buttonStyles({\n intent: isPrimary ? \"primary\" : \"secondary\",\n })}\n disabled={rest.disabled ?? isSubmitting}\n data-loading={clicked}\n >\n {clicked ? <Spinner /> : null}\n {label ? <span>{uiTextToFormattedMessage(label, intl)}</span> : \"\"}\n </button>\n )\n}\n\nDefaultButton.displayName = \"DefaultButton\"\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { getNodeLabel } from \"@ory/client-fetch\"\nimport {\n messageTestId,\n OryNodeInputProps,\n uiTextToFormattedMessage,\n} from \"@ory/elements-react\"\nimport { useForm } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { cn } from \"../../utils/cn\"\nimport { CheckboxLabel } from \"../ui/checkbox-label\"\n\nfunction CheckboxSVG() {\n return (\n <svg\n className=\"absolute hidden size-4 peer-checked:block fill-checkbox-foreground-checked\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n 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\"\n />\n </svg>\n )\n}\n\nexport const DefaultCheckbox = ({\n attributes: initialAttributes,\n node,\n}: OryNodeInputProps) => {\n const {\n value,\n name,\n // Button does not support these attributes, so we skip them\n autocomplete: _autocomplete,\n onclick: _onclick,\n maxlength: _max,\n // End of skipped attributes\n ...attributes\n } = initialAttributes\n\n const intl = useIntl()\n const label = getNodeLabel(node)\n const { register } = useForm()\n const hasError = node.messages.some((m) => m.type === \"error\")\n\n return (\n <label className=\"flex items-start gap-3 self-stretch antialiased\">\n <span className=\"flex h-5 items-center\">\n <input\n {...attributes}\n value={1}\n defaultChecked={Boolean(value)}\n type=\"checkbox\"\n className={cn(\n \"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\",\n hasError && \"border-interface-border-validation-danger\",\n )}\n {...register(name, { value })}\n />\n <CheckboxSVG />\n </span>\n <span className=\"flex flex-col\">\n <span className=\"font-normal leading-tight text-interface-foreground-default-primary\">\n <CheckboxLabel label={label} />\n </span>\n {node.messages.map((message) => (\n <span\n key={message.id}\n className={cn(\n \"mt-1\",\n message.type === \"error\"\n ? \"text-interface-foreground-validation-danger\"\n : \"text-interface-foreground-default-secondary\",\n )}\n {...messageTestId(message)}\n >\n {uiTextToFormattedMessage(message, intl)}\n </span>\n ))}\n </span>\n </label>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiText } from \"@ory/client-fetch\"\nimport { useIntl } from \"react-intl\"\nimport { uiTextToFormattedMessage } from \"../../../../util\"\n\ntype CheckboxLabelProps = {\n label?: UiText\n}\n\nconst linkRegex = /\\[([^\\]]+)\\]\\(([^)]+)\\)/g\n\nexport function computeLabelElements(labelText: string) {\n const elements = []\n let lastIndex = 0\n\n // Use matchAll to find all markdown links\n for (const match of labelText.matchAll(linkRegex)) {\n const linkText = match[1]\n const url = match[2]\n const matchStart = match.index\n if (typeof matchStart === \"undefined\") {\n // Some types seem to be wrong somewhere, eslint complains that matchStart can be undefined, but it can't?\n // So we just skip this match, if it is undefined\n continue\n }\n\n // Push the text before the match\n if (matchStart > lastIndex) {\n elements.push(labelText.slice(lastIndex, matchStart))\n }\n\n // Push the <a> tag for the markdown link\n elements.push(\n <a\n key={matchStart}\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-button-link-brand-brand hover:text-button-link-brand-brand-hover underline\"\n >\n {linkText}\n </a>,\n )\n\n // Update lastIndex to the end of the current match\n lastIndex = matchStart + match[0].length\n }\n\n // Push any remaining text after the last match\n if (lastIndex < labelText.length) {\n elements.push(labelText.slice(lastIndex))\n }\n return elements\n}\n\nexport function CheckboxLabel({ label }: CheckboxLabelProps) {\n const intl = useIntl()\n if (!label) {\n return null\n }\n\n const labelText = uiTextToFormattedMessage(label, intl)\n\n return <>{computeLabelElements(labelText)}</>\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiText } from \"@ory/client-fetch\"\nimport { IntlShape } from \"react-intl\"\n\n/**\n * Converts a UiText to a FormattedMessage.\n * The UiText contains the id of the message and the context.\n * The context is used to inject values into the message from Ory, e.g. a timestamp.\n * For example a UI Node from Ory might look like this:\n *\n * \\{\n * \"type\":\"input\",\n * \"group\":\"default\",\n * \"attributes\": \\{\n * \"name\":\"traits.email\",\n * \"type\":\"email\",\n * \"required\":true,\n * \"autocomplete\":\"email\",\n * \"disabled\":false,\n * \"node_type\":\"input\"\n * \\},\n * \"messages\":[],\n * \"meta\": \\{\n * \"label\": \\{\n * \"id\":1070002,\n * \"text\":\"E-Mail\",\n * \"type\":\"info\",\n * \"context\":\\{\n * \"title\":\"E-Mail\"\n * \\},\n * \\}\n * \\}\n * \\}\n *\n * The context has the key \"title\" which matches the formatter template name \"\\{title\\}\"\n * An example translation file would look like this:\n * \\{\n * \"identities.messages.1070002\": \"\\{title\\}\"\n * \\}\n *\n * The formatter would then take the meta.label.id and look for the translation with the key matching the id.\n * It would then replace the template \"\\{title\\}\" with the value from the context with the key \"title\".\n *\n * @param uiText - The UiText is part of the UiNode object sent by Kratos when performing a flow.\n * @param intl - The intl object from react-intl\n */\nexport const uiTextToFormattedMessage = (\n { id, context = {}, text }: Omit<UiText, \"type\">,\n intl: IntlShape,\n) => {\n const contextInjectedMessage = Object.entries(context).reduce(\n (accumulator, [key, value]) => {\n // context might provide an array of objects instead of a single object\n // for example when looking up a recovery code\n if (Array.isArray(value)) {\n return {\n ...accumulator,\n [key]: value,\n [key + \"_list\"]: intl.formatList<string>(value),\n }\n } else if (key.endsWith(\"_unix\")) {\n if (typeof value === \"number\") {\n return {\n ...accumulator,\n [key]: intl.formatDate(new Date(value * 1000)),\n [key + \"_since\"]: intl.formatDateTimeRange(\n new Date(value),\n new Date(),\n ),\n [key + \"_since_minutes\"]: Math.ceil(\n (value - new Date().getTime() / 1000) / 60,\n ).toFixed(0),\n [key + \"_until\"]: intl.formatDateTimeRange(\n new Date(),\n new Date(value),\n ),\n [key + \"_until_minutes\"]: Math.ceil(\n (new Date().getTime() / 1000 - value) / 60,\n ).toFixed(0),\n }\n }\n } else if (key === \"property\") {\n return {\n ...accumulator,\n [key]: intl.formatMessage({\n id: `property.${value}`,\n defaultMessage: value,\n }),\n }\n }\n return {\n ...accumulator,\n [key]: value as string | number,\n }\n },\n {},\n )\n\n return intl.formatMessage(\n {\n id: `identities.messages.${id}`,\n defaultMessage: text,\n },\n contextInjectedMessage,\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { OryFormGroupProps } from \"@ory/elements-react\"\n\nexport function DefaultGroupContainer({ children }: OryFormGroupProps) {\n return <div className=\"grid grid-cols-1 gap-8\">{children}</div>\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nexport function DefaultHorizontalDivider() {\n return <hr className=\"border-interface-border-default-primary\" />\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { OryNodeImageProps } from \"@ory/elements-react\"\n\nexport function DefaultImage({ attributes }: OryNodeImageProps) {\n return (\n <figure>\n <img {...attributes} />\n </figure>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { FlowType, getNodeLabel } from \"@ory/client-fetch\"\nimport {\n OryNodeInputProps,\n uiTextToFormattedMessage,\n useOryFlow,\n} from \"@ory/elements-react\"\nimport { useRef, useState } from \"react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport EyeOff from \"../../assets/icons/eye-off.svg\"\nimport Eye from \"../../assets/icons/eye.svg\"\nimport { cn } from \"../../utils/cn\"\n\nexport const DefaultInput = ({\n node,\n attributes,\n onClick,\n}: OryNodeInputProps) => {\n const label = getNodeLabel(node)\n const { register } = useFormContext()\n const {\n value,\n autocomplete,\n name,\n maxlength,\n node_type: _,\n ...rest\n } = attributes\n const intl = useIntl()\n const { flowType } = useOryFlow()\n const inputRef = useRef<HTMLInputElement | null>(null)\n\n const formattedLabel = label\n ? intl.formatMessage(\n {\n id: \"input.placeholder\",\n defaultMessage: \"Enter your {placeholder}\",\n },\n {\n placeholder: uiTextToFormattedMessage(label, intl),\n },\n )\n : \"\"\n\n if (rest.type === \"hidden\") {\n return (\n <input\n {...rest}\n onClick={onClick}\n maxLength={maxlength}\n autoComplete={autocomplete}\n placeholder={formattedLabel}\n data-testid={`ory/form/node/input/${name}`}\n {...register(name, { value })}\n />\n )\n }\n\n const { ref, ...restRegister } = register(name, { value })\n\n return (\n <div\n className={cn(\n \"relative flex justify-stretch\",\n // The settings flow input fields are supposed to be dense, so we don't need the extra padding we want on the user flows.\n flowType === FlowType.Settings && \"max-w-[488px]\",\n )}\n >\n <input\n {...rest}\n onClick={onClick}\n maxLength={maxlength}\n autoComplete={autocomplete}\n placeholder={formattedLabel}\n data-testid={`ory/form/node/input/${name}`}\n className={cn(\n \"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\",\n \"bg-input-background-default border-input-border-default text-input-foreground-primary\",\n \"disabled:bg-input-background-disabled disabled:border-input-border-disabled disabled:text-input-foreground-disabled\",\n \"focus:border-input-border-focus focus-visible:border-input-border-focus\",\n \"hover:bg-input-background-hover hover:border-input-border-hover\",\n \"px-4 py-[13px]\",\n )}\n ref={(e) => {\n inputRef.current = e\n ref(e)\n }}\n {...restRegister}\n />\n {rest.type === \"password\" && <PasswordToggle inputRef={inputRef} />}\n </div>\n )\n}\n\nfunction PasswordToggle({\n inputRef,\n}: {\n inputRef: React.RefObject<HTMLInputElement>\n}) {\n const [shown, setShown] = useState(false)\n\n const handleClick = () => {\n setShown(!shown)\n if (inputRef.current) {\n inputRef.current.type = shown ? \"password\" : \"text\"\n }\n }\n\n return (\n <button\n onClick={handleClick}\n className=\"absolute right-0 h-full w-12 flex items-center justify-center\"\n type=\"button\"\n >\n {shown ? <EyeOff /> : <Eye />}\n </button>\n )\n}\n","import * as React from \"react\";\nconst SvgEyeOff = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgEyeOff;","import * as React from \"react\";\nconst SvgEye = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><g strokeLinecap=\"round\" strokeLinejoin=\"round\"><path stroke=\"currentColor\" d=\"M10 12a2 2 0 1 0 4 0 2 2 0 0 0-4 0\" /><path stroke=\"#64748B\" d=\"M21 12q-3.6 6-9 6t-9-6q3.6-6 9-6t9 6\" /></g></svg>;\nexport default SvgEye;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowType,\n getNodeLabel,\n instanceOfUiText,\n UiNode,\n} from \"@ory/client-fetch\"\nimport {\n OryNodeLabelProps,\n messageTestId,\n uiTextToFormattedMessage,\n useComponents,\n useOryFlow,\n} from \"@ory/elements-react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { initFlowUrl } from \"../../utils/url\"\n\nfunction findResendNode(nodes: UiNode[]) {\n return nodes.find(\n (n) =>\n \"name\" in n.attributes &&\n ((n.attributes.name === \"email\" && n.attributes.type === \"submit\") ||\n n.attributes.name === \"resend\"),\n )\n}\n\nexport function DefaultLabel({\n node,\n children,\n attributes,\n ...rest\n}: OryNodeLabelProps) {\n const intl = useIntl()\n const label = getNodeLabel(node)\n const { Message } = useComponents()\n const { config, flowType, flow } = useOryFlow()\n const { setValue, formState } = useFormContext()\n\n const isPassword = attributes.type === \"password\"\n\n const resendNode = findResendNode(flow.ui.nodes)\n\n const handleResend = () => {\n if (resendNode?.attributes && \"name\" in resendNode.attributes) {\n setValue(resendNode.attributes.name, resendNode.attributes.value)\n }\n }\n\n const fieldError = formState.errors[attributes.name]\n return (\n <div className=\"flex flex-col gap-1 antialiased\">\n {label && (\n <span className=\"inline-flex justify-between\">\n <label\n {...messageTestId(label)}\n className=\"leading-normal text-input-foreground-primary\"\n htmlFor={attributes.name}\n data-testid={`ory/form/node/input/label/${attributes.name}`}\n {...rest}\n >\n {uiTextToFormattedMessage(label, intl)}\n </label>\n {isPassword &&\n config.project.recovery_enabled &&\n flowType === FlowType.Login && (\n // TODO: make it possible to override with a custom component\n <a\n href={initFlowUrl(config.sdk.url, \"recovery\", flow)}\n className=\"text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline\"\n >\n {intl.formatMessage({\n id: \"forms.label.forgot-password\",\n defaultMessage: \"Forgot password?\",\n })}\n </a>\n )}\n {resendNode?.attributes.node_type === \"input\" && (\n <button\n type=\"submit\"\n name={resendNode.attributes.name}\n value={resendNode.attributes.value}\n onClick={handleResend}\n className=\"cursor-pointer text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline\"\n >\n {intl.formatMessage({ id: \"identities.messages.1070008\" })}\n </button>\n )}\n </span>\n )}\n {children}\n {node.messages.map((message) => (\n <Message.Content key={message.id} message={message} />\n ))}\n {fieldError && instanceOfUiText(fieldError) && (\n <Message.Content message={fieldError} />\n )}\n </div>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getNodeLabel } from \"@ory/client-fetch\"\nimport {\n OryNodeAnchorProps,\n uiTextToFormattedMessage,\n} from \"@ory/elements-react\"\nimport { forwardRef } from \"react\"\nimport { useIntl } from \"react-intl\"\nimport { cn } from \"../../utils/cn\"\n\nexport const DefaultLinkButton = forwardRef<\n HTMLAnchorElement,\n OryNodeAnchorProps\n>(({ attributes, node }, ref) => {\n const intl = useIntl()\n const label = getNodeLabel(node)\n return (\n <a\n {...attributes}\n ref={ref}\n title={label ? uiTextToFormattedMessage(label, intl) : \"\"}\n data-testid={`ory/form/node/link/${attributes.id}`}\n className={cn(\n \"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\",\n )}\n >\n {label ? uiTextToFormattedMessage(label, intl) : \"\"}\n </a>\n )\n})\n\nDefaultLinkButton.displayName = \"DefaultLinkButton\"\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { useFormContext } from \"react-hook-form\"\nimport { InputOTP, InputOTPGroup, InputOTPSlot } from \"./shadcn/otp-input\"\nimport { OryNodeInputProps, useOryFlow } from \"@ory/elements-react\"\nimport { FlowType } from \"@ory/client-fetch\"\nimport { cn } from \"../../utils/cn\"\n\nexport const DefaultPinCodeInput = ({ attributes }: OryNodeInputProps) => {\n const { setValue, watch } = useFormContext()\n const { maxlength, name } = attributes\n const elements = maxlength ?? 6\n const { flowType } = useOryFlow()\n\n const handleInputChange = (v: string) => {\n setValue(name, v)\n }\n\n const value = watch(name) as string\n\n return (\n <InputOTP\n maxLength={maxlength ?? 6}\n onChange={handleInputChange}\n name={name}\n value={value}\n >\n <InputOTPGroup\n className={cn(\n \"w-full flex gap-2 justify-stretch\",\n // The settings flow input fields are supposed to be dense, so we don't need the extra padding we want on the user flows.\n flowType === FlowType.Settings && \"max-w-[488px]\",\n )}\n >\n {[...Array(elements)].map((_, index) => (\n <InputOTPSlot index={index} key={index} />\n ))}\n </InputOTPGroup>\n </InputOTP>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { cn } from \"../../../utils/cn\"\nimport { OTPInput, OTPInputContext } from \"input-otp\"\nimport * as React from \"react\"\n\n// This file is a copy from https://ui.shadcn.com/docs/components/input-otp\n\nconst InputOTP = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"flex items-center gap-2 has-[:disabled]:opacity-50\",\n containerClassName,\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n))\nInputOTP.displayName = \"InputOTP\"\n\nconst InputOTPGroup = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center\", className)} {...props} />\n))\nInputOTPGroup.displayName = \"InputOTPGroup\"\n\nconst InputOTPSlot = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\"> & { index: number }\n>(({ index, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]\n\n return (\n <div\n ref={ref}\n className={cn(\n \"rounded-forms border border-solid bg-input-background-default py-[15px] text-center focus-visible:outline-none w-full\",\n \"relative flex items-center justify-center transition-all leading-none\",\n isActive ? \"border-input-border-focus\" : \"border-input-border-default\",\n className,\n )}\n {...props}\n >\n <span className=\"inline-block size-4\">{char}</span>\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"h-4 w-px animate-caret-blink bg-interface-background-brand-primary duration-700\" />\n </div>\n )}\n </div>\n )\n})\nInputOTPSlot.displayName = \"InputOTPSlot\"\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot }\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n OryFormSectionContentProps,\n OryFormSectionFooterProps,\n OryFormSectionProps,\n} from \"@ory/elements-react\"\nimport { cn } from \"../../utils/cn\"\n\nconst DefaultFormSection = ({\n children,\n nodes: _nodes,\n ...rest\n}: OryFormSectionProps) => {\n return (\n <form\n className=\"flex w-full max-w-screen-sm flex-col md:max-w-[712px] lg:max-w-[802px] xl:max-w-[896px] px-4\"\n {...rest}\n >\n {children}\n </form>\n )\n}\n\nconst DefaultFormSectionContent = ({\n title,\n description,\n children,\n}: OryFormSectionContentProps) => {\n return (\n <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\">\n <div className=\"flex flex-col gap-2\">\n <h3 className=\"font-medium text-interface-foreground-default-primary\">\n {title}\n </h3>\n <span className=\"text-interface-foreground-default-secondary\">\n {description}\n </span>\n </div>\n {children}\n </div>\n )\n}\n\nconst DefaultFormSectionFooter = ({\n children,\n text,\n}: OryFormSectionFooterProps) => {\n return (\n <div\n className={cn(\n \"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\",\n )}\n >\n <span>{text}</span>\n {children}\n </div>\n )\n}\n\nexport {\n DefaultFormSection,\n DefaultFormSectionContent,\n DefaultFormSectionFooter,\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiText } from \"@ory/client-fetch\"\nimport { OryNodeTextProps, uiTextToFormattedMessage } from \"@ory/elements-react\"\nimport { useIntl } from \"react-intl\"\n\nexport function DefaultText({ node, attributes }: OryNodeTextProps) {\n const intl = useIntl()\n\n // There is a special case where this node is the lookup secrets code node. In that case we need special formatting:\n const lookup = (\n attributes.text.context as {\n secrets: UiText[]\n }\n )?.secrets\n\n if (lookup) {\n return (\n <>\n <p data-testid={`ory/form/node/text/${attributes.id}/label`}>\n {node.meta.label\n ? uiTextToFormattedMessage(node.meta.label, intl)\n : \"\"}\n </p>\n {lookup.map((text: UiText, index) => (\n <pre\n data-testid={`ory/form/node/text/lookup_secret_codes/text`}\n key={index}\n >\n <code>{text ? uiTextToFormattedMessage(text, intl) : \"\"}</code>\n </pre>\n ))}\n </>\n )\n }\n\n return (\n <>\n <p\n data-testid={`ory/form/node/text/${attributes.id}/label`}\n id={attributes.id}\n >\n {node.meta.label ? (\n <label>{uiTextToFormattedMessage(node.meta.label, intl)}</label>\n ) : null}\n {attributes.text ? uiTextToFormattedMessage(attributes.text, intl) : \"\"}\n </p>\n </>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { OryPageHeaderProps, useComponents } from \"@ory/elements-react\"\nimport { UserMenu } from \"../ui/user-menu\"\nimport { useSession } from \"@ory/elements-react/client\"\n\nexport const DefaultPageHeader = (_props: OryPageHeaderProps) => {\n const { Card } = useComponents()\n const { session } = useSession()\n\n return (\n <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\">\n <div className=\"flex flex-col gap-12\">\n <div className=\"flex max-h-10 flex-1 justify-between gap-2\">\n <div className=\"relative h-10 flex-1\">\n <Card.Logo />\n </div>\n <UserMenu session={session} />\n </div>\n </div>\n </div>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { LogoutFlow, Session } from \"@ory/client-fetch\"\nimport { DropdownMenuLabel } from \"@radix-ui/react-dropdown-menu\"\nimport { useCallback, useEffect, useState } from \"react\"\nimport { useOryFlow } from \"@ory/elements-react\"\nimport { frontendClient } from \"../../../../util/client\"\nimport IconLogout from \"../../assets/icons/logout.svg\"\nimport IconSettings from \"../../assets/icons/settings.svg\"\nimport { getUserInitials } from \"../../utils/user\"\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"./dropdown-menu\"\nimport { UserAvatar } from \"./user-avater\"\n\ntype UserMenuProps = {\n session: Session | null\n logoutFlow?: LogoutFlow\n}\n\nexport const UserMenu = ({ session }: UserMenuProps) => {\n const { config } = useOryFlow()\n const initials = getUserInitials(session)\n const [logoutFlow, setLogoutFlow] = useState<LogoutFlow | undefined>()\n\n const fetchLogoutFlow = useCallback(async () => {\n const flow = await frontendClient(config.sdk.url).createBrowserLogoutFlow()\n setLogoutFlow(flow)\n }, [config.sdk.url])\n\n useEffect(() => {\n void fetchLogoutFlow()\n }, [fetchLogoutFlow])\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <UserAvatar initials={initials} />\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuLabel className=\"flex gap-3 px-5 py-4.5\">\n <UserAvatar disabled initials={initials} />\n <div className=\"flex flex-col justify-center text-sm leading-tight\">\n <div className=\"text-interface-foreground-default-primary leading-tight font-medium\">\n {initials.primary}\n </div>\n {initials.secondary && (\n <div className=\"text-interface-foreground-default-tertiary leading-tight\">\n {initials.secondary}\n </div>\n )}\n </div>\n </DropdownMenuLabel>\n <DropdownMenuItem asChild>\n <a href=\"/settings\">\n <IconSettings size={16} /> User settings\n </a>\n </DropdownMenuItem>\n <DropdownMenuItem asChild disabled={!logoutFlow?.logout_url}>\n <a href={logoutFlow?.logout_url}>\n <IconLogout size={16} /> Logout\n </a>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n Configuration,\n ConfigurationParameters,\n FrontendApi,\n} from \"@ory/client-fetch\"\n\nexport function frontendClient(\n sdkUrl: string,\n opts: Partial<ConfigurationParameters> = {},\n) {\n const config = new Configuration({\n ...opts,\n basePath: sdkUrl,\n headers: {\n Accept: \"application/json\",\n ...opts.headers,\n },\n })\n return new FrontendApi(config)\n}\n","import * as React from \"react\";\nconst SvgLogout = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 16 16\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgLogout;","import * as React from \"react\";\nconst SvgSettings = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 16 16\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><g stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><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\" /><path d=\"M6 8a2 2 0 1 0 4 0 2 2 0 0 0-4 0\" /></g></svg>;\nexport default SvgSettings;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Session } from \"@ory/client-fetch\"\n\nexport type UserInitials = {\n primary: string\n secondary?: string\n avatar?: string\n}\n\nfunction isTraitsIndexable(\n traits: unknown,\n): traits is Record<string, string | Record<string, string>> {\n return typeof traits === \"object\" && traits !== null\n}\n\nexport const getUserInitials = (session: Session | null): UserInitials => {\n const avatar = \"\"\n let primary = \"\"\n let secondary = \"\"\n\n if (\n !session?.identity?.traits ||\n !isTraitsIndexable(session.identity.traits)\n ) {\n return {\n primary,\n secondary,\n avatar,\n }\n }\n\n const traits = session.identity?.traits\n\n if (traits.email && typeof traits.email === \"string\") {\n secondary = traits.email\n }\n\n if (traits.name) {\n if (typeof traits.name === \"string\") {\n primary = traits.name\n }\n\n if (\n typeof traits.name === \"object\" &&\n traits.name &&\n traits.name.first &&\n traits.name.last\n ) {\n primary = traits.name.first + \" \" + traits.name.last\n }\n }\n\n if (primary === \"\") {\n primary = secondary\n secondary = \"\"\n }\n\n return {\n primary,\n secondary,\n avatar,\n }\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\n\nimport { ComponentPropsWithoutRef, ElementRef, forwardRef } from \"react\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport { cn } from \"../../utils/cn\"\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\n\nconst DropdownMenuContent = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.Content>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 16, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n align=\"end\"\n className={cn(\n \"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\",\n \"border border-interface-border-default-primary bg-interface-background-default-primary rounded-cards\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownMenuItem = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.Item>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-pointer select-none items-center outline-none transition-colors data-[disabled]:pointer-events-none\",\n \"px-8 py-3 lg:py-4.5 text-sm gap-6\",\n \"first:border-0 border-t border-button-secondary-border-default hover:border-button-social-border-hover\",\n \"text-button-secondary-foreground-default bg-button-secondary-background-default\",\n \"hover:text-button-secondary-foreground-hover hover:bg-button-secondary-background-hover\",\n \"data-[disabled]:text-button-secondary-foreground-disabled data-[disabled]:bg-button-secondary-background-disabled\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuLabel = forwardRef<\n ElementRef<typeof DropdownMenuPrimitive.Label>,\n ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"px-2 py-1.5 text-sm font-semibold\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ComponentPropsWithoutRef, forwardRef } from \"react\"\nimport { UserInitials } from \"../../utils/user\"\nimport IconUser from \"../../assets/icons/user.svg\"\n\ntype UserAvatarProps = {\n initials: UserInitials\n} & ComponentPropsWithoutRef<\"button\">\n\nexport const UserAvatar = forwardRef<HTMLButtonElement, UserAvatarProps>(\n ({ initials, ...rest }, ref) => {\n return (\n <button\n ref={ref}\n className=\"relative flex size-10 items-center justify-center overflow-hidden rounded-[999px] bg-button-primary-background-default hover:bg-button-primary-background-hover\"\n {...rest}\n >\n <div className=\"relative flex size-full items-center justify-center\">\n {initials.avatar ? (\n <img\n src={initials.avatar}\n alt={initials.primary}\n className=\"w-full object-contain\"\n />\n ) : (\n <IconUser\n size={24}\n className=\"text-button-primary-foreground-default\"\n />\n )}\n </div>\n </button>\n )\n },\n)\nUserAvatar.displayName = \"UserAvatar\"\n","import * as React from \"react\";\nconst SvgUser = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgUser;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode, UiNodeInputAttributes } from \"@ory/client-fetch\"\nimport { OrySettingsOidcProps } from \"@ory/elements-react\"\nimport { useEffect } from \"react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useDebounceValue } from \"usehooks-ts\"\nimport Trash from \"../../assets/icons/trash.svg\"\nimport logos from \"../../provider-logos\"\nimport { DefaultHorizontalDivider } from \"../form/horizontal-divider\"\nimport { DefaultButtonSocial, extractProvider } from \"../form/social\"\nimport { Spinner } from \"../form/spinner\"\n\nexport function DefaultSettingsOidc({\n linkButtons,\n unlinkButtons,\n}: OrySettingsOidcProps) {\n const hasLinkButtons = linkButtons.length > 0\n const hasUnlinkButtons = unlinkButtons.length > 0\n\n return (\n <div className=\"flex flex-col gap-8\">\n {hasLinkButtons && (\n <div className=\"grid items-start gap-3 grid-cols-1 sm:grid-cols-2 md:grid-cols-3\">\n {linkButtons.map((button) => {\n const attrs = button.attributes as UiNodeInputAttributes\n\n return (\n <DefaultButtonSocial\n showLabel\n key={attrs.value}\n node={button}\n attributes={attrs}\n onClick={button.onClick}\n />\n )\n })}\n </div>\n )}\n {hasUnlinkButtons && hasLinkButtons ? <DefaultHorizontalDivider /> : null}\n {unlinkButtons.map((button) => {\n if (button.attributes.node_type !== \"input\") {\n return null\n }\n return <UnlinkRow key={button.attributes.value} button={button} />\n })}\n </div>\n )\n}\n\ntype UnlinkRowProps = {\n button: UiNode & { onClick: () => void }\n}\n\nfunction UnlinkRow({ button }: UnlinkRowProps) {\n // Safari cancels form submission events, if we do a state update in the same tick\n // so we delay the state update by 100ms\n const [clicked, setClicked] = useDebounceValue(false, 100)\n const {\n formState: { isSubmitting },\n } = useFormContext()\n const attrs = button.attributes as UiNodeInputAttributes\n const provider = extractProvider(button.meta.label?.context) ?? \"\"\n const Logo = logos[(attrs.value as string).split(\"-\")[0]]\n\n const localOnClick = () => {\n button.onClick()\n setClicked(true)\n }\n\n useEffect(() => {\n if (!isSubmitting) {\n setClicked(false)\n }\n }, [isSubmitting, setClicked])\n\n return (\n <div key={attrs.value} className=\"flex justify-between\">\n <div className=\"flex items-center gap-6\">\n {Logo ? <Logo size={32} /> : <logos.generic size={32} />}\n <p className=\"text-sm font-medium text-interface-foreground-default-secondary\">\n {provider}\n </p>\n </div>\n <button\n {...attrs}\n type=\"submit\"\n onClick={localOnClick}\n disabled={isSubmitting}\n className=\"relative\"\n title={`Unlink ${provider}`}\n >\n {clicked ? (\n <Spinner className=\"relative\" />\n ) : (\n <Trash\n className=\"text-button-link-default-secondary hover:text-button-link-default-secondary-hover\"\n size={24}\n />\n )}\n </button>\n </div>\n )\n}\n","import * as React from \"react\";\nconst SvgTrash = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgTrash;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNodeInputAttributes } from \"@ory/client-fetch\"\nimport { OrySettingsPasskeyProps, useComponents } from \"@ory/elements-react\"\nimport Passkey from \"../../assets/icons/passkey.svg\"\nimport Trash from \"../../assets/icons/trash.svg\"\nimport { DefaultHorizontalDivider } from \"../form/horizontal-divider\"\nimport { useFormContext } from \"react-hook-form\"\nimport { Spinner } from \"../form/spinner\"\n\nexport function DefaultSettingsPasskey({\n triggerButton,\n removeButtons,\n}: OrySettingsPasskeyProps) {\n const {\n formState: { isSubmitting },\n } = useFormContext()\n const { Node } = useComponents()\n\n const hasRemoveButtons = removeButtons.length > 0\n\n return (\n <div className=\"flex flex-col gap-8\">\n <div className=\"flex max-w-[60%] items-end gap-3\">\n {triggerButton && (\n <Node.Button\n node={triggerButton}\n attributes={triggerButton.attributes as UiNodeInputAttributes}\n onClick={triggerButton.onClick}\n />\n )}\n </div>\n {hasRemoveButtons ? (\n <div className=\"flex flex-col gap-8\">\n <DefaultHorizontalDivider />\n <div className=\"flex flex-col gap-2\">\n {removeButtons.map((node, i) => {\n const context = node.meta.label?.context ?? {}\n const addedAt =\n \"added_at\" in context ? (context.added_at as string) : null\n const displayName =\n \"display_name\" in context\n ? (context.display_name as string)\n : null\n const keyId =\n \"value\" in node.attributes ? node.attributes.value : null\n\n return (\n <div\n className=\"flex justify-between gap-6 md:items-center\"\n key={`passkey-remove-button-${i}`}\n >\n <div className=\"flex gap-2 items-center flex-1 truncate\">\n <Passkey\n size={32}\n className=\"text-interface-foreground-default-primary\"\n />\n <div className=\"flex-1 flex-col md:flex-row md:items-center flex md:justify-between gap-4 truncate\">\n <div className=\"flex-1 flex-col truncate\">\n <p className=\"text-sm font-medium text-interface-foreground-default-secondary truncate\">\n {displayName}\n </p>\n <span className=\"text-sm text-interface-foreground-default-tertiary hidden sm:block truncate\">\n {keyId}\n </span>\n </div>\n {addedAt && (\n <p className=\"text-sm text-interface-foreground-default-tertiary\">\n {new Intl.DateTimeFormat(undefined, {\n dateStyle: \"long\",\n }).format(new Date(addedAt))}\n </p>\n )}\n </div>\n </div>\n <button\n {...(node.attributes as UiNodeInputAttributes)}\n type=\"submit\"\n onClick={node.onClick}\n disabled={isSubmitting}\n className=\"relative\"\n >\n {isSubmitting ? (\n <Spinner className=\"relative\" />\n ) : (\n <Trash\n className=\"text-button-link-default-secondary hover:text-button-link-default-secondary-hover\"\n size={24}\n />\n )}\n </button>\n </div>\n )\n })}\n </div>\n </div>\n ) : null}\n </div>\n )\n}\n","import * as React from \"react\";\nconst SvgDownload = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} fill=\"none\" {...props}><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\" /></svg>;\nexport default SvgDownload;","import * as React from \"react\";\nconst SvgRefresh = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} fill=\"none\" {...props}><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\" /></svg>;\nexport default SvgRefresh;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNodeInputAttributes } from \"@ory/client-fetch\"\nimport { OrySettingsRecoveryCodesProps } from \"@ory/elements-react\"\nimport Download from \"../../assets/icons/download.svg\"\nimport Eye from \"../../assets/icons/eye.svg\"\nimport Refresh from \"../../assets/icons/refresh.svg\"\nimport { DefaultHorizontalDivider } from \"../form/horizontal-divider\"\nimport { useFormContext } from \"react-hook-form\"\n\nexport function DefaultSettingsRecoveryCodes({\n codes,\n regnerateButton,\n revealButton,\n onRegenerate,\n onReveal,\n}: OrySettingsRecoveryCodesProps) {\n const {\n formState: { isSubmitting },\n } = useFormContext()\n const onDownload = () => {\n const element = document.createElement(\"a\")\n const file = new Blob([codes.join(\"\\n\")], {\n type: \"text/plain\",\n })\n element.href = URL.createObjectURL(file)\n element.download = \"recovery-codes.txt\"\n document.body.appendChild(element)\n element.click()\n }\n\n const hasCodes = codes.length >= 1\n\n return (\n <div className=\"flex flex-col gap-8\">\n {codes.length > 0 && <DefaultHorizontalDivider />}\n <div className=\"flex gap-4 justify-between\">\n <span className=\"text-interface-foreground-default-tertiary\">\n {revealButton && \"Reveal recovery codes\"}\n </span>\n <div className=\"flex gap-2\">\n {regnerateButton && codes.length > 0 && (\n <button\n {...(regnerateButton.attributes as UiNodeInputAttributes)}\n type=\"submit\"\n className=\"ml-auto\"\n onClick={onRegenerate}\n disabled={isSubmitting}\n data-loading={isSubmitting}\n >\n <Refresh\n size={24}\n className=\"text-button-link-default-secondary hover:text-button-link-default-secondary-hover\"\n />\n </button>\n )}\n {revealButton && (\n <>\n <button\n {...(revealButton.attributes as UiNodeInputAttributes)}\n type=\"submit\"\n className=\"ml-auto\"\n onClick={onReveal}\n title=\"Reveal recovery codes\"\n >\n <Eye\n size={24}\n className=\"text-button-link-default-secondary hover:text-button-link-default-secondary-hover\"\n />\n </button>\n </>\n )}\n {hasCodes && (\n <button\n onClick={onDownload}\n type=\"button\"\n className=\"ml-auto\"\n data-testid=\"ory/screen/settings/group/recovery_code/download\"\n title=\"Download recovery codes\"\n >\n <Download\n size={24}\n className=\"text-button-link-default-secondary hover:text-button-link-default-secondary-hover\"\n />\n </button>\n )}\n </div>\n </div>\n {hasCodes ? (\n <div className=\"rounded-general p-6 bg-interface-background-default-secondary border-interface-border-default-primary\">\n <div\n className=\"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 flex-wrap gap-4 text-sm text-interface-foreground-default-primary\"\n data-testid=\"ory/screen/settings/group/recovery_code/codes\"\n >\n {codes.map((code) => (\n <p key={code}>{code}</p>\n ))}\n </div>\n </div>\n ) : null}\n </div>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n UiNodeImageAttributes,\n UiNodeInputAttributes,\n UiNodeTextAttributes,\n} from \"@ory/client-fetch\"\nimport { OrySettingsTotpProps, useComponents } from \"@ory/elements-react\"\nimport QrCode from \"../../assets/icons/qrcode.svg\"\nimport Trash from \"../../assets/icons/trash.svg\"\nimport { DefaultHorizontalDivider } from \"../form/horizontal-divider\"\nimport { useFormContext } from \"react-hook-form\"\nimport { Spinner } from \"../form/spinner\"\n\nexport function DefaultSettingsTotp({\n totpImage,\n totpInput,\n totpSecret,\n totpUnlink,\n onUnlink,\n}: OrySettingsTotpProps) {\n const { Node, Card } = useComponents()\n const {\n formState: { isSubmitting },\n } = useFormContext()\n if (totpUnlink) {\n const {\n type,\n autocomplete: _ignoredAutocomplete,\n label: _ignoredLabel,\n node_type: _ignoredNodeType,\n ...buttonAttrs\n } = totpUnlink.attributes as UiNodeInputAttributes\n\n return (\n <div className=\"grid grid-cols-1 gap-8 md:grid-cols-2\">\n <div className=\"col-span-full\">\n <Card.Divider />\n </div>\n <div className=\"col-span-full flex items-center gap-6\">\n <div className=\"aspect-square size-8 \">\n <QrCode size={32} />\n </div>\n <div className=\"mr-auto flex flex-col\">\n <p className=\"text-sm font-medium text-interface-foreground-default-primary\">\n Authenticator app\n </p>\n </div>\n <button\n type={type === \"button\" ? \"button\" : \"submit\"}\n {...buttonAttrs}\n onClick={onUnlink}\n disabled={isSubmitting}\n >\n {isSubmitting ? (\n <Spinner className=\"relative\" />\n ) : (\n <Trash\n className=\"text-button-link-default-secondary hover:text-button-link-default-secondary-hover\"\n size={24}\n />\n )}\n </button>\n </div>\n </div>\n )\n }\n\n if (totpImage && totpSecret && totpInput) {\n return (\n <div className=\"grid grid-cols-1 gap-8 md:grid-cols-2\">\n <div className=\"col-span-full\">\n <DefaultHorizontalDivider />\n </div>\n <div className=\"flex justify-center rounded-cards bg-interface-background-default-secondary p-8\">\n <div className=\"aspect-square h-44 rounded bg-[white]\">\n <div className=\"-m-3 antialiased mix-blend-multiply\">\n <Node.Image\n node={totpImage}\n attributes={{\n ...(totpImage.attributes as UiNodeImageAttributes),\n }}\n />\n </div>\n </div>\n </div>\n <div className=\"flex flex-col gap-6\">\n <Node.Label\n node={totpSecret}\n attributes={totpSecret.attributes as UiNodeInputAttributes}\n >\n <Node.Input\n node={totpSecret}\n attributes={{\n disabled: true,\n name: \"totp_secret_key\",\n node_type: \"input\",\n type: \"text\",\n value: (totpSecret.attributes as UiNodeTextAttributes).text\n .text,\n }}\n />\n </Node.Label>\n <Node.Label\n attributes={totpInput.attributes as UiNodeInputAttributes}\n node={totpInput}\n >\n <Node.CodeInput\n node={totpInput}\n attributes={totpInput.attributes as UiNodeInputAttributes}\n />\n </Node.Label>\n </div>\n </div>\n )\n }\n}\n","import * as React from \"react\";\nconst SvgQrcode = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} fill=\"none\" {...props}><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\" /></svg>;\nexport default SvgQrcode;","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNodeInputAttributes } from \"@ory/client-fetch\"\nimport { OrySettingsWebauthnProps, useComponents } from \"@ory/elements-react\"\nimport Key from \"../../assets/icons/key.svg\"\nimport Trash from \"../../assets/icons/trash.svg\"\nimport { useFormContext } from \"react-hook-form\"\nimport { Spinner } from \"../form/spinner\"\n\nexport function DefaultSettingsWebauthn({\n nameInput,\n triggerButton,\n removeButtons,\n}: OrySettingsWebauthnProps) {\n const {\n formState: { isSubmitting },\n } = useFormContext()\n const { Node, Card } = useComponents()\n const hasRemoveButtons = removeButtons.length > 0\n\n return (\n <div className=\"flex flex-col gap-8\">\n <div className=\"flex md:max-w-96 sm:items-end gap-3 flex-col sm:flex-row\">\n <div className=\"flex-1\">\n <Node.Label\n node={nameInput}\n attributes={nameInput.attributes as UiNodeInputAttributes}\n >\n <Node.Input\n node={nameInput}\n attributes={nameInput.attributes as UiNodeInputAttributes}\n />\n </Node.Label>\n </div>\n {triggerButton ? (\n <Node.Button\n node={triggerButton}\n attributes={triggerButton.attributes as UiNodeInputAttributes}\n onClick={triggerButton.onClick}\n />\n ) : null}\n </div>\n {hasRemoveButtons ? (\n <div className=\"flex flex-col gap-8\">\n <Card.Divider />\n <div className=\"flex flex-col gap-4\">\n {removeButtons.map((node, i) => {\n const context = node.meta.label?.context ?? {}\n const addedAt =\n \"added_at\" in context ? (context.added_at as string) : null\n const displayName =\n \"display_name\" in context\n ? (context.display_name as string)\n : null\n const keyId =\n \"value\" in node.attributes ? node.attributes.value : null\n\n return (\n <div\n className=\"flex justify-between gap-6 md:items-center\"\n key={`webauthn-remove-button-${i}`}\n >\n <div className=\"flex gap-2 items-center flex-1 truncate\">\n <Key\n size={32}\n className=\"text-interface-foreground-default-primary\"\n />\n <div className=\"flex-1 flex-col md:flex-row md:items-center flex md:justify-between gap-4 truncate\">\n <div className=\"flex-1 flex-col truncate\">\n <p className=\"text-sm font-medium text-interface-foreground-default-secondary truncate\">\n {displayName}\n </p>\n <span className=\"text-sm text-interface-foreground-default-tertiary hidden sm:block truncate\">\n {keyId}\n </span>\n </div>\n {addedAt && (\n <p className=\"text-sm text-interface-foreground-default-tertiary\">\n {new Intl.DateTimeFormat(undefined, {\n dateStyle: \"long\",\n }).format(new Date(addedAt))}\n </p>\n )}\n </div>\n </div>\n <button\n {...(node.attributes as UiNodeInputAttributes)}\n type=\"submit\"\n onClick={node.onClick}\n disabled={isSubmitting}\n className=\"relative\"\n >\n {isSubmitting ? (\n <Spinner className=\"relative\" />\n ) : (\n <Trash\n className=\"text-button-link-default-secondary hover:text-button-link-default-secondary-hover\"\n size={24}\n />\n )}\n </button>\n </div>\n )\n })}\n </div>\n </div>\n ) : null}\n </div>\n )\n}\n","import * as React from \"react\";\nconst SvgKey = props => <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 32 32\" width={props?.width ? props.width : props?.size ?? 20} height={props?.height ? props.height : props?.size ?? 20} {...props}><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\" /></svg>;\nexport default SvgKey;","// Copyright © 2025 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PropsWithChildren } from \"react\"\n\nexport function DefaultAuthMethodListContainer({\n children,\n}: PropsWithChildren) {\n return <div className=\"grid grid-cols-1 gap-2\">{children}</div>\n}\n","// Copyright © 2025 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { isUiNodeInputAttributes } from \"@ory/client-fetch\"\nimport { NodeProps } from \"../../../../components/form/nodes/node\"\nimport { Turnstile, TurnstileInstance } from \"@marsidev/react-turnstile\"\nimport { ReactElement, useRef } from \"react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { NodeInput } from \"../../../../components/form/nodes/input\"\n\ntype Config = {\n sitekey: string\n action: string\n theme: \"auto\" | \"light\" | \"dark\"\n response_field_name: string\n}\n\nexport const DefaultCaptcha = ({ node }: NodeProps) => {\n const { setValue } = useFormContext()\n const ref = useRef<TurnstileInstance>()\n // In this node, we only care about the `captcha-turnstile-options` node as that contains\n // all required information to render the captcha.\n const nodes: ReactElement[] = []\n\n // Special case for CAPTCHA handling as we need to render a different component\n if (isUiNodeInputAttributes(node.attributes)) {\n if (\n node.attributes.name === \"transient_payload.captcha_turnstile_response\"\n ) {\n nodes.push(<NodeInput key={1} node={node} attributes={node.attributes} />)\n }\n }\n\n if (\n isUiNodeInputAttributes(node.attributes) &&\n node.attributes.name === \"captcha_turnstile_options\"\n ) {\n const options: Config = JSON.parse(node.attributes.value as string)\n nodes.push(\n <Turnstile\n key={2}\n ref={ref}\n siteKey={options.sitekey}\n options={{\n action: options.action,\n size: \"flexible\",\n theme: options.theme,\n responseField: false,\n responseFieldName: options.response_field_name,\n }}\n onExpire={() => ref.current?.reset()}\n onSuccess={(token) => {\n setValue(options.response_field_name, token)\n }}\n />,\n )\n }\n\n return nodes\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n Dispatch,\n PropsWithChildren,\n createContext,\n useContext,\n useState,\n} from \"react\"\nimport { OryFlowContainer } from \"../util/flowContainer\"\nimport { FormState, FormStateAction, useFormStateReducer } from \"./form-state\"\n\n/**\n * Returns an object that contains the current flow and the flow type, as well as the configuration.\n *\n * @returns The current flow container\n */\nexport function useOryFlow() {\n const ctx = useContext(OryFlowContext)\n if (!ctx) {\n throw new Error(\"useOryFlow must be used within a OryFlowProvider\")\n }\n\n return ctx\n}\n\n/**\n * Function to set the flow container.\n */\nexport type FlowContainerSetter = Dispatch<OryFlowContainer>\n\n/**\n * The return value of the OryFlowContext.\n */\nexport type FlowContextValue = OryFlowContainer & {\n /**\n * Function to set the flow container.\n */\n setFlowContainer: FlowContainerSetter\n\n /**\n * The current form state.\n * @see FormState\n */\n formState: FormState\n\n /**\n * Dispatch function to update the form state.\n */\n dispatchFormState: Dispatch<FormStateAction>\n}\n\n// This is fine, because we don't export the context itself and guard from it being null in useOryFlow\nconst OryFlowContext = createContext<FlowContextValue>(null!)\n\nexport type OryFlowProviderProps = PropsWithChildren<OryFlowContainer>\n\nexport function OryFlowProvider({\n children,\n ...container\n}: OryFlowProviderProps) {\n const [flowContainer, setFlowContainer] = useState(container)\n const [formState, dispatchFormState] = useFormStateReducer(container)\n\n return (\n <OryFlowContext.Provider\n value={\n {\n ...flowContainer,\n setFlowContainer: (flowContainer) => {\n setFlowContainer(flowContainer)\n dispatchFormState({\n type: \"action_flow_update\",\n flow: flowContainer,\n })\n },\n formState,\n dispatchFormState,\n } as FlowContextValue\n }\n >\n {children}\n </OryFlowContext.Provider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { FlowType, UiNode, UiNodeGroupEnum } from \"@ory/client-fetch\"\nimport { useReducer } from \"react\"\nimport { isChoosingMethod } from \"../components/card/card-two-step.utils\"\nimport { OryFlowContainer } from \"../util\"\nimport { nodesToAuthMethodGroups } from \"../util/ui\"\n\nexport type FormState =\n | { current: \"provide_identifier\" }\n | { current: \"select_method\" }\n | { current: \"method_active\"; method: UiNodeGroupEnum }\n | { current: \"success_screen\" }\n | { current: \"settings\" }\n\nexport type FormStateAction =\n | {\n type: \"action_flow_update\"\n flow: OryFlowContainer\n }\n | {\n type: \"action_select_method\"\n method: UiNodeGroupEnum\n }\n\nfunction findMethodWithMessage(nodes?: UiNode[]) {\n return nodes\n ?.filter((n) => ![\"default\", \"identifier_first\"].includes(n.group))\n ?.find((node) => node.messages?.length > 0)\n}\n\nfunction parseStateFromFlow(flow: OryFlowContainer): FormState {\n switch (flow.flowType) {\n case FlowType.Registration:\n case FlowType.Login: {\n const methodWithMessage = findMethodWithMessage(flow.flow.ui.nodes)\n if (flow.flow.active == \"link_recovery\") {\n return { current: \"method_active\", method: \"link\" }\n } else if (flow.flow.active == \"code_recovery\") {\n return { current: \"method_active\", method: \"code\" }\n } else if (methodWithMessage) {\n return { current: \"method_active\", method: methodWithMessage.group }\n } else if (\n flow.flow.active &&\n ![\"default\", \"identifier_first\", \"oidc\"].includes(flow.flow.active)\n ) {\n return { current: \"method_active\", method: flow.flow.active }\n } else if (isChoosingMethod(flow)) {\n // Login has a special case where we only have one method. Here, we\n // do not want to display the chooser.\n const authMethods = nodesToAuthMethodGroups(flow.flow.ui.nodes)\n if (authMethods.length === 1 && authMethods[0] !== \"code\") {\n // TODO: https://github.com/ory/kratos/issues/4271 - once this is fixed in Kratos, we can remove the check for \"code\"\n return { current: \"method_active\", method: authMethods[0] }\n }\n return { current: \"select_method\" }\n } else if (flow.flow.ui.messages?.some((m) => m.id === 1010016)) {\n // Account linking edge case\n return { current: \"select_method\" }\n }\n return { current: \"provide_identifier\" }\n }\n case FlowType.Recovery:\n case FlowType.Verification:\n // The API does not provide types for the active field of the recovery flow\n // TODO: Add types for the recovery flow in Kratos\n if (flow.flow.active === \"code\" || flow.flow.active === \"link\") {\n if (flow.flow.state === \"choose_method\") {\n return { current: \"provide_identifier\" }\n }\n return { current: \"method_active\", method: flow.flow.active }\n }\n break\n case FlowType.Settings:\n return { current: \"settings\" }\n }\n console.warn(\n `[Ory/Elements React] Encountered an unknown form state on ${flow.flowType} flow with ID ${flow.flow.id}`,\n )\n throw new Error(\"Unknown form state\")\n}\n\nexport function formStateReducer(\n state: FormState,\n action: FormStateAction,\n): FormState {\n switch (action.type) {\n case \"action_flow_update\":\n return parseStateFromFlow(action.flow)\n case \"action_select_method\":\n return { current: \"method_active\", method: action.method }\n }\n return state\n}\n\nexport function useFormStateReducer(flow: OryFlowContainer) {\n return useReducer(formStateReducer, parseStateFromFlow(flow))\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { FlowType, UiNode, UiNodeGroupEnum } from \"@ory/client-fetch\"\nimport {\n LoginFlowContainer,\n RegistrationFlowContainer,\n} from \"../../util/flowContainer\"\n\nexport function isChoosingMethod(\n flow: LoginFlowContainer | RegistrationFlowContainer,\n): boolean {\n return (\n flow.flow.ui.nodes.some(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"screen\" &&\n \"value\" in node.attributes &&\n node.attributes.value === \"previous\",\n ) ||\n flow.flow.ui.nodes.some(\n (node) =>\n node.group === UiNodeGroupEnum.IdentifierFirst &&\n \"name\" in node.attributes &&\n node.attributes.name === \"identifier\" &&\n node.attributes.type === \"hidden\",\n ) ||\n (flow.flowType === FlowType.Login && flow.flow.requested_aal === \"aal2\")\n )\n}\n\nexport function filterOidcOut(nodes: UiNode[]): UiNode[] {\n return nodes.filter((node) => node.group !== UiNodeGroupEnum.Oidc)\n}\n\nexport function getFinalNodes(\n uniqueGroups: Partial<Record<UiNodeGroupEnum, UiNode[]>>,\n selectedGroup: UiNodeGroupEnum | undefined,\n): UiNode[] {\n const selectedNodes: UiNode[] = selectedGroup\n ? (uniqueGroups[selectedGroup] ?? [])\n : []\n\n return [\n ...(uniqueGroups?.identifier_first ?? []),\n ...(uniqueGroups?.default ?? []),\n ...(uniqueGroups?.captcha ?? []),\n ]\n .flat()\n .filter(\n (node) => \"type\" in node.attributes && node.attributes.type === \"hidden\",\n )\n .concat(selectedNodes)\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PropsWithChildren } from \"react\"\nimport { IntlProvider as OriginalIntlProvider } from \"react-intl\"\nimport { OryLocales } from \"..\"\nimport { LocaleMap } from \"../locales\"\n\n// ISO 639-1 language codes\n// https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\nexport const LanguageCodes = [\n \"ab\",\n \"aa\",\n \"af\",\n \"sq\",\n \"am\",\n \"ar\",\n \"hy\",\n \"as\",\n \"ay\",\n \"az\",\n \"ba\",\n \"eu\",\n \"bn\",\n \"dz\",\n \"bh\",\n \"bi\",\n \"br\",\n \"bg\",\n \"my\",\n \"be\",\n \"km\",\n \"ca\",\n \"zh\",\n \"co\",\n \"hr\",\n \"cs\",\n \"da\",\n \"nl\",\n \"en\",\n \"eo\",\n \"et\",\n \"fo\",\n \"fj\",\n \"fi\",\n \"fr\",\n \"fy\",\n \"gd\",\n \"gl\",\n \"ka\",\n \"de\",\n \"el\",\n \"kl\",\n \"gn\",\n \"gu\",\n \"ha\",\n \"iw\",\n \"hi\",\n \"hu\",\n \"is\",\n \"in\",\n \"ia\",\n \"ie\",\n \"ik\",\n \"ga\",\n \"it\",\n \"ja\",\n \"jw\",\n \"kn\",\n \"ks\",\n \"kk\",\n \"rw\",\n \"ky\",\n \"rn\",\n \"ko\",\n \"ku\",\n \"lo\",\n \"la\",\n \"lv\",\n \"ln\",\n \"lt\",\n \"mk\",\n \"mg\",\n \"ms\",\n \"ml\",\n \"mt\",\n \"mi\",\n \"mr\",\n \"mo\",\n \"mn\",\n \"na\",\n \"ne\",\n \"no\",\n \"oc\",\n \"or\",\n \"om\",\n \"ps\",\n \"fa\",\n \"pl\",\n \"pt\",\n \"pa\",\n \"qu\",\n \"rm\",\n \"ro\",\n \"ru\",\n \"sm\",\n \"sg\",\n \"sa\",\n \"sr\",\n \"sh\",\n \"st\",\n \"tn\",\n \"sn\",\n \"sd\",\n \"si\",\n \"ss\",\n \"sk\",\n \"sl\",\n \"so\",\n \"es\",\n \"su\",\n \"sw\",\n \"sv\",\n \"tl\",\n \"tg\",\n \"ta\",\n \"tt\",\n \"te\",\n \"th\",\n \"bo\",\n \"ti\",\n \"to\",\n \"ts\",\n \"tr\",\n \"tk\",\n \"tw\",\n \"uk\",\n \"ur\",\n \"uz\",\n \"vi\",\n \"vo\",\n \"cy\",\n \"wo\",\n \"xh\",\n \"ji\",\n \"yo\",\n \"zu\",\n] as const\n\nexport type Locale = keyof typeof OryLocales\n\nexport type IntlContextProps = {\n locale: Locale\n customTranslations?: Partial<LocaleMap>\n}\n\nfunction mergeTranslations(customTranslations: Partial<LocaleMap>) {\n return Object.keys(customTranslations).reduce((acc, key) => {\n acc[key] = { ...OryLocales[key], ...customTranslations[key] }\n return acc\n }, OryLocales)\n}\n\nexport const IntlProvider = ({\n children,\n locale,\n customTranslations,\n}: PropsWithChildren<IntlContextProps>) => {\n const messages = mergeTranslations(customTranslations ?? {})\n\n return (\n <OriginalIntlProvider\n onWarn={() => ({})}\n defaultRichTextElements={{\n del: (chunks) => <del>{chunks}</del>,\n }}\n locale={locale}\n messages={messages[locale]}\n defaultLocale=\"en\"\n >\n {children}\n </OriginalIntlProvider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useComponents } from \"../../context\"\n\nexport type OryCardHeaderProps = Record<string, never>\n\nexport function OryCardHeader() {\n const { Card } = useComponents()\n return <Card.Header />\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode, UiNodeGroupEnum } from \"@ory/client-fetch\"\nimport { PropsWithChildren } from \"react\"\nimport { FormProvider, useForm } from \"react-hook-form\"\nimport { useOryFlow } from \"../../context\"\nimport { computeDefaultValues } from \"./form-helpers\"\nimport { useOryFormResolver } from \"./form-resolver\"\n\nexport function OryFormProvider({\n children,\n nodes,\n}: PropsWithChildren & { nodes?: UiNode[] }) {\n const flowContainer = useOryFlow()\n const defaultNodes = nodes\n ? flowContainer.flow.ui.nodes\n .filter((node) => node.group === UiNodeGroupEnum.Default)\n .concat(nodes)\n : flowContainer.flow.ui.nodes\n\n const methods = useForm({\n // TODO: Generify this, so we have typesafety in the submit handler.\n defaultValues: computeDefaultValues(defaultNodes),\n resolver: useOryFormResolver(),\n })\n\n return <FormProvider {...methods}>{children}</FormProvider>\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { isUiNodeInputAttributes, UiNode } from \"@ory/client-fetch\"\nimport { FormValues } from \"../../types\"\n\nexport function computeDefaultValues(nodes: UiNode[]): FormValues {\n return nodes.reduce<FormValues>((acc, node) => {\n const attrs = node.attributes\n\n if (isUiNodeInputAttributes(attrs)) {\n // TODO: Kratos should return false for the value here, and not undefined.\n if (attrs.type === \"checkbox\" && typeof attrs.value === \"undefined\") {\n attrs.value = false\n }\n // Skip the \"method\" field and \"submit\" button\n if (\n attrs.name === \"method\" ||\n attrs.type === \"submit\" ||\n typeof attrs.value === \"undefined\"\n ) {\n return acc\n }\n\n // Unroll nested traits or assign default values\n return unrollTrait(\n {\n name: attrs.name,\n value: attrs.value,\n },\n acc,\n )\n }\n\n return acc\n }, {})\n}\n\nexport function unrollTrait<T extends string, V>(\n input: { name: T; value: V },\n output: Partial<UnrollTrait<T, V>> = {},\n): UnrollTrait<T, V> {\n const keys = input.name.split(\".\")\n\n // It's challenging to type this for deeply nested structures because the shape\n // of current changes dynamically as we navigate through levels.\n // TODO(jonas): This is not ideal. We should be able to type this properly.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let current: any = output\n keys.forEach((key, index) => {\n if (!key) return\n current = current[key] =\n index === keys.length - 1 ? input.value : current[key] || {}\n })\n\n return output as UnrollTrait<T, V>\n}\n\ntype UnrollTrait<T extends string, V> = T extends `${infer Head}.${infer Tail}`\n ? { [K in Head]: UnrollTrait<Tail, V> }\n : { [K in T]: V }\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useOryFlow } from \"../../context\"\nimport { FormValues } from \"../../types\"\nimport { isUiNodeInputAttributes } from \"@ory/client-fetch\"\n\nfunction isCodeResendRequest(data: FormValues) {\n // There are two types of resend - one\n return data.email ?? data.resend\n}\n\n/**\n * Creates a resolver for the Ory form\n *\n * The resolver does form validation for missing fields in the form.\n *\n * @returns a react-hook-form resolver for the Ory form\n */\nexport function useOryFormResolver() {\n const flowContainer = useOryFlow()\n\n return (data: FormValues) => {\n if (flowContainer.formState.current === \"method_active\") {\n // This is a workaround which prevents the flow from being submitted without a code,\n // which in some cases can cause issues in Ory Kratos' resend detection.\n if (\n // When we submit a code\n data.method === \"code\" &&\n // And the code is not present\n !data.code &&\n // And the flow is not a code resend request\n !isCodeResendRequest(data) &&\n // And the flow has a code input node\n flowContainer.flow.ui.nodes.find(({ attributes, group }) => {\n if (!isUiNodeInputAttributes(attributes)) {\n return false\n }\n\n return (\n group === \"code\" &&\n attributes.name === \"code\" &&\n attributes.type !== \"hidden\"\n )\n })\n ) {\n return {\n values: data,\n errors: {\n // We know the code node exists, so we can safely hardcode the ID.\n code: {\n id: 4000002,\n context: {\n property: \"code\",\n },\n type: \"error\",\n text: \"Property code is missing\",\n },\n },\n }\n }\n }\n return {\n values: data,\n errors: {},\n }\n }\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PropsWithChildren } from \"react\"\nimport { useComponents } from \"../../context\"\nimport { OryFormProvider } from \"../form/form-provider\"\n\nexport type OryCardRootProps = PropsWithChildren\n\n/**\n * The root component of the Ory Card.\n *\n * This can be used to build fully custom implementations of the Ory Flows.\n *\n * However, you most likely want to override the individual components instead.\n *\n * @param props - pass children to render instead of the default Ory Card components\n * @returns\n */\nexport function OryCard({ children }: PropsWithChildren) {\n const { Card } = useComponents()\n return (\n <Card.Root>\n <OryFormProvider>{children}</OryFormProvider>\n </Card.Root>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useComponents } from \"../../context\"\n\nexport type OryCardFooterProps = Record<string, never>\n\nexport function OryCardFooter() {\n const { Card } = useComponents()\n return <Card.Footer />\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PropsWithChildren } from \"react\"\nimport { useComponents } from \"../../context\"\n\n/**\n * Props for the OryCardContent component.\n */\nexport type OryCardContentProps = PropsWithChildren\n\n/**\n * A component that renders the content of the Ory Card.\n * This is the main content of the card, such as the flow's form, with it's input fields and messages.\n *\n * You can use this component to build fully custom implementations of the Ory Flows.\n *\n * However, you most likely want to override the individual components instead.\n *\n * @param props - pass children to render instead of the default Ory Card components\n * @returns\n */\nexport function OryCardContent({ children }: OryCardContentProps) {\n const { Card } = useComponents()\n\n return <Card.Content>{children}</Card.Content>\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode, UiNodeGroupEnum } from \"@ory/client-fetch\"\nimport { useFormContext } from \"react-hook-form\"\nimport { OryCard, OryCardContent, OryCardFooter } from \".\"\nimport { useComponents, useNodeSorter, useOryFlow } from \"../../context\"\nimport { isGroupImmediateSubmit } from \"../../theme/default/utils/form\"\nimport { findNode, useNodesGroups } from \"../../util/ui\"\nimport { OryForm } from \"../form/form\"\nimport { OryCardValidationMessages } from \"../form/messages\"\nimport { Node } from \"../form/nodes/node\"\nimport { OryFormSocialButtonsForm } from \"../form/social\"\nimport { filterOidcOut, getFinalNodes } from \"./card-two-step.utils\"\nimport { OryCardHeader } from \"./header\"\n\ntype MethodOption = {\n title?: { id: string; values?: Record<string, string> }\n}\nfunction isUINodeGroupEnum(method: string): method is UiNodeGroupEnum {\n // @ts-expect-error it's a string array, but typescript thinks the argument must be validated stricter\n return Object.values(UiNodeGroupEnum).includes(method)\n}\n\ntype MethodOptions = Partial<Record<UiNodeGroupEnum, MethodOption>>\n\ntype AuthMethodListProps = {\n options: MethodOptions\n setSelectedGroup: (group: UiNodeGroupEnum) => void\n}\n\nexport function OryTwoStepCard() {\n const { Form, Card } = useComponents()\n const { flow, flowType, formState, dispatchFormState } = useOryFlow()\n const { ui } = flow\n\n const nodeSorter = useNodeSorter()\n const sortNodes = (a: UiNode, b: UiNode) => nodeSorter(a, b, { flowType })\n\n const uniqueGroups = useNodesGroups(ui.nodes)\n\n const options: MethodOptions = Object.fromEntries(\n Object.values(UiNodeGroupEnum)\n .filter((group) => uniqueGroups.groups[group]?.length)\n .filter(\n (group) =>\n !(\n [\n UiNodeGroupEnum.Oidc,\n UiNodeGroupEnum.Default,\n UiNodeGroupEnum.IdentifierFirst,\n UiNodeGroupEnum.Profile,\n UiNodeGroupEnum.Captcha,\n ] as UiNodeGroupEnum[]\n ).includes(group),\n )\n .map((g) => [g, {}]),\n )\n\n // Special case to show the address on code method selector\n if (UiNodeGroupEnum.Code in options) {\n let identifier = findNode(ui.nodes, {\n group: \"identifier_first\",\n node_type: \"input\",\n name: \"identifier\",\n })?.attributes?.value\n identifier ||= findNode(ui.nodes, {\n group: \"code\",\n node_type: \"input\",\n name: \"address\",\n })?.attributes?.value\n if (identifier) {\n options[UiNodeGroupEnum.Code] = {\n title: {\n id: \"identities.messages.1010023\",\n values: { address: identifier },\n },\n }\n }\n }\n\n const nonOidcNodes = filterOidcOut(ui.nodes)\n const finalNodes =\n formState.current === \"method_active\"\n ? getFinalNodes(uniqueGroups.groups, formState.method)\n : []\n\n const handleAfterFormSubmit = (method: unknown) => {\n if (typeof method !== \"string\" || !isUINodeGroupEnum(method)) {\n return\n }\n if (isGroupImmediateSubmit(method)) {\n dispatchFormState({\n type: \"action_select_method\",\n method: method,\n })\n }\n }\n const hasOidc = ui.nodes.some((node) => node.group === UiNodeGroupEnum.Oidc)\n\n // We want to show the OIDC buttons on all screens, except when the user has selected a different method.\n const showOidc = !(\n formState.current === \"method_active\" && formState.method !== \"oidc\"\n )\n\n return (\n <OryCard>\n <OryCardHeader />\n <OryCardContent>\n <OryCardValidationMessages />\n {showOidc && <OryFormSocialButtonsForm />}\n <OryForm onAfterSubmit={handleAfterFormSubmit}>\n <Form.Group>\n {formState.current === \"provide_identifier\" && (\n <>\n {hasOidc && <Card.Divider />}\n {nonOidcNodes.sort(sortNodes).map((node, k) => (\n <Node node={node} key={k} />\n ))}\n </>\n )}\n {formState.current === \"select_method\" && (\n <>\n <Card.Divider />\n <AuthMethodList\n options={options}\n setSelectedGroup={(group) =>\n dispatchFormState({\n type: \"action_select_method\",\n method: group,\n })\n }\n />\n {ui.nodes\n .filter((n) => n.group === UiNodeGroupEnum.Captcha)\n .map((node, k) => (\n <Node node={node} key={k} />\n ))}\n </>\n )}\n {formState.current === \"method_active\" && (\n <>\n {ui.nodes\n .filter((n) => n.type === \"script\")\n .map((node, k) => (\n <Node node={node} key={k} />\n ))}\n {finalNodes.sort(sortNodes).map((node, k) => (\n <Node node={node} key={k} />\n ))}\n </>\n )}\n </Form.Group>\n <OryCardFooter />\n </OryForm>\n </OryCardContent>\n </OryCard>\n )\n}\n\nfunction AuthMethodList({ options, setSelectedGroup }: AuthMethodListProps) {\n const { Card } = useComponents()\n const { setValue, getValues } = useFormContext()\n\n const handleClick = (group: UiNodeGroupEnum, options?: MethodOption) => {\n if (isGroupImmediateSubmit(group)) {\n // Required because identifier node is not always defined with code method in aal2\n if (\n group === \"code\" &&\n !getValues(\"identifier\") &&\n options?.title?.values?.address\n ) {\n setValue(\"identifier\", options?.title?.values?.address)\n }\n // If the method is \"immediate submit\" (e.g. the method's submit button should be triggered immediately)\n // then the method needs to be added to the form data.\n setValue(\"method\", group)\n } else {\n setSelectedGroup(group)\n }\n }\n return (\n <Card.AuthMethodListContainer>\n {Object.entries(options).map(([group, options]) => (\n <Card.AuthMethodListItem\n key={group}\n group={group}\n title={options.title}\n onClick={() => handleClick(group as UiNodeGroupEnum, options)}\n />\n ))}\n </Card.AuthMethodListContainer>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowType,\n isUiNodeAnchorAttributes,\n isUiNodeImageAttributes,\n isUiNodeInputAttributes,\n isUiNodeScriptAttributes,\n UiText,\n} from \"@ory/client-fetch\"\nimport { ComponentType, PropsWithChildren } from \"react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { useComponents, useOryFlow } from \"../../context\"\nimport {\n OryCardAuthMethodListItemProps,\n OryCardLogoProps,\n OryFormRootProps,\n OryFormSectionContentProps,\n OryFormSectionFooterProps,\n OryNodeAnchorProps,\n OryNodeButtonProps,\n OryNodeCaptchaProps,\n OryNodeImageProps,\n OryNodeInputProps,\n OryNodeLabelProps,\n OryNodeTextProps,\n} from \"../../types\"\nimport { OryCardFooter, OryCardFooterProps } from \"../card\"\nimport { OryCardRootProps } from \"../card/card\"\nimport { OryCardContentProps } from \"../card/content\"\nimport { OryPageHeaderProps } from \"../generic\"\nimport { OryCardDividerProps } from \"../generic/divider\"\nimport {\n OrySettingsOidcProps,\n OrySettingsPasskeyProps,\n OrySettingsRecoveryCodesProps,\n OrySettingsTotpProps,\n OrySettingsWebauthnProps,\n} from \"../settings\"\nimport { OryFormGroupProps } from \"./groups\"\nimport { OryMessageContentProps, OryMessageRootProps } from \"./messages\"\nimport { OryCardSettingsSectionProps } from \"./section\"\nimport { OryFormOidcRootProps, OryNodeOidcButtonProps } from \"./social\"\nimport { useOryFormSubmit } from \"./useOryFormSubmit\"\n\n/**\n * A record of all the components that are used in the OryForm component.\n */\nexport type OryFlowComponents = {\n Node: {\n /**\n * Button component, rendered whenever a button is encountered in the Ory UI Nodes.\n */\n Button: ComponentType<OryNodeButtonProps>\n /**\n * The SocialButton component is rendered whenever a button of group \"oidc\" node is encountered.\n *\n * It renders the \"Login with Google\", \"Login with Facebook\" etc. buttons.\n */\n OidcButton: ComponentType<OryNodeOidcButtonProps>\n /**\n * Anchor component, rendered whenever an \"anchor\" node is encountered\n */\n Anchor: ComponentType<OryNodeAnchorProps>\n /**\n * The Input component is rendered whenever a \"input\" node is encountered.\n */\n Input: ComponentType<OryNodeInputProps>\n /**\n * Special version of the Input component for OTP codes.\n */\n CodeInput: ComponentType<OryNodeInputProps>\n /**\n * The Image component is rendered whenever an \"image\" node is encountered.\n *\n * For example used in the \"Logo\" node.\n */\n Image: ComponentType<OryNodeImageProps>\n /**\n * The Label component is rendered around Input components and is used to render form labels.\n */\n Label: ComponentType<OryNodeLabelProps>\n /**\n * The Checkbox component is rendered whenever an input node with of boolean type is encountered.\n */\n Checkbox: ComponentType<OryNodeInputProps>\n /**\n * The Text component is rendered whenever a \"text\" node is encountered.\n */\n Text: ComponentType<OryNodeTextProps>\n /**\n * The Captcha component is rendered whenever a \"captcha\" group is encountered.\n */\n Captcha: ComponentType<OryNodeCaptchaProps>\n }\n Card: {\n /**\n * The card container is the main container of the card.\n */\n Root: ComponentType<OryCardRootProps>\n /**\n * The card footer is the footer of the card container.\n */\n Footer: ComponentType<OryCardFooterProps>\n /**\n * The card header is the header of the card container.\n */\n Header: ComponentType<OryCardRootProps>\n /**\n * The card content is the main content of the card container.\n */\n Content: ComponentType<OryCardContentProps>\n /**\n * The card logo is the logo of the card container.\n */\n Logo: ComponentType<OryCardLogoProps>\n /**\n * The HorizontalDivider component is rendered between groups.\n */\n Divider: ComponentType<OryCardDividerProps>\n\n /**\n * The AuthMethodListContainer component is rendered around the \"method\" chooser step in the identifier_first login flow.\n *\n * This is only used, if login is configured to use identifier_first authentication.\n */\n AuthMethodListContainer: ComponentType<PropsWithChildren>\n /**\n * The AuthMethodListItem component is rendered on the \"method\" chooser step in the identifier_first login flow.\n *\n * This is only used, if login is configured to use identifier_first authentication.\n */\n AuthMethodListItem: ComponentType<OryCardAuthMethodListItemProps>\n\n /**\n * The SettingsSection component is rendered around each section of the settings.\n */\n SettingsSection: ComponentType<OryCardSettingsSectionProps>\n /**\n * The SettingsSectionContent component is rendered around the content of each section of the settings.\n */\n SettingsSectionContent: ComponentType<OryFormSectionContentProps>\n /**\n * The SettingsSectionFooter component is rendered around the footer of each section of the settings.\n */\n SettingsSectionFooter: ComponentType<OryFormSectionFooterProps>\n }\n Form: {\n /**\n * The FormContainer component is the main container of the form.\n *\n * It should render its children.\n *\n * You most likely don't want to override this component directly.\n */\n Root: ComponentType<OryFormRootProps>\n /**\n * A special form group container for the social buttons.\n *\n * This is required, because the social buttons need to be in its form, to not influence the other form groups.\n *\n * You most likely don't want to override this component directly.\n */\n OidcRoot: ComponentType<OryFormOidcRootProps>\n\n /**\n * The FormGroup is rendered around each group of nodes in the UI nodes.\n */\n Group: ComponentType<OryFormGroupProps>\n\n /**\n * The section on the settings page, rendering the OIDC settings\n */\n OidcSettings: ComponentType<OrySettingsOidcProps>\n\n /**\n * The section on the settings page, rendering the Webauthn settings\n */\n WebauthnSettings: ComponentType<OrySettingsWebauthnProps>\n\n /**\n * The section on the settings page, rendering the Passkey settings\n */\n PasskeySettings: ComponentType<OrySettingsPasskeyProps>\n\n /**\n * The section on the settings page, rendering the TOTP settings\n */\n TotpSettings: ComponentType<OrySettingsTotpProps>\n\n /**\n * The section on the settings page, rendering the recovery code settings\n */\n RecoveryCodesSettings: ComponentType<OrySettingsRecoveryCodesProps>\n }\n Message: {\n /**\n * The MessageContainer is rendered around the messages.\n */\n Root: ComponentType<OryMessageRootProps>\n\n /**\n * The Message component is rendered whenever a message is encountered.\n */\n Content: ComponentType<OryMessageContentProps>\n }\n Page: {\n Header: ComponentType<OryPageHeaderProps>\n }\n}\n\ntype DeepPartialTwoLevels<T> = {\n [P in keyof T]?: T[P] extends object ? { [K in keyof T[P]]?: T[P][K] } : T[P]\n}\n\nexport type OryFlowComponentOverrides = DeepPartialTwoLevels<OryFlowComponents>\n\nexport type OryFormProps = PropsWithChildren<{\n onAfterSubmit?: (method: string | number | boolean | undefined) => void\n}>\n\nexport function OryForm({ children, onAfterSubmit }: OryFormProps) {\n const { Form } = useComponents()\n const flowContainer = useOryFlow()\n const methods = useFormContext()\n const { Message } = useComponents()\n\n const intl = useIntl()\n\n const onSubmit = useOryFormSubmit(onAfterSubmit)\n\n const hasMethods = flowContainer.flow.ui.nodes.some((node) => {\n if (isUiNodeInputAttributes(node.attributes)) {\n return node.attributes.name !== \"csrf_token\"\n } else if (isUiNodeAnchorAttributes(node.attributes)) {\n return true\n } else if (isUiNodeImageAttributes(node.attributes)) {\n return true\n } else if (isUiNodeScriptAttributes(node.attributes)) {\n return true\n }\n return false\n })\n if (!hasMethods) {\n // This is defined in Ory Kratos as well.\n const m: UiText = {\n id: 5000002,\n text: intl.formatMessage({\n id: `identities.messages.${5000002}`,\n defaultMessage:\n \"No authentication methods are available for this request. Please contact the site or app owner.\",\n }),\n type: \"error\",\n }\n\n return (\n <>\n <Message.Root>\n <Message.Content key={m.id} message={m} />\n </Message.Root>\n <OryCardFooter />\n </>\n )\n }\n\n if (\n flowContainer.flowType === FlowType.Login &&\n flowContainer.formState.current === \"method_active\" &&\n flowContainer.formState.method === \"code\"\n ) {\n // This is enforced here because method code node is sometimes missing\n methods.setValue(\"method\", \"code\")\n }\n\n return (\n <Form.Root\n action={flowContainer.flow.ui.action}\n method={flowContainer.flow.ui.method}\n onSubmit={(e) => void methods.handleSubmit(onSubmit)(e)}\n >\n {children}\n </Form.Root>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowType,\n OnRedirectHandler,\n UpdateLoginFlowBody,\n UpdateRecoveryFlowBody,\n UpdateRegistrationFlowBody,\n UpdateSettingsFlowBody,\n UpdateVerificationFlowBody,\n} from \"@ory/client-fetch\"\nimport { SubmitHandler, useFormContext } from \"react-hook-form\"\nimport { useOryFlow } from \"../../context\"\nimport { FormValues } from \"../../types\"\nimport { OryFlowContainer } from \"../../util\"\nimport { onSubmitLogin } from \"../../util/onSubmitLogin\"\nimport { onSubmitRecovery } from \"../../util/onSubmitRecovery\"\nimport { onSubmitRegistration } from \"../../util/onSubmitRegistration\"\nimport { onSubmitSettings } from \"../../util/onSubmitSettings\"\nimport { onSubmitVerification } from \"../../util/onSubmitVerification\"\nimport { computeDefaultValues } from \"./form-helpers\"\n\n// The \"select_account\" prompt is supported by the following providers.\n// This prompt forces the user to select an account, even if they are already logged in.\n// This is useful when the user wants to link an account, for example.\n// TODO: this list could likely be extended, but the parameter is poorly documented.\nconst supportsSelectAccountPrompt = [\"google\", \"github\"]\n\nexport function useOryFormSubmit(\n onAfterSubmit?: (method: string | number | boolean | undefined) => void,\n) {\n const flowContainer = useOryFlow()\n const methods = useFormContext()\n\n const handleSuccess = (flow: OryFlowContainer) => {\n flowContainer.setFlowContainer(flow)\n methods.reset(computeDefaultValues(flow.flow.ui.nodes))\n }\n\n const onRedirect: OnRedirectHandler = (url, _external) => {\n window.location.assign(url)\n }\n\n const onSubmit: SubmitHandler<FormValues> = async (data) => {\n switch (flowContainer.flowType) {\n case FlowType.Login: {\n const submitData: UpdateLoginFlowBody = {\n ...(data as unknown as UpdateLoginFlowBody),\n }\n if (submitData.method === \"code\" && data.code) {\n submitData.resend = \"\"\n }\n\n await onSubmitLogin(flowContainer, {\n onRedirect,\n setFlowContainer: handleSuccess,\n body: submitData,\n })\n break\n }\n case FlowType.Registration: {\n const submitData: UpdateRegistrationFlowBody = {\n ...(data as unknown as UpdateRegistrationFlowBody),\n }\n\n if (submitData.method === \"code\" && submitData.code) {\n submitData.resend = \"\"\n }\n\n await onSubmitRegistration(flowContainer, {\n onRedirect,\n setFlowContainer: handleSuccess,\n body: submitData,\n })\n break\n }\n case FlowType.Verification:\n await onSubmitVerification(flowContainer, {\n onRedirect,\n setFlowContainer: handleSuccess,\n body: data as unknown as UpdateVerificationFlowBody,\n })\n break\n case FlowType.Recovery: {\n const submitData: UpdateRecoveryFlowBody = {\n ...(data as unknown as UpdateRecoveryFlowBody),\n }\n // TODO: We should probably fix this in Kratos, and give the code priority over the email. However, that would be breaking :(\n if (data.code) {\n submitData.email = \"\"\n }\n await onSubmitRecovery(flowContainer, {\n onRedirect,\n setFlowContainer: handleSuccess,\n body: submitData,\n })\n break\n }\n case FlowType.Settings: {\n const submitData: UpdateSettingsFlowBody = {\n ...(data as unknown as UpdateSettingsFlowBody),\n }\n\n if (\"totp_unlink\" in submitData) {\n submitData.method = \"totp\"\n }\n\n if (\n \"lookup_secret_confirm\" in submitData ||\n \"lookup_secret_reveal\" in submitData ||\n \"lookup_secret_regenerate\" in submitData ||\n \"lookup_secret_disable\" in submitData\n ) {\n submitData.method = \"lookup_secret\"\n }\n\n // Force the account selection screen on link to provide a better use experience.\n // https://github.com/ory/elements/issues/268\n // TODO: Maybe this needs to be configurable in the configuration\n if (\n submitData.method === \"oidc\" &&\n submitData.link &&\n supportsSelectAccountPrompt.includes(submitData.link)\n ) {\n submitData.upstream_parameters = {\n prompt: \"select_account\",\n }\n }\n\n if (\"webauthn_remove\" in submitData) {\n submitData.method = \"webauthn\"\n }\n\n if (\"passkey_remove\" in submitData) {\n submitData.method = \"passkey\"\n }\n\n await onSubmitSettings(flowContainer, {\n onRedirect,\n setFlowContainer: handleSuccess,\n body: submitData,\n })\n break\n }\n }\n if (\"password\" in data) {\n methods.setValue(\"password\", \"\")\n }\n if (\"code\" in data) {\n methods.setValue(\"code\", \"\")\n }\n if (\"totp_code\" in data) {\n methods.setValue(\"totp_code\", \"\")\n }\n onAfterSubmit?.(data.method)\n }\n\n return onSubmit\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowType,\n handleFlowError,\n LoginFlow,\n loginUrl,\n UpdateLoginFlowBody,\n} from \"@ory/client-fetch\"\nimport { OnSubmitHandlerProps } from \"./submitHandler\"\nimport { OryFlowContainer } from \"./flowContainer\"\nimport { frontendClient } from \"./client\"\nimport { replaceWindowFlowId } from \"./internal\"\n\n/**\n * Use this method to submit a login flow. This method is used in the `onSubmit` handler of the login form.\n *\n * @param config - The configuration object.\n * @param flow - The flow object.\n * @param setFlowContainer - This method is used to update the flow container when a validation error occurs, for example.\n * @param body - The form values to submit.\n * @param onRedirect - This method is used to redirect the user to a different page.\n */\nexport async function onSubmitLogin(\n { config, flow }: OryFlowContainer,\n {\n setFlowContainer,\n body,\n onRedirect,\n }: OnSubmitHandlerProps<UpdateLoginFlowBody>,\n) {\n if (!config.sdk.url) {\n throw new Error(\n `Please supply your Ory Network SDK url to the Ory Elements configuration.`,\n )\n }\n\n await frontendClient(config.sdk.url, config.sdk.options ?? {})\n .updateLoginFlowRaw({\n flow: flow.id,\n updateLoginFlowBody: body,\n })\n .then(() => {\n // TODO Remove this workaround. If the return_to value is missing we redirect to the browser endpoint which will redirect us\n // TODO to the default_redirect_url. Ideally, this value comes from the project config.\n window.location.href =\n // eslint-disable-next-line promise/always-return\n flow.return_to ?? config.sdk.url + \"/self-service/login/browser\"\n })\n .catch(\n handleFlowError({\n onRestartFlow: (useFlowId?: string) => {\n if (useFlowId) {\n replaceWindowFlowId(useFlowId)\n } else {\n onRedirect(loginUrl(config), true)\n }\n },\n onValidationError: (body: LoginFlow) => {\n setFlowContainer({\n config,\n flow: body,\n flowType: FlowType.Login,\n })\n },\n onRedirect,\n }),\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n ContinueWith,\n FlowType,\n GenericError,\n handleContinueWith,\n handleFlowError,\n instanceOfContinueWithRecoveryUi,\n OnRedirectHandler,\n RecoveryFlow,\n recoveryUrl,\n UpdateRecoveryFlowBody,\n} from \"@ory/client-fetch\"\nimport { frontendClient } from \"./client\"\nimport { OryClientConfiguration } from \"./clientConfiguration\"\nimport { OryFlowContainer } from \"./flowContainer\"\nimport { OnSubmitHandlerProps } from \"./submitHandler\"\nimport { replaceWindowFlowId } from \"./internal\"\n\n/**\n * Use this method to submit a recovery flow. This method is used in the `onSubmit` handler of the recovery form.\n *\n * @param config - The configuration object.\n * @param flow - The flow object.\n * @param setFlowContainer - This method is used to update the flow container when a validation error occurs, for example.\n * @param body - The form values to submit.\n * @param onRedirect - This method is used to redirect the user to a different page.\n */\nexport async function onSubmitRecovery(\n { config, flow }: OryFlowContainer,\n {\n setFlowContainer,\n body,\n onRedirect,\n }: OnSubmitHandlerProps<UpdateRecoveryFlowBody>,\n) {\n if (!config.sdk.url) {\n throw new Error(\n `Please supply your Ory Network SDK url to the Ory Elements configuration.`,\n )\n }\n\n await frontendClient(config.sdk.url, config.sdk.options ?? {})\n .updateRecoveryFlowRaw({\n flow: flow.id,\n updateRecoveryFlowBody: body,\n })\n .then(async (res) => {\n const flow = await res.value()\n\n const didContinueWith = handleContinueWith(flow.continue_with, {\n onRedirect,\n })\n\n // eslint-disable-next-line promise/always-return\n if (didContinueWith) {\n return\n }\n\n setFlowContainer({\n flow,\n flowType: FlowType.Recovery,\n config,\n })\n })\n .catch(\n handleFlowError({\n onRestartFlow: (useFlowId) => {\n if (useFlowId) {\n replaceWindowFlowId(useFlowId)\n } else {\n onRedirect(recoveryUrl(config), true)\n }\n },\n onValidationError: (body: RecoveryFlow | { error: GenericError }) => {\n if (\"error\" in body) {\n handleContinueWithRecoveryUIError(body.error, config, onRedirect)\n return\n } else {\n setFlowContainer({\n flow: body,\n flowType: FlowType.Recovery,\n config,\n })\n }\n },\n onRedirect,\n }),\n )\n}\n\nfunction handleContinueWithRecoveryUIError(\n error: GenericError,\n config: OryClientConfiguration,\n onRedirect: OnRedirectHandler,\n) {\n if (\n \"continue_with\" in error.details &&\n Array.isArray(error.details.continue_with)\n ) {\n const continueWithRecovery = (\n error.details.continue_with as ContinueWith[]\n ).find(instanceOfContinueWithRecoveryUi)\n if (continueWithRecovery?.action === \"show_recovery_ui\") {\n onRedirect(\n config.project.recovery_ui_url +\n \"?flow=\" +\n continueWithRecovery?.flow.id,\n false,\n )\n return\n }\n }\n onRedirect(recoveryUrl(config), true)\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowType,\n handleContinueWith,\n handleFlowError,\n RegistrationFlow,\n registrationUrl,\n UpdateRegistrationFlowBody,\n} from \"@ory/client-fetch\"\nimport { OryFlowContainer } from \"./flowContainer\"\nimport { OnSubmitHandlerProps } from \"./submitHandler\"\nimport { frontendClient } from \"./client\"\nimport { replaceWindowFlowId } from \"./internal\"\n\n/**\n * Use this method to submit a registration flow. This method is used in the `onSubmit` handler of the registration form.\n *\n * @param config - The configuration object.\n * @param flow - The flow object.\n * @param setFlowContainer - This method is used to update the flow container when a validation error occurs, for example.\n * @param body - The form values to submit.\n * @param onRedirect - This method is used to redirect the user to a different page.\n */\nexport async function onSubmitRegistration(\n { config, flow }: OryFlowContainer,\n {\n setFlowContainer,\n body,\n onRedirect,\n }: OnSubmitHandlerProps<UpdateRegistrationFlowBody>,\n) {\n if (!config.sdk.url) {\n throw new Error(\n `Please supply your Ory Network SDK url to the Ory Elements configuration.`,\n )\n }\n\n const client = frontendClient(config.sdk.url, config.sdk.options ?? {})\n await client\n .updateRegistrationFlowRaw({\n flow: flow.id,\n updateRegistrationFlowBody: body,\n })\n .then(async (res) => {\n const body = await res.value()\n\n const didContinueWith = handleContinueWith(body.continue_with, {\n onRedirect,\n })\n\n // eslint-disable-next-line promise/always-return\n if (didContinueWith) {\n return\n }\n\n // We did not receive a valid continue_with, but the state flow is still a success. In this case we re-initialize\n // the registration flow which will redirect the user to the default url.\n onRedirect(registrationUrl(config), true)\n })\n .catch(\n handleFlowError({\n onRestartFlow: (useFlowId) => {\n if (useFlowId) {\n replaceWindowFlowId(useFlowId)\n } else {\n onRedirect(registrationUrl(config), true)\n }\n },\n onValidationError: (body: RegistrationFlow) => {\n setFlowContainer({\n flow: body,\n flowType: FlowType.Registration,\n config,\n })\n },\n onRedirect,\n }),\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowType,\n handleContinueWith,\n handleFlowError,\n isResponseError,\n loginUrl,\n SettingsFlow,\n settingsUrl,\n UpdateSettingsFlowBody,\n} from \"@ory/client-fetch\"\nimport { OryFlowContainer } from \"./flowContainer\"\nimport { OnSubmitHandlerProps } from \"./submitHandler\"\nimport { frontendClient } from \"./client\"\nimport { replaceWindowFlowId } from \"./internal\"\n\n/**\n * Use this method to submit a settings flow. This method is used in the `onSubmit` handler of the settings form.\n *\n * @param config - The configuration object.\n * @param flow - The flow object.\n * @param setFlowContainer - This method is used to update the flow container when a validation error occurs, for example.\n * @param body - The form values to submit.\n * @param onRedirect - This method is used to redirect the user to a different page.\n */\nexport async function onSubmitSettings(\n { config, flow }: OryFlowContainer,\n {\n setFlowContainer,\n body,\n onRedirect,\n }: OnSubmitHandlerProps<UpdateSettingsFlowBody>,\n) {\n if (!config.sdk.url) {\n throw new Error(\n `Please supply your Ory Network SDK url to the Ory Elements configuration.`,\n )\n }\n\n const client = frontendClient(config.sdk.url, config.sdk.options ?? {})\n await client\n .updateSettingsFlowRaw({\n flow: flow.id,\n updateSettingsFlowBody: body,\n })\n .then(async (res) => {\n const body = await res.value()\n\n const didContinueWith = handleContinueWith(body.continue_with, {\n onRedirect,\n })\n\n // eslint-disable-next-line promise/always-return\n if (didContinueWith) {\n return\n }\n\n setFlowContainer({\n flow: body,\n flowType: FlowType.Settings,\n config,\n })\n })\n .catch(\n handleFlowError({\n onRestartFlow: (useFlowId) => {\n if (useFlowId) {\n replaceWindowFlowId(useFlowId)\n } else {\n onRedirect(settingsUrl(config), true)\n }\n },\n onValidationError: (body: SettingsFlow) => {\n setFlowContainer({\n flow: body,\n flowType: FlowType.Settings,\n config,\n })\n },\n onRedirect,\n }),\n )\n .catch((err) => {\n if (isResponseError(err)) {\n if (err.response.status === 401) {\n return onRedirect(\n loginUrl(config) + \"?return_to=\" + settingsUrl(config),\n true,\n )\n }\n throw err\n }\n })\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowType,\n handleFlowError,\n UpdateVerificationFlowBody,\n VerificationFlow,\n verificationUrl,\n} from \"@ory/client-fetch\"\nimport { OryFlowContainer } from \"./flowContainer\"\nimport { OnSubmitHandlerProps } from \"./submitHandler\"\nimport { frontendClient } from \"./client\"\nimport { replaceWindowFlowId } from \"./internal\"\n\n/**\n * Use this method to submit a verification flow. This method is used in the `onSubmit` handler of the verification form.\n *\n * @param config - The configuration object.\n * @param flow - The flow object.\n * @param setFlowContainer - This method is used to update the flow container when a validation error occurs, for example.\n * @param body - The form values to submit.\n * @param onRedirect - This method is used to redirect the user to a different page.\n */\nexport async function onSubmitVerification(\n { config, flow }: OryFlowContainer,\n {\n setFlowContainer,\n body,\n onRedirect,\n }: OnSubmitHandlerProps<UpdateVerificationFlowBody>,\n) {\n if (!config.sdk.url) {\n throw new Error(\n `Please supply your Ory Network SDK URL to the Ory Elements configuration.`,\n )\n }\n\n await frontendClient(config.sdk.url, config.sdk.options ?? {})\n .updateVerificationFlowRaw({\n flow: flow.id,\n updateVerificationFlowBody: body,\n })\n .then(async (res) =>\n setFlowContainer({\n flow: await res.value(),\n flowType: FlowType.Verification,\n config,\n }),\n )\n .catch(\n handleFlowError({\n onRestartFlow: (useFlowId) => {\n if (useFlowId) {\n replaceWindowFlowId(useFlowId)\n } else {\n onRedirect(verificationUrl(config), true)\n }\n },\n onValidationError: (body: VerificationFlow) => {\n setFlowContainer({\n flow: body,\n flowType: FlowType.Verification,\n config,\n })\n },\n onRedirect,\n }),\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useOryFlow, useComponents } from \"../../context\"\nimport { UiText } from \"@ory/client-fetch\"\nimport { DetailedHTMLProps, HTMLAttributes } from \"react\"\n\nexport type OryMessageContentProps = {\n message: UiText\n}\n\nexport type OryMessageRootProps = DetailedHTMLProps<\n HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>\n\n// This is a list of message IDs that should not be shown to the user.\n// They're returned by the API, but they don't work well in the two step flows.\nconst messageIdsToHide = [\n 1040009, 1060003, 1080003, 1010004, 1010014, 1040005, 1010016,\n]\n\nexport function OryCardValidationMessages({ ...props }: OryMessageRootProps) {\n const { flow } = useOryFlow()\n const messages = flow.ui.messages?.filter(\n (m) => !messageIdsToHide.includes(m.id),\n )\n const { Message } = useComponents()\n\n if (!messages) {\n return null\n }\n\n return (\n <Message.Root {...props}>\n {messages?.map((message) => (\n <Message.Content key={message.id} message={message} />\n ))}\n </Message.Root>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { NodeInput } from \"./input\"\nimport {\n UiNode,\n isUiNodeAnchorAttributes,\n isUiNodeImageAttributes,\n isUiNodeInputAttributes,\n isUiNodeScriptAttributes,\n isUiNodeTextAttributes,\n UiNodeGroupEnum,\n} from \"@ory/client-fetch\"\nimport { MouseEventHandler, ReactNode } from \"react\"\nimport { useComponents } from \"../../../context\"\n\nexport type NodeProps = {\n node: UiNode\n className?: string\n onClick?: MouseEventHandler\n}\n\nexport const Node = ({ node, onClick }: NodeProps): ReactNode => {\n const { Node } = useComponents()\n\n // Special case for CAPTCHA handling as we need to render a different component\n if (node.group === UiNodeGroupEnum.Captcha) {\n return <Node.Captcha node={node} />\n }\n\n if (isUiNodeImageAttributes(node.attributes)) {\n return <Node.Image node={node} attributes={node.attributes} />\n } else if (isUiNodeTextAttributes(node.attributes)) {\n const attrs = node.attributes\n return <Node.Text attributes={attrs} node={node} />\n } else if (isUiNodeInputAttributes(node.attributes)) {\n return (\n <NodeInput node={node} attributes={node.attributes} onClick={onClick} />\n )\n } else if (isUiNodeAnchorAttributes(node.attributes)) {\n return <Node.Anchor attributes={node.attributes} node={node} />\n } else if (isUiNodeScriptAttributes(node.attributes)) {\n const {\n crossorigin,\n referrerpolicy,\n node_type: _nodeType,\n ...attributes\n } = node.attributes\n\n return (\n <script\n crossOrigin={\n crossorigin as \"anonymous\" | \"use-credentials\" | \"\" | undefined\n }\n referrerPolicy={referrerpolicy as React.HTMLAttributeReferrerPolicy}\n {...attributes}\n />\n )\n }\n return null\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useComponents } from \"../../context\"\nimport { useOryFlow } from \"../../context\"\nimport { UiNode, UiNodeInputAttributes } from \"@ory/client-fetch\"\nimport { PropsWithChildren } from \"react\"\nimport { OryForm } from \"./form\"\nimport { useFormContext } from \"react-hook-form\"\nimport { OryFormProvider } from \"./form-provider\"\n\nexport type OryFormOidcRootProps = PropsWithChildren<{\n nodes: UiNode[]\n}>\n\nexport type OryNodeOidcButtonProps = {\n node: UiNode\n attributes: UiNodeInputAttributes\n onClick?: () => void\n}\n\nexport function OryFormOidcButtons() {\n const {\n flow: { ui },\n } = useOryFlow()\n const { setValue } = useFormContext()\n\n // Only get the oidc nodes.\n const filteredNodes = ui.nodes.filter((node) => node.group === \"oidc\")\n\n const { Form, Node } = useComponents()\n\n if (filteredNodes.length === 0) {\n return null\n }\n\n return (\n <Form.OidcRoot nodes={filteredNodes}>\n {filteredNodes.map((node, k) => (\n <Node.OidcButton\n node={node}\n key={k}\n attributes={node.attributes as UiNodeInputAttributes}\n onClick={() => {\n setValue(\n \"provider\",\n (node.attributes as UiNodeInputAttributes).value,\n )\n setValue(\"method\", \"oidc\")\n }}\n />\n ))}\n </Form.OidcRoot>\n )\n}\n\nexport function OryFormSocialButtonsForm() {\n const {\n flow: { ui },\n } = useOryFlow()\n\n // Only get the oidc nodes.\n const filteredNodes = ui.nodes.filter((node) => node.group === \"oidc\")\n\n if (filteredNodes.length === 0) {\n return null\n }\n\n return (\n <OryFormProvider>\n <OryForm>\n <OryFormOidcButtons />\n </OryForm>\n </OryFormProvider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useComponents, useNodeSorter } from \"../../context\"\nimport { useOryFlow } from \"../../context\"\nimport { UiNodeGroupEnum } from \"@ory/client-fetch\"\nimport { PropsWithChildren } from \"react\"\nimport { Node } from \"./nodes/node\"\n\nexport type OryFormGroupsProps = PropsWithChildren<{\n groups: UiNodeGroupEnum[]\n}>\n\nexport type OryFormGroupProps = PropsWithChildren\n\nexport function OryFormGroups({ groups }: OryFormGroupsProps) {\n const {\n flow: { ui },\n } = useOryFlow()\n const nodeSorter = useNodeSorter()\n const { flowType } = useOryFlow()\n const { Form } = useComponents()\n const nodes = ui.nodes\n .filter((node) => groups.indexOf(node.group) > -1)\n .sort((a, b) => nodeSorter(a, b, { flowType }))\n\n return (\n <Form.Group>\n {nodes.map((node, k) => {\n return <Node node={node} key={k} />\n })}\n </Form.Group>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode } from \"@ory/client-fetch\"\nimport {\n ComponentPropsWithoutRef,\n FormEventHandler,\n PropsWithChildren,\n} from \"react\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useComponents } from \"../../context/component\"\nimport { OryFormProvider } from \"./form-provider\"\nimport { useOryFormSubmit } from \"./useOryFormSubmit\"\nimport { useOryFlow } from \"../../context\"\n\ntype OryFormProps = Omit<\n ComponentPropsWithoutRef<\"form\">,\n \"action\" | \"method\" | \"onSubmit\"\n>\n\nexport type OryFormSectionProps = PropsWithChildren<\n OryFormProps & {\n nodes?: UiNode[]\n }\n>\n\nexport type OryCardSettingsSectionProps = PropsWithChildren & {\n action: string\n method: string\n onSubmit: FormEventHandler<HTMLFormElement>\n}\n\nexport function OryFormSection({\n children,\n nodes,\n ...rest\n}: OryFormSectionProps) {\n return (\n <OryFormProvider nodes={nodes}>\n <OryFormSectionInner {...rest}>{children}</OryFormSectionInner>\n </OryFormProvider>\n )\n}\n\nfunction OryFormSectionInner({\n children,\n ...rest\n}: PropsWithChildren<OryFormProps>) {\n const { Card } = useComponents()\n const flowContainer = useOryFlow()\n const onSubmit = useOryFormSubmit()\n const methods = useFormContext()\n\n return (\n <Card.SettingsSection\n action={flowContainer.flow.ui.action}\n method={flowContainer.flow.ui.method}\n onSubmit={(e) => void methods.handleSubmit(onSubmit)(e)}\n {...rest}\n >\n {children}\n </Card.SettingsSection>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useComponents } from \"../../context\"\nimport { useOryFlow } from \"../../context\"\n\n/**\n * Props type for the Form Group Divider component.\n */\nexport type OryCardDividerProps = Record<string, never>\n\n/**\n * Renders the @see Card.Divider between the groups of nodes in the Ory Form.\n *\n * You can use this component to build fully custom implementations of the Ory Flows.\n *\n * However, you most likely want to override the individual components instead.\n *\n * @returns\n */\nexport function OryFormGroupDivider() {\n const { Card } = useComponents()\n const {\n flow: { ui },\n } = useOryFlow()\n\n // Only get the oidc nodes.\n const filteredNodes = ui.nodes.filter((node) => node.group === \"oidc\")\n\n // Are there other first-factor nodes available?\n const otherNodes = ui.nodes.filter(\n (node) => node.group !== \"oidc\" && node.group !== \"default\",\n )\n\n if (filteredNodes.length > 0 && otherNodes.length > 0) {\n return <Card.Divider />\n }\n return null\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useComponents } from \"../../context\"\n\nexport type OryPageHeaderProps = Record<never, never>\n\nexport const HeadlessPageHeader = () => {\n const { Page } = useComponents()\n\n return <Page.Header />\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode, UiNodeGroupEnum } from \"@ory/client-fetch\"\nimport { useIntl } from \"react-intl\"\nimport { useComponents, useOryFlow } from \"../../context\"\nimport { useNodesGroups } from \"../../util/ui\"\nimport { OryCardValidationMessages } from \"../form\"\nimport { Node } from \"../form/nodes/node\"\nimport { OryFormSection } from \"../form/section\"\nimport { OrySettingsOidc } from \"./oidc-settings\"\nimport { OrySettingsPasskey } from \"./passkey-settings\"\nimport { OrySettingsRecoveryCodes } from \"./recovery-codes-settings\"\nimport { OrySettingsTotp } from \"./totp-settings\"\nimport { OrySettingsWebauthn } from \"./webauthn-settings\"\n\ntype SettingsSectionProps = {\n group: UiNodeGroupEnum\n nodes: UiNode[]\n}\n\nfunction SettingsSectionContent({ group, nodes }: SettingsSectionProps) {\n const { Card } = useComponents()\n const intl = useIntl()\n const { flow } = useOryFlow()\n const uniqueGroups = useNodesGroups(flow.ui.nodes)\n\n if (group === UiNodeGroupEnum.Totp) {\n return (\n <OryFormSection\n nodes={uniqueGroups.groups.totp}\n data-testid=\"ory/screen/settings/group/totp\"\n >\n <OrySettingsTotp nodes={uniqueGroups.groups.totp ?? []} />\n {uniqueGroups.groups.default?.map((node, k) => (\n <Node key={k} node={node} />\n ))}\n </OryFormSection>\n )\n }\n\n if (group === UiNodeGroupEnum.LookupSecret) {\n return (\n <OryFormSection\n nodes={uniqueGroups.groups.lookup_secret}\n data-testid=\"ory/screen/settings/group/lookup_secret\"\n >\n <OrySettingsRecoveryCodes\n nodes={uniqueGroups.groups.lookup_secret ?? []}\n />\n {uniqueGroups.groups.default?.map((node, k) => (\n <Node key={k} node={node} />\n ))}\n </OryFormSection>\n )\n }\n\n if (group === UiNodeGroupEnum.Oidc) {\n return (\n <OryFormSection\n nodes={uniqueGroups.groups.oidc}\n data-testid=\"ory/screen/settings/group/oidc\"\n >\n <OrySettingsOidc nodes={uniqueGroups.groups.oidc ?? []} />\n {uniqueGroups.groups.default?.map((node, k) => (\n <Node key={k} node={node} />\n ))}\n </OryFormSection>\n )\n }\n\n if (group === UiNodeGroupEnum.Webauthn) {\n return (\n <OryFormSection\n nodes={uniqueGroups.groups.webauthn}\n data-testid=\"ory/screen/settings/group/webauthn\"\n >\n <OrySettingsWebauthn nodes={uniqueGroups.groups.webauthn ?? []} />\n {uniqueGroups.groups.default?.map((node, k) => (\n <Node key={k} node={node} />\n ))}\n </OryFormSection>\n )\n }\n\n if (group === UiNodeGroupEnum.Passkey) {\n return (\n <OryFormSection\n nodes={uniqueGroups.groups.passkey}\n data-testid=\"ory/screen/settings/group/passkey\"\n >\n <OrySettingsPasskey nodes={uniqueGroups.groups.passkey ?? []} />\n {uniqueGroups.groups.default?.map((node, k) => (\n <Node key={k} node={node} />\n ))}\n </OryFormSection>\n )\n }\n\n return (\n <OryFormSection\n nodes={nodes}\n data-testid={`ory/screen/settings/group/${group}`}\n >\n <Card.SettingsSectionContent\n title={intl.formatMessage({\n id: `settings.${group}.title`,\n })}\n description={intl.formatMessage({\n id: `settings.${group}.description`,\n })}\n >\n {uniqueGroups.groups.default?.map((node, k) => (\n <Node key={k} node={node} />\n ))}\n {nodes\n .filter(\n (node) =>\n \"type\" in node.attributes && node.attributes.type !== \"submit\",\n )\n .map((node, k) => (\n <Node key={k} node={node} />\n ))}\n </Card.SettingsSectionContent>\n <Card.SettingsSectionFooter>\n {nodes\n .filter(\n (node) =>\n \"type\" in node.attributes && node.attributes.type === \"submit\",\n )\n .map((node, k) => (\n <Node key={k} node={node} />\n ))}\n </Card.SettingsSectionFooter>\n </OryFormSection>\n )\n}\n\nconst getScriptNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"id\" in node.attributes && node.attributes.id === \"webauthn_script\",\n )\n\nexport function OrySettingsCard() {\n const { flow } = useOryFlow()\n const uniqueGroups = useNodesGroups(flow.ui.nodes)\n const scriptNode = getScriptNode(flow.ui.nodes)\n\n return (\n <>\n <OryCardValidationMessages />\n {scriptNode && <Node node={scriptNode} />}\n {uniqueGroups.entries.map(([group, nodes]) => {\n if (group === UiNodeGroupEnum.Default) {\n return null\n }\n\n return (\n <SettingsSectionContent key={group} group={group} nodes={nodes} />\n )\n })}\n </>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode } from \"@ory/client-fetch\"\nimport { useComponents } from \"../../context\"\nimport { useIntl } from \"react-intl\"\nimport { useFormContext } from \"react-hook-form\"\n\nconst getLinkButtons = (nodes: UiNode[]): UiNode[] =>\n nodes.filter(\n (node) => \"name\" in node.attributes && node.attributes.name === \"link\",\n )\n\nconst getUnlinkButtons = (nodes: UiNode[]): UiNode[] =>\n nodes.filter(\n (node) => \"name\" in node.attributes && node.attributes.name === \"unlink\",\n )\n\nexport interface HeadlessSettingsOidcProps {\n nodes: UiNode[]\n}\n\nexport function OrySettingsOidc({ nodes }: HeadlessSettingsOidcProps) {\n const { Card, Form } = useComponents()\n const intl = useIntl()\n const { setValue } = useFormContext()\n\n const linkButtons = getLinkButtons(nodes).map((node) => ({\n ...node,\n onClick: () => {\n if (node.attributes.node_type === \"input\") {\n setValue(\"link\", node.attributes.value)\n setValue(\"method\", \"oidc\")\n }\n },\n }))\n const unlinkButtons = getUnlinkButtons(nodes).map((node) => ({\n ...node,\n onClick: () => {\n if (node.attributes.node_type === \"input\") {\n setValue(\"unlink\", node.attributes.value)\n setValue(\"method\", \"oidc\")\n }\n },\n }))\n\n return (\n <>\n <Card.SettingsSectionContent\n title={intl.formatMessage({ id: \"settings.oidc.title\" })}\n description={intl.formatMessage({ id: \"settings.oidc.description\" })}\n >\n <Form.OidcSettings\n linkButtons={linkButtons}\n unlinkButtons={unlinkButtons}\n />\n </Card.SettingsSectionContent>\n <Card.SettingsSectionFooter\n text={intl.formatMessage({ id: \"settings.oidc.info\" })}\n ></Card.SettingsSectionFooter>\n </>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n UiNode,\n UiNodeAttributes,\n UiNodeInputAttributes,\n} from \"@ory/client-fetch\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { useComponents } from \"../../context\"\nimport { triggerToWindowCall } from \"../../util/ui\"\nimport { Node } from \"../form/nodes/node\"\n\nconst getTriggerNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"passkey_register_trigger\",\n )\n\nconst getSettingsNodes = (nodes: UiNode[]): UiNode[] =>\n nodes.filter(\n (node) =>\n \"name\" in node.attributes &&\n (node.attributes.name === \"passkey_settings_register\" ||\n node.attributes.name === \"passkey_create_data\"),\n )\n\nconst getRemoveNodes = (nodes: UiNode[]): UiNode[] =>\n nodes.filter(\n (node) =>\n \"name\" in node.attributes && node.attributes.name === \"passkey_remove\",\n )\n\ninterface HeadlessSettingsPasskeyProps {\n nodes: UiNode[]\n}\n\nexport function OrySettingsPasskey({ nodes }: HeadlessSettingsPasskeyProps) {\n const { Card, Form } = useComponents()\n const intl = useIntl()\n const { setValue } = useFormContext()\n\n const triggerButton = getTriggerNode(nodes)\n const settingsNodes = getSettingsNodes(nodes)\n const removeNodes = getRemoveNodes(nodes)\n\n if (!triggerButton) {\n return null\n }\n\n const {\n onclick: _onClick,\n onclickTrigger,\n ...triggerAttributes\n } = triggerButton.attributes as UiNodeInputAttributes\n\n const onTriggerClick = () => {\n triggerToWindowCall(onclickTrigger)\n }\n\n const removePasskeyHandler = (value: string) => {\n return () => {\n setValue(\"passkey_remove\", value)\n setValue(\"method\", \"passkey\")\n }\n }\n\n return (\n <>\n <Card.SettingsSectionContent\n title={intl.formatMessage({ id: \"settings.passkey.title\" })}\n description={intl.formatMessage({\n id: \"settings.passkey.description\",\n })}\n >\n {settingsNodes.map((node, i) => (\n <Node key={`passkey-settings-nodes-${i}`} node={node} />\n ))}\n <Form.PasskeySettings\n triggerButton={{\n ...triggerButton,\n attributes: triggerAttributes as UiNodeAttributes,\n onClick: onTriggerClick,\n }}\n removeButtons={removeNodes.map((node) => ({\n ...node,\n onClick:\n node.attributes.node_type === \"input\"\n ? removePasskeyHandler(node.attributes.value as string)\n : () => {},\n }))}\n />\n </Card.SettingsSectionContent>\n <Card.SettingsSectionFooter\n text={intl.formatMessage({ id: \"settings.passkey.info\" })}\n ></Card.SettingsSectionFooter>\n </>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n UiNode,\n UiNodeInputAttributes,\n UiNodeTextAttributes,\n} from \"@ory/client-fetch\"\nimport { useIntl } from \"react-intl\"\nimport { useComponents } from \"../../context\"\nimport { useFormContext } from \"react-hook-form\"\n\nconst getRegenerateNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"lookup_secret_regenerate\",\n )\n\nconst getRevealNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"lookup_secret_reveal\",\n )\n\nconst getRecoveryCodes = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"id\" in node.attributes && node.attributes.id === \"lookup_secret_codes\",\n )\n\nconst getDisableNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"lookup_secret_disable\",\n )\n\nconst getConfirmNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"lookup_secret_confirm\",\n )\n\ninterface HeadlessSettingsRecoveryCodesProps {\n nodes: UiNode[]\n}\n\nexport function OrySettingsRecoveryCodes({\n nodes,\n}: HeadlessSettingsRecoveryCodesProps) {\n const { Card, Form, Node } = useComponents()\n const intl = useIntl()\n\n const codesNode = getRecoveryCodes(nodes)\n const revealNode = getRevealNode(nodes)\n const regenerateNode = getRegenerateNode(nodes)\n const disableNode = getDisableNode(nodes)\n const confirmNode = getConfirmNode(nodes)\n const { setValue } = useFormContext()\n\n const codesContext =\n ((codesNode?.attributes as UiNodeTextAttributes)?.text.context as {\n secrets?: { text: string }[]\n }) ?? {}\n const secrets = codesContext.secrets\n ? codesContext.secrets.map((i) => i.text)\n : []\n\n const onRegenerate = () => {\n if (regenerateNode?.attributes.node_type === \"input\") {\n setValue(regenerateNode?.attributes.name, \"true\")\n setValue(\"method\", \"lookup_secret\")\n }\n }\n\n const onReveal = () => {\n if (revealNode?.attributes.node_type === \"input\") {\n setValue(revealNode?.attributes.name, \"true\")\n setValue(\"method\", \"lookup_secret\")\n }\n }\n\n const footerNode = disableNode ?? regenerateNode ?? confirmNode\n\n return (\n <>\n <Card.SettingsSectionContent\n title={intl.formatMessage({ id: \"settings.lookup_secret.title\" })}\n description={intl.formatMessage({\n id: \"settings.lookup_secret.description\",\n })}\n >\n <Form.RecoveryCodesSettings\n codes={secrets}\n revealButton={revealNode}\n regnerateButton={regenerateNode}\n onRegenerate={onRegenerate}\n onReveal={onReveal}\n />\n </Card.SettingsSectionContent>\n <Card.SettingsSectionFooter>\n {footerNode && (\n <Node.Button\n node={footerNode}\n attributes={footerNode.attributes as UiNodeInputAttributes}\n />\n )}\n </Card.SettingsSectionFooter>\n </>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { UiNode, UiNodeInputAttributes } from \"@ory/client-fetch\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { useComponents } from \"../../context\"\n\nconst getQrCodeNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) => \"id\" in node.attributes && node.attributes.id === \"totp_qr\",\n )\n\nconst getTotpSecretNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"id\" in node.attributes && node.attributes.id === \"totp_secret_key\",\n )\n\nconst getTotpInputNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) => \"name\" in node.attributes && node.attributes.name === \"totp_code\",\n )\n\nconst getTotpUnlinkInput = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes && node.attributes.name === \"totp_unlink\",\n )\n\nconst getTotpLinkButton = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) => \"name\" in node.attributes && node.attributes.name === \"method\",\n )\n\ninterface HeadlessSettingsTotpProps {\n nodes: UiNode[]\n}\n\nexport function OrySettingsTotp({ nodes }: HeadlessSettingsTotpProps) {\n const { Card, Form, Node } = useComponents()\n const intl = useIntl()\n const { setValue } = useFormContext()\n\n const totpUnlink = getTotpUnlinkInput(nodes)\n const qrNode = getQrCodeNode(nodes)\n const secretNode = getTotpSecretNode(nodes)\n const totpCodeNode = getTotpInputNode(nodes)\n const totpLinkButton = getTotpLinkButton(nodes)\n\n const handleUnlink = () => {\n if (totpUnlink?.attributes.node_type === \"input\") {\n setValue(totpUnlink.attributes.name, totpUnlink.attributes.value)\n setValue(\"method\", \"totp\")\n }\n }\n\n return (\n <>\n <Card.SettingsSectionContent\n title={intl.formatMessage({ id: \"settings.totp.title\" })}\n description={intl.formatMessage({ id: \"settings.totp.description\" })}\n >\n <Form.TotpSettings\n totpImage={qrNode}\n totpSecret={secretNode}\n totpInput={totpCodeNode}\n totpUnlink={totpUnlink}\n onUnlink={handleUnlink}\n />\n </Card.SettingsSectionContent>\n <Card.SettingsSectionFooter\n text={\n totpUnlink\n ? intl.formatMessage({ id: \"settings.totp.info.linked\" })\n : intl.formatMessage({ id: \"settings.totp.info.not-linked\" })\n }\n >\n {totpLinkButton && (\n <Node.Button\n node={totpLinkButton}\n attributes={totpLinkButton.attributes as UiNodeInputAttributes}\n />\n )}\n </Card.SettingsSectionFooter>\n </>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n UiNode,\n UiNodeAttributes,\n UiNodeInputAttributes,\n} from \"@ory/client-fetch\"\nimport { useFormContext } from \"react-hook-form\"\nimport { useIntl } from \"react-intl\"\nimport { useComponents } from \"../../context\"\nimport { triggerToWindowCall } from \"../../util/ui\"\nimport { Node } from \"../form/nodes/node\"\n\nconst getInputNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"webauthn_register_displayname\",\n )\n\nconst getTriggerNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes &&\n node.attributes.name === \"webauthn_register_trigger\",\n )\n\nconst getRemoveButtons = (nodes: UiNode[]): UiNode[] =>\n nodes.filter(\n (node) =>\n \"name\" in node.attributes && node.attributes.name === \"webauthn_remove\",\n )\n\nconst getRegisterNode = (nodes: UiNode[]): UiNode | undefined =>\n nodes.find(\n (node) =>\n \"name\" in node.attributes && node.attributes.name === \"webauthn_register\",\n )\n\ninterface HeadlessSettingsWebauthnProps {\n nodes: UiNode[]\n}\n\nexport function OrySettingsWebauthn({ nodes }: HeadlessSettingsWebauthnProps) {\n const { Card, Form } = useComponents()\n const intl = useIntl()\n const { setValue } = useFormContext()\n\n const triggerButton = getTriggerNode(nodes)\n const inputNode = getInputNode(nodes)\n const removeButtons = getRemoveButtons(nodes)\n const registerNode = getRegisterNode(nodes)\n\n if (!inputNode || !triggerButton) {\n return null\n }\n\n const {\n onclick: _onClick,\n onclickTrigger,\n ...triggerAttributes\n } = triggerButton.attributes as UiNodeInputAttributes\n\n const onTriggerClick = () => {\n triggerToWindowCall(onclickTrigger)\n }\n const removeWebauthnKeyHandler = (value: string) => {\n return () => {\n setValue(\"webauthn_remove\", value)\n setValue(\"method\", \"webauthn\")\n }\n }\n\n return (\n <>\n <Card.SettingsSectionContent\n title={intl.formatMessage({ id: \"settings.webauthn.title\" })}\n description={intl.formatMessage({\n id: \"settings.webauthn.description\",\n })}\n >\n <Form.WebauthnSettings\n nameInput={inputNode}\n triggerButton={{\n ...triggerButton,\n attributes: triggerAttributes as UiNodeAttributes,\n onClick: onTriggerClick,\n }}\n removeButtons={removeButtons.map((node) => ({\n ...node,\n onClick:\n node.attributes.node_type === \"input\"\n ? removeWebauthnKeyHandler(node.attributes.value as string)\n : () => {},\n }))}\n />\n {registerNode && <Node node={registerNode} />}\n </Card.SettingsSectionContent>\n <Card.SettingsSectionFooter\n text={intl.formatMessage({ id: \"settings.webauthn.info\" })}\n ></Card.SettingsSectionFooter>\n </>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { PropsWithChildren } from \"react\"\n\nimport { OryFlowComponents } from \"../components\"\nimport { OryFlowContainer } from \"../util/flowContainer\"\nimport { OryComponentProvider } from \"./component\"\nimport { OryFlowProvider } from \"./flow-context\"\nimport { IntlProvider } from \"./intl-context\"\n\nexport type OryProviderProps = {\n components: OryFlowComponents\n} & OryFlowContainer &\n PropsWithChildren\n\nexport function OryProvider({\n children,\n components: Components,\n ...oryFlowProps\n}: OryProviderProps) {\n return (\n <IntlProvider\n locale={oryFlowProps.config.intl?.locale ?? \"en\"}\n customTranslations={oryFlowProps.config.intl?.customTranslations}\n >\n <OryFlowProvider {...oryFlowProps}>\n <OryComponentProvider components={Components}>\n {children}\n </OryComponentProvider>\n </OryFlowProvider>\n </IntlProvider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport { NodeProps } from \"./node\"\nimport { useComponents } from \"../../../context\"\nimport { triggerToWindowCall } from \"../../../util/ui\"\nimport {\n UiNodeInputAttributes,\n UiNodeInputAttributesTypeEnum,\n} from \"@ory/client-fetch\"\nimport { MouseEventHandler, ReactNode, useEffect, useRef } from \"react\"\nimport { useFormContext } from \"react-hook-form\"\n\nexport const NodeInput = ({\n node,\n attributes,\n}: NodeProps & {\n attributes: UiNodeInputAttributes\n onClick?: MouseEventHandler\n}): ReactNode => {\n const { Node } = useComponents()\n const { setValue } = useFormContext()\n\n const {\n onloadTrigger: onloadTrigger,\n onclickTrigger,\n // These properties do not exist on input fields so we remove them (as we already have handled them).\n onclick: _ignoredOnclick,\n onload: _ignoredOnload,\n //\n ...attrs\n } = attributes\n const isResendNode = node.meta.label?.id === 1070008\n const isScreenSelectionNode =\n \"name\" in node.attributes && node.attributes.name === \"screen\"\n\n const setFormValue = () => {\n if (attrs.value && !(isResendNode || isScreenSelectionNode)) {\n setValue(attrs.name, attrs.value)\n }\n }\n\n const hasRun = useRef(false)\n useEffect(\n () => {\n setFormValue()\n if (!hasRun.current && onloadTrigger) {\n hasRun.current = true\n triggerToWindowCall(onloadTrigger)\n }\n },\n // TODO(jonas): make sure onloadTrigger is stable\n // eslint-disable-next-line react-hooks/exhaustive-deps -- ignore onloadTrigger for now, until we make sure this is stable\n [],\n )\n\n const handleClick: MouseEventHandler = () => {\n setFormValue()\n if (onclickTrigger) {\n triggerToWindowCall(onclickTrigger)\n }\n }\n\n const isSocial =\n (attrs.name === \"provider\" || attrs.name === \"link\") &&\n node.group === \"oidc\"\n const isPinCodeInput =\n (attrs.name === \"code\" && node.group === \"code\") ||\n (attrs.name === \"totp_code\" && node.group === \"totp\")\n\n switch (attributes.type) {\n case UiNodeInputAttributesTypeEnum.Submit:\n case UiNodeInputAttributesTypeEnum.Button:\n if (isSocial) {\n return null\n }\n if (isResendNode || isScreenSelectionNode) {\n return null\n }\n\n return (\n <Node.Label\n // The label is rendered in the button component\n attributes={{ ...attrs, label: undefined }}\n node={{ ...node, meta: { ...node.meta, label: undefined } }}\n >\n <Node.Button attributes={attrs} node={node} onClick={handleClick} />\n </Node.Label>\n )\n case UiNodeInputAttributesTypeEnum.DatetimeLocal:\n throw new Error(\"Not implemented\")\n case UiNodeInputAttributesTypeEnum.Checkbox:\n return (\n <Node.Label\n // The label is rendered in the checkbox component\n attributes={{ ...attrs, label: undefined }}\n node={{ ...node, meta: { ...node.meta, label: undefined } }}\n >\n <Node.Checkbox attributes={attrs} node={node} onClick={handleClick} />\n </Node.Label>\n )\n case UiNodeInputAttributesTypeEnum.Hidden:\n return <Node.Input attributes={attrs} node={node} onClick={handleClick} />\n default:\n if (isPinCodeInput) {\n return (\n <Node.Label attributes={attrs} node={node}>\n <Node.CodeInput\n attributes={attrs}\n node={node}\n onClick={handleClick}\n />\n </Node.Label>\n )\n }\n\n return (\n <Node.Label attributes={attrs} node={node}>\n <Node.Input attributes={attrs} node={node} onClick={handleClick} />\n </Node.Label>\n )\n }\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n OryFlowComponentOverrides,\n OryFlowComponents,\n} from \"@ory/elements-react\"\nimport {\n DefaultCard,\n DefaultCardContent,\n DefaultCardFooter,\n DefaultCardHeader,\n DefaultCardLogo,\n} from \"./card\"\nimport { DefaultAuthMethodListItem } from \"./card/auth-method-list-item\"\nimport {\n DefaultFormContainer,\n DefaultMessage,\n DefaultMessageContainer,\n} from \"./form\"\nimport { DefaultButton } from \"./form/button\"\nimport { DefaultCheckbox } from \"./form/checkbox\"\nimport { DefaultGroupContainer } from \"./form/group-container\"\nimport { DefaultHorizontalDivider } from \"./form/horizontal-divider\"\nimport { DefaultImage } from \"./form/image\"\nimport { DefaultInput } from \"./form/input\"\nimport { DefaultLabel } from \"./form/label\"\nimport { DefaultLinkButton } from \"./form/link-button\"\nimport { DefaultPinCodeInput } from \"./form/pin-code-input\"\nimport {\n DefaultFormSection,\n DefaultFormSectionContent,\n DefaultFormSectionFooter,\n} from \"./form/section\"\nimport {\n DefaultButtonSocial,\n DefaultSocialButtonContainer,\n} from \"./form/social\"\nimport { DefaultText } from \"./form/text\"\nimport { DefaultPageHeader } from \"./generic/page-header\"\nimport { DefaultSettingsOidc } from \"./settings/settings-oidc\"\nimport { DefaultSettingsPasskey } from \"./settings/settings-passkey\"\nimport { DefaultSettingsRecoveryCodes } from \"./settings/settings-recovery-codes\"\nimport { DefaultSettingsTotp } from \"./settings/settings-totp\"\nimport { DefaultSettingsWebauthn } from \"./settings/settings-webauthn\"\nimport { DefaultAuthMethodListContainer } from \"./card/auth-method-list-container\"\nimport { DefaultCaptcha } from \"./form/captcha\"\n\nexport function getOryComponents(\n overrides?: OryFlowComponentOverrides,\n): OryFlowComponents {\n // Yes, this could probably be easier by using lodash or a custom merge function.\n // But, this makes it very explicit what can be overridden, and does not introduce issues with merging nested fields.\n return {\n Card: {\n Root: overrides?.Card?.Root ?? DefaultCard,\n Footer: overrides?.Card?.Footer ?? DefaultCardFooter,\n Header: overrides?.Card?.Header ?? DefaultCardHeader,\n Content: overrides?.Card?.Content ?? DefaultCardContent,\n Logo: overrides?.Card?.Logo ?? DefaultCardLogo,\n Divider: overrides?.Card?.Divider ?? DefaultHorizontalDivider,\n AuthMethodListContainer:\n overrides?.Card?.AuthMethodListContainer ??\n DefaultAuthMethodListContainer,\n AuthMethodListItem:\n overrides?.Card?.AuthMethodListItem ?? DefaultAuthMethodListItem,\n SettingsSection: overrides?.Card?.SettingsSection ?? DefaultFormSection,\n SettingsSectionContent:\n overrides?.Card?.SettingsSectionContent ?? DefaultFormSectionContent,\n SettingsSectionFooter:\n overrides?.Card?.SettingsSectionFooter ?? DefaultFormSectionFooter,\n },\n Node: {\n Button: overrides?.Node?.Button ?? DefaultButton,\n OidcButton: overrides?.Node?.OidcButton ?? DefaultButtonSocial,\n Input: overrides?.Node?.Input ?? DefaultInput,\n CodeInput: overrides?.Node?.CodeInput ?? DefaultPinCodeInput,\n Image: overrides?.Node?.Image ?? DefaultImage,\n Label: overrides?.Node?.Label ?? DefaultLabel,\n Checkbox: overrides?.Node?.Checkbox ?? DefaultCheckbox,\n Text: overrides?.Node?.Text ?? DefaultText,\n Anchor: overrides?.Node?.Anchor ?? DefaultLinkButton,\n Captcha: overrides?.Node?.Captcha ?? DefaultCaptcha,\n },\n Form: {\n Root: overrides?.Form?.Root ?? DefaultFormContainer,\n Group: overrides?.Form?.Group ?? DefaultGroupContainer,\n OidcRoot: overrides?.Form?.OidcRoot ?? DefaultSocialButtonContainer,\n RecoveryCodesSettings:\n overrides?.Form?.RecoveryCodesSettings ?? DefaultSettingsRecoveryCodes,\n TotpSettings: overrides?.Form?.TotpSettings ?? DefaultSettingsTotp,\n OidcSettings: overrides?.Form?.OidcSettings ?? DefaultSettingsOidc,\n WebauthnSettings:\n overrides?.Form?.WebauthnSettings ?? DefaultSettingsWebauthn,\n PasskeySettings:\n overrides?.Form?.PasskeySettings ?? DefaultSettingsPasskey,\n },\n Message: {\n Root: overrides?.Message?.Root ?? DefaultMessageContainer,\n Content: overrides?.Message?.Content ?? DefaultMessage,\n },\n Page: {\n Header: overrides?.Page?.Header ?? DefaultPageHeader,\n },\n }\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { FlowError } from \"@ory/client-fetch\"\nimport {\n OryClientConfiguration,\n OryFlowComponentOverrides,\n} from \"@ory/elements-react\"\nimport { PropsWithChildren } from \"react\"\n\nexport type ErrorFlowContextProps = {\n error: FlowError\n components?: OryFlowComponentOverrides\n config: OryClientConfiguration\n}\n\nexport function Error({\n error,\n children,\n}: PropsWithChildren<ErrorFlowContextProps>) {\n return (\n <div data-testid={\"ory/screen/error/raw\"}>\n {JSON.stringify(error) || children}\n </div>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { FlowType, LoginFlow } from \"@ory/client-fetch\"\nimport {\n OryClientConfiguration,\n OryFlowComponentOverrides,\n OryProvider,\n OryTwoStepCard,\n} from \"@ory/elements-react\"\nimport { PropsWithChildren } from \"react\"\nimport { getOryComponents } from \"../components\"\n\nexport type LoginFlowContextProps = {\n flow: LoginFlow\n components?: OryFlowComponentOverrides\n config: OryClientConfiguration\n}\n\nexport function Login({\n flow,\n config,\n children,\n components: flowOverrideComponents,\n}: PropsWithChildren<LoginFlowContextProps>) {\n const components = getOryComponents(flowOverrideComponents)\n return (\n <OryProvider\n config={config}\n flow={flow}\n flowType={FlowType.Login}\n components={components}\n >\n {children ?? <OryTwoStepCard />}\n </OryProvider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { FlowType, RecoveryFlow } from \"@ory/client-fetch\"\nimport {\n OryClientConfiguration,\n OryFlowComponentOverrides,\n OryProvider,\n OryTwoStepCard,\n} from \"@ory/elements-react\"\nimport { PropsWithChildren } from \"react\"\nimport { getOryComponents } from \"../components\"\n\nexport type RecoveryFlowContextProps = {\n flow: RecoveryFlow\n components?: OryFlowComponentOverrides\n config: OryClientConfiguration\n}\n\nexport function Recovery({\n flow,\n config,\n children,\n components: flowOverrideComponents,\n}: PropsWithChildren<RecoveryFlowContextProps>) {\n const components = getOryComponents(flowOverrideComponents)\n return (\n <OryProvider\n config={config}\n flow={flow}\n flowType={FlowType.Recovery}\n components={components}\n >\n {children ?? <OryTwoStepCard />}\n </OryProvider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { FlowType, RegistrationFlow } from \"@ory/client-fetch\"\nimport {\n OryClientConfiguration,\n OryFlowComponentOverrides,\n OryProvider,\n OryTwoStepCard,\n} from \"@ory/elements-react\"\nimport { PropsWithChildren } from \"react\"\nimport { getOryComponents } from \"../components\"\n\ntype RegistrationFlowContextProps = {\n flow: RegistrationFlow\n components?: OryFlowComponentOverrides\n config: OryClientConfiguration\n}\n\nexport function Registration({\n flow,\n children,\n components: flowOverrideComponents,\n config,\n}: PropsWithChildren<RegistrationFlowContextProps>) {\n const components = getOryComponents(flowOverrideComponents)\n return (\n <OryProvider\n config={config}\n flow={flow}\n flowType={FlowType.Registration}\n components={components}\n >\n {children ?? <OryTwoStepCard />}\n </OryProvider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { FlowType, SettingsFlow } from \"@ory/client-fetch\"\nimport {\n HeadlessPageHeader,\n OryClientConfiguration,\n OryFlowComponentOverrides,\n OryProvider,\n OrySettingsCard,\n} from \"@ory/elements-react\"\nimport { PropsWithChildren } from \"react\"\nimport { getOryComponents } from \"../components\"\n\nexport type SettingsFlowContextProps = {\n flow: SettingsFlow\n components?: OryFlowComponentOverrides\n config: OryClientConfiguration\n}\n\nexport function Settings({\n flow,\n config,\n children,\n components: flowOverrideComponents,\n}: PropsWithChildren<SettingsFlowContextProps>) {\n const components = getOryComponents(flowOverrideComponents)\n\n return (\n <OryProvider\n config={config}\n flow={flow}\n flowType={FlowType.Settings}\n components={components}\n >\n {children ?? (\n <>\n <HeadlessPageHeader />\n <OrySettingsCard />\n </>\n )}\n </OryProvider>\n )\n}\n","// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\n\"use client\"\nimport { FlowType, VerificationFlow } from \"@ory/client-fetch\"\nimport {\n OryClientConfiguration,\n OryFlowComponentOverrides,\n OryProvider,\n OryTwoStepCard,\n} from \"@ory/elements-react\"\nimport { PropsWithChildren } from \"react\"\nimport { getOryComponents } from \"../components\"\n\nexport type VerificationFlowContextProps = {\n flow: VerificationFlow\n components?: OryFlowComponentOverrides\n config: OryClientConfiguration\n}\n\nexport function Verification({\n flow,\n config,\n children,\n components: flowOverrideComponents,\n}: PropsWithChildren<VerificationFlowContextProps>) {\n const components = getOryComponents(flowOverrideComponents)\n return (\n <OryProvider\n config={config}\n flow={flow}\n flowType={FlowType.Verification}\n components={components}\n >\n {children ?? <OryTwoStepCard />}\n </O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,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AACd,GAAoD;AAClD,QAAM,aAAa,iBAAiB,sBAAsB;AAC1D,SACE,gBAAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,UAAUC,WAAS;AAAA,MACnB;AAAA,MAEC,wCAAY,gBAAAF,MAACG,iBAAA,EAAe;AAAA;AAAA,EAC/B;AAEJ;","names":["React","jsx","jsxs","jsx","jsxs","UiNodeGroupEnum","jsx","fn","UiNodeGroupEnum","_a","jsx","jsxs","jsxs","jsx","useComponents","useOryFlow","FlowType","isUiNodeInputAttributes","useIntl","FlowType","useOryFlow","React","jsx","jsx","jsxs","useOryFlow","FlowType","initFlowUrl","jsx","jsxs","useComponents","useOryFlow","useOryFlow","jsx","jsx","jsx","jsxs","useIntl","uiTextToFormattedMessage","useOryFlow","FlowType","useOryFlow","useFormContext","useIntl","React","jsx","React","jsx","React","jsx","jsxs","React","jsx","jsxs","React","jsx","jsxs","React","jsx","React","jsx","jsxs","React","jsx","jsxs","React","jsx","jsxs","React","jsx","jsxs","React","jsx","jsxs","React","jsx","jsxs","React","jsx","jsxs","React","jsx","jsx","jsxs","Fragment","jsx","jsxs","logos","useOryFlow","useIntl","useFormContext","node","jsx","useOryFlow","FlowType","useIntl","uiTextToFormattedMessage","useIntl","React","jsx","React","jsx","React","jsx","React","jsx","React","jsx","React","jsx","jsx","jsxs","useIntl","uiTextToFormattedMessage","useFormContext","useIntl","useEffect","jsx","jsxs","useIntl","useFormContext","uiTextToFormattedMessage","getNodeLabel","messageTestId","uiTextToFormattedMessage","useIntl","useIntl","uiTextToFormattedMessage","Fragment","jsx","useIntl","uiTextToFormattedMessage","jsx","jsxs","useIntl","getNodeLabel","messageTestId","uiTextToFormattedMessage","jsx","jsx","jsx","FlowType","getNodeLabel","uiTextToFormattedMessage","useOryFlow","useState","useFormContext","useIntl","React","jsx","React","jsx","jsxs","jsx","jsxs","getNodeLabel","useFormContext","useIntl","useOryFlow","uiTextToFormattedMessage","FlowType","useState","FlowType","getNodeLabel","messageTestId","uiTextToFormattedMessage","useComponents","useOryFlow","useFormContext","useIntl","jsx","jsxs","useIntl","getNodeLabel","useComponents","useOryFlow","useFormContext","messageTestId","uiTextToFormattedMessage","FlowType","getNodeLabel","uiTextToFormattedMessage","useIntl","jsx","useIntl","getNodeLabel","uiTextToFormattedMessage","useFormContext","React","jsx","jsxs","useOryFlow","FlowType","jsx","useFormContext","useOryFlow","FlowType","jsx","jsxs","uiTextToFormattedMessage","useIntl","Fragment","jsx","jsxs","useComponents","DropdownMenuLabel","useEffect","useState","useOryFlow","React","jsx","React","jsx","jsxs","forwardRef","jsx","forwardRef","jsx","forwardRef","React","jsx","jsx","forwardRef","jsx","jsxs","useOryFlow","useState","useEffect","DropdownMenuLabel","jsx","jsxs","useComponents","useEffect","useFormContext","useDebounceValue","React","jsx","jsx","jsxs","useDebounceValue","useFormContext","useEffect","useComponents","useFormContext","jsx","jsxs","useFormContext","Node","useComponents","React","jsx","React","jsx","useFormContext","Fragment","jsx","jsxs","useComponents","React","jsx","useFormContext","jsx","jsxs","Node","useComponents","useFormContext","useComponents","React","jsx","useFormContext","jsx","jsxs","useFormContext","Node","useComponents","jsx","isUiNodeInputAttributes","useRef","useFormContext","createContext","useContext","useState","FlowType","FlowType","UiNodeGroupEnum","jsx","createContext","jsx","UiNodeGroupEnum","useForm","isUiNodeInputAttributes","isUiNodeInputAttributes","jsx","jsx","jsx","jsx","UiNodeGroupEnum","useFormContext","FlowType","isUiNodeInputAttributes","useFormContext","useIntl","FlowType","useFormContext","FlowType","FlowType","handleFlowError","FlowType","handleContinueWith","handleFlowError","FlowType","handleContinueWith","handleFlowError","loginUrl","FlowType","handleFlowError","Fragment","jsx","jsxs","jsx","isUiNodeAnchorAttributes","isUiNodeImageAttributes","isUiNodeInputAttributes","isUiNodeScriptAttributes","UiNodeGroupEnum","jsx","useFormContext","jsx","Fragment","jsx","jsxs","jsx","useFormContext","jsx","jsx","jsx","UiNodeGroupEnum","useIntl","useIntl","useFormContext","Fragment","jsx","jsxs","useFormContext","useIntl","Fragment","jsx","jsxs","useIntl","useFormContext","Fragment","jsx","jsxs","useFormContext","useIntl","Fragment","jsx","jsxs","useFormContext","useIntl","Fragment","jsx","jsxs","Fragment","jsx","jsxs","jsx","jsx","useEffect","useRef","useFormContext","jsx","Node","jsx","useFormContext","useRef","isUiNodeInputAttributes","jsx","Error","FlowType","OryTwoStepCard","jsx","FlowType","OryTwoStepCard","FlowType","OryProvider","OryTwoStepCard","jsx","OryProvider","FlowType","OryTwoStepCard","FlowType","OryProvider","OryTwoStepCard","jsx","OryProvider","FlowType","OryTwoStepCard","FlowType","OryProvider","Fragment","jsx","jsxs","OryProvider","FlowType","FlowType","OryProvider","OryTwoStepCard","jsx","OryProvider","FlowType","OryTwoStepCard"]}
|