@wise/dynamic-flow-client 4.0.0-exp-no-min-16b18aa → 4.0.0-experimental-0afa26a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/build/main.js +1454 -1344
  2. package/build/main.mjs +1488 -1378
  3. package/build/types/index.d.ts +2 -2
  4. package/build/types/revamp/DynamicFormCore.d.ts +11 -0
  5. package/build/types/revamp/domain/components/DecisionComponent.d.ts +1 -0
  6. package/build/types/revamp/domain/components/InstructionsComponent.d.ts +1 -0
  7. package/build/types/revamp/domain/components/ListComponent.d.ts +1 -0
  8. package/build/types/revamp/domain/components/ReviewComponent.d.ts +1 -0
  9. package/build/types/revamp/domain/components/StatusListComponent.d.ts +1 -0
  10. package/build/types/revamp/domain/mappers/layout/listLayoutToComponent.d.ts +3 -3
  11. package/build/types/revamp/domain/mappers/mapStepToComponent.d.ts +2 -1
  12. package/build/types/revamp/domain/mappers/schema/oneOfSchemaToComponent/oneOfSchemaToComponent.d.ts +1 -1
  13. package/build/types/revamp/domain/mappers/schema/tests/test-utils.d.ts +3 -1
  14. package/build/types/revamp/renderers/CoreContainerRenderer.d.ts +1 -6
  15. package/build/types/revamp/renderers/getRenderFunction.d.ts +2 -3
  16. package/build/types/revamp/renderers/mappers/alertComponentToProps.d.ts +2 -1
  17. package/build/types/revamp/renderers/mappers/allOfComponentToProps.d.ts +2 -2
  18. package/build/types/revamp/renderers/mappers/booleanInputComponentToProps.d.ts +2 -1
  19. package/build/types/revamp/renderers/mappers/boxComponentToProps.d.ts +2 -2
  20. package/build/types/revamp/renderers/mappers/buttonComponentToProps.d.ts +2 -1
  21. package/build/types/revamp/renderers/mappers/columnsComponentToProps.d.ts +2 -2
  22. package/build/types/revamp/renderers/mappers/componentToRendererProps.d.ts +11 -9
  23. package/build/types/revamp/renderers/mappers/containerComponentToProps.d.ts +4 -3
  24. package/build/types/revamp/renderers/mappers/dateInputComponentToProps.d.ts +2 -1
  25. package/build/types/revamp/renderers/mappers/decisionComponentToProps.d.ts +2 -1
  26. package/build/types/revamp/renderers/mappers/dividerComponentToProps.d.ts +2 -1
  27. package/build/types/revamp/renderers/mappers/formComponentToProps.d.ts +2 -2
  28. package/build/types/revamp/renderers/mappers/headingComponentToProps.d.ts +2 -1
  29. package/build/types/revamp/renderers/mappers/hiddenComponentToProps.d.ts +2 -1
  30. package/build/types/revamp/renderers/mappers/imageComponentToProps.d.ts +2 -1
  31. package/build/types/revamp/renderers/mappers/instructionsComponentToProps.d.ts +2 -1
  32. package/build/types/revamp/renderers/mappers/integerInputComponentToProps.d.ts +2 -1
  33. package/build/types/revamp/renderers/mappers/listComponentToProps.d.ts +2 -1
  34. package/build/types/revamp/renderers/mappers/loadingIndicatorComponentToProps.d.ts +2 -1
  35. package/build/types/revamp/renderers/mappers/markdownComponentToProps.d.ts +2 -1
  36. package/build/types/revamp/renderers/mappers/modalComponentToProps.d.ts +2 -2
  37. package/build/types/revamp/renderers/mappers/multiSelectComponentToProps.d.ts +2 -1
  38. package/build/types/revamp/renderers/mappers/multiUploadInputComponentToProps.d.ts +2 -1
  39. package/build/types/revamp/renderers/mappers/numberInputComponentToProps.d.ts +2 -1
  40. package/build/types/revamp/renderers/mappers/objectComponentToProps.d.ts +2 -2
  41. package/build/types/revamp/renderers/mappers/paragraphComponentToProps.d.ts +2 -1
  42. package/build/types/revamp/renderers/mappers/repeatableComponentToProps.d.ts +2 -2
  43. package/build/types/revamp/renderers/mappers/reviewComponentToProps.d.ts +2 -1
  44. package/build/types/revamp/renderers/mappers/searchComponentToProps.d.ts +2 -1
  45. package/build/types/revamp/renderers/mappers/selectInputComponentToProps.d.ts +2 -2
  46. package/build/types/revamp/renderers/mappers/statusListComponentToProps.d.ts +2 -1
  47. package/build/types/revamp/renderers/mappers/textInputComponentToProps.d.ts +2 -1
  48. package/build/types/revamp/renderers/mappers/tupleComponentToProps.d.ts +2 -2
  49. package/build/types/revamp/renderers/mappers/uploadInputComponentToProps.d.ts +2 -1
  50. package/build/types/revamp/renderers/mappers/utils/inputComponentToProps.d.ts +1 -0
  51. package/build/types/revamp/renderers/stepComponentToProps.d.ts +3 -3
  52. package/build/types/revamp/test-utils/DynamicFlowWise.d.ts +8 -2
  53. package/build/types/revamp/types.d.ts +12 -16
  54. package/build/types/revamp/utils/type-utils.d.ts +0 -4
  55. package/package.json +20 -20
  56. package/build/cjs.meta.json +0 -23420
  57. package/build/esm.meta.json +0 -23431
  58. package/build/types/revamp/DynamicFragmentCore.d.ts +0 -11
  59. package/build/types/revamp/test-utils/DynamicFragmentWise.d.ts +0 -7
package/build/main.js CHANGED
@@ -143,10 +143,10 @@ var init_clsx = __esm({
143
143
  }
144
144
  });
145
145
 
146
- // ../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.20.1_@types+react@18.3.18_react-dom@18.3.1_reac_mzw7cg6j4wc7ddwlhxck7linn4/node_modules/@wise/art/dist/index-8Fxev6OI.esm.js
146
+ // ../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.22.0_@types+react@18.3.18_react-dom@18.3.1_reac_62coi6aa7fmdhpcz7p72kf3gum/node_modules/@wise/art/dist/index-8Fxev6OI.esm.js
147
147
  var import_react14, import_jsx_runtime11, unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
148
148
  var init_index_8Fxev6OI_esm = __esm({
149
- "../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.20.1_@types+react@18.3.18_react-dom@18.3.1_reac_mzw7cg6j4wc7ddwlhxck7linn4/node_modules/@wise/art/dist/index-8Fxev6OI.esm.js"() {
149
+ "../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.22.0_@types+react@18.3.18_react-dom@18.3.1_reac_62coi6aa7fmdhpcz7p72kf3gum/node_modules/@wise/art/dist/index-8Fxev6OI.esm.js"() {
150
150
  "use strict";
151
151
  init_clsx();
152
152
  import_react14 = require("react");
@@ -439,7 +439,7 @@ var index_exports = {};
439
439
  __export(index_exports, {
440
440
  DynamicFlow: () => DynamicFlow_default,
441
441
  DynamicFlowCoreRevamp: () => DynamicFlowCore,
442
- DynamicFragmentCore: () => DynamicFragmentCore,
442
+ DynamicFormCore: () => DynamicFormCore,
443
443
  JsonSchemaForm: () => JsonSchemaForm_default,
444
444
  Layout: () => DynamicLayout_default,
445
445
  convertStepToLayout: () => convertStepToLayout,
@@ -1430,891 +1430,290 @@ var CoreContainerRenderer = {
1430
1430
  render: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children })
1431
1431
  };
1432
1432
 
1433
- // src/revamp/utils/type-validators.ts
1434
- var isString = (value) => typeof value === "string";
1435
- var isNumber = (value) => typeof value === "number" && !Number.isNaN(value);
1436
- var isInteger = (value) => isNumber(value) && Math.floor(value) === value;
1437
- var isBoolean = (value) => typeof value === "boolean";
1438
- var isObject = (value) => !isNullish(value) && (value == null ? void 0 : value.constructor) === Object;
1439
- var isArray = (value) => Array.isArray(value);
1440
- var isNull = (value) => value === null;
1441
- var isUndefined = (value) => typeof value === "undefined";
1442
- var isNullish = (v) => isNull(v) || isUndefined(v);
1443
- var isFile = (value) => value instanceof File;
1444
-
1445
- // src/revamp/utils/type-utils.ts
1446
- var hasChildren = (component) => "getChildren" in component && typeof component.getChildren === "function";
1447
- var isColumnsComponent = (component) => Object.hasOwnProperty.call(component, "startComponents") && Object.hasOwnProperty.call(component, "endComponents");
1448
- var isHiddenComponent = (component) => "hidden" in component && component.hidden;
1449
- var isRepeatableComponent = (component) => Object.hasOwnProperty.call(component, "editableComponent");
1450
- var isObjectLocalValue = (value) => value != null && typeof value === "object" && !Array.isArray(value) && !(value instanceof File);
1451
- var isArrayLocalValue = (value) => Array.isArray(value);
1452
- var isObjectModel = (model) => model != null && typeof model === "object" && !Array.isArray(model);
1453
- var isArrayModel = (model) => Array.isArray(model);
1454
- var isAllOfSchema = (schema) => "allOf" in schema && !isNullish(schema.allOf);
1455
- var isBooleanSchema = (schema) => "type" in schema && schema.type === "boolean";
1456
- var isBlobSchema = (schema) => "type" in schema && schema.type === "blob";
1457
- var isConstSchema = (schema) => "const" in schema && schema.const !== void 0;
1458
- var isIntegerSchema = (schema) => "type" in schema && schema.type === "integer";
1459
- var isNumberSchema = (schema) => "type" in schema && schema.type === "number";
1460
- var isObjectSchema = (schema) => "type" in schema && schema.type === "object";
1461
- var isOneOfSchema = (schema) => "oneOf" in schema && !isNullish(schema.oneOf);
1462
- var isArraySchema = (schema) => "items" in schema && !isNullish(schema.items);
1463
- var isArrayListSchema = (schema) => "items" in schema && isObject(schema.items) && !isArray(schema.items);
1464
- var isArrayTupleSchema = (schema) => "items" in schema && !isObject(schema.items) && isArray(schema.items);
1465
- var isStringSchema = (schema) => "type" in schema && schema.type === "string";
1466
- var isStringSchemaWithUpload = (schema) => isStringSchema(schema) && schema.format === "base64url";
1467
- var isSchemaWithPersistAsync = (schema) => "persistAsync" in schema && !isNullish(schema.persistAsync);
1468
-
1469
- // src/revamp/renderers/mappers/utils/pick.ts
1470
- function pick(obj, ...keys) {
1471
- const result = {};
1472
- keys.forEach((key) => {
1473
- result[key] = obj[key];
1474
- });
1475
- return result;
1476
- }
1477
-
1478
- // src/revamp/renderers/stepComponentToProps.ts
1479
- var stepComponentToProps = (component, children) => __spreadProps(__spreadValues({
1480
- type: "step"
1481
- }, pick(
1482
- component,
1483
- "back",
1484
- "description",
1485
- "error",
1486
- "external",
1487
- "loadingState",
1488
- "step",
1489
- "title",
1490
- "onAction",
1491
- "trackEvent"
1492
- )), {
1493
- children
1494
- });
1495
-
1496
- // src/revamp/renderers/mappers/alertComponentToProps.ts
1497
- var alertComponentToProps = (component) => pick(component, "type", "callToAction", "context", "control", "margin", "markdown");
1498
-
1499
- // src/revamp/renderers/mappers/allOfComponentToProps.ts
1500
- var allOfComponentToProps = (component, children) => __spreadProps(__spreadValues({
1501
- type: "section"
1502
- }, pick(component, "control", "description", "help", "icon", "image", "title")), {
1503
- children
1504
- });
1505
-
1506
- // src/revamp/renderers/mappers/utils/mapErrorsToValidationState.ts
1507
- var mapErrorsToValidationState = (errors) => {
1508
- if (errors) {
1509
- if (errors.length > 0) {
1510
- return { status: "invalid", message: errors[0] };
1433
+ // src/revamp/renderers/getRenderFunction.tsx
1434
+ var import_jsx_runtime4 = require("react/jsx-runtime");
1435
+ var getRenderFunction = (renderers) => {
1436
+ function ComponentRenderer(props) {
1437
+ const { type } = props;
1438
+ if (type === "hidden") {
1439
+ return null;
1511
1440
  }
1512
- return { status: "valid" };
1441
+ const renderer = renderers.find(
1442
+ ({ canRenderType, canRender = () => true }) => (
1443
+ // once the type is matched, we know the props are of the correct type
1444
+ canRenderType === type && canRender(props)
1445
+ )
1446
+ );
1447
+ if (!renderer) {
1448
+ throw new Error(`Could not find a renderer for ${type}`);
1449
+ }
1450
+ return renderer.render(props);
1513
1451
  }
1514
- return void 0;
1452
+ const render = (props) => {
1453
+ if (!props) {
1454
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, {});
1455
+ }
1456
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ComponentRenderer, __spreadValues({}, props), props.uid);
1457
+ };
1458
+ return render;
1515
1459
  };
1516
1460
 
1517
- // src/revamp/renderers/mappers/utils/inputComponentToProps.ts
1518
- var inputComponentToProps = (component, type) => {
1519
- var _a, _b, _c, _d;
1520
- const {
1521
- control,
1522
- description,
1523
- disabled,
1524
- errors,
1525
- help,
1526
- icon,
1527
- id,
1528
- image,
1529
- placeholder,
1530
- required,
1531
- title,
1532
- validationAsyncState,
1533
- onBlur,
1534
- onFocus
1535
- } = component;
1536
- const { messages } = validationAsyncState != null ? validationAsyncState : {};
1537
- return {
1538
- type,
1539
- control,
1540
- description,
1541
- disabled,
1542
- error: (_a = messages == null ? void 0 : messages.error) != null ? _a : errors == null ? void 0 : errors[0],
1543
- help,
1544
- icon,
1545
- id,
1546
- image: image ? {
1547
- accessibilityDescription: (_b = image.accessibilityDescription) != null ? _b : image.text,
1548
- uri: image.uri,
1549
- url: (_d = (_c = image.uri) != null ? _c : image.url) != null ? _d : ""
1550
- } : void 0,
1551
- placeholder,
1552
- required,
1553
- title,
1554
- validationState: getValidationState(errors, validationAsyncState),
1555
- value: component.getLocalValue(),
1556
- onBlur: onBlur.bind(component),
1557
- onFocus: onFocus.bind(component)
1558
- };
1461
+ // ../types/build/main.mjs
1462
+ var __defProp2 = Object.defineProperty;
1463
+ var __defProps2 = Object.defineProperties;
1464
+ var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
1465
+ var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
1466
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1467
+ var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
1468
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1469
+ var __spreadValues2 = (a, b) => {
1470
+ for (var prop in b || (b = {}))
1471
+ if (__hasOwnProp2.call(b, prop))
1472
+ __defNormalProp2(a, prop, b[prop]);
1473
+ if (__getOwnPropSymbols2)
1474
+ for (var prop of __getOwnPropSymbols2(b)) {
1475
+ if (__propIsEnum2.call(b, prop))
1476
+ __defNormalProp2(a, prop, b[prop]);
1477
+ }
1478
+ return a;
1559
1479
  };
1560
- var getValidationState = (errors, validationAsyncState) => {
1561
- if (validationAsyncState) {
1562
- if (validationAsyncState == null ? void 0 : validationAsyncState.messages.error) {
1563
- return { status: "invalid", message: validationAsyncState == null ? void 0 : validationAsyncState.messages.error };
1480
+ var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
1481
+ var util;
1482
+ (function(util2) {
1483
+ util2.assertEqual = (val) => val;
1484
+ function assertIs(_arg) {
1485
+ }
1486
+ util2.assertIs = assertIs;
1487
+ function assertNever(_x) {
1488
+ throw new Error();
1489
+ }
1490
+ util2.assertNever = assertNever;
1491
+ util2.arrayToEnum = (items) => {
1492
+ const obj = {};
1493
+ for (const item of items) {
1494
+ obj[item] = item;
1564
1495
  }
1565
- if (validationAsyncState == null ? void 0 : validationAsyncState.messages.success) {
1566
- return { status: "valid", message: validationAsyncState == null ? void 0 : validationAsyncState.messages.success };
1496
+ return obj;
1497
+ };
1498
+ util2.getValidEnumValues = (obj) => {
1499
+ const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
1500
+ const filtered = {};
1501
+ for (const k of validKeys) {
1502
+ filtered[k] = obj[k];
1567
1503
  }
1568
- }
1569
- return mapErrorsToValidationState(errors);
1570
- };
1571
-
1572
- // src/revamp/renderers/mappers/booleanInputComponentToProps.ts
1573
- var booleanInputComponentToProps = (component) => {
1574
- var _a;
1575
- return __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-checkbox")), {
1576
- value: (_a = component.value) != null ? _a : false,
1577
- onChange: component.onChange.bind(component)
1578
- });
1579
- };
1580
-
1581
- // src/revamp/renderers/mappers/boxComponentToProps.ts
1582
- var boxComponentToProps = (component, children) => __spreadProps(__spreadValues({}, pick(component, "type", "border", "control", "width", "margin")), {
1583
- children
1584
- });
1585
-
1586
- // src/revamp/renderers/mappers/buttonComponentToProps.ts
1587
- var buttonComponentToProps = (component) => {
1588
- return __spreadValues({
1589
- type: "button"
1590
- }, pick(
1591
- component,
1592
- "title",
1593
- "control",
1594
- "context",
1595
- "disabled",
1596
- "margin",
1597
- "pinOrder",
1598
- "size",
1599
- "onClick"
1600
- ));
1601
- };
1602
-
1603
- // src/revamp/renderers/mappers/columnsComponentToProps.ts
1604
- var columnsComponentToProps = ({ bias, control, margin }, startChildren, endChildren) => ({ type: "columns", bias, control, margin, startChildren, endChildren });
1605
-
1606
- // src/revamp/renderers/mappers/containerComponentToProps.ts
1607
- var containerComponentToProps = (children) => ({
1608
- type: "container",
1609
- children
1610
- });
1611
-
1612
- // src/revamp/renderers/mappers/dateInputComponentToProps.ts
1613
- var dateInputComponentToProps = (component) => __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-date")), {
1614
- autoComplete: component.autoComplete,
1615
- minimumDate: component.minimumDate,
1616
- maximumDate: component.maximumDate,
1617
- onChange: component.onChange.bind(component)
1618
- });
1619
-
1620
- // src/revamp/renderers/mappers/decisionComponentToProps.ts
1621
- var decisionComponentToProps = (component) => __spreadProps(__spreadValues({}, pick(component, "type", "control", "margin", "title")), {
1622
- options: component.options.map((_a) => {
1623
- var _b = _a, { image } = _b, rest = __objRest(_b, ["image"]);
1624
- var _a2, _b2, _c;
1625
- return __spreadProps(__spreadValues({}, rest), {
1626
- image: image ? {
1627
- accessibilityDescription: (_a2 = image.accessibilityDescription) != null ? _a2 : image.text,
1628
- uri: image.uri,
1629
- url: (_c = (_b2 = image.uri) != null ? _b2 : image.url) != null ? _c : ""
1630
- } : image
1504
+ return util2.objectValues(filtered);
1505
+ };
1506
+ util2.objectValues = (obj) => {
1507
+ return util2.objectKeys(obj).map(function(e) {
1508
+ return obj[e];
1631
1509
  });
1632
- })
1633
- });
1634
-
1635
- // src/revamp/renderers/mappers/dividerComponentToProps.ts
1636
- var dividerComponentToProps = (component) => pick(component, "type", "control", "margin");
1637
-
1638
- // src/revamp/renderers/mappers/formComponentToProps.ts
1639
- var formComponentToProps = ({ control, margin }, children) => ({ type: "form", children, control, margin });
1640
-
1641
- // src/revamp/renderers/mappers/headingComponentToProps.ts
1642
- var headingComponentToProps = (component) => pick(component, "type", "align", "control", "margin", "size", "text");
1643
-
1644
- // src/revamp/renderers/mappers/hiddenComponentToProps.ts
1645
- var hiddenComponentToProps = () => ({
1646
- type: "hidden"
1647
- });
1648
-
1649
- // src/revamp/renderers/mappers/imageComponentToProps.ts
1650
- var imageComponentToProps = (component) => {
1651
- var _a;
1652
- return __spreadProps(__spreadValues({}, pick(component, "type", "control", "margin", "size")), {
1653
- accessibilityDescription: component.content.accessibilityDescription,
1654
- url: (_a = component.content.url) != null ? _a : "",
1655
- uri: component.content.uri
1656
- });
1657
- };
1658
-
1659
- // src/revamp/renderers/mappers/instructionsComponentToProps.ts
1660
- var instructionsComponentToProps = (component) => pick(component, "type", "control", "items", "margin", "title");
1661
-
1662
- // src/revamp/renderers/mappers/integerInputComponentToProps.ts
1663
- var integerInputComponentToProps = (component) => __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-integer")), {
1664
- autoComplete: component.autoComplete,
1665
- maximum: component.maximum,
1666
- minimum: component.minimum,
1667
- onChange: component.onChange.bind(component)
1668
- });
1669
-
1670
- // src/revamp/renderers/mappers/loadingIndicatorComponentToProps.ts
1671
- var loadingIndicatorComponentToProps = (component) => pick(component, "type", "control", "margin", "size");
1672
-
1673
- // src/revamp/renderers/mappers/markdownComponentToProps.ts
1674
- var markdownComponentToProps = (control) => pick(control, "type", "align", "margin", "content", "control");
1675
-
1676
- // src/revamp/renderers/mappers/modalComponentToProps.ts
1677
- var modalComponentToProps = ({ content, control, margin, trigger }, components) => ({
1678
- type: "modal",
1679
- content: { components, title: content.title },
1680
- control,
1681
- margin,
1682
- trigger
1683
- });
1684
-
1685
- // src/revamp/renderers/mappers/multiUploadInputComponentToProps.ts
1686
- var multiUploadInputComponentToProps = (component) => {
1687
- const { accepts, files, maxSize, minItems, maxItems, uploadLabel } = component;
1688
- return __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-upload-multi")), {
1689
- accepts,
1690
- maxSize,
1691
- minItems,
1692
- maxItems,
1693
- uploadLabel,
1694
- value: files.map((file) => __spreadProps(__spreadValues({}, file), { validationState: mapErrorsToValidationState(file.errors) })),
1695
- onInsertFile: component.onInsertFile.bind(component),
1696
- onRemoveFile: component.onRemoveFile.bind(component)
1697
- });
1698
- };
1699
-
1700
- // src/revamp/renderers/mappers/numberInputComponentToProps.ts
1701
- var numberInputComponentToProps = (component) => __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-number")), {
1702
- maximum: component.maximum,
1703
- minimum: component.minimum,
1704
- onChange: component.onChange.bind(component)
1705
- });
1706
-
1707
- // src/revamp/renderers/mappers/objectComponentToProps.ts
1708
- var objectComponentToProps = (component, children) => {
1709
- var _a, _b;
1710
- return __spreadProps(__spreadValues({
1711
- type: "section"
1712
- }, pick(component, "control", "description", "help", "icon", "title")), {
1713
- // TODO: Remove when viewbindings are updated
1714
- image: component.image ? __spreadProps(__spreadValues({}, component.image), {
1715
- url: (_b = (_a = component.image) == null ? void 0 : _a.url) != null ? _b : ""
1716
- }) : void 0,
1717
- children
1718
- });
1719
- };
1720
-
1721
- // src/revamp/renderers/mappers/paragraphComponentToProps.ts
1722
- var paragraphComponentToProps = (component) => pick(component, "type", "align", "control", "margin", "text");
1723
-
1724
- // src/revamp/renderers/mappers/repeatableComponentToProps.ts
1725
- var repeatableComponentToProps = (component, children, editableItemChildren) => {
1726
- var _a, _b;
1727
- const {
1728
- addItemTitle,
1729
- control,
1730
- components,
1731
- description,
1732
- editItemTitle,
1733
- errors,
1734
- icon,
1735
- image,
1736
- maxItems,
1737
- minItems,
1738
- summaryDefaults,
1739
- title = "",
1740
- onEdit,
1741
- onAdd,
1742
- onSave,
1743
- onRemove
1744
- } = component;
1745
- const getSummaryImage = (componentSummary) => {
1746
- var _a2, _b2;
1747
- if (componentSummary.image) {
1748
- return __spreadProps(__spreadValues({}, componentSummary.image), {
1749
- url: (_a2 = componentSummary.image.url) != null ? _a2 : ""
1750
- });
1510
+ };
1511
+ util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
1512
+ const keys = [];
1513
+ for (const key in object) {
1514
+ if (Object.prototype.hasOwnProperty.call(object, key)) {
1515
+ keys.push(key);
1516
+ }
1751
1517
  }
1752
- if (summaryDefaults.image) {
1753
- return __spreadProps(__spreadValues({}, summaryDefaults.image), {
1754
- url: (_b2 = summaryDefaults.image.url) != null ? _b2 : ""
1755
- });
1518
+ return keys;
1519
+ };
1520
+ util2.find = (arr, checker) => {
1521
+ for (const item of arr) {
1522
+ if (checker(item))
1523
+ return item;
1756
1524
  }
1525
+ return void 0;
1757
1526
  };
1758
- const getSummary = (componentSummary) => {
1759
- var _a2, _b2, _c;
1760
- return {
1761
- title: (_a2 = componentSummary.title) != null ? _a2 : summaryDefaults.title,
1762
- description: (_b2 = componentSummary.description) != null ? _b2 : summaryDefaults.description,
1763
- icon: (_c = componentSummary.icon) != null ? _c : summaryDefaults.icon,
1764
- image: getSummaryImage(componentSummary)
1765
- };
1527
+ util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
1528
+ function joinValues(array, separator = " | ") {
1529
+ return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
1530
+ }
1531
+ util2.joinValues = joinValues;
1532
+ util2.jsonStringifyReplacer = (_, value) => {
1533
+ if (typeof value === "bigint") {
1534
+ return value.toString();
1535
+ }
1536
+ return value;
1766
1537
  };
1767
- const itemProps = components.map((childComponent) => __spreadProps(__spreadValues({}, getSummary(childComponent.getSummary())), {
1768
- id: `${childComponent.uid}-summary`
1769
- }));
1770
- return {
1771
- type: "repeatable",
1772
- children,
1773
- addItemTitle,
1774
- control,
1775
- description,
1776
- editableItem: editableItemChildren,
1777
- editItemTitle,
1778
- error: errors == null ? void 0 : errors[0],
1779
- icon,
1780
- image: image ? {
1781
- accessibilityDescription: (_a = image.accessibilityDescription) != null ? _a : image.text,
1782
- uri: image.uri,
1783
- url: (_b = image.url) != null ? _b : ""
1784
- } : void 0,
1785
- items: itemProps,
1786
- maxItems,
1787
- minItems,
1788
- title,
1789
- validationState: mapErrorsToValidationState(errors),
1790
- onAdd: onAdd.bind(component),
1791
- onEdit: onEdit.bind(component),
1792
- onSave: onSave.bind(component),
1793
- onRemove: onRemove.bind(component)
1538
+ })(util || (util = {}));
1539
+ var objectUtil;
1540
+ (function(objectUtil2) {
1541
+ objectUtil2.mergeShapes = (first, second) => {
1542
+ return __spreadValues2(__spreadValues2({}, first), second);
1794
1543
  };
1544
+ })(objectUtil || (objectUtil = {}));
1545
+ var ZodParsedType = util.arrayToEnum([
1546
+ "string",
1547
+ "nan",
1548
+ "number",
1549
+ "integer",
1550
+ "float",
1551
+ "boolean",
1552
+ "date",
1553
+ "bigint",
1554
+ "symbol",
1555
+ "function",
1556
+ "undefined",
1557
+ "null",
1558
+ "array",
1559
+ "object",
1560
+ "unknown",
1561
+ "promise",
1562
+ "void",
1563
+ "never",
1564
+ "map",
1565
+ "set"
1566
+ ]);
1567
+ var getParsedType = (data) => {
1568
+ const t = typeof data;
1569
+ switch (t) {
1570
+ case "undefined":
1571
+ return ZodParsedType.undefined;
1572
+ case "string":
1573
+ return ZodParsedType.string;
1574
+ case "number":
1575
+ return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
1576
+ case "boolean":
1577
+ return ZodParsedType.boolean;
1578
+ case "function":
1579
+ return ZodParsedType.function;
1580
+ case "bigint":
1581
+ return ZodParsedType.bigint;
1582
+ case "symbol":
1583
+ return ZodParsedType.symbol;
1584
+ case "object":
1585
+ if (Array.isArray(data)) {
1586
+ return ZodParsedType.array;
1587
+ }
1588
+ if (data === null) {
1589
+ return ZodParsedType.null;
1590
+ }
1591
+ if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
1592
+ return ZodParsedType.promise;
1593
+ }
1594
+ if (typeof Map !== "undefined" && data instanceof Map) {
1595
+ return ZodParsedType.map;
1596
+ }
1597
+ if (typeof Set !== "undefined" && data instanceof Set) {
1598
+ return ZodParsedType.set;
1599
+ }
1600
+ if (typeof Date !== "undefined" && data instanceof Date) {
1601
+ return ZodParsedType.date;
1602
+ }
1603
+ return ZodParsedType.object;
1604
+ default:
1605
+ return ZodParsedType.unknown;
1606
+ }
1795
1607
  };
1796
-
1797
- // src/revamp/renderers/mappers/reviewComponentToProps.ts
1798
- var reviewComponentToProps = (component) => pick(component, "type", "callToAction", "control", "fields", "margin", "title");
1799
-
1800
- // src/revamp/renderers/mappers/searchComponentToProps.ts
1801
- var searchComponentToProps = (component) => {
1802
- const { uid, control, emptyMessage, error, isLoading, margin, query, results, title } = component;
1803
- const onChange = component.onChange.bind(component);
1804
- const onSelect = component.onSelect.bind(component);
1805
- const state = getSearchState({
1806
- emptyMessage,
1807
- error,
1808
- isLoading,
1809
- query,
1810
- results,
1811
- onChange,
1812
- onSelect
1813
- });
1814
- return {
1815
- type: "search",
1816
- id: uid,
1817
- control,
1818
- isLoading,
1819
- margin,
1820
- query,
1821
- state,
1822
- title,
1823
- onChange
1824
- };
1608
+ var ZodIssueCode = util.arrayToEnum([
1609
+ "invalid_type",
1610
+ "invalid_literal",
1611
+ "custom",
1612
+ "invalid_union",
1613
+ "invalid_union_discriminator",
1614
+ "invalid_enum_value",
1615
+ "unrecognized_keys",
1616
+ "invalid_arguments",
1617
+ "invalid_return_type",
1618
+ "invalid_date",
1619
+ "invalid_string",
1620
+ "too_small",
1621
+ "too_big",
1622
+ "invalid_intersection_types",
1623
+ "not_multiple_of",
1624
+ "not_finite"
1625
+ ]);
1626
+ var quotelessJson = (obj) => {
1627
+ const json = JSON.stringify(obj, null, 2);
1628
+ return json.replace(/"([^"]+)":/g, "$1:");
1825
1629
  };
1826
- var getSearchState = ({
1827
- emptyMessage,
1828
- error,
1829
- isLoading,
1830
- query,
1831
- results,
1832
- onChange,
1833
- onSelect
1834
- }) => {
1835
- if (!query || isLoading) {
1836
- return { type: "pending" };
1630
+ var ZodError = class _ZodError extends Error {
1631
+ get errors() {
1632
+ return this.issues;
1837
1633
  }
1838
- if (error) {
1839
- return { type: "error", onRetry: () => onChange(query) };
1634
+ constructor(issues) {
1635
+ super();
1636
+ this.issues = [];
1637
+ this.addIssue = (sub) => {
1638
+ this.issues = [...this.issues, sub];
1639
+ };
1640
+ this.addIssues = (subs = []) => {
1641
+ this.issues = [...this.issues, ...subs];
1642
+ };
1643
+ const actualProto = new.target.prototype;
1644
+ if (Object.setPrototypeOf) {
1645
+ Object.setPrototypeOf(this, actualProto);
1646
+ } else {
1647
+ this.__proto__ = actualProto;
1648
+ }
1649
+ this.name = "ZodError";
1650
+ this.issues = issues;
1840
1651
  }
1841
- if (results.length === 0) {
1842
- return { type: "noResults", message: emptyMessage };
1652
+ format(_mapper) {
1653
+ const mapper = _mapper || function(issue) {
1654
+ return issue.message;
1655
+ };
1656
+ const fieldErrors = { _errors: [] };
1657
+ const processError = (error) => {
1658
+ for (const issue of error.issues) {
1659
+ if (issue.code === "invalid_union") {
1660
+ issue.unionErrors.map(processError);
1661
+ } else if (issue.code === "invalid_return_type") {
1662
+ processError(issue.returnTypeError);
1663
+ } else if (issue.code === "invalid_arguments") {
1664
+ processError(issue.argumentsError);
1665
+ } else if (issue.path.length === 0) {
1666
+ fieldErrors._errors.push(mapper(issue));
1667
+ } else {
1668
+ let curr = fieldErrors;
1669
+ let i = 0;
1670
+ while (i < issue.path.length) {
1671
+ const el = issue.path[i];
1672
+ const terminal = i === issue.path.length - 1;
1673
+ if (!terminal) {
1674
+ curr[el] = curr[el] || { _errors: [] };
1675
+ } else {
1676
+ curr[el] = curr[el] || { _errors: [] };
1677
+ curr[el]._errors.push(mapper(issue));
1678
+ }
1679
+ curr = curr[el];
1680
+ i++;
1681
+ }
1682
+ }
1683
+ }
1684
+ };
1685
+ processError(this);
1686
+ return fieldErrors;
1843
1687
  }
1844
- const rendererResults = results.map((result) => {
1845
- var _a;
1846
- return __spreadProps(__spreadValues({}, result), {
1847
- id: result.type === "action" ? (_a = result.value.id) != null ? _a : result.value.$id : void 0,
1848
- onClick: () => onSelect(result)
1849
- });
1850
- });
1851
- return { type: "results", results: rendererResults };
1852
- };
1853
-
1854
- // src/revamp/renderers/mappers/selectInputComponentToProps.ts
1855
- var selectInputComponentToProps = (component, children) => {
1856
- var _b;
1857
- const { autoComplete, options, selectedIndex, onSelect } = component;
1858
- const _a = inputComponentToProps(component, "input-select"), { value } = _a, props = __objRest(_a, ["value"]);
1859
- return __spreadProps(__spreadValues({}, props), {
1860
- autoComplete,
1861
- options,
1862
- selectedIndex,
1863
- onSelect: onSelect.bind(component),
1864
- children: (_b = children[selectedIndex != null ? selectedIndex : -1]) != null ? _b : null
1865
- });
1866
- };
1867
-
1868
- // src/revamp/renderers/mappers/statusListComponentToProps.ts
1869
- var statusListComponentToProps = (component) => pick(component, "type", "control", "items", "margin", "title");
1870
-
1871
- // src/revamp/renderers/mappers/textInputComponentToProps.ts
1872
- var textInputComponentToProps = (component) => __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-text")), {
1873
- autoComplete: component.autoComplete,
1874
- autoCapitalize: component == null ? void 0 : component.autocapitalization,
1875
- displayFormat: component.displayFormat,
1876
- maxLength: component.maxLength,
1877
- minLength: component.minLength,
1878
- onChange: component.onChange.bind(component)
1879
- });
1880
-
1881
- // src/revamp/renderers/mappers/multiSelectComponentToProps.ts
1882
- var multiSelectInputComponentToProps = (component) => {
1883
- const { autoComplete, maxItems, minItems, options, selectedIndices, onSelect } = component;
1884
- const _a = inputComponentToProps(component, "input-multi-select"), { required, value } = _a, props = __objRest(_a, ["required", "value"]);
1885
- return __spreadProps(__spreadValues({}, props), {
1886
- autoComplete,
1887
- maxItems,
1888
- minItems,
1889
- options,
1890
- selectedIndices,
1891
- onSelect: onSelect.bind(component)
1892
- });
1893
- };
1894
-
1895
- // src/revamp/renderers/mappers/uploadInputComponentToProps.ts
1896
- var uploadInputComponentToProps = (component) => {
1897
- const { accepts, maxSize } = component;
1898
- return __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-upload")), {
1899
- accepts,
1900
- maxSize,
1901
- onUpload: component.onUpload.bind(component)
1902
- });
1903
- };
1904
-
1905
- // src/revamp/renderers/mappers/tupleComponentToProps.ts
1906
- var tupleComponentToProps = (component, children) => {
1907
- var _a, _b;
1908
- return __spreadProps(__spreadValues({
1909
- type: "section"
1910
- }, pick(component, "control", "description", "help", "icon", "title")), {
1911
- // TODO Remove URL default after next types update (add back to `pick`)
1912
- image: component.image ? __spreadProps(__spreadValues({}, component.image), {
1913
- url: (_b = (_a = component.image) == null ? void 0 : _a.url) != null ? _b : ""
1914
- }) : void 0,
1915
- children
1916
- });
1917
- };
1918
-
1919
- // src/revamp/renderers/mappers/listComponentToProps.ts
1920
- var listComponentToProps = (component) => __spreadProps(__spreadValues({}, pick(component, "type", "callToAction", "control", "margin", "title")), {
1921
- items: component.items.map((_a) => {
1922
- var _b = _a, { image } = _b, rest = __objRest(_b, ["image"]);
1923
- var _a2, _b2, _c;
1924
- return __spreadProps(__spreadValues({}, rest), {
1925
- image: image ? {
1926
- accessibilityDescription: (_a2 = image == null ? void 0 : image.accessibilityDescription) != null ? _a2 : image == null ? void 0 : image.text,
1927
- uri: image == null ? void 0 : image.uri,
1928
- url: (_c = (_b2 = image == null ? void 0 : image.url) != null ? _b2 : image == null ? void 0 : image.url) != null ? _c : ""
1929
- } : void 0
1930
- });
1931
- })
1932
- });
1933
-
1934
- // src/revamp/renderers/mappers/componentToRendererProps.ts
1935
- var componentToRendererProps = (component, nestedContent) => {
1936
- const { children, startChildren, endChildren, editableItemChildren } = nestedContent;
1937
- if (isHiddenComponent(component)) {
1938
- return hiddenComponentToProps();
1688
+ static assert(value) {
1689
+ if (!(value instanceof _ZodError)) {
1690
+ throw new Error(`Not a ZodError: ${value}`);
1691
+ }
1939
1692
  }
1940
- switch (component.type) {
1941
- case "step":
1942
- return stepComponentToProps(component, children);
1943
- case "alert":
1944
- return alertComponentToProps(component);
1945
- case "all-of":
1946
- return allOfComponentToProps(component, children);
1947
- case "boolean":
1948
- return booleanInputComponentToProps(component);
1949
- case "box":
1950
- return boxComponentToProps(component, children);
1951
- case "button":
1952
- return buttonComponentToProps(component);
1953
- case "columns":
1954
- return columnsComponentToProps(component, startChildren, endChildren);
1955
- case "container":
1956
- return containerComponentToProps(children);
1957
- case "date":
1958
- return dateInputComponentToProps(component);
1959
- case "decision":
1960
- return decisionComponentToProps(component);
1961
- case "divider":
1962
- return dividerComponentToProps(component);
1963
- case "form":
1964
- return formComponentToProps(component, children);
1965
- case "heading":
1966
- return headingComponentToProps(component);
1967
- case "const":
1968
- return hiddenComponentToProps();
1969
- case "image":
1970
- return imageComponentToProps(component);
1971
- case "instructions":
1972
- return instructionsComponentToProps(component);
1973
- case "integer":
1974
- return integerInputComponentToProps(component);
1975
- case "list":
1976
- return listComponentToProps(component);
1977
- case "loading-indicator":
1978
- return loadingIndicatorComponentToProps(component);
1979
- case "markdown":
1980
- return markdownComponentToProps(component);
1981
- case "modal":
1982
- return modalComponentToProps(component, children);
1983
- case "multi-select":
1984
- return multiSelectInputComponentToProps(component);
1985
- case "multi-upload":
1986
- return multiUploadInputComponentToProps(component);
1987
- case "number":
1988
- return numberInputComponentToProps(component);
1989
- case "object":
1990
- return objectComponentToProps(component, children);
1991
- case "paragraph":
1992
- return paragraphComponentToProps(component);
1993
- case "repeatable":
1994
- return repeatableComponentToProps(component, children != null ? children : [], editableItemChildren);
1995
- case "review":
1996
- return reviewComponentToProps(component);
1997
- case "search":
1998
- return searchComponentToProps(component);
1999
- case "select":
2000
- return selectInputComponentToProps(component, children != null ? children : []);
2001
- case "status-list":
2002
- return statusListComponentToProps(component);
2003
- case "text":
2004
- return textInputComponentToProps(component);
2005
- case "tuple":
2006
- return tupleComponentToProps(component, children);
2007
- case "upload":
2008
- return uploadInputComponentToProps(component);
2009
- default:
2010
- throw new Error("Unknown component type");
1693
+ toString() {
1694
+ return this.message;
2011
1695
  }
2012
- };
2013
-
2014
- // src/revamp/renderers/getRenderFunction.tsx
2015
- var import_jsx_runtime4 = require("react/jsx-runtime");
2016
- var getRenderFunction = (renderers) => {
2017
- function ComponentRenderer(props) {
2018
- const { type } = props;
2019
- if (type === "hidden") {
2020
- return null;
2021
- }
2022
- const renderer = renderers.find(
2023
- ({ canRenderType, canRender = () => true }) => (
2024
- // once the type is matched, we know the props are of the correct type
2025
- canRenderType === type && canRender(props)
2026
- )
2027
- );
2028
- if (!renderer) {
2029
- throw new Error(`Could not find a renderer for ${type}`);
2030
- }
2031
- return renderer.render(props);
1696
+ get message() {
1697
+ return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
2032
1698
  }
2033
- const getNestedContent = (component) => {
2034
- if (!hasChildren(component)) {
2035
- return {};
2036
- }
2037
- if (isColumnsComponent(component)) {
2038
- return {
2039
- startChildren: component.startComponents.map(render),
2040
- endChildren: component.endComponents.map(render)
2041
- };
2042
- }
2043
- if (isRepeatableComponent(component)) {
2044
- return {
2045
- // We specifically only want components here, because getChildren() includes the editable component
2046
- children: component.components.map(render),
2047
- editableItemChildren: component.editableComponent !== null ? render(component.editableComponent) : null
2048
- };
2049
- }
2050
- return {
2051
- children: component.getChildren().map(render)
2052
- };
2053
- };
2054
- const render = (component) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2055
- ComponentRenderer,
2056
- __spreadValues({}, componentToRendererProps(component, getNestedContent(component))),
2057
- component.uid
2058
- );
2059
- return render;
2060
- };
2061
-
2062
- // ../types/build/main.mjs
2063
- var __defProp2 = Object.defineProperty;
2064
- var __defProps2 = Object.defineProperties;
2065
- var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
2066
- var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
2067
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
2068
- var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
2069
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2070
- var __spreadValues2 = (a, b) => {
2071
- for (var prop in b || (b = {}))
2072
- if (__hasOwnProp2.call(b, prop))
2073
- __defNormalProp2(a, prop, b[prop]);
2074
- if (__getOwnPropSymbols2)
2075
- for (var prop of __getOwnPropSymbols2(b)) {
2076
- if (__propIsEnum2.call(b, prop))
2077
- __defNormalProp2(a, prop, b[prop]);
1699
+ get isEmpty() {
1700
+ return this.issues.length === 0;
1701
+ }
1702
+ flatten(mapper = (issue) => issue.message) {
1703
+ const fieldErrors = {};
1704
+ const formErrors = [];
1705
+ for (const sub of this.issues) {
1706
+ if (sub.path.length > 0) {
1707
+ fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
1708
+ fieldErrors[sub.path[0]].push(mapper(sub));
1709
+ } else {
1710
+ formErrors.push(mapper(sub));
1711
+ }
2078
1712
  }
2079
- return a;
2080
- };
2081
- var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
2082
- var util;
2083
- (function(util2) {
2084
- util2.assertEqual = (val) => val;
2085
- function assertIs(_arg) {
1713
+ return { formErrors, fieldErrors };
2086
1714
  }
2087
- util2.assertIs = assertIs;
2088
- function assertNever(_x) {
2089
- throw new Error();
2090
- }
2091
- util2.assertNever = assertNever;
2092
- util2.arrayToEnum = (items) => {
2093
- const obj = {};
2094
- for (const item of items) {
2095
- obj[item] = item;
2096
- }
2097
- return obj;
2098
- };
2099
- util2.getValidEnumValues = (obj) => {
2100
- const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
2101
- const filtered = {};
2102
- for (const k of validKeys) {
2103
- filtered[k] = obj[k];
2104
- }
2105
- return util2.objectValues(filtered);
2106
- };
2107
- util2.objectValues = (obj) => {
2108
- return util2.objectKeys(obj).map(function(e) {
2109
- return obj[e];
2110
- });
2111
- };
2112
- util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
2113
- const keys = [];
2114
- for (const key in object) {
2115
- if (Object.prototype.hasOwnProperty.call(object, key)) {
2116
- keys.push(key);
2117
- }
2118
- }
2119
- return keys;
2120
- };
2121
- util2.find = (arr, checker) => {
2122
- for (const item of arr) {
2123
- if (checker(item))
2124
- return item;
2125
- }
2126
- return void 0;
2127
- };
2128
- util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
2129
- function joinValues(array, separator = " | ") {
2130
- return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
2131
- }
2132
- util2.joinValues = joinValues;
2133
- util2.jsonStringifyReplacer = (_, value) => {
2134
- if (typeof value === "bigint") {
2135
- return value.toString();
2136
- }
2137
- return value;
2138
- };
2139
- })(util || (util = {}));
2140
- var objectUtil;
2141
- (function(objectUtil2) {
2142
- objectUtil2.mergeShapes = (first, second) => {
2143
- return __spreadValues2(__spreadValues2({}, first), second);
2144
- };
2145
- })(objectUtil || (objectUtil = {}));
2146
- var ZodParsedType = util.arrayToEnum([
2147
- "string",
2148
- "nan",
2149
- "number",
2150
- "integer",
2151
- "float",
2152
- "boolean",
2153
- "date",
2154
- "bigint",
2155
- "symbol",
2156
- "function",
2157
- "undefined",
2158
- "null",
2159
- "array",
2160
- "object",
2161
- "unknown",
2162
- "promise",
2163
- "void",
2164
- "never",
2165
- "map",
2166
- "set"
2167
- ]);
2168
- var getParsedType = (data) => {
2169
- const t = typeof data;
2170
- switch (t) {
2171
- case "undefined":
2172
- return ZodParsedType.undefined;
2173
- case "string":
2174
- return ZodParsedType.string;
2175
- case "number":
2176
- return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
2177
- case "boolean":
2178
- return ZodParsedType.boolean;
2179
- case "function":
2180
- return ZodParsedType.function;
2181
- case "bigint":
2182
- return ZodParsedType.bigint;
2183
- case "symbol":
2184
- return ZodParsedType.symbol;
2185
- case "object":
2186
- if (Array.isArray(data)) {
2187
- return ZodParsedType.array;
2188
- }
2189
- if (data === null) {
2190
- return ZodParsedType.null;
2191
- }
2192
- if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
2193
- return ZodParsedType.promise;
2194
- }
2195
- if (typeof Map !== "undefined" && data instanceof Map) {
2196
- return ZodParsedType.map;
2197
- }
2198
- if (typeof Set !== "undefined" && data instanceof Set) {
2199
- return ZodParsedType.set;
2200
- }
2201
- if (typeof Date !== "undefined" && data instanceof Date) {
2202
- return ZodParsedType.date;
2203
- }
2204
- return ZodParsedType.object;
2205
- default:
2206
- return ZodParsedType.unknown;
2207
- }
2208
- };
2209
- var ZodIssueCode = util.arrayToEnum([
2210
- "invalid_type",
2211
- "invalid_literal",
2212
- "custom",
2213
- "invalid_union",
2214
- "invalid_union_discriminator",
2215
- "invalid_enum_value",
2216
- "unrecognized_keys",
2217
- "invalid_arguments",
2218
- "invalid_return_type",
2219
- "invalid_date",
2220
- "invalid_string",
2221
- "too_small",
2222
- "too_big",
2223
- "invalid_intersection_types",
2224
- "not_multiple_of",
2225
- "not_finite"
2226
- ]);
2227
- var quotelessJson = (obj) => {
2228
- const json = JSON.stringify(obj, null, 2);
2229
- return json.replace(/"([^"]+)":/g, "$1:");
2230
- };
2231
- var ZodError = class _ZodError extends Error {
2232
- get errors() {
2233
- return this.issues;
2234
- }
2235
- constructor(issues) {
2236
- super();
2237
- this.issues = [];
2238
- this.addIssue = (sub) => {
2239
- this.issues = [...this.issues, sub];
2240
- };
2241
- this.addIssues = (subs = []) => {
2242
- this.issues = [...this.issues, ...subs];
2243
- };
2244
- const actualProto = new.target.prototype;
2245
- if (Object.setPrototypeOf) {
2246
- Object.setPrototypeOf(this, actualProto);
2247
- } else {
2248
- this.__proto__ = actualProto;
2249
- }
2250
- this.name = "ZodError";
2251
- this.issues = issues;
2252
- }
2253
- format(_mapper) {
2254
- const mapper = _mapper || function(issue) {
2255
- return issue.message;
2256
- };
2257
- const fieldErrors = { _errors: [] };
2258
- const processError = (error) => {
2259
- for (const issue of error.issues) {
2260
- if (issue.code === "invalid_union") {
2261
- issue.unionErrors.map(processError);
2262
- } else if (issue.code === "invalid_return_type") {
2263
- processError(issue.returnTypeError);
2264
- } else if (issue.code === "invalid_arguments") {
2265
- processError(issue.argumentsError);
2266
- } else if (issue.path.length === 0) {
2267
- fieldErrors._errors.push(mapper(issue));
2268
- } else {
2269
- let curr = fieldErrors;
2270
- let i = 0;
2271
- while (i < issue.path.length) {
2272
- const el = issue.path[i];
2273
- const terminal = i === issue.path.length - 1;
2274
- if (!terminal) {
2275
- curr[el] = curr[el] || { _errors: [] };
2276
- } else {
2277
- curr[el] = curr[el] || { _errors: [] };
2278
- curr[el]._errors.push(mapper(issue));
2279
- }
2280
- curr = curr[el];
2281
- i++;
2282
- }
2283
- }
2284
- }
2285
- };
2286
- processError(this);
2287
- return fieldErrors;
2288
- }
2289
- static assert(value) {
2290
- if (!(value instanceof _ZodError)) {
2291
- throw new Error(`Not a ZodError: ${value}`);
2292
- }
2293
- }
2294
- toString() {
2295
- return this.message;
2296
- }
2297
- get message() {
2298
- return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
2299
- }
2300
- get isEmpty() {
2301
- return this.issues.length === 0;
2302
- }
2303
- flatten(mapper = (issue) => issue.message) {
2304
- const fieldErrors = {};
2305
- const formErrors = [];
2306
- for (const sub of this.issues) {
2307
- if (sub.path.length > 0) {
2308
- fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
2309
- fieldErrors[sub.path[0]].push(mapper(sub));
2310
- } else {
2311
- formErrors.push(mapper(sub));
2312
- }
2313
- }
2314
- return { formErrors, fieldErrors };
2315
- }
2316
- get formErrors() {
2317
- return this.flatten();
1715
+ get formErrors() {
1716
+ return this.flatten();
2318
1717
  }
2319
1718
  };
2320
1719
  ZodError.create = (issues) => {
@@ -6009,51 +5408,16 @@ var z = /* @__PURE__ */ Object.freeze({
6009
5408
  quotelessJson,
6010
5409
  ZodError
6011
5410
  });
6012
- var jsonElementSchema = z.lazy(
6013
- () => z.union([
6014
- z.string(),
6015
- z.number(),
6016
- z.boolean(),
6017
- z.record(jsonElementSchema),
6018
- z.array(jsonElementSchema)
6019
- ]).nullable()
6020
- );
6021
- var externalSchema = z.object({
6022
- url: z.string()
5411
+ var imageSchema = z.object({
5412
+ text: z.string().optional(),
5413
+ url: z.string(),
5414
+ accessibilityDescription: z.string().optional()
6023
5415
  });
6024
- var stepErrorSchema = z.object({
6025
- error: z.string().optional(),
6026
- validation: jsonElementSchema.optional()
6027
- });
6028
- var httpMethodSchema = z.union([
6029
- z.literal("GET"),
6030
- z.literal("POST"),
6031
- z.literal("PUT"),
6032
- z.literal("PATCH"),
6033
- z.literal("DELETE")
6034
- ]);
6035
- var iconNamedSchema = z.object({
6036
- name: z.string()
6037
- });
6038
- var sizeSchema = z.union([
6039
- z.literal("xs"),
6040
- z.literal("sm"),
6041
- z.literal("md"),
6042
- z.literal("lg"),
6043
- z.literal("xl")
6044
- ]);
6045
- var contextSchema = z.union([
6046
- z.literal("positive"),
6047
- z.literal("neutral"),
6048
- z.literal("warning"),
6049
- z.literal("negative"),
6050
- z.literal("success"),
6051
- z.literal("failure"),
6052
- z.literal("info"),
6053
- z.literal("primary")
6054
- ]);
6055
- var iconTextSchema = z.object({
6056
- text: z.string()
5416
+ var summaryProviderSchema = z.object({
5417
+ providesTitle: z.boolean().optional(),
5418
+ providesDescription: z.boolean().optional(),
5419
+ providesIcon: z.boolean().optional(),
5420
+ providesImage: z.boolean().optional()
6057
5421
  });
6058
5422
  var autocompleteTokenSchema = z.union([
6059
5423
  z.literal("on"),
@@ -6120,19 +5484,71 @@ var autocompleteTokenSchema = z.union([
6120
5484
  z.literal("fax"),
6121
5485
  z.literal("pager")
6122
5486
  ]);
6123
- var iconSchema = z.union([iconNamedSchema, iconTextSchema]);
5487
+ var helpSchema = z.object({
5488
+ markdown: z.string()
5489
+ });
5490
+ var jsonElementSchema = z.lazy(
5491
+ () => z.union([
5492
+ z.string(),
5493
+ z.number(),
5494
+ z.boolean(),
5495
+ z.record(jsonElementSchema),
5496
+ z.array(jsonElementSchema)
5497
+ ]).nullable()
5498
+ );
5499
+ var stringSchemaFormatSchema = z.union([
5500
+ z.literal("date"),
5501
+ z.literal("email"),
5502
+ z.literal("numeric"),
5503
+ z.literal("password"),
5504
+ z.literal("phone-number"),
5505
+ z.literal("base64url")
5506
+ ]);
6124
5507
  var autocapitalizationTypeSchema = z.union([
6125
5508
  z.literal("none"),
6126
5509
  z.literal("characters"),
6127
5510
  z.literal("sentences"),
6128
5511
  z.literal("words")
6129
5512
  ]);
6130
- var alignSchema = z.union([z.literal("left"), z.literal("center"), z.literal("right")]);
6131
- var imageSchema = z.object({
6132
- text: z.string().optional(),
6133
- url: z.string(),
6134
- accessibilityDescription: z.string().optional()
5513
+ var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
5514
+ var externalSchema = z.object({
5515
+ url: z.string()
5516
+ });
5517
+ var stepErrorSchema = z.object({
5518
+ error: z.string().optional(),
5519
+ validation: jsonElementSchema.optional()
5520
+ });
5521
+ var iconNamedSchema = z.object({
5522
+ name: z.string()
6135
5523
  });
5524
+ var iconTextSchema = z.object({
5525
+ text: z.string()
5526
+ });
5527
+ var alignSchema = z.union([z.literal("left"), z.literal("center"), z.literal("right")]);
5528
+ var httpMethodSchema = z.union([
5529
+ z.literal("GET"),
5530
+ z.literal("POST"),
5531
+ z.literal("PUT"),
5532
+ z.literal("PATCH"),
5533
+ z.literal("DELETE")
5534
+ ]);
5535
+ var sizeSchema = z.union([
5536
+ z.literal("xs"),
5537
+ z.literal("sm"),
5538
+ z.literal("md"),
5539
+ z.literal("lg"),
5540
+ z.literal("xl")
5541
+ ]);
5542
+ var contextSchema = z.union([
5543
+ z.literal("positive"),
5544
+ z.literal("neutral"),
5545
+ z.literal("warning"),
5546
+ z.literal("negative"),
5547
+ z.literal("success"),
5548
+ z.literal("failure"),
5549
+ z.literal("info"),
5550
+ z.literal("primary")
5551
+ ]);
6136
5552
  var imageLayoutSchema = z.object({
6137
5553
  type: z.literal("image"),
6138
5554
  text: z.string().optional(),
@@ -6142,62 +5558,43 @@ var imageLayoutSchema = z.object({
6142
5558
  control: z.string().optional(),
6143
5559
  margin: sizeSchema.optional()
6144
5560
  });
6145
- var statusListLayoutStatusSchema = z.union([
6146
- z.literal("not-done"),
6147
- z.literal("pending"),
6148
- z.literal("done")
6149
- ]);
6150
- var headingLayoutSchema = z.object({
6151
- type: z.literal("heading"),
6152
- text: z.string(),
6153
- size: sizeSchema.optional(),
6154
- align: alignSchema.optional(),
6155
- control: z.string().optional(),
6156
- margin: sizeSchema.optional()
6157
- });
6158
- var searchLayoutSchema = z.object({
6159
- type: z.literal("search"),
6160
- title: z.string(),
6161
- method: httpMethodSchema,
5561
+ var searchSearchRequestSchema = z.object({
6162
5562
  url: z.string(),
5563
+ method: httpMethodSchema,
6163
5564
  param: z.string(),
6164
- emptyMessage: z.string().optional(),
5565
+ query: z.string()
5566
+ });
5567
+ var errorResponseBodySchema = z.object({
5568
+ refreshFormUrl: z.string().optional(),
5569
+ analytics: z.record(z.string()).optional(),
5570
+ error: z.string().optional(),
5571
+ validation: jsonElementSchema.optional(),
5572
+ refreshUrl: z.string().optional()
5573
+ });
5574
+ var paragraphLayoutSchema = z.object({
5575
+ type: z.literal("paragraph"),
5576
+ text: z.string(),
5577
+ align: alignSchema.optional(),
6165
5578
  control: z.string().optional(),
6166
5579
  margin: sizeSchema.optional()
6167
5580
  });
6168
- var modalLayoutTriggerSchema = z.object({
6169
- title: z.string()
6170
- });
6171
- var helpSchema = z.object({
6172
- markdown: z.string()
5581
+ var instructionsLayoutItemSchema = z.object({
5582
+ text: z.string(),
5583
+ context: contextSchema,
5584
+ tag: z.string().optional()
6173
5585
  });
6174
5586
  var columnsLayoutBiasSchema = z.union([
6175
5587
  z.literal("none"),
6176
5588
  z.literal("left"),
6177
5589
  z.literal("right")
6178
5590
  ]);
6179
- var instructionsLayoutItemSchema = z.object({
6180
- text: z.string(),
6181
- context: contextSchema
6182
- });
6183
5591
  var formLayoutSchemaReferenceSchema = z.object({
6184
5592
  $ref: z.string()
6185
5593
  });
6186
- var listLayoutStatusSchema = z.union([
6187
- z.literal("warning"),
6188
- z.literal("neutral"),
6189
- z.literal("positive")
6190
- ]);
6191
- var instructionsLayoutSchema = z.object({
6192
- type: z.literal("instructions"),
6193
- title: z.string().optional(),
6194
- items: z.array(instructionsLayoutItemSchema),
6195
- control: z.string().optional(),
6196
- margin: sizeSchema.optional()
6197
- });
6198
- var paragraphLayoutSchema = z.object({
6199
- type: z.literal("paragraph"),
5594
+ var headingLayoutSchema = z.object({
5595
+ type: z.literal("heading"),
6200
5596
  text: z.string(),
5597
+ size: sizeSchema.optional(),
6201
5598
  align: alignSchema.optional(),
6202
5599
  control: z.string().optional(),
6203
5600
  margin: sizeSchema.optional()
@@ -6207,13 +5604,6 @@ var dividerLayoutSchema = z.object({
6207
5604
  control: z.string().optional(),
6208
5605
  margin: sizeSchema.optional()
6209
5606
  });
6210
- var formLayoutSchema = z.object({
6211
- type: z.literal("form"),
6212
- schema: formLayoutSchemaReferenceSchema.optional(),
6213
- schemaId: z.string(),
6214
- control: z.string().optional(),
6215
- margin: sizeSchema.optional()
6216
- });
6217
5607
  var infoLayoutSchema = z.object({
6218
5608
  type: z.literal("info"),
6219
5609
  markdown: z.string(),
@@ -6221,6 +5611,13 @@ var infoLayoutSchema = z.object({
6221
5611
  control: z.string().optional(),
6222
5612
  margin: sizeSchema.optional()
6223
5613
  });
5614
+ var instructionsLayoutSchema = z.object({
5615
+ type: z.literal("instructions"),
5616
+ title: z.string().optional(),
5617
+ items: z.array(instructionsLayoutItemSchema),
5618
+ control: z.string().optional(),
5619
+ margin: sizeSchema.optional()
5620
+ });
6224
5621
  var loadingIndicatorLayoutSchema = z.object({
6225
5622
  type: z.literal("loading-indicator"),
6226
5623
  size: sizeSchema.optional(),
@@ -6234,56 +5631,38 @@ var markdownLayoutSchema = z.object({
6234
5631
  control: z.string().optional(),
6235
5632
  margin: sizeSchema.optional()
6236
5633
  });
6237
- var summaryProviderSchema = z.object({
6238
- providesTitle: z.boolean().optional(),
6239
- providesDescription: z.boolean().optional(),
6240
- providesIcon: z.boolean().optional(),
6241
- providesImage: z.boolean().optional()
6242
- });
6243
- var stringSchemaFormatSchema = z.union([
6244
- z.literal("date"),
6245
- z.literal("email"),
6246
- z.literal("numeric"),
6247
- z.literal("password"),
6248
- z.literal("phone-number"),
6249
- z.literal("base64url")
6250
- ]);
6251
- var validateAsyncSchema = z.object({
6252
- param: z.string(),
5634
+ var searchLayoutSchema = z.object({
5635
+ type: z.literal("search"),
5636
+ title: z.string(),
6253
5637
  method: httpMethodSchema,
6254
- url: z.string()
6255
- });
6256
- var uploadSourceSchema = z.union([z.literal("camera"), z.literal("file")]);
6257
- var summarySummariserSchema = z.object({
6258
- defaultTitle: z.string().optional(),
6259
- defaultDescription: z.string().optional(),
6260
- defaultIcon: iconSchema.optional(),
6261
- defaultImage: imageLayoutSchema.optional(),
6262
- providesTitle: z.boolean().optional(),
6263
- providesDescription: z.boolean().optional(),
6264
- providesIcon: z.boolean().optional(),
6265
- providesImage: z.boolean().optional()
6266
- });
6267
- var searchSearchRequestSchema = z.object({
6268
5638
  url: z.string(),
6269
- method: httpMethodSchema,
6270
5639
  param: z.string(),
6271
- query: z.string()
5640
+ emptyMessage: z.string().optional(),
5641
+ control: z.string().optional(),
5642
+ margin: sizeSchema.optional()
6272
5643
  });
6273
- var searchResultSearchSchema = z.object({
6274
- type: z.literal("search"),
6275
- title: z.string(),
6276
- description: z.string().optional(),
6277
- icon: iconSchema.optional(),
6278
- image: imageLayoutSchema.optional(),
6279
- value: searchSearchRequestSchema
5644
+ var modalLayoutTriggerSchema = z.object({
5645
+ title: z.string()
6280
5646
  });
6281
- var errorResponseBodySchema = z.object({
6282
- refreshFormUrl: z.string().optional(),
6283
- analytics: z.record(z.string()).optional(),
6284
- error: z.string().optional(),
6285
- validation: jsonElementSchema.optional(),
6286
- refreshUrl: z.string().optional()
5647
+ var listLayoutStatusSchema = z.union([
5648
+ z.literal("warning"),
5649
+ z.literal("neutral"),
5650
+ z.literal("positive")
5651
+ ]);
5652
+ var reviewLayoutFieldSchema = z.object({
5653
+ label: z.string(),
5654
+ value: z.string(),
5655
+ rawValue: z.string().optional(),
5656
+ help: helpSchema.optional(),
5657
+ tag: z.string().optional()
5658
+ });
5659
+ var statusListLayoutStatusSchema = z.union([
5660
+ z.literal("not-done"),
5661
+ z.literal("pending"),
5662
+ z.literal("done")
5663
+ ]);
5664
+ var linkSchema = z.object({
5665
+ url: z.string()
6287
5666
  });
6288
5667
  var actionTypeSchema = z.union([
6289
5668
  z.literal("primary"),
@@ -6298,10 +5677,22 @@ var navigationStackBehaviorSchema = z.union([
6298
5677
  z.literal("remove-all"),
6299
5678
  z.literal("replace-current")
6300
5679
  ]);
6301
- var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
6302
- var linkSchema = z.object({
5680
+ var iconSchema = z.union([iconNamedSchema, iconTextSchema]);
5681
+ var validateAsyncSchema = z.object({
5682
+ param: z.string(),
5683
+ method: httpMethodSchema,
6303
5684
  url: z.string()
6304
5685
  });
5686
+ var summarySummariserSchema = z.object({
5687
+ defaultTitle: z.string().optional(),
5688
+ defaultDescription: z.string().optional(),
5689
+ defaultIcon: iconSchema.optional(),
5690
+ defaultImage: imageLayoutSchema.optional(),
5691
+ providesTitle: z.boolean().optional(),
5692
+ providesDescription: z.boolean().optional(),
5693
+ providesIcon: z.boolean().optional(),
5694
+ providesImage: z.boolean().optional()
5695
+ });
6305
5696
  var actionSchema = z.object({
6306
5697
  title: z.string().optional(),
6307
5698
  type: actionTypeSchema.optional(),
@@ -6321,45 +5712,49 @@ var linkHandlerSchema = z.object({
6321
5712
  regexPattern: z.string(),
6322
5713
  action: actionSchema
6323
5714
  });
6324
- var listLayoutItemSchema = z.object({
5715
+ var searchResultActionSchema = z.object({
5716
+ type: z.literal("action"),
5717
+ title: z.string(),
6325
5718
  description: z.string().optional(),
6326
- status: listLayoutStatusSchema.optional(),
6327
5719
  icon: iconSchema.optional(),
6328
- image: imageSchema.optional(),
6329
- title: z.string(),
6330
- subtitle: z.string().optional(),
6331
- value: z.string().optional(),
6332
- subvalue: z.string().optional()
5720
+ image: imageLayoutSchema.optional(),
5721
+ value: actionSchema
6333
5722
  });
6334
- var decisionLayoutOptionSchema = z.object({
6335
- action: actionSchema,
5723
+ var searchResultSearchSchema = z.object({
5724
+ type: z.literal("search"),
6336
5725
  title: z.string(),
6337
5726
  description: z.string().optional(),
6338
- disabled: z.boolean().optional(),
6339
5727
  icon: iconSchema.optional(),
6340
- image: imageLayoutSchema.optional()
6341
- });
6342
- var behaviorSchema = z.object({
6343
- action: actionSchema.optional(),
6344
- link: linkSchema.optional()
5728
+ image: imageLayoutSchema.optional(),
5729
+ value: searchSearchRequestSchema
6345
5730
  });
6346
- var reviewLayoutFieldSchema = z.object({
6347
- label: z.string(),
6348
- value: z.string(),
6349
- rawValue: z.string().optional(),
6350
- help: helpSchema.optional()
5731
+ var actionResponseBodySchema = z.object({
5732
+ action: actionSchema
6351
5733
  });
6352
5734
  var reviewLayoutCallToActionSchema = z.object({
6353
5735
  title: z.string(),
6354
5736
  action: actionSchema
6355
5737
  });
6356
- var decisionLayoutSchema = z.object({
6357
- type: z.literal("decision"),
6358
- title: z.string().optional(),
6359
- options: z.array(decisionLayoutOptionSchema),
5738
+ var formLayoutSchema = z.object({
5739
+ type: z.literal("form"),
5740
+ schema: formLayoutSchemaReferenceSchema.optional(),
5741
+ schemaId: z.string(),
6360
5742
  control: z.string().optional(),
6361
5743
  margin: sizeSchema.optional()
6362
5744
  });
5745
+ var decisionLayoutOptionSchema = z.object({
5746
+ action: actionSchema,
5747
+ title: z.string(),
5748
+ description: z.string().optional(),
5749
+ disabled: z.boolean().optional(),
5750
+ icon: iconSchema.optional(),
5751
+ image: imageLayoutSchema.optional(),
5752
+ tag: z.string().optional()
5753
+ });
5754
+ var behaviorSchema = z.object({
5755
+ action: actionSchema.optional(),
5756
+ link: linkSchema.optional()
5757
+ });
6363
5758
  var buttonLayoutSchema = z.object({
6364
5759
  type: z.literal("button"),
6365
5760
  size: sizeSchema.optional(),
@@ -6371,17 +5766,44 @@ var buttonLayoutSchema = z.object({
6371
5766
  control: z.string().optional(),
6372
5767
  margin: sizeSchema.optional()
6373
5768
  });
6374
- var searchResultActionSchema = z.object({
6375
- type: z.literal("action"),
5769
+ var reviewLayoutSchema = z.object({
5770
+ type: z.literal("review"),
5771
+ orientation: z.string().optional(),
5772
+ action: actionSchema.optional(),
5773
+ fields: z.array(reviewLayoutFieldSchema),
5774
+ title: z.string().optional(),
5775
+ callToAction: reviewLayoutCallToActionSchema.optional(),
5776
+ control: z.string().optional(),
5777
+ margin: sizeSchema.optional()
5778
+ });
5779
+ var itemCallToActionSchema = z.object({
5780
+ title: z.string(),
5781
+ accessibilityDescription: z.string().optional(),
5782
+ behavior: behaviorSchema
5783
+ });
5784
+ var listLayoutCallToActionSchema = z.object({
6376
5785
  title: z.string(),
5786
+ accessibilityDescription: z.string().optional(),
5787
+ behavior: behaviorSchema
5788
+ });
5789
+ var listLayoutItemSchema = z.object({
6377
5790
  description: z.string().optional(),
5791
+ status: listLayoutStatusSchema.optional(),
6378
5792
  icon: iconSchema.optional(),
6379
- image: imageLayoutSchema.optional(),
6380
- value: actionSchema
5793
+ image: imageSchema.optional(),
5794
+ title: z.string().optional(),
5795
+ subtitle: z.string().optional(),
5796
+ value: z.string().optional(),
5797
+ subvalue: z.string().optional(),
5798
+ tag: z.string().optional()
6381
5799
  });
6382
- var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
6383
- var actionResponseBodySchema = z.object({
6384
- action: actionSchema
5800
+ var statusListLayoutItemSchema = z.object({
5801
+ title: z.string(),
5802
+ description: z.string().optional(),
5803
+ icon: iconSchema,
5804
+ status: statusListLayoutStatusSchema.optional(),
5805
+ callToAction: itemCallToActionSchema.optional(),
5806
+ tag: z.string().optional()
6385
5807
  });
6386
5808
  var pollingOnErrorSchema = z.object({
6387
5809
  action: actionSchema
@@ -6390,6 +5812,7 @@ var navigationBackBehaviorSchema = z.object({
6390
5812
  title: z.string().optional(),
6391
5813
  action: actionSchema
6392
5814
  });
5815
+ var summarySchema = z.union([summaryProviderSchema, summarySummariserSchema]);
6393
5816
  var pollingSchema = z.object({
6394
5817
  url: z.string(),
6395
5818
  interval: z.number().optional(),
@@ -6403,41 +5826,22 @@ var navigationSchema = z.object({
6403
5826
  back: navigationBackBehaviorSchema.optional(),
6404
5827
  stackBehavior: navigationStackBehaviorSchema.optional()
6405
5828
  });
6406
- var listLayoutCallToActionSchema = z.object({
6407
- title: z.string(),
6408
- accessibilityDescription: z.string().optional(),
6409
- behavior: behaviorSchema
5829
+ var searchResultSchema = z.union([searchResultActionSchema, searchResultSearchSchema]);
5830
+ var searchResponseBodySchema = z.object({
5831
+ results: z.array(searchResultSchema)
6410
5832
  });
6411
5833
  var alertLayoutCallToActionSchema = z.object({
6412
5834
  title: z.string(),
6413
5835
  accessibilityDescription: z.string().optional(),
6414
5836
  behavior: behaviorSchema
6415
5837
  });
6416
- var itemCallToActionSchema = z.object({
6417
- title: z.string(),
6418
- accessibilityDescription: z.string().optional(),
6419
- behavior: behaviorSchema
6420
- });
6421
- var reviewLayoutSchema = z.object({
6422
- type: z.literal("review"),
6423
- orientation: z.string().optional(),
6424
- action: actionSchema.optional(),
6425
- fields: z.array(reviewLayoutFieldSchema),
5838
+ var decisionLayoutSchema = z.object({
5839
+ type: z.literal("decision"),
6426
5840
  title: z.string().optional(),
6427
- callToAction: reviewLayoutCallToActionSchema.optional(),
5841
+ options: z.array(decisionLayoutOptionSchema),
6428
5842
  control: z.string().optional(),
6429
5843
  margin: sizeSchema.optional()
6430
5844
  });
6431
- var searchResponseBodySchema = z.object({
6432
- results: z.array(searchResultSchema)
6433
- });
6434
- var statusListLayoutItemSchema = z.object({
6435
- title: z.string(),
6436
- description: z.string().optional(),
6437
- icon: iconSchema,
6438
- status: statusListLayoutStatusSchema.optional(),
6439
- callToAction: itemCallToActionSchema.optional()
6440
- });
6441
5845
  var listLayoutSchema = z.object({
6442
5846
  type: z.literal("list"),
6443
5847
  title: z.string().optional(),
@@ -6446,6 +5850,13 @@ var listLayoutSchema = z.object({
6446
5850
  control: z.string().optional(),
6447
5851
  margin: sizeSchema.optional()
6448
5852
  });
5853
+ var statusListLayoutSchema = z.object({
5854
+ type: z.literal("status-list"),
5855
+ items: z.array(statusListLayoutItemSchema),
5856
+ title: z.string().optional(),
5857
+ control: z.string().optional(),
5858
+ margin: sizeSchema.optional()
5859
+ });
6449
5860
  var alertLayoutSchema = z.object({
6450
5861
  type: z.literal("alert"),
6451
5862
  markdown: z.string(),
@@ -6492,134 +5903,46 @@ var blobSchemaSchema = z.object({
6492
5903
  source: uploadSourceSchema.optional(),
6493
5904
  disabled: z.boolean().optional()
6494
5905
  });
6495
- var statusListLayoutSchema = z.object({
6496
- type: z.literal("status-list"),
6497
- items: z.array(statusListLayoutItemSchema),
6498
- title: z.string().optional(),
6499
- control: z.string().optional(),
6500
- margin: sizeSchema.optional()
6501
- });
6502
- var stepSchema = z.lazy(
6503
- () => z.object({
6504
- key: z.string().optional(),
6505
- type: z.string().optional(),
6506
- actions: z.array(actionSchema).optional(),
6507
- refreshFormUrl: z.string().optional(),
6508
- id: z.string(),
6509
- title: z.string(),
6510
- schemas: z.array(schemaSchema),
6511
- layout: z.array(layoutSchema),
6512
- description: z.string().optional(),
6513
- model: jsonElementSchema.optional(),
6514
- external: externalSchema.optional(),
6515
- polling: pollingSchema.optional(),
6516
- linkHandlers: z.array(linkHandlerSchema).optional(),
6517
- analytics: z.record(z.string()).optional(),
6518
- errors: stepErrorSchema.optional(),
6519
- navigation: navigationSchema.optional(),
6520
- refreshUrl: z.string().optional()
6521
- })
6522
- );
6523
- var schemaSchema = z.lazy(
6524
- () => z.union([
6525
- allOfSchemaSchema,
6526
- arraySchemaSchema,
6527
- blobSchemaSchema,
6528
- booleanSchemaSchema,
6529
- constSchemaSchema,
6530
- integerSchemaSchema,
6531
- numberSchemaSchema,
6532
- objectSchemaSchema,
6533
- oneOfSchemaSchema,
6534
- stringSchemaSchema
6535
- ])
6536
- );
6537
- var layoutSchema = z.lazy(
6538
- () => z.union([
6539
- alertLayoutSchema,
6540
- boxLayoutSchema,
6541
- buttonLayoutSchema,
6542
- columnsLayoutSchema,
6543
- decisionLayoutSchema,
6544
- dividerLayoutSchema,
6545
- formLayoutSchema,
6546
- headingLayoutSchema,
6547
- imageLayoutSchema,
6548
- infoLayoutSchema,
6549
- instructionsLayoutSchema,
6550
- listLayoutSchema,
6551
- loadingIndicatorLayoutSchema,
6552
- markdownLayoutSchema,
6553
- modalLayoutSchema,
6554
- paragraphLayoutSchema,
6555
- reviewLayoutSchema,
6556
- searchLayoutSchema,
6557
- statusListLayoutSchema
6558
- ])
6559
- );
6560
- var modalLayoutContentSchema = z.lazy(
6561
- () => z.object({
6562
- title: z.string().optional(),
6563
- components: z.array(layoutSchema)
6564
- })
6565
- );
6566
- var modalLayoutSchema = z.lazy(
6567
- () => z.object({
6568
- type: z.literal("modal"),
6569
- control: z.string().optional(),
6570
- margin: sizeSchema.optional(),
6571
- trigger: modalLayoutTriggerSchema,
6572
- content: modalLayoutContentSchema
6573
- })
6574
- );
6575
- var boxLayoutSchema = z.lazy(
6576
- () => z.object({
6577
- type: z.literal("box"),
6578
- components: z.array(layoutSchema),
6579
- width: sizeSchema.optional(),
6580
- border: z.boolean().optional(),
6581
- control: z.string().optional(),
6582
- margin: sizeSchema.optional()
6583
- })
6584
- );
6585
- var columnsLayoutSchema = z.lazy(
6586
- () => z.object({
6587
- type: z.literal("columns"),
6588
- left: z.array(layoutSchema),
6589
- right: z.array(layoutSchema),
6590
- bias: columnsLayoutBiasSchema.optional(),
6591
- control: z.string().optional(),
6592
- margin: sizeSchema.optional()
6593
- })
6594
- );
6595
- var arraySchemaSchema = z.lazy(
6596
- () => z.union([arraySchemaListSchema, arraySchemaTupleSchema])
6597
- );
6598
- var arraySchemaListSchema = z.lazy(
5906
+ var numberSchemaSchema = z.lazy(
6599
5907
  () => z.object({
6600
- type: z.literal("array"),
5908
+ type: z.literal("number"),
5909
+ autofillProvider: z.string().optional(),
6601
5910
  promoted: z.boolean().optional(),
6602
- $id: z.string().optional(),
6603
- items: schemaSchema,
6604
- addItemTitle: z.string(),
6605
- editItemTitle: z.string(),
6606
- minItems: z.number().optional(),
6607
- maxItems: z.number().optional(),
5911
+ refreshFormOnChange: z.boolean().optional(),
5912
+ refreshUrl: z.string().optional(),
5913
+ refreshFormUrl: z.string().optional(),
6608
5914
  placeholder: z.string().optional(),
5915
+ minimum: z.number().optional(),
5916
+ maximum: z.number().optional(),
5917
+ $id: z.string().optional(),
6609
5918
  title: z.string().optional(),
6610
5919
  description: z.string().optional(),
6611
5920
  control: z.string().optional(),
5921
+ default: z.number().optional(),
6612
5922
  hidden: z.boolean().optional(),
5923
+ disabled: z.boolean().optional(),
6613
5924
  icon: iconSchema.optional(),
6614
5925
  image: imageSchema.optional(),
6615
5926
  keywords: z.array(z.string()).optional(),
6616
- summary: summarySummariserSchema.optional(),
5927
+ summary: summaryProviderSchema.optional(),
6617
5928
  analyticsId: z.string().optional(),
6618
5929
  persistAsync: persistAsyncSchema.optional(),
5930
+ refreshStepOnChange: z.boolean().optional(),
6619
5931
  validationAsync: validateAsyncSchema.optional(),
6620
- alert: alertLayoutSchema.optional(),
6621
5932
  validationMessages: z.record(z.string()).optional(),
6622
- disabled: z.boolean().optional()
5933
+ alert: alertLayoutSchema.optional(),
5934
+ autocompleteHint: z.array(autocompleteTokenSchema).optional(),
5935
+ autofillKey: z.string().optional(),
5936
+ help: helpSchema.optional()
5937
+ })
5938
+ );
5939
+ var persistAsyncSchema = z.lazy(
5940
+ () => z.object({
5941
+ param: z.string(),
5942
+ idProperty: z.string(),
5943
+ schema: schemaSchema,
5944
+ url: z.string(),
5945
+ method: httpMethodSchema
6623
5946
  })
6624
5947
  );
6625
5948
  var arraySchemaTupleSchema = z.lazy(
@@ -6642,91 +5965,72 @@ var arraySchemaTupleSchema = z.lazy(
6642
5965
  alert: alertLayoutSchema.optional()
6643
5966
  })
6644
5967
  );
6645
- var oneOfSchemaSchema = z.lazy(
6646
- () => z.object({
5968
+ var schemaSchema = z.lazy(
5969
+ () => z.union([
5970
+ allOfSchemaSchema,
5971
+ arraySchemaSchema,
5972
+ blobSchemaSchema,
5973
+ booleanSchemaSchema,
5974
+ constSchemaSchema,
5975
+ integerSchemaSchema,
5976
+ numberSchemaSchema,
5977
+ objectSchemaSchema,
5978
+ oneOfSchemaSchema,
5979
+ stringSchemaSchema
5980
+ ])
5981
+ );
5982
+ var booleanSchemaSchema = z.lazy(
5983
+ () => z.object({
5984
+ type: z.literal("boolean"),
6647
5985
  autofillProvider: z.string().optional(),
6648
5986
  promoted: z.boolean().optional(),
6649
5987
  refreshFormOnChange: z.boolean().optional(),
6650
5988
  refreshUrl: z.string().optional(),
6651
5989
  refreshFormUrl: z.string().optional(),
6652
- promotion: jsonElementSchema.optional(),
6653
- oneOf: z.array(schemaSchema),
6654
- placeholder: z.string().optional(),
6655
5990
  $id: z.string().optional(),
6656
5991
  title: z.string().optional(),
6657
5992
  description: z.string().optional(),
6658
5993
  control: z.string().optional(),
6659
- default: jsonElementSchema.optional(),
5994
+ default: z.boolean().optional(),
6660
5995
  hidden: z.boolean().optional(),
5996
+ disabled: z.boolean().optional(),
6661
5997
  icon: iconSchema.optional(),
6662
5998
  image: imageSchema.optional(),
6663
5999
  keywords: z.array(z.string()).optional(),
6664
6000
  summary: summaryProviderSchema.optional(),
6665
6001
  analyticsId: z.string().optional(),
6002
+ persistAsync: persistAsyncSchema.optional(),
6666
6003
  refreshStepOnChange: z.boolean().optional(),
6004
+ validationAsync: validateAsyncSchema.optional(),
6667
6005
  alert: alertLayoutSchema.optional(),
6668
- help: helpSchema.optional(),
6669
- autocompleteHint: z.array(autocompleteTokenSchema).optional(),
6670
6006
  autofillKey: z.string().optional(),
6671
- validationMessages: z.record(z.string()).optional(),
6672
- disabled: z.boolean().optional()
6007
+ help: helpSchema.optional()
6673
6008
  })
6674
6009
  );
6675
- var stringSchemaSchema = z.lazy(
6010
+ var allOfSchemaSchema = z.lazy(
6676
6011
  () => z.object({
6677
- type: z.literal("string"),
6678
- autofillProvider: z.string().optional(),
6012
+ disabled: z.boolean().optional(),
6679
6013
  promoted: z.boolean().optional(),
6680
- refreshFormOnChange: z.boolean().optional(),
6681
- refreshUrl: z.string().optional(),
6682
- refreshFormUrl: z.string().optional(),
6683
- format: stringSchemaFormatSchema.optional(),
6684
- displayFormat: z.string().optional(),
6685
- placeholder: z.string().optional(),
6686
- minLength: z.number().optional(),
6687
- maxLength: z.number().optional(),
6688
- minimum: z.string().optional(),
6689
- maximum: z.string().optional(),
6690
- pattern: z.string().optional(),
6691
- autocapitalization: autocapitalizationTypeSchema.optional(),
6014
+ allOf: z.array(schemaSchema),
6692
6015
  $id: z.string().optional(),
6693
6016
  title: z.string().optional(),
6694
6017
  description: z.string().optional(),
6695
6018
  control: z.string().optional(),
6696
- default: z.string().optional(),
6697
6019
  hidden: z.boolean().optional(),
6698
- disabled: z.boolean().optional(),
6699
6020
  icon: iconSchema.optional(),
6700
6021
  image: imageSchema.optional(),
6701
6022
  keywords: z.array(z.string()).optional(),
6702
6023
  summary: summaryProviderSchema.optional(),
6703
6024
  analyticsId: z.string().optional(),
6704
- persistAsync: persistAsyncSchema.optional(),
6705
- refreshStepOnChange: z.boolean().optional(),
6706
- validationAsync: validateAsyncSchema.optional(),
6707
- validationMessages: z.record(z.string()).optional(),
6708
- alert: alertLayoutSchema.optional(),
6709
- cameraConfig: jsonElementSchema.optional(),
6710
- accepts: z.array(z.string()).optional(),
6711
- maxSize: z.number().optional(),
6712
- source: uploadSourceSchema.optional(),
6713
- autocompleteHint: z.array(autocompleteTokenSchema).optional(),
6714
- autofillKey: z.string().optional(),
6715
- help: helpSchema.optional()
6025
+ alert: alertLayoutSchema.optional()
6716
6026
  })
6717
6027
  );
6718
- var persistAsyncSchema = z.lazy(
6719
- () => z.object({
6720
- param: z.string(),
6721
- idProperty: z.string(),
6722
- schema: schemaSchema,
6723
- url: z.string(),
6724
- method: httpMethodSchema
6725
- })
6028
+ var arraySchemaSchema = z.lazy(
6029
+ () => z.union([arraySchemaListSchema, arraySchemaTupleSchema])
6726
6030
  );
6727
- var numberSchemaSchema = z.lazy(
6031
+ var integerSchemaSchema = z.lazy(
6728
6032
  () => z.object({
6729
- type: z.literal("number"),
6033
+ type: z.literal("integer"),
6730
6034
  autofillProvider: z.string().optional(),
6731
6035
  promoted: z.boolean().optional(),
6732
6036
  refreshFormOnChange: z.boolean().optional(),
@@ -6757,24 +6061,6 @@ var numberSchemaSchema = z.lazy(
6757
6061
  help: helpSchema.optional()
6758
6062
  })
6759
6063
  );
6760
- var allOfSchemaSchema = z.lazy(
6761
- () => z.object({
6762
- disabled: z.boolean().optional(),
6763
- promoted: z.boolean().optional(),
6764
- allOf: z.array(schemaSchema),
6765
- $id: z.string().optional(),
6766
- title: z.string().optional(),
6767
- description: z.string().optional(),
6768
- control: z.string().optional(),
6769
- hidden: z.boolean().optional(),
6770
- icon: iconSchema.optional(),
6771
- image: imageSchema.optional(),
6772
- keywords: z.array(z.string()).optional(),
6773
- summary: summaryProviderSchema.optional(),
6774
- analyticsId: z.string().optional(),
6775
- alert: alertLayoutSchema.optional()
6776
- })
6777
- );
6778
6064
  var objectSchemaSchema = z.lazy(
6779
6065
  () => z.object({
6780
6066
  type: z.literal("object"),
@@ -6797,50 +6083,59 @@ var objectSchemaSchema = z.lazy(
6797
6083
  alert: alertLayoutSchema.optional()
6798
6084
  })
6799
6085
  );
6800
- var booleanSchemaSchema = z.lazy(
6086
+ var oneOfSchemaSchema = z.lazy(
6801
6087
  () => z.object({
6802
- type: z.literal("boolean"),
6803
6088
  autofillProvider: z.string().optional(),
6804
6089
  promoted: z.boolean().optional(),
6805
6090
  refreshFormOnChange: z.boolean().optional(),
6806
6091
  refreshUrl: z.string().optional(),
6807
6092
  refreshFormUrl: z.string().optional(),
6093
+ promotion: jsonElementSchema.optional(),
6094
+ oneOf: z.array(schemaSchema),
6095
+ placeholder: z.string().optional(),
6808
6096
  $id: z.string().optional(),
6809
6097
  title: z.string().optional(),
6810
6098
  description: z.string().optional(),
6811
6099
  control: z.string().optional(),
6812
- default: z.boolean().optional(),
6100
+ default: jsonElementSchema.optional(),
6813
6101
  hidden: z.boolean().optional(),
6814
- disabled: z.boolean().optional(),
6815
6102
  icon: iconSchema.optional(),
6816
6103
  image: imageSchema.optional(),
6817
6104
  keywords: z.array(z.string()).optional(),
6818
6105
  summary: summaryProviderSchema.optional(),
6819
6106
  analyticsId: z.string().optional(),
6820
- persistAsync: persistAsyncSchema.optional(),
6821
6107
  refreshStepOnChange: z.boolean().optional(),
6822
- validationAsync: validateAsyncSchema.optional(),
6823
6108
  alert: alertLayoutSchema.optional(),
6109
+ help: helpSchema.optional(),
6110
+ autocompleteHint: z.array(autocompleteTokenSchema).optional(),
6824
6111
  autofillKey: z.string().optional(),
6825
- help: helpSchema.optional()
6112
+ validationMessages: z.record(z.string()).optional(),
6113
+ disabled: z.boolean().optional()
6826
6114
  })
6827
6115
  );
6828
- var integerSchemaSchema = z.lazy(
6116
+ var stringSchemaSchema = z.lazy(
6829
6117
  () => z.object({
6830
- type: z.literal("integer"),
6118
+ type: z.literal("string"),
6831
6119
  autofillProvider: z.string().optional(),
6832
6120
  promoted: z.boolean().optional(),
6833
6121
  refreshFormOnChange: z.boolean().optional(),
6834
6122
  refreshUrl: z.string().optional(),
6835
6123
  refreshFormUrl: z.string().optional(),
6124
+ format: stringSchemaFormatSchema.optional(),
6125
+ displayFormat: z.string().optional(),
6836
6126
  placeholder: z.string().optional(),
6837
- minimum: z.number().optional(),
6838
- maximum: z.number().optional(),
6127
+ minLength: z.number().optional(),
6128
+ maxLength: z.number().optional(),
6129
+ minimum: z.string().optional(),
6130
+ maximum: z.string().optional(),
6131
+ pattern: z.string().optional(),
6132
+ autocapitalization: autocapitalizationTypeSchema.optional(),
6133
+ autocorrect: z.boolean().optional(),
6839
6134
  $id: z.string().optional(),
6840
6135
  title: z.string().optional(),
6841
6136
  description: z.string().optional(),
6842
6137
  control: z.string().optional(),
6843
- default: z.number().optional(),
6138
+ default: z.string().optional(),
6844
6139
  hidden: z.boolean().optional(),
6845
6140
  disabled: z.boolean().optional(),
6846
6141
  icon: iconSchema.optional(),
@@ -6853,11 +6148,122 @@ var integerSchemaSchema = z.lazy(
6853
6148
  validationAsync: validateAsyncSchema.optional(),
6854
6149
  validationMessages: z.record(z.string()).optional(),
6855
6150
  alert: alertLayoutSchema.optional(),
6151
+ cameraConfig: jsonElementSchema.optional(),
6152
+ accepts: z.array(z.string()).optional(),
6153
+ maxSize: z.number().optional(),
6154
+ source: uploadSourceSchema.optional(),
6856
6155
  autocompleteHint: z.array(autocompleteTokenSchema).optional(),
6857
6156
  autofillKey: z.string().optional(),
6858
6157
  help: helpSchema.optional()
6859
6158
  })
6860
6159
  );
6160
+ var arraySchemaListSchema = z.lazy(
6161
+ () => z.object({
6162
+ type: z.literal("array"),
6163
+ promoted: z.boolean().optional(),
6164
+ $id: z.string().optional(),
6165
+ items: schemaSchema,
6166
+ addItemTitle: z.string(),
6167
+ editItemTitle: z.string(),
6168
+ minItems: z.number().optional(),
6169
+ maxItems: z.number().optional(),
6170
+ placeholder: z.string().optional(),
6171
+ title: z.string().optional(),
6172
+ description: z.string().optional(),
6173
+ control: z.string().optional(),
6174
+ hidden: z.boolean().optional(),
6175
+ icon: iconSchema.optional(),
6176
+ image: imageSchema.optional(),
6177
+ keywords: z.array(z.string()).optional(),
6178
+ summary: summarySummariserSchema.optional(),
6179
+ analyticsId: z.string().optional(),
6180
+ persistAsync: persistAsyncSchema.optional(),
6181
+ validationAsync: validateAsyncSchema.optional(),
6182
+ alert: alertLayoutSchema.optional(),
6183
+ validationMessages: z.record(z.string()).optional(),
6184
+ disabled: z.boolean().optional()
6185
+ })
6186
+ );
6187
+ var stepSchema = z.lazy(
6188
+ () => z.object({
6189
+ key: z.string().optional(),
6190
+ type: z.string().optional(),
6191
+ actions: z.array(actionSchema).optional(),
6192
+ refreshFormUrl: z.string().optional(),
6193
+ id: z.string(),
6194
+ title: z.string(),
6195
+ schemas: z.array(schemaSchema),
6196
+ layout: z.array(layoutSchema),
6197
+ description: z.string().optional(),
6198
+ model: jsonElementSchema.optional(),
6199
+ external: externalSchema.optional(),
6200
+ polling: pollingSchema.optional(),
6201
+ linkHandlers: z.array(linkHandlerSchema).optional(),
6202
+ analytics: z.record(z.string()).optional(),
6203
+ errors: stepErrorSchema.optional(),
6204
+ navigation: navigationSchema.optional(),
6205
+ refreshUrl: z.string().optional(),
6206
+ control: z.string().optional()
6207
+ })
6208
+ );
6209
+ var layoutSchema = z.lazy(
6210
+ () => z.union([
6211
+ alertLayoutSchema,
6212
+ boxLayoutSchema,
6213
+ buttonLayoutSchema,
6214
+ columnsLayoutSchema,
6215
+ decisionLayoutSchema,
6216
+ dividerLayoutSchema,
6217
+ formLayoutSchema,
6218
+ headingLayoutSchema,
6219
+ imageLayoutSchema,
6220
+ infoLayoutSchema,
6221
+ instructionsLayoutSchema,
6222
+ listLayoutSchema,
6223
+ loadingIndicatorLayoutSchema,
6224
+ markdownLayoutSchema,
6225
+ modalLayoutSchema,
6226
+ paragraphLayoutSchema,
6227
+ reviewLayoutSchema,
6228
+ searchLayoutSchema,
6229
+ statusListLayoutSchema
6230
+ ])
6231
+ );
6232
+ var columnsLayoutSchema = z.lazy(
6233
+ () => z.object({
6234
+ type: z.literal("columns"),
6235
+ left: z.array(layoutSchema),
6236
+ right: z.array(layoutSchema),
6237
+ bias: columnsLayoutBiasSchema.optional(),
6238
+ control: z.string().optional(),
6239
+ margin: sizeSchema.optional()
6240
+ })
6241
+ );
6242
+ var modalLayoutContentSchema = z.lazy(
6243
+ () => z.object({
6244
+ title: z.string().optional(),
6245
+ components: z.array(layoutSchema)
6246
+ })
6247
+ );
6248
+ var boxLayoutSchema = z.lazy(
6249
+ () => z.object({
6250
+ type: z.literal("box"),
6251
+ components: z.array(layoutSchema),
6252
+ width: sizeSchema.optional(),
6253
+ border: z.boolean().optional(),
6254
+ control: z.string().optional(),
6255
+ margin: sizeSchema.optional()
6256
+ })
6257
+ );
6258
+ var modalLayoutSchema = z.lazy(
6259
+ () => z.object({
6260
+ type: z.literal("modal"),
6261
+ control: z.string().optional(),
6262
+ margin: sizeSchema.optional(),
6263
+ trigger: modalLayoutTriggerSchema,
6264
+ content: modalLayoutContentSchema
6265
+ })
6266
+ );
6861
6267
  var validateStep = (step) => validate(step, stepSchema);
6862
6268
  var validateActionResponse = (response) => validate(response, actionResponseBodySchema);
6863
6269
  var validate = (value, schema) => {
@@ -6886,25 +6292,59 @@ var flattenZodErrors = (zodError) => zodError.flatMap((e) => {
6886
6292
  var import_react3 = require("react");
6887
6293
  var import_react_intl7 = require("react-intl");
6888
6294
 
6889
- // src/revamp/utils/component-utils.ts
6890
- var getSubmittableData = async (components) => Promise.all(components.map(async (component) => component.getSubmittableValue())).then(
6891
- (values) => values.reduce((acc, value) => mergeModels(acc, value), null)
6892
- );
6893
- var getSubmittableDataSync = (components) => components.map((component) => component.getSubmittableValueSync()).reduce((acc, value) => mergeModels(acc, value), null);
6894
- var getLocalValues = (components) => components.map((component) => component.getLocalValue()).reduce((acc, value) => mergeLocalValues(acc, value), null);
6895
- var mergeLocalValues = (valueA, valueB) => {
6896
- if (valueA === null) {
6897
- return valueB;
6898
- }
6899
- if (valueB === null) {
6900
- return valueA;
6901
- }
6902
- if (isObjectLocalValue(valueA) && isObjectLocalValue(valueB)) {
6903
- return __spreadValues(__spreadValues({}, valueA), valueB);
6904
- }
6905
- return valueB;
6906
- };
6907
- var mergeModels = (valueA, valueB) => {
6295
+ // src/revamp/utils/type-validators.ts
6296
+ var isString = (value) => typeof value === "string";
6297
+ var isNumber = (value) => typeof value === "number" && !Number.isNaN(value);
6298
+ var isInteger = (value) => isNumber(value) && Math.floor(value) === value;
6299
+ var isBoolean = (value) => typeof value === "boolean";
6300
+ var isObject = (value) => !isNullish(value) && (value == null ? void 0 : value.constructor) === Object;
6301
+ var isArray = (value) => Array.isArray(value);
6302
+ var isNull = (value) => value === null;
6303
+ var isUndefined = (value) => typeof value === "undefined";
6304
+ var isNullish = (v) => isNull(v) || isUndefined(v);
6305
+ var isFile = (value) => value instanceof File;
6306
+
6307
+ // src/revamp/utils/type-utils.ts
6308
+ var hasChildren = (component) => "getChildren" in component && typeof component.getChildren === "function";
6309
+ var isHiddenComponent = (component) => "hidden" in component && component.hidden;
6310
+ var isObjectLocalValue = (value) => value != null && typeof value === "object" && !Array.isArray(value) && !(value instanceof File);
6311
+ var isArrayLocalValue = (value) => Array.isArray(value);
6312
+ var isObjectModel = (model) => model != null && typeof model === "object" && !Array.isArray(model);
6313
+ var isArrayModel = (model) => Array.isArray(model);
6314
+ var isAllOfSchema = (schema) => "allOf" in schema && !isNullish(schema.allOf);
6315
+ var isBooleanSchema = (schema) => "type" in schema && schema.type === "boolean";
6316
+ var isBlobSchema = (schema) => "type" in schema && schema.type === "blob";
6317
+ var isConstSchema = (schema) => "const" in schema && schema.const !== void 0;
6318
+ var isIntegerSchema = (schema) => "type" in schema && schema.type === "integer";
6319
+ var isNumberSchema = (schema) => "type" in schema && schema.type === "number";
6320
+ var isObjectSchema = (schema) => "type" in schema && schema.type === "object";
6321
+ var isOneOfSchema = (schema) => "oneOf" in schema && !isNullish(schema.oneOf);
6322
+ var isArraySchema = (schema) => "items" in schema && !isNullish(schema.items);
6323
+ var isArrayListSchema = (schema) => "items" in schema && isObject(schema.items) && !isArray(schema.items);
6324
+ var isArrayTupleSchema = (schema) => "items" in schema && !isObject(schema.items) && isArray(schema.items);
6325
+ var isStringSchema = (schema) => "type" in schema && schema.type === "string";
6326
+ var isStringSchemaWithUpload = (schema) => isStringSchema(schema) && schema.format === "base64url";
6327
+ var isSchemaWithPersistAsync = (schema) => "persistAsync" in schema && !isNullish(schema.persistAsync);
6328
+
6329
+ // src/revamp/utils/component-utils.ts
6330
+ var getSubmittableData = async (components) => Promise.all(components.map(async (component) => component.getSubmittableValue())).then(
6331
+ (values) => values.reduce((acc, value) => mergeModels(acc, value), null)
6332
+ );
6333
+ var getSubmittableDataSync = (components) => components.map((component) => component.getSubmittableValueSync()).reduce((acc, value) => mergeModels(acc, value), null);
6334
+ var getLocalValues = (components) => components.map((component) => component.getLocalValue()).reduce((acc, value) => mergeLocalValues(acc, value), null);
6335
+ var mergeLocalValues = (valueA, valueB) => {
6336
+ if (valueA === null) {
6337
+ return valueB;
6338
+ }
6339
+ if (valueB === null) {
6340
+ return valueA;
6341
+ }
6342
+ if (isObjectLocalValue(valueA) && isObjectLocalValue(valueB)) {
6343
+ return __spreadValues(__spreadValues({}, valueA), valueB);
6344
+ }
6345
+ return valueB;
6346
+ };
6347
+ var mergeModels = (valueA, valueB) => {
6908
6348
  if (valueA === null) {
6909
6349
  return valueB;
6910
6350
  }
@@ -8745,6 +8185,19 @@ var oneOfSchemaToComponent = (schemaMapperProps, mapperProps) => {
8745
8185
  required = false
8746
8186
  } = schemaMapperProps;
8747
8187
  const initialModel = (_a = model != null ? model : schema.default) != null ? _a : null;
8188
+ if (schema.oneOf.length === 1 && isFormSectionSchema(schema.oneOf[0])) {
8189
+ return mapSchemaToComponent(
8190
+ {
8191
+ uid,
8192
+ schema: supressSchemaTitleAndDescription(schema.oneOf[0]),
8193
+ model: initialModel,
8194
+ localValue,
8195
+ validationErrors: initialError,
8196
+ required
8197
+ },
8198
+ mapperProps
8199
+ );
8200
+ }
8748
8201
  const options = schema.oneOf.map((childSchema, index) => {
8749
8202
  const { title = "", description, image, icon, keywords = [] } = childSchema;
8750
8203
  return {
@@ -10298,9 +9751,8 @@ var createInstructionsComponent = (instructionsProps) => __spreadProps(__spreadV
10298
9751
  var instructionsLayoutToComponent = (uid, { control, items, margin = "md", title }) => createInstructionsComponent({
10299
9752
  uid,
10300
9753
  control,
10301
- items: items.map(({ context, text }) => ({
10302
- context: mapLegacyContext(context),
10303
- text
9754
+ items: items.map((item) => __spreadProps(__spreadValues({}, item), {
9755
+ context: mapLegacyContext(item.context)
10304
9756
  })),
10305
9757
  margin,
10306
9758
  title
@@ -10409,12 +9861,10 @@ var reviewLayoutToComponent = (uid, { fields, title, callToAction, control, marg
10409
9861
  uid,
10410
9862
  callToAction: getReviewAction({ onAction, onLink, callToAction, action }),
10411
9863
  control: getOrientationControl({ control, orientation }),
10412
- fields: fields.map(({ label, value, rawValue, help }) => ({
10413
- label,
10414
- value,
10415
- rawValue,
10416
- help: help == null ? void 0 : help.markdown
10417
- })),
9864
+ fields: fields.map((field) => {
9865
+ var _a;
9866
+ return __spreadProps(__spreadValues({}, field), { help: (_a = field.help) == null ? void 0 : _a.markdown });
9867
+ }),
10418
9868
  margin,
10419
9869
  title
10420
9870
  });
@@ -10527,10 +9977,10 @@ var createSearchComponent = (searchProps, performSearch, onAction, updateCompone
10527
9977
  signal,
10528
9978
  query,
10529
9979
  config: searchConfig
10530
- }).then((state) => {
9980
+ }).then((results) => {
10531
9981
  if (!signal.aborted) {
10532
9982
  update((draft) => {
10533
- draft.results = state;
9983
+ draft.results = results;
10534
9984
  draft.isLoading = false;
10535
9985
  draft.error = void 0;
10536
9986
  });
@@ -10585,24 +10035,31 @@ var createSearchComponent = (searchProps, performSearch, onAction, updateCompone
10585
10035
  };
10586
10036
 
10587
10037
  // src/revamp/domain/features/search/getPerformSearchFunction.ts
10588
- var getPerformSearchFunction = (httpClient, defaultConfig) => async ({ config = defaultConfig, query, signal }) => {
10589
- if (!query) {
10590
- return [];
10591
- }
10592
- const { method, param, url } = config;
10593
- const headers2 = { "Content-Type": "application/json" };
10594
- const request = method === "GET" ? httpClient(addQueryParameter(url, param, query), {
10595
- method,
10596
- headers: headers2,
10597
- signal
10598
- }) : httpClient(url, {
10599
- method,
10600
- headers: headers2,
10601
- signal,
10602
- body: JSON.stringify({ [param]: query })
10603
- });
10604
- const response = await request;
10605
- return parseResponse(response);
10038
+ var getPerformSearchFunction = (httpClient, defaultConfig) => {
10039
+ let latestSuccessfulRequestHash = hashRequest("", defaultConfig);
10040
+ let latestSuccessfulResults = [];
10041
+ return async ({ config = defaultConfig, query, signal }) => {
10042
+ const requestHash = hashRequest(query, config);
10043
+ if (requestHash !== latestSuccessfulRequestHash) {
10044
+ const { method, param, url } = config;
10045
+ const headers2 = { "Content-Type": "application/json" };
10046
+ const response = await (method === "GET" ? httpClient(addQueryParameter(url, param, query), {
10047
+ method,
10048
+ headers: headers2,
10049
+ signal
10050
+ }) : httpClient(url, {
10051
+ method,
10052
+ headers: headers2,
10053
+ signal,
10054
+ body: JSON.stringify({ [param]: query })
10055
+ }));
10056
+ const results = await parseResponse(response);
10057
+ latestSuccessfulRequestHash = requestHash;
10058
+ latestSuccessfulResults = results;
10059
+ return results;
10060
+ }
10061
+ return latestSuccessfulResults;
10062
+ };
10606
10063
  };
10607
10064
  var parseResponse = async (response) => {
10608
10065
  if (response.ok) {
@@ -10625,6 +10082,7 @@ var addQueryParameter = (url, key, value) => {
10625
10082
  var isValidResponseBody = (body) => isObject(body) && "results" in body && isArray(body.results) && body.results.every(
10626
10083
  (result) => isObject(result) && "title" in result && "type" in result && "value" in result
10627
10084
  );
10085
+ var hashRequest = (query, config) => JSON.stringify({ query, config });
10628
10086
 
10629
10087
  // src/revamp/domain/mappers/layout/searchLayoutToComponent.ts
10630
10088
  var searchLayoutToComponent = (uid, { control, emptyMessage = "", method, param, title, url, margin = "md" }, mapperProps) => {
@@ -10780,14 +10238,7 @@ var createListComponent = (listProps) => __spreadProps(__spreadValues({
10780
10238
  var listLayoutToComponent = (uid, { callToAction, control, items, margin = "md", title }, mapperProps) => createListComponent({
10781
10239
  uid,
10782
10240
  control,
10783
- items: items.map(({ value, subvalue, title: itemTitle, subtitle, icon, image }) => ({
10784
- title: itemTitle,
10785
- subtitle,
10786
- value,
10787
- subvalue,
10788
- icon,
10789
- image
10790
- })),
10241
+ items: items.map((item) => __spreadValues({}, item)),
10791
10242
  callToAction: getListCallToAction(callToAction, mapperProps),
10792
10243
  margin,
10793
10244
  title
@@ -10911,11 +10362,13 @@ var getUnreferencedSchemas = (step) => {
10911
10362
  // src/revamp/domain/mappers/mapStepToComponent.ts
10912
10363
  var mapStepToComponent = (_a) => {
10913
10364
  var _b = _a, {
10365
+ bit,
10914
10366
  loadingState,
10915
10367
  displayStepTitle,
10916
10368
  trackEvent,
10917
10369
  onPoll
10918
10370
  } = _b, restProps = __objRest(_b, [
10371
+ "bit",
10919
10372
  "loadingState",
10920
10373
  "displayStepTitle",
10921
10374
  "trackEvent",
@@ -10936,7 +10389,7 @@ var mapStepToComponent = (_a) => {
10936
10389
  if (stepId === void 0) {
10937
10390
  throw new Error("Step must have an id or a key");
10938
10391
  }
10939
- const uid = stepId != null ? stepId : "step";
10392
+ const uid = `${stepId != null ? stepId : "step"}_${bit}`;
10940
10393
  const onAction = async (action) => {
10941
10394
  try {
10942
10395
  await stepComponent.getSubmittableValue();
@@ -11427,6 +10880,10 @@ function useDynamicFlowCore(props) {
11427
10880
  );
11428
10881
  const [stepComponent, setStepComponent] = (0, import_react3.useState)(null);
11429
10882
  const stepComponentRef = (0, import_react3.useRef)(null);
10883
+ const stepBit = (0, import_react3.useRef)("flip");
10884
+ const flipStepBit = () => {
10885
+ stepBit.current = stepBit.current === "flip" ? "flop" : "flip";
10886
+ };
11430
10887
  const stepRef = (0, import_react3.useRef)(initialStep != null ? initialStep : null);
11431
10888
  const etagRef = (0, import_react3.useRef)(null);
11432
10889
  const abortControllerRef = (0, import_react3.useRef)(new AbortController());
@@ -11470,6 +10927,7 @@ function useDynamicFlowCore(props) {
11470
10927
  };
11471
10928
  try {
11472
10929
  const newStepComponent = mapStepToComponent({
10930
+ bit: stepBit.current,
11473
10931
  stepLocalValue: (_c = (_b = stepComponentRef.current) == null ? void 0 : _b.getLocalValue()) != null ? _c : null,
11474
10932
  step: newStep,
11475
10933
  displayStepTitle,
@@ -11555,6 +11013,7 @@ function useDynamicFlowCore(props) {
11555
11013
  }
11556
11014
  case "replace-step": {
11557
11015
  const isFirstStep = stepRef.current === null;
11016
+ flipStepBit();
11558
11017
  initialiseWithStep(command.step, command.etag);
11559
11018
  trackCoreEvent("Step Shown", { isFirstStep });
11560
11019
  break;
@@ -11642,36 +11101,674 @@ function useDynamicFlowCore(props) {
11642
11101
  signal,
11643
11102
  trackEvent: trackCoreEvent
11644
11103
  });
11645
- switch (command.type) {
11646
- case "replace-step":
11647
- initialiseWithStep(command.step, command.etag);
11648
- return true;
11649
- case "action":
11650
- void onAction(command.action);
11651
- return true;
11652
- case "complete":
11653
- onCompletion(command.result);
11654
- return true;
11655
- case "continue":
11656
- return false;
11657
- }
11658
- },
11659
- // eslint-disable-next-line react-hooks/exhaustive-deps
11660
- []
11661
- );
11662
- return { stepComponentRef };
11663
- }
11104
+ switch (command.type) {
11105
+ case "replace-step":
11106
+ flipStepBit();
11107
+ initialiseWithStep(command.step, command.etag);
11108
+ return true;
11109
+ case "action":
11110
+ void onAction(command.action);
11111
+ return true;
11112
+ case "complete":
11113
+ onCompletion(command.result);
11114
+ return true;
11115
+ case "continue":
11116
+ return false;
11117
+ }
11118
+ },
11119
+ // eslint-disable-next-line react-hooks/exhaustive-deps
11120
+ []
11121
+ );
11122
+ return { stepComponentRef };
11123
+ }
11124
+
11125
+ // src/revamp/renderers/mappers/utils/pick.ts
11126
+ function pick(obj, ...keys) {
11127
+ const result = {};
11128
+ keys.forEach((key) => {
11129
+ result[key] = obj[key];
11130
+ });
11131
+ return result;
11132
+ }
11133
+
11134
+ // src/revamp/renderers/mappers/alertComponentToProps.ts
11135
+ var alertComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "type", "callToAction", "context", "control", "margin", "markdown")), rendererMapperProps);
11136
+
11137
+ // src/revamp/renderers/mappers/allOfComponentToProps.ts
11138
+ var allOfComponentToProps = (component, rendererMapperProps) => {
11139
+ const childrenProps = component.components.map(
11140
+ (c) => componentToRendererProps(c, rendererMapperProps)
11141
+ );
11142
+ return __spreadProps(__spreadValues(__spreadValues({
11143
+ type: "section"
11144
+ }, pick(component, "uid", "control", "description", "help", "icon", "image", "title")), rendererMapperProps), {
11145
+ children: childrenProps.map(rendererMapperProps.render),
11146
+ childrenProps
11147
+ });
11148
+ };
11149
+
11150
+ // src/revamp/renderers/mappers/utils/mapErrorsToValidationState.ts
11151
+ var mapErrorsToValidationState = (errors) => {
11152
+ if (errors) {
11153
+ if (errors.length > 0) {
11154
+ return { status: "invalid", message: errors[0] };
11155
+ }
11156
+ return { status: "valid" };
11157
+ }
11158
+ return void 0;
11159
+ };
11160
+
11161
+ // src/revamp/renderers/mappers/utils/inputComponentToProps.ts
11162
+ var inputComponentToProps = (component, type) => {
11163
+ var _a, _b, _c, _d;
11164
+ const {
11165
+ uid,
11166
+ control,
11167
+ description,
11168
+ disabled,
11169
+ errors,
11170
+ help,
11171
+ icon,
11172
+ id,
11173
+ image,
11174
+ placeholder,
11175
+ required,
11176
+ title,
11177
+ validationAsyncState,
11178
+ onBlur,
11179
+ onFocus
11180
+ } = component;
11181
+ const { messages } = validationAsyncState != null ? validationAsyncState : {};
11182
+ return {
11183
+ uid,
11184
+ type,
11185
+ control,
11186
+ description,
11187
+ disabled,
11188
+ error: (_a = messages == null ? void 0 : messages.error) != null ? _a : errors == null ? void 0 : errors[0],
11189
+ help,
11190
+ icon,
11191
+ id,
11192
+ image: image ? {
11193
+ accessibilityDescription: (_b = image.accessibilityDescription) != null ? _b : image.text,
11194
+ uri: image.uri,
11195
+ url: (_d = (_c = image.uri) != null ? _c : image.url) != null ? _d : ""
11196
+ } : void 0,
11197
+ placeholder,
11198
+ required,
11199
+ title,
11200
+ validationState: getValidationState(errors, validationAsyncState),
11201
+ value: component.getLocalValue(),
11202
+ onBlur: onBlur.bind(component),
11203
+ onFocus: onFocus.bind(component)
11204
+ };
11205
+ };
11206
+ var getValidationState = (errors, validationAsyncState) => {
11207
+ if (validationAsyncState) {
11208
+ if (validationAsyncState == null ? void 0 : validationAsyncState.messages.error) {
11209
+ return { status: "invalid", message: validationAsyncState == null ? void 0 : validationAsyncState.messages.error };
11210
+ }
11211
+ if (validationAsyncState == null ? void 0 : validationAsyncState.messages.success) {
11212
+ return { status: "valid", message: validationAsyncState == null ? void 0 : validationAsyncState.messages.success };
11213
+ }
11214
+ }
11215
+ return mapErrorsToValidationState(errors);
11216
+ };
11217
+
11218
+ // src/revamp/renderers/mappers/booleanInputComponentToProps.ts
11219
+ var booleanInputComponentToProps = (component, rendererMapperProps) => {
11220
+ var _a;
11221
+ return __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-checkbox")), rendererMapperProps), {
11222
+ value: (_a = component.value) != null ? _a : false,
11223
+ onChange: component.onChange.bind(component)
11224
+ });
11225
+ };
11226
+
11227
+ // src/revamp/renderers/mappers/boxComponentToProps.ts
11228
+ var boxComponentToProps = (component, rendererMapperProps) => {
11229
+ const childrenProps = component.components.map(
11230
+ (c) => componentToRendererProps(c, rendererMapperProps)
11231
+ );
11232
+ return __spreadProps(__spreadValues(__spreadValues({}, pick(component, "uid", "type", "border", "control", "width", "margin")), rendererMapperProps), {
11233
+ children: childrenProps.map(rendererMapperProps.render),
11234
+ childrenProps
11235
+ });
11236
+ };
11237
+
11238
+ // src/revamp/renderers/mappers/buttonComponentToProps.ts
11239
+ var buttonComponentToProps = (component, rendererMapperProps) => {
11240
+ return __spreadValues(__spreadValues({
11241
+ type: "button"
11242
+ }, pick(
11243
+ component,
11244
+ "uid",
11245
+ "title",
11246
+ "control",
11247
+ "context",
11248
+ "disabled",
11249
+ "margin",
11250
+ "pinOrder",
11251
+ "size",
11252
+ "onClick"
11253
+ )), rendererMapperProps);
11254
+ };
11255
+
11256
+ // src/revamp/renderers/mappers/columnsComponentToProps.ts
11257
+ var columnsComponentToProps = ({ uid, bias, control, margin, startComponents, endComponents }, rendererMapperProps) => {
11258
+ const startChildrenProps = startComponents.map(
11259
+ (c) => componentToRendererProps(c, rendererMapperProps)
11260
+ );
11261
+ const endChildrenProps = endComponents.map(
11262
+ (c) => componentToRendererProps(c, rendererMapperProps)
11263
+ );
11264
+ return __spreadValues({
11265
+ uid,
11266
+ type: "columns",
11267
+ bias,
11268
+ control,
11269
+ margin,
11270
+ startChildren: startChildrenProps.map(rendererMapperProps.render),
11271
+ endChildren: endChildrenProps.map(rendererMapperProps.render),
11272
+ startChildrenProps,
11273
+ endChildrenProps
11274
+ }, rendererMapperProps);
11275
+ };
11276
+
11277
+ // src/revamp/renderers/mappers/containerComponentToProps.ts
11278
+ var containerComponentToProps = (component, rendererMapperProps) => {
11279
+ const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
11280
+ return __spreadValues({
11281
+ type: "container",
11282
+ uid: component.uid,
11283
+ children: childrenProps.map(rendererMapperProps.render),
11284
+ childrenProps
11285
+ }, rendererMapperProps);
11286
+ };
11287
+
11288
+ // src/revamp/renderers/mappers/dateInputComponentToProps.ts
11289
+ var dateInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-date")), rendererMapperProps), {
11290
+ autoComplete: component.autoComplete,
11291
+ minimumDate: component.minimumDate,
11292
+ maximumDate: component.maximumDate,
11293
+ onChange: component.onChange.bind(component)
11294
+ });
11295
+
11296
+ // src/revamp/renderers/mappers/decisionComponentToProps.ts
11297
+ var decisionComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, pick(component, "uid", "type", "control", "margin", "title")), rendererMapperProps), {
11298
+ options: component.options.map((_a) => {
11299
+ var _b = _a, { image } = _b, rest = __objRest(_b, ["image"]);
11300
+ var _a2, _b2, _c;
11301
+ return __spreadProps(__spreadValues({}, rest), {
11302
+ image: image ? {
11303
+ accessibilityDescription: (_a2 = image.accessibilityDescription) != null ? _a2 : image.text,
11304
+ uri: image.uri,
11305
+ url: (_c = (_b2 = image.uri) != null ? _b2 : image.url) != null ? _c : ""
11306
+ } : image
11307
+ });
11308
+ })
11309
+ });
11310
+
11311
+ // src/revamp/renderers/mappers/dividerComponentToProps.ts
11312
+ var dividerComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "type", "control", "margin")), rendererMapperProps);
11313
+
11314
+ // src/revamp/renderers/mappers/formComponentToProps.ts
11315
+ var formComponentToProps = (component, rendererMapperProps) => {
11316
+ const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
11317
+ const { uid, control, margin } = component;
11318
+ return __spreadValues({
11319
+ uid,
11320
+ type: "form",
11321
+ children: childrenProps.map(rendererMapperProps.render),
11322
+ childrenProps,
11323
+ control,
11324
+ margin
11325
+ }, rendererMapperProps);
11326
+ };
11327
+
11328
+ // src/revamp/renderers/mappers/headingComponentToProps.ts
11329
+ var headingComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "type", "align", "control", "margin", "size", "text")), rendererMapperProps);
11330
+
11331
+ // src/revamp/renderers/mappers/hiddenComponentToProps.ts
11332
+ var hiddenComponentToProps = ({ uid }) => ({
11333
+ uid,
11334
+ type: "hidden"
11335
+ });
11336
+
11337
+ // src/revamp/renderers/mappers/imageComponentToProps.ts
11338
+ var imageComponentToProps = (component, rendererMapperProps) => {
11339
+ var _a;
11340
+ return __spreadProps(__spreadValues(__spreadValues({}, pick(component, "uid", "type", "control", "margin", "size")), rendererMapperProps), {
11341
+ accessibilityDescription: component.content.accessibilityDescription,
11342
+ url: (_a = component.content.url) != null ? _a : "",
11343
+ uri: component.content.uri
11344
+ });
11345
+ };
11346
+
11347
+ // src/revamp/renderers/mappers/instructionsComponentToProps.ts
11348
+ var instructionsComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "type", "control", "items", "margin", "title")), rendererMapperProps);
11349
+
11350
+ // src/revamp/renderers/mappers/integerInputComponentToProps.ts
11351
+ var integerInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-integer")), rendererMapperProps), {
11352
+ autoComplete: component.autoComplete,
11353
+ maximum: component.maximum,
11354
+ minimum: component.minimum,
11355
+ onChange: component.onChange.bind(component)
11356
+ });
11357
+
11358
+ // src/revamp/renderers/mappers/loadingIndicatorComponentToProps.ts
11359
+ var loadingIndicatorComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "type", "control", "margin", "size")), rendererMapperProps);
11360
+
11361
+ // src/revamp/renderers/mappers/markdownComponentToProps.ts
11362
+ var markdownComponentToProps = (control, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(control, "uid", "type", "align", "margin", "content", "control")), rendererMapperProps);
11363
+
11364
+ // src/revamp/renderers/mappers/modalComponentToProps.ts
11365
+ var modalComponentToProps = (component, rendererMapperProps) => {
11366
+ const { uid, content, control, margin, trigger } = component;
11367
+ const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
11368
+ return __spreadValues({
11369
+ uid,
11370
+ type: "modal",
11371
+ content: {
11372
+ children: childrenProps.map(rendererMapperProps.render),
11373
+ childrenProps,
11374
+ title: content.title
11375
+ },
11376
+ control,
11377
+ margin,
11378
+ trigger
11379
+ }, rendererMapperProps);
11380
+ };
11381
+
11382
+ // src/revamp/renderers/mappers/multiUploadInputComponentToProps.ts
11383
+ var multiUploadInputComponentToProps = (component, rendererMapperProps) => {
11384
+ const { accepts, files, maxSize, minItems, maxItems, uploadLabel } = component;
11385
+ return __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-upload-multi")), rendererMapperProps), {
11386
+ accepts,
11387
+ maxSize,
11388
+ minItems,
11389
+ maxItems,
11390
+ uploadLabel,
11391
+ value: files.map((file) => __spreadProps(__spreadValues({}, file), {
11392
+ validationState: mapErrorsToValidationState(file.errors)
11393
+ })),
11394
+ onInsertFile: component.onInsertFile.bind(component),
11395
+ onRemoveFile: component.onRemoveFile.bind(component)
11396
+ });
11397
+ };
11398
+
11399
+ // src/revamp/renderers/mappers/numberInputComponentToProps.ts
11400
+ var numberInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-number")), rendererMapperProps), {
11401
+ maximum: component.maximum,
11402
+ minimum: component.minimum,
11403
+ onChange: component.onChange.bind(component)
11404
+ });
11405
+
11406
+ // src/revamp/renderers/mappers/objectComponentToProps.ts
11407
+ var objectComponentToProps = (component, rendererMapperProps) => {
11408
+ var _a, _b;
11409
+ const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
11410
+ return __spreadProps(__spreadValues(__spreadValues({
11411
+ type: "section"
11412
+ }, pick(component, "uid", "control", "description", "help", "icon", "title")), rendererMapperProps), {
11413
+ // TODO: Remove when viewbindings are updated
11414
+ image: component.image ? __spreadProps(__spreadValues({}, component.image), {
11415
+ url: (_b = (_a = component.image) == null ? void 0 : _a.url) != null ? _b : ""
11416
+ }) : void 0,
11417
+ children: childrenProps.map(rendererMapperProps.render),
11418
+ childrenProps
11419
+ });
11420
+ };
11421
+
11422
+ // src/revamp/renderers/mappers/paragraphComponentToProps.ts
11423
+ var paragraphComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "type", "align", "control", "margin", "text")), rendererMapperProps);
11424
+
11425
+ // src/revamp/renderers/mappers/repeatableComponentToProps.ts
11426
+ var repeatableComponentToProps = (component, rendererMapperProps) => {
11427
+ var _a, _b;
11428
+ const {
11429
+ uid,
11430
+ addItemTitle,
11431
+ control,
11432
+ components,
11433
+ description,
11434
+ editableComponent,
11435
+ editItemTitle,
11436
+ errors,
11437
+ icon,
11438
+ image,
11439
+ maxItems,
11440
+ minItems,
11441
+ summaryDefaults,
11442
+ title = "",
11443
+ onEdit,
11444
+ onAdd,
11445
+ onSave,
11446
+ onRemove
11447
+ } = component;
11448
+ const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
11449
+ const editableItemProps = editableComponent ? componentToRendererProps(editableComponent, rendererMapperProps) : null;
11450
+ const getSummaryImage = (componentSummary) => {
11451
+ var _a2, _b2;
11452
+ if (componentSummary.image) {
11453
+ return __spreadProps(__spreadValues({}, componentSummary.image), {
11454
+ url: (_a2 = componentSummary.image.url) != null ? _a2 : ""
11455
+ });
11456
+ }
11457
+ if (summaryDefaults.image) {
11458
+ return __spreadProps(__spreadValues({}, summaryDefaults.image), {
11459
+ url: (_b2 = summaryDefaults.image.url) != null ? _b2 : ""
11460
+ });
11461
+ }
11462
+ };
11463
+ const getSummary = (componentSummary) => {
11464
+ var _a2, _b2, _c;
11465
+ return {
11466
+ title: (_a2 = componentSummary.title) != null ? _a2 : summaryDefaults.title,
11467
+ description: (_b2 = componentSummary.description) != null ? _b2 : summaryDefaults.description,
11468
+ icon: (_c = componentSummary.icon) != null ? _c : summaryDefaults.icon,
11469
+ image: getSummaryImage(componentSummary)
11470
+ };
11471
+ };
11472
+ const itemProps = components.map((childComponent) => __spreadProps(__spreadValues({}, getSummary(childComponent.getSummary())), {
11473
+ id: `${childComponent.uid}-summary`
11474
+ }));
11475
+ return __spreadValues({
11476
+ uid,
11477
+ type: "repeatable",
11478
+ children: childrenProps.map(rendererMapperProps.render),
11479
+ childrenProps,
11480
+ addItemTitle,
11481
+ control,
11482
+ description,
11483
+ editableItem: rendererMapperProps.render(editableItemProps),
11484
+ editableItemProps,
11485
+ editItemTitle,
11486
+ error: errors == null ? void 0 : errors[0],
11487
+ icon,
11488
+ image: image ? {
11489
+ accessibilityDescription: (_a = image.accessibilityDescription) != null ? _a : image.text,
11490
+ uri: image.uri,
11491
+ url: (_b = image.url) != null ? _b : ""
11492
+ } : void 0,
11493
+ items: itemProps,
11494
+ maxItems,
11495
+ minItems,
11496
+ title,
11497
+ validationState: mapErrorsToValidationState(errors),
11498
+ onAdd: onAdd.bind(component),
11499
+ onEdit: onEdit.bind(component),
11500
+ onSave: onSave.bind(component),
11501
+ onRemove: onRemove.bind(component)
11502
+ }, rendererMapperProps);
11503
+ };
11504
+
11505
+ // src/revamp/renderers/mappers/reviewComponentToProps.ts
11506
+ var reviewComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "type", "callToAction", "control", "fields", "margin", "title")), rendererMapperProps);
11507
+
11508
+ // src/revamp/renderers/mappers/searchComponentToProps.ts
11509
+ var searchComponentToProps = (component, rendererMapperProps) => {
11510
+ const { uid, control, emptyMessage, error, isLoading, margin, query, results, title } = component;
11511
+ const onChange = component.onChange.bind(component);
11512
+ const onSelect = component.onSelect.bind(component);
11513
+ const state = getSearchState({
11514
+ emptyMessage,
11515
+ error,
11516
+ isLoading,
11517
+ query,
11518
+ results,
11519
+ onChange,
11520
+ onSelect
11521
+ });
11522
+ return __spreadValues({
11523
+ uid,
11524
+ type: "search",
11525
+ id: uid,
11526
+ control,
11527
+ isLoading,
11528
+ margin,
11529
+ query,
11530
+ state,
11531
+ title,
11532
+ onChange
11533
+ }, rendererMapperProps);
11534
+ };
11535
+ var getSearchState = ({
11536
+ emptyMessage,
11537
+ error,
11538
+ isLoading,
11539
+ query,
11540
+ results,
11541
+ onChange,
11542
+ onSelect
11543
+ }) => {
11544
+ if (!query || isLoading) {
11545
+ return { type: "pending" };
11546
+ }
11547
+ if (error) {
11548
+ return { type: "error", onRetry: () => onChange(query) };
11549
+ }
11550
+ if (results.length === 0) {
11551
+ return { type: "noResults", message: emptyMessage };
11552
+ }
11553
+ const rendererResults = results.map((result) => {
11554
+ var _a;
11555
+ return __spreadProps(__spreadValues({}, result), {
11556
+ id: result.type === "action" ? (_a = result.value.id) != null ? _a : result.value.$id : void 0,
11557
+ onClick: () => onSelect(result)
11558
+ });
11559
+ });
11560
+ return { type: "results", results: rendererResults };
11561
+ };
11562
+
11563
+ // src/revamp/renderers/mappers/selectInputComponentToProps.ts
11564
+ var selectInputComponentToProps = (component, rendererMapperProps) => {
11565
+ const { autoComplete, options, selectedIndex, onSelect } = component;
11566
+ const selectedChild = component.getSelectedChild();
11567
+ const childrenProps = selectedChild ? componentToRendererProps(selectedChild, rendererMapperProps) : null;
11568
+ const _a = inputComponentToProps(component, "input-select"), { value } = _a, props = __objRest(_a, ["value"]);
11569
+ return __spreadProps(__spreadValues(__spreadValues({}, props), rendererMapperProps), {
11570
+ autoComplete,
11571
+ options,
11572
+ selectedIndex,
11573
+ onSelect: onSelect.bind(component),
11574
+ children: rendererMapperProps.render(childrenProps),
11575
+ childrenProps
11576
+ });
11577
+ };
11578
+
11579
+ // src/revamp/renderers/mappers/statusListComponentToProps.ts
11580
+ var statusListComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "type", "control", "items", "margin", "title")), rendererMapperProps);
11581
+
11582
+ // src/revamp/renderers/mappers/textInputComponentToProps.ts
11583
+ var textInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-text")), rendererMapperProps), {
11584
+ autoComplete: component.autoComplete,
11585
+ autoCapitalize: component == null ? void 0 : component.autocapitalization,
11586
+ displayFormat: component.displayFormat,
11587
+ maxLength: component.maxLength,
11588
+ minLength: component.minLength,
11589
+ onChange: component.onChange.bind(component)
11590
+ });
11591
+
11592
+ // src/revamp/renderers/mappers/multiSelectComponentToProps.ts
11593
+ var multiSelectInputComponentToProps = (component, rendererMapperProps) => {
11594
+ const { autoComplete, maxItems, minItems, options, selectedIndices, onSelect } = component;
11595
+ const _a = inputComponentToProps(component, "input-multi-select"), { required, value } = _a, props = __objRest(_a, ["required", "value"]);
11596
+ return __spreadProps(__spreadValues(__spreadValues({}, props), rendererMapperProps), {
11597
+ autoComplete,
11598
+ maxItems,
11599
+ minItems,
11600
+ options,
11601
+ selectedIndices,
11602
+ onSelect: onSelect.bind(component)
11603
+ });
11604
+ };
11605
+
11606
+ // src/revamp/renderers/mappers/uploadInputComponentToProps.ts
11607
+ var uploadInputComponentToProps = (component, rendererMapperProps) => {
11608
+ const { accepts, maxSize } = component;
11609
+ return __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-upload")), rendererMapperProps), {
11610
+ accepts,
11611
+ maxSize,
11612
+ onUpload: component.onUpload.bind(component)
11613
+ });
11614
+ };
11615
+
11616
+ // src/revamp/renderers/mappers/tupleComponentToProps.ts
11617
+ var tupleComponentToProps = (component, rendererMapperProps) => {
11618
+ var _a, _b;
11619
+ const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
11620
+ return __spreadProps(__spreadValues(__spreadValues({
11621
+ type: "section"
11622
+ }, pick(component, "uid", "control", "description", "help", "icon", "title")), rendererMapperProps), {
11623
+ // TODO Remove URL default after next types update (add back to `pick`)
11624
+ image: component.image ? __spreadProps(__spreadValues({}, component.image), {
11625
+ url: (_b = (_a = component.image) == null ? void 0 : _a.url) != null ? _b : ""
11626
+ }) : void 0,
11627
+ children: childrenProps.map(rendererMapperProps.render),
11628
+ childrenProps
11629
+ });
11630
+ };
11631
+
11632
+ // src/revamp/renderers/mappers/listComponentToProps.ts
11633
+ var listComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, pick(component, "uid", "type", "callToAction", "control", "margin", "title")), rendererMapperProps), {
11634
+ items: component.items.map((_a) => {
11635
+ var _b = _a, { image } = _b, rest = __objRest(_b, ["image"]);
11636
+ var _a2, _b2, _c;
11637
+ return __spreadProps(__spreadValues({}, rest), {
11638
+ image: image ? {
11639
+ accessibilityDescription: (_a2 = image == null ? void 0 : image.accessibilityDescription) != null ? _a2 : image == null ? void 0 : image.text,
11640
+ uri: image == null ? void 0 : image.uri,
11641
+ url: (_c = (_b2 = image == null ? void 0 : image.url) != null ? _b2 : image == null ? void 0 : image.url) != null ? _c : ""
11642
+ } : void 0
11643
+ });
11644
+ })
11645
+ });
11646
+
11647
+ // src/revamp/renderers/stepComponentToProps.ts
11648
+ var stepComponentToProps = ({
11649
+ uid,
11650
+ back,
11651
+ description,
11652
+ error,
11653
+ external,
11654
+ loadingState,
11655
+ step,
11656
+ title,
11657
+ components,
11658
+ onAction
11659
+ }, rendererMapperProps) => {
11660
+ const childrenProps = components.map((c) => componentToRendererProps(c, rendererMapperProps));
11661
+ return __spreadValues({
11662
+ type: "step",
11663
+ uid,
11664
+ back,
11665
+ description,
11666
+ error,
11667
+ external,
11668
+ loadingState,
11669
+ title,
11670
+ step,
11671
+ onAction,
11672
+ children: childrenProps.map(rendererMapperProps.render),
11673
+ childrenProps
11674
+ }, rendererMapperProps);
11675
+ };
11676
+
11677
+ // src/revamp/renderers/mappers/componentToRendererProps.ts
11678
+ var componentToRendererProps = (component, rendererMapperProps) => {
11679
+ if (isHiddenComponent(component)) {
11680
+ return hiddenComponentToProps(component);
11681
+ }
11682
+ switch (component.type) {
11683
+ case "step":
11684
+ return stepComponentToProps(component, rendererMapperProps);
11685
+ case "alert":
11686
+ return alertComponentToProps(component, rendererMapperProps);
11687
+ case "all-of":
11688
+ return allOfComponentToProps(component, rendererMapperProps);
11689
+ case "boolean":
11690
+ return booleanInputComponentToProps(component, rendererMapperProps);
11691
+ case "box":
11692
+ return boxComponentToProps(component, rendererMapperProps);
11693
+ case "button":
11694
+ return buttonComponentToProps(component, rendererMapperProps);
11695
+ case "columns":
11696
+ return columnsComponentToProps(component, rendererMapperProps);
11697
+ case "container":
11698
+ return containerComponentToProps(component, rendererMapperProps);
11699
+ case "date":
11700
+ return dateInputComponentToProps(component, rendererMapperProps);
11701
+ case "decision":
11702
+ return decisionComponentToProps(component, rendererMapperProps);
11703
+ case "divider":
11704
+ return dividerComponentToProps(component, rendererMapperProps);
11705
+ case "form":
11706
+ return formComponentToProps(component, rendererMapperProps);
11707
+ case "heading":
11708
+ return headingComponentToProps(component, rendererMapperProps);
11709
+ case "const":
11710
+ return hiddenComponentToProps(component);
11711
+ case "image":
11712
+ return imageComponentToProps(component, rendererMapperProps);
11713
+ case "instructions":
11714
+ return instructionsComponentToProps(component, rendererMapperProps);
11715
+ case "integer":
11716
+ return integerInputComponentToProps(component, rendererMapperProps);
11717
+ case "list":
11718
+ return listComponentToProps(component, rendererMapperProps);
11719
+ case "loading-indicator":
11720
+ return loadingIndicatorComponentToProps(component, rendererMapperProps);
11721
+ case "markdown":
11722
+ return markdownComponentToProps(component, rendererMapperProps);
11723
+ case "modal":
11724
+ return modalComponentToProps(component, rendererMapperProps);
11725
+ case "multi-select":
11726
+ return multiSelectInputComponentToProps(component, rendererMapperProps);
11727
+ case "multi-upload":
11728
+ return multiUploadInputComponentToProps(component, rendererMapperProps);
11729
+ case "number":
11730
+ return numberInputComponentToProps(component, rendererMapperProps);
11731
+ case "object":
11732
+ return objectComponentToProps(component, rendererMapperProps);
11733
+ case "paragraph":
11734
+ return paragraphComponentToProps(component, rendererMapperProps);
11735
+ case "repeatable":
11736
+ return repeatableComponentToProps(component, rendererMapperProps);
11737
+ case "review":
11738
+ return reviewComponentToProps(component, rendererMapperProps);
11739
+ case "search":
11740
+ return searchComponentToProps(component, rendererMapperProps);
11741
+ case "select":
11742
+ return selectInputComponentToProps(component, rendererMapperProps);
11743
+ case "status-list":
11744
+ return statusListComponentToProps(component, rendererMapperProps);
11745
+ case "text":
11746
+ return textInputComponentToProps(component, rendererMapperProps);
11747
+ case "tuple":
11748
+ return tupleComponentToProps(component, rendererMapperProps);
11749
+ case "upload":
11750
+ return uploadInputComponentToProps(component, rendererMapperProps);
11751
+ default:
11752
+ throw new Error("Unknown component type");
11753
+ }
11754
+ };
11664
11755
 
11665
11756
  // src/revamp/DynamicFlowCore.tsx
11666
11757
  var import_jsx_runtime5 = require("react/jsx-runtime");
11667
11758
  function DynamicFlowCore(props) {
11668
11759
  var _a, _b;
11669
11760
  const { stepComponentRef } = useDynamicFlowCore(props);
11670
- const { renderers, onEvent, onError } = props;
11761
+ const { renderers, httpClient, onEvent, onError } = props;
11671
11762
  const render = (0, import_react4.useMemo)(
11672
11763
  () => getRenderFunction([CoreContainerRenderer, ...renderers]),
11673
11764
  [renderers]
11674
11765
  );
11766
+ const tree = stepComponentRef.current ? componentToRendererProps(stepComponentRef.current, {
11767
+ render,
11768
+ httpClient,
11769
+ trackEvent: stepComponentRef.current.trackEvent,
11770
+ stepLoadingState: stepComponentRef.current.loadingState
11771
+ }) : null;
11675
11772
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
11676
11773
  ErrorBoundary_default,
11677
11774
  {
@@ -11679,12 +11776,12 @@ function DynamicFlowCore(props) {
11679
11776
  onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed", { error });
11680
11777
  onError == null ? void 0 : onError(error);
11681
11778
  },
11682
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { id: (_b = (_a = stepComponentRef.current) == null ? void 0 : _a.step) == null ? void 0 : _b.id, className: "dynamic-flow", children: stepComponentRef.current ? render(stepComponentRef.current) : null })
11779
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { id: (_b = (_a = stepComponentRef.current) == null ? void 0 : _a.step) == null ? void 0 : _b.id, className: "dynamic-flow", children: render(tree) })
11683
11780
  }
11684
11781
  );
11685
11782
  }
11686
11783
 
11687
- // src/revamp/DynamicFragmentCore.tsx
11784
+ // src/revamp/DynamicFormCore.tsx
11688
11785
  var import_react5 = require("react");
11689
11786
 
11690
11787
  // src/revamp/utils/openLinkInNewTab.tsx
@@ -11698,11 +11795,18 @@ var openLinkInNewTab = (url) => {
11698
11795
  }
11699
11796
  };
11700
11797
 
11701
- // src/revamp/DynamicFragmentCore.tsx
11798
+ // src/revamp/DynamicFormCore.tsx
11702
11799
  var import_jsx_runtime6 = require("react/jsx-runtime");
11703
- var DynamicFragmentCore = (0, import_react5.forwardRef)(function DynamicFragmentCore2(props, ref) {
11704
- const { onCompletion = () => {
11705
- }, onEvent, onError, onLink = openLinkInNewTab, renderers } = props;
11800
+ var DynamicFormCore = (0, import_react5.forwardRef)(function DynamicFormCore2(props, ref) {
11801
+ const {
11802
+ onCompletion = () => {
11803
+ },
11804
+ httpClient,
11805
+ onEvent,
11806
+ onError,
11807
+ onLink = openLinkInNewTab,
11808
+ renderers
11809
+ } = props;
11706
11810
  const { stepComponentRef } = useDynamicFlowCore(__spreadProps(__spreadValues({ onCompletion }, props), { onLink }));
11707
11811
  (0, import_react5.useImperativeHandle)(
11708
11812
  ref,
@@ -11723,6 +11827,12 @@ var DynamicFragmentCore = (0, import_react5.forwardRef)(function DynamicFragment
11723
11827
  () => getRenderFunction([CoreContainerRenderer, ...renderers]),
11724
11828
  [renderers]
11725
11829
  );
11830
+ const tree = stepComponentRef.current ? componentToRendererProps(stepComponentRef.current, {
11831
+ render,
11832
+ httpClient,
11833
+ trackEvent: stepComponentRef.current.trackEvent,
11834
+ stepLoadingState: stepComponentRef.current.loadingState
11835
+ }) : null;
11726
11836
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
11727
11837
  ErrorBoundary_default,
11728
11838
  {
@@ -11730,7 +11840,7 @@ var DynamicFragmentCore = (0, import_react5.forwardRef)(function DynamicFragment
11730
11840
  onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed");
11731
11841
  onError(error);
11732
11842
  },
11733
- children: stepComponentRef.current ? render(stepComponentRef.current) : null
11843
+ children: render(tree)
11734
11844
  }
11735
11845
  );
11736
11846
  });
@@ -13032,7 +13142,7 @@ var import_components3 = require("@transferwise/components");
13032
13142
  // src/legacy/layout/utils/getNavigationOptionMedia.tsx
13033
13143
  var import_components2 = require("@transferwise/components");
13034
13144
 
13035
- // ../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.20.1_@types+react@18.3.18_react-dom@18.3.1_reac_mzw7cg6j4wc7ddwlhxck7linn4/node_modules/@wise/art/dist/index.esm.js
13145
+ // ../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.22.0_@types+react@18.3.18_react-dom@18.3.1_reac_62coi6aa7fmdhpcz7p72kf3gum/node_modules/@wise/art/dist/index.esm.js
13036
13146
  init_index_8Fxev6OI_esm();
13037
13147
  init_clsx();
13038
13148
  var import_react15 = require("react");