@inploi/plugin-chatbot 14.0.1 → 14.1.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 +4 -4
- package/dist/{chatbot-body-77c91e40.js → chatbot-body-4bed3e94.js} +796 -782
- package/dist/chatbot-body-9328c4b7.cjs +5 -0
- package/dist/i18n.d.ts +6 -0
- package/dist/index-56ea6372.cjs +5 -0
- package/dist/{index-21fc767e.js → index-b60fcc82.js} +2 -1
- package/dist/interpreter.d.ts +2 -0
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/package.json +3 -3
- package/dist/chatbot-body-a078e4eb.cjs +0 -5
- package/dist/index-bc9b2b2e.cjs +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as ur, B as Je, S as ct, V as Pe, g as cr, a as
|
|
2
|
-
import { ApiError as
|
|
1
|
+
import { D as ur, B as Je, S as ct, V as Pe, g as cr, a as pt, z as Xr, A as Yr, M as Qr, R as es, k as dr, E as ts, $ as rs, H as ss, K as ns, u as ne, o as u, c as Me, b as Ze, h as _e, _ as ue, i as Ce, y as xe, d as me, L as ht, F as is, s as P, p as as, e as fr, f as os, j as Ne, U as ls, C as Q, l as ie, m as us, n as cs, q as ds, r as pr, t as fs } from "./index-b60fcc82.js";
|
|
2
|
+
import { ApiError as ps, isApiErrorWithData as hs } from "@inploi/sdk";
|
|
3
3
|
const Ot = (e, r, t) => {
|
|
4
4
|
var s;
|
|
5
5
|
return e.log({
|
|
@@ -49,7 +49,7 @@ var Rt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
|
49
49
|
case "number":
|
|
50
50
|
return je(d, { submissions: { _temp: { value: o, type: "number" } }, context: r });
|
|
51
51
|
case "object":
|
|
52
|
-
return Array.isArray(o) && o.every((
|
|
52
|
+
return Array.isArray(o) && o.every((h) => typeof h == "string") ? je(d, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
|
|
53
53
|
}
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
@@ -134,11 +134,11 @@ var Rt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
|
134
134
|
case "boolean":
|
|
135
135
|
return d.value === !0 ? "true" : "false";
|
|
136
136
|
case "file":
|
|
137
|
-
return d.value.map((
|
|
137
|
+
return d.value.map((h) => `${h.name} (${Pe(h.sizeKb)})`).join(", ");
|
|
138
138
|
case "enum":
|
|
139
139
|
return d.value.join(", ");
|
|
140
140
|
case "address":
|
|
141
|
-
return Object.values(d.value).filter((
|
|
141
|
+
return Object.values(d.value).filter((h) => h && h.trim().length > 0).join(", ");
|
|
142
142
|
case "number":
|
|
143
143
|
case "string":
|
|
144
144
|
return d.value ? d.value.toString() : a;
|
|
@@ -147,30 +147,30 @@ var Rt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
|
147
147
|
case "integration": {
|
|
148
148
|
if (typeof d.value != "object" || Array.isArray(d.value))
|
|
149
149
|
break;
|
|
150
|
-
let
|
|
151
|
-
switch (typeof
|
|
150
|
+
let h = ct(d.value, o);
|
|
151
|
+
switch (typeof h) {
|
|
152
152
|
case "boolean":
|
|
153
|
-
return
|
|
153
|
+
return h === !0 ? "true" : "false";
|
|
154
154
|
case "string":
|
|
155
|
-
return
|
|
155
|
+
return h;
|
|
156
156
|
case "number":
|
|
157
|
-
return
|
|
157
|
+
return h.toString();
|
|
158
158
|
case "object":
|
|
159
|
-
if (Array.isArray(
|
|
160
|
-
return
|
|
159
|
+
if (Array.isArray(h) && h.every((v) => typeof v == "string"))
|
|
160
|
+
return h.join(", ");
|
|
161
161
|
}
|
|
162
162
|
break;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
return a;
|
|
166
166
|
});
|
|
167
|
-
const
|
|
167
|
+
const hr = ({
|
|
168
168
|
context: e,
|
|
169
169
|
submissions: r
|
|
170
170
|
}) => ({
|
|
171
171
|
context: e,
|
|
172
172
|
submissions: r ?? {}
|
|
173
|
-
}), ce = (e, r) => ms(e,
|
|
173
|
+
}), ce = (e, r) => ms(e, hr(r)), gs = (e, r) => je(e, hr(r)), yr = ({
|
|
174
174
|
node: e,
|
|
175
175
|
nodes: r,
|
|
176
176
|
stopWhen: t
|
|
@@ -213,22 +213,22 @@ const pr = ({
|
|
|
213
213
|
getSubmissions: n,
|
|
214
214
|
getApplicationRecovery: o,
|
|
215
215
|
setApplicationRecovery: d,
|
|
216
|
-
chatService:
|
|
216
|
+
chatService: h,
|
|
217
217
|
persistWriteBarrier: v,
|
|
218
218
|
onFlowEnd: x,
|
|
219
|
-
onInterpret:
|
|
219
|
+
onInterpret: p,
|
|
220
220
|
t: m
|
|
221
221
|
}) => {
|
|
222
222
|
var N;
|
|
223
223
|
let k = new AbortController();
|
|
224
224
|
(N = e.data).startedWriteNodeIds ?? (N.startedWriteNodeIds = e.nodes.flatMap((y) => {
|
|
225
|
-
var
|
|
225
|
+
var A, B;
|
|
226
226
|
if (y.type !== "integration-application-submit" || !e.data.nodeHistory.includes(y.id))
|
|
227
227
|
return [];
|
|
228
|
-
const C = y.data.key ? (
|
|
229
|
-
return (C == null ? void 0 : C.type) === "integration" && ((
|
|
228
|
+
const C = y.data.key ? (A = n()) == null ? void 0 : A[y.data.key] : void 0;
|
|
229
|
+
return (C == null ? void 0 : C.type) === "integration" && ((B = mr(C.value, void 0)) == null ? void 0 : B.verdict) === "not_submitted" ? [] : [y.id];
|
|
230
230
|
}));
|
|
231
|
-
const
|
|
231
|
+
const V = {
|
|
232
232
|
...r.service,
|
|
233
233
|
log: (y) => r.service.log({
|
|
234
234
|
...y,
|
|
@@ -237,101 +237,101 @@ const pr = ({
|
|
|
237
237
|
...r.customProperties
|
|
238
238
|
}
|
|
239
239
|
})
|
|
240
|
-
},
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
240
|
+
}, I = async (y, C) => {
|
|
241
|
+
const E = k.signal;
|
|
242
|
+
if (E.aborted)
|
|
243
243
|
return;
|
|
244
|
-
const
|
|
245
|
-
var
|
|
246
|
-
return
|
|
244
|
+
const A = n(), B = o(), J = (B == null ? void 0 : B.submitNodeId) === y.id ? e.nodes.find((D) => {
|
|
245
|
+
var $;
|
|
246
|
+
return D.id === B.fileQuestionNodeId && D.type === "question-file" && (($ = A == null ? void 0 : A[D.data.key]) == null ? void 0 : $.type) !== "file";
|
|
247
247
|
}) : void 0;
|
|
248
248
|
if (J)
|
|
249
|
-
return
|
|
250
|
-
|
|
249
|
+
return I(J, C);
|
|
250
|
+
p == null || p(y, C);
|
|
251
251
|
try {
|
|
252
252
|
await xs({
|
|
253
253
|
flow: e,
|
|
254
|
-
analytics:
|
|
254
|
+
analytics: V,
|
|
255
255
|
logger: t,
|
|
256
256
|
talentBankClient: s,
|
|
257
257
|
apiClient: a,
|
|
258
258
|
context: i,
|
|
259
259
|
node: y,
|
|
260
|
-
submissions:
|
|
261
|
-
applicationRecovery:
|
|
262
|
-
setApplicationRecovery: async (
|
|
263
|
-
if (!
|
|
260
|
+
submissions: A,
|
|
261
|
+
applicationRecovery: B,
|
|
262
|
+
setApplicationRecovery: async (D) => {
|
|
263
|
+
if (!E.aborted)
|
|
264
264
|
try {
|
|
265
|
-
await d(
|
|
266
|
-
} catch (
|
|
267
|
-
t.error("Failed to persist application recovery",
|
|
265
|
+
await d(D);
|
|
266
|
+
} catch ($) {
|
|
267
|
+
t.error("Failed to persist application recovery", $);
|
|
268
268
|
}
|
|
269
269
|
},
|
|
270
|
-
forceSubmitConfirmation: (
|
|
270
|
+
forceSubmitConfirmation: (B == null ? void 0 : B.submitNodeId) === y.id,
|
|
271
271
|
persistWriteBarrier: v,
|
|
272
|
-
signal:
|
|
272
|
+
signal: E,
|
|
273
273
|
t: m,
|
|
274
274
|
chat: {
|
|
275
|
-
sendMessage: async (
|
|
275
|
+
sendMessage: async (D) => h.send({
|
|
276
276
|
groupId: y.id,
|
|
277
|
-
message:
|
|
278
|
-
signal:
|
|
277
|
+
message: D,
|
|
278
|
+
signal: E
|
|
279
279
|
}),
|
|
280
|
-
userInput: async (
|
|
281
|
-
input:
|
|
282
|
-
signal:
|
|
280
|
+
userInput: async (D) => h.input({
|
|
281
|
+
input: D,
|
|
282
|
+
signal: E
|
|
283
283
|
}),
|
|
284
|
-
setSubmission: (
|
|
285
|
-
|
|
284
|
+
setSubmission: (D, $) => {
|
|
285
|
+
E.aborted || h.setSubmission(D, $);
|
|
286
286
|
}
|
|
287
287
|
},
|
|
288
|
-
next: (
|
|
289
|
-
if (
|
|
288
|
+
next: (D) => {
|
|
289
|
+
if (E.aborted)
|
|
290
290
|
return;
|
|
291
|
-
const
|
|
291
|
+
const $ = (B == null ? void 0 : B.fileQuestionNodeId) === y.id ? B.submitNodeId : D, F = $ ? e.nodes.find((H) => H.id === $) : bs({
|
|
292
292
|
childNode: y,
|
|
293
293
|
nodes: e.nodes
|
|
294
294
|
});
|
|
295
|
-
return
|
|
295
|
+
return F ? I(F, y) : x == null ? void 0 : x(y);
|
|
296
296
|
},
|
|
297
297
|
end: () => {
|
|
298
|
-
|
|
298
|
+
E.aborted || x == null || x(y);
|
|
299
299
|
}
|
|
300
300
|
});
|
|
301
|
-
} catch (
|
|
302
|
-
if (
|
|
301
|
+
} catch (D) {
|
|
302
|
+
if (D instanceof Yr)
|
|
303
303
|
return;
|
|
304
|
-
throw
|
|
304
|
+
throw D;
|
|
305
305
|
}
|
|
306
306
|
};
|
|
307
307
|
return {
|
|
308
308
|
interpret: async (y) => {
|
|
309
|
-
const C = e.nodes.find((
|
|
310
|
-
return
|
|
309
|
+
const C = e.nodes.find((E) => E.id === y) ?? cr(e.nodes);
|
|
310
|
+
return I(C);
|
|
311
311
|
},
|
|
312
312
|
undo: (y) => {
|
|
313
|
-
var
|
|
314
|
-
if ((
|
|
313
|
+
var $;
|
|
314
|
+
if (($ = e.data.startedWriteNodeIds) != null && $.length || e.data.isFinished)
|
|
315
315
|
return {
|
|
316
316
|
removed: 0
|
|
317
317
|
};
|
|
318
|
-
const C =
|
|
319
|
-
if (
|
|
318
|
+
const C = pt(e), E = C ? y.lastIndexOf(C) : -1, A = e.nodes.find((F) => F.id === C);
|
|
319
|
+
if (E === -1 || !A)
|
|
320
320
|
return {
|
|
321
321
|
removed: 0
|
|
322
322
|
};
|
|
323
|
-
const
|
|
323
|
+
const B = e.nodes.find((F) => F.id === y[y.length - 1]);
|
|
324
324
|
k.abort();
|
|
325
|
-
const J = y.splice(
|
|
326
|
-
e.data.messages = e.data.messages.filter((
|
|
327
|
-
const
|
|
328
|
-
for (const
|
|
329
|
-
const
|
|
330
|
-
if (!(!
|
|
331
|
-
for (const
|
|
332
|
-
typeof
|
|
325
|
+
const J = y.splice(E);
|
|
326
|
+
e.data.messages = e.data.messages.filter((F) => !F.groupId || !J.includes(F.groupId)), e.data.currentInput = null;
|
|
327
|
+
const D = n();
|
|
328
|
+
for (const F of J.slice(1)) {
|
|
329
|
+
const H = e.nodes.find((M) => M.id === F);
|
|
330
|
+
if (!(!H || !D || H.id === C) && ("key" in H.data && H.data.key && delete D[H.data.key], "keys" in H.data))
|
|
331
|
+
for (const M of Object.values(H.data.keys))
|
|
332
|
+
typeof M == "string" && delete D[M];
|
|
333
333
|
}
|
|
334
|
-
return k = new AbortController(),
|
|
334
|
+
return k = new AbortController(), I(A, B), {
|
|
335
335
|
removed: J.length
|
|
336
336
|
};
|
|
337
337
|
},
|
|
@@ -350,62 +350,62 @@ async function xs(e) {
|
|
|
350
350
|
text: r.data.title
|
|
351
351
|
}), e.next(r.nextId);
|
|
352
352
|
case "pre-apply-result":
|
|
353
|
-
return
|
|
353
|
+
return js({
|
|
354
354
|
...e,
|
|
355
355
|
node: r
|
|
356
356
|
});
|
|
357
357
|
case "text":
|
|
358
|
-
return
|
|
358
|
+
return As({
|
|
359
359
|
...e,
|
|
360
360
|
node: r
|
|
361
361
|
});
|
|
362
362
|
case "image":
|
|
363
|
-
return
|
|
363
|
+
return Es({
|
|
364
364
|
...e,
|
|
365
365
|
node: r
|
|
366
366
|
});
|
|
367
367
|
case "question-text":
|
|
368
|
-
return
|
|
368
|
+
return Ms({
|
|
369
369
|
...e,
|
|
370
370
|
node: r
|
|
371
371
|
});
|
|
372
372
|
case "question-enum":
|
|
373
|
-
return
|
|
373
|
+
return Ds({
|
|
374
374
|
...e,
|
|
375
375
|
node: r
|
|
376
376
|
});
|
|
377
377
|
case "question-number":
|
|
378
|
-
return
|
|
378
|
+
return Ns({
|
|
379
379
|
...e,
|
|
380
380
|
node: r
|
|
381
381
|
});
|
|
382
382
|
case "question-phone":
|
|
383
|
-
return
|
|
383
|
+
return Ls({
|
|
384
384
|
...e,
|
|
385
385
|
node: r
|
|
386
386
|
});
|
|
387
387
|
case "question-boolean":
|
|
388
|
-
return
|
|
388
|
+
return Ts({
|
|
389
389
|
...e,
|
|
390
390
|
node: r
|
|
391
391
|
});
|
|
392
392
|
case "question-file":
|
|
393
|
-
return
|
|
393
|
+
return Rs({
|
|
394
394
|
...e,
|
|
395
395
|
node: r
|
|
396
396
|
});
|
|
397
397
|
case "question-address":
|
|
398
|
-
return
|
|
398
|
+
return Os({
|
|
399
399
|
...e,
|
|
400
400
|
node: r
|
|
401
401
|
});
|
|
402
402
|
case "end-flow":
|
|
403
|
-
return
|
|
403
|
+
return Bs({
|
|
404
404
|
...e,
|
|
405
405
|
node: r
|
|
406
406
|
});
|
|
407
407
|
case "if-block":
|
|
408
|
-
return
|
|
408
|
+
return Fs({
|
|
409
409
|
...e,
|
|
410
410
|
node: r
|
|
411
411
|
});
|
|
@@ -415,12 +415,12 @@ async function xs(e) {
|
|
|
415
415
|
node: r
|
|
416
416
|
});
|
|
417
417
|
case "link":
|
|
418
|
-
return
|
|
418
|
+
return Vs({
|
|
419
419
|
...e,
|
|
420
420
|
node: r
|
|
421
421
|
});
|
|
422
422
|
case "integration-application-submit":
|
|
423
|
-
return
|
|
423
|
+
return Is({
|
|
424
424
|
...e,
|
|
425
425
|
node: r
|
|
426
426
|
});
|
|
@@ -465,15 +465,15 @@ async function _s({
|
|
|
465
465
|
isDuplicate: !1
|
|
466
466
|
};
|
|
467
467
|
if (s && t) {
|
|
468
|
-
const
|
|
469
|
-
if (r.data.scope === "company" ||
|
|
468
|
+
const h = r.data.scope === "job" ? (d = i.job) == null ? void 0 : d.id : void 0;
|
|
469
|
+
if (r.data.scope === "company" || h != null)
|
|
470
470
|
try {
|
|
471
471
|
o = await t.checkDuplicate({
|
|
472
472
|
email: Qr({
|
|
473
473
|
key: r.data.email,
|
|
474
474
|
submissions: s
|
|
475
475
|
}).toString(),
|
|
476
|
-
jobId:
|
|
476
|
+
jobId: h,
|
|
477
477
|
scope: r.data.scope
|
|
478
478
|
});
|
|
479
479
|
} catch (v) {
|
|
@@ -510,7 +510,8 @@ async function Cs({
|
|
|
510
510
|
})
|
|
511
511
|
}, e(r.nextId);
|
|
512
512
|
}
|
|
513
|
-
|
|
513
|
+
const Ss = 5e3;
|
|
514
|
+
async function Is({
|
|
514
515
|
chat: e,
|
|
515
516
|
next: r,
|
|
516
517
|
end: t,
|
|
@@ -520,22 +521,22 @@ async function Ss({
|
|
|
520
521
|
submissions: n,
|
|
521
522
|
analytics: o,
|
|
522
523
|
flow: d,
|
|
523
|
-
applicationRecovery:
|
|
524
|
+
applicationRecovery: h,
|
|
524
525
|
setApplicationRecovery: v,
|
|
525
526
|
forceSubmitConfirmation: x,
|
|
526
|
-
persistWriteBarrier:
|
|
527
|
+
persistWriteBarrier: p,
|
|
527
528
|
signal: m,
|
|
528
529
|
t: k
|
|
529
530
|
}) {
|
|
530
|
-
var
|
|
531
|
-
if ((
|
|
531
|
+
var I;
|
|
532
|
+
if ((I = d.data.startedWriteNodeIds) != null && I.includes(s.id) && (h == null ? void 0 : h.submitNodeId) !== s.id)
|
|
532
533
|
return await e.sendMessage({
|
|
533
534
|
type: "system",
|
|
534
535
|
variant: "warning",
|
|
535
536
|
text: k("submission_unknown")
|
|
536
537
|
}), t();
|
|
537
|
-
const
|
|
538
|
-
var
|
|
538
|
+
const V = async (N) => {
|
|
539
|
+
var H, M, T;
|
|
539
540
|
N !== !0 && await e.userInput({
|
|
540
541
|
type: "submit",
|
|
541
542
|
key: void 0,
|
|
@@ -552,11 +553,24 @@ async function Ss({
|
|
|
552
553
|
} = o.getSessionInfo();
|
|
553
554
|
if (m.aborted)
|
|
554
555
|
return;
|
|
555
|
-
const
|
|
556
|
-
if ((
|
|
556
|
+
const E = ((H = d.data.startedWriteNodeIds) == null ? void 0 : H.includes(s.id)) === !0;
|
|
557
|
+
if ((h == null ? void 0 : h.submitNodeId) === s.id && await v(void 0), E || (d.data.startedWriteNodeIds = [...d.data.startedWriteNodeIds ?? [], s.id]), await p().catch((L) => i.error("Failed to persist application write barrier", L)), m.aborted)
|
|
557
558
|
return;
|
|
558
|
-
let
|
|
559
|
-
const
|
|
559
|
+
let A;
|
|
560
|
+
const B = setTimeout(() => {
|
|
561
|
+
A = (async () => {
|
|
562
|
+
await e.sendMessage({
|
|
563
|
+
type: "text",
|
|
564
|
+
author: "bot",
|
|
565
|
+
text: k("submission_still_working")
|
|
566
|
+
}), await e.sendMessage({
|
|
567
|
+
type: "loading",
|
|
568
|
+
text: k("submitting")
|
|
569
|
+
});
|
|
570
|
+
})().catch((L) => i.error("Failed to send submission progress message", L));
|
|
571
|
+
}, Ss);
|
|
572
|
+
let J;
|
|
573
|
+
const D = await a.fetch("/flow/submit", {
|
|
560
574
|
method: "POST",
|
|
561
575
|
body: JSON.stringify({
|
|
562
576
|
log_submit: !1,
|
|
@@ -568,43 +582,43 @@ async function Ss({
|
|
|
568
582
|
submissions: ts(d.nodes, rs(n || {}, s.data.submitKeys)),
|
|
569
583
|
pre_apply: dr(d.nodes, n || {}, d.data.flowSessionId)
|
|
570
584
|
})
|
|
571
|
-
}).catch((
|
|
572
|
-
if (m.aborted)
|
|
585
|
+
}).catch((L) => (J = L, hs(L) ? L.data : L));
|
|
586
|
+
if (clearTimeout(B), await A, m.aborted)
|
|
573
587
|
return;
|
|
574
588
|
s.data.key && e.setSubmission(s.data.key, {
|
|
575
589
|
type: "integration",
|
|
576
|
-
value:
|
|
590
|
+
value: D
|
|
577
591
|
});
|
|
578
|
-
const
|
|
579
|
-
if (
|
|
592
|
+
const $ = ss(D);
|
|
593
|
+
if ($ && o.log({
|
|
580
594
|
event: "FLOW_SUBMIT",
|
|
581
595
|
properties: {
|
|
582
596
|
flow_id: d.id,
|
|
583
597
|
flow_version: d.version,
|
|
584
598
|
flow_session_id: d.data.flowSessionId,
|
|
585
599
|
flow_build: d.build,
|
|
586
|
-
service:
|
|
587
|
-
response:
|
|
600
|
+
service: $.service,
|
|
601
|
+
response: $.response,
|
|
588
602
|
flow_type: "CHATBOT_DRAWER",
|
|
589
603
|
job: d.job
|
|
590
604
|
}
|
|
591
|
-
}), ns(
|
|
605
|
+
}), ns(D)) {
|
|
592
606
|
const {
|
|
593
|
-
redirect_url:
|
|
594
|
-
message:
|
|
595
|
-
button_text:
|
|
596
|
-
} =
|
|
607
|
+
redirect_url: L,
|
|
608
|
+
message: U,
|
|
609
|
+
button_text: Z
|
|
610
|
+
} = D.integration_response.data;
|
|
597
611
|
await e.sendMessage({
|
|
598
612
|
type: "text",
|
|
599
613
|
author: "bot",
|
|
600
|
-
text:
|
|
614
|
+
text: U ?? k("submission_redirect_message")
|
|
601
615
|
});
|
|
602
616
|
try {
|
|
603
|
-
const
|
|
604
|
-
y &&
|
|
617
|
+
const z = new URL(L);
|
|
618
|
+
y && !z.searchParams.has("anonymous_id") && z.searchParams.set("anonymous_id", y), await e.sendMessage({
|
|
605
619
|
type: "link",
|
|
606
|
-
href:
|
|
607
|
-
text:
|
|
620
|
+
href: z.toString(),
|
|
621
|
+
text: Z ?? k("complete_submission"),
|
|
608
622
|
onClick: () => {
|
|
609
623
|
if (!C) {
|
|
610
624
|
i.error("session_id not set, cannot log FLOW_REDIRECT event");
|
|
@@ -617,14 +631,14 @@ async function Ss({
|
|
|
617
631
|
flow_id: d.id,
|
|
618
632
|
flow_session_id: C,
|
|
619
633
|
flow_version: d.version,
|
|
620
|
-
href:
|
|
634
|
+
href: z.toString(),
|
|
621
635
|
job: d.job
|
|
622
636
|
}
|
|
623
637
|
});
|
|
624
638
|
}
|
|
625
639
|
});
|
|
626
|
-
} catch (
|
|
627
|
-
i.error(`Invalid redirect URL: ${
|
|
640
|
+
} catch (z) {
|
|
641
|
+
i.error(`Invalid redirect URL: ${L}`, z), e.sendMessage({
|
|
628
642
|
type: "system",
|
|
629
643
|
variant: "error",
|
|
630
644
|
text: k("redirect_url_error")
|
|
@@ -632,52 +646,52 @@ async function Ss({
|
|
|
632
646
|
}
|
|
633
647
|
return r(s.nextId);
|
|
634
648
|
}
|
|
635
|
-
if ((
|
|
649
|
+
if ((D == null ? void 0 : D.success) === !0)
|
|
636
650
|
return s.data.skipConfirmation !== !0 && await e.sendMessage({
|
|
637
651
|
type: "system",
|
|
638
652
|
variant: "success",
|
|
639
653
|
text: k("submission_completed")
|
|
640
654
|
}), r(s.nextId);
|
|
641
|
-
const
|
|
642
|
-
if ((
|
|
643
|
-
i.error(
|
|
644
|
-
const
|
|
645
|
-
return
|
|
646
|
-
fileQuestionNodeId:
|
|
655
|
+
const F = mr(D, J);
|
|
656
|
+
if ((F == null ? void 0 : F.verdict) === "not_submitted" && (E || (d.data.startedWriteNodeIds = (M = d.data.startedWriteNodeIds) == null ? void 0 : M.filter((L) => L !== s.id)), (h == null ? void 0 : h.submitNodeId) === s.id && await v(h), await p().catch((L) => i.error("Failed to persist application write barrier release", L))), F) {
|
|
657
|
+
i.error(J ?? F.message);
|
|
658
|
+
const L = F.phase === "submit" && F.verdict === "confirmed" && F.code === "unreadable_document" && typeof F.field == "string" && F.status !== void 0 && F.status >= 400 && F.status < 500 && ((T = n == null ? void 0 : n[F.field]) == null ? void 0 : T.type) === "file" ? F.field : void 0, U = L === void 0 ? void 0 : d.nodes.find((Z) => Z.type === "question-file" && Z.data.key === L);
|
|
659
|
+
return U && L !== void 0 ? (e.setSubmission(L, null), await v({
|
|
660
|
+
fileQuestionNodeId: U.id,
|
|
647
661
|
submitNodeId: s.id
|
|
648
662
|
}), await e.sendMessage({
|
|
649
663
|
type: "system",
|
|
650
664
|
variant: "error",
|
|
651
665
|
text: k("submission_unreadable_document")
|
|
652
|
-
}), r(
|
|
666
|
+
}), r(U.id)) : F.status === 409 && F.phase === "submit" && F.verdict === "confirmed" ? (await e.sendMessage({
|
|
653
667
|
type: "system",
|
|
654
668
|
variant: "info",
|
|
655
669
|
text: k("submission_duplicate")
|
|
656
|
-
}), t()) :
|
|
670
|
+
}), t()) : F.status === 410 && F.code === "job_closed" ? (await e.sendMessage({
|
|
657
671
|
type: "system",
|
|
658
672
|
variant: "info",
|
|
659
673
|
text: k("submission_closed")
|
|
660
|
-
}), t()) :
|
|
674
|
+
}), t()) : F.phase === "submit" && F.verdict === "unknown" ? (await e.sendMessage({
|
|
661
675
|
type: "system",
|
|
662
676
|
variant: "warning",
|
|
663
677
|
text: k("submission_unknown")
|
|
664
|
-
}), t()) :
|
|
678
|
+
}), t()) : F.phase === "workflow" && F.retryable === !0 && F.verdict === "not_submitted" ? (await e.sendMessage({
|
|
665
679
|
type: "system",
|
|
666
680
|
variant: "error",
|
|
667
681
|
text: k("submission_retryable")
|
|
668
|
-
}),
|
|
682
|
+
}), V(!1)) : (await e.sendMessage({
|
|
669
683
|
type: "system",
|
|
670
684
|
variant: "error",
|
|
671
685
|
text: k("submission_failed")
|
|
672
686
|
}), t());
|
|
673
687
|
}
|
|
674
|
-
return i.error(
|
|
688
|
+
return i.error(J ?? D), await e.sendMessage({
|
|
675
689
|
type: "system",
|
|
676
690
|
variant: "error",
|
|
677
691
|
text: k("submission_failed")
|
|
678
692
|
}), t();
|
|
679
693
|
};
|
|
680
|
-
await
|
|
694
|
+
await V(x === !0 ? !1 : s.data.skipConfirmation);
|
|
681
695
|
}
|
|
682
696
|
const mr = (e, r) => {
|
|
683
697
|
if (!Xr(e))
|
|
@@ -688,10 +702,10 @@ const mr = (e, r) => {
|
|
|
688
702
|
const s = t.error;
|
|
689
703
|
if (typeof s != "object" || s === null)
|
|
690
704
|
return;
|
|
691
|
-
const i = s.data, a = typeof i == "object" && i !== null ? i : {}, n = (
|
|
705
|
+
const i = s.data, a = typeof i == "object" && i !== null ? i : {}, n = (h) => typeof a[h] == "string" ? a[h] : void 0, o = (h) => typeof a[h] == "boolean" ? a[h] : void 0, d = t.status;
|
|
692
706
|
return {
|
|
693
707
|
message: e.integration_response.error.message,
|
|
694
|
-
status: typeof d == "number" ? d : r instanceof
|
|
708
|
+
status: typeof d == "number" ? d : r instanceof ps ? r.status : void 0,
|
|
695
709
|
phase: n("phase"),
|
|
696
710
|
retryable: o("retryable"),
|
|
697
711
|
verdict: n("verdict"),
|
|
@@ -699,7 +713,7 @@ const mr = (e, r) => {
|
|
|
699
713
|
field: n("field")
|
|
700
714
|
};
|
|
701
715
|
};
|
|
702
|
-
async function
|
|
716
|
+
async function Vs({
|
|
703
717
|
chat: e,
|
|
704
718
|
next: r,
|
|
705
719
|
node: t,
|
|
@@ -718,7 +732,7 @@ async function Is({
|
|
|
718
732
|
})
|
|
719
733
|
}), r(t.nextId);
|
|
720
734
|
}
|
|
721
|
-
async function
|
|
735
|
+
async function Fs({
|
|
722
736
|
submissions: e,
|
|
723
737
|
next: r,
|
|
724
738
|
node: t,
|
|
@@ -729,7 +743,7 @@ async function Vs({
|
|
|
729
743
|
context: s
|
|
730
744
|
}) ? t.branchId : t.nextId);
|
|
731
745
|
}
|
|
732
|
-
async function
|
|
746
|
+
async function As({
|
|
733
747
|
chat: e,
|
|
734
748
|
next: r,
|
|
735
749
|
node: t,
|
|
@@ -745,7 +759,7 @@ async function Fs({
|
|
|
745
759
|
})
|
|
746
760
|
}), r(t.nextId);
|
|
747
761
|
}
|
|
748
|
-
async function
|
|
762
|
+
async function Es({
|
|
749
763
|
chat: e,
|
|
750
764
|
next: r,
|
|
751
765
|
node: t
|
|
@@ -758,7 +772,7 @@ async function As({
|
|
|
758
772
|
width: t.data.width
|
|
759
773
|
}), r(t.nextId);
|
|
760
774
|
}
|
|
761
|
-
async function
|
|
775
|
+
async function Ms({
|
|
762
776
|
chat: e,
|
|
763
777
|
next: r,
|
|
764
778
|
node: t,
|
|
@@ -806,7 +820,7 @@ async function Es({
|
|
|
806
820
|
text: n.type === "phone" ? Je(n.value) : n.value
|
|
807
821
|
}), r(t.nextId);
|
|
808
822
|
}
|
|
809
|
-
async function
|
|
823
|
+
async function Ns({
|
|
810
824
|
chat: e,
|
|
811
825
|
next: r,
|
|
812
826
|
node: t,
|
|
@@ -843,7 +857,7 @@ async function Ms({
|
|
|
843
857
|
text: n.value.toString()
|
|
844
858
|
}), r(t.nextId);
|
|
845
859
|
}
|
|
846
|
-
async function
|
|
860
|
+
async function Ls({
|
|
847
861
|
chat: e,
|
|
848
862
|
next: r,
|
|
849
863
|
node: t,
|
|
@@ -882,7 +896,7 @@ async function Ns({
|
|
|
882
896
|
text: n.type === "phone" ? Je(n.value) : n.value
|
|
883
897
|
}), r(t.nextId);
|
|
884
898
|
}
|
|
885
|
-
async function
|
|
899
|
+
async function Ds({
|
|
886
900
|
chat: e,
|
|
887
901
|
next: r,
|
|
888
902
|
node: t,
|
|
@@ -913,7 +927,7 @@ async function Ls({
|
|
|
913
927
|
text: t.data.options.filter((o) => n.value.includes(o.value)).map((o) => o.label).join(", ")
|
|
914
928
|
}), r(t.nextId);
|
|
915
929
|
}
|
|
916
|
-
async function
|
|
930
|
+
async function Ts({
|
|
917
931
|
chat: e,
|
|
918
932
|
next: r,
|
|
919
933
|
node: t,
|
|
@@ -950,7 +964,7 @@ async function Ds({
|
|
|
950
964
|
text: n.value === !0 ? t.data.trueLabel : t.data.falseLabel
|
|
951
965
|
}), r(t.nextId);
|
|
952
966
|
}
|
|
953
|
-
async function
|
|
967
|
+
async function Os({
|
|
954
968
|
chat: e,
|
|
955
969
|
next: r,
|
|
956
970
|
node: t,
|
|
@@ -986,7 +1000,7 @@ async function Ts({
|
|
|
986
1000
|
}
|
|
987
1001
|
return r(t.nextId);
|
|
988
1002
|
}
|
|
989
|
-
async function
|
|
1003
|
+
async function Rs({
|
|
990
1004
|
node: e,
|
|
991
1005
|
chat: r,
|
|
992
1006
|
next: t,
|
|
@@ -1029,7 +1043,7 @@ async function Os({
|
|
|
1029
1043
|
});
|
|
1030
1044
|
return t(e.nextId);
|
|
1031
1045
|
}
|
|
1032
|
-
async function
|
|
1046
|
+
async function Bs({
|
|
1033
1047
|
chat: e,
|
|
1034
1048
|
end: r,
|
|
1035
1049
|
node: t
|
|
@@ -1040,7 +1054,7 @@ async function Rs({
|
|
|
1040
1054
|
text: t.data.systemMessage
|
|
1041
1055
|
}), r();
|
|
1042
1056
|
}
|
|
1043
|
-
async function
|
|
1057
|
+
async function js({
|
|
1044
1058
|
node: e,
|
|
1045
1059
|
flow: r,
|
|
1046
1060
|
submissions: t,
|
|
@@ -1051,11 +1065,11 @@ async function Bs({
|
|
|
1051
1065
|
}) {
|
|
1052
1066
|
const o = es(r.nodes, t || {}), {
|
|
1053
1067
|
answers: d,
|
|
1054
|
-
...
|
|
1068
|
+
...h
|
|
1055
1069
|
} = o;
|
|
1056
1070
|
s.setSubmission(e.data.key, {
|
|
1057
1071
|
type: "integration",
|
|
1058
|
-
value:
|
|
1072
|
+
value: h
|
|
1059
1073
|
});
|
|
1060
1074
|
const v = new AbortController(), x = setTimeout(() => v.abort(), 5e3);
|
|
1061
1075
|
if (a.fetch("/flow/pre-apply", {
|
|
@@ -1071,9 +1085,9 @@ async function Bs({
|
|
|
1071
1085
|
}).finally(() => clearTimeout(x)), o.status !== "skipped") {
|
|
1072
1086
|
const m = [o.status === "unavailable" ? "We could not prepare your pre-apply summary. You can still continue to your application." : o.hasHardConcerns ? e.data.messages.hard : o.hasAdvisoryConcerns ? e.data.messages.advisory : e.data.messages.matched];
|
|
1073
1087
|
for (const k of ["hard", "advisory"]) {
|
|
1074
|
-
const
|
|
1075
|
-
|
|
1076
|
-
` +
|
|
1088
|
+
const V = d.filter((I) => !I.matched && I.severity === k);
|
|
1089
|
+
V.length && m.push((k === "hard" ? "Role requirements" : "Other things to consider") + `
|
|
1090
|
+
` + V.map((I) => `• ${I.message}`).join(`
|
|
1077
1091
|
`));
|
|
1078
1092
|
}
|
|
1079
1093
|
await s.sendMessage({
|
|
@@ -1102,7 +1116,7 @@ const Se = ({
|
|
|
1102
1116
|
}) => {
|
|
1103
1117
|
const {
|
|
1104
1118
|
t
|
|
1105
|
-
} =
|
|
1119
|
+
} = ne();
|
|
1106
1120
|
return u("button", {
|
|
1107
1121
|
class: Me("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),
|
|
1108
1122
|
type: "submit",
|
|
@@ -1138,17 +1152,17 @@ function Xe(e) {
|
|
|
1138
1152
|
}
|
|
1139
1153
|
var at;
|
|
1140
1154
|
// @__NO_SIDE_EFFECTS__
|
|
1141
|
-
function
|
|
1155
|
+
function Ps(e) {
|
|
1142
1156
|
return at == null ? void 0 : at.get(e);
|
|
1143
1157
|
}
|
|
1144
1158
|
var ot;
|
|
1145
1159
|
// @__NO_SIDE_EFFECTS__
|
|
1146
|
-
function
|
|
1160
|
+
function $s(e) {
|
|
1147
1161
|
return ot == null ? void 0 : ot.get(e);
|
|
1148
1162
|
}
|
|
1149
1163
|
var lt;
|
|
1150
1164
|
// @__NO_SIDE_EFFECTS__
|
|
1151
|
-
function
|
|
1165
|
+
function qs(e, r) {
|
|
1152
1166
|
var t;
|
|
1153
1167
|
return (t = lt == null ? void 0 : lt.get(e)) == null ? void 0 : t.get(r);
|
|
1154
1168
|
}
|
|
@@ -1158,7 +1172,7 @@ function Ee(e) {
|
|
|
1158
1172
|
const r = typeof e;
|
|
1159
1173
|
return r === "string" ? `"${e}"` : r === "number" || r === "bigint" || r === "boolean" ? `${e}` : r === "object" || r === "function" ? (e && ((s = (t = Object.getPrototypeOf(e)) == null ? void 0 : t.constructor) == null ? void 0 : s.name)) ?? "null" : r;
|
|
1160
1174
|
}
|
|
1161
|
-
function
|
|
1175
|
+
function X(e, r, t, s, i) {
|
|
1162
1176
|
const a = i && "input" in i ? i.input : t.value, n = (i == null ? void 0 : i.expected) ?? e.expects ?? null, o = (i == null ? void 0 : i.received) ?? /* @__PURE__ */ Ee(a), d = {
|
|
1163
1177
|
kind: e.kind,
|
|
1164
1178
|
type: e.type,
|
|
@@ -1172,11 +1186,11 @@ function H(e, r, t, s, i) {
|
|
|
1172
1186
|
lang: s.lang,
|
|
1173
1187
|
abortEarly: s.abortEarly,
|
|
1174
1188
|
abortPipeEarly: s.abortPipeEarly
|
|
1175
|
-
},
|
|
1189
|
+
}, h = e.kind === "schema", v = (i == null ? void 0 : i.message) ?? e.message ?? /* @__PURE__ */ qs(e.reference, d.lang) ?? (h ? /* @__PURE__ */ $s(d.lang) : null) ?? s.message ?? /* @__PURE__ */ Ps(d.lang);
|
|
1176
1190
|
v !== void 0 && (d.message = typeof v == "function" ? (
|
|
1177
1191
|
// @ts-expect-error
|
|
1178
1192
|
v(d)
|
|
1179
|
-
) : v),
|
|
1193
|
+
) : v), h && (t.typed = !1), t.issues ? t.issues.push(d) : t.issues = [d];
|
|
1180
1194
|
}
|
|
1181
1195
|
// @__NO_SIDE_EFFECTS__
|
|
1182
1196
|
function de(e) {
|
|
@@ -1189,16 +1203,16 @@ function de(e) {
|
|
|
1189
1203
|
};
|
|
1190
1204
|
}
|
|
1191
1205
|
// @__NO_SIDE_EFFECTS__
|
|
1192
|
-
function
|
|
1206
|
+
function Us(e, r) {
|
|
1193
1207
|
return Object.hasOwn(e, r) && r !== "__proto__" && r !== "prototype" && r !== "constructor";
|
|
1194
1208
|
}
|
|
1195
1209
|
// @__NO_SIDE_EFFECTS__
|
|
1196
|
-
function
|
|
1210
|
+
function zs(e, r) {
|
|
1197
1211
|
const t = [...new Set(e)];
|
|
1198
1212
|
return t.length > 1 ? `(${t.join(` ${r} `)})` : t[0] ?? "never";
|
|
1199
1213
|
}
|
|
1200
1214
|
// @__NO_SIDE_EFFECTS__
|
|
1201
|
-
function
|
|
1215
|
+
function Ws(e) {
|
|
1202
1216
|
if (e.path) {
|
|
1203
1217
|
let r = "";
|
|
1204
1218
|
for (const t of e.path)
|
|
@@ -1219,7 +1233,7 @@ var Ks = class extends Error {
|
|
|
1219
1233
|
constructor(e) {
|
|
1220
1234
|
super(e[0].message), this.name = "ValiError", this.issues = e;
|
|
1221
1235
|
}
|
|
1222
|
-
},
|
|
1236
|
+
}, Gs = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
|
|
1223
1237
|
// @__NO_SIDE_EFFECTS__
|
|
1224
1238
|
function gr(e, r) {
|
|
1225
1239
|
return {
|
|
@@ -1231,7 +1245,7 @@ function gr(e, r) {
|
|
|
1231
1245
|
requirement: e,
|
|
1232
1246
|
message: r,
|
|
1233
1247
|
"~run"(t, s) {
|
|
1234
|
-
return t.typed && !this.requirement(t.value) &&
|
|
1248
|
+
return t.typed && !this.requirement(t.value) && X(this, "input", t, s), t;
|
|
1235
1249
|
}
|
|
1236
1250
|
};
|
|
1237
1251
|
}
|
|
@@ -1243,10 +1257,10 @@ function br(e) {
|
|
|
1243
1257
|
reference: br,
|
|
1244
1258
|
expects: null,
|
|
1245
1259
|
async: !1,
|
|
1246
|
-
requirement:
|
|
1260
|
+
requirement: Gs,
|
|
1247
1261
|
message: e,
|
|
1248
1262
|
"~run"(r, t) {
|
|
1249
|
-
return r.typed && !this.requirement.test(r.value) &&
|
|
1263
|
+
return r.typed && !this.requirement.test(r.value) && X(this, "email", r, t), r;
|
|
1250
1264
|
}
|
|
1251
1265
|
};
|
|
1252
1266
|
}
|
|
@@ -1261,7 +1275,7 @@ function $e(e, r) {
|
|
|
1261
1275
|
requirement: e,
|
|
1262
1276
|
message: r,
|
|
1263
1277
|
"~run"(t, s) {
|
|
1264
|
-
return t.typed && t.value.length > this.requirement &&
|
|
1278
|
+
return t.typed && t.value.length > this.requirement && X(this, "length", t, s, {
|
|
1265
1279
|
received: `${t.value.length}`
|
|
1266
1280
|
}), t;
|
|
1267
1281
|
}
|
|
@@ -1278,7 +1292,7 @@ function vr(e, r) {
|
|
|
1278
1292
|
requirement: e,
|
|
1279
1293
|
message: r,
|
|
1280
1294
|
"~run"(t, s) {
|
|
1281
|
-
return t.typed && !(t.value <= this.requirement) &&
|
|
1295
|
+
return t.typed && !(t.value <= this.requirement) && X(this, "value", t, s, {
|
|
1282
1296
|
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ Ee(t.value)
|
|
1283
1297
|
}), t;
|
|
1284
1298
|
}
|
|
@@ -1295,7 +1309,7 @@ function Ae(e, r) {
|
|
|
1295
1309
|
requirement: e,
|
|
1296
1310
|
message: r,
|
|
1297
1311
|
"~run"(t, s) {
|
|
1298
|
-
return t.typed && t.value.length < this.requirement &&
|
|
1312
|
+
return t.typed && t.value.length < this.requirement && X(this, "length", t, s, {
|
|
1299
1313
|
received: `${t.value.length}`
|
|
1300
1314
|
}), t;
|
|
1301
1315
|
}
|
|
@@ -1312,7 +1326,7 @@ function xr(e, r) {
|
|
|
1312
1326
|
requirement: e,
|
|
1313
1327
|
message: r,
|
|
1314
1328
|
"~run"(t, s) {
|
|
1315
|
-
return t.typed && !(t.value >= this.requirement) &&
|
|
1329
|
+
return t.typed && !(t.value >= this.requirement) && X(this, "value", t, s, {
|
|
1316
1330
|
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ Ee(t.value)
|
|
1317
1331
|
}), t;
|
|
1318
1332
|
}
|
|
@@ -1329,7 +1343,7 @@ function yt(e, r) {
|
|
|
1329
1343
|
requirement: e,
|
|
1330
1344
|
message: r,
|
|
1331
1345
|
"~run"(t, s) {
|
|
1332
|
-
return t.typed && !this.requirement.test(t.value) &&
|
|
1346
|
+
return t.typed && !this.requirement.test(t.value) && X(this, "format", t, s), t;
|
|
1333
1347
|
}
|
|
1334
1348
|
};
|
|
1335
1349
|
}
|
|
@@ -1363,12 +1377,12 @@ function wr(e) {
|
|
|
1363
1377
|
},
|
|
1364
1378
|
message: e,
|
|
1365
1379
|
"~run"(r, t) {
|
|
1366
|
-
return r.typed && !this.requirement(r.value) &&
|
|
1380
|
+
return r.typed && !this.requirement(r.value) && X(this, "URL", r, t), r;
|
|
1367
1381
|
}
|
|
1368
1382
|
};
|
|
1369
1383
|
}
|
|
1370
1384
|
// @__NO_SIDE_EFFECTS__
|
|
1371
|
-
function
|
|
1385
|
+
function Hs(e, r, t) {
|
|
1372
1386
|
return typeof e.fallback == "function" ? (
|
|
1373
1387
|
// @ts-expect-error
|
|
1374
1388
|
e.fallback(r, t)
|
|
@@ -1408,7 +1422,7 @@ function kr(e, r) {
|
|
|
1408
1422
|
for (let n = 0; n < i.length; n++) {
|
|
1409
1423
|
const o = i[n], d = this.item["~run"]({ value: o }, s);
|
|
1410
1424
|
if (d.issues) {
|
|
1411
|
-
const
|
|
1425
|
+
const h = {
|
|
1412
1426
|
type: "array",
|
|
1413
1427
|
origin: "value",
|
|
1414
1428
|
input: i,
|
|
@@ -1416,7 +1430,7 @@ function kr(e, r) {
|
|
|
1416
1430
|
value: o
|
|
1417
1431
|
};
|
|
1418
1432
|
for (const v of d.issues)
|
|
1419
|
-
v.path ? v.path.unshift(
|
|
1433
|
+
v.path ? v.path.unshift(h) : v.path = [h], (a = t.issues) == null || a.push(v);
|
|
1420
1434
|
if (t.issues || (t.issues = d.issues), s.abortEarly) {
|
|
1421
1435
|
t.typed = !1;
|
|
1422
1436
|
break;
|
|
@@ -1425,7 +1439,7 @@ function kr(e, r) {
|
|
|
1425
1439
|
d.typed || (t.typed = !1), t.value.push(d.value);
|
|
1426
1440
|
}
|
|
1427
1441
|
} else
|
|
1428
|
-
|
|
1442
|
+
X(this, "type", t, s);
|
|
1429
1443
|
return t;
|
|
1430
1444
|
}
|
|
1431
1445
|
};
|
|
@@ -1443,7 +1457,7 @@ function Cr(e) {
|
|
|
1443
1457
|
return /* @__PURE__ */ de(this);
|
|
1444
1458
|
},
|
|
1445
1459
|
"~run"(r, t) {
|
|
1446
|
-
return typeof r.value == "boolean" ? r.typed = !0 :
|
|
1460
|
+
return typeof r.value == "boolean" ? r.typed = !0 : X(this, "type", r, t), r;
|
|
1447
1461
|
}
|
|
1448
1462
|
};
|
|
1449
1463
|
}
|
|
@@ -1460,7 +1474,7 @@ function Sr(e) {
|
|
|
1460
1474
|
return /* @__PURE__ */ de(this);
|
|
1461
1475
|
},
|
|
1462
1476
|
"~run"(r, t) {
|
|
1463
|
-
return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 :
|
|
1477
|
+
return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : X(this, "type", r, t), r;
|
|
1464
1478
|
}
|
|
1465
1479
|
};
|
|
1466
1480
|
}
|
|
@@ -1489,8 +1503,8 @@ function ye(e, r) {
|
|
|
1489
1503
|
const d = n in i ? (
|
|
1490
1504
|
// @ts-expect-error
|
|
1491
1505
|
i[n]
|
|
1492
|
-
) : /* @__PURE__ */ _r(o),
|
|
1493
|
-
if (
|
|
1506
|
+
) : /* @__PURE__ */ _r(o), h = o["~run"]({ value: d }, s);
|
|
1507
|
+
if (h.issues) {
|
|
1494
1508
|
const v = {
|
|
1495
1509
|
type: "object",
|
|
1496
1510
|
origin: "value",
|
|
@@ -1498,17 +1512,17 @@ function ye(e, r) {
|
|
|
1498
1512
|
key: n,
|
|
1499
1513
|
value: d
|
|
1500
1514
|
};
|
|
1501
|
-
for (const x of
|
|
1515
|
+
for (const x of h.issues)
|
|
1502
1516
|
x.path ? x.path.unshift(v) : x.path = [v], (a = t.issues) == null || a.push(x);
|
|
1503
|
-
if (t.issues || (t.issues =
|
|
1517
|
+
if (t.issues || (t.issues = h.issues), s.abortEarly) {
|
|
1504
1518
|
t.typed = !1;
|
|
1505
1519
|
break;
|
|
1506
1520
|
}
|
|
1507
1521
|
}
|
|
1508
|
-
|
|
1522
|
+
h.typed || (t.typed = !1), t.value[n] = h.value;
|
|
1509
1523
|
} else if (o.fallback !== void 0)
|
|
1510
|
-
t.value[n] = /* @__PURE__ */
|
|
1511
|
-
else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (
|
|
1524
|
+
t.value[n] = /* @__PURE__ */ Hs(o);
|
|
1525
|
+
else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (X(this, "key", t, s, {
|
|
1512
1526
|
input: void 0,
|
|
1513
1527
|
expected: `"${n}"`,
|
|
1514
1528
|
path: [
|
|
@@ -1525,7 +1539,7 @@ function ye(e, r) {
|
|
|
1525
1539
|
break;
|
|
1526
1540
|
}
|
|
1527
1541
|
} else
|
|
1528
|
-
|
|
1542
|
+
X(this, "type", t, s);
|
|
1529
1543
|
return t;
|
|
1530
1544
|
}
|
|
1531
1545
|
};
|
|
@@ -1554,7 +1568,7 @@ function Ir(e, r) {
|
|
|
1554
1568
|
kind: "schema",
|
|
1555
1569
|
type: "picklist",
|
|
1556
1570
|
reference: Ir,
|
|
1557
|
-
expects: /* @__PURE__ */
|
|
1571
|
+
expects: /* @__PURE__ */ zs(e.map(Ee), "|"),
|
|
1558
1572
|
async: !1,
|
|
1559
1573
|
options: e,
|
|
1560
1574
|
message: r,
|
|
@@ -1562,7 +1576,7 @@ function Ir(e, r) {
|
|
|
1562
1576
|
return /* @__PURE__ */ de(this);
|
|
1563
1577
|
},
|
|
1564
1578
|
"~run"(t, s) {
|
|
1565
|
-
return this.options.includes(t.value) ? t.typed = !0 :
|
|
1579
|
+
return this.options.includes(t.value) ? t.typed = !0 : X(this, "type", t, s), t;
|
|
1566
1580
|
}
|
|
1567
1581
|
};
|
|
1568
1582
|
}
|
|
@@ -1586,37 +1600,37 @@ function Vr(e, r, t) {
|
|
|
1586
1600
|
if (a && typeof a == "object") {
|
|
1587
1601
|
s.typed = !0, s.value = {};
|
|
1588
1602
|
for (const d in a)
|
|
1589
|
-
if (/* @__PURE__ */
|
|
1590
|
-
const
|
|
1603
|
+
if (/* @__PURE__ */ Us(a, d)) {
|
|
1604
|
+
const h = a[d], v = this.key["~run"]({ value: d }, i);
|
|
1591
1605
|
if (v.issues) {
|
|
1592
|
-
const
|
|
1606
|
+
const p = {
|
|
1593
1607
|
type: "object",
|
|
1594
1608
|
origin: "key",
|
|
1595
1609
|
input: a,
|
|
1596
1610
|
key: d,
|
|
1597
|
-
value:
|
|
1611
|
+
value: h
|
|
1598
1612
|
};
|
|
1599
1613
|
for (const m of v.issues)
|
|
1600
|
-
m.path = [
|
|
1614
|
+
m.path = [p], (n = s.issues) == null || n.push(m);
|
|
1601
1615
|
if (s.issues || (s.issues = v.issues), i.abortEarly) {
|
|
1602
1616
|
s.typed = !1;
|
|
1603
1617
|
break;
|
|
1604
1618
|
}
|
|
1605
1619
|
}
|
|
1606
1620
|
const x = this.value["~run"](
|
|
1607
|
-
{ value:
|
|
1621
|
+
{ value: h },
|
|
1608
1622
|
i
|
|
1609
1623
|
);
|
|
1610
1624
|
if (x.issues) {
|
|
1611
|
-
const
|
|
1625
|
+
const p = {
|
|
1612
1626
|
type: "object",
|
|
1613
1627
|
origin: "value",
|
|
1614
1628
|
input: a,
|
|
1615
1629
|
key: d,
|
|
1616
|
-
value:
|
|
1630
|
+
value: h
|
|
1617
1631
|
};
|
|
1618
1632
|
for (const m of x.issues)
|
|
1619
|
-
m.path ? m.path.unshift(
|
|
1633
|
+
m.path ? m.path.unshift(p) : m.path = [p], (o = s.issues) == null || o.push(m);
|
|
1620
1634
|
if (s.issues || (s.issues = x.issues), i.abortEarly) {
|
|
1621
1635
|
s.typed = !1;
|
|
1622
1636
|
break;
|
|
@@ -1625,17 +1639,17 @@ function Vr(e, r, t) {
|
|
|
1625
1639
|
(!v.typed || !x.typed) && (s.typed = !1), v.typed && (s.value[v.value] = x.value);
|
|
1626
1640
|
}
|
|
1627
1641
|
} else
|
|
1628
|
-
|
|
1642
|
+
X(this, "type", s, i);
|
|
1629
1643
|
return s;
|
|
1630
1644
|
}
|
|
1631
1645
|
};
|
|
1632
1646
|
}
|
|
1633
1647
|
// @__NO_SIDE_EFFECTS__
|
|
1634
|
-
function
|
|
1648
|
+
function se(e) {
|
|
1635
1649
|
return {
|
|
1636
1650
|
kind: "schema",
|
|
1637
1651
|
type: "string",
|
|
1638
|
-
reference:
|
|
1652
|
+
reference: se,
|
|
1639
1653
|
expects: "string",
|
|
1640
1654
|
async: !1,
|
|
1641
1655
|
message: e,
|
|
@@ -1643,18 +1657,18 @@ function re(e) {
|
|
|
1643
1657
|
return /* @__PURE__ */ de(this);
|
|
1644
1658
|
},
|
|
1645
1659
|
"~run"(r, t) {
|
|
1646
|
-
return typeof r.value == "string" ? r.typed = !0 :
|
|
1660
|
+
return typeof r.value == "string" ? r.typed = !0 : X(this, "type", r, t), r;
|
|
1647
1661
|
}
|
|
1648
1662
|
};
|
|
1649
1663
|
}
|
|
1650
|
-
function
|
|
1664
|
+
function Js(e, r, t) {
|
|
1651
1665
|
const s = e["~run"]({ value: r }, /* @__PURE__ */ Xe(t));
|
|
1652
1666
|
if (s.issues)
|
|
1653
1667
|
throw new Ks(s.issues);
|
|
1654
1668
|
return s.value;
|
|
1655
1669
|
}
|
|
1656
1670
|
// @__NO_SIDE_EFFECTS__
|
|
1657
|
-
function
|
|
1671
|
+
function Zs(e, r) {
|
|
1658
1672
|
const t = {};
|
|
1659
1673
|
for (const s in e.entries)
|
|
1660
1674
|
t[s] = !r || r.includes(s) ? /* @__PURE__ */ qe(e.entries[s]) : e.entries[s];
|
|
@@ -1688,7 +1702,7 @@ function ve(...e) {
|
|
|
1688
1702
|
};
|
|
1689
1703
|
}
|
|
1690
1704
|
// @__NO_SIDE_EFFECTS__
|
|
1691
|
-
function
|
|
1705
|
+
function Xs(e, r, t) {
|
|
1692
1706
|
const s = e["~run"]({ value: r }, /* @__PURE__ */ Xe(t));
|
|
1693
1707
|
return {
|
|
1694
1708
|
typed: s.typed,
|
|
@@ -1698,7 +1712,7 @@ function Zs(e, r, t) {
|
|
|
1698
1712
|
};
|
|
1699
1713
|
}
|
|
1700
1714
|
// @__NO_SIDE_EFFECTS__
|
|
1701
|
-
async function
|
|
1715
|
+
async function Ys(e, r, t) {
|
|
1702
1716
|
const s = await e["~run"](
|
|
1703
1717
|
{ value: r },
|
|
1704
1718
|
/* @__PURE__ */ Xe(t)
|
|
@@ -1749,7 +1763,7 @@ const Le = ({
|
|
|
1749
1763
|
}) => {
|
|
1750
1764
|
const {
|
|
1751
1765
|
t
|
|
1752
|
-
} =
|
|
1766
|
+
} = ne();
|
|
1753
1767
|
return u("button", {
|
|
1754
1768
|
type: "button",
|
|
1755
1769
|
class: Me("fr touch-hitbox text-neutral-10 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),
|
|
@@ -1775,7 +1789,7 @@ const Le = ({
|
|
|
1775
1789
|
});
|
|
1776
1790
|
};
|
|
1777
1791
|
var gt = { Afghanistan: "93", Albania: "355", Algeria: "213", "American Samoa": "1 684", Andorra: "376", Angola: "244", Anguilla: "1 264", Antarctica: "672", "Antigua and Barbuda": "1 268", Argentina: "54", Armenia: "374", Aruba: "297", Australia: "61", Austria: "43", Azerbaijan: "994", Bahrain: "973", Bangladesh: "880", Barbados: "1 246", Belarus: "375", Belgium: "32", Belize: "501", Benin: "229", Bermuda: "1 441", Bhutan: "975", Bolivia: "591", "Bosnia and Herzegovina": "387", Botswana: "267", "Bouvet Island": "47", Brazil: "55", "British Indian Ocean Territory": "246", "British Virgin Islands": "1 284", Brunei: "673", Bulgaria: "359", "Burkina Faso": "226", Burundi: "257", "Cabo Verde": "238", Cambodia: "855", Cameroon: "237", Canada: "1", "Caribbean Netherlands": "599", "Cayman Islands": "1 345", "Central African Republic": "236", Chad: "235", Chile: "56", China: "86", "Christmas Island": "61", "Cocos (Keeling) Islands": "61", Colombia: "57", Comoros: "269", "Cook Islands": "682", "Costa Rica": "506", Croatia: "385", Cuba: "53", Curaçao: "599", Cyprus: "357", Czechia: "420", "Côte d'Ivoire": "225", "Democratic Republic of the Congo": "243", Denmark: "45", Djibouti: "253", "Dominican Republic": "1 809", Ecuador: "593", Egypt: "20", "El Salvador": "503", "Equatorial Guinea": "240", Eritrea: "291", Estonia: "372", Eswatini: "268", Ethiopia: "251", "Falkland Islands (Islas Malvinas)": "500", "Faroe Islands": "298", Fiji: "679", Finland: "358", France: "33", "French Guiana": "594", "French Polynesia": "689", "French Southern and Antarctic Lands": "262", Gabon: "241", Georgia: "995", Germany: "49", Ghana: "233", Gibraltar: "350", Greece: "30", Greenland: "299", Grenada: "1 473", Guadeloupe: "590", Guam: "1 671", Guatemala: "502", Guernsey: "44", Guinea: "224", "Guinea-Bissau": "245", Guyana: "592", Haiti: "509", Honduras: "504", "Hong Kong": "852", Hungary: "36", Iceland: "354", India: "91", Indonesia: "62", Iran: "98", Iraq: "964", Ireland: "353", "Isle of Man": "44", Israel: "972", Italy: "39", Jamaica: "1 876", Japan: "81", Jersey: "44", Jordan: "962", Kazakhstan: "7", Kenya: "254", Kiribati: "686", Kosovo: "383", Kuwait: "965", Kyrgyzstan: "996", Laos: "856", Latvia: "371", Lebanon: "961", Lesotho: "266", Liberia: "231", Libya: "218", Liechtenstein: "423", Lithuania: "370", Luxembourg: "352", Macao: "853", Madagascar: "261", Malawi: "265", Malaysia: "60", Maldives: "960", Mali: "223", Malta: "356", "Marshall Islands": "692", Martinique: "596", Mauritania: "222", Mauritius: "230", Mayotte: "262", Mexico: "52", Micronesia: "691", Moldova: "373", Monaco: "377", Mongolia: "976", Montenegro: "382", Montserrat: "1 664", Morocco: "212", Mozambique: "258", "Myanmar (Burma)": "95", Namibia: "264", Nauru: "674", Nepal: "977", Netherlands: "31", "New Caledonia": "687", "New Zealand": "64", Nicaragua: "505", Niger: "227", Nigeria: "234", Niue: "683", "Norfolk Island": "672", "North Korea": "850", "North Macedonia": "389", "Northern Mariana Islands": "1 670", Norway: "47", Oman: "968", Pakistan: "92", Palau: "680", Palestine: "970", Panama: "507", "Papua New Guinea": "675", Paraguay: "595", Peru: "51", Philippines: "63", "Pitcairn Islands": "64", Poland: "48", Portugal: "351", "Puerto Rico": "1 787", Qatar: "974", Romania: "40", Russia: "7", Rwanda: "250", Réunion: "262", "Saint Barthélemy": "590", "Saint Helena, Ascension and Tristan da Cunha": "290", "Saint Kitts and Nevis": "1 869", "Saint Lucia": "1 758", "Saint Martin": "590", "Saint Pierre and Miquelon": "508", "Saint Vincent and the Grenadines": "1 784", Samoa: "685", "San Marino": "378", "Saudi Arabia": "966", Senegal: "221", Serbia: "381", Seychelles: "248", "Sierra Leone": "232", Singapore: "65", "Sint Maarten": "1 721", Slovakia: "421", Slovenia: "386", "Solomon Islands": "677", Somalia: "252", "South Africa": "27", "South Georgia and the South Sandwich Islands": "500", "South Korea": "82", "South Sudan": "211", Spain: "34", "Sri Lanka": "94", Sudan: "249", Suriname: "597", "Svalbard and Jan Mayen": "47", Sweden: "46", Switzerland: "41", Syria: "963", "São Tomé and Príncipe": "239", Taiwan: "886", Tajikistan: "992", Tanzania: "255", Thailand: "66", "The Bahamas": "1 242", "The Gambia": "220", "Timor-Leste": "670", Togo: "228", Tokelau: "690", Tonga: "676", "Trinidad and Tobago": "1 868", Tunisia: "216", Turkmenistan: "993", "Turks and Caicos Islands": "1 649", Tuvalu: "688", Türkiye: "90", "U.S. Virgin Islands": "1 340", Uganda: "256", Ukraine: "380", "United Arab Emirates": "971", "United Kingdom": "44", "United States": "1", "United States Minor Outlying Islands": "1", Uruguay: "598", Uzbekistan: "998", Vanuatu: "678", "Vatican City": "379", Venezuela: "58", Vietnam: "84", "Wallis and Futuna": "681", "Western Sahara": "212", Yemen: "967", Zambia: "260", Zimbabwe: "263", "Åland Islands": "358" };
|
|
1778
|
-
const
|
|
1792
|
+
const We = Ze("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", {
|
|
1779
1793
|
variants: {
|
|
1780
1794
|
optional: {
|
|
1781
1795
|
true: "pr-16 pl-3",
|
|
@@ -1785,70 +1799,70 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1785
1799
|
defaultVariants: {
|
|
1786
1800
|
optional: !1
|
|
1787
1801
|
}
|
|
1788
|
-
}),
|
|
1789
|
-
name: /* @__PURE__ */
|
|
1790
|
-
}),
|
|
1802
|
+
}), Qs = "https://api.mapbox.com/search/searchbox/v1/suggest", en = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", tn = (e) => atob(e).split("").reverse().join(""), pe = /* @__PURE__ */ ye({
|
|
1803
|
+
name: /* @__PURE__ */ se()
|
|
1804
|
+
}), rn = /* @__PURE__ */ ye({
|
|
1791
1805
|
suggestions: /* @__PURE__ */ kr(/* @__PURE__ */ ye({
|
|
1792
|
-
full_address: /* @__PURE__ */ qe(/* @__PURE__ */
|
|
1793
|
-
place_formatted: /* @__PURE__ */ qe(/* @__PURE__ */
|
|
1794
|
-
name: /* @__PURE__ */ qe(/* @__PURE__ */
|
|
1795
|
-
mapbox_id: /* @__PURE__ */
|
|
1796
|
-
context: /* @__PURE__ */
|
|
1797
|
-
address:
|
|
1798
|
-
street:
|
|
1799
|
-
neighborhood:
|
|
1800
|
-
locality:
|
|
1801
|
-
district:
|
|
1802
|
-
place:
|
|
1803
|
-
region:
|
|
1804
|
-
postcode:
|
|
1805
|
-
country:
|
|
1806
|
+
full_address: /* @__PURE__ */ qe(/* @__PURE__ */ se()),
|
|
1807
|
+
place_formatted: /* @__PURE__ */ qe(/* @__PURE__ */ se()),
|
|
1808
|
+
name: /* @__PURE__ */ qe(/* @__PURE__ */ se()),
|
|
1809
|
+
mapbox_id: /* @__PURE__ */ se(),
|
|
1810
|
+
context: /* @__PURE__ */ Zs(/* @__PURE__ */ ye({
|
|
1811
|
+
address: pe,
|
|
1812
|
+
street: pe,
|
|
1813
|
+
neighborhood: pe,
|
|
1814
|
+
locality: pe,
|
|
1815
|
+
district: pe,
|
|
1816
|
+
place: pe,
|
|
1817
|
+
region: pe,
|
|
1818
|
+
postcode: pe,
|
|
1819
|
+
country: pe
|
|
1806
1820
|
}))
|
|
1807
1821
|
}))
|
|
1808
|
-
}),
|
|
1822
|
+
}), sn = ({
|
|
1809
1823
|
logger: e,
|
|
1810
1824
|
t: r
|
|
1811
1825
|
}) => is(() => {
|
|
1812
1826
|
var s;
|
|
1813
|
-
const t = (s =
|
|
1827
|
+
const t = (s = P.current$.peek().flow) == null ? void 0 : s.data.flowSessionId;
|
|
1814
1828
|
return t ? {
|
|
1815
1829
|
enabled: !0,
|
|
1816
1830
|
getPredictions: async (i) => {
|
|
1817
1831
|
var x;
|
|
1818
|
-
const a = new URL(
|
|
1832
|
+
const a = new URL(Qs);
|
|
1819
1833
|
a.searchParams.set("q", i), a.searchParams.set("session_token", t);
|
|
1820
|
-
const n = (x =
|
|
1821
|
-
n && n.lat !== void 0 && n.lng !== void 0 && n.lat >= -90 && n.lat <= 90 && n.lng >= -180 && n.lng <= 180 && a.searchParams.set("proximity", `${n.lng},${n.lat}`), a.searchParams.set("access_token", en
|
|
1834
|
+
const n = (x = P.current$.peek().flow) == null ? void 0 : x.locationOrigin;
|
|
1835
|
+
n && n.lat !== void 0 && n.lng !== void 0 && n.lat >= -90 && n.lat <= 90 && n.lng >= -180 && n.lng <= 180 && a.searchParams.set("proximity", `${n.lng},${n.lat}`), a.searchParams.set("access_token", tn(en));
|
|
1822
1836
|
const d = await fetch(a);
|
|
1823
1837
|
if (!d.ok)
|
|
1824
1838
|
return e.error("Failed to get address details", d), {
|
|
1825
1839
|
ok: !1,
|
|
1826
1840
|
error: r("address_error")
|
|
1827
1841
|
};
|
|
1828
|
-
const
|
|
1829
|
-
if (
|
|
1830
|
-
return e.error("Failed to parse address details",
|
|
1842
|
+
const h = /* @__PURE__ */ Xs(rn, await d.json());
|
|
1843
|
+
if (h.success === !1)
|
|
1844
|
+
return e.error("Failed to parse address details", h.issues), {
|
|
1831
1845
|
ok: !1,
|
|
1832
1846
|
error: r("address_error")
|
|
1833
1847
|
};
|
|
1834
1848
|
const {
|
|
1835
1849
|
suggestions: v
|
|
1836
|
-
} =
|
|
1850
|
+
} = h.output;
|
|
1837
1851
|
return {
|
|
1838
1852
|
ok: !0,
|
|
1839
|
-
data: v.map((
|
|
1840
|
-
var m, k,
|
|
1853
|
+
data: v.map((p) => {
|
|
1854
|
+
var m, k, V, I, N, y, C, E, A;
|
|
1841
1855
|
return {
|
|
1842
|
-
label:
|
|
1843
|
-
id:
|
|
1856
|
+
label: p.full_address ?? p.place_formatted ?? p.name ?? p.mapbox_id,
|
|
1857
|
+
id: p.mapbox_id,
|
|
1844
1858
|
address: {
|
|
1845
|
-
line1: ((m =
|
|
1859
|
+
line1: ((m = p.context.address) == null ? void 0 : m.name) ?? ((k = p.context.street) == null ? void 0 : k.name),
|
|
1846
1860
|
line2: void 0,
|
|
1847
|
-
line3: ((
|
|
1848
|
-
city: ((N =
|
|
1849
|
-
state: (C =
|
|
1850
|
-
postcode: (
|
|
1851
|
-
country: (
|
|
1861
|
+
line3: ((V = p.context.neighborhood) == null ? void 0 : V.name) ?? ((I = p.context.locality) == null ? void 0 : I.name),
|
|
1862
|
+
city: ((N = p.context.place) == null ? void 0 : N.name) ?? ((y = p.context.district) == null ? void 0 : y.name),
|
|
1863
|
+
state: (C = p.context.region) == null ? void 0 : C.name,
|
|
1864
|
+
postcode: (E = p.context.postcode) == null ? void 0 : E.name,
|
|
1865
|
+
country: (A = p.context.country) == null ? void 0 : A.name
|
|
1852
1866
|
}
|
|
1853
1867
|
};
|
|
1854
1868
|
})
|
|
@@ -1860,7 +1874,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1860
1874
|
}, [e, r]), Bt = (e) => {
|
|
1861
1875
|
const {
|
|
1862
1876
|
t: r
|
|
1863
|
-
} =
|
|
1877
|
+
} = ne();
|
|
1864
1878
|
return u("button", {
|
|
1865
1879
|
type: "button",
|
|
1866
1880
|
class: "touch-hitbox text-neutral-10 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",
|
|
@@ -1880,22 +1894,22 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1880
1894
|
children: r("back")
|
|
1881
1895
|
})]
|
|
1882
1896
|
});
|
|
1883
|
-
},
|
|
1897
|
+
}, nn = ({
|
|
1884
1898
|
input: e,
|
|
1885
1899
|
onSubmitSuccess: r,
|
|
1886
1900
|
logger: t
|
|
1887
1901
|
}) => {
|
|
1888
1902
|
const {
|
|
1889
1903
|
t: s
|
|
1890
|
-
} =
|
|
1904
|
+
} = ne(), [i, a] = _e(), {
|
|
1891
1905
|
enabled: n,
|
|
1892
1906
|
getPredictions: o
|
|
1893
|
-
} =
|
|
1907
|
+
} = sn({
|
|
1894
1908
|
logger: t,
|
|
1895
1909
|
t: s
|
|
1896
|
-
}), [d,
|
|
1897
|
-
var
|
|
1898
|
-
if (Ce(n, "Query state should not be enabled"), y = y.trim(), y === ((
|
|
1910
|
+
}), [d, h] = _e(n ? "query" : "manual"), [v, x] = _e(""), [p, m] = _e(), k = ue(), V = ue(), I = (y) => {
|
|
1911
|
+
var E;
|
|
1912
|
+
if (Ce(n, "Query state should not be enabled"), y = y.trim(), y === ((E = k.current) == null ? void 0 : E.query) || y === (p == null ? void 0 : p.query) && p.status === "done")
|
|
1899
1913
|
return;
|
|
1900
1914
|
if (x(y), y === "") {
|
|
1901
1915
|
k.current = void 0, m(void 0);
|
|
@@ -1907,44 +1921,44 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1907
1921
|
m({
|
|
1908
1922
|
query: y,
|
|
1909
1923
|
status: "pending"
|
|
1910
|
-
}), o(y).then((
|
|
1911
|
-
k.current === C && (k.current = void 0, m(
|
|
1924
|
+
}), o(y).then((A) => {
|
|
1925
|
+
k.current === C && (k.current = void 0, m(A.ok ? {
|
|
1912
1926
|
query: y,
|
|
1913
1927
|
status: "done",
|
|
1914
|
-
items:
|
|
1928
|
+
items: A.data
|
|
1915
1929
|
} : {
|
|
1916
1930
|
query: y,
|
|
1917
1931
|
status: "failed",
|
|
1918
|
-
error:
|
|
1932
|
+
error: A.error
|
|
1919
1933
|
}));
|
|
1920
|
-
}, (
|
|
1921
|
-
k.current === C && (k.current = void 0, t.error("Failed to get address details",
|
|
1934
|
+
}, (A) => {
|
|
1935
|
+
k.current === C && (k.current = void 0, t.error("Failed to get address details", A), m({
|
|
1922
1936
|
query: y,
|
|
1923
1937
|
status: "failed",
|
|
1924
1938
|
error: s("address_error")
|
|
1925
1939
|
}));
|
|
1926
1940
|
});
|
|
1927
1941
|
}, N = (y, C) => {
|
|
1928
|
-
a((
|
|
1929
|
-
...
|
|
1942
|
+
a((E) => ({
|
|
1943
|
+
...E,
|
|
1930
1944
|
[y]: C
|
|
1931
1945
|
}));
|
|
1932
1946
|
};
|
|
1933
1947
|
switch (d) {
|
|
1934
1948
|
case "query":
|
|
1935
|
-
return Ce(n, "Query state should not be enabled"), u(
|
|
1949
|
+
return Ce(n, "Query state should not be enabled"), u(an, {
|
|
1936
1950
|
input: e,
|
|
1937
1951
|
onSkip: () => r(null),
|
|
1938
1952
|
onAddressSelect: (y) => {
|
|
1939
1953
|
if (y === "") {
|
|
1940
|
-
k.current && (k.current = void 0, m(void 0)),
|
|
1954
|
+
k.current && (k.current = void 0, m(void 0)), h("manual");
|
|
1941
1955
|
return;
|
|
1942
1956
|
}
|
|
1943
|
-
const C = (
|
|
1944
|
-
C && (
|
|
1957
|
+
const C = (p == null ? void 0 : p.status) === "done" ? p.items.find((E) => E.id === y) : void 0;
|
|
1958
|
+
C && (V.current !== y && a(C.address), V.current = y, h("details"));
|
|
1945
1959
|
},
|
|
1946
|
-
onAddressSearch:
|
|
1947
|
-
lookup:
|
|
1960
|
+
onAddressSearch: I,
|
|
1961
|
+
lookup: p,
|
|
1948
1962
|
query: v
|
|
1949
1963
|
});
|
|
1950
1964
|
case "details":
|
|
@@ -1956,7 +1970,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1956
1970
|
onFieldChange: N,
|
|
1957
1971
|
actions: u(Bt, {
|
|
1958
1972
|
onClick: () => {
|
|
1959
|
-
|
|
1973
|
+
h("query");
|
|
1960
1974
|
}
|
|
1961
1975
|
})
|
|
1962
1976
|
});
|
|
@@ -1969,12 +1983,12 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1969
1983
|
onFieldChange: N,
|
|
1970
1984
|
actions: n ? u(Bt, {
|
|
1971
1985
|
onClick: () => {
|
|
1972
|
-
|
|
1986
|
+
h("query");
|
|
1973
1987
|
}
|
|
1974
1988
|
}) : void 0
|
|
1975
1989
|
});
|
|
1976
1990
|
}
|
|
1977
|
-
},
|
|
1991
|
+
}, an = ({
|
|
1978
1992
|
input: e,
|
|
1979
1993
|
onSkip: r,
|
|
1980
1994
|
lookup: t,
|
|
@@ -1984,7 +1998,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1984
1998
|
}) => {
|
|
1985
1999
|
const {
|
|
1986
2000
|
t: n
|
|
1987
|
-
} =
|
|
2001
|
+
} = ne(), o = ue(null);
|
|
1988
2002
|
return xe(() => {
|
|
1989
2003
|
o.current && (o.current.focus(), o.current.select());
|
|
1990
2004
|
}, []), u(me, {
|
|
@@ -2006,7 +2020,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2006
2020
|
autoFocus: !0,
|
|
2007
2021
|
placeholder: e.config.placeholder || n("address_search"),
|
|
2008
2022
|
defaultValue: i,
|
|
2009
|
-
class:
|
|
2023
|
+
class: We({
|
|
2010
2024
|
optional: !!e.config.optional,
|
|
2011
2025
|
className: "w-full rounded-full"
|
|
2012
2026
|
})
|
|
@@ -2051,7 +2065,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2051
2065
|
role: "status",
|
|
2052
2066
|
class: (t == null ? void 0 : t.status) === "pending" || (t == null ? void 0 : t.status) === "done" && t.items.length === 0 ? "text-neutral-10 flex items-center gap-2 px-4 py-2 text-sm" : "sr-only",
|
|
2053
2067
|
children: (t == null ? void 0 : t.status) === "pending" ? u(me, {
|
|
2054
|
-
children: [u(
|
|
2068
|
+
children: [u(ht, {
|
|
2055
2069
|
"aria-hidden": "true",
|
|
2056
2070
|
class: "h-4 w-4 shrink-0"
|
|
2057
2071
|
}), n("address_searching")]
|
|
@@ -2110,11 +2124,11 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2110
2124
|
}, []);
|
|
2111
2125
|
const n = Object.keys(gt), {
|
|
2112
2126
|
t: o
|
|
2113
|
-
} =
|
|
2127
|
+
} = ne();
|
|
2114
2128
|
return u("form", {
|
|
2115
2129
|
class: "flex flex-col px-2 pt-2",
|
|
2116
2130
|
onSubmit: (d) => {
|
|
2117
|
-
const
|
|
2131
|
+
const h = new FormData(d.currentTarget), v = Object.fromEntries(h.entries());
|
|
2118
2132
|
t({
|
|
2119
2133
|
type: "address",
|
|
2120
2134
|
value: v
|
|
@@ -2123,7 +2137,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2123
2137
|
children: [u("div", {
|
|
2124
2138
|
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]",
|
|
2125
2139
|
ref: a,
|
|
2126
|
-
children: jt.map((d,
|
|
2140
|
+
children: jt.map((d, h) => {
|
|
2127
2141
|
const v = `isdk_${d}`, x = i.config.keys[d];
|
|
2128
2142
|
return x ? u(me, {
|
|
2129
2143
|
children: [u("label", {
|
|
@@ -2139,7 +2153,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2139
2153
|
name: x,
|
|
2140
2154
|
id: v,
|
|
2141
2155
|
defaultValue: e[d],
|
|
2142
|
-
onChange: (
|
|
2156
|
+
onChange: (p) => r(d, p.currentTarget.value),
|
|
2143
2157
|
required: !0,
|
|
2144
2158
|
children: [e.country && !n.includes(e.country) ? u("option", {
|
|
2145
2159
|
value: e[d],
|
|
@@ -2147,10 +2161,10 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2147
2161
|
}) : u("option", {
|
|
2148
2162
|
value: "",
|
|
2149
2163
|
children: o("select_country")
|
|
2150
|
-
}), n.map((
|
|
2151
|
-
value:
|
|
2152
|
-
children:
|
|
2153
|
-
},
|
|
2164
|
+
}), n.map((p) => u("option", {
|
|
2165
|
+
value: p,
|
|
2166
|
+
children: p
|
|
2167
|
+
}, p))]
|
|
2154
2168
|
}), u("svg", {
|
|
2155
2169
|
class: "text-neutral-12 absolute bottom-2.5 right-2 flex items-center justify-center",
|
|
2156
2170
|
width: "16",
|
|
@@ -2167,14 +2181,14 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2167
2181
|
})
|
|
2168
2182
|
})]
|
|
2169
2183
|
}) : u("input", {
|
|
2170
|
-
autoFocus:
|
|
2184
|
+
autoFocus: h === 0 ? !0 : void 0,
|
|
2171
2185
|
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",
|
|
2172
2186
|
name: x,
|
|
2173
2187
|
id: v,
|
|
2174
2188
|
defaultValue: e[d],
|
|
2175
|
-
onInput: (
|
|
2189
|
+
onInput: (p) => r(d, p.currentTarget.value),
|
|
2176
2190
|
required: !0
|
|
2177
|
-
}),
|
|
2191
|
+
}), h === jt.length - 1 ? u("hr", {
|
|
2178
2192
|
class: "m-0 w-full border-b border-b-transparent"
|
|
2179
2193
|
}) : u("hr", {
|
|
2180
2194
|
class: "border-b-neutral-5 m-0 w-full border-b border-solid"
|
|
@@ -2195,7 +2209,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2195
2209
|
var r;
|
|
2196
2210
|
(r = e.current) == null || r.focus();
|
|
2197
2211
|
}, []), e;
|
|
2198
|
-
}, Fr = ["true", "false"],
|
|
2212
|
+
}, Fr = ["true", "false"], on = /* @__PURE__ */ Ir(Fr), ln = "answer", Ar = "flex items-center flex-wrap gap-2 p-2.5", Er = "min-w-0 max-w-full flex-auto", Mr = fr(({
|
|
2199
2213
|
label: e,
|
|
2200
2214
|
...r
|
|
2201
2215
|
}, t) => u("button", {
|
|
@@ -2206,7 +2220,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2206
2220
|
class: "text-center text-base",
|
|
2207
2221
|
children: e
|
|
2208
2222
|
})
|
|
2209
|
-
})),
|
|
2223
|
+
})), un = ({
|
|
2210
2224
|
input: e,
|
|
2211
2225
|
onSubmitSuccess: r
|
|
2212
2226
|
}) => {
|
|
@@ -2216,7 +2230,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2216
2230
|
class: "",
|
|
2217
2231
|
onSubmit: (s) => {
|
|
2218
2232
|
s.preventDefault();
|
|
2219
|
-
const i = os(s).value, a =
|
|
2233
|
+
const i = os(s).value, a = Js(on, i);
|
|
2220
2234
|
r({
|
|
2221
2235
|
type: "boolean",
|
|
2222
2236
|
value: a === "true"
|
|
@@ -2229,7 +2243,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2229
2243
|
children: u(Mr, {
|
|
2230
2244
|
ref: i === 0 ? t : null,
|
|
2231
2245
|
type: "submit",
|
|
2232
|
-
name:
|
|
2246
|
+
name: ln,
|
|
2233
2247
|
value: s,
|
|
2234
2248
|
label: e.config.labels[s]
|
|
2235
2249
|
}, s)
|
|
@@ -2243,17 +2257,17 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2243
2257
|
})
|
|
2244
2258
|
})]
|
|
2245
2259
|
});
|
|
2246
|
-
},
|
|
2260
|
+
}, cn = (e) => new Promise((r, t) => {
|
|
2247
2261
|
const s = new FileReader();
|
|
2248
2262
|
s.onload = () => {
|
|
2249
2263
|
if (typeof s.result != "string" || !s.result)
|
|
2250
2264
|
return t(new Error("Invalid file"));
|
|
2251
2265
|
r(s.result);
|
|
2252
2266
|
}, s.onerror = t, s.readAsDataURL(e);
|
|
2253
|
-
}), $t = (e) => e.reduce((r, t) => r + t.sizeKb, 0),
|
|
2267
|
+
}), $t = (e) => e.reduce((r, t) => r + t.sizeKb, 0), dn = Ne("file"), qt = 3, vt = (e) => {
|
|
2254
2268
|
const r = e.lastIndexOf(".");
|
|
2255
2269
|
return r === -1 ? [e, ""] : [e.slice(0, r), e.slice(r)];
|
|
2256
|
-
},
|
|
2270
|
+
}, fn = ({
|
|
2257
2271
|
file: e,
|
|
2258
2272
|
class: r,
|
|
2259
2273
|
...t
|
|
@@ -2283,61 +2297,61 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2283
2297
|
}) => u("li", {
|
|
2284
2298
|
class: Me("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
|
|
2285
2299
|
...r
|
|
2286
|
-
}),
|
|
2300
|
+
}), pn = (e, r) => {
|
|
2287
2301
|
const [t, s] = vt(e);
|
|
2288
2302
|
return `${t.slice(0, r)}${s}`;
|
|
2289
2303
|
}, zt = (e) => ({
|
|
2290
|
-
name:
|
|
2304
|
+
name: pn(e.name, 42),
|
|
2291
2305
|
sizeKb: e.size / 1e3
|
|
2292
2306
|
}), hn = ({
|
|
2293
2307
|
input: e,
|
|
2294
2308
|
onSubmitSuccess: r
|
|
2295
2309
|
}) => {
|
|
2296
2310
|
var k;
|
|
2297
|
-
const t = (k =
|
|
2311
|
+
const t = (k = P.current$.value.flow) == null ? void 0 : k.data.submissions[e.key], [s, i] = _e(dn(t) && t.value.length ? {
|
|
2298
2312
|
status: "ready",
|
|
2299
2313
|
files: t.value
|
|
2300
2314
|
} : {
|
|
2301
2315
|
status: "empty"
|
|
2302
|
-
}), a = ue(0), n = s.status === "ready" ? s.files : [], o = s.status === "ready" || s.status === "pending" ? s.files : [], d = s.status === "error" ? s.error : void 0,
|
|
2303
|
-
t:
|
|
2304
|
-
} =
|
|
2305
|
-
if (!
|
|
2316
|
+
}), a = ue(0), n = s.status === "ready" ? s.files : [], o = s.status === "ready" || s.status === "pending" ? s.files : [], d = s.status === "error" ? s.error : void 0, h = o.length - qt, v = $t(o), x = bt(), {
|
|
2317
|
+
t: p
|
|
2318
|
+
} = ne(), m = (V) => {
|
|
2319
|
+
if (!V.length)
|
|
2306
2320
|
return {
|
|
2307
2321
|
type: "required",
|
|
2308
|
-
message:
|
|
2322
|
+
message: p("validation_file")
|
|
2309
2323
|
};
|
|
2310
|
-
if (!ls(
|
|
2324
|
+
if (!ls(V, e.config.extensions))
|
|
2311
2325
|
return {
|
|
2312
2326
|
type: "validate",
|
|
2313
|
-
message:
|
|
2327
|
+
message: p("validation_file_ext", {
|
|
2314
2328
|
ext: e.config.extensions.join(", ")
|
|
2315
2329
|
})
|
|
2316
2330
|
};
|
|
2317
|
-
if (e.config.fileSizeLimitKib && $t(
|
|
2331
|
+
if (e.config.fileSizeLimitKib && $t(V) > e.config.fileSizeLimitKib)
|
|
2318
2332
|
return {
|
|
2319
2333
|
type: "max",
|
|
2320
|
-
message:
|
|
2334
|
+
message: p("validation_file_size", {
|
|
2321
2335
|
size: Pe(e.config.fileSizeLimitKib)
|
|
2322
2336
|
})
|
|
2323
2337
|
};
|
|
2324
|
-
if (!e.config.allowMultiple &&
|
|
2338
|
+
if (!e.config.allowMultiple && V.length > 1)
|
|
2325
2339
|
return {
|
|
2326
2340
|
type: "invalid",
|
|
2327
|
-
message:
|
|
2341
|
+
message: p("validation_file_max", {
|
|
2328
2342
|
count: 1
|
|
2329
2343
|
})
|
|
2330
2344
|
};
|
|
2331
2345
|
};
|
|
2332
2346
|
return u("form", {
|
|
2333
2347
|
class: "flex flex-col gap-1 p-2.5",
|
|
2334
|
-
onSubmit: (
|
|
2335
|
-
if (
|
|
2348
|
+
onSubmit: (V) => {
|
|
2349
|
+
if (V.preventDefault(), s.status === "pending" || s.status === "error")
|
|
2336
2350
|
return;
|
|
2337
|
-
const
|
|
2338
|
-
|
|
2351
|
+
const I = m(n);
|
|
2352
|
+
I ? i({
|
|
2339
2353
|
status: "error",
|
|
2340
|
-
error:
|
|
2354
|
+
error: I
|
|
2341
2355
|
}) : r({
|
|
2342
2356
|
type: "file",
|
|
2343
2357
|
value: n
|
|
@@ -2351,19 +2365,19 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2351
2365
|
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",
|
|
2352
2366
|
children: [o.length > 0 ? u("ul", {
|
|
2353
2367
|
class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
|
|
2354
|
-
children: [o.slice(0, qt).map((
|
|
2355
|
-
const [
|
|
2368
|
+
children: [o.slice(0, qt).map((V) => {
|
|
2369
|
+
const [I, N] = vt(V.name);
|
|
2356
2370
|
return u(Ut, {
|
|
2357
2371
|
class: "flex overflow-hidden",
|
|
2358
2372
|
children: [u("span", {
|
|
2359
2373
|
class: "block truncate",
|
|
2360
|
-
children:
|
|
2374
|
+
children: I
|
|
2361
2375
|
}), u("span", {
|
|
2362
2376
|
children: N
|
|
2363
2377
|
})]
|
|
2364
2378
|
});
|
|
2365
|
-
}),
|
|
2366
|
-
children: ["+",
|
|
2379
|
+
}), h > 0 ? u(Ut, {
|
|
2380
|
+
children: ["+", h, " file", h !== 1 ? "s" : ""]
|
|
2367
2381
|
}) : null]
|
|
2368
2382
|
}) : u("div", {
|
|
2369
2383
|
class: "flex flex-col justify-center gap-4 pb-6 pt-5",
|
|
@@ -2384,12 +2398,12 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2384
2398
|
})
|
|
2385
2399
|
}), u("p", {
|
|
2386
2400
|
class: "text-neutral-12 tracking-[-0.01em]",
|
|
2387
|
-
children:
|
|
2401
|
+
children: p("upload_file", {
|
|
2388
2402
|
count: e.config.allowMultiple ? 2 : 1
|
|
2389
2403
|
})
|
|
2390
2404
|
}), e.config.fileSizeLimitKib ? u("p", {
|
|
2391
2405
|
class: "text-neutral-10 text-xs",
|
|
2392
|
-
children: ["(",
|
|
2406
|
+
children: ["(", p("file_max_size", {
|
|
2393
2407
|
size: Pe(e.config.fileSizeLimitKib)
|
|
2394
2408
|
}), ")"]
|
|
2395
2409
|
}) : null]
|
|
@@ -2398,13 +2412,13 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2398
2412
|
children: [u("p", {
|
|
2399
2413
|
id: "accepted-filetypes",
|
|
2400
2414
|
class: "sr-only",
|
|
2401
|
-
children:
|
|
2415
|
+
children: p("file_extensions")
|
|
2402
2416
|
}), u("ul", {
|
|
2403
2417
|
"aria-describedby": "accepted-filetypes",
|
|
2404
2418
|
class: "flex flex-wrap justify-center gap-2",
|
|
2405
|
-
children: e.config.extensions.map((
|
|
2419
|
+
children: e.config.extensions.map((V) => u("li", {
|
|
2406
2420
|
class: "ring-lowest outline-neutral-6 text-neutral-9 bg-neutral-1 rounded-md px-1 py-0.5 text-[11px] uppercase tracking-wide outline outline-1 ring-2",
|
|
2407
|
-
children:
|
|
2421
|
+
children: V.replace(".", "")
|
|
2408
2422
|
}))
|
|
2409
2423
|
})]
|
|
2410
2424
|
})]
|
|
@@ -2412,52 +2426,52 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2412
2426
|
role: "status",
|
|
2413
2427
|
class: Me("text-neutral-11 flex items-center gap-1.5 text-xs", o.length === 0 && "sr-only"),
|
|
2414
2428
|
children: s.status === "pending" ? u(me, {
|
|
2415
|
-
children: [u(
|
|
2429
|
+
children: [u(ht, {
|
|
2416
2430
|
"aria-hidden": "true",
|
|
2417
2431
|
class: "h-4 w-4"
|
|
2418
|
-
}),
|
|
2432
|
+
}), p("file_preparing", {
|
|
2419
2433
|
count: o.length
|
|
2420
2434
|
})]
|
|
2421
2435
|
}) : s.status === "ready" ? u(me, {
|
|
2422
2436
|
children: [Pe(v), " ", n.length > 1 ? "total" : "", u("span", {
|
|
2423
2437
|
class: "sr-only",
|
|
2424
|
-
children: [". ",
|
|
2438
|
+
children: [". ", p("file_ready", {
|
|
2425
2439
|
count: n.length
|
|
2426
2440
|
})]
|
|
2427
2441
|
})]
|
|
2428
2442
|
}) : null
|
|
2429
2443
|
}), u("input", {
|
|
2430
2444
|
id: "dropzone-file",
|
|
2431
|
-
onInput: async (
|
|
2432
|
-
Ce(
|
|
2433
|
-
const
|
|
2434
|
-
if (
|
|
2445
|
+
onInput: async (V) => {
|
|
2446
|
+
Ce(V.target instanceof HTMLInputElement);
|
|
2447
|
+
const I = V.target.files ? Array.from(V.target.files) : [];
|
|
2448
|
+
if (V.target.value = "", !I.length)
|
|
2435
2449
|
return;
|
|
2436
|
-
const N = ++a.current, y = s.status === "ready", C =
|
|
2437
|
-
if (
|
|
2450
|
+
const N = ++a.current, y = s.status === "ready", C = I.map(zt), E = m(C);
|
|
2451
|
+
if (E)
|
|
2438
2452
|
return i({
|
|
2439
2453
|
status: "error",
|
|
2440
|
-
error:
|
|
2454
|
+
error: E
|
|
2441
2455
|
});
|
|
2442
2456
|
i({
|
|
2443
2457
|
status: "pending",
|
|
2444
2458
|
files: C
|
|
2445
2459
|
});
|
|
2446
2460
|
try {
|
|
2447
|
-
const
|
|
2448
|
-
...zt(
|
|
2449
|
-
data: await
|
|
2461
|
+
const A = await Promise.all(I.map(async (B) => ({
|
|
2462
|
+
...zt(B),
|
|
2463
|
+
data: await cn(B)
|
|
2450
2464
|
})));
|
|
2451
2465
|
a.current === N && i({
|
|
2452
2466
|
status: "ready",
|
|
2453
|
-
files:
|
|
2467
|
+
files: A
|
|
2454
2468
|
});
|
|
2455
2469
|
} catch {
|
|
2456
2470
|
a.current === N && i({
|
|
2457
2471
|
status: "error",
|
|
2458
2472
|
error: {
|
|
2459
2473
|
type: "invalid",
|
|
2460
|
-
message:
|
|
2474
|
+
message: p(y ? "file_read_error_replacement" : "file_read_error")
|
|
2461
2475
|
}
|
|
2462
2476
|
});
|
|
2463
2477
|
}
|
|
@@ -2480,47 +2494,47 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2480
2494
|
})]
|
|
2481
2495
|
});
|
|
2482
2496
|
};
|
|
2483
|
-
var
|
|
2497
|
+
var Ke = (e) => e.type === "checkbox", ke = (e) => e instanceof Date, te = (e) => e == null;
|
|
2484
2498
|
const Nr = (e) => typeof e == "object";
|
|
2485
|
-
var K = (e) => !
|
|
2499
|
+
var K = (e) => !te(e) && !Array.isArray(e) && Nr(e) && !ke(e), yn = (e) => K(e) && e.target ? Ke(e.target) ? e.target.checked : e.target.value : e, mn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, gn = (e, r) => e.has(mn(r)), bn = (e) => {
|
|
2486
2500
|
const r = e.constructor && e.constructor.prototype;
|
|
2487
2501
|
return K(r) && r.hasOwnProperty("isPrototypeOf");
|
|
2488
2502
|
}, xt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
2489
|
-
function
|
|
2503
|
+
function G(e) {
|
|
2490
2504
|
if (e instanceof Date)
|
|
2491
2505
|
return new Date(e);
|
|
2492
2506
|
const r = typeof FileList < "u" && e instanceof FileList;
|
|
2493
2507
|
if (xt && (e instanceof Blob || r))
|
|
2494
2508
|
return e;
|
|
2495
2509
|
const t = Array.isArray(e);
|
|
2496
|
-
if (!t && !(K(e) &&
|
|
2510
|
+
if (!t && !(K(e) && bn(e)))
|
|
2497
2511
|
return e;
|
|
2498
2512
|
const s = t ? [] : Object.create(Object.getPrototypeOf(e));
|
|
2499
2513
|
for (const i in e)
|
|
2500
|
-
Object.prototype.hasOwnProperty.call(e, i) && (s[i] =
|
|
2514
|
+
Object.prototype.hasOwnProperty.call(e, i) && (s[i] = G(e[i]));
|
|
2501
2515
|
return s;
|
|
2502
2516
|
}
|
|
2503
2517
|
var Ye = (e) => /^\w*$/.test(e), q = (e) => e === void 0, wt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], _t = (e) => wt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), _ = (e, r, t) => {
|
|
2504
2518
|
if (!r || !K(e))
|
|
2505
2519
|
return t;
|
|
2506
|
-
const s = (Ye(r) ? [r] : _t(r)).reduce((i, a) =>
|
|
2520
|
+
const s = (Ye(r) ? [r] : _t(r)).reduce((i, a) => te(i) ? i : i[a], e);
|
|
2507
2521
|
return q(s) || s === e ? q(e[r]) ? t : e[r] : s;
|
|
2508
|
-
}, le = (e) => typeof e == "boolean", ae = (e) => typeof e == "function",
|
|
2522
|
+
}, le = (e) => typeof e == "boolean", ae = (e) => typeof e == "function", j = (e, r, t) => {
|
|
2509
2523
|
let s = -1;
|
|
2510
2524
|
const i = Ye(r) ? [r] : _t(r), a = i.length, n = a - 1;
|
|
2511
2525
|
for (; ++s < a; ) {
|
|
2512
2526
|
const o = i[s];
|
|
2513
2527
|
let d = t;
|
|
2514
2528
|
if (s !== n) {
|
|
2515
|
-
const
|
|
2516
|
-
d = K(
|
|
2529
|
+
const h = e[o];
|
|
2530
|
+
d = K(h) || Array.isArray(h) ? h : isNaN(+i[s + 1]) ? {} : [];
|
|
2517
2531
|
}
|
|
2518
2532
|
if (o === "__proto__" || o === "constructor" || o === "prototype")
|
|
2519
2533
|
return;
|
|
2520
2534
|
e[o] = d, e = e[o];
|
|
2521
2535
|
}
|
|
2522
2536
|
};
|
|
2523
|
-
const
|
|
2537
|
+
const Wt = {
|
|
2524
2538
|
BLUR: "blur",
|
|
2525
2539
|
FOCUS_OUT: "focusout",
|
|
2526
2540
|
CHANGE: "change"
|
|
@@ -2530,7 +2544,7 @@ const Kt = {
|
|
|
2530
2544
|
onSubmit: "onSubmit",
|
|
2531
2545
|
onTouched: "onTouched",
|
|
2532
2546
|
all: "all"
|
|
2533
|
-
},
|
|
2547
|
+
}, he = {
|
|
2534
2548
|
max: "max",
|
|
2535
2549
|
min: "min",
|
|
2536
2550
|
maxLength: "maxLength",
|
|
@@ -2538,9 +2552,9 @@ const Kt = {
|
|
|
2538
2552
|
pattern: "pattern",
|
|
2539
2553
|
required: "required",
|
|
2540
2554
|
validate: "validate"
|
|
2541
|
-
},
|
|
2542
|
-
|
|
2543
|
-
var
|
|
2555
|
+
}, vn = Q.createContext(null);
|
|
2556
|
+
vn.displayName = "HookFormControlContext";
|
|
2557
|
+
var xn = (e, r, t, s = !0) => {
|
|
2544
2558
|
const i = {
|
|
2545
2559
|
defaultValues: r._defaultValues
|
|
2546
2560
|
};
|
|
@@ -2553,8 +2567,8 @@ var vn = (e, r, t, s = !0) => {
|
|
|
2553
2567
|
});
|
|
2554
2568
|
return i;
|
|
2555
2569
|
};
|
|
2556
|
-
const
|
|
2557
|
-
var
|
|
2570
|
+
const wn = typeof window < "u" ? Q.useLayoutEffect : Q.useEffect;
|
|
2571
|
+
var re = (e) => typeof e == "string", _n = (e, r, t, s, i) => re(e) ? (s && r.watch.add(e), _(t, e, i)) : Array.isArray(e) ? e.map((a) => (s && r.watch.add(a), _(t, a))) : (s && (r.watchAll = !0), t), dt = (e) => te(e) || !Nr(e);
|
|
2558
2572
|
function be(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
2559
2573
|
if (dt(e) || dt(r))
|
|
2560
2574
|
return Object.is(e, r);
|
|
@@ -2578,15 +2592,15 @@ function be(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
|
2578
2592
|
}
|
|
2579
2593
|
return !0;
|
|
2580
2594
|
}
|
|
2581
|
-
const
|
|
2582
|
-
|
|
2595
|
+
const kn = Q.createContext(null);
|
|
2596
|
+
kn.displayName = "HookFormContext";
|
|
2583
2597
|
var Lr = (e, r, t, s, i) => r ? {
|
|
2584
2598
|
...t[e],
|
|
2585
2599
|
types: {
|
|
2586
2600
|
...t[e] && t[e].types ? t[e].types : {},
|
|
2587
2601
|
[s]: i || !0
|
|
2588
2602
|
}
|
|
2589
|
-
} : {}, Ue = (e) => Array.isArray(e) ? e : [e],
|
|
2603
|
+
} : {}, Ue = (e) => Array.isArray(e) ? e : [e], Kt = () => {
|
|
2590
2604
|
let e = [];
|
|
2591
2605
|
return {
|
|
2592
2606
|
get observers() {
|
|
@@ -2619,37 +2633,37 @@ function Dr(e, r) {
|
|
|
2619
2633
|
}
|
|
2620
2634
|
return t;
|
|
2621
2635
|
}
|
|
2622
|
-
var
|
|
2636
|
+
var ee = (e) => K(e) && !Object.keys(e).length, kt = (e) => e.type === "file", Ge = (e) => {
|
|
2623
2637
|
if (!xt)
|
|
2624
2638
|
return !1;
|
|
2625
2639
|
const r = e ? e.ownerDocument : 0;
|
|
2626
2640
|
return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
|
|
2627
|
-
}, Tr = (e) => e.type === "select-multiple", Ct = (e) => e.type === "radio",
|
|
2628
|
-
function
|
|
2641
|
+
}, Tr = (e) => e.type === "select-multiple", Ct = (e) => e.type === "radio", Cn = (e) => Ct(e) || Ke(e), ut = (e) => Ge(e) && e.isConnected;
|
|
2642
|
+
function Sn(e, r) {
|
|
2629
2643
|
const t = r.slice(0, -1).length;
|
|
2630
2644
|
let s = 0;
|
|
2631
2645
|
for (; s < t; )
|
|
2632
2646
|
e = q(e) ? s++ : e[r[s++]];
|
|
2633
2647
|
return e;
|
|
2634
2648
|
}
|
|
2635
|
-
function
|
|
2649
|
+
function In(e) {
|
|
2636
2650
|
for (const r in e)
|
|
2637
2651
|
if (e.hasOwnProperty(r) && !q(e[r]))
|
|
2638
2652
|
return !1;
|
|
2639
2653
|
return !0;
|
|
2640
2654
|
}
|
|
2641
|
-
function
|
|
2642
|
-
const t = Array.isArray(r) ? r : Ye(r) ? [r] : _t(r), s = t.length === 1 ? e :
|
|
2643
|
-
return s && delete s[a], i !== 0 && (K(s) &&
|
|
2655
|
+
function W(e, r) {
|
|
2656
|
+
const t = Array.isArray(r) ? r : Ye(r) ? [r] : _t(r), s = t.length === 1 ? e : Sn(e, t), i = t.length - 1, a = t[i];
|
|
2657
|
+
return s && delete s[a], i !== 0 && (K(s) && ee(s) || Array.isArray(s) && In(s)) && W(e, t.slice(0, -1)), e;
|
|
2644
2658
|
}
|
|
2645
|
-
var
|
|
2659
|
+
var Vn = (e) => {
|
|
2646
2660
|
for (const r in e)
|
|
2647
2661
|
if (ae(e[r]))
|
|
2648
2662
|
return !0;
|
|
2649
2663
|
return !1;
|
|
2650
2664
|
};
|
|
2651
2665
|
function Or(e) {
|
|
2652
|
-
return Array.isArray(e) || K(e) && !
|
|
2666
|
+
return Array.isArray(e) || K(e) && !Vn(e);
|
|
2653
2667
|
}
|
|
2654
2668
|
function ft(e, r = {}) {
|
|
2655
2669
|
for (const t in e) {
|
|
@@ -2663,7 +2677,7 @@ function Fe(e, r, t) {
|
|
|
2663
2677
|
for (const s in e) {
|
|
2664
2678
|
const i = e[s];
|
|
2665
2679
|
if (Or(i))
|
|
2666
|
-
q(r) || dt(t[s]) ? t[s] = ft(i, Array.isArray(i) ? [] : {}) : Fe(i,
|
|
2680
|
+
q(r) || dt(t[s]) ? t[s] = ft(i, Array.isArray(i) ? [] : {}) : Fe(i, te(r) ? {} : r[s], t[s]);
|
|
2667
2681
|
else {
|
|
2668
2682
|
const a = r[s];
|
|
2669
2683
|
t[s] = !be(i, a);
|
|
@@ -2687,7 +2701,7 @@ var Rr = (e) => {
|
|
|
2687
2701
|
) : Gt;
|
|
2688
2702
|
}
|
|
2689
2703
|
return Gt;
|
|
2690
|
-
}, Br = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: s }) => q(e) ? e : r ? e === "" ? NaN : e && +e : t &&
|
|
2704
|
+
}, Br = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: s }) => q(e) ? e : r ? e === "" ? NaN : e && +e : t && re(e) ? new Date(e) : s ? s(e) : e;
|
|
2691
2705
|
const Jt = {
|
|
2692
2706
|
isValid: !1,
|
|
2693
2707
|
value: null
|
|
@@ -2698,13 +2712,13 @@ var jr = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disab
|
|
|
2698
2712
|
} : r, Jt) : Jt;
|
|
2699
2713
|
function Zt(e) {
|
|
2700
2714
|
const r = e.ref;
|
|
2701
|
-
return kt(r) ? r.files : Ct(r) ? jr(e.refs).value : Tr(r) ? [...r.selectedOptions].map(({ value: t }) => t) :
|
|
2715
|
+
return kt(r) ? r.files : Ct(r) ? jr(e.refs).value : Tr(r) ? [...r.selectedOptions].map(({ value: t }) => t) : Ke(r) ? Rr(e.refs).value : Br(q(r.value) ? e.ref.value : r.value, e);
|
|
2702
2716
|
}
|
|
2703
|
-
var
|
|
2717
|
+
var Fn = (e, r, t, s) => {
|
|
2704
2718
|
const i = {};
|
|
2705
2719
|
for (const a of e) {
|
|
2706
2720
|
const n = _(r, a);
|
|
2707
|
-
n &&
|
|
2721
|
+
n && j(i, a, n._f);
|
|
2708
2722
|
}
|
|
2709
2723
|
return {
|
|
2710
2724
|
criteriaMode: t,
|
|
@@ -2720,7 +2734,7 @@ var Vn = (e, r, t, s) => {
|
|
|
2720
2734
|
isOnTouch: e === oe.onTouched
|
|
2721
2735
|
});
|
|
2722
2736
|
const Yt = "AsyncFunction";
|
|
2723
|
-
var
|
|
2737
|
+
var An = (e) => !!e && !!e.validate && !!(ae(e.validate) && e.validate.constructor.name === Yt || K(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === Yt)), En = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), Qt = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((s) => e.startsWith(s) && /^\.\w+/.test(e.slice(s.length))));
|
|
2724
2738
|
const ze = (e, r, t, s) => {
|
|
2725
2739
|
for (const i of t || Object.keys(e)) {
|
|
2726
2740
|
const a = _(e, i);
|
|
@@ -2766,19 +2780,19 @@ function er(e, r, t) {
|
|
|
2766
2780
|
name: t
|
|
2767
2781
|
};
|
|
2768
2782
|
}
|
|
2769
|
-
var
|
|
2783
|
+
var Mn = (e, r, t, s) => {
|
|
2770
2784
|
t(e);
|
|
2771
2785
|
const { name: i, ...a } = e;
|
|
2772
|
-
return
|
|
2773
|
-
},
|
|
2786
|
+
return ee(a) || Object.keys(a).length >= Object.keys(r).length || Object.keys(a).find((n) => r[n] === (!s || oe.all));
|
|
2787
|
+
}, Nn = (e, r, t) => !e || !r || e === r || Ue(e).some((s) => s && (t ? s === r : s.startsWith(r) || r.startsWith(s))), Ln = (e, r, t, s, i) => i.isOnAll ? !1 : !t && i.isOnTouch ? !(r || e) : (t ? s.isOnBlur : i.isOnBlur) ? !e : (t ? s.isOnChange : i.isOnChange) ? e : !0, Dn = (e, r) => !wt(_(e, r)).length && W(e, r), Tn = (e, r, t) => {
|
|
2774
2788
|
const s = Ue(_(e, t));
|
|
2775
|
-
return
|
|
2789
|
+
return j(s, "root", r[t]), j(e, t, s), e;
|
|
2776
2790
|
};
|
|
2777
2791
|
function tr(e, r, t = "validate") {
|
|
2778
|
-
if (
|
|
2792
|
+
if (re(e) || Array.isArray(e) && e.every(re) || le(e) && !e)
|
|
2779
2793
|
return {
|
|
2780
2794
|
type: t,
|
|
2781
|
-
message:
|
|
2795
|
+
message: re(e) ? e : "",
|
|
2782
2796
|
ref: r
|
|
2783
2797
|
};
|
|
2784
2798
|
}
|
|
@@ -2786,94 +2800,94 @@ var Ve = (e) => K(e) && !He(e) ? e : {
|
|
|
2786
2800
|
value: e,
|
|
2787
2801
|
message: ""
|
|
2788
2802
|
}, rr = async (e, r, t, s, i, a) => {
|
|
2789
|
-
const { ref: n, refs: o, required: d, maxLength:
|
|
2790
|
-
if (!N || r.has(
|
|
2803
|
+
const { ref: n, refs: o, required: d, maxLength: h, minLength: v, min: x, max: p, pattern: m, validate: k, name: V, valueAsNumber: I, mount: N } = e._f, y = _(t, V);
|
|
2804
|
+
if (!N || r.has(V))
|
|
2791
2805
|
return {};
|
|
2792
|
-
const C = o ? o[0] : n,
|
|
2793
|
-
i && C.reportValidity && (C.setCustomValidity(le(
|
|
2794
|
-
},
|
|
2795
|
-
const
|
|
2796
|
-
|
|
2797
|
-
type:
|
|
2798
|
-
message:
|
|
2806
|
+
const C = o ? o[0] : n, E = (M) => {
|
|
2807
|
+
i && C.reportValidity && (C.setCustomValidity(le(M) ? "" : M || ""), C.reportValidity());
|
|
2808
|
+
}, A = {}, B = Ct(n), J = Ke(n), D = B || J, $ = (I || kt(n)) && q(n.value) && q(y) || Ge(n) && n.value === "" || y === "" || Array.isArray(y) && !y.length, F = Lr.bind(null, V, s, A), H = (M, T, L, U = he.maxLength, Z = he.minLength) => {
|
|
2809
|
+
const z = M ? T : L;
|
|
2810
|
+
A[V] = {
|
|
2811
|
+
type: M ? U : Z,
|
|
2812
|
+
message: z,
|
|
2799
2813
|
ref: n,
|
|
2800
|
-
...
|
|
2814
|
+
...F(M ? U : Z, z)
|
|
2801
2815
|
};
|
|
2802
2816
|
};
|
|
2803
|
-
if (a ? !Array.isArray(y) || !y.length : d && (!
|
|
2804
|
-
const { value:
|
|
2805
|
-
if (
|
|
2806
|
-
type:
|
|
2807
|
-
message:
|
|
2817
|
+
if (a ? !Array.isArray(y) || !y.length : d && (!D && ($ || te(y)) || le(y) && !y || J && !Rr(o).isValid || B && !jr(o).isValid)) {
|
|
2818
|
+
const { value: M, message: T } = re(d) ? { value: !!d, message: d } : Ve(d);
|
|
2819
|
+
if (M && (A[V] = {
|
|
2820
|
+
type: he.required,
|
|
2821
|
+
message: T,
|
|
2808
2822
|
ref: C,
|
|
2809
|
-
...
|
|
2823
|
+
...F(he.required, T)
|
|
2810
2824
|
}, !s))
|
|
2811
|
-
return
|
|
2825
|
+
return E(T), A;
|
|
2812
2826
|
}
|
|
2813
|
-
if (
|
|
2814
|
-
let
|
|
2815
|
-
const
|
|
2816
|
-
if (!
|
|
2817
|
-
const
|
|
2818
|
-
|
|
2827
|
+
if (!$ && (!te(x) || !te(p))) {
|
|
2828
|
+
let M, T;
|
|
2829
|
+
const L = Ve(p), U = Ve(x);
|
|
2830
|
+
if (!te(y) && !isNaN(y)) {
|
|
2831
|
+
const Z = n.valueAsNumber || y && +y;
|
|
2832
|
+
te(L.value) || (M = Z > L.value), te(U.value) || (T = Z < U.value);
|
|
2819
2833
|
} else {
|
|
2820
|
-
const
|
|
2821
|
-
|
|
2834
|
+
const Z = n.valueAsDate || new Date(y), z = (Oe) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + Oe), De = n.type == "time", Te = n.type == "week";
|
|
2835
|
+
re(L.value) && y && (M = De ? z(y) > z(L.value) : Te ? y > L.value : Z > new Date(L.value)), re(U.value) && y && (T = De ? z(y) < z(U.value) : Te ? y < U.value : Z < new Date(U.value));
|
|
2822
2836
|
}
|
|
2823
|
-
if ((
|
|
2824
|
-
return
|
|
2837
|
+
if ((M || T) && (H(!!M, L.message, U.message, he.max, he.min), !s))
|
|
2838
|
+
return E(A[V].message), A;
|
|
2825
2839
|
}
|
|
2826
|
-
if ((
|
|
2827
|
-
const
|
|
2828
|
-
if ((
|
|
2829
|
-
return
|
|
2840
|
+
if ((h || v) && !$ && (re(y) || a && Array.isArray(y))) {
|
|
2841
|
+
const M = Ve(h), T = Ve(v), L = !te(M.value) && y.length > +M.value, U = !te(T.value) && y.length < +T.value;
|
|
2842
|
+
if ((L || U) && (H(L, M.message, T.message), !s))
|
|
2843
|
+
return E(A[V].message), A;
|
|
2830
2844
|
}
|
|
2831
|
-
if (m &&
|
|
2832
|
-
const { value:
|
|
2833
|
-
if (He(
|
|
2834
|
-
type:
|
|
2835
|
-
message:
|
|
2845
|
+
if (m && !$ && re(y)) {
|
|
2846
|
+
const { value: M, message: T } = Ve(m);
|
|
2847
|
+
if (He(M) && !y.match(M) && (A[V] = {
|
|
2848
|
+
type: he.pattern,
|
|
2849
|
+
message: T,
|
|
2836
2850
|
ref: n,
|
|
2837
|
-
...
|
|
2851
|
+
...F(he.pattern, T)
|
|
2838
2852
|
}, !s))
|
|
2839
|
-
return
|
|
2853
|
+
return E(T), A;
|
|
2840
2854
|
}
|
|
2841
2855
|
if (k) {
|
|
2842
2856
|
if (ae(k)) {
|
|
2843
|
-
const
|
|
2844
|
-
if (
|
|
2845
|
-
...
|
|
2846
|
-
...
|
|
2857
|
+
const M = await k(y, t), T = tr(M, C);
|
|
2858
|
+
if (T && (A[V] = {
|
|
2859
|
+
...T,
|
|
2860
|
+
...F(he.validate, T.message)
|
|
2847
2861
|
}, !s))
|
|
2848
|
-
return
|
|
2862
|
+
return E(T.message), A;
|
|
2849
2863
|
} else if (K(k)) {
|
|
2850
|
-
let
|
|
2851
|
-
for (const
|
|
2852
|
-
if (!
|
|
2864
|
+
let M = {};
|
|
2865
|
+
for (const T in k) {
|
|
2866
|
+
if (!ee(M) && !s)
|
|
2853
2867
|
break;
|
|
2854
|
-
const
|
|
2855
|
-
|
|
2856
|
-
...
|
|
2857
|
-
...
|
|
2858
|
-
},
|
|
2868
|
+
const L = tr(await k[T](y, t), C, T);
|
|
2869
|
+
L && (M = {
|
|
2870
|
+
...L,
|
|
2871
|
+
...F(T, L.message)
|
|
2872
|
+
}, E(L.message), s && (A[V] = M));
|
|
2859
2873
|
}
|
|
2860
|
-
if (!
|
|
2874
|
+
if (!ee(M) && (A[V] = {
|
|
2861
2875
|
ref: C,
|
|
2862
|
-
...
|
|
2876
|
+
...M
|
|
2863
2877
|
}, !s))
|
|
2864
|
-
return
|
|
2878
|
+
return A;
|
|
2865
2879
|
}
|
|
2866
2880
|
}
|
|
2867
|
-
return
|
|
2881
|
+
return E(!0), A;
|
|
2868
2882
|
};
|
|
2869
|
-
const
|
|
2883
|
+
const On = {
|
|
2870
2884
|
mode: oe.onSubmit,
|
|
2871
2885
|
reValidateMode: oe.onChange,
|
|
2872
2886
|
shouldFocusError: !0
|
|
2873
2887
|
};
|
|
2874
|
-
function
|
|
2888
|
+
function Rn(e = {}) {
|
|
2875
2889
|
let r = {
|
|
2876
|
-
...
|
|
2890
|
+
...On,
|
|
2877
2891
|
...e
|
|
2878
2892
|
}, t = {
|
|
2879
2893
|
submitCount: 0,
|
|
@@ -2890,7 +2904,7 @@ function On(e = {}) {
|
|
|
2890
2904
|
validatingFields: {},
|
|
2891
2905
|
errors: r.errors || {},
|
|
2892
2906
|
disabled: r.disabled || !1
|
|
2893
|
-
}, s = {}, i = K(r.defaultValues) || K(r.values) ?
|
|
2907
|
+
}, s = {}, i = K(r.defaultValues) || K(r.values) ? G(r.defaultValues || r.values) || {} : {}, a = r.shouldUnregister ? {} : G(i), n = {
|
|
2894
2908
|
action: !1,
|
|
2895
2909
|
mount: !1,
|
|
2896
2910
|
watch: !1,
|
|
@@ -2901,7 +2915,7 @@ function On(e = {}) {
|
|
|
2901
2915
|
unMount: /* @__PURE__ */ new Set(),
|
|
2902
2916
|
array: /* @__PURE__ */ new Set(),
|
|
2903
2917
|
watch: /* @__PURE__ */ new Set()
|
|
2904
|
-
}, d,
|
|
2918
|
+
}, d, h = 0;
|
|
2905
2919
|
const v = {
|
|
2906
2920
|
isDirty: !1,
|
|
2907
2921
|
dirtyFields: !1,
|
|
@@ -2913,88 +2927,88 @@ function On(e = {}) {
|
|
|
2913
2927
|
}, x = {
|
|
2914
2928
|
...v
|
|
2915
2929
|
};
|
|
2916
|
-
let
|
|
2930
|
+
let p = {
|
|
2917
2931
|
...x
|
|
2918
2932
|
};
|
|
2919
2933
|
const m = {
|
|
2920
|
-
array:
|
|
2921
|
-
state:
|
|
2922
|
-
}, k = r.criteriaMode === oe.all,
|
|
2923
|
-
clearTimeout(
|
|
2924
|
-
},
|
|
2925
|
-
if (!n.keepIsValid && !r.disabled && (x.isValid ||
|
|
2934
|
+
array: Kt(),
|
|
2935
|
+
state: Kt()
|
|
2936
|
+
}, k = r.criteriaMode === oe.all, V = (l) => (c) => {
|
|
2937
|
+
clearTimeout(h), h = setTimeout(l, c);
|
|
2938
|
+
}, I = async (l) => {
|
|
2939
|
+
if (!n.keepIsValid && !r.disabled && (x.isValid || p.isValid || l)) {
|
|
2926
2940
|
let c;
|
|
2927
|
-
r.resolver ? (c =
|
|
2941
|
+
r.resolver ? (c = ee((await D()).errors), N()) : c = await F(s, !0), c !== t.isValid && m.state.next({
|
|
2928
2942
|
isValid: c
|
|
2929
2943
|
});
|
|
2930
2944
|
}
|
|
2931
2945
|
}, N = (l, c) => {
|
|
2932
|
-
!r.disabled && (x.isValidating || x.validatingFields ||
|
|
2933
|
-
f && (c ?
|
|
2946
|
+
!r.disabled && (x.isValidating || x.validatingFields || p.isValidating || p.validatingFields) && ((l || Array.from(o.mount)).forEach((f) => {
|
|
2947
|
+
f && (c ? j(t.validatingFields, f, c) : W(t.validatingFields, f));
|
|
2934
2948
|
}), m.state.next({
|
|
2935
2949
|
validatingFields: t.validatingFields,
|
|
2936
|
-
isValidating: !
|
|
2950
|
+
isValidating: !ee(t.validatingFields)
|
|
2937
2951
|
}));
|
|
2938
2952
|
}, y = (l, c = [], f, w, b = !0, g = !0) => {
|
|
2939
2953
|
if (w && f && !r.disabled) {
|
|
2940
2954
|
if (n.action = !0, g && Array.isArray(_(s, l))) {
|
|
2941
|
-
const
|
|
2942
|
-
b &&
|
|
2955
|
+
const S = f(_(s, l), w.argA, w.argB);
|
|
2956
|
+
b && j(s, l, S);
|
|
2943
2957
|
}
|
|
2944
2958
|
if (g && Array.isArray(_(t.errors, l))) {
|
|
2945
|
-
const
|
|
2946
|
-
b &&
|
|
2959
|
+
const S = f(_(t.errors, l), w.argA, w.argB);
|
|
2960
|
+
b && j(t.errors, l, S), Dn(t.errors, l);
|
|
2947
2961
|
}
|
|
2948
|
-
if ((x.touchedFields ||
|
|
2949
|
-
const
|
|
2950
|
-
b &&
|
|
2962
|
+
if ((x.touchedFields || p.touchedFields) && g && Array.isArray(_(t.touchedFields, l))) {
|
|
2963
|
+
const S = f(_(t.touchedFields, l), w.argA, w.argB);
|
|
2964
|
+
b && j(t.touchedFields, l, S);
|
|
2951
2965
|
}
|
|
2952
|
-
(x.dirtyFields ||
|
|
2966
|
+
(x.dirtyFields || p.dirtyFields) && (t.dirtyFields = Fe(i, a)), m.state.next({
|
|
2953
2967
|
name: l,
|
|
2954
|
-
isDirty:
|
|
2968
|
+
isDirty: M(l, c),
|
|
2955
2969
|
dirtyFields: t.dirtyFields,
|
|
2956
2970
|
errors: t.errors,
|
|
2957
2971
|
isValid: t.isValid
|
|
2958
2972
|
});
|
|
2959
2973
|
} else
|
|
2960
|
-
|
|
2974
|
+
j(a, l, c);
|
|
2961
2975
|
}, C = (l, c) => {
|
|
2962
|
-
|
|
2976
|
+
j(t.errors, l, c), m.state.next({
|
|
2963
2977
|
errors: t.errors
|
|
2964
2978
|
});
|
|
2965
|
-
},
|
|
2979
|
+
}, E = (l) => {
|
|
2966
2980
|
t.errors = l, m.state.next({
|
|
2967
2981
|
errors: t.errors,
|
|
2968
2982
|
isValid: !1
|
|
2969
2983
|
});
|
|
2970
|
-
},
|
|
2984
|
+
}, A = (l, c, f, w) => {
|
|
2971
2985
|
const b = _(s, l);
|
|
2972
2986
|
if (b) {
|
|
2973
2987
|
const g = _(a, l, q(f) ? _(i, l) : f);
|
|
2974
|
-
q(g) || w && w.defaultChecked || c ?
|
|
2988
|
+
q(g) || w && w.defaultChecked || c ? j(a, l, c ? g : Zt(b._f)) : U(l, g), n.mount && !n.action && I();
|
|
2975
2989
|
}
|
|
2976
|
-
},
|
|
2977
|
-
let g = !1,
|
|
2978
|
-
const
|
|
2990
|
+
}, B = (l, c, f, w, b) => {
|
|
2991
|
+
let g = !1, S = !1;
|
|
2992
|
+
const O = {
|
|
2979
2993
|
name: l
|
|
2980
2994
|
};
|
|
2981
2995
|
if (!r.disabled) {
|
|
2982
2996
|
if (!f || w) {
|
|
2983
|
-
(x.isDirty ||
|
|
2984
|
-
const
|
|
2985
|
-
|
|
2997
|
+
(x.isDirty || p.isDirty) && (S = t.isDirty, t.isDirty = O.isDirty = M(), g = S !== O.isDirty);
|
|
2998
|
+
const R = be(_(i, l), c);
|
|
2999
|
+
S = !!_(t.dirtyFields, l), R ? W(t.dirtyFields, l) : j(t.dirtyFields, l, !0), O.dirtyFields = t.dirtyFields, g = g || (x.dirtyFields || p.dirtyFields) && S !== !R;
|
|
2986
3000
|
}
|
|
2987
3001
|
if (f) {
|
|
2988
|
-
const
|
|
2989
|
-
|
|
3002
|
+
const R = _(t.touchedFields, l);
|
|
3003
|
+
R || (j(t.touchedFields, l, f), O.touchedFields = t.touchedFields, g = g || (x.touchedFields || p.touchedFields) && R !== f);
|
|
2990
3004
|
}
|
|
2991
|
-
g && b && m.state.next(
|
|
3005
|
+
g && b && m.state.next(O);
|
|
2992
3006
|
}
|
|
2993
|
-
return g ?
|
|
3007
|
+
return g ? O : {};
|
|
2994
3008
|
}, J = (l, c, f, w) => {
|
|
2995
|
-
const b = _(t.errors, l), g = (x.isValid ||
|
|
2996
|
-
if (r.delayError && f ? (d =
|
|
2997
|
-
const
|
|
3009
|
+
const b = _(t.errors, l), g = (x.isValid || p.isValid) && le(c) && t.isValid !== c;
|
|
3010
|
+
if (r.delayError && f ? (d = V(() => C(l, f)), d(r.delayError)) : (clearTimeout(h), d = null, f ? j(t.errors, l, f) : W(t.errors, l)), (f ? !be(b, f) : b) || !ee(w) || g) {
|
|
3011
|
+
const S = {
|
|
2998
3012
|
...w,
|
|
2999
3013
|
...g && le(c) ? { isValid: c } : {},
|
|
3000
3014
|
errors: t.errors,
|
|
@@ -3002,110 +3016,110 @@ function On(e = {}) {
|
|
|
3002
3016
|
};
|
|
3003
3017
|
t = {
|
|
3004
3018
|
...t,
|
|
3005
|
-
...
|
|
3006
|
-
}, m.state.next(
|
|
3019
|
+
...S
|
|
3020
|
+
}, m.state.next(S);
|
|
3007
3021
|
}
|
|
3008
|
-
},
|
|
3009
|
-
const { errors: c } = await
|
|
3022
|
+
}, D = async (l) => (N(l, !0), await r.resolver(a, r.context, Fn(l || o.mount, s, r.criteriaMode, r.shouldUseNativeValidation))), $ = async (l) => {
|
|
3023
|
+
const { errors: c } = await D(l);
|
|
3010
3024
|
if (N(l), l)
|
|
3011
3025
|
for (const f of l) {
|
|
3012
3026
|
const w = _(c, f);
|
|
3013
|
-
w ?
|
|
3027
|
+
w ? j(t.errors, f, w) : W(t.errors, f);
|
|
3014
3028
|
}
|
|
3015
3029
|
else
|
|
3016
3030
|
t.errors = c;
|
|
3017
3031
|
return c;
|
|
3018
|
-
},
|
|
3032
|
+
}, F = async (l, c, f = {
|
|
3019
3033
|
valid: !0
|
|
3020
3034
|
}) => {
|
|
3021
3035
|
for (const w in l) {
|
|
3022
3036
|
const b = l[w];
|
|
3023
3037
|
if (b) {
|
|
3024
|
-
const { _f: g, ...
|
|
3038
|
+
const { _f: g, ...S } = b;
|
|
3025
3039
|
if (g) {
|
|
3026
|
-
const
|
|
3027
|
-
|
|
3028
|
-
const
|
|
3029
|
-
if (
|
|
3040
|
+
const O = o.array.has(g.name), R = b._f && An(b._f);
|
|
3041
|
+
R && x.validatingFields && N([g.name], !0);
|
|
3042
|
+
const Y = await rr(b, o.disabled, a, k, r.shouldUseNativeValidation && !c, O);
|
|
3043
|
+
if (R && x.validatingFields && N([g.name]), Y[g.name] && (f.valid = !1, c || e.shouldUseNativeValidation))
|
|
3030
3044
|
break;
|
|
3031
|
-
!c && (_(
|
|
3045
|
+
!c && (_(Y, g.name) ? O ? Tn(t.errors, Y, g.name) : j(t.errors, g.name, Y[g.name]) : W(t.errors, g.name));
|
|
3032
3046
|
}
|
|
3033
|
-
!
|
|
3047
|
+
!ee(S) && await F(S, c, f);
|
|
3034
3048
|
}
|
|
3035
3049
|
}
|
|
3036
3050
|
return f.valid;
|
|
3037
|
-
},
|
|
3051
|
+
}, H = () => {
|
|
3038
3052
|
for (const l of o.unMount) {
|
|
3039
3053
|
const c = _(s, l);
|
|
3040
3054
|
c && (c._f.refs ? c._f.refs.every((f) => !ut(f)) : !ut(c._f.ref)) && tt(l);
|
|
3041
3055
|
}
|
|
3042
3056
|
o.unMount = /* @__PURE__ */ new Set();
|
|
3043
|
-
},
|
|
3044
|
-
...n.mount ? a : q(c) ? i :
|
|
3045
|
-
}, f, c),
|
|
3057
|
+
}, M = (l, c) => !r.disabled && (l && c && j(a, l, c), !be(St(), i)), T = (l, c, f) => _n(l, o, {
|
|
3058
|
+
...n.mount ? a : q(c) ? i : re(l) ? { [l]: c } : c
|
|
3059
|
+
}, f, c), L = (l) => wt(_(n.mount ? a : i, l, r.shouldUnregister ? _(i, l, []) : [])), U = (l, c, f = {}) => {
|
|
3046
3060
|
const w = _(s, l);
|
|
3047
3061
|
let b = c;
|
|
3048
3062
|
if (w) {
|
|
3049
3063
|
const g = w._f;
|
|
3050
|
-
g && (!g.disabled &&
|
|
3051
|
-
(!
|
|
3052
|
-
}) : g.refs.forEach((
|
|
3064
|
+
g && (!g.disabled && j(a, l, Br(c, g)), b = Ge(g.ref) && te(c) ? "" : c, Tr(g.ref) ? [...g.ref.options].forEach((S) => S.selected = b.includes(S.value)) : g.refs ? Ke(g.ref) ? g.refs.forEach((S) => {
|
|
3065
|
+
(!S.defaultChecked || !S.disabled) && (Array.isArray(b) ? S.checked = !!b.find((O) => O === S.value) : S.checked = b === S.value || !!b);
|
|
3066
|
+
}) : g.refs.forEach((S) => S.checked = S.value === b) : kt(g.ref) ? g.ref.value = "" : (g.ref.value = b, g.ref.type || m.state.next({
|
|
3053
3067
|
name: l,
|
|
3054
|
-
values:
|
|
3068
|
+
values: G(a)
|
|
3055
3069
|
})));
|
|
3056
3070
|
}
|
|
3057
|
-
(f.shouldDirty || f.shouldTouch) &&
|
|
3058
|
-
},
|
|
3071
|
+
(f.shouldDirty || f.shouldTouch) && B(l, b, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && Oe(l);
|
|
3072
|
+
}, Z = (l, c, f) => {
|
|
3059
3073
|
for (const w in c) {
|
|
3060
3074
|
if (!c.hasOwnProperty(w))
|
|
3061
3075
|
return;
|
|
3062
|
-
const b = c[w], g = l + "." + w,
|
|
3063
|
-
(o.array.has(l) || K(b) ||
|
|
3076
|
+
const b = c[w], g = l + "." + w, S = _(s, g);
|
|
3077
|
+
(o.array.has(l) || K(b) || S && !S._f) && !ke(b) ? Z(g, b, f) : U(g, b, f);
|
|
3064
3078
|
}
|
|
3065
|
-
},
|
|
3066
|
-
const w = _(s, l), b = o.array.has(l), g =
|
|
3067
|
-
|
|
3079
|
+
}, z = (l, c, f = {}) => {
|
|
3080
|
+
const w = _(s, l), b = o.array.has(l), g = G(c);
|
|
3081
|
+
j(a, l, g), b ? (m.array.next({
|
|
3068
3082
|
name: l,
|
|
3069
|
-
values:
|
|
3070
|
-
}), (x.isDirty || x.dirtyFields ||
|
|
3083
|
+
values: G(a)
|
|
3084
|
+
}), (x.isDirty || x.dirtyFields || p.isDirty || p.dirtyFields) && f.shouldDirty && m.state.next({
|
|
3071
3085
|
name: l,
|
|
3072
3086
|
dirtyFields: Fe(i, a),
|
|
3073
|
-
isDirty:
|
|
3074
|
-
})) : w && !w._f && !
|
|
3087
|
+
isDirty: M(l, g)
|
|
3088
|
+
})) : w && !w._f && !te(g) ? Z(l, g, f) : U(l, g, f), Qt(l, o) ? m.state.next({
|
|
3075
3089
|
...t,
|
|
3076
3090
|
name: l,
|
|
3077
|
-
values:
|
|
3091
|
+
values: G(a)
|
|
3078
3092
|
}) : m.state.next({
|
|
3079
3093
|
name: n.mount ? l : void 0,
|
|
3080
|
-
values:
|
|
3094
|
+
values: G(a)
|
|
3081
3095
|
});
|
|
3082
3096
|
}, De = async (l) => {
|
|
3083
3097
|
n.mount = !0;
|
|
3084
3098
|
const c = l.target;
|
|
3085
3099
|
let f = c.name, w = !0;
|
|
3086
|
-
const b = _(s, f), g = (
|
|
3087
|
-
w = Number.isNaN(
|
|
3088
|
-
},
|
|
3100
|
+
const b = _(s, f), g = (R) => {
|
|
3101
|
+
w = Number.isNaN(R) || ke(R) && isNaN(R.getTime()) || be(R, _(a, f, R));
|
|
3102
|
+
}, S = Xt(r.mode), O = Xt(r.reValidateMode);
|
|
3089
3103
|
if (b) {
|
|
3090
|
-
let
|
|
3091
|
-
const we = c.type ? Zt(b._f) :
|
|
3092
|
-
|
|
3093
|
-
const it =
|
|
3104
|
+
let R, Y;
|
|
3105
|
+
const we = c.type ? Zt(b._f) : yn(l), ge = l.type === Wt.BLUR || l.type === Wt.FOCUS_OUT, Hr = !En(b._f) && !r.resolver && !_(t.errors, f) && !b._f.deps || Ln(ge, _(t.touchedFields, f), t.isSubmitted, O, S), nt = Qt(f, o, ge);
|
|
3106
|
+
j(a, f, we), ge ? (!c || !c.readOnly) && (b._f.onBlur && b._f.onBlur(l), d && d(0)) : b._f.onChange && b._f.onChange(l);
|
|
3107
|
+
const it = B(f, we, ge), Jr = !ee(it) || nt;
|
|
3094
3108
|
if (!ge && m.state.next({
|
|
3095
3109
|
name: f,
|
|
3096
3110
|
type: l.type,
|
|
3097
|
-
values:
|
|
3111
|
+
values: G(a)
|
|
3098
3112
|
}), Hr)
|
|
3099
|
-
return (x.isValid ||
|
|
3113
|
+
return (x.isValid || p.isValid) && (r.mode === "onBlur" ? ge && I() : ge || I()), Jr && m.state.next({ name: f, ...nt ? {} : it });
|
|
3100
3114
|
if (!ge && nt && m.state.next({ ...t }), r.resolver) {
|
|
3101
|
-
const { errors: Dt } = await
|
|
3115
|
+
const { errors: Dt } = await D([f]);
|
|
3102
3116
|
if (N([f]), g(we), w) {
|
|
3103
3117
|
const Zr = er(t.errors, s, f), Tt = er(Dt, s, Zr.name || f);
|
|
3104
|
-
|
|
3118
|
+
R = Tt.error, f = Tt.name, Y = ee(Dt);
|
|
3105
3119
|
}
|
|
3106
3120
|
} else
|
|
3107
|
-
N([f], !0),
|
|
3108
|
-
w && (b._f.deps && (!Array.isArray(b._f.deps) || b._f.deps.length > 0) && Oe(b._f.deps), J(f,
|
|
3121
|
+
N([f], !0), R = (await rr(b, o.disabled, a, k, r.shouldUseNativeValidation))[f], N([f]), g(we), w && (R ? Y = !1 : (x.isValid || p.isValid) && (Y = await F(s, !0)));
|
|
3122
|
+
w && (b._f.deps && (!Array.isArray(b._f.deps) || b._f.deps.length > 0) && Oe(b._f.deps), J(f, Y, R, it));
|
|
3109
3123
|
}
|
|
3110
3124
|
}, Te = (l, c) => {
|
|
3111
3125
|
if (_(t.errors, c) && l.focus)
|
|
@@ -3114,15 +3128,15 @@ function On(e = {}) {
|
|
|
3114
3128
|
let f, w;
|
|
3115
3129
|
const b = Ue(l);
|
|
3116
3130
|
if (r.resolver) {
|
|
3117
|
-
const g = await
|
|
3118
|
-
f =
|
|
3131
|
+
const g = await $(q(l) ? l : b);
|
|
3132
|
+
f = ee(g), w = l ? !b.some((S) => _(g, S)) : f;
|
|
3119
3133
|
} else
|
|
3120
3134
|
l ? (w = (await Promise.all(b.map(async (g) => {
|
|
3121
|
-
const
|
|
3122
|
-
return await
|
|
3123
|
-
}))).every(Boolean), !(!w && !t.isValid) &&
|
|
3135
|
+
const S = _(s, g);
|
|
3136
|
+
return await F(S && S._f ? { [g]: S } : S);
|
|
3137
|
+
}))).every(Boolean), !(!w && !t.isValid) && I()) : w = f = await F(s);
|
|
3124
3138
|
return m.state.next({
|
|
3125
|
-
...!
|
|
3139
|
+
...!re(l) || (x.isValid || p.isValid) && f !== t.isValid ? {} : { name: l },
|
|
3126
3140
|
...r.resolver || !l ? { isValid: f } : {},
|
|
3127
3141
|
errors: t.errors
|
|
3128
3142
|
}), c.shouldFocus && !w && ze(s, Te, l ? b : o.mount), w;
|
|
@@ -3130,7 +3144,7 @@ function On(e = {}) {
|
|
|
3130
3144
|
let f = {
|
|
3131
3145
|
...n.mount ? a : i
|
|
3132
3146
|
};
|
|
3133
|
-
return c && (f = Dr(c.dirtyFields ? t.dirtyFields : t.touchedFields, f)), q(l) ? f :
|
|
3147
|
+
return c && (f = Dr(c.dirtyFields ? t.dirtyFields : t.touchedFields, f)), q(l) ? f : re(l) ? _(f, l) : l.map((w) => _(f, w));
|
|
3134
3148
|
}, It = (l, c) => ({
|
|
3135
3149
|
invalid: !!_((c || t).errors, l),
|
|
3136
3150
|
isDirty: !!_((c || t).dirtyFields, l),
|
|
@@ -3139,7 +3153,7 @@ function On(e = {}) {
|
|
|
3139
3153
|
isTouched: !!_((c || t).touchedFields, l)
|
|
3140
3154
|
}), $r = (l) => {
|
|
3141
3155
|
const c = l ? Ue(l) : void 0;
|
|
3142
|
-
c == null || c.forEach((f) =>
|
|
3156
|
+
c == null || c.forEach((f) => W(t.errors, f)), c ? c.forEach((f) => {
|
|
3143
3157
|
m.state.next({
|
|
3144
3158
|
name: f,
|
|
3145
3159
|
errors: t.errors
|
|
@@ -3148,9 +3162,9 @@ function On(e = {}) {
|
|
|
3148
3162
|
errors: {}
|
|
3149
3163
|
});
|
|
3150
3164
|
}, Vt = (l, c, f) => {
|
|
3151
|
-
const w = (_(s, l, { _f: {} })._f || {}).ref, b = _(t.errors, l) || {}, { ref: g, message:
|
|
3152
|
-
|
|
3153
|
-
...
|
|
3165
|
+
const w = (_(s, l, { _f: {} })._f || {}).ref, b = _(t.errors, l) || {}, { ref: g, message: S, type: O, ...R } = b;
|
|
3166
|
+
j(t.errors, l, {
|
|
3167
|
+
...R,
|
|
3154
3168
|
...c,
|
|
3155
3169
|
ref: w
|
|
3156
3170
|
}), m.state.next({
|
|
@@ -3159,18 +3173,18 @@ function On(e = {}) {
|
|
|
3159
3173
|
isValid: !1
|
|
3160
3174
|
}), f && f.shouldFocus && w && w.focus && w.focus();
|
|
3161
3175
|
}, qr = (l, c) => ae(l) ? m.state.subscribe({
|
|
3162
|
-
next: (f) => "values" in f && l(
|
|
3163
|
-
}) :
|
|
3176
|
+
next: (f) => "values" in f && l(T(void 0, c), f)
|
|
3177
|
+
}) : T(l, c, !0), Ft = (l) => m.state.subscribe({
|
|
3164
3178
|
next: (c) => {
|
|
3165
|
-
|
|
3179
|
+
Nn(l.name, c.name, l.exact) && Mn(c, l.formState || x, Gr, l.reRenderRoot) && l.callback({
|
|
3166
3180
|
values: { ...a },
|
|
3167
3181
|
...t,
|
|
3168
3182
|
...c,
|
|
3169
3183
|
defaultValues: i
|
|
3170
3184
|
});
|
|
3171
3185
|
}
|
|
3172
|
-
}).unsubscribe, Ur = (l) => (n.mount = !0,
|
|
3173
|
-
...
|
|
3186
|
+
}).unsubscribe, Ur = (l) => (n.mount = !0, p = {
|
|
3187
|
+
...p,
|
|
3174
3188
|
...l.formState
|
|
3175
3189
|
}, Ft({
|
|
3176
3190
|
...l,
|
|
@@ -3180,22 +3194,22 @@ function On(e = {}) {
|
|
|
3180
3194
|
}
|
|
3181
3195
|
})), tt = (l, c = {}) => {
|
|
3182
3196
|
for (const f of l ? Ue(l) : o.mount)
|
|
3183
|
-
o.mount.delete(f), o.array.delete(f), c.keepValue || (
|
|
3197
|
+
o.mount.delete(f), o.array.delete(f), c.keepValue || (W(s, f), W(a, f)), !c.keepError && W(t.errors, f), !c.keepDirty && W(t.dirtyFields, f), !c.keepTouched && W(t.touchedFields, f), !c.keepIsValidating && W(t.validatingFields, f), !r.shouldUnregister && !c.keepDefaultValue && W(i, f);
|
|
3184
3198
|
m.state.next({
|
|
3185
|
-
values:
|
|
3199
|
+
values: G(a)
|
|
3186
3200
|
}), m.state.next({
|
|
3187
3201
|
...t,
|
|
3188
|
-
...c.keepDirty ? { isDirty:
|
|
3189
|
-
}), !c.keepIsValid &&
|
|
3202
|
+
...c.keepDirty ? { isDirty: M() } : {}
|
|
3203
|
+
}), !c.keepIsValid && I();
|
|
3190
3204
|
}, At = ({ disabled: l, name: c }) => {
|
|
3191
3205
|
if (le(l) && n.mount || l || o.disabled.has(c)) {
|
|
3192
3206
|
const b = o.disabled.has(c) !== !!l;
|
|
3193
|
-
l ? o.disabled.add(c) : o.disabled.delete(c), b && n.mount && !n.action &&
|
|
3207
|
+
l ? o.disabled.add(c) : o.disabled.delete(c), b && n.mount && !n.action && I();
|
|
3194
3208
|
}
|
|
3195
3209
|
}, rt = (l, c = {}) => {
|
|
3196
3210
|
let f = _(s, l);
|
|
3197
3211
|
const w = le(c.disabled) || le(r.disabled);
|
|
3198
|
-
return
|
|
3212
|
+
return j(s, l, {
|
|
3199
3213
|
...f || {},
|
|
3200
3214
|
_f: {
|
|
3201
3215
|
...f && f._f ? f._f : { ref: { name: l } },
|
|
@@ -3206,7 +3220,7 @@ function On(e = {}) {
|
|
|
3206
3220
|
}), o.mount.add(l), f ? At({
|
|
3207
3221
|
disabled: le(c.disabled) ? c.disabled : r.disabled,
|
|
3208
3222
|
name: l
|
|
3209
|
-
}) :
|
|
3223
|
+
}) : A(l, !0, c.value), {
|
|
3210
3224
|
...w ? { disabled: c.disabled || r.disabled } : {},
|
|
3211
3225
|
...r.progressive ? {
|
|
3212
3226
|
required: !!c.required,
|
|
@@ -3222,24 +3236,24 @@ function On(e = {}) {
|
|
|
3222
3236
|
ref: (b) => {
|
|
3223
3237
|
if (b) {
|
|
3224
3238
|
rt(l, c), f = _(s, l);
|
|
3225
|
-
const g = q(b.value) && b.querySelectorAll && b.querySelectorAll("input,select,textarea")[0] || b,
|
|
3226
|
-
if (
|
|
3239
|
+
const g = q(b.value) && b.querySelectorAll && b.querySelectorAll("input,select,textarea")[0] || b, S = Cn(g), O = f._f.refs || [];
|
|
3240
|
+
if (S ? O.find((R) => R === g) : g === f._f.ref)
|
|
3227
3241
|
return;
|
|
3228
|
-
|
|
3242
|
+
j(s, l, {
|
|
3229
3243
|
_f: {
|
|
3230
3244
|
...f._f,
|
|
3231
|
-
...
|
|
3245
|
+
...S ? {
|
|
3232
3246
|
refs: [
|
|
3233
|
-
...
|
|
3247
|
+
...O.filter(ut),
|
|
3234
3248
|
g,
|
|
3235
3249
|
...Array.isArray(_(i, l)) ? [{}] : []
|
|
3236
3250
|
],
|
|
3237
3251
|
ref: { type: g.type, name: l }
|
|
3238
3252
|
} : { ref: g }
|
|
3239
3253
|
}
|
|
3240
|
-
}),
|
|
3254
|
+
}), A(l, !1, void 0, g);
|
|
3241
3255
|
} else
|
|
3242
|
-
f = _(s, l, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || c.shouldUnregister) && !(
|
|
3256
|
+
f = _(s, l, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || c.shouldUnregister) && !(gn(o.array, l) && n.action) && o.unMount.add(l);
|
|
3243
3257
|
}
|
|
3244
3258
|
};
|
|
3245
3259
|
}, st = () => r.shouldFocusError && ze(s, Te, o.mount), zr = (l) => {
|
|
@@ -3252,18 +3266,18 @@ function On(e = {}) {
|
|
|
3252
3266
|
}, Et = (l, c) => async (f) => {
|
|
3253
3267
|
let w;
|
|
3254
3268
|
f && (f.preventDefault && f.preventDefault(), f.persist && f.persist());
|
|
3255
|
-
let b =
|
|
3269
|
+
let b = G(a);
|
|
3256
3270
|
if (m.state.next({
|
|
3257
3271
|
isSubmitting: !0
|
|
3258
3272
|
}), r.resolver) {
|
|
3259
|
-
const { errors: g, values:
|
|
3260
|
-
N(), t.errors = g, b =
|
|
3273
|
+
const { errors: g, values: S } = await D();
|
|
3274
|
+
N(), t.errors = g, b = G(S);
|
|
3261
3275
|
} else
|
|
3262
|
-
await
|
|
3276
|
+
await F(s);
|
|
3263
3277
|
if (o.disabled.size)
|
|
3264
3278
|
for (const g of o.disabled)
|
|
3265
|
-
|
|
3266
|
-
if (
|
|
3279
|
+
W(b, g);
|
|
3280
|
+
if (W(t.errors, "root"), ee(t.errors)) {
|
|
3267
3281
|
m.state.next({
|
|
3268
3282
|
errors: {}
|
|
3269
3283
|
});
|
|
@@ -3277,47 +3291,47 @@ function On(e = {}) {
|
|
|
3277
3291
|
if (m.state.next({
|
|
3278
3292
|
isSubmitted: !0,
|
|
3279
3293
|
isSubmitting: !1,
|
|
3280
|
-
isSubmitSuccessful:
|
|
3294
|
+
isSubmitSuccessful: ee(t.errors) && !w,
|
|
3281
3295
|
submitCount: t.submitCount + 1,
|
|
3282
3296
|
errors: t.errors
|
|
3283
3297
|
}), w)
|
|
3284
3298
|
throw w;
|
|
3285
|
-
},
|
|
3286
|
-
_(s, l) && (q(c.defaultValue) ?
|
|
3299
|
+
}, Wr = (l, c = {}) => {
|
|
3300
|
+
_(s, l) && (q(c.defaultValue) ? z(l, G(_(i, l))) : (z(l, c.defaultValue), j(i, l, G(c.defaultValue))), c.keepTouched || W(t.touchedFields, l), c.keepDirty || (W(t.dirtyFields, l), t.isDirty = c.defaultValue ? M(l, G(_(i, l))) : M()), c.keepError || (W(t.errors, l), x.isValid && I()), m.state.next({ ...t }));
|
|
3287
3301
|
}, Mt = (l, c = {}) => {
|
|
3288
|
-
const f = l ?
|
|
3302
|
+
const f = l ? G(l) : i, w = G(f), b = ee(l), g = b ? i : w;
|
|
3289
3303
|
if (c.keepDefaultValues || (i = f), !c.keepValues) {
|
|
3290
3304
|
if (c.keepDirtyValues) {
|
|
3291
|
-
const
|
|
3305
|
+
const S = /* @__PURE__ */ new Set([
|
|
3292
3306
|
...o.mount,
|
|
3293
3307
|
...Object.keys(Fe(i, a))
|
|
3294
3308
|
]);
|
|
3295
|
-
for (const
|
|
3296
|
-
const
|
|
3297
|
-
|
|
3309
|
+
for (const O of Array.from(S)) {
|
|
3310
|
+
const R = _(t.dirtyFields, O), Y = _(a, O), we = _(g, O);
|
|
3311
|
+
R && !q(Y) ? j(g, O, Y) : !R && !q(we) && z(O, we);
|
|
3298
3312
|
}
|
|
3299
3313
|
} else {
|
|
3300
3314
|
if (xt && q(l))
|
|
3301
|
-
for (const
|
|
3302
|
-
const
|
|
3303
|
-
if (
|
|
3304
|
-
const
|
|
3305
|
-
if (Ge(
|
|
3306
|
-
const
|
|
3307
|
-
if (
|
|
3308
|
-
|
|
3315
|
+
for (const S of o.mount) {
|
|
3316
|
+
const O = _(s, S);
|
|
3317
|
+
if (O && O._f) {
|
|
3318
|
+
const R = Array.isArray(O._f.refs) ? O._f.refs[0] : O._f.ref;
|
|
3319
|
+
if (Ge(R)) {
|
|
3320
|
+
const Y = R.closest("form");
|
|
3321
|
+
if (Y) {
|
|
3322
|
+
Y.reset();
|
|
3309
3323
|
break;
|
|
3310
3324
|
}
|
|
3311
3325
|
}
|
|
3312
3326
|
}
|
|
3313
3327
|
}
|
|
3314
3328
|
if (c.keepFieldsRef)
|
|
3315
|
-
for (const
|
|
3316
|
-
|
|
3329
|
+
for (const S of o.mount)
|
|
3330
|
+
z(S, _(g, S));
|
|
3317
3331
|
else
|
|
3318
3332
|
s = {};
|
|
3319
3333
|
}
|
|
3320
|
-
a = r.shouldUnregister ? c.keepDefaultValues ?
|
|
3334
|
+
a = r.shouldUnregister ? c.keepDefaultValues ? G(i) : {} : G(g), m.array.next({
|
|
3321
3335
|
values: { ...g }
|
|
3322
3336
|
}), m.state.next({
|
|
3323
3337
|
values: { ...g }
|
|
@@ -3331,7 +3345,7 @@ function On(e = {}) {
|
|
|
3331
3345
|
watch: /* @__PURE__ */ new Set(),
|
|
3332
3346
|
watchAll: !1,
|
|
3333
3347
|
focus: ""
|
|
3334
|
-
}, n.mount = !x.isValid || !!c.keepIsValid || !!c.keepDirtyValues || !r.shouldUnregister && !
|
|
3348
|
+
}, n.mount = !x.isValid || !!c.keepIsValid || !!c.keepDirtyValues || !r.shouldUnregister && !ee(g), n.watch = !!r.shouldUnregister, n.keepIsValid = !!c.keepIsValid, n.action = !1, c.keepErrors || (t.errors = {}), m.state.next({
|
|
3335
3349
|
submitCount: c.keepSubmitCount ? t.submitCount : 0,
|
|
3336
3350
|
isDirty: b ? !1 : c.keepDirty ? t.isDirty : !!(c.keepDefaultValues && !be(l, i)),
|
|
3337
3351
|
isSubmitted: c.keepIsSubmitted ? t.isSubmitted : !1,
|
|
@@ -3342,7 +3356,7 @@ function On(e = {}) {
|
|
|
3342
3356
|
isSubmitting: !1,
|
|
3343
3357
|
defaultValues: i
|
|
3344
3358
|
});
|
|
3345
|
-
}, Nt = (l, c) => Mt(ae(l) ? l(a) : l, { ...r.resetOptions, ...c }),
|
|
3359
|
+
}, Nt = (l, c) => Mt(ae(l) ? l(a) : l, { ...r.resetOptions, ...c }), Kr = (l, c = {}) => {
|
|
3346
3360
|
const f = _(s, l), w = f && f._f;
|
|
3347
3361
|
if (w) {
|
|
3348
3362
|
const b = w.refs ? w.refs[0] : w.ref;
|
|
@@ -3363,23 +3377,23 @@ function On(e = {}) {
|
|
|
3363
3377
|
handleSubmit: Et,
|
|
3364
3378
|
setError: Vt,
|
|
3365
3379
|
_subscribe: Ft,
|
|
3366
|
-
_runSchema:
|
|
3380
|
+
_runSchema: D,
|
|
3367
3381
|
_updateIsValidating: N,
|
|
3368
3382
|
_focusError: st,
|
|
3369
|
-
_getWatch:
|
|
3370
|
-
_getDirty:
|
|
3371
|
-
_setValid:
|
|
3383
|
+
_getWatch: T,
|
|
3384
|
+
_getDirty: M,
|
|
3385
|
+
_setValid: I,
|
|
3372
3386
|
_setFieldArray: y,
|
|
3373
3387
|
_setDisabledField: At,
|
|
3374
|
-
_setErrors:
|
|
3375
|
-
_getFieldArray:
|
|
3388
|
+
_setErrors: E,
|
|
3389
|
+
_getFieldArray: L,
|
|
3376
3390
|
_reset: Mt,
|
|
3377
3391
|
_resetDefaultValues: () => ae(r.defaultValues) && r.defaultValues().then((l) => {
|
|
3378
3392
|
Nt(l, r.resetOptions), m.state.next({
|
|
3379
3393
|
isLoading: !1
|
|
3380
3394
|
});
|
|
3381
3395
|
}),
|
|
3382
|
-
_removeUnmounted:
|
|
3396
|
+
_removeUnmounted: H,
|
|
3383
3397
|
_disableForm: zr,
|
|
3384
3398
|
_subjects: m,
|
|
3385
3399
|
_proxyFormState: x,
|
|
@@ -3422,14 +3436,14 @@ function On(e = {}) {
|
|
|
3422
3436
|
register: rt,
|
|
3423
3437
|
handleSubmit: Et,
|
|
3424
3438
|
watch: qr,
|
|
3425
|
-
setValue:
|
|
3439
|
+
setValue: z,
|
|
3426
3440
|
getValues: St,
|
|
3427
3441
|
reset: Nt,
|
|
3428
|
-
resetField:
|
|
3442
|
+
resetField: Wr,
|
|
3429
3443
|
clearErrors: $r,
|
|
3430
3444
|
unregister: tt,
|
|
3431
3445
|
setError: Vt,
|
|
3432
|
-
setFocus:
|
|
3446
|
+
setFocus: Kr,
|
|
3433
3447
|
getFieldState: It
|
|
3434
3448
|
};
|
|
3435
3449
|
return {
|
|
@@ -3438,7 +3452,7 @@ function On(e = {}) {
|
|
|
3438
3452
|
};
|
|
3439
3453
|
}
|
|
3440
3454
|
function Qe(e = {}) {
|
|
3441
|
-
const r =
|
|
3455
|
+
const r = Q.useRef(void 0), t = Q.useRef(void 0), [s, i] = Q.useState({
|
|
3442
3456
|
isDirty: !1,
|
|
3443
3457
|
isValidating: !1,
|
|
3444
3458
|
isLoading: ae(e.defaultValues),
|
|
@@ -3462,14 +3476,14 @@ function Qe(e = {}) {
|
|
|
3462
3476
|
formState: s
|
|
3463
3477
|
}, e.defaultValues && !ae(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
3464
3478
|
else {
|
|
3465
|
-
const { formControl: n, ...o } =
|
|
3479
|
+
const { formControl: n, ...o } = Rn(e);
|
|
3466
3480
|
r.current = {
|
|
3467
3481
|
...o,
|
|
3468
3482
|
formState: s
|
|
3469
3483
|
};
|
|
3470
3484
|
}
|
|
3471
3485
|
const a = r.current.control;
|
|
3472
|
-
return a._options = e,
|
|
3486
|
+
return a._options = e, wn(() => {
|
|
3473
3487
|
const n = a._subscribe({
|
|
3474
3488
|
formState: a._proxyFormState,
|
|
3475
3489
|
callback: () => i({ ...a._formState }),
|
|
@@ -3479,69 +3493,69 @@ function Qe(e = {}) {
|
|
|
3479
3493
|
...o,
|
|
3480
3494
|
isReady: !0
|
|
3481
3495
|
})), a._formState.isReady = !0, n;
|
|
3482
|
-
}, [a]),
|
|
3496
|
+
}, [a]), Q.useEffect(() => a._disableForm(e.disabled), [a, e.disabled]), Q.useEffect(() => {
|
|
3483
3497
|
e.mode && (a._options.mode = e.mode), e.reValidateMode && (a._options.reValidateMode = e.reValidateMode);
|
|
3484
|
-
}, [a, e.mode, e.reValidateMode]),
|
|
3498
|
+
}, [a, e.mode, e.reValidateMode]), Q.useEffect(() => {
|
|
3485
3499
|
e.errors && (a._setErrors(e.errors), a._focusError());
|
|
3486
|
-
}, [a, e.errors]),
|
|
3500
|
+
}, [a, e.errors]), Q.useEffect(() => {
|
|
3487
3501
|
e.shouldUnregister && a._subjects.state.next({
|
|
3488
3502
|
values: a._getWatch()
|
|
3489
3503
|
});
|
|
3490
|
-
}, [a, e.shouldUnregister]),
|
|
3504
|
+
}, [a, e.shouldUnregister]), Q.useEffect(() => {
|
|
3491
3505
|
if (a._proxyFormState.isDirty) {
|
|
3492
3506
|
const n = a._getDirty();
|
|
3493
3507
|
n !== s.isDirty && a._subjects.state.next({
|
|
3494
3508
|
isDirty: n
|
|
3495
3509
|
});
|
|
3496
3510
|
}
|
|
3497
|
-
}, [a, s.isDirty]),
|
|
3511
|
+
}, [a, s.isDirty]), Q.useEffect(() => {
|
|
3498
3512
|
var n;
|
|
3499
3513
|
e.values && !be(e.values, t.current) ? (a._reset(e.values, {
|
|
3500
3514
|
keepFieldsRef: !0,
|
|
3501
3515
|
...a._options.resetOptions
|
|
3502
3516
|
}), !((n = a._options.resetOptions) === null || n === void 0) && n.keepIsValid || a._setValid(), t.current = e.values, i((o) => ({ ...o }))) : a._resetDefaultValues();
|
|
3503
|
-
}, [a, e.values]),
|
|
3517
|
+
}, [a, e.values]), Q.useEffect(() => {
|
|
3504
3518
|
a._state.mount || (a._setValid(), a._state.mount = !0), a._state.watch && (a._state.watch = !1, a._subjects.state.next({ ...a._formState })), a._removeUnmounted();
|
|
3505
|
-
}), r.current.formState =
|
|
3519
|
+
}), r.current.formState = Q.useMemo(() => xn(s, a), [a, s]), r.current;
|
|
3506
3520
|
}
|
|
3507
3521
|
const sr = (e, r, t) => {
|
|
3508
3522
|
if (e && "reportValidity" in e) {
|
|
3509
3523
|
const s = _(t, r);
|
|
3510
3524
|
e.setCustomValidity(s && s.message || ""), e.reportValidity();
|
|
3511
3525
|
}
|
|
3512
|
-
},
|
|
3526
|
+
}, Bn = (e, r) => {
|
|
3513
3527
|
for (const t in r.fields) {
|
|
3514
3528
|
const s = r.fields[t];
|
|
3515
3529
|
s && s.ref && "reportValidity" in s.ref ? sr(s.ref, t, e) : s.refs && s.refs.forEach((i) => sr(i, t, e));
|
|
3516
3530
|
}
|
|
3517
|
-
},
|
|
3518
|
-
r.shouldUseNativeValidation &&
|
|
3531
|
+
}, jn = (e, r) => {
|
|
3532
|
+
r.shouldUseNativeValidation && Bn(e, r);
|
|
3519
3533
|
const t = {};
|
|
3520
3534
|
for (const s in e) {
|
|
3521
3535
|
const i = _(r.fields, s), a = Object.assign(e[s] || {}, { ref: i && i.ref });
|
|
3522
|
-
if (
|
|
3536
|
+
if (Pn(r.names || Object.keys(e), s)) {
|
|
3523
3537
|
const n = Object.assign({}, _(t, s));
|
|
3524
|
-
|
|
3538
|
+
j(n, "root", a), j(t, s, n);
|
|
3525
3539
|
} else
|
|
3526
|
-
|
|
3540
|
+
j(t, s, a);
|
|
3527
3541
|
}
|
|
3528
3542
|
return t;
|
|
3529
|
-
},
|
|
3543
|
+
}, Pn = (e, r) => e.some((t) => t.startsWith(r + "."));
|
|
3530
3544
|
var et = function(e, r, t) {
|
|
3531
3545
|
return t === void 0 && (t = {}), function(s, i, a) {
|
|
3532
3546
|
try {
|
|
3533
3547
|
var n = !a.shouldUseNativeValidation && a.criteriaMode === "all";
|
|
3534
|
-
return Promise.resolve(/* @__PURE__ */
|
|
3548
|
+
return Promise.resolve(/* @__PURE__ */ Ys(e, s, Object.assign({}, r, { abortPipeEarly: !n }))).then(function(o) {
|
|
3535
3549
|
if (o.issues) {
|
|
3536
3550
|
for (var d = {}; o.issues.length; ) {
|
|
3537
|
-
var
|
|
3538
|
-
if (v && (d[v] || (d[v] = { message:
|
|
3539
|
-
var x = d[v].types,
|
|
3540
|
-
d[v] = Lr(v, n, d,
|
|
3551
|
+
var h = o.issues[0], v = /* @__PURE__ */ Ws(h);
|
|
3552
|
+
if (v && (d[v] || (d[v] = { message: h.message, type: h.type }), n)) {
|
|
3553
|
+
var x = d[v].types, p = x && x[h.type];
|
|
3554
|
+
d[v] = Lr(v, n, d, h.type, p ? [].concat(p, h.message) : h.message);
|
|
3541
3555
|
}
|
|
3542
3556
|
o.issues.shift();
|
|
3543
3557
|
}
|
|
3544
|
-
return { values: {}, errors:
|
|
3558
|
+
return { values: {}, errors: jn(d, a) };
|
|
3545
3559
|
}
|
|
3546
3560
|
return { values: t.raw ? s : o.output, errors: {} };
|
|
3547
3561
|
});
|
|
@@ -3550,19 +3564,19 @@ var et = function(e, r, t) {
|
|
|
3550
3564
|
}
|
|
3551
3565
|
};
|
|
3552
3566
|
};
|
|
3553
|
-
const nr = 27, ir = 12, ar = 10,
|
|
3567
|
+
const nr = 27, ir = 12, ar = 10, $n = Ne("enum"), qn = (e, r) => {
|
|
3554
3568
|
const t = {
|
|
3555
3569
|
min: e.minSelected ?? 0,
|
|
3556
3570
|
max: e.maxSelected ?? e.options.length
|
|
3557
3571
|
};
|
|
3558
3572
|
return et(/* @__PURE__ */ ye({
|
|
3559
|
-
checked: /* @__PURE__ */ ve(/* @__PURE__ */ Vr(/* @__PURE__ */
|
|
3573
|
+
checked: /* @__PURE__ */ ve(/* @__PURE__ */ Vr(/* @__PURE__ */ se(), /* @__PURE__ */ Cr()), /* @__PURE__ */ mt((s) => Object.entries(s).filter(([i, a]) => a).map(([i, a]) => i)), /* @__PURE__ */ $e(t.max, r("validation_multiple_choice_max", {
|
|
3560
3574
|
count: t.max
|
|
3561
3575
|
})), /* @__PURE__ */ Ae(t.min, r("validation_multiple_choice_min", {
|
|
3562
3576
|
count: t.min
|
|
3563
3577
|
})))
|
|
3564
3578
|
}));
|
|
3565
|
-
},
|
|
3579
|
+
}, Un = fr(({
|
|
3566
3580
|
option: e,
|
|
3567
3581
|
...r
|
|
3568
3582
|
}, t) => u(me, {
|
|
@@ -3585,14 +3599,14 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3585
3599
|
booleanLike: Ar
|
|
3586
3600
|
}
|
|
3587
3601
|
}
|
|
3588
|
-
}),
|
|
3602
|
+
}), zn = ({
|
|
3589
3603
|
input: e,
|
|
3590
3604
|
onSubmitSuccess: r
|
|
3591
3605
|
}) => {
|
|
3592
3606
|
var v, x;
|
|
3593
|
-
const t = e.key ? (v =
|
|
3607
|
+
const t = e.key ? (v = P.current$.value.flow) == null ? void 0 : v.data.submissions[e.key] : void 0, s = (e.config.minSelected === 1 || e.config.minSelected === void 0) && e.config.maxSelected === 1, i = s && e.config.options.length === 2, {
|
|
3594
3608
|
t: a
|
|
3595
|
-
} =
|
|
3609
|
+
} = ne(), {
|
|
3596
3610
|
register: n,
|
|
3597
3611
|
handleSubmit: o,
|
|
3598
3612
|
formState: {
|
|
@@ -3600,10 +3614,10 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3600
3614
|
}
|
|
3601
3615
|
} = Qe({
|
|
3602
3616
|
defaultValues: {
|
|
3603
|
-
checked: s ? {} :
|
|
3617
|
+
checked: s ? {} : $n(t) ? Object.fromEntries(t.value.map((p) => [p, !0])) : {}
|
|
3604
3618
|
},
|
|
3605
|
-
resolver:
|
|
3606
|
-
}),
|
|
3619
|
+
resolver: qn(e.config, a)
|
|
3620
|
+
}), h = bt();
|
|
3607
3621
|
return i ? u("ul", {
|
|
3608
3622
|
style: {
|
|
3609
3623
|
maxHeight: 6.5 * nr + 5 * ir + 2 * ar
|
|
@@ -3611,30 +3625,30 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3611
3625
|
class: or({
|
|
3612
3626
|
variant: "booleanLike"
|
|
3613
3627
|
}),
|
|
3614
|
-
children: e.config.options.map((
|
|
3628
|
+
children: e.config.options.map((p, m) => u("li", {
|
|
3615
3629
|
class: Er,
|
|
3616
3630
|
children: u(Mr, {
|
|
3617
3631
|
type: "submit",
|
|
3618
3632
|
ref: (k) => {
|
|
3619
|
-
k && m === 0 && (
|
|
3633
|
+
k && m === 0 && (h.current = k);
|
|
3620
3634
|
},
|
|
3621
|
-
label:
|
|
3635
|
+
label: p.label,
|
|
3622
3636
|
value: "true",
|
|
3623
3637
|
onClick: () => r({
|
|
3624
3638
|
type: "enum",
|
|
3625
|
-
value: [
|
|
3639
|
+
value: [p.value]
|
|
3626
3640
|
})
|
|
3627
3641
|
})
|
|
3628
|
-
},
|
|
3642
|
+
}, p.value))
|
|
3629
3643
|
}) : u("form", {
|
|
3630
3644
|
noValidate: !0,
|
|
3631
|
-
onSubmit: (
|
|
3645
|
+
onSubmit: (p) => o((m) => {
|
|
3632
3646
|
const k = m.checked;
|
|
3633
3647
|
r({
|
|
3634
3648
|
type: "enum",
|
|
3635
3649
|
value: k
|
|
3636
3650
|
});
|
|
3637
|
-
})(
|
|
3651
|
+
})(p),
|
|
3638
3652
|
children: [u("div", {
|
|
3639
3653
|
class: "flex items-center gap-1",
|
|
3640
3654
|
children: [u("ul", {
|
|
@@ -3644,27 +3658,27 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3644
3658
|
class: or({
|
|
3645
3659
|
variant: e.config.options.length === 1 ? "singleOption" : void 0
|
|
3646
3660
|
}),
|
|
3647
|
-
children: e.config.options.map((
|
|
3648
|
-
const k = `checked.${
|
|
3649
|
-
ref:
|
|
3650
|
-
...
|
|
3661
|
+
children: e.config.options.map((p, m) => {
|
|
3662
|
+
const k = `checked.${p.value}`, {
|
|
3663
|
+
ref: V,
|
|
3664
|
+
...I
|
|
3651
3665
|
} = n(k);
|
|
3652
3666
|
return u("li", {
|
|
3653
3667
|
class: "relative",
|
|
3654
|
-
children: u(
|
|
3655
|
-
option:
|
|
3668
|
+
children: u(Un, {
|
|
3669
|
+
option: p,
|
|
3656
3670
|
autoFocus: m === 0,
|
|
3657
3671
|
ref: (N) => {
|
|
3658
|
-
N && m === 0 && (
|
|
3672
|
+
N && m === 0 && (h.current = N), V(N);
|
|
3659
3673
|
},
|
|
3660
3674
|
id: k,
|
|
3661
|
-
...
|
|
3675
|
+
...I,
|
|
3662
3676
|
onClick: s ? () => r({
|
|
3663
3677
|
type: "enum",
|
|
3664
|
-
value: [
|
|
3678
|
+
value: [p.value]
|
|
3665
3679
|
}) : void 0
|
|
3666
3680
|
})
|
|
3667
|
-
},
|
|
3681
|
+
}, p.value);
|
|
3668
3682
|
})
|
|
3669
3683
|
}), u("div", {
|
|
3670
3684
|
class: "flex flex-col items-center gap-2 pr-2.5 pt-2.5",
|
|
@@ -3684,7 +3698,7 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3684
3698
|
})
|
|
3685
3699
|
})]
|
|
3686
3700
|
});
|
|
3687
|
-
},
|
|
3701
|
+
}, Wn = Ne("number"), Kn = (e, r) => {
|
|
3688
3702
|
const t = e.min ?? Number.MIN_SAFE_INTEGER, s = e.max ?? Number.MAX_SAFE_INTEGER, i = e.decimalCases ?? 0;
|
|
3689
3703
|
return et(/* @__PURE__ */ ye({
|
|
3690
3704
|
number: /* @__PURE__ */ ve(/* @__PURE__ */ Sr(r("validation_number")), /* @__PURE__ */ xr(t, r("validation_number_min", {
|
|
@@ -3695,14 +3709,14 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3695
3709
|
count: i
|
|
3696
3710
|
})))
|
|
3697
3711
|
}));
|
|
3698
|
-
},
|
|
3712
|
+
}, Gn = ({
|
|
3699
3713
|
input: e,
|
|
3700
3714
|
onSubmitSuccess: r
|
|
3701
3715
|
}) => {
|
|
3702
3716
|
var x;
|
|
3703
|
-
const t = e.config.defaultValue, s = e.key ? (x =
|
|
3717
|
+
const t = e.config.defaultValue, s = e.key ? (x = P.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, {
|
|
3704
3718
|
t: i
|
|
3705
|
-
} =
|
|
3719
|
+
} = ne(), {
|
|
3706
3720
|
register: a,
|
|
3707
3721
|
handleSubmit: n,
|
|
3708
3722
|
formState: {
|
|
@@ -3710,12 +3724,12 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3710
3724
|
}
|
|
3711
3725
|
} = Qe({
|
|
3712
3726
|
defaultValues: {
|
|
3713
|
-
number:
|
|
3727
|
+
number: Wn(s) ? s.value : t ? Number(t) : void 0
|
|
3714
3728
|
},
|
|
3715
3729
|
resolver: Kn(e.config, i)
|
|
3716
3730
|
}), {
|
|
3717
3731
|
ref: d,
|
|
3718
|
-
...
|
|
3732
|
+
...h
|
|
3719
3733
|
} = a("number", {
|
|
3720
3734
|
required: !e.config.optional,
|
|
3721
3735
|
valueAsNumber: !0
|
|
@@ -3724,10 +3738,10 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3724
3738
|
v.current && (v.current.focus(), v.current.select());
|
|
3725
3739
|
}, []), u("form", {
|
|
3726
3740
|
class: "flex flex-col gap-1 p-2.5",
|
|
3727
|
-
onSubmit: n((
|
|
3728
|
-
|
|
3741
|
+
onSubmit: n((p) => {
|
|
3742
|
+
p.number !== void 0 && r({
|
|
3729
3743
|
type: "number",
|
|
3730
|
-
value:
|
|
3744
|
+
value: p.number
|
|
3731
3745
|
});
|
|
3732
3746
|
}),
|
|
3733
3747
|
children: [u("div", {
|
|
@@ -3735,19 +3749,19 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3735
3749
|
children: [u("div", {
|
|
3736
3750
|
class: "relative min-w-0 flex-grow",
|
|
3737
3751
|
children: [u("input", {
|
|
3738
|
-
...
|
|
3752
|
+
...h,
|
|
3739
3753
|
id: "chat-input",
|
|
3740
3754
|
autocomplete: "off",
|
|
3741
3755
|
autoCapitalize: "off",
|
|
3742
3756
|
autoCorrect: "off",
|
|
3743
3757
|
autoFocus: !0,
|
|
3744
|
-
ref: (
|
|
3745
|
-
|
|
3758
|
+
ref: (p) => {
|
|
3759
|
+
p && (v.current = p), d(p);
|
|
3746
3760
|
},
|
|
3747
3761
|
type: "text",
|
|
3748
3762
|
min: e.config.min,
|
|
3749
3763
|
max: e.config.max,
|
|
3750
|
-
class:
|
|
3764
|
+
class: We({
|
|
3751
3765
|
optional: e.config.optional,
|
|
3752
3766
|
className: "[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"
|
|
3753
3767
|
}),
|
|
@@ -3761,7 +3775,7 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3761
3775
|
error: o.number
|
|
3762
3776
|
})]
|
|
3763
3777
|
});
|
|
3764
|
-
},
|
|
3778
|
+
}, Hn = (e) => {
|
|
3765
3779
|
if (e === "")
|
|
3766
3780
|
return {
|
|
3767
3781
|
countryCode: "",
|
|
@@ -3775,35 +3789,35 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3775
3789
|
countryCode: "",
|
|
3776
3790
|
phoneNumber: ""
|
|
3777
3791
|
};
|
|
3778
|
-
},
|
|
3779
|
-
const r = /* @__PURE__ */ ve(/* @__PURE__ */
|
|
3792
|
+
}, Jn = "44", Zn = /^[0-9 ]+$/, Xn = Ne("string"), Yn = Ne("phone"), Qn = (e) => {
|
|
3793
|
+
const r = /* @__PURE__ */ ve(/* @__PURE__ */ se(e("validation_country_code")), /* @__PURE__ */ yt(Zn, e("validation_country_code"))), t = /* @__PURE__ */ ve(/* @__PURE__ */ se(e("validation_phone")), /* @__PURE__ */ Ae(1, e("validation_phone")), /* @__PURE__ */ mt((s) => s.replace(/[^0-9]/g, "")));
|
|
3780
3794
|
return et(/* @__PURE__ */ ye({
|
|
3781
3795
|
countryCode: r,
|
|
3782
3796
|
phoneNumber: t
|
|
3783
3797
|
}));
|
|
3784
|
-
},
|
|
3798
|
+
}, ei = ({
|
|
3785
3799
|
input: e,
|
|
3786
3800
|
onSubmitSuccess: r
|
|
3787
3801
|
}) => {
|
|
3788
|
-
var
|
|
3789
|
-
const t = e.key ? (
|
|
3802
|
+
var V;
|
|
3803
|
+
const t = e.key ? (V = P.current$.value.flow) == null ? void 0 : V.data.submissions[e.key] : void 0, {
|
|
3790
3804
|
t: s
|
|
3791
|
-
} =
|
|
3805
|
+
} = ne(), [i, a] = _e(), n = Xn(t) ? Hn(t.value) : Yn(t) ? t.value : void 0, {
|
|
3792
3806
|
register: o,
|
|
3793
3807
|
handleSubmit: d,
|
|
3794
3808
|
formState: {
|
|
3795
|
-
errors:
|
|
3809
|
+
errors: h
|
|
3796
3810
|
},
|
|
3797
3811
|
watch: v
|
|
3798
3812
|
} = Qe({
|
|
3799
3813
|
defaultValues: {
|
|
3800
|
-
countryCode: (n == null ? void 0 : n.countryCode) ?? e.config.defaultValue.countryCode ??
|
|
3814
|
+
countryCode: (n == null ? void 0 : n.countryCode) ?? e.config.defaultValue.countryCode ?? Jn,
|
|
3801
3815
|
phoneNumber: (n == null ? void 0 : n.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
|
|
3802
3816
|
},
|
|
3803
|
-
resolver:
|
|
3817
|
+
resolver: Qn(s)
|
|
3804
3818
|
}), {
|
|
3805
3819
|
ref: x,
|
|
3806
|
-
...
|
|
3820
|
+
...p
|
|
3807
3821
|
} = o("phoneNumber", {
|
|
3808
3822
|
required: !e.config.optional
|
|
3809
3823
|
}), m = ue(), k = v("countryCode");
|
|
@@ -3812,18 +3826,18 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3812
3826
|
}, []), u("form", {
|
|
3813
3827
|
noValidate: !0,
|
|
3814
3828
|
class: "flex flex-col gap-1 p-2.5",
|
|
3815
|
-
onSubmit: d((
|
|
3816
|
-
const N =
|
|
3829
|
+
onSubmit: d((I) => {
|
|
3830
|
+
const N = I.phoneNumber.replace(/[^0-9]/g, ""), y = I.countryCode.replace(/[^0-9]/g, "");
|
|
3817
3831
|
a(void 0);
|
|
3818
|
-
const C = e.config.minChars ?? 7,
|
|
3819
|
-
if (
|
|
3832
|
+
const C = e.config.minChars ?? 7, E = N.length + y.length;
|
|
3833
|
+
if (E < C)
|
|
3820
3834
|
return a(s("validation_phone_min_chars", {
|
|
3821
3835
|
count: C
|
|
3822
3836
|
}));
|
|
3823
|
-
const
|
|
3824
|
-
if (
|
|
3837
|
+
const A = e.config.maxChars;
|
|
3838
|
+
if (A != null && E > A)
|
|
3825
3839
|
return a(s("validation_max_chars", {
|
|
3826
|
-
count:
|
|
3840
|
+
count: A
|
|
3827
3841
|
}));
|
|
3828
3842
|
e.config.submissionFormat === "phone" ? r({
|
|
3829
3843
|
type: "phone",
|
|
@@ -3833,7 +3847,7 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3833
3847
|
}
|
|
3834
3848
|
}) : r({
|
|
3835
3849
|
type: "string",
|
|
3836
|
-
value: k +
|
|
3850
|
+
value: k + I.phoneNumber
|
|
3837
3851
|
});
|
|
3838
3852
|
}),
|
|
3839
3853
|
children: [u("div", {
|
|
@@ -3849,13 +3863,13 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3849
3863
|
...o("countryCode", {}),
|
|
3850
3864
|
id: `isdk_phone_${e.key}`,
|
|
3851
3865
|
class: "absolute inset-0 opacity-0",
|
|
3852
|
-
children: Object.entries(gt).map(([
|
|
3866
|
+
children: Object.entries(gt).map(([I, N]) => u("option", {
|
|
3853
3867
|
value: N,
|
|
3854
|
-
children: [
|
|
3855
|
-
},
|
|
3868
|
+
children: [I, " (+", N, ")"]
|
|
3869
|
+
}, I))
|
|
3856
3870
|
})]
|
|
3857
3871
|
}), u("input", {
|
|
3858
|
-
...
|
|
3872
|
+
...p,
|
|
3859
3873
|
id: "chat-input",
|
|
3860
3874
|
type: "tel",
|
|
3861
3875
|
inputMode: "tel",
|
|
@@ -3863,10 +3877,10 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3863
3877
|
autoCapitalize: "off",
|
|
3864
3878
|
autoCorrect: "off",
|
|
3865
3879
|
autoFocus: !0,
|
|
3866
|
-
ref: (
|
|
3867
|
-
|
|
3880
|
+
ref: (I) => {
|
|
3881
|
+
I && (m.current = I), x(I);
|
|
3868
3882
|
},
|
|
3869
|
-
class:
|
|
3883
|
+
class: We({
|
|
3870
3884
|
optional: e.config.optional,
|
|
3871
3885
|
className: "min-w-0 flex-1 rounded-r-full"
|
|
3872
3886
|
}),
|
|
@@ -3877,12 +3891,12 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3877
3891
|
})]
|
|
3878
3892
|
}), u(Se, {})]
|
|
3879
3893
|
}), u(Le, {
|
|
3880
|
-
error:
|
|
3894
|
+
error: h.countryCode || h.phoneNumber || {
|
|
3881
3895
|
message: i
|
|
3882
3896
|
}
|
|
3883
3897
|
})]
|
|
3884
3898
|
});
|
|
3885
|
-
},
|
|
3899
|
+
}, ti = ({
|
|
3886
3900
|
input: e,
|
|
3887
3901
|
onSubmitSuccess: r
|
|
3888
3902
|
}) => u("div", {
|
|
@@ -3914,7 +3928,7 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3914
3928
|
})]
|
|
3915
3929
|
})
|
|
3916
3930
|
})
|
|
3917
|
-
}),
|
|
3931
|
+
}), ri = {
|
|
3918
3932
|
date: {
|
|
3919
3933
|
type: "date",
|
|
3920
3934
|
inputMode: "text"
|
|
@@ -3933,7 +3947,7 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3933
3947
|
inputMode: "url",
|
|
3934
3948
|
formNoValidate: !0
|
|
3935
3949
|
}
|
|
3936
|
-
},
|
|
3950
|
+
}, si = Ne("string"), ni = (e, r) => {
|
|
3937
3951
|
const t = {
|
|
3938
3952
|
maxLength: r("validation_max_chars", {
|
|
3939
3953
|
count: e.maxChars ?? 999
|
|
@@ -3944,20 +3958,20 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3944
3958
|
};
|
|
3945
3959
|
return et(/* @__PURE__ */ ye({
|
|
3946
3960
|
text: {
|
|
3947
|
-
date: /* @__PURE__ */ ve(/* @__PURE__ */
|
|
3948
|
-
email: /* @__PURE__ */ ve(/* @__PURE__ */
|
|
3949
|
-
text: /* @__PURE__ */ ve(/* @__PURE__ */
|
|
3950
|
-
url: /* @__PURE__ */ ve(/* @__PURE__ */
|
|
3961
|
+
date: /* @__PURE__ */ ve(/* @__PURE__ */ se(r("validation_date")), /* @__PURE__ */ yt(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
|
|
3962
|
+
email: /* @__PURE__ */ ve(/* @__PURE__ */ se(r("validation_email")), /* @__PURE__ */ br(r("validation_email")), /* @__PURE__ */ Ae(e.minChars ?? 1, t.minLength), /* @__PURE__ */ $e(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
3963
|
+
text: /* @__PURE__ */ ve(/* @__PURE__ */ se(), /* @__PURE__ */ Ae(e.minChars ?? 1, t.minLength), /* @__PURE__ */ $e(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
3964
|
+
url: /* @__PURE__ */ ve(/* @__PURE__ */ se(r("validation_url")), /* @__PURE__ */ wr(r("validation_url")), /* @__PURE__ */ Ae(e.minChars ?? 1, t.minLength), /* @__PURE__ */ $e(e.maxChars ?? 1 / 0, t.maxLength))
|
|
3951
3965
|
}[e.format]
|
|
3952
3966
|
}));
|
|
3953
|
-
},
|
|
3967
|
+
}, ii = ({
|
|
3954
3968
|
input: e,
|
|
3955
3969
|
onSubmitSuccess: r
|
|
3956
3970
|
}) => {
|
|
3957
3971
|
var x;
|
|
3958
3972
|
const {
|
|
3959
3973
|
t
|
|
3960
|
-
} =
|
|
3974
|
+
} = ne(), s = e.key ? (x = P.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, i = e.config.defaultValue, {
|
|
3961
3975
|
register: a,
|
|
3962
3976
|
handleSubmit: n,
|
|
3963
3977
|
formState: {
|
|
@@ -3965,12 +3979,12 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3965
3979
|
}
|
|
3966
3980
|
} = Qe({
|
|
3967
3981
|
defaultValues: {
|
|
3968
|
-
text:
|
|
3982
|
+
text: si(s) ? s.value : i ?? ""
|
|
3969
3983
|
},
|
|
3970
|
-
resolver:
|
|
3984
|
+
resolver: ni(e.config, t)
|
|
3971
3985
|
}), {
|
|
3972
3986
|
ref: d,
|
|
3973
|
-
...
|
|
3987
|
+
...h
|
|
3974
3988
|
} = a("text", {
|
|
3975
3989
|
required: !e.config.optional
|
|
3976
3990
|
}), v = ue();
|
|
@@ -3979,10 +3993,10 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3979
3993
|
}, []), u("form", {
|
|
3980
3994
|
noValidate: !0,
|
|
3981
3995
|
class: "flex flex-col gap-1 p-2.5",
|
|
3982
|
-
onSubmit: n((
|
|
3996
|
+
onSubmit: n((p) => {
|
|
3983
3997
|
r({
|
|
3984
3998
|
type: "string",
|
|
3985
|
-
value:
|
|
3999
|
+
value: p.text
|
|
3986
4000
|
});
|
|
3987
4001
|
}),
|
|
3988
4002
|
children: [u("div", {
|
|
@@ -3991,17 +4005,17 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3991
4005
|
class: "relative min-w-0 flex-1",
|
|
3992
4006
|
children: [u("input", {
|
|
3993
4007
|
id: "chat-input",
|
|
3994
|
-
...
|
|
3995
|
-
...
|
|
4008
|
+
...h,
|
|
4009
|
+
...ri[e.config.format],
|
|
3996
4010
|
autocomplete: "off",
|
|
3997
4011
|
autoCapitalize: "off",
|
|
3998
4012
|
autoCorrect: "off",
|
|
3999
4013
|
autoFocus: !0,
|
|
4000
|
-
ref: (
|
|
4001
|
-
|
|
4014
|
+
ref: (p) => {
|
|
4015
|
+
p && (v.current = p), d(p);
|
|
4002
4016
|
},
|
|
4003
4017
|
placeholder: e.config.placeholder,
|
|
4004
|
-
class:
|
|
4018
|
+
class: We({
|
|
4005
4019
|
optional: !!e.config.optional,
|
|
4006
4020
|
className: "w-full rounded-full"
|
|
4007
4021
|
})
|
|
@@ -4014,20 +4028,20 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
4014
4028
|
error: o.text
|
|
4015
4029
|
})]
|
|
4016
4030
|
});
|
|
4017
|
-
},
|
|
4018
|
-
text:
|
|
4019
|
-
phone:
|
|
4020
|
-
"multiple-choice":
|
|
4021
|
-
boolean:
|
|
4031
|
+
}, ai = {
|
|
4032
|
+
text: ii,
|
|
4033
|
+
phone: ei,
|
|
4034
|
+
"multiple-choice": zn,
|
|
4035
|
+
boolean: un,
|
|
4022
4036
|
file: hn,
|
|
4023
|
-
submit:
|
|
4024
|
-
address:
|
|
4025
|
-
number:
|
|
4026
|
-
},
|
|
4037
|
+
submit: ti,
|
|
4038
|
+
address: nn,
|
|
4039
|
+
number: Gn
|
|
4040
|
+
}, oi = ({
|
|
4027
4041
|
logger: e
|
|
4028
4042
|
}) => {
|
|
4029
4043
|
var i;
|
|
4030
|
-
const r = (i =
|
|
4044
|
+
const r = (i = P.current$.value.flow) == null ? void 0 : i.data.currentInput, t = ue(null), s = () => ie.onInteractionFn$.value();
|
|
4031
4045
|
return xe(() => {
|
|
4032
4046
|
var a;
|
|
4033
4047
|
(a = t.current) == null || a.scrollTo({
|
|
@@ -4041,10 +4055,10 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
4041
4055
|
onPointerDownCapture: r ? s : void 0,
|
|
4042
4056
|
onKeyDownCapture: r ? s : void 0,
|
|
4043
4057
|
children: r ? (() => {
|
|
4044
|
-
const a =
|
|
4058
|
+
const a = ai[r.type];
|
|
4045
4059
|
return u(a, {
|
|
4046
4060
|
logger: e,
|
|
4047
|
-
onSubmitSuccess:
|
|
4061
|
+
onSubmitSuccess: ie.onSubmitSuccessFn$.value,
|
|
4048
4062
|
input: r
|
|
4049
4063
|
});
|
|
4050
4064
|
})() : u("div", {
|
|
@@ -4052,7 +4066,7 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
4052
4066
|
children: [u("input", {
|
|
4053
4067
|
"aria-hidden": "true",
|
|
4054
4068
|
id: "chat-input",
|
|
4055
|
-
class:
|
|
4069
|
+
class: We({
|
|
4056
4070
|
optional: !1,
|
|
4057
4071
|
className: "flex-grow rounded-full"
|
|
4058
4072
|
}),
|
|
@@ -4066,30 +4080,30 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
4066
4080
|
})
|
|
4067
4081
|
});
|
|
4068
4082
|
};
|
|
4069
|
-
function
|
|
4083
|
+
function li(e) {
|
|
4070
4084
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4071
4085
|
}
|
|
4072
|
-
var
|
|
4086
|
+
var ui = function(e) {
|
|
4073
4087
|
return e instanceof RegExp;
|
|
4074
|
-
},
|
|
4088
|
+
}, ci = function(r) {
|
|
4075
4089
|
var t = /[\\^$.*+?()[\]{}|]/g, s = RegExp(t.source);
|
|
4076
4090
|
return r && s.test(r) ? r.replace(t, "\\$&") : r;
|
|
4077
4091
|
}, Pr = function(e) {
|
|
4078
4092
|
return typeof e == "string";
|
|
4079
|
-
},
|
|
4093
|
+
}, di = function(e) {
|
|
4080
4094
|
var r = [];
|
|
4081
4095
|
return e.forEach(function(t) {
|
|
4082
4096
|
Array.isArray(t) ? r = r.concat(t) : r.push(t);
|
|
4083
4097
|
}), r;
|
|
4084
4098
|
};
|
|
4085
|
-
function
|
|
4099
|
+
function fi(e, r, t) {
|
|
4086
4100
|
var s = 0, i = 0;
|
|
4087
4101
|
if (e === "")
|
|
4088
4102
|
return e;
|
|
4089
4103
|
if (!e || !Pr(e))
|
|
4090
4104
|
throw new TypeError("First argument to react-string-replace#replaceString must be a string");
|
|
4091
4105
|
var a = r;
|
|
4092
|
-
|
|
4106
|
+
ui(a) || (a = new RegExp("(" + ci(a) + ")", "gi"));
|
|
4093
4107
|
for (var n = e.split(a), o = 1, d = n.length; o < d; o += 2) {
|
|
4094
4108
|
if (n[o] === void 0 || n[o - 1] === void 0) {
|
|
4095
4109
|
console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
|
|
@@ -4099,32 +4113,32 @@ function di(e, r, t) {
|
|
|
4099
4113
|
}
|
|
4100
4114
|
return n;
|
|
4101
4115
|
}
|
|
4102
|
-
var
|
|
4103
|
-
return Array.isArray(r) || (r = [r]),
|
|
4104
|
-
return Pr(i) ?
|
|
4116
|
+
var pi = function(r, t, s) {
|
|
4117
|
+
return Array.isArray(r) || (r = [r]), di(r.map(function(i) {
|
|
4118
|
+
return Pr(i) ? fi(i, t, s) : i;
|
|
4105
4119
|
}));
|
|
4106
4120
|
};
|
|
4107
|
-
const Be = /* @__PURE__ */
|
|
4121
|
+
const Be = /* @__PURE__ */ li(pi), hi = /(\[[^\]]+\]\([^)]+\))/g, yi = /\[([^\]]+)\]\(([^)]+)\)/, mi = /(https?:\/\/[^\s]+)/g, gi = /_(.*?)_/g, bi = /\*\*(.*?)\*\*/g, vi = /\\n|\n/g, lr = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", xi = (e) => {
|
|
4108
4122
|
const r = Be(e, hi, (n, o) => {
|
|
4109
|
-
const [, d,
|
|
4110
|
-
return
|
|
4123
|
+
const [, d, h] = n.match(yi) ?? [];
|
|
4124
|
+
return h ? u("a", {
|
|
4111
4125
|
class: lr,
|
|
4112
|
-
href:
|
|
4113
|
-
children: d ??
|
|
4114
|
-
},
|
|
4126
|
+
href: h,
|
|
4127
|
+
children: d ?? h
|
|
4128
|
+
}, h + o) : u("span", {
|
|
4115
4129
|
children: "INVALID LINK"
|
|
4116
4130
|
});
|
|
4117
|
-
}), t = Be(r,
|
|
4131
|
+
}), t = Be(r, mi, (n, o) => u("a", {
|
|
4118
4132
|
class: lr,
|
|
4119
4133
|
href: n,
|
|
4120
4134
|
children: n
|
|
4121
|
-
}, n + o)), s = Be(t,
|
|
4135
|
+
}, n + o)), s = Be(t, gi, (n, o) => u("em", {
|
|
4122
4136
|
children: n
|
|
4123
|
-
}, n + o)), i = Be(s,
|
|
4137
|
+
}, n + o)), i = Be(s, bi, (n, o) => u("strong", {
|
|
4124
4138
|
children: n
|
|
4125
4139
|
}, n + o));
|
|
4126
|
-
return Be(i,
|
|
4127
|
-
},
|
|
4140
|
+
return Be(i, vi, (n, o) => u("br", {}, `br-${o}`));
|
|
4141
|
+
}, wi = Ze("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", {
|
|
4128
4142
|
variants: {
|
|
4129
4143
|
side: {
|
|
4130
4144
|
left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
|
|
@@ -4138,7 +4152,7 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4138
4152
|
defaultVariants: {
|
|
4139
4153
|
side: "left"
|
|
4140
4154
|
}
|
|
4141
|
-
}),
|
|
4155
|
+
}), _i = ({
|
|
4142
4156
|
children: e,
|
|
4143
4157
|
className: r,
|
|
4144
4158
|
animate: t,
|
|
@@ -4148,14 +4162,14 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4148
4162
|
style: {
|
|
4149
4163
|
transformOrigin: s === "left" ? "0% 50%" : "100% 50%"
|
|
4150
4164
|
},
|
|
4151
|
-
class:
|
|
4165
|
+
class: wi({
|
|
4152
4166
|
className: r,
|
|
4153
4167
|
side: s,
|
|
4154
4168
|
animate: t
|
|
4155
4169
|
}),
|
|
4156
4170
|
...i,
|
|
4157
4171
|
children: e
|
|
4158
|
-
}),
|
|
4172
|
+
}), ki = ({
|
|
4159
4173
|
message: e
|
|
4160
4174
|
}) => u("div", {
|
|
4161
4175
|
class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
|
|
@@ -4179,12 +4193,12 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4179
4193
|
})
|
|
4180
4194
|
})]
|
|
4181
4195
|
})
|
|
4182
|
-
}),
|
|
4196
|
+
}), Ci = ({
|
|
4183
4197
|
className: e,
|
|
4184
4198
|
...r
|
|
4185
4199
|
}) => u("div", {
|
|
4186
4200
|
"aria-hidden": !0,
|
|
4187
|
-
children:
|
|
4201
|
+
children: ie.isBotTyping$.value === !0 ? u("div", {
|
|
4188
4202
|
"aria-label": "Typing…",
|
|
4189
4203
|
class: Me("flex gap-1 p-4", e),
|
|
4190
4204
|
...r,
|
|
@@ -4197,10 +4211,10 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4197
4211
|
}
|
|
4198
4212
|
}))
|
|
4199
4213
|
}) : void 0
|
|
4200
|
-
}),
|
|
4214
|
+
}), Si = {
|
|
4201
4215
|
bot: "left",
|
|
4202
4216
|
user: "right"
|
|
4203
|
-
},
|
|
4217
|
+
}, Ii = Ze("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)]", {
|
|
4204
4218
|
variants: {
|
|
4205
4219
|
variant: {
|
|
4206
4220
|
info: "text-neutral-8",
|
|
@@ -4209,10 +4223,10 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4209
4223
|
success: "text-[#4CAF50]"
|
|
4210
4224
|
}
|
|
4211
4225
|
}
|
|
4212
|
-
}),
|
|
4226
|
+
}), Vi = ({
|
|
4213
4227
|
lastSentMessageFooter: e
|
|
4214
4228
|
}) => {
|
|
4215
|
-
const r =
|
|
4229
|
+
const r = P.current$.value.flow, t = (r == null ? void 0 : r.data.messages) ?? [], s = r ? pt(r) : void 0;
|
|
4216
4230
|
return u("ol", {
|
|
4217
4231
|
"aria-label": "Chat messages",
|
|
4218
4232
|
"aria-live": "polite",
|
|
@@ -4224,7 +4238,7 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4224
4238
|
children: [s && i.groupId === s && !t.slice(a + 1).some((n) => n.groupId === s) ? e : null, us(i).with({
|
|
4225
4239
|
type: "system"
|
|
4226
4240
|
}, (n) => u("p", {
|
|
4227
|
-
class:
|
|
4241
|
+
class: Ii({
|
|
4228
4242
|
variant: n.variant
|
|
4229
4243
|
}),
|
|
4230
4244
|
children: n.text
|
|
@@ -4232,17 +4246,17 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4232
4246
|
type: "text",
|
|
4233
4247
|
author: cs.union("bot", "user")
|
|
4234
4248
|
}, (n) => {
|
|
4235
|
-
const o = a === t.length - 1, d = n.author === "bot" ?
|
|
4249
|
+
const o = a === t.length - 1, d = n.author === "bot" ? xi(n.text) : n.text;
|
|
4236
4250
|
return u(me, {
|
|
4237
|
-
children: u(
|
|
4251
|
+
children: u(_i, {
|
|
4238
4252
|
animate: o,
|
|
4239
|
-
side:
|
|
4253
|
+
side: Si[n.author],
|
|
4240
4254
|
children: d
|
|
4241
4255
|
}, a)
|
|
4242
4256
|
});
|
|
4243
4257
|
}).with({
|
|
4244
4258
|
type: "link"
|
|
4245
|
-
}, (n) => u(
|
|
4259
|
+
}, (n) => u(ki, {
|
|
4246
4260
|
message: n
|
|
4247
4261
|
})).with({
|
|
4248
4262
|
type: "image"
|
|
@@ -4254,7 +4268,7 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4254
4268
|
}
|
|
4255
4269
|
})).with({
|
|
4256
4270
|
type: "file"
|
|
4257
|
-
}, (n) => u(
|
|
4271
|
+
}, (n) => u(fn, {
|
|
4258
4272
|
class: n.author === "bot" ? void 0 : "ml-auto",
|
|
4259
4273
|
file: {
|
|
4260
4274
|
name: n.fileName,
|
|
@@ -4264,9 +4278,9 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4264
4278
|
type: "loading"
|
|
4265
4279
|
}, (n) => {
|
|
4266
4280
|
const o = t[t.length - 1];
|
|
4267
|
-
return !(n === o) ||
|
|
4281
|
+
return !(n === o) || ie.isBotTyping$.value ? null : u("div", {
|
|
4268
4282
|
class: "flex flex-grow flex-col items-center justify-center gap-2",
|
|
4269
|
-
children: [u(
|
|
4283
|
+
children: [u(ht, {
|
|
4270
4284
|
"aria-hidden": n.text ? "true" : void 0,
|
|
4271
4285
|
class: "text-neutral-6 h-8 w-8"
|
|
4272
4286
|
}), n.text ? u("p", {
|
|
@@ -4277,9 +4291,9 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4277
4291
|
});
|
|
4278
4292
|
}).exhaustive()]
|
|
4279
4293
|
})
|
|
4280
|
-
}, a)), u(
|
|
4294
|
+
}, a)), u(Ci, {}, "typing")]
|
|
4281
4295
|
});
|
|
4282
|
-
},
|
|
4296
|
+
}, Ni = ({
|
|
4283
4297
|
logger: e,
|
|
4284
4298
|
apiClient: r,
|
|
4285
4299
|
analytics: t,
|
|
@@ -4287,35 +4301,35 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4287
4301
|
}) => {
|
|
4288
4302
|
const {
|
|
4289
4303
|
flow: i
|
|
4290
|
-
} =
|
|
4304
|
+
} = P.current$.value;
|
|
4291
4305
|
Ce(i, "Flow is required to exist to show chatbot body");
|
|
4292
|
-
const a =
|
|
4306
|
+
const a = P.viewState$.value, {
|
|
4293
4307
|
chatRef: n,
|
|
4294
4308
|
chatService: o
|
|
4295
4309
|
} = ds(), {
|
|
4296
4310
|
t: d
|
|
4297
|
-
} =
|
|
4311
|
+
} = ne(), [h, v] = _e();
|
|
4298
4312
|
return xe(() => {
|
|
4299
|
-
a === "maximised" &&
|
|
4313
|
+
a === "maximised" && ie.scrollToEnd();
|
|
4300
4314
|
}, [a]), xe(() => {
|
|
4301
4315
|
var y;
|
|
4302
4316
|
const {
|
|
4303
4317
|
state: x,
|
|
4304
|
-
flow:
|
|
4305
|
-
} =
|
|
4318
|
+
flow: p
|
|
4319
|
+
} = P.current$.peek();
|
|
4306
4320
|
if (x !== "loaded")
|
|
4307
4321
|
throw new Error(d("invalid_state"));
|
|
4308
|
-
let m =
|
|
4309
|
-
if (
|
|
4322
|
+
let m = p.data.nodeHistory.at(-1);
|
|
4323
|
+
if (ie.scrollToEnd(), P.setInput(void 0), p.data.isFinished)
|
|
4310
4324
|
return;
|
|
4311
4325
|
const k = () => {
|
|
4312
|
-
const C =
|
|
4313
|
-
!C || C.data.hasInteracted || (
|
|
4326
|
+
const C = P.current$.peek().flow;
|
|
4327
|
+
!C || C.data.hasInteracted || (P.markAsInteracted(), Ot(t, C, "FLOW_INTERACT"));
|
|
4314
4328
|
};
|
|
4315
|
-
|
|
4329
|
+
ie.onInteractionFn$.value = k, m === void 0 ? (m = cr(i.nodes).id, P.setCurrentNodeId(m), Ot(t, p, "FLOW_START")) : P.removeMessagesSentByNodeIds([m]);
|
|
4316
4330
|
const {
|
|
4317
|
-
interpret:
|
|
4318
|
-
abort:
|
|
4331
|
+
interpret: V,
|
|
4332
|
+
abort: I,
|
|
4319
4333
|
undo: N
|
|
4320
4334
|
} = vs({
|
|
4321
4335
|
context: i.context,
|
|
@@ -4331,20 +4345,20 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4331
4345
|
t: d,
|
|
4332
4346
|
getApplicationRecovery: () => {
|
|
4333
4347
|
var C;
|
|
4334
|
-
return (C =
|
|
4348
|
+
return (C = P.current$.peek().flow) == null ? void 0 : C.data.applicationRecovery;
|
|
4335
4349
|
},
|
|
4336
|
-
setApplicationRecovery:
|
|
4337
|
-
persistWriteBarrier: () =>
|
|
4350
|
+
setApplicationRecovery: P.setApplicationRecovery,
|
|
4351
|
+
persistWriteBarrier: () => P.persistWriteBarrier(p),
|
|
4338
4352
|
// We need to get fresh submissions, that’s why we call `peek` here.
|
|
4339
4353
|
getSubmissions: () => {
|
|
4340
4354
|
var C;
|
|
4341
|
-
return (C =
|
|
4355
|
+
return (C = P.current$.peek().flow) == null ? void 0 : C.data.submissions;
|
|
4342
4356
|
},
|
|
4343
|
-
onInterpret: (C) =>
|
|
4357
|
+
onInterpret: (C) => P.setCurrentNodeId(C.id),
|
|
4344
4358
|
onFlowEnd: async () => {
|
|
4345
|
-
var
|
|
4346
|
-
|
|
4347
|
-
const C =
|
|
4359
|
+
var E;
|
|
4360
|
+
P.markAsFinished();
|
|
4361
|
+
const C = P.current$.peek().flow;
|
|
4348
4362
|
Ce(C), t.log({
|
|
4349
4363
|
event: "FLOW_END",
|
|
4350
4364
|
properties: {
|
|
@@ -4354,13 +4368,13 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4354
4368
|
flow_build: i.build,
|
|
4355
4369
|
job: i.job
|
|
4356
4370
|
},
|
|
4357
|
-
customProperties: (
|
|
4371
|
+
customProperties: (E = i.analytics) == null ? void 0 : E.customProperties
|
|
4358
4372
|
});
|
|
4359
4373
|
}
|
|
4360
4374
|
});
|
|
4361
|
-
return v(() => N),
|
|
4362
|
-
|
|
4363
|
-
}),
|
|
4375
|
+
return v(() => N), V(m), () => {
|
|
4376
|
+
ie.onInteractionFn$.value === k && (ie.onInteractionFn$.value = () => {
|
|
4377
|
+
}), I();
|
|
4364
4378
|
};
|
|
4365
4379
|
}, [t, r, o, e, i, s, d]), u(me, {
|
|
4366
4380
|
children: [u("div", {
|
|
@@ -4374,43 +4388,43 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4374
4388
|
style: {
|
|
4375
4389
|
WebkitOverflowScrolling: "touch"
|
|
4376
4390
|
},
|
|
4377
|
-
children: u(
|
|
4378
|
-
lastSentMessageFooter: !
|
|
4379
|
-
undoFn:
|
|
4391
|
+
children: u(Vi, {
|
|
4392
|
+
lastSentMessageFooter: !pt(i) || !h ? null : u(Fi, {
|
|
4393
|
+
undoFn: h
|
|
4380
4394
|
})
|
|
4381
4395
|
})
|
|
4382
|
-
}),
|
|
4396
|
+
}), ie.isReadingHistory$.value && !i.data.isFinished && !ie.isBotTyping$.value && u("div", {
|
|
4383
4397
|
class: "absolute bottom-2 left-1/2 -translate-x-1/2",
|
|
4384
|
-
children: u(
|
|
4398
|
+
children: u(pr, {
|
|
4385
4399
|
class: "bg-neutral-1 ring-divider shadow-surface-md ring-1",
|
|
4386
4400
|
"aria-label": d("jump_to_current"),
|
|
4387
4401
|
onClick: () => {
|
|
4388
|
-
var
|
|
4389
|
-
|
|
4402
|
+
var p, m;
|
|
4403
|
+
ie.scrollToEnd(), (m = ((p = n.current) == null ? void 0 : p.querySelector('li[tabindex="-1"]')) ?? n.current) == null || m.focus({
|
|
4390
4404
|
preventScroll: !0
|
|
4391
4405
|
});
|
|
4392
4406
|
},
|
|
4393
4407
|
children: u(fs, {})
|
|
4394
4408
|
})
|
|
4395
4409
|
})]
|
|
4396
|
-
}), u(
|
|
4410
|
+
}), u(oi, {
|
|
4397
4411
|
logger: e
|
|
4398
4412
|
})]
|
|
4399
4413
|
});
|
|
4400
|
-
},
|
|
4414
|
+
}, Fi = ({
|
|
4401
4415
|
undoFn: e
|
|
4402
4416
|
}) => {
|
|
4403
4417
|
const {
|
|
4404
4418
|
t: r
|
|
4405
|
-
} =
|
|
4419
|
+
} = ne();
|
|
4406
4420
|
return u("div", {
|
|
4407
4421
|
class: "flex flex-1 items-center justify-end px-1",
|
|
4408
|
-
children: u(
|
|
4422
|
+
children: u(pr, {
|
|
4409
4423
|
"aria-label": r("undo"),
|
|
4410
4424
|
onClick: async () => {
|
|
4411
4425
|
const {
|
|
4412
4426
|
flow: t
|
|
4413
|
-
} =
|
|
4427
|
+
} = P.current$.peek();
|
|
4414
4428
|
Ce(t), e(t.data.nodeHistory);
|
|
4415
4429
|
},
|
|
4416
4430
|
children: u("path", {
|
|
@@ -4420,5 +4434,5 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4420
4434
|
});
|
|
4421
4435
|
};
|
|
4422
4436
|
export {
|
|
4423
|
-
|
|
4437
|
+
Ni as ChatbotBody
|
|
4424
4438
|
};
|