@bymos/agentkit-sdk 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agentkit-widget.iife.js +66 -33
- package/agentkit-widget.js +1264 -1222
- package/index.cjs +64 -31
- package/index.js +824 -782
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRoot as fa } from "preact/compat/client";
|
|
2
|
-
import { createElement as qt, useCallback as pa, useEffect as
|
|
3
|
-
import { Fragment as
|
|
2
|
+
import { createElement as qt, useCallback as pa, useEffect as X, useMemo as Mr, useRef as he, useState as ne } from "preact/compat";
|
|
3
|
+
import { Fragment as ve, jsx as d, jsxs as y } from "preact/jsx-runtime";
|
|
4
4
|
var A;
|
|
5
5
|
(function(e) {
|
|
6
6
|
e.assertEqual = (n) => {
|
|
@@ -61,7 +61,7 @@ var _ = A.arrayToEnum([
|
|
|
61
61
|
"never",
|
|
62
62
|
"map",
|
|
63
63
|
"set"
|
|
64
|
-
]),
|
|
64
|
+
]), ge = (e) => {
|
|
65
65
|
switch (typeof e) {
|
|
66
66
|
case "undefined":
|
|
67
67
|
return _.undefined;
|
|
@@ -99,7 +99,7 @@ var _ = A.arrayToEnum([
|
|
|
99
99
|
"invalid_intersection_types",
|
|
100
100
|
"not_multiple_of",
|
|
101
101
|
"not_finite"
|
|
102
|
-
]),
|
|
102
|
+
]), ie = class Lr extends Error {
|
|
103
103
|
get errors() {
|
|
104
104
|
return this.issues;
|
|
105
105
|
}
|
|
@@ -157,8 +157,8 @@ var _ = A.arrayToEnum([
|
|
|
157
157
|
return this.flatten();
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
|
-
|
|
161
|
-
var
|
|
160
|
+
ie.create = (e) => new ie(e);
|
|
161
|
+
var Oe = (e, t) => {
|
|
162
162
|
let r;
|
|
163
163
|
switch (e.code) {
|
|
164
164
|
case m.invalid_type:
|
|
@@ -213,7 +213,7 @@ var Ze = (e, t) => {
|
|
|
213
213
|
r = t.defaultError, A.assertNever(e);
|
|
214
214
|
}
|
|
215
215
|
return { message: r };
|
|
216
|
-
}, ma =
|
|
216
|
+
}, ma = Oe;
|
|
217
217
|
function _t() {
|
|
218
218
|
return ma;
|
|
219
219
|
}
|
|
@@ -248,12 +248,12 @@ function b(e, t) {
|
|
|
248
248
|
e.common.contextualErrorMap,
|
|
249
249
|
e.schemaErrorMap,
|
|
250
250
|
r,
|
|
251
|
-
r ===
|
|
251
|
+
r === Oe ? void 0 : Oe
|
|
252
252
|
].filter((n) => !!n)
|
|
253
253
|
});
|
|
254
254
|
e.common.issues.push(a);
|
|
255
255
|
}
|
|
256
|
-
var
|
|
256
|
+
var J = class Tr {
|
|
257
257
|
constructor() {
|
|
258
258
|
this.value = "valid";
|
|
259
259
|
}
|
|
@@ -266,7 +266,7 @@ var Y = class Tr {
|
|
|
266
266
|
static mergeArray(t, r) {
|
|
267
267
|
const a = [];
|
|
268
268
|
for (const n of r) {
|
|
269
|
-
if (n.status === "aborted") return
|
|
269
|
+
if (n.status === "aborted") return w;
|
|
270
270
|
n.status === "dirty" && t.dirty(), a.push(n.value);
|
|
271
271
|
}
|
|
272
272
|
return {
|
|
@@ -289,7 +289,7 @@ var Y = class Tr {
|
|
|
289
289
|
const a = {};
|
|
290
290
|
for (const n of r) {
|
|
291
291
|
const { key: i, value: s } = n;
|
|
292
|
-
if (i.status === "aborted" || s.status === "aborted") return
|
|
292
|
+
if (i.status === "aborted" || s.status === "aborted") return w;
|
|
293
293
|
i.status === "dirty" && t.dirty(), s.status === "dirty" && t.dirty(), i.value !== "__proto__" && (typeof s.value < "u" || n.alwaysSet) && (a[i.value] = s.value);
|
|
294
294
|
}
|
|
295
295
|
return {
|
|
@@ -297,17 +297,17 @@ var Y = class Tr {
|
|
|
297
297
|
value: a
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
|
-
},
|
|
300
|
+
}, w = Object.freeze({ status: "aborted" }), je = (e) => ({
|
|
301
301
|
status: "dirty",
|
|
302
302
|
value: e
|
|
303
|
-
}),
|
|
303
|
+
}), U = (e) => ({
|
|
304
304
|
status: "valid",
|
|
305
305
|
value: e
|
|
306
|
-
}), tr = (e) => e.status === "aborted", rr = (e) => e.status === "dirty",
|
|
306
|
+
}), tr = (e) => e.status === "aborted", rr = (e) => e.status === "dirty", Me = (e) => e.status === "valid", Ke = (e) => typeof Promise < "u" && e instanceof Promise, x;
|
|
307
307
|
(function(e) {
|
|
308
308
|
e.errToObj = (t) => typeof t == "string" ? { message: t } : t || {}, e.toString = (t) => typeof t == "string" ? t : t?.message;
|
|
309
309
|
})(x || (x = {}));
|
|
310
|
-
var
|
|
310
|
+
var se = class {
|
|
311
311
|
constructor(e, t, r, a) {
|
|
312
312
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = r, this._key = a;
|
|
313
313
|
}
|
|
@@ -315,7 +315,7 @@ var ne = class {
|
|
|
315
315
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
316
316
|
}
|
|
317
317
|
}, ar = (e, t) => {
|
|
318
|
-
if (
|
|
318
|
+
if (Me(t)) return {
|
|
319
319
|
success: !0,
|
|
320
320
|
data: t.value
|
|
321
321
|
};
|
|
@@ -324,12 +324,12 @@ var ne = class {
|
|
|
324
324
|
success: !1,
|
|
325
325
|
get error() {
|
|
326
326
|
if (this._error) return this._error;
|
|
327
|
-
const r = new
|
|
327
|
+
const r = new ie(e.common.issues);
|
|
328
328
|
return this._error = r, this._error;
|
|
329
329
|
}
|
|
330
330
|
};
|
|
331
331
|
};
|
|
332
|
-
function
|
|
332
|
+
function E(e) {
|
|
333
333
|
if (!e) return {};
|
|
334
334
|
const { errorMap: t, invalid_type_error: r, required_error: a, description: n } = e;
|
|
335
335
|
if (t && (r || a)) throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
@@ -344,18 +344,18 @@ function M(e) {
|
|
|
344
344
|
description: n
|
|
345
345
|
};
|
|
346
346
|
}
|
|
347
|
-
var
|
|
347
|
+
var L = class {
|
|
348
348
|
get description() {
|
|
349
349
|
return this._def.description;
|
|
350
350
|
}
|
|
351
351
|
_getType(e) {
|
|
352
|
-
return
|
|
352
|
+
return ge(e.data);
|
|
353
353
|
}
|
|
354
354
|
_getOrReturnCtx(e, t) {
|
|
355
355
|
return t || {
|
|
356
356
|
common: e.parent.common,
|
|
357
357
|
data: e.data,
|
|
358
|
-
parsedType:
|
|
358
|
+
parsedType: ge(e.data),
|
|
359
359
|
schemaErrorMap: this._def.errorMap,
|
|
360
360
|
path: e.path,
|
|
361
361
|
parent: e.parent
|
|
@@ -363,11 +363,11 @@ var T = class {
|
|
|
363
363
|
}
|
|
364
364
|
_processInputParams(e) {
|
|
365
365
|
return {
|
|
366
|
-
status: new
|
|
366
|
+
status: new J(),
|
|
367
367
|
ctx: {
|
|
368
368
|
common: e.parent.common,
|
|
369
369
|
data: e.data,
|
|
370
|
-
parsedType:
|
|
370
|
+
parsedType: ge(e.data),
|
|
371
371
|
schemaErrorMap: this._def.errorMap,
|
|
372
372
|
path: e.path,
|
|
373
373
|
parent: e.parent
|
|
@@ -399,7 +399,7 @@ var T = class {
|
|
|
399
399
|
schemaErrorMap: this._def.errorMap,
|
|
400
400
|
parent: null,
|
|
401
401
|
data: e,
|
|
402
|
-
parsedType:
|
|
402
|
+
parsedType: ge(e)
|
|
403
403
|
};
|
|
404
404
|
return ar(r, this._parseSync({
|
|
405
405
|
data: e,
|
|
@@ -417,7 +417,7 @@ var T = class {
|
|
|
417
417
|
schemaErrorMap: this._def.errorMap,
|
|
418
418
|
parent: null,
|
|
419
419
|
data: e,
|
|
420
|
-
parsedType:
|
|
420
|
+
parsedType: ge(e)
|
|
421
421
|
};
|
|
422
422
|
if (!this["~standard"].async) try {
|
|
423
423
|
const r = this._parseSync({
|
|
@@ -425,7 +425,7 @@ var T = class {
|
|
|
425
425
|
path: [],
|
|
426
426
|
parent: t
|
|
427
427
|
});
|
|
428
|
-
return
|
|
428
|
+
return Me(r) ? { value: r.value } : { issues: t.common.issues };
|
|
429
429
|
} catch (r) {
|
|
430
430
|
r?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), t.common = {
|
|
431
431
|
issues: [],
|
|
@@ -436,7 +436,7 @@ var T = class {
|
|
|
436
436
|
data: e,
|
|
437
437
|
path: [],
|
|
438
438
|
parent: t
|
|
439
|
-
}).then((r) =>
|
|
439
|
+
}).then((r) => Me(r) ? { value: r.value } : { issues: t.common.issues });
|
|
440
440
|
}
|
|
441
441
|
async parseAsync(e, t) {
|
|
442
442
|
const r = await this.safeParseAsync(e, t);
|
|
@@ -454,7 +454,7 @@ var T = class {
|
|
|
454
454
|
schemaErrorMap: this._def.errorMap,
|
|
455
455
|
parent: null,
|
|
456
456
|
data: e,
|
|
457
|
-
parsedType:
|
|
457
|
+
parsedType: ge(e)
|
|
458
458
|
}, a = this._parse({
|
|
459
459
|
data: e,
|
|
460
460
|
path: r.path,
|
|
@@ -476,9 +476,9 @@ var T = class {
|
|
|
476
476
|
return this._refinement((r, a) => e(r) ? !0 : (a.addIssue(typeof t == "function" ? t(r, a) : t), !1));
|
|
477
477
|
}
|
|
478
478
|
_refinement(e) {
|
|
479
|
-
return new
|
|
479
|
+
return new pe({
|
|
480
480
|
schema: this,
|
|
481
|
-
typeName:
|
|
481
|
+
typeName: S.ZodEffects,
|
|
482
482
|
effect: {
|
|
483
483
|
type: "refinement",
|
|
484
484
|
refinement: e
|
|
@@ -496,19 +496,19 @@ var T = class {
|
|
|
496
496
|
};
|
|
497
497
|
}
|
|
498
498
|
optional() {
|
|
499
|
-
return
|
|
499
|
+
return fe.create(this, this._def);
|
|
500
500
|
}
|
|
501
501
|
nullable() {
|
|
502
|
-
return
|
|
502
|
+
return _e.create(this, this._def);
|
|
503
503
|
}
|
|
504
504
|
nullish() {
|
|
505
505
|
return this.nullable().optional();
|
|
506
506
|
}
|
|
507
507
|
array() {
|
|
508
|
-
return
|
|
508
|
+
return Le.create(this);
|
|
509
509
|
}
|
|
510
510
|
promise() {
|
|
511
|
-
return
|
|
511
|
+
return Fe.create(this, this._def);
|
|
512
512
|
}
|
|
513
513
|
or(e) {
|
|
514
514
|
return rt.create([this, e], this._def);
|
|
@@ -517,10 +517,10 @@ var T = class {
|
|
|
517
517
|
return at.create(this, e, this._def);
|
|
518
518
|
}
|
|
519
519
|
transform(e) {
|
|
520
|
-
return new
|
|
521
|
-
...
|
|
520
|
+
return new pe({
|
|
521
|
+
...E(this._def),
|
|
522
522
|
schema: this,
|
|
523
|
-
typeName:
|
|
523
|
+
typeName: S.ZodEffects,
|
|
524
524
|
effect: {
|
|
525
525
|
type: "transform",
|
|
526
526
|
transform: e
|
|
@@ -530,26 +530,26 @@ var T = class {
|
|
|
530
530
|
default(e) {
|
|
531
531
|
const t = typeof e == "function" ? e : () => e;
|
|
532
532
|
return new ot({
|
|
533
|
-
...
|
|
533
|
+
...E(this._def),
|
|
534
534
|
innerType: this,
|
|
535
535
|
defaultValue: t,
|
|
536
|
-
typeName:
|
|
536
|
+
typeName: S.ZodDefault
|
|
537
537
|
});
|
|
538
538
|
}
|
|
539
539
|
brand() {
|
|
540
540
|
return new Pr({
|
|
541
|
-
typeName:
|
|
541
|
+
typeName: S.ZodBranded,
|
|
542
542
|
type: this,
|
|
543
|
-
...
|
|
543
|
+
...E(this._def)
|
|
544
544
|
});
|
|
545
545
|
}
|
|
546
546
|
catch(e) {
|
|
547
547
|
const t = typeof e == "function" ? e : () => e;
|
|
548
548
|
return new lt({
|
|
549
|
-
...
|
|
549
|
+
...E(this._def),
|
|
550
550
|
innerType: this,
|
|
551
551
|
catchValue: t,
|
|
552
|
-
typeName:
|
|
552
|
+
typeName: S.ZodCatch
|
|
553
553
|
});
|
|
554
554
|
}
|
|
555
555
|
describe(e) {
|
|
@@ -603,7 +603,7 @@ function Za(e, t) {
|
|
|
603
603
|
function Oa(e, t) {
|
|
604
604
|
return !!((t === "v4" || !t) && Ia.test(e) || (t === "v6" || !t) && Ea.test(e));
|
|
605
605
|
}
|
|
606
|
-
var qe = class
|
|
606
|
+
var qe = class Ze extends L {
|
|
607
607
|
_parse(t) {
|
|
608
608
|
if (this._def.coerce && (t.data = String(t.data)), this._getType(t) !== _.string) {
|
|
609
609
|
const n = this._getOrReturnCtx(t);
|
|
@@ -611,9 +611,9 @@ var qe = class je extends T {
|
|
|
611
611
|
code: m.invalid_type,
|
|
612
612
|
expected: _.string,
|
|
613
613
|
received: n.parsedType
|
|
614
|
-
}),
|
|
614
|
+
}), w;
|
|
615
615
|
}
|
|
616
|
-
const r = new
|
|
616
|
+
const r = new J();
|
|
617
617
|
let a;
|
|
618
618
|
for (const n of this._def.checks) if (n.kind === "min")
|
|
619
619
|
t.data.length < n.value && (a = this._getOrReturnCtx(t, a), b(a, {
|
|
@@ -770,7 +770,7 @@ var qe = class je extends T {
|
|
|
770
770
|
});
|
|
771
771
|
}
|
|
772
772
|
_addCheck(t) {
|
|
773
|
-
return new
|
|
773
|
+
return new Ze({
|
|
774
774
|
...this._def,
|
|
775
775
|
checks: [...this._def.checks, t]
|
|
776
776
|
});
|
|
@@ -945,19 +945,19 @@ var qe = class je extends T {
|
|
|
945
945
|
return this.min(1, x.errToObj(t));
|
|
946
946
|
}
|
|
947
947
|
trim() {
|
|
948
|
-
return new
|
|
948
|
+
return new Ze({
|
|
949
949
|
...this._def,
|
|
950
950
|
checks: [...this._def.checks, { kind: "trim" }]
|
|
951
951
|
});
|
|
952
952
|
}
|
|
953
953
|
toLowerCase() {
|
|
954
|
-
return new
|
|
954
|
+
return new Ze({
|
|
955
955
|
...this._def,
|
|
956
956
|
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
957
957
|
});
|
|
958
958
|
}
|
|
959
959
|
toUpperCase() {
|
|
960
|
-
return new
|
|
960
|
+
return new Ze({
|
|
961
961
|
...this._def,
|
|
962
962
|
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
963
963
|
});
|
|
@@ -1023,15 +1023,15 @@ var qe = class je extends T {
|
|
|
1023
1023
|
};
|
|
1024
1024
|
qe.create = (e) => new qe({
|
|
1025
1025
|
checks: [],
|
|
1026
|
-
typeName:
|
|
1026
|
+
typeName: S.ZodString,
|
|
1027
1027
|
coerce: e?.coerce ?? !1,
|
|
1028
|
-
...
|
|
1028
|
+
...E(e)
|
|
1029
1029
|
});
|
|
1030
1030
|
function Fa(e, t) {
|
|
1031
1031
|
const r = (e.toString().split(".")[1] || "").length, a = (t.toString().split(".")[1] || "").length, n = r > a ? r : a;
|
|
1032
1032
|
return Number.parseInt(e.toFixed(n).replace(".", "")) % Number.parseInt(t.toFixed(n).replace(".", "")) / 10 ** n;
|
|
1033
1033
|
}
|
|
1034
|
-
var wt = class St extends
|
|
1034
|
+
var wt = class St extends L {
|
|
1035
1035
|
constructor() {
|
|
1036
1036
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1037
1037
|
}
|
|
@@ -1042,10 +1042,10 @@ var wt = class St extends T {
|
|
|
1042
1042
|
code: m.invalid_type,
|
|
1043
1043
|
expected: _.number,
|
|
1044
1044
|
received: n.parsedType
|
|
1045
|
-
}),
|
|
1045
|
+
}), w;
|
|
1046
1046
|
}
|
|
1047
1047
|
let r;
|
|
1048
|
-
const a = new
|
|
1048
|
+
const a = new J();
|
|
1049
1049
|
for (const n of this._def.checks) n.kind === "int" ? A.isInteger(t.data) || (r = this._getOrReturnCtx(t, r), b(r, {
|
|
1050
1050
|
code: m.invalid_type,
|
|
1051
1051
|
expected: "integer",
|
|
@@ -1195,11 +1195,11 @@ var wt = class St extends T {
|
|
|
1195
1195
|
};
|
|
1196
1196
|
wt.create = (e) => new wt({
|
|
1197
1197
|
checks: [],
|
|
1198
|
-
typeName:
|
|
1198
|
+
typeName: S.ZodNumber,
|
|
1199
1199
|
coerce: e?.coerce || !1,
|
|
1200
|
-
...
|
|
1200
|
+
...E(e)
|
|
1201
1201
|
});
|
|
1202
|
-
var Ct = class It extends
|
|
1202
|
+
var Ct = class It extends L {
|
|
1203
1203
|
constructor() {
|
|
1204
1204
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1205
1205
|
}
|
|
@@ -1211,7 +1211,7 @@ var Ct = class It extends T {
|
|
|
1211
1211
|
}
|
|
1212
1212
|
if (this._getType(t) !== _.bigint) return this._getInvalidInput(t);
|
|
1213
1213
|
let r;
|
|
1214
|
-
const a = new
|
|
1214
|
+
const a = new J();
|
|
1215
1215
|
for (const n of this._def.checks) n.kind === "min" ? (n.inclusive ? t.data < n.value : t.data <= n.value) && (r = this._getOrReturnCtx(t, r), b(r, {
|
|
1216
1216
|
code: m.too_small,
|
|
1217
1217
|
type: "bigint",
|
|
@@ -1240,7 +1240,7 @@ var Ct = class It extends T {
|
|
|
1240
1240
|
code: m.invalid_type,
|
|
1241
1241
|
expected: _.bigint,
|
|
1242
1242
|
received: r.parsedType
|
|
1243
|
-
}),
|
|
1243
|
+
}), w;
|
|
1244
1244
|
}
|
|
1245
1245
|
gte(t, r) {
|
|
1246
1246
|
return this.setLimit("min", t, !0, x.toString(r));
|
|
@@ -1323,11 +1323,11 @@ var Ct = class It extends T {
|
|
|
1323
1323
|
};
|
|
1324
1324
|
Ct.create = (e) => new Ct({
|
|
1325
1325
|
checks: [],
|
|
1326
|
-
typeName:
|
|
1326
|
+
typeName: S.ZodBigInt,
|
|
1327
1327
|
coerce: e?.coerce ?? !1,
|
|
1328
|
-
...
|
|
1328
|
+
...E(e)
|
|
1329
1329
|
});
|
|
1330
|
-
var Nt = class extends
|
|
1330
|
+
var Nt = class extends L {
|
|
1331
1331
|
_parse(e) {
|
|
1332
1332
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== _.boolean) {
|
|
1333
1333
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1335,17 +1335,17 @@ var Nt = class extends T {
|
|
|
1335
1335
|
code: m.invalid_type,
|
|
1336
1336
|
expected: _.boolean,
|
|
1337
1337
|
received: t.parsedType
|
|
1338
|
-
}),
|
|
1338
|
+
}), w;
|
|
1339
1339
|
}
|
|
1340
|
-
return
|
|
1340
|
+
return U(e.data);
|
|
1341
1341
|
}
|
|
1342
1342
|
};
|
|
1343
1343
|
Nt.create = (e) => new Nt({
|
|
1344
|
-
typeName:
|
|
1344
|
+
typeName: S.ZodBoolean,
|
|
1345
1345
|
coerce: e?.coerce || !1,
|
|
1346
|
-
...
|
|
1346
|
+
...E(e)
|
|
1347
1347
|
});
|
|
1348
|
-
var Et = class jr extends
|
|
1348
|
+
var Et = class jr extends L {
|
|
1349
1349
|
_parse(t) {
|
|
1350
1350
|
if (this._def.coerce && (t.data = new Date(t.data)), this._getType(t) !== _.date) {
|
|
1351
1351
|
const n = this._getOrReturnCtx(t);
|
|
@@ -1353,11 +1353,11 @@ var Et = class jr extends T {
|
|
|
1353
1353
|
code: m.invalid_type,
|
|
1354
1354
|
expected: _.date,
|
|
1355
1355
|
received: n.parsedType
|
|
1356
|
-
}),
|
|
1356
|
+
}), w;
|
|
1357
1357
|
}
|
|
1358
1358
|
if (Number.isNaN(t.data.getTime()))
|
|
1359
|
-
return b(this._getOrReturnCtx(t), { code: m.invalid_date }),
|
|
1360
|
-
const r = new
|
|
1359
|
+
return b(this._getOrReturnCtx(t), { code: m.invalid_date }), w;
|
|
1360
|
+
const r = new J();
|
|
1361
1361
|
let a;
|
|
1362
1362
|
for (const n of this._def.checks) n.kind === "min" ? t.data.getTime() < n.value && (a = this._getOrReturnCtx(t, a), b(a, {
|
|
1363
1363
|
code: m.too_small,
|
|
@@ -1413,10 +1413,10 @@ var Et = class jr extends T {
|
|
|
1413
1413
|
Et.create = (e) => new Et({
|
|
1414
1414
|
checks: [],
|
|
1415
1415
|
coerce: e?.coerce || !1,
|
|
1416
|
-
typeName:
|
|
1417
|
-
...
|
|
1416
|
+
typeName: S.ZodDate,
|
|
1417
|
+
...E(e)
|
|
1418
1418
|
});
|
|
1419
|
-
var Mt = class extends
|
|
1419
|
+
var Mt = class extends L {
|
|
1420
1420
|
_parse(e) {
|
|
1421
1421
|
if (this._getType(e) !== _.symbol) {
|
|
1422
1422
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1424,16 +1424,16 @@ var Mt = class extends T {
|
|
|
1424
1424
|
code: m.invalid_type,
|
|
1425
1425
|
expected: _.symbol,
|
|
1426
1426
|
received: t.parsedType
|
|
1427
|
-
}),
|
|
1427
|
+
}), w;
|
|
1428
1428
|
}
|
|
1429
|
-
return
|
|
1429
|
+
return U(e.data);
|
|
1430
1430
|
}
|
|
1431
1431
|
};
|
|
1432
1432
|
Mt.create = (e) => new Mt({
|
|
1433
|
-
typeName:
|
|
1434
|
-
...
|
|
1433
|
+
typeName: S.ZodSymbol,
|
|
1434
|
+
...E(e)
|
|
1435
1435
|
});
|
|
1436
|
-
var et = class extends
|
|
1436
|
+
var et = class extends L {
|
|
1437
1437
|
_parse(e) {
|
|
1438
1438
|
if (this._getType(e) !== _.undefined) {
|
|
1439
1439
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1441,16 +1441,16 @@ var et = class extends T {
|
|
|
1441
1441
|
code: m.invalid_type,
|
|
1442
1442
|
expected: _.undefined,
|
|
1443
1443
|
received: t.parsedType
|
|
1444
|
-
}),
|
|
1444
|
+
}), w;
|
|
1445
1445
|
}
|
|
1446
|
-
return
|
|
1446
|
+
return U(e.data);
|
|
1447
1447
|
}
|
|
1448
1448
|
};
|
|
1449
1449
|
et.create = (e) => new et({
|
|
1450
|
-
typeName:
|
|
1451
|
-
...
|
|
1450
|
+
typeName: S.ZodUndefined,
|
|
1451
|
+
...E(e)
|
|
1452
1452
|
});
|
|
1453
|
-
var tt = class extends
|
|
1453
|
+
var tt = class extends L {
|
|
1454
1454
|
_parse(e) {
|
|
1455
1455
|
if (this._getType(e) !== _.null) {
|
|
1456
1456
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1458,54 +1458,54 @@ var tt = class extends T {
|
|
|
1458
1458
|
code: m.invalid_type,
|
|
1459
1459
|
expected: _.null,
|
|
1460
1460
|
received: t.parsedType
|
|
1461
|
-
}),
|
|
1461
|
+
}), w;
|
|
1462
1462
|
}
|
|
1463
|
-
return
|
|
1463
|
+
return U(e.data);
|
|
1464
1464
|
}
|
|
1465
1465
|
};
|
|
1466
1466
|
tt.create = (e) => new tt({
|
|
1467
|
-
typeName:
|
|
1468
|
-
...
|
|
1467
|
+
typeName: S.ZodNull,
|
|
1468
|
+
...E(e)
|
|
1469
1469
|
});
|
|
1470
|
-
var Lt = class extends
|
|
1470
|
+
var Lt = class extends L {
|
|
1471
1471
|
constructor() {
|
|
1472
1472
|
super(...arguments), this._any = !0;
|
|
1473
1473
|
}
|
|
1474
1474
|
_parse(e) {
|
|
1475
|
-
return
|
|
1475
|
+
return U(e.data);
|
|
1476
1476
|
}
|
|
1477
1477
|
};
|
|
1478
1478
|
Lt.create = (e) => new Lt({
|
|
1479
|
-
typeName:
|
|
1480
|
-
...
|
|
1479
|
+
typeName: S.ZodAny,
|
|
1480
|
+
...E(e)
|
|
1481
1481
|
});
|
|
1482
|
-
var
|
|
1482
|
+
var Ne = class extends L {
|
|
1483
1483
|
constructor() {
|
|
1484
1484
|
super(...arguments), this._unknown = !0;
|
|
1485
1485
|
}
|
|
1486
1486
|
_parse(e) {
|
|
1487
|
-
return
|
|
1487
|
+
return U(e.data);
|
|
1488
1488
|
}
|
|
1489
1489
|
};
|
|
1490
|
-
|
|
1491
|
-
typeName:
|
|
1492
|
-
...
|
|
1490
|
+
Ne.create = (e) => new Ne({
|
|
1491
|
+
typeName: S.ZodUnknown,
|
|
1492
|
+
...E(e)
|
|
1493
1493
|
});
|
|
1494
|
-
var
|
|
1494
|
+
var ke = class extends L {
|
|
1495
1495
|
_parse(e) {
|
|
1496
1496
|
const t = this._getOrReturnCtx(e);
|
|
1497
1497
|
return b(t, {
|
|
1498
1498
|
code: m.invalid_type,
|
|
1499
1499
|
expected: _.never,
|
|
1500
1500
|
received: t.parsedType
|
|
1501
|
-
}),
|
|
1501
|
+
}), w;
|
|
1502
1502
|
}
|
|
1503
1503
|
};
|
|
1504
|
-
|
|
1505
|
-
typeName:
|
|
1506
|
-
...
|
|
1504
|
+
ke.create = (e) => new ke({
|
|
1505
|
+
typeName: S.ZodNever,
|
|
1506
|
+
...E(e)
|
|
1507
1507
|
});
|
|
1508
|
-
var Tt = class extends
|
|
1508
|
+
var Tt = class extends L {
|
|
1509
1509
|
_parse(e) {
|
|
1510
1510
|
if (this._getType(e) !== _.undefined) {
|
|
1511
1511
|
const t = this._getOrReturnCtx(e);
|
|
@@ -1513,16 +1513,16 @@ var Tt = class extends T {
|
|
|
1513
1513
|
code: m.invalid_type,
|
|
1514
1514
|
expected: _.void,
|
|
1515
1515
|
received: t.parsedType
|
|
1516
|
-
}),
|
|
1516
|
+
}), w;
|
|
1517
1517
|
}
|
|
1518
|
-
return
|
|
1518
|
+
return U(e.data);
|
|
1519
1519
|
}
|
|
1520
1520
|
};
|
|
1521
1521
|
Tt.create = (e) => new Tt({
|
|
1522
|
-
typeName:
|
|
1523
|
-
...
|
|
1522
|
+
typeName: S.ZodVoid,
|
|
1523
|
+
...E(e)
|
|
1524
1524
|
});
|
|
1525
|
-
var
|
|
1525
|
+
var Le = class Xe extends L {
|
|
1526
1526
|
_parse(t) {
|
|
1527
1527
|
const { ctx: r, status: a } = this._processInputParams(t), n = this._def;
|
|
1528
1528
|
if (r.parsedType !== _.array)
|
|
@@ -1530,7 +1530,7 @@ var Ee = class Xe extends T {
|
|
|
1530
1530
|
code: m.invalid_type,
|
|
1531
1531
|
expected: _.array,
|
|
1532
1532
|
received: r.parsedType
|
|
1533
|
-
}),
|
|
1533
|
+
}), w;
|
|
1534
1534
|
if (n.exactLength !== null) {
|
|
1535
1535
|
const s = r.data.length > n.exactLength.value, o = r.data.length < n.exactLength.value;
|
|
1536
1536
|
(s || o) && (b(r, {
|
|
@@ -1557,9 +1557,9 @@ var Ee = class Xe extends T {
|
|
|
1557
1557
|
inclusive: !0,
|
|
1558
1558
|
exact: !1,
|
|
1559
1559
|
message: n.maxLength.message
|
|
1560
|
-
}), a.dirty()), r.common.async) return Promise.all([...r.data].map((s, o) => n.type._parseAsync(new
|
|
1561
|
-
const i = [...r.data].map((s, o) => n.type._parseSync(new
|
|
1562
|
-
return
|
|
1560
|
+
}), a.dirty()), r.common.async) return Promise.all([...r.data].map((s, o) => n.type._parseAsync(new se(r, s, r.path, o)))).then((s) => J.mergeArray(a, s));
|
|
1561
|
+
const i = [...r.data].map((s, o) => n.type._parseSync(new se(r, s, r.path, o)));
|
|
1562
|
+
return J.mergeArray(a, i);
|
|
1563
1563
|
}
|
|
1564
1564
|
get element() {
|
|
1565
1565
|
return this._def.type;
|
|
@@ -1595,31 +1595,31 @@ var Ee = class Xe extends T {
|
|
|
1595
1595
|
return this.min(1, t);
|
|
1596
1596
|
}
|
|
1597
1597
|
};
|
|
1598
|
-
|
|
1598
|
+
Le.create = (e, t) => new Le({
|
|
1599
1599
|
type: e,
|
|
1600
1600
|
minLength: null,
|
|
1601
1601
|
maxLength: null,
|
|
1602
1602
|
exactLength: null,
|
|
1603
|
-
typeName:
|
|
1604
|
-
...
|
|
1603
|
+
typeName: S.ZodArray,
|
|
1604
|
+
...E(t)
|
|
1605
1605
|
});
|
|
1606
|
-
function
|
|
1607
|
-
if (e instanceof
|
|
1606
|
+
function Ie(e) {
|
|
1607
|
+
if (e instanceof te) {
|
|
1608
1608
|
const t = {};
|
|
1609
1609
|
for (const r in e.shape) {
|
|
1610
1610
|
const a = e.shape[r];
|
|
1611
|
-
t[r] =
|
|
1611
|
+
t[r] = fe.create(Ie(a));
|
|
1612
1612
|
}
|
|
1613
|
-
return new
|
|
1613
|
+
return new te({
|
|
1614
1614
|
...e._def,
|
|
1615
1615
|
shape: () => t
|
|
1616
1616
|
});
|
|
1617
|
-
} else return e instanceof
|
|
1617
|
+
} else return e instanceof Le ? new Le({
|
|
1618
1618
|
...e._def,
|
|
1619
|
-
type:
|
|
1620
|
-
}) : e instanceof
|
|
1619
|
+
type: Ie(e.element)
|
|
1620
|
+
}) : e instanceof fe ? fe.create(Ie(e.unwrap())) : e instanceof _e ? _e.create(Ie(e.unwrap())) : e instanceof be ? be.create(e.items.map((t) => Ie(t))) : e;
|
|
1621
1621
|
}
|
|
1622
|
-
var
|
|
1622
|
+
var te = class q extends L {
|
|
1623
1623
|
constructor() {
|
|
1624
1624
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1625
1625
|
}
|
|
@@ -1638,10 +1638,10 @@ var ee = class K extends T {
|
|
|
1638
1638
|
code: m.invalid_type,
|
|
1639
1639
|
expected: _.object,
|
|
1640
1640
|
received: l.parsedType
|
|
1641
|
-
}),
|
|
1641
|
+
}), w;
|
|
1642
1642
|
}
|
|
1643
1643
|
const { status: r, ctx: a } = this._processInputParams(t), { shape: n, keys: i } = this._getCached(), s = [];
|
|
1644
|
-
if (!(this._def.catchall instanceof
|
|
1644
|
+
if (!(this._def.catchall instanceof ke && this._def.unknownKeys === "strip"))
|
|
1645
1645
|
for (const l in a.data) i.includes(l) || s.push(l);
|
|
1646
1646
|
const o = [];
|
|
1647
1647
|
for (const l of i) {
|
|
@@ -1651,11 +1651,11 @@ var ee = class K extends T {
|
|
|
1651
1651
|
status: "valid",
|
|
1652
1652
|
value: l
|
|
1653
1653
|
},
|
|
1654
|
-
value: c._parse(new
|
|
1654
|
+
value: c._parse(new se(a, u, a.path, l)),
|
|
1655
1655
|
alwaysSet: l in a.data
|
|
1656
1656
|
});
|
|
1657
1657
|
}
|
|
1658
|
-
if (this._def.catchall instanceof
|
|
1658
|
+
if (this._def.catchall instanceof ke) {
|
|
1659
1659
|
const l = this._def.unknownKeys;
|
|
1660
1660
|
if (l === "passthrough") for (const c of s) o.push({
|
|
1661
1661
|
key: {
|
|
@@ -1683,7 +1683,7 @@ var ee = class K extends T {
|
|
|
1683
1683
|
status: "valid",
|
|
1684
1684
|
value: c
|
|
1685
1685
|
},
|
|
1686
|
-
value: l._parse(new
|
|
1686
|
+
value: l._parse(new se(a, u, a.path, c)),
|
|
1687
1687
|
alwaysSet: c in a.data
|
|
1688
1688
|
});
|
|
1689
1689
|
}
|
|
@@ -1699,13 +1699,13 @@ var ee = class K extends T {
|
|
|
1699
1699
|
});
|
|
1700
1700
|
}
|
|
1701
1701
|
return l;
|
|
1702
|
-
}).then((l) =>
|
|
1702
|
+
}).then((l) => J.mergeObjectSync(r, l)) : J.mergeObjectSync(r, o);
|
|
1703
1703
|
}
|
|
1704
1704
|
get shape() {
|
|
1705
1705
|
return this._def.shape();
|
|
1706
1706
|
}
|
|
1707
1707
|
strict(t) {
|
|
1708
|
-
return x.errToObj, new
|
|
1708
|
+
return x.errToObj, new q({
|
|
1709
1709
|
...this._def,
|
|
1710
1710
|
unknownKeys: "strict",
|
|
1711
1711
|
...t !== void 0 ? { errorMap: (r, a) => {
|
|
@@ -1715,19 +1715,19 @@ var ee = class K extends T {
|
|
|
1715
1715
|
});
|
|
1716
1716
|
}
|
|
1717
1717
|
strip() {
|
|
1718
|
-
return new
|
|
1718
|
+
return new q({
|
|
1719
1719
|
...this._def,
|
|
1720
1720
|
unknownKeys: "strip"
|
|
1721
1721
|
});
|
|
1722
1722
|
}
|
|
1723
1723
|
passthrough() {
|
|
1724
|
-
return new
|
|
1724
|
+
return new q({
|
|
1725
1725
|
...this._def,
|
|
1726
1726
|
unknownKeys: "passthrough"
|
|
1727
1727
|
});
|
|
1728
1728
|
}
|
|
1729
1729
|
extend(t) {
|
|
1730
|
-
return new
|
|
1730
|
+
return new q({
|
|
1731
1731
|
...this._def,
|
|
1732
1732
|
shape: () => ({
|
|
1733
1733
|
...this._def.shape(),
|
|
@@ -1736,21 +1736,21 @@ var ee = class K extends T {
|
|
|
1736
1736
|
});
|
|
1737
1737
|
}
|
|
1738
1738
|
merge(t) {
|
|
1739
|
-
return new
|
|
1739
|
+
return new q({
|
|
1740
1740
|
unknownKeys: t._def.unknownKeys,
|
|
1741
1741
|
catchall: t._def.catchall,
|
|
1742
1742
|
shape: () => ({
|
|
1743
1743
|
...this._def.shape(),
|
|
1744
1744
|
...t._def.shape()
|
|
1745
1745
|
}),
|
|
1746
|
-
typeName:
|
|
1746
|
+
typeName: S.ZodObject
|
|
1747
1747
|
});
|
|
1748
1748
|
}
|
|
1749
1749
|
setKey(t, r) {
|
|
1750
1750
|
return this.augment({ [t]: r });
|
|
1751
1751
|
}
|
|
1752
1752
|
catchall(t) {
|
|
1753
|
-
return new
|
|
1753
|
+
return new q({
|
|
1754
1754
|
...this._def,
|
|
1755
1755
|
catchall: t
|
|
1756
1756
|
});
|
|
@@ -1758,7 +1758,7 @@ var ee = class K extends T {
|
|
|
1758
1758
|
pick(t) {
|
|
1759
1759
|
const r = {};
|
|
1760
1760
|
for (const a of A.objectKeys(t)) t[a] && this.shape[a] && (r[a] = this.shape[a]);
|
|
1761
|
-
return new
|
|
1761
|
+
return new q({
|
|
1762
1762
|
...this._def,
|
|
1763
1763
|
shape: () => r
|
|
1764
1764
|
});
|
|
@@ -1766,13 +1766,13 @@ var ee = class K extends T {
|
|
|
1766
1766
|
omit(t) {
|
|
1767
1767
|
const r = {};
|
|
1768
1768
|
for (const a of A.objectKeys(this.shape)) t[a] || (r[a] = this.shape[a]);
|
|
1769
|
-
return new
|
|
1769
|
+
return new q({
|
|
1770
1770
|
...this._def,
|
|
1771
1771
|
shape: () => r
|
|
1772
1772
|
});
|
|
1773
1773
|
}
|
|
1774
1774
|
deepPartial() {
|
|
1775
|
-
return
|
|
1775
|
+
return Ie(this);
|
|
1776
1776
|
}
|
|
1777
1777
|
partial(t) {
|
|
1778
1778
|
const r = {};
|
|
@@ -1780,7 +1780,7 @@ var ee = class K extends T {
|
|
|
1780
1780
|
const n = this.shape[a];
|
|
1781
1781
|
t && !t[a] ? r[a] = n : r[a] = n.optional();
|
|
1782
1782
|
}
|
|
1783
|
-
return new
|
|
1783
|
+
return new q({
|
|
1784
1784
|
...this._def,
|
|
1785
1785
|
shape: () => r
|
|
1786
1786
|
});
|
|
@@ -1790,10 +1790,10 @@ var ee = class K extends T {
|
|
|
1790
1790
|
for (const a of A.objectKeys(this.shape)) if (t && !t[a]) r[a] = this.shape[a];
|
|
1791
1791
|
else {
|
|
1792
1792
|
let n = this.shape[a];
|
|
1793
|
-
for (; n instanceof
|
|
1793
|
+
for (; n instanceof fe; ) n = n._def.innerType;
|
|
1794
1794
|
r[a] = n;
|
|
1795
1795
|
}
|
|
1796
|
-
return new
|
|
1796
|
+
return new q({
|
|
1797
1797
|
...this._def,
|
|
1798
1798
|
shape: () => r
|
|
1799
1799
|
});
|
|
@@ -1802,39 +1802,39 @@ var ee = class K extends T {
|
|
|
1802
1802
|
return Fr(A.objectKeys(this.shape));
|
|
1803
1803
|
}
|
|
1804
1804
|
};
|
|
1805
|
-
|
|
1805
|
+
te.create = (e, t) => new te({
|
|
1806
1806
|
shape: () => e,
|
|
1807
1807
|
unknownKeys: "strip",
|
|
1808
|
-
catchall:
|
|
1809
|
-
typeName:
|
|
1810
|
-
...
|
|
1808
|
+
catchall: ke.create(),
|
|
1809
|
+
typeName: S.ZodObject,
|
|
1810
|
+
...E(t)
|
|
1811
1811
|
});
|
|
1812
|
-
|
|
1812
|
+
te.strictCreate = (e, t) => new te({
|
|
1813
1813
|
shape: () => e,
|
|
1814
1814
|
unknownKeys: "strict",
|
|
1815
|
-
catchall:
|
|
1816
|
-
typeName:
|
|
1817
|
-
...
|
|
1815
|
+
catchall: ke.create(),
|
|
1816
|
+
typeName: S.ZodObject,
|
|
1817
|
+
...E(t)
|
|
1818
1818
|
});
|
|
1819
|
-
|
|
1819
|
+
te.lazycreate = (e, t) => new te({
|
|
1820
1820
|
shape: e,
|
|
1821
1821
|
unknownKeys: "strip",
|
|
1822
|
-
catchall:
|
|
1823
|
-
typeName:
|
|
1824
|
-
...
|
|
1822
|
+
catchall: ke.create(),
|
|
1823
|
+
typeName: S.ZodObject,
|
|
1824
|
+
...E(t)
|
|
1825
1825
|
});
|
|
1826
|
-
var rt = class extends
|
|
1826
|
+
var rt = class extends L {
|
|
1827
1827
|
_parse(e) {
|
|
1828
1828
|
const { ctx: t } = this._processInputParams(e), r = this._def.options;
|
|
1829
1829
|
function a(n) {
|
|
1830
1830
|
for (const s of n) if (s.result.status === "valid") return s.result;
|
|
1831
1831
|
for (const s of n) if (s.result.status === "dirty")
|
|
1832
1832
|
return t.common.issues.push(...s.ctx.common.issues), s.result;
|
|
1833
|
-
const i = n.map((s) => new
|
|
1833
|
+
const i = n.map((s) => new ie(s.ctx.common.issues));
|
|
1834
1834
|
return b(t, {
|
|
1835
1835
|
code: m.invalid_union,
|
|
1836
1836
|
unionErrors: i
|
|
1837
|
-
}),
|
|
1837
|
+
}), w;
|
|
1838
1838
|
}
|
|
1839
1839
|
if (t.common.async) return Promise.all(r.map(async (n) => {
|
|
1840
1840
|
const i = {
|
|
@@ -1878,11 +1878,11 @@ var rt = class extends T {
|
|
|
1878
1878
|
}
|
|
1879
1879
|
if (n)
|
|
1880
1880
|
return t.common.issues.push(...n.ctx.common.issues), n.result;
|
|
1881
|
-
const s = i.map((o) => new
|
|
1881
|
+
const s = i.map((o) => new ie(o));
|
|
1882
1882
|
return b(t, {
|
|
1883
1883
|
code: m.invalid_union,
|
|
1884
1884
|
unionErrors: s
|
|
1885
|
-
}),
|
|
1885
|
+
}), w;
|
|
1886
1886
|
}
|
|
1887
1887
|
}
|
|
1888
1888
|
get options() {
|
|
@@ -1891,10 +1891,10 @@ var rt = class extends T {
|
|
|
1891
1891
|
};
|
|
1892
1892
|
rt.create = (e, t) => new rt({
|
|
1893
1893
|
options: e,
|
|
1894
|
-
typeName:
|
|
1895
|
-
...
|
|
1894
|
+
typeName: S.ZodUnion,
|
|
1895
|
+
...E(t)
|
|
1896
1896
|
});
|
|
1897
|
-
var
|
|
1897
|
+
var de = (e) => e instanceof nt ? de(e.schema) : e instanceof pe ? de(e.innerType()) : e instanceof it ? [e.value] : e instanceof ft ? e.options : e instanceof st ? A.objectValues(e.enum) : e instanceof ot ? de(e._def.innerType) : e instanceof et ? [void 0] : e instanceof tt ? [null] : e instanceof fe ? [void 0, ...de(e.unwrap())] : e instanceof _e ? [null, ...de(e.unwrap())] : e instanceof Pr || e instanceof ct ? de(e.unwrap()) : e instanceof lt ? de(e._def.innerType) : [], Pa = class Zr extends L {
|
|
1898
1898
|
_parse(t) {
|
|
1899
1899
|
const { ctx: r } = this._processInputParams(t);
|
|
1900
1900
|
if (r.parsedType !== _.object)
|
|
@@ -1902,7 +1902,7 @@ var le = (e) => e instanceof nt ? le(e.schema) : e instanceof he ? le(e.innerTyp
|
|
|
1902
1902
|
code: m.invalid_type,
|
|
1903
1903
|
expected: _.object,
|
|
1904
1904
|
received: r.parsedType
|
|
1905
|
-
}),
|
|
1905
|
+
}), w;
|
|
1906
1906
|
const a = this.discriminator, n = r.data[a], i = this.optionsMap.get(n);
|
|
1907
1907
|
return i ? r.common.async ? i._parseAsync({
|
|
1908
1908
|
data: r.data,
|
|
@@ -1916,7 +1916,7 @@ var le = (e) => e instanceof nt ? le(e.schema) : e instanceof he ? le(e.innerTyp
|
|
|
1916
1916
|
code: m.invalid_union_discriminator,
|
|
1917
1917
|
options: Array.from(this.optionsMap.keys()),
|
|
1918
1918
|
path: [a]
|
|
1919
|
-
}),
|
|
1919
|
+
}), w);
|
|
1920
1920
|
}
|
|
1921
1921
|
get discriminator() {
|
|
1922
1922
|
return this._def.discriminator;
|
|
@@ -1930,7 +1930,7 @@ var le = (e) => e instanceof nt ? le(e.schema) : e instanceof he ? le(e.innerTyp
|
|
|
1930
1930
|
static create(t, r, a) {
|
|
1931
1931
|
const n = /* @__PURE__ */ new Map();
|
|
1932
1932
|
for (const i of r) {
|
|
1933
|
-
const s =
|
|
1933
|
+
const s = de(i.shape[t]);
|
|
1934
1934
|
if (!s.length) throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);
|
|
1935
1935
|
for (const o of s) {
|
|
1936
1936
|
if (n.has(o)) throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(o)}`);
|
|
@@ -1938,16 +1938,16 @@ var le = (e) => e instanceof nt ? le(e.schema) : e instanceof he ? le(e.innerTyp
|
|
|
1938
1938
|
}
|
|
1939
1939
|
}
|
|
1940
1940
|
return new Zr({
|
|
1941
|
-
typeName:
|
|
1941
|
+
typeName: S.ZodDiscriminatedUnion,
|
|
1942
1942
|
discriminator: t,
|
|
1943
1943
|
options: r,
|
|
1944
1944
|
optionsMap: n,
|
|
1945
|
-
...
|
|
1945
|
+
...E(a)
|
|
1946
1946
|
});
|
|
1947
1947
|
}
|
|
1948
1948
|
};
|
|
1949
1949
|
function At(e, t) {
|
|
1950
|
-
const r =
|
|
1950
|
+
const r = ge(e), a = ge(t);
|
|
1951
1951
|
if (e === t) return {
|
|
1952
1952
|
valid: !0,
|
|
1953
1953
|
data: e
|
|
@@ -1983,15 +1983,15 @@ function At(e, t) {
|
|
|
1983
1983
|
data: e
|
|
1984
1984
|
} : { valid: !1 };
|
|
1985
1985
|
}
|
|
1986
|
-
var at = class extends
|
|
1986
|
+
var at = class extends L {
|
|
1987
1987
|
_parse(e) {
|
|
1988
1988
|
const { status: t, ctx: r } = this._processInputParams(e), a = (n, i) => {
|
|
1989
|
-
if (tr(n) || tr(i)) return
|
|
1989
|
+
if (tr(n) || tr(i)) return w;
|
|
1990
1990
|
const s = At(n.value, i.value);
|
|
1991
1991
|
return s.valid ? ((rr(n) || rr(i)) && t.dirty(), {
|
|
1992
1992
|
status: t.value,
|
|
1993
1993
|
value: s.data
|
|
1994
|
-
}) : (b(r, { code: m.invalid_intersection_types }),
|
|
1994
|
+
}) : (b(r, { code: m.invalid_intersection_types }), w);
|
|
1995
1995
|
};
|
|
1996
1996
|
return r.common.async ? Promise.all([this._def.left._parseAsync({
|
|
1997
1997
|
data: r.data,
|
|
@@ -2015,10 +2015,10 @@ var at = class extends T {
|
|
|
2015
2015
|
at.create = (e, t, r) => new at({
|
|
2016
2016
|
left: e,
|
|
2017
2017
|
right: t,
|
|
2018
|
-
typeName:
|
|
2019
|
-
...
|
|
2018
|
+
typeName: S.ZodIntersection,
|
|
2019
|
+
...E(r)
|
|
2020
2020
|
});
|
|
2021
|
-
var
|
|
2021
|
+
var be = class Or extends L {
|
|
2022
2022
|
_parse(t) {
|
|
2023
2023
|
const { status: r, ctx: a } = this._processInputParams(t);
|
|
2024
2024
|
if (a.parsedType !== _.array)
|
|
@@ -2026,7 +2026,7 @@ var ke = class Or extends T {
|
|
|
2026
2026
|
code: m.invalid_type,
|
|
2027
2027
|
expected: _.array,
|
|
2028
2028
|
received: a.parsedType
|
|
2029
|
-
}),
|
|
2029
|
+
}), w;
|
|
2030
2030
|
if (a.data.length < this._def.items.length)
|
|
2031
2031
|
return b(a, {
|
|
2032
2032
|
code: m.too_small,
|
|
@@ -2034,7 +2034,7 @@ var ke = class Or extends T {
|
|
|
2034
2034
|
inclusive: !0,
|
|
2035
2035
|
exact: !1,
|
|
2036
2036
|
type: "array"
|
|
2037
|
-
}),
|
|
2037
|
+
}), w;
|
|
2038
2038
|
!this._def.rest && a.data.length > this._def.items.length && (b(a, {
|
|
2039
2039
|
code: m.too_big,
|
|
2040
2040
|
maximum: this._def.items.length,
|
|
@@ -2044,9 +2044,9 @@ var ke = class Or extends T {
|
|
|
2044
2044
|
}), r.dirty());
|
|
2045
2045
|
const n = [...a.data].map((i, s) => {
|
|
2046
2046
|
const o = this._def.items[s] || this._def.rest;
|
|
2047
|
-
return o ? o._parse(new
|
|
2047
|
+
return o ? o._parse(new se(a, i, a.path, s)) : null;
|
|
2048
2048
|
}).filter((i) => !!i);
|
|
2049
|
-
return a.common.async ? Promise.all(n).then((i) =>
|
|
2049
|
+
return a.common.async ? Promise.all(n).then((i) => J.mergeArray(r, i)) : J.mergeArray(r, n);
|
|
2050
2050
|
}
|
|
2051
2051
|
get items() {
|
|
2052
2052
|
return this._def.items;
|
|
@@ -2058,16 +2058,16 @@ var ke = class Or extends T {
|
|
|
2058
2058
|
});
|
|
2059
2059
|
}
|
|
2060
2060
|
};
|
|
2061
|
-
|
|
2061
|
+
be.create = (e, t) => {
|
|
2062
2062
|
if (!Array.isArray(e)) throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2063
|
-
return new
|
|
2063
|
+
return new be({
|
|
2064
2064
|
items: e,
|
|
2065
|
-
typeName:
|
|
2065
|
+
typeName: S.ZodTuple,
|
|
2066
2066
|
rest: null,
|
|
2067
|
-
...
|
|
2067
|
+
...E(t)
|
|
2068
2068
|
});
|
|
2069
2069
|
};
|
|
2070
|
-
var $a = class Rt extends
|
|
2070
|
+
var $a = class Rt extends L {
|
|
2071
2071
|
get keySchema() {
|
|
2072
2072
|
return this._def.keyType;
|
|
2073
2073
|
}
|
|
@@ -2081,32 +2081,32 @@ var $a = class Rt extends T {
|
|
|
2081
2081
|
code: m.invalid_type,
|
|
2082
2082
|
expected: _.object,
|
|
2083
2083
|
received: a.parsedType
|
|
2084
|
-
}),
|
|
2084
|
+
}), w;
|
|
2085
2085
|
const n = [], i = this._def.keyType, s = this._def.valueType;
|
|
2086
2086
|
for (const o in a.data) n.push({
|
|
2087
|
-
key: i._parse(new
|
|
2088
|
-
value: s._parse(new
|
|
2087
|
+
key: i._parse(new se(a, o, a.path, o)),
|
|
2088
|
+
value: s._parse(new se(a, a.data[o], a.path, o)),
|
|
2089
2089
|
alwaysSet: o in a.data
|
|
2090
2090
|
});
|
|
2091
|
-
return a.common.async ?
|
|
2091
|
+
return a.common.async ? J.mergeObjectAsync(r, n) : J.mergeObjectSync(r, n);
|
|
2092
2092
|
}
|
|
2093
2093
|
get element() {
|
|
2094
2094
|
return this._def.valueType;
|
|
2095
2095
|
}
|
|
2096
2096
|
static create(t, r, a) {
|
|
2097
|
-
return r instanceof
|
|
2097
|
+
return r instanceof L ? new Rt({
|
|
2098
2098
|
keyType: t,
|
|
2099
2099
|
valueType: r,
|
|
2100
|
-
typeName:
|
|
2101
|
-
...
|
|
2100
|
+
typeName: S.ZodRecord,
|
|
2101
|
+
...E(a)
|
|
2102
2102
|
}) : new Rt({
|
|
2103
2103
|
keyType: qe.create(),
|
|
2104
2104
|
valueType: t,
|
|
2105
|
-
typeName:
|
|
2106
|
-
...
|
|
2105
|
+
typeName: S.ZodRecord,
|
|
2106
|
+
...E(r)
|
|
2107
2107
|
});
|
|
2108
2108
|
}
|
|
2109
|
-
}, jt = class extends
|
|
2109
|
+
}, jt = class extends L {
|
|
2110
2110
|
get keySchema() {
|
|
2111
2111
|
return this._def.keyType;
|
|
2112
2112
|
}
|
|
@@ -2120,17 +2120,17 @@ var $a = class Rt extends T {
|
|
|
2120
2120
|
code: m.invalid_type,
|
|
2121
2121
|
expected: _.map,
|
|
2122
2122
|
received: r.parsedType
|
|
2123
|
-
}),
|
|
2123
|
+
}), w;
|
|
2124
2124
|
const a = this._def.keyType, n = this._def.valueType, i = [...r.data.entries()].map(([s, o], l) => ({
|
|
2125
|
-
key: a._parse(new
|
|
2126
|
-
value: n._parse(new
|
|
2125
|
+
key: a._parse(new se(r, s, r.path, [l, "key"])),
|
|
2126
|
+
value: n._parse(new se(r, o, r.path, [l, "value"]))
|
|
2127
2127
|
}));
|
|
2128
2128
|
if (r.common.async) {
|
|
2129
2129
|
const s = /* @__PURE__ */ new Map();
|
|
2130
2130
|
return Promise.resolve().then(async () => {
|
|
2131
2131
|
for (const o of i) {
|
|
2132
2132
|
const l = await o.key, c = await o.value;
|
|
2133
|
-
if (l.status === "aborted" || c.status === "aborted") return
|
|
2133
|
+
if (l.status === "aborted" || c.status === "aborted") return w;
|
|
2134
2134
|
(l.status === "dirty" || c.status === "dirty") && t.dirty(), s.set(l.value, c.value);
|
|
2135
2135
|
}
|
|
2136
2136
|
return {
|
|
@@ -2142,7 +2142,7 @@ var $a = class Rt extends T {
|
|
|
2142
2142
|
const s = /* @__PURE__ */ new Map();
|
|
2143
2143
|
for (const o of i) {
|
|
2144
2144
|
const l = o.key, c = o.value;
|
|
2145
|
-
if (l.status === "aborted" || c.status === "aborted") return
|
|
2145
|
+
if (l.status === "aborted" || c.status === "aborted") return w;
|
|
2146
2146
|
(l.status === "dirty" || c.status === "dirty") && t.dirty(), s.set(l.value, c.value);
|
|
2147
2147
|
}
|
|
2148
2148
|
return {
|
|
@@ -2155,10 +2155,10 @@ var $a = class Rt extends T {
|
|
|
2155
2155
|
jt.create = (e, t, r) => new jt({
|
|
2156
2156
|
valueType: t,
|
|
2157
2157
|
keyType: e,
|
|
2158
|
-
typeName:
|
|
2159
|
-
...
|
|
2158
|
+
typeName: S.ZodMap,
|
|
2159
|
+
...E(r)
|
|
2160
2160
|
});
|
|
2161
|
-
var Zt = class Ot extends
|
|
2161
|
+
var Zt = class Ot extends L {
|
|
2162
2162
|
_parse(t) {
|
|
2163
2163
|
const { status: r, ctx: a } = this._processInputParams(t);
|
|
2164
2164
|
if (a.parsedType !== _.set)
|
|
@@ -2166,7 +2166,7 @@ var Zt = class Ot extends T {
|
|
|
2166
2166
|
code: m.invalid_type,
|
|
2167
2167
|
expected: _.set,
|
|
2168
2168
|
received: a.parsedType
|
|
2169
|
-
}),
|
|
2169
|
+
}), w;
|
|
2170
2170
|
const n = this._def;
|
|
2171
2171
|
n.minSize !== null && a.data.size < n.minSize.value && (b(a, {
|
|
2172
2172
|
code: m.too_small,
|
|
@@ -2187,7 +2187,7 @@ var Zt = class Ot extends T {
|
|
|
2187
2187
|
function s(l) {
|
|
2188
2188
|
const c = /* @__PURE__ */ new Set();
|
|
2189
2189
|
for (const u of l) {
|
|
2190
|
-
if (u.status === "aborted") return
|
|
2190
|
+
if (u.status === "aborted") return w;
|
|
2191
2191
|
u.status === "dirty" && r.dirty(), c.add(u.value);
|
|
2192
2192
|
}
|
|
2193
2193
|
return {
|
|
@@ -2195,7 +2195,7 @@ var Zt = class Ot extends T {
|
|
|
2195
2195
|
value: c
|
|
2196
2196
|
};
|
|
2197
2197
|
}
|
|
2198
|
-
const o = [...a.data.values()].map((l, c) => i._parse(new
|
|
2198
|
+
const o = [...a.data.values()].map((l, c) => i._parse(new se(a, l, a.path, c)));
|
|
2199
2199
|
return a.common.async ? Promise.all(o).then((l) => s(l)) : s(o);
|
|
2200
2200
|
}
|
|
2201
2201
|
min(t, r) {
|
|
@@ -2227,10 +2227,10 @@ Zt.create = (e, t) => new Zt({
|
|
|
2227
2227
|
valueType: e,
|
|
2228
2228
|
minSize: null,
|
|
2229
2229
|
maxSize: null,
|
|
2230
|
-
typeName:
|
|
2231
|
-
...
|
|
2230
|
+
typeName: S.ZodSet,
|
|
2231
|
+
...E(t)
|
|
2232
2232
|
});
|
|
2233
|
-
var Va = class Je extends
|
|
2233
|
+
var Va = class Je extends L {
|
|
2234
2234
|
constructor() {
|
|
2235
2235
|
super(...arguments), this.validate = this.implement;
|
|
2236
2236
|
}
|
|
@@ -2241,7 +2241,7 @@ var Va = class Je extends T {
|
|
|
2241
2241
|
code: m.invalid_type,
|
|
2242
2242
|
expected: _.function,
|
|
2243
2243
|
received: r.parsedType
|
|
2244
|
-
}),
|
|
2244
|
+
}), w;
|
|
2245
2245
|
function a(o, l) {
|
|
2246
2246
|
return xt({
|
|
2247
2247
|
data: o,
|
|
@@ -2250,7 +2250,7 @@ var Va = class Je extends T {
|
|
|
2250
2250
|
r.common.contextualErrorMap,
|
|
2251
2251
|
r.schemaErrorMap,
|
|
2252
2252
|
_t(),
|
|
2253
|
-
|
|
2253
|
+
Oe
|
|
2254
2254
|
].filter((c) => !!c),
|
|
2255
2255
|
issueData: {
|
|
2256
2256
|
code: m.invalid_arguments,
|
|
@@ -2266,7 +2266,7 @@ var Va = class Je extends T {
|
|
|
2266
2266
|
r.common.contextualErrorMap,
|
|
2267
2267
|
r.schemaErrorMap,
|
|
2268
2268
|
_t(),
|
|
2269
|
-
|
|
2269
|
+
Oe
|
|
2270
2270
|
].filter((c) => !!c),
|
|
2271
2271
|
issueData: {
|
|
2272
2272
|
code: m.invalid_return_type,
|
|
@@ -2275,10 +2275,10 @@ var Va = class Je extends T {
|
|
|
2275
2275
|
});
|
|
2276
2276
|
}
|
|
2277
2277
|
const i = { errorMap: r.common.contextualErrorMap }, s = r.data;
|
|
2278
|
-
if (this._def.returns instanceof
|
|
2278
|
+
if (this._def.returns instanceof Fe) {
|
|
2279
2279
|
const o = this;
|
|
2280
|
-
return
|
|
2281
|
-
const c = new
|
|
2280
|
+
return U(async function(...l) {
|
|
2281
|
+
const c = new ie([]), u = await o._def.args.parseAsync(l, i).catch((p) => {
|
|
2282
2282
|
throw c.addIssue(a(l, p)), c;
|
|
2283
2283
|
}), h = await Reflect.apply(s, this, u);
|
|
2284
2284
|
return await o._def.returns._def.type.parseAsync(h, i).catch((p) => {
|
|
@@ -2287,11 +2287,11 @@ var Va = class Je extends T {
|
|
|
2287
2287
|
});
|
|
2288
2288
|
} else {
|
|
2289
2289
|
const o = this;
|
|
2290
|
-
return
|
|
2290
|
+
return U(function(...l) {
|
|
2291
2291
|
const c = o._def.args.safeParse(l, i);
|
|
2292
|
-
if (!c.success) throw new
|
|
2292
|
+
if (!c.success) throw new ie([a(l, c.error)]);
|
|
2293
2293
|
const u = Reflect.apply(s, this, c.data), h = o._def.returns.safeParse(u, i);
|
|
2294
|
-
if (!h.success) throw new
|
|
2294
|
+
if (!h.success) throw new ie([n(u, h.error)]);
|
|
2295
2295
|
return h.data;
|
|
2296
2296
|
});
|
|
2297
2297
|
}
|
|
@@ -2305,7 +2305,7 @@ var Va = class Je extends T {
|
|
|
2305
2305
|
args(...t) {
|
|
2306
2306
|
return new Je({
|
|
2307
2307
|
...this._def,
|
|
2308
|
-
args:
|
|
2308
|
+
args: be.create(t).rest(Ne.create())
|
|
2309
2309
|
});
|
|
2310
2310
|
}
|
|
2311
2311
|
returns(t) {
|
|
@@ -2322,13 +2322,13 @@ var Va = class Je extends T {
|
|
|
2322
2322
|
}
|
|
2323
2323
|
static create(t, r, a) {
|
|
2324
2324
|
return new Je({
|
|
2325
|
-
args: t ||
|
|
2326
|
-
returns: r ||
|
|
2327
|
-
typeName:
|
|
2328
|
-
...
|
|
2325
|
+
args: t || be.create([]).rest(Ne.create()),
|
|
2326
|
+
returns: r || Ne.create(),
|
|
2327
|
+
typeName: S.ZodFunction,
|
|
2328
|
+
...E(a)
|
|
2329
2329
|
});
|
|
2330
2330
|
}
|
|
2331
|
-
}, nt = class extends
|
|
2331
|
+
}, nt = class extends L {
|
|
2332
2332
|
get schema() {
|
|
2333
2333
|
return this._def.getter();
|
|
2334
2334
|
}
|
|
@@ -2343,10 +2343,10 @@ var Va = class Je extends T {
|
|
|
2343
2343
|
};
|
|
2344
2344
|
nt.create = (e, t) => new nt({
|
|
2345
2345
|
getter: e,
|
|
2346
|
-
typeName:
|
|
2347
|
-
...
|
|
2346
|
+
typeName: S.ZodLazy,
|
|
2347
|
+
...E(t)
|
|
2348
2348
|
});
|
|
2349
|
-
var it = class extends
|
|
2349
|
+
var it = class extends L {
|
|
2350
2350
|
_parse(e) {
|
|
2351
2351
|
if (e.data !== this._def.value) {
|
|
2352
2352
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2354,7 +2354,7 @@ var it = class extends T {
|
|
|
2354
2354
|
received: t.data,
|
|
2355
2355
|
code: m.invalid_literal,
|
|
2356
2356
|
expected: this._def.value
|
|
2357
|
-
}),
|
|
2357
|
+
}), w;
|
|
2358
2358
|
}
|
|
2359
2359
|
return {
|
|
2360
2360
|
status: "valid",
|
|
@@ -2367,17 +2367,17 @@ var it = class extends T {
|
|
|
2367
2367
|
};
|
|
2368
2368
|
it.create = (e, t) => new it({
|
|
2369
2369
|
value: e,
|
|
2370
|
-
typeName:
|
|
2371
|
-
...
|
|
2370
|
+
typeName: S.ZodLiteral,
|
|
2371
|
+
...E(t)
|
|
2372
2372
|
});
|
|
2373
2373
|
function Fr(e, t) {
|
|
2374
2374
|
return new ft({
|
|
2375
2375
|
values: e,
|
|
2376
|
-
typeName:
|
|
2377
|
-
...
|
|
2376
|
+
typeName: S.ZodEnum,
|
|
2377
|
+
...E(t)
|
|
2378
2378
|
});
|
|
2379
2379
|
}
|
|
2380
|
-
var ft = class Ft extends
|
|
2380
|
+
var ft = class Ft extends L {
|
|
2381
2381
|
_parse(t) {
|
|
2382
2382
|
if (typeof t.data != "string") {
|
|
2383
2383
|
const r = this._getOrReturnCtx(t), a = this._def.values;
|
|
@@ -2385,7 +2385,7 @@ var ft = class Ft extends T {
|
|
|
2385
2385
|
expected: A.joinValues(a),
|
|
2386
2386
|
received: r.parsedType,
|
|
2387
2387
|
code: m.invalid_type
|
|
2388
|
-
}),
|
|
2388
|
+
}), w;
|
|
2389
2389
|
}
|
|
2390
2390
|
if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(t.data)) {
|
|
2391
2391
|
const r = this._getOrReturnCtx(t), a = this._def.values;
|
|
@@ -2393,9 +2393,9 @@ var ft = class Ft extends T {
|
|
|
2393
2393
|
received: r.data,
|
|
2394
2394
|
code: m.invalid_enum_value,
|
|
2395
2395
|
options: a
|
|
2396
|
-
}),
|
|
2396
|
+
}), w;
|
|
2397
2397
|
}
|
|
2398
|
-
return
|
|
2398
|
+
return U(t.data);
|
|
2399
2399
|
}
|
|
2400
2400
|
get options() {
|
|
2401
2401
|
return this._def.values;
|
|
@@ -2429,7 +2429,7 @@ var ft = class Ft extends T {
|
|
|
2429
2429
|
}
|
|
2430
2430
|
};
|
|
2431
2431
|
ft.create = Fr;
|
|
2432
|
-
var st = class extends
|
|
2432
|
+
var st = class extends L {
|
|
2433
2433
|
_parse(e) {
|
|
2434
2434
|
const t = A.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(e);
|
|
2435
2435
|
if (r.parsedType !== _.string && r.parsedType !== _.number) {
|
|
@@ -2438,7 +2438,7 @@ var st = class extends T {
|
|
|
2438
2438
|
expected: A.joinValues(a),
|
|
2439
2439
|
received: r.parsedType,
|
|
2440
2440
|
code: m.invalid_type
|
|
2441
|
-
}),
|
|
2441
|
+
}), w;
|
|
2442
2442
|
}
|
|
2443
2443
|
if (this._cache || (this._cache = new Set(A.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
2444
2444
|
const a = A.objectValues(t);
|
|
@@ -2446,9 +2446,9 @@ var st = class extends T {
|
|
|
2446
2446
|
received: r.data,
|
|
2447
2447
|
code: m.invalid_enum_value,
|
|
2448
2448
|
options: a
|
|
2449
|
-
}),
|
|
2449
|
+
}), w;
|
|
2450
2450
|
}
|
|
2451
|
-
return
|
|
2451
|
+
return U(e.data);
|
|
2452
2452
|
}
|
|
2453
2453
|
get enum() {
|
|
2454
2454
|
return this._def.values;
|
|
@@ -2456,10 +2456,10 @@ var st = class extends T {
|
|
|
2456
2456
|
};
|
|
2457
2457
|
st.create = (e, t) => new st({
|
|
2458
2458
|
values: e,
|
|
2459
|
-
typeName:
|
|
2460
|
-
...
|
|
2459
|
+
typeName: S.ZodNativeEnum,
|
|
2460
|
+
...E(t)
|
|
2461
2461
|
});
|
|
2462
|
-
var
|
|
2462
|
+
var Fe = class extends L {
|
|
2463
2463
|
unwrap() {
|
|
2464
2464
|
return this._def.type;
|
|
2465
2465
|
}
|
|
@@ -2469,23 +2469,23 @@ var Oe = class extends T {
|
|
|
2469
2469
|
code: m.invalid_type,
|
|
2470
2470
|
expected: _.promise,
|
|
2471
2471
|
received: t.parsedType
|
|
2472
|
-
}),
|
|
2472
|
+
}), w) : U((t.parsedType === _.promise ? t.data : Promise.resolve(t.data)).then((r) => this._def.type.parseAsync(r, {
|
|
2473
2473
|
path: t.path,
|
|
2474
2474
|
errorMap: t.common.contextualErrorMap
|
|
2475
2475
|
})));
|
|
2476
2476
|
}
|
|
2477
2477
|
};
|
|
2478
|
-
|
|
2478
|
+
Fe.create = (e, t) => new Fe({
|
|
2479
2479
|
type: e,
|
|
2480
|
-
typeName:
|
|
2481
|
-
...
|
|
2480
|
+
typeName: S.ZodPromise,
|
|
2481
|
+
...E(t)
|
|
2482
2482
|
});
|
|
2483
|
-
var
|
|
2483
|
+
var pe = class extends L {
|
|
2484
2484
|
innerType() {
|
|
2485
2485
|
return this._def.schema;
|
|
2486
2486
|
}
|
|
2487
2487
|
sourceType() {
|
|
2488
|
-
return this._def.schema._def.typeName ===
|
|
2488
|
+
return this._def.schema._def.typeName === S.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2489
2489
|
}
|
|
2490
2490
|
_parse(e) {
|
|
2491
2491
|
const { status: t, ctx: r } = this._processInputParams(e), a = this._def.effect || null, n = {
|
|
@@ -2499,22 +2499,22 @@ var he = class extends T {
|
|
|
2499
2499
|
if (n.addIssue = n.addIssue.bind(n), a.type === "preprocess") {
|
|
2500
2500
|
const i = a.transform(r.data, n);
|
|
2501
2501
|
if (r.common.async) return Promise.resolve(i).then(async (s) => {
|
|
2502
|
-
if (t.value === "aborted") return
|
|
2502
|
+
if (t.value === "aborted") return w;
|
|
2503
2503
|
const o = await this._def.schema._parseAsync({
|
|
2504
2504
|
data: s,
|
|
2505
2505
|
path: r.path,
|
|
2506
2506
|
parent: r
|
|
2507
2507
|
});
|
|
2508
|
-
return o.status === "aborted" ?
|
|
2508
|
+
return o.status === "aborted" ? w : o.status === "dirty" || t.value === "dirty" ? je(o.value) : o;
|
|
2509
2509
|
});
|
|
2510
2510
|
{
|
|
2511
|
-
if (t.value === "aborted") return
|
|
2511
|
+
if (t.value === "aborted") return w;
|
|
2512
2512
|
const s = this._def.schema._parseSync({
|
|
2513
2513
|
data: i,
|
|
2514
2514
|
path: r.path,
|
|
2515
2515
|
parent: r
|
|
2516
2516
|
});
|
|
2517
|
-
return s.status === "aborted" ?
|
|
2517
|
+
return s.status === "aborted" ? w : s.status === "dirty" || t.value === "dirty" ? je(s.value) : s;
|
|
2518
2518
|
}
|
|
2519
2519
|
}
|
|
2520
2520
|
if (a.type === "refinement") {
|
|
@@ -2530,7 +2530,7 @@ var he = class extends T {
|
|
|
2530
2530
|
path: r.path,
|
|
2531
2531
|
parent: r
|
|
2532
2532
|
});
|
|
2533
|
-
return s.status === "aborted" ?
|
|
2533
|
+
return s.status === "aborted" ? w : (s.status === "dirty" && t.dirty(), i(s.value), {
|
|
2534
2534
|
status: t.value,
|
|
2535
2535
|
value: s.value
|
|
2536
2536
|
});
|
|
@@ -2538,7 +2538,7 @@ var he = class extends T {
|
|
|
2538
2538
|
data: r.data,
|
|
2539
2539
|
path: r.path,
|
|
2540
2540
|
parent: r
|
|
2541
|
-
}).then((s) => s.status === "aborted" ?
|
|
2541
|
+
}).then((s) => s.status === "aborted" ? w : (s.status === "dirty" && t.dirty(), i(s.value).then(() => ({
|
|
2542
2542
|
status: t.value,
|
|
2543
2543
|
value: s.value
|
|
2544
2544
|
}))));
|
|
@@ -2549,7 +2549,7 @@ var he = class extends T {
|
|
|
2549
2549
|
path: r.path,
|
|
2550
2550
|
parent: r
|
|
2551
2551
|
});
|
|
2552
|
-
if (!
|
|
2552
|
+
if (!Me(i)) return w;
|
|
2553
2553
|
const s = a.transform(i.value, n);
|
|
2554
2554
|
if (s instanceof Promise) throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2555
2555
|
return {
|
|
@@ -2560,55 +2560,55 @@ var he = class extends T {
|
|
|
2560
2560
|
data: r.data,
|
|
2561
2561
|
path: r.path,
|
|
2562
2562
|
parent: r
|
|
2563
|
-
}).then((i) =>
|
|
2563
|
+
}).then((i) => Me(i) ? Promise.resolve(a.transform(i.value, n)).then((s) => ({
|
|
2564
2564
|
status: t.value,
|
|
2565
2565
|
value: s
|
|
2566
|
-
})) :
|
|
2566
|
+
})) : w);
|
|
2567
2567
|
A.assertNever(a);
|
|
2568
2568
|
}
|
|
2569
2569
|
};
|
|
2570
|
-
|
|
2570
|
+
pe.create = (e, t, r) => new pe({
|
|
2571
2571
|
schema: e,
|
|
2572
|
-
typeName:
|
|
2572
|
+
typeName: S.ZodEffects,
|
|
2573
2573
|
effect: t,
|
|
2574
|
-
...
|
|
2574
|
+
...E(r)
|
|
2575
2575
|
});
|
|
2576
|
-
|
|
2576
|
+
pe.createWithPreprocess = (e, t, r) => new pe({
|
|
2577
2577
|
schema: t,
|
|
2578
2578
|
effect: {
|
|
2579
2579
|
type: "preprocess",
|
|
2580
2580
|
transform: e
|
|
2581
2581
|
},
|
|
2582
|
-
typeName:
|
|
2583
|
-
...
|
|
2582
|
+
typeName: S.ZodEffects,
|
|
2583
|
+
...E(r)
|
|
2584
2584
|
});
|
|
2585
|
-
var
|
|
2585
|
+
var fe = class extends L {
|
|
2586
2586
|
_parse(e) {
|
|
2587
|
-
return this._getType(e) === _.undefined ?
|
|
2587
|
+
return this._getType(e) === _.undefined ? U(void 0) : this._def.innerType._parse(e);
|
|
2588
2588
|
}
|
|
2589
2589
|
unwrap() {
|
|
2590
2590
|
return this._def.innerType;
|
|
2591
2591
|
}
|
|
2592
2592
|
};
|
|
2593
|
-
|
|
2593
|
+
fe.create = (e, t) => new fe({
|
|
2594
2594
|
innerType: e,
|
|
2595
|
-
typeName:
|
|
2596
|
-
...
|
|
2595
|
+
typeName: S.ZodOptional,
|
|
2596
|
+
...E(t)
|
|
2597
2597
|
});
|
|
2598
|
-
var
|
|
2598
|
+
var _e = class extends L {
|
|
2599
2599
|
_parse(e) {
|
|
2600
|
-
return this._getType(e) === _.null ?
|
|
2600
|
+
return this._getType(e) === _.null ? U(null) : this._def.innerType._parse(e);
|
|
2601
2601
|
}
|
|
2602
2602
|
unwrap() {
|
|
2603
2603
|
return this._def.innerType;
|
|
2604
2604
|
}
|
|
2605
2605
|
};
|
|
2606
|
-
|
|
2606
|
+
_e.create = (e, t) => new _e({
|
|
2607
2607
|
innerType: e,
|
|
2608
|
-
typeName:
|
|
2609
|
-
...
|
|
2608
|
+
typeName: S.ZodNullable,
|
|
2609
|
+
...E(t)
|
|
2610
2610
|
});
|
|
2611
|
-
var ot = class extends
|
|
2611
|
+
var ot = class extends L {
|
|
2612
2612
|
_parse(e) {
|
|
2613
2613
|
const { ctx: t } = this._processInputParams(e);
|
|
2614
2614
|
let r = t.data;
|
|
@@ -2624,11 +2624,11 @@ var ot = class extends T {
|
|
|
2624
2624
|
};
|
|
2625
2625
|
ot.create = (e, t) => new ot({
|
|
2626
2626
|
innerType: e,
|
|
2627
|
-
typeName:
|
|
2627
|
+
typeName: S.ZodDefault,
|
|
2628
2628
|
defaultValue: typeof t.default == "function" ? t.default : () => t.default,
|
|
2629
|
-
...
|
|
2629
|
+
...E(t)
|
|
2630
2630
|
});
|
|
2631
|
-
var lt = class extends
|
|
2631
|
+
var lt = class extends L {
|
|
2632
2632
|
_parse(e) {
|
|
2633
2633
|
const { ctx: t } = this._processInputParams(e), r = {
|
|
2634
2634
|
...t,
|
|
@@ -2645,7 +2645,7 @@ var lt = class extends T {
|
|
|
2645
2645
|
status: "valid",
|
|
2646
2646
|
value: n.status === "valid" ? n.value : this._def.catchValue({
|
|
2647
2647
|
get error() {
|
|
2648
|
-
return new
|
|
2648
|
+
return new ie(r.common.issues);
|
|
2649
2649
|
},
|
|
2650
2650
|
input: r.data
|
|
2651
2651
|
})
|
|
@@ -2653,7 +2653,7 @@ var lt = class extends T {
|
|
|
2653
2653
|
status: "valid",
|
|
2654
2654
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2655
2655
|
get error() {
|
|
2656
|
-
return new
|
|
2656
|
+
return new ie(r.common.issues);
|
|
2657
2657
|
},
|
|
2658
2658
|
input: r.data
|
|
2659
2659
|
})
|
|
@@ -2665,11 +2665,11 @@ var lt = class extends T {
|
|
|
2665
2665
|
};
|
|
2666
2666
|
lt.create = (e, t) => new lt({
|
|
2667
2667
|
innerType: e,
|
|
2668
|
-
typeName:
|
|
2668
|
+
typeName: S.ZodCatch,
|
|
2669
2669
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
2670
|
-
...
|
|
2670
|
+
...E(t)
|
|
2671
2671
|
});
|
|
2672
|
-
var Pt = class extends
|
|
2672
|
+
var Pt = class extends L {
|
|
2673
2673
|
_parse(e) {
|
|
2674
2674
|
if (this._getType(e) !== _.nan) {
|
|
2675
2675
|
const t = this._getOrReturnCtx(e);
|
|
@@ -2677,7 +2677,7 @@ var Pt = class extends T {
|
|
|
2677
2677
|
code: m.invalid_type,
|
|
2678
2678
|
expected: _.nan,
|
|
2679
2679
|
received: t.parsedType
|
|
2680
|
-
}),
|
|
2680
|
+
}), w;
|
|
2681
2681
|
}
|
|
2682
2682
|
return {
|
|
2683
2683
|
status: "valid",
|
|
@@ -2686,10 +2686,10 @@ var Pt = class extends T {
|
|
|
2686
2686
|
}
|
|
2687
2687
|
};
|
|
2688
2688
|
Pt.create = (e) => new Pt({
|
|
2689
|
-
typeName:
|
|
2690
|
-
...
|
|
2689
|
+
typeName: S.ZodNaN,
|
|
2690
|
+
...E(e)
|
|
2691
2691
|
});
|
|
2692
|
-
var Pr = class extends
|
|
2692
|
+
var Pr = class extends L {
|
|
2693
2693
|
_parse(e) {
|
|
2694
2694
|
const { ctx: t } = this._processInputParams(e), r = t.data;
|
|
2695
2695
|
return this._def.type._parse({
|
|
@@ -2701,7 +2701,7 @@ var Pr = class extends T {
|
|
|
2701
2701
|
unwrap() {
|
|
2702
2702
|
return this._def.type;
|
|
2703
2703
|
}
|
|
2704
|
-
}, $r = class Vr extends
|
|
2704
|
+
}, $r = class Vr extends L {
|
|
2705
2705
|
_parse(t) {
|
|
2706
2706
|
const { status: r, ctx: a } = this._processInputParams(t);
|
|
2707
2707
|
if (a.common.async)
|
|
@@ -2711,7 +2711,7 @@ var Pr = class extends T {
|
|
|
2711
2711
|
path: a.path,
|
|
2712
2712
|
parent: a
|
|
2713
2713
|
});
|
|
2714
|
-
return i.status === "aborted" ?
|
|
2714
|
+
return i.status === "aborted" ? w : i.status === "dirty" ? (r.dirty(), je(i.value)) : this._def.out._parseAsync({
|
|
2715
2715
|
data: i.value,
|
|
2716
2716
|
path: a.path,
|
|
2717
2717
|
parent: a
|
|
@@ -2723,7 +2723,7 @@ var Pr = class extends T {
|
|
|
2723
2723
|
path: a.path,
|
|
2724
2724
|
parent: a
|
|
2725
2725
|
});
|
|
2726
|
-
return n.status === "aborted" ?
|
|
2726
|
+
return n.status === "aborted" ? w : n.status === "dirty" ? (r.dirty(), {
|
|
2727
2727
|
status: "dirty",
|
|
2728
2728
|
value: n.value
|
|
2729
2729
|
}) : this._def.out._parseSync({
|
|
@@ -2737,12 +2737,12 @@ var Pr = class extends T {
|
|
|
2737
2737
|
return new Vr({
|
|
2738
2738
|
in: t,
|
|
2739
2739
|
out: r,
|
|
2740
|
-
typeName:
|
|
2740
|
+
typeName: S.ZodPipeline
|
|
2741
2741
|
});
|
|
2742
2742
|
}
|
|
2743
|
-
}, ct = class extends
|
|
2743
|
+
}, ct = class extends L {
|
|
2744
2744
|
_parse(e) {
|
|
2745
|
-
const t = this._def.innerType._parse(e), r = (a) => (
|
|
2745
|
+
const t = this._def.innerType._parse(e), r = (a) => (Me(a) && (a.value = Object.freeze(a.value)), a);
|
|
2746
2746
|
return Ke(t) ? t.then((a) => r(a)) : r(t);
|
|
2747
2747
|
}
|
|
2748
2748
|
unwrap() {
|
|
@@ -2751,38 +2751,38 @@ var Pr = class extends T {
|
|
|
2751
2751
|
};
|
|
2752
2752
|
ct.create = (e, t) => new ct({
|
|
2753
2753
|
innerType: e,
|
|
2754
|
-
typeName:
|
|
2755
|
-
...
|
|
2754
|
+
typeName: S.ZodReadonly,
|
|
2755
|
+
...E(t)
|
|
2756
2756
|
});
|
|
2757
|
-
var xo = { object:
|
|
2757
|
+
var xo = { object: te.lazycreate }, S;
|
|
2758
2758
|
(function(e) {
|
|
2759
2759
|
e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
|
|
2760
|
-
})(
|
|
2761
|
-
var
|
|
2760
|
+
})(S || (S = {}));
|
|
2761
|
+
var z = qe.create, wo = wt.create, So = Pt.create, Co = Ct.create, vt = Nt.create, Io = Et.create, No = Mt.create, Eo = et.create, Mo = tt.create, Lo = Lt.create, za = Ne.create, To = ke.create, Ao = Tt.create, Ro = Le.create, Dt = te.create, jo = te.strictCreate, Zo = rt.create, Oo = Pa.create, Fo = at.create, Po = be.create, Wa = $a.create, $o = jt.create, Vo = Zt.create, zo = Va.create, Wo = nt.create, Do = it.create, $t = ft.create, Uo = st.create, Bo = Fe.create, Go = pe.create, Ho = fe.create, Yo = _e.create, Xo = pe.createWithPreprocess, Jo = $r.create, Da = Dt({
|
|
2762
2762
|
mode: $t([
|
|
2763
2763
|
"light",
|
|
2764
2764
|
"dark",
|
|
2765
2765
|
"system"
|
|
2766
2766
|
]).optional(),
|
|
2767
|
-
accentColor:
|
|
2768
|
-
fontFamily:
|
|
2769
|
-
borderRadius:
|
|
2767
|
+
accentColor: z().optional(),
|
|
2768
|
+
fontFamily: z().optional(),
|
|
2769
|
+
borderRadius: z().optional()
|
|
2770
2770
|
}), Ua = Dt({
|
|
2771
|
-
externalId:
|
|
2772
|
-
authId:
|
|
2773
|
-
name:
|
|
2774
|
-
email:
|
|
2771
|
+
externalId: z().optional(),
|
|
2772
|
+
authId: z().optional(),
|
|
2773
|
+
name: z().optional(),
|
|
2774
|
+
email: z().optional()
|
|
2775
2775
|
}), zr = Dt({
|
|
2776
|
-
agentId:
|
|
2777
|
-
apiBaseUrl:
|
|
2778
|
-
tenantId:
|
|
2776
|
+
agentId: z().min(1, "agentId is required"),
|
|
2777
|
+
apiBaseUrl: z().url("apiBaseUrl must be a valid URL"),
|
|
2778
|
+
tenantId: z().optional(),
|
|
2779
2779
|
user: Ua.optional(),
|
|
2780
|
-
sessionId:
|
|
2780
|
+
sessionId: z().optional(),
|
|
2781
2781
|
mode: $t(["floating", "inline"]).optional(),
|
|
2782
|
-
title:
|
|
2783
|
-
subtitle:
|
|
2784
|
-
description:
|
|
2785
|
-
avatarUrl:
|
|
2782
|
+
title: z().optional(),
|
|
2783
|
+
subtitle: z().optional(),
|
|
2784
|
+
description: z().optional(),
|
|
2785
|
+
avatarUrl: z().optional(),
|
|
2786
2786
|
streaming: vt().optional(),
|
|
2787
2787
|
preview: vt().optional(),
|
|
2788
2788
|
skipServerConfigFetch: vt().optional(),
|
|
@@ -2792,7 +2792,7 @@ var V = qe.create, wo = wt.create, So = Pt.create, Co = Ct.create, vt = Nt.creat
|
|
|
2792
2792
|
}), Ba = zr.omit({
|
|
2793
2793
|
agentId: !0,
|
|
2794
2794
|
apiBaseUrl: !0
|
|
2795
|
-
}).partial(),
|
|
2795
|
+
}).partial(), ye = {
|
|
2796
2796
|
mode: "floating",
|
|
2797
2797
|
streaming: !0,
|
|
2798
2798
|
title: "AI Assistant",
|
|
@@ -2803,16 +2803,16 @@ var V = qe.create, wo = wt.create, So = Pt.create, Co = Ct.create, vt = Nt.creat
|
|
|
2803
2803
|
borderRadius: "12px"
|
|
2804
2804
|
}
|
|
2805
2805
|
};
|
|
2806
|
-
function
|
|
2806
|
+
function Ve(e, t) {
|
|
2807
2807
|
zr.parse(e);
|
|
2808
2808
|
let r;
|
|
2809
2809
|
const a = t ? { ...t } : void 0;
|
|
2810
2810
|
a && typeof a.theme == "object" && a.theme !== null ? (r = a.theme, delete a.theme) : a && typeof a.theme == "string" && (r = { mode: a.theme }, delete a.theme);
|
|
2811
2811
|
const n = a ? Ba.passthrough().safeParse(a).data : void 0, i = n ? Wr(n, e) : e, s = {
|
|
2812
|
-
mode: i.theme?.mode ?? r?.mode ??
|
|
2813
|
-
accentColor: i.theme?.accentColor ?? r?.accentColor ??
|
|
2814
|
-
fontFamily: i.theme?.fontFamily ?? r?.fontFamily ??
|
|
2815
|
-
borderRadius: i.theme?.borderRadius ?? r?.borderRadius ??
|
|
2812
|
+
mode: i.theme?.mode ?? r?.mode ?? ye.theme.mode,
|
|
2813
|
+
accentColor: i.theme?.accentColor ?? r?.accentColor ?? ye.theme.accentColor,
|
|
2814
|
+
fontFamily: i.theme?.fontFamily ?? r?.fontFamily ?? ye.theme.fontFamily,
|
|
2815
|
+
borderRadius: i.theme?.borderRadius ?? r?.borderRadius ?? ye.theme.borderRadius
|
|
2816
2816
|
};
|
|
2817
2817
|
return {
|
|
2818
2818
|
agentId: i.agentId,
|
|
@@ -2825,8 +2825,8 @@ function $e(e, t) {
|
|
|
2825
2825
|
email: i.user?.email
|
|
2826
2826
|
},
|
|
2827
2827
|
sessionId: i.sessionId,
|
|
2828
|
-
mode: i.mode ??
|
|
2829
|
-
title: i.title ??
|
|
2828
|
+
mode: i.mode ?? ye.mode,
|
|
2829
|
+
title: i.title ?? ye.title,
|
|
2830
2830
|
subtitle: i.subtitle,
|
|
2831
2831
|
description: i.description,
|
|
2832
2832
|
suggestedQuestions: (() => {
|
|
@@ -2834,7 +2834,7 @@ function $e(e, t) {
|
|
|
2834
2834
|
return Array.isArray(o) ? o : [];
|
|
2835
2835
|
})(),
|
|
2836
2836
|
avatarUrl: i.avatarUrl,
|
|
2837
|
-
streaming: i.streaming ??
|
|
2837
|
+
streaming: i.streaming ?? ye.streaming,
|
|
2838
2838
|
preview: i.preview === !0,
|
|
2839
2839
|
skipServerConfigFetch: i.skipServerConfigFetch === !0,
|
|
2840
2840
|
configChannel: i.configChannel,
|
|
@@ -2869,7 +2869,7 @@ var Vt = function() {
|
|
|
2869
2869
|
return t;
|
|
2870
2870
|
}, Vt.apply(this, arguments);
|
|
2871
2871
|
};
|
|
2872
|
-
function
|
|
2872
|
+
function oe(e, t, r, a) {
|
|
2873
2873
|
function n(i) {
|
|
2874
2874
|
return i instanceof r ? i : new r(function(s) {
|
|
2875
2875
|
s(i);
|
|
@@ -2896,7 +2896,7 @@ function ie(e, t, r, a) {
|
|
|
2896
2896
|
c((a = a.apply(e, t || [])).next());
|
|
2897
2897
|
});
|
|
2898
2898
|
}
|
|
2899
|
-
function
|
|
2899
|
+
function le(e, t) {
|
|
2900
2900
|
var r = {
|
|
2901
2901
|
label: 0,
|
|
2902
2902
|
sent: function() {
|
|
@@ -3011,9 +3011,9 @@ function nr(e, t) {
|
|
|
3011
3011
|
}
|
|
3012
3012
|
}
|
|
3013
3013
|
function ir(e, t, r) {
|
|
3014
|
-
return r === void 0 && (r = 16),
|
|
3014
|
+
return r === void 0 && (r = 16), oe(this, void 0, void 0, function() {
|
|
3015
3015
|
var a, n, i, s;
|
|
3016
|
-
return
|
|
3016
|
+
return le(this, function(o) {
|
|
3017
3017
|
switch (o.label) {
|
|
3018
3018
|
case 0:
|
|
3019
3019
|
a = Array(e.length), n = Date.now(), i = 0, o.label = 1;
|
|
@@ -3029,7 +3029,7 @@ function ir(e, t, r) {
|
|
|
3029
3029
|
});
|
|
3030
3030
|
});
|
|
3031
3031
|
}
|
|
3032
|
-
function
|
|
3032
|
+
function Pe(e) {
|
|
3033
3033
|
return e.then(void 0, function() {
|
|
3034
3034
|
}), e;
|
|
3035
3035
|
}
|
|
@@ -3043,13 +3043,13 @@ function Xa(e, t) {
|
|
|
3043
3043
|
function Ut(e) {
|
|
3044
3044
|
return parseInt(e);
|
|
3045
3045
|
}
|
|
3046
|
-
function
|
|
3046
|
+
function ee(e) {
|
|
3047
3047
|
return parseFloat(e);
|
|
3048
3048
|
}
|
|
3049
|
-
function
|
|
3049
|
+
function ue(e, t) {
|
|
3050
3050
|
return typeof e == "number" && isNaN(e) ? t : e;
|
|
3051
3051
|
}
|
|
3052
|
-
function
|
|
3052
|
+
function W(e) {
|
|
3053
3053
|
return e.reduce(function(t, r) {
|
|
3054
3054
|
return t + (r ? 1 : 0);
|
|
3055
3055
|
}, 0);
|
|
@@ -3092,19 +3092,19 @@ function Qa(e) {
|
|
|
3092
3092
|
}
|
|
3093
3093
|
return t;
|
|
3094
3094
|
}
|
|
3095
|
-
function
|
|
3095
|
+
function me(e, t) {
|
|
3096
3096
|
var r = e[0] >>> 16, a = e[0] & 65535, n = e[1] >>> 16, i = e[1] & 65535, s = t[0] >>> 16, o = t[0] & 65535, l = t[1] >>> 16, c = t[1] & 65535, u = 0, h = 0, p = 0, f = 0;
|
|
3097
3097
|
f += i + c, p += f >>> 16, f &= 65535, p += n + l, h += p >>> 16, p &= 65535, h += a + o, u += h >>> 16, h &= 65535, u += r + s, u &= 65535, e[0] = u << 16 | h, e[1] = p << 16 | f;
|
|
3098
3098
|
}
|
|
3099
|
-
function
|
|
3099
|
+
function Q(e, t) {
|
|
3100
3100
|
var r = e[0] >>> 16, a = e[0] & 65535, n = e[1] >>> 16, i = e[1] & 65535, s = t[0] >>> 16, o = t[0] & 65535, l = t[1] >>> 16, c = t[1] & 65535, u = 0, h = 0, p = 0, f = 0;
|
|
3101
3101
|
f += i * c, p += f >>> 16, f &= 65535, p += n * c, h += p >>> 16, p &= 65535, p += i * l, h += p >>> 16, p &= 65535, h += a * c, u += h >>> 16, h &= 65535, h += n * l, u += h >>> 16, h &= 65535, h += i * o, u += h >>> 16, h &= 65535, u += r * c + a * l + n * o + i * s, u &= 65535, e[0] = u << 16 | h, e[1] = p << 16 | f;
|
|
3102
3102
|
}
|
|
3103
|
-
function
|
|
3103
|
+
function xe(e, t) {
|
|
3104
3104
|
var r = e[0];
|
|
3105
3105
|
t %= 64, t === 32 ? (e[0] = e[1], e[1] = r) : t < 32 ? (e[0] = r << t | e[1] >>> 32 - t, e[1] = e[1] << t | r >>> 32 - t) : (t -= 32, e[0] = e[1] << t | r >>> 32 - t, e[1] = r << t | e[1] >>> 32 - t);
|
|
3106
3106
|
}
|
|
3107
|
-
function
|
|
3107
|
+
function H(e, t) {
|
|
3108
3108
|
t %= 64, t !== 0 && (t < 32 ? (e[0] = e[1] >>> 32 - t, e[1] = e[1] << t) : (e[0] = e[1] << t - 32, e[1] = 0));
|
|
3109
3109
|
}
|
|
3110
3110
|
function Z(e, t) {
|
|
@@ -3113,7 +3113,7 @@ function Z(e, t) {
|
|
|
3113
3113
|
var Ka = [4283543511, 3981806797], qa = [3301882366, 444984403];
|
|
3114
3114
|
function sr(e) {
|
|
3115
3115
|
var t = [0, e[0] >>> 1];
|
|
3116
|
-
Z(e, t),
|
|
3116
|
+
Z(e, t), Q(e, Ka), t[1] = e[0] >>> 1, Z(e, t), Q(e, qa), t[1] = e[0] >>> 1, Z(e, t);
|
|
3117
3117
|
}
|
|
3118
3118
|
var Ge = [2277735313, 289559509], He = [1291169091, 658871167], or = [0, 5], en = [0, 1390208809], tn = [0, 944331445];
|
|
3119
3119
|
function rn(e, t) {
|
|
@@ -3121,42 +3121,42 @@ function rn(e, t) {
|
|
|
3121
3121
|
t = t || 0;
|
|
3122
3122
|
var a = [0, r.length], n = a[1] % 16, i = a[1] - n, s = [0, t], o = [0, t], l = [0, 0], c = [0, 0], u;
|
|
3123
3123
|
for (u = 0; u < i; u = u + 16)
|
|
3124
|
-
l[0] = r[u + 4] | r[u + 5] << 8 | r[u + 6] << 16 | r[u + 7] << 24, l[1] = r[u] | r[u + 1] << 8 | r[u + 2] << 16 | r[u + 3] << 24, c[0] = r[u + 12] | r[u + 13] << 8 | r[u + 14] << 16 | r[u + 15] << 24, c[1] = r[u + 8] | r[u + 9] << 8 | r[u + 10] << 16 | r[u + 11] << 24,
|
|
3124
|
+
l[0] = r[u + 4] | r[u + 5] << 8 | r[u + 6] << 16 | r[u + 7] << 24, l[1] = r[u] | r[u + 1] << 8 | r[u + 2] << 16 | r[u + 3] << 24, c[0] = r[u + 12] | r[u + 13] << 8 | r[u + 14] << 16 | r[u + 15] << 24, c[1] = r[u + 8] | r[u + 9] << 8 | r[u + 10] << 16 | r[u + 11] << 24, Q(l, Ge), xe(l, 31), Q(l, He), Z(s, l), xe(s, 27), me(s, o), Q(s, or), me(s, en), Q(c, He), xe(c, 33), Q(c, Ge), Z(o, c), xe(o, 31), me(o, s), Q(o, or), me(o, tn);
|
|
3125
3125
|
l[0] = 0, l[1] = 0, c[0] = 0, c[1] = 0;
|
|
3126
3126
|
var h = [0, 0];
|
|
3127
3127
|
switch (n) {
|
|
3128
3128
|
case 15:
|
|
3129
|
-
h[1] = r[u + 14],
|
|
3129
|
+
h[1] = r[u + 14], H(h, 48), Z(c, h);
|
|
3130
3130
|
case 14:
|
|
3131
|
-
h[1] = r[u + 13],
|
|
3131
|
+
h[1] = r[u + 13], H(h, 40), Z(c, h);
|
|
3132
3132
|
case 13:
|
|
3133
|
-
h[1] = r[u + 12],
|
|
3133
|
+
h[1] = r[u + 12], H(h, 32), Z(c, h);
|
|
3134
3134
|
case 12:
|
|
3135
|
-
h[1] = r[u + 11],
|
|
3135
|
+
h[1] = r[u + 11], H(h, 24), Z(c, h);
|
|
3136
3136
|
case 11:
|
|
3137
|
-
h[1] = r[u + 10],
|
|
3137
|
+
h[1] = r[u + 10], H(h, 16), Z(c, h);
|
|
3138
3138
|
case 10:
|
|
3139
|
-
h[1] = r[u + 9],
|
|
3139
|
+
h[1] = r[u + 9], H(h, 8), Z(c, h);
|
|
3140
3140
|
case 9:
|
|
3141
|
-
h[1] = r[u + 8], Z(c, h),
|
|
3141
|
+
h[1] = r[u + 8], Z(c, h), Q(c, He), xe(c, 33), Q(c, Ge), Z(o, c);
|
|
3142
3142
|
case 8:
|
|
3143
|
-
h[1] = r[u + 7],
|
|
3143
|
+
h[1] = r[u + 7], H(h, 56), Z(l, h);
|
|
3144
3144
|
case 7:
|
|
3145
|
-
h[1] = r[u + 6],
|
|
3145
|
+
h[1] = r[u + 6], H(h, 48), Z(l, h);
|
|
3146
3146
|
case 6:
|
|
3147
|
-
h[1] = r[u + 5],
|
|
3147
|
+
h[1] = r[u + 5], H(h, 40), Z(l, h);
|
|
3148
3148
|
case 5:
|
|
3149
|
-
h[1] = r[u + 4],
|
|
3149
|
+
h[1] = r[u + 4], H(h, 32), Z(l, h);
|
|
3150
3150
|
case 4:
|
|
3151
|
-
h[1] = r[u + 3],
|
|
3151
|
+
h[1] = r[u + 3], H(h, 24), Z(l, h);
|
|
3152
3152
|
case 3:
|
|
3153
|
-
h[1] = r[u + 2],
|
|
3153
|
+
h[1] = r[u + 2], H(h, 16), Z(l, h);
|
|
3154
3154
|
case 2:
|
|
3155
|
-
h[1] = r[u + 1],
|
|
3155
|
+
h[1] = r[u + 1], H(h, 8), Z(l, h);
|
|
3156
3156
|
case 1:
|
|
3157
|
-
h[1] = r[u], Z(l, h),
|
|
3157
|
+
h[1] = r[u], Z(l, h), Q(l, Ge), xe(l, 31), Q(l, He), Z(s, l);
|
|
3158
3158
|
}
|
|
3159
|
-
return Z(s, a), Z(o, a),
|
|
3159
|
+
return Z(s, a), Z(o, a), me(s, o), me(o, s), sr(s), sr(o), me(s, o), me(o, s), ("00000000" + (s[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (s[1] >>> 0).toString(16)).slice(-8) + ("00000000" + (o[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (o[1] >>> 0).toString(16)).slice(-8);
|
|
3160
3160
|
}
|
|
3161
3161
|
function an(e) {
|
|
3162
3162
|
var t;
|
|
@@ -3174,7 +3174,7 @@ function sn(e) {
|
|
|
3174
3174
|
return typeof e != "function";
|
|
3175
3175
|
}
|
|
3176
3176
|
function on(e, t) {
|
|
3177
|
-
var r =
|
|
3177
|
+
var r = Pe(new Promise(function(a) {
|
|
3178
3178
|
var n = Date.now();
|
|
3179
3179
|
nr(e.bind(null, t), function() {
|
|
3180
3180
|
for (var i = [], s = 0; s < arguments.length; s++) i[s] = arguments[s];
|
|
@@ -3220,19 +3220,19 @@ function on(e, t) {
|
|
|
3220
3220
|
function ln(e, t, r, a) {
|
|
3221
3221
|
var n = Object.keys(e).filter(function(s) {
|
|
3222
3222
|
return Xa(r, s);
|
|
3223
|
-
}), i =
|
|
3223
|
+
}), i = Pe(ir(n, function(s) {
|
|
3224
3224
|
return on(e[s], t);
|
|
3225
3225
|
}, a));
|
|
3226
3226
|
return function() {
|
|
3227
|
-
return
|
|
3227
|
+
return oe(this, void 0, void 0, function() {
|
|
3228
3228
|
var o, l, c, u, h;
|
|
3229
|
-
return
|
|
3229
|
+
return le(this, function(p) {
|
|
3230
3230
|
switch (p.label) {
|
|
3231
3231
|
case 0:
|
|
3232
3232
|
return [4, i];
|
|
3233
3233
|
case 1:
|
|
3234
3234
|
return o = p.sent(), [4, ir(o, function(f) {
|
|
3235
|
-
return
|
|
3235
|
+
return Pe(f());
|
|
3236
3236
|
}, a)];
|
|
3237
3237
|
case 2:
|
|
3238
3238
|
return l = p.sent(), [4, Promise.all(l)];
|
|
@@ -3246,7 +3246,7 @@ function ln(e, t, r, a) {
|
|
|
3246
3246
|
}
|
|
3247
3247
|
function Hr() {
|
|
3248
3248
|
var e = window, t = navigator;
|
|
3249
|
-
return
|
|
3249
|
+
return W([
|
|
3250
3250
|
"MSCSSMatrix" in e,
|
|
3251
3251
|
"msSetImmediate" in e,
|
|
3252
3252
|
"msIndexedDB" in e,
|
|
@@ -3256,16 +3256,16 @@ function Hr() {
|
|
|
3256
3256
|
}
|
|
3257
3257
|
function cn() {
|
|
3258
3258
|
var e = window, t = navigator;
|
|
3259
|
-
return
|
|
3259
|
+
return W([
|
|
3260
3260
|
"msWriteProfilerMark" in e,
|
|
3261
3261
|
"MSStream" in e,
|
|
3262
3262
|
"msLaunchUri" in t,
|
|
3263
3263
|
"msSaveBlob" in t
|
|
3264
3264
|
]) >= 3 && !Hr();
|
|
3265
3265
|
}
|
|
3266
|
-
function
|
|
3266
|
+
function ze() {
|
|
3267
3267
|
var e = window, t = navigator;
|
|
3268
|
-
return
|
|
3268
|
+
return W([
|
|
3269
3269
|
"webkitPersistentStorage" in t,
|
|
3270
3270
|
"webkitTemporaryStorage" in t,
|
|
3271
3271
|
(t.vendor || "").indexOf("Google") === 0,
|
|
@@ -3275,9 +3275,9 @@ function Ve() {
|
|
|
3275
3275
|
"webkitSpeechGrammar" in e
|
|
3276
3276
|
]) >= 5;
|
|
3277
3277
|
}
|
|
3278
|
-
function
|
|
3278
|
+
function re() {
|
|
3279
3279
|
var e = window, t = navigator;
|
|
3280
|
-
return
|
|
3280
|
+
return W([
|
|
3281
3281
|
"ApplePayError" in e,
|
|
3282
3282
|
"CSSPrimitiveValue" in e,
|
|
3283
3283
|
"Counter" in e,
|
|
@@ -3288,7 +3288,7 @@ function te() {
|
|
|
3288
3288
|
}
|
|
3289
3289
|
function Bt() {
|
|
3290
3290
|
var e = window, t = e.HTMLElement, r = e.Document;
|
|
3291
|
-
return
|
|
3291
|
+
return W([
|
|
3292
3292
|
"safari" in e,
|
|
3293
3293
|
!("ongestureend" in e),
|
|
3294
3294
|
!("TouchEvent" in e),
|
|
@@ -3297,13 +3297,13 @@ function Bt() {
|
|
|
3297
3297
|
r && "pointerLockElement" in r.prototype
|
|
3298
3298
|
]) >= 4;
|
|
3299
3299
|
}
|
|
3300
|
-
function
|
|
3300
|
+
function We() {
|
|
3301
3301
|
var e = window;
|
|
3302
3302
|
return nn(e.print) && String(e.browser) === "[object WebPageNamespace]";
|
|
3303
3303
|
}
|
|
3304
3304
|
function Yr() {
|
|
3305
3305
|
var e, t, r = window;
|
|
3306
|
-
return
|
|
3306
|
+
return W([
|
|
3307
3307
|
"buildID" in navigator,
|
|
3308
3308
|
"MozAppearance" in ((t = (e = document.documentElement) === null || e === void 0 ? void 0 : e.style) !== null && t !== void 0 ? t : {}),
|
|
3309
3309
|
"onmozfullscreenchange" in r,
|
|
@@ -3314,7 +3314,7 @@ function Yr() {
|
|
|
3314
3314
|
}
|
|
3315
3315
|
function dn() {
|
|
3316
3316
|
var e = window;
|
|
3317
|
-
return
|
|
3317
|
+
return W([
|
|
3318
3318
|
!("MediaSettingsRange" in e),
|
|
3319
3319
|
"RTCEncodedAudioFrame" in e,
|
|
3320
3320
|
"" + e.Intl == "[object Intl]",
|
|
@@ -3323,7 +3323,7 @@ function dn() {
|
|
|
3323
3323
|
}
|
|
3324
3324
|
function un() {
|
|
3325
3325
|
var e = window, t = e.URLPattern;
|
|
3326
|
-
return
|
|
3326
|
+
return W([
|
|
3327
3327
|
"union" in Set.prototype,
|
|
3328
3328
|
"Iterator" in e,
|
|
3329
3329
|
t && "hasRegExpGroups" in t.prototype,
|
|
@@ -3332,16 +3332,16 @@ function un() {
|
|
|
3332
3332
|
}
|
|
3333
3333
|
function hn() {
|
|
3334
3334
|
var e = window;
|
|
3335
|
-
return
|
|
3335
|
+
return W([
|
|
3336
3336
|
"DOMRectList" in e,
|
|
3337
3337
|
"RTCPeerConnectionIceEvent" in e,
|
|
3338
3338
|
"SVGGeometryElement" in e,
|
|
3339
3339
|
"ontransitioncancel" in e
|
|
3340
3340
|
]) >= 3;
|
|
3341
3341
|
}
|
|
3342
|
-
function
|
|
3342
|
+
function De() {
|
|
3343
3343
|
var e = window, t = navigator, r = e.CSS, a = e.HTMLButtonElement;
|
|
3344
|
-
return
|
|
3344
|
+
return W([
|
|
3345
3345
|
!("getStorageUpdates" in t),
|
|
3346
3346
|
a && "popover" in a.prototype,
|
|
3347
3347
|
"CSSCounterStyleRule" in e,
|
|
@@ -3352,7 +3352,7 @@ function We() {
|
|
|
3352
3352
|
function fn() {
|
|
3353
3353
|
if (navigator.platform === "iPad") return !0;
|
|
3354
3354
|
var e = screen, t = e.width / e.height;
|
|
3355
|
-
return
|
|
3355
|
+
return W([
|
|
3356
3356
|
"MediaSource" in window,
|
|
3357
3357
|
!!Element.prototype.webkitRequestFullscreen,
|
|
3358
3358
|
t > 0.65 && t < 1.53
|
|
@@ -3367,12 +3367,12 @@ function mn() {
|
|
|
3367
3367
|
return (e.exitFullscreen || e.msExitFullscreen || e.mozCancelFullScreen || e.webkitExitFullscreen).call(e);
|
|
3368
3368
|
}
|
|
3369
3369
|
function Gt() {
|
|
3370
|
-
var e =
|
|
3371
|
-
return e ?
|
|
3370
|
+
var e = ze(), t = Yr(), r = window, a = navigator, n = "connection";
|
|
3371
|
+
return e ? W([
|
|
3372
3372
|
!("SharedWorker" in r),
|
|
3373
3373
|
a[n] && "ontypechange" in a[n],
|
|
3374
3374
|
!("sinkId" in new Audio())
|
|
3375
|
-
]) >= 2 : t ?
|
|
3375
|
+
]) >= 2 : t ? W([
|
|
3376
3376
|
"onorientationchange" in r,
|
|
3377
3377
|
"orientation" in r,
|
|
3378
3378
|
/android/i.test(a.appVersion)
|
|
@@ -3380,7 +3380,7 @@ function Gt() {
|
|
|
3380
3380
|
}
|
|
3381
3381
|
function gn() {
|
|
3382
3382
|
var e = navigator, t = window, r = Audio.prototype, a = t.visualViewport;
|
|
3383
|
-
return
|
|
3383
|
+
return W([
|
|
3384
3384
|
"srLatency" in r,
|
|
3385
3385
|
"srChannelCount" in r,
|
|
3386
3386
|
"devicePosture" in e,
|
|
@@ -3399,7 +3399,7 @@ function kn() {
|
|
|
3399
3399
|
n.type = "triangle", n.frequency.value = 1e4;
|
|
3400
3400
|
var i = a.createDynamicsCompressor();
|
|
3401
3401
|
i.threshold.value = -50, i.knee.value = 40, i.ratio.value = 12, i.attack.value = 0, i.release.value = 0.25, n.connect(i), i.connect(a.destination), n.start(0);
|
|
3402
|
-
var s = _n(a), o = s[0], l = s[1], c =
|
|
3402
|
+
var s = _n(a), o = s[0], l = s[1], c = Pe(o.then(function(u) {
|
|
3403
3403
|
return xn(u.getChannelData(0).subarray(r));
|
|
3404
3404
|
}, function(u) {
|
|
3405
3405
|
if (u.name === "timeout" || u.name === "suspended") return -3;
|
|
@@ -3410,10 +3410,10 @@ function kn() {
|
|
|
3410
3410
|
};
|
|
3411
3411
|
}
|
|
3412
3412
|
function yn() {
|
|
3413
|
-
return
|
|
3413
|
+
return re() && !Bt() && !hn();
|
|
3414
3414
|
}
|
|
3415
3415
|
function bn() {
|
|
3416
|
-
return
|
|
3416
|
+
return re() && De() && We() || ze() && gn() && un();
|
|
3417
3417
|
}
|
|
3418
3418
|
function _n(e) {
|
|
3419
3419
|
var t = 3, r = 500, a = 500, n = 5e3, i = function() {
|
|
@@ -3430,7 +3430,7 @@ function _n(e) {
|
|
|
3430
3430
|
}, p = function() {
|
|
3431
3431
|
try {
|
|
3432
3432
|
var f = e.startRendering();
|
|
3433
|
-
switch (Br(f) &&
|
|
3433
|
+
switch (Br(f) && Pe(f), e.state) {
|
|
3434
3434
|
case "running":
|
|
3435
3435
|
u = Date.now(), l && h();
|
|
3436
3436
|
break;
|
|
@@ -3438,8 +3438,8 @@ function _n(e) {
|
|
|
3438
3438
|
document.hidden || c++, l && c >= t ? o(lr("suspended")) : setTimeout(p, r);
|
|
3439
3439
|
break;
|
|
3440
3440
|
}
|
|
3441
|
-
} catch (
|
|
3442
|
-
o(
|
|
3441
|
+
} catch (v) {
|
|
3442
|
+
o(v);
|
|
3443
3443
|
}
|
|
3444
3444
|
};
|
|
3445
3445
|
p(), i = function() {
|
|
@@ -3457,9 +3457,9 @@ function lr(e) {
|
|
|
3457
3457
|
}
|
|
3458
3458
|
function Xr(e, t, r) {
|
|
3459
3459
|
var a, n, i;
|
|
3460
|
-
return r === void 0 && (r = 50),
|
|
3460
|
+
return r === void 0 && (r = 50), oe(this, void 0, void 0, function() {
|
|
3461
3461
|
var s, o;
|
|
3462
|
-
return
|
|
3462
|
+
return le(this, function(l) {
|
|
3463
3463
|
switch (l.label) {
|
|
3464
3464
|
case 0:
|
|
3465
3465
|
s = document, l.label = 1;
|
|
@@ -3478,17 +3478,17 @@ function Xr(e, t, r) {
|
|
|
3478
3478
|
]), [4, new Promise(function(c, u) {
|
|
3479
3479
|
var h = !1, p = function() {
|
|
3480
3480
|
h = !0, c();
|
|
3481
|
-
}, f = function(
|
|
3482
|
-
h = !0, u(
|
|
3481
|
+
}, f = function(I) {
|
|
3482
|
+
h = !0, u(I);
|
|
3483
3483
|
};
|
|
3484
3484
|
o.onload = p, o.onerror = f;
|
|
3485
|
-
var
|
|
3486
|
-
|
|
3487
|
-
var
|
|
3488
|
-
var
|
|
3489
|
-
h || (((g = (
|
|
3485
|
+
var v = o.style;
|
|
3486
|
+
v.setProperty("display", "block", "important"), v.position = "absolute", v.top = "0", v.left = "0", v.visibility = "hidden", t && "srcdoc" in o ? o.srcdoc = t : o.src = "about:blank", s.body.appendChild(o);
|
|
3487
|
+
var k = function() {
|
|
3488
|
+
var I, g;
|
|
3489
|
+
h || (((g = (I = o.contentWindow) === null || I === void 0 ? void 0 : I.document) === null || g === void 0 ? void 0 : g.readyState) === "complete" ? p() : setTimeout(k, 10));
|
|
3490
3490
|
};
|
|
3491
|
-
|
|
3491
|
+
k();
|
|
3492
3492
|
})];
|
|
3493
3493
|
case 5:
|
|
3494
3494
|
l.sent(), l.label = 6;
|
|
@@ -3537,7 +3537,7 @@ function Cn() {
|
|
|
3537
3537
|
e = t;
|
|
3538
3538
|
}
|
|
3539
3539
|
}
|
|
3540
|
-
var In = "mmMwWLliI0O&1", Nn = "48px",
|
|
3540
|
+
var In = "mmMwWLliI0O&1", Nn = "48px", we = [
|
|
3541
3541
|
"monospace",
|
|
3542
3542
|
"sans-serif",
|
|
3543
3543
|
"serif"
|
|
@@ -3599,34 +3599,34 @@ function En() {
|
|
|
3599
3599
|
var e = this;
|
|
3600
3600
|
return Xr(function(t, r) {
|
|
3601
3601
|
var a = r.document;
|
|
3602
|
-
return
|
|
3603
|
-
var n, i, s, o, l, c, u, h, p, f,
|
|
3604
|
-
return
|
|
3602
|
+
return oe(e, void 0, void 0, function() {
|
|
3603
|
+
var n, i, s, o, l, c, u, h, p, f, v, k;
|
|
3604
|
+
return le(this, function(I) {
|
|
3605
3605
|
for (n = a.body, n.style.fontSize = Nn, i = a.createElement("div"), i.style.setProperty("visibility", "hidden", "important"), s = {}, o = {}, l = function(g) {
|
|
3606
|
-
var
|
|
3607
|
-
return j.position = "absolute", j.top = "0", j.left = "0", j.fontFamily = g,
|
|
3608
|
-
}, c = function(g,
|
|
3609
|
-
return l("'".concat(g, "',").concat(
|
|
3606
|
+
var N = a.createElement("span"), j = N.style;
|
|
3607
|
+
return j.position = "absolute", j.top = "0", j.left = "0", j.fontFamily = g, N.textContent = In, i.appendChild(N), N;
|
|
3608
|
+
}, c = function(g, N) {
|
|
3609
|
+
return l("'".concat(g, "',").concat(N));
|
|
3610
3610
|
}, u = function() {
|
|
3611
|
-
return
|
|
3611
|
+
return we.map(l);
|
|
3612
3612
|
}, h = function() {
|
|
3613
|
-
for (var g = {},
|
|
3614
|
-
g[
|
|
3615
|
-
return c(
|
|
3613
|
+
for (var g = {}, N = function(D) {
|
|
3614
|
+
g[D] = we.map(function(ae) {
|
|
3615
|
+
return c(D, ae);
|
|
3616
3616
|
});
|
|
3617
|
-
}, j = 0,
|
|
3618
|
-
var
|
|
3619
|
-
|
|
3617
|
+
}, j = 0, P = cr; j < P.length; j++) {
|
|
3618
|
+
var B = P[j];
|
|
3619
|
+
N(B);
|
|
3620
3620
|
}
|
|
3621
3621
|
return g;
|
|
3622
3622
|
}, p = function(g) {
|
|
3623
|
-
return
|
|
3624
|
-
return g[j].offsetWidth !== s[
|
|
3623
|
+
return we.some(function(N, j) {
|
|
3624
|
+
return g[j].offsetWidth !== s[N] || g[j].offsetHeight !== o[N];
|
|
3625
3625
|
});
|
|
3626
|
-
}, f = u(),
|
|
3627
|
-
s[
|
|
3626
|
+
}, f = u(), v = h(), n.appendChild(i), k = 0; k < we.length; k++)
|
|
3627
|
+
s[we[k]] = f[k].offsetWidth, o[we[k]] = f[k].offsetHeight;
|
|
3628
3628
|
return [2, cr.filter(function(g) {
|
|
3629
|
-
return p(
|
|
3629
|
+
return p(v[g]);
|
|
3630
3630
|
})];
|
|
3631
3631
|
});
|
|
3632
3632
|
});
|
|
@@ -3714,7 +3714,7 @@ function kt(e) {
|
|
|
3714
3714
|
return e.toDataURL();
|
|
3715
3715
|
}
|
|
3716
3716
|
function Pn() {
|
|
3717
|
-
return
|
|
3717
|
+
return re() && De() && We();
|
|
3718
3718
|
}
|
|
3719
3719
|
function $n() {
|
|
3720
3720
|
var e = navigator, t = 0, r;
|
|
@@ -3737,7 +3737,7 @@ function Vn() {
|
|
|
3737
3737
|
function zn() {
|
|
3738
3738
|
var e = navigator, t = [], r = e.language || e.userLanguage || e.browserLanguage || e.systemLanguage;
|
|
3739
3739
|
if (r !== void 0 && t.push([r]), Array.isArray(e.languages))
|
|
3740
|
-
|
|
3740
|
+
ze() && dn() || t.push(e.languages);
|
|
3741
3741
|
else if (typeof e.languages == "string") {
|
|
3742
3742
|
var a = e.languages;
|
|
3743
3743
|
a && t.push(a.split(","));
|
|
@@ -3748,15 +3748,15 @@ function Wn() {
|
|
|
3748
3748
|
return window.screen.colorDepth;
|
|
3749
3749
|
}
|
|
3750
3750
|
function Dn() {
|
|
3751
|
-
return
|
|
3751
|
+
return ue(ee(navigator.deviceMemory), void 0);
|
|
3752
3752
|
}
|
|
3753
3753
|
function Un() {
|
|
3754
|
-
if (!(
|
|
3754
|
+
if (!(re() && De() && We()))
|
|
3755
3755
|
return Bn();
|
|
3756
3756
|
}
|
|
3757
3757
|
function Bn() {
|
|
3758
3758
|
var e = screen, t = function(a) {
|
|
3759
|
-
return
|
|
3759
|
+
return ue(Ut(a), null);
|
|
3760
3760
|
}, r = [t(e.width), t(e.height)];
|
|
3761
3761
|
return r.sort().reverse(), r;
|
|
3762
3762
|
}
|
|
@@ -3773,9 +3773,9 @@ function Yn() {
|
|
|
3773
3773
|
function Xn() {
|
|
3774
3774
|
var e = this;
|
|
3775
3775
|
return Yn(), function() {
|
|
3776
|
-
return
|
|
3776
|
+
return oe(e, void 0, void 0, function() {
|
|
3777
3777
|
var t;
|
|
3778
|
-
return
|
|
3778
|
+
return le(this, function(r) {
|
|
3779
3779
|
switch (r.label) {
|
|
3780
3780
|
case 0:
|
|
3781
3781
|
return t = zt(), Wt(t) ? Qe ? [2, Dr([], Qe, !0)] : pn() ? [4, mn()] : [3, 2] : [3, 2];
|
|
@@ -3790,14 +3790,14 @@ function Xn() {
|
|
|
3790
3790
|
}
|
|
3791
3791
|
function Jn() {
|
|
3792
3792
|
var e = this;
|
|
3793
|
-
if (
|
|
3793
|
+
if (re() && De() && We()) return function() {
|
|
3794
3794
|
return Promise.resolve(void 0);
|
|
3795
3795
|
};
|
|
3796
3796
|
var t = Xn();
|
|
3797
3797
|
return function() {
|
|
3798
|
-
return
|
|
3798
|
+
return oe(e, void 0, void 0, function() {
|
|
3799
3799
|
var r, a;
|
|
3800
|
-
return
|
|
3800
|
+
return le(this, function(n) {
|
|
3801
3801
|
switch (n.label) {
|
|
3802
3802
|
case 0:
|
|
3803
3803
|
return [4, t()];
|
|
@@ -3818,10 +3818,10 @@ function Jn() {
|
|
|
3818
3818
|
function zt() {
|
|
3819
3819
|
var e = screen;
|
|
3820
3820
|
return [
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3821
|
+
ue(ee(e.availTop), null),
|
|
3822
|
+
ue(ee(e.width) - ee(e.availWidth) - ue(ee(e.availLeft), 0), null),
|
|
3823
|
+
ue(ee(e.height) - ee(e.availHeight) - ue(ee(e.availTop), 0), null),
|
|
3824
|
+
ue(ee(e.availLeft), null)
|
|
3825
3825
|
];
|
|
3826
3826
|
}
|
|
3827
3827
|
function Wt(e) {
|
|
@@ -3829,7 +3829,7 @@ function Wt(e) {
|
|
|
3829
3829
|
return !0;
|
|
3830
3830
|
}
|
|
3831
3831
|
function Qn() {
|
|
3832
|
-
return
|
|
3832
|
+
return ue(Ut(navigator.hardwareConcurrency), void 0);
|
|
3833
3833
|
}
|
|
3834
3834
|
function Kn() {
|
|
3835
3835
|
var e, t = (e = window.Intl) === null || e === void 0 ? void 0 : e.DateTimeFormat;
|
|
@@ -3842,7 +3842,7 @@ function Kn() {
|
|
|
3842
3842
|
}
|
|
3843
3843
|
function qn() {
|
|
3844
3844
|
var e = (/* @__PURE__ */ new Date()).getFullYear();
|
|
3845
|
-
return Math.max(
|
|
3845
|
+
return Math.max(ee(new Date(e, 0, 1).getTimezoneOffset()), ee(new Date(e, 6, 1).getTimezoneOffset()));
|
|
3846
3846
|
}
|
|
3847
3847
|
function ei() {
|
|
3848
3848
|
try {
|
|
@@ -3874,7 +3874,7 @@ function ni() {
|
|
|
3874
3874
|
}
|
|
3875
3875
|
function ii() {
|
|
3876
3876
|
var e = navigator.platform;
|
|
3877
|
-
return e === "MacIntel" &&
|
|
3877
|
+
return e === "MacIntel" && re() && !Bt() ? fn() ? "iPad" : "iPhone" : e;
|
|
3878
3878
|
}
|
|
3879
3879
|
function si() {
|
|
3880
3880
|
return navigator.vendor || "";
|
|
@@ -4203,9 +4203,9 @@ function ci() {
|
|
|
4203
4203
|
}
|
|
4204
4204
|
function di(e) {
|
|
4205
4205
|
var t = (e === void 0 ? {} : e).debug;
|
|
4206
|
-
return
|
|
4206
|
+
return oe(this, void 0, void 0, function() {
|
|
4207
4207
|
var r, a, n, i, s, o;
|
|
4208
|
-
return
|
|
4208
|
+
return le(this, function(l) {
|
|
4209
4209
|
switch (l.label) {
|
|
4210
4210
|
case 0:
|
|
4211
4211
|
return ui() ? (r = ci(), a = Object.keys(r), n = (o = []).concat.apply(o, a.map(function(c) {
|
|
@@ -4214,7 +4214,7 @@ function di(e) {
|
|
|
4214
4214
|
case 1:
|
|
4215
4215
|
return i = l.sent(), t && fi(r, i), s = a.filter(function(c) {
|
|
4216
4216
|
var u = r[c];
|
|
4217
|
-
return
|
|
4217
|
+
return W(u.map(function(h) {
|
|
4218
4218
|
return i[h];
|
|
4219
4219
|
})) > u.length * 0.6;
|
|
4220
4220
|
}), s.sort(), [2, s];
|
|
@@ -4223,13 +4223,13 @@ function di(e) {
|
|
|
4223
4223
|
});
|
|
4224
4224
|
}
|
|
4225
4225
|
function ui() {
|
|
4226
|
-
return
|
|
4226
|
+
return re() || Gt();
|
|
4227
4227
|
}
|
|
4228
4228
|
function hi(e) {
|
|
4229
4229
|
var t;
|
|
4230
|
-
return
|
|
4230
|
+
return oe(this, void 0, void 0, function() {
|
|
4231
4231
|
var r, a, n, i, l, s, o, l;
|
|
4232
|
-
return
|
|
4232
|
+
return le(this, function(c) {
|
|
4233
4233
|
switch (c.label) {
|
|
4234
4234
|
case 0:
|
|
4235
4235
|
for (r = document, a = r.createElement("div"), n = new Array(e.length), i = {}, dr(a), l = 0; l < e.length; ++l)
|
|
@@ -4298,12 +4298,12 @@ function ki() {
|
|
|
4298
4298
|
}
|
|
4299
4299
|
}
|
|
4300
4300
|
function yi() {
|
|
4301
|
-
if (
|
|
4302
|
-
if (
|
|
4303
|
-
if (
|
|
4304
|
-
if (
|
|
4301
|
+
if (Se("no-preference")) return 0;
|
|
4302
|
+
if (Se("high") || Se("more")) return 1;
|
|
4303
|
+
if (Se("low") || Se("less")) return -1;
|
|
4304
|
+
if (Se("forced")) return 10;
|
|
4305
4305
|
}
|
|
4306
|
-
function
|
|
4306
|
+
function Se(e) {
|
|
4307
4307
|
return matchMedia("(prefers-contrast: ".concat(e, ")")).matches;
|
|
4308
4308
|
}
|
|
4309
4309
|
function bi() {
|
|
@@ -4327,54 +4327,54 @@ function xi() {
|
|
|
4327
4327
|
function mr(e) {
|
|
4328
4328
|
return matchMedia("(dynamic-range: ".concat(e, ")")).matches;
|
|
4329
4329
|
}
|
|
4330
|
-
var R = Math,
|
|
4330
|
+
var R = Math, V = function() {
|
|
4331
4331
|
return 0;
|
|
4332
4332
|
};
|
|
4333
4333
|
function wi() {
|
|
4334
|
-
var e = R.acos ||
|
|
4335
|
-
return R.pow(R.PI,
|
|
4336
|
-
},
|
|
4337
|
-
return R.log(
|
|
4338
|
-
}, g = function(
|
|
4339
|
-
return R.log(
|
|
4340
|
-
},
|
|
4341
|
-
return R.log((1 +
|
|
4342
|
-
}, j = function(
|
|
4343
|
-
return R.exp(
|
|
4344
|
-
},
|
|
4345
|
-
return (R.exp(
|
|
4346
|
-
},
|
|
4347
|
-
return R.exp(
|
|
4348
|
-
},
|
|
4349
|
-
return (R.exp(2 *
|
|
4350
|
-
},
|
|
4351
|
-
return R.log(1 +
|
|
4334
|
+
var e = R.acos || V, t = R.acosh || V, r = R.asin || V, a = R.asinh || V, n = R.atanh || V, i = R.atan || V, s = R.sin || V, o = R.sinh || V, l = R.cos || V, c = R.cosh || V, u = R.tan || V, h = R.tanh || V, p = R.exp || V, f = R.expm1 || V, v = R.log1p || V, k = function(T) {
|
|
4335
|
+
return R.pow(R.PI, T);
|
|
4336
|
+
}, I = function(T) {
|
|
4337
|
+
return R.log(T + R.sqrt(T * T - 1));
|
|
4338
|
+
}, g = function(T) {
|
|
4339
|
+
return R.log(T + R.sqrt(T * T + 1));
|
|
4340
|
+
}, N = function(T) {
|
|
4341
|
+
return R.log((1 + T) / (1 - T)) / 2;
|
|
4342
|
+
}, j = function(T) {
|
|
4343
|
+
return R.exp(T) - 1 / R.exp(T) / 2;
|
|
4344
|
+
}, P = function(T) {
|
|
4345
|
+
return (R.exp(T) + 1 / R.exp(T)) / 2;
|
|
4346
|
+
}, B = function(T) {
|
|
4347
|
+
return R.exp(T) - 1;
|
|
4348
|
+
}, D = function(T) {
|
|
4349
|
+
return (R.exp(2 * T) - 1) / (R.exp(2 * T) + 1);
|
|
4350
|
+
}, ae = function(T) {
|
|
4351
|
+
return R.log(1 + T);
|
|
4352
4352
|
};
|
|
4353
4353
|
return {
|
|
4354
4354
|
acos: e(0.12312423423423424),
|
|
4355
4355
|
acosh: t(1e308),
|
|
4356
|
-
acoshPf:
|
|
4356
|
+
acoshPf: I(1e154),
|
|
4357
4357
|
asin: r(0.12312423423423424),
|
|
4358
4358
|
asinh: a(1),
|
|
4359
4359
|
asinhPf: g(1),
|
|
4360
4360
|
atanh: n(0.5),
|
|
4361
|
-
atanhPf:
|
|
4361
|
+
atanhPf: N(0.5),
|
|
4362
4362
|
atan: i(0.5),
|
|
4363
4363
|
sin: s(-1e300),
|
|
4364
4364
|
sinh: o(1),
|
|
4365
4365
|
sinhPf: j(1),
|
|
4366
4366
|
cos: l(10.000000000123),
|
|
4367
4367
|
cosh: c(1),
|
|
4368
|
-
coshPf:
|
|
4368
|
+
coshPf: P(1),
|
|
4369
4369
|
tan: u(-1e300),
|
|
4370
4370
|
tanh: h(1),
|
|
4371
|
-
tanhPf:
|
|
4371
|
+
tanhPf: D(1),
|
|
4372
4372
|
exp: p(1),
|
|
4373
4373
|
expm1: f(1),
|
|
4374
|
-
expm1Pf:
|
|
4375
|
-
log1p:
|
|
4376
|
-
log1pPf:
|
|
4377
|
-
powPI:
|
|
4374
|
+
expm1Pf: B(1),
|
|
4375
|
+
log1p: v(10),
|
|
4376
|
+
log1pPf: ae(10),
|
|
4377
|
+
powPI: k(-100)
|
|
4378
4378
|
};
|
|
4379
4379
|
}
|
|
4380
4380
|
var Si = "mmMwWLliI0fiflO&1", bt = {
|
|
@@ -4391,14 +4391,14 @@ function Ci() {
|
|
|
4391
4391
|
for (var r = {}, a = {}, n = 0, i = Object.keys(bt); n < i.length; n++) {
|
|
4392
4392
|
var s = i[n], o = bt[s], l = o[0], c = l === void 0 ? {} : l, u = o[1], h = u === void 0 ? Si : u, p = e.createElement("span");
|
|
4393
4393
|
p.textContent = h, p.style.whiteSpace = "nowrap";
|
|
4394
|
-
for (var f = 0,
|
|
4395
|
-
var
|
|
4396
|
-
|
|
4394
|
+
for (var f = 0, v = Object.keys(c); f < v.length; f++) {
|
|
4395
|
+
var k = v[f], I = c[k];
|
|
4396
|
+
I !== void 0 && (p.style[k] = I);
|
|
4397
4397
|
}
|
|
4398
4398
|
r[s] = p, t.append(e.createElement("br"), p);
|
|
4399
4399
|
}
|
|
4400
|
-
for (var g = 0,
|
|
4401
|
-
var s =
|
|
4400
|
+
for (var g = 0, N = Object.keys(bt); g < N.length; g++) {
|
|
4401
|
+
var s = N[g];
|
|
4402
4402
|
a[s] = r[s].getBoundingClientRect().width;
|
|
4403
4403
|
}
|
|
4404
4404
|
return a;
|
|
@@ -4407,7 +4407,7 @@ function Ci() {
|
|
|
4407
4407
|
function Ii(e, t) {
|
|
4408
4408
|
return t === void 0 && (t = 4e3), Xr(function(r, a) {
|
|
4409
4409
|
var n = a.document, i = n.body, s = i.style;
|
|
4410
|
-
s.width = "".concat(t, "px"), s.webkitTextSizeAdjust = s.textSizeAdjust = "none",
|
|
4410
|
+
s.width = "".concat(t, "px"), s.webkitTextSizeAdjust = s.textSizeAdjust = "none", ze() ? i.style.zoom = "".concat(1 / a.devicePixelRatio) : re() && (i.style.zoom = "reset");
|
|
4411
4411
|
var o = n.createElement("div");
|
|
4412
4412
|
return o.textContent = Dr([], Array(t / 20 << 0), !0).map(function() {
|
|
4413
4413
|
return "word";
|
|
@@ -4564,28 +4564,28 @@ function $i(e) {
|
|
|
4564
4564
|
var p = h[u];
|
|
4565
4565
|
s.push("".concat(p, "=").concat(n[p]));
|
|
4566
4566
|
}
|
|
4567
|
-
for (var f = gr(r),
|
|
4568
|
-
var
|
|
4569
|
-
o.push("".concat(
|
|
4567
|
+
for (var f = gr(r), v = 0, k = f; v < k.length; v++) {
|
|
4568
|
+
var I = k[v], g = r[I];
|
|
4569
|
+
o.push("".concat(I, "=").concat(g).concat(Ri.has(g) ? "=".concat(r.getParameter(g)) : ""));
|
|
4570
4570
|
}
|
|
4571
|
-
if (a) for (var
|
|
4572
|
-
var
|
|
4573
|
-
if (!(
|
|
4574
|
-
var
|
|
4575
|
-
if (!
|
|
4576
|
-
i.push(
|
|
4571
|
+
if (a) for (var N = 0, j = a; N < j.length; N++) {
|
|
4572
|
+
var P = j[N];
|
|
4573
|
+
if (!(P === Kr && ea() || P === Fi && Wi())) {
|
|
4574
|
+
var B = r.getExtension(P);
|
|
4575
|
+
if (!B) {
|
|
4576
|
+
i.push(P);
|
|
4577
4577
|
continue;
|
|
4578
4578
|
}
|
|
4579
|
-
for (var
|
|
4580
|
-
var
|
|
4581
|
-
l.push("".concat(
|
|
4579
|
+
for (var D = 0, ae = gr(B); D < ae.length; D++) {
|
|
4580
|
+
var I = ae[D], g = B[I];
|
|
4581
|
+
l.push("".concat(I, "=").concat(g).concat(ji.has(g) ? "=".concat(r.getParameter(g)) : ""));
|
|
4582
4582
|
}
|
|
4583
4583
|
}
|
|
4584
4584
|
}
|
|
4585
|
-
for (var
|
|
4586
|
-
for (var
|
|
4587
|
-
var Ue =
|
|
4588
|
-
c.push("".concat(
|
|
4585
|
+
for (var T = 0, C = Zi; T < C.length; T++)
|
|
4586
|
+
for (var F = C[T], ce = 0, Te = Oi; ce < Te.length; ce++) {
|
|
4587
|
+
var Ue = Te[ce], pt = Vi(r, F, Ue);
|
|
4588
|
+
c.push("".concat(F, ".").concat(Ue, "=").concat(pt.join(",")));
|
|
4589
4589
|
}
|
|
4590
4590
|
return l.sort(), o.sort(), {
|
|
4591
4591
|
contextAttributes: s,
|
|
@@ -4630,13 +4630,13 @@ function ea() {
|
|
|
4630
4630
|
return Yr();
|
|
4631
4631
|
}
|
|
4632
4632
|
function Wi() {
|
|
4633
|
-
return
|
|
4633
|
+
return ze() || re();
|
|
4634
4634
|
}
|
|
4635
4635
|
function ta(e) {
|
|
4636
4636
|
return typeof e.getParameter == "function";
|
|
4637
4637
|
}
|
|
4638
4638
|
function Di() {
|
|
4639
|
-
if (!(Gt() ||
|
|
4639
|
+
if (!(Gt() || re())) return -2;
|
|
4640
4640
|
if (!window.AudioContext) return -1;
|
|
4641
4641
|
var e = new AudioContext().baseLatency;
|
|
4642
4642
|
return e == null ? -1 : isFinite(e) ? e : -3;
|
|
@@ -4704,7 +4704,7 @@ function Yi(e) {
|
|
|
4704
4704
|
}
|
|
4705
4705
|
function Xi(e) {
|
|
4706
4706
|
if (Gt()) return 0.4;
|
|
4707
|
-
if (
|
|
4707
|
+
if (re()) return Bt() && !(De() && We()) ? 0.5 : 0.3;
|
|
4708
4708
|
var t = "value" in e.platform ? e.platform.value : "";
|
|
4709
4709
|
return /^Win/.test(t) ? 0.6 : /^Mac/.test(t) ? 0.5 : 0.7;
|
|
4710
4710
|
}
|
|
@@ -4746,9 +4746,9 @@ function es(e) {
|
|
|
4746
4746
|
function ts(e, t) {
|
|
4747
4747
|
var r = Date.now();
|
|
4748
4748
|
return { get: function(a) {
|
|
4749
|
-
return
|
|
4749
|
+
return oe(this, void 0, void 0, function() {
|
|
4750
4750
|
var n, i, s;
|
|
4751
|
-
return
|
|
4751
|
+
return le(this, function(o) {
|
|
4752
4752
|
switch (o.label) {
|
|
4753
4753
|
case 0:
|
|
4754
4754
|
return n = Date.now(), [4, e()];
|
|
@@ -4769,9 +4769,9 @@ function rs() {
|
|
|
4769
4769
|
}
|
|
4770
4770
|
function as(e) {
|
|
4771
4771
|
var t;
|
|
4772
|
-
return e === void 0 && (e = {}),
|
|
4772
|
+
return e === void 0 && (e = {}), oe(this, void 0, void 0, function() {
|
|
4773
4773
|
var r, a, n;
|
|
4774
|
-
return
|
|
4774
|
+
return le(this, function(i) {
|
|
4775
4775
|
switch (i.label) {
|
|
4776
4776
|
case 0:
|
|
4777
4777
|
return (!((t = e.monitoring) !== null && t !== void 0) || t) && rs(), r = e.delayFallback, a = e.debug, [4, es(r)];
|
|
@@ -5026,8 +5026,8 @@ async function ls(e, t, r, a = {}) {
|
|
|
5026
5026
|
return f && r.onDocuments && r.onDocuments(f), !1;
|
|
5027
5027
|
}
|
|
5028
5028
|
if (h.type === "control_mode") {
|
|
5029
|
-
const f = h.mode,
|
|
5030
|
-
return f && r.onControlMode && r.onControlMode(f,
|
|
5029
|
+
const f = h.mode, v = !!h.queued;
|
|
5030
|
+
return f && r.onControlMode && r.onControlMode(f, v), v ? (r.onEnd(n), !0) : !1;
|
|
5031
5031
|
}
|
|
5032
5032
|
if (h.type === "tool_calls_started") {
|
|
5033
5033
|
const f = h.toolNames ?? [];
|
|
@@ -5044,16 +5044,16 @@ async function ls(e, t, r, a = {}) {
|
|
|
5044
5044
|
return f && r.onAck && r.onAck(f), !1;
|
|
5045
5045
|
}
|
|
5046
5046
|
if (h.type === "progress") {
|
|
5047
|
-
const f = h.stage,
|
|
5048
|
-
return f &&
|
|
5047
|
+
const f = h.stage, v = h.text, k = h.mode;
|
|
5048
|
+
return f && v && r.onProgress && r.onProgress(f, v, k), !1;
|
|
5049
5049
|
}
|
|
5050
5050
|
if (h.type === "tool_start") {
|
|
5051
|
-
const f = h.toolId,
|
|
5052
|
-
return f &&
|
|
5051
|
+
const f = h.toolId, v = h.text, k = h.toolName, I = h.mode;
|
|
5052
|
+
return f && v && r.onToolStart && r.onToolStart(f, v, k, I), !1;
|
|
5053
5053
|
}
|
|
5054
5054
|
if (h.type === "tool_complete") {
|
|
5055
|
-
const f = h.toolId,
|
|
5056
|
-
return f &&
|
|
5055
|
+
const f = h.toolId, v = h.text, k = h.durationMs, I = h.ok;
|
|
5056
|
+
return f && v && r.onToolComplete && r.onToolComplete(f, v, k ?? 0, I), !1;
|
|
5057
5057
|
}
|
|
5058
5058
|
if (h.type === "model_start" || h.type === "final_meta") {
|
|
5059
5059
|
if (h.type === "final_meta" && r.onFinalMeta) {
|
|
@@ -5180,7 +5180,7 @@ function ut(e) {
|
|
|
5180
5180
|
const t = Math.floor(e / 6e4), r = Math.round(e % 6e4 / 1e3);
|
|
5181
5181
|
return r > 0 ? `${t}m ${r}s` : `${t}m`;
|
|
5182
5182
|
}
|
|
5183
|
-
function
|
|
5183
|
+
function Ce() {
|
|
5184
5184
|
return `msg-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 7)}`;
|
|
5185
5185
|
}
|
|
5186
5186
|
var vs = class {
|
|
@@ -5266,7 +5266,7 @@ var vs = class {
|
|
|
5266
5266
|
}
|
|
5267
5267
|
if (!this.config.skipServerConfigFetch) {
|
|
5268
5268
|
const a = await this.apiClient.fetchWidgetConfig(this.config.agentId, this.config.tenantId);
|
|
5269
|
-
a && (this.config =
|
|
5269
|
+
a && (this.config = Ve(this.hostConfig, a), this.onStateChange(this.getState(), this.config));
|
|
5270
5270
|
}
|
|
5271
5271
|
if (this.setState({ initStatus: "ready" }), !this.state.sessionId) return;
|
|
5272
5272
|
this.openEventStream();
|
|
@@ -5284,7 +5284,7 @@ var vs = class {
|
|
|
5284
5284
|
kind: o.mimeType.startsWith("image/") ? "image" : "file"
|
|
5285
5285
|
})) : void 0;
|
|
5286
5286
|
return {
|
|
5287
|
-
id:
|
|
5287
|
+
id: Ce(),
|
|
5288
5288
|
role: a.role,
|
|
5289
5289
|
content: a.content,
|
|
5290
5290
|
images: !i && a.images && a.images.length > 0 ? a.images : void 0,
|
|
@@ -5321,7 +5321,7 @@ var vs = class {
|
|
|
5321
5321
|
if (typeof n.content != "string" || n.id && this.state.messages.some((i) => i.id === n.id)) return;
|
|
5322
5322
|
if (n.direction === "human") {
|
|
5323
5323
|
const i = {
|
|
5324
|
-
id: n.id ??
|
|
5324
|
+
id: n.id ?? Ce(),
|
|
5325
5325
|
role: "assistant",
|
|
5326
5326
|
content: n.content,
|
|
5327
5327
|
createdAt: n.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -5337,7 +5337,7 @@ var vs = class {
|
|
|
5337
5337
|
}
|
|
5338
5338
|
if (n.direction === "ai") {
|
|
5339
5339
|
const i = {
|
|
5340
|
-
id: n.id ??
|
|
5340
|
+
id: n.id ?? Ce(),
|
|
5341
5341
|
role: "assistant",
|
|
5342
5342
|
content: n.content,
|
|
5343
5343
|
createdAt: n.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -5421,7 +5421,7 @@ var vs = class {
|
|
|
5421
5421
|
return;
|
|
5422
5422
|
}
|
|
5423
5423
|
const n = a.filter((l) => l.kind === "image"), i = {
|
|
5424
|
-
id:
|
|
5424
|
+
id: Ce(),
|
|
5425
5425
|
role: "user",
|
|
5426
5426
|
content: e.trim(),
|
|
5427
5427
|
uploadedImageUrl: n[0]?.url,
|
|
@@ -5462,7 +5462,7 @@ var vs = class {
|
|
|
5462
5462
|
return;
|
|
5463
5463
|
}
|
|
5464
5464
|
const i = {
|
|
5465
|
-
id:
|
|
5465
|
+
id: Ce(),
|
|
5466
5466
|
role: "assistant",
|
|
5467
5467
|
content: n.content,
|
|
5468
5468
|
images: n.images,
|
|
@@ -5489,13 +5489,12 @@ var vs = class {
|
|
|
5489
5489
|
}
|
|
5490
5490
|
}
|
|
5491
5491
|
async sendStreaming(e, t, r, a = !1) {
|
|
5492
|
-
const n =
|
|
5492
|
+
const n = Ce(), i = {
|
|
5493
5493
|
id: n,
|
|
5494
5494
|
role: "assistant",
|
|
5495
5495
|
content: "",
|
|
5496
5496
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5497
|
-
status: "streaming"
|
|
5498
|
-
toolStatus: "Thinking..."
|
|
5497
|
+
status: "streaming"
|
|
5499
5498
|
};
|
|
5500
5499
|
this.setState({ messages: [...this.state.messages, i] }), this.emitter.emit("stream:start");
|
|
5501
5500
|
let s = !1, o = !1, l = null, c = null, u = null;
|
|
@@ -5532,44 +5531,44 @@ var vs = class {
|
|
|
5532
5531
|
onAck: (p) => {
|
|
5533
5532
|
this.updateMessage(n, { ackText: p });
|
|
5534
5533
|
},
|
|
5535
|
-
onProgress: (p, f,
|
|
5536
|
-
const
|
|
5537
|
-
|
|
5534
|
+
onProgress: (p, f, v) => {
|
|
5535
|
+
const k = this.state.messages.find((g) => g.id === n)?.progressEvents ?? [], I = Date.now();
|
|
5536
|
+
v && c === null && (c = v, this.updateMessage(n, { turnMeta: {
|
|
5538
5537
|
totalMs: null,
|
|
5539
5538
|
collapseAfterFinal: null,
|
|
5540
|
-
mode:
|
|
5541
|
-
} })), this.updateMessage(n, { progressEvents: [...kr(
|
|
5539
|
+
mode: v
|
|
5540
|
+
} })), this.updateMessage(n, { progressEvents: [...kr(k, I), {
|
|
5542
5541
|
stage: p,
|
|
5543
5542
|
text: f,
|
|
5544
5543
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5545
5544
|
status: "active",
|
|
5546
|
-
startedAtMs:
|
|
5545
|
+
startedAtMs: I
|
|
5547
5546
|
}] });
|
|
5548
5547
|
},
|
|
5549
|
-
onToolStart: (p, f,
|
|
5550
|
-
const
|
|
5551
|
-
|
|
5548
|
+
onToolStart: (p, f, v, k) => {
|
|
5549
|
+
const I = this.state.messages.find((N) => N.id === n)?.progressEvents ?? [], g = Date.now();
|
|
5550
|
+
k && c === null && (c = k, this.updateMessage(n, { turnMeta: {
|
|
5552
5551
|
totalMs: null,
|
|
5553
5552
|
collapseAfterFinal: null,
|
|
5554
|
-
mode:
|
|
5555
|
-
} })), this.updateMessage(n, { progressEvents: [...kr(
|
|
5553
|
+
mode: k
|
|
5554
|
+
} })), this.updateMessage(n, { progressEvents: [...kr(I, g), {
|
|
5556
5555
|
stage: "calling_tool",
|
|
5557
5556
|
toolId: p,
|
|
5558
|
-
toolName:
|
|
5557
|
+
toolName: v,
|
|
5559
5558
|
text: f,
|
|
5560
5559
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5561
5560
|
status: "active",
|
|
5562
5561
|
startedAtMs: g
|
|
5563
5562
|
}] });
|
|
5564
5563
|
},
|
|
5565
|
-
onToolComplete: (p, f,
|
|
5566
|
-
const
|
|
5567
|
-
this.updateMessage(n, { progressEvents:
|
|
5564
|
+
onToolComplete: (p, f, v, k) => {
|
|
5565
|
+
const I = this.state.messages.find((g) => g.id === n)?.progressEvents ?? [];
|
|
5566
|
+
this.updateMessage(n, { progressEvents: I.map((g) => g.stage === "calling_tool" && g.status === "active" && g.toolId === p ? {
|
|
5568
5567
|
...g,
|
|
5569
5568
|
status: "done",
|
|
5570
5569
|
text: f,
|
|
5571
|
-
durationMs:
|
|
5572
|
-
ok:
|
|
5570
|
+
durationMs: v,
|
|
5571
|
+
ok: k
|
|
5573
5572
|
} : g) });
|
|
5574
5573
|
},
|
|
5575
5574
|
onFinalMeta: (p, f) => {
|
|
@@ -5593,21 +5592,21 @@ var vs = class {
|
|
|
5593
5592
|
}), this.emitter.emit("stream:end", { content: "" });
|
|
5594
5593
|
return;
|
|
5595
5594
|
}
|
|
5596
|
-
const f = this.state.messages.find((g) => g.id === n),
|
|
5595
|
+
const f = this.state.messages.find((g) => g.id === n), v = c === "detailed", k = v || c === "standard";
|
|
5597
5596
|
this.updateMessage(n, {
|
|
5598
5597
|
content: p,
|
|
5599
5598
|
status: "sent",
|
|
5600
5599
|
toolStatus: void 0,
|
|
5601
|
-
progressEvents:
|
|
5602
|
-
progressCollapsed:
|
|
5603
|
-
turnMeta:
|
|
5600
|
+
progressEvents: v && f?.progressEvents?.length ? gs(f.progressEvents) : void 0,
|
|
5601
|
+
progressCollapsed: v ? u ?? !0 : void 0,
|
|
5602
|
+
turnMeta: k ? {
|
|
5604
5603
|
totalMs: l ?? Date.now() - h,
|
|
5605
5604
|
collapseAfterFinal: u,
|
|
5606
5605
|
mode: c
|
|
5607
5606
|
} : void 0
|
|
5608
5607
|
}), this.setState({ isLoading: !1 }), this.emitter.emit("stream:end", { content: p });
|
|
5609
|
-
const
|
|
5610
|
-
|
|
5608
|
+
const I = this.state.messages.find((g) => g.id === n);
|
|
5609
|
+
I && this.emitter.emit("message:received", I);
|
|
5611
5610
|
},
|
|
5612
5611
|
onControlMode: (p, f) => {
|
|
5613
5612
|
f && p === "human" && (o = !0);
|
|
@@ -5621,9 +5620,9 @@ var vs = class {
|
|
|
5621
5620
|
return;
|
|
5622
5621
|
}
|
|
5623
5622
|
const f = (g) => {
|
|
5624
|
-
const
|
|
5623
|
+
const N = this.state.messages.find((j) => j.id === n)?.content ?? "";
|
|
5625
5624
|
this.updateMessage(n, {
|
|
5626
|
-
content:
|
|
5625
|
+
content: N || g,
|
|
5627
5626
|
status: "error"
|
|
5628
5627
|
}), this.setState({
|
|
5629
5628
|
isLoading: !1,
|
|
@@ -5632,19 +5631,19 @@ var vs = class {
|
|
|
5632
5631
|
error: g,
|
|
5633
5632
|
message: null
|
|
5634
5633
|
}), this.reportError(g, { stack: p.stack });
|
|
5635
|
-
},
|
|
5634
|
+
}, v = (g) => {
|
|
5636
5635
|
this.updateMessage(n, {
|
|
5637
5636
|
content: g,
|
|
5638
5637
|
status: "sent",
|
|
5639
5638
|
toolStatus: void 0,
|
|
5640
5639
|
progressEvents: void 0
|
|
5641
5640
|
}), this.setState({ isLoading: !1 }), this.emitter.emit("stream:end", { content: g });
|
|
5642
|
-
const
|
|
5643
|
-
|
|
5644
|
-
},
|
|
5645
|
-
if (
|
|
5646
|
-
hs(this.config.apiBaseUrl,
|
|
5647
|
-
g.status === "done" && g.finalText ?
|
|
5641
|
+
const N = this.state.messages.find((j) => j.id === n);
|
|
5642
|
+
N && this.emitter.emit("message:received", N);
|
|
5643
|
+
}, k = this.state.messages.find((g) => g.id === n)?.runId, I = this.state.sessionId;
|
|
5644
|
+
if (k && I) {
|
|
5645
|
+
hs(this.config.apiBaseUrl, I, k, { preview: this.config.preview }).then((g) => {
|
|
5646
|
+
g.status === "done" && g.finalText ? v(g.finalText) : f(g.errorMessage || p.message || "Something went wrong. Please try again.");
|
|
5648
5647
|
}).catch(() => f(p.message || "Something went wrong. Please try again."));
|
|
5649
5648
|
return;
|
|
5650
5649
|
}
|
|
@@ -5771,39 +5770,39 @@ function Yt(e, t, r, a, n) {
|
|
|
5771
5770
|
};
|
|
5772
5771
|
return h;
|
|
5773
5772
|
}
|
|
5774
|
-
var
|
|
5773
|
+
var Ee = /* @__PURE__ */ new Map(), Es = 0;
|
|
5775
5774
|
function Xt(e) {
|
|
5776
5775
|
const t = `agentkit-widget-${++Es}`, r = e.destroy.bind(e);
|
|
5777
5776
|
return e.destroy = () => {
|
|
5778
|
-
|
|
5779
|
-
},
|
|
5777
|
+
Ee.delete(t), r();
|
|
5778
|
+
}, Ee.set(t, e), t;
|
|
5780
5779
|
}
|
|
5781
5780
|
function Ms(e, t, r) {
|
|
5782
5781
|
const a = {
|
|
5783
5782
|
...e,
|
|
5784
5783
|
mode: "floating"
|
|
5785
|
-
}, n = Yt(
|
|
5784
|
+
}, n = Yt(Ve(a), a, t, r);
|
|
5786
5785
|
return Xt(n), n;
|
|
5787
5786
|
}
|
|
5788
5787
|
function Ls(e, t, r, a) {
|
|
5789
5788
|
const n = {
|
|
5790
5789
|
...t,
|
|
5791
5790
|
mode: "floating"
|
|
5792
|
-
}, i = Yt(
|
|
5791
|
+
}, i = Yt(Ve(n), n, r, a, e);
|
|
5793
5792
|
return Xt(i), i;
|
|
5794
5793
|
}
|
|
5795
5794
|
function Ts(e, t, r, a) {
|
|
5796
5795
|
const n = {
|
|
5797
5796
|
...t,
|
|
5798
5797
|
mode: "inline"
|
|
5799
|
-
}, i = Yt(
|
|
5798
|
+
}, i = Yt(Ve(n), n, r, a, e);
|
|
5800
5799
|
return Xt(i), i;
|
|
5801
5800
|
}
|
|
5802
5801
|
function As(e) {
|
|
5803
|
-
e ?
|
|
5802
|
+
e ? Ee.get(e)?.destroy() : (Ee.forEach((t) => t.destroy()), Ee.clear());
|
|
5804
5803
|
}
|
|
5805
5804
|
function Qo() {
|
|
5806
|
-
return Array.from(
|
|
5805
|
+
return Array.from(Ee.keys());
|
|
5807
5806
|
}
|
|
5808
5807
|
function Rs(e) {
|
|
5809
5808
|
const { theme: t } = e, r = [
|
|
@@ -7108,6 +7107,39 @@ var Zs = `
|
|
|
7108
7107
|
.ak-cursor__dot:nth-child(2) { animation-delay: 0.2s; }
|
|
7109
7108
|
.ak-cursor__dot:nth-child(3) { animation-delay: 0.4s; }
|
|
7110
7109
|
|
|
7110
|
+
/* Pre-first-chunk wait — deliberately shares the metrics of .ak-progress__item
|
|
7111
|
+
and .ak-progress__summary so dots → activity line → summary never reflow. */
|
|
7112
|
+
.ak-typing-row {
|
|
7113
|
+
display: inline-flex;
|
|
7114
|
+
align-items: center;
|
|
7115
|
+
gap: 5px;
|
|
7116
|
+
padding: 2px 0;
|
|
7117
|
+
margin: 0 0 4px;
|
|
7118
|
+
/* One text line at the shared row metrics, so the dots occupy exactly the
|
|
7119
|
+
box the activity line and summary will occupy (border-box). */
|
|
7120
|
+
min-height: calc(0.76rem * 1.4 + 4px);
|
|
7121
|
+
animation: ak-msg-in 0.15s ease-out;
|
|
7122
|
+
}
|
|
7123
|
+
.ak-typing-row__dot {
|
|
7124
|
+
width: 6px;
|
|
7125
|
+
height: 6px;
|
|
7126
|
+
border-radius: 50%;
|
|
7127
|
+
background: var(--ak-bot-text);
|
|
7128
|
+
opacity: 0.5;
|
|
7129
|
+
animation: ak-bounce 1.3s infinite ease-in-out;
|
|
7130
|
+
}
|
|
7131
|
+
.ak-typing-row__dot:nth-child(2) { animation-delay: 0.2s; }
|
|
7132
|
+
.ak-typing-row__dot:nth-child(3) { animation-delay: 0.4s; }
|
|
7133
|
+
@media (prefers-reduced-motion: reduce) {
|
|
7134
|
+
.ak-typing-row__dot,
|
|
7135
|
+
.ak-cursor__dot,
|
|
7136
|
+
.ak-typing__dot,
|
|
7137
|
+
.ak-progress__item--active,
|
|
7138
|
+
.ak-agent-status__icon {
|
|
7139
|
+
animation: none;
|
|
7140
|
+
}
|
|
7141
|
+
}
|
|
7142
|
+
|
|
7111
7143
|
/* ── Markdown rendering ──────────────────────────────────────── */
|
|
7112
7144
|
.ak-message__bubble--md {
|
|
7113
7145
|
white-space: normal;
|
|
@@ -7398,19 +7430,18 @@ var Zs = `
|
|
|
7398
7430
|
}
|
|
7399
7431
|
|
|
7400
7432
|
/* ── Agent status indicator ──────────────────────────────────── */
|
|
7433
|
+
/* Same bare row as .ak-progress__item / .ak-typing-row — activity-off tenants
|
|
7434
|
+
see the tool status swap in without the surrounding box changing size. */
|
|
7401
7435
|
.ak-agent-status {
|
|
7402
7436
|
display: inline-flex;
|
|
7403
7437
|
align-items: center;
|
|
7404
|
-
gap:
|
|
7438
|
+
gap: 6px;
|
|
7405
7439
|
margin-bottom: 4px;
|
|
7406
|
-
padding:
|
|
7407
|
-
border-radius: 14px;
|
|
7408
|
-
background: var(--ak-bot-bg);
|
|
7409
|
-
border: 1px solid var(--ak-border);
|
|
7440
|
+
padding: 2px 0;
|
|
7410
7441
|
color: var(--ak-bot-text);
|
|
7411
|
-
font-size: 0.
|
|
7412
|
-
|
|
7413
|
-
opacity: 0.
|
|
7442
|
+
font-size: 0.76rem;
|
|
7443
|
+
line-height: 1.4;
|
|
7444
|
+
opacity: 0.6;
|
|
7414
7445
|
animation: ak-msg-in 0.15s ease-out;
|
|
7415
7446
|
}
|
|
7416
7447
|
.ak-agent-status__icon {
|
|
@@ -7419,7 +7450,7 @@ var Zs = `
|
|
|
7419
7450
|
animation: ak-sparkle-pulse 2.5s ease-in-out infinite;
|
|
7420
7451
|
}
|
|
7421
7452
|
.ak-agent-status__text {
|
|
7422
|
-
line-height: 1;
|
|
7453
|
+
line-height: 1.4;
|
|
7423
7454
|
}
|
|
7424
7455
|
@keyframes ak-sparkle-pulse {
|
|
7425
7456
|
0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
|
|
@@ -7486,9 +7517,8 @@ var Zs = `
|
|
|
7486
7517
|
}
|
|
7487
7518
|
.ak-progress__toggle--collapsed:hover { opacity: 0.85; }
|
|
7488
7519
|
.ak-progress__text {
|
|
7489
|
-
font-size: 0.
|
|
7520
|
+
font-size: 0.76rem;
|
|
7490
7521
|
color: var(--ak-bot-text);
|
|
7491
|
-
opacity: 0.75;
|
|
7492
7522
|
line-height: 1.4;
|
|
7493
7523
|
margin: 0;
|
|
7494
7524
|
}
|
|
@@ -7498,18 +7528,17 @@ var Zs = `
|
|
|
7498
7528
|
margin: 0 0 4px;
|
|
7499
7529
|
padding: 0;
|
|
7500
7530
|
}
|
|
7531
|
+
/* Bare row, not a pill — identical metrics to .ak-progress__summary so the
|
|
7532
|
+
live line and the post-turn "Worked for Ns" swap without a size change. */
|
|
7501
7533
|
.ak-progress__item {
|
|
7502
7534
|
display: flex;
|
|
7503
7535
|
align-items: center;
|
|
7504
|
-
gap:
|
|
7505
|
-
padding:
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
border: 1px solid var(--ak-border);
|
|
7509
|
-
font-size: 0.8rem;
|
|
7536
|
+
gap: 6px;
|
|
7537
|
+
padding: 2px 0;
|
|
7538
|
+
font-size: 0.76rem;
|
|
7539
|
+
line-height: 1.4;
|
|
7510
7540
|
color: var(--ak-bot-text);
|
|
7511
|
-
|
|
7512
|
-
opacity: 0.8;
|
|
7541
|
+
opacity: 0.6;
|
|
7513
7542
|
animation: ak-msg-in 0.15s ease-out;
|
|
7514
7543
|
}
|
|
7515
7544
|
.ak-progress__item--active {
|
|
@@ -7517,8 +7546,8 @@ var Zs = `
|
|
|
7517
7546
|
animation: ak-msg-in 0.15s ease-out, ak-active-pulse 2s ease-in-out infinite;
|
|
7518
7547
|
}
|
|
7519
7548
|
@keyframes ak-active-pulse {
|
|
7520
|
-
0%, 100% { opacity: 0.
|
|
7521
|
-
50% { opacity:
|
|
7549
|
+
0%, 100% { opacity: 0.6; }
|
|
7550
|
+
50% { opacity: 0.9; }
|
|
7522
7551
|
}
|
|
7523
7552
|
/* Claude-style step list (detailed mode) */
|
|
7524
7553
|
.ak-progress__steps {
|
|
@@ -7561,6 +7590,9 @@ var Zs = `
|
|
|
7561
7590
|
gap: 6px;
|
|
7562
7591
|
padding: 2px 0;
|
|
7563
7592
|
margin: 0 0 4px;
|
|
7593
|
+
/* Shrink-to-fit as a column flex item would otherwise break "Worked for 8.4s"
|
|
7594
|
+
onto two lines, doubling the row height as the turn ends. */
|
|
7595
|
+
white-space: nowrap;
|
|
7564
7596
|
border: none;
|
|
7565
7597
|
background: transparent;
|
|
7566
7598
|
font-size: 0.76rem;
|
|
@@ -7751,7 +7783,7 @@ function Ps() {
|
|
|
7751
7783
|
});
|
|
7752
7784
|
}
|
|
7753
7785
|
function $s({ title: e, subtitle: t, avatarUrl: r, onClose: a, onReset: n, hideClose: i = !1 }) {
|
|
7754
|
-
const [s, o] =
|
|
7786
|
+
const [s, o] = ne(!1);
|
|
7755
7787
|
return /* @__PURE__ */ y("div", {
|
|
7756
7788
|
className: `ak-header${s ? " ak-header--confirming" : ""}`,
|
|
7757
7789
|
children: [/* @__PURE__ */ y("div", {
|
|
@@ -7837,7 +7869,7 @@ function $s({ title: e, subtitle: t, avatarUrl: r, onClose: a, onReset: n, hideC
|
|
|
7837
7869
|
})]
|
|
7838
7870
|
});
|
|
7839
7871
|
}
|
|
7840
|
-
function
|
|
7872
|
+
function $e(e) {
|
|
7841
7873
|
if (!e) return null;
|
|
7842
7874
|
const t = e.trim();
|
|
7843
7875
|
if (!t) return null;
|
|
@@ -7851,8 +7883,8 @@ function Pe(e) {
|
|
|
7851
7883
|
].includes(r) ? t : null : t;
|
|
7852
7884
|
}
|
|
7853
7885
|
function ia(e) {
|
|
7854
|
-
const [, t] =
|
|
7855
|
-
|
|
7886
|
+
const [, t] = ne(0);
|
|
7887
|
+
X(() => {
|
|
7856
7888
|
if (!e) return;
|
|
7857
7889
|
const r = setInterval(() => t((a) => a + 1), 1e3);
|
|
7858
7890
|
return () => clearInterval(r);
|
|
@@ -7888,7 +7920,7 @@ function ht({ event: e, active: t }) {
|
|
|
7888
7920
|
strokeLinecap: "round",
|
|
7889
7921
|
strokeLinejoin: "round",
|
|
7890
7922
|
"aria-hidden": "true",
|
|
7891
|
-
children: e.ok === !1 ? /* @__PURE__ */ y(
|
|
7923
|
+
children: e.ok === !1 ? /* @__PURE__ */ y(ve, { children: [/* @__PURE__ */ d("line", {
|
|
7892
7924
|
x1: "18",
|
|
7893
7925
|
y1: "6",
|
|
7894
7926
|
x2: "6",
|
|
@@ -7930,8 +7962,8 @@ function yr({ events: e, live: t }) {
|
|
|
7930
7962
|
});
|
|
7931
7963
|
}
|
|
7932
7964
|
function Ws({ events: e }) {
|
|
7933
|
-
const [t, r] =
|
|
7934
|
-
|
|
7965
|
+
const [t, r] = ne(0), a = Math.min(t, e.length - 1), n = a < e.length - 1;
|
|
7966
|
+
X(() => {
|
|
7935
7967
|
if (!n) return;
|
|
7936
7968
|
const c = setTimeout(() => r((u) => Math.min(u + 1, e.length - 1)), Vs);
|
|
7937
7969
|
return () => clearTimeout(c);
|
|
@@ -7969,8 +8001,8 @@ function Ws({ events: e }) {
|
|
|
7969
8001
|
});
|
|
7970
8002
|
}
|
|
7971
8003
|
function Ds({ ackText: e, events: t = [], collapsed: r = !0, isComplete: a = !1, turnMeta: n }) {
|
|
7972
|
-
const [i, s] =
|
|
7973
|
-
|
|
8004
|
+
const [i, s] = ne(!r);
|
|
8005
|
+
X(() => {
|
|
7974
8006
|
a && s(!r);
|
|
7975
8007
|
}, [a]);
|
|
7976
8008
|
const o = n?.mode;
|
|
@@ -8083,7 +8115,7 @@ function br({ messageId: e, images: t, onCellClick: r }) {
|
|
|
8083
8115
|
className: "ak-gallery__img ak-gallery__img--contain"
|
|
8084
8116
|
})
|
|
8085
8117
|
}), /* @__PURE__ */ d("a", {
|
|
8086
|
-
href:
|
|
8118
|
+
href: $e(s.downloadHref) ?? void 0,
|
|
8087
8119
|
download: !0,
|
|
8088
8120
|
className: "ak-message__image-dl-icon",
|
|
8089
8121
|
title: "Download image",
|
|
@@ -8113,7 +8145,7 @@ function br({ messageId: e, images: t, onCellClick: r }) {
|
|
|
8113
8145
|
}
|
|
8114
8146
|
if (a === 2) return /* @__PURE__ */ d("div", {
|
|
8115
8147
|
className: "ak-gallery ak-gallery--two",
|
|
8116
|
-
children: t.map((s, o) => /* @__PURE__ */ d(
|
|
8148
|
+
children: t.map((s, o) => /* @__PURE__ */ d(Re, {
|
|
8117
8149
|
src: s.src,
|
|
8118
8150
|
alt: s.alt,
|
|
8119
8151
|
onClick: () => r(o)
|
|
@@ -8121,17 +8153,17 @@ function br({ messageId: e, images: t, onCellClick: r }) {
|
|
|
8121
8153
|
});
|
|
8122
8154
|
if (a === 3) return /* @__PURE__ */ y("div", {
|
|
8123
8155
|
className: "ak-gallery ak-gallery--three",
|
|
8124
|
-
children: [/* @__PURE__ */ d(
|
|
8156
|
+
children: [/* @__PURE__ */ d(Re, {
|
|
8125
8157
|
src: t[0].src,
|
|
8126
8158
|
alt: t[0].alt,
|
|
8127
8159
|
onClick: () => r(0)
|
|
8128
8160
|
}, t[0].key ?? `${e}-0`), /* @__PURE__ */ y("div", {
|
|
8129
8161
|
className: "ak-gallery__col",
|
|
8130
|
-
children: [/* @__PURE__ */ d(
|
|
8162
|
+
children: [/* @__PURE__ */ d(Re, {
|
|
8131
8163
|
src: t[1].src,
|
|
8132
8164
|
alt: t[1].alt,
|
|
8133
8165
|
onClick: () => r(1)
|
|
8134
|
-
}, t[1].key ?? `${e}-1`), /* @__PURE__ */ d(
|
|
8166
|
+
}, t[1].key ?? `${e}-1`), /* @__PURE__ */ d(Re, {
|
|
8135
8167
|
src: t[2].src,
|
|
8136
8168
|
alt: t[2].alt,
|
|
8137
8169
|
onClick: () => r(2)
|
|
@@ -8143,7 +8175,7 @@ function br({ messageId: e, images: t, onCellClick: r }) {
|
|
|
8143
8175
|
className: "ak-gallery ak-gallery--grid",
|
|
8144
8176
|
children: n.map((s, o) => {
|
|
8145
8177
|
const l = o === n.length - 1;
|
|
8146
|
-
return /* @__PURE__ */ d(
|
|
8178
|
+
return /* @__PURE__ */ d(Re, {
|
|
8147
8179
|
src: s.src,
|
|
8148
8180
|
alt: s.alt,
|
|
8149
8181
|
overlayCount: l && i > 0 ? i : 0,
|
|
@@ -8152,7 +8184,7 @@ function br({ messageId: e, images: t, onCellClick: r }) {
|
|
|
8152
8184
|
})
|
|
8153
8185
|
});
|
|
8154
8186
|
}
|
|
8155
|
-
function
|
|
8187
|
+
function Re({ src: e, alt: t, overlayCount: r = 0, onClick: a }) {
|
|
8156
8188
|
return /* @__PURE__ */ y("button", {
|
|
8157
8189
|
type: "button",
|
|
8158
8190
|
onClick: a,
|
|
@@ -8171,7 +8203,7 @@ function Ae({ src: e, alt: t, overlayCount: r = 0, onClick: a }) {
|
|
|
8171
8203
|
}
|
|
8172
8204
|
function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
|
|
8173
8205
|
const n = t !== null, i = n && t !== null ? Math.min(Math.max(0, t), e.length - 1) : 0, s = n ? e[i] : null;
|
|
8174
|
-
return
|
|
8206
|
+
return X(() => {
|
|
8175
8207
|
if (!n) return;
|
|
8176
8208
|
const o = (l) => {
|
|
8177
8209
|
l.key === "Escape" ? (l.stopPropagation(), r()) : l.key === "ArrowLeft" && e.length > 1 ? (l.preventDefault(), a((i - 1 + e.length) % e.length)) : l.key === "ArrowRight" && e.length > 1 && (l.preventDefault(), a((i + 1) % e.length));
|
|
@@ -8203,7 +8235,7 @@ function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
|
|
|
8203
8235
|
]
|
|
8204
8236
|
}),
|
|
8205
8237
|
/* @__PURE__ */ d("a", {
|
|
8206
|
-
href:
|
|
8238
|
+
href: $e(s.downloadHref) ?? void 0,
|
|
8207
8239
|
download: !0,
|
|
8208
8240
|
target: "_blank",
|
|
8209
8241
|
rel: "noopener noreferrer",
|
|
@@ -8261,7 +8293,7 @@ function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
|
|
|
8261
8293
|
})
|
|
8262
8294
|
]
|
|
8263
8295
|
}),
|
|
8264
|
-
e.length > 1 && /* @__PURE__ */ y(
|
|
8296
|
+
e.length > 1 && /* @__PURE__ */ y(ve, { children: [/* @__PURE__ */ d("button", {
|
|
8265
8297
|
type: "button",
|
|
8266
8298
|
onClick: (o) => {
|
|
8267
8299
|
o.stopPropagation(), a((i - 1 + e.length) % e.length);
|
|
@@ -8333,7 +8365,7 @@ function xr({ url: e, mimeType: t, fileName: r }) {
|
|
|
8333
8365
|
label: n || "FILE"
|
|
8334
8366
|
};
|
|
8335
8367
|
return /* @__PURE__ */ y("a", {
|
|
8336
|
-
href:
|
|
8368
|
+
href: $e(e) ?? void 0,
|
|
8337
8369
|
target: "_blank",
|
|
8338
8370
|
rel: "noopener noreferrer",
|
|
8339
8371
|
className: "ak-file-chip",
|
|
@@ -8375,7 +8407,7 @@ function Gs(e) {
|
|
|
8375
8407
|
}
|
|
8376
8408
|
}
|
|
8377
8409
|
var wr = /(`[^`\n]+`|\*\*[^*\n]+\*\*|\*[^*\n]+\*|!\[[^\]\n]*\]\([^)\n]+\)|\[[^\]\n]+\]\([^)\n]+\))/g;
|
|
8378
|
-
function
|
|
8410
|
+
function Y(e) {
|
|
8379
8411
|
const t = [];
|
|
8380
8412
|
let r = 0, a = 0;
|
|
8381
8413
|
wr.lastIndex = 0;
|
|
@@ -8390,7 +8422,7 @@ function G(e) {
|
|
|
8390
8422
|
else if (i.startsWith("**")) t.push(/* @__PURE__ */ d("strong", { children: i.slice(2, -2) }, a++));
|
|
8391
8423
|
else if (i.startsWith("*")) t.push(/* @__PURE__ */ d("em", { children: i.slice(1, -1) }, a++));
|
|
8392
8424
|
else if (i.startsWith("![")) {
|
|
8393
|
-
const s = i.match(/!\[([^\]]*)\]\(([^)]+)\)/), o =
|
|
8425
|
+
const s = i.match(/!\[([^\]]*)\]\(([^)]+)\)/), o = $e(s?.[2]);
|
|
8394
8426
|
s && o ? t.push(/* @__PURE__ */ d("a", {
|
|
8395
8427
|
href: o,
|
|
8396
8428
|
target: "_blank",
|
|
@@ -8398,7 +8430,7 @@ function G(e) {
|
|
|
8398
8430
|
children: s[1] || "image"
|
|
8399
8431
|
}, a++)) : s && t.push(s[1] || "image");
|
|
8400
8432
|
} else {
|
|
8401
|
-
const s = i.match(/\[(.+?)\]\((.+?)\)/), o =
|
|
8433
|
+
const s = i.match(/\[(.+?)\]\((.+?)\)/), o = $e(s?.[2]);
|
|
8402
8434
|
s && o ? t.push(/* @__PURE__ */ d("a", {
|
|
8403
8435
|
href: o,
|
|
8404
8436
|
target: "_blank",
|
|
@@ -8441,7 +8473,7 @@ function Hs(e) {
|
|
|
8441
8473
|
}
|
|
8442
8474
|
const o = i.match(/^(#{1,6})(\s+.*)?$/);
|
|
8443
8475
|
if (o) {
|
|
8444
|
-
const c = o[1].length, u = o[2] ?
|
|
8476
|
+
const c = o[1].length, u = o[2] ? Y(o[2].trim()) : "";
|
|
8445
8477
|
c === 1 ? r.push(/* @__PURE__ */ d("h1", {
|
|
8446
8478
|
className: "ak-md-h1",
|
|
8447
8479
|
children: u
|
|
@@ -8475,21 +8507,21 @@ function Hs(e) {
|
|
|
8475
8507
|
u++;
|
|
8476
8508
|
continue;
|
|
8477
8509
|
}
|
|
8478
|
-
const h = t[u].length - t[u].trimStart().length, p = t[u].replace(/^[-*+]\s+/, ""), f = [],
|
|
8479
|
-
let
|
|
8480
|
-
for (;
|
|
8481
|
-
const g = t[
|
|
8510
|
+
const h = t[u].length - t[u].trimStart().length, p = t[u].replace(/^[-*+]\s+/, ""), f = [], v = [];
|
|
8511
|
+
let k = u + 1;
|
|
8512
|
+
for (; k < t.length && k < u + 20; ) {
|
|
8513
|
+
const g = t[k];
|
|
8482
8514
|
if (g.length - g.trimStart().length > h && g.trim() !== "") {
|
|
8483
|
-
const
|
|
8484
|
-
/^[-*+]\s/.test(
|
|
8515
|
+
const N = g.trim();
|
|
8516
|
+
/^[-*+]\s/.test(N) ? f.push(/* @__PURE__ */ d("li", { children: Y(N.replace(/^[-*+]\s+/, "")) }, `nested-${k}`)) : v.push(/* @__PURE__ */ d("p", {
|
|
8485
8517
|
style: { margin: "0.2em 0 0" },
|
|
8486
|
-
children:
|
|
8487
|
-
}, `cont-${
|
|
8518
|
+
children: Y(N)
|
|
8519
|
+
}, `cont-${k}`)), k++;
|
|
8488
8520
|
} else break;
|
|
8489
8521
|
}
|
|
8490
|
-
const
|
|
8491
|
-
|
|
8492
|
-
|
|
8522
|
+
const I = v.length > 0 || f.length > 0 ? /* @__PURE__ */ y(ve, { children: [
|
|
8523
|
+
Y(p),
|
|
8524
|
+
v,
|
|
8493
8525
|
f.length > 0 && /* @__PURE__ */ d("ul", {
|
|
8494
8526
|
style: {
|
|
8495
8527
|
margin: "0.2em 0 0",
|
|
@@ -8497,8 +8529,8 @@ function Hs(e) {
|
|
|
8497
8529
|
},
|
|
8498
8530
|
children: f
|
|
8499
8531
|
})
|
|
8500
|
-
] }) :
|
|
8501
|
-
c.push(/* @__PURE__ */ d("li", { children:
|
|
8532
|
+
] }) : Y(p);
|
|
8533
|
+
c.push(/* @__PURE__ */ d("li", { children: I }, `item-${u}`)), u = k;
|
|
8502
8534
|
}
|
|
8503
8535
|
r.push(/* @__PURE__ */ d("ul", {
|
|
8504
8536
|
className: "ak-md-ul",
|
|
@@ -8514,21 +8546,21 @@ function Hs(e) {
|
|
|
8514
8546
|
u++;
|
|
8515
8547
|
continue;
|
|
8516
8548
|
}
|
|
8517
|
-
const h = t[u].length - t[u].trimStart().length, p = t[u].replace(/^\d+\.\s+/, ""), f = [],
|
|
8518
|
-
let
|
|
8519
|
-
for (;
|
|
8520
|
-
const g = t[
|
|
8549
|
+
const h = t[u].length - t[u].trimStart().length, p = t[u].replace(/^\d+\.\s+/, ""), f = [], v = [];
|
|
8550
|
+
let k = u + 1;
|
|
8551
|
+
for (; k < t.length && k < u + 20; ) {
|
|
8552
|
+
const g = t[k];
|
|
8521
8553
|
if (g.length - g.trimStart().length > h && g.trim() !== "") {
|
|
8522
|
-
const
|
|
8523
|
-
/^\d+\.\s/.test(
|
|
8554
|
+
const N = g.trim();
|
|
8555
|
+
/^\d+\.\s/.test(N) ? f.push(/* @__PURE__ */ d("li", { children: Y(N.replace(/^\d+\.\s+/, "")) }, `nested-order-${k}`)) : /^[-*+]\s/.test(N) ? f.push(/* @__PURE__ */ d("li", { children: Y(N.replace(/^[-*+]\s+/, "")) }, `nested-unorder-${k}`)) : v.push(/* @__PURE__ */ d("p", {
|
|
8524
8556
|
style: { margin: "0.2em 0 0" },
|
|
8525
|
-
children:
|
|
8526
|
-
}, `cont-${
|
|
8557
|
+
children: Y(N)
|
|
8558
|
+
}, `cont-${k}`)), k++;
|
|
8527
8559
|
} else break;
|
|
8528
8560
|
}
|
|
8529
|
-
const
|
|
8530
|
-
|
|
8531
|
-
|
|
8561
|
+
const I = v.length > 0 || f.length > 0 ? /* @__PURE__ */ y(ve, { children: [
|
|
8562
|
+
Y(p),
|
|
8563
|
+
v,
|
|
8532
8564
|
f.length > 0 && /* @__PURE__ */ d("ol", {
|
|
8533
8565
|
style: {
|
|
8534
8566
|
margin: "0.2em 0 0",
|
|
@@ -8536,8 +8568,8 @@ function Hs(e) {
|
|
|
8536
8568
|
},
|
|
8537
8569
|
children: f
|
|
8538
8570
|
})
|
|
8539
|
-
] }) :
|
|
8540
|
-
c.push(/* @__PURE__ */ d("li", { children:
|
|
8571
|
+
] }) : Y(p);
|
|
8572
|
+
c.push(/* @__PURE__ */ d("li", { children: I }, `order-item-${u}`)), u = k;
|
|
8541
8573
|
}
|
|
8542
8574
|
r.push(/* @__PURE__ */ d("ol", {
|
|
8543
8575
|
className: "ak-md-ol",
|
|
@@ -8552,28 +8584,28 @@ function Hs(e) {
|
|
|
8552
8584
|
if (i.includes("|") && a + 1 < t.length && t[a + 1].includes("|")) {
|
|
8553
8585
|
const c = t[a + 1];
|
|
8554
8586
|
if (/^\s*\|?[\s:|*-]+\|[\s:|*-|]+\|?[\s:|*-]*$/.test(c)) {
|
|
8555
|
-
const u = i.split("|").map((
|
|
8556
|
-
const
|
|
8557
|
-
return
|
|
8558
|
-
}).filter((
|
|
8587
|
+
const u = i.split("|").map((v) => v.trim()).filter((v) => v.length > 0), h = c.split("|").map((v) => {
|
|
8588
|
+
const k = v.trim();
|
|
8589
|
+
return k.startsWith(":") && k.endsWith(":") ? "center" : k.endsWith(":") ? "right" : (k.startsWith(":"), "left");
|
|
8590
|
+
}).filter((v, k) => k > 0 && k <= u.length), p = [];
|
|
8559
8591
|
let f = a + 2;
|
|
8560
8592
|
for (; f < t.length && t[f].includes("|") && t[f].trim() !== ""; ) {
|
|
8561
|
-
const
|
|
8562
|
-
if (
|
|
8563
|
-
p.push(
|
|
8593
|
+
const v = t[f].split("|").map((k) => k.trim()).filter((k) => k.length > 0);
|
|
8594
|
+
if (v.length > 0)
|
|
8595
|
+
p.push(v), f++;
|
|
8564
8596
|
else break;
|
|
8565
8597
|
}
|
|
8566
8598
|
r.push(/* @__PURE__ */ y("table", {
|
|
8567
8599
|
className: "ak-md-table",
|
|
8568
|
-
children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: u.map((
|
|
8569
|
-
style: { textAlign: h[
|
|
8600
|
+
children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: u.map((v, k) => /* @__PURE__ */ d("th", {
|
|
8601
|
+
style: { textAlign: h[k] || "left" },
|
|
8570
8602
|
className: "ak-md-th",
|
|
8571
|
-
children:
|
|
8572
|
-
}, `th-${
|
|
8603
|
+
children: Y(v)
|
|
8604
|
+
}, `th-${k}`)) }) }), /* @__PURE__ */ d("tbody", { children: p.map((v, k) => /* @__PURE__ */ d("tr", { children: u.map((I, g) => /* @__PURE__ */ d("td", {
|
|
8573
8605
|
style: { textAlign: h[g] || "left" },
|
|
8574
8606
|
className: "ak-md-td",
|
|
8575
|
-
children:
|
|
8576
|
-
}, `td-${
|
|
8607
|
+
children: v[g] ? Y(v[g]) : ""
|
|
8608
|
+
}, `td-${k}-${g}`)) }, `tr-${k}`)) })]
|
|
8577
8609
|
}, n++)), a = f;
|
|
8578
8610
|
continue;
|
|
8579
8611
|
}
|
|
@@ -8584,76 +8616,76 @@ function Hs(e) {
|
|
|
8584
8616
|
if (l.length > 0) {
|
|
8585
8617
|
const c = [];
|
|
8586
8618
|
l.forEach((u, h) => {
|
|
8587
|
-
c.push(...
|
|
8619
|
+
c.push(...Y(u)), h < l.length - 1 && c.push(/* @__PURE__ */ d("br", {}, `br-${h}`));
|
|
8588
8620
|
}), r.push(/* @__PURE__ */ d("p", {
|
|
8589
8621
|
className: "ak-md-p",
|
|
8590
8622
|
children: c
|
|
8591
8623
|
}, n++));
|
|
8592
8624
|
}
|
|
8593
8625
|
}
|
|
8594
|
-
return /* @__PURE__ */ d(
|
|
8626
|
+
return /* @__PURE__ */ d(ve, { children: r });
|
|
8595
8627
|
}
|
|
8596
8628
|
function Ys({ message: e }) {
|
|
8597
|
-
const [t, r] =
|
|
8629
|
+
const [t, r] = ne(null), [a, n] = ne(null), i = e.role === "user", s = e.status === "error", o = e.status === "streaming", l = !!(e.images && e.images.length > 0), c = !!(e.documents && e.documents.length > 0), u = (() => {
|
|
8598
8630
|
if (!i) return [];
|
|
8599
|
-
const
|
|
8600
|
-
url:
|
|
8601
|
-
mimeType:
|
|
8602
|
-
fileName:
|
|
8631
|
+
const C = (e.uploadedAttachments ?? []).filter((F) => F.kind === "image").map((F) => ({
|
|
8632
|
+
url: F.url,
|
|
8633
|
+
mimeType: F.mimeType,
|
|
8634
|
+
fileName: F.fileName
|
|
8603
8635
|
}));
|
|
8604
|
-
return
|
|
8636
|
+
return C.length > 0 ? C : e.uploadedImageUrl ? [{
|
|
8605
8637
|
url: e.uploadedImageUrl,
|
|
8606
8638
|
mimeType: "image/jpeg"
|
|
8607
8639
|
}] : [];
|
|
8608
|
-
})(), h = i ? (e.uploadedAttachments ?? []).filter((
|
|
8640
|
+
})(), h = i ? (e.uploadedAttachments ?? []).filter((C) => C.kind === "file") : [], p = u.length > 0, f = h.length > 0, v = l || p, k = !!e.progressEvents && e.progressEvents.length > 0, I = o && !e.content && !e.toolStatus && !k, g = !i && !s, N = !!e.isHuman && !i, j = i ? "ak-message--user" : s ? "ak-message--assistant ak-message--error" : N ? "ak-message--assistant ak-message--operator" : "ak-message--assistant", P = [
|
|
8609
8641
|
"ak-message__bubble",
|
|
8610
|
-
|
|
8611
|
-
|
|
8612
|
-
|
|
8613
|
-
].filter(Boolean).join(" "),
|
|
8614
|
-
className:
|
|
8642
|
+
g ? "ak-message__bubble--md" : "",
|
|
8643
|
+
v ? "ak-message__bubble--has-image" : "",
|
|
8644
|
+
N ? "ak-message__bubble--operator" : ""
|
|
8645
|
+
].filter(Boolean).join(" "), B = N ? e.senderDisplay?.trim() || "Operator" : null, D = B ? B.charAt(0).toUpperCase() : "", ae = /* @__PURE__ */ y(ve, { children: [/* @__PURE__ */ y("div", {
|
|
8646
|
+
className: P,
|
|
8615
8647
|
children: [
|
|
8616
8648
|
p && /* @__PURE__ */ d(br, {
|
|
8617
8649
|
messageId: `${e.id}-up`,
|
|
8618
|
-
images: u.map((
|
|
8619
|
-
src:
|
|
8620
|
-
alt:
|
|
8621
|
-
downloadHref:
|
|
8650
|
+
images: u.map((C) => ({
|
|
8651
|
+
src: C.url,
|
|
8652
|
+
alt: C.fileName ?? "Uploaded image",
|
|
8653
|
+
downloadHref: C.url
|
|
8622
8654
|
})),
|
|
8623
|
-
onCellClick: (
|
|
8655
|
+
onCellClick: (C) => r(C)
|
|
8624
8656
|
}),
|
|
8625
8657
|
f && /* @__PURE__ */ d("div", {
|
|
8626
8658
|
className: "ak-message__files",
|
|
8627
|
-
children: h.map((
|
|
8628
|
-
url:
|
|
8629
|
-
mimeType:
|
|
8630
|
-
fileName:
|
|
8631
|
-
}, `${e.id}-up-file-${
|
|
8659
|
+
children: h.map((C, F) => /* @__PURE__ */ d(xr, {
|
|
8660
|
+
url: C.url,
|
|
8661
|
+
mimeType: C.mimeType,
|
|
8662
|
+
fileName: C.fileName
|
|
8663
|
+
}, `${e.id}-up-file-${F}`))
|
|
8632
8664
|
}),
|
|
8633
8665
|
l && /* @__PURE__ */ d(br, {
|
|
8634
8666
|
messageId: `${e.id}-asst`,
|
|
8635
|
-
images: e.images.map((
|
|
8636
|
-
const
|
|
8637
|
-
return
|
|
8638
|
-
src:
|
|
8667
|
+
images: e.images.map((C, F) => {
|
|
8668
|
+
const ce = C.url ?? (C.base64 ? `data:${C.mimeType};base64,${C.base64}` : null);
|
|
8669
|
+
return ce ? {
|
|
8670
|
+
src: ce,
|
|
8639
8671
|
alt: "Generated image",
|
|
8640
|
-
downloadHref:
|
|
8641
|
-
key: `gen-${
|
|
8672
|
+
downloadHref: C.url ?? ce,
|
|
8673
|
+
key: `gen-${F}`
|
|
8642
8674
|
} : null;
|
|
8643
|
-
}).filter((
|
|
8644
|
-
onCellClick: (
|
|
8675
|
+
}).filter((C) => C !== null),
|
|
8676
|
+
onCellClick: (C) => n(C)
|
|
8645
8677
|
}),
|
|
8646
8678
|
c && /* @__PURE__ */ d("div", {
|
|
8647
8679
|
className: "ak-message__files",
|
|
8648
|
-
children: e.documents.map((
|
|
8649
|
-
url:
|
|
8650
|
-
mimeType:
|
|
8651
|
-
fileName:
|
|
8652
|
-
}, `${e.id}-asst-doc-${
|
|
8680
|
+
children: e.documents.map((C, F) => C.url ? /* @__PURE__ */ d(xr, {
|
|
8681
|
+
url: C.url,
|
|
8682
|
+
mimeType: C.mimeType,
|
|
8683
|
+
fileName: C.fileName
|
|
8684
|
+
}, `${e.id}-asst-doc-${F}`) : null)
|
|
8653
8685
|
}),
|
|
8654
|
-
|
|
8655
|
-
className:
|
|
8656
|
-
children: [
|
|
8686
|
+
e.content && /* @__PURE__ */ y("div", {
|
|
8687
|
+
className: v ? "ak-message__image-caption" : void 0,
|
|
8688
|
+
children: [g ? Hs(e.content) : e.content, o && /* @__PURE__ */ y("span", {
|
|
8657
8689
|
className: "ak-cursor",
|
|
8658
8690
|
"aria-hidden": "true",
|
|
8659
8691
|
children: [
|
|
@@ -8667,9 +8699,9 @@ function Ys({ message: e }) {
|
|
|
8667
8699
|
}), /* @__PURE__ */ d("span", {
|
|
8668
8700
|
className: "ak-message__time",
|
|
8669
8701
|
children: Gs(e.createdAt)
|
|
8670
|
-
})] }),
|
|
8702
|
+
})] }), T = !!e.content || v || f || c || !o && !e.toolStatus;
|
|
8671
8703
|
return /* @__PURE__ */ y("div", {
|
|
8672
|
-
className: `ak-message ${
|
|
8704
|
+
className: `ak-message ${j}`,
|
|
8673
8705
|
children: [
|
|
8674
8706
|
!i && (e.ackText || e.progressEvents && e.progressEvents.length > 0 || e.turnMeta) && /* @__PURE__ */ d(Ds, {
|
|
8675
8707
|
ackText: e.ackText,
|
|
@@ -8678,38 +8710,48 @@ function Ys({ message: e }) {
|
|
|
8678
8710
|
isComplete: !o,
|
|
8679
8711
|
turnMeta: e.turnMeta
|
|
8680
8712
|
}),
|
|
8713
|
+
I && /* @__PURE__ */ y("div", {
|
|
8714
|
+
className: "ak-typing-row",
|
|
8715
|
+
role: "status",
|
|
8716
|
+
"aria-label": "Assistant is typing",
|
|
8717
|
+
children: [
|
|
8718
|
+
/* @__PURE__ */ d("span", { className: "ak-typing-row__dot" }),
|
|
8719
|
+
/* @__PURE__ */ d("span", { className: "ak-typing-row__dot" }),
|
|
8720
|
+
/* @__PURE__ */ d("span", { className: "ak-typing-row__dot" })
|
|
8721
|
+
]
|
|
8722
|
+
}),
|
|
8681
8723
|
!i && e.toolStatus && !(e.progressEvents && e.progressEvents.length > 0) && /* @__PURE__ */ d(Bs, { status: e.toolStatus }),
|
|
8682
|
-
|
|
8724
|
+
N && /* @__PURE__ */ y("span", {
|
|
8683
8725
|
className: "ak-message__sender-label",
|
|
8684
8726
|
children: [/* @__PURE__ */ d("span", {
|
|
8685
8727
|
className: "ak-message__operator-avatar",
|
|
8686
8728
|
"aria-hidden": "true",
|
|
8687
|
-
children:
|
|
8729
|
+
children: D
|
|
8688
8730
|
}), /* @__PURE__ */ d("span", {
|
|
8689
8731
|
className: "ak-message__operator-name",
|
|
8690
|
-
children:
|
|
8732
|
+
children: B
|
|
8691
8733
|
})]
|
|
8692
8734
|
}),
|
|
8693
|
-
|
|
8735
|
+
T && ae,
|
|
8694
8736
|
u.length > 0 && /* @__PURE__ */ d(_r, {
|
|
8695
|
-
images: u.map((
|
|
8696
|
-
src:
|
|
8697
|
-
alt:
|
|
8698
|
-
downloadHref:
|
|
8737
|
+
images: u.map((C) => ({
|
|
8738
|
+
src: C.url,
|
|
8739
|
+
alt: C.fileName ?? "Uploaded image",
|
|
8740
|
+
downloadHref: C.url
|
|
8699
8741
|
})),
|
|
8700
8742
|
index: t,
|
|
8701
8743
|
onClose: () => r(null),
|
|
8702
8744
|
onIndexChange: r
|
|
8703
8745
|
}),
|
|
8704
8746
|
l && /* @__PURE__ */ d(_r, {
|
|
8705
|
-
images: e.images.map((
|
|
8706
|
-
const
|
|
8707
|
-
return
|
|
8708
|
-
src:
|
|
8747
|
+
images: e.images.map((C) => {
|
|
8748
|
+
const F = C.url ?? (C.base64 ? `data:${C.mimeType};base64,${C.base64}` : null);
|
|
8749
|
+
return F ? {
|
|
8750
|
+
src: F,
|
|
8709
8751
|
alt: "Generated image",
|
|
8710
|
-
downloadHref:
|
|
8752
|
+
downloadHref: C.url ?? F
|
|
8711
8753
|
} : null;
|
|
8712
|
-
}).filter((
|
|
8754
|
+
}).filter((C) => C !== null),
|
|
8713
8755
|
index: a,
|
|
8714
8756
|
onClose: () => n(null),
|
|
8715
8757
|
onIndexChange: n
|
|
@@ -8748,8 +8790,8 @@ function Js(e, t) {
|
|
|
8748
8790
|
return r;
|
|
8749
8791
|
}
|
|
8750
8792
|
function Qs({ messages: e, isLoading: t, operatorFallbackLabel: r = "Operator" }) {
|
|
8751
|
-
const a =
|
|
8752
|
-
return
|
|
8793
|
+
const a = he(null), n = he(null), i = he(!0), s = Mr(() => Js(e, r), [e, r]);
|
|
8794
|
+
return X(() => {
|
|
8753
8795
|
if (!(a.current?.parentElement ?? a.current)) return;
|
|
8754
8796
|
const o = (u) => {
|
|
8755
8797
|
i.current = u.scrollHeight - u.scrollTop - u.clientHeight < 120;
|
|
@@ -8759,9 +8801,9 @@ function Qs({ messages: e, isLoading: t, operatorFallbackLabel: r = "Operator" }
|
|
|
8759
8801
|
if (!l) return;
|
|
8760
8802
|
const c = () => o(l);
|
|
8761
8803
|
return l.addEventListener("scroll", c, { passive: !0 }), () => l.removeEventListener("scroll", c);
|
|
8762
|
-
}, []),
|
|
8804
|
+
}, []), X(() => {
|
|
8763
8805
|
e[e.length - 1]?.role === "user" && (i.current = !0), i.current && n.current?.scrollIntoView({ behavior: "smooth" });
|
|
8764
|
-
}, [e]),
|
|
8806
|
+
}, [e]), X(() => {
|
|
8765
8807
|
i.current && n.current?.scrollIntoView({ behavior: "smooth" });
|
|
8766
8808
|
}, [t, e.find((o) => o.status === "streaming")?.content ?? ""]), /* @__PURE__ */ y("div", {
|
|
8767
8809
|
ref: a,
|
|
@@ -8996,102 +9038,102 @@ function lo(e) {
|
|
|
8996
9038
|
return la.includes(e.type);
|
|
8997
9039
|
}
|
|
8998
9040
|
function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…", photoSendingEnabled: a = !1, fileUploadEnabled: n = !1, attachmentMaxCount: i = 5, attachmentMaxFileSizeMb: s = 1 }) {
|
|
8999
|
-
const [o, l] =
|
|
9000
|
-
|
|
9001
|
-
h.forEach((
|
|
9002
|
-
}, []),
|
|
9003
|
-
t ||
|
|
9041
|
+
const [o, l] = ne(""), [c, u] = ne([]), [h, p] = ne(/* @__PURE__ */ new Map()), [f, v] = ne(!1), k = he(null), I = he(null), g = he(null), N = he(null), j = he(null), P = a || n, B = Mr(() => s * 1024 * 1024, [s]);
|
|
9042
|
+
X(() => () => {
|
|
9043
|
+
h.forEach((M) => URL.revokeObjectURL(M));
|
|
9044
|
+
}, []), X(() => {
|
|
9045
|
+
t || k.current?.focus();
|
|
9004
9046
|
}, [t]);
|
|
9005
|
-
const
|
|
9047
|
+
const D = pa((M) => {
|
|
9006
9048
|
if (!f) return;
|
|
9007
|
-
const O =
|
|
9008
|
-
!
|
|
9049
|
+
const O = M.composedPath ? M.composedPath() : [], K = !!N.current && O.includes(N.current), $ = !!j.current && O.includes(j.current);
|
|
9050
|
+
!K && !$ && v(!1);
|
|
9009
9051
|
}, [f]);
|
|
9010
|
-
|
|
9052
|
+
X(() => {
|
|
9011
9053
|
if (f)
|
|
9012
|
-
return document.addEventListener("click",
|
|
9013
|
-
}, [f,
|
|
9014
|
-
|
|
9015
|
-
}, [
|
|
9016
|
-
function
|
|
9017
|
-
h.forEach((
|
|
9018
|
-
}
|
|
9019
|
-
function
|
|
9054
|
+
return document.addEventListener("click", D), () => document.removeEventListener("click", D);
|
|
9055
|
+
}, [f, D]), X(() => {
|
|
9056
|
+
P || v(!1);
|
|
9057
|
+
}, [P]);
|
|
9058
|
+
function ae() {
|
|
9059
|
+
h.forEach((M) => URL.revokeObjectURL(M)), p(/* @__PURE__ */ new Map()), u([]), I.current && (I.current.value = ""), g.current && (g.current.value = "");
|
|
9060
|
+
}
|
|
9061
|
+
function T(M) {
|
|
9020
9062
|
u((O) => {
|
|
9021
|
-
const
|
|
9022
|
-
if (
|
|
9023
|
-
const
|
|
9024
|
-
|
|
9025
|
-
const
|
|
9026
|
-
return
|
|
9063
|
+
const K = O[M];
|
|
9064
|
+
if (K) {
|
|
9065
|
+
const $ = h.get(K.file);
|
|
9066
|
+
$ && (URL.revokeObjectURL($), p((G) => {
|
|
9067
|
+
const Ae = new Map(G);
|
|
9068
|
+
return Ae.delete(K.file), Ae;
|
|
9027
9069
|
}));
|
|
9028
9070
|
}
|
|
9029
|
-
return O.filter((
|
|
9071
|
+
return O.filter(($, G) => G !== M);
|
|
9030
9072
|
});
|
|
9031
9073
|
}
|
|
9032
|
-
function
|
|
9033
|
-
const
|
|
9034
|
-
!
|
|
9074
|
+
function C() {
|
|
9075
|
+
const M = o.trim();
|
|
9076
|
+
!M && c.length === 0 || t || (e(M, c), l(""), ae(), k.current && (k.current.style.height = "auto"));
|
|
9035
9077
|
}
|
|
9036
|
-
function
|
|
9037
|
-
|
|
9078
|
+
function F(M) {
|
|
9079
|
+
M.key === "Enter" && !M.shiftKey && (M.preventDefault(), C());
|
|
9038
9080
|
}
|
|
9039
|
-
function
|
|
9040
|
-
const O =
|
|
9081
|
+
function ce(M) {
|
|
9082
|
+
const O = M.currentTarget;
|
|
9041
9083
|
l(O.value), O.style.height = "auto", O.style.height = `${O.scrollHeight}px`;
|
|
9042
9084
|
}
|
|
9043
|
-
function
|
|
9044
|
-
if (
|
|
9045
|
-
const
|
|
9046
|
-
for (const
|
|
9047
|
-
if (O === "image" && !lo(
|
|
9048
|
-
|
|
9085
|
+
function Te(M, O) {
|
|
9086
|
+
if (M.length === 0) return;
|
|
9087
|
+
const K = [], $ = [];
|
|
9088
|
+
for (const G of M) {
|
|
9089
|
+
if (O === "image" && !lo(G)) {
|
|
9090
|
+
$.push(`${G.name} (image type not supported)`);
|
|
9049
9091
|
continue;
|
|
9050
9092
|
}
|
|
9051
|
-
if (O === "file" && !oo(
|
|
9052
|
-
|
|
9093
|
+
if (O === "file" && !oo(G)) {
|
|
9094
|
+
$.push(`${G.name} (file type not supported)`);
|
|
9053
9095
|
continue;
|
|
9054
9096
|
}
|
|
9055
|
-
if (
|
|
9056
|
-
|
|
9097
|
+
if (G.size > B) {
|
|
9098
|
+
$.push(`${G.name} (over ${s} MB)`);
|
|
9057
9099
|
continue;
|
|
9058
9100
|
}
|
|
9059
|
-
|
|
9060
|
-
file:
|
|
9101
|
+
K.push({
|
|
9102
|
+
file: G,
|
|
9061
9103
|
kind: O
|
|
9062
9104
|
});
|
|
9063
9105
|
}
|
|
9064
|
-
u((
|
|
9065
|
-
const
|
|
9066
|
-
return
|
|
9106
|
+
u((G) => {
|
|
9107
|
+
const Ae = [...G, ...K], Kt = Ae.slice(0, i);
|
|
9108
|
+
return Ae.length > i && $.push(`max ${i} attachments allowed`), p((ha) => {
|
|
9067
9109
|
const mt = new Map(ha);
|
|
9068
9110
|
for (const Be of Kt) Be.kind === "image" && !mt.has(Be.file) && mt.set(Be.file, URL.createObjectURL(Be.file));
|
|
9069
9111
|
return mt;
|
|
9070
9112
|
}), Kt;
|
|
9071
|
-
}),
|
|
9072
|
-
• ${
|
|
9113
|
+
}), $.length > 0 && alert(`Some attachments were not added:
|
|
9114
|
+
• ${$.join(`
|
|
9073
9115
|
• `)}`);
|
|
9074
9116
|
}
|
|
9075
|
-
function Ue(
|
|
9076
|
-
const O = Array.from(
|
|
9077
|
-
|
|
9117
|
+
function Ue(M) {
|
|
9118
|
+
const O = Array.from(M.currentTarget.files ?? []);
|
|
9119
|
+
M.currentTarget.value = "", Te(O, "image");
|
|
9078
9120
|
}
|
|
9079
|
-
function pt(
|
|
9080
|
-
const O = Array.from(
|
|
9081
|
-
|
|
9121
|
+
function pt(M) {
|
|
9122
|
+
const O = Array.from(M.currentTarget.files ?? []);
|
|
9123
|
+
M.currentTarget.value = "", Te(O, "file");
|
|
9082
9124
|
}
|
|
9083
9125
|
function ca() {
|
|
9084
|
-
|
|
9126
|
+
v(!1), I.current?.click();
|
|
9085
9127
|
}
|
|
9086
9128
|
function da() {
|
|
9087
|
-
|
|
9129
|
+
v(!1), g.current?.click();
|
|
9088
9130
|
}
|
|
9089
9131
|
const ua = !t && (!!o.trim() || c.length > 0);
|
|
9090
9132
|
return /* @__PURE__ */ y("div", {
|
|
9091
9133
|
className: "ak-composer",
|
|
9092
9134
|
children: [
|
|
9093
|
-
|
|
9094
|
-
ref:
|
|
9135
|
+
P && f && /* @__PURE__ */ y("div", {
|
|
9136
|
+
ref: N,
|
|
9095
9137
|
className: "ak-composer__attach-menu",
|
|
9096
9138
|
role: "menu",
|
|
9097
9139
|
children: [a && /* @__PURE__ */ y("button", {
|
|
@@ -9113,26 +9155,26 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
|
|
|
9113
9155
|
c.length > 0 && /* @__PURE__ */ d("div", {
|
|
9114
9156
|
className: "ak-composer__attachments",
|
|
9115
9157
|
role: "list",
|
|
9116
|
-
children: c.map((
|
|
9117
|
-
const
|
|
9118
|
-
if (
|
|
9119
|
-
const
|
|
9158
|
+
children: c.map((M, O) => {
|
|
9159
|
+
const K = `${M.file.name}-${O}`;
|
|
9160
|
+
if (M.kind === "image") {
|
|
9161
|
+
const $ = h.get(M.file);
|
|
9120
9162
|
return /* @__PURE__ */ y("div", {
|
|
9121
9163
|
className: "ak-composer__preview-wrap",
|
|
9122
9164
|
role: "listitem",
|
|
9123
|
-
children: [
|
|
9124
|
-
src:
|
|
9125
|
-
alt:
|
|
9165
|
+
children: [$ && /* @__PURE__ */ d("img", {
|
|
9166
|
+
src: $,
|
|
9167
|
+
alt: M.file.name,
|
|
9126
9168
|
className: "ak-composer__preview-img"
|
|
9127
9169
|
}), /* @__PURE__ */ d("button", {
|
|
9128
9170
|
className: "ak-composer__preview-remove",
|
|
9129
|
-
onClick: () =>
|
|
9171
|
+
onClick: () => T(O),
|
|
9130
9172
|
type: "button",
|
|
9131
|
-
"aria-label": `Remove ${
|
|
9173
|
+
"aria-label": `Remove ${M.file.name}`,
|
|
9132
9174
|
disabled: t,
|
|
9133
9175
|
children: /* @__PURE__ */ d(Cr, {})
|
|
9134
9176
|
})]
|
|
9135
|
-
},
|
|
9177
|
+
}, K);
|
|
9136
9178
|
}
|
|
9137
9179
|
return /* @__PURE__ */ y("span", {
|
|
9138
9180
|
className: "ak-composer__file-chip",
|
|
@@ -9141,27 +9183,27 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
|
|
|
9141
9183
|
/* @__PURE__ */ d(Sr, {}),
|
|
9142
9184
|
/* @__PURE__ */ d("span", {
|
|
9143
9185
|
className: "ak-composer__file-chip-name",
|
|
9144
|
-
title:
|
|
9145
|
-
children:
|
|
9186
|
+
title: M.file.name,
|
|
9187
|
+
children: M.file.name
|
|
9146
9188
|
}),
|
|
9147
9189
|
/* @__PURE__ */ d("button", {
|
|
9148
9190
|
className: "ak-composer__file-chip-remove",
|
|
9149
|
-
onClick: () =>
|
|
9191
|
+
onClick: () => T(O),
|
|
9150
9192
|
type: "button",
|
|
9151
|
-
"aria-label": `Remove ${
|
|
9193
|
+
"aria-label": `Remove ${M.file.name}`,
|
|
9152
9194
|
disabled: t,
|
|
9153
9195
|
children: /* @__PURE__ */ d(Cr, {})
|
|
9154
9196
|
})
|
|
9155
9197
|
]
|
|
9156
|
-
},
|
|
9198
|
+
}, K);
|
|
9157
9199
|
})
|
|
9158
9200
|
}),
|
|
9159
9201
|
/* @__PURE__ */ y("div", {
|
|
9160
9202
|
className: "ak-composer__input-wrap",
|
|
9161
9203
|
children: [
|
|
9162
|
-
|
|
9204
|
+
P && /* @__PURE__ */ y(ve, { children: [
|
|
9163
9205
|
a && /* @__PURE__ */ d("input", {
|
|
9164
|
-
ref:
|
|
9206
|
+
ref: I,
|
|
9165
9207
|
type: "file",
|
|
9166
9208
|
multiple: !0,
|
|
9167
9209
|
accept: so,
|
|
@@ -9185,7 +9227,7 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
|
|
|
9185
9227
|
children: /* @__PURE__ */ d("button", {
|
|
9186
9228
|
ref: j,
|
|
9187
9229
|
className: `ak-composer__attach${f ? " ak-composer__attach--open" : ""}`,
|
|
9188
|
-
onClick: () =>
|
|
9230
|
+
onClick: () => v((M) => !M),
|
|
9189
9231
|
disabled: t,
|
|
9190
9232
|
"aria-label": "Attachment options",
|
|
9191
9233
|
"aria-haspopup": "true",
|
|
@@ -9196,11 +9238,11 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
|
|
|
9196
9238
|
})
|
|
9197
9239
|
] }),
|
|
9198
9240
|
/* @__PURE__ */ d("textarea", {
|
|
9199
|
-
ref:
|
|
9241
|
+
ref: k,
|
|
9200
9242
|
className: "ak-composer__input",
|
|
9201
9243
|
value: o,
|
|
9202
|
-
onInput:
|
|
9203
|
-
onKeyDown:
|
|
9244
|
+
onInput: ce,
|
|
9245
|
+
onKeyDown: F,
|
|
9204
9246
|
placeholder: r,
|
|
9205
9247
|
disabled: t,
|
|
9206
9248
|
rows: 1,
|
|
@@ -9208,7 +9250,7 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
|
|
|
9208
9250
|
}),
|
|
9209
9251
|
/* @__PURE__ */ d("button", {
|
|
9210
9252
|
className: "ak-composer__send",
|
|
9211
|
-
onClick:
|
|
9253
|
+
onClick: C,
|
|
9212
9254
|
disabled: !ua,
|
|
9213
9255
|
"aria-label": "Send message",
|
|
9214
9256
|
type: "button",
|
|
@@ -9384,7 +9426,7 @@ function Nr({ config: e, messages: t, isLoading: r, error: a, isInline: n, initS
|
|
|
9384
9426
|
className: "ak-init-status ak-init-status--maintenance",
|
|
9385
9427
|
children: /* @__PURE__ */ d(ho, {})
|
|
9386
9428
|
}),
|
|
9387
|
-
i === "ready" && /* @__PURE__ */ y(
|
|
9429
|
+
i === "ready" && /* @__PURE__ */ y(ve, { children: [
|
|
9388
9430
|
t.length === 0 ? /* @__PURE__ */ d(qs, {
|
|
9389
9431
|
title: e.title,
|
|
9390
9432
|
description: e.description ?? e.subtitle,
|
|
@@ -9453,13 +9495,13 @@ function vo({ isOpen: e, onClick: t, avatarUrl: r, ariaLabel: a = "Toggle chat"
|
|
|
9453
9495
|
});
|
|
9454
9496
|
}
|
|
9455
9497
|
function Er({ config: e, state: t, callbacks: r }) {
|
|
9456
|
-
const a = e.mode === "inline", n =
|
|
9457
|
-
return
|
|
9498
|
+
const a = e.mode === "inline", n = he(null);
|
|
9499
|
+
return X(() => {
|
|
9458
9500
|
const i = n.current?.getRootNode()?.host;
|
|
9459
9501
|
if (!i) return;
|
|
9460
9502
|
const s = js(e.theme.mode);
|
|
9461
9503
|
i.setAttribute("data-theme", s);
|
|
9462
|
-
}, [e.theme.mode]),
|
|
9504
|
+
}, [e.theme.mode]), X(() => {
|
|
9463
9505
|
if (a) return;
|
|
9464
9506
|
const i = n.current?.getRootNode()?.host;
|
|
9465
9507
|
i && (t.isOpen ? i.setAttribute("data-open", "") : i.removeAttribute("data-open"));
|
|
@@ -9521,7 +9563,7 @@ function ko(e) {
|
|
|
9521
9563
|
` + Rs(e);
|
|
9522
9564
|
}
|
|
9523
9565
|
function Qt(e, t) {
|
|
9524
|
-
return ko(
|
|
9566
|
+
return ko(Ve({
|
|
9525
9567
|
...e,
|
|
9526
9568
|
mode: t
|
|
9527
9569
|
}));
|
|
@@ -9565,7 +9607,7 @@ export {
|
|
|
9565
9607
|
Qo as listWidgets,
|
|
9566
9608
|
qo as mount,
|
|
9567
9609
|
el as mountFloating,
|
|
9568
|
-
|
|
9610
|
+
Ve as normalizeConfig,
|
|
9569
9611
|
Cs as prepareInlineContainer,
|
|
9570
9612
|
xs as removeShadowHost,
|
|
9571
9613
|
Jt as renderWidget,
|