@wise/dynamic-flow-client 3.10.0 → 3.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/main.js CHANGED
@@ -1291,11 +1291,14 @@ var isStringSchemaWithUpload = (schema) => isStringSchema(schema) && schema.form
1291
1291
  var isSchemaWithPersistAsync = (schema) => "persistAsync" in schema && !isNullish(schema.persistAsync);
1292
1292
 
1293
1293
  // src/revamp/renderers/stepComponentToProps.ts
1294
- var stepComponentToProps = ({ back, external, loadingState, trackEvent }, children) => ({
1294
+ var stepComponentToProps = ({ back, description, error, external, loadingState, title, trackEvent }, children) => ({
1295
1295
  type: "step",
1296
1296
  back,
1297
+ description,
1298
+ error,
1297
1299
  external,
1298
1300
  loadingState,
1301
+ title,
1299
1302
  trackEvent,
1300
1303
  children
1301
1304
  });
@@ -6519,27 +6522,6 @@ var alertLayoutToComponent = (uid, { control, markdown, margin = "md", context =
6519
6522
  context: mapLegacyContext(context)
6520
6523
  });
6521
6524
 
6522
- // src/revamp/domain/components/HeadingComponent.ts
6523
- var createHeadingComponent = (headingProps) => __spreadProps(__spreadValues({
6524
- type: "heading"
6525
- }, headingProps), {
6526
- getSubmittableValue: async () => null,
6527
- getSummary: () => ({}),
6528
- // Noop
6529
- getLocalValue: () => null,
6530
- validate: () => true
6531
- });
6532
-
6533
- // src/revamp/domain/mappers/layout/headingLayoutToComponent.ts
6534
- var headingLayoutToComponent = (uid, { align = "left", margin = "md", size = "md", control, text }) => createHeadingComponent({
6535
- uid,
6536
- align: mapLegacyAlign(align),
6537
- control,
6538
- margin,
6539
- size,
6540
- text
6541
- });
6542
-
6543
6525
  // src/revamp/domain/components/BoxComponent.ts
6544
6526
  var createBoxComponent = (boxProps) => __spreadProps(__spreadValues({}, boxProps), {
6545
6527
  type: "box",
@@ -7783,38 +7765,32 @@ var getComponentForLocalValueKey = (key, component) => {
7783
7765
 
7784
7766
  // src/revamp/domain/components/utils/isPartialLocalValueMatch.ts
7785
7767
  var isPartialLocalValueMatch = (partialValue, component) => {
7786
- if (isArray(partialValue) && component.type === "repeatable") {
7787
- const children = component.getChildren();
7788
- return partialValue.every((value, index) => {
7789
- const childComponent = children[index];
7790
- return childComponent ? isPartialLocalValueMatch(value, childComponent) : false;
7791
- });
7768
+ if (!component) {
7769
+ return false;
7792
7770
  }
7793
7771
  const componentValue = component.getLocalValue();
7794
7772
  if (component.type === "const") {
7795
7773
  return compareLocalValue(partialValue, componentValue);
7796
7774
  }
7797
7775
  if (isObjectLocalValue(partialValue) && isObjectLocalValue(componentValue)) {
7798
- const allKeys = Array.from(
7799
- /* @__PURE__ */ new Set([...Object.keys(partialValue), ...Object.keys(componentValue)])
7800
- );
7801
- const matchingKeys = allKeys.filter(
7802
- (key) => !isNullish(partialValue[key]) && !isNullish(componentValue[key])
7803
- );
7804
- return matchingKeys.length > 0 && matchingKeys.every((key) => {
7805
- const componentForKey = getComponentForLocalValueKey(key, component);
7806
- return componentForKey ? isPartialLocalValueMatch(partialValue[key], componentForKey) : false;
7807
- });
7776
+ return isPartialObjectMatch(partialValue, componentValue, component);
7808
7777
  }
7809
- if (partialValue instanceof File && componentValue instanceof File) {
7810
- return areEquivalentFiles(partialValue, componentValue);
7811
- }
7812
- if ("isPersisted" in component && component.isPersisted) {
7813
- return true;
7814
- }
7815
- return compareLocalValue(partialValue, componentValue);
7778
+ return true;
7779
+ };
7780
+ var isPartialObjectMatch = (partialValue, componentValue, component) => {
7781
+ const resultByKey = getMatchingKeys(partialValue, componentValue).map((key) => {
7782
+ const componentForKey = getComponentForLocalValueKey(key, component);
7783
+ if (componentForKey && componentForKey.type === "const") {
7784
+ return isPartialLocalValueMatch(partialValue[key], componentForKey);
7785
+ }
7786
+ return null;
7787
+ });
7788
+ return resultByKey.includes(true) && !resultByKey.includes(false);
7789
+ };
7790
+ var getMatchingKeys = (a, b) => {
7791
+ const allKeys = Array.from(/* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(b)]));
7792
+ return allKeys.filter((key) => !isNullish(a[key]) && !isNullish(b[key]));
7816
7793
  };
7817
- var areEquivalentFiles = (fileA, fileB) => fileA.name === fileB.name && fileA.type === fileB.type && fileA.size === fileB.size;
7818
7794
 
7819
7795
  // src/revamp/domain/components/SelectInputComponent.ts
7820
7796
  var createSelectInputComponent = (selectProps, updateComponent) => {
@@ -8140,6 +8116,19 @@ var toBase64 = async (file) => new Promise((resolve, reject) => {
8140
8116
  reader.addEventListener("error", reject);
8141
8117
  reader.readAsDataURL(file);
8142
8118
  });
8119
+ var base64dataUrltoFile = (dataurl, filename) => {
8120
+ if (!isBase64DataUrl(dataurl)) {
8121
+ return null;
8122
+ }
8123
+ const [, base64data] = dataurl.split(",");
8124
+ return new File([base64ToBytes(base64data)], filename, { type: getMimeType(dataurl) });
8125
+ };
8126
+ var isBase64DataUrl = (dataurl) => dataurl.startsWith("data:") && dataurl.includes("base64") && dataurl.includes(",");
8127
+ var getMimeType = (base64dataUrl) => base64dataUrl.substring("data:".length).split(";")[0];
8128
+ var base64ToBytes = (base64) => {
8129
+ const charCodes = atob(base64).split("").map((m) => m.charCodeAt(0));
8130
+ return Uint8Array.from(charCodes);
8131
+ };
8143
8132
 
8144
8133
  // src/revamp/domain/components/UploadInputComponent.ts
8145
8134
  var createUploadInputComponent = (uploadInputProps, updateComponent) => {
@@ -8241,6 +8230,7 @@ var createUploadInputComponent = (uploadInputProps, updateComponent) => {
8241
8230
 
8242
8231
  // src/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToUploadInputComponent.ts
8243
8232
  var stringSchemaToUploadInputComponent = (schemaMapperProps, mapperProps) => {
8233
+ var _a;
8244
8234
  const { schema, localValue, model, required = false } = schemaMapperProps;
8245
8235
  const { accepts, autocompleteHint, maxSize, validationMessages } = schema;
8246
8236
  const { getErrorMessageFunctions, updateComponent, onRefresh, onValueChange } = mapperProps;
@@ -8248,7 +8238,7 @@ var stringSchemaToUploadInputComponent = (schemaMapperProps, mapperProps) => {
8248
8238
  const { performPersistAsync } = getPersistAsyncInitialState(schemaMapperProps, mapperProps);
8249
8239
  const persistedState = performPersistAsync ? getInitialPersistedState(null, model) : getInitialPersistedState();
8250
8240
  const validLocalValue = isFile(localValue) ? localValue : null;
8251
- const value = performPersistAsync ? validLocalValue : null;
8241
+ const value = (_a = getFileFromModel(model)) != null ? _a : validLocalValue;
8252
8242
  return createUploadInputComponent(
8253
8243
  __spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
8254
8244
  accepts,
@@ -8265,6 +8255,7 @@ var stringSchemaToUploadInputComponent = (schemaMapperProps, mapperProps) => {
8265
8255
  updateComponent
8266
8256
  );
8267
8257
  };
8258
+ var getFileFromModel = (model) => isString(model) ? base64dataUrltoFile(model, "") : null;
8268
8259
 
8269
8260
  // src/revamp/domain/components/TextInputComponent.ts
8270
8261
  var createTextInputComponent = (textInputProps, updateComponent) => {
@@ -9250,6 +9241,27 @@ var formLayoutToComponent = (uid, { schemaId, schema: schemaRef, control, margin
9250
9241
  });
9251
9242
  };
9252
9243
 
9244
+ // src/revamp/domain/components/HeadingComponent.ts
9245
+ var createHeadingComponent = (headingProps) => __spreadProps(__spreadValues({
9246
+ type: "heading"
9247
+ }, headingProps), {
9248
+ getSubmittableValue: async () => null,
9249
+ getSummary: () => ({}),
9250
+ // Noop
9251
+ getLocalValue: () => null,
9252
+ validate: () => true
9253
+ });
9254
+
9255
+ // src/revamp/domain/mappers/layout/headingLayoutToComponent.ts
9256
+ var headingLayoutToComponent = (uid, { align = "left", margin = "md", size = "md", control, text }) => createHeadingComponent({
9257
+ uid,
9258
+ align: mapLegacyAlign(align),
9259
+ control,
9260
+ margin,
9261
+ size,
9262
+ text
9263
+ });
9264
+
9253
9265
  // src/revamp/domain/components/ImageComponent.ts
9254
9266
  var createImageComponent = (imageProps) => __spreadProps(__spreadValues({
9255
9267
  type: "image"
@@ -9722,7 +9734,7 @@ var mapStepToComponent = (_a) => {
9722
9734
  ]);
9723
9735
  var _a2, _b2;
9724
9736
  const { httpClient, step, updateComponent } = restProps;
9725
- const { id, navigation, external, key, layout = [], polling } = step;
9737
+ const { id, description, errors, external, key, layout = [], navigation, polling, title } = step;
9726
9738
  const backNavigation = (_a2 = navigation == null ? void 0 : navigation.back) != null ? _a2 : navigation == null ? void 0 : navigation.backButton;
9727
9739
  const back = backNavigation ? {
9728
9740
  title: backNavigation.title,
@@ -9759,34 +9771,21 @@ var mapStepToComponent = (_a) => {
9759
9771
  onRefresh
9760
9772
  }))
9761
9773
  );
9762
- const additionalComponents = makeAdditionalComponents(step, uid, displayStepTitle);
9763
9774
  const stepComponent = createStepComponent({
9764
9775
  uid,
9765
- components: [...additionalComponents, ...layoutComponents],
9766
9776
  back,
9777
+ components: layoutComponents,
9778
+ description,
9779
+ error: errors == null ? void 0 : errors.error,
9767
9780
  external,
9768
9781
  loadingState,
9769
9782
  stepPolling,
9770
9783
  updateComponent,
9784
+ title: displayStepTitle ? title : void 0,
9771
9785
  trackEvent
9772
9786
  });
9773
9787
  return stepComponent;
9774
9788
  };
9775
- var makeAdditionalComponents = (step, uid, displayStepTitle) => {
9776
- const { title, errors } = step;
9777
- const heading = title && displayStepTitle ? headingLayoutToComponent(`${uid}.title`, {
9778
- type: "heading",
9779
- text: title,
9780
- align: "center",
9781
- size: "lg"
9782
- }) : void 0;
9783
- const stepError = (errors == null ? void 0 : errors.error) ? alertLayoutToComponent(`${uid}.global-error`, {
9784
- type: "alert",
9785
- markdown: errors.error,
9786
- context: "negative"
9787
- }) : void 0;
9788
- return [...heading ? [heading] : [], ...stepError ? [stepError] : []];
9789
- };
9790
9789
 
9791
9790
  // src/revamp/flow/executeRefresh.ts
9792
9791
  var executeRefresh = async (props) => {
@@ -12296,7 +12295,7 @@ var import_jsx_runtime55 = require("react/jsx-runtime");
12296
12295
  var ReviewRenderer = {
12297
12296
  canRenderType: "review",
12298
12297
  render: ({ callToAction, control, fields, margin, title }) => {
12299
- const orientation = control === "horizontal" ? "HORIZONTAL_RIGHT_ALIGNED" : "VERTICAL_ONE_COLUMN";
12298
+ const orientation = mapControlToDefinitionListLayout(control);
12300
12299
  const action = callToAction ? {
12301
12300
  text: callToAction.title,
12302
12301
  onClick: (event) => {
@@ -12321,6 +12320,21 @@ var ReviewRenderer = {
12321
12320
  }
12322
12321
  };
12323
12322
  var ReviewRenderer_default = ReviewRenderer;
12323
+ var mapControlToDefinitionListLayout = (control) => {
12324
+ switch (control) {
12325
+ case "horizontal":
12326
+ case "horizontal-end-aligned":
12327
+ return "HORIZONTAL_RIGHT_ALIGNED";
12328
+ case "horizontal-start-aligned":
12329
+ return "HORIZONTAL_LEFT_ALIGNED";
12330
+ case "vertical-two-column":
12331
+ return "VERTICAL_TWO_COLUMN";
12332
+ case "vertical":
12333
+ case "vertical-one-column":
12334
+ default:
12335
+ return "VERTICAL_ONE_COLUMN";
12336
+ }
12337
+ };
12324
12338
  var getFieldValue = (value, help, orientation) => {
12325
12339
  if (help) {
12326
12340
  return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
@@ -12446,13 +12460,14 @@ function BackButton({ title, onClick }) {
12446
12460
  var BackButton_default = BackButton;
12447
12461
 
12448
12462
  // src/revamp/wise/renderers/step/StepRenderer.tsx
12463
+ var import_components39 = require("@transferwise/components");
12449
12464
  var import_jsx_runtime58 = require("react/jsx-runtime");
12450
12465
  var StepRenderer = {
12451
12466
  canRenderType: "step",
12452
12467
  render: StepRendererComponent
12453
12468
  };
12454
12469
  function StepRendererComponent(props) {
12455
- const { back, loadingState, external, trackEvent, children } = props;
12470
+ const { back, description, error, external, loadingState, title, trackEvent, children } = props;
12456
12471
  const value = (0, import_react20.useMemo)(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
12457
12472
  const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
12458
12473
  if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
@@ -12460,6 +12475,9 @@ function StepRendererComponent(props) {
12460
12475
  }
12461
12476
  return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(StepRendererContextProvider, { value, children: [
12462
12477
  back ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(BackButton_default, __spreadValues({}, back)) : null,
12478
+ title ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h2", { className: "text-xs-center m-b-2", children: title }) : void 0,
12479
+ description ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "text-xs-center m-b-2", children: description }) : void 0,
12480
+ error ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components39.Alert, { type: "negative", className: "m-b-2", message: error }) : void 0,
12463
12481
  children
12464
12482
  ] });
12465
12483
  }
@@ -13829,10 +13847,10 @@ var import_classnames16 = __toESM(require_classnames());
13829
13847
  var import_react52 = require("react");
13830
13848
 
13831
13849
  // src/legacy/layout/alert/DynamicAlert.tsx
13832
- var import_components40 = require("@transferwise/components");
13850
+ var import_components41 = require("@transferwise/components");
13833
13851
 
13834
13852
  // src/legacy/layout/utils/getNavigationOptionMedia.tsx
13835
- var import_components39 = require("@transferwise/components");
13853
+ var import_components40 = require("@transferwise/components");
13836
13854
 
13837
13855
  // src/legacy/layout/icon/FlagIcon.tsx
13838
13856
  var import_jsx_runtime65 = require("react/jsx-runtime");
@@ -13883,10 +13901,10 @@ var DynamicIcon_default2 = DynamicIcon2;
13883
13901
  var import_jsx_runtime68 = require("react/jsx-runtime");
13884
13902
  var getNavigationOptionMedia = ({ icon, image }) => {
13885
13903
  if (icon == null ? void 0 : icon.name) {
13886
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components39.Avatar, { type: import_components39.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(DynamicIcon_default2, { type: icon.name }) });
13904
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components40.Avatar, { type: import_components40.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(DynamicIcon_default2, { type: icon.name }) });
13887
13905
  }
13888
13906
  if (icon == null ? void 0 : icon.text) {
13889
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components39.Avatar, { type: import_components39.AvatarType.INITIALS, children: icon.text });
13907
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components40.Avatar, { type: import_components40.AvatarType.INITIALS, children: icon.text });
13890
13908
  }
13891
13909
  if (image == null ? void 0 : image.url) {
13892
13910
  const { url, text } = image;
@@ -13930,7 +13948,7 @@ var import_jsx_runtime69 = require("react/jsx-runtime");
13930
13948
  var DynamicAlert = (props) => {
13931
13949
  const alert = props.component;
13932
13950
  return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
13933
- import_components40.Alert,
13951
+ import_components41.Alert,
13934
13952
  {
13935
13953
  type: mapContextToAlertType(legacy_mapContext(alert.context)),
13936
13954
  className: getMargin2(alert.margin),
@@ -14014,7 +14032,7 @@ var getBoxWidthClasses = (component) => {
14014
14032
  var DynamicBox_default = DynamicBox;
14015
14033
 
14016
14034
  // src/legacy/layout/button/DynamicButton.tsx
14017
- var import_components41 = require("@transferwise/components");
14035
+ var import_components42 = require("@transferwise/components");
14018
14036
 
14019
14037
  // src/legacy/layout/button/utils.ts
14020
14038
  var priorities = {
@@ -14074,7 +14092,7 @@ function DynamicButton(props) {
14074
14092
  const { loading } = useDynamicFlow();
14075
14093
  const className = getMargin2(component.margin || "md");
14076
14094
  return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
14077
- import_components41.Button,
14095
+ import_components42.Button,
14078
14096
  {
14079
14097
  size: getButtonSize(component.size),
14080
14098
  type: priority === "tertiary" ? void 0 : type,
@@ -14142,12 +14160,12 @@ var getWidth = (bias) => {
14142
14160
  var DynamicColumns_default = DynamicColumns;
14143
14161
 
14144
14162
  // src/legacy/layout/decision/DynamicDecision.tsx
14145
- var import_components42 = require("@transferwise/components");
14163
+ var import_components43 = require("@transferwise/components");
14146
14164
  var import_jsx_runtime73 = require("react/jsx-runtime");
14147
14165
  function DynamicDecision({ component, onAction }) {
14148
14166
  const { loading } = useDynamicFlow();
14149
- return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: getMargin2(component.margin), children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_components42.NavigationOptionsList, { children: component.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
14150
- import_components42.NavigationOption,
14167
+ return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: getMargin2(component.margin), children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_components43.NavigationOptionsList, { children: component.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
14168
+ import_components43.NavigationOption,
14151
14169
  {
14152
14170
  title: option.title,
14153
14171
  content: option.description,
@@ -14172,7 +14190,7 @@ var DynamicDivider = ({ component }) => {
14172
14190
  var DynamicDivider_default = DynamicDivider;
14173
14191
 
14174
14192
  // src/legacy/layout/external/DynamicExternal.tsx
14175
- var import_components43 = require("@transferwise/components");
14193
+ var import_components44 = require("@transferwise/components");
14176
14194
  var import_react31 = require("react");
14177
14195
  var import_react_intl19 = require("react-intl");
14178
14196
 
@@ -14203,9 +14221,9 @@ var DynamicExternal = ({ component, onAction }) => {
14203
14221
  }) : void 0;
14204
14222
  useExternalStepPolling(pollingConfiguration, onAction);
14205
14223
  return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
14206
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components43.Loader, { size: import_components43.Size.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
14224
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components44.Loader, { size: import_components44.Size.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
14207
14225
  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("br", {}),
14208
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components43.Button, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
14226
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components44.Button, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
14209
14227
  ] });
14210
14228
  };
14211
14229
  var DynamicExternal_default = DynamicExternal;
@@ -14214,7 +14232,7 @@ var DynamicExternal_default = DynamicExternal;
14214
14232
  var import_react45 = require("react");
14215
14233
 
14216
14234
  // src/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.tsx
14217
- var import_components44 = require("@transferwise/components");
14235
+ var import_components45 = require("@transferwise/components");
14218
14236
  var import_classnames7 = __toESM(require_classnames());
14219
14237
  var import_react32 = require("react");
14220
14238
  var import_jsx_runtime76 = require("react/jsx-runtime");
@@ -14234,7 +14252,7 @@ function AllOfSchema(props) {
14234
14252
  };
14235
14253
  const [models, setModels] = (0, import_react32.useState)(splitModel(props.model, props.schema.allOf));
14236
14254
  return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
14237
- props.schema.title && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components44.Header, { title: props.schema.title }),
14255
+ props.schema.title && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_components45.Header, { title: props.schema.title }),
14238
14256
  props.schema.description && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("p", { children: props.schema.description }),
14239
14257
  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
14240
14258
  // eslint-disable-next-line react/no-array-index-key
@@ -14262,12 +14280,12 @@ AllOfSchema.defaultProps = {
14262
14280
  var AllOfSchema_default = AllOfSchema;
14263
14281
 
14264
14282
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/MultipleFileUploadSchema.tsx
14265
- var import_components46 = require("@transferwise/components");
14283
+ var import_components47 = require("@transferwise/components");
14266
14284
  var import_classnames8 = __toESM(require_classnames());
14267
14285
  var import_react33 = require("react");
14268
14286
 
14269
14287
  // src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
14270
- var import_components45 = require("@transferwise/components");
14288
+ var import_components46 = require("@transferwise/components");
14271
14289
  var import_formatting2 = require("@transferwise/formatting");
14272
14290
  var import_react_intl20 = require("react-intl");
14273
14291
  var import_jsx_runtime77 = require("react/jsx-runtime");
@@ -14280,9 +14298,9 @@ function ControlFeedback(props) {
14280
14298
  const isDescriptionVisible = props.schema.type !== "boolean" && props.schema.description && !isErrorVisible && !isValidationVisible;
14281
14299
  const hasInfoMessage = Boolean(props.infoMessage);
14282
14300
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { id: props.id, children: [
14283
- isErrorVisible ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components45.InlineAlert, { type: "error", children: props.errors }) : null,
14284
- isValidationVisible ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components45.InlineAlert, { type: "error", children: props.validations.map((validation) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { children: validationMessages[validation] }, validation)) }) : null,
14285
- (isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_components45.InlineAlert, { type: "info", children: [
14301
+ isErrorVisible ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components46.InlineAlert, { type: "error", children: props.errors }) : null,
14302
+ isValidationVisible ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components46.InlineAlert, { type: "error", children: props.validations.map((validation) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { children: validationMessages[validation] }, validation)) }) : null,
14303
+ (isDescriptionVisible || hasInfoMessage) && /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_components46.InlineAlert, { type: "info", children: [
14286
14304
  isDescriptionVisible && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { children: props.schema.description }),
14287
14305
  hasInfoMessage && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { children: props.infoMessage })
14288
14306
  ] })
@@ -14474,7 +14492,7 @@ function MultipleFileUploadSchema(props) {
14474
14492
  const feedbackId = `${uid}-feedback`;
14475
14493
  return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: (0, import_classnames8.default)("form-group", { "has-error": showError }), children: [
14476
14494
  /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("label", { className: "d-block control-label", htmlFor: uid, children: props.schema.title }),
14477
- /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components46.UploadInput, __spreadValues({}, uploadInputProps)) }),
14495
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { "aria-describedby": feedbackId, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_components47.UploadInput, __spreadValues({}, uploadInputProps)) }),
14478
14496
  /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
14479
14497
  ControlFeedback_default,
14480
14498
  {
@@ -14505,7 +14523,7 @@ function getSuccessfullyProcessedFiles(allFiles) {
14505
14523
  return allFiles.filter((file) => !file.error && file.status === "succeeded");
14506
14524
  }
14507
14525
  function convertFileIdsToComponentFileObjects(fileIds) {
14508
- return fileIds.map((id) => isValidId(id) ? { id, status: import_components46.Status.SUCCEEDED } : null).filter((item) => item !== null);
14526
+ return fileIds.map((id) => isValidId(id) ? { id, status: import_components47.Status.SUCCEEDED } : null).filter((item) => item !== null);
14509
14527
  }
14510
14528
  function isValidId(id) {
14511
14529
  return isNumber3(id) || isString2(id);
@@ -14516,13 +14534,13 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
14516
14534
  }
14517
14535
 
14518
14536
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
14519
- var import_components48 = require("@transferwise/components");
14537
+ var import_components49 = require("@transferwise/components");
14520
14538
  var import_classnames9 = __toESM(require_classnames());
14521
14539
  var import_react34 = require("react");
14522
14540
  var import_react_intl23 = require("react-intl");
14523
14541
 
14524
14542
  // src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
14525
- var import_components47 = require("@transferwise/components");
14543
+ var import_components48 = require("@transferwise/components");
14526
14544
  var import_jsx_runtime79 = require("react/jsx-runtime");
14527
14545
  var mapConstSchemaToOption = (schema, controlType) => {
14528
14546
  switch (controlType) {
@@ -14574,17 +14592,17 @@ var getIconPropertyForSelectOption = (icon) => {
14574
14592
  var getAvatarPropertyForRadioOption = ({ image, icon }) => {
14575
14593
  if (image == null ? void 0 : image.url) {
14576
14594
  return {
14577
- avatar: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components47.Avatar, { type: import_components47.AvatarType.THUMBNAIL, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("img", { src: image.url, alt: "" }) })
14595
+ avatar: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components48.Avatar, { type: import_components48.AvatarType.THUMBNAIL, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("img", { src: image.url, alt: "" }) })
14578
14596
  };
14579
14597
  }
14580
14598
  if ((icon == null ? void 0 : icon.name) && isValidIconName(icon.name)) {
14581
14599
  return {
14582
- avatar: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components47.Avatar, { type: import_components47.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(DynamicIcon_default2, { type: icon.name }) })
14600
+ avatar: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components48.Avatar, { type: import_components48.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(DynamicIcon_default2, { type: icon.name }) })
14583
14601
  };
14584
14602
  }
14585
14603
  if (icon == null ? void 0 : icon.text) {
14586
14604
  return {
14587
- avatar: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components47.Avatar, { type: import_components47.AvatarType.INITIALS, children: icon.text })
14605
+ avatar: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_components48.Avatar, { type: import_components48.AvatarType.INITIALS, children: icon.text })
14588
14606
  };
14589
14607
  }
14590
14608
  return null;
@@ -14668,7 +14686,7 @@ function MultiSelectSchema({
14668
14686
  return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: (0, import_classnames9.default)("d-flex flex-column", formGroupClasses), children: [
14669
14687
  schema.title ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("label", { htmlFor: id, children: schema.title }) : void 0,
14670
14688
  /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
14671
- import_components48.SelectInput,
14689
+ import_components49.SelectInput,
14672
14690
  {
14673
14691
  id,
14674
14692
  multiple: true,
@@ -14693,7 +14711,7 @@ function MultiSelectSchema({
14693
14711
  if (withinTrigger) {
14694
14712
  return selected && index === selected[0] ? getFormattedMessage() : void 0;
14695
14713
  }
14696
- return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components48.SelectInputOptionContent, { title: label, note: note != null ? note : secondary, icon });
14714
+ return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components49.SelectInputOptionContent, { title: label, note: note != null ? note : secondary, icon });
14697
14715
  },
14698
14716
  onChange: broadcastModelChange
14699
14717
  }
@@ -14723,17 +14741,17 @@ var getInitialModelIndices2 = (model, options) => {
14723
14741
  };
14724
14742
 
14725
14743
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
14726
- var import_components50 = require("@transferwise/components");
14744
+ var import_components51 = require("@transferwise/components");
14727
14745
  var import_icons4 = require("@transferwise/icons");
14728
14746
  var import_react36 = require("react");
14729
14747
  var import_react_intl25 = require("react-intl");
14730
14748
 
14731
14749
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
14732
- var import_components49 = require("@transferwise/components");
14750
+ var import_components50 = require("@transferwise/components");
14733
14751
  var import_jsx_runtime81 = require("react/jsx-runtime");
14734
14752
  function ItemSummaryOption2({ item, onClick }) {
14735
14753
  return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
14736
- import_components49.NavigationOption,
14754
+ import_components50.NavigationOption,
14737
14755
  {
14738
14756
  media: getNavigationOptionMedia(item),
14739
14757
  title: item.title,
@@ -15079,7 +15097,7 @@ function RepeatableSchema({
15079
15097
  "has-error": (_a = errors && !isEmpty(errors)) != null ? _a : submitted && validations.length
15080
15098
  };
15081
15099
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { id, className: (0, import_classnames10.default)(formGroupClasses), children: [
15082
- schema.title && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_components50.Header, { title: schema.title }),
15100
+ schema.title && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_components51.Header, { title: schema.title }),
15083
15101
  itemSummaries == null ? void 0 : itemSummaries.map((itemSummary) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
15084
15102
  ItemSummaryOption2,
15085
15103
  {
@@ -15089,7 +15107,7 @@ function RepeatableSchema({
15089
15107
  JSON.stringify(itemSummary)
15090
15108
  )),
15091
15109
  /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
15092
- import_components50.NavigationOption,
15110
+ import_components51.NavigationOption,
15093
15111
  {
15094
15112
  media: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_icons4.Plus, {}),
15095
15113
  title: schema.addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
@@ -15098,7 +15116,7 @@ function RepeatableSchema({
15098
15116
  }
15099
15117
  ),
15100
15118
  /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
15101
- import_components50.Modal,
15119
+ import_components51.Modal,
15102
15120
  {
15103
15121
  open: openModalType !== null,
15104
15122
  title: (openModalType === "add" ? schema.addItemTitle : schema.editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
@@ -15194,7 +15212,7 @@ ArraySchema.defaultProps = {
15194
15212
  var ArraySchema_default = ArraySchema;
15195
15213
 
15196
15214
  // src/legacy/jsonSchemaForm/objectSchema/ObjectSchema.tsx
15197
- var import_components51 = require("@transferwise/components");
15215
+ var import_components52 = require("@transferwise/components");
15198
15216
  var import_classnames11 = __toESM(require_classnames());
15199
15217
  var import_react37 = require("react");
15200
15218
  var import_jsx_runtime86 = require("react/jsx-runtime");
@@ -15236,7 +15254,7 @@ function ObjectSchema(props) {
15236
15254
  return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
15237
15255
  props.schema.alert && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(DynamicAlert_default, { component: props.schema.alert }),
15238
15256
  /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("fieldset", { children: [
15239
- props.schema.title && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_components51.Header, { title: props.schema.title, as: "legend" }),
15257
+ props.schema.title && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_components52.Header, { title: props.schema.title, as: "legend" }),
15240
15258
  props.schema.description && !props.hideTitle && /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("p", { children: [
15241
15259
  " ",
15242
15260
  props.schema.description,
@@ -15274,21 +15292,21 @@ ObjectSchema.defaultProps = {
15274
15292
  var ObjectSchema_default = ObjectSchema;
15275
15293
 
15276
15294
  // src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
15277
- var import_components54 = require("@transferwise/components");
15295
+ var import_components55 = require("@transferwise/components");
15278
15296
  var import_classnames12 = __toESM(require_classnames());
15279
15297
  var import_react40 = require("react");
15280
15298
 
15281
15299
  // src/legacy/jsonSchemaForm/help/Help.tsx
15282
- var import_components52 = require("@transferwise/components");
15300
+ var import_components53 = require("@transferwise/components");
15283
15301
  var import_react_intl26 = require("react-intl");
15284
15302
  var import_jsx_runtime87 = require("react/jsx-runtime");
15285
15303
  function Help2(props) {
15286
15304
  const intl = (0, import_react_intl26.useIntl)();
15287
15305
  return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
15288
- import_components52.Info,
15306
+ import_components53.Info,
15289
15307
  {
15290
15308
  className: "m-l-1",
15291
- content: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_components52.Markdown, { config: { link: { target: "_blank" } }, children: props.help.markdown }),
15309
+ content: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_components53.Markdown, { config: { link: { target: "_blank" } }, children: props.help.markdown }),
15292
15310
  presentation: "POPOVER",
15293
15311
  size: "sm",
15294
15312
  "aria-label": intl.formatMessage(help_messages_default.helpAria)
@@ -15301,7 +15319,7 @@ var Help_default2 = Help2;
15301
15319
  var import_react39 = require("react");
15302
15320
 
15303
15321
  // src/legacy/formControl/FormControl.tsx
15304
- var import_components53 = require("@transferwise/components");
15322
+ var import_components54 = require("@transferwise/components");
15305
15323
  var import_react38 = require("react");
15306
15324
 
15307
15325
  // src/legacy/formControl/utils/value-utils.ts
@@ -15577,7 +15595,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
15577
15595
  switch (type) {
15578
15596
  case FormControlType.RADIO:
15579
15597
  return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
15580
- import_components53.RadioGroup,
15598
+ import_components54.RadioGroup,
15581
15599
  {
15582
15600
  radios: options.map(this.mapOption),
15583
15601
  name,
@@ -15587,7 +15605,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
15587
15605
  );
15588
15606
  case FormControlType.CHECKBOX:
15589
15607
  return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
15590
- import_components53.Checkbox,
15608
+ import_components54.Checkbox,
15591
15609
  {
15592
15610
  checked: getSafeBooleanValue(value, { coerceValue: true }),
15593
15611
  disabled,
@@ -15605,7 +15623,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
15605
15623
  const items = options;
15606
15624
  const selected = this.getSelectedOption(options);
15607
15625
  return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "d-flex flex-column", children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
15608
- import_components53.SelectInput,
15626
+ import_components54.SelectInput,
15609
15627
  {
15610
15628
  id,
15611
15629
  items: items.map((value2) => ({
@@ -15615,7 +15633,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
15615
15633
  })),
15616
15634
  value: selected != null ? selected : null,
15617
15635
  renderValue: ({ hideIconInTrigger, icon, label: label2, note, secondary }, withinTrigger) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
15618
- import_components53.SelectInputOptionContent,
15636
+ import_components54.SelectInputOptionContent,
15619
15637
  {
15620
15638
  title: label2,
15621
15639
  note: withinTrigger ? note != null ? note : secondary : note,
@@ -15644,7 +15662,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
15644
15662
  }
15645
15663
  case FormControlType.TAB:
15646
15664
  return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
15647
- import_components53.Tabs,
15665
+ import_components54.Tabs,
15648
15666
  {
15649
15667
  selected: ((_a = this.getSelectedOption(options)) == null ? void 0 : _a.value) || 0,
15650
15668
  tabs: options.map((option) => ({
@@ -15729,7 +15747,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
15729
15747
  case FormControlType.DATE:
15730
15748
  case FormControlType.DATETIME:
15731
15749
  return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
15732
- import_components53.DateInput,
15750
+ import_components54.DateInput,
15733
15751
  {
15734
15752
  dayAutoComplete: this.getAutocompleteValue({ suffix: "-day" }),
15735
15753
  yearAutoComplete: this.getAutocompleteValue({ suffix: "-year" }),
@@ -15745,7 +15763,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
15745
15763
  );
15746
15764
  case FormControlType.DATELOOKUP: {
15747
15765
  return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
15748
- import_components53.DateLookup,
15766
+ import_components54.DateLookup,
15749
15767
  {
15750
15768
  value: getSafeDateStringValue(value),
15751
15769
  min: minDate,
@@ -15763,7 +15781,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
15763
15781
  }
15764
15782
  case FormControlType.TEL:
15765
15783
  return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
15766
- import_components53.PhoneNumberInput,
15784
+ import_components54.PhoneNumberInput,
15767
15785
  {
15768
15786
  disabled,
15769
15787
  countryCode,
@@ -15795,7 +15813,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
15795
15813
  };
15796
15814
  if (this.props.displayPattern) {
15797
15815
  return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
15798
- import_components53.TextareaWithDisplayFormat,
15816
+ import_components54.TextareaWithDisplayFormat,
15799
15817
  __spreadProps(__spreadValues({
15800
15818
  displayPattern: this.props.displayPattern
15801
15819
  }, textareaProps), {
@@ -15817,7 +15835,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
15817
15835
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
15818
15836
  // @ts-expect-error - TODO: Remove this once Upload is migrated to TypeScript
15819
15837
  /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
15820
- import_components53.Upload,
15838
+ import_components54.Upload,
15821
15839
  __spreadProps(__spreadValues({}, uploadProps), {
15822
15840
  usAccept: uploadProps.usAccept || "*",
15823
15841
  usDisabled: uploadProps.usDisabled || disabled,
@@ -15855,7 +15873,7 @@ var _FormControl = class _FormControl extends import_react38.PureComponent {
15855
15873
  };
15856
15874
  if (this.props.displayPattern) {
15857
15875
  return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
15858
- import_components53.InputWithDisplayFormat,
15876
+ import_components54.InputWithDisplayFormat,
15859
15877
  __spreadProps(__spreadValues({
15860
15878
  displayPattern: this.props.displayPattern
15861
15879
  }, inputProps), {
@@ -16185,7 +16203,7 @@ function getTitleAndHelp(schema, forId) {
16185
16203
  schema.title,
16186
16204
  " ",
16187
16205
  helpElement
16188
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_components54.Header, { title: (_a = schema.title) != null ? _a : "" }) });
16206
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_components55.Header, { title: (_a = schema.title) != null ? _a : "" }) });
16189
16207
  return schema.title ? titleElement : helpElement;
16190
16208
  }
16191
16209
  function getValidations(props, schemaIndex) {
@@ -16225,7 +16243,7 @@ var import_classnames13 = __toESM(require_classnames());
16225
16243
  var import_react42 = require("react");
16226
16244
 
16227
16245
  // src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
16228
- var import_components55 = require("@transferwise/components");
16246
+ var import_components56 = require("@transferwise/components");
16229
16247
  var import_react41 = require("react");
16230
16248
  var import_jsx_runtime91 = require("react/jsx-runtime");
16231
16249
  function UploadInputAdapter(props) {
@@ -16243,7 +16261,7 @@ function UploadInputAdapter(props) {
16243
16261
  onCancel
16244
16262
  } = props;
16245
16263
  const onEvent = useEventDispatcher();
16246
- const files = (0, import_react41.useMemo)(() => fileId ? [{ id: fileId, status: import_components55.Status.SUCCEEDED }] : [], [fileId]);
16264
+ const files = (0, import_react41.useMemo)(() => fileId ? [{ id: fileId, status: import_components56.Status.SUCCEEDED }] : [], [fileId]);
16247
16265
  const uploadFile = (formData) => {
16248
16266
  onEvent("Dynamic Flow - PersistAsync", { status: "pending", schemaId: id });
16249
16267
  return httpClient(String(httpOptions.url), {
@@ -16261,7 +16279,7 @@ function UploadInputAdapter(props) {
16261
16279
  });
16262
16280
  };
16263
16281
  return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
16264
- import_components55.UploadInput,
16282
+ import_components56.UploadInput,
16265
16283
  {
16266
16284
  id,
16267
16285
  fileInputName: httpOptions.fileInputName,
@@ -16399,7 +16417,7 @@ var getSelectionFromModel = (schema, model) => {
16399
16417
  };
16400
16418
 
16401
16419
  // src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.tsx
16402
- var import_components56 = require("@transferwise/components");
16420
+ var import_components57 = require("@transferwise/components");
16403
16421
  var import_jsx_runtime94 = require("react/jsx-runtime");
16404
16422
  var PromotedOneOfCheckboxControl = (props) => {
16405
16423
  const { id, selection, setSelection } = props;
@@ -16411,13 +16429,13 @@ var PromotedOneOfCheckboxControl = (props) => {
16411
16429
  const toggleSelection = () => {
16412
16430
  setSelection(checked ? selectionWhenUnchecked : selectionWhenChecked);
16413
16431
  };
16414
- return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_components56.Checkbox, { id, label: title, checked, onChange: toggleSelection }) });
16432
+ return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_components57.Checkbox, { id, label: title, checked, onChange: toggleSelection }) });
16415
16433
  };
16416
16434
  PromotedOneOfCheckboxControl.defaultProps = {};
16417
16435
  var PromotedOneOfCheckboxControl_default = PromotedOneOfCheckboxControl;
16418
16436
 
16419
16437
  // src/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.tsx
16420
- var import_components57 = require("@transferwise/components");
16438
+ var import_components58 = require("@transferwise/components");
16421
16439
  var import_jsx_runtime95 = require("react/jsx-runtime");
16422
16440
  function PromotedOneOfRadioControl(props) {
16423
16441
  var _a, _b;
@@ -16438,7 +16456,7 @@ function PromotedOneOfRadioControl(props) {
16438
16456
  return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "form-group", children: [
16439
16457
  title && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("label", { className: "control-label", htmlFor: id, children: title }),
16440
16458
  /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
16441
- import_components57.RadioGroup,
16459
+ import_components58.RadioGroup,
16442
16460
  {
16443
16461
  name: "promoted-selection",
16444
16462
  selectedValue: selection,
@@ -16529,7 +16547,7 @@ function getOtherOneOf(schema) {
16529
16547
  var PromotedOneOfSchema_default = PromotedOneOfSchema;
16530
16548
 
16531
16549
  // src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
16532
- var import_components58 = require("@transferwise/components");
16550
+ var import_components59 = require("@transferwise/components");
16533
16551
  var import_react_intl28 = require("react-intl");
16534
16552
 
16535
16553
  // src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.ts
@@ -16553,7 +16571,7 @@ function ReadOnlySchema({ schema, model }) {
16553
16571
  const { title = "" } = schema;
16554
16572
  const { formatMessage } = (0, import_react_intl28.useIntl)();
16555
16573
  const value = getValueForSchema({ schema, model, formatMessage });
16556
- return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_components58.DefinitionList, { layout: import_components58.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
16574
+ return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_components59.DefinitionList, { layout: import_components59.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
16557
16575
  }
16558
16576
  var ReadOnlySchema_default = ReadOnlySchema;
16559
16577
  function getValueForSchema({
@@ -16778,7 +16796,7 @@ function DynamicForm({
16778
16796
  var DynamicForm_default = DynamicForm;
16779
16797
 
16780
16798
  // src/legacy/layout/heading/DynamicHeading.tsx
16781
- var import_components59 = require("@transferwise/components");
16799
+ var import_components60 = require("@transferwise/components");
16782
16800
  var import_classnames14 = __toESM(require_classnames());
16783
16801
  var import_jsx_runtime102 = require("react/jsx-runtime");
16784
16802
  var DynamicHeading = (props) => {
@@ -16805,30 +16823,30 @@ var DisplayHeading2 = ({ size, text, classes }) => {
16805
16823
  switch (size) {
16806
16824
  case "xs":
16807
16825
  case "sm":
16808
- return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_components59.Display, { type: "display-small", className: classes, children: text });
16826
+ return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_components60.Display, { type: "display-small", className: classes, children: text });
16809
16827
  case "xl":
16810
16828
  case "lg":
16811
- return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_components59.Display, { type: "display-large", className: classes, children: text });
16829
+ return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_components60.Display, { type: "display-large", className: classes, children: text });
16812
16830
  case "md":
16813
16831
  default:
16814
- return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_components59.Display, { type: "display-medium", className: classes, children: text });
16832
+ return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_components60.Display, { type: "display-medium", className: classes, children: text });
16815
16833
  }
16816
16834
  };
16817
16835
  var DynamicHeading_default = DynamicHeading;
16818
16836
 
16819
16837
  // src/legacy/layout/markdown/DynamicMarkdown.tsx
16820
- var import_components60 = require("@transferwise/components");
16838
+ var import_components61 = require("@transferwise/components");
16821
16839
  var import_jsx_runtime103 = require("react/jsx-runtime");
16822
16840
  var DynamicMarkdown = ({ component }) => {
16823
16841
  const { content, align, margin } = component;
16824
- return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: getTextAlignmentAndMargin2({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_components60.Markdown, { config: { link: { target: "_blank" } }, children: content }) });
16842
+ return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: getTextAlignmentAndMargin2({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_components61.Markdown, { config: { link: { target: "_blank" } }, children: content }) });
16825
16843
  };
16826
16844
  var DynamicInfo = ({ component }) => {
16827
- return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: getTextAlignmentAndMargin2(component), children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_components60.Markdown, { config: { link: { target: "_blank" } }, children: component.markdown }) });
16845
+ return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: getTextAlignmentAndMargin2(component), children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_components61.Markdown, { config: { link: { target: "_blank" } }, children: component.markdown }) });
16828
16846
  };
16829
16847
 
16830
16848
  // src/legacy/layout/image/DynamicImage.tsx
16831
- var import_components61 = require("@transferwise/components");
16849
+ var import_components62 = require("@transferwise/components");
16832
16850
  var import_react47 = require("react");
16833
16851
  var import_jsx_runtime104 = require("react/jsx-runtime");
16834
16852
  function DynamicImage({ component: image }) {
@@ -16847,7 +16865,7 @@ function DynamicImage({ component: image }) {
16847
16865
  if (!imageSource) {
16848
16866
  return null;
16849
16867
  }
16850
- return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_components61.Image, __spreadValues({ className: `img-responsive ${getMargin2(margin || "md")}` }, imageProps)) });
16868
+ return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_components62.Image, __spreadValues({ className: `img-responsive ${getMargin2(margin || "md")}` }, imageProps)) });
16851
16869
  }
16852
16870
  var readImageBlobAsDataURL2 = (imageBlob) => (
16853
16871
  // we can safely assume the type of reader.result is string
@@ -16883,7 +16901,7 @@ var getImageSource2 = async (httpClient, imageUrl) => {
16883
16901
  var DynamicImage_default = DynamicImage;
16884
16902
 
16885
16903
  // src/legacy/layout/instructions/DynamicInstructions.tsx
16886
- var import_components62 = require("@transferwise/components");
16904
+ var import_components63 = require("@transferwise/components");
16887
16905
  var import_jsx_runtime105 = require("react/jsx-runtime");
16888
16906
  var doContext2 = ["positive", "neutral"];
16889
16907
  var dontContext2 = ["warning", "negative"];
@@ -16892,8 +16910,8 @@ var DynamicInstructions = ({ component }) => {
16892
16910
  const dos = items.filter((item) => doContext2.includes(item.context)).map(({ text }) => text);
16893
16911
  const donts = items.filter((item) => dontContext2.includes(item.context)).map(({ text }) => text);
16894
16912
  return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: getMargin2(component.margin || "md"), children: [
16895
- component.title ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_components62.Header, { title: component.title }) : null,
16896
- /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_components62.InstructionsList, { dos, donts })
16913
+ component.title ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_components63.Header, { title: component.title }) : null,
16914
+ /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_components63.InstructionsList, { dos, donts })
16897
16915
  ] });
16898
16916
  };
16899
16917
  var DynamicInstructions_default = DynamicInstructions;
@@ -17003,11 +17021,11 @@ function DynamicLayout(props) {
17003
17021
  var DynamicLayout_default = DynamicLayout;
17004
17022
 
17005
17023
  // src/legacy/layout/list/DynamicStatusList.tsx
17006
- var import_components63 = require("@transferwise/components");
17024
+ var import_components64 = require("@transferwise/components");
17007
17025
  var import_jsx_runtime107 = require("react/jsx-runtime");
17008
17026
  var DynamicStatusList = ({ component }) => {
17009
17027
  return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: getMargin2(component.margin || "md"), children: [
17010
- component.title ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_components63.Header, { title: component.title }) : null,
17028
+ component.title ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_components64.Header, { title: component.title }) : null,
17011
17029
  component.items.map(mapListItemToSummary)
17012
17030
  ] });
17013
17031
  };
@@ -17017,7 +17035,7 @@ var mapListItemToSummary = ({ title, description, icon, status }) => {
17017
17035
  title,
17018
17036
  description
17019
17037
  }, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(DynamicIcon_default2, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
17020
- return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_components63.Summary, __spreadValues({}, props));
17038
+ return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_components64.Summary, __spreadValues({}, props));
17021
17039
  };
17022
17040
  var statusListMap = {
17023
17041
  done: "done",
@@ -17033,12 +17051,12 @@ var statusMap = __spreadValues(__spreadValues({}, statusListMap), legacyStatusMa
17033
17051
  var DynamicStatusList_default = DynamicStatusList;
17034
17052
 
17035
17053
  // src/legacy/layout/loadingIndicator/DynamicLoadingIndicator.tsx
17036
- var import_components64 = require("@transferwise/components");
17054
+ var import_components65 = require("@transferwise/components");
17037
17055
  var import_jsx_runtime108 = require("react/jsx-runtime");
17038
17056
  var DynamicLoadingIndicator = ({ component }) => {
17039
17057
  const { margin = "md", size = "md" } = component;
17040
17058
  return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
17041
- import_components64.Loader,
17059
+ import_components65.Loader,
17042
17060
  {
17043
17061
  size,
17044
17062
  classNames: {
@@ -17051,14 +17069,14 @@ var DynamicLoadingIndicator = ({ component }) => {
17051
17069
  var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
17052
17070
 
17053
17071
  // src/legacy/layout/paragraph/DynamicParagraph.tsx
17054
- var import_components66 = require("@transferwise/components");
17072
+ var import_components67 = require("@transferwise/components");
17055
17073
  var import_react_intl29 = require("react-intl");
17056
17074
 
17057
17075
  // src/legacy/layout/paragraph/useSnackBarIfAvailable.ts
17058
- var import_components65 = require("@transferwise/components");
17076
+ var import_components66 = require("@transferwise/components");
17059
17077
  var import_react48 = require("react");
17060
17078
  function useSnackBarIfAvailable2() {
17061
- const context = (0, import_react48.useContext)(import_components65.SnackbarContext);
17079
+ const context = (0, import_react48.useContext)(import_components66.SnackbarContext);
17062
17080
  return context ? context.createSnackbar : noop3;
17063
17081
  }
17064
17082
  function noop3() {
@@ -17099,7 +17117,7 @@ function CopyableDynamicParagraph({ component }) {
17099
17117
  style: { textOverflow: "ellipsis" }
17100
17118
  }
17101
17119
  ),
17102
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_components66.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
17120
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_components67.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
17103
17121
  ] });
17104
17122
  }
17105
17123
  function noop4() {
@@ -17107,7 +17125,7 @@ function noop4() {
17107
17125
  var DynamicParagraph_default = DynamicParagraph;
17108
17126
 
17109
17127
  // src/legacy/layout/review/DynamicReview.tsx
17110
- var import_components67 = require("@transferwise/components");
17128
+ var import_components68 = require("@transferwise/components");
17111
17129
  var import_jsx_runtime110 = require("react/jsx-runtime");
17112
17130
  var getDefinitions = (orientation, review) => review.fields.map(({ label, value, help }, index) => ({
17113
17131
  key: String(index),
@@ -17128,9 +17146,21 @@ var getFieldValue2 = (value, help, orientation) => {
17128
17146
  }
17129
17147
  return value;
17130
17148
  };
17131
- var getReviewLayout = (review) => {
17149
+ var getDefinitionListLayout = (review) => {
17132
17150
  const orientation = review.control || review.orientation;
17133
- return orientation === "horizontal" ? "HORIZONTAL_RIGHT_ALIGNED" : "VERTICAL_ONE_COLUMN";
17151
+ switch (orientation) {
17152
+ case "horizontal":
17153
+ case "horizontal-end-aligned":
17154
+ return "HORIZONTAL_RIGHT_ALIGNED";
17155
+ case "horizontal-start-aligned":
17156
+ return "HORIZONTAL_LEFT_ALIGNED";
17157
+ case "vertical-two-column":
17158
+ return "VERTICAL_TWO_COLUMN";
17159
+ case "vertical":
17160
+ case "vertical-one-column":
17161
+ default:
17162
+ return "VERTICAL_ONE_COLUMN";
17163
+ }
17134
17164
  };
17135
17165
  function DynamicReview(props) {
17136
17166
  const review = props.component;
@@ -17145,12 +17175,12 @@ function DynamicReview(props) {
17145
17175
  }
17146
17176
  }
17147
17177
  });
17148
- const orientation = getReviewLayout(review);
17178
+ const orientation = getDefinitionListLayout(review);
17149
17179
  const callToAction = review.callToAction ? getReviewAction2(review.callToAction.title, review.callToAction.action) : null;
17150
17180
  const legacyCallToAction = !callToAction && review.action ? getReviewAction2(review.action.title || "", review.action) : null;
17151
17181
  return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: margin, children: [
17152
- review.title && /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_components67.Header, { title: review.title, action: callToAction || legacyCallToAction || void 0 }),
17153
- /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_components67.DefinitionList, { layout: orientation, definitions: getDefinitions(orientation, review) }) })
17182
+ review.title && /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_components68.Header, { title: review.title, action: callToAction || legacyCallToAction || void 0 }),
17183
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_components68.DefinitionList, { layout: orientation, definitions: getDefinitions(orientation, review) }) })
17154
17184
  ] });
17155
17185
  }
17156
17186
  var DynamicReview_default = DynamicReview;
@@ -17160,13 +17190,13 @@ var import_react50 = require("react");
17160
17190
  var import_icons5 = require("@transferwise/icons");
17161
17191
 
17162
17192
  // src/legacy/layout/search/SearchInput.tsx
17163
- var import_components68 = require("@transferwise/components");
17193
+ var import_components69 = require("@transferwise/components");
17164
17194
  var import_jsx_runtime111 = require("react/jsx-runtime");
17165
17195
  var SearchInput = ({ title, value, onFocus, onChange }) => {
17166
17196
  return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("label", { className: "control-label d-inline", children: [
17167
17197
  title,
17168
17198
  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
17169
- import_components68.Input,
17199
+ import_components69.Input,
17170
17200
  {
17171
17201
  type: "text",
17172
17202
  value,
@@ -17179,15 +17209,15 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
17179
17209
  };
17180
17210
 
17181
17211
  // src/legacy/layout/search/SearchResults.tsx
17182
- var import_components69 = require("@transferwise/components");
17212
+ var import_components70 = require("@transferwise/components");
17183
17213
  var import_react_intl30 = require("react-intl");
17184
17214
  var import_jsx_runtime112 = require("react/jsx-runtime");
17185
17215
  function SearchResults2({ results, emptyMessage, onSelect }) {
17186
17216
  if (results.length === 0) {
17187
17217
  return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("p", { className: "m-t-2", children: emptyMessage });
17188
17218
  }
17189
- return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_components69.NavigationOptionsList, { children: results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
17190
- import_components69.NavigationOption,
17219
+ return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_components70.NavigationOptionsList, { children: results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
17220
+ import_components70.NavigationOption,
17191
17221
  {
17192
17222
  title: result.title,
17193
17223
  content: result.description,
@@ -17288,7 +17318,7 @@ var addQueryParameter2 = (url, key, value) => {
17288
17318
  };
17289
17319
 
17290
17320
  // src/legacy/layout/search/DynamicSearch.tsx
17291
- var import_components70 = require("@transferwise/components");
17321
+ var import_components71 = require("@transferwise/components");
17292
17322
  var import_classnames15 = __toESM(require_classnames());
17293
17323
  var import_jsx_runtime113 = require("react/jsx-runtime");
17294
17324
  var DEBOUNCE_TIME2 = 400;
@@ -17329,7 +17359,7 @@ function DynamicSearch({ component, onAction }) {
17329
17359
  return /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: (0, import_classnames15.default)(getMargin2(margin != null ? margin : "md"), "df-search-typeahead"), children: /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)("label", { className: "control-label d-inline", children: [
17330
17360
  title,
17331
17361
  /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: "m-t-1", children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
17332
- import_components70.Typeahead,
17362
+ import_components71.Typeahead,
17333
17363
  {
17334
17364
  id: "typeahead-input-id",
17335
17365
  name: "typeahead-input-name",
@@ -17384,7 +17414,7 @@ function TypeaheadFooter2({
17384
17414
  emptyMessage
17385
17415
  }) {
17386
17416
  if (state === "success" && results.length === 0) {
17387
- return /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_components70.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: emptyMessage });
17417
+ return /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_components71.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: emptyMessage });
17388
17418
  }
17389
17419
  if (state === "error" && results.length === 0) {
17390
17420
  return /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(ErrorResult2, { onRetrySearch }) });
@@ -17397,7 +17427,7 @@ function TypeaheadFooter2({
17397
17427
  var DynamicSearch_default = DynamicSearch;
17398
17428
 
17399
17429
  // src/legacy/layout/modal/DynamicModal.tsx
17400
- var import_components71 = require("@transferwise/components");
17430
+ var import_components72 = require("@transferwise/components");
17401
17431
  var import_react51 = require("react");
17402
17432
  var import_jsx_runtime114 = require("react/jsx-runtime");
17403
17433
  function DynamicModal(props) {
@@ -17405,9 +17435,9 @@ function DynamicModal(props) {
17405
17435
  const { component, onAction } = props;
17406
17436
  const { margin = "md" } = component;
17407
17437
  return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("div", { className: getTextAlignmentAndMargin2({ margin }), children: [
17408
- /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_components71.Button, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
17438
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_components72.Button, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
17409
17439
  /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
17410
- import_components71.Modal,
17440
+ import_components72.Modal,
17411
17441
  {
17412
17442
  scroll: "content",
17413
17443
  open: visible,
@@ -17960,7 +17990,7 @@ var CameraCapture_messages_default = (0, import_react_intl33.defineMessages)({
17960
17990
  });
17961
17991
 
17962
17992
  // src/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.tsx
17963
- var import_components72 = require("@transferwise/components");
17993
+ var import_components73 = require("@transferwise/components");
17964
17994
  var import_react_intl34 = require("react-intl");
17965
17995
  var import_jsx_runtime118 = require("react/jsx-runtime");
17966
17996
  var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(CaptureButton, { onClick: onCapture }) });
@@ -17971,24 +18001,24 @@ var ReviewBottomBar = ({
17971
18001
  const intl = (0, import_react_intl34.useIntl)();
17972
18002
  return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
17973
18003
  /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
17974
- import_components72.Button,
18004
+ import_components73.Button,
17975
18005
  {
17976
18006
  className: "m-b-1",
17977
18007
  block: true,
17978
- size: import_components72.Size.MEDIUM,
17979
- type: import_components72.ControlType.ACCENT,
18008
+ size: import_components73.Size.MEDIUM,
18009
+ type: import_components73.ControlType.ACCENT,
17980
18010
  onClick: onSubmit,
17981
18011
  children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
17982
18012
  }
17983
18013
  ),
17984
18014
  /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
17985
- import_components72.Button,
18015
+ import_components73.Button,
17986
18016
  {
17987
18017
  className: "m-b-2",
17988
18018
  block: true,
17989
- size: import_components72.Size.MEDIUM,
17990
- type: import_components72.ControlType.ACCENT,
17991
- priority: import_components72.Priority.SECONDARY,
18019
+ size: import_components73.Size.MEDIUM,
18020
+ type: import_components73.ControlType.ACCENT,
18021
+ priority: import_components73.Priority.SECONDARY,
17992
18022
  onClick: onRetry,
17993
18023
  children: intl.formatMessage(CameraCapture_messages_default.reviewRetry)
17994
18024
  }
@@ -18040,13 +18070,13 @@ function OrientationLockOverlay() {
18040
18070
  var OrientationLockOverlay_default = OrientationLockOverlay;
18041
18071
 
18042
18072
  // src/legacy/step/cameraStep/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
18043
- var import_components73 = require("@transferwise/components");
18073
+ var import_components74 = require("@transferwise/components");
18044
18074
  var import_jsx_runtime120 = require("react/jsx-runtime");
18045
18075
  function CameraErrorScreen({ title, description, actionButton, onAction }) {
18046
18076
  return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
18047
18077
  /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("h2", { className: "text-xs-center m-b-3", children: title }),
18048
18078
  /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("p", { className: "text-xs-center m-b-5", children: description }),
18049
- onAction && actionButton && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_components73.Button, { block: true, onClick: onAction, children: actionButton })
18079
+ onAction && actionButton && /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_components74.Button, { block: true, onClick: onAction, children: actionButton })
18050
18080
  ] }) }) });
18051
18081
  }
18052
18082
  var CameraErrorScreen_default = CameraErrorScreen;
@@ -18606,7 +18636,7 @@ function getOrigin2(url) {
18606
18636
  }
18607
18637
 
18608
18638
  // src/legacy/dynamicFlow/BackButton.tsx
18609
- var import_components75 = require("@transferwise/components");
18639
+ var import_components76 = require("@transferwise/components");
18610
18640
  var import_icons6 = require("@transferwise/icons");
18611
18641
  var import_jsx_runtime125 = require("react/jsx-runtime");
18612
18642
  function BackButton2({ title, action, onAction }) {
@@ -18622,7 +18652,7 @@ function BackButton2({ title, action, onAction }) {
18622
18652
  },
18623
18653
  children: [
18624
18654
  /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("span", { className: "sr-only", children: title }),
18625
- /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_components75.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_icons6.ArrowLeft, { size: "24" }) })
18655
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_components76.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_icons6.ArrowLeft, { size: "24" }) })
18626
18656
  ]
18627
18657
  }
18628
18658
  );
@@ -18799,19 +18829,19 @@ var getSchemaReference = (component) => {
18799
18829
  var isInlineSchema = (schema) => schema !== void 0 && typeof schema === "object" && !Object.hasOwnProperty.call(schema, "$ref");
18800
18830
 
18801
18831
  // src/legacy/dynamicFlow/utils/useLoader.tsx
18802
- var import_components76 = require("@transferwise/components");
18832
+ var import_components77 = require("@transferwise/components");
18803
18833
  var import_react65 = require("react");
18804
18834
  var import_jsx_runtime127 = require("react/jsx-runtime");
18805
18835
  function useLoader(loaderConfig, initialState) {
18806
18836
  const config = __spreadValues({
18807
- size: import_components76.Size.EXTRA_LARGE,
18837
+ size: import_components77.Size.EXTRA_LARGE,
18808
18838
  initial: true,
18809
18839
  submission: false
18810
18840
  }, loaderConfig);
18811
18841
  const [loadingState, setLoadingState] = (0, import_react65.useState)(initialState);
18812
18842
  const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
18813
18843
  const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
18814
- import_components76.Loader,
18844
+ import_components77.Loader,
18815
18845
  {
18816
18846
  size: config.size,
18817
18847
  classNames: { "tw-loader": "tw-loader m-x-auto" },