@wise/dynamic-flow-client-internal 1.1.0 → 1.1.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 +521 -521
- package/build/main.min.js +3 -3
- package/package.json +2 -2
package/build/main.js
CHANGED
|
@@ -57,7 +57,7 @@ var require_main_min = __commonJS({
|
|
|
57
57
|
var wc = Object.getOwnPropertyDescriptor;
|
|
58
58
|
var Fc = Object.getOwnPropertyDescriptors;
|
|
59
59
|
var Cc = Object.getOwnPropertyNames;
|
|
60
|
-
var
|
|
60
|
+
var va = Object.getOwnPropertySymbols;
|
|
61
61
|
var xc = Object.getPrototypeOf;
|
|
62
62
|
var ka = Object.prototype.hasOwnProperty;
|
|
63
63
|
var Oc = Object.prototype.propertyIsEnumerable;
|
|
@@ -65,14 +65,14 @@ var require_main_min = __commonJS({
|
|
|
65
65
|
var i = (e, t) => {
|
|
66
66
|
for (var r in t ||= {})
|
|
67
67
|
ka.call(t, r) && Pa(e, r, t[r]);
|
|
68
|
-
if (
|
|
69
|
-
for (var r of
|
|
68
|
+
if (va)
|
|
69
|
+
for (var r of va(t))
|
|
70
70
|
Oc.call(t, r) && Pa(e, r, t[r]);
|
|
71
71
|
return e;
|
|
72
72
|
};
|
|
73
|
-
var
|
|
73
|
+
var h = (e, t) => Sc(e, Fc(t));
|
|
74
74
|
var Ma = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
|
|
75
|
-
var
|
|
75
|
+
var nt = (e, t) => {
|
|
76
76
|
for (var r in t)
|
|
77
77
|
Rt(e, r, { get: t[r], enumerable: true });
|
|
78
78
|
};
|
|
@@ -83,8 +83,8 @@ var require_main_min = __commonJS({
|
|
|
83
83
|
return e;
|
|
84
84
|
};
|
|
85
85
|
var qe = (e, t, r) => (r = e != null ? bc(xc(e)) : {}, Ea(t || !e || !e.__esModule ? Rt(r, "default", { value: e, enumerable: true }) : r, e));
|
|
86
|
-
var
|
|
87
|
-
var
|
|
86
|
+
var Ac = (e) => Ea(Rt({}, "__esModule", { value: true }), e);
|
|
87
|
+
var lt = Ma((Qy, xr) => {
|
|
88
88
|
(function() {
|
|
89
89
|
"use strict";
|
|
90
90
|
var e = {}.hasOwnProperty, t = "[native code]";
|
|
@@ -161,8 +161,8 @@ var require_main_min = __commonJS({
|
|
|
161
161
|
return b = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(p, f) {
|
|
162
162
|
p.__proto__ = f;
|
|
163
163
|
} || function(p, f) {
|
|
164
|
-
for (var
|
|
165
|
-
f.hasOwnProperty(
|
|
164
|
+
for (var g in f)
|
|
165
|
+
f.hasOwnProperty(g) && (p[g] = f[g]);
|
|
166
166
|
}, b(y, l);
|
|
167
167
|
};
|
|
168
168
|
return function(y, l) {
|
|
@@ -220,8 +220,8 @@ var require_main_min = __commonJS({
|
|
|
220
220
|
p.onUserMediaError("getUserMedia not supported");
|
|
221
221
|
return;
|
|
222
222
|
}
|
|
223
|
-
var f = JSON.stringify(l.audioConstraints) !== JSON.stringify(p.audioConstraints),
|
|
224
|
-
(
|
|
223
|
+
var f = JSON.stringify(l.audioConstraints) !== JSON.stringify(p.audioConstraints), g = JSON.stringify(l.videoConstraints) !== JSON.stringify(p.videoConstraints), S = l.minScreenshotWidth !== p.minScreenshotWidth, O = l.minScreenshotHeight !== p.minScreenshotHeight;
|
|
224
|
+
(g || S || O) && (this.canvas = null, this.ctx = null), (f || g) && (this.stopAndCleanup(), this.requestUserMedia());
|
|
225
225
|
}, y.prototype.componentWillUnmount = function() {
|
|
226
226
|
this.unmounted = true, this.stopAndCleanup();
|
|
227
227
|
}, y.stopMediaStream = function(l) {
|
|
@@ -234,54 +234,54 @@ var require_main_min = __commonJS({
|
|
|
234
234
|
var l = this.state;
|
|
235
235
|
l.hasUserMedia && (y.stopMediaStream(this.stream), l.src && window.URL.revokeObjectURL(l.src));
|
|
236
236
|
}, y.prototype.getScreenshot = function(l) {
|
|
237
|
-
var p = this, f = p.state,
|
|
237
|
+
var p = this, f = p.state, g = p.props;
|
|
238
238
|
if (!f.hasUserMedia)
|
|
239
239
|
return null;
|
|
240
240
|
var S = this.getCanvas(l);
|
|
241
|
-
return S && S.toDataURL(
|
|
241
|
+
return S && S.toDataURL(g.screenshotFormat, g.screenshotQuality);
|
|
242
242
|
}, y.prototype.getCanvas = function(l) {
|
|
243
|
-
var p = this, f = p.state,
|
|
243
|
+
var p = this, f = p.state, g = p.props;
|
|
244
244
|
if (!this.video || !f.hasUserMedia || !this.video.videoHeight)
|
|
245
245
|
return null;
|
|
246
246
|
if (!this.ctx) {
|
|
247
247
|
var S = this.video.videoWidth, O = this.video.videoHeight;
|
|
248
248
|
if (!this.props.forceScreenshotSourceSize) {
|
|
249
|
-
var
|
|
250
|
-
S =
|
|
249
|
+
var F = S / O;
|
|
250
|
+
S = g.minScreenshotWidth || this.video.clientWidth, O = S / F, g.minScreenshotHeight && O < g.minScreenshotHeight && (O = g.minScreenshotHeight, S = O * F);
|
|
251
251
|
}
|
|
252
252
|
this.canvas = document.createElement("canvas"), this.canvas.width = l?.width || S, this.canvas.height = l?.height || O, this.ctx = this.canvas.getContext("2d");
|
|
253
253
|
}
|
|
254
|
-
var
|
|
255
|
-
return A &&
|
|
254
|
+
var C = this, A = C.ctx, w = C.canvas;
|
|
255
|
+
return A && w && (g.mirrored && (A.translate(w.width, 0), A.scale(-1, 1)), A.imageSmoothingEnabled = g.imageSmoothing, A.drawImage(this.video, 0, 0, l?.width || w.width, l?.height || w.height), g.mirrored && (A.scale(-1, 1), A.translate(-w.width, 0))), w;
|
|
256
256
|
}, y.prototype.requestUserMedia = function() {
|
|
257
|
-
var l = this, p = this.props, f = function(O,
|
|
258
|
-
var
|
|
259
|
-
p.audio && (
|
|
257
|
+
var l = this, p = this.props, f = function(O, F) {
|
|
258
|
+
var C = { video: typeof F < "u" ? F : true };
|
|
259
|
+
p.audio && (C.audio = typeof O < "u" ? O : true), l.requestUserMediaId++;
|
|
260
260
|
var A = l.requestUserMediaId;
|
|
261
|
-
navigator.mediaDevices.getUserMedia(
|
|
262
|
-
l.unmounted || A !== l.requestUserMediaId ? y.stopMediaStream(
|
|
263
|
-
}).catch(function(
|
|
264
|
-
l.handleUserMedia(
|
|
261
|
+
navigator.mediaDevices.getUserMedia(C).then(function(w) {
|
|
262
|
+
l.unmounted || A !== l.requestUserMediaId ? y.stopMediaStream(w) : l.handleUserMedia(null, w);
|
|
263
|
+
}).catch(function(w) {
|
|
264
|
+
l.handleUserMedia(w);
|
|
265
265
|
});
|
|
266
266
|
};
|
|
267
267
|
if ("mediaDevices" in navigator)
|
|
268
268
|
f(p.audioConstraints, p.videoConstraints);
|
|
269
269
|
else {
|
|
270
|
-
var
|
|
270
|
+
var g = function(O) {
|
|
271
271
|
return { optional: [{ sourceId: O }] };
|
|
272
272
|
}, S = function(O) {
|
|
273
|
-
var
|
|
274
|
-
return typeof
|
|
273
|
+
var F = O.deviceId;
|
|
274
|
+
return typeof F == "string" ? F : Array.isArray(F) && F.length > 0 ? F[0] : typeof F == "object" && F.ideal ? F.ideal : null;
|
|
275
275
|
};
|
|
276
276
|
MediaStreamTrack.getSources(function(O) {
|
|
277
|
-
var
|
|
278
|
-
O.forEach(function(
|
|
279
|
-
|
|
277
|
+
var F = null, C = null;
|
|
278
|
+
O.forEach(function(D) {
|
|
279
|
+
D.kind === "audio" ? F = D.id : D.kind === "video" && (C = D.id);
|
|
280
280
|
});
|
|
281
281
|
var A = S(p.audioConstraints);
|
|
282
|
-
A && (
|
|
283
|
-
var
|
|
284
|
-
|
|
282
|
+
A && (F = A);
|
|
283
|
+
var w = S(p.videoConstraints);
|
|
284
|
+
w && (C = w), f(g(F), g(C));
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
287
|
}, y.prototype.handleUserMedia = function(l, p) {
|
|
@@ -298,7 +298,7 @@ var require_main_min = __commonJS({
|
|
|
298
298
|
}
|
|
299
299
|
f.onUserMedia(p);
|
|
300
300
|
}, y.prototype.render = function() {
|
|
301
|
-
var l = this, p = this, f = p.state,
|
|
301
|
+
var l = this, p = this, f = p.state, g = p.props, S = g.audio, O = g.forceScreenshotSourceSize, F = g.onUserMedia, C = g.onUserMediaError, A = g.screenshotFormat, w = g.screenshotQuality, D = g.minScreenshotWidth, k = g.minScreenshotHeight, I = g.audioConstraints, q = g.videoConstraints, ee = g.imageSmoothing, v = g.mirrored, T = g.style, M = T === void 0 ? {} : T, ue = g.children, pe = d(g, ["audio", "forceScreenshotSourceSize", "onUserMedia", "onUserMediaError", "screenshotFormat", "screenshotQuality", "minScreenshotWidth", "minScreenshotHeight", "audioConstraints", "videoConstraints", "imageSmoothing", "mirrored", "style", "children"]), le = v ? m(m({}, M), { transform: (M.transform || "") + " scaleX(-1)" }) : M, Ve = { getScreenshot: this.getScreenshot.bind(this) };
|
|
302
302
|
return a.createElement(a.Fragment, null, a.createElement("video", m({ autoPlay: true, src: f.src, muted: !S, playsInline: true, ref: function(He) {
|
|
303
303
|
l.video = He;
|
|
304
304
|
}, style: le }, pe)), ue && ue(Ve));
|
|
@@ -313,8 +313,8 @@ var require_main_min = __commonJS({
|
|
|
313
313
|
});
|
|
314
314
|
});
|
|
315
315
|
var Fp = {};
|
|
316
|
-
|
|
317
|
-
module2.exports =
|
|
316
|
+
nt(Fp, { DynamicFlow: () => ga, JsonSchemaForm: () => er, Layout: () => ne, convertStepToLayout: () => Ut, fixtures: () => Jl, inlineReferences: () => $e, isValidSchema: () => $, makeHttpClient: () => pr, translations: () => dc });
|
|
317
|
+
module2.exports = Ac(Fp);
|
|
318
318
|
function Ut(e, { displayStepTitle: t = true } = {}) {
|
|
319
319
|
if (!e || !e.type)
|
|
320
320
|
throw new Error("Missing step type");
|
|
@@ -328,7 +328,7 @@ var require_main_min = __commonJS({
|
|
|
328
328
|
case "form":
|
|
329
329
|
return kc(e);
|
|
330
330
|
case "external":
|
|
331
|
-
return
|
|
331
|
+
return vc(e);
|
|
332
332
|
default:
|
|
333
333
|
throw new Error("invalid step type");
|
|
334
334
|
}
|
|
@@ -341,7 +341,7 @@ var require_main_min = __commonJS({
|
|
|
341
341
|
}
|
|
342
342
|
return e.description && t.push(no(e.description)), t;
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function vc(e) {
|
|
345
345
|
return [...ro(e), Pc(e)];
|
|
346
346
|
}
|
|
347
347
|
function Pc(e) {
|
|
@@ -365,7 +365,7 @@ var require_main_min = __commonJS({
|
|
|
365
365
|
e.details.title && t.push(ao(e.details.title)), e.details.description && t.push(no(e.details.description));
|
|
366
366
|
}
|
|
367
367
|
if (e.actions) {
|
|
368
|
-
let r = e.actions.map((o) => sr(
|
|
368
|
+
let r = e.actions.map((o) => sr(h(i({}, o), { type: o.type || "primary" })));
|
|
369
369
|
t.push(oo(r, "md"));
|
|
370
370
|
}
|
|
371
371
|
return t;
|
|
@@ -399,7 +399,7 @@ var require_main_min = __commonJS({
|
|
|
399
399
|
return typeof e == "string" ? { type: "image", url: e, text: void 0, margin: "lg", size: "md" } : Ia(e);
|
|
400
400
|
}
|
|
401
401
|
function sr(e) {
|
|
402
|
-
return { type: "button", action:
|
|
402
|
+
return { type: "button", action: h(i({}, e), { title: e.title }) };
|
|
403
403
|
}
|
|
404
404
|
function Bc(e) {
|
|
405
405
|
return { type: "review", title: e.title, fields: e.fields.map(Nc) };
|
|
@@ -425,12 +425,12 @@ var require_main_min = __commonJS({
|
|
|
425
425
|
return e ? t ? e.map((a) => a.type === "form" ? zc({ formComponent: a, schemas: t }) : a.type === "decision" ? Vc({ decisionComponent: a, actions: r }) : a.type === "button" ? Hc({ actionComponent: a, actions: r }) : a.type === "box" ? qc({ boxComponent: a, schemas: t, actions: r, model: o }) : a.type === "columns" ? $c({ columnsComponent: a, schemas: t, actions: r, model: o }) : a) : e : [];
|
|
426
426
|
}
|
|
427
427
|
function zc({ formComponent: e, schemas: t }) {
|
|
428
|
-
return io(e.schema) && e.schema.$ref ?
|
|
428
|
+
return io(e.schema) && e.schema.$ref ? h(i({}, e), { schema: Gc(t, e.schema.$ref) }) : i({}, e);
|
|
429
429
|
}
|
|
430
430
|
function Vc({ decisionComponent: e, actions: t }) {
|
|
431
431
|
var o;
|
|
432
|
-
let r = (o = e == null ? void 0 : e.options) == null ? void 0 : o.map((a) => a.action && io(a.action) ?
|
|
433
|
-
return
|
|
432
|
+
let r = (o = e == null ? void 0 : e.options) == null ? void 0 : o.map((a) => a.action && io(a.action) ? h(i({}, a), { action: Da(t, a.action.$ref) }) : a);
|
|
433
|
+
return h(i({}, e), { options: r });
|
|
434
434
|
}
|
|
435
435
|
function Hc({ actionComponent: e, actions: t }) {
|
|
436
436
|
var r;
|
|
@@ -441,10 +441,10 @@ var require_main_min = __commonJS({
|
|
|
441
441
|
return e;
|
|
442
442
|
}
|
|
443
443
|
function qc({ boxComponent: e, schemas: t, actions: r, model: o }) {
|
|
444
|
-
return
|
|
444
|
+
return h(i({}, e), { components: $e({ layout: e.components, schemas: t, actions: r, model: o }) });
|
|
445
445
|
}
|
|
446
446
|
function $c({ columnsComponent: e, schemas: t, actions: r, model: o }) {
|
|
447
|
-
return
|
|
447
|
+
return h(i({}, e), { left: $e({ layout: e.left, schemas: t, actions: r, model: o }), right: $e({ layout: e.right, schemas: t, actions: r, model: o }) });
|
|
448
448
|
}
|
|
449
449
|
function Gc(e, t) {
|
|
450
450
|
let r = e.find((o) => o.$id === t);
|
|
@@ -463,7 +463,7 @@ var require_main_min = __commonJS({
|
|
|
463
463
|
}
|
|
464
464
|
var xe = require("react");
|
|
465
465
|
var ul = require("react-intl");
|
|
466
|
-
var
|
|
466
|
+
var ht = require("react");
|
|
467
467
|
var lr = require("react");
|
|
468
468
|
function La() {
|
|
469
469
|
let [e, t] = (0, lr.useState)(0);
|
|
@@ -477,26 +477,26 @@ var require_main_min = __commonJS({
|
|
|
477
477
|
var Ra = require("react/jsx-runtime");
|
|
478
478
|
var Ta = { loading: false, registerPersistAsyncPromise: (e) => {
|
|
479
479
|
} };
|
|
480
|
-
var Ba = (0,
|
|
480
|
+
var Ba = (0, ht.createContext)(Ta);
|
|
481
481
|
var Na = ({ loading: e, children: t }) => {
|
|
482
|
-
let { pendingPromises: r, addPendingPromise: o } = La(), a = (0,
|
|
482
|
+
let { pendingPromises: r, addPendingPromise: o } = La(), a = (0, ht.useMemo)(() => ({ loading: e || r > 0, registerPersistAsyncPromise: o }), [e, r, o]);
|
|
483
483
|
return (0, Ra.jsx)(Ba.Provider, { value: a, children: t });
|
|
484
484
|
};
|
|
485
|
-
var cr = () => (0,
|
|
486
|
-
var
|
|
485
|
+
var cr = () => (0, ht.useContext)(Ba) || Ta;
|
|
486
|
+
var gt = require("react");
|
|
487
487
|
var ja = require("react/jsx-runtime");
|
|
488
|
-
var Ua = (0,
|
|
488
|
+
var Ua = (0, gt.createContext)({ triggerEvent: () => {
|
|
489
489
|
} });
|
|
490
490
|
var mr = ({ metadata: e, children: t, onEvent: r }) => {
|
|
491
|
-
let o = (0,
|
|
491
|
+
let o = (0, gt.useMemo)(() => ({ triggerEvent: so(r, e) }), [r, e]);
|
|
492
492
|
return (0, ja.jsx)(Ua.Provider, { value: o, children: t });
|
|
493
493
|
};
|
|
494
494
|
function Z() {
|
|
495
|
-
let { triggerEvent: e } = (0,
|
|
495
|
+
let { triggerEvent: e } = (0, gt.useContext)(Ua);
|
|
496
496
|
return e;
|
|
497
497
|
}
|
|
498
498
|
var so = (e, t) => (r, o = {}) => e(r, i(i({}, t), o));
|
|
499
|
-
var
|
|
499
|
+
var it = require("react");
|
|
500
500
|
function za(e) {
|
|
501
501
|
return e >= 200 && e < 300;
|
|
502
502
|
}
|
|
@@ -508,7 +508,7 @@ var require_main_min = __commonJS({
|
|
|
508
508
|
}
|
|
509
509
|
var pr = (e, t) => (r, o) => {
|
|
510
510
|
let a = Kc(r, e || ""), n = Yc(o == null ? void 0 : o.headers, t);
|
|
511
|
-
return fetch(a,
|
|
511
|
+
return fetch(a, h(i({}, o || {}), { headers: n }));
|
|
512
512
|
};
|
|
513
513
|
var Kc = (e, t) => typeof e == "string" && ur(e) ? t + e : e;
|
|
514
514
|
var Yc = (e, t) => {
|
|
@@ -520,35 +520,35 @@ var require_main_min = __commonJS({
|
|
|
520
520
|
return r;
|
|
521
521
|
};
|
|
522
522
|
var lo = require("react/jsx-runtime");
|
|
523
|
-
var fr = (0,
|
|
523
|
+
var fr = (0, it.createContext)(void 0);
|
|
524
524
|
var Va = ({ httpClient: e, children: t }) => (0, lo.jsx)(fr.Provider, { value: e, children: t });
|
|
525
525
|
var yr = ({ baseUrl: e, children: t }) => {
|
|
526
|
-
let r = (0,
|
|
526
|
+
let r = (0, it.useMemo)(() => pr(e), [e]);
|
|
527
527
|
return (0, lo.jsx)(fr.Provider, { value: r, children: t });
|
|
528
528
|
};
|
|
529
|
-
var re = () => (0,
|
|
530
|
-
var hr = () => !!(0,
|
|
531
|
-
var
|
|
529
|
+
var re = () => (0, it.useContext)(fr) || fetch;
|
|
530
|
+
var hr = () => !!(0, it.useContext)(fr);
|
|
531
|
+
var bt = require("react");
|
|
532
532
|
var qa = require("react/jsx-runtime");
|
|
533
533
|
var Ee = (e, t, r = "UNKNOWN-FLOW-ID", o = "UNKNOWN-FLOW-ID") => (a, n, s) => t(e, `Dynamic Flow ${e} - ${a} - ${n}`, i({ flowId: r, stepId: o }, s));
|
|
534
|
-
var Ha = (0,
|
|
534
|
+
var Ha = (0, bt.createContext)(null);
|
|
535
535
|
var gr = ({ flowId: e, stepId: t, children: r, onLog: o }) => {
|
|
536
|
-
let a = (0,
|
|
536
|
+
let a = (0, bt.useMemo)(() => ({ debug: Ee("debug", o, e, t), info: Ee("info", o, e, t), warning: Ee("warning", o, e, t), error: Ee("error", o, e, t), critical: Ee("critical", o, e, t) }), [o, e, t]);
|
|
537
537
|
return (0, qa.jsx)(Ha.Provider, { value: a, children: r });
|
|
538
538
|
};
|
|
539
|
-
var
|
|
540
|
-
let e = (0,
|
|
539
|
+
var Ge = () => {
|
|
540
|
+
let e = (0, bt.useContext)(Ha);
|
|
541
541
|
if (e == null)
|
|
542
542
|
throw new Error("Logging context not found. Did you forget to wrap your component in a <LogProvider />?");
|
|
543
543
|
return e;
|
|
544
544
|
};
|
|
545
545
|
var J = (e) => typeof e == "object" && e !== null && e.constructor === Object;
|
|
546
|
-
var co = (e) =>
|
|
547
|
-
var mo = (e) =>
|
|
548
|
-
var $a = (e) => L(e) ||
|
|
546
|
+
var co = (e) => E(e) || J(e);
|
|
547
|
+
var mo = (e) => Ae(e) || B(e) || L(e) || E(e);
|
|
548
|
+
var $a = (e) => L(e) || E(e);
|
|
549
549
|
var uo = (e) => z(e) ? e.length === 0 ? true : e.every((t) => typeof t == "string" || typeof t == "number" || typeof t == "boolean") : false;
|
|
550
|
-
var Ga = (e) =>
|
|
551
|
-
var St = (e) => L(e) ||
|
|
550
|
+
var Ga = (e) => E(e) ? true : uo(e);
|
|
551
|
+
var St = (e) => L(e) || E(e);
|
|
552
552
|
var Jc = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean"]);
|
|
553
553
|
function fe(e) {
|
|
554
554
|
return Jc.has(e.type || "") || "const" in e && e.const !== void 0;
|
|
@@ -565,7 +565,7 @@ var require_main_min = __commonJS({
|
|
|
565
565
|
function zt(e) {
|
|
566
566
|
return !!e.allOf;
|
|
567
567
|
}
|
|
568
|
-
function
|
|
568
|
+
function st(e) {
|
|
569
569
|
return e.type === "blob";
|
|
570
570
|
}
|
|
571
571
|
function ye(e) {
|
|
@@ -582,7 +582,7 @@ var require_main_min = __commonJS({
|
|
|
582
582
|
return !!e.persistAsync;
|
|
583
583
|
}
|
|
584
584
|
function Zc(e) {
|
|
585
|
-
return wt(e) && (
|
|
585
|
+
return wt(e) && (st(e.persistAsync.schema) || Xc(e.persistAsync.schema));
|
|
586
586
|
}
|
|
587
587
|
var Vt = (e) => fe(e) && !!e.validationAsync;
|
|
588
588
|
function Xc(e) {
|
|
@@ -593,14 +593,14 @@ var require_main_min = __commonJS({
|
|
|
593
593
|
return e.type === "string" && e.format === "base64url";
|
|
594
594
|
}
|
|
595
595
|
var L = (e) => typeof e == "string";
|
|
596
|
-
var
|
|
597
|
-
var Ka = (e) =>
|
|
598
|
-
var
|
|
599
|
-
var
|
|
596
|
+
var B = (e) => typeof e == "number" && !Number.isNaN(e);
|
|
597
|
+
var Ka = (e) => B(e) && Math.floor(e) === e;
|
|
598
|
+
var Ae = (e) => typeof e == "boolean";
|
|
599
|
+
var R = (e) => !E(e) && !K(e) && (e == null ? void 0 : e.constructor) === Object;
|
|
600
600
|
var z = (e) => Array.isArray(e);
|
|
601
|
-
var
|
|
602
|
-
var
|
|
603
|
-
var Ft = (e) => L(e) && e.length === 0 || (
|
|
601
|
+
var E = (e) => e === null;
|
|
602
|
+
var K = (e) => typeof e == "undefined";
|
|
603
|
+
var Ft = (e) => L(e) && e.length === 0 || (R(e) || z(e)) && Object.keys(e).length === 0;
|
|
604
604
|
function Ya(e, t) {
|
|
605
605
|
return t.oneOf.some((r) => De(e, r) === e) ? e : null;
|
|
606
606
|
}
|
|
@@ -616,10 +616,10 @@ var require_main_min = __commonJS({
|
|
|
616
616
|
return L(e) && !Ft(e) ? e : null;
|
|
617
617
|
}
|
|
618
618
|
function Xa(e) {
|
|
619
|
-
return
|
|
619
|
+
return B(e) ? e : null;
|
|
620
620
|
}
|
|
621
621
|
function Qa(e) {
|
|
622
|
-
return
|
|
622
|
+
return Ae(e) ? e : null;
|
|
623
623
|
}
|
|
624
624
|
function fo(e, t) {
|
|
625
625
|
if (!z(e) || !Ie(t))
|
|
@@ -633,10 +633,10 @@ var require_main_min = __commonJS({
|
|
|
633
633
|
}
|
|
634
634
|
function en(e, t) {
|
|
635
635
|
return Object.keys(t.properties).reduce((r, o) => {
|
|
636
|
-
if (e && !
|
|
636
|
+
if (e && !K(e[o])) {
|
|
637
637
|
let a = e[o], n = t.properties[o], s = Ht(a, n);
|
|
638
|
-
if (!
|
|
639
|
-
return
|
|
638
|
+
if (!E(s))
|
|
639
|
+
return h(i({}, r), { [o]: s });
|
|
640
640
|
}
|
|
641
641
|
return r;
|
|
642
642
|
}, {});
|
|
@@ -648,21 +648,21 @@ var require_main_min = __commonJS({
|
|
|
648
648
|
}, {});
|
|
649
649
|
}
|
|
650
650
|
function rn(e, t) {
|
|
651
|
-
return t.oneOf.map((r) => oe(e, r)).reduce((r, o) =>
|
|
651
|
+
return t.oneOf.map((r) => oe(e, r)).reduce((r, o) => E(r) ? o : J(r) && J(o) ? on(r, o) : E(o) ? r : o, null);
|
|
652
652
|
}
|
|
653
653
|
function on(e, t) {
|
|
654
654
|
return Object.keys(t).reduce((r, o) => {
|
|
655
655
|
let a = e[o], n = t[o];
|
|
656
|
-
return J(a) && J(n) ?
|
|
656
|
+
return J(a) && J(n) ? h(i({}, r), { [o]: on(a, n) }) : h(i({}, r), { [o]: t[o] });
|
|
657
657
|
}, i({}, e));
|
|
658
658
|
}
|
|
659
659
|
var Ht = (e, t) => J(e) ? oe(e, t) : uo(e) ? em(e, t) : De(e, t);
|
|
660
660
|
function De(e, t) {
|
|
661
|
-
if (
|
|
661
|
+
if (E(e))
|
|
662
662
|
return null;
|
|
663
663
|
if (t.oneOf)
|
|
664
664
|
return Ya(e, t);
|
|
665
|
-
if (!
|
|
665
|
+
if (!K(t.const) && e === t.const)
|
|
666
666
|
return e;
|
|
667
667
|
if (t.type)
|
|
668
668
|
switch (t.type) {
|
|
@@ -679,42 +679,42 @@ var require_main_min = __commonJS({
|
|
|
679
679
|
return null;
|
|
680
680
|
}
|
|
681
681
|
function oe(e, t) {
|
|
682
|
-
return fe(t) || ye(t) ||
|
|
682
|
+
return fe(t) || ye(t) || E(e) ? null : t.allOf ? tn(e, t) : t.oneOf ? rn(e, t) : !K(t.const) && e === t.const ? e : ce(t) ? en(e, t) : null;
|
|
683
683
|
}
|
|
684
684
|
function em(e, t) {
|
|
685
685
|
return me(t) ? Ja(e, t) : ye(t) ? fo(e, t) : null;
|
|
686
686
|
}
|
|
687
687
|
function qt(e, t = false) {
|
|
688
|
-
return !t || !
|
|
688
|
+
return !t || !K(e);
|
|
689
689
|
}
|
|
690
690
|
function an(e, t = false) {
|
|
691
691
|
return !t || z(e);
|
|
692
692
|
}
|
|
693
693
|
function nn(e, t) {
|
|
694
|
-
return !
|
|
694
|
+
return !B(t) || L(e) && e.length >= t;
|
|
695
695
|
}
|
|
696
696
|
function sn(e, t) {
|
|
697
|
-
return !
|
|
697
|
+
return !B(t) || L(e) && e.length <= t;
|
|
698
698
|
}
|
|
699
699
|
function ln(e, t) {
|
|
700
700
|
return t === void 0 ? true : e == null ? false : !!new RegExp(t).test(e);
|
|
701
701
|
}
|
|
702
702
|
function yo(e, t) {
|
|
703
|
-
return !
|
|
703
|
+
return !B(t) && !L(t) || (B(e) || L(e)) && e <= t;
|
|
704
704
|
}
|
|
705
705
|
function ho(e, t) {
|
|
706
|
-
return !
|
|
706
|
+
return !B(t) && !L(t) || (B(e) || L(e)) && e >= t;
|
|
707
707
|
}
|
|
708
708
|
function cn(e, t) {
|
|
709
|
-
return !
|
|
709
|
+
return !B(t) || z(e) && e.length >= t;
|
|
710
710
|
}
|
|
711
711
|
function mn(e, t) {
|
|
712
|
-
return !
|
|
712
|
+
return !B(t) || z(e) && e.length <= t;
|
|
713
713
|
}
|
|
714
|
-
function
|
|
714
|
+
function _e(e, t, r) {
|
|
715
715
|
if (t.const)
|
|
716
716
|
return wo(e, t, r);
|
|
717
|
-
if (
|
|
717
|
+
if (E(e))
|
|
718
718
|
return r ? ["required"] : [];
|
|
719
719
|
if (_a(t))
|
|
720
720
|
return go(e, t, r);
|
|
@@ -734,7 +734,7 @@ var require_main_min = __commonJS({
|
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
736
|
function go(e, t, r) {
|
|
737
|
-
if (!L(e) && !
|
|
737
|
+
if (!L(e) && !E(e))
|
|
738
738
|
return ["type"];
|
|
739
739
|
if (e === "" && r)
|
|
740
740
|
return ["required"];
|
|
@@ -742,7 +742,7 @@ var require_main_min = __commonJS({
|
|
|
742
742
|
return qt(e, r) || o.push("required"), nn(e, t.minLength) || o.push("minLength"), sn(e, t.maxLength) || o.push("maxLength"), ln(e, t.pattern) || o.push("pattern"), ho(e, t.minimum) || o.push("minimum"), yo(e, t.maximum) || o.push("maximum"), o;
|
|
743
743
|
}
|
|
744
744
|
function br(e, t, r) {
|
|
745
|
-
if (!
|
|
745
|
+
if (!B(e) && !E(e))
|
|
746
746
|
return ["type"];
|
|
747
747
|
let o = [];
|
|
748
748
|
return qt(e, r) || o.push("required"), ho(e, t.minimum) || o.push("minimum"), yo(e, t.maximum) || o.push("maximum"), o;
|
|
@@ -751,7 +751,7 @@ var require_main_min = __commonJS({
|
|
|
751
751
|
return Ka(e) ? br(e, t, r) : ["type"];
|
|
752
752
|
}
|
|
753
753
|
function So(e, t, r) {
|
|
754
|
-
if (!
|
|
754
|
+
if (!Ae(e) && !E(e))
|
|
755
755
|
return ["type"];
|
|
756
756
|
let o = [];
|
|
757
757
|
return qt(e, r) || o.push("required"), o;
|
|
@@ -760,7 +760,7 @@ var require_main_min = __commonJS({
|
|
|
760
760
|
return qt(e, r) ? e !== t.const ? ["const"] : [] : ["required"];
|
|
761
761
|
}
|
|
762
762
|
function Ct(e, t, r) {
|
|
763
|
-
if (!z(e) && !
|
|
763
|
+
if (!z(e) && !E(e))
|
|
764
764
|
return ["type"];
|
|
765
765
|
if (!an(e, r))
|
|
766
766
|
return ["required"];
|
|
@@ -768,7 +768,7 @@ var require_main_min = __commonJS({
|
|
|
768
768
|
return cn(e, t.minItems) || o.push("minItems"), mn(e, t.maxItems) || o.push("maxItems"), o;
|
|
769
769
|
}
|
|
770
770
|
function dn(e, t) {
|
|
771
|
-
return
|
|
771
|
+
return E(e) ? ["type"] : [];
|
|
772
772
|
}
|
|
773
773
|
function tm(e, t) {
|
|
774
774
|
return J(e) ? z(t.required) ? t.required.map((o) => typeof e[o] != "undefined").reduce((o, a) => o && a, true) ? [] : ["required"] : [] : ["type"];
|
|
@@ -789,24 +789,24 @@ var require_main_min = __commonJS({
|
|
|
789
789
|
return !wo(e, t).length;
|
|
790
790
|
}
|
|
791
791
|
function sm(e, t) {
|
|
792
|
-
return !
|
|
792
|
+
return !R(e) || t.type !== "object" || !R(t.properties) ? false : Object.keys(t.properties).map((r) => lm(e[r], t.properties[r], t.required && t.required.includes(r))).every((r) => r);
|
|
793
793
|
}
|
|
794
794
|
function lm(e, t, r) {
|
|
795
|
-
return typeof e == "undefined" ? !r :
|
|
795
|
+
return typeof e == "undefined" ? !r : $(e, t);
|
|
796
796
|
}
|
|
797
797
|
function cm(e, t) {
|
|
798
|
-
return t.type !== "array" || !
|
|
798
|
+
return t.type !== "array" || !R(t.items) || Ct(e, t).length > 0 ? false : Array.isArray(e) && Ie(t) && e.map((r) => $(r, t.items)).every((r) => r);
|
|
799
799
|
}
|
|
800
800
|
function mm(e, t) {
|
|
801
|
-
return z(t.oneOf) ? t.oneOf.some((r) =>
|
|
801
|
+
return z(t.oneOf) ? t.oneOf.some((r) => $(e, r)) : false;
|
|
802
802
|
}
|
|
803
803
|
function dm(e, t) {
|
|
804
|
-
return z(t.allOf) ? t.allOf.map((r) =>
|
|
804
|
+
return z(t.allOf) ? t.allOf.map((r) => $(e, r)).every((r) => r) : false;
|
|
805
805
|
}
|
|
806
806
|
function um(e, t) {
|
|
807
807
|
return !dn(e, t).length;
|
|
808
808
|
}
|
|
809
|
-
function
|
|
809
|
+
function $(e, t) {
|
|
810
810
|
if (t.oneOf)
|
|
811
811
|
return mm(e, t);
|
|
812
812
|
if (t.allOf)
|
|
@@ -841,7 +841,7 @@ var require_main_min = __commonJS({
|
|
|
841
841
|
if (!e)
|
|
842
842
|
return null;
|
|
843
843
|
let [t, r, o] = e.split("-").map((a) => parseInt(a, 10));
|
|
844
|
-
return !
|
|
844
|
+
return !B(t) || !B(r) || !B(o) ? null : new Date(t, r - 1, o);
|
|
845
845
|
};
|
|
846
846
|
var pn = (e) => pm(e);
|
|
847
847
|
var xt = (e, t) => {
|
|
@@ -858,10 +858,10 @@ var require_main_min = __commonJS({
|
|
|
858
858
|
r !== null && (e(...o), a());
|
|
859
859
|
}, n;
|
|
860
860
|
};
|
|
861
|
-
var
|
|
861
|
+
var We = (e, t) => e === t ? true : Array.isArray(e) && Array.isArray(t) ? e.length === t.length && e.every((r, o) => We(r, t[o])) : !!(fn(e) && fn(t) && fm(e, t));
|
|
862
862
|
var fm = (e, t) => {
|
|
863
863
|
let r = Object.keys(e), o = Object.keys(t);
|
|
864
|
-
return r.length === o.length && r.every((a) => Object.prototype.hasOwnProperty.call(t, a) &&
|
|
864
|
+
return r.length === o.length && r.every((a) => Object.prototype.hasOwnProperty.call(t, a) && We(e[a], t[a]));
|
|
865
865
|
};
|
|
866
866
|
var fn = (e) => typeof e == "object" && e !== null;
|
|
867
867
|
function Sr(e) {
|
|
@@ -872,7 +872,7 @@ var require_main_min = __commonJS({
|
|
|
872
872
|
o.readAsDataURL(e), o.addEventListener("load", () => t(o.result)), o.addEventListener("error", (a) => r(a));
|
|
873
873
|
});
|
|
874
874
|
function hn(e, t) {
|
|
875
|
-
let r = t.reduce((o, a) =>
|
|
875
|
+
let r = t.reduce((o, a) => h(i({}, o), { [a.id]: a }), {});
|
|
876
876
|
for (let o of e) {
|
|
877
877
|
let a = r[o.id];
|
|
878
878
|
if (!a || a.status !== o.status)
|
|
@@ -880,9 +880,9 @@ var require_main_min = __commonJS({
|
|
|
880
880
|
}
|
|
881
881
|
return true;
|
|
882
882
|
}
|
|
883
|
-
var
|
|
883
|
+
var ve = (e = "") => `${e ? `${e}-` : ""}${Math.floor(1e8 * Math.random())}`;
|
|
884
884
|
var gn = { DAY_MONTH_YEAR: "day-month-year", MONTH_YEAR: "month-year" };
|
|
885
|
-
var
|
|
885
|
+
var N = { RADIO: "radio", CHECKBOX: "checkbox", SELECT: "select", FILE: "file", DATE: "date", DATETIME: "date-time", DATELOOKUP: "date-lookup", TEL: "tel", NUMBER: "number", HIDDEN: "hidden", PASSWORD: "password", TEXT: "text", TEXTAREA: "textarea", UPLOAD: "upload", TAB: "tab" };
|
|
886
886
|
var bn = { SHORT: "short", LONG: "long" };
|
|
887
887
|
var he = { READ_ONLY: "readOnly", PERSIST_ASYNC: "persistAsync", VALIDATION_ASYNC: "validationAsync", OBJECT: "object", PROMOTED_ONE_OF: "promotedOneOf", ONE_OF: "oneOf", ALL_OF: "allOf", BASIC: "basic", ARRAY: "array" };
|
|
888
888
|
var Sn = { EXTRA_SMALL: "xs", SMALL: "sm", MEDIUM: "md", LARGE: "lg", EXTRA_LARGE: "xl" };
|
|
@@ -919,14 +919,14 @@ var require_main_min = __commonJS({
|
|
|
919
919
|
return (0, xn.useCallback)(xt(e, t), [e, t]);
|
|
920
920
|
}
|
|
921
921
|
var $t = require("react");
|
|
922
|
-
function
|
|
922
|
+
function An(e) {
|
|
923
923
|
let [t, r] = (0, $t.useState)(null), [o, a] = (0, $t.useState)(false), n = () => a(true);
|
|
924
924
|
return (0, $t.useEffect)(() => {
|
|
925
925
|
e && (a(false), r(window.open(e, "_blank")));
|
|
926
926
|
}, [e]), { requiresManualTrigger: !!(e && !t && !o), dismissConfirmation: n };
|
|
927
927
|
}
|
|
928
928
|
var Gt = require("react");
|
|
929
|
-
function
|
|
929
|
+
function vn(e, t) {
|
|
930
930
|
let r = re(), o = (0, Gt.useMemo)(() => {
|
|
931
931
|
if (e)
|
|
932
932
|
return () => r(e.url).then((n) => {
|
|
@@ -945,10 +945,10 @@ var require_main_min = __commonJS({
|
|
|
945
945
|
let { action: d } = m;
|
|
946
946
|
if (d.exit) {
|
|
947
947
|
let u = i(i({}, d.result || {}), n.data || {});
|
|
948
|
-
t(
|
|
948
|
+
t(h(i({}, d), { result: u }));
|
|
949
949
|
} else {
|
|
950
950
|
let u = i(i({}, d.data || {}), n.data || {});
|
|
951
|
-
t(
|
|
951
|
+
t(h(i({}, d), { data: u }));
|
|
952
952
|
}
|
|
953
953
|
return false;
|
|
954
954
|
}
|
|
@@ -962,11 +962,11 @@ var require_main_min = __commonJS({
|
|
|
962
962
|
var ys = require("react-intl");
|
|
963
963
|
var Pn = require("react-intl");
|
|
964
964
|
var _t = (0, Pn.defineMessages)({ genericError: { id: "dynamicFlows.PersistAsyncSchema.genericError", defaultMessage: "Something went wrong, please try again later!", description: "Generic error message for persist async schema" } });
|
|
965
|
-
var
|
|
965
|
+
var yt = require("react");
|
|
966
966
|
var cs = require("react-intl");
|
|
967
967
|
var xm = { allOf: [{ title: "Number schemas", type: "object", displayOrder: ["number"], properties: { number: { type: "number", title: "Number input", minimum: 2, maximum: 200, default: 1, help: { markdown: "2 or more" }, validationMessages: { min: "Too low buddy!", max: "Crazy high!" } } }, required: ["number"] }, { title: "String schemas", type: "object", displayOrder: ["string", "date", "phone", "file"], properties: { string: { type: "string", title: "Text input", minLength: 2, maxLength: 8, pattern: "^[a-z]+$", default: "abc", help: { markdown: "Keep it secret, Keep it safe" } }, date: { type: "string", format: "date", title: "Date input", minimum: "2000-02-01", maximum: "2010-01-01", validationMessages: { min: "Must be after Feb 2000", max: "Must be before Jan 2010" } }, phone: { type: "string", format: "phone", title: "Phone input", minLength: 10, maxLength: 12 }, file: { type: "string", format: "base64url", title: "File input" } }, required: ["string"] }, { title: "Boolean schemas", type: "object", displayOrder: ["boolean"], properties: { boolean: { type: "boolean", title: "Boolean input", width: "md" } } }, { title: "OneOf Const schema", type: "object", displayOrder: ["select", "radio"], properties: { select: { title: "Select", placeholder: "Please choose", oneOf: [{ title: "One", const: "one" }, { title: "Two", const: "two" }, { title: "Three", const: "three" }] }, radio: { title: "Radio", placeholder: "Please choose", oneOf: [{ title: "One", const: "one" }, { title: "Two", const: "two" }] } }, required: ["select", "radio"] }] };
|
|
968
968
|
var Cr = xm;
|
|
969
|
-
var ss = qe(
|
|
969
|
+
var ss = qe(lt());
|
|
970
970
|
var ie = require("react");
|
|
971
971
|
var kn = require("@transferwise/components");
|
|
972
972
|
var j = (e) => {
|
|
@@ -996,13 +996,13 @@ var require_main_min = __commonJS({
|
|
|
996
996
|
return "";
|
|
997
997
|
}
|
|
998
998
|
};
|
|
999
|
-
var
|
|
999
|
+
var Ke = (e) => `${Om(e.align)} ${j(e.margin)}`;
|
|
1000
1000
|
var Mn = require("react/jsx-runtime");
|
|
1001
|
-
var
|
|
1001
|
+
var Am = (e) => {
|
|
1002
1002
|
let t = e.component;
|
|
1003
|
-
return (0, Mn.jsx)(kn.Alert, { type: Pm(
|
|
1003
|
+
return (0, Mn.jsx)(kn.Alert, { type: Pm(vm(t.context)), className: j(t.margin), message: t.markdown });
|
|
1004
1004
|
};
|
|
1005
|
-
var
|
|
1005
|
+
var vm = (e) => {
|
|
1006
1006
|
switch (e) {
|
|
1007
1007
|
case "success":
|
|
1008
1008
|
return "positive";
|
|
@@ -1018,11 +1018,11 @@ var require_main_min = __commonJS({
|
|
|
1018
1018
|
}
|
|
1019
1019
|
};
|
|
1020
1020
|
var Pm = (e) => !e || !["neutral", "warning", "negative", "positive"].includes(e) ? "neutral" : e;
|
|
1021
|
-
var ae =
|
|
1022
|
-
var
|
|
1021
|
+
var ae = Am;
|
|
1022
|
+
var ct = require("react/jsx-runtime");
|
|
1023
1023
|
var km = (e) => {
|
|
1024
1024
|
let t = e.component, r = j(t.margin || t.border ? "lg" : "xs");
|
|
1025
|
-
return !t.width || t.width === "xl" ? (0,
|
|
1025
|
+
return !t.width || t.width === "xl" ? (0, ct.jsx)("div", { className: r + En(t.border), children: (0, ct.jsx)(ne, { components: t.components, model: e.model, submitted: e.submitted, errors: e.errors, onModelChange: e.onModelChange, onAction: e.onAction, onPersistAsync: e.onPersistAsync }) }) : (0, ct.jsx)("div", { className: "row", children: (0, ct.jsx)("div", { className: r + Mm(t), children: (0, ct.jsx)("div", { className: En(t.border), children: (0, ct.jsx)(ne, { components: t.components, model: e.model, submitted: e.submitted, errors: e.errors, onModelChange: e.onModelChange, onAction: e.onAction, onPersistAsync: e.onPersistAsync }) }) }) });
|
|
1026
1026
|
};
|
|
1027
1027
|
var En = (e) => e ? " well p-b-0" : "";
|
|
1028
1028
|
var Mm = (e) => {
|
|
@@ -1078,56 +1078,56 @@ var require_main_min = __commonJS({
|
|
|
1078
1078
|
}
|
|
1079
1079
|
};
|
|
1080
1080
|
var xo = Em;
|
|
1081
|
-
var
|
|
1081
|
+
var mt = require("react/jsx-runtime");
|
|
1082
1082
|
var Tm = (e) => {
|
|
1083
1083
|
let t = e.component, { leftWidth: r, rightWidth: o } = Bm(t.bias);
|
|
1084
|
-
return (0,
|
|
1084
|
+
return (0, mt.jsxs)("div", { className: `${j(t.margin || "xs")} row`, children: [(0, mt.jsx)("div", { className: `${r} m-b-0`, children: (0, mt.jsx)(ne, { components: t.left, model: e.model, submitted: e.submitted, errors: e.errors, onModelChange: e.onModelChange, onAction: e.onAction, onPersistAsync: e.onPersistAsync }) }), (0, mt.jsx)("div", { className: `${o} m-b-0`, children: (0, mt.jsx)(ne, { components: t.right, model: e.model, submitted: e.submitted, errors: e.errors, onModelChange: e.onModelChange, onAction: e.onAction, onPersistAsync: e.onPersistAsync }) })] });
|
|
1085
1085
|
};
|
|
1086
1086
|
var Bm = (e) => e === "left" ? { leftWidth: "col-md-8", rightWidth: "col-md-4" } : e === "right" ? { leftWidth: "col-md-4", rightWidth: "col-md-8" } : { leftWidth: "col-md-6", rightWidth: "col-md-6" };
|
|
1087
1087
|
var Oo = Tm;
|
|
1088
1088
|
var Pe = require("@transferwise/components");
|
|
1089
|
-
var
|
|
1089
|
+
var Ye = require("react/jsx-runtime");
|
|
1090
1090
|
var Nm = (e) => {
|
|
1091
1091
|
var t, r, o;
|
|
1092
1092
|
if ((t = e.icon) != null && t.name)
|
|
1093
|
-
return (0,
|
|
1093
|
+
return (0, Ye.jsx)(Pe.Avatar, { type: Pe.AvatarType.ICON, children: (0, Ye.jsx)(Je, { type: e.icon.name }) });
|
|
1094
1094
|
if ((r = e.icon) != null && r.text)
|
|
1095
|
-
return (0,
|
|
1095
|
+
return (0, Ye.jsx)(Pe.Avatar, { type: Pe.AvatarType.INITIALS, children: e.icon.text });
|
|
1096
1096
|
if ((o = e.image) != null && o.url) {
|
|
1097
1097
|
let { url: a, text: n } = e.image;
|
|
1098
|
-
return (0,
|
|
1098
|
+
return (0, Ye.jsx)("img", { src: a, alt: n });
|
|
1099
1099
|
}
|
|
1100
1100
|
};
|
|
1101
1101
|
var Rm = (e) => {
|
|
1102
1102
|
let t = e.component, r = (o, a) => {
|
|
1103
1103
|
let n = Nm(o);
|
|
1104
|
-
return (0,
|
|
1104
|
+
return (0, Ye.jsx)(Pe.NavigationOption, { title: o.title, content: o.description, disabled: o.disabled, media: n, showMediaCircle: false, showMediaAtAllSizes: true, onClick: () => a(o.action) }, JSON.stringify(o));
|
|
1105
1105
|
};
|
|
1106
|
-
return (0,
|
|
1106
|
+
return (0, Ye.jsx)("div", { className: j(t.margin), children: (0, Ye.jsx)(Pe.NavigationOptionsList, { children: t.options.map((o) => r(o, e.onAction)) }) });
|
|
1107
1107
|
};
|
|
1108
|
-
var
|
|
1108
|
+
var Ao = Rm;
|
|
1109
1109
|
var Ln = require("react/jsx-runtime");
|
|
1110
1110
|
var Um = ({ component: e }) => {
|
|
1111
1111
|
let r = `m-t-0 ${j(e.margin)}`;
|
|
1112
1112
|
return (0, Ln.jsx)("hr", { className: r });
|
|
1113
1113
|
};
|
|
1114
|
-
var
|
|
1114
|
+
var vo = Um;
|
|
1115
1115
|
var Ot = require("@transferwise/components");
|
|
1116
1116
|
var Or = require("react");
|
|
1117
1117
|
var Nn = require("react-intl");
|
|
1118
1118
|
var Tn = require("react-intl");
|
|
1119
1119
|
var Bn = (0, Tn.defineMessages)({ retryTitle: { id: "dynamicFlows.DynamicExternal.retryTitle", defaultMessage: "Reopen window", description: "" } });
|
|
1120
|
-
var
|
|
1120
|
+
var Ze = require("react/jsx-runtime");
|
|
1121
1121
|
var jm = ({ component: e, onAction: t }) => {
|
|
1122
1122
|
let { requestUrl: r, responseHandlers: o, polling: a, retryTitle: n } = e, s = (0, Nn.useIntl)(), m = (0, Or.useCallback)(() => window.open(r, "df-external-window"), [r]);
|
|
1123
1123
|
(0, Or.useEffect)(() => {
|
|
1124
1124
|
m();
|
|
1125
1125
|
}, [m]);
|
|
1126
|
-
let d = a && o ?
|
|
1127
|
-
return
|
|
1126
|
+
let d = a && o ? h(i({}, a), { responseHandlers: o }) : void 0;
|
|
1127
|
+
return vn(d, t), (0, Ze.jsxs)(Ze.Fragment, { children: [(0, Ze.jsx)(Ot.Loader, { size: Ot.Size.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }), (0, Ze.jsx)("br", {}), (0, Ze.jsx)(Ot.Button, { priority: "tertiary", block: true, onClick: m, children: n || s.formatMessage(Bn.retryTitle) })] });
|
|
1128
1128
|
};
|
|
1129
1129
|
var Po = jm;
|
|
1130
|
-
var Rn = qe(
|
|
1130
|
+
var Rn = qe(lt());
|
|
1131
1131
|
var Un = require("react");
|
|
1132
1132
|
var ke = require("react/jsx-runtime");
|
|
1133
1133
|
var zm = (e, t) => t.map((r) => oe(e, r) || {});
|
|
@@ -1136,16 +1136,16 @@ var require_main_min = __commonJS({
|
|
|
1136
1136
|
var jn = (e) => {
|
|
1137
1137
|
let t = (a, n) => {
|
|
1138
1138
|
let s = e.schema.allOf[a];
|
|
1139
|
-
r[a] = oe(n.model, s) || {}, o(r), e.onChange(
|
|
1139
|
+
r[a] = oe(n.model, s) || {}, o(r), e.onChange(h(i({}, n), { model: Vm(r) }));
|
|
1140
1140
|
}, [r, o] = (0, Un.useState)(zm(e.model, e.schema.allOf));
|
|
1141
|
-
return (0, ke.jsxs)(ke.Fragment, { children: [e.schema.title && (0, ke.jsx)("h3", { className: "page-header", children: e.schema.title }), e.schema.description && (0, ke.jsx)("p", { children: e.schema.description }), (0, ke.jsx)("div", { className: "row", children: e.schema.allOf.map((a, n) => (0, ke.jsx)("div", { className: (0, Rn.default)(Hm(a.width)), children: (0, ke.jsx)(de, { schema: a, model: r[n], errors: e.errors, submitted: e.submitted, disabled: e.disabled, onChange: (s) => t(n,
|
|
1141
|
+
return (0, ke.jsxs)(ke.Fragment, { children: [e.schema.title && (0, ke.jsx)("h3", { className: "page-header", children: e.schema.title }), e.schema.description && (0, ke.jsx)("p", { children: e.schema.description }), (0, ke.jsx)("div", { className: "row", children: e.schema.allOf.map((a, n) => (0, ke.jsx)("div", { className: (0, Rn.default)(Hm(a.width)), children: (0, ke.jsx)(de, { schema: a, model: r[n], errors: e.errors, submitted: e.submitted, disabled: e.disabled, onChange: (s) => t(n, h(i({}, s), { model: s.model })), onPersistAsync: e.onPersistAsync }) }, n)) })] });
|
|
1142
1142
|
};
|
|
1143
1143
|
jn.defaultProps = { disabled: false };
|
|
1144
|
-
var
|
|
1144
|
+
var Ar = jn;
|
|
1145
1145
|
var Pr = require("@transferwise/components");
|
|
1146
|
-
var Qn = qe(
|
|
1146
|
+
var Qn = qe(lt());
|
|
1147
1147
|
var Wt = require("react");
|
|
1148
|
-
var
|
|
1148
|
+
var vr = require("@transferwise/components");
|
|
1149
1149
|
var ko = require("@transferwise/formatting");
|
|
1150
1150
|
var Vn = require("react-intl");
|
|
1151
1151
|
var zn = require("react-intl");
|
|
@@ -1154,7 +1154,7 @@ var require_main_min = __commonJS({
|
|
|
1154
1154
|
var Hn = (e) => {
|
|
1155
1155
|
var m;
|
|
1156
1156
|
let t = qm(e.schema), r = i(i(i({}, t), e.validationMessages), e.schema.validationMessages), o = (e.submitted || !e.changed) && !!e.errors, a = !o && (e.submitted || e.changed && e.blurred) && !!((m = e.validations) != null && m.length), n = e.focused && e.schema.description && !a, s = !!e.infoMessage;
|
|
1157
|
-
return (0, Le.jsxs)("div", { children: [o ? (0, Le.jsx)(
|
|
1157
|
+
return (0, Le.jsxs)("div", { children: [o ? (0, Le.jsx)(vr.InlineAlert, { type: "error", children: e.errors }) : null, a ? (0, Le.jsx)(vr.InlineAlert, { type: "error", children: e.validations.map((d) => (0, Le.jsx)("div", { children: r[d] }, d)) }) : null, (n || s) && (0, Le.jsxs)(vr.InlineAlert, { type: "info", children: [n && (0, Le.jsx)("div", { children: e.schema.description }), s && (0, Le.jsx)("div", { children: e.infoMessage })] })] });
|
|
1158
1158
|
};
|
|
1159
1159
|
Hn.defaultProps = { errors: "", validations: [], validationMessages: {}, validationAsyncSuccessMessage: null };
|
|
1160
1160
|
function qm(e) {
|
|
@@ -1179,11 +1179,11 @@ var require_main_min = __commonJS({
|
|
|
1179
1179
|
}
|
|
1180
1180
|
function Gn(e) {
|
|
1181
1181
|
let t = e instanceof Error;
|
|
1182
|
-
if (!(
|
|
1182
|
+
if (!(R(e) && "data" in e) && !t)
|
|
1183
1183
|
return L(e) ? e : void 0;
|
|
1184
1184
|
if (t) {
|
|
1185
1185
|
let a = e;
|
|
1186
|
-
return { id:
|
|
1186
|
+
return { id: ve(), message: a.message };
|
|
1187
1187
|
} else
|
|
1188
1188
|
return i({ message: L(e.message) ? e.message : "" }, e);
|
|
1189
1189
|
}
|
|
@@ -1196,16 +1196,16 @@ var require_main_min = __commonJS({
|
|
|
1196
1196
|
let { formatMessage: r } = (0, Jn.useIntl)(), { maxFileSizeError: o, maxItemsError: a, minItemsError: n } = Yn;
|
|
1197
1197
|
return { maxFileSizeErrorMessage: r(o), maxItemsErrorMessage: r(a, { maxItems: e }), minItemsErrorMessage: r(n, { minItems: t }), requiredMessage: r(Wn.required) };
|
|
1198
1198
|
}
|
|
1199
|
-
var
|
|
1199
|
+
var At = require("react/jsx-runtime");
|
|
1200
1200
|
var ei = (e) => {
|
|
1201
|
-
var
|
|
1202
|
-
let { onChange: t, schema: r } = e, o = Z(), a = Zn(r), n = (0, Wt.useMemo)(() => r.$id ||
|
|
1201
|
+
var w, D;
|
|
1202
|
+
let { onChange: t, schema: r } = e, o = Z(), a = Zn(r), n = (0, Wt.useMemo)(() => r.$id || ve(), [r.$id]), [s, m] = (0, Wt.useState)(false), [d, u] = (0, Wt.useState)(() => $m(e.model || [])), c = ti(r.items.persistAsync), b = r.items.persistAsync.schema, y = st(b), l = async (k) => {
|
|
1203
1203
|
m(true);
|
|
1204
1204
|
try {
|
|
1205
1205
|
let I = await qn(k, y);
|
|
1206
1206
|
o("Dynamic Flow - PersistAsync", { status: "pending", schemaId: r.$id });
|
|
1207
|
-
let
|
|
1208
|
-
return o("Dynamic Flow - PersistAsync", { status: "success", schemaId: r.$id }), $n(
|
|
1207
|
+
let q = await c(I);
|
|
1208
|
+
return o("Dynamic Flow - PersistAsync", { status: "success", schemaId: r.$id }), $n(q);
|
|
1209
1209
|
} catch (I) {
|
|
1210
1210
|
return o("Dynamic Flow - PersistAsync", { status: "failure", schemaId: r.$id }), Promise.reject(Gn(I));
|
|
1211
1211
|
}
|
|
@@ -1214,11 +1214,11 @@ var require_main_min = __commonJS({
|
|
|
1214
1214
|
if (hn(k, d))
|
|
1215
1215
|
return;
|
|
1216
1216
|
u(k);
|
|
1217
|
-
let
|
|
1218
|
-
t({ model:
|
|
1217
|
+
let q = Xn(k).map((ee) => ee.id);
|
|
1218
|
+
t({ model: q, triggerSchema: r, triggerModel: q });
|
|
1219
1219
|
}
|
|
1220
|
-
let
|
|
1221
|
-
return (0,
|
|
1220
|
+
let g = Xn(d).map((k) => k.id), S = Ct(g, r, e.required), O = !!e.errors || (s || e.submitted) && !!S.length, F = "accepts" in b && b.accepts, C = "maxSize" in b && b.maxSize, A = h(i(i({ multiple: true, className: "form-control", files: d, fileInputName: n, id: n }, F ? { fileTypes: F } : void 0), C ? { sizeLimit: Sr(C) } : void 0), { sizeLimitErrorMessage: ((w = b.validationMessages) == null ? void 0 : w.maxSize) || a.maxFileSizeErrorMessage, maxFiles: e.schema.maxItems, maxFilesErrorMessage: ((D = e.schema.validationMessages) == null ? void 0 : D.maxItems) || a.maxItemsErrorMessage, uploadButtonTitle: b.title, description: b.description, disabled: e.disabled, onUploadFile: (k) => l(k.get(n)), onFilesChange: p, onDeleteFile: () => Promise.resolve() });
|
|
1221
|
+
return (0, At.jsxs)("div", { className: (0, Qn.default)("form-group", { "has-error": O }), children: [(0, At.jsx)("label", { className: "d-block control-label", htmlFor: n, children: e.schema.title }), (0, At.jsx)(Pr.UploadInput, i({}, A)), (0, At.jsx)(Te, { changed: s, submitted: e.submitted, errors: e.errors, schema: e.schema, validations: S, validationMessages: _m(r, !!e.required, a), infoMessage: null, focused: false, blurred: true })] });
|
|
1222
1222
|
};
|
|
1223
1223
|
ei.defaultProps = { errors: null, required: false };
|
|
1224
1224
|
var Mo = ei;
|
|
@@ -1229,7 +1229,7 @@ var require_main_min = __commonJS({
|
|
|
1229
1229
|
return e.map((t) => Gm(t) ? { id: t, status: Pr.Status.SUCCEEDED } : null).filter((t) => t !== null);
|
|
1230
1230
|
}
|
|
1231
1231
|
function Gm(e) {
|
|
1232
|
-
return
|
|
1232
|
+
return B(e) || L(e);
|
|
1233
1233
|
}
|
|
1234
1234
|
function _m(e, t, r) {
|
|
1235
1235
|
let { minItems: o, maxItems: a } = e;
|
|
@@ -1239,7 +1239,7 @@ var require_main_min = __commonJS({
|
|
|
1239
1239
|
var ri = (e) => {
|
|
1240
1240
|
let { schema: t } = e;
|
|
1241
1241
|
if (Wa(t))
|
|
1242
|
-
return (0, ai.jsx)(Mo,
|
|
1242
|
+
return (0, ai.jsx)(Mo, h(i({}, e), { schema: t }));
|
|
1243
1243
|
throw new Error("Not implemented");
|
|
1244
1244
|
};
|
|
1245
1245
|
ri.defaultProps = { errors: null, required: false };
|
|
@@ -1253,24 +1253,24 @@ var require_main_min = __commonJS({
|
|
|
1253
1253
|
};
|
|
1254
1254
|
ni.defaultProps = { required: false };
|
|
1255
1255
|
var kr = ni;
|
|
1256
|
-
var si = qe(
|
|
1256
|
+
var si = qe(lt());
|
|
1257
1257
|
var Mr = require("react");
|
|
1258
1258
|
var Be = require("react/jsx-runtime");
|
|
1259
1259
|
var Wm = (e) => ({ "col-xs-12": true, "col-sm-6": e === "md", "col-sm-4": e === "sm" });
|
|
1260
1260
|
var li = (e) => {
|
|
1261
1261
|
let [t, r] = (0, Mr.useState)(() => i({}, oe(e.model, e.schema))), o = (u, c) => {
|
|
1262
|
-
c.model !== null ? t[u] = c.model : delete t[u], r(t), e.onChange(
|
|
1262
|
+
c.model !== null ? t[u] = c.model : delete t[u], r(t), e.onChange(h(i({}, c), { model: t }));
|
|
1263
1263
|
}, a = (u) => e.schema.required && e.schema.required.includes(u);
|
|
1264
1264
|
(0, Mr.useEffect)(() => {
|
|
1265
1265
|
let u = oe(t, e.schema) || {};
|
|
1266
|
-
r(u),
|
|
1266
|
+
r(u), We(u, t) || e.onChange({ model: u, triggerSchema: e.schema, triggerModel: u });
|
|
1267
1267
|
}, [e.schema]);
|
|
1268
1268
|
let n = /* @__PURE__ */ new Set([...e.schema.displayOrder || [], ...Object.keys(e.schema.properties)]), s = (u) => typeof e.schema.properties[u] != "undefined", m = Array.from(n).filter(s), d = e.errors;
|
|
1269
1269
|
return (0, Be.jsxs)("fieldset", { children: [e.schema.title && !e.hideTitle && (0, Be.jsxs)("legend", { children: [" ", e.schema.title, " "] }), e.schema.description && !e.hideTitle && (0, Be.jsxs)("p", { children: [" ", e.schema.description, " "] }), e.schema.alert && (0, Be.jsx)(ae, { component: e.schema.alert }), (0, Be.jsx)("div", { className: "row", children: m.map((u) => (0, Be.jsx)("div", { className: (0, si.default)(Wm(e.schema.properties[u].width)), children: (0, Be.jsx)(de, { schema: e.schema.properties[u], model: e.model && e.model[u], errors: d && d[u], submitted: e.submitted, required: a(u), disabled: e.disabled, onChange: (c) => o(u, c), onPersistAsync: e.onPersistAsync }) }, u)) })] });
|
|
1270
1270
|
};
|
|
1271
1271
|
li.defaultProps = { hideTitle: false, disabled: false };
|
|
1272
|
-
var
|
|
1273
|
-
var
|
|
1272
|
+
var vt = li;
|
|
1273
|
+
var Ai = qe(lt());
|
|
1274
1274
|
var Me = require("react");
|
|
1275
1275
|
var Er = require("@transferwise/components");
|
|
1276
1276
|
var di = require("react-intl");
|
|
@@ -1282,19 +1282,19 @@ var require_main_min = __commonJS({
|
|
|
1282
1282
|
return (0, Eo.jsx)(Er.Info, { className: "m-l-1", content: (0, Eo.jsx)(Er.Markdown, { children: e.help.markdown }), presentation: "POPOVER", size: "sm", "aria-label": t.formatMessage(mi.helpAria) });
|
|
1283
1283
|
};
|
|
1284
1284
|
var Pt = Km;
|
|
1285
|
-
var
|
|
1285
|
+
var G = require("@transferwise/components");
|
|
1286
1286
|
var yi = require("react");
|
|
1287
1287
|
var kt = (e, t = {}) => {
|
|
1288
1288
|
let { coerceValue: r = false } = t;
|
|
1289
|
-
if (!
|
|
1290
|
-
if (
|
|
1291
|
-
|
|
1289
|
+
if (!E(e)) {
|
|
1290
|
+
if (R(e)) {
|
|
1291
|
+
dt({ received: "object", expected: "string" });
|
|
1292
1292
|
return;
|
|
1293
1293
|
}
|
|
1294
1294
|
if (!L(e)) {
|
|
1295
1295
|
if (r)
|
|
1296
1296
|
return Do({ received: typeof e, expected: "string" }), String(e);
|
|
1297
|
-
|
|
1297
|
+
dt({ received: typeof e, expected: "string" });
|
|
1298
1298
|
return;
|
|
1299
1299
|
}
|
|
1300
1300
|
return e;
|
|
@@ -1302,59 +1302,59 @@ var require_main_min = __commonJS({
|
|
|
1302
1302
|
};
|
|
1303
1303
|
var Io = (e, t = {}) => {
|
|
1304
1304
|
let { coerceValue: r = false } = t;
|
|
1305
|
-
if (
|
|
1305
|
+
if (E(e))
|
|
1306
1306
|
return;
|
|
1307
|
-
if (
|
|
1307
|
+
if (B(e))
|
|
1308
1308
|
return e;
|
|
1309
1309
|
let o = { received: typeof e, expected: "string or number" };
|
|
1310
|
-
if (
|
|
1311
|
-
|
|
1310
|
+
if (R(e)) {
|
|
1311
|
+
dt(o);
|
|
1312
1312
|
return;
|
|
1313
1313
|
}
|
|
1314
1314
|
if (!L(e)) {
|
|
1315
1315
|
if (r)
|
|
1316
1316
|
return Do(o), String(e);
|
|
1317
|
-
|
|
1317
|
+
dt(o);
|
|
1318
1318
|
return;
|
|
1319
1319
|
}
|
|
1320
1320
|
return e;
|
|
1321
1321
|
};
|
|
1322
1322
|
var ui = (e, t = {}) => {
|
|
1323
1323
|
let { coerceValue: r = false } = t;
|
|
1324
|
-
if (
|
|
1324
|
+
if (E(e))
|
|
1325
1325
|
return false;
|
|
1326
|
-
if (!
|
|
1326
|
+
if (!Ae(e)) {
|
|
1327
1327
|
if (r)
|
|
1328
1328
|
return Do({ received: typeof e, expected: "boolean" }), !!e;
|
|
1329
|
-
|
|
1329
|
+
dt({ received: typeof e, expected: "boolean" });
|
|
1330
1330
|
return;
|
|
1331
1331
|
}
|
|
1332
1332
|
return e;
|
|
1333
1333
|
};
|
|
1334
1334
|
var pi = (e) => {
|
|
1335
|
-
if (!
|
|
1335
|
+
if (!E(e)) {
|
|
1336
1336
|
if (!(e instanceof Date) && !L(e)) {
|
|
1337
|
-
|
|
1337
|
+
dt({ received: typeof e, expected: "string or Date" });
|
|
1338
1338
|
return;
|
|
1339
1339
|
}
|
|
1340
1340
|
return e;
|
|
1341
1341
|
}
|
|
1342
1342
|
};
|
|
1343
1343
|
var fi = (e) => {
|
|
1344
|
-
if (
|
|
1344
|
+
if (E(e))
|
|
1345
1345
|
return null;
|
|
1346
1346
|
if (!L(e))
|
|
1347
|
-
return
|
|
1347
|
+
return dt({ received: typeof e, expected: "string", fallback: "null" }), null;
|
|
1348
1348
|
let t = un(e);
|
|
1349
1349
|
return t === null && console.warn("Incorrectly formatted date string. Falling back to null."), t;
|
|
1350
1350
|
};
|
|
1351
1351
|
var Do = ({ received: e, expected: t }) => {
|
|
1352
1352
|
console.warn(`Value with type ${e} passed to control that only accepts type ${t}. Type will be coerced, but this behaviour will change in the future, so please fix your code.`);
|
|
1353
1353
|
};
|
|
1354
|
-
var
|
|
1354
|
+
var dt = ({ received: e, expected: t, fallback: r = "undefined" }) => {
|
|
1355
1355
|
console.warn(`Value with type ${e} passed to control that only accepts type ${t}. Falling back to ${r}`);
|
|
1356
1356
|
};
|
|
1357
|
-
var
|
|
1357
|
+
var Y = require("react/jsx-runtime");
|
|
1358
1358
|
var Mt = class extends yi.PureComponent {
|
|
1359
1359
|
constructor(r) {
|
|
1360
1360
|
super(r);
|
|
@@ -1382,7 +1382,7 @@ var require_main_min = __commonJS({
|
|
|
1382
1382
|
if (this.props.value !== null && typeof this.props.value != "undefined")
|
|
1383
1383
|
return r2.find((o) => this.props.value === o.value);
|
|
1384
1384
|
};
|
|
1385
|
-
this.mapOption = (r2) =>
|
|
1385
|
+
this.mapOption = (r2) => h(i({}, r2), { value: B(r2.value) || L(r2.value) ? r2.value : void 0, disabled: r2.disabled || this.props.disabled, readOnly: this.props.readOnly });
|
|
1386
1386
|
this.state = { selectedOption: r.selectedOption, touched: false, prevValue: r.value };
|
|
1387
1387
|
}
|
|
1388
1388
|
static getDerivedStateFromProps(r, o) {
|
|
@@ -1390,67 +1390,67 @@ var require_main_min = __commonJS({
|
|
|
1390
1390
|
}
|
|
1391
1391
|
render() {
|
|
1392
1392
|
var ee;
|
|
1393
|
-
let { name: r, placeholder: o, step: a, countryCode: n, type: s, options: m, disabled: d, readOnly: u, required: c, minLength: b, maxLength: y, min: l, max: p, searchPlaceholder: f, searchValue:
|
|
1393
|
+
let { name: r, placeholder: o, step: a, countryCode: n, type: s, options: m, disabled: d, readOnly: u, required: c, minLength: b, maxLength: y, min: l, max: p, searchPlaceholder: f, searchValue: g, onSearchChange: S, size: O, uploadProps: F, label: C, monthFormat: A, id: w, minDate: D, maxDate: k, value: I, mode: q } = this.props;
|
|
1394
1394
|
switch (s) {
|
|
1395
|
-
case
|
|
1396
|
-
return (0,
|
|
1397
|
-
case
|
|
1398
|
-
return (0,
|
|
1399
|
-
case
|
|
1400
|
-
let
|
|
1401
|
-
return (0,
|
|
1402
|
-
var
|
|
1403
|
-
this.setState({ selectedOption:
|
|
1404
|
-
}, onFocus: this.handleOnFocus, onBlur: this.handleOnBlur, onSearchChange:
|
|
1395
|
+
case N.RADIO:
|
|
1396
|
+
return (0, Y.jsx)(G.RadioGroup, { radios: m.map(this.mapOption), name: r, selectedValue: Io(I, { coerceValue: true }), onChange: this.handleOnChange });
|
|
1397
|
+
case N.CHECKBOX:
|
|
1398
|
+
return (0, Y.jsx)(G.Checkbox, { checked: ui(I, { coerceValue: true }), disabled: d, label: C, required: c, readOnly: u, onChange: this.handleOnChange, onBlur: this.handleOnBlur, onFocus: this.handleOnFocus });
|
|
1399
|
+
case N.SELECT: {
|
|
1400
|
+
let v = m.length >= 20;
|
|
1401
|
+
return (0, Y.jsx)(G.Select, { id: w, selected: this.getSelectedOption(m), options: m, search: v, required: c, disabled: d, placeholder: o, searchPlaceholder: f, searchValue: g, onChange: (T) => {
|
|
1402
|
+
var M;
|
|
1403
|
+
this.setState({ selectedOption: T != null ? T : void 0 }), this.props.onChange((M = T == null ? void 0 : T.value) != null ? M : null);
|
|
1404
|
+
}, onFocus: this.handleOnFocus, onBlur: this.handleOnBlur, onSearchChange: v ? S : void 0 });
|
|
1405
1405
|
}
|
|
1406
|
-
case
|
|
1407
|
-
return (0,
|
|
1408
|
-
let
|
|
1409
|
-
this.setState({ selectedOption: m.find((
|
|
1406
|
+
case N.TAB:
|
|
1407
|
+
return (0, Y.jsx)(G.Tabs, { selected: ((ee = this.getSelectedOption(m)) == null ? void 0 : ee.value) || 0, tabs: m.map((v) => ({ title: v.label, content: (0, Y.jsx)(Y.Fragment, {}), disabled: v.disabled || false })), name: w, onTabSelect: (v) => {
|
|
1408
|
+
let T = !!this.state.selectedOption;
|
|
1409
|
+
this.setState({ selectedOption: m.find((M) => M.value === v) }), this.props.onChange(v, T ? "user" : "init");
|
|
1410
1410
|
} });
|
|
1411
|
-
case
|
|
1412
|
-
return (0,
|
|
1413
|
-
this.props.onChange(parseFloat(
|
|
1414
|
-
}, onFocus: this.handleOnFocus, onWheel: (
|
|
1415
|
-
|
|
1411
|
+
case N.NUMBER:
|
|
1412
|
+
return (0, Y.jsx)("input", { autoComplete: this.getAutocompleteStatus(), className: "form-control", disabled: d, id: w, max: p, min: l, placeholder: o, readOnly: u, required: c, step: a, type: "number", value: Io(I, { coerceValue: true }), onBlur: this.handleOnBlur, onChange: (v) => {
|
|
1413
|
+
this.props.onChange(parseFloat(v.target.value));
|
|
1414
|
+
}, onFocus: this.handleOnFocus, onWheel: (v) => {
|
|
1415
|
+
v.target instanceof HTMLElement && v.target.blur();
|
|
1416
1416
|
} });
|
|
1417
|
-
case
|
|
1418
|
-
return (0,
|
|
1419
|
-
case
|
|
1420
|
-
return (0,
|
|
1421
|
-
case
|
|
1422
|
-
case
|
|
1423
|
-
return (0,
|
|
1424
|
-
case
|
|
1425
|
-
return (0,
|
|
1426
|
-
this.handleOnChange(pn(
|
|
1417
|
+
case N.HIDDEN:
|
|
1418
|
+
return (0, Y.jsx)("input", { type: "hidden", name: r, value: kt(I, { coerceValue: true }), id: w });
|
|
1419
|
+
case N.PASSWORD:
|
|
1420
|
+
return (0, Y.jsx)("input", { autoComplete: this.getAutocompleteStatus(), className: "form-control", disabled: d, id: w, placeholder: o, readOnly: u, required: c, type: "password", value: kt(I, { coerceValue: true }), onBlur: this.handleOnBlur, onChange: this.handleInputOnChange, onFocus: this.handleOnFocus });
|
|
1421
|
+
case N.DATE:
|
|
1422
|
+
case N.DATETIME:
|
|
1423
|
+
return (0, Y.jsx)(G.DateInput, { disabled: d, size: O, value: pi(I), mode: q, monthFormat: A, onBlur: this.handleOnBlur, onChange: this.handleOnChange, onFocus: this.handleOnFocus });
|
|
1424
|
+
case N.DATELOOKUP:
|
|
1425
|
+
return (0, Y.jsx)(G.DateLookup, { value: fi(I), min: D, max: k, placeholder: o, monthFormat: A, disabled: d, onChange: (v) => {
|
|
1426
|
+
this.handleOnChange(pn(v));
|
|
1427
1427
|
}, onBlur: this.handleOnBlur, onFocus: this.handleOnFocus });
|
|
1428
|
-
case
|
|
1429
|
-
return (0,
|
|
1430
|
-
case
|
|
1431
|
-
let
|
|
1432
|
-
return this.props.displayPattern ? (0,
|
|
1428
|
+
case N.TEL:
|
|
1429
|
+
return (0, Y.jsx)(G.PhoneNumberInput, { disabled: d, countryCode: n, placeholder: o, required: c, searchPlaceholder: f, size: O, initialValue: kt(I), onBlur: this.handleOnBlur, onChange: this.handleOnChange, onFocus: this.handleOnFocus });
|
|
1430
|
+
case N.TEXTAREA: {
|
|
1431
|
+
let v = { className: "form-control tw-form-control", id: w, name: r, placeholder: o, value: kt(I, { coerceValue: true }), readOnly: u, required: c, minLength: b, maxLength: y, onFocus: this.handleOnFocus, onBlur: this.handleOnBlur, disabled: d, autoComplete: this.getAutocompleteStatus() };
|
|
1432
|
+
return this.props.displayPattern ? (0, Y.jsx)(G.TextareaWithDisplayFormat, h(i({ displayPattern: this.props.displayPattern }, v), { onChange: this.handleOnChange })) : (0, Y.jsx)("textarea", h(i({}, v), { onChange: this.handleInputOnChange }));
|
|
1433
1433
|
}
|
|
1434
|
-
case
|
|
1435
|
-
case
|
|
1436
|
-
return (0,
|
|
1437
|
-
this.handleOnChange(
|
|
1434
|
+
case N.FILE:
|
|
1435
|
+
case N.UPLOAD:
|
|
1436
|
+
return (0, Y.jsx)(G.Upload, h(i({}, F), { usAccept: F.usAccept || "*", usDisabled: F.usDisabled || d, onSuccess: (v) => {
|
|
1437
|
+
this.handleOnChange(v);
|
|
1438
1438
|
}, onFailure: () => {
|
|
1439
1439
|
this.handleOnChange(null);
|
|
1440
1440
|
}, onCancel: () => {
|
|
1441
1441
|
this.handleOnChange(null);
|
|
1442
1442
|
} }));
|
|
1443
|
-
case
|
|
1443
|
+
case N.TEXT:
|
|
1444
1444
|
default: {
|
|
1445
|
-
let
|
|
1446
|
-
return this.props.displayPattern ? (0,
|
|
1445
|
+
let v = { type: "text", className: "form-control", id: w, name: r, placeholder: o, value: kt(I, { coerceValue: true }), readOnly: u, required: c, minLength: b, maxLength: y, onFocus: this.handleOnFocus, onBlur: this.handleOnBlur, disabled: d, autoComplete: this.getAutocompleteStatus() };
|
|
1446
|
+
return this.props.displayPattern ? (0, Y.jsx)(G.InputWithDisplayFormat, h(i({ displayPattern: this.props.displayPattern }, v), { onChange: this.handleOnChange })) : (0, Y.jsx)("input", h(i({}, v), { onChange: this.handleInputOnChange }));
|
|
1447
1447
|
}
|
|
1448
1448
|
}
|
|
1449
1449
|
}
|
|
1450
1450
|
};
|
|
1451
1451
|
var be = Mt;
|
|
1452
|
-
be.Type =
|
|
1453
|
-
var
|
|
1452
|
+
be.Type = N, be.Size = Sn, be.MonthFormat = bn, be.DateMode = gn, be.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: Mt.DateMode.DAY_MONTH_YEAR, monthFormat: Mt.MonthFormat.LONG, onBlur: null, onFocus: null, onSearchChange: null, options: [], placeholder: null, readOnly: false, required: false, searchPlaceholder: null, searchValue: "", selectedOption: null, size: Mt.Size.MEDIUM, step: 1, type: Mt.Type.TEXT, uploadProps: {}, value: null };
|
|
1453
|
+
var Xe = require("@transferwise/components");
|
|
1454
1454
|
var Lo = qe(require("@transferwise/icons"));
|
|
1455
1455
|
var Kt = require("react/jsx-runtime");
|
|
1456
1456
|
var Ym = ({ type: e }) => {
|
|
@@ -1471,7 +1471,7 @@ var require_main_min = __commonJS({
|
|
|
1471
1471
|
let t = hi(e);
|
|
1472
1472
|
return Object.keys(Lo).includes(t);
|
|
1473
1473
|
}
|
|
1474
|
-
var
|
|
1474
|
+
var Je = Ym;
|
|
1475
1475
|
function Ir(e) {
|
|
1476
1476
|
if (e) {
|
|
1477
1477
|
let t = Zm.indexOf(e);
|
|
@@ -1497,25 +1497,25 @@ var require_main_min = __commonJS({
|
|
|
1497
1497
|
var Si = (e) => e ? Ir(e.name) : null;
|
|
1498
1498
|
var ed = (e) => z(e) ? { searchStrings: e } : {};
|
|
1499
1499
|
var td = (e) => e != null && e.url ? { icon: (0, Se.jsx)("div", { className: "media", children: (0, Se.jsx)("div", { className: "np-option__no-media-circle", children: (0, Se.jsx)("img", { src: e.url, alt: e.name || "" }) }) }) } : null;
|
|
1500
|
-
var rd = (e) => e != null && e.name && To(e.name) ? { icon: (0, Se.jsx)(
|
|
1501
|
-
var Dr = (e) => e != null && e.name && To(e.name) ? { avatar: (0, Se.jsx)(
|
|
1502
|
-
var Lr = (e) => e && e.url ? { avatar: (0, Se.jsx)(
|
|
1500
|
+
var rd = (e) => e != null && e.name && To(e.name) ? { icon: (0, Se.jsx)(Je, { type: e.name }) } : e != null && e.text ? { icon: (0, Se.jsx)("span", { children: e.text }) } : null;
|
|
1501
|
+
var Dr = (e) => e != null && e.name && To(e.name) ? { avatar: (0, Se.jsx)(Xe.Avatar, { type: Xe.AvatarType.ICON, children: (0, Se.jsx)(Je, { type: e.name }) }) } : e != null && e.text ? { avatar: (0, Se.jsx)(Xe.Avatar, { type: Xe.AvatarType.INITIALS, children: e.text }) } : null;
|
|
1502
|
+
var Lr = (e) => e && e.url ? { avatar: (0, Se.jsx)(Xe.Avatar, { type: Xe.AvatarType.THUMBNAIL, children: (0, Se.jsx)("img", { src: e.url, alt: "User avatar" }) }) } : null;
|
|
1503
1503
|
var Tr = ({ accepts: e }) => i({}, z(e) && { usAccept: e.join(",") });
|
|
1504
1504
|
var wi = (e, t) => {
|
|
1505
1505
|
if (e && t)
|
|
1506
1506
|
return { [(e + t).length > 50 ? "secondary" : "note"]: t };
|
|
1507
1507
|
};
|
|
1508
1508
|
var Fi = (e) => {
|
|
1509
|
-
if (!
|
|
1509
|
+
if (!K(e) && !E(e))
|
|
1510
1510
|
return { disabled: e };
|
|
1511
1511
|
};
|
|
1512
1512
|
var xi = require("react/jsx-runtime");
|
|
1513
1513
|
var od = (e) => e === "string" || e === "number";
|
|
1514
|
-
var Bo = (e) => {
|
|
1514
|
+
var Bo = (e, t) => {
|
|
1515
|
+
if (me(e))
|
|
1516
|
+
return e.control === N.TAB && e.oneOf.length > 3 ? N.SELECT : 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.'), N.RADIO) : e.control || N.SELECT;
|
|
1515
1517
|
if ("control" in e && e.control)
|
|
1516
|
-
return
|
|
1517
|
-
if (e.oneOf)
|
|
1518
|
-
return e.oneOf.length === 1 || e.oneOf.length >= 3 ? "select" : "radio";
|
|
1518
|
+
return e.control;
|
|
1519
1519
|
if (e.type === "string")
|
|
1520
1520
|
switch (e.format) {
|
|
1521
1521
|
case "date":
|
|
@@ -1533,17 +1533,17 @@ var require_main_min = __commonJS({
|
|
|
1533
1533
|
};
|
|
1534
1534
|
var ad = (e, t) => e.oneOf ? e.oneOf.map((r) => bi(r, t)) : null;
|
|
1535
1535
|
var Ci = (e) => {
|
|
1536
|
-
let t =
|
|
1536
|
+
let t = Ge(), r = (u) => od(e.schema.type) && (E(u) || K(u)) ? "" : u, o = (u, c) => {
|
|
1537
1537
|
e.onChange(De(u, e.schema), c);
|
|
1538
|
-
}, a = Bo(e.schema);
|
|
1539
|
-
a === "file" && t.warning("Deprecation
|
|
1538
|
+
}, a = Bo(e.schema, t);
|
|
1539
|
+
a === "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.schema.values && t.error("Deprecated schema", "Schema.values is a legacy approach. Please use oneOf.");
|
|
1540
1540
|
let n = e.schema.values || ad(e.schema, a), s = { onFocus: e.onFocus, onBlur: e.onBlur, onSearchChange: e.onSearchChange, onChange: o }, m = r(e.value), d = { id: e.id, name: e.id, label: e.schema.title, options: n || [], placeholder: e.schema.placeholder, autoComplete: !e.schema.help, disabled: e.disabled || e.schema.disabled, displayPattern: e.schema.displayFormat, uploadProps: Tr(e.schema) };
|
|
1541
1541
|
return (0, xi.jsx)(be, i(i({ type: a, value: m }, s), d));
|
|
1542
1542
|
};
|
|
1543
1543
|
Ci.defaultProps = { value: null, onFocus: null, onBlur: null, onSearchChange: null, disabled: false };
|
|
1544
1544
|
var Yt = Ci;
|
|
1545
1545
|
function Ne(e) {
|
|
1546
|
-
return !
|
|
1546
|
+
return !K(e == null ? void 0 : e.const);
|
|
1547
1547
|
}
|
|
1548
1548
|
function Jt(e) {
|
|
1549
1549
|
return !!e && !Ne(e);
|
|
@@ -1559,9 +1559,9 @@ var require_main_min = __commonJS({
|
|
|
1559
1559
|
if (o >= 0)
|
|
1560
1560
|
return o;
|
|
1561
1561
|
}
|
|
1562
|
-
return jt(e) && J(t) && Object.keys(t).length >= 1 ? Br(e, t) : jt(e) && !
|
|
1562
|
+
return jt(e) && J(t) && Object.keys(t).length >= 1 ? Br(e, t) : jt(e) && !K(e.default) && J(e.default) && Object.keys(e.default).length >= 1 ? Br(e, e.default) : null;
|
|
1563
1563
|
};
|
|
1564
|
-
var Zt = (e, t) => e.oneOf.findIndex((r) => !
|
|
1564
|
+
var Zt = (e, t) => e.oneOf.findIndex((r) => !K(t) && $(t, r));
|
|
1565
1565
|
function Br(e, t) {
|
|
1566
1566
|
if (t == null)
|
|
1567
1567
|
return null;
|
|
@@ -1572,32 +1572,32 @@ var require_main_min = __commonJS({
|
|
|
1572
1572
|
return e.properties !== null && typeof e.properties == "object" ? Object.entries(e.properties) : [];
|
|
1573
1573
|
}
|
|
1574
1574
|
var te = require("react/jsx-runtime");
|
|
1575
|
-
var
|
|
1576
|
-
let t = Z(), [r, o] = (0, Me.useState)(false), [a, n] = (0, Me.useState)(false), [s, m] = (0, Me.useState)(false), d = (0, Me.useMemo)(() => e.schema.$id ||
|
|
1577
|
-
l("Dynamic Flow - OneOf Searched", { oneOfId: e.schema.analyticsId, searchValueLength:
|
|
1575
|
+
var vi = (e) => {
|
|
1576
|
+
let t = Z(), [r, o] = (0, Me.useState)(false), [a, n] = (0, Me.useState)(false), [s, m] = (0, Me.useState)(false), d = (0, Me.useMemo)(() => e.schema.$id || ve(), [e.schema.$id]), [u, c] = (0, Me.useState)(Oi(e.schema, e.model)), [b, y] = (0, Me.useState)(cd(e.model, e.schema.oneOf)), l = On(t, 200), p = (w) => {
|
|
1577
|
+
l("Dynamic Flow - OneOf Searched", { oneOfId: e.schema.analyticsId, searchValueLength: w.length });
|
|
1578
1578
|
};
|
|
1579
1579
|
if ((0, Me.useEffect)(() => {
|
|
1580
|
-
let
|
|
1581
|
-
|
|
1580
|
+
let w = Zt(e.schema, e.model), D = Zt(e.schema, e.schema.default);
|
|
1581
|
+
w === -1 && D >= 0 && O(D, "init");
|
|
1582
1582
|
}, [e.schema]), !z(e.schema.oneOf))
|
|
1583
1583
|
return console.error("Incorrect format", e.schema), null;
|
|
1584
|
-
let f = (
|
|
1585
|
-
y([...b.slice(0,
|
|
1586
|
-
},
|
|
1584
|
+
let f = (w, D) => {
|
|
1585
|
+
y([...b.slice(0, w), D.model, ...b.slice(w + 1)]), o(true), e.onChange(D);
|
|
1586
|
+
}, g = () => {
|
|
1587
1587
|
n(true);
|
|
1588
1588
|
}, S = () => {
|
|
1589
1589
|
n(false), m(true);
|
|
1590
|
-
}, O = (
|
|
1591
|
-
c(
|
|
1592
|
-
let k = e.schema.oneOf[
|
|
1590
|
+
}, O = (w, D) => {
|
|
1591
|
+
c(w);
|
|
1592
|
+
let k = e.schema.oneOf[w];
|
|
1593
1593
|
if (Ne(k)) {
|
|
1594
1594
|
let I = k.const;
|
|
1595
|
-
e.onChange({ model: I, triggerSchema: e.schema, triggerModel: I, type:
|
|
1595
|
+
e.onChange({ model: I, triggerSchema: e.schema, triggerModel: I, type: D });
|
|
1596
1596
|
} else
|
|
1597
|
-
e.onChange({ model: b[
|
|
1598
|
-
|
|
1599
|
-
},
|
|
1600
|
-
return (0, te.jsxs)(te.Fragment, { children: [(e.schema.oneOf.length > 1 || Ne(e.schema.oneOf[0])) && (0, te.jsxs)(te.Fragment, { children: [(0, te.jsxs)("div", { className: (0,
|
|
1597
|
+
e.onChange({ model: b[w], triggerSchema: k, triggerModel: b[w], type: D });
|
|
1598
|
+
D !== "init" && e.schema.analyticsId && t("Dynamic Flow - OneOf Selected", { oneOfId: e.schema.analyticsId, schemaId: k == null ? void 0 : k.analyticsId });
|
|
1599
|
+
}, F = md(e.schema), C = sd(e, u), A = { "form-group": true, "has-error": !r && e.errors && !Ft(e.errors) || (e.submitted || r && s) && C.length };
|
|
1600
|
+
return (0, te.jsxs)(te.Fragment, { children: [(e.schema.oneOf.length > 1 || Ne(e.schema.oneOf[0])) && (0, te.jsxs)(te.Fragment, { children: [(0, te.jsxs)("div", { className: (0, Ai.default)(A), children: [id(e.schema, d), (0, te.jsx)(Yt, { id: d, schema: F, value: u, disabled: e.disabled, onChange: O, onFocus: g, onBlur: S, onSearchChange: p }), (0, te.jsx)(Te, { changed: r, focused: a, blurred: s, submitted: e.submitted, errors: ld(e.errors), schema: e.schema, validations: C, infoMessage: null })] }), e.schema.alert && (0, te.jsx)(ae, { component: e.schema.alert })] }), Jt(e.schema.oneOf[u]) && (0, te.jsx)(de, { schema: e.schema.oneOf[u], model: b[u], errors: e.errors, submitted: e.submitted, hideTitle: true, disabled: e.disabled, onChange: (w) => f(u, w), onPersistAsync: e.onPersistAsync })] });
|
|
1601
1601
|
};
|
|
1602
1602
|
function id(e, t) {
|
|
1603
1603
|
let r = e.help ? (0, te.jsx)(Pt, { help: e.help }) : null, o = Ne(e.oneOf[0]) ? (0, te.jsxs)("label", { className: "control-label d-inline", htmlFor: t, children: [e.title, " ", r] }) : (0, te.jsxs)("h4", { className: "m-b-2", children: [e.title, " ", r] });
|
|
@@ -1605,7 +1605,7 @@ var require_main_min = __commonJS({
|
|
|
1605
1605
|
}
|
|
1606
1606
|
function sd(e, t) {
|
|
1607
1607
|
let r = e.schema.oneOf[t != null ? t : -1];
|
|
1608
|
-
return Ne(r) ?
|
|
1608
|
+
return Ne(r) ? _e(r.const, e.schema, !!e.required) : t === null || t < 0 ? _e(null, e.schema, !!e.required) : [];
|
|
1609
1609
|
}
|
|
1610
1610
|
function ld(e) {
|
|
1611
1611
|
return typeof e == "string" ? e : null;
|
|
@@ -1614,42 +1614,42 @@ var require_main_min = __commonJS({
|
|
|
1614
1614
|
return t.map((r) => Ht(e, r));
|
|
1615
1615
|
}
|
|
1616
1616
|
function md(e) {
|
|
1617
|
-
return
|
|
1617
|
+
return h(i({}, e), { oneOf: e.oneOf.map(dd) });
|
|
1618
1618
|
}
|
|
1619
1619
|
function dd(e, t) {
|
|
1620
1620
|
let { title: r, description: o, disabled: a = false, icon: n, image: s, keywords: m } = e;
|
|
1621
1621
|
return { title: r, description: o, disabled: a, icon: n, image: s, const: t, keywords: m };
|
|
1622
1622
|
}
|
|
1623
|
-
|
|
1624
|
-
var Nr =
|
|
1625
|
-
var Ei = qe(
|
|
1626
|
-
var
|
|
1623
|
+
vi.defaultProps = { required: false, disabled: false };
|
|
1624
|
+
var Nr = vi;
|
|
1625
|
+
var Ei = qe(lt());
|
|
1626
|
+
var ut = require("react");
|
|
1627
1627
|
var Rr = require("@transferwise/components");
|
|
1628
1628
|
var Pi = require("react");
|
|
1629
1629
|
var Mi = require("react/jsx-runtime");
|
|
1630
1630
|
var ki = (e) => {
|
|
1631
|
-
let { id: t, httpClient: r = fetch, httpOptions: o, fileId: a, idProperty: n, usAccept: s, maxSize: m, usPlaceholder: d, onSuccess: u, onFailure: c, onCancel: b } = e, y = Z(), l = (0, Pi.useMemo)(() => a ? [{ id: a, status: Rr.Status.SUCCEEDED }] : [], [a]), p = (f) => (y("Dynamic Flow - PersistAsync", { status: "pending", schemaId: t }), r(`${o.url}`, { method: o.method || "POST", body: f }).then((
|
|
1631
|
+
let { id: t, httpClient: r = fetch, httpOptions: o, fileId: a, idProperty: n, usAccept: s, maxSize: m, usPlaceholder: d, onSuccess: u, onFailure: c, onCancel: b } = e, y = Z(), l = (0, Pi.useMemo)(() => a ? [{ id: a, status: Rr.Status.SUCCEEDED }] : [], [a]), p = (f) => (y("Dynamic Flow - PersistAsync", { status: "pending", schemaId: t }), r(`${o.url}`, { method: o.method || "POST", body: f }).then((g) => g.ok ? (u && u(g.clone()), g.json().then((S) => ({ id: S[n] }))) : (c && c({ response: g }), Promise.reject())));
|
|
1632
1632
|
return (0, Mi.jsx)(Rr.UploadInput, { id: t, fileInputName: o.fileInputName, files: l, uploadButtonTitle: e.usLabel, sizeLimit: m ? Sr(m) : void 0, fileTypes: s, description: d, onUploadFile: p, onDeleteFile: (f) => (b && b(), Promise.resolve()) });
|
|
1633
1633
|
};
|
|
1634
1634
|
var Xt = require("react/jsx-runtime");
|
|
1635
1635
|
var Ii = (e) => {
|
|
1636
|
-
let [t, r] = (0,
|
|
1637
|
-
(0,
|
|
1638
|
-
e.submitted && s(
|
|
1636
|
+
let [t, r] = (0, ut.useState)({}), [o, a] = (0, ut.useState)(null), [n, s] = (0, ut.useState)([]), [m, d] = (0, ut.useState)(false), u = re(), c = Z();
|
|
1637
|
+
(0, ut.useEffect)(() => {
|
|
1638
|
+
e.submitted && s(_e(e.model, e.schema, !!e.required));
|
|
1639
1639
|
}, [e.model, e.submitted]);
|
|
1640
|
-
let y = async (
|
|
1641
|
-
let A = await
|
|
1642
|
-
e.onChange({ model:
|
|
1643
|
-
}, l = async (
|
|
1644
|
-
if (
|
|
1645
|
-
let
|
|
1646
|
-
r(
|
|
1640
|
+
let y = async (F, C) => {
|
|
1641
|
+
let A = await F.json(), w = Uo(e.schema.persistAsync.idProperty, A);
|
|
1642
|
+
e.onChange({ model: w, triggerSchema: e.schema, triggerModel: w }), d(true), c("Dynamic Flow - PersistAsync", { status: "success", schemaId: e.schema.$id });
|
|
1643
|
+
}, l = async (F) => {
|
|
1644
|
+
if (F.response && dr(F.response.status)) {
|
|
1645
|
+
let C = await F.response.json();
|
|
1646
|
+
r(C.validation || {}), a([e.schema.persistAsync.param]);
|
|
1647
1647
|
}
|
|
1648
1648
|
e.onChange({ model: null, triggerSchema: e.schema, triggerModel: null }), d(true), c("Dynamic Flow - PersistAsync", { status: "failure", schemaId: e.schema.$id });
|
|
1649
1649
|
}, p = () => {
|
|
1650
1650
|
a(null), e.onChange({ model: null, triggerSchema: e.schema, triggerModel: null }), d(true);
|
|
1651
|
-
}, { url: f, method:
|
|
1652
|
-
return (0, Xt.jsxs)("div", { className: (0, Ei.default)(O), children: [(0, Xt.jsx)(ki, i({ id: e.schema.$id || e.schema.persistAsync.schema.$id || e.schema.persistAsync.idProperty, fileId: e.model, idProperty: e.schema.persistAsync.idProperty, animationDelay: 0, maxSize: e.schema.persistAsync.schema.maxSize, usLabel: e.schema.title || e.schema.persistAsync.schema.title, usPlaceholder: e.schema.description || e.schema.persistAsync.schema.description, httpOptions: { url: f, method:
|
|
1651
|
+
}, { url: f, method: g } = e.schema.persistAsync, S = o || n, O = { "form-group": true, "has-error": (e.submitted || m) && !!S.length };
|
|
1652
|
+
return (0, Xt.jsxs)("div", { className: (0, Ei.default)(O), children: [(0, Xt.jsx)(ki, i({ id: e.schema.$id || e.schema.persistAsync.schema.$id || e.schema.persistAsync.idProperty, fileId: e.model, idProperty: e.schema.persistAsync.idProperty, animationDelay: 0, maxSize: e.schema.persistAsync.schema.maxSize, usLabel: e.schema.title || e.schema.persistAsync.schema.title, usPlaceholder: e.schema.description || e.schema.persistAsync.schema.description, httpOptions: { url: f, method: g, fileInputName: e.schema.persistAsync.param }, httpClient: u, onSuccess: y, onFailure: l, onCancel: p }, Tr(e.schema.persistAsync.schema))), (0, Xt.jsx)(Te, { blurred: true, focused: false, changed: m, submitted: e.submitted, errors: e.errors, schema: e.schema, validations: S, validationMessages: i({ required: "Value is required..." }, t), infoMessage: null })] });
|
|
1653
1653
|
};
|
|
1654
1654
|
Ii.defaultProps = { required: false };
|
|
1655
1655
|
var Ro = Ii;
|
|
@@ -1695,36 +1695,36 @@ var require_main_min = __commonJS({
|
|
|
1695
1695
|
return (0, Et.jsx)(Et.Fragment, {});
|
|
1696
1696
|
}
|
|
1697
1697
|
};
|
|
1698
|
-
zi.defaultProps = { id:
|
|
1698
|
+
zi.defaultProps = { id: ve(), title: void 0 };
|
|
1699
1699
|
var Vi = zi;
|
|
1700
1700
|
var Re = require("react/jsx-runtime");
|
|
1701
1701
|
var qi = (e) => e.promoted === true;
|
|
1702
1702
|
var ud = (e) => {
|
|
1703
1703
|
var m;
|
|
1704
1704
|
let [t, r] = (0, Hi.useState)(Li(e.schema, e.model) || ((m = e.schema.promotion) == null ? void 0 : m.default) || "promoted"), o = e.schema.alert, a = e.schema.oneOf.find(qi), n = pd(a), s = fd(e.schema);
|
|
1705
|
-
return (0, Re.jsxs)(Re.Fragment, { children: [o && (0, Re.jsx)(ae, { component: o }), (0, Re.jsx)(Vi, { id: e.schema.$id, title: e.schema.title, promotedOneOf: a, promotion: e.schema.promotion, selection: t, setSelection: r }), t === "promoted" && (0, Re.jsx)(
|
|
1705
|
+
return (0, Re.jsxs)(Re.Fragment, { children: [o && (0, Re.jsx)(ae, { component: o }), (0, Re.jsx)(Vi, { id: e.schema.$id, title: e.schema.title, promotedOneOf: a, promotion: e.schema.promotion, selection: t, setSelection: r }), t === "promoted" && (0, Re.jsx)(vt, h(i({}, e), { schema: n })), t === "other" && (0, Re.jsx)(de, h(i({}, e), { schema: s }))] });
|
|
1706
1706
|
};
|
|
1707
1707
|
function pd(e) {
|
|
1708
|
-
return
|
|
1708
|
+
return h(i({}, e), { title: void 0, description: void 0 });
|
|
1709
1709
|
}
|
|
1710
1710
|
function fd(e) {
|
|
1711
1711
|
var o, a, n;
|
|
1712
1712
|
let t = (o = e.promotion) != null && o.displayTwice ? [...e.oneOf] : e.oneOf.filter((s) => !qi(s)), r = (n = (a = e.promotion) == null ? void 0 : a.other.heading) == null ? void 0 : n.text;
|
|
1713
|
-
return t.length === 1 ?
|
|
1713
|
+
return t.length === 1 ? h(i({}, t[0]), { title: r }) : t.length > 1 ? { title: r, oneOf: t, control: e.control } : null;
|
|
1714
1714
|
}
|
|
1715
1715
|
var jr = ud;
|
|
1716
1716
|
var zr = require("@transferwise/components");
|
|
1717
1717
|
var Gi = require("react-intl");
|
|
1718
1718
|
var $i = require("react-intl");
|
|
1719
1719
|
var Vo = (0, $i.defineMessages)({ yes: { id: "dynamicFlows.ReadOnlySchema.yes", defaultMessage: "Yes", description: "Yes, used for boolean schemas with a value of true." }, no: { id: "dynamicFlows.ReadOnlySchema.no", defaultMessage: "No", description: "No: used for boolean schemas with a value of false." } });
|
|
1720
|
-
var
|
|
1720
|
+
var pt = require("react/jsx-runtime");
|
|
1721
1721
|
var yd = ({ schema: e, model: t }) => {
|
|
1722
1722
|
let { title: r = "" } = e, { formatMessage: o } = (0, Gi.useIntl)(), a = hd({ schema: e, model: t, formatMessage: o });
|
|
1723
|
-
return (0,
|
|
1723
|
+
return (0, pt.jsx)(zr.DefinitionList, { layout: zr.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title: r, value: a, key: "" }] });
|
|
1724
1724
|
};
|
|
1725
1725
|
var Ho = yd;
|
|
1726
1726
|
function hd({ schema: e, model: t, formatMessage: r }) {
|
|
1727
|
-
return fe(e) ? me(e) ? gd(e, t) : e.type === "boolean" &&
|
|
1727
|
+
return fe(e) ? me(e) ? gd(e, t) : e.type === "boolean" && Ae(t) ? r(t ? Vo.yes : Vo.no) : t && t.toString() || "" : "";
|
|
1728
1728
|
}
|
|
1729
1729
|
function gd(e, t) {
|
|
1730
1730
|
let r = bd(e, t);
|
|
@@ -1735,108 +1735,108 @@ var require_main_min = __commonJS({
|
|
|
1735
1735
|
}
|
|
1736
1736
|
function Sd(e) {
|
|
1737
1737
|
let t = e.title && e.description ? `${e.title} - ${e.description}` : e.title || "", r = wd(e);
|
|
1738
|
-
return r ? (0,
|
|
1738
|
+
return r ? (0, pt.jsxs)(pt.Fragment, { children: [r, " ", t] }) : t;
|
|
1739
1739
|
}
|
|
1740
1740
|
function wd(e) {
|
|
1741
1741
|
var r, o;
|
|
1742
1742
|
let t = (o = Ir((r = e.icon) == null ? void 0 : r.name)) == null ? void 0 : o.currency;
|
|
1743
|
-
return t ? (0,
|
|
1743
|
+
return t ? (0, pt.jsx)("i", { className: `currency-flag currency-flag-${t} hidden-xs` }) : null;
|
|
1744
1744
|
}
|
|
1745
|
-
var
|
|
1745
|
+
var Qe = require("react");
|
|
1746
1746
|
var Wi = require("react/jsx-runtime");
|
|
1747
1747
|
var _i = (e) => {
|
|
1748
|
-
let [t, r] = (0,
|
|
1749
|
-
let
|
|
1750
|
-
o.current =
|
|
1751
|
-
let k = await y(A.url, { method: A.method || "POST", headers: { "Content-Type": "application/json" }, body: A.method === "GET" ? void 0 : JSON.stringify(
|
|
1748
|
+
let [t, r] = (0, Qe.useState)(e.model), o = (0, Qe.useRef)(null), [a, n] = (0, Qe.useState)(null), [s, m] = (0, Qe.useState)(null), [d, u] = (0, Qe.useState)(false), [c, b] = (0, Qe.useState)(null), y = re(), l = Z(), p = Ge(), f = async (C, A) => {
|
|
1749
|
+
let w = g(), D = { [A.param]: C };
|
|
1750
|
+
o.current = C, u(true), A.method || p.warning("Invalid schema or model", 'ValidationAsyncSchema without a "method" property would have defaulted to "GET" in previous versions. Now defaults to "POST".', {}), l("Dynamic Flow - ValidationAsync", { status: "pending" });
|
|
1751
|
+
let k = await y(A.url, { method: A.method || "POST", headers: { "Content-Type": "application/json" }, body: A.method === "GET" ? void 0 : JSON.stringify(D), signal: w });
|
|
1752
1752
|
try {
|
|
1753
1753
|
let I = await k.json();
|
|
1754
|
-
if (!
|
|
1754
|
+
if (!R(I))
|
|
1755
1755
|
throw new Error("Response body is not an object");
|
|
1756
1756
|
l("Dynamic Flow - ValidationAsync", { status: "success" }), k.status === 200 ? n(L(I.message) ? I.message : null) : k.status === 422 && m(L(I.message) ? I.message : null);
|
|
1757
1757
|
} catch (I) {
|
|
1758
1758
|
l("Dynamic Flow - ValidationAsync", { status: "failure" });
|
|
1759
1759
|
}
|
|
1760
|
-
},
|
|
1760
|
+
}, g = () => {
|
|
1761
1761
|
c && c.abort();
|
|
1762
|
-
let
|
|
1763
|
-
return b(
|
|
1762
|
+
let C = new AbortController();
|
|
1763
|
+
return b(C), C.signal;
|
|
1764
1764
|
}, S = () => {
|
|
1765
|
-
!
|
|
1766
|
-
}, O = (
|
|
1767
|
-
e.onChange(
|
|
1768
|
-
},
|
|
1769
|
-
return (0, Wi.jsx)(
|
|
1765
|
+
!E(t) && !We(t, o.current) && f(t, e.schema.validationAsync);
|
|
1766
|
+
}, O = (C) => {
|
|
1767
|
+
e.onChange(h(i({}, C), { triggerSchema: e.schema, triggerModel: C.model })), m(null), n(null), $(C.model, e.schema) && r(C.model);
|
|
1768
|
+
}, F = { required: e.required, submitted: e.submitted || d, schema: e.schema, model: t, errors: s || e.errors, onChange: O, onBlur: S, infoMessage: a };
|
|
1769
|
+
return (0, Wi.jsx)(et, i({}, F));
|
|
1770
1770
|
};
|
|
1771
1771
|
_i.defaultProps = { required: false };
|
|
1772
1772
|
var Vr = _i;
|
|
1773
1773
|
var V = require("react/jsx-runtime");
|
|
1774
1774
|
var Fd = (e) => {
|
|
1775
|
-
let { schema: t, model: r = null, errors: o = null, hideTitle: a = false, disabled: n = false } = e, s =
|
|
1775
|
+
let { schema: t, model: r = null, errors: o = null, hideTitle: a = false, disabled: n = false } = e, s = h(i({}, e), { model: r, errors: o, hideTitle: a, disabled: n }), m = Fo(t), d = Ge(), u = () => d.error("Invalid schema or model", `Schema of type ${m || "undefined"} requested, but schema did not pass validation.`);
|
|
1776
1776
|
switch (m) {
|
|
1777
1777
|
case "readOnly":
|
|
1778
1778
|
return (0, V.jsx)(Ho, i({}, s));
|
|
1779
1779
|
case "persistAsync":
|
|
1780
1780
|
if (wt(t) && $a(r) && St(o)) {
|
|
1781
|
-
let c =
|
|
1781
|
+
let c = h(i({}, s), { schema: t, model: r, errors: o });
|
|
1782
1782
|
return (0, V.jsx)(Ur, i({}, c));
|
|
1783
1783
|
} else
|
|
1784
1784
|
return u(), (0, V.jsx)(Ur, i({}, e));
|
|
1785
1785
|
case "validationAsync":
|
|
1786
1786
|
if (Vt(t) && mo(r) && St(o)) {
|
|
1787
|
-
let c =
|
|
1787
|
+
let c = h(i({}, s), { schema: t, model: r, errors: o });
|
|
1788
1788
|
return (0, V.jsx)(Vr, i({}, c));
|
|
1789
1789
|
} else
|
|
1790
1790
|
return u(), (0, V.jsx)(Vr, i({}, e));
|
|
1791
1791
|
case "basic":
|
|
1792
1792
|
if (fe(t) && mo(r) && St(o)) {
|
|
1793
|
-
let c =
|
|
1794
|
-
return (0, V.jsx)(
|
|
1793
|
+
let c = h(i({ infoMessage: null }, s), { schema: t, model: r, errors: o });
|
|
1794
|
+
return (0, V.jsx)(et, i({}, c));
|
|
1795
1795
|
} else {
|
|
1796
|
-
let c =
|
|
1797
|
-
return u(), (0, V.jsx)(
|
|
1796
|
+
let c = h(i({ infoMessage: null }, s), { schema: t, model: r, errors: o });
|
|
1797
|
+
return u(), (0, V.jsx)(et, i({}, c));
|
|
1798
1798
|
}
|
|
1799
1799
|
case "object":
|
|
1800
1800
|
if (ce(t) && co(r)) {
|
|
1801
|
-
let c =
|
|
1802
|
-
return (0, V.jsx)(
|
|
1801
|
+
let c = h(i({}, s), { schema: t, model: r, errors: o });
|
|
1802
|
+
return (0, V.jsx)(vt, i({}, c), JSON.stringify(t));
|
|
1803
1803
|
} else
|
|
1804
|
-
return u(), (0, V.jsx)(
|
|
1804
|
+
return u(), (0, V.jsx)(vt, i({}, e));
|
|
1805
1805
|
case "array":
|
|
1806
1806
|
if (ye(t) && Ga(r) && St(o)) {
|
|
1807
|
-
let c =
|
|
1807
|
+
let c = h(i({}, s), { schema: t, model: r, errors: o });
|
|
1808
1808
|
return (0, V.jsx)(kr, i({}, c));
|
|
1809
1809
|
} else
|
|
1810
1810
|
return u(), (0, V.jsx)(kr, i({}, e));
|
|
1811
1811
|
case "promotedOneOf":
|
|
1812
1812
|
if (jt(t) && co(r)) {
|
|
1813
|
-
let c =
|
|
1813
|
+
let c = h(i({}, s), { schema: t, model: r, errors: o });
|
|
1814
1814
|
return (0, V.jsx)(jr, i({}, c));
|
|
1815
1815
|
} else
|
|
1816
1816
|
return u(), (0, V.jsx)(jr, i({}, e));
|
|
1817
1817
|
case "oneOf":
|
|
1818
1818
|
if (me(t)) {
|
|
1819
|
-
let c =
|
|
1819
|
+
let c = h(i({}, s), { schema: t, model: r, errors: o });
|
|
1820
1820
|
return (0, V.jsx)(Nr, i({}, c));
|
|
1821
1821
|
} else
|
|
1822
1822
|
return u(), (0, V.jsx)(Nr, i({}, e));
|
|
1823
1823
|
case "allOf":
|
|
1824
1824
|
if (zt(t) && J(r)) {
|
|
1825
|
-
let c =
|
|
1826
|
-
return (0, V.jsx)(
|
|
1825
|
+
let c = h(i({}, s), { schema: t, model: r, errors: o });
|
|
1826
|
+
return (0, V.jsx)(Ar, i({}, c));
|
|
1827
1827
|
} else
|
|
1828
|
-
return u(), (0, V.jsx)(
|
|
1828
|
+
return u(), (0, V.jsx)(Ar, i({}, e));
|
|
1829
1829
|
}
|
|
1830
1830
|
return (0, V.jsx)(V.Fragment, {});
|
|
1831
1831
|
};
|
|
1832
1832
|
var de = Fd;
|
|
1833
|
-
var
|
|
1833
|
+
var ft = require("react/jsx-runtime");
|
|
1834
1834
|
var Cd = (e) => {
|
|
1835
1835
|
let t = i({ model: null, errors: null, disabled: false, baseUrl: "" }, e);
|
|
1836
|
-
return hr() || t.baseUrl == null ? (0,
|
|
1836
|
+
return hr() || t.baseUrl == null ? (0, ft.jsx)(de, i({}, t)) : (0, ft.jsx)(xd, { baseUrl: t.baseUrl, onEvent: t.onEvent, onLog: t.onLog, children: (0, ft.jsx)(de, i({}, t)) });
|
|
1837
1837
|
};
|
|
1838
1838
|
var er = Cd;
|
|
1839
|
-
var xd = ({ baseUrl: e, onEvent: t, onLog: r, children: o }) => (0,
|
|
1839
|
+
var xd = ({ baseUrl: e, onEvent: t, onLog: r, children: o }) => (0, ft.jsx)(gr, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog: r != null ? r : Ki, children: (0, ft.jsx)(mr, { metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" }, onEvent: t != null ? t : Ki, children: (0, ft.jsx)(yr, { baseUrl: e, children: o }) }) });
|
|
1840
1840
|
var Ki = () => {
|
|
1841
1841
|
};
|
|
1842
1842
|
var qo = require("react/jsx-runtime");
|
|
@@ -1848,8 +1848,8 @@ var require_main_min = __commonJS({
|
|
|
1848
1848
|
};
|
|
1849
1849
|
var $o = Od;
|
|
1850
1850
|
var It = require("react/jsx-runtime");
|
|
1851
|
-
var
|
|
1852
|
-
let { text: t, size: r = "md", align: o = "left", margin: a = "md" } = e.component, n =
|
|
1851
|
+
var Ad = (e) => {
|
|
1852
|
+
let { text: t, size: r = "md", align: o = "left", margin: a = "md" } = e.component, n = Ke({ align: o, margin: a });
|
|
1853
1853
|
switch (r) {
|
|
1854
1854
|
case "xs":
|
|
1855
1855
|
return (0, It.jsx)("h5", { className: n, children: t });
|
|
@@ -1864,11 +1864,11 @@ var require_main_min = __commonJS({
|
|
|
1864
1864
|
return (0, It.jsx)("h3", { className: n, children: t });
|
|
1865
1865
|
}
|
|
1866
1866
|
};
|
|
1867
|
-
var Go =
|
|
1867
|
+
var Go = Ad;
|
|
1868
1868
|
var Yi = require("@transferwise/components");
|
|
1869
1869
|
var _o = require("react/jsx-runtime");
|
|
1870
|
-
var
|
|
1871
|
-
var Wo =
|
|
1870
|
+
var vd = ({ component: e }) => (0, _o.jsx)("div", { className: Ke(e), children: (0, _o.jsx)(Yi.Markdown, { config: { link: { target: "_blank" } }, children: e.markdown }) });
|
|
1871
|
+
var Wo = vd;
|
|
1872
1872
|
var Ji = require("@transferwise/components");
|
|
1873
1873
|
var Hr = require("react");
|
|
1874
1874
|
var Ko = require("react/jsx-runtime");
|
|
@@ -1913,7 +1913,7 @@ var require_main_min = __commonJS({
|
|
|
1913
1913
|
case "review":
|
|
1914
1914
|
return (0, H.jsx)(Qo, { component: c, onAction: s }, X(c));
|
|
1915
1915
|
case "divider":
|
|
1916
|
-
return (0, H.jsx)(
|
|
1916
|
+
return (0, H.jsx)(vo, { component: c }, X(c));
|
|
1917
1917
|
case "info":
|
|
1918
1918
|
return (0, H.jsx)(Wo, { component: c }, X(c));
|
|
1919
1919
|
case "columns":
|
|
@@ -1925,7 +1925,7 @@ var require_main_min = __commonJS({
|
|
|
1925
1925
|
case "box":
|
|
1926
1926
|
return (0, H.jsx)(Co, { component: c, model: r, submitted: o, errors: a, onModelChange: n, onAction: s, onPersistAsync: m }, X(c));
|
|
1927
1927
|
case "decision":
|
|
1928
|
-
return (0, H.jsx)(
|
|
1928
|
+
return (0, H.jsx)(Ao, { component: c, onAction: s }, X(c));
|
|
1929
1929
|
case "external":
|
|
1930
1930
|
return (0, H.jsx)(Po, { component: c, onAction: s }, X(c));
|
|
1931
1931
|
case "list":
|
|
@@ -1943,7 +1943,7 @@ var require_main_min = __commonJS({
|
|
|
1943
1943
|
var Dt = require("react/jsx-runtime");
|
|
1944
1944
|
var Id = ({ component: e }) => (0, Dt.jsxs)("div", { className: j(e.margin || "md"), children: [e.title ? (0, Dt.jsxs)("h4", { className: "m-b-2", children: [" ", e.title, " "] }) : null, e.items.map(Dd)] });
|
|
1945
1945
|
function Dd({ title: e, description: t, icon: r, status: o }) {
|
|
1946
|
-
let a = i(i({ key: `${e}/${t || ""}`, title: e, description: t }, r != null && r.name ? { icon: (0, Dt.jsx)(
|
|
1946
|
+
let a = i(i({ key: `${e}/${t || ""}`, title: e, description: t }, r != null && r.name ? { icon: (0, Dt.jsx)(Je, { type: r.name }) } : {}), o ? { status: Ld[o] } : {});
|
|
1947
1947
|
return (0, Dt.jsx)(Zi.Summary, i({}, a));
|
|
1948
1948
|
}
|
|
1949
1949
|
var Ld = { positive: "done", warning: "pending", neutral: "notDone" };
|
|
@@ -1967,15 +1967,15 @@ var require_main_min = __commonJS({
|
|
|
1967
1967
|
}
|
|
1968
1968
|
function Bd() {
|
|
1969
1969
|
}
|
|
1970
|
-
var
|
|
1971
|
-
var Nd = ({ component: e }) => e.control === "copyable" ? (0,
|
|
1972
|
-
var Rd = ({ component: e }) => (0,
|
|
1970
|
+
var tt = require("react/jsx-runtime");
|
|
1971
|
+
var Nd = ({ component: e }) => e.control === "copyable" ? (0, tt.jsx)(Ud, { component: e }) : (0, tt.jsx)(Rd, { component: e });
|
|
1972
|
+
var Rd = ({ component: e }) => (0, tt.jsxs)("p", { className: Ke(e), children: [" ", e.text, " "] });
|
|
1973
1973
|
var Ud = ({ component: e }) => {
|
|
1974
1974
|
let { formatMessage: t } = (0, ns.useIntl)(), r = os(), { text: o } = e, a = () => {
|
|
1975
1975
|
var s;
|
|
1976
1976
|
(s = navigator.clipboard) == null || s.writeText(o).then(() => r({ text: t(ea.copied) })).catch(jd);
|
|
1977
|
-
}, n =
|
|
1978
|
-
return (0,
|
|
1977
|
+
}, n = Ke({ align: e.align, margin: "sm" }) + " form-control";
|
|
1978
|
+
return (0, tt.jsxs)("div", { className: Ke(e), children: [(0, tt.jsx)("input", { type: "text", className: n, value: o, readOnly: true, style: { textOverflow: "ellipsis" } }), (0, tt.jsx)(as.Button, { block: true, onClick: a, children: t(ea.copy) })] });
|
|
1979
1979
|
};
|
|
1980
1980
|
function jd() {
|
|
1981
1981
|
}
|
|
@@ -1992,90 +1992,90 @@ var require_main_min = __commonJS({
|
|
|
1992
1992
|
};
|
|
1993
1993
|
var Qo = Hd;
|
|
1994
1994
|
var se = require("react/jsx-runtime");
|
|
1995
|
-
var ta = (e) =>
|
|
1995
|
+
var ta = (e) => E(e) || K(e);
|
|
1996
1996
|
var qd = (e) => e.type === "boolean" && ta(e.default) ? false : e.default;
|
|
1997
1997
|
var ls = (e) => {
|
|
1998
|
-
var ee,
|
|
1999
|
-
let t = (
|
|
2000
|
-
y(true), o(a(
|
|
2001
|
-
}, r = (
|
|
2002
|
-
d(
|
|
2003
|
-
let pe = r(
|
|
1998
|
+
var ee, v, T;
|
|
1999
|
+
let t = (M) => {
|
|
2000
|
+
y(true), o(a(M), "user");
|
|
2001
|
+
}, r = (M) => _e(M, e.schema, e.required), o = (M, ue) => {
|
|
2002
|
+
d(M);
|
|
2003
|
+
let pe = r(M);
|
|
2004
2004
|
O(pe);
|
|
2005
|
-
let le =
|
|
2005
|
+
let le = M;
|
|
2006
2006
|
c(le), le !== u && e.onChange({ model: le, triggerSchema: e.schema, triggerModel: le, lastTriggerModel: u, type: ue });
|
|
2007
|
-
}, a = (
|
|
2008
|
-
p(false),
|
|
2009
|
-
}, [m, d] = (0, ie.useState)((ee = e.model) != null ? ee : null), [u, c] = (0, ie.useState)((
|
|
2010
|
-
let
|
|
2011
|
-
ta(m) && !ta(
|
|
2007
|
+
}, a = (M) => De(M, e.schema), n = () => p(true), s = () => {
|
|
2008
|
+
p(false), g(true), e.onBlur && e.onBlur();
|
|
2009
|
+
}, [m, d] = (0, ie.useState)((ee = e.model) != null ? ee : null), [u, c] = (0, ie.useState)((v = e.model) != null ? v : null), [b, y] = (0, ie.useState)(false), [l, p] = (0, ie.useState)(false), [f, g] = (0, ie.useState)(false), [S, O] = (0, ie.useState)([]), F = (0, ie.useMemo)(() => e.schema.$id || ve(), [e.schema.$id]), C = () => {
|
|
2010
|
+
let M = qd(e.schema);
|
|
2011
|
+
ta(m) && !ta(M) && o(M, "init"), e.schema.const && o(e.schema.const, "init");
|
|
2012
2012
|
}, A = () => {
|
|
2013
2013
|
O(r(m));
|
|
2014
|
-
},
|
|
2015
|
-
(0, ie.useEffect)(A, [e.model, e.submitted]), (0, ie.useEffect)(
|
|
2016
|
-
var
|
|
2017
|
-
return d((
|
|
2014
|
+
}, w = e.schema.const, D = e.schema.hidden || w;
|
|
2015
|
+
(0, ie.useEffect)(A, [e.model, e.submitted]), (0, ie.useEffect)(C, [e.schema]), (0, ie.useEffect)(() => {
|
|
2016
|
+
var M;
|
|
2017
|
+
return d((M = e.model) != null ? M : null);
|
|
2018
2018
|
}, [e.model]);
|
|
2019
|
-
let k = { "form-group": true, "has-error": (e.submitted || !b) && !!e.errors || (e.submitted || b && f) && !!S.length, "has-info": l && !!e.schema.description || !!e.infoMessage }, I = e.schema.format !== "file" && e.schema.type !== "boolean",
|
|
2020
|
-
return
|
|
2019
|
+
let k = { "form-group": true, "has-error": (e.submitted || !b) && !!e.errors || (e.submitted || b && f) && !!S.length, "has-info": l && !!e.schema.description || !!e.infoMessage }, I = e.schema.format !== "file" && e.schema.type !== "boolean", q = e.schema.help;
|
|
2020
|
+
return D ? null : (0, se.jsxs)(se.Fragment, { children: [e.schema.alert && (0, se.jsx)(ae, { component: e.schema.alert }), (0, se.jsxs)("div", { className: (0, ss.default)(k), children: [I && (0, se.jsxs)("div", { className: "d-inline-block", children: [(0, se.jsx)("label", { className: "control-label d-inline", htmlFor: F, children: e.schema.title }), !!q && (0, se.jsx)(Pt, { help: q })] }), !I && !!q && (0, se.jsx)(Pt, { help: q }), (0, se.jsx)(Yt, { id: F, schema: e.schema, value: m, disabled: !!e.disabled, onChange: t, onFocus: n, onBlur: s }), (0, se.jsx)(Te, { changed: b, focused: l, blurred: f, submitted: e.submitted, errors: (T = e.errors) != null ? T : null, schema: e.schema, validations: S, infoMessage: e.infoMessage })] })] });
|
|
2021
2021
|
};
|
|
2022
2022
|
ls.defaultProps = { required: false, disabled: false, onBlur: null };
|
|
2023
|
-
var
|
|
2023
|
+
var et = ls;
|
|
2024
2024
|
var us = require("react/jsx-runtime");
|
|
2025
2025
|
var Uo = (e, t) => t[e];
|
|
2026
2026
|
var ms = (e, t) => {
|
|
2027
2027
|
var r;
|
|
2028
2028
|
return (r = t.validation) == null ? void 0 : r[e];
|
|
2029
2029
|
};
|
|
2030
|
-
var $d = /* @__PURE__ */ new Set([
|
|
2030
|
+
var $d = /* @__PURE__ */ new Set([N.RADIO, N.SELECT, N.DATELOOKUP, N.FILE, N.UPLOAD]);
|
|
2031
2031
|
var ds = (e) => {
|
|
2032
|
-
let t = (0, cs.useIntl)(), r = re(), o = Z(), [a, n] = (0,
|
|
2033
|
-
(0,
|
|
2034
|
-
$d.has(Bo(e.schema.persistAsync.schema)) &&
|
|
2032
|
+
let t = (0, cs.useIntl)(), r = re(), o = Z(), [a, n] = (0, yt.useState)(null), s = ps(a), [m, d] = (0, yt.useState)(null), [u, c] = (0, yt.useState)(false), [b, y] = (0, yt.useState)(null), l = Ge();
|
|
2033
|
+
(0, yt.useEffect)(() => {
|
|
2034
|
+
$d.has(Bo(e.schema.persistAsync.schema, l)) && S();
|
|
2035
2035
|
}, [a]);
|
|
2036
|
-
let
|
|
2037
|
-
let
|
|
2036
|
+
let p = () => d(t.formatMessage(_t.genericError)), f = async (C, A) => {
|
|
2037
|
+
let w = g(), D = { [A.param]: C };
|
|
2038
2038
|
c(true);
|
|
2039
2039
|
try {
|
|
2040
2040
|
o("Dynamic Flow - PersistAsync", { status: "pending", schemaId: Cr.$id });
|
|
2041
|
-
let
|
|
2042
|
-
e.onPersistAsync(
|
|
2043
|
-
let
|
|
2044
|
-
if (!
|
|
2041
|
+
let k = r(A.url, { method: A.method, headers: { "Content-Type": "application/json" }, body: JSON.stringify(D), signal: w });
|
|
2042
|
+
e.onPersistAsync(k);
|
|
2043
|
+
let I = await k, q = await I.json();
|
|
2044
|
+
if (!R(q))
|
|
2045
2045
|
throw new Error("Response is not an object");
|
|
2046
|
-
let { idProperty:
|
|
2047
|
-
if (za(
|
|
2048
|
-
let
|
|
2049
|
-
e.onChange({ model:
|
|
2050
|
-
} else if (dr(
|
|
2051
|
-
let { validation:
|
|
2052
|
-
d(
|
|
2046
|
+
let { idProperty: ee, param: v } = e.schema.persistAsync;
|
|
2047
|
+
if (za(I.status)) {
|
|
2048
|
+
let T = Uo(ee, q);
|
|
2049
|
+
e.onChange({ model: T, triggerSchema: e.schema, triggerModel: T });
|
|
2050
|
+
} else if (dr(I.status)) {
|
|
2051
|
+
let { validation: T } = q, M = R(T) && (T == null ? void 0 : T[v]) || null;
|
|
2052
|
+
d(M), e.onChange({ model: null, triggerSchema: e.schema, triggerModel: null });
|
|
2053
2053
|
} else
|
|
2054
|
-
|
|
2054
|
+
p();
|
|
2055
2055
|
o("Dynamic Flow - PersistAsync", { status: "success", schemaId: Cr.$id });
|
|
2056
|
-
} catch (
|
|
2057
|
-
o("Dynamic Flow - PersistAsync", { status: "failure", schemaId: Cr.$id }),
|
|
2056
|
+
} catch (k) {
|
|
2057
|
+
o("Dynamic Flow - PersistAsync", { status: "failure", schemaId: Cr.$id }), p();
|
|
2058
2058
|
}
|
|
2059
|
-
},
|
|
2059
|
+
}, g = () => {
|
|
2060
2060
|
b && b.abort();
|
|
2061
|
-
let
|
|
2062
|
-
return y(
|
|
2063
|
-
}, h = () => {
|
|
2064
|
-
!M(a) && !_e(a, s) && p(a, e.schema.persistAsync);
|
|
2061
|
+
let C = new AbortController();
|
|
2062
|
+
return y(C), C.signal;
|
|
2065
2063
|
}, S = () => {
|
|
2066
|
-
|
|
2067
|
-
}, O = (
|
|
2068
|
-
|
|
2064
|
+
!E(a) && !We(a, s) && f(a, e.schema.persistAsync);
|
|
2065
|
+
}, O = () => {
|
|
2066
|
+
S();
|
|
2067
|
+
}, F = ({ model: C }) => {
|
|
2068
|
+
d(null), $(C, e.schema.persistAsync.schema) && n(C);
|
|
2069
2069
|
};
|
|
2070
|
-
return (0, us.jsx)(
|
|
2070
|
+
return (0, us.jsx)(et, { required: e.required, submitted: e.submitted || u, schema: e.schema.persistAsync.schema, errors: m || e.errors, model: null, infoMessage: null, onChange: F, onBlur: O });
|
|
2071
2071
|
};
|
|
2072
2072
|
ds.defaultProps = { required: false };
|
|
2073
2073
|
var No = ds;
|
|
2074
2074
|
var ti = (e) => {
|
|
2075
2075
|
let [t, r] = (0, fs.useState)(null), o = re(), a = (0, ys.useIntl)(), { schema: n } = e;
|
|
2076
2076
|
async function s(y) {
|
|
2077
|
-
let l = y instanceof Blob ? !
|
|
2078
|
-
return (
|
|
2077
|
+
let l = y instanceof Blob ? !st(n) : !$(y, n);
|
|
2078
|
+
return (E(y) || l) && b(), await u(y);
|
|
2079
2079
|
}
|
|
2080
2080
|
let m = () => {
|
|
2081
2081
|
t && t.abort();
|
|
@@ -2083,8 +2083,8 @@ var require_main_min = __commonJS({
|
|
|
2083
2083
|
return r(y), y.signal;
|
|
2084
2084
|
};
|
|
2085
2085
|
function d(y) {
|
|
2086
|
-
let l =
|
|
2087
|
-
return { method: e.method, headers: i({}, !l && { "Content-Type": "application/json" }), body:
|
|
2086
|
+
let l = st(n), p = m(), f = e.param, g = l ? Gd(f, y) : JSON.stringify({ [f]: y });
|
|
2087
|
+
return { method: e.method, headers: i({}, !l && { "Content-Type": "application/json" }), body: g, signal: p };
|
|
2088
2088
|
}
|
|
2089
2089
|
async function u(y) {
|
|
2090
2090
|
try {
|
|
@@ -2092,9 +2092,9 @@ var require_main_min = __commonJS({
|
|
|
2092
2092
|
if (!l.ok)
|
|
2093
2093
|
return c(l);
|
|
2094
2094
|
let p = await l.json();
|
|
2095
|
-
if (
|
|
2095
|
+
if (R(p)) {
|
|
2096
2096
|
let f = p[e.idProperty];
|
|
2097
|
-
if (L(f) ||
|
|
2097
|
+
if (L(f) || B(f))
|
|
2098
2098
|
return { data: f };
|
|
2099
2099
|
}
|
|
2100
2100
|
return b();
|
|
@@ -2105,7 +2105,7 @@ var require_main_min = __commonJS({
|
|
|
2105
2105
|
async function c(y) {
|
|
2106
2106
|
if (y.status === 422) {
|
|
2107
2107
|
let l = await y.json();
|
|
2108
|
-
if (
|
|
2108
|
+
if (R(l)) {
|
|
2109
2109
|
let p = ms(e.param, l);
|
|
2110
2110
|
if (L(p))
|
|
2111
2111
|
throw new Error(p);
|
|
@@ -2124,19 +2124,19 @@ var require_main_min = __commonJS({
|
|
|
2124
2124
|
return t !== null && r.append(e, t), r;
|
|
2125
2125
|
}
|
|
2126
2126
|
function _d(e) {
|
|
2127
|
-
return
|
|
2127
|
+
return R(e) && "message" in e && typeof e.message == "string";
|
|
2128
2128
|
}
|
|
2129
|
-
var
|
|
2129
|
+
var rt = require("react");
|
|
2130
2130
|
function Fr({ asyncFn: e, interval: t, maxAttempts: r, maxConsecutiveFails: o, onPollingResponse: a, onFailure: n }) {
|
|
2131
|
-
let s = (0,
|
|
2132
|
-
(0,
|
|
2131
|
+
let s = (0, rt.useRef)(a), m = (0, rt.useRef)(n), d = (0, rt.useMemo)(() => Wd(e, r, o, (u) => s.current(u), () => m.current()), [e, r, o]);
|
|
2132
|
+
(0, rt.useEffect)(() => {
|
|
2133
2133
|
if (t > 0) {
|
|
2134
2134
|
let u = setInterval(() => {
|
|
2135
2135
|
d();
|
|
2136
2136
|
}, t);
|
|
2137
2137
|
return () => clearInterval(u);
|
|
2138
2138
|
}
|
|
2139
|
-
}, [d, t]), (0,
|
|
2139
|
+
}, [d, t]), (0, rt.useEffect)(() => {
|
|
2140
2140
|
s.current = a, m.current = n;
|
|
2141
2141
|
}, [a, n]);
|
|
2142
2142
|
}
|
|
@@ -2211,7 +2211,7 @@ var require_main_min = __commonJS({
|
|
|
2211
2211
|
return t === "user" || t === void 0;
|
|
2212
2212
|
};
|
|
2213
2213
|
var Os = (e) => !!((e == null ? void 0 : e.label) || "").match(/camera2? 0/g);
|
|
2214
|
-
var
|
|
2214
|
+
var As = async (e) => {
|
|
2215
2215
|
let t = document.createElement("canvas");
|
|
2216
2216
|
if (e) {
|
|
2217
2217
|
t.setAttribute("height", `${e.videoHeight}`), t.setAttribute("width", `${e.videoWidth}`);
|
|
@@ -2220,7 +2220,7 @@ var require_main_min = __commonJS({
|
|
|
2220
2220
|
}
|
|
2221
2221
|
return t;
|
|
2222
2222
|
};
|
|
2223
|
-
var
|
|
2223
|
+
var vs = async () => {
|
|
2224
2224
|
var e, t;
|
|
2225
2225
|
return (await ((t = (e = navigator == null ? void 0 : navigator.mediaDevices) == null ? void 0 : e.enumerateDevices) == null ? void 0 : t.call(e)) || []).filter((r) => r.kind === "videoinput");
|
|
2226
2226
|
};
|
|
@@ -2248,16 +2248,16 @@ var require_main_min = __commonJS({
|
|
|
2248
2248
|
}, [e]);
|
|
2249
2249
|
let a = async (n) => {
|
|
2250
2250
|
if (n === "back") {
|
|
2251
|
-
let s = (await
|
|
2251
|
+
let s = (await vs()).find(Os);
|
|
2252
2252
|
if (s != null && s.deviceId)
|
|
2253
|
-
return
|
|
2253
|
+
return h(i({}, o), { deviceId: { exact: s.deviceId } });
|
|
2254
2254
|
}
|
|
2255
2255
|
return o;
|
|
2256
2256
|
};
|
|
2257
2257
|
return { videoConstraints: t };
|
|
2258
2258
|
};
|
|
2259
2259
|
var Wr = require("react");
|
|
2260
|
-
var
|
|
2260
|
+
var _ = require("react/jsx-runtime");
|
|
2261
2261
|
var Zd = 92;
|
|
2262
2262
|
var Es = 120;
|
|
2263
2263
|
var Xd = 40;
|
|
@@ -2277,14 +2277,14 @@ var require_main_min = __commonJS({
|
|
|
2277
2277
|
}, 100);
|
|
2278
2278
|
return window.addEventListener("resize", y), () => window.removeEventListener("resize", y);
|
|
2279
2279
|
});
|
|
2280
|
-
let m = (r ? Xd : 0) + (o ? Qd : 0) + (a ? eu : 0), d = (0,
|
|
2280
|
+
let m = (r ? Xd : 0) + (o ? Qd : 0) + (a ? eu : 0), d = (0, _.jsxs)(_.Fragment, { children: [r && (0, _.jsx)("img", { className: "camera-capture-img", src: r, alt: "" }), o && (0, _.jsx)("h4", { className: "camera-capture-title", children: o }), a && (0, _.jsx)("small", { className: "camera-capture-instructions", children: a })] }), u = Zd + m;
|
|
2281
2281
|
if (n) {
|
|
2282
|
-
m = u - Es, d = (0,
|
|
2282
|
+
m = u - Es, d = (0, _.jsx)("small", { className: "camera-capture-instructions", children: n });
|
|
2283
2283
|
let y = Es + tu;
|
|
2284
|
-
u < y && (d = (0,
|
|
2284
|
+
u < y && (d = (0, _.jsx)(_.Fragment, {}));
|
|
2285
2285
|
}
|
|
2286
2286
|
let c = { x: "50%", y: "5%", width: `min(90%, ${Is}px)`, height: `calc(90% - ${u}px)`, style: { transform: `translateX(max(-45%, -${Is / 2}px))` } }, b = { style: { left: "5%", top: `calc(100% - ${u}px - 5%)`, height: `calc(${m}px + 5%)`, width: "90%" } };
|
|
2287
|
-
return (0,
|
|
2287
|
+
return (0, _.jsxs)("svg", { ref: s, xmlns: "http://www.w3.org/2000/svg", children: [(0, _.jsx)("defs", { children: (0, _.jsxs)("mask", { id: "mask", children: [(0, _.jsx)("rect", { width: "100%", height: "100%", fill: "#fff" }), (0, _.jsx)("image", i({ href: e }, c))] }) }), e && (0, _.jsx)("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }), t && (0, _.jsx)("image", i({ href: t }, c)), (0, _.jsx)("foreignObject", { width: "100%", height: "100%", children: (0, _.jsx)("div", h(i({ className: "camera-capture-text-and-image-container" }, b), { children: d })) })] });
|
|
2288
2288
|
};
|
|
2289
2289
|
var aa = ru;
|
|
2290
2290
|
var Ls = require("@transferwise/components");
|
|
@@ -2300,10 +2300,10 @@ var require_main_min = __commonJS({
|
|
|
2300
2300
|
var Ns = require("react-intl");
|
|
2301
2301
|
var Bs = require("react-intl");
|
|
2302
2302
|
var ia = (0, Bs.defineMessages)({ title: { id: "dynamicFlows.CameraCapture.CameraNotSupported.title", defaultMessage: "Camera not supported", description: "Title of standalone page prompting that camera is not available on users browser" }, paragraph: { 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" } });
|
|
2303
|
-
var
|
|
2303
|
+
var ot = require("react/jsx-runtime");
|
|
2304
2304
|
var au = () => {
|
|
2305
2305
|
let e = (0, Ns.useIntl)();
|
|
2306
|
-
return (0,
|
|
2306
|
+
return (0, ot.jsx)("div", { id: "camera-not-supported", children: (0, ot.jsx)("div", { className: "container p-t-5", children: (0, ot.jsx)("div", { className: "row", children: (0, ot.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [(0, ot.jsx)("h2", { className: "text-xs-center m-b-3", children: e.formatMessage(ia.title) }), (0, ot.jsx)("p", { className: "text-xs-center m-b-5", children: e.formatMessage(ia.paragraph) })] }) }) }) });
|
|
2307
2307
|
};
|
|
2308
2308
|
var sa = au;
|
|
2309
2309
|
var Rs = (e) => e == null ? void 0 : e("Dynamic Flow - Camera Permission Denied", {});
|
|
@@ -2312,38 +2312,38 @@ var require_main_min = __commonJS({
|
|
|
2312
2312
|
var nu = async (e, t) => {
|
|
2313
2313
|
var n;
|
|
2314
2314
|
let r = Gr(t), o = oa(t), a = (n = r == null ? void 0 : r.getSettings) == null ? void 0 : n.call(r);
|
|
2315
|
-
return
|
|
2315
|
+
return h(i({}, r && { "Available Video Devices (by label)": await Ps(), "Active Video Device (by label)": await ks(t), "Camera Capabilities": o, "Camera Settings": a }), { "Camera Direction (Asked)": e == null ? void 0 : e.direction });
|
|
2316
2316
|
};
|
|
2317
2317
|
var Q = require("react/jsx-runtime");
|
|
2318
2318
|
var iu = ({ direction: e = "back", overlay: t = "", outline: r = "", imageUrl: o = "", title: a = "", instructions: n = "", showReview: s = false, onCapture: m, onEvent: d }) => {
|
|
2319
|
-
let [u, c] = (0, Ce.useState)("CAPTURE"), [b, y] = (0, Ce.useState)(false), [l, p] = (0, Ce.useState)(false), [f,
|
|
2320
|
-
var
|
|
2321
|
-
if ((
|
|
2319
|
+
let [u, c] = (0, Ce.useState)("CAPTURE"), [b, y] = (0, Ce.useState)(false), [l, p] = (0, Ce.useState)(false), [f, g] = (0, Ce.useState)(), S = (0, Ce.useRef)(null), { videoConstraints: O } = Ms(e), F = (0, zs.useIntl)(), C = (0, Ce.useCallback)(async () => {
|
|
2320
|
+
var v, T, M, ue, pe, le;
|
|
2321
|
+
if ((v = S == null ? void 0 : S.current) != null && v.video && ((M = (T = S == null ? void 0 : S.current) == null ? void 0 : T.video) == null ? void 0 : M.readyState) >= 3) {
|
|
2322
2322
|
(pe = (ue = S == null ? void 0 : S.current) == null ? void 0 : ue.video) == null || pe.pause();
|
|
2323
|
-
let Ve = await
|
|
2323
|
+
let Ve = await As((le = S == null ? void 0 : S.current) == null ? void 0 : le.video);
|
|
2324
2324
|
Ve == null || Ve.toBlob((He) => {
|
|
2325
2325
|
if (He)
|
|
2326
2326
|
if (s) {
|
|
2327
2327
|
let Nt = window.URL.createObjectURL(He);
|
|
2328
|
-
|
|
2328
|
+
g({ source: Nt, blob: He }), c("REVIEW");
|
|
2329
2329
|
} else
|
|
2330
2330
|
m(He);
|
|
2331
2331
|
}, "image/jpeg", 0.92);
|
|
2332
2332
|
}
|
|
2333
|
-
}, [S, s,
|
|
2334
|
-
if (
|
|
2333
|
+
}, [S, s, g, c, m, b]), A = (0, Ce.useCallback)((v) => {
|
|
2334
|
+
if (v instanceof DOMException && (v == null ? void 0 : v.name) === "NotAllowedError") {
|
|
2335
2335
|
c("NO_CAMERA_ACCESS"), Rs(d);
|
|
2336
2336
|
return;
|
|
2337
2337
|
}
|
|
2338
|
-
c("CAMERA_NOT_SUPPORTED"), js(d,
|
|
2339
|
-
}, [c, d]),
|
|
2340
|
-
p(true), y(xs(
|
|
2341
|
-
}, [y, d, e]),
|
|
2338
|
+
c("CAMERA_NOT_SUPPORTED"), js(d, v);
|
|
2339
|
+
}, [c, d]), w = (0, Ce.useCallback)((v) => {
|
|
2340
|
+
p(true), y(xs(v)), Us(d, { direction: e }, v);
|
|
2341
|
+
}, [y, d, e]), D = () => {
|
|
2342
2342
|
m((f == null ? void 0 : f.blob) || null);
|
|
2343
2343
|
}, k = () => {
|
|
2344
|
-
c("CAPTURE"),
|
|
2345
|
-
}, I = () => c("CAPTURE"),
|
|
2346
|
-
return (0, Q.jsxs)("section", { className: "camera-capture", children: [u === "CAPTURE" &&
|
|
2344
|
+
c("CAPTURE"), g(void 0);
|
|
2345
|
+
}, I = () => c("CAPTURE"), q = (0, Q.jsxs)(Q.Fragment, { children: [O && (0, Q.jsx)(Vs.default, { ref: S, audio: false, videoConstraints: O, mirrored: b, onUserMediaError: A, onUserMedia: w }), (0, Q.jsx)(aa, { overlay: t, outline: r, imageUrl: o, title: a, instructions: n }), l && (0, Q.jsx)(Fs, { onCapture: () => void C() })] }), ee = (0, Q.jsxs)(Q.Fragment, { children: [(0, Q.jsx)("img", { className: "review-image", src: f == null ? void 0 : f.source, alt: "" }), (0, Q.jsx)(aa, { overlay: t, imageUrl: o, title: a, instructions: n, reviewInstructions: F.formatMessage(or.reviewInstructions) }), (0, Q.jsx)(Cs, { onSubmit: D, onRetry: k })] });
|
|
2346
|
+
return (0, Q.jsxs)("section", { className: "camera-capture", children: [u === "CAPTURE" && q, u === "REVIEW" && ee, u === "NO_CAMERA_ACCESS" && (0, Q.jsx)(na, { onAction: I }), u === "CAMERA_NOT_SUPPORTED" && (0, Q.jsx)(sa, {})] });
|
|
2347
2347
|
};
|
|
2348
2348
|
var la = iu;
|
|
2349
2349
|
var qs = require("react/jsx-runtime");
|
|
@@ -2354,19 +2354,19 @@ var require_main_min = __commonJS({
|
|
|
2354
2354
|
});
|
|
2355
2355
|
}
|
|
2356
2356
|
var lu = (e) => {
|
|
2357
|
-
let { step: t, model: r, onModelChange: o, onAction: a } = e, n = Z(), s = Hs(t), m = cu(t), d = mu(t), { title: u, image: c, cameraConfig: b } = m, { assets: y, direction: l, instructions: p } = b || {}, { overlay: f, outline:
|
|
2357
|
+
let { step: t, model: r, onModelChange: o, onAction: a } = e, n = Z(), s = Hs(t), m = cu(t), d = mu(t), { title: u, image: c, cameraConfig: b } = m, { assets: y, direction: l, instructions: p } = b || {}, { overlay: f, outline: g } = y || {}, { url: S } = c || {}, [O, F] = (0, Yr.useState)(false);
|
|
2358
2358
|
(0, Yr.useEffect)(() => {
|
|
2359
2359
|
O && a(d);
|
|
2360
2360
|
}, [r]);
|
|
2361
|
-
let
|
|
2362
|
-
let { $id:
|
|
2361
|
+
let C = async (A) => {
|
|
2362
|
+
let { $id: w } = m;
|
|
2363
2363
|
if (A) {
|
|
2364
|
-
let
|
|
2365
|
-
|
|
2364
|
+
let D = await su(A), k = { [w || ""]: D };
|
|
2365
|
+
F(true), o({ model: k, formSchema: s, triggerModel: D, triggerSchema: m });
|
|
2366
2366
|
}
|
|
2367
2367
|
};
|
|
2368
|
-
return (0, qs.jsx)(la, { overlay: f, outline:
|
|
2369
|
-
|
|
2368
|
+
return (0, qs.jsx)(la, { overlay: f, outline: g, title: u, imageUrl: S, instructions: p, direction: l, onEvent: n, onCapture: (A) => {
|
|
2369
|
+
C(A);
|
|
2370
2370
|
} });
|
|
2371
2371
|
};
|
|
2372
2372
|
var Jr = lu;
|
|
@@ -2413,8 +2413,8 @@ var require_main_min = __commonJS({
|
|
|
2413
2413
|
var ze = require("react/jsx-runtime");
|
|
2414
2414
|
var Ks = (e) => {
|
|
2415
2415
|
var s;
|
|
2416
|
-
let { step: t, globalError: r } = e, o = (s = t == null ? void 0 : t.external) == null ? void 0 : s.url, { requiresManualTrigger: a, dismissConfirmation: n } =
|
|
2417
|
-
return t === void 0 ? null : o && a ? (0, ze.jsx)(Zr, { url: o, onClose: n }) : Cn(t) === "camera" ? (0, ze.jsx)(Jr,
|
|
2416
|
+
let { step: t, globalError: r } = e, o = (s = t == null ? void 0 : t.external) == null ? void 0 : s.url, { requiresManualTrigger: a, dismissConfirmation: n } = An(o);
|
|
2417
|
+
return t === void 0 ? null : o && a ? (0, ze.jsx)(Zr, { url: o, onClose: n }) : Cn(t) === "camera" ? (0, ze.jsx)(Jr, h(i({}, e), { step: t })) : (0, ze.jsxs)(ze.Fragment, { children: [r ? (0, ze.jsx)(ae, { component: { context: "negative", markdown: r, margin: "lg" } }) : null, (0, ze.jsx)($r, h(i({}, e), { stepSpecification: t }))] });
|
|
2418
2418
|
};
|
|
2419
2419
|
var Ys = require("react");
|
|
2420
2420
|
var pu = 1e3;
|
|
@@ -2436,18 +2436,18 @@ var require_main_min = __commonJS({
|
|
|
2436
2436
|
}
|
|
2437
2437
|
var Qs = (e) => {
|
|
2438
2438
|
var l, p;
|
|
2439
|
-
let [t, r] = (0, Lt.useState)((l = e == null ? void 0 : e.errors) == null ? void 0 : l.validation), [o, a] = (0, Lt.useState)((p = e == null ? void 0 : e.errors) == null ? void 0 : p.error), [n, s] = (0, Lt.useState)({ step: e || void 0, models: e != null && e.model ? Xs(e.model, ca(e)) : {}, etag: void 0 }), { step: m, models: d, etag: u } = n, c = (f,
|
|
2440
|
-
var S, O,
|
|
2441
|
-
s((A) => ({ step: f, models: f.model ? Xs(f.model, ca(f)) : A.models, etag:
|
|
2442
|
-
}, b = (f,
|
|
2439
|
+
let [t, r] = (0, Lt.useState)((l = e == null ? void 0 : e.errors) == null ? void 0 : l.validation), [o, a] = (0, Lt.useState)((p = e == null ? void 0 : e.errors) == null ? void 0 : p.error), [n, s] = (0, Lt.useState)({ step: e || void 0, models: e != null && e.model ? Xs(e.model, ca(e)) : {}, etag: void 0 }), { step: m, models: d, etag: u } = n, c = (f, g) => {
|
|
2440
|
+
var S, O, F, C;
|
|
2441
|
+
s((A) => ({ step: f, models: f.model ? Xs(f.model, ca(f)) : A.models, etag: g })), r((O = (S = f == null ? void 0 : f.errors) == null ? void 0 : S.validation) != null ? O : null), a((C = (F = f == null ? void 0 : f.errors) == null ? void 0 : F.error) != null ? C : null);
|
|
2442
|
+
}, b = (f, g, S) => {
|
|
2443
2443
|
s((O) => {
|
|
2444
|
-
let
|
|
2445
|
-
return S(
|
|
2444
|
+
let F = h(i({}, O.models), { [f]: g }), C = { step: O.step, models: F, etag: O.etag };
|
|
2445
|
+
return S(F), C;
|
|
2446
2446
|
});
|
|
2447
2447
|
}, y = (0, Lt.useMemo)(() => fu(d, ca(m)), [d, m]);
|
|
2448
2448
|
return { formErrors: t, globalError: o, step: m, models: d, etag: u, modelIsValid: y, setFormErrors: r, setGlobalError: a, setStepAndEtag: c, setSchemaModel: b };
|
|
2449
2449
|
};
|
|
2450
|
-
var Xs = (e, t = []) => t.reduce((r, o) => (o.$id || console.warn("Schema without $id property found."),
|
|
2450
|
+
var Xs = (e, t = []) => t.reduce((r, o) => (o.$id || console.warn("Schema without $id property found."), h(i({}, r), { [o.$id || ""]: oe(e, o) || {} })), {});
|
|
2451
2451
|
var ca = (e) => [...ma((e == null ? void 0 : e.layout) || []), ...(e == null ? void 0 : e.schemas) || []];
|
|
2452
2452
|
var ma = (e) => e.flatMap((t) => {
|
|
2453
2453
|
switch (t.type) {
|
|
@@ -2461,7 +2461,7 @@ var require_main_min = __commonJS({
|
|
|
2461
2461
|
return [];
|
|
2462
2462
|
}
|
|
2463
2463
|
});
|
|
2464
|
-
var fu = (e, t = []) => !(t != null && t.some((r) => (r.$id || console.warn("Schema without $id property found."),
|
|
2464
|
+
var fu = (e, t = []) => !(t != null && t.some((r) => (r.$id || console.warn("Schema without $id property found."), !$(e[r.$id || ""] || {}, r))));
|
|
2465
2465
|
var Xr = require("@transferwise/components");
|
|
2466
2466
|
var el = require("react");
|
|
2467
2467
|
var rl = require("react/jsx-runtime");
|
|
@@ -2508,13 +2508,13 @@ var require_main_min = __commonJS({
|
|
|
2508
2508
|
if (ha(e), (o = e.headers) != null && o.has("X-Df-Exit"))
|
|
2509
2509
|
return { type: "exit", result: await fa(e) };
|
|
2510
2510
|
let t = await ya(e);
|
|
2511
|
-
if (!
|
|
2511
|
+
if (!R(t))
|
|
2512
2512
|
throw new Error("Incorrect response body in response. Expected an object.");
|
|
2513
2513
|
if (t.action) {
|
|
2514
|
-
if (!
|
|
2514
|
+
if (!R(t.action))
|
|
2515
2515
|
throw new Error("Incorrect response body in action response. Expected an object satisfying the type { action: Action }.");
|
|
2516
2516
|
let a = t.action;
|
|
2517
|
-
return a.exit === true &&
|
|
2517
|
+
return a.exit === true && R(a.result) ? { type: "exit", result: a.result } : { type: "action", action: t.action };
|
|
2518
2518
|
}
|
|
2519
2519
|
let r = e.headers.get("etag") || void 0;
|
|
2520
2520
|
return { type: "step", step: t, etag: r };
|
|
@@ -2522,14 +2522,14 @@ var require_main_min = __commonJS({
|
|
|
2522
2522
|
var cl = async (e) => {
|
|
2523
2523
|
ha(e);
|
|
2524
2524
|
let t = await ya(e);
|
|
2525
|
-
if (!
|
|
2525
|
+
if (!R(t))
|
|
2526
2526
|
throw new Error("Incorrect response body in error response. Expected an object.");
|
|
2527
2527
|
return t;
|
|
2528
2528
|
};
|
|
2529
2529
|
var fa = async (e) => {
|
|
2530
2530
|
ha(e);
|
|
2531
2531
|
let t = await ya(e);
|
|
2532
|
-
return
|
|
2532
|
+
return R(t) || t === null ? t : null;
|
|
2533
2533
|
};
|
|
2534
2534
|
var ya = async (e) => {
|
|
2535
2535
|
try {
|
|
@@ -2545,56 +2545,56 @@ var require_main_min = __commonJS({
|
|
|
2545
2545
|
throw new Error("The body of the provided Response object has already been used. Every request must respond with a new Response object.");
|
|
2546
2546
|
};
|
|
2547
2547
|
var hu = (e) => typeof e == "object" && e !== null && "clone" in e && "bodyUsed" in e;
|
|
2548
|
-
var
|
|
2548
|
+
var at = require("react/jsx-runtime");
|
|
2549
2549
|
var ml = () => {
|
|
2550
2550
|
};
|
|
2551
2551
|
var gu = ({ flowId: e, httpClient: t, initialAction: r, initialStep: o, loaderConfig: a, displayStepTitle: n = true, onCompletion: s, onError: m, onEvent: d = ml, onLog: u = ml }) => {
|
|
2552
|
-
let { locale: c } = (0, ul.useIntl)(), { formErrors: b, globalError: y, step: l, models: p, etag: f, modelIsValid:
|
|
2553
|
-
var
|
|
2554
|
-
return i({ flowId: e, stepId: l == null ? void 0 : l.key }, (
|
|
2555
|
-
}, [e, l]),
|
|
2556
|
-
let { url:
|
|
2557
|
-
return t(
|
|
2558
|
-
}, [t, c]), pe = async (
|
|
2559
|
-
k(
|
|
2552
|
+
let { locale: c } = (0, ul.useIntl)(), { formErrors: b, globalError: y, step: l, models: p, etag: f, modelIsValid: g, setFormErrors: S, setGlobalError: O, setStepAndEtag: F, setSchemaModel: C } = Qs(o), [A, w] = (0, xe.useState)(false), { loadingState: D, setLoadingState: k, loader: I } = tl(a, o ? "idle" : "initial"), q = Ee("warning", u, e, l == null ? void 0 : l.key), ee = Ee("error", u, e, l == null ? void 0 : l.key), v = Ee("critical", u, e, l == null ? void 0 : l.key), T = (0, xe.useMemo)(() => {
|
|
2553
|
+
var x;
|
|
2554
|
+
return i({ flowId: e, stepId: l == null ? void 0 : l.key }, (x = l == null ? void 0 : l.analytics) != null ? x : {});
|
|
2555
|
+
}, [e, l]), M = (0, xe.useMemo)(() => so(d, T), [d, T]), ue = (0, xe.useCallback)(({ action: x, data: U, etag: P }) => {
|
|
2556
|
+
let { url: W, method: Oe = "POST" } = x;
|
|
2557
|
+
return t(W != null ? W : "", { method: Oe, headers: i({ "accept-language": c, "Content-Type": "application/json" }, P ? { "If-None-Match": P } : {}), credentials: "include", body: Oe === "GET" ? void 0 : JSON.stringify(U) });
|
|
2558
|
+
}, [t, c]), pe = async (x, U = {}) => {
|
|
2559
|
+
k(D === "initial" ? "initial" : "submission");
|
|
2560
2560
|
try {
|
|
2561
|
-
|
|
2562
|
-
let P = await ue({ action:
|
|
2561
|
+
M("Dynamic Flow - Step Submitted", { actionId: x.$id });
|
|
2562
|
+
let P = await ue({ action: x, data: U });
|
|
2563
2563
|
return Oa(P, "submission");
|
|
2564
2564
|
} catch (P) {
|
|
2565
2565
|
nr(P, "Error fetching next step");
|
|
2566
2566
|
}
|
|
2567
|
-
}, le = async (
|
|
2567
|
+
}, le = async (x, U, P) => {
|
|
2568
2568
|
k("refresh");
|
|
2569
2569
|
try {
|
|
2570
|
-
|
|
2571
|
-
let
|
|
2572
|
-
await Oa(
|
|
2573
|
-
} catch (
|
|
2574
|
-
nr(
|
|
2570
|
+
M("Dynamic Flow - Step Refreshed", { status: "pending" });
|
|
2571
|
+
let W = await ue({ action: x, data: U, etag: P });
|
|
2572
|
+
await Oa(W, "refresh"), k("idle");
|
|
2573
|
+
} catch (W) {
|
|
2574
|
+
nr(W, "Error fetching refresh step");
|
|
2575
2575
|
}
|
|
2576
|
-
}, Ve = async (
|
|
2576
|
+
}, Ve = async (x, U) => {
|
|
2577
2577
|
try {
|
|
2578
|
-
let P = await ue({ action:
|
|
2579
|
-
Nt(i(i({},
|
|
2578
|
+
let P = await ue({ action: x, data: U }), W = await fa(P);
|
|
2579
|
+
Nt(i(i({}, W), x.result));
|
|
2580
2580
|
} catch (P) {
|
|
2581
2581
|
nr(P, "Error fetching exit result");
|
|
2582
2582
|
}
|
|
2583
|
-
}, He = Js(le), Nt = (0, xe.useCallback)((
|
|
2584
|
-
|
|
2585
|
-
}, [s,
|
|
2583
|
+
}, He = Js(le), Nt = (0, xe.useCallback)((x) => {
|
|
2584
|
+
M("Dynamic Flow - Flow Finished", { result: "success" }), s(x);
|
|
2585
|
+
}, [s, M]);
|
|
2586
2586
|
(0, xe.useEffect)(() => {
|
|
2587
|
-
|
|
2587
|
+
M("Dynamic Flow - Flow Started", {});
|
|
2588
2588
|
}, []), (0, xe.useEffect)(() => {
|
|
2589
2589
|
if (!o) {
|
|
2590
|
-
let
|
|
2591
|
-
pe(
|
|
2590
|
+
let x = i({ $id: "#initial-step-request", method: "GET" }, r);
|
|
2591
|
+
pe(x, x.data);
|
|
2592
2592
|
}
|
|
2593
2593
|
}, [t, c, JSON.stringify(o), JSON.stringify(r)]);
|
|
2594
|
-
let Oa = async (
|
|
2595
|
-
if (
|
|
2594
|
+
let Oa = async (x, U) => {
|
|
2595
|
+
if (x.ok)
|
|
2596
2596
|
try {
|
|
2597
|
-
let P = await ll(
|
|
2597
|
+
let P = await ll(x);
|
|
2598
2598
|
switch (P.type) {
|
|
2599
2599
|
case "action":
|
|
2600
2600
|
pe(P.action, P.action.data);
|
|
@@ -2603,82 +2603,82 @@ var require_main_min = __commonJS({
|
|
|
2603
2603
|
return Nt(P.result);
|
|
2604
2604
|
case "step":
|
|
2605
2605
|
default: {
|
|
2606
|
-
let { step:
|
|
2607
|
-
return
|
|
2606
|
+
let { step: W, etag: Oe } = P;
|
|
2607
|
+
return U === "submission" ? uc(W, Oe) : pc(W, Oe);
|
|
2608
2608
|
}
|
|
2609
2609
|
}
|
|
2610
2610
|
} catch (P) {
|
|
2611
2611
|
return nr(P, "Error parsing fetch response");
|
|
2612
2612
|
}
|
|
2613
|
-
return fc(
|
|
2614
|
-
}, uc = (
|
|
2615
|
-
|
|
2616
|
-
}, pc = (
|
|
2617
|
-
|
|
2618
|
-
}, fc = async (
|
|
2619
|
-
if (
|
|
2613
|
+
return fc(x, U);
|
|
2614
|
+
}, uc = (x, U) => {
|
|
2615
|
+
F(x, U), w(false), k("idle"), M("Dynamic Flow - Step Started", i({ stepId: x.key }, x == null ? void 0 : x.analytics));
|
|
2616
|
+
}, pc = (x, U) => {
|
|
2617
|
+
F(x, U), k("idle"), M("Dynamic Flow - Step Refreshed", { status: "success" });
|
|
2618
|
+
}, fc = async (x, U) => {
|
|
2619
|
+
if (x.status === 304) {
|
|
2620
2620
|
k("idle");
|
|
2621
2621
|
return;
|
|
2622
2622
|
}
|
|
2623
2623
|
try {
|
|
2624
|
-
let P = await cl(
|
|
2624
|
+
let P = await cl(x);
|
|
2625
2625
|
if (P.refreshFormUrl) {
|
|
2626
|
-
let
|
|
2627
|
-
await le(
|
|
2626
|
+
let W = { url: P == null ? void 0 : P.refreshFormUrl, method: "POST" };
|
|
2627
|
+
await le(W, eo(p), f);
|
|
2628
2628
|
}
|
|
2629
2629
|
if (P.validation && S(P.validation), P.error && O(P.error), !P.refreshFormUrl && !P.validation && !P.error)
|
|
2630
2630
|
throw ee("Invalid response", "Response body must contain at least one of the following properties: refreshFormUrl, validation, or error."), P;
|
|
2631
2631
|
} catch (P) {
|
|
2632
|
-
|
|
2632
|
+
U === "refresh" && M("Dynamic Flow - Step Refreshed", { status: "failure" }), M("Dynamic Flow - Flow Finished", { status: "failure" }), m(P, x.status), ee("Invalid response", "Error response body must be an object.");
|
|
2633
2633
|
}
|
|
2634
2634
|
k("idle");
|
|
2635
|
-
}, nr = (
|
|
2636
|
-
|
|
2637
|
-
}, yc = (
|
|
2638
|
-
let { model:
|
|
2639
|
-
O(null), J(
|
|
2640
|
-
hc(
|
|
2635
|
+
}, nr = (x, U) => {
|
|
2636
|
+
v("Error fetching", U), m(x), k("idle");
|
|
2637
|
+
}, yc = (x) => {
|
|
2638
|
+
let { model: U, formSchema: P } = x, { $id: W = "" } = P;
|
|
2639
|
+
O(null), J(U) || v("Invalid model on change", "onModelChange was called but the model argument is not an object"), C(W, U, (to) => {
|
|
2640
|
+
hc(x, to);
|
|
2641
2641
|
});
|
|
2642
|
-
}, hc = (
|
|
2643
|
-
let { triggerSchema: P } =
|
|
2644
|
-
if (Su(
|
|
2642
|
+
}, hc = (x, U) => {
|
|
2643
|
+
let { triggerSchema: P } = x;
|
|
2644
|
+
if (Su(x)) {
|
|
2645
2645
|
let Oe = { url: P.refreshFormUrl || (l == null ? void 0 : l.refreshFormUrl), method: "POST" };
|
|
2646
|
-
He(Oe, eo(
|
|
2646
|
+
He(Oe, eo(U), f, P);
|
|
2647
2647
|
}
|
|
2648
|
-
}, gc = async (
|
|
2649
|
-
let { data:
|
|
2650
|
-
if (
|
|
2651
|
-
|
|
2648
|
+
}, gc = async (x) => {
|
|
2649
|
+
let { data: U, method: P, exit: W, url: Oe, result: to } = x, ir = i(i({}, eo(p)), U), Aa = { url: x.url, method: x.method, currency: ir.currency, type: ir.type };
|
|
2650
|
+
if (D !== "idle" || x.disabled) {
|
|
2651
|
+
q("Action supressed", D !== "idle" ? `onAction was supressed because loadingState is ${D}` : "onAction was supressed because action is disabled", Aa);
|
|
2652
2652
|
return;
|
|
2653
2653
|
}
|
|
2654
|
-
if (
|
|
2654
|
+
if (W) {
|
|
2655
2655
|
if (Oe) {
|
|
2656
|
-
dl(P) ? (S(null),
|
|
2656
|
+
dl(P) ? (S(null), w(true), g && await Ve(x, ir)) : await Ve(x);
|
|
2657
2657
|
return;
|
|
2658
2658
|
}
|
|
2659
2659
|
Nt(to);
|
|
2660
2660
|
return;
|
|
2661
2661
|
}
|
|
2662
2662
|
if (dl(P)) {
|
|
2663
|
-
S(null),
|
|
2663
|
+
S(null), w(true), g ? pe(x, ir) : M("Dynamic Flow - onAction supressed", i({ reason: "invalid model" }, Aa));
|
|
2664
2664
|
return;
|
|
2665
2665
|
}
|
|
2666
|
-
pe(
|
|
2666
|
+
pe(x);
|
|
2667
2667
|
};
|
|
2668
|
-
return (0,
|
|
2669
|
-
gc(
|
|
2668
|
+
return (0, at.jsx)(gr, { flowId: e, stepId: l == null ? void 0 : l.key, onLog: u, children: (0, at.jsx)(mr, { metadata: T, onEvent: d, children: (0, at.jsx)(Na, { loading: D !== "idle", children: (0, at.jsx)(Va, { httpClient: t, children: I !== null ? I : (0, at.jsx)(Ks, { step: l, model: eo(p), submitted: A, globalError: y, formErrors: b, stepLayoutOptions: { displayStepTitle: n }, onAction: (x) => {
|
|
2669
|
+
gc(x);
|
|
2670
2670
|
}, onModelChange: yc }) }) }) }) });
|
|
2671
2671
|
};
|
|
2672
|
-
var bu = (e) => (0,
|
|
2672
|
+
var bu = (e) => (0, at.jsx)(pa, { onError: e.onError, children: (0, at.jsx)(gu, i({}, e)) });
|
|
2673
2673
|
var ga = bu;
|
|
2674
2674
|
var eo = (e) => Object.values(e).reduce((t, r) => i(i({}, t), r), {});
|
|
2675
2675
|
var dl = (e = "POST") => ["POST", "PUT", "PATCH"].includes(e.toUpperCase());
|
|
2676
2676
|
var Su = (e) => {
|
|
2677
|
-
let { type: t, triggerSchema: r, triggerModel: o, lastTriggerModel: a = null } = e, n = () =>
|
|
2677
|
+
let { type: t, triggerSchema: r, triggerModel: o, lastTriggerModel: a = null } = e, n = () => $(o, r), s = () => $(a, r);
|
|
2678
2678
|
return t !== "init" && (r == null ? void 0 : r.refreshFormOnChange) && (n() || s());
|
|
2679
2679
|
};
|
|
2680
2680
|
var ba = {};
|
|
2681
|
-
|
|
2681
|
+
nt(ba, { alert: () => pl, box: () => fl, button: () => yl, columns: () => hl, copyable: () => gl, decision: () => bl, heading: () => Sl, image: () => wl, info: () => Fl, list: () => Cl, loadingIndicator: () => xl, paragraph: () => Ol, review: () => Al });
|
|
2682
2682
|
var wu = { type: "form", key: "Components/Alert", title: "Alert Component", description: "Alerts can have different contexts.", actions: [], schemas: [], layout: [{ type: "alert", markdown: 'This is an alert with "neutral" context. A subset of Markdown features are supported, like **bold text**, and __italic__ I think. But no line breaks nor links.', context: "neutral" }, { type: "alert", markdown: 'This is an alert with "warning" context. A subset of Markdown features are supported, like **bold text**, and __italic__ I think. But no line breaks nor links.', context: "warning" }, { type: "alert", markdown: 'This is an alert with "positive" context. A subset of Markdown features are supported, like **bold text**, and __italic__ I think. But no line breaks nor links.', context: "positive" }, { type: "alert", markdown: 'This is an alert with "negative" context. A subset of Markdown features are supported, like **bold text**, and __italic__ I think. But no line breaks nor links.', context: "negative" }] };
|
|
2683
2683
|
var pl = wu;
|
|
2684
2684
|
var Fu = { type: "form", key: "Components/Box", title: "Box Component", description: "Box is a container for other layour components. It can have a border!", actions: [], schemas: [], layout: ["xs", "sm", "md", "lg", "xl"].map((e) => ({ type: "box", width: e, border: true, components: [{ type: "paragraph", text: `This paragraph is inside a box with border: "true" and width: "${e}".` }] })) };
|
|
@@ -2688,10 +2688,10 @@ var require_main_min = __commonJS({
|
|
|
2688
2688
|
var yl = xu;
|
|
2689
2689
|
var Ou = { type: "form", key: "Components/Columns", title: "Columns Component", description: "Arrange components in two columns (when there's enough space)", actions: [], schemas: [], layout: [{ type: "columns", left: [{ type: "button", action: { title: "Save", type: "primary", exit: true, result: { side: "left" } } }], right: [{ type: "button", action: { title: "Delete", type: "negative", exit: true, result: { side: "right" } } }] }] };
|
|
2690
2690
|
var hl = Ou;
|
|
2691
|
-
var
|
|
2692
|
-
var gl =
|
|
2693
|
-
var
|
|
2694
|
-
var bl =
|
|
2691
|
+
var Au = { key: "Components/Copyable", type: "form", title: "Copyable Text", description: "Copyable Text Component.", actions: [], layout: [{ type: "paragraph", align: "center", text: "Please copy the code below and use it in that other thing." }, { type: "paragraph", text: "7Xtiq6fnX9aEVF7yZAmb2qyqS857ro8S", align: "center", control: "copyable" }], schemas: [] };
|
|
2692
|
+
var gl = Au;
|
|
2693
|
+
var vu = { type: "form", key: "Components/Decision", title: "Decision Component", description: "A step with a decision Component.", actions: [], schemas: [], layout: [{ type: "heading", size: "sm", text: "Please continue using one of the following options:" }, { type: "decision", options: [{ title: "Create a new recipient", description: "You will need their bank details to hand", icon: { name: "plus" }, action: { title: "", url: "recipient" } }, { title: "Choose an existing recipient", disabled: false, icon: { name: "bank" }, action: { title: "", url: "review" } }, { title: "Show me the external step", disabled: false, icon: { name: "bulb" }, action: { title: "", url: "external" } }] }] };
|
|
2694
|
+
var bl = vu;
|
|
2695
2695
|
var Pu = { type: "form", key: "Components/Heading", title: "Heading Component", description: 'Headings can have different sizes: "xs", "sm", "md", "lg", "xl".', actions: [], schemas: [], layout: ["xs", "sm", "md", "lg", "xl"].map((e) => ({ type: "heading", text: `This is heading with size: "${e}"`, size: e })) };
|
|
2696
2696
|
var Sl = Pu;
|
|
2697
2697
|
var ku = ["xs", "sm", "md", "lg", "xl"];
|
|
@@ -2722,11 +2722,11 @@ But the best part? Bananas are biodegradable and environmentally-friendly, makin
|
|
|
2722
2722
|
var Lu = { type: "form", key: "Components/Paragraph", title: "Paragraph Component", description: "A block of plain text.", actions: [], schemas: [], layout: [{ type: "paragraph", text: "Well, if you're really bent on using fruit for data backup, bananas might just be the perfect choice. For starters, they're portable and can fit in any backpack or briefcase. So, you can take your backup with you wherever you go." }, { type: "paragraph", text: "And who needs passwords when you have bananas? With each backup, you can create a unique banana code by peeling the skin in a particular pattern, thus ensuring the safety of your data." }, { type: "paragraph", text: "But the best part? Bananas are biodegradable and environmentally-friendly, making them the ideal choice for anyone concerned about the planet. When you're done with your backup, you can simply toss the bananas in the compost bin or plant them in your garden. Who knew data backup could be so good for the earth?" }, { type: "alert", markdown: "Paragraph is a block of plain text content. If you need richer formatting and layout options, consider using Info Layout.", context: "neutral" }] };
|
|
2723
2723
|
var Ol = Lu;
|
|
2724
2724
|
var Tu = { type: "form", key: "Components/Review", title: "Review Component", description: "Show a list of read-only fields.", actions: [], schemas: [], layout: [{ type: "box", border: true, components: [{ type: "review", title: "Please check your details (vertical orientation)", orientation: "vertical", fields: [{ label: "name", value: "Bob Loblaw" }, { label: "email", value: "bob.loblaw@law.blog" }, { label: "address", value: "123 Fake St, New York, NY 10001" }] }] }, { type: "box", border: true, components: [{ type: "review", title: "Please check your details (horizontal orientation)", orientation: "horizontal", fields: [{ label: "name", value: "Bob Loblaw" }, { label: "email", value: "bob.loblaw@law.blog" }, { label: "address", value: "123 Fake St, New York, NY 10001" }] }] }, { type: "box", border: true, components: [{ type: "review", title: "The action property is only supported on web", orientation: "horizontal", action: { title: "Edit", url: "/edit" }, fields: [{ label: "name", value: "Bob Loblaw" }, { label: "email", value: "bob.loblaw@law.blog" }, { label: "address", value: "123 Fake St, New York, NY 10001" }] }] }] };
|
|
2725
|
-
var
|
|
2725
|
+
var Al = Tu;
|
|
2726
2726
|
var Sa = {};
|
|
2727
|
-
|
|
2727
|
+
nt(Sa, { cameraCapture: () => vl, recipient: () => Pl, recipientUpdate: () => kl, singleFileUpload: () => Ml, stepValidationErrors: () => El });
|
|
2728
2728
|
var Bu = { key: "Examples/Camera Capture", title: "Camera Capture Example", type: "form", schemas: [{ properties: { frontSideFile: { refreshFormOnChange: false, format: "base64url", $id: "frontSideFile", title: "Passport photo page", hidden: false, cameraConfig: { assets: { overlay: "https://wise.com/public-resources/assets/camera-guidelines/v2/overlay_passport.png", outline: "https://wise.com/public-resources/assets/camera-guidelines/v2/outline_passport.png" }, direction: "back" }, source: "camera", type: "string" } }, required: ["frontSideFile"], displayOrder: ["frontSideFile"], $id: "ee2501a9-2566-459b-a42e-f9f0932be0e6", type: "object" }, { properties: { type: { refreshFormOnChange: false, $id: "9200f887-bfdd-46ad-8386-e76f455a7cc8", const: "ID_DOCUMENT_WITH_LIVENESS", hidden: true, type: "string" } }, required: ["type"], displayOrder: ["type"], $id: "c59a2881-a2e0-4108-b42e-0d30fc95bd7f", type: "object" }, { properties: { profileId: { refreshFormOnChange: false, $id: "75d888dc-208a-4d7d-a2a7-aeca0dd1b533", const: 14551053, hidden: true, type: "integer" } }, required: ["profileId"], displayOrder: ["profileId"], $id: "3eec6add-2d0e-41d7-8317-49542c841484", type: "object" }, { properties: { sessionId: { refreshFormOnChange: false, $id: "df82adf3-8a66-46b5-bef8-72f59be2188d", const: "62dfe7d026c6da1ac0db1ee4", hidden: true, type: "string" } }, required: ["sessionId"], displayOrder: ["sessionId"], $id: "e1a8fb67-9af2-47e8-97c1-f2a88e5d5f3a", type: "object" }], actions: [{ url: "/v3/kyc-checks/87785/flow?actionId=SINGLE_PAGE_REVIEW&sessionId=62dfe7d026c6da1ac0db1ee4&", type: "primary", method: "POST", disabled: false, $id: "6789eac5-7bbe-49d8-9da8-6edb8e7ef165", title: "" }], layout: [{ type: "form", schema: { $ref: "ee2501a9-2566-459b-a42e-f9f0932be0e6" } }, { components: [{ action: { $ref: "6789eac5-7bbe-49d8-9da8-6edb8e7ef165" }, margin: "lg", size: "md", type: "button" }], border: false, width: "xl", type: "box" }], model: { profileId: 14551053, sessionId: "62dfe7d026c6da1ac0db1ee4", issuingCountry: "HU", documentType: "PASSPORT", type: "ID_DOCUMENT_WITH_LIVENESS", key: { value: "ID_DOCUMENT_WITH_LIVENESS14551053" } }, refreshFormUrl: "/" };
|
|
2729
|
-
var
|
|
2729
|
+
var vl = Bu;
|
|
2730
2730
|
var Nu = { key: "Examples/Recipient Creation", type: "form", title: "Recipient Creation Example", description: "A form step with the typical recipient creation form.", actions: [], schemas: [{ $id: "#new-recipient", allOf: [{ type: "object", displayOrder: ["profileId", "currency", "legalEntityType", "email"], properties: { profileId: { type: "number", hidden: true, const: 123456789 }, currency: { title: "Currency", type: "string", analyticsId: "currency", oneOf: [{ title: "EUR", analyticsId: "currency-eur", icon: { name: "flag-eur" }, description: "Euro", const: "EUR" }, { title: "GBP", analyticsId: "currency-gbp", icon: { name: "flag-gbp" }, description: "British pound", const: "GBP" }, { title: "INR", analyticsId: "currency-inr", icon: { name: "flag-inr" }, description: "Indian rupee", const: "INR" }, { title: "USD", analyticsId: "currency-usd", icon: { name: "flag-usd" }, description: "United States dollar", const: "USD" }], validationMessages: { required: "Please enter currency." }, default: "EUR", refreshFormOnChange: true }, legalEntityType: { title: "Select recipient type", type: "string", analyticsId: "legalEntityType", oneOf: [{ title: "Person", analyticsId: "legalEntityType-person", const: "PERSON" }, { title: "Business", analyticsId: "legalEntityType-business", const: "INSTITUTION" }], validationMessages: { required: "Please specify the type of recipient." }, refreshFormOnChange: true }, email: { title: "Their email", type: "string", analyticsId: "email", placeholder: "example@example.ex", validationMessages: { maxLength: "The email you have entered is too long.", pattern: "The email address is invalid." }, refreshFormOnChange: true, autofillProvider: "contact", autofillKey: "contact.email", refreshFormUrl: "/steps/recipient", pattern: "\\s*[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+\\s*", maxLength: 255 } }, required: ["currency", "legalEntityType"] }, { title: "Bank details", analyticsId: "bank-details", oneOf: [{ title: "Inside Europe", analyticsId: "bank-details-europe", type: "object", displayOrder: ["name", "ownedByCustomer", "details", "type"], properties: { name: { type: "object", displayOrder: ["fullName"], properties: { fullName: { title: "Full name of the account holder", type: "string", validationMessages: { minLength: "Name needs to be between 2 and 140 characters long.", maxLength: "Recipient name cannot be longer than 140 characters.", pattern: "This recipient name contains invalid characters. Please use latin characters only.", required: "Name cannot be empty." }, autofillProvider: "contact", autofillKey: "contact.fullName", pattern: `^[0-9A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\xFF-_()'*,.%#^@&{}~<>+$"\\[\\]\\\\ ]+$`, minLength: 2, maxLength: 140 } }, required: ["fullName"] }, ownedByCustomer: { title: "My own Account", type: "boolean", hidden: true, const: false }, details: { type: "object", displayOrder: ["bic", "iban"], properties: { bic: { title: "Bank code (BIC/SWIFT)", type: "string", placeholder: "BARCGB22XXX", hidden: true, validationMessages: { minLength: "The BIC you have entered is too short.", maxLength: "The BIC you have entered is too long.", pattern: "Please specify a valid BIC." }, pattern: "^[A-Za-z]{6}[A-Za-z\\d]{2}([A-Za-z\\d]{3})?$", minLength: 8, maxLength: 11 }, iban: { title: "IBAN", type: "string", placeholder: "DE12345678901234567890", displayFormat: "**** **** **** **** **** **** **** ****", help: { markdown: "IBANs are long account numbers used by banks for cross-border transfers. Each country structures this number differently, but it always starts with a 2 digit country code (e.g. DE for Germany)." }, validationMessages: { minLength: "The IBAN you have entered is too short.", maxLength: "The IBAN you have entered is too long.", pattern: "Please specify a valid IBAN.", required: "Please specify an IBAN." }, refreshFormOnChange: true, pattern: "^[a-zA-Z]{2}[a-zA-Z0-9 ]{12,40}$", minLength: 14, maxLength: 42 } }, required: ["iban"] }, type: { title: "Type", type: "string", hidden: true, const: "Iban" } }, required: ["type", "name", "details"], icon: { name: "bank" } }, { title: "Outside Europe", analyticsId: "bank-details-outside-europe", type: "object", displayOrder: ["name", "ownedByCustomer", "details", "type"], properties: { name: { type: "object", displayOrder: ["fullName"], properties: { fullName: { title: "Full name of the account holder", type: "string", validationMessages: { minLength: "Name needs to be between 2 and 140 characters long.", maxLength: "Recipient name cannot be longer than 140 characters.", pattern: "This recipient name contains invalid characters. Please use latin characters only.", required: "Name cannot be empty." }, autofillProvider: "contact", autofillKey: "contact.fullName", pattern: `^[0-9A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\xFF-_()'*,.%#^@&{}~<>+$"\\[\\]\\\\ ]+$`, minLength: 2, maxLength: 140 } }, required: ["fullName"] }, ownedByCustomer: { title: "My own Account", type: "boolean", hidden: true, const: false }, details: { type: "object", displayOrder: ["bic", "accountNumber"], properties: { bic: { title: "SWIFT / BIC code", type: "string", placeholder: "BUKBGB22", validationMessages: { minLength: "The BIC you have entered is too short.", maxLength: "The BIC you have entered is too long.", pattern: "Please specify a valid BIC.", required: "Please specify a BIC." }, pattern: "^[a-zA-Z]{6}(([a-zA-Z0-9]{2})|([a-zA-Z0-9]{5}))$", minLength: 8, maxLength: 11 }, accountNumber: { title: "IBAN / Account Number", type: "string", placeholder: "123456789012", validationMessages: { minLength: "Account number is too short.", maxLength: "Account number is too large.", pattern: "Please enter a valid account number.", required: "Please enter an IBAN or account number." }, pattern: "^[a-zA-Z0-9]{4,34}$", minLength: 4, maxLength: 34 } }, required: ["bic", "accountNumber"] }, type: { title: "Type", type: "string", hidden: true, const: "SwiftCode" } }, required: ["type", "name", "details"], icon: { name: "bank" }, alert: { context: "warning", markdown: "To send EUR to this account, we need to use the SWIFT network. It\u2019s slower, so the transfer might take a day or two longer. Also note that intermediary banks and your recipient\u2019s bank might charge extra fees to the amount received." } }], control: "tab", placeholder: "Please select where you are sending to..." }] }], refreshFormUrl: "/steps/recipient", layout: [{ type: "form", schema: { $ref: "#new-recipient" } }, { type: "button", action: { type: "primary", title: "Confirm", url: "/v2/accounts", method: "POST" } }], model: { ownedByCustomer: false, details: {} } };
|
|
2731
2731
|
var Pl = Nu;
|
|
2732
2732
|
var Ru = { key: "Examples/Recipient Update", type: "form", title: "Edit recipient", actions: [{ title: "Update", url: "/responses/recipientUpdate/?delay=5000", type: "primary", method: "PATCH", $id: "submit" }], schemas: [{ $id: "form", allOf: [{ type: "object", displayOrder: ["currency"], properties: { currency: { title: "Currency", type: "string", analyticsId: "currency-select", oneOf: [{ title: "GBP", analyticsId: "GBP", icon: { name: "flag-gbp" }, description: "British pound", const: "GBP" }], readOnly: true } }, required: [] }, { title: "Bank details", type: "object", analyticsId: "SortCode", icon: { name: "bank" }, displayOrder: ["name", "details", "address"], properties: { name: { type: "object", displayOrder: ["fullName"], properties: { fullName: { title: "Full name of the account holder", type: "string", disabled: true, readOnly: true, validationMessages: { minLength: "Name needs to be between 2 and 140 characters long.", maxLength: "Recipient name cannot be longer than 140 characters.", pattern: "This recipient name may contain invalid characters or is not the full name. Please try again." }, autofillProvider: "contact", autofillKey: "contact.fullName", pattern: "^[0-9A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\xFF-_()'*,.]+ +[0-9A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\xFF-_()'*,.]+([0-9A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\xFF-_()'*,. ]*)$", minLength: 2, maxLength: 140 } }, required: [] }, details: { type: "object", displayOrder: ["sortCode", "accountNumber"], properties: { sortCode: { title: "UK sort code", type: "string", placeholder: "40-30-20", disabled: true, readOnly: true, validationMessages: { pattern: "Please enter a valid bank code." }, pattern: "^\\d{2}-?\\d{2}-?\\d{2}$", minLength: 6, maxLength: 8, format: "numeric", displayFormat: "**-**-**" }, accountNumber: { title: "Account number", type: "string", placeholder: "12345678", disabled: true, readOnly: true, validationMessages: { minLength: "Account number is too short.", maxLength: "Account number is too large.", pattern: "Please enter a valid account number." }, pattern: "[0-9]{8}", minLength: 8, maxLength: 8, format: "numeric" } }, required: [] }, address: { title: "Recipient address", type: "object", displayOrder: ["country", "city", "firstLine", "postCode"], properties: { country: { title: "Country", type: "string", placeholder: "Choose a country", oneOf: [{ title: "Argentina", const: "AR" }, { title: "Brazil", const: "BR" }, { title: "Canada", const: "CA" }, { title: "Denmark", const: "DK" }, { title: "Egypt", const: "EG" }, { title: "France", const: "FR" }, { title: "Germany", const: "DE" }, { title: "Honduras", const: "HN" }, { title: "Italy", const: "IT" }, { title: "Japan", const: "JP" }, { title: "Korea, Republic of", const: "KR" }, { title: "Liberia", const: "LR" }, { title: "Morocco", const: "MA" }, { title: "New Zealand", const: "NZ" }, { title: "Oman", const: "OM" }, { title: "Peru", const: "PE" }, { title: "Qatar", const: "QA" }, { title: "Russian Federation", const: "RU" }, { title: "Spain", const: "ES" }, { title: "Turkey", const: "TR" }, { title: "United Kingdom of Great Britain and Northern Ireland", const: "GB" }, { title: "United States of America", const: "US" }, { title: "Viet Nam", const: "VN" }, { title: "Yemen", const: "YE" }, { title: "Zimbabwe", const: "ZW" }], validationMessages: { required: "Please select a country." }, autofillProvider: "contact", autofillKey: "contact.countryCode" }, city: { title: "City", type: "string", autofillProvider: "contact", autofillKey: "contact.city", pattern: "^.{1,255}$", minLength: 1, maxLength: 255 }, firstLine: { title: "Recipient address", type: "string", autofillProvider: "contact", autofillKey: "contact.firstLine", pattern: "^.{1,255}$", minLength: 1, maxLength: 255 }, postCode: { title: "Post code", type: "string", validationMessages: { pattern: "Please specify a valid post code.", required: "Please specify the recipient's post code." }, autofillProvider: "contact", autofillKey: "contact.postalCode", pattern: "^.{1,32}$", minLength: 1, maxLength: 32 } }, required: ["country", "city", "firstLine", "postCode"], help: { markdown: "For legal reasons, we need to ask for the recipient's address (not the bank's address). Don't worry, they won't get any post from us." } } }, required: ["address"] }] }], errors: { validation: { address: { country: "Please select a country.", city: "Please enter a city.", postCode: "Please enter a post code.", firstLine: "Please enter a residential address." } } }, refreshFormUrl: "/steps/recipientUpdate/?refresh", model: { country: "GB", ownedByCustomer: false, creatorId: 5465158, accountSummary: "(04-00-04) 27832001", active: true, longAccountSummary: "GBP account ending in 2001", type: "SortCode", isInternal: false, profileId: 5461759, legalEntityType: "PERSON", name: { fullName: "Fergus Jordan" }, currency: "GBP", details: { accountNumber: "27832001", sortCode: "040004", hashedByLooseHashAlgorithm: "5c577703b845c613532bf0e08bbb38ce37644f76af58e1af6fa7447df7041a27" }, id: 67912450, hash: "fe319d809ce8a4f155412afe1b62bc2f1abf6e4af89f762a85a47811f54dab53", commonFieldMap: { bankCodeField: "sortCode", accountNumberField: "accountNumber" } }, layout: [{ schema: { $ref: "form" }, type: "form" }, { type: "button", action: { $ref: "submit" } }] };
|
|
@@ -2736,7 +2736,7 @@ But the best part? Bananas are biodegradable and environmentally-friendly, makin
|
|
|
2736
2736
|
var ju = { key: "Examples/Step Validation Errors", title: "Step with validation errors", type: "form", errors: { validation: { "bridekeeper-questions": { "favourite-colour": "Auuuuuuuugh" } } }, actions: [], layout: [{ type: "form", schema: { $ref: "#the-schema" } }], schemas: [{ $id: "#the-schema", type: "object", displayOrder: ["bridekeeper-questions"], properties: { "bridekeeper-questions": { type: "object", displayOrder: ["name", "quest", "favourite-colour"], properties: { name: { title: "What is your name?", type: "string", placeholder: "Sir Lancelot of Camelot" }, quest: { title: "What is your quest?", type: "string", placeholder: "to seek the Holy Grail" }, "favourite-colour": { title: "What is your favourite colour?", analyticsId: "colour-select", oneOf: [{ title: "Blue", analyticsId: "colour-select-blue", image: { url: "https://placeholder.pics/svg/128/0099ff/FFFFFF" }, const: 1 }, { title: "Yellow", analyticsId: "colour-select-yellow", image: { url: "https://placeholder.pics/svg/128/ffcc00/FFFFFF" }, const: 2 }, { title: "Red", analyticsId: "colour-select-red", image: { url: "https://placeholder.pics/svg/128/ff6600/FFFFFF" }, const: 2 }] } } } } }] };
|
|
2737
2737
|
var El = ju;
|
|
2738
2738
|
var wa = {};
|
|
2739
|
-
|
|
2739
|
+
nt(wa, { actionResponse: () => Il, external: () => Dl, persistAsync: () => Ll, polling: () => Tl, validationAsync: () => Bl });
|
|
2740
2740
|
var zu = { key: "Features/Action Response", title: "Action Response", description: "", type: "form", actions: [], schemas: [], layout: [{ type: "paragraph", text: "The button below will trigger an action that fetches '/responses/action'.", align: "center" }, { type: "paragraph", text: "That should return an action response that will load a final step.", align: "center" }, { type: "button", action: { url: "/responses/action", title: "Submit", type: "primary" } }] };
|
|
2741
2741
|
var Il = zu;
|
|
2742
2742
|
var Vu = { type: "form", key: "Features/External", title: "External Feature", description: "Your bank is opening in another window.", external: { url: "http://google.com/" }, polling: { url: "/polling/1234", interval: 2, maxAttempts: 5, onError: { action: { url: "/failure" } } }, layout: [{ type: "paragraph", align: "center", text: "Please, follow their instructions. Keep this window open." }, { type: "loading-indicator", margin: "xl" }, { type: "info", align: "center", markdown: "If it didn't work, you can [reopen](http://google.com/) the tab" }], actions: [], schemas: [] };
|
|
@@ -2748,7 +2748,7 @@ But the best part? Bananas are biodegradable and environmentally-friendly, makin
|
|
|
2748
2748
|
var $u = { type: "form", key: "Features/Validation Async", title: "Validation Async Feature", schemas: [{ $id: "#the-schema", type: "object", displayOrder: ["account-number"], properties: { "account-number": { $id: "#the-string-schema", type: "string", maxLength: 6, title: "Account number (max 6 digits)", validationAsync: { method: "POST", url: "/validate", param: "myParameter" } } } }], layout: [{ type: "form", schema: { $ref: "#the-schema" } }], actions: [], model: {} };
|
|
2749
2749
|
var Bl = $u;
|
|
2750
2750
|
var Fa = {};
|
|
2751
|
-
|
|
2751
|
+
nt(Fa, { allLayoutComponents: () => Nl, finalStepLayout: () => Rl, listLayout: () => Ul, payInLayout: () => jl, reviewLayout: () => zl, successLayout: () => Vl });
|
|
2752
2752
|
var Gu = [{ type: "box", width: "md", components: [{ type: "heading", text: "This is a large heading", size: "lg", align: "center", margin: "md" }, { type: "paragraph", text: "This is a paragraph of text. This is a paragraph of text. This is a paragraph of text.", align: "center", margin: "xl" }, { type: "loading-indicator", size: "lg", margin: "md" }] }, { type: "columns", bias: "left", left: [{ type: "box", border: true, components: [{ type: "heading", text: "Small heading", size: "sm", margin: "md" }, { type: "divider", margin: "xl" }, { type: "review", title: "Review title", margin: "lg", orientation: "horizontal", action: { $id: "edit-profile", title: "Edit", url: "/edit", method: "GET" }, fields: [{ label: "First name", value: "John" }, { label: "Last name", value: "Smith" }] }, { type: "image", text: "An image of cascading stylesheet computer code", url: "https://bootstrap.transferwise.com/assets/img/css2-bg.jpg", margin: "xs" }] }], right: [{ type: "form", schema: { type: "object", title: "Personal details", alert: { markdown: "Make sure you get this correct, or your transfer could be held up!", context: "neutral" }, displayOrder: ["firstname", "lastname"], properties: { firstname: { type: "string", title: "First name", alert: { markdown: "Please use **only** latin characters.", context: "warning" } }, lastname: { type: "string", title: "Last name", minLength: 3, help: { markdown: "help!" } } } } }, { type: "alert", markdown: "This is an alert - we can use **bold** to provide emphasis.", context: "warning" }, { type: "info", markdown: `### This heading comes from markdown
|
|
2753
2753
|
\r We can use markdown to add [links](https://transferwise.com) and _other_ **formatting**
|
|
2754
2754
|
\r. It will also let us add simple lists:
|
|
@@ -2767,7 +2767,7 @@ But the best part? Bananas are biodegradable and environmentally-friendly, makin
|
|
|
2767
2767
|
var Ju = [{ type: "box", width: "xs", components: [{ type: "image", url: "https://transferwise.com/staticrab/homepage/_next/static/images/how_to_2-06281f8ea9caa50445f075d460434bcf.svg", text: "An illustration" }] }, { type: "box", width: "lg", components: [{ type: "heading", align: "center", text: "You've scheduled a monthly payment of 100 EUR to Rayna Kenter" }] }, { type: "box", width: "md", components: [{ type: "info", align: "center", markdown: "Your first payment has been sent **now**", margin: "xs" }, { type: "paragraph", align: "center", text: "Your next payment will be made on July 29th, 2020 (BST)" }, { type: "columns", left: [{ type: "button", action: { title: "Check transfer details", url: "/check", method: "GET" } }], right: [{ type: "button", action: { title: "Invite & earn", url: "/check", method: "GET", type: "primary" } }] }] }];
|
|
2768
2768
|
var Vl = Ju;
|
|
2769
2769
|
var Ca = {};
|
|
2770
|
-
|
|
2770
|
+
nt(Ca, { action: () => Hl, actionResponseFinal: () => ql, exit: () => $l, recipientUpdateFinal: () => Gl });
|
|
2771
2771
|
var Zu = { action: { url: "/responses/success", method: "POST" } };
|
|
2772
2772
|
var Hl = Zu;
|
|
2773
2773
|
var Xu = { type: "form", key: "action-response-final", title: "Action Response Final Step", description: "This step was loaded as a result of an Action Response.", actions: [], schemas: [], layout: [{ type: "alert", markdown: 'If you want to see this again, perhaps go back to "Action Response" story.', context: "positive" }, { type: "button", action: { title: "Start Over", type: "primary", url: "/steps/actionResponse" } }] };
|
|
@@ -2777,7 +2777,7 @@ But the best part? Bananas are biodegradable and environmentally-friendly, makin
|
|
|
2777
2777
|
var ep = { type: "form", key: "recipient-update-final", title: "Recipient Update Final Step", description: "The recipient has been updated.", actions: [], schemas: [], layout: [{ type: "alert", markdown: "Nothing to see here.", context: "positive" }, { type: "button", action: { title: "Start Over", type: "primary", url: "/steps/recipientUpdate" } }] };
|
|
2778
2778
|
var Gl = ep;
|
|
2779
2779
|
var xa = {};
|
|
2780
|
-
|
|
2780
|
+
nt(xa, { numberAndInteger: () => Wl, oneOf: () => Kl, simpleForm: () => _l, stringFormats: () => Yl });
|
|
2781
2781
|
var tp = { key: "Schemas/Basic Form", title: "Simple Form", description: "A simple form with text fields and a checkbox.", type: "form", actions: [], schemas: [{ $id: "#the-schema", type: "object", displayOrder: ["name", "pineapple"], properties: { name: { title: "Name (string schema)", type: "string" }, pineapple: { title: "Pineapple on pizza (boolean schema)", type: "boolean" } } }], layout: [{ type: "form", schema: { $ref: "#the-schema" } }, { type: "button", action: { url: "/submit", title: "Submit", type: "primary" } }] };
|
|
2782
2782
|
var _l = tp;
|
|
2783
2783
|
var rp = { key: "Schemas/Number And Integer", title: "Number and Integer Schemas", description: "Number and Integer Schemas.", type: "form", actions: [], schemas: [{ $id: "#the-schema", type: "object", displayOrder: ["some-number", "some-integer"], properties: { "some-number": { title: "Number (number schema)", type: "number", validationMessages: { type: "This is not an number" } }, "some-integer": { title: "Integer (integer schema, does not support decimals)", type: "integer", validationMessages: { type: "This is not an integer" } } } }], layout: [{ type: "form", schema: { $ref: "#the-schema" } }, { type: "button", action: { url: "/submit", title: "Submit", type: "primary" } }] };
|
|
@@ -2788,7 +2788,7 @@ But the best part? Bananas are biodegradable and environmentally-friendly, makin
|
|
|
2788
2788
|
var np = { key: "Schemas/String Formats", title: "String Schema Formats", description: "String schemas with different formats (password, date, telephone).", type: "form", actions: [], schemas: [{ $id: "#the-schema", type: "object", displayOrder: ["name", "password", "dob", "date-lookup", "telephone"], properties: { name: { title: "Name (string schema no format)", type: "string" }, password: { title: 'Password (string schema with format: "password")', type: "string", format: "password" }, dob: { title: 'Date of birth (string schema with format: "date")', type: "string", format: "date" }, "date-lookup": { title: 'Date Lookup (string schema with format: "date" and control: "date-lookup")', type: "string", format: "date", control: "date-lookup", minimum: "2023-01-01", maximum: "2023-12-31", placeholder: "Select a date" }, telephone: { title: 'Phone number (string schema with format: "phone-number")', type: "string", format: "phone-number" } } }], layout: [{ type: "form", schema: { $ref: "#the-schema" } }, { type: "button", action: { url: "/submit", title: "Submit", type: "primary" } }], model: { "date-lookup": "2023-01-01" } };
|
|
2789
2789
|
var Yl = np;
|
|
2790
2790
|
var Bt = (e) => ({ type: "form", key: `Components/Image-${e}`, title: `Image Component - ${e}`, description: `This is an image with size: "${e}"`, actions: [], schemas: [], layout: [{ type: "image", url: "http://placekitten.com/g/400/400", text: `This is an image with size: "${e}"`, size: e }] });
|
|
2791
|
-
var Jl = { steps:
|
|
2791
|
+
var Jl = { steps: h(i(i(i(i({}, ba), Sa), wa), xa), { "image-xs": Bt("xs"), "image-sm": Bt("sm"), "image-md": Bt("md"), "image-lg": Bt("lg"), "image-xl": Bt("xl") }), layouts: i({}, Fa), responses: Ca };
|
|
2792
2792
|
var Zl = { "dynamicFlows.ArraySchema.maxItemsError": "Bitte f\xFCge {maxItems} oder weniger hinzu.", "dynamicFlows.ArraySchema.minItemsError": "Bitte f\xFCge mindestens {minItems} hinzu.", "dynamicFlows.CameraCapture.CameraNotSupported.paragraph": "Der von dir verwendete Browser unterst\xFCtzt keine Kameras. Bitte verwende einen anderen Browser oder ein anderes Ger\xE4t, oder lade unsere App herunter", "dynamicFlows.CameraCapture.CameraNotSupported.title": "Kamera wird nicht unterst\xFCtzt", "dynamicFlows.CameraCapture.NoCameraAccess.action": "Kamerazugriff genehmigen", "dynamicFlows.CameraCapture.NoCameraAccess.paragraph": "Aktiviere den Kamerazugriff in den Einstellungen deines Browsers, um weitermachen zu k\xF6nnen.", "dynamicFlows.CameraCapture.NoCameraAccess.title": "Wir k\xF6nnen nicht auf deine Kamera zugreifen", "dynamicFlows.CameraCapture.reviewInstructions": "Ist das aufgenommene Bild deutlich erkennbar und vollst\xE4ndig?", "dynamicFlows.CameraCapture.reviewRetry": "Nein, erneut versuchen", "dynamicFlows.CameraCapture.reviewSubmit": "Ja, senden", "dynamicFlows.ControlFeedback.maxLength": "Bitte gib nicht mehr als {maxLength} Zeichen ein.", "dynamicFlows.ControlFeedback.maximum": "Bitte gib eine Zahl ein, die {maximum} oder weniger betr\xE4gt.", "dynamicFlows.ControlFeedback.maximumDate": "Bitte gib ein Datum ein, das am oder vor dem {maximum} liegt.", "dynamicFlows.ControlFeedback.minLength": "Bitte gib mindestens {minLength} Zeichen ein.", "dynamicFlows.ControlFeedback.minimum": "Bitte gib eine Zahl ein, die {minimum} oder mehr betr\xE4gt.", "dynamicFlows.ControlFeedback.minimumDate": "Bitte gib ein Datum ein, das am oder nach dem {minimum} liegt.", "dynamicFlows.ControlFeedback.pattern": "Bitte gib die Angabe im richtigen Format ein.", "dynamicFlows.ControlFeedback.patternDate": "Bitte gib ein Datum im richtigen Format ein.", "dynamicFlows.ControlFeedback.required": "Bitte f\xFClle dieses Feld aus.", "dynamicFlows.ControlFeedback.type": "Falscher Typ", "dynamicFlows.DynamicExternal.retryTitle": "Fenster erneut \xF6ffnen", "dynamicFlows.DynamicParagraph.copied": "In Zwischenablage kopiert", "dynamicFlows.DynamicParagraph.copy": "Kopieren", "dynamicFlows.ErrorBoundary.errorAlert": "Hoppla \u2013 da ist was schiefgelaufen...", "dynamicFlows.ErrorBoundary.retry": "Erneut versuchen", "dynamicFlows.ExternalConfirmation.cancel": "Abbrechen", "dynamicFlows.ExternalConfirmation.description": "Bitte best\xE4tige, dass du **{origin}** in einem neuen Browser-Tab \xF6ffnen m\xF6chtest.", "dynamicFlows.ExternalConfirmation.open": "In neuem Tab \xF6ffnen", "dynamicFlows.ExternalConfirmation.title": "Bitte best\xE4tigen", "dynamicFlows.Help.ariaLabel": "Klicke hier f\xFCr mehr Informationen.", "dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "Diese Datei ist leider zu gro\xDF. Bitte lade eine kleinere Datei hoch.", "dynamicFlows.MultipleFileUploadSchema.maxItemsError": "Bitte lade {maxItems} oder weniger Dateien hoch.", "dynamicFlows.MultipleFileUploadSchema.minItemsError": "Bitte lade mindestens {minItems} Datei(en) hoch.", "dynamicFlows.PersistAsyncSchema.genericError": "Da ist etwas schiefgelaufen. Probiere es bitte sp\xE4ter noch einmal.", "dynamicFlows.ReadOnlySchema.no": "Nein", "dynamicFlows.ReadOnlySchema.yes": "Ja" };
|
|
2793
2793
|
var Xl = { "dynamicFlows.ArraySchema.maxItemsError": "Please add {maxItems} or fewer.", "dynamicFlows.ArraySchema.minItemsError": "Please add at least {minItems}.", "dynamicFlows.CameraCapture.CameraNotSupported.paragraph": "The browser you're using doesn't have support for a camera. Try a different browser, device, or download our mobile app.", "dynamicFlows.CameraCapture.CameraNotSupported.title": "Camera not supported", "dynamicFlows.CameraCapture.NoCameraAccess.action": "Enable camera access", "dynamicFlows.CameraCapture.NoCameraAccess.paragraph": "Enable camera access in your browser's settings to get going again.", "dynamicFlows.CameraCapture.NoCameraAccess.title": "We can't access your camera", "dynamicFlows.CameraCapture.reviewInstructions": "Is your picture clear, readable and complete?", "dynamicFlows.CameraCapture.reviewRetry": "No, try again", "dynamicFlows.CameraCapture.reviewSubmit": "Yes, submit", "dynamicFlows.ControlFeedback.maxLength": "Please enter {maxLength} or fewer characters.", "dynamicFlows.ControlFeedback.maximum": "Please enter a number that's {maximum} or less.", "dynamicFlows.ControlFeedback.maximumDate": "Please enter a date that's on or before {maximum}.", "dynamicFlows.ControlFeedback.minLength": "Please enter at least {minLength} characters.", "dynamicFlows.ControlFeedback.minimum": "Please enter a number that's {minimum} or more.", "dynamicFlows.ControlFeedback.minimumDate": "Please enter a date that's on or after {minimum}.", "dynamicFlows.ControlFeedback.pattern": "Please enter this in the correct format.", "dynamicFlows.ControlFeedback.patternDate": "Please enter a date in the corrrect format.", "dynamicFlows.ControlFeedback.required": "Please fill out this field.", "dynamicFlows.ControlFeedback.type": "Incorrect type", "dynamicFlows.DynamicExternal.retryTitle": "Reopen window", "dynamicFlows.DynamicParagraph.copied": "Copied to clipboard", "dynamicFlows.DynamicParagraph.copy": "Copy", "dynamicFlows.ErrorBoundary.errorAlert": "Oops. Something went wrong...", "dynamicFlows.ErrorBoundary.retry": "Retry", "dynamicFlows.ExternalConfirmation.cancel": "Cancel", "dynamicFlows.ExternalConfirmation.description": "Please confirm you want to open **{origin}** in a new browser tab.", "dynamicFlows.ExternalConfirmation.open": "Open in new tab", "dynamicFlows.ExternalConfirmation.title": "Please confirm", "dynamicFlows.Help.ariaLabel": "Click here for more info.", "dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "Sorry, that file is too big. Please upload a smaller file.", "dynamicFlows.MultipleFileUploadSchema.maxItemsError": "Please upload {maxItems} or fewer files.", "dynamicFlows.MultipleFileUploadSchema.minItemsError": "Please upload at least {minItems} file(s).", "dynamicFlows.PersistAsyncSchema.genericError": "Something went wrong, please try again later!", "dynamicFlows.ReadOnlySchema.no": "No", "dynamicFlows.ReadOnlySchema.yes": "Yes" };
|
|
2794
2794
|
var Ql = { "dynamicFlows.ArraySchema.maxItemsError": "A\xF1ade {maxItems} o menos.", "dynamicFlows.ArraySchema.minItemsError": "A\xF1ade al menos {minItems}.", "dynamicFlows.CameraCapture.CameraNotSupported.paragraph": "El navegador que est\xE1s utilizando no es compatible con una c\xE1mara. Prueba con otro navegador, dispositivo o descarga nuestra app m\xF3vil.", "dynamicFlows.CameraCapture.CameraNotSupported.title": "C\xE1mara no compatible", "dynamicFlows.CameraCapture.NoCameraAccess.action": "Habilitar acceso a la c\xE1mara", "dynamicFlows.CameraCapture.NoCameraAccess.paragraph": "Habilita el acceso a la c\xE1mara en la configuraci\xF3n de tu navegador para volver a activarla.", "dynamicFlows.CameraCapture.NoCameraAccess.title": "No podemos acceder a tu c\xE1mara", "dynamicFlows.CameraCapture.reviewInstructions": "\xBFTu foto es clara, legible y completa?", "dynamicFlows.CameraCapture.reviewRetry": "No, intentar de nuevo", "dynamicFlows.CameraCapture.reviewSubmit": "S\xED, enviar", "dynamicFlows.ControlFeedback.maxLength": "Introduce {maxLength} caracteres o menos.", "dynamicFlows.ControlFeedback.maximum": "Introduce una cifra igual o inferior a {maximum}.", "dynamicFlows.ControlFeedback.maximumDate": "Introduce una fecha que sea igual o anterior al {maximum}.", "dynamicFlows.ControlFeedback.minLength": "Introduce al menos {minLength} caracteres.", "dynamicFlows.ControlFeedback.minimum": "Introduce una cifra igual o inferior a {minimum}.", "dynamicFlows.ControlFeedback.minimumDate": "Introduce una fecha que sea igual o posterior al {minimum}.", "dynamicFlows.ControlFeedback.pattern": "Utiliza el formato correcto.", "dynamicFlows.ControlFeedback.patternDate": "Introduce la fecha en un formato correcto.", "dynamicFlows.ControlFeedback.required": "Completa este campo.", "dynamicFlows.ControlFeedback.type": "Tipo incorrecto", "dynamicFlows.DynamicExternal.retryTitle": "Reabrir ventana", "dynamicFlows.DynamicParagraph.copied": "Copiado al portapapeles", "dynamicFlows.DynamicParagraph.copy": "Copiar", "dynamicFlows.ErrorBoundary.errorAlert": "Vaya. Algo ha salido mal...", "dynamicFlows.ErrorBoundary.retry": "Reintentar", "dynamicFlows.ExternalConfirmation.cancel": "Cancelar", "dynamicFlows.ExternalConfirmation.description": "Confirma que quieres abrir **{origin}** en una nueva pesta\xF1a del navegador.", "dynamicFlows.ExternalConfirmation.open": "Abrir en nueva pesta\xF1a", "dynamicFlows.ExternalConfirmation.title": "Por favor, confirma", "dynamicFlows.Help.ariaLabel": "Haz clic aqu\xED para obtener m\xE1s informaci\xF3n.", "dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "Lo sentimos, el archivo pesa demasiado. Sube uno m\xE1s peque\xF1o.", "dynamicFlows.MultipleFileUploadSchema.maxItemsError": "Sube {maxItems} o menos archivos.", "dynamicFlows.MultipleFileUploadSchema.minItemsError": "Sube al menos {minItems} archivo(s).", "dynamicFlows.PersistAsyncSchema.genericError": "Algo ha ido mal. Int\xE9ntalo de nuevo m\xE1s tarde.", "dynamicFlows.ReadOnlySchema.no": "No", "dynamicFlows.ReadOnlySchema.yes": "S\xED" };
|