@inploi/plugin-chatbot 14.16.0 → 14.17.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/cdn/index.js +4 -4
- package/dist/{chatbot-body-c30b12cc.js → chatbot-body-b728cd78.js} +498 -485
- package/dist/{chatbot-body-1d399b73.cjs → chatbot-body-f9ecbfd4.cjs} +2 -2
- package/dist/chatbot.d.ts +2 -0
- package/dist/chatbot.state.d.ts +2 -1
- package/dist/components/job-alerts-offer.d.ts +6 -0
- package/dist/components/job-alerts-privacy-line.test.d.ts +1 -0
- package/dist/i18n.d.ts +6 -0
- package/dist/index-3e26f368.cjs +5 -0
- package/dist/{index-cea8111c.js → index-41fceabc.js} +105 -100
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/package.json +1 -1
- package/dist/index-2b9b0c8e.cjs +0 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Y = (e, r, t) => (
|
|
4
|
-
import { p as
|
|
5
|
-
import { saveClosedRoleJobAlerts as
|
|
6
|
-
var
|
|
1
|
+
var As = Object.defineProperty;
|
|
2
|
+
var Is = (e, r, t) => r in e ? As(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
|
+
var Y = (e, r, t) => (Is(e, typeof r != "symbol" ? r + "" : r, t), t);
|
|
4
|
+
import { p as Br, f as vt, L as Dt, m as Ge, v as Pr, O as qr, l as Es, I as Fs, C as Vs, j as Ur, P as Ms, u as Ls, y as Ns, w as Rs, F as Ts, V as sr, W as nr, A as Ds, k as ar, b as Os, x as js, h as Wr, E as $s, S as Bs, R as Ps, Q as qs, J as zr, Z as Us, _ as Ws, s as q, a as re, o as l, c as Qe, d as xt, e as ke, g as ye, i as Oe, n as Le, q as be, r as Ut, t as zs, z as Hr, B as Kr, D as Hs, G as Ks, H as et, K as ir, M as ae, N as ce, T as Gs, U as Js, X as Zs, Y as Xs, $ as Ys, a0 as Qs, a1 as Gr, a2 as en } from "./index-41fceabc.js";
|
|
5
|
+
import { saveClosedRoleJobAlerts as tn } from "@inploi/sdk";
|
|
6
|
+
var rn = "9.12.0", Jr = `https://sdk.inploi.com/@inploi/flows@${rn}/cdn/captcha/index.html`, sn = new URL(Jr).origin, or = 3e4, nn = 5 * 6e4, an = (e) => typeof e == "object" && e !== null && e.source === "inploi-captcha", Ft = /* @__PURE__ */ new WeakMap(), on = (e) => {
|
|
7
7
|
let r = Ft.get(e);
|
|
8
8
|
return r || (r = e.fetch("/flow/captcha").then((t) => {
|
|
9
9
|
let s = t == null ? void 0 : t.site_key;
|
|
@@ -11,7 +11,7 @@ var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/
|
|
|
11
11
|
}).catch((t) => {
|
|
12
12
|
throw Ft.delete(e), t;
|
|
13
13
|
}), Ft.set(e, r)), r;
|
|
14
|
-
},
|
|
14
|
+
}, ln = (e, r = {}) => new Promise((t, s) => {
|
|
15
15
|
let { signal: n, container: i = null, theme: a, onInteractive: o } = r instanceof AbortSignal ? { signal: r } : r, c = !1, f = () => {
|
|
16
16
|
}, p = (w) => {
|
|
17
17
|
c || (c = !0, clearTimeout(b), n == null || n.removeEventListener("abort", m), f(), w());
|
|
@@ -21,17 +21,17 @@ var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/
|
|
|
21
21
|
if (k(or), n == null ? void 0 : n.aborted)
|
|
22
22
|
return m();
|
|
23
23
|
n == null || n.addEventListener("abort", m), (async () => {
|
|
24
|
-
let w = await
|
|
24
|
+
let w = await on(e);
|
|
25
25
|
if (w === void 0)
|
|
26
26
|
return p(() => t(void 0));
|
|
27
27
|
if (c)
|
|
28
28
|
return;
|
|
29
29
|
let C = document.createElement("iframe");
|
|
30
|
-
C.src = `${
|
|
31
|
-
let A = !1, v = (
|
|
32
|
-
if (!C.contentWindow ||
|
|
30
|
+
C.src = `${Jr}?${new URLSearchParams({ sitekey: w, origin: window.location.origin, ...a && { theme: a } }).toString()}`, C.title = "Cloudflare security check", C.style.cssText = `display:block;border:0;width:${i ? "100%" : "300px"};height:0;color-scheme:normal`, i ? i.appendChild(C) : (C.style.cssText += ";position:fixed;bottom:16px;right:16px;z-index:2147483647", document.body.appendChild(C));
|
|
31
|
+
let A = !1, v = (N) => {
|
|
32
|
+
if (!C.contentWindow || N.source !== C.contentWindow || N.origin !== sn || !an(N.data))
|
|
33
33
|
return;
|
|
34
|
-
let V =
|
|
34
|
+
let V = N.data;
|
|
35
35
|
switch (V.type) {
|
|
36
36
|
case "token":
|
|
37
37
|
return p(() => t(V.token));
|
|
@@ -39,7 +39,7 @@ var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/
|
|
|
39
39
|
C.style.height = `${Math.max(0, Math.ceil(V.height))}px`;
|
|
40
40
|
return;
|
|
41
41
|
case "before-interactive":
|
|
42
|
-
return A = !0, k(
|
|
42
|
+
return A = !0, k(nn), o == null ? void 0 : o();
|
|
43
43
|
case "after-interactive":
|
|
44
44
|
return A = !1, k(or);
|
|
45
45
|
case "error":
|
|
@@ -59,12 +59,12 @@ var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/
|
|
|
59
59
|
let [n, ...i] = e.compareKey.split(".");
|
|
60
60
|
if (!n)
|
|
61
61
|
return !1;
|
|
62
|
-
let a =
|
|
62
|
+
let a = Br({ context: r, key: n, path: i, submissions: t });
|
|
63
63
|
if (!a)
|
|
64
64
|
return !1;
|
|
65
65
|
switch (a.type) {
|
|
66
66
|
case "address": {
|
|
67
|
-
let o =
|
|
67
|
+
let o = Dt(a.value, i);
|
|
68
68
|
switch (e.compare) {
|
|
69
69
|
case "equals":
|
|
70
70
|
return o === e.compareValue;
|
|
@@ -80,7 +80,7 @@ var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/
|
|
|
80
80
|
case "integration": {
|
|
81
81
|
if (typeof a.value != "object" || Array.isArray(a.value))
|
|
82
82
|
return !1;
|
|
83
|
-
let o =
|
|
83
|
+
let o = Dt(a.value, i), c = { ...s, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
|
|
84
84
|
switch (typeof o) {
|
|
85
85
|
case "boolean":
|
|
86
86
|
return lt(c, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
|
|
@@ -166,8 +166,8 @@ var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/
|
|
|
166
166
|
return !1;
|
|
167
167
|
return !0;
|
|
168
168
|
}
|
|
169
|
-
},
|
|
170
|
-
let [a, ...o] = n.trim().split("."), c =
|
|
169
|
+
}, cn = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, un = (e, { context: r, submissions: t }) => e.replace(cn, (s, n, i = "") => {
|
|
170
|
+
let [a, ...o] = n.trim().split("."), c = Br({ key: a, path: o, submissions: t, context: r });
|
|
171
171
|
if (!c)
|
|
172
172
|
return i;
|
|
173
173
|
switch (c.type) {
|
|
@@ -187,7 +187,7 @@ var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/
|
|
|
187
187
|
case "integration": {
|
|
188
188
|
if (typeof c.value != "object" || Array.isArray(c.value))
|
|
189
189
|
break;
|
|
190
|
-
let f =
|
|
190
|
+
let f = Dt(c.value, o);
|
|
191
191
|
switch (typeof f) {
|
|
192
192
|
case "boolean":
|
|
193
193
|
return f === !0 ? "true" : "false";
|
|
@@ -205,11 +205,11 @@ var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/
|
|
|
205
205
|
return i;
|
|
206
206
|
});
|
|
207
207
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
208
|
-
function
|
|
208
|
+
function dn(e) {
|
|
209
209
|
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
|
|
210
210
|
}
|
|
211
211
|
function Wt(e, r, t = "") {
|
|
212
|
-
const s =
|
|
212
|
+
const s = dn(e), n = e == null ? void 0 : e.length, i = r !== void 0;
|
|
213
213
|
if (!s || i && n !== r) {
|
|
214
214
|
const a = t && `"${t}" `, o = i ? ` of length ${r}` : "", c = s ? `length=${n}` : `type=${typeof e}`;
|
|
215
215
|
throw new Error(a + "expected Uint8Array" + o + ", got " + c);
|
|
@@ -222,7 +222,7 @@ function cr(e, r = !0) {
|
|
|
222
222
|
if (r && e.finished)
|
|
223
223
|
throw new Error("Hash#digest() has already been called");
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function fn(e, r) {
|
|
226
226
|
Wt(e, void 0, "digestInto() output");
|
|
227
227
|
const t = r.outputLen;
|
|
228
228
|
if (e.length < t)
|
|
@@ -238,32 +238,32 @@ function Vt(e) {
|
|
|
238
238
|
function pe(e, r) {
|
|
239
239
|
return e << 32 - r | e >>> r;
|
|
240
240
|
}
|
|
241
|
-
const
|
|
241
|
+
const hn = /* @__PURE__ */ (() => (
|
|
242
242
|
// @ts-ignore
|
|
243
243
|
typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function"
|
|
244
|
-
))(),
|
|
245
|
-
function
|
|
246
|
-
if (Wt(e),
|
|
244
|
+
))(), pn = /* @__PURE__ */ Array.from({ length: 256 }, (e, r) => r.toString(16).padStart(2, "0"));
|
|
245
|
+
function mn(e) {
|
|
246
|
+
if (Wt(e), hn)
|
|
247
247
|
return e.toHex();
|
|
248
248
|
let r = "";
|
|
249
249
|
for (let t = 0; t < e.length; t++)
|
|
250
|
-
r +=
|
|
250
|
+
r += pn[e[t]];
|
|
251
251
|
return r;
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function yn(e, r = {}) {
|
|
254
254
|
const t = (n, i) => e(i).update(n).digest(), s = e(void 0);
|
|
255
255
|
return t.outputLen = s.outputLen, t.blockLen = s.blockLen, t.create = (n) => e(n), Object.assign(t, r), Object.freeze(t);
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const bn = (e) => ({
|
|
258
258
|
oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, e])
|
|
259
259
|
});
|
|
260
|
-
function
|
|
260
|
+
function gn(e, r, t) {
|
|
261
261
|
return e & r ^ ~e & t;
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function vn(e, r, t) {
|
|
264
264
|
return e & r ^ e & t ^ r & t;
|
|
265
265
|
}
|
|
266
|
-
class
|
|
266
|
+
class xn {
|
|
267
267
|
constructor(r, t, s, n) {
|
|
268
268
|
Y(this, "blockLen");
|
|
269
269
|
Y(this, "outputLen");
|
|
@@ -294,7 +294,7 @@ class gn {
|
|
|
294
294
|
return this.length += r.length, this.roundClean(), this;
|
|
295
295
|
}
|
|
296
296
|
digestInto(r) {
|
|
297
|
-
cr(this),
|
|
297
|
+
cr(this), fn(r, this), this.finished = !0;
|
|
298
298
|
const { buffer: t, view: s, blockLen: n, isLE: i } = this;
|
|
299
299
|
let { pos: a } = this;
|
|
300
300
|
t[a++] = 128, Ot(this.buffer.subarray(a)), this.padOffset > n - a && (this.process(s, 0), a = 0);
|
|
@@ -334,7 +334,7 @@ const Ee = /* @__PURE__ */ Uint32Array.from([
|
|
|
334
334
|
2600822924,
|
|
335
335
|
528734635,
|
|
336
336
|
1541459225
|
|
337
|
-
]),
|
|
337
|
+
]), wn = /* @__PURE__ */ Uint32Array.from([
|
|
338
338
|
1116352408,
|
|
339
339
|
1899447441,
|
|
340
340
|
3049323471,
|
|
@@ -400,7 +400,7 @@ const Ee = /* @__PURE__ */ Uint32Array.from([
|
|
|
400
400
|
3204031479,
|
|
401
401
|
3329325298
|
|
402
402
|
]), Fe = /* @__PURE__ */ new Uint32Array(64);
|
|
403
|
-
class
|
|
403
|
+
class _n extends xn {
|
|
404
404
|
constructor(r) {
|
|
405
405
|
super(64, r, 8, !1);
|
|
406
406
|
}
|
|
@@ -421,7 +421,7 @@ class xn extends gn {
|
|
|
421
421
|
}
|
|
422
422
|
let { A: s, B: n, C: i, D: a, E: o, F: c, G: f, H: p } = this;
|
|
423
423
|
for (let g = 0; g < 64; g++) {
|
|
424
|
-
const m = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), b = p + m +
|
|
424
|
+
const m = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), b = p + m + gn(o, c, f) + wn[g] + Fe[g] | 0, w = (pe(s, 2) ^ pe(s, 13) ^ pe(s, 22)) + vn(s, n, i) | 0;
|
|
425
425
|
p = f, f = c, c = o, o = a + b | 0, a = i, i = n, n = s, s = b + w | 0;
|
|
426
426
|
}
|
|
427
427
|
s = s + this.A | 0, n = n + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, c = c + this.F | 0, f = f + this.G | 0, p = p + this.H | 0, this.set(s, n, i, a, o, c, f, p);
|
|
@@ -433,7 +433,7 @@ class xn extends gn {
|
|
|
433
433
|
this.set(0, 0, 0, 0, 0, 0, 0, 0), Ot(this.buffer);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
class
|
|
436
|
+
class kn extends _n {
|
|
437
437
|
constructor() {
|
|
438
438
|
super(32);
|
|
439
439
|
// We cannot use array here since array allows indexing by variable
|
|
@@ -448,11 +448,11 @@ class wn extends xn {
|
|
|
448
448
|
Y(this, "H", Ee[7] | 0);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
const
|
|
452
|
-
() => new
|
|
453
|
-
/* @__PURE__ */
|
|
451
|
+
const Cn = /* @__PURE__ */ yn(
|
|
452
|
+
() => new kn(),
|
|
453
|
+
/* @__PURE__ */ bn(1)
|
|
454
454
|
);
|
|
455
|
-
var
|
|
455
|
+
var Zr = (e) => {
|
|
456
456
|
let r = e.find((t) => t.isHead);
|
|
457
457
|
if (!r)
|
|
458
458
|
throw new Error("No head node found");
|
|
@@ -461,12 +461,12 @@ var Jr = (e) => {
|
|
|
461
461
|
var r, t;
|
|
462
462
|
if (!(e.data.isFinished || (r = e.data.startedWriteNodeIds) != null && r.length))
|
|
463
463
|
return (t = [...e.data.messages].reverse().find((s) => s.groupId && e.nodes.some((n) => n.id === s.groupId && n.type.startsWith("question-")) && (s.type === "system" || "author" in s && s.author === "user"))) == null ? void 0 : t.groupId;
|
|
464
|
-
}, jt = (e) => Array.isArray(e) ? e.map(jt) : e !== null && typeof e == "object" ? Object.fromEntries(Object.entries(e).sort(([r], [t]) => r.localeCompare(t)).map(([r, t]) => [r, jt(t)])) : typeof e == "function" ? void 0 : e,
|
|
465
|
-
function
|
|
464
|
+
}, jt = (e) => Array.isArray(e) ? e.map(jt) : e !== null && typeof e == "object" ? Object.fromEntries(Object.entries(e).sort(([r], [t]) => r.localeCompare(t)).map(([r, t]) => [r, jt(t)])) : typeof e == "function" ? void 0 : e, Sn = (e) => mn(Cn(new TextEncoder().encode(JSON.stringify(jt(e)))));
|
|
465
|
+
function An(e, r, t, s) {
|
|
466
466
|
var n;
|
|
467
467
|
if (s != null && s.aborted)
|
|
468
468
|
return;
|
|
469
|
-
let i =
|
|
469
|
+
let i = Sn(t), a = (n = e.data).preApplyFingerprints ?? (n.preApplyFingerprints = []);
|
|
470
470
|
if (a.includes(i))
|
|
471
471
|
return;
|
|
472
472
|
a.push(i);
|
|
@@ -478,183 +478,183 @@ function Cn(e, r, t, s) {
|
|
|
478
478
|
clearTimeout(c);
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
|
-
var
|
|
481
|
+
var Xr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {} }), he = (e, r) => un(e, Xr(r)), In = (e, r) => lt(e, Xr(r)), Yr = ({ node: e, nodes: r, stopWhen: t }) => {
|
|
482
482
|
if ((t == null ? void 0 : t(e)) === !0)
|
|
483
483
|
return e;
|
|
484
484
|
let s = e.nextId ? r.find((n) => n.id === e.nextId) : void 0;
|
|
485
485
|
if (s)
|
|
486
|
-
return
|
|
487
|
-
},
|
|
486
|
+
return Yr({ node: s, nodes: r, stopWhen: t });
|
|
487
|
+
}, En = ({ childNode: e, nodes: r }) => {
|
|
488
488
|
let t = r.filter((s) => s.type === "if-block").find((s) => {
|
|
489
489
|
if (!s.branchId)
|
|
490
490
|
return !1;
|
|
491
491
|
let n = r.find((a) => a.id === s.branchId);
|
|
492
492
|
if (!n)
|
|
493
493
|
return !1;
|
|
494
|
-
let i =
|
|
494
|
+
let i = Yr({ node: n, nodes: r, stopWhen: (a) => a.id === e.id });
|
|
495
495
|
return !(!i || i.id !== e.id);
|
|
496
496
|
});
|
|
497
497
|
if (t != null && t.nextId)
|
|
498
498
|
return r.find((s) => s.id === t.nextId);
|
|
499
|
-
},
|
|
499
|
+
}, Fn = 3, Vn = ({ flow: e, analytics: r, logger: t, talentBankClient: s, context: n, apiClient: i, getSubmissions: a, getApplicationRecovery: o, setApplicationRecovery: c, chatService: f, persistWriteBarrier: p, onSubmitNetworkError: g, closedRoleBehaviour: m, settledOutcomes: b = m, dateEchoLocale: k, onFlowEnd: w, onInterpret: C, forceSubmitConfirmation: A, flowType: v, t: N }) => {
|
|
500
500
|
var V;
|
|
501
501
|
let M = new AbortController(), ee = { submitAccepted: !1 };
|
|
502
|
-
(V = e.data).startedWriteNodeIds ?? (V.startedWriteNodeIds = e.nodes.flatMap((
|
|
502
|
+
(V = e.data).startedWriteNodeIds ?? (V.startedWriteNodeIds = e.nodes.flatMap((R) => {
|
|
503
503
|
var j, E;
|
|
504
|
-
if (
|
|
504
|
+
if (R.type !== "integration-application-submit" || !e.data.nodeHistory.includes(R.id))
|
|
505
505
|
return [];
|
|
506
|
-
let
|
|
507
|
-
return (
|
|
506
|
+
let T = R.data.key ? (j = a()) == null ? void 0 : j[R.data.key] : void 0;
|
|
507
|
+
return (T == null ? void 0 : T.type) === "integration" && ((E = Pr(T.value)) == null ? void 0 : E.verdict) === "not_submitted" ? [] : [R.id];
|
|
508
508
|
}));
|
|
509
|
-
let K = { ...r.service, log: (
|
|
509
|
+
let K = { ...r.service, log: (R) => r.service.log({ ...R, customProperties: { ...R.customProperties, ...r.customProperties } }) }, D = async (R, T) => {
|
|
510
510
|
let j = M.signal;
|
|
511
511
|
if (j.aborted)
|
|
512
512
|
return;
|
|
513
|
-
let E = a(), F = o(), B = (F == null ? void 0 : F.submitNodeId) ===
|
|
513
|
+
let E = a(), F = o(), B = (F == null ? void 0 : F.submitNodeId) === R.id ? e.nodes.find((L) => {
|
|
514
514
|
var W;
|
|
515
515
|
return L.id === F.fileQuestionNodeId && L.type === "question-file" && ((W = E == null ? void 0 : E[L.data.key]) == null ? void 0 : W.type) !== "file";
|
|
516
516
|
}) : void 0;
|
|
517
517
|
if (B)
|
|
518
|
-
return
|
|
519
|
-
C == null || C(
|
|
518
|
+
return D(B, T);
|
|
519
|
+
C == null || C(R, T);
|
|
520
520
|
try {
|
|
521
|
-
await
|
|
521
|
+
await Mn({ flow: e, analytics: K, logger: t, talentBankClient: s, apiClient: i, context: n, node: R, submissions: E, applicationRecovery: F, setApplicationRecovery: async (L) => {
|
|
522
522
|
if (!j.aborted)
|
|
523
523
|
try {
|
|
524
524
|
await c(L);
|
|
525
525
|
} catch (W) {
|
|
526
526
|
t.error("Failed to persist application recovery", W);
|
|
527
527
|
}
|
|
528
|
-
}, forceSubmitConfirmation: A || (F == null ? void 0 : F.submitNodeId) ===
|
|
528
|
+
}, forceSubmitConfirmation: A || (F == null ? void 0 : F.submitNodeId) === R.id, run: ee, persistWriteBarrier: p, onSubmitNetworkError: g, settledOutcomes: b, dateEchoLocale: k, flowType: v, signal: j, t: N, chat: { sendMessage: async (L) => f.send({ groupId: R.id, message: L, signal: j }), userInput: async (L) => f.input({ input: L, signal: j }), setSubmission: (L, W) => {
|
|
529
529
|
j.aborted || f.setSubmission(L, W);
|
|
530
530
|
}, captcha: f.captcha }, next: (L) => {
|
|
531
531
|
if (j.aborted)
|
|
532
532
|
return;
|
|
533
|
-
let W = (F == null ? void 0 : F.fileQuestionNodeId) ===
|
|
534
|
-
return U ?
|
|
533
|
+
let W = (F == null ? void 0 : F.fileQuestionNodeId) === R.id ? F.submitNodeId : L, U = W ? e.nodes.find((te) => te.id === W) : En({ childNode: R, nodes: e.nodes });
|
|
534
|
+
return U ? D(U, R) : w == null ? void 0 : w(R);
|
|
535
535
|
}, end: () => {
|
|
536
|
-
j.aborted || (w == null || w(
|
|
536
|
+
j.aborted || (w == null || w(R));
|
|
537
537
|
} });
|
|
538
538
|
} catch (L) {
|
|
539
|
-
if (L instanceof
|
|
539
|
+
if (L instanceof qr)
|
|
540
540
|
return;
|
|
541
541
|
throw L;
|
|
542
542
|
}
|
|
543
543
|
};
|
|
544
|
-
return { interpret: async (
|
|
545
|
-
let
|
|
546
|
-
return T
|
|
547
|
-
}, undo: (
|
|
544
|
+
return { interpret: async (R) => {
|
|
545
|
+
let T = e.nodes.find((j) => j.id === R) ?? Zr(e.nodes);
|
|
546
|
+
return D(T);
|
|
547
|
+
}, undo: (R) => {
|
|
548
548
|
var W;
|
|
549
549
|
if (delete e.data.reviewReplay, ((W = e.data.startedWriteNodeIds) == null ? void 0 : W.length) || e.data.isFinished)
|
|
550
550
|
return { removed: 0 };
|
|
551
|
-
let
|
|
551
|
+
let T = zt(e), j = T ? R.lastIndexOf(T) : -1, E = e.nodes.find((U) => U.id === T);
|
|
552
552
|
if (j === -1 || !E)
|
|
553
553
|
return { removed: 0 };
|
|
554
|
-
let F = e.nodes.find((U) => U.id ===
|
|
554
|
+
let F = e.nodes.find((U) => U.id === R[R.length - 1]);
|
|
555
555
|
M.abort();
|
|
556
|
-
let B =
|
|
556
|
+
let B = R.splice(j);
|
|
557
557
|
e.data.messages = e.data.messages.filter((U) => !U.groupId || !B.includes(U.groupId)), e.data.currentInput = null;
|
|
558
558
|
let L = a();
|
|
559
559
|
for (let U of B.slice(1)) {
|
|
560
560
|
let te = e.nodes.find((X) => X.id === U);
|
|
561
|
-
if (!(!te || !L || te.id ===
|
|
561
|
+
if (!(!te || !L || te.id === T) && ("key" in te.data && te.data.key && delete L[te.data.key], "keys" in te.data))
|
|
562
562
|
for (let X of Object.values(te.data.keys))
|
|
563
563
|
typeof X == "string" && delete L[X];
|
|
564
564
|
}
|
|
565
|
-
return M = new AbortController(),
|
|
565
|
+
return M = new AbortController(), D(E, F), { removed: B.length };
|
|
566
566
|
}, abort: () => {
|
|
567
567
|
M.abort();
|
|
568
568
|
} };
|
|
569
569
|
};
|
|
570
|
-
async function
|
|
570
|
+
async function Mn(e) {
|
|
571
571
|
let r = e.node;
|
|
572
572
|
switch (r.type) {
|
|
573
573
|
case "flow-section":
|
|
574
574
|
return await e.chat.sendMessage({ type: "system", variant: "info", text: r.data.title }), e.next(r.nextId);
|
|
575
575
|
case "pre-apply-result":
|
|
576
|
-
return
|
|
576
|
+
return ra({ ...e, node: r });
|
|
577
577
|
case "text":
|
|
578
|
-
return
|
|
578
|
+
return Hn({ ...e, node: r });
|
|
579
579
|
case "image":
|
|
580
|
-
return
|
|
580
|
+
return Kn({ ...e, node: r });
|
|
581
581
|
case "question-text":
|
|
582
|
-
return
|
|
582
|
+
return Gn({ ...e, node: r });
|
|
583
583
|
case "question-enum":
|
|
584
|
-
return
|
|
584
|
+
return Xn({ ...e, node: r });
|
|
585
585
|
case "question-number":
|
|
586
|
-
return
|
|
586
|
+
return Jn({ ...e, node: r });
|
|
587
587
|
case "question-phone":
|
|
588
|
-
return Gn({ ...e, node: r });
|
|
589
|
-
case "question-boolean":
|
|
590
588
|
return Zn({ ...e, node: r });
|
|
591
|
-
case "question-
|
|
589
|
+
case "question-boolean":
|
|
592
590
|
return Yn({ ...e, node: r });
|
|
591
|
+
case "question-file":
|
|
592
|
+
return ea({ ...e, node: r });
|
|
593
593
|
case "question-address":
|
|
594
|
-
return Xn({ ...e, node: r });
|
|
595
|
-
case "end-flow":
|
|
596
594
|
return Qn({ ...e, node: r });
|
|
595
|
+
case "end-flow":
|
|
596
|
+
return ta({ ...e, node: r });
|
|
597
597
|
case "if-block":
|
|
598
|
-
return
|
|
598
|
+
return zn({ ...e, node: r });
|
|
599
599
|
case "jump":
|
|
600
|
-
return
|
|
600
|
+
return Rn({ ...e, node: r });
|
|
601
601
|
case "link":
|
|
602
|
-
return
|
|
602
|
+
return Wn({ ...e, node: r });
|
|
603
603
|
case "integration-application-submit":
|
|
604
|
-
return
|
|
604
|
+
return Pn({ ...e, node: r });
|
|
605
605
|
case "add-submission":
|
|
606
|
-
return
|
|
606
|
+
return Tn({ ...e, node: r });
|
|
607
607
|
case "integration-workflow-get":
|
|
608
608
|
throw Error("Workflow should be unreachable");
|
|
609
609
|
case "check-duplicate":
|
|
610
|
-
return
|
|
610
|
+
return Nn({ ...e, node: r });
|
|
611
611
|
case "feedback":
|
|
612
|
-
return
|
|
612
|
+
return Ln({ ...e, node: r });
|
|
613
613
|
default:
|
|
614
614
|
throw new Error(`Unknown node: ${JSON.stringify(r)}`);
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
|
-
async function
|
|
617
|
+
async function Ln({ next: e, node: r }) {
|
|
618
618
|
e(r.nextId);
|
|
619
619
|
}
|
|
620
|
-
async function
|
|
620
|
+
async function Nn({ next: e, node: r, talentBankClient: t, submissions: s, flow: n, logger: i, chat: a }) {
|
|
621
621
|
var c;
|
|
622
622
|
let o = { isDuplicate: !1 };
|
|
623
623
|
if (s && t) {
|
|
624
624
|
let f = r.data.scope === "job" ? (c = n.job) == null ? void 0 : c.id : void 0;
|
|
625
625
|
if (r.data.scope === "company" || f != null)
|
|
626
626
|
try {
|
|
627
|
-
o = await t.checkDuplicate({ email:
|
|
627
|
+
o = await t.checkDuplicate({ email: Es({ key: r.data.email, submissions: s }).toString(), jobId: f, scope: r.data.scope });
|
|
628
628
|
} catch (p) {
|
|
629
629
|
i.error("[check-duplicate]", p);
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
a.setSubmission(r.data.key, { type: "integration", value: o }), e(r.nextId);
|
|
633
633
|
}
|
|
634
|
-
async function
|
|
634
|
+
async function Rn({ next: e, node: r }) {
|
|
635
635
|
e(r.data.targetId);
|
|
636
636
|
}
|
|
637
|
-
async function
|
|
637
|
+
async function Tn({ next: e, node: r, logger: t, submissions: s, context: n }) {
|
|
638
638
|
if (!s) {
|
|
639
639
|
t.error("Submissions not found");
|
|
640
640
|
return;
|
|
641
641
|
}
|
|
642
642
|
s[r.data.key] = { type: "string", value: he(r.data.value, { submissions: s, context: n }) }, e(r.nextId);
|
|
643
643
|
}
|
|
644
|
-
var
|
|
645
|
-
let { waitMs: s, throttles: n, maintenance: i } =
|
|
644
|
+
var Dn = 5e3, On = (e, r) => r ? `${e}@${r.id_type}:${r.id}` : e, jn = (e, r = Date.now()) => Math.min(e.until, r + (e.maintenance ? qs : e.throttles ? zr : Us)), $n = (e, r, t) => {
|
|
645
|
+
let { waitMs: s, throttles: n, maintenance: i } = Ws(r == null ? void 0 : r.throttles, t);
|
|
646
646
|
return { key: e, until: Date.now() + s, ...n !== void 0 && { throttles: n }, ...i && { maintenance: i } };
|
|
647
|
-
},
|
|
647
|
+
}, Bn = ["ApiError", "NotFoundError", "UnauthorisedError", "SchemaValidationError", "ParsingError"], $t = (e) => e instanceof Error && Bn.includes(e.name) ? e : void 0, ur = (e) => {
|
|
648
648
|
let r = $t(e);
|
|
649
649
|
return (r == null ? void 0 : r.name) === "ApiError" ? r : void 0;
|
|
650
650
|
};
|
|
651
|
-
async function
|
|
652
|
-
var
|
|
653
|
-
let
|
|
651
|
+
async function Pn({ chat: e, next: r, end: t, node: s, logger: n, apiClient: i, submissions: a, analytics: o, flow: c, applicationRecovery: f, setApplicationRecovery: p, forceSubmitConfirmation: g, flowType: m, run: b, persistWriteBarrier: k, signal: w, onSubmitNetworkError: C, settledOutcomes: A, t: v }) {
|
|
652
|
+
var D, R;
|
|
653
|
+
let N = async ({ redirect_url: T, message: j, button_text: E }) => {
|
|
654
654
|
let { anonymous_id: F, session_id: B } = o.getSessionInfo();
|
|
655
655
|
await e.sendMessage({ type: "text", author: "bot", text: j ?? v("submission_redirect_message") });
|
|
656
656
|
try {
|
|
657
|
-
let L = new URL(
|
|
657
|
+
let L = new URL(T);
|
|
658
658
|
F && !L.searchParams.has("anonymous_id") && L.searchParams.set("anonymous_id", F), await e.sendMessage({ type: "link", href: L.toString(), text: E ?? v("complete_submission"), onClick: () => {
|
|
659
659
|
if (!B) {
|
|
660
660
|
n.error("session_id not set, cannot log FLOW_REDIRECT event");
|
|
@@ -663,24 +663,24 @@ async function $n({ chat: e, next: r, end: t, node: s, logger: n, apiClient: i,
|
|
|
663
663
|
o.log({ event: "FLOW_REDIRECT", properties: { flow_build: c.build, flow_id: c.id, flow_session_id: B, flow_version: c.version, href: L.toString(), job: c.job } });
|
|
664
664
|
} });
|
|
665
665
|
} catch (L) {
|
|
666
|
-
n.error(`Invalid redirect URL: ${
|
|
666
|
+
n.error(`Invalid redirect URL: ${T}`, L), e.sendMessage({ type: "system", variant: "error", text: v("redirect_url_error") });
|
|
667
667
|
}
|
|
668
668
|
};
|
|
669
|
-
if ((
|
|
670
|
-
let
|
|
671
|
-
return
|
|
669
|
+
if ((D = c.data.startedWriteNodeIds) != null && D.includes(s.id) && (f == null ? void 0 : f.submitNodeId) !== s.id) {
|
|
670
|
+
let T = (R = c.data.submitRedirects) == null ? void 0 : R[s.id];
|
|
671
|
+
return T ? (await N(T), r(s.nextId)) : (await e.sendMessage({ type: "system", variant: "warning", text: v("submission_unknown") }), t());
|
|
672
672
|
}
|
|
673
|
-
let V =
|
|
673
|
+
let V = On(s.id, c.job), M = 0, ee = b.submitAccepted && s.data.skipConfirmation === !0 && (f == null ? void 0 : f.submitNodeId) !== s.id, K = async (T) => {
|
|
674
674
|
var nt, pt, mt, At, at, u, d, h, _;
|
|
675
675
|
let j = ((nt = c.data.submitCooldown) == null ? void 0 : nt.key) === V ? c.data.submitCooldown : void 0;
|
|
676
|
-
j && (j.until =
|
|
676
|
+
j && (j.until = jn(j));
|
|
677
677
|
let E = j == null ? void 0 : j.until;
|
|
678
|
-
(c.data.reviewRequiresSend === !0 && !ee ||
|
|
678
|
+
(c.data.reviewRequiresSend === !0 && !ee || T !== !0 || E !== void 0 && E > Date.now()) && await e.userInput({ type: "submit", key: void 0, config: { label: s.data.submitLabel, ...E !== void 0 && { availableAt: E } } }), ee = !1;
|
|
679
679
|
let F;
|
|
680
680
|
if (s.data.captcha) {
|
|
681
681
|
let y = e.captcha, x = !0;
|
|
682
682
|
try {
|
|
683
|
-
F = await
|
|
683
|
+
F = await ln(i, { signal: w, container: (y == null ? void 0 : y.container()) ?? null, theme: y == null ? void 0 : y.theme, onInteractive: () => {
|
|
684
684
|
e.sendMessage({ type: "text", author: "bot", text: v("captcha_check") }).catch(() => {
|
|
685
685
|
}).then(() => {
|
|
686
686
|
x && (y == null || y.reveal(!0));
|
|
@@ -702,7 +702,7 @@ async function $n({ chat: e, next: r, end: t, node: s, logger: n, apiClient: i,
|
|
|
702
702
|
return;
|
|
703
703
|
let U, te = setTimeout(() => {
|
|
704
704
|
U = e.sendMessage({ type: "loading", semantic: "submission-still-working", text: v("submission_still_working") }).catch((y) => n.error("Failed to send submission progress message", y));
|
|
705
|
-
},
|
|
705
|
+
}, Dn), X, z = await i.fetch("/flow/submit", { method: "POST", body: JSON.stringify({ log_submit: !1, integration_id: s.data.integrationId, anonymous_id: B, session_id: L, job: c.job, flow_build: c.build, ...F !== void 0 && { captcha_token: F }, submissions: Ms(c.nodes, Ls(a || {}, s.data.submitKeys)), pre_apply: Ur(c.nodes, a || {}, c.data.flowSessionId) }) }).catch((y) => {
|
|
706
706
|
X = y;
|
|
707
707
|
let x = ur(y);
|
|
708
708
|
return (x == null ? void 0 : x.data) !== void 0 ? x.data : y;
|
|
@@ -711,38 +711,38 @@ async function $n({ chat: e, next: r, end: t, node: s, logger: n, apiClient: i,
|
|
|
711
711
|
return;
|
|
712
712
|
if (X !== void 0 && !$t(X) && C)
|
|
713
713
|
return await C(X, w), K(!0);
|
|
714
|
-
c.data.stagingDestination =
|
|
715
|
-
let rt = (mt = ur(X)) == null ? void 0 : mt.status, $e = typeof rt == "number" ? rt : void 0, O =
|
|
716
|
-
Ae &&
|
|
717
|
-
let qe =
|
|
714
|
+
c.data.stagingDestination = Ns(z), s.data.key && e.setSubmission(s.data.key, { type: "integration", value: z });
|
|
715
|
+
let rt = (mt = ur(X)) == null ? void 0 : mt.status, $e = typeof rt == "number" ? rt : void 0, O = Pr(z, $e), Be = O === void 0 && $e === 429, Pe = A === "terminal" && ((O == null ? void 0 : O.outcome) === "closed" || (O == null ? void 0 : O.outcome) === "duplicate"), Ae = c.data.failedAttemptAt, Ne = Ae == null ? void 0 : Ae[V];
|
|
716
|
+
Ae && Ne !== void 0 && Ne > Date.now() && (Ne = Ae[V] = Date.now());
|
|
717
|
+
let qe = Ne !== void 0 && Date.now() - Ne < Rs || ((At = c.data.unconfirmedAttemptKeys) == null ? void 0 : At.includes(V)) === !0, st = (at = $t(X)) == null ? void 0 : at.status, ve = Ts(z, typeof st == "number" ? st : void 0);
|
|
718
718
|
ve && o.log({ event: "FLOW_SUBMIT", properties: { flow_id: c.id, flow_version: c.version, flow_session_id: c.data.flowSessionId, flow_build: c.build, service: ve.service, response: ve.response, captured: (z == null ? void 0 : z.captured) === !0, flow_type: (m == null ? void 0 : m()) ?? "CHATBOT_DRAWER", job: c.job, ...(O == null ? void 0 : O.outcome) === "duplicate" && { outcome: qe ? "duplicate_after_own_attempt" : "duplicate" }, ...ve.outcome && { outcome: ve.outcome } } });
|
|
719
719
|
let Ue = sr(z) || (z == null ? void 0 : z.success) === !0;
|
|
720
720
|
if ((Ue || nr(z)) && (b.submitAccepted = !0), Ue && ((u = c.data.submitCooldown) == null ? void 0 : u.throttles) !== void 0 && (delete c.data.submitCooldown.throttles, await k().catch((y) => n.error("Failed to persist submit cooldown reset", y))), sr(z)) {
|
|
721
721
|
let { redirect_url: y, message: x, button_text: I } = z.integration_response.data, $ = { redirect_url: y, message: x, button_text: I };
|
|
722
|
-
return w.aborted ? void 0 : (c.data.submitRedirects = { ...c.data.submitRedirects, [s.id]: $ }, await k().catch((P) => n.error("Failed to persist submit redirect", P)), await
|
|
722
|
+
return w.aborted ? void 0 : (c.data.submitRedirects = { ...c.data.submitRedirects, [s.id]: $ }, await k().catch((P) => n.error("Failed to persist submit redirect", P)), await N($), r(s.nextId));
|
|
723
723
|
}
|
|
724
724
|
let ht = nr(z);
|
|
725
725
|
if (ht)
|
|
726
726
|
return await e.sendMessage({ type: "system", variant: "success", text: ht.message ?? v("submission_pending") }), r(s.nextId);
|
|
727
727
|
if ((z == null ? void 0 : z.success) === !0)
|
|
728
728
|
return s.data.skipConfirmation !== !0 && await e.sendMessage({ type: "system", variant: "success", text: v("submission_completed") }), r(s.nextId);
|
|
729
|
-
let We = Ds(O), ze = We !== void 0 && ((d = a == null ? void 0 : a[We]) == null ? void 0 : d.type) === "file" ? We : void 0,
|
|
730
|
-
if (!
|
|
731
|
-
if (n.error(X ?? O.message),
|
|
732
|
-
return e.setSubmission(ze, null), await p({ fileQuestionNodeId:
|
|
729
|
+
let We = Ds(O), ze = We !== void 0 && ((d = a == null ? void 0 : a[We]) == null ? void 0 : d.type) === "file" ? We : void 0, Re = ze === void 0 ? void 0 : c.nodes.find((y) => y.type === "question-file" && y.data.key === ze);
|
|
730
|
+
if (!Re && !Pe && !ar(O) && (c.data.submitCooldown = $n(V, j, O)), (O == null ? void 0 : O.outcome) !== "duplicate" && !Be && (c.data.failedAttemptAt = { ...c.data.failedAttemptAt, [V]: Date.now() }, (h = c.data.unconfirmedAttemptKeys) != null && h.includes(V) && (c.data.unconfirmedAttemptKeys = c.data.unconfirmedAttemptKeys.filter((y) => y !== V))), (O == null ? void 0 : O.verdict) === "not_submitted" || (O == null ? void 0 : O.outcome) === "duplicate" || (O == null ? void 0 : O.outcome) === "closed" || Be || Os(z, $e) ? (W || (c.data.startedWriteNodeIds = (_ = c.data.startedWriteNodeIds) == null ? void 0 : _.filter((y) => y !== s.id)), (f == null ? void 0 : f.submitNodeId) === s.id && await p(f), await k().catch((y) => n.error("Failed to persist application write barrier release", y))) : await k().catch((y) => n.error("Failed to persist submit cooldown", y)), O) {
|
|
731
|
+
if (n.error(X ?? O.message), Re && ze !== void 0)
|
|
732
|
+
return e.setSubmission(ze, null), await p({ fileQuestionNodeId: Re.id, submitNodeId: s.id }), await e.sendMessage({ type: "system", variant: "error", text: v("submission_unreadable_document") }), r(Re.id);
|
|
733
733
|
if (O.outcome === "duplicate")
|
|
734
734
|
return await e.sendMessage({ type: "system", variant: Pe ? "success" : "info", semantic: "submission-duplicate", text: v(qe ? "submission_duplicate_earlier_attempt" : "submission_duplicate") }), Pe ? (delete c.data.submitCooldown, t()) : K(!1);
|
|
735
735
|
if (O.outcome === "closed")
|
|
736
736
|
return await e.sendMessage({ type: "system", variant: "info", semantic: "submission-closed", text: v("submission_closed") }), Pe ? (delete c.data.submitCooldown, t()) : K(!1);
|
|
737
|
-
let y =
|
|
738
|
-
return y ? (await e.sendMessage({ type: "system", variant: "warning", text: y.until === void 0 ? v("submission_provider_maintenance_later") : v("submission_provider_maintenance", { time:
|
|
737
|
+
let y = js(O);
|
|
738
|
+
return y ? (await e.sendMessage({ type: "system", variant: "warning", text: y.until === void 0 ? v("submission_provider_maintenance_later") : v("submission_provider_maintenance", { time: Wr(y.until, void 0) }) }), K(!1)) : O.outcome === "unknown" ? (await e.sendMessage({ type: "system", variant: "warning", text: v($s(O) ? "submission_unknown_do_not_resubmit" : "submission_unknown") }), K(!1)) : ar(O) ? Bs(z) ? (await e.sendMessage({ type: "text", author: "bot", text: O.message }), K(!1)) : (M === 0 && await e.sendMessage({ type: "system", variant: "warning", text: v("captcha_failed") }), M++, K(M <= Fn)) : Ps(O) ? (await e.sendMessage({ type: "system", variant: "error", text: v("submission_retryable") }), K(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: v("submission_failed") }), t());
|
|
739
739
|
}
|
|
740
740
|
return n.error(X ?? z), Be ? (await e.sendMessage({ type: "system", variant: "error", text: v("submission_retryable") }), K(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: v("submission_failed") }), t());
|
|
741
741
|
};
|
|
742
742
|
await K(g === !0 && !ee ? !1 : s.data.skipConfirmation);
|
|
743
743
|
}
|
|
744
|
-
var
|
|
745
|
-
if (!
|
|
744
|
+
var qn = /{{\s*\$context\.job\.apply_url\s*(?:\|[^}]*)?}}/, Un = (e, r) => {
|
|
745
|
+
if (!qn.test(e))
|
|
746
746
|
return !1;
|
|
747
747
|
try {
|
|
748
748
|
let { protocol: t } = new URL(r);
|
|
@@ -751,47 +751,47 @@ var Bn = /{{\s*\$context\.job\.apply_url\s*(?:\|[^}]*)?}}/, Pn = (e, r) => {
|
|
|
751
751
|
return !1;
|
|
752
752
|
}
|
|
753
753
|
};
|
|
754
|
-
async function
|
|
754
|
+
async function Wn({ chat: e, next: r, node: t, submissions: s, context: n, analytics: i, flow: a }) {
|
|
755
755
|
let o = he(t.data.href, { submissions: s, context: n }), { flowSessionId: c } = a.data;
|
|
756
|
-
await e.sendMessage({ type: "link", href: o, text: he(t.data.cta, { submissions: s, context: n }), ...
|
|
756
|
+
await e.sendMessage({ type: "link", href: o, text: he(t.data.cta, { submissions: s, context: n }), ...Un(t.data.href, o) && { onClick: () => {
|
|
757
757
|
i.log({ event: "FLOW_REDIRECT", properties: { flow_build: a.build, flow_id: a.id, flow_session_id: c, flow_version: a.version, href: o, job: a.job } });
|
|
758
758
|
} } }), r(t.nextId);
|
|
759
759
|
}
|
|
760
|
-
async function
|
|
761
|
-
r(
|
|
760
|
+
async function zn({ submissions: e, next: r, node: t, context: s }) {
|
|
761
|
+
r(In(t, { submissions: e, context: s }) ? t.branchId : t.nextId);
|
|
762
762
|
}
|
|
763
|
-
async function
|
|
763
|
+
async function Hn({ chat: e, next: r, node: t, submissions: s, context: n }) {
|
|
764
764
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.text, { submissions: s, context: n }) }), r(t.nextId);
|
|
765
765
|
}
|
|
766
|
-
async function
|
|
766
|
+
async function Kn({ chat: e, next: r, node: t }) {
|
|
767
767
|
await e.sendMessage({ author: "bot", type: "image", url: t.data.url, height: t.data.height, width: t.data.width }), r(t.nextId);
|
|
768
768
|
}
|
|
769
|
-
async function
|
|
769
|
+
async function Gn({ chat: e, next: r, node: t, submissions: s, context: n, t: i, dateEchoLocale: a }) {
|
|
770
770
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: s, context: n }) });
|
|
771
771
|
let o = t.data.format === "phone" ? await e.userInput({ key: t.data.key, type: "phone", config: { optional: t.data.optional, placeholder: t.data.placeholder, minChars: t.data.minChars, maxChars: t.data.maxChars, submissionFormat: "text", defaultValue: {} } }) : await e.userInput({ key: t.data.key, type: "text", config: { optional: t.data.optional, placeholder: t.data.placeholder, format: t.data.format, maxChars: t.data.maxChars, minChars: t.data.minChars, multiline: t.data.format === "text" && t.data.multiline === !0 } });
|
|
772
|
-
o === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: o.type === "phone" ? vt(o.value) : t.data.format === "date" && a !== void 0 ?
|
|
772
|
+
o === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: o.type === "phone" ? vt(o.value) : t.data.format === "date" && a !== void 0 ? Fs(o.value, a) : o.value }), r(t.nextId);
|
|
773
773
|
}
|
|
774
|
-
async function
|
|
774
|
+
async function Jn({ chat: e, next: r, node: t, submissions: s, context: n, t: i }) {
|
|
775
775
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: s, context: n }) });
|
|
776
776
|
let a = await e.userInput({ key: t.data.key, type: "number", config: { max: t.data.max, min: t.data.min, optional: t.data.optional, placeholder: t.data.placeholder, decimalCases: t.data.decimalCases } });
|
|
777
777
|
a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.value.toString() }), r(t.nextId);
|
|
778
778
|
}
|
|
779
|
-
async function
|
|
779
|
+
async function Zn({ chat: e, next: r, node: t, submissions: s, context: n, t: i }) {
|
|
780
780
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: s, context: n }) });
|
|
781
781
|
let a = await e.userInput({ key: t.data.key, type: "phone", config: { minChars: t.data.minChars, defaultValue: { countryCode: t.data.defaultCountryCode }, placeholder: t.data.placeholder, submissionFormat: "phone", optional: t.data.optional } });
|
|
782
782
|
a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.type === "phone" ? vt(a.value) : a.value }), r(t.nextId);
|
|
783
783
|
}
|
|
784
|
-
async function
|
|
784
|
+
async function Xn({ chat: e, next: r, node: t, submissions: s, context: n, t: i }) {
|
|
785
785
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: s, context: n }) });
|
|
786
786
|
let a = await e.userInput({ key: t.data.key, type: "multiple-choice", config: t.data });
|
|
787
787
|
a.value.length === 0 ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: t.data.options.filter((o) => a.value.includes(o.value)).map((o) => o.label).join(", ") }), r(t.nextId);
|
|
788
788
|
}
|
|
789
|
-
async function
|
|
789
|
+
async function Yn({ chat: e, next: r, node: t, submissions: s, context: n, t: i }) {
|
|
790
790
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: s, context: n }) });
|
|
791
791
|
let a = await e.userInput({ key: t.data.key, type: "boolean", config: { optional: t.data.optional, labels: { true: t.data.trueLabel, false: t.data.falseLabel } } });
|
|
792
792
|
a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.value === !0 ? t.data.trueLabel : t.data.falseLabel }), r(t.nextId);
|
|
793
793
|
}
|
|
794
|
-
async function
|
|
794
|
+
async function Qn({ chat: e, next: r, node: t, t: s }) {
|
|
795
795
|
await e.sendMessage({ author: "bot", type: "text", text: t.data.question });
|
|
796
796
|
let n = await e.userInput({ type: "address", key: t.data.key, config: { optional: t.data.optional, keys: t.data.keys, line2Required: t.data.line2Required, placeholder: t.data.placeholder } });
|
|
797
797
|
if (n === null)
|
|
@@ -802,7 +802,7 @@ async function Xn({ chat: e, next: r, node: t, t: s }) {
|
|
|
802
802
|
}
|
|
803
803
|
return r(t.nextId);
|
|
804
804
|
}
|
|
805
|
-
async function
|
|
805
|
+
async function ea({ node: e, chat: r, next: t, submissions: s, context: n, t: i }) {
|
|
806
806
|
await r.sendMessage({ author: "bot", type: "text", text: he(e.data.question, { submissions: s, context: n }) });
|
|
807
807
|
let a = await r.userInput({ key: e.data.key, type: "file", config: { optional: e.data.optional, extensions: e.data.extensions, fileSizeLimitKib: e.data.maxSizeKb ?? 10 * 1024, allowMultiple: e.data.multiple === !0 } });
|
|
808
808
|
if (a === null)
|
|
@@ -812,12 +812,12 @@ async function Yn({ node: e, chat: r, next: t, submissions: s, context: n, t: i
|
|
|
812
812
|
await r.sendMessage({ author: "user", type: "file", fileName: o.name, fileSizeKb: o.sizeKb });
|
|
813
813
|
return t(e.nextId);
|
|
814
814
|
}
|
|
815
|
-
async function
|
|
815
|
+
async function ta({ chat: e, end: r, node: t }) {
|
|
816
816
|
await e.sendMessage({ type: "system", variant: "info", text: t.data.systemMessage }), r();
|
|
817
817
|
}
|
|
818
|
-
async function
|
|
819
|
-
let f =
|
|
820
|
-
if (s.setSubmission(e.data.key, { type: "integration", value: g }),
|
|
818
|
+
async function ra({ node: e, flow: r, submissions: t, chat: s, next: n, apiClient: i, analytics: a, signal: o, context: c }) {
|
|
819
|
+
let f = Vs(r.nodes, t || {}), { answers: p, ...g } = f;
|
|
820
|
+
if (s.setSubmission(e.data.key, { type: "integration", value: g }), An(r, i, { ...a.getSessionInfo(), job: r.job, flow_build: r.build, pre_apply: Ur(r.nodes, t || {}, r.data.flowSessionId) }, o), f.status !== "skipped") {
|
|
821
821
|
let m = [f.status === "unavailable" ? "We could not prepare your pre-apply summary. You can still continue to your application." : f.hasHardConcerns ? e.data.messages.hard : f.hasAdvisoryConcerns ? e.data.messages.advisory : e.data.messages.matched];
|
|
822
822
|
for (let b of ["hard", "advisory"]) {
|
|
823
823
|
let k = p.filter((w) => !w.matched && w.severity === b);
|
|
@@ -845,7 +845,7 @@ const dr = (e, r, t) => {
|
|
|
845
845
|
},
|
|
846
846
|
customProperties: (s = r.analytics) == null ? void 0 : s.customProperties
|
|
847
847
|
});
|
|
848
|
-
}, Bt = "resume-prompt",
|
|
848
|
+
}, Bt = "resume-prompt", sa = async ({
|
|
849
849
|
chatService: e,
|
|
850
850
|
t: r,
|
|
851
851
|
signal: t
|
|
@@ -916,19 +916,19 @@ function wt(e) {
|
|
|
916
916
|
}
|
|
917
917
|
var Mt;
|
|
918
918
|
// @__NO_SIDE_EFFECTS__
|
|
919
|
-
function
|
|
919
|
+
function na(e) {
|
|
920
920
|
return Mt == null ? void 0 : Mt.get(e);
|
|
921
921
|
}
|
|
922
922
|
var Lt;
|
|
923
923
|
// @__NO_SIDE_EFFECTS__
|
|
924
|
-
function
|
|
924
|
+
function aa(e) {
|
|
925
925
|
return Lt == null ? void 0 : Lt.get(e);
|
|
926
926
|
}
|
|
927
|
-
var
|
|
927
|
+
var Nt;
|
|
928
928
|
// @__NO_SIDE_EFFECTS__
|
|
929
|
-
function
|
|
929
|
+
function ia(e, r) {
|
|
930
930
|
var t;
|
|
931
|
-
return (t =
|
|
931
|
+
return (t = Nt == null ? void 0 : Nt.get(e)) == null ? void 0 : t.get(r);
|
|
932
932
|
}
|
|
933
933
|
// @__NO_SIDE_EFFECTS__
|
|
934
934
|
function Xe(e) {
|
|
@@ -950,7 +950,7 @@ function se(e, r, t, s, n) {
|
|
|
950
950
|
lang: s.lang,
|
|
951
951
|
abortEarly: s.abortEarly,
|
|
952
952
|
abortPipeEarly: s.abortPipeEarly
|
|
953
|
-
}, f = e.kind === "schema", p = (n == null ? void 0 : n.message) ?? e.message ?? /* @__PURE__ */
|
|
953
|
+
}, f = e.kind === "schema", p = (n == null ? void 0 : n.message) ?? e.message ?? /* @__PURE__ */ ia(e.reference, c.lang) ?? (f ? /* @__PURE__ */ aa(c.lang) : null) ?? s.message ?? /* @__PURE__ */ na(c.lang);
|
|
954
954
|
p !== void 0 && (c.message = typeof p == "function" ? (
|
|
955
955
|
// @ts-expect-error
|
|
956
956
|
p(c)
|
|
@@ -967,16 +967,16 @@ function ge(e) {
|
|
|
967
967
|
};
|
|
968
968
|
}
|
|
969
969
|
// @__NO_SIDE_EFFECTS__
|
|
970
|
-
function
|
|
970
|
+
function oa(e, r) {
|
|
971
971
|
return Object.hasOwn(e, r) && r !== "__proto__" && r !== "prototype" && r !== "constructor";
|
|
972
972
|
}
|
|
973
973
|
// @__NO_SIDE_EFFECTS__
|
|
974
|
-
function
|
|
974
|
+
function la(e, r) {
|
|
975
975
|
const t = [...new Set(e)];
|
|
976
976
|
return t.length > 1 ? `(${t.join(` ${r} `)})` : t[0] ?? "never";
|
|
977
977
|
}
|
|
978
978
|
// @__NO_SIDE_EFFECTS__
|
|
979
|
-
function
|
|
979
|
+
function ca(e) {
|
|
980
980
|
if (e.path) {
|
|
981
981
|
let r = "";
|
|
982
982
|
for (const t of e.path)
|
|
@@ -988,7 +988,7 @@ function oa(e) {
|
|
|
988
988
|
}
|
|
989
989
|
return null;
|
|
990
990
|
}
|
|
991
|
-
var
|
|
991
|
+
var ua = class extends Error {
|
|
992
992
|
/**
|
|
993
993
|
* Creates a Valibot error with useful information.
|
|
994
994
|
*
|
|
@@ -997,13 +997,13 @@ var la = class extends Error {
|
|
|
997
997
|
constructor(e) {
|
|
998
998
|
super(e[0].message), this.name = "ValiError", this.issues = e;
|
|
999
999
|
}
|
|
1000
|
-
},
|
|
1000
|
+
}, da = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
|
|
1001
1001
|
// @__NO_SIDE_EFFECTS__
|
|
1002
|
-
function
|
|
1002
|
+
function Qr(e, r) {
|
|
1003
1003
|
return {
|
|
1004
1004
|
kind: "validation",
|
|
1005
1005
|
type: "check",
|
|
1006
|
-
reference:
|
|
1006
|
+
reference: Qr,
|
|
1007
1007
|
async: !1,
|
|
1008
1008
|
expects: null,
|
|
1009
1009
|
requirement: e,
|
|
@@ -1014,14 +1014,14 @@ function Yr(e, r) {
|
|
|
1014
1014
|
};
|
|
1015
1015
|
}
|
|
1016
1016
|
// @__NO_SIDE_EFFECTS__
|
|
1017
|
-
function
|
|
1017
|
+
function es(e) {
|
|
1018
1018
|
return {
|
|
1019
1019
|
kind: "validation",
|
|
1020
1020
|
type: "email",
|
|
1021
|
-
reference:
|
|
1021
|
+
reference: es,
|
|
1022
1022
|
expects: null,
|
|
1023
1023
|
async: !1,
|
|
1024
|
-
requirement:
|
|
1024
|
+
requirement: da,
|
|
1025
1025
|
message: e,
|
|
1026
1026
|
"~run"(r, t) {
|
|
1027
1027
|
return r.typed && !this.requirement.test(r.value) && se(this, "email", r, t), r;
|
|
@@ -1046,11 +1046,11 @@ function ct(e, r) {
|
|
|
1046
1046
|
};
|
|
1047
1047
|
}
|
|
1048
1048
|
// @__NO_SIDE_EFFECTS__
|
|
1049
|
-
function
|
|
1049
|
+
function ts(e, r) {
|
|
1050
1050
|
return {
|
|
1051
1051
|
kind: "validation",
|
|
1052
1052
|
type: "max_value",
|
|
1053
|
-
reference:
|
|
1053
|
+
reference: ts,
|
|
1054
1054
|
async: !1,
|
|
1055
1055
|
expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ Xe(e)}`,
|
|
1056
1056
|
requirement: e,
|
|
@@ -1080,11 +1080,11 @@ function Ze(e, r) {
|
|
|
1080
1080
|
};
|
|
1081
1081
|
}
|
|
1082
1082
|
// @__NO_SIDE_EFFECTS__
|
|
1083
|
-
function
|
|
1083
|
+
function rs(e, r) {
|
|
1084
1084
|
return {
|
|
1085
1085
|
kind: "validation",
|
|
1086
1086
|
type: "min_value",
|
|
1087
|
-
reference:
|
|
1087
|
+
reference: rs,
|
|
1088
1088
|
async: !1,
|
|
1089
1089
|
expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ Xe(e)}`,
|
|
1090
1090
|
requirement: e,
|
|
@@ -1125,11 +1125,11 @@ function Kt(e) {
|
|
|
1125
1125
|
};
|
|
1126
1126
|
}
|
|
1127
1127
|
// @__NO_SIDE_EFFECTS__
|
|
1128
|
-
function
|
|
1128
|
+
function ss(e) {
|
|
1129
1129
|
return {
|
|
1130
1130
|
kind: "validation",
|
|
1131
1131
|
type: "url",
|
|
1132
|
-
reference:
|
|
1132
|
+
reference: ss,
|
|
1133
1133
|
async: !1,
|
|
1134
1134
|
expects: null,
|
|
1135
1135
|
requirement(r) {
|
|
@@ -1146,7 +1146,7 @@ function rs(e) {
|
|
|
1146
1146
|
};
|
|
1147
1147
|
}
|
|
1148
1148
|
// @__NO_SIDE_EFFECTS__
|
|
1149
|
-
function
|
|
1149
|
+
function fa(e, r, t) {
|
|
1150
1150
|
return typeof e.fallback == "function" ? (
|
|
1151
1151
|
// @ts-expect-error
|
|
1152
1152
|
e.fallback(r, t)
|
|
@@ -1156,7 +1156,7 @@ function ua(e, r, t) {
|
|
|
1156
1156
|
);
|
|
1157
1157
|
}
|
|
1158
1158
|
// @__NO_SIDE_EFFECTS__
|
|
1159
|
-
function
|
|
1159
|
+
function ns(e, r, t) {
|
|
1160
1160
|
return typeof e.default == "function" ? (
|
|
1161
1161
|
// @ts-expect-error
|
|
1162
1162
|
e.default(r, t)
|
|
@@ -1166,11 +1166,11 @@ function ss(e, r, t) {
|
|
|
1166
1166
|
);
|
|
1167
1167
|
}
|
|
1168
1168
|
// @__NO_SIDE_EFFECTS__
|
|
1169
|
-
function
|
|
1169
|
+
function as(e, r) {
|
|
1170
1170
|
return {
|
|
1171
1171
|
kind: "schema",
|
|
1172
1172
|
type: "array",
|
|
1173
|
-
reference:
|
|
1173
|
+
reference: as,
|
|
1174
1174
|
expects: "Array",
|
|
1175
1175
|
async: !1,
|
|
1176
1176
|
item: e,
|
|
@@ -1209,11 +1209,11 @@ function ns(e, r) {
|
|
|
1209
1209
|
};
|
|
1210
1210
|
}
|
|
1211
1211
|
// @__NO_SIDE_EFFECTS__
|
|
1212
|
-
function
|
|
1212
|
+
function is(e) {
|
|
1213
1213
|
return {
|
|
1214
1214
|
kind: "schema",
|
|
1215
1215
|
type: "boolean",
|
|
1216
|
-
reference:
|
|
1216
|
+
reference: is,
|
|
1217
1217
|
expects: "boolean",
|
|
1218
1218
|
async: !1,
|
|
1219
1219
|
message: e,
|
|
@@ -1226,11 +1226,11 @@ function as(e) {
|
|
|
1226
1226
|
};
|
|
1227
1227
|
}
|
|
1228
1228
|
// @__NO_SIDE_EFFECTS__
|
|
1229
|
-
function
|
|
1229
|
+
function os(e) {
|
|
1230
1230
|
return {
|
|
1231
1231
|
kind: "schema",
|
|
1232
1232
|
type: "number",
|
|
1233
|
-
reference:
|
|
1233
|
+
reference: os,
|
|
1234
1234
|
expects: "number",
|
|
1235
1235
|
async: !1,
|
|
1236
1236
|
message: e,
|
|
@@ -1267,7 +1267,7 @@ function Ce(e, r) {
|
|
|
1267
1267
|
const c = a in n ? (
|
|
1268
1268
|
// @ts-expect-error
|
|
1269
1269
|
n[a]
|
|
1270
|
-
) : /* @__PURE__ */
|
|
1270
|
+
) : /* @__PURE__ */ ns(o), f = o["~run"]({ value: c }, s);
|
|
1271
1271
|
if (f.issues) {
|
|
1272
1272
|
const p = {
|
|
1273
1273
|
type: "object",
|
|
@@ -1285,7 +1285,7 @@ function Ce(e, r) {
|
|
|
1285
1285
|
}
|
|
1286
1286
|
f.typed || (t.typed = !1), t.value[a] = f.value;
|
|
1287
1287
|
} else if (o.fallback !== void 0)
|
|
1288
|
-
t.value[a] = /* @__PURE__ */
|
|
1288
|
+
t.value[a] = /* @__PURE__ */ fa(o);
|
|
1289
1289
|
else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (se(this, "key", t, s, {
|
|
1290
1290
|
input: void 0,
|
|
1291
1291
|
expected: `"${a}"`,
|
|
@@ -1322,17 +1322,17 @@ function Je(e, r) {
|
|
|
1322
1322
|
return /* @__PURE__ */ ge(this);
|
|
1323
1323
|
},
|
|
1324
1324
|
"~run"(t, s) {
|
|
1325
|
-
return t.value === void 0 && (this.default !== void 0 && (t.value = /* @__PURE__ */
|
|
1325
|
+
return t.value === void 0 && (this.default !== void 0 && (t.value = /* @__PURE__ */ ns(this, t, s)), t.value === void 0) ? (t.typed = !0, t) : this.wrapped["~run"](t, s);
|
|
1326
1326
|
}
|
|
1327
1327
|
};
|
|
1328
1328
|
}
|
|
1329
1329
|
// @__NO_SIDE_EFFECTS__
|
|
1330
|
-
function
|
|
1330
|
+
function ls(e, r) {
|
|
1331
1331
|
return {
|
|
1332
1332
|
kind: "schema",
|
|
1333
1333
|
type: "picklist",
|
|
1334
|
-
reference:
|
|
1335
|
-
expects: /* @__PURE__ */
|
|
1334
|
+
reference: ls,
|
|
1335
|
+
expects: /* @__PURE__ */ la(e.map(Xe), "|"),
|
|
1336
1336
|
async: !1,
|
|
1337
1337
|
options: e,
|
|
1338
1338
|
message: r,
|
|
@@ -1345,11 +1345,11 @@ function os(e, r) {
|
|
|
1345
1345
|
};
|
|
1346
1346
|
}
|
|
1347
1347
|
// @__NO_SIDE_EFFECTS__
|
|
1348
|
-
function
|
|
1348
|
+
function cs(e, r, t) {
|
|
1349
1349
|
return {
|
|
1350
1350
|
kind: "schema",
|
|
1351
1351
|
type: "record",
|
|
1352
|
-
reference:
|
|
1352
|
+
reference: cs,
|
|
1353
1353
|
expects: "Object",
|
|
1354
1354
|
async: !1,
|
|
1355
1355
|
key: e,
|
|
@@ -1364,7 +1364,7 @@ function ls(e, r, t) {
|
|
|
1364
1364
|
if (i && typeof i == "object") {
|
|
1365
1365
|
s.typed = !0, s.value = {};
|
|
1366
1366
|
for (const c in i)
|
|
1367
|
-
if (/* @__PURE__ */
|
|
1367
|
+
if (/* @__PURE__ */ oa(i, c)) {
|
|
1368
1368
|
const f = i[c], p = this.key["~run"]({ value: c }, n);
|
|
1369
1369
|
if (p.issues) {
|
|
1370
1370
|
const m = {
|
|
@@ -1425,14 +1425,14 @@ function le(e) {
|
|
|
1425
1425
|
}
|
|
1426
1426
|
};
|
|
1427
1427
|
}
|
|
1428
|
-
function
|
|
1428
|
+
function ha(e, r, t) {
|
|
1429
1429
|
const s = e["~run"]({ value: r }, /* @__PURE__ */ wt(t));
|
|
1430
1430
|
if (s.issues)
|
|
1431
|
-
throw new
|
|
1431
|
+
throw new ua(s.issues);
|
|
1432
1432
|
return s.value;
|
|
1433
1433
|
}
|
|
1434
1434
|
// @__NO_SIDE_EFFECTS__
|
|
1435
|
-
function
|
|
1435
|
+
function pa(e, r) {
|
|
1436
1436
|
const t = {};
|
|
1437
1437
|
for (const s in e.entries)
|
|
1438
1438
|
t[s] = !r || r.includes(s) ? /* @__PURE__ */ Je(e.entries[s]) : e.entries[s];
|
|
@@ -1466,7 +1466,7 @@ function Me(...e) {
|
|
|
1466
1466
|
};
|
|
1467
1467
|
}
|
|
1468
1468
|
// @__NO_SIDE_EFFECTS__
|
|
1469
|
-
function
|
|
1469
|
+
function ma(e, r, t) {
|
|
1470
1470
|
const s = e["~run"]({ value: r }, /* @__PURE__ */ wt(t));
|
|
1471
1471
|
return {
|
|
1472
1472
|
typed: s.typed,
|
|
@@ -1476,7 +1476,7 @@ function ha(e, r, t) {
|
|
|
1476
1476
|
};
|
|
1477
1477
|
}
|
|
1478
1478
|
// @__NO_SIDE_EFFECTS__
|
|
1479
|
-
async function
|
|
1479
|
+
async function ya(e, r, t) {
|
|
1480
1480
|
const s = await e["~run"](
|
|
1481
1481
|
{ value: r },
|
|
1482
1482
|
/* @__PURE__ */ wt(t)
|
|
@@ -1552,7 +1552,7 @@ const tt = ({
|
|
|
1552
1552
|
}), t("skip")]
|
|
1553
1553
|
});
|
|
1554
1554
|
};
|
|
1555
|
-
var Gt = { Afghanistan: "93", Albania: "355", Algeria: "213", "American Samoa": "1 684", Andorra: "376", Angola: "244", Anguilla: "1 264", Antarctica: "672", "Antigua and Barbuda": "1 268", Argentina: "54", Armenia: "374", Aruba: "297", Australia: "61", Austria: "43", Azerbaijan: "994", Bahrain: "973", Bangladesh: "880", Barbados: "1 246", Belarus: "375", Belgium: "32", Belize: "501", Benin: "229", Bermuda: "1 441", Bhutan: "975", Bolivia: "591", "Bosnia and Herzegovina": "387", Botswana: "267", "Bouvet Island": "47", Brazil: "55", "British Indian Ocean Territory": "246", "British Virgin Islands": "1 284", Brunei: "673", Bulgaria: "359", "Burkina Faso": "226", Burundi: "257", "Cabo Verde": "238", Cambodia: "855", Cameroon: "237", Canada: "1", "Caribbean Netherlands": "599", "Cayman Islands": "1 345", "Central African Republic": "236", Chad: "235", Chile: "56", China: "86", "Christmas Island": "61", "Cocos (Keeling) Islands": "61", Colombia: "57", Comoros: "269", "Cook Islands": "682", "Costa Rica": "506", Croatia: "385", Cuba: "53", Curaçao: "599", Cyprus: "357", Czechia: "420", "Côte d'Ivoire": "225", "Democratic Republic of the Congo": "243", Denmark: "45", Djibouti: "253", "Dominican Republic": "1 809", Ecuador: "593", Egypt: "20", "El Salvador": "503", "Equatorial Guinea": "240", Eritrea: "291", Estonia: "372", Eswatini: "268", Ethiopia: "251", "Falkland Islands (Islas Malvinas)": "500", "Faroe Islands": "298", Fiji: "679", Finland: "358", France: "33", "French Guiana": "594", "French Polynesia": "689", "French Southern and Antarctic Lands": "262", Gabon: "241", Georgia: "995", Germany: "49", Ghana: "233", Gibraltar: "350", Greece: "30", Greenland: "299", Grenada: "1 473", Guadeloupe: "590", Guam: "1 671", Guatemala: "502", Guernsey: "44", Guinea: "224", "Guinea-Bissau": "245", Guyana: "592", Haiti: "509", Honduras: "504", "Hong Kong": "852", Hungary: "36", Iceland: "354", India: "91", Indonesia: "62", Iran: "98", Iraq: "964", Ireland: "353", "Isle of Man": "44", Israel: "972", Italy: "39", Jamaica: "1 876", Japan: "81", Jersey: "44", Jordan: "962", Kazakhstan: "7", Kenya: "254", Kiribati: "686", Kosovo: "383", Kuwait: "965", Kyrgyzstan: "996", Laos: "856", Latvia: "371", Lebanon: "961", Lesotho: "266", Liberia: "231", Libya: "218", Liechtenstein: "423", Lithuania: "370", Luxembourg: "352", Macao: "853", Madagascar: "261", Malawi: "265", Malaysia: "60", Maldives: "960", Mali: "223", Malta: "356", "Marshall Islands": "692", Martinique: "596", Mauritania: "222", Mauritius: "230", Mayotte: "262", Mexico: "52", Micronesia: "691", Moldova: "373", Monaco: "377", Mongolia: "976", Montenegro: "382", Montserrat: "1 664", Morocco: "212", Mozambique: "258", "Myanmar (Burma)": "95", Namibia: "264", Nauru: "674", Nepal: "977", Netherlands: "31", "New Caledonia": "687", "New Zealand": "64", Nicaragua: "505", Niger: "227", Nigeria: "234", Niue: "683", "Norfolk Island": "672", "North Korea": "850", "North Macedonia": "389", "Northern Mariana Islands": "1 670", Norway: "47", Oman: "968", Pakistan: "92", Palau: "680", Palestine: "970", Panama: "507", "Papua New Guinea": "675", Paraguay: "595", Peru: "51", Philippines: "63", "Pitcairn Islands": "64", Poland: "48", Portugal: "351", "Puerto Rico": "1 787", Qatar: "974", Romania: "40", Russia: "7", Rwanda: "250", Réunion: "262", "Saint Barthélemy": "590", "Saint Helena, Ascension and Tristan da Cunha": "290", "Saint Kitts and Nevis": "1 869", "Saint Lucia": "1 758", "Saint Martin": "590", "Saint Pierre and Miquelon": "508", "Saint Vincent and the Grenadines": "1 784", Samoa: "685", "San Marino": "378", "Saudi Arabia": "966", Senegal: "221", Serbia: "381", Seychelles: "248", "Sierra Leone": "232", Singapore: "65", "Sint Maarten": "1 721", Slovakia: "421", Slovenia: "386", "Solomon Islands": "677", Somalia: "252", "South Africa": "27", "South Georgia and the South Sandwich Islands": "500", "South Korea": "82", "South Sudan": "211", Spain: "34", "Sri Lanka": "94", Sudan: "249", Suriname: "597", "Svalbard and Jan Mayen": "47", Sweden: "46", Switzerland: "41", Syria: "963", "São Tomé and Príncipe": "239", Taiwan: "886", Tajikistan: "992", Tanzania: "255", Thailand: "66", "The Bahamas": "1 242", "The Gambia": "220", "Timor-Leste": "670", Togo: "228", Tokelau: "690", Tonga: "676", "Trinidad and Tobago": "1 868", Tunisia: "216", Turkmenistan: "993", "Turks and Caicos Islands": "1 649", Tuvalu: "688", Türkiye: "90", "U.S. Virgin Islands": "1 340", Uganda: "256", Ukraine: "380", "United Arab Emirates": "971", "United Kingdom": "44", "United States": "1", "United States Minor Outlying Islands": "1", Uruguay: "598", Uzbekistan: "998", Vanuatu: "678", "Vatican City": "379", Venezuela: "58", Vietnam: "84", "Wallis and Futuna": "681", "Western Sahara": "212", Yemen: "967", Zambia: "260", Zimbabwe: "263", "Åland Islands": "358" },
|
|
1555
|
+
var Gt = { Afghanistan: "93", Albania: "355", Algeria: "213", "American Samoa": "1 684", Andorra: "376", Angola: "244", Anguilla: "1 264", Antarctica: "672", "Antigua and Barbuda": "1 268", Argentina: "54", Armenia: "374", Aruba: "297", Australia: "61", Austria: "43", Azerbaijan: "994", Bahrain: "973", Bangladesh: "880", Barbados: "1 246", Belarus: "375", Belgium: "32", Belize: "501", Benin: "229", Bermuda: "1 441", Bhutan: "975", Bolivia: "591", "Bosnia and Herzegovina": "387", Botswana: "267", "Bouvet Island": "47", Brazil: "55", "British Indian Ocean Territory": "246", "British Virgin Islands": "1 284", Brunei: "673", Bulgaria: "359", "Burkina Faso": "226", Burundi: "257", "Cabo Verde": "238", Cambodia: "855", Cameroon: "237", Canada: "1", "Caribbean Netherlands": "599", "Cayman Islands": "1 345", "Central African Republic": "236", Chad: "235", Chile: "56", China: "86", "Christmas Island": "61", "Cocos (Keeling) Islands": "61", Colombia: "57", Comoros: "269", "Cook Islands": "682", "Costa Rica": "506", Croatia: "385", Cuba: "53", Curaçao: "599", Cyprus: "357", Czechia: "420", "Côte d'Ivoire": "225", "Democratic Republic of the Congo": "243", Denmark: "45", Djibouti: "253", "Dominican Republic": "1 809", Ecuador: "593", Egypt: "20", "El Salvador": "503", "Equatorial Guinea": "240", Eritrea: "291", Estonia: "372", Eswatini: "268", Ethiopia: "251", "Falkland Islands (Islas Malvinas)": "500", "Faroe Islands": "298", Fiji: "679", Finland: "358", France: "33", "French Guiana": "594", "French Polynesia": "689", "French Southern and Antarctic Lands": "262", Gabon: "241", Georgia: "995", Germany: "49", Ghana: "233", Gibraltar: "350", Greece: "30", Greenland: "299", Grenada: "1 473", Guadeloupe: "590", Guam: "1 671", Guatemala: "502", Guernsey: "44", Guinea: "224", "Guinea-Bissau": "245", Guyana: "592", Haiti: "509", Honduras: "504", "Hong Kong": "852", Hungary: "36", Iceland: "354", India: "91", Indonesia: "62", Iran: "98", Iraq: "964", Ireland: "353", "Isle of Man": "44", Israel: "972", Italy: "39", Jamaica: "1 876", Japan: "81", Jersey: "44", Jordan: "962", Kazakhstan: "7", Kenya: "254", Kiribati: "686", Kosovo: "383", Kuwait: "965", Kyrgyzstan: "996", Laos: "856", Latvia: "371", Lebanon: "961", Lesotho: "266", Liberia: "231", Libya: "218", Liechtenstein: "423", Lithuania: "370", Luxembourg: "352", Macao: "853", Madagascar: "261", Malawi: "265", Malaysia: "60", Maldives: "960", Mali: "223", Malta: "356", "Marshall Islands": "692", Martinique: "596", Mauritania: "222", Mauritius: "230", Mayotte: "262", Mexico: "52", Micronesia: "691", Moldova: "373", Monaco: "377", Mongolia: "976", Montenegro: "382", Montserrat: "1 664", Morocco: "212", Mozambique: "258", "Myanmar (Burma)": "95", Namibia: "264", Nauru: "674", Nepal: "977", Netherlands: "31", "New Caledonia": "687", "New Zealand": "64", Nicaragua: "505", Niger: "227", Nigeria: "234", Niue: "683", "Norfolk Island": "672", "North Korea": "850", "North Macedonia": "389", "Northern Mariana Islands": "1 670", Norway: "47", Oman: "968", Pakistan: "92", Palau: "680", Palestine: "970", Panama: "507", "Papua New Guinea": "675", Paraguay: "595", Peru: "51", Philippines: "63", "Pitcairn Islands": "64", Poland: "48", Portugal: "351", "Puerto Rico": "1 787", Qatar: "974", Romania: "40", Russia: "7", Rwanda: "250", Réunion: "262", "Saint Barthélemy": "590", "Saint Helena, Ascension and Tristan da Cunha": "290", "Saint Kitts and Nevis": "1 869", "Saint Lucia": "1 758", "Saint Martin": "590", "Saint Pierre and Miquelon": "508", "Saint Vincent and the Grenadines": "1 784", Samoa: "685", "San Marino": "378", "Saudi Arabia": "966", Senegal: "221", Serbia: "381", Seychelles: "248", "Sierra Leone": "232", Singapore: "65", "Sint Maarten": "1 721", Slovakia: "421", Slovenia: "386", "Solomon Islands": "677", Somalia: "252", "South Africa": "27", "South Georgia and the South Sandwich Islands": "500", "South Korea": "82", "South Sudan": "211", Spain: "34", "Sri Lanka": "94", Sudan: "249", Suriname: "597", "Svalbard and Jan Mayen": "47", Sweden: "46", Switzerland: "41", Syria: "963", "São Tomé and Príncipe": "239", Taiwan: "886", Tajikistan: "992", Tanzania: "255", Thailand: "66", "The Bahamas": "1 242", "The Gambia": "220", "Timor-Leste": "670", Togo: "228", Tokelau: "690", Tonga: "676", "Trinidad and Tobago": "1 868", Tunisia: "216", Turkmenistan: "993", "Turks and Caicos Islands": "1 649", Tuvalu: "688", Türkiye: "90", "U.S. Virgin Islands": "1 340", Uganda: "256", Ukraine: "380", "United Arab Emirates": "971", "United Kingdom": "44", "United States": "1", "United States Minor Outlying Islands": "1", Uruguay: "598", Uzbekistan: "998", Vanuatu: "678", "Vatican City": "379", Venezuela: "58", Vietnam: "84", "Wallis and Futuna": "681", "Western Sahara": "212", Yemen: "967", Zambia: "260", Zimbabwe: "263", "Åland Islands": "358" }, ba = (e) => {
|
|
1556
1556
|
if (e === "")
|
|
1557
1557
|
return { countryCode: "", phoneNumber: "" };
|
|
1558
1558
|
let r = Object.values(Gt).find((s) => e.startsWith(s)) ?? "", t = e.replace(r, "");
|
|
@@ -1568,16 +1568,16 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1568
1568
|
defaultVariants: {
|
|
1569
1569
|
optional: !1
|
|
1570
1570
|
}
|
|
1571
|
-
}),
|
|
1571
|
+
}), ga = "https://api.mapbox.com/search/searchbox/v1/suggest", va = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", xa = (e) => atob(e).split("").reverse().join(""), we = /* @__PURE__ */ Ce({
|
|
1572
1572
|
name: /* @__PURE__ */ le()
|
|
1573
|
-
}),
|
|
1574
|
-
suggestions: /* @__PURE__ */
|
|
1573
|
+
}), wa = /* @__PURE__ */ Ce({
|
|
1574
|
+
suggestions: /* @__PURE__ */ as(/* @__PURE__ */ Ce({
|
|
1575
1575
|
feature_type: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1576
1576
|
full_address: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1577
1577
|
place_formatted: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1578
1578
|
name: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1579
1579
|
mapbox_id: /* @__PURE__ */ le(),
|
|
1580
|
-
context: /* @__PURE__ */
|
|
1580
|
+
context: /* @__PURE__ */ pa(/* @__PURE__ */ Ce({
|
|
1581
1581
|
address: we,
|
|
1582
1582
|
street: we,
|
|
1583
1583
|
neighborhood: we,
|
|
@@ -1589,27 +1589,27 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1589
1589
|
country: we
|
|
1590
1590
|
}))
|
|
1591
1591
|
}))
|
|
1592
|
-
}),
|
|
1592
|
+
}), _a = ({
|
|
1593
1593
|
logger: e,
|
|
1594
1594
|
t: r
|
|
1595
|
-
}) =>
|
|
1595
|
+
}) => zs(() => {
|
|
1596
1596
|
var s;
|
|
1597
1597
|
const t = (s = q.current$.peek().flow) == null ? void 0 : s.data.flowSessionId;
|
|
1598
1598
|
return t ? {
|
|
1599
1599
|
enabled: !0,
|
|
1600
1600
|
getPredictions: async (n) => {
|
|
1601
1601
|
var g;
|
|
1602
|
-
const i = new URL(
|
|
1602
|
+
const i = new URL(ga);
|
|
1603
1603
|
i.searchParams.set("q", n), i.searchParams.set("session_token", t);
|
|
1604
1604
|
const a = (g = q.current$.peek().flow) == null ? void 0 : g.locationOrigin;
|
|
1605
|
-
a && a.lat !== void 0 && a.lng !== void 0 && a.lat >= -90 && a.lat <= 90 && a.lng >= -180 && a.lng <= 180 && i.searchParams.set("proximity", `${a.lng},${a.lat}`), i.searchParams.set("access_token",
|
|
1605
|
+
a && a.lat !== void 0 && a.lng !== void 0 && a.lat >= -90 && a.lat <= 90 && a.lng >= -180 && a.lng <= 180 && i.searchParams.set("proximity", `${a.lng},${a.lat}`), i.searchParams.set("access_token", xa(va));
|
|
1606
1606
|
const c = await fetch(i);
|
|
1607
1607
|
if (!c.ok)
|
|
1608
1608
|
return e.error("Failed to get address details", c), {
|
|
1609
1609
|
ok: !1,
|
|
1610
1610
|
error: r("address_error")
|
|
1611
1611
|
};
|
|
1612
|
-
const f = /* @__PURE__ */
|
|
1612
|
+
const f = /* @__PURE__ */ ma(wa, await c.json());
|
|
1613
1613
|
if (f.success === !1)
|
|
1614
1614
|
return e.error("Failed to parse address details", f.issues), {
|
|
1615
1615
|
ok: !1,
|
|
@@ -1621,7 +1621,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1621
1621
|
return {
|
|
1622
1622
|
ok: !0,
|
|
1623
1623
|
data: p.map((m) => {
|
|
1624
|
-
var b, k, w, C, A, v,
|
|
1624
|
+
var b, k, w, C, A, v, N, V, M;
|
|
1625
1625
|
return {
|
|
1626
1626
|
// A postcode result has no full address and is named by the postcode itself (PROD-7311).
|
|
1627
1627
|
label: m.full_address ?? ([m.name, m.place_formatted].filter(Boolean).join(", ") || m.mapbox_id),
|
|
@@ -1631,7 +1631,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1631
1631
|
line2: void 0,
|
|
1632
1632
|
line3: ((w = m.context.neighborhood) == null ? void 0 : w.name) ?? ((C = m.context.locality) == null ? void 0 : C.name),
|
|
1633
1633
|
city: ((A = m.context.place) == null ? void 0 : A.name) ?? ((v = m.context.district) == null ? void 0 : v.name),
|
|
1634
|
-
state: (
|
|
1634
|
+
state: (N = m.context.region) == null ? void 0 : N.name,
|
|
1635
1635
|
postcode: ((V = m.context.postcode) == null ? void 0 : V.name) ?? (m.feature_type === "postcode" ? m.name : void 0),
|
|
1636
1636
|
country: (M = m.context.country) == null ? void 0 : M.name
|
|
1637
1637
|
}
|
|
@@ -1665,7 +1665,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1665
1665
|
children: r("back")
|
|
1666
1666
|
})]
|
|
1667
1667
|
});
|
|
1668
|
-
},
|
|
1668
|
+
}, ka = ({
|
|
1669
1669
|
input: e,
|
|
1670
1670
|
onSubmitSuccess: r,
|
|
1671
1671
|
logger: t
|
|
@@ -1675,7 +1675,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1675
1675
|
} = re(), [n, i] = ke(), {
|
|
1676
1676
|
enabled: a,
|
|
1677
1677
|
getPredictions: o
|
|
1678
|
-
} =
|
|
1678
|
+
} = _a({
|
|
1679
1679
|
logger: t,
|
|
1680
1680
|
t: s
|
|
1681
1681
|
}), [c, f] = ke(a ? "query" : "manual"), [p, g] = ke(""), [m, b] = ke(), k = ye(), w = ye(), C = (v) => {
|
|
@@ -1686,14 +1686,14 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1686
1686
|
k.current = void 0, b(void 0);
|
|
1687
1687
|
return;
|
|
1688
1688
|
}
|
|
1689
|
-
const
|
|
1689
|
+
const N = k.current = {
|
|
1690
1690
|
query: v
|
|
1691
1691
|
};
|
|
1692
1692
|
b({
|
|
1693
1693
|
query: v,
|
|
1694
1694
|
status: "pending"
|
|
1695
1695
|
}), o(v).then((M) => {
|
|
1696
|
-
k.current ===
|
|
1696
|
+
k.current === N && (k.current = void 0, b(M.ok ? {
|
|
1697
1697
|
query: v,
|
|
1698
1698
|
status: "done",
|
|
1699
1699
|
items: M.data
|
|
@@ -1703,21 +1703,21 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1703
1703
|
error: M.error
|
|
1704
1704
|
}));
|
|
1705
1705
|
}, (M) => {
|
|
1706
|
-
k.current ===
|
|
1706
|
+
k.current === N && (k.current = void 0, t.error("Failed to get address details", M), b({
|
|
1707
1707
|
query: v,
|
|
1708
1708
|
status: "failed",
|
|
1709
1709
|
error: s("address_error")
|
|
1710
1710
|
}));
|
|
1711
1711
|
});
|
|
1712
|
-
}, A = (v,
|
|
1712
|
+
}, A = (v, N) => {
|
|
1713
1713
|
i((V) => ({
|
|
1714
1714
|
...V,
|
|
1715
|
-
[v]:
|
|
1715
|
+
[v]: N
|
|
1716
1716
|
}));
|
|
1717
1717
|
};
|
|
1718
1718
|
switch (c) {
|
|
1719
1719
|
case "query":
|
|
1720
|
-
return Oe(a, "Query state should not be enabled"), l(
|
|
1720
|
+
return Oe(a, "Query state should not be enabled"), l(Ca, {
|
|
1721
1721
|
input: e,
|
|
1722
1722
|
onSkip: () => r(null),
|
|
1723
1723
|
onAddressSelect: (v) => {
|
|
@@ -1725,8 +1725,8 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1725
1725
|
k.current && (k.current = void 0, b(void 0)), f("manual");
|
|
1726
1726
|
return;
|
|
1727
1727
|
}
|
|
1728
|
-
const
|
|
1729
|
-
|
|
1728
|
+
const N = (m == null ? void 0 : m.status) === "done" ? m.items.find((V) => V.id === v) : void 0;
|
|
1729
|
+
N && (w.current !== v && i(N.address), w.current = v, f("details"));
|
|
1730
1730
|
},
|
|
1731
1731
|
onAddressSearch: C,
|
|
1732
1732
|
lookup: m,
|
|
@@ -1764,7 +1764,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1764
1764
|
) : void 0
|
|
1765
1765
|
});
|
|
1766
1766
|
}
|
|
1767
|
-
},
|
|
1767
|
+
}, Ca = ({
|
|
1768
1768
|
input: e,
|
|
1769
1769
|
onSkip: r,
|
|
1770
1770
|
lookup: t,
|
|
@@ -1884,7 +1884,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1884
1884
|
}, "")]
|
|
1885
1885
|
})]
|
|
1886
1886
|
});
|
|
1887
|
-
},
|
|
1887
|
+
}, Rt = ["line1", "line2", "line3", "city", "state", "postcode", "country"], hr = ({
|
|
1888
1888
|
addressFields: e,
|
|
1889
1889
|
onFieldChange: r,
|
|
1890
1890
|
onSubmitSuccess: t,
|
|
@@ -1908,7 +1908,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1908
1908
|
const f = c.currentTarget, p = [...f.querySelectorAll("input")].filter((b) => b.value !== "" && !b.value.trim());
|
|
1909
1909
|
for (const b of p) {
|
|
1910
1910
|
b.value = "";
|
|
1911
|
-
const k =
|
|
1911
|
+
const k = Rt.find((w) => n.config.keys[w] === b.name);
|
|
1912
1912
|
k && r(k, "");
|
|
1913
1913
|
}
|
|
1914
1914
|
if (p.length > 0 && !f.checkValidity()) {
|
|
@@ -1924,7 +1924,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1924
1924
|
children: [l("div", {
|
|
1925
1925
|
class: "bg-neutral-3 border-neutral-5 grid items-center gap-1.5 rounded-2xl border pb-2 pl-4 pr-3 pt-3 [grid-template-columns:min-content_1fr]",
|
|
1926
1926
|
ref: i,
|
|
1927
|
-
children:
|
|
1927
|
+
children: Rt.map((c, f) => {
|
|
1928
1928
|
const p = `isdk_${c}`, g = n.config.keys[c];
|
|
1929
1929
|
return g ? l(be, {
|
|
1930
1930
|
children: [l("label", {
|
|
@@ -1975,7 +1975,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1975
1975
|
defaultValue: e[c],
|
|
1976
1976
|
onInput: (m) => r(c, m.currentTarget.value),
|
|
1977
1977
|
required: c === "line2" ? n.config.line2Required === !0 : c !== "line3"
|
|
1978
|
-
}), f ===
|
|
1978
|
+
}), f === Rt.length - 1 ? l("hr", {
|
|
1979
1979
|
class: "m-0 w-full border-b border-b-transparent"
|
|
1980
1980
|
}) : l("hr", {
|
|
1981
1981
|
class: "border-b-neutral-5 m-0 w-full border-b border-solid"
|
|
@@ -1992,11 +1992,11 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1992
1992
|
});
|
|
1993
1993
|
}, Jt = () => {
|
|
1994
1994
|
const e = ye(null);
|
|
1995
|
-
return
|
|
1995
|
+
return Hr(() => {
|
|
1996
1996
|
var r;
|
|
1997
1997
|
(r = e.current) == null || r.focus();
|
|
1998
1998
|
}, []), e;
|
|
1999
|
-
},
|
|
1999
|
+
}, us = ["true", "false"], Sa = /* @__PURE__ */ ls(us), Aa = "answer", ds = "flex items-center flex-wrap gap-2 p-2.5", fs = "min-w-0 max-w-full flex-auto", hs = Kr(({
|
|
2000
2000
|
label: e,
|
|
2001
2001
|
...r
|
|
2002
2002
|
}, t) => l("button", {
|
|
@@ -2007,7 +2007,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2007
2007
|
class: "text-center text-base",
|
|
2008
2008
|
children: e
|
|
2009
2009
|
})
|
|
2010
|
-
})),
|
|
2010
|
+
})), Ia = ({
|
|
2011
2011
|
input: e,
|
|
2012
2012
|
onSubmitSuccess: r
|
|
2013
2013
|
}) => {
|
|
@@ -2017,20 +2017,20 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2017
2017
|
class: "",
|
|
2018
2018
|
onSubmit: (s) => {
|
|
2019
2019
|
s.preventDefault();
|
|
2020
|
-
const n =
|
|
2020
|
+
const n = Hs(s).value, i = ha(Sa, n);
|
|
2021
2021
|
r({
|
|
2022
2022
|
type: "boolean",
|
|
2023
2023
|
value: i === "true"
|
|
2024
2024
|
});
|
|
2025
2025
|
},
|
|
2026
2026
|
children: [l("ul", {
|
|
2027
|
-
class:
|
|
2028
|
-
children:
|
|
2029
|
-
class:
|
|
2030
|
-
children: l(
|
|
2027
|
+
class: ds,
|
|
2028
|
+
children: us.map((s, n) => l("li", {
|
|
2029
|
+
class: fs,
|
|
2030
|
+
children: l(hs, {
|
|
2031
2031
|
ref: n === 0 ? t : null,
|
|
2032
2032
|
type: "submit",
|
|
2033
|
-
name:
|
|
2033
|
+
name: Aa,
|
|
2034
2034
|
value: s,
|
|
2035
2035
|
label: e.config.labels[s]
|
|
2036
2036
|
}, s)
|
|
@@ -2044,10 +2044,10 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2044
2044
|
})
|
|
2045
2045
|
})]
|
|
2046
2046
|
});
|
|
2047
|
-
}, pr = (e) => e.reduce((r, t) => r + t.sizeKb, 0),
|
|
2047
|
+
}, pr = (e) => e.reduce((r, t) => r + t.sizeKb, 0), Ea = et("file"), mr = 3, _t = (e) => {
|
|
2048
2048
|
const r = e.lastIndexOf(".");
|
|
2049
2049
|
return r === -1 ? [e, ""] : [e.slice(0, r), e.slice(r)];
|
|
2050
|
-
},
|
|
2050
|
+
}, Fa = ({
|
|
2051
2051
|
file: e,
|
|
2052
2052
|
class: r,
|
|
2053
2053
|
...t
|
|
@@ -2083,22 +2083,22 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2083
2083
|
}) => l("li", {
|
|
2084
2084
|
class: Qe("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
|
|
2085
2085
|
...r
|
|
2086
|
-
}),
|
|
2086
|
+
}), Va = (e, r) => {
|
|
2087
2087
|
const [t, s] = _t(e);
|
|
2088
2088
|
return `${t.slice(0, r)}${s}`;
|
|
2089
2089
|
}, br = (e) => ({
|
|
2090
|
-
name:
|
|
2090
|
+
name: Va(e.name, 42),
|
|
2091
2091
|
sizeKb: e.size / 1e3
|
|
2092
|
-
}),
|
|
2093
|
-
const s = _t(r.name)[1].toLowerCase(), n = [...t.map((a) => a.toLowerCase()), ...
|
|
2092
|
+
}), Ma = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], La = (e, r, t) => {
|
|
2093
|
+
const s = _t(r.name)[1].toLowerCase(), n = [...t.map((a) => a.toLowerCase()), ...Ma], i = s === "" ? "none" : n.includes(s) ? s : "other";
|
|
2094
2094
|
return `chatbot-file-refused:${e}:${i}`;
|
|
2095
|
-
},
|
|
2095
|
+
}, Na = ({
|
|
2096
2096
|
input: e,
|
|
2097
2097
|
onSubmitSuccess: r,
|
|
2098
2098
|
analytics: t
|
|
2099
2099
|
}) => {
|
|
2100
2100
|
var C;
|
|
2101
|
-
const s = (C = q.current$.value.flow) == null ? void 0 : C.data.submissions[e.key], [n, i] = ke(
|
|
2101
|
+
const s = (C = q.current$.value.flow) == null ? void 0 : C.data.submissions[e.key], [n, i] = ke(Ea(s) && s.value.length ? {
|
|
2102
2102
|
status: "ready",
|
|
2103
2103
|
files: s.value
|
|
2104
2104
|
} : {
|
|
@@ -2155,13 +2155,13 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2155
2155
|
}
|
|
2156
2156
|
};
|
|
2157
2157
|
}, w = (A, v) => {
|
|
2158
|
-
var
|
|
2158
|
+
var N, V;
|
|
2159
2159
|
return t.log({
|
|
2160
2160
|
event: "INTERACTION",
|
|
2161
2161
|
properties: {
|
|
2162
|
-
tag:
|
|
2162
|
+
tag: La(A, v, e.config.extensions)
|
|
2163
2163
|
},
|
|
2164
|
-
customProperties: (V = (
|
|
2164
|
+
customProperties: (V = (N = q.current$.peek().flow) == null ? void 0 : N.analytics) == null ? void 0 : V.customProperties
|
|
2165
2165
|
});
|
|
2166
2166
|
};
|
|
2167
2167
|
return l("form", {
|
|
@@ -2187,14 +2187,14 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2187
2187
|
children: [c.length > 0 ? l("ul", {
|
|
2188
2188
|
class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
|
|
2189
2189
|
children: [c.slice(0, mr).map((A) => {
|
|
2190
|
-
const [v,
|
|
2190
|
+
const [v, N] = _t(A.name);
|
|
2191
2191
|
return l(yr, {
|
|
2192
2192
|
class: "flex overflow-hidden",
|
|
2193
2193
|
children: [l("span", {
|
|
2194
2194
|
class: "block truncate",
|
|
2195
2195
|
children: v
|
|
2196
2196
|
}), l("span", {
|
|
2197
|
-
children:
|
|
2197
|
+
children: N
|
|
2198
2198
|
})]
|
|
2199
2199
|
});
|
|
2200
2200
|
}), p > 0 ? l(yr, {
|
|
@@ -2274,12 +2274,12 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2274
2274
|
Oe(A.target instanceof HTMLInputElement);
|
|
2275
2275
|
const v = A.target.files ? Array.from(A.target.files) : [];
|
|
2276
2276
|
A.target.value = "";
|
|
2277
|
-
const [
|
|
2278
|
-
if (!
|
|
2277
|
+
const [N] = v;
|
|
2278
|
+
if (!N)
|
|
2279
2279
|
return;
|
|
2280
2280
|
const V = ++a.current, M = n.status === "ready", ee = v.map(br), K = k(ee);
|
|
2281
2281
|
if (K)
|
|
2282
|
-
return w(K.reason, K.file ??
|
|
2282
|
+
return w(K.reason, K.file ?? N), i({
|
|
2283
2283
|
status: "error",
|
|
2284
2284
|
error: K.error
|
|
2285
2285
|
});
|
|
@@ -2287,26 +2287,26 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2287
2287
|
status: "pending",
|
|
2288
2288
|
files: ee
|
|
2289
2289
|
});
|
|
2290
|
-
let
|
|
2290
|
+
let D;
|
|
2291
2291
|
try {
|
|
2292
|
-
const
|
|
2292
|
+
const R = await Promise.all(v.map(async (T) => {
|
|
2293
2293
|
try {
|
|
2294
2294
|
return {
|
|
2295
|
-
...br(
|
|
2296
|
-
data: await
|
|
2295
|
+
...br(T),
|
|
2296
|
+
data: await Ks(T)
|
|
2297
2297
|
};
|
|
2298
2298
|
} catch (j) {
|
|
2299
|
-
throw
|
|
2299
|
+
throw D ?? (D = T), j;
|
|
2300
2300
|
}
|
|
2301
2301
|
}));
|
|
2302
2302
|
a.current === V && i({
|
|
2303
2303
|
status: "ready",
|
|
2304
|
-
files:
|
|
2304
|
+
files: R
|
|
2305
2305
|
});
|
|
2306
2306
|
} catch {
|
|
2307
2307
|
if (a.current !== V)
|
|
2308
2308
|
return;
|
|
2309
|
-
w("unreadable",
|
|
2309
|
+
w("unreadable", D ?? N), i({
|
|
2310
2310
|
status: "error",
|
|
2311
2311
|
error: {
|
|
2312
2312
|
type: "invalid",
|
|
@@ -2334,9 +2334,9 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2334
2334
|
})]
|
|
2335
2335
|
});
|
|
2336
2336
|
};
|
|
2337
|
-
var ft = (e) => e.type === "checkbox",
|
|
2338
|
-
const
|
|
2339
|
-
var Z = (e) => !oe(e) && !Array.isArray(e) &&
|
|
2337
|
+
var ft = (e) => e.type === "checkbox", De = (e) => e instanceof Date, oe = (e) => e == null;
|
|
2338
|
+
const ps = (e) => typeof e == "object";
|
|
2339
|
+
var Z = (e) => !oe(e) && !Array.isArray(e) && ps(e) && !De(e), Ra = (e) => Z(e) && e.target ? ft(e.target) ? e.target.checked : e.target.value : e, Ta = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Da = (e, r) => e.has(Ta(r)), Oa = (e) => {
|
|
2340
2340
|
const r = e.constructor && e.constructor.prototype;
|
|
2341
2341
|
return Z(r) && r.hasOwnProperty("isPrototypeOf");
|
|
2342
2342
|
}, Zt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
@@ -2347,7 +2347,7 @@ function Q(e) {
|
|
|
2347
2347
|
if (Zt && (e instanceof Blob || r))
|
|
2348
2348
|
return e;
|
|
2349
2349
|
const t = Array.isArray(e);
|
|
2350
|
-
if (!t && !(Z(e) &&
|
|
2350
|
+
if (!t && !(Z(e) && Oa(e)))
|
|
2351
2351
|
return e;
|
|
2352
2352
|
const s = t ? [] : Object.create(Object.getPrototypeOf(e));
|
|
2353
2353
|
for (const n in e)
|
|
@@ -2392,9 +2392,9 @@ const gr = {
|
|
|
2392
2392
|
pattern: "pattern",
|
|
2393
2393
|
required: "required",
|
|
2394
2394
|
validate: "validate"
|
|
2395
|
-
},
|
|
2396
|
-
|
|
2397
|
-
var
|
|
2395
|
+
}, ja = ae.createContext(null);
|
|
2396
|
+
ja.displayName = "HookFormControlContext";
|
|
2397
|
+
var $a = (e, r, t, s = !0) => {
|
|
2398
2398
|
const n = {
|
|
2399
2399
|
defaultValues: r._defaultValues
|
|
2400
2400
|
};
|
|
@@ -2407,12 +2407,12 @@ var Oa = (e, r, t, s = !0) => {
|
|
|
2407
2407
|
});
|
|
2408
2408
|
return n;
|
|
2409
2409
|
};
|
|
2410
|
-
const
|
|
2411
|
-
var ue = (e) => typeof e == "string",
|
|
2410
|
+
const Ba = typeof window < "u" ? ae.useLayoutEffect : ae.useEffect;
|
|
2411
|
+
var ue = (e) => typeof e == "string", Pa = (e, r, t, s, n) => ue(e) ? (s && r.watch.add(e), S(t, e, n)) : Array.isArray(e) ? e.map((i) => (s && r.watch.add(i), S(t, i))) : (s && (r.watchAll = !0), t), Pt = (e) => oe(e) || !ps(e);
|
|
2412
2412
|
function Ve(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
2413
2413
|
if (Pt(e) || Pt(r))
|
|
2414
2414
|
return Object.is(e, r);
|
|
2415
|
-
if (
|
|
2415
|
+
if (De(e) && De(r))
|
|
2416
2416
|
return Object.is(e.getTime(), r.getTime());
|
|
2417
2417
|
const s = Object.keys(e), n = Object.keys(r);
|
|
2418
2418
|
if (s.length !== n.length)
|
|
@@ -2426,15 +2426,15 @@ function Ve(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
|
2426
2426
|
return !1;
|
|
2427
2427
|
if (i !== "ref") {
|
|
2428
2428
|
const o = r[i];
|
|
2429
|
-
if (
|
|
2429
|
+
if (De(a) && De(o) || Z(a) && Z(o) || Array.isArray(a) && Array.isArray(o) ? !Ve(a, o, t) : !Object.is(a, o))
|
|
2430
2430
|
return !1;
|
|
2431
2431
|
}
|
|
2432
2432
|
}
|
|
2433
2433
|
return !0;
|
|
2434
2434
|
}
|
|
2435
|
-
const
|
|
2436
|
-
|
|
2437
|
-
var
|
|
2435
|
+
const qa = ae.createContext(null);
|
|
2436
|
+
qa.displayName = "HookFormContext";
|
|
2437
|
+
var ms = (e, r, t, s, n) => r ? {
|
|
2438
2438
|
...t[e],
|
|
2439
2439
|
types: {
|
|
2440
2440
|
...t[e] && t[e].types ? t[e].types : {},
|
|
@@ -2460,13 +2460,13 @@ var ps = (e, r, t, s, n) => r ? {
|
|
|
2460
2460
|
}
|
|
2461
2461
|
};
|
|
2462
2462
|
};
|
|
2463
|
-
function
|
|
2463
|
+
function ys(e, r) {
|
|
2464
2464
|
const t = {};
|
|
2465
2465
|
for (const s in e)
|
|
2466
2466
|
if (e.hasOwnProperty(s)) {
|
|
2467
2467
|
const n = e[s], i = r[s];
|
|
2468
2468
|
if (n && Z(n) && i) {
|
|
2469
|
-
const a =
|
|
2469
|
+
const a = ys(n, i);
|
|
2470
2470
|
Z(a) && (t[s] = a);
|
|
2471
2471
|
} else
|
|
2472
2472
|
e[s] && (t[s] = i);
|
|
@@ -2478,37 +2478,37 @@ var ie = (e) => Z(e) && !Object.keys(e).length, Qt = (e) => e.type === "file", b
|
|
|
2478
2478
|
return !1;
|
|
2479
2479
|
const r = e ? e.ownerDocument : 0;
|
|
2480
2480
|
return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
|
|
2481
|
-
},
|
|
2482
|
-
function
|
|
2481
|
+
}, bs = (e) => e.type === "select-multiple", er = (e) => e.type === "radio", Ua = (e) => er(e) || ft(e), Tt = (e) => bt(e) && e.isConnected;
|
|
2482
|
+
function Wa(e, r) {
|
|
2483
2483
|
const t = r.slice(0, -1).length;
|
|
2484
2484
|
let s = 0;
|
|
2485
2485
|
for (; s < t; )
|
|
2486
2486
|
e = G(e) ? s++ : e[r[s++]];
|
|
2487
2487
|
return e;
|
|
2488
2488
|
}
|
|
2489
|
-
function
|
|
2489
|
+
function za(e) {
|
|
2490
2490
|
for (const r in e)
|
|
2491
2491
|
if (e.hasOwnProperty(r) && !G(e[r]))
|
|
2492
2492
|
return !1;
|
|
2493
2493
|
return !0;
|
|
2494
2494
|
}
|
|
2495
2495
|
function J(e, r) {
|
|
2496
|
-
const t = Array.isArray(r) ? r : kt(r) ? [r] : Yt(r), s = t.length === 1 ? e :
|
|
2497
|
-
return s && delete s[i], n !== 0 && (Z(s) && ie(s) || Array.isArray(s) &&
|
|
2496
|
+
const t = Array.isArray(r) ? r : kt(r) ? [r] : Yt(r), s = t.length === 1 ? e : Wa(e, t), n = t.length - 1, i = t[n];
|
|
2497
|
+
return s && delete s[i], n !== 0 && (Z(s) && ie(s) || Array.isArray(s) && za(s)) && J(e, t.slice(0, -1)), e;
|
|
2498
2498
|
}
|
|
2499
|
-
var
|
|
2499
|
+
var Ha = (e) => {
|
|
2500
2500
|
for (const r in e)
|
|
2501
2501
|
if (de(e[r]))
|
|
2502
2502
|
return !0;
|
|
2503
2503
|
return !1;
|
|
2504
2504
|
};
|
|
2505
|
-
function
|
|
2506
|
-
return Array.isArray(e) || Z(e) && !
|
|
2505
|
+
function gs(e) {
|
|
2506
|
+
return Array.isArray(e) || Z(e) && !Ha(e);
|
|
2507
2507
|
}
|
|
2508
2508
|
function qt(e, r = {}) {
|
|
2509
2509
|
for (const t in e) {
|
|
2510
2510
|
const s = e[t];
|
|
2511
|
-
|
|
2511
|
+
gs(s) ? (r[t] = Array.isArray(s) ? [] : {}, qt(s, r[t])) : G(s) || (r[t] = !0);
|
|
2512
2512
|
}
|
|
2513
2513
|
return r;
|
|
2514
2514
|
}
|
|
@@ -2516,7 +2516,7 @@ function Ke(e, r, t) {
|
|
|
2516
2516
|
t || (t = qt(r));
|
|
2517
2517
|
for (const s in e) {
|
|
2518
2518
|
const n = e[s];
|
|
2519
|
-
if (
|
|
2519
|
+
if (gs(n))
|
|
2520
2520
|
G(r) || Pt(t[s]) ? t[s] = qt(n, Array.isArray(n) ? [] : {}) : Ke(n, oe(r) ? {} : r[s], t[s]);
|
|
2521
2521
|
else {
|
|
2522
2522
|
const i = r[s];
|
|
@@ -2529,7 +2529,7 @@ const xr = {
|
|
|
2529
2529
|
value: !1,
|
|
2530
2530
|
isValid: !1
|
|
2531
2531
|
}, wr = { value: !0, isValid: !0 };
|
|
2532
|
-
var
|
|
2532
|
+
var vs = (e) => {
|
|
2533
2533
|
if (Array.isArray(e)) {
|
|
2534
2534
|
if (e.length > 1) {
|
|
2535
2535
|
const r = e.filter((t) => t && t.checked && !t.disabled).map((t) => t.value);
|
|
@@ -2541,20 +2541,20 @@ var gs = (e) => {
|
|
|
2541
2541
|
) : xr;
|
|
2542
2542
|
}
|
|
2543
2543
|
return xr;
|
|
2544
|
-
},
|
|
2544
|
+
}, xs = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: s }) => G(e) ? e : r ? e === "" ? NaN : e && +e : t && ue(e) ? new Date(e) : s ? s(e) : e;
|
|
2545
2545
|
const _r = {
|
|
2546
2546
|
isValid: !1,
|
|
2547
2547
|
value: null
|
|
2548
2548
|
};
|
|
2549
|
-
var
|
|
2549
|
+
var ws = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disabled ? {
|
|
2550
2550
|
isValid: !0,
|
|
2551
2551
|
value: t.value
|
|
2552
2552
|
} : r, _r) : _r;
|
|
2553
2553
|
function kr(e) {
|
|
2554
2554
|
const r = e.ref;
|
|
2555
|
-
return Qt(r) ? r.files : er(r) ?
|
|
2555
|
+
return Qt(r) ? r.files : er(r) ? ws(e.refs).value : bs(r) ? [...r.selectedOptions].map(({ value: t }) => t) : ft(r) ? vs(e.refs).value : xs(G(r.value) ? e.ref.value : r.value, e);
|
|
2556
2556
|
}
|
|
2557
|
-
var
|
|
2557
|
+
var Ka = (e, r, t, s) => {
|
|
2558
2558
|
const n = {};
|
|
2559
2559
|
for (const i of e) {
|
|
2560
2560
|
const a = S(r, i);
|
|
@@ -2574,7 +2574,7 @@ var za = (e, r, t, s) => {
|
|
|
2574
2574
|
isOnTouch: e === fe.onTouched
|
|
2575
2575
|
});
|
|
2576
2576
|
const Sr = "AsyncFunction";
|
|
2577
|
-
var
|
|
2577
|
+
var Ga = (e) => !!e && !!e.validate && !!(de(e.validate) && e.validate.constructor.name === Sr || Z(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === Sr)), Ja = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), Ar = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((s) => e.startsWith(s) && /^\.\w+/.test(e.slice(s.length))));
|
|
2578
2578
|
const dt = (e, r, t, s) => {
|
|
2579
2579
|
for (const n of t || Object.keys(e)) {
|
|
2580
2580
|
const i = S(e, n);
|
|
@@ -2620,11 +2620,11 @@ function Ir(e, r, t) {
|
|
|
2620
2620
|
name: t
|
|
2621
2621
|
};
|
|
2622
2622
|
}
|
|
2623
|
-
var
|
|
2623
|
+
var Za = (e, r, t, s) => {
|
|
2624
2624
|
t(e);
|
|
2625
2625
|
const { name: n, ...i } = e;
|
|
2626
2626
|
return ie(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((a) => r[a] === (!s || fe.all));
|
|
2627
|
-
},
|
|
2627
|
+
}, Xa = (e, r, t) => !e || !r || e === r || ut(e).some((s) => s && (t ? s === r : s.startsWith(r) || r.startsWith(s))), Ya = (e, r, t, s, n) => n.isOnAll ? !1 : !t && n.isOnTouch ? !(r || e) : (t ? s.isOnBlur : n.isOnBlur) ? !e : (t ? s.isOnChange : n.isOnChange) ? e : !0, Qa = (e, r) => !Xt(S(e, r)).length && J(e, r), ei = (e, r, t) => {
|
|
2628
2628
|
const s = ut(S(e, t));
|
|
2629
2629
|
return H(s, "root", r[t]), H(e, t, s), e;
|
|
2630
2630
|
};
|
|
@@ -2643,28 +2643,28 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2643
2643
|
const { ref: a, refs: o, required: c, maxLength: f, minLength: p, min: g, max: m, pattern: b, validate: k, name: w, valueAsNumber: C, mount: A } = e._f, v = S(t, w);
|
|
2644
2644
|
if (!A || r.has(w))
|
|
2645
2645
|
return {};
|
|
2646
|
-
const
|
|
2647
|
-
n &&
|
|
2648
|
-
}, M = {}, ee = er(a), K = ft(a),
|
|
2646
|
+
const N = o ? o[0] : a, V = (E) => {
|
|
2647
|
+
n && N.reportValidity && (N.setCustomValidity(me(E) ? "" : E || ""), N.reportValidity());
|
|
2648
|
+
}, M = {}, ee = er(a), K = ft(a), D = ee || K, R = (C || Qt(a)) && G(a.value) && G(v) || bt(a) && a.value === "" || v === "" || Array.isArray(v) && !v.length, T = ms.bind(null, w, s, M), j = (E, F, B, L = _e.maxLength, W = _e.minLength) => {
|
|
2649
2649
|
const U = E ? F : B;
|
|
2650
2650
|
M[w] = {
|
|
2651
2651
|
type: E ? L : W,
|
|
2652
2652
|
message: U,
|
|
2653
2653
|
ref: a,
|
|
2654
|
-
...
|
|
2654
|
+
...T(E ? L : W, U)
|
|
2655
2655
|
};
|
|
2656
2656
|
};
|
|
2657
|
-
if (i ? !Array.isArray(v) || !v.length : c && (!
|
|
2657
|
+
if (i ? !Array.isArray(v) || !v.length : c && (!D && (R || oe(v)) || me(v) && !v || K && !vs(o).isValid || ee && !ws(o).isValid)) {
|
|
2658
2658
|
const { value: E, message: F } = ue(c) ? { value: !!c, message: c } : He(c);
|
|
2659
2659
|
if (E && (M[w] = {
|
|
2660
2660
|
type: _e.required,
|
|
2661
2661
|
message: F,
|
|
2662
|
-
ref:
|
|
2663
|
-
...
|
|
2662
|
+
ref: N,
|
|
2663
|
+
...T(_e.required, F)
|
|
2664
2664
|
}, !s))
|
|
2665
2665
|
return V(F), M;
|
|
2666
2666
|
}
|
|
2667
|
-
if (!
|
|
2667
|
+
if (!R && (!oe(g) || !oe(m))) {
|
|
2668
2668
|
let E, F;
|
|
2669
2669
|
const B = He(m), L = He(g);
|
|
2670
2670
|
if (!oe(v) && !isNaN(v)) {
|
|
@@ -2677,27 +2677,27 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2677
2677
|
if ((E || F) && (j(!!E, B.message, L.message, _e.max, _e.min), !s))
|
|
2678
2678
|
return V(M[w].message), M;
|
|
2679
2679
|
}
|
|
2680
|
-
if ((f || p) && !
|
|
2680
|
+
if ((f || p) && !R && (ue(v) || i && Array.isArray(v))) {
|
|
2681
2681
|
const E = He(f), F = He(p), B = !oe(E.value) && v.length > +E.value, L = !oe(F.value) && v.length < +F.value;
|
|
2682
2682
|
if ((B || L) && (j(B, E.message, F.message), !s))
|
|
2683
2683
|
return V(M[w].message), M;
|
|
2684
2684
|
}
|
|
2685
|
-
if (b && !
|
|
2685
|
+
if (b && !R && ue(v)) {
|
|
2686
2686
|
const { value: E, message: F } = He(b);
|
|
2687
2687
|
if (gt(E) && !v.match(E) && (M[w] = {
|
|
2688
2688
|
type: _e.pattern,
|
|
2689
2689
|
message: F,
|
|
2690
2690
|
ref: a,
|
|
2691
|
-
...
|
|
2691
|
+
...T(_e.pattern, F)
|
|
2692
2692
|
}, !s))
|
|
2693
2693
|
return V(F), M;
|
|
2694
2694
|
}
|
|
2695
2695
|
if (k) {
|
|
2696
2696
|
if (de(k)) {
|
|
2697
|
-
const E = await k(v, t), F = Er(E,
|
|
2697
|
+
const E = await k(v, t), F = Er(E, N);
|
|
2698
2698
|
if (F && (M[w] = {
|
|
2699
2699
|
...F,
|
|
2700
|
-
...
|
|
2700
|
+
...T(_e.validate, F.message)
|
|
2701
2701
|
}, !s))
|
|
2702
2702
|
return V(F.message), M;
|
|
2703
2703
|
} else if (Z(k)) {
|
|
@@ -2705,14 +2705,14 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2705
2705
|
for (const F in k) {
|
|
2706
2706
|
if (!ie(E) && !s)
|
|
2707
2707
|
break;
|
|
2708
|
-
const B = Er(await k[F](v, t),
|
|
2708
|
+
const B = Er(await k[F](v, t), N, F);
|
|
2709
2709
|
B && (E = {
|
|
2710
2710
|
...B,
|
|
2711
|
-
...
|
|
2711
|
+
...T(F, B.message)
|
|
2712
2712
|
}, V(B.message), s && (M[w] = E));
|
|
2713
2713
|
}
|
|
2714
2714
|
if (!ie(E) && (M[w] = {
|
|
2715
|
-
ref:
|
|
2715
|
+
ref: N,
|
|
2716
2716
|
...E
|
|
2717
2717
|
}, !s))
|
|
2718
2718
|
return M;
|
|
@@ -2720,14 +2720,14 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2720
2720
|
}
|
|
2721
2721
|
return V(!0), M;
|
|
2722
2722
|
};
|
|
2723
|
-
const
|
|
2723
|
+
const ti = {
|
|
2724
2724
|
mode: fe.onSubmit,
|
|
2725
2725
|
reValidateMode: fe.onChange,
|
|
2726
2726
|
shouldFocusError: !0
|
|
2727
2727
|
};
|
|
2728
|
-
function
|
|
2728
|
+
function ri(e = {}) {
|
|
2729
2729
|
let r = {
|
|
2730
|
-
...
|
|
2730
|
+
...ti,
|
|
2731
2731
|
...e
|
|
2732
2732
|
}, t = {
|
|
2733
2733
|
submitCount: 0,
|
|
@@ -2778,7 +2778,7 @@ function ei(e = {}) {
|
|
|
2778
2778
|
}, C = async (u) => {
|
|
2779
2779
|
if (!a.keepIsValid && !r.disabled && (g.isValid || m.isValid || u)) {
|
|
2780
2780
|
let d;
|
|
2781
|
-
r.resolver ? (d = ie((await
|
|
2781
|
+
r.resolver ? (d = ie((await D()).errors), A()) : d = await T(s, !0), d !== t.isValid && b.state.next({
|
|
2782
2782
|
isValid: d
|
|
2783
2783
|
});
|
|
2784
2784
|
}
|
|
@@ -2797,7 +2797,7 @@ function ei(e = {}) {
|
|
|
2797
2797
|
}
|
|
2798
2798
|
if (x && Array.isArray(S(t.errors, u))) {
|
|
2799
2799
|
const I = h(S(t.errors, u), _.argA, _.argB);
|
|
2800
|
-
y && H(t.errors, u, I),
|
|
2800
|
+
y && H(t.errors, u, I), Qa(t.errors, u);
|
|
2801
2801
|
}
|
|
2802
2802
|
if ((g.touchedFields || m.touchedFields) && x && Array.isArray(S(t.touchedFields, u))) {
|
|
2803
2803
|
const I = h(S(t.touchedFields, u), _.argA, _.argB);
|
|
@@ -2812,7 +2812,7 @@ function ei(e = {}) {
|
|
|
2812
2812
|
});
|
|
2813
2813
|
} else
|
|
2814
2814
|
H(i, u, d);
|
|
2815
|
-
},
|
|
2815
|
+
}, N = (u, d) => {
|
|
2816
2816
|
H(t.errors, u, d), b.state.next({
|
|
2817
2817
|
errors: t.errors
|
|
2818
2818
|
});
|
|
@@ -2847,7 +2847,7 @@ function ei(e = {}) {
|
|
|
2847
2847
|
return x ? $ : {};
|
|
2848
2848
|
}, K = (u, d, h, _) => {
|
|
2849
2849
|
const y = S(t.errors, u), x = (g.isValid || m.isValid) && me(d) && t.isValid !== d;
|
|
2850
|
-
if (r.delayError && h ? (c = w(() =>
|
|
2850
|
+
if (r.delayError && h ? (c = w(() => N(u, h)), c(r.delayError)) : (clearTimeout(f), c = null, h ? H(t.errors, u, h) : J(t.errors, u)), (h ? !Ve(y, h) : y) || !ie(_) || x) {
|
|
2851
2851
|
const I = {
|
|
2852
2852
|
..._,
|
|
2853
2853
|
...x && me(d) ? { isValid: d } : {},
|
|
@@ -2859,8 +2859,8 @@ function ei(e = {}) {
|
|
|
2859
2859
|
...I
|
|
2860
2860
|
}, b.state.next(I);
|
|
2861
2861
|
}
|
|
2862
|
-
},
|
|
2863
|
-
const { errors: d } = await
|
|
2862
|
+
}, D = async (u) => (A(u, !0), await r.resolver(i, r.context, Ka(u || o.mount, s, r.criteriaMode, r.shouldUseNativeValidation))), R = async (u) => {
|
|
2863
|
+
const { errors: d } = await D(u);
|
|
2864
2864
|
if (A(u), u)
|
|
2865
2865
|
for (const h of u) {
|
|
2866
2866
|
const _ = S(d, h);
|
|
@@ -2869,7 +2869,7 @@ function ei(e = {}) {
|
|
|
2869
2869
|
else
|
|
2870
2870
|
t.errors = d;
|
|
2871
2871
|
return d;
|
|
2872
|
-
},
|
|
2872
|
+
}, T = async (u, d, h = {
|
|
2873
2873
|
valid: !0
|
|
2874
2874
|
}) => {
|
|
2875
2875
|
for (const _ in u) {
|
|
@@ -2877,31 +2877,31 @@ function ei(e = {}) {
|
|
|
2877
2877
|
if (y) {
|
|
2878
2878
|
const { _f: x, ...I } = y;
|
|
2879
2879
|
if (x) {
|
|
2880
|
-
const $ = o.array.has(x.name), P = y._f &&
|
|
2880
|
+
const $ = o.array.has(x.name), P = y._f && Ga(y._f);
|
|
2881
2881
|
P && g.validatingFields && A([x.name], !0);
|
|
2882
2882
|
const ne = await Fr(y, o.disabled, i, k, r.shouldUseNativeValidation && !d, $);
|
|
2883
2883
|
if (P && g.validatingFields && A([x.name]), ne[x.name] && (h.valid = !1, d || e.shouldUseNativeValidation))
|
|
2884
2884
|
break;
|
|
2885
|
-
!d && (S(ne, x.name) ? $ ?
|
|
2885
|
+
!d && (S(ne, x.name) ? $ ? ei(t.errors, ne, x.name) : H(t.errors, x.name, ne[x.name]) : J(t.errors, x.name));
|
|
2886
2886
|
}
|
|
2887
|
-
!ie(I) && await
|
|
2887
|
+
!ie(I) && await T(I, d, h);
|
|
2888
2888
|
}
|
|
2889
2889
|
}
|
|
2890
2890
|
return h.valid;
|
|
2891
2891
|
}, j = () => {
|
|
2892
2892
|
for (const u of o.unMount) {
|
|
2893
2893
|
const d = S(s, u);
|
|
2894
|
-
d && (d._f.refs ? d._f.refs.every((h) => !
|
|
2894
|
+
d && (d._f.refs ? d._f.refs.every((h) => !Tt(h)) : !Tt(d._f.ref)) && qe(u);
|
|
2895
2895
|
}
|
|
2896
2896
|
o.unMount = /* @__PURE__ */ new Set();
|
|
2897
|
-
}, E = (u, d) => !r.disabled && (u && d && H(i, u, d), !Ve(rt(), n)), F = (u, d, h) =>
|
|
2897
|
+
}, E = (u, d) => !r.disabled && (u && d && H(i, u, d), !Ve(rt(), n)), F = (u, d, h) => Pa(u, o, {
|
|
2898
2898
|
...a.mount ? i : G(d) ? n : ue(u) ? { [u]: d } : d
|
|
2899
2899
|
}, h, d), B = (u) => Xt(S(a.mount ? i : n, u, r.shouldUnregister ? S(n, u, []) : [])), L = (u, d, h = {}) => {
|
|
2900
2900
|
const _ = S(s, u);
|
|
2901
2901
|
let y = d;
|
|
2902
2902
|
if (_) {
|
|
2903
2903
|
const x = _._f;
|
|
2904
|
-
x && (!x.disabled && H(i, u,
|
|
2904
|
+
x && (!x.disabled && H(i, u, xs(d, x)), y = bt(x.ref) && oe(d) ? "" : d, bs(x.ref) ? [...x.ref.options].forEach((I) => I.selected = y.includes(I.value)) : x.refs ? ft(x.ref) ? x.refs.forEach((I) => {
|
|
2905
2905
|
(!I.defaultChecked || !I.disabled) && (Array.isArray(y) ? I.checked = !!y.find(($) => $ === I.value) : I.checked = y === I.value || !!y);
|
|
2906
2906
|
}) : x.refs.forEach((I) => I.checked = I.value === y) : Qt(x.ref) ? x.ref.value = "" : (x.ref.value = y, x.ref.type || b.state.next({
|
|
2907
2907
|
name: u,
|
|
@@ -2914,7 +2914,7 @@ function ei(e = {}) {
|
|
|
2914
2914
|
if (!d.hasOwnProperty(_))
|
|
2915
2915
|
return;
|
|
2916
2916
|
const y = d[_], x = u + "." + _, I = S(s, x);
|
|
2917
|
-
(o.array.has(u) || Z(y) || I && !I._f) && !
|
|
2917
|
+
(o.array.has(u) || Z(y) || I && !I._f) && !De(y) ? W(x, y, h) : L(x, y, h);
|
|
2918
2918
|
}
|
|
2919
2919
|
}, U = (u, d, h = {}) => {
|
|
2920
2920
|
const _ = S(s, u), y = o.array.has(u), x = Q(d);
|
|
@@ -2938,27 +2938,27 @@ function ei(e = {}) {
|
|
|
2938
2938
|
const d = u.target;
|
|
2939
2939
|
let h = d.name, _ = !0;
|
|
2940
2940
|
const y = S(s, h), x = (P) => {
|
|
2941
|
-
_ = Number.isNaN(P) ||
|
|
2941
|
+
_ = Number.isNaN(P) || De(P) && isNaN(P.getTime()) || Ve(P, S(i, h, P));
|
|
2942
2942
|
}, I = Cr(r.mode), $ = Cr(r.reValidateMode);
|
|
2943
2943
|
if (y) {
|
|
2944
2944
|
let P, ne;
|
|
2945
|
-
const
|
|
2946
|
-
H(i, h,
|
|
2947
|
-
const Et = ee(h,
|
|
2945
|
+
const Te = d.type ? kr(y._f) : Ra(u), Ie = u.type === gr.BLUR || u.type === gr.FOCUS_OUT, ks = !Ja(y._f) && !r.resolver && !S(t.errors, h) && !y._f.deps || Ya(Ie, S(t.touchedFields, h), t.isSubmitted, $, I), It = Ar(h, o, Ie);
|
|
2946
|
+
H(i, h, Te), Ie ? (!d || !d.readOnly) && (y._f.onBlur && y._f.onBlur(u), c && c(0)) : y._f.onChange && y._f.onChange(u);
|
|
2947
|
+
const Et = ee(h, Te, Ie), Cs = !ie(Et) || It;
|
|
2948
2948
|
if (!Ie && b.state.next({
|
|
2949
2949
|
name: h,
|
|
2950
2950
|
type: u.type,
|
|
2951
2951
|
values: Q(i)
|
|
2952
|
-
}),
|
|
2953
|
-
return (g.isValid || m.isValid) && (r.mode === "onBlur" ? Ie && C() : Ie || C()),
|
|
2952
|
+
}), ks)
|
|
2953
|
+
return (g.isValid || m.isValid) && (r.mode === "onBlur" ? Ie && C() : Ie || C()), Cs && b.state.next({ name: h, ...It ? {} : Et });
|
|
2954
2954
|
if (!Ie && It && b.state.next({ ...t }), r.resolver) {
|
|
2955
|
-
const { errors: tr } = await
|
|
2956
|
-
if (A([h]), x(
|
|
2957
|
-
const
|
|
2955
|
+
const { errors: tr } = await D([h]);
|
|
2956
|
+
if (A([h]), x(Te), _) {
|
|
2957
|
+
const Ss = Ir(t.errors, s, h), rr = Ir(tr, s, Ss.name || h);
|
|
2958
2958
|
P = rr.error, h = rr.name, ne = ie(tr);
|
|
2959
2959
|
}
|
|
2960
2960
|
} else
|
|
2961
|
-
A([h], !0), P = (await Fr(y, o.disabled, i, k, r.shouldUseNativeValidation))[h], A([h]), x(
|
|
2961
|
+
A([h], !0), P = (await Fr(y, o.disabled, i, k, r.shouldUseNativeValidation))[h], A([h]), x(Te), _ && (P ? ne = !1 : (g.isValid || m.isValid) && (ne = await T(s, !0)));
|
|
2962
2962
|
_ && (y._f.deps && (!Array.isArray(y._f.deps) || y._f.deps.length > 0) && z(y._f.deps), K(h, ne, P, Et));
|
|
2963
2963
|
}
|
|
2964
2964
|
}, X = (u, d) => {
|
|
@@ -2968,13 +2968,13 @@ function ei(e = {}) {
|
|
|
2968
2968
|
let h, _;
|
|
2969
2969
|
const y = ut(u);
|
|
2970
2970
|
if (r.resolver) {
|
|
2971
|
-
const x = await
|
|
2971
|
+
const x = await R(G(u) ? u : y);
|
|
2972
2972
|
h = ie(x), _ = u ? !y.some((I) => S(x, I)) : h;
|
|
2973
2973
|
} else
|
|
2974
2974
|
u ? (_ = (await Promise.all(y.map(async (x) => {
|
|
2975
2975
|
const I = S(s, x);
|
|
2976
|
-
return await
|
|
2977
|
-
}))).every(Boolean), !(!_ && !t.isValid) && C()) : _ = h = await
|
|
2976
|
+
return await T(I && I._f ? { [x]: I } : I);
|
|
2977
|
+
}))).every(Boolean), !(!_ && !t.isValid) && C()) : _ = h = await T(s);
|
|
2978
2978
|
return b.state.next({
|
|
2979
2979
|
...!ue(u) || (g.isValid || m.isValid) && h !== t.isValid ? {} : { name: u },
|
|
2980
2980
|
...r.resolver || !u ? { isValid: h } : {},
|
|
@@ -2984,7 +2984,7 @@ function ei(e = {}) {
|
|
|
2984
2984
|
let h = {
|
|
2985
2985
|
...a.mount ? i : n
|
|
2986
2986
|
};
|
|
2987
|
-
return d && (h =
|
|
2987
|
+
return d && (h = ys(d.dirtyFields ? t.dirtyFields : t.touchedFields, h)), G(u) ? h : ue(u) ? S(h, u) : u.map((_) => S(h, _));
|
|
2988
2988
|
}, $e = (u, d) => ({
|
|
2989
2989
|
invalid: !!S((d || t).errors, u),
|
|
2990
2990
|
isDirty: !!S((d || t).dirtyFields, u),
|
|
@@ -3016,14 +3016,14 @@ function ei(e = {}) {
|
|
|
3016
3016
|
next: (h) => "values" in h && u(F(void 0, d), h)
|
|
3017
3017
|
}) : F(u, d, !0), Ae = (u) => b.state.subscribe({
|
|
3018
3018
|
next: (d) => {
|
|
3019
|
-
|
|
3019
|
+
Xa(u.name, d.name, u.exact) && Za(d, u.formState || g, mt, u.reRenderRoot) && u.callback({
|
|
3020
3020
|
values: { ...i },
|
|
3021
3021
|
...t,
|
|
3022
3022
|
...d,
|
|
3023
3023
|
defaultValues: n
|
|
3024
3024
|
});
|
|
3025
3025
|
}
|
|
3026
|
-
}).unsubscribe,
|
|
3026
|
+
}).unsubscribe, Ne = (u) => (a.mount = !0, m = {
|
|
3027
3027
|
...m,
|
|
3028
3028
|
...u.formState
|
|
3029
3029
|
}, Ae({
|
|
@@ -3076,7 +3076,7 @@ function ei(e = {}) {
|
|
|
3076
3076
|
ref: (y) => {
|
|
3077
3077
|
if (y) {
|
|
3078
3078
|
ve(u, d), h = S(s, u);
|
|
3079
|
-
const x = G(y.value) && y.querySelectorAll && y.querySelectorAll("input,select,textarea")[0] || y, I =
|
|
3079
|
+
const x = G(y.value) && y.querySelectorAll && y.querySelectorAll("input,select,textarea")[0] || y, I = Ua(x), $ = h._f.refs || [];
|
|
3080
3080
|
if (I ? $.find((P) => P === x) : x === h._f.ref)
|
|
3081
3081
|
return;
|
|
3082
3082
|
H(s, u, {
|
|
@@ -3084,7 +3084,7 @@ function ei(e = {}) {
|
|
|
3084
3084
|
...h._f,
|
|
3085
3085
|
...I ? {
|
|
3086
3086
|
refs: [
|
|
3087
|
-
...$.filter(
|
|
3087
|
+
...$.filter(Tt),
|
|
3088
3088
|
x,
|
|
3089
3089
|
...Array.isArray(S(n, u)) ? [{}] : []
|
|
3090
3090
|
],
|
|
@@ -3093,7 +3093,7 @@ function ei(e = {}) {
|
|
|
3093
3093
|
}
|
|
3094
3094
|
}), M(u, !1, void 0, x);
|
|
3095
3095
|
} else
|
|
3096
|
-
h = S(s, u, {}), h._f && (h._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(
|
|
3096
|
+
h = S(s, u, {}), h._f && (h._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(Da(o.array, u) && a.action) && o.unMount.add(u);
|
|
3097
3097
|
}
|
|
3098
3098
|
};
|
|
3099
3099
|
}, Ue = () => r.shouldFocusError && dt(s, X, o.mount), ht = (u) => {
|
|
@@ -3110,10 +3110,10 @@ function ei(e = {}) {
|
|
|
3110
3110
|
if (b.state.next({
|
|
3111
3111
|
isSubmitting: !0
|
|
3112
3112
|
}), r.resolver) {
|
|
3113
|
-
const { errors: x, values: I } = await
|
|
3113
|
+
const { errors: x, values: I } = await D();
|
|
3114
3114
|
A(), t.errors = x, y = Q(I);
|
|
3115
3115
|
} else
|
|
3116
|
-
await
|
|
3116
|
+
await T(s);
|
|
3117
3117
|
if (o.disabled.size)
|
|
3118
3118
|
for (const x of o.disabled)
|
|
3119
3119
|
J(y, x);
|
|
@@ -3138,7 +3138,7 @@ function ei(e = {}) {
|
|
|
3138
3138
|
throw _;
|
|
3139
3139
|
}, ze = (u, d = {}) => {
|
|
3140
3140
|
S(s, u) && (G(d.defaultValue) ? U(u, Q(S(n, u))) : (U(u, d.defaultValue), H(n, u, Q(d.defaultValue))), d.keepTouched || J(t.touchedFields, u), d.keepDirty || (J(t.dirtyFields, u), t.isDirty = d.defaultValue ? E(u, Q(S(n, u))) : E()), d.keepError || (J(t.errors, u), g.isValid && C()), b.state.next({ ...t }));
|
|
3141
|
-
},
|
|
3141
|
+
}, Re = (u, d = {}) => {
|
|
3142
3142
|
const h = u ? Q(u) : n, _ = Q(h), y = ie(u), x = y ? n : _;
|
|
3143
3143
|
if (d.keepDefaultValues || (n = h), !d.keepValues) {
|
|
3144
3144
|
if (d.keepDirtyValues) {
|
|
@@ -3147,8 +3147,8 @@ function ei(e = {}) {
|
|
|
3147
3147
|
...Object.keys(Ke(n, i))
|
|
3148
3148
|
]);
|
|
3149
3149
|
for (const $ of Array.from(I)) {
|
|
3150
|
-
const P = S(t.dirtyFields, $), ne = S(i, $),
|
|
3151
|
-
P && !G(ne) ? H(x, $, ne) : !P && !G(
|
|
3150
|
+
const P = S(t.dirtyFields, $), ne = S(i, $), Te = S(x, $);
|
|
3151
|
+
P && !G(ne) ? H(x, $, ne) : !P && !G(Te) && U($, Te);
|
|
3152
3152
|
}
|
|
3153
3153
|
} else {
|
|
3154
3154
|
if (Zt && G(u))
|
|
@@ -3196,7 +3196,7 @@ function ei(e = {}) {
|
|
|
3196
3196
|
isSubmitting: !1,
|
|
3197
3197
|
defaultValues: n
|
|
3198
3198
|
});
|
|
3199
|
-
}, nt = (u, d) =>
|
|
3199
|
+
}, nt = (u, d) => Re(de(u) ? u(i) : u, { ...r.resetOptions, ...d }), pt = (u, d = {}) => {
|
|
3200
3200
|
const h = S(s, u), _ = h && h._f;
|
|
3201
3201
|
if (_) {
|
|
3202
3202
|
const y = _.refs ? _.refs[0] : _.ref;
|
|
@@ -3217,7 +3217,7 @@ function ei(e = {}) {
|
|
|
3217
3217
|
handleSubmit: We,
|
|
3218
3218
|
setError: Be,
|
|
3219
3219
|
_subscribe: Ae,
|
|
3220
|
-
_runSchema:
|
|
3220
|
+
_runSchema: D,
|
|
3221
3221
|
_updateIsValidating: A,
|
|
3222
3222
|
_focusError: Ue,
|
|
3223
3223
|
_getWatch: F,
|
|
@@ -3227,7 +3227,7 @@ function ei(e = {}) {
|
|
|
3227
3227
|
_setDisabledField: st,
|
|
3228
3228
|
_setErrors: V,
|
|
3229
3229
|
_getFieldArray: B,
|
|
3230
|
-
_reset:
|
|
3230
|
+
_reset: Re,
|
|
3231
3231
|
_resetDefaultValues: () => de(r.defaultValues) && r.defaultValues().then((u) => {
|
|
3232
3232
|
nt(u, r.resetOptions), b.state.next({
|
|
3233
3233
|
isLoading: !1
|
|
@@ -3271,7 +3271,7 @@ function ei(e = {}) {
|
|
|
3271
3271
|
};
|
|
3272
3272
|
}
|
|
3273
3273
|
},
|
|
3274
|
-
subscribe:
|
|
3274
|
+
subscribe: Ne,
|
|
3275
3275
|
trigger: z,
|
|
3276
3276
|
register: ve,
|
|
3277
3277
|
handleSubmit: We,
|
|
@@ -3316,14 +3316,14 @@ function Ct(e = {}) {
|
|
|
3316
3316
|
formState: s
|
|
3317
3317
|
}, e.defaultValues && !de(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
3318
3318
|
else {
|
|
3319
|
-
const { formControl: a, ...o } =
|
|
3319
|
+
const { formControl: a, ...o } = ri(e);
|
|
3320
3320
|
r.current = {
|
|
3321
3321
|
...o,
|
|
3322
3322
|
formState: s
|
|
3323
3323
|
};
|
|
3324
3324
|
}
|
|
3325
3325
|
const i = r.current.control;
|
|
3326
|
-
return i._options = e,
|
|
3326
|
+
return i._options = e, Ba(() => {
|
|
3327
3327
|
const a = i._subscribe({
|
|
3328
3328
|
formState: i._proxyFormState,
|
|
3329
3329
|
callback: () => n({ ...i._formState }),
|
|
@@ -3356,46 +3356,46 @@ function Ct(e = {}) {
|
|
|
3356
3356
|
}), !((a = i._options.resetOptions) === null || a === void 0) && a.keepIsValid || i._setValid(), t.current = e.values, n((o) => ({ ...o }))) : i._resetDefaultValues();
|
|
3357
3357
|
}, [i, e.values]), ae.useEffect(() => {
|
|
3358
3358
|
i._state.mount || (i._setValid(), i._state.mount = !0), i._state.watch && (i._state.watch = !1, i._subjects.state.next({ ...i._formState })), i._removeUnmounted();
|
|
3359
|
-
}), r.current.formState = ae.useMemo(() =>
|
|
3359
|
+
}), r.current.formState = ae.useMemo(() => $a(s, i), [i, s]), r.current;
|
|
3360
3360
|
}
|
|
3361
3361
|
const Vr = (e, r, t) => {
|
|
3362
3362
|
if (e && "reportValidity" in e) {
|
|
3363
3363
|
const s = S(t, r);
|
|
3364
3364
|
e.setCustomValidity(s && s.message || ""), e.reportValidity();
|
|
3365
3365
|
}
|
|
3366
|
-
},
|
|
3366
|
+
}, si = (e, r) => {
|
|
3367
3367
|
for (const t in r.fields) {
|
|
3368
3368
|
const s = r.fields[t];
|
|
3369
3369
|
s && s.ref && "reportValidity" in s.ref ? Vr(s.ref, t, e) : s.refs && s.refs.forEach((n) => Vr(n, t, e));
|
|
3370
3370
|
}
|
|
3371
|
-
},
|
|
3372
|
-
r.shouldUseNativeValidation &&
|
|
3371
|
+
}, ni = (e, r) => {
|
|
3372
|
+
r.shouldUseNativeValidation && si(e, r);
|
|
3373
3373
|
const t = {};
|
|
3374
3374
|
for (const s in e) {
|
|
3375
3375
|
const n = S(r.fields, s), i = Object.assign(e[s] || {}, { ref: n && n.ref });
|
|
3376
|
-
if (
|
|
3376
|
+
if (ai(r.names || Object.keys(e), s)) {
|
|
3377
3377
|
const a = Object.assign({}, S(t, s));
|
|
3378
3378
|
H(a, "root", i), H(t, s, a);
|
|
3379
3379
|
} else
|
|
3380
3380
|
H(t, s, i);
|
|
3381
3381
|
}
|
|
3382
3382
|
return t;
|
|
3383
|
-
},
|
|
3383
|
+
}, ai = (e, r) => e.some((t) => t.startsWith(r + "."));
|
|
3384
3384
|
var St = function(e, r, t) {
|
|
3385
3385
|
return t === void 0 && (t = {}), function(s, n, i) {
|
|
3386
3386
|
try {
|
|
3387
3387
|
var a = !i.shouldUseNativeValidation && i.criteriaMode === "all";
|
|
3388
|
-
return Promise.resolve(/* @__PURE__ */
|
|
3388
|
+
return Promise.resolve(/* @__PURE__ */ ya(e, s, Object.assign({}, r, { abortPipeEarly: !a }))).then(function(o) {
|
|
3389
3389
|
if (o.issues) {
|
|
3390
3390
|
for (var c = {}; o.issues.length; ) {
|
|
3391
|
-
var f = o.issues[0], p = /* @__PURE__ */
|
|
3391
|
+
var f = o.issues[0], p = /* @__PURE__ */ ca(f);
|
|
3392
3392
|
if (p && (c[p] || (c[p] = { message: f.message, type: f.type }), a)) {
|
|
3393
3393
|
var g = c[p].types, m = g && g[f.type];
|
|
3394
|
-
c[p] =
|
|
3394
|
+
c[p] = ms(p, a, c, f.type, m ? [].concat(m, f.message) : f.message);
|
|
3395
3395
|
}
|
|
3396
3396
|
o.issues.shift();
|
|
3397
3397
|
}
|
|
3398
|
-
return { values: {}, errors:
|
|
3398
|
+
return { values: {}, errors: ni(c, i) };
|
|
3399
3399
|
}
|
|
3400
3400
|
return { values: t.raw ? s : o.output, errors: {} };
|
|
3401
3401
|
});
|
|
@@ -3404,19 +3404,19 @@ var St = function(e, r, t) {
|
|
|
3404
3404
|
}
|
|
3405
3405
|
};
|
|
3406
3406
|
};
|
|
3407
|
-
const Mr = 27, Lr = 12,
|
|
3407
|
+
const Mr = 27, Lr = 12, Nr = 10, ii = et("enum"), oi = (e, r) => {
|
|
3408
3408
|
const t = {
|
|
3409
3409
|
min: e.minSelected ?? 0,
|
|
3410
3410
|
max: e.maxSelected ?? e.options.length
|
|
3411
3411
|
};
|
|
3412
3412
|
return St(/* @__PURE__ */ Ce({
|
|
3413
|
-
checked: /* @__PURE__ */ Me(/* @__PURE__ */
|
|
3413
|
+
checked: /* @__PURE__ */ Me(/* @__PURE__ */ cs(/* @__PURE__ */ le(), /* @__PURE__ */ is()), /* @__PURE__ */ Kt((s) => Object.entries(s).filter(([n, i]) => i).map(([n, i]) => n)), /* @__PURE__ */ ct(t.max, r("validation_multiple_choice_max", {
|
|
3414
3414
|
count: t.max
|
|
3415
3415
|
})), /* @__PURE__ */ Ze(t.min, r("validation_multiple_choice_min", {
|
|
3416
3416
|
count: t.min
|
|
3417
3417
|
})))
|
|
3418
3418
|
}));
|
|
3419
|
-
},
|
|
3419
|
+
}, li = Kr(({
|
|
3420
3420
|
option: e,
|
|
3421
3421
|
...r
|
|
3422
3422
|
}, t) => l(be, {
|
|
@@ -3430,16 +3430,16 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3430
3430
|
htmlFor: r.id,
|
|
3431
3431
|
children: e.label
|
|
3432
3432
|
})]
|
|
3433
|
-
})),
|
|
3433
|
+
})), Rr = xt("gutter-stable flex w-full flex-1 flex-wrap gap-2 overflow-y-auto rounded-xl p-2.5 pr-4", {
|
|
3434
3434
|
variants: {
|
|
3435
3435
|
variant: {
|
|
3436
3436
|
// In cases where there is only one option, we want to center it
|
|
3437
3437
|
singleOption: "justify-center",
|
|
3438
3438
|
// Two choices, one answer
|
|
3439
|
-
booleanLike:
|
|
3439
|
+
booleanLike: ds
|
|
3440
3440
|
}
|
|
3441
3441
|
}
|
|
3442
|
-
}),
|
|
3442
|
+
}), ci = ({
|
|
3443
3443
|
input: e,
|
|
3444
3444
|
onSubmitSuccess: r
|
|
3445
3445
|
}) => {
|
|
@@ -3454,21 +3454,21 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3454
3454
|
}
|
|
3455
3455
|
} = Ct({
|
|
3456
3456
|
defaultValues: {
|
|
3457
|
-
checked: s ? {} :
|
|
3457
|
+
checked: s ? {} : ii(t) ? Object.fromEntries(t.value.map((m) => [m, !0])) : {}
|
|
3458
3458
|
},
|
|
3459
|
-
resolver:
|
|
3459
|
+
resolver: oi(e.config, i)
|
|
3460
3460
|
}), f = Jt();
|
|
3461
3461
|
return n ? l(be, {
|
|
3462
3462
|
children: [l("ul", {
|
|
3463
3463
|
style: {
|
|
3464
|
-
maxHeight: 6.5 * Mr + 5 * Lr + 2 *
|
|
3464
|
+
maxHeight: 6.5 * Mr + 5 * Lr + 2 * Nr
|
|
3465
3465
|
},
|
|
3466
|
-
class:
|
|
3466
|
+
class: Rr({
|
|
3467
3467
|
variant: "booleanLike"
|
|
3468
3468
|
}),
|
|
3469
3469
|
children: e.config.options.map((m, b) => l("li", {
|
|
3470
|
-
class:
|
|
3471
|
-
children: l(
|
|
3470
|
+
class: fs,
|
|
3471
|
+
children: l(hs, {
|
|
3472
3472
|
type: "submit",
|
|
3473
3473
|
ref: (k) => {
|
|
3474
3474
|
k && b === 0 && (f.current = k);
|
|
@@ -3505,9 +3505,9 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3505
3505
|
class: "flex items-center gap-1",
|
|
3506
3506
|
children: [l("ul", {
|
|
3507
3507
|
style: {
|
|
3508
|
-
maxHeight: 6.5 * Mr + 5 * Lr + 2 *
|
|
3508
|
+
maxHeight: 6.5 * Mr + 5 * Lr + 2 * Nr
|
|
3509
3509
|
},
|
|
3510
|
-
class:
|
|
3510
|
+
class: Rr({
|
|
3511
3511
|
variant: e.config.options.length === 1 ? "singleOption" : void 0
|
|
3512
3512
|
}),
|
|
3513
3513
|
children: e.config.options.map((m, b) => {
|
|
@@ -3517,7 +3517,7 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3517
3517
|
} = a(k);
|
|
3518
3518
|
return l("li", {
|
|
3519
3519
|
class: "relative",
|
|
3520
|
-
children: l(
|
|
3520
|
+
children: l(li, {
|
|
3521
3521
|
option: m,
|
|
3522
3522
|
autoFocus: b === 0,
|
|
3523
3523
|
ref: (A) => {
|
|
@@ -3550,18 +3550,18 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3550
3550
|
})
|
|
3551
3551
|
})]
|
|
3552
3552
|
});
|
|
3553
|
-
},
|
|
3553
|
+
}, ui = et("number"), di = (e, r) => {
|
|
3554
3554
|
const t = e.min ?? Number.MIN_SAFE_INTEGER, s = e.max ?? Number.MAX_SAFE_INTEGER, n = e.decimalCases ?? 0;
|
|
3555
3555
|
return St(/* @__PURE__ */ Ce({
|
|
3556
|
-
number: /* @__PURE__ */ Me(/* @__PURE__ */
|
|
3556
|
+
number: /* @__PURE__ */ Me(/* @__PURE__ */ os(r("validation_number")), /* @__PURE__ */ rs(t, r("validation_number_min", {
|
|
3557
3557
|
min: t
|
|
3558
|
-
})), /* @__PURE__ */
|
|
3558
|
+
})), /* @__PURE__ */ ts(s, r("validation_number_max", {
|
|
3559
3559
|
max: s
|
|
3560
|
-
})), /* @__PURE__ */
|
|
3560
|
+
})), /* @__PURE__ */ Qr((i) => i === Number(i.toFixed(n)), r("validation_number_decimal_cases", {
|
|
3561
3561
|
count: n
|
|
3562
3562
|
})))
|
|
3563
3563
|
}));
|
|
3564
|
-
},
|
|
3564
|
+
}, fi = ({
|
|
3565
3565
|
input: e,
|
|
3566
3566
|
onSubmitSuccess: r
|
|
3567
3567
|
}) => {
|
|
@@ -3576,9 +3576,9 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3576
3576
|
}
|
|
3577
3577
|
} = Ct({
|
|
3578
3578
|
defaultValues: {
|
|
3579
|
-
number:
|
|
3579
|
+
number: ui(s) ? s.value : t ? Number(t) : void 0
|
|
3580
3580
|
},
|
|
3581
|
-
resolver:
|
|
3581
|
+
resolver: di(e.config, n)
|
|
3582
3582
|
}), {
|
|
3583
3583
|
ref: c,
|
|
3584
3584
|
...f
|
|
@@ -3627,20 +3627,20 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3627
3627
|
error: o.number
|
|
3628
3628
|
})]
|
|
3629
3629
|
});
|
|
3630
|
-
},
|
|
3631
|
-
const r = /* @__PURE__ */ Me(/* @__PURE__ */ le(e("validation_country_code")), /* @__PURE__ */ Ht(
|
|
3630
|
+
}, hi = "44", pi = /^[0-9 ]+$/, mi = et("string"), yi = et("phone"), bi = (e) => {
|
|
3631
|
+
const r = /* @__PURE__ */ Me(/* @__PURE__ */ le(e("validation_country_code")), /* @__PURE__ */ Ht(pi, e("validation_country_code"))), t = /* @__PURE__ */ Me(/* @__PURE__ */ le(e("validation_phone")), /* @__PURE__ */ Ze(1, e("validation_phone")), /* @__PURE__ */ Kt((s) => s.replace(/[^0-9]/g, "")));
|
|
3632
3632
|
return St(/* @__PURE__ */ Ce({
|
|
3633
3633
|
countryCode: r,
|
|
3634
3634
|
phoneNumber: t
|
|
3635
3635
|
}));
|
|
3636
|
-
},
|
|
3636
|
+
}, gi = ({
|
|
3637
3637
|
input: e,
|
|
3638
3638
|
onSubmitSuccess: r
|
|
3639
3639
|
}) => {
|
|
3640
3640
|
var w;
|
|
3641
3641
|
const t = e.key ? (w = q.current$.value.flow) == null ? void 0 : w.data.submissions[e.key] : void 0, {
|
|
3642
3642
|
t: s
|
|
3643
|
-
} = re(), [n, i] = ke(), a =
|
|
3643
|
+
} = re(), [n, i] = ke(), a = mi(t) ? ba(t.value) : yi(t) ? t.value : void 0, {
|
|
3644
3644
|
register: o,
|
|
3645
3645
|
handleSubmit: c,
|
|
3646
3646
|
formState: {
|
|
@@ -3649,10 +3649,10 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3649
3649
|
watch: p
|
|
3650
3650
|
} = Ct({
|
|
3651
3651
|
defaultValues: {
|
|
3652
|
-
countryCode: (a == null ? void 0 : a.countryCode) ?? e.config.defaultValue.countryCode ??
|
|
3652
|
+
countryCode: (a == null ? void 0 : a.countryCode) ?? e.config.defaultValue.countryCode ?? hi,
|
|
3653
3653
|
phoneNumber: (a == null ? void 0 : a.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
|
|
3654
3654
|
},
|
|
3655
|
-
resolver:
|
|
3655
|
+
resolver: bi(s)
|
|
3656
3656
|
}), {
|
|
3657
3657
|
ref: g,
|
|
3658
3658
|
...m
|
|
@@ -3667,10 +3667,10 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3667
3667
|
onSubmit: c((C) => {
|
|
3668
3668
|
const A = C.phoneNumber.replace(/[^0-9]/g, ""), v = C.countryCode.replace(/[^0-9]/g, "");
|
|
3669
3669
|
i(void 0);
|
|
3670
|
-
const
|
|
3671
|
-
if (V <
|
|
3670
|
+
const N = e.config.minChars ?? 7, V = A.length + v.length;
|
|
3671
|
+
if (V < N)
|
|
3672
3672
|
return i(s("validation_phone_min_chars", {
|
|
3673
|
-
count:
|
|
3673
|
+
count: N
|
|
3674
3674
|
}));
|
|
3675
3675
|
const M = e.config.maxChars;
|
|
3676
3676
|
if (M != null && V > M)
|
|
@@ -3734,14 +3734,14 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3734
3734
|
}
|
|
3735
3735
|
})]
|
|
3736
3736
|
});
|
|
3737
|
-
}, yt = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)),
|
|
3738
|
-
time:
|
|
3737
|
+
}, yt = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)), Tr = (e, r, t, s) => t !== void 0 && s * 1e3 > zr ? e("submission_available_at", {
|
|
3738
|
+
time: Wr(t, r)
|
|
3739
3739
|
}) : e("submission_cooldown", {
|
|
3740
3740
|
count: s
|
|
3741
|
-
}),
|
|
3741
|
+
}), vi = (e, r) => {
|
|
3742
3742
|
const t = e == null ? void 0 : e.trim();
|
|
3743
3743
|
return t && t !== "Submit" ? t : r("submit");
|
|
3744
|
-
},
|
|
3744
|
+
}, xi = ({
|
|
3745
3745
|
input: e,
|
|
3746
3746
|
onSubmitSuccess: r
|
|
3747
3747
|
}) => {
|
|
@@ -3751,11 +3751,11 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3751
3751
|
} = re(), {
|
|
3752
3752
|
availableAt: n
|
|
3753
3753
|
} = e.config, [i, a] = ke(() => yt(n)), [o, c] = ke("");
|
|
3754
|
-
|
|
3754
|
+
Hr(() => {
|
|
3755
3755
|
const p = yt(n);
|
|
3756
3756
|
if (a(p), p === 0)
|
|
3757
3757
|
return;
|
|
3758
|
-
c(
|
|
3758
|
+
c(Tr(t, s, n, p));
|
|
3759
3759
|
const g = setInterval(() => {
|
|
3760
3760
|
const m = yt(n);
|
|
3761
3761
|
a(m), !(m > 0) && (clearInterval(g), c(t("submission_cooldown_ready")));
|
|
@@ -3777,7 +3777,7 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3777
3777
|
class: "flex items-center gap-1.5",
|
|
3778
3778
|
children: [l("span", {
|
|
3779
3779
|
class: "inline-flex items-center text-sm font-medium",
|
|
3780
|
-
children:
|
|
3780
|
+
children: vi(e.config.label, t)
|
|
3781
3781
|
}), l("svg", {
|
|
3782
3782
|
stroke: "currentColor",
|
|
3783
3783
|
"stroke-width": "1.5",
|
|
@@ -3797,16 +3797,16 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3797
3797
|
id: "submit-cooldown",
|
|
3798
3798
|
"aria-hidden": "true",
|
|
3799
3799
|
class: "text-neutral-11 text-xs",
|
|
3800
|
-
children:
|
|
3800
|
+
children: Tr(t, s, n, i)
|
|
3801
3801
|
}), l("p", {
|
|
3802
3802
|
role: "status",
|
|
3803
3803
|
class: "sr-only",
|
|
3804
3804
|
children: o
|
|
3805
3805
|
})]
|
|
3806
3806
|
});
|
|
3807
|
-
},
|
|
3808
|
-
e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight,
|
|
3809
|
-
},
|
|
3807
|
+
}, wi = 160, Dr = (e) => {
|
|
3808
|
+
e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, wi)}px`;
|
|
3809
|
+
}, _i = {
|
|
3810
3810
|
date: {
|
|
3811
3811
|
type: "date",
|
|
3812
3812
|
inputMode: "text"
|
|
@@ -3825,7 +3825,7 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3825
3825
|
inputMode: "url",
|
|
3826
3826
|
formNoValidate: !0
|
|
3827
3827
|
}
|
|
3828
|
-
},
|
|
3828
|
+
}, ki = et("string"), Ci = (e, r) => {
|
|
3829
3829
|
const t = {
|
|
3830
3830
|
maxLength: r("validation_max_chars", {
|
|
3831
3831
|
count: e.maxChars ?? 999
|
|
@@ -3837,12 +3837,12 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3837
3837
|
return St(/* @__PURE__ */ Ce({
|
|
3838
3838
|
text: {
|
|
3839
3839
|
date: /* @__PURE__ */ Me(/* @__PURE__ */ le(r("validation_date")), /* @__PURE__ */ Ht(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
|
|
3840
|
-
email: /* @__PURE__ */ Me(/* @__PURE__ */ le(r("validation_email")), /* @__PURE__ */
|
|
3840
|
+
email: /* @__PURE__ */ Me(/* @__PURE__ */ le(r("validation_email")), /* @__PURE__ */ es(r("validation_email")), /* @__PURE__ */ Ze(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ct(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
3841
3841
|
text: /* @__PURE__ */ Me(/* @__PURE__ */ le(), /* @__PURE__ */ Ze(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ct(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
3842
|
-
url: /* @__PURE__ */ Me(/* @__PURE__ */ le(r("validation_url")), /* @__PURE__ */
|
|
3842
|
+
url: /* @__PURE__ */ Me(/* @__PURE__ */ le(r("validation_url")), /* @__PURE__ */ ss(r("validation_url")), /* @__PURE__ */ Ze(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ct(e.maxChars ?? 1 / 0, t.maxLength))
|
|
3843
3843
|
}[e.format]
|
|
3844
3844
|
}));
|
|
3845
|
-
},
|
|
3845
|
+
}, Si = ({
|
|
3846
3846
|
input: e,
|
|
3847
3847
|
onSubmitSuccess: r
|
|
3848
3848
|
}) => {
|
|
@@ -3858,9 +3858,9 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3858
3858
|
}
|
|
3859
3859
|
} = Ct({
|
|
3860
3860
|
defaultValues: {
|
|
3861
|
-
text:
|
|
3861
|
+
text: ki(s) ? s.value : n ?? ""
|
|
3862
3862
|
},
|
|
3863
|
-
resolver:
|
|
3863
|
+
resolver: Ci(e.config, t)
|
|
3864
3864
|
}), {
|
|
3865
3865
|
ref: p,
|
|
3866
3866
|
...g
|
|
@@ -3868,7 +3868,7 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3868
3868
|
required: !e.config.optional
|
|
3869
3869
|
}), m = ye();
|
|
3870
3870
|
Le(() => {
|
|
3871
|
-
m.current && (m.current instanceof HTMLTextAreaElement &&
|
|
3871
|
+
m.current && (m.current instanceof HTMLTextAreaElement && Dr(m.current), m.current.focus(), m.current.select());
|
|
3872
3872
|
}, []);
|
|
3873
3873
|
const b = e.config.maxChars, k = i && b !== void 0 ? c("text").length : void 0;
|
|
3874
3874
|
return l("form", {
|
|
@@ -3891,7 +3891,7 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3891
3891
|
maxLength: b,
|
|
3892
3892
|
autoFocus: !0,
|
|
3893
3893
|
"aria-describedby": k !== void 0 ? "chat-input-count" : void 0,
|
|
3894
|
-
onInput: (C) =>
|
|
3894
|
+
onInput: (C) => Dr(C.currentTarget),
|
|
3895
3895
|
onKeyDown: (C) => {
|
|
3896
3896
|
var A;
|
|
3897
3897
|
C.key === "Enter" && (C.ctrlKey || C.metaKey) && (C.preventDefault(), (A = C.currentTarget.form) == null || A.requestSubmit());
|
|
@@ -3907,7 +3907,7 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3907
3907
|
}) : l("input", {
|
|
3908
3908
|
id: "chat-input",
|
|
3909
3909
|
...g,
|
|
3910
|
-
...
|
|
3910
|
+
..._i[e.config.format],
|
|
3911
3911
|
autocomplete: "off",
|
|
3912
3912
|
autoCapitalize: "off",
|
|
3913
3913
|
autoCorrect: "off",
|
|
@@ -3936,16 +3936,16 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3936
3936
|
error: f.text
|
|
3937
3937
|
})]
|
|
3938
3938
|
});
|
|
3939
|
-
},
|
|
3940
|
-
text:
|
|
3941
|
-
phone:
|
|
3942
|
-
"multiple-choice":
|
|
3943
|
-
boolean:
|
|
3944
|
-
file:
|
|
3945
|
-
submit:
|
|
3946
|
-
address:
|
|
3947
|
-
number:
|
|
3948
|
-
},
|
|
3939
|
+
}, Ai = {
|
|
3940
|
+
text: Si,
|
|
3941
|
+
phone: gi,
|
|
3942
|
+
"multiple-choice": ci,
|
|
3943
|
+
boolean: Ia,
|
|
3944
|
+
file: Na,
|
|
3945
|
+
submit: xi,
|
|
3946
|
+
address: ka,
|
|
3947
|
+
number: fi
|
|
3948
|
+
}, Ii = ({
|
|
3949
3949
|
logger: e,
|
|
3950
3950
|
analytics: r
|
|
3951
3951
|
}) => {
|
|
@@ -3964,7 +3964,7 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3964
3964
|
onPointerDownCapture: t ? n : void 0,
|
|
3965
3965
|
onKeyDownCapture: t ? n : void 0,
|
|
3966
3966
|
children: t ? (() => {
|
|
3967
|
-
const a =
|
|
3967
|
+
const a = Ai[t.type];
|
|
3968
3968
|
return l(a, {
|
|
3969
3969
|
logger: e,
|
|
3970
3970
|
analytics: r,
|
|
@@ -3990,30 +3990,30 @@ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
|
|
|
3990
3990
|
})
|
|
3991
3991
|
});
|
|
3992
3992
|
};
|
|
3993
|
-
function
|
|
3993
|
+
function Ei(e) {
|
|
3994
3994
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3995
3995
|
}
|
|
3996
|
-
var
|
|
3996
|
+
var Fi = function(e) {
|
|
3997
3997
|
return e instanceof RegExp;
|
|
3998
|
-
},
|
|
3998
|
+
}, Vi = function(r) {
|
|
3999
3999
|
var t = /[\\^$.*+?()[\]{}|]/g, s = RegExp(t.source);
|
|
4000
4000
|
return r && s.test(r) ? r.replace(t, "\\$&") : r;
|
|
4001
|
-
},
|
|
4001
|
+
}, _s = function(e) {
|
|
4002
4002
|
return typeof e == "string";
|
|
4003
|
-
},
|
|
4003
|
+
}, Mi = function(e) {
|
|
4004
4004
|
var r = [];
|
|
4005
4005
|
return e.forEach(function(t) {
|
|
4006
4006
|
Array.isArray(t) ? r = r.concat(t) : r.push(t);
|
|
4007
4007
|
}), r;
|
|
4008
4008
|
};
|
|
4009
|
-
function
|
|
4009
|
+
function Li(e, r, t) {
|
|
4010
4010
|
var s = 0, n = 0;
|
|
4011
4011
|
if (e === "")
|
|
4012
4012
|
return e;
|
|
4013
|
-
if (!e || !
|
|
4013
|
+
if (!e || !_s(e))
|
|
4014
4014
|
throw new TypeError("First argument to react-string-replace#replaceString must be a string");
|
|
4015
4015
|
var i = r;
|
|
4016
|
-
|
|
4016
|
+
Fi(i) || (i = new RegExp("(" + Vi(i) + ")", "gi"));
|
|
4017
4017
|
for (var a = e.split(i), o = 1, c = a.length; o < c; o += 2) {
|
|
4018
4018
|
if (a[o] === void 0 || a[o - 1] === void 0) {
|
|
4019
4019
|
console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
|
|
@@ -4023,14 +4023,14 @@ function Vi(e, r, t) {
|
|
|
4023
4023
|
}
|
|
4024
4024
|
return a;
|
|
4025
4025
|
}
|
|
4026
|
-
var
|
|
4027
|
-
return Array.isArray(r) || (r = [r]),
|
|
4028
|
-
return
|
|
4026
|
+
var Ni = function(r, t, s) {
|
|
4027
|
+
return Array.isArray(r) || (r = [r]), Mi(r.map(function(n) {
|
|
4028
|
+
return _s(n) ? Li(n, t, s) : n;
|
|
4029
4029
|
}));
|
|
4030
4030
|
};
|
|
4031
|
-
const ot = /* @__PURE__ */
|
|
4032
|
-
const r = ot(e,
|
|
4033
|
-
const [, f, p] = o.match(
|
|
4031
|
+
const ot = /* @__PURE__ */ Ei(Ni), Ri = /(\[[^\]]+\]\([^)]+\))/g, Ti = /\[([^\]]+)\]\(([^)]+)\)/, Di = /(https?:\/\/[^\s]+)/g, Oi = /_(.*?)_/g, ji = /\*\*(.*?)\*\*/g, $i = /(\\n|\n)/g, Or = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Bi = (e) => {
|
|
4032
|
+
const r = ot(e, Ri, (o, c) => {
|
|
4033
|
+
const [, f, p] = o.match(Ti) ?? [];
|
|
4034
4034
|
return p ? l("a", {
|
|
4035
4035
|
class: Or,
|
|
4036
4036
|
href: p,
|
|
@@ -4038,18 +4038,18 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4038
4038
|
}, p + c) : l("span", {
|
|
4039
4039
|
children: "INVALID LINK"
|
|
4040
4040
|
});
|
|
4041
|
-
}), t = ot(r,
|
|
4041
|
+
}), t = ot(r, Di, (o, c) => l("a", {
|
|
4042
4042
|
class: Or,
|
|
4043
4043
|
href: o,
|
|
4044
4044
|
children: o
|
|
4045
|
-
}, o + c)), s = ot(t,
|
|
4045
|
+
}, o + c)), s = ot(t, Oi, (o, c) => l("em", {
|
|
4046
4046
|
children: o
|
|
4047
|
-
}, o + c)), n = ot(s,
|
|
4047
|
+
}, o + c)), n = ot(s, ji, (o, c) => l("strong", {
|
|
4048
4048
|
children: o
|
|
4049
4049
|
}, o + c));
|
|
4050
4050
|
let i = 0;
|
|
4051
|
-
return ot(n,
|
|
4052
|
-
},
|
|
4051
|
+
return ot(n, $i, () => l("br", {}, `br-${i++}`));
|
|
4052
|
+
}, Pi = xt("select-text max-w-[min(100%,24rem)] [text-wrap:pretty] leading-snug flex-shrink min-w-[2rem] py-2 px-3 rounded-[18px] min-h-[36px] break-words relative", {
|
|
4053
4053
|
variants: {
|
|
4054
4054
|
side: {
|
|
4055
4055
|
left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
|
|
@@ -4063,7 +4063,7 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4063
4063
|
defaultVariants: {
|
|
4064
4064
|
side: "left"
|
|
4065
4065
|
}
|
|
4066
|
-
}),
|
|
4066
|
+
}), qi = ({
|
|
4067
4067
|
children: e,
|
|
4068
4068
|
className: r,
|
|
4069
4069
|
animate: t,
|
|
@@ -4073,20 +4073,33 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4073
4073
|
style: {
|
|
4074
4074
|
transformOrigin: s === "left" ? "0% 50%" : "100% 50%"
|
|
4075
4075
|
},
|
|
4076
|
-
class:
|
|
4076
|
+
class: Pi({
|
|
4077
4077
|
className: r,
|
|
4078
4078
|
side: s,
|
|
4079
4079
|
animate: t
|
|
4080
4080
|
}),
|
|
4081
4081
|
...n,
|
|
4082
4082
|
children: e
|
|
4083
|
-
}), jr = /* @__PURE__ */ new Map(),
|
|
4083
|
+
}), jr = /* @__PURE__ */ new Map(), $r = Gs({
|
|
4084
|
+
overrides: {},
|
|
4085
|
+
locale: void 0
|
|
4086
|
+
}), Ui = (e, r) => {
|
|
4087
|
+
const t = r == null ? void 0 : r.trim();
|
|
4088
|
+
if (!t)
|
|
4089
|
+
return e("job_alerts_privacy");
|
|
4090
|
+
const s = e("job_alerts_privacy_sender", {
|
|
4091
|
+
employer: t
|
|
4092
|
+
});
|
|
4093
|
+
return e("job_alerts_privacy") !== $r("job_alerts_privacy") && s === $r("job_alerts_privacy_sender", {
|
|
4094
|
+
employer: t
|
|
4095
|
+
}) ? e("job_alerts_privacy") : s;
|
|
4096
|
+
}, Wi = ({
|
|
4084
4097
|
flow: e,
|
|
4085
4098
|
rpcClient: r
|
|
4086
4099
|
}) => {
|
|
4087
4100
|
const {
|
|
4088
4101
|
t
|
|
4089
|
-
} = re(), s = e.data.flowSessionId, n = jr.get(s) ??
|
|
4102
|
+
} = re(), s = e.data.flowSessionId, n = jr.get(s) ?? Js("offer");
|
|
4090
4103
|
jr.set(s, n);
|
|
4091
4104
|
const i = (c) => {
|
|
4092
4105
|
const f = e.data.submissions[c];
|
|
@@ -4103,7 +4116,7 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4103
4116
|
if (!(n.value !== "offer" && n.value !== "error")) {
|
|
4104
4117
|
n.value = "saving";
|
|
4105
4118
|
try {
|
|
4106
|
-
await
|
|
4119
|
+
await tn(r, {
|
|
4107
4120
|
contact: {
|
|
4108
4121
|
email: a,
|
|
4109
4122
|
first_name: i("first_name"),
|
|
@@ -4144,10 +4157,10 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4144
4157
|
})]
|
|
4145
4158
|
}), l("p", {
|
|
4146
4159
|
class: "text-xs",
|
|
4147
|
-
children: t
|
|
4160
|
+
children: Ui(t, e.employer)
|
|
4148
4161
|
})]
|
|
4149
4162
|
});
|
|
4150
|
-
},
|
|
4163
|
+
}, zi = ({
|
|
4151
4164
|
message: e
|
|
4152
4165
|
}) => l("div", {
|
|
4153
4166
|
class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
|
|
@@ -4171,7 +4184,7 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4171
4184
|
})
|
|
4172
4185
|
})]
|
|
4173
4186
|
})
|
|
4174
|
-
}),
|
|
4187
|
+
}), Hi = ({
|
|
4175
4188
|
className: e,
|
|
4176
4189
|
...r
|
|
4177
4190
|
}) => l("div", {
|
|
@@ -4189,10 +4202,10 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4189
4202
|
}
|
|
4190
4203
|
}))
|
|
4191
4204
|
}) : void 0
|
|
4192
|
-
}),
|
|
4205
|
+
}), Ki = {
|
|
4193
4206
|
bot: "left",
|
|
4194
4207
|
user: "right"
|
|
4195
|
-
},
|
|
4208
|
+
}, Gi = xt("w-full select-none py-2 text-wrap-balance text-center text-[10px] uppercase tracking-widest drop-shadow-[0_1.5px_var(--i-color-n-1)]", {
|
|
4196
4209
|
variants: {
|
|
4197
4210
|
variant: {
|
|
4198
4211
|
info: "text-neutral-11",
|
|
@@ -4201,7 +4214,7 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4201
4214
|
success: "text-system-success"
|
|
4202
4215
|
}
|
|
4203
4216
|
}
|
|
4204
|
-
}),
|
|
4217
|
+
}), Ji = ({
|
|
4205
4218
|
env: e,
|
|
4206
4219
|
lastSentMessageFooter: r,
|
|
4207
4220
|
rpcClient: t
|
|
@@ -4217,28 +4230,28 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4217
4230
|
children: [l("li", {
|
|
4218
4231
|
class: "flex",
|
|
4219
4232
|
tabIndex: f === i.length - 1 ? -1 : void 0,
|
|
4220
|
-
children: [o && c.groupId === o && !i.slice(f + 1).some((p) => p.groupId === o) ? r : null,
|
|
4233
|
+
children: [o && c.groupId === o && !i.slice(f + 1).some((p) => p.groupId === o) ? r : null, Zs(c).with({
|
|
4221
4234
|
type: "system"
|
|
4222
4235
|
}, (p) => l("p", {
|
|
4223
|
-
class:
|
|
4236
|
+
class: Gi({
|
|
4224
4237
|
variant: p.variant
|
|
4225
4238
|
}),
|
|
4226
4239
|
children: p.text
|
|
4227
4240
|
})).with({
|
|
4228
4241
|
type: "text",
|
|
4229
|
-
author:
|
|
4242
|
+
author: Xs.union("bot", "user")
|
|
4230
4243
|
}, (p) => {
|
|
4231
|
-
const g = f === i.length - 1, m = p.author === "bot" ?
|
|
4244
|
+
const g = f === i.length - 1, m = p.author === "bot" ? Bi(p.text) : p.text;
|
|
4232
4245
|
return l(be, {
|
|
4233
|
-
children: l(
|
|
4246
|
+
children: l(qi, {
|
|
4234
4247
|
animate: g,
|
|
4235
|
-
side:
|
|
4248
|
+
side: Ki[p.author],
|
|
4236
4249
|
children: m
|
|
4237
4250
|
}, f)
|
|
4238
4251
|
});
|
|
4239
4252
|
}).with({
|
|
4240
4253
|
type: "link"
|
|
4241
|
-
}, (p) => l(
|
|
4254
|
+
}, (p) => l(zi, {
|
|
4242
4255
|
message: p
|
|
4243
4256
|
})).with({
|
|
4244
4257
|
type: "image"
|
|
@@ -4250,7 +4263,7 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4250
4263
|
}
|
|
4251
4264
|
})).with({
|
|
4252
4265
|
type: "file"
|
|
4253
|
-
}, (p) => l(
|
|
4266
|
+
}, (p) => l(Fa, {
|
|
4254
4267
|
class: p.author === "bot" ? void 0 : "ml-auto",
|
|
4255
4268
|
file: {
|
|
4256
4269
|
name: p.fileName,
|
|
@@ -4273,7 +4286,7 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4273
4286
|
});
|
|
4274
4287
|
}).exhaustive()]
|
|
4275
4288
|
}), f === a && (n != null && n.jobAlerts) && t ? l("li", {
|
|
4276
|
-
children: l(
|
|
4289
|
+
children: l(Wi, {
|
|
4277
4290
|
flow: n,
|
|
4278
4291
|
rpcClient: t
|
|
4279
4292
|
}, n.data.flowSessionId)
|
|
@@ -4290,9 +4303,9 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4290
4303
|
"aria-label": s("captcha_check"),
|
|
4291
4304
|
class: "w-full max-w-[min(100%,24rem)] rounded-md"
|
|
4292
4305
|
})
|
|
4293
|
-
}, "captcha"), l(
|
|
4306
|
+
}, "captcha"), l(Hi, {}, "typing")]
|
|
4294
4307
|
});
|
|
4295
|
-
},
|
|
4308
|
+
}, eo = ({
|
|
4296
4309
|
logger: e,
|
|
4297
4310
|
apiClient: r,
|
|
4298
4311
|
rpcClient: t,
|
|
@@ -4307,7 +4320,7 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4307
4320
|
const o = q.viewState$.value, {
|
|
4308
4321
|
chatRef: c,
|
|
4309
4322
|
chatService: f
|
|
4310
|
-
} =
|
|
4323
|
+
} = Ys(), {
|
|
4311
4324
|
t: p
|
|
4312
4325
|
} = re(), [g, m] = ke();
|
|
4313
4326
|
return Le(() => {
|
|
@@ -4324,15 +4337,15 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4324
4337
|
if (ce.scrollToEnd(), q.setInput(void 0), k.data.isFinished)
|
|
4325
4338
|
return;
|
|
4326
4339
|
const C = () => {
|
|
4327
|
-
const
|
|
4328
|
-
!
|
|
4340
|
+
const D = q.current$.peek().flow;
|
|
4341
|
+
!D || D.data.hasInteracted || (q.markAsInteracted(), dr(s, D, "FLOW_INTERACT"));
|
|
4329
4342
|
};
|
|
4330
|
-
ce.onInteractionFn$.value = C, w === void 0 ? (w =
|
|
4343
|
+
ce.onInteractionFn$.value = C, w === void 0 ? (w = Zr(a.nodes).id, q.setCurrentNodeId(w), dr(s, k, "FLOW_START")) : q.removeMessagesSentByNodeIds([w, Bt]);
|
|
4331
4344
|
const {
|
|
4332
4345
|
interpret: A,
|
|
4333
4346
|
abort: v,
|
|
4334
|
-
undo:
|
|
4335
|
-
} =
|
|
4347
|
+
undo: N
|
|
4348
|
+
} = Vn({
|
|
4336
4349
|
context: a.context,
|
|
4337
4350
|
analytics: {
|
|
4338
4351
|
service: s,
|
|
@@ -4345,42 +4358,42 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4345
4358
|
chatService: f,
|
|
4346
4359
|
t: p,
|
|
4347
4360
|
getApplicationRecovery: () => {
|
|
4348
|
-
var
|
|
4349
|
-
return (
|
|
4361
|
+
var D;
|
|
4362
|
+
return (D = q.current$.peek().flow) == null ? void 0 : D.data.applicationRecovery;
|
|
4350
4363
|
},
|
|
4351
4364
|
setApplicationRecovery: q.setApplicationRecovery,
|
|
4352
4365
|
persistWriteBarrier: () => q.persistWriteBarrier(k),
|
|
4353
4366
|
// We need to get fresh submissions, that’s why we call `peek` here.
|
|
4354
4367
|
getSubmissions: () => {
|
|
4355
|
-
var
|
|
4356
|
-
return (
|
|
4368
|
+
var D;
|
|
4369
|
+
return (D = q.current$.peek().flow) == null ? void 0 : D.data.submissions;
|
|
4357
4370
|
},
|
|
4358
|
-
onInterpret: (
|
|
4371
|
+
onInterpret: (D) => q.setCurrentNodeId(D.id),
|
|
4359
4372
|
onFlowEnd: async () => {
|
|
4360
|
-
var
|
|
4373
|
+
var R;
|
|
4361
4374
|
q.markAsFinished();
|
|
4362
|
-
const
|
|
4363
|
-
Oe(
|
|
4375
|
+
const D = q.current$.peek().flow;
|
|
4376
|
+
Oe(D), s.log({
|
|
4364
4377
|
event: "FLOW_END",
|
|
4365
4378
|
properties: {
|
|
4366
4379
|
flow_id: a.id,
|
|
4367
4380
|
flow_version: a.version,
|
|
4368
|
-
flow_session_id:
|
|
4381
|
+
flow_session_id: D.data.flowSessionId,
|
|
4369
4382
|
flow_build: a.build,
|
|
4370
4383
|
job: a.job
|
|
4371
4384
|
},
|
|
4372
|
-
customProperties: (
|
|
4385
|
+
customProperties: (R = a.analytics) == null ? void 0 : R.customProperties
|
|
4373
4386
|
});
|
|
4374
4387
|
}
|
|
4375
4388
|
}), V = w, M = () => {
|
|
4376
|
-
m(() =>
|
|
4389
|
+
m(() => N), A(V);
|
|
4377
4390
|
}, ee = new AbortController();
|
|
4378
|
-
return k.offerResume ?
|
|
4391
|
+
return k.offerResume ? sa({
|
|
4379
4392
|
chatService: f,
|
|
4380
4393
|
t: p,
|
|
4381
4394
|
signal: ee.signal
|
|
4382
|
-
}).then((
|
|
4383
|
-
|
|
4395
|
+
}).then((D) => (q.settleResume(k), D ? M() : (q.restart(), Qs.flushStateData()))).catch((D) => {
|
|
4396
|
+
D instanceof qr || e.error("Resume prompt failed", D);
|
|
4384
4397
|
}) : M(), () => {
|
|
4385
4398
|
ee.abort(), ce.onInteractionFn$.value === C && (ce.onInteractionFn$.value = () => {
|
|
4386
4399
|
}), v();
|
|
@@ -4397,16 +4410,16 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4397
4410
|
style: {
|
|
4398
4411
|
WebkitOverflowScrolling: "touch"
|
|
4399
4412
|
},
|
|
4400
|
-
children: l(
|
|
4413
|
+
children: l(Ji, {
|
|
4401
4414
|
env: i,
|
|
4402
4415
|
rpcClient: t,
|
|
4403
|
-
lastSentMessageFooter: !zt(a) || !g ? null : l(
|
|
4416
|
+
lastSentMessageFooter: !zt(a) || !g ? null : l(Zi, {
|
|
4404
4417
|
undoFn: g
|
|
4405
4418
|
})
|
|
4406
4419
|
})
|
|
4407
4420
|
}), ce.isReadingHistory$.value && !a.data.isFinished && !ce.isBotTyping$.value && l("div", {
|
|
4408
4421
|
class: "absolute bottom-2 left-1/2 -translate-x-1/2",
|
|
4409
|
-
children: l(
|
|
4422
|
+
children: l(Gr, {
|
|
4410
4423
|
class: "bg-neutral-1 ring-divider shadow-surface-md ring-1",
|
|
4411
4424
|
"aria-label": p("jump_to_current"),
|
|
4412
4425
|
onClick: () => {
|
|
@@ -4415,15 +4428,15 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4415
4428
|
preventScroll: !0
|
|
4416
4429
|
});
|
|
4417
4430
|
},
|
|
4418
|
-
children: l(
|
|
4431
|
+
children: l(en, {})
|
|
4419
4432
|
})
|
|
4420
4433
|
})]
|
|
4421
|
-
}), l(
|
|
4434
|
+
}), l(Ii, {
|
|
4422
4435
|
logger: e,
|
|
4423
4436
|
analytics: s
|
|
4424
4437
|
})]
|
|
4425
4438
|
});
|
|
4426
|
-
},
|
|
4439
|
+
}, Zi = ({
|
|
4427
4440
|
undoFn: e
|
|
4428
4441
|
}) => {
|
|
4429
4442
|
const {
|
|
@@ -4431,7 +4444,7 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4431
4444
|
} = re();
|
|
4432
4445
|
return l("div", {
|
|
4433
4446
|
class: "flex flex-1 items-center justify-end px-1",
|
|
4434
|
-
children: l(
|
|
4447
|
+
children: l(Gr, {
|
|
4435
4448
|
"aria-label": r("undo"),
|
|
4436
4449
|
onClick: async () => {
|
|
4437
4450
|
const {
|
|
@@ -4446,5 +4459,5 @@ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]
|
|
|
4446
4459
|
});
|
|
4447
4460
|
};
|
|
4448
4461
|
export {
|
|
4449
|
-
|
|
4462
|
+
eo as ChatbotBody
|
|
4450
4463
|
};
|