@wise/dynamic-flow-client 3.9.4 → 3.11.0

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 (48) hide show
  1. package/build/main.js +1284 -962
  2. package/build/main.min.js +1 -1
  3. package/build/main.mjs +982 -660
  4. package/build/types/legacy/dynamicFlow/tests/DynamicFlow.InitialAction.spec.d.ts +1 -0
  5. package/build/types/legacy/dynamicFlow/tests/DynamicFlow.InitialStep.spec.d.ts +1 -0
  6. package/build/types/legacy/dynamicFlow/tests/DynamicFlow.LoaderConfig.spec.d.ts +1 -0
  7. package/build/types/legacy/dynamicFlow/tests/DynamicFlow.legacy.spec.d.ts +1 -0
  8. package/build/types/legacy/formControl/FormControl.spec.d.ts +1 -0
  9. package/build/types/legacy/jsonSchemaForm/JsonSchemaForm.spec.d.ts +1 -0
  10. package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/ArrayTypeSchema.spec.d.ts +1 -0
  11. package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.errors.spec.d.ts +1 -0
  12. package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.spec.d.ts +1 -0
  13. package/build/types/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.spec.d.ts +1 -0
  14. package/build/types/legacy/jsonSchemaForm/genericSchema/GenericSchema.spec.d.ts +1 -0
  15. package/build/types/legacy/jsonSchemaForm/help/Help.spec.d.ts +1 -0
  16. package/build/types/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.spec.d.ts +1 -0
  17. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.spec.d.ts +1 -0
  18. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.spec.d.ts +1 -0
  19. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.spec.d.ts +1 -0
  20. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.spec.d.ts +1 -0
  21. package/build/types/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.spec.d.ts +1 -0
  22. package/build/types/legacy/layout/DynamicLayout.end-to-end.spec.d.ts +1 -0
  23. package/build/types/legacy/layout/DynamicLayout.spec.d.ts +1 -0
  24. package/build/types/legacy/layout/alert/DynamicAlert.spec.d.ts +1 -0
  25. package/build/types/legacy/layout/box/DynamicBox.spec.d.ts +1 -0
  26. package/build/types/legacy/layout/columns/DynamicColumns.spec.d.ts +1 -0
  27. package/build/types/legacy/layout/decision/DynamicDecision.spec.d.ts +1 -0
  28. package/build/types/legacy/layout/divider/DynamicDivider.spec.d.ts +1 -0
  29. package/build/types/legacy/layout/external/DynamicExternal.spec.d.ts +1 -0
  30. package/build/types/legacy/layout/form/DynamicForm.spec.d.ts +1 -0
  31. package/build/types/legacy/layout/heading/DynamicHeading.spec.d.ts +1 -0
  32. package/build/types/legacy/layout/paragraph/DynamicParagraph.spec.d.ts +1 -0
  33. package/build/types/legacy/step/layoutStep/LayoutStep.spec.d.ts +1 -0
  34. package/build/types/revamp/domain/components/MultiSelectInputComponent.d.ts +28 -0
  35. package/build/types/revamp/domain/components/StepDomainComponent.d.ts +5 -2
  36. package/build/types/revamp/domain/components/utils/local-value.d.ts +2 -0
  37. package/build/types/revamp/domain/features/persistAsync/getComponentPersistAsync.d.ts +2 -1
  38. package/build/types/revamp/domain/features/validationAsync/getComponentValidationAsync.d.ts +2 -1
  39. package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToComponent.d.ts +1 -1
  40. package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToMultiSelectComponent.d.ts +8 -0
  41. package/build/types/revamp/domain/types.d.ts +4 -3
  42. package/build/types/revamp/renderers/mappers/multiSelectComponentToProps.d.ts +3 -0
  43. package/build/types/revamp/renderers/stepComponentToProps.d.ts +1 -1
  44. package/build/types/revamp/renderers/types.d.ts +12 -1
  45. package/build/types/revamp/types.d.ts +2 -2
  46. package/build/types/revamp/wise/renderers/MultiSelectInputRenderer.d.ts +4 -0
  47. package/build/types/revamp/wise/renderers/getWiseRenderers.d.ts +1 -1
  48. package/package.json +3 -4
package/build/main.mjs CHANGED
@@ -1269,11 +1269,14 @@ var isStringSchemaWithUpload = (schema) => isStringSchema(schema) && schema.form
1269
1269
  var isSchemaWithPersistAsync = (schema) => "persistAsync" in schema && !isNullish(schema.persistAsync);
1270
1270
 
1271
1271
  // src/revamp/renderers/stepComponentToProps.ts
1272
- var stepComponentToProps = ({ back, external, loadingState, trackEvent }, children) => ({
1272
+ var stepComponentToProps = ({ back, description, error, external, loadingState, title, trackEvent }, children) => ({
1273
1273
  type: "step",
1274
1274
  back,
1275
+ description,
1276
+ error,
1275
1277
  external,
1276
1278
  loadingState,
1279
+ title,
1277
1280
  trackEvent,
1278
1281
  children
1279
1282
  });
@@ -1685,6 +1688,17 @@ var textInputComponentToProps = (component) => __spreadProps(__spreadValues({},
1685
1688
  onChange: component.onChange.bind(component)
1686
1689
  });
1687
1690
 
1691
+ // src/revamp/renderers/mappers/multiSelectComponentToProps.ts
1692
+ var multiSelectInputComponentToProps = (component) => {
1693
+ const { options, selectedIndices, onSelect } = component;
1694
+ const _a = inputComponentToProps(component, "input-multi-select"), { value } = _a, props = __objRest(_a, ["value"]);
1695
+ return __spreadProps(__spreadValues({}, props), {
1696
+ options,
1697
+ selectedIndices,
1698
+ onSelect: onSelect.bind(component)
1699
+ });
1700
+ };
1701
+
1688
1702
  // src/revamp/renderers/mappers/uploadInputComponentToProps.ts
1689
1703
  var uploadInputComponentToProps = (component) => {
1690
1704
  const { accepts, maxSize } = component;
@@ -1742,6 +1756,8 @@ var componentToRendererProps = (component, nestedContent) => {
1742
1756
  return markdownComponentToProps(component);
1743
1757
  case "modal":
1744
1758
  return modalComponentToProps(component, children);
1759
+ case "multi-select":
1760
+ return multiSelectInputComponentToProps(component);
1745
1761
  case "multi-upload":
1746
1762
  return multiUploadInputComponentToProps(component);
1747
1763
  case "number":
@@ -6484,27 +6500,6 @@ var alertLayoutToComponent = (uid, { control, markdown, margin = "md", context =
6484
6500
  context: mapLegacyContext(context)
6485
6501
  });
6486
6502
 
6487
- // src/revamp/domain/components/HeadingComponent.ts
6488
- var createHeadingComponent = (headingProps) => __spreadProps(__spreadValues({
6489
- type: "heading"
6490
- }, headingProps), {
6491
- getSubmittableValue: async () => null,
6492
- getSummary: () => ({}),
6493
- // Noop
6494
- getLocalValue: () => null,
6495
- validate: () => true
6496
- });
6497
-
6498
- // src/revamp/domain/mappers/layout/headingLayoutToComponent.ts
6499
- var headingLayoutToComponent = (uid, { align = "left", margin = "md", size = "md", control, text }) => createHeadingComponent({
6500
- uid,
6501
- align: mapLegacyAlign(align),
6502
- control,
6503
- margin,
6504
- size,
6505
- text
6506
- });
6507
-
6508
6503
  // src/revamp/domain/components/BoxComponent.ts
6509
6504
  var createBoxComponent = (boxProps) => __spreadProps(__spreadValues({}, boxProps), {
6510
6505
  type: "box",
@@ -6702,6 +6697,17 @@ var abortAndResetController = (abortController) => {
6702
6697
  return new AbortController();
6703
6698
  };
6704
6699
 
6700
+ // src/revamp/domain/components/utils/local-value.ts
6701
+ var compareLocalValue = (valueA, valueB) => {
6702
+ if (isArrayLocalValue(valueA) && isArrayLocalValue(valueB)) {
6703
+ return valueA.length === valueB.length && valueA.every((value, index) => compareLocalValue(value, valueB[index]));
6704
+ }
6705
+ if (isObjectLocalValue(valueA) && isObjectLocalValue(valueB)) {
6706
+ return Object.keys(valueA).every((key) => compareLocalValue(valueA[key], valueB[key]));
6707
+ }
6708
+ return valueA === valueB;
6709
+ };
6710
+
6705
6711
  // src/revamp/domain/features/persistAsync/getComponentPersistAsync.ts
6706
6712
  var getComponentPersistAsync = (update, performPersistAsync) => (
6707
6713
  /**
@@ -6710,7 +6716,7 @@ var getComponentPersistAsync = (update, performPersistAsync) => (
6710
6716
  */
6711
6717
  async (persistedState, currentValue) => {
6712
6718
  const { abortController, lastSubmitted, submission } = persistedState;
6713
- if (lastSubmitted === currentValue) {
6719
+ if (compareLocalValue(lastSubmitted, currentValue)) {
6714
6720
  return submission;
6715
6721
  }
6716
6722
  const newAbortController = abortAndResetController(abortController);
@@ -7769,15 +7775,6 @@ var isPartialLocalValueMatch = (partialValue, component) => {
7769
7775
  return compareLocalValue(partialValue, componentValue);
7770
7776
  };
7771
7777
  var areEquivalentFiles = (fileA, fileB) => fileA.name === fileB.name && fileA.type === fileB.type && fileA.size === fileB.size;
7772
- var compareLocalValue = (valueA, valueB) => {
7773
- if (isArrayLocalValue(valueA) && isArrayLocalValue(valueB)) {
7774
- return valueA.length === valueB.length && valueA.every((value, index) => compareLocalValue(value, valueB[index]));
7775
- }
7776
- if (isObjectLocalValue(valueA) && isObjectLocalValue(valueB)) {
7777
- return Object.keys(valueA).every((key) => compareLocalValue(valueA[key], valueB[key]));
7778
- }
7779
- return valueA === valueB;
7780
- };
7781
7778
 
7782
7779
  // src/revamp/domain/components/SelectInputComponent.ts
7783
7780
  var createSelectInputComponent = (selectProps, updateComponent) => {
@@ -8745,6 +8742,193 @@ var getPersistAsyncConfig = (schema) => {
8745
8742
  };
8746
8743
  var getValueForPersistAsync = (localValue) => isArray(localValue) && localValue.every(isFile) ? localValue : [];
8747
8744
 
8745
+ // src/revamp/domain/components/MultiSelectInputComponent.ts
8746
+ var createMultiSelectComponent = (multiSelectProps, updateComponent) => {
8747
+ const _a = multiSelectProps, {
8748
+ uid,
8749
+ checks,
8750
+ options,
8751
+ initialValue,
8752
+ performPersistAsync,
8753
+ performValidationAsync,
8754
+ performRefresh,
8755
+ onValueChange
8756
+ } = _a, rest = __objRest(_a, [
8757
+ "uid",
8758
+ "checks",
8759
+ "options",
8760
+ "initialValue",
8761
+ "performPersistAsync",
8762
+ "performValidationAsync",
8763
+ "performRefresh",
8764
+ "onValueChange"
8765
+ ]);
8766
+ const update = getInputUpdateFunction(uid, updateComponent);
8767
+ const children = options.map((option) => option.component);
8768
+ const selectedIndices = getInitialModelIndices(initialValue, children);
8769
+ const getValidationErrors = getLocalValueValidator(checks);
8770
+ const getAndSetValidationErrors = (currentValue) => {
8771
+ const messages = getValidationErrors(currentValue);
8772
+ update((draft) => {
8773
+ draft.errors = messages;
8774
+ });
8775
+ return messages;
8776
+ };
8777
+ const inputComponent = __spreadProps(__spreadValues({
8778
+ uid,
8779
+ type: "multi-select",
8780
+ children,
8781
+ options,
8782
+ selectedIndices,
8783
+ value: null
8784
+ }, rest), {
8785
+ onSelect(indices) {
8786
+ update((draft) => {
8787
+ draft.selectedIndices = indices;
8788
+ draft.errors = [];
8789
+ });
8790
+ performRefresh == null ? void 0 : performRefresh();
8791
+ onValueChange();
8792
+ getAndSetValidationErrors(this.getLocalValue());
8793
+ },
8794
+ onBlur() {
8795
+ },
8796
+ // Noop
8797
+ onFocus() {
8798
+ },
8799
+ // Noop
8800
+ getLocalValue() {
8801
+ var _a2, _b;
8802
+ return (_b = (_a2 = this.getSelectedChildren()) == null ? void 0 : _a2.map((child) => child.getLocalValue())) != null ? _b : null;
8803
+ },
8804
+ validate() {
8805
+ const messages = getAndSetValidationErrors(this.getLocalValue());
8806
+ return messages.length === 0;
8807
+ },
8808
+ async getSubmittableValue() {
8809
+ const selected = this.getSelectedChildren();
8810
+ if (selected) {
8811
+ return Promise.all(selected.map(async (child) => child.getSubmittableValue()));
8812
+ }
8813
+ return null;
8814
+ },
8815
+ getSummary: () => ({}),
8816
+ getChildren() {
8817
+ return this.children;
8818
+ },
8819
+ getSelectedChildren() {
8820
+ return this.selectedIndices.map((i) => this.children[i]);
8821
+ }
8822
+ });
8823
+ if (performRefresh) {
8824
+ return inputComponent;
8825
+ }
8826
+ if (performPersistAsync) {
8827
+ const persist = getComponentPersistAsync(update, performPersistAsync);
8828
+ return __spreadProps(__spreadValues({}, inputComponent), {
8829
+ isPersisted: true,
8830
+ onSelect(indices) {
8831
+ inputComponent.onSelect.call(this, indices);
8832
+ const isValid2 = getValidationErrors(this.getLocalValue()).length === 0;
8833
+ if (isValid2 && indices != null) {
8834
+ persist(this.persistedState, this.getLocalValue()).catch(() => {
8835
+ });
8836
+ }
8837
+ },
8838
+ async getSubmittableValue() {
8839
+ return persist(this.persistedState, this.getLocalValue());
8840
+ }
8841
+ });
8842
+ }
8843
+ if (performValidationAsync) {
8844
+ const validateAsync = getComponentValidationAsync(update, performValidationAsync);
8845
+ return __spreadProps(__spreadValues({}, inputComponent), {
8846
+ onSelect(indices) {
8847
+ inputComponent.onSelect.call(this, indices);
8848
+ if (this.validate()) {
8849
+ validateAsync(this.validationState, this.getLocalValue()).catch(() => {
8850
+ });
8851
+ }
8852
+ }
8853
+ });
8854
+ }
8855
+ return inputComponent;
8856
+ };
8857
+ var getInitialModelIndices = (model, options) => {
8858
+ if (!isArray(model)) {
8859
+ return [];
8860
+ }
8861
+ return model.map((m) => options.findIndex((o) => o.getLocalValue() === m)).filter((n) => n >= 0);
8862
+ };
8863
+
8864
+ // src/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToMultiSelectComponent.ts
8865
+ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
8866
+ const {
8867
+ uid,
8868
+ localValue,
8869
+ schema,
8870
+ model,
8871
+ required = false,
8872
+ validationErrors: initialError
8873
+ } = schemaMapperProps;
8874
+ const initialModel = model != null ? model : null;
8875
+ const options = schema.items.oneOf.map((childSchema, index) => {
8876
+ const { title: title2 = "", description, image, icon, keywords = [] } = childSchema;
8877
+ return {
8878
+ title: title2,
8879
+ description,
8880
+ image,
8881
+ icon,
8882
+ keywords,
8883
+ disabled: "disabled" in childSchema ? Boolean(childSchema.disabled) : false,
8884
+ component: mapSchemaToComponent(
8885
+ {
8886
+ uid: `${uid}.oneOf-${index}`,
8887
+ schema: childSchema,
8888
+ model: initialModel,
8889
+ localValue,
8890
+ validationErrors: initialError,
8891
+ required
8892
+ },
8893
+ mapperProps
8894
+ )
8895
+ };
8896
+ });
8897
+ const { title, validationMessages } = schema;
8898
+ const { getErrorMessageFunctions, onRefresh, onValueChange, updateComponent } = mapperProps;
8899
+ const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
8900
+ const { performPersistAsync, persistedState } = getPersistAsyncInitialState(
8901
+ schemaMapperProps,
8902
+ mapperProps
8903
+ );
8904
+ const { performValidationAsync, validationState } = getValidationAsyncInitialState(
8905
+ schemaMapperProps,
8906
+ mapperProps
8907
+ );
8908
+ const initialValue = performPersistAsync ? localValue : model != null ? model : null;
8909
+ return createMultiSelectComponent(
8910
+ __spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
8911
+ autoComplete: "off",
8912
+ checks: schema.hidden ? [] : [
8913
+ getRequiredCheck(required, errorMessageFunctions),
8914
+ getAboveMaxItemsCheck(schema, errorMessageFunctions),
8915
+ getBelowMinItemsCheck(schema, errorMessageFunctions)
8916
+ ],
8917
+ initialValue,
8918
+ options,
8919
+ required,
8920
+ persistedState,
8921
+ performPersistAsync,
8922
+ title,
8923
+ validationState,
8924
+ performValidationAsync,
8925
+ performRefresh: getPerformRefresh(schema, onRefresh),
8926
+ onValueChange
8927
+ }),
8928
+ updateComponent
8929
+ );
8930
+ };
8931
+
8748
8932
  // src/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToComponent.ts
8749
8933
  var arraySchemaToComponent = (schemaMapperProps, mapperProps) => {
8750
8934
  const { schema, model: originalModel } = schemaMapperProps;
@@ -8752,6 +8936,9 @@ var arraySchemaToComponent = (schemaMapperProps, mapperProps) => {
8752
8936
  if (isArraySchemaListWithMultiFileUpload(schema)) {
8753
8937
  return arraySchemaToMultiUploadComponent(__spreadProps(__spreadValues({}, schemaMapperProps), { schema, model }), mapperProps);
8754
8938
  }
8939
+ if (isArraySchemaListWithMultiSelect(schema)) {
8940
+ return arraySchemaToMultiSelectComponent(__spreadProps(__spreadValues({}, schemaMapperProps), { schema, model }), mapperProps);
8941
+ }
8755
8942
  if (isArrayListSchema(schema)) {
8756
8943
  return arraySchemaToRepeatableComponent(__spreadProps(__spreadValues({}, schemaMapperProps), { schema, model }), mapperProps);
8757
8944
  }
@@ -8759,6 +8946,7 @@ var arraySchemaToComponent = (schemaMapperProps, mapperProps) => {
8759
8946
  };
8760
8947
  var isArraySchemaListWithMultiFileUpload = (schema) => isArrayListSchema(schema) && (isPersistAsyncWithUploadSchema(schema.items) || isStringSchemaWithUpload(schema.items));
8761
8948
  var isPersistAsyncWithUploadSchema = (schema) => isSchemaWithPersistAsync(schema) && (isBlobSchema(schema.persistAsync.schema) || isStringSchemaWithUpload(schema.persistAsync.schema));
8949
+ var isArraySchemaListWithMultiSelect = (schema) => isArrayListSchema(schema) && "oneOf" in schema.items && schema.items.oneOf.every(isConstSchema);
8762
8950
 
8763
8951
  // src/revamp/domain/components/BooleanInputComponent.ts
8764
8952
  var createBooleanInputComponent = (booleanInputProps, updateComponent) => {
@@ -9022,6 +9210,27 @@ var formLayoutToComponent = (uid, { schemaId, schema: schemaRef, control, margin
9022
9210
  });
9023
9211
  };
9024
9212
 
9213
+ // src/revamp/domain/components/HeadingComponent.ts
9214
+ var createHeadingComponent = (headingProps) => __spreadProps(__spreadValues({
9215
+ type: "heading"
9216
+ }, headingProps), {
9217
+ getSubmittableValue: async () => null,
9218
+ getSummary: () => ({}),
9219
+ // Noop
9220
+ getLocalValue: () => null,
9221
+ validate: () => true
9222
+ });
9223
+
9224
+ // src/revamp/domain/mappers/layout/headingLayoutToComponent.ts
9225
+ var headingLayoutToComponent = (uid, { align = "left", margin = "md", size = "md", control, text }) => createHeadingComponent({
9226
+ uid,
9227
+ align: mapLegacyAlign(align),
9228
+ control,
9229
+ margin,
9230
+ size,
9231
+ text
9232
+ });
9233
+
9025
9234
  // src/revamp/domain/components/ImageComponent.ts
9026
9235
  var createImageComponent = (imageProps) => __spreadProps(__spreadValues({
9027
9236
  type: "image"
@@ -9494,7 +9703,7 @@ var mapStepToComponent = (_a) => {
9494
9703
  ]);
9495
9704
  var _a2, _b2;
9496
9705
  const { httpClient, step, updateComponent } = restProps;
9497
- const { id, navigation, external, key, layout = [], polling } = step;
9706
+ const { id, description, errors, external, key, layout = [], navigation, polling, title } = step;
9498
9707
  const backNavigation = (_a2 = navigation == null ? void 0 : navigation.back) != null ? _a2 : navigation == null ? void 0 : navigation.backButton;
9499
9708
  const back = backNavigation ? {
9500
9709
  title: backNavigation.title,
@@ -9531,34 +9740,21 @@ var mapStepToComponent = (_a) => {
9531
9740
  onRefresh
9532
9741
  }))
9533
9742
  );
9534
- const additionalComponents = makeAdditionalComponents(step, uid, displayStepTitle);
9535
9743
  const stepComponent = createStepComponent({
9536
9744
  uid,
9537
- components: [...additionalComponents, ...layoutComponents],
9538
9745
  back,
9746
+ components: layoutComponents,
9747
+ description,
9748
+ error: errors == null ? void 0 : errors.error,
9539
9749
  external,
9540
9750
  loadingState,
9541
9751
  stepPolling,
9542
9752
  updateComponent,
9753
+ title: displayStepTitle ? title : void 0,
9543
9754
  trackEvent
9544
9755
  });
9545
9756
  return stepComponent;
9546
9757
  };
9547
- var makeAdditionalComponents = (step, uid, displayStepTitle) => {
9548
- const { title, errors } = step;
9549
- const heading = title && displayStepTitle ? headingLayoutToComponent(`${uid}.title`, {
9550
- type: "heading",
9551
- text: title,
9552
- align: "center",
9553
- size: "lg"
9554
- }) : void 0;
9555
- const stepError = (errors == null ? void 0 : errors.error) ? alertLayoutToComponent(`${uid}.global-error`, {
9556
- type: "alert",
9557
- markdown: errors.error,
9558
- context: "negative"
9559
- }) : void 0;
9560
- return [...heading ? [heading] : [], ...stepError ? [stepError] : []];
9561
- };
9562
9758
 
9563
9759
  // src/revamp/flow/executeRefresh.ts
9564
9760
  var executeRefresh = async (props) => {
@@ -10196,7 +10392,7 @@ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
10196
10392
  return deterministicId || (id ? `radix-${id}` : "");
10197
10393
  }
10198
10394
 
10199
- // ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.29.0_@types+react@18.0.29_react@18.2.0/node_modules/@wise/forms/dist/index.mjs
10395
+ // ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.35.0_@types+react@18.0.29_react@18.2.0/node_modules/@wise/forms/dist/index.mjs
10200
10396
  var import_classnames = __toESM(require_classnames(), 1);
10201
10397
  import { InlineAlert, Sentiment as Sentiment2, Input, TextArea } from "@transferwise/components";
10202
10398
  import { createContext as createContext2, useContext as useContext2, forwardRef } from "react";
@@ -10984,13 +11180,131 @@ function DFModal({ content, margin, trigger }) {
10984
11180
  ] });
10985
11181
  }
10986
11182
 
11183
+ // src/revamp/wise/renderers/MultiSelectInputRenderer.tsx
11184
+ import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
11185
+
11186
+ // src/revamp/wise/renderers/SelectInputRenderer/OptionMedia.tsx
11187
+ import { Avatar as Avatar2, AvatarType as AvatarType2 } from "@transferwise/components";
11188
+ import { jsx as jsx34 } from "react/jsx-runtime";
11189
+ function OptionMedia({ icon, image }) {
11190
+ if (image == null ? void 0 : image.url) {
11191
+ return /* @__PURE__ */ jsx34("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
11192
+ }
11193
+ if (icon && "name" in icon) {
11194
+ return /* @__PURE__ */ jsx34(Avatar2, { type: AvatarType2.ICON, children: /* @__PURE__ */ jsx34(DynamicIcon_default, { name: icon.name }) });
11195
+ }
11196
+ if (icon && "text" in icon) {
11197
+ return /* @__PURE__ */ jsx34(Avatar2, { type: AvatarType2.INITIALS, children: icon.text });
11198
+ }
11199
+ return null;
11200
+ }
11201
+
11202
+ // src/revamp/wise/renderers/MultiSelectInputRenderer.tsx
11203
+ import { useIntl as useIntl4 } from "react-intl";
11204
+
11205
+ // src/common/messages/multi-select.messages.ts
11206
+ import { defineMessages as defineMessages6 } from "react-intl";
11207
+ var multi_select_messages_default = defineMessages6({
11208
+ summary: {
11209
+ id: "dynamicFlows.MultiSelect.summary",
11210
+ defaultMessage: "{first} and {count} more",
11211
+ description: "A summary of the multiple items selected. Showing the title of the first selected item, and the number of other items that have been selected."
11212
+ }
11213
+ });
11214
+
11215
+ // src/revamp/wise/renderers/MultiSelectInputRenderer.tsx
11216
+ import { useState as useState6 } from "react";
11217
+ import { jsx as jsx35 } from "react/jsx-runtime";
11218
+ var MultiSelectInputRenderer = {
11219
+ canRenderType: "input-multi-select",
11220
+ render: (props) => /* @__PURE__ */ jsx35(MultiSelectInputRendererComponent, __spreadValues({}, props))
11221
+ };
11222
+ function MultiSelectInputRendererComponent(props) {
11223
+ const { formatMessage } = useIntl4();
11224
+ const [stagedIndices, setStagedIndices] = useState6();
11225
+ const {
11226
+ id,
11227
+ description,
11228
+ disabled,
11229
+ label,
11230
+ help,
11231
+ error,
11232
+ options,
11233
+ placeholder,
11234
+ selectedIndices,
11235
+ onSelect
11236
+ } = props;
11237
+ const mergedIndices = stagedIndices != null ? stagedIndices : selectedIndices;
11238
+ const getFormattedMessage = () => {
11239
+ if (mergedIndices.length > 0) {
11240
+ if (mergedIndices.length > 1) {
11241
+ return formatMessage(multi_select_messages_default.summary, {
11242
+ first: options[mergedIndices[0]].title,
11243
+ count: mergedIndices.length - 1
11244
+ });
11245
+ }
11246
+ return options[mergedIndices[0]].title;
11247
+ }
11248
+ return void 0;
11249
+ };
11250
+ const renderValue = (index, withinTrigger) => {
11251
+ const option = index >= 0 ? options[index] : null;
11252
+ if (option === null) {
11253
+ return null;
11254
+ }
11255
+ if (withinTrigger) {
11256
+ return index === mergedIndices[0] ? getFormattedMessage() : void 0;
11257
+ }
11258
+ const contentProps = {
11259
+ title: option.title,
11260
+ description: option.description,
11261
+ icon: /* @__PURE__ */ jsx35(OptionMedia, { icon: option.icon, image: option.image })
11262
+ };
11263
+ return /* @__PURE__ */ jsx35(SelectInputOptionContent, __spreadValues({}, contentProps));
11264
+ };
11265
+ return /* @__PURE__ */ jsx35(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx35(
11266
+ SelectInput,
11267
+ {
11268
+ id,
11269
+ items: options.map((option, index) => {
11270
+ var _a, _b, _c;
11271
+ return {
11272
+ type: "option",
11273
+ value: index,
11274
+ filterMatchers: [
11275
+ ...(_a = option.keywords) != null ? _a : [],
11276
+ (_b = option.title) != null ? _b : "",
11277
+ (_c = option.description) != null ? _c : ""
11278
+ ],
11279
+ disabled: option.disabled
11280
+ };
11281
+ }),
11282
+ disabled,
11283
+ placeholder,
11284
+ value: mergedIndices,
11285
+ renderValue,
11286
+ multiple: true,
11287
+ onChange: (values) => {
11288
+ setStagedIndices(values);
11289
+ },
11290
+ onClose: () => {
11291
+ if (stagedIndices) {
11292
+ onSelect(stagedIndices);
11293
+ setStagedIndices(void 0);
11294
+ }
11295
+ }
11296
+ }
11297
+ ) });
11298
+ }
11299
+ var MultiSelectInputRenderer_default = MultiSelectInputRenderer;
11300
+
10987
11301
  // src/revamp/wise/renderers/MultiUploadInputRenderer.tsx
10988
11302
  import { UploadInput } from "@transferwise/components";
10989
11303
 
10990
11304
  // src/revamp/wise/renderers/components/UploadFieldInput.tsx
10991
11305
  var import_classnames4 = __toESM(require_classnames());
10992
11306
  import { InlineAlert as InlineAlert2 } from "@transferwise/components";
10993
- import { jsx as jsx34, jsxs as jsxs9 } from "react/jsx-runtime";
11307
+ import { jsx as jsx36, jsxs as jsxs9 } from "react/jsx-runtime";
10994
11308
  function UploadFieldInput({
10995
11309
  id,
10996
11310
  children,
@@ -10999,7 +11313,7 @@ function UploadFieldInput({
10999
11313
  error,
11000
11314
  help
11001
11315
  }) {
11002
- const labelContent = label && help ? /* @__PURE__ */ jsx34(LabelContentWithHelp, { text: label, help }) : label;
11316
+ const labelContent = label && help ? /* @__PURE__ */ jsx36(LabelContentWithHelp, { text: label, help }) : label;
11003
11317
  const descriptionId = description ? `${id}-description` : void 0;
11004
11318
  return /* @__PURE__ */ jsxs9(
11005
11319
  "div",
@@ -11008,9 +11322,9 @@ function UploadFieldInput({
11008
11322
  "has-error": !!error
11009
11323
  }),
11010
11324
  children: [
11011
- /* @__PURE__ */ jsx34("label", { htmlFor: id, className: "control-label", children: labelContent }),
11325
+ /* @__PURE__ */ jsx36("label", { htmlFor: id, className: "control-label", children: labelContent }),
11012
11326
  children,
11013
- error && /* @__PURE__ */ jsx34(InlineAlert2, { type: "negative", id: descriptionId, children: error })
11327
+ error && /* @__PURE__ */ jsx36(InlineAlert2, { type: "negative", id: descriptionId, children: error })
11014
11328
  ]
11015
11329
  }
11016
11330
  );
@@ -11053,7 +11367,7 @@ var nanoid = (size = 21) => {
11053
11367
  var getRandomId = () => nanoid(10);
11054
11368
 
11055
11369
  // src/revamp/wise/renderers/MultiUploadInputRenderer.tsx
11056
- import { jsx as jsx35 } from "react/jsx-runtime";
11370
+ import { jsx as jsx37 } from "react/jsx-runtime";
11057
11371
  var MultiUploadInputRenderer = {
11058
11372
  canRenderType: "input-upload-multi",
11059
11373
  render: (props) => {
@@ -11080,7 +11394,7 @@ var MultiUploadInputRenderer = {
11080
11394
  };
11081
11395
  const onDeleteFile = async (fileId) => onDelete(String(fileId));
11082
11396
  const descriptionId = description ? `${id}-description` : void 0;
11083
- return /* @__PURE__ */ jsx35(UploadFieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx35(
11397
+ return /* @__PURE__ */ jsx37(UploadFieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx37(
11084
11398
  UploadInput,
11085
11399
  {
11086
11400
  id,
@@ -11103,12 +11417,12 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
11103
11417
 
11104
11418
  // src/revamp/wise/renderers/NumberInputRenderer.tsx
11105
11419
  import { Input as Input3 } from "@transferwise/components";
11106
- import { jsx as jsx36 } from "react/jsx-runtime";
11420
+ import { jsx as jsx38 } from "react/jsx-runtime";
11107
11421
  var NumberInputRenderer = {
11108
11422
  canRenderType: "input-number",
11109
11423
  render: (props) => {
11110
11424
  const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
11111
- return /* @__PURE__ */ jsx36(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx36(
11425
+ return /* @__PURE__ */ jsx38(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx38(
11112
11426
  Input3,
11113
11427
  __spreadValues({
11114
11428
  id,
@@ -11127,7 +11441,7 @@ var NumberInputRenderer = {
11127
11441
  var NumberInputRenderer_default = NumberInputRenderer;
11128
11442
 
11129
11443
  // src/revamp/wise/renderers/ParagraphRenderer.tsx
11130
- import { useIntl as useIntl4 } from "react-intl";
11444
+ import { useIntl as useIntl5 } from "react-intl";
11131
11445
 
11132
11446
  // src/revamp/wise/renderers/hooks/useSnackBarIfAvailable.ts
11133
11447
  import { SnackbarContext } from "@transferwise/components";
@@ -11143,8 +11457,8 @@ var import_classnames5 = __toESM(require_classnames());
11143
11457
  import { Button as Button3, Input as Input4 } from "@transferwise/components";
11144
11458
 
11145
11459
  // src/common/messages/paragraph.messages.ts
11146
- import { defineMessages as defineMessages6 } from "react-intl";
11147
- var paragraph_messages_default = defineMessages6({
11460
+ import { defineMessages as defineMessages7 } from "react-intl";
11461
+ var paragraph_messages_default = defineMessages7({
11148
11462
  copy: {
11149
11463
  id: "dynamicFlows.DynamicParagraph.copy",
11150
11464
  defaultMessage: "Copy",
@@ -11158,24 +11472,24 @@ var paragraph_messages_default = defineMessages6({
11158
11472
  });
11159
11473
 
11160
11474
  // src/revamp/wise/renderers/ParagraphRenderer.tsx
11161
- import { jsx as jsx37, jsxs as jsxs10 } from "react/jsx-runtime";
11475
+ import { jsx as jsx39, jsxs as jsxs10 } from "react/jsx-runtime";
11162
11476
  var ParagraphRenderer = {
11163
11477
  canRenderType: "paragraph",
11164
- render: (props) => /* @__PURE__ */ jsx37(Paragraph, __spreadValues({}, props))
11478
+ render: (props) => /* @__PURE__ */ jsx39(Paragraph, __spreadValues({}, props))
11165
11479
  };
11166
11480
  function Paragraph({ align, control, margin, text }) {
11167
11481
  const className = getTextAlignmentAndMargin({ align, margin });
11168
- return control === "copyable" ? /* @__PURE__ */ jsx37(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx37(StandardParagraph, { className, text });
11482
+ return control === "copyable" ? /* @__PURE__ */ jsx39(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx39(StandardParagraph, { className, text });
11169
11483
  }
11170
11484
  function StandardParagraph({ text, className }) {
11171
- return /* @__PURE__ */ jsx37("p", { className, children: text });
11485
+ return /* @__PURE__ */ jsx39("p", { className, children: text });
11172
11486
  }
11173
11487
  function CopyableParagraph({
11174
11488
  text,
11175
11489
  align,
11176
11490
  className
11177
11491
  }) {
11178
- const { formatMessage } = useIntl4();
11492
+ const { formatMessage } = useIntl5();
11179
11493
  const createSnackbar = useSnackBarIfAvailable();
11180
11494
  const copy = () => {
11181
11495
  navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
@@ -11183,7 +11497,7 @@ function CopyableParagraph({
11183
11497
  };
11184
11498
  const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
11185
11499
  return /* @__PURE__ */ jsxs10("div", { className, children: [
11186
- /* @__PURE__ */ jsx37(
11500
+ /* @__PURE__ */ jsx39(
11187
11501
  Input4,
11188
11502
  {
11189
11503
  type: "text",
@@ -11192,20 +11506,20 @@ function CopyableParagraph({
11192
11506
  className: (0, import_classnames5.default)("text-ellipsis", inputAlignmentClasses)
11193
11507
  }
11194
11508
  ),
11195
- /* @__PURE__ */ jsx37(Button3, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
11509
+ /* @__PURE__ */ jsx39(Button3, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
11196
11510
  ] });
11197
11511
  }
11198
11512
  var ParagraphRenderer_default = ParagraphRenderer;
11199
11513
 
11200
11514
  // src/revamp/wise/renderers/RepeatableRenderer.tsx
11201
11515
  import { Button as Button4, Header as Header3, Modal as Modal2, NavigationOption as NavigationOption2, InlineAlert as InlineAlert3 } from "@transferwise/components";
11202
- import { useState as useState6 } from "react";
11516
+ import { useState as useState7 } from "react";
11203
11517
  import { Plus } from "@transferwise/icons";
11204
- import { useIntl as useIntl5 } from "react-intl";
11518
+ import { useIntl as useIntl6 } from "react-intl";
11205
11519
 
11206
11520
  // src/common/messages/repeatable.messages.ts
11207
- import { defineMessages as defineMessages7 } from "react-intl";
11208
- var repeatable_messages_default = defineMessages7({
11521
+ import { defineMessages as defineMessages8 } from "react-intl";
11522
+ var repeatable_messages_default = defineMessages8({
11209
11523
  addItemTitle: {
11210
11524
  id: "dynamicFlows.ArraySchema.addItemTitle",
11211
11525
  defaultMessage: "Add Item",
@@ -11230,10 +11544,10 @@ var repeatable_messages_default = defineMessages7({
11230
11544
 
11231
11545
  // src/revamp/wise/renderers/RepeatableRenderer.tsx
11232
11546
  var import_classnames6 = __toESM(require_classnames());
11233
- import { Fragment as Fragment4, jsx as jsx38, jsxs as jsxs11 } from "react/jsx-runtime";
11547
+ import { Fragment as Fragment4, jsx as jsx40, jsxs as jsxs11 } from "react/jsx-runtime";
11234
11548
  var RepeatableRenderer = {
11235
11549
  canRenderType: "repeatable",
11236
- render: (props) => /* @__PURE__ */ jsx38(Repeatable, __spreadValues({}, props))
11550
+ render: (props) => /* @__PURE__ */ jsx40(Repeatable, __spreadValues({}, props))
11237
11551
  };
11238
11552
  function Repeatable(props) {
11239
11553
  const {
@@ -11249,8 +11563,8 @@ function Repeatable(props) {
11249
11563
  onSave,
11250
11564
  onRemove
11251
11565
  } = props;
11252
- const { formatMessage } = useIntl5();
11253
- const [openModalType, setOpenModalType] = useState6(null);
11566
+ const { formatMessage } = useIntl6();
11567
+ const [openModalType, setOpenModalType] = useState7(null);
11254
11568
  const onAddItem = () => {
11255
11569
  onAdd();
11256
11570
  setOpenModalType("add");
@@ -11273,8 +11587,8 @@ function Repeatable(props) {
11273
11587
  setOpenModalType(null);
11274
11588
  };
11275
11589
  return /* @__PURE__ */ jsxs11(Fragment4, { children: [
11276
- title && /* @__PURE__ */ jsx38(Header3, { title }),
11277
- description && /* @__PURE__ */ jsx38("p", { children: description }),
11590
+ title && /* @__PURE__ */ jsx40(Header3, { title }),
11591
+ description && /* @__PURE__ */ jsx40("p", { children: description }),
11278
11592
  /* @__PURE__ */ jsxs11(
11279
11593
  "div",
11280
11594
  {
@@ -11282,30 +11596,30 @@ function Repeatable(props) {
11282
11596
  "has-error": error
11283
11597
  }),
11284
11598
  children: [
11285
- items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx38(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
11286
- /* @__PURE__ */ jsx38(
11599
+ items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx40(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
11600
+ /* @__PURE__ */ jsx40(
11287
11601
  NavigationOption2,
11288
11602
  {
11289
- media: /* @__PURE__ */ jsx38(Plus, {}),
11603
+ media: /* @__PURE__ */ jsx40(Plus, {}),
11290
11604
  title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
11291
11605
  showMediaAtAllSizes: true,
11292
11606
  onClick: () => onAddItem()
11293
11607
  }
11294
11608
  ),
11295
- error && /* @__PURE__ */ jsx38(InlineAlert3, { type: "negative", children: error })
11609
+ error && /* @__PURE__ */ jsx40(InlineAlert3, { type: "negative", children: error })
11296
11610
  ]
11297
11611
  }
11298
11612
  ),
11299
- /* @__PURE__ */ jsx38(
11613
+ /* @__PURE__ */ jsx40(
11300
11614
  Modal2,
11301
11615
  {
11302
11616
  open: openModalType !== null,
11303
11617
  title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
11304
11618
  body: /* @__PURE__ */ jsxs11(Fragment4, { children: [
11305
- /* @__PURE__ */ jsx38("div", { className: "m-b-2", children: editableItem }),
11619
+ /* @__PURE__ */ jsx40("div", { className: "m-b-2", children: editableItem }),
11306
11620
  /* @__PURE__ */ jsxs11("div", { children: [
11307
- /* @__PURE__ */ jsx38(Button4, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
11308
- /* @__PURE__ */ jsx38(Button4, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
11621
+ /* @__PURE__ */ jsx40(Button4, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
11622
+ /* @__PURE__ */ jsx40(Button4, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
11309
11623
  ] })
11310
11624
  ] }),
11311
11625
  onClose: () => onCancelEdit()
@@ -11317,10 +11631,10 @@ function ItemSummaryOption({
11317
11631
  item,
11318
11632
  onClick
11319
11633
  }) {
11320
- return /* @__PURE__ */ jsx38(
11634
+ return /* @__PURE__ */ jsx40(
11321
11635
  NavigationOption2,
11322
11636
  {
11323
- media: /* @__PURE__ */ jsx38(NavigationOptionMedia, __spreadValues({}, item)),
11637
+ media: /* @__PURE__ */ jsx40(NavigationOptionMedia, __spreadValues({}, item)),
11324
11638
  title: item.title,
11325
11639
  content: item.description,
11326
11640
  showMediaAtAllSizes: true,
@@ -11334,14 +11648,14 @@ var RepeatableRenderer_default = RepeatableRenderer;
11334
11648
  import { Input as Input5, Markdown as Markdown3, NavigationOption as NavigationOption3, NavigationOptionsList as NavigationOptionsList2 } from "@transferwise/components";
11335
11649
 
11336
11650
  // src/revamp/wise/renderers/SearchRenderer/ErrorResult.tsx
11337
- import { useIntl as useIntl6 } from "react-intl";
11338
- import { jsx as jsx39, jsxs as jsxs12 } from "react/jsx-runtime";
11651
+ import { useIntl as useIntl7 } from "react-intl";
11652
+ import { jsx as jsx41, jsxs as jsxs12 } from "react/jsx-runtime";
11339
11653
  function ErrorResult({ state }) {
11340
- const intl = useIntl6();
11654
+ const intl = useIntl7();
11341
11655
  return /* @__PURE__ */ jsxs12("p", { className: "m-t-2", children: [
11342
11656
  intl.formatMessage(generic_error_messages_default.genericError),
11343
11657
  "\xA0",
11344
- /* @__PURE__ */ jsx39(
11658
+ /* @__PURE__ */ jsx41(
11345
11659
  "a",
11346
11660
  {
11347
11661
  href: "/",
@@ -11356,8 +11670,8 @@ function ErrorResult({ state }) {
11356
11670
  }
11357
11671
 
11358
11672
  // src/revamp/wise/renderers/SearchRenderer/BlockSearchRendererComponent.tsx
11359
- import { useState as useState7 } from "react";
11360
- import { Fragment as Fragment5, jsx as jsx40, jsxs as jsxs13 } from "react/jsx-runtime";
11673
+ import { useState as useState8 } from "react";
11674
+ import { Fragment as Fragment5, jsx as jsx42, jsxs as jsxs13 } from "react/jsx-runtime";
11361
11675
  function BlockSearchRendererComponent({
11362
11676
  id,
11363
11677
  isLoading,
@@ -11367,10 +11681,10 @@ function BlockSearchRendererComponent({
11367
11681
  state,
11368
11682
  title
11369
11683
  }) {
11370
- const [hasSearched, setHasSearched] = useState7(false);
11684
+ const [hasSearched, setHasSearched] = useState8(false);
11371
11685
  const trackEvent = useTrackEvent();
11372
11686
  return /* @__PURE__ */ jsxs13("div", { className: getMargin(margin), children: [
11373
- /* @__PURE__ */ jsx40(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ jsx40(
11687
+ /* @__PURE__ */ jsx42(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ jsx42(
11374
11688
  Input5,
11375
11689
  {
11376
11690
  id,
@@ -11387,7 +11701,7 @@ function BlockSearchRendererComponent({
11387
11701
  }
11388
11702
  }
11389
11703
  ) }),
11390
- isLoading ? /* @__PURE__ */ jsx40(Fragment5, { children: "Loading..." }) : /* @__PURE__ */ jsx40(SearchResultContent, { state, onChange })
11704
+ isLoading ? /* @__PURE__ */ jsx42(Fragment5, { children: "Loading..." }) : /* @__PURE__ */ jsx42(SearchResultContent, { state, onChange })
11391
11705
  ] });
11392
11706
  }
11393
11707
  function SearchResultContent({
@@ -11396,29 +11710,29 @@ function SearchResultContent({
11396
11710
  }) {
11397
11711
  switch (state.type) {
11398
11712
  case "error":
11399
- return /* @__PURE__ */ jsx40(ErrorResult, { state });
11713
+ return /* @__PURE__ */ jsx42(ErrorResult, { state });
11400
11714
  case "results":
11401
- return /* @__PURE__ */ jsx40(SearchResults, { state, onChange });
11715
+ return /* @__PURE__ */ jsx42(SearchResults, { state, onChange });
11402
11716
  case "noResults":
11403
- return /* @__PURE__ */ jsx40(EmptySearchResult, { state });
11717
+ return /* @__PURE__ */ jsx42(EmptySearchResult, { state });
11404
11718
  case "pending":
11405
11719
  default:
11406
11720
  return null;
11407
11721
  }
11408
11722
  }
11409
11723
  function EmptySearchResult({ state }) {
11410
- return /* @__PURE__ */ jsx40(Markdown3, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
11724
+ return /* @__PURE__ */ jsx42(Markdown3, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
11411
11725
  }
11412
11726
  function SearchResults({
11413
11727
  state
11414
11728
  }) {
11415
11729
  const trackEvent = useTrackEvent();
11416
- return /* @__PURE__ */ jsx40(NavigationOptionsList2, { children: state.results.map((result) => /* @__PURE__ */ jsx40(
11730
+ return /* @__PURE__ */ jsx42(NavigationOptionsList2, { children: state.results.map((result) => /* @__PURE__ */ jsx42(
11417
11731
  NavigationOption3,
11418
11732
  {
11419
11733
  title: result.title,
11420
11734
  content: result.description,
11421
- media: /* @__PURE__ */ jsx40(NavigationOptionMedia, __spreadValues({}, result)),
11735
+ media: /* @__PURE__ */ jsx42(NavigationOptionMedia, __spreadValues({}, result)),
11422
11736
  showMediaCircle: false,
11423
11737
  showMediaAtAllSizes: true,
11424
11738
  onClick: () => {
@@ -11436,8 +11750,8 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
11436
11750
  // src/revamp/wise/renderers/SearchRenderer/InlineSearchRendererComponent.tsx
11437
11751
  import { Markdown as Markdown4, Typeahead } from "@transferwise/components";
11438
11752
  import { Search } from "@transferwise/icons";
11439
- import { useState as useState8 } from "react";
11440
- import { jsx as jsx41, jsxs as jsxs14 } from "react/jsx-runtime";
11753
+ import { useState as useState9 } from "react";
11754
+ import { jsx as jsx43, jsxs as jsxs14 } from "react/jsx-runtime";
11441
11755
  function InlineSearchRenderer({
11442
11756
  id,
11443
11757
  isLoading,
@@ -11446,21 +11760,21 @@ function InlineSearchRenderer({
11446
11760
  state,
11447
11761
  title
11448
11762
  }) {
11449
- const [hasSearched, setHasSearched] = useState8(false);
11763
+ const [hasSearched, setHasSearched] = useState9(false);
11450
11764
  const trackEvent = useTrackEvent();
11451
- return /* @__PURE__ */ jsx41("div", { className: getMargin(margin), children: /* @__PURE__ */ jsxs14(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: [
11765
+ return /* @__PURE__ */ jsx43("div", { className: getMargin(margin), children: /* @__PURE__ */ jsxs14(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: [
11452
11766
  id,
11453
- /* @__PURE__ */ jsx41(
11767
+ /* @__PURE__ */ jsx43(
11454
11768
  Typeahead,
11455
11769
  {
11456
11770
  id: "typeahead-input-id",
11457
11771
  name: "typeahead-input-name",
11458
11772
  size: "md",
11459
11773
  maxHeight: 100,
11460
- footer: /* @__PURE__ */ jsx41(TypeaheadFooter, { state, isLoading }),
11774
+ footer: /* @__PURE__ */ jsx43(TypeaheadFooter, { state, isLoading }),
11461
11775
  multiple: false,
11462
11776
  clearable: false,
11463
- addon: /* @__PURE__ */ jsx41(Search, { size: 24 }),
11777
+ addon: /* @__PURE__ */ jsx43(Search, { size: 24 }),
11464
11778
  options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
11465
11779
  minQueryLength: 1,
11466
11780
  onChange: (values) => {
@@ -11497,47 +11811,29 @@ function mapResultToTypeaheadOption(result) {
11497
11811
  }
11498
11812
  function TypeaheadFooter({ state, isLoading }) {
11499
11813
  if (state.type === "noResults") {
11500
- return /* @__PURE__ */ jsx41(Markdown4, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
11814
+ return /* @__PURE__ */ jsx43(Markdown4, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
11501
11815
  }
11502
11816
  if (state.type === "error") {
11503
- return /* @__PURE__ */ jsx41("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx41(ErrorResult, { state }) });
11817
+ return /* @__PURE__ */ jsx43("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx43(ErrorResult, { state }) });
11504
11818
  }
11505
11819
  if (state.type === "pending" || isLoading) {
11506
- return /* @__PURE__ */ jsx41("p", { className: "m-t-2 m-x-2", children: "Loading..." });
11820
+ return /* @__PURE__ */ jsx43("p", { className: "m-t-2 m-x-2", children: "Loading..." });
11507
11821
  }
11508
11822
  return null;
11509
11823
  }
11510
11824
  var InlineSearchRendererComponent_default = InlineSearchRenderer;
11511
11825
 
11512
11826
  // src/revamp/wise/renderers/SearchRenderer/SearchRenderer.tsx
11513
- import { jsx as jsx42 } from "react/jsx-runtime";
11827
+ import { jsx as jsx44 } from "react/jsx-runtime";
11514
11828
  var SearchRenderer = {
11515
11829
  canRenderType: "search",
11516
- render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx42(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx42(BlockSearchRendererComponent_default, __spreadValues({}, props))
11830
+ render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx44(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx44(BlockSearchRendererComponent_default, __spreadValues({}, props))
11517
11831
  };
11518
11832
  var SearchRenderer_default = SearchRenderer;
11519
11833
 
11520
11834
  // src/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.tsx
11521
11835
  import { RadioGroup } from "@transferwise/components";
11522
-
11523
- // src/revamp/wise/renderers/SelectInputRenderer/OptionMedia.tsx
11524
- import { Avatar as Avatar2, AvatarType as AvatarType2 } from "@transferwise/components";
11525
- import { jsx as jsx43 } from "react/jsx-runtime";
11526
- function OptionMedia({ icon, image }) {
11527
- if (image == null ? void 0 : image.url) {
11528
- return /* @__PURE__ */ jsx43("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
11529
- }
11530
- if (icon && "name" in icon) {
11531
- return /* @__PURE__ */ jsx43(Avatar2, { type: AvatarType2.ICON, children: /* @__PURE__ */ jsx43(DynamicIcon_default, { name: icon.name }) });
11532
- }
11533
- if (icon && "text" in icon) {
11534
- return /* @__PURE__ */ jsx43(Avatar2, { type: AvatarType2.INITIALS, children: icon.text });
11535
- }
11536
- return null;
11537
- }
11538
-
11539
- // src/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.tsx
11540
- import { Fragment as Fragment6, jsx as jsx44, jsxs as jsxs15 } from "react/jsx-runtime";
11836
+ import { Fragment as Fragment6, jsx as jsx45, jsxs as jsxs15 } from "react/jsx-runtime";
11541
11837
  function RadioInputRendererComponent(props) {
11542
11838
  const {
11543
11839
  id,
@@ -11552,7 +11848,7 @@ function RadioInputRendererComponent(props) {
11552
11848
  onSelect
11553
11849
  } = props;
11554
11850
  return /* @__PURE__ */ jsxs15(Fragment6, { children: [
11555
- /* @__PURE__ */ jsx44(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx44("span", { children: /* @__PURE__ */ jsx44(
11851
+ /* @__PURE__ */ jsx45(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx45("span", { children: /* @__PURE__ */ jsx45(
11556
11852
  RadioGroup,
11557
11853
  {
11558
11854
  name: id,
@@ -11561,11 +11857,12 @@ function RadioInputRendererComponent(props) {
11561
11857
  value: index,
11562
11858
  secondary: option.description,
11563
11859
  disabled: option.disabled || disabled,
11564
- avatar: /* @__PURE__ */ jsx44(OptionMedia, { icon: option.icon, image: option.image })
11860
+ avatar: /* @__PURE__ */ jsx45(OptionMedia, { icon: option.icon, image: option.image })
11565
11861
  })),
11566
11862
  selectedValue: selectedIndex != null ? selectedIndex : void 0,
11567
11863
  onChange: onSelect
11568
- }
11864
+ },
11865
+ `${id}-${selectedIndex}`
11569
11866
  ) }) }),
11570
11867
  children
11571
11868
  ] });
@@ -11574,7 +11871,7 @@ function RadioInputRendererComponent(props) {
11574
11871
  // src/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.tsx
11575
11872
  import { Tabs } from "@transferwise/components";
11576
11873
  import { useEffect as useEffect4 } from "react";
11577
- import { Fragment as Fragment7, jsx as jsx45, jsxs as jsxs16 } from "react/jsx-runtime";
11874
+ import { Fragment as Fragment7, jsx as jsx46, jsxs as jsxs16 } from "react/jsx-runtime";
11578
11875
  function TabInputRendererComponent(props) {
11579
11876
  const {
11580
11877
  id,
@@ -11594,7 +11891,7 @@ function TabInputRendererComponent(props) {
11594
11891
  }
11595
11892
  }, [selectedIndex, onSelect, options.length]);
11596
11893
  return /* @__PURE__ */ jsxs16(Fragment7, { children: [
11597
- /* @__PURE__ */ jsx45(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx45(
11894
+ /* @__PURE__ */ jsx46(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx46(
11598
11895
  Tabs,
11599
11896
  {
11600
11897
  name: id,
@@ -11603,7 +11900,7 @@ function TabInputRendererComponent(props) {
11603
11900
  title: option.title,
11604
11901
  // if we pass null, we get some props-types console errors
11605
11902
  // eslint-disable-next-line react/jsx-no-useless-fragment
11606
- content: /* @__PURE__ */ jsx45(Fragment7, {}),
11903
+ content: /* @__PURE__ */ jsx46(Fragment7, {}),
11607
11904
  disabled: option.disabled || disabled
11608
11905
  })),
11609
11906
  onTabSelect: onSelect
@@ -11615,26 +11912,26 @@ function TabInputRendererComponent(props) {
11615
11912
  var isValidIndex = (index, options) => index !== null && index >= 0 && index < options;
11616
11913
 
11617
11914
  // src/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.tsx
11618
- import { SelectInput, SelectInputOptionContent } from "@transferwise/components";
11915
+ import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
11619
11916
 
11620
11917
  // src/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.tsx
11621
11918
  import { Avatar as Avatar3, AvatarType as AvatarType3 } from "@transferwise/components";
11622
- import { jsx as jsx46 } from "react/jsx-runtime";
11919
+ import { jsx as jsx47 } from "react/jsx-runtime";
11623
11920
  function SelectTriggerMedia({ icon, image }) {
11624
11921
  if (image == null ? void 0 : image.url) {
11625
11922
  return null;
11626
11923
  }
11627
11924
  if (icon && "name" in icon) {
11628
- return /* @__PURE__ */ jsx46(Avatar3, { type: AvatarType3.ICON, size: 24, children: /* @__PURE__ */ jsx46(DynamicIcon_default, { name: icon.name }) });
11925
+ return /* @__PURE__ */ jsx47(Avatar3, { type: AvatarType3.ICON, size: 24, children: /* @__PURE__ */ jsx47(DynamicIcon_default, { name: icon.name }) });
11629
11926
  }
11630
11927
  if (icon && "text" in icon) {
11631
- return /* @__PURE__ */ jsx46(Avatar3, { type: AvatarType3.ICON, size: 24, children: icon.text });
11928
+ return /* @__PURE__ */ jsx47(Avatar3, { type: AvatarType3.ICON, size: 24, children: icon.text });
11632
11929
  }
11633
11930
  return null;
11634
11931
  }
11635
11932
 
11636
11933
  // src/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.tsx
11637
- import { Fragment as Fragment8, jsx as jsx47, jsxs as jsxs17 } from "react/jsx-runtime";
11934
+ import { Fragment as Fragment8, jsx as jsx48, jsxs as jsxs17 } from "react/jsx-runtime";
11638
11935
  function SelectInputRendererComponent(props) {
11639
11936
  const {
11640
11937
  id,
@@ -11669,17 +11966,17 @@ function SelectInputRendererComponent(props) {
11669
11966
  const contentProps = withinTrigger ? {
11670
11967
  title: option.title,
11671
11968
  note: option.description,
11672
- icon: /* @__PURE__ */ jsx47(SelectTriggerMedia, { icon: option.icon, image: option.image })
11969
+ icon: /* @__PURE__ */ jsx48(SelectTriggerMedia, { icon: option.icon, image: option.image })
11673
11970
  } : {
11674
11971
  title: option.title,
11675
11972
  description: option.description,
11676
- icon: /* @__PURE__ */ jsx47(OptionMedia, { icon: option.icon, image: option.image })
11973
+ icon: /* @__PURE__ */ jsx48(OptionMedia, { icon: option.icon, image: option.image })
11677
11974
  };
11678
- return /* @__PURE__ */ jsx47(SelectInputOptionContent, __spreadValues({}, contentProps));
11975
+ return /* @__PURE__ */ jsx48(SelectInputOptionContent2, __spreadValues({}, contentProps));
11679
11976
  };
11680
11977
  return /* @__PURE__ */ jsxs17(Fragment8, { children: [
11681
- /* @__PURE__ */ jsx47(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx47(
11682
- SelectInput,
11978
+ /* @__PURE__ */ jsx48(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx48(
11979
+ SelectInput2,
11683
11980
  {
11684
11981
  name: id,
11685
11982
  placeholder,
@@ -11699,7 +11996,7 @@ function SelectInputRendererComponent(props) {
11699
11996
  // src/revamp/wise/renderers/SelectInputRenderer/SegmentedInputRendererComponent.tsx
11700
11997
  import { useEffect as useEffect5 } from "react";
11701
11998
  import { SegmentedControl } from "@transferwise/components";
11702
- import { Fragment as Fragment9, jsx as jsx48, jsxs as jsxs18 } from "react/jsx-runtime";
11999
+ import { Fragment as Fragment9, jsx as jsx49, jsxs as jsxs18 } from "react/jsx-runtime";
11703
12000
  function SegmentedInputRendererComponent(props) {
11704
12001
  const { id, children, description, error, help, label, options, selectedIndex, onSelect } = props;
11705
12002
  useEffect5(() => {
@@ -11708,7 +12005,7 @@ function SegmentedInputRendererComponent(props) {
11708
12005
  }
11709
12006
  }, [selectedIndex, onSelect, options.length]);
11710
12007
  return /* @__PURE__ */ jsxs18(Fragment9, { children: [
11711
- /* @__PURE__ */ jsx48(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx48(
12008
+ /* @__PURE__ */ jsx49(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx49(
11712
12009
  SegmentedControl,
11713
12010
  {
11714
12011
  name: `${id}-segmented-control`,
@@ -11723,26 +12020,26 @@ function SegmentedInputRendererComponent(props) {
11723
12020
  onChange: (value) => onSelect(Number(value))
11724
12021
  }
11725
12022
  ) }),
11726
- /* @__PURE__ */ jsx48("div", { id: `${id}-children`, children })
12023
+ /* @__PURE__ */ jsx49("div", { id: `${id}-children`, children })
11727
12024
  ] });
11728
12025
  }
11729
12026
  var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
11730
12027
 
11731
12028
  // src/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.tsx
11732
- import { jsx as jsx49 } from "react/jsx-runtime";
12029
+ import { jsx as jsx50 } from "react/jsx-runtime";
11733
12030
  var SelectInputRenderer = {
11734
12031
  canRenderType: "input-select",
11735
12032
  render: (props) => {
11736
12033
  switch (props.control) {
11737
12034
  case "radio":
11738
- return /* @__PURE__ */ jsx49(RadioInputRendererComponent, __spreadValues({}, props));
12035
+ return /* @__PURE__ */ jsx50(RadioInputRendererComponent, __spreadValues({}, props));
11739
12036
  case "tab":
11740
- return props.options.length > 3 ? /* @__PURE__ */ jsx49(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx49(TabInputRendererComponent, __spreadValues({}, props));
12037
+ return props.options.length > 3 ? /* @__PURE__ */ jsx50(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx50(TabInputRendererComponent, __spreadValues({}, props));
11741
12038
  case "segmented":
11742
- return props.options.length > 3 ? /* @__PURE__ */ jsx49(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx49(SegmentedInputRendererComponent, __spreadValues({}, props));
12039
+ return props.options.length > 3 ? /* @__PURE__ */ jsx50(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx50(SegmentedInputRendererComponent, __spreadValues({}, props));
11743
12040
  case "select":
11744
12041
  default:
11745
- return /* @__PURE__ */ jsx49(SelectInputRendererComponent, __spreadValues({}, props));
12042
+ return /* @__PURE__ */ jsx50(SelectInputRendererComponent, __spreadValues({}, props));
11746
12043
  }
11747
12044
  }
11748
12045
  };
@@ -11750,17 +12047,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
11750
12047
 
11751
12048
  // src/revamp/wise/renderers/StatusListRenderer.tsx
11752
12049
  import { Header as Header4, Summary } from "@transferwise/components";
11753
- import { jsx as jsx50, jsxs as jsxs19 } from "react/jsx-runtime";
12050
+ import { jsx as jsx51, jsxs as jsxs19 } from "react/jsx-runtime";
11754
12051
  var StatusListRenderer = {
11755
12052
  canRenderType: "status-list",
11756
12053
  render: ({ margin, items, title }) => /* @__PURE__ */ jsxs19("div", { className: getMargin(margin), children: [
11757
- title ? /* @__PURE__ */ jsx50(Header4, { title }) : null,
11758
- items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx50(
12054
+ title ? /* @__PURE__ */ jsx51(Header4, { title }) : null,
12055
+ items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx51(
11759
12056
  Summary,
11760
12057
  {
11761
12058
  title: itemTitle,
11762
12059
  description,
11763
- icon: icon && "name" in icon ? /* @__PURE__ */ jsx50(DynamicIcon_default, { name: icon.name }) : null,
12060
+ icon: icon && "name" in icon ? /* @__PURE__ */ jsx51(DynamicIcon_default, { name: icon.name }) : null,
11764
12061
  status: mapStatus(status)
11765
12062
  },
11766
12063
  `${title}/${description || ""}`
@@ -11783,31 +12080,31 @@ import {
11783
12080
  TextArea as TextArea2,
11784
12081
  TextareaWithDisplayFormat
11785
12082
  } from "@transferwise/components";
11786
- import { jsx as jsx51 } from "react/jsx-runtime";
12083
+ import { jsx as jsx52 } from "react/jsx-runtime";
11787
12084
  function VariableTextInput({
11788
12085
  control,
11789
12086
  inputProps
11790
12087
  }) {
11791
12088
  switch (control) {
11792
12089
  case "password":
11793
- return /* @__PURE__ */ jsx51(TextInput, __spreadValues({ type: "password" }, inputProps));
12090
+ return /* @__PURE__ */ jsx52(TextInput, __spreadValues({ type: "password" }, inputProps));
11794
12091
  case "email":
11795
- return /* @__PURE__ */ jsx51(TextInput, __spreadValues({ type: "email" }, inputProps));
12092
+ return /* @__PURE__ */ jsx52(TextInput, __spreadValues({ type: "email" }, inputProps));
11796
12093
  case "textarea":
11797
- return /* @__PURE__ */ jsx51(TextAreaInput, __spreadValues({}, inputProps));
12094
+ return /* @__PURE__ */ jsx52(TextAreaInput, __spreadValues({}, inputProps));
11798
12095
  case "numeric":
11799
- return /* @__PURE__ */ jsx51(NumericInput, __spreadValues({ type: "number" }, inputProps));
12096
+ return /* @__PURE__ */ jsx52(NumericInput, __spreadValues({ type: "number" }, inputProps));
11800
12097
  case "phone-number":
11801
- return /* @__PURE__ */ jsx51(PhoneNumberInput, __spreadValues({}, inputProps));
12098
+ return /* @__PURE__ */ jsx52(PhoneNumberInput, __spreadValues({}, inputProps));
11802
12099
  default:
11803
- return /* @__PURE__ */ jsx51(TextInput, __spreadValues({ type: "text" }, inputProps));
12100
+ return /* @__PURE__ */ jsx52(TextInput, __spreadValues({ type: "text" }, inputProps));
11804
12101
  }
11805
12102
  }
11806
12103
  function TextInput(_a) {
11807
12104
  var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
11808
12105
  if (typeof displayFormat === "string") {
11809
12106
  const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
11810
- return /* @__PURE__ */ jsx51(
12107
+ return /* @__PURE__ */ jsx52(
11811
12108
  InputWithDisplayFormat,
11812
12109
  __spreadValues({
11813
12110
  displayPattern: displayFormat,
@@ -11815,29 +12112,29 @@ function TextInput(_a) {
11815
12112
  }, inputProps)
11816
12113
  );
11817
12114
  }
11818
- return /* @__PURE__ */ jsx51(Input6, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
12115
+ return /* @__PURE__ */ jsx52(Input6, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
11819
12116
  }
11820
12117
  function TextAreaInput(_a) {
11821
12118
  var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
11822
12119
  const textAreaProps = __spreadValues({ id, name: id }, rest);
11823
- return typeof displayFormat === "string" ? /* @__PURE__ */ jsx51(
12120
+ return typeof displayFormat === "string" ? /* @__PURE__ */ jsx52(
11824
12121
  TextareaWithDisplayFormat,
11825
12122
  __spreadValues({
11826
12123
  displayPattern: displayFormat,
11827
12124
  onChange: (newValue) => onChange(newValue)
11828
12125
  }, textAreaProps)
11829
- ) : /* @__PURE__ */ jsx51(TextArea2, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
12126
+ ) : /* @__PURE__ */ jsx52(TextArea2, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
11830
12127
  }
11831
12128
  function NumericInput(_a) {
11832
12129
  var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
11833
12130
  const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
11834
- return typeof displayFormat === "string" ? /* @__PURE__ */ jsx51(
12131
+ return typeof displayFormat === "string" ? /* @__PURE__ */ jsx52(
11835
12132
  InputWithDisplayFormat,
11836
12133
  __spreadValues({
11837
12134
  displayPattern: displayFormat,
11838
12135
  onChange: (newValue) => onChange(numericValueOrNull(newValue))
11839
12136
  }, numericProps)
11840
- ) : /* @__PURE__ */ jsx51(
12137
+ ) : /* @__PURE__ */ jsx52(
11841
12138
  Input6,
11842
12139
  __spreadValues({
11843
12140
  onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
@@ -11846,12 +12143,12 @@ function NumericInput(_a) {
11846
12143
  }
11847
12144
  function PhoneNumberInput(_a) {
11848
12145
  var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
11849
- return /* @__PURE__ */ jsx51(PhoneNumber, __spreadValues({ initialValue: value }, rest));
12146
+ return /* @__PURE__ */ jsx52(PhoneNumber, __spreadValues({ initialValue: value }, rest));
11850
12147
  }
11851
12148
  var VariableTextInput_default = VariableTextInput;
11852
12149
 
11853
12150
  // src/revamp/wise/renderers/TextInputRenderer.tsx
11854
- import { jsx as jsx52 } from "react/jsx-runtime";
12151
+ import { jsx as jsx53 } from "react/jsx-runtime";
11855
12152
  var TextInputRenderer = {
11856
12153
  canRenderType: "input-text",
11857
12154
  render: (props) => {
@@ -11876,14 +12173,14 @@ var TextInputRenderer = {
11876
12173
  ]);
11877
12174
  const value = initialValue != null ? initialValue : "";
11878
12175
  const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
11879
- return /* @__PURE__ */ jsx52(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx52(VariableTextInput_default, { control, inputProps }) });
12176
+ return /* @__PURE__ */ jsx53(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx53(VariableTextInput_default, { control, inputProps }) });
11880
12177
  }
11881
12178
  };
11882
12179
  var TextInputRenderer_default = TextInputRenderer;
11883
12180
 
11884
12181
  // src/revamp/wise/renderers/UploadInputRenderer.tsx
11885
12182
  import { Upload, UploadInput as UploadInput2 } from "@transferwise/components";
11886
- import { jsx as jsx53 } from "react/jsx-runtime";
12183
+ import { jsx as jsx54 } from "react/jsx-runtime";
11887
12184
  var UploadInputRenderer = {
11888
12185
  canRenderType: "input-upload",
11889
12186
  render: (props) => {
@@ -11899,7 +12196,7 @@ var UploadInputRenderer = {
11899
12196
  };
11900
12197
  return (
11901
12198
  // We don't pass help here as there is no sensible place to display it
11902
- /* @__PURE__ */ jsx53(UploadFieldInput_default, { id, label: void 0, description: void 0, error, children: /* @__PURE__ */ jsx53(
12199
+ /* @__PURE__ */ jsx54(UploadFieldInput_default, { id, label: void 0, description: void 0, error, children: /* @__PURE__ */ jsx54(
11903
12200
  UploadInput2,
11904
12201
  {
11905
12202
  id,
@@ -11954,7 +12251,7 @@ var LargeUploadRenderer = {
11954
12251
  throw e;
11955
12252
  }
11956
12253
  };
11957
- return /* @__PURE__ */ jsx53(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx53(
12254
+ return /* @__PURE__ */ jsx54(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx54(
11958
12255
  Upload,
11959
12256
  __spreadProps(__spreadValues({}, uploadProps), {
11960
12257
  usAccept: getAcceptsString(accepts),
@@ -11969,11 +12266,11 @@ var LargeUploadRenderer = {
11969
12266
 
11970
12267
  // src/revamp/wise/renderers/ReviewRenderer.tsx
11971
12268
  import { DefinitionList, Header as Header5 } from "@transferwise/components";
11972
- import { Fragment as Fragment10, jsx as jsx54, jsxs as jsxs20 } from "react/jsx-runtime";
12269
+ import { Fragment as Fragment10, jsx as jsx55, jsxs as jsxs20 } from "react/jsx-runtime";
11973
12270
  var ReviewRenderer = {
11974
12271
  canRenderType: "review",
11975
12272
  render: ({ callToAction, control, fields, margin, title }) => {
11976
- const orientation = control === "horizontal" ? "HORIZONTAL_RIGHT_ALIGNED" : "VERTICAL_ONE_COLUMN";
12273
+ const orientation = mapControlToDefinitionListLayout(control);
11977
12274
  const action = callToAction ? {
11978
12275
  text: callToAction.title,
11979
12276
  onClick: (event) => {
@@ -11982,8 +12279,8 @@ var ReviewRenderer = {
11982
12279
  }
11983
12280
  } : void 0;
11984
12281
  return /* @__PURE__ */ jsxs20("div", { className: getMargin(margin), children: [
11985
- (title || callToAction) && /* @__PURE__ */ jsx54(Header5, { title: title != null ? title : "", action }),
11986
- /* @__PURE__ */ jsx54("div", { className: margin, children: /* @__PURE__ */ jsx54(
12282
+ (title || callToAction) && /* @__PURE__ */ jsx55(Header5, { title: title != null ? title : "", action }),
12283
+ /* @__PURE__ */ jsx55("div", { className: margin, children: /* @__PURE__ */ jsx55(
11987
12284
  DefinitionList,
11988
12285
  {
11989
12286
  layout: orientation,
@@ -11998,16 +12295,31 @@ var ReviewRenderer = {
11998
12295
  }
11999
12296
  };
12000
12297
  var ReviewRenderer_default = ReviewRenderer;
12298
+ var mapControlToDefinitionListLayout = (control) => {
12299
+ switch (control) {
12300
+ case "horizontal":
12301
+ case "horizontal-end-aligned":
12302
+ return "HORIZONTAL_RIGHT_ALIGNED";
12303
+ case "horizontal-start-aligned":
12304
+ return "HORIZONTAL_LEFT_ALIGNED";
12305
+ case "vertical-two-column":
12306
+ return "VERTICAL_TWO_COLUMN";
12307
+ case "vertical":
12308
+ case "vertical-one-column":
12309
+ default:
12310
+ return "VERTICAL_ONE_COLUMN";
12311
+ }
12312
+ };
12001
12313
  var getFieldValue = (value, help, orientation) => {
12002
12314
  if (help) {
12003
12315
  return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs20(Fragment10, { children: [
12004
- /* @__PURE__ */ jsx54(Help_default, { help }),
12316
+ /* @__PURE__ */ jsx55(Help_default, { help }),
12005
12317
  " ",
12006
12318
  value
12007
12319
  ] }) : /* @__PURE__ */ jsxs20(Fragment10, { children: [
12008
12320
  value,
12009
12321
  " ",
12010
- /* @__PURE__ */ jsx54(Help_default, { help })
12322
+ /* @__PURE__ */ jsx55(Help_default, { help })
12011
12323
  ] });
12012
12324
  }
12013
12325
  return value;
@@ -12017,11 +12329,11 @@ var getFieldValue = (value, help, orientation) => {
12017
12329
  import { useMemo as useMemo4 } from "react";
12018
12330
 
12019
12331
  // src/revamp/wise/renderers/step/ExternalConfirmationDialog.tsx
12020
- import { useIntl as useIntl7 } from "react-intl";
12332
+ import { useIntl as useIntl8 } from "react-intl";
12021
12333
 
12022
12334
  // src/common/messages/external-confirmation.messages.ts
12023
- import { defineMessages as defineMessages8 } from "react-intl";
12024
- var external_confirmation_messages_default = defineMessages8({
12335
+ import { defineMessages as defineMessages9 } from "react-intl";
12336
+ var external_confirmation_messages_default = defineMessages9({
12025
12337
  title: {
12026
12338
  id: "dynamicFlows.ExternalConfirmation.title",
12027
12339
  defaultMessage: "Please confirm",
@@ -12046,17 +12358,17 @@ var external_confirmation_messages_default = defineMessages8({
12046
12358
 
12047
12359
  // src/revamp/wise/renderers/step/ExternalConfirmationDialog.tsx
12048
12360
  import { Button as Button5, Markdown as Markdown5 } from "@transferwise/components";
12049
- import { jsx as jsx55, jsxs as jsxs21 } from "react/jsx-runtime";
12361
+ import { jsx as jsx56, jsxs as jsxs21 } from "react/jsx-runtime";
12050
12362
  function ExternalConfirmationDialog({
12051
12363
  external,
12052
12364
  onClose
12053
12365
  }) {
12054
- const { formatMessage } = useIntl7();
12055
- return /* @__PURE__ */ jsx55("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs21("div", { className: "df-box-renderer-width-lg", children: [
12056
- /* @__PURE__ */ jsx55("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
12057
- /* @__PURE__ */ jsx55(Markdown5, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
12058
- /* @__PURE__ */ jsx55("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs21("div", { className: "df-box-renderer-width-lg", children: [
12059
- /* @__PURE__ */ jsx55(
12366
+ const { formatMessage } = useIntl8();
12367
+ return /* @__PURE__ */ jsx56("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs21("div", { className: "df-box-renderer-width-lg", children: [
12368
+ /* @__PURE__ */ jsx56("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
12369
+ /* @__PURE__ */ jsx56(Markdown5, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
12370
+ /* @__PURE__ */ jsx56("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs21("div", { className: "df-box-renderer-width-lg", children: [
12371
+ /* @__PURE__ */ jsx56(
12060
12372
  Button5,
12061
12373
  {
12062
12374
  block: true,
@@ -12070,7 +12382,7 @@ function ExternalConfirmationDialog({
12070
12382
  children: formatMessage(external_confirmation_messages_default.open)
12071
12383
  }
12072
12384
  ),
12073
- /* @__PURE__ */ jsx55(Button5, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
12385
+ /* @__PURE__ */ jsx56(Button5, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
12074
12386
  ] }) })
12075
12387
  ] }) });
12076
12388
  }
@@ -12083,10 +12395,10 @@ function getOrigin(url) {
12083
12395
  }
12084
12396
 
12085
12397
  // src/revamp/wise/renderers/step/useExternal.tsx
12086
- import { useEffect as useEffect6, useState as useState9 } from "react";
12398
+ import { useEffect as useEffect6, useState as useState10 } from "react";
12087
12399
  function useExternal(url) {
12088
- const [externalWindow, setExternalWindow] = useState9(null);
12089
- const [hasDismissed, setHasDismissed] = useState9(false);
12400
+ const [externalWindow, setExternalWindow] = useState10(null);
12401
+ const [hasDismissed, setHasDismissed] = useState10(false);
12090
12402
  const dismissConfirmation = () => setHasDismissed(true);
12091
12403
  useEffect6(() => {
12092
12404
  if (url) {
@@ -12101,7 +12413,7 @@ function useExternal(url) {
12101
12413
  // src/revamp/wise/renderers/step/BackButton.tsx
12102
12414
  import { Avatar as Avatar4 } from "@transferwise/components";
12103
12415
  import { ArrowLeft } from "@transferwise/icons";
12104
- import { jsx as jsx56, jsxs as jsxs22 } from "react/jsx-runtime";
12416
+ import { jsx as jsx57, jsxs as jsxs22 } from "react/jsx-runtime";
12105
12417
  function BackButton({ title, onClick }) {
12106
12418
  return /* @__PURE__ */ jsxs22(
12107
12419
  "a",
@@ -12114,8 +12426,8 @@ function BackButton({ title, onClick }) {
12114
12426
  onClick();
12115
12427
  },
12116
12428
  children: [
12117
- /* @__PURE__ */ jsx56("span", { className: "sr-only", children: title }),
12118
- /* @__PURE__ */ jsx56(Avatar4, { type: "icon", children: /* @__PURE__ */ jsx56(ArrowLeft, { size: "24" }) })
12429
+ /* @__PURE__ */ jsx57("span", { className: "sr-only", children: title }),
12430
+ /* @__PURE__ */ jsx57(Avatar4, { type: "icon", children: /* @__PURE__ */ jsx57(ArrowLeft, { size: "24" }) })
12119
12431
  ]
12120
12432
  }
12121
12433
  );
@@ -12123,20 +12435,24 @@ function BackButton({ title, onClick }) {
12123
12435
  var BackButton_default = BackButton;
12124
12436
 
12125
12437
  // src/revamp/wise/renderers/step/StepRenderer.tsx
12126
- import { jsx as jsx57, jsxs as jsxs23 } from "react/jsx-runtime";
12438
+ import { Alert as Alert3 } from "@transferwise/components";
12439
+ import { jsx as jsx58, jsxs as jsxs23 } from "react/jsx-runtime";
12127
12440
  var StepRenderer = {
12128
12441
  canRenderType: "step",
12129
12442
  render: StepRendererComponent
12130
12443
  };
12131
12444
  function StepRendererComponent(props) {
12132
- const { back, loadingState, external, trackEvent, children } = props;
12445
+ const { back, description, error, external, loadingState, title, trackEvent, children } = props;
12133
12446
  const value = useMemo4(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
12134
12447
  const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
12135
12448
  if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
12136
- return /* @__PURE__ */ jsx57(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
12449
+ return /* @__PURE__ */ jsx58(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
12137
12450
  }
12138
12451
  return /* @__PURE__ */ jsxs23(StepRendererContextProvider, { value, children: [
12139
- back ? /* @__PURE__ */ jsx57(BackButton_default, __spreadValues({}, back)) : null,
12452
+ back ? /* @__PURE__ */ jsx58(BackButton_default, __spreadValues({}, back)) : null,
12453
+ title ? /* @__PURE__ */ jsx58("h2", { className: "text-xs-center m-b-2", children: title }) : void 0,
12454
+ description ? /* @__PURE__ */ jsx58("p", { className: "text-xs-center m-b-2", children: description }) : void 0,
12455
+ error ? /* @__PURE__ */ jsx58(Alert3, { type: "negative", className: "m-b-2", message: error }) : void 0,
12140
12456
  children
12141
12457
  ] });
12142
12458
  }
@@ -12161,6 +12477,7 @@ var getWiseRenderers = () => [
12161
12477
  LoadingIndicatorRenderer_default,
12162
12478
  MarkdownRenderer_default,
12163
12479
  ModalRenderer_default,
12480
+ MultiSelectInputRenderer_default,
12164
12481
  MultiUploadInputRenderer_default,
12165
12482
  NumberInputRenderer_default,
12166
12483
  ParagraphRenderer_default,
@@ -12175,18 +12492,18 @@ var getWiseRenderers = () => [
12175
12492
  ];
12176
12493
 
12177
12494
  // src/revamp/DynamicFlowWise.tsx
12178
- import { jsx as jsx58 } from "react/jsx-runtime";
12495
+ import { jsx as jsx59 } from "react/jsx-runtime";
12179
12496
  var wiseRenderers = getWiseRenderers();
12180
12497
  function DynamicFlowWise(props) {
12181
12498
  const { httpClient, renderers } = props;
12182
12499
  const mergedRenderers = useMemo5(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
12183
- return /* @__PURE__ */ jsx58(HttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx58(DynamicFlowCore, __spreadProps(__spreadValues({}, props), { renderers: mergedRenderers })) });
12500
+ return /* @__PURE__ */ jsx59(HttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx59(DynamicFlowCore, __spreadProps(__spreadValues({}, props), { renderers: mergedRenderers })) });
12184
12501
  }
12185
12502
  var DynamicFlowWise_default = DynamicFlowWise;
12186
12503
 
12187
12504
  // src/revamp/DynamicFragmentWise.tsx
12188
12505
  import { forwardRef as forwardRef3, useImperativeHandle, useMemo as useMemo6 } from "react";
12189
- import { jsx as jsx59 } from "react/jsx-runtime";
12506
+ import { jsx as jsx60 } from "react/jsx-runtime";
12190
12507
  var wiseRenderers2 = getWiseRenderers();
12191
12508
  var DynamicFragmentWise = forwardRef3(function DynamicFragmentWise2(props, ref) {
12192
12509
  const { httpClient, onEvent, onError, renderers } = props;
@@ -12211,14 +12528,14 @@ var DynamicFragmentWise = forwardRef3(function DynamicFragmentWise2(props, ref)
12211
12528
  () => getRenderFunction([CoreContainerRenderer, ...mergedRenderers, StepRenderer]),
12212
12529
  [mergedRenderers]
12213
12530
  );
12214
- return /* @__PURE__ */ jsx59(
12531
+ return /* @__PURE__ */ jsx60(
12215
12532
  ErrorBoundary_default,
12216
12533
  {
12217
12534
  onError: (error) => {
12218
12535
  onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed");
12219
12536
  onError(error);
12220
12537
  },
12221
- children: /* @__PURE__ */ jsx59(HttpClientProvider, { httpClient, children: stepComponentRef.current ? render(stepComponentRef.current) : null })
12538
+ children: /* @__PURE__ */ jsx60(HttpClientProvider, { httpClient, children: stepComponentRef.current ? render(stepComponentRef.current) : null })
12222
12539
  }
12223
12540
  );
12224
12541
  });
@@ -12529,15 +12846,15 @@ function isReference(block) {
12529
12846
  }
12530
12847
 
12531
12848
  // src/legacy/dynamicFlow/DynamicFlow.tsx
12532
- import { useCallback as useCallback11, useEffect as useEffect26, useMemo as useMemo22, useState as useState34 } from "react";
12849
+ import { useCallback as useCallback11, useEffect as useEffect26, useMemo as useMemo22, useState as useState35 } from "react";
12533
12850
 
12534
12851
  // src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
12535
12852
  import { createContext as createContext4, useContext as useContext5, useMemo as useMemo7 } from "react";
12536
12853
 
12537
12854
  // src/legacy/common/contexts/dynamicFlowContexts/usePendingPromiseCounter.ts
12538
- import { useCallback as useCallback3, useState as useState10 } from "react";
12855
+ import { useCallback as useCallback3, useState as useState11 } from "react";
12539
12856
  function usePendingPromiseCounter() {
12540
- const [count, setCount] = useState10(0);
12857
+ const [count, setCount] = useState11(0);
12541
12858
  const addPendingPromise = useCallback3(
12542
12859
  (promise) => {
12543
12860
  setCount((c) => c + 1);
@@ -12552,7 +12869,7 @@ var noop2 = () => {
12552
12869
  };
12553
12870
 
12554
12871
  // src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
12555
- import { jsx as jsx60 } from "react/jsx-runtime";
12872
+ import { jsx as jsx61 } from "react/jsx-runtime";
12556
12873
  var defaultContextValue = {
12557
12874
  loading: false,
12558
12875
  registerPersistAsyncPromise: (promise) => {
@@ -12567,7 +12884,7 @@ var DynamicFlowProvider = ({ loading, children }) => {
12567
12884
  registerPersistAsyncPromise: addPendingPromise
12568
12885
  };
12569
12886
  }, [loading, pendingPromises, addPendingPromise]);
12570
- return /* @__PURE__ */ jsx60(DFContext.Provider, { value: providerValue, children });
12887
+ return /* @__PURE__ */ jsx61(DFContext.Provider, { value: providerValue, children });
12571
12888
  };
12572
12889
  var useDynamicFlow = () => {
12573
12890
  const context = useContext5(DFContext);
@@ -12576,7 +12893,7 @@ var useDynamicFlow = () => {
12576
12893
 
12577
12894
  // src/legacy/common/contexts/eventsContext/EventsContext.tsx
12578
12895
  import { createContext as createContext5, useContext as useContext6, useMemo as useMemo8 } from "react";
12579
- import { jsx as jsx61 } from "react/jsx-runtime";
12896
+ import { jsx as jsx62 } from "react/jsx-runtime";
12580
12897
  var EventsContext = createContext5({
12581
12898
  triggerEvent: () => {
12582
12899
  }
@@ -12586,7 +12903,7 @@ function EventsContextProvider({ metadata, children, onEvent }) {
12586
12903
  () => ({ triggerEvent: getEventDispatcher(onEvent, metadata) }),
12587
12904
  [onEvent, metadata]
12588
12905
  );
12589
- return /* @__PURE__ */ jsx61(EventsContext.Provider, { value, children });
12906
+ return /* @__PURE__ */ jsx62(EventsContext.Provider, { value, children });
12590
12907
  }
12591
12908
  function useEventDispatcher() {
12592
12909
  const { triggerEvent } = useContext6(EventsContext);
@@ -12601,7 +12918,7 @@ var getEventDispatcher = (onEvent, metadata) => (eventName, properties = {}) =>
12601
12918
 
12602
12919
  // src/legacy/common/contexts/logContext/LogContext.tsx
12603
12920
  import { createContext as createContext6, useContext as useContext7, useMemo as useMemo9 } from "react";
12604
- import { jsx as jsx62 } from "react/jsx-runtime";
12921
+ import { jsx as jsx63 } from "react/jsx-runtime";
12605
12922
  var getLogger = (level, onLog, flowId = "UNKNOWN-FLOW-ID", stepId = "UNKNOWN-FLOW-ID") => (title, description, extra) => {
12606
12923
  try {
12607
12924
  onLog(level, `Dynamic Flow ${level} - ${title} - ${description}`, __spreadValues({
@@ -12623,7 +12940,7 @@ function LogProvider({ flowId, stepId, children, onLog }) {
12623
12940
  }),
12624
12941
  [onLog, flowId, stepId]
12625
12942
  );
12626
- return /* @__PURE__ */ jsx62(LogContext.Provider, { value, children });
12943
+ return /* @__PURE__ */ jsx63(LogContext.Provider, { value, children });
12627
12944
  }
12628
12945
  var useLogger = () => {
12629
12946
  const logging = useContext7(LogContext);
@@ -12637,10 +12954,10 @@ var useLogger = () => {
12637
12954
 
12638
12955
  // src/legacy/common/contexts/featureContext/FeatureContext.tsx
12639
12956
  import { createContext as createContext7, useContext as useContext8 } from "react";
12640
- import { jsx as jsx63 } from "react/jsx-runtime";
12957
+ import { jsx as jsx64 } from "react/jsx-runtime";
12641
12958
  var FeatureContext = createContext7([]);
12642
12959
  function FeatureContextProvider({ features, children }) {
12643
- return /* @__PURE__ */ jsx63(FeatureContext.Provider, { value: features, children });
12960
+ return /* @__PURE__ */ jsx64(FeatureContext.Provider, { value: features, children });
12644
12961
  }
12645
12962
 
12646
12963
  // src/legacy/common/utils/api-utils.ts
@@ -13376,10 +13693,10 @@ function useDebouncedFunction(callback, waitMs) {
13376
13693
  }
13377
13694
 
13378
13695
  // src/legacy/common/hooks/useExternal/useExternal.tsx
13379
- import { useEffect as useEffect7, useState as useState11 } from "react";
13696
+ import { useEffect as useEffect7, useState as useState12 } from "react";
13380
13697
  function useExternal2(url) {
13381
- const [externalWindow, setExternalWindow] = useState11(null);
13382
- const [hasManuallyTriggered, setHasManuallyTriggered] = useState11(false);
13698
+ const [externalWindow, setExternalWindow] = useState12(null);
13699
+ const [hasManuallyTriggered, setHasManuallyTriggered] = useState12(false);
13383
13700
  const dismissConfirmation = () => setHasManuallyTriggered(true);
13384
13701
  useEffect7(() => {
13385
13702
  if (url) {
@@ -13449,12 +13766,12 @@ function useExternalStepPolling(polling, onAction) {
13449
13766
  }
13450
13767
 
13451
13768
  // src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts
13452
- import { useState as useState28 } from "react";
13453
- import { useIntl as useIntl19 } from "react-intl";
13769
+ import { useState as useState29 } from "react";
13770
+ import { useIntl as useIntl20 } from "react-intl";
13454
13771
 
13455
13772
  // src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
13456
- import { useEffect as useEffect18, useState as useState27 } from "react";
13457
- import { useIntl as useIntl18 } from "react-intl";
13773
+ import { useEffect as useEffect18, useState as useState28 } from "react";
13774
+ import { useIntl as useIntl19 } from "react-intl";
13458
13775
 
13459
13776
  // src/legacy/common/constants/DateMode.ts
13460
13777
  var DateMode = {
@@ -13502,28 +13819,28 @@ var Size = {
13502
13819
 
13503
13820
  // src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
13504
13821
  var import_classnames16 = __toESM(require_classnames());
13505
- import { useEffect as useEffect17, useMemo as useMemo17, useState as useState26 } from "react";
13822
+ import { useEffect as useEffect17, useMemo as useMemo17, useState as useState27 } from "react";
13506
13823
 
13507
13824
  // src/legacy/layout/alert/DynamicAlert.tsx
13508
- import { Alert as Alert3 } from "@transferwise/components";
13825
+ import { Alert as Alert4 } from "@transferwise/components";
13509
13826
 
13510
13827
  // src/legacy/layout/utils/getNavigationOptionMedia.tsx
13511
13828
  import { Avatar as Avatar5, AvatarType as AvatarType4 } from "@transferwise/components";
13512
13829
 
13513
13830
  // src/legacy/layout/icon/FlagIcon.tsx
13514
- import { jsx as jsx64 } from "react/jsx-runtime";
13831
+ import { jsx as jsx65 } from "react/jsx-runtime";
13515
13832
  var isFlagIcon2 = (name) => name.startsWith("flag-");
13516
13833
  function FlagIcon2({ name }) {
13517
13834
  if (!isFlagIcon2(name)) {
13518
13835
  return null;
13519
13836
  }
13520
13837
  const code = name.substring(5);
13521
- return /* @__PURE__ */ jsx64(Flag, { intrinsicSize: 24, code });
13838
+ return /* @__PURE__ */ jsx65(Flag, { intrinsicSize: 24, code });
13522
13839
  }
13523
13840
 
13524
13841
  // src/legacy/layout/icon/NamedIcon.tsx
13525
13842
  import * as icons2 from "@transferwise/icons";
13526
- import { jsx as jsx65 } from "react/jsx-runtime";
13843
+ import { jsx as jsx66 } from "react/jsx-runtime";
13527
13844
  var isNamedIcon2 = (name) => {
13528
13845
  const iconName = toCapitalisedCamelCase2(name);
13529
13846
  return Object.keys(icons2).includes(iconName);
@@ -13534,19 +13851,19 @@ function NamedIcon2({ name }) {
13534
13851
  }
13535
13852
  const iconName = toCapitalisedCamelCase2(name);
13536
13853
  const Icon = icons2[iconName];
13537
- return /* @__PURE__ */ jsx65(Icon, { size: 24 });
13854
+ return /* @__PURE__ */ jsx66(Icon, { size: 24 });
13538
13855
  }
13539
13856
  var toCapitalisedCamelCase2 = (value) => value.split("-").map(capitaliseFirstChar2).join("");
13540
13857
  var capitaliseFirstChar2 = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
13541
13858
 
13542
13859
  // src/legacy/layout/icon/DynamicIcon.tsx
13543
- import { jsx as jsx66 } from "react/jsx-runtime";
13860
+ import { jsx as jsx67 } from "react/jsx-runtime";
13544
13861
  function DynamicIcon2({ type }) {
13545
13862
  if (isFlagIcon2(type)) {
13546
- return /* @__PURE__ */ jsx66(FlagIcon2, { name: type });
13863
+ return /* @__PURE__ */ jsx67(FlagIcon2, { name: type });
13547
13864
  }
13548
13865
  if (isNamedIcon2(type)) {
13549
- return /* @__PURE__ */ jsx66(NamedIcon2, { name: type });
13866
+ return /* @__PURE__ */ jsx67(NamedIcon2, { name: type });
13550
13867
  }
13551
13868
  return null;
13552
13869
  }
@@ -13556,17 +13873,17 @@ function isValidIconName(name) {
13556
13873
  var DynamicIcon_default2 = DynamicIcon2;
13557
13874
 
13558
13875
  // src/legacy/layout/utils/getNavigationOptionMedia.tsx
13559
- import { jsx as jsx67 } from "react/jsx-runtime";
13876
+ import { jsx as jsx68 } from "react/jsx-runtime";
13560
13877
  var getNavigationOptionMedia = ({ icon, image }) => {
13561
13878
  if (icon == null ? void 0 : icon.name) {
13562
- return /* @__PURE__ */ jsx67(Avatar5, { type: AvatarType4.ICON, children: /* @__PURE__ */ jsx67(DynamicIcon_default2, { type: icon.name }) });
13879
+ return /* @__PURE__ */ jsx68(Avatar5, { type: AvatarType4.ICON, children: /* @__PURE__ */ jsx68(DynamicIcon_default2, { type: icon.name }) });
13563
13880
  }
13564
13881
  if (icon == null ? void 0 : icon.text) {
13565
- return /* @__PURE__ */ jsx67(Avatar5, { type: AvatarType4.INITIALS, children: icon.text });
13882
+ return /* @__PURE__ */ jsx68(Avatar5, { type: AvatarType4.INITIALS, children: icon.text });
13566
13883
  }
13567
13884
  if (image == null ? void 0 : image.url) {
13568
13885
  const { url, text } = image;
13569
- return /* @__PURE__ */ jsx67("img", { src: url, alt: text });
13886
+ return /* @__PURE__ */ jsx68("img", { src: url, alt: text });
13570
13887
  }
13571
13888
  return null;
13572
13889
  };
@@ -13602,11 +13919,11 @@ var getTextAlignment2 = (align) => {
13602
13919
  var getTextAlignmentAndMargin2 = (component) => `${getTextAlignment2(component.align)} ${getMargin2(component.margin)}`;
13603
13920
 
13604
13921
  // src/legacy/layout/alert/DynamicAlert.tsx
13605
- import { jsx as jsx68 } from "react/jsx-runtime";
13922
+ import { jsx as jsx69 } from "react/jsx-runtime";
13606
13923
  var DynamicAlert = (props) => {
13607
13924
  const alert = props.component;
13608
- return /* @__PURE__ */ jsx68(
13609
- Alert3,
13925
+ return /* @__PURE__ */ jsx69(
13926
+ Alert4,
13610
13927
  {
13611
13928
  type: mapContextToAlertType(legacy_mapContext(alert.context)),
13612
13929
  className: getMargin2(alert.margin),
@@ -13638,12 +13955,12 @@ var mapContextToAlertType = (context) => {
13638
13955
  var DynamicAlert_default = DynamicAlert;
13639
13956
 
13640
13957
  // src/legacy/layout/box/DynamicBox.tsx
13641
- import { jsx as jsx69 } from "react/jsx-runtime";
13958
+ import { jsx as jsx70 } from "react/jsx-runtime";
13642
13959
  var DynamicBox = (props) => {
13643
13960
  const box = props.component;
13644
13961
  const margin = getMargin2(box.margin || box.border ? "lg" : "xs");
13645
13962
  if (!box.width || box.width === "xl") {
13646
- return /* @__PURE__ */ jsx69("div", { className: margin + getBorderClass(box.border), children: /* @__PURE__ */ jsx69(
13963
+ return /* @__PURE__ */ jsx70("div", { className: margin + getBorderClass(box.border), children: /* @__PURE__ */ jsx70(
13647
13964
  DynamicLayout_default,
13648
13965
  {
13649
13966
  components: box.components,
@@ -13656,7 +13973,7 @@ var DynamicBox = (props) => {
13656
13973
  }
13657
13974
  ) });
13658
13975
  }
13659
- return /* @__PURE__ */ jsx69("div", { className: "row", children: /* @__PURE__ */ jsx69("div", { className: margin + getBoxWidthClasses(box), children: /* @__PURE__ */ jsx69("div", { className: getBorderClass(box.border), children: /* @__PURE__ */ jsx69(
13976
+ return /* @__PURE__ */ jsx70("div", { className: "row", children: /* @__PURE__ */ jsx70("div", { className: margin + getBoxWidthClasses(box), children: /* @__PURE__ */ jsx70("div", { className: getBorderClass(box.border), children: /* @__PURE__ */ jsx70(
13660
13977
  DynamicLayout_default,
13661
13978
  {
13662
13979
  components: box.components,
@@ -13740,7 +14057,7 @@ var getButtonSize = (size) => {
13740
14057
  };
13741
14058
 
13742
14059
  // src/legacy/layout/button/DynamicButton.tsx
13743
- import { jsx as jsx70 } from "react/jsx-runtime";
14060
+ import { jsx as jsx71 } from "react/jsx-runtime";
13744
14061
  function DynamicButton(props) {
13745
14062
  var _a;
13746
14063
  const { component, onAction } = props;
@@ -13749,7 +14066,7 @@ function DynamicButton(props) {
13749
14066
  const priority = getButtonPriority(component);
13750
14067
  const { loading } = useDynamicFlow();
13751
14068
  const className = getMargin2(component.margin || "md");
13752
- return /* @__PURE__ */ jsx70(
14069
+ return /* @__PURE__ */ jsx71(
13753
14070
  Button6,
13754
14071
  {
13755
14072
  size: getButtonSize(component.size),
@@ -13766,12 +14083,12 @@ function DynamicButton(props) {
13766
14083
  var DynamicButton_default = DynamicButton;
13767
14084
 
13768
14085
  // src/legacy/layout/columns/DynamicColumns.tsx
13769
- import { jsx as jsx71, jsxs as jsxs24 } from "react/jsx-runtime";
14086
+ import { jsx as jsx72, jsxs as jsxs24 } from "react/jsx-runtime";
13770
14087
  var DynamicColumns = (props) => {
13771
14088
  const columns = props.component;
13772
14089
  const { leftWidth, rightWidth } = getWidth(columns.bias);
13773
14090
  return /* @__PURE__ */ jsxs24("div", { className: `${getMargin2(columns.margin || "xs")} row`, children: [
13774
- /* @__PURE__ */ jsx71("div", { className: `${leftWidth} m-b-0`, children: /* @__PURE__ */ jsx71(
14091
+ /* @__PURE__ */ jsx72("div", { className: `${leftWidth} m-b-0`, children: /* @__PURE__ */ jsx72(
13775
14092
  DynamicLayout_default,
13776
14093
  {
13777
14094
  components: columns.left,
@@ -13783,7 +14100,7 @@ var DynamicColumns = (props) => {
13783
14100
  onPersistAsync: props.onPersistAsync
13784
14101
  }
13785
14102
  ) }),
13786
- /* @__PURE__ */ jsx71("div", { className: `${rightWidth} m-b-0`, children: /* @__PURE__ */ jsx71(
14103
+ /* @__PURE__ */ jsx72("div", { className: `${rightWidth} m-b-0`, children: /* @__PURE__ */ jsx72(
13787
14104
  DynamicLayout_default,
13788
14105
  {
13789
14106
  components: columns.right,
@@ -13819,10 +14136,10 @@ var DynamicColumns_default = DynamicColumns;
13819
14136
 
13820
14137
  // src/legacy/layout/decision/DynamicDecision.tsx
13821
14138
  import { NavigationOption as NavigationOption4, NavigationOptionsList as NavigationOptionsList3 } from "@transferwise/components";
13822
- import { jsx as jsx72 } from "react/jsx-runtime";
14139
+ import { jsx as jsx73 } from "react/jsx-runtime";
13823
14140
  function DynamicDecision({ component, onAction }) {
13824
14141
  const { loading } = useDynamicFlow();
13825
- return /* @__PURE__ */ jsx72("div", { className: getMargin2(component.margin), children: /* @__PURE__ */ jsx72(NavigationOptionsList3, { children: component.options.map((option) => /* @__PURE__ */ jsx72(
14142
+ return /* @__PURE__ */ jsx73("div", { className: getMargin2(component.margin), children: /* @__PURE__ */ jsx73(NavigationOptionsList3, { children: component.options.map((option) => /* @__PURE__ */ jsx73(
13826
14143
  NavigationOption4,
13827
14144
  {
13828
14145
  title: option.title,
@@ -13839,22 +14156,22 @@ function DynamicDecision({ component, onAction }) {
13839
14156
  var DynamicDecision_default = DynamicDecision;
13840
14157
 
13841
14158
  // src/legacy/layout/divider/DynamicDivider.tsx
13842
- import { jsx as jsx73 } from "react/jsx-runtime";
14159
+ import { jsx as jsx74 } from "react/jsx-runtime";
13843
14160
  var DynamicDivider = ({ component }) => {
13844
14161
  const margin = getMargin2(component.margin);
13845
14162
  const className = `m-t-0 ${margin}`;
13846
- return /* @__PURE__ */ jsx73("hr", { className });
14163
+ return /* @__PURE__ */ jsx74("hr", { className });
13847
14164
  };
13848
14165
  var DynamicDivider_default = DynamicDivider;
13849
14166
 
13850
14167
  // src/legacy/layout/external/DynamicExternal.tsx
13851
14168
  import { Button as Button7, Loader as Loader2, Size as Size2 } from "@transferwise/components";
13852
14169
  import { useCallback as useCallback6, useEffect as useEffect8 } from "react";
13853
- import { useIntl as useIntl8 } from "react-intl";
14170
+ import { useIntl as useIntl9 } from "react-intl";
13854
14171
 
13855
14172
  // src/legacy/layout/external/DynamicExternal.messages.ts
13856
- import { defineMessages as defineMessages9 } from "react-intl";
13857
- var DynamicExternal_messages_default = defineMessages9({
14173
+ import { defineMessages as defineMessages10 } from "react-intl";
14174
+ var DynamicExternal_messages_default = defineMessages10({
13858
14175
  retryTitle: {
13859
14176
  id: "dynamicFlows.DynamicExternal.retryTitle",
13860
14177
  defaultMessage: "Reopen window",
@@ -13863,10 +14180,10 @@ var DynamicExternal_messages_default = defineMessages9({
13863
14180
  });
13864
14181
 
13865
14182
  // src/legacy/layout/external/DynamicExternal.tsx
13866
- import { Fragment as Fragment11, jsx as jsx74, jsxs as jsxs25 } from "react/jsx-runtime";
14183
+ import { Fragment as Fragment11, jsx as jsx75, jsxs as jsxs25 } from "react/jsx-runtime";
13867
14184
  var DynamicExternal = ({ component, onAction }) => {
13868
14185
  const { requestUrl, responseHandlers, polling, retryTitle } = component;
13869
- const intl = useIntl8();
14186
+ const intl = useIntl9();
13870
14187
  const openExternalUrl = useCallback6(
13871
14188
  () => window.open(requestUrl, "df-external-window"),
13872
14189
  [requestUrl]
@@ -13879,9 +14196,9 @@ var DynamicExternal = ({ component, onAction }) => {
13879
14196
  }) : void 0;
13880
14197
  useExternalStepPolling(pollingConfiguration, onAction);
13881
14198
  return /* @__PURE__ */ jsxs25(Fragment11, { children: [
13882
- /* @__PURE__ */ jsx74(Loader2, { size: Size2.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
13883
- /* @__PURE__ */ jsx74("br", {}),
13884
- /* @__PURE__ */ jsx74(Button7, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
14199
+ /* @__PURE__ */ jsx75(Loader2, { size: Size2.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
14200
+ /* @__PURE__ */ jsx75("br", {}),
14201
+ /* @__PURE__ */ jsx75(Button7, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
13885
14202
  ] });
13886
14203
  };
13887
14204
  var DynamicExternal_default = DynamicExternal;
@@ -13892,8 +14209,8 @@ import { useEffect as useEffect15 } from "react";
13892
14209
  // src/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
13893
14210
  var import_classnames7 = __toESM(require_classnames());
13894
14211
  import { Header as Header6 } from "@transferwise/components";
13895
- import { useState as useState12 } from "react";
13896
- import { Fragment as Fragment12, jsx as jsx75, jsxs as jsxs26 } from "react/jsx-runtime";
14212
+ import { useState as useState13 } from "react";
14213
+ import { Fragment as Fragment12, jsx as jsx76, jsxs as jsxs26 } from "react/jsx-runtime";
13897
14214
  var splitModel = (model, schemas) => schemas.map((schema) => getValidObjectModelParts(model, schema) || {});
13898
14215
  var combineModels = (models) => models.reduce((current, combined) => __spreadValues(__spreadValues({}, combined), current), {});
13899
14216
  var getSchemaColumnClasses = (width) => ({
@@ -13908,13 +14225,13 @@ function AllOfSchema(props) {
13908
14225
  setModels(models);
13909
14226
  props.onChange(__spreadProps(__spreadValues({}, onChangeProps), { model: combineModels(models) }));
13910
14227
  };
13911
- const [models, setModels] = useState12(splitModel(props.model, props.schema.allOf));
14228
+ const [models, setModels] = useState13(splitModel(props.model, props.schema.allOf));
13912
14229
  return /* @__PURE__ */ jsxs26(Fragment12, { children: [
13913
- props.schema.title && /* @__PURE__ */ jsx75(Header6, { title: props.schema.title }),
13914
- props.schema.description && /* @__PURE__ */ jsx75("p", { children: props.schema.description }),
13915
- /* @__PURE__ */ jsx75("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
14230
+ props.schema.title && /* @__PURE__ */ jsx76(Header6, { title: props.schema.title }),
14231
+ props.schema.description && /* @__PURE__ */ jsx76("p", { children: props.schema.description }),
14232
+ /* @__PURE__ */ jsx76("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
13916
14233
  // eslint-disable-next-line react/no-array-index-key
13917
- /* @__PURE__ */ jsx75("div", { className: (0, import_classnames7.default)(getSchemaColumnClasses(schema.width)), children: /* @__PURE__ */ jsx75(
14234
+ /* @__PURE__ */ jsx76("div", { className: (0, import_classnames7.default)(getSchemaColumnClasses(schema.width)), children: /* @__PURE__ */ jsx76(
13918
14235
  GenericSchema_default,
13919
14236
  {
13920
14237
  schema,
@@ -13943,13 +14260,13 @@ import {
13943
14260
  Status,
13944
14261
  UploadInput as UploadInput3
13945
14262
  } from "@transferwise/components";
13946
- import { useMemo as useMemo11, useState as useState13 } from "react";
14263
+ import { useMemo as useMemo11, useState as useState14 } from "react";
13947
14264
 
13948
14265
  // src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
13949
14266
  import { InlineAlert as InlineAlert4 } from "@transferwise/components";
13950
14267
  import { formatDate as formatDate3 } from "@transferwise/formatting";
13951
- import { useIntl as useIntl9 } from "react-intl";
13952
- import { jsx as jsx76, jsxs as jsxs27 } from "react/jsx-runtime";
14268
+ import { useIntl as useIntl10 } from "react-intl";
14269
+ import { jsx as jsx77, jsxs as jsxs27 } from "react/jsx-runtime";
13953
14270
  function ControlFeedback(props) {
13954
14271
  var _a;
13955
14272
  const defaultValidationMessages = useDefaultValidationMessages(props.schema);
@@ -13959,11 +14276,11 @@ function ControlFeedback(props) {
13959
14276
  const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
13960
14277
  const hasInfoMessage = Boolean(props.infoMessage);
13961
14278
  return /* @__PURE__ */ jsxs27("div", { id: props.id, children: [
13962
- isErrorVisible ? /* @__PURE__ */ jsx76(InlineAlert4, { type: "error", children: props.errors }) : null,
13963
- isValidationVisible ? /* @__PURE__ */ jsx76(InlineAlert4, { type: "error", children: props.validations.map((validation) => /* @__PURE__ */ jsx76("div", { children: validationMessages[validation] }, validation)) }) : null,
14279
+ isErrorVisible ? /* @__PURE__ */ jsx77(InlineAlert4, { type: "error", children: props.errors }) : null,
14280
+ isValidationVisible ? /* @__PURE__ */ jsx77(InlineAlert4, { type: "error", children: props.validations.map((validation) => /* @__PURE__ */ jsx77("div", { children: validationMessages[validation] }, validation)) }) : null,
13964
14281
  (isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ jsxs27(InlineAlert4, { type: "info", children: [
13965
- isDescriptionVisible && /* @__PURE__ */ jsx76("div", { children: props.schema.description }),
13966
- hasInfoMessage && /* @__PURE__ */ jsx76("div", { children: props.infoMessage })
14282
+ isDescriptionVisible && /* @__PURE__ */ jsx77("div", { children: props.schema.description }),
14283
+ hasInfoMessage && /* @__PURE__ */ jsx77("div", { children: props.infoMessage })
13967
14284
  ] })
13968
14285
  ] });
13969
14286
  }
@@ -13974,7 +14291,7 @@ ControlFeedback.defaultProps = {
13974
14291
  validationAsyncSuccessMessage: null
13975
14292
  };
13976
14293
  function useDefaultValidationMessages(schema) {
13977
- const { formatMessage, locale } = useIntl9();
14294
+ const { formatMessage, locale } = useIntl10();
13978
14295
  const formattedMessages = {
13979
14296
  type: formatMessage(validation_messages_default.type),
13980
14297
  minimum: formatMessage(validation_messages_default.minimum, {
@@ -14061,11 +14378,11 @@ function constructUploadError(response) {
14061
14378
  }
14062
14379
 
14063
14380
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.tsx
14064
- import { useIntl as useIntl10 } from "react-intl";
14381
+ import { useIntl as useIntl11 } from "react-intl";
14065
14382
 
14066
14383
  // src/legacy/common/messages.ts
14067
- import { defineMessages as defineMessages10 } from "react-intl";
14068
- var messages_default = defineMessages10({
14384
+ import { defineMessages as defineMessages11 } from "react-intl";
14385
+ var messages_default = defineMessages11({
14069
14386
  required: {
14070
14387
  id: "dynamicFlows.DefaultErrorMessages.required",
14071
14388
  defaultMessage: "Please fill out this field.",
@@ -14078,7 +14395,7 @@ function useFormattedDefaultErrorMessages({
14078
14395
  maxItems,
14079
14396
  minItems
14080
14397
  }) {
14081
- const { formatMessage } = useIntl10();
14398
+ const { formatMessage } = useIntl11();
14082
14399
  const { maxFileSizeError, maxItemsError, minItemsError } = multi_file_upload_messages_default;
14083
14400
  return {
14084
14401
  maxFileSizeErrorMessage: formatMessage(maxFileSizeError),
@@ -14089,15 +14406,15 @@ function useFormattedDefaultErrorMessages({
14089
14406
  }
14090
14407
 
14091
14408
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
14092
- import { jsx as jsx77, jsxs as jsxs28 } from "react/jsx-runtime";
14409
+ import { jsx as jsx78, jsxs as jsxs28 } from "react/jsx-runtime";
14093
14410
  function MultipleFileUploadSchema(props) {
14094
14411
  var _a, _b;
14095
14412
  const { onChange, schema } = props;
14096
14413
  const onEvent = useEventDispatcher();
14097
14414
  const defaultErrorMessages = useFormattedDefaultErrorMessages(schema);
14098
14415
  const uid = useMemo11(() => schema.$id || generateRandomId(), [schema.$id]);
14099
- const [inputChanged, setInputChanged] = useState13(false);
14100
- const [files, setFiles] = useState13(() => convertFileIdsToComponentFileObjects(props.model || []));
14416
+ const [inputChanged, setInputChanged] = useState14(false);
14417
+ const [files, setFiles] = useState14(() => convertFileIdsToComponentFileObjects(props.model || []));
14101
14418
  const performPersistAsync = usePersistAsync(schema.items.persistAsync);
14102
14419
  const fileSchemaDescriptor = schema.items.persistAsync.schema;
14103
14420
  const isBlob = isBlobSchema2(fileSchemaDescriptor);
@@ -14152,9 +14469,9 @@ function MultipleFileUploadSchema(props) {
14152
14469
  });
14153
14470
  const feedbackId = `${uid}-feedback`;
14154
14471
  return /* @__PURE__ */ jsxs28("div", { className: (0, import_classnames8.default)("form-group", { "has-error": showError }), children: [
14155
- /* @__PURE__ */ jsx77("label", { className: "d-block control-label", htmlFor: uid, children: props.schema.title }),
14156
- /* @__PURE__ */ jsx77("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ jsx77(UploadInput3, __spreadValues({}, uploadInputProps)) }),
14157
- /* @__PURE__ */ jsx77(
14472
+ /* @__PURE__ */ jsx78("label", { className: "d-block control-label", htmlFor: uid, children: props.schema.title }),
14473
+ /* @__PURE__ */ jsx78("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ jsx78(UploadInput3, __spreadValues({}, uploadInputProps)) }),
14474
+ /* @__PURE__ */ jsx78(
14158
14475
  ControlFeedback_default,
14159
14476
  {
14160
14477
  id: feedbackId,
@@ -14196,13 +14513,13 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
14196
14513
 
14197
14514
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
14198
14515
  var import_classnames9 = __toESM(require_classnames());
14199
- import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
14200
- import { useEffect as useEffect9, useMemo as useMemo12, useState as useState14 } from "react";
14201
- import { useIntl as useIntl11 } from "react-intl";
14516
+ import { SelectInput as SelectInput3, SelectInputOptionContent as SelectInputOptionContent3 } from "@transferwise/components";
14517
+ import { useEffect as useEffect9, useMemo as useMemo12, useState as useState15 } from "react";
14518
+ import { useIntl as useIntl12 } from "react-intl";
14202
14519
 
14203
14520
  // src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
14204
14521
  import { Avatar as Avatar6, AvatarType as AvatarType5 } from "@transferwise/components";
14205
- import { jsx as jsx78 } from "react/jsx-runtime";
14522
+ import { jsx as jsx79 } from "react/jsx-runtime";
14206
14523
  var mapConstSchemaToOption = (schema, controlType) => {
14207
14524
  switch (controlType) {
14208
14525
  case "select":
@@ -14226,7 +14543,7 @@ var mapKeywordsToSearchStrings = (searchStrings) => isArray2(searchStrings) ? {
14226
14543
  var mapImage = (image) => {
14227
14544
  if (image == null ? void 0 : image.url) {
14228
14545
  return {
14229
- icon: /* @__PURE__ */ jsx78("div", { className: "media", children: /* @__PURE__ */ jsx78("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ jsx78("img", { src: image.url, alt: image.name || "" }) }) }),
14546
+ icon: /* @__PURE__ */ jsx79("div", { className: "media", children: /* @__PURE__ */ jsx79("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ jsx79("img", { src: image.url, alt: image.name || "" }) }) }),
14230
14547
  hideIconInTrigger: true
14231
14548
  };
14232
14549
  }
@@ -14235,17 +14552,17 @@ var mapImage = (image) => {
14235
14552
  var getIconPropertyForSelectOption = (icon) => {
14236
14553
  if ((icon == null ? void 0 : icon.name) && isFlagIcon2(icon.name)) {
14237
14554
  return {
14238
- icon: /* @__PURE__ */ jsx78(Flag, { code: icon.name.substring(5), intrinsicSize: 24 })
14555
+ icon: /* @__PURE__ */ jsx79(Flag, { code: icon.name.substring(5), intrinsicSize: 24 })
14239
14556
  };
14240
14557
  }
14241
14558
  if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
14242
14559
  return {
14243
- icon: /* @__PURE__ */ jsx78(DynamicIcon_default2, { type: icon.name })
14560
+ icon: /* @__PURE__ */ jsx79(DynamicIcon_default2, { type: icon.name })
14244
14561
  };
14245
14562
  }
14246
14563
  if (icon == null ? void 0 : icon.text) {
14247
14564
  return {
14248
- icon: /* @__PURE__ */ jsx78("span", { children: icon.text })
14565
+ icon: /* @__PURE__ */ jsx79("span", { children: icon.text })
14249
14566
  };
14250
14567
  }
14251
14568
  return null;
@@ -14253,17 +14570,17 @@ var getIconPropertyForSelectOption = (icon) => {
14253
14570
  var getAvatarPropertyForRadioOption = ({ image, icon }) => {
14254
14571
  if (image == null ? void 0 : image.url) {
14255
14572
  return {
14256
- avatar: /* @__PURE__ */ jsx78(Avatar6, { type: AvatarType5.THUMBNAIL, children: /* @__PURE__ */ jsx78("img", { src: image.url, alt: "" }) })
14573
+ avatar: /* @__PURE__ */ jsx79(Avatar6, { type: AvatarType5.THUMBNAIL, children: /* @__PURE__ */ jsx79("img", { src: image.url, alt: "" }) })
14257
14574
  };
14258
14575
  }
14259
14576
  if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
14260
14577
  return {
14261
- avatar: /* @__PURE__ */ jsx78(Avatar6, { type: AvatarType5.ICON, children: /* @__PURE__ */ jsx78(DynamicIcon_default2, { type: icon.name }) })
14578
+ avatar: /* @__PURE__ */ jsx79(Avatar6, { type: AvatarType5.ICON, children: /* @__PURE__ */ jsx79(DynamicIcon_default2, { type: icon.name }) })
14262
14579
  };
14263
14580
  }
14264
14581
  if (icon == null ? void 0 : icon.text) {
14265
14582
  return {
14266
- avatar: /* @__PURE__ */ jsx78(Avatar6, { type: AvatarType5.INITIALS, children: icon.text })
14583
+ avatar: /* @__PURE__ */ jsx79(Avatar6, { type: AvatarType5.INITIALS, children: icon.text })
14267
14584
  };
14268
14585
  }
14269
14586
  return null;
@@ -14291,18 +14608,8 @@ var getDisabled = (disabled) => {
14291
14608
  return void 0;
14292
14609
  };
14293
14610
 
14294
- // src/common/messages/multi-select.messages.ts
14295
- import { defineMessages as defineMessages11 } from "react-intl";
14296
- var multi_select_messages_default = defineMessages11({
14297
- summary: {
14298
- id: "dynamicFlows.MultiSelect.summary",
14299
- defaultMessage: "{first} and {count} more",
14300
- description: "A summary of the multiple items selected. Showing the title of the first selected item, and the number of other items that have been selected."
14301
- }
14302
- });
14303
-
14304
14611
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
14305
- import { jsx as jsx79, jsxs as jsxs29 } from "react/jsx-runtime";
14612
+ import { jsx as jsx80, jsxs as jsxs29 } from "react/jsx-runtime";
14306
14613
  function MultiSelectSchema({
14307
14614
  schema,
14308
14615
  model,
@@ -14311,12 +14618,12 @@ function MultiSelectSchema({
14311
14618
  errors,
14312
14619
  onChange
14313
14620
  }) {
14314
- const { formatMessage, locale } = useIntl11();
14621
+ const { formatMessage, locale } = useIntl12();
14315
14622
  const { disabled, items, validationMessages, placeholder } = schema;
14316
14623
  const options = items.oneOf.map((item) => mapConstSchemaToOption(item, "select"));
14317
14624
  const id = useMemo12(() => schema.$id || generateRandomId(), [schema.$id]);
14318
- const [changed, setChanged] = useState14(false);
14319
- const [selected, setSelected] = useState14(getInitialModelIndices(model, options));
14625
+ const [changed, setChanged] = useState15(false);
14626
+ const [selected, setSelected] = useState15(getInitialModelIndices2(model, options));
14320
14627
  useEffect9(
14321
14628
  () => {
14322
14629
  if (selected) {
@@ -14355,9 +14662,9 @@ function MultiSelectSchema({
14355
14662
  "has-error": shouldShowInitialError || shouldShowValidationError
14356
14663
  };
14357
14664
  return /* @__PURE__ */ jsxs29("div", { className: (0, import_classnames9.default)("d-flex flex-column", formGroupClasses), children: [
14358
- schema.title ? /* @__PURE__ */ jsx79("label", { htmlFor: id, children: schema.title }) : void 0,
14359
- /* @__PURE__ */ jsx79(
14360
- SelectInput2,
14665
+ schema.title ? /* @__PURE__ */ jsx80("label", { htmlFor: id, children: schema.title }) : void 0,
14666
+ /* @__PURE__ */ jsx80(
14667
+ SelectInput3,
14361
14668
  {
14362
14669
  id,
14363
14670
  multiple: true,
@@ -14382,12 +14689,12 @@ function MultiSelectSchema({
14382
14689
  if (withinTrigger) {
14383
14690
  return selected && index === selected[0] ? getFormattedMessage() : void 0;
14384
14691
  }
14385
- return /* @__PURE__ */ jsx79(SelectInputOptionContent2, { title: label, note: note != null ? note : secondary, icon });
14692
+ return /* @__PURE__ */ jsx80(SelectInputOptionContent3, { title: label, note: note != null ? note : secondary, icon });
14386
14693
  },
14387
14694
  onChange: broadcastModelChange
14388
14695
  }
14389
14696
  ),
14390
- /* @__PURE__ */ jsx79(
14697
+ /* @__PURE__ */ jsx80(
14391
14698
  ControlFeedback_default,
14392
14699
  {
14393
14700
  id: `${id}-feedback`,
@@ -14404,7 +14711,7 @@ function MultiSelectSchema({
14404
14711
  )
14405
14712
  ] });
14406
14713
  }
14407
- var getInitialModelIndices = (model, options) => {
14714
+ var getInitialModelIndices2 = (model, options) => {
14408
14715
  if (model == null) {
14409
14716
  return null;
14410
14717
  }
@@ -14414,14 +14721,14 @@ var getInitialModelIndices = (model, options) => {
14414
14721
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
14415
14722
  import { Header as Header7, Modal as Modal3, NavigationOption as NavigationOption6 } from "@transferwise/components";
14416
14723
  import { Plus as Plus2 } from "@transferwise/icons";
14417
- import { useMemo as useMemo13, useState as useState16 } from "react";
14418
- import { useIntl as useIntl13 } from "react-intl";
14724
+ import { useMemo as useMemo13, useState as useState17 } from "react";
14725
+ import { useIntl as useIntl14 } from "react-intl";
14419
14726
 
14420
14727
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
14421
14728
  import { NavigationOption as NavigationOption5 } from "@transferwise/components";
14422
- import { jsx as jsx80 } from "react/jsx-runtime";
14729
+ import { jsx as jsx81 } from "react/jsx-runtime";
14423
14730
  function ItemSummaryOption2({ item, onClick }) {
14424
- return /* @__PURE__ */ jsx80(
14731
+ return /* @__PURE__ */ jsx81(
14425
14732
  NavigationOption5,
14426
14733
  {
14427
14734
  media: getNavigationOptionMedia(item),
@@ -14434,9 +14741,9 @@ function ItemSummaryOption2({ item, onClick }) {
14434
14741
  }
14435
14742
 
14436
14743
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.tsx
14437
- import { useState as useState15 } from "react";
14438
- import { useIntl as useIntl12 } from "react-intl";
14439
- import { jsx as jsx81 } from "react/jsx-runtime";
14744
+ import { useState as useState16 } from "react";
14745
+ import { useIntl as useIntl13 } from "react-intl";
14746
+ import { jsx as jsx82 } from "react/jsx-runtime";
14440
14747
  function RepeatableSchemaStep({
14441
14748
  type,
14442
14749
  schema,
@@ -14446,8 +14753,8 @@ function RepeatableSchemaStep({
14446
14753
  onModelChange,
14447
14754
  onAction
14448
14755
  }) {
14449
- const { formatMessage } = useIntl12();
14450
- const [filename, setFilename] = useState15(void 0);
14756
+ const { formatMessage } = useIntl13();
14757
+ const [filename, setFilename] = useState16(void 0);
14451
14758
  const step = {
14452
14759
  layout: [
14453
14760
  {
@@ -14484,7 +14791,7 @@ function RepeatableSchemaStep({
14484
14791
  }
14485
14792
  onModelChange(__spreadProps(__spreadValues({}, modelChangeProps), { model: model2 }));
14486
14793
  };
14487
- return /* @__PURE__ */ jsx81(
14794
+ return /* @__PURE__ */ jsx82(
14488
14795
  DynamicFlowStep,
14489
14796
  {
14490
14797
  step,
@@ -14690,7 +14997,7 @@ var schemaSummaryProvides = (summary, providesProp) => (
14690
14997
 
14691
14998
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
14692
14999
  var import_classnames10 = __toESM(require_classnames());
14693
- import { jsx as jsx82, jsxs as jsxs30 } from "react/jsx-runtime";
15000
+ import { jsx as jsx83, jsxs as jsxs30 } from "react/jsx-runtime";
14694
15001
  function RepeatableSchema({
14695
15002
  schema,
14696
15003
  model,
@@ -14700,9 +15007,9 @@ function RepeatableSchema({
14700
15007
  onChange
14701
15008
  }) {
14702
15009
  var _a;
14703
- const [openModalType, setOpenModalType] = useState16(null);
14704
- const [changed, setChanged] = useState16(false);
14705
- const [itemSummaries, setItemSummaries] = useState16(() => {
15010
+ const [openModalType, setOpenModalType] = useState17(null);
15011
+ const [changed, setChanged] = useState17(false);
15012
+ const [itemSummaries, setItemSummaries] = useState17(() => {
14706
15013
  if (isObject2(model) && !isArray2(model)) {
14707
15014
  throw new Error(
14708
15015
  "RepeatableSchema does not support object models. Ensure your array schema is wrapped inside an object schema."
@@ -14710,7 +15017,7 @@ function RepeatableSchema({
14710
15017
  }
14711
15018
  return model ? model.map((item) => getItemSummaryFromSchema(schema.items, item, schema == null ? void 0 : schema.summary)) : null;
14712
15019
  });
14713
- const [editableItem, setEditableItem] = useState16({ item: null, model: null });
15020
+ const [editableItem, setEditableItem] = useState17({ item: null, model: null });
14714
15021
  const id = useMemo13(() => schema.$id || generateRandomId(), [schema.$id]);
14715
15022
  const broadcastModelChange = (updatedItems) => {
14716
15023
  const updatedModel = updatedItems ? updatedItems.map(({ value }) => value) : null;
@@ -14753,7 +15060,7 @@ function RepeatableSchema({
14753
15060
  setEditableItem({ item: null, model: null });
14754
15061
  setOpenModalType(null);
14755
15062
  };
14756
- const { formatMessage } = useIntl13();
15063
+ const { formatMessage } = useIntl14();
14757
15064
  const validations = getValidationFailures(model, schema, required);
14758
15065
  const base64ValidationMessages = useFormattedDefaultErrorMessages({
14759
15066
  minItems: schema.minItems,
@@ -14768,8 +15075,8 @@ function RepeatableSchema({
14768
15075
  "has-error": (_a = errors && !isEmpty(errors)) != null ? _a : submitted && validations.length
14769
15076
  };
14770
15077
  return /* @__PURE__ */ jsxs30("div", { id, className: (0, import_classnames10.default)(formGroupClasses), children: [
14771
- schema.title && /* @__PURE__ */ jsx82(Header7, { title: schema.title }),
14772
- itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ jsx82(
15078
+ schema.title && /* @__PURE__ */ jsx83(Header7, { title: schema.title }),
15079
+ itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ jsx83(
14773
15080
  ItemSummaryOption2,
14774
15081
  {
14775
15082
  item: itemSummary,
@@ -14777,21 +15084,21 @@ function RepeatableSchema({
14777
15084
  },
14778
15085
  JSON.stringify(itemSummary)
14779
15086
  )),
14780
- /* @__PURE__ */ jsx82(
15087
+ /* @__PURE__ */ jsx83(
14781
15088
  NavigationOption6,
14782
15089
  {
14783
- media: /* @__PURE__ */ jsx82(Plus2, {}),
15090
+ media: /* @__PURE__ */ jsx83(Plus2, {}),
14784
15091
  title: schema.addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
14785
15092
  showMediaAtAllSizes: true,
14786
15093
  onClick: onAddItem
14787
15094
  }
14788
15095
  ),
14789
- /* @__PURE__ */ jsx82(
15096
+ /* @__PURE__ */ jsx83(
14790
15097
  Modal3,
14791
15098
  {
14792
15099
  open: openModalType !== null,
14793
15100
  title: (openModalType === "add" ? schema.addItemTitle : schema.editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
14794
- body: /* @__PURE__ */ jsx82(
15101
+ body: /* @__PURE__ */ jsx83(
14795
15102
  RepeatableSchemaStep_default,
14796
15103
  {
14797
15104
  type: openModalType != null ? openModalType : "add",
@@ -14806,7 +15113,7 @@ function RepeatableSchema({
14806
15113
  onClose: onCancelEdit
14807
15114
  }
14808
15115
  ),
14809
- /* @__PURE__ */ jsx82(
15116
+ /* @__PURE__ */ jsx83(
14810
15117
  ControlFeedback_default,
14811
15118
  {
14812
15119
  id: `${id}-feedback`,
@@ -14848,17 +15155,17 @@ var getUpdatedItemSummaries = (action, {
14848
15155
  var RepeatableSchema_default = RepeatableSchema;
14849
15156
 
14850
15157
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/ArrayListSchema.tsx
14851
- import { jsx as jsx83 } from "react/jsx-runtime";
15158
+ import { jsx as jsx84 } from "react/jsx-runtime";
14852
15159
  function ArrayListSchema(props) {
14853
15160
  const { schema } = props;
14854
15161
  if (isMultipleFileUploadSchema(schema)) {
14855
- return /* @__PURE__ */ jsx83(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
15162
+ return /* @__PURE__ */ jsx84(MultipleFileUploadSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
14856
15163
  }
14857
15164
  if (isMultiSelectConstSchema(schema)) {
14858
- return /* @__PURE__ */ jsx83(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { schema }));
15165
+ return /* @__PURE__ */ jsx84(MultiSelectSchema, __spreadProps(__spreadValues({}, props), { schema }));
14859
15166
  }
14860
15167
  if (isListArraySchema(schema)) {
14861
- return /* @__PURE__ */ jsx83(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
15168
+ return /* @__PURE__ */ jsx84(RepeatableSchema_default, __spreadProps(__spreadValues({}, props), { schema }));
14862
15169
  }
14863
15170
  throw new Error("Invalid array list schema");
14864
15171
  }
@@ -14869,11 +15176,11 @@ ArrayListSchema.defaultProps = {
14869
15176
  var ArrayListSchema_default = ArrayListSchema;
14870
15177
 
14871
15178
  // src/legacy/jsonSchemaForm/arrayTypeSchema/ArraySchema.tsx
14872
- import { jsx as jsx84 } from "react/jsx-runtime";
15179
+ import { jsx as jsx85 } from "react/jsx-runtime";
14873
15180
  var ArraySchema = (props) => {
14874
15181
  const { schema } = props;
14875
15182
  if (isListArraySchema(schema)) {
14876
- return /* @__PURE__ */ jsx84(ArrayListSchema_default, __spreadValues({}, props));
15183
+ return /* @__PURE__ */ jsx85(ArrayListSchema_default, __spreadValues({}, props));
14877
15184
  }
14878
15185
  throw new Error("Not implemented");
14879
15186
  };
@@ -14885,15 +15192,15 @@ var ArraySchema_default = ArraySchema;
14885
15192
  // src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
14886
15193
  var import_classnames11 = __toESM(require_classnames());
14887
15194
  import { Header as Header8 } from "@transferwise/components";
14888
- import { useState as useState17, useEffect as useEffect10 } from "react";
14889
- import { Fragment as Fragment13, jsx as jsx85, jsxs as jsxs31 } from "react/jsx-runtime";
15195
+ import { useState as useState18, useEffect as useEffect10 } from "react";
15196
+ import { Fragment as Fragment13, jsx as jsx86, jsxs as jsxs31 } from "react/jsx-runtime";
14890
15197
  var getSchemaColumnClasses2 = (width) => ({
14891
15198
  "col-xs-12": true,
14892
15199
  "col-sm-6": width === "md",
14893
15200
  "col-sm-4": width === "sm"
14894
15201
  });
14895
15202
  function ObjectSchema(props) {
14896
- const [model, setModel] = useState17(() => __spreadValues({}, getValidObjectModelParts(props.model, props.schema)));
15203
+ const [model, setModel] = useState18(() => __spreadValues({}, getValidObjectModelParts(props.model, props.schema)));
14897
15204
  const onChangeProperty = (propertyName, onChangeProps) => {
14898
15205
  if (onChangeProps.model !== null) {
14899
15206
  model[propertyName] = onChangeProps.model;
@@ -14923,21 +15230,21 @@ function ObjectSchema(props) {
14923
15230
  const orderedPropertyNames = Array.from(allorderedPropertiesSet).filter(isPropertyDefined);
14924
15231
  const propsErrors = props.errors;
14925
15232
  return /* @__PURE__ */ jsxs31(Fragment13, { children: [
14926
- props.schema.alert && /* @__PURE__ */ jsx85(DynamicAlert_default, { component: props.schema.alert }),
15233
+ props.schema.alert && /* @__PURE__ */ jsx86(DynamicAlert_default, { component: props.schema.alert }),
14927
15234
  /* @__PURE__ */ jsxs31("fieldset", { children: [
14928
- props.schema.title && !props.hideTitle && /* @__PURE__ */ jsx85(Header8, { title: props.schema.title, as: "legend" }),
15235
+ props.schema.title && !props.hideTitle && /* @__PURE__ */ jsx86(Header8, { title: props.schema.title, as: "legend" }),
14929
15236
  props.schema.description && !props.hideTitle && /* @__PURE__ */ jsxs31("p", { children: [
14930
15237
  " ",
14931
15238
  props.schema.description,
14932
15239
  " "
14933
15240
  ] }),
14934
- /* @__PURE__ */ jsx85("div", { className: "row", children: orderedPropertyNames.map((propertyName) => /* @__PURE__ */ jsx85(
15241
+ /* @__PURE__ */ jsx86("div", { className: "row", children: orderedPropertyNames.map((propertyName) => /* @__PURE__ */ jsx86(
14935
15242
  "div",
14936
15243
  {
14937
15244
  className: (0, import_classnames11.default)(
14938
15245
  getSchemaColumnClasses2(props.schema.properties[propertyName].width)
14939
15246
  ),
14940
- children: /* @__PURE__ */ jsx85(
15247
+ children: /* @__PURE__ */ jsx86(
14941
15248
  GenericSchema_default,
14942
15249
  {
14943
15250
  schema: props.schema.properties[propertyName],
@@ -14965,19 +15272,19 @@ var ObjectSchema_default = ObjectSchema;
14965
15272
  // src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
14966
15273
  var import_classnames12 = __toESM(require_classnames());
14967
15274
  import { Header as Header9 } from "@transferwise/components";
14968
- import { useEffect as useEffect12, useMemo as useMemo14, useState as useState18 } from "react";
15275
+ import { useEffect as useEffect12, useMemo as useMemo14, useState as useState19 } from "react";
14969
15276
 
14970
15277
  // src/legacy/jsonSchemaForm/help/Help.tsx
14971
15278
  import { Markdown as Markdown6, Info as Info2 } from "@transferwise/components";
14972
- import { useIntl as useIntl14 } from "react-intl";
14973
- import { jsx as jsx86 } from "react/jsx-runtime";
15279
+ import { useIntl as useIntl15 } from "react-intl";
15280
+ import { jsx as jsx87 } from "react/jsx-runtime";
14974
15281
  function Help2(props) {
14975
- const intl = useIntl14();
14976
- return /* @__PURE__ */ jsx86(
15282
+ const intl = useIntl15();
15283
+ return /* @__PURE__ */ jsx87(
14977
15284
  Info2,
14978
15285
  {
14979
15286
  className: "m-l-1",
14980
- content: /* @__PURE__ */ jsx86(Markdown6, { config: { link: { target: "_blank" } }, children: props.help.markdown }),
15287
+ content: /* @__PURE__ */ jsx87(Markdown6, { config: { link: { target: "_blank" } }, children: props.help.markdown }),
14981
15288
  presentation: "POPOVER",
14982
15289
  size: "sm",
14983
15290
  "aria-label": intl.formatMessage(help_messages_default.helpAria)
@@ -14997,8 +15304,8 @@ import {
14997
15304
  InputWithDisplayFormat as InputWithDisplayFormat2,
14998
15305
  PhoneNumberInput as PhoneNumberInput2,
14999
15306
  RadioGroup as RadioGroup2,
15000
- SelectInput as SelectInput3,
15001
- SelectInputOptionContent as SelectInputOptionContent3,
15307
+ SelectInput as SelectInput4,
15308
+ SelectInputOptionContent as SelectInputOptionContent4,
15002
15309
  Tabs as Tabs2,
15003
15310
  TextareaWithDisplayFormat as TextareaWithDisplayFormat2,
15004
15311
  Upload as Upload2
@@ -15189,7 +15496,7 @@ var autocompleteTokenMap2 = {
15189
15496
  };
15190
15497
 
15191
15498
  // src/legacy/formControl/FormControl.tsx
15192
- import { Fragment as Fragment14, jsx as jsx87 } from "react/jsx-runtime";
15499
+ import { Fragment as Fragment14, jsx as jsx88 } from "react/jsx-runtime";
15193
15500
  var _FormControl = class _FormControl extends PureComponent {
15194
15501
  constructor(props) {
15195
15502
  super(props);
@@ -15277,7 +15584,7 @@ var _FormControl = class _FormControl extends PureComponent {
15277
15584
  } = this.props;
15278
15585
  switch (type) {
15279
15586
  case FormControlType.RADIO:
15280
- return /* @__PURE__ */ jsx87(
15587
+ return /* @__PURE__ */ jsx88(
15281
15588
  RadioGroup2,
15282
15589
  {
15283
15590
  radios: options.map(this.mapOption),
@@ -15287,7 +15594,7 @@ var _FormControl = class _FormControl extends PureComponent {
15287
15594
  }
15288
15595
  );
15289
15596
  case FormControlType.CHECKBOX:
15290
- return /* @__PURE__ */ jsx87(
15597
+ return /* @__PURE__ */ jsx88(
15291
15598
  Checkbox2,
15292
15599
  {
15293
15600
  checked: getSafeBooleanValue(value, { coerceValue: true }),
@@ -15305,8 +15612,8 @@ var _FormControl = class _FormControl extends PureComponent {
15305
15612
  const search = options.length >= 8;
15306
15613
  const items = options;
15307
15614
  const selected = this.getSelectedOption(options);
15308
- return /* @__PURE__ */ jsx87("div", { className: "d-flex flex-column", children: /* @__PURE__ */ jsx87(
15309
- SelectInput3,
15615
+ return /* @__PURE__ */ jsx88("div", { className: "d-flex flex-column", children: /* @__PURE__ */ jsx88(
15616
+ SelectInput4,
15310
15617
  {
15311
15618
  id,
15312
15619
  items: items.map((value2) => ({
@@ -15315,8 +15622,8 @@ var _FormControl = class _FormControl extends PureComponent {
15315
15622
  disabled: value2.disabled
15316
15623
  })),
15317
15624
  value: selected != null ? selected : null,
15318
- renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ jsx87(
15319
- SelectInputOptionContent3,
15625
+ renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ jsx88(
15626
+ SelectInputOptionContent4,
15320
15627
  {
15321
15628
  title: label2,
15322
15629
  note: withinTrigger ? note != null ? note : secondary : note,
@@ -15344,13 +15651,13 @@ var _FormControl = class _FormControl extends PureComponent {
15344
15651
  ) });
15345
15652
  }
15346
15653
  case FormControlType.TAB:
15347
- return /* @__PURE__ */ jsx87(
15654
+ return /* @__PURE__ */ jsx88(
15348
15655
  Tabs2,
15349
15656
  {
15350
15657
  selected: ((_a = this.getSelectedOption(options)) == null ? void 0 : _a.value) || 0,
15351
15658
  tabs: options.map((option) => ({
15352
15659
  title: option.label,
15353
- content: /* @__PURE__ */ jsx87(Fragment14, {}),
15660
+ content: /* @__PURE__ */ jsx88(Fragment14, {}),
15354
15661
  disabled: option.disabled || false
15355
15662
  })),
15356
15663
  name: id,
@@ -15365,7 +15672,7 @@ var _FormControl = class _FormControl extends PureComponent {
15365
15672
  );
15366
15673
  case FormControlType.NUMERIC:
15367
15674
  case FormControlType.NUMBER: {
15368
- return /* @__PURE__ */ jsx87(
15675
+ return /* @__PURE__ */ jsx88(
15369
15676
  "input",
15370
15677
  {
15371
15678
  autoComplete: this.getAutocompleteValue(),
@@ -15399,7 +15706,7 @@ var _FormControl = class _FormControl extends PureComponent {
15399
15706
  );
15400
15707
  }
15401
15708
  case FormControlType.HIDDEN:
15402
- return /* @__PURE__ */ jsx87(
15709
+ return /* @__PURE__ */ jsx88(
15403
15710
  "input",
15404
15711
  {
15405
15712
  type: "hidden",
@@ -15409,7 +15716,7 @@ var _FormControl = class _FormControl extends PureComponent {
15409
15716
  }
15410
15717
  );
15411
15718
  case FormControlType.PASSWORD:
15412
- return /* @__PURE__ */ jsx87(
15719
+ return /* @__PURE__ */ jsx88(
15413
15720
  "input",
15414
15721
  {
15415
15722
  autoComplete: this.getAutocompleteValue(),
@@ -15429,7 +15736,7 @@ var _FormControl = class _FormControl extends PureComponent {
15429
15736
  );
15430
15737
  case FormControlType.DATE:
15431
15738
  case FormControlType.DATETIME:
15432
- return /* @__PURE__ */ jsx87(
15739
+ return /* @__PURE__ */ jsx88(
15433
15740
  DateInput2,
15434
15741
  {
15435
15742
  dayAutoComplete: this.getAutocompleteValue({ suffix: "-day" }),
@@ -15445,7 +15752,7 @@ var _FormControl = class _FormControl extends PureComponent {
15445
15752
  }
15446
15753
  );
15447
15754
  case FormControlType.DATELOOKUP: {
15448
- return /* @__PURE__ */ jsx87(
15755
+ return /* @__PURE__ */ jsx88(
15449
15756
  DateLookup2,
15450
15757
  {
15451
15758
  value: getSafeDateStringValue(value),
@@ -15463,7 +15770,7 @@ var _FormControl = class _FormControl extends PureComponent {
15463
15770
  );
15464
15771
  }
15465
15772
  case FormControlType.TEL:
15466
- return /* @__PURE__ */ jsx87(
15773
+ return /* @__PURE__ */ jsx88(
15467
15774
  PhoneNumberInput2,
15468
15775
  {
15469
15776
  disabled,
@@ -15495,7 +15802,7 @@ var _FormControl = class _FormControl extends PureComponent {
15495
15802
  autoComplete: this.getAutocompleteValue()
15496
15803
  };
15497
15804
  if (this.props.displayPattern) {
15498
- return /* @__PURE__ */ jsx87(
15805
+ return /* @__PURE__ */ jsx88(
15499
15806
  TextareaWithDisplayFormat2,
15500
15807
  __spreadProps(__spreadValues({
15501
15808
  displayPattern: this.props.displayPattern
@@ -15504,7 +15811,7 @@ var _FormControl = class _FormControl extends PureComponent {
15504
15811
  })
15505
15812
  );
15506
15813
  }
15507
- return /* @__PURE__ */ jsx87(
15814
+ return /* @__PURE__ */ jsx88(
15508
15815
  "textarea",
15509
15816
  __spreadProps(__spreadValues({}, textareaProps), {
15510
15817
  "aria-describedby": describedBy,
@@ -15517,7 +15824,7 @@ var _FormControl = class _FormControl extends PureComponent {
15517
15824
  return (
15518
15825
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
15519
15826
  // @ts-expect-error - TODO: Remove this once Upload is migrated to TypeScript
15520
- /* @__PURE__ */ jsx87(
15827
+ /* @__PURE__ */ jsx88(
15521
15828
  Upload2,
15522
15829
  __spreadProps(__spreadValues({}, uploadProps), {
15523
15830
  usAccept: uploadProps.usAccept || "*",
@@ -15555,7 +15862,7 @@ var _FormControl = class _FormControl extends PureComponent {
15555
15862
  autoComplete: this.getAutocompleteValue()
15556
15863
  };
15557
15864
  if (this.props.displayPattern) {
15558
- return /* @__PURE__ */ jsx87(
15865
+ return /* @__PURE__ */ jsx88(
15559
15866
  InputWithDisplayFormat2,
15560
15867
  __spreadProps(__spreadValues({
15561
15868
  displayPattern: this.props.displayPattern
@@ -15564,7 +15871,7 @@ var _FormControl = class _FormControl extends PureComponent {
15564
15871
  })
15565
15872
  );
15566
15873
  }
15567
- return /* @__PURE__ */ jsx87(
15874
+ return /* @__PURE__ */ jsx88(
15568
15875
  "input",
15569
15876
  __spreadProps(__spreadValues({}, inputProps), {
15570
15877
  "aria-describedby": describedBy,
@@ -15613,7 +15920,7 @@ _FormControl.defaultProps = {
15613
15920
  var FormControl = _FormControl;
15614
15921
 
15615
15922
  // src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
15616
- import { jsx as jsx88 } from "react/jsx-runtime";
15923
+ import { jsx as jsx89 } from "react/jsx-runtime";
15617
15924
  var isNativeInput = (propsSchemaType) => propsSchemaType === "string" || propsSchemaType === "number";
15618
15925
  var getControlType = (schema) => {
15619
15926
  if (isOneOfSchema2(schema)) {
@@ -15719,7 +16026,7 @@ function SchemaFormControl(props) {
15719
16026
  describedBy,
15720
16027
  required
15721
16028
  };
15722
- return /* @__PURE__ */ jsx88("div", { "aria-describedby": describedBy, children: /* @__PURE__ */ jsx88(FormControl, __spreadValues(__spreadValues({ type: controlType, value: safeValue }, events), controlProps)) });
16029
+ return /* @__PURE__ */ jsx89("div", { "aria-describedby": describedBy, children: /* @__PURE__ */ jsx89(FormControl, __spreadValues(__spreadValues({ type: controlType, value: safeValue }, events), controlProps)) });
15723
16030
  }
15724
16031
  SchemaFormControl.defaultProps = {
15725
16032
  value: null,
@@ -15748,17 +16055,17 @@ var warnIfInvalidSchema = (schema, log, controlType) => {
15748
16055
  var SchemaFormControl_default = SchemaFormControl;
15749
16056
 
15750
16057
  // src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
15751
- import { Fragment as Fragment15, jsx as jsx89, jsxs as jsxs32 } from "react/jsx-runtime";
16058
+ import { Fragment as Fragment15, jsx as jsx90, jsxs as jsxs32 } from "react/jsx-runtime";
15752
16059
  function OneOfSchema(props) {
15753
16060
  const onEvent = useEventDispatcher();
15754
- const [changed, setChanged] = useState18(false);
15755
- const [focused, setFocused] = useState18(false);
15756
- const [blurred, setBlurred] = useState18(false);
16061
+ const [changed, setChanged] = useState19(false);
16062
+ const [focused, setFocused] = useState19(false);
16063
+ const [blurred, setBlurred] = useState19(false);
15757
16064
  const id = useMemo14(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
15758
- const [schemaIndex, setSchemaIndex] = useState18(
16065
+ const [schemaIndex, setSchemaIndex] = useState19(
15759
16066
  getActiveSchemaIndex(props.schema, props.model)
15760
16067
  );
15761
- const [models, setModels] = useState18(getModelPartsForSchemas(props.model, props.schema.oneOf));
16068
+ const [models, setModels] = useState19(getModelPartsForSchemas(props.model, props.schema.oneOf));
15762
16069
  const debouncedTrackEvent = useDebouncedFunction(onEvent, 200);
15763
16070
  const onSearchChange = (searchValue) => {
15764
16071
  debouncedTrackEvent("Dynamic Flow - OneOf Searched", {
@@ -15826,10 +16133,10 @@ function OneOfSchema(props) {
15826
16133
  const feedbackId = `${id}-feedback`;
15827
16134
  return /* @__PURE__ */ jsxs32(Fragment15, { children: [
15828
16135
  (props.schema.oneOf.length > 1 || isConstSchema2(props.schema.oneOf[0])) && /* @__PURE__ */ jsxs32(Fragment15, { children: [
15829
- props.schema.alert && /* @__PURE__ */ jsx89(DynamicAlert_default, { component: props.schema.alert }),
16136
+ props.schema.alert && /* @__PURE__ */ jsx90(DynamicAlert_default, { component: props.schema.alert }),
15830
16137
  /* @__PURE__ */ jsxs32("div", { className: (0, import_classnames12.default)(formGroupClasses), children: [
15831
16138
  getTitleAndHelp(props.schema, id),
15832
- /* @__PURE__ */ jsx89(
16139
+ /* @__PURE__ */ jsx90(
15833
16140
  SchemaFormControl_default,
15834
16141
  {
15835
16142
  id,
@@ -15844,7 +16151,7 @@ function OneOfSchema(props) {
15844
16151
  onSearchChange
15845
16152
  }
15846
16153
  ),
15847
- /* @__PURE__ */ jsx89(
16154
+ /* @__PURE__ */ jsx90(
15848
16155
  ControlFeedback_default,
15849
16156
  {
15850
16157
  id: feedbackId,
@@ -15860,7 +16167,7 @@ function OneOfSchema(props) {
15860
16167
  )
15861
16168
  ] })
15862
16169
  ] }),
15863
- isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ jsx89(
16170
+ isNoNConstSchema(props.schema.oneOf[schemaIndex]) && /* @__PURE__ */ jsx90(
15864
16171
  GenericSchema_default,
15865
16172
  {
15866
16173
  schema: props.schema.oneOf[schemaIndex],
@@ -15877,16 +16184,16 @@ function OneOfSchema(props) {
15877
16184
  }
15878
16185
  function getTitleAndHelp(schema, forId) {
15879
16186
  var _a;
15880
- const helpElement = schema.help ? /* @__PURE__ */ jsx89(Help_default2, { help: schema.help }) : null;
15881
- const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */ jsx89("div", { className: "m-b-1", children: /* @__PURE__ */ jsxs32("label", { className: "control-label d-inline", htmlFor: forId, children: [
16187
+ const helpElement = schema.help ? /* @__PURE__ */ jsx90(Help_default2, { help: schema.help }) : null;
16188
+ const titleElement = isConstSchema2(schema.oneOf[0]) ? /* @__PURE__ */ jsx90("div", { className: "m-b-1", children: /* @__PURE__ */ jsxs32("label", { className: "control-label d-inline", htmlFor: forId, children: [
15882
16189
  schema.title,
15883
16190
  " ",
15884
16191
  helpElement
15885
- ] }) }) : /* @__PURE__ */ jsx89(Fragment15, { children: helpElement ? /* @__PURE__ */ jsxs32("h4", { className: "m-b-2", children: [
16192
+ ] }) }) : /* @__PURE__ */ jsx90(Fragment15, { children: helpElement ? /* @__PURE__ */ jsxs32("h4", { className: "m-b-2", children: [
15886
16193
  schema.title,
15887
16194
  " ",
15888
16195
  helpElement
15889
- ] }) : /* @__PURE__ */ jsx89(Header9, { title: (_a = schema.title) != null ? _a : "" }) });
16196
+ ] }) : /* @__PURE__ */ jsx90(Header9, { title: (_a = schema.title) != null ? _a : "" }) });
15890
16197
  return schema.title ? titleElement : helpElement;
15891
16198
  }
15892
16199
  function getValidations(props, schemaIndex) {
@@ -15923,12 +16230,12 @@ var OneOfSchema_default = OneOfSchema;
15923
16230
 
15924
16231
  // src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
15925
16232
  var import_classnames13 = __toESM(require_classnames());
15926
- import { useEffect as useEffect13, useState as useState19 } from "react";
16233
+ import { useEffect as useEffect13, useState as useState20 } from "react";
15927
16234
 
15928
16235
  // src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
15929
16236
  import { Status as Status2, UploadInput as UploadInput4 } from "@transferwise/components";
15930
16237
  import { useMemo as useMemo15 } from "react";
15931
- import { jsx as jsx90 } from "react/jsx-runtime";
16238
+ import { jsx as jsx91 } from "react/jsx-runtime";
15932
16239
  function UploadInputAdapter(props) {
15933
16240
  const {
15934
16241
  id,
@@ -15961,7 +16268,7 @@ function UploadInputAdapter(props) {
15961
16268
  return Promise.reject();
15962
16269
  });
15963
16270
  };
15964
- return /* @__PURE__ */ jsx90(
16271
+ return /* @__PURE__ */ jsx91(
15965
16272
  UploadInput4,
15966
16273
  {
15967
16274
  id,
@@ -15981,13 +16288,13 @@ function UploadInputAdapter(props) {
15981
16288
  }
15982
16289
 
15983
16290
  // src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
15984
- import { jsx as jsx91, jsxs as jsxs33 } from "react/jsx-runtime";
16291
+ import { jsx as jsx92, jsxs as jsxs33 } from "react/jsx-runtime";
15985
16292
  function PersistAsyncBlobSchema(props) {
15986
16293
  const { model, schema, submitted, required, errors, onChange } = props;
15987
- const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = useState19({});
15988
- const [persistAsyncValidations, setPersistAsyncValidations] = useState19(null);
15989
- const [validations, setValidations] = useState19([]);
15990
- const [changed, setChanged] = useState19(false);
16294
+ const [persistAsyncValidationMessages, setPersistAsyncValidationMessages] = useState20({});
16295
+ const [persistAsyncValidations, setPersistAsyncValidations] = useState20(null);
16296
+ const [validations, setValidations] = useState20([]);
16297
+ const [changed, setChanged] = useState20(false);
15991
16298
  const httpClient = useHttpClient();
15992
16299
  const onEvent = useEventDispatcher();
15993
16300
  useEffect13(() => {
@@ -16028,7 +16335,7 @@ function PersistAsyncBlobSchema(props) {
16028
16335
  const id = schema.$id || schema.persistAsync.schema.$id || schema.persistAsync.idProperty;
16029
16336
  const feedbackId = `${id}-feedback`;
16030
16337
  return /* @__PURE__ */ jsxs33("div", { className: (0, import_classnames13.default)(formGroupClasses), children: [
16031
- /* @__PURE__ */ jsx91("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ jsx91(
16338
+ /* @__PURE__ */ jsx92("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ jsx92(
16032
16339
  UploadInputAdapter,
16033
16340
  __spreadValues({
16034
16341
  id,
@@ -16045,7 +16352,7 @@ function PersistAsyncBlobSchema(props) {
16045
16352
  onCancel
16046
16353
  }, mapSchemaToUploadOptions(schema.persistAsync.schema))
16047
16354
  ) }),
16048
- /* @__PURE__ */ jsx91(
16355
+ /* @__PURE__ */ jsx92(
16049
16356
  ControlFeedback_default,
16050
16357
  {
16051
16358
  id: feedbackId,
@@ -16070,17 +16377,17 @@ PersistAsyncBlobSchema.defaultProps = {
16070
16377
  var PersistAsyncBlobSchema_default = PersistAsyncBlobSchema;
16071
16378
 
16072
16379
  // src/legacy/jsonSchemaForm/persistAsyncSchema/PersistAsyncSchema.tsx
16073
- import { jsx as jsx92 } from "react/jsx-runtime";
16380
+ import { jsx as jsx93 } from "react/jsx-runtime";
16074
16381
  function PersistAsyncSchema(props) {
16075
16382
  const { schema } = props;
16076
16383
  const persistAsyncSchemaType = schema.persistAsync.schema.type;
16077
16384
  if (persistAsyncSchemaType === "blob") {
16078
- return /* @__PURE__ */ jsx92(
16385
+ return /* @__PURE__ */ jsx93(
16079
16386
  PersistAsyncBlobSchema_default,
16080
16387
  __spreadValues({}, props)
16081
16388
  );
16082
16389
  }
16083
- return /* @__PURE__ */ jsx92(PersistAsyncBasicSchema_default, __spreadValues({}, props));
16390
+ return /* @__PURE__ */ jsx93(PersistAsyncBasicSchema_default, __spreadValues({}, props));
16084
16391
  }
16085
16392
  PersistAsyncSchema.defaultProps = {
16086
16393
  required: false
@@ -16088,7 +16395,7 @@ PersistAsyncSchema.defaultProps = {
16088
16395
  var PersistAsyncSchema_default = PersistAsyncSchema;
16089
16396
 
16090
16397
  // src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
16091
- import { useState as useState20 } from "react";
16398
+ import { useState as useState21 } from "react";
16092
16399
 
16093
16400
  // src/legacy/jsonSchemaForm/promotedOneOfSchema/promoted-one-of-utils.ts
16094
16401
  var getSelectionFromModel = (schema, model) => {
@@ -16101,7 +16408,7 @@ var getSelectionFromModel = (schema, model) => {
16101
16408
 
16102
16409
  // src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
16103
16410
  import { Checkbox as Checkbox3 } from "@transferwise/components";
16104
- import { jsx as jsx93 } from "react/jsx-runtime";
16411
+ import { jsx as jsx94 } from "react/jsx-runtime";
16105
16412
  var PromotedOneOfCheckboxControl = (props) => {
16106
16413
  const { id, selection, setSelection } = props;
16107
16414
  const { promoted, other, checkedMeans } = props.promotion;
@@ -16112,14 +16419,14 @@ var PromotedOneOfCheckboxControl = (props) => {
16112
16419
  const toggleSelection = () => {
16113
16420
  setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
16114
16421
  };
16115
- return /* @__PURE__ */ jsx93("div", { className: "form-group", children: /* @__PURE__ */ jsx93(Checkbox3, { id, label: title, checked, onChange: toggleSelection }) });
16422
+ return /* @__PURE__ */ jsx94("div", { className: "form-group", children: /* @__PURE__ */ jsx94(Checkbox3, { id, label: title, checked, onChange: toggleSelection }) });
16116
16423
  };
16117
16424
  PromotedOneOfCheckboxControl.defaultProps = {};
16118
16425
  var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
16119
16426
 
16120
16427
  // src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
16121
16428
  import { RadioGroup as RadioGroup3 } from "@transferwise/components";
16122
- import { jsx as jsx94, jsxs as jsxs34 } from "react/jsx-runtime";
16429
+ import { jsx as jsx95, jsxs as jsxs34 } from "react/jsx-runtime";
16123
16430
  function PromotedOneOfRadioControl(props) {
16124
16431
  var _a, _b;
16125
16432
  const { id, selection, setSelection, promotion, promotedOneOf, title } = props;
@@ -16137,8 +16444,8 @@ function PromotedOneOfRadioControl(props) {
16137
16444
  }, getAvatarPropertyForRadioOption(promotion.other))
16138
16445
  ];
16139
16446
  return /* @__PURE__ */ jsxs34("div", { className: "form-group", children: [
16140
- title && /* @__PURE__ */ jsx94("label", { className: "control-label", htmlFor: id, children: title }),
16141
- /* @__PURE__ */ jsx94(
16447
+ title && /* @__PURE__ */ jsx95("label", { className: "control-label", htmlFor: id, children: title }),
16448
+ /* @__PURE__ */ jsx95(
16142
16449
  RadioGroup3,
16143
16450
  {
16144
16451
  name: "promoted-selection",
@@ -16156,16 +16463,16 @@ PromotedOneOfRadioControl.defaultProps = {
16156
16463
  var PromotedOneOfRadioControl_default = PromotedOneOfRadioControl;
16157
16464
 
16158
16465
  // src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.tsx
16159
- import { Fragment as Fragment16, jsx as jsx95 } from "react/jsx-runtime";
16466
+ import { Fragment as Fragment16, jsx as jsx96 } from "react/jsx-runtime";
16160
16467
  function PromotedOneOfControl(props) {
16161
16468
  const controlType = props.promotion.control || "radio";
16162
16469
  switch (controlType) {
16163
16470
  case "radio":
16164
- return /* @__PURE__ */ jsx95(PromotedOneOfRadioControl_default, __spreadValues({}, props));
16471
+ return /* @__PURE__ */ jsx96(PromotedOneOfRadioControl_default, __spreadValues({}, props));
16165
16472
  case "checkbox":
16166
- return /* @__PURE__ */ jsx95(PromotedOneOfCheckboxControl_default, __spreadValues({}, props));
16473
+ return /* @__PURE__ */ jsx96(PromotedOneOfCheckboxControl_default, __spreadValues({}, props));
16167
16474
  default:
16168
- return /* @__PURE__ */ jsx95(Fragment16, {});
16475
+ return /* @__PURE__ */ jsx96(Fragment16, {});
16169
16476
  }
16170
16477
  }
16171
16478
  PromotedOneOfControl.defaultProps = {
@@ -16175,11 +16482,11 @@ PromotedOneOfControl.defaultProps = {
16175
16482
  var PromotedOneOfControl_default = PromotedOneOfControl;
16176
16483
 
16177
16484
  // src/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.tsx
16178
- import { Fragment as Fragment17, jsx as jsx96, jsxs as jsxs35 } from "react/jsx-runtime";
16485
+ import { Fragment as Fragment17, jsx as jsx97, jsxs as jsxs35 } from "react/jsx-runtime";
16179
16486
  var isPromoted = (schema) => schema.promoted === true;
16180
16487
  var PromotedOneOfSchema = (props) => {
16181
16488
  var _a;
16182
- const [selection, setSelection] = useState20(
16489
+ const [selection, setSelection] = useState21(
16183
16490
  getSelectionFromModel(props.schema, props.model) || ((_a = props.schema.promotion) == null ? void 0 : _a.default) || "promoted"
16184
16491
  );
16185
16492
  const promotedAlert = props.schema.alert;
@@ -16187,8 +16494,8 @@ var PromotedOneOfSchema = (props) => {
16187
16494
  const promotedObjectSchema = getPromotedObjectSchema(promotedOneOf);
16188
16495
  const otherOneOf = getOtherOneOf(props.schema);
16189
16496
  return /* @__PURE__ */ jsxs35(Fragment17, { children: [
16190
- promotedAlert && /* @__PURE__ */ jsx96(DynamicAlert_default, { component: promotedAlert }),
16191
- /* @__PURE__ */ jsx96(
16497
+ promotedAlert && /* @__PURE__ */ jsx97(DynamicAlert_default, { component: promotedAlert }),
16498
+ /* @__PURE__ */ jsx97(
16192
16499
  PromotedOneOfControl_default,
16193
16500
  {
16194
16501
  id: props.schema.$id,
@@ -16199,8 +16506,8 @@ var PromotedOneOfSchema = (props) => {
16199
16506
  setSelection
16200
16507
  }
16201
16508
  ),
16202
- selection === "promoted" && /* @__PURE__ */ jsx96(ObjectSchema_default, __spreadProps(__spreadValues({}, props), { schema: promotedObjectSchema })),
16203
- selection === "other" && /* @__PURE__ */ jsx96(GenericSchema_default, __spreadProps(__spreadValues({}, props), { schema: otherOneOf }))
16509
+ selection === "promoted" && /* @__PURE__ */ jsx97(ObjectSchema_default, __spreadProps(__spreadValues({}, props), { schema: promotedObjectSchema })),
16510
+ selection === "other" && /* @__PURE__ */ jsx97(GenericSchema_default, __spreadProps(__spreadValues({}, props), { schema: otherOneOf }))
16204
16511
  ] });
16205
16512
  };
16206
16513
  function getPromotedObjectSchema(promotedSchema) {
@@ -16231,7 +16538,7 @@ var PromotedOneOfSchema_default = PromotedOneOfSchema;
16231
16538
 
16232
16539
  // src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
16233
16540
  import { DefinitionList as DefinitionList2, Layout } from "@transferwise/components";
16234
- import { useIntl as useIntl15 } from "react-intl";
16541
+ import { useIntl as useIntl16 } from "react-intl";
16235
16542
 
16236
16543
  // src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.ts
16237
16544
  import { defineMessages as defineMessages12 } from "react-intl";
@@ -16249,12 +16556,12 @@ var ReadOnlySchema_messages_default = defineMessages12({
16249
16556
  });
16250
16557
 
16251
16558
  // src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
16252
- import { Fragment as Fragment18, jsx as jsx97, jsxs as jsxs36 } from "react/jsx-runtime";
16559
+ import { Fragment as Fragment18, jsx as jsx98, jsxs as jsxs36 } from "react/jsx-runtime";
16253
16560
  function ReadOnlySchema({ schema, model }) {
16254
16561
  const { title = "" } = schema;
16255
- const { formatMessage } = useIntl15();
16562
+ const { formatMessage } = useIntl16();
16256
16563
  const value = getValueForSchema({ schema, model, formatMessage });
16257
- return /* @__PURE__ */ jsx97(DefinitionList2, { layout: Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
16564
+ return /* @__PURE__ */ jsx98(DefinitionList2, { layout: Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
16258
16565
  }
16259
16566
  var ReadOnlySchema_default = ReadOnlySchema;
16260
16567
  function getValueForSchema({
@@ -16295,18 +16602,18 @@ function getValueFromOption(option) {
16295
16602
  }
16296
16603
 
16297
16604
  // src/legacy/jsonSchemaForm/validationAsyncSchema/ValidationAsyncSchema.tsx
16298
- import { useEffect as useEffect14, useRef as useRef3, useState as useState21 } from "react";
16299
- import { jsx as jsx98 } from "react/jsx-runtime";
16605
+ import { useEffect as useEffect14, useRef as useRef3, useState as useState22 } from "react";
16606
+ import { jsx as jsx99 } from "react/jsx-runtime";
16300
16607
  function ValidationAsyncSchema(props) {
16301
16608
  const { schema, model, required, submitted, errors, onChange } = props;
16302
- const [validationAsyncModel, setValidationAsyncModel] = useState21(model);
16609
+ const [validationAsyncModel, setValidationAsyncModel] = useState22(model);
16303
16610
  const previousRequestedModelReference = useRef3(null);
16304
- const [validationAsyncSuccessMessage, setValidationAsyncSuccessMessage] = useState21(
16611
+ const [validationAsyncSuccessMessage, setValidationAsyncSuccessMessage] = useState22(
16305
16612
  null
16306
16613
  );
16307
- const [validationAsyncErrors, setValidationAsyncErrors] = useState21(null);
16308
- const [fieldSubmitted, setFieldSubmitted] = useState21(false);
16309
- const [abortController, setAbortController] = useState21(null);
16614
+ const [validationAsyncErrors, setValidationAsyncErrors] = useState22(null);
16615
+ const [fieldSubmitted, setFieldSubmitted] = useState22(false);
16616
+ const [abortController, setAbortController] = useState22(null);
16310
16617
  const httpClient = useHttpClient();
16311
16618
  const onEvent = useEventDispatcher();
16312
16619
  const log = useLogger();
@@ -16380,13 +16687,13 @@ function ValidationAsyncSchema(props) {
16380
16687
  required,
16381
16688
  schema
16382
16689
  };
16383
- return /* @__PURE__ */ jsx98(BasicTypeSchema_default, __spreadValues({}, basicTypeSchemaProps));
16690
+ return /* @__PURE__ */ jsx99(BasicTypeSchema_default, __spreadValues({}, basicTypeSchemaProps));
16384
16691
  }
16385
16692
  ValidationAsyncSchema.defaultProps = { required: false };
16386
16693
  var ValidationAsyncSchema_default = ValidationAsyncSchema;
16387
16694
 
16388
16695
  // src/legacy/jsonSchemaForm/genericSchema/GenericSchema.tsx
16389
- import { Fragment as Fragment19, jsx as jsx99 } from "react/jsx-runtime";
16696
+ import { Fragment as Fragment19, jsx as jsx100 } from "react/jsx-runtime";
16390
16697
  import { createElement } from "react";
16391
16698
  function GenericSchemaForm(props) {
16392
16699
  const { schema, model = null, errors = null, hideTitle = false, disabled = false } = props;
@@ -16403,29 +16710,29 @@ function GenericSchemaForm(props) {
16403
16710
  }, [JSON.stringify(schema), JSON.stringify(model), JSON.stringify(errors), type, log]);
16404
16711
  switch (type) {
16405
16712
  case "readOnly":
16406
- return /* @__PURE__ */ jsx99(ReadOnlySchema_default, __spreadValues({}, schemaProps));
16713
+ return /* @__PURE__ */ jsx100(ReadOnlySchema_default, __spreadValues({}, schemaProps));
16407
16714
  case "persistAsync":
16408
- return /* @__PURE__ */ jsx99(PersistAsyncSchema_default, __spreadValues({}, schemaProps));
16715
+ return /* @__PURE__ */ jsx100(PersistAsyncSchema_default, __spreadValues({}, schemaProps));
16409
16716
  case "validationAsync":
16410
- return /* @__PURE__ */ jsx99(ValidationAsyncSchema_default, __spreadValues({}, schemaProps));
16717
+ return /* @__PURE__ */ jsx100(ValidationAsyncSchema_default, __spreadValues({}, schemaProps));
16411
16718
  case "basic": {
16412
16719
  const basicTypeProps = __spreadValues({
16413
16720
  infoMessage: null
16414
16721
  }, schemaProps);
16415
- return /* @__PURE__ */ jsx99(BasicTypeSchema_default, __spreadValues({}, basicTypeProps));
16722
+ return /* @__PURE__ */ jsx100(BasicTypeSchema_default, __spreadValues({}, basicTypeProps));
16416
16723
  }
16417
16724
  case "object":
16418
16725
  return /* @__PURE__ */ createElement(ObjectSchema_default, __spreadProps(__spreadValues({}, schemaProps), { key: JSON.stringify(schema) }));
16419
16726
  case "array":
16420
- return /* @__PURE__ */ jsx99(ArraySchema_default, __spreadValues({}, schemaProps));
16727
+ return /* @__PURE__ */ jsx100(ArraySchema_default, __spreadValues({}, schemaProps));
16421
16728
  case "promotedOneOf":
16422
- return /* @__PURE__ */ jsx99(PromotedOneOfSchema_default, __spreadValues({}, schemaProps));
16729
+ return /* @__PURE__ */ jsx100(PromotedOneOfSchema_default, __spreadValues({}, schemaProps));
16423
16730
  case "oneOf":
16424
- return /* @__PURE__ */ jsx99(OneOfSchema_default, __spreadValues({}, schemaProps));
16731
+ return /* @__PURE__ */ jsx100(OneOfSchema_default, __spreadValues({}, schemaProps));
16425
16732
  case "allOf":
16426
- return /* @__PURE__ */ jsx99(AllOfSchema_default, __spreadValues({}, schemaProps));
16733
+ return /* @__PURE__ */ jsx100(AllOfSchema_default, __spreadValues({}, schemaProps));
16427
16734
  }
16428
- return /* @__PURE__ */ jsx99(Fragment19, {});
16735
+ return /* @__PURE__ */ jsx100(Fragment19, {});
16429
16736
  }
16430
16737
  var GenericSchema_default = GenericSchemaForm;
16431
16738
  var isValidGenericSchema = (schema, model, errors) => {
@@ -16452,7 +16759,7 @@ var isValidGenericSchema = (schema, model, errors) => {
16452
16759
  };
16453
16760
 
16454
16761
  // src/legacy/layout/form/DynamicForm.tsx
16455
- import { jsx as jsx100 } from "react/jsx-runtime";
16762
+ import { jsx as jsx101 } from "react/jsx-runtime";
16456
16763
  function DynamicForm({
16457
16764
  component,
16458
16765
  model = null,
@@ -16462,7 +16769,7 @@ function DynamicForm({
16462
16769
  onPersistAsync
16463
16770
  }) {
16464
16771
  const formSchema = component.schema;
16465
- return /* @__PURE__ */ jsx100("div", { className: getMargin2(component.margin || "md"), children: /* @__PURE__ */ jsx100(
16772
+ return /* @__PURE__ */ jsx101("div", { className: getMargin2(component.margin || "md"), children: /* @__PURE__ */ jsx101(
16466
16773
  GenericSchema_default,
16467
16774
  {
16468
16775
  schema: formSchema,
@@ -16481,61 +16788,61 @@ var DynamicForm_default = DynamicForm;
16481
16788
  // src/legacy/layout/heading/DynamicHeading.tsx
16482
16789
  var import_classnames14 = __toESM(require_classnames());
16483
16790
  import { Display as Display2 } from "@transferwise/components";
16484
- import { jsx as jsx101 } from "react/jsx-runtime";
16791
+ import { jsx as jsx102 } from "react/jsx-runtime";
16485
16792
  var DynamicHeading = (props) => {
16486
16793
  const { text, size = "md", align = "left", margin = "md", control } = props.component;
16487
16794
  const classes = (0, import_classnames14.default)(getTextAlignmentAndMargin2({ align, margin }));
16488
- return control === "display" ? /* @__PURE__ */ jsx101(DisplayHeading2, { size, text, classes }) : /* @__PURE__ */ jsx101(StandardHeading2, { size, text, classes });
16795
+ return control === "display" ? /* @__PURE__ */ jsx102(DisplayHeading2, { size, text, classes }) : /* @__PURE__ */ jsx102(StandardHeading2, { size, text, classes });
16489
16796
  };
16490
16797
  var StandardHeading2 = ({ size, text, classes }) => {
16491
16798
  switch (size) {
16492
16799
  case "xs":
16493
- return /* @__PURE__ */ jsx101("h5", { className: classes, children: text });
16800
+ return /* @__PURE__ */ jsx102("h5", { className: classes, children: text });
16494
16801
  case "sm":
16495
- return /* @__PURE__ */ jsx101("h4", { className: classes, children: text });
16802
+ return /* @__PURE__ */ jsx102("h4", { className: classes, children: text });
16496
16803
  case "lg":
16497
- return /* @__PURE__ */ jsx101("h2", { className: classes, children: text });
16804
+ return /* @__PURE__ */ jsx102("h2", { className: classes, children: text });
16498
16805
  case "xl":
16499
- return /* @__PURE__ */ jsx101("h1", { className: classes, children: text });
16806
+ return /* @__PURE__ */ jsx102("h1", { className: classes, children: text });
16500
16807
  case "md":
16501
16808
  default:
16502
- return /* @__PURE__ */ jsx101("h3", { className: classes, children: text });
16809
+ return /* @__PURE__ */ jsx102("h3", { className: classes, children: text });
16503
16810
  }
16504
16811
  };
16505
16812
  var DisplayHeading2 = ({ size, text, classes }) => {
16506
16813
  switch (size) {
16507
16814
  case "xs":
16508
16815
  case "sm":
16509
- return /* @__PURE__ */ jsx101(Display2, { type: "display-small", className: classes, children: text });
16816
+ return /* @__PURE__ */ jsx102(Display2, { type: "display-small", className: classes, children: text });
16510
16817
  case "xl":
16511
16818
  case "lg":
16512
- return /* @__PURE__ */ jsx101(Display2, { type: "display-large", className: classes, children: text });
16819
+ return /* @__PURE__ */ jsx102(Display2, { type: "display-large", className: classes, children: text });
16513
16820
  case "md":
16514
16821
  default:
16515
- return /* @__PURE__ */ jsx101(Display2, { type: "display-medium", className: classes, children: text });
16822
+ return /* @__PURE__ */ jsx102(Display2, { type: "display-medium", className: classes, children: text });
16516
16823
  }
16517
16824
  };
16518
16825
  var DynamicHeading_default = DynamicHeading;
16519
16826
 
16520
16827
  // src/legacy/layout/markdown/DynamicMarkdown.tsx
16521
16828
  import { Markdown as Markdown7 } from "@transferwise/components";
16522
- import { jsx as jsx102 } from "react/jsx-runtime";
16829
+ import { jsx as jsx103 } from "react/jsx-runtime";
16523
16830
  var DynamicMarkdown = ({ component }) => {
16524
16831
  const { content, align, margin } = component;
16525
- return /* @__PURE__ */ jsx102("div", { className: getTextAlignmentAndMargin2({ align, margin }), children: /* @__PURE__ */ jsx102(Markdown7, { config: { link: { target: "_blank" } }, children: content }) });
16832
+ return /* @__PURE__ */ jsx103("div", { className: getTextAlignmentAndMargin2({ align, margin }), children: /* @__PURE__ */ jsx103(Markdown7, { config: { link: { target: "_blank" } }, children: content }) });
16526
16833
  };
16527
16834
  var DynamicInfo = ({ component }) => {
16528
- return /* @__PURE__ */ jsx102("div", { className: getTextAlignmentAndMargin2(component), children: /* @__PURE__ */ jsx102(Markdown7, { config: { link: { target: "_blank" } }, children: component.markdown }) });
16835
+ return /* @__PURE__ */ jsx103("div", { className: getTextAlignmentAndMargin2(component), children: /* @__PURE__ */ jsx103(Markdown7, { config: { link: { target: "_blank" } }, children: component.markdown }) });
16529
16836
  };
16530
16837
 
16531
16838
  // src/legacy/layout/image/DynamicImage.tsx
16532
16839
  import { Image as Image2 } from "@transferwise/components";
16533
- import { useEffect as useEffect16, useState as useState22 } from "react";
16534
- import { jsx as jsx103 } from "react/jsx-runtime";
16840
+ import { useEffect as useEffect16, useState as useState23 } from "react";
16841
+ import { jsx as jsx104 } from "react/jsx-runtime";
16535
16842
  function DynamicImage({ component: image }) {
16536
16843
  const { url, size, text, margin, accessibilityDescription } = image;
16537
16844
  const httpClient = useHttpClient();
16538
- const [imageSource, setImageSource] = useState22("");
16845
+ const [imageSource, setImageSource] = useState23("");
16539
16846
  useEffect16(() => {
16540
16847
  void getImageSource2(httpClient, url).then(setImageSource);
16541
16848
  }, [url, httpClient]);
@@ -16548,7 +16855,7 @@ function DynamicImage({ component: image }) {
16548
16855
  if (!imageSource) {
16549
16856
  return null;
16550
16857
  }
16551
- return /* @__PURE__ */ jsx103("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ jsx103(Image2, __spreadValues({ className: `img-responsive ${getMargin2(margin || "md")}` }, imageProps)) });
16858
+ return /* @__PURE__ */ jsx104("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ jsx104(Image2, __spreadValues({ className: `img-responsive ${getMargin2(margin || "md")}` }, imageProps)) });
16552
16859
  }
16553
16860
  var readImageBlobAsDataURL2 = (imageBlob) => (
16554
16861
  // we can safely assume the type of reader.result is string
@@ -16585,7 +16892,7 @@ var DynamicImage_default = DynamicImage;
16585
16892
 
16586
16893
  // src/legacy/layout/instructions/DynamicInstructions.tsx
16587
16894
  import { Header as Header10, InstructionsList as InstructionsList2 } from "@transferwise/components";
16588
- import { jsx as jsx104, jsxs as jsxs37 } from "react/jsx-runtime";
16895
+ import { jsx as jsx105, jsxs as jsxs37 } from "react/jsx-runtime";
16589
16896
  var doContext2 = ["positive", "neutral"];
16590
16897
  var dontContext2 = ["warning", "negative"];
16591
16898
  var DynamicInstructions = ({ component }) => {
@@ -16593,39 +16900,39 @@ var DynamicInstructions = ({ component }) => {
16593
16900
  const dos = items.filter((item) => doContext2.includes(item.context)).map(({ text }) => text);
16594
16901
  const donts = items.filter((item) => dontContext2.includes(item.context)).map(({ text }) => text);
16595
16902
  return /* @__PURE__ */ jsxs37("div", { className: getMargin2(component.margin || "md"), children: [
16596
- component.title ? /* @__PURE__ */ jsx104(Header10, { title: component.title }) : null,
16597
- /* @__PURE__ */ jsx104(InstructionsList2, { dos, donts })
16903
+ component.title ? /* @__PURE__ */ jsx105(Header10, { title: component.title }) : null,
16904
+ /* @__PURE__ */ jsx105(InstructionsList2, { dos, donts })
16598
16905
  ] });
16599
16906
  };
16600
16907
  var DynamicInstructions_default = DynamicInstructions;
16601
16908
 
16602
16909
  // src/legacy/layout/DynamicLayout.tsx
16603
- import { Fragment as Fragment20, jsx as jsx105 } from "react/jsx-runtime";
16910
+ import { Fragment as Fragment20, jsx as jsx106 } from "react/jsx-runtime";
16604
16911
  var getKey = (component) => JSON.stringify(component);
16605
16912
  function DynamicLayout(props) {
16606
16913
  const { components, model, submitted, errors, onModelChange, onAction, onPersistAsync, baseUrl } = props;
16607
16914
  const renderComponent = (component) => {
16608
16915
  switch (component.type) {
16609
16916
  case "heading":
16610
- return /* @__PURE__ */ jsx105(DynamicHeading_default, { component }, getKey(component));
16917
+ return /* @__PURE__ */ jsx106(DynamicHeading_default, { component }, getKey(component));
16611
16918
  case "paragraph":
16612
- return /* @__PURE__ */ jsx105(DynamicParagraph_default, { component }, getKey(component));
16919
+ return /* @__PURE__ */ jsx106(DynamicParagraph_default, { component }, getKey(component));
16613
16920
  case "image":
16614
- return /* @__PURE__ */ jsx105(DynamicImage_default, { component }, getKey(component));
16921
+ return /* @__PURE__ */ jsx106(DynamicImage_default, { component }, getKey(component));
16615
16922
  case "alert":
16616
- return /* @__PURE__ */ jsx105(DynamicAlert_default, { component }, getKey(component));
16923
+ return /* @__PURE__ */ jsx106(DynamicAlert_default, { component }, getKey(component));
16617
16924
  case "review":
16618
- return /* @__PURE__ */ jsx105(DynamicReview_default, { component, onAction }, getKey(component));
16925
+ return /* @__PURE__ */ jsx106(DynamicReview_default, { component, onAction }, getKey(component));
16619
16926
  case "divider":
16620
- return /* @__PURE__ */ jsx105(DynamicDivider_default, { component }, getKey(component));
16927
+ return /* @__PURE__ */ jsx106(DynamicDivider_default, { component }, getKey(component));
16621
16928
  case "info":
16622
- return /* @__PURE__ */ jsx105(DynamicInfo, { component }, getKey(component));
16929
+ return /* @__PURE__ */ jsx106(DynamicInfo, { component }, getKey(component));
16623
16930
  case "instructions":
16624
- return /* @__PURE__ */ jsx105(DynamicInstructions_default, { component }, getKey(component));
16931
+ return /* @__PURE__ */ jsx106(DynamicInstructions_default, { component }, getKey(component));
16625
16932
  case "markdown":
16626
- return /* @__PURE__ */ jsx105(DynamicMarkdown, { component }, getKey(component));
16933
+ return /* @__PURE__ */ jsx106(DynamicMarkdown, { component }, getKey(component));
16627
16934
  case "columns":
16628
- return /* @__PURE__ */ jsx105(
16935
+ return /* @__PURE__ */ jsx106(
16629
16936
  DynamicColumns_default,
16630
16937
  {
16631
16938
  component,
@@ -16639,7 +16946,7 @@ function DynamicLayout(props) {
16639
16946
  getKey(component)
16640
16947
  );
16641
16948
  case "form":
16642
- return /* @__PURE__ */ jsx105(
16949
+ return /* @__PURE__ */ jsx106(
16643
16950
  DynamicForm_default,
16644
16951
  {
16645
16952
  component,
@@ -16652,9 +16959,9 @@ function DynamicLayout(props) {
16652
16959
  getKey(__spreadProps(__spreadValues({}, component), { errors: errors != null ? errors : null }))
16653
16960
  );
16654
16961
  case "button":
16655
- return /* @__PURE__ */ jsx105(DynamicButton_default, { component, onAction }, getKey(component));
16962
+ return /* @__PURE__ */ jsx106(DynamicButton_default, { component, onAction }, getKey(component));
16656
16963
  case "box":
16657
- return /* @__PURE__ */ jsx105(
16964
+ return /* @__PURE__ */ jsx106(
16658
16965
  DynamicBox_default,
16659
16966
  {
16660
16967
  component,
@@ -16668,18 +16975,18 @@ function DynamicLayout(props) {
16668
16975
  getKey(component)
16669
16976
  );
16670
16977
  case "decision":
16671
- return /* @__PURE__ */ jsx105(DynamicDecision_default, { component, onAction }, getKey(component));
16978
+ return /* @__PURE__ */ jsx106(DynamicDecision_default, { component, onAction }, getKey(component));
16672
16979
  case "external":
16673
- return /* @__PURE__ */ jsx105(DynamicExternal_default, { component, onAction }, getKey(component));
16980
+ return /* @__PURE__ */ jsx106(DynamicExternal_default, { component, onAction }, getKey(component));
16674
16981
  case "list":
16675
16982
  case "status-list":
16676
- return /* @__PURE__ */ jsx105(DynamicStatusList_default, { component, onAction }, getKey(component));
16983
+ return /* @__PURE__ */ jsx106(DynamicStatusList_default, { component, onAction }, getKey(component));
16677
16984
  case "loading-indicator":
16678
- return /* @__PURE__ */ jsx105(DynamicLoadingIndicator_default, { component }, getKey(component));
16985
+ return /* @__PURE__ */ jsx106(DynamicLoadingIndicator_default, { component }, getKey(component));
16679
16986
  case "search":
16680
- return /* @__PURE__ */ jsx105(DynamicSearch_default, { component, onAction }, getKey(component));
16987
+ return /* @__PURE__ */ jsx106(DynamicSearch_default, { component, onAction }, getKey(component));
16681
16988
  case "modal":
16682
- return /* @__PURE__ */ jsx105(
16989
+ return /* @__PURE__ */ jsx106(
16683
16990
  DynamicModal_default,
16684
16991
  {
16685
16992
  component,
@@ -16693,22 +17000,22 @@ function DynamicLayout(props) {
16693
17000
  getKey(component)
16694
17001
  );
16695
17002
  default:
16696
- return /* @__PURE__ */ jsx105("div", {}, getKey(component));
17003
+ return /* @__PURE__ */ jsx106("div", {}, getKey(component));
16697
17004
  }
16698
17005
  };
16699
17006
  if (useHasHttpClientProvider() || baseUrl == null) {
16700
- return /* @__PURE__ */ jsx105(Fragment20, { children: components.map(renderComponent) });
17007
+ return /* @__PURE__ */ jsx106(Fragment20, { children: components.map(renderComponent) });
16701
17008
  }
16702
- return /* @__PURE__ */ jsx105(HttpClientProviderFromBaseUrl, { baseUrl, children: components.map(renderComponent) });
17009
+ return /* @__PURE__ */ jsx106(HttpClientProviderFromBaseUrl, { baseUrl, children: components.map(renderComponent) });
16703
17010
  }
16704
17011
  var DynamicLayout_default = DynamicLayout;
16705
17012
 
16706
17013
  // src/legacy/layout/list/DynamicStatusList.tsx
16707
17014
  import { Header as Header11, Summary as Summary2 } from "@transferwise/components";
16708
- import { jsx as jsx106, jsxs as jsxs38 } from "react/jsx-runtime";
17015
+ import { jsx as jsx107, jsxs as jsxs38 } from "react/jsx-runtime";
16709
17016
  var DynamicStatusList = ({ component }) => {
16710
17017
  return /* @__PURE__ */ jsxs38("div", { className: getMargin2(component.margin || "md"), children: [
16711
- component.title ? /* @__PURE__ */ jsx106(Header11, { title: component.title }) : null,
17018
+ component.title ? /* @__PURE__ */ jsx107(Header11, { title: component.title }) : null,
16712
17019
  component.items.map(mapListItemToSummary)
16713
17020
  ] });
16714
17021
  };
@@ -16717,8 +17024,8 @@ var mapListItemToSummary = ({ title, description, icon, status }) => {
16717
17024
  key: `${title}/${description || ""}`,
16718
17025
  title,
16719
17026
  description
16720
- }, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ jsx106(DynamicIcon_default2, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
16721
- return /* @__PURE__ */ jsx106(Summary2, __spreadValues({}, props));
17027
+ }, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ jsx107(DynamicIcon_default2, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
17028
+ return /* @__PURE__ */ jsx107(Summary2, __spreadValues({}, props));
16722
17029
  };
16723
17030
  var statusListMap = {
16724
17031
  done: "done",
@@ -16735,10 +17042,10 @@ var DynamicStatusList_default = DynamicStatusList;
16735
17042
 
16736
17043
  // src/legacy/layout/loadingIndicator/DynamicLoadingIndicator.tsx
16737
17044
  import { Loader as Loader3 } from "@transferwise/components";
16738
- import { jsx as jsx107 } from "react/jsx-runtime";
17045
+ import { jsx as jsx108 } from "react/jsx-runtime";
16739
17046
  var DynamicLoadingIndicator = ({ component }) => {
16740
17047
  const { margin = "md", size = "md" } = component;
16741
- return /* @__PURE__ */ jsx107(
17048
+ return /* @__PURE__ */ jsx108(
16742
17049
  Loader3,
16743
17050
  {
16744
17051
  size,
@@ -16753,7 +17060,7 @@ var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
16753
17060
 
16754
17061
  // src/legacy/layout/paragraph/DynamicParagraph.tsx
16755
17062
  import { Button as Button8 } from "@transferwise/components";
16756
- import { useIntl as useIntl16 } from "react-intl";
17063
+ import { useIntl as useIntl17 } from "react-intl";
16757
17064
 
16758
17065
  // src/legacy/layout/paragraph/useSnackBarIfAvailable.ts
16759
17066
  import { SnackbarContext as SnackbarContext2 } from "@transferwise/components";
@@ -16766,9 +17073,9 @@ function noop3() {
16766
17073
  }
16767
17074
 
16768
17075
  // src/legacy/layout/paragraph/DynamicParagraph.tsx
16769
- import { jsx as jsx108, jsxs as jsxs39 } from "react/jsx-runtime";
17076
+ import { jsx as jsx109, jsxs as jsxs39 } from "react/jsx-runtime";
16770
17077
  function DynamicParagraph({ component }) {
16771
- return component.control === "copyable" ? /* @__PURE__ */ jsx108(CopyableDynamicParagraph, { component }) : /* @__PURE__ */ jsx108(BasicDynamicParagraph, { component });
17078
+ return component.control === "copyable" ? /* @__PURE__ */ jsx109(CopyableDynamicParagraph, { component }) : /* @__PURE__ */ jsx109(BasicDynamicParagraph, { component });
16772
17079
  }
16773
17080
  function BasicDynamicParagraph({ component }) {
16774
17081
  return /* @__PURE__ */ jsxs39("p", { className: getTextAlignmentAndMargin2(component), children: [
@@ -16778,7 +17085,7 @@ function BasicDynamicParagraph({ component }) {
16778
17085
  ] });
16779
17086
  }
16780
17087
  function CopyableDynamicParagraph({ component }) {
16781
- const { formatMessage } = useIntl16();
17088
+ const { formatMessage } = useIntl17();
16782
17089
  const createSnackbar = useSnackBarIfAvailable2();
16783
17090
  const { text } = component;
16784
17091
  const copy = () => {
@@ -16790,7 +17097,7 @@ function CopyableDynamicParagraph({ component }) {
16790
17097
  margin: "sm"
16791
17098
  })} form-control`;
16792
17099
  return /* @__PURE__ */ jsxs39("div", { className: getTextAlignmentAndMargin2(component), children: [
16793
- /* @__PURE__ */ jsx108(
17100
+ /* @__PURE__ */ jsx109(
16794
17101
  "input",
16795
17102
  {
16796
17103
  type: "text",
@@ -16800,7 +17107,7 @@ function CopyableDynamicParagraph({ component }) {
16800
17107
  style: { textOverflow: "ellipsis" }
16801
17108
  }
16802
17109
  ),
16803
- /* @__PURE__ */ jsx108(Button8, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
17110
+ /* @__PURE__ */ jsx109(Button8, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
16804
17111
  ] });
16805
17112
  }
16806
17113
  function noop4() {
@@ -16809,7 +17116,7 @@ var DynamicParagraph_default = DynamicParagraph;
16809
17116
 
16810
17117
  // src/legacy/layout/review/DynamicReview.tsx
16811
17118
  import { DefinitionList as DefinitionList3, Header as Header12 } from "@transferwise/components";
16812
- import { Fragment as Fragment21, jsx as jsx109, jsxs as jsxs40 } from "react/jsx-runtime";
17119
+ import { Fragment as Fragment21, jsx as jsx110, jsxs as jsxs40 } from "react/jsx-runtime";
16813
17120
  var getDefinitions = (orientation, review) => review.fields.map(({ label, value, help }, index) => ({
16814
17121
  key: String(index),
16815
17122
  title: label,
@@ -16818,20 +17125,32 @@ var getDefinitions = (orientation, review) => review.fields.map(({ label, value,
16818
17125
  var getFieldValue2 = (value, help, orientation) => {
16819
17126
  if (help) {
16820
17127
  return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs40(Fragment21, { children: [
16821
- /* @__PURE__ */ jsx109(Help_default2, { help }),
17128
+ /* @__PURE__ */ jsx110(Help_default2, { help }),
16822
17129
  " ",
16823
17130
  value
16824
17131
  ] }) : /* @__PURE__ */ jsxs40(Fragment21, { children: [
16825
17132
  value,
16826
17133
  " ",
16827
- /* @__PURE__ */ jsx109(Help_default2, { help })
17134
+ /* @__PURE__ */ jsx110(Help_default2, { help })
16828
17135
  ] });
16829
17136
  }
16830
17137
  return value;
16831
17138
  };
16832
- var getReviewLayout = (review) => {
17139
+ var getDefinitionListLayout = (review) => {
16833
17140
  const orientation = review.control || review.orientation;
16834
- return orientation === "horizontal" ? "HORIZONTAL_RIGHT_ALIGNED" : "VERTICAL_ONE_COLUMN";
17141
+ switch (orientation) {
17142
+ case "horizontal":
17143
+ case "horizontal-end-aligned":
17144
+ return "HORIZONTAL_RIGHT_ALIGNED";
17145
+ case "horizontal-start-aligned":
17146
+ return "HORIZONTAL_LEFT_ALIGNED";
17147
+ case "vertical-two-column":
17148
+ return "VERTICAL_TWO_COLUMN";
17149
+ case "vertical":
17150
+ case "vertical-one-column":
17151
+ default:
17152
+ return "VERTICAL_ONE_COLUMN";
17153
+ }
16835
17154
  };
16836
17155
  function DynamicReview(props) {
16837
17156
  const review = props.component;
@@ -16846,27 +17165,27 @@ function DynamicReview(props) {
16846
17165
  }
16847
17166
  }
16848
17167
  });
16849
- const orientation = getReviewLayout(review);
17168
+ const orientation = getDefinitionListLayout(review);
16850
17169
  const callToAction = review.callToAction ? getReviewAction2(review.callToAction.title, review.callToAction.action) : null;
16851
17170
  const legacyCallToAction = !callToAction && review.action ? getReviewAction2(review.action.title || "", review.action) : null;
16852
17171
  return /* @__PURE__ */ jsxs40("div", { className: margin, children: [
16853
- review.title && /* @__PURE__ */ jsx109(Header12, { title: review.title, action: callToAction || legacyCallToAction || void 0 }),
16854
- /* @__PURE__ */ jsx109("div", { className: margin, children: /* @__PURE__ */ jsx109(DefinitionList3, { layout: orientation, definitions: getDefinitions(orientation, review) }) })
17172
+ review.title && /* @__PURE__ */ jsx110(Header12, { title: review.title, action: callToAction || legacyCallToAction || void 0 }),
17173
+ /* @__PURE__ */ jsx110("div", { className: margin, children: /* @__PURE__ */ jsx110(DefinitionList3, { layout: orientation, definitions: getDefinitions(orientation, review) }) })
16855
17174
  ] });
16856
17175
  }
16857
17176
  var DynamicReview_default = DynamicReview;
16858
17177
 
16859
17178
  // src/legacy/layout/search/DynamicSearch.tsx
16860
- import { useMemo as useMemo16, useState as useState24 } from "react";
17179
+ import { useMemo as useMemo16, useState as useState25 } from "react";
16861
17180
  import { Search as Search2 } from "@transferwise/icons";
16862
17181
 
16863
17182
  // src/legacy/layout/search/SearchInput.tsx
16864
17183
  import { Input as Input7 } from "@transferwise/components";
16865
- import { jsx as jsx110, jsxs as jsxs41 } from "react/jsx-runtime";
17184
+ import { jsx as jsx111, jsxs as jsxs41 } from "react/jsx-runtime";
16866
17185
  var SearchInput = ({ title, value, onFocus, onChange }) => {
16867
17186
  return /* @__PURE__ */ jsxs41("label", { className: "control-label d-inline", children: [
16868
17187
  title,
16869
- /* @__PURE__ */ jsx110(
17188
+ /* @__PURE__ */ jsx111(
16870
17189
  Input7,
16871
17190
  {
16872
17191
  type: "text",
@@ -16881,13 +17200,13 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
16881
17200
 
16882
17201
  // src/legacy/layout/search/SearchResults.tsx
16883
17202
  import { NavigationOption as NavigationOption7, NavigationOptionsList as NavigationOptionsList4 } from "@transferwise/components";
16884
- import { useIntl as useIntl17 } from "react-intl";
16885
- import { jsx as jsx111, jsxs as jsxs42 } from "react/jsx-runtime";
17203
+ import { useIntl as useIntl18 } from "react-intl";
17204
+ import { jsx as jsx112, jsxs as jsxs42 } from "react/jsx-runtime";
16886
17205
  function SearchResults2({ results, emptyMessage, onSelect }) {
16887
17206
  if (results.length === 0) {
16888
- return /* @__PURE__ */ jsx111("p", { className: "m-t-2", children: emptyMessage });
17207
+ return /* @__PURE__ */ jsx112("p", { className: "m-t-2", children: emptyMessage });
16889
17208
  }
16890
- return /* @__PURE__ */ jsx111(NavigationOptionsList4, { children: results.map((result) => /* @__PURE__ */ jsx111(
17209
+ return /* @__PURE__ */ jsx112(NavigationOptionsList4, { children: results.map((result) => /* @__PURE__ */ jsx112(
16891
17210
  NavigationOption7,
16892
17211
  {
16893
17212
  title: result.title,
@@ -16901,11 +17220,11 @@ function SearchResults2({ results, emptyMessage, onSelect }) {
16901
17220
  )) });
16902
17221
  }
16903
17222
  function ErrorResult2({ onRetrySearch }) {
16904
- const intl = useIntl17();
17223
+ const intl = useIntl18();
16905
17224
  return /* @__PURE__ */ jsxs42("p", { className: "m-t-2", children: [
16906
17225
  intl.formatMessage(generic_error_messages_default.genericError),
16907
17226
  "\xA0",
16908
- /* @__PURE__ */ jsx111(
17227
+ /* @__PURE__ */ jsx112(
16909
17228
  "a",
16910
17229
  {
16911
17230
  href: "/",
@@ -16920,10 +17239,10 @@ function ErrorResult2({ onRetrySearch }) {
16920
17239
  }
16921
17240
 
16922
17241
  // src/legacy/layout/search/useSearch.tsx
16923
- import { useCallback as useCallback7, useRef as useRef4, useState as useState23 } from "react";
17242
+ import { useCallback as useCallback7, useRef as useRef4, useState as useState24 } from "react";
16924
17243
  var headers = { "Content-Type": "application/json" };
16925
17244
  var useSearch = (defaultSearchConfig) => {
16926
- const [state, setState] = useState23({
17245
+ const [state, setState] = useState24({
16927
17246
  status: "idle"
16928
17247
  });
16929
17248
  const abortControllerRef = useRef4(null);
@@ -16991,10 +17310,10 @@ var addQueryParameter2 = (url, key, value) => {
16991
17310
  // src/legacy/layout/search/DynamicSearch.tsx
16992
17311
  var import_classnames15 = __toESM(require_classnames());
16993
17312
  import { Markdown as Markdown8, Typeahead as Typeahead2 } from "@transferwise/components";
16994
- import { jsx as jsx112, jsxs as jsxs43 } from "react/jsx-runtime";
17313
+ import { jsx as jsx113, jsxs as jsxs43 } from "react/jsx-runtime";
16995
17314
  var DEBOUNCE_TIME2 = 400;
16996
17315
  function DynamicSearch({ component, onAction }) {
16997
- const [query, setQuery] = useState24("");
17316
+ const [query, setQuery] = useState25("");
16998
17317
  const { control, title, margin, url, method, param, emptyMessage } = component;
16999
17318
  const { status, results, search } = useSearch({ url, method, param });
17000
17319
  const onEvent = useEventDispatcher();
@@ -17027,16 +17346,16 @@ function DynamicSearch({ component, onAction }) {
17027
17346
  void search(query);
17028
17347
  };
17029
17348
  if (control === "inline") {
17030
- return /* @__PURE__ */ jsx112("div", { className: (0, import_classnames15.default)(getMargin2(margin != null ? margin : "md"), "df-search-typeahead"), children: /* @__PURE__ */ jsxs43("label", { className: "control-label d-inline", children: [
17349
+ return /* @__PURE__ */ jsx113("div", { className: (0, import_classnames15.default)(getMargin2(margin != null ? margin : "md"), "df-search-typeahead"), children: /* @__PURE__ */ jsxs43("label", { className: "control-label d-inline", children: [
17031
17350
  title,
17032
- /* @__PURE__ */ jsx112("div", { className: "m-t-1", children: /* @__PURE__ */ jsx112(
17351
+ /* @__PURE__ */ jsx113("div", { className: "m-t-1", children: /* @__PURE__ */ jsx113(
17033
17352
  Typeahead2,
17034
17353
  {
17035
17354
  id: "typeahead-input-id",
17036
17355
  name: "typeahead-input-name",
17037
17356
  size: "md",
17038
17357
  maxHeight: 100,
17039
- footer: /* @__PURE__ */ jsx112(
17358
+ footer: /* @__PURE__ */ jsx113(
17040
17359
  TypeaheadFooter2,
17041
17360
  {
17042
17361
  state: status,
@@ -17047,7 +17366,7 @@ function DynamicSearch({ component, onAction }) {
17047
17366
  ),
17048
17367
  multiple: false,
17049
17368
  clearable: false,
17050
- addon: /* @__PURE__ */ jsx112(Search2, { size: 24 }),
17369
+ addon: /* @__PURE__ */ jsx113(Search2, { size: 24 }),
17051
17370
  options: results.map(mapResultToTypeaheadOption2),
17052
17371
  onChange: (values) => {
17053
17372
  if (values.length > 0) {
@@ -17063,10 +17382,10 @@ function DynamicSearch({ component, onAction }) {
17063
17382
  ] }) });
17064
17383
  }
17065
17384
  return /* @__PURE__ */ jsxs43("div", { className: getMargin2(margin != null ? margin : "md"), children: [
17066
- /* @__PURE__ */ jsx112(SearchInput, { title, value: query, onChange, onFocus: onSearchStart }),
17067
- status === "loading" && /* @__PURE__ */ jsx112(DynamicLoadingIndicator_default, { component: { type: "loading-indicator", size: "sm" } }),
17068
- status === "error" && /* @__PURE__ */ jsx112(ErrorResult2, { onRetrySearch }),
17069
- status === "success" && /* @__PURE__ */ jsx112(SearchResults2, { results, emptyMessage, onSelect: onResultSelected })
17385
+ /* @__PURE__ */ jsx113(SearchInput, { title, value: query, onChange, onFocus: onSearchStart }),
17386
+ status === "loading" && /* @__PURE__ */ jsx113(DynamicLoadingIndicator_default, { component: { type: "loading-indicator", size: "sm" } }),
17387
+ status === "error" && /* @__PURE__ */ jsx113(ErrorResult2, { onRetrySearch }),
17388
+ status === "success" && /* @__PURE__ */ jsx113(SearchResults2, { results, emptyMessage, onSelect: onResultSelected })
17070
17389
  ] });
17071
17390
  }
17072
17391
  function mapResultToTypeaheadOption2(result) {
@@ -17085,13 +17404,13 @@ function TypeaheadFooter2({
17085
17404
  emptyMessage
17086
17405
  }) {
17087
17406
  if (state === "success" && results.length === 0) {
17088
- return /* @__PURE__ */ jsx112(Markdown8, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: emptyMessage });
17407
+ return /* @__PURE__ */ jsx113(Markdown8, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: emptyMessage });
17089
17408
  }
17090
17409
  if (state === "error" && results.length === 0) {
17091
- return /* @__PURE__ */ jsx112("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx112(ErrorResult2, { onRetrySearch }) });
17410
+ return /* @__PURE__ */ jsx113("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx113(ErrorResult2, { onRetrySearch }) });
17092
17411
  }
17093
17412
  if (state === "loading" || results.length === 0) {
17094
- return /* @__PURE__ */ jsx112("p", { className: "m-t-2 m-x-2", children: "Loading..." });
17413
+ return /* @__PURE__ */ jsx113("p", { className: "m-t-2 m-x-2", children: "Loading..." });
17095
17414
  }
17096
17415
  return null;
17097
17416
  }
@@ -17099,21 +17418,21 @@ var DynamicSearch_default = DynamicSearch;
17099
17418
 
17100
17419
  // src/legacy/layout/modal/DynamicModal.tsx
17101
17420
  import { Button as Button9, Modal as Modal4 } from "@transferwise/components";
17102
- import { useState as useState25 } from "react";
17103
- import { jsx as jsx113, jsxs as jsxs44 } from "react/jsx-runtime";
17421
+ import { useState as useState26 } from "react";
17422
+ import { jsx as jsx114, jsxs as jsxs44 } from "react/jsx-runtime";
17104
17423
  function DynamicModal(props) {
17105
- const [visible, isVisible] = useState25(false);
17424
+ const [visible, isVisible] = useState26(false);
17106
17425
  const { component, onAction } = props;
17107
17426
  const { margin = "md" } = component;
17108
17427
  return /* @__PURE__ */ jsxs44("div", { className: getTextAlignmentAndMargin2({ margin }), children: [
17109
- /* @__PURE__ */ jsx113(Button9, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
17110
- /* @__PURE__ */ jsx113(
17428
+ /* @__PURE__ */ jsx114(Button9, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
17429
+ /* @__PURE__ */ jsx114(
17111
17430
  Modal4,
17112
17431
  {
17113
17432
  scroll: "content",
17114
17433
  open: visible,
17115
17434
  size: "lg",
17116
- body: /* @__PURE__ */ jsx113(
17435
+ body: /* @__PURE__ */ jsx114(
17117
17436
  DynamicLayout_default,
17118
17437
  __spreadProps(__spreadValues({}, props), {
17119
17438
  components: component.content.components,
@@ -17131,7 +17450,7 @@ function DynamicModal(props) {
17131
17450
  var DynamicModal_default = DynamicModal;
17132
17451
 
17133
17452
  // src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
17134
- import { Fragment as Fragment22, jsx as jsx114, jsxs as jsxs45 } from "react/jsx-runtime";
17453
+ import { Fragment as Fragment22, jsx as jsx115, jsxs as jsxs45 } from "react/jsx-runtime";
17135
17454
  var isNullish3 = (value) => isNull3(value) || isUndefined3(value);
17136
17455
  var getDefaultValue = (schema) => {
17137
17456
  return schema.type === "boolean" && isNullish3(schema.default) ? false : schema.default;
@@ -17169,12 +17488,12 @@ var BasicTypeSchema = (props) => {
17169
17488
  props.onBlur();
17170
17489
  }
17171
17490
  };
17172
- const [model, setModel] = useState26((_a = props.model) != null ? _a : null);
17173
- const [lastModel, setLastModel] = useState26((_b = props.model) != null ? _b : null);
17174
- const [changed, setChanged] = useState26(false);
17175
- const [focused, setFocused] = useState26(false);
17176
- const [blurred, setBlurred] = useState26(false);
17177
- const [validations, setValidations] = useState26([]);
17491
+ const [model, setModel] = useState27((_a = props.model) != null ? _a : null);
17492
+ const [lastModel, setLastModel] = useState27((_b = props.model) != null ? _b : null);
17493
+ const [changed, setChanged] = useState27(false);
17494
+ const [focused, setFocused] = useState27(false);
17495
+ const [blurred, setBlurred] = useState27(false);
17496
+ const [validations, setValidations] = useState27([]);
17178
17497
  const id = useMemo17(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
17179
17498
  const onSchemaChange = () => {
17180
17499
  const defaultValue = getDefaultValue(props.schema);
@@ -17208,14 +17527,14 @@ var BasicTypeSchema = (props) => {
17208
17527
  const schemaHelp = props.schema.help;
17209
17528
  const feedbackId = `${id}-feedback`;
17210
17529
  return !isHidden ? /* @__PURE__ */ jsxs45(Fragment22, { children: [
17211
- props.schema.alert && /* @__PURE__ */ jsx114(DynamicAlert_default, { component: props.schema.alert }),
17530
+ props.schema.alert && /* @__PURE__ */ jsx115(DynamicAlert_default, { component: props.schema.alert }),
17212
17531
  /* @__PURE__ */ jsxs45("div", { className: (0, import_classnames16.default)(formGroupClasses), children: [
17213
17532
  showLabel && /* @__PURE__ */ jsxs45("div", { className: "d-inline-block m-b-1", children: [
17214
- /* @__PURE__ */ jsx114("label", { className: "control-label d-inline", htmlFor: id, children: props.schema.title }),
17215
- !!schemaHelp && /* @__PURE__ */ jsx114(Help_default2, { help: schemaHelp })
17533
+ /* @__PURE__ */ jsx115("label", { className: "control-label d-inline", htmlFor: id, children: props.schema.title }),
17534
+ !!schemaHelp && /* @__PURE__ */ jsx115(Help_default2, { help: schemaHelp })
17216
17535
  ] }),
17217
- !showLabel && !!schemaHelp && /* @__PURE__ */ jsx114(Help_default2, { help: schemaHelp }),
17218
- /* @__PURE__ */ jsx114(
17536
+ !showLabel && !!schemaHelp && /* @__PURE__ */ jsx115(Help_default2, { help: schemaHelp }),
17537
+ /* @__PURE__ */ jsx115(
17219
17538
  SchemaFormControl_default,
17220
17539
  {
17221
17540
  id,
@@ -17228,7 +17547,7 @@ var BasicTypeSchema = (props) => {
17228
17547
  describedBy: feedbackId
17229
17548
  }
17230
17549
  ),
17231
- /* @__PURE__ */ jsx114(
17550
+ /* @__PURE__ */ jsx115(
17232
17551
  ControlFeedback_default,
17233
17552
  {
17234
17553
  id: feedbackId,
@@ -17253,7 +17572,7 @@ BasicTypeSchema.defaultProps = {
17253
17572
  var BasicTypeSchema_default = BasicTypeSchema;
17254
17573
 
17255
17574
  // src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
17256
- import { jsx as jsx115 } from "react/jsx-runtime";
17575
+ import { jsx as jsx116 } from "react/jsx-runtime";
17257
17576
  var getIdFromResponse = (idProperty, response) => response[idProperty];
17258
17577
  var getErrorFromResponse = (errorProperty, response) => {
17259
17578
  var _a;
@@ -17268,14 +17587,14 @@ var controlTypesWithPersistOnChange = /* @__PURE__ */ new Set([
17268
17587
  ]);
17269
17588
  function PersistAsyncBasicSchema(props) {
17270
17589
  const { schema, required, submitted, errors, onChange, onPersistAsync } = props;
17271
- const intl = useIntl18();
17590
+ const intl = useIntl19();
17272
17591
  const httpClient = useHttpClient();
17273
17592
  const onEvent = useEventDispatcher();
17274
- const [persistAsyncModel, setPersistAsyncModel] = useState27(null);
17593
+ const [persistAsyncModel, setPersistAsyncModel] = useState28(null);
17275
17594
  const previousPersistAsyncModel = usePrevious(persistAsyncModel);
17276
- const [persistAsyncError, setPersistAsyncError] = useState27(null);
17277
- const [fieldSubmitted, setFieldSubmitted] = useState27(false);
17278
- const [abortController, setAbortController] = useState27(null);
17595
+ const [persistAsyncError, setPersistAsyncError] = useState28(null);
17596
+ const [fieldSubmitted, setFieldSubmitted] = useState28(false);
17597
+ const [abortController, setAbortController] = useState28(null);
17279
17598
  useEffect18(() => {
17280
17599
  if (controlTypesWithPersistOnChange.has(
17281
17600
  // TODO: LOW avoid type assertion below -- control type may be nullish. consider ?? ''
@@ -17343,7 +17662,7 @@ function PersistAsyncBasicSchema(props) {
17343
17662
  setPersistAsyncModel(newPersistAsyncModel);
17344
17663
  }
17345
17664
  };
17346
- return /* @__PURE__ */ jsx115(
17665
+ return /* @__PURE__ */ jsx116(
17347
17666
  BasicTypeSchema_default,
17348
17667
  {
17349
17668
  required,
@@ -17364,9 +17683,9 @@ var PersistAsyncBasicSchema_default = PersistAsyncBasicSchema;
17364
17683
 
17365
17684
  // src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts
17366
17685
  var usePersistAsync = (persistAsync) => {
17367
- const [abortController, setAbortController] = useState28(null);
17686
+ const [abortController, setAbortController] = useState29(null);
17368
17687
  const httpClient = useHttpClient();
17369
- const intl = useIntl19();
17688
+ const intl = useIntl20();
17370
17689
  const { schema } = persistAsync;
17371
17690
  async function handlePersistAsync(model) {
17372
17691
  const isInvalidSchema = model instanceof Blob ? !isBlobSchema2(schema) : !isValidSchema(model, schema);
@@ -17554,7 +17873,7 @@ function useStepPolling(polling, onAction) {
17554
17873
  }
17555
17874
 
17556
17875
  // src/legacy/step/layoutStep/LayoutStep.tsx
17557
- import { jsx as jsx116 } from "react/jsx-runtime";
17876
+ import { jsx as jsx117 } from "react/jsx-runtime";
17558
17877
  var getComponents = (step, options) => {
17559
17878
  var _a;
17560
17879
  if (isEmpty(step)) {
@@ -17577,7 +17896,7 @@ var LayoutStep = (props) => {
17577
17896
  onEvent("Dynamic Flow - onAction supressed", { reason: "LayoutStep - loading state" });
17578
17897
  };
17579
17898
  useStepPolling(stepSpecification.polling, onAction);
17580
- return /* @__PURE__ */ jsx116(
17899
+ return /* @__PURE__ */ jsx117(
17581
17900
  DynamicLayout_default,
17582
17901
  {
17583
17902
  components,
@@ -17593,11 +17912,11 @@ var LayoutStep = (props) => {
17593
17912
  var LayoutStep_default = LayoutStep;
17594
17913
 
17595
17914
  // src/legacy/step/cameraStep/CameraStep.tsx
17596
- import { useEffect as useEffect25, useState as useState31 } from "react";
17915
+ import { useEffect as useEffect25, useState as useState32 } from "react";
17597
17916
 
17598
17917
  // src/legacy/step/cameraStep/cameraCapture/CameraCapture.tsx
17599
- import { useCallback as useCallback10, useEffect as useEffect24, useMemo as useMemo20, useRef as useRef8, useState as useState30 } from "react";
17600
- import { useIntl as useIntl22 } from "react-intl";
17918
+ import { useCallback as useCallback10, useEffect as useEffect24, useMemo as useMemo20, useRef as useRef8, useState as useState31 } from "react";
17919
+ import { useIntl as useIntl23 } from "react-intl";
17601
17920
  import Webcam from "react-webcam";
17602
17921
 
17603
17922
  // src/legacy/step/cameraStep/cameraCapture/CameraCapture.messages.ts
@@ -17662,16 +17981,16 @@ var CameraCapture_messages_default = defineMessages13({
17662
17981
 
17663
17982
  // src/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.tsx
17664
17983
  import { Button as Button10, ControlType, Priority, Size as Size3 } from "@transferwise/components";
17665
- import { useIntl as useIntl20 } from "react-intl";
17666
- import { jsx as jsx117, jsxs as jsxs46 } from "react/jsx-runtime";
17667
- var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ jsx117("div", { className: "bottom-bar", children: /* @__PURE__ */ jsx117(CaptureButton, { onClick: onCapture }) });
17984
+ import { useIntl as useIntl21 } from "react-intl";
17985
+ import { jsx as jsx118, jsxs as jsxs46 } from "react/jsx-runtime";
17986
+ var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ jsx118("div", { className: "bottom-bar", children: /* @__PURE__ */ jsx118(CaptureButton, { onClick: onCapture }) });
17668
17987
  var ReviewBottomBar = ({
17669
17988
  onSubmit,
17670
17989
  onRetry
17671
17990
  }) => {
17672
- const intl = useIntl20();
17673
- return /* @__PURE__ */ jsx117("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ jsx117("div", { className: "row", children: /* @__PURE__ */ jsxs46("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
17674
- /* @__PURE__ */ jsx117(
17991
+ const intl = useIntl21();
17992
+ return /* @__PURE__ */ jsx118("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ jsx118("div", { className: "row", children: /* @__PURE__ */ jsxs46("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
17993
+ /* @__PURE__ */ jsx118(
17675
17994
  Button10,
17676
17995
  {
17677
17996
  className: "m-b-1",
@@ -17682,7 +18001,7 @@ var ReviewBottomBar = ({
17682
18001
  children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
17683
18002
  }
17684
18003
  ),
17685
- /* @__PURE__ */ jsx117(
18004
+ /* @__PURE__ */ jsx118(
17686
18005
  Button10,
17687
18006
  {
17688
18007
  className: "m-b-2",
@@ -17696,19 +18015,19 @@ var ReviewBottomBar = ({
17696
18015
  )
17697
18016
  ] }) }) });
17698
18017
  };
17699
- var CaptureButton = ({ onClick }) => /* @__PURE__ */ jsx117(
18018
+ var CaptureButton = ({ onClick }) => /* @__PURE__ */ jsx118(
17700
18019
  "button",
17701
18020
  {
17702
18021
  type: "button",
17703
18022
  className: "camera-capture-btn m-b-2",
17704
18023
  "data-testid": "camera-capture-button",
17705
18024
  onClick,
17706
- children: /* @__PURE__ */ jsx117("span", { className: "camera-capture-btn-inner" })
18025
+ children: /* @__PURE__ */ jsx118("span", { className: "camera-capture-btn-inner" })
17707
18026
  }
17708
18027
  );
17709
18028
 
17710
18029
  // src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
17711
- import { useIntl as useIntl21 } from "react-intl";
18030
+ import { useIntl as useIntl22 } from "react-intl";
17712
18031
 
17713
18032
  // src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.ts
17714
18033
  import { defineMessages as defineMessages14 } from "react-intl";
@@ -17721,11 +18040,11 @@ var OrientationLockOverlay_messages_default = defineMessages14({
17721
18040
  });
17722
18041
 
17723
18042
  // src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
17724
- import { jsx as jsx118, jsxs as jsxs47 } from "react/jsx-runtime";
18043
+ import { jsx as jsx119, jsxs as jsxs47 } from "react/jsx-runtime";
17725
18044
  function OrientationLockOverlay() {
17726
- const intl = useIntl21();
18045
+ const intl = useIntl22();
17727
18046
  return /* @__PURE__ */ jsxs47("div", { className: "orientation-lock-overlay", children: [
17728
- /* @__PURE__ */ jsx118(
18047
+ /* @__PURE__ */ jsx119(
17729
18048
  "img",
17730
18049
  {
17731
18050
  className: "m-b-3",
@@ -17735,19 +18054,19 @@ function OrientationLockOverlay() {
17735
18054
  alt: ""
17736
18055
  }
17737
18056
  ),
17738
- /* @__PURE__ */ jsx118("p", { className: "text-center m-b-0", children: intl.formatMessage(OrientationLockOverlay_messages_default.text) })
18057
+ /* @__PURE__ */ jsx119("p", { className: "text-center m-b-0", children: intl.formatMessage(OrientationLockOverlay_messages_default.text) })
17739
18058
  ] });
17740
18059
  }
17741
18060
  var OrientationLockOverlay_default = OrientationLockOverlay;
17742
18061
 
17743
18062
  // src/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
17744
18063
  import { Button as Button11 } from "@transferwise/components";
17745
- import { jsx as jsx119, jsxs as jsxs48 } from "react/jsx-runtime";
18064
+ import { jsx as jsx120, jsxs as jsxs48 } from "react/jsx-runtime";
17746
18065
  function CameraErrorScreen({ title, description, actionButton, onAction }) {
17747
- return /* @__PURE__ */ jsx119("div", { className: "container p-t-5", children: /* @__PURE__ */ jsx119("div", { className: "row", children: /* @__PURE__ */ jsxs48("div", { className: "col-md-6 col-md-offset-3", children: [
17748
- /* @__PURE__ */ jsx119("h2", { className: "text-xs-center m-b-3", children: title }),
17749
- /* @__PURE__ */ jsx119("p", { className: "text-xs-center m-b-5", children: description }),
17750
- onAction && actionButton && /* @__PURE__ */ jsx119(Button11, { block: true, onClick: onAction, children: actionButton })
18066
+ return /* @__PURE__ */ jsx120("div", { className: "container p-t-5", children: /* @__PURE__ */ jsx120("div", { className: "row", children: /* @__PURE__ */ jsxs48("div", { className: "col-md-6 col-md-offset-3", children: [
18067
+ /* @__PURE__ */ jsx120("h2", { className: "text-xs-center m-b-3", children: title }),
18068
+ /* @__PURE__ */ jsx120("p", { className: "text-xs-center m-b-5", children: description }),
18069
+ onAction && actionButton && /* @__PURE__ */ jsx120(Button11, { block: true, onClick: onAction, children: actionButton })
17751
18070
  ] }) }) });
17752
18071
  }
17753
18072
  var CameraErrorScreen_default = CameraErrorScreen;
@@ -17834,7 +18153,10 @@ var trackCameraOrientationLocked = (onEvent) => {
17834
18153
  var useFullScreenOrientationLock = (shouldLockOrientation, onEvent) => {
17835
18154
  const lockOrientation = useCallback9(() => {
17836
18155
  if (window.screen.orientation && "lock" in window.screen.orientation && typeof window.screen.orientation.lock === "function") {
17837
- window.screen.orientation.lock("portrait").then(() => trackCameraOrientationLocked(onEvent)).catch(noop5);
18156
+ const lockPromise = window.screen.orientation.lock("portrait");
18157
+ if (lockPromise instanceof Promise) {
18158
+ lockPromise.then(() => trackCameraOrientationLocked(onEvent)).catch(noop5);
18159
+ }
17838
18160
  }
17839
18161
  }, [onEvent]);
17840
18162
  const unlockOrientation = useCallback9(() => {
@@ -17890,9 +18212,9 @@ var noop5 = () => {
17890
18212
  };
17891
18213
 
17892
18214
  // src/legacy/step/cameraStep/cameraCapture/hooks/useVideoConstraints.ts
17893
- import { useEffect as useEffect22, useState as useState29 } from "react";
18215
+ import { useEffect as useEffect22, useState as useState30 } from "react";
17894
18216
  var useVideoConstraints = (direction) => {
17895
- const [videoConstraints, setVideoConstraints] = useState29();
18217
+ const [videoConstraints, setVideoConstraints] = useState30();
17896
18218
  const defaultVideoConstraints = {
17897
18219
  facingMode: direction === "front" ? "user" : "environment",
17898
18220
  height: { min: 480, max: 1080, ideal: 720 },
@@ -17919,7 +18241,7 @@ var useVideoConstraints = (direction) => {
17919
18241
 
17920
18242
  // src/legacy/step/cameraStep/cameraCapture/overlay/Overlay.tsx
17921
18243
  import { useEffect as useEffect23, useRef as useRef7 } from "react";
17922
- import { Fragment as Fragment23, jsx as jsx120, jsxs as jsxs49 } from "react/jsx-runtime";
18244
+ import { Fragment as Fragment23, jsx as jsx121, jsxs as jsxs49 } from "react/jsx-runtime";
17923
18245
  var captureButtonHeight = 92;
17924
18246
  var reviewButtonsHeight = 120;
17925
18247
  var imageHeight = 40;
@@ -17942,17 +18264,17 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
17942
18264
  });
17943
18265
  let helperBoxHeight = (imageUrl ? imageHeight : 0) + (title ? titleHeight : 0) + (instructions ? instructionsHeight : 0);
17944
18266
  let helperBox = /* @__PURE__ */ jsxs49(Fragment23, { children: [
17945
- imageUrl && /* @__PURE__ */ jsx120("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
17946
- title && /* @__PURE__ */ jsx120("h4", { className: "camera-capture-title", children: title }),
17947
- instructions && /* @__PURE__ */ jsx120("small", { className: "camera-capture-instructions", children: instructions })
18267
+ imageUrl && /* @__PURE__ */ jsx121("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
18268
+ title && /* @__PURE__ */ jsx121("h4", { className: "camera-capture-title", children: title }),
18269
+ instructions && /* @__PURE__ */ jsx121("small", { className: "camera-capture-instructions", children: instructions })
17948
18270
  ] });
17949
18271
  const frameBottomMargin = captureButtonHeight + helperBoxHeight;
17950
18272
  if (reviewInstructions) {
17951
18273
  helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
17952
- helperBox = /* @__PURE__ */ jsx120("small", { className: "camera-capture-instructions", children: reviewInstructions });
18274
+ helperBox = /* @__PURE__ */ jsx121("small", { className: "camera-capture-instructions", children: reviewInstructions });
17953
18275
  const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
17954
18276
  if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
17955
- helperBox = /* @__PURE__ */ jsx120(Fragment23, {});
18277
+ helperBox = /* @__PURE__ */ jsx121(Fragment23, {});
17956
18278
  }
17957
18279
  }
17958
18280
  const framePosition = {
@@ -17971,19 +18293,19 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
17971
18293
  }
17972
18294
  };
17973
18295
  return /* @__PURE__ */ jsxs49("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
17974
- /* @__PURE__ */ jsx120("defs", { children: /* @__PURE__ */ jsxs49("mask", { id: "mask", children: [
17975
- /* @__PURE__ */ jsx120("rect", { width: "100%", height: "100%", fill: "#fff" }),
17976
- /* @__PURE__ */ jsx120("image", __spreadValues({ href: overlay }, framePosition))
18296
+ /* @__PURE__ */ jsx121("defs", { children: /* @__PURE__ */ jsxs49("mask", { id: "mask", children: [
18297
+ /* @__PURE__ */ jsx121("rect", { width: "100%", height: "100%", fill: "#fff" }),
18298
+ /* @__PURE__ */ jsx121("image", __spreadValues({ href: overlay }, framePosition))
17977
18299
  ] }) }),
17978
- overlay && /* @__PURE__ */ jsx120("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
17979
- outline && /* @__PURE__ */ jsx120("image", __spreadValues({ href: outline }, framePosition)),
17980
- /* @__PURE__ */ jsx120("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ jsx120("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
18300
+ overlay && /* @__PURE__ */ jsx121("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
18301
+ outline && /* @__PURE__ */ jsx121("image", __spreadValues({ href: outline }, framePosition)),
18302
+ /* @__PURE__ */ jsx121("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ jsx121("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
17981
18303
  ] });
17982
18304
  }
17983
18305
  var Overlay_default = Overlay;
17984
18306
 
17985
18307
  // src/legacy/step/cameraStep/cameraCapture/CameraCapture.tsx
17986
- import { jsx as jsx121, jsxs as jsxs50 } from "react/jsx-runtime";
18308
+ import { jsx as jsx122, jsxs as jsxs50 } from "react/jsx-runtime";
17987
18309
  function CameraCapture({
17988
18310
  direction = "back",
17989
18311
  overlay = "",
@@ -17995,11 +18317,11 @@ function CameraCapture({
17995
18317
  onCapture,
17996
18318
  onEvent
17997
18319
  }) {
17998
- const [mode, setMode] = useState30("CAPTURE" /* CAPTURE */);
17999
- const [cameraError, setCameraError] = useState30();
18000
- const [isVideoMirrored, setIsVideoMirrored] = useState30(false);
18001
- const [ready, setReady] = useState30(false);
18002
- const [reviewImage, setReviewImage] = useState30();
18320
+ const [mode, setMode] = useState31("CAPTURE" /* CAPTURE */);
18321
+ const [cameraError, setCameraError] = useState31();
18322
+ const [isVideoMirrored, setIsVideoMirrored] = useState31(false);
18323
+ const [ready, setReady] = useState31(false);
18324
+ const [reviewImage, setReviewImage] = useState31();
18003
18325
  const webcamReference = useRef8(null);
18004
18326
  const { videoConstraints } = useVideoConstraints(direction);
18005
18327
  const shouldLockOrientation = useMemo20(
@@ -18010,7 +18332,7 @@ function CameraCapture({
18010
18332
  shouldLockOrientation,
18011
18333
  onEvent
18012
18334
  );
18013
- const intl = useIntl22();
18335
+ const intl = useIntl23();
18014
18336
  const handleCapture = useCallback10(async () => {
18015
18337
  var _a, _b, _c, _d, _e, _f;
18016
18338
  if (((_a = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _a.video) && ((_c = (_b = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _b.video) == null ? void 0 : _c.readyState) >= 3) {
@@ -18092,7 +18414,7 @@ function CameraCapture({
18092
18414
  }
18093
18415
  }, [mode, exitFullScreen]);
18094
18416
  const captureScreen = /* @__PURE__ */ jsxs50("div", { className: "camera-capture", children: [
18095
- videoConstraints && /* @__PURE__ */ jsx121(
18417
+ videoConstraints && /* @__PURE__ */ jsx122(
18096
18418
  Webcam,
18097
18419
  {
18098
18420
  ref: webcamReference,
@@ -18103,7 +18425,7 @@ function CameraCapture({
18103
18425
  onUserMedia: handleUserMedia
18104
18426
  }
18105
18427
  ),
18106
- /* @__PURE__ */ jsx121(
18428
+ /* @__PURE__ */ jsx122(
18107
18429
  Overlay_default,
18108
18430
  {
18109
18431
  overlay,
@@ -18113,8 +18435,8 @@ function CameraCapture({
18113
18435
  instructions
18114
18436
  }
18115
18437
  ),
18116
- shouldLockOrientation && /* @__PURE__ */ jsx121(OrientationLockOverlay_default, {}),
18117
- ready && /* @__PURE__ */ jsx121(
18438
+ shouldLockOrientation && /* @__PURE__ */ jsx122(OrientationLockOverlay_default, {}),
18439
+ ready && /* @__PURE__ */ jsx122(
18118
18440
  CaptureBottomBar,
18119
18441
  {
18120
18442
  onCapture: () => {
@@ -18124,8 +18446,8 @@ function CameraCapture({
18124
18446
  )
18125
18447
  ] });
18126
18448
  const reviewScreen = /* @__PURE__ */ jsxs50("div", { className: "camera-capture", children: [
18127
- /* @__PURE__ */ jsx121("img", { className: "review-image", src: reviewImage == null ? void 0 : reviewImage.source, alt: "" }),
18128
- /* @__PURE__ */ jsx121(
18449
+ /* @__PURE__ */ jsx122("img", { className: "review-image", src: reviewImage == null ? void 0 : reviewImage.source, alt: "" }),
18450
+ /* @__PURE__ */ jsx122(
18129
18451
  Overlay_default,
18130
18452
  {
18131
18453
  overlay,
@@ -18135,18 +18457,18 @@ function CameraCapture({
18135
18457
  reviewInstructions: intl.formatMessage(CameraCapture_messages_default.reviewInstructions)
18136
18458
  }
18137
18459
  ),
18138
- /* @__PURE__ */ jsx121(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
18460
+ /* @__PURE__ */ jsx122(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
18139
18461
  ] });
18140
18462
  return /* @__PURE__ */ jsxs50("section", { children: [
18141
18463
  mode === "CAPTURE" /* CAPTURE */ && captureScreen,
18142
18464
  mode === "REVIEW" /* REVIEW */ && reviewScreen,
18143
- mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */ jsx121(CameraErrorScreen_default, __spreadValues({}, cameraError))
18465
+ mode === "ERROR" /* ERROR */ && cameraError && /* @__PURE__ */ jsx122(CameraErrorScreen_default, __spreadValues({}, cameraError))
18144
18466
  ] });
18145
18467
  }
18146
18468
  var CameraCapture_default = CameraCapture;
18147
18469
 
18148
18470
  // src/legacy/step/cameraStep/CameraStep.tsx
18149
- import { jsx as jsx122 } from "react/jsx-runtime";
18471
+ import { jsx as jsx123 } from "react/jsx-runtime";
18150
18472
  function blobToBase64(blob) {
18151
18473
  return new Promise((resolve, _) => {
18152
18474
  const reader = new FileReader();
@@ -18164,7 +18486,7 @@ function CameraStep(props) {
18164
18486
  const { assets, direction, instructions } = cameraConfig || {};
18165
18487
  const { overlay, outline } = assets || {};
18166
18488
  const { url: imageUrl } = image || {};
18167
- const [captureClicked, setCaptureClicked] = useState31(false);
18489
+ const [captureClicked, setCaptureClicked] = useState32(false);
18168
18490
  useEffect25(() => {
18169
18491
  if (captureClicked) {
18170
18492
  onAction(action);
@@ -18184,7 +18506,7 @@ function CameraStep(props) {
18184
18506
  });
18185
18507
  }
18186
18508
  };
18187
- return /* @__PURE__ */ jsx122(
18509
+ return /* @__PURE__ */ jsx123(
18188
18510
  CameraCapture_default,
18189
18511
  {
18190
18512
  overlay,
@@ -18233,13 +18555,13 @@ function getFirstAction(step) {
18233
18555
  }
18234
18556
 
18235
18557
  // src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
18236
- import { useIntl as useIntl23 } from "react-intl";
18237
- import { jsx as jsx123 } from "react/jsx-runtime";
18558
+ import { useIntl as useIntl24 } from "react-intl";
18559
+ import { jsx as jsx124 } from "react/jsx-runtime";
18238
18560
  var noop6 = () => {
18239
18561
  };
18240
18562
  function ExternalConfirmationStep({ url, onClose }) {
18241
- const { formatMessage } = useIntl23();
18242
- return /* @__PURE__ */ jsx123(
18563
+ const { formatMessage } = useIntl24();
18564
+ return /* @__PURE__ */ jsx124(
18243
18565
  DynamicLayout_default,
18244
18566
  {
18245
18567
  components: [
@@ -18306,7 +18628,7 @@ function getOrigin2(url) {
18306
18628
  // src/legacy/dynamicFlow/BackButton.tsx
18307
18629
  import { Avatar as Avatar7 } from "@transferwise/components";
18308
18630
  import { ArrowLeft as ArrowLeft2 } from "@transferwise/icons";
18309
- import { jsx as jsx124, jsxs as jsxs51 } from "react/jsx-runtime";
18631
+ import { jsx as jsx125, jsxs as jsxs51 } from "react/jsx-runtime";
18310
18632
  function BackButton2({ title, action, onAction }) {
18311
18633
  return /* @__PURE__ */ jsxs51(
18312
18634
  "a",
@@ -18319,8 +18641,8 @@ function BackButton2({ title, action, onAction }) {
18319
18641
  onAction(__spreadProps(__spreadValues({}, action), { skipValidation: true }));
18320
18642
  },
18321
18643
  children: [
18322
- /* @__PURE__ */ jsx124("span", { className: "sr-only", children: title }),
18323
- /* @__PURE__ */ jsx124(Avatar7, { type: "icon", children: /* @__PURE__ */ jsx124(ArrowLeft2, { size: "24" }) })
18644
+ /* @__PURE__ */ jsx125("span", { className: "sr-only", children: title }),
18645
+ /* @__PURE__ */ jsx125(Avatar7, { type: "icon", children: /* @__PURE__ */ jsx125(ArrowLeft2, { size: "24" }) })
18324
18646
  ]
18325
18647
  }
18326
18648
  );
@@ -18328,7 +18650,7 @@ function BackButton2({ title, action, onAction }) {
18328
18650
  var BackButton_default2 = BackButton2;
18329
18651
 
18330
18652
  // src/legacy/dynamicFlow/DynamicFlowStep.tsx
18331
- import { Fragment as Fragment24, jsx as jsx125, jsxs as jsxs52 } from "react/jsx-runtime";
18653
+ import { Fragment as Fragment24, jsx as jsx126, jsxs as jsxs52 } from "react/jsx-runtime";
18332
18654
  function DynamicFlowStep(props) {
18333
18655
  var _a, _b, _c;
18334
18656
  const { step, globalError, onAction } = props;
@@ -18337,20 +18659,20 @@ function DynamicFlowStep(props) {
18337
18659
  const { requiresManualTrigger, dismissConfirmation } = useExternal2(externalUrl);
18338
18660
  if (step === void 0) {
18339
18661
  if (globalError) {
18340
- return /* @__PURE__ */ jsx125(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } });
18662
+ return /* @__PURE__ */ jsx126(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } });
18341
18663
  }
18342
18664
  return null;
18343
18665
  }
18344
18666
  if (externalUrl && requiresManualTrigger) {
18345
- return /* @__PURE__ */ jsx125(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
18667
+ return /* @__PURE__ */ jsx126(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
18346
18668
  }
18347
18669
  if (isCameraStep(step)) {
18348
- return /* @__PURE__ */ jsx125(CameraStep_default, __spreadProps(__spreadValues({}, props), { step }));
18670
+ return /* @__PURE__ */ jsx126(CameraStep_default, __spreadProps(__spreadValues({}, props), { step }));
18349
18671
  }
18350
18672
  return /* @__PURE__ */ jsxs52(Fragment24, { children: [
18351
- backButton && /* @__PURE__ */ jsx125(BackButton_default2, __spreadProps(__spreadValues({}, backButton), { onAction })),
18352
- globalError ? /* @__PURE__ */ jsx125(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
18353
- /* @__PURE__ */ jsx125(LayoutStep_default, __spreadProps(__spreadValues({}, props), { stepSpecification: step }))
18673
+ backButton && /* @__PURE__ */ jsx126(BackButton_default2, __spreadProps(__spreadValues({}, backButton), { onAction })),
18674
+ globalError ? /* @__PURE__ */ jsx126(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
18675
+ /* @__PURE__ */ jsx126(LayoutStep_default, __spreadProps(__spreadValues({}, props), { stepSpecification: step }))
18354
18676
  ] });
18355
18677
  }
18356
18678
 
@@ -18390,12 +18712,12 @@ function useDebouncedRefresh(fetchRefresh) {
18390
18712
  var shouldDebounceSchema = (schema) => getSchemaType(schema) === "basic" && schema.type !== "boolean" && schema.format !== "base64url";
18391
18713
 
18392
18714
  // src/legacy/dynamicFlow/utils/useDynamicFlowState.ts
18393
- import { useMemo as useMemo21, useState as useState32 } from "react";
18715
+ import { useMemo as useMemo21, useState as useState33 } from "react";
18394
18716
  var useDynamicFlowState = (initialStep) => {
18395
18717
  var _a, _b;
18396
- const [formErrors, setFormErrors] = useState32((_a = initialStep == null ? void 0 : initialStep.errors) == null ? void 0 : _a.validation);
18397
- const [globalError, setGlobalError] = useState32((_b = initialStep == null ? void 0 : initialStep.errors) == null ? void 0 : _b.error);
18398
- const [stepAndModels, setStepAndModels] = useState32({
18718
+ const [formErrors, setFormErrors] = useState33((_a = initialStep == null ? void 0 : initialStep.errors) == null ? void 0 : _a.validation);
18719
+ const [globalError, setGlobalError] = useState33((_b = initialStep == null ? void 0 : initialStep.errors) == null ? void 0 : _b.error);
18720
+ const [stepAndModels, setStepAndModels] = useState33({
18399
18721
  step: initialStep || void 0,
18400
18722
  models: (initialStep == null ? void 0 : initialStep.model) ? buildInitialModels(initialStep.model, getAllSchemas(initialStep)) : {},
18401
18723
  etag: void 0
@@ -18498,17 +18820,17 @@ var isInlineSchema = (schema) => schema !== void 0 && typeof schema === "object"
18498
18820
 
18499
18821
  // src/legacy/dynamicFlow/utils/useLoader.tsx
18500
18822
  import { Loader as Loader4, Size as Size4 } from "@transferwise/components";
18501
- import { useState as useState33 } from "react";
18502
- import { jsx as jsx126 } from "react/jsx-runtime";
18823
+ import { useState as useState34 } from "react";
18824
+ import { jsx as jsx127 } from "react/jsx-runtime";
18503
18825
  function useLoader(loaderConfig, initialState) {
18504
18826
  const config = __spreadValues({
18505
18827
  size: Size4.EXTRA_LARGE,
18506
18828
  initial: true,
18507
18829
  submission: false
18508
18830
  }, loaderConfig);
18509
- const [loadingState, setLoadingState] = useState33(initialState);
18831
+ const [loadingState, setLoadingState] = useState34(initialState);
18510
18832
  const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
18511
- const loader = shouldDisplayLoader ? /* @__PURE__ */ jsx126(
18833
+ const loader = shouldDisplayLoader ? /* @__PURE__ */ jsx127(
18512
18834
  Loader4,
18513
18835
  {
18514
18836
  size: config.size,
@@ -18611,9 +18933,9 @@ var assertResponseIsValid2 = (response) => {
18611
18933
  var isResponse2 = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
18612
18934
 
18613
18935
  // src/legacy/dynamicFlow/utils/useErrorResponse.tsx
18614
- import { useIntl as useIntl24 } from "react-intl";
18936
+ import { useIntl as useIntl25 } from "react-intl";
18615
18937
  var useErrorResponse = () => {
18616
- const { formatMessage } = useIntl24();
18938
+ const { formatMessage } = useIntl25();
18617
18939
  return async (response, fetchType) => {
18618
18940
  try {
18619
18941
  const errorResponse = await parseErrorResponse(response);
@@ -18628,7 +18950,7 @@ var useErrorResponse = () => {
18628
18950
  };
18629
18951
 
18630
18952
  // src/legacy/dynamicFlow/DynamicFlow.tsx
18631
- import { jsx as jsx127 } from "react/jsx-runtime";
18953
+ import { jsx as jsx128 } from "react/jsx-runtime";
18632
18954
  var noop7 = () => {
18633
18955
  };
18634
18956
  var DynamicFlowComponent = ({
@@ -18656,7 +18978,7 @@ var DynamicFlowComponent = ({
18656
18978
  setStepAndEtag,
18657
18979
  setSchemaModel
18658
18980
  } = useDynamicFlowState(initialStep);
18659
- const [submitted, setSubmitted] = useState34(false);
18981
+ const [submitted, setSubmitted] = useState35(false);
18660
18982
  const { isLoading, loader, setLoadingState } = useLoader(
18661
18983
  loaderConfig,
18662
18984
  initialStep ? "idle" : "initial"
@@ -18867,7 +19189,7 @@ var DynamicFlowComponent = ({
18867
19189
  await performAction(action);
18868
19190
  }
18869
19191
  };
18870
- return /* @__PURE__ */ jsx127(LogProvider, { flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), onLog, children: /* @__PURE__ */ jsx127(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ jsx127(DynamicFlowProvider, { loading: isLoading || isDebouncing, children: /* @__PURE__ */ jsx127(HttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx127(FeatureContextProvider, { features, children: loader !== null ? loader : /* @__PURE__ */ jsx127(
19192
+ return /* @__PURE__ */ jsx128(LogProvider, { flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), onLog, children: /* @__PURE__ */ jsx128(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ jsx128(DynamicFlowProvider, { loading: isLoading || isDebouncing, children: /* @__PURE__ */ jsx128(HttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx128(FeatureContextProvider, { features, children: loader !== null ? loader : /* @__PURE__ */ jsx128(
18871
19193
  DynamicFlowStep,
18872
19194
  {
18873
19195
  step,
@@ -18884,7 +19206,7 @@ var DynamicFlowComponent = ({
18884
19206
  ) }) }) }) }) });
18885
19207
  };
18886
19208
  function DynamicFlow(props) {
18887
- return /* @__PURE__ */ jsx127(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ jsx127(DynamicFlowComponent, __spreadValues({}, props)) });
19209
+ return /* @__PURE__ */ jsx128(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ jsx128(DynamicFlowComponent, __spreadValues({}, props)) });
18888
19210
  }
18889
19211
  var DynamicFlow_default = DynamicFlow;
18890
19212
  var combineModels2 = (formModels) => Object.values(formModels).reduce((previous, model) => __spreadValues(__spreadValues({}, previous), model), {});
@@ -18901,19 +19223,19 @@ var shouldTriggerRefresh = (props) => {
18901
19223
  };
18902
19224
 
18903
19225
  // src/legacy/jsonSchemaForm/JsonSchemaForm.tsx
18904
- import { jsx as jsx128 } from "react/jsx-runtime";
19226
+ import { jsx as jsx129 } from "react/jsx-runtime";
18905
19227
  function JsonSchemaForm(props) {
18906
19228
  const schemaProps = __spreadValues({
18907
19229
  model: null,
18908
19230
  errors: null
18909
19231
  }, props);
18910
19232
  const { baseUrl = "", onEvent = noop8, onLog = noop8 } = props;
18911
- return /* @__PURE__ */ jsx128(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog, children: /* @__PURE__ */ jsx128(
19233
+ return /* @__PURE__ */ jsx129(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog, children: /* @__PURE__ */ jsx129(
18912
19234
  EventsContextProvider,
18913
19235
  {
18914
19236
  metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" },
18915
19237
  onEvent,
18916
- children: /* @__PURE__ */ jsx128(HttpClientProviderFromBaseUrl, { baseUrl, children: /* @__PURE__ */ jsx128(GenericSchema_default, __spreadValues({}, schemaProps)) })
19238
+ children: /* @__PURE__ */ jsx129(HttpClientProviderFromBaseUrl, { baseUrl, children: /* @__PURE__ */ jsx129(GenericSchema_default, __spreadValues({}, schemaProps)) })
18917
19239
  }
18918
19240
  ) });
18919
19241
  }