@inploi/plugin-chatbot 14.15.0 → 14.16.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.
@@ -1,9 +1,9 @@
1
1
  var Ss = Object.defineProperty;
2
2
  var As = (e, r, t) => r in e ? Ss(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
3
  var Y = (e, r, t) => (As(e, typeof r != "symbol" ? r + "" : r, t), t);
4
- import { u as Br, p as vt, D as Dt, l as Ge, f as $r, T as Pr, a as Es, E as Is, N as Fs, I as qr, C as Vs, s as Ms, g as Ls, S as Rs, U as sr, $ as nr, R as Ns, w as ar, m as Ts, y as Ds, b as Ur, k as Os, x as js, h as Bs, z as $s, Z as Wr, H as Ps, v as qs, c as q, d as re, o as l, e as Qe, i as xt, j as ke, _ as ye, n as Oe, q as Le, r as be, L as Ut, F as Us, t as zr, A as Hr, B as Ws, G as zs, J as et, K as ir, M as ae, O as ce, P as Hs, Q as Ks, V as Gs, W as Js, X as Zs, Y as Kr, a0 as Xs } from "./index-8afa7a59.js";
5
- import { saveClosedRoleJobAlerts as Ys } from "@inploi/sdk";
6
- var Qs = "9.11.0", Gr = `https://sdk.inploi.com/@inploi/flows@${Qs}/cdn/captcha/index.html`, en = new URL(Gr).origin, or = 3e4, tn = 5 * 6e4, rn = (e) => typeof e == "object" && e !== null && e.source === "inploi-captcha", Ft = /* @__PURE__ */ new WeakMap(), sn = (e) => {
4
+ import { p as $r, f as vt, L as Tt, m as Ge, v as Br, O as Pr, l as Is, I as Es, C as Fs, j as qr, P as Vs, u as Ms, y as Ls, w as Rs, F as Ns, V as sr, W as nr, A as Ds, k as ar, b as Ts, x as Os, h as Ur, E as js, S as $s, R as Bs, Q as Ps, J as Wr, Z as qs, _ as Us, s as q, a as re, o as l, c as Qe, d as xt, e as ke, g as ye, i as Oe, n as Le, q as be, r as Ut, t as Ws, z as zr, B as Hr, D as zs, G as Hs, H as et, K as ir, M as ae, N as ce, T as Ks, U as Gs, X as Js, Y as Zs, $ as Xs, a0 as Kr, a1 as Ys } from "./index-cea8111c.js";
5
+ import { saveClosedRoleJobAlerts as Qs } from "@inploi/sdk";
6
+ var en = "9.12.0", Gr = `https://sdk.inploi.com/@inploi/flows@${en}/cdn/captcha/index.html`, tn = new URL(Gr).origin, or = 3e4, rn = 5 * 6e4, sn = (e) => typeof e == "object" && e !== null && e.source === "inploi-captcha", Ft = /* @__PURE__ */ new WeakMap(), nn = (e) => {
7
7
  let r = Ft.get(e);
8
8
  return r || (r = e.fetch("/flow/captcha").then((t) => {
9
9
  let s = t == null ? void 0 : t.site_key;
@@ -11,60 +11,60 @@ var Qs = "9.11.0", Gr = `https://sdk.inploi.com/@inploi/flows@${Qs}/cdn/captcha/
11
11
  }).catch((t) => {
12
12
  throw Ft.delete(e), t;
13
13
  }), Ft.set(e, r)), r;
14
- }, nn = (e, r = {}) => new Promise((t, s) => {
15
- let { signal: n, container: a = null, theme: i, onInteractive: o } = r instanceof AbortSignal ? { signal: r } : r, c = !1, d = () => {
16
- }, g = (k) => {
17
- c || (c = !0, clearTimeout(m), n == null || n.removeEventListener("abort", p), d(), k());
18
- }, b = (k) => g(() => s(new Error(k))), p = () => b("Captcha aborted"), m, _ = (k) => {
19
- clearTimeout(m), m = setTimeout(() => b("Captcha timed out"), k);
14
+ }, an = (e, r = {}) => new Promise((t, s) => {
15
+ let { signal: n, container: i = null, theme: a, onInteractive: o } = r instanceof AbortSignal ? { signal: r } : r, c = !1, f = () => {
16
+ }, p = (w) => {
17
+ c || (c = !0, clearTimeout(b), n == null || n.removeEventListener("abort", m), f(), w());
18
+ }, g = (w) => p(() => s(new Error(w))), m = () => g("Captcha aborted"), b, k = (w) => {
19
+ clearTimeout(b), b = setTimeout(() => g("Captcha timed out"), w);
20
20
  };
21
- if (_(or), n == null ? void 0 : n.aborted)
22
- return p();
23
- n == null || n.addEventListener("abort", p), (async () => {
24
- let k = await sn(e);
25
- if (k === void 0)
26
- return g(() => t(void 0));
21
+ if (k(or), n == null ? void 0 : n.aborted)
22
+ return m();
23
+ n == null || n.addEventListener("abort", m), (async () => {
24
+ let w = await nn(e);
25
+ if (w === void 0)
26
+ return p(() => t(void 0));
27
27
  if (c)
28
28
  return;
29
29
  let C = document.createElement("iframe");
30
- C.src = `${Gr}?${new URLSearchParams({ sitekey: k, origin: window.location.origin, ...i && { theme: i } }).toString()}`, C.title = "Cloudflare security check", C.style.cssText = `display:block;border:0;width:${a ? "100%" : "300px"};height:0;color-scheme:normal`, a ? a.appendChild(C) : (C.style.cssText += ";position:fixed;bottom:16px;right:16px;z-index:2147483647", document.body.appendChild(C));
30
+ C.src = `${Gr}?${new URLSearchParams({ sitekey: w, origin: window.location.origin, ...a && { theme: a } }).toString()}`, C.title = "Cloudflare security check", C.style.cssText = `display:block;border:0;width:${i ? "100%" : "300px"};height:0;color-scheme:normal`, i ? i.appendChild(C) : (C.style.cssText += ";position:fixed;bottom:16px;right:16px;z-index:2147483647", document.body.appendChild(C));
31
31
  let A = !1, v = (R) => {
32
- if (!C.contentWindow || R.source !== C.contentWindow || R.origin !== en || !rn(R.data))
32
+ if (!C.contentWindow || R.source !== C.contentWindow || R.origin !== tn || !sn(R.data))
33
33
  return;
34
34
  let V = R.data;
35
35
  switch (V.type) {
36
36
  case "token":
37
- return g(() => t(V.token));
37
+ return p(() => t(V.token));
38
38
  case "resize":
39
39
  C.style.height = `${Math.max(0, Math.ceil(V.height))}px`;
40
40
  return;
41
41
  case "before-interactive":
42
- return A = !0, _(tn), o == null ? void 0 : o();
42
+ return A = !0, k(rn), o == null ? void 0 : o();
43
43
  case "after-interactive":
44
- return A = !1, _(or);
44
+ return A = !1, k(or);
45
45
  case "error":
46
- !A && !V.interactive && b("Captcha failed");
46
+ !A && !V.interactive && g("Captcha failed");
47
47
  return;
48
48
  case "expired":
49
- return b("Captcha expired");
49
+ return g("Captcha expired");
50
50
  case "timeout":
51
- return b("Captcha timed out");
51
+ return g("Captcha timed out");
52
52
  }
53
53
  };
54
- window.addEventListener("message", v), d = () => {
54
+ window.addEventListener("message", v), f = () => {
55
55
  window.removeEventListener("message", v), C.remove();
56
56
  };
57
- })().catch((k) => g(() => s(k)));
57
+ })().catch((w) => p(() => s(w)));
58
58
  }), lr = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
59
- let [n, ...a] = e.compareKey.split(".");
59
+ let [n, ...i] = e.compareKey.split(".");
60
60
  if (!n)
61
61
  return !1;
62
- let i = Br({ context: r, key: n, path: a, submissions: t });
63
- if (!i)
62
+ let a = $r({ context: r, key: n, path: i, submissions: t });
63
+ if (!a)
64
64
  return !1;
65
- switch (i.type) {
65
+ switch (a.type) {
66
66
  case "address": {
67
- let o = Dt(i.value, a);
67
+ let o = Tt(a.value, i);
68
68
  switch (e.compare) {
69
69
  case "equals":
70
70
  return o === e.compareValue;
@@ -78,9 +78,9 @@ var Qs = "9.11.0", Gr = `https://sdk.inploi.com/@inploi/flows@${Qs}/cdn/captcha/
78
78
  break;
79
79
  }
80
80
  case "integration": {
81
- if (typeof i.value != "object" || Array.isArray(i.value))
81
+ if (typeof a.value != "object" || Array.isArray(a.value))
82
82
  return !1;
83
- let o = Dt(i.value, a), c = { ...s, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
83
+ let o = Tt(a.value, i), c = { ...s, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
84
84
  switch (typeof o) {
85
85
  case "boolean":
86
86
  return lt(c, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
@@ -89,7 +89,7 @@ var Qs = "9.11.0", Gr = `https://sdk.inploi.com/@inploi/flows@${Qs}/cdn/captcha/
89
89
  case "number":
90
90
  return lt(c, { submissions: { _temp: { value: o, type: "number" } }, context: r });
91
91
  case "object":
92
- return Array.isArray(o) && o.every((d) => typeof d == "string") ? lt(c, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
92
+ return Array.isArray(o) && o.every((f) => typeof f == "string") ? lt(c, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
93
93
  }
94
94
  break;
95
95
  }
@@ -97,15 +97,15 @@ var Qs = "9.11.0", Gr = `https://sdk.inploi.com/@inploi/flows@${Qs}/cdn/captcha/
97
97
  let o = e.compareValue === "true";
98
98
  switch (e.compare) {
99
99
  case "equals":
100
- return i.value === o;
100
+ return a.value === o;
101
101
  case "notEquals":
102
- return i.value !== o;
102
+ return a.value !== o;
103
103
  }
104
104
  break;
105
105
  }
106
106
  case "phone":
107
107
  case "string": {
108
- let o = i.type === "phone" ? vt(i.value) : i.value;
108
+ let o = a.type === "phone" ? vt(a.value) : a.value;
109
109
  switch (e.compare) {
110
110
  case "equals":
111
111
  return o === e.compareValue;
@@ -123,33 +123,33 @@ var Qs = "9.11.0", Gr = `https://sdk.inploi.com/@inploi/flows@${Qs}/cdn/captcha/
123
123
  let o = Number(e.compareValue);
124
124
  switch (e.compare) {
125
125
  case "equals":
126
- return i.value === o;
126
+ return a.value === o;
127
127
  case "notEquals":
128
- return i.value !== o;
128
+ return a.value !== o;
129
129
  case "greaterThan":
130
- return i.value > o;
130
+ return a.value > o;
131
131
  case "greaterThanOrEqualTo":
132
- return i.value >= o;
132
+ return a.value >= o;
133
133
  case "lessThan":
134
- return i.value < o;
134
+ return a.value < o;
135
135
  case "lessThanOrEqualTo":
136
- return i.value <= o;
136
+ return a.value <= o;
137
137
  }
138
138
  } catch {
139
- return console.error(`Failed to parse number in if-block ${s.id}`, i.value), !1;
139
+ return console.error(`Failed to parse number in if-block ${s.id}`, a.value), !1;
140
140
  }
141
141
  break;
142
142
  }
143
143
  case "enum":
144
144
  switch (e.compare) {
145
145
  case "equals":
146
- return i.value.length === 1 && i.value[0] === e.compareValue;
146
+ return a.value.length === 1 && a.value[0] === e.compareValue;
147
147
  case "notEquals":
148
- return i.value.length === 1 && i.value[0] !== e.compareValue;
148
+ return a.value.length === 1 && a.value[0] !== e.compareValue;
149
149
  case "contains":
150
- return i.value.includes(e.compareValue);
150
+ return a.value.includes(e.compareValue);
151
151
  case "notContains":
152
- return !i.value.includes(e.compareValue);
152
+ return !a.value.includes(e.compareValue);
153
153
  }
154
154
  break;
155
155
  }
@@ -166,53 +166,53 @@ var Qs = "9.11.0", Gr = `https://sdk.inploi.com/@inploi/flows@${Qs}/cdn/captcha/
166
166
  return !1;
167
167
  return !0;
168
168
  }
169
- }, an = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, on = (e, { context: r, submissions: t }) => e.replace(an, (s, n, a = "") => {
170
- let [i, ...o] = n.trim().split("."), c = Br({ key: i, path: o, submissions: t, context: r });
169
+ }, on = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, ln = (e, { context: r, submissions: t }) => e.replace(on, (s, n, i = "") => {
170
+ let [a, ...o] = n.trim().split("."), c = $r({ key: a, path: o, submissions: t, context: r });
171
171
  if (!c)
172
- return a;
172
+ return i;
173
173
  switch (c.type) {
174
174
  case "boolean":
175
175
  return c.value === !0 ? "true" : "false";
176
176
  case "file":
177
- return c.value.map((d) => `${d.name} (${Ge(d.sizeKb)})`).join(", ");
177
+ return c.value.map((f) => `${f.name} (${Ge(f.sizeKb)})`).join(", ");
178
178
  case "enum":
179
179
  return c.value.join(", ");
180
180
  case "address":
181
- return Object.values(c.value).filter((d) => d && d.trim().length > 0).join(", ");
181
+ return Object.values(c.value).filter((f) => f && f.trim().length > 0).join(", ");
182
182
  case "number":
183
183
  case "string":
184
- return c.value ? c.value.toString() : a;
184
+ return c.value ? c.value.toString() : i;
185
185
  case "phone":
186
186
  return vt(c.value);
187
187
  case "integration": {
188
188
  if (typeof c.value != "object" || Array.isArray(c.value))
189
189
  break;
190
- let d = Dt(c.value, o);
191
- switch (typeof d) {
190
+ let f = Tt(c.value, o);
191
+ switch (typeof f) {
192
192
  case "boolean":
193
- return d === !0 ? "true" : "false";
193
+ return f === !0 ? "true" : "false";
194
194
  case "string":
195
- return d;
195
+ return f;
196
196
  case "number":
197
- return d.toString();
197
+ return f.toString();
198
198
  case "object":
199
- if (Array.isArray(d) && d.every((g) => typeof g == "string"))
200
- return d.join(", ");
199
+ if (Array.isArray(f) && f.every((p) => typeof p == "string"))
200
+ return f.join(", ");
201
201
  }
202
202
  break;
203
203
  }
204
204
  }
205
- return a;
205
+ return i;
206
206
  });
207
207
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
208
- function ln(e) {
208
+ function cn(e) {
209
209
  return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
210
210
  }
211
211
  function Wt(e, r, t = "") {
212
- const s = ln(e), n = e == null ? void 0 : e.length, a = r !== void 0;
213
- if (!s || a && n !== r) {
214
- const i = t && `"${t}" `, o = a ? ` of length ${r}` : "", c = s ? `length=${n}` : `type=${typeof e}`;
215
- throw new Error(i + "expected Uint8Array" + o + ", got " + c);
212
+ const s = cn(e), n = e == null ? void 0 : e.length, i = r !== void 0;
213
+ if (!s || i && n !== r) {
214
+ const a = t && `"${t}" `, o = i ? ` of length ${r}` : "", c = s ? `length=${n}` : `type=${typeof e}`;
215
+ throw new Error(a + "expected Uint8Array" + o + ", got " + c);
216
216
  }
217
217
  return e;
218
218
  }
@@ -222,7 +222,7 @@ function cr(e, r = !0) {
222
222
  if (r && e.finished)
223
223
  throw new Error("Hash#digest() has already been called");
224
224
  }
225
- function cn(e, r) {
225
+ function un(e, r) {
226
226
  Wt(e, void 0, "digestInto() output");
227
227
  const t = r.outputLen;
228
228
  if (e.length < t)
@@ -238,32 +238,32 @@ function Vt(e) {
238
238
  function pe(e, r) {
239
239
  return e << 32 - r | e >>> r;
240
240
  }
241
- const un = /* @__PURE__ */ (() => (
241
+ const dn = /* @__PURE__ */ (() => (
242
242
  // @ts-ignore
243
243
  typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function"
244
- ))(), dn = /* @__PURE__ */ Array.from({ length: 256 }, (e, r) => r.toString(16).padStart(2, "0"));
245
- function fn(e) {
246
- if (Wt(e), un)
244
+ ))(), fn = /* @__PURE__ */ Array.from({ length: 256 }, (e, r) => r.toString(16).padStart(2, "0"));
245
+ function hn(e) {
246
+ if (Wt(e), dn)
247
247
  return e.toHex();
248
248
  let r = "";
249
249
  for (let t = 0; t < e.length; t++)
250
- r += dn[e[t]];
250
+ r += fn[e[t]];
251
251
  return r;
252
252
  }
253
- function hn(e, r = {}) {
254
- const t = (n, a) => e(a).update(n).digest(), s = e(void 0);
253
+ function pn(e, r = {}) {
254
+ const t = (n, i) => e(i).update(n).digest(), s = e(void 0);
255
255
  return t.outputLen = s.outputLen, t.blockLen = s.blockLen, t.create = (n) => e(n), Object.assign(t, r), Object.freeze(t);
256
256
  }
257
- const pn = (e) => ({
257
+ const mn = (e) => ({
258
258
  oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, e])
259
259
  });
260
- function mn(e, r, t) {
260
+ function yn(e, r, t) {
261
261
  return e & r ^ ~e & t;
262
262
  }
263
- function yn(e, r, t) {
263
+ function bn(e, r, t) {
264
264
  return e & r ^ e & t ^ r & t;
265
265
  }
266
- class bn {
266
+ class gn {
267
267
  constructor(r, t, s, n) {
268
268
  Y(this, "blockLen");
269
269
  Y(this, "outputLen");
@@ -280,35 +280,35 @@ class bn {
280
280
  }
281
281
  update(r) {
282
282
  cr(this), Wt(r);
283
- const { view: t, buffer: s, blockLen: n } = this, a = r.length;
284
- for (let i = 0; i < a; ) {
285
- const o = Math.min(n - this.pos, a - i);
283
+ const { view: t, buffer: s, blockLen: n } = this, i = r.length;
284
+ for (let a = 0; a < i; ) {
285
+ const o = Math.min(n - this.pos, i - a);
286
286
  if (o === n) {
287
287
  const c = Vt(r);
288
- for (; n <= a - i; i += n)
289
- this.process(c, i);
288
+ for (; n <= i - a; a += n)
289
+ this.process(c, a);
290
290
  continue;
291
291
  }
292
- s.set(r.subarray(i, i + o), this.pos), this.pos += o, i += o, this.pos === n && (this.process(t, 0), this.pos = 0);
292
+ s.set(r.subarray(a, a + o), this.pos), this.pos += o, a += o, this.pos === n && (this.process(t, 0), this.pos = 0);
293
293
  }
294
294
  return this.length += r.length, this.roundClean(), this;
295
295
  }
296
296
  digestInto(r) {
297
- cr(this), cn(r, this), this.finished = !0;
298
- const { buffer: t, view: s, blockLen: n, isLE: a } = this;
299
- let { pos: i } = this;
300
- t[i++] = 128, Ot(this.buffer.subarray(i)), this.padOffset > n - i && (this.process(s, 0), i = 0);
301
- for (let b = i; b < n; b++)
302
- t[b] = 0;
303
- s.setBigUint64(n - 8, BigInt(this.length * 8), a), this.process(s, 0);
297
+ cr(this), un(r, this), this.finished = !0;
298
+ const { buffer: t, view: s, blockLen: n, isLE: i } = this;
299
+ let { pos: a } = this;
300
+ t[a++] = 128, Ot(this.buffer.subarray(a)), this.padOffset > n - a && (this.process(s, 0), a = 0);
301
+ for (let g = a; g < n; g++)
302
+ t[g] = 0;
303
+ s.setBigUint64(n - 8, BigInt(this.length * 8), i), this.process(s, 0);
304
304
  const o = Vt(r), c = this.outputLen;
305
305
  if (c % 4)
306
306
  throw new Error("_sha2: outputLen must be aligned to 32bit");
307
- const d = c / 4, g = this.get();
308
- if (d > g.length)
307
+ const f = c / 4, p = this.get();
308
+ if (f > p.length)
309
309
  throw new Error("_sha2: outputLen bigger than state");
310
- for (let b = 0; b < d; b++)
311
- o.setUint32(4 * b, g[b], a);
310
+ for (let g = 0; g < f; g++)
311
+ o.setUint32(4 * g, p[g], i);
312
312
  }
313
313
  digest() {
314
314
  const { buffer: r, outputLen: t } = this;
@@ -318,14 +318,14 @@ class bn {
318
318
  }
319
319
  _cloneInto(r) {
320
320
  r || (r = new this.constructor()), r.set(...this.get());
321
- const { blockLen: t, buffer: s, length: n, finished: a, destroyed: i, pos: o } = this;
322
- return r.destroyed = i, r.finished = a, r.length = n, r.pos = o, n % t && r.buffer.set(s), r;
321
+ const { blockLen: t, buffer: s, length: n, finished: i, destroyed: a, pos: o } = this;
322
+ return r.destroyed = a, r.finished = i, r.length = n, r.pos = o, n % t && r.buffer.set(s), r;
323
323
  }
324
324
  clone() {
325
325
  return this._cloneInto();
326
326
  }
327
327
  }
328
- const Ie = /* @__PURE__ */ Uint32Array.from([
328
+ const Ee = /* @__PURE__ */ Uint32Array.from([
329
329
  1779033703,
330
330
  3144134277,
331
331
  1013904242,
@@ -334,7 +334,7 @@ const Ie = /* @__PURE__ */ Uint32Array.from([
334
334
  2600822924,
335
335
  528734635,
336
336
  1541459225
337
- ]), gn = /* @__PURE__ */ Uint32Array.from([
337
+ ]), vn = /* @__PURE__ */ Uint32Array.from([
338
338
  1116352408,
339
339
  1899447441,
340
340
  3049323471,
@@ -400,31 +400,31 @@ const Ie = /* @__PURE__ */ Uint32Array.from([
400
400
  3204031479,
401
401
  3329325298
402
402
  ]), Fe = /* @__PURE__ */ new Uint32Array(64);
403
- class vn extends bn {
403
+ class xn extends gn {
404
404
  constructor(r) {
405
405
  super(64, r, 8, !1);
406
406
  }
407
407
  get() {
408
- const { A: r, B: t, C: s, D: n, E: a, F: i, G: o, H: c } = this;
409
- return [r, t, s, n, a, i, o, c];
408
+ const { A: r, B: t, C: s, D: n, E: i, F: a, G: o, H: c } = this;
409
+ return [r, t, s, n, i, a, o, c];
410
410
  }
411
411
  // prettier-ignore
412
- set(r, t, s, n, a, i, o, c) {
413
- this.A = r | 0, this.B = t | 0, this.C = s | 0, this.D = n | 0, this.E = a | 0, this.F = i | 0, this.G = o | 0, this.H = c | 0;
412
+ set(r, t, s, n, i, a, o, c) {
413
+ this.A = r | 0, this.B = t | 0, this.C = s | 0, this.D = n | 0, this.E = i | 0, this.F = a | 0, this.G = o | 0, this.H = c | 0;
414
414
  }
415
415
  process(r, t) {
416
- for (let b = 0; b < 16; b++, t += 4)
417
- Fe[b] = r.getUint32(t, !1);
418
- for (let b = 16; b < 64; b++) {
419
- const p = Fe[b - 15], m = Fe[b - 2], _ = pe(p, 7) ^ pe(p, 18) ^ p >>> 3, k = pe(m, 17) ^ pe(m, 19) ^ m >>> 10;
420
- Fe[b] = k + Fe[b - 7] + _ + Fe[b - 16] | 0;
416
+ for (let g = 0; g < 16; g++, t += 4)
417
+ Fe[g] = r.getUint32(t, !1);
418
+ for (let g = 16; g < 64; g++) {
419
+ const m = Fe[g - 15], b = Fe[g - 2], k = pe(m, 7) ^ pe(m, 18) ^ m >>> 3, w = pe(b, 17) ^ pe(b, 19) ^ b >>> 10;
420
+ Fe[g] = w + Fe[g - 7] + k + Fe[g - 16] | 0;
421
421
  }
422
- let { A: s, B: n, C: a, D: i, E: o, F: c, G: d, H: g } = this;
423
- for (let b = 0; b < 64; b++) {
424
- const p = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), m = g + p + mn(o, c, d) + gn[b] + Fe[b] | 0, k = (pe(s, 2) ^ pe(s, 13) ^ pe(s, 22)) + yn(s, n, a) | 0;
425
- g = d, d = c, c = o, o = i + m | 0, i = a, a = n, n = s, s = m + k | 0;
422
+ let { A: s, B: n, C: i, D: a, E: o, F: c, G: f, H: p } = this;
423
+ for (let g = 0; g < 64; g++) {
424
+ const m = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), b = p + m + yn(o, c, f) + vn[g] + Fe[g] | 0, w = (pe(s, 2) ^ pe(s, 13) ^ pe(s, 22)) + bn(s, n, i) | 0;
425
+ p = f, f = c, c = o, o = a + b | 0, a = i, i = n, n = s, s = b + w | 0;
426
426
  }
427
- s = s + this.A | 0, n = n + this.B | 0, a = a + this.C | 0, i = i + this.D | 0, o = o + this.E | 0, c = c + this.F | 0, d = d + this.G | 0, g = g + this.H | 0, this.set(s, n, a, i, o, c, d, g);
427
+ s = s + this.A | 0, n = n + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, c = c + this.F | 0, f = f + this.G | 0, p = p + this.H | 0, this.set(s, n, i, a, o, c, f, p);
428
428
  }
429
429
  roundClean() {
430
430
  Ot(Fe);
@@ -433,24 +433,24 @@ class vn extends bn {
433
433
  this.set(0, 0, 0, 0, 0, 0, 0, 0), Ot(this.buffer);
434
434
  }
435
435
  }
436
- class xn extends vn {
436
+ class wn extends xn {
437
437
  constructor() {
438
438
  super(32);
439
439
  // We cannot use array here since array allows indexing by variable
440
440
  // which means optimizer/compiler cannot use registers.
441
- Y(this, "A", Ie[0] | 0);
442
- Y(this, "B", Ie[1] | 0);
443
- Y(this, "C", Ie[2] | 0);
444
- Y(this, "D", Ie[3] | 0);
445
- Y(this, "E", Ie[4] | 0);
446
- Y(this, "F", Ie[5] | 0);
447
- Y(this, "G", Ie[6] | 0);
448
- Y(this, "H", Ie[7] | 0);
441
+ Y(this, "A", Ee[0] | 0);
442
+ Y(this, "B", Ee[1] | 0);
443
+ Y(this, "C", Ee[2] | 0);
444
+ Y(this, "D", Ee[3] | 0);
445
+ Y(this, "E", Ee[4] | 0);
446
+ Y(this, "F", Ee[5] | 0);
447
+ Y(this, "G", Ee[6] | 0);
448
+ Y(this, "H", Ee[7] | 0);
449
449
  }
450
450
  }
451
- const wn = /* @__PURE__ */ hn(
452
- () => new xn(),
453
- /* @__PURE__ */ pn(1)
451
+ const _n = /* @__PURE__ */ pn(
452
+ () => new wn(),
453
+ /* @__PURE__ */ mn(1)
454
454
  );
455
455
  var Jr = (e) => {
456
456
  let r = e.find((t) => t.isHead);
@@ -461,79 +461,79 @@ var Jr = (e) => {
461
461
  var r, t;
462
462
  if (!(e.data.isFinished || (r = e.data.startedWriteNodeIds) != null && r.length))
463
463
  return (t = [...e.data.messages].reverse().find((s) => s.groupId && e.nodes.some((n) => n.id === s.groupId && n.type.startsWith("question-")) && (s.type === "system" || "author" in s && s.author === "user"))) == null ? void 0 : t.groupId;
464
- }, jt = (e) => Array.isArray(e) ? e.map(jt) : e !== null && typeof e == "object" ? Object.fromEntries(Object.entries(e).sort(([r], [t]) => r.localeCompare(t)).map(([r, t]) => [r, jt(t)])) : typeof e == "function" ? void 0 : e, _n = (e) => fn(wn(new TextEncoder().encode(JSON.stringify(jt(e)))));
465
- function kn(e, r, t, s) {
464
+ }, jt = (e) => Array.isArray(e) ? e.map(jt) : e !== null && typeof e == "object" ? Object.fromEntries(Object.entries(e).sort(([r], [t]) => r.localeCompare(t)).map(([r, t]) => [r, jt(t)])) : typeof e == "function" ? void 0 : e, kn = (e) => hn(_n(new TextEncoder().encode(JSON.stringify(jt(e)))));
465
+ function Cn(e, r, t, s) {
466
466
  var n;
467
467
  if (s != null && s.aborted)
468
468
  return;
469
- let a = _n(t), i = (n = e.data).preApplyFingerprints ?? (n.preApplyFingerprints = []);
470
- if (i.includes(a))
469
+ let i = kn(t), a = (n = e.data).preApplyFingerprints ?? (n.preApplyFingerprints = []);
470
+ if (a.includes(i))
471
471
  return;
472
- i.push(a);
472
+ a.push(i);
473
473
  let o = new AbortController(), c = setTimeout(() => o.abort(), 5e3);
474
474
  r.fetch("/flow/pre-apply", { method: "POST", signal: o.signal, body: JSON.stringify(t) }).catch(() => {
475
- let d = i.indexOf(a);
476
- d !== -1 && i.splice(d, 1);
475
+ let f = a.indexOf(i);
476
+ f !== -1 && a.splice(f, 1);
477
477
  }).finally(() => {
478
478
  clearTimeout(c);
479
479
  });
480
480
  }
481
- var Zr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {} }), he = (e, r) => on(e, Zr(r)), Cn = (e, r) => lt(e, Zr(r)), Xr = ({ node: e, nodes: r, stopWhen: t }) => {
481
+ var Zr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {} }), he = (e, r) => ln(e, Zr(r)), Sn = (e, r) => lt(e, Zr(r)), Xr = ({ node: e, nodes: r, stopWhen: t }) => {
482
482
  if ((t == null ? void 0 : t(e)) === !0)
483
483
  return e;
484
484
  let s = e.nextId ? r.find((n) => n.id === e.nextId) : void 0;
485
485
  if (s)
486
486
  return Xr({ node: s, nodes: r, stopWhen: t });
487
- }, Sn = ({ childNode: e, nodes: r }) => {
487
+ }, An = ({ childNode: e, nodes: r }) => {
488
488
  let t = r.filter((s) => s.type === "if-block").find((s) => {
489
489
  if (!s.branchId)
490
490
  return !1;
491
- let n = r.find((i) => i.id === s.branchId);
491
+ let n = r.find((a) => a.id === s.branchId);
492
492
  if (!n)
493
493
  return !1;
494
- let a = Xr({ node: n, nodes: r, stopWhen: (i) => i.id === e.id });
495
- return !(!a || a.id !== e.id);
494
+ let i = Xr({ node: n, nodes: r, stopWhen: (a) => a.id === e.id });
495
+ return !(!i || i.id !== e.id);
496
496
  });
497
497
  if (t != null && t.nextId)
498
498
  return r.find((s) => s.id === t.nextId);
499
- }, An = 3, En = ({ flow: e, analytics: r, logger: t, talentBankClient: s, context: n, apiClient: a, getSubmissions: i, getApplicationRecovery: o, setApplicationRecovery: c, chatService: d, persistWriteBarrier: g, onSubmitNetworkError: b, closedRoleBehaviour: p, settledOutcomes: m = p, dateEchoLocale: _, onFlowEnd: k, onInterpret: C, forceSubmitConfirmation: A, flowType: v, t: R }) => {
499
+ }, In = 3, En = ({ flow: e, analytics: r, logger: t, talentBankClient: s, context: n, apiClient: i, getSubmissions: a, getApplicationRecovery: o, setApplicationRecovery: c, chatService: f, persistWriteBarrier: p, onSubmitNetworkError: g, closedRoleBehaviour: m, settledOutcomes: b = m, dateEchoLocale: k, onFlowEnd: w, onInterpret: C, forceSubmitConfirmation: A, flowType: v, t: R }) => {
500
500
  var V;
501
501
  let M = new AbortController(), ee = { submitAccepted: !1 };
502
- (V = e.data).startedWriteNodeIds ?? (V.startedWriteNodeIds = e.nodes.flatMap((D) => {
503
- var j, I;
504
- if (D.type !== "integration-application-submit" || !e.data.nodeHistory.includes(D.id))
502
+ (V = e.data).startedWriteNodeIds ?? (V.startedWriteNodeIds = e.nodes.flatMap((N) => {
503
+ var j, E;
504
+ if (N.type !== "integration-application-submit" || !e.data.nodeHistory.includes(N.id))
505
505
  return [];
506
- let T = D.data.key ? (j = i()) == null ? void 0 : j[D.data.key] : void 0;
507
- return (T == null ? void 0 : T.type) === "integration" && ((I = $r(T.value)) == null ? void 0 : I.verdict) === "not_submitted" ? [] : [D.id];
506
+ let D = N.data.key ? (j = a()) == null ? void 0 : j[N.data.key] : void 0;
507
+ return (D == null ? void 0 : D.type) === "integration" && ((E = Br(D.value)) == null ? void 0 : E.verdict) === "not_submitted" ? [] : [N.id];
508
508
  }));
509
- let N = { ...r.service, log: (D) => r.service.log({ ...D, customProperties: { ...D.customProperties, ...r.customProperties } }) }, G = async (D, T) => {
509
+ let K = { ...r.service, log: (N) => r.service.log({ ...N, customProperties: { ...N.customProperties, ...r.customProperties } }) }, T = async (N, D) => {
510
510
  let j = M.signal;
511
511
  if (j.aborted)
512
512
  return;
513
- let I = i(), F = o(), $ = (F == null ? void 0 : F.submitNodeId) === D.id ? e.nodes.find((L) => {
513
+ let E = a(), F = o(), B = (F == null ? void 0 : F.submitNodeId) === N.id ? e.nodes.find((L) => {
514
514
  var W;
515
- return L.id === F.fileQuestionNodeId && L.type === "question-file" && ((W = I == null ? void 0 : I[L.data.key]) == null ? void 0 : W.type) !== "file";
515
+ return L.id === F.fileQuestionNodeId && L.type === "question-file" && ((W = E == null ? void 0 : E[L.data.key]) == null ? void 0 : W.type) !== "file";
516
516
  }) : void 0;
517
- if ($)
518
- return G($, T);
519
- C == null || C(D, T);
517
+ if (B)
518
+ return T(B, D);
519
+ C == null || C(N, D);
520
520
  try {
521
- await In({ flow: e, analytics: N, logger: t, talentBankClient: s, apiClient: a, context: n, node: D, submissions: I, applicationRecovery: F, setApplicationRecovery: async (L) => {
521
+ await Fn({ flow: e, analytics: K, logger: t, talentBankClient: s, apiClient: i, context: n, node: N, submissions: E, applicationRecovery: F, setApplicationRecovery: async (L) => {
522
522
  if (!j.aborted)
523
523
  try {
524
524
  await c(L);
525
525
  } catch (W) {
526
526
  t.error("Failed to persist application recovery", W);
527
527
  }
528
- }, forceSubmitConfirmation: A || (F == null ? void 0 : F.submitNodeId) === D.id, run: ee, persistWriteBarrier: g, onSubmitNetworkError: b, settledOutcomes: m, dateEchoLocale: _, flowType: v, signal: j, t: R, chat: { sendMessage: async (L) => d.send({ groupId: D.id, message: L, signal: j }), userInput: async (L) => d.input({ input: L, signal: j }), setSubmission: (L, W) => {
529
- j.aborted || d.setSubmission(L, W);
530
- }, captcha: d.captcha }, next: (L) => {
528
+ }, forceSubmitConfirmation: A || (F == null ? void 0 : F.submitNodeId) === N.id, run: ee, persistWriteBarrier: p, onSubmitNetworkError: g, settledOutcomes: b, dateEchoLocale: k, flowType: v, signal: j, t: R, chat: { sendMessage: async (L) => f.send({ groupId: N.id, message: L, signal: j }), userInput: async (L) => f.input({ input: L, signal: j }), setSubmission: (L, W) => {
529
+ j.aborted || f.setSubmission(L, W);
530
+ }, captcha: f.captcha }, next: (L) => {
531
531
  if (j.aborted)
532
532
  return;
533
- let W = (F == null ? void 0 : F.fileQuestionNodeId) === D.id ? F.submitNodeId : L, U = W ? e.nodes.find((te) => te.id === W) : Sn({ childNode: D, nodes: e.nodes });
534
- return U ? G(U, D) : k == null ? void 0 : k(D);
533
+ let W = (F == null ? void 0 : F.fileQuestionNodeId) === N.id ? F.submitNodeId : L, U = W ? e.nodes.find((te) => te.id === W) : An({ childNode: N, nodes: e.nodes });
534
+ return U ? T(U, N) : w == null ? void 0 : w(N);
535
535
  }, end: () => {
536
- j.aborted || (k == null || k(D));
536
+ j.aborted || (w == null || w(N));
537
537
  } });
538
538
  } catch (L) {
539
539
  if (L instanceof Pr)
@@ -541,207 +541,207 @@ var Zr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
541
541
  throw L;
542
542
  }
543
543
  };
544
- return { interpret: async (D) => {
545
- let T = e.nodes.find((j) => j.id === D) ?? Jr(e.nodes);
546
- return G(T);
547
- }, undo: (D) => {
544
+ return { interpret: async (N) => {
545
+ let D = e.nodes.find((j) => j.id === N) ?? Jr(e.nodes);
546
+ return T(D);
547
+ }, undo: (N) => {
548
548
  var W;
549
549
  if (delete e.data.reviewReplay, ((W = e.data.startedWriteNodeIds) == null ? void 0 : W.length) || e.data.isFinished)
550
550
  return { removed: 0 };
551
- let T = zt(e), j = T ? D.lastIndexOf(T) : -1, I = e.nodes.find((U) => U.id === T);
552
- if (j === -1 || !I)
551
+ let D = zt(e), j = D ? N.lastIndexOf(D) : -1, E = e.nodes.find((U) => U.id === D);
552
+ if (j === -1 || !E)
553
553
  return { removed: 0 };
554
- let F = e.nodes.find((U) => U.id === D[D.length - 1]);
554
+ let F = e.nodes.find((U) => U.id === N[N.length - 1]);
555
555
  M.abort();
556
- let $ = D.splice(j);
557
- e.data.messages = e.data.messages.filter((U) => !U.groupId || !$.includes(U.groupId)), e.data.currentInput = null;
558
- let L = i();
559
- for (let U of $.slice(1)) {
556
+ let B = N.splice(j);
557
+ e.data.messages = e.data.messages.filter((U) => !U.groupId || !B.includes(U.groupId)), e.data.currentInput = null;
558
+ let L = a();
559
+ for (let U of B.slice(1)) {
560
560
  let te = e.nodes.find((X) => X.id === U);
561
- if (!(!te || !L || te.id === T) && ("key" in te.data && te.data.key && delete L[te.data.key], "keys" in te.data))
561
+ if (!(!te || !L || te.id === D) && ("key" in te.data && te.data.key && delete L[te.data.key], "keys" in te.data))
562
562
  for (let X of Object.values(te.data.keys))
563
563
  typeof X == "string" && delete L[X];
564
564
  }
565
- return M = new AbortController(), G(I, F), { removed: $.length };
565
+ return M = new AbortController(), T(E, F), { removed: B.length };
566
566
  }, abort: () => {
567
567
  M.abort();
568
568
  } };
569
569
  };
570
- async function In(e) {
570
+ async function Fn(e) {
571
571
  let r = e.node;
572
572
  switch (r.type) {
573
573
  case "flow-section":
574
574
  return await e.chat.sendMessage({ type: "system", variant: "info", text: r.data.title }), e.next(r.nextId);
575
575
  case "pre-apply-result":
576
- return Qn({ ...e, node: r });
576
+ return ea({ ...e, node: r });
577
577
  case "text":
578
- return Un({ ...e, node: r });
579
- case "image":
580
578
  return Wn({ ...e, node: r });
581
- case "question-text":
579
+ case "image":
582
580
  return zn({ ...e, node: r });
581
+ case "question-text":
582
+ return Hn({ ...e, node: r });
583
583
  case "question-enum":
584
- return Gn({ ...e, node: r });
584
+ return Jn({ ...e, node: r });
585
585
  case "question-number":
586
- return Hn({ ...e, node: r });
587
- case "question-phone":
588
586
  return Kn({ ...e, node: r });
587
+ case "question-phone":
588
+ return Gn({ ...e, node: r });
589
589
  case "question-boolean":
590
- return Jn({ ...e, node: r });
590
+ return Zn({ ...e, node: r });
591
591
  case "question-file":
592
- return Xn({ ...e, node: r });
592
+ return Yn({ ...e, node: r });
593
593
  case "question-address":
594
- return Zn({ ...e, node: r });
594
+ return Xn({ ...e, node: r });
595
595
  case "end-flow":
596
- return Yn({ ...e, node: r });
596
+ return Qn({ ...e, node: r });
597
597
  case "if-block":
598
- return qn({ ...e, node: r });
598
+ return Un({ ...e, node: r });
599
599
  case "jump":
600
- return Mn({ ...e, node: r });
600
+ return Ln({ ...e, node: r });
601
601
  case "link":
602
- return Pn({ ...e, node: r });
602
+ return qn({ ...e, node: r });
603
603
  case "integration-application-submit":
604
- return jn({ ...e, node: r });
604
+ return $n({ ...e, node: r });
605
605
  case "add-submission":
606
- return Ln({ ...e, node: r });
606
+ return Rn({ ...e, node: r });
607
607
  case "integration-workflow-get":
608
608
  throw Error("Workflow should be unreachable");
609
609
  case "check-duplicate":
610
- return Vn({ ...e, node: r });
610
+ return Mn({ ...e, node: r });
611
611
  case "feedback":
612
- return Fn({ ...e, node: r });
612
+ return Vn({ ...e, node: r });
613
613
  default:
614
614
  throw new Error(`Unknown node: ${JSON.stringify(r)}`);
615
615
  }
616
616
  }
617
- async function Fn({ next: e, node: r }) {
617
+ async function Vn({ next: e, node: r }) {
618
618
  e(r.nextId);
619
619
  }
620
- async function Vn({ next: e, node: r, talentBankClient: t, submissions: s, flow: n, logger: a, chat: i }) {
620
+ async function Mn({ next: e, node: r, talentBankClient: t, submissions: s, flow: n, logger: i, chat: a }) {
621
621
  var c;
622
622
  let o = { isDuplicate: !1 };
623
623
  if (s && t) {
624
- let d = r.data.scope === "job" ? (c = n.job) == null ? void 0 : c.id : void 0;
625
- if (r.data.scope === "company" || d != null)
624
+ let f = r.data.scope === "job" ? (c = n.job) == null ? void 0 : c.id : void 0;
625
+ if (r.data.scope === "company" || f != null)
626
626
  try {
627
- o = await t.checkDuplicate({ email: Es({ key: r.data.email, submissions: s }).toString(), jobId: d, scope: r.data.scope });
628
- } catch (g) {
629
- a.error("[check-duplicate]", g);
627
+ o = await t.checkDuplicate({ email: Is({ key: r.data.email, submissions: s }).toString(), jobId: f, scope: r.data.scope });
628
+ } catch (p) {
629
+ i.error("[check-duplicate]", p);
630
630
  }
631
631
  }
632
- i.setSubmission(r.data.key, { type: "integration", value: o }), e(r.nextId);
632
+ a.setSubmission(r.data.key, { type: "integration", value: o }), e(r.nextId);
633
633
  }
634
- async function Mn({ next: e, node: r }) {
634
+ async function Ln({ next: e, node: r }) {
635
635
  e(r.data.targetId);
636
636
  }
637
- async function Ln({ next: e, node: r, logger: t, submissions: s, context: n }) {
637
+ async function Rn({ next: e, node: r, logger: t, submissions: s, context: n }) {
638
638
  if (!s) {
639
639
  t.error("Submissions not found");
640
640
  return;
641
641
  }
642
642
  s[r.data.key] = { type: "string", value: he(r.data.value, { submissions: s, context: n }) }, e(r.nextId);
643
643
  }
644
- var Rn = 5e3, Nn = (e, r) => r ? `${e}@${r.id_type}:${r.id}` : e, Tn = (e, r = Date.now()) => Math.min(e.until, r + (e.maintenance ? $s : e.throttles ? Wr : Ps)), Dn = (e, r, t) => {
645
- let { waitMs: s, throttles: n, maintenance: a } = qs(r == null ? void 0 : r.throttles, t);
646
- return { key: e, until: Date.now() + s, ...n !== void 0 && { throttles: n }, ...a && { maintenance: a } };
647
- }, On = ["ApiError", "NotFoundError", "UnauthorisedError", "SchemaValidationError", "ParsingError"], Bt = (e) => e instanceof Error && On.includes(e.name) ? e : void 0, ur = (e) => {
648
- let r = Bt(e);
644
+ var Nn = 5e3, Dn = (e, r) => r ? `${e}@${r.id_type}:${r.id}` : e, Tn = (e, r = Date.now()) => Math.min(e.until, r + (e.maintenance ? Ps : e.throttles ? Wr : qs)), On = (e, r, t) => {
645
+ let { waitMs: s, throttles: n, maintenance: i } = Us(r == null ? void 0 : r.throttles, t);
646
+ return { key: e, until: Date.now() + s, ...n !== void 0 && { throttles: n }, ...i && { maintenance: i } };
647
+ }, jn = ["ApiError", "NotFoundError", "UnauthorisedError", "SchemaValidationError", "ParsingError"], $t = (e) => e instanceof Error && jn.includes(e.name) ? e : void 0, ur = (e) => {
648
+ let r = $t(e);
649
649
  return (r == null ? void 0 : r.name) === "ApiError" ? r : void 0;
650
650
  };
651
- async function jn({ chat: e, next: r, end: t, node: s, logger: n, apiClient: a, submissions: i, analytics: o, flow: c, applicationRecovery: d, setApplicationRecovery: g, forceSubmitConfirmation: b, flowType: p, run: m, persistWriteBarrier: _, signal: k, onSubmitNetworkError: C, settledOutcomes: A, t: v }) {
652
- var G, D;
653
- let R = async ({ redirect_url: T, message: j, button_text: I }) => {
654
- let { anonymous_id: F, session_id: $ } = o.getSessionInfo();
651
+ async function $n({ chat: e, next: r, end: t, node: s, logger: n, apiClient: i, submissions: a, analytics: o, flow: c, applicationRecovery: f, setApplicationRecovery: p, forceSubmitConfirmation: g, flowType: m, run: b, persistWriteBarrier: k, signal: w, onSubmitNetworkError: C, settledOutcomes: A, t: v }) {
652
+ var T, N;
653
+ let R = async ({ redirect_url: D, message: j, button_text: E }) => {
654
+ let { anonymous_id: F, session_id: B } = o.getSessionInfo();
655
655
  await e.sendMessage({ type: "text", author: "bot", text: j ?? v("submission_redirect_message") });
656
656
  try {
657
- let L = new URL(T);
658
- F && !L.searchParams.has("anonymous_id") && L.searchParams.set("anonymous_id", F), await e.sendMessage({ type: "link", href: L.toString(), text: I ?? v("complete_submission"), onClick: () => {
659
- if (!$) {
657
+ let L = new URL(D);
658
+ F && !L.searchParams.has("anonymous_id") && L.searchParams.set("anonymous_id", F), await e.sendMessage({ type: "link", href: L.toString(), text: E ?? v("complete_submission"), onClick: () => {
659
+ if (!B) {
660
660
  n.error("session_id not set, cannot log FLOW_REDIRECT event");
661
661
  return;
662
662
  }
663
- o.log({ event: "FLOW_REDIRECT", properties: { flow_build: c.build, flow_id: c.id, flow_session_id: $, flow_version: c.version, href: L.toString(), job: c.job } });
663
+ o.log({ event: "FLOW_REDIRECT", properties: { flow_build: c.build, flow_id: c.id, flow_session_id: B, flow_version: c.version, href: L.toString(), job: c.job } });
664
664
  } });
665
665
  } catch (L) {
666
- n.error(`Invalid redirect URL: ${T}`, L), e.sendMessage({ type: "system", variant: "error", text: v("redirect_url_error") });
666
+ n.error(`Invalid redirect URL: ${D}`, L), e.sendMessage({ type: "system", variant: "error", text: v("redirect_url_error") });
667
667
  }
668
668
  };
669
- if ((G = c.data.startedWriteNodeIds) != null && G.includes(s.id) && (d == null ? void 0 : d.submitNodeId) !== s.id) {
670
- let T = (D = c.data.submitRedirects) == null ? void 0 : D[s.id];
671
- return T ? (await R(T), r(s.nextId)) : (await e.sendMessage({ type: "system", variant: "warning", text: v("submission_unknown") }), t());
669
+ if ((T = c.data.startedWriteNodeIds) != null && T.includes(s.id) && (f == null ? void 0 : f.submitNodeId) !== s.id) {
670
+ let D = (N = c.data.submitRedirects) == null ? void 0 : N[s.id];
671
+ return D ? (await R(D), r(s.nextId)) : (await e.sendMessage({ type: "system", variant: "warning", text: v("submission_unknown") }), t());
672
672
  }
673
- let V = Nn(s.id, c.job), M = 0, ee = m.submitAccepted && s.data.skipConfirmation === !0 && (d == null ? void 0 : d.submitNodeId) !== s.id, N = async (T) => {
674
- var nt, pt, mt, At, at, u, f, h, w;
673
+ let V = Dn(s.id, c.job), M = 0, ee = b.submitAccepted && s.data.skipConfirmation === !0 && (f == null ? void 0 : f.submitNodeId) !== s.id, K = async (D) => {
674
+ var nt, pt, mt, At, at, u, d, h, _;
675
675
  let j = ((nt = c.data.submitCooldown) == null ? void 0 : nt.key) === V ? c.data.submitCooldown : void 0;
676
676
  j && (j.until = Tn(j));
677
- let I = j == null ? void 0 : j.until;
678
- (c.data.reviewRequiresSend === !0 && !ee || T !== !0 || I !== void 0 && I > Date.now()) && await e.userInput({ type: "submit", key: void 0, config: { label: s.data.submitLabel, ...I !== void 0 && { availableAt: I } } }), ee = !1;
677
+ let E = j == null ? void 0 : j.until;
678
+ (c.data.reviewRequiresSend === !0 && !ee || D !== !0 || E !== void 0 && E > Date.now()) && await e.userInput({ type: "submit", key: void 0, config: { label: s.data.submitLabel, ...E !== void 0 && { availableAt: E } } }), ee = !1;
679
679
  let F;
680
680
  if (s.data.captcha) {
681
681
  let y = e.captcha, x = !0;
682
682
  try {
683
- F = await nn(a, { signal: k, container: (y == null ? void 0 : y.container()) ?? null, theme: y == null ? void 0 : y.theme, onInteractive: () => {
683
+ F = await an(i, { signal: w, container: (y == null ? void 0 : y.container()) ?? null, theme: y == null ? void 0 : y.theme, onInteractive: () => {
684
684
  e.sendMessage({ type: "text", author: "bot", text: v("captcha_check") }).catch(() => {
685
685
  }).then(() => {
686
686
  x && (y == null || y.reveal(!0));
687
687
  });
688
688
  } });
689
- } catch (E) {
690
- if (n.error("Captcha check failed", E), k.aborted)
689
+ } catch (I) {
690
+ if (n.error("Captcha check failed", I), w.aborted)
691
691
  return;
692
692
  } finally {
693
693
  x = !1, y == null || y.reveal(!1);
694
694
  }
695
695
  }
696
696
  await e.sendMessage({ type: "loading", text: v("submitting") });
697
- let { anonymous_id: $, session_id: L } = o.getSessionInfo();
698
- if (k.aborted)
697
+ let { anonymous_id: B, session_id: L } = o.getSessionInfo();
698
+ if (w.aborted)
699
699
  return;
700
700
  let W = ((pt = c.data.startedWriteNodeIds) == null ? void 0 : pt.includes(s.id)) === !0;
701
- if ((d == null ? void 0 : d.submitNodeId) === s.id && await g(void 0), W || (c.data.startedWriteNodeIds = [...c.data.startedWriteNodeIds ?? [], s.id]), await _().catch((y) => n.error("Failed to persist application write barrier", y)), k.aborted)
701
+ if ((f == null ? void 0 : f.submitNodeId) === s.id && await p(void 0), W || (c.data.startedWriteNodeIds = [...c.data.startedWriteNodeIds ?? [], s.id]), await k().catch((y) => n.error("Failed to persist application write barrier", y)), w.aborted)
702
702
  return;
703
703
  let U, te = setTimeout(() => {
704
704
  U = e.sendMessage({ type: "loading", semantic: "submission-still-working", text: v("submission_still_working") }).catch((y) => n.error("Failed to send submission progress message", y));
705
- }, Rn), X, H = await a.fetch("/flow/submit", { method: "POST", body: JSON.stringify({ log_submit: !1, integration_id: s.data.integrationId, anonymous_id: $, session_id: L, job: c.job, flow_build: c.build, ...F !== void 0 && { captcha_token: F }, submissions: Vs(c.nodes, Ms(i || {}, s.data.submitKeys)), pre_apply: qr(c.nodes, i || {}, c.data.flowSessionId) }) }).catch((y) => {
705
+ }, Nn), X, z = await i.fetch("/flow/submit", { method: "POST", body: JSON.stringify({ log_submit: !1, integration_id: s.data.integrationId, anonymous_id: B, session_id: L, job: c.job, flow_build: c.build, ...F !== void 0 && { captcha_token: F }, submissions: Vs(c.nodes, Ms(a || {}, s.data.submitKeys)), pre_apply: qr(c.nodes, a || {}, c.data.flowSessionId) }) }).catch((y) => {
706
706
  X = y;
707
707
  let x = ur(y);
708
708
  return (x == null ? void 0 : x.data) !== void 0 ? x.data : y;
709
709
  });
710
- if (clearTimeout(te), await U, k.aborted)
710
+ if (clearTimeout(te), await U, w.aborted)
711
711
  return;
712
- if (X !== void 0 && !Bt(X) && C)
713
- return await C(X, k), N(!0);
714
- s.data.key && e.setSubmission(s.data.key, { type: "integration", value: H });
715
- let rt = (mt = ur(X)) == null ? void 0 : mt.status, Be = typeof rt == "number" ? rt : void 0, O = $r(H, Be), $e = O === void 0 && Be === 429, Pe = A === "terminal" && ((O == null ? void 0 : O.outcome) === "closed" || (O == null ? void 0 : O.outcome) === "duplicate"), Ae = c.data.failedAttemptAt, Re = Ae == null ? void 0 : Ae[V];
712
+ if (X !== void 0 && !$t(X) && C)
713
+ return await C(X, w), K(!0);
714
+ c.data.stagingDestination = Ls(z), s.data.key && e.setSubmission(s.data.key, { type: "integration", value: z });
715
+ let rt = (mt = ur(X)) == null ? void 0 : mt.status, $e = typeof rt == "number" ? rt : void 0, O = Br(z, $e), Be = O === void 0 && $e === 429, Pe = A === "terminal" && ((O == null ? void 0 : O.outcome) === "closed" || (O == null ? void 0 : O.outcome) === "duplicate"), Ae = c.data.failedAttemptAt, Re = Ae == null ? void 0 : Ae[V];
716
716
  Ae && Re !== void 0 && Re > Date.now() && (Re = Ae[V] = Date.now());
717
- let qe = Re !== void 0 && Date.now() - Re < Ls || ((At = c.data.unconfirmedAttemptKeys) == null ? void 0 : At.includes(V)) === !0, st = (at = Bt(X)) == null ? void 0 : at.status, ve = Rs(H, typeof st == "number" ? st : void 0);
718
- ve && o.log({ event: "FLOW_SUBMIT", properties: { flow_id: c.id, flow_version: c.version, flow_session_id: c.data.flowSessionId, flow_build: c.build, service: ve.service, response: ve.response, captured: (H == null ? void 0 : H.captured) === !0, flow_type: (p == null ? void 0 : p()) ?? "CHATBOT_DRAWER", job: c.job, ...(O == null ? void 0 : O.outcome) === "duplicate" && { outcome: qe ? "duplicate_after_own_attempt" : "duplicate" }, ...ve.outcome && { outcome: ve.outcome } } });
719
- let Ue = sr(H) || (H == null ? void 0 : H.success) === !0;
720
- if ((Ue || nr(H)) && (m.submitAccepted = !0), Ue && ((u = c.data.submitCooldown) == null ? void 0 : u.throttles) !== void 0 && (delete c.data.submitCooldown.throttles, await _().catch((y) => n.error("Failed to persist submit cooldown reset", y))), sr(H)) {
721
- let { redirect_url: y, message: x, button_text: E } = H.integration_response.data, B = { redirect_url: y, message: x, button_text: E };
722
- return k.aborted ? void 0 : (c.data.submitRedirects = { ...c.data.submitRedirects, [s.id]: B }, await _().catch((P) => n.error("Failed to persist submit redirect", P)), await R(B), r(s.nextId));
717
+ let qe = Re !== void 0 && Date.now() - Re < Rs || ((At = c.data.unconfirmedAttemptKeys) == null ? void 0 : At.includes(V)) === !0, st = (at = $t(X)) == null ? void 0 : at.status, ve = Ns(z, typeof st == "number" ? st : void 0);
718
+ ve && o.log({ event: "FLOW_SUBMIT", properties: { flow_id: c.id, flow_version: c.version, flow_session_id: c.data.flowSessionId, flow_build: c.build, service: ve.service, response: ve.response, captured: (z == null ? void 0 : z.captured) === !0, flow_type: (m == null ? void 0 : m()) ?? "CHATBOT_DRAWER", job: c.job, ...(O == null ? void 0 : O.outcome) === "duplicate" && { outcome: qe ? "duplicate_after_own_attempt" : "duplicate" }, ...ve.outcome && { outcome: ve.outcome } } });
719
+ let Ue = sr(z) || (z == null ? void 0 : z.success) === !0;
720
+ if ((Ue || nr(z)) && (b.submitAccepted = !0), Ue && ((u = c.data.submitCooldown) == null ? void 0 : u.throttles) !== void 0 && (delete c.data.submitCooldown.throttles, await k().catch((y) => n.error("Failed to persist submit cooldown reset", y))), sr(z)) {
721
+ let { redirect_url: y, message: x, button_text: I } = z.integration_response.data, $ = { redirect_url: y, message: x, button_text: I };
722
+ return w.aborted ? void 0 : (c.data.submitRedirects = { ...c.data.submitRedirects, [s.id]: $ }, await k().catch((P) => n.error("Failed to persist submit redirect", P)), await R($), r(s.nextId));
723
723
  }
724
- let ht = nr(H);
724
+ let ht = nr(z);
725
725
  if (ht)
726
726
  return await e.sendMessage({ type: "system", variant: "success", text: ht.message ?? v("submission_pending") }), r(s.nextId);
727
- if ((H == null ? void 0 : H.success) === !0)
727
+ if ((z == null ? void 0 : z.success) === !0)
728
728
  return s.data.skipConfirmation !== !0 && await e.sendMessage({ type: "system", variant: "success", text: v("submission_completed") }), r(s.nextId);
729
- let We = Ns(O), ze = We !== void 0 && ((f = i == null ? void 0 : i[We]) == null ? void 0 : f.type) === "file" ? We : void 0, Ne = ze === void 0 ? void 0 : c.nodes.find((y) => y.type === "question-file" && y.data.key === ze);
730
- if (!Ne && !Pe && !ar(O) && (c.data.submitCooldown = Dn(V, j, O)), (O == null ? void 0 : O.outcome) !== "duplicate" && !$e && (c.data.failedAttemptAt = { ...c.data.failedAttemptAt, [V]: Date.now() }, (h = c.data.unconfirmedAttemptKeys) != null && h.includes(V) && (c.data.unconfirmedAttemptKeys = c.data.unconfirmedAttemptKeys.filter((y) => y !== V))), (O == null ? void 0 : O.verdict) === "not_submitted" || (O == null ? void 0 : O.outcome) === "duplicate" || (O == null ? void 0 : O.outcome) === "closed" || $e || Ts(H, Be) ? (W || (c.data.startedWriteNodeIds = (w = c.data.startedWriteNodeIds) == null ? void 0 : w.filter((y) => y !== s.id)), (d == null ? void 0 : d.submitNodeId) === s.id && await g(d), await _().catch((y) => n.error("Failed to persist application write barrier release", y))) : await _().catch((y) => n.error("Failed to persist submit cooldown", y)), O) {
729
+ let We = Ds(O), ze = We !== void 0 && ((d = a == null ? void 0 : a[We]) == null ? void 0 : d.type) === "file" ? We : void 0, Ne = ze === void 0 ? void 0 : c.nodes.find((y) => y.type === "question-file" && y.data.key === ze);
730
+ if (!Ne && !Pe && !ar(O) && (c.data.submitCooldown = On(V, j, O)), (O == null ? void 0 : O.outcome) !== "duplicate" && !Be && (c.data.failedAttemptAt = { ...c.data.failedAttemptAt, [V]: Date.now() }, (h = c.data.unconfirmedAttemptKeys) != null && h.includes(V) && (c.data.unconfirmedAttemptKeys = c.data.unconfirmedAttemptKeys.filter((y) => y !== V))), (O == null ? void 0 : O.verdict) === "not_submitted" || (O == null ? void 0 : O.outcome) === "duplicate" || (O == null ? void 0 : O.outcome) === "closed" || Be || Ts(z, $e) ? (W || (c.data.startedWriteNodeIds = (_ = c.data.startedWriteNodeIds) == null ? void 0 : _.filter((y) => y !== s.id)), (f == null ? void 0 : f.submitNodeId) === s.id && await p(f), await k().catch((y) => n.error("Failed to persist application write barrier release", y))) : await k().catch((y) => n.error("Failed to persist submit cooldown", y)), O) {
731
731
  if (n.error(X ?? O.message), Ne && ze !== void 0)
732
- return e.setSubmission(ze, null), await g({ fileQuestionNodeId: Ne.id, submitNodeId: s.id }), await e.sendMessage({ type: "system", variant: "error", text: v("submission_unreadable_document") }), r(Ne.id);
732
+ return e.setSubmission(ze, null), await p({ fileQuestionNodeId: Ne.id, submitNodeId: s.id }), await e.sendMessage({ type: "system", variant: "error", text: v("submission_unreadable_document") }), r(Ne.id);
733
733
  if (O.outcome === "duplicate")
734
- return await e.sendMessage({ type: "system", variant: Pe ? "success" : "info", semantic: "submission-duplicate", text: v(qe ? "submission_duplicate_earlier_attempt" : "submission_duplicate") }), Pe ? (delete c.data.submitCooldown, t()) : N(!1);
734
+ return await e.sendMessage({ type: "system", variant: Pe ? "success" : "info", semantic: "submission-duplicate", text: v(qe ? "submission_duplicate_earlier_attempt" : "submission_duplicate") }), Pe ? (delete c.data.submitCooldown, t()) : K(!1);
735
735
  if (O.outcome === "closed")
736
- return await e.sendMessage({ type: "system", variant: "info", semantic: "submission-closed", text: v("submission_closed") }), Pe ? (delete c.data.submitCooldown, t()) : N(!1);
737
- let y = Ds(O);
738
- return y ? (await e.sendMessage({ type: "system", variant: "warning", text: y.until === void 0 ? v("submission_provider_maintenance_later") : v("submission_provider_maintenance", { time: Ur(y.until, void 0) }) }), N(!1)) : O.outcome === "unknown" ? (await e.sendMessage({ type: "system", variant: "warning", text: v(Os(O) ? "submission_unknown_do_not_resubmit" : "submission_unknown") }), N(!1)) : ar(O) ? js(H) ? (await e.sendMessage({ type: "text", author: "bot", text: O.message }), N(!1)) : (M === 0 && await e.sendMessage({ type: "system", variant: "warning", text: v("captcha_failed") }), M++, N(M <= An)) : Bs(O) ? (await e.sendMessage({ type: "system", variant: "error", text: v("submission_retryable") }), N(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: v("submission_failed") }), t());
736
+ return await e.sendMessage({ type: "system", variant: "info", semantic: "submission-closed", text: v("submission_closed") }), Pe ? (delete c.data.submitCooldown, t()) : K(!1);
737
+ let y = Os(O);
738
+ return y ? (await e.sendMessage({ type: "system", variant: "warning", text: y.until === void 0 ? v("submission_provider_maintenance_later") : v("submission_provider_maintenance", { time: Ur(y.until, void 0) }) }), K(!1)) : O.outcome === "unknown" ? (await e.sendMessage({ type: "system", variant: "warning", text: v(js(O) ? "submission_unknown_do_not_resubmit" : "submission_unknown") }), K(!1)) : ar(O) ? $s(z) ? (await e.sendMessage({ type: "text", author: "bot", text: O.message }), K(!1)) : (M === 0 && await e.sendMessage({ type: "system", variant: "warning", text: v("captcha_failed") }), M++, K(M <= In)) : Bs(O) ? (await e.sendMessage({ type: "system", variant: "error", text: v("submission_retryable") }), K(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: v("submission_failed") }), t());
739
739
  }
740
- return n.error(X ?? H), $e ? (await e.sendMessage({ type: "system", variant: "error", text: v("submission_retryable") }), N(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: v("submission_failed") }), t());
740
+ return n.error(X ?? z), Be ? (await e.sendMessage({ type: "system", variant: "error", text: v("submission_retryable") }), K(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: v("submission_failed") }), t());
741
741
  };
742
- await N(b === !0 && !ee ? !1 : s.data.skipConfirmation);
742
+ await K(g === !0 && !ee ? !1 : s.data.skipConfirmation);
743
743
  }
744
- var Bn = /{{\s*\$context\.job\.apply_url\s*(?:\|[^}]*)?}}/, $n = (e, r) => {
744
+ var Bn = /{{\s*\$context\.job\.apply_url\s*(?:\|[^}]*)?}}/, Pn = (e, r) => {
745
745
  if (!Bn.test(e))
746
746
  return !1;
747
747
  try {
@@ -751,83 +751,83 @@ var Bn = /{{\s*\$context\.job\.apply_url\s*(?:\|[^}]*)?}}/, $n = (e, r) => {
751
751
  return !1;
752
752
  }
753
753
  };
754
- async function Pn({ chat: e, next: r, node: t, submissions: s, context: n, analytics: a, flow: i }) {
755
- let o = he(t.data.href, { submissions: s, context: n }), { flowSessionId: c } = i.data;
756
- await e.sendMessage({ type: "link", href: o, text: he(t.data.cta, { submissions: s, context: n }), ...$n(t.data.href, o) && { onClick: () => {
757
- a.log({ event: "FLOW_REDIRECT", properties: { flow_build: i.build, flow_id: i.id, flow_session_id: c, flow_version: i.version, href: o, job: i.job } });
754
+ async function qn({ chat: e, next: r, node: t, submissions: s, context: n, analytics: i, flow: a }) {
755
+ let o = he(t.data.href, { submissions: s, context: n }), { flowSessionId: c } = a.data;
756
+ await e.sendMessage({ type: "link", href: o, text: he(t.data.cta, { submissions: s, context: n }), ...Pn(t.data.href, o) && { onClick: () => {
757
+ i.log({ event: "FLOW_REDIRECT", properties: { flow_build: a.build, flow_id: a.id, flow_session_id: c, flow_version: a.version, href: o, job: a.job } });
758
758
  } } }), r(t.nextId);
759
759
  }
760
- async function qn({ submissions: e, next: r, node: t, context: s }) {
761
- r(Cn(t, { submissions: e, context: s }) ? t.branchId : t.nextId);
760
+ async function Un({ submissions: e, next: r, node: t, context: s }) {
761
+ r(Sn(t, { submissions: e, context: s }) ? t.branchId : t.nextId);
762
762
  }
763
- async function Un({ chat: e, next: r, node: t, submissions: s, context: n }) {
763
+ async function Wn({ chat: e, next: r, node: t, submissions: s, context: n }) {
764
764
  await e.sendMessage({ author: "bot", type: "text", text: he(t.data.text, { submissions: s, context: n }) }), r(t.nextId);
765
765
  }
766
- async function Wn({ chat: e, next: r, node: t }) {
766
+ async function zn({ chat: e, next: r, node: t }) {
767
767
  await e.sendMessage({ author: "bot", type: "image", url: t.data.url, height: t.data.height, width: t.data.width }), r(t.nextId);
768
768
  }
769
- async function zn({ chat: e, next: r, node: t, submissions: s, context: n, t: a, dateEchoLocale: i }) {
769
+ async function Hn({ chat: e, next: r, node: t, submissions: s, context: n, t: i, dateEchoLocale: a }) {
770
770
  await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: s, context: n }) });
771
771
  let o = t.data.format === "phone" ? await e.userInput({ key: t.data.key, type: "phone", config: { optional: t.data.optional, placeholder: t.data.placeholder, minChars: t.data.minChars, maxChars: t.data.maxChars, submissionFormat: "text", defaultValue: {} } }) : await e.userInput({ key: t.data.key, type: "text", config: { optional: t.data.optional, placeholder: t.data.placeholder, format: t.data.format, maxChars: t.data.maxChars, minChars: t.data.minChars, multiline: t.data.format === "text" && t.data.multiline === !0 } });
772
- o === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: a("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: o.type === "phone" ? vt(o.value) : t.data.format === "date" && i !== void 0 ? Is(o.value, i) : o.value }), r(t.nextId);
772
+ o === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: o.type === "phone" ? vt(o.value) : t.data.format === "date" && a !== void 0 ? Es(o.value, a) : o.value }), r(t.nextId);
773
773
  }
774
- async function Hn({ chat: e, next: r, node: t, submissions: s, context: n, t: a }) {
774
+ async function Kn({ chat: e, next: r, node: t, submissions: s, context: n, t: i }) {
775
775
  await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: s, context: n }) });
776
- let i = await e.userInput({ key: t.data.key, type: "number", config: { max: t.data.max, min: t.data.min, optional: t.data.optional, placeholder: t.data.placeholder, decimalCases: t.data.decimalCases } });
777
- i === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: a("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: i.value.toString() }), r(t.nextId);
776
+ let a = await e.userInput({ key: t.data.key, type: "number", config: { max: t.data.max, min: t.data.min, optional: t.data.optional, placeholder: t.data.placeholder, decimalCases: t.data.decimalCases } });
777
+ a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.value.toString() }), r(t.nextId);
778
778
  }
779
- async function Kn({ chat: e, next: r, node: t, submissions: s, context: n, t: a }) {
779
+ async function Gn({ chat: e, next: r, node: t, submissions: s, context: n, t: i }) {
780
780
  await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: s, context: n }) });
781
- let i = await e.userInput({ key: t.data.key, type: "phone", config: { minChars: t.data.minChars, defaultValue: { countryCode: t.data.defaultCountryCode }, placeholder: t.data.placeholder, submissionFormat: "phone", optional: t.data.optional } });
782
- i === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: a("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: i.type === "phone" ? vt(i.value) : i.value }), r(t.nextId);
781
+ let a = await e.userInput({ key: t.data.key, type: "phone", config: { minChars: t.data.minChars, defaultValue: { countryCode: t.data.defaultCountryCode }, placeholder: t.data.placeholder, submissionFormat: "phone", optional: t.data.optional } });
782
+ a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.type === "phone" ? vt(a.value) : a.value }), r(t.nextId);
783
783
  }
784
- async function Gn({ chat: e, next: r, node: t, submissions: s, context: n, t: a }) {
784
+ async function Jn({ chat: e, next: r, node: t, submissions: s, context: n, t: i }) {
785
785
  await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: s, context: n }) });
786
- let i = await e.userInput({ key: t.data.key, type: "multiple-choice", config: t.data });
787
- i.value.length === 0 ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: a("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: t.data.options.filter((o) => i.value.includes(o.value)).map((o) => o.label).join(", ") }), r(t.nextId);
786
+ let a = await e.userInput({ key: t.data.key, type: "multiple-choice", config: t.data });
787
+ a.value.length === 0 ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: t.data.options.filter((o) => a.value.includes(o.value)).map((o) => o.label).join(", ") }), r(t.nextId);
788
788
  }
789
- async function Jn({ chat: e, next: r, node: t, submissions: s, context: n, t: a }) {
789
+ async function Zn({ chat: e, next: r, node: t, submissions: s, context: n, t: i }) {
790
790
  await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: s, context: n }) });
791
- let i = await e.userInput({ key: t.data.key, type: "boolean", config: { optional: t.data.optional, labels: { true: t.data.trueLabel, false: t.data.falseLabel } } });
792
- i === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: a("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: i.value === !0 ? t.data.trueLabel : t.data.falseLabel }), r(t.nextId);
791
+ let a = await e.userInput({ key: t.data.key, type: "boolean", config: { optional: t.data.optional, labels: { true: t.data.trueLabel, false: t.data.falseLabel } } });
792
+ a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.value === !0 ? t.data.trueLabel : t.data.falseLabel }), r(t.nextId);
793
793
  }
794
- async function Zn({ chat: e, next: r, node: t, t: s }) {
794
+ async function Xn({ chat: e, next: r, node: t, t: s }) {
795
795
  await e.sendMessage({ author: "bot", type: "text", text: t.data.question });
796
796
  let n = await e.userInput({ type: "address", key: t.data.key, config: { optional: t.data.optional, keys: t.data.keys, line2Required: t.data.line2Required, placeholder: t.data.placeholder } });
797
797
  if (n === null)
798
798
  await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: s("skipped") });
799
799
  else {
800
- let a = Object.values(n.value).filter((i) => i && i.trim().length > 0).join(", ");
801
- await e.sendMessage({ author: "user", type: "text", text: a });
800
+ let i = Object.values(n.value).filter((a) => a && a.trim().length > 0).join(", ");
801
+ await e.sendMessage({ author: "user", type: "text", text: i });
802
802
  }
803
803
  return r(t.nextId);
804
804
  }
805
- async function Xn({ node: e, chat: r, next: t, submissions: s, context: n, t: a }) {
805
+ async function Yn({ node: e, chat: r, next: t, submissions: s, context: n, t: i }) {
806
806
  await r.sendMessage({ author: "bot", type: "text", text: he(e.data.question, { submissions: s, context: n }) });
807
- let i = await r.userInput({ key: e.data.key, type: "file", config: { optional: e.data.optional, extensions: e.data.extensions, fileSizeLimitKib: e.data.maxSizeKb ?? 10 * 1024, allowMultiple: e.data.multiple === !0 } });
808
- if (i === null)
809
- await r.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: a("skipped") });
807
+ let a = await r.userInput({ key: e.data.key, type: "file", config: { optional: e.data.optional, extensions: e.data.extensions, fileSizeLimitKib: e.data.maxSizeKb ?? 10 * 1024, allowMultiple: e.data.multiple === !0 } });
808
+ if (a === null)
809
+ await r.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") });
810
810
  else
811
- for (let o of i.value)
811
+ for (let o of a.value)
812
812
  await r.sendMessage({ author: "user", type: "file", fileName: o.name, fileSizeKb: o.sizeKb });
813
813
  return t(e.nextId);
814
814
  }
815
- async function Yn({ chat: e, end: r, node: t }) {
815
+ async function Qn({ chat: e, end: r, node: t }) {
816
816
  await e.sendMessage({ type: "system", variant: "info", text: t.data.systemMessage }), r();
817
817
  }
818
- async function Qn({ node: e, flow: r, submissions: t, chat: s, next: n, apiClient: a, analytics: i, signal: o, context: c }) {
819
- let d = Fs(r.nodes, t || {}), { answers: g, ...b } = d;
820
- if (s.setSubmission(e.data.key, { type: "integration", value: b }), kn(r, a, { ...i.getSessionInfo(), job: r.job, flow_build: r.build, pre_apply: qr(r.nodes, t || {}, r.data.flowSessionId) }, o), d.status !== "skipped") {
821
- let p = [d.status === "unavailable" ? "We could not prepare your pre-apply summary. You can still continue to your application." : d.hasHardConcerns ? e.data.messages.hard : d.hasAdvisoryConcerns ? e.data.messages.advisory : e.data.messages.matched];
822
- for (let m of ["hard", "advisory"]) {
823
- let _ = g.filter((k) => !k.matched && k.severity === m);
824
- _.length && p.push((m === "hard" ? "Role requirements" : "Other things to consider") + `
825
- ` + _.map((k) => `• ${k.message}`).join(`
818
+ async function ea({ node: e, flow: r, submissions: t, chat: s, next: n, apiClient: i, analytics: a, signal: o, context: c }) {
819
+ let f = Fs(r.nodes, t || {}), { answers: p, ...g } = f;
820
+ if (s.setSubmission(e.data.key, { type: "integration", value: g }), Cn(r, i, { ...a.getSessionInfo(), job: r.job, flow_build: r.build, pre_apply: qr(r.nodes, t || {}, r.data.flowSessionId) }, o), f.status !== "skipped") {
821
+ let m = [f.status === "unavailable" ? "We could not prepare your pre-apply summary. You can still continue to your application." : f.hasHardConcerns ? e.data.messages.hard : f.hasAdvisoryConcerns ? e.data.messages.advisory : e.data.messages.matched];
822
+ for (let b of ["hard", "advisory"]) {
823
+ let k = p.filter((w) => !w.matched && w.severity === b);
824
+ k.length && m.push((b === "hard" ? "Role requirements" : "Other things to consider") + `
825
+ ` + k.map((w) => `• ${w.message}`).join(`
826
826
  `));
827
827
  }
828
- await s.sendMessage({ type: "text", author: "bot", text: p.join(`
828
+ await s.sendMessage({ type: "text", author: "bot", text: m.join(`
829
829
 
830
- `) }), d.hasHardConcerns && e.data.alternativeLink && await s.sendMessage({ type: "link", href: e.data.alternativeLink.href, text: e.data.alternativeLink.label }), await s.userInput({ type: "submit", key: void 0, config: { label: he(e.data.continueLabel, { submissions: t, context: c }) } });
830
+ `) }), f.hasHardConcerns && e.data.alternativeLink && await s.sendMessage({ type: "link", href: e.data.alternativeLink.href, text: e.data.alternativeLink.label }), await s.userInput({ type: "submit", key: void 0, config: { label: he(e.data.continueLabel, { submissions: t, context: c }) } });
831
831
  }
832
832
  return n(e.nextId);
833
833
  }
@@ -845,7 +845,7 @@ const dr = (e, r, t) => {
845
845
  },
846
846
  customProperties: (s = r.analytics) == null ? void 0 : s.customProperties
847
847
  });
848
- }, $t = "resume-prompt", ea = async ({
848
+ }, Bt = "resume-prompt", ta = async ({
849
849
  chatService: e,
850
850
  t: r,
851
851
  signal: t
@@ -856,7 +856,7 @@ const dr = (e, r, t) => {
856
856
  author: "bot",
857
857
  text: r("resume_prompt")
858
858
  },
859
- groupId: $t,
859
+ groupId: Bt,
860
860
  signal: t
861
861
  });
862
862
  const s = await e.input({
@@ -873,7 +873,7 @@ const dr = (e, r, t) => {
873
873
  },
874
874
  signal: t
875
875
  });
876
- return q.removeMessagesSentByNodeIds([$t]), (s == null ? void 0 : s.value) !== !1;
876
+ return q.removeMessagesSentByNodeIds([Bt]), (s == null ? void 0 : s.value) !== !1;
877
877
  }, je = ({
878
878
  class: e,
879
879
  ...r
@@ -916,17 +916,17 @@ function wt(e) {
916
916
  }
917
917
  var Mt;
918
918
  // @__NO_SIDE_EFFECTS__
919
- function ta(e) {
919
+ function ra(e) {
920
920
  return Mt == null ? void 0 : Mt.get(e);
921
921
  }
922
922
  var Lt;
923
923
  // @__NO_SIDE_EFFECTS__
924
- function ra(e) {
924
+ function sa(e) {
925
925
  return Lt == null ? void 0 : Lt.get(e);
926
926
  }
927
927
  var Rt;
928
928
  // @__NO_SIDE_EFFECTS__
929
- function sa(e, r) {
929
+ function na(e, r) {
930
930
  var t;
931
931
  return (t = Rt == null ? void 0 : Rt.get(e)) == null ? void 0 : t.get(r);
932
932
  }
@@ -937,24 +937,24 @@ function Xe(e) {
937
937
  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;
938
938
  }
939
939
  function se(e, r, t, s, n) {
940
- const a = n && "input" in n ? n.input : t.value, i = (n == null ? void 0 : n.expected) ?? e.expects ?? null, o = (n == null ? void 0 : n.received) ?? /* @__PURE__ */ Xe(a), c = {
940
+ const i = n && "input" in n ? n.input : t.value, a = (n == null ? void 0 : n.expected) ?? e.expects ?? null, o = (n == null ? void 0 : n.received) ?? /* @__PURE__ */ Xe(i), c = {
941
941
  kind: e.kind,
942
942
  type: e.type,
943
- input: a,
944
- expected: i,
943
+ input: i,
944
+ expected: a,
945
945
  received: o,
946
- message: `Invalid ${r}: ${i ? `Expected ${i} but r` : "R"}eceived ${o}`,
946
+ message: `Invalid ${r}: ${a ? `Expected ${a} but r` : "R"}eceived ${o}`,
947
947
  requirement: e.requirement,
948
948
  path: n == null ? void 0 : n.path,
949
949
  issues: n == null ? void 0 : n.issues,
950
950
  lang: s.lang,
951
951
  abortEarly: s.abortEarly,
952
952
  abortPipeEarly: s.abortPipeEarly
953
- }, d = e.kind === "schema", g = (n == null ? void 0 : n.message) ?? e.message ?? /* @__PURE__ */ sa(e.reference, c.lang) ?? (d ? /* @__PURE__ */ ra(c.lang) : null) ?? s.message ?? /* @__PURE__ */ ta(c.lang);
954
- g !== void 0 && (c.message = typeof g == "function" ? (
953
+ }, f = e.kind === "schema", p = (n == null ? void 0 : n.message) ?? e.message ?? /* @__PURE__ */ na(e.reference, c.lang) ?? (f ? /* @__PURE__ */ sa(c.lang) : null) ?? s.message ?? /* @__PURE__ */ ra(c.lang);
954
+ p !== void 0 && (c.message = typeof p == "function" ? (
955
955
  // @ts-expect-error
956
- g(c)
957
- ) : g), d && (t.typed = !1), t.issues ? t.issues.push(c) : t.issues = [c];
956
+ p(c)
957
+ ) : p), f && (t.typed = !1), t.issues ? t.issues.push(c) : t.issues = [c];
958
958
  }
959
959
  // @__NO_SIDE_EFFECTS__
960
960
  function ge(e) {
@@ -967,16 +967,16 @@ function ge(e) {
967
967
  };
968
968
  }
969
969
  // @__NO_SIDE_EFFECTS__
970
- function na(e, r) {
970
+ function aa(e, r) {
971
971
  return Object.hasOwn(e, r) && r !== "__proto__" && r !== "prototype" && r !== "constructor";
972
972
  }
973
973
  // @__NO_SIDE_EFFECTS__
974
- function aa(e, r) {
974
+ function ia(e, r) {
975
975
  const t = [...new Set(e)];
976
976
  return t.length > 1 ? `(${t.join(` ${r} `)})` : t[0] ?? "never";
977
977
  }
978
978
  // @__NO_SIDE_EFFECTS__
979
- function ia(e) {
979
+ function oa(e) {
980
980
  if (e.path) {
981
981
  let r = "";
982
982
  for (const t of e.path)
@@ -988,7 +988,7 @@ function ia(e) {
988
988
  }
989
989
  return null;
990
990
  }
991
- var oa = class extends Error {
991
+ var la = class extends Error {
992
992
  /**
993
993
  * Creates a Valibot error with useful information.
994
994
  *
@@ -997,7 +997,7 @@ var oa = class extends Error {
997
997
  constructor(e) {
998
998
  super(e[0].message), this.name = "ValiError", this.issues = e;
999
999
  }
1000
- }, la = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
1000
+ }, ca = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
1001
1001
  // @__NO_SIDE_EFFECTS__
1002
1002
  function Yr(e, r) {
1003
1003
  return {
@@ -1021,7 +1021,7 @@ function Qr(e) {
1021
1021
  reference: Qr,
1022
1022
  expects: null,
1023
1023
  async: !1,
1024
- requirement: la,
1024
+ requirement: ca,
1025
1025
  message: e,
1026
1026
  "~run"(r, t) {
1027
1027
  return r.typed && !this.requirement.test(r.value) && se(this, "email", r, t), r;
@@ -1146,7 +1146,7 @@ function rs(e) {
1146
1146
  };
1147
1147
  }
1148
1148
  // @__NO_SIDE_EFFECTS__
1149
- function ca(e, r, t) {
1149
+ function ua(e, r, t) {
1150
1150
  return typeof e.fallback == "function" ? (
1151
1151
  // @ts-expect-error
1152
1152
  e.fallback(r, t)
@@ -1179,22 +1179,22 @@ function ns(e, r) {
1179
1179
  return /* @__PURE__ */ ge(this);
1180
1180
  },
1181
1181
  "~run"(t, s) {
1182
- var a;
1182
+ var i;
1183
1183
  const n = t.value;
1184
1184
  if (Array.isArray(n)) {
1185
1185
  t.typed = !0, t.value = [];
1186
- for (let i = 0; i < n.length; i++) {
1187
- const o = n[i], c = this.item["~run"]({ value: o }, s);
1186
+ for (let a = 0; a < n.length; a++) {
1187
+ const o = n[a], c = this.item["~run"]({ value: o }, s);
1188
1188
  if (c.issues) {
1189
- const d = {
1189
+ const f = {
1190
1190
  type: "array",
1191
1191
  origin: "value",
1192
1192
  input: n,
1193
- key: i,
1193
+ key: a,
1194
1194
  value: o
1195
1195
  };
1196
- for (const g of c.issues)
1197
- g.path ? g.path.unshift(d) : g.path = [d], (a = t.issues) == null || a.push(g);
1196
+ for (const p of c.issues)
1197
+ p.path ? p.path.unshift(f) : p.path = [f], (i = t.issues) == null || i.push(p);
1198
1198
  if (t.issues || (t.issues = c.issues), s.abortEarly) {
1199
1199
  t.typed = !1;
1200
1200
  break;
@@ -1256,47 +1256,47 @@ function Ce(e, r) {
1256
1256
  return /* @__PURE__ */ ge(this);
1257
1257
  },
1258
1258
  "~run"(t, s) {
1259
- var a;
1259
+ var i;
1260
1260
  const n = t.value;
1261
1261
  if (n && typeof n == "object") {
1262
1262
  t.typed = !0, t.value = {};
1263
- for (const i in this.entries) {
1264
- const o = this.entries[i];
1265
- if (i in n || (o.type === "exact_optional" || o.type === "optional" || o.type === "nullish") && // @ts-expect-error
1263
+ for (const a in this.entries) {
1264
+ const o = this.entries[a];
1265
+ if (a in n || (o.type === "exact_optional" || o.type === "optional" || o.type === "nullish") && // @ts-expect-error
1266
1266
  o.default !== void 0) {
1267
- const c = i in n ? (
1267
+ const c = a in n ? (
1268
1268
  // @ts-expect-error
1269
- n[i]
1270
- ) : /* @__PURE__ */ ss(o), d = o["~run"]({ value: c }, s);
1271
- if (d.issues) {
1272
- const g = {
1269
+ n[a]
1270
+ ) : /* @__PURE__ */ ss(o), f = o["~run"]({ value: c }, s);
1271
+ if (f.issues) {
1272
+ const p = {
1273
1273
  type: "object",
1274
1274
  origin: "value",
1275
1275
  input: n,
1276
- key: i,
1276
+ key: a,
1277
1277
  value: c
1278
1278
  };
1279
- for (const b of d.issues)
1280
- b.path ? b.path.unshift(g) : b.path = [g], (a = t.issues) == null || a.push(b);
1281
- if (t.issues || (t.issues = d.issues), s.abortEarly) {
1279
+ for (const g of f.issues)
1280
+ g.path ? g.path.unshift(p) : g.path = [p], (i = t.issues) == null || i.push(g);
1281
+ if (t.issues || (t.issues = f.issues), s.abortEarly) {
1282
1282
  t.typed = !1;
1283
1283
  break;
1284
1284
  }
1285
1285
  }
1286
- d.typed || (t.typed = !1), t.value[i] = d.value;
1286
+ f.typed || (t.typed = !1), t.value[a] = f.value;
1287
1287
  } else if (o.fallback !== void 0)
1288
- t.value[i] = /* @__PURE__ */ ca(o);
1288
+ t.value[a] = /* @__PURE__ */ ua(o);
1289
1289
  else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (se(this, "key", t, s, {
1290
1290
  input: void 0,
1291
- expected: `"${i}"`,
1291
+ expected: `"${a}"`,
1292
1292
  path: [
1293
1293
  {
1294
1294
  type: "object",
1295
1295
  origin: "key",
1296
1296
  input: n,
1297
- key: i,
1297
+ key: a,
1298
1298
  // @ts-expect-error
1299
- value: n[i]
1299
+ value: n[a]
1300
1300
  }
1301
1301
  ]
1302
1302
  }), s.abortEarly))
@@ -1332,7 +1332,7 @@ function os(e, r) {
1332
1332
  kind: "schema",
1333
1333
  type: "picklist",
1334
1334
  reference: os,
1335
- expects: /* @__PURE__ */ aa(e.map(Xe), "|"),
1335
+ expects: /* @__PURE__ */ ia(e.map(Xe), "|"),
1336
1336
  async: !1,
1337
1337
  options: e,
1338
1338
  message: r,
@@ -1359,48 +1359,48 @@ function ls(e, r, t) {
1359
1359
  return /* @__PURE__ */ ge(this);
1360
1360
  },
1361
1361
  "~run"(s, n) {
1362
- var i, o;
1363
- const a = s.value;
1364
- if (a && typeof a == "object") {
1362
+ var a, o;
1363
+ const i = s.value;
1364
+ if (i && typeof i == "object") {
1365
1365
  s.typed = !0, s.value = {};
1366
- for (const c in a)
1367
- if (/* @__PURE__ */ na(a, c)) {
1368
- const d = a[c], g = this.key["~run"]({ value: c }, n);
1369
- if (g.issues) {
1370
- const p = {
1366
+ for (const c in i)
1367
+ if (/* @__PURE__ */ aa(i, c)) {
1368
+ const f = i[c], p = this.key["~run"]({ value: c }, n);
1369
+ if (p.issues) {
1370
+ const m = {
1371
1371
  type: "object",
1372
1372
  origin: "key",
1373
- input: a,
1373
+ input: i,
1374
1374
  key: c,
1375
- value: d
1375
+ value: f
1376
1376
  };
1377
- for (const m of g.issues)
1378
- m.path = [p], (i = s.issues) == null || i.push(m);
1379
- if (s.issues || (s.issues = g.issues), n.abortEarly) {
1377
+ for (const b of p.issues)
1378
+ b.path = [m], (a = s.issues) == null || a.push(b);
1379
+ if (s.issues || (s.issues = p.issues), n.abortEarly) {
1380
1380
  s.typed = !1;
1381
1381
  break;
1382
1382
  }
1383
1383
  }
1384
- const b = this.value["~run"](
1385
- { value: d },
1384
+ const g = this.value["~run"](
1385
+ { value: f },
1386
1386
  n
1387
1387
  );
1388
- if (b.issues) {
1389
- const p = {
1388
+ if (g.issues) {
1389
+ const m = {
1390
1390
  type: "object",
1391
1391
  origin: "value",
1392
- input: a,
1392
+ input: i,
1393
1393
  key: c,
1394
- value: d
1394
+ value: f
1395
1395
  };
1396
- for (const m of b.issues)
1397
- m.path ? m.path.unshift(p) : m.path = [p], (o = s.issues) == null || o.push(m);
1398
- if (s.issues || (s.issues = b.issues), n.abortEarly) {
1396
+ for (const b of g.issues)
1397
+ b.path ? b.path.unshift(m) : b.path = [m], (o = s.issues) == null || o.push(b);
1398
+ if (s.issues || (s.issues = g.issues), n.abortEarly) {
1399
1399
  s.typed = !1;
1400
1400
  break;
1401
1401
  }
1402
1402
  }
1403
- (!g.typed || !b.typed) && (s.typed = !1), g.typed && (s.value[g.value] = b.value);
1403
+ (!p.typed || !g.typed) && (s.typed = !1), p.typed && (s.value[p.value] = g.value);
1404
1404
  }
1405
1405
  } else
1406
1406
  se(this, "type", s, n);
@@ -1425,14 +1425,14 @@ function le(e) {
1425
1425
  }
1426
1426
  };
1427
1427
  }
1428
- function ua(e, r, t) {
1428
+ function da(e, r, t) {
1429
1429
  const s = e["~run"]({ value: r }, /* @__PURE__ */ wt(t));
1430
1430
  if (s.issues)
1431
- throw new oa(s.issues);
1431
+ throw new la(s.issues);
1432
1432
  return s.value;
1433
1433
  }
1434
1434
  // @__NO_SIDE_EFFECTS__
1435
- function da(e, r) {
1435
+ function fa(e, r) {
1436
1436
  const t = {};
1437
1437
  for (const s in e.entries)
1438
1438
  t[s] = !r || r.includes(s) ? /* @__PURE__ */ Je(e.entries[s]) : e.entries[s];
@@ -1466,7 +1466,7 @@ function Me(...e) {
1466
1466
  };
1467
1467
  }
1468
1468
  // @__NO_SIDE_EFFECTS__
1469
- function fa(e, r, t) {
1469
+ function ha(e, r, t) {
1470
1470
  const s = e["~run"]({ value: r }, /* @__PURE__ */ wt(t));
1471
1471
  return {
1472
1472
  typed: s.typed,
@@ -1476,7 +1476,7 @@ function fa(e, r, t) {
1476
1476
  };
1477
1477
  }
1478
1478
  // @__NO_SIDE_EFFECTS__
1479
- async function ha(e, r, t) {
1479
+ async function pa(e, r, t) {
1480
1480
  const s = await e["~run"](
1481
1481
  { value: r },
1482
1482
  /* @__PURE__ */ wt(t)
@@ -1552,7 +1552,7 @@ const tt = ({
1552
1552
  }), t("skip")]
1553
1553
  });
1554
1554
  };
1555
- var Gt = { Afghanistan: "93", Albania: "355", Algeria: "213", "American Samoa": "1 684", Andorra: "376", Angola: "244", Anguilla: "1 264", Antarctica: "672", "Antigua and Barbuda": "1 268", Argentina: "54", Armenia: "374", Aruba: "297", Australia: "61", Austria: "43", Azerbaijan: "994", Bahrain: "973", Bangladesh: "880", Barbados: "1 246", Belarus: "375", Belgium: "32", Belize: "501", Benin: "229", Bermuda: "1 441", Bhutan: "975", Bolivia: "591", "Bosnia and Herzegovina": "387", Botswana: "267", "Bouvet Island": "47", Brazil: "55", "British Indian Ocean Territory": "246", "British Virgin Islands": "1 284", Brunei: "673", Bulgaria: "359", "Burkina Faso": "226", Burundi: "257", "Cabo Verde": "238", Cambodia: "855", Cameroon: "237", Canada: "1", "Caribbean Netherlands": "599", "Cayman Islands": "1 345", "Central African Republic": "236", Chad: "235", Chile: "56", China: "86", "Christmas Island": "61", "Cocos (Keeling) Islands": "61", Colombia: "57", Comoros: "269", "Cook Islands": "682", "Costa Rica": "506", Croatia: "385", Cuba: "53", Curaçao: "599", Cyprus: "357", Czechia: "420", "Côte d'Ivoire": "225", "Democratic Republic of the Congo": "243", Denmark: "45", Djibouti: "253", "Dominican Republic": "1 809", Ecuador: "593", Egypt: "20", "El Salvador": "503", "Equatorial Guinea": "240", Eritrea: "291", Estonia: "372", Eswatini: "268", Ethiopia: "251", "Falkland Islands (Islas Malvinas)": "500", "Faroe Islands": "298", Fiji: "679", Finland: "358", France: "33", "French Guiana": "594", "French Polynesia": "689", "French Southern and Antarctic Lands": "262", Gabon: "241", Georgia: "995", Germany: "49", Ghana: "233", Gibraltar: "350", Greece: "30", Greenland: "299", Grenada: "1 473", Guadeloupe: "590", Guam: "1 671", Guatemala: "502", Guernsey: "44", Guinea: "224", "Guinea-Bissau": "245", Guyana: "592", Haiti: "509", Honduras: "504", "Hong Kong": "852", Hungary: "36", Iceland: "354", India: "91", Indonesia: "62", Iran: "98", Iraq: "964", Ireland: "353", "Isle of Man": "44", Israel: "972", Italy: "39", Jamaica: "1 876", Japan: "81", Jersey: "44", Jordan: "962", Kazakhstan: "7", Kenya: "254", Kiribati: "686", Kosovo: "383", Kuwait: "965", Kyrgyzstan: "996", Laos: "856", Latvia: "371", Lebanon: "961", Lesotho: "266", Liberia: "231", Libya: "218", Liechtenstein: "423", Lithuania: "370", Luxembourg: "352", Macao: "853", Madagascar: "261", Malawi: "265", Malaysia: "60", Maldives: "960", Mali: "223", Malta: "356", "Marshall Islands": "692", Martinique: "596", Mauritania: "222", Mauritius: "230", Mayotte: "262", Mexico: "52", Micronesia: "691", Moldova: "373", Monaco: "377", Mongolia: "976", Montenegro: "382", Montserrat: "1 664", Morocco: "212", Mozambique: "258", "Myanmar (Burma)": "95", Namibia: "264", Nauru: "674", Nepal: "977", Netherlands: "31", "New Caledonia": "687", "New Zealand": "64", Nicaragua: "505", Niger: "227", Nigeria: "234", Niue: "683", "Norfolk Island": "672", "North Korea": "850", "North Macedonia": "389", "Northern Mariana Islands": "1 670", Norway: "47", Oman: "968", Pakistan: "92", Palau: "680", Palestine: "970", Panama: "507", "Papua New Guinea": "675", Paraguay: "595", Peru: "51", Philippines: "63", "Pitcairn Islands": "64", Poland: "48", Portugal: "351", "Puerto Rico": "1 787", Qatar: "974", Romania: "40", Russia: "7", Rwanda: "250", Réunion: "262", "Saint Barthélemy": "590", "Saint Helena, Ascension and Tristan da Cunha": "290", "Saint Kitts and Nevis": "1 869", "Saint Lucia": "1 758", "Saint Martin": "590", "Saint Pierre and Miquelon": "508", "Saint Vincent and the Grenadines": "1 784", Samoa: "685", "San Marino": "378", "Saudi Arabia": "966", Senegal: "221", Serbia: "381", Seychelles: "248", "Sierra Leone": "232", Singapore: "65", "Sint Maarten": "1 721", Slovakia: "421", Slovenia: "386", "Solomon Islands": "677", Somalia: "252", "South Africa": "27", "South Georgia and the South Sandwich Islands": "500", "South Korea": "82", "South Sudan": "211", Spain: "34", "Sri Lanka": "94", Sudan: "249", Suriname: "597", "Svalbard and Jan Mayen": "47", Sweden: "46", Switzerland: "41", Syria: "963", "São Tomé and Príncipe": "239", Taiwan: "886", Tajikistan: "992", Tanzania: "255", Thailand: "66", "The Bahamas": "1 242", "The Gambia": "220", "Timor-Leste": "670", Togo: "228", Tokelau: "690", Tonga: "676", "Trinidad and Tobago": "1 868", Tunisia: "216", Turkmenistan: "993", "Turks and Caicos Islands": "1 649", Tuvalu: "688", Türkiye: "90", "U.S. Virgin Islands": "1 340", Uganda: "256", Ukraine: "380", "United Arab Emirates": "971", "United Kingdom": "44", "United States": "1", "United States Minor Outlying Islands": "1", Uruguay: "598", Uzbekistan: "998", Vanuatu: "678", "Vatican City": "379", Venezuela: "58", Vietnam: "84", "Wallis and Futuna": "681", "Western Sahara": "212", Yemen: "967", Zambia: "260", Zimbabwe: "263", "Åland Islands": "358" }, pa = (e) => {
1555
+ var Gt = { Afghanistan: "93", Albania: "355", Algeria: "213", "American Samoa": "1 684", Andorra: "376", Angola: "244", Anguilla: "1 264", Antarctica: "672", "Antigua and Barbuda": "1 268", Argentina: "54", Armenia: "374", Aruba: "297", Australia: "61", Austria: "43", Azerbaijan: "994", Bahrain: "973", Bangladesh: "880", Barbados: "1 246", Belarus: "375", Belgium: "32", Belize: "501", Benin: "229", Bermuda: "1 441", Bhutan: "975", Bolivia: "591", "Bosnia and Herzegovina": "387", Botswana: "267", "Bouvet Island": "47", Brazil: "55", "British Indian Ocean Territory": "246", "British Virgin Islands": "1 284", Brunei: "673", Bulgaria: "359", "Burkina Faso": "226", Burundi: "257", "Cabo Verde": "238", Cambodia: "855", Cameroon: "237", Canada: "1", "Caribbean Netherlands": "599", "Cayman Islands": "1 345", "Central African Republic": "236", Chad: "235", Chile: "56", China: "86", "Christmas Island": "61", "Cocos (Keeling) Islands": "61", Colombia: "57", Comoros: "269", "Cook Islands": "682", "Costa Rica": "506", Croatia: "385", Cuba: "53", Curaçao: "599", Cyprus: "357", Czechia: "420", "Côte d'Ivoire": "225", "Democratic Republic of the Congo": "243", Denmark: "45", Djibouti: "253", "Dominican Republic": "1 809", Ecuador: "593", Egypt: "20", "El Salvador": "503", "Equatorial Guinea": "240", Eritrea: "291", Estonia: "372", Eswatini: "268", Ethiopia: "251", "Falkland Islands (Islas Malvinas)": "500", "Faroe Islands": "298", Fiji: "679", Finland: "358", France: "33", "French Guiana": "594", "French Polynesia": "689", "French Southern and Antarctic Lands": "262", Gabon: "241", Georgia: "995", Germany: "49", Ghana: "233", Gibraltar: "350", Greece: "30", Greenland: "299", Grenada: "1 473", Guadeloupe: "590", Guam: "1 671", Guatemala: "502", Guernsey: "44", Guinea: "224", "Guinea-Bissau": "245", Guyana: "592", Haiti: "509", Honduras: "504", "Hong Kong": "852", Hungary: "36", Iceland: "354", India: "91", Indonesia: "62", Iran: "98", Iraq: "964", Ireland: "353", "Isle of Man": "44", Israel: "972", Italy: "39", Jamaica: "1 876", Japan: "81", Jersey: "44", Jordan: "962", Kazakhstan: "7", Kenya: "254", Kiribati: "686", Kosovo: "383", Kuwait: "965", Kyrgyzstan: "996", Laos: "856", Latvia: "371", Lebanon: "961", Lesotho: "266", Liberia: "231", Libya: "218", Liechtenstein: "423", Lithuania: "370", Luxembourg: "352", Macao: "853", Madagascar: "261", Malawi: "265", Malaysia: "60", Maldives: "960", Mali: "223", Malta: "356", "Marshall Islands": "692", Martinique: "596", Mauritania: "222", Mauritius: "230", Mayotte: "262", Mexico: "52", Micronesia: "691", Moldova: "373", Monaco: "377", Mongolia: "976", Montenegro: "382", Montserrat: "1 664", Morocco: "212", Mozambique: "258", "Myanmar (Burma)": "95", Namibia: "264", Nauru: "674", Nepal: "977", Netherlands: "31", "New Caledonia": "687", "New Zealand": "64", Nicaragua: "505", Niger: "227", Nigeria: "234", Niue: "683", "Norfolk Island": "672", "North Korea": "850", "North Macedonia": "389", "Northern Mariana Islands": "1 670", Norway: "47", Oman: "968", Pakistan: "92", Palau: "680", Palestine: "970", Panama: "507", "Papua New Guinea": "675", Paraguay: "595", Peru: "51", Philippines: "63", "Pitcairn Islands": "64", Poland: "48", Portugal: "351", "Puerto Rico": "1 787", Qatar: "974", Romania: "40", Russia: "7", Rwanda: "250", Réunion: "262", "Saint Barthélemy": "590", "Saint Helena, Ascension and Tristan da Cunha": "290", "Saint Kitts and Nevis": "1 869", "Saint Lucia": "1 758", "Saint Martin": "590", "Saint Pierre and Miquelon": "508", "Saint Vincent and the Grenadines": "1 784", Samoa: "685", "San Marino": "378", "Saudi Arabia": "966", Senegal: "221", Serbia: "381", Seychelles: "248", "Sierra Leone": "232", Singapore: "65", "Sint Maarten": "1 721", Slovakia: "421", Slovenia: "386", "Solomon Islands": "677", Somalia: "252", "South Africa": "27", "South Georgia and the South Sandwich Islands": "500", "South Korea": "82", "South Sudan": "211", Spain: "34", "Sri Lanka": "94", Sudan: "249", Suriname: "597", "Svalbard and Jan Mayen": "47", Sweden: "46", Switzerland: "41", Syria: "963", "São Tomé and Príncipe": "239", Taiwan: "886", Tajikistan: "992", Tanzania: "255", Thailand: "66", "The Bahamas": "1 242", "The Gambia": "220", "Timor-Leste": "670", Togo: "228", Tokelau: "690", Tonga: "676", "Trinidad and Tobago": "1 868", Tunisia: "216", Turkmenistan: "993", "Turks and Caicos Islands": "1 649", Tuvalu: "688", Türkiye: "90", "U.S. Virgin Islands": "1 340", Uganda: "256", Ukraine: "380", "United Arab Emirates": "971", "United Kingdom": "44", "United States": "1", "United States Minor Outlying Islands": "1", Uruguay: "598", Uzbekistan: "998", Vanuatu: "678", "Vatican City": "379", Venezuela: "58", Vietnam: "84", "Wallis and Futuna": "681", "Western Sahara": "212", Yemen: "967", Zambia: "260", Zimbabwe: "263", "Åland Islands": "358" }, ma = (e) => {
1556
1556
  if (e === "")
1557
1557
  return { countryCode: "", phoneNumber: "" };
1558
1558
  let r = Object.values(Gt).find((s) => e.startsWith(s)) ?? "", t = e.replace(r, "");
@@ -1568,16 +1568,16 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1568
1568
  defaultVariants: {
1569
1569
  optional: !1
1570
1570
  }
1571
- }), ma = "https://api.mapbox.com/search/searchbox/v1/suggest", ya = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", ba = (e) => atob(e).split("").reverse().join(""), we = /* @__PURE__ */ Ce({
1571
+ }), ya = "https://api.mapbox.com/search/searchbox/v1/suggest", ba = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", ga = (e) => atob(e).split("").reverse().join(""), we = /* @__PURE__ */ Ce({
1572
1572
  name: /* @__PURE__ */ le()
1573
- }), ga = /* @__PURE__ */ Ce({
1573
+ }), va = /* @__PURE__ */ Ce({
1574
1574
  suggestions: /* @__PURE__ */ ns(/* @__PURE__ */ Ce({
1575
1575
  feature_type: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
1576
1576
  full_address: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
1577
1577
  place_formatted: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
1578
1578
  name: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
1579
1579
  mapbox_id: /* @__PURE__ */ le(),
1580
- context: /* @__PURE__ */ da(/* @__PURE__ */ Ce({
1580
+ context: /* @__PURE__ */ fa(/* @__PURE__ */ Ce({
1581
1581
  address: we,
1582
1582
  street: we,
1583
1583
  neighborhood: we,
@@ -1589,51 +1589,51 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1589
1589
  country: we
1590
1590
  }))
1591
1591
  }))
1592
- }), va = ({
1592
+ }), xa = ({
1593
1593
  logger: e,
1594
1594
  t: r
1595
- }) => Us(() => {
1595
+ }) => Ws(() => {
1596
1596
  var s;
1597
1597
  const t = (s = q.current$.peek().flow) == null ? void 0 : s.data.flowSessionId;
1598
1598
  return t ? {
1599
1599
  enabled: !0,
1600
1600
  getPredictions: async (n) => {
1601
- var b;
1602
- const a = new URL(ma);
1603
- a.searchParams.set("q", n), a.searchParams.set("session_token", t);
1604
- const i = (b = q.current$.peek().flow) == null ? void 0 : b.locationOrigin;
1605
- i && i.lat !== void 0 && i.lng !== void 0 && i.lat >= -90 && i.lat <= 90 && i.lng >= -180 && i.lng <= 180 && a.searchParams.set("proximity", `${i.lng},${i.lat}`), a.searchParams.set("access_token", ba(ya));
1606
- const c = await fetch(a);
1601
+ var g;
1602
+ const i = new URL(ya);
1603
+ i.searchParams.set("q", n), i.searchParams.set("session_token", t);
1604
+ const a = (g = q.current$.peek().flow) == null ? void 0 : g.locationOrigin;
1605
+ a && a.lat !== void 0 && a.lng !== void 0 && a.lat >= -90 && a.lat <= 90 && a.lng >= -180 && a.lng <= 180 && i.searchParams.set("proximity", `${a.lng},${a.lat}`), i.searchParams.set("access_token", ga(ba));
1606
+ const c = await fetch(i);
1607
1607
  if (!c.ok)
1608
1608
  return e.error("Failed to get address details", c), {
1609
1609
  ok: !1,
1610
1610
  error: r("address_error")
1611
1611
  };
1612
- const d = /* @__PURE__ */ fa(ga, await c.json());
1613
- if (d.success === !1)
1614
- return e.error("Failed to parse address details", d.issues), {
1612
+ const f = /* @__PURE__ */ ha(va, await c.json());
1613
+ if (f.success === !1)
1614
+ return e.error("Failed to parse address details", f.issues), {
1615
1615
  ok: !1,
1616
1616
  error: r("address_error")
1617
1617
  };
1618
1618
  const {
1619
- suggestions: g
1620
- } = d.output;
1619
+ suggestions: p
1620
+ } = f.output;
1621
1621
  return {
1622
1622
  ok: !0,
1623
- data: g.map((p) => {
1624
- var m, _, k, C, A, v, R, V, M;
1623
+ data: p.map((m) => {
1624
+ var b, k, w, C, A, v, R, V, M;
1625
1625
  return {
1626
1626
  // A postcode result has no full address and is named by the postcode itself (PROD-7311).
1627
- label: p.full_address ?? ([p.name, p.place_formatted].filter(Boolean).join(", ") || p.mapbox_id),
1628
- id: p.mapbox_id,
1627
+ label: m.full_address ?? ([m.name, m.place_formatted].filter(Boolean).join(", ") || m.mapbox_id),
1628
+ id: m.mapbox_id,
1629
1629
  address: {
1630
- line1: ((m = p.context.address) == null ? void 0 : m.name) ?? ((_ = p.context.street) == null ? void 0 : _.name),
1630
+ line1: ((b = m.context.address) == null ? void 0 : b.name) ?? ((k = m.context.street) == null ? void 0 : k.name),
1631
1631
  line2: void 0,
1632
- line3: ((k = p.context.neighborhood) == null ? void 0 : k.name) ?? ((C = p.context.locality) == null ? void 0 : C.name),
1633
- city: ((A = p.context.place) == null ? void 0 : A.name) ?? ((v = p.context.district) == null ? void 0 : v.name),
1634
- state: (R = p.context.region) == null ? void 0 : R.name,
1635
- postcode: ((V = p.context.postcode) == null ? void 0 : V.name) ?? (p.feature_type === "postcode" ? p.name : void 0),
1636
- country: (M = p.context.country) == null ? void 0 : M.name
1632
+ line3: ((w = m.context.neighborhood) == null ? void 0 : w.name) ?? ((C = m.context.locality) == null ? void 0 : C.name),
1633
+ city: ((A = m.context.place) == null ? void 0 : A.name) ?? ((v = m.context.district) == null ? void 0 : v.name),
1634
+ state: (R = m.context.region) == null ? void 0 : R.name,
1635
+ postcode: ((V = m.context.postcode) == null ? void 0 : V.name) ?? (m.feature_type === "postcode" ? m.name : void 0),
1636
+ country: (M = m.context.country) == null ? void 0 : M.name
1637
1637
  }
1638
1638
  };
1639
1639
  })
@@ -1665,35 +1665,35 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1665
1665
  children: r("back")
1666
1666
  })]
1667
1667
  });
1668
- }, xa = ({
1668
+ }, wa = ({
1669
1669
  input: e,
1670
1670
  onSubmitSuccess: r,
1671
1671
  logger: t
1672
1672
  }) => {
1673
1673
  const {
1674
1674
  t: s
1675
- } = re(), [n, a] = ke(), {
1676
- enabled: i,
1675
+ } = re(), [n, i] = ke(), {
1676
+ enabled: a,
1677
1677
  getPredictions: o
1678
- } = va({
1678
+ } = xa({
1679
1679
  logger: t,
1680
1680
  t: s
1681
- }), [c, d] = ke(i ? "query" : "manual"), [g, b] = ke(""), [p, m] = ke(), _ = ye(), k = ye(), C = (v) => {
1681
+ }), [c, f] = ke(a ? "query" : "manual"), [p, g] = ke(""), [m, b] = ke(), k = ye(), w = ye(), C = (v) => {
1682
1682
  var V;
1683
- if (Oe(i, "Query state should not be enabled"), v = v.trim(), v === ((V = _.current) == null ? void 0 : V.query) || v === (p == null ? void 0 : p.query) && p.status === "done")
1683
+ if (Oe(a, "Query state should not be enabled"), v = v.trim(), v === ((V = k.current) == null ? void 0 : V.query) || v === (m == null ? void 0 : m.query) && m.status === "done")
1684
1684
  return;
1685
- if (b(v), v === "") {
1686
- _.current = void 0, m(void 0);
1685
+ if (g(v), v === "") {
1686
+ k.current = void 0, b(void 0);
1687
1687
  return;
1688
1688
  }
1689
- const R = _.current = {
1689
+ const R = k.current = {
1690
1690
  query: v
1691
1691
  };
1692
- m({
1692
+ b({
1693
1693
  query: v,
1694
1694
  status: "pending"
1695
1695
  }), o(v).then((M) => {
1696
- _.current === R && (_.current = void 0, m(M.ok ? {
1696
+ k.current === R && (k.current = void 0, b(M.ok ? {
1697
1697
  query: v,
1698
1698
  status: "done",
1699
1699
  items: M.data
@@ -1703,34 +1703,34 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1703
1703
  error: M.error
1704
1704
  }));
1705
1705
  }, (M) => {
1706
- _.current === R && (_.current = void 0, t.error("Failed to get address details", M), m({
1706
+ k.current === R && (k.current = void 0, t.error("Failed to get address details", M), b({
1707
1707
  query: v,
1708
1708
  status: "failed",
1709
1709
  error: s("address_error")
1710
1710
  }));
1711
1711
  });
1712
1712
  }, A = (v, R) => {
1713
- a((V) => ({
1713
+ i((V) => ({
1714
1714
  ...V,
1715
1715
  [v]: R
1716
1716
  }));
1717
1717
  };
1718
1718
  switch (c) {
1719
1719
  case "query":
1720
- return Oe(i, "Query state should not be enabled"), l(wa, {
1720
+ return Oe(a, "Query state should not be enabled"), l(_a, {
1721
1721
  input: e,
1722
1722
  onSkip: () => r(null),
1723
1723
  onAddressSelect: (v) => {
1724
1724
  if (v === "") {
1725
- _.current && (_.current = void 0, m(void 0)), d("manual");
1725
+ k.current && (k.current = void 0, b(void 0)), f("manual");
1726
1726
  return;
1727
1727
  }
1728
- const R = (p == null ? void 0 : p.status) === "done" ? p.items.find((V) => V.id === v) : void 0;
1729
- R && (k.current !== v && a(R.address), k.current = v, d("details"));
1728
+ const R = (m == null ? void 0 : m.status) === "done" ? m.items.find((V) => V.id === v) : void 0;
1729
+ R && (w.current !== v && i(R.address), w.current = v, f("details"));
1730
1730
  },
1731
1731
  onAddressSearch: C,
1732
- lookup: p,
1733
- query: g
1732
+ lookup: m,
1733
+ query: p
1734
1734
  });
1735
1735
  case "details":
1736
1736
  return Oe(n !== void 0), l(hr, {
@@ -1741,7 +1741,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1741
1741
  onFieldChange: A,
1742
1742
  actions: l(fr, {
1743
1743
  onClick: () => {
1744
- d("query");
1744
+ f("query");
1745
1745
  }
1746
1746
  })
1747
1747
  });
@@ -1752,9 +1752,9 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1752
1752
  onSubmitSuccess: r,
1753
1753
  addressFields: n ?? {},
1754
1754
  onFieldChange: A,
1755
- actions: i ? l(fr, {
1755
+ actions: a ? l(fr, {
1756
1756
  onClick: () => {
1757
- d("query");
1757
+ f("query");
1758
1758
  }
1759
1759
  }) : e.config.optional ? (
1760
1760
  // Without address search this is the only screen, so an optional question needs its own way past.
@@ -1764,16 +1764,16 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1764
1764
  ) : void 0
1765
1765
  });
1766
1766
  }
1767
- }, wa = ({
1767
+ }, _a = ({
1768
1768
  input: e,
1769
1769
  onSkip: r,
1770
1770
  lookup: t,
1771
1771
  onAddressSelect: s,
1772
1772
  query: n,
1773
- onAddressSearch: a
1773
+ onAddressSearch: i
1774
1774
  }) => {
1775
1775
  const {
1776
- t: i
1776
+ t: a
1777
1777
  } = re(), o = ye(null);
1778
1778
  return Le(() => {
1779
1779
  o.current && (o.current.focus(), o.current.select());
@@ -1782,8 +1782,8 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1782
1782
  noValidate: !0,
1783
1783
  onSubmit: (c) => {
1784
1784
  c.preventDefault();
1785
- const g = new FormData(c.currentTarget).get("address");
1786
- typeof g == "string" && a(g);
1785
+ const p = new FormData(c.currentTarget).get("address");
1786
+ typeof p == "string" && i(p);
1787
1787
  },
1788
1788
  class: "flex gap-2 p-2.5",
1789
1789
  children: [l("div", {
@@ -1794,7 +1794,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1794
1794
  id: "chat-address",
1795
1795
  autocomplete: "address-line1",
1796
1796
  autoFocus: !0,
1797
- placeholder: e.config.placeholder || i("address_search"),
1797
+ placeholder: e.config.placeholder || a("address_search"),
1798
1798
  defaultValue: n,
1799
1799
  class: Ye({
1800
1800
  optional: !!e.config.optional,
@@ -1826,7 +1826,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1826
1826
  })
1827
1827
  }), l("span", {
1828
1828
  class: "sr-only",
1829
- children: i("search")
1829
+ children: a("search")
1830
1830
  })]
1831
1831
  })]
1832
1832
  }), e.config.optional && l(Se, {
@@ -1844,8 +1844,8 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1844
1844
  children: [l(Ut, {
1845
1845
  "aria-hidden": "true",
1846
1846
  class: "h-4 w-4 shrink-0"
1847
- }), i("address_searching")]
1848
- }) : (t == null ? void 0 : t.status) === "done" && t.items.length === 0 ? i("address_no_results") : null
1847
+ }), a("address_searching")]
1848
+ }) : (t == null ? void 0 : t.status) === "done" && t.items.length === 0 ? a("address_no_results") : null
1849
1849
  }), l("ul", {
1850
1850
  children: [((t == null ? void 0 : t.status) === "done" ? t.items : []).map((c) => l("li", {
1851
1851
  children: l("button", {
@@ -1878,7 +1878,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1878
1878
  },
1879
1879
  children: l("span", {
1880
1880
  class: "flex-grow",
1881
- children: i("address_manual")
1881
+ children: a("address_manual")
1882
1882
  })
1883
1883
  })
1884
1884
  }, "")]
@@ -1891,44 +1891,44 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1891
1891
  actions: s,
1892
1892
  input: n
1893
1893
  }) => {
1894
- const a = ye(null);
1894
+ const i = ye(null);
1895
1895
  Le(() => {
1896
- if (a.current) {
1897
- const c = a.current.querySelector("input");
1896
+ if (i.current) {
1897
+ const c = i.current.querySelector("input");
1898
1898
  c && (c.focus(), c.select());
1899
1899
  }
1900
1900
  }, []);
1901
- const i = Object.keys(Gt), {
1901
+ const a = Object.keys(Gt), {
1902
1902
  t: o
1903
1903
  } = re();
1904
1904
  return l("form", {
1905
1905
  class: "flex flex-col px-2 pt-2",
1906
1906
  onSubmit: (c) => {
1907
1907
  c.preventDefault();
1908
- const d = c.currentTarget, g = [...d.querySelectorAll("input")].filter((m) => m.value !== "" && !m.value.trim());
1909
- for (const m of g) {
1910
- m.value = "";
1911
- const _ = Nt.find((k) => n.config.keys[k] === m.name);
1912
- _ && r(_, "");
1908
+ const f = c.currentTarget, p = [...f.querySelectorAll("input")].filter((b) => b.value !== "" && !b.value.trim());
1909
+ for (const b of p) {
1910
+ b.value = "";
1911
+ const k = Nt.find((w) => n.config.keys[w] === b.name);
1912
+ k && r(k, "");
1913
1913
  }
1914
- if (g.length > 0 && !d.checkValidity()) {
1915
- d.reportValidity();
1914
+ if (p.length > 0 && !f.checkValidity()) {
1915
+ f.reportValidity();
1916
1916
  return;
1917
1917
  }
1918
- const b = new FormData(d), p = Object.fromEntries(b.entries());
1918
+ const g = new FormData(f), m = Object.fromEntries(g.entries());
1919
1919
  t({
1920
1920
  type: "address",
1921
- value: p
1921
+ value: m
1922
1922
  });
1923
1923
  },
1924
1924
  children: [l("div", {
1925
1925
  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]",
1926
- ref: a,
1927
- children: Nt.map((c, d) => {
1928
- const g = `isdk_${c}`, b = n.config.keys[c];
1929
- return b ? l(be, {
1926
+ ref: i,
1927
+ children: Nt.map((c, f) => {
1928
+ const p = `isdk_${c}`, g = n.config.keys[c];
1929
+ return g ? l(be, {
1930
1930
  children: [l("label", {
1931
- for: g,
1931
+ for: p,
1932
1932
  class: "text-neutral-11 [&:has(+*>input:focus)]:text-neutral-12 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",
1933
1933
  children: o(c)
1934
1934
  }), l("div", {
@@ -1937,21 +1937,21 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1937
1937
  class: "relative",
1938
1938
  children: [l("select", {
1939
1939
  class: "text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 w-full flex-1 appearance-none rounded-lg border-solid bg-transparent bg-none px-3 py-1.5 text-base transition-colors focus:outline-none",
1940
- name: b,
1941
- id: g,
1940
+ name: g,
1941
+ id: p,
1942
1942
  defaultValue: e[c],
1943
- onChange: (p) => r(c, p.currentTarget.value),
1943
+ onChange: (m) => r(c, m.currentTarget.value),
1944
1944
  required: !0,
1945
- children: [e.country && !i.includes(e.country) ? l("option", {
1945
+ children: [e.country && !a.includes(e.country) ? l("option", {
1946
1946
  value: e[c],
1947
1947
  children: e[c]
1948
1948
  }) : l("option", {
1949
1949
  value: "",
1950
1950
  children: o("select_country")
1951
- }), i.map((p) => l("option", {
1952
- value: p,
1953
- children: p
1954
- }, p))]
1951
+ }), a.map((m) => l("option", {
1952
+ value: m,
1953
+ children: m
1954
+ }, m))]
1955
1955
  }), l("svg", {
1956
1956
  class: "text-neutral-12 absolute bottom-2.5 right-2 flex items-center justify-center",
1957
1957
  width: "16",
@@ -1968,14 +1968,14 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1968
1968
  })
1969
1969
  })]
1970
1970
  }) : l("input", {
1971
- autoFocus: d === 0 ? !0 : void 0,
1971
+ autoFocus: f === 0 ? !0 : void 0,
1972
1972
  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",
1973
- name: b,
1974
- id: g,
1973
+ name: g,
1974
+ id: p,
1975
1975
  defaultValue: e[c],
1976
- onInput: (p) => r(c, p.currentTarget.value),
1976
+ onInput: (m) => r(c, m.currentTarget.value),
1977
1977
  required: c === "line2" ? n.config.line2Required === !0 : c !== "line3"
1978
- }), d === Nt.length - 1 ? l("hr", {
1978
+ }), f === Nt.length - 1 ? l("hr", {
1979
1979
  class: "m-0 w-full border-b border-b-transparent"
1980
1980
  }) : l("hr", {
1981
1981
  class: "border-b-neutral-5 m-0 w-full border-b border-solid"
@@ -1996,7 +1996,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1996
1996
  var r;
1997
1997
  (r = e.current) == null || r.focus();
1998
1998
  }, []), e;
1999
- }, cs = ["true", "false"], _a = /* @__PURE__ */ os(cs), ka = "answer", us = "flex items-center flex-wrap gap-2 p-2.5", ds = "min-w-0 max-w-full flex-auto", fs = Hr(({
1999
+ }, cs = ["true", "false"], ka = /* @__PURE__ */ os(cs), Ca = "answer", us = "flex items-center flex-wrap gap-2 p-2.5", ds = "min-w-0 max-w-full flex-auto", fs = Hr(({
2000
2000
  label: e,
2001
2001
  ...r
2002
2002
  }, t) => l("button", {
@@ -2007,7 +2007,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2007
2007
  class: "text-center text-base",
2008
2008
  children: e
2009
2009
  })
2010
- })), Ca = ({
2010
+ })), Sa = ({
2011
2011
  input: e,
2012
2012
  onSubmitSuccess: r
2013
2013
  }) => {
@@ -2017,10 +2017,10 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2017
2017
  class: "",
2018
2018
  onSubmit: (s) => {
2019
2019
  s.preventDefault();
2020
- const n = Ws(s).value, a = ua(_a, n);
2020
+ const n = zs(s).value, i = da(ka, n);
2021
2021
  r({
2022
2022
  type: "boolean",
2023
- value: a === "true"
2023
+ value: i === "true"
2024
2024
  });
2025
2025
  },
2026
2026
  children: [l("ul", {
@@ -2030,7 +2030,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2030
2030
  children: l(fs, {
2031
2031
  ref: n === 0 ? t : null,
2032
2032
  type: "submit",
2033
- name: ka,
2033
+ name: Ca,
2034
2034
  value: s,
2035
2035
  label: e.config.labels[s]
2036
2036
  }, s)
@@ -2044,17 +2044,17 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2044
2044
  })
2045
2045
  })]
2046
2046
  });
2047
- }, pr = (e) => e.reduce((r, t) => r + t.sizeKb, 0), Sa = et("file"), mr = 3, _t = (e) => {
2047
+ }, pr = (e) => e.reduce((r, t) => r + t.sizeKb, 0), Aa = et("file"), mr = 3, _t = (e) => {
2048
2048
  const r = e.lastIndexOf(".");
2049
2049
  return r === -1 ? [e, ""] : [e.slice(0, r), e.slice(r)];
2050
- }, Aa = ({
2050
+ }, Ia = ({
2051
2051
  file: e,
2052
2052
  class: r,
2053
2053
  ...t
2054
2054
  }) => {
2055
2055
  const {
2056
2056
  t: s
2057
- } = re(), [n, a] = _t(e.name);
2057
+ } = re(), [n, i] = _t(e.name);
2058
2058
  return l("div", {
2059
2059
  class: Qe("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline", r),
2060
2060
  ...t,
@@ -2067,7 +2067,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2067
2067
  class: "block truncate",
2068
2068
  children: n
2069
2069
  }), l("span", {
2070
- children: a
2070
+ children: i
2071
2071
  })]
2072
2072
  }), l("p", {
2073
2073
  class: "text-accent-11",
@@ -2089,29 +2089,29 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2089
2089
  }, br = (e) => ({
2090
2090
  name: Ea(e.name, 42),
2091
2091
  sizeKb: e.size / 1e3
2092
- }), Ia = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], Fa = (e, r, t) => {
2093
- const s = _t(r.name)[1].toLowerCase(), n = [...t.map((i) => i.toLowerCase()), ...Ia], a = s === "" ? "none" : n.includes(s) ? s : "other";
2094
- return `chatbot-file-refused:${e}:${a}`;
2095
- }, Va = ({
2092
+ }), Fa = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], Va = (e, r, t) => {
2093
+ const s = _t(r.name)[1].toLowerCase(), n = [...t.map((a) => a.toLowerCase()), ...Fa], i = s === "" ? "none" : n.includes(s) ? s : "other";
2094
+ return `chatbot-file-refused:${e}:${i}`;
2095
+ }, Ma = ({
2096
2096
  input: e,
2097
2097
  onSubmitSuccess: r,
2098
2098
  analytics: t
2099
2099
  }) => {
2100
2100
  var C;
2101
- const s = (C = q.current$.value.flow) == null ? void 0 : C.data.submissions[e.key], [n, a] = ke(Sa(s) && s.value.length ? {
2101
+ const s = (C = q.current$.value.flow) == null ? void 0 : C.data.submissions[e.key], [n, i] = ke(Aa(s) && s.value.length ? {
2102
2102
  status: "ready",
2103
2103
  files: s.value
2104
2104
  } : {
2105
2105
  status: "empty"
2106
- }), i = ye(0), o = n.status === "ready" ? n.files : [], c = n.status === "ready" || n.status === "pending" ? n.files : [], d = n.status === "error" ? n.error : void 0, g = c.length - mr, b = pr(c), p = Jt(), {
2107
- t: m
2108
- } = re(), _ = (A) => {
2106
+ }), a = ye(0), o = n.status === "ready" ? n.files : [], c = n.status === "ready" || n.status === "pending" ? n.files : [], f = n.status === "error" ? n.error : void 0, p = c.length - mr, g = pr(c), m = Jt(), {
2107
+ t: b
2108
+ } = re(), k = (A) => {
2109
2109
  if (!A.length)
2110
2110
  return {
2111
2111
  reason: "required",
2112
2112
  error: {
2113
2113
  type: "required",
2114
- message: m("validation_file")
2114
+ message: b("validation_file")
2115
2115
  }
2116
2116
  };
2117
2117
  if (!ir(A, e.config.extensions))
@@ -2120,7 +2120,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2120
2120
  file: A.find((v) => !ir([v], e.config.extensions)),
2121
2121
  error: {
2122
2122
  type: "validate",
2123
- message: m("validation_file_ext", {
2123
+ message: b("validation_file_ext", {
2124
2124
  ext: e.config.extensions.join(", ")
2125
2125
  })
2126
2126
  }
@@ -2131,7 +2131,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2131
2131
  file: A.find((v) => v.sizeKb === 0),
2132
2132
  error: {
2133
2133
  type: "validate",
2134
- message: m("validation_file_empty")
2134
+ message: b("validation_file_empty")
2135
2135
  }
2136
2136
  };
2137
2137
  if (e.config.fileSizeLimitKib && pr(A) > e.config.fileSizeLimitKib)
@@ -2139,7 +2139,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2139
2139
  reason: "size",
2140
2140
  error: {
2141
2141
  type: "max",
2142
- message: m("validation_file_size", {
2142
+ message: b("validation_file_size", {
2143
2143
  size: Ge(e.config.fileSizeLimitKib)
2144
2144
  })
2145
2145
  }
@@ -2149,17 +2149,17 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2149
2149
  reason: "count",
2150
2150
  error: {
2151
2151
  type: "invalid",
2152
- message: m("validation_file_max", {
2152
+ message: b("validation_file_max", {
2153
2153
  count: 1
2154
2154
  })
2155
2155
  }
2156
2156
  };
2157
- }, k = (A, v) => {
2157
+ }, w = (A, v) => {
2158
2158
  var R, V;
2159
2159
  return t.log({
2160
2160
  event: "INTERACTION",
2161
2161
  properties: {
2162
- tag: Fa(A, v, e.config.extensions)
2162
+ tag: Va(A, v, e.config.extensions)
2163
2163
  },
2164
2164
  customProperties: (V = (R = q.current$.peek().flow) == null ? void 0 : R.analytics) == null ? void 0 : V.customProperties
2165
2165
  });
@@ -2169,8 +2169,8 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2169
2169
  onSubmit: (A) => {
2170
2170
  if (A.preventDefault(), n.status === "pending" || n.status === "error")
2171
2171
  return;
2172
- const v = _(o);
2173
- v ? a({
2172
+ const v = k(o);
2173
+ v ? i({
2174
2174
  status: "error",
2175
2175
  error: v.error
2176
2176
  }) : r({
@@ -2181,7 +2181,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2181
2181
  children: [l("div", {
2182
2182
  class: "flex items-center gap-2",
2183
2183
  children: [l("label", {
2184
- ref: p,
2184
+ ref: m,
2185
2185
  for: "dropzone-file",
2186
2186
  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",
2187
2187
  children: [c.length > 0 ? l("ul", {
@@ -2197,9 +2197,9 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2197
2197
  children: R
2198
2198
  })]
2199
2199
  });
2200
- }), g > 0 ? l(yr, {
2201
- children: m("file_more", {
2202
- count: g
2200
+ }), p > 0 ? l(yr, {
2201
+ children: b("file_more", {
2202
+ count: p
2203
2203
  })
2204
2204
  }) : null]
2205
2205
  }) : l("div", {
@@ -2221,12 +2221,12 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2221
2221
  })
2222
2222
  }), l("p", {
2223
2223
  class: "text-neutral-12 tracking-[-0.01em]",
2224
- children: m("upload_file", {
2224
+ children: b("upload_file", {
2225
2225
  count: e.config.allowMultiple ? 2 : 1
2226
2226
  })
2227
2227
  }), e.config.fileSizeLimitKib ? l("p", {
2228
2228
  class: "text-neutral-11 text-xs",
2229
- children: ["(", m("file_max_size", {
2229
+ children: ["(", b("file_max_size", {
2230
2230
  size: Ge(e.config.fileSizeLimitKib)
2231
2231
  }), ")"]
2232
2232
  }) : null]
@@ -2235,7 +2235,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2235
2235
  children: [l("p", {
2236
2236
  id: "accepted-filetypes",
2237
2237
  class: "sr-only",
2238
- children: m("file_extensions")
2238
+ children: b("file_extensions")
2239
2239
  }), l("ul", {
2240
2240
  "aria-describedby": "accepted-filetypes",
2241
2241
  class: "flex flex-wrap justify-center gap-2",
@@ -2252,22 +2252,22 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2252
2252
  children: [l(Ut, {
2253
2253
  "aria-hidden": "true",
2254
2254
  class: "h-4 w-4"
2255
- }), m("file_preparing", {
2255
+ }), b("file_preparing", {
2256
2256
  count: c.length
2257
2257
  })]
2258
2258
  }) : n.status === "ready" ? l(be, {
2259
- children: [o.length > 1 ? m("file_total_size", {
2260
- size: Ge(b)
2261
- }) : Ge(b), l("span", {
2259
+ children: [o.length > 1 ? b("file_total_size", {
2260
+ size: Ge(g)
2261
+ }) : Ge(g), l("span", {
2262
2262
  class: "sr-only",
2263
- children: [". ", m("file_ready", {
2263
+ children: [". ", b("file_ready", {
2264
2264
  count: o.length
2265
2265
  })]
2266
2266
  })]
2267
2267
  }) : null
2268
2268
  }), l("input", {
2269
2269
  id: "dropzone-file",
2270
- "aria-label": m("upload_file", {
2270
+ "aria-label": b("upload_file", {
2271
2271
  count: e.config.allowMultiple ? 2 : 1
2272
2272
  }),
2273
2273
  onInput: async (A) => {
@@ -2277,40 +2277,40 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2277
2277
  const [R] = v;
2278
2278
  if (!R)
2279
2279
  return;
2280
- const V = ++i.current, M = n.status === "ready", ee = v.map(br), N = _(ee);
2281
- if (N)
2282
- return k(N.reason, N.file ?? R), a({
2280
+ const V = ++a.current, M = n.status === "ready", ee = v.map(br), K = k(ee);
2281
+ if (K)
2282
+ return w(K.reason, K.file ?? R), i({
2283
2283
  status: "error",
2284
- error: N.error
2284
+ error: K.error
2285
2285
  });
2286
- a({
2286
+ i({
2287
2287
  status: "pending",
2288
2288
  files: ee
2289
2289
  });
2290
- let G;
2290
+ let T;
2291
2291
  try {
2292
- const D = await Promise.all(v.map(async (T) => {
2292
+ const N = await Promise.all(v.map(async (D) => {
2293
2293
  try {
2294
2294
  return {
2295
- ...br(T),
2296
- data: await zs(T)
2295
+ ...br(D),
2296
+ data: await Hs(D)
2297
2297
  };
2298
2298
  } catch (j) {
2299
- throw G ?? (G = T), j;
2299
+ throw T ?? (T = D), j;
2300
2300
  }
2301
2301
  }));
2302
- i.current === V && a({
2302
+ a.current === V && i({
2303
2303
  status: "ready",
2304
- files: D
2304
+ files: N
2305
2305
  });
2306
2306
  } catch {
2307
- if (i.current !== V)
2307
+ if (a.current !== V)
2308
2308
  return;
2309
- k("unreadable", G ?? R), a({
2309
+ w("unreadable", T ?? R), i({
2310
2310
  status: "error",
2311
2311
  error: {
2312
2312
  type: "invalid",
2313
- message: m(M ? "file_read_error_replacement" : "file_read_error")
2313
+ message: b(M ? "file_read_error_replacement" : "file_read_error")
2314
2314
  }
2315
2315
  });
2316
2316
  }
@@ -2330,13 +2330,13 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2330
2330
  })]
2331
2331
  })]
2332
2332
  }), l(tt, {
2333
- error: d
2333
+ error: f
2334
2334
  })]
2335
2335
  });
2336
2336
  };
2337
- var ft = (e) => e.type === "checkbox", De = (e) => e instanceof Date, oe = (e) => e == null;
2337
+ var ft = (e) => e.type === "checkbox", Te = (e) => e instanceof Date, oe = (e) => e == null;
2338
2338
  const hs = (e) => typeof e == "object";
2339
- var Z = (e) => !oe(e) && !Array.isArray(e) && hs(e) && !De(e), Ma = (e) => Z(e) && e.target ? ft(e.target) ? e.target.checked : e.target.value : e, La = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Ra = (e, r) => e.has(La(r)), Na = (e) => {
2339
+ var Z = (e) => !oe(e) && !Array.isArray(e) && hs(e) && !Te(e), La = (e) => Z(e) && e.target ? ft(e.target) ? e.target.checked : e.target.value : e, Ra = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Na = (e, r) => e.has(Ra(r)), Da = (e) => {
2340
2340
  const r = e.constructor && e.constructor.prototype;
2341
2341
  return Z(r) && r.hasOwnProperty("isPrototypeOf");
2342
2342
  }, Zt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
@@ -2347,27 +2347,27 @@ function Q(e) {
2347
2347
  if (Zt && (e instanceof Blob || r))
2348
2348
  return e;
2349
2349
  const t = Array.isArray(e);
2350
- if (!t && !(Z(e) && Na(e)))
2350
+ if (!t && !(Z(e) && Da(e)))
2351
2351
  return e;
2352
2352
  const s = t ? [] : Object.create(Object.getPrototypeOf(e));
2353
2353
  for (const n in e)
2354
2354
  Object.prototype.hasOwnProperty.call(e, n) && (s[n] = Q(e[n]));
2355
2355
  return s;
2356
2356
  }
2357
- var kt = (e) => /^\w*$/.test(e), K = (e) => e === void 0, Xt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Yt = (e) => Xt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, r, t) => {
2357
+ var kt = (e) => /^\w*$/.test(e), G = (e) => e === void 0, Xt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Yt = (e) => Xt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, r, t) => {
2358
2358
  if (!r || !Z(e))
2359
2359
  return t;
2360
- const s = (kt(r) ? [r] : Yt(r)).reduce((n, a) => oe(n) ? n : n[a], e);
2361
- return K(s) || s === e ? K(e[r]) ? t : e[r] : s;
2362
- }, me = (e) => typeof e == "boolean", de = (e) => typeof e == "function", z = (e, r, t) => {
2360
+ const s = (kt(r) ? [r] : Yt(r)).reduce((n, i) => oe(n) ? n : n[i], e);
2361
+ return G(s) || s === e ? G(e[r]) ? t : e[r] : s;
2362
+ }, me = (e) => typeof e == "boolean", de = (e) => typeof e == "function", H = (e, r, t) => {
2363
2363
  let s = -1;
2364
- const n = kt(r) ? [r] : Yt(r), a = n.length, i = a - 1;
2365
- for (; ++s < a; ) {
2364
+ const n = kt(r) ? [r] : Yt(r), i = n.length, a = i - 1;
2365
+ for (; ++s < i; ) {
2366
2366
  const o = n[s];
2367
2367
  let c = t;
2368
- if (s !== i) {
2369
- const d = e[o];
2370
- c = Z(d) || Array.isArray(d) ? d : isNaN(+n[s + 1]) ? {} : [];
2368
+ if (s !== a) {
2369
+ const f = e[o];
2370
+ c = Z(f) || Array.isArray(f) ? f : isNaN(+n[s + 1]) ? {} : [];
2371
2371
  }
2372
2372
  if (o === "__proto__" || o === "constructor" || o === "prototype")
2373
2373
  return;
@@ -2394,25 +2394,25 @@ const gr = {
2394
2394
  validate: "validate"
2395
2395
  }, Ta = ae.createContext(null);
2396
2396
  Ta.displayName = "HookFormControlContext";
2397
- var Da = (e, r, t, s = !0) => {
2397
+ var Oa = (e, r, t, s = !0) => {
2398
2398
  const n = {
2399
2399
  defaultValues: r._defaultValues
2400
2400
  };
2401
- for (const a in e)
2402
- Object.defineProperty(n, a, {
2401
+ for (const i in e)
2402
+ Object.defineProperty(n, i, {
2403
2403
  get: () => {
2404
- const i = a;
2405
- return r._proxyFormState[i] !== fe.all && (r._proxyFormState[i] = !s || fe.all), t && (t[i] = !0), e[i];
2404
+ const a = i;
2405
+ return r._proxyFormState[a] !== fe.all && (r._proxyFormState[a] = !s || fe.all), t && (t[a] = !0), e[a];
2406
2406
  }
2407
2407
  });
2408
2408
  return n;
2409
2409
  };
2410
- const Oa = typeof window < "u" ? ae.useLayoutEffect : ae.useEffect;
2411
- var ue = (e) => typeof e == "string", ja = (e, r, t, s, n) => ue(e) ? (s && r.watch.add(e), S(t, e, n)) : Array.isArray(e) ? e.map((a) => (s && r.watch.add(a), S(t, a))) : (s && (r.watchAll = !0), t), Pt = (e) => oe(e) || !hs(e);
2410
+ const ja = typeof window < "u" ? ae.useLayoutEffect : ae.useEffect;
2411
+ var ue = (e) => typeof e == "string", $a = (e, r, t, s, n) => ue(e) ? (s && r.watch.add(e), S(t, e, n)) : Array.isArray(e) ? e.map((i) => (s && r.watch.add(i), S(t, i))) : (s && (r.watchAll = !0), t), Pt = (e) => oe(e) || !hs(e);
2412
2412
  function Ve(e, r, t = /* @__PURE__ */ new WeakSet()) {
2413
2413
  if (Pt(e) || Pt(r))
2414
2414
  return Object.is(e, r);
2415
- if (De(e) && De(r))
2415
+ if (Te(e) && Te(r))
2416
2416
  return Object.is(e.getTime(), r.getTime());
2417
2417
  const s = Object.keys(e), n = Object.keys(r);
2418
2418
  if (s.length !== n.length)
@@ -2420,13 +2420,13 @@ function Ve(e, r, t = /* @__PURE__ */ new WeakSet()) {
2420
2420
  if (t.has(e) || t.has(r))
2421
2421
  return !0;
2422
2422
  t.add(e), t.add(r);
2423
- for (const a of s) {
2424
- const i = e[a];
2425
- if (!n.includes(a))
2423
+ for (const i of s) {
2424
+ const a = e[i];
2425
+ if (!n.includes(i))
2426
2426
  return !1;
2427
- if (a !== "ref") {
2428
- const o = r[a];
2429
- if (De(i) && De(o) || Z(i) && Z(o) || Array.isArray(i) && Array.isArray(o) ? !Ve(i, o, t) : !Object.is(i, o))
2427
+ if (i !== "ref") {
2428
+ const o = r[i];
2429
+ if (Te(a) && Te(o) || Z(a) && Z(o) || Array.isArray(a) && Array.isArray(o) ? !Ve(a, o, t) : !Object.is(a, o))
2430
2430
  return !1;
2431
2431
  }
2432
2432
  }
@@ -2447,12 +2447,12 @@ var ps = (e, r, t, s, n) => r ? {
2447
2447
  return e;
2448
2448
  },
2449
2449
  next: (n) => {
2450
- for (const a of e)
2451
- a.next && a.next(n);
2450
+ for (const i of e)
2451
+ i.next && i.next(n);
2452
2452
  },
2453
2453
  subscribe: (n) => (e.push(n), {
2454
2454
  unsubscribe: () => {
2455
- e = e.filter((a) => a !== n);
2455
+ e = e.filter((i) => i !== n);
2456
2456
  }
2457
2457
  }),
2458
2458
  unsubscribe: () => {
@@ -2464,12 +2464,12 @@ function ms(e, r) {
2464
2464
  const t = {};
2465
2465
  for (const s in e)
2466
2466
  if (e.hasOwnProperty(s)) {
2467
- const n = e[s], a = r[s];
2468
- if (n && Z(n) && a) {
2469
- const i = ms(n, a);
2470
- Z(i) && (t[s] = i);
2467
+ const n = e[s], i = r[s];
2468
+ if (n && Z(n) && i) {
2469
+ const a = ms(n, i);
2470
+ Z(a) && (t[s] = a);
2471
2471
  } else
2472
- e[s] && (t[s] = a);
2472
+ e[s] && (t[s] = i);
2473
2473
  }
2474
2474
  return t;
2475
2475
  }
@@ -2478,37 +2478,37 @@ var ie = (e) => Z(e) && !Object.keys(e).length, Qt = (e) => e.type === "file", b
2478
2478
  return !1;
2479
2479
  const r = e ? e.ownerDocument : 0;
2480
2480
  return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
2481
- }, ys = (e) => e.type === "select-multiple", er = (e) => e.type === "radio", $a = (e) => er(e) || ft(e), Tt = (e) => bt(e) && e.isConnected;
2482
- function Pa(e, r) {
2481
+ }, ys = (e) => e.type === "select-multiple", er = (e) => e.type === "radio", Pa = (e) => er(e) || ft(e), Dt = (e) => bt(e) && e.isConnected;
2482
+ function qa(e, r) {
2483
2483
  const t = r.slice(0, -1).length;
2484
2484
  let s = 0;
2485
2485
  for (; s < t; )
2486
- e = K(e) ? s++ : e[r[s++]];
2486
+ e = G(e) ? s++ : e[r[s++]];
2487
2487
  return e;
2488
2488
  }
2489
- function qa(e) {
2489
+ function Ua(e) {
2490
2490
  for (const r in e)
2491
- if (e.hasOwnProperty(r) && !K(e[r]))
2491
+ if (e.hasOwnProperty(r) && !G(e[r]))
2492
2492
  return !1;
2493
2493
  return !0;
2494
2494
  }
2495
2495
  function J(e, r) {
2496
- const t = Array.isArray(r) ? r : kt(r) ? [r] : Yt(r), s = t.length === 1 ? e : Pa(e, t), n = t.length - 1, a = t[n];
2497
- return s && delete s[a], n !== 0 && (Z(s) && ie(s) || Array.isArray(s) && qa(s)) && J(e, t.slice(0, -1)), e;
2496
+ const t = Array.isArray(r) ? r : kt(r) ? [r] : Yt(r), s = t.length === 1 ? e : qa(e, t), n = t.length - 1, i = t[n];
2497
+ return s && delete s[i], n !== 0 && (Z(s) && ie(s) || Array.isArray(s) && Ua(s)) && J(e, t.slice(0, -1)), e;
2498
2498
  }
2499
- var Ua = (e) => {
2499
+ var Wa = (e) => {
2500
2500
  for (const r in e)
2501
2501
  if (de(e[r]))
2502
2502
  return !0;
2503
2503
  return !1;
2504
2504
  };
2505
2505
  function bs(e) {
2506
- return Array.isArray(e) || Z(e) && !Ua(e);
2506
+ return Array.isArray(e) || Z(e) && !Wa(e);
2507
2507
  }
2508
2508
  function qt(e, r = {}) {
2509
2509
  for (const t in e) {
2510
2510
  const s = e[t];
2511
- bs(s) ? (r[t] = Array.isArray(s) ? [] : {}, qt(s, r[t])) : K(s) || (r[t] = !0);
2511
+ bs(s) ? (r[t] = Array.isArray(s) ? [] : {}, qt(s, r[t])) : G(s) || (r[t] = !0);
2512
2512
  }
2513
2513
  return r;
2514
2514
  }
@@ -2517,10 +2517,10 @@ function Ke(e, r, t) {
2517
2517
  for (const s in e) {
2518
2518
  const n = e[s];
2519
2519
  if (bs(n))
2520
- K(r) || Pt(t[s]) ? t[s] = qt(n, Array.isArray(n) ? [] : {}) : Ke(n, oe(r) ? {} : r[s], t[s]);
2520
+ G(r) || Pt(t[s]) ? t[s] = qt(n, Array.isArray(n) ? [] : {}) : Ke(n, oe(r) ? {} : r[s], t[s]);
2521
2521
  else {
2522
- const a = r[s];
2523
- t[s] = !Ve(n, a);
2522
+ const i = r[s];
2523
+ t[s] = !Ve(n, i);
2524
2524
  }
2525
2525
  }
2526
2526
  return t;
@@ -2537,11 +2537,11 @@ var gs = (e) => {
2537
2537
  }
2538
2538
  return e[0].checked && !e[0].disabled ? (
2539
2539
  // @ts-expect-error expected to work in the browser
2540
- e[0].attributes && !K(e[0].attributes.value) ? K(e[0].value) || e[0].value === "" ? wr : { value: e[0].value, isValid: !0 } : wr
2540
+ e[0].attributes && !G(e[0].attributes.value) ? G(e[0].value) || e[0].value === "" ? wr : { value: e[0].value, isValid: !0 } : wr
2541
2541
  ) : xr;
2542
2542
  }
2543
2543
  return xr;
2544
- }, vs = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: s }) => K(e) ? e : r ? e === "" ? NaN : e && +e : t && ue(e) ? new Date(e) : s ? s(e) : e;
2544
+ }, vs = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: s }) => G(e) ? e : r ? e === "" ? NaN : e && +e : t && ue(e) ? new Date(e) : s ? s(e) : e;
2545
2545
  const _r = {
2546
2546
  isValid: !1,
2547
2547
  value: null
@@ -2552,13 +2552,13 @@ var xs = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disab
2552
2552
  } : r, _r) : _r;
2553
2553
  function kr(e) {
2554
2554
  const r = e.ref;
2555
- return Qt(r) ? r.files : er(r) ? xs(e.refs).value : ys(r) ? [...r.selectedOptions].map(({ value: t }) => t) : ft(r) ? gs(e.refs).value : vs(K(r.value) ? e.ref.value : r.value, e);
2555
+ return Qt(r) ? r.files : er(r) ? xs(e.refs).value : ys(r) ? [...r.selectedOptions].map(({ value: t }) => t) : ft(r) ? gs(e.refs).value : vs(G(r.value) ? e.ref.value : r.value, e);
2556
2556
  }
2557
- var Wa = (e, r, t, s) => {
2557
+ var za = (e, r, t, s) => {
2558
2558
  const n = {};
2559
- for (const a of e) {
2560
- const i = S(r, a);
2561
- i && z(n, a, i._f);
2559
+ for (const i of e) {
2560
+ const a = S(r, i);
2561
+ a && H(n, i, a._f);
2562
2562
  }
2563
2563
  return {
2564
2564
  criteriaMode: t,
@@ -2566,7 +2566,7 @@ var Wa = (e, r, t, s) => {
2566
2566
  fields: n,
2567
2567
  shouldUseNativeValidation: s
2568
2568
  };
2569
- }, gt = (e) => e instanceof RegExp, it = (e) => K(e) ? e : gt(e) ? e.source : Z(e) ? gt(e.value) ? e.value.source : e.value : e, Cr = (e) => ({
2569
+ }, gt = (e) => e instanceof RegExp, it = (e) => G(e) ? e : gt(e) ? e.source : Z(e) ? gt(e.value) ? e.value.source : e.value : e, Cr = (e) => ({
2570
2570
  isOnSubmit: !e || e === fe.onSubmit,
2571
2571
  isOnBlur: e === fe.onBlur,
2572
2572
  isOnChange: e === fe.onChange,
@@ -2574,16 +2574,16 @@ var Wa = (e, r, t, s) => {
2574
2574
  isOnTouch: e === fe.onTouched
2575
2575
  });
2576
2576
  const Sr = "AsyncFunction";
2577
- var za = (e) => !!e && !!e.validate && !!(de(e.validate) && e.validate.constructor.name === Sr || Z(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === Sr)), Ha = (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))));
2577
+ var Ha = (e) => !!e && !!e.validate && !!(de(e.validate) && e.validate.constructor.name === Sr || Z(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === Sr)), Ka = (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))));
2578
2578
  const dt = (e, r, t, s) => {
2579
2579
  for (const n of t || Object.keys(e)) {
2580
- const a = S(e, n);
2581
- if (a) {
2582
- const { _f: i, ...o } = a;
2583
- if (i) {
2584
- if (i.refs && i.refs[0] && r(i.refs[0], n) && !s)
2580
+ const i = S(e, n);
2581
+ if (i) {
2582
+ const { _f: a, ...o } = i;
2583
+ if (a) {
2584
+ if (a.refs && a.refs[0] && r(a.refs[0], n) && !s)
2585
2585
  return !0;
2586
- if (i.ref && r(i.ref, i.name) && !s)
2586
+ if (a.ref && r(a.ref, a.name) && !s)
2587
2587
  return !0;
2588
2588
  if (dt(o, r))
2589
2589
  break;
@@ -2592,7 +2592,7 @@ const dt = (e, r, t, s) => {
2592
2592
  }
2593
2593
  }
2594
2594
  };
2595
- function Er(e, r, t) {
2595
+ function Ir(e, r, t) {
2596
2596
  const s = S(e, t);
2597
2597
  if (s || kt(t))
2598
2598
  return {
@@ -2601,17 +2601,17 @@ function Er(e, r, t) {
2601
2601
  };
2602
2602
  const n = t.split(".");
2603
2603
  for (; n.length; ) {
2604
- const a = n.join("."), i = S(r, a), o = S(e, a);
2605
- if (i && !Array.isArray(i) && t !== a)
2604
+ const i = n.join("."), a = S(r, i), o = S(e, i);
2605
+ if (a && !Array.isArray(a) && t !== i)
2606
2606
  return { name: t };
2607
2607
  if (o && o.type)
2608
2608
  return {
2609
- name: a,
2609
+ name: i,
2610
2610
  error: o
2611
2611
  };
2612
2612
  if (o && o.root && o.root.type)
2613
2613
  return {
2614
- name: `${a}.root`,
2614
+ name: `${i}.root`,
2615
2615
  error: o.root
2616
2616
  };
2617
2617
  n.pop();
@@ -2620,15 +2620,15 @@ function Er(e, r, t) {
2620
2620
  name: t
2621
2621
  };
2622
2622
  }
2623
- var Ka = (e, r, t, s) => {
2623
+ var Ga = (e, r, t, s) => {
2624
2624
  t(e);
2625
- const { name: n, ...a } = e;
2626
- return ie(a) || Object.keys(a).length >= Object.keys(r).length || Object.keys(a).find((i) => r[i] === (!s || fe.all));
2627
- }, Ga = (e, r, t) => !e || !r || e === r || ut(e).some((s) => s && (t ? s === r : s.startsWith(r) || r.startsWith(s))), Ja = (e, r, t, s, n) => n.isOnAll ? !1 : !t && n.isOnTouch ? !(r || e) : (t ? s.isOnBlur : n.isOnBlur) ? !e : (t ? s.isOnChange : n.isOnChange) ? e : !0, Za = (e, r) => !Xt(S(e, r)).length && J(e, r), Xa = (e, r, t) => {
2625
+ const { name: n, ...i } = e;
2626
+ return ie(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((a) => r[a] === (!s || fe.all));
2627
+ }, Ja = (e, r, t) => !e || !r || e === r || ut(e).some((s) => s && (t ? s === r : s.startsWith(r) || r.startsWith(s))), Za = (e, r, t, s, n) => n.isOnAll ? !1 : !t && n.isOnTouch ? !(r || e) : (t ? s.isOnBlur : n.isOnBlur) ? !e : (t ? s.isOnChange : n.isOnChange) ? e : !0, Xa = (e, r) => !Xt(S(e, r)).length && J(e, r), Ya = (e, r, t) => {
2628
2628
  const s = ut(S(e, t));
2629
- return z(s, "root", r[t]), z(e, t, s), e;
2629
+ return H(s, "root", r[t]), H(e, t, s), e;
2630
2630
  };
2631
- function Ir(e, r, t = "validate") {
2631
+ function Er(e, r, t = "validate") {
2632
2632
  if (ue(e) || Array.isArray(e) && e.every(ue) || me(e) && !e)
2633
2633
  return {
2634
2634
  type: t,
@@ -2639,95 +2639,95 @@ function Ir(e, r, t = "validate") {
2639
2639
  var He = (e) => Z(e) && !gt(e) ? e : {
2640
2640
  value: e,
2641
2641
  message: ""
2642
- }, Fr = async (e, r, t, s, n, a) => {
2643
- const { ref: i, refs: o, required: c, maxLength: d, minLength: g, min: b, max: p, pattern: m, validate: _, name: k, valueAsNumber: C, mount: A } = e._f, v = S(t, k);
2644
- if (!A || r.has(k))
2642
+ }, Fr = async (e, r, t, s, n, i) => {
2643
+ const { ref: a, refs: o, required: c, maxLength: f, minLength: p, min: g, max: m, pattern: b, validate: k, name: w, valueAsNumber: C, mount: A } = e._f, v = S(t, w);
2644
+ if (!A || r.has(w))
2645
2645
  return {};
2646
- const R = o ? o[0] : i, V = (I) => {
2647
- n && R.reportValidity && (R.setCustomValidity(me(I) ? "" : I || ""), R.reportValidity());
2648
- }, M = {}, ee = er(i), N = ft(i), G = ee || N, D = (C || Qt(i)) && K(i.value) && K(v) || bt(i) && i.value === "" || v === "" || Array.isArray(v) && !v.length, T = ps.bind(null, k, s, M), j = (I, F, $, L = _e.maxLength, W = _e.minLength) => {
2649
- const U = I ? F : $;
2650
- M[k] = {
2651
- type: I ? L : W,
2646
+ const R = o ? o[0] : a, V = (E) => {
2647
+ n && R.reportValidity && (R.setCustomValidity(me(E) ? "" : E || ""), R.reportValidity());
2648
+ }, M = {}, ee = er(a), K = ft(a), T = ee || K, N = (C || Qt(a)) && G(a.value) && G(v) || bt(a) && a.value === "" || v === "" || Array.isArray(v) && !v.length, D = ps.bind(null, w, s, M), j = (E, F, B, L = _e.maxLength, W = _e.minLength) => {
2649
+ const U = E ? F : B;
2650
+ M[w] = {
2651
+ type: E ? L : W,
2652
2652
  message: U,
2653
- ref: i,
2654
- ...T(I ? L : W, U)
2653
+ ref: a,
2654
+ ...D(E ? L : W, U)
2655
2655
  };
2656
2656
  };
2657
- if (a ? !Array.isArray(v) || !v.length : c && (!G && (D || oe(v)) || me(v) && !v || N && !gs(o).isValid || ee && !xs(o).isValid)) {
2658
- const { value: I, message: F } = ue(c) ? { value: !!c, message: c } : He(c);
2659
- if (I && (M[k] = {
2657
+ if (i ? !Array.isArray(v) || !v.length : c && (!T && (N || oe(v)) || me(v) && !v || K && !gs(o).isValid || ee && !xs(o).isValid)) {
2658
+ const { value: E, message: F } = ue(c) ? { value: !!c, message: c } : He(c);
2659
+ if (E && (M[w] = {
2660
2660
  type: _e.required,
2661
2661
  message: F,
2662
2662
  ref: R,
2663
- ...T(_e.required, F)
2663
+ ...D(_e.required, F)
2664
2664
  }, !s))
2665
2665
  return V(F), M;
2666
2666
  }
2667
- if (!D && (!oe(b) || !oe(p))) {
2668
- let I, F;
2669
- const $ = He(p), L = He(b);
2667
+ if (!N && (!oe(g) || !oe(m))) {
2668
+ let E, F;
2669
+ const B = He(m), L = He(g);
2670
2670
  if (!oe(v) && !isNaN(v)) {
2671
- const W = i.valueAsNumber || v && +v;
2672
- oe($.value) || (I = W > $.value), oe(L.value) || (F = W < L.value);
2671
+ const W = a.valueAsNumber || v && +v;
2672
+ oe(B.value) || (E = W > B.value), oe(L.value) || (F = W < L.value);
2673
2673
  } else {
2674
- const W = i.valueAsDate || new Date(v), U = (H) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + H), te = i.type == "time", X = i.type == "week";
2675
- ue($.value) && v && (I = te ? U(v) > U($.value) : X ? v > $.value : W > new Date($.value)), ue(L.value) && v && (F = te ? U(v) < U(L.value) : X ? v < L.value : W < new Date(L.value));
2674
+ const W = a.valueAsDate || new Date(v), U = (z) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + z), te = a.type == "time", X = a.type == "week";
2675
+ ue(B.value) && v && (E = te ? U(v) > U(B.value) : X ? v > B.value : W > new Date(B.value)), ue(L.value) && v && (F = te ? U(v) < U(L.value) : X ? v < L.value : W < new Date(L.value));
2676
2676
  }
2677
- if ((I || F) && (j(!!I, $.message, L.message, _e.max, _e.min), !s))
2678
- return V(M[k].message), M;
2677
+ if ((E || F) && (j(!!E, B.message, L.message, _e.max, _e.min), !s))
2678
+ return V(M[w].message), M;
2679
2679
  }
2680
- if ((d || g) && !D && (ue(v) || a && Array.isArray(v))) {
2681
- const I = He(d), F = He(g), $ = !oe(I.value) && v.length > +I.value, L = !oe(F.value) && v.length < +F.value;
2682
- if (($ || L) && (j($, I.message, F.message), !s))
2683
- return V(M[k].message), M;
2680
+ if ((f || p) && !N && (ue(v) || i && Array.isArray(v))) {
2681
+ const E = He(f), F = He(p), B = !oe(E.value) && v.length > +E.value, L = !oe(F.value) && v.length < +F.value;
2682
+ if ((B || L) && (j(B, E.message, F.message), !s))
2683
+ return V(M[w].message), M;
2684
2684
  }
2685
- if (m && !D && ue(v)) {
2686
- const { value: I, message: F } = He(m);
2687
- if (gt(I) && !v.match(I) && (M[k] = {
2685
+ if (b && !N && ue(v)) {
2686
+ const { value: E, message: F } = He(b);
2687
+ if (gt(E) && !v.match(E) && (M[w] = {
2688
2688
  type: _e.pattern,
2689
2689
  message: F,
2690
- ref: i,
2691
- ...T(_e.pattern, F)
2690
+ ref: a,
2691
+ ...D(_e.pattern, F)
2692
2692
  }, !s))
2693
2693
  return V(F), M;
2694
2694
  }
2695
- if (_) {
2696
- if (de(_)) {
2697
- const I = await _(v, t), F = Ir(I, R);
2698
- if (F && (M[k] = {
2695
+ if (k) {
2696
+ if (de(k)) {
2697
+ const E = await k(v, t), F = Er(E, R);
2698
+ if (F && (M[w] = {
2699
2699
  ...F,
2700
- ...T(_e.validate, F.message)
2700
+ ...D(_e.validate, F.message)
2701
2701
  }, !s))
2702
2702
  return V(F.message), M;
2703
- } else if (Z(_)) {
2704
- let I = {};
2705
- for (const F in _) {
2706
- if (!ie(I) && !s)
2703
+ } else if (Z(k)) {
2704
+ let E = {};
2705
+ for (const F in k) {
2706
+ if (!ie(E) && !s)
2707
2707
  break;
2708
- const $ = Ir(await _[F](v, t), R, F);
2709
- $ && (I = {
2710
- ...$,
2711
- ...T(F, $.message)
2712
- }, V($.message), s && (M[k] = I));
2708
+ const B = Er(await k[F](v, t), R, F);
2709
+ B && (E = {
2710
+ ...B,
2711
+ ...D(F, B.message)
2712
+ }, V(B.message), s && (M[w] = E));
2713
2713
  }
2714
- if (!ie(I) && (M[k] = {
2714
+ if (!ie(E) && (M[w] = {
2715
2715
  ref: R,
2716
- ...I
2716
+ ...E
2717
2717
  }, !s))
2718
2718
  return M;
2719
2719
  }
2720
2720
  }
2721
2721
  return V(!0), M;
2722
2722
  };
2723
- const Ya = {
2723
+ const Qa = {
2724
2724
  mode: fe.onSubmit,
2725
2725
  reValidateMode: fe.onChange,
2726
2726
  shouldFocusError: !0
2727
2727
  };
2728
- function Qa(e = {}) {
2728
+ function ei(e = {}) {
2729
2729
  let r = {
2730
- ...Ya,
2730
+ ...Qa,
2731
2731
  ...e
2732
2732
  }, t = {
2733
2733
  submitCount: 0,
@@ -2744,7 +2744,7 @@ function Qa(e = {}) {
2744
2744
  validatingFields: {},
2745
2745
  errors: r.errors || {},
2746
2746
  disabled: r.disabled || !1
2747
- }, s = {}, n = Z(r.defaultValues) || Z(r.values) ? Q(r.defaultValues || r.values) || {} : {}, a = r.shouldUnregister ? {} : Q(n), i = {
2747
+ }, s = {}, n = Z(r.defaultValues) || Z(r.values) ? Q(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : Q(n), a = {
2748
2748
  action: !1,
2749
2749
  mount: !1,
2750
2750
  watch: !1,
@@ -2755,8 +2755,8 @@ function Qa(e = {}) {
2755
2755
  unMount: /* @__PURE__ */ new Set(),
2756
2756
  array: /* @__PURE__ */ new Set(),
2757
2757
  watch: /* @__PURE__ */ new Set()
2758
- }, c, d = 0;
2759
- const g = {
2758
+ }, c, f = 0;
2759
+ const p = {
2760
2760
  isDirty: !1,
2761
2761
  dirtyFields: !1,
2762
2762
  validatingFields: !1,
@@ -2764,327 +2764,327 @@ function Qa(e = {}) {
2764
2764
  isValidating: !1,
2765
2765
  isValid: !1,
2766
2766
  errors: !1
2767
- }, b = {
2768
- ...g
2767
+ }, g = {
2768
+ ...p
2769
2769
  };
2770
- let p = {
2771
- ...b
2770
+ let m = {
2771
+ ...g
2772
2772
  };
2773
- const m = {
2773
+ const b = {
2774
2774
  array: vr(),
2775
2775
  state: vr()
2776
- }, _ = r.criteriaMode === fe.all, k = (u) => (f) => {
2777
- clearTimeout(d), d = setTimeout(u, f);
2776
+ }, k = r.criteriaMode === fe.all, w = (u) => (d) => {
2777
+ clearTimeout(f), f = setTimeout(u, d);
2778
2778
  }, C = async (u) => {
2779
- if (!i.keepIsValid && !r.disabled && (b.isValid || p.isValid || u)) {
2780
- let f;
2781
- r.resolver ? (f = ie((await G()).errors), A()) : f = await T(s, !0), f !== t.isValid && m.state.next({
2782
- isValid: f
2779
+ if (!a.keepIsValid && !r.disabled && (g.isValid || m.isValid || u)) {
2780
+ let d;
2781
+ r.resolver ? (d = ie((await T()).errors), A()) : d = await D(s, !0), d !== t.isValid && b.state.next({
2782
+ isValid: d
2783
2783
  });
2784
2784
  }
2785
- }, A = (u, f) => {
2786
- !r.disabled && (b.isValidating || b.validatingFields || p.isValidating || p.validatingFields) && ((u || Array.from(o.mount)).forEach((h) => {
2787
- h && (f ? z(t.validatingFields, h, f) : J(t.validatingFields, h));
2788
- }), m.state.next({
2785
+ }, A = (u, d) => {
2786
+ !r.disabled && (g.isValidating || g.validatingFields || m.isValidating || m.validatingFields) && ((u || Array.from(o.mount)).forEach((h) => {
2787
+ h && (d ? H(t.validatingFields, h, d) : J(t.validatingFields, h));
2788
+ }), b.state.next({
2789
2789
  validatingFields: t.validatingFields,
2790
2790
  isValidating: !ie(t.validatingFields)
2791
2791
  }));
2792
- }, v = (u, f = [], h, w, y = !0, x = !0) => {
2793
- if (w && h && !r.disabled) {
2794
- if (i.action = !0, x && Array.isArray(S(s, u))) {
2795
- const E = h(S(s, u), w.argA, w.argB);
2796
- y && z(s, u, E);
2792
+ }, v = (u, d = [], h, _, y = !0, x = !0) => {
2793
+ if (_ && h && !r.disabled) {
2794
+ if (a.action = !0, x && Array.isArray(S(s, u))) {
2795
+ const I = h(S(s, u), _.argA, _.argB);
2796
+ y && H(s, u, I);
2797
2797
  }
2798
2798
  if (x && Array.isArray(S(t.errors, u))) {
2799
- const E = h(S(t.errors, u), w.argA, w.argB);
2800
- y && z(t.errors, u, E), Za(t.errors, u);
2799
+ const I = h(S(t.errors, u), _.argA, _.argB);
2800
+ y && H(t.errors, u, I), Xa(t.errors, u);
2801
2801
  }
2802
- if ((b.touchedFields || p.touchedFields) && x && Array.isArray(S(t.touchedFields, u))) {
2803
- const E = h(S(t.touchedFields, u), w.argA, w.argB);
2804
- y && z(t.touchedFields, u, E);
2802
+ if ((g.touchedFields || m.touchedFields) && x && Array.isArray(S(t.touchedFields, u))) {
2803
+ const I = h(S(t.touchedFields, u), _.argA, _.argB);
2804
+ y && H(t.touchedFields, u, I);
2805
2805
  }
2806
- (b.dirtyFields || p.dirtyFields) && (t.dirtyFields = Ke(n, a)), m.state.next({
2806
+ (g.dirtyFields || m.dirtyFields) && (t.dirtyFields = Ke(n, i)), b.state.next({
2807
2807
  name: u,
2808
- isDirty: I(u, f),
2808
+ isDirty: E(u, d),
2809
2809
  dirtyFields: t.dirtyFields,
2810
2810
  errors: t.errors,
2811
2811
  isValid: t.isValid
2812
2812
  });
2813
2813
  } else
2814
- z(a, u, f);
2815
- }, R = (u, f) => {
2816
- z(t.errors, u, f), m.state.next({
2814
+ H(i, u, d);
2815
+ }, R = (u, d) => {
2816
+ H(t.errors, u, d), b.state.next({
2817
2817
  errors: t.errors
2818
2818
  });
2819
2819
  }, V = (u) => {
2820
- t.errors = u, m.state.next({
2820
+ t.errors = u, b.state.next({
2821
2821
  errors: t.errors,
2822
2822
  isValid: !1
2823
2823
  });
2824
- }, M = (u, f, h, w) => {
2824
+ }, M = (u, d, h, _) => {
2825
2825
  const y = S(s, u);
2826
2826
  if (y) {
2827
- const x = S(a, u, K(h) ? S(n, u) : h);
2828
- K(x) || w && w.defaultChecked || f ? z(a, u, f ? x : kr(y._f)) : L(u, x), i.mount && !i.action && C();
2827
+ const x = S(i, u, G(h) ? S(n, u) : h);
2828
+ G(x) || _ && _.defaultChecked || d ? H(i, u, d ? x : kr(y._f)) : L(u, x), a.mount && !a.action && C();
2829
2829
  }
2830
- }, ee = (u, f, h, w, y) => {
2831
- let x = !1, E = !1;
2832
- const B = {
2830
+ }, ee = (u, d, h, _, y) => {
2831
+ let x = !1, I = !1;
2832
+ const $ = {
2833
2833
  name: u
2834
2834
  };
2835
2835
  if (!r.disabled) {
2836
- if (!h || w) {
2837
- (b.isDirty || p.isDirty) && (E = t.isDirty, t.isDirty = B.isDirty = I(), x = E !== B.isDirty);
2838
- const P = Ve(S(n, u), f);
2839
- E = !!S(t.dirtyFields, u), P ? J(t.dirtyFields, u) : z(t.dirtyFields, u, !0), B.dirtyFields = t.dirtyFields, x = x || (b.dirtyFields || p.dirtyFields) && E !== !P;
2836
+ if (!h || _) {
2837
+ (g.isDirty || m.isDirty) && (I = t.isDirty, t.isDirty = $.isDirty = E(), x = I !== $.isDirty);
2838
+ const P = Ve(S(n, u), d);
2839
+ I = !!S(t.dirtyFields, u), P ? J(t.dirtyFields, u) : H(t.dirtyFields, u, !0), $.dirtyFields = t.dirtyFields, x = x || (g.dirtyFields || m.dirtyFields) && I !== !P;
2840
2840
  }
2841
2841
  if (h) {
2842
2842
  const P = S(t.touchedFields, u);
2843
- P || (z(t.touchedFields, u, h), B.touchedFields = t.touchedFields, x = x || (b.touchedFields || p.touchedFields) && P !== h);
2843
+ P || (H(t.touchedFields, u, h), $.touchedFields = t.touchedFields, x = x || (g.touchedFields || m.touchedFields) && P !== h);
2844
2844
  }
2845
- x && y && m.state.next(B);
2845
+ x && y && b.state.next($);
2846
2846
  }
2847
- return x ? B : {};
2848
- }, N = (u, f, h, w) => {
2849
- const y = S(t.errors, u), x = (b.isValid || p.isValid) && me(f) && t.isValid !== f;
2850
- if (r.delayError && h ? (c = k(() => R(u, h)), c(r.delayError)) : (clearTimeout(d), c = null, h ? z(t.errors, u, h) : J(t.errors, u)), (h ? !Ve(y, h) : y) || !ie(w) || x) {
2851
- const E = {
2852
- ...w,
2853
- ...x && me(f) ? { isValid: f } : {},
2847
+ return x ? $ : {};
2848
+ }, K = (u, d, h, _) => {
2849
+ const y = S(t.errors, u), x = (g.isValid || m.isValid) && me(d) && t.isValid !== d;
2850
+ if (r.delayError && h ? (c = w(() => R(u, h)), c(r.delayError)) : (clearTimeout(f), c = null, h ? H(t.errors, u, h) : J(t.errors, u)), (h ? !Ve(y, h) : y) || !ie(_) || x) {
2851
+ const I = {
2852
+ ..._,
2853
+ ...x && me(d) ? { isValid: d } : {},
2854
2854
  errors: t.errors,
2855
2855
  name: u
2856
2856
  };
2857
2857
  t = {
2858
2858
  ...t,
2859
- ...E
2860
- }, m.state.next(E);
2859
+ ...I
2860
+ }, b.state.next(I);
2861
2861
  }
2862
- }, G = async (u) => (A(u, !0), await r.resolver(a, r.context, Wa(u || o.mount, s, r.criteriaMode, r.shouldUseNativeValidation))), D = async (u) => {
2863
- const { errors: f } = await G(u);
2862
+ }, T = async (u) => (A(u, !0), await r.resolver(i, r.context, za(u || o.mount, s, r.criteriaMode, r.shouldUseNativeValidation))), N = async (u) => {
2863
+ const { errors: d } = await T(u);
2864
2864
  if (A(u), u)
2865
2865
  for (const h of u) {
2866
- const w = S(f, h);
2867
- w ? z(t.errors, h, w) : J(t.errors, h);
2866
+ const _ = S(d, h);
2867
+ _ ? H(t.errors, h, _) : J(t.errors, h);
2868
2868
  }
2869
2869
  else
2870
- t.errors = f;
2871
- return f;
2872
- }, T = async (u, f, h = {
2870
+ t.errors = d;
2871
+ return d;
2872
+ }, D = async (u, d, h = {
2873
2873
  valid: !0
2874
2874
  }) => {
2875
- for (const w in u) {
2876
- const y = u[w];
2875
+ for (const _ in u) {
2876
+ const y = u[_];
2877
2877
  if (y) {
2878
- const { _f: x, ...E } = y;
2878
+ const { _f: x, ...I } = y;
2879
2879
  if (x) {
2880
- const B = o.array.has(x.name), P = y._f && za(y._f);
2881
- P && b.validatingFields && A([x.name], !0);
2882
- const ne = await Fr(y, o.disabled, a, _, r.shouldUseNativeValidation && !f, B);
2883
- if (P && b.validatingFields && A([x.name]), ne[x.name] && (h.valid = !1, f || e.shouldUseNativeValidation))
2880
+ const $ = o.array.has(x.name), P = y._f && Ha(y._f);
2881
+ P && g.validatingFields && A([x.name], !0);
2882
+ const ne = await Fr(y, o.disabled, i, k, r.shouldUseNativeValidation && !d, $);
2883
+ if (P && g.validatingFields && A([x.name]), ne[x.name] && (h.valid = !1, d || e.shouldUseNativeValidation))
2884
2884
  break;
2885
- !f && (S(ne, x.name) ? B ? Xa(t.errors, ne, x.name) : z(t.errors, x.name, ne[x.name]) : J(t.errors, x.name));
2885
+ !d && (S(ne, x.name) ? $ ? Ya(t.errors, ne, x.name) : H(t.errors, x.name, ne[x.name]) : J(t.errors, x.name));
2886
2886
  }
2887
- !ie(E) && await T(E, f, h);
2887
+ !ie(I) && await D(I, d, h);
2888
2888
  }
2889
2889
  }
2890
2890
  return h.valid;
2891
2891
  }, j = () => {
2892
2892
  for (const u of o.unMount) {
2893
- const f = S(s, u);
2894
- f && (f._f.refs ? f._f.refs.every((h) => !Tt(h)) : !Tt(f._f.ref)) && qe(u);
2893
+ const d = S(s, u);
2894
+ d && (d._f.refs ? d._f.refs.every((h) => !Dt(h)) : !Dt(d._f.ref)) && qe(u);
2895
2895
  }
2896
2896
  o.unMount = /* @__PURE__ */ new Set();
2897
- }, I = (u, f) => !r.disabled && (u && f && z(a, u, f), !Ve(rt(), n)), F = (u, f, h) => ja(u, o, {
2898
- ...i.mount ? a : K(f) ? n : ue(u) ? { [u]: f } : f
2899
- }, h, f), $ = (u) => Xt(S(i.mount ? a : n, u, r.shouldUnregister ? S(n, u, []) : [])), L = (u, f, h = {}) => {
2900
- const w = S(s, u);
2901
- let y = f;
2902
- if (w) {
2903
- const x = w._f;
2904
- x && (!x.disabled && z(a, u, vs(f, x)), y = bt(x.ref) && oe(f) ? "" : f, ys(x.ref) ? [...x.ref.options].forEach((E) => E.selected = y.includes(E.value)) : x.refs ? ft(x.ref) ? x.refs.forEach((E) => {
2905
- (!E.defaultChecked || !E.disabled) && (Array.isArray(y) ? E.checked = !!y.find((B) => B === E.value) : E.checked = y === E.value || !!y);
2906
- }) : x.refs.forEach((E) => E.checked = E.value === y) : Qt(x.ref) ? x.ref.value = "" : (x.ref.value = y, x.ref.type || m.state.next({
2897
+ }, E = (u, d) => !r.disabled && (u && d && H(i, u, d), !Ve(rt(), n)), F = (u, d, h) => $a(u, o, {
2898
+ ...a.mount ? i : G(d) ? n : ue(u) ? { [u]: d } : d
2899
+ }, h, d), B = (u) => Xt(S(a.mount ? i : n, u, r.shouldUnregister ? S(n, u, []) : [])), L = (u, d, h = {}) => {
2900
+ const _ = S(s, u);
2901
+ let y = d;
2902
+ if (_) {
2903
+ const x = _._f;
2904
+ x && (!x.disabled && H(i, u, vs(d, x)), y = bt(x.ref) && oe(d) ? "" : d, ys(x.ref) ? [...x.ref.options].forEach((I) => I.selected = y.includes(I.value)) : x.refs ? ft(x.ref) ? x.refs.forEach((I) => {
2905
+ (!I.defaultChecked || !I.disabled) && (Array.isArray(y) ? I.checked = !!y.find(($) => $ === I.value) : I.checked = y === I.value || !!y);
2906
+ }) : x.refs.forEach((I) => I.checked = I.value === y) : Qt(x.ref) ? x.ref.value = "" : (x.ref.value = y, x.ref.type || b.state.next({
2907
2907
  name: u,
2908
- values: Q(a)
2908
+ values: Q(i)
2909
2909
  })));
2910
2910
  }
2911
- (h.shouldDirty || h.shouldTouch) && ee(u, y, h.shouldTouch, h.shouldDirty, !0), h.shouldValidate && H(u);
2912
- }, W = (u, f, h) => {
2913
- for (const w in f) {
2914
- if (!f.hasOwnProperty(w))
2911
+ (h.shouldDirty || h.shouldTouch) && ee(u, y, h.shouldTouch, h.shouldDirty, !0), h.shouldValidate && z(u);
2912
+ }, W = (u, d, h) => {
2913
+ for (const _ in d) {
2914
+ if (!d.hasOwnProperty(_))
2915
2915
  return;
2916
- const y = f[w], x = u + "." + w, E = S(s, x);
2917
- (o.array.has(u) || Z(y) || E && !E._f) && !De(y) ? W(x, y, h) : L(x, y, h);
2916
+ const y = d[_], x = u + "." + _, I = S(s, x);
2917
+ (o.array.has(u) || Z(y) || I && !I._f) && !Te(y) ? W(x, y, h) : L(x, y, h);
2918
2918
  }
2919
- }, U = (u, f, h = {}) => {
2920
- const w = S(s, u), y = o.array.has(u), x = Q(f);
2921
- z(a, u, x), y ? (m.array.next({
2919
+ }, U = (u, d, h = {}) => {
2920
+ const _ = S(s, u), y = o.array.has(u), x = Q(d);
2921
+ H(i, u, x), y ? (b.array.next({
2922
2922
  name: u,
2923
- values: Q(a)
2924
- }), (b.isDirty || b.dirtyFields || p.isDirty || p.dirtyFields) && h.shouldDirty && m.state.next({
2923
+ values: Q(i)
2924
+ }), (g.isDirty || g.dirtyFields || m.isDirty || m.dirtyFields) && h.shouldDirty && b.state.next({
2925
2925
  name: u,
2926
- dirtyFields: Ke(n, a),
2927
- isDirty: I(u, x)
2928
- })) : w && !w._f && !oe(x) ? W(u, x, h) : L(u, x, h), Ar(u, o) ? m.state.next({
2926
+ dirtyFields: Ke(n, i),
2927
+ isDirty: E(u, x)
2928
+ })) : _ && !_._f && !oe(x) ? W(u, x, h) : L(u, x, h), Ar(u, o) ? b.state.next({
2929
2929
  ...t,
2930
2930
  name: u,
2931
- values: Q(a)
2932
- }) : m.state.next({
2933
- name: i.mount ? u : void 0,
2934
- values: Q(a)
2931
+ values: Q(i)
2932
+ }) : b.state.next({
2933
+ name: a.mount ? u : void 0,
2934
+ values: Q(i)
2935
2935
  });
2936
2936
  }, te = async (u) => {
2937
- i.mount = !0;
2938
- const f = u.target;
2939
- let h = f.name, w = !0;
2937
+ a.mount = !0;
2938
+ const d = u.target;
2939
+ let h = d.name, _ = !0;
2940
2940
  const y = S(s, h), x = (P) => {
2941
- w = Number.isNaN(P) || De(P) && isNaN(P.getTime()) || Ve(P, S(a, h, P));
2942
- }, E = Cr(r.mode), B = Cr(r.reValidateMode);
2941
+ _ = Number.isNaN(P) || Te(P) && isNaN(P.getTime()) || Ve(P, S(i, h, P));
2942
+ }, I = Cr(r.mode), $ = Cr(r.reValidateMode);
2943
2943
  if (y) {
2944
2944
  let P, ne;
2945
- const Te = f.type ? kr(y._f) : Ma(u), Ee = u.type === gr.BLUR || u.type === gr.FOCUS_OUT, _s = !Ha(y._f) && !r.resolver && !S(t.errors, h) && !y._f.deps || Ja(Ee, S(t.touchedFields, h), t.isSubmitted, B, E), Et = Ar(h, o, Ee);
2946
- z(a, h, Te), Ee ? (!f || !f.readOnly) && (y._f.onBlur && y._f.onBlur(u), c && c(0)) : y._f.onChange && y._f.onChange(u);
2947
- const It = ee(h, Te, Ee), ks = !ie(It) || Et;
2948
- if (!Ee && m.state.next({
2945
+ const De = d.type ? kr(y._f) : La(u), Ie = u.type === gr.BLUR || u.type === gr.FOCUS_OUT, _s = !Ka(y._f) && !r.resolver && !S(t.errors, h) && !y._f.deps || Za(Ie, S(t.touchedFields, h), t.isSubmitted, $, I), It = Ar(h, o, Ie);
2946
+ H(i, h, De), Ie ? (!d || !d.readOnly) && (y._f.onBlur && y._f.onBlur(u), c && c(0)) : y._f.onChange && y._f.onChange(u);
2947
+ const Et = ee(h, De, Ie), ks = !ie(Et) || It;
2948
+ if (!Ie && b.state.next({
2949
2949
  name: h,
2950
2950
  type: u.type,
2951
- values: Q(a)
2951
+ values: Q(i)
2952
2952
  }), _s)
2953
- return (b.isValid || p.isValid) && (r.mode === "onBlur" ? Ee && C() : Ee || C()), ks && m.state.next({ name: h, ...Et ? {} : It });
2954
- if (!Ee && Et && m.state.next({ ...t }), r.resolver) {
2955
- const { errors: tr } = await G([h]);
2956
- if (A([h]), x(Te), w) {
2957
- const Cs = Er(t.errors, s, h), rr = Er(tr, s, Cs.name || h);
2953
+ return (g.isValid || m.isValid) && (r.mode === "onBlur" ? Ie && C() : Ie || C()), ks && b.state.next({ name: h, ...It ? {} : Et });
2954
+ if (!Ie && It && b.state.next({ ...t }), r.resolver) {
2955
+ const { errors: tr } = await T([h]);
2956
+ if (A([h]), x(De), _) {
2957
+ const Cs = Ir(t.errors, s, h), rr = Ir(tr, s, Cs.name || h);
2958
2958
  P = rr.error, h = rr.name, ne = ie(tr);
2959
2959
  }
2960
2960
  } else
2961
- A([h], !0), P = (await Fr(y, o.disabled, a, _, r.shouldUseNativeValidation))[h], A([h]), x(Te), w && (P ? ne = !1 : (b.isValid || p.isValid) && (ne = await T(s, !0)));
2962
- w && (y._f.deps && (!Array.isArray(y._f.deps) || y._f.deps.length > 0) && H(y._f.deps), N(h, ne, P, It));
2961
+ A([h], !0), P = (await Fr(y, o.disabled, i, k, r.shouldUseNativeValidation))[h], A([h]), x(De), _ && (P ? ne = !1 : (g.isValid || m.isValid) && (ne = await D(s, !0)));
2962
+ _ && (y._f.deps && (!Array.isArray(y._f.deps) || y._f.deps.length > 0) && z(y._f.deps), K(h, ne, P, Et));
2963
2963
  }
2964
- }, X = (u, f) => {
2965
- if (S(t.errors, f) && u.focus)
2964
+ }, X = (u, d) => {
2965
+ if (S(t.errors, d) && u.focus)
2966
2966
  return u.focus(), 1;
2967
- }, H = async (u, f = {}) => {
2968
- let h, w;
2967
+ }, z = async (u, d = {}) => {
2968
+ let h, _;
2969
2969
  const y = ut(u);
2970
2970
  if (r.resolver) {
2971
- const x = await D(K(u) ? u : y);
2972
- h = ie(x), w = u ? !y.some((E) => S(x, E)) : h;
2971
+ const x = await N(G(u) ? u : y);
2972
+ h = ie(x), _ = u ? !y.some((I) => S(x, I)) : h;
2973
2973
  } else
2974
- u ? (w = (await Promise.all(y.map(async (x) => {
2975
- const E = S(s, x);
2976
- return await T(E && E._f ? { [x]: E } : E);
2977
- }))).every(Boolean), !(!w && !t.isValid) && C()) : w = h = await T(s);
2978
- return m.state.next({
2979
- ...!ue(u) || (b.isValid || p.isValid) && h !== t.isValid ? {} : { name: u },
2974
+ u ? (_ = (await Promise.all(y.map(async (x) => {
2975
+ const I = S(s, x);
2976
+ return await D(I && I._f ? { [x]: I } : I);
2977
+ }))).every(Boolean), !(!_ && !t.isValid) && C()) : _ = h = await D(s);
2978
+ return b.state.next({
2979
+ ...!ue(u) || (g.isValid || m.isValid) && h !== t.isValid ? {} : { name: u },
2980
2980
  ...r.resolver || !u ? { isValid: h } : {},
2981
2981
  errors: t.errors
2982
- }), f.shouldFocus && !w && dt(s, X, u ? y : o.mount), w;
2983
- }, rt = (u, f) => {
2982
+ }), d.shouldFocus && !_ && dt(s, X, u ? y : o.mount), _;
2983
+ }, rt = (u, d) => {
2984
2984
  let h = {
2985
- ...i.mount ? a : n
2985
+ ...a.mount ? i : n
2986
2986
  };
2987
- return f && (h = ms(f.dirtyFields ? t.dirtyFields : t.touchedFields, h)), K(u) ? h : ue(u) ? S(h, u) : u.map((w) => S(h, w));
2988
- }, Be = (u, f) => ({
2989
- invalid: !!S((f || t).errors, u),
2990
- isDirty: !!S((f || t).dirtyFields, u),
2991
- error: S((f || t).errors, u),
2987
+ return d && (h = ms(d.dirtyFields ? t.dirtyFields : t.touchedFields, h)), G(u) ? h : ue(u) ? S(h, u) : u.map((_) => S(h, _));
2988
+ }, $e = (u, d) => ({
2989
+ invalid: !!S((d || t).errors, u),
2990
+ isDirty: !!S((d || t).dirtyFields, u),
2991
+ error: S((d || t).errors, u),
2992
2992
  isValidating: !!S(t.validatingFields, u),
2993
- isTouched: !!S((f || t).touchedFields, u)
2993
+ isTouched: !!S((d || t).touchedFields, u)
2994
2994
  }), O = (u) => {
2995
- const f = u ? ut(u) : void 0;
2996
- f == null || f.forEach((h) => J(t.errors, h)), f ? f.forEach((h) => {
2997
- m.state.next({
2995
+ const d = u ? ut(u) : void 0;
2996
+ d == null || d.forEach((h) => J(t.errors, h)), d ? d.forEach((h) => {
2997
+ b.state.next({
2998
2998
  name: h,
2999
2999
  errors: t.errors
3000
3000
  });
3001
- }) : m.state.next({
3001
+ }) : b.state.next({
3002
3002
  errors: {}
3003
3003
  });
3004
- }, $e = (u, f, h) => {
3005
- const w = (S(s, u, { _f: {} })._f || {}).ref, y = S(t.errors, u) || {}, { ref: x, message: E, type: B, ...P } = y;
3006
- z(t.errors, u, {
3004
+ }, Be = (u, d, h) => {
3005
+ const _ = (S(s, u, { _f: {} })._f || {}).ref, y = S(t.errors, u) || {}, { ref: x, message: I, type: $, ...P } = y;
3006
+ H(t.errors, u, {
3007
3007
  ...P,
3008
- ...f,
3009
- ref: w
3010
- }), m.state.next({
3008
+ ...d,
3009
+ ref: _
3010
+ }), b.state.next({
3011
3011
  name: u,
3012
3012
  errors: t.errors,
3013
3013
  isValid: !1
3014
- }), h && h.shouldFocus && w && w.focus && w.focus();
3015
- }, Pe = (u, f) => de(u) ? m.state.subscribe({
3016
- next: (h) => "values" in h && u(F(void 0, f), h)
3017
- }) : F(u, f, !0), Ae = (u) => m.state.subscribe({
3018
- next: (f) => {
3019
- Ga(u.name, f.name, u.exact) && Ka(f, u.formState || b, mt, u.reRenderRoot) && u.callback({
3020
- values: { ...a },
3014
+ }), h && h.shouldFocus && _ && _.focus && _.focus();
3015
+ }, Pe = (u, d) => de(u) ? b.state.subscribe({
3016
+ next: (h) => "values" in h && u(F(void 0, d), h)
3017
+ }) : F(u, d, !0), Ae = (u) => b.state.subscribe({
3018
+ next: (d) => {
3019
+ Ja(u.name, d.name, u.exact) && Ga(d, u.formState || g, mt, u.reRenderRoot) && u.callback({
3020
+ values: { ...i },
3021
3021
  ...t,
3022
- ...f,
3022
+ ...d,
3023
3023
  defaultValues: n
3024
3024
  });
3025
3025
  }
3026
- }).unsubscribe, Re = (u) => (i.mount = !0, p = {
3027
- ...p,
3026
+ }).unsubscribe, Re = (u) => (a.mount = !0, m = {
3027
+ ...m,
3028
3028
  ...u.formState
3029
3029
  }, Ae({
3030
3030
  ...u,
3031
3031
  formState: {
3032
- ...g,
3032
+ ...p,
3033
3033
  ...u.formState
3034
3034
  }
3035
- })), qe = (u, f = {}) => {
3035
+ })), qe = (u, d = {}) => {
3036
3036
  for (const h of u ? ut(u) : o.mount)
3037
- o.mount.delete(h), o.array.delete(h), f.keepValue || (J(s, h), J(a, h)), !f.keepError && J(t.errors, h), !f.keepDirty && J(t.dirtyFields, h), !f.keepTouched && J(t.touchedFields, h), !f.keepIsValidating && J(t.validatingFields, h), !r.shouldUnregister && !f.keepDefaultValue && J(n, h);
3038
- m.state.next({
3039
- values: Q(a)
3040
- }), m.state.next({
3037
+ o.mount.delete(h), o.array.delete(h), d.keepValue || (J(s, h), J(i, h)), !d.keepError && J(t.errors, h), !d.keepDirty && J(t.dirtyFields, h), !d.keepTouched && J(t.touchedFields, h), !d.keepIsValidating && J(t.validatingFields, h), !r.shouldUnregister && !d.keepDefaultValue && J(n, h);
3038
+ b.state.next({
3039
+ values: Q(i)
3040
+ }), b.state.next({
3041
3041
  ...t,
3042
- ...f.keepDirty ? { isDirty: I() } : {}
3043
- }), !f.keepIsValid && C();
3044
- }, st = ({ disabled: u, name: f }) => {
3045
- if (me(u) && i.mount || u || o.disabled.has(f)) {
3046
- const y = o.disabled.has(f) !== !!u;
3047
- u ? o.disabled.add(f) : o.disabled.delete(f), y && i.mount && !i.action && C();
3042
+ ...d.keepDirty ? { isDirty: E() } : {}
3043
+ }), !d.keepIsValid && C();
3044
+ }, st = ({ disabled: u, name: d }) => {
3045
+ if (me(u) && a.mount || u || o.disabled.has(d)) {
3046
+ const y = o.disabled.has(d) !== !!u;
3047
+ u ? o.disabled.add(d) : o.disabled.delete(d), y && a.mount && !a.action && C();
3048
3048
  }
3049
- }, ve = (u, f = {}) => {
3049
+ }, ve = (u, d = {}) => {
3050
3050
  let h = S(s, u);
3051
- const w = me(f.disabled) || me(r.disabled);
3052
- return z(s, u, {
3051
+ const _ = me(d.disabled) || me(r.disabled);
3052
+ return H(s, u, {
3053
3053
  ...h || {},
3054
3054
  _f: {
3055
3055
  ...h && h._f ? h._f : { ref: { name: u } },
3056
3056
  name: u,
3057
3057
  mount: !0,
3058
- ...f
3058
+ ...d
3059
3059
  }
3060
3060
  }), o.mount.add(u), h ? st({
3061
- disabled: me(f.disabled) ? f.disabled : r.disabled,
3061
+ disabled: me(d.disabled) ? d.disabled : r.disabled,
3062
3062
  name: u
3063
- }) : M(u, !0, f.value), {
3064
- ...w ? { disabled: f.disabled || r.disabled } : {},
3063
+ }) : M(u, !0, d.value), {
3064
+ ..._ ? { disabled: d.disabled || r.disabled } : {},
3065
3065
  ...r.progressive ? {
3066
- required: !!f.required,
3067
- min: it(f.min),
3068
- max: it(f.max),
3069
- minLength: it(f.minLength),
3070
- maxLength: it(f.maxLength),
3071
- pattern: it(f.pattern)
3066
+ required: !!d.required,
3067
+ min: it(d.min),
3068
+ max: it(d.max),
3069
+ minLength: it(d.minLength),
3070
+ maxLength: it(d.maxLength),
3071
+ pattern: it(d.pattern)
3072
3072
  } : {},
3073
3073
  name: u,
3074
3074
  onChange: te,
3075
3075
  onBlur: te,
3076
3076
  ref: (y) => {
3077
3077
  if (y) {
3078
- ve(u, f), h = S(s, u);
3079
- const x = K(y.value) && y.querySelectorAll && y.querySelectorAll("input,select,textarea")[0] || y, E = $a(x), B = h._f.refs || [];
3080
- if (E ? B.find((P) => P === x) : x === h._f.ref)
3078
+ ve(u, d), h = S(s, u);
3079
+ const x = G(y.value) && y.querySelectorAll && y.querySelectorAll("input,select,textarea")[0] || y, I = Pa(x), $ = h._f.refs || [];
3080
+ if (I ? $.find((P) => P === x) : x === h._f.ref)
3081
3081
  return;
3082
- z(s, u, {
3082
+ H(s, u, {
3083
3083
  _f: {
3084
3084
  ...h._f,
3085
- ...E ? {
3085
+ ...I ? {
3086
3086
  refs: [
3087
- ...B.filter(Tt),
3087
+ ...$.filter(Dt),
3088
3088
  x,
3089
3089
  ...Array.isArray(S(n, u)) ? [{}] : []
3090
3090
  ],
@@ -3093,69 +3093,69 @@ function Qa(e = {}) {
3093
3093
  }
3094
3094
  }), M(u, !1, void 0, x);
3095
3095
  } else
3096
- h = S(s, u, {}), h._f && (h._f.mount = !1), (r.shouldUnregister || f.shouldUnregister) && !(Ra(o.array, u) && i.action) && o.unMount.add(u);
3096
+ h = S(s, u, {}), h._f && (h._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(Na(o.array, u) && a.action) && o.unMount.add(u);
3097
3097
  }
3098
3098
  };
3099
3099
  }, Ue = () => r.shouldFocusError && dt(s, X, o.mount), ht = (u) => {
3100
- me(u) && (m.state.next({ disabled: u }), dt(s, (f, h) => {
3101
- const w = S(s, h);
3102
- w && (f.disabled = w._f.disabled || u, Array.isArray(w._f.refs) && w._f.refs.forEach((y) => {
3103
- y.disabled = w._f.disabled || u;
3100
+ me(u) && (b.state.next({ disabled: u }), dt(s, (d, h) => {
3101
+ const _ = S(s, h);
3102
+ _ && (d.disabled = _._f.disabled || u, Array.isArray(_._f.refs) && _._f.refs.forEach((y) => {
3103
+ y.disabled = _._f.disabled || u;
3104
3104
  }));
3105
3105
  }, 0, !1));
3106
- }, We = (u, f) => async (h) => {
3107
- let w;
3106
+ }, We = (u, d) => async (h) => {
3107
+ let _;
3108
3108
  h && (h.preventDefault && h.preventDefault(), h.persist && h.persist());
3109
- let y = Q(a);
3110
- if (m.state.next({
3109
+ let y = Q(i);
3110
+ if (b.state.next({
3111
3111
  isSubmitting: !0
3112
3112
  }), r.resolver) {
3113
- const { errors: x, values: E } = await G();
3114
- A(), t.errors = x, y = Q(E);
3113
+ const { errors: x, values: I } = await T();
3114
+ A(), t.errors = x, y = Q(I);
3115
3115
  } else
3116
- await T(s);
3116
+ await D(s);
3117
3117
  if (o.disabled.size)
3118
3118
  for (const x of o.disabled)
3119
3119
  J(y, x);
3120
3120
  if (J(t.errors, "root"), ie(t.errors)) {
3121
- m.state.next({
3121
+ b.state.next({
3122
3122
  errors: {}
3123
3123
  });
3124
3124
  try {
3125
3125
  await u(y, h);
3126
3126
  } catch (x) {
3127
- w = x;
3127
+ _ = x;
3128
3128
  }
3129
3129
  } else
3130
- f && await f({ ...t.errors }, h), Ue(), setTimeout(Ue);
3131
- if (m.state.next({
3130
+ d && await d({ ...t.errors }, h), Ue(), setTimeout(Ue);
3131
+ if (b.state.next({
3132
3132
  isSubmitted: !0,
3133
3133
  isSubmitting: !1,
3134
- isSubmitSuccessful: ie(t.errors) && !w,
3134
+ isSubmitSuccessful: ie(t.errors) && !_,
3135
3135
  submitCount: t.submitCount + 1,
3136
3136
  errors: t.errors
3137
- }), w)
3138
- throw w;
3139
- }, ze = (u, f = {}) => {
3140
- S(s, u) && (K(f.defaultValue) ? U(u, Q(S(n, u))) : (U(u, f.defaultValue), z(n, u, Q(f.defaultValue))), f.keepTouched || J(t.touchedFields, u), f.keepDirty || (J(t.dirtyFields, u), t.isDirty = f.defaultValue ? I(u, Q(S(n, u))) : I()), f.keepError || (J(t.errors, u), b.isValid && C()), m.state.next({ ...t }));
3141
- }, Ne = (u, f = {}) => {
3142
- const h = u ? Q(u) : n, w = Q(h), y = ie(u), x = y ? n : w;
3143
- if (f.keepDefaultValues || (n = h), !f.keepValues) {
3144
- if (f.keepDirtyValues) {
3145
- const E = /* @__PURE__ */ new Set([
3137
+ }), _)
3138
+ throw _;
3139
+ }, ze = (u, d = {}) => {
3140
+ S(s, u) && (G(d.defaultValue) ? U(u, Q(S(n, u))) : (U(u, d.defaultValue), H(n, u, Q(d.defaultValue))), d.keepTouched || J(t.touchedFields, u), d.keepDirty || (J(t.dirtyFields, u), t.isDirty = d.defaultValue ? E(u, Q(S(n, u))) : E()), d.keepError || (J(t.errors, u), g.isValid && C()), b.state.next({ ...t }));
3141
+ }, Ne = (u, d = {}) => {
3142
+ const h = u ? Q(u) : n, _ = Q(h), y = ie(u), x = y ? n : _;
3143
+ if (d.keepDefaultValues || (n = h), !d.keepValues) {
3144
+ if (d.keepDirtyValues) {
3145
+ const I = /* @__PURE__ */ new Set([
3146
3146
  ...o.mount,
3147
- ...Object.keys(Ke(n, a))
3147
+ ...Object.keys(Ke(n, i))
3148
3148
  ]);
3149
- for (const B of Array.from(E)) {
3150
- const P = S(t.dirtyFields, B), ne = S(a, B), Te = S(x, B);
3151
- P && !K(ne) ? z(x, B, ne) : !P && !K(Te) && U(B, Te);
3149
+ for (const $ of Array.from(I)) {
3150
+ const P = S(t.dirtyFields, $), ne = S(i, $), De = S(x, $);
3151
+ P && !G(ne) ? H(x, $, ne) : !P && !G(De) && U($, De);
3152
3152
  }
3153
3153
  } else {
3154
- if (Zt && K(u))
3155
- for (const E of o.mount) {
3156
- const B = S(s, E);
3157
- if (B && B._f) {
3158
- const P = Array.isArray(B._f.refs) ? B._f.refs[0] : B._f.ref;
3154
+ if (Zt && G(u))
3155
+ for (const I of o.mount) {
3156
+ const $ = S(s, I);
3157
+ if ($ && $._f) {
3158
+ const P = Array.isArray($._f.refs) ? $._f.refs[0] : $._f.ref;
3159
3159
  if (bt(P)) {
3160
3160
  const ne = P.closest("form");
3161
3161
  if (ne) {
@@ -3165,43 +3165,43 @@ function Qa(e = {}) {
3165
3165
  }
3166
3166
  }
3167
3167
  }
3168
- if (f.keepFieldsRef)
3169
- for (const E of o.mount)
3170
- U(E, S(x, E));
3168
+ if (d.keepFieldsRef)
3169
+ for (const I of o.mount)
3170
+ U(I, S(x, I));
3171
3171
  else
3172
3172
  s = {};
3173
3173
  }
3174
- a = r.shouldUnregister ? f.keepDefaultValues ? Q(n) : {} : Q(x), m.array.next({
3174
+ i = r.shouldUnregister ? d.keepDefaultValues ? Q(n) : {} : Q(x), b.array.next({
3175
3175
  values: { ...x }
3176
- }), m.state.next({
3176
+ }), b.state.next({
3177
3177
  values: { ...x }
3178
3178
  });
3179
3179
  }
3180
3180
  o = {
3181
- mount: f.keepDirtyValues ? o.mount : /* @__PURE__ */ new Set(),
3181
+ mount: d.keepDirtyValues ? o.mount : /* @__PURE__ */ new Set(),
3182
3182
  unMount: /* @__PURE__ */ new Set(),
3183
3183
  array: /* @__PURE__ */ new Set(),
3184
3184
  disabled: /* @__PURE__ */ new Set(),
3185
3185
  watch: /* @__PURE__ */ new Set(),
3186
3186
  watchAll: !1,
3187
3187
  focus: ""
3188
- }, i.mount = !b.isValid || !!f.keepIsValid || !!f.keepDirtyValues || !r.shouldUnregister && !ie(x), i.watch = !!r.shouldUnregister, i.keepIsValid = !!f.keepIsValid, i.action = !1, f.keepErrors || (t.errors = {}), m.state.next({
3189
- submitCount: f.keepSubmitCount ? t.submitCount : 0,
3190
- isDirty: y ? !1 : f.keepDirty ? t.isDirty : !!(f.keepDefaultValues && !Ve(u, n)),
3191
- isSubmitted: f.keepIsSubmitted ? t.isSubmitted : !1,
3192
- dirtyFields: y ? {} : f.keepDirtyValues ? f.keepDefaultValues && a ? Ke(n, a) : t.dirtyFields : f.keepDefaultValues && u ? Ke(n, u) : f.keepDirty ? t.dirtyFields : {},
3193
- touchedFields: f.keepTouched ? t.touchedFields : {},
3194
- errors: f.keepErrors ? t.errors : {},
3195
- isSubmitSuccessful: f.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
3188
+ }, a.mount = !g.isValid || !!d.keepIsValid || !!d.keepDirtyValues || !r.shouldUnregister && !ie(x), a.watch = !!r.shouldUnregister, a.keepIsValid = !!d.keepIsValid, a.action = !1, d.keepErrors || (t.errors = {}), b.state.next({
3189
+ submitCount: d.keepSubmitCount ? t.submitCount : 0,
3190
+ isDirty: y ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Ve(u, n)),
3191
+ isSubmitted: d.keepIsSubmitted ? t.isSubmitted : !1,
3192
+ dirtyFields: y ? {} : d.keepDirtyValues ? d.keepDefaultValues && i ? Ke(n, i) : t.dirtyFields : d.keepDefaultValues && u ? Ke(n, u) : d.keepDirty ? t.dirtyFields : {},
3193
+ touchedFields: d.keepTouched ? t.touchedFields : {},
3194
+ errors: d.keepErrors ? t.errors : {},
3195
+ isSubmitSuccessful: d.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
3196
3196
  isSubmitting: !1,
3197
3197
  defaultValues: n
3198
3198
  });
3199
- }, nt = (u, f) => Ne(de(u) ? u(a) : u, { ...r.resetOptions, ...f }), pt = (u, f = {}) => {
3200
- const h = S(s, u), w = h && h._f;
3201
- if (w) {
3202
- const y = w.refs ? w.refs[0] : w.ref;
3199
+ }, nt = (u, d) => Ne(de(u) ? u(i) : u, { ...r.resetOptions, ...d }), pt = (u, d = {}) => {
3200
+ const h = S(s, u), _ = h && h._f;
3201
+ if (_) {
3202
+ const y = _.refs ? _.refs[0] : _.ref;
3203
3203
  y.focus && setTimeout(() => {
3204
- y.focus(), f.shouldSelect && de(y.select) && y.select();
3204
+ y.focus(), d.shouldSelect && de(y.select) && y.select();
3205
3205
  });
3206
3206
  }
3207
3207
  }, mt = (u) => {
@@ -3213,41 +3213,41 @@ function Qa(e = {}) {
3213
3213
  control: {
3214
3214
  register: ve,
3215
3215
  unregister: qe,
3216
- getFieldState: Be,
3216
+ getFieldState: $e,
3217
3217
  handleSubmit: We,
3218
- setError: $e,
3218
+ setError: Be,
3219
3219
  _subscribe: Ae,
3220
- _runSchema: G,
3220
+ _runSchema: T,
3221
3221
  _updateIsValidating: A,
3222
3222
  _focusError: Ue,
3223
3223
  _getWatch: F,
3224
- _getDirty: I,
3224
+ _getDirty: E,
3225
3225
  _setValid: C,
3226
3226
  _setFieldArray: v,
3227
3227
  _setDisabledField: st,
3228
3228
  _setErrors: V,
3229
- _getFieldArray: $,
3229
+ _getFieldArray: B,
3230
3230
  _reset: Ne,
3231
3231
  _resetDefaultValues: () => de(r.defaultValues) && r.defaultValues().then((u) => {
3232
- nt(u, r.resetOptions), m.state.next({
3232
+ nt(u, r.resetOptions), b.state.next({
3233
3233
  isLoading: !1
3234
3234
  });
3235
3235
  }),
3236
3236
  _removeUnmounted: j,
3237
3237
  _disableForm: ht,
3238
- _subjects: m,
3239
- _proxyFormState: b,
3238
+ _subjects: b,
3239
+ _proxyFormState: g,
3240
3240
  get _fields() {
3241
3241
  return s;
3242
3242
  },
3243
3243
  get _formValues() {
3244
- return a;
3244
+ return i;
3245
3245
  },
3246
3246
  get _state() {
3247
- return i;
3247
+ return a;
3248
3248
  },
3249
3249
  set _state(u) {
3250
- i = u;
3250
+ a = u;
3251
3251
  },
3252
3252
  get _defaultValues() {
3253
3253
  return n;
@@ -3272,7 +3272,7 @@ function Qa(e = {}) {
3272
3272
  }
3273
3273
  },
3274
3274
  subscribe: Re,
3275
- trigger: H,
3275
+ trigger: z,
3276
3276
  register: ve,
3277
3277
  handleSubmit: We,
3278
3278
  watch: Pe,
@@ -3282,9 +3282,9 @@ function Qa(e = {}) {
3282
3282
  resetField: ze,
3283
3283
  clearErrors: O,
3284
3284
  unregister: qe,
3285
- setError: $e,
3285
+ setError: Be,
3286
3286
  setFocus: pt,
3287
- getFieldState: Be
3287
+ getFieldState: $e
3288
3288
  };
3289
3289
  return {
3290
3290
  ...at,
@@ -3316,86 +3316,86 @@ function Ct(e = {}) {
3316
3316
  formState: s
3317
3317
  }, e.defaultValues && !de(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
3318
3318
  else {
3319
- const { formControl: i, ...o } = Qa(e);
3319
+ const { formControl: a, ...o } = ei(e);
3320
3320
  r.current = {
3321
3321
  ...o,
3322
3322
  formState: s
3323
3323
  };
3324
3324
  }
3325
- const a = r.current.control;
3326
- return a._options = e, Oa(() => {
3327
- const i = a._subscribe({
3328
- formState: a._proxyFormState,
3329
- callback: () => n({ ...a._formState }),
3325
+ const i = r.current.control;
3326
+ return i._options = e, ja(() => {
3327
+ const a = i._subscribe({
3328
+ formState: i._proxyFormState,
3329
+ callback: () => n({ ...i._formState }),
3330
3330
  reRenderRoot: !0
3331
3331
  });
3332
3332
  return n((o) => ({
3333
3333
  ...o,
3334
3334
  isReady: !0
3335
- })), a._formState.isReady = !0, i;
3336
- }, [a]), ae.useEffect(() => a._disableForm(e.disabled), [a, e.disabled]), ae.useEffect(() => {
3337
- e.mode && (a._options.mode = e.mode), e.reValidateMode && (a._options.reValidateMode = e.reValidateMode);
3338
- }, [a, e.mode, e.reValidateMode]), ae.useEffect(() => {
3339
- e.errors && (a._setErrors(e.errors), a._focusError());
3340
- }, [a, e.errors]), ae.useEffect(() => {
3341
- e.shouldUnregister && a._subjects.state.next({
3342
- values: a._getWatch()
3335
+ })), i._formState.isReady = !0, a;
3336
+ }, [i]), ae.useEffect(() => i._disableForm(e.disabled), [i, e.disabled]), ae.useEffect(() => {
3337
+ e.mode && (i._options.mode = e.mode), e.reValidateMode && (i._options.reValidateMode = e.reValidateMode);
3338
+ }, [i, e.mode, e.reValidateMode]), ae.useEffect(() => {
3339
+ e.errors && (i._setErrors(e.errors), i._focusError());
3340
+ }, [i, e.errors]), ae.useEffect(() => {
3341
+ e.shouldUnregister && i._subjects.state.next({
3342
+ values: i._getWatch()
3343
3343
  });
3344
- }, [a, e.shouldUnregister]), ae.useEffect(() => {
3345
- if (a._proxyFormState.isDirty) {
3346
- const i = a._getDirty();
3347
- i !== s.isDirty && a._subjects.state.next({
3348
- isDirty: i
3344
+ }, [i, e.shouldUnregister]), ae.useEffect(() => {
3345
+ if (i._proxyFormState.isDirty) {
3346
+ const a = i._getDirty();
3347
+ a !== s.isDirty && i._subjects.state.next({
3348
+ isDirty: a
3349
3349
  });
3350
3350
  }
3351
- }, [a, s.isDirty]), ae.useEffect(() => {
3352
- var i;
3353
- e.values && !Ve(e.values, t.current) ? (a._reset(e.values, {
3351
+ }, [i, s.isDirty]), ae.useEffect(() => {
3352
+ var a;
3353
+ e.values && !Ve(e.values, t.current) ? (i._reset(e.values, {
3354
3354
  keepFieldsRef: !0,
3355
- ...a._options.resetOptions
3356
- }), !((i = a._options.resetOptions) === null || i === void 0) && i.keepIsValid || a._setValid(), t.current = e.values, n((o) => ({ ...o }))) : a._resetDefaultValues();
3357
- }, [a, e.values]), ae.useEffect(() => {
3358
- a._state.mount || (a._setValid(), a._state.mount = !0), a._state.watch && (a._state.watch = !1, a._subjects.state.next({ ...a._formState })), a._removeUnmounted();
3359
- }), r.current.formState = ae.useMemo(() => Da(s, a), [a, s]), r.current;
3355
+ ...i._options.resetOptions
3356
+ }), !((a = i._options.resetOptions) === null || a === void 0) && a.keepIsValid || i._setValid(), t.current = e.values, n((o) => ({ ...o }))) : i._resetDefaultValues();
3357
+ }, [i, e.values]), ae.useEffect(() => {
3358
+ i._state.mount || (i._setValid(), i._state.mount = !0), i._state.watch && (i._state.watch = !1, i._subjects.state.next({ ...i._formState })), i._removeUnmounted();
3359
+ }), r.current.formState = ae.useMemo(() => Oa(s, i), [i, s]), r.current;
3360
3360
  }
3361
3361
  const Vr = (e, r, t) => {
3362
3362
  if (e && "reportValidity" in e) {
3363
3363
  const s = S(t, r);
3364
3364
  e.setCustomValidity(s && s.message || ""), e.reportValidity();
3365
3365
  }
3366
- }, ei = (e, r) => {
3366
+ }, ti = (e, r) => {
3367
3367
  for (const t in r.fields) {
3368
3368
  const s = r.fields[t];
3369
3369
  s && s.ref && "reportValidity" in s.ref ? Vr(s.ref, t, e) : s.refs && s.refs.forEach((n) => Vr(n, t, e));
3370
3370
  }
3371
- }, ti = (e, r) => {
3372
- r.shouldUseNativeValidation && ei(e, r);
3371
+ }, ri = (e, r) => {
3372
+ r.shouldUseNativeValidation && ti(e, r);
3373
3373
  const t = {};
3374
3374
  for (const s in e) {
3375
- const n = S(r.fields, s), a = Object.assign(e[s] || {}, { ref: n && n.ref });
3376
- if (ri(r.names || Object.keys(e), s)) {
3377
- const i = Object.assign({}, S(t, s));
3378
- z(i, "root", a), z(t, s, i);
3375
+ const n = S(r.fields, s), i = Object.assign(e[s] || {}, { ref: n && n.ref });
3376
+ if (si(r.names || Object.keys(e), s)) {
3377
+ const a = Object.assign({}, S(t, s));
3378
+ H(a, "root", i), H(t, s, a);
3379
3379
  } else
3380
- z(t, s, a);
3380
+ H(t, s, i);
3381
3381
  }
3382
3382
  return t;
3383
- }, ri = (e, r) => e.some((t) => t.startsWith(r + "."));
3383
+ }, si = (e, r) => e.some((t) => t.startsWith(r + "."));
3384
3384
  var St = function(e, r, t) {
3385
- return t === void 0 && (t = {}), function(s, n, a) {
3385
+ return t === void 0 && (t = {}), function(s, n, i) {
3386
3386
  try {
3387
- var i = !a.shouldUseNativeValidation && a.criteriaMode === "all";
3388
- return Promise.resolve(/* @__PURE__ */ ha(e, s, Object.assign({}, r, { abortPipeEarly: !i }))).then(function(o) {
3387
+ var a = !i.shouldUseNativeValidation && i.criteriaMode === "all";
3388
+ return Promise.resolve(/* @__PURE__ */ pa(e, s, Object.assign({}, r, { abortPipeEarly: !a }))).then(function(o) {
3389
3389
  if (o.issues) {
3390
3390
  for (var c = {}; o.issues.length; ) {
3391
- var d = o.issues[0], g = /* @__PURE__ */ ia(d);
3392
- if (g && (c[g] || (c[g] = { message: d.message, type: d.type }), i)) {
3393
- var b = c[g].types, p = b && b[d.type];
3394
- c[g] = ps(g, i, c, d.type, p ? [].concat(p, d.message) : d.message);
3391
+ var f = o.issues[0], p = /* @__PURE__ */ oa(f);
3392
+ if (p && (c[p] || (c[p] = { message: f.message, type: f.type }), a)) {
3393
+ var g = c[p].types, m = g && g[f.type];
3394
+ c[p] = ps(p, a, c, f.type, m ? [].concat(m, f.message) : f.message);
3395
3395
  }
3396
3396
  o.issues.shift();
3397
3397
  }
3398
- return { values: {}, errors: ti(c, a) };
3398
+ return { values: {}, errors: ri(c, i) };
3399
3399
  }
3400
3400
  return { values: t.raw ? s : o.output, errors: {} };
3401
3401
  });
@@ -3404,19 +3404,19 @@ var St = function(e, r, t) {
3404
3404
  }
3405
3405
  };
3406
3406
  };
3407
- const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3407
+ const Mr = 27, Lr = 12, Rr = 10, ni = et("enum"), ai = (e, r) => {
3408
3408
  const t = {
3409
3409
  min: e.minSelected ?? 0,
3410
3410
  max: e.maxSelected ?? e.options.length
3411
3411
  };
3412
3412
  return St(/* @__PURE__ */ Ce({
3413
- checked: /* @__PURE__ */ Me(/* @__PURE__ */ ls(/* @__PURE__ */ le(), /* @__PURE__ */ as()), /* @__PURE__ */ Kt((s) => Object.entries(s).filter(([n, a]) => a).map(([n, a]) => n)), /* @__PURE__ */ ct(t.max, r("validation_multiple_choice_max", {
3413
+ checked: /* @__PURE__ */ Me(/* @__PURE__ */ ls(/* @__PURE__ */ le(), /* @__PURE__ */ as()), /* @__PURE__ */ Kt((s) => Object.entries(s).filter(([n, i]) => i).map(([n, i]) => n)), /* @__PURE__ */ ct(t.max, r("validation_multiple_choice_max", {
3414
3414
  count: t.max
3415
3415
  })), /* @__PURE__ */ Ze(t.min, r("validation_multiple_choice_min", {
3416
3416
  count: t.min
3417
3417
  })))
3418
3418
  }));
3419
- }, ai = Hr(({
3419
+ }, ii = Hr(({
3420
3420
  option: e,
3421
3421
  ...r
3422
3422
  }, t) => l(be, {
@@ -3439,25 +3439,25 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3439
3439
  booleanLike: us
3440
3440
  }
3441
3441
  }
3442
- }), ii = ({
3442
+ }), oi = ({
3443
3443
  input: e,
3444
3444
  onSubmitSuccess: r
3445
3445
  }) => {
3446
- var g, b;
3447
- const t = e.key ? (g = q.current$.value.flow) == null ? void 0 : g.data.submissions[e.key] : void 0, s = e.config.maxSelected === 1, n = s && e.config.options.length === 2, {
3448
- t: a
3446
+ var p, g;
3447
+ const t = e.key ? (p = q.current$.value.flow) == null ? void 0 : p.data.submissions[e.key] : void 0, s = e.config.maxSelected === 1, n = s && e.config.options.length === 2, {
3448
+ t: i
3449
3449
  } = re(), {
3450
- register: i,
3450
+ register: a,
3451
3451
  handleSubmit: o,
3452
3452
  formState: {
3453
3453
  errors: c
3454
3454
  }
3455
3455
  } = Ct({
3456
3456
  defaultValues: {
3457
- checked: s ? {} : si(t) ? Object.fromEntries(t.value.map((p) => [p, !0])) : {}
3457
+ checked: s ? {} : ni(t) ? Object.fromEntries(t.value.map((m) => [m, !0])) : {}
3458
3458
  },
3459
- resolver: ni(e.config, a)
3460
- }), d = Jt();
3459
+ resolver: ai(e.config, i)
3460
+ }), f = Jt();
3461
3461
  return n ? l(be, {
3462
3462
  children: [l("ul", {
3463
3463
  style: {
@@ -3466,21 +3466,21 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3466
3466
  class: Nr({
3467
3467
  variant: "booleanLike"
3468
3468
  }),
3469
- children: e.config.options.map((p, m) => l("li", {
3469
+ children: e.config.options.map((m, b) => l("li", {
3470
3470
  class: ds,
3471
3471
  children: l(fs, {
3472
3472
  type: "submit",
3473
- ref: (_) => {
3474
- _ && m === 0 && (d.current = _);
3473
+ ref: (k) => {
3474
+ k && b === 0 && (f.current = k);
3475
3475
  },
3476
- label: p.label,
3476
+ label: m.label,
3477
3477
  value: "true",
3478
3478
  onClick: () => r({
3479
3479
  type: "enum",
3480
- value: [p.value]
3480
+ value: [m.value]
3481
3481
  })
3482
3482
  })
3483
- }, p.value))
3483
+ }, m.value))
3484
3484
  }), e.config.minSelected === 0 && l("div", {
3485
3485
  class: "px-2 pb-2",
3486
3486
  children: l(Se, {
@@ -3494,13 +3494,13 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3494
3494
  })]
3495
3495
  }) : l("form", {
3496
3496
  noValidate: !0,
3497
- onSubmit: (p) => o((m) => {
3498
- const _ = m.checked;
3497
+ onSubmit: (m) => o((b) => {
3498
+ const k = b.checked;
3499
3499
  r({
3500
3500
  type: "enum",
3501
- value: _
3501
+ value: k
3502
3502
  });
3503
- })(p),
3503
+ })(m),
3504
3504
  children: [l("div", {
3505
3505
  class: "flex items-center gap-1",
3506
3506
  children: [l("ul", {
@@ -3510,27 +3510,27 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3510
3510
  class: Nr({
3511
3511
  variant: e.config.options.length === 1 ? "singleOption" : void 0
3512
3512
  }),
3513
- children: e.config.options.map((p, m) => {
3514
- const _ = `checked.${p.value}`, {
3515
- ref: k,
3513
+ children: e.config.options.map((m, b) => {
3514
+ const k = `checked.${m.value}`, {
3515
+ ref: w,
3516
3516
  ...C
3517
- } = i(_);
3517
+ } = a(k);
3518
3518
  return l("li", {
3519
3519
  class: "relative",
3520
- children: l(ai, {
3521
- option: p,
3522
- autoFocus: m === 0,
3520
+ children: l(ii, {
3521
+ option: m,
3522
+ autoFocus: b === 0,
3523
3523
  ref: (A) => {
3524
- A && m === 0 && (d.current = A), k(A);
3524
+ A && b === 0 && (f.current = A), w(A);
3525
3525
  },
3526
- id: _,
3526
+ id: k,
3527
3527
  ...C,
3528
3528
  onClick: s ? () => r({
3529
3529
  type: "enum",
3530
- value: [p.value]
3530
+ value: [m.value]
3531
3531
  }) : void 0
3532
3532
  })
3533
- }, p.value);
3533
+ }, m.value);
3534
3534
  })
3535
3535
  }), l("div", {
3536
3536
  class: "flex flex-col items-center gap-2 pr-2.5 pt-2.5",
@@ -3546,54 +3546,54 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3546
3546
  }), l("div", {
3547
3547
  class: "px-1",
3548
3548
  children: l(tt, {
3549
- error: (b = c.checked) == null ? void 0 : b.root
3549
+ error: (g = c.checked) == null ? void 0 : g.root
3550
3550
  })
3551
3551
  })]
3552
3552
  });
3553
- }, oi = et("number"), li = (e, r) => {
3553
+ }, li = et("number"), ci = (e, r) => {
3554
3554
  const t = e.min ?? Number.MIN_SAFE_INTEGER, s = e.max ?? Number.MAX_SAFE_INTEGER, n = e.decimalCases ?? 0;
3555
3555
  return St(/* @__PURE__ */ Ce({
3556
3556
  number: /* @__PURE__ */ Me(/* @__PURE__ */ is(r("validation_number")), /* @__PURE__ */ ts(t, r("validation_number_min", {
3557
3557
  min: t
3558
3558
  })), /* @__PURE__ */ es(s, r("validation_number_max", {
3559
3559
  max: s
3560
- })), /* @__PURE__ */ Yr((a) => a === Number(a.toFixed(n)), r("validation_number_decimal_cases", {
3560
+ })), /* @__PURE__ */ Yr((i) => i === Number(i.toFixed(n)), r("validation_number_decimal_cases", {
3561
3561
  count: n
3562
3562
  })))
3563
3563
  }));
3564
- }, ci = ({
3564
+ }, ui = ({
3565
3565
  input: e,
3566
3566
  onSubmitSuccess: r
3567
3567
  }) => {
3568
- var b;
3569
- const t = e.config.defaultValue, s = e.key ? (b = q.current$.value.flow) == null ? void 0 : b.data.submissions[e.key] : void 0, {
3568
+ var g;
3569
+ const t = e.config.defaultValue, s = e.key ? (g = q.current$.value.flow) == null ? void 0 : g.data.submissions[e.key] : void 0, {
3570
3570
  t: n
3571
3571
  } = re(), {
3572
- register: a,
3573
- handleSubmit: i,
3572
+ register: i,
3573
+ handleSubmit: a,
3574
3574
  formState: {
3575
3575
  errors: o
3576
3576
  }
3577
3577
  } = Ct({
3578
3578
  defaultValues: {
3579
- number: oi(s) ? s.value : t ? Number(t) : void 0
3579
+ number: li(s) ? s.value : t ? Number(t) : void 0
3580
3580
  },
3581
- resolver: li(e.config, n)
3581
+ resolver: ci(e.config, n)
3582
3582
  }), {
3583
3583
  ref: c,
3584
- ...d
3585
- } = a("number", {
3584
+ ...f
3585
+ } = i("number", {
3586
3586
  required: !e.config.optional,
3587
3587
  valueAsNumber: !0
3588
- }), g = ye();
3588
+ }), p = ye();
3589
3589
  return Le(() => {
3590
- g.current && (g.current.focus(), g.current.select());
3590
+ p.current && (p.current.focus(), p.current.select());
3591
3591
  }, []), l("form", {
3592
3592
  class: "flex flex-col gap-1 p-2.5",
3593
- onSubmit: i((p) => {
3594
- p.number !== void 0 && r({
3593
+ onSubmit: a((m) => {
3594
+ m.number !== void 0 && r({
3595
3595
  type: "number",
3596
- value: p.number
3596
+ value: m.number
3597
3597
  });
3598
3598
  }),
3599
3599
  children: [l("div", {
@@ -3601,14 +3601,14 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3601
3601
  children: [l("div", {
3602
3602
  class: "relative min-w-0 flex-grow",
3603
3603
  children: [l("input", {
3604
- ...d,
3604
+ ...f,
3605
3605
  id: "chat-input",
3606
3606
  autocomplete: "off",
3607
3607
  autoCapitalize: "off",
3608
3608
  autoCorrect: "off",
3609
3609
  autoFocus: !0,
3610
- ref: (p) => {
3611
- p && (g.current = p), c(p);
3610
+ ref: (m) => {
3611
+ m && (p.current = m), c(m);
3612
3612
  },
3613
3613
  type: "text",
3614
3614
  min: e.config.min,
@@ -3627,54 +3627,54 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3627
3627
  error: o.number
3628
3628
  })]
3629
3629
  });
3630
- }, ui = "44", di = /^[0-9 ]+$/, fi = et("string"), hi = et("phone"), pi = (e) => {
3631
- const r = /* @__PURE__ */ Me(/* @__PURE__ */ le(e("validation_country_code")), /* @__PURE__ */ Ht(di, e("validation_country_code"))), t = /* @__PURE__ */ Me(/* @__PURE__ */ le(e("validation_phone")), /* @__PURE__ */ Ze(1, e("validation_phone")), /* @__PURE__ */ Kt((s) => s.replace(/[^0-9]/g, "")));
3630
+ }, di = "44", fi = /^[0-9 ]+$/, hi = et("string"), pi = et("phone"), mi = (e) => {
3631
+ const r = /* @__PURE__ */ Me(/* @__PURE__ */ le(e("validation_country_code")), /* @__PURE__ */ Ht(fi, e("validation_country_code"))), t = /* @__PURE__ */ Me(/* @__PURE__ */ le(e("validation_phone")), /* @__PURE__ */ Ze(1, e("validation_phone")), /* @__PURE__ */ Kt((s) => s.replace(/[^0-9]/g, "")));
3632
3632
  return St(/* @__PURE__ */ Ce({
3633
3633
  countryCode: r,
3634
3634
  phoneNumber: t
3635
3635
  }));
3636
- }, mi = ({
3636
+ }, yi = ({
3637
3637
  input: e,
3638
3638
  onSubmitSuccess: r
3639
3639
  }) => {
3640
- var k;
3641
- const t = e.key ? (k = q.current$.value.flow) == null ? void 0 : k.data.submissions[e.key] : void 0, {
3640
+ var w;
3641
+ const t = e.key ? (w = q.current$.value.flow) == null ? void 0 : w.data.submissions[e.key] : void 0, {
3642
3642
  t: s
3643
- } = re(), [n, a] = ke(), i = fi(t) ? pa(t.value) : hi(t) ? t.value : void 0, {
3643
+ } = re(), [n, i] = ke(), a = hi(t) ? ma(t.value) : pi(t) ? t.value : void 0, {
3644
3644
  register: o,
3645
3645
  handleSubmit: c,
3646
3646
  formState: {
3647
- errors: d
3647
+ errors: f
3648
3648
  },
3649
- watch: g
3649
+ watch: p
3650
3650
  } = Ct({
3651
3651
  defaultValues: {
3652
- countryCode: (i == null ? void 0 : i.countryCode) ?? e.config.defaultValue.countryCode ?? ui,
3653
- phoneNumber: (i == null ? void 0 : i.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
3652
+ countryCode: (a == null ? void 0 : a.countryCode) ?? e.config.defaultValue.countryCode ?? di,
3653
+ phoneNumber: (a == null ? void 0 : a.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
3654
3654
  },
3655
- resolver: pi(s)
3655
+ resolver: mi(s)
3656
3656
  }), {
3657
- ref: b,
3658
- ...p
3657
+ ref: g,
3658
+ ...m
3659
3659
  } = o("phoneNumber", {
3660
3660
  required: !e.config.optional
3661
- }), m = ye(), _ = g("countryCode");
3661
+ }), b = ye(), k = p("countryCode");
3662
3662
  return Le(() => {
3663
- m.current && (m.current.focus(), m.current.select());
3663
+ b.current && (b.current.focus(), b.current.select());
3664
3664
  }, []), l("form", {
3665
3665
  noValidate: !0,
3666
3666
  class: "flex flex-col gap-1 p-2.5",
3667
3667
  onSubmit: c((C) => {
3668
3668
  const A = C.phoneNumber.replace(/[^0-9]/g, ""), v = C.countryCode.replace(/[^0-9]/g, "");
3669
- a(void 0);
3669
+ i(void 0);
3670
3670
  const R = e.config.minChars ?? 7, V = A.length + v.length;
3671
3671
  if (V < R)
3672
- return a(s("validation_phone_min_chars", {
3672
+ return i(s("validation_phone_min_chars", {
3673
3673
  count: R
3674
3674
  }));
3675
3675
  const M = e.config.maxChars;
3676
3676
  if (M != null && V > M)
3677
- return a(s("validation_max_chars", {
3677
+ return i(s("validation_max_chars", {
3678
3678
  count: M
3679
3679
  }));
3680
3680
  e.config.submissionFormat === "phone" ? r({
@@ -3685,7 +3685,7 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3685
3685
  }
3686
3686
  }) : r({
3687
3687
  type: "string",
3688
- value: _ + C.phoneNumber
3688
+ value: k + C.phoneNumber
3689
3689
  });
3690
3690
  }),
3691
3691
  children: [l("div", {
@@ -3696,7 +3696,7 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3696
3696
  class: "text-neutral-12 bg-lowest hover:bg-neutral-5 placeholder:text-neutral-8 focus-visible:outline-accent-7 focus-within:bg-neutral-5 focus-within:outline-accent-7 outline-divider relative flex h-full cursor-pointer appearance-none items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap rounded-l-full border-solid px-3 py-1.5 text-center text-base outline outline-2 transition-all focus-within:outline-none",
3697
3697
  htmlFor: `isdk_phone_${e.key}`,
3698
3698
  children: [l("span", {
3699
- children: ["+", _]
3699
+ children: ["+", k]
3700
3700
  }), l("select", {
3701
3701
  ...o("countryCode", {}),
3702
3702
  id: `isdk_phone_${e.key}`,
@@ -3707,7 +3707,7 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3707
3707
  }, C))
3708
3708
  })]
3709
3709
  }), l("input", {
3710
- ...p,
3710
+ ...m,
3711
3711
  id: "chat-input",
3712
3712
  type: "tel",
3713
3713
  inputMode: "tel",
@@ -3716,7 +3716,7 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3716
3716
  autoCorrect: "off",
3717
3717
  autoFocus: !0,
3718
3718
  ref: (C) => {
3719
- C && (m.current = C), b(C);
3719
+ C && (b.current = C), g(C);
3720
3720
  },
3721
3721
  class: Ye({
3722
3722
  optional: e.config.optional,
@@ -3729,19 +3729,19 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3729
3729
  })]
3730
3730
  }), l(je, {})]
3731
3731
  }), l(tt, {
3732
- error: d.countryCode || d.phoneNumber || {
3732
+ error: f.countryCode || f.phoneNumber || {
3733
3733
  message: n
3734
3734
  }
3735
3735
  })]
3736
3736
  });
3737
- }, yt = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)), Tr = (e, r, t, s) => t !== void 0 && s * 1e3 > Wr ? e("submission_available_at", {
3737
+ }, yt = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)), Dr = (e, r, t, s) => t !== void 0 && s * 1e3 > Wr ? e("submission_available_at", {
3738
3738
  time: Ur(t, r)
3739
3739
  }) : e("submission_cooldown", {
3740
3740
  count: s
3741
- }), yi = (e, r) => {
3741
+ }), bi = (e, r) => {
3742
3742
  const t = e == null ? void 0 : e.trim();
3743
3743
  return t && t !== "Submit" ? t : r("submit");
3744
- }, bi = ({
3744
+ }, gi = ({
3745
3745
  input: e,
3746
3746
  onSubmitSuccess: r
3747
3747
  }) => {
@@ -3750,26 +3750,26 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3750
3750
  locale: s
3751
3751
  } = re(), {
3752
3752
  availableAt: n
3753
- } = e.config, [a, i] = ke(() => yt(n)), [o, c] = ke("");
3753
+ } = e.config, [i, a] = ke(() => yt(n)), [o, c] = ke("");
3754
3754
  zr(() => {
3755
- const g = yt(n);
3756
- if (i(g), g === 0)
3755
+ const p = yt(n);
3756
+ if (a(p), p === 0)
3757
3757
  return;
3758
- c(Tr(t, s, n, g));
3759
- const b = setInterval(() => {
3760
- const p = yt(n);
3761
- i(p), !(p > 0) && (clearInterval(b), c(t("submission_cooldown_ready")));
3758
+ c(Dr(t, s, n, p));
3759
+ const g = setInterval(() => {
3760
+ const m = yt(n);
3761
+ a(m), !(m > 0) && (clearInterval(g), c(t("submission_cooldown_ready")));
3762
3762
  }, 250);
3763
- return () => clearInterval(b);
3763
+ return () => clearInterval(g);
3764
3764
  }, [n, s, t]);
3765
- const d = a > 0;
3765
+ const f = i > 0;
3766
3766
  return l("div", {
3767
3767
  class: "flex flex-col items-center gap-2 py-3",
3768
3768
  children: [l("button", {
3769
3769
  class: "bg-accent-9 hover:bg-accent-10 active:bg-submit-bg-active hover:border-accent-10 active:border-submit-bg-active border-accent-9 ring-accent-6 focus-visible:outline-accent-8 ring-offset-neutral-1 aria-disabled:hover:bg-accent-9 aria-disabled:hover:border-accent-9 flex cursor-pointer rounded-full border border-solid px-5 py-3 pr-4 text-white outline-none ring-1 ring-offset-[1.5px] transition-all duration-300 focus-visible:outline-2 active:ring-2 active:ring-offset-2 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:active:ring-1 aria-disabled:active:ring-offset-[1.5px]",
3770
3770
  name: e.key,
3771
- "aria-disabled": d,
3772
- "aria-describedby": d ? "submit-cooldown" : void 0,
3771
+ "aria-disabled": f,
3772
+ "aria-describedby": f ? "submit-cooldown" : void 0,
3773
3773
  onClick: () => {
3774
3774
  yt(n) > 0 || r(null);
3775
3775
  },
@@ -3777,7 +3777,7 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3777
3777
  class: "flex items-center gap-1.5",
3778
3778
  children: [l("span", {
3779
3779
  class: "inline-flex items-center text-sm font-medium",
3780
- children: yi(e.config.label, t)
3780
+ children: bi(e.config.label, t)
3781
3781
  }), l("svg", {
3782
3782
  stroke: "currentColor",
3783
3783
  "stroke-width": "1.5",
@@ -3793,20 +3793,20 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3793
3793
  })]
3794
3794
  })]
3795
3795
  })
3796
- }), d && l("p", {
3796
+ }), f && l("p", {
3797
3797
  id: "submit-cooldown",
3798
3798
  "aria-hidden": "true",
3799
3799
  class: "text-neutral-11 text-xs",
3800
- children: Tr(t, s, n, a)
3800
+ children: Dr(t, s, n, i)
3801
3801
  }), l("p", {
3802
3802
  role: "status",
3803
3803
  class: "sr-only",
3804
3804
  children: o
3805
3805
  })]
3806
3806
  });
3807
- }, gi = 160, Dr = (e) => {
3808
- e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, gi)}px`;
3809
- }, vi = {
3807
+ }, vi = 160, Tr = (e) => {
3808
+ e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, vi)}px`;
3809
+ }, xi = {
3810
3810
  date: {
3811
3811
  type: "date",
3812
3812
  inputMode: "text"
@@ -3825,7 +3825,7 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3825
3825
  inputMode: "url",
3826
3826
  formNoValidate: !0
3827
3827
  }
3828
- }, xi = et("string"), wi = (e, r) => {
3828
+ }, wi = et("string"), _i = (e, r) => {
3829
3829
  const t = {
3830
3830
  maxLength: r("validation_max_chars", {
3831
3831
  count: e.maxChars ?? 999
@@ -3842,35 +3842,35 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3842
3842
  url: /* @__PURE__ */ Me(/* @__PURE__ */ le(r("validation_url")), /* @__PURE__ */ rs(r("validation_url")), /* @__PURE__ */ Ze(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ct(e.maxChars ?? 1 / 0, t.maxLength))
3843
3843
  }[e.format]
3844
3844
  }));
3845
- }, _i = ({
3845
+ }, ki = ({
3846
3846
  input: e,
3847
3847
  onSubmitSuccess: r
3848
3848
  }) => {
3849
- var k;
3849
+ var w;
3850
3850
  const {
3851
3851
  t
3852
- } = re(), s = e.key ? (k = q.current$.value.flow) == null ? void 0 : k.data.submissions[e.key] : void 0, n = e.config.defaultValue, a = e.config.multiline === !0 && e.config.format === "text", {
3853
- register: i,
3852
+ } = re(), s = e.key ? (w = q.current$.value.flow) == null ? void 0 : w.data.submissions[e.key] : void 0, n = e.config.defaultValue, i = e.config.multiline === !0 && e.config.format === "text", {
3853
+ register: a,
3854
3854
  handleSubmit: o,
3855
3855
  watch: c,
3856
3856
  formState: {
3857
- errors: d
3857
+ errors: f
3858
3858
  }
3859
3859
  } = Ct({
3860
3860
  defaultValues: {
3861
- text: xi(s) ? s.value : n ?? ""
3861
+ text: wi(s) ? s.value : n ?? ""
3862
3862
  },
3863
- resolver: wi(e.config, t)
3863
+ resolver: _i(e.config, t)
3864
3864
  }), {
3865
- ref: g,
3866
- ...b
3867
- } = i("text", {
3865
+ ref: p,
3866
+ ...g
3867
+ } = a("text", {
3868
3868
  required: !e.config.optional
3869
- }), p = ye();
3869
+ }), m = ye();
3870
3870
  Le(() => {
3871
- p.current && (p.current instanceof HTMLTextAreaElement && Dr(p.current), p.current.focus(), p.current.select());
3871
+ m.current && (m.current instanceof HTMLTextAreaElement && Tr(m.current), m.current.focus(), m.current.select());
3872
3872
  }, []);
3873
- const m = e.config.maxChars, _ = a && m !== void 0 ? c("text").length : void 0;
3873
+ const b = e.config.maxChars, k = i && b !== void 0 ? c("text").length : void 0;
3874
3874
  return l("form", {
3875
3875
  noValidate: !0,
3876
3876
  class: "flex flex-col gap-1 p-2.5",
@@ -3881,23 +3881,23 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3881
3881
  });
3882
3882
  }),
3883
3883
  children: [l("div", {
3884
- class: a ? "flex items-end gap-2" : "flex items-center gap-2",
3884
+ class: i ? "flex items-end gap-2" : "flex items-center gap-2",
3885
3885
  children: [l("div", {
3886
3886
  class: "relative min-w-0 flex-1",
3887
- children: [a ? l("textarea", {
3887
+ children: [i ? l("textarea", {
3888
3888
  id: "chat-input",
3889
- ...b,
3889
+ ...g,
3890
3890
  rows: 2,
3891
- maxLength: m,
3891
+ maxLength: b,
3892
3892
  autoFocus: !0,
3893
- "aria-describedby": _ !== void 0 ? "chat-input-count" : void 0,
3894
- onInput: (C) => Dr(C.currentTarget),
3893
+ "aria-describedby": k !== void 0 ? "chat-input-count" : void 0,
3894
+ onInput: (C) => Tr(C.currentTarget),
3895
3895
  onKeyDown: (C) => {
3896
3896
  var A;
3897
3897
  C.key === "Enter" && (C.ctrlKey || C.metaKey) && (C.preventDefault(), (A = C.currentTarget.form) == null || A.requestSubmit());
3898
3898
  },
3899
3899
  ref: (C) => {
3900
- C && (p.current = C), g(C);
3900
+ C && (m.current = C), p(C);
3901
3901
  },
3902
3902
  placeholder: e.config.placeholder,
3903
3903
  class: Ye({
@@ -3906,14 +3906,14 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3906
3906
  })
3907
3907
  }) : l("input", {
3908
3908
  id: "chat-input",
3909
- ...b,
3910
- ...vi[e.config.format],
3909
+ ...g,
3910
+ ...xi[e.config.format],
3911
3911
  autocomplete: "off",
3912
3912
  autoCapitalize: "off",
3913
3913
  autoCorrect: "off",
3914
3914
  autoFocus: !0,
3915
3915
  ref: (C) => {
3916
- C && (p.current = C), g(C);
3916
+ C && (m.current = C), p(C);
3917
3917
  },
3918
3918
  placeholder: e.config.placeholder,
3919
3919
  class: Ye({
@@ -3923,37 +3923,37 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3923
3923
  }), e.config.optional && l(
3924
3924
  Se,
3925
3925
  {
3926
- class: a ? "absolute bottom-1 right-0.5" : "absolute bottom-0 right-0.5 top-0",
3926
+ class: i ? "absolute bottom-1 right-0.5" : "absolute bottom-0 right-0.5 top-0",
3927
3927
  onClick: () => r(null)
3928
3928
  }
3929
3929
  )]
3930
3930
  }), l(je, {})]
3931
- }), _ !== void 0 && m !== void 0 && l("p", {
3931
+ }), k !== void 0 && b !== void 0 && l("p", {
3932
3932
  id: "chat-input-count",
3933
3933
  class: "text-neutral-10 px-3 text-right text-xs",
3934
- children: [_, "/", m]
3934
+ children: [k, "/", b]
3935
3935
  }), l(tt, {
3936
- error: d.text
3936
+ error: f.text
3937
3937
  })]
3938
3938
  });
3939
- }, ki = {
3940
- text: _i,
3941
- phone: mi,
3942
- "multiple-choice": ii,
3943
- boolean: Ca,
3944
- file: Va,
3945
- submit: bi,
3946
- address: xa,
3947
- number: ci
3948
- }, Ci = ({
3939
+ }, Ci = {
3940
+ text: ki,
3941
+ phone: yi,
3942
+ "multiple-choice": oi,
3943
+ boolean: Sa,
3944
+ file: Ma,
3945
+ submit: gi,
3946
+ address: wa,
3947
+ number: ui
3948
+ }, Si = ({
3949
3949
  logger: e,
3950
3950
  analytics: r
3951
3951
  }) => {
3952
- var a;
3953
- const t = (a = q.current$.value.flow) == null ? void 0 : a.data.currentInput, s = ye(null), n = () => ce.onInteractionFn$.value();
3952
+ var i;
3953
+ const t = (i = q.current$.value.flow) == null ? void 0 : i.data.currentInput, s = ye(null), n = () => ce.onInteractionFn$.value();
3954
3954
  return Le(() => {
3955
- var i;
3956
- (i = s.current) == null || i.scrollTo({
3955
+ var a;
3956
+ (a = s.current) == null || a.scrollTo({
3957
3957
  top: 0
3958
3958
  });
3959
3959
  }, [t]), l("div", {
@@ -3964,8 +3964,8 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3964
3964
  onPointerDownCapture: t ? n : void 0,
3965
3965
  onKeyDownCapture: t ? n : void 0,
3966
3966
  children: t ? (() => {
3967
- const i = ki[t.type];
3968
- return l(i, {
3967
+ const a = Ci[t.type];
3968
+ return l(a, {
3969
3969
  logger: e,
3970
3970
  analytics: r,
3971
3971
  onSubmitSuccess: ce.onSubmitSuccessFn$.value,
@@ -3990,66 +3990,66 @@ const Mr = 27, Lr = 12, Rr = 10, si = et("enum"), ni = (e, r) => {
3990
3990
  })
3991
3991
  });
3992
3992
  };
3993
- function Si(e) {
3993
+ function Ai(e) {
3994
3994
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
3995
3995
  }
3996
- var Ai = function(e) {
3996
+ var Ii = function(e) {
3997
3997
  return e instanceof RegExp;
3998
3998
  }, Ei = function(r) {
3999
3999
  var t = /[\\^$.*+?()[\]{}|]/g, s = RegExp(t.source);
4000
4000
  return r && s.test(r) ? r.replace(t, "\\$&") : r;
4001
4001
  }, ws = function(e) {
4002
4002
  return typeof e == "string";
4003
- }, Ii = function(e) {
4003
+ }, Fi = function(e) {
4004
4004
  var r = [];
4005
4005
  return e.forEach(function(t) {
4006
4006
  Array.isArray(t) ? r = r.concat(t) : r.push(t);
4007
4007
  }), r;
4008
4008
  };
4009
- function Fi(e, r, t) {
4009
+ function Vi(e, r, t) {
4010
4010
  var s = 0, n = 0;
4011
4011
  if (e === "")
4012
4012
  return e;
4013
4013
  if (!e || !ws(e))
4014
4014
  throw new TypeError("First argument to react-string-replace#replaceString must be a string");
4015
- var a = r;
4016
- Ai(a) || (a = new RegExp("(" + Ei(a) + ")", "gi"));
4017
- for (var i = e.split(a), o = 1, c = i.length; o < c; o += 2) {
4018
- if (i[o] === void 0 || i[o - 1] === void 0) {
4015
+ var i = r;
4016
+ Ii(i) || (i = new RegExp("(" + Ei(i) + ")", "gi"));
4017
+ for (var a = e.split(i), o = 1, c = a.length; o < c; o += 2) {
4018
+ if (a[o] === void 0 || a[o - 1] === void 0) {
4019
4019
  console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
4020
4020
  continue;
4021
4021
  }
4022
- n = i[o].length, s += i[o - 1].length, i[o] = t(i[o], o, s), s += n;
4022
+ n = a[o].length, s += a[o - 1].length, a[o] = t(a[o], o, s), s += n;
4023
4023
  }
4024
- return i;
4024
+ return a;
4025
4025
  }
4026
- var Vi = function(r, t, s) {
4027
- return Array.isArray(r) || (r = [r]), Ii(r.map(function(n) {
4028
- return ws(n) ? Fi(n, t, s) : n;
4026
+ var Mi = function(r, t, s) {
4027
+ return Array.isArray(r) || (r = [r]), Fi(r.map(function(n) {
4028
+ return ws(n) ? Vi(n, t, s) : n;
4029
4029
  }));
4030
4030
  };
4031
- const ot = /* @__PURE__ */ Si(Vi), Mi = /(\[[^\]]+\]\([^)]+\))/g, Li = /\[([^\]]+)\]\(([^)]+)\)/, Ri = /(https?:\/\/[^\s]+)/g, Ni = /_(.*?)_/g, Ti = /\*\*(.*?)\*\*/g, Di = /(\\n|\n)/g, Or = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Oi = (e) => {
4032
- const r = ot(e, Mi, (o, c) => {
4033
- const [, d, g] = o.match(Li) ?? [];
4034
- return g ? l("a", {
4031
+ const ot = /* @__PURE__ */ Ai(Mi), Li = /(\[[^\]]+\]\([^)]+\))/g, Ri = /\[([^\]]+)\]\(([^)]+)\)/, Ni = /(https?:\/\/[^\s]+)/g, Di = /_(.*?)_/g, Ti = /\*\*(.*?)\*\*/g, Oi = /(\\n|\n)/g, Or = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", ji = (e) => {
4032
+ const r = ot(e, Li, (o, c) => {
4033
+ const [, f, p] = o.match(Ri) ?? [];
4034
+ return p ? l("a", {
4035
4035
  class: Or,
4036
- href: g,
4037
- children: d ?? g
4038
- }, g + c) : l("span", {
4036
+ href: p,
4037
+ children: f ?? p
4038
+ }, p + c) : l("span", {
4039
4039
  children: "INVALID LINK"
4040
4040
  });
4041
- }), t = ot(r, Ri, (o, c) => l("a", {
4041
+ }), t = ot(r, Ni, (o, c) => l("a", {
4042
4042
  class: Or,
4043
4043
  href: o,
4044
4044
  children: o
4045
- }, o + c)), s = ot(t, Ni, (o, c) => l("em", {
4045
+ }, o + c)), s = ot(t, Di, (o, c) => l("em", {
4046
4046
  children: o
4047
4047
  }, o + c)), n = ot(s, Ti, (o, c) => l("strong", {
4048
4048
  children: o
4049
4049
  }, o + c));
4050
- let a = 0;
4051
- return ot(n, Di, () => l("br", {}, `br-${a++}`));
4052
- }, ji = xt("select-text max-w-[min(100%,24rem)] [text-wrap:pretty] leading-snug flex-shrink min-w-[2rem] py-2 px-3 rounded-[18px] min-h-[36px] break-words relative", {
4050
+ let i = 0;
4051
+ return ot(n, Oi, () => l("br", {}, `br-${i++}`));
4052
+ }, $i = xt("select-text max-w-[min(100%,24rem)] [text-wrap:pretty] leading-snug flex-shrink min-w-[2rem] py-2 px-3 rounded-[18px] min-h-[36px] break-words relative", {
4053
4053
  variants: {
4054
4054
  side: {
4055
4055
  left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
@@ -4073,26 +4073,26 @@ const ot = /* @__PURE__ */ Si(Vi), Mi = /(\[[^\]]+\]\([^)]+\))/g, Li = /\[([^\]]
4073
4073
  style: {
4074
4074
  transformOrigin: s === "left" ? "0% 50%" : "100% 50%"
4075
4075
  },
4076
- class: ji({
4076
+ class: $i({
4077
4077
  className: r,
4078
4078
  side: s,
4079
4079
  animate: t
4080
4080
  }),
4081
4081
  ...n,
4082
4082
  children: e
4083
- }), jr = /* @__PURE__ */ new Map(), $i = ({
4083
+ }), jr = /* @__PURE__ */ new Map(), Pi = ({
4084
4084
  flow: e,
4085
4085
  rpcClient: r
4086
4086
  }) => {
4087
4087
  const {
4088
4088
  t
4089
- } = re(), s = e.data.flowSessionId, n = jr.get(s) ?? Hs("offer");
4089
+ } = re(), s = e.data.flowSessionId, n = jr.get(s) ?? Ks("offer");
4090
4090
  jr.set(s, n);
4091
- const a = (c) => {
4092
- const d = e.data.submissions[c];
4093
- return (d == null ? void 0 : d.type) === "string" ? d.value.trim() : void 0;
4094
- }, i = a("email") || e.nodes.flatMap((c) => c.type === "question-text" && c.data.format === "email" ? [a(c.data.key)] : []).find((c) => !!c);
4095
- if (!i || n.value === "declined")
4091
+ const i = (c) => {
4092
+ const f = e.data.submissions[c];
4093
+ return (f == null ? void 0 : f.type) === "string" ? f.value.trim() : void 0;
4094
+ }, a = i("email") || e.nodes.flatMap((c) => c.type === "question-text" && c.data.format === "email" ? [i(c.data.key)] : []).find((c) => !!c);
4095
+ if (!a || n.value === "declined")
4096
4096
  return null;
4097
4097
  if (n.value === "success")
4098
4098
  return l("p", {
@@ -4103,11 +4103,11 @@ const ot = /* @__PURE__ */ Si(Vi), Mi = /(\[[^\]]+\]\([^)]+\))/g, Li = /\[([^\]]
4103
4103
  if (!(n.value !== "offer" && n.value !== "error")) {
4104
4104
  n.value = "saving";
4105
4105
  try {
4106
- await Ys(r, {
4106
+ await Qs(r, {
4107
4107
  contact: {
4108
- email: i,
4109
- first_name: a("first_name"),
4110
- last_name: a("last_name")
4108
+ email: a,
4109
+ first_name: i("first_name"),
4110
+ last_name: i("last_name")
4111
4111
  },
4112
4112
  job: e.job
4113
4113
  }), n.value = "success";
@@ -4120,7 +4120,7 @@ const ot = /* @__PURE__ */ Si(Vi), Mi = /(\[[^\]]+\]\([^)]+\))/g, Li = /\[([^\]]
4120
4120
  class: "bg-neutral-2 flex flex-col gap-2 rounded-xl p-3 text-sm",
4121
4121
  children: [l("p", {
4122
4122
  children: t("job_alerts_offer", {
4123
- email: i
4123
+ email: a
4124
4124
  })
4125
4125
  }), n.value === "error" ? l("p", {
4126
4126
  role: "alert",
@@ -4147,7 +4147,7 @@ const ot = /* @__PURE__ */ Si(Vi), Mi = /(\[[^\]]+\]\([^)]+\))/g, Li = /\[([^\]]
4147
4147
  children: t("job_alerts_privacy")
4148
4148
  })]
4149
4149
  });
4150
- }, Pi = ({
4150
+ }, qi = ({
4151
4151
  message: e
4152
4152
  }) => l("div", {
4153
4153
  class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
@@ -4171,7 +4171,7 @@ const ot = /* @__PURE__ */ Si(Vi), Mi = /(\[[^\]]+\]\([^)]+\))/g, Li = /\[([^\]]
4171
4171
  })
4172
4172
  })]
4173
4173
  })
4174
- }), qi = ({
4174
+ }), Ui = ({
4175
4175
  className: e,
4176
4176
  ...r
4177
4177
  }) => l("div", {
@@ -4189,10 +4189,10 @@ const ot = /* @__PURE__ */ Si(Vi), Mi = /(\[[^\]]+\]\([^)]+\))/g, Li = /\[([^\]]
4189
4189
  }
4190
4190
  }))
4191
4191
  }) : void 0
4192
- }), Ui = {
4192
+ }), Wi = {
4193
4193
  bot: "left",
4194
4194
  user: "right"
4195
- }, Wi = xt("w-full select-none py-2 text-wrap-balance text-center text-[10px] uppercase tracking-widest drop-shadow-[0_1.5px_var(--i-color-n-1)]", {
4195
+ }, zi = xt("w-full select-none py-2 text-wrap-balance text-center text-[10px] uppercase tracking-widest drop-shadow-[0_1.5px_var(--i-color-n-1)]", {
4196
4196
  variants: {
4197
4197
  variant: {
4198
4198
  info: "text-neutral-11",
@@ -4201,200 +4201,206 @@ const ot = /* @__PURE__ */ Si(Vi), Mi = /(\[[^\]]+\]\([^)]+\))/g, Li = /\[([^\]]
4201
4201
  success: "text-system-success"
4202
4202
  }
4203
4203
  }
4204
- }), zi = ({
4205
- lastSentMessageFooter: e,
4206
- rpcClient: r
4204
+ }), Hi = ({
4205
+ env: e,
4206
+ lastSentMessageFooter: r,
4207
+ rpcClient: t
4207
4208
  }) => {
4208
4209
  const {
4209
- t
4210
- } = re(), s = q.current$.value.flow, n = (s == null ? void 0 : s.data.messages) ?? [], a = n.findIndex((o) => o.type === "system" && o.semantic === "submission-closed"), i = s ? zt(s) : void 0;
4210
+ t: s
4211
+ } = re(), n = q.current$.value.flow, i = (n == null ? void 0 : n.data.messages) ?? [], a = i.findIndex((c) => c.type === "system" && c.semantic === "submission-closed"), o = n ? zt(n) : void 0;
4211
4212
  return l("ol", {
4212
- "aria-label": t("chat_messages"),
4213
+ "aria-label": s("chat_messages"),
4213
4214
  "aria-live": "polite",
4214
4215
  class: "mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",
4215
- children: [n.map((o, c) => l(be, {
4216
+ children: [i.map((c, f) => l(be, {
4216
4217
  children: [l("li", {
4217
4218
  class: "flex",
4218
- tabIndex: c === n.length - 1 ? -1 : void 0,
4219
- children: [i && o.groupId === i && !n.slice(c + 1).some((d) => d.groupId === i) ? e : null, Ks(o).with({
4219
+ tabIndex: f === i.length - 1 ? -1 : void 0,
4220
+ children: [o && c.groupId === o && !i.slice(f + 1).some((p) => p.groupId === o) ? r : null, Gs(c).with({
4220
4221
  type: "system"
4221
- }, (d) => l("p", {
4222
- class: Wi({
4223
- variant: d.variant
4222
+ }, (p) => l("p", {
4223
+ class: zi({
4224
+ variant: p.variant
4224
4225
  }),
4225
- children: d.text
4226
+ children: p.text
4226
4227
  })).with({
4227
4228
  type: "text",
4228
- author: Gs.union("bot", "user")
4229
- }, (d) => {
4230
- const g = c === n.length - 1, b = d.author === "bot" ? Oi(d.text) : d.text;
4229
+ author: Js.union("bot", "user")
4230
+ }, (p) => {
4231
+ const g = f === i.length - 1, m = p.author === "bot" ? ji(p.text) : p.text;
4231
4232
  return l(be, {
4232
4233
  children: l(Bi, {
4233
4234
  animate: g,
4234
- side: Ui[d.author],
4235
- children: b
4236
- }, c)
4235
+ side: Wi[p.author],
4236
+ children: m
4237
+ }, f)
4237
4238
  });
4238
4239
  }).with({
4239
4240
  type: "link"
4240
- }, (d) => l(Pi, {
4241
- message: d
4241
+ }, (p) => l(qi, {
4242
+ message: p
4242
4243
  })).with({
4243
4244
  type: "image"
4244
- }, (d) => l("img", {
4245
+ }, (p) => l("img", {
4245
4246
  class: "shadow-surface-md w-full max-w-[min(100%,24rem)] rounded-2xl",
4246
- src: d.url,
4247
+ src: p.url,
4247
4248
  style: {
4248
- aspectRatio: d.width / d.height
4249
+ aspectRatio: p.width / p.height
4249
4250
  }
4250
4251
  })).with({
4251
4252
  type: "file"
4252
- }, (d) => l(Aa, {
4253
- class: d.author === "bot" ? void 0 : "ml-auto",
4253
+ }, (p) => l(Ia, {
4254
+ class: p.author === "bot" ? void 0 : "ml-auto",
4254
4255
  file: {
4255
- name: d.fileName,
4256
- sizeKb: d.fileSizeKb
4256
+ name: p.fileName,
4257
+ sizeKb: p.fileSizeKb
4257
4258
  }
4258
4259
  })).with({
4259
4260
  type: "loading"
4260
- }, (d) => {
4261
- const g = n[n.length - 1];
4262
- return !(d === g) || ce.isBotTyping$.value || s != null && s.data.isFinished ? null : l("div", {
4261
+ }, (p) => {
4262
+ const g = i[i.length - 1];
4263
+ return !(p === g) || ce.isBotTyping$.value || n != null && n.data.isFinished ? null : l("div", {
4263
4264
  class: "flex flex-grow flex-col items-center justify-center gap-2",
4264
4265
  children: [l(Ut, {
4265
- "aria-hidden": d.text ? "true" : void 0,
4266
+ "aria-hidden": p.text ? "true" : void 0,
4266
4267
  class: "text-neutral-6 h-8 w-8"
4267
- }), d.text ? l("p", {
4268
+ }), p.text ? l("p", {
4268
4269
  role: "status",
4269
4270
  class: "text-neutral-11 text-sm",
4270
- children: d.text
4271
+ children: p.text
4271
4272
  }) : null]
4272
4273
  });
4273
4274
  }).exhaustive()]
4274
- }), c === a && (s != null && s.jobAlerts) && r ? l("li", {
4275
- children: l($i, {
4276
- flow: s,
4277
- rpcClient: r
4278
- }, s.data.flowSessionId)
4275
+ }), f === a && (n != null && n.jobAlerts) && t ? l("li", {
4276
+ children: l(Pi, {
4277
+ flow: n,
4278
+ rpcClient: t
4279
+ }, n.data.flowSessionId)
4279
4280
  }) : null]
4280
- }, c)), l("li", {
4281
+ }, f)), e && e !== "production" && (n == null ? void 0 : n.data.isFinished) && n.data.stagingDestination && l("li", {
4282
+ class: "text-neutral-11 text-center text-xs",
4283
+ children: n.data.stagingDestination
4284
+ }), l("li", {
4281
4285
  class: ce.captchaVisible$.value ? "flex" : "hidden",
4282
4286
  children: l("div", {
4283
4287
  "data-captcha-slot": !0,
4284
4288
  tabIndex: -1,
4285
4289
  role: "group",
4286
- "aria-label": t("captcha_check"),
4290
+ "aria-label": s("captcha_check"),
4287
4291
  class: "w-full max-w-[min(100%,24rem)] rounded-md"
4288
4292
  })
4289
- }, "captcha"), l(qi, {}, "typing")]
4293
+ }, "captcha"), l(Ui, {}, "typing")]
4290
4294
  });
4291
- }, Zi = ({
4295
+ }, Xi = ({
4292
4296
  logger: e,
4293
4297
  apiClient: r,
4294
4298
  rpcClient: t,
4295
4299
  analytics: s,
4296
- talentBankClient: n
4300
+ talentBankClient: n,
4301
+ env: i
4297
4302
  }) => {
4298
4303
  const {
4299
4304
  flow: a
4300
4305
  } = q.current$.value;
4301
4306
  Oe(a, "Flow is required to exist to show chatbot body");
4302
- const i = q.viewState$.value, {
4303
- chatRef: o,
4304
- chatService: c
4305
- } = Js(), {
4306
- t: d
4307
- } = re(), [g, b] = ke();
4307
+ const o = q.viewState$.value, {
4308
+ chatRef: c,
4309
+ chatService: f
4310
+ } = Zs(), {
4311
+ t: p
4312
+ } = re(), [g, m] = ke();
4308
4313
  return Le(() => {
4309
- i === "maximised" && ce.scrollToEnd();
4310
- }, [i]), Le(() => {
4311
- var ee;
4314
+ o === "maximised" && ce.scrollToEnd();
4315
+ }, [o]), Le(() => {
4316
+ var K;
4312
4317
  const {
4313
- state: p,
4314
- flow: m
4318
+ state: b,
4319
+ flow: k
4315
4320
  } = q.current$.peek();
4316
- if (p !== "loaded")
4317
- throw new Error(d("invalid_state"));
4318
- let _ = m.data.nodeHistory.at(-1);
4319
- if (ce.scrollToEnd(), q.setInput(void 0), m.data.isFinished)
4321
+ if (b !== "loaded")
4322
+ throw new Error(p("invalid_state"));
4323
+ let w = k.data.nodeHistory.at(-1);
4324
+ if (ce.scrollToEnd(), q.setInput(void 0), k.data.isFinished)
4320
4325
  return;
4321
- const k = () => {
4322
- const N = q.current$.peek().flow;
4323
- !N || N.data.hasInteracted || (q.markAsInteracted(), dr(s, N, "FLOW_INTERACT"));
4326
+ const C = () => {
4327
+ const T = q.current$.peek().flow;
4328
+ !T || T.data.hasInteracted || (q.markAsInteracted(), dr(s, T, "FLOW_INTERACT"));
4324
4329
  };
4325
- ce.onInteractionFn$.value = k, _ === void 0 ? (_ = Jr(a.nodes).id, q.setCurrentNodeId(_), dr(s, m, "FLOW_START")) : q.removeMessagesSentByNodeIds([_, $t]);
4330
+ ce.onInteractionFn$.value = C, w === void 0 ? (w = Jr(a.nodes).id, q.setCurrentNodeId(w), dr(s, k, "FLOW_START")) : q.removeMessagesSentByNodeIds([w, Bt]);
4326
4331
  const {
4327
- interpret: C,
4328
- abort: A,
4329
- undo: v
4332
+ interpret: A,
4333
+ abort: v,
4334
+ undo: R
4330
4335
  } = En({
4331
4336
  context: a.context,
4332
4337
  analytics: {
4333
4338
  service: s,
4334
- customProperties: (ee = a.analytics) == null ? void 0 : ee.customProperties
4339
+ customProperties: (K = a.analytics) == null ? void 0 : K.customProperties
4335
4340
  },
4336
4341
  apiClient: r,
4337
4342
  logger: e,
4338
4343
  talentBankClient: n,
4339
4344
  flow: a,
4340
- chatService: c,
4341
- t: d,
4345
+ chatService: f,
4346
+ t: p,
4342
4347
  getApplicationRecovery: () => {
4343
- var N;
4344
- return (N = q.current$.peek().flow) == null ? void 0 : N.data.applicationRecovery;
4348
+ var T;
4349
+ return (T = q.current$.peek().flow) == null ? void 0 : T.data.applicationRecovery;
4345
4350
  },
4346
4351
  setApplicationRecovery: q.setApplicationRecovery,
4347
- persistWriteBarrier: () => q.persistWriteBarrier(m),
4352
+ persistWriteBarrier: () => q.persistWriteBarrier(k),
4348
4353
  // We need to get fresh submissions, that’s why we call `peek` here.
4349
4354
  getSubmissions: () => {
4350
- var N;
4351
- return (N = q.current$.peek().flow) == null ? void 0 : N.data.submissions;
4355
+ var T;
4356
+ return (T = q.current$.peek().flow) == null ? void 0 : T.data.submissions;
4352
4357
  },
4353
- onInterpret: (N) => q.setCurrentNodeId(N.id),
4358
+ onInterpret: (T) => q.setCurrentNodeId(T.id),
4354
4359
  onFlowEnd: async () => {
4355
- var G;
4360
+ var N;
4356
4361
  q.markAsFinished();
4357
- const N = q.current$.peek().flow;
4358
- Oe(N), s.log({
4362
+ const T = q.current$.peek().flow;
4363
+ Oe(T), s.log({
4359
4364
  event: "FLOW_END",
4360
4365
  properties: {
4361
4366
  flow_id: a.id,
4362
4367
  flow_version: a.version,
4363
- flow_session_id: N.data.flowSessionId,
4368
+ flow_session_id: T.data.flowSessionId,
4364
4369
  flow_build: a.build,
4365
4370
  job: a.job
4366
4371
  },
4367
- customProperties: (G = a.analytics) == null ? void 0 : G.customProperties
4372
+ customProperties: (N = a.analytics) == null ? void 0 : N.customProperties
4368
4373
  });
4369
4374
  }
4370
- }), R = _, V = () => {
4371
- b(() => v), C(R);
4372
- }, M = new AbortController();
4373
- return m.offerResume ? ea({
4374
- chatService: c,
4375
- t: d,
4376
- signal: M.signal
4377
- }).then((N) => (q.settleResume(m), N ? V() : (q.restart(), Zs.flushStateData()))).catch((N) => {
4378
- N instanceof Pr || e.error("Resume prompt failed", N);
4379
- }) : V(), () => {
4380
- M.abort(), ce.onInteractionFn$.value === k && (ce.onInteractionFn$.value = () => {
4381
- }), A();
4375
+ }), V = w, M = () => {
4376
+ m(() => R), A(V);
4377
+ }, ee = new AbortController();
4378
+ return k.offerResume ? ta({
4379
+ chatService: f,
4380
+ t: p,
4381
+ signal: ee.signal
4382
+ }).then((T) => (q.settleResume(k), T ? M() : (q.restart(), Xs.flushStateData()))).catch((T) => {
4383
+ T instanceof Pr || e.error("Resume prompt failed", T);
4384
+ }) : M(), () => {
4385
+ ee.abort(), ce.onInteractionFn$.value === C && (ce.onInteractionFn$.value = () => {
4386
+ }), v();
4382
4387
  };
4383
- }, [s, r, c, e, a, n, d]), l(be, {
4388
+ }, [s, r, f, e, a, n, p]), l(be, {
4384
4389
  children: [l("div", {
4385
4390
  class: "relative flex min-h-0 w-full max-w-full flex-grow flex-col",
4386
4391
  children: [l("div", {
4387
- ref: o,
4392
+ ref: c,
4388
4393
  role: "region",
4389
- "aria-label": d("conversation_history"),
4394
+ "aria-label": p("conversation_history"),
4390
4395
  tabIndex: 0,
4391
4396
  className: "hide-scrollbars fr flex min-h-0 w-full max-w-full flex-grow flex-col overflow-y-auto ring-inset",
4392
4397
  style: {
4393
4398
  WebkitOverflowScrolling: "touch"
4394
4399
  },
4395
- children: l(zi, {
4400
+ children: l(Hi, {
4401
+ env: i,
4396
4402
  rpcClient: t,
4397
- lastSentMessageFooter: !zt(a) || !g ? null : l(Hi, {
4403
+ lastSentMessageFooter: !zt(a) || !g ? null : l(Ki, {
4398
4404
  undoFn: g
4399
4405
  })
4400
4406
  })
@@ -4402,22 +4408,22 @@ const ot = /* @__PURE__ */ Si(Vi), Mi = /(\[[^\]]+\]\([^)]+\))/g, Li = /\[([^\]]
4402
4408
  class: "absolute bottom-2 left-1/2 -translate-x-1/2",
4403
4409
  children: l(Kr, {
4404
4410
  class: "bg-neutral-1 ring-divider shadow-surface-md ring-1",
4405
- "aria-label": d("jump_to_current"),
4411
+ "aria-label": p("jump_to_current"),
4406
4412
  onClick: () => {
4407
- var m, _;
4408
- ce.scrollToEnd(), (_ = ((m = o.current) == null ? void 0 : m.querySelector('li[tabindex="-1"]')) ?? o.current) == null || _.focus({
4413
+ var k, w;
4414
+ ce.scrollToEnd(), (w = ((k = c.current) == null ? void 0 : k.querySelector('li[tabindex="-1"]')) ?? c.current) == null || w.focus({
4409
4415
  preventScroll: !0
4410
4416
  });
4411
4417
  },
4412
- children: l(Xs, {})
4418
+ children: l(Ys, {})
4413
4419
  })
4414
4420
  })]
4415
- }), l(Ci, {
4421
+ }), l(Si, {
4416
4422
  logger: e,
4417
4423
  analytics: s
4418
4424
  })]
4419
4425
  });
4420
- }, Hi = ({
4426
+ }, Ki = ({
4421
4427
  undoFn: e
4422
4428
  }) => {
4423
4429
  const {
@@ -4440,5 +4446,5 @@ const ot = /* @__PURE__ */ Si(Vi), Mi = /(\[[^\]]+\]\([^)]+\))/g, Li = /\[([^\]]
4440
4446
  });
4441
4447
  };
4442
4448
  export {
4443
- Zi as ChatbotBody
4449
+ Xi as ChatbotBody
4444
4450
  };