@inploi/plugin-chatbot 14.6.0 → 14.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.js +5 -5
- package/dist/{chatbot-body-fdff9162.js → chatbot-body-8d36637a.js} +1101 -1094
- package/dist/chatbot-body-95e99884.cjs +5 -0
- package/dist/chatbot.idb.d.ts +1 -0
- package/dist/chatbot.state.d.ts +9 -4
- package/dist/i18n.d.ts +6 -6
- package/dist/index-51cb9a4f.cjs +5 -0
- package/dist/{index-aa94ec24.js → index-8090d2e3.js} +736 -735
- package/dist/interpreter.d.ts +2 -0
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/package.json +4 -4
- package/dist/chatbot-body-15318a9d.cjs +0 -5
- package/dist/index-ff2885b1.cjs +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as yr, Z as
|
|
1
|
+
import { W as yr, Z as ot, P as wt, Y as Ge, t as mr, g as gr, a as Ct, A as ss, Q as ns, I as as, j as br, _ as is, J as os, n as ls, C as $t, V as us, u as se, o as u, c as Oe, b as lt, h as ve, d as pe, i as Me, y as Ie, k as we, L as St, F as cs, s as $, p as vr, e as xr, f as ds, l as Re, X as qt, m as Q, q as ie, M as fs, z as ps, r as hs, S as wr, v as ys } from "./index-8090d2e3.js";
|
|
2
2
|
import { isApiErrorWithData as ms, ApiError as gs } from "@inploi/sdk";
|
|
3
3
|
const Ut = (e, r, t) => {
|
|
4
4
|
var s;
|
|
@@ -16,15 +16,15 @@ const Ut = (e, r, t) => {
|
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
18
|
var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
19
|
-
let [
|
|
20
|
-
if (!
|
|
19
|
+
let [a, ...i] = e.compareKey.split(".");
|
|
20
|
+
if (!a)
|
|
21
21
|
return !1;
|
|
22
|
-
let n = yr({ context: r, key:
|
|
22
|
+
let n = yr({ context: r, key: a, path: i, submissions: t });
|
|
23
23
|
if (!n)
|
|
24
24
|
return !1;
|
|
25
25
|
switch (n.type) {
|
|
26
26
|
case "address": {
|
|
27
|
-
let o =
|
|
27
|
+
let o = wt(n.value, i);
|
|
28
28
|
switch (e.compare) {
|
|
29
29
|
case "equals":
|
|
30
30
|
return o === e.compareValue;
|
|
@@ -40,16 +40,16 @@ var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
|
40
40
|
case "integration": {
|
|
41
41
|
if (typeof n.value != "object" || Array.isArray(n.value))
|
|
42
42
|
return !1;
|
|
43
|
-
let o =
|
|
43
|
+
let o = wt(n.value, i), c = { ...s, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
|
|
44
44
|
switch (typeof o) {
|
|
45
45
|
case "boolean":
|
|
46
|
-
return
|
|
46
|
+
return Ke(c, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
|
|
47
47
|
case "string":
|
|
48
|
-
return
|
|
48
|
+
return Ke(c, { submissions: { _temp: { value: o, type: "string" } }, context: r });
|
|
49
49
|
case "number":
|
|
50
|
-
return
|
|
50
|
+
return Ke(c, { submissions: { _temp: { value: o, type: "number" } }, context: r });
|
|
51
51
|
case "object":
|
|
52
|
-
return Array.isArray(o) && o.every((
|
|
52
|
+
return Array.isArray(o) && o.every((p) => typeof p == "string") ? Ke(c, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
|
|
53
53
|
}
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
@@ -65,7 +65,7 @@ var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
|
65
65
|
}
|
|
66
66
|
case "phone":
|
|
67
67
|
case "string": {
|
|
68
|
-
let o = n.type === "phone" ?
|
|
68
|
+
let o = n.type === "phone" ? ot(n.value) : n.value;
|
|
69
69
|
switch (e.compare) {
|
|
70
70
|
case "equals":
|
|
71
71
|
return o === e.compareValue;
|
|
@@ -113,56 +113,56 @@ var zt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
|
113
113
|
}
|
|
114
114
|
break;
|
|
115
115
|
}
|
|
116
|
-
},
|
|
116
|
+
}, Ke = (e, { context: r, submissions: t }) => {
|
|
117
117
|
let s = "combinator" in e.data ? e.data.conditions : [e.data];
|
|
118
118
|
if (("combinator" in e.data ? e.data.combinator : "and") === "or") {
|
|
119
|
-
for (let
|
|
120
|
-
if (zt({ condition:
|
|
119
|
+
for (let a of s)
|
|
120
|
+
if (zt({ condition: a, context: r, submissions: t, ifBlock: e }))
|
|
121
121
|
return !0;
|
|
122
122
|
return !1;
|
|
123
123
|
} else {
|
|
124
|
-
for (let
|
|
125
|
-
if (!zt({ condition:
|
|
124
|
+
for (let a of s)
|
|
125
|
+
if (!zt({ condition: a, context: r, submissions: t, ifBlock: e }))
|
|
126
126
|
return !1;
|
|
127
127
|
return !0;
|
|
128
128
|
}
|
|
129
|
-
}, bs = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, vs = (e, { context: r, submissions: t }) => e.replace(bs, (s,
|
|
130
|
-
let [n, ...o] =
|
|
129
|
+
}, bs = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, vs = (e, { context: r, submissions: t }) => e.replace(bs, (s, a, i = "") => {
|
|
130
|
+
let [n, ...o] = a.trim().split("."), c = yr({ key: n, path: o, submissions: t, context: r });
|
|
131
131
|
if (!c)
|
|
132
|
-
return
|
|
132
|
+
return i;
|
|
133
133
|
switch (c.type) {
|
|
134
134
|
case "boolean":
|
|
135
135
|
return c.value === !0 ? "true" : "false";
|
|
136
136
|
case "file":
|
|
137
|
-
return c.value.map((
|
|
137
|
+
return c.value.map((p) => `${p.name} (${Ge(p.sizeKb)})`).join(", ");
|
|
138
138
|
case "enum":
|
|
139
139
|
return c.value.join(", ");
|
|
140
140
|
case "address":
|
|
141
|
-
return Object.values(c.value).filter((
|
|
141
|
+
return Object.values(c.value).filter((p) => p && p.trim().length > 0).join(", ");
|
|
142
142
|
case "number":
|
|
143
143
|
case "string":
|
|
144
|
-
return c.value ? c.value.toString() :
|
|
144
|
+
return c.value ? c.value.toString() : i;
|
|
145
145
|
case "phone":
|
|
146
|
-
return
|
|
146
|
+
return ot(c.value);
|
|
147
147
|
case "integration": {
|
|
148
148
|
if (typeof c.value != "object" || Array.isArray(c.value))
|
|
149
149
|
break;
|
|
150
|
-
let
|
|
151
|
-
switch (typeof
|
|
150
|
+
let p = wt(c.value, o);
|
|
151
|
+
switch (typeof p) {
|
|
152
152
|
case "boolean":
|
|
153
|
-
return
|
|
153
|
+
return p === !0 ? "true" : "false";
|
|
154
154
|
case "string":
|
|
155
|
-
return
|
|
155
|
+
return p;
|
|
156
156
|
case "number":
|
|
157
|
-
return
|
|
157
|
+
return p.toString();
|
|
158
158
|
case "object":
|
|
159
|
-
if (Array.isArray(
|
|
160
|
-
return
|
|
159
|
+
if (Array.isArray(p) && p.every((b) => typeof b == "string"))
|
|
160
|
+
return p.join(", ");
|
|
161
161
|
}
|
|
162
162
|
break;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
return
|
|
165
|
+
return i;
|
|
166
166
|
});
|
|
167
167
|
const _r = ({
|
|
168
168
|
context: e,
|
|
@@ -170,14 +170,14 @@ const _r = ({
|
|
|
170
170
|
}) => ({
|
|
171
171
|
context: e,
|
|
172
172
|
submissions: r ?? {}
|
|
173
|
-
}), he = (e, r) => vs(e, _r(r)), xs = (e, r) =>
|
|
173
|
+
}), he = (e, r) => vs(e, _r(r)), xs = (e, r) => Ke(e, _r(r)), kr = ({
|
|
174
174
|
node: e,
|
|
175
175
|
nodes: r,
|
|
176
176
|
stopWhen: t
|
|
177
177
|
}) => {
|
|
178
178
|
if ((t == null ? void 0 : t(e)) === !0)
|
|
179
179
|
return e;
|
|
180
|
-
const s = e.nextId ? r.find((
|
|
180
|
+
const s = e.nextId ? r.find((a) => a.id === e.nextId) : void 0;
|
|
181
181
|
if (s)
|
|
182
182
|
return kr({
|
|
183
183
|
node: s,
|
|
@@ -188,35 +188,35 @@ const _r = ({
|
|
|
188
188
|
childNode: e,
|
|
189
189
|
nodes: r
|
|
190
190
|
}) => {
|
|
191
|
-
const s = r.filter((
|
|
192
|
-
if (!
|
|
191
|
+
const s = r.filter((a) => a.type === "if-block").find((a) => {
|
|
192
|
+
if (!a.branchId)
|
|
193
193
|
return !1;
|
|
194
|
-
const
|
|
195
|
-
if (!
|
|
194
|
+
const i = r.find((o) => o.id === a.branchId);
|
|
195
|
+
if (!i)
|
|
196
196
|
return !1;
|
|
197
197
|
const n = kr({
|
|
198
|
-
node:
|
|
198
|
+
node: i,
|
|
199
199
|
nodes: r,
|
|
200
200
|
stopWhen: (o) => o.id === e.id
|
|
201
201
|
});
|
|
202
202
|
return !(!n || n.id !== e.id);
|
|
203
203
|
});
|
|
204
204
|
if (s != null && s.nextId)
|
|
205
|
-
return r.find((
|
|
205
|
+
return r.find((a) => a.id === s.nextId);
|
|
206
206
|
}, _s = ({
|
|
207
207
|
flow: e,
|
|
208
208
|
analytics: r,
|
|
209
209
|
logger: t,
|
|
210
210
|
talentBankClient: s,
|
|
211
|
-
context:
|
|
212
|
-
apiClient:
|
|
211
|
+
context: a,
|
|
212
|
+
apiClient: i,
|
|
213
213
|
getSubmissions: n,
|
|
214
214
|
getApplicationRecovery: o,
|
|
215
215
|
setApplicationRecovery: c,
|
|
216
|
-
chatService:
|
|
216
|
+
chatService: p,
|
|
217
217
|
persistWriteBarrier: b,
|
|
218
218
|
onFlowEnd: x,
|
|
219
|
-
onInterpret:
|
|
219
|
+
onInterpret: h,
|
|
220
220
|
t: m
|
|
221
221
|
}) => {
|
|
222
222
|
var I;
|
|
@@ -237,77 +237,77 @@ const _r = ({
|
|
|
237
237
|
...r.customProperties
|
|
238
238
|
}
|
|
239
239
|
})
|
|
240
|
-
},
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
240
|
+
}, V = async (y, _) => {
|
|
241
|
+
const F = C.signal;
|
|
242
|
+
if (F.aborted)
|
|
243
243
|
return;
|
|
244
|
-
const M = n(), O = o(), G = (O == null ? void 0 : O.submitNodeId) === y.id ? e.nodes.find((
|
|
244
|
+
const M = n(), O = o(), G = (O == null ? void 0 : O.submitNodeId) === y.id ? e.nodes.find((L) => {
|
|
245
245
|
var U;
|
|
246
|
-
return
|
|
246
|
+
return L.id === O.fileQuestionNodeId && L.type === "question-file" && ((U = M == null ? void 0 : M[L.data.key]) == null ? void 0 : U.type) !== "file";
|
|
247
247
|
}) : void 0;
|
|
248
248
|
if (G)
|
|
249
|
-
return
|
|
250
|
-
|
|
249
|
+
return V(G, _);
|
|
250
|
+
h == null || h(y, _);
|
|
251
251
|
try {
|
|
252
252
|
await ks({
|
|
253
253
|
flow: e,
|
|
254
254
|
analytics: E,
|
|
255
255
|
logger: t,
|
|
256
256
|
talentBankClient: s,
|
|
257
|
-
apiClient:
|
|
258
|
-
context:
|
|
257
|
+
apiClient: i,
|
|
258
|
+
context: a,
|
|
259
259
|
node: y,
|
|
260
260
|
submissions: M,
|
|
261
261
|
applicationRecovery: O,
|
|
262
|
-
setApplicationRecovery: async (
|
|
263
|
-
if (!
|
|
262
|
+
setApplicationRecovery: async (L) => {
|
|
263
|
+
if (!F.aborted)
|
|
264
264
|
try {
|
|
265
|
-
await c(
|
|
265
|
+
await c(L);
|
|
266
266
|
} catch (U) {
|
|
267
267
|
t.error("Failed to persist application recovery", U);
|
|
268
268
|
}
|
|
269
269
|
},
|
|
270
270
|
forceSubmitConfirmation: (O == null ? void 0 : O.submitNodeId) === y.id,
|
|
271
271
|
persistWriteBarrier: b,
|
|
272
|
-
signal:
|
|
272
|
+
signal: F,
|
|
273
273
|
t: m,
|
|
274
274
|
chat: {
|
|
275
|
-
sendMessage: async (
|
|
275
|
+
sendMessage: async (L) => p.send({
|
|
276
276
|
groupId: y.id,
|
|
277
|
-
message:
|
|
278
|
-
signal:
|
|
277
|
+
message: L,
|
|
278
|
+
signal: F
|
|
279
279
|
}),
|
|
280
|
-
userInput: async (
|
|
281
|
-
input:
|
|
282
|
-
signal:
|
|
280
|
+
userInput: async (L) => p.input({
|
|
281
|
+
input: L,
|
|
282
|
+
signal: F
|
|
283
283
|
}),
|
|
284
|
-
setSubmission: (
|
|
285
|
-
|
|
284
|
+
setSubmission: (L, U) => {
|
|
285
|
+
F.aborted || p.setSubmission(L, U);
|
|
286
286
|
}
|
|
287
287
|
},
|
|
288
|
-
next: (
|
|
289
|
-
if (
|
|
288
|
+
next: (L) => {
|
|
289
|
+
if (F.aborted)
|
|
290
290
|
return;
|
|
291
|
-
const U = (O == null ? void 0 : O.fileQuestionNodeId) === y.id ? O.submitNodeId :
|
|
291
|
+
const U = (O == null ? void 0 : O.fileQuestionNodeId) === y.id ? O.submitNodeId : L, D = U ? e.nodes.find((T) => T.id === U) : ws({
|
|
292
292
|
childNode: y,
|
|
293
293
|
nodes: e.nodes
|
|
294
294
|
});
|
|
295
|
-
return
|
|
295
|
+
return D ? V(D, y) : x == null ? void 0 : x(y);
|
|
296
296
|
},
|
|
297
297
|
end: () => {
|
|
298
|
-
|
|
298
|
+
F.aborted || x == null || x(y);
|
|
299
299
|
}
|
|
300
300
|
});
|
|
301
|
-
} catch (
|
|
302
|
-
if (
|
|
301
|
+
} catch (L) {
|
|
302
|
+
if (L instanceof ss)
|
|
303
303
|
return;
|
|
304
|
-
throw
|
|
304
|
+
throw L;
|
|
305
305
|
}
|
|
306
306
|
};
|
|
307
307
|
return {
|
|
308
308
|
interpret: async (y) => {
|
|
309
|
-
const _ = e.nodes.find((
|
|
310
|
-
return
|
|
309
|
+
const _ = e.nodes.find((F) => F.id === y) ?? gr(e.nodes);
|
|
310
|
+
return V(_);
|
|
311
311
|
},
|
|
312
312
|
undo: (y) => {
|
|
313
313
|
var U;
|
|
@@ -315,23 +315,23 @@ const _r = ({
|
|
|
315
315
|
return {
|
|
316
316
|
removed: 0
|
|
317
317
|
};
|
|
318
|
-
const _ =
|
|
319
|
-
if (
|
|
318
|
+
const _ = Ct(e), F = _ ? y.lastIndexOf(_) : -1, M = e.nodes.find((D) => D.id === _);
|
|
319
|
+
if (F === -1 || !M)
|
|
320
320
|
return {
|
|
321
321
|
removed: 0
|
|
322
322
|
};
|
|
323
|
-
const O = e.nodes.find((
|
|
323
|
+
const O = e.nodes.find((D) => D.id === y[y.length - 1]);
|
|
324
324
|
C.abort();
|
|
325
|
-
const G = y.splice(
|
|
326
|
-
e.data.messages = e.data.messages.filter((
|
|
327
|
-
const
|
|
328
|
-
for (const
|
|
329
|
-
const
|
|
330
|
-
if (!(!
|
|
331
|
-
for (const w of Object.values(
|
|
332
|
-
typeof w == "string" && delete
|
|
325
|
+
const G = y.splice(F);
|
|
326
|
+
e.data.messages = e.data.messages.filter((D) => !D.groupId || !G.includes(D.groupId)), e.data.currentInput = null;
|
|
327
|
+
const L = n();
|
|
328
|
+
for (const D of G.slice(1)) {
|
|
329
|
+
const T = e.nodes.find((w) => w.id === D);
|
|
330
|
+
if (!(!T || !L || T.id === _) && ("key" in T.data && T.data.key && delete L[T.data.key], "keys" in T.data))
|
|
331
|
+
for (const w of Object.values(T.data.keys))
|
|
332
|
+
typeof w == "string" && delete L[w];
|
|
333
333
|
}
|
|
334
|
-
return C = new AbortController(),
|
|
334
|
+
return C = new AbortController(), V(M, O), {
|
|
335
335
|
removed: G.length
|
|
336
336
|
};
|
|
337
337
|
},
|
|
@@ -350,57 +350,57 @@ async function ks(e) {
|
|
|
350
350
|
text: r.data.title
|
|
351
351
|
}), e.next(r.nextId);
|
|
352
352
|
case "pre-apply-result":
|
|
353
|
-
return
|
|
353
|
+
return Ks({
|
|
354
354
|
...e,
|
|
355
355
|
node: r
|
|
356
356
|
});
|
|
357
357
|
case "text":
|
|
358
|
-
return
|
|
358
|
+
return Os({
|
|
359
359
|
...e,
|
|
360
360
|
node: r
|
|
361
361
|
});
|
|
362
362
|
case "image":
|
|
363
|
-
return
|
|
363
|
+
return Rs({
|
|
364
364
|
...e,
|
|
365
365
|
node: r
|
|
366
366
|
});
|
|
367
367
|
case "question-text":
|
|
368
|
-
return
|
|
368
|
+
return Ps({
|
|
369
369
|
...e,
|
|
370
370
|
node: r
|
|
371
371
|
});
|
|
372
372
|
case "question-enum":
|
|
373
|
-
return
|
|
373
|
+
return $s({
|
|
374
374
|
...e,
|
|
375
375
|
node: r
|
|
376
376
|
});
|
|
377
377
|
case "question-number":
|
|
378
|
-
return
|
|
378
|
+
return Bs({
|
|
379
379
|
...e,
|
|
380
380
|
node: r
|
|
381
381
|
});
|
|
382
382
|
case "question-phone":
|
|
383
|
-
return
|
|
383
|
+
return js({
|
|
384
384
|
...e,
|
|
385
385
|
node: r
|
|
386
386
|
});
|
|
387
387
|
case "question-boolean":
|
|
388
|
-
return
|
|
388
|
+
return qs({
|
|
389
389
|
...e,
|
|
390
390
|
node: r
|
|
391
391
|
});
|
|
392
392
|
case "question-file":
|
|
393
|
-
return
|
|
393
|
+
return zs({
|
|
394
394
|
...e,
|
|
395
395
|
node: r
|
|
396
396
|
});
|
|
397
397
|
case "question-address":
|
|
398
|
-
return
|
|
398
|
+
return Us({
|
|
399
399
|
...e,
|
|
400
400
|
node: r
|
|
401
401
|
});
|
|
402
402
|
case "end-flow":
|
|
403
|
-
return
|
|
403
|
+
return Ws({
|
|
404
404
|
...e,
|
|
405
405
|
node: r
|
|
406
406
|
});
|
|
@@ -415,17 +415,17 @@ async function ks(e) {
|
|
|
415
415
|
node: r
|
|
416
416
|
});
|
|
417
417
|
case "link":
|
|
418
|
-
return
|
|
418
|
+
return Ds({
|
|
419
419
|
...e,
|
|
420
420
|
node: r
|
|
421
421
|
});
|
|
422
422
|
case "integration-application-submit":
|
|
423
|
-
return
|
|
423
|
+
return Ls({
|
|
424
424
|
...e,
|
|
425
425
|
node: r
|
|
426
426
|
});
|
|
427
427
|
case "add-submission":
|
|
428
|
-
return
|
|
428
|
+
return As({
|
|
429
429
|
...e,
|
|
430
430
|
node: r
|
|
431
431
|
});
|
|
@@ -456,8 +456,8 @@ async function Ss({
|
|
|
456
456
|
node: r,
|
|
457
457
|
talentBankClient: t,
|
|
458
458
|
submissions: s,
|
|
459
|
-
flow:
|
|
460
|
-
logger:
|
|
459
|
+
flow: a,
|
|
460
|
+
logger: i,
|
|
461
461
|
chat: n
|
|
462
462
|
}) {
|
|
463
463
|
var c;
|
|
@@ -465,19 +465,19 @@ async function Ss({
|
|
|
465
465
|
isDuplicate: !1
|
|
466
466
|
};
|
|
467
467
|
if (s && t) {
|
|
468
|
-
const
|
|
469
|
-
if (r.data.scope === "company" ||
|
|
468
|
+
const p = r.data.scope === "job" ? (c = a.job) == null ? void 0 : c.id : void 0;
|
|
469
|
+
if (r.data.scope === "company" || p != null)
|
|
470
470
|
try {
|
|
471
471
|
o = await t.checkDuplicate({
|
|
472
472
|
email: ns({
|
|
473
473
|
key: r.data.email,
|
|
474
474
|
submissions: s
|
|
475
475
|
}).toString(),
|
|
476
|
-
jobId:
|
|
476
|
+
jobId: p,
|
|
477
477
|
scope: r.data.scope
|
|
478
478
|
});
|
|
479
479
|
} catch (b) {
|
|
480
|
-
|
|
480
|
+
i.error("[check-duplicate]", b);
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
n.setSubmission(r.data.key, {
|
|
@@ -491,12 +491,12 @@ async function Is({
|
|
|
491
491
|
}) {
|
|
492
492
|
e(r.data.targetId);
|
|
493
493
|
}
|
|
494
|
-
async function
|
|
494
|
+
async function As({
|
|
495
495
|
next: e,
|
|
496
496
|
node: r,
|
|
497
497
|
logger: t,
|
|
498
498
|
submissions: s,
|
|
499
|
-
context:
|
|
499
|
+
context: a
|
|
500
500
|
}) {
|
|
501
501
|
if (!s) {
|
|
502
502
|
t.error("Submissions not found");
|
|
@@ -506,59 +506,59 @@ async function Fs({
|
|
|
506
506
|
type: "string",
|
|
507
507
|
value: he(r.data.value, {
|
|
508
508
|
submissions: s,
|
|
509
|
-
context:
|
|
509
|
+
context: a
|
|
510
510
|
})
|
|
511
511
|
}, e(r.nextId);
|
|
512
512
|
}
|
|
513
|
-
const
|
|
513
|
+
const Fs = 5e3, Cr = 3e4, Vs = 2e4, Ms = 6e4, Sr = 12e4, Es = 60 * 6e4, Ns = (e, r, t) => {
|
|
514
514
|
if (!((t == null ? void 0 : t.retryable) === !0 && (t.providerStatus === 429 || t.providerStatus !== void 0 && t.providerStatus >= 500 || t.phase === "workflow" && t.verdict === "not_submitted")))
|
|
515
515
|
return {
|
|
516
516
|
key: e,
|
|
517
517
|
until: Date.now() + Cr
|
|
518
518
|
};
|
|
519
|
-
const
|
|
519
|
+
const a = ((r == null ? void 0 : r.throttles) ?? 0) + 1, i = Math.min(a * Vs, Ms), n = (t.retryAfterSeconds ?? 0) * 1e3;
|
|
520
520
|
return {
|
|
521
521
|
key: e,
|
|
522
|
-
until: Date.now() + Math.min(Math.max(
|
|
523
|
-
throttles:
|
|
522
|
+
until: Date.now() + Math.min(Math.max(i, n), Sr),
|
|
523
|
+
throttles: a
|
|
524
524
|
};
|
|
525
525
|
};
|
|
526
|
-
async function
|
|
526
|
+
async function Ls({
|
|
527
527
|
chat: e,
|
|
528
528
|
next: r,
|
|
529
529
|
end: t,
|
|
530
530
|
node: s,
|
|
531
|
-
logger:
|
|
532
|
-
apiClient:
|
|
531
|
+
logger: a,
|
|
532
|
+
apiClient: i,
|
|
533
533
|
submissions: n,
|
|
534
534
|
analytics: o,
|
|
535
535
|
flow: c,
|
|
536
|
-
applicationRecovery:
|
|
536
|
+
applicationRecovery: p,
|
|
537
537
|
setApplicationRecovery: b,
|
|
538
538
|
forceSubmitConfirmation: x,
|
|
539
|
-
persistWriteBarrier:
|
|
539
|
+
persistWriteBarrier: h,
|
|
540
540
|
signal: m,
|
|
541
541
|
t: C
|
|
542
542
|
}) {
|
|
543
543
|
var I;
|
|
544
|
-
if ((I = c.data.startedWriteNodeIds) != null && I.includes(s.id) && (
|
|
544
|
+
if ((I = c.data.startedWriteNodeIds) != null && I.includes(s.id) && (p == null ? void 0 : p.submitNodeId) !== s.id)
|
|
545
545
|
return await e.sendMessage({
|
|
546
546
|
type: "system",
|
|
547
547
|
variant: "warning",
|
|
548
548
|
text: C("submission_unknown")
|
|
549
549
|
}), t();
|
|
550
|
-
const E = c.job ? `${s.id}@${c.job.id_type}:${c.job.id}` : s.id,
|
|
551
|
-
var
|
|
552
|
-
const _ = ((
|
|
550
|
+
const E = c.job ? `${s.id}@${c.job.id_type}:${c.job.id}` : s.id, V = async (y) => {
|
|
551
|
+
var Be, je, et, $e, tt, qe, rt;
|
|
552
|
+
const _ = ((Be = c.data.submitCooldown) == null ? void 0 : Be.key) === E ? c.data.submitCooldown : void 0;
|
|
553
553
|
_ && (_.until = Math.min(_.until, Date.now() + (_.throttles ? Sr : Cr)));
|
|
554
|
-
const
|
|
555
|
-
(y !== !0 ||
|
|
554
|
+
const F = _ == null ? void 0 : _.until;
|
|
555
|
+
(y !== !0 || F !== void 0 && F > Date.now()) && await e.userInput({
|
|
556
556
|
type: "submit",
|
|
557
557
|
key: void 0,
|
|
558
558
|
config: {
|
|
559
559
|
label: s.data.submitLabel,
|
|
560
|
-
...
|
|
561
|
-
availableAt:
|
|
560
|
+
...F !== void 0 && {
|
|
561
|
+
availableAt: F
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
564
|
}), await e.sendMessage({
|
|
@@ -571,12 +571,12 @@ async function Ns({
|
|
|
571
571
|
} = o.getSessionInfo();
|
|
572
572
|
if (m.aborted)
|
|
573
573
|
return;
|
|
574
|
-
const G = ((
|
|
575
|
-
if ((
|
|
574
|
+
const G = ((je = c.data.startedWriteNodeIds) == null ? void 0 : je.includes(s.id)) === !0;
|
|
575
|
+
if ((p == null ? void 0 : p.submitNodeId) === s.id && await b(void 0), G || (c.data.startedWriteNodeIds = [...c.data.startedWriteNodeIds ?? [], s.id]), await h().catch((B) => a.error("Failed to persist application write barrier", B)), m.aborted)
|
|
576
576
|
return;
|
|
577
|
-
let
|
|
577
|
+
let L;
|
|
578
578
|
const U = setTimeout(() => {
|
|
579
|
-
|
|
579
|
+
L = (async () => {
|
|
580
580
|
await e.sendMessage({
|
|
581
581
|
type: "text",
|
|
582
582
|
author: "bot",
|
|
@@ -585,10 +585,10 @@ async function Ns({
|
|
|
585
585
|
type: "loading",
|
|
586
586
|
text: C("submitting")
|
|
587
587
|
});
|
|
588
|
-
})().catch((
|
|
589
|
-
},
|
|
590
|
-
let
|
|
591
|
-
const
|
|
588
|
+
})().catch((B) => a.error("Failed to send submission progress message", B));
|
|
589
|
+
}, Fs);
|
|
590
|
+
let D;
|
|
591
|
+
const T = await i.fetch("/flow/submit", {
|
|
592
592
|
method: "POST",
|
|
593
593
|
body: JSON.stringify({
|
|
594
594
|
log_submit: !1,
|
|
@@ -597,56 +597,60 @@ async function Ns({
|
|
|
597
597
|
session_id: O,
|
|
598
598
|
job: c.job,
|
|
599
599
|
flow_build: c.build,
|
|
600
|
-
submissions:
|
|
600
|
+
submissions: is(c.nodes, os(n || {}, s.data.submitKeys)),
|
|
601
601
|
pre_apply: br(c.nodes, n || {}, c.data.flowSessionId)
|
|
602
602
|
})
|
|
603
|
-
}).catch((
|
|
604
|
-
if (clearTimeout(U), await
|
|
603
|
+
}).catch((B) => (D = B, ms(B) ? B.data : B));
|
|
604
|
+
if (clearTimeout(U), await L, m.aborted)
|
|
605
605
|
return;
|
|
606
606
|
s.data.key && e.setSubmission(s.data.key, {
|
|
607
607
|
type: "integration",
|
|
608
|
-
value:
|
|
608
|
+
value: T
|
|
609
609
|
});
|
|
610
|
-
const w = mr(
|
|
611
|
-
|
|
610
|
+
const w = mr(T, D instanceof gs ? D.status : void 0), N = c.data.failedAttemptAt;
|
|
611
|
+
let q = N == null ? void 0 : N[E];
|
|
612
|
+
N && q !== void 0 && q > Date.now() && (q = N[E] = Date.now());
|
|
613
|
+
const H = q !== void 0 && Date.now() - q < Es || ((et = c.data.unconfirmedAttemptKeys) == null ? void 0 : et.includes(E)) === !0, X = ls(T);
|
|
614
|
+
if (X && o.log({
|
|
612
615
|
event: "FLOW_SUBMIT",
|
|
613
616
|
properties: {
|
|
614
617
|
flow_id: c.id,
|
|
615
618
|
flow_version: c.version,
|
|
616
619
|
flow_session_id: c.data.flowSessionId,
|
|
617
620
|
flow_build: c.build,
|
|
618
|
-
service:
|
|
619
|
-
response:
|
|
621
|
+
service: X.service,
|
|
622
|
+
response: X.response,
|
|
620
623
|
flow_type: "CHATBOT_DRAWER",
|
|
621
624
|
job: c.job,
|
|
622
|
-
// Measures how many duplicates follow the candidate's own
|
|
625
|
+
// Measures how many duplicates follow the candidate's own recent failed attempt; set exactly when
|
|
626
|
+
// the earlier-attempt copy is shown.
|
|
623
627
|
...(w == null ? void 0 : w.outcome) === "duplicate" && {
|
|
624
|
-
outcome:
|
|
628
|
+
outcome: H ? "duplicate_after_own_attempt" : "duplicate"
|
|
625
629
|
},
|
|
626
|
-
...
|
|
627
|
-
outcome:
|
|
630
|
+
...X.outcome && {
|
|
631
|
+
outcome: X.outcome
|
|
628
632
|
}
|
|
629
633
|
}
|
|
630
|
-
}), ($t(
|
|
634
|
+
}), ($t(T) || (T == null ? void 0 : T.success) === !0) && (($e = c.data.submitCooldown) == null ? void 0 : $e.throttles) !== void 0 && (delete c.data.submitCooldown.throttles, await h().catch((B) => a.error("Failed to persist submit cooldown reset", B))), $t(T)) {
|
|
631
635
|
const {
|
|
632
|
-
redirect_url:
|
|
633
|
-
message:
|
|
634
|
-
button_text:
|
|
635
|
-
} =
|
|
636
|
+
redirect_url: B,
|
|
637
|
+
message: st,
|
|
638
|
+
button_text: Ue
|
|
639
|
+
} = T.integration_response.data;
|
|
636
640
|
await e.sendMessage({
|
|
637
641
|
type: "text",
|
|
638
642
|
author: "bot",
|
|
639
|
-
text:
|
|
643
|
+
text: st ?? C("submission_redirect_message")
|
|
640
644
|
});
|
|
641
645
|
try {
|
|
642
|
-
const
|
|
643
|
-
M && !
|
|
646
|
+
const de = new URL(B);
|
|
647
|
+
M && !de.searchParams.has("anonymous_id") && de.searchParams.set("anonymous_id", M), await e.sendMessage({
|
|
644
648
|
type: "link",
|
|
645
|
-
href:
|
|
646
|
-
text:
|
|
649
|
+
href: de.toString(),
|
|
650
|
+
text: Ue ?? C("complete_submission"),
|
|
647
651
|
onClick: () => {
|
|
648
652
|
if (!O) {
|
|
649
|
-
|
|
653
|
+
a.error("session_id not set, cannot log FLOW_REDIRECT event");
|
|
650
654
|
return;
|
|
651
655
|
}
|
|
652
656
|
o.log({
|
|
@@ -656,14 +660,14 @@ async function Ns({
|
|
|
656
660
|
flow_id: c.id,
|
|
657
661
|
flow_session_id: O,
|
|
658
662
|
flow_version: c.version,
|
|
659
|
-
href:
|
|
663
|
+
href: de.toString(),
|
|
660
664
|
job: c.job
|
|
661
665
|
}
|
|
662
666
|
});
|
|
663
667
|
}
|
|
664
668
|
});
|
|
665
|
-
} catch (
|
|
666
|
-
|
|
669
|
+
} catch (de) {
|
|
670
|
+
a.error(`Invalid redirect URL: ${B}`, de), e.sendMessage({
|
|
667
671
|
type: "system",
|
|
668
672
|
variant: "error",
|
|
669
673
|
text: C("redirect_url_error")
|
|
@@ -671,71 +675,74 @@ async function Ns({
|
|
|
671
675
|
}
|
|
672
676
|
return r(s.nextId);
|
|
673
677
|
}
|
|
674
|
-
const
|
|
675
|
-
if (
|
|
678
|
+
const _e = us(T);
|
|
679
|
+
if (_e)
|
|
676
680
|
return await e.sendMessage({
|
|
677
681
|
type: "system",
|
|
678
682
|
variant: "success",
|
|
679
|
-
text:
|
|
683
|
+
text: _e.message ?? C("submission_pending")
|
|
680
684
|
}), r(s.nextId);
|
|
681
|
-
if ((
|
|
685
|
+
if ((T == null ? void 0 : T.success) === !0)
|
|
682
686
|
return s.data.skipConfirmation !== !0 && await e.sendMessage({
|
|
683
687
|
type: "system",
|
|
684
688
|
variant: "success",
|
|
685
689
|
text: C("submission_completed")
|
|
686
690
|
}), r(s.nextId);
|
|
687
|
-
const
|
|
688
|
-
return
|
|
689
|
-
|
|
691
|
+
const ue = (w == null ? void 0 : w.phase) === "submit" && w.verdict === "confirmed" && w.code === "unreadable_document" && typeof w.field == "string" && w.status !== void 0 && w.status >= 400 && w.status < 500 && ((tt = n == null ? void 0 : n[w.field]) == null ? void 0 : tt.type) === "file" ? w.field : void 0, ce = ue === void 0 ? void 0 : c.nodes.find((B) => B.type === "question-file" && B.data.key === ue);
|
|
692
|
+
return ce || (c.data.submitCooldown = Ns(E, _, w)), (w == null ? void 0 : w.outcome) !== "duplicate" && (c.data.failedAttemptAt = {
|
|
693
|
+
...c.data.failedAttemptAt,
|
|
694
|
+
[E]: Date.now()
|
|
695
|
+
}, (qe = c.data.unconfirmedAttemptKeys) != null && qe.includes(E) && (c.data.unconfirmedAttemptKeys = c.data.unconfirmedAttemptKeys.filter((B) => B !== E))), (w == null ? void 0 : w.verdict) === "not_submitted" || (w == null ? void 0 : w.outcome) === "duplicate" || (w == null ? void 0 : w.outcome) === "closed" ? (G || (c.data.startedWriteNodeIds = (rt = c.data.startedWriteNodeIds) == null ? void 0 : rt.filter((B) => B !== s.id)), (p == null ? void 0 : p.submitNodeId) === s.id && await b(p), await h().catch((B) => a.error("Failed to persist application write barrier release", B))) : await h().catch((B) => a.error("Failed to persist submit cooldown", B)), w ? (a.error(D ?? w.message), ce && ue !== void 0 ? (e.setSubmission(ue, null), await b({
|
|
696
|
+
fileQuestionNodeId: ce.id,
|
|
690
697
|
submitNodeId: s.id
|
|
691
698
|
}), await e.sendMessage({
|
|
692
699
|
type: "system",
|
|
693
700
|
variant: "error",
|
|
694
701
|
text: C("submission_unreadable_document")
|
|
695
|
-
}), r(
|
|
702
|
+
}), r(ce.id)) : w.outcome === "duplicate" ? (await e.sendMessage({
|
|
696
703
|
type: "system",
|
|
697
704
|
variant: "info",
|
|
698
|
-
text: C(
|
|
699
|
-
}),
|
|
705
|
+
text: C(H ? "submission_duplicate_earlier_attempt" : "submission_duplicate")
|
|
706
|
+
}), V(!1)) : w.outcome === "closed" ? (await e.sendMessage({
|
|
700
707
|
type: "system",
|
|
701
708
|
variant: "info",
|
|
702
709
|
text: C("submission_closed")
|
|
703
|
-
}),
|
|
710
|
+
}), V(!1)) : w.outcome === "unknown" ? (await e.sendMessage({
|
|
704
711
|
type: "system",
|
|
705
712
|
variant: "warning",
|
|
706
713
|
text: C("submission_unknown")
|
|
707
|
-
}),
|
|
714
|
+
}), V(!1)) : (w.phase === "workflow" || w.phase === "authentication") && w.retryable === !0 && w.verdict === "not_submitted" ? (await e.sendMessage({
|
|
708
715
|
type: "system",
|
|
709
716
|
variant: "error",
|
|
710
717
|
text: C("submission_retryable")
|
|
711
|
-
}),
|
|
718
|
+
}), V(!1)) : (await e.sendMessage({
|
|
712
719
|
type: "system",
|
|
713
720
|
variant: "error",
|
|
714
721
|
text: C("submission_failed")
|
|
715
|
-
}), t())) : (
|
|
722
|
+
}), t())) : (a.error(D ?? T), await e.sendMessage({
|
|
716
723
|
type: "system",
|
|
717
724
|
variant: "error",
|
|
718
725
|
text: C("submission_failed")
|
|
719
726
|
}), t());
|
|
720
727
|
};
|
|
721
|
-
await
|
|
728
|
+
await V(x === !0 ? !1 : s.data.skipConfirmation);
|
|
722
729
|
}
|
|
723
|
-
async function
|
|
730
|
+
async function Ds({
|
|
724
731
|
chat: e,
|
|
725
732
|
next: r,
|
|
726
733
|
node: t,
|
|
727
734
|
submissions: s,
|
|
728
|
-
context:
|
|
735
|
+
context: a
|
|
729
736
|
}) {
|
|
730
737
|
await e.sendMessage({
|
|
731
738
|
type: "link",
|
|
732
739
|
href: he(t.data.href, {
|
|
733
740
|
submissions: s,
|
|
734
|
-
context:
|
|
741
|
+
context: a
|
|
735
742
|
}),
|
|
736
743
|
text: he(t.data.cta, {
|
|
737
744
|
submissions: s,
|
|
738
|
-
context:
|
|
745
|
+
context: a
|
|
739
746
|
})
|
|
740
747
|
}), r(t.nextId);
|
|
741
748
|
}
|
|
@@ -750,23 +757,23 @@ async function Ts({
|
|
|
750
757
|
context: s
|
|
751
758
|
}) ? t.branchId : t.nextId);
|
|
752
759
|
}
|
|
753
|
-
async function
|
|
760
|
+
async function Os({
|
|
754
761
|
chat: e,
|
|
755
762
|
next: r,
|
|
756
763
|
node: t,
|
|
757
764
|
submissions: s,
|
|
758
|
-
context:
|
|
765
|
+
context: a
|
|
759
766
|
}) {
|
|
760
767
|
await e.sendMessage({
|
|
761
768
|
author: "bot",
|
|
762
769
|
type: "text",
|
|
763
770
|
text: he(t.data.text, {
|
|
764
771
|
submissions: s,
|
|
765
|
-
context:
|
|
772
|
+
context: a
|
|
766
773
|
})
|
|
767
774
|
}), r(t.nextId);
|
|
768
775
|
}
|
|
769
|
-
async function
|
|
776
|
+
async function Rs({
|
|
770
777
|
chat: e,
|
|
771
778
|
next: r,
|
|
772
779
|
node: t
|
|
@@ -779,20 +786,20 @@ async function Os({
|
|
|
779
786
|
width: t.data.width
|
|
780
787
|
}), r(t.nextId);
|
|
781
788
|
}
|
|
782
|
-
async function
|
|
789
|
+
async function Ps({
|
|
783
790
|
chat: e,
|
|
784
791
|
next: r,
|
|
785
792
|
node: t,
|
|
786
793
|
submissions: s,
|
|
787
|
-
context:
|
|
788
|
-
t:
|
|
794
|
+
context: a,
|
|
795
|
+
t: i
|
|
789
796
|
}) {
|
|
790
797
|
await e.sendMessage({
|
|
791
798
|
author: "bot",
|
|
792
799
|
type: "text",
|
|
793
800
|
text: he(t.data.question, {
|
|
794
801
|
submissions: s,
|
|
795
|
-
context:
|
|
802
|
+
context: a
|
|
796
803
|
})
|
|
797
804
|
});
|
|
798
805
|
const n = t.data.format === "phone" ? await e.userInput({
|
|
@@ -820,27 +827,27 @@ async function Rs({
|
|
|
820
827
|
n === null ? await e.sendMessage({
|
|
821
828
|
type: "system",
|
|
822
829
|
variant: "info",
|
|
823
|
-
text:
|
|
830
|
+
text: i("skipped")
|
|
824
831
|
}) : await e.sendMessage({
|
|
825
832
|
author: "user",
|
|
826
833
|
type: "text",
|
|
827
|
-
text: n.type === "phone" ?
|
|
834
|
+
text: n.type === "phone" ? ot(n.value) : n.value
|
|
828
835
|
}), r(t.nextId);
|
|
829
836
|
}
|
|
830
|
-
async function
|
|
837
|
+
async function Bs({
|
|
831
838
|
chat: e,
|
|
832
839
|
next: r,
|
|
833
840
|
node: t,
|
|
834
841
|
submissions: s,
|
|
835
|
-
context:
|
|
836
|
-
t:
|
|
842
|
+
context: a,
|
|
843
|
+
t: i
|
|
837
844
|
}) {
|
|
838
845
|
await e.sendMessage({
|
|
839
846
|
author: "bot",
|
|
840
847
|
type: "text",
|
|
841
848
|
text: he(t.data.question, {
|
|
842
849
|
submissions: s,
|
|
843
|
-
context:
|
|
850
|
+
context: a
|
|
844
851
|
})
|
|
845
852
|
});
|
|
846
853
|
const n = await e.userInput({
|
|
@@ -857,27 +864,27 @@ async function Ps({
|
|
|
857
864
|
n === null ? await e.sendMessage({
|
|
858
865
|
type: "system",
|
|
859
866
|
variant: "info",
|
|
860
|
-
text:
|
|
867
|
+
text: i("skipped")
|
|
861
868
|
}) : await e.sendMessage({
|
|
862
869
|
author: "user",
|
|
863
870
|
type: "text",
|
|
864
871
|
text: n.value.toString()
|
|
865
872
|
}), r(t.nextId);
|
|
866
873
|
}
|
|
867
|
-
async function
|
|
874
|
+
async function js({
|
|
868
875
|
chat: e,
|
|
869
876
|
next: r,
|
|
870
877
|
node: t,
|
|
871
878
|
submissions: s,
|
|
872
|
-
context:
|
|
873
|
-
t:
|
|
879
|
+
context: a,
|
|
880
|
+
t: i
|
|
874
881
|
}) {
|
|
875
882
|
await e.sendMessage({
|
|
876
883
|
author: "bot",
|
|
877
884
|
type: "text",
|
|
878
885
|
text: he(t.data.question, {
|
|
879
886
|
submissions: s,
|
|
880
|
-
context:
|
|
887
|
+
context: a
|
|
881
888
|
})
|
|
882
889
|
});
|
|
883
890
|
const n = await e.userInput({
|
|
@@ -896,27 +903,27 @@ async function Bs({
|
|
|
896
903
|
n === null ? await e.sendMessage({
|
|
897
904
|
type: "system",
|
|
898
905
|
variant: "info",
|
|
899
|
-
text:
|
|
906
|
+
text: i("skipped")
|
|
900
907
|
}) : await e.sendMessage({
|
|
901
908
|
author: "user",
|
|
902
909
|
type: "text",
|
|
903
|
-
text: n.type === "phone" ?
|
|
910
|
+
text: n.type === "phone" ? ot(n.value) : n.value
|
|
904
911
|
}), r(t.nextId);
|
|
905
912
|
}
|
|
906
|
-
async function
|
|
913
|
+
async function $s({
|
|
907
914
|
chat: e,
|
|
908
915
|
next: r,
|
|
909
916
|
node: t,
|
|
910
917
|
submissions: s,
|
|
911
|
-
context:
|
|
912
|
-
t:
|
|
918
|
+
context: a,
|
|
919
|
+
t: i
|
|
913
920
|
}) {
|
|
914
921
|
await e.sendMessage({
|
|
915
922
|
author: "bot",
|
|
916
923
|
type: "text",
|
|
917
924
|
text: he(t.data.question, {
|
|
918
925
|
submissions: s,
|
|
919
|
-
context:
|
|
926
|
+
context: a
|
|
920
927
|
})
|
|
921
928
|
});
|
|
922
929
|
const n = await e.userInput({
|
|
@@ -927,27 +934,27 @@ async function js({
|
|
|
927
934
|
n.value.length === 0 ? await e.sendMessage({
|
|
928
935
|
type: "system",
|
|
929
936
|
variant: "info",
|
|
930
|
-
text:
|
|
937
|
+
text: i("skipped")
|
|
931
938
|
}) : await e.sendMessage({
|
|
932
939
|
author: "user",
|
|
933
940
|
type: "text",
|
|
934
941
|
text: t.data.options.filter((o) => n.value.includes(o.value)).map((o) => o.label).join(", ")
|
|
935
942
|
}), r(t.nextId);
|
|
936
943
|
}
|
|
937
|
-
async function
|
|
944
|
+
async function qs({
|
|
938
945
|
chat: e,
|
|
939
946
|
next: r,
|
|
940
947
|
node: t,
|
|
941
948
|
submissions: s,
|
|
942
|
-
context:
|
|
943
|
-
t:
|
|
949
|
+
context: a,
|
|
950
|
+
t: i
|
|
944
951
|
}) {
|
|
945
952
|
await e.sendMessage({
|
|
946
953
|
author: "bot",
|
|
947
954
|
type: "text",
|
|
948
955
|
text: he(t.data.question, {
|
|
949
956
|
submissions: s,
|
|
950
|
-
context:
|
|
957
|
+
context: a
|
|
951
958
|
})
|
|
952
959
|
});
|
|
953
960
|
const n = await e.userInput({
|
|
@@ -964,14 +971,14 @@ async function $s({
|
|
|
964
971
|
n === null ? await e.sendMessage({
|
|
965
972
|
type: "system",
|
|
966
973
|
variant: "info",
|
|
967
|
-
text:
|
|
974
|
+
text: i("skipped")
|
|
968
975
|
}) : await e.sendMessage({
|
|
969
976
|
author: "user",
|
|
970
977
|
type: "text",
|
|
971
978
|
text: n.value === !0 ? t.data.trueLabel : t.data.falseLabel
|
|
972
979
|
}), r(t.nextId);
|
|
973
980
|
}
|
|
974
|
-
async function
|
|
981
|
+
async function Us({
|
|
975
982
|
chat: e,
|
|
976
983
|
next: r,
|
|
977
984
|
node: t,
|
|
@@ -982,7 +989,7 @@ async function qs({
|
|
|
982
989
|
type: "text",
|
|
983
990
|
text: t.data.question
|
|
984
991
|
});
|
|
985
|
-
const
|
|
992
|
+
const a = await e.userInput({
|
|
986
993
|
type: "address",
|
|
987
994
|
key: t.data.key,
|
|
988
995
|
config: {
|
|
@@ -992,36 +999,36 @@ async function qs({
|
|
|
992
999
|
placeholder: t.data.placeholder
|
|
993
1000
|
}
|
|
994
1001
|
});
|
|
995
|
-
if (
|
|
1002
|
+
if (a === null)
|
|
996
1003
|
await e.sendMessage({
|
|
997
1004
|
type: "system",
|
|
998
1005
|
variant: "info",
|
|
999
1006
|
text: s("skipped")
|
|
1000
1007
|
});
|
|
1001
1008
|
else {
|
|
1002
|
-
const
|
|
1009
|
+
const i = Object.values(a.value).filter((n) => n && n.trim().length > 0).join(", ");
|
|
1003
1010
|
await e.sendMessage({
|
|
1004
1011
|
author: "user",
|
|
1005
1012
|
type: "text",
|
|
1006
|
-
text:
|
|
1013
|
+
text: i
|
|
1007
1014
|
});
|
|
1008
1015
|
}
|
|
1009
1016
|
return r(t.nextId);
|
|
1010
1017
|
}
|
|
1011
|
-
async function
|
|
1018
|
+
async function zs({
|
|
1012
1019
|
node: e,
|
|
1013
1020
|
chat: r,
|
|
1014
1021
|
next: t,
|
|
1015
1022
|
submissions: s,
|
|
1016
|
-
context:
|
|
1017
|
-
t:
|
|
1023
|
+
context: a,
|
|
1024
|
+
t: i
|
|
1018
1025
|
}) {
|
|
1019
1026
|
await r.sendMessage({
|
|
1020
1027
|
author: "bot",
|
|
1021
1028
|
type: "text",
|
|
1022
1029
|
text: he(e.data.question, {
|
|
1023
1030
|
submissions: s,
|
|
1024
|
-
context:
|
|
1031
|
+
context: a
|
|
1025
1032
|
})
|
|
1026
1033
|
});
|
|
1027
1034
|
const n = await r.userInput({
|
|
@@ -1039,7 +1046,7 @@ async function Us({
|
|
|
1039
1046
|
await r.sendMessage({
|
|
1040
1047
|
type: "system",
|
|
1041
1048
|
variant: "info",
|
|
1042
|
-
text:
|
|
1049
|
+
text: i("skipped")
|
|
1043
1050
|
});
|
|
1044
1051
|
else
|
|
1045
1052
|
for (const o of n.value)
|
|
@@ -1051,7 +1058,7 @@ async function Us({
|
|
|
1051
1058
|
});
|
|
1052
1059
|
return t(e.nextId);
|
|
1053
1060
|
}
|
|
1054
|
-
async function
|
|
1061
|
+
async function Ws({
|
|
1055
1062
|
chat: e,
|
|
1056
1063
|
end: r,
|
|
1057
1064
|
node: t
|
|
@@ -1062,25 +1069,25 @@ async function zs({
|
|
|
1062
1069
|
text: t.data.systemMessage
|
|
1063
1070
|
}), r();
|
|
1064
1071
|
}
|
|
1065
|
-
async function
|
|
1072
|
+
async function Ks({
|
|
1066
1073
|
node: e,
|
|
1067
1074
|
flow: r,
|
|
1068
1075
|
submissions: t,
|
|
1069
1076
|
chat: s,
|
|
1070
|
-
next:
|
|
1071
|
-
apiClient:
|
|
1077
|
+
next: a,
|
|
1078
|
+
apiClient: i,
|
|
1072
1079
|
analytics: n
|
|
1073
1080
|
}) {
|
|
1074
|
-
const o =
|
|
1081
|
+
const o = as(r.nodes, t || {}), {
|
|
1075
1082
|
answers: c,
|
|
1076
|
-
...
|
|
1083
|
+
...p
|
|
1077
1084
|
} = o;
|
|
1078
1085
|
s.setSubmission(e.data.key, {
|
|
1079
1086
|
type: "integration",
|
|
1080
|
-
value:
|
|
1087
|
+
value: p
|
|
1081
1088
|
});
|
|
1082
1089
|
const b = new AbortController(), x = setTimeout(() => b.abort(), 5e3);
|
|
1083
|
-
if (
|
|
1090
|
+
if (i.fetch("/flow/pre-apply", {
|
|
1084
1091
|
method: "POST",
|
|
1085
1092
|
signal: b.signal,
|
|
1086
1093
|
body: JSON.stringify({
|
|
@@ -1093,9 +1100,9 @@ async function Ws({
|
|
|
1093
1100
|
}).finally(() => clearTimeout(x)), o.status !== "skipped") {
|
|
1094
1101
|
const m = [o.status === "unavailable" ? "We could not prepare your pre-apply summary. You can still continue to your application." : o.hasHardConcerns ? e.data.messages.hard : o.hasAdvisoryConcerns ? e.data.messages.advisory : e.data.messages.matched];
|
|
1095
1102
|
for (const C of ["hard", "advisory"]) {
|
|
1096
|
-
const E = c.filter((
|
|
1103
|
+
const E = c.filter((V) => !V.matched && V.severity === C);
|
|
1097
1104
|
E.length && m.push((C === "hard" ? "Role requirements" : "Other things to consider") + `
|
|
1098
|
-
` + E.map((
|
|
1105
|
+
` + E.map((V) => `• ${V.message}`).join(`
|
|
1099
1106
|
`));
|
|
1100
1107
|
}
|
|
1101
1108
|
await s.sendMessage({
|
|
@@ -1116,7 +1123,7 @@ async function Ws({
|
|
|
1116
1123
|
}
|
|
1117
1124
|
});
|
|
1118
1125
|
}
|
|
1119
|
-
return
|
|
1126
|
+
return a(e.nextId);
|
|
1120
1127
|
}
|
|
1121
1128
|
const Ee = ({
|
|
1122
1129
|
class: e,
|
|
@@ -1148,21 +1155,16 @@ const Ee = ({
|
|
|
1148
1155
|
})
|
|
1149
1156
|
});
|
|
1150
1157
|
};
|
|
1151
|
-
var
|
|
1158
|
+
var me;
|
|
1152
1159
|
// @__NO_SIDE_EFFECTS__
|
|
1153
|
-
function
|
|
1160
|
+
function ut(e) {
|
|
1154
1161
|
return {
|
|
1155
|
-
lang: (e == null ? void 0 : e.lang) ?? (
|
|
1162
|
+
lang: (e == null ? void 0 : e.lang) ?? (me == null ? void 0 : me.lang),
|
|
1156
1163
|
message: e == null ? void 0 : e.message,
|
|
1157
|
-
abortEarly: (e == null ? void 0 : e.abortEarly) ?? (
|
|
1158
|
-
abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (
|
|
1164
|
+
abortEarly: (e == null ? void 0 : e.abortEarly) ?? (me == null ? void 0 : me.abortEarly),
|
|
1165
|
+
abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (me == null ? void 0 : me.abortPipeEarly)
|
|
1159
1166
|
};
|
|
1160
1167
|
}
|
|
1161
|
-
var yt;
|
|
1162
|
-
// @__NO_SIDE_EFFECTS__
|
|
1163
|
-
function Ks(e) {
|
|
1164
|
-
return yt == null ? void 0 : yt.get(e);
|
|
1165
|
-
}
|
|
1166
1168
|
var mt;
|
|
1167
1169
|
// @__NO_SIDE_EFFECTS__
|
|
1168
1170
|
function Gs(e) {
|
|
@@ -1170,57 +1172,62 @@ function Gs(e) {
|
|
|
1170
1172
|
}
|
|
1171
1173
|
var gt;
|
|
1172
1174
|
// @__NO_SIDE_EFFECTS__
|
|
1173
|
-
function Hs(e
|
|
1175
|
+
function Hs(e) {
|
|
1176
|
+
return gt == null ? void 0 : gt.get(e);
|
|
1177
|
+
}
|
|
1178
|
+
var bt;
|
|
1179
|
+
// @__NO_SIDE_EFFECTS__
|
|
1180
|
+
function Js(e, r) {
|
|
1174
1181
|
var t;
|
|
1175
|
-
return (t =
|
|
1182
|
+
return (t = bt == null ? void 0 : bt.get(e)) == null ? void 0 : t.get(r);
|
|
1176
1183
|
}
|
|
1177
1184
|
// @__NO_SIDE_EFFECTS__
|
|
1178
|
-
function
|
|
1185
|
+
function Te(e) {
|
|
1179
1186
|
var t, s;
|
|
1180
1187
|
const r = typeof e;
|
|
1181
1188
|
return r === "string" ? `"${e}"` : r === "number" || r === "bigint" || r === "boolean" ? `${e}` : r === "object" || r === "function" ? (e && ((s = (t = Object.getPrototypeOf(e)) == null ? void 0 : t.constructor) == null ? void 0 : s.name)) ?? "null" : r;
|
|
1182
1189
|
}
|
|
1183
|
-
function Z(e, r, t, s,
|
|
1184
|
-
const
|
|
1190
|
+
function Z(e, r, t, s, a) {
|
|
1191
|
+
const i = a && "input" in a ? a.input : t.value, n = (a == null ? void 0 : a.expected) ?? e.expects ?? null, o = (a == null ? void 0 : a.received) ?? /* @__PURE__ */ Te(i), c = {
|
|
1185
1192
|
kind: e.kind,
|
|
1186
1193
|
type: e.type,
|
|
1187
|
-
input:
|
|
1194
|
+
input: i,
|
|
1188
1195
|
expected: n,
|
|
1189
1196
|
received: o,
|
|
1190
1197
|
message: `Invalid ${r}: ${n ? `Expected ${n} but r` : "R"}eceived ${o}`,
|
|
1191
1198
|
requirement: e.requirement,
|
|
1192
|
-
path:
|
|
1193
|
-
issues:
|
|
1199
|
+
path: a == null ? void 0 : a.path,
|
|
1200
|
+
issues: a == null ? void 0 : a.issues,
|
|
1194
1201
|
lang: s.lang,
|
|
1195
1202
|
abortEarly: s.abortEarly,
|
|
1196
1203
|
abortPipeEarly: s.abortPipeEarly
|
|
1197
|
-
},
|
|
1204
|
+
}, p = e.kind === "schema", b = (a == null ? void 0 : a.message) ?? e.message ?? /* @__PURE__ */ Js(e.reference, c.lang) ?? (p ? /* @__PURE__ */ Hs(c.lang) : null) ?? s.message ?? /* @__PURE__ */ Gs(c.lang);
|
|
1198
1205
|
b !== void 0 && (c.message = typeof b == "function" ? (
|
|
1199
1206
|
// @ts-expect-error
|
|
1200
1207
|
b(c)
|
|
1201
|
-
) : b),
|
|
1208
|
+
) : b), p && (t.typed = !1), t.issues ? t.issues.push(c) : t.issues = [c];
|
|
1202
1209
|
}
|
|
1203
1210
|
// @__NO_SIDE_EFFECTS__
|
|
1204
|
-
function
|
|
1211
|
+
function ye(e) {
|
|
1205
1212
|
return {
|
|
1206
1213
|
version: 1,
|
|
1207
1214
|
vendor: "valibot",
|
|
1208
1215
|
validate(r) {
|
|
1209
|
-
return e["~run"]({ value: r }, /* @__PURE__ */
|
|
1216
|
+
return e["~run"]({ value: r }, /* @__PURE__ */ ut());
|
|
1210
1217
|
}
|
|
1211
1218
|
};
|
|
1212
1219
|
}
|
|
1213
1220
|
// @__NO_SIDE_EFFECTS__
|
|
1214
|
-
function
|
|
1221
|
+
function Xs(e, r) {
|
|
1215
1222
|
return Object.hasOwn(e, r) && r !== "__proto__" && r !== "prototype" && r !== "constructor";
|
|
1216
1223
|
}
|
|
1217
1224
|
// @__NO_SIDE_EFFECTS__
|
|
1218
|
-
function
|
|
1225
|
+
function Zs(e, r) {
|
|
1219
1226
|
const t = [...new Set(e)];
|
|
1220
1227
|
return t.length > 1 ? `(${t.join(` ${r} `)})` : t[0] ?? "never";
|
|
1221
1228
|
}
|
|
1222
1229
|
// @__NO_SIDE_EFFECTS__
|
|
1223
|
-
function
|
|
1230
|
+
function Ys(e) {
|
|
1224
1231
|
if (e.path) {
|
|
1225
1232
|
let r = "";
|
|
1226
1233
|
for (const t of e.path)
|
|
@@ -1232,7 +1239,7 @@ function Zs(e) {
|
|
|
1232
1239
|
}
|
|
1233
1240
|
return null;
|
|
1234
1241
|
}
|
|
1235
|
-
var
|
|
1242
|
+
var Qs = class extends Error {
|
|
1236
1243
|
/**
|
|
1237
1244
|
* Creates a Valibot error with useful information.
|
|
1238
1245
|
*
|
|
@@ -1241,7 +1248,7 @@ var Ys = class extends Error {
|
|
|
1241
1248
|
constructor(e) {
|
|
1242
1249
|
super(e[0].message), this.name = "ValiError", this.issues = e;
|
|
1243
1250
|
}
|
|
1244
|
-
},
|
|
1251
|
+
}, en = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
|
|
1245
1252
|
// @__NO_SIDE_EFFECTS__
|
|
1246
1253
|
function Ir(e, r) {
|
|
1247
1254
|
return {
|
|
@@ -1258,14 +1265,14 @@ function Ir(e, r) {
|
|
|
1258
1265
|
};
|
|
1259
1266
|
}
|
|
1260
1267
|
// @__NO_SIDE_EFFECTS__
|
|
1261
|
-
function
|
|
1268
|
+
function Ar(e) {
|
|
1262
1269
|
return {
|
|
1263
1270
|
kind: "validation",
|
|
1264
1271
|
type: "email",
|
|
1265
|
-
reference:
|
|
1272
|
+
reference: Ar,
|
|
1266
1273
|
expects: null,
|
|
1267
1274
|
async: !1,
|
|
1268
|
-
requirement:
|
|
1275
|
+
requirement: en,
|
|
1269
1276
|
message: e,
|
|
1270
1277
|
"~run"(r, t) {
|
|
1271
1278
|
return r.typed && !this.requirement.test(r.value) && Z(this, "email", r, t), r;
|
|
@@ -1273,11 +1280,11 @@ function Fr(e) {
|
|
|
1273
1280
|
};
|
|
1274
1281
|
}
|
|
1275
1282
|
// @__NO_SIDE_EFFECTS__
|
|
1276
|
-
function
|
|
1283
|
+
function He(e, r) {
|
|
1277
1284
|
return {
|
|
1278
1285
|
kind: "validation",
|
|
1279
1286
|
type: "max_length",
|
|
1280
|
-
reference:
|
|
1287
|
+
reference: He,
|
|
1281
1288
|
async: !1,
|
|
1282
1289
|
expects: `<=${e}`,
|
|
1283
1290
|
requirement: e,
|
|
@@ -1290,28 +1297,28 @@ function Ke(e, r) {
|
|
|
1290
1297
|
};
|
|
1291
1298
|
}
|
|
1292
1299
|
// @__NO_SIDE_EFFECTS__
|
|
1293
|
-
function
|
|
1300
|
+
function Fr(e, r) {
|
|
1294
1301
|
return {
|
|
1295
1302
|
kind: "validation",
|
|
1296
1303
|
type: "max_value",
|
|
1297
|
-
reference:
|
|
1304
|
+
reference: Fr,
|
|
1298
1305
|
async: !1,
|
|
1299
|
-
expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */
|
|
1306
|
+
expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ Te(e)}`,
|
|
1300
1307
|
requirement: e,
|
|
1301
1308
|
message: r,
|
|
1302
1309
|
"~run"(t, s) {
|
|
1303
1310
|
return t.typed && !(t.value <= this.requirement) && Z(this, "value", t, s, {
|
|
1304
|
-
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */
|
|
1311
|
+
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ Te(t.value)
|
|
1305
1312
|
}), t;
|
|
1306
1313
|
}
|
|
1307
1314
|
};
|
|
1308
1315
|
}
|
|
1309
1316
|
// @__NO_SIDE_EFFECTS__
|
|
1310
|
-
function
|
|
1317
|
+
function De(e, r) {
|
|
1311
1318
|
return {
|
|
1312
1319
|
kind: "validation",
|
|
1313
1320
|
type: "min_length",
|
|
1314
|
-
reference:
|
|
1321
|
+
reference: De,
|
|
1315
1322
|
async: !1,
|
|
1316
1323
|
expects: `>=${e}`,
|
|
1317
1324
|
requirement: e,
|
|
@@ -1324,28 +1331,28 @@ function Te(e, r) {
|
|
|
1324
1331
|
};
|
|
1325
1332
|
}
|
|
1326
1333
|
// @__NO_SIDE_EFFECTS__
|
|
1327
|
-
function
|
|
1334
|
+
function Vr(e, r) {
|
|
1328
1335
|
return {
|
|
1329
1336
|
kind: "validation",
|
|
1330
1337
|
type: "min_value",
|
|
1331
|
-
reference:
|
|
1338
|
+
reference: Vr,
|
|
1332
1339
|
async: !1,
|
|
1333
|
-
expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */
|
|
1340
|
+
expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ Te(e)}`,
|
|
1334
1341
|
requirement: e,
|
|
1335
1342
|
message: r,
|
|
1336
1343
|
"~run"(t, s) {
|
|
1337
1344
|
return t.typed && !(t.value >= this.requirement) && Z(this, "value", t, s, {
|
|
1338
|
-
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */
|
|
1345
|
+
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ Te(t.value)
|
|
1339
1346
|
}), t;
|
|
1340
1347
|
}
|
|
1341
1348
|
};
|
|
1342
1349
|
}
|
|
1343
1350
|
// @__NO_SIDE_EFFECTS__
|
|
1344
|
-
function
|
|
1351
|
+
function It(e, r) {
|
|
1345
1352
|
return {
|
|
1346
1353
|
kind: "validation",
|
|
1347
1354
|
type: "regex",
|
|
1348
|
-
reference:
|
|
1355
|
+
reference: It,
|
|
1349
1356
|
async: !1,
|
|
1350
1357
|
expects: `${e}`,
|
|
1351
1358
|
requirement: e,
|
|
@@ -1356,11 +1363,11 @@ function St(e, r) {
|
|
|
1356
1363
|
};
|
|
1357
1364
|
}
|
|
1358
1365
|
// @__NO_SIDE_EFFECTS__
|
|
1359
|
-
function
|
|
1366
|
+
function At(e) {
|
|
1360
1367
|
return {
|
|
1361
1368
|
kind: "transformation",
|
|
1362
1369
|
type: "transform",
|
|
1363
|
-
reference:
|
|
1370
|
+
reference: At,
|
|
1364
1371
|
async: !1,
|
|
1365
1372
|
operation: e,
|
|
1366
1373
|
"~run"(r) {
|
|
@@ -1390,7 +1397,7 @@ function Mr(e) {
|
|
|
1390
1397
|
};
|
|
1391
1398
|
}
|
|
1392
1399
|
// @__NO_SIDE_EFFECTS__
|
|
1393
|
-
function
|
|
1400
|
+
function tn(e, r, t) {
|
|
1394
1401
|
return typeof e.fallback == "function" ? (
|
|
1395
1402
|
// @ts-expect-error
|
|
1396
1403
|
e.fallback(r, t)
|
|
@@ -1420,25 +1427,25 @@ function Nr(e, r) {
|
|
|
1420
1427
|
item: e,
|
|
1421
1428
|
message: r,
|
|
1422
1429
|
get "~standard"() {
|
|
1423
|
-
return /* @__PURE__ */
|
|
1430
|
+
return /* @__PURE__ */ ye(this);
|
|
1424
1431
|
},
|
|
1425
1432
|
"~run"(t, s) {
|
|
1426
|
-
var
|
|
1427
|
-
const
|
|
1428
|
-
if (Array.isArray(
|
|
1433
|
+
var i;
|
|
1434
|
+
const a = t.value;
|
|
1435
|
+
if (Array.isArray(a)) {
|
|
1429
1436
|
t.typed = !0, t.value = [];
|
|
1430
|
-
for (let n = 0; n <
|
|
1431
|
-
const o =
|
|
1437
|
+
for (let n = 0; n < a.length; n++) {
|
|
1438
|
+
const o = a[n], c = this.item["~run"]({ value: o }, s);
|
|
1432
1439
|
if (c.issues) {
|
|
1433
|
-
const
|
|
1440
|
+
const p = {
|
|
1434
1441
|
type: "array",
|
|
1435
1442
|
origin: "value",
|
|
1436
|
-
input:
|
|
1443
|
+
input: a,
|
|
1437
1444
|
key: n,
|
|
1438
1445
|
value: o
|
|
1439
1446
|
};
|
|
1440
1447
|
for (const b of c.issues)
|
|
1441
|
-
b.path ? b.path.unshift(
|
|
1448
|
+
b.path ? b.path.unshift(p) : b.path = [p], (i = t.issues) == null || i.push(b);
|
|
1442
1449
|
if (t.issues || (t.issues = c.issues), s.abortEarly) {
|
|
1443
1450
|
t.typed = !1;
|
|
1444
1451
|
break;
|
|
@@ -1462,7 +1469,7 @@ function Lr(e) {
|
|
|
1462
1469
|
async: !1,
|
|
1463
1470
|
message: e,
|
|
1464
1471
|
get "~standard"() {
|
|
1465
|
-
return /* @__PURE__ */
|
|
1472
|
+
return /* @__PURE__ */ ye(this);
|
|
1466
1473
|
},
|
|
1467
1474
|
"~run"(r, t) {
|
|
1468
1475
|
return typeof r.value == "boolean" ? r.typed = !0 : Z(this, "type", r, t), r;
|
|
@@ -1470,16 +1477,16 @@ function Lr(e) {
|
|
|
1470
1477
|
};
|
|
1471
1478
|
}
|
|
1472
1479
|
// @__NO_SIDE_EFFECTS__
|
|
1473
|
-
function
|
|
1480
|
+
function Dr(e) {
|
|
1474
1481
|
return {
|
|
1475
1482
|
kind: "schema",
|
|
1476
1483
|
type: "number",
|
|
1477
|
-
reference:
|
|
1484
|
+
reference: Dr,
|
|
1478
1485
|
expects: "number",
|
|
1479
1486
|
async: !1,
|
|
1480
1487
|
message: e,
|
|
1481
1488
|
get "~standard"() {
|
|
1482
|
-
return /* @__PURE__ */
|
|
1489
|
+
return /* @__PURE__ */ ye(this);
|
|
1483
1490
|
},
|
|
1484
1491
|
"~run"(r, t) {
|
|
1485
1492
|
return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : Z(this, "type", r, t), r;
|
|
@@ -1487,49 +1494,49 @@ function Tr(e) {
|
|
|
1487
1494
|
};
|
|
1488
1495
|
}
|
|
1489
1496
|
// @__NO_SIDE_EFFECTS__
|
|
1490
|
-
function
|
|
1497
|
+
function xe(e, r) {
|
|
1491
1498
|
return {
|
|
1492
1499
|
kind: "schema",
|
|
1493
1500
|
type: "object",
|
|
1494
|
-
reference:
|
|
1501
|
+
reference: xe,
|
|
1495
1502
|
expects: "Object",
|
|
1496
1503
|
async: !1,
|
|
1497
1504
|
entries: e,
|
|
1498
1505
|
message: r,
|
|
1499
1506
|
get "~standard"() {
|
|
1500
|
-
return /* @__PURE__ */
|
|
1507
|
+
return /* @__PURE__ */ ye(this);
|
|
1501
1508
|
},
|
|
1502
1509
|
"~run"(t, s) {
|
|
1503
|
-
var
|
|
1504
|
-
const
|
|
1505
|
-
if (
|
|
1510
|
+
var i;
|
|
1511
|
+
const a = t.value;
|
|
1512
|
+
if (a && typeof a == "object") {
|
|
1506
1513
|
t.typed = !0, t.value = {};
|
|
1507
1514
|
for (const n in this.entries) {
|
|
1508
1515
|
const o = this.entries[n];
|
|
1509
|
-
if (n in
|
|
1516
|
+
if (n in a || (o.type === "exact_optional" || o.type === "optional" || o.type === "nullish") && // @ts-expect-error
|
|
1510
1517
|
o.default !== void 0) {
|
|
1511
|
-
const c = n in
|
|
1518
|
+
const c = n in a ? (
|
|
1512
1519
|
// @ts-expect-error
|
|
1513
|
-
|
|
1514
|
-
) : /* @__PURE__ */ Er(o),
|
|
1515
|
-
if (
|
|
1520
|
+
a[n]
|
|
1521
|
+
) : /* @__PURE__ */ Er(o), p = o["~run"]({ value: c }, s);
|
|
1522
|
+
if (p.issues) {
|
|
1516
1523
|
const b = {
|
|
1517
1524
|
type: "object",
|
|
1518
1525
|
origin: "value",
|
|
1519
|
-
input:
|
|
1526
|
+
input: a,
|
|
1520
1527
|
key: n,
|
|
1521
1528
|
value: c
|
|
1522
1529
|
};
|
|
1523
|
-
for (const x of
|
|
1524
|
-
x.path ? x.path.unshift(b) : x.path = [b], (
|
|
1525
|
-
if (t.issues || (t.issues =
|
|
1530
|
+
for (const x of p.issues)
|
|
1531
|
+
x.path ? x.path.unshift(b) : x.path = [b], (i = t.issues) == null || i.push(x);
|
|
1532
|
+
if (t.issues || (t.issues = p.issues), s.abortEarly) {
|
|
1526
1533
|
t.typed = !1;
|
|
1527
1534
|
break;
|
|
1528
1535
|
}
|
|
1529
1536
|
}
|
|
1530
|
-
|
|
1537
|
+
p.typed || (t.typed = !1), t.value[n] = p.value;
|
|
1531
1538
|
} else if (o.fallback !== void 0)
|
|
1532
|
-
t.value[n] = /* @__PURE__ */
|
|
1539
|
+
t.value[n] = /* @__PURE__ */ tn(o);
|
|
1533
1540
|
else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (Z(this, "key", t, s, {
|
|
1534
1541
|
input: void 0,
|
|
1535
1542
|
expected: `"${n}"`,
|
|
@@ -1537,10 +1544,10 @@ function ve(e, r) {
|
|
|
1537
1544
|
{
|
|
1538
1545
|
type: "object",
|
|
1539
1546
|
origin: "key",
|
|
1540
|
-
input:
|
|
1547
|
+
input: a,
|
|
1541
1548
|
key: n,
|
|
1542
1549
|
// @ts-expect-error
|
|
1543
|
-
value:
|
|
1550
|
+
value: a[n]
|
|
1544
1551
|
}
|
|
1545
1552
|
]
|
|
1546
1553
|
}), s.abortEarly))
|
|
@@ -1553,17 +1560,17 @@ function ve(e, r) {
|
|
|
1553
1560
|
};
|
|
1554
1561
|
}
|
|
1555
1562
|
// @__NO_SIDE_EFFECTS__
|
|
1556
|
-
function
|
|
1563
|
+
function Je(e, r) {
|
|
1557
1564
|
return {
|
|
1558
1565
|
kind: "schema",
|
|
1559
1566
|
type: "optional",
|
|
1560
|
-
reference:
|
|
1567
|
+
reference: Je,
|
|
1561
1568
|
expects: `(${e.expects} | undefined)`,
|
|
1562
1569
|
async: !1,
|
|
1563
1570
|
wrapped: e,
|
|
1564
1571
|
default: r,
|
|
1565
1572
|
get "~standard"() {
|
|
1566
|
-
return /* @__PURE__ */
|
|
1573
|
+
return /* @__PURE__ */ ye(this);
|
|
1567
1574
|
},
|
|
1568
1575
|
"~run"(t, s) {
|
|
1569
1576
|
return t.value === void 0 && (this.default !== void 0 && (t.value = /* @__PURE__ */ Er(this, t, s)), t.value === void 0) ? (t.typed = !0, t) : this.wrapped["~run"](t, s);
|
|
@@ -1571,17 +1578,17 @@ function Ge(e, r) {
|
|
|
1571
1578
|
};
|
|
1572
1579
|
}
|
|
1573
1580
|
// @__NO_SIDE_EFFECTS__
|
|
1574
|
-
function
|
|
1581
|
+
function Tr(e, r) {
|
|
1575
1582
|
return {
|
|
1576
1583
|
kind: "schema",
|
|
1577
1584
|
type: "picklist",
|
|
1578
|
-
reference:
|
|
1579
|
-
expects: /* @__PURE__ */
|
|
1585
|
+
reference: Tr,
|
|
1586
|
+
expects: /* @__PURE__ */ Zs(e.map(Te), "|"),
|
|
1580
1587
|
async: !1,
|
|
1581
1588
|
options: e,
|
|
1582
1589
|
message: r,
|
|
1583
1590
|
get "~standard"() {
|
|
1584
|
-
return /* @__PURE__ */
|
|
1591
|
+
return /* @__PURE__ */ ye(this);
|
|
1585
1592
|
},
|
|
1586
1593
|
"~run"(t, s) {
|
|
1587
1594
|
return this.options.includes(t.value) ? t.typed = !0 : Z(this, "type", t, s), t;
|
|
@@ -1600,46 +1607,46 @@ function Or(e, r, t) {
|
|
|
1600
1607
|
value: r,
|
|
1601
1608
|
message: t,
|
|
1602
1609
|
get "~standard"() {
|
|
1603
|
-
return /* @__PURE__ */
|
|
1610
|
+
return /* @__PURE__ */ ye(this);
|
|
1604
1611
|
},
|
|
1605
|
-
"~run"(s,
|
|
1612
|
+
"~run"(s, a) {
|
|
1606
1613
|
var n, o;
|
|
1607
|
-
const
|
|
1608
|
-
if (
|
|
1614
|
+
const i = s.value;
|
|
1615
|
+
if (i && typeof i == "object") {
|
|
1609
1616
|
s.typed = !0, s.value = {};
|
|
1610
|
-
for (const c in
|
|
1611
|
-
if (/* @__PURE__ */
|
|
1612
|
-
const
|
|
1617
|
+
for (const c in i)
|
|
1618
|
+
if (/* @__PURE__ */ Xs(i, c)) {
|
|
1619
|
+
const p = i[c], b = this.key["~run"]({ value: c }, a);
|
|
1613
1620
|
if (b.issues) {
|
|
1614
|
-
const
|
|
1621
|
+
const h = {
|
|
1615
1622
|
type: "object",
|
|
1616
1623
|
origin: "key",
|
|
1617
|
-
input:
|
|
1624
|
+
input: i,
|
|
1618
1625
|
key: c,
|
|
1619
|
-
value:
|
|
1626
|
+
value: p
|
|
1620
1627
|
};
|
|
1621
1628
|
for (const m of b.issues)
|
|
1622
|
-
m.path = [
|
|
1623
|
-
if (s.issues || (s.issues = b.issues),
|
|
1629
|
+
m.path = [h], (n = s.issues) == null || n.push(m);
|
|
1630
|
+
if (s.issues || (s.issues = b.issues), a.abortEarly) {
|
|
1624
1631
|
s.typed = !1;
|
|
1625
1632
|
break;
|
|
1626
1633
|
}
|
|
1627
1634
|
}
|
|
1628
1635
|
const x = this.value["~run"](
|
|
1629
|
-
{ value:
|
|
1630
|
-
|
|
1636
|
+
{ value: p },
|
|
1637
|
+
a
|
|
1631
1638
|
);
|
|
1632
1639
|
if (x.issues) {
|
|
1633
|
-
const
|
|
1640
|
+
const h = {
|
|
1634
1641
|
type: "object",
|
|
1635
1642
|
origin: "value",
|
|
1636
|
-
input:
|
|
1643
|
+
input: i,
|
|
1637
1644
|
key: c,
|
|
1638
|
-
value:
|
|
1645
|
+
value: p
|
|
1639
1646
|
};
|
|
1640
1647
|
for (const m of x.issues)
|
|
1641
|
-
m.path ? m.path.unshift(
|
|
1642
|
-
if (s.issues || (s.issues = x.issues),
|
|
1648
|
+
m.path ? m.path.unshift(h) : m.path = [h], (o = s.issues) == null || o.push(m);
|
|
1649
|
+
if (s.issues || (s.issues = x.issues), a.abortEarly) {
|
|
1643
1650
|
s.typed = !1;
|
|
1644
1651
|
break;
|
|
1645
1652
|
}
|
|
@@ -1647,44 +1654,44 @@ function Or(e, r, t) {
|
|
|
1647
1654
|
(!b.typed || !x.typed) && (s.typed = !1), b.typed && (s.value[b.value] = x.value);
|
|
1648
1655
|
}
|
|
1649
1656
|
} else
|
|
1650
|
-
Z(this, "type", s,
|
|
1657
|
+
Z(this, "type", s, a);
|
|
1651
1658
|
return s;
|
|
1652
1659
|
}
|
|
1653
1660
|
};
|
|
1654
1661
|
}
|
|
1655
1662
|
// @__NO_SIDE_EFFECTS__
|
|
1656
|
-
function
|
|
1663
|
+
function ae(e) {
|
|
1657
1664
|
return {
|
|
1658
1665
|
kind: "schema",
|
|
1659
1666
|
type: "string",
|
|
1660
|
-
reference:
|
|
1667
|
+
reference: ae,
|
|
1661
1668
|
expects: "string",
|
|
1662
1669
|
async: !1,
|
|
1663
1670
|
message: e,
|
|
1664
1671
|
get "~standard"() {
|
|
1665
|
-
return /* @__PURE__ */
|
|
1672
|
+
return /* @__PURE__ */ ye(this);
|
|
1666
1673
|
},
|
|
1667
1674
|
"~run"(r, t) {
|
|
1668
1675
|
return typeof r.value == "string" ? r.typed = !0 : Z(this, "type", r, t), r;
|
|
1669
1676
|
}
|
|
1670
1677
|
};
|
|
1671
1678
|
}
|
|
1672
|
-
function
|
|
1673
|
-
const s = e["~run"]({ value: r }, /* @__PURE__ */
|
|
1679
|
+
function rn(e, r, t) {
|
|
1680
|
+
const s = e["~run"]({ value: r }, /* @__PURE__ */ ut(t));
|
|
1674
1681
|
if (s.issues)
|
|
1675
|
-
throw new
|
|
1682
|
+
throw new Qs(s.issues);
|
|
1676
1683
|
return s.value;
|
|
1677
1684
|
}
|
|
1678
1685
|
// @__NO_SIDE_EFFECTS__
|
|
1679
|
-
function
|
|
1686
|
+
function sn(e, r) {
|
|
1680
1687
|
const t = {};
|
|
1681
1688
|
for (const s in e.entries)
|
|
1682
|
-
t[s] = !r || r.includes(s) ? /* @__PURE__ */
|
|
1689
|
+
t[s] = !r || r.includes(s) ? /* @__PURE__ */ Je(e.entries[s]) : e.entries[s];
|
|
1683
1690
|
return {
|
|
1684
1691
|
...e,
|
|
1685
1692
|
entries: t,
|
|
1686
1693
|
get "~standard"() {
|
|
1687
|
-
return /* @__PURE__ */
|
|
1694
|
+
return /* @__PURE__ */ ye(this);
|
|
1688
1695
|
}
|
|
1689
1696
|
};
|
|
1690
1697
|
}
|
|
@@ -1694,7 +1701,7 @@ function Se(...e) {
|
|
|
1694
1701
|
...e[0],
|
|
1695
1702
|
pipe: e,
|
|
1696
1703
|
get "~standard"() {
|
|
1697
|
-
return /* @__PURE__ */
|
|
1704
|
+
return /* @__PURE__ */ ye(this);
|
|
1698
1705
|
},
|
|
1699
1706
|
"~run"(r, t) {
|
|
1700
1707
|
for (const s of e)
|
|
@@ -1710,8 +1717,8 @@ function Se(...e) {
|
|
|
1710
1717
|
};
|
|
1711
1718
|
}
|
|
1712
1719
|
// @__NO_SIDE_EFFECTS__
|
|
1713
|
-
function
|
|
1714
|
-
const s = e["~run"]({ value: r }, /* @__PURE__ */
|
|
1720
|
+
function nn(e, r, t) {
|
|
1721
|
+
const s = e["~run"]({ value: r }, /* @__PURE__ */ ut(t));
|
|
1715
1722
|
return {
|
|
1716
1723
|
typed: s.typed,
|
|
1717
1724
|
success: !s.issues,
|
|
@@ -1720,10 +1727,10 @@ function sn(e, r, t) {
|
|
|
1720
1727
|
};
|
|
1721
1728
|
}
|
|
1722
1729
|
// @__NO_SIDE_EFFECTS__
|
|
1723
|
-
async function
|
|
1730
|
+
async function an(e, r, t) {
|
|
1724
1731
|
const s = await e["~run"](
|
|
1725
1732
|
{ value: r },
|
|
1726
|
-
/* @__PURE__ */
|
|
1733
|
+
/* @__PURE__ */ ut(t)
|
|
1727
1734
|
);
|
|
1728
1735
|
return {
|
|
1729
1736
|
typed: s.typed,
|
|
@@ -1765,7 +1772,7 @@ const Pe = ({
|
|
|
1765
1772
|
class: "break-words pr-1 text-sm",
|
|
1766
1773
|
children: e.message
|
|
1767
1774
|
})]
|
|
1768
|
-
}),
|
|
1775
|
+
}), Ae = ({
|
|
1769
1776
|
class: e,
|
|
1770
1777
|
...r
|
|
1771
1778
|
}) => {
|
|
@@ -1797,7 +1804,7 @@ const Pe = ({
|
|
|
1797
1804
|
});
|
|
1798
1805
|
};
|
|
1799
1806
|
var Ft = { Afghanistan: "93", Albania: "355", Algeria: "213", "American Samoa": "1 684", Andorra: "376", Angola: "244", Anguilla: "1 264", Antarctica: "672", "Antigua and Barbuda": "1 268", Argentina: "54", Armenia: "374", Aruba: "297", Australia: "61", Austria: "43", Azerbaijan: "994", Bahrain: "973", Bangladesh: "880", Barbados: "1 246", Belarus: "375", Belgium: "32", Belize: "501", Benin: "229", Bermuda: "1 441", Bhutan: "975", Bolivia: "591", "Bosnia and Herzegovina": "387", Botswana: "267", "Bouvet Island": "47", Brazil: "55", "British Indian Ocean Territory": "246", "British Virgin Islands": "1 284", Brunei: "673", Bulgaria: "359", "Burkina Faso": "226", Burundi: "257", "Cabo Verde": "238", Cambodia: "855", Cameroon: "237", Canada: "1", "Caribbean Netherlands": "599", "Cayman Islands": "1 345", "Central African Republic": "236", Chad: "235", Chile: "56", China: "86", "Christmas Island": "61", "Cocos (Keeling) Islands": "61", Colombia: "57", Comoros: "269", "Cook Islands": "682", "Costa Rica": "506", Croatia: "385", Cuba: "53", Curaçao: "599", Cyprus: "357", Czechia: "420", "Côte d'Ivoire": "225", "Democratic Republic of the Congo": "243", Denmark: "45", Djibouti: "253", "Dominican Republic": "1 809", Ecuador: "593", Egypt: "20", "El Salvador": "503", "Equatorial Guinea": "240", Eritrea: "291", Estonia: "372", Eswatini: "268", Ethiopia: "251", "Falkland Islands (Islas Malvinas)": "500", "Faroe Islands": "298", Fiji: "679", Finland: "358", France: "33", "French Guiana": "594", "French Polynesia": "689", "French Southern and Antarctic Lands": "262", Gabon: "241", Georgia: "995", Germany: "49", Ghana: "233", Gibraltar: "350", Greece: "30", Greenland: "299", Grenada: "1 473", Guadeloupe: "590", Guam: "1 671", Guatemala: "502", Guernsey: "44", Guinea: "224", "Guinea-Bissau": "245", Guyana: "592", Haiti: "509", Honduras: "504", "Hong Kong": "852", Hungary: "36", Iceland: "354", India: "91", Indonesia: "62", Iran: "98", Iraq: "964", Ireland: "353", "Isle of Man": "44", Israel: "972", Italy: "39", Jamaica: "1 876", Japan: "81", Jersey: "44", Jordan: "962", Kazakhstan: "7", Kenya: "254", Kiribati: "686", Kosovo: "383", Kuwait: "965", Kyrgyzstan: "996", Laos: "856", Latvia: "371", Lebanon: "961", Lesotho: "266", Liberia: "231", Libya: "218", Liechtenstein: "423", Lithuania: "370", Luxembourg: "352", Macao: "853", Madagascar: "261", Malawi: "265", Malaysia: "60", Maldives: "960", Mali: "223", Malta: "356", "Marshall Islands": "692", Martinique: "596", Mauritania: "222", Mauritius: "230", Mayotte: "262", Mexico: "52", Micronesia: "691", Moldova: "373", Monaco: "377", Mongolia: "976", Montenegro: "382", Montserrat: "1 664", Morocco: "212", Mozambique: "258", "Myanmar (Burma)": "95", Namibia: "264", Nauru: "674", Nepal: "977", Netherlands: "31", "New Caledonia": "687", "New Zealand": "64", Nicaragua: "505", Niger: "227", Nigeria: "234", Niue: "683", "Norfolk Island": "672", "North Korea": "850", "North Macedonia": "389", "Northern Mariana Islands": "1 670", Norway: "47", Oman: "968", Pakistan: "92", Palau: "680", Palestine: "970", Panama: "507", "Papua New Guinea": "675", Paraguay: "595", Peru: "51", Philippines: "63", "Pitcairn Islands": "64", Poland: "48", Portugal: "351", "Puerto Rico": "1 787", Qatar: "974", Romania: "40", Russia: "7", Rwanda: "250", Réunion: "262", "Saint Barthélemy": "590", "Saint Helena, Ascension and Tristan da Cunha": "290", "Saint Kitts and Nevis": "1 869", "Saint Lucia": "1 758", "Saint Martin": "590", "Saint Pierre and Miquelon": "508", "Saint Vincent and the Grenadines": "1 784", Samoa: "685", "San Marino": "378", "Saudi Arabia": "966", Senegal: "221", Serbia: "381", Seychelles: "248", "Sierra Leone": "232", Singapore: "65", "Sint Maarten": "1 721", Slovakia: "421", Slovenia: "386", "Solomon Islands": "677", Somalia: "252", "South Africa": "27", "South Georgia and the South Sandwich Islands": "500", "South Korea": "82", "South Sudan": "211", Spain: "34", "Sri Lanka": "94", Sudan: "249", Suriname: "597", "Svalbard and Jan Mayen": "47", Sweden: "46", Switzerland: "41", Syria: "963", "São Tomé and Príncipe": "239", Taiwan: "886", Tajikistan: "992", Tanzania: "255", Thailand: "66", "The Bahamas": "1 242", "The Gambia": "220", "Timor-Leste": "670", Togo: "228", Tokelau: "690", Tonga: "676", "Trinidad and Tobago": "1 868", Tunisia: "216", Turkmenistan: "993", "Turks and Caicos Islands": "1 649", Tuvalu: "688", Türkiye: "90", "U.S. Virgin Islands": "1 340", Uganda: "256", Ukraine: "380", "United Arab Emirates": "971", "United Kingdom": "44", "United States": "1", "United States Minor Outlying Islands": "1", Uruguay: "598", Uzbekistan: "998", Vanuatu: "678", "Vatican City": "379", Venezuela: "58", Vietnam: "84", "Wallis and Futuna": "681", "Western Sahara": "212", Yemen: "967", Zambia: "260", Zimbabwe: "263", "Åland Islands": "358" };
|
|
1800
|
-
const
|
|
1807
|
+
const Ye = lt("outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest py-1 text-base outline outline-2 transition-all", {
|
|
1801
1808
|
variants: {
|
|
1802
1809
|
optional: {
|
|
1803
1810
|
true: "pr-16 pl-3",
|
|
@@ -1807,27 +1814,27 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1807
1814
|
defaultVariants: {
|
|
1808
1815
|
optional: !1
|
|
1809
1816
|
}
|
|
1810
|
-
}),
|
|
1811
|
-
name: /* @__PURE__ */
|
|
1812
|
-
}),
|
|
1813
|
-
suggestions: /* @__PURE__ */ Nr(/* @__PURE__ */
|
|
1814
|
-
full_address: /* @__PURE__ */
|
|
1815
|
-
place_formatted: /* @__PURE__ */
|
|
1816
|
-
name: /* @__PURE__ */
|
|
1817
|
-
mapbox_id: /* @__PURE__ */
|
|
1818
|
-
context: /* @__PURE__ */
|
|
1819
|
-
address:
|
|
1820
|
-
street:
|
|
1821
|
-
neighborhood:
|
|
1822
|
-
locality:
|
|
1823
|
-
district:
|
|
1824
|
-
place:
|
|
1825
|
-
region:
|
|
1826
|
-
postcode:
|
|
1827
|
-
country:
|
|
1817
|
+
}), on = "https://api.mapbox.com/search/searchbox/v1/suggest", ln = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", un = (e) => atob(e).split("").reverse().join(""), ge = /* @__PURE__ */ xe({
|
|
1818
|
+
name: /* @__PURE__ */ ae()
|
|
1819
|
+
}), cn = /* @__PURE__ */ xe({
|
|
1820
|
+
suggestions: /* @__PURE__ */ Nr(/* @__PURE__ */ xe({
|
|
1821
|
+
full_address: /* @__PURE__ */ Je(/* @__PURE__ */ ae()),
|
|
1822
|
+
place_formatted: /* @__PURE__ */ Je(/* @__PURE__ */ ae()),
|
|
1823
|
+
name: /* @__PURE__ */ Je(/* @__PURE__ */ ae()),
|
|
1824
|
+
mapbox_id: /* @__PURE__ */ ae(),
|
|
1825
|
+
context: /* @__PURE__ */ sn(/* @__PURE__ */ xe({
|
|
1826
|
+
address: ge,
|
|
1827
|
+
street: ge,
|
|
1828
|
+
neighborhood: ge,
|
|
1829
|
+
locality: ge,
|
|
1830
|
+
district: ge,
|
|
1831
|
+
place: ge,
|
|
1832
|
+
region: ge,
|
|
1833
|
+
postcode: ge,
|
|
1834
|
+
country: ge
|
|
1828
1835
|
}))
|
|
1829
1836
|
}))
|
|
1830
|
-
}),
|
|
1837
|
+
}), dn = ({
|
|
1831
1838
|
logger: e,
|
|
1832
1839
|
t: r
|
|
1833
1840
|
}) => cs(() => {
|
|
@@ -1835,42 +1842,42 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1835
1842
|
const t = (s = $.current$.peek().flow) == null ? void 0 : s.data.flowSessionId;
|
|
1836
1843
|
return t ? {
|
|
1837
1844
|
enabled: !0,
|
|
1838
|
-
getPredictions: async (
|
|
1845
|
+
getPredictions: async (a) => {
|
|
1839
1846
|
var x;
|
|
1840
|
-
const
|
|
1841
|
-
|
|
1847
|
+
const i = new URL(on);
|
|
1848
|
+
i.searchParams.set("q", a), i.searchParams.set("session_token", t);
|
|
1842
1849
|
const n = (x = $.current$.peek().flow) == null ? void 0 : x.locationOrigin;
|
|
1843
|
-
n && n.lat !== void 0 && n.lng !== void 0 && n.lat >= -90 && n.lat <= 90 && n.lng >= -180 && n.lng <= 180 &&
|
|
1844
|
-
const c = await fetch(
|
|
1850
|
+
n && n.lat !== void 0 && n.lng !== void 0 && n.lat >= -90 && n.lat <= 90 && n.lng >= -180 && n.lng <= 180 && i.searchParams.set("proximity", `${n.lng},${n.lat}`), i.searchParams.set("access_token", un(ln));
|
|
1851
|
+
const c = await fetch(i);
|
|
1845
1852
|
if (!c.ok)
|
|
1846
1853
|
return e.error("Failed to get address details", c), {
|
|
1847
1854
|
ok: !1,
|
|
1848
1855
|
error: r("address_error")
|
|
1849
1856
|
};
|
|
1850
|
-
const
|
|
1851
|
-
if (
|
|
1852
|
-
return e.error("Failed to parse address details",
|
|
1857
|
+
const p = /* @__PURE__ */ nn(cn, await c.json());
|
|
1858
|
+
if (p.success === !1)
|
|
1859
|
+
return e.error("Failed to parse address details", p.issues), {
|
|
1853
1860
|
ok: !1,
|
|
1854
1861
|
error: r("address_error")
|
|
1855
1862
|
};
|
|
1856
1863
|
const {
|
|
1857
1864
|
suggestions: b
|
|
1858
|
-
} =
|
|
1865
|
+
} = p.output;
|
|
1859
1866
|
return {
|
|
1860
1867
|
ok: !0,
|
|
1861
|
-
data: b.map((
|
|
1862
|
-
var m, C, E,
|
|
1868
|
+
data: b.map((h) => {
|
|
1869
|
+
var m, C, E, V, I, y, _, F, M;
|
|
1863
1870
|
return {
|
|
1864
|
-
label:
|
|
1865
|
-
id:
|
|
1871
|
+
label: h.full_address ?? h.place_formatted ?? h.name ?? h.mapbox_id,
|
|
1872
|
+
id: h.mapbox_id,
|
|
1866
1873
|
address: {
|
|
1867
|
-
line1: ((m =
|
|
1874
|
+
line1: ((m = h.context.address) == null ? void 0 : m.name) ?? ((C = h.context.street) == null ? void 0 : C.name),
|
|
1868
1875
|
line2: void 0,
|
|
1869
|
-
line3: ((E =
|
|
1870
|
-
city: ((I =
|
|
1871
|
-
state: (_ =
|
|
1872
|
-
postcode: (
|
|
1873
|
-
country: (M =
|
|
1876
|
+
line3: ((E = h.context.neighborhood) == null ? void 0 : E.name) ?? ((V = h.context.locality) == null ? void 0 : V.name),
|
|
1877
|
+
city: ((I = h.context.place) == null ? void 0 : I.name) ?? ((y = h.context.district) == null ? void 0 : y.name),
|
|
1878
|
+
state: (_ = h.context.region) == null ? void 0 : _.name,
|
|
1879
|
+
postcode: (F = h.context.postcode) == null ? void 0 : F.name,
|
|
1880
|
+
country: (M = h.context.country) == null ? void 0 : M.name
|
|
1874
1881
|
}
|
|
1875
1882
|
};
|
|
1876
1883
|
})
|
|
@@ -1902,22 +1909,22 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1902
1909
|
children: r("back")
|
|
1903
1910
|
})]
|
|
1904
1911
|
});
|
|
1905
|
-
},
|
|
1912
|
+
}, fn = ({
|
|
1906
1913
|
input: e,
|
|
1907
1914
|
onSubmitSuccess: r,
|
|
1908
1915
|
logger: t
|
|
1909
1916
|
}) => {
|
|
1910
1917
|
const {
|
|
1911
1918
|
t: s
|
|
1912
|
-
} = se(), [
|
|
1919
|
+
} = se(), [a, i] = ve(), {
|
|
1913
1920
|
enabled: n,
|
|
1914
1921
|
getPredictions: o
|
|
1915
|
-
} =
|
|
1922
|
+
} = dn({
|
|
1916
1923
|
logger: t,
|
|
1917
1924
|
t: s
|
|
1918
|
-
}), [c,
|
|
1919
|
-
var
|
|
1920
|
-
if (Me(n, "Query state should not be enabled"), y = y.trim(), y === ((
|
|
1925
|
+
}), [c, p] = ve(n ? "query" : "manual"), [b, x] = ve(""), [h, m] = ve(), C = pe(), E = pe(), V = (y) => {
|
|
1926
|
+
var F;
|
|
1927
|
+
if (Me(n, "Query state should not be enabled"), y = y.trim(), y === ((F = C.current) == null ? void 0 : F.query) || y === (h == null ? void 0 : h.query) && h.status === "done")
|
|
1921
1928
|
return;
|
|
1922
1929
|
if (x(y), y === "") {
|
|
1923
1930
|
C.current = void 0, m(void 0);
|
|
@@ -1947,38 +1954,38 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1947
1954
|
}));
|
|
1948
1955
|
});
|
|
1949
1956
|
}, I = (y, _) => {
|
|
1950
|
-
|
|
1951
|
-
...
|
|
1957
|
+
i((F) => ({
|
|
1958
|
+
...F,
|
|
1952
1959
|
[y]: _
|
|
1953
1960
|
}));
|
|
1954
1961
|
};
|
|
1955
1962
|
switch (c) {
|
|
1956
1963
|
case "query":
|
|
1957
|
-
return Me(n, "Query state should not be enabled"), u(
|
|
1964
|
+
return Me(n, "Query state should not be enabled"), u(pn, {
|
|
1958
1965
|
input: e,
|
|
1959
1966
|
onSkip: () => r(null),
|
|
1960
1967
|
onAddressSelect: (y) => {
|
|
1961
1968
|
if (y === "") {
|
|
1962
|
-
C.current && (C.current = void 0, m(void 0)),
|
|
1969
|
+
C.current && (C.current = void 0, m(void 0)), p("manual");
|
|
1963
1970
|
return;
|
|
1964
1971
|
}
|
|
1965
|
-
const _ = (
|
|
1966
|
-
_ && (E.current !== y &&
|
|
1972
|
+
const _ = (h == null ? void 0 : h.status) === "done" ? h.items.find((F) => F.id === y) : void 0;
|
|
1973
|
+
_ && (E.current !== y && i(_.address), E.current = y, p("details"));
|
|
1967
1974
|
},
|
|
1968
|
-
onAddressSearch:
|
|
1969
|
-
lookup:
|
|
1975
|
+
onAddressSearch: V,
|
|
1976
|
+
lookup: h,
|
|
1970
1977
|
query: b
|
|
1971
1978
|
});
|
|
1972
1979
|
case "details":
|
|
1973
|
-
return Me(
|
|
1980
|
+
return Me(a !== void 0), u(Kt, {
|
|
1974
1981
|
input: e,
|
|
1975
1982
|
logger: t,
|
|
1976
1983
|
onSubmitSuccess: r,
|
|
1977
|
-
addressFields:
|
|
1984
|
+
addressFields: a,
|
|
1978
1985
|
onFieldChange: I,
|
|
1979
1986
|
actions: u(Wt, {
|
|
1980
1987
|
onClick: () => {
|
|
1981
|
-
|
|
1988
|
+
p("query");
|
|
1982
1989
|
}
|
|
1983
1990
|
})
|
|
1984
1991
|
});
|
|
@@ -1987,40 +1994,40 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1987
1994
|
logger: t,
|
|
1988
1995
|
input: e,
|
|
1989
1996
|
onSubmitSuccess: r,
|
|
1990
|
-
addressFields:
|
|
1997
|
+
addressFields: a ?? {},
|
|
1991
1998
|
onFieldChange: I,
|
|
1992
1999
|
actions: n ? u(Wt, {
|
|
1993
2000
|
onClick: () => {
|
|
1994
|
-
|
|
2001
|
+
p("query");
|
|
1995
2002
|
}
|
|
1996
2003
|
}) : e.config.optional ? (
|
|
1997
2004
|
// Without address search this is the only screen, so an optional question needs its own way past.
|
|
1998
|
-
u(
|
|
2005
|
+
u(Ae, {
|
|
1999
2006
|
onClick: () => r(null)
|
|
2000
2007
|
})
|
|
2001
2008
|
) : void 0
|
|
2002
2009
|
});
|
|
2003
2010
|
}
|
|
2004
|
-
},
|
|
2011
|
+
}, pn = ({
|
|
2005
2012
|
input: e,
|
|
2006
2013
|
onSkip: r,
|
|
2007
2014
|
lookup: t,
|
|
2008
2015
|
onAddressSelect: s,
|
|
2009
|
-
query:
|
|
2010
|
-
onAddressSearch:
|
|
2016
|
+
query: a,
|
|
2017
|
+
onAddressSearch: i
|
|
2011
2018
|
}) => {
|
|
2012
2019
|
const {
|
|
2013
2020
|
t: n
|
|
2014
|
-
} = se(), o =
|
|
2021
|
+
} = se(), o = pe(null);
|
|
2015
2022
|
return Ie(() => {
|
|
2016
2023
|
o.current && (o.current.focus(), o.current.select());
|
|
2017
|
-
}, []), u(
|
|
2024
|
+
}, []), u(we, {
|
|
2018
2025
|
children: [u("form", {
|
|
2019
2026
|
noValidate: !0,
|
|
2020
2027
|
onSubmit: (c) => {
|
|
2021
2028
|
c.preventDefault();
|
|
2022
2029
|
const b = new FormData(c.currentTarget).get("address");
|
|
2023
|
-
typeof b == "string" &&
|
|
2030
|
+
typeof b == "string" && i(b);
|
|
2024
2031
|
},
|
|
2025
2032
|
class: "flex gap-2 p-2.5",
|
|
2026
2033
|
children: [u("div", {
|
|
@@ -2032,8 +2039,8 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2032
2039
|
autocomplete: "address-line1 country-name postal-code",
|
|
2033
2040
|
autoFocus: !0,
|
|
2034
2041
|
placeholder: e.config.placeholder || n("address_search"),
|
|
2035
|
-
defaultValue:
|
|
2036
|
-
class:
|
|
2042
|
+
defaultValue: a,
|
|
2043
|
+
class: Ye({
|
|
2037
2044
|
optional: !!e.config.optional,
|
|
2038
2045
|
className: "w-full rounded-full"
|
|
2039
2046
|
})
|
|
@@ -2066,7 +2073,7 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2066
2073
|
children: n("search")
|
|
2067
2074
|
})]
|
|
2068
2075
|
})]
|
|
2069
|
-
}), e.config.optional && u(
|
|
2076
|
+
}), e.config.optional && u(Ae, {
|
|
2070
2077
|
class: "relative",
|
|
2071
2078
|
onClick: r
|
|
2072
2079
|
})]
|
|
@@ -2077,8 +2084,8 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2077
2084
|
}) : null, u("p", {
|
|
2078
2085
|
role: "status",
|
|
2079
2086
|
class: (t == null ? void 0 : t.status) === "pending" || (t == null ? void 0 : t.status) === "done" && t.items.length === 0 ? "text-neutral-10 flex items-center gap-2 px-4 py-2 text-sm" : "sr-only",
|
|
2080
|
-
children: (t == null ? void 0 : t.status) === "pending" ? u(
|
|
2081
|
-
children: [u(
|
|
2087
|
+
children: (t == null ? void 0 : t.status) === "pending" ? u(we, {
|
|
2088
|
+
children: [u(St, {
|
|
2082
2089
|
"aria-hidden": "true",
|
|
2083
2090
|
class: "h-4 w-4 shrink-0"
|
|
2084
2091
|
}), n("address_searching")]
|
|
@@ -2121,17 +2128,17 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2121
2128
|
}, "")]
|
|
2122
2129
|
})]
|
|
2123
2130
|
});
|
|
2124
|
-
},
|
|
2131
|
+
}, vt = ["line1", "line2", "line3", "city", "state", "postcode", "country"], Kt = ({
|
|
2125
2132
|
addressFields: e,
|
|
2126
2133
|
onFieldChange: r,
|
|
2127
2134
|
onSubmitSuccess: t,
|
|
2128
2135
|
actions: s,
|
|
2129
|
-
input:
|
|
2136
|
+
input: a
|
|
2130
2137
|
}) => {
|
|
2131
|
-
const
|
|
2138
|
+
const i = pe(null);
|
|
2132
2139
|
Ie(() => {
|
|
2133
|
-
if (
|
|
2134
|
-
const c =
|
|
2140
|
+
if (i.current) {
|
|
2141
|
+
const c = i.current.querySelector("input");
|
|
2135
2142
|
c && (c.focus(), c.select());
|
|
2136
2143
|
}
|
|
2137
2144
|
}, []);
|
|
@@ -2141,28 +2148,28 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2141
2148
|
return u("form", {
|
|
2142
2149
|
class: "flex flex-col px-2 pt-2",
|
|
2143
2150
|
onSubmit: (c) => {
|
|
2144
|
-
const
|
|
2151
|
+
const p = c.currentTarget, b = [...p.querySelectorAll("input")].filter((m) => m.value !== "" && !m.value.trim());
|
|
2145
2152
|
for (const m of b) {
|
|
2146
2153
|
m.value = "";
|
|
2147
|
-
const C =
|
|
2154
|
+
const C = vt.find((E) => a.config.keys[E] === m.name);
|
|
2148
2155
|
C && r(C, "");
|
|
2149
2156
|
}
|
|
2150
|
-
if (b.length > 0 && !
|
|
2151
|
-
c.preventDefault(),
|
|
2157
|
+
if (b.length > 0 && !p.checkValidity()) {
|
|
2158
|
+
c.preventDefault(), p.reportValidity();
|
|
2152
2159
|
return;
|
|
2153
2160
|
}
|
|
2154
|
-
const x = new FormData(
|
|
2161
|
+
const x = new FormData(p), h = Object.fromEntries(x.entries());
|
|
2155
2162
|
t({
|
|
2156
2163
|
type: "address",
|
|
2157
|
-
value:
|
|
2164
|
+
value: h
|
|
2158
2165
|
});
|
|
2159
2166
|
},
|
|
2160
2167
|
children: [u("div", {
|
|
2161
2168
|
class: "bg-neutral-3 border-neutral-5 grid items-center gap-1.5 rounded-2xl border pb-2 pl-4 pr-3 pt-3 [grid-template-columns:min-content_1fr]",
|
|
2162
|
-
ref:
|
|
2163
|
-
children:
|
|
2164
|
-
const b = `isdk_${c}`, x =
|
|
2165
|
-
return x ? u(
|
|
2169
|
+
ref: i,
|
|
2170
|
+
children: vt.map((c, p) => {
|
|
2171
|
+
const b = `isdk_${c}`, x = a.config.keys[c];
|
|
2172
|
+
return x ? u(we, {
|
|
2166
2173
|
children: [u("label", {
|
|
2167
2174
|
for: b,
|
|
2168
2175
|
class: "text-neutral-9 [&:has(+*>input:focus)]:text-neutral-11 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",
|
|
@@ -2176,7 +2183,7 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2176
2183
|
name: x,
|
|
2177
2184
|
id: b,
|
|
2178
2185
|
defaultValue: e[c],
|
|
2179
|
-
onChange: (
|
|
2186
|
+
onChange: (h) => r(c, h.currentTarget.value),
|
|
2180
2187
|
required: !0,
|
|
2181
2188
|
children: [e.country && !n.includes(e.country) ? u("option", {
|
|
2182
2189
|
value: e[c],
|
|
@@ -2184,10 +2191,10 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2184
2191
|
}) : u("option", {
|
|
2185
2192
|
value: "",
|
|
2186
2193
|
children: o("select_country")
|
|
2187
|
-
}), n.map((
|
|
2188
|
-
value:
|
|
2189
|
-
children:
|
|
2190
|
-
},
|
|
2194
|
+
}), n.map((h) => u("option", {
|
|
2195
|
+
value: h,
|
|
2196
|
+
children: h
|
|
2197
|
+
}, h))]
|
|
2191
2198
|
}), u("svg", {
|
|
2192
2199
|
class: "text-neutral-12 absolute bottom-2.5 right-2 flex items-center justify-center",
|
|
2193
2200
|
width: "16",
|
|
@@ -2204,14 +2211,14 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2204
2211
|
})
|
|
2205
2212
|
})]
|
|
2206
2213
|
}) : u("input", {
|
|
2207
|
-
autoFocus:
|
|
2214
|
+
autoFocus: p === 0 ? !0 : void 0,
|
|
2208
2215
|
class: "text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 flex-1 rounded-lg border-solid bg-transparent px-3 py-1.5 text-base transition-colors autofill:shadow-[inset_0_0_0_1000px_hsl(210_16.7%_97.6%)] focus:outline-none",
|
|
2209
2216
|
name: x,
|
|
2210
2217
|
id: b,
|
|
2211
2218
|
defaultValue: e[c],
|
|
2212
|
-
onInput: (
|
|
2213
|
-
required: c !== "line2" ||
|
|
2214
|
-
}),
|
|
2219
|
+
onInput: (h) => r(c, h.currentTarget.value),
|
|
2220
|
+
required: c !== "line2" || a.config.line2Required === !0
|
|
2221
|
+
}), p === vt.length - 1 ? u("hr", {
|
|
2215
2222
|
class: "m-0 w-full border-b border-b-transparent"
|
|
2216
2223
|
}) : u("hr", {
|
|
2217
2224
|
class: "border-b-neutral-5 m-0 w-full border-b border-solid"
|
|
@@ -2227,12 +2234,12 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2227
2234
|
})]
|
|
2228
2235
|
});
|
|
2229
2236
|
}, Vt = () => {
|
|
2230
|
-
const e =
|
|
2237
|
+
const e = pe(null);
|
|
2231
2238
|
return vr(() => {
|
|
2232
2239
|
var r;
|
|
2233
2240
|
(r = e.current) == null || r.focus();
|
|
2234
2241
|
}, []), e;
|
|
2235
|
-
}, Rr = ["true", "false"], hn = /* @__PURE__ */
|
|
2242
|
+
}, Rr = ["true", "false"], hn = /* @__PURE__ */ Tr(Rr), yn = "answer", Pr = "flex items-center flex-wrap gap-2 p-2.5", Br = "min-w-0 max-w-full flex-auto", jr = xr(({
|
|
2236
2243
|
label: e,
|
|
2237
2244
|
...r
|
|
2238
2245
|
}, t) => u("button", {
|
|
@@ -2243,7 +2250,7 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2243
2250
|
class: "text-center text-base",
|
|
2244
2251
|
children: e
|
|
2245
2252
|
})
|
|
2246
|
-
})),
|
|
2253
|
+
})), mn = ({
|
|
2247
2254
|
input: e,
|
|
2248
2255
|
onSubmitSuccess: r
|
|
2249
2256
|
}) => {
|
|
@@ -2253,49 +2260,49 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2253
2260
|
class: "",
|
|
2254
2261
|
onSubmit: (s) => {
|
|
2255
2262
|
s.preventDefault();
|
|
2256
|
-
const
|
|
2263
|
+
const a = ds(s).value, i = rn(hn, a);
|
|
2257
2264
|
r({
|
|
2258
2265
|
type: "boolean",
|
|
2259
|
-
value:
|
|
2266
|
+
value: i === "true"
|
|
2260
2267
|
});
|
|
2261
2268
|
},
|
|
2262
2269
|
children: [u("ul", {
|
|
2263
2270
|
class: Pr,
|
|
2264
|
-
children: Rr.map((s,
|
|
2271
|
+
children: Rr.map((s, a) => u("li", {
|
|
2265
2272
|
class: Br,
|
|
2266
2273
|
children: u(jr, {
|
|
2267
|
-
ref:
|
|
2274
|
+
ref: a === 0 ? t : null,
|
|
2268
2275
|
type: "submit",
|
|
2269
|
-
name:
|
|
2276
|
+
name: yn,
|
|
2270
2277
|
value: s,
|
|
2271
2278
|
label: e.config.labels[s]
|
|
2272
2279
|
}, s)
|
|
2273
2280
|
}))
|
|
2274
2281
|
}), e.config.optional && u("div", {
|
|
2275
2282
|
class: "px-2 pb-2",
|
|
2276
|
-
children: u(
|
|
2283
|
+
children: u(Ae, {
|
|
2277
2284
|
class: "relative w-full",
|
|
2278
2285
|
type: "button",
|
|
2279
2286
|
onClick: () => r(null)
|
|
2280
2287
|
})
|
|
2281
2288
|
})]
|
|
2282
2289
|
});
|
|
2283
|
-
},
|
|
2290
|
+
}, gn = (e) => new Promise((r, t) => {
|
|
2284
2291
|
const s = new FileReader();
|
|
2285
2292
|
s.onload = () => {
|
|
2286
2293
|
if (typeof s.result != "string" || !s.result)
|
|
2287
2294
|
return t(new Error("Invalid file"));
|
|
2288
2295
|
r(s.result);
|
|
2289
2296
|
}, s.onerror = t, s.readAsDataURL(e);
|
|
2290
|
-
}), Gt = (e) => e.reduce((r, t) => r + t.sizeKb, 0),
|
|
2297
|
+
}), Gt = (e) => e.reduce((r, t) => r + t.sizeKb, 0), bn = Re("file"), Ht = 3, ct = (e) => {
|
|
2291
2298
|
const r = e.lastIndexOf(".");
|
|
2292
2299
|
return r === -1 ? [e, ""] : [e.slice(0, r), e.slice(r)];
|
|
2293
|
-
},
|
|
2300
|
+
}, vn = ({
|
|
2294
2301
|
file: e,
|
|
2295
2302
|
class: r,
|
|
2296
2303
|
...t
|
|
2297
2304
|
}) => {
|
|
2298
|
-
const [s,
|
|
2305
|
+
const [s, a] = ct(e.name);
|
|
2299
2306
|
return u("div", {
|
|
2300
2307
|
class: Oe("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline", r),
|
|
2301
2308
|
...t,
|
|
@@ -2306,12 +2313,12 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2306
2313
|
class: "block truncate",
|
|
2307
2314
|
children: s
|
|
2308
2315
|
}), u("span", {
|
|
2309
|
-
children:
|
|
2316
|
+
children: a
|
|
2310
2317
|
})]
|
|
2311
2318
|
}), u("p", {
|
|
2312
2319
|
"aria-label": "File size",
|
|
2313
2320
|
class: "text-accent-11",
|
|
2314
|
-
children:
|
|
2321
|
+
children: Ge(e.sizeKb)
|
|
2315
2322
|
})]
|
|
2316
2323
|
});
|
|
2317
2324
|
}, Jt = ({
|
|
@@ -2320,27 +2327,27 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2320
2327
|
}) => u("li", {
|
|
2321
2328
|
class: Oe("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
|
|
2322
2329
|
...r
|
|
2323
|
-
}),
|
|
2324
|
-
const [t, s] =
|
|
2330
|
+
}), xn = (e, r) => {
|
|
2331
|
+
const [t, s] = ct(e);
|
|
2325
2332
|
return `${t.slice(0, r)}${s}`;
|
|
2326
2333
|
}, Xt = (e) => ({
|
|
2327
|
-
name:
|
|
2334
|
+
name: xn(e.name, 42),
|
|
2328
2335
|
sizeKb: e.size / 1e3
|
|
2329
|
-
}),
|
|
2330
|
-
const s =
|
|
2331
|
-
return `chatbot-file-refused:${e}:${
|
|
2332
|
-
},
|
|
2336
|
+
}), wn = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], _n = (e, r, t) => {
|
|
2337
|
+
const s = ct(r.name)[1].toLowerCase(), a = [...t.map((n) => n.toLowerCase()), ...wn], i = s === "" ? "none" : a.includes(s) ? s : "other";
|
|
2338
|
+
return `chatbot-file-refused:${e}:${i}`;
|
|
2339
|
+
}, kn = ({
|
|
2333
2340
|
input: e,
|
|
2334
2341
|
onSubmitSuccess: r,
|
|
2335
2342
|
analytics: t
|
|
2336
2343
|
}) => {
|
|
2337
|
-
var
|
|
2338
|
-
const s = (
|
|
2344
|
+
var V;
|
|
2345
|
+
const s = (V = $.current$.value.flow) == null ? void 0 : V.data.submissions[e.key], [a, i] = ve(bn(s) && s.value.length ? {
|
|
2339
2346
|
status: "ready",
|
|
2340
2347
|
files: s.value
|
|
2341
2348
|
} : {
|
|
2342
2349
|
status: "empty"
|
|
2343
|
-
}), n =
|
|
2350
|
+
}), n = pe(0), o = a.status === "ready" ? a.files : [], c = a.status === "ready" || a.status === "pending" ? a.files : [], p = a.status === "error" ? a.error : void 0, b = c.length - Ht, x = Gt(c), h = Vt(), {
|
|
2344
2351
|
t: m
|
|
2345
2352
|
} = se(), C = (I) => {
|
|
2346
2353
|
if (!I.length)
|
|
@@ -2368,7 +2375,7 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2368
2375
|
error: {
|
|
2369
2376
|
type: "max",
|
|
2370
2377
|
message: m("validation_file_size", {
|
|
2371
|
-
size:
|
|
2378
|
+
size: Ge(e.config.fileSizeLimitKib)
|
|
2372
2379
|
})
|
|
2373
2380
|
}
|
|
2374
2381
|
};
|
|
@@ -2383,22 +2390,22 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2383
2390
|
}
|
|
2384
2391
|
};
|
|
2385
2392
|
}, E = (I, y) => {
|
|
2386
|
-
var _,
|
|
2393
|
+
var _, F;
|
|
2387
2394
|
return t.log({
|
|
2388
2395
|
event: "INTERACTION",
|
|
2389
2396
|
properties: {
|
|
2390
|
-
tag:
|
|
2397
|
+
tag: _n(I, y, e.config.extensions)
|
|
2391
2398
|
},
|
|
2392
|
-
customProperties: (
|
|
2399
|
+
customProperties: (F = (_ = $.current$.peek().flow) == null ? void 0 : _.analytics) == null ? void 0 : F.customProperties
|
|
2393
2400
|
});
|
|
2394
2401
|
};
|
|
2395
2402
|
return u("form", {
|
|
2396
2403
|
class: "flex flex-col gap-1 p-2.5",
|
|
2397
2404
|
onSubmit: (I) => {
|
|
2398
|
-
if (I.preventDefault(),
|
|
2405
|
+
if (I.preventDefault(), a.status === "pending" || a.status === "error")
|
|
2399
2406
|
return;
|
|
2400
2407
|
const y = C(o);
|
|
2401
|
-
y ?
|
|
2408
|
+
y ? i({
|
|
2402
2409
|
status: "error",
|
|
2403
2410
|
error: y.error
|
|
2404
2411
|
}) : r({
|
|
@@ -2409,13 +2416,13 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2409
2416
|
children: [u("div", {
|
|
2410
2417
|
class: "flex items-center gap-2",
|
|
2411
2418
|
children: [u("label", {
|
|
2412
|
-
ref:
|
|
2419
|
+
ref: h,
|
|
2413
2420
|
for: "dropzone-file",
|
|
2414
2421
|
class: "border-neutral-8 bg-neutral-2 flex h-48 w-full cursor-pointer flex-col items-center justify-center overflow-hidden rounded-2xl border border-dashed p-4",
|
|
2415
2422
|
children: [c.length > 0 ? u("ul", {
|
|
2416
2423
|
class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
|
|
2417
2424
|
children: [c.slice(0, Ht).map((I) => {
|
|
2418
|
-
const [y, _] =
|
|
2425
|
+
const [y, _] = ct(I.name);
|
|
2419
2426
|
return u(Jt, {
|
|
2420
2427
|
class: "flex overflow-hidden",
|
|
2421
2428
|
children: [u("span", {
|
|
@@ -2453,7 +2460,7 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2453
2460
|
}), e.config.fileSizeLimitKib ? u("p", {
|
|
2454
2461
|
class: "text-neutral-10 text-xs",
|
|
2455
2462
|
children: ["(", m("file_max_size", {
|
|
2456
|
-
size:
|
|
2463
|
+
size: Ge(e.config.fileSizeLimitKib)
|
|
2457
2464
|
}), ")"]
|
|
2458
2465
|
}) : null]
|
|
2459
2466
|
}), u("aside", {
|
|
@@ -2474,15 +2481,15 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2474
2481
|
}), u("p", {
|
|
2475
2482
|
role: "status",
|
|
2476
2483
|
class: Oe("text-neutral-11 flex items-center gap-1.5 text-xs", c.length === 0 && "sr-only"),
|
|
2477
|
-
children:
|
|
2478
|
-
children: [u(
|
|
2484
|
+
children: a.status === "pending" ? u(we, {
|
|
2485
|
+
children: [u(St, {
|
|
2479
2486
|
"aria-hidden": "true",
|
|
2480
2487
|
class: "h-4 w-4"
|
|
2481
2488
|
}), m("file_preparing", {
|
|
2482
2489
|
count: c.length
|
|
2483
2490
|
})]
|
|
2484
|
-
}) :
|
|
2485
|
-
children: [
|
|
2491
|
+
}) : a.status === "ready" ? u(we, {
|
|
2492
|
+
children: [Ge(x), " ", o.length > 1 ? "total" : "", u("span", {
|
|
2486
2493
|
class: "sr-only",
|
|
2487
2494
|
children: [". ", m("file_ready", {
|
|
2488
2495
|
count: o.length
|
|
@@ -2498,36 +2505,36 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2498
2505
|
const [_] = y;
|
|
2499
2506
|
if (!_)
|
|
2500
2507
|
return;
|
|
2501
|
-
const
|
|
2508
|
+
const F = ++n.current, M = a.status === "ready", O = y.map(Xt), G = C(O);
|
|
2502
2509
|
if (G)
|
|
2503
|
-
return E(G.reason, G.file ?? _),
|
|
2510
|
+
return E(G.reason, G.file ?? _), i({
|
|
2504
2511
|
status: "error",
|
|
2505
2512
|
error: G.error
|
|
2506
2513
|
});
|
|
2507
|
-
|
|
2514
|
+
i({
|
|
2508
2515
|
status: "pending",
|
|
2509
2516
|
files: O
|
|
2510
2517
|
});
|
|
2511
|
-
let
|
|
2518
|
+
let L;
|
|
2512
2519
|
try {
|
|
2513
|
-
const U = await Promise.all(y.map(async (
|
|
2520
|
+
const U = await Promise.all(y.map(async (D) => {
|
|
2514
2521
|
try {
|
|
2515
2522
|
return {
|
|
2516
|
-
...Xt(
|
|
2517
|
-
data: await
|
|
2523
|
+
...Xt(D),
|
|
2524
|
+
data: await gn(D)
|
|
2518
2525
|
};
|
|
2519
|
-
} catch (
|
|
2520
|
-
throw
|
|
2526
|
+
} catch (T) {
|
|
2527
|
+
throw L ?? (L = D), T;
|
|
2521
2528
|
}
|
|
2522
2529
|
}));
|
|
2523
|
-
n.current ===
|
|
2530
|
+
n.current === F && i({
|
|
2524
2531
|
status: "ready",
|
|
2525
2532
|
files: U
|
|
2526
2533
|
});
|
|
2527
2534
|
} catch {
|
|
2528
|
-
if (n.current !==
|
|
2535
|
+
if (n.current !== F)
|
|
2529
2536
|
return;
|
|
2530
|
-
E("unreadable",
|
|
2537
|
+
E("unreadable", L ?? _), i({
|
|
2531
2538
|
status: "error",
|
|
2532
2539
|
error: {
|
|
2533
2540
|
type: "invalid",
|
|
@@ -2545,50 +2552,50 @@ const Xe = nt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2545
2552
|
class: "flex h-full flex-col items-center gap-2",
|
|
2546
2553
|
children: [u(Ee, {
|
|
2547
2554
|
disabled: o.length === 0
|
|
2548
|
-
}), e.config.optional && u(
|
|
2555
|
+
}), e.config.optional && u(Ae, {
|
|
2549
2556
|
class: "relative",
|
|
2550
2557
|
onClick: () => r(null)
|
|
2551
2558
|
})]
|
|
2552
2559
|
})]
|
|
2553
2560
|
}), u(Pe, {
|
|
2554
|
-
error:
|
|
2561
|
+
error: p
|
|
2555
2562
|
})]
|
|
2556
2563
|
});
|
|
2557
2564
|
};
|
|
2558
|
-
var
|
|
2565
|
+
var Qe = (e) => e.type === "checkbox", Ve = (e) => e instanceof Date, re = (e) => e == null;
|
|
2559
2566
|
const $r = (e) => typeof e == "object";
|
|
2560
|
-
var K = (e) => !re(e) && !Array.isArray(e) && $r(e) && !
|
|
2567
|
+
var K = (e) => !re(e) && !Array.isArray(e) && $r(e) && !Ve(e), Cn = (e) => K(e) && e.target ? Qe(e.target) ? e.target.checked : e.target.value : e, Sn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, In = (e, r) => e.has(Sn(r)), An = (e) => {
|
|
2561
2568
|
const r = e.constructor && e.constructor.prototype;
|
|
2562
2569
|
return K(r) && r.hasOwnProperty("isPrototypeOf");
|
|
2563
|
-
},
|
|
2564
|
-
function
|
|
2570
|
+
}, Mt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
2571
|
+
function J(e) {
|
|
2565
2572
|
if (e instanceof Date)
|
|
2566
2573
|
return new Date(e);
|
|
2567
2574
|
const r = typeof FileList < "u" && e instanceof FileList;
|
|
2568
|
-
if (
|
|
2575
|
+
if (Mt && (e instanceof Blob || r))
|
|
2569
2576
|
return e;
|
|
2570
2577
|
const t = Array.isArray(e);
|
|
2571
|
-
if (!t && !(K(e) &&
|
|
2578
|
+
if (!t && !(K(e) && An(e)))
|
|
2572
2579
|
return e;
|
|
2573
2580
|
const s = t ? [] : Object.create(Object.getPrototypeOf(e));
|
|
2574
|
-
for (const
|
|
2575
|
-
Object.prototype.hasOwnProperty.call(e,
|
|
2581
|
+
for (const a in e)
|
|
2582
|
+
Object.prototype.hasOwnProperty.call(e, a) && (s[a] = J(e[a]));
|
|
2576
2583
|
return s;
|
|
2577
2584
|
}
|
|
2578
|
-
var
|
|
2585
|
+
var dt = (e) => /^\w*$/.test(e), z = (e) => e === void 0, Et = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Nt = (e) => Et(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, r, t) => {
|
|
2579
2586
|
if (!r || !K(e))
|
|
2580
2587
|
return t;
|
|
2581
|
-
const s = (
|
|
2588
|
+
const s = (dt(r) ? [r] : Nt(r)).reduce((a, i) => re(a) ? a : a[i], e);
|
|
2582
2589
|
return z(s) || s === e ? z(e[r]) ? t : e[r] : s;
|
|
2583
|
-
},
|
|
2590
|
+
}, fe = (e) => typeof e == "boolean", oe = (e) => typeof e == "function", j = (e, r, t) => {
|
|
2584
2591
|
let s = -1;
|
|
2585
|
-
const
|
|
2586
|
-
for (; ++s <
|
|
2587
|
-
const o =
|
|
2592
|
+
const a = dt(r) ? [r] : Nt(r), i = a.length, n = i - 1;
|
|
2593
|
+
for (; ++s < i; ) {
|
|
2594
|
+
const o = a[s];
|
|
2588
2595
|
let c = t;
|
|
2589
2596
|
if (s !== n) {
|
|
2590
|
-
const
|
|
2591
|
-
c = K(
|
|
2597
|
+
const p = e[o];
|
|
2598
|
+
c = K(p) || Array.isArray(p) ? p : isNaN(+a[s + 1]) ? {} : [];
|
|
2592
2599
|
}
|
|
2593
2600
|
if (o === "__proto__" || o === "constructor" || o === "prototype")
|
|
2594
2601
|
return;
|
|
@@ -2605,7 +2612,7 @@ const Zt = {
|
|
|
2605
2612
|
onSubmit: "onSubmit",
|
|
2606
2613
|
onTouched: "onTouched",
|
|
2607
2614
|
all: "all"
|
|
2608
|
-
},
|
|
2615
|
+
}, be = {
|
|
2609
2616
|
max: "max",
|
|
2610
2617
|
min: "min",
|
|
2611
2618
|
maxLength: "maxLength",
|
|
@@ -2616,64 +2623,64 @@ const Zt = {
|
|
|
2616
2623
|
}, Fn = Q.createContext(null);
|
|
2617
2624
|
Fn.displayName = "HookFormControlContext";
|
|
2618
2625
|
var Vn = (e, r, t, s = !0) => {
|
|
2619
|
-
const
|
|
2626
|
+
const a = {
|
|
2620
2627
|
defaultValues: r._defaultValues
|
|
2621
2628
|
};
|
|
2622
|
-
for (const
|
|
2623
|
-
Object.defineProperty(
|
|
2629
|
+
for (const i in e)
|
|
2630
|
+
Object.defineProperty(a, i, {
|
|
2624
2631
|
get: () => {
|
|
2625
|
-
const n =
|
|
2632
|
+
const n = i;
|
|
2626
2633
|
return r._proxyFormState[n] !== le.all && (r._proxyFormState[n] = !s || le.all), t && (t[n] = !0), e[n];
|
|
2627
2634
|
}
|
|
2628
2635
|
});
|
|
2629
|
-
return
|
|
2636
|
+
return a;
|
|
2630
2637
|
};
|
|
2631
|
-
const
|
|
2632
|
-
var ne = (e) => typeof e == "string",
|
|
2638
|
+
const Mn = typeof window < "u" ? Q.useLayoutEffect : Q.useEffect;
|
|
2639
|
+
var ne = (e) => typeof e == "string", En = (e, r, t, s, a) => ne(e) ? (s && r.watch.add(e), S(t, e, a)) : Array.isArray(e) ? e.map((i) => (s && r.watch.add(i), S(t, i))) : (s && (r.watchAll = !0), t), _t = (e) => re(e) || !$r(e);
|
|
2633
2640
|
function Ce(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
2634
|
-
if (
|
|
2641
|
+
if (_t(e) || _t(r))
|
|
2635
2642
|
return Object.is(e, r);
|
|
2636
|
-
if (
|
|
2643
|
+
if (Ve(e) && Ve(r))
|
|
2637
2644
|
return Object.is(e.getTime(), r.getTime());
|
|
2638
|
-
const s = Object.keys(e),
|
|
2639
|
-
if (s.length !==
|
|
2645
|
+
const s = Object.keys(e), a = Object.keys(r);
|
|
2646
|
+
if (s.length !== a.length)
|
|
2640
2647
|
return !1;
|
|
2641
2648
|
if (t.has(e) || t.has(r))
|
|
2642
2649
|
return !0;
|
|
2643
2650
|
t.add(e), t.add(r);
|
|
2644
|
-
for (const
|
|
2645
|
-
const n = e[
|
|
2646
|
-
if (!
|
|
2651
|
+
for (const i of s) {
|
|
2652
|
+
const n = e[i];
|
|
2653
|
+
if (!a.includes(i))
|
|
2647
2654
|
return !1;
|
|
2648
|
-
if (
|
|
2649
|
-
const o = r[
|
|
2650
|
-
if (
|
|
2655
|
+
if (i !== "ref") {
|
|
2656
|
+
const o = r[i];
|
|
2657
|
+
if (Ve(n) && Ve(o) || K(n) && K(o) || Array.isArray(n) && Array.isArray(o) ? !Ce(n, o, t) : !Object.is(n, o))
|
|
2651
2658
|
return !1;
|
|
2652
2659
|
}
|
|
2653
2660
|
}
|
|
2654
2661
|
return !0;
|
|
2655
2662
|
}
|
|
2656
|
-
const
|
|
2657
|
-
|
|
2658
|
-
var qr = (e, r, t, s,
|
|
2663
|
+
const Nn = Q.createContext(null);
|
|
2664
|
+
Nn.displayName = "HookFormContext";
|
|
2665
|
+
var qr = (e, r, t, s, a) => r ? {
|
|
2659
2666
|
...t[e],
|
|
2660
2667
|
types: {
|
|
2661
2668
|
...t[e] && t[e].types ? t[e].types : {},
|
|
2662
|
-
[s]:
|
|
2669
|
+
[s]: a || !0
|
|
2663
2670
|
}
|
|
2664
|
-
} : {},
|
|
2671
|
+
} : {}, Xe = (e) => Array.isArray(e) ? e : [e], Yt = () => {
|
|
2665
2672
|
let e = [];
|
|
2666
2673
|
return {
|
|
2667
2674
|
get observers() {
|
|
2668
2675
|
return e;
|
|
2669
2676
|
},
|
|
2670
|
-
next: (
|
|
2671
|
-
for (const
|
|
2672
|
-
|
|
2677
|
+
next: (a) => {
|
|
2678
|
+
for (const i of e)
|
|
2679
|
+
i.next && i.next(a);
|
|
2673
2680
|
},
|
|
2674
|
-
subscribe: (
|
|
2681
|
+
subscribe: (a) => (e.push(a), {
|
|
2675
2682
|
unsubscribe: () => {
|
|
2676
|
-
e = e.filter((
|
|
2683
|
+
e = e.filter((i) => i !== a);
|
|
2677
2684
|
}
|
|
2678
2685
|
}),
|
|
2679
2686
|
unsubscribe: () => {
|
|
@@ -2685,22 +2692,22 @@ function Ur(e, r) {
|
|
|
2685
2692
|
const t = {};
|
|
2686
2693
|
for (const s in e)
|
|
2687
2694
|
if (e.hasOwnProperty(s)) {
|
|
2688
|
-
const
|
|
2689
|
-
if (
|
|
2690
|
-
const n = Ur(
|
|
2695
|
+
const a = e[s], i = r[s];
|
|
2696
|
+
if (a && K(a) && i) {
|
|
2697
|
+
const n = Ur(a, i);
|
|
2691
2698
|
K(n) && (t[s] = n);
|
|
2692
2699
|
} else
|
|
2693
|
-
e[s] && (t[s] =
|
|
2700
|
+
e[s] && (t[s] = i);
|
|
2694
2701
|
}
|
|
2695
2702
|
return t;
|
|
2696
2703
|
}
|
|
2697
|
-
var ee = (e) => K(e) && !Object.keys(e).length,
|
|
2698
|
-
if (!
|
|
2704
|
+
var ee = (e) => K(e) && !Object.keys(e).length, Lt = (e) => e.type === "file", at = (e) => {
|
|
2705
|
+
if (!Mt)
|
|
2699
2706
|
return !1;
|
|
2700
2707
|
const r = e ? e.ownerDocument : 0;
|
|
2701
2708
|
return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
|
|
2702
|
-
}, zr = (e) => e.type === "select-multiple",
|
|
2703
|
-
function
|
|
2709
|
+
}, zr = (e) => e.type === "select-multiple", Dt = (e) => e.type === "radio", Ln = (e) => Dt(e) || Qe(e), xt = (e) => at(e) && e.isConnected;
|
|
2710
|
+
function Dn(e, r) {
|
|
2704
2711
|
const t = r.slice(0, -1).length;
|
|
2705
2712
|
let s = 0;
|
|
2706
2713
|
for (; s < t; )
|
|
@@ -2714,34 +2721,34 @@ function Tn(e) {
|
|
|
2714
2721
|
return !0;
|
|
2715
2722
|
}
|
|
2716
2723
|
function W(e, r) {
|
|
2717
|
-
const t = Array.isArray(r) ? r :
|
|
2718
|
-
return s && delete s[
|
|
2724
|
+
const t = Array.isArray(r) ? r : dt(r) ? [r] : Nt(r), s = t.length === 1 ? e : Dn(e, t), a = t.length - 1, i = t[a];
|
|
2725
|
+
return s && delete s[i], a !== 0 && (K(s) && ee(s) || Array.isArray(s) && Tn(s)) && W(e, t.slice(0, -1)), e;
|
|
2719
2726
|
}
|
|
2720
|
-
var
|
|
2727
|
+
var On = (e) => {
|
|
2721
2728
|
for (const r in e)
|
|
2722
2729
|
if (oe(e[r]))
|
|
2723
2730
|
return !0;
|
|
2724
2731
|
return !1;
|
|
2725
2732
|
};
|
|
2726
2733
|
function Wr(e) {
|
|
2727
|
-
return Array.isArray(e) || K(e) && !
|
|
2734
|
+
return Array.isArray(e) || K(e) && !On(e);
|
|
2728
2735
|
}
|
|
2729
|
-
function
|
|
2736
|
+
function kt(e, r = {}) {
|
|
2730
2737
|
for (const t in e) {
|
|
2731
2738
|
const s = e[t];
|
|
2732
|
-
Wr(s) ? (r[t] = Array.isArray(s) ? [] : {},
|
|
2739
|
+
Wr(s) ? (r[t] = Array.isArray(s) ? [] : {}, kt(s, r[t])) : z(s) || (r[t] = !0);
|
|
2733
2740
|
}
|
|
2734
2741
|
return r;
|
|
2735
2742
|
}
|
|
2736
2743
|
function Le(e, r, t) {
|
|
2737
|
-
t || (t =
|
|
2744
|
+
t || (t = kt(r));
|
|
2738
2745
|
for (const s in e) {
|
|
2739
|
-
const
|
|
2740
|
-
if (Wr(
|
|
2741
|
-
z(r) ||
|
|
2746
|
+
const a = e[s];
|
|
2747
|
+
if (Wr(a))
|
|
2748
|
+
z(r) || _t(t[s]) ? t[s] = kt(a, Array.isArray(a) ? [] : {}) : Le(a, re(r) ? {} : r[s], t[s]);
|
|
2742
2749
|
else {
|
|
2743
|
-
const
|
|
2744
|
-
t[s] = !Ce(
|
|
2750
|
+
const i = r[s];
|
|
2751
|
+
t[s] = !Ce(a, i);
|
|
2745
2752
|
}
|
|
2746
2753
|
}
|
|
2747
2754
|
return t;
|
|
@@ -2773,21 +2780,21 @@ var Hr = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disab
|
|
|
2773
2780
|
} : r, tr) : tr;
|
|
2774
2781
|
function rr(e) {
|
|
2775
2782
|
const r = e.ref;
|
|
2776
|
-
return
|
|
2783
|
+
return Lt(r) ? r.files : Dt(r) ? Hr(e.refs).value : zr(r) ? [...r.selectedOptions].map(({ value: t }) => t) : Qe(r) ? Kr(e.refs).value : Gr(z(r.value) ? e.ref.value : r.value, e);
|
|
2777
2784
|
}
|
|
2778
|
-
var
|
|
2779
|
-
const
|
|
2780
|
-
for (const
|
|
2781
|
-
const n = S(r,
|
|
2782
|
-
n &&
|
|
2785
|
+
var Rn = (e, r, t, s) => {
|
|
2786
|
+
const a = {};
|
|
2787
|
+
for (const i of e) {
|
|
2788
|
+
const n = S(r, i);
|
|
2789
|
+
n && j(a, i, n._f);
|
|
2783
2790
|
}
|
|
2784
2791
|
return {
|
|
2785
2792
|
criteriaMode: t,
|
|
2786
2793
|
names: [...e],
|
|
2787
|
-
fields:
|
|
2794
|
+
fields: a,
|
|
2788
2795
|
shouldUseNativeValidation: s
|
|
2789
2796
|
};
|
|
2790
|
-
},
|
|
2797
|
+
}, it = (e) => e instanceof RegExp, ze = (e) => z(e) ? e : it(e) ? e.source : K(e) ? it(e.value) ? e.value.source : e.value : e, sr = (e) => ({
|
|
2791
2798
|
isOnSubmit: !e || e === le.onSubmit,
|
|
2792
2799
|
isOnBlur: e === le.onBlur,
|
|
2793
2800
|
isOnChange: e === le.onChange,
|
|
@@ -2795,142 +2802,142 @@ var On = (e, r, t, s) => {
|
|
|
2795
2802
|
isOnTouch: e === le.onTouched
|
|
2796
2803
|
});
|
|
2797
2804
|
const nr = "AsyncFunction";
|
|
2798
|
-
var
|
|
2799
|
-
const
|
|
2800
|
-
for (const
|
|
2801
|
-
const
|
|
2802
|
-
if (
|
|
2803
|
-
const { _f: n, ...o } =
|
|
2805
|
+
var Pn = (e) => !!e && !!e.validate && !!(oe(e.validate) && e.validate.constructor.name === nr || K(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === nr)), Bn = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), ar = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((s) => e.startsWith(s) && /^\.\w+/.test(e.slice(s.length))));
|
|
2806
|
+
const Ze = (e, r, t, s) => {
|
|
2807
|
+
for (const a of t || Object.keys(e)) {
|
|
2808
|
+
const i = S(e, a);
|
|
2809
|
+
if (i) {
|
|
2810
|
+
const { _f: n, ...o } = i;
|
|
2804
2811
|
if (n) {
|
|
2805
|
-
if (n.refs && n.refs[0] && r(n.refs[0],
|
|
2812
|
+
if (n.refs && n.refs[0] && r(n.refs[0], a) && !s)
|
|
2806
2813
|
return !0;
|
|
2807
2814
|
if (n.ref && r(n.ref, n.name) && !s)
|
|
2808
2815
|
return !0;
|
|
2809
|
-
if (
|
|
2816
|
+
if (Ze(o, r))
|
|
2810
2817
|
break;
|
|
2811
|
-
} else if (K(o) &&
|
|
2818
|
+
} else if (K(o) && Ze(o, r))
|
|
2812
2819
|
break;
|
|
2813
2820
|
}
|
|
2814
2821
|
}
|
|
2815
2822
|
};
|
|
2816
|
-
function
|
|
2823
|
+
function ir(e, r, t) {
|
|
2817
2824
|
const s = S(e, t);
|
|
2818
|
-
if (s ||
|
|
2825
|
+
if (s || dt(t))
|
|
2819
2826
|
return {
|
|
2820
2827
|
error: s,
|
|
2821
2828
|
name: t
|
|
2822
2829
|
};
|
|
2823
|
-
const
|
|
2824
|
-
for (;
|
|
2825
|
-
const
|
|
2826
|
-
if (n && !Array.isArray(n) && t !==
|
|
2830
|
+
const a = t.split(".");
|
|
2831
|
+
for (; a.length; ) {
|
|
2832
|
+
const i = a.join("."), n = S(r, i), o = S(e, i);
|
|
2833
|
+
if (n && !Array.isArray(n) && t !== i)
|
|
2827
2834
|
return { name: t };
|
|
2828
2835
|
if (o && o.type)
|
|
2829
2836
|
return {
|
|
2830
|
-
name:
|
|
2837
|
+
name: i,
|
|
2831
2838
|
error: o
|
|
2832
2839
|
};
|
|
2833
2840
|
if (o && o.root && o.root.type)
|
|
2834
2841
|
return {
|
|
2835
|
-
name: `${
|
|
2842
|
+
name: `${i}.root`,
|
|
2836
2843
|
error: o.root
|
|
2837
2844
|
};
|
|
2838
|
-
|
|
2845
|
+
a.pop();
|
|
2839
2846
|
}
|
|
2840
2847
|
return {
|
|
2841
2848
|
name: t
|
|
2842
2849
|
};
|
|
2843
2850
|
}
|
|
2844
|
-
var
|
|
2851
|
+
var jn = (e, r, t, s) => {
|
|
2845
2852
|
t(e);
|
|
2846
|
-
const { name:
|
|
2847
|
-
return ee(
|
|
2848
|
-
},
|
|
2849
|
-
const s =
|
|
2850
|
-
return
|
|
2853
|
+
const { name: a, ...i } = e;
|
|
2854
|
+
return ee(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((n) => r[n] === (!s || le.all));
|
|
2855
|
+
}, $n = (e, r, t) => !e || !r || e === r || Xe(e).some((s) => s && (t ? s === r : s.startsWith(r) || r.startsWith(s))), qn = (e, r, t, s, a) => a.isOnAll ? !1 : !t && a.isOnTouch ? !(r || e) : (t ? s.isOnBlur : a.isOnBlur) ? !e : (t ? s.isOnChange : a.isOnChange) ? e : !0, Un = (e, r) => !Et(S(e, r)).length && W(e, r), zn = (e, r, t) => {
|
|
2856
|
+
const s = Xe(S(e, t));
|
|
2857
|
+
return j(s, "root", r[t]), j(e, t, s), e;
|
|
2851
2858
|
};
|
|
2852
2859
|
function or(e, r, t = "validate") {
|
|
2853
|
-
if (ne(e) || Array.isArray(e) && e.every(ne) ||
|
|
2860
|
+
if (ne(e) || Array.isArray(e) && e.every(ne) || fe(e) && !e)
|
|
2854
2861
|
return {
|
|
2855
2862
|
type: t,
|
|
2856
2863
|
message: ne(e) ? e : "",
|
|
2857
2864
|
ref: r
|
|
2858
2865
|
};
|
|
2859
2866
|
}
|
|
2860
|
-
var Ne = (e) => K(e) && !
|
|
2867
|
+
var Ne = (e) => K(e) && !it(e) ? e : {
|
|
2861
2868
|
value: e,
|
|
2862
2869
|
message: ""
|
|
2863
|
-
}, lr = async (e, r, t, s,
|
|
2864
|
-
const { ref: n, refs: o, required: c, maxLength:
|
|
2870
|
+
}, lr = async (e, r, t, s, a, i) => {
|
|
2871
|
+
const { ref: n, refs: o, required: c, maxLength: p, minLength: b, min: x, max: h, pattern: m, validate: C, name: E, valueAsNumber: V, mount: I } = e._f, y = S(t, E);
|
|
2865
2872
|
if (!I || r.has(E))
|
|
2866
2873
|
return {};
|
|
2867
|
-
const _ = o ? o[0] : n,
|
|
2868
|
-
|
|
2869
|
-
}, M = {}, O =
|
|
2870
|
-
const
|
|
2874
|
+
const _ = o ? o[0] : n, F = (w) => {
|
|
2875
|
+
a && _.reportValidity && (_.setCustomValidity(fe(w) ? "" : w || ""), _.reportValidity());
|
|
2876
|
+
}, M = {}, O = Dt(n), G = Qe(n), L = O || G, U = (V || Lt(n)) && z(n.value) && z(y) || at(n) && n.value === "" || y === "" || Array.isArray(y) && !y.length, D = qr.bind(null, E, s, M), T = (w, N, q, H = be.maxLength, X = be.minLength) => {
|
|
2877
|
+
const te = w ? N : q;
|
|
2871
2878
|
M[E] = {
|
|
2872
|
-
type: w ?
|
|
2873
|
-
message:
|
|
2879
|
+
type: w ? H : X,
|
|
2880
|
+
message: te,
|
|
2874
2881
|
ref: n,
|
|
2875
|
-
...
|
|
2882
|
+
...D(w ? H : X, te)
|
|
2876
2883
|
};
|
|
2877
2884
|
};
|
|
2878
|
-
if (
|
|
2879
|
-
const { value: w, message:
|
|
2885
|
+
if (i ? !Array.isArray(y) || !y.length : c && (!L && (U || re(y)) || fe(y) && !y || G && !Kr(o).isValid || O && !Hr(o).isValid)) {
|
|
2886
|
+
const { value: w, message: N } = ne(c) ? { value: !!c, message: c } : Ne(c);
|
|
2880
2887
|
if (w && (M[E] = {
|
|
2881
|
-
type:
|
|
2882
|
-
message:
|
|
2888
|
+
type: be.required,
|
|
2889
|
+
message: N,
|
|
2883
2890
|
ref: _,
|
|
2884
|
-
...
|
|
2891
|
+
...D(be.required, N)
|
|
2885
2892
|
}, !s))
|
|
2886
|
-
return
|
|
2893
|
+
return F(N), M;
|
|
2887
2894
|
}
|
|
2888
|
-
if (!U && (!re(x) || !re(
|
|
2889
|
-
let w,
|
|
2890
|
-
const q = Ne(
|
|
2895
|
+
if (!U && (!re(x) || !re(h))) {
|
|
2896
|
+
let w, N;
|
|
2897
|
+
const q = Ne(h), H = Ne(x);
|
|
2891
2898
|
if (!re(y) && !isNaN(y)) {
|
|
2892
|
-
const
|
|
2893
|
-
re(q.value) || (w =
|
|
2899
|
+
const X = n.valueAsNumber || y && +y;
|
|
2900
|
+
re(q.value) || (w = X > q.value), re(H.value) || (N = X < H.value);
|
|
2894
2901
|
} else {
|
|
2895
|
-
const
|
|
2896
|
-
ne(q.value) && y && (w =
|
|
2902
|
+
const X = n.valueAsDate || new Date(y), te = (ce) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ce), _e = n.type == "time", ue = n.type == "week";
|
|
2903
|
+
ne(q.value) && y && (w = _e ? te(y) > te(q.value) : ue ? y > q.value : X > new Date(q.value)), ne(H.value) && y && (N = _e ? te(y) < te(H.value) : ue ? y < H.value : X < new Date(H.value));
|
|
2897
2904
|
}
|
|
2898
|
-
if ((w ||
|
|
2899
|
-
return
|
|
2905
|
+
if ((w || N) && (T(!!w, q.message, H.message, be.max, be.min), !s))
|
|
2906
|
+
return F(M[E].message), M;
|
|
2900
2907
|
}
|
|
2901
|
-
if ((
|
|
2902
|
-
const w = Ne(
|
|
2903
|
-
if ((q ||
|
|
2904
|
-
return
|
|
2908
|
+
if ((p || b) && !U && (ne(y) || i && Array.isArray(y))) {
|
|
2909
|
+
const w = Ne(p), N = Ne(b), q = !re(w.value) && y.length > +w.value, H = !re(N.value) && y.length < +N.value;
|
|
2910
|
+
if ((q || H) && (T(q, w.message, N.message), !s))
|
|
2911
|
+
return F(M[E].message), M;
|
|
2905
2912
|
}
|
|
2906
2913
|
if (m && !U && ne(y)) {
|
|
2907
|
-
const { value: w, message:
|
|
2908
|
-
if (
|
|
2909
|
-
type:
|
|
2910
|
-
message:
|
|
2914
|
+
const { value: w, message: N } = Ne(m);
|
|
2915
|
+
if (it(w) && !y.match(w) && (M[E] = {
|
|
2916
|
+
type: be.pattern,
|
|
2917
|
+
message: N,
|
|
2911
2918
|
ref: n,
|
|
2912
|
-
...
|
|
2919
|
+
...D(be.pattern, N)
|
|
2913
2920
|
}, !s))
|
|
2914
|
-
return
|
|
2921
|
+
return F(N), M;
|
|
2915
2922
|
}
|
|
2916
2923
|
if (C) {
|
|
2917
2924
|
if (oe(C)) {
|
|
2918
|
-
const w = await C(y, t),
|
|
2919
|
-
if (
|
|
2920
|
-
...
|
|
2921
|
-
...
|
|
2925
|
+
const w = await C(y, t), N = or(w, _);
|
|
2926
|
+
if (N && (M[E] = {
|
|
2927
|
+
...N,
|
|
2928
|
+
...D(be.validate, N.message)
|
|
2922
2929
|
}, !s))
|
|
2923
|
-
return
|
|
2930
|
+
return F(N.message), M;
|
|
2924
2931
|
} else if (K(C)) {
|
|
2925
2932
|
let w = {};
|
|
2926
|
-
for (const
|
|
2933
|
+
for (const N in C) {
|
|
2927
2934
|
if (!ee(w) && !s)
|
|
2928
2935
|
break;
|
|
2929
|
-
const q = or(await C[
|
|
2936
|
+
const q = or(await C[N](y, t), _, N);
|
|
2930
2937
|
q && (w = {
|
|
2931
2938
|
...q,
|
|
2932
|
-
...
|
|
2933
|
-
},
|
|
2939
|
+
...D(N, q.message)
|
|
2940
|
+
}, F(q.message), s && (M[E] = w));
|
|
2934
2941
|
}
|
|
2935
2942
|
if (!ee(w) && (M[E] = {
|
|
2936
2943
|
ref: _,
|
|
@@ -2939,16 +2946,16 @@ var Ne = (e) => K(e) && !rt(e) ? e : {
|
|
|
2939
2946
|
return M;
|
|
2940
2947
|
}
|
|
2941
2948
|
}
|
|
2942
|
-
return
|
|
2949
|
+
return F(!0), M;
|
|
2943
2950
|
};
|
|
2944
|
-
const
|
|
2951
|
+
const Wn = {
|
|
2945
2952
|
mode: le.onSubmit,
|
|
2946
2953
|
reValidateMode: le.onChange,
|
|
2947
2954
|
shouldFocusError: !0
|
|
2948
2955
|
};
|
|
2949
|
-
function
|
|
2956
|
+
function Kn(e = {}) {
|
|
2950
2957
|
let r = {
|
|
2951
|
-
...
|
|
2958
|
+
...Wn,
|
|
2952
2959
|
...e
|
|
2953
2960
|
}, t = {
|
|
2954
2961
|
submitCount: 0,
|
|
@@ -2965,7 +2972,7 @@ function Wn(e = {}) {
|
|
|
2965
2972
|
validatingFields: {},
|
|
2966
2973
|
errors: r.errors || {},
|
|
2967
2974
|
disabled: r.disabled || !1
|
|
2968
|
-
}, s = {},
|
|
2975
|
+
}, s = {}, a = K(r.defaultValues) || K(r.values) ? J(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : J(a), n = {
|
|
2969
2976
|
action: !1,
|
|
2970
2977
|
mount: !1,
|
|
2971
2978
|
watch: !1,
|
|
@@ -2976,7 +2983,7 @@ function Wn(e = {}) {
|
|
|
2976
2983
|
unMount: /* @__PURE__ */ new Set(),
|
|
2977
2984
|
array: /* @__PURE__ */ new Set(),
|
|
2978
2985
|
watch: /* @__PURE__ */ new Set()
|
|
2979
|
-
}, c,
|
|
2986
|
+
}, c, p = 0;
|
|
2980
2987
|
const b = {
|
|
2981
2988
|
isDirty: !1,
|
|
2982
2989
|
dirtyFields: !1,
|
|
@@ -2988,24 +2995,24 @@ function Wn(e = {}) {
|
|
|
2988
2995
|
}, x = {
|
|
2989
2996
|
...b
|
|
2990
2997
|
};
|
|
2991
|
-
let
|
|
2998
|
+
let h = {
|
|
2992
2999
|
...x
|
|
2993
3000
|
};
|
|
2994
3001
|
const m = {
|
|
2995
3002
|
array: Yt(),
|
|
2996
3003
|
state: Yt()
|
|
2997
3004
|
}, C = r.criteriaMode === le.all, E = (l) => (d) => {
|
|
2998
|
-
clearTimeout(
|
|
2999
|
-
},
|
|
3000
|
-
if (!n.keepIsValid && !r.disabled && (x.isValid ||
|
|
3005
|
+
clearTimeout(p), p = setTimeout(l, d);
|
|
3006
|
+
}, V = async (l) => {
|
|
3007
|
+
if (!n.keepIsValid && !r.disabled && (x.isValid || h.isValid || l)) {
|
|
3001
3008
|
let d;
|
|
3002
|
-
r.resolver ? (d = ee((await
|
|
3009
|
+
r.resolver ? (d = ee((await L()).errors), I()) : d = await D(s, !0), d !== t.isValid && m.state.next({
|
|
3003
3010
|
isValid: d
|
|
3004
3011
|
});
|
|
3005
3012
|
}
|
|
3006
3013
|
}, I = (l, d) => {
|
|
3007
|
-
!r.disabled && (x.isValidating || x.validatingFields ||
|
|
3008
|
-
f && (d ?
|
|
3014
|
+
!r.disabled && (x.isValidating || x.validatingFields || h.isValidating || h.validatingFields) && ((l || Array.from(o.mount)).forEach((f) => {
|
|
3015
|
+
f && (d ? j(t.validatingFields, f, d) : W(t.validatingFields, f));
|
|
3009
3016
|
}), m.state.next({
|
|
3010
3017
|
validatingFields: t.validatingFields,
|
|
3011
3018
|
isValidating: !ee(t.validatingFields)
|
|
@@ -3013,18 +3020,18 @@ function Wn(e = {}) {
|
|
|
3013
3020
|
}, y = (l, d = [], f, k, v = !0, g = !0) => {
|
|
3014
3021
|
if (k && f && !r.disabled) {
|
|
3015
3022
|
if (n.action = !0, g && Array.isArray(S(s, l))) {
|
|
3016
|
-
const
|
|
3017
|
-
v &&
|
|
3023
|
+
const A = f(S(s, l), k.argA, k.argB);
|
|
3024
|
+
v && j(s, l, A);
|
|
3018
3025
|
}
|
|
3019
3026
|
if (g && Array.isArray(S(t.errors, l))) {
|
|
3020
|
-
const
|
|
3021
|
-
v &&
|
|
3027
|
+
const A = f(S(t.errors, l), k.argA, k.argB);
|
|
3028
|
+
v && j(t.errors, l, A), Un(t.errors, l);
|
|
3022
3029
|
}
|
|
3023
|
-
if ((x.touchedFields ||
|
|
3024
|
-
const
|
|
3025
|
-
v &&
|
|
3030
|
+
if ((x.touchedFields || h.touchedFields) && g && Array.isArray(S(t.touchedFields, l))) {
|
|
3031
|
+
const A = f(S(t.touchedFields, l), k.argA, k.argB);
|
|
3032
|
+
v && j(t.touchedFields, l, A);
|
|
3026
3033
|
}
|
|
3027
|
-
(x.dirtyFields ||
|
|
3034
|
+
(x.dirtyFields || h.dirtyFields) && (t.dirtyFields = Le(a, i)), m.state.next({
|
|
3028
3035
|
name: l,
|
|
3029
3036
|
isDirty: w(l, d),
|
|
3030
3037
|
dirtyFields: t.dirtyFields,
|
|
@@ -3032,12 +3039,12 @@ function Wn(e = {}) {
|
|
|
3032
3039
|
isValid: t.isValid
|
|
3033
3040
|
});
|
|
3034
3041
|
} else
|
|
3035
|
-
|
|
3042
|
+
j(i, l, d);
|
|
3036
3043
|
}, _ = (l, d) => {
|
|
3037
|
-
|
|
3044
|
+
j(t.errors, l, d), m.state.next({
|
|
3038
3045
|
errors: t.errors
|
|
3039
3046
|
});
|
|
3040
|
-
},
|
|
3047
|
+
}, F = (l) => {
|
|
3041
3048
|
t.errors = l, m.state.next({
|
|
3042
3049
|
errors: t.errors,
|
|
3043
3050
|
isValid: !1
|
|
@@ -3045,165 +3052,165 @@ function Wn(e = {}) {
|
|
|
3045
3052
|
}, M = (l, d, f, k) => {
|
|
3046
3053
|
const v = S(s, l);
|
|
3047
3054
|
if (v) {
|
|
3048
|
-
const g = S(
|
|
3049
|
-
z(g) || k && k.defaultChecked || d ?
|
|
3055
|
+
const g = S(i, l, z(f) ? S(a, l) : f);
|
|
3056
|
+
z(g) || k && k.defaultChecked || d ? j(i, l, d ? g : rr(v._f)) : H(l, g), n.mount && !n.action && V();
|
|
3050
3057
|
}
|
|
3051
3058
|
}, O = (l, d, f, k, v) => {
|
|
3052
|
-
let g = !1,
|
|
3059
|
+
let g = !1, A = !1;
|
|
3053
3060
|
const R = {
|
|
3054
3061
|
name: l
|
|
3055
3062
|
};
|
|
3056
3063
|
if (!r.disabled) {
|
|
3057
3064
|
if (!f || k) {
|
|
3058
|
-
(x.isDirty ||
|
|
3059
|
-
const P = Ce(S(
|
|
3060
|
-
|
|
3065
|
+
(x.isDirty || h.isDirty) && (A = t.isDirty, t.isDirty = R.isDirty = w(), g = A !== R.isDirty);
|
|
3066
|
+
const P = Ce(S(a, l), d);
|
|
3067
|
+
A = !!S(t.dirtyFields, l), P ? W(t.dirtyFields, l) : j(t.dirtyFields, l, !0), R.dirtyFields = t.dirtyFields, g = g || (x.dirtyFields || h.dirtyFields) && A !== !P;
|
|
3061
3068
|
}
|
|
3062
3069
|
if (f) {
|
|
3063
3070
|
const P = S(t.touchedFields, l);
|
|
3064
|
-
P || (
|
|
3071
|
+
P || (j(t.touchedFields, l, f), R.touchedFields = t.touchedFields, g = g || (x.touchedFields || h.touchedFields) && P !== f);
|
|
3065
3072
|
}
|
|
3066
3073
|
g && v && m.state.next(R);
|
|
3067
3074
|
}
|
|
3068
3075
|
return g ? R : {};
|
|
3069
3076
|
}, G = (l, d, f, k) => {
|
|
3070
|
-
const v = S(t.errors, l), g = (x.isValid ||
|
|
3071
|
-
if (r.delayError && f ? (c = E(() => _(l, f)), c(r.delayError)) : (clearTimeout(
|
|
3072
|
-
const
|
|
3077
|
+
const v = S(t.errors, l), g = (x.isValid || h.isValid) && fe(d) && t.isValid !== d;
|
|
3078
|
+
if (r.delayError && f ? (c = E(() => _(l, f)), c(r.delayError)) : (clearTimeout(p), c = null, f ? j(t.errors, l, f) : W(t.errors, l)), (f ? !Ce(v, f) : v) || !ee(k) || g) {
|
|
3079
|
+
const A = {
|
|
3073
3080
|
...k,
|
|
3074
|
-
...g &&
|
|
3081
|
+
...g && fe(d) ? { isValid: d } : {},
|
|
3075
3082
|
errors: t.errors,
|
|
3076
3083
|
name: l
|
|
3077
3084
|
};
|
|
3078
3085
|
t = {
|
|
3079
3086
|
...t,
|
|
3080
|
-
...
|
|
3081
|
-
}, m.state.next(
|
|
3087
|
+
...A
|
|
3088
|
+
}, m.state.next(A);
|
|
3082
3089
|
}
|
|
3083
|
-
},
|
|
3084
|
-
const { errors: d } = await
|
|
3090
|
+
}, L = async (l) => (I(l, !0), await r.resolver(i, r.context, Rn(l || o.mount, s, r.criteriaMode, r.shouldUseNativeValidation))), U = async (l) => {
|
|
3091
|
+
const { errors: d } = await L(l);
|
|
3085
3092
|
if (I(l), l)
|
|
3086
3093
|
for (const f of l) {
|
|
3087
3094
|
const k = S(d, f);
|
|
3088
|
-
k ?
|
|
3095
|
+
k ? j(t.errors, f, k) : W(t.errors, f);
|
|
3089
3096
|
}
|
|
3090
3097
|
else
|
|
3091
3098
|
t.errors = d;
|
|
3092
3099
|
return d;
|
|
3093
|
-
},
|
|
3100
|
+
}, D = async (l, d, f = {
|
|
3094
3101
|
valid: !0
|
|
3095
3102
|
}) => {
|
|
3096
3103
|
for (const k in l) {
|
|
3097
3104
|
const v = l[k];
|
|
3098
3105
|
if (v) {
|
|
3099
|
-
const { _f: g, ...
|
|
3106
|
+
const { _f: g, ...A } = v;
|
|
3100
3107
|
if (g) {
|
|
3101
|
-
const R = o.array.has(g.name), P = v._f &&
|
|
3108
|
+
const R = o.array.has(g.name), P = v._f && Pn(v._f);
|
|
3102
3109
|
P && x.validatingFields && I([g.name], !0);
|
|
3103
|
-
const Y = await lr(v, o.disabled,
|
|
3110
|
+
const Y = await lr(v, o.disabled, i, C, r.shouldUseNativeValidation && !d, R);
|
|
3104
3111
|
if (P && x.validatingFields && I([g.name]), Y[g.name] && (f.valid = !1, d || e.shouldUseNativeValidation))
|
|
3105
3112
|
break;
|
|
3106
|
-
!d && (S(Y, g.name) ? R ?
|
|
3113
|
+
!d && (S(Y, g.name) ? R ? zn(t.errors, Y, g.name) : j(t.errors, g.name, Y[g.name]) : W(t.errors, g.name));
|
|
3107
3114
|
}
|
|
3108
|
-
!ee(
|
|
3115
|
+
!ee(A) && await D(A, d, f);
|
|
3109
3116
|
}
|
|
3110
3117
|
}
|
|
3111
3118
|
return f.valid;
|
|
3112
|
-
},
|
|
3119
|
+
}, T = () => {
|
|
3113
3120
|
for (const l of o.unMount) {
|
|
3114
3121
|
const d = S(s, l);
|
|
3115
|
-
d && (d._f.refs ? d._f.refs.every((f) => !
|
|
3122
|
+
d && (d._f.refs ? d._f.refs.every((f) => !xt(f)) : !xt(d._f.ref)) && B(l);
|
|
3116
3123
|
}
|
|
3117
3124
|
o.unMount = /* @__PURE__ */ new Set();
|
|
3118
|
-
}, w = (l, d) => !r.disabled && (l && d &&
|
|
3119
|
-
...n.mount ?
|
|
3120
|
-
}, f, d), q = (l) =>
|
|
3125
|
+
}, w = (l, d) => !r.disabled && (l && d && j(i, l, d), !Ce(Be(), a)), N = (l, d, f) => En(l, o, {
|
|
3126
|
+
...n.mount ? i : z(d) ? a : ne(l) ? { [l]: d } : d
|
|
3127
|
+
}, f, d), q = (l) => Et(S(n.mount ? i : a, l, r.shouldUnregister ? S(a, l, []) : [])), H = (l, d, f = {}) => {
|
|
3121
3128
|
const k = S(s, l);
|
|
3122
3129
|
let v = d;
|
|
3123
3130
|
if (k) {
|
|
3124
3131
|
const g = k._f;
|
|
3125
|
-
g && (!g.disabled &&
|
|
3126
|
-
(!
|
|
3127
|
-
}) : g.refs.forEach((
|
|
3132
|
+
g && (!g.disabled && j(i, l, Gr(d, g)), v = at(g.ref) && re(d) ? "" : d, zr(g.ref) ? [...g.ref.options].forEach((A) => A.selected = v.includes(A.value)) : g.refs ? Qe(g.ref) ? g.refs.forEach((A) => {
|
|
3133
|
+
(!A.defaultChecked || !A.disabled) && (Array.isArray(v) ? A.checked = !!v.find((R) => R === A.value) : A.checked = v === A.value || !!v);
|
|
3134
|
+
}) : g.refs.forEach((A) => A.checked = A.value === v) : Lt(g.ref) ? g.ref.value = "" : (g.ref.value = v, g.ref.type || m.state.next({
|
|
3128
3135
|
name: l,
|
|
3129
|
-
values:
|
|
3136
|
+
values: J(i)
|
|
3130
3137
|
})));
|
|
3131
3138
|
}
|
|
3132
|
-
(f.shouldDirty || f.shouldTouch) && O(l, v, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate &&
|
|
3133
|
-
},
|
|
3139
|
+
(f.shouldDirty || f.shouldTouch) && O(l, v, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && ce(l);
|
|
3140
|
+
}, X = (l, d, f) => {
|
|
3134
3141
|
for (const k in d) {
|
|
3135
3142
|
if (!d.hasOwnProperty(k))
|
|
3136
3143
|
return;
|
|
3137
|
-
const v = d[k], g = l + "." + k,
|
|
3138
|
-
(o.array.has(l) || K(v) ||
|
|
3144
|
+
const v = d[k], g = l + "." + k, A = S(s, g);
|
|
3145
|
+
(o.array.has(l) || K(v) || A && !A._f) && !Ve(v) ? X(g, v, f) : H(g, v, f);
|
|
3139
3146
|
}
|
|
3140
|
-
},
|
|
3141
|
-
const k = S(s, l), v = o.array.has(l), g =
|
|
3142
|
-
|
|
3147
|
+
}, te = (l, d, f = {}) => {
|
|
3148
|
+
const k = S(s, l), v = o.array.has(l), g = J(d);
|
|
3149
|
+
j(i, l, g), v ? (m.array.next({
|
|
3143
3150
|
name: l,
|
|
3144
|
-
values:
|
|
3145
|
-
}), (x.isDirty || x.dirtyFields ||
|
|
3151
|
+
values: J(i)
|
|
3152
|
+
}), (x.isDirty || x.dirtyFields || h.isDirty || h.dirtyFields) && f.shouldDirty && m.state.next({
|
|
3146
3153
|
name: l,
|
|
3147
|
-
dirtyFields: Le(
|
|
3154
|
+
dirtyFields: Le(a, i),
|
|
3148
3155
|
isDirty: w(l, g)
|
|
3149
|
-
})) : k && !k._f && !re(g) ?
|
|
3156
|
+
})) : k && !k._f && !re(g) ? X(l, g, f) : H(l, g, f), ar(l, o) ? m.state.next({
|
|
3150
3157
|
...t,
|
|
3151
3158
|
name: l,
|
|
3152
|
-
values:
|
|
3159
|
+
values: J(i)
|
|
3153
3160
|
}) : m.state.next({
|
|
3154
3161
|
name: n.mount ? l : void 0,
|
|
3155
|
-
values:
|
|
3162
|
+
values: J(i)
|
|
3156
3163
|
});
|
|
3157
|
-
},
|
|
3164
|
+
}, _e = async (l) => {
|
|
3158
3165
|
n.mount = !0;
|
|
3159
3166
|
const d = l.target;
|
|
3160
3167
|
let f = d.name, k = !0;
|
|
3161
3168
|
const v = S(s, f), g = (P) => {
|
|
3162
|
-
k = Number.isNaN(P) ||
|
|
3163
|
-
},
|
|
3169
|
+
k = Number.isNaN(P) || Ve(P) && isNaN(P.getTime()) || Ce(P, S(i, f, P));
|
|
3170
|
+
}, A = sr(r.mode), R = sr(r.reValidateMode);
|
|
3164
3171
|
if (v) {
|
|
3165
3172
|
let P, Y;
|
|
3166
|
-
const
|
|
3167
|
-
|
|
3168
|
-
const
|
|
3173
|
+
const Fe = d.type ? rr(v._f) : Cn(l), ke = l.type === Zt.BLUR || l.type === Zt.FOCUS_OUT, es = !Bn(v._f) && !r.resolver && !S(t.errors, f) && !v._f.deps || qn(ke, S(t.touchedFields, f), t.isSubmitted, R, A), ht = ar(f, o, ke);
|
|
3174
|
+
j(i, f, Fe), ke ? (!d || !d.readOnly) && (v._f.onBlur && v._f.onBlur(l), c && c(0)) : v._f.onChange && v._f.onChange(l);
|
|
3175
|
+
const yt = O(f, Fe, ke), ts = !ee(yt) || ht;
|
|
3169
3176
|
if (!ke && m.state.next({
|
|
3170
3177
|
name: f,
|
|
3171
3178
|
type: l.type,
|
|
3172
|
-
values:
|
|
3179
|
+
values: J(i)
|
|
3173
3180
|
}), es)
|
|
3174
|
-
return (x.isValid ||
|
|
3181
|
+
return (x.isValid || h.isValid) && (r.mode === "onBlur" ? ke && V() : ke || V()), ts && m.state.next({ name: f, ...ht ? {} : yt });
|
|
3175
3182
|
if (!ke && ht && m.state.next({ ...t }), r.resolver) {
|
|
3176
|
-
const { errors: Bt } = await
|
|
3177
|
-
if (I([f]), g(
|
|
3178
|
-
const rs =
|
|
3183
|
+
const { errors: Bt } = await L([f]);
|
|
3184
|
+
if (I([f]), g(Fe), k) {
|
|
3185
|
+
const rs = ir(t.errors, s, f), jt = ir(Bt, s, rs.name || f);
|
|
3179
3186
|
P = jt.error, f = jt.name, Y = ee(Bt);
|
|
3180
3187
|
}
|
|
3181
3188
|
} else
|
|
3182
|
-
I([f], !0), P = (await lr(v, o.disabled,
|
|
3183
|
-
k && (v._f.deps && (!Array.isArray(v._f.deps) || v._f.deps.length > 0) &&
|
|
3189
|
+
I([f], !0), P = (await lr(v, o.disabled, i, C, r.shouldUseNativeValidation))[f], I([f]), g(Fe), k && (P ? Y = !1 : (x.isValid || h.isValid) && (Y = await D(s, !0)));
|
|
3190
|
+
k && (v._f.deps && (!Array.isArray(v._f.deps) || v._f.deps.length > 0) && ce(v._f.deps), G(f, Y, P, yt));
|
|
3184
3191
|
}
|
|
3185
|
-
},
|
|
3192
|
+
}, ue = (l, d) => {
|
|
3186
3193
|
if (S(t.errors, d) && l.focus)
|
|
3187
3194
|
return l.focus(), 1;
|
|
3188
|
-
},
|
|
3195
|
+
}, ce = async (l, d = {}) => {
|
|
3189
3196
|
let f, k;
|
|
3190
|
-
const v =
|
|
3197
|
+
const v = Xe(l);
|
|
3191
3198
|
if (r.resolver) {
|
|
3192
3199
|
const g = await U(z(l) ? l : v);
|
|
3193
|
-
f = ee(g), k = l ? !v.some((
|
|
3200
|
+
f = ee(g), k = l ? !v.some((A) => S(g, A)) : f;
|
|
3194
3201
|
} else
|
|
3195
3202
|
l ? (k = (await Promise.all(v.map(async (g) => {
|
|
3196
|
-
const
|
|
3197
|
-
return await
|
|
3198
|
-
}))).every(Boolean), !(!k && !t.isValid) &&
|
|
3203
|
+
const A = S(s, g);
|
|
3204
|
+
return await D(A && A._f ? { [g]: A } : A);
|
|
3205
|
+
}))).every(Boolean), !(!k && !t.isValid) && V()) : k = f = await D(s);
|
|
3199
3206
|
return m.state.next({
|
|
3200
|
-
...!ne(l) || (x.isValid ||
|
|
3207
|
+
...!ne(l) || (x.isValid || h.isValid) && f !== t.isValid ? {} : { name: l },
|
|
3201
3208
|
...r.resolver || !l ? { isValid: f } : {},
|
|
3202
3209
|
errors: t.errors
|
|
3203
|
-
}), d.shouldFocus && !k &&
|
|
3210
|
+
}), d.shouldFocus && !k && Ze(s, ue, l ? v : o.mount), k;
|
|
3204
3211
|
}, Be = (l, d) => {
|
|
3205
3212
|
let f = {
|
|
3206
|
-
...n.mount ?
|
|
3213
|
+
...n.mount ? i : a
|
|
3207
3214
|
};
|
|
3208
3215
|
return d && (f = Ur(d.dirtyFields ? t.dirtyFields : t.touchedFields, f)), z(l) ? f : ne(l) ? S(f, l) : l.map((k) => S(f, k));
|
|
3209
3216
|
}, je = (l, d) => ({
|
|
@@ -3212,8 +3219,8 @@ function Wn(e = {}) {
|
|
|
3212
3219
|
error: S((d || t).errors, l),
|
|
3213
3220
|
isValidating: !!S(t.validatingFields, l),
|
|
3214
3221
|
isTouched: !!S((d || t).touchedFields, l)
|
|
3215
|
-
}),
|
|
3216
|
-
const d = l ?
|
|
3222
|
+
}), et = (l) => {
|
|
3223
|
+
const d = l ? Xe(l) : void 0;
|
|
3217
3224
|
d == null || d.forEach((f) => W(t.errors, f)), d ? d.forEach((f) => {
|
|
3218
3225
|
m.state.next({
|
|
3219
3226
|
name: f,
|
|
@@ -3223,8 +3230,8 @@ function Wn(e = {}) {
|
|
|
3223
3230
|
errors: {}
|
|
3224
3231
|
});
|
|
3225
3232
|
}, $e = (l, d, f) => {
|
|
3226
|
-
const k = (S(s, l, { _f: {} })._f || {}).ref, v = S(t.errors, l) || {}, { ref: g, message:
|
|
3227
|
-
|
|
3233
|
+
const k = (S(s, l, { _f: {} })._f || {}).ref, v = S(t.errors, l) || {}, { ref: g, message: A, type: R, ...P } = v;
|
|
3234
|
+
j(t.errors, l, {
|
|
3228
3235
|
...P,
|
|
3229
3236
|
...d,
|
|
3230
3237
|
ref: k
|
|
@@ -3233,44 +3240,44 @@ function Wn(e = {}) {
|
|
|
3233
3240
|
errors: t.errors,
|
|
3234
3241
|
isValid: !1
|
|
3235
3242
|
}), f && f.shouldFocus && k && k.focus && k.focus();
|
|
3236
|
-
},
|
|
3237
|
-
next: (f) => "values" in f && l(
|
|
3238
|
-
}) :
|
|
3243
|
+
}, tt = (l, d) => oe(l) ? m.state.subscribe({
|
|
3244
|
+
next: (f) => "values" in f && l(N(void 0, d), f)
|
|
3245
|
+
}) : N(l, d, !0), qe = (l) => m.state.subscribe({
|
|
3239
3246
|
next: (d) => {
|
|
3240
|
-
|
|
3241
|
-
values: { ...
|
|
3247
|
+
$n(l.name, d.name, l.exact) && jn(d, l.formState || x, Qr, l.reRenderRoot) && l.callback({
|
|
3248
|
+
values: { ...i },
|
|
3242
3249
|
...t,
|
|
3243
3250
|
...d,
|
|
3244
|
-
defaultValues:
|
|
3251
|
+
defaultValues: a
|
|
3245
3252
|
});
|
|
3246
3253
|
}
|
|
3247
|
-
}).unsubscribe,
|
|
3248
|
-
...
|
|
3254
|
+
}).unsubscribe, rt = (l) => (n.mount = !0, h = {
|
|
3255
|
+
...h,
|
|
3249
3256
|
...l.formState
|
|
3250
|
-
},
|
|
3257
|
+
}, qe({
|
|
3251
3258
|
...l,
|
|
3252
3259
|
formState: {
|
|
3253
3260
|
...b,
|
|
3254
3261
|
...l.formState
|
|
3255
3262
|
}
|
|
3256
|
-
})),
|
|
3257
|
-
for (const f of l ?
|
|
3258
|
-
o.mount.delete(f), o.array.delete(f), d.keepValue || (W(s, f), W(
|
|
3263
|
+
})), B = (l, d = {}) => {
|
|
3264
|
+
for (const f of l ? Xe(l) : o.mount)
|
|
3265
|
+
o.mount.delete(f), o.array.delete(f), d.keepValue || (W(s, f), W(i, f)), !d.keepError && W(t.errors, f), !d.keepDirty && W(t.dirtyFields, f), !d.keepTouched && W(t.touchedFields, f), !d.keepIsValidating && W(t.validatingFields, f), !r.shouldUnregister && !d.keepDefaultValue && W(a, f);
|
|
3259
3266
|
m.state.next({
|
|
3260
|
-
values:
|
|
3267
|
+
values: J(i)
|
|
3261
3268
|
}), m.state.next({
|
|
3262
3269
|
...t,
|
|
3263
3270
|
...d.keepDirty ? { isDirty: w() } : {}
|
|
3264
|
-
}), !d.keepIsValid &&
|
|
3265
|
-
},
|
|
3266
|
-
if (
|
|
3271
|
+
}), !d.keepIsValid && V();
|
|
3272
|
+
}, st = ({ disabled: l, name: d }) => {
|
|
3273
|
+
if (fe(l) && n.mount || l || o.disabled.has(d)) {
|
|
3267
3274
|
const v = o.disabled.has(d) !== !!l;
|
|
3268
|
-
l ? o.disabled.add(d) : o.disabled.delete(d), v && n.mount && !n.action &&
|
|
3275
|
+
l ? o.disabled.add(d) : o.disabled.delete(d), v && n.mount && !n.action && V();
|
|
3269
3276
|
}
|
|
3270
|
-
},
|
|
3277
|
+
}, Ue = (l, d = {}) => {
|
|
3271
3278
|
let f = S(s, l);
|
|
3272
|
-
const k =
|
|
3273
|
-
return
|
|
3279
|
+
const k = fe(d.disabled) || fe(r.disabled);
|
|
3280
|
+
return j(s, l, {
|
|
3274
3281
|
...f || {},
|
|
3275
3282
|
_f: {
|
|
3276
3283
|
...f && f._f ? f._f : { ref: { name: l } },
|
|
@@ -3278,63 +3285,63 @@ function Wn(e = {}) {
|
|
|
3278
3285
|
mount: !0,
|
|
3279
3286
|
...d
|
|
3280
3287
|
}
|
|
3281
|
-
}), o.mount.add(l), f ?
|
|
3282
|
-
disabled:
|
|
3288
|
+
}), o.mount.add(l), f ? st({
|
|
3289
|
+
disabled: fe(d.disabled) ? d.disabled : r.disabled,
|
|
3283
3290
|
name: l
|
|
3284
3291
|
}) : M(l, !0, d.value), {
|
|
3285
3292
|
...k ? { disabled: d.disabled || r.disabled } : {},
|
|
3286
3293
|
...r.progressive ? {
|
|
3287
3294
|
required: !!d.required,
|
|
3288
|
-
min:
|
|
3289
|
-
max:
|
|
3290
|
-
minLength:
|
|
3291
|
-
maxLength:
|
|
3292
|
-
pattern:
|
|
3295
|
+
min: ze(d.min),
|
|
3296
|
+
max: ze(d.max),
|
|
3297
|
+
minLength: ze(d.minLength),
|
|
3298
|
+
maxLength: ze(d.maxLength),
|
|
3299
|
+
pattern: ze(d.pattern)
|
|
3293
3300
|
} : {},
|
|
3294
3301
|
name: l,
|
|
3295
|
-
onChange:
|
|
3296
|
-
onBlur:
|
|
3302
|
+
onChange: _e,
|
|
3303
|
+
onBlur: _e,
|
|
3297
3304
|
ref: (v) => {
|
|
3298
3305
|
if (v) {
|
|
3299
|
-
|
|
3300
|
-
const g = z(v.value) && v.querySelectorAll && v.querySelectorAll("input,select,textarea")[0] || v,
|
|
3301
|
-
if (
|
|
3306
|
+
Ue(l, d), f = S(s, l);
|
|
3307
|
+
const g = z(v.value) && v.querySelectorAll && v.querySelectorAll("input,select,textarea")[0] || v, A = Ln(g), R = f._f.refs || [];
|
|
3308
|
+
if (A ? R.find((P) => P === g) : g === f._f.ref)
|
|
3302
3309
|
return;
|
|
3303
|
-
|
|
3310
|
+
j(s, l, {
|
|
3304
3311
|
_f: {
|
|
3305
3312
|
...f._f,
|
|
3306
|
-
...
|
|
3313
|
+
...A ? {
|
|
3307
3314
|
refs: [
|
|
3308
|
-
...R.filter(
|
|
3315
|
+
...R.filter(xt),
|
|
3309
3316
|
g,
|
|
3310
|
-
...Array.isArray(S(
|
|
3317
|
+
...Array.isArray(S(a, l)) ? [{}] : []
|
|
3311
3318
|
],
|
|
3312
3319
|
ref: { type: g.type, name: l }
|
|
3313
3320
|
} : { ref: g }
|
|
3314
3321
|
}
|
|
3315
3322
|
}), M(l, !1, void 0, g);
|
|
3316
3323
|
} else
|
|
3317
|
-
f = S(s, l, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(
|
|
3324
|
+
f = S(s, l, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(In(o.array, l) && n.action) && o.unMount.add(l);
|
|
3318
3325
|
}
|
|
3319
3326
|
};
|
|
3320
|
-
},
|
|
3321
|
-
|
|
3327
|
+
}, de = () => r.shouldFocusError && Ze(s, ue, o.mount), Xr = (l) => {
|
|
3328
|
+
fe(l) && (m.state.next({ disabled: l }), Ze(s, (d, f) => {
|
|
3322
3329
|
const k = S(s, f);
|
|
3323
3330
|
k && (d.disabled = k._f.disabled || l, Array.isArray(k._f.refs) && k._f.refs.forEach((v) => {
|
|
3324
3331
|
v.disabled = k._f.disabled || l;
|
|
3325
3332
|
}));
|
|
3326
3333
|
}, 0, !1));
|
|
3327
|
-
},
|
|
3334
|
+
}, Tt = (l, d) => async (f) => {
|
|
3328
3335
|
let k;
|
|
3329
3336
|
f && (f.preventDefault && f.preventDefault(), f.persist && f.persist());
|
|
3330
|
-
let v =
|
|
3337
|
+
let v = J(i);
|
|
3331
3338
|
if (m.state.next({
|
|
3332
3339
|
isSubmitting: !0
|
|
3333
3340
|
}), r.resolver) {
|
|
3334
|
-
const { errors: g, values:
|
|
3335
|
-
I(), t.errors = g, v =
|
|
3341
|
+
const { errors: g, values: A } = await L();
|
|
3342
|
+
I(), t.errors = g, v = J(A);
|
|
3336
3343
|
} else
|
|
3337
|
-
await
|
|
3344
|
+
await D(s);
|
|
3338
3345
|
if (o.disabled.size)
|
|
3339
3346
|
for (const g of o.disabled)
|
|
3340
3347
|
W(v, g);
|
|
@@ -3348,7 +3355,7 @@ function Wn(e = {}) {
|
|
|
3348
3355
|
k = g;
|
|
3349
3356
|
}
|
|
3350
3357
|
} else
|
|
3351
|
-
d && await d({ ...t.errors }, f),
|
|
3358
|
+
d && await d({ ...t.errors }, f), de(), setTimeout(de);
|
|
3352
3359
|
if (m.state.next({
|
|
3353
3360
|
isSubmitted: !0,
|
|
3354
3361
|
isSubmitting: !1,
|
|
@@ -3358,26 +3365,26 @@ function Wn(e = {}) {
|
|
|
3358
3365
|
}), k)
|
|
3359
3366
|
throw k;
|
|
3360
3367
|
}, Zr = (l, d = {}) => {
|
|
3361
|
-
S(s, l) && (z(d.defaultValue) ?
|
|
3368
|
+
S(s, l) && (z(d.defaultValue) ? te(l, J(S(a, l))) : (te(l, d.defaultValue), j(a, l, J(d.defaultValue))), d.keepTouched || W(t.touchedFields, l), d.keepDirty || (W(t.dirtyFields, l), t.isDirty = d.defaultValue ? w(l, J(S(a, l))) : w()), d.keepError || (W(t.errors, l), x.isValid && V()), m.state.next({ ...t }));
|
|
3362
3369
|
}, Ot = (l, d = {}) => {
|
|
3363
|
-
const f = l ?
|
|
3364
|
-
if (d.keepDefaultValues || (
|
|
3370
|
+
const f = l ? J(l) : a, k = J(f), v = ee(l), g = v ? a : k;
|
|
3371
|
+
if (d.keepDefaultValues || (a = f), !d.keepValues) {
|
|
3365
3372
|
if (d.keepDirtyValues) {
|
|
3366
|
-
const
|
|
3373
|
+
const A = /* @__PURE__ */ new Set([
|
|
3367
3374
|
...o.mount,
|
|
3368
|
-
...Object.keys(Le(
|
|
3375
|
+
...Object.keys(Le(a, i))
|
|
3369
3376
|
]);
|
|
3370
|
-
for (const R of Array.from(
|
|
3371
|
-
const P = S(t.dirtyFields, R), Y = S(
|
|
3372
|
-
P && !z(Y) ?
|
|
3377
|
+
for (const R of Array.from(A)) {
|
|
3378
|
+
const P = S(t.dirtyFields, R), Y = S(i, R), Fe = S(g, R);
|
|
3379
|
+
P && !z(Y) ? j(g, R, Y) : !P && !z(Fe) && te(R, Fe);
|
|
3373
3380
|
}
|
|
3374
3381
|
} else {
|
|
3375
|
-
if (
|
|
3376
|
-
for (const
|
|
3377
|
-
const R = S(s,
|
|
3382
|
+
if (Mt && z(l))
|
|
3383
|
+
for (const A of o.mount) {
|
|
3384
|
+
const R = S(s, A);
|
|
3378
3385
|
if (R && R._f) {
|
|
3379
3386
|
const P = Array.isArray(R._f.refs) ? R._f.refs[0] : R._f.ref;
|
|
3380
|
-
if (
|
|
3387
|
+
if (at(P)) {
|
|
3381
3388
|
const Y = P.closest("form");
|
|
3382
3389
|
if (Y) {
|
|
3383
3390
|
Y.reset();
|
|
@@ -3387,12 +3394,12 @@ function Wn(e = {}) {
|
|
|
3387
3394
|
}
|
|
3388
3395
|
}
|
|
3389
3396
|
if (d.keepFieldsRef)
|
|
3390
|
-
for (const
|
|
3391
|
-
|
|
3397
|
+
for (const A of o.mount)
|
|
3398
|
+
te(A, S(g, A));
|
|
3392
3399
|
else
|
|
3393
3400
|
s = {};
|
|
3394
3401
|
}
|
|
3395
|
-
|
|
3402
|
+
i = r.shouldUnregister ? d.keepDefaultValues ? J(a) : {} : J(g), m.array.next({
|
|
3396
3403
|
values: { ...g }
|
|
3397
3404
|
}), m.state.next({
|
|
3398
3405
|
values: { ...g }
|
|
@@ -3408,16 +3415,16 @@ function Wn(e = {}) {
|
|
|
3408
3415
|
focus: ""
|
|
3409
3416
|
}, n.mount = !x.isValid || !!d.keepIsValid || !!d.keepDirtyValues || !r.shouldUnregister && !ee(g), n.watch = !!r.shouldUnregister, n.keepIsValid = !!d.keepIsValid, n.action = !1, d.keepErrors || (t.errors = {}), m.state.next({
|
|
3410
3417
|
submitCount: d.keepSubmitCount ? t.submitCount : 0,
|
|
3411
|
-
isDirty: v ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Ce(l,
|
|
3418
|
+
isDirty: v ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Ce(l, a)),
|
|
3412
3419
|
isSubmitted: d.keepIsSubmitted ? t.isSubmitted : !1,
|
|
3413
|
-
dirtyFields: v ? {} : d.keepDirtyValues ? d.keepDefaultValues &&
|
|
3420
|
+
dirtyFields: v ? {} : d.keepDirtyValues ? d.keepDefaultValues && i ? Le(a, i) : t.dirtyFields : d.keepDefaultValues && l ? Le(a, l) : d.keepDirty ? t.dirtyFields : {},
|
|
3414
3421
|
touchedFields: d.keepTouched ? t.touchedFields : {},
|
|
3415
3422
|
errors: d.keepErrors ? t.errors : {},
|
|
3416
3423
|
isSubmitSuccessful: d.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
|
|
3417
3424
|
isSubmitting: !1,
|
|
3418
|
-
defaultValues:
|
|
3425
|
+
defaultValues: a
|
|
3419
3426
|
});
|
|
3420
|
-
}, Rt = (l, d) => Ot(oe(l) ? l(
|
|
3427
|
+
}, Rt = (l, d) => Ot(oe(l) ? l(i) : l, { ...r.resetOptions, ...d }), Yr = (l, d = {}) => {
|
|
3421
3428
|
const f = S(s, l), k = f && f._f;
|
|
3422
3429
|
if (k) {
|
|
3423
3430
|
const v = k.refs ? k.refs[0] : k.ref;
|
|
@@ -3432,21 +3439,21 @@ function Wn(e = {}) {
|
|
|
3432
3439
|
};
|
|
3433
3440
|
}, Pt = {
|
|
3434
3441
|
control: {
|
|
3435
|
-
register:
|
|
3436
|
-
unregister:
|
|
3442
|
+
register: Ue,
|
|
3443
|
+
unregister: B,
|
|
3437
3444
|
getFieldState: je,
|
|
3438
|
-
handleSubmit:
|
|
3445
|
+
handleSubmit: Tt,
|
|
3439
3446
|
setError: $e,
|
|
3440
|
-
_subscribe:
|
|
3441
|
-
_runSchema:
|
|
3447
|
+
_subscribe: qe,
|
|
3448
|
+
_runSchema: L,
|
|
3442
3449
|
_updateIsValidating: I,
|
|
3443
|
-
_focusError:
|
|
3444
|
-
_getWatch:
|
|
3450
|
+
_focusError: de,
|
|
3451
|
+
_getWatch: N,
|
|
3445
3452
|
_getDirty: w,
|
|
3446
|
-
_setValid:
|
|
3453
|
+
_setValid: V,
|
|
3447
3454
|
_setFieldArray: y,
|
|
3448
|
-
_setDisabledField:
|
|
3449
|
-
_setErrors:
|
|
3455
|
+
_setDisabledField: st,
|
|
3456
|
+
_setErrors: F,
|
|
3450
3457
|
_getFieldArray: q,
|
|
3451
3458
|
_reset: Ot,
|
|
3452
3459
|
_resetDefaultValues: () => oe(r.defaultValues) && r.defaultValues().then((l) => {
|
|
@@ -3454,7 +3461,7 @@ function Wn(e = {}) {
|
|
|
3454
3461
|
isLoading: !1
|
|
3455
3462
|
});
|
|
3456
3463
|
}),
|
|
3457
|
-
_removeUnmounted:
|
|
3464
|
+
_removeUnmounted: T,
|
|
3458
3465
|
_disableForm: Xr,
|
|
3459
3466
|
_subjects: m,
|
|
3460
3467
|
_proxyFormState: x,
|
|
@@ -3462,7 +3469,7 @@ function Wn(e = {}) {
|
|
|
3462
3469
|
return s;
|
|
3463
3470
|
},
|
|
3464
3471
|
get _formValues() {
|
|
3465
|
-
return
|
|
3472
|
+
return i;
|
|
3466
3473
|
},
|
|
3467
3474
|
get _state() {
|
|
3468
3475
|
return n;
|
|
@@ -3471,7 +3478,7 @@ function Wn(e = {}) {
|
|
|
3471
3478
|
n = l;
|
|
3472
3479
|
},
|
|
3473
3480
|
get _defaultValues() {
|
|
3474
|
-
return
|
|
3481
|
+
return a;
|
|
3475
3482
|
},
|
|
3476
3483
|
get _names() {
|
|
3477
3484
|
return o;
|
|
@@ -3492,17 +3499,17 @@ function Wn(e = {}) {
|
|
|
3492
3499
|
};
|
|
3493
3500
|
}
|
|
3494
3501
|
},
|
|
3495
|
-
subscribe:
|
|
3496
|
-
trigger:
|
|
3497
|
-
register:
|
|
3498
|
-
handleSubmit:
|
|
3499
|
-
watch:
|
|
3500
|
-
setValue:
|
|
3502
|
+
subscribe: rt,
|
|
3503
|
+
trigger: ce,
|
|
3504
|
+
register: Ue,
|
|
3505
|
+
handleSubmit: Tt,
|
|
3506
|
+
watch: tt,
|
|
3507
|
+
setValue: te,
|
|
3501
3508
|
getValues: Be,
|
|
3502
3509
|
reset: Rt,
|
|
3503
3510
|
resetField: Zr,
|
|
3504
|
-
clearErrors:
|
|
3505
|
-
unregister:
|
|
3511
|
+
clearErrors: et,
|
|
3512
|
+
unregister: B,
|
|
3506
3513
|
setError: $e,
|
|
3507
3514
|
setFocus: Yr,
|
|
3508
3515
|
getFieldState: je
|
|
@@ -3512,8 +3519,8 @@ function Wn(e = {}) {
|
|
|
3512
3519
|
formControl: Pt
|
|
3513
3520
|
};
|
|
3514
3521
|
}
|
|
3515
|
-
function
|
|
3516
|
-
const r = Q.useRef(void 0), t = Q.useRef(void 0), [s,
|
|
3522
|
+
function ft(e = {}) {
|
|
3523
|
+
const r = Q.useRef(void 0), t = Q.useRef(void 0), [s, a] = Q.useState({
|
|
3517
3524
|
isDirty: !1,
|
|
3518
3525
|
isValidating: !1,
|
|
3519
3526
|
isLoading: oe(e.defaultValues),
|
|
@@ -3537,86 +3544,86 @@ function lt(e = {}) {
|
|
|
3537
3544
|
formState: s
|
|
3538
3545
|
}, e.defaultValues && !oe(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
3539
3546
|
else {
|
|
3540
|
-
const { formControl: n, ...o } =
|
|
3547
|
+
const { formControl: n, ...o } = Kn(e);
|
|
3541
3548
|
r.current = {
|
|
3542
3549
|
...o,
|
|
3543
3550
|
formState: s
|
|
3544
3551
|
};
|
|
3545
3552
|
}
|
|
3546
|
-
const
|
|
3547
|
-
return
|
|
3548
|
-
const n =
|
|
3549
|
-
formState:
|
|
3550
|
-
callback: () =>
|
|
3553
|
+
const i = r.current.control;
|
|
3554
|
+
return i._options = e, Mn(() => {
|
|
3555
|
+
const n = i._subscribe({
|
|
3556
|
+
formState: i._proxyFormState,
|
|
3557
|
+
callback: () => a({ ...i._formState }),
|
|
3551
3558
|
reRenderRoot: !0
|
|
3552
3559
|
});
|
|
3553
|
-
return
|
|
3560
|
+
return a((o) => ({
|
|
3554
3561
|
...o,
|
|
3555
3562
|
isReady: !0
|
|
3556
|
-
})),
|
|
3557
|
-
}, [
|
|
3558
|
-
e.mode && (
|
|
3559
|
-
}, [
|
|
3560
|
-
e.errors && (
|
|
3561
|
-
}, [
|
|
3562
|
-
e.shouldUnregister &&
|
|
3563
|
-
values:
|
|
3563
|
+
})), i._formState.isReady = !0, n;
|
|
3564
|
+
}, [i]), Q.useEffect(() => i._disableForm(e.disabled), [i, e.disabled]), Q.useEffect(() => {
|
|
3565
|
+
e.mode && (i._options.mode = e.mode), e.reValidateMode && (i._options.reValidateMode = e.reValidateMode);
|
|
3566
|
+
}, [i, e.mode, e.reValidateMode]), Q.useEffect(() => {
|
|
3567
|
+
e.errors && (i._setErrors(e.errors), i._focusError());
|
|
3568
|
+
}, [i, e.errors]), Q.useEffect(() => {
|
|
3569
|
+
e.shouldUnregister && i._subjects.state.next({
|
|
3570
|
+
values: i._getWatch()
|
|
3564
3571
|
});
|
|
3565
|
-
}, [
|
|
3566
|
-
if (
|
|
3567
|
-
const n =
|
|
3568
|
-
n !== s.isDirty &&
|
|
3572
|
+
}, [i, e.shouldUnregister]), Q.useEffect(() => {
|
|
3573
|
+
if (i._proxyFormState.isDirty) {
|
|
3574
|
+
const n = i._getDirty();
|
|
3575
|
+
n !== s.isDirty && i._subjects.state.next({
|
|
3569
3576
|
isDirty: n
|
|
3570
3577
|
});
|
|
3571
3578
|
}
|
|
3572
|
-
}, [
|
|
3579
|
+
}, [i, s.isDirty]), Q.useEffect(() => {
|
|
3573
3580
|
var n;
|
|
3574
|
-
e.values && !Ce(e.values, t.current) ? (
|
|
3581
|
+
e.values && !Ce(e.values, t.current) ? (i._reset(e.values, {
|
|
3575
3582
|
keepFieldsRef: !0,
|
|
3576
|
-
...
|
|
3577
|
-
}), !((n =
|
|
3578
|
-
}, [
|
|
3579
|
-
|
|
3580
|
-
}), r.current.formState = Q.useMemo(() => Vn(s,
|
|
3583
|
+
...i._options.resetOptions
|
|
3584
|
+
}), !((n = i._options.resetOptions) === null || n === void 0) && n.keepIsValid || i._setValid(), t.current = e.values, a((o) => ({ ...o }))) : i._resetDefaultValues();
|
|
3585
|
+
}, [i, e.values]), Q.useEffect(() => {
|
|
3586
|
+
i._state.mount || (i._setValid(), i._state.mount = !0), i._state.watch && (i._state.watch = !1, i._subjects.state.next({ ...i._formState })), i._removeUnmounted();
|
|
3587
|
+
}), r.current.formState = Q.useMemo(() => Vn(s, i), [i, s]), r.current;
|
|
3581
3588
|
}
|
|
3582
3589
|
const ur = (e, r, t) => {
|
|
3583
3590
|
if (e && "reportValidity" in e) {
|
|
3584
3591
|
const s = S(t, r);
|
|
3585
3592
|
e.setCustomValidity(s && s.message || ""), e.reportValidity();
|
|
3586
3593
|
}
|
|
3587
|
-
},
|
|
3594
|
+
}, Gn = (e, r) => {
|
|
3588
3595
|
for (const t in r.fields) {
|
|
3589
3596
|
const s = r.fields[t];
|
|
3590
|
-
s && s.ref && "reportValidity" in s.ref ? ur(s.ref, t, e) : s.refs && s.refs.forEach((
|
|
3597
|
+
s && s.ref && "reportValidity" in s.ref ? ur(s.ref, t, e) : s.refs && s.refs.forEach((a) => ur(a, t, e));
|
|
3591
3598
|
}
|
|
3592
|
-
},
|
|
3593
|
-
r.shouldUseNativeValidation &&
|
|
3599
|
+
}, Hn = (e, r) => {
|
|
3600
|
+
r.shouldUseNativeValidation && Gn(e, r);
|
|
3594
3601
|
const t = {};
|
|
3595
3602
|
for (const s in e) {
|
|
3596
|
-
const
|
|
3597
|
-
if (
|
|
3603
|
+
const a = S(r.fields, s), i = Object.assign(e[s] || {}, { ref: a && a.ref });
|
|
3604
|
+
if (Jn(r.names || Object.keys(e), s)) {
|
|
3598
3605
|
const n = Object.assign({}, S(t, s));
|
|
3599
|
-
|
|
3606
|
+
j(n, "root", i), j(t, s, n);
|
|
3600
3607
|
} else
|
|
3601
|
-
|
|
3608
|
+
j(t, s, i);
|
|
3602
3609
|
}
|
|
3603
3610
|
return t;
|
|
3604
|
-
},
|
|
3605
|
-
var
|
|
3606
|
-
return t === void 0 && (t = {}), function(s,
|
|
3611
|
+
}, Jn = (e, r) => e.some((t) => t.startsWith(r + "."));
|
|
3612
|
+
var pt = function(e, r, t) {
|
|
3613
|
+
return t === void 0 && (t = {}), function(s, a, i) {
|
|
3607
3614
|
try {
|
|
3608
|
-
var n = !
|
|
3609
|
-
return Promise.resolve(/* @__PURE__ */
|
|
3615
|
+
var n = !i.shouldUseNativeValidation && i.criteriaMode === "all";
|
|
3616
|
+
return Promise.resolve(/* @__PURE__ */ an(e, s, Object.assign({}, r, { abortPipeEarly: !n }))).then(function(o) {
|
|
3610
3617
|
if (o.issues) {
|
|
3611
3618
|
for (var c = {}; o.issues.length; ) {
|
|
3612
|
-
var
|
|
3613
|
-
if (b && (c[b] || (c[b] = { message:
|
|
3614
|
-
var x = c[b].types,
|
|
3615
|
-
c[b] = qr(b, n, c,
|
|
3619
|
+
var p = o.issues[0], b = /* @__PURE__ */ Ys(p);
|
|
3620
|
+
if (b && (c[b] || (c[b] = { message: p.message, type: p.type }), n)) {
|
|
3621
|
+
var x = c[b].types, h = x && x[p.type];
|
|
3622
|
+
c[b] = qr(b, n, c, p.type, h ? [].concat(h, p.message) : p.message);
|
|
3616
3623
|
}
|
|
3617
3624
|
o.issues.shift();
|
|
3618
3625
|
}
|
|
3619
|
-
return { values: {}, errors:
|
|
3626
|
+
return { values: {}, errors: Hn(c, i) };
|
|
3620
3627
|
}
|
|
3621
3628
|
return { values: t.raw ? s : o.output, errors: {} };
|
|
3622
3629
|
});
|
|
@@ -3625,22 +3632,22 @@ var ut = function(e, r, t) {
|
|
|
3625
3632
|
}
|
|
3626
3633
|
};
|
|
3627
3634
|
};
|
|
3628
|
-
const cr = 27, dr = 12, fr = 10,
|
|
3635
|
+
const cr = 27, dr = 12, fr = 10, Xn = Re("enum"), Zn = (e, r) => {
|
|
3629
3636
|
const t = {
|
|
3630
3637
|
min: e.minSelected ?? 0,
|
|
3631
3638
|
max: e.maxSelected ?? e.options.length
|
|
3632
3639
|
};
|
|
3633
|
-
return
|
|
3634
|
-
checked: /* @__PURE__ */ Se(/* @__PURE__ */ Or(/* @__PURE__ */
|
|
3640
|
+
return pt(/* @__PURE__ */ xe({
|
|
3641
|
+
checked: /* @__PURE__ */ Se(/* @__PURE__ */ Or(/* @__PURE__ */ ae(), /* @__PURE__ */ Lr()), /* @__PURE__ */ At((s) => Object.entries(s).filter(([a, i]) => i).map(([a, i]) => a)), /* @__PURE__ */ He(t.max, r("validation_multiple_choice_max", {
|
|
3635
3642
|
count: t.max
|
|
3636
|
-
})), /* @__PURE__ */
|
|
3643
|
+
})), /* @__PURE__ */ De(t.min, r("validation_multiple_choice_min", {
|
|
3637
3644
|
count: t.min
|
|
3638
3645
|
})))
|
|
3639
3646
|
}));
|
|
3640
|
-
},
|
|
3647
|
+
}, Yn = xr(({
|
|
3641
3648
|
option: e,
|
|
3642
3649
|
...r
|
|
3643
|
-
}, t) => u(
|
|
3650
|
+
}, t) => u(we, {
|
|
3644
3651
|
children: [u("input", {
|
|
3645
3652
|
class: "peer sr-only h-full",
|
|
3646
3653
|
type: "checkbox",
|
|
@@ -3651,7 +3658,7 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
3651
3658
|
htmlFor: r.id,
|
|
3652
3659
|
children: e.label
|
|
3653
3660
|
})]
|
|
3654
|
-
})),
|
|
3661
|
+
})), pr = lt("gutter-stable flex w-full flex-1 flex-wrap gap-2 overflow-y-auto rounded-xl p-2.5 pr-4", {
|
|
3655
3662
|
variants: {
|
|
3656
3663
|
variant: {
|
|
3657
3664
|
// In cases where there is only one option, we want to center it
|
|
@@ -3660,90 +3667,90 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
3660
3667
|
booleanLike: Pr
|
|
3661
3668
|
}
|
|
3662
3669
|
}
|
|
3663
|
-
}),
|
|
3670
|
+
}), Qn = ({
|
|
3664
3671
|
input: e,
|
|
3665
3672
|
onSubmitSuccess: r
|
|
3666
3673
|
}) => {
|
|
3667
3674
|
var b, x;
|
|
3668
|
-
const t = e.key ? (b = $.current$.value.flow) == null ? void 0 : b.data.submissions[e.key] : void 0, s = (e.config.minSelected === 1 || e.config.minSelected === void 0) && e.config.maxSelected === 1,
|
|
3669
|
-
t:
|
|
3675
|
+
const t = e.key ? (b = $.current$.value.flow) == null ? void 0 : b.data.submissions[e.key] : void 0, s = (e.config.minSelected === 1 || e.config.minSelected === void 0) && e.config.maxSelected === 1, a = s && e.config.options.length === 2, {
|
|
3676
|
+
t: i
|
|
3670
3677
|
} = se(), {
|
|
3671
3678
|
register: n,
|
|
3672
3679
|
handleSubmit: o,
|
|
3673
3680
|
formState: {
|
|
3674
3681
|
errors: c
|
|
3675
3682
|
}
|
|
3676
|
-
} =
|
|
3683
|
+
} = ft({
|
|
3677
3684
|
defaultValues: {
|
|
3678
|
-
checked: s ? {} :
|
|
3685
|
+
checked: s ? {} : Xn(t) ? Object.fromEntries(t.value.map((h) => [h, !0])) : {}
|
|
3679
3686
|
},
|
|
3680
|
-
resolver:
|
|
3681
|
-
}),
|
|
3682
|
-
return
|
|
3687
|
+
resolver: Zn(e.config, i)
|
|
3688
|
+
}), p = Vt();
|
|
3689
|
+
return a ? u("ul", {
|
|
3683
3690
|
style: {
|
|
3684
3691
|
maxHeight: 6.5 * cr + 5 * dr + 2 * fr
|
|
3685
3692
|
},
|
|
3686
|
-
class:
|
|
3693
|
+
class: pr({
|
|
3687
3694
|
variant: "booleanLike"
|
|
3688
3695
|
}),
|
|
3689
|
-
children: e.config.options.map((
|
|
3696
|
+
children: e.config.options.map((h, m) => u("li", {
|
|
3690
3697
|
class: Br,
|
|
3691
3698
|
children: u(jr, {
|
|
3692
3699
|
type: "submit",
|
|
3693
3700
|
ref: (C) => {
|
|
3694
|
-
C && m === 0 && (
|
|
3701
|
+
C && m === 0 && (p.current = C);
|
|
3695
3702
|
},
|
|
3696
|
-
label:
|
|
3703
|
+
label: h.label,
|
|
3697
3704
|
value: "true",
|
|
3698
3705
|
onClick: () => r({
|
|
3699
3706
|
type: "enum",
|
|
3700
|
-
value: [
|
|
3707
|
+
value: [h.value]
|
|
3701
3708
|
})
|
|
3702
3709
|
})
|
|
3703
|
-
},
|
|
3710
|
+
}, h.value))
|
|
3704
3711
|
}) : u("form", {
|
|
3705
3712
|
noValidate: !0,
|
|
3706
|
-
onSubmit: (
|
|
3713
|
+
onSubmit: (h) => o((m) => {
|
|
3707
3714
|
const C = m.checked;
|
|
3708
3715
|
r({
|
|
3709
3716
|
type: "enum",
|
|
3710
3717
|
value: C
|
|
3711
3718
|
});
|
|
3712
|
-
})(
|
|
3719
|
+
})(h),
|
|
3713
3720
|
children: [u("div", {
|
|
3714
3721
|
class: "flex items-center gap-1",
|
|
3715
3722
|
children: [u("ul", {
|
|
3716
3723
|
style: {
|
|
3717
3724
|
maxHeight: 6.5 * cr + 5 * dr + 2 * fr
|
|
3718
3725
|
},
|
|
3719
|
-
class:
|
|
3726
|
+
class: pr({
|
|
3720
3727
|
variant: e.config.options.length === 1 ? "singleOption" : void 0
|
|
3721
3728
|
}),
|
|
3722
|
-
children: e.config.options.map((
|
|
3723
|
-
const C = `checked.${
|
|
3729
|
+
children: e.config.options.map((h, m) => {
|
|
3730
|
+
const C = `checked.${h.value}`, {
|
|
3724
3731
|
ref: E,
|
|
3725
|
-
...
|
|
3732
|
+
...V
|
|
3726
3733
|
} = n(C);
|
|
3727
3734
|
return u("li", {
|
|
3728
3735
|
class: "relative",
|
|
3729
|
-
children: u(
|
|
3730
|
-
option:
|
|
3736
|
+
children: u(Yn, {
|
|
3737
|
+
option: h,
|
|
3731
3738
|
autoFocus: m === 0,
|
|
3732
3739
|
ref: (I) => {
|
|
3733
|
-
I && m === 0 && (
|
|
3740
|
+
I && m === 0 && (p.current = I), E(I);
|
|
3734
3741
|
},
|
|
3735
3742
|
id: C,
|
|
3736
|
-
...
|
|
3743
|
+
...V,
|
|
3737
3744
|
onClick: s ? () => r({
|
|
3738
3745
|
type: "enum",
|
|
3739
|
-
value: [
|
|
3746
|
+
value: [h.value]
|
|
3740
3747
|
}) : void 0
|
|
3741
3748
|
})
|
|
3742
|
-
},
|
|
3749
|
+
}, h.value);
|
|
3743
3750
|
})
|
|
3744
3751
|
}), u("div", {
|
|
3745
3752
|
class: "flex flex-col items-center gap-2 pr-2.5 pt-2.5",
|
|
3746
|
-
children: [s ? null : u(Ee, {}), e.config.minSelected === 0 && u(
|
|
3753
|
+
children: [s ? null : u(Ee, {}), e.config.minSelected === 0 && u(Ae, {
|
|
3747
3754
|
class: "relative",
|
|
3748
3755
|
type: "button",
|
|
3749
3756
|
onClick: () => r({
|
|
@@ -3759,50 +3766,50 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
3759
3766
|
})
|
|
3760
3767
|
})]
|
|
3761
3768
|
});
|
|
3762
|
-
},
|
|
3763
|
-
const t = e.min ?? Number.MIN_SAFE_INTEGER, s = e.max ?? Number.MAX_SAFE_INTEGER,
|
|
3764
|
-
return
|
|
3765
|
-
number: /* @__PURE__ */ Se(/* @__PURE__ */
|
|
3769
|
+
}, ea = Re("number"), ta = (e, r) => {
|
|
3770
|
+
const t = e.min ?? Number.MIN_SAFE_INTEGER, s = e.max ?? Number.MAX_SAFE_INTEGER, a = e.decimalCases ?? 0;
|
|
3771
|
+
return pt(/* @__PURE__ */ xe({
|
|
3772
|
+
number: /* @__PURE__ */ Se(/* @__PURE__ */ Dr(r("validation_number")), /* @__PURE__ */ Vr(t, r("validation_number_min", {
|
|
3766
3773
|
min: t
|
|
3767
|
-
})), /* @__PURE__ */
|
|
3774
|
+
})), /* @__PURE__ */ Fr(s, r("validation_number_max", {
|
|
3768
3775
|
max: s
|
|
3769
|
-
})), /* @__PURE__ */ Ir((
|
|
3770
|
-
count:
|
|
3776
|
+
})), /* @__PURE__ */ Ir((i) => i === Number(i.toFixed(a)), r("validation_number_decimal_cases", {
|
|
3777
|
+
count: a
|
|
3771
3778
|
})))
|
|
3772
3779
|
}));
|
|
3773
|
-
},
|
|
3780
|
+
}, ra = ({
|
|
3774
3781
|
input: e,
|
|
3775
3782
|
onSubmitSuccess: r
|
|
3776
3783
|
}) => {
|
|
3777
3784
|
var x;
|
|
3778
3785
|
const t = e.config.defaultValue, s = e.key ? (x = $.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, {
|
|
3779
|
-
t:
|
|
3786
|
+
t: a
|
|
3780
3787
|
} = se(), {
|
|
3781
|
-
register:
|
|
3788
|
+
register: i,
|
|
3782
3789
|
handleSubmit: n,
|
|
3783
3790
|
formState: {
|
|
3784
3791
|
errors: o
|
|
3785
3792
|
}
|
|
3786
|
-
} =
|
|
3793
|
+
} = ft({
|
|
3787
3794
|
defaultValues: {
|
|
3788
|
-
number:
|
|
3795
|
+
number: ea(s) ? s.value : t ? Number(t) : void 0
|
|
3789
3796
|
},
|
|
3790
|
-
resolver:
|
|
3797
|
+
resolver: ta(e.config, a)
|
|
3791
3798
|
}), {
|
|
3792
3799
|
ref: c,
|
|
3793
|
-
...
|
|
3794
|
-
} =
|
|
3800
|
+
...p
|
|
3801
|
+
} = i("number", {
|
|
3795
3802
|
required: !e.config.optional,
|
|
3796
3803
|
valueAsNumber: !0
|
|
3797
|
-
}), b =
|
|
3804
|
+
}), b = pe();
|
|
3798
3805
|
return Ie(() => {
|
|
3799
3806
|
b.current && (b.current.focus(), b.current.select());
|
|
3800
3807
|
}, []), u("form", {
|
|
3801
3808
|
class: "flex flex-col gap-1 p-2.5",
|
|
3802
|
-
onSubmit: n((
|
|
3803
|
-
|
|
3809
|
+
onSubmit: n((h) => {
|
|
3810
|
+
h.number !== void 0 && r({
|
|
3804
3811
|
type: "number",
|
|
3805
|
-
value:
|
|
3812
|
+
value: h.number
|
|
3806
3813
|
});
|
|
3807
3814
|
}),
|
|
3808
3815
|
children: [u("div", {
|
|
@@ -3810,24 +3817,24 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
3810
3817
|
children: [u("div", {
|
|
3811
3818
|
class: "relative min-w-0 flex-grow",
|
|
3812
3819
|
children: [u("input", {
|
|
3813
|
-
...
|
|
3820
|
+
...p,
|
|
3814
3821
|
id: "chat-input",
|
|
3815
3822
|
autocomplete: "off",
|
|
3816
3823
|
autoCapitalize: "off",
|
|
3817
3824
|
autoCorrect: "off",
|
|
3818
3825
|
autoFocus: !0,
|
|
3819
|
-
ref: (
|
|
3820
|
-
|
|
3826
|
+
ref: (h) => {
|
|
3827
|
+
h && (b.current = h), c(h);
|
|
3821
3828
|
},
|
|
3822
3829
|
type: "text",
|
|
3823
3830
|
min: e.config.min,
|
|
3824
3831
|
max: e.config.max,
|
|
3825
|
-
class:
|
|
3832
|
+
class: Ye({
|
|
3826
3833
|
optional: e.config.optional,
|
|
3827
3834
|
className: "[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"
|
|
3828
3835
|
}),
|
|
3829
3836
|
placeholder: e.config.placeholder
|
|
3830
|
-
}), e.config.optional && u(
|
|
3837
|
+
}), e.config.optional && u(Ae, {
|
|
3831
3838
|
class: "absolute bottom-0 right-0.5 top-0",
|
|
3832
3839
|
onClick: () => r(null)
|
|
3833
3840
|
})]
|
|
@@ -3836,13 +3843,13 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
3836
3843
|
error: o.number
|
|
3837
3844
|
})]
|
|
3838
3845
|
});
|
|
3839
|
-
},
|
|
3846
|
+
}, sa = (e) => {
|
|
3840
3847
|
if (e === "")
|
|
3841
3848
|
return {
|
|
3842
3849
|
countryCode: "",
|
|
3843
3850
|
phoneNumber: ""
|
|
3844
3851
|
};
|
|
3845
|
-
const r = Object.entries(Ft).find((
|
|
3852
|
+
const r = Object.entries(Ft).find((a) => e.startsWith(a[1])), t = r ? r[1] : "", s = e.replace(t, "");
|
|
3846
3853
|
return /^\d+$/.test(s) ? {
|
|
3847
3854
|
countryCode: t,
|
|
3848
3855
|
phoneNumber: s
|
|
@@ -3850,54 +3857,54 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
3850
3857
|
countryCode: "",
|
|
3851
3858
|
phoneNumber: ""
|
|
3852
3859
|
};
|
|
3853
|
-
},
|
|
3854
|
-
const r = /* @__PURE__ */ Se(/* @__PURE__ */
|
|
3855
|
-
return
|
|
3860
|
+
}, na = "44", aa = /^[0-9 ]+$/, ia = Re("string"), oa = Re("phone"), la = (e) => {
|
|
3861
|
+
const r = /* @__PURE__ */ Se(/* @__PURE__ */ ae(e("validation_country_code")), /* @__PURE__ */ It(aa, e("validation_country_code"))), t = /* @__PURE__ */ Se(/* @__PURE__ */ ae(e("validation_phone")), /* @__PURE__ */ De(1, e("validation_phone")), /* @__PURE__ */ At((s) => s.replace(/[^0-9]/g, "")));
|
|
3862
|
+
return pt(/* @__PURE__ */ xe({
|
|
3856
3863
|
countryCode: r,
|
|
3857
3864
|
phoneNumber: t
|
|
3858
3865
|
}));
|
|
3859
|
-
},
|
|
3866
|
+
}, ua = ({
|
|
3860
3867
|
input: e,
|
|
3861
3868
|
onSubmitSuccess: r
|
|
3862
3869
|
}) => {
|
|
3863
3870
|
var E;
|
|
3864
3871
|
const t = e.key ? (E = $.current$.value.flow) == null ? void 0 : E.data.submissions[e.key] : void 0, {
|
|
3865
3872
|
t: s
|
|
3866
|
-
} = se(), [
|
|
3873
|
+
} = se(), [a, i] = ve(), n = ia(t) ? sa(t.value) : oa(t) ? t.value : void 0, {
|
|
3867
3874
|
register: o,
|
|
3868
3875
|
handleSubmit: c,
|
|
3869
3876
|
formState: {
|
|
3870
|
-
errors:
|
|
3877
|
+
errors: p
|
|
3871
3878
|
},
|
|
3872
3879
|
watch: b
|
|
3873
|
-
} =
|
|
3880
|
+
} = ft({
|
|
3874
3881
|
defaultValues: {
|
|
3875
|
-
countryCode: (n == null ? void 0 : n.countryCode) ?? e.config.defaultValue.countryCode ??
|
|
3882
|
+
countryCode: (n == null ? void 0 : n.countryCode) ?? e.config.defaultValue.countryCode ?? na,
|
|
3876
3883
|
phoneNumber: (n == null ? void 0 : n.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
|
|
3877
3884
|
},
|
|
3878
|
-
resolver:
|
|
3885
|
+
resolver: la(s)
|
|
3879
3886
|
}), {
|
|
3880
3887
|
ref: x,
|
|
3881
|
-
...
|
|
3888
|
+
...h
|
|
3882
3889
|
} = o("phoneNumber", {
|
|
3883
3890
|
required: !e.config.optional
|
|
3884
|
-
}), m =
|
|
3891
|
+
}), m = pe(), C = b("countryCode");
|
|
3885
3892
|
return Ie(() => {
|
|
3886
3893
|
m.current && (m.current.focus(), m.current.select());
|
|
3887
3894
|
}, []), u("form", {
|
|
3888
3895
|
noValidate: !0,
|
|
3889
3896
|
class: "flex flex-col gap-1 p-2.5",
|
|
3890
|
-
onSubmit: c((
|
|
3891
|
-
const I =
|
|
3892
|
-
|
|
3893
|
-
const _ = e.config.minChars ?? 7,
|
|
3894
|
-
if (
|
|
3895
|
-
return
|
|
3897
|
+
onSubmit: c((V) => {
|
|
3898
|
+
const I = V.phoneNumber.replace(/[^0-9]/g, ""), y = V.countryCode.replace(/[^0-9]/g, "");
|
|
3899
|
+
i(void 0);
|
|
3900
|
+
const _ = e.config.minChars ?? 7, F = I.length + y.length;
|
|
3901
|
+
if (F < _)
|
|
3902
|
+
return i(s("validation_phone_min_chars", {
|
|
3896
3903
|
count: _
|
|
3897
3904
|
}));
|
|
3898
3905
|
const M = e.config.maxChars;
|
|
3899
|
-
if (M != null &&
|
|
3900
|
-
return
|
|
3906
|
+
if (M != null && F > M)
|
|
3907
|
+
return i(s("validation_max_chars", {
|
|
3901
3908
|
count: M
|
|
3902
3909
|
}));
|
|
3903
3910
|
e.config.submissionFormat === "phone" ? r({
|
|
@@ -3908,7 +3915,7 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
3908
3915
|
}
|
|
3909
3916
|
}) : r({
|
|
3910
3917
|
type: "string",
|
|
3911
|
-
value: C +
|
|
3918
|
+
value: C + V.phoneNumber
|
|
3912
3919
|
});
|
|
3913
3920
|
}),
|
|
3914
3921
|
children: [u("div", {
|
|
@@ -3924,13 +3931,13 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
3924
3931
|
...o("countryCode", {}),
|
|
3925
3932
|
id: `isdk_phone_${e.key}`,
|
|
3926
3933
|
class: "absolute inset-0 opacity-0",
|
|
3927
|
-
children: Object.entries(Ft).map(([
|
|
3934
|
+
children: Object.entries(Ft).map(([V, I]) => u("option", {
|
|
3928
3935
|
value: I,
|
|
3929
|
-
children: [
|
|
3930
|
-
},
|
|
3936
|
+
children: [V, " (+", I, ")"]
|
|
3937
|
+
}, V))
|
|
3931
3938
|
})]
|
|
3932
3939
|
}), u("input", {
|
|
3933
|
-
...
|
|
3940
|
+
...h,
|
|
3934
3941
|
id: "chat-input",
|
|
3935
3942
|
type: "tel",
|
|
3936
3943
|
inputMode: "tel",
|
|
@@ -3938,26 +3945,26 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
3938
3945
|
autoCapitalize: "off",
|
|
3939
3946
|
autoCorrect: "off",
|
|
3940
3947
|
autoFocus: !0,
|
|
3941
|
-
ref: (
|
|
3942
|
-
|
|
3948
|
+
ref: (V) => {
|
|
3949
|
+
V && (m.current = V), x(V);
|
|
3943
3950
|
},
|
|
3944
|
-
class:
|
|
3951
|
+
class: Ye({
|
|
3945
3952
|
optional: e.config.optional,
|
|
3946
3953
|
className: "min-w-0 flex-1 rounded-r-full"
|
|
3947
3954
|
}),
|
|
3948
3955
|
placeholder: e.config.placeholder
|
|
3949
|
-
}), e.config.optional && u(
|
|
3956
|
+
}), e.config.optional && u(Ae, {
|
|
3950
3957
|
class: "absolute bottom-0 right-1 top-0",
|
|
3951
3958
|
onClick: () => r(null)
|
|
3952
3959
|
})]
|
|
3953
3960
|
}), u(Ee, {})]
|
|
3954
3961
|
}), u(Pe, {
|
|
3955
|
-
error:
|
|
3956
|
-
message:
|
|
3962
|
+
error: p.countryCode || p.phoneNumber || {
|
|
3963
|
+
message: a
|
|
3957
3964
|
}
|
|
3958
3965
|
})]
|
|
3959
3966
|
});
|
|
3960
|
-
},
|
|
3967
|
+
}, nt = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)), ca = ({
|
|
3961
3968
|
input: e,
|
|
3962
3969
|
onSubmitSuccess: r
|
|
3963
3970
|
}) => {
|
|
@@ -3965,21 +3972,21 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
3965
3972
|
t
|
|
3966
3973
|
} = se(), {
|
|
3967
3974
|
availableAt: s
|
|
3968
|
-
} = e.config, [
|
|
3975
|
+
} = e.config, [a, i] = ve(() => nt(s)), [n, o] = ve("");
|
|
3969
3976
|
vr(() => {
|
|
3970
|
-
const
|
|
3971
|
-
if (
|
|
3977
|
+
const p = nt(s);
|
|
3978
|
+
if (i(p), p === 0)
|
|
3972
3979
|
return;
|
|
3973
3980
|
o(t("submission_cooldown", {
|
|
3974
|
-
count:
|
|
3981
|
+
count: p
|
|
3975
3982
|
}));
|
|
3976
3983
|
const b = setInterval(() => {
|
|
3977
|
-
const x =
|
|
3978
|
-
|
|
3984
|
+
const x = nt(s);
|
|
3985
|
+
i(x), !(x > 0) && (clearInterval(b), o(t("submission_cooldown_ready")));
|
|
3979
3986
|
}, 250);
|
|
3980
3987
|
return () => clearInterval(b);
|
|
3981
3988
|
}, [s, t]);
|
|
3982
|
-
const c =
|
|
3989
|
+
const c = a > 0;
|
|
3983
3990
|
return u("div", {
|
|
3984
3991
|
class: "flex flex-col items-center gap-2 py-3",
|
|
3985
3992
|
children: [u("button", {
|
|
@@ -3988,7 +3995,7 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
3988
3995
|
"aria-disabled": c,
|
|
3989
3996
|
"aria-describedby": c ? "submit-cooldown" : void 0,
|
|
3990
3997
|
onClick: () => {
|
|
3991
|
-
|
|
3998
|
+
nt(s) > 0 || r(null);
|
|
3992
3999
|
},
|
|
3993
4000
|
children: u("span", {
|
|
3994
4001
|
class: "flex items-center gap-1.5",
|
|
@@ -4015,7 +4022,7 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
4015
4022
|
"aria-hidden": "true",
|
|
4016
4023
|
class: "text-neutral-11 text-xs",
|
|
4017
4024
|
children: t("submission_cooldown", {
|
|
4018
|
-
count:
|
|
4025
|
+
count: a
|
|
4019
4026
|
})
|
|
4020
4027
|
}), u("p", {
|
|
4021
4028
|
role: "status",
|
|
@@ -4023,7 +4030,7 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
4023
4030
|
children: n
|
|
4024
4031
|
})]
|
|
4025
4032
|
});
|
|
4026
|
-
},
|
|
4033
|
+
}, da = {
|
|
4027
4034
|
date: {
|
|
4028
4035
|
type: "date",
|
|
4029
4036
|
inputMode: "text"
|
|
@@ -4042,7 +4049,7 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
4042
4049
|
inputMode: "url",
|
|
4043
4050
|
formNoValidate: !0
|
|
4044
4051
|
}
|
|
4045
|
-
},
|
|
4052
|
+
}, fa = Re("string"), pa = (e, r) => {
|
|
4046
4053
|
const t = {
|
|
4047
4054
|
maxLength: r("validation_max_chars", {
|
|
4048
4055
|
count: e.maxChars ?? 999
|
|
@@ -4051,47 +4058,47 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
4051
4058
|
count: e.minChars ?? 1
|
|
4052
4059
|
})
|
|
4053
4060
|
};
|
|
4054
|
-
return
|
|
4061
|
+
return pt(/* @__PURE__ */ xe({
|
|
4055
4062
|
text: {
|
|
4056
|
-
date: /* @__PURE__ */ Se(/* @__PURE__ */
|
|
4057
|
-
email: /* @__PURE__ */ Se(/* @__PURE__ */
|
|
4058
|
-
text: /* @__PURE__ */ Se(/* @__PURE__ */
|
|
4059
|
-
url: /* @__PURE__ */ Se(/* @__PURE__ */
|
|
4063
|
+
date: /* @__PURE__ */ Se(/* @__PURE__ */ ae(r("validation_date")), /* @__PURE__ */ It(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
|
|
4064
|
+
email: /* @__PURE__ */ Se(/* @__PURE__ */ ae(r("validation_email")), /* @__PURE__ */ Ar(r("validation_email")), /* @__PURE__ */ De(e.minChars ?? 1, t.minLength), /* @__PURE__ */ He(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
4065
|
+
text: /* @__PURE__ */ Se(/* @__PURE__ */ ae(), /* @__PURE__ */ De(e.minChars ?? 1, t.minLength), /* @__PURE__ */ He(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
4066
|
+
url: /* @__PURE__ */ Se(/* @__PURE__ */ ae(r("validation_url")), /* @__PURE__ */ Mr(r("validation_url")), /* @__PURE__ */ De(e.minChars ?? 1, t.minLength), /* @__PURE__ */ He(e.maxChars ?? 1 / 0, t.maxLength))
|
|
4060
4067
|
}[e.format]
|
|
4061
4068
|
}));
|
|
4062
|
-
},
|
|
4069
|
+
}, ha = ({
|
|
4063
4070
|
input: e,
|
|
4064
4071
|
onSubmitSuccess: r
|
|
4065
4072
|
}) => {
|
|
4066
4073
|
var x;
|
|
4067
4074
|
const {
|
|
4068
4075
|
t
|
|
4069
|
-
} = se(), s = e.key ? (x = $.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0,
|
|
4070
|
-
register:
|
|
4076
|
+
} = se(), s = e.key ? (x = $.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, a = e.config.defaultValue, {
|
|
4077
|
+
register: i,
|
|
4071
4078
|
handleSubmit: n,
|
|
4072
4079
|
formState: {
|
|
4073
4080
|
errors: o
|
|
4074
4081
|
}
|
|
4075
|
-
} =
|
|
4082
|
+
} = ft({
|
|
4076
4083
|
defaultValues: {
|
|
4077
|
-
text:
|
|
4084
|
+
text: fa(s) ? s.value : a ?? ""
|
|
4078
4085
|
},
|
|
4079
|
-
resolver:
|
|
4086
|
+
resolver: pa(e.config, t)
|
|
4080
4087
|
}), {
|
|
4081
4088
|
ref: c,
|
|
4082
|
-
...
|
|
4083
|
-
} =
|
|
4089
|
+
...p
|
|
4090
|
+
} = i("text", {
|
|
4084
4091
|
required: !e.config.optional
|
|
4085
|
-
}), b =
|
|
4092
|
+
}), b = pe();
|
|
4086
4093
|
return Ie(() => {
|
|
4087
4094
|
b.current && (b.current.focus(), b.current.select());
|
|
4088
4095
|
}, []), u("form", {
|
|
4089
4096
|
noValidate: !0,
|
|
4090
4097
|
class: "flex flex-col gap-1 p-2.5",
|
|
4091
|
-
onSubmit: n((
|
|
4098
|
+
onSubmit: n((h) => {
|
|
4092
4099
|
r({
|
|
4093
4100
|
type: "string",
|
|
4094
|
-
value:
|
|
4101
|
+
value: h.text
|
|
4095
4102
|
});
|
|
4096
4103
|
}),
|
|
4097
4104
|
children: [u("div", {
|
|
@@ -4100,21 +4107,21 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
4100
4107
|
class: "relative min-w-0 flex-1",
|
|
4101
4108
|
children: [u("input", {
|
|
4102
4109
|
id: "chat-input",
|
|
4103
|
-
...
|
|
4104
|
-
...
|
|
4110
|
+
...p,
|
|
4111
|
+
...da[e.config.format],
|
|
4105
4112
|
autocomplete: "off",
|
|
4106
4113
|
autoCapitalize: "off",
|
|
4107
4114
|
autoCorrect: "off",
|
|
4108
4115
|
autoFocus: !0,
|
|
4109
|
-
ref: (
|
|
4110
|
-
|
|
4116
|
+
ref: (h) => {
|
|
4117
|
+
h && (b.current = h), c(h);
|
|
4111
4118
|
},
|
|
4112
4119
|
placeholder: e.config.placeholder,
|
|
4113
|
-
class:
|
|
4120
|
+
class: Ye({
|
|
4114
4121
|
optional: !!e.config.optional,
|
|
4115
4122
|
className: "w-full rounded-full"
|
|
4116
4123
|
})
|
|
4117
|
-
}), e.config.optional && u(
|
|
4124
|
+
}), e.config.optional && u(Ae, {
|
|
4118
4125
|
class: "absolute bottom-0 right-0.5 top-0",
|
|
4119
4126
|
onClick: () => r(null)
|
|
4120
4127
|
})]
|
|
@@ -4123,21 +4130,21 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
4123
4130
|
error: o.text
|
|
4124
4131
|
})]
|
|
4125
4132
|
});
|
|
4126
|
-
},
|
|
4127
|
-
text:
|
|
4128
|
-
phone:
|
|
4129
|
-
"multiple-choice":
|
|
4130
|
-
boolean:
|
|
4131
|
-
file:
|
|
4132
|
-
submit:
|
|
4133
|
-
address:
|
|
4134
|
-
number:
|
|
4135
|
-
},
|
|
4133
|
+
}, ya = {
|
|
4134
|
+
text: ha,
|
|
4135
|
+
phone: ua,
|
|
4136
|
+
"multiple-choice": Qn,
|
|
4137
|
+
boolean: mn,
|
|
4138
|
+
file: kn,
|
|
4139
|
+
submit: ca,
|
|
4140
|
+
address: fn,
|
|
4141
|
+
number: ra
|
|
4142
|
+
}, ma = ({
|
|
4136
4143
|
logger: e,
|
|
4137
4144
|
analytics: r
|
|
4138
4145
|
}) => {
|
|
4139
|
-
var
|
|
4140
|
-
const t = (
|
|
4146
|
+
var i;
|
|
4147
|
+
const t = (i = $.current$.value.flow) == null ? void 0 : i.data.currentInput, s = pe(null), a = () => ie.onInteractionFn$.value();
|
|
4141
4148
|
return Ie(() => {
|
|
4142
4149
|
var n;
|
|
4143
4150
|
(n = s.current) == null || n.scrollTo({
|
|
@@ -4148,14 +4155,14 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
4148
4155
|
class: "border-divider max-h-[calc(100%-var(--header-height)-4rem)] w-full shrink-0 scroll-pb-12 overflow-y-auto overscroll-contain border-t",
|
|
4149
4156
|
children: u("div", {
|
|
4150
4157
|
class: "flex flex-col",
|
|
4151
|
-
onPointerDownCapture: t ?
|
|
4152
|
-
onKeyDownCapture: t ?
|
|
4158
|
+
onPointerDownCapture: t ? a : void 0,
|
|
4159
|
+
onKeyDownCapture: t ? a : void 0,
|
|
4153
4160
|
children: t ? (() => {
|
|
4154
|
-
const n =
|
|
4161
|
+
const n = ya[t.type];
|
|
4155
4162
|
return u(n, {
|
|
4156
4163
|
logger: e,
|
|
4157
4164
|
analytics: r,
|
|
4158
|
-
onSubmitSuccess:
|
|
4165
|
+
onSubmitSuccess: ie.onSubmitSuccessFn$.value,
|
|
4159
4166
|
input: t
|
|
4160
4167
|
});
|
|
4161
4168
|
})() : u("div", {
|
|
@@ -4163,7 +4170,7 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
4163
4170
|
children: [u("input", {
|
|
4164
4171
|
"aria-hidden": "true",
|
|
4165
4172
|
id: "chat-input",
|
|
4166
|
-
class:
|
|
4173
|
+
class: Ye({
|
|
4167
4174
|
optional: !1,
|
|
4168
4175
|
className: "flex-grow rounded-full"
|
|
4169
4176
|
}),
|
|
@@ -4177,65 +4184,65 @@ const cr = 27, dr = 12, fr = 10, Jn = Re("enum"), Xn = (e, r) => {
|
|
|
4177
4184
|
})
|
|
4178
4185
|
});
|
|
4179
4186
|
};
|
|
4180
|
-
function
|
|
4187
|
+
function ga(e) {
|
|
4181
4188
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4182
4189
|
}
|
|
4183
|
-
var
|
|
4190
|
+
var ba = function(e) {
|
|
4184
4191
|
return e instanceof RegExp;
|
|
4185
|
-
},
|
|
4192
|
+
}, va = function(r) {
|
|
4186
4193
|
var t = /[\\^$.*+?()[\]{}|]/g, s = RegExp(t.source);
|
|
4187
4194
|
return r && s.test(r) ? r.replace(t, "\\$&") : r;
|
|
4188
4195
|
}, Jr = function(e) {
|
|
4189
4196
|
return typeof e == "string";
|
|
4190
|
-
},
|
|
4197
|
+
}, xa = function(e) {
|
|
4191
4198
|
var r = [];
|
|
4192
4199
|
return e.forEach(function(t) {
|
|
4193
4200
|
Array.isArray(t) ? r = r.concat(t) : r.push(t);
|
|
4194
4201
|
}), r;
|
|
4195
4202
|
};
|
|
4196
|
-
function
|
|
4197
|
-
var s = 0,
|
|
4203
|
+
function wa(e, r, t) {
|
|
4204
|
+
var s = 0, a = 0;
|
|
4198
4205
|
if (e === "")
|
|
4199
4206
|
return e;
|
|
4200
4207
|
if (!e || !Jr(e))
|
|
4201
4208
|
throw new TypeError("First argument to react-string-replace#replaceString must be a string");
|
|
4202
|
-
var
|
|
4203
|
-
|
|
4204
|
-
for (var n = e.split(
|
|
4209
|
+
var i = r;
|
|
4210
|
+
ba(i) || (i = new RegExp("(" + va(i) + ")", "gi"));
|
|
4211
|
+
for (var n = e.split(i), o = 1, c = n.length; o < c; o += 2) {
|
|
4205
4212
|
if (n[o] === void 0 || n[o - 1] === void 0) {
|
|
4206
4213
|
console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
|
|
4207
4214
|
continue;
|
|
4208
4215
|
}
|
|
4209
|
-
|
|
4216
|
+
a = n[o].length, s += n[o - 1].length, n[o] = t(n[o], o, s), s += a;
|
|
4210
4217
|
}
|
|
4211
4218
|
return n;
|
|
4212
4219
|
}
|
|
4213
|
-
var
|
|
4214
|
-
return Array.isArray(r) || (r = [r]),
|
|
4215
|
-
return Jr(
|
|
4220
|
+
var _a = function(r, t, s) {
|
|
4221
|
+
return Array.isArray(r) || (r = [r]), xa(r.map(function(a) {
|
|
4222
|
+
return Jr(a) ? wa(a, t, s) : a;
|
|
4216
4223
|
}));
|
|
4217
4224
|
};
|
|
4218
|
-
const
|
|
4219
|
-
const r =
|
|
4220
|
-
const [, c,
|
|
4221
|
-
return
|
|
4222
|
-
class:
|
|
4223
|
-
href:
|
|
4224
|
-
children: c ??
|
|
4225
|
-
},
|
|
4225
|
+
const We = /* @__PURE__ */ ga(_a), ka = /(\[[^\]]+\]\([^)]+\))/g, Ca = /\[([^\]]+)\]\(([^)]+)\)/, Sa = /(https?:\/\/[^\s]+)/g, Ia = /_(.*?)_/g, Aa = /\*\*(.*?)\*\*/g, Fa = /\\n|\n/g, hr = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Va = (e) => {
|
|
4226
|
+
const r = We(e, ka, (n, o) => {
|
|
4227
|
+
const [, c, p] = n.match(Ca) ?? [];
|
|
4228
|
+
return p ? u("a", {
|
|
4229
|
+
class: hr,
|
|
4230
|
+
href: p,
|
|
4231
|
+
children: c ?? p
|
|
4232
|
+
}, p + o) : u("span", {
|
|
4226
4233
|
children: "INVALID LINK"
|
|
4227
4234
|
});
|
|
4228
|
-
}), t =
|
|
4229
|
-
class:
|
|
4235
|
+
}), t = We(r, Sa, (n, o) => u("a", {
|
|
4236
|
+
class: hr,
|
|
4230
4237
|
href: n,
|
|
4231
4238
|
children: n
|
|
4232
|
-
}, n + o)), s =
|
|
4239
|
+
}, n + o)), s = We(t, Ia, (n, o) => u("em", {
|
|
4233
4240
|
children: n
|
|
4234
|
-
}, n + o)),
|
|
4241
|
+
}, n + o)), a = We(s, Aa, (n, o) => u("strong", {
|
|
4235
4242
|
children: n
|
|
4236
4243
|
}, n + o));
|
|
4237
|
-
return
|
|
4238
|
-
},
|
|
4244
|
+
return We(a, Fa, (n, o) => u("br", {}, `br-${o}`));
|
|
4245
|
+
}, Ma = lt("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", {
|
|
4239
4246
|
variants: {
|
|
4240
4247
|
side: {
|
|
4241
4248
|
left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
|
|
@@ -4249,24 +4256,24 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
|
|
|
4249
4256
|
defaultVariants: {
|
|
4250
4257
|
side: "left"
|
|
4251
4258
|
}
|
|
4252
|
-
}),
|
|
4259
|
+
}), Ea = ({
|
|
4253
4260
|
children: e,
|
|
4254
4261
|
className: r,
|
|
4255
4262
|
animate: t,
|
|
4256
4263
|
side: s,
|
|
4257
|
-
...
|
|
4264
|
+
...a
|
|
4258
4265
|
}) => u("p", {
|
|
4259
4266
|
style: {
|
|
4260
4267
|
transformOrigin: s === "left" ? "0% 50%" : "100% 50%"
|
|
4261
4268
|
},
|
|
4262
|
-
class:
|
|
4269
|
+
class: Ma({
|
|
4263
4270
|
className: r,
|
|
4264
4271
|
side: s,
|
|
4265
4272
|
animate: t
|
|
4266
4273
|
}),
|
|
4267
|
-
...
|
|
4274
|
+
...a,
|
|
4268
4275
|
children: e
|
|
4269
|
-
}),
|
|
4276
|
+
}), Na = ({
|
|
4270
4277
|
message: e
|
|
4271
4278
|
}) => u("div", {
|
|
4272
4279
|
class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
|
|
@@ -4290,12 +4297,12 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
|
|
|
4290
4297
|
})
|
|
4291
4298
|
})]
|
|
4292
4299
|
})
|
|
4293
|
-
}),
|
|
4300
|
+
}), La = ({
|
|
4294
4301
|
className: e,
|
|
4295
4302
|
...r
|
|
4296
4303
|
}) => u("div", {
|
|
4297
4304
|
"aria-hidden": !0,
|
|
4298
|
-
children:
|
|
4305
|
+
children: ie.isBotTyping$.value === !0 ? u("div", {
|
|
4299
4306
|
"aria-label": "Typing…",
|
|
4300
4307
|
class: Oe("flex gap-1 p-4", e),
|
|
4301
4308
|
...r,
|
|
@@ -4308,10 +4315,10 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
|
|
|
4308
4315
|
}
|
|
4309
4316
|
}))
|
|
4310
4317
|
}) : void 0
|
|
4311
|
-
}),
|
|
4318
|
+
}), Da = {
|
|
4312
4319
|
bot: "left",
|
|
4313
4320
|
user: "right"
|
|
4314
|
-
},
|
|
4321
|
+
}, Ta = lt("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)]", {
|
|
4315
4322
|
variants: {
|
|
4316
4323
|
variant: {
|
|
4317
4324
|
info: "text-neutral-8",
|
|
@@ -4320,40 +4327,40 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
|
|
|
4320
4327
|
success: "text-[#4CAF50]"
|
|
4321
4328
|
}
|
|
4322
4329
|
}
|
|
4323
|
-
}),
|
|
4330
|
+
}), Oa = ({
|
|
4324
4331
|
lastSentMessageFooter: e
|
|
4325
4332
|
}) => {
|
|
4326
|
-
const r = $.current$.value.flow, t = (r == null ? void 0 : r.data.messages) ?? [], s = r ?
|
|
4333
|
+
const r = $.current$.value.flow, t = (r == null ? void 0 : r.data.messages) ?? [], s = r ? Ct(r) : void 0;
|
|
4327
4334
|
return u("ol", {
|
|
4328
4335
|
"aria-label": "Chat messages",
|
|
4329
4336
|
"aria-live": "polite",
|
|
4330
4337
|
class: "mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",
|
|
4331
|
-
children: [t.map((
|
|
4338
|
+
children: [t.map((a, i) => u(we, {
|
|
4332
4339
|
children: u("li", {
|
|
4333
4340
|
class: "flex",
|
|
4334
|
-
tabIndex:
|
|
4335
|
-
children: [s &&
|
|
4341
|
+
tabIndex: i === t.length - 1 ? -1 : void 0,
|
|
4342
|
+
children: [s && a.groupId === s && !t.slice(i + 1).some((n) => n.groupId === s) ? e : null, fs(a).with({
|
|
4336
4343
|
type: "system"
|
|
4337
4344
|
}, (n) => u("p", {
|
|
4338
|
-
class:
|
|
4345
|
+
class: Ta({
|
|
4339
4346
|
variant: n.variant
|
|
4340
4347
|
}),
|
|
4341
4348
|
children: n.text
|
|
4342
4349
|
})).with({
|
|
4343
4350
|
type: "text",
|
|
4344
|
-
author:
|
|
4351
|
+
author: ps.union("bot", "user")
|
|
4345
4352
|
}, (n) => {
|
|
4346
|
-
const o =
|
|
4347
|
-
return u(
|
|
4348
|
-
children: u(
|
|
4353
|
+
const o = i === t.length - 1, c = n.author === "bot" ? Va(n.text) : n.text;
|
|
4354
|
+
return u(we, {
|
|
4355
|
+
children: u(Ea, {
|
|
4349
4356
|
animate: o,
|
|
4350
|
-
side:
|
|
4357
|
+
side: Da[n.author],
|
|
4351
4358
|
children: c
|
|
4352
|
-
},
|
|
4359
|
+
}, i)
|
|
4353
4360
|
});
|
|
4354
4361
|
}).with({
|
|
4355
4362
|
type: "link"
|
|
4356
|
-
}, (n) => u(
|
|
4363
|
+
}, (n) => u(Na, {
|
|
4357
4364
|
message: n
|
|
4358
4365
|
})).with({
|
|
4359
4366
|
type: "image"
|
|
@@ -4365,7 +4372,7 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
|
|
|
4365
4372
|
}
|
|
4366
4373
|
})).with({
|
|
4367
4374
|
type: "file"
|
|
4368
|
-
}, (n) => u(
|
|
4375
|
+
}, (n) => u(vn, {
|
|
4369
4376
|
class: n.author === "bot" ? void 0 : "ml-auto",
|
|
4370
4377
|
file: {
|
|
4371
4378
|
name: n.fileName,
|
|
@@ -4375,9 +4382,9 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
|
|
|
4375
4382
|
type: "loading"
|
|
4376
4383
|
}, (n) => {
|
|
4377
4384
|
const o = t[t.length - 1];
|
|
4378
|
-
return !(n === o) ||
|
|
4385
|
+
return !(n === o) || ie.isBotTyping$.value ? null : u("div", {
|
|
4379
4386
|
class: "flex flex-grow flex-col items-center justify-center gap-2",
|
|
4380
|
-
children: [u(
|
|
4387
|
+
children: [u(St, {
|
|
4381
4388
|
"aria-hidden": n.text ? "true" : void 0,
|
|
4382
4389
|
class: "text-neutral-6 h-8 w-8"
|
|
4383
4390
|
}), n.text ? u("p", {
|
|
@@ -4388,56 +4395,56 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
|
|
|
4388
4395
|
});
|
|
4389
4396
|
}).exhaustive()]
|
|
4390
4397
|
})
|
|
4391
|
-
},
|
|
4398
|
+
}, i)), u(La, {}, "typing")]
|
|
4392
4399
|
});
|
|
4393
|
-
},
|
|
4400
|
+
}, $a = ({
|
|
4394
4401
|
logger: e,
|
|
4395
4402
|
apiClient: r,
|
|
4396
4403
|
analytics: t,
|
|
4397
4404
|
talentBankClient: s
|
|
4398
4405
|
}) => {
|
|
4399
4406
|
const {
|
|
4400
|
-
flow:
|
|
4407
|
+
flow: a
|
|
4401
4408
|
} = $.current$.value;
|
|
4402
|
-
Me(
|
|
4403
|
-
const
|
|
4409
|
+
Me(a, "Flow is required to exist to show chatbot body");
|
|
4410
|
+
const i = $.viewState$.value, {
|
|
4404
4411
|
chatRef: n,
|
|
4405
4412
|
chatService: o
|
|
4406
|
-
} =
|
|
4413
|
+
} = hs(), {
|
|
4407
4414
|
t: c
|
|
4408
|
-
} = se(), [
|
|
4415
|
+
} = se(), [p, b] = ve();
|
|
4409
4416
|
return Ie(() => {
|
|
4410
|
-
|
|
4411
|
-
}, [
|
|
4417
|
+
i === "maximised" && ie.scrollToEnd();
|
|
4418
|
+
}, [i]), Ie(() => {
|
|
4412
4419
|
var y;
|
|
4413
4420
|
const {
|
|
4414
4421
|
state: x,
|
|
4415
|
-
flow:
|
|
4422
|
+
flow: h
|
|
4416
4423
|
} = $.current$.peek();
|
|
4417
4424
|
if (x !== "loaded")
|
|
4418
4425
|
throw new Error(c("invalid_state"));
|
|
4419
|
-
let m =
|
|
4420
|
-
if (
|
|
4426
|
+
let m = h.data.nodeHistory.at(-1);
|
|
4427
|
+
if (ie.scrollToEnd(), $.setInput(void 0), h.data.isFinished)
|
|
4421
4428
|
return;
|
|
4422
4429
|
const C = () => {
|
|
4423
4430
|
const _ = $.current$.peek().flow;
|
|
4424
4431
|
!_ || _.data.hasInteracted || ($.markAsInteracted(), Ut(t, _, "FLOW_INTERACT"));
|
|
4425
4432
|
};
|
|
4426
|
-
|
|
4433
|
+
ie.onInteractionFn$.value = C, m === void 0 ? (m = gr(a.nodes).id, $.setCurrentNodeId(m), Ut(t, h, "FLOW_START")) : $.removeMessagesSentByNodeIds([m]);
|
|
4427
4434
|
const {
|
|
4428
4435
|
interpret: E,
|
|
4429
|
-
abort:
|
|
4436
|
+
abort: V,
|
|
4430
4437
|
undo: I
|
|
4431
4438
|
} = _s({
|
|
4432
|
-
context:
|
|
4439
|
+
context: a.context,
|
|
4433
4440
|
analytics: {
|
|
4434
4441
|
service: t,
|
|
4435
|
-
customProperties: (y =
|
|
4442
|
+
customProperties: (y = a.analytics) == null ? void 0 : y.customProperties
|
|
4436
4443
|
},
|
|
4437
4444
|
apiClient: r,
|
|
4438
4445
|
logger: e,
|
|
4439
4446
|
talentBankClient: s,
|
|
4440
|
-
flow:
|
|
4447
|
+
flow: a,
|
|
4441
4448
|
chatService: o,
|
|
4442
4449
|
t: c,
|
|
4443
4450
|
getApplicationRecovery: () => {
|
|
@@ -4445,7 +4452,7 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
|
|
|
4445
4452
|
return (_ = $.current$.peek().flow) == null ? void 0 : _.data.applicationRecovery;
|
|
4446
4453
|
},
|
|
4447
4454
|
setApplicationRecovery: $.setApplicationRecovery,
|
|
4448
|
-
persistWriteBarrier: () => $.persistWriteBarrier(
|
|
4455
|
+
persistWriteBarrier: () => $.persistWriteBarrier(h),
|
|
4449
4456
|
// We need to get fresh submissions, that’s why we call `peek` here.
|
|
4450
4457
|
getSubmissions: () => {
|
|
4451
4458
|
var _;
|
|
@@ -4453,27 +4460,27 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
|
|
|
4453
4460
|
},
|
|
4454
4461
|
onInterpret: (_) => $.setCurrentNodeId(_.id),
|
|
4455
4462
|
onFlowEnd: async () => {
|
|
4456
|
-
var
|
|
4463
|
+
var F;
|
|
4457
4464
|
$.markAsFinished();
|
|
4458
4465
|
const _ = $.current$.peek().flow;
|
|
4459
4466
|
Me(_), t.log({
|
|
4460
4467
|
event: "FLOW_END",
|
|
4461
4468
|
properties: {
|
|
4462
|
-
flow_id:
|
|
4463
|
-
flow_version:
|
|
4469
|
+
flow_id: a.id,
|
|
4470
|
+
flow_version: a.version,
|
|
4464
4471
|
flow_session_id: _.data.flowSessionId,
|
|
4465
|
-
flow_build:
|
|
4466
|
-
job:
|
|
4472
|
+
flow_build: a.build,
|
|
4473
|
+
job: a.job
|
|
4467
4474
|
},
|
|
4468
|
-
customProperties: (
|
|
4475
|
+
customProperties: (F = a.analytics) == null ? void 0 : F.customProperties
|
|
4469
4476
|
});
|
|
4470
4477
|
}
|
|
4471
4478
|
});
|
|
4472
4479
|
return b(() => I), E(m), () => {
|
|
4473
|
-
|
|
4474
|
-
}),
|
|
4480
|
+
ie.onInteractionFn$.value === C && (ie.onInteractionFn$.value = () => {
|
|
4481
|
+
}), V();
|
|
4475
4482
|
};
|
|
4476
|
-
}, [t, r, o, e,
|
|
4483
|
+
}, [t, r, o, e, a, s, c]), u(we, {
|
|
4477
4484
|
children: [u("div", {
|
|
4478
4485
|
class: "relative flex min-h-0 w-full max-w-full flex-grow flex-col",
|
|
4479
4486
|
children: [u("div", {
|
|
@@ -4485,31 +4492,31 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
|
|
|
4485
4492
|
style: {
|
|
4486
4493
|
WebkitOverflowScrolling: "touch"
|
|
4487
4494
|
},
|
|
4488
|
-
children: u(
|
|
4489
|
-
lastSentMessageFooter: !
|
|
4490
|
-
undoFn:
|
|
4495
|
+
children: u(Oa, {
|
|
4496
|
+
lastSentMessageFooter: !Ct(a) || !p ? null : u(Ra, {
|
|
4497
|
+
undoFn: p
|
|
4491
4498
|
})
|
|
4492
4499
|
})
|
|
4493
|
-
}),
|
|
4500
|
+
}), ie.isReadingHistory$.value && !a.data.isFinished && !ie.isBotTyping$.value && u("div", {
|
|
4494
4501
|
class: "absolute bottom-2 left-1/2 -translate-x-1/2",
|
|
4495
4502
|
children: u(wr, {
|
|
4496
4503
|
class: "bg-neutral-1 ring-divider shadow-surface-md ring-1",
|
|
4497
4504
|
"aria-label": c("jump_to_current"),
|
|
4498
4505
|
onClick: () => {
|
|
4499
|
-
var
|
|
4500
|
-
|
|
4506
|
+
var h, m;
|
|
4507
|
+
ie.scrollToEnd(), (m = ((h = n.current) == null ? void 0 : h.querySelector('li[tabindex="-1"]')) ?? n.current) == null || m.focus({
|
|
4501
4508
|
preventScroll: !0
|
|
4502
4509
|
});
|
|
4503
4510
|
},
|
|
4504
4511
|
children: u(ys, {})
|
|
4505
4512
|
})
|
|
4506
4513
|
})]
|
|
4507
|
-
}), u(
|
|
4514
|
+
}), u(ma, {
|
|
4508
4515
|
logger: e,
|
|
4509
4516
|
analytics: t
|
|
4510
4517
|
})]
|
|
4511
4518
|
});
|
|
4512
|
-
},
|
|
4519
|
+
}, Ra = ({
|
|
4513
4520
|
undoFn: e
|
|
4514
4521
|
}) => {
|
|
4515
4522
|
const {
|
|
@@ -4532,5 +4539,5 @@ const Ue = /* @__PURE__ */ mi(wi), _i = /(\[[^\]]+\]\([^)]+\))/g, ki = /\[([^\]]
|
|
|
4532
4539
|
});
|
|
4533
4540
|
};
|
|
4534
4541
|
export {
|
|
4535
|
-
|
|
4542
|
+
$a as ChatbotBody
|
|
4536
4543
|
};
|