@inploi/plugin-chatbot 6.0.0 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.js +5 -0
- package/cdn/style.css +1 -0
- package/dist/{chatbot-body-7a1a39d5.js → chatbot-body-1964a1ed.js} +359 -357
- package/dist/chatbot-body-6eb29db1.cjs +1 -0
- package/dist/chatbot.d.ts +1 -0
- package/dist/components/chat-input/chat-input.boolean.d.ts +2 -1
- package/dist/{index-a14b193c.cjs → index-0b742038.cjs} +3 -3
- package/dist/{index-20ae56ee.js → index-df69f83a.js} +173 -173
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +4 -4
- package/dist/chatbot-body-4e70aa38.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as Ke, i as er, k as Te, a as tr, b as fe, A as Le, c as
|
|
1
|
+
import { g as Ke, i as er, k as Te, a as tr, b as fe, A as Le, c as Fr, N as Ge, _ as T, d as rr, h as ee, e as re, p as le, F as mt, u as G, o as l, f as Re, j as ft, y as pe, s as I, l as Xe, m as ve, n as Lr, q as he, r as Nr, t as it, v as X, w as Tr, x as nr, z as Dr, B as sr, C as Rr, D as Ce, E as Y, G as Or, V as Br, H as ye, I as De, J as ze, K as ar, L as Pr, M as $r, O as jr, P as zr, Q as Ur, R as qr, S as Kr, T as Gr, U as Hr, W as Wr, X as Jr } from "./index-df69f83a.js";
|
|
2
2
|
import "@inploi/sdk";
|
|
3
3
|
const Lt = ({
|
|
4
4
|
condition: e,
|
|
@@ -172,10 +172,10 @@ const Lt = ({
|
|
|
172
172
|
return !1;
|
|
173
173
|
return !0;
|
|
174
174
|
}
|
|
175
|
-
},
|
|
175
|
+
}, Zr = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, ne = (e, {
|
|
176
176
|
context: t,
|
|
177
177
|
submissions: r
|
|
178
|
-
}) => e.replace(
|
|
178
|
+
}) => e.replace(Zr, (n, s, a = "") => {
|
|
179
179
|
const [i, ...u] = s.trim().split("."), d = or({
|
|
180
180
|
key: i,
|
|
181
181
|
path: u,
|
|
@@ -231,7 +231,7 @@ const Lt = ({
|
|
|
231
231
|
nodes: t,
|
|
232
232
|
stopWhen: r
|
|
233
233
|
});
|
|
234
|
-
},
|
|
234
|
+
}, Xr = ({
|
|
235
235
|
childNode: e,
|
|
236
236
|
nodes: t
|
|
237
237
|
}) => {
|
|
@@ -250,7 +250,7 @@ const Lt = ({
|
|
|
250
250
|
});
|
|
251
251
|
if (n != null && n.nextId)
|
|
252
252
|
return t.find((s) => s.id === n.nextId);
|
|
253
|
-
},
|
|
253
|
+
}, Qr = ({
|
|
254
254
|
flow: e,
|
|
255
255
|
analytics: t,
|
|
256
256
|
logger: r,
|
|
@@ -272,11 +272,11 @@ const Lt = ({
|
|
|
272
272
|
...t.customProperties
|
|
273
273
|
}
|
|
274
274
|
})
|
|
275
|
-
}, h = async (_,
|
|
275
|
+
}, h = async (_, y) => {
|
|
276
276
|
const A = a();
|
|
277
|
-
d == null || d(_,
|
|
277
|
+
d == null || d(_, y);
|
|
278
278
|
try {
|
|
279
|
-
await
|
|
279
|
+
await Yr({
|
|
280
280
|
flow: e,
|
|
281
281
|
analytics: v,
|
|
282
282
|
logger: r,
|
|
@@ -298,7 +298,7 @@ const Lt = ({
|
|
|
298
298
|
addToSubmissions: i.addToSubmissions
|
|
299
299
|
},
|
|
300
300
|
next: (S) => {
|
|
301
|
-
const E = S ? e.nodes.find((g) => g.id === S) :
|
|
301
|
+
const E = S ? e.nodes.find((g) => g.id === S) : Xr({
|
|
302
302
|
childNode: _,
|
|
303
303
|
nodes: e.nodes
|
|
304
304
|
});
|
|
@@ -314,21 +314,21 @@ const Lt = ({
|
|
|
314
314
|
};
|
|
315
315
|
return {
|
|
316
316
|
interpret: async (_) => {
|
|
317
|
-
const
|
|
318
|
-
return h(
|
|
317
|
+
const y = e.nodes.find((A) => A.id === _) ?? tr(e.nodes);
|
|
318
|
+
return h(y);
|
|
319
319
|
},
|
|
320
320
|
undo: (_) => {
|
|
321
|
-
let
|
|
321
|
+
let y = 1;
|
|
322
322
|
const A = e.nodes.find((E) => E.id === _[_.length - 1]);
|
|
323
323
|
for (let E = _.length - 2; E > 0; E--) {
|
|
324
324
|
const g = _[E], F = e.nodes.find((j) => j.id === g);
|
|
325
|
-
if (!F || (
|
|
325
|
+
if (!F || (y++, F.type.startsWith("question-")))
|
|
326
326
|
break;
|
|
327
327
|
}
|
|
328
328
|
w.abort(), w = new AbortController();
|
|
329
|
-
const S = e.nodes.find((E) => E.id === _[_.length -
|
|
329
|
+
const S = e.nodes.find((E) => E.id === _[_.length - y]);
|
|
330
330
|
return fe(S, "Undo failed: new start node not found"), h(S, A), {
|
|
331
|
-
removed:
|
|
331
|
+
removed: y
|
|
332
332
|
};
|
|
333
333
|
},
|
|
334
334
|
abort: () => {
|
|
@@ -336,93 +336,93 @@ const Lt = ({
|
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
}, Qe = (e) => `+${e.countryCode} ${e.phoneNumber}`;
|
|
339
|
-
async function
|
|
339
|
+
async function Yr(e) {
|
|
340
340
|
const t = e.node;
|
|
341
341
|
switch (t.type) {
|
|
342
342
|
case "text":
|
|
343
|
-
return
|
|
343
|
+
return ln({
|
|
344
344
|
...e,
|
|
345
345
|
node: t
|
|
346
346
|
});
|
|
347
347
|
case "image":
|
|
348
|
-
return
|
|
348
|
+
return un({
|
|
349
349
|
...e,
|
|
350
350
|
node: t
|
|
351
351
|
});
|
|
352
352
|
case "question-text":
|
|
353
|
-
return
|
|
353
|
+
return cn({
|
|
354
354
|
...e,
|
|
355
355
|
node: t
|
|
356
356
|
});
|
|
357
357
|
case "question-enum":
|
|
358
|
-
return
|
|
358
|
+
return hn({
|
|
359
359
|
...e,
|
|
360
360
|
node: t
|
|
361
361
|
});
|
|
362
362
|
case "question-number":
|
|
363
|
-
return
|
|
363
|
+
return dn({
|
|
364
364
|
...e,
|
|
365
365
|
node: t
|
|
366
366
|
});
|
|
367
367
|
case "question-phone":
|
|
368
|
-
return
|
|
368
|
+
return fn({
|
|
369
369
|
...e,
|
|
370
370
|
node: t
|
|
371
371
|
});
|
|
372
372
|
case "question-boolean":
|
|
373
|
-
return
|
|
373
|
+
return pn({
|
|
374
374
|
...e,
|
|
375
375
|
node: t
|
|
376
376
|
});
|
|
377
377
|
case "question-file":
|
|
378
|
-
return
|
|
378
|
+
return gn({
|
|
379
379
|
...e,
|
|
380
380
|
node: t
|
|
381
381
|
});
|
|
382
382
|
case "question-address":
|
|
383
|
-
return
|
|
383
|
+
return mn({
|
|
384
384
|
...e,
|
|
385
385
|
node: t
|
|
386
386
|
});
|
|
387
387
|
case "end-flow":
|
|
388
|
-
return
|
|
388
|
+
return bn({
|
|
389
389
|
...e,
|
|
390
390
|
node: t
|
|
391
391
|
});
|
|
392
392
|
case "if-block":
|
|
393
|
-
return
|
|
393
|
+
return on({
|
|
394
394
|
...e,
|
|
395
395
|
node: t
|
|
396
396
|
});
|
|
397
397
|
case "jump":
|
|
398
|
-
return
|
|
398
|
+
return rn({
|
|
399
399
|
...e,
|
|
400
400
|
node: t
|
|
401
401
|
});
|
|
402
402
|
case "link":
|
|
403
|
-
return
|
|
403
|
+
return an({
|
|
404
404
|
...e,
|
|
405
405
|
node: t
|
|
406
406
|
});
|
|
407
407
|
case "integration-application-submit":
|
|
408
|
-
return
|
|
408
|
+
return sn({
|
|
409
409
|
...e,
|
|
410
410
|
node: t
|
|
411
411
|
});
|
|
412
412
|
case "add-submission":
|
|
413
|
-
return
|
|
413
|
+
return nn({
|
|
414
414
|
...e,
|
|
415
415
|
node: t
|
|
416
416
|
});
|
|
417
417
|
case "integration-workflow-get":
|
|
418
418
|
throw Error("Workflow should be unreachable");
|
|
419
419
|
case "identify":
|
|
420
|
-
return
|
|
420
|
+
return tn({
|
|
421
421
|
...e,
|
|
422
422
|
node: t
|
|
423
423
|
});
|
|
424
424
|
case "feedback":
|
|
425
|
-
return
|
|
425
|
+
return en({
|
|
426
426
|
...e,
|
|
427
427
|
node: t
|
|
428
428
|
});
|
|
@@ -437,13 +437,13 @@ const Ie = (e, t) => {
|
|
|
437
437
|
throw new Error(`Submission at “${t}” is not a string or number`);
|
|
438
438
|
return r;
|
|
439
439
|
};
|
|
440
|
-
async function
|
|
440
|
+
async function en({
|
|
441
441
|
next: e,
|
|
442
442
|
node: t
|
|
443
443
|
}) {
|
|
444
444
|
e(t.nextId);
|
|
445
445
|
}
|
|
446
|
-
async function
|
|
446
|
+
async function tn({
|
|
447
447
|
next: e,
|
|
448
448
|
node: t,
|
|
449
449
|
analytics: r,
|
|
@@ -476,13 +476,13 @@ async function en({
|
|
|
476
476
|
e(t.nextId);
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
async function
|
|
479
|
+
async function rn({
|
|
480
480
|
next: e,
|
|
481
481
|
node: t
|
|
482
482
|
}) {
|
|
483
483
|
e(t.data.targetId);
|
|
484
484
|
}
|
|
485
|
-
async function
|
|
485
|
+
async function nn({
|
|
486
486
|
next: e,
|
|
487
487
|
node: t,
|
|
488
488
|
logger: r,
|
|
@@ -501,7 +501,7 @@ async function rn({
|
|
|
501
501
|
})
|
|
502
502
|
}, e(t.nextId);
|
|
503
503
|
}
|
|
504
|
-
async function
|
|
504
|
+
async function sn({
|
|
505
505
|
chat: e,
|
|
506
506
|
next: t,
|
|
507
507
|
node: r,
|
|
@@ -533,9 +533,9 @@ async function nn({
|
|
|
533
533
|
anonymous_id: v,
|
|
534
534
|
session_id: h,
|
|
535
535
|
job: u.job,
|
|
536
|
-
submissions:
|
|
536
|
+
submissions: Fr(a || {})
|
|
537
537
|
})
|
|
538
|
-
}).catch((
|
|
538
|
+
}).catch((y) => y);
|
|
539
539
|
r.data.key && e.addToSubmissions(r.data.key, {
|
|
540
540
|
type: "integration",
|
|
541
541
|
value: _
|
|
@@ -552,7 +552,7 @@ async function nn({
|
|
|
552
552
|
data: T.any
|
|
553
553
|
}
|
|
554
554
|
}))
|
|
555
|
-
}, (
|
|
555
|
+
}, (y) => {
|
|
556
556
|
i.log({
|
|
557
557
|
event: "FLOW_SUBMIT",
|
|
558
558
|
properties: {
|
|
@@ -560,10 +560,10 @@ async function nn({
|
|
|
560
560
|
flow_version: u.version,
|
|
561
561
|
flow_session_id: u.data.flowSessionId,
|
|
562
562
|
flow_build: u.build,
|
|
563
|
-
service:
|
|
563
|
+
service: y.service ?? "INVALID_SERVICE",
|
|
564
564
|
response: {
|
|
565
|
-
status:
|
|
566
|
-
payload: "data" in
|
|
565
|
+
status: y.status,
|
|
566
|
+
payload: "data" in y ? y.data : y.error.data ?? null
|
|
567
567
|
},
|
|
568
568
|
job: u.job
|
|
569
569
|
}
|
|
@@ -577,18 +577,18 @@ async function nn({
|
|
|
577
577
|
button_text: T.optional(T.union(T.string, T.nullish))
|
|
578
578
|
})
|
|
579
579
|
}
|
|
580
|
-
}, async (
|
|
580
|
+
}, async (y) => {
|
|
581
581
|
await e.sendMessage({
|
|
582
582
|
type: "text",
|
|
583
583
|
author: "bot",
|
|
584
|
-
text:
|
|
584
|
+
text: y.redirect.message ?? d("submission_redirect_message")
|
|
585
585
|
});
|
|
586
586
|
try {
|
|
587
|
-
const A = new URL(
|
|
587
|
+
const A = new URL(y.redirect.redirect_url);
|
|
588
588
|
v && !A.searchParams.has("anonymous_id") && A.searchParams.set("anonymous_id", v), await e.sendMessage({
|
|
589
589
|
type: "link",
|
|
590
590
|
href: A.toString(),
|
|
591
|
-
text:
|
|
591
|
+
text: y.redirect.button_text ?? d("complete_submission"),
|
|
592
592
|
onClick: () => {
|
|
593
593
|
if (!h) {
|
|
594
594
|
n.error("session_id not set, cannot log FLOW_REDIRECT event");
|
|
@@ -608,7 +608,7 @@ async function nn({
|
|
|
608
608
|
}
|
|
609
609
|
});
|
|
610
610
|
} catch (A) {
|
|
611
|
-
n.error(`Invalid redirect URL: ${
|
|
611
|
+
n.error(`Invalid redirect URL: ${y.redirect.redirect_url}`, A), e.sendMessage({
|
|
612
612
|
type: "system",
|
|
613
613
|
variant: "error",
|
|
614
614
|
text: d("redirect_url_error")
|
|
@@ -629,14 +629,14 @@ async function nn({
|
|
|
629
629
|
message: T.string
|
|
630
630
|
})
|
|
631
631
|
}
|
|
632
|
-
}, async (
|
|
633
|
-
n.error(
|
|
632
|
+
}, async (y) => {
|
|
633
|
+
n.error(y.error), await e.sendMessage({
|
|
634
634
|
type: "system",
|
|
635
635
|
variant: "error",
|
|
636
|
-
text:
|
|
636
|
+
text: y.error.message || d("submission_failed")
|
|
637
637
|
}), await p(!1);
|
|
638
|
-
}).otherwise(async (
|
|
639
|
-
n.error(
|
|
638
|
+
}).otherwise(async (y) => {
|
|
639
|
+
n.error(y), await e.sendMessage({
|
|
640
640
|
type: "system",
|
|
641
641
|
variant: "error",
|
|
642
642
|
text: d("submission_failed")
|
|
@@ -645,7 +645,7 @@ async function nn({
|
|
|
645
645
|
};
|
|
646
646
|
await p(r.data.skipConfirmation);
|
|
647
647
|
}
|
|
648
|
-
async function
|
|
648
|
+
async function an({
|
|
649
649
|
chat: e,
|
|
650
650
|
next: t,
|
|
651
651
|
node: r,
|
|
@@ -664,7 +664,7 @@ async function sn({
|
|
|
664
664
|
})
|
|
665
665
|
}), t(r.nextId);
|
|
666
666
|
}
|
|
667
|
-
async function
|
|
667
|
+
async function on({
|
|
668
668
|
submissions: e,
|
|
669
669
|
next: t,
|
|
670
670
|
node: r,
|
|
@@ -675,7 +675,7 @@ async function an({
|
|
|
675
675
|
context: n
|
|
676
676
|
}) ? r.branchId : r.nextId);
|
|
677
677
|
}
|
|
678
|
-
async function
|
|
678
|
+
async function ln({
|
|
679
679
|
chat: e,
|
|
680
680
|
next: t,
|
|
681
681
|
node: r,
|
|
@@ -691,7 +691,7 @@ async function on({
|
|
|
691
691
|
})
|
|
692
692
|
}), t(r.nextId);
|
|
693
693
|
}
|
|
694
|
-
async function
|
|
694
|
+
async function un({
|
|
695
695
|
chat: e,
|
|
696
696
|
next: t,
|
|
697
697
|
node: r
|
|
@@ -704,7 +704,7 @@ async function ln({
|
|
|
704
704
|
width: r.data.width
|
|
705
705
|
}), t(r.nextId);
|
|
706
706
|
}
|
|
707
|
-
async function
|
|
707
|
+
async function cn({
|
|
708
708
|
chat: e,
|
|
709
709
|
next: t,
|
|
710
710
|
node: r,
|
|
@@ -751,7 +751,7 @@ async function un({
|
|
|
751
751
|
text: i.type === "phone" ? Qe(i.value) : i.value
|
|
752
752
|
}), t(r.nextId);
|
|
753
753
|
}
|
|
754
|
-
async function
|
|
754
|
+
async function dn({
|
|
755
755
|
chat: e,
|
|
756
756
|
next: t,
|
|
757
757
|
node: r,
|
|
@@ -788,7 +788,7 @@ async function cn({
|
|
|
788
788
|
text: i.value.toString()
|
|
789
789
|
}), t(r.nextId);
|
|
790
790
|
}
|
|
791
|
-
async function
|
|
791
|
+
async function fn({
|
|
792
792
|
chat: e,
|
|
793
793
|
next: t,
|
|
794
794
|
node: r,
|
|
@@ -826,7 +826,7 @@ async function dn({
|
|
|
826
826
|
text: a.type === "phone" ? Qe(a.value) : a.value
|
|
827
827
|
}), t(r.nextId);
|
|
828
828
|
}
|
|
829
|
-
async function
|
|
829
|
+
async function hn({
|
|
830
830
|
chat: e,
|
|
831
831
|
next: t,
|
|
832
832
|
node: r,
|
|
@@ -857,7 +857,7 @@ async function fn({
|
|
|
857
857
|
text: r.data.options.filter((u) => i.value.includes(u.value)).map((u) => u.label).join(", ")
|
|
858
858
|
}), t(r.nextId);
|
|
859
859
|
}
|
|
860
|
-
async function
|
|
860
|
+
async function pn({
|
|
861
861
|
chat: e,
|
|
862
862
|
next: t,
|
|
863
863
|
node: r,
|
|
@@ -894,7 +894,7 @@ async function hn({
|
|
|
894
894
|
text: i.value === !0 ? r.data.trueLabel : r.data.falseLabel
|
|
895
895
|
}), t(r.nextId);
|
|
896
896
|
}
|
|
897
|
-
async function
|
|
897
|
+
async function mn({
|
|
898
898
|
chat: e,
|
|
899
899
|
next: t,
|
|
900
900
|
node: r,
|
|
@@ -930,7 +930,7 @@ async function pn({
|
|
|
930
930
|
}
|
|
931
931
|
return t(r.nextId);
|
|
932
932
|
}
|
|
933
|
-
async function
|
|
933
|
+
async function gn({
|
|
934
934
|
node: e,
|
|
935
935
|
chat: t,
|
|
936
936
|
next: r,
|
|
@@ -973,7 +973,7 @@ async function mn({
|
|
|
973
973
|
});
|
|
974
974
|
r(e.nextId);
|
|
975
975
|
}
|
|
976
|
-
async function
|
|
976
|
+
async function bn({
|
|
977
977
|
chat: e,
|
|
978
978
|
end: t,
|
|
979
979
|
node: r
|
|
@@ -1038,7 +1038,7 @@ function ht(e, t, r) {
|
|
|
1038
1038
|
ht.debounce = ht;
|
|
1039
1039
|
var yn = ht;
|
|
1040
1040
|
const Nt = /* @__PURE__ */ rr(yn);
|
|
1041
|
-
function
|
|
1041
|
+
function vn(e) {
|
|
1042
1042
|
let {
|
|
1043
1043
|
debounce: t,
|
|
1044
1044
|
scroll: r,
|
|
@@ -1069,7 +1069,7 @@ function bn(e) {
|
|
|
1069
1069
|
lastBounds: i
|
|
1070
1070
|
}), p = t ? typeof t == "number" ? t : t.scroll : null, w = t ? typeof t == "number" ? t : t.resize : null, v = re(!1);
|
|
1071
1071
|
le(() => (v.current = !0, () => void (v.current = !1)));
|
|
1072
|
-
const [h, _,
|
|
1072
|
+
const [h, _, y] = mt(() => {
|
|
1073
1073
|
const g = () => {
|
|
1074
1074
|
if (!d.current.element)
|
|
1075
1075
|
return;
|
|
@@ -1092,15 +1092,15 @@ function bn(e) {
|
|
|
1092
1092
|
x: H,
|
|
1093
1093
|
y: se
|
|
1094
1094
|
};
|
|
1095
|
-
d.current.element instanceof HTMLElement && s && (U.height = d.current.element.offsetHeight, U.width = d.current.element.offsetWidth), Object.freeze(U), v.current && !
|
|
1095
|
+
d.current.element instanceof HTMLElement && s && (U.height = d.current.element.offsetHeight, U.width = d.current.element.offsetWidth), Object.freeze(U), v.current && !_n(d.current.lastBounds, U) && u(d.current.lastBounds = U);
|
|
1096
1096
|
};
|
|
1097
1097
|
return [g, w ? Nt(g, w) : g, p ? Nt(g, p) : g];
|
|
1098
1098
|
}, [u, s, p, w]);
|
|
1099
1099
|
function A() {
|
|
1100
|
-
d.current.scrollContainers && (d.current.scrollContainers.forEach((g) => g.removeEventListener("scroll",
|
|
1100
|
+
d.current.scrollContainers && (d.current.scrollContainers.forEach((g) => g.removeEventListener("scroll", y, !0)), d.current.scrollContainers = null), d.current.resizeObserver && (d.current.resizeObserver.disconnect(), d.current.resizeObserver = null);
|
|
1101
1101
|
}
|
|
1102
1102
|
function S() {
|
|
1103
|
-
d.current.element && (d.current.resizeObserver = new a(
|
|
1103
|
+
d.current.element && (d.current.resizeObserver = new a(y), d.current.resizeObserver.observe(d.current.element), r && d.current.scrollContainers && d.current.scrollContainers.forEach((g) => g.addEventListener("scroll", y, {
|
|
1104
1104
|
capture: !0,
|
|
1105
1105
|
passive: !0
|
|
1106
1106
|
})));
|
|
@@ -1108,17 +1108,17 @@ function bn(e) {
|
|
|
1108
1108
|
const E = (g) => {
|
|
1109
1109
|
!g || g === d.current.element || (A(), d.current.element = g, d.current.scrollContainers = lr(g), S());
|
|
1110
1110
|
};
|
|
1111
|
-
return
|
|
1111
|
+
return wn(y, !!r), xn(_), le(() => {
|
|
1112
1112
|
A(), S();
|
|
1113
|
-
}, [r,
|
|
1113
|
+
}, [r, y, _]), le(() => A, []), [E, i, h];
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function xn(e) {
|
|
1116
1116
|
le(() => {
|
|
1117
1117
|
const t = e;
|
|
1118
1118
|
return window.addEventListener("resize", t), () => void window.removeEventListener("resize", t);
|
|
1119
1119
|
}, [e]);
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function wn(e, t) {
|
|
1122
1122
|
le(() => {
|
|
1123
1123
|
if (t) {
|
|
1124
1124
|
const r = e;
|
|
@@ -1140,7 +1140,7 @@ function lr(e) {
|
|
|
1140
1140
|
} = window.getComputedStyle(e);
|
|
1141
1141
|
return [r, n, s].some((a) => a === "auto" || a === "scroll") && t.push(e), [...t, ...lr(e.parentElement)];
|
|
1142
1142
|
}
|
|
1143
|
-
const
|
|
1143
|
+
const kn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], _n = (e, t) => kn.every((r) => e[r] === t[r]), xe = ({
|
|
1144
1144
|
class: e,
|
|
1145
1145
|
...t
|
|
1146
1146
|
}) => {
|
|
@@ -1169,7 +1169,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1169
1169
|
})]
|
|
1170
1170
|
})
|
|
1171
1171
|
});
|
|
1172
|
-
},
|
|
1172
|
+
}, Sn = 25, pt = ft({
|
|
1173
1173
|
instant: () => {
|
|
1174
1174
|
},
|
|
1175
1175
|
smooth: () => {
|
|
@@ -1182,7 +1182,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1182
1182
|
instant: () => pt.value.instant(),
|
|
1183
1183
|
smooth: () => pt.value.smooth()
|
|
1184
1184
|
}
|
|
1185
|
-
},
|
|
1185
|
+
}, Cn = () => {
|
|
1186
1186
|
const e = re(null);
|
|
1187
1187
|
pe(() => {
|
|
1188
1188
|
pt.value = {
|
|
@@ -1215,7 +1215,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1215
1215
|
if (s != null && s.aborted)
|
|
1216
1216
|
throw new Le();
|
|
1217
1217
|
z.isBotTyping$.value = !0;
|
|
1218
|
-
const u = Math.min(Math.max(20, i.text.length), 100) *
|
|
1218
|
+
const u = Math.min(Math.max(20, i.text.length), 100) * Sn;
|
|
1219
1219
|
await new Promise((d) => setTimeout(d, u, {
|
|
1220
1220
|
signal: s
|
|
1221
1221
|
})), z.isBotTyping$.value = !1;
|
|
@@ -1286,7 +1286,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1286
1286
|
} = G();
|
|
1287
1287
|
return l("button", {
|
|
1288
1288
|
type: "button",
|
|
1289
|
-
class: Re("fr text-neutral-
|
|
1289
|
+
class: Re("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),
|
|
1290
1290
|
...t,
|
|
1291
1291
|
children: [l("svg", {
|
|
1292
1292
|
"aria-hidden": !0,
|
|
@@ -1565,15 +1565,15 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1565
1565
|
defaultVariants: {
|
|
1566
1566
|
optional: !1
|
|
1567
1567
|
}
|
|
1568
|
-
}),
|
|
1568
|
+
}), En = "https://api.mapbox.com/search/searchbox/v1/suggest", An = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", Vn = (e) => atob(e).split("").reverse().join(""), ae = he({
|
|
1569
1569
|
name: X()
|
|
1570
|
-
}),
|
|
1571
|
-
suggestions:
|
|
1570
|
+
}), In = he({
|
|
1571
|
+
suggestions: Nr(he({
|
|
1572
1572
|
full_address: it(X()),
|
|
1573
1573
|
place_formatted: it(X()),
|
|
1574
1574
|
name: it(X()),
|
|
1575
1575
|
mapbox_id: X(),
|
|
1576
|
-
context:
|
|
1576
|
+
context: Tr(he({
|
|
1577
1577
|
address: ae,
|
|
1578
1578
|
street: ae,
|
|
1579
1579
|
neighborhood: ae,
|
|
@@ -1585,7 +1585,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1585
1585
|
country: ae
|
|
1586
1586
|
}))
|
|
1587
1587
|
}))
|
|
1588
|
-
}),
|
|
1588
|
+
}), Mn = ({
|
|
1589
1589
|
logger: e,
|
|
1590
1590
|
t
|
|
1591
1591
|
}) => mt(() => {
|
|
@@ -1595,17 +1595,17 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1595
1595
|
enabled: !0,
|
|
1596
1596
|
getPredictions: async (s) => {
|
|
1597
1597
|
var v;
|
|
1598
|
-
const a = new URL(
|
|
1598
|
+
const a = new URL(En);
|
|
1599
1599
|
a.searchParams.set("q", s), a.searchParams.set("session_token", r);
|
|
1600
1600
|
const i = (v = I.current$.peek().flow) == null ? void 0 : v.locationOrigin;
|
|
1601
|
-
i && i.lat !== void 0 && i.lng !== void 0 && i.lat >= -90 && i.lat <= 90 && i.lng >= -180 && i.lng <= 180 && a.searchParams.set("proximity", `${i.lng},${i.lat}`), a.searchParams.set("access_token", An
|
|
1601
|
+
i && i.lat !== void 0 && i.lng !== void 0 && i.lat >= -90 && i.lat <= 90 && i.lng >= -180 && i.lng <= 180 && a.searchParams.set("proximity", `${i.lng},${i.lat}`), a.searchParams.set("access_token", Vn(An));
|
|
1602
1602
|
const d = await fetch(a);
|
|
1603
1603
|
if (!d.ok)
|
|
1604
1604
|
return e.error("Failed to get address details", d), {
|
|
1605
1605
|
ok: !1,
|
|
1606
1606
|
error: t("address_error")
|
|
1607
1607
|
};
|
|
1608
|
-
const p =
|
|
1608
|
+
const p = Lr(In, await d.json());
|
|
1609
1609
|
if (p.success === !1)
|
|
1610
1610
|
return e.error("Failed to parse address details", p.issues), {
|
|
1611
1611
|
ok: !1,
|
|
@@ -1617,12 +1617,12 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1617
1617
|
return {
|
|
1618
1618
|
ok: !0,
|
|
1619
1619
|
data: w.map((h) => {
|
|
1620
|
-
var _,
|
|
1620
|
+
var _, y, A, S, E, g, F, j, D;
|
|
1621
1621
|
return {
|
|
1622
1622
|
label: h.full_address ?? h.place_formatted ?? h.name ?? h.mapbox_id,
|
|
1623
1623
|
id: h.mapbox_id,
|
|
1624
1624
|
address: {
|
|
1625
|
-
line1: ((_ = h.context.address) == null ? void 0 : _.name) ?? ((
|
|
1625
|
+
line1: ((_ = h.context.address) == null ? void 0 : _.name) ?? ((y = h.context.street) == null ? void 0 : y.name),
|
|
1626
1626
|
line2: void 0,
|
|
1627
1627
|
line3: ((A = h.context.neighborhood) == null ? void 0 : A.name) ?? ((S = h.context.locality) == null ? void 0 : S.name),
|
|
1628
1628
|
city: ((E = h.context.place) == null ? void 0 : E.name) ?? ((g = h.context.district) == null ? void 0 : g.name),
|
|
@@ -1660,7 +1660,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1660
1660
|
children: t("back")
|
|
1661
1661
|
})]
|
|
1662
1662
|
});
|
|
1663
|
-
},
|
|
1663
|
+
}, Fn = ({
|
|
1664
1664
|
input: e,
|
|
1665
1665
|
onSubmitSuccess: t,
|
|
1666
1666
|
logger: r
|
|
@@ -1670,10 +1670,10 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1670
1670
|
} = G(), [s, a] = ee(), [i, u] = ee([]), {
|
|
1671
1671
|
enabled: d,
|
|
1672
1672
|
getPredictions: p
|
|
1673
|
-
} =
|
|
1673
|
+
} = Mn({
|
|
1674
1674
|
logger: r,
|
|
1675
1675
|
t: n
|
|
1676
|
-
}), [w, v] = ee(d ? "query" : "manual"), [h, _] = ee(""), [
|
|
1676
|
+
}), [w, v] = ee(d ? "query" : "manual"), [h, _] = ee(""), [y, A] = ee(), S = (E) => {
|
|
1677
1677
|
fe(d, "Query state should not be enabled"), E = E.trim(), E !== (h == null ? void 0 : h.trim()) && (_(E), E === "" && u([]), A(void 0), p(E).then((g) => {
|
|
1678
1678
|
if (g.ok === !1) {
|
|
1679
1679
|
u([]), A(g.error);
|
|
@@ -1684,7 +1684,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1684
1684
|
};
|
|
1685
1685
|
switch (w) {
|
|
1686
1686
|
case "query":
|
|
1687
|
-
return fe(d, "Query state should not be enabled"), l(
|
|
1687
|
+
return fe(d, "Query state should not be enabled"), l(Ln, {
|
|
1688
1688
|
input: e,
|
|
1689
1689
|
onSkip: () => t(null),
|
|
1690
1690
|
onAddressSelect: (E) => {
|
|
@@ -1700,7 +1700,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1700
1700
|
},
|
|
1701
1701
|
suggestions: i,
|
|
1702
1702
|
query: h,
|
|
1703
|
-
error:
|
|
1703
|
+
error: y
|
|
1704
1704
|
});
|
|
1705
1705
|
case "details":
|
|
1706
1706
|
return fe(s !== void 0), l(Rt, {
|
|
@@ -1727,7 +1727,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1727
1727
|
}) : void 0
|
|
1728
1728
|
});
|
|
1729
1729
|
}
|
|
1730
|
-
},
|
|
1730
|
+
}, Ln = ({
|
|
1731
1731
|
input: e,
|
|
1732
1732
|
onSkip: t,
|
|
1733
1733
|
suggestions: r,
|
|
@@ -1749,7 +1749,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1749
1749
|
const v = new FormData(p.currentTarget).get("address");
|
|
1750
1750
|
typeof v == "string" && a(v);
|
|
1751
1751
|
},
|
|
1752
|
-
class: "flex gap-
|
|
1752
|
+
class: "flex gap-2 p-2.5",
|
|
1753
1753
|
children: [l("div", {
|
|
1754
1754
|
class: "group relative flex-1",
|
|
1755
1755
|
children: [l("input", {
|
|
@@ -1793,7 +1793,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1793
1793
|
})
|
|
1794
1794
|
})]
|
|
1795
1795
|
}), e.config.optional && l(we, {
|
|
1796
|
-
class: "",
|
|
1796
|
+
class: "relative",
|
|
1797
1797
|
onClick: t
|
|
1798
1798
|
})]
|
|
1799
1799
|
}), i ? l(Ee, {
|
|
@@ -1933,34 +1933,34 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1933
1933
|
})]
|
|
1934
1934
|
})]
|
|
1935
1935
|
});
|
|
1936
|
-
},
|
|
1936
|
+
}, bt = () => {
|
|
1937
1937
|
const e = re(null);
|
|
1938
1938
|
return le(() => {
|
|
1939
1939
|
var t;
|
|
1940
1940
|
(t = e.current) == null || t.focus();
|
|
1941
1941
|
}, []), e;
|
|
1942
|
-
}, ur = ["true", "false"],
|
|
1942
|
+
}, ur = ["true", "false"], Nn = Rr(ur), Tn = "answer", cr = "flex items-center flex-wrap gap-2 p-2.5", dr = "min-w-0 max-w-full flex-auto", fr = nr(({
|
|
1943
1943
|
label: e,
|
|
1944
1944
|
...t
|
|
1945
1945
|
}, r) => l("button", {
|
|
1946
|
-
class: "bg-lowest ease-expo-out ring-divider text-neutral-12 active:ring-accent-7 active:bg-accent-2 active:text-accent-11 fr block w-full overflow-hidden rounded-2xl px-2
|
|
1946
|
+
class: "bg-lowest ease-expo-out ring-divider text-neutral-12 active:ring-accent-7 active:bg-accent-2 active:text-accent-11 fr block w-full overflow-hidden rounded-2xl px-2 py-2.5 ring-2 transition-all selection:bg-transparent",
|
|
1947
1947
|
...t,
|
|
1948
1948
|
ref: r,
|
|
1949
1949
|
children: l("p", {
|
|
1950
|
-
class: "
|
|
1950
|
+
class: "text-center text-base",
|
|
1951
1951
|
children: e
|
|
1952
1952
|
})
|
|
1953
|
-
})),
|
|
1953
|
+
})), Dn = ({
|
|
1954
1954
|
input: e,
|
|
1955
1955
|
onSubmitSuccess: t
|
|
1956
1956
|
}) => {
|
|
1957
|
-
const r =
|
|
1957
|
+
const r = bt();
|
|
1958
1958
|
return l("form", {
|
|
1959
1959
|
noValidate: !0,
|
|
1960
1960
|
class: "",
|
|
1961
1961
|
onSubmit: (n) => {
|
|
1962
1962
|
n.preventDefault();
|
|
1963
|
-
const s =
|
|
1963
|
+
const s = Dr(n).value, a = sr(Nn, s);
|
|
1964
1964
|
t({
|
|
1965
1965
|
type: "boolean",
|
|
1966
1966
|
value: a === "true"
|
|
@@ -1969,11 +1969,11 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1969
1969
|
children: [l("ul", {
|
|
1970
1970
|
class: cr,
|
|
1971
1971
|
children: ur.map((n, s) => l("li", {
|
|
1972
|
-
class:
|
|
1973
|
-
children: l(
|
|
1972
|
+
class: dr,
|
|
1973
|
+
children: l(fr, {
|
|
1974
1974
|
ref: s === 0 ? r : null,
|
|
1975
1975
|
type: "submit",
|
|
1976
|
-
name:
|
|
1976
|
+
name: Tn,
|
|
1977
1977
|
value: n,
|
|
1978
1978
|
label: e.config.labels[n]
|
|
1979
1979
|
}, n)
|
|
@@ -1981,16 +1981,16 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
1981
1981
|
}), e.config.optional && l("div", {
|
|
1982
1982
|
class: "px-2 pb-2",
|
|
1983
1983
|
children: l(we, {
|
|
1984
|
-
class: "w-full",
|
|
1984
|
+
class: "relative w-full",
|
|
1985
1985
|
type: "button",
|
|
1986
1986
|
onClick: () => t(null)
|
|
1987
1987
|
})
|
|
1988
1988
|
})]
|
|
1989
1989
|
});
|
|
1990
|
-
},
|
|
1990
|
+
}, Rn = (e) => new Promise((t, r) => {
|
|
1991
1991
|
const n = new FileReader();
|
|
1992
1992
|
n.readAsDataURL(e), n.onload = () => n.result ? t(n.result.toString()) : r("No result from reader"), n.onerror = r;
|
|
1993
|
-
}),
|
|
1993
|
+
}), On = (e) => e.reduce((t, r) => t + r.sizeKb, 0), Bn = Ce("file"), Ot = 3, Pn = ({
|
|
1994
1994
|
file: e,
|
|
1995
1995
|
class: t,
|
|
1996
1996
|
...r
|
|
@@ -2020,26 +2020,26 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
2020
2020
|
}) => l("li", {
|
|
2021
2021
|
class: Re("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
|
|
2022
2022
|
...t
|
|
2023
|
-
}),
|
|
2023
|
+
}), hr = (e) => {
|
|
2024
2024
|
const t = e.split(".").pop();
|
|
2025
2025
|
if (!t)
|
|
2026
2026
|
throw new Error("No file extension found");
|
|
2027
2027
|
return t ? "." + t : "";
|
|
2028
|
-
},
|
|
2028
|
+
}, $n = ({
|
|
2029
2029
|
allowedExtensions: e,
|
|
2030
2030
|
files: t
|
|
2031
2031
|
}) => {
|
|
2032
2032
|
const r = e.map((n) => n.toLowerCase());
|
|
2033
|
-
return t.every((n) => r.includes(
|
|
2034
|
-
},
|
|
2035
|
-
const r =
|
|
2033
|
+
return t.every((n) => r.includes(hr(n.name).toLowerCase()));
|
|
2034
|
+
}, jn = (e, t) => {
|
|
2035
|
+
const r = hr(e);
|
|
2036
2036
|
return `${e.replace(new RegExp(`${r}$`), "").slice(0, t)}${r}`;
|
|
2037
|
-
},
|
|
2037
|
+
}, zn = ({
|
|
2038
2038
|
input: e,
|
|
2039
2039
|
onSubmitSuccess: t
|
|
2040
2040
|
}) => {
|
|
2041
2041
|
var v;
|
|
2042
|
-
const r = (v = I.current$.value.flow) == null ? void 0 : v.data.submissions[e.key], [n, s] = ee(
|
|
2042
|
+
const r = (v = I.current$.value.flow) == null ? void 0 : v.data.submissions[e.key], [n, s] = ee(Bn(r) ? r.value : []), [a, i] = ee(), u = n.length - Ot, d = On(n), p = bt(), {
|
|
2043
2043
|
t: w
|
|
2044
2044
|
} = G();
|
|
2045
2045
|
return l("form", {
|
|
@@ -2047,7 +2047,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
2047
2047
|
onSubmit: (h) => (h.preventDefault(), i(void 0), n.length === 0 ? i({
|
|
2048
2048
|
type: "required",
|
|
2049
2049
|
message: w("validation_file")
|
|
2050
|
-
}) : e.config.extensions.length > 0 &&
|
|
2050
|
+
}) : e.config.extensions.length > 0 && !$n({
|
|
2051
2051
|
allowedExtensions: e.config.extensions,
|
|
2052
2052
|
files: n
|
|
2053
2053
|
}) ? i({
|
|
@@ -2077,12 +2077,12 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
2077
2077
|
children: [l("ul", {
|
|
2078
2078
|
class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
|
|
2079
2079
|
children: [n.slice(0, Ot).map((h) => {
|
|
2080
|
-
const _ = h.name.split(".").pop(),
|
|
2080
|
+
const _ = h.name.split(".").pop(), y = h.name.replace(new RegExp(`.${_}$`), "");
|
|
2081
2081
|
return l(Bt, {
|
|
2082
2082
|
class: "flex overflow-hidden",
|
|
2083
2083
|
children: [l("span", {
|
|
2084
2084
|
class: "block truncate",
|
|
2085
|
-
children:
|
|
2085
|
+
children: y
|
|
2086
2086
|
}), l("span", {
|
|
2087
2087
|
children: [".", _]
|
|
2088
2088
|
})]
|
|
@@ -2141,22 +2141,22 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
2141
2141
|
id: "dropzone-file",
|
|
2142
2142
|
onInput: async (h) => {
|
|
2143
2143
|
fe(h.target instanceof HTMLInputElement);
|
|
2144
|
-
const _ = h.target.files ? Array.from(h.target.files) : [],
|
|
2145
|
-
const E = await
|
|
2144
|
+
const _ = h.target.files ? Array.from(h.target.files) : [], y = await Promise.allSettled(_.map(async (S) => {
|
|
2145
|
+
const E = await Rn(S);
|
|
2146
2146
|
return {
|
|
2147
|
-
name:
|
|
2147
|
+
name: jn(S.name, 42),
|
|
2148
2148
|
data: E,
|
|
2149
2149
|
sizeKb: S.size / 1e3
|
|
2150
2150
|
};
|
|
2151
2151
|
}));
|
|
2152
|
-
if (
|
|
2152
|
+
if (y.some(({
|
|
2153
2153
|
status: S
|
|
2154
2154
|
}) => S === "rejected"))
|
|
2155
2155
|
return i({
|
|
2156
2156
|
type: "invalid",
|
|
2157
2157
|
message: "Invalid file"
|
|
2158
2158
|
});
|
|
2159
|
-
const A =
|
|
2159
|
+
const A = y.map((S) => S.status === "fulfilled" ? S.value : null).filter(Boolean);
|
|
2160
2160
|
s(A);
|
|
2161
2161
|
},
|
|
2162
2162
|
multiple: e.config.allowMultiple,
|
|
@@ -2168,6 +2168,7 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
2168
2168
|
children: [l(xe, {
|
|
2169
2169
|
disabled: n.length === 0
|
|
2170
2170
|
}), e.config.optional && l(we, {
|
|
2171
|
+
class: "relative",
|
|
2171
2172
|
onClick: () => t(null)
|
|
2172
2173
|
})]
|
|
2173
2174
|
})]
|
|
@@ -2177,11 +2178,11 @@ const wn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], kn =
|
|
|
2177
2178
|
});
|
|
2178
2179
|
};
|
|
2179
2180
|
var Be = (e) => e.type === "checkbox", Se = (e) => e instanceof Date, q = (e) => e == null;
|
|
2180
|
-
const
|
|
2181
|
-
var P = (e) => !q(e) && !Array.isArray(e) &&
|
|
2181
|
+
const pr = (e) => typeof e == "object";
|
|
2182
|
+
var P = (e) => !q(e) && !Array.isArray(e) && pr(e) && !Se(e), Un = (e) => P(e) && e.target ? Be(e.target) ? e.target.checked : e.target.value : e, qn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Kn = (e, t) => e.has(qn(t)), Gn = (e) => {
|
|
2182
2183
|
const t = e.constructor && e.constructor.prototype;
|
|
2183
2184
|
return P(t) && t.hasOwnProperty("isPrototypeOf");
|
|
2184
|
-
},
|
|
2185
|
+
}, yt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
2185
2186
|
function oe(e) {
|
|
2186
2187
|
let t;
|
|
2187
2188
|
const r = Array.isArray(e);
|
|
@@ -2189,8 +2190,8 @@ function oe(e) {
|
|
|
2189
2190
|
t = new Date(e);
|
|
2190
2191
|
else if (e instanceof Set)
|
|
2191
2192
|
t = new Set(e);
|
|
2192
|
-
else if (!(
|
|
2193
|
-
if (t = r ? [] : {}, !r && !
|
|
2193
|
+
else if (!(yt && (e instanceof Blob || e instanceof FileList)) && (r || P(e)))
|
|
2194
|
+
if (t = r ? [] : {}, !r && !Gn(e))
|
|
2194
2195
|
t = e;
|
|
2195
2196
|
else
|
|
2196
2197
|
for (const n in e)
|
|
@@ -2225,7 +2226,7 @@ const Pt = {
|
|
|
2225
2226
|
validate: "validate"
|
|
2226
2227
|
};
|
|
2227
2228
|
Y.createContext(null);
|
|
2228
|
-
var
|
|
2229
|
+
var Hn = (e, t, r, n = !0) => {
|
|
2229
2230
|
const s = {
|
|
2230
2231
|
defaultValues: t._defaultValues
|
|
2231
2232
|
};
|
|
@@ -2237,12 +2238,12 @@ var Gn = (e, t, r, n = !0) => {
|
|
|
2237
2238
|
}
|
|
2238
2239
|
});
|
|
2239
2240
|
return s;
|
|
2240
|
-
}, J = (e) => P(e) && !Object.keys(e).length,
|
|
2241
|
+
}, J = (e) => P(e) && !Object.keys(e).length, Wn = (e, t, r, n) => {
|
|
2241
2242
|
r(e);
|
|
2242
2243
|
const { name: s, ...a } = e;
|
|
2243
2244
|
return J(a) || Object.keys(a).length >= Object.keys(t).length || Object.keys(a).find((i) => t[i] === (!n || Z.all));
|
|
2244
2245
|
}, ot = (e) => Array.isArray(e) ? e : [e];
|
|
2245
|
-
function
|
|
2246
|
+
function Jn(e) {
|
|
2246
2247
|
const t = Y.useRef(e);
|
|
2247
2248
|
t.current = e, Y.useEffect(() => {
|
|
2248
2249
|
const r = !e.disabled && t.current.subject && t.current.subject.subscribe({
|
|
@@ -2253,10 +2254,10 @@ function Wn(e) {
|
|
|
2253
2254
|
};
|
|
2254
2255
|
}, [e.disabled]);
|
|
2255
2256
|
}
|
|
2256
|
-
var te = (e) => typeof e == "string",
|
|
2257
|
+
var te = (e) => typeof e == "string", Zn = (e, t, r, n, s) => te(e) ? (n && t.watch.add(e), x(r, e, s)) : Array.isArray(e) ? e.map((a) => (n && t.watch.add(a), x(r, a))) : (n && (t.watchAll = !0), r), vt = (e) => /^\w*$/.test(e), mr = (e) => Pe(e.replace(/["|']|\]/g, "").split(/\.|\[/));
|
|
2257
2258
|
function L(e, t, r) {
|
|
2258
2259
|
let n = -1;
|
|
2259
|
-
const s = vt(t) ? [t] :
|
|
2260
|
+
const s = vt(t) ? [t] : mr(t), a = s.length, i = a - 1;
|
|
2260
2261
|
for (; ++n < a; ) {
|
|
2261
2262
|
const u = s[n];
|
|
2262
2263
|
let d = r;
|
|
@@ -2268,7 +2269,7 @@ function L(e, t, r) {
|
|
|
2268
2269
|
}
|
|
2269
2270
|
return e;
|
|
2270
2271
|
}
|
|
2271
|
-
var
|
|
2272
|
+
var gr = (e, t, r, n, s) => t ? {
|
|
2272
2273
|
...r[e],
|
|
2273
2274
|
types: {
|
|
2274
2275
|
...r[e] && r[e].types ? r[e].types : {},
|
|
@@ -2296,11 +2297,11 @@ const Ue = (e, t, r, n) => {
|
|
|
2296
2297
|
}
|
|
2297
2298
|
}
|
|
2298
2299
|
};
|
|
2299
|
-
var
|
|
2300
|
+
var Xn = (e, t, r) => {
|
|
2300
2301
|
const n = Pe(x(e, r));
|
|
2301
2302
|
return L(n, "root", t[r]), L(e, r, n), e;
|
|
2302
2303
|
}, xt = (e) => e.type === "file", de = (e) => typeof e == "function", He = (e) => {
|
|
2303
|
-
if (!
|
|
2304
|
+
if (!yt)
|
|
2304
2305
|
return !1;
|
|
2305
2306
|
const t = e ? e.ownerDocument : 0;
|
|
2306
2307
|
return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
|
|
@@ -2309,7 +2310,7 @@ const zt = {
|
|
|
2309
2310
|
value: !1,
|
|
2310
2311
|
isValid: !1
|
|
2311
2312
|
}, Ut = { value: !0, isValid: !0 };
|
|
2312
|
-
var
|
|
2313
|
+
var br = (e) => {
|
|
2313
2314
|
if (Array.isArray(e)) {
|
|
2314
2315
|
if (e.length > 1) {
|
|
2315
2316
|
const t = e.filter((r) => r && r.checked && !r.disabled).map((r) => r.value);
|
|
@@ -2342,23 +2343,23 @@ var _e = (e) => P(e) && !We(e) ? e : {
|
|
|
2342
2343
|
value: e,
|
|
2343
2344
|
message: ""
|
|
2344
2345
|
}, Gt = async (e, t, r, n, s) => {
|
|
2345
|
-
const { ref: a, refs: i, required: u, maxLength: d, minLength: p, min: w, max: v, pattern: h, validate: _, name:
|
|
2346
|
+
const { ref: a, refs: i, required: u, maxLength: d, minLength: p, min: w, max: v, pattern: h, validate: _, name: y, valueAsNumber: A, mount: S, disabled: E } = e._f, g = x(t, y);
|
|
2346
2347
|
if (!S || E)
|
|
2347
2348
|
return {};
|
|
2348
2349
|
const F = i ? i[0] : a, j = (M) => {
|
|
2349
2350
|
n && F.reportValidity && (F.setCustomValidity(ce(M) ? "" : M || ""), F.reportValidity());
|
|
2350
|
-
}, D = {}, me = wt(a), ue = Be(a), Ae = me || ue, H = (A || xt(a)) && O(a.value) && O(g) || He(a) && a.value === "" || g === "" || Array.isArray(g) && !g.length, se =
|
|
2351
|
+
}, D = {}, me = wt(a), ue = Be(a), Ae = me || ue, H = (A || xt(a)) && O(a.value) && O(g) || He(a) && a.value === "" || g === "" || Array.isArray(g) && !g.length, se = gr.bind(null, y, r, D), U = (M, V, R, K = ie.maxLength, W = ie.minLength) => {
|
|
2351
2352
|
const Q = M ? V : R;
|
|
2352
|
-
D[
|
|
2353
|
+
D[y] = {
|
|
2353
2354
|
type: M ? K : W,
|
|
2354
2355
|
message: Q,
|
|
2355
2356
|
ref: a,
|
|
2356
2357
|
...se(M ? K : W, Q)
|
|
2357
2358
|
};
|
|
2358
2359
|
};
|
|
2359
|
-
if (s ? !Array.isArray(g) || !g.length : u && (!Ae && (H || q(g)) || ce(g) && !g || ue && !
|
|
2360
|
+
if (s ? !Array.isArray(g) || !g.length : u && (!Ae && (H || q(g)) || ce(g) && !g || ue && !br(i).isValid || me && !yr(i).isValid)) {
|
|
2360
2361
|
const { value: M, message: V } = qe(u) ? { value: !!u, message: u } : _e(u);
|
|
2361
|
-
if (M && (D[
|
|
2362
|
+
if (M && (D[y] = {
|
|
2362
2363
|
type: ie.required,
|
|
2363
2364
|
message: V,
|
|
2364
2365
|
ref: F,
|
|
@@ -2377,16 +2378,16 @@ var _e = (e) => P(e) && !We(e) ? e : {
|
|
|
2377
2378
|
te(R.value) && g && (M = ge ? Q(g) > Q(R.value) : Ve ? g > R.value : W > new Date(R.value)), te(K.value) && g && (V = ge ? Q(g) < Q(K.value) : Ve ? g < K.value : W < new Date(K.value));
|
|
2378
2379
|
}
|
|
2379
2380
|
if ((M || V) && (U(!!M, R.message, K.message, ie.max, ie.min), !r))
|
|
2380
|
-
return j(D[
|
|
2381
|
+
return j(D[y].message), D;
|
|
2381
2382
|
}
|
|
2382
2383
|
if ((d || p) && !H && (te(g) || s && Array.isArray(g))) {
|
|
2383
2384
|
const M = _e(d), V = _e(p), R = !q(M.value) && g.length > +M.value, K = !q(V.value) && g.length < +V.value;
|
|
2384
2385
|
if ((R || K) && (U(R, M.message, V.message), !r))
|
|
2385
|
-
return j(D[
|
|
2386
|
+
return j(D[y].message), D;
|
|
2386
2387
|
}
|
|
2387
2388
|
if (h && !H && te(g)) {
|
|
2388
2389
|
const { value: M, message: V } = _e(h);
|
|
2389
|
-
if (We(M) && !g.match(M) && (D[
|
|
2390
|
+
if (We(M) && !g.match(M) && (D[y] = {
|
|
2390
2391
|
type: ie.pattern,
|
|
2391
2392
|
message: V,
|
|
2392
2393
|
ref: a,
|
|
@@ -2397,7 +2398,7 @@ var _e = (e) => P(e) && !We(e) ? e : {
|
|
|
2397
2398
|
if (_) {
|
|
2398
2399
|
if (de(_)) {
|
|
2399
2400
|
const M = await _(g, t), V = Kt(M, F);
|
|
2400
|
-
if (V && (D[
|
|
2401
|
+
if (V && (D[y] = {
|
|
2401
2402
|
...V,
|
|
2402
2403
|
...se(ie.validate, V.message)
|
|
2403
2404
|
}, !r))
|
|
@@ -2411,9 +2412,9 @@ var _e = (e) => P(e) && !We(e) ? e : {
|
|
|
2411
2412
|
R && (M = {
|
|
2412
2413
|
...R,
|
|
2413
2414
|
...se(V, R.message)
|
|
2414
|
-
}, j(R.message), r && (D[
|
|
2415
|
+
}, j(R.message), r && (D[y] = M));
|
|
2415
2416
|
}
|
|
2416
|
-
if (!J(M) && (D[
|
|
2417
|
+
if (!J(M) && (D[y] = {
|
|
2417
2418
|
ref: F,
|
|
2418
2419
|
...M
|
|
2419
2420
|
}, !r))
|
|
@@ -2422,22 +2423,22 @@ var _e = (e) => P(e) && !We(e) ? e : {
|
|
|
2422
2423
|
}
|
|
2423
2424
|
return j(!0), D;
|
|
2424
2425
|
};
|
|
2425
|
-
function
|
|
2426
|
+
function Qn(e, t) {
|
|
2426
2427
|
const r = t.slice(0, -1).length;
|
|
2427
2428
|
let n = 0;
|
|
2428
2429
|
for (; n < r; )
|
|
2429
2430
|
e = O(e) ? n++ : e[t[n++]];
|
|
2430
2431
|
return e;
|
|
2431
2432
|
}
|
|
2432
|
-
function
|
|
2433
|
+
function Yn(e) {
|
|
2433
2434
|
for (const t in e)
|
|
2434
2435
|
if (e.hasOwnProperty(t) && !O(e[t]))
|
|
2435
2436
|
return !1;
|
|
2436
2437
|
return !0;
|
|
2437
2438
|
}
|
|
2438
2439
|
function $(e, t) {
|
|
2439
|
-
const r = Array.isArray(t) ? t : vt(t) ? [t] :
|
|
2440
|
-
return n && delete n[a], s !== 0 && (P(n) && J(n) || Array.isArray(n) &&
|
|
2440
|
+
const r = Array.isArray(t) ? t : vt(t) ? [t] : mr(t), n = r.length === 1 ? e : Qn(e, r), s = r.length - 1, a = r[s];
|
|
2441
|
+
return n && delete n[a], s !== 0 && (P(n) && J(n) || Array.isArray(n) && Yn(n)) && $(e, r.slice(0, -1)), e;
|
|
2441
2442
|
}
|
|
2442
2443
|
function lt() {
|
|
2443
2444
|
let e = [];
|
|
@@ -2459,8 +2460,8 @@ function lt() {
|
|
|
2459
2460
|
}
|
|
2460
2461
|
};
|
|
2461
2462
|
}
|
|
2462
|
-
var Je = (e) => q(e) || !
|
|
2463
|
-
function
|
|
2463
|
+
var Je = (e) => q(e) || !pr(e);
|
|
2464
|
+
function be(e, t) {
|
|
2464
2465
|
if (Je(e) || Je(t))
|
|
2465
2466
|
return e === t;
|
|
2466
2467
|
if (Se(e) && Se(t))
|
|
@@ -2474,13 +2475,13 @@ function ye(e, t) {
|
|
|
2474
2475
|
return !1;
|
|
2475
2476
|
if (s !== "ref") {
|
|
2476
2477
|
const i = t[s];
|
|
2477
|
-
if (Se(a) && Se(i) || P(a) && P(i) || Array.isArray(a) && Array.isArray(i) ? !
|
|
2478
|
+
if (Se(a) && Se(i) || P(a) && P(i) || Array.isArray(a) && Array.isArray(i) ? !be(a, i) : a !== i)
|
|
2478
2479
|
return !1;
|
|
2479
2480
|
}
|
|
2480
2481
|
}
|
|
2481
2482
|
return !0;
|
|
2482
2483
|
}
|
|
2483
|
-
var
|
|
2484
|
+
var vr = (e) => e.type === "select-multiple", es = (e) => wt(e) || Be(e), ut = (e) => He(e) && e.isConnected, xr = (e) => {
|
|
2484
2485
|
for (const t in e)
|
|
2485
2486
|
if (de(e[t]))
|
|
2486
2487
|
return !0;
|
|
@@ -2490,23 +2491,23 @@ function Ze(e, t = {}) {
|
|
|
2490
2491
|
const r = Array.isArray(e);
|
|
2491
2492
|
if (P(e) || r)
|
|
2492
2493
|
for (const n in e)
|
|
2493
|
-
Array.isArray(e[n]) || P(e[n]) && !
|
|
2494
|
+
Array.isArray(e[n]) || P(e[n]) && !xr(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, Ze(e[n], t[n])) : q(e[n]) || (t[n] = !0);
|
|
2494
2495
|
return t;
|
|
2495
2496
|
}
|
|
2496
|
-
function
|
|
2497
|
+
function wr(e, t, r) {
|
|
2497
2498
|
const n = Array.isArray(e);
|
|
2498
2499
|
if (P(e) || n)
|
|
2499
2500
|
for (const s in e)
|
|
2500
|
-
Array.isArray(e[s]) || P(e[s]) && !
|
|
2501
|
+
Array.isArray(e[s]) || P(e[s]) && !xr(e[s]) ? O(t) || Je(r[s]) ? r[s] = Array.isArray(e[s]) ? Ze(e[s], []) : { ...Ze(e[s]) } : wr(e[s], q(t) ? {} : t[s], r[s]) : r[s] = !be(e[s], t[s]);
|
|
2501
2502
|
return r;
|
|
2502
2503
|
}
|
|
2503
|
-
var ct = (e, t) =>
|
|
2504
|
+
var ct = (e, t) => wr(e, t, Ze(t)), kr = (e, { valueAsNumber: t, valueAsDate: r, setValueAs: n }) => O(e) ? e : t ? e === "" ? NaN : e && +e : r && te(e) ? new Date(e) : n ? n(e) : e;
|
|
2504
2505
|
function dt(e) {
|
|
2505
2506
|
const t = e.ref;
|
|
2506
2507
|
if (!(e.refs ? e.refs.every((r) => r.disabled) : t.disabled))
|
|
2507
|
-
return xt(t) ? t.files : wt(t) ? yr(e.refs).value :
|
|
2508
|
+
return xt(t) ? t.files : wt(t) ? yr(e.refs).value : vr(t) ? [...t.selectedOptions].map(({ value: r }) => r) : Be(t) ? br(e.refs).value : kr(O(t.value) ? e.ref.value : t.value, e);
|
|
2508
2509
|
}
|
|
2509
|
-
var
|
|
2510
|
+
var ts = (e, t, r, n) => {
|
|
2510
2511
|
const s = {};
|
|
2511
2512
|
for (const a of e) {
|
|
2512
2513
|
const i = x(t, a);
|
|
@@ -2518,7 +2519,7 @@ var es = (e, t, r, n) => {
|
|
|
2518
2519
|
fields: s,
|
|
2519
2520
|
shouldUseNativeValidation: n
|
|
2520
2521
|
};
|
|
2521
|
-
}, Me = (e) => O(e) ? e : We(e) ? e.source : P(e) ? We(e.value) ? e.value.source : e.value : e,
|
|
2522
|
+
}, Me = (e) => O(e) ? e : We(e) ? e.source : P(e) ? We(e.value) ? e.value.source : e.value : e, rs = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
|
|
2522
2523
|
function Ht(e, t, r) {
|
|
2523
2524
|
const n = x(e, r);
|
|
2524
2525
|
if (n || vt(r))
|
|
@@ -2542,15 +2543,15 @@ function Ht(e, t, r) {
|
|
|
2542
2543
|
name: r
|
|
2543
2544
|
};
|
|
2544
2545
|
}
|
|
2545
|
-
var
|
|
2546
|
-
const
|
|
2546
|
+
var ns = (e, t, r, n, s) => s.isOnAll ? !1 : !r && s.isOnTouch ? !(t || e) : (r ? n.isOnBlur : s.isOnBlur) ? !e : (r ? n.isOnChange : s.isOnChange) ? e : !0, ss = (e, t) => !Pe(x(e, t)).length && $(e, t);
|
|
2547
|
+
const as = {
|
|
2547
2548
|
mode: Z.onSubmit,
|
|
2548
2549
|
reValidateMode: Z.onChange,
|
|
2549
2550
|
shouldFocusError: !0
|
|
2550
2551
|
};
|
|
2551
|
-
function
|
|
2552
|
+
function is(e = {}, t) {
|
|
2552
2553
|
let r = {
|
|
2553
|
-
...
|
|
2554
|
+
...as,
|
|
2554
2555
|
...e
|
|
2555
2556
|
}, n = {
|
|
2556
2557
|
submitCount: 0,
|
|
@@ -2586,7 +2587,7 @@ function as(e = {}, t) {
|
|
|
2586
2587
|
values: lt(),
|
|
2587
2588
|
array: lt(),
|
|
2588
2589
|
state: lt()
|
|
2589
|
-
}, _ = e.resetOptions && e.resetOptions.keepDirtyValues,
|
|
2590
|
+
}, _ = e.resetOptions && e.resetOptions.keepDirtyValues, y = $t(r.mode), A = $t(r.reValidateMode), S = r.criteriaMode === Z.all, E = (o) => (c) => {
|
|
2590
2591
|
clearTimeout(w), w = setTimeout(o, c);
|
|
2591
2592
|
}, g = async (o) => {
|
|
2592
2593
|
if (v.isValid || o) {
|
|
@@ -2597,19 +2598,19 @@ function as(e = {}, t) {
|
|
|
2597
2598
|
}
|
|
2598
2599
|
}, F = (o) => v.isValidating && h.state.next({
|
|
2599
2600
|
isValidating: o
|
|
2600
|
-
}), j = (o, c = [], f, k,
|
|
2601
|
+
}), j = (o, c = [], f, k, b = !0, m = !0) => {
|
|
2601
2602
|
if (k && f) {
|
|
2602
2603
|
if (u.action = !0, m && Array.isArray(x(s, o))) {
|
|
2603
2604
|
const C = f(x(s, o), k.argA, k.argB);
|
|
2604
|
-
|
|
2605
|
+
b && L(s, o, C);
|
|
2605
2606
|
}
|
|
2606
2607
|
if (m && Array.isArray(x(n.errors, o))) {
|
|
2607
2608
|
const C = f(x(n.errors, o), k.argA, k.argB);
|
|
2608
|
-
|
|
2609
|
+
b && L(n.errors, o, C), ss(n.errors, o);
|
|
2609
2610
|
}
|
|
2610
2611
|
if (v.touchedFields && m && Array.isArray(x(n.touchedFields, o))) {
|
|
2611
2612
|
const C = f(x(n.touchedFields, o), k.argA, k.argB);
|
|
2612
|
-
|
|
2613
|
+
b && L(n.touchedFields, o, C);
|
|
2613
2614
|
}
|
|
2614
2615
|
v.dirtyFields && (n.dirtyFields = ct(a, i)), h.state.next({
|
|
2615
2616
|
name: o,
|
|
@@ -2625,29 +2626,29 @@ function as(e = {}, t) {
|
|
|
2625
2626
|
errors: n.errors
|
|
2626
2627
|
});
|
|
2627
2628
|
}, me = (o, c, f, k) => {
|
|
2628
|
-
const
|
|
2629
|
-
if (
|
|
2629
|
+
const b = x(s, o);
|
|
2630
|
+
if (b) {
|
|
2630
2631
|
const m = x(i, o, O(f) ? x(a, o) : f);
|
|
2631
|
-
O(m) || k && k.defaultChecked || c ? L(i, o, c ? m : dt(
|
|
2632
|
+
O(m) || k && k.defaultChecked || c ? L(i, o, c ? m : dt(b._f)) : W(o, m), u.mount && g();
|
|
2632
2633
|
}
|
|
2633
|
-
}, ue = (o, c, f, k,
|
|
2634
|
+
}, ue = (o, c, f, k, b) => {
|
|
2634
2635
|
let m = !1, C = !1;
|
|
2635
2636
|
const N = {
|
|
2636
2637
|
name: o
|
|
2637
2638
|
};
|
|
2638
2639
|
if (!f || k) {
|
|
2639
2640
|
v.isDirty && (C = n.isDirty, n.isDirty = N.isDirty = V(), m = C !== N.isDirty);
|
|
2640
|
-
const B =
|
|
2641
|
+
const B = be(x(a, o), c);
|
|
2641
2642
|
C = x(n.dirtyFields, o), B ? $(n.dirtyFields, o) : L(n.dirtyFields, o, !0), N.dirtyFields = n.dirtyFields, m = m || v.dirtyFields && C !== !B;
|
|
2642
2643
|
}
|
|
2643
2644
|
if (f) {
|
|
2644
2645
|
const B = x(n.touchedFields, o);
|
|
2645
2646
|
B || (L(n.touchedFields, o, f), N.touchedFields = n.touchedFields, m = m || v.touchedFields && B !== f);
|
|
2646
2647
|
}
|
|
2647
|
-
return m &&
|
|
2648
|
+
return m && b && h.state.next(N), m ? N : {};
|
|
2648
2649
|
}, Ae = (o, c, f, k) => {
|
|
2649
|
-
const
|
|
2650
|
-
if (e.delayError && f ? (p = E(() => D(o, f)), p(e.delayError)) : (clearTimeout(w), p = null, f ? L(n.errors, o, f) : $(n.errors, o)), (f ? !
|
|
2650
|
+
const b = x(n.errors, o), m = v.isValid && ce(c) && n.isValid !== c;
|
|
2651
|
+
if (e.delayError && f ? (p = E(() => D(o, f)), p(e.delayError)) : (clearTimeout(w), p = null, f ? L(n.errors, o, f) : $(n.errors, o)), (f ? !be(b, f) : b) || !J(k) || m) {
|
|
2651
2652
|
const C = {
|
|
2652
2653
|
...k,
|
|
2653
2654
|
...m && ce(c) ? { isValid: c } : {},
|
|
@@ -2660,7 +2661,7 @@ function as(e = {}, t) {
|
|
|
2660
2661
|
}, h.state.next(C);
|
|
2661
2662
|
}
|
|
2662
2663
|
F(!1);
|
|
2663
|
-
}, H = async (o) => r.resolver(i, r.context,
|
|
2664
|
+
}, H = async (o) => r.resolver(i, r.context, ts(o || d.mount, s, r.criteriaMode, r.shouldUseNativeValidation)), se = async (o) => {
|
|
2664
2665
|
const { errors: c } = await H(o);
|
|
2665
2666
|
if (o)
|
|
2666
2667
|
for (const f of o) {
|
|
@@ -2674,14 +2675,14 @@ function as(e = {}, t) {
|
|
|
2674
2675
|
valid: !0
|
|
2675
2676
|
}) => {
|
|
2676
2677
|
for (const k in o) {
|
|
2677
|
-
const
|
|
2678
|
-
if (
|
|
2679
|
-
const { _f: m, ...C } =
|
|
2678
|
+
const b = o[k];
|
|
2679
|
+
if (b) {
|
|
2680
|
+
const { _f: m, ...C } = b;
|
|
2680
2681
|
if (m) {
|
|
2681
|
-
const N = d.array.has(m.name), B = await Gt(
|
|
2682
|
+
const N = d.array.has(m.name), B = await Gt(b, i, S, r.shouldUseNativeValidation && !c, N);
|
|
2682
2683
|
if (B[m.name] && (f.valid = !1, c))
|
|
2683
2684
|
break;
|
|
2684
|
-
!c && (x(B, m.name) ? N ?
|
|
2685
|
+
!c && (x(B, m.name) ? N ? Xn(n.errors, B, m.name) : L(n.errors, m.name, B[m.name]) : $(n.errors, m.name));
|
|
2685
2686
|
}
|
|
2686
2687
|
C && await U(C, c, f);
|
|
2687
2688
|
}
|
|
@@ -2693,27 +2694,27 @@ function as(e = {}, t) {
|
|
|
2693
2694
|
c && (c._f.refs ? c._f.refs.every((f) => !ut(f)) : !ut(c._f.ref)) && rt(o);
|
|
2694
2695
|
}
|
|
2695
2696
|
d.unMount = /* @__PURE__ */ new Set();
|
|
2696
|
-
}, V = (o, c) => (o && c && L(i, o, c), !
|
|
2697
|
+
}, V = (o, c) => (o && c && L(i, o, c), !be(kt(), a)), R = (o, c, f) => Zn(o, d, {
|
|
2697
2698
|
...u.mount ? i : O(c) ? a : te(o) ? { [o]: c } : c
|
|
2698
2699
|
}, f, c), K = (o) => Pe(x(u.mount ? i : a, o, e.shouldUnregister ? x(a, o, []) : [])), W = (o, c, f = {}) => {
|
|
2699
2700
|
const k = x(s, o);
|
|
2700
|
-
let
|
|
2701
|
+
let b = c;
|
|
2701
2702
|
if (k) {
|
|
2702
2703
|
const m = k._f;
|
|
2703
|
-
m && (!m.disabled && L(i, o,
|
|
2704
|
+
m && (!m.disabled && L(i, o, kr(c, m)), b = He(m.ref) && q(c) ? "" : c, vr(m.ref) ? [...m.ref.options].forEach((C) => C.selected = b.includes(C.value)) : m.refs ? Be(m.ref) ? m.refs.length > 1 ? m.refs.forEach((C) => (!C.defaultChecked || !C.disabled) && (C.checked = Array.isArray(b) ? !!b.find((N) => N === C.value) : b === C.value)) : m.refs[0] && (m.refs[0].checked = !!b) : m.refs.forEach((C) => C.checked = C.value === b) : xt(m.ref) ? m.ref.value = "" : (m.ref.value = b, m.ref.type || h.values.next({
|
|
2704
2705
|
name: o,
|
|
2705
2706
|
values: { ...i }
|
|
2706
2707
|
})));
|
|
2707
2708
|
}
|
|
2708
|
-
(f.shouldDirty || f.shouldTouch) && ue(o,
|
|
2709
|
+
(f.shouldDirty || f.shouldTouch) && ue(o, b, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && tt(o);
|
|
2709
2710
|
}, Q = (o, c, f) => {
|
|
2710
2711
|
for (const k in c) {
|
|
2711
|
-
const
|
|
2712
|
-
(d.array.has(o) || !Je(
|
|
2712
|
+
const b = c[k], m = `${o}.${k}`, C = x(s, m);
|
|
2713
|
+
(d.array.has(o) || !Je(b) || C && !C._f) && !Se(b) ? Q(m, b, f) : W(m, b, f);
|
|
2713
2714
|
}
|
|
2714
2715
|
}, ge = (o, c, f = {}) => {
|
|
2715
|
-
const k = x(s, o),
|
|
2716
|
-
L(i, o, m),
|
|
2716
|
+
const k = x(s, o), b = d.array.has(o), m = oe(c);
|
|
2717
|
+
L(i, o, m), b ? (h.array.next({
|
|
2717
2718
|
name: o,
|
|
2718
2719
|
values: { ...i }
|
|
2719
2720
|
}), (v.isDirty || v.dirtyFields) && f.shouldDirty && h.state.next({
|
|
@@ -2727,41 +2728,41 @@ function as(e = {}, t) {
|
|
|
2727
2728
|
}, Ve = async (o) => {
|
|
2728
2729
|
const c = o.target;
|
|
2729
2730
|
let f = c.name, k = !0;
|
|
2730
|
-
const
|
|
2731
|
+
const b = x(s, f), m = () => c.type ? dt(b._f) : Un(o), C = (N) => {
|
|
2731
2732
|
k = Number.isNaN(N) || N === x(i, f, N);
|
|
2732
2733
|
};
|
|
2733
|
-
if (
|
|
2734
|
+
if (b) {
|
|
2734
2735
|
let N, B;
|
|
2735
|
-
const je = m(), ke = o.type === Pt.BLUR || o.type === Pt.FOCUS_OUT,
|
|
2736
|
-
L(i, f, je), ke ? (
|
|
2737
|
-
const at = ue(f, je, ke, !1),
|
|
2736
|
+
const je = m(), ke = o.type === Pt.BLUR || o.type === Pt.FOCUS_OUT, Vr = !rs(b._f) && !r.resolver && !x(n.errors, f) && !b._f.deps || ns(ke, x(n.touchedFields, f), n.isSubmitted, A, y), st = jt(f, d, ke);
|
|
2737
|
+
L(i, f, je), ke ? (b._f.onBlur && b._f.onBlur(o), p && p(0)) : b._f.onChange && b._f.onChange(o);
|
|
2738
|
+
const at = ue(f, je, ke, !1), Ir = !J(at) || st;
|
|
2738
2739
|
if (!ke && h.values.next({
|
|
2739
2740
|
name: f,
|
|
2740
2741
|
type: o.type,
|
|
2741
2742
|
values: { ...i }
|
|
2742
|
-
}),
|
|
2743
|
-
return v.isValid && g(),
|
|
2743
|
+
}), Vr)
|
|
2744
|
+
return v.isValid && g(), Ir && h.state.next({ name: f, ...st ? {} : at });
|
|
2744
2745
|
if (!ke && st && h.state.next({ ...n }), F(!0), r.resolver) {
|
|
2745
2746
|
const { errors: Mt } = await H([f]);
|
|
2746
2747
|
if (C(je), k) {
|
|
2747
|
-
const
|
|
2748
|
+
const Mr = Ht(n.errors, s, f), Ft = Ht(Mt, s, Mr.name || f);
|
|
2748
2749
|
N = Ft.error, f = Ft.name, B = J(Mt);
|
|
2749
2750
|
}
|
|
2750
2751
|
} else
|
|
2751
|
-
N = (await Gt(
|
|
2752
|
-
k && (
|
|
2752
|
+
N = (await Gt(b, i, S, r.shouldUseNativeValidation))[f], C(je), k && (N ? B = !1 : v.isValid && (B = await U(s, !0)));
|
|
2753
|
+
k && (b._f.deps && tt(b._f.deps), Ae(f, B, N, at));
|
|
2753
2754
|
}
|
|
2754
2755
|
}, $e = (o, c) => {
|
|
2755
2756
|
if (x(n.errors, c) && o.focus)
|
|
2756
2757
|
return o.focus(), 1;
|
|
2757
2758
|
}, tt = async (o, c = {}) => {
|
|
2758
2759
|
let f, k;
|
|
2759
|
-
const
|
|
2760
|
+
const b = ot(o);
|
|
2760
2761
|
if (F(!0), r.resolver) {
|
|
2761
|
-
const m = await se(O(o) ? o :
|
|
2762
|
-
f = J(m), k = o ? !
|
|
2762
|
+
const m = await se(O(o) ? o : b);
|
|
2763
|
+
f = J(m), k = o ? !b.some((C) => x(m, C)) : f;
|
|
2763
2764
|
} else
|
|
2764
|
-
o ? (k = (await Promise.all(
|
|
2765
|
+
o ? (k = (await Promise.all(b.map(async (m) => {
|
|
2765
2766
|
const C = x(s, m);
|
|
2766
2767
|
return await U(C && C._f ? { [m]: C } : C);
|
|
2767
2768
|
}))).every(Boolean), !(!k && !n.isValid) && g()) : k = f = await U(s);
|
|
@@ -2770,7 +2771,7 @@ function as(e = {}, t) {
|
|
|
2770
2771
|
...r.resolver || !o ? { isValid: f } : {},
|
|
2771
2772
|
errors: n.errors,
|
|
2772
2773
|
isValidating: !1
|
|
2773
|
-
}), c.shouldFocus && !k && Ue(s, $e, o ?
|
|
2774
|
+
}), c.shouldFocus && !k && Ue(s, $e, o ? b : d.mount), k;
|
|
2774
2775
|
}, kt = (o) => {
|
|
2775
2776
|
const c = {
|
|
2776
2777
|
...a,
|
|
@@ -2782,7 +2783,7 @@ function as(e = {}, t) {
|
|
|
2782
2783
|
isDirty: !!x((c || n).dirtyFields, o),
|
|
2783
2784
|
isTouched: !!x((c || n).touchedFields, o),
|
|
2784
2785
|
error: x((c || n).errors, o)
|
|
2785
|
-
}),
|
|
2786
|
+
}), Sr = (o) => {
|
|
2786
2787
|
o && ot(o).forEach((c) => $(n.errors, c)), h.state.next({
|
|
2787
2788
|
errors: o ? n.errors : {}
|
|
2788
2789
|
});
|
|
@@ -2796,7 +2797,7 @@ function as(e = {}, t) {
|
|
|
2796
2797
|
errors: n.errors,
|
|
2797
2798
|
isValid: !1
|
|
2798
2799
|
}), f && f.shouldFocus && k && k.focus && k.focus();
|
|
2799
|
-
},
|
|
2800
|
+
}, Cr = (o, c) => de(o) ? h.values.subscribe({
|
|
2800
2801
|
next: (f) => o(R(void 0, c), f)
|
|
2801
2802
|
}) : R(o, c, !0), rt = (o, c = {}) => {
|
|
2802
2803
|
for (const f of o ? ot(o) : d.mount)
|
|
@@ -2807,9 +2808,9 @@ function as(e = {}, t) {
|
|
|
2807
2808
|
...n,
|
|
2808
2809
|
...c.keepDirty ? { isDirty: V() } : {}
|
|
2809
2810
|
}), !c.keepIsValid && g();
|
|
2810
|
-
}, Ct = ({ disabled: o, name: c, field: f, fields: k, value:
|
|
2811
|
+
}, Ct = ({ disabled: o, name: c, field: f, fields: k, value: b }) => {
|
|
2811
2812
|
if (ce(o)) {
|
|
2812
|
-
const m = o ? void 0 : O(
|
|
2813
|
+
const m = o ? void 0 : O(b) ? dt(f ? f._f : x(k, c)._f) : b;
|
|
2813
2814
|
L(i, c, m), ue(c, m, !1, !1, !0);
|
|
2814
2815
|
}
|
|
2815
2816
|
}, nt = (o, c = {}) => {
|
|
@@ -2840,10 +2841,10 @@ function as(e = {}, t) {
|
|
|
2840
2841
|
name: o,
|
|
2841
2842
|
onChange: Ve,
|
|
2842
2843
|
onBlur: Ve,
|
|
2843
|
-
ref: (
|
|
2844
|
-
if (
|
|
2844
|
+
ref: (b) => {
|
|
2845
|
+
if (b) {
|
|
2845
2846
|
nt(o, c), f = x(s, o);
|
|
2846
|
-
const m = O(
|
|
2847
|
+
const m = O(b.value) && b.querySelectorAll && b.querySelectorAll("input,select,textarea")[0] || b, C = es(m), N = f._f.refs || [];
|
|
2847
2848
|
if (C ? N.find((B) => B === m) : m === f._f.ref)
|
|
2848
2849
|
return;
|
|
2849
2850
|
L(s, o, {
|
|
@@ -2860,10 +2861,10 @@ function as(e = {}, t) {
|
|
|
2860
2861
|
}
|
|
2861
2862
|
}), me(o, !1, void 0, m);
|
|
2862
2863
|
} else
|
|
2863
|
-
f = x(s, o, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || c.shouldUnregister) && !(
|
|
2864
|
+
f = x(s, o, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || c.shouldUnregister) && !(Kn(d.array, o) && u.action) && d.unMount.add(o);
|
|
2864
2865
|
}
|
|
2865
2866
|
};
|
|
2866
|
-
}, Et = () => r.shouldFocusError && Ue(s, $e, d.mount),
|
|
2867
|
+
}, Et = () => r.shouldFocusError && Ue(s, $e, d.mount), Er = (o) => {
|
|
2867
2868
|
ce(o) && (h.state.next({ disabled: o }), Ue(s, (c) => {
|
|
2868
2869
|
c.disabled = o;
|
|
2869
2870
|
}, 0, !1));
|
|
@@ -2873,8 +2874,8 @@ function as(e = {}, t) {
|
|
|
2873
2874
|
if (h.state.next({
|
|
2874
2875
|
isSubmitting: !0
|
|
2875
2876
|
}), r.resolver) {
|
|
2876
|
-
const { errors:
|
|
2877
|
-
n.errors =
|
|
2877
|
+
const { errors: b, values: m } = await H();
|
|
2878
|
+
n.errors = b, k = m;
|
|
2878
2879
|
} else
|
|
2879
2880
|
await U(s);
|
|
2880
2881
|
$(n.errors, "root"), J(n.errors) ? (h.state.next({
|
|
@@ -2886,16 +2887,16 @@ function as(e = {}, t) {
|
|
|
2886
2887
|
submitCount: n.submitCount + 1,
|
|
2887
2888
|
errors: n.errors
|
|
2888
2889
|
});
|
|
2889
|
-
},
|
|
2890
|
+
}, Ar = (o, c = {}) => {
|
|
2890
2891
|
x(s, o) && (O(c.defaultValue) ? ge(o, x(a, o)) : (ge(o, c.defaultValue), L(a, o, c.defaultValue)), c.keepTouched || $(n.touchedFields, o), c.keepDirty || ($(n.dirtyFields, o), n.isDirty = c.defaultValue ? V(o, x(a, o)) : V()), c.keepError || ($(n.errors, o), v.isValid && g()), h.state.next({ ...n }));
|
|
2891
2892
|
}, Vt = (o, c = {}) => {
|
|
2892
|
-
const f = o ? oe(o) : a, k = oe(f),
|
|
2893
|
+
const f = o ? oe(o) : a, k = oe(f), b = o && !J(o) ? k : a;
|
|
2893
2894
|
if (c.keepDefaultValues || (a = f), !c.keepValues) {
|
|
2894
2895
|
if (c.keepDirtyValues || _)
|
|
2895
2896
|
for (const m of d.mount)
|
|
2896
|
-
x(n.dirtyFields, m) ? L(
|
|
2897
|
+
x(n.dirtyFields, m) ? L(b, m, x(i, m)) : ge(m, x(b, m));
|
|
2897
2898
|
else {
|
|
2898
|
-
if (
|
|
2899
|
+
if (yt && O(o))
|
|
2899
2900
|
for (const m of d.mount) {
|
|
2900
2901
|
const C = x(s, m);
|
|
2901
2902
|
if (C && C._f) {
|
|
@@ -2911,10 +2912,10 @@ function as(e = {}, t) {
|
|
|
2911
2912
|
}
|
|
2912
2913
|
s = {};
|
|
2913
2914
|
}
|
|
2914
|
-
i = e.shouldUnregister ? c.keepDefaultValues ? oe(a) : {} : oe(
|
|
2915
|
-
values: { ...
|
|
2915
|
+
i = e.shouldUnregister ? c.keepDefaultValues ? oe(a) : {} : oe(b), h.array.next({
|
|
2916
|
+
values: { ...b }
|
|
2916
2917
|
}), h.values.next({
|
|
2917
|
-
values: { ...
|
|
2918
|
+
values: { ...b }
|
|
2918
2919
|
});
|
|
2919
2920
|
}
|
|
2920
2921
|
d = {
|
|
@@ -2926,7 +2927,7 @@ function as(e = {}, t) {
|
|
|
2926
2927
|
focus: ""
|
|
2927
2928
|
}, !u.mount && t(), u.mount = !v.isValid || !!c.keepIsValid, u.watch = !!e.shouldUnregister, h.state.next({
|
|
2928
2929
|
submitCount: c.keepSubmitCount ? n.submitCount : 0,
|
|
2929
|
-
isDirty: c.keepDirty ? n.isDirty : !!(c.keepDefaultValues && !
|
|
2930
|
+
isDirty: c.keepDirty ? n.isDirty : !!(c.keepDefaultValues && !be(o, a)),
|
|
2930
2931
|
isSubmitted: c.keepIsSubmitted ? n.isSubmitted : !1,
|
|
2931
2932
|
dirtyFields: c.keepDirtyValues ? n.dirtyFields : c.keepDefaultValues && o ? ct(a, o) : {},
|
|
2932
2933
|
touchedFields: c.keepTouched ? n.touchedFields : {},
|
|
@@ -2962,7 +2963,7 @@ function as(e = {}, t) {
|
|
|
2962
2963
|
...o
|
|
2963
2964
|
};
|
|
2964
2965
|
},
|
|
2965
|
-
_disableForm:
|
|
2966
|
+
_disableForm: Er,
|
|
2966
2967
|
_subjects: h,
|
|
2967
2968
|
_proxyFormState: v,
|
|
2968
2969
|
get _fields() {
|
|
@@ -3005,19 +3006,19 @@ function as(e = {}, t) {
|
|
|
3005
3006
|
trigger: tt,
|
|
3006
3007
|
register: nt,
|
|
3007
3008
|
handleSubmit: At,
|
|
3008
|
-
watch:
|
|
3009
|
+
watch: Cr,
|
|
3009
3010
|
setValue: ge,
|
|
3010
3011
|
getValues: kt,
|
|
3011
3012
|
reset: It,
|
|
3012
|
-
resetField:
|
|
3013
|
-
clearErrors:
|
|
3013
|
+
resetField: Ar,
|
|
3014
|
+
clearErrors: Sr,
|
|
3014
3015
|
unregister: rt,
|
|
3015
3016
|
setError: St,
|
|
3016
3017
|
setFocus: (o, c = {}) => {
|
|
3017
3018
|
const f = x(s, o), k = f && f._f;
|
|
3018
3019
|
if (k) {
|
|
3019
|
-
const
|
|
3020
|
-
|
|
3020
|
+
const b = k.refs ? k.refs[0] : k.ref;
|
|
3021
|
+
b.focus && (b.focus(), c.shouldSelect && b.select());
|
|
3021
3022
|
}
|
|
3022
3023
|
},
|
|
3023
3024
|
getFieldState: _t
|
|
@@ -3040,14 +3041,14 @@ function Ye(e = {}) {
|
|
|
3040
3041
|
defaultValues: de(e.defaultValues) ? void 0 : e.defaultValues
|
|
3041
3042
|
});
|
|
3042
3043
|
t.current || (t.current = {
|
|
3043
|
-
...
|
|
3044
|
+
...is(e, () => s((i) => ({ ...i }))),
|
|
3044
3045
|
formState: n
|
|
3045
3046
|
});
|
|
3046
3047
|
const a = t.current.control;
|
|
3047
|
-
return a._options = e,
|
|
3048
|
+
return a._options = e, Jn({
|
|
3048
3049
|
subject: a._subjects.state,
|
|
3049
3050
|
next: (i) => {
|
|
3050
|
-
|
|
3051
|
+
Wn(i, a._proxyFormState, a._updateFormState, !0) && s({ ...a._formState });
|
|
3051
3052
|
}
|
|
3052
3053
|
}), Y.useEffect(() => a._disableForm(e.disabled), [a, e.disabled]), Y.useEffect(() => {
|
|
3053
3054
|
if (a._proxyFormState.isDirty) {
|
|
@@ -3057,17 +3058,17 @@ function Ye(e = {}) {
|
|
|
3057
3058
|
});
|
|
3058
3059
|
}
|
|
3059
3060
|
}, [a, n.isDirty]), Y.useEffect(() => {
|
|
3060
|
-
e.values && !
|
|
3061
|
+
e.values && !be(e.values, r.current) ? (a._reset(e.values, a._options.resetOptions), r.current = e.values) : a._resetDefaultValues();
|
|
3061
3062
|
}, [e.values, a]), Y.useEffect(() => {
|
|
3062
3063
|
a._state.mount || (a._updateValid(), a._state.mount = !0), a._state.watch && (a._state.watch = !1, a._subjects.state.next({ ...a._formState })), a._removeUnmounted();
|
|
3063
|
-
}), t.current.formState =
|
|
3064
|
+
}), t.current.formState = Hn(n, a), t.current;
|
|
3064
3065
|
}
|
|
3065
3066
|
var Wt = function(e, t, r) {
|
|
3066
3067
|
if (e && "reportValidity" in e) {
|
|
3067
3068
|
var n = x(r, t);
|
|
3068
3069
|
e.setCustomValidity(n && n.message || ""), e.reportValidity();
|
|
3069
3070
|
}
|
|
3070
|
-
},
|
|
3071
|
+
}, os = function(e, t) {
|
|
3071
3072
|
var r = function(s) {
|
|
3072
3073
|
var a = t.fields[s];
|
|
3073
3074
|
a && a.ref && "reportValidity" in a.ref ? Wt(a.ref, s, e) : a.refs && a.refs.forEach(function(i) {
|
|
@@ -3076,25 +3077,25 @@ var Wt = function(e, t, r) {
|
|
|
3076
3077
|
};
|
|
3077
3078
|
for (var n in t.fields)
|
|
3078
3079
|
r(n);
|
|
3079
|
-
},
|
|
3080
|
-
t.shouldUseNativeValidation &&
|
|
3080
|
+
}, ls = function(e, t) {
|
|
3081
|
+
t.shouldUseNativeValidation && os(e, t);
|
|
3081
3082
|
var r = {};
|
|
3082
3083
|
for (var n in e) {
|
|
3083
3084
|
var s = x(t.fields, n), a = Object.assign(e[n] || {}, { ref: s && s.ref });
|
|
3084
|
-
if (
|
|
3085
|
-
var i = Object.assign({},
|
|
3085
|
+
if (cs(t.names || Object.keys(e), n)) {
|
|
3086
|
+
var i = Object.assign({}, us(x(r, n)));
|
|
3086
3087
|
L(i, "root", a), L(r, n, i);
|
|
3087
3088
|
} else
|
|
3088
3089
|
L(r, n, a);
|
|
3089
3090
|
}
|
|
3090
3091
|
return r;
|
|
3091
|
-
},
|
|
3092
|
+
}, us = function(e) {
|
|
3092
3093
|
return Array.isArray(e) ? e.filter(Boolean) : [];
|
|
3093
|
-
},
|
|
3094
|
+
}, cs = function(e, t) {
|
|
3094
3095
|
return e.some(function(r) {
|
|
3095
3096
|
return r.startsWith(t + ".");
|
|
3096
3097
|
});
|
|
3097
|
-
},
|
|
3098
|
+
}, ds = function(e, t) {
|
|
3098
3099
|
for (var r = {}; e.issues.length; ) {
|
|
3099
3100
|
var n = e.issues[0];
|
|
3100
3101
|
if (n.path) {
|
|
@@ -3103,7 +3104,7 @@ var Wt = function(e, t, r) {
|
|
|
3103
3104
|
}).join(".");
|
|
3104
3105
|
if (r[s] || (r[s] = { message: n.message, type: n.validation }), t) {
|
|
3105
3106
|
var a = r[s].types, i = a && a[n.validation];
|
|
3106
|
-
r[s] =
|
|
3107
|
+
r[s] = gr(s, t, r, n.validation, i ? [].concat(i, n.message) : n.message);
|
|
3107
3108
|
}
|
|
3108
3109
|
e.issues.shift();
|
|
3109
3110
|
}
|
|
@@ -3119,15 +3120,15 @@ var Wt = function(e, t, r) {
|
|
|
3119
3120
|
return { values: r.raw ? n : v, errors: {} };
|
|
3120
3121
|
}
|
|
3121
3122
|
var w = Object.assign({}, { abortEarly: !1, abortPipeEarly: !1 }, t);
|
|
3122
|
-
return r.mode === "sync" ? p(sr(e, n, w)) : Promise.resolve(
|
|
3123
|
+
return r.mode === "sync" ? p(sr(e, n, w)) : Promise.resolve(Or(e, n, w)).then(p);
|
|
3123
3124
|
}();
|
|
3124
3125
|
} catch (p) {
|
|
3125
3126
|
return u(p);
|
|
3126
3127
|
}
|
|
3127
3128
|
return d && d.then ? d.then(void 0, u) : d;
|
|
3128
3129
|
}(0, function(i) {
|
|
3129
|
-
if (i instanceof
|
|
3130
|
-
return { values: {}, errors:
|
|
3130
|
+
if (i instanceof Br)
|
|
3131
|
+
return { values: {}, errors: ls(ds(i, !a.shouldUseNativeValidation && a.criteriaMode === "all"), a) };
|
|
3131
3132
|
throw i;
|
|
3132
3133
|
}));
|
|
3133
3134
|
} catch (i) {
|
|
@@ -3135,19 +3136,19 @@ var Wt = function(e, t, r) {
|
|
|
3135
3136
|
}
|
|
3136
3137
|
};
|
|
3137
3138
|
};
|
|
3138
|
-
const Jt = 27, Zt = 12, Xt = 10,
|
|
3139
|
+
const Jt = 27, Zt = 12, Xt = 10, fs = Ce("enum"), hs = (e, t) => {
|
|
3139
3140
|
const r = {
|
|
3140
3141
|
min: e.minSelected ?? 0,
|
|
3141
3142
|
max: e.maxSelected ?? e.options.length
|
|
3142
3143
|
};
|
|
3143
3144
|
return et(he({
|
|
3144
|
-
checked:
|
|
3145
|
+
checked: ye(Pr(X(), $r()), ar((n) => Object.entries(n).filter(([s, a]) => a).map(([s, a]) => s)), ze(r.max, t("validation_multiple_choice_max", {
|
|
3145
3146
|
count: r.max
|
|
3146
3147
|
})), De(r.min, t("validation_multiple_choice_min", {
|
|
3147
3148
|
count: r.min
|
|
3148
3149
|
})))
|
|
3149
3150
|
}));
|
|
3150
|
-
},
|
|
3151
|
+
}, ps = nr(({
|
|
3151
3152
|
option: e,
|
|
3152
3153
|
...t
|
|
3153
3154
|
}, r) => l(ve, {
|
|
@@ -3161,7 +3162,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3161
3162
|
htmlFor: t.id,
|
|
3162
3163
|
children: e.label
|
|
3163
3164
|
})]
|
|
3164
|
-
})), Qt = Xe("gutter-stable flex w-full flex-1 flex-wrap gap-
|
|
3165
|
+
})), Qt = Xe("gutter-stable flex w-full flex-1 flex-wrap gap-2 overflow-y-auto rounded-xl p-2.5 pr-4", {
|
|
3165
3166
|
variants: {
|
|
3166
3167
|
variant: {
|
|
3167
3168
|
// In cases where there is only one option, we want to center it
|
|
@@ -3170,7 +3171,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3170
3171
|
booleanLike: cr
|
|
3171
3172
|
}
|
|
3172
3173
|
}
|
|
3173
|
-
}),
|
|
3174
|
+
}), ms = ({
|
|
3174
3175
|
input: e,
|
|
3175
3176
|
onSubmitSuccess: t
|
|
3176
3177
|
}) => {
|
|
@@ -3185,10 +3186,10 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3185
3186
|
}
|
|
3186
3187
|
} = Ye({
|
|
3187
3188
|
defaultValues: {
|
|
3188
|
-
checked: n ? {} :
|
|
3189
|
+
checked: n ? {} : fs(r) ? Object.fromEntries(r.value.map((h) => [h, !0])) : {}
|
|
3189
3190
|
},
|
|
3190
|
-
resolver:
|
|
3191
|
-
}), p =
|
|
3191
|
+
resolver: hs(e.config, a)
|
|
3192
|
+
}), p = bt();
|
|
3192
3193
|
return s ? l("ul", {
|
|
3193
3194
|
style: {
|
|
3194
3195
|
maxHeight: 6.5 * Jt + 5 * Zt + 2 * Xt
|
|
@@ -3197,11 +3198,11 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3197
3198
|
variant: "booleanLike"
|
|
3198
3199
|
}),
|
|
3199
3200
|
children: e.config.options.map((h, _) => l("li", {
|
|
3200
|
-
class:
|
|
3201
|
-
children: l(
|
|
3201
|
+
class: dr,
|
|
3202
|
+
children: l(fr, {
|
|
3202
3203
|
type: "submit",
|
|
3203
|
-
ref: (
|
|
3204
|
-
|
|
3204
|
+
ref: (y) => {
|
|
3205
|
+
y && _ === 0 && (p.current = y);
|
|
3205
3206
|
},
|
|
3206
3207
|
label: h.label,
|
|
3207
3208
|
value: "true",
|
|
@@ -3214,10 +3215,10 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3214
3215
|
}) : l("form", {
|
|
3215
3216
|
noValidate: !0,
|
|
3216
3217
|
onSubmit: (h) => u((_) => {
|
|
3217
|
-
const
|
|
3218
|
+
const y = _.checked;
|
|
3218
3219
|
t({
|
|
3219
3220
|
type: "enum",
|
|
3220
|
-
value:
|
|
3221
|
+
value: y
|
|
3221
3222
|
});
|
|
3222
3223
|
})(h),
|
|
3223
3224
|
children: [l("div", {
|
|
@@ -3230,19 +3231,19 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3230
3231
|
variant: e.config.options.length === 1 ? "singleOption" : void 0
|
|
3231
3232
|
}),
|
|
3232
3233
|
children: e.config.options.map((h, _) => {
|
|
3233
|
-
const
|
|
3234
|
+
const y = `checked.${h.value}`, {
|
|
3234
3235
|
ref: A,
|
|
3235
3236
|
...S
|
|
3236
|
-
} = i(
|
|
3237
|
+
} = i(y);
|
|
3237
3238
|
return l("li", {
|
|
3238
3239
|
class: "relative",
|
|
3239
|
-
children: l(
|
|
3240
|
+
children: l(ps, {
|
|
3240
3241
|
option: h,
|
|
3241
3242
|
autoFocus: _ === 0,
|
|
3242
3243
|
ref: (E) => {
|
|
3243
3244
|
E && _ === 0 && (p.current = E), A(E);
|
|
3244
3245
|
},
|
|
3245
|
-
id:
|
|
3246
|
+
id: y,
|
|
3246
3247
|
...S,
|
|
3247
3248
|
onClick: n ? () => t({
|
|
3248
3249
|
type: "enum",
|
|
@@ -3254,6 +3255,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3254
3255
|
}), l("div", {
|
|
3255
3256
|
class: "flex flex-col items-center gap-2 pr-2.5 pt-2.5",
|
|
3256
3257
|
children: [n ? null : l(xe, {}), e.config.minSelected === 0 && l(we, {
|
|
3258
|
+
class: "relative",
|
|
3257
3259
|
type: "button",
|
|
3258
3260
|
onClick: () => t({
|
|
3259
3261
|
type: "enum",
|
|
@@ -3268,14 +3270,14 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3268
3270
|
})
|
|
3269
3271
|
})]
|
|
3270
3272
|
});
|
|
3271
|
-
},
|
|
3273
|
+
}, gs = Ce("number"), bs = (e, t) => {
|
|
3272
3274
|
const r = e.min ?? Number.MIN_SAFE_INTEGER, n = e.max ?? Number.MAX_SAFE_INTEGER, s = e.decimalCases ?? 0;
|
|
3273
3275
|
return et(he({
|
|
3274
|
-
number:
|
|
3276
|
+
number: ye(qr(t("validation_number")), Ur(r, t("validation_number_min", {
|
|
3275
3277
|
min: r
|
|
3276
|
-
})),
|
|
3278
|
+
})), zr(n, t("validation_number_max", {
|
|
3277
3279
|
max: n
|
|
3278
|
-
})),
|
|
3280
|
+
})), jr((a) => a === Number(a.toFixed(s)), t("validation_number_decimal_cases", {
|
|
3279
3281
|
count: s
|
|
3280
3282
|
})))
|
|
3281
3283
|
}));
|
|
@@ -3294,9 +3296,9 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3294
3296
|
}
|
|
3295
3297
|
} = Ye({
|
|
3296
3298
|
defaultValues: {
|
|
3297
|
-
number: r ? Number(r) :
|
|
3299
|
+
number: r ? Number(r) : gs(n) ? n.value : void 0
|
|
3298
3300
|
},
|
|
3299
|
-
resolver:
|
|
3301
|
+
resolver: bs(e.config, s)
|
|
3300
3302
|
}), {
|
|
3301
3303
|
ref: d,
|
|
3302
3304
|
...p
|
|
@@ -3337,7 +3339,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3337
3339
|
}),
|
|
3338
3340
|
placeholder: e.config.placeholder
|
|
3339
3341
|
}), e.config.optional && l(we, {
|
|
3340
|
-
class: "absolute right-0 top-0",
|
|
3342
|
+
class: "absolute bottom-0 right-0.5 top-0",
|
|
3341
3343
|
onClick: () => t(null)
|
|
3342
3344
|
})]
|
|
3343
3345
|
}), l(xe, {})]
|
|
@@ -3345,7 +3347,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3345
3347
|
error: u.number
|
|
3346
3348
|
})]
|
|
3347
3349
|
});
|
|
3348
|
-
},
|
|
3350
|
+
}, vs = (e) => {
|
|
3349
3351
|
if (e === "")
|
|
3350
3352
|
return {
|
|
3351
3353
|
countryCode: "",
|
|
@@ -3359,20 +3361,20 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3359
3361
|
countryCode: "",
|
|
3360
3362
|
phoneNumber: ""
|
|
3361
3363
|
};
|
|
3362
|
-
},
|
|
3363
|
-
const t =
|
|
3364
|
+
}, xs = "44", ws = /^[0-9 ]+$/, ks = Ce("string"), _s = Ce("phone"), Ss = (e) => {
|
|
3365
|
+
const t = ye(X(e("validation_country_code")), Kr(ws, e("validation_country_code"))), r = ye(X(e("validation_phone")), De(1, e("validation_phone")), ar((n) => n.replace(/[^0-9]/g, "")));
|
|
3364
3366
|
return et(he({
|
|
3365
3367
|
countryCode: t,
|
|
3366
3368
|
phoneNumber: r
|
|
3367
3369
|
}));
|
|
3368
|
-
},
|
|
3370
|
+
}, Cs = ({
|
|
3369
3371
|
input: e,
|
|
3370
3372
|
onSubmitSuccess: t
|
|
3371
3373
|
}) => {
|
|
3372
3374
|
var A;
|
|
3373
3375
|
const r = e.key ? (A = I.current$.value.flow) == null ? void 0 : A.data.submissions[e.key] : void 0, {
|
|
3374
3376
|
t: n
|
|
3375
|
-
} = G(), [s, a] = ee(), i =
|
|
3377
|
+
} = G(), [s, a] = ee(), i = ks(r) ? vs(r.value) : _s(r) ? r.value : void 0, {
|
|
3376
3378
|
register: u,
|
|
3377
3379
|
handleSubmit: d,
|
|
3378
3380
|
formState: {
|
|
@@ -3381,16 +3383,16 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3381
3383
|
watch: w
|
|
3382
3384
|
} = Ye({
|
|
3383
3385
|
defaultValues: {
|
|
3384
|
-
countryCode: (i == null ? void 0 : i.countryCode) ?? e.config.defaultValue.countryCode ??
|
|
3386
|
+
countryCode: (i == null ? void 0 : i.countryCode) ?? e.config.defaultValue.countryCode ?? xs,
|
|
3385
3387
|
phoneNumber: (i == null ? void 0 : i.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
|
|
3386
3388
|
},
|
|
3387
|
-
resolver:
|
|
3389
|
+
resolver: Ss(n)
|
|
3388
3390
|
}), {
|
|
3389
3391
|
ref: v,
|
|
3390
3392
|
...h
|
|
3391
3393
|
} = u("phoneNumber", {
|
|
3392
3394
|
required: !e.config.optional
|
|
3393
|
-
}), _ = re(),
|
|
3395
|
+
}), _ = re(), y = w("countryCode");
|
|
3394
3396
|
return pe(() => {
|
|
3395
3397
|
_.current && (_.current.focus(), _.current.select());
|
|
3396
3398
|
}, []), l("form", {
|
|
@@ -3412,7 +3414,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3412
3414
|
}
|
|
3413
3415
|
}) : t({
|
|
3414
3416
|
type: "string",
|
|
3415
|
-
value:
|
|
3417
|
+
value: y + S.phoneNumber
|
|
3416
3418
|
});
|
|
3417
3419
|
}),
|
|
3418
3420
|
children: [l("div", {
|
|
@@ -3423,7 +3425,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3423
3425
|
class: "text-neutral-12 bg-lowest hover:bg-neutral-5 placeholder:text-neutral-8 focus-visible:outline-accent-7 focus-within:bg-neutral-5 focus-within:outline-accent-7 outline-divider relative flex h-full cursor-pointer appearance-none items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap rounded-l-full border-solid px-3 py-1.5 text-center text-base outline outline-2 transition-all focus-within:outline-none",
|
|
3424
3426
|
htmlFor: `isdk_phone_${e.key}`,
|
|
3425
3427
|
children: [l("span", {
|
|
3426
|
-
children: ["+",
|
|
3428
|
+
children: ["+", y]
|
|
3427
3429
|
}), l("select", {
|
|
3428
3430
|
...u("countryCode", {}),
|
|
3429
3431
|
id: `isdk_phone_${e.key}`,
|
|
@@ -3451,7 +3453,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3451
3453
|
}),
|
|
3452
3454
|
placeholder: e.config.placeholder
|
|
3453
3455
|
}), e.config.optional && l(we, {
|
|
3454
|
-
class: "absolute bottom-0 right-
|
|
3456
|
+
class: "absolute bottom-0 right-1 top-0",
|
|
3455
3457
|
onClick: () => t(null)
|
|
3456
3458
|
})]
|
|
3457
3459
|
}), l(xe, {})]
|
|
@@ -3461,7 +3463,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3461
3463
|
}
|
|
3462
3464
|
})]
|
|
3463
3465
|
});
|
|
3464
|
-
},
|
|
3466
|
+
}, Es = ({
|
|
3465
3467
|
input: e,
|
|
3466
3468
|
onSubmitSuccess: t
|
|
3467
3469
|
}) => l("div", {
|
|
@@ -3493,7 +3495,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3493
3495
|
})]
|
|
3494
3496
|
})
|
|
3495
3497
|
})
|
|
3496
|
-
}),
|
|
3498
|
+
}), As = {
|
|
3497
3499
|
email: {
|
|
3498
3500
|
type: "email",
|
|
3499
3501
|
inputMode: "email",
|
|
@@ -3508,7 +3510,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3508
3510
|
inputMode: "url",
|
|
3509
3511
|
formNoValidate: !0
|
|
3510
3512
|
}
|
|
3511
|
-
},
|
|
3513
|
+
}, Vs = Ce("string"), Is = (e, t) => {
|
|
3512
3514
|
const r = {
|
|
3513
3515
|
maxLength: t("validation_max_chars", {
|
|
3514
3516
|
count: e.maxChars ?? 999
|
|
@@ -3519,12 +3521,12 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3519
3521
|
};
|
|
3520
3522
|
return et(he({
|
|
3521
3523
|
text: {
|
|
3522
|
-
email:
|
|
3523
|
-
text:
|
|
3524
|
-
url:
|
|
3524
|
+
email: ye(X(t("validation_email")), Gr(t("validation_email")), De(e.minChars ?? 1, r.minLength), ze(e.maxChars ?? 1 / 0, r.maxLength)),
|
|
3525
|
+
text: ye(X(), De(e.minChars ?? 1, r.minLength), ze(e.maxChars ?? 1 / 0, r.maxLength)),
|
|
3526
|
+
url: ye(X(t("validation_url")), Hr(t("validation_url")), De(e.minChars ?? 1, r.minLength), ze(e.maxChars ?? 1 / 0, r.maxLength))
|
|
3525
3527
|
}[e.format]
|
|
3526
3528
|
}));
|
|
3527
|
-
},
|
|
3529
|
+
}, Ms = ({
|
|
3528
3530
|
input: e,
|
|
3529
3531
|
onSubmitSuccess: t
|
|
3530
3532
|
}) => {
|
|
@@ -3539,9 +3541,9 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3539
3541
|
}
|
|
3540
3542
|
} = Ye({
|
|
3541
3543
|
defaultValues: {
|
|
3542
|
-
text: s || (
|
|
3544
|
+
text: s || (Vs(n) ? n.value : "")
|
|
3543
3545
|
},
|
|
3544
|
-
resolver:
|
|
3546
|
+
resolver: Is(e.config, r)
|
|
3545
3547
|
}), {
|
|
3546
3548
|
ref: d,
|
|
3547
3549
|
...p
|
|
@@ -3566,7 +3568,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3566
3568
|
children: [l("input", {
|
|
3567
3569
|
id: "chat-input",
|
|
3568
3570
|
...p,
|
|
3569
|
-
...
|
|
3571
|
+
...As[e.config.format],
|
|
3570
3572
|
autocomplete: "off",
|
|
3571
3573
|
autoCapitalize: "off",
|
|
3572
3574
|
autoCorrect: "off",
|
|
@@ -3580,7 +3582,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3580
3582
|
className: "w-full rounded-full"
|
|
3581
3583
|
})
|
|
3582
3584
|
}), e.config.optional && l(we, {
|
|
3583
|
-
class: "absolute right-0 top-0",
|
|
3585
|
+
class: "absolute bottom-0 right-0.5 top-0",
|
|
3584
3586
|
onClick: () => t(null)
|
|
3585
3587
|
})]
|
|
3586
3588
|
}), l(xe, {})]
|
|
@@ -3588,20 +3590,20 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3588
3590
|
error: u.text
|
|
3589
3591
|
})]
|
|
3590
3592
|
});
|
|
3591
|
-
},
|
|
3592
|
-
text:
|
|
3593
|
-
phone:
|
|
3594
|
-
"multiple-choice":
|
|
3595
|
-
boolean:
|
|
3596
|
-
file:
|
|
3597
|
-
submit:
|
|
3598
|
-
address:
|
|
3593
|
+
}, Fs = {
|
|
3594
|
+
text: Ms,
|
|
3595
|
+
phone: Cs,
|
|
3596
|
+
"multiple-choice": ms,
|
|
3597
|
+
boolean: Dn,
|
|
3598
|
+
file: zn,
|
|
3599
|
+
submit: Es,
|
|
3600
|
+
address: Fn,
|
|
3599
3601
|
number: ys
|
|
3600
|
-
},
|
|
3602
|
+
}, Ls = ({
|
|
3601
3603
|
logger: e
|
|
3602
3604
|
}) => {
|
|
3603
3605
|
var a;
|
|
3604
|
-
const t = (a = I.current$.value.flow) == null ? void 0 : a.data.currentInput, [r, n] =
|
|
3606
|
+
const t = (a = I.current$.value.flow) == null ? void 0 : a.data.currentInput, [r, n] = vn(), s = re(null);
|
|
3605
3607
|
return I.inputHeight$.value = n.height, le(() => {
|
|
3606
3608
|
const i = s.current;
|
|
3607
3609
|
if (i)
|
|
@@ -3618,7 +3620,7 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3618
3620
|
ref: r,
|
|
3619
3621
|
class: "border-divider flex flex-col justify-end border-t",
|
|
3620
3622
|
children: t ? (() => {
|
|
3621
|
-
const i =
|
|
3623
|
+
const i = Fs[t.type];
|
|
3622
3624
|
return l(i, {
|
|
3623
3625
|
logger: e,
|
|
3624
3626
|
onSubmitSuccess: z.onSubmitSuccessFn$.value,
|
|
@@ -3643,27 +3645,27 @@ const Jt = 27, Zt = 12, Xt = 10, ds = Ce("enum"), fs = (e, t) => {
|
|
|
3643
3645
|
})
|
|
3644
3646
|
});
|
|
3645
3647
|
};
|
|
3646
|
-
var
|
|
3648
|
+
var Ns = function(e) {
|
|
3647
3649
|
return e instanceof RegExp;
|
|
3648
|
-
},
|
|
3650
|
+
}, Ts = function(t) {
|
|
3649
3651
|
var r = /[\\^$.*+?()[\]{}|]/g, n = RegExp(r.source);
|
|
3650
3652
|
return t && n.test(t) ? t.replace(r, "\\$&") : t;
|
|
3651
|
-
},
|
|
3653
|
+
}, _r = function(e) {
|
|
3652
3654
|
return typeof e == "string";
|
|
3653
|
-
},
|
|
3655
|
+
}, Ds = function(e) {
|
|
3654
3656
|
var t = [];
|
|
3655
3657
|
return e.forEach(function(r) {
|
|
3656
3658
|
Array.isArray(r) ? t = t.concat(r) : t.push(r);
|
|
3657
3659
|
}), t;
|
|
3658
3660
|
};
|
|
3659
|
-
function
|
|
3661
|
+
function Rs(e, t, r) {
|
|
3660
3662
|
var n = 0, s = 0;
|
|
3661
3663
|
if (e === "")
|
|
3662
3664
|
return e;
|
|
3663
|
-
if (!e || !
|
|
3665
|
+
if (!e || !_r(e))
|
|
3664
3666
|
throw new TypeError("First argument to react-string-replace#replaceString must be a string");
|
|
3665
3667
|
var a = t;
|
|
3666
|
-
|
|
3668
|
+
Ns(a) || (a = new RegExp("(" + Ts(a) + ")", "gi"));
|
|
3667
3669
|
for (var i = e.split(a), u = 1, d = i.length; u < d; u += 2) {
|
|
3668
3670
|
if (i[u] === void 0 || i[u - 1] === void 0) {
|
|
3669
3671
|
console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
|
|
@@ -3673,14 +3675,14 @@ function Ds(e, t, r) {
|
|
|
3673
3675
|
}
|
|
3674
3676
|
return i;
|
|
3675
3677
|
}
|
|
3676
|
-
var
|
|
3677
|
-
return Array.isArray(t) || (t = [t]),
|
|
3678
|
-
return
|
|
3678
|
+
var Os = function(t, r, n) {
|
|
3679
|
+
return Array.isArray(t) || (t = [t]), Ds(t.map(function(s) {
|
|
3680
|
+
return _r(s) ? Rs(s, r, n) : s;
|
|
3679
3681
|
}));
|
|
3680
3682
|
};
|
|
3681
|
-
const Fe = /* @__PURE__ */ rr(
|
|
3682
|
-
const t = Fe(e,
|
|
3683
|
-
const [, d, p] = i.match(
|
|
3683
|
+
const Fe = /* @__PURE__ */ rr(Os), Bs = /(\[[^\]]+\]\([^)]+\))/g, Ps = /\[([^\]]+)\]\(([^)]+)\)/, $s = /(https?:\/\/[^\s]+)/g, js = /_(.*?)_/g, zs = /\*\*(.*?)\*\*/g, Us = /\\n|\n/g, Yt = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", qs = (e) => {
|
|
3684
|
+
const t = Fe(e, Bs, (i, u) => {
|
|
3685
|
+
const [, d, p] = i.match(Ps) ?? [];
|
|
3684
3686
|
return p ? l("a", {
|
|
3685
3687
|
class: Yt,
|
|
3686
3688
|
href: p,
|
|
@@ -3688,17 +3690,17 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
|
|
|
3688
3690
|
}, p + u) : l("span", {
|
|
3689
3691
|
children: "INVALID LINK"
|
|
3690
3692
|
});
|
|
3691
|
-
}), r = Fe(t,
|
|
3693
|
+
}), r = Fe(t, $s, (i, u) => l("a", {
|
|
3692
3694
|
class: Yt,
|
|
3693
3695
|
href: i,
|
|
3694
3696
|
children: i
|
|
3695
|
-
}, i + u)), n = Fe(r,
|
|
3697
|
+
}, i + u)), n = Fe(r, js, (i, u) => l("em", {
|
|
3696
3698
|
children: i
|
|
3697
|
-
}, i + u)), s = Fe(n,
|
|
3699
|
+
}, i + u)), s = Fe(n, zs, (i, u) => l("strong", {
|
|
3698
3700
|
children: i
|
|
3699
3701
|
}, i + u));
|
|
3700
|
-
return Fe(s,
|
|
3701
|
-
},
|
|
3702
|
+
return Fe(s, Us, (i, u) => l("br", {}, `br-${u}`));
|
|
3703
|
+
}, Ks = Xe("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", {
|
|
3702
3704
|
variants: {
|
|
3703
3705
|
side: {
|
|
3704
3706
|
left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
|
|
@@ -3712,7 +3714,7 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
|
|
|
3712
3714
|
defaultVariants: {
|
|
3713
3715
|
side: "left"
|
|
3714
3716
|
}
|
|
3715
|
-
}),
|
|
3717
|
+
}), Gs = ({
|
|
3716
3718
|
children: e,
|
|
3717
3719
|
className: t,
|
|
3718
3720
|
animate: r,
|
|
@@ -3722,14 +3724,14 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
|
|
|
3722
3724
|
style: {
|
|
3723
3725
|
transformOrigin: n === "left" ? "0% 50%" : "100% 50%"
|
|
3724
3726
|
},
|
|
3725
|
-
class:
|
|
3727
|
+
class: Ks({
|
|
3726
3728
|
className: t,
|
|
3727
3729
|
side: n,
|
|
3728
3730
|
animate: r
|
|
3729
3731
|
}),
|
|
3730
3732
|
...s,
|
|
3731
3733
|
children: e
|
|
3732
|
-
}),
|
|
3734
|
+
}), Hs = ({
|
|
3733
3735
|
message: e
|
|
3734
3736
|
}) => l("div", {
|
|
3735
3737
|
class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
|
|
@@ -3753,7 +3755,7 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
|
|
|
3753
3755
|
})
|
|
3754
3756
|
})]
|
|
3755
3757
|
})
|
|
3756
|
-
}),
|
|
3758
|
+
}), Ws = ({
|
|
3757
3759
|
className: e,
|
|
3758
3760
|
...t
|
|
3759
3761
|
}) => (le(() => {
|
|
@@ -3773,10 +3775,10 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
|
|
|
3773
3775
|
}
|
|
3774
3776
|
}))
|
|
3775
3777
|
}) : void 0
|
|
3776
|
-
})),
|
|
3778
|
+
})), Js = {
|
|
3777
3779
|
bot: "left",
|
|
3778
3780
|
user: "right"
|
|
3779
|
-
},
|
|
3781
|
+
}, Zs = Xe("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)]", {
|
|
3780
3782
|
variants: {
|
|
3781
3783
|
variant: {
|
|
3782
3784
|
info: "text-neutral-8",
|
|
@@ -3785,7 +3787,7 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
|
|
|
3785
3787
|
success: "text-[#4CAF50]"
|
|
3786
3788
|
}
|
|
3787
3789
|
}
|
|
3788
|
-
}),
|
|
3790
|
+
}), Xs = ({
|
|
3789
3791
|
lastSentMessageFooter: e
|
|
3790
3792
|
}) => {
|
|
3791
3793
|
var r;
|
|
@@ -3801,7 +3803,7 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
|
|
|
3801
3803
|
children: Ge(n).with({
|
|
3802
3804
|
type: "system"
|
|
3803
3805
|
}, (a) => l("p", {
|
|
3804
|
-
class:
|
|
3806
|
+
class: Zs({
|
|
3805
3807
|
variant: a.variant
|
|
3806
3808
|
}),
|
|
3807
3809
|
children: a.text
|
|
@@ -3809,17 +3811,17 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
|
|
|
3809
3811
|
type: "text",
|
|
3810
3812
|
author: T.union("bot", "user")
|
|
3811
3813
|
}, (a) => {
|
|
3812
|
-
const i = a.author === "user" && !t.slice(s + 1).some((p) => p.type === "text" && p.author === "user"), u = s === t.length - 1, d = a.author === "bot" ?
|
|
3814
|
+
const i = a.author === "user" && !t.slice(s + 1).some((p) => p.type === "text" && p.author === "user"), u = s === t.length - 1, d = a.author === "bot" ? qs(a.text) : a.text;
|
|
3813
3815
|
return l(ve, {
|
|
3814
|
-
children: [i ? e : null, l(
|
|
3816
|
+
children: [i ? e : null, l(Gs, {
|
|
3815
3817
|
animate: u,
|
|
3816
|
-
side:
|
|
3818
|
+
side: Js[a.author],
|
|
3817
3819
|
children: d
|
|
3818
3820
|
}, s)]
|
|
3819
3821
|
});
|
|
3820
3822
|
}).with({
|
|
3821
3823
|
type: "link"
|
|
3822
|
-
}, (a) => l(
|
|
3824
|
+
}, (a) => l(Hs, {
|
|
3823
3825
|
message: a
|
|
3824
3826
|
})).with({
|
|
3825
3827
|
type: "image"
|
|
@@ -3831,7 +3833,7 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
|
|
|
3831
3833
|
}
|
|
3832
3834
|
})).with({
|
|
3833
3835
|
type: "file"
|
|
3834
|
-
}, (a) => l(
|
|
3836
|
+
}, (a) => l(Pn, {
|
|
3835
3837
|
class: a.author === "bot" ? void 0 : "ml-auto",
|
|
3836
3838
|
file: {
|
|
3837
3839
|
name: a.fileName,
|
|
@@ -3843,15 +3845,15 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
|
|
|
3843
3845
|
const i = t[t.length - 1];
|
|
3844
3846
|
return !(a === i) || z.isBotTyping$.value ? null : l("div", {
|
|
3845
3847
|
class: "flex flex-grow flex-col items-center justify-center",
|
|
3846
|
-
children: l(
|
|
3848
|
+
children: l(Wr, {
|
|
3847
3849
|
class: "text-neutral-6 h-8 w-8"
|
|
3848
3850
|
})
|
|
3849
3851
|
});
|
|
3850
3852
|
}).exhaustive()
|
|
3851
3853
|
})
|
|
3852
|
-
}, s)), l(
|
|
3854
|
+
}, s)), l(Ws, {}, "typing")]
|
|
3853
3855
|
});
|
|
3854
|
-
},
|
|
3856
|
+
}, ia = ({
|
|
3855
3857
|
logger: e,
|
|
3856
3858
|
apiClient: t,
|
|
3857
3859
|
analytics: r
|
|
@@ -3863,7 +3865,7 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
|
|
|
3863
3865
|
const s = I.viewState$.value, {
|
|
3864
3866
|
chatRef: a,
|
|
3865
3867
|
chatService: i
|
|
3866
|
-
} =
|
|
3868
|
+
} = Cn(), {
|
|
3867
3869
|
t: u
|
|
3868
3870
|
} = G(), [d, p] = ee();
|
|
3869
3871
|
return pe(() => {
|
|
@@ -3892,9 +3894,9 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
|
|
|
3892
3894
|
})) : I.removeMessagesSentByNodeIds([h]);
|
|
3893
3895
|
const {
|
|
3894
3896
|
interpret: _,
|
|
3895
|
-
abort:
|
|
3897
|
+
abort: y,
|
|
3896
3898
|
undo: A
|
|
3897
|
-
} =
|
|
3899
|
+
} = Qr({
|
|
3898
3900
|
context: n.context,
|
|
3899
3901
|
analytics: {
|
|
3900
3902
|
service: r,
|
|
@@ -3928,7 +3930,7 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
|
|
|
3928
3930
|
});
|
|
3929
3931
|
}
|
|
3930
3932
|
});
|
|
3931
|
-
return p(() => A), _(h),
|
|
3933
|
+
return p(() => A), _(h), y;
|
|
3932
3934
|
}, [r, t, i, e, n, u]), l(ve, {
|
|
3933
3935
|
children: [l("div", {
|
|
3934
3936
|
ref: a,
|
|
@@ -3937,22 +3939,22 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
|
|
|
3937
3939
|
WebkitOverflowScrolling: "touch",
|
|
3938
3940
|
paddingBottom: I.inputHeight$.value
|
|
3939
3941
|
},
|
|
3940
|
-
children: l(
|
|
3941
|
-
lastSentMessageFooter: n.data.isFinished || !d ? null : l(
|
|
3942
|
+
children: l(Xs, {
|
|
3943
|
+
lastSentMessageFooter: n.data.isFinished || !d ? null : l(Ys, {
|
|
3942
3944
|
undoFn: d
|
|
3943
3945
|
})
|
|
3944
3946
|
})
|
|
3945
|
-
}), l(
|
|
3947
|
+
}), l(Ls, {
|
|
3946
3948
|
logger: e
|
|
3947
3949
|
})]
|
|
3948
3950
|
});
|
|
3949
|
-
},
|
|
3951
|
+
}, Qs = (e) => e.type === "identify" ? [] : "key" in e.data && e.data.key ? [e.data.key] : "keys" in e.data ? Object.values(e.data.keys).filter((t) => typeof t == "string") : [], Ys = ({
|
|
3950
3952
|
undoFn: e
|
|
3951
3953
|
}) => {
|
|
3952
3954
|
const {
|
|
3953
3955
|
t
|
|
3954
3956
|
} = G();
|
|
3955
|
-
return l(
|
|
3957
|
+
return l(Jr, {
|
|
3956
3958
|
onClick: async () => {
|
|
3957
3959
|
const {
|
|
3958
3960
|
flow: r
|
|
@@ -3961,7 +3963,7 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
|
|
|
3961
3963
|
const {
|
|
3962
3964
|
removed: n
|
|
3963
3965
|
} = e(r.data.nodeHistory), s = r.data.nodeHistory.splice(-n);
|
|
3964
|
-
s.length !== 0 && (I.removeMessagesSentByNodeIds(s), I.setInput(void 0), s.pop(), s.map((a) => r.nodes.find((i) => i.id === a)).filter(Boolean).flatMap(
|
|
3966
|
+
s.length !== 0 && (I.removeMessagesSentByNodeIds(s), I.setInput(void 0), s.pop(), s.map((a) => r.nodes.find((i) => i.id === a)).filter(Boolean).flatMap(Qs).forEach((a) => delete r.data.submissions[a]), I.current$.value = {
|
|
3965
3967
|
...I.current$.value
|
|
3966
3968
|
});
|
|
3967
3969
|
},
|
|
@@ -3973,5 +3975,5 @@ const Fe = /* @__PURE__ */ rr(Rs), Os = /(\[[^\]]+\]\([^)]+\))/g, Bs = /\[([^\]]
|
|
|
3973
3975
|
});
|
|
3974
3976
|
};
|
|
3975
3977
|
export {
|
|
3976
|
-
|
|
3978
|
+
ia as ChatbotBody
|
|
3977
3979
|
};
|