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