@ory/elements-react 0.0.0-pr.4a28a8f → 0.0.0-pr.6b3fe62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -187,13 +187,16 @@ function nodesToAuthMethodGroups(nodes, excludeAuthMethods = []) {
187
187
  ].includes(group)
188
188
  );
189
189
  }
190
- function useNodesGroups(nodes) {
190
+ function useNodesGroups(nodes, { omit } = {}) {
191
191
  const groupSorter = useGroupSorter();
192
192
  const groups = useMemo(() => {
193
193
  var _a;
194
194
  const groups2 = {};
195
195
  for (const node of nodes) {
196
- if (node.type === "script") {
196
+ if ((omit == null ? void 0 : omit.includes("script")) && isUiNodeScriptAttributes(node.attributes)) {
197
+ continue;
198
+ }
199
+ if ((omit == null ? void 0 : omit.includes("input_hidden")) && isUiNodeInputAttributes(node.attributes) && node.attributes.type === "hidden") {
197
200
  continue;
198
201
  }
199
202
  const groupNodes = (_a = groups2[node.group]) != null ? _a : [];
@@ -261,6 +264,8 @@ function parseStateFromFlow(flow) {
261
264
  break;
262
265
  case FlowType.Settings:
263
266
  return { current: "settings" };
267
+ case FlowType.OAuth2Consent:
268
+ return { current: "method_active", method: "oauth2_consent" };
264
269
  }
265
270
  console.warn(
266
271
  `[Ory/Elements React] Encountered an unknown form state on ${flow.flowType} flow with ID ${flow.flow.id}`
@@ -374,6 +379,22 @@ function computeDefaultValues(nodes) {
374
379
  if (attrs.name === "method" || attrs.type === "submit" || typeof attrs.value === "undefined") {
375
380
  return acc;
376
381
  }
382
+ if (attrs.name.startsWith("grant_scope")) {
383
+ const scope = attrs.value;
384
+ if (Array.isArray(acc.grant_scope)) {
385
+ return {
386
+ ...acc,
387
+ // We want to have all scopes accepted by default, so that the user has to actively uncheck them.
388
+ grant_scope: [...acc.grant_scope, scope]
389
+ };
390
+ } else if (!acc.grant_scope) {
391
+ return {
392
+ ...acc,
393
+ grant_scope: [scope]
394
+ };
395
+ }
396
+ return acc;
397
+ }
377
398
  return unrollTrait(
378
399
  {
379
400
  name: attrs.name,
@@ -823,6 +844,19 @@ function useOryFormSubmit(onAfterSubmit) {
823
844
  });
824
845
  break;
825
846
  }
847
+ case FlowType.OAuth2Consent: {
848
+ const response = await fetch(flowContainer.flow.ui.action, {
849
+ method: "POST",
850
+ body: JSON.stringify(data),
851
+ headers: {
852
+ "Content-Type": "application/json"
853
+ }
854
+ });
855
+ const oauth2Success = await response.json();
856
+ if (oauth2Success.redirect_to && typeof oauth2Success.redirect_to === "string") {
857
+ onRedirect(oauth2Success.redirect_to);
858
+ }
859
+ }
826
860
  }
827
861
  if ("password" in data) {
828
862
  methods.setValue("password", "");
@@ -837,7 +871,11 @@ function useOryFormSubmit(onAfterSubmit) {
837
871
  };
838
872
  return onSubmit;
839
873
  }
840
- function OryForm({ children, onAfterSubmit }) {
874
+ function OryForm({
875
+ children,
876
+ onAfterSubmit,
877
+ "data-testid": dataTestId
878
+ }) {
841
879
  const { Form } = useComponents();
842
880
  const flowContainer = useOryFlow();
843
881
  const methods = useFormContext();
@@ -865,7 +903,7 @@ function OryForm({ children, onAfterSubmit }) {
865
903
  }),
866
904
  type: "error"
867
905
  };
868
- return /* @__PURE__ */ jsxs(Fragment, { children: [
906
+ return /* @__PURE__ */ jsxs("div", { "data-testid": dataTestId, children: [
869
907
  /* @__PURE__ */ jsx(Message.Root, { children: /* @__PURE__ */ jsx(Message.Content, { message: m }, m.id) }),
870
908
  /* @__PURE__ */ jsx(OryCardFooter, {})
871
909
  ] });
@@ -876,6 +914,7 @@ function OryForm({ children, onAfterSubmit }) {
876
914
  return /* @__PURE__ */ jsx(
877
915
  Form.Root,
878
916
  {
917
+ "data-testid": dataTestId,
879
918
  action: flowContainer.flow.ui.action,
880
919
  method: flowContainer.flow.ui.method,
881
920
  onSubmit: (e) => void methods.handleSubmit(onSubmit)(e),
@@ -910,7 +949,7 @@ var NodeInput = ({
910
949
  }) => {
911
950
  var _a;
912
951
  const { Node: Node2 } = useComponents();
913
- const { setValue } = useFormContext();
952
+ const { setValue, watch } = useFormContext();
914
953
  const {
915
954
  onloadTrigger,
916
955
  onclickTrigger,
@@ -923,7 +962,10 @@ var NodeInput = ({
923
962
  const isResendNode = ((_a = node.meta.label) == null ? void 0 : _a.id) === 1070008;
924
963
  const isScreenSelectionNode = "name" in node.attributes && node.attributes.name === "screen";
925
964
  const setFormValue = () => {
926
- if (attrs.value && !(isResendNode || isScreenSelectionNode)) {
965
+ if (isResendNode || isScreenSelectionNode || node.group === UiNodeGroupEnum.Oauth2Consent) {
966
+ return;
967
+ }
968
+ if (attrs.value !== void 0) {
927
969
  setValue(attrs.name, attrs.value);
928
970
  }
929
971
  };
@@ -948,6 +990,19 @@ var NodeInput = ({
948
990
  };
949
991
  const isSocial = (attrs.name === "provider" || attrs.name === "link") && (node.group === UiNodeGroupEnum.Oidc || node.group === UiNodeGroupEnum.Saml);
950
992
  const isPinCodeInput = attrs.name === "code" && node.group === "code" || attrs.name === "totp_code" && node.group === "totp";
993
+ const handleScopeChange = (checked) => {
994
+ const scopes = watch("grant_scope");
995
+ if (Array.isArray(scopes)) {
996
+ if (checked) {
997
+ setValue("grant_scope", Array.from(/* @__PURE__ */ new Set([...scopes, attrs.value])));
998
+ } else {
999
+ setValue(
1000
+ "grant_scope",
1001
+ scopes.filter((scope) => scope !== attrs.value)
1002
+ );
1003
+ }
1004
+ }
1005
+ };
951
1006
  switch (attributes.type) {
952
1007
  case UiNodeInputAttributesTypeEnum.Submit:
953
1008
  case UiNodeInputAttributesTypeEnum.Button:
@@ -957,6 +1012,9 @@ var NodeInput = ({
957
1012
  if (isResendNode || isScreenSelectionNode) {
958
1013
  return null;
959
1014
  }
1015
+ if (node.group === "oauth2_consent") {
1016
+ return null;
1017
+ }
960
1018
  return /* @__PURE__ */ jsx(
961
1019
  Node2.Label,
962
1020
  {
@@ -968,6 +1026,21 @@ var NodeInput = ({
968
1026
  case UiNodeInputAttributesTypeEnum.DatetimeLocal:
969
1027
  throw new Error("Not implemented");
970
1028
  case UiNodeInputAttributesTypeEnum.Checkbox:
1029
+ if (node.group === "oauth2_consent" && node.attributes.node_type === "input") {
1030
+ switch (node.attributes.name) {
1031
+ case "grant_scope":
1032
+ return /* @__PURE__ */ jsx(
1033
+ Node2.ConsentScopeCheckbox,
1034
+ {
1035
+ attributes: attrs,
1036
+ node,
1037
+ onCheckedChange: handleScopeChange
1038
+ }
1039
+ );
1040
+ default:
1041
+ return null;
1042
+ }
1043
+ }
971
1044
  return /* @__PURE__ */ jsx(
972
1045
  Node2.Label,
973
1046
  {
@@ -1056,11 +1129,13 @@ function OryFormSocialButtonsForm() {
1056
1129
  const {
1057
1130
  flow: { ui }
1058
1131
  } = useOryFlow();
1059
- const filteredNodes = ui.nodes.filter((node) => node.group === UiNodeGroupEnum.Saml || node.group === UiNodeGroupEnum.Oidc);
1132
+ const filteredNodes = ui.nodes.filter(
1133
+ (node) => node.group === UiNodeGroupEnum.Saml || node.group === UiNodeGroupEnum.Oidc
1134
+ );
1060
1135
  if (filteredNodes.length === 0) {
1061
1136
  return null;
1062
1137
  }
1063
- return /* @__PURE__ */ jsx(OryFormProvider, { children: /* @__PURE__ */ jsx(OryForm, { children: /* @__PURE__ */ jsx(OryFormOidcButtons, {}) }) });
1138
+ return /* @__PURE__ */ jsx(OryFormProvider, { children: /* @__PURE__ */ jsx(OryForm, { "data-testid": `ory/form/methods/oidc-saml`, children: /* @__PURE__ */ jsx(OryFormOidcButtons, {}) }) });
1064
1139
  }
1065
1140
  function isUINodeGroupEnum(method) {
1066
1141
  return Object.values(UiNodeGroupEnum).includes(method);
@@ -1072,11 +1147,14 @@ function OryTwoStepCard() {
1072
1147
  const { ui } = flow;
1073
1148
  const nodeSorter = useNodeSorter();
1074
1149
  const sortNodes = (a, b) => nodeSorter(a, b, { flowType });
1075
- const uniqueGroups = useNodesGroups(ui.nodes);
1076
- const options = Object.fromEntries(
1150
+ const groupsToShow = useNodesGroups(ui.nodes, {
1151
+ // We only want to render groups that have visible elements.
1152
+ omit: ["script", "input_hidden"]
1153
+ });
1154
+ const authMethodBlocks = Object.fromEntries(
1077
1155
  Object.values(UiNodeGroupEnum).filter((group) => {
1078
1156
  var _a2;
1079
- return (_a2 = uniqueGroups.groups[group]) == null ? void 0 : _a2.length;
1157
+ return (_a2 = groupsToShow.groups[group]) == null ? void 0 : _a2.length;
1080
1158
  }).filter(
1081
1159
  (group) => ![
1082
1160
  UiNodeGroupEnum.Oidc,
@@ -1088,7 +1166,17 @@ function OryTwoStepCard() {
1088
1166
  ].includes(group)
1089
1167
  ).map((g) => [g, {}])
1090
1168
  );
1091
- if (UiNodeGroupEnum.Code in options) {
1169
+ const authMethodAdditionalNodes = ui.nodes.filter(
1170
+ ({ group }) => [
1171
+ UiNodeGroupEnum.Oidc,
1172
+ UiNodeGroupEnum.Saml,
1173
+ UiNodeGroupEnum.Default,
1174
+ UiNodeGroupEnum.IdentifierFirst,
1175
+ UiNodeGroupEnum.Profile,
1176
+ UiNodeGroupEnum.Captcha
1177
+ ].includes(group)
1178
+ );
1179
+ if (UiNodeGroupEnum.Code in authMethodBlocks) {
1092
1180
  let identifier = (_b = (_a = findNode(ui.nodes, {
1093
1181
  group: "identifier_first",
1094
1182
  node_type: "input",
@@ -1100,7 +1188,7 @@ function OryTwoStepCard() {
1100
1188
  name: "address"
1101
1189
  })) == null ? void 0 : _c.attributes) == null ? void 0 : _d.value);
1102
1190
  if (identifier) {
1103
- options[UiNodeGroupEnum.Code] = {
1191
+ authMethodBlocks[UiNodeGroupEnum.Code] = {
1104
1192
  title: {
1105
1193
  id: "identities.messages.1010023",
1106
1194
  values: { address: identifier }
@@ -1109,7 +1197,7 @@ function OryTwoStepCard() {
1109
1197
  }
1110
1198
  }
1111
1199
  const nonSsoNodes = removeSsoNodes(ui.nodes);
1112
- const finalNodes = formState.current === "method_active" ? getFinalNodes(uniqueGroups.groups, formState.method) : [];
1200
+ const finalNodes = formState.current === "method_active" ? getFinalNodes(groupsToShow.groups, formState.method) : [];
1113
1201
  const handleAfterFormSubmit = (method) => {
1114
1202
  if (typeof method !== "string" || !isUINodeGroupEnum(method)) {
1115
1203
  return;
@@ -1138,39 +1226,49 @@ function OryTwoStepCard() {
1138
1226
  /* @__PURE__ */ jsxs(OryCardContent, { children: [
1139
1227
  /* @__PURE__ */ jsx(OryCardValidationMessages, {}),
1140
1228
  showSso && /* @__PURE__ */ jsx(OryFormSocialButtonsForm, {}),
1141
- /* @__PURE__ */ jsxs(OryForm, { onAfterSubmit: handleAfterFormSubmit, children: [
1142
- /* @__PURE__ */ jsxs(Form.Group, { children: [
1143
- formState.current === "provide_identifier" && /* @__PURE__ */ jsxs(Fragment, { children: [
1144
- showSsoDivider && /* @__PURE__ */ jsx(Card.Divider, {}),
1145
- nonSsoNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1146
- ] }),
1147
- formState.current === "select_method" && /* @__PURE__ */ jsxs(Fragment, { children: [
1148
- /* @__PURE__ */ jsx(Card.Divider, {}),
1149
- /* @__PURE__ */ jsx(
1150
- AuthMethodList,
1151
- {
1152
- options,
1153
- setSelectedGroup: (group) => dispatchFormState({
1154
- type: "action_select_method",
1155
- method: group
1156
- })
1157
- }
1158
- ),
1159
- ui.nodes.filter((n) => n.group === UiNodeGroupEnum.Captcha).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1160
- ] }),
1161
- formState.current === "method_active" && /* @__PURE__ */ jsxs(Fragment, { children: [
1162
- ui.nodes.filter((n) => n.type === "script").map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k)),
1163
- finalNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1164
- ] })
1165
- ] }),
1166
- /* @__PURE__ */ jsx(OryCardFooter, {})
1167
- ] })
1229
+ /* @__PURE__ */ jsxs(
1230
+ OryForm,
1231
+ {
1232
+ "data-testid": `ory/form/methods/local`,
1233
+ onAfterSubmit: handleAfterFormSubmit,
1234
+ children: [
1235
+ formState.current === "provide_identifier" && /* @__PURE__ */ jsxs(Form.Group, { children: [
1236
+ showSsoDivider && /* @__PURE__ */ jsx(Card.Divider, {}),
1237
+ nonSsoNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1238
+ ] }),
1239
+ formState.current === "select_method" && /* @__PURE__ */ jsxs(Form.Group, { children: [
1240
+ Object.entries(authMethodBlocks).length > 0 && /* @__PURE__ */ jsx(Card.Divider, {}),
1241
+ Object.entries(authMethodBlocks).length > 0 && /* @__PURE__ */ jsx(
1242
+ AuthMethodList,
1243
+ {
1244
+ options: authMethodBlocks,
1245
+ setSelectedGroup: (group) => dispatchFormState({
1246
+ type: "action_select_method",
1247
+ method: group
1248
+ })
1249
+ }
1250
+ ),
1251
+ authMethodAdditionalNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1252
+ ] }),
1253
+ formState.current === "method_active" && /* @__PURE__ */ jsxs(Form.Group, { children: [
1254
+ ui.nodes.filter(
1255
+ (n) => isUiNodeScriptAttributes(n.attributes) || n.group === UiNodeGroupEnum.Captcha
1256
+ ).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k)),
1257
+ finalNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1258
+ ] }),
1259
+ /* @__PURE__ */ jsx(OryCardFooter, {})
1260
+ ]
1261
+ }
1262
+ )
1168
1263
  ] })
1169
1264
  ] });
1170
1265
  }
1171
1266
  function AuthMethodList({ options, setSelectedGroup }) {
1172
1267
  const { Card } = useComponents();
1173
1268
  const { setValue, getValues } = useFormContext();
1269
+ if (Object.entries(options).length === 0) {
1270
+ return null;
1271
+ }
1174
1272
  const handleClick = (group, options2) => {
1175
1273
  var _a, _b, _c, _d;
1176
1274
  if (isGroupImmediateSubmit(group)) {
@@ -1230,6 +1328,19 @@ function OryFormSectionInner({
1230
1328
  }
1231
1329
  );
1232
1330
  }
1331
+ function OryConsentCard() {
1332
+ const { Form, Card } = useComponents();
1333
+ const flow = useOryFlow();
1334
+ return /* @__PURE__ */ jsxs(OryCard, { children: [
1335
+ /* @__PURE__ */ jsx(OryCardHeader, {}),
1336
+ /* @__PURE__ */ jsx(OryCardContent, { children: /* @__PURE__ */ jsxs(OryForm, { children: [
1337
+ /* @__PURE__ */ jsx(Card.Divider, {}),
1338
+ /* @__PURE__ */ jsx(Form.Group, { children: flow.flow.ui.nodes.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k)) }),
1339
+ /* @__PURE__ */ jsx(Card.Divider, {}),
1340
+ /* @__PURE__ */ jsx(OryCardFooter, {})
1341
+ ] }) })
1342
+ ] });
1343
+ }
1233
1344
  function OryFormGroupDivider() {
1234
1345
  const { Card } = useComponents();
1235
1346
  const {
@@ -1583,16 +1694,19 @@ function SettingsSectionContent({ group, nodes }) {
1583
1694
  const { Card } = useComponents();
1584
1695
  const intl = useIntl();
1585
1696
  const { flow } = useOryFlow();
1586
- const uniqueGroups = useNodesGroups(flow.ui.nodes);
1697
+ const groupedNodes = useNodesGroups(flow.ui.nodes, {
1698
+ // Script nodes are already handled by the parent component.
1699
+ omit: ["script"]
1700
+ });
1587
1701
  if (group === UiNodeGroupEnum.Totp) {
1588
1702
  return /* @__PURE__ */ jsxs(
1589
1703
  OryFormSection,
1590
1704
  {
1591
- nodes: uniqueGroups.groups.totp,
1705
+ nodes: groupedNodes.groups.totp,
1592
1706
  "data-testid": "ory/screen/settings/group/totp",
1593
1707
  children: [
1594
- /* @__PURE__ */ jsx(OrySettingsTotp, { nodes: (_a = uniqueGroups.groups.totp) != null ? _a : [] }),
1595
- (_b = uniqueGroups.groups.default) == null ? void 0 : _b.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1708
+ /* @__PURE__ */ jsx(OrySettingsTotp, { nodes: (_a = groupedNodes.groups.totp) != null ? _a : [] }),
1709
+ (_b = groupedNodes.groups.default) == null ? void 0 : _b.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1596
1710
  ]
1597
1711
  }
1598
1712
  );
@@ -1601,16 +1715,16 @@ function SettingsSectionContent({ group, nodes }) {
1601
1715
  return /* @__PURE__ */ jsxs(
1602
1716
  OryFormSection,
1603
1717
  {
1604
- nodes: uniqueGroups.groups.lookup_secret,
1718
+ nodes: groupedNodes.groups.lookup_secret,
1605
1719
  "data-testid": "ory/screen/settings/group/lookup_secret",
1606
1720
  children: [
1607
1721
  /* @__PURE__ */ jsx(
1608
1722
  OrySettingsRecoveryCodes,
1609
1723
  {
1610
- nodes: (_c = uniqueGroups.groups.lookup_secret) != null ? _c : []
1724
+ nodes: (_c = groupedNodes.groups.lookup_secret) != null ? _c : []
1611
1725
  }
1612
1726
  ),
1613
- (_d = uniqueGroups.groups.default) == null ? void 0 : _d.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1727
+ (_d = groupedNodes.groups.default) == null ? void 0 : _d.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1614
1728
  ]
1615
1729
  }
1616
1730
  );
@@ -1619,11 +1733,11 @@ function SettingsSectionContent({ group, nodes }) {
1619
1733
  return /* @__PURE__ */ jsxs(
1620
1734
  OryFormSection,
1621
1735
  {
1622
- nodes: uniqueGroups.groups.oidc,
1736
+ nodes: groupedNodes.groups.oidc,
1623
1737
  "data-testid": "ory/screen/settings/group/oidc",
1624
1738
  children: [
1625
- /* @__PURE__ */ jsx(OrySettingsOidc, { nodes: (_e = uniqueGroups.groups.oidc) != null ? _e : [] }),
1626
- (_f = uniqueGroups.groups.default) == null ? void 0 : _f.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1739
+ /* @__PURE__ */ jsx(OrySettingsOidc, { nodes: (_e = groupedNodes.groups.oidc) != null ? _e : [] }),
1740
+ (_f = groupedNodes.groups.default) == null ? void 0 : _f.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1627
1741
  ]
1628
1742
  }
1629
1743
  );
@@ -1632,11 +1746,11 @@ function SettingsSectionContent({ group, nodes }) {
1632
1746
  return /* @__PURE__ */ jsxs(
1633
1747
  OryFormSection,
1634
1748
  {
1635
- nodes: uniqueGroups.groups.webauthn,
1749
+ nodes: groupedNodes.groups.webauthn,
1636
1750
  "data-testid": "ory/screen/settings/group/webauthn",
1637
1751
  children: [
1638
- /* @__PURE__ */ jsx(OrySettingsWebauthn, { nodes: (_g = uniqueGroups.groups.webauthn) != null ? _g : [] }),
1639
- (_h = uniqueGroups.groups.default) == null ? void 0 : _h.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1752
+ /* @__PURE__ */ jsx(OrySettingsWebauthn, { nodes: (_g = groupedNodes.groups.webauthn) != null ? _g : [] }),
1753
+ (_h = groupedNodes.groups.default) == null ? void 0 : _h.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1640
1754
  ]
1641
1755
  }
1642
1756
  );
@@ -1645,11 +1759,11 @@ function SettingsSectionContent({ group, nodes }) {
1645
1759
  return /* @__PURE__ */ jsxs(
1646
1760
  OryFormSection,
1647
1761
  {
1648
- nodes: uniqueGroups.groups.passkey,
1762
+ nodes: groupedNodes.groups.passkey,
1649
1763
  "data-testid": "ory/screen/settings/group/passkey",
1650
1764
  children: [
1651
- /* @__PURE__ */ jsx(OrySettingsPasskey, { nodes: (_i = uniqueGroups.groups.passkey) != null ? _i : [] }),
1652
- (_j = uniqueGroups.groups.default) == null ? void 0 : _j.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1765
+ /* @__PURE__ */ jsx(OrySettingsPasskey, { nodes: (_i = groupedNodes.groups.passkey) != null ? _i : [] }),
1766
+ (_j = groupedNodes.groups.default) == null ? void 0 : _j.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1653
1767
  ]
1654
1768
  }
1655
1769
  );
@@ -1670,7 +1784,7 @@ function SettingsSectionContent({ group, nodes }) {
1670
1784
  id: `settings.${group}.description`
1671
1785
  }),
1672
1786
  children: [
1673
- (_k = uniqueGroups.groups.default) == null ? void 0 : _k.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k)),
1787
+ (_k = groupedNodes.groups.default) == null ? void 0 : _k.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k)),
1674
1788
  nodes.filter(
1675
1789
  (node) => "type" in node.attributes && node.attributes.type !== "submit"
1676
1790
  ).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
@@ -1684,16 +1798,16 @@ function SettingsSectionContent({ group, nodes }) {
1684
1798
  }
1685
1799
  );
1686
1800
  }
1687
- var getScriptNode = (nodes) => nodes.find(
1688
- (node) => "id" in node.attributes && node.attributes.id === "webauthn_script"
1801
+ var onlyScriptNodes = (nodes) => nodes.filter(
1802
+ (node) => isUiNodeScriptAttributes(node.attributes) && node.attributes.id === "webauthn_script"
1689
1803
  );
1690
1804
  function OrySettingsCard() {
1691
1805
  const { flow } = useOryFlow();
1692
- const uniqueGroups = useNodesGroups(flow.ui.nodes);
1693
- const scriptNode = getScriptNode(flow.ui.nodes);
1806
+ const uniqueGroups = useNodesGroups(flow.ui.nodes, { omit: ["script"] });
1807
+ const scriptNodes = onlyScriptNodes(flow.ui.nodes);
1694
1808
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1695
1809
  /* @__PURE__ */ jsx(OryCardValidationMessages, {}),
1696
- scriptNode && /* @__PURE__ */ jsx(Node, { node: scriptNode }),
1810
+ scriptNodes.map((n) => /* @__PURE__ */ jsx(Node, { node: n })),
1697
1811
  uniqueGroups.entries.map(([group, nodes]) => {
1698
1812
  if (group === UiNodeGroupEnum.Default) {
1699
1813
  return null;
@@ -2029,6 +2143,20 @@ var en_default = {
2029
2143
  "property.username": "username",
2030
2144
  "property.identifier": "identifier",
2031
2145
  "property.code": "code",
2146
+ "consent.title": "Authorize {party}",
2147
+ "consent.subtitle": "A third party application wants to access information associated with your account {identifier}.",
2148
+ "consent.scope.openid.title": "Identity",
2149
+ "consent.scope.openid.description": "Allows the application to verify your identity. This is required for authentication and a trusted login experience.",
2150
+ "consent.scope.offline_access.title": "Offline Access",
2151
+ "consent.scope.offline_access.description": "Allows this application to keep you signed in even when you're not actively using it.",
2152
+ "consent.scope.profile.title": "Profile Information",
2153
+ "consent.scope.profile.description": "Allows access to your basic profile details, including your username, first name, and last name.",
2154
+ "consent.scope.email.title": "Email Address",
2155
+ "consent.scope.email.description": "Retrieve your email address and its verification status.",
2156
+ "consent.scope.address.title": "Physical Address",
2157
+ "consent.scope.address.description": "Access your postal address.",
2158
+ "consent.scope.phone.title": "Phone Number",
2159
+ "consent.scope.phone.description": "Retrieve your phone number and its verification status.",
2032
2160
  "error.title.what-happened": "What happened?",
2033
2161
  "error.title.what-can-i-do": "What can I do?",
2034
2162
  "error.instructions": "Please try again in a few minutes or contact the website operator.",
@@ -2205,7 +2333,7 @@ var de_default = {
2205
2333
  "two-step.code.description": "Ein Best\xE4tigungscode wird an Ihre E-Mail gesendet.",
2206
2334
  "two-step.code.title": "E-Mail-Code",
2207
2335
  "two-step.passkey.description": "Verwenden Sie die Fingerabdruck- oder Gesichtserkennung Ihres Ger\xE4ts",
2208
- "two-step.passkey.title": "Passwort (empfohlen)",
2336
+ "two-step.passkey.title": "Passkey (empfohlen)",
2209
2337
  "two-step.password.description": "Geben Sie Ihr Passwort ein, das mit Ihrem Konto verkn\xFCpft ist",
2210
2338
  "two-step.password.title": "Passwort",
2211
2339
  "two-step.webauthn.title": "Sicherheitsschl\xFCssel",
@@ -2300,6 +2428,20 @@ var de_default = {
2300
2428
  "property.phone": "Telefon",
2301
2429
  "property.code": "Code",
2302
2430
  "property.username": "Benutzername",
2431
+ "consent.title": "Autorisieren {party}",
2432
+ "consent.subtitle": "Eine Drittanbieteranwendung m\xF6chte auf Informationen zugreifen, die mit Ihrem Konto {identifier} verkn\xFCpft sind.",
2433
+ "consent.scope.openid.title": "Identit\xE4t",
2434
+ "consent.scope.openid.description": "Erm\xF6glicht der Anwendung, Ihre Identit\xE4t zu \xFCberpr\xFCfen. Dies ist f\xFCr die Authentifizierung und eine vertrauensw\xFCrdige Login-Erfahrung erforderlich.",
2435
+ "consent.scope.offline_access.title": "Offline-Zugriff",
2436
+ "consent.scope.offline_access.description": "Erm\xF6glicht dieser Anwendung, Sie angemeldet zu lassen, auch wenn Sie sie nicht aktiv nutzen.",
2437
+ "consent.scope.profile.title": "Profilinformationen",
2438
+ "consent.scope.profile.description": "Erm\xF6glicht den Zugriff auf Ihre grundlegenden Profildetails, einschlie\xDFlich Ihres Benutzernamens, Vornamens und Nachnamens.",
2439
+ "consent.scope.email.title": "E-Mail-Adresse",
2440
+ "consent.scope.email.description": "Erm\xF6glicht den Abruf Ihrer E-Mail-Adresse und deren \xDCberpr\xFCfungsstatus.",
2441
+ "consent.scope.address.title": "Physische Adresse",
2442
+ "consent.scope.address.description": "Erm\xF6glicht den Zugriff auf Ihre Postanschrift.",
2443
+ "consent.scope.phone.title": "Telefonnummer",
2444
+ "consent.scope.phone.description": "Erm\xF6glicht den Abruf Ihrer Telefonnummer und deren \xDCberpr\xFCfungsstatus.",
2303
2445
  "error.title.what-happened": "Was ist passiert?",
2304
2446
  "error.footer.copy": "Kopieren",
2305
2447
  "error.footer.text": "Bitte f\xFCgen Sie bei der Meldung dieses Fehlers die folgenden Informationen hinzu:",
@@ -2571,6 +2713,20 @@ var es_default = {
2571
2713
  "property.password": "",
2572
2714
  "property.phone": "",
2573
2715
  "property.username": "",
2716
+ "consent.title": "Autorizar {party}",
2717
+ "consent.subtitle": "Una aplicaci\xF3n de terceros quiere acceder a la informaci\xF3n asociada a su cuenta {identifier}.",
2718
+ "consent.scope.openid.title": "Identidad",
2719
+ "consent.scope.openid.description": "Permite que la aplicaci\xF3n verifique su identidad. Esto es necesario para la autenticaci\xF3n y una experiencia de inicio de sesi\xF3n confiable.",
2720
+ "consent.scope.offline_access.title": "Acceso sin conexi\xF3n",
2721
+ "consent.scope.offline_access.description": "Permite que esta aplicaci\xF3n le mantenga conectado incluso cuando no la est\xE9 utilizando activamente.",
2722
+ "consent.scope.profile.title": "Informaci\xF3n del perfil",
2723
+ "consent.scope.profile.description": "Permite el acceso a los detalles b\xE1sicos de su perfil, incluyendo su nombre de usuario, nombre y apellido.",
2724
+ "consent.scope.email.title": "Direcci\xF3n de correo electr\xF3nico",
2725
+ "consent.scope.email.description": "Recupere su direcci\xF3n de correo electr\xF3nico y su estado de verificaci\xF3n.",
2726
+ "consent.scope.address.title": "Direcci\xF3n f\xEDsica",
2727
+ "consent.scope.address.description": "Acceda a su direcci\xF3n postal.",
2728
+ "consent.scope.phone.title": "N\xFAmero de tel\xE9fono",
2729
+ "consent.scope.phone.description": "Recupere su n\xFAmero de tel\xE9fono y su estado de verificaci\xF3n.",
2574
2730
  "error.action.go-back": "",
2575
2731
  "error.footer.copy": "",
2576
2732
  "error.footer.text": "",
@@ -2842,6 +2998,20 @@ var fr_default = {
2842
2998
  "property.password": "",
2843
2999
  "property.phone": "",
2844
3000
  "property.username": "",
3001
+ "consent.title": "Autoriser {party}",
3002
+ "consent.subtitle": "Une application tierce souhaite acc\xE9der aux informations associ\xE9es \xE0 votre compte {identifier}.",
3003
+ "consent.scope.openid.title": "Identit\xE9",
3004
+ "consent.scope.openid.description": "Permet \xE0 l'application de v\xE9rifier votre identit\xE9. Cela est n\xE9cessaire pour l'authentification et une exp\xE9rience de connexion fiable.",
3005
+ "consent.scope.offline_access.title": "Acc\xE8s hors ligne",
3006
+ "consent.scope.offline_access.description": "Permet \xE0 cette application de vous maintenir connect\xE9 m\xEAme lorsque vous ne l'utilisez pas activement.",
3007
+ "consent.scope.profile.title": "Informations de profil",
3008
+ "consent.scope.profile.description": "Permet l'acc\xE8s aux d\xE9tails de base de votre profil, y compris votre nom d'utilisateur, pr\xE9nom et nom.",
3009
+ "consent.scope.email.title": "Adresse e-mail",
3010
+ "consent.scope.email.description": "R\xE9cup\xE8re votre adresse e-mail et son statut de v\xE9rification.",
3011
+ "consent.scope.address.title": "Adresse physique",
3012
+ "consent.scope.address.description": "Acc\xE8de \xE0 votre adresse postale.",
3013
+ "consent.scope.phone.title": "Num\xE9ro de t\xE9l\xE9phone",
3014
+ "consent.scope.phone.description": "R\xE9cup\xE8re votre num\xE9ro de t\xE9l\xE9phone et son statut de v\xE9rification.",
2845
3015
  "error.action.go-back": "",
2846
3016
  "error.footer.copy": "",
2847
3017
  "error.footer.text": "",
@@ -3113,6 +3283,20 @@ var nl_default = {
3113
3283
  "property.password": "",
3114
3284
  "property.phone": "",
3115
3285
  "property.username": "",
3286
+ "consent.title": "Autoriseren {party}",
3287
+ "consent.subtitle": "Een derde partij applicatie wil toegang tot informatie die aan uw account {identifier} is gekoppeld.",
3288
+ "consent.scope.openid.title": "Identiteit",
3289
+ "consent.scope.openid.description": "Stelt de applicatie in staat uw identiteit te verifi\xEBren. Dit is vereist voor authenticatie en een betrouwbare inlogervaring.",
3290
+ "consent.scope.offline_access.title": "Offline toegang",
3291
+ "consent.scope.offline_access.description": "Stelt deze applicatie in staat u ingelogd te houden, zelfs wanneer u deze niet actief gebruikt.",
3292
+ "consent.scope.profile.title": "Profielinformatie",
3293
+ "consent.scope.profile.description": "Geeft toegang tot uw basisprofielgegevens, inclusief uw gebruikersnaam, voornaam en achternaam.",
3294
+ "consent.scope.email.title": "E-mailadres",
3295
+ "consent.scope.email.description": "Haal uw e-mailadres en de verificatiestatus ervan op.",
3296
+ "consent.scope.address.title": "Fysiek adres",
3297
+ "consent.scope.address.description": "Toegang tot uw postadres.",
3298
+ "consent.scope.phone.title": "Telefoonnummer",
3299
+ "consent.scope.phone.description": "Haal uw telefoonnummer en de verificatiestatus ervan op.",
3116
3300
  "error.action.go-back": "",
3117
3301
  "error.footer.copy": "",
3118
3302
  "error.footer.text": "",
@@ -3384,6 +3568,20 @@ var pl_default = {
3384
3568
  "property.phone": "",
3385
3569
  "property.username": "",
3386
3570
  "property.identifier": "",
3571
+ "consent.title": "Autoryzuj {party}",
3572
+ "consent.subtitle": "Aplikacja trzeciej strony chce uzyska\u0107 dost\u0119p do informacji powi\u0105zanych z Twoim kontem {identifier}.",
3573
+ "consent.scope.openid.title": "To\u017Csamo\u015B\u0107",
3574
+ "consent.scope.openid.description": "Pozwala aplikacji zweryfikowa\u0107 Twoj\u0105 to\u017Csamo\u015B\u0107. Jest to wymagane do uwierzytelniania i zapewnienia zaufanej sesji logowania.",
3575
+ "consent.scope.offline_access.title": "Dost\u0119p offline",
3576
+ "consent.scope.offline_access.description": "Pozwala aplikacji utrzyma\u0107 Twoje logowanie, nawet gdy nie korzystasz z niej aktywnie.",
3577
+ "consent.scope.profile.title": "Informacje profilowe",
3578
+ "consent.scope.profile.description": "Pozwala na dost\u0119p do podstawowych danych profilowych, w tym nazwy u\u017Cytkownika, imienia i nazwiska.",
3579
+ "consent.scope.email.title": "Adres e-mail",
3580
+ "consent.scope.email.description": "Pobierz sw\xF3j adres e-mail oraz status jego weryfikacji.",
3581
+ "consent.scope.address.title": "Adres fizyczny",
3582
+ "consent.scope.address.description": "Dost\u0119p do Twojego adresu pocztowego.",
3583
+ "consent.scope.phone.title": "Numer telefonu",
3584
+ "consent.scope.phone.description": "Pobierz sw\xF3j numer telefonu oraz status jego weryfikacji.",
3387
3585
  "error.action.go-back": "",
3388
3586
  "error.footer.copy": "",
3389
3587
  "error.footer.text": "",
@@ -3655,6 +3853,20 @@ var pt_default = {
3655
3853
  "property.password": "",
3656
3854
  "property.phone": "",
3657
3855
  "property.username": "",
3856
+ "consent.title": "Autorizar {party}",
3857
+ "consent.subtitle": "Um aplicativo de terceiros deseja acessar as informa\xE7\xF5es associadas \xE0 sua conta {identifier}.",
3858
+ "consent.scope.openid.title": "Identidade",
3859
+ "consent.scope.openid.description": "Permite que a aplica\xE7\xE3o verifique sua identidade. Isso \xE9 necess\xE1rio para a autentica\xE7\xE3o e uma experi\xEAncia de login confi\xE1vel.",
3860
+ "consent.scope.offline_access.title": "Acesso Offline",
3861
+ "consent.scope.offline_access.description": "Permite que este aplicativo mantenha voc\xEA conectado mesmo quando n\xE3o estiver usando-o ativamente.",
3862
+ "consent.scope.profile.title": "Informa\xE7\xF5es do Perfil",
3863
+ "consent.scope.profile.description": "Permite o acesso aos detalhes b\xE1sicos do seu perfil, incluindo seu nome de usu\xE1rio, primeiro nome e sobrenome.",
3864
+ "consent.scope.email.title": "Endere\xE7o de E-mail",
3865
+ "consent.scope.email.description": "Recupere seu endere\xE7o de e-mail e seu status de verifica\xE7\xE3o.",
3866
+ "consent.scope.address.title": "Endere\xE7o F\xEDsico",
3867
+ "consent.scope.address.description": "Acesse seu endere\xE7o postal.",
3868
+ "consent.scope.phone.title": "N\xFAmero de Telefone",
3869
+ "consent.scope.phone.description": "Recupere seu n\xFAmero de telefone e seu status de verifica\xE7\xE3o.",
3658
3870
  "error.action.go-back": "",
3659
3871
  "error.footer.copy": "",
3660
3872
  "error.footer.text": "",
@@ -3926,6 +4138,20 @@ var sv_default = {
3926
4138
  "property.username": "anv\xE4ndarnamn",
3927
4139
  "property.identifier": "identifier",
3928
4140
  "property.code": "kod",
4141
+ "consent.title": "Auktorisera {party}",
4142
+ "consent.subtitle": "En tredjepartsapplikation vill f\xE5 tillg\xE5ng till information kopplad till ditt konto {identifier}.",
4143
+ "consent.scope.openid.title": "Identitet",
4144
+ "consent.scope.openid.description": "G\xF6r det m\xF6jligt f\xF6r applikationen att verifiera din identitet. Detta kr\xE4vs f\xF6r autentisering och en p\xE5litlig inloggningsupplevelse.",
4145
+ "consent.scope.offline_access.title": "Offline-\xE5tkomst",
4146
+ "consent.scope.offline_access.description": "G\xF6r det m\xF6jligt f\xF6r denna applikation att h\xE5lla dig inloggad \xE4ven n\xE4r du inte aktivt anv\xE4nder den.",
4147
+ "consent.scope.profile.title": "Profilinformation",
4148
+ "consent.scope.profile.description": "Ger tillg\xE5ng till dina grundl\xE4ggande profiluppgifter, inklusive ditt anv\xE4ndarnamn, f\xF6rnamn och efternamn.",
4149
+ "consent.scope.email.title": "E-postadress",
4150
+ "consent.scope.email.description": "H\xE4mta din e-postadress och dess verifieringsstatus.",
4151
+ "consent.scope.address.title": "Fysisk adress",
4152
+ "consent.scope.address.description": "F\xE5 \xE5tkomst till din postadress.",
4153
+ "consent.scope.phone.title": "Telefonnummer",
4154
+ "consent.scope.phone.description": "H\xE4mta ditt telefonnummer och dess verifieringsstatus.",
3929
4155
  "error.action.go-back": "",
3930
4156
  "error.footer.copy": "",
3931
4157
  "error.footer.text": "",
@@ -3946,6 +4172,6 @@ var OryLocales = {
3946
4172
  sv: sv_default
3947
4173
  };
3948
4174
 
3949
- export { HeadlessPageHeader, OryCard, OryCardContent, OryCardFooter, OryCardHeader, OryCardValidationMessages, OryForm, OryFormGroupDivider, OryFormGroups, OryFormOidcButtons, OryFormSection, OryFormSocialButtonsForm, OryLocales, OryProvider, OrySettingsCard, OryTwoStepCard, messageTestId, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryFlow };
4175
+ export { HeadlessPageHeader, OryCard, OryCardContent, OryCardFooter, OryCardHeader, OryCardValidationMessages, OryConsentCard, OryForm, OryFormGroupDivider, OryFormGroups, OryFormOidcButtons, OryFormSection, OryFormSocialButtonsForm, OryLocales, OryProvider, OrySettingsCard, OryTwoStepCard, messageTestId, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryFlow };
3950
4176
  //# sourceMappingURL=index.mjs.map
3951
4177
  //# sourceMappingURL=index.mjs.map