@inploi/plugin-chatbot 14.10.4 → 14.10.5
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 +5 -5
- package/dist/{chatbot-body-c0265aee.js → chatbot-body-79e96f30.js} +1085 -1084
- package/dist/chatbot-body-bcd93147.cjs +5 -0
- package/dist/chatbot.state.d.ts +3 -5
- package/dist/components/chat-error.d.ts +1 -3
- package/dist/{index-5f46fe22.js → index-bf148ac8.js} +384 -399
- package/dist/index-fdcebcd0.cjs +5 -0
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/package.json +2 -2
- package/dist/chatbot-body-2922a129.cjs +0 -5
- package/dist/index-6a081598.cjs +0 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var Sn = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { u as Or, p as vt, D as
|
|
2
|
+
var An = (e, r, t) => r in e ? Sn(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
|
+
var Y = (e, r, t) => (An(e, typeof r != "symbol" ? r + "" : r, t), t);
|
|
4
|
+
import { u as Or, p as vt, D as Nt, l as He, f as Br, I as $r, a as In, E as En, N as Fn, T as jr, C as Vn, s as Mn, g as Ln, S as Rn, U as rr, $ as nr, R as Dn, w as sr, m as Tn, y as Nn, b as Pr, k as On, x as Bn, h as $n, z as jn, Z as qr, H as Pn, v as qn, c as P, d as te, o as c, e as Je, i as xt, j as we, _ as ye, n as Be, q as Me, r as ke, L as qt, F as Un, t as Ur, A as Hr, B as Hn, G as Ze, J as ar, K as ne, M as le, O as zn, P as Wn, Q as Kn, V as Gn, W as zr, X as Jn } from "./index-bf148ac8.js";
|
|
5
5
|
import "@inploi/sdk";
|
|
6
|
-
var Zn = "9.8.2",
|
|
6
|
+
var Zn = "9.8.2", Wr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/index.html`, Xn = new URL(Wr).origin, ir = 3e4, Yn = 5 * 6e4, Qn = (e) => typeof e == "object" && e !== null && e.source === "inploi-captcha", Ft = /* @__PURE__ */ new WeakMap(), es = (e) => {
|
|
7
7
|
let r = Ft.get(e);
|
|
8
8
|
return r || (r = e.fetch("/flow/captcha").then((t) => {
|
|
9
9
|
let n = t == null ? void 0 : t.site_key;
|
|
@@ -13,37 +13,37 @@ var Zn = "9.8.2", Hr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
13
13
|
}), Ft.set(e, r)), r;
|
|
14
14
|
}, ts = (e, r = {}) => new Promise((t, n) => {
|
|
15
15
|
let { signal: s, container: i = null, theme: a, onInteractive: o } = r instanceof AbortSignal ? { signal: r } : r, u = !1, f = () => {
|
|
16
|
-
},
|
|
17
|
-
u || (u = !0, clearTimeout(m), s == null || s.removeEventListener("abort", p), f(),
|
|
18
|
-
}, y = (
|
|
19
|
-
clearTimeout(m), m = setTimeout(() => y("Captcha timed out"),
|
|
16
|
+
}, g = (C) => {
|
|
17
|
+
u || (u = !0, clearTimeout(m), s == null || s.removeEventListener("abort", p), f(), C());
|
|
18
|
+
}, y = (C) => g(() => n(new Error(C))), p = () => y("Captcha aborted"), m, _ = (C) => {
|
|
19
|
+
clearTimeout(m), m = setTimeout(() => y("Captcha timed out"), C);
|
|
20
20
|
};
|
|
21
|
-
if (
|
|
21
|
+
if (_(ir), s == null ? void 0 : s.aborted)
|
|
22
22
|
return p();
|
|
23
23
|
s == null || s.addEventListener("abort", p), (async () => {
|
|
24
|
-
let
|
|
25
|
-
if (
|
|
26
|
-
return
|
|
24
|
+
let C = await es(e);
|
|
25
|
+
if (C === void 0)
|
|
26
|
+
return g(() => t(void 0));
|
|
27
27
|
if (u)
|
|
28
28
|
return;
|
|
29
|
-
let
|
|
30
|
-
|
|
31
|
-
let
|
|
32
|
-
if (!
|
|
29
|
+
let k = document.createElement("iframe");
|
|
30
|
+
k.src = `${Wr}?${new URLSearchParams({ sitekey: C, origin: window.location.origin, ...a && { theme: a } }).toString()}`, k.title = "Cloudflare security check", k.style.cssText = `display:block;border:0;width:${i ? "100%" : "300px"};height:0;color-scheme:normal`, i ? i.appendChild(k) : (k.style.cssText += ";position:fixed;bottom:16px;right:16px;z-index:2147483647", document.body.appendChild(k));
|
|
31
|
+
let A = !1, b = (V) => {
|
|
32
|
+
if (!k.contentWindow || V.source !== k.contentWindow || V.origin !== Xn || !Qn(V.data))
|
|
33
33
|
return;
|
|
34
|
-
let
|
|
35
|
-
switch (
|
|
34
|
+
let F = V.data;
|
|
35
|
+
switch (F.type) {
|
|
36
36
|
case "token":
|
|
37
|
-
return
|
|
37
|
+
return g(() => t(F.token));
|
|
38
38
|
case "resize":
|
|
39
|
-
|
|
39
|
+
k.style.height = `${Math.max(0, Math.ceil(F.height))}px`;
|
|
40
40
|
return;
|
|
41
41
|
case "before-interactive":
|
|
42
|
-
return
|
|
42
|
+
return A = !0, _(Yn), o == null ? void 0 : o();
|
|
43
43
|
case "after-interactive":
|
|
44
|
-
return
|
|
44
|
+
return A = !1, _(ir);
|
|
45
45
|
case "error":
|
|
46
|
-
!
|
|
46
|
+
!A && !F.interactive && y("Captcha failed");
|
|
47
47
|
return;
|
|
48
48
|
case "expired":
|
|
49
49
|
return y("Captcha expired");
|
|
@@ -51,10 +51,10 @@ var Zn = "9.8.2", Hr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
51
51
|
return y("Captcha timed out");
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
-
window.addEventListener("message",
|
|
55
|
-
window.removeEventListener("message",
|
|
54
|
+
window.addEventListener("message", b), f = () => {
|
|
55
|
+
window.removeEventListener("message", b), k.remove();
|
|
56
56
|
};
|
|
57
|
-
})().catch((
|
|
57
|
+
})().catch((C) => g(() => n(C)));
|
|
58
58
|
}), or = ({ condition: e, context: r, submissions: t, ifBlock: n }) => {
|
|
59
59
|
let [s, ...i] = e.compareKey.split(".");
|
|
60
60
|
if (!s)
|
|
@@ -64,7 +64,7 @@ var Zn = "9.8.2", Hr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
64
64
|
return !1;
|
|
65
65
|
switch (a.type) {
|
|
66
66
|
case "address": {
|
|
67
|
-
let o =
|
|
67
|
+
let o = Nt(a.value, i);
|
|
68
68
|
switch (e.compare) {
|
|
69
69
|
case "equals":
|
|
70
70
|
return o === e.compareValue;
|
|
@@ -80,16 +80,16 @@ var Zn = "9.8.2", Hr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
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 = Nt(a.value, i), u = { ...n, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
|
|
84
84
|
switch (typeof o) {
|
|
85
85
|
case "boolean":
|
|
86
|
-
return
|
|
86
|
+
return lt(u, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
|
|
87
87
|
case "string":
|
|
88
|
-
return
|
|
88
|
+
return lt(u, { submissions: { _temp: { value: o, type: "string" } }, context: r });
|
|
89
89
|
case "number":
|
|
90
|
-
return
|
|
90
|
+
return lt(u, { submissions: { _temp: { value: o, type: "number" } }, context: r });
|
|
91
91
|
case "object":
|
|
92
|
-
return Array.isArray(o) && o.every((f) => typeof f == "string") ?
|
|
92
|
+
return Array.isArray(o) && o.every((f) => typeof f == "string") ? lt(u, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
|
|
93
93
|
}
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
@@ -153,7 +153,7 @@ var Zn = "9.8.2", Hr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
153
153
|
}
|
|
154
154
|
break;
|
|
155
155
|
}
|
|
156
|
-
},
|
|
156
|
+
}, lt = (e, { context: r, submissions: t }) => {
|
|
157
157
|
let n = "combinator" in e.data ? e.data.conditions : [e.data];
|
|
158
158
|
if (("combinator" in e.data ? e.data.combinator : "and") === "or") {
|
|
159
159
|
for (let s of n)
|
|
@@ -174,7 +174,7 @@ var Zn = "9.8.2", Hr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
174
174
|
case "boolean":
|
|
175
175
|
return u.value === !0 ? "true" : "false";
|
|
176
176
|
case "file":
|
|
177
|
-
return u.value.map((f) => `${f.name} (${
|
|
177
|
+
return u.value.map((f) => `${f.name} (${He(f.sizeKb)})`).join(", ");
|
|
178
178
|
case "enum":
|
|
179
179
|
return u.value.join(", ");
|
|
180
180
|
case "address":
|
|
@@ -187,7 +187,7 @@ var Zn = "9.8.2", Hr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
187
187
|
case "integration": {
|
|
188
188
|
if (typeof u.value != "object" || Array.isArray(u.value))
|
|
189
189
|
break;
|
|
190
|
-
let f =
|
|
190
|
+
let f = Nt(u.value, o);
|
|
191
191
|
switch (typeof f) {
|
|
192
192
|
case "boolean":
|
|
193
193
|
return f === !0 ? "true" : "false";
|
|
@@ -196,7 +196,7 @@ var Zn = "9.8.2", Hr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
196
196
|
case "number":
|
|
197
197
|
return f.toString();
|
|
198
198
|
case "object":
|
|
199
|
-
if (Array.isArray(f) && f.every((
|
|
199
|
+
if (Array.isArray(f) && f.every((g) => typeof g == "string"))
|
|
200
200
|
return f.join(", ");
|
|
201
201
|
}
|
|
202
202
|
break;
|
|
@@ -265,17 +265,17 @@ function fs(e, r, t) {
|
|
|
265
265
|
}
|
|
266
266
|
class hs {
|
|
267
267
|
constructor(r, t, n, s) {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
268
|
+
Y(this, "blockLen");
|
|
269
|
+
Y(this, "outputLen");
|
|
270
|
+
Y(this, "padOffset");
|
|
271
|
+
Y(this, "isLE");
|
|
272
272
|
// For partial updates less than block size
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
273
|
+
Y(this, "buffer");
|
|
274
|
+
Y(this, "view");
|
|
275
|
+
Y(this, "finished", !1);
|
|
276
|
+
Y(this, "length", 0);
|
|
277
|
+
Y(this, "pos", 0);
|
|
278
|
+
Y(this, "destroyed", !1);
|
|
279
279
|
this.blockLen = r, this.outputLen = t, this.padOffset = n, this.isLE = s, this.buffer = new Uint8Array(r), this.view = Vt(this.buffer);
|
|
280
280
|
}
|
|
281
281
|
update(r) {
|
|
@@ -304,11 +304,11 @@ class hs {
|
|
|
304
304
|
const o = Vt(r), u = this.outputLen;
|
|
305
305
|
if (u % 4)
|
|
306
306
|
throw new Error("_sha2: outputLen must be aligned to 32bit");
|
|
307
|
-
const f = u / 4,
|
|
308
|
-
if (f >
|
|
307
|
+
const f = u / 4, g = this.get();
|
|
308
|
+
if (f > g.length)
|
|
309
309
|
throw new Error("_sha2: outputLen bigger than state");
|
|
310
310
|
for (let y = 0; y < f; y++)
|
|
311
|
-
o.setUint32(4 * y,
|
|
311
|
+
o.setUint32(4 * y, g[y], i);
|
|
312
312
|
}
|
|
313
313
|
digest() {
|
|
314
314
|
const { buffer: r, outputLen: t } = this;
|
|
@@ -325,7 +325,7 @@ class hs {
|
|
|
325
325
|
return this._cloneInto();
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
const
|
|
328
|
+
const Ie = /* @__PURE__ */ Uint32Array.from([
|
|
329
329
|
1779033703,
|
|
330
330
|
3144134277,
|
|
331
331
|
1013904242,
|
|
@@ -399,7 +399,7 @@ const Ve = /* @__PURE__ */ Uint32Array.from([
|
|
|
399
399
|
2756734187,
|
|
400
400
|
3204031479,
|
|
401
401
|
3329325298
|
|
402
|
-
]),
|
|
402
|
+
]), Ee = /* @__PURE__ */ new Uint32Array(64);
|
|
403
403
|
class ms extends hs {
|
|
404
404
|
constructor(r) {
|
|
405
405
|
super(64, r, 8, !1);
|
|
@@ -414,20 +414,20 @@ class ms extends hs {
|
|
|
414
414
|
}
|
|
415
415
|
process(r, t) {
|
|
416
416
|
for (let y = 0; y < 16; y++, t += 4)
|
|
417
|
-
|
|
417
|
+
Ee[y] = r.getUint32(t, !1);
|
|
418
418
|
for (let y = 16; y < 64; y++) {
|
|
419
|
-
const p =
|
|
420
|
-
|
|
419
|
+
const p = Ee[y - 15], m = Ee[y - 2], _ = pe(p, 7) ^ pe(p, 18) ^ p >>> 3, C = pe(m, 17) ^ pe(m, 19) ^ m >>> 10;
|
|
420
|
+
Ee[y] = C + Ee[y - 7] + _ + Ee[y - 16] | 0;
|
|
421
421
|
}
|
|
422
|
-
let { A: n, B: s, C: i, D: a, E: o, F: u, G: f, H:
|
|
422
|
+
let { A: n, B: s, C: i, D: a, E: o, F: u, G: f, H: g } = this;
|
|
423
423
|
for (let y = 0; y < 64; y++) {
|
|
424
|
-
const p = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), m =
|
|
425
|
-
|
|
424
|
+
const p = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), m = g + p + ds(o, u, f) + ps[y] + Ee[y] | 0, C = (pe(n, 2) ^ pe(n, 13) ^ pe(n, 22)) + fs(n, s, i) | 0;
|
|
425
|
+
g = f, f = u, u = o, o = a + m | 0, a = i, i = s, s = n, n = m + C | 0;
|
|
426
426
|
}
|
|
427
|
-
n = n + this.A | 0, s = s + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, u = u + this.F | 0, f = f + this.G | 0,
|
|
427
|
+
n = n + this.A | 0, s = s + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, u = u + this.F | 0, f = f + this.G | 0, g = g + this.H | 0, this.set(n, s, i, a, o, u, f, g);
|
|
428
428
|
}
|
|
429
429
|
roundClean() {
|
|
430
|
-
Ot(
|
|
430
|
+
Ot(Ee);
|
|
431
431
|
}
|
|
432
432
|
destroy() {
|
|
433
433
|
this.set(0, 0, 0, 0, 0, 0, 0, 0), Ot(this.buffer);
|
|
@@ -438,14 +438,14 @@ class ys extends ms {
|
|
|
438
438
|
super(32);
|
|
439
439
|
// We cannot use array here since array allows indexing by variable
|
|
440
440
|
// which means optimizer/compiler cannot use registers.
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
441
|
+
Y(this, "A", Ie[0] | 0);
|
|
442
|
+
Y(this, "B", Ie[1] | 0);
|
|
443
|
+
Y(this, "C", Ie[2] | 0);
|
|
444
|
+
Y(this, "D", Ie[3] | 0);
|
|
445
|
+
Y(this, "E", Ie[4] | 0);
|
|
446
|
+
Y(this, "F", Ie[5] | 0);
|
|
447
|
+
Y(this, "G", Ie[6] | 0);
|
|
448
|
+
Y(this, "H", Ie[7] | 0);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
451
|
const bs = /* @__PURE__ */ cs(
|
|
@@ -457,7 +457,7 @@ var Kr = (e) => {
|
|
|
457
457
|
if (!r)
|
|
458
458
|
throw new Error("No head node found");
|
|
459
459
|
return r;
|
|
460
|
-
},
|
|
460
|
+
}, Ht = (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((n) => n.groupId && e.nodes.some((s) => s.id === n.groupId && s.type.startsWith("question-")) && (n.type === "system" || "author" in n && n.author === "user"))) == null ? void 0 : t.groupId;
|
|
@@ -478,7 +478,7 @@ function vs(e, r, t, n) {
|
|
|
478
478
|
clearTimeout(u);
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
|
-
var Gr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {} }), he = (e, r) => ns(e, Gr(r)), xs = (e, r) =>
|
|
481
|
+
var Gr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {} }), he = (e, r) => ns(e, Gr(r)), xs = (e, r) => lt(e, Gr(r)), Jr = ({ node: e, nodes: r, stopWhen: t }) => {
|
|
482
482
|
if ((t == null ? void 0 : t(e)) === !0)
|
|
483
483
|
return e;
|
|
484
484
|
let n = e.nextId ? r.find((s) => s.id === e.nextId) : void 0;
|
|
@@ -496,75 +496,75 @@ var Gr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
|
|
|
496
496
|
});
|
|
497
497
|
if (t != null && t.nextId)
|
|
498
498
|
return r.find((n) => n.id === t.nextId);
|
|
499
|
-
}, _s = 3, ks = ({ flow: e, analytics: r, logger: t, talentBankClient: n, context: s, apiClient: i, getSubmissions: a, getApplicationRecovery: o, setApplicationRecovery: u, chatService: f, persistWriteBarrier:
|
|
500
|
-
var
|
|
501
|
-
let
|
|
502
|
-
(
|
|
503
|
-
var
|
|
504
|
-
if (
|
|
499
|
+
}, _s = 3, ks = ({ flow: e, analytics: r, logger: t, talentBankClient: n, context: s, apiClient: i, getSubmissions: a, getApplicationRecovery: o, setApplicationRecovery: u, chatService: f, persistWriteBarrier: g, onSubmitNetworkError: y, closedRoleBehaviour: p, dateEchoLocale: m, onFlowEnd: _, onInterpret: C, forceSubmitConfirmation: k, flowType: A, t: b }) => {
|
|
500
|
+
var V;
|
|
501
|
+
let F = new AbortController(), R = { submitAccepted: !1 };
|
|
502
|
+
(V = e.data).startedWriteNodeIds ?? (V.startedWriteNodeIds = e.nodes.flatMap((T) => {
|
|
503
|
+
var D, U;
|
|
504
|
+
if (T.type !== "integration-application-submit" || !e.data.nodeHistory.includes(T.id))
|
|
505
505
|
return [];
|
|
506
|
-
let
|
|
507
|
-
return (
|
|
506
|
+
let z = T.data.key ? (D = a()) == null ? void 0 : D[T.data.key] : void 0;
|
|
507
|
+
return (z == null ? void 0 : z.type) === "integration" && ((U = Br(z.value)) == null ? void 0 : U.verdict) === "not_submitted" ? [] : [T.id];
|
|
508
508
|
}));
|
|
509
|
-
let
|
|
510
|
-
let
|
|
511
|
-
if (
|
|
509
|
+
let O = { ...r.service, log: (T) => r.service.log({ ...T, customProperties: { ...T.customProperties, ...r.customProperties } }) }, q = async (T, z) => {
|
|
510
|
+
let D = F.signal;
|
|
511
|
+
if (D.aborted)
|
|
512
512
|
return;
|
|
513
|
-
let
|
|
514
|
-
var
|
|
515
|
-
return
|
|
513
|
+
let U = a(), I = o(), L = (I == null ? void 0 : I.submitNodeId) === T.id ? e.nodes.find((M) => {
|
|
514
|
+
var N;
|
|
515
|
+
return M.id === I.fileQuestionNodeId && M.type === "question-file" && ((N = U == null ? void 0 : U[M.data.key]) == null ? void 0 : N.type) !== "file";
|
|
516
516
|
}) : void 0;
|
|
517
|
-
if (
|
|
518
|
-
return L
|
|
519
|
-
|
|
517
|
+
if (L)
|
|
518
|
+
return q(L, z);
|
|
519
|
+
C == null || C(T, z);
|
|
520
520
|
try {
|
|
521
|
-
await Cs({ flow: e, analytics:
|
|
522
|
-
if (!
|
|
521
|
+
await Cs({ flow: e, analytics: O, logger: t, talentBankClient: n, apiClient: i, context: s, node: T, submissions: U, applicationRecovery: I, setApplicationRecovery: async (M) => {
|
|
522
|
+
if (!D.aborted)
|
|
523
523
|
try {
|
|
524
|
-
await u(
|
|
525
|
-
} catch (
|
|
526
|
-
t.error("Failed to persist application recovery",
|
|
524
|
+
await u(M);
|
|
525
|
+
} catch (N) {
|
|
526
|
+
t.error("Failed to persist application recovery", N);
|
|
527
527
|
}
|
|
528
|
-
}, forceSubmitConfirmation:
|
|
529
|
-
|
|
530
|
-
}, captcha: f.captcha }, next: (
|
|
531
|
-
if (
|
|
528
|
+
}, forceSubmitConfirmation: k || (I == null ? void 0 : I.submitNodeId) === T.id, run: R, persistWriteBarrier: g, onSubmitNetworkError: y, closedRoleBehaviour: p, dateEchoLocale: m, flowType: A, signal: D, t: b, chat: { sendMessage: async (M) => f.send({ groupId: T.id, message: M, signal: D }), userInput: async (M) => f.input({ input: M, signal: D }), setSubmission: (M, N) => {
|
|
529
|
+
D.aborted || f.setSubmission(M, N);
|
|
530
|
+
}, captcha: f.captcha }, next: (M) => {
|
|
531
|
+
if (D.aborted)
|
|
532
532
|
return;
|
|
533
|
-
let
|
|
534
|
-
return
|
|
533
|
+
let N = (I == null ? void 0 : I.fileQuestionNodeId) === T.id ? I.submitNodeId : M, W = N ? e.nodes.find((K) => K.id === N) : ws({ childNode: T, nodes: e.nodes });
|
|
534
|
+
return W ? q(W, T) : _ == null ? void 0 : _(T);
|
|
535
535
|
}, end: () => {
|
|
536
|
-
|
|
536
|
+
D.aborted || (_ == null || _(T));
|
|
537
537
|
} });
|
|
538
|
-
} catch (
|
|
539
|
-
if (
|
|
538
|
+
} catch (M) {
|
|
539
|
+
if (M instanceof $r)
|
|
540
540
|
return;
|
|
541
|
-
throw
|
|
541
|
+
throw M;
|
|
542
542
|
}
|
|
543
543
|
};
|
|
544
|
-
return { interpret: async (
|
|
545
|
-
let
|
|
546
|
-
return
|
|
547
|
-
}, undo: (
|
|
548
|
-
var
|
|
549
|
-
if (delete e.data.reviewReplay, ((
|
|
544
|
+
return { interpret: async (T) => {
|
|
545
|
+
let z = e.nodes.find((D) => D.id === T) ?? Kr(e.nodes);
|
|
546
|
+
return q(z);
|
|
547
|
+
}, undo: (T) => {
|
|
548
|
+
var N;
|
|
549
|
+
if (delete e.data.reviewReplay, ((N = e.data.startedWriteNodeIds) == null ? void 0 : N.length) || e.data.isFinished)
|
|
550
550
|
return { removed: 0 };
|
|
551
|
-
let
|
|
552
|
-
if (
|
|
551
|
+
let z = Ht(e), D = z ? T.lastIndexOf(z) : -1, U = e.nodes.find((W) => W.id === z);
|
|
552
|
+
if (D === -1 || !U)
|
|
553
553
|
return { removed: 0 };
|
|
554
|
-
let
|
|
555
|
-
|
|
556
|
-
let
|
|
557
|
-
e.data.messages = e.data.messages.filter((
|
|
558
|
-
let
|
|
559
|
-
for (let
|
|
560
|
-
let K = e.nodes.find((
|
|
561
|
-
if (!(!K || !
|
|
562
|
-
for (let
|
|
563
|
-
typeof
|
|
554
|
+
let I = e.nodes.find((W) => W.id === T[T.length - 1]);
|
|
555
|
+
F.abort();
|
|
556
|
+
let L = T.splice(D);
|
|
557
|
+
e.data.messages = e.data.messages.filter((W) => !W.groupId || !L.includes(W.groupId)), e.data.currentInput = null;
|
|
558
|
+
let M = a();
|
|
559
|
+
for (let W of L.slice(1)) {
|
|
560
|
+
let K = e.nodes.find((ue) => ue.id === W);
|
|
561
|
+
if (!(!K || !M || K.id === z) && ("key" in K.data && K.data.key && delete M[K.data.key], "keys" in K.data))
|
|
562
|
+
for (let ue of Object.values(K.data.keys))
|
|
563
|
+
typeof ue == "string" && delete M[ue];
|
|
564
564
|
}
|
|
565
|
-
return
|
|
565
|
+
return F = new AbortController(), q(U, I), { removed: L.length };
|
|
566
566
|
}, abort: () => {
|
|
567
|
-
|
|
567
|
+
F.abort();
|
|
568
568
|
} };
|
|
569
569
|
};
|
|
570
570
|
async function Cs(e) {
|
|
@@ -573,41 +573,41 @@ async function Cs(e) {
|
|
|
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 Ks({ ...e, node: r });
|
|
577
577
|
case "text":
|
|
578
|
-
return
|
|
578
|
+
return Os({ ...e, node: r });
|
|
579
579
|
case "image":
|
|
580
|
-
return
|
|
580
|
+
return Bs({ ...e, node: r });
|
|
581
581
|
case "question-text":
|
|
582
|
-
return Os({ ...e, node: r });
|
|
583
|
-
case "question-enum":
|
|
584
582
|
return $s({ ...e, node: r });
|
|
583
|
+
case "question-enum":
|
|
584
|
+
return qs({ ...e, node: r });
|
|
585
585
|
case "question-number":
|
|
586
|
-
return Bs({ ...e, node: r });
|
|
587
|
-
case "question-phone":
|
|
588
586
|
return js({ ...e, node: r });
|
|
589
|
-
case "question-
|
|
587
|
+
case "question-phone":
|
|
590
588
|
return Ps({ ...e, node: r });
|
|
591
|
-
case "question-
|
|
589
|
+
case "question-boolean":
|
|
592
590
|
return Us({ ...e, node: r });
|
|
591
|
+
case "question-file":
|
|
592
|
+
return zs({ ...e, node: r });
|
|
593
593
|
case "question-address":
|
|
594
|
-
return
|
|
594
|
+
return Hs({ ...e, node: r });
|
|
595
595
|
case "end-flow":
|
|
596
596
|
return Ws({ ...e, node: r });
|
|
597
597
|
case "if-block":
|
|
598
|
-
return
|
|
598
|
+
return Ns({ ...e, node: r });
|
|
599
599
|
case "jump":
|
|
600
|
-
return
|
|
600
|
+
return Is({ ...e, node: r });
|
|
601
601
|
case "link":
|
|
602
|
-
return
|
|
602
|
+
return Ts({ ...e, node: r });
|
|
603
603
|
case "integration-application-submit":
|
|
604
|
-
return
|
|
604
|
+
return Ds({ ...e, node: r });
|
|
605
605
|
case "add-submission":
|
|
606
606
|
return Es({ ...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 As({ ...e, node: r });
|
|
611
611
|
case "feedback":
|
|
612
612
|
return Ss({ ...e, node: r });
|
|
613
613
|
default:
|
|
@@ -617,21 +617,21 @@ async function Cs(e) {
|
|
|
617
617
|
async function Ss({ next: e, node: r }) {
|
|
618
618
|
e(r.nextId);
|
|
619
619
|
}
|
|
620
|
-
async function
|
|
620
|
+
async function As({ next: e, node: r, talentBankClient: t, submissions: n, flow: s, logger: i, chat: a }) {
|
|
621
621
|
var u;
|
|
622
622
|
let o = { isDuplicate: !1 };
|
|
623
623
|
if (n && t) {
|
|
624
624
|
let f = r.data.scope === "job" ? (u = s.job) == null ? void 0 : u.id : void 0;
|
|
625
625
|
if (r.data.scope === "company" || f != null)
|
|
626
626
|
try {
|
|
627
|
-
o = await t.checkDuplicate({ email:
|
|
628
|
-
} catch (
|
|
629
|
-
i.error("[check-duplicate]",
|
|
627
|
+
o = await t.checkDuplicate({ email: In({ key: r.data.email, submissions: n }).toString(), jobId: f, scope: r.data.scope });
|
|
628
|
+
} catch (g) {
|
|
629
|
+
i.error("[check-duplicate]", g);
|
|
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 Is({ next: e, node: r }) {
|
|
635
635
|
e(r.data.targetId);
|
|
636
636
|
}
|
|
637
637
|
async function Es({ next: e, node: r, logger: t, submissions: n, context: s }) {
|
|
@@ -641,146 +641,146 @@ async function Es({ next: e, node: r, logger: t, submissions: n, context: s }) {
|
|
|
641
641
|
}
|
|
642
642
|
n[r.data.key] = { type: "string", value: he(r.data.value, { submissions: n, context: s }) }, e(r.nextId);
|
|
643
643
|
}
|
|
644
|
-
var Fs = 5e3, Vs = (e, r, t) => {
|
|
644
|
+
var Fs = 5e3, Vs = (e, r) => r ? `${e}@${r.id_type}:${r.id}` : e, Ms = (e, r = Date.now()) => Math.min(e.until, r + (e.maintenance ? jn : e.throttles ? qr : Pn)), Ls = (e, r, t) => {
|
|
645
645
|
let { waitMs: n, throttles: s, maintenance: i } = qn(r == null ? void 0 : r.throttles, t);
|
|
646
646
|
return { key: e, until: Date.now() + n, ...s !== void 0 && { throttles: s }, ...i && { maintenance: i } };
|
|
647
|
-
},
|
|
647
|
+
}, Rs = ["ApiError", "NotFoundError", "UnauthorisedError", "SchemaValidationError", "ParsingError"], Zr = (e) => e instanceof Error && Rs.includes(e.name) ? e : void 0, cr = (e) => {
|
|
648
648
|
let r = Zr(e);
|
|
649
649
|
return (r == null ? void 0 : r.name) === "ApiError" ? r : void 0;
|
|
650
650
|
};
|
|
651
|
-
async function
|
|
652
|
-
var
|
|
653
|
-
let
|
|
654
|
-
let { anonymous_id:
|
|
655
|
-
await e.sendMessage({ type: "text", author: "bot", text:
|
|
651
|
+
async function Ds({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i, submissions: a, analytics: o, flow: u, applicationRecovery: f, setApplicationRecovery: g, forceSubmitConfirmation: y, flowType: p, run: m, persistWriteBarrier: _, signal: C, onSubmitNetworkError: k, closedRoleBehaviour: A, t: b }) {
|
|
652
|
+
var T, z;
|
|
653
|
+
let V = async ({ redirect_url: D, message: U, button_text: I }) => {
|
|
654
|
+
let { anonymous_id: L, session_id: M } = o.getSessionInfo();
|
|
655
|
+
await e.sendMessage({ type: "text", author: "bot", text: U ?? b("submission_redirect_message") });
|
|
656
656
|
try {
|
|
657
|
-
let
|
|
658
|
-
|
|
659
|
-
if (!
|
|
657
|
+
let N = new URL(D);
|
|
658
|
+
L && !N.searchParams.has("anonymous_id") && N.searchParams.set("anonymous_id", L), await e.sendMessage({ type: "link", href: N.toString(), text: I ?? b("complete_submission"), onClick: () => {
|
|
659
|
+
if (!M) {
|
|
660
660
|
s.error("session_id not set, cannot log FLOW_REDIRECT event");
|
|
661
661
|
return;
|
|
662
662
|
}
|
|
663
|
-
o.log({ event: "FLOW_REDIRECT", properties: { flow_build: u.build, flow_id: u.id, flow_session_id:
|
|
663
|
+
o.log({ event: "FLOW_REDIRECT", properties: { flow_build: u.build, flow_id: u.id, flow_session_id: M, flow_version: u.version, href: N.toString(), job: u.job } });
|
|
664
664
|
} });
|
|
665
|
-
} catch (
|
|
666
|
-
s.error(`Invalid redirect URL: ${
|
|
665
|
+
} catch (N) {
|
|
666
|
+
s.error(`Invalid redirect URL: ${D}`, N), e.sendMessage({ type: "system", variant: "error", text: b("redirect_url_error") });
|
|
667
667
|
}
|
|
668
668
|
};
|
|
669
|
-
if ((
|
|
670
|
-
let
|
|
671
|
-
return
|
|
669
|
+
if ((T = u.data.startedWriteNodeIds) != null && T.includes(n.id) && (f == null ? void 0 : f.submitNodeId) !== n.id) {
|
|
670
|
+
let D = (z = u.data.submitRedirects) == null ? void 0 : z[n.id];
|
|
671
|
+
return D ? (await V(D), r(n.nextId)) : (await e.sendMessage({ type: "system", variant: "warning", text: b("submission_unknown") }), t());
|
|
672
672
|
}
|
|
673
|
-
let
|
|
674
|
-
var
|
|
675
|
-
let
|
|
676
|
-
|
|
677
|
-
let
|
|
678
|
-
(u.data.reviewRequiresSend === !0 && !
|
|
679
|
-
let
|
|
673
|
+
let F = Vs(n.id, u.job), R = 0, O = m.submitAccepted && n.data.skipConfirmation === !0 && (f == null ? void 0 : f.submitNodeId) !== n.id, q = async (D) => {
|
|
674
|
+
var rt, ht, nt, st, pt, mt, At, at;
|
|
675
|
+
let U = ((rt = u.data.submitCooldown) == null ? void 0 : rt.key) === F ? u.data.submitCooldown : void 0;
|
|
676
|
+
U && (U.until = Ms(U));
|
|
677
|
+
let I = U == null ? void 0 : U.until;
|
|
678
|
+
(u.data.reviewRequiresSend === !0 && !O || D !== !0 || I !== void 0 && I > Date.now()) && await e.userInput({ type: "submit", key: void 0, config: { label: n.data.submitLabel, ...I !== void 0 && { availableAt: I } } }), O = !1;
|
|
679
|
+
let L;
|
|
680
680
|
if (n.data.captcha) {
|
|
681
|
-
let
|
|
681
|
+
let l = e.captcha, d = !0;
|
|
682
682
|
try {
|
|
683
|
-
|
|
684
|
-
e.sendMessage({ type: "text", author: "bot", text:
|
|
683
|
+
L = await ts(i, { signal: C, container: (l == null ? void 0 : l.container()) ?? null, theme: l == null ? void 0 : l.theme, onInteractive: () => {
|
|
684
|
+
e.sendMessage({ type: "text", author: "bot", text: b("captcha_check") }).catch(() => {
|
|
685
685
|
}).then(() => {
|
|
686
|
-
|
|
686
|
+
d && (l == null || l.reveal(!0));
|
|
687
687
|
});
|
|
688
688
|
} });
|
|
689
|
-
} catch (
|
|
690
|
-
if (s.error("Captcha check failed",
|
|
689
|
+
} catch (h) {
|
|
690
|
+
if (s.error("Captcha check failed", h), C.aborted)
|
|
691
691
|
return;
|
|
692
692
|
} finally {
|
|
693
|
-
|
|
693
|
+
d = !1, l == null || l.reveal(!1);
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
|
-
await e.sendMessage({ type: "loading", text:
|
|
697
|
-
let { anonymous_id:
|
|
698
|
-
if (
|
|
696
|
+
await e.sendMessage({ type: "loading", text: b("submitting") });
|
|
697
|
+
let { anonymous_id: M, session_id: N } = o.getSessionInfo();
|
|
698
|
+
if (C.aborted)
|
|
699
699
|
return;
|
|
700
|
-
let
|
|
701
|
-
if ((f == null ? void 0 : f.submitNodeId) === n.id && await
|
|
700
|
+
let W = ((ht = u.data.startedWriteNodeIds) == null ? void 0 : ht.includes(n.id)) === !0;
|
|
701
|
+
if ((f == null ? void 0 : f.submitNodeId) === n.id && await g(void 0), W || (u.data.startedWriteNodeIds = [...u.data.startedWriteNodeIds ?? [], n.id]), await _().catch((l) => s.error("Failed to persist application write barrier", l)), C.aborted)
|
|
702
702
|
return;
|
|
703
|
-
let K,
|
|
703
|
+
let K, ue = setTimeout(() => {
|
|
704
704
|
K = (async () => {
|
|
705
|
-
await e.sendMessage({ type: "text", author: "bot", text:
|
|
706
|
-
})().catch((
|
|
707
|
-
}, Fs),
|
|
708
|
-
|
|
709
|
-
let
|
|
710
|
-
return (
|
|
705
|
+
await e.sendMessage({ type: "text", author: "bot", text: b("submission_still_working") }), await e.sendMessage({ type: "loading", text: b("submitting") });
|
|
706
|
+
})().catch((l) => s.error("Failed to send submission progress message", l));
|
|
707
|
+
}, Fs), oe, G = await i.fetch("/flow/submit", { method: "POST", body: JSON.stringify({ log_submit: !1, integration_id: n.data.integrationId, anonymous_id: M, session_id: N, job: u.job, flow_build: u.build, ...L !== void 0 && { captcha_token: L }, submissions: Vn(u.nodes, Mn(a || {}, n.data.submitKeys)), pre_apply: jr(u.nodes, a || {}, u.data.flowSessionId) }) }).catch((l) => {
|
|
708
|
+
oe = l;
|
|
709
|
+
let d = cr(l);
|
|
710
|
+
return (d == null ? void 0 : d.data) !== void 0 ? d.data : l;
|
|
711
711
|
});
|
|
712
|
-
if (clearTimeout(
|
|
712
|
+
if (clearTimeout(ue), await K, C.aborted)
|
|
713
713
|
return;
|
|
714
|
-
if (
|
|
715
|
-
return await
|
|
714
|
+
if (oe !== void 0 && !Zr(oe) && k)
|
|
715
|
+
return await k(oe, C), q(!0);
|
|
716
716
|
n.data.key && e.setSubmission(n.data.key, { type: "integration", value: G });
|
|
717
|
-
let
|
|
718
|
-
|
|
719
|
-
let
|
|
720
|
-
|
|
721
|
-
let
|
|
722
|
-
if ((
|
|
723
|
-
let { redirect_url:
|
|
724
|
-
return
|
|
717
|
+
let Ye = (nt = cr(oe)) == null ? void 0 : nt.status, Qe = typeof Ye == "number" ? Ye : void 0, B = Br(G, Qe), Ce = u.data.failedAttemptAt, Re = Ce == null ? void 0 : Ce[F];
|
|
718
|
+
Ce && Re !== void 0 && Re > Date.now() && (Re = Ce[F] = Date.now());
|
|
719
|
+
let et = Re !== void 0 && Date.now() - Re < Ln || ((st = u.data.unconfirmedAttemptKeys) == null ? void 0 : st.includes(F)) === !0, De = Rn(G);
|
|
720
|
+
De && o.log({ event: "FLOW_SUBMIT", properties: { flow_id: u.id, flow_version: u.version, flow_session_id: u.data.flowSessionId, flow_build: u.build, service: De.service, response: De.response, flow_type: (p == null ? void 0 : p()) ?? "CHATBOT_DRAWER", job: u.job, ...(B == null ? void 0 : B.outcome) === "duplicate" && { outcome: et ? "duplicate_after_own_attempt" : "duplicate" }, ...De.outcome && { outcome: De.outcome } } });
|
|
721
|
+
let je = rr(G) || (G == null ? void 0 : G.success) === !0;
|
|
722
|
+
if ((je || nr(G)) && (m.submitAccepted = !0), je && ((pt = u.data.submitCooldown) == null ? void 0 : pt.throttles) !== void 0 && (delete u.data.submitCooldown.throttles, await _().catch((l) => s.error("Failed to persist submit cooldown reset", l))), rr(G)) {
|
|
723
|
+
let { redirect_url: l, message: d, button_text: h } = G.integration_response.data, w = { redirect_url: l, message: d, button_text: h };
|
|
724
|
+
return C.aborted ? void 0 : (u.data.submitRedirects = { ...u.data.submitRedirects, [n.id]: w }, await _().catch((x) => s.error("Failed to persist submit redirect", x)), await V(w), r(n.nextId));
|
|
725
725
|
}
|
|
726
|
-
let
|
|
727
|
-
if (
|
|
728
|
-
return await e.sendMessage({ type: "system", variant: "success", text:
|
|
726
|
+
let tt = nr(G);
|
|
727
|
+
if (tt)
|
|
728
|
+
return await e.sendMessage({ type: "system", variant: "success", text: tt.message ?? b("submission_pending") }), r(n.nextId);
|
|
729
729
|
if ((G == null ? void 0 : G.success) === !0)
|
|
730
|
-
return n.data.skipConfirmation !== !0 && await e.sendMessage({ type: "system", variant: "success", text:
|
|
731
|
-
let
|
|
732
|
-
if (!
|
|
733
|
-
if (s.error(
|
|
734
|
-
return e.setSubmission(
|
|
730
|
+
return n.data.skipConfirmation !== !0 && await e.sendMessage({ type: "system", variant: "success", text: b("submission_completed") }), r(n.nextId);
|
|
731
|
+
let Te = Dn(B), Se = Te !== void 0 && ((mt = a == null ? void 0 : a[Te]) == null ? void 0 : mt.type) === "file" ? Te : void 0, Pe = Se === void 0 ? void 0 : u.nodes.find((l) => l.type === "question-file" && l.data.key === Se);
|
|
732
|
+
if (!Pe && !(A === "terminal" && (B == null ? void 0 : B.outcome) === "closed") && !sr(B) && (u.data.submitCooldown = Ls(F, U, B)), (B == null ? void 0 : B.outcome) !== "duplicate" && (u.data.failedAttemptAt = { ...u.data.failedAttemptAt, [F]: Date.now() }, (At = u.data.unconfirmedAttemptKeys) != null && At.includes(F) && (u.data.unconfirmedAttemptKeys = u.data.unconfirmedAttemptKeys.filter((l) => l !== F))), (B == null ? void 0 : B.verdict) === "not_submitted" || (B == null ? void 0 : B.outcome) === "duplicate" || (B == null ? void 0 : B.outcome) === "closed" || Tn(G, Qe) ? (W || (u.data.startedWriteNodeIds = (at = u.data.startedWriteNodeIds) == null ? void 0 : at.filter((l) => l !== n.id)), (f == null ? void 0 : f.submitNodeId) === n.id && await g(f), await _().catch((l) => s.error("Failed to persist application write barrier release", l))) : await _().catch((l) => s.error("Failed to persist submit cooldown", l)), B) {
|
|
733
|
+
if (s.error(oe ?? B.message), Pe && Se !== void 0)
|
|
734
|
+
return e.setSubmission(Se, null), await g({ fileQuestionNodeId: Pe.id, submitNodeId: n.id }), await e.sendMessage({ type: "system", variant: "error", text: b("submission_unreadable_document") }), r(Pe.id);
|
|
735
735
|
if (B.outcome === "duplicate")
|
|
736
|
-
return await e.sendMessage({ type: "system", variant: "info", text:
|
|
736
|
+
return await e.sendMessage({ type: "system", variant: "info", text: b(et ? "submission_duplicate_earlier_attempt" : "submission_duplicate") }), q(!1);
|
|
737
737
|
if (B.outcome === "closed")
|
|
738
|
-
return await e.sendMessage({ type: "system", variant: "info", text:
|
|
739
|
-
let
|
|
740
|
-
return
|
|
738
|
+
return await e.sendMessage({ type: "system", variant: "info", text: b("submission_closed") }), A === "terminal" ? (delete u.data.submitCooldown, t()) : q(!1);
|
|
739
|
+
let l = Nn(B);
|
|
740
|
+
return l ? (await e.sendMessage({ type: "system", variant: "warning", text: l.until === void 0 ? b("submission_provider_maintenance_later") : b("submission_provider_maintenance", { time: Pr(l.until, void 0) }) }), q(!1)) : B.outcome === "unknown" ? (await e.sendMessage({ type: "system", variant: "warning", text: b(On(B) ? "submission_unknown_do_not_resubmit" : "submission_unknown") }), q(!1)) : sr(B) ? Bn(G) ? (await e.sendMessage({ type: "text", author: "bot", text: B.message }), q(!1)) : (R === 0 && await e.sendMessage({ type: "system", variant: "warning", text: b("captcha_failed") }), R++, q(R <= _s)) : $n(B) ? (await e.sendMessage({ type: "system", variant: "error", text: b("submission_retryable") }), q(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: b("submission_failed") }), t());
|
|
741
741
|
}
|
|
742
|
-
return s.error(
|
|
742
|
+
return s.error(oe ?? G), await e.sendMessage({ type: "system", variant: "error", text: b("submission_failed") }), t();
|
|
743
743
|
};
|
|
744
|
-
await
|
|
744
|
+
await q(y === !0 && !O ? !1 : n.data.skipConfirmation);
|
|
745
745
|
}
|
|
746
|
-
async function
|
|
746
|
+
async function Ts({ chat: e, next: r, node: t, submissions: n, context: s }) {
|
|
747
747
|
await e.sendMessage({ type: "link", href: he(t.data.href, { submissions: n, context: s }), text: he(t.data.cta, { submissions: n, context: s }) }), r(t.nextId);
|
|
748
748
|
}
|
|
749
|
-
async function
|
|
749
|
+
async function Ns({ submissions: e, next: r, node: t, context: n }) {
|
|
750
750
|
r(xs(t, { submissions: e, context: n }) ? t.branchId : t.nextId);
|
|
751
751
|
}
|
|
752
|
-
async function
|
|
752
|
+
async function Os({ chat: e, next: r, node: t, submissions: n, context: s }) {
|
|
753
753
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.text, { submissions: n, context: s }) }), r(t.nextId);
|
|
754
754
|
}
|
|
755
|
-
async function
|
|
755
|
+
async function Bs({ chat: e, next: r, node: t }) {
|
|
756
756
|
await e.sendMessage({ author: "bot", type: "image", url: t.data.url, height: t.data.height, width: t.data.width }), r(t.nextId);
|
|
757
757
|
}
|
|
758
|
-
async function
|
|
758
|
+
async function $s({ chat: e, next: r, node: t, submissions: n, context: s, t: i, dateEchoLocale: a }) {
|
|
759
759
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
760
760
|
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 } });
|
|
761
761
|
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 ? En(o.value, a) : o.value }), r(t.nextId);
|
|
762
762
|
}
|
|
763
|
-
async function
|
|
763
|
+
async function js({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
|
|
764
764
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
765
765
|
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 } });
|
|
766
766
|
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);
|
|
767
767
|
}
|
|
768
|
-
async function
|
|
768
|
+
async function Ps({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
|
|
769
769
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
770
770
|
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 } });
|
|
771
771
|
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);
|
|
772
772
|
}
|
|
773
|
-
async function
|
|
773
|
+
async function qs({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
|
|
774
774
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
775
775
|
let a = await e.userInput({ key: t.data.key, type: "multiple-choice", config: t.data });
|
|
776
776
|
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);
|
|
777
777
|
}
|
|
778
|
-
async function
|
|
778
|
+
async function Us({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
|
|
779
779
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
780
780
|
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 } } });
|
|
781
781
|
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);
|
|
782
782
|
}
|
|
783
|
-
async function
|
|
783
|
+
async function Hs({ chat: e, next: r, node: t, t: n }) {
|
|
784
784
|
await e.sendMessage({ author: "bot", type: "text", text: t.data.question });
|
|
785
785
|
let s = 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 } });
|
|
786
786
|
if (s === null)
|
|
@@ -791,7 +791,7 @@ async function qs({ chat: e, next: r, node: t, t: n }) {
|
|
|
791
791
|
}
|
|
792
792
|
return r(t.nextId);
|
|
793
793
|
}
|
|
794
|
-
async function
|
|
794
|
+
async function zs({ node: e, chat: r, next: t, submissions: n, context: s, t: i }) {
|
|
795
795
|
await r.sendMessage({ author: "bot", type: "text", text: he(e.data.question, { submissions: n, context: s }) });
|
|
796
796
|
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 } });
|
|
797
797
|
if (a === null)
|
|
@@ -804,14 +804,14 @@ async function Us({ node: e, chat: r, next: t, submissions: n, context: s, t: i
|
|
|
804
804
|
async function Ws({ chat: e, end: r, node: t }) {
|
|
805
805
|
await e.sendMessage({ type: "system", variant: "info", text: t.data.systemMessage }), r();
|
|
806
806
|
}
|
|
807
|
-
async function
|
|
808
|
-
let f = Fn(r.nodes, t || {}), { answers:
|
|
809
|
-
if (n.setSubmission(e.data.key, { type: "integration", value: y }), vs(r, i, { ...a.getSessionInfo(), job: r.job, flow_build: r.build, pre_apply:
|
|
807
|
+
async function Ks({ node: e, flow: r, submissions: t, chat: n, next: s, apiClient: i, analytics: a, signal: o, context: u }) {
|
|
808
|
+
let f = Fn(r.nodes, t || {}), { answers: g, ...y } = f;
|
|
809
|
+
if (n.setSubmission(e.data.key, { type: "integration", value: y }), vs(r, i, { ...a.getSessionInfo(), job: r.job, flow_build: r.build, pre_apply: jr(r.nodes, t || {}, r.data.flowSessionId) }, o), f.status !== "skipped") {
|
|
810
810
|
let p = [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];
|
|
811
811
|
for (let m of ["hard", "advisory"]) {
|
|
812
|
-
let
|
|
813
|
-
|
|
814
|
-
` +
|
|
812
|
+
let _ = g.filter((C) => !C.matched && C.severity === m);
|
|
813
|
+
_.length && p.push((m === "hard" ? "Role requirements" : "Other things to consider") + `
|
|
814
|
+
` + _.map((C) => `• ${C.message}`).join(`
|
|
815
815
|
`));
|
|
816
816
|
}
|
|
817
817
|
await n.sendMessage({ type: "text", author: "bot", text: p.join(`
|
|
@@ -834,7 +834,7 @@ const ur = (e, r, t) => {
|
|
|
834
834
|
},
|
|
835
835
|
customProperties: (n = r.analytics) == null ? void 0 : n.customProperties
|
|
836
836
|
});
|
|
837
|
-
},
|
|
837
|
+
}, $t = "resume-prompt", Gs = async ({
|
|
838
838
|
chatService: e,
|
|
839
839
|
t: r,
|
|
840
840
|
signal: t
|
|
@@ -845,7 +845,7 @@ const ur = (e, r, t) => {
|
|
|
845
845
|
author: "bot",
|
|
846
846
|
text: r("resume_prompt")
|
|
847
847
|
},
|
|
848
|
-
groupId:
|
|
848
|
+
groupId: $t,
|
|
849
849
|
signal: t
|
|
850
850
|
});
|
|
851
851
|
const n = await e.input({
|
|
@@ -862,16 +862,16 @@ const ur = (e, r, t) => {
|
|
|
862
862
|
},
|
|
863
863
|
signal: t
|
|
864
864
|
});
|
|
865
|
-
return
|
|
865
|
+
return P.removeMessagesSentByNodeIds([$t]), (n == null ? void 0 : n.value) !== !1;
|
|
866
866
|
}, $e = ({
|
|
867
867
|
class: e,
|
|
868
868
|
...r
|
|
869
869
|
}) => {
|
|
870
870
|
const {
|
|
871
871
|
t
|
|
872
|
-
} =
|
|
872
|
+
} = te();
|
|
873
873
|
return c("button", {
|
|
874
|
-
class:
|
|
874
|
+
class: Je("bg-accent-9 active:bg-accent-10 pointer-coarse:touch-hitbox fr flex-shrink-0 rounded-full p-2 text-white transition-all disabled:cursor-not-allowed disabled:opacity-50", e),
|
|
875
875
|
type: "submit",
|
|
876
876
|
...r,
|
|
877
877
|
children: c("svg", {
|
|
@@ -905,28 +905,28 @@ function wt(e) {
|
|
|
905
905
|
}
|
|
906
906
|
var Mt;
|
|
907
907
|
// @__NO_SIDE_EFFECTS__
|
|
908
|
-
function
|
|
908
|
+
function Js(e) {
|
|
909
909
|
return Mt == null ? void 0 : Mt.get(e);
|
|
910
910
|
}
|
|
911
911
|
var Lt;
|
|
912
912
|
// @__NO_SIDE_EFFECTS__
|
|
913
|
-
function
|
|
913
|
+
function Zs(e) {
|
|
914
914
|
return Lt == null ? void 0 : Lt.get(e);
|
|
915
915
|
}
|
|
916
|
-
var
|
|
916
|
+
var Rt;
|
|
917
917
|
// @__NO_SIDE_EFFECTS__
|
|
918
|
-
function
|
|
918
|
+
function Xs(e, r) {
|
|
919
919
|
var t;
|
|
920
|
-
return (t =
|
|
920
|
+
return (t = Rt == null ? void 0 : Rt.get(e)) == null ? void 0 : t.get(r);
|
|
921
921
|
}
|
|
922
922
|
// @__NO_SIDE_EFFECTS__
|
|
923
|
-
function
|
|
923
|
+
function Ke(e) {
|
|
924
924
|
var t, n;
|
|
925
925
|
const r = typeof e;
|
|
926
926
|
return r === "string" ? `"${e}"` : r === "number" || r === "bigint" || r === "boolean" ? `${e}` : r === "object" || r === "function" ? (e && ((n = (t = Object.getPrototypeOf(e)) == null ? void 0 : t.constructor) == null ? void 0 : n.name)) ?? "null" : r;
|
|
927
927
|
}
|
|
928
|
-
function
|
|
929
|
-
const i = s && "input" in s ? s.input : t.value, a = (s == null ? void 0 : s.expected) ?? e.expects ?? null, o = (s == null ? void 0 : s.received) ?? /* @__PURE__ */
|
|
928
|
+
function ee(e, r, t, n, s) {
|
|
929
|
+
const i = s && "input" in s ? s.input : t.value, a = (s == null ? void 0 : s.expected) ?? e.expects ?? null, o = (s == null ? void 0 : s.received) ?? /* @__PURE__ */ Ke(i), u = {
|
|
930
930
|
kind: e.kind,
|
|
931
931
|
type: e.type,
|
|
932
932
|
input: i,
|
|
@@ -939,11 +939,11 @@ function te(e, r, t, n, s) {
|
|
|
939
939
|
lang: n.lang,
|
|
940
940
|
abortEarly: n.abortEarly,
|
|
941
941
|
abortPipeEarly: n.abortPipeEarly
|
|
942
|
-
}, f = e.kind === "schema",
|
|
943
|
-
|
|
942
|
+
}, f = e.kind === "schema", g = (s == null ? void 0 : s.message) ?? e.message ?? /* @__PURE__ */ Xs(e.reference, u.lang) ?? (f ? /* @__PURE__ */ Zs(u.lang) : null) ?? n.message ?? /* @__PURE__ */ Js(u.lang);
|
|
943
|
+
g !== void 0 && (u.message = typeof g == "function" ? (
|
|
944
944
|
// @ts-expect-error
|
|
945
|
-
|
|
946
|
-
) :
|
|
945
|
+
g(u)
|
|
946
|
+
) : g), f && (t.typed = !1), t.issues ? t.issues.push(u) : t.issues = [u];
|
|
947
947
|
}
|
|
948
948
|
// @__NO_SIDE_EFFECTS__
|
|
949
949
|
function be(e) {
|
|
@@ -956,16 +956,16 @@ function be(e) {
|
|
|
956
956
|
};
|
|
957
957
|
}
|
|
958
958
|
// @__NO_SIDE_EFFECTS__
|
|
959
|
-
function
|
|
959
|
+
function Ys(e, r) {
|
|
960
960
|
return Object.hasOwn(e, r) && r !== "__proto__" && r !== "prototype" && r !== "constructor";
|
|
961
961
|
}
|
|
962
962
|
// @__NO_SIDE_EFFECTS__
|
|
963
|
-
function
|
|
963
|
+
function Qs(e, r) {
|
|
964
964
|
const t = [...new Set(e)];
|
|
965
965
|
return t.length > 1 ? `(${t.join(` ${r} `)})` : t[0] ?? "never";
|
|
966
966
|
}
|
|
967
967
|
// @__NO_SIDE_EFFECTS__
|
|
968
|
-
function
|
|
968
|
+
function ea(e) {
|
|
969
969
|
if (e.path) {
|
|
970
970
|
let r = "";
|
|
971
971
|
for (const t of e.path)
|
|
@@ -977,7 +977,7 @@ function Ys(e) {
|
|
|
977
977
|
}
|
|
978
978
|
return null;
|
|
979
979
|
}
|
|
980
|
-
var
|
|
980
|
+
var ta = class extends Error {
|
|
981
981
|
/**
|
|
982
982
|
* Creates a Valibot error with useful information.
|
|
983
983
|
*
|
|
@@ -986,7 +986,7 @@ var Qs = class extends Error {
|
|
|
986
986
|
constructor(e) {
|
|
987
987
|
super(e[0].message), this.name = "ValiError", this.issues = e;
|
|
988
988
|
}
|
|
989
|
-
},
|
|
989
|
+
}, ra = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
|
|
990
990
|
// @__NO_SIDE_EFFECTS__
|
|
991
991
|
function Xr(e, r) {
|
|
992
992
|
return {
|
|
@@ -998,7 +998,7 @@ function Xr(e, r) {
|
|
|
998
998
|
requirement: e,
|
|
999
999
|
message: r,
|
|
1000
1000
|
"~run"(t, n) {
|
|
1001
|
-
return t.typed && !this.requirement(t.value) &&
|
|
1001
|
+
return t.typed && !this.requirement(t.value) && ee(this, "input", t, n), t;
|
|
1002
1002
|
}
|
|
1003
1003
|
};
|
|
1004
1004
|
}
|
|
@@ -1010,25 +1010,25 @@ function Yr(e) {
|
|
|
1010
1010
|
reference: Yr,
|
|
1011
1011
|
expects: null,
|
|
1012
1012
|
async: !1,
|
|
1013
|
-
requirement:
|
|
1013
|
+
requirement: ra,
|
|
1014
1014
|
message: e,
|
|
1015
1015
|
"~run"(r, t) {
|
|
1016
|
-
return r.typed && !this.requirement.test(r.value) &&
|
|
1016
|
+
return r.typed && !this.requirement.test(r.value) && ee(this, "email", r, t), r;
|
|
1017
1017
|
}
|
|
1018
1018
|
};
|
|
1019
1019
|
}
|
|
1020
1020
|
// @__NO_SIDE_EFFECTS__
|
|
1021
|
-
function
|
|
1021
|
+
function ct(e, r) {
|
|
1022
1022
|
return {
|
|
1023
1023
|
kind: "validation",
|
|
1024
1024
|
type: "max_length",
|
|
1025
|
-
reference:
|
|
1025
|
+
reference: ct,
|
|
1026
1026
|
async: !1,
|
|
1027
1027
|
expects: `<=${e}`,
|
|
1028
1028
|
requirement: e,
|
|
1029
1029
|
message: r,
|
|
1030
1030
|
"~run"(t, n) {
|
|
1031
|
-
return t.typed && t.value.length > this.requirement &&
|
|
1031
|
+
return t.typed && t.value.length > this.requirement && ee(this, "length", t, n, {
|
|
1032
1032
|
received: `${t.value.length}`
|
|
1033
1033
|
}), t;
|
|
1034
1034
|
}
|
|
@@ -1041,28 +1041,28 @@ function Qr(e, r) {
|
|
|
1041
1041
|
type: "max_value",
|
|
1042
1042
|
reference: Qr,
|
|
1043
1043
|
async: !1,
|
|
1044
|
-
expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */
|
|
1044
|
+
expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ Ke(e)}`,
|
|
1045
1045
|
requirement: e,
|
|
1046
1046
|
message: r,
|
|
1047
1047
|
"~run"(t, n) {
|
|
1048
|
-
return t.typed && !(t.value <= this.requirement) &&
|
|
1049
|
-
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */
|
|
1048
|
+
return t.typed && !(t.value <= this.requirement) && ee(this, "value", t, n, {
|
|
1049
|
+
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ Ke(t.value)
|
|
1050
1050
|
}), t;
|
|
1051
1051
|
}
|
|
1052
1052
|
};
|
|
1053
1053
|
}
|
|
1054
1054
|
// @__NO_SIDE_EFFECTS__
|
|
1055
|
-
function
|
|
1055
|
+
function We(e, r) {
|
|
1056
1056
|
return {
|
|
1057
1057
|
kind: "validation",
|
|
1058
1058
|
type: "min_length",
|
|
1059
|
-
reference:
|
|
1059
|
+
reference: We,
|
|
1060
1060
|
async: !1,
|
|
1061
1061
|
expects: `>=${e}`,
|
|
1062
1062
|
requirement: e,
|
|
1063
1063
|
message: r,
|
|
1064
1064
|
"~run"(t, n) {
|
|
1065
|
-
return t.typed && t.value.length < this.requirement &&
|
|
1065
|
+
return t.typed && t.value.length < this.requirement && ee(this, "length", t, n, {
|
|
1066
1066
|
received: `${t.value.length}`
|
|
1067
1067
|
}), t;
|
|
1068
1068
|
}
|
|
@@ -1075,12 +1075,12 @@ function en(e, r) {
|
|
|
1075
1075
|
type: "min_value",
|
|
1076
1076
|
reference: en,
|
|
1077
1077
|
async: !1,
|
|
1078
|
-
expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */
|
|
1078
|
+
expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ Ke(e)}`,
|
|
1079
1079
|
requirement: e,
|
|
1080
1080
|
message: r,
|
|
1081
1081
|
"~run"(t, n) {
|
|
1082
|
-
return t.typed && !(t.value >= this.requirement) &&
|
|
1083
|
-
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */
|
|
1082
|
+
return t.typed && !(t.value >= this.requirement) && ee(this, "value", t, n, {
|
|
1083
|
+
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ Ke(t.value)
|
|
1084
1084
|
}), t;
|
|
1085
1085
|
}
|
|
1086
1086
|
};
|
|
@@ -1096,16 +1096,16 @@ function zt(e, r) {
|
|
|
1096
1096
|
requirement: e,
|
|
1097
1097
|
message: r,
|
|
1098
1098
|
"~run"(t, n) {
|
|
1099
|
-
return t.typed && !this.requirement.test(t.value) &&
|
|
1099
|
+
return t.typed && !this.requirement.test(t.value) && ee(this, "format", t, n), t;
|
|
1100
1100
|
}
|
|
1101
1101
|
};
|
|
1102
1102
|
}
|
|
1103
1103
|
// @__NO_SIDE_EFFECTS__
|
|
1104
|
-
function
|
|
1104
|
+
function Wt(e) {
|
|
1105
1105
|
return {
|
|
1106
1106
|
kind: "transformation",
|
|
1107
1107
|
type: "transform",
|
|
1108
|
-
reference:
|
|
1108
|
+
reference: Wt,
|
|
1109
1109
|
async: !1,
|
|
1110
1110
|
operation: e,
|
|
1111
1111
|
"~run"(r) {
|
|
@@ -1130,12 +1130,12 @@ function tn(e) {
|
|
|
1130
1130
|
},
|
|
1131
1131
|
message: e,
|
|
1132
1132
|
"~run"(r, t) {
|
|
1133
|
-
return r.typed && !this.requirement(r.value) &&
|
|
1133
|
+
return r.typed && !this.requirement(r.value) && ee(this, "URL", r, t), r;
|
|
1134
1134
|
}
|
|
1135
1135
|
};
|
|
1136
1136
|
}
|
|
1137
1137
|
// @__NO_SIDE_EFFECTS__
|
|
1138
|
-
function
|
|
1138
|
+
function na(e, r, t) {
|
|
1139
1139
|
return typeof e.fallback == "function" ? (
|
|
1140
1140
|
// @ts-expect-error
|
|
1141
1141
|
e.fallback(r, t)
|
|
@@ -1182,8 +1182,8 @@ function nn(e, r) {
|
|
|
1182
1182
|
key: a,
|
|
1183
1183
|
value: o
|
|
1184
1184
|
};
|
|
1185
|
-
for (const
|
|
1186
|
-
|
|
1185
|
+
for (const g of u.issues)
|
|
1186
|
+
g.path ? g.path.unshift(f) : g.path = [f], (i = t.issues) == null || i.push(g);
|
|
1187
1187
|
if (t.issues || (t.issues = u.issues), n.abortEarly) {
|
|
1188
1188
|
t.typed = !1;
|
|
1189
1189
|
break;
|
|
@@ -1192,7 +1192,7 @@ function nn(e, r) {
|
|
|
1192
1192
|
u.typed || (t.typed = !1), t.value.push(u.value);
|
|
1193
1193
|
}
|
|
1194
1194
|
} else
|
|
1195
|
-
|
|
1195
|
+
ee(this, "type", t, n);
|
|
1196
1196
|
return t;
|
|
1197
1197
|
}
|
|
1198
1198
|
};
|
|
@@ -1210,7 +1210,7 @@ function sn(e) {
|
|
|
1210
1210
|
return /* @__PURE__ */ be(this);
|
|
1211
1211
|
},
|
|
1212
1212
|
"~run"(r, t) {
|
|
1213
|
-
return typeof r.value == "boolean" ? r.typed = !0 :
|
|
1213
|
+
return typeof r.value == "boolean" ? r.typed = !0 : ee(this, "type", r, t), r;
|
|
1214
1214
|
}
|
|
1215
1215
|
};
|
|
1216
1216
|
}
|
|
@@ -1227,7 +1227,7 @@ function an(e) {
|
|
|
1227
1227
|
return /* @__PURE__ */ be(this);
|
|
1228
1228
|
},
|
|
1229
1229
|
"~run"(r, t) {
|
|
1230
|
-
return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 :
|
|
1230
|
+
return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : ee(this, "type", r, t), r;
|
|
1231
1231
|
}
|
|
1232
1232
|
};
|
|
1233
1233
|
}
|
|
@@ -1258,7 +1258,7 @@ function _e(e, r) {
|
|
|
1258
1258
|
s[a]
|
|
1259
1259
|
) : /* @__PURE__ */ rn(o), f = o["~run"]({ value: u }, n);
|
|
1260
1260
|
if (f.issues) {
|
|
1261
|
-
const
|
|
1261
|
+
const g = {
|
|
1262
1262
|
type: "object",
|
|
1263
1263
|
origin: "value",
|
|
1264
1264
|
input: s,
|
|
@@ -1266,7 +1266,7 @@ function _e(e, r) {
|
|
|
1266
1266
|
value: u
|
|
1267
1267
|
};
|
|
1268
1268
|
for (const y of f.issues)
|
|
1269
|
-
y.path ? y.path.unshift(
|
|
1269
|
+
y.path ? y.path.unshift(g) : y.path = [g], (i = t.issues) == null || i.push(y);
|
|
1270
1270
|
if (t.issues || (t.issues = f.issues), n.abortEarly) {
|
|
1271
1271
|
t.typed = !1;
|
|
1272
1272
|
break;
|
|
@@ -1274,8 +1274,8 @@ function _e(e, r) {
|
|
|
1274
1274
|
}
|
|
1275
1275
|
f.typed || (t.typed = !1), t.value[a] = f.value;
|
|
1276
1276
|
} else if (o.fallback !== void 0)
|
|
1277
|
-
t.value[a] = /* @__PURE__ */
|
|
1278
|
-
else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (
|
|
1277
|
+
t.value[a] = /* @__PURE__ */ na(o);
|
|
1278
|
+
else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (ee(this, "key", t, n, {
|
|
1279
1279
|
input: void 0,
|
|
1280
1280
|
expected: `"${a}"`,
|
|
1281
1281
|
path: [
|
|
@@ -1292,17 +1292,17 @@ function _e(e, r) {
|
|
|
1292
1292
|
break;
|
|
1293
1293
|
}
|
|
1294
1294
|
} else
|
|
1295
|
-
|
|
1295
|
+
ee(this, "type", t, n);
|
|
1296
1296
|
return t;
|
|
1297
1297
|
}
|
|
1298
1298
|
};
|
|
1299
1299
|
}
|
|
1300
1300
|
// @__NO_SIDE_EFFECTS__
|
|
1301
|
-
function
|
|
1301
|
+
function ze(e, r) {
|
|
1302
1302
|
return {
|
|
1303
1303
|
kind: "schema",
|
|
1304
1304
|
type: "optional",
|
|
1305
|
-
reference:
|
|
1305
|
+
reference: ze,
|
|
1306
1306
|
expects: `(${e.expects} | undefined)`,
|
|
1307
1307
|
async: !1,
|
|
1308
1308
|
wrapped: e,
|
|
@@ -1321,7 +1321,7 @@ function on(e, r) {
|
|
|
1321
1321
|
kind: "schema",
|
|
1322
1322
|
type: "picklist",
|
|
1323
1323
|
reference: on,
|
|
1324
|
-
expects: /* @__PURE__ */
|
|
1324
|
+
expects: /* @__PURE__ */ Qs(e.map(Ke), "|"),
|
|
1325
1325
|
async: !1,
|
|
1326
1326
|
options: e,
|
|
1327
1327
|
message: r,
|
|
@@ -1329,7 +1329,7 @@ function on(e, r) {
|
|
|
1329
1329
|
return /* @__PURE__ */ be(this);
|
|
1330
1330
|
},
|
|
1331
1331
|
"~run"(t, n) {
|
|
1332
|
-
return this.options.includes(t.value) ? t.typed = !0 :
|
|
1332
|
+
return this.options.includes(t.value) ? t.typed = !0 : ee(this, "type", t, n), t;
|
|
1333
1333
|
}
|
|
1334
1334
|
};
|
|
1335
1335
|
}
|
|
@@ -1353,9 +1353,9 @@ function ln(e, r, t) {
|
|
|
1353
1353
|
if (i && typeof i == "object") {
|
|
1354
1354
|
n.typed = !0, n.value = {};
|
|
1355
1355
|
for (const u in i)
|
|
1356
|
-
if (/* @__PURE__ */
|
|
1357
|
-
const f = i[u],
|
|
1358
|
-
if (
|
|
1356
|
+
if (/* @__PURE__ */ Ys(i, u)) {
|
|
1357
|
+
const f = i[u], g = this.key["~run"]({ value: u }, s);
|
|
1358
|
+
if (g.issues) {
|
|
1359
1359
|
const p = {
|
|
1360
1360
|
type: "object",
|
|
1361
1361
|
origin: "key",
|
|
@@ -1363,9 +1363,9 @@ function ln(e, r, t) {
|
|
|
1363
1363
|
key: u,
|
|
1364
1364
|
value: f
|
|
1365
1365
|
};
|
|
1366
|
-
for (const m of
|
|
1366
|
+
for (const m of g.issues)
|
|
1367
1367
|
m.path = [p], (a = n.issues) == null || a.push(m);
|
|
1368
|
-
if (n.issues || (n.issues =
|
|
1368
|
+
if (n.issues || (n.issues = g.issues), s.abortEarly) {
|
|
1369
1369
|
n.typed = !1;
|
|
1370
1370
|
break;
|
|
1371
1371
|
}
|
|
@@ -1389,20 +1389,20 @@ function ln(e, r, t) {
|
|
|
1389
1389
|
break;
|
|
1390
1390
|
}
|
|
1391
1391
|
}
|
|
1392
|
-
(!
|
|
1392
|
+
(!g.typed || !y.typed) && (n.typed = !1), g.typed && (n.value[g.value] = y.value);
|
|
1393
1393
|
}
|
|
1394
1394
|
} else
|
|
1395
|
-
|
|
1395
|
+
ee(this, "type", n, s);
|
|
1396
1396
|
return n;
|
|
1397
1397
|
}
|
|
1398
1398
|
};
|
|
1399
1399
|
}
|
|
1400
1400
|
// @__NO_SIDE_EFFECTS__
|
|
1401
|
-
function
|
|
1401
|
+
function ie(e) {
|
|
1402
1402
|
return {
|
|
1403
1403
|
kind: "schema",
|
|
1404
1404
|
type: "string",
|
|
1405
|
-
reference:
|
|
1405
|
+
reference: ie,
|
|
1406
1406
|
expects: "string",
|
|
1407
1407
|
async: !1,
|
|
1408
1408
|
message: e,
|
|
@@ -1410,21 +1410,21 @@ function oe(e) {
|
|
|
1410
1410
|
return /* @__PURE__ */ be(this);
|
|
1411
1411
|
},
|
|
1412
1412
|
"~run"(r, t) {
|
|
1413
|
-
return typeof r.value == "string" ? r.typed = !0 :
|
|
1413
|
+
return typeof r.value == "string" ? r.typed = !0 : ee(this, "type", r, t), r;
|
|
1414
1414
|
}
|
|
1415
1415
|
};
|
|
1416
1416
|
}
|
|
1417
|
-
function
|
|
1417
|
+
function sa(e, r, t) {
|
|
1418
1418
|
const n = e["~run"]({ value: r }, /* @__PURE__ */ wt(t));
|
|
1419
1419
|
if (n.issues)
|
|
1420
|
-
throw new
|
|
1420
|
+
throw new ta(n.issues);
|
|
1421
1421
|
return n.value;
|
|
1422
1422
|
}
|
|
1423
1423
|
// @__NO_SIDE_EFFECTS__
|
|
1424
|
-
function
|
|
1424
|
+
function aa(e, r) {
|
|
1425
1425
|
const t = {};
|
|
1426
1426
|
for (const n in e.entries)
|
|
1427
|
-
t[n] = !r || r.includes(n) ? /* @__PURE__ */
|
|
1427
|
+
t[n] = !r || r.includes(n) ? /* @__PURE__ */ ze(e.entries[n]) : e.entries[n];
|
|
1428
1428
|
return {
|
|
1429
1429
|
...e,
|
|
1430
1430
|
entries: t,
|
|
@@ -1434,7 +1434,7 @@ function na(e, r) {
|
|
|
1434
1434
|
};
|
|
1435
1435
|
}
|
|
1436
1436
|
// @__NO_SIDE_EFFECTS__
|
|
1437
|
-
function
|
|
1437
|
+
function Ve(...e) {
|
|
1438
1438
|
return {
|
|
1439
1439
|
...e[0],
|
|
1440
1440
|
pipe: e,
|
|
@@ -1455,7 +1455,7 @@ function Ne(...e) {
|
|
|
1455
1455
|
};
|
|
1456
1456
|
}
|
|
1457
1457
|
// @__NO_SIDE_EFFECTS__
|
|
1458
|
-
function
|
|
1458
|
+
function ia(e, r, t) {
|
|
1459
1459
|
const n = e["~run"]({ value: r }, /* @__PURE__ */ wt(t));
|
|
1460
1460
|
return {
|
|
1461
1461
|
typed: n.typed,
|
|
@@ -1465,7 +1465,7 @@ function sa(e, r, t) {
|
|
|
1465
1465
|
};
|
|
1466
1466
|
}
|
|
1467
1467
|
// @__NO_SIDE_EFFECTS__
|
|
1468
|
-
async function
|
|
1468
|
+
async function oa(e, r, t) {
|
|
1469
1469
|
const n = await e["~run"](
|
|
1470
1470
|
{ value: r },
|
|
1471
1471
|
/* @__PURE__ */ wt(t)
|
|
@@ -1477,7 +1477,7 @@ async function aa(e, r, t) {
|
|
|
1477
1477
|
issues: n.issues
|
|
1478
1478
|
};
|
|
1479
1479
|
}
|
|
1480
|
-
const
|
|
1480
|
+
const Xe = ({
|
|
1481
1481
|
error: e
|
|
1482
1482
|
}) => !e || !e.message ? null : c("div", {
|
|
1483
1483
|
role: "alert",
|
|
@@ -1510,16 +1510,16 @@ const Ye = ({
|
|
|
1510
1510
|
class: "break-words pr-1 text-sm",
|
|
1511
1511
|
children: e.message
|
|
1512
1512
|
})]
|
|
1513
|
-
}),
|
|
1513
|
+
}), Le = ({
|
|
1514
1514
|
class: e,
|
|
1515
1515
|
...r
|
|
1516
1516
|
}) => {
|
|
1517
1517
|
const {
|
|
1518
1518
|
t
|
|
1519
|
-
} =
|
|
1519
|
+
} = te();
|
|
1520
1520
|
return c("button", {
|
|
1521
1521
|
type: "button",
|
|
1522
|
-
class:
|
|
1522
|
+
class: Je("fr touch-hitbox text-neutral-11 bg-neutral-1 ring-divider hover:ring-divider active:ring-interactive-bg-hover hover:text-neutral-12 active:text-neutral-12 hover:bg-divider active:bg-interactive-bg-hover flex flex-shrink-0 items-center justify-center gap-1 self-center rounded-full py-1 pl-2 pr-2.5 text-sm ring-1 transition-all", e),
|
|
1523
1523
|
...r,
|
|
1524
1524
|
children: [c("svg", {
|
|
1525
1525
|
"aria-hidden": !0,
|
|
@@ -1542,7 +1542,7 @@ const Ye = ({
|
|
|
1542
1542
|
});
|
|
1543
1543
|
};
|
|
1544
1544
|
var Kt = { 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" };
|
|
1545
|
-
const
|
|
1545
|
+
const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest py-1 text-base outline outline-2 transition-all", {
|
|
1546
1546
|
variants: {
|
|
1547
1547
|
optional: {
|
|
1548
1548
|
true: "pr-16 pl-3",
|
|
@@ -1552,16 +1552,16 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1552
1552
|
defaultVariants: {
|
|
1553
1553
|
optional: !1
|
|
1554
1554
|
}
|
|
1555
|
-
}),
|
|
1556
|
-
name: /* @__PURE__ */
|
|
1557
|
-
}),
|
|
1555
|
+
}), la = "https://api.mapbox.com/search/searchbox/v1/suggest", ca = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", ua = (e) => atob(e).split("").reverse().join(""), ve = /* @__PURE__ */ _e({
|
|
1556
|
+
name: /* @__PURE__ */ ie()
|
|
1557
|
+
}), da = /* @__PURE__ */ _e({
|
|
1558
1558
|
suggestions: /* @__PURE__ */ nn(/* @__PURE__ */ _e({
|
|
1559
|
-
feature_type: /* @__PURE__ */
|
|
1560
|
-
full_address: /* @__PURE__ */
|
|
1561
|
-
place_formatted: /* @__PURE__ */
|
|
1562
|
-
name: /* @__PURE__ */
|
|
1563
|
-
mapbox_id: /* @__PURE__ */
|
|
1564
|
-
context: /* @__PURE__ */
|
|
1559
|
+
feature_type: /* @__PURE__ */ ze(/* @__PURE__ */ ie()),
|
|
1560
|
+
full_address: /* @__PURE__ */ ze(/* @__PURE__ */ ie()),
|
|
1561
|
+
place_formatted: /* @__PURE__ */ ze(/* @__PURE__ */ ie()),
|
|
1562
|
+
name: /* @__PURE__ */ ze(/* @__PURE__ */ ie()),
|
|
1563
|
+
mapbox_id: /* @__PURE__ */ ie(),
|
|
1564
|
+
context: /* @__PURE__ */ aa(/* @__PURE__ */ _e({
|
|
1565
1565
|
address: ve,
|
|
1566
1566
|
street: ve,
|
|
1567
1567
|
neighborhood: ve,
|
|
@@ -1573,51 +1573,51 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1573
1573
|
country: ve
|
|
1574
1574
|
}))
|
|
1575
1575
|
}))
|
|
1576
|
-
}),
|
|
1576
|
+
}), fa = ({
|
|
1577
1577
|
logger: e,
|
|
1578
1578
|
t: r
|
|
1579
1579
|
}) => Un(() => {
|
|
1580
1580
|
var n;
|
|
1581
|
-
const t = (n =
|
|
1581
|
+
const t = (n = P.current$.peek().flow) == null ? void 0 : n.data.flowSessionId;
|
|
1582
1582
|
return t ? {
|
|
1583
1583
|
enabled: !0,
|
|
1584
1584
|
getPredictions: async (s) => {
|
|
1585
1585
|
var y;
|
|
1586
|
-
const i = new URL(
|
|
1586
|
+
const i = new URL(la);
|
|
1587
1587
|
i.searchParams.set("q", s), i.searchParams.set("session_token", t);
|
|
1588
|
-
const a = (y =
|
|
1589
|
-
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",
|
|
1588
|
+
const a = (y = P.current$.peek().flow) == null ? void 0 : y.locationOrigin;
|
|
1589
|
+
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", ua(ca));
|
|
1590
1590
|
const u = await fetch(i);
|
|
1591
1591
|
if (!u.ok)
|
|
1592
1592
|
return e.error("Failed to get address details", u), {
|
|
1593
1593
|
ok: !1,
|
|
1594
1594
|
error: r("address_error")
|
|
1595
1595
|
};
|
|
1596
|
-
const f = /* @__PURE__ */
|
|
1596
|
+
const f = /* @__PURE__ */ ia(da, await u.json());
|
|
1597
1597
|
if (f.success === !1)
|
|
1598
1598
|
return e.error("Failed to parse address details", f.issues), {
|
|
1599
1599
|
ok: !1,
|
|
1600
1600
|
error: r("address_error")
|
|
1601
1601
|
};
|
|
1602
1602
|
const {
|
|
1603
|
-
suggestions:
|
|
1603
|
+
suggestions: g
|
|
1604
1604
|
} = f.output;
|
|
1605
1605
|
return {
|
|
1606
1606
|
ok: !0,
|
|
1607
|
-
data:
|
|
1608
|
-
var m,
|
|
1607
|
+
data: g.map((p) => {
|
|
1608
|
+
var m, _, C, k, A, b, V, F, R;
|
|
1609
1609
|
return {
|
|
1610
1610
|
// A postcode result has no full address and is named by the postcode itself (PROD-7311).
|
|
1611
1611
|
label: p.full_address ?? ([p.name, p.place_formatted].filter(Boolean).join(", ") || p.mapbox_id),
|
|
1612
1612
|
id: p.mapbox_id,
|
|
1613
1613
|
address: {
|
|
1614
|
-
line1: ((m = p.context.address) == null ? void 0 : m.name) ?? ((
|
|
1614
|
+
line1: ((m = p.context.address) == null ? void 0 : m.name) ?? ((_ = p.context.street) == null ? void 0 : _.name),
|
|
1615
1615
|
line2: void 0,
|
|
1616
|
-
line3: ((
|
|
1617
|
-
city: ((
|
|
1618
|
-
state: (
|
|
1619
|
-
postcode: ((
|
|
1620
|
-
country: (
|
|
1616
|
+
line3: ((C = p.context.neighborhood) == null ? void 0 : C.name) ?? ((k = p.context.locality) == null ? void 0 : k.name),
|
|
1617
|
+
city: ((A = p.context.place) == null ? void 0 : A.name) ?? ((b = p.context.district) == null ? void 0 : b.name),
|
|
1618
|
+
state: (V = p.context.region) == null ? void 0 : V.name,
|
|
1619
|
+
postcode: ((F = p.context.postcode) == null ? void 0 : F.name) ?? (p.feature_type === "postcode" ? p.name : void 0),
|
|
1620
|
+
country: (R = p.context.country) == null ? void 0 : R.name
|
|
1621
1621
|
}
|
|
1622
1622
|
};
|
|
1623
1623
|
})
|
|
@@ -1629,7 +1629,7 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1629
1629
|
}, [e, r]), dr = (e) => {
|
|
1630
1630
|
const {
|
|
1631
1631
|
t: r
|
|
1632
|
-
} =
|
|
1632
|
+
} = te();
|
|
1633
1633
|
return c("button", {
|
|
1634
1634
|
type: "button",
|
|
1635
1635
|
class: "touch-hitbox text-neutral-11 hover:bg-neutral-4 hover:text-neutral-12 hover:border-neutral-5 relative flex items-center gap-1 rounded-[18px] border border-solid border-transparent px-3 py-1 pl-1.5 text-sm transition-colors",
|
|
@@ -1649,80 +1649,80 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1649
1649
|
children: r("back")
|
|
1650
1650
|
})]
|
|
1651
1651
|
});
|
|
1652
|
-
},
|
|
1652
|
+
}, ha = ({
|
|
1653
1653
|
input: e,
|
|
1654
1654
|
onSubmitSuccess: r,
|
|
1655
1655
|
logger: t
|
|
1656
1656
|
}) => {
|
|
1657
1657
|
const {
|
|
1658
1658
|
t: n
|
|
1659
|
-
} =
|
|
1659
|
+
} = te(), [s, i] = we(), {
|
|
1660
1660
|
enabled: a,
|
|
1661
1661
|
getPredictions: o
|
|
1662
|
-
} =
|
|
1662
|
+
} = fa({
|
|
1663
1663
|
logger: t,
|
|
1664
1664
|
t: n
|
|
1665
|
-
}), [u, f] = we(a ? "query" : "manual"), [
|
|
1666
|
-
var
|
|
1667
|
-
if (
|
|
1665
|
+
}), [u, f] = we(a ? "query" : "manual"), [g, y] = we(""), [p, m] = we(), _ = ye(), C = ye(), k = (b) => {
|
|
1666
|
+
var F;
|
|
1667
|
+
if (Be(a, "Query state should not be enabled"), b = b.trim(), b === ((F = _.current) == null ? void 0 : F.query) || b === (p == null ? void 0 : p.query) && p.status === "done")
|
|
1668
1668
|
return;
|
|
1669
|
-
if (y(
|
|
1670
|
-
|
|
1669
|
+
if (y(b), b === "") {
|
|
1670
|
+
_.current = void 0, m(void 0);
|
|
1671
1671
|
return;
|
|
1672
1672
|
}
|
|
1673
|
-
const
|
|
1674
|
-
query:
|
|
1673
|
+
const V = _.current = {
|
|
1674
|
+
query: b
|
|
1675
1675
|
};
|
|
1676
1676
|
m({
|
|
1677
|
-
query:
|
|
1677
|
+
query: b,
|
|
1678
1678
|
status: "pending"
|
|
1679
|
-
}), o(
|
|
1680
|
-
|
|
1681
|
-
query:
|
|
1679
|
+
}), o(b).then((R) => {
|
|
1680
|
+
_.current === V && (_.current = void 0, m(R.ok ? {
|
|
1681
|
+
query: b,
|
|
1682
1682
|
status: "done",
|
|
1683
|
-
items:
|
|
1683
|
+
items: R.data
|
|
1684
1684
|
} : {
|
|
1685
|
-
query:
|
|
1685
|
+
query: b,
|
|
1686
1686
|
status: "failed",
|
|
1687
|
-
error:
|
|
1687
|
+
error: R.error
|
|
1688
1688
|
}));
|
|
1689
|
-
}, (
|
|
1690
|
-
|
|
1691
|
-
query:
|
|
1689
|
+
}, (R) => {
|
|
1690
|
+
_.current === V && (_.current = void 0, t.error("Failed to get address details", R), m({
|
|
1691
|
+
query: b,
|
|
1692
1692
|
status: "failed",
|
|
1693
1693
|
error: n("address_error")
|
|
1694
1694
|
}));
|
|
1695
1695
|
});
|
|
1696
|
-
},
|
|
1697
|
-
i((
|
|
1698
|
-
...
|
|
1699
|
-
[
|
|
1696
|
+
}, A = (b, V) => {
|
|
1697
|
+
i((F) => ({
|
|
1698
|
+
...F,
|
|
1699
|
+
[b]: V
|
|
1700
1700
|
}));
|
|
1701
1701
|
};
|
|
1702
1702
|
switch (u) {
|
|
1703
1703
|
case "query":
|
|
1704
|
-
return
|
|
1704
|
+
return Be(a, "Query state should not be enabled"), c(pa, {
|
|
1705
1705
|
input: e,
|
|
1706
1706
|
onSkip: () => r(null),
|
|
1707
|
-
onAddressSelect: (
|
|
1708
|
-
if (
|
|
1709
|
-
|
|
1707
|
+
onAddressSelect: (b) => {
|
|
1708
|
+
if (b === "") {
|
|
1709
|
+
_.current && (_.current = void 0, m(void 0)), f("manual");
|
|
1710
1710
|
return;
|
|
1711
1711
|
}
|
|
1712
|
-
const
|
|
1713
|
-
|
|
1712
|
+
const V = (p == null ? void 0 : p.status) === "done" ? p.items.find((F) => F.id === b) : void 0;
|
|
1713
|
+
V && (C.current !== b && i(V.address), C.current = b, f("details"));
|
|
1714
1714
|
},
|
|
1715
|
-
onAddressSearch:
|
|
1715
|
+
onAddressSearch: k,
|
|
1716
1716
|
lookup: p,
|
|
1717
|
-
query:
|
|
1717
|
+
query: g
|
|
1718
1718
|
});
|
|
1719
1719
|
case "details":
|
|
1720
|
-
return
|
|
1720
|
+
return Be(s !== void 0), c(fr, {
|
|
1721
1721
|
input: e,
|
|
1722
1722
|
logger: t,
|
|
1723
1723
|
onSubmitSuccess: r,
|
|
1724
1724
|
addressFields: s,
|
|
1725
|
-
onFieldChange:
|
|
1725
|
+
onFieldChange: A,
|
|
1726
1726
|
actions: c(dr, {
|
|
1727
1727
|
onClick: () => {
|
|
1728
1728
|
f("query");
|
|
@@ -1735,20 +1735,20 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1735
1735
|
input: e,
|
|
1736
1736
|
onSubmitSuccess: r,
|
|
1737
1737
|
addressFields: s ?? {},
|
|
1738
|
-
onFieldChange:
|
|
1738
|
+
onFieldChange: A,
|
|
1739
1739
|
actions: a ? c(dr, {
|
|
1740
1740
|
onClick: () => {
|
|
1741
1741
|
f("query");
|
|
1742
1742
|
}
|
|
1743
1743
|
}) : e.config.optional ? (
|
|
1744
1744
|
// Without address search this is the only screen, so an optional question needs its own way past.
|
|
1745
|
-
c(
|
|
1745
|
+
c(Le, {
|
|
1746
1746
|
onClick: () => r(null)
|
|
1747
1747
|
})
|
|
1748
1748
|
) : void 0
|
|
1749
1749
|
});
|
|
1750
1750
|
}
|
|
1751
|
-
},
|
|
1751
|
+
}, pa = ({
|
|
1752
1752
|
input: e,
|
|
1753
1753
|
onSkip: r,
|
|
1754
1754
|
lookup: t,
|
|
@@ -1758,16 +1758,16 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1758
1758
|
}) => {
|
|
1759
1759
|
const {
|
|
1760
1760
|
t: a
|
|
1761
|
-
} =
|
|
1762
|
-
return
|
|
1761
|
+
} = te(), o = ye(null);
|
|
1762
|
+
return Me(() => {
|
|
1763
1763
|
o.current && (o.current.focus(), o.current.select());
|
|
1764
1764
|
}, []), c(ke, {
|
|
1765
1765
|
children: [c("form", {
|
|
1766
1766
|
noValidate: !0,
|
|
1767
1767
|
onSubmit: (u) => {
|
|
1768
1768
|
u.preventDefault();
|
|
1769
|
-
const
|
|
1770
|
-
typeof
|
|
1769
|
+
const g = new FormData(u.currentTarget).get("address");
|
|
1770
|
+
typeof g == "string" && i(g);
|
|
1771
1771
|
},
|
|
1772
1772
|
class: "flex gap-2 p-2.5",
|
|
1773
1773
|
children: [c("div", {
|
|
@@ -1780,7 +1780,7 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1780
1780
|
autoFocus: !0,
|
|
1781
1781
|
placeholder: e.config.placeholder || a("address_search"),
|
|
1782
1782
|
defaultValue: s,
|
|
1783
|
-
class:
|
|
1783
|
+
class: Ge({
|
|
1784
1784
|
optional: !!e.config.optional,
|
|
1785
1785
|
className: "w-full rounded-full"
|
|
1786
1786
|
})
|
|
@@ -1813,11 +1813,11 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1813
1813
|
children: a("search")
|
|
1814
1814
|
})]
|
|
1815
1815
|
})]
|
|
1816
|
-
}), e.config.optional && c(
|
|
1816
|
+
}), e.config.optional && c(Le, {
|
|
1817
1817
|
class: "relative",
|
|
1818
1818
|
onClick: r
|
|
1819
1819
|
})]
|
|
1820
|
-
}), (t == null ? void 0 : t.status) === "failed" ? c(
|
|
1820
|
+
}), (t == null ? void 0 : t.status) === "failed" ? c(Xe, {
|
|
1821
1821
|
error: {
|
|
1822
1822
|
message: t.error
|
|
1823
1823
|
}
|
|
@@ -1868,7 +1868,7 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1868
1868
|
}, "")]
|
|
1869
1869
|
})]
|
|
1870
1870
|
});
|
|
1871
|
-
},
|
|
1871
|
+
}, Dt = ["line1", "line2", "line3", "city", "state", "postcode", "country"], fr = ({
|
|
1872
1872
|
addressFields: e,
|
|
1873
1873
|
onFieldChange: r,
|
|
1874
1874
|
onSubmitSuccess: t,
|
|
@@ -1876,7 +1876,7 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1876
1876
|
input: s
|
|
1877
1877
|
}) => {
|
|
1878
1878
|
const i = ye(null);
|
|
1879
|
-
|
|
1879
|
+
Me(() => {
|
|
1880
1880
|
if (i.current) {
|
|
1881
1881
|
const u = i.current.querySelector("input");
|
|
1882
1882
|
u && (u.focus(), u.select());
|
|
@@ -1884,18 +1884,19 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1884
1884
|
}, []);
|
|
1885
1885
|
const a = Object.keys(Kt), {
|
|
1886
1886
|
t: o
|
|
1887
|
-
} =
|
|
1887
|
+
} = te();
|
|
1888
1888
|
return c("form", {
|
|
1889
1889
|
class: "flex flex-col px-2 pt-2",
|
|
1890
1890
|
onSubmit: (u) => {
|
|
1891
|
-
|
|
1892
|
-
|
|
1891
|
+
u.preventDefault();
|
|
1892
|
+
const f = u.currentTarget, g = [...f.querySelectorAll("input")].filter((m) => m.value !== "" && !m.value.trim());
|
|
1893
|
+
for (const m of g) {
|
|
1893
1894
|
m.value = "";
|
|
1894
|
-
const
|
|
1895
|
-
|
|
1895
|
+
const _ = Dt.find((C) => s.config.keys[C] === m.name);
|
|
1896
|
+
_ && r(_, "");
|
|
1896
1897
|
}
|
|
1897
|
-
if (
|
|
1898
|
-
|
|
1898
|
+
if (g.length > 0 && !f.checkValidity()) {
|
|
1899
|
+
f.reportValidity();
|
|
1899
1900
|
return;
|
|
1900
1901
|
}
|
|
1901
1902
|
const y = new FormData(f), p = Object.fromEntries(y.entries());
|
|
@@ -1907,11 +1908,11 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1907
1908
|
children: [c("div", {
|
|
1908
1909
|
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]",
|
|
1909
1910
|
ref: i,
|
|
1910
|
-
children:
|
|
1911
|
-
const
|
|
1911
|
+
children: Dt.map((u, f) => {
|
|
1912
|
+
const g = `isdk_${u}`, y = s.config.keys[u];
|
|
1912
1913
|
return y ? c(ke, {
|
|
1913
1914
|
children: [c("label", {
|
|
1914
|
-
for:
|
|
1915
|
+
for: g,
|
|
1915
1916
|
class: "text-neutral-11 [&:has(+*>input:focus)]:text-neutral-12 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",
|
|
1916
1917
|
children: o(u)
|
|
1917
1918
|
}), c("div", {
|
|
@@ -1921,7 +1922,7 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1921
1922
|
children: [c("select", {
|
|
1922
1923
|
class: "text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 w-full flex-1 appearance-none rounded-lg border-solid bg-transparent bg-none px-3 py-1.5 text-base transition-colors focus:outline-none",
|
|
1923
1924
|
name: y,
|
|
1924
|
-
id:
|
|
1925
|
+
id: g,
|
|
1925
1926
|
defaultValue: e[u],
|
|
1926
1927
|
onChange: (p) => r(u, p.currentTarget.value),
|
|
1927
1928
|
required: !0,
|
|
@@ -1954,11 +1955,11 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1954
1955
|
autoFocus: f === 0 ? !0 : void 0,
|
|
1955
1956
|
class: "text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 flex-1 rounded-lg border-solid bg-transparent px-3 py-1.5 text-base transition-colors autofill:shadow-[inset_0_0_0_1000px_hsl(210_16.7%_97.6%)] focus:outline-none",
|
|
1956
1957
|
name: y,
|
|
1957
|
-
id:
|
|
1958
|
+
id: g,
|
|
1958
1959
|
defaultValue: e[u],
|
|
1959
1960
|
onInput: (p) => r(u, p.currentTarget.value),
|
|
1960
1961
|
required: u === "line2" ? s.config.line2Required === !0 : u !== "line3"
|
|
1961
|
-
}), f ===
|
|
1962
|
+
}), f === Dt.length - 1 ? c("hr", {
|
|
1962
1963
|
class: "m-0 w-full border-b border-b-transparent"
|
|
1963
1964
|
}) : c("hr", {
|
|
1964
1965
|
class: "border-b-neutral-5 m-0 w-full border-b border-solid"
|
|
@@ -1979,7 +1980,7 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1979
1980
|
var r;
|
|
1980
1981
|
(r = e.current) == null || r.focus();
|
|
1981
1982
|
}, []), e;
|
|
1982
|
-
}, cn = ["true", "false"],
|
|
1983
|
+
}, cn = ["true", "false"], ma = /* @__PURE__ */ on(cn), ya = "answer", un = "flex items-center flex-wrap gap-2 p-2.5", dn = "min-w-0 max-w-full flex-auto", fn = Hr(({
|
|
1983
1984
|
label: e,
|
|
1984
1985
|
...r
|
|
1985
1986
|
}, t) => c("button", {
|
|
@@ -1990,7 +1991,7 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1990
1991
|
class: "text-center text-base",
|
|
1991
1992
|
children: e
|
|
1992
1993
|
})
|
|
1993
|
-
})),
|
|
1994
|
+
})), ba = ({
|
|
1994
1995
|
input: e,
|
|
1995
1996
|
onSubmitSuccess: r
|
|
1996
1997
|
}) => {
|
|
@@ -2000,7 +2001,7 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2000
2001
|
class: "",
|
|
2001
2002
|
onSubmit: (n) => {
|
|
2002
2003
|
n.preventDefault();
|
|
2003
|
-
const s =
|
|
2004
|
+
const s = Hn(n).value, i = sa(ma, s);
|
|
2004
2005
|
r({
|
|
2005
2006
|
type: "boolean",
|
|
2006
2007
|
value: i === "true"
|
|
@@ -2013,40 +2014,40 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2013
2014
|
children: c(fn, {
|
|
2014
2015
|
ref: s === 0 ? t : null,
|
|
2015
2016
|
type: "submit",
|
|
2016
|
-
name:
|
|
2017
|
+
name: ya,
|
|
2017
2018
|
value: n,
|
|
2018
2019
|
label: e.config.labels[n]
|
|
2019
2020
|
}, n)
|
|
2020
2021
|
}))
|
|
2021
2022
|
}), e.config.optional && c("div", {
|
|
2022
2023
|
class: "px-2 pb-2",
|
|
2023
|
-
children: c(
|
|
2024
|
+
children: c(Le, {
|
|
2024
2025
|
class: "relative w-full",
|
|
2025
2026
|
type: "button",
|
|
2026
2027
|
onClick: () => r(null)
|
|
2027
2028
|
})
|
|
2028
2029
|
})]
|
|
2029
2030
|
});
|
|
2030
|
-
},
|
|
2031
|
+
}, ga = (e) => new Promise((r, t) => {
|
|
2031
2032
|
const n = new FileReader();
|
|
2032
2033
|
n.onload = () => {
|
|
2033
2034
|
if (typeof n.result != "string" || !n.result)
|
|
2034
2035
|
return t(new Error("Invalid file"));
|
|
2035
2036
|
r(n.result);
|
|
2036
2037
|
}, n.onerror = t, n.readAsDataURL(e);
|
|
2037
|
-
}), hr = (e) => e.reduce((r, t) => r + t.sizeKb, 0),
|
|
2038
|
+
}), hr = (e) => e.reduce((r, t) => r + t.sizeKb, 0), va = Ze("file"), pr = 3, _t = (e) => {
|
|
2038
2039
|
const r = e.lastIndexOf(".");
|
|
2039
2040
|
return r === -1 ? [e, ""] : [e.slice(0, r), e.slice(r)];
|
|
2040
|
-
},
|
|
2041
|
+
}, xa = ({
|
|
2041
2042
|
file: e,
|
|
2042
2043
|
class: r,
|
|
2043
2044
|
...t
|
|
2044
2045
|
}) => {
|
|
2045
2046
|
const {
|
|
2046
2047
|
t: n
|
|
2047
|
-
} =
|
|
2048
|
+
} = te(), [s, i] = _t(e.name);
|
|
2048
2049
|
return c("div", {
|
|
2049
|
-
class:
|
|
2050
|
+
class: Je("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline", r),
|
|
2050
2051
|
...t,
|
|
2051
2052
|
children: [c("p", {
|
|
2052
2053
|
class: "text-accent-12 flex flex-grow overflow-hidden",
|
|
@@ -2064,39 +2065,39 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2064
2065
|
children: [c("span", {
|
|
2065
2066
|
class: "sr-only",
|
|
2066
2067
|
children: [n("file_size"), ": "]
|
|
2067
|
-
}),
|
|
2068
|
+
}), He(e.sizeKb)]
|
|
2068
2069
|
})]
|
|
2069
2070
|
});
|
|
2070
2071
|
}, mr = ({
|
|
2071
2072
|
class: e,
|
|
2072
2073
|
...r
|
|
2073
2074
|
}) => c("li", {
|
|
2074
|
-
class:
|
|
2075
|
+
class: Je("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
|
|
2075
2076
|
...r
|
|
2076
|
-
}),
|
|
2077
|
+
}), wa = (e, r) => {
|
|
2077
2078
|
const [t, n] = _t(e);
|
|
2078
2079
|
return `${t.slice(0, r)}${n}`;
|
|
2079
2080
|
}, yr = (e) => ({
|
|
2080
|
-
name:
|
|
2081
|
+
name: wa(e.name, 42),
|
|
2081
2082
|
sizeKb: e.size / 1e3
|
|
2082
|
-
}),
|
|
2083
|
-
const n = _t(r.name)[1].toLowerCase(), s = [...t.map((a) => a.toLowerCase()), ...
|
|
2083
|
+
}), _a = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], ka = (e, r, t) => {
|
|
2084
|
+
const n = _t(r.name)[1].toLowerCase(), s = [...t.map((a) => a.toLowerCase()), ..._a], i = n === "" ? "none" : s.includes(n) ? n : "other";
|
|
2084
2085
|
return `chatbot-file-refused:${e}:${i}`;
|
|
2085
|
-
},
|
|
2086
|
+
}, Ca = ({
|
|
2086
2087
|
input: e,
|
|
2087
2088
|
onSubmitSuccess: r,
|
|
2088
2089
|
analytics: t
|
|
2089
2090
|
}) => {
|
|
2090
|
-
var
|
|
2091
|
-
const n = (
|
|
2091
|
+
var k;
|
|
2092
|
+
const n = (k = P.current$.value.flow) == null ? void 0 : k.data.submissions[e.key], [s, i] = we(va(n) && n.value.length ? {
|
|
2092
2093
|
status: "ready",
|
|
2093
2094
|
files: n.value
|
|
2094
2095
|
} : {
|
|
2095
2096
|
status: "empty"
|
|
2096
|
-
}), a = ye(0), o = s.status === "ready" ? s.files : [], u = s.status === "ready" || s.status === "pending" ? s.files : [], f = s.status === "error" ? s.error : void 0,
|
|
2097
|
+
}), a = ye(0), o = s.status === "ready" ? s.files : [], u = s.status === "ready" || s.status === "pending" ? s.files : [], f = s.status === "error" ? s.error : void 0, g = u.length - pr, y = hr(u), p = Gt(), {
|
|
2097
2098
|
t: m
|
|
2098
|
-
} =
|
|
2099
|
-
if (!
|
|
2099
|
+
} = te(), _ = (A) => {
|
|
2100
|
+
if (!A.length)
|
|
2100
2101
|
return {
|
|
2101
2102
|
reason: "required",
|
|
2102
2103
|
error: {
|
|
@@ -2104,10 +2105,10 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2104
2105
|
message: m("validation_file")
|
|
2105
2106
|
}
|
|
2106
2107
|
};
|
|
2107
|
-
if (!ar(
|
|
2108
|
+
if (!ar(A, e.config.extensions))
|
|
2108
2109
|
return {
|
|
2109
2110
|
reason: "type",
|
|
2110
|
-
file:
|
|
2111
|
+
file: A.find((b) => !ar([b], e.config.extensions)),
|
|
2111
2112
|
error: {
|
|
2112
2113
|
type: "validate",
|
|
2113
2114
|
message: m("validation_file_ext", {
|
|
@@ -2115,26 +2116,26 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2115
2116
|
})
|
|
2116
2117
|
}
|
|
2117
2118
|
};
|
|
2118
|
-
if (
|
|
2119
|
+
if (A.some((b) => b.sizeKb === 0))
|
|
2119
2120
|
return {
|
|
2120
2121
|
reason: "empty",
|
|
2121
|
-
file:
|
|
2122
|
+
file: A.find((b) => b.sizeKb === 0),
|
|
2122
2123
|
error: {
|
|
2123
2124
|
type: "validate",
|
|
2124
2125
|
message: m("validation_file_empty")
|
|
2125
2126
|
}
|
|
2126
2127
|
};
|
|
2127
|
-
if (e.config.fileSizeLimitKib && hr(
|
|
2128
|
+
if (e.config.fileSizeLimitKib && hr(A) > e.config.fileSizeLimitKib)
|
|
2128
2129
|
return {
|
|
2129
2130
|
reason: "size",
|
|
2130
2131
|
error: {
|
|
2131
2132
|
type: "max",
|
|
2132
2133
|
message: m("validation_file_size", {
|
|
2133
|
-
size:
|
|
2134
|
+
size: He(e.config.fileSizeLimitKib)
|
|
2134
2135
|
})
|
|
2135
2136
|
}
|
|
2136
2137
|
};
|
|
2137
|
-
if (!e.config.allowMultiple &&
|
|
2138
|
+
if (!e.config.allowMultiple && A.length > 1)
|
|
2138
2139
|
return {
|
|
2139
2140
|
reason: "count",
|
|
2140
2141
|
error: {
|
|
@@ -2144,25 +2145,25 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2144
2145
|
})
|
|
2145
2146
|
}
|
|
2146
2147
|
};
|
|
2147
|
-
},
|
|
2148
|
-
var
|
|
2148
|
+
}, C = (A, b) => {
|
|
2149
|
+
var V, F;
|
|
2149
2150
|
return t.log({
|
|
2150
2151
|
event: "INTERACTION",
|
|
2151
2152
|
properties: {
|
|
2152
|
-
tag:
|
|
2153
|
+
tag: ka(A, b, e.config.extensions)
|
|
2153
2154
|
},
|
|
2154
|
-
customProperties: (
|
|
2155
|
+
customProperties: (F = (V = P.current$.peek().flow) == null ? void 0 : V.analytics) == null ? void 0 : F.customProperties
|
|
2155
2156
|
});
|
|
2156
2157
|
};
|
|
2157
2158
|
return c("form", {
|
|
2158
2159
|
class: "flex flex-col gap-1 p-2.5",
|
|
2159
|
-
onSubmit: (
|
|
2160
|
-
if (
|
|
2160
|
+
onSubmit: (A) => {
|
|
2161
|
+
if (A.preventDefault(), s.status === "pending" || s.status === "error")
|
|
2161
2162
|
return;
|
|
2162
|
-
const
|
|
2163
|
-
|
|
2163
|
+
const b = _(o);
|
|
2164
|
+
b ? i({
|
|
2164
2165
|
status: "error",
|
|
2165
|
-
error:
|
|
2166
|
+
error: b.error
|
|
2166
2167
|
}) : r({
|
|
2167
2168
|
type: "file",
|
|
2168
2169
|
value: o
|
|
@@ -2176,20 +2177,20 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2176
2177
|
class: "border-neutral-8 bg-neutral-2 flex h-48 w-full cursor-pointer flex-col items-center justify-center overflow-hidden rounded-2xl border border-dashed p-4",
|
|
2177
2178
|
children: [u.length > 0 ? c("ul", {
|
|
2178
2179
|
class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
|
|
2179
|
-
children: [u.slice(0, pr).map((
|
|
2180
|
-
const [
|
|
2180
|
+
children: [u.slice(0, pr).map((A) => {
|
|
2181
|
+
const [b, V] = _t(A.name);
|
|
2181
2182
|
return c(mr, {
|
|
2182
2183
|
class: "flex overflow-hidden",
|
|
2183
2184
|
children: [c("span", {
|
|
2184
2185
|
class: "block truncate",
|
|
2185
|
-
children:
|
|
2186
|
+
children: b
|
|
2186
2187
|
}), c("span", {
|
|
2187
|
-
children:
|
|
2188
|
+
children: V
|
|
2188
2189
|
})]
|
|
2189
2190
|
});
|
|
2190
|
-
}),
|
|
2191
|
+
}), g > 0 ? c(mr, {
|
|
2191
2192
|
children: m("file_more", {
|
|
2192
|
-
count:
|
|
2193
|
+
count: g
|
|
2193
2194
|
})
|
|
2194
2195
|
}) : null]
|
|
2195
2196
|
}) : c("div", {
|
|
@@ -2217,7 +2218,7 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2217
2218
|
}), e.config.fileSizeLimitKib ? c("p", {
|
|
2218
2219
|
class: "text-neutral-11 text-xs",
|
|
2219
2220
|
children: ["(", m("file_max_size", {
|
|
2220
|
-
size:
|
|
2221
|
+
size: He(e.config.fileSizeLimitKib)
|
|
2221
2222
|
}), ")"]
|
|
2222
2223
|
}) : null]
|
|
2223
2224
|
}), c("aside", {
|
|
@@ -2229,15 +2230,15 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2229
2230
|
}), c("ul", {
|
|
2230
2231
|
"aria-describedby": "accepted-filetypes",
|
|
2231
2232
|
class: "flex flex-wrap justify-center gap-2",
|
|
2232
|
-
children: e.config.extensions.map((
|
|
2233
|
+
children: e.config.extensions.map((A) => c("li", {
|
|
2233
2234
|
class: "ring-lowest outline-neutral-6 text-neutral-11 bg-neutral-1 rounded-md px-1 py-0.5 text-[11px] uppercase tracking-wide outline outline-1 ring-2",
|
|
2234
|
-
children:
|
|
2235
|
+
children: A.replace(".", "")
|
|
2235
2236
|
}))
|
|
2236
2237
|
})]
|
|
2237
2238
|
})]
|
|
2238
2239
|
}), c("p", {
|
|
2239
2240
|
role: "status",
|
|
2240
|
-
class:
|
|
2241
|
+
class: Je("text-neutral-11 flex items-center gap-1.5 text-xs", u.length === 0 && "sr-only"),
|
|
2241
2242
|
children: s.status === "pending" ? c(ke, {
|
|
2242
2243
|
children: [c(qt, {
|
|
2243
2244
|
"aria-hidden": "true",
|
|
@@ -2247,8 +2248,8 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2247
2248
|
})]
|
|
2248
2249
|
}) : s.status === "ready" ? c(ke, {
|
|
2249
2250
|
children: [o.length > 1 ? m("file_total_size", {
|
|
2250
|
-
size:
|
|
2251
|
-
}) :
|
|
2251
|
+
size: He(y)
|
|
2252
|
+
}) : He(y), c("span", {
|
|
2252
2253
|
class: "sr-only",
|
|
2253
2254
|
children: [". ", m("file_ready", {
|
|
2254
2255
|
count: o.length
|
|
@@ -2260,47 +2261,47 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2260
2261
|
"aria-label": m("upload_file", {
|
|
2261
2262
|
count: e.config.allowMultiple ? 2 : 1
|
|
2262
2263
|
}),
|
|
2263
|
-
onInput: async (
|
|
2264
|
-
|
|
2265
|
-
const
|
|
2266
|
-
|
|
2267
|
-
const [
|
|
2268
|
-
if (!
|
|
2264
|
+
onInput: async (A) => {
|
|
2265
|
+
Be(A.target instanceof HTMLInputElement);
|
|
2266
|
+
const b = A.target.files ? Array.from(A.target.files) : [];
|
|
2267
|
+
A.target.value = "";
|
|
2268
|
+
const [V] = b;
|
|
2269
|
+
if (!V)
|
|
2269
2270
|
return;
|
|
2270
|
-
const
|
|
2271
|
-
if (
|
|
2272
|
-
return
|
|
2271
|
+
const F = ++a.current, R = s.status === "ready", O = b.map(yr), q = _(O);
|
|
2272
|
+
if (q)
|
|
2273
|
+
return C(q.reason, q.file ?? V), i({
|
|
2273
2274
|
status: "error",
|
|
2274
|
-
error:
|
|
2275
|
+
error: q.error
|
|
2275
2276
|
});
|
|
2276
2277
|
i({
|
|
2277
2278
|
status: "pending",
|
|
2278
|
-
files:
|
|
2279
|
+
files: O
|
|
2279
2280
|
});
|
|
2280
|
-
let
|
|
2281
|
+
let T;
|
|
2281
2282
|
try {
|
|
2282
|
-
const
|
|
2283
|
+
const z = await Promise.all(b.map(async (D) => {
|
|
2283
2284
|
try {
|
|
2284
2285
|
return {
|
|
2285
|
-
...yr(
|
|
2286
|
-
data: await
|
|
2286
|
+
...yr(D),
|
|
2287
|
+
data: await ga(D)
|
|
2287
2288
|
};
|
|
2288
|
-
} catch (
|
|
2289
|
-
throw
|
|
2289
|
+
} catch (U) {
|
|
2290
|
+
throw T ?? (T = D), U;
|
|
2290
2291
|
}
|
|
2291
2292
|
}));
|
|
2292
|
-
a.current ===
|
|
2293
|
+
a.current === F && i({
|
|
2293
2294
|
status: "ready",
|
|
2294
|
-
files:
|
|
2295
|
+
files: z
|
|
2295
2296
|
});
|
|
2296
2297
|
} catch {
|
|
2297
|
-
if (a.current !==
|
|
2298
|
+
if (a.current !== F)
|
|
2298
2299
|
return;
|
|
2299
|
-
|
|
2300
|
+
C("unreadable", T ?? V), i({
|
|
2300
2301
|
status: "error",
|
|
2301
2302
|
error: {
|
|
2302
2303
|
type: "invalid",
|
|
2303
|
-
message: m(
|
|
2304
|
+
message: m(R ? "file_read_error_replacement" : "file_read_error")
|
|
2304
2305
|
}
|
|
2305
2306
|
});
|
|
2306
2307
|
}
|
|
@@ -2314,40 +2315,40 @@ const Je = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2314
2315
|
class: "flex h-full flex-col items-center gap-2",
|
|
2315
2316
|
children: [c($e, {
|
|
2316
2317
|
disabled: o.length === 0
|
|
2317
|
-
}), e.config.optional && c(
|
|
2318
|
+
}), e.config.optional && c(Le, {
|
|
2318
2319
|
class: "relative",
|
|
2319
2320
|
onClick: () => r(null)
|
|
2320
2321
|
})]
|
|
2321
2322
|
})]
|
|
2322
|
-
}), c(
|
|
2323
|
+
}), c(Xe, {
|
|
2323
2324
|
error: f
|
|
2324
2325
|
})]
|
|
2325
2326
|
});
|
|
2326
2327
|
};
|
|
2327
|
-
var
|
|
2328
|
+
var ft = (e) => e.type === "checkbox", Oe = (e) => e instanceof Date, ae = (e) => e == null;
|
|
2328
2329
|
const hn = (e) => typeof e == "object";
|
|
2329
|
-
var
|
|
2330
|
+
var X = (e) => !ae(e) && !Array.isArray(e) && hn(e) && !Oe(e), Sa = (e) => X(e) && e.target ? ft(e.target) ? e.target.checked : e.target.value : e, Aa = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Ia = (e, r) => e.has(Aa(r)), Ea = (e) => {
|
|
2330
2331
|
const r = e.constructor && e.constructor.prototype;
|
|
2331
|
-
return
|
|
2332
|
+
return X(r) && r.hasOwnProperty("isPrototypeOf");
|
|
2332
2333
|
}, Jt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
2333
|
-
function
|
|
2334
|
+
function Q(e) {
|
|
2334
2335
|
if (e instanceof Date)
|
|
2335
2336
|
return new Date(e);
|
|
2336
2337
|
const r = typeof FileList < "u" && e instanceof FileList;
|
|
2337
2338
|
if (Jt && (e instanceof Blob || r))
|
|
2338
2339
|
return e;
|
|
2339
2340
|
const t = Array.isArray(e);
|
|
2340
|
-
if (!t && !(
|
|
2341
|
+
if (!t && !(X(e) && Ea(e)))
|
|
2341
2342
|
return e;
|
|
2342
2343
|
const n = t ? [] : Object.create(Object.getPrototypeOf(e));
|
|
2343
2344
|
for (const s in e)
|
|
2344
|
-
Object.prototype.hasOwnProperty.call(e, s) && (n[s] =
|
|
2345
|
+
Object.prototype.hasOwnProperty.call(e, s) && (n[s] = Q(e[s]));
|
|
2345
2346
|
return n;
|
|
2346
2347
|
}
|
|
2347
2348
|
var kt = (e) => /^\w*$/.test(e), J = (e) => e === void 0, Zt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Xt = (e) => Zt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, r, t) => {
|
|
2348
|
-
if (!r || !
|
|
2349
|
+
if (!r || !X(e))
|
|
2349
2350
|
return t;
|
|
2350
|
-
const n = (kt(r) ? [r] : Xt(r)).reduce((s, i) =>
|
|
2351
|
+
const n = (kt(r) ? [r] : Xt(r)).reduce((s, i) => ae(s) ? s : s[i], e);
|
|
2351
2352
|
return J(n) || n === e ? J(e[r]) ? t : e[r] : n;
|
|
2352
2353
|
}, me = (e) => typeof e == "boolean", de = (e) => typeof e == "function", H = (e, r, t) => {
|
|
2353
2354
|
let n = -1;
|
|
@@ -2357,7 +2358,7 @@ var kt = (e) => /^\w*$/.test(e), J = (e) => e === void 0, Zt = (e) => Array.isAr
|
|
|
2357
2358
|
let u = t;
|
|
2358
2359
|
if (n !== a) {
|
|
2359
2360
|
const f = e[o];
|
|
2360
|
-
u =
|
|
2361
|
+
u = X(f) || Array.isArray(f) ? f : isNaN(+s[n + 1]) ? {} : [];
|
|
2361
2362
|
}
|
|
2362
2363
|
if (o === "__proto__" || o === "constructor" || o === "prototype")
|
|
2363
2364
|
return;
|
|
@@ -2382,9 +2383,9 @@ const br = {
|
|
|
2382
2383
|
pattern: "pattern",
|
|
2383
2384
|
required: "required",
|
|
2384
2385
|
validate: "validate"
|
|
2385
|
-
},
|
|
2386
|
-
|
|
2387
|
-
var
|
|
2386
|
+
}, Fa = ne.createContext(null);
|
|
2387
|
+
Fa.displayName = "HookFormControlContext";
|
|
2388
|
+
var Va = (e, r, t, n = !0) => {
|
|
2388
2389
|
const s = {
|
|
2389
2390
|
defaultValues: r._defaultValues
|
|
2390
2391
|
};
|
|
@@ -2397,12 +2398,12 @@ var Ea = (e, r, t, n = !0) => {
|
|
|
2397
2398
|
});
|
|
2398
2399
|
return s;
|
|
2399
2400
|
};
|
|
2400
|
-
const
|
|
2401
|
-
var
|
|
2402
|
-
function
|
|
2403
|
-
if (
|
|
2401
|
+
const Ma = typeof window < "u" ? ne.useLayoutEffect : ne.useEffect;
|
|
2402
|
+
var ce = (e) => typeof e == "string", La = (e, r, t, n, s) => ce(e) ? (n && r.watch.add(e), S(t, e, s)) : Array.isArray(e) ? e.map((i) => (n && r.watch.add(i), S(t, i))) : (n && (r.watchAll = !0), t), jt = (e) => ae(e) || !hn(e);
|
|
2403
|
+
function Fe(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
2404
|
+
if (jt(e) || jt(r))
|
|
2404
2405
|
return Object.is(e, r);
|
|
2405
|
-
if (
|
|
2406
|
+
if (Oe(e) && Oe(r))
|
|
2406
2407
|
return Object.is(e.getTime(), r.getTime());
|
|
2407
2408
|
const n = Object.keys(e), s = Object.keys(r);
|
|
2408
2409
|
if (n.length !== s.length)
|
|
@@ -2416,21 +2417,21 @@ function Le(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
|
2416
2417
|
return !1;
|
|
2417
2418
|
if (i !== "ref") {
|
|
2418
2419
|
const o = r[i];
|
|
2419
|
-
if (
|
|
2420
|
+
if (Oe(a) && Oe(o) || X(a) && X(o) || Array.isArray(a) && Array.isArray(o) ? !Fe(a, o, t) : !Object.is(a, o))
|
|
2420
2421
|
return !1;
|
|
2421
2422
|
}
|
|
2422
2423
|
}
|
|
2423
2424
|
return !0;
|
|
2424
2425
|
}
|
|
2425
|
-
const
|
|
2426
|
-
|
|
2426
|
+
const Ra = ne.createContext(null);
|
|
2427
|
+
Ra.displayName = "HookFormContext";
|
|
2427
2428
|
var pn = (e, r, t, n, s) => r ? {
|
|
2428
2429
|
...t[e],
|
|
2429
2430
|
types: {
|
|
2430
2431
|
...t[e] && t[e].types ? t[e].types : {},
|
|
2431
2432
|
[n]: s || !0
|
|
2432
2433
|
}
|
|
2433
|
-
} : {},
|
|
2434
|
+
} : {}, ut = (e) => Array.isArray(e) ? e : [e], gr = () => {
|
|
2434
2435
|
let e = [];
|
|
2435
2436
|
return {
|
|
2436
2437
|
get observers() {
|
|
@@ -2455,45 +2456,45 @@ function mn(e, r) {
|
|
|
2455
2456
|
for (const n in e)
|
|
2456
2457
|
if (e.hasOwnProperty(n)) {
|
|
2457
2458
|
const s = e[n], i = r[n];
|
|
2458
|
-
if (s &&
|
|
2459
|
+
if (s && X(s) && i) {
|
|
2459
2460
|
const a = mn(s, i);
|
|
2460
|
-
|
|
2461
|
+
X(a) && (t[n] = a);
|
|
2461
2462
|
} else
|
|
2462
2463
|
e[n] && (t[n] = i);
|
|
2463
2464
|
}
|
|
2464
2465
|
return t;
|
|
2465
2466
|
}
|
|
2466
|
-
var
|
|
2467
|
+
var se = (e) => X(e) && !Object.keys(e).length, Yt = (e) => e.type === "file", bt = (e) => {
|
|
2467
2468
|
if (!Jt)
|
|
2468
2469
|
return !1;
|
|
2469
2470
|
const r = e ? e.ownerDocument : 0;
|
|
2470
2471
|
return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
|
|
2471
|
-
}, yn = (e) => e.type === "select-multiple", Qt = (e) => e.type === "radio",
|
|
2472
|
-
function
|
|
2472
|
+
}, yn = (e) => e.type === "select-multiple", Qt = (e) => e.type === "radio", Da = (e) => Qt(e) || ft(e), Tt = (e) => bt(e) && e.isConnected;
|
|
2473
|
+
function Ta(e, r) {
|
|
2473
2474
|
const t = r.slice(0, -1).length;
|
|
2474
2475
|
let n = 0;
|
|
2475
2476
|
for (; n < t; )
|
|
2476
2477
|
e = J(e) ? n++ : e[r[n++]];
|
|
2477
2478
|
return e;
|
|
2478
2479
|
}
|
|
2479
|
-
function
|
|
2480
|
+
function Na(e) {
|
|
2480
2481
|
for (const r in e)
|
|
2481
2482
|
if (e.hasOwnProperty(r) && !J(e[r]))
|
|
2482
2483
|
return !1;
|
|
2483
2484
|
return !0;
|
|
2484
2485
|
}
|
|
2485
|
-
function
|
|
2486
|
-
const t = Array.isArray(r) ? r : kt(r) ? [r] : Xt(r), n = t.length === 1 ? e :
|
|
2487
|
-
return n && delete n[i], s !== 0 && (
|
|
2486
|
+
function Z(e, r) {
|
|
2487
|
+
const t = Array.isArray(r) ? r : kt(r) ? [r] : Xt(r), n = t.length === 1 ? e : Ta(e, t), s = t.length - 1, i = t[s];
|
|
2488
|
+
return n && delete n[i], s !== 0 && (X(n) && se(n) || Array.isArray(n) && Na(n)) && Z(e, t.slice(0, -1)), e;
|
|
2488
2489
|
}
|
|
2489
|
-
var
|
|
2490
|
+
var Oa = (e) => {
|
|
2490
2491
|
for (const r in e)
|
|
2491
2492
|
if (de(e[r]))
|
|
2492
2493
|
return !0;
|
|
2493
2494
|
return !1;
|
|
2494
2495
|
};
|
|
2495
2496
|
function bn(e) {
|
|
2496
|
-
return Array.isArray(e) ||
|
|
2497
|
+
return Array.isArray(e) || X(e) && !Oa(e);
|
|
2497
2498
|
}
|
|
2498
2499
|
function Pt(e, r = {}) {
|
|
2499
2500
|
for (const t in e) {
|
|
@@ -2502,15 +2503,15 @@ function Pt(e, r = {}) {
|
|
|
2502
2503
|
}
|
|
2503
2504
|
return r;
|
|
2504
2505
|
}
|
|
2505
|
-
function
|
|
2506
|
+
function Ue(e, r, t) {
|
|
2506
2507
|
t || (t = Pt(r));
|
|
2507
2508
|
for (const n in e) {
|
|
2508
2509
|
const s = e[n];
|
|
2509
2510
|
if (bn(s))
|
|
2510
|
-
J(r) ||
|
|
2511
|
+
J(r) || jt(t[n]) ? t[n] = Pt(s, Array.isArray(s) ? [] : {}) : Ue(s, ae(r) ? {} : r[n], t[n]);
|
|
2511
2512
|
else {
|
|
2512
2513
|
const i = r[n];
|
|
2513
|
-
t[n] = !
|
|
2514
|
+
t[n] = !Fe(s, i);
|
|
2514
2515
|
}
|
|
2515
2516
|
}
|
|
2516
2517
|
return t;
|
|
@@ -2531,7 +2532,7 @@ var gn = (e) => {
|
|
|
2531
2532
|
) : vr;
|
|
2532
2533
|
}
|
|
2533
2534
|
return vr;
|
|
2534
|
-
}, vn = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: n }) => J(e) ? e : r ? e === "" ? NaN : e && +e : t &&
|
|
2535
|
+
}, vn = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: n }) => J(e) ? e : r ? e === "" ? NaN : e && +e : t && ce(e) ? new Date(e) : n ? n(e) : e;
|
|
2535
2536
|
const wr = {
|
|
2536
2537
|
isValid: !1,
|
|
2537
2538
|
value: null
|
|
@@ -2542,9 +2543,9 @@ var xn = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disab
|
|
|
2542
2543
|
} : r, wr) : wr;
|
|
2543
2544
|
function _r(e) {
|
|
2544
2545
|
const r = e.ref;
|
|
2545
|
-
return Yt(r) ? r.files : Qt(r) ? xn(e.refs).value : yn(r) ? [...r.selectedOptions].map(({ value: t }) => t) :
|
|
2546
|
+
return Yt(r) ? r.files : Qt(r) ? xn(e.refs).value : yn(r) ? [...r.selectedOptions].map(({ value: t }) => t) : ft(r) ? gn(e.refs).value : vn(J(r.value) ? e.ref.value : r.value, e);
|
|
2546
2547
|
}
|
|
2547
|
-
var
|
|
2548
|
+
var Ba = (e, r, t, n) => {
|
|
2548
2549
|
const s = {};
|
|
2549
2550
|
for (const i of e) {
|
|
2550
2551
|
const a = S(r, i);
|
|
@@ -2556,7 +2557,7 @@ var Ta = (e, r, t, n) => {
|
|
|
2556
2557
|
fields: s,
|
|
2557
2558
|
shouldUseNativeValidation: n
|
|
2558
2559
|
};
|
|
2559
|
-
}, gt = (e) => e instanceof RegExp,
|
|
2560
|
+
}, gt = (e) => e instanceof RegExp, it = (e) => J(e) ? e : gt(e) ? e.source : X(e) ? gt(e.value) ? e.value.source : e.value : e, kr = (e) => ({
|
|
2560
2561
|
isOnSubmit: !e || e === fe.onSubmit,
|
|
2561
2562
|
isOnBlur: e === fe.onBlur,
|
|
2562
2563
|
isOnChange: e === fe.onChange,
|
|
@@ -2564,8 +2565,8 @@ var Ta = (e, r, t, n) => {
|
|
|
2564
2565
|
isOnTouch: e === fe.onTouched
|
|
2565
2566
|
});
|
|
2566
2567
|
const Cr = "AsyncFunction";
|
|
2567
|
-
var
|
|
2568
|
-
const
|
|
2568
|
+
var $a = (e) => !!e && !!e.validate && !!(de(e.validate) && e.validate.constructor.name === Cr || X(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === Cr)), ja = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), Sr = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
|
|
2569
|
+
const dt = (e, r, t, n) => {
|
|
2569
2570
|
for (const s of t || Object.keys(e)) {
|
|
2570
2571
|
const i = S(e, s);
|
|
2571
2572
|
if (i) {
|
|
@@ -2575,14 +2576,14 @@ const lt = (e, r, t, n) => {
|
|
|
2575
2576
|
return !0;
|
|
2576
2577
|
if (a.ref && r(a.ref, a.name) && !n)
|
|
2577
2578
|
return !0;
|
|
2578
|
-
if (
|
|
2579
|
+
if (dt(o, r))
|
|
2579
2580
|
break;
|
|
2580
|
-
} else if (
|
|
2581
|
+
} else if (X(o) && dt(o, r))
|
|
2581
2582
|
break;
|
|
2582
2583
|
}
|
|
2583
2584
|
}
|
|
2584
2585
|
};
|
|
2585
|
-
function
|
|
2586
|
+
function Ar(e, r, t) {
|
|
2586
2587
|
const n = S(e, t);
|
|
2587
2588
|
if (n || kt(t))
|
|
2588
2589
|
return {
|
|
@@ -2610,112 +2611,112 @@ function Ir(e, r, t) {
|
|
|
2610
2611
|
name: t
|
|
2611
2612
|
};
|
|
2612
2613
|
}
|
|
2613
|
-
var
|
|
2614
|
+
var Pa = (e, r, t, n) => {
|
|
2614
2615
|
t(e);
|
|
2615
2616
|
const { name: s, ...i } = e;
|
|
2616
|
-
return
|
|
2617
|
-
},
|
|
2618
|
-
const n =
|
|
2617
|
+
return se(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((a) => r[a] === (!n || fe.all));
|
|
2618
|
+
}, qa = (e, r, t) => !e || !r || e === r || ut(e).some((n) => n && (t ? n === r : n.startsWith(r) || r.startsWith(n))), Ua = (e, r, t, n, s) => s.isOnAll ? !1 : !t && s.isOnTouch ? !(r || e) : (t ? n.isOnBlur : s.isOnBlur) ? !e : (t ? n.isOnChange : s.isOnChange) ? e : !0, Ha = (e, r) => !Zt(S(e, r)).length && Z(e, r), za = (e, r, t) => {
|
|
2619
|
+
const n = ut(S(e, t));
|
|
2619
2620
|
return H(n, "root", r[t]), H(e, t, n), e;
|
|
2620
2621
|
};
|
|
2621
|
-
function
|
|
2622
|
-
if (
|
|
2622
|
+
function Ir(e, r, t = "validate") {
|
|
2623
|
+
if (ce(e) || Array.isArray(e) && e.every(ce) || me(e) && !e)
|
|
2623
2624
|
return {
|
|
2624
2625
|
type: t,
|
|
2625
|
-
message:
|
|
2626
|
+
message: ce(e) ? e : "",
|
|
2626
2627
|
ref: r
|
|
2627
2628
|
};
|
|
2628
2629
|
}
|
|
2629
|
-
var
|
|
2630
|
+
var qe = (e) => X(e) && !gt(e) ? e : {
|
|
2630
2631
|
value: e,
|
|
2631
2632
|
message: ""
|
|
2632
2633
|
}, Er = async (e, r, t, n, s, i) => {
|
|
2633
|
-
const { ref: a, refs: o, required: u, maxLength: f, minLength:
|
|
2634
|
-
if (!
|
|
2634
|
+
const { ref: a, refs: o, required: u, maxLength: f, minLength: g, min: y, max: p, pattern: m, validate: _, name: C, valueAsNumber: k, mount: A } = e._f, b = S(t, C);
|
|
2635
|
+
if (!A || r.has(C))
|
|
2635
2636
|
return {};
|
|
2636
|
-
const
|
|
2637
|
-
s &&
|
|
2638
|
-
},
|
|
2639
|
-
const
|
|
2640
|
-
|
|
2641
|
-
type:
|
|
2642
|
-
message:
|
|
2637
|
+
const V = o ? o[0] : a, F = (I) => {
|
|
2638
|
+
s && V.reportValidity && (V.setCustomValidity(me(I) ? "" : I || ""), V.reportValidity());
|
|
2639
|
+
}, R = {}, O = Qt(a), q = ft(a), T = O || q, z = (k || Yt(a)) && J(a.value) && J(b) || bt(a) && a.value === "" || b === "" || Array.isArray(b) && !b.length, D = pn.bind(null, C, n, R), U = (I, L, M, N = xe.maxLength, W = xe.minLength) => {
|
|
2640
|
+
const K = I ? L : M;
|
|
2641
|
+
R[C] = {
|
|
2642
|
+
type: I ? N : W,
|
|
2643
|
+
message: K,
|
|
2643
2644
|
ref: a,
|
|
2644
|
-
...
|
|
2645
|
+
...D(I ? N : W, K)
|
|
2645
2646
|
};
|
|
2646
2647
|
};
|
|
2647
|
-
if (i ? !Array.isArray(
|
|
2648
|
-
const { value:
|
|
2649
|
-
if (
|
|
2648
|
+
if (i ? !Array.isArray(b) || !b.length : u && (!T && (z || ae(b)) || me(b) && !b || q && !gn(o).isValid || O && !xn(o).isValid)) {
|
|
2649
|
+
const { value: I, message: L } = ce(u) ? { value: !!u, message: u } : qe(u);
|
|
2650
|
+
if (I && (R[C] = {
|
|
2650
2651
|
type: xe.required,
|
|
2651
|
-
message:
|
|
2652
|
-
ref:
|
|
2653
|
-
...
|
|
2652
|
+
message: L,
|
|
2653
|
+
ref: V,
|
|
2654
|
+
...D(xe.required, L)
|
|
2654
2655
|
}, !n))
|
|
2655
|
-
return
|
|
2656
|
+
return F(L), R;
|
|
2656
2657
|
}
|
|
2657
|
-
if (!
|
|
2658
|
-
let
|
|
2659
|
-
const
|
|
2660
|
-
if (!
|
|
2661
|
-
const
|
|
2662
|
-
|
|
2658
|
+
if (!z && (!ae(y) || !ae(p))) {
|
|
2659
|
+
let I, L;
|
|
2660
|
+
const M = qe(p), N = qe(y);
|
|
2661
|
+
if (!ae(b) && !isNaN(b)) {
|
|
2662
|
+
const W = a.valueAsNumber || b && +b;
|
|
2663
|
+
ae(M.value) || (I = W > M.value), ae(N.value) || (L = W < N.value);
|
|
2663
2664
|
} else {
|
|
2664
|
-
const
|
|
2665
|
-
|
|
2665
|
+
const W = a.valueAsDate || new Date(b), K = (G) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + G), ue = a.type == "time", oe = a.type == "week";
|
|
2666
|
+
ce(M.value) && b && (I = ue ? K(b) > K(M.value) : oe ? b > M.value : W > new Date(M.value)), ce(N.value) && b && (L = ue ? K(b) < K(N.value) : oe ? b < N.value : W < new Date(N.value));
|
|
2666
2667
|
}
|
|
2667
|
-
if ((
|
|
2668
|
-
return
|
|
2668
|
+
if ((I || L) && (U(!!I, M.message, N.message, xe.max, xe.min), !n))
|
|
2669
|
+
return F(R[C].message), R;
|
|
2669
2670
|
}
|
|
2670
|
-
if ((f ||
|
|
2671
|
-
const
|
|
2672
|
-
if ((
|
|
2673
|
-
return
|
|
2671
|
+
if ((f || g) && !z && (ce(b) || i && Array.isArray(b))) {
|
|
2672
|
+
const I = qe(f), L = qe(g), M = !ae(I.value) && b.length > +I.value, N = !ae(L.value) && b.length < +L.value;
|
|
2673
|
+
if ((M || N) && (U(M, I.message, L.message), !n))
|
|
2674
|
+
return F(R[C].message), R;
|
|
2674
2675
|
}
|
|
2675
|
-
if (m && !
|
|
2676
|
-
const { value:
|
|
2677
|
-
if (gt(
|
|
2676
|
+
if (m && !z && ce(b)) {
|
|
2677
|
+
const { value: I, message: L } = qe(m);
|
|
2678
|
+
if (gt(I) && !b.match(I) && (R[C] = {
|
|
2678
2679
|
type: xe.pattern,
|
|
2679
|
-
message:
|
|
2680
|
+
message: L,
|
|
2680
2681
|
ref: a,
|
|
2681
|
-
...
|
|
2682
|
+
...D(xe.pattern, L)
|
|
2682
2683
|
}, !n))
|
|
2683
|
-
return
|
|
2684
|
+
return F(L), R;
|
|
2684
2685
|
}
|
|
2685
|
-
if (
|
|
2686
|
-
if (de(
|
|
2687
|
-
const
|
|
2688
|
-
if (
|
|
2689
|
-
...
|
|
2690
|
-
...
|
|
2686
|
+
if (_) {
|
|
2687
|
+
if (de(_)) {
|
|
2688
|
+
const I = await _(b, t), L = Ir(I, V);
|
|
2689
|
+
if (L && (R[C] = {
|
|
2690
|
+
...L,
|
|
2691
|
+
...D(xe.validate, L.message)
|
|
2691
2692
|
}, !n))
|
|
2692
|
-
return
|
|
2693
|
-
} else if (
|
|
2694
|
-
let
|
|
2695
|
-
for (const
|
|
2696
|
-
if (!
|
|
2693
|
+
return F(L.message), R;
|
|
2694
|
+
} else if (X(_)) {
|
|
2695
|
+
let I = {};
|
|
2696
|
+
for (const L in _) {
|
|
2697
|
+
if (!se(I) && !n)
|
|
2697
2698
|
break;
|
|
2698
|
-
const
|
|
2699
|
-
|
|
2700
|
-
...
|
|
2701
|
-
...
|
|
2702
|
-
},
|
|
2699
|
+
const M = Ir(await _[L](b, t), V, L);
|
|
2700
|
+
M && (I = {
|
|
2701
|
+
...M,
|
|
2702
|
+
...D(L, M.message)
|
|
2703
|
+
}, F(M.message), n && (R[C] = I));
|
|
2703
2704
|
}
|
|
2704
|
-
if (!
|
|
2705
|
-
ref:
|
|
2706
|
-
...
|
|
2705
|
+
if (!se(I) && (R[C] = {
|
|
2706
|
+
ref: V,
|
|
2707
|
+
...I
|
|
2707
2708
|
}, !n))
|
|
2708
|
-
return
|
|
2709
|
+
return R;
|
|
2709
2710
|
}
|
|
2710
2711
|
}
|
|
2711
|
-
return
|
|
2712
|
+
return F(!0), R;
|
|
2712
2713
|
};
|
|
2713
2714
|
const Wa = {
|
|
2714
2715
|
mode: fe.onSubmit,
|
|
2715
2716
|
reValidateMode: fe.onChange,
|
|
2716
2717
|
shouldFocusError: !0
|
|
2717
2718
|
};
|
|
2718
|
-
function
|
|
2719
|
+
function Ka(e = {}) {
|
|
2719
2720
|
let r = {
|
|
2720
2721
|
...Wa,
|
|
2721
2722
|
...e
|
|
@@ -2734,7 +2735,7 @@ function za(e = {}) {
|
|
|
2734
2735
|
validatingFields: {},
|
|
2735
2736
|
errors: r.errors || {},
|
|
2736
2737
|
disabled: r.disabled || !1
|
|
2737
|
-
}, n = {}, s =
|
|
2738
|
+
}, n = {}, s = X(r.defaultValues) || X(r.values) ? Q(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : Q(s), a = {
|
|
2738
2739
|
action: !1,
|
|
2739
2740
|
mount: !1,
|
|
2740
2741
|
watch: !1,
|
|
@@ -2746,7 +2747,7 @@ function za(e = {}) {
|
|
|
2746
2747
|
array: /* @__PURE__ */ new Set(),
|
|
2747
2748
|
watch: /* @__PURE__ */ new Set()
|
|
2748
2749
|
}, u, f = 0;
|
|
2749
|
-
const
|
|
2750
|
+
const g = {
|
|
2750
2751
|
isDirty: !1,
|
|
2751
2752
|
dirtyFields: !1,
|
|
2752
2753
|
validatingFields: !1,
|
|
@@ -2755,7 +2756,7 @@ function za(e = {}) {
|
|
|
2755
2756
|
isValid: !1,
|
|
2756
2757
|
errors: !1
|
|
2757
2758
|
}, y = {
|
|
2758
|
-
...
|
|
2759
|
+
...g
|
|
2759
2760
|
};
|
|
2760
2761
|
let p = {
|
|
2761
2762
|
...y
|
|
@@ -2763,227 +2764,227 @@ function za(e = {}) {
|
|
|
2763
2764
|
const m = {
|
|
2764
2765
|
array: gr(),
|
|
2765
2766
|
state: gr()
|
|
2766
|
-
},
|
|
2767
|
+
}, _ = r.criteriaMode === fe.all, C = (l) => (d) => {
|
|
2767
2768
|
clearTimeout(f), f = setTimeout(l, d);
|
|
2768
|
-
},
|
|
2769
|
+
}, k = async (l) => {
|
|
2769
2770
|
if (!a.keepIsValid && !r.disabled && (y.isValid || p.isValid || l)) {
|
|
2770
2771
|
let d;
|
|
2771
|
-
r.resolver ? (d =
|
|
2772
|
+
r.resolver ? (d = se((await T()).errors), A()) : d = await D(n, !0), d !== t.isValid && m.state.next({
|
|
2772
2773
|
isValid: d
|
|
2773
2774
|
});
|
|
2774
2775
|
}
|
|
2775
|
-
},
|
|
2776
|
+
}, A = (l, d) => {
|
|
2776
2777
|
!r.disabled && (y.isValidating || y.validatingFields || p.isValidating || p.validatingFields) && ((l || Array.from(o.mount)).forEach((h) => {
|
|
2777
|
-
h && (d ? H(t.validatingFields, h, d) :
|
|
2778
|
+
h && (d ? H(t.validatingFields, h, d) : Z(t.validatingFields, h));
|
|
2778
2779
|
}), m.state.next({
|
|
2779
2780
|
validatingFields: t.validatingFields,
|
|
2780
|
-
isValidating: !
|
|
2781
|
+
isValidating: !se(t.validatingFields)
|
|
2781
2782
|
}));
|
|
2782
|
-
},
|
|
2783
|
-
if (
|
|
2784
|
-
if (a.action = !0,
|
|
2785
|
-
const
|
|
2786
|
-
|
|
2783
|
+
}, b = (l, d = [], h, w, x = !0, v = !0) => {
|
|
2784
|
+
if (w && h && !r.disabled) {
|
|
2785
|
+
if (a.action = !0, v && Array.isArray(S(n, l))) {
|
|
2786
|
+
const E = h(S(n, l), w.argA, w.argB);
|
|
2787
|
+
x && H(n, l, E);
|
|
2787
2788
|
}
|
|
2788
|
-
if (
|
|
2789
|
-
const
|
|
2790
|
-
|
|
2789
|
+
if (v && Array.isArray(S(t.errors, l))) {
|
|
2790
|
+
const E = h(S(t.errors, l), w.argA, w.argB);
|
|
2791
|
+
x && H(t.errors, l, E), Ha(t.errors, l);
|
|
2791
2792
|
}
|
|
2792
|
-
if ((y.touchedFields || p.touchedFields) &&
|
|
2793
|
-
const
|
|
2794
|
-
|
|
2793
|
+
if ((y.touchedFields || p.touchedFields) && v && Array.isArray(S(t.touchedFields, l))) {
|
|
2794
|
+
const E = h(S(t.touchedFields, l), w.argA, w.argB);
|
|
2795
|
+
x && H(t.touchedFields, l, E);
|
|
2795
2796
|
}
|
|
2796
|
-
(y.dirtyFields || p.dirtyFields) && (t.dirtyFields =
|
|
2797
|
+
(y.dirtyFields || p.dirtyFields) && (t.dirtyFields = Ue(s, i)), m.state.next({
|
|
2797
2798
|
name: l,
|
|
2798
|
-
isDirty:
|
|
2799
|
+
isDirty: I(l, d),
|
|
2799
2800
|
dirtyFields: t.dirtyFields,
|
|
2800
2801
|
errors: t.errors,
|
|
2801
2802
|
isValid: t.isValid
|
|
2802
2803
|
});
|
|
2803
2804
|
} else
|
|
2804
2805
|
H(i, l, d);
|
|
2805
|
-
},
|
|
2806
|
+
}, V = (l, d) => {
|
|
2806
2807
|
H(t.errors, l, d), m.state.next({
|
|
2807
2808
|
errors: t.errors
|
|
2808
2809
|
});
|
|
2809
|
-
},
|
|
2810
|
+
}, F = (l) => {
|
|
2810
2811
|
t.errors = l, m.state.next({
|
|
2811
2812
|
errors: t.errors,
|
|
2812
2813
|
isValid: !1
|
|
2813
2814
|
});
|
|
2814
|
-
},
|
|
2815
|
-
const
|
|
2816
|
-
if (
|
|
2817
|
-
const
|
|
2818
|
-
J(
|
|
2815
|
+
}, R = (l, d, h, w) => {
|
|
2816
|
+
const x = S(n, l);
|
|
2817
|
+
if (x) {
|
|
2818
|
+
const v = S(i, l, J(h) ? S(s, l) : h);
|
|
2819
|
+
J(v) || w && w.defaultChecked || d ? H(i, l, d ? v : _r(x._f)) : N(l, v), a.mount && !a.action && k();
|
|
2819
2820
|
}
|
|
2820
|
-
},
|
|
2821
|
-
let
|
|
2822
|
-
const
|
|
2821
|
+
}, O = (l, d, h, w, x) => {
|
|
2822
|
+
let v = !1, E = !1;
|
|
2823
|
+
const $ = {
|
|
2823
2824
|
name: l
|
|
2824
2825
|
};
|
|
2825
2826
|
if (!r.disabled) {
|
|
2826
|
-
if (!h ||
|
|
2827
|
-
(y.isDirty || p.isDirty) && (
|
|
2828
|
-
const
|
|
2829
|
-
|
|
2827
|
+
if (!h || w) {
|
|
2828
|
+
(y.isDirty || p.isDirty) && (E = t.isDirty, t.isDirty = $.isDirty = I(), v = E !== $.isDirty);
|
|
2829
|
+
const j = Fe(S(s, l), d);
|
|
2830
|
+
E = !!S(t.dirtyFields, l), j ? Z(t.dirtyFields, l) : H(t.dirtyFields, l, !0), $.dirtyFields = t.dirtyFields, v = v || (y.dirtyFields || p.dirtyFields) && E !== !j;
|
|
2830
2831
|
}
|
|
2831
2832
|
if (h) {
|
|
2832
|
-
const
|
|
2833
|
-
|
|
2833
|
+
const j = S(t.touchedFields, l);
|
|
2834
|
+
j || (H(t.touchedFields, l, h), $.touchedFields = t.touchedFields, v = v || (y.touchedFields || p.touchedFields) && j !== h);
|
|
2834
2835
|
}
|
|
2835
|
-
|
|
2836
|
+
v && x && m.state.next($);
|
|
2836
2837
|
}
|
|
2837
|
-
return
|
|
2838
|
-
},
|
|
2839
|
-
const
|
|
2840
|
-
if (r.delayError && h ? (u =
|
|
2841
|
-
const
|
|
2842
|
-
...
|
|
2843
|
-
...
|
|
2838
|
+
return v ? $ : {};
|
|
2839
|
+
}, q = (l, d, h, w) => {
|
|
2840
|
+
const x = S(t.errors, l), v = (y.isValid || p.isValid) && me(d) && t.isValid !== d;
|
|
2841
|
+
if (r.delayError && h ? (u = C(() => V(l, h)), u(r.delayError)) : (clearTimeout(f), u = null, h ? H(t.errors, l, h) : Z(t.errors, l)), (h ? !Fe(x, h) : x) || !se(w) || v) {
|
|
2842
|
+
const E = {
|
|
2843
|
+
...w,
|
|
2844
|
+
...v && me(d) ? { isValid: d } : {},
|
|
2844
2845
|
errors: t.errors,
|
|
2845
2846
|
name: l
|
|
2846
2847
|
};
|
|
2847
2848
|
t = {
|
|
2848
2849
|
...t,
|
|
2849
|
-
...
|
|
2850
|
-
}, m.state.next(
|
|
2850
|
+
...E
|
|
2851
|
+
}, m.state.next(E);
|
|
2851
2852
|
}
|
|
2852
|
-
},
|
|
2853
|
-
const { errors: d } = await
|
|
2854
|
-
if (
|
|
2853
|
+
}, T = async (l) => (A(l, !0), await r.resolver(i, r.context, Ba(l || o.mount, n, r.criteriaMode, r.shouldUseNativeValidation))), z = async (l) => {
|
|
2854
|
+
const { errors: d } = await T(l);
|
|
2855
|
+
if (A(l), l)
|
|
2855
2856
|
for (const h of l) {
|
|
2856
|
-
const
|
|
2857
|
-
|
|
2857
|
+
const w = S(d, h);
|
|
2858
|
+
w ? H(t.errors, h, w) : Z(t.errors, h);
|
|
2858
2859
|
}
|
|
2859
2860
|
else
|
|
2860
2861
|
t.errors = d;
|
|
2861
2862
|
return d;
|
|
2862
|
-
},
|
|
2863
|
+
}, D = async (l, d, h = {
|
|
2863
2864
|
valid: !0
|
|
2864
2865
|
}) => {
|
|
2865
|
-
for (const
|
|
2866
|
-
const
|
|
2867
|
-
if (
|
|
2868
|
-
const { _f:
|
|
2869
|
-
if (
|
|
2870
|
-
const
|
|
2871
|
-
|
|
2872
|
-
const
|
|
2873
|
-
if (
|
|
2866
|
+
for (const w in l) {
|
|
2867
|
+
const x = l[w];
|
|
2868
|
+
if (x) {
|
|
2869
|
+
const { _f: v, ...E } = x;
|
|
2870
|
+
if (v) {
|
|
2871
|
+
const $ = o.array.has(v.name), j = x._f && $a(x._f);
|
|
2872
|
+
j && y.validatingFields && A([v.name], !0);
|
|
2873
|
+
const re = await Er(x, o.disabled, i, _, r.shouldUseNativeValidation && !d, $);
|
|
2874
|
+
if (j && y.validatingFields && A([v.name]), re[v.name] && (h.valid = !1, d || e.shouldUseNativeValidation))
|
|
2874
2875
|
break;
|
|
2875
|
-
!d && (S(
|
|
2876
|
+
!d && (S(re, v.name) ? $ ? za(t.errors, re, v.name) : H(t.errors, v.name, re[v.name]) : Z(t.errors, v.name));
|
|
2876
2877
|
}
|
|
2877
|
-
!
|
|
2878
|
+
!se(E) && await D(E, d, h);
|
|
2878
2879
|
}
|
|
2879
2880
|
}
|
|
2880
2881
|
return h.valid;
|
|
2881
|
-
},
|
|
2882
|
+
}, U = () => {
|
|
2882
2883
|
for (const l of o.unMount) {
|
|
2883
2884
|
const d = S(n, l);
|
|
2884
|
-
d && (d._f.refs ? d._f.refs.every((h) => !
|
|
2885
|
+
d && (d._f.refs ? d._f.refs.every((h) => !Tt(h)) : !Tt(d._f.ref)) && je(l);
|
|
2885
2886
|
}
|
|
2886
2887
|
o.unMount = /* @__PURE__ */ new Set();
|
|
2887
|
-
},
|
|
2888
|
-
...a.mount ? i : J(d) ? s :
|
|
2889
|
-
}, h, d),
|
|
2890
|
-
const
|
|
2891
|
-
let
|
|
2892
|
-
if (
|
|
2893
|
-
const
|
|
2894
|
-
|
|
2895
|
-
(!
|
|
2896
|
-
}) :
|
|
2888
|
+
}, I = (l, d) => !r.disabled && (l && d && H(i, l, d), !Fe(Ye(), s)), L = (l, d, h) => La(l, o, {
|
|
2889
|
+
...a.mount ? i : J(d) ? s : ce(l) ? { [l]: d } : d
|
|
2890
|
+
}, h, d), M = (l) => Zt(S(a.mount ? i : s, l, r.shouldUnregister ? S(s, l, []) : [])), N = (l, d, h = {}) => {
|
|
2891
|
+
const w = S(n, l);
|
|
2892
|
+
let x = d;
|
|
2893
|
+
if (w) {
|
|
2894
|
+
const v = w._f;
|
|
2895
|
+
v && (!v.disabled && H(i, l, vn(d, v)), x = bt(v.ref) && ae(d) ? "" : d, yn(v.ref) ? [...v.ref.options].forEach((E) => E.selected = x.includes(E.value)) : v.refs ? ft(v.ref) ? v.refs.forEach((E) => {
|
|
2896
|
+
(!E.defaultChecked || !E.disabled) && (Array.isArray(x) ? E.checked = !!x.find(($) => $ === E.value) : E.checked = x === E.value || !!x);
|
|
2897
|
+
}) : v.refs.forEach((E) => E.checked = E.value === x) : Yt(v.ref) ? v.ref.value = "" : (v.ref.value = x, v.ref.type || m.state.next({
|
|
2897
2898
|
name: l,
|
|
2898
|
-
values:
|
|
2899
|
+
values: Q(i)
|
|
2899
2900
|
})));
|
|
2900
2901
|
}
|
|
2901
|
-
(h.shouldDirty || h.shouldTouch) &&
|
|
2902
|
-
},
|
|
2903
|
-
for (const
|
|
2904
|
-
if (!d.hasOwnProperty(
|
|
2902
|
+
(h.shouldDirty || h.shouldTouch) && O(l, x, h.shouldTouch, h.shouldDirty, !0), h.shouldValidate && G(l);
|
|
2903
|
+
}, W = (l, d, h) => {
|
|
2904
|
+
for (const w in d) {
|
|
2905
|
+
if (!d.hasOwnProperty(w))
|
|
2905
2906
|
return;
|
|
2906
|
-
const
|
|
2907
|
-
(o.array.has(l) ||
|
|
2907
|
+
const x = d[w], v = l + "." + w, E = S(n, v);
|
|
2908
|
+
(o.array.has(l) || X(x) || E && !E._f) && !Oe(x) ? W(v, x, h) : N(v, x, h);
|
|
2908
2909
|
}
|
|
2909
|
-
},
|
|
2910
|
-
const
|
|
2911
|
-
H(i, l,
|
|
2910
|
+
}, K = (l, d, h = {}) => {
|
|
2911
|
+
const w = S(n, l), x = o.array.has(l), v = Q(d);
|
|
2912
|
+
H(i, l, v), x ? (m.array.next({
|
|
2912
2913
|
name: l,
|
|
2913
|
-
values:
|
|
2914
|
+
values: Q(i)
|
|
2914
2915
|
}), (y.isDirty || y.dirtyFields || p.isDirty || p.dirtyFields) && h.shouldDirty && m.state.next({
|
|
2915
2916
|
name: l,
|
|
2916
|
-
dirtyFields:
|
|
2917
|
-
isDirty:
|
|
2918
|
-
})) :
|
|
2917
|
+
dirtyFields: Ue(s, i),
|
|
2918
|
+
isDirty: I(l, v)
|
|
2919
|
+
})) : w && !w._f && !ae(v) ? W(l, v, h) : N(l, v, h), Sr(l, o) ? m.state.next({
|
|
2919
2920
|
...t,
|
|
2920
2921
|
name: l,
|
|
2921
|
-
values:
|
|
2922
|
+
values: Q(i)
|
|
2922
2923
|
}) : m.state.next({
|
|
2923
2924
|
name: a.mount ? l : void 0,
|
|
2924
|
-
values:
|
|
2925
|
+
values: Q(i)
|
|
2925
2926
|
});
|
|
2926
|
-
},
|
|
2927
|
+
}, ue = async (l) => {
|
|
2927
2928
|
a.mount = !0;
|
|
2928
2929
|
const d = l.target;
|
|
2929
|
-
let h = d.name,
|
|
2930
|
-
const
|
|
2931
|
-
|
|
2932
|
-
},
|
|
2933
|
-
if (
|
|
2934
|
-
let
|
|
2935
|
-
const
|
|
2936
|
-
H(i, h,
|
|
2937
|
-
const Et =
|
|
2938
|
-
if (!
|
|
2930
|
+
let h = d.name, w = !0;
|
|
2931
|
+
const x = S(n, h), v = (j) => {
|
|
2932
|
+
w = Number.isNaN(j) || Oe(j) && isNaN(j.getTime()) || Fe(j, S(i, h, j));
|
|
2933
|
+
}, E = kr(r.mode), $ = kr(r.reValidateMode);
|
|
2934
|
+
if (x) {
|
|
2935
|
+
let j, re;
|
|
2936
|
+
const Ne = d.type ? _r(x._f) : Sa(l), Ae = l.type === br.BLUR || l.type === br.FOCUS_OUT, _n = !ja(x._f) && !r.resolver && !S(t.errors, h) && !x._f.deps || Ua(Ae, S(t.touchedFields, h), t.isSubmitted, $, E), It = Sr(h, o, Ae);
|
|
2937
|
+
H(i, h, Ne), Ae ? (!d || !d.readOnly) && (x._f.onBlur && x._f.onBlur(l), u && u(0)) : x._f.onChange && x._f.onChange(l);
|
|
2938
|
+
const Et = O(h, Ne, Ae), kn = !se(Et) || It;
|
|
2939
|
+
if (!Ae && m.state.next({
|
|
2939
2940
|
name: h,
|
|
2940
2941
|
type: l.type,
|
|
2941
|
-
values:
|
|
2942
|
+
values: Q(i)
|
|
2942
2943
|
}), _n)
|
|
2943
|
-
return (y.isValid || p.isValid) && (r.mode === "onBlur" ?
|
|
2944
|
-
if (!
|
|
2945
|
-
const { errors: er } = await
|
|
2946
|
-
if (
|
|
2947
|
-
const Cn =
|
|
2948
|
-
|
|
2944
|
+
return (y.isValid || p.isValid) && (r.mode === "onBlur" ? Ae && k() : Ae || k()), kn && m.state.next({ name: h, ...It ? {} : Et });
|
|
2945
|
+
if (!Ae && It && m.state.next({ ...t }), r.resolver) {
|
|
2946
|
+
const { errors: er } = await T([h]);
|
|
2947
|
+
if (A([h]), v(Ne), w) {
|
|
2948
|
+
const Cn = Ar(t.errors, n, h), tr = Ar(er, n, Cn.name || h);
|
|
2949
|
+
j = tr.error, h = tr.name, re = se(er);
|
|
2949
2950
|
}
|
|
2950
2951
|
} else
|
|
2951
|
-
|
|
2952
|
-
|
|
2952
|
+
A([h], !0), j = (await Er(x, o.disabled, i, _, r.shouldUseNativeValidation))[h], A([h]), v(Ne), w && (j ? re = !1 : (y.isValid || p.isValid) && (re = await D(n, !0)));
|
|
2953
|
+
w && (x._f.deps && (!Array.isArray(x._f.deps) || x._f.deps.length > 0) && G(x._f.deps), q(h, re, j, Et));
|
|
2953
2954
|
}
|
|
2954
|
-
},
|
|
2955
|
+
}, oe = (l, d) => {
|
|
2955
2956
|
if (S(t.errors, d) && l.focus)
|
|
2956
2957
|
return l.focus(), 1;
|
|
2957
|
-
},
|
|
2958
|
-
let h,
|
|
2959
|
-
const
|
|
2958
|
+
}, G = async (l, d = {}) => {
|
|
2959
|
+
let h, w;
|
|
2960
|
+
const x = ut(l);
|
|
2960
2961
|
if (r.resolver) {
|
|
2961
|
-
const
|
|
2962
|
-
h =
|
|
2962
|
+
const v = await z(J(l) ? l : x);
|
|
2963
|
+
h = se(v), w = l ? !x.some((E) => S(v, E)) : h;
|
|
2963
2964
|
} else
|
|
2964
|
-
l ? (
|
|
2965
|
-
const
|
|
2966
|
-
return await
|
|
2967
|
-
}))).every(Boolean), !(!
|
|
2965
|
+
l ? (w = (await Promise.all(x.map(async (v) => {
|
|
2966
|
+
const E = S(n, v);
|
|
2967
|
+
return await D(E && E._f ? { [v]: E } : E);
|
|
2968
|
+
}))).every(Boolean), !(!w && !t.isValid) && k()) : w = h = await D(n);
|
|
2968
2969
|
return m.state.next({
|
|
2969
|
-
...!
|
|
2970
|
+
...!ce(l) || (y.isValid || p.isValid) && h !== t.isValid ? {} : { name: l },
|
|
2970
2971
|
...r.resolver || !l ? { isValid: h } : {},
|
|
2971
2972
|
errors: t.errors
|
|
2972
|
-
}), d.shouldFocus && !
|
|
2973
|
-
},
|
|
2973
|
+
}), d.shouldFocus && !w && dt(n, oe, l ? x : o.mount), w;
|
|
2974
|
+
}, Ye = (l, d) => {
|
|
2974
2975
|
let h = {
|
|
2975
2976
|
...a.mount ? i : s
|
|
2976
2977
|
};
|
|
2977
|
-
return d && (h = mn(d.dirtyFields ? t.dirtyFields : t.touchedFields, h)), J(l) ? h :
|
|
2978
|
-
},
|
|
2978
|
+
return d && (h = mn(d.dirtyFields ? t.dirtyFields : t.touchedFields, h)), J(l) ? h : ce(l) ? S(h, l) : l.map((w) => S(h, w));
|
|
2979
|
+
}, Qe = (l, d) => ({
|
|
2979
2980
|
invalid: !!S((d || t).errors, l),
|
|
2980
2981
|
isDirty: !!S((d || t).dirtyFields, l),
|
|
2981
2982
|
error: S((d || t).errors, l),
|
|
2982
2983
|
isValidating: !!S(t.validatingFields, l),
|
|
2983
2984
|
isTouched: !!S((d || t).touchedFields, l)
|
|
2984
|
-
}),
|
|
2985
|
-
const d = l ?
|
|
2986
|
-
d == null || d.forEach((h) =>
|
|
2985
|
+
}), B = (l) => {
|
|
2986
|
+
const d = l ? ut(l) : void 0;
|
|
2987
|
+
d == null || d.forEach((h) => Z(t.errors, h)), d ? d.forEach((h) => {
|
|
2987
2988
|
m.state.next({
|
|
2988
2989
|
name: h,
|
|
2989
2990
|
errors: t.errors
|
|
@@ -2991,54 +2992,54 @@ function za(e = {}) {
|
|
|
2991
2992
|
}) : m.state.next({
|
|
2992
2993
|
errors: {}
|
|
2993
2994
|
});
|
|
2994
|
-
},
|
|
2995
|
-
const
|
|
2995
|
+
}, Ce = (l, d, h) => {
|
|
2996
|
+
const w = (S(n, l, { _f: {} })._f || {}).ref, x = S(t.errors, l) || {}, { ref: v, message: E, type: $, ...j } = x;
|
|
2996
2997
|
H(t.errors, l, {
|
|
2997
|
-
...
|
|
2998
|
+
...j,
|
|
2998
2999
|
...d,
|
|
2999
|
-
ref:
|
|
3000
|
+
ref: w
|
|
3000
3001
|
}), m.state.next({
|
|
3001
3002
|
name: l,
|
|
3002
3003
|
errors: t.errors,
|
|
3003
3004
|
isValid: !1
|
|
3004
|
-
}), h && h.shouldFocus &&
|
|
3005
|
-
},
|
|
3006
|
-
next: (h) => "values" in h && l(
|
|
3007
|
-
}) :
|
|
3005
|
+
}), h && h.shouldFocus && w && w.focus && w.focus();
|
|
3006
|
+
}, Re = (l, d) => de(l) ? m.state.subscribe({
|
|
3007
|
+
next: (h) => "values" in h && l(L(void 0, d), h)
|
|
3008
|
+
}) : L(l, d, !0), et = (l) => m.state.subscribe({
|
|
3008
3009
|
next: (d) => {
|
|
3009
|
-
|
|
3010
|
+
qa(l.name, d.name, l.exact) && Pa(d, l.formState || y, mt, l.reRenderRoot) && l.callback({
|
|
3010
3011
|
values: { ...i },
|
|
3011
3012
|
...t,
|
|
3012
3013
|
...d,
|
|
3013
3014
|
defaultValues: s
|
|
3014
3015
|
});
|
|
3015
3016
|
}
|
|
3016
|
-
}).unsubscribe,
|
|
3017
|
+
}).unsubscribe, De = (l) => (a.mount = !0, p = {
|
|
3017
3018
|
...p,
|
|
3018
3019
|
...l.formState
|
|
3019
|
-
},
|
|
3020
|
+
}, et({
|
|
3020
3021
|
...l,
|
|
3021
3022
|
formState: {
|
|
3022
|
-
...
|
|
3023
|
+
...g,
|
|
3023
3024
|
...l.formState
|
|
3024
3025
|
}
|
|
3025
|
-
})),
|
|
3026
|
-
for (const h of l ?
|
|
3027
|
-
o.mount.delete(h), o.array.delete(h), d.keepValue || (
|
|
3026
|
+
})), je = (l, d = {}) => {
|
|
3027
|
+
for (const h of l ? ut(l) : o.mount)
|
|
3028
|
+
o.mount.delete(h), o.array.delete(h), d.keepValue || (Z(n, h), Z(i, h)), !d.keepError && Z(t.errors, h), !d.keepDirty && Z(t.dirtyFields, h), !d.keepTouched && Z(t.touchedFields, h), !d.keepIsValidating && Z(t.validatingFields, h), !r.shouldUnregister && !d.keepDefaultValue && Z(s, h);
|
|
3028
3029
|
m.state.next({
|
|
3029
|
-
values:
|
|
3030
|
+
values: Q(i)
|
|
3030
3031
|
}), m.state.next({
|
|
3031
3032
|
...t,
|
|
3032
|
-
...d.keepDirty ? { isDirty:
|
|
3033
|
-
}), !d.keepIsValid &&
|
|
3034
|
-
},
|
|
3033
|
+
...d.keepDirty ? { isDirty: I() } : {}
|
|
3034
|
+
}), !d.keepIsValid && k();
|
|
3035
|
+
}, tt = ({ disabled: l, name: d }) => {
|
|
3035
3036
|
if (me(l) && a.mount || l || o.disabled.has(d)) {
|
|
3036
|
-
const
|
|
3037
|
-
l ? o.disabled.add(d) : o.disabled.delete(d),
|
|
3037
|
+
const x = o.disabled.has(d) !== !!l;
|
|
3038
|
+
l ? o.disabled.add(d) : o.disabled.delete(d), x && a.mount && !a.action && k();
|
|
3038
3039
|
}
|
|
3039
|
-
},
|
|
3040
|
+
}, Te = (l, d = {}) => {
|
|
3040
3041
|
let h = S(n, l);
|
|
3041
|
-
const
|
|
3042
|
+
const w = me(d.disabled) || me(r.disabled);
|
|
3042
3043
|
return H(n, l, {
|
|
3043
3044
|
...h || {},
|
|
3044
3045
|
_f: {
|
|
@@ -3047,124 +3048,124 @@ function za(e = {}) {
|
|
|
3047
3048
|
mount: !0,
|
|
3048
3049
|
...d
|
|
3049
3050
|
}
|
|
3050
|
-
}), o.mount.add(l), h ?
|
|
3051
|
+
}), o.mount.add(l), h ? tt({
|
|
3051
3052
|
disabled: me(d.disabled) ? d.disabled : r.disabled,
|
|
3052
3053
|
name: l
|
|
3053
|
-
}) :
|
|
3054
|
-
...
|
|
3054
|
+
}) : R(l, !0, d.value), {
|
|
3055
|
+
...w ? { disabled: d.disabled || r.disabled } : {},
|
|
3055
3056
|
...r.progressive ? {
|
|
3056
3057
|
required: !!d.required,
|
|
3057
|
-
min:
|
|
3058
|
-
max:
|
|
3059
|
-
minLength:
|
|
3060
|
-
maxLength:
|
|
3061
|
-
pattern:
|
|
3058
|
+
min: it(d.min),
|
|
3059
|
+
max: it(d.max),
|
|
3060
|
+
minLength: it(d.minLength),
|
|
3061
|
+
maxLength: it(d.maxLength),
|
|
3062
|
+
pattern: it(d.pattern)
|
|
3062
3063
|
} : {},
|
|
3063
3064
|
name: l,
|
|
3064
|
-
onChange:
|
|
3065
|
-
onBlur:
|
|
3066
|
-
ref: (
|
|
3067
|
-
if (
|
|
3068
|
-
|
|
3069
|
-
const
|
|
3070
|
-
if (
|
|
3065
|
+
onChange: ue,
|
|
3066
|
+
onBlur: ue,
|
|
3067
|
+
ref: (x) => {
|
|
3068
|
+
if (x) {
|
|
3069
|
+
Te(l, d), h = S(n, l);
|
|
3070
|
+
const v = J(x.value) && x.querySelectorAll && x.querySelectorAll("input,select,textarea")[0] || x, E = Da(v), $ = h._f.refs || [];
|
|
3071
|
+
if (E ? $.find((j) => j === v) : v === h._f.ref)
|
|
3071
3072
|
return;
|
|
3072
3073
|
H(n, l, {
|
|
3073
3074
|
_f: {
|
|
3074
3075
|
...h._f,
|
|
3075
|
-
...
|
|
3076
|
+
...E ? {
|
|
3076
3077
|
refs: [
|
|
3077
|
-
|
|
3078
|
-
|
|
3078
|
+
...$.filter(Tt),
|
|
3079
|
+
v,
|
|
3079
3080
|
...Array.isArray(S(s, l)) ? [{}] : []
|
|
3080
3081
|
],
|
|
3081
|
-
ref: { type:
|
|
3082
|
-
} : { ref:
|
|
3082
|
+
ref: { type: v.type, name: l }
|
|
3083
|
+
} : { ref: v }
|
|
3083
3084
|
}
|
|
3084
|
-
}),
|
|
3085
|
+
}), R(l, !1, void 0, v);
|
|
3085
3086
|
} else
|
|
3086
|
-
h = S(n, l, {}), h._f && (h._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(
|
|
3087
|
+
h = S(n, l, {}), h._f && (h._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(Ia(o.array, l) && a.action) && o.unMount.add(l);
|
|
3087
3088
|
}
|
|
3088
3089
|
};
|
|
3089
|
-
},
|
|
3090
|
-
me(l) && (m.state.next({ disabled: l }),
|
|
3091
|
-
const
|
|
3092
|
-
|
|
3093
|
-
|
|
3090
|
+
}, Se = () => r.shouldFocusError && dt(n, oe, o.mount), Pe = (l) => {
|
|
3091
|
+
me(l) && (m.state.next({ disabled: l }), dt(n, (d, h) => {
|
|
3092
|
+
const w = S(n, h);
|
|
3093
|
+
w && (d.disabled = w._f.disabled || l, Array.isArray(w._f.refs) && w._f.refs.forEach((x) => {
|
|
3094
|
+
x.disabled = w._f.disabled || l;
|
|
3094
3095
|
}));
|
|
3095
3096
|
}, 0, !1));
|
|
3096
|
-
},
|
|
3097
|
-
let
|
|
3097
|
+
}, rt = (l, d) => async (h) => {
|
|
3098
|
+
let w;
|
|
3098
3099
|
h && (h.preventDefault && h.preventDefault(), h.persist && h.persist());
|
|
3099
|
-
let
|
|
3100
|
+
let x = Q(i);
|
|
3100
3101
|
if (m.state.next({
|
|
3101
3102
|
isSubmitting: !0
|
|
3102
3103
|
}), r.resolver) {
|
|
3103
|
-
const { errors:
|
|
3104
|
-
|
|
3104
|
+
const { errors: v, values: E } = await T();
|
|
3105
|
+
A(), t.errors = v, x = Q(E);
|
|
3105
3106
|
} else
|
|
3106
|
-
await
|
|
3107
|
+
await D(n);
|
|
3107
3108
|
if (o.disabled.size)
|
|
3108
|
-
for (const
|
|
3109
|
-
|
|
3110
|
-
if (
|
|
3109
|
+
for (const v of o.disabled)
|
|
3110
|
+
Z(x, v);
|
|
3111
|
+
if (Z(t.errors, "root"), se(t.errors)) {
|
|
3111
3112
|
m.state.next({
|
|
3112
3113
|
errors: {}
|
|
3113
3114
|
});
|
|
3114
3115
|
try {
|
|
3115
|
-
await l(
|
|
3116
|
-
} catch (
|
|
3117
|
-
|
|
3116
|
+
await l(x, h);
|
|
3117
|
+
} catch (v) {
|
|
3118
|
+
w = v;
|
|
3118
3119
|
}
|
|
3119
3120
|
} else
|
|
3120
|
-
d && await d({ ...t.errors }, h),
|
|
3121
|
+
d && await d({ ...t.errors }, h), Se(), setTimeout(Se);
|
|
3121
3122
|
if (m.state.next({
|
|
3122
3123
|
isSubmitted: !0,
|
|
3123
3124
|
isSubmitting: !1,
|
|
3124
|
-
isSubmitSuccessful:
|
|
3125
|
+
isSubmitSuccessful: se(t.errors) && !w,
|
|
3125
3126
|
submitCount: t.submitCount + 1,
|
|
3126
3127
|
errors: t.errors
|
|
3127
|
-
}),
|
|
3128
|
-
throw
|
|
3128
|
+
}), w)
|
|
3129
|
+
throw w;
|
|
3129
3130
|
}, ht = (l, d = {}) => {
|
|
3130
|
-
S(n, l) && (J(d.defaultValue) ?
|
|
3131
|
-
},
|
|
3132
|
-
const h = l ?
|
|
3131
|
+
S(n, l) && (J(d.defaultValue) ? K(l, Q(S(s, l))) : (K(l, d.defaultValue), H(s, l, Q(d.defaultValue))), d.keepTouched || Z(t.touchedFields, l), d.keepDirty || (Z(t.dirtyFields, l), t.isDirty = d.defaultValue ? I(l, Q(S(s, l))) : I()), d.keepError || (Z(t.errors, l), y.isValid && k()), m.state.next({ ...t }));
|
|
3132
|
+
}, nt = (l, d = {}) => {
|
|
3133
|
+
const h = l ? Q(l) : s, w = Q(h), x = se(l), v = x ? s : w;
|
|
3133
3134
|
if (d.keepDefaultValues || (s = h), !d.keepValues) {
|
|
3134
3135
|
if (d.keepDirtyValues) {
|
|
3135
|
-
const
|
|
3136
|
+
const E = /* @__PURE__ */ new Set([
|
|
3136
3137
|
...o.mount,
|
|
3137
|
-
...Object.keys(
|
|
3138
|
+
...Object.keys(Ue(s, i))
|
|
3138
3139
|
]);
|
|
3139
|
-
for (const
|
|
3140
|
-
const
|
|
3141
|
-
|
|
3140
|
+
for (const $ of Array.from(E)) {
|
|
3141
|
+
const j = S(t.dirtyFields, $), re = S(i, $), Ne = S(v, $);
|
|
3142
|
+
j && !J(re) ? H(v, $, re) : !j && !J(Ne) && K($, Ne);
|
|
3142
3143
|
}
|
|
3143
3144
|
} else {
|
|
3144
3145
|
if (Jt && J(l))
|
|
3145
|
-
for (const
|
|
3146
|
-
const
|
|
3147
|
-
if (
|
|
3148
|
-
const
|
|
3149
|
-
if (bt(
|
|
3150
|
-
const
|
|
3151
|
-
if (
|
|
3152
|
-
|
|
3146
|
+
for (const E of o.mount) {
|
|
3147
|
+
const $ = S(n, E);
|
|
3148
|
+
if ($ && $._f) {
|
|
3149
|
+
const j = Array.isArray($._f.refs) ? $._f.refs[0] : $._f.ref;
|
|
3150
|
+
if (bt(j)) {
|
|
3151
|
+
const re = j.closest("form");
|
|
3152
|
+
if (re) {
|
|
3153
|
+
re.reset();
|
|
3153
3154
|
break;
|
|
3154
3155
|
}
|
|
3155
3156
|
}
|
|
3156
3157
|
}
|
|
3157
3158
|
}
|
|
3158
3159
|
if (d.keepFieldsRef)
|
|
3159
|
-
for (const
|
|
3160
|
-
|
|
3160
|
+
for (const E of o.mount)
|
|
3161
|
+
K(E, S(v, E));
|
|
3161
3162
|
else
|
|
3162
3163
|
n = {};
|
|
3163
3164
|
}
|
|
3164
|
-
i = r.shouldUnregister ? d.keepDefaultValues ?
|
|
3165
|
-
values: { ...
|
|
3165
|
+
i = r.shouldUnregister ? d.keepDefaultValues ? Q(s) : {} : Q(v), m.array.next({
|
|
3166
|
+
values: { ...v }
|
|
3166
3167
|
}), m.state.next({
|
|
3167
|
-
values: { ...
|
|
3168
|
+
values: { ...v }
|
|
3168
3169
|
});
|
|
3169
3170
|
}
|
|
3170
3171
|
o = {
|
|
@@ -3175,23 +3176,23 @@ function za(e = {}) {
|
|
|
3175
3176
|
watch: /* @__PURE__ */ new Set(),
|
|
3176
3177
|
watchAll: !1,
|
|
3177
3178
|
focus: ""
|
|
3178
|
-
}, a.mount = !y.isValid || !!d.keepIsValid || !!d.keepDirtyValues || !r.shouldUnregister && !
|
|
3179
|
+
}, a.mount = !y.isValid || !!d.keepIsValid || !!d.keepDirtyValues || !r.shouldUnregister && !se(v), a.watch = !!r.shouldUnregister, a.keepIsValid = !!d.keepIsValid, a.action = !1, d.keepErrors || (t.errors = {}), m.state.next({
|
|
3179
3180
|
submitCount: d.keepSubmitCount ? t.submitCount : 0,
|
|
3180
|
-
isDirty:
|
|
3181
|
+
isDirty: x ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Fe(l, s)),
|
|
3181
3182
|
isSubmitted: d.keepIsSubmitted ? t.isSubmitted : !1,
|
|
3182
|
-
dirtyFields:
|
|
3183
|
+
dirtyFields: x ? {} : d.keepDirtyValues ? d.keepDefaultValues && i ? Ue(s, i) : t.dirtyFields : d.keepDefaultValues && l ? Ue(s, l) : d.keepDirty ? t.dirtyFields : {},
|
|
3183
3184
|
touchedFields: d.keepTouched ? t.touchedFields : {},
|
|
3184
3185
|
errors: d.keepErrors ? t.errors : {},
|
|
3185
3186
|
isSubmitSuccessful: d.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
|
|
3186
3187
|
isSubmitting: !1,
|
|
3187
3188
|
defaultValues: s
|
|
3188
3189
|
});
|
|
3189
|
-
},
|
|
3190
|
-
const h = S(n, l),
|
|
3191
|
-
if (
|
|
3192
|
-
const
|
|
3193
|
-
|
|
3194
|
-
|
|
3190
|
+
}, st = (l, d) => nt(de(l) ? l(i) : l, { ...r.resetOptions, ...d }), pt = (l, d = {}) => {
|
|
3191
|
+
const h = S(n, l), w = h && h._f;
|
|
3192
|
+
if (w) {
|
|
3193
|
+
const x = w.refs ? w.refs[0] : w.ref;
|
|
3194
|
+
x.focus && setTimeout(() => {
|
|
3195
|
+
x.focus(), d.shouldSelect && de(x.select) && x.select();
|
|
3195
3196
|
});
|
|
3196
3197
|
}
|
|
3197
3198
|
}, mt = (l) => {
|
|
@@ -3199,32 +3200,32 @@ function za(e = {}) {
|
|
|
3199
3200
|
...t,
|
|
3200
3201
|
...l
|
|
3201
3202
|
};
|
|
3202
|
-
},
|
|
3203
|
+
}, at = {
|
|
3203
3204
|
control: {
|
|
3204
|
-
register:
|
|
3205
|
-
unregister:
|
|
3206
|
-
getFieldState:
|
|
3207
|
-
handleSubmit:
|
|
3208
|
-
setError:
|
|
3209
|
-
_subscribe:
|
|
3210
|
-
_runSchema:
|
|
3211
|
-
_updateIsValidating:
|
|
3212
|
-
_focusError:
|
|
3213
|
-
_getWatch:
|
|
3214
|
-
_getDirty:
|
|
3215
|
-
_setValid:
|
|
3216
|
-
_setFieldArray:
|
|
3217
|
-
_setDisabledField:
|
|
3218
|
-
_setErrors:
|
|
3219
|
-
_getFieldArray:
|
|
3220
|
-
_reset:
|
|
3205
|
+
register: Te,
|
|
3206
|
+
unregister: je,
|
|
3207
|
+
getFieldState: Qe,
|
|
3208
|
+
handleSubmit: rt,
|
|
3209
|
+
setError: Ce,
|
|
3210
|
+
_subscribe: et,
|
|
3211
|
+
_runSchema: T,
|
|
3212
|
+
_updateIsValidating: A,
|
|
3213
|
+
_focusError: Se,
|
|
3214
|
+
_getWatch: L,
|
|
3215
|
+
_getDirty: I,
|
|
3216
|
+
_setValid: k,
|
|
3217
|
+
_setFieldArray: b,
|
|
3218
|
+
_setDisabledField: tt,
|
|
3219
|
+
_setErrors: F,
|
|
3220
|
+
_getFieldArray: M,
|
|
3221
|
+
_reset: nt,
|
|
3221
3222
|
_resetDefaultValues: () => de(r.defaultValues) && r.defaultValues().then((l) => {
|
|
3222
|
-
|
|
3223
|
+
st(l, r.resetOptions), m.state.next({
|
|
3223
3224
|
isLoading: !1
|
|
3224
3225
|
});
|
|
3225
3226
|
}),
|
|
3226
|
-
_removeUnmounted:
|
|
3227
|
-
_disableForm:
|
|
3227
|
+
_removeUnmounted: U,
|
|
3228
|
+
_disableForm: Pe,
|
|
3228
3229
|
_subjects: m,
|
|
3229
3230
|
_proxyFormState: y,
|
|
3230
3231
|
get _fields() {
|
|
@@ -3261,28 +3262,28 @@ function za(e = {}) {
|
|
|
3261
3262
|
};
|
|
3262
3263
|
}
|
|
3263
3264
|
},
|
|
3264
|
-
subscribe:
|
|
3265
|
-
trigger:
|
|
3266
|
-
register:
|
|
3267
|
-
handleSubmit:
|
|
3268
|
-
watch:
|
|
3269
|
-
setValue:
|
|
3270
|
-
getValues:
|
|
3271
|
-
reset:
|
|
3265
|
+
subscribe: De,
|
|
3266
|
+
trigger: G,
|
|
3267
|
+
register: Te,
|
|
3268
|
+
handleSubmit: rt,
|
|
3269
|
+
watch: Re,
|
|
3270
|
+
setValue: K,
|
|
3271
|
+
getValues: Ye,
|
|
3272
|
+
reset: st,
|
|
3272
3273
|
resetField: ht,
|
|
3273
|
-
clearErrors:
|
|
3274
|
-
unregister:
|
|
3275
|
-
setError:
|
|
3274
|
+
clearErrors: B,
|
|
3275
|
+
unregister: je,
|
|
3276
|
+
setError: Ce,
|
|
3276
3277
|
setFocus: pt,
|
|
3277
|
-
getFieldState:
|
|
3278
|
+
getFieldState: Qe
|
|
3278
3279
|
};
|
|
3279
3280
|
return {
|
|
3280
|
-
...
|
|
3281
|
-
formControl:
|
|
3281
|
+
...at,
|
|
3282
|
+
formControl: at
|
|
3282
3283
|
};
|
|
3283
3284
|
}
|
|
3284
3285
|
function Ct(e = {}) {
|
|
3285
|
-
const r =
|
|
3286
|
+
const r = ne.useRef(void 0), t = ne.useRef(void 0), [n, s] = ne.useState({
|
|
3286
3287
|
isDirty: !1,
|
|
3287
3288
|
isValidating: !1,
|
|
3288
3289
|
isLoading: de(e.defaultValues),
|
|
@@ -3306,14 +3307,14 @@ function Ct(e = {}) {
|
|
|
3306
3307
|
formState: n
|
|
3307
3308
|
}, e.defaultValues && !de(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
3308
3309
|
else {
|
|
3309
|
-
const { formControl: a, ...o } =
|
|
3310
|
+
const { formControl: a, ...o } = Ka(e);
|
|
3310
3311
|
r.current = {
|
|
3311
3312
|
...o,
|
|
3312
3313
|
formState: n
|
|
3313
3314
|
};
|
|
3314
3315
|
}
|
|
3315
3316
|
const i = r.current.control;
|
|
3316
|
-
return i._options = e,
|
|
3317
|
+
return i._options = e, Ma(() => {
|
|
3317
3318
|
const a = i._subscribe({
|
|
3318
3319
|
formState: i._proxyFormState,
|
|
3319
3320
|
callback: () => s({ ...i._formState }),
|
|
@@ -3323,69 +3324,69 @@ function Ct(e = {}) {
|
|
|
3323
3324
|
...o,
|
|
3324
3325
|
isReady: !0
|
|
3325
3326
|
})), i._formState.isReady = !0, a;
|
|
3326
|
-
}, [i]),
|
|
3327
|
+
}, [i]), ne.useEffect(() => i._disableForm(e.disabled), [i, e.disabled]), ne.useEffect(() => {
|
|
3327
3328
|
e.mode && (i._options.mode = e.mode), e.reValidateMode && (i._options.reValidateMode = e.reValidateMode);
|
|
3328
|
-
}, [i, e.mode, e.reValidateMode]),
|
|
3329
|
+
}, [i, e.mode, e.reValidateMode]), ne.useEffect(() => {
|
|
3329
3330
|
e.errors && (i._setErrors(e.errors), i._focusError());
|
|
3330
|
-
}, [i, e.errors]),
|
|
3331
|
+
}, [i, e.errors]), ne.useEffect(() => {
|
|
3331
3332
|
e.shouldUnregister && i._subjects.state.next({
|
|
3332
3333
|
values: i._getWatch()
|
|
3333
3334
|
});
|
|
3334
|
-
}, [i, e.shouldUnregister]),
|
|
3335
|
+
}, [i, e.shouldUnregister]), ne.useEffect(() => {
|
|
3335
3336
|
if (i._proxyFormState.isDirty) {
|
|
3336
3337
|
const a = i._getDirty();
|
|
3337
3338
|
a !== n.isDirty && i._subjects.state.next({
|
|
3338
3339
|
isDirty: a
|
|
3339
3340
|
});
|
|
3340
3341
|
}
|
|
3341
|
-
}, [i, n.isDirty]),
|
|
3342
|
+
}, [i, n.isDirty]), ne.useEffect(() => {
|
|
3342
3343
|
var a;
|
|
3343
|
-
e.values && !
|
|
3344
|
+
e.values && !Fe(e.values, t.current) ? (i._reset(e.values, {
|
|
3344
3345
|
keepFieldsRef: !0,
|
|
3345
3346
|
...i._options.resetOptions
|
|
3346
3347
|
}), !((a = i._options.resetOptions) === null || a === void 0) && a.keepIsValid || i._setValid(), t.current = e.values, s((o) => ({ ...o }))) : i._resetDefaultValues();
|
|
3347
|
-
}, [i, e.values]),
|
|
3348
|
+
}, [i, e.values]), ne.useEffect(() => {
|
|
3348
3349
|
i._state.mount || (i._setValid(), i._state.mount = !0), i._state.watch && (i._state.watch = !1, i._subjects.state.next({ ...i._formState })), i._removeUnmounted();
|
|
3349
|
-
}), r.current.formState =
|
|
3350
|
+
}), r.current.formState = ne.useMemo(() => Va(n, i), [i, n]), r.current;
|
|
3350
3351
|
}
|
|
3351
3352
|
const Fr = (e, r, t) => {
|
|
3352
3353
|
if (e && "reportValidity" in e) {
|
|
3353
3354
|
const n = S(t, r);
|
|
3354
3355
|
e.setCustomValidity(n && n.message || ""), e.reportValidity();
|
|
3355
3356
|
}
|
|
3356
|
-
},
|
|
3357
|
+
}, Ga = (e, r) => {
|
|
3357
3358
|
for (const t in r.fields) {
|
|
3358
3359
|
const n = r.fields[t];
|
|
3359
3360
|
n && n.ref && "reportValidity" in n.ref ? Fr(n.ref, t, e) : n.refs && n.refs.forEach((s) => Fr(s, t, e));
|
|
3360
3361
|
}
|
|
3361
|
-
},
|
|
3362
|
-
r.shouldUseNativeValidation &&
|
|
3362
|
+
}, Ja = (e, r) => {
|
|
3363
|
+
r.shouldUseNativeValidation && Ga(e, r);
|
|
3363
3364
|
const t = {};
|
|
3364
3365
|
for (const n in e) {
|
|
3365
3366
|
const s = S(r.fields, n), i = Object.assign(e[n] || {}, { ref: s && s.ref });
|
|
3366
|
-
if (
|
|
3367
|
+
if (Za(r.names || Object.keys(e), n)) {
|
|
3367
3368
|
const a = Object.assign({}, S(t, n));
|
|
3368
3369
|
H(a, "root", i), H(t, n, a);
|
|
3369
3370
|
} else
|
|
3370
3371
|
H(t, n, i);
|
|
3371
3372
|
}
|
|
3372
3373
|
return t;
|
|
3373
|
-
},
|
|
3374
|
+
}, Za = (e, r) => e.some((t) => t.startsWith(r + "."));
|
|
3374
3375
|
var St = function(e, r, t) {
|
|
3375
3376
|
return t === void 0 && (t = {}), function(n, s, i) {
|
|
3376
3377
|
try {
|
|
3377
3378
|
var a = !i.shouldUseNativeValidation && i.criteriaMode === "all";
|
|
3378
|
-
return Promise.resolve(/* @__PURE__ */
|
|
3379
|
+
return Promise.resolve(/* @__PURE__ */ oa(e, n, Object.assign({}, r, { abortPipeEarly: !a }))).then(function(o) {
|
|
3379
3380
|
if (o.issues) {
|
|
3380
3381
|
for (var u = {}; o.issues.length; ) {
|
|
3381
|
-
var f = o.issues[0],
|
|
3382
|
-
if (
|
|
3383
|
-
var y = u[
|
|
3384
|
-
u[
|
|
3382
|
+
var f = o.issues[0], g = /* @__PURE__ */ ea(f);
|
|
3383
|
+
if (g && (u[g] || (u[g] = { message: f.message, type: f.type }), a)) {
|
|
3384
|
+
var y = u[g].types, p = y && y[f.type];
|
|
3385
|
+
u[g] = pn(g, a, u, f.type, p ? [].concat(p, f.message) : f.message);
|
|
3385
3386
|
}
|
|
3386
3387
|
o.issues.shift();
|
|
3387
3388
|
}
|
|
3388
|
-
return { values: {}, errors:
|
|
3389
|
+
return { values: {}, errors: Ja(u, i) };
|
|
3389
3390
|
}
|
|
3390
3391
|
return { values: t.raw ? n : o.output, errors: {} };
|
|
3391
3392
|
});
|
|
@@ -3394,19 +3395,19 @@ var St = function(e, r, t) {
|
|
|
3394
3395
|
}
|
|
3395
3396
|
};
|
|
3396
3397
|
};
|
|
3397
|
-
const Vr = 27, Mr = 12, Lr = 10,
|
|
3398
|
+
const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
3398
3399
|
const t = {
|
|
3399
3400
|
min: e.minSelected ?? 0,
|
|
3400
3401
|
max: e.maxSelected ?? e.options.length
|
|
3401
3402
|
};
|
|
3402
3403
|
return St(/* @__PURE__ */ _e({
|
|
3403
|
-
checked: /* @__PURE__ */
|
|
3404
|
+
checked: /* @__PURE__ */ Ve(/* @__PURE__ */ ln(/* @__PURE__ */ ie(), /* @__PURE__ */ sn()), /* @__PURE__ */ Wt((n) => Object.entries(n).filter(([s, i]) => i).map(([s, i]) => s)), /* @__PURE__ */ ct(t.max, r("validation_multiple_choice_max", {
|
|
3404
3405
|
count: t.max
|
|
3405
|
-
})), /* @__PURE__ */
|
|
3406
|
+
})), /* @__PURE__ */ We(t.min, r("validation_multiple_choice_min", {
|
|
3406
3407
|
count: t.min
|
|
3407
3408
|
})))
|
|
3408
3409
|
}));
|
|
3409
|
-
},
|
|
3410
|
+
}, Qa = Hr(({
|
|
3410
3411
|
option: e,
|
|
3411
3412
|
...r
|
|
3412
3413
|
}, t) => c(ke, {
|
|
@@ -3420,7 +3421,7 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3420
3421
|
htmlFor: r.id,
|
|
3421
3422
|
children: e.label
|
|
3422
3423
|
})]
|
|
3423
|
-
})),
|
|
3424
|
+
})), Rr = xt("gutter-stable flex w-full flex-1 flex-wrap gap-2 overflow-y-auto rounded-xl p-2.5 pr-4", {
|
|
3424
3425
|
variants: {
|
|
3425
3426
|
variant: {
|
|
3426
3427
|
// In cases where there is only one option, we want to center it
|
|
@@ -3429,14 +3430,14 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3429
3430
|
booleanLike: un
|
|
3430
3431
|
}
|
|
3431
3432
|
}
|
|
3432
|
-
}),
|
|
3433
|
+
}), ei = ({
|
|
3433
3434
|
input: e,
|
|
3434
3435
|
onSubmitSuccess: r
|
|
3435
3436
|
}) => {
|
|
3436
|
-
var
|
|
3437
|
-
const t = e.key ? (
|
|
3437
|
+
var g, y;
|
|
3438
|
+
const t = e.key ? (g = P.current$.value.flow) == null ? void 0 : g.data.submissions[e.key] : void 0, n = (e.config.minSelected === 1 || e.config.minSelected === void 0) && e.config.maxSelected === 1, s = n && e.config.options.length === 2, {
|
|
3438
3439
|
t: i
|
|
3439
|
-
} =
|
|
3440
|
+
} = te(), {
|
|
3440
3441
|
register: a,
|
|
3441
3442
|
handleSubmit: o,
|
|
3442
3443
|
formState: {
|
|
@@ -3444,23 +3445,23 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3444
3445
|
}
|
|
3445
3446
|
} = Ct({
|
|
3446
3447
|
defaultValues: {
|
|
3447
|
-
checked: n ? {} :
|
|
3448
|
+
checked: n ? {} : Xa(t) ? Object.fromEntries(t.value.map((p) => [p, !0])) : {}
|
|
3448
3449
|
},
|
|
3449
|
-
resolver:
|
|
3450
|
+
resolver: Ya(e.config, i)
|
|
3450
3451
|
}), f = Gt();
|
|
3451
3452
|
return s ? c("ul", {
|
|
3452
3453
|
style: {
|
|
3453
3454
|
maxHeight: 6.5 * Vr + 5 * Mr + 2 * Lr
|
|
3454
3455
|
},
|
|
3455
|
-
class:
|
|
3456
|
+
class: Rr({
|
|
3456
3457
|
variant: "booleanLike"
|
|
3457
3458
|
}),
|
|
3458
3459
|
children: e.config.options.map((p, m) => c("li", {
|
|
3459
3460
|
class: dn,
|
|
3460
3461
|
children: c(fn, {
|
|
3461
3462
|
type: "submit",
|
|
3462
|
-
ref: (
|
|
3463
|
-
|
|
3463
|
+
ref: (_) => {
|
|
3464
|
+
_ && m === 0 && (f.current = _);
|
|
3464
3465
|
},
|
|
3465
3466
|
label: p.label,
|
|
3466
3467
|
value: "true",
|
|
@@ -3473,10 +3474,10 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3473
3474
|
}) : c("form", {
|
|
3474
3475
|
noValidate: !0,
|
|
3475
3476
|
onSubmit: (p) => o((m) => {
|
|
3476
|
-
const
|
|
3477
|
+
const _ = m.checked;
|
|
3477
3478
|
r({
|
|
3478
3479
|
type: "enum",
|
|
3479
|
-
value:
|
|
3480
|
+
value: _
|
|
3480
3481
|
});
|
|
3481
3482
|
})(p),
|
|
3482
3483
|
children: [c("div", {
|
|
@@ -3485,24 +3486,24 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3485
3486
|
style: {
|
|
3486
3487
|
maxHeight: 6.5 * Vr + 5 * Mr + 2 * Lr
|
|
3487
3488
|
},
|
|
3488
|
-
class:
|
|
3489
|
+
class: Rr({
|
|
3489
3490
|
variant: e.config.options.length === 1 ? "singleOption" : void 0
|
|
3490
3491
|
}),
|
|
3491
3492
|
children: e.config.options.map((p, m) => {
|
|
3492
|
-
const
|
|
3493
|
-
ref:
|
|
3494
|
-
...
|
|
3495
|
-
} = a(
|
|
3493
|
+
const _ = `checked.${p.value}`, {
|
|
3494
|
+
ref: C,
|
|
3495
|
+
...k
|
|
3496
|
+
} = a(_);
|
|
3496
3497
|
return c("li", {
|
|
3497
3498
|
class: "relative",
|
|
3498
|
-
children: c(
|
|
3499
|
+
children: c(Qa, {
|
|
3499
3500
|
option: p,
|
|
3500
3501
|
autoFocus: m === 0,
|
|
3501
|
-
ref: (
|
|
3502
|
-
|
|
3502
|
+
ref: (A) => {
|
|
3503
|
+
A && m === 0 && (f.current = A), C(A);
|
|
3503
3504
|
},
|
|
3504
|
-
id:
|
|
3505
|
-
...
|
|
3505
|
+
id: _,
|
|
3506
|
+
...k,
|
|
3506
3507
|
onClick: n ? () => r({
|
|
3507
3508
|
type: "enum",
|
|
3508
3509
|
value: [p.value]
|
|
@@ -3512,7 +3513,7 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3512
3513
|
})
|
|
3513
3514
|
}), c("div", {
|
|
3514
3515
|
class: "flex flex-col items-center gap-2 pr-2.5 pt-2.5",
|
|
3515
|
-
children: [n ? null : c($e, {}), e.config.minSelected === 0 && c(
|
|
3516
|
+
children: [n ? null : c($e, {}), e.config.minSelected === 0 && c(Le, {
|
|
3516
3517
|
class: "relative",
|
|
3517
3518
|
type: "button",
|
|
3518
3519
|
onClick: () => r({
|
|
@@ -3523,15 +3524,15 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3523
3524
|
})]
|
|
3524
3525
|
}), c("div", {
|
|
3525
3526
|
class: "px-1",
|
|
3526
|
-
children: c(
|
|
3527
|
+
children: c(Xe, {
|
|
3527
3528
|
error: (y = u.checked) == null ? void 0 : y.root
|
|
3528
3529
|
})
|
|
3529
3530
|
})]
|
|
3530
3531
|
});
|
|
3531
|
-
},
|
|
3532
|
+
}, ti = Ze("number"), ri = (e, r) => {
|
|
3532
3533
|
const t = e.min ?? Number.MIN_SAFE_INTEGER, n = e.max ?? Number.MAX_SAFE_INTEGER, s = e.decimalCases ?? 0;
|
|
3533
3534
|
return St(/* @__PURE__ */ _e({
|
|
3534
|
-
number: /* @__PURE__ */
|
|
3535
|
+
number: /* @__PURE__ */ Ve(/* @__PURE__ */ an(r("validation_number")), /* @__PURE__ */ en(t, r("validation_number_min", {
|
|
3535
3536
|
min: t
|
|
3536
3537
|
})), /* @__PURE__ */ Qr(n, r("validation_number_max", {
|
|
3537
3538
|
max: n
|
|
@@ -3539,14 +3540,14 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3539
3540
|
count: s
|
|
3540
3541
|
})))
|
|
3541
3542
|
}));
|
|
3542
|
-
},
|
|
3543
|
+
}, ni = ({
|
|
3543
3544
|
input: e,
|
|
3544
3545
|
onSubmitSuccess: r
|
|
3545
3546
|
}) => {
|
|
3546
3547
|
var y;
|
|
3547
|
-
const t = e.config.defaultValue, n = e.key ? (y =
|
|
3548
|
+
const t = e.config.defaultValue, n = e.key ? (y = P.current$.value.flow) == null ? void 0 : y.data.submissions[e.key] : void 0, {
|
|
3548
3549
|
t: s
|
|
3549
|
-
} =
|
|
3550
|
+
} = te(), {
|
|
3550
3551
|
register: i,
|
|
3551
3552
|
handleSubmit: a,
|
|
3552
3553
|
formState: {
|
|
@@ -3554,18 +3555,18 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3554
3555
|
}
|
|
3555
3556
|
} = Ct({
|
|
3556
3557
|
defaultValues: {
|
|
3557
|
-
number:
|
|
3558
|
+
number: ti(n) ? n.value : t ? Number(t) : void 0
|
|
3558
3559
|
},
|
|
3559
|
-
resolver:
|
|
3560
|
+
resolver: ri(e.config, s)
|
|
3560
3561
|
}), {
|
|
3561
3562
|
ref: u,
|
|
3562
3563
|
...f
|
|
3563
3564
|
} = i("number", {
|
|
3564
3565
|
required: !e.config.optional,
|
|
3565
3566
|
valueAsNumber: !0
|
|
3566
|
-
}),
|
|
3567
|
-
return
|
|
3568
|
-
|
|
3567
|
+
}), g = ye();
|
|
3568
|
+
return Me(() => {
|
|
3569
|
+
g.current && (g.current.focus(), g.current.select());
|
|
3569
3570
|
}, []), c("form", {
|
|
3570
3571
|
class: "flex flex-col gap-1 p-2.5",
|
|
3571
3572
|
onSubmit: a((p) => {
|
|
@@ -3586,26 +3587,26 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3586
3587
|
autoCorrect: "off",
|
|
3587
3588
|
autoFocus: !0,
|
|
3588
3589
|
ref: (p) => {
|
|
3589
|
-
p && (
|
|
3590
|
+
p && (g.current = p), u(p);
|
|
3590
3591
|
},
|
|
3591
3592
|
type: "text",
|
|
3592
3593
|
min: e.config.min,
|
|
3593
3594
|
max: e.config.max,
|
|
3594
|
-
class:
|
|
3595
|
+
class: Ge({
|
|
3595
3596
|
optional: e.config.optional,
|
|
3596
3597
|
className: "[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"
|
|
3597
3598
|
}),
|
|
3598
3599
|
placeholder: e.config.placeholder
|
|
3599
|
-
}), e.config.optional && c(
|
|
3600
|
+
}), e.config.optional && c(Le, {
|
|
3600
3601
|
class: "absolute bottom-0 right-0.5 top-0",
|
|
3601
3602
|
onClick: () => r(null)
|
|
3602
3603
|
})]
|
|
3603
3604
|
}), c($e, {})]
|
|
3604
|
-
}), c(
|
|
3605
|
+
}), c(Xe, {
|
|
3605
3606
|
error: o.number
|
|
3606
3607
|
})]
|
|
3607
3608
|
});
|
|
3608
|
-
},
|
|
3609
|
+
}, si = (e) => {
|
|
3609
3610
|
if (e === "")
|
|
3610
3611
|
return {
|
|
3611
3612
|
countryCode: "",
|
|
@@ -3619,65 +3620,65 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3619
3620
|
countryCode: "",
|
|
3620
3621
|
phoneNumber: ""
|
|
3621
3622
|
};
|
|
3622
|
-
},
|
|
3623
|
-
const r = /* @__PURE__ */
|
|
3623
|
+
}, ai = "44", ii = /^[0-9 ]+$/, oi = Ze("string"), li = Ze("phone"), ci = (e) => {
|
|
3624
|
+
const r = /* @__PURE__ */ Ve(/* @__PURE__ */ ie(e("validation_country_code")), /* @__PURE__ */ zt(ii, e("validation_country_code"))), t = /* @__PURE__ */ Ve(/* @__PURE__ */ ie(e("validation_phone")), /* @__PURE__ */ We(1, e("validation_phone")), /* @__PURE__ */ Wt((n) => n.replace(/[^0-9]/g, "")));
|
|
3624
3625
|
return St(/* @__PURE__ */ _e({
|
|
3625
3626
|
countryCode: r,
|
|
3626
3627
|
phoneNumber: t
|
|
3627
3628
|
}));
|
|
3628
|
-
},
|
|
3629
|
+
}, ui = ({
|
|
3629
3630
|
input: e,
|
|
3630
3631
|
onSubmitSuccess: r
|
|
3631
3632
|
}) => {
|
|
3632
|
-
var
|
|
3633
|
-
const t = e.key ? (
|
|
3633
|
+
var C;
|
|
3634
|
+
const t = e.key ? (C = P.current$.value.flow) == null ? void 0 : C.data.submissions[e.key] : void 0, {
|
|
3634
3635
|
t: n
|
|
3635
|
-
} =
|
|
3636
|
+
} = te(), [s, i] = we(), a = oi(t) ? si(t.value) : li(t) ? t.value : void 0, {
|
|
3636
3637
|
register: o,
|
|
3637
3638
|
handleSubmit: u,
|
|
3638
3639
|
formState: {
|
|
3639
3640
|
errors: f
|
|
3640
3641
|
},
|
|
3641
|
-
watch:
|
|
3642
|
+
watch: g
|
|
3642
3643
|
} = Ct({
|
|
3643
3644
|
defaultValues: {
|
|
3644
|
-
countryCode: (a == null ? void 0 : a.countryCode) ?? e.config.defaultValue.countryCode ??
|
|
3645
|
+
countryCode: (a == null ? void 0 : a.countryCode) ?? e.config.defaultValue.countryCode ?? ai,
|
|
3645
3646
|
phoneNumber: (a == null ? void 0 : a.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
|
|
3646
3647
|
},
|
|
3647
|
-
resolver:
|
|
3648
|
+
resolver: ci(n)
|
|
3648
3649
|
}), {
|
|
3649
3650
|
ref: y,
|
|
3650
3651
|
...p
|
|
3651
3652
|
} = o("phoneNumber", {
|
|
3652
3653
|
required: !e.config.optional
|
|
3653
|
-
}), m = ye(),
|
|
3654
|
-
return
|
|
3654
|
+
}), m = ye(), _ = g("countryCode");
|
|
3655
|
+
return Me(() => {
|
|
3655
3656
|
m.current && (m.current.focus(), m.current.select());
|
|
3656
3657
|
}, []), c("form", {
|
|
3657
3658
|
noValidate: !0,
|
|
3658
3659
|
class: "flex flex-col gap-1 p-2.5",
|
|
3659
|
-
onSubmit: u((
|
|
3660
|
-
const
|
|
3660
|
+
onSubmit: u((k) => {
|
|
3661
|
+
const A = k.phoneNumber.replace(/[^0-9]/g, ""), b = k.countryCode.replace(/[^0-9]/g, "");
|
|
3661
3662
|
i(void 0);
|
|
3662
|
-
const
|
|
3663
|
-
if (
|
|
3663
|
+
const V = e.config.minChars ?? 7, F = A.length + b.length;
|
|
3664
|
+
if (F < V)
|
|
3664
3665
|
return i(n("validation_phone_min_chars", {
|
|
3665
|
-
count:
|
|
3666
|
+
count: V
|
|
3666
3667
|
}));
|
|
3667
|
-
const
|
|
3668
|
-
if (
|
|
3668
|
+
const R = e.config.maxChars;
|
|
3669
|
+
if (R != null && F > R)
|
|
3669
3670
|
return i(n("validation_max_chars", {
|
|
3670
|
-
count:
|
|
3671
|
+
count: R
|
|
3671
3672
|
}));
|
|
3672
3673
|
e.config.submissionFormat === "phone" ? r({
|
|
3673
3674
|
type: "phone",
|
|
3674
3675
|
value: {
|
|
3675
|
-
countryCode:
|
|
3676
|
-
phoneNumber:
|
|
3676
|
+
countryCode: b,
|
|
3677
|
+
phoneNumber: A
|
|
3677
3678
|
}
|
|
3678
3679
|
}) : r({
|
|
3679
3680
|
type: "string",
|
|
3680
|
-
value:
|
|
3681
|
+
value: _ + k.phoneNumber
|
|
3681
3682
|
});
|
|
3682
3683
|
}),
|
|
3683
3684
|
children: [c("div", {
|
|
@@ -3688,15 +3689,15 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3688
3689
|
class: "text-neutral-12 bg-lowest hover:bg-neutral-5 placeholder:text-neutral-8 focus-visible:outline-accent-7 focus-within:bg-neutral-5 focus-within:outline-accent-7 outline-divider relative flex h-full cursor-pointer appearance-none items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap rounded-l-full border-solid px-3 py-1.5 text-center text-base outline outline-2 transition-all focus-within:outline-none",
|
|
3689
3690
|
htmlFor: `isdk_phone_${e.key}`,
|
|
3690
3691
|
children: [c("span", {
|
|
3691
|
-
children: ["+",
|
|
3692
|
+
children: ["+", _]
|
|
3692
3693
|
}), c("select", {
|
|
3693
3694
|
...o("countryCode", {}),
|
|
3694
3695
|
id: `isdk_phone_${e.key}`,
|
|
3695
3696
|
class: "absolute inset-0 opacity-0",
|
|
3696
|
-
children: Object.entries(Kt).map(([
|
|
3697
|
-
value:
|
|
3698
|
-
children: [
|
|
3699
|
-
},
|
|
3697
|
+
children: Object.entries(Kt).map(([k, A]) => c("option", {
|
|
3698
|
+
value: A,
|
|
3699
|
+
children: [k, " (+", A, ")"]
|
|
3700
|
+
}, k))
|
|
3700
3701
|
})]
|
|
3701
3702
|
}), c("input", {
|
|
3702
3703
|
...p,
|
|
@@ -3707,44 +3708,44 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3707
3708
|
autoCapitalize: "off",
|
|
3708
3709
|
autoCorrect: "off",
|
|
3709
3710
|
autoFocus: !0,
|
|
3710
|
-
ref: (
|
|
3711
|
-
|
|
3711
|
+
ref: (k) => {
|
|
3712
|
+
k && (m.current = k), y(k);
|
|
3712
3713
|
},
|
|
3713
|
-
class:
|
|
3714
|
+
class: Ge({
|
|
3714
3715
|
optional: e.config.optional,
|
|
3715
3716
|
className: "min-w-0 flex-1 rounded-r-full"
|
|
3716
3717
|
}),
|
|
3717
3718
|
placeholder: e.config.placeholder
|
|
3718
|
-
}), e.config.optional && c(
|
|
3719
|
+
}), e.config.optional && c(Le, {
|
|
3719
3720
|
class: "absolute bottom-0 right-1 top-0",
|
|
3720
3721
|
onClick: () => r(null)
|
|
3721
3722
|
})]
|
|
3722
3723
|
}), c($e, {})]
|
|
3723
|
-
}), c(
|
|
3724
|
+
}), c(Xe, {
|
|
3724
3725
|
error: f.countryCode || f.phoneNumber || {
|
|
3725
3726
|
message: s
|
|
3726
3727
|
}
|
|
3727
3728
|
})]
|
|
3728
3729
|
});
|
|
3729
|
-
}, yt = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)),
|
|
3730
|
-
time:
|
|
3730
|
+
}, yt = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)), Dr = (e, r, t, n) => t !== void 0 && n * 1e3 > qr ? e("submission_available_at", {
|
|
3731
|
+
time: Pr(t, r)
|
|
3731
3732
|
}) : e("submission_cooldown", {
|
|
3732
3733
|
count: n
|
|
3733
|
-
}),
|
|
3734
|
+
}), di = ({
|
|
3734
3735
|
input: e,
|
|
3735
3736
|
onSubmitSuccess: r
|
|
3736
3737
|
}) => {
|
|
3737
3738
|
const {
|
|
3738
3739
|
t,
|
|
3739
3740
|
locale: n
|
|
3740
|
-
} =
|
|
3741
|
+
} = te(), {
|
|
3741
3742
|
availableAt: s
|
|
3742
3743
|
} = e.config, [i, a] = we(() => yt(s)), [o, u] = we("");
|
|
3743
3744
|
Ur(() => {
|
|
3744
|
-
const
|
|
3745
|
-
if (a(
|
|
3745
|
+
const g = yt(s);
|
|
3746
|
+
if (a(g), g === 0)
|
|
3746
3747
|
return;
|
|
3747
|
-
u(
|
|
3748
|
+
u(Dr(t, n, s, g));
|
|
3748
3749
|
const y = setInterval(() => {
|
|
3749
3750
|
const p = yt(s);
|
|
3750
3751
|
a(p), !(p > 0) && (clearInterval(y), u(t("submission_cooldown_ready")));
|
|
@@ -3786,16 +3787,16 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3786
3787
|
id: "submit-cooldown",
|
|
3787
3788
|
"aria-hidden": "true",
|
|
3788
3789
|
class: "text-neutral-11 text-xs",
|
|
3789
|
-
children:
|
|
3790
|
+
children: Dr(t, n, s, i)
|
|
3790
3791
|
}), c("p", {
|
|
3791
3792
|
role: "status",
|
|
3792
3793
|
class: "sr-only",
|
|
3793
3794
|
children: o
|
|
3794
3795
|
})]
|
|
3795
3796
|
});
|
|
3796
|
-
},
|
|
3797
|
-
e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight,
|
|
3798
|
-
},
|
|
3797
|
+
}, fi = 160, Tr = (e) => {
|
|
3798
|
+
e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, fi)}px`;
|
|
3799
|
+
}, hi = {
|
|
3799
3800
|
date: {
|
|
3800
3801
|
type: "date",
|
|
3801
3802
|
inputMode: "text"
|
|
@@ -3814,7 +3815,7 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3814
3815
|
inputMode: "url",
|
|
3815
3816
|
formNoValidate: !0
|
|
3816
3817
|
}
|
|
3817
|
-
},
|
|
3818
|
+
}, pi = Ze("string"), mi = (e, r) => {
|
|
3818
3819
|
const t = {
|
|
3819
3820
|
maxLength: r("validation_max_chars", {
|
|
3820
3821
|
count: e.maxChars ?? 999
|
|
@@ -3825,20 +3826,20 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3825
3826
|
};
|
|
3826
3827
|
return St(/* @__PURE__ */ _e({
|
|
3827
3828
|
text: {
|
|
3828
|
-
date: /* @__PURE__ */
|
|
3829
|
-
email: /* @__PURE__ */
|
|
3830
|
-
text: /* @__PURE__ */
|
|
3831
|
-
url: /* @__PURE__ */
|
|
3829
|
+
date: /* @__PURE__ */ Ve(/* @__PURE__ */ ie(r("validation_date")), /* @__PURE__ */ zt(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
|
|
3830
|
+
email: /* @__PURE__ */ Ve(/* @__PURE__ */ ie(r("validation_email")), /* @__PURE__ */ Yr(r("validation_email")), /* @__PURE__ */ We(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ct(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
3831
|
+
text: /* @__PURE__ */ Ve(/* @__PURE__ */ ie(), /* @__PURE__ */ We(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ct(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
3832
|
+
url: /* @__PURE__ */ Ve(/* @__PURE__ */ ie(r("validation_url")), /* @__PURE__ */ tn(r("validation_url")), /* @__PURE__ */ We(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ct(e.maxChars ?? 1 / 0, t.maxLength))
|
|
3832
3833
|
}[e.format]
|
|
3833
3834
|
}));
|
|
3834
|
-
},
|
|
3835
|
+
}, yi = ({
|
|
3835
3836
|
input: e,
|
|
3836
3837
|
onSubmitSuccess: r
|
|
3837
3838
|
}) => {
|
|
3838
|
-
var
|
|
3839
|
+
var C;
|
|
3839
3840
|
const {
|
|
3840
3841
|
t
|
|
3841
|
-
} =
|
|
3842
|
+
} = te(), n = e.key ? (C = P.current$.value.flow) == null ? void 0 : C.data.submissions[e.key] : void 0, s = e.config.defaultValue, i = e.config.multiline === !0 && e.config.format === "text", {
|
|
3842
3843
|
register: a,
|
|
3843
3844
|
handleSubmit: o,
|
|
3844
3845
|
watch: u,
|
|
@@ -3847,26 +3848,26 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3847
3848
|
}
|
|
3848
3849
|
} = Ct({
|
|
3849
3850
|
defaultValues: {
|
|
3850
|
-
text:
|
|
3851
|
+
text: pi(n) ? n.value : s ?? ""
|
|
3851
3852
|
},
|
|
3852
|
-
resolver:
|
|
3853
|
+
resolver: mi(e.config, t)
|
|
3853
3854
|
}), {
|
|
3854
|
-
ref:
|
|
3855
|
+
ref: g,
|
|
3855
3856
|
...y
|
|
3856
3857
|
} = a("text", {
|
|
3857
3858
|
required: !e.config.optional
|
|
3858
3859
|
}), p = ye();
|
|
3859
|
-
|
|
3860
|
-
p.current && (p.current instanceof HTMLTextAreaElement &&
|
|
3860
|
+
Me(() => {
|
|
3861
|
+
p.current && (p.current instanceof HTMLTextAreaElement && Tr(p.current), p.current.focus(), p.current.select());
|
|
3861
3862
|
}, []);
|
|
3862
|
-
const m = e.config.maxChars,
|
|
3863
|
+
const m = e.config.maxChars, _ = i && m !== void 0 ? u("text").length : void 0;
|
|
3863
3864
|
return c("form", {
|
|
3864
3865
|
noValidate: !0,
|
|
3865
3866
|
class: "flex flex-col gap-1 p-2.5",
|
|
3866
|
-
onSubmit: o((
|
|
3867
|
+
onSubmit: o((k) => {
|
|
3867
3868
|
r({
|
|
3868
3869
|
type: "string",
|
|
3869
|
-
value:
|
|
3870
|
+
value: k.text
|
|
3870
3871
|
});
|
|
3871
3872
|
}),
|
|
3872
3873
|
children: [c("div", {
|
|
@@ -3879,68 +3880,68 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3879
3880
|
rows: 2,
|
|
3880
3881
|
maxLength: m,
|
|
3881
3882
|
autoFocus: !0,
|
|
3882
|
-
"aria-describedby":
|
|
3883
|
-
onInput: (
|
|
3884
|
-
onKeyDown: (
|
|
3885
|
-
var
|
|
3886
|
-
|
|
3883
|
+
"aria-describedby": _ !== void 0 ? "chat-input-count" : void 0,
|
|
3884
|
+
onInput: (k) => Tr(k.currentTarget),
|
|
3885
|
+
onKeyDown: (k) => {
|
|
3886
|
+
var A;
|
|
3887
|
+
k.key === "Enter" && (k.ctrlKey || k.metaKey) && (k.preventDefault(), (A = k.currentTarget.form) == null || A.requestSubmit());
|
|
3887
3888
|
},
|
|
3888
|
-
ref: (
|
|
3889
|
-
|
|
3889
|
+
ref: (k) => {
|
|
3890
|
+
k && (p.current = k), g(k);
|
|
3890
3891
|
},
|
|
3891
3892
|
placeholder: e.config.placeholder,
|
|
3892
|
-
class:
|
|
3893
|
+
class: Ge({
|
|
3893
3894
|
optional: !!e.config.optional,
|
|
3894
3895
|
className: "block w-full resize-none overflow-y-auto rounded-2xl"
|
|
3895
3896
|
})
|
|
3896
3897
|
}) : c("input", {
|
|
3897
3898
|
id: "chat-input",
|
|
3898
3899
|
...y,
|
|
3899
|
-
...
|
|
3900
|
+
...hi[e.config.format],
|
|
3900
3901
|
autocomplete: "off",
|
|
3901
3902
|
autoCapitalize: "off",
|
|
3902
3903
|
autoCorrect: "off",
|
|
3903
3904
|
autoFocus: !0,
|
|
3904
|
-
ref: (
|
|
3905
|
-
|
|
3905
|
+
ref: (k) => {
|
|
3906
|
+
k && (p.current = k), g(k);
|
|
3906
3907
|
},
|
|
3907
3908
|
placeholder: e.config.placeholder,
|
|
3908
|
-
class:
|
|
3909
|
+
class: Ge({
|
|
3909
3910
|
optional: !!e.config.optional,
|
|
3910
3911
|
className: "w-full rounded-full"
|
|
3911
3912
|
})
|
|
3912
3913
|
}), e.config.optional && c(
|
|
3913
|
-
|
|
3914
|
+
Le,
|
|
3914
3915
|
{
|
|
3915
3916
|
class: i ? "absolute bottom-1 right-0.5" : "absolute bottom-0 right-0.5 top-0",
|
|
3916
3917
|
onClick: () => r(null)
|
|
3917
3918
|
}
|
|
3918
3919
|
)]
|
|
3919
3920
|
}), c($e, {})]
|
|
3920
|
-
}),
|
|
3921
|
+
}), _ !== void 0 && m !== void 0 && c("p", {
|
|
3921
3922
|
id: "chat-input-count",
|
|
3922
3923
|
class: "text-neutral-10 px-3 text-right text-xs",
|
|
3923
|
-
children: [
|
|
3924
|
-
}), c(
|
|
3924
|
+
children: [_, "/", m]
|
|
3925
|
+
}), c(Xe, {
|
|
3925
3926
|
error: f.text
|
|
3926
3927
|
})]
|
|
3927
3928
|
});
|
|
3928
|
-
},
|
|
3929
|
-
text:
|
|
3930
|
-
phone:
|
|
3931
|
-
"multiple-choice":
|
|
3932
|
-
boolean:
|
|
3933
|
-
file:
|
|
3934
|
-
submit:
|
|
3935
|
-
address:
|
|
3936
|
-
number:
|
|
3937
|
-
},
|
|
3929
|
+
}, bi = {
|
|
3930
|
+
text: yi,
|
|
3931
|
+
phone: ui,
|
|
3932
|
+
"multiple-choice": ei,
|
|
3933
|
+
boolean: ba,
|
|
3934
|
+
file: Ca,
|
|
3935
|
+
submit: di,
|
|
3936
|
+
address: ha,
|
|
3937
|
+
number: ni
|
|
3938
|
+
}, gi = ({
|
|
3938
3939
|
logger: e,
|
|
3939
3940
|
analytics: r
|
|
3940
3941
|
}) => {
|
|
3941
3942
|
var i;
|
|
3942
|
-
const t = (i =
|
|
3943
|
-
return
|
|
3943
|
+
const t = (i = P.current$.value.flow) == null ? void 0 : i.data.currentInput, n = ye(null), s = () => le.onInteractionFn$.value();
|
|
3944
|
+
return Me(() => {
|
|
3944
3945
|
var a;
|
|
3945
3946
|
(a = n.current) == null || a.scrollTo({
|
|
3946
3947
|
top: 0
|
|
@@ -3953,11 +3954,11 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3953
3954
|
onPointerDownCapture: t ? s : void 0,
|
|
3954
3955
|
onKeyDownCapture: t ? s : void 0,
|
|
3955
3956
|
children: t ? (() => {
|
|
3956
|
-
const a =
|
|
3957
|
+
const a = bi[t.type];
|
|
3957
3958
|
return c(a, {
|
|
3958
3959
|
logger: e,
|
|
3959
3960
|
analytics: r,
|
|
3960
|
-
onSubmitSuccess:
|
|
3961
|
+
onSubmitSuccess: le.onSubmitSuccessFn$.value,
|
|
3961
3962
|
input: t
|
|
3962
3963
|
});
|
|
3963
3964
|
})() : c("div", {
|
|
@@ -3965,7 +3966,7 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3965
3966
|
children: [c("input", {
|
|
3966
3967
|
"aria-hidden": "true",
|
|
3967
3968
|
id: "chat-input",
|
|
3968
|
-
class:
|
|
3969
|
+
class: Ge({
|
|
3969
3970
|
optional: !1,
|
|
3970
3971
|
className: "flex-grow rounded-full"
|
|
3971
3972
|
}),
|
|
@@ -3979,30 +3980,30 @@ const Vr = 27, Mr = 12, Lr = 10, Ja = Xe("enum"), Za = (e, r) => {
|
|
|
3979
3980
|
})
|
|
3980
3981
|
});
|
|
3981
3982
|
};
|
|
3982
|
-
function
|
|
3983
|
+
function vi(e) {
|
|
3983
3984
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3984
3985
|
}
|
|
3985
|
-
var
|
|
3986
|
+
var xi = function(e) {
|
|
3986
3987
|
return e instanceof RegExp;
|
|
3987
|
-
},
|
|
3988
|
+
}, wi = function(r) {
|
|
3988
3989
|
var t = /[\\^$.*+?()[\]{}|]/g, n = RegExp(t.source);
|
|
3989
3990
|
return r && n.test(r) ? r.replace(t, "\\$&") : r;
|
|
3990
3991
|
}, wn = function(e) {
|
|
3991
3992
|
return typeof e == "string";
|
|
3992
|
-
},
|
|
3993
|
+
}, _i = function(e) {
|
|
3993
3994
|
var r = [];
|
|
3994
3995
|
return e.forEach(function(t) {
|
|
3995
3996
|
Array.isArray(t) ? r = r.concat(t) : r.push(t);
|
|
3996
3997
|
}), r;
|
|
3997
3998
|
};
|
|
3998
|
-
function
|
|
3999
|
+
function ki(e, r, t) {
|
|
3999
4000
|
var n = 0, s = 0;
|
|
4000
4001
|
if (e === "")
|
|
4001
4002
|
return e;
|
|
4002
4003
|
if (!e || !wn(e))
|
|
4003
4004
|
throw new TypeError("First argument to react-string-replace#replaceString must be a string");
|
|
4004
4005
|
var i = r;
|
|
4005
|
-
|
|
4006
|
+
xi(i) || (i = new RegExp("(" + wi(i) + ")", "gi"));
|
|
4006
4007
|
for (var a = e.split(i), o = 1, u = a.length; o < u; o += 2) {
|
|
4007
4008
|
if (a[o] === void 0 || a[o - 1] === void 0) {
|
|
4008
4009
|
console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
|
|
@@ -4012,33 +4013,33 @@ function wi(e, r, t) {
|
|
|
4012
4013
|
}
|
|
4013
4014
|
return a;
|
|
4014
4015
|
}
|
|
4015
|
-
var
|
|
4016
|
-
return Array.isArray(r) || (r = [r]),
|
|
4017
|
-
return wn(s) ?
|
|
4016
|
+
var Ci = function(r, t, n) {
|
|
4017
|
+
return Array.isArray(r) || (r = [r]), _i(r.map(function(s) {
|
|
4018
|
+
return wn(s) ? ki(s, t, n) : s;
|
|
4018
4019
|
}));
|
|
4019
4020
|
};
|
|
4020
|
-
const
|
|
4021
|
-
const r =
|
|
4022
|
-
const [, f,
|
|
4023
|
-
return
|
|
4024
|
-
class:
|
|
4025
|
-
href:
|
|
4026
|
-
children: f ??
|
|
4027
|
-
},
|
|
4021
|
+
const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ai = /\[([^\]]+)\]\(([^)]+)\)/, Ii = /(https?:\/\/[^\s]+)/g, Ei = /_(.*?)_/g, Fi = /\*\*(.*?)\*\*/g, Vi = /(\\n|\n)/g, Nr = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Mi = (e) => {
|
|
4022
|
+
const r = ot(e, Si, (o, u) => {
|
|
4023
|
+
const [, f, g] = o.match(Ai) ?? [];
|
|
4024
|
+
return g ? c("a", {
|
|
4025
|
+
class: Nr,
|
|
4026
|
+
href: g,
|
|
4027
|
+
children: f ?? g
|
|
4028
|
+
}, g + u) : c("span", {
|
|
4028
4029
|
children: "INVALID LINK"
|
|
4029
4030
|
});
|
|
4030
|
-
}), t =
|
|
4031
|
-
class:
|
|
4031
|
+
}), t = ot(r, Ii, (o, u) => c("a", {
|
|
4032
|
+
class: Nr,
|
|
4032
4033
|
href: o,
|
|
4033
4034
|
children: o
|
|
4034
|
-
}, o + u)), n =
|
|
4035
|
+
}, o + u)), n = ot(t, Ei, (o, u) => c("em", {
|
|
4035
4036
|
children: o
|
|
4036
|
-
}, o + u)), s =
|
|
4037
|
+
}, o + u)), s = ot(n, Fi, (o, u) => c("strong", {
|
|
4037
4038
|
children: o
|
|
4038
4039
|
}, o + u));
|
|
4039
4040
|
let i = 0;
|
|
4040
|
-
return
|
|
4041
|
-
},
|
|
4041
|
+
return ot(s, Vi, () => c("br", {}, `br-${i++}`));
|
|
4042
|
+
}, Li = 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", {
|
|
4042
4043
|
variants: {
|
|
4043
4044
|
side: {
|
|
4044
4045
|
left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
|
|
@@ -4052,7 +4053,7 @@ const st = /* @__PURE__ */ bi(_i), ki = /(\[[^\]]+\]\([^)]+\))/g, Ci = /\[([^\]]
|
|
|
4052
4053
|
defaultVariants: {
|
|
4053
4054
|
side: "left"
|
|
4054
4055
|
}
|
|
4055
|
-
}),
|
|
4056
|
+
}), Ri = ({
|
|
4056
4057
|
children: e,
|
|
4057
4058
|
className: r,
|
|
4058
4059
|
animate: t,
|
|
@@ -4062,14 +4063,14 @@ const st = /* @__PURE__ */ bi(_i), ki = /(\[[^\]]+\]\([^)]+\))/g, Ci = /\[([^\]]
|
|
|
4062
4063
|
style: {
|
|
4063
4064
|
transformOrigin: n === "left" ? "0% 50%" : "100% 50%"
|
|
4064
4065
|
},
|
|
4065
|
-
class:
|
|
4066
|
+
class: Li({
|
|
4066
4067
|
className: r,
|
|
4067
4068
|
side: n,
|
|
4068
4069
|
animate: t
|
|
4069
4070
|
}),
|
|
4070
4071
|
...s,
|
|
4071
4072
|
children: e
|
|
4072
|
-
}),
|
|
4073
|
+
}), Di = ({
|
|
4073
4074
|
message: e
|
|
4074
4075
|
}) => c("div", {
|
|
4075
4076
|
class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
|
|
@@ -4093,14 +4094,14 @@ const st = /* @__PURE__ */ bi(_i), ki = /(\[[^\]]+\]\([^)]+\))/g, Ci = /\[([^\]]
|
|
|
4093
4094
|
})
|
|
4094
4095
|
})]
|
|
4095
4096
|
})
|
|
4096
|
-
}),
|
|
4097
|
+
}), Ti = ({
|
|
4097
4098
|
className: e,
|
|
4098
4099
|
...r
|
|
4099
4100
|
}) => c("div", {
|
|
4100
4101
|
"aria-hidden": !0,
|
|
4101
|
-
children:
|
|
4102
|
+
children: le.isBotTyping$.value === !0 ? c("div", {
|
|
4102
4103
|
"data-testid": "typing-indicator",
|
|
4103
|
-
class:
|
|
4104
|
+
class: Je("flex gap-1 p-4", e),
|
|
4104
4105
|
...r,
|
|
4105
4106
|
children: Array.from({
|
|
4106
4107
|
length: 3
|
|
@@ -4111,10 +4112,10 @@ const st = /* @__PURE__ */ bi(_i), ki = /(\[[^\]]+\]\([^)]+\))/g, Ci = /\[([^\]]
|
|
|
4111
4112
|
}
|
|
4112
4113
|
}))
|
|
4113
4114
|
}) : void 0
|
|
4114
|
-
}),
|
|
4115
|
+
}), Ni = {
|
|
4115
4116
|
bot: "left",
|
|
4116
4117
|
user: "right"
|
|
4117
|
-
},
|
|
4118
|
+
}, Oi = 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)]", {
|
|
4118
4119
|
variants: {
|
|
4119
4120
|
variant: {
|
|
4120
4121
|
info: "text-neutral-11",
|
|
@@ -4123,12 +4124,12 @@ const st = /* @__PURE__ */ bi(_i), ki = /(\[[^\]]+\]\([^)]+\))/g, Ci = /\[([^\]]
|
|
|
4123
4124
|
success: "text-system-success"
|
|
4124
4125
|
}
|
|
4125
4126
|
}
|
|
4126
|
-
}),
|
|
4127
|
+
}), Bi = ({
|
|
4127
4128
|
lastSentMessageFooter: e
|
|
4128
4129
|
}) => {
|
|
4129
4130
|
const {
|
|
4130
4131
|
t: r
|
|
4131
|
-
} =
|
|
4132
|
+
} = te(), t = P.current$.value.flow, n = (t == null ? void 0 : t.data.messages) ?? [], s = t ? Ht(t) : void 0;
|
|
4132
4133
|
return c("ol", {
|
|
4133
4134
|
"aria-label": r("chat_messages"),
|
|
4134
4135
|
"aria-live": "polite",
|
|
@@ -4140,25 +4141,25 @@ const st = /* @__PURE__ */ bi(_i), ki = /(\[[^\]]+\]\([^)]+\))/g, Ci = /\[([^\]]
|
|
|
4140
4141
|
children: [s && i.groupId === s && !n.slice(a + 1).some((o) => o.groupId === s) ? e : null, zn(i).with({
|
|
4141
4142
|
type: "system"
|
|
4142
4143
|
}, (o) => c("p", {
|
|
4143
|
-
class:
|
|
4144
|
+
class: Oi({
|
|
4144
4145
|
variant: o.variant
|
|
4145
4146
|
}),
|
|
4146
4147
|
children: o.text
|
|
4147
4148
|
})).with({
|
|
4148
4149
|
type: "text",
|
|
4149
|
-
author:
|
|
4150
|
+
author: Wn.union("bot", "user")
|
|
4150
4151
|
}, (o) => {
|
|
4151
|
-
const u = a === n.length - 1, f = o.author === "bot" ?
|
|
4152
|
+
const u = a === n.length - 1, f = o.author === "bot" ? Mi(o.text) : o.text;
|
|
4152
4153
|
return c(ke, {
|
|
4153
|
-
children: c(
|
|
4154
|
+
children: c(Ri, {
|
|
4154
4155
|
animate: u,
|
|
4155
|
-
side:
|
|
4156
|
+
side: Ni[o.author],
|
|
4156
4157
|
children: f
|
|
4157
4158
|
}, a)
|
|
4158
4159
|
});
|
|
4159
4160
|
}).with({
|
|
4160
4161
|
type: "link"
|
|
4161
|
-
}, (o) => c(
|
|
4162
|
+
}, (o) => c(Di, {
|
|
4162
4163
|
message: o
|
|
4163
4164
|
})).with({
|
|
4164
4165
|
type: "image"
|
|
@@ -4170,7 +4171,7 @@ const st = /* @__PURE__ */ bi(_i), ki = /(\[[^\]]+\]\([^)]+\))/g, Ci = /\[([^\]]
|
|
|
4170
4171
|
}
|
|
4171
4172
|
})).with({
|
|
4172
4173
|
type: "file"
|
|
4173
|
-
}, (o) => c(
|
|
4174
|
+
}, (o) => c(xa, {
|
|
4174
4175
|
class: o.author === "bot" ? void 0 : "ml-auto",
|
|
4175
4176
|
file: {
|
|
4176
4177
|
name: o.fileName,
|
|
@@ -4180,7 +4181,7 @@ const st = /* @__PURE__ */ bi(_i), ki = /(\[[^\]]+\]\([^)]+\))/g, Ci = /\[([^\]]
|
|
|
4180
4181
|
type: "loading"
|
|
4181
4182
|
}, (o) => {
|
|
4182
4183
|
const u = n[n.length - 1];
|
|
4183
|
-
return !(o === u) ||
|
|
4184
|
+
return !(o === u) || le.isBotTyping$.value ? null : c("div", {
|
|
4184
4185
|
class: "flex flex-grow flex-col items-center justify-center gap-2",
|
|
4185
4186
|
children: [c(qt, {
|
|
4186
4187
|
"aria-hidden": o.text ? "true" : void 0,
|
|
@@ -4194,7 +4195,7 @@ const st = /* @__PURE__ */ bi(_i), ki = /(\[[^\]]+\]\([^)]+\))/g, Ci = /\[([^\]]
|
|
|
4194
4195
|
}).exhaustive()]
|
|
4195
4196
|
})
|
|
4196
4197
|
}, a)), c("li", {
|
|
4197
|
-
class:
|
|
4198
|
+
class: le.captchaVisible$.value ? "flex" : "hidden",
|
|
4198
4199
|
children: c("div", {
|
|
4199
4200
|
"data-captcha-slot": !0,
|
|
4200
4201
|
tabIndex: -1,
|
|
@@ -4202,9 +4203,9 @@ const st = /* @__PURE__ */ bi(_i), ki = /(\[[^\]]+\]\([^)]+\))/g, Ci = /\[([^\]]
|
|
|
4202
4203
|
"aria-label": r("captcha_check"),
|
|
4203
4204
|
class: "w-full max-w-[min(100%,24rem)] rounded-md"
|
|
4204
4205
|
})
|
|
4205
|
-
}, "captcha"), c(
|
|
4206
|
+
}, "captcha"), c(Ti, {}, "typing")]
|
|
4206
4207
|
});
|
|
4207
|
-
},
|
|
4208
|
+
}, Ui = ({
|
|
4208
4209
|
logger: e,
|
|
4209
4210
|
apiClient: r,
|
|
4210
4211
|
analytics: t,
|
|
@@ -4212,41 +4213,41 @@ const st = /* @__PURE__ */ bi(_i), ki = /(\[[^\]]+\]\([^)]+\))/g, Ci = /\[([^\]]
|
|
|
4212
4213
|
}) => {
|
|
4213
4214
|
const {
|
|
4214
4215
|
flow: s
|
|
4215
|
-
} =
|
|
4216
|
-
|
|
4217
|
-
const i =
|
|
4216
|
+
} = P.current$.value;
|
|
4217
|
+
Be(s, "Flow is required to exist to show chatbot body");
|
|
4218
|
+
const i = P.viewState$.value, {
|
|
4218
4219
|
chatRef: a,
|
|
4219
4220
|
chatService: o
|
|
4220
4221
|
} = Kn(), {
|
|
4221
4222
|
t: u
|
|
4222
|
-
} =
|
|
4223
|
-
return
|
|
4224
|
-
i === "maximised" &&
|
|
4225
|
-
}, [i]),
|
|
4226
|
-
var
|
|
4223
|
+
} = te(), [f, g] = we();
|
|
4224
|
+
return Me(() => {
|
|
4225
|
+
i === "maximised" && le.scrollToEnd();
|
|
4226
|
+
}, [i]), Me(() => {
|
|
4227
|
+
var R;
|
|
4227
4228
|
const {
|
|
4228
4229
|
state: y,
|
|
4229
4230
|
flow: p
|
|
4230
|
-
} =
|
|
4231
|
+
} = P.current$.peek();
|
|
4231
4232
|
if (y !== "loaded")
|
|
4232
4233
|
throw new Error(u("invalid_state"));
|
|
4233
4234
|
let m = p.data.nodeHistory.at(-1);
|
|
4234
|
-
if (
|
|
4235
|
+
if (le.scrollToEnd(), P.setInput(void 0), p.data.isFinished)
|
|
4235
4236
|
return;
|
|
4236
|
-
const
|
|
4237
|
-
const
|
|
4238
|
-
!
|
|
4237
|
+
const _ = () => {
|
|
4238
|
+
const O = P.current$.peek().flow;
|
|
4239
|
+
!O || O.data.hasInteracted || (P.markAsInteracted(), ur(t, O, "FLOW_INTERACT"));
|
|
4239
4240
|
};
|
|
4240
|
-
|
|
4241
|
+
le.onInteractionFn$.value = _, m === void 0 ? (m = Kr(s.nodes).id, P.setCurrentNodeId(m), ur(t, p, "FLOW_START")) : P.removeMessagesSentByNodeIds([m, $t]);
|
|
4241
4242
|
const {
|
|
4242
|
-
interpret:
|
|
4243
|
-
abort:
|
|
4244
|
-
undo:
|
|
4243
|
+
interpret: C,
|
|
4244
|
+
abort: k,
|
|
4245
|
+
undo: A
|
|
4245
4246
|
} = ks({
|
|
4246
4247
|
context: s.context,
|
|
4247
4248
|
analytics: {
|
|
4248
4249
|
service: t,
|
|
4249
|
-
customProperties: (
|
|
4250
|
+
customProperties: (R = s.analytics) == null ? void 0 : R.customProperties
|
|
4250
4251
|
},
|
|
4251
4252
|
apiClient: r,
|
|
4252
4253
|
logger: e,
|
|
@@ -4255,45 +4256,45 @@ const st = /* @__PURE__ */ bi(_i), ki = /(\[[^\]]+\]\([^)]+\))/g, Ci = /\[([^\]]
|
|
|
4255
4256
|
chatService: o,
|
|
4256
4257
|
t: u,
|
|
4257
4258
|
getApplicationRecovery: () => {
|
|
4258
|
-
var
|
|
4259
|
-
return (
|
|
4259
|
+
var O;
|
|
4260
|
+
return (O = P.current$.peek().flow) == null ? void 0 : O.data.applicationRecovery;
|
|
4260
4261
|
},
|
|
4261
|
-
setApplicationRecovery:
|
|
4262
|
-
persistWriteBarrier: () =>
|
|
4262
|
+
setApplicationRecovery: P.setApplicationRecovery,
|
|
4263
|
+
persistWriteBarrier: () => P.persistWriteBarrier(p),
|
|
4263
4264
|
// We need to get fresh submissions, that’s why we call `peek` here.
|
|
4264
4265
|
getSubmissions: () => {
|
|
4265
|
-
var
|
|
4266
|
-
return (
|
|
4266
|
+
var O;
|
|
4267
|
+
return (O = P.current$.peek().flow) == null ? void 0 : O.data.submissions;
|
|
4267
4268
|
},
|
|
4268
|
-
onInterpret: (
|
|
4269
|
+
onInterpret: (O) => P.setCurrentNodeId(O.id),
|
|
4269
4270
|
onFlowEnd: async () => {
|
|
4270
|
-
var
|
|
4271
|
-
|
|
4272
|
-
const
|
|
4273
|
-
|
|
4271
|
+
var q;
|
|
4272
|
+
P.markAsFinished();
|
|
4273
|
+
const O = P.current$.peek().flow;
|
|
4274
|
+
Be(O), t.log({
|
|
4274
4275
|
event: "FLOW_END",
|
|
4275
4276
|
properties: {
|
|
4276
4277
|
flow_id: s.id,
|
|
4277
4278
|
flow_version: s.version,
|
|
4278
|
-
flow_session_id:
|
|
4279
|
+
flow_session_id: O.data.flowSessionId,
|
|
4279
4280
|
flow_build: s.build,
|
|
4280
4281
|
job: s.job
|
|
4281
4282
|
},
|
|
4282
|
-
customProperties: (
|
|
4283
|
+
customProperties: (q = s.analytics) == null ? void 0 : q.customProperties
|
|
4283
4284
|
});
|
|
4284
4285
|
}
|
|
4285
|
-
}),
|
|
4286
|
-
|
|
4287
|
-
},
|
|
4288
|
-
return p.offerResume ?
|
|
4286
|
+
}), b = m, V = () => {
|
|
4287
|
+
g(() => A), C(b);
|
|
4288
|
+
}, F = new AbortController();
|
|
4289
|
+
return p.offerResume ? Gs({
|
|
4289
4290
|
chatService: o,
|
|
4290
4291
|
t: u,
|
|
4291
|
-
signal:
|
|
4292
|
-
}).then((
|
|
4293
|
-
|
|
4294
|
-
}) :
|
|
4295
|
-
|
|
4296
|
-
}),
|
|
4292
|
+
signal: F.signal
|
|
4293
|
+
}).then((O) => (P.settleResume(p), O ? V() : (P.restart(), Gn.flushStateData()))).catch((O) => {
|
|
4294
|
+
O instanceof $r || e.error("Resume prompt failed", O);
|
|
4295
|
+
}) : V(), () => {
|
|
4296
|
+
F.abort(), le.onInteractionFn$.value === _ && (le.onInteractionFn$.value = () => {
|
|
4297
|
+
}), k();
|
|
4297
4298
|
};
|
|
4298
4299
|
}, [t, r, o, e, s, n, u]), c(ke, {
|
|
4299
4300
|
children: [c("div", {
|
|
@@ -4307,36 +4308,36 @@ const st = /* @__PURE__ */ bi(_i), ki = /(\[[^\]]+\]\([^)]+\))/g, Ci = /\[([^\]]
|
|
|
4307
4308
|
style: {
|
|
4308
4309
|
WebkitOverflowScrolling: "touch"
|
|
4309
4310
|
},
|
|
4310
|
-
children: c(
|
|
4311
|
-
lastSentMessageFooter: !
|
|
4311
|
+
children: c(Bi, {
|
|
4312
|
+
lastSentMessageFooter: !Ht(s) || !f ? null : c($i, {
|
|
4312
4313
|
undoFn: f
|
|
4313
4314
|
})
|
|
4314
4315
|
})
|
|
4315
|
-
}),
|
|
4316
|
+
}), le.isReadingHistory$.value && !s.data.isFinished && !le.isBotTyping$.value && c("div", {
|
|
4316
4317
|
class: "absolute bottom-2 left-1/2 -translate-x-1/2",
|
|
4317
4318
|
children: c(zr, {
|
|
4318
4319
|
class: "bg-neutral-1 ring-divider shadow-surface-md ring-1",
|
|
4319
4320
|
"aria-label": u("jump_to_current"),
|
|
4320
4321
|
onClick: () => {
|
|
4321
4322
|
var p, m;
|
|
4322
|
-
|
|
4323
|
+
le.scrollToEnd(), (m = ((p = a.current) == null ? void 0 : p.querySelector('li[tabindex="-1"]')) ?? a.current) == null || m.focus({
|
|
4323
4324
|
preventScroll: !0
|
|
4324
4325
|
});
|
|
4325
4326
|
},
|
|
4326
4327
|
children: c(Jn, {})
|
|
4327
4328
|
})
|
|
4328
4329
|
})]
|
|
4329
|
-
}), c(
|
|
4330
|
+
}), c(gi, {
|
|
4330
4331
|
logger: e,
|
|
4331
4332
|
analytics: t
|
|
4332
4333
|
})]
|
|
4333
4334
|
});
|
|
4334
|
-
},
|
|
4335
|
+
}, $i = ({
|
|
4335
4336
|
undoFn: e
|
|
4336
4337
|
}) => {
|
|
4337
4338
|
const {
|
|
4338
4339
|
t: r
|
|
4339
|
-
} =
|
|
4340
|
+
} = te();
|
|
4340
4341
|
return c("div", {
|
|
4341
4342
|
class: "flex flex-1 items-center justify-end px-1",
|
|
4342
4343
|
children: c(zr, {
|
|
@@ -4344,8 +4345,8 @@ const st = /* @__PURE__ */ bi(_i), ki = /(\[[^\]]+\]\([^)]+\))/g, Ci = /\[([^\]]
|
|
|
4344
4345
|
onClick: async () => {
|
|
4345
4346
|
const {
|
|
4346
4347
|
flow: t
|
|
4347
|
-
} =
|
|
4348
|
-
|
|
4348
|
+
} = P.current$.peek();
|
|
4349
|
+
Be(t), e(t.data.nodeHistory);
|
|
4349
4350
|
},
|
|
4350
4351
|
children: c("path", {
|
|
4351
4352
|
d: "M3 13h2.67l6.66-6.67a1.9 1.9 0 0 0 0-2.66 1.91 1.91 0 0 0-2.66 0L3 10.33V13Zm4.6-7.25 2.67 2.67"
|
|
@@ -4354,5 +4355,5 @@ const st = /* @__PURE__ */ bi(_i), ki = /(\[[^\]]+\]\([^)]+\))/g, Ci = /\[([^\]]
|
|
|
4354
4355
|
});
|
|
4355
4356
|
};
|
|
4356
4357
|
export {
|
|
4357
|
-
|
|
4358
|
+
Ui as ChatbotBody
|
|
4358
4359
|
};
|