@wise/dynamic-flow-client-internal 3.0.0 → 3.0.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
@@ -92,7 +92,7 @@ var require_main_min = __commonJS({
92
92
  !Ea.call(e, o) && o !== r && ar(e, o, { get: () => t[o], enumerable: !(a = em(t, o)) || a.enumerable });
93
93
  return e;
94
94
  };
95
- var Ie = (e, t, r) => (r = e != null ? Zl(am(e)) : {}, yn(t || !e || !e.__esModule ? ar(r, "default", { value: e, enumerable: true }) : r, e));
95
+ var De = (e, t, r) => (r = e != null ? Zl(am(e)) : {}, yn(t || !e || !e.__esModule ? ar(r, "default", { value: e, enumerable: true }) : r, e));
96
96
  var nm = (e) => yn(ar({}, "__esModule", { value: true }), e);
97
97
  var et = ka((Oy, _r) => {
98
98
  "use strict";
@@ -153,7 +153,7 @@ var require_main_min = __commonJS({
153
153
  var aa;
154
154
  var Ud;
155
155
  var go;
156
- var _e;
156
+ var $e;
157
157
  var $g;
158
158
  var Wg;
159
159
  var ho;
@@ -173,8 +173,8 @@ var require_main_min = __commonJS({
173
173
  };
174
174
  (function(e) {
175
175
  e.SMALL = "small", e.MEDIUM = "medium", e.LARGE = "large";
176
- })(_e || (_e = {}));
177
- $g = { [_e.SMALL]: 200, [_e.MEDIUM]: 300, [_e.LARGE]: 500 }, Wg = { [_e.SMALL]: 200, [_e.MEDIUM]: 300, [_e.LARGE]: 500 };
176
+ })($e || ($e = {}));
177
+ $g = { [$e.SMALL]: 200, [$e.MEDIUM]: 300, [$e.LARGE]: 500 }, Wg = { [$e.SMALL]: 200, [$e.MEDIUM]: 300, [$e.LARGE]: 500 };
178
178
  (function(e) {
179
179
  e.BELL = "bell", e.BRIEFCASE = "briefcase", e.BUSINESS_CARD = "business-card", e.CALENDAR = "calendar", e.CHECK_MARK = "check-mark", e.CLOSED_WINDOW = "closed-window", e.COIN_PILE_DOWN = "coin-pile-down", e.COIN_PILE_UP = "coin-pile-up", e.CONFETTI = "confetti", e.CONSTRUCTION_FENCE = "construction-fence", e.CONVERT = "convert", e.COOKIE = "cookie", e.DIGITAL_CARD_2 = "digital-card-2", e.DIGITAL_CARD = "digital-card", e.DOCUMENTS = "documents", e.DOOR = "door", e.ECO_CARD = "eco-card", e.ELECTRIC_PLUG = "electric-plug", e.EMAIL_SUCCESS = "email-success", e.EMAIL = "email", e.EXCLAMATION_MARK = "exclamation-mark", e.FLAG = "flag", e.FLOWER = "flower", e.GEAR = "gear", e.GLOBE = "globe", e.GRAPH = "graph", e.HEART_2 = "heart-2", e.HEART_3 = "heart-3", e.HEART_4 = "heart-4", e.HEART_5 = "heart-5", e.HEART = "heart", e.HOUSE = "house", e.ID_CARD = "id-card", e.INFINITE = "infinite", e.INVITE_LETTER = "invite-letter", e.JARS = "jars", e.KEY = "key", e.LIGHT_BULB = "light-bulb", e.LOCK = "lock", e.MAGNIFYING_GLASS = "magnifying-glass", e.MAP = "map", e.MARBLE_CARD_BUSINESS = "marble-card-business", e.MARBLE_CARD = "marble-card", e.MARBLE = "marble", e.MEGAPHONE = "megaphone", e.MULTI_CURRENCY = "multi-currency", e.ONE_INVITE_LETTER_OPENED = "one-invite-letter-opened", e.PALM_TREE = "palm-tree", e.PERCENTAGE = "percentage", e.PERSONAL_CARD = "personal-card", e.PHONES = "phones", e.PIE_CHART = "pie-chart", e.PLANE_2 = "plane-2", e.PLANE = "plane", e.PUZZLE_PIECES = "puzzle-pieces", e.QUESTION_MARK = "question-mark", e.RECEIVE = "receive", e.REMINDER_LETTER = "reminder-letter", e.SAND_TIMER = "sand-timer", e.SHOPPING_BAG = "shopping-bag", e.SKIP_AUTHENTICATION = "skip-authentication", e.SPEECH_BUBBLE = "speech-bubble", e.TOOL = "tool", e.TWO_INVITE_LETTERS_OPENED = "two-invite-letters-opened", e.WALLET = "wallet";
180
180
  })(ho || (ho = {}));
@@ -365,8 +365,8 @@ var require_main_min = __commonJS({
365
365
  y.onUserMedia(l);
366
366
  }, f.prototype.render = function() {
367
367
  var m = this, l = this, y = l.state, g = l.props, C = g.audio, b = g.forceScreenshotSourceSize, w = g.disablePictureInPicture, v = g.onUserMedia, P = g.onUserMediaError, M = g.screenshotFormat, E = g.screenshotQuality, A = g.minScreenshotWidth, L = g.minScreenshotHeight, O = g.audioConstraints, B = g.videoConstraints, k = g.imageSmoothing, G = g.mirrored, H = g.style, x = H === void 0 ? {} : H, X = g.children, z = u(g, ["audio", "forceScreenshotSourceSize", "disablePictureInPicture", "onUserMedia", "onUserMediaError", "screenshotFormat", "screenshotQuality", "minScreenshotWidth", "minScreenshotHeight", "audioConstraints", "videoConstraints", "imageSmoothing", "mirrored", "style", "children"]), K = G ? c(c({}, x), { transform: (x.transform || "") + " scaleX(-1)" }) : x, ie = { getScreenshot: this.getScreenshot.bind(this) };
368
- return o.createElement(o.Fragment, null, o.createElement("video", c({ autoPlay: true, disablePictureInPicture: w, src: y.src, muted: !C, playsInline: true, ref: function(Ke) {
369
- m.video = Ke;
368
+ return o.createElement(o.Fragment, null, o.createElement("video", c({ autoPlay: true, disablePictureInPicture: w, src: y.src, muted: !C, playsInline: true, ref: function(Je) {
369
+ m.video = Je;
370
370
  }, style: K }, z)), X && X(ie));
371
371
  }, f.defaultProps = { audio: false, disablePictureInPicture: false, forceScreenshotSourceSize: false, imageSmoothing: true, mirrored: false, onUserMedia: function() {
372
372
  }, onUserMediaError: function() {
@@ -439,7 +439,7 @@ var require_main_min = __commonJS({
439
439
  })();
440
440
  });
441
441
  var Yp = {};
442
- om(Yp, { DynamicFlow: () => cn, JsonSchemaForm: () => ln, Layout: () => se, convertStepToLayout: () => or, inlineReferences: () => je, isValidSchema: () => $, makeHttpClient: () => Vr, translations: () => Kl });
442
+ om(Yp, { DynamicFlow: () => cn, JsonSchemaForm: () => ln, Layout: () => se, convertStepToLayout: () => or, inlineReferences: () => Ue, isValidSchema: () => $, makeHttpClient: () => Vr, translations: () => Kl });
443
443
  module2.exports = nm(Yp);
444
444
  function or(e, { displayStepTitle: t = true } = {}) {
445
445
  if (e.layout)
@@ -543,8 +543,8 @@ var require_main_min = __commonJS({
543
543
  function Sm(e, t) {
544
544
  return [...t && e.title ? [La(e.title)] : [], ...e.description ? [Ta(e.description)] : [], ...e.layout || []];
545
545
  }
546
- function je({ layout: e, schemas: t, actions: r, model: a }) {
547
- return e ? t ? e.map((o) => o.type === "form" ? Cm({ formComponent: o, schemas: t }) : o.type === "decision" ? bm({ decisionComponent: o, actions: r }) : o.type === "button" ? Fm({ actionComponent: o, actions: r }) : o.type === "box" ? S(s({}, o), { components: je({ layout: o.components, schemas: t, actions: r, model: a }) }) : o.type === "modal" ? S(s({}, o), { components: je({ layout: o.content.components, schemas: t, actions: r, model: a }) }) : o.type === "columns" ? S(s({}, o), { left: je({ layout: o.left, schemas: t, actions: r, model: a }), right: je({ layout: o.right, schemas: t, actions: r, model: a }) }) : o) : e : [];
546
+ function Ue({ layout: e, schemas: t, actions: r, model: a }) {
547
+ return e ? t ? e.map((o) => o.type === "form" ? Cm({ formComponent: o, schemas: t }) : o.type === "decision" ? bm({ decisionComponent: o, actions: r }) : o.type === "button" ? Fm({ actionComponent: o, actions: r }) : o.type === "box" ? S(s({}, o), { components: Ue({ layout: o.components, schemas: t, actions: r, model: a }) }) : o.type === "modal" ? S(s({}, o), { components: Ue({ layout: o.content.components, schemas: t, actions: r, model: a }) }) : o.type === "columns" ? S(s({}, o), { left: Ue({ layout: o.left, schemas: t, actions: r, model: a }), right: Ue({ layout: o.right, schemas: t, actions: r, model: a }) }) : o) : e : [];
548
548
  }
549
549
  function Cm({ formComponent: e, schemas: t }) {
550
550
  if (e.schemaId)
@@ -583,7 +583,7 @@ var require_main_min = __commonJS({
583
583
  function Er(e) {
584
584
  return Object.hasOwnProperty.call(e, "$ref");
585
585
  }
586
- var ke = require("react");
586
+ var Ie = require("react");
587
587
  var Il = require("react-intl");
588
588
  var Pt = require("react");
589
589
  var kr = require("react");
@@ -625,7 +625,7 @@ var require_main_min = __commonJS({
625
625
  };
626
626
  var kt = require("react");
627
627
  var Pn = require("react/jsx-runtime");
628
- var Je = (e, t, r = "UNKNOWN-FLOW-ID", a = "UNKNOWN-FLOW-ID") => (o, n, i) => {
628
+ var Ye = (e, t, r = "UNKNOWN-FLOW-ID", a = "UNKNOWN-FLOW-ID") => (o, n, i) => {
629
629
  try {
630
630
  t(e, `Dynamic Flow ${e} - ${o} - ${n}`, s({ flowId: r, stepId: a }, i));
631
631
  } catch (c) {
@@ -633,7 +633,7 @@ var require_main_min = __commonJS({
633
633
  };
634
634
  var An = (0, kt.createContext)(null);
635
635
  function Dr({ flowId: e, stepId: t, children: r, onLog: a }) {
636
- let o = (0, kt.useMemo)(() => ({ debug: Je("debug", a, e, t), info: Je("info", a, e, t), warning: Je("warning", a, e, t), error: Je("error", a, e, t), critical: Je("critical", a, e, t) }), [a, e, t]);
636
+ let o = (0, kt.useMemo)(() => ({ debug: Ye("debug", a, e, t), info: Ye("info", a, e, t), warning: Ye("warning", a, e, t), error: Ye("error", a, e, t), critical: Ye("critical", a, e, t) }), [a, e, t]);
637
637
  return (0, Pn.jsx)(An.Provider, { value: o, children: r });
638
638
  }
639
639
  var It = () => {
@@ -657,14 +657,14 @@ var require_main_min = __commonJS({
657
657
  var D = (e) => typeof e == "string";
658
658
  var j = (e) => typeof e == "number" && !Number.isNaN(e);
659
659
  var In = (e) => j(e) && Math.floor(e) === e;
660
- var De = (e) => typeof e == "boolean";
661
- var R = (e) => !I(e) && !ee(e) && (e == null ? void 0 : e.constructor) === Object;
660
+ var Le = (e) => typeof e == "boolean";
661
+ var T = (e) => !I(e) && !ee(e) && (e == null ? void 0 : e.constructor) === Object;
662
662
  var U = (e) => Array.isArray(e);
663
663
  var I = (e) => e === null;
664
664
  var ee = (e) => typeof e == "undefined";
665
- var Dt = (e) => D(e) && e.length === 0 || (R(e) || U(e)) && Object.keys(e).length === 0;
665
+ var Dt = (e) => D(e) && e.length === 0 || (T(e) || U(e)) && Object.keys(e).length === 0;
666
666
  function Dn(e, t) {
667
- return t.oneOf.some((r) => Ye(e, r) === e) ? e : null;
667
+ return t.oneOf.some((r) => Xe(e, r) === e) ? e : null;
668
668
  }
669
669
  function Ln(e, t) {
670
670
  var a;
@@ -672,7 +672,7 @@ var require_main_min = __commonJS({
672
672
  return r.length === 0 ? null : (a = r.find((o) => o.some((n) => n !== null))) != null ? a : r[0];
673
673
  }
674
674
  function Am(e, t) {
675
- return !Ue(t) || !Le(t) ? null : Ba(e, t);
675
+ return !Ve(t) || !Te(t) ? null : Ba(e, t);
676
676
  }
677
677
  function Tn(e) {
678
678
  return D(e) && !Dt(e) ? e : null;
@@ -681,10 +681,10 @@ var require_main_min = __commonJS({
681
681
  return j(e) ? e : null;
682
682
  }
683
683
  function Nn(e) {
684
- return De(e) ? e : null;
684
+ return Le(e) ? e : null;
685
685
  }
686
686
  function Ba(e, t) {
687
- if (!U(e) || !Le(t))
687
+ if (!U(e) || !Te(t))
688
688
  return null;
689
689
  if (e.length > 0) {
690
690
  let r = typeof e[0];
@@ -718,8 +718,8 @@ var require_main_min = __commonJS({
718
718
  return J(o) && J(n) ? S(s({}, r), { [a]: Un(o, n) }) : S(s({}, r), { [a]: t[a] });
719
719
  }, s({}, e));
720
720
  }
721
- var Lt = (e, t) => J(e) ? le(e, t) : za(e) ? Pm(e, t) : Ye(e, t);
722
- function Ye(e, t) {
721
+ var Lt = (e, t) => J(e) ? le(e, t) : za(e) ? Pm(e, t) : Xe(e, t);
722
+ function Xe(e, t) {
723
723
  if (I(e))
724
724
  return null;
725
725
  if (t.oneOf)
@@ -741,10 +741,10 @@ var require_main_min = __commonJS({
741
741
  return null;
742
742
  }
743
743
  function le(e, t) {
744
- return Ve(t) || Ue(t) || I(e) ? null : t.allOf ? zn(e, t) : t.oneOf ? jn(e, t) : !ee(t.const) && e === t.const ? e : Te(t) ? Bn(e, t) : null;
744
+ return He(t) || Ve(t) || I(e) ? null : t.allOf ? zn(e, t) : t.oneOf ? jn(e, t) : !ee(t.const) && he(e, t.const) ? e : Re(t) ? Bn(e, t) : null;
745
745
  }
746
746
  function Pm(e, t) {
747
- return Se(t) ? Ln(e, t) : Ue(t) ? Ba(e, t) : null;
747
+ return Ce(t) ? Ln(e, t) : Ve(t) ? Ba(e, t) : null;
748
748
  }
749
749
  function nr(e, t = false) {
750
750
  return !t || !ee(e);
@@ -773,7 +773,7 @@ var require_main_min = __commonJS({
773
773
  function $n(e, t) {
774
774
  return !j(t) || U(e) && e.length <= t;
775
775
  }
776
- function Xe(e, t, r) {
776
+ function Ze(e, t, r) {
777
777
  if (t.const)
778
778
  return Ga(e, t, r);
779
779
  if (I(e))
@@ -813,13 +813,13 @@ var require_main_min = __commonJS({
813
813
  return In(e) ? Tr(e, t, r) : ["type"];
814
814
  }
815
815
  function qa(e, t, r) {
816
- if (!De(e) && !I(e))
816
+ if (!Le(e) && !I(e))
817
817
  return ["type"];
818
818
  let a = [];
819
819
  return nr(e, r) || a.push("required"), a;
820
820
  }
821
821
  function Ga(e, t, r) {
822
- return nr(e, r) ? e !== t.const ? ["const"] : [] : ["required"];
822
+ return nr(e, r) ? he(e, t.const) ? [] : ["const"] : ["required"];
823
823
  }
824
824
  function Tt(e, t, r) {
825
825
  if (!U(e) && !I(e))
@@ -851,13 +851,13 @@ var require_main_min = __commonJS({
851
851
  return !Ga(e, t).length;
852
852
  }
853
853
  function Tm(e, t) {
854
- return !R(e) || t.type !== "object" || !R(t.properties) ? false : Object.keys(t.properties).map((r) => Rm(e[r], t.properties[r], t.required && t.required.includes(r))).every((r) => r);
854
+ return !T(e) || t.type !== "object" || !T(t.properties) ? false : Object.keys(t.properties).map((r) => Rm(e[r], t.properties[r], t.required && t.required.includes(r))).every((r) => r);
855
855
  }
856
856
  function Rm(e, t, r) {
857
857
  return t.hidden ? true : typeof e == "undefined" ? !r : $(e, t);
858
858
  }
859
859
  function Nm(e, t) {
860
- return t.type !== "array" || !R(t.items) || Tt(e, t).length > 0 ? false : Array.isArray(e) && Le(t) && e.map((r) => $(r, t.items)).every((r) => r);
860
+ return t.type !== "array" || !T(t.items) || Tt(e, t).length > 0 ? false : Array.isArray(e) && Te(t) && e.map((r) => $(r, t.items)).every((r) => r);
861
861
  }
862
862
  function Bm(e, t) {
863
863
  return U(t.oneOf) ? t.oneOf.some((r) => $(e, r)) : false;
@@ -905,7 +905,7 @@ var require_main_min = __commonJS({
905
905
  return !j(t) || !j(r) || !j(a) ? null : new Date(t, r - 1, a);
906
906
  };
907
907
  var Jn = (e) => Um(e);
908
- var Ze = (e, t) => {
908
+ var Qe = (e, t) => {
909
909
  let r, a, o = () => {
910
910
  r && (clearTimeout(r), r = null), a = null;
911
911
  }, n = (...i) => {
@@ -919,10 +919,10 @@ var require_main_min = __commonJS({
919
919
  r !== null && (e(...a), o());
920
920
  }, n;
921
921
  };
922
- var Qe = (e, t) => e === t ? true : Array.isArray(e) && Array.isArray(t) ? e.length === t.length && e.every((r, a) => Qe(r, t[a])) : !!(Yn(e) && Yn(t) && Vm(e, t));
922
+ var he = (e, t) => e === t ? true : Array.isArray(e) && Array.isArray(t) ? e.length === t.length && e.every((r, a) => he(r, t[a])) : !!(Yn(e) && Yn(t) && Vm(e, t));
923
923
  var Vm = (e, t) => {
924
924
  let r = Object.keys(e), a = Object.keys(t);
925
- return r.length === a.length && r.every((o) => Object.hasOwnProperty.call(t, o) && Qe(e[o], t[o]));
925
+ return r.length === a.length && r.every((o) => Object.hasOwnProperty.call(t, o) && he(e[o], t[o]));
926
926
  };
927
927
  var Yn = (e) => typeof e == "object" && e !== null;
928
928
  function Nr(e) {
@@ -941,26 +941,26 @@ var require_main_min = __commonJS({
941
941
  }
942
942
  return true;
943
943
  }
944
- var Re = (e = "") => `${e ? `${e}-` : ""}${Math.floor(1e8 * Math.random())}`;
945
- function Ce(e) {
944
+ var Ne = (e = "") => `${e ? `${e}-` : ""}${Math.floor(1e8 * Math.random())}`;
945
+ function be(e) {
946
946
  return !ee(e == null ? void 0 : e.const);
947
947
  }
948
948
  function ir(e) {
949
- return !!e && !Ce(e);
949
+ return !!e && !be(e);
950
950
  }
951
- var Hm = (e) => !!e.readOnly && Ve(e);
951
+ var Hm = (e) => !!e.readOnly && He(e);
952
952
  var qm = (e) => !!e.oneOf && !!e.promotion;
953
953
  var Gm = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean"]);
954
- function Ve(e) {
955
- return Gm.has(e.type || "") || "const" in e && e.const !== void 0;
954
+ function He(e) {
955
+ return Gm.has(e.type || "") || "const" in e && e.const !== void 0 && !T(e.const);
956
956
  }
957
- function Te(e) {
957
+ function Re(e) {
958
958
  return e.type === "object";
959
959
  }
960
960
  function mt(e) {
961
- return Se(e) && e.oneOf.every((t) => t.type === "object");
961
+ return Ce(e) && e.oneOf.every((t) => t.type === "object");
962
962
  }
963
- function Se(e) {
963
+ function Ce(e) {
964
964
  return !!e.oneOf;
965
965
  }
966
966
  function _a(e) {
@@ -969,10 +969,10 @@ var require_main_min = __commonJS({
969
969
  function Rt(e) {
970
970
  return e.type === "blob";
971
971
  }
972
- function Ue(e) {
972
+ function Ve(e) {
973
973
  return e.type === "array";
974
974
  }
975
- function Le(e) {
975
+ function Te(e) {
976
976
  let t = e.items;
977
977
  return !Array.isArray(t);
978
978
  }
@@ -985,15 +985,15 @@ var require_main_min = __commonJS({
985
985
  function _m(e) {
986
986
  return Br(e) && (Rt(e.persistAsync.schema) || $m(e.persistAsync.schema));
987
987
  }
988
- var $a = (e) => Ve(e) && !!e.validationAsync;
988
+ var $a = (e) => He(e) && !!e.validationAsync;
989
989
  function $m(e) {
990
990
  return e.type === "string" && e.format === "base64url";
991
991
  }
992
992
  function Qn(e) {
993
993
  return e.type === "string" && e.format === "base64url";
994
994
  }
995
- var ei = (e) => Ue(e) && Le(e) && _m(e.items);
996
- var dt = (e) => Hm(e) ? "readOnly" : Br(e) ? "persistAsync" : $a(e) ? "validationAsync" : Te(e) ? "object" : Ue(e) ? "array" : qm(e) ? "promotedOneOf" : Se(e) ? "oneOf" : _a(e) ? "allOf" : Ve(e) ? "basic" : null;
995
+ var ei = (e) => Ve(e) && Te(e) && _m(e.items);
996
+ var dt = (e) => Hm(e) ? "readOnly" : Br(e) ? "persistAsync" : $a(e) ? "validationAsync" : Re(e) ? "object" : Ve(e) ? "array" : qm(e) ? "promotedOneOf" : Ce(e) ? "oneOf" : _a(e) ? "allOf" : He(e) ? "basic" : null;
997
997
  var ti = (e) => Wm(e) && Km(e) && Jm(e);
998
998
  var Wm = (e) => !e.type || e.type === "form";
999
999
  var Km = (e) => {
@@ -1007,15 +1007,15 @@ var require_main_min = __commonJS({
1007
1007
  if ((t == null ? void 0 : t.length) !== 1)
1008
1008
  return false;
1009
1009
  let r = t[0];
1010
- if (!Te(r) || Object.values(r.properties).length !== 1)
1010
+ if (!Re(r) || Object.values(r.properties).length !== 1)
1011
1011
  return false;
1012
1012
  let a = Object.values(r.properties)[0];
1013
1013
  return Qn(a) ? a.source === "camera" : false;
1014
1014
  };
1015
- var zr = (e) => e.filter((t) => Te(t) ? Object.values((t == null ? void 0 : t.properties) || {}).find((r) => (r == null ? void 0 : r.hidden) !== true) : (t == null ? void 0 : t.hidden) !== true);
1015
+ var zr = (e) => e.filter((t) => Re(t) ? Object.values((t == null ? void 0 : t.properties) || {}).find((r) => (r == null ? void 0 : r.hidden) !== true) : (t == null ? void 0 : t.hidden) !== true);
1016
1016
  var J = (e) => typeof e == "object" && e !== null && e.constructor === Object;
1017
1017
  var Wa = (e) => I(e) || J(e);
1018
- var Ka = (e) => De(e) || j(e) || D(e) || I(e);
1018
+ var Ka = (e) => Le(e) || j(e) || D(e) || I(e);
1019
1019
  var jr = (e) => D(e) || I(e);
1020
1020
  var za = (e) => U(e) ? e.length === 0 ? true : e.every((t) => typeof t == "string" || typeof t == "number" || typeof t == "boolean" || typeof t == "object") : false;
1021
1021
  var ri = (e) => I(e) ? true : za(e);
@@ -1031,7 +1031,7 @@ var require_main_min = __commonJS({
1031
1031
  };
1032
1032
  var oi = require("react");
1033
1033
  function ni(e, t) {
1034
- return (0, oi.useCallback)(Ze(e, t), [e, t]);
1034
+ return (0, oi.useCallback)(Qe(e, t), [e, t]);
1035
1035
  }
1036
1036
  var cr = require("react");
1037
1037
  function ii(e) {
@@ -1110,14 +1110,14 @@ var require_main_min = __commonJS({
1110
1110
  var kc = require("react");
1111
1111
  var Ic = require("react-intl");
1112
1112
  var mi = require("react-intl");
1113
- var be = (0, mi.defineMessages)({ genericErrorRetryHint: { id: "dynamicFlows.PersistAsyncSchema.genericError", defaultMessage: "Something went wrong, please try again.", description: "Generic error message for persist async schema" }, genericError: { id: "dynamicFlows.ErrorBoundary.errorAlert", defaultMessage: "Something went wrong.", description: "Generic error message for when something has gone wrong." }, retry: { id: "dynamicFlows.ErrorBoundary.retry", defaultMessage: "Retry", description: "Usually this follows the generic error and contains a link." } });
1113
+ var Fe = (0, mi.defineMessages)({ genericErrorRetryHint: { id: "dynamicFlows.PersistAsyncSchema.genericError", defaultMessage: "Something went wrong, please try again.", description: "Generic error message for persist async schema" }, genericError: { id: "dynamicFlows.ErrorBoundary.errorAlert", defaultMessage: "Something went wrong.", description: "Generic error message for when something has gone wrong." }, retry: { id: "dynamicFlows.ErrorBoundary.retry", defaultMessage: "Retry", description: "Usually this follows the generic error and contains a link." } });
1114
1114
  var vt = require("react");
1115
1115
  var Oc = require("react-intl");
1116
1116
  var di = { DAY_MONTH_YEAR: "day-month-year", MONTH_YEAR: "month-year" };
1117
1117
  var N = { RADIO: "radio", CHECKBOX: "checkbox", SELECT: "select", EMAIL: "email", FILE: "file", DATE: "date", DATETIME: "date-time", DATELOOKUP: "date-lookup", TEL: "tel", NUMERIC: "numeric", NUMBER: "number", HIDDEN: "hidden", PASSWORD: "password", TEXT: "text", TEXTAREA: "textarea", UPLOAD: "upload", TAB: "tab" };
1118
1118
  var ui = { SHORT: "short", LONG: "long" };
1119
1119
  var pi = { EXTRA_SMALL: "xs", SMALL: "sm", MEDIUM: "md", LARGE: "lg", EXTRA_LARGE: "xl" };
1120
- var xc = Ie(et());
1120
+ var xc = De(et());
1121
1121
  var ue = require("react");
1122
1122
  var Ci = require("@transferwise/components");
1123
1123
  var Bt = require("@transferwise/components");
@@ -1133,7 +1133,7 @@ var require_main_min = __commonJS({
1133
1133
  }
1134
1134
  var od = ["aed", "ars", "aud", "bdt", "bgn", "bhd", "bnd", "brl", "bwp", "cad", "chf", "clp", "cny", "cop", "crc", "czk", "dkk", "egp", "eur", "fjd", "gbp", "gel", "ghs", "gtq", "hkd", "hrk", "huf", "idr", "ils", "imp", "inr", "isk", "jmd", "jpy", "kes", "krw", "kwd", "lak", "lkr", "lsl", "mad", "mur", "mxn", "myr", "mzn", "nad", "ngn", "nok", "npr", "nzd", "omr", "pab", "pen", "php", "pkr", "pln", "qar", "ron", "rub", "sar", "sek", "sgd", "thb", "tmt", "try", "twd", "tzs", "uah", "ugx", "usd", "uyu", "vnd", "xof", "zar", "zmw"];
1135
1135
  var nd = ["ad", "ae", "ar", "at", "au", "bd", "be", "bg", "bh", "bn", "br", "bw", "ca", "ch", "cl", "cn", "co", "cr", "cy", "cz", "de", "dk", "ee", "eg", "es", "eu", "fi", "fj", "fr", "gb", "ge", "gg", "gh", "gp", "gr", "gt", "hk", "hr", "hu", "id", "ie", "il", "im", "in", "is", "it", "je", "jm", "jp", "ke", "kr", "kw", "la", "li", "lk", "ls", "lt", "lu", "lv", "ma", "mc", "mt", "mu", "mx", "my", "mz", "na", "ng", "nl", "no", "np", "nz", "om", "pa", "pe", "ph", "pk", "pl", "pt", "qa", "ro", "ru", "sa", "se", "sg", "si", "sk", "sm", "th", "tm", "tr", "tw", "tz", "ua", "ug", "us", "uy", "va", "vn", "wi", "xo", "za", "zm"];
1136
- var hi = Ie(require("@transferwise/icons"));
1136
+ var hi = De(require("@transferwise/icons"));
1137
1137
  var Si = require("react/jsx-runtime");
1138
1138
  var $r = (e) => {
1139
1139
  let t = wi(e);
@@ -1194,7 +1194,7 @@ var require_main_min = __commonJS({
1194
1194
  return "";
1195
1195
  }
1196
1196
  };
1197
- var Fe = (e) => `${cd(e.align)} ${V(e.margin)}`;
1197
+ var xe = (e) => `${cd(e.align)} ${V(e.margin)}`;
1198
1198
  var bi = require("react/jsx-runtime");
1199
1199
  var ld = (e) => {
1200
1200
  let t = e.component;
@@ -1311,9 +1311,9 @@ var require_main_min = __commonJS({
1311
1311
  var ao = Fd;
1312
1312
  var ac = require("react");
1313
1313
  var Di = require("@transferwise/components");
1314
- var Li = Ie(et());
1314
+ var Li = De(et());
1315
1315
  var Ti = require("react");
1316
- var Ne = require("react/jsx-runtime");
1316
+ var Be = require("react/jsx-runtime");
1317
1317
  var xd = (e, t) => t.map((r) => le(e, r) || {});
1318
1318
  var vd = (e) => e.reduce((t, r) => s(s({}, r), t), {});
1319
1319
  var Od = (e) => ({ "col-xs-12": true, "col-sm-6": e === "md", "col-sm-4": e === "sm" });
@@ -1322,34 +1322,34 @@ var require_main_min = __commonJS({
1322
1322
  let i = e.schema.allOf[o];
1323
1323
  r[o] = le(n.model, i) || {}, a(r), e.onChange(S(s({}, n), { model: vd(r) }));
1324
1324
  }, [r, a] = (0, Ti.useState)(xd(e.model, e.schema.allOf));
1325
- return (0, Ne.jsxs)(Ne.Fragment, { children: [e.schema.title && (0, Ne.jsx)(Di.Header, { title: e.schema.title }), e.schema.description && (0, Ne.jsx)("p", { children: e.schema.description }), (0, Ne.jsx)("div", { className: "row", children: e.schema.allOf.map((o, n) => (0, Ne.jsx)("div", { className: (0, Li.default)(Od(o.width)), children: (0, Ne.jsx)(me, { schema: o, model: r[n], errors: e.errors, submitted: e.submitted, disabled: e.disabled, onChange: (i) => t(n, S(s({}, i), { model: i.model })), onPersistAsync: e.onPersistAsync }) }, n)) })] });
1325
+ return (0, Be.jsxs)(Be.Fragment, { children: [e.schema.title && (0, Be.jsx)(Di.Header, { title: e.schema.title }), e.schema.description && (0, Be.jsx)("p", { children: e.schema.description }), (0, Be.jsx)("div", { className: "row", children: e.schema.allOf.map((o, n) => (0, Be.jsx)("div", { className: (0, Li.default)(Od(o.width)), children: (0, Be.jsx)(me, { schema: o, model: r[n], errors: e.errors, submitted: e.submitted, disabled: e.disabled, onChange: (i) => t(n, S(s({}, i), { model: i.model })), onPersistAsync: e.onPersistAsync }) }, n)) })] });
1326
1326
  }
1327
1327
  Ri.defaultProps = { disabled: false };
1328
1328
  var oo = Ri;
1329
1329
  var Xr = require("@transferwise/components");
1330
- var Ji = Ie(et());
1330
+ var Ji = De(et());
1331
1331
  var dr = require("react");
1332
1332
  var Yr = require("@transferwise/components");
1333
1333
  var no = require("@transferwise/formatting");
1334
1334
  var Bi = require("react-intl");
1335
1335
  var Ni = require("react-intl");
1336
- var xe = (0, Ni.defineMessages)({ type: { id: "dynamicFlows.ControlFeedback.type", defaultMessage: "Incorrect type", description: "" }, minimum: { id: "dynamicFlows.ControlFeedback.minimum", defaultMessage: "Please enter a number that's {minimum} or more.", description: "" }, maximum: { id: "dynamicFlows.ControlFeedback.maximum", defaultMessage: "Please enter a number that's {maximum} or less.", description: "" }, minLength: { id: "dynamicFlows.ControlFeedback.minLength", defaultMessage: "Please enter at least {minLength} characters.", description: "" }, maxLength: { id: "dynamicFlows.ControlFeedback.maxLength", defaultMessage: "Please enter {maxLength} or fewer characters.", description: "" }, minimumDate: { id: "dynamicFlows.ControlFeedback.minimumDate", defaultMessage: "Please enter a date that's on or after {minimum}.", description: "" }, maximumDate: { id: "dynamicFlows.ControlFeedback.maximumDate", defaultMessage: "Please enter a date that's on or before {maximum}.", description: "" }, pattern: { id: "dynamicFlows.ControlFeedback.pattern", defaultMessage: "Please enter this in the correct format.", description: "" }, patternDate: { id: "dynamicFlows.ControlFeedback.patternDate", defaultMessage: "Please enter a date in the corrrect format.", description: "" }, required: { id: "dynamicFlows.ControlFeedback.required", defaultMessage: "Please fill out this field.", description: "" } });
1337
- var He = require("react/jsx-runtime");
1336
+ var ve = (0, Ni.defineMessages)({ type: { id: "dynamicFlows.ControlFeedback.type", defaultMessage: "Incorrect type", description: "" }, minimum: { id: "dynamicFlows.ControlFeedback.minimum", defaultMessage: "Please enter a number that's {minimum} or more.", description: "" }, maximum: { id: "dynamicFlows.ControlFeedback.maximum", defaultMessage: "Please enter a number that's {maximum} or less.", description: "" }, minLength: { id: "dynamicFlows.ControlFeedback.minLength", defaultMessage: "Please enter at least {minLength} characters.", description: "" }, maxLength: { id: "dynamicFlows.ControlFeedback.maxLength", defaultMessage: "Please enter {maxLength} or fewer characters.", description: "" }, minimumDate: { id: "dynamicFlows.ControlFeedback.minimumDate", defaultMessage: "Please enter a date that's on or after {minimum}.", description: "" }, maximumDate: { id: "dynamicFlows.ControlFeedback.maximumDate", defaultMessage: "Please enter a date that's on or before {maximum}.", description: "" }, pattern: { id: "dynamicFlows.ControlFeedback.pattern", defaultMessage: "Please enter this in the correct format.", description: "" }, patternDate: { id: "dynamicFlows.ControlFeedback.patternDate", defaultMessage: "Please enter a date in the corrrect format.", description: "" }, required: { id: "dynamicFlows.ControlFeedback.required", defaultMessage: "Please fill out this field.", description: "" } });
1337
+ var qe = require("react/jsx-runtime");
1338
1338
  function zi(e) {
1339
1339
  var c;
1340
1340
  let t = Ad(e.schema), r = s(s(s({}, t), e.validationMessages), e.schema.validationMessages), a = (e.submitted || !e.changed) && !!e.errors, o = !a && (e.submitted || e.changed && e.blurred) && !!((c = e.validations) != null && c.length), n = e.schema.description && !a && !o, i = !!e.infoMessage;
1341
- return (0, He.jsxs)("div", { id: e.id, children: [a ? (0, He.jsx)(Yr.InlineAlert, { type: "error", children: e.errors }) : null, o ? (0, He.jsx)(Yr.InlineAlert, { type: "error", children: e.validations.map((u) => (0, He.jsx)("div", { children: r[u] }, u)) }) : null, (n || i) && (0, He.jsxs)(Yr.InlineAlert, { type: "info", children: [n && (0, He.jsx)("div", { children: e.schema.description }), i && (0, He.jsx)("div", { children: e.infoMessage })] })] });
1341
+ return (0, qe.jsxs)("div", { id: e.id, children: [a ? (0, qe.jsx)(Yr.InlineAlert, { type: "error", children: e.errors }) : null, o ? (0, qe.jsx)(Yr.InlineAlert, { type: "error", children: e.validations.map((u) => (0, qe.jsx)("div", { children: r[u] }, u)) }) : null, (n || i) && (0, qe.jsxs)(Yr.InlineAlert, { type: "info", children: [n && (0, qe.jsx)("div", { children: e.schema.description }), i && (0, qe.jsx)("div", { children: e.infoMessage })] })] });
1342
1342
  }
1343
1343
  zi.defaultProps = { errors: "", validations: [], validationMessages: {}, validationAsyncSuccessMessage: null };
1344
1344
  function Ad(e) {
1345
- let { formatMessage: t, locale: r } = (0, Bi.useIntl)(), a = { type: t(xe.type), minimum: t(xe.minimum, { minimum: e.minimum }), maximum: t(xe.maximum, { maximum: e.maximum }), minLength: t(xe.minLength, { minLength: e.minLength }), maxLength: t(xe.maxLength, { maxLength: e.maxLength }), pattern: t(xe.pattern), required: t(xe.required) };
1345
+ let { formatMessage: t, locale: r } = (0, Bi.useIntl)(), a = { type: t(ve.type), minimum: t(ve.minimum, { minimum: e.minimum }), maximum: t(ve.maximum, { maximum: e.maximum }), minLength: t(ve.minLength, { minLength: e.minLength }), maxLength: t(ve.maxLength, { maxLength: e.maxLength }), pattern: t(ve.pattern), required: t(ve.required) };
1346
1346
  if (e.format === "date") {
1347
- let o = { pattern: t(xe.patternDate), minimum: e.minimum ? t(xe.minimumDate, { minimum: (0, no.formatDate)(new Date(e.minimum), r, { timeZone: "UTC", dateStyle: "long" }) }) : void 0, maximum: e.maximum ? t(xe.maximumDate, { maximum: (0, no.formatDate)(new Date(e.maximum), r, { timeZone: "UTC", dateStyle: "long" }) }) : void 0 };
1347
+ let o = { pattern: t(ve.patternDate), minimum: e.minimum ? t(ve.minimumDate, { minimum: (0, no.formatDate)(new Date(e.minimum), r, { timeZone: "UTC", dateStyle: "long" }) }) : void 0, maximum: e.maximum ? t(ve.maximumDate, { maximum: (0, no.formatDate)(new Date(e.maximum), r, { timeZone: "UTC", dateStyle: "long" }) }) : void 0 };
1348
1348
  return s(s({}, a), o);
1349
1349
  }
1350
1350
  return a;
1351
1351
  }
1352
- var qe = zi;
1352
+ var Ge = zi;
1353
1353
  async function ji(e, t) {
1354
1354
  if (t)
1355
1355
  return e;
@@ -1363,11 +1363,11 @@ var require_main_min = __commonJS({
1363
1363
  }
1364
1364
  function Vi(e) {
1365
1365
  let t = e instanceof Error;
1366
- if (!(R(e) && "data" in e) && !t)
1366
+ if (!(T(e) && "data" in e) && !t)
1367
1367
  return D(e) ? e : void 0;
1368
1368
  if (t) {
1369
1369
  let o = e;
1370
- return { id: Re(), message: o.message };
1370
+ return { id: Ne(), message: o.message };
1371
1371
  }
1372
1372
  return s({ message: D(e.message) ? e.message : "" }, e);
1373
1373
  }
@@ -1383,7 +1383,7 @@ var require_main_min = __commonJS({
1383
1383
  var ht = require("react/jsx-runtime");
1384
1384
  function Yi(e) {
1385
1385
  var E, A;
1386
- let { onChange: t, schema: r } = e, a = ae(), o = Wi(r), n = (0, dr.useMemo)(() => r.$id || Re(), [r.$id]), [i, c] = (0, dr.useState)(false), [u, d] = (0, dr.useState)(() => Pd(e.model || [])), p = Xi(r.items.persistAsync), h = r.items.persistAsync.schema, f = Rt(h), m = async (L) => {
1386
+ let { onChange: t, schema: r } = e, a = ae(), o = Wi(r), n = (0, dr.useMemo)(() => r.$id || Ne(), [r.$id]), [i, c] = (0, dr.useState)(false), [u, d] = (0, dr.useState)(() => Pd(e.model || [])), p = Xi(r.items.persistAsync), h = r.items.persistAsync.schema, f = Rt(h), m = async (L) => {
1387
1387
  c(true);
1388
1388
  try {
1389
1389
  let O = await ji(L, f);
@@ -1402,7 +1402,7 @@ var require_main_min = __commonJS({
1402
1402
  t({ model: B, triggerSchema: r, triggerModel: B });
1403
1403
  }
1404
1404
  let g = Ki(u).map((L) => L.id), C = Tt(g, r, e.required), b = !!e.errors || (i || e.submitted) && !!C.length, w = "accepts" in h && h.accepts, v = "maxSize" in h && h.maxSize, P = S(s(s({ multiple: true, className: "form-control", files: u, fileInputName: n, id: n }, w ? { fileTypes: w } : void 0), v ? { sizeLimit: Nr(v) } : void 0), { sizeLimitErrorMessage: ((E = h.validationMessages) == null ? void 0 : E.maxSize) || o.maxFileSizeErrorMessage, maxFiles: e.schema.maxItems, maxFilesErrorMessage: ((A = e.schema.validationMessages) == null ? void 0 : A.maxItems) || o.maxItemsErrorMessage, uploadButtonTitle: h.title, description: h.description, disabled: e.disabled, onUploadFile: (L) => m(L.get(n)), onFilesChange: l, onDeleteFile: () => Promise.resolve() }), M = `${n}-feedback`;
1405
- return (0, ht.jsxs)("div", { className: (0, Ji.default)("form-group", { "has-error": b }), children: [(0, ht.jsx)("label", { className: "d-block control-label", htmlFor: n, children: e.schema.title }), (0, ht.jsx)("div", { "aria-describedby": M, children: (0, ht.jsx)(Xr.UploadInput, s({}, P)) }), (0, ht.jsx)(qe, { id: M, changed: i, submitted: e.submitted, errors: e.errors, schema: e.schema, validations: C, validationMessages: Ed(r, !!e.required, o), infoMessage: null, focused: false, blurred: true })] });
1405
+ return (0, ht.jsxs)("div", { className: (0, Ji.default)("form-group", { "has-error": b }), children: [(0, ht.jsx)("label", { className: "d-block control-label", htmlFor: n, children: e.schema.title }), (0, ht.jsx)("div", { "aria-describedby": M, children: (0, ht.jsx)(Xr.UploadInput, s({}, P)) }), (0, ht.jsx)(Ge, { id: M, changed: i, submitted: e.submitted, errors: e.errors, schema: e.schema, validations: C, validationMessages: Ed(r, !!e.required, o), infoMessage: null, focused: false, blurred: true })] });
1406
1406
  }
1407
1407
  Yi.defaultProps = { errors: null, required: false };
1408
1408
  var io = Yi;
@@ -1449,7 +1449,7 @@ var require_main_min = __commonJS({
1449
1449
  return r;
1450
1450
  if (e.oneOf.length === 1 && ir(e.oneOf[0]))
1451
1451
  return 0;
1452
- if (Ce(e.oneOf[0])) {
1452
+ if (be(e.oneOf[0])) {
1453
1453
  let a = ur(e, e.default);
1454
1454
  if (a >= 0)
1455
1455
  return a;
@@ -1463,7 +1463,7 @@ var require_main_min = __commonJS({
1463
1463
  function jt(e, t) {
1464
1464
  if (t == null)
1465
1465
  return null;
1466
- let r = e.oneOf.map((a) => Id(a).reduce((o, [n, i]) => Ce(i) && i.const === t[n] ? o + 2 : ir(i) && typeof t[n] != "undefined" ? o + 1 : o, 0));
1466
+ let r = e.oneOf.map((a) => Id(a).reduce((o, [n, i]) => be(i) && i.const === t[n] ? o + 2 : ir(i) && typeof t[n] != "undefined" ? o + 1 : o, 0));
1467
1467
  return r.every((a) => a === r[0]) ? null : r.indexOf(Math.max(...r));
1468
1468
  }
1469
1469
  function Id(e) {
@@ -1526,12 +1526,12 @@ var require_main_min = __commonJS({
1526
1526
  }
1527
1527
  return null;
1528
1528
  };
1529
- var is = (e, t) => Ce(e) ? e.title ? e.title : D(e.const) ? e.const : null : jr(t) ? t : null;
1529
+ var is = (e, t) => be(e) ? e.title ? e.title : D(e.const) ? e.const : null : jr(t) ? t : null;
1530
1530
  var Rd = (e, t) => !!e && Object.hasOwnProperty.call(e, t) && !!e[t];
1531
- var ve = require("react/jsx-runtime");
1531
+ var Oe = require("react/jsx-runtime");
1532
1532
  function Nd({ schema: e, model: t, errors: r, submitted: a, onChange: o }) {
1533
1533
  let [n, i] = (0, ea.useState)(null), [c, u] = (0, ea.useState)(() => {
1534
- if (R(t) && !U(t))
1534
+ if (T(t) && !U(t))
1535
1535
  throw new Error("RepeatableSchema does not support object models. Ensure your array schema is wrapped inside an object schema.");
1536
1536
  return t ? t.map((C) => so(e.items, C, e == null ? void 0 : e.summary)) : null;
1537
1537
  }), [d, p] = (0, ea.useState)({ item: null, model: null }), h = (C) => {
@@ -1551,7 +1551,7 @@ var require_main_min = __commonJS({
1551
1551
  }, y = () => {
1552
1552
  p({ item: null, model: null }), i(null);
1553
1553
  }, { formatMessage: g } = (0, cs.useIntl)();
1554
- return (0, ve.jsxs)(ve.Fragment, { children: [e.title && (0, ve.jsx)(Ut.Header, { title: e.title }), c == null ? void 0 : c.map((C) => (0, ve.jsx)(Qi, { item: C, onClick: () => m(C) }, JSON.stringify(C))), (0, ve.jsx)(Ut.NavigationOption, { media: (0, ve.jsx)(ss.Plus, {}), title: e.addItemTitle || g(gt.addItemTitle), showMediaAtAllSizes: true, onClick: f }), (0, ve.jsx)(Ut.Modal, { open: n !== null, title: (n === "add" ? e.addItemTitle : e.editItemTitle) || g(gt.addItemTitle), body: (0, ve.jsx)(os, { type: n != null ? n : "add", schema: e, model: d.model, errors: r, submitted: a, onAction: l, onModelChange: ({ model: C }) => p(S(s({}, d), { model: C })) }), onClose: y })] });
1554
+ return (0, Oe.jsxs)(Oe.Fragment, { children: [e.title && (0, Oe.jsx)(Ut.Header, { title: e.title }), c == null ? void 0 : c.map((C) => (0, Oe.jsx)(Qi, { item: C, onClick: () => m(C) }, JSON.stringify(C))), (0, Oe.jsx)(Ut.NavigationOption, { media: (0, Oe.jsx)(ss.Plus, {}), title: e.addItemTitle || g(gt.addItemTitle), showMediaAtAllSizes: true, onClick: f }), (0, Oe.jsx)(Ut.Modal, { open: n !== null, title: (n === "add" ? e.addItemTitle : e.editItemTitle) || g(gt.addItemTitle), body: (0, Oe.jsx)(os, { type: n != null ? n : "add", schema: e, model: d.model, errors: r, submitted: a, onAction: l, onModelChange: ({ model: C }) => p(S(s({}, d), { model: C })) }), onClose: y })] });
1555
1555
  }
1556
1556
  var Bd = (e, { originalItem: t, updatedItem: r, itemSummaries: a }) => {
1557
1557
  if (e === "remove")
@@ -1573,7 +1573,7 @@ var require_main_min = __commonJS({
1573
1573
  let { schema: t } = e;
1574
1574
  if (ei(t))
1575
1575
  return (0, co.jsx)(io, S(s({}, e), { schema: t }));
1576
- if (Le(t))
1576
+ if (Te(t))
1577
1577
  return (0, co.jsx)(ls, S(s({}, e), { schema: t }));
1578
1578
  throw new Error("Invalid array list schema");
1579
1579
  };
@@ -1582,16 +1582,16 @@ var require_main_min = __commonJS({
1582
1582
  var ps = require("react/jsx-runtime");
1583
1583
  var us = (e) => {
1584
1584
  let { schema: t } = e;
1585
- if (Le(t))
1585
+ if (Te(t))
1586
1586
  return (0, ps.jsx)(ds, s({}, e));
1587
1587
  throw new Error("Not implemented");
1588
1588
  };
1589
1589
  us.defaultProps = { required: false };
1590
1590
  var lo = us;
1591
1591
  var fs = require("@transferwise/components");
1592
- var ys = Ie(et());
1592
+ var ys = De(et());
1593
1593
  var ta = require("react");
1594
- var he = require("react/jsx-runtime");
1594
+ var ge = require("react/jsx-runtime");
1595
1595
  var zd = (e) => ({ "col-xs-12": true, "col-sm-6": e === "md", "col-sm-4": e === "sm" });
1596
1596
  function hs(e) {
1597
1597
  let [t, r] = (0, ta.useState)(() => s({}, le(e.model, e.schema))), a = (d, p) => {
@@ -1599,16 +1599,16 @@ var require_main_min = __commonJS({
1599
1599
  }, o = (d) => e.schema.required && e.schema.required.includes(d);
1600
1600
  (0, ta.useEffect)(() => {
1601
1601
  let d = le(t, e.schema) || {};
1602
- r(d), Qe(d, t) || e.onChange({ model: d, triggerSchema: e.schema, triggerModel: d });
1602
+ r(d), he(d, t) || e.onChange({ model: d, triggerSchema: e.schema, triggerModel: d });
1603
1603
  }, [e.schema]);
1604
1604
  let n = /* @__PURE__ */ new Set([...e.schema.displayOrder || [], ...Object.keys(e.schema.properties)]), i = (d) => typeof e.schema.properties[d] != "undefined", c = Array.from(n).filter(i), u = e.errors;
1605
- return (0, he.jsxs)(he.Fragment, { children: [e.schema.alert && (0, he.jsx)(ce, { component: e.schema.alert }), (0, he.jsxs)("fieldset", { children: [e.schema.title && !e.hideTitle && (0, he.jsx)(fs.Header, { title: e.schema.title, as: "legend" }), e.schema.description && !e.hideTitle && (0, he.jsxs)("p", { children: [" ", e.schema.description, " "] }), (0, he.jsx)("div", { className: "row", children: c.map((d) => (0, he.jsx)("div", { className: (0, ys.default)(zd(e.schema.properties[d].width)), children: (0, he.jsx)(me, { schema: e.schema.properties[d], model: e.model && e.model[d], errors: u == null ? void 0 : u[d], submitted: e.submitted, required: o(d), disabled: e.disabled, onChange: (p) => a(d, p), onPersistAsync: e.onPersistAsync }) }, d)) })] })] });
1605
+ return (0, ge.jsxs)(ge.Fragment, { children: [e.schema.alert && (0, ge.jsx)(ce, { component: e.schema.alert }), (0, ge.jsxs)("fieldset", { children: [e.schema.title && !e.hideTitle && (0, ge.jsx)(fs.Header, { title: e.schema.title, as: "legend" }), e.schema.description && !e.hideTitle && (0, ge.jsxs)("p", { children: [" ", e.schema.description, " "] }), (0, ge.jsx)("div", { className: "row", children: c.map((d) => (0, ge.jsx)("div", { className: (0, ys.default)(zd(e.schema.properties[d].width)), children: (0, ge.jsx)(me, { schema: e.schema.properties[d], model: e.model && e.model[d], errors: u == null ? void 0 : u[d], submitted: e.submitted, required: o(d), disabled: e.disabled, onChange: (p) => a(d, p), onPersistAsync: e.onPersistAsync }) }, d)) })] })] });
1606
1606
  }
1607
1607
  hs.defaultProps = { hideTitle: false, disabled: false };
1608
1608
  var pr = hs;
1609
1609
  var Ls = require("@transferwise/components");
1610
- var Ts = Ie(et());
1611
- var Be = require("react");
1610
+ var Ts = De(et());
1611
+ var ze = require("react");
1612
1612
  var ra = require("@transferwise/components");
1613
1613
  var Ss = require("react-intl");
1614
1614
  var gs = require("react-intl");
@@ -1618,14 +1618,14 @@ var require_main_min = __commonJS({
1618
1618
  let t = (0, Ss.useIntl)();
1619
1619
  return (0, mo.jsx)(ra.Info, { className: "m-l-1", content: (0, mo.jsx)(ra.Markdown, { config: { link: { target: "_blank" } }, children: e.help.markdown }), presentation: "POPOVER", size: "sm", "aria-label": t.formatMessage(ws.helpAria) });
1620
1620
  }
1621
- var Ge = jd;
1621
+ var _e = jd;
1622
1622
  var Is = require("react");
1623
1623
  var W = require("@transferwise/components");
1624
1624
  var vs = require("react");
1625
1625
  var Vt = (e, t = {}) => {
1626
1626
  let { coerceValue: r = false } = t;
1627
1627
  if (!I(e)) {
1628
- if (R(e)) {
1628
+ if (T(e)) {
1629
1629
  wt({ received: "object", expected: "string" });
1630
1630
  return;
1631
1631
  }
@@ -1645,7 +1645,7 @@ var require_main_min = __commonJS({
1645
1645
  if (j(e))
1646
1646
  return e;
1647
1647
  let a = { received: typeof e, expected: "string or number" };
1648
- if (R(e)) {
1648
+ if (T(e)) {
1649
1649
  wt(a);
1650
1650
  return;
1651
1651
  }
@@ -1661,7 +1661,7 @@ var require_main_min = __commonJS({
1661
1661
  let { coerceValue: r = false } = t;
1662
1662
  if (I(e))
1663
1663
  return false;
1664
- if (!De(e)) {
1664
+ if (!Le(e)) {
1665
1665
  if (r)
1666
1666
  return po({ received: typeof e, expected: "boolean" }), !!e;
1667
1667
  wt({ received: typeof e, expected: "boolean" });
@@ -1698,7 +1698,7 @@ var require_main_min = __commonJS({
1698
1698
  };
1699
1699
  var xs = { on: "on", name: "name", "name-prefix": "honorific-prefix", "given-name": "given-name", "additional-name": "additional-name", "family-name": "family-name", "name-suffix": "honorific-suffix", nickname: "nickname", email: "email", "new-username": "username", username: "username", "new-password": "new-password", password: "current-password", "one-time-code": "one-time-code", "job-title": "organization-title", "organization-name": "organization", "full-street-address": "street-address", "street-address-line-1": "address-line1", "street-address-line-2": "address-line2", "street-address-line-3": "address-line3", "address-level-1": "address-level1", "address-level-2": "address-level2", "address-level-3": "address-level3", "address-level-4": "address-level4", "country-code": "country", "country-name": "country-name", "postal-code": "postal-code", "credit-card-name": "cc-name", "credit-card-given-name": "cc-given-name", "credit-card-middle-name": "cc-additional-name", "credit-card-family-name": "cc-family-name", "credit-card-number": "cc-number", "credit-card-expiration": "cc-exp", "credit-card-expiration-month": "cc-exp-month", "credit-card-expiration-year": "cc-exp-year", "credit-card-security-code": "cc-csc", "credit-card-type": "cc-type", "transaction-currency": "transaction-currency", "transaction-amount": "transaction-amount", language: "language", birthdate: "bday", "birthdate-day": "bday-day", "birthdate-month": "bday-month", "birthdate-year": "bday-year", gender: "sex", "phone-number": "tel", "phone-country-code": "tel-country-code", "phone-national": "tel-national", "phone-area-code": "tel-area-code", "phone-local": "tel-local", "phone-local-prefix": "tel-local-prefix", "phone-local-suffix": "tel-local-suffix", "phone-extension": "tel-extension", url: "url", photo: "photo", impp: "impp", shipping: "shipping", billing: "billing", home: "home", work: "work", mobile: "mobile", fax: "fax", pager: "pager" };
1700
1700
  var Y = require("react/jsx-runtime");
1701
- var Oe = class Oe extends vs.PureComponent {
1701
+ var Ae = class Ae extends vs.PureComponent {
1702
1702
  constructor(r) {
1703
1703
  super(r);
1704
1704
  this.getAutocompleteValue = () => {
@@ -1744,7 +1744,7 @@ var require_main_min = __commonJS({
1744
1744
  return (0, Y.jsx)(W.Checkbox, { checked: Cs(A, { coerceValue: true }), disabled: u, label: w, required: p, readOnly: d, onChange: this.handleOnChange, onBlur: this.handleOnBlur, onFocus: this.handleOnFocus });
1745
1745
  case N.SELECT: {
1746
1746
  let k = c.length >= 20, G = c, H = this.getSelectedOption(c);
1747
- return (0, Y.jsx)("div", { className: "d-flex flex-column", children: (0, Y.jsx)(W.SelectInput, { id: P, items: G.map((x) => ({ type: "option", value: x, disabled: x.disabled })), value: H != null ? H : null, renderValue: ({ hideIconInTrigger: x, icon: X, label: z, note: K, secondary: ie }, Ke) => (0, Y.jsx)(W.SelectInputOptionContent, { title: z, note: K != null ? K : ie, icon: Ke && x ? void 0 : X }), filterable: k, disabled: u, placeholder: a, filterPlaceholder: y, onChange: (x) => {
1747
+ return (0, Y.jsx)("div", { className: "d-flex flex-column", children: (0, Y.jsx)(W.SelectInput, { id: P, items: G.map((x) => ({ type: "option", value: x, disabled: x.disabled })), value: H != null ? H : null, renderValue: ({ hideIconInTrigger: x, icon: X, label: z, note: K, secondary: ie }, Je) => (0, Y.jsx)(W.SelectInputOptionContent, { title: z, note: K != null ? K : ie, icon: Je && x ? void 0 : X }), filterable: k, disabled: u, placeholder: a, filterPlaceholder: y, onChange: (x) => {
1748
1748
  var X;
1749
1749
  this.setState({ selectedOption: x }), this.props.onChange((X = x == null ? void 0 : x.value) != null ? X : null);
1750
1750
  }, onFilterChange: k && g ? ({ query: x }) => {
@@ -1800,14 +1800,14 @@ var require_main_min = __commonJS({
1800
1800
  }
1801
1801
  }
1802
1802
  };
1803
- Oe.Type = N, Oe.Size = pi, Oe.MonthFormat = ui, Oe.DateMode = di, Oe.defaultProps = { autoComplete: true, countryCode: null, disabled: false, displayPattern: null, id: null, label: "", max: null, maxDate: null, maxLength: null, min: null, minDate: null, minLength: null, mode: Oe.DateMode.DAY_MONTH_YEAR, monthFormat: Oe.MonthFormat.LONG, onBlur: null, onFocus: null, onSearchChange: null, options: [], placeholder: null, readOnly: false, required: false, searchPlaceholder: null, searchValue: "", selectedOption: null, size: Oe.Size.MEDIUM, step: 1, type: Oe.Type.TEXT, uploadProps: {}, value: null };
1804
- var Ht = Oe;
1803
+ Ae.Type = N, Ae.Size = pi, Ae.MonthFormat = ui, Ae.DateMode = di, Ae.defaultProps = { autoComplete: true, countryCode: null, disabled: false, displayPattern: null, id: null, label: "", max: null, maxDate: null, maxLength: null, min: null, minDate: null, minLength: null, mode: Ae.DateMode.DAY_MONTH_YEAR, monthFormat: Ae.MonthFormat.LONG, onBlur: null, onFocus: null, onSearchChange: null, options: [], placeholder: null, readOnly: false, required: false, searchPlaceholder: null, searchValue: "", selectedOption: null, size: Ae.Size.MEDIUM, step: 1, type: Ae.Type.TEXT, uploadProps: {}, value: null };
1804
+ var Ht = Ae;
1805
1805
  var ot = require("@transferwise/components");
1806
1806
  Ms();
1807
1807
  yo();
1808
1808
  var Qg = require("react");
1809
1809
  var ew = require("react/jsx-runtime");
1810
- var ge = require("react/jsx-runtime");
1810
+ var we = require("react/jsx-runtime");
1811
1811
  var Es = (e, t) => {
1812
1812
  switch (t) {
1813
1813
  case "select":
@@ -1820,9 +1820,9 @@ var require_main_min = __commonJS({
1820
1820
  var Vd = (e) => s(s(s({ label: e.title, value: e.const }, Wd(e.title, e.description)), qt(e)), ks(e.disabled));
1821
1821
  var Hd = (e) => s(s(s(s(s({ label: e.title, value: e.const }, $d(e.title, e.description)), _d(e.icon)), Gd(e.image)), ks(e.disabled)), qd(e.keywords));
1822
1822
  var qd = (e) => U(e) ? { searchStrings: e } : {};
1823
- var Gd = (e) => e != null && e.url ? { icon: (0, ge.jsx)("div", { className: "media", children: (0, ge.jsx)("div", { className: "np-option__no-media-circle", children: (0, ge.jsx)("img", { src: e.url, alt: e.name || "" }) }) }), hideIconInTrigger: true } : null;
1824
- var _d = (e) => e != null && e.name && Nt(e.name) ? { icon: (0, ge.jsx)(go, { code: e.name.substring(5), intrinsicSize: 24 }) } : e != null && e.name && Xa(e.name) ? { icon: (0, ge.jsx)(tt, { type: e.name }) } : e != null && e.text ? { icon: (0, ge.jsx)("span", { children: e.text }) } : null;
1825
- var qt = ({ image: e, icon: t }) => e != null && e.url ? { avatar: (0, ge.jsx)(ot.Avatar, { type: ot.AvatarType.THUMBNAIL, children: (0, ge.jsx)("img", { src: e.url, alt: "" }) }) } : t != null && t.name && Xa(t.name) ? { avatar: (0, ge.jsx)(ot.Avatar, { type: ot.AvatarType.ICON, children: (0, ge.jsx)(tt, { type: t.name }) }) } : t != null && t.text ? { avatar: (0, ge.jsx)(ot.Avatar, { type: ot.AvatarType.INITIALS, children: t.text }) } : null;
1823
+ var Gd = (e) => e != null && e.url ? { icon: (0, we.jsx)("div", { className: "media", children: (0, we.jsx)("div", { className: "np-option__no-media-circle", children: (0, we.jsx)("img", { src: e.url, alt: e.name || "" }) }) }), hideIconInTrigger: true } : null;
1824
+ var _d = (e) => e != null && e.name && Nt(e.name) ? { icon: (0, we.jsx)(go, { code: e.name.substring(5), intrinsicSize: 24 }) } : e != null && e.name && Xa(e.name) ? { icon: (0, we.jsx)(tt, { type: e.name }) } : e != null && e.text ? { icon: (0, we.jsx)("span", { children: e.text }) } : null;
1825
+ var qt = ({ image: e, icon: t }) => e != null && e.url ? { avatar: (0, we.jsx)(ot.Avatar, { type: ot.AvatarType.THUMBNAIL, children: (0, we.jsx)("img", { src: e.url, alt: "" }) }) } : t != null && t.name && Xa(t.name) ? { avatar: (0, we.jsx)(ot.Avatar, { type: ot.AvatarType.ICON, children: (0, we.jsx)(tt, { type: t.name }) }) } : t != null && t.text ? { avatar: (0, we.jsx)(ot.Avatar, { type: ot.AvatarType.INITIALS, children: t.text }) } : null;
1826
1826
  var oa = ({ accepts: e }) => s({}, U(e) && { usAccept: e.join(",") });
1827
1827
  var $d = (e, t) => {
1828
1828
  if (e && t)
@@ -1838,14 +1838,14 @@ var require_main_min = __commonJS({
1838
1838
  };
1839
1839
  var wo = require("react/jsx-runtime");
1840
1840
  var Kd = (e) => e === "string" || e === "number";
1841
- var So = (e) => Se(e) ? e.control === N.TAB && e.oneOf.length > 3 ? N.SELECT : e.control || N.SELECT : Rr(e) ? Jd(e) : "control" in e && e.control ? e.control : e.type === "boolean" ? "checkbox" : e.type === "integer" ? "number" : e.type;
1841
+ var So = (e) => Ce(e) ? e.control === N.TAB && e.oneOf.length > 3 ? N.SELECT : e.control || N.SELECT : Rr(e) ? Jd(e) : "control" in e && e.control ? e.control : e.type === "boolean" ? "checkbox" : e.type === "integer" ? "number" : e.type;
1842
1842
  var Jd = ({ format: e, control: t }) => t ? Yd[t] || t : e && Xd[e] || "text";
1843
1843
  var Yd = { "date-lookup": "date-lookup", password: "password", textarea: "textarea", email: "email", numeric: "numeric", "phone-number": "tel" };
1844
1844
  var Xd = { date: "date", email: "email", base64url: "file", password: "password", "phone-number": "tel" };
1845
1845
  var Zd = (e, t) => e.oneOf ? e.oneOf.map((r) => Es(r, t)) : null;
1846
1846
  function Ds(e) {
1847
1847
  let { id: t, schema: r, value: a, disabled: o, onChange: n, onFocus: i, onBlur: c, onSearchChange: u, describedBy: d } = e, p = It(), h = (b) => Kd(r.type) && (I(b) || ee(b)) ? "" : b, f = (b, w, v) => {
1848
- n(Ye(b, r), w, v);
1848
+ n(Xe(b, r), w, v);
1849
1849
  }, m = So(r);
1850
1850
  (0, Is.useEffect)(() => {
1851
1851
  Qd(r, p, m);
@@ -1855,15 +1855,15 @@ var require_main_min = __commonJS({
1855
1855
  }
1856
1856
  Ds.defaultProps = { value: null, onFocus: null, onBlur: null, onSearchChange: null, disabled: false };
1857
1857
  var Qd = (e, t, r) => {
1858
- Se(e) && e.oneOf.length === 2 && !e.control && t.warning("Deprecation warning", 'A oneOf schema with 2 options and no control type currently renders as a "radio" but will be changed to render as a "select". Please specify control radio to retain the existing behaviour.'), r === "file" && t.warning("Deprecation warning", "Please use a persist-async blob schema instead of string with base64url for file uploads. The base64url does not perform well on low end devices. Support for this schema will be removed in a later release."), e.values && t.warning("Deprecated schema", "Schema.values is a legacy approach. Please use oneOf.");
1858
+ Ce(e) && e.oneOf.length === 2 && !e.control && t.warning("Deprecation warning", 'A oneOf schema with 2 options and no control type currently renders as a "radio" but will be changed to render as a "select". Please specify control radio to retain the existing behaviour.'), r === "file" && t.warning("Deprecation warning", "Please use a persist-async blob schema instead of string with base64url for file uploads. The base64url does not perform well on low end devices. Support for this schema will be removed in a later release."), e.values && t.warning("Deprecated schema", "Schema.values is a legacy approach. Please use oneOf.");
1859
1859
  };
1860
1860
  var fr = Ds;
1861
1861
  var te = require("react/jsx-runtime");
1862
1862
  function Rs(e) {
1863
- let t = ae(), [r, a] = (0, Be.useState)(false), [o, n] = (0, Be.useState)(false), [i, c] = (0, Be.useState)(false), u = (0, Be.useMemo)(() => e.schema.$id || Re(), [e.schema.$id]), [d, p] = (0, Be.useState)(Qr(e.schema, e.model)), [h, f] = (0, Be.useState)(au(e.model, e.schema.oneOf)), m = ni(t, 200), l = (E) => {
1863
+ let t = ae(), [r, a] = (0, ze.useState)(false), [o, n] = (0, ze.useState)(false), [i, c] = (0, ze.useState)(false), u = (0, ze.useMemo)(() => e.schema.$id || Ne(), [e.schema.$id]), [d, p] = (0, ze.useState)(Qr(e.schema, e.model)), [h, f] = (0, ze.useState)(au(e.model, e.schema.oneOf)), m = ni(t, 200), l = (E) => {
1864
1864
  m("Dynamic Flow - OneOf Searched", { oneOfId: e.schema.analyticsId, searchValueLength: E.length });
1865
1865
  };
1866
- if ((0, Be.useEffect)(() => {
1866
+ if ((0, ze.useEffect)(() => {
1867
1867
  let E = ur(e.schema, e.model), A = ur(e.schema, e.schema.default);
1868
1868
  E === -1 && A >= 0 && b(A, "init");
1869
1869
  }, [e.schema]), !U(e.schema.oneOf))
@@ -1877,23 +1877,23 @@ var require_main_min = __commonJS({
1877
1877
  }, b = (E, A, L) => {
1878
1878
  p(E);
1879
1879
  let O = e.schema.oneOf[E];
1880
- if (Ce(O)) {
1880
+ if (be(O)) {
1881
1881
  let B = O.const;
1882
1882
  e.onChange({ model: B, triggerSchema: e.schema, triggerModel: B, type: A, metadata: L });
1883
1883
  } else
1884
1884
  e.onChange({ model: h[E], triggerSchema: O, triggerModel: h[E], type: A, metadata: L });
1885
1885
  A !== "init" && e.schema.analyticsId && t("Dynamic Flow - OneOf Selected", { oneOfId: e.schema.analyticsId, schemaId: O == null ? void 0 : O.analyticsId });
1886
1886
  }, w = ou(e.schema), v = tu(e, d), P = { "form-group": true, "has-error": !r && e.errors && !Dt(e.errors) || (e.submitted || r && i) && v.length }, M = `${u}-feedback`;
1887
- return (0, te.jsxs)(te.Fragment, { children: [(e.schema.oneOf.length > 1 || Ce(e.schema.oneOf[0])) && (0, te.jsxs)(te.Fragment, { children: [e.schema.alert && (0, te.jsx)(ce, { component: e.schema.alert }), (0, te.jsxs)("div", { className: (0, Ts.default)(P), children: [eu(e.schema, u), (0, te.jsx)(fr, { id: u, schema: w, value: d, disabled: e.disabled, describedBy: M, onChange: b, onFocus: g, onBlur: C, onSearchChange: l }), (0, te.jsx)(qe, { id: M, changed: r, focused: o, blurred: i, submitted: e.submitted, errors: ru(e.errors), schema: e.schema, validations: v, infoMessage: null })] })] }), ir(e.schema.oneOf[d]) && (0, te.jsx)(me, { schema: e.schema.oneOf[d], model: h[d], errors: e.errors, submitted: e.submitted, hideTitle: true, disabled: e.disabled, onChange: (E) => y(d, E), onPersistAsync: e.onPersistAsync })] });
1887
+ return (0, te.jsxs)(te.Fragment, { children: [(e.schema.oneOf.length > 1 || be(e.schema.oneOf[0])) && (0, te.jsxs)(te.Fragment, { children: [e.schema.alert && (0, te.jsx)(ce, { component: e.schema.alert }), (0, te.jsxs)("div", { className: (0, Ts.default)(P), children: [eu(e.schema, u), (0, te.jsx)(fr, { id: u, schema: w, value: d, disabled: e.disabled, describedBy: M, onChange: b, onFocus: g, onBlur: C, onSearchChange: l }), (0, te.jsx)(Ge, { id: M, changed: r, focused: o, blurred: i, submitted: e.submitted, errors: ru(e.errors), schema: e.schema, validations: v, infoMessage: null })] })] }), ir(e.schema.oneOf[d]) && (0, te.jsx)(me, { schema: e.schema.oneOf[d], model: h[d], errors: e.errors, submitted: e.submitted, hideTitle: true, disabled: e.disabled, onChange: (E) => y(d, E), onPersistAsync: e.onPersistAsync })] });
1888
1888
  }
1889
1889
  function eu(e, t) {
1890
1890
  var o;
1891
- let r = e.help ? (0, te.jsx)(Ge, { help: e.help }) : null, a = Ce(e.oneOf[0]) ? (0, te.jsx)("div", { className: "m-b-1", children: (0, te.jsxs)("label", { className: "control-label d-inline", htmlFor: t, children: [e.title, " ", r] }) }) : (0, te.jsx)(te.Fragment, { children: r ? (0, te.jsxs)("h4", { className: "m-b-2", children: [e.title, " ", r] }) : (0, te.jsx)(Ls.Header, { title: (o = e.title) != null ? o : "" }) });
1891
+ let r = e.help ? (0, te.jsx)(_e, { help: e.help }) : null, a = be(e.oneOf[0]) ? (0, te.jsx)("div", { className: "m-b-1", children: (0, te.jsxs)("label", { className: "control-label d-inline", htmlFor: t, children: [e.title, " ", r] }) }) : (0, te.jsx)(te.Fragment, { children: r ? (0, te.jsxs)("h4", { className: "m-b-2", children: [e.title, " ", r] }) : (0, te.jsx)(Ls.Header, { title: (o = e.title) != null ? o : "" }) });
1892
1892
  return e.title ? a : r;
1893
1893
  }
1894
1894
  function tu(e, t) {
1895
1895
  let r = e.schema.oneOf[t != null ? t : -1];
1896
- return Ce(r) ? Xe(r.const, e.schema, !!e.required) : t === null || t < 0 ? Xe(null, e.schema, !!e.required) : [];
1896
+ return be(r) ? Ze(r.const, e.schema, !!e.required) : t === null || t < 0 ? Ze(null, e.schema, !!e.required) : [];
1897
1897
  }
1898
1898
  function ru(e) {
1899
1899
  return typeof e == "string" ? e : null;
@@ -1910,7 +1910,7 @@ var require_main_min = __commonJS({
1910
1910
  }
1911
1911
  Rs.defaultProps = { required: false, disabled: false };
1912
1912
  var Co = Rs;
1913
- var js = Ie(et());
1913
+ var js = De(et());
1914
1914
  var Ct = require("react");
1915
1915
  var na = require("@transferwise/components");
1916
1916
  var Ns = require("react");
@@ -1923,7 +1923,7 @@ var require_main_min = __commonJS({
1923
1923
  function Us(e) {
1924
1924
  let { model: t, schema: r, submitted: a, required: o, errors: n, onChange: i } = e, [c, u] = (0, Ct.useState)({}), [d, p] = (0, Ct.useState)(null), [h, f] = (0, Ct.useState)([]), [m, l] = (0, Ct.useState)(false), y = oe(), g = ae();
1925
1925
  (0, Ct.useEffect)(() => {
1926
- f(a ? Xe(t, r, !!o) : []);
1926
+ f(a ? Ze(t, r, !!o) : []);
1927
1927
  }, [t, r, a, o]);
1928
1928
  let C = async (O, B) => {
1929
1929
  let k = await O.json(), G = xo(r.persistAsync.idProperty, k);
@@ -1937,7 +1937,7 @@ var require_main_min = __commonJS({
1937
1937
  }, w = () => {
1938
1938
  p(null), i({ model: null, triggerSchema: r, triggerModel: null }), l(true);
1939
1939
  }, { url: v, method: P } = r.persistAsync, M = d || h, E = { "form-group": true, "has-error": (a || m) && !!M.length }, A = r.$id || r.persistAsync.schema.$id || r.persistAsync.idProperty, L = `${A}-feedback`;
1940
- return (0, Gt.jsxs)("div", { className: (0, js.default)(E), children: [(0, Gt.jsx)("div", { "aria-describedby": L, children: (0, Gt.jsx)(Bs, s({ id: A, fileId: t, idProperty: r.persistAsync.idProperty, animationDelay: 0, maxSize: r.persistAsync.schema.maxSize, usLabel: r.title || r.persistAsync.schema.title, usPlaceholder: r.description || r.persistAsync.schema.description, httpOptions: { url: v, method: P, fileInputName: r.persistAsync.param }, httpClient: y, onSuccess: C, onFailure: b, onCancel: w }, oa(r.persistAsync.schema))) }), (0, Gt.jsx)(qe, { id: L, blurred: true, focused: false, changed: m, submitted: a, errors: n, schema: r, validations: M, validationMessages: s({ required: "Value is required..." }, c), infoMessage: null })] });
1940
+ return (0, Gt.jsxs)("div", { className: (0, js.default)(E), children: [(0, Gt.jsx)("div", { "aria-describedby": L, children: (0, Gt.jsx)(Bs, s({ id: A, fileId: t, idProperty: r.persistAsync.idProperty, animationDelay: 0, maxSize: r.persistAsync.schema.maxSize, usLabel: r.title || r.persistAsync.schema.title, usPlaceholder: r.description || r.persistAsync.schema.description, httpOptions: { url: v, method: P, fileInputName: r.persistAsync.param }, httpClient: y, onSuccess: C, onFailure: b, onCancel: w }, oa(r.persistAsync.schema))) }), (0, Gt.jsx)(Ge, { id: L, blurred: true, focused: false, changed: m, submitted: a, errors: n, schema: r, validations: M, validationMessages: s({ required: "Value is required..." }, c), infoMessage: null })] });
1941
1941
  }
1942
1942
  Us.defaultProps = { required: false };
1943
1943
  var Fo = Us;
@@ -1983,14 +1983,14 @@ var require_main_min = __commonJS({
1983
1983
  return (0, _t.jsx)(_t.Fragment, {});
1984
1984
  }
1985
1985
  }
1986
- Js.defaultProps = { id: Re(), title: void 0 };
1986
+ Js.defaultProps = { id: Ne(), title: void 0 };
1987
1987
  var Ys = Js;
1988
- var $e = require("react/jsx-runtime");
1988
+ var We = require("react/jsx-runtime");
1989
1989
  var Zs = (e) => e.promoted === true;
1990
1990
  var iu = (e) => {
1991
1991
  var c;
1992
1992
  let [t, r] = (0, Xs.useState)(Hs(e.schema, e.model) || ((c = e.schema.promotion) == null ? void 0 : c.default) || "promoted"), a = e.schema.alert, o = e.schema.oneOf.find(Zs), n = su(o), i = cu(e.schema);
1993
- return (0, $e.jsxs)($e.Fragment, { children: [a && (0, $e.jsx)(ce, { component: a }), (0, $e.jsx)(Ys, { id: e.schema.$id, title: e.schema.title, promotedOneOf: o, promotion: e.schema.promotion, selection: t, setSelection: r }), t === "promoted" && (0, $e.jsx)(pr, S(s({}, e), { schema: n })), t === "other" && (0, $e.jsx)(me, S(s({}, e), { schema: i }))] });
1993
+ return (0, We.jsxs)(We.Fragment, { children: [a && (0, We.jsx)(ce, { component: a }), (0, We.jsx)(Ys, { id: e.schema.$id, title: e.schema.title, promotedOneOf: o, promotion: e.schema.promotion, selection: t, setSelection: r }), t === "promoted" && (0, We.jsx)(pr, S(s({}, e), { schema: n })), t === "other" && (0, We.jsx)(me, S(s({}, e), { schema: i }))] });
1994
1994
  };
1995
1995
  function su(e) {
1996
1996
  return S(s({}, e), { title: void 0, description: void 0 });
@@ -2012,7 +2012,7 @@ var require_main_min = __commonJS({
2012
2012
  }
2013
2013
  var Eo = lu;
2014
2014
  function mu({ schema: e, model: t, formatMessage: r }) {
2015
- return Ve(e) ? Se(e) ? du(e, t) : e.type === "boolean" && De(t) ? r(t ? Mo.yes : Mo.no) : t && t.toString() || "" : "";
2015
+ return He(e) ? Ce(e) ? du(e, t) : e.type === "boolean" && Le(t) ? r(t ? Mo.yes : Mo.no) : t && t.toString() || "" : "";
2016
2016
  }
2017
2017
  function du(e, t) {
2018
2018
  let r = uu(e, t);
@@ -2025,11 +2025,11 @@ var require_main_min = __commonJS({
2025
2025
  let t = e.title && e.description ? `${e.title} - ${e.description}` : e.title || "", r = qt({ icon: e.icon });
2026
2026
  return r != null && r.avatar ? (0, $t.jsxs)($t.Fragment, { children: [r.avatar, " ", t] }) : t;
2027
2027
  }
2028
- var ze = require("react");
2028
+ var je = require("react");
2029
2029
  var rc = require("react/jsx-runtime");
2030
2030
  function tc(e) {
2031
- let { schema: t, model: r, required: a, submitted: o, errors: n, onChange: i } = e, [c, u] = (0, ze.useState)(r), d = (0, ze.useRef)(null), [p, h] = (0, ze.useState)(null), [f, m] = (0, ze.useState)(null), [l, y] = (0, ze.useState)(false), [g, C] = (0, ze.useState)(null), b = oe(), w = ae(), v = It();
2032
- (0, ze.useEffect)(() => {
2031
+ let { schema: t, model: r, required: a, submitted: o, errors: n, onChange: i } = e, [c, u] = (0, je.useState)(r), d = (0, je.useRef)(null), [p, h] = (0, je.useState)(null), [f, m] = (0, je.useState)(null), [l, y] = (0, je.useState)(false), [g, C] = (0, je.useState)(null), b = oe(), w = ae(), v = It();
2032
+ (0, je.useEffect)(() => {
2033
2033
  t.validationAsync.method || v.warning("Invalid schema or model", 'ValidationAsyncSchema without a "method" property would have defaulted to "GET" in previous versions. Now defaults to "POST".', {});
2034
2034
  }, [v, t.validationAsync.method]);
2035
2035
  let P = async (O, B) => {
@@ -2038,7 +2038,7 @@ var require_main_min = __commonJS({
2038
2038
  let H = await b(B.url, { method: B.method || "POST", headers: { "Content-Type": "application/json" }, body: B.method === "GET" ? void 0 : JSON.stringify(G), signal: k });
2039
2039
  try {
2040
2040
  let x = await H.json();
2041
- if (!R(x))
2041
+ if (!T(x))
2042
2042
  throw new Error("Response body is not an object");
2043
2043
  w("Dynamic Flow - ValidationAsync", { status: "success" }), H.status === 200 ? h(D(x.message) ? x.message : null) : H.status === 422 && m(D(x.message) ? x.message : null);
2044
2044
  } catch (x) {
@@ -2052,12 +2052,12 @@ var require_main_min = __commonJS({
2052
2052
  return (0, rc.jsx)(bt, s({}, { submitted: o || l, model: c, errors: f || n, infoMessage: p, onChange: (O) => {
2053
2053
  i(S(s({}, O), { triggerSchema: t, triggerModel: O.model })), m(null), h(null), u(O.model);
2054
2054
  }, onBlur: () => {
2055
- !I(c) && !Qe(c, d.current) && $(c, t) && P(c, t.validationAsync);
2055
+ !I(c) && !he(c, d.current) && $(c, t) && P(c, t.validationAsync);
2056
2056
  }, required: a, schema: t }));
2057
2057
  }
2058
2058
  tc.defaultProps = { required: false };
2059
2059
  var ko = tc;
2060
- var we = require("react/jsx-runtime");
2060
+ var Se = require("react/jsx-runtime");
2061
2061
  var oc = require("react");
2062
2062
  function fu(e) {
2063
2063
  let { schema: t, model: r = null, errors: a = null, hideTitle: o = false, disabled: n = false } = e, i = S(s({}, e), { model: r, errors: a, hideTitle: o, disabled: n }), c = dt(t), u = It();
@@ -2065,27 +2065,27 @@ var require_main_min = __commonJS({
2065
2065
  yu(t, r, a) || u.error("Invalid schema or model", `Schema of type ${c || "undefined"} requested, but schema did not pass validation.`);
2066
2066
  }, [JSON.stringify(t), JSON.stringify(r), JSON.stringify(a), c, u]), c) {
2067
2067
  case "readOnly":
2068
- return (0, we.jsx)(Eo, s({}, i));
2068
+ return (0, Se.jsx)(Eo, s({}, i));
2069
2069
  case "persistAsync":
2070
- return (0, we.jsx)(Oo, s({}, i));
2070
+ return (0, Se.jsx)(Oo, s({}, i));
2071
2071
  case "validationAsync":
2072
- return (0, we.jsx)(ko, s({}, i));
2072
+ return (0, Se.jsx)(ko, s({}, i));
2073
2073
  case "basic": {
2074
2074
  let d = s({ infoMessage: null }, i);
2075
- return (0, we.jsx)(bt, s({}, d));
2075
+ return (0, Se.jsx)(bt, s({}, d));
2076
2076
  }
2077
2077
  case "object":
2078
2078
  return (0, oc.createElement)(pr, S(s({}, i), { key: JSON.stringify(t) }));
2079
2079
  case "array":
2080
- return (0, we.jsx)(lo, s({}, i));
2080
+ return (0, Se.jsx)(lo, s({}, i));
2081
2081
  case "promotedOneOf":
2082
- return (0, we.jsx)(Po, s({}, i));
2082
+ return (0, Se.jsx)(Po, s({}, i));
2083
2083
  case "oneOf":
2084
- return (0, we.jsx)(Co, s({}, i));
2084
+ return (0, Se.jsx)(Co, s({}, i));
2085
2085
  case "allOf":
2086
- return (0, we.jsx)(oo, s({}, i));
2086
+ return (0, Se.jsx)(oo, s({}, i));
2087
2087
  }
2088
- return (0, we.jsx)(we.Fragment, {});
2088
+ return (0, Se.jsx)(Se.Fragment, {});
2089
2089
  }
2090
2090
  var me = fu;
2091
2091
  var yu = (e, t, r) => {
@@ -2095,15 +2095,15 @@ var require_main_min = __commonJS({
2095
2095
  case "validationAsync":
2096
2096
  return $a(e) && Ka(t) && sr(r);
2097
2097
  case "basic":
2098
- return Ve(e) && Ka(t) && sr(r);
2098
+ return He(e) && Ka(t) && sr(r);
2099
2099
  case "object":
2100
- return Te(e) && Wa(t);
2100
+ return Re(e) && Wa(t);
2101
2101
  case "array":
2102
- return Ue(e) && ri(t) && sr(r);
2102
+ return Ve(e) && ri(t) && sr(r);
2103
2103
  case "promotedOneOf":
2104
2104
  return mt(e) && Wa(t);
2105
2105
  case "oneOf":
2106
- return Se(e);
2106
+ return Ce(e);
2107
2107
  case "allOf":
2108
2108
  return _a(e) && J(t);
2109
2109
  }
@@ -2118,38 +2118,38 @@ var require_main_min = __commonJS({
2118
2118
  }
2119
2119
  var Do = hu;
2120
2120
  var sa = require("@transferwise/components");
2121
- var nc = Ie(et());
2122
- var Ae = require("react/jsx-runtime");
2121
+ var nc = De(et());
2122
+ var Pe = require("react/jsx-runtime");
2123
2123
  var gu = (e) => {
2124
- let { text: t, size: r = "md", align: a = "left", margin: o = "md", control: n } = e.component, i = (0, nc.default)(Fe({ align: a, margin: o }));
2125
- return n === "display" ? (0, Ae.jsx)(Su, { size: r, text: t, classes: i }) : (0, Ae.jsx)(wu, { size: r, text: t, classes: i });
2124
+ let { text: t, size: r = "md", align: a = "left", margin: o = "md", control: n } = e.component, i = (0, nc.default)(xe({ align: a, margin: o }));
2125
+ return n === "display" ? (0, Pe.jsx)(Su, { size: r, text: t, classes: i }) : (0, Pe.jsx)(wu, { size: r, text: t, classes: i });
2126
2126
  };
2127
2127
  var wu = ({ size: e, text: t, classes: r }) => {
2128
2128
  switch (e) {
2129
2129
  case "xs":
2130
- return (0, Ae.jsx)("h5", { className: r, children: t });
2130
+ return (0, Pe.jsx)("h5", { className: r, children: t });
2131
2131
  case "sm":
2132
- return (0, Ae.jsx)("h4", { className: r, children: t });
2132
+ return (0, Pe.jsx)("h4", { className: r, children: t });
2133
2133
  case "lg":
2134
- return (0, Ae.jsx)("h2", { className: r, children: t });
2134
+ return (0, Pe.jsx)("h2", { className: r, children: t });
2135
2135
  case "xl":
2136
- return (0, Ae.jsx)("h1", { className: r, children: t });
2136
+ return (0, Pe.jsx)("h1", { className: r, children: t });
2137
2137
  case "md":
2138
2138
  default:
2139
- return (0, Ae.jsx)("h3", { className: r, children: t });
2139
+ return (0, Pe.jsx)("h3", { className: r, children: t });
2140
2140
  }
2141
2141
  };
2142
2142
  var Su = ({ size: e, text: t, classes: r }) => {
2143
2143
  switch (e) {
2144
2144
  case "xs":
2145
2145
  case "sm":
2146
- return (0, Ae.jsx)(sa.Display, { type: "display-small", className: r, children: t });
2146
+ return (0, Pe.jsx)(sa.Display, { type: "display-small", className: r, children: t });
2147
2147
  case "xl":
2148
2148
  case "lg":
2149
- return (0, Ae.jsx)(sa.Display, { type: "display-large", className: r, children: t });
2149
+ return (0, Pe.jsx)(sa.Display, { type: "display-large", className: r, children: t });
2150
2150
  case "md":
2151
2151
  default:
2152
- return (0, Ae.jsx)(sa.Display, { type: "display-medium", className: r, children: t });
2152
+ return (0, Pe.jsx)(sa.Display, { type: "display-medium", className: r, children: t });
2153
2153
  }
2154
2154
  };
2155
2155
  var Lo = gu;
@@ -2157,9 +2157,9 @@ var require_main_min = __commonJS({
2157
2157
  var hr = require("react/jsx-runtime");
2158
2158
  var Ro = ({ component: e }) => {
2159
2159
  let { content: t, align: r, margin: a } = e;
2160
- return (0, hr.jsx)("div", { className: Fe({ align: r, margin: a }), children: (0, hr.jsx)(To.Markdown, { config: { link: { target: "_blank" } }, children: t }) });
2160
+ return (0, hr.jsx)("div", { className: xe({ align: r, margin: a }), children: (0, hr.jsx)(To.Markdown, { config: { link: { target: "_blank" } }, children: t }) });
2161
2161
  };
2162
- var No = ({ component: e }) => (0, hr.jsx)("div", { className: Fe(e), children: (0, hr.jsx)(To.Markdown, { config: { link: { target: "_blank" } }, children: e.markdown }) });
2162
+ var No = ({ component: e }) => (0, hr.jsx)("div", { className: xe(e), children: (0, hr.jsx)(To.Markdown, { config: { link: { target: "_blank" } }, children: e.markdown }) });
2163
2163
  var ic = require("@transferwise/components");
2164
2164
  var ca = require("react");
2165
2165
  var Bo = require("react/jsx-runtime");
@@ -2283,14 +2283,14 @@ var require_main_min = __commonJS({
2283
2283
  return e.control === "copyable" ? (0, nt.jsx)(Nu, { component: e }) : (0, nt.jsx)(Ru, { component: e });
2284
2284
  }
2285
2285
  function Ru({ component: e }) {
2286
- return (0, nt.jsxs)("p", { className: Fe(e), children: [" ", e.text, " "] });
2286
+ return (0, nt.jsxs)("p", { className: xe(e), children: [" ", e.text, " "] });
2287
2287
  }
2288
2288
  function Nu({ component: e }) {
2289
2289
  let { formatMessage: t } = (0, fc.useIntl)(), r = uc(), { text: a } = e, o = () => {
2290
2290
  var i;
2291
2291
  (i = navigator.clipboard) == null || i.writeText(a).then(() => r({ text: t(_o.copied) })).catch(Bu);
2292
- }, n = `${Fe({ align: e.align, margin: "sm" })} form-control`;
2293
- return (0, nt.jsxs)("div", { className: Fe(e), children: [(0, nt.jsx)("input", { type: "text", className: n, value: a, readOnly: true, style: { textOverflow: "ellipsis" } }), (0, nt.jsx)(pc.Button, { block: true, onClick: o, children: t(_o.copy) })] });
2292
+ }, n = `${xe({ align: e.align, margin: "sm" })} form-control`;
2293
+ return (0, nt.jsxs)("div", { className: xe(e), children: [(0, nt.jsx)("input", { type: "text", className: n, value: a, readOnly: true, style: { textOverflow: "ellipsis" } }), (0, nt.jsx)(pc.Button, { block: true, onClick: o, children: t(_o.copy) })] });
2294
2294
  }
2295
2295
  function Bu() {
2296
2296
  }
@@ -2298,7 +2298,7 @@ var require_main_min = __commonJS({
2298
2298
  var da = require("@transferwise/components");
2299
2299
  var de = require("react/jsx-runtime");
2300
2300
  var zu = (e, t) => t.fields.map(({ label: r, value: a, help: o }, n) => ({ key: String(n), title: r, value: ju(a, o, e) }));
2301
- var ju = (e, t, r) => t ? r === "HORIZONTAL_RIGHT_ALIGNED" ? (0, de.jsxs)(de.Fragment, { children: [(0, de.jsx)(Ge, { help: t }), " ", e] }) : (0, de.jsxs)(de.Fragment, { children: [e, " ", (0, de.jsx)(Ge, { help: t })] }) : e;
2301
+ var ju = (e, t, r) => t ? r === "HORIZONTAL_RIGHT_ALIGNED" ? (0, de.jsxs)(de.Fragment, { children: [(0, de.jsx)(_e, { help: t }), " ", e] }) : (0, de.jsxs)(de.Fragment, { children: [e, " ", (0, de.jsx)(_e, { help: t })] }) : e;
2302
2302
  var Uu = (e) => (e.control || e.orientation) === "horizontal" ? "HORIZONTAL_RIGHT_ALIGNED" : "VERTICAL_ONE_COLUMN";
2303
2303
  function Vu(e) {
2304
2304
  let t = e.component, r = V(t.margin || "xs"), a = (c, u) => ({ text: c != null ? c : "", href: u.url, onClick: (d) => {
@@ -2319,9 +2319,9 @@ var require_main_min = __commonJS({
2319
2319
  }
2320
2320
  function Sc({ onRetrySearch: e }) {
2321
2321
  let t = (0, gc.useIntl)();
2322
- return (0, Ft.jsxs)("p", { className: "m-t-2", children: [t.formatMessage(be.genericError), "\xA0", (0, Ft.jsx)("a", { href: "/", onClick: (r) => {
2322
+ return (0, Ft.jsxs)("p", { className: "m-t-2", children: [t.formatMessage(Fe.genericError), "\xA0", (0, Ft.jsx)("a", { href: "/", onClick: (r) => {
2323
2323
  r.preventDefault(), e();
2324
- }, children: t.formatMessage(be.retry) })] });
2324
+ }, children: t.formatMessage(Fe.retry) })] });
2325
2325
  }
2326
2326
  var Kt = require("react");
2327
2327
  var Cc = { "Content-Type": "application/json" };
@@ -2355,7 +2355,7 @@ var require_main_min = __commonJS({
2355
2355
  }, u = t.status === "success" ? t.results : [];
2356
2356
  return { status: t.status, results: u, search: n };
2357
2357
  };
2358
- var Hu = (e) => R(e) && "results" in e && U(e.results) && e.results.every((t) => R(t) && "title" in t && "type" in t && "value" in t);
2358
+ var Hu = (e) => T(e) && "results" in e && U(e.results) && e.results.every((t) => T(t) && "title" in t && "type" in t && "value" in t);
2359
2359
  var qu = (e) => e instanceof DOMException && e.name === "AbortError";
2360
2360
  var Gu = (e, t, r) => {
2361
2361
  let [a, o] = e.split("?"), n = new URLSearchParams(o);
@@ -2364,7 +2364,7 @@ var require_main_min = __commonJS({
2364
2364
  var xt = require("react/jsx-runtime");
2365
2365
  var _u = 400;
2366
2366
  function $u({ component: e, onAction: t }) {
2367
- let [r, a] = (0, fa.useState)(""), { title: o, margin: n, url: i, method: c, param: u, emptyMessage: d } = e, { status: p, results: h, search: f } = bc({ url: i, method: c, param: u }), m = ae(), l = (0, fa.useMemo)(() => Ze(f, _u), [f]), y = () => {
2367
+ let [r, a] = (0, fa.useState)(""), { title: o, margin: n, url: i, method: c, param: u, emptyMessage: d } = e, { status: p, results: h, search: f } = bc({ url: i, method: c, param: u }), m = ae(), l = (0, fa.useMemo)(() => Qe(f, _u), [f]), y = () => {
2368
2368
  m("Dynamic Flow - Search Started", {});
2369
2369
  }, g = (w) => {
2370
2370
  a(w), l(w);
@@ -2385,7 +2385,7 @@ var require_main_min = __commonJS({
2385
2385
  var Jt = require("react/jsx-runtime");
2386
2386
  function Wu(e) {
2387
2387
  let [t, r] = (0, Fc.useState)(false), { component: a, onAction: o } = e, { margin: n = "md" } = a;
2388
- return (0, Jt.jsxs)("div", { className: Fe({ margin: n }), children: [(0, Jt.jsx)(ya.Button, { priority: "tertiary", block: true, onClick: () => r(true), children: a.trigger.title }), (0, Jt.jsx)(ya.Modal, { scroll: "content", open: t, size: "lg", body: (0, Jt.jsx)(se, S(s({}, e), { components: a.content.components, onAction: (i) => {
2388
+ return (0, Jt.jsxs)("div", { className: xe({ margin: n }), children: [(0, Jt.jsx)(ya.Button, { priority: "tertiary", block: true, onClick: () => r(true), children: a.trigger.title }), (0, Jt.jsx)(ya.Modal, { scroll: "content", open: t, size: "lg", body: (0, Jt.jsx)(se, S(s({}, e), { components: a.content.components, onAction: (i) => {
2389
2389
  r(false), o(i);
2390
2390
  } })), onClose: () => r(false) })] });
2391
2391
  }
@@ -2397,15 +2397,15 @@ var require_main_min = __commonJS({
2397
2397
  var k, G, H;
2398
2398
  let t = (x, X, z) => {
2399
2399
  f(true), a(o(x), "user", z);
2400
- }, r = (x) => Xe(x, e.schema, e.required), a = (x, X, z) => {
2400
+ }, r = (x) => Ze(x, e.schema, e.required), a = (x, X, z) => {
2401
2401
  u(x);
2402
2402
  let K = r(x);
2403
2403
  b(K);
2404
2404
  let ie = x;
2405
2405
  p(ie), ie !== d && e.onChange({ model: ie, triggerSchema: e.schema, triggerModel: ie, lastTriggerModel: d, type: X, metadata: z });
2406
- }, o = (x) => Ye(x, e.schema), n = () => l(true), i = () => {
2406
+ }, o = (x) => Xe(x, e.schema), n = () => l(true), i = () => {
2407
2407
  l(false), g(true), e.onBlur && e.onBlur();
2408
- }, [c, u] = (0, ue.useState)((k = e.model) != null ? k : null), [d, p] = (0, ue.useState)((G = e.model) != null ? G : null), [h, f] = (0, ue.useState)(false), [m, l] = (0, ue.useState)(false), [y, g] = (0, ue.useState)(false), [C, b] = (0, ue.useState)([]), w = (0, ue.useMemo)(() => e.schema.$id || Re(), [e.schema.$id]), v = () => {
2408
+ }, [c, u] = (0, ue.useState)((k = e.model) != null ? k : null), [d, p] = (0, ue.useState)((G = e.model) != null ? G : null), [h, f] = (0, ue.useState)(false), [m, l] = (0, ue.useState)(false), [y, g] = (0, ue.useState)(false), [C, b] = (0, ue.useState)([]), w = (0, ue.useMemo)(() => e.schema.$id || Ne(), [e.schema.$id]), v = () => {
2409
2409
  let x = Ku(e.schema);
2410
2410
  $o(c) && !$o(x) && a(x, "init"), e.schema.const && a(e.schema.const, "init");
2411
2411
  }, P = () => {
@@ -2417,7 +2417,7 @@ var require_main_min = __commonJS({
2417
2417
  x !== c && u(x);
2418
2418
  }, [e.model]);
2419
2419
  let A = { "form-group": true, "has-error": (e.submitted || !h) && !!e.errors || (e.submitted || h && y) && !!C.length, "has-info": !!e.schema.description || !!e.infoMessage }, L = e.schema.format !== "file" && e.schema.type !== "boolean", O = e.schema.help, B = `${w}-feedback`;
2420
- return E ? null : (0, pe.jsxs)(pe.Fragment, { children: [e.schema.alert && (0, pe.jsx)(ce, { component: e.schema.alert }), (0, pe.jsxs)("div", { className: (0, xc.default)(A), children: [L && (0, pe.jsxs)("div", { className: "d-inline-block m-b-1", children: [(0, pe.jsx)("label", { className: "control-label d-inline", htmlFor: w, children: e.schema.title }), !!O && (0, pe.jsx)(Ge, { help: O })] }), !L && !!O && (0, pe.jsx)(Ge, { help: O }), (0, pe.jsx)(fr, { id: w, schema: e.schema, value: c, disabled: !!e.disabled, onChange: t, onFocus: n, onBlur: i, describedBy: B }), (0, pe.jsx)(qe, { id: B, changed: h, focused: m, blurred: y, submitted: e.submitted, errors: (H = e.errors) != null ? H : null, schema: e.schema, validations: C, infoMessage: e.infoMessage })] })] });
2420
+ return E ? null : (0, pe.jsxs)(pe.Fragment, { children: [e.schema.alert && (0, pe.jsx)(ce, { component: e.schema.alert }), (0, pe.jsxs)("div", { className: (0, xc.default)(A), children: [L && (0, pe.jsxs)("div", { className: "d-inline-block m-b-1", children: [(0, pe.jsx)("label", { className: "control-label d-inline", htmlFor: w, children: e.schema.title }), !!O && (0, pe.jsx)(_e, { help: O })] }), !L && !!O && (0, pe.jsx)(_e, { help: O }), (0, pe.jsx)(fr, { id: w, schema: e.schema, value: c, disabled: !!e.disabled, onChange: t, onFocus: n, onBlur: i, describedBy: B }), (0, pe.jsx)(Ge, { id: B, changed: h, focused: m, blurred: y, submitted: e.submitted, errors: (H = e.errors) != null ? H : null, schema: e.schema, validations: C, infoMessage: e.infoMessage })] })] });
2421
2421
  };
2422
2422
  vc.defaultProps = { required: false, disabled: false, onBlur: null };
2423
2423
  var bt = vc;
@@ -2433,7 +2433,7 @@ var require_main_min = __commonJS({
2433
2433
  (0, vt.useEffect)(() => {
2434
2434
  Ju.has(So(t.persistAsync.schema)) && M();
2435
2435
  }, [p]);
2436
- let w = () => l(c.formatMessage(be.genericErrorRetryHint)), v = async (L, O) => {
2436
+ let w = () => l(c.formatMessage(Fe.genericErrorRetryHint)), v = async (L, O) => {
2437
2437
  let B = P(), k = { [O.param]: L };
2438
2438
  g(true);
2439
2439
  try {
@@ -2441,14 +2441,14 @@ var require_main_min = __commonJS({
2441
2441
  let G = u(O.url, { method: O.method, headers: { "Content-Type": "application/json" }, body: JSON.stringify(k), signal: B });
2442
2442
  i(G);
2443
2443
  let H = await G, x = await H.json();
2444
- if (!R(x))
2444
+ if (!T(x))
2445
2445
  throw new Error("Response is not an object");
2446
2446
  let { idProperty: X, param: z } = t.persistAsync;
2447
2447
  if (kn(H.status)) {
2448
2448
  let K = xo(X, x);
2449
2449
  n({ model: K, triggerSchema: t, triggerModel: K });
2450
2450
  } else if (Lr(H.status)) {
2451
- let { validation: K } = x, ie = R(K) && (K == null ? void 0 : K[z]) || null;
2451
+ let { validation: K } = x, ie = T(K) && (K == null ? void 0 : K[z]) || null;
2452
2452
  l(ie), n({ model: null, triggerSchema: t, triggerModel: null });
2453
2453
  } else
2454
2454
  w();
@@ -2461,7 +2461,7 @@ var require_main_min = __commonJS({
2461
2461
  let L = new AbortController();
2462
2462
  return b(L), L.signal;
2463
2463
  }, M = () => {
2464
- !I(p) && !Qe(p, f) && v(p, t.persistAsync);
2464
+ !I(p) && !he(p, f) && v(p, t.persistAsync);
2465
2465
  }, E = () => {
2466
2466
  M();
2467
2467
  }, A = ({ model: L }) => {
@@ -2492,7 +2492,7 @@ var require_main_min = __commonJS({
2492
2492
  if (!m.ok)
2493
2493
  return p(m);
2494
2494
  let l = await m.json();
2495
- if (R(l)) {
2495
+ if (T(l)) {
2496
2496
  let y = l[e.idProperty];
2497
2497
  if (D(y) || j(y))
2498
2498
  return { data: y };
@@ -2505,16 +2505,16 @@ var require_main_min = __commonJS({
2505
2505
  async function p(f) {
2506
2506
  if (f.status === 422) {
2507
2507
  let m = await f.json();
2508
- if (R(m)) {
2508
+ if (T(m)) {
2509
2509
  let l = Ac(e.param, m);
2510
2510
  if (D(l))
2511
2511
  throw new Error(l);
2512
2512
  }
2513
2513
  }
2514
- throw new Error(o.formatMessage(be.genericErrorRetryHint));
2514
+ throw new Error(o.formatMessage(Fe.genericErrorRetryHint));
2515
2515
  }
2516
2516
  let h = (f) => {
2517
- let m = Xu(f) ? f.message : o.formatMessage(be.genericErrorRetryHint);
2517
+ let m = Xu(f) ? f.message : o.formatMessage(Fe.genericErrorRetryHint);
2518
2518
  throw new Error(m);
2519
2519
  };
2520
2520
  return i;
@@ -2524,7 +2524,7 @@ var require_main_min = __commonJS({
2524
2524
  return t !== null && r.append(e, t), r;
2525
2525
  }
2526
2526
  function Xu(e) {
2527
- return R(e) && "message" in e && typeof e.message == "string";
2527
+ return T(e) && "message" in e && typeof e.message == "string";
2528
2528
  }
2529
2529
  var it = require("react");
2530
2530
  function Gr({ asyncFn: e, interval: t, maxAttempts: r, maxConsecutiveFails: a, onPollingResponse: o, onFailure: n }) {
@@ -2582,7 +2582,7 @@ var require_main_min = __commonJS({
2582
2582
  if (Dt(e))
2583
2583
  return [];
2584
2584
  let r = or(e, t);
2585
- return je({ layout: r, schemas: e.schemas || [], actions: e.actions || [], model: (a = e.model) != null ? a : null });
2585
+ return Ue({ layout: r, schemas: e.schemas || [], actions: e.actions || [], model: (a = e.model) != null ? a : null });
2586
2586
  };
2587
2587
  var ep = (e) => {
2588
2588
  let { stepSpecification: t, stepLayoutOptions: r, submitted: a, model: o, formErrors: n, onModelChange: i } = e, c = Qu(t, r), { loading: u, registerPersistAsyncPromise: d } = Mt(), p = ae(), h = u ? () => {
@@ -2594,18 +2594,18 @@ var require_main_min = __commonJS({
2594
2594
  var Fa = require("react");
2595
2595
  var ne = require("react");
2596
2596
  var tl = require("react-intl");
2597
- var rl = Ie(Tc());
2597
+ var rl = De(Tc());
2598
2598
  var Rc = require("react-intl");
2599
2599
  var fe = (0, Rc.defineMessages)({ reviewSubmit: { id: "dynamicFlows.CameraCapture.reviewSubmit", defaultMessage: "Yes, submit", description: "Accept and submit the image taken with the camera" }, reviewRetry: { id: "dynamicFlows.CameraCapture.reviewRetry", defaultMessage: "No, try again", description: "Image taken with camera is not good, don't submit, and retake the image" }, reviewInstructions: { id: "dynamicFlows.CameraCapture.reviewInstructions", defaultMessage: "Is your picture clear, readable and complete?", description: "After taking an image with the camera, prompt user to review the image" }, cameraNotSupportedTitle: { id: "dynamicFlows.CameraCapture.CameraNotSupported.title", defaultMessage: "Camera not supported", description: "Title of standalone page prompting that camera is not available on users browser" }, cameraNotSupportedParagraph: { id: "dynamicFlows.CameraCapture.CameraNotSupported.paragraph", defaultMessage: "The browser you're using doesn't have support for a camera. Try a different browser, device, or download our mobile app.", description: "Further text of standalone page prompting that camera is not available on user's browser" }, noCameraAccessTitle: { id: "dynamicFlows.CameraCapture.NoCameraAccess.title", defaultMessage: "We can't access your camera", description: "Title of standalone page prompting missing camera permissions" }, noCameraAccessParagraph: { id: "dynamicFlows.CameraCapture.NoCameraAccess.paragraph", defaultMessage: "Enable camera access in your browser's settings to get going again.", description: "Further text of standalone page prompting missing camera permissions" }, noCameraAccessAction: { id: "dynamicFlows.CameraCapture.NoCameraAccess.action", defaultMessage: "Enable camera access", description: "Action to ask for camera permissions again" }, cameraConnectionIssueTitle: { id: "dynamicFlows.CameraCapture.CameraConnectionIssue.title", defaultMessage: "We can't access your camera", description: "Title of standalone page prompting that there was an issue connecting to a camera" }, cameraConnectionIssueParagraph: { id: "dynamicFlows.CameraCapture.CameraConnectionIssue.paragraph", defaultMessage: "Please check if it is connected and try again.", description: "Further text of standalone page prompting that there was an issue connecting to a camera" }, cameraConnectionIssueAction: { id: "dynamicFlows.CameraCapture.CameraConnectionIssue.action", defaultMessage: "Try again", description: "Action to try using camera again" } });
2600
- var Me = require("@transferwise/components");
2600
+ var Ee = require("@transferwise/components");
2601
2601
  var Nc = require("react-intl");
2602
- var Pe = require("react/jsx-runtime");
2603
- var Ko = ({ onCapture: e }) => (0, Pe.jsx)("div", { className: "bottom-bar", children: (0, Pe.jsx)(tp, { onClick: e }) });
2602
+ var Me = require("react/jsx-runtime");
2603
+ var Ko = ({ onCapture: e }) => (0, Me.jsx)("div", { className: "bottom-bar", children: (0, Me.jsx)(tp, { onClick: e }) });
2604
2604
  var Jo = ({ onSubmit: e, onRetry: t }) => {
2605
2605
  let r = (0, Nc.useIntl)();
2606
- return (0, Pe.jsx)("div", { className: "bottom-bar p-x-2", children: (0, Pe.jsx)("div", { className: "row", children: (0, Pe.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [(0, Pe.jsx)(Me.Button, { className: "m-b-1", block: true, size: Me.Size.MEDIUM, type: Me.ControlType.ACCENT, onClick: e, children: r.formatMessage(fe.reviewSubmit) }), (0, Pe.jsx)(Me.Button, { className: "m-b-2", block: true, size: Me.Size.MEDIUM, type: Me.ControlType.ACCENT, priority: Me.Priority.SECONDARY, onClick: t, children: r.formatMessage(fe.reviewRetry) })] }) }) });
2606
+ return (0, Me.jsx)("div", { className: "bottom-bar p-x-2", children: (0, Me.jsx)("div", { className: "row", children: (0, Me.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [(0, Me.jsx)(Ee.Button, { className: "m-b-1", block: true, size: Ee.Size.MEDIUM, type: Ee.ControlType.ACCENT, onClick: e, children: r.formatMessage(fe.reviewSubmit) }), (0, Me.jsx)(Ee.Button, { className: "m-b-2", block: true, size: Ee.Size.MEDIUM, type: Ee.ControlType.ACCENT, priority: Ee.Priority.SECONDARY, onClick: t, children: r.formatMessage(fe.reviewRetry) })] }) }) });
2607
2607
  };
2608
- var tp = ({ onClick: e }) => (0, Pe.jsx)("button", { type: "button", className: "camera-capture-btn m-b-2", "data-testid": "camera-capture-button", onClick: e, children: (0, Pe.jsx)("span", { className: "camera-capture-btn-inner" }) });
2608
+ var tp = ({ onClick: e }) => (0, Me.jsx)("button", { type: "button", className: "camera-capture-btn m-b-2", "data-testid": "camera-capture-button", onClick: e, children: (0, Me.jsx)("span", { className: "camera-capture-btn-inner" }) });
2609
2609
  var jc = require("react-intl");
2610
2610
  var Bc = require("react-intl");
2611
2611
  var zc = (0, Bc.defineMessages)({ text: { id: "dynamicFlows.CameraCapture.rotatePhone.text", defaultMessage: "Rotate your phone to portrait view to take a photo", description: "Prompt the user to rotate their phone from landscape to portrait mode when attempting to take a photo" } });
@@ -2622,7 +2622,7 @@ var require_main_min = __commonJS({
2622
2622
  }
2623
2623
  var Xo = ap;
2624
2624
  var ct = require("react");
2625
- var Yt = Ie(Vc());
2625
+ var Yt = De(Vc());
2626
2626
  var Hc = (e) => {
2627
2627
  var r;
2628
2628
  let { facingMode: t } = ((r = wa(e)) == null ? void 0 : r.getSettings()) || {};
@@ -2731,7 +2731,7 @@ var require_main_min = __commonJS({
2731
2731
  function dp({ overlay: e, outline: t, imageUrl: r, title: a, instructions: o, reviewInstructions: n }) {
2732
2732
  let i = (0, ba.useRef)(null);
2733
2733
  (0, ba.useEffect)(() => {
2734
- let f = Ze(() => {
2734
+ let f = Qe(() => {
2735
2735
  var m;
2736
2736
  if ((m = i.current) != null && m.innerHTML) {
2737
2737
  let l = i.current;
@@ -2753,9 +2753,9 @@ var require_main_min = __commonJS({
2753
2753
  var ye = require("react/jsx-runtime");
2754
2754
  function up({ direction: e = "back", overlay: t = "", outline: r = "", imageUrl: a = "", title: o = "", instructions: n = "", showReview: i = false, onCapture: c, onEvent: u }) {
2755
2755
  let [d, p] = (0, ne.useState)("CAPTURE"), [h, f] = (0, ne.useState)(), [m, l] = (0, ne.useState)(false), [y, g] = (0, ne.useState)(false), [C, b] = (0, ne.useState)(), w = (0, ne.useRef)(null), { videoConstraints: v } = Zc(e), P = (0, ne.useMemo)(() => !!(ai() && d === "CAPTURE"), [d]), { enterFullScreen: M, exitFullScreen: E } = Xc(P, u), A = (0, tl.useIntl)(), L = (0, ne.useCallback)(async () => {
2756
- var z, K, ie, Ke, Ot, er;
2756
+ var z, K, ie, Je, Ot, er;
2757
2757
  if ((z = w == null ? void 0 : w.current) != null && z.video && ((ie = (K = w == null ? void 0 : w.current) == null ? void 0 : K.video) == null ? void 0 : ie.readyState) >= 3) {
2758
- (Ot = (Ke = w == null ? void 0 : w.current) == null ? void 0 : Ke.video) == null || Ot.pause();
2758
+ (Ot = (Je = w == null ? void 0 : w.current) == null ? void 0 : Je.video) == null || Ot.pause();
2759
2759
  let tr = await Gc((er = w == null ? void 0 : w.current) == null ? void 0 : er.video);
2760
2760
  tr == null || tr.toBlob((At) => {
2761
2761
  if (At)
@@ -2822,7 +2822,7 @@ var require_main_min = __commonJS({
2822
2822
  var xa = fp;
2823
2823
  function al(e) {
2824
2824
  let r = zr(e.schemas || [])[0];
2825
- if (!r || !Te(r))
2825
+ if (!r || !Re(r))
2826
2826
  throw new Error("The first schema in a camera step is expected to be of type object and have at least one property with a schema...");
2827
2827
  return r;
2828
2828
  }
@@ -2869,11 +2869,11 @@ var require_main_min = __commonJS({
2869
2869
  }, children: [(0, Xt.jsx)("span", { className: "sr-only", children: e }), (0, Xt.jsx)(ll.Avatar, { type: "icon", children: (0, Xt.jsx)(ml.ArrowLeft, { size: "24" }) })] });
2870
2870
  }
2871
2871
  var dl = Sp;
2872
- var Ee = require("react/jsx-runtime");
2872
+ var ke = require("react/jsx-runtime");
2873
2873
  function Zr(e) {
2874
2874
  var u, d, p;
2875
2875
  let { step: t, globalError: r, onAction: a } = e, o = (u = t == null ? void 0 : t.external) == null ? void 0 : u.url, n = ((d = t == null ? void 0 : t.navigation) == null ? void 0 : d.back) || ((p = t == null ? void 0 : t.navigation) == null ? void 0 : p.backButton), { requiresManualTrigger: i, dismissConfirmation: c } = ii(o);
2876
- return t === void 0 ? r ? (0, Ee.jsx)(ce, { component: { context: "negative", markdown: r, margin: "lg" } }) : null : o && i ? (0, Ee.jsx)(va, { url: o, onClose: c }) : ti(t) ? (0, Ee.jsx)(xa, S(s({}, e), { step: t })) : (0, Ee.jsxs)(Ee.Fragment, { children: [n && (0, Ee.jsx)(dl, S(s({}, n), { onAction: a })), r ? (0, Ee.jsx)(ce, { component: { context: "negative", markdown: r, margin: "lg" } }) : null, (0, Ee.jsx)(ga, S(s({}, e), { stepSpecification: t }))] });
2876
+ return t === void 0 ? r ? (0, ke.jsx)(ce, { component: { context: "negative", markdown: r, margin: "lg" } }) : null : o && i ? (0, ke.jsx)(va, { url: o, onClose: c }) : ti(t) ? (0, ke.jsx)(xa, S(s({}, e), { step: t })) : (0, ke.jsxs)(ke.Fragment, { children: [n && (0, ke.jsx)(dl, S(s({}, n), { onAction: a })), r ? (0, ke.jsx)(ce, { component: { context: "negative", markdown: r, margin: "lg" } }) : null, (0, ke.jsx)(ga, S(s({}, e), { stepSpecification: t }))] });
2877
2877
  }
2878
2878
  var ul = require("react");
2879
2879
  var Cp = 1e3;
@@ -2881,7 +2881,7 @@ var require_main_min = __commonJS({
2881
2881
  let t = (0, ul.useRef)(/* @__PURE__ */ new Map()), r = (a) => {
2882
2882
  if (t.current.has(a))
2883
2883
  return t.current.get(a);
2884
- let o = Ze((n, i, c) => e(n, i, c), Cp);
2884
+ let o = Qe((n, i, c) => e(n, i, c), Cp);
2885
2885
  return t.current.set(a, o), o;
2886
2886
  };
2887
2887
  return function(a, o, n, i) {
@@ -2947,7 +2947,7 @@ var require_main_min = __commonJS({
2947
2947
  var xl = require("react/jsx-runtime");
2948
2948
  function Fl({ onDismiss: e }) {
2949
2949
  let { formatMessage: t } = (0, bl.useIntl)();
2950
- return (0, xl.jsx)(Pa.Alert, { action: { text: t(be.retry), href: window.location.href }, message: t(be.genericError), type: Pa.Sentiment.NEGATIVE, className: "m-b-3", onDismiss: e });
2950
+ return (0, xl.jsx)(Pa.Alert, { action: { text: t(Fe.retry), href: window.location.href }, message: t(Fe.genericError), type: Pa.Sentiment.NEGATIVE, className: "m-b-3", onDismiss: e });
2951
2951
  }
2952
2952
  var Qt = require("react/jsx-runtime");
2953
2953
  var Op = () => {
@@ -2987,19 +2987,19 @@ var require_main_min = __commonJS({
2987
2987
  };
2988
2988
  var Ol = async (e) => {
2989
2989
  let t = await vr(e);
2990
- if (!R(t))
2990
+ if (!T(t))
2991
2991
  throw new Error("Incorrect response body in response. Expected an object.");
2992
2992
  let r = e.headers.get("etag") || void 0;
2993
2993
  return { type: "step", step: t, etag: r };
2994
2994
  };
2995
2995
  var Al = async (e) => {
2996
2996
  let t = await vr(e);
2997
- if (!R(t))
2997
+ if (!T(t))
2998
2998
  throw new Error("Incorrect response body in response. Expected an object.");
2999
- if (!R(t.action))
2999
+ if (!T(t.action))
3000
3000
  throw new Error("Incorrect response body in action response. Expected an object satisfying the type { action: Action }.");
3001
3001
  let r = t.action;
3002
- return r.exit === true && R(r.result) ? { type: "exit", result: r.result } : { type: "action", action: t.action };
3002
+ return r.exit === true && T(r.result) ? { type: "exit", result: r.result } : { type: "action", action: t.action };
3003
3003
  };
3004
3004
  var Pl = async (e) => ({ type: "exit", result: await nn(e) });
3005
3005
  var Ml = async (e) => {
@@ -3011,12 +3011,12 @@ var require_main_min = __commonJS({
3011
3011
  if ((a = e.headers) != null && a.has("X-Df-Exit"))
3012
3012
  return Pl(e);
3013
3013
  let t = await vr(e.clone());
3014
- return R(t) && t.action ? Al(e) : Ol(e);
3014
+ return T(t) && t.action ? Al(e) : Ol(e);
3015
3015
  };
3016
3016
  var El = async (e) => {
3017
3017
  sn(e);
3018
3018
  let t = await vr(e);
3019
- if (!R(t))
3019
+ if (!T(t))
3020
3020
  throw new Error("Incorrect response body in error response. Expected an object.");
3021
3021
  if (!t.refreshFormUrl && !t.refreshUrl && !t.validation && !t.error)
3022
3022
  throw t;
@@ -3025,7 +3025,7 @@ var require_main_min = __commonJS({
3025
3025
  var nn = async (e) => {
3026
3026
  sn(e);
3027
3027
  let t = await vr(e);
3028
- return R(t) ? t : null;
3028
+ return T(t) ? t : null;
3029
3029
  };
3030
3030
  var vr = async (e) => {
3031
3031
  try {
@@ -3041,47 +3041,47 @@ var require_main_min = __commonJS({
3041
3041
  throw new Error("The body of the provided Response object has already been used. Every request must respond with a new Response object.");
3042
3042
  };
3043
3043
  var Pp = (e) => typeof e == "object" && e !== null && "clone" in e && "bodyUsed" in e;
3044
- var We = require("react/jsx-runtime");
3044
+ var Ke = require("react/jsx-runtime");
3045
3045
  var kl = () => {
3046
3046
  };
3047
3047
  var Mp = ({ flowId: e, httpClient: t, initialAction: r, initialStep: a, loaderConfig: o, displayStepTitle: n = true, features: i, onCompletion: c, onError: u, onEvent: d = kl, onLog: p = kl }) => {
3048
- let { locale: h } = (0, Il.useIntl)(), { formErrors: f, globalError: m, step: l, models: y, etag: g, modelIsValid: C, setFormErrors: b, setGlobalError: w, setStepAndEtag: v, setSchemaModel: P } = hl(a), [M, E] = (0, ke.useState)(false), { isLoading: A, loader: L, setLoadingState: O } = Sl(o, a ? "idle" : "initial"), B = Je("critical", p, e, (l == null ? void 0 : l.id) || (l == null ? void 0 : l.key)), k = Je("warning", p, e, (l == null ? void 0 : l.id) || (l == null ? void 0 : l.key)), G = (F) => {
3048
+ let { locale: h } = (0, Il.useIntl)(), { formErrors: f, globalError: m, step: l, models: y, etag: g, modelIsValid: C, setFormErrors: b, setGlobalError: w, setStepAndEtag: v, setSchemaModel: P } = hl(a), [M, E] = (0, Ie.useState)(false), { isLoading: A, loader: L, setLoadingState: O } = Sl(o, a ? "idle" : "initial"), B = Ye("critical", p, e, (l == null ? void 0 : l.id) || (l == null ? void 0 : l.key)), k = Ye("warning", p, e, (l == null ? void 0 : l.id) || (l == null ? void 0 : l.key)), G = (F) => {
3049
3049
  F && !F.layout && k("Deprecation warning", "Support for steps with no layout is being dropped. Please add a layout array to your step.", { stepId: F.id || F.key });
3050
- }, H = (0, ke.useMemo)(() => {
3050
+ }, H = (0, Ie.useMemo)(() => {
3051
3051
  var F;
3052
3052
  return s({ flowId: e, stepId: (l == null ? void 0 : l.id) || (l == null ? void 0 : l.key) }, (F = l == null ? void 0 : l.analytics) != null ? F : {});
3053
- }, [e, l]), x = (0, ke.useMemo)(() => Ra(d, H), [d, H]), X = (0, ke.useCallback)(({ action: F, data: _, etag: T }) => {
3053
+ }, [e, l]), x = (0, Ie.useMemo)(() => Ra(d, H), [d, H]), X = (0, Ie.useCallback)(({ action: F, data: _, etag: R }) => {
3054
3054
  let { url: re, method: lt = "POST" } = F;
3055
- return t(re != null ? re : "", { method: lt, headers: s({ "accept-language": h, "Content-Type": "application/json" }, T ? { "If-None-Match": T } : {}), credentials: "include", body: lt === "GET" ? void 0 : JSON.stringify(_) });
3055
+ return t(re != null ? re : "", { method: lt, headers: s({ "accept-language": h, "Content-Type": "application/json" }, R ? { "If-None-Match": R } : {}), credentials: "include", body: lt === "GET" ? void 0 : JSON.stringify(_) });
3056
3056
  }, [t, h]), z = async (F, _ = {}) => {
3057
3057
  O(l ? "submission" : "initial"), x("Dynamic Flow - Step Submitted", { actionId: F.id || F.$id });
3058
3058
  try {
3059
- let T = await X({ action: F, data: _ });
3060
- if (F.exit && T.ok) {
3061
- await ie(T, F.result);
3059
+ let R = await X({ action: F, data: _ });
3060
+ if (F.exit && R.ok) {
3061
+ await ie(R, F.result);
3062
3062
  return;
3063
3063
  }
3064
- await er(T, "submission");
3065
- } catch (T) {
3066
- rr(T, F.exit ? "Error fetching exit result" : "Error fetching next step");
3064
+ await er(R, "submission");
3065
+ } catch (R) {
3066
+ rr(R, F.exit ? "Error fetching exit result" : "Error fetching next step");
3067
3067
  }
3068
- }, K = async (F, _, T) => {
3068
+ }, K = async (F, _, R) => {
3069
3069
  O("refresh"), x("Dynamic Flow - Step Refreshed", { status: "pending" });
3070
3070
  try {
3071
- let re = await X({ action: { url: F, method: "POST" }, data: _, etag: T });
3071
+ let re = await X({ action: { url: F, method: "POST" }, data: _, etag: R });
3072
3072
  await er(re, "refresh");
3073
3073
  } catch (re) {
3074
3074
  rr(re, "Error fetching refresh step");
3075
3075
  }
3076
3076
  }, ie = async (F, _) => {
3077
- let T = await nn(F);
3078
- Ot(s(s({}, T), _));
3079
- }, Ke = pl(K), Ot = (0, ke.useCallback)((F) => {
3077
+ let R = await nn(F);
3078
+ Ot(s(s({}, R), _));
3079
+ }, Je = pl(K), Ot = (0, Ie.useCallback)((F) => {
3080
3080
  x("Dynamic Flow - Flow Finished", { result: "success" }), c(F);
3081
3081
  }, [c, x]);
3082
- (0, ke.useEffect)(() => {
3082
+ (0, Ie.useEffect)(() => {
3083
3083
  x("Dynamic Flow - Flow Started", {});
3084
- }, []), (0, ke.useEffect)(() => {
3084
+ }, []), (0, Ie.useEffect)(() => {
3085
3085
  if (!a) {
3086
3086
  let F = s({ id: "#initial-step-request", method: "GET" }, r);
3087
3087
  z(F, F.data);
@@ -3099,28 +3099,28 @@ var require_main_min = __commonJS({
3099
3099
  At(re);
3100
3100
  return;
3101
3101
  }
3102
- let T = await Ml(F);
3103
- T.type === "action" ? z(T.action, T.action.data) : T.type === "exit" ? Ot(T.result) : tr(T.step, T.etag, _);
3104
- } catch (T) {
3105
- rr(T, "Error parsing fetch response", _, F.status);
3102
+ let R = await Ml(F);
3103
+ R.type === "action" ? z(R.action, R.action.data) : R.type === "exit" ? Ot(R.result) : tr(R.step, R.etag, _);
3104
+ } catch (R) {
3105
+ rr(R, "Error parsing fetch response", _, F.status);
3106
3106
  }
3107
- }, tr = (F, _, T) => {
3108
- G(F), v(F, _), O("idle"), T === "submission" ? (E(false), x("Dynamic Flow - Step Started", s({ stepId: F.id || F.key }, F == null ? void 0 : F.analytics))) : x("Dynamic Flow - Step Refreshed", { status: "success" });
3107
+ }, tr = (F, _, R) => {
3108
+ G(F), v(F, _), O("idle"), R === "submission" ? (E(false), x("Dynamic Flow - Step Started", s({ stepId: F.id || F.key }, F == null ? void 0 : F.analytics))) : x("Dynamic Flow - Step Refreshed", { status: "success" });
3109
3109
  }, At = async (F) => {
3110
3110
  let _ = F.refreshUrl || F.refreshFormUrl;
3111
3111
  _ && await K(_, Ma(y), g), F.validation && b(F.validation), F.error && w(F.error), O("idle");
3112
- }, rr = (F, _, T, re) => {
3113
- B("Error fetching", _), T === "refresh" && x("Dynamic Flow - Step Refreshed", { status: "failure" }), x("Dynamic Flow - Flow Finished", { status: "failure" }), u(F, re), O("idle");
3112
+ }, rr = (F, _, R, re) => {
3113
+ B("Error fetching", _), R === "refresh" && x("Dynamic Flow - Step Refreshed", { status: "failure" }), x("Dynamic Flow - Flow Finished", { status: "failure" }), u(F, re), O("idle");
3114
3114
  }, Jl = (F) => {
3115
- let { model: _, formSchema: T } = F, { $id: re = "" } = T;
3115
+ let { model: _, formSchema: R } = F, { $id: re = "" } = R;
3116
3116
  w(null), J(_) || B("Invalid model on change", "onModelChange was called but the model argument is not an object"), P(re, _, (Ar) => {
3117
3117
  Yl(F, Ar);
3118
3118
  });
3119
3119
  }, Yl = (F, _) => {
3120
- let { triggerSchema: T } = F;
3120
+ let { triggerSchema: R } = F;
3121
3121
  if (Ip(F)) {
3122
- let re = T.refreshUrl || T.refreshFormUrl, lt = (l == null ? void 0 : l.refreshUrl) || (l == null ? void 0 : l.refreshFormUrl), Ar = re || lt;
3123
- Ar && Ke(Ar, Ma(_), g, T);
3122
+ let re = R.refreshUrl || R.refreshFormUrl, lt = (l == null ? void 0 : l.refreshUrl) || (l == null ? void 0 : l.refreshFormUrl), Ar = re || lt;
3123
+ Ar && Je(Ar, Ma(_), g, R);
3124
3124
  }
3125
3125
  }, Xl = async (F) => {
3126
3126
  if (A || F.disabled)
@@ -3129,15 +3129,15 @@ var require_main_min = __commonJS({
3129
3129
  Ot(F.result);
3130
3130
  return;
3131
3131
  }
3132
- let { data: _, method: T, skipValidation: re } = F, lt = s(s({}, Ma(y)), _);
3133
- kp(T) ? (b(null), re || E(true), (C || re) && await z(F, lt)) : await z(F);
3132
+ let { data: _, method: R, skipValidation: re } = F, lt = s(s({}, Ma(y)), _);
3133
+ kp(R) ? (b(null), re || E(true), (C || re) && await z(F, lt)) : await z(F);
3134
3134
  };
3135
- return (0, We.jsx)(Dr, { flowId: e, stepId: (l == null ? void 0 : l.id) || (l == null ? void 0 : l.key), onLog: p, children: (0, We.jsx)(Ir, { metadata: H, onEvent: d, children: (0, We.jsx)(Fn, { loading: A, children: (0, We.jsx)(si, { httpClient: t, children: (0, We.jsx)(Mn, { features: i, children: L !== null ? L : (0, We.jsx)(Zr, { step: l, model: Ma(y), submitted: M, globalError: m, formErrors: f, stepLayoutOptions: { displayStepTitle: n }, onAction: (F) => {
3135
+ return (0, Ke.jsx)(Dr, { flowId: e, stepId: (l == null ? void 0 : l.id) || (l == null ? void 0 : l.key), onLog: p, children: (0, Ke.jsx)(Ir, { metadata: H, onEvent: d, children: (0, Ke.jsx)(Fn, { loading: A, children: (0, Ke.jsx)(si, { httpClient: t, children: (0, Ke.jsx)(Mn, { features: i, children: L !== null ? L : (0, Ke.jsx)(Zr, { step: l, model: Ma(y), submitted: M, globalError: m, formErrors: f, stepLayoutOptions: { displayStepTitle: n }, onAction: (F) => {
3136
3136
  Xl(F);
3137
3137
  }, onModelChange: Jl }) }) }) }) }) });
3138
3138
  };
3139
3139
  function Ep(e) {
3140
- return (0, We.jsx)(on, { onError: e.onError, children: (0, We.jsx)(Mp, s({}, e)) });
3140
+ return (0, Ke.jsx)(on, { onError: e.onError, children: (0, Ke.jsx)(Mp, s({}, e)) });
3141
3141
  }
3142
3142
  var cn = Ep;
3143
3143
  var Ma = (e) => Object.values(e).reduce((t, r) => s(s({}, t), r), {});