@bymos/agentkit-sdk 0.7.1 → 0.7.2
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 +41 -28
- package/agentkit-widget.js +1220 -1191
- package/index.cjs +41 -28
- package/index.js +1029 -1000
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRoot as fa } from "preact/compat/client";
|
|
2
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
|
|
3
|
+
import { Fragment as ye, jsx as c, jsxs as y } from "preact/jsx-runtime";
|
|
4
4
|
var A;
|
|
5
5
|
(function(e) {
|
|
6
6
|
e.assertEqual = (n) => {
|
|
@@ -123,8 +123,8 @@ var _ = A.arrayToEnum([
|
|
|
123
123
|
else {
|
|
124
124
|
let o = a, l = 0;
|
|
125
125
|
for (; l < s.path.length; ) {
|
|
126
|
-
const
|
|
127
|
-
l !== s.path.length - 1 ? o[
|
|
126
|
+
const d = s.path[l];
|
|
127
|
+
l !== s.path.length - 1 ? o[d] = o[d] || { _errors: [] } : (o[d] = o[d] || { _errors: [] }, o[d]._errors.push(r(s))), o = o[d], l++;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
};
|
|
@@ -228,8 +228,8 @@ var xt = (e) => {
|
|
|
228
228
|
message: n.message
|
|
229
229
|
};
|
|
230
230
|
let o = "";
|
|
231
|
-
const l = a.filter((
|
|
232
|
-
for (const
|
|
231
|
+
const l = a.filter((d) => !!d).slice().reverse();
|
|
232
|
+
for (const d of l) o = d(s, {
|
|
233
233
|
data: t,
|
|
234
234
|
defaultError: o
|
|
235
235
|
}).message;
|
|
@@ -266,7 +266,7 @@ var J = 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 C;
|
|
270
270
|
n.status === "dirty" && t.dirty(), a.push(n.value);
|
|
271
271
|
}
|
|
272
272
|
return {
|
|
@@ -289,7 +289,7 @@ var J = 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 C;
|
|
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,10 +297,10 @@ var J = class Tr {
|
|
|
297
297
|
value: a
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
|
-
},
|
|
300
|
+
}, C = Object.freeze({ status: "aborted" }), je = (e) => ({
|
|
301
301
|
status: "dirty",
|
|
302
302
|
value: e
|
|
303
|
-
}),
|
|
303
|
+
}), B = (e) => ({
|
|
304
304
|
status: "valid",
|
|
305
305
|
value: e
|
|
306
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;
|
|
@@ -478,7 +478,7 @@ var L = class {
|
|
|
478
478
|
_refinement(e) {
|
|
479
479
|
return new pe({
|
|
480
480
|
schema: this,
|
|
481
|
-
typeName:
|
|
481
|
+
typeName: I.ZodEffects,
|
|
482
482
|
effect: {
|
|
483
483
|
type: "refinement",
|
|
484
484
|
refinement: e
|
|
@@ -520,7 +520,7 @@ var L = class {
|
|
|
520
520
|
return new pe({
|
|
521
521
|
...E(this._def),
|
|
522
522
|
schema: this,
|
|
523
|
-
typeName:
|
|
523
|
+
typeName: I.ZodEffects,
|
|
524
524
|
effect: {
|
|
525
525
|
type: "transform",
|
|
526
526
|
transform: e
|
|
@@ -533,12 +533,12 @@ var L = class {
|
|
|
533
533
|
...E(this._def),
|
|
534
534
|
innerType: this,
|
|
535
535
|
defaultValue: t,
|
|
536
|
-
typeName:
|
|
536
|
+
typeName: I.ZodDefault
|
|
537
537
|
});
|
|
538
538
|
}
|
|
539
539
|
brand() {
|
|
540
540
|
return new Pr({
|
|
541
|
-
typeName:
|
|
541
|
+
typeName: I.ZodBranded,
|
|
542
542
|
type: this,
|
|
543
543
|
...E(this._def)
|
|
544
544
|
});
|
|
@@ -549,7 +549,7 @@ var L = class {
|
|
|
549
549
|
...E(this._def),
|
|
550
550
|
innerType: this,
|
|
551
551
|
catchValue: t,
|
|
552
|
-
typeName:
|
|
552
|
+
typeName: I.ZodCatch
|
|
553
553
|
});
|
|
554
554
|
}
|
|
555
555
|
describe(e) {
|
|
@@ -611,7 +611,7 @@ var qe = class Ze extends L {
|
|
|
611
611
|
code: m.invalid_type,
|
|
612
612
|
expected: _.string,
|
|
613
613
|
received: n.parsedType
|
|
614
|
-
}),
|
|
614
|
+
}), C;
|
|
615
615
|
}
|
|
616
616
|
const r = new J();
|
|
617
617
|
let a;
|
|
@@ -1023,7 +1023,7 @@ var qe = class Ze extends L {
|
|
|
1023
1023
|
};
|
|
1024
1024
|
qe.create = (e) => new qe({
|
|
1025
1025
|
checks: [],
|
|
1026
|
-
typeName:
|
|
1026
|
+
typeName: I.ZodString,
|
|
1027
1027
|
coerce: e?.coerce ?? !1,
|
|
1028
1028
|
...E(e)
|
|
1029
1029
|
});
|
|
@@ -1042,7 +1042,7 @@ var wt = class St extends L {
|
|
|
1042
1042
|
code: m.invalid_type,
|
|
1043
1043
|
expected: _.number,
|
|
1044
1044
|
received: n.parsedType
|
|
1045
|
-
}),
|
|
1045
|
+
}), C;
|
|
1046
1046
|
}
|
|
1047
1047
|
let r;
|
|
1048
1048
|
const a = new J();
|
|
@@ -1195,7 +1195,7 @@ var wt = class St extends L {
|
|
|
1195
1195
|
};
|
|
1196
1196
|
wt.create = (e) => new wt({
|
|
1197
1197
|
checks: [],
|
|
1198
|
-
typeName:
|
|
1198
|
+
typeName: I.ZodNumber,
|
|
1199
1199
|
coerce: e?.coerce || !1,
|
|
1200
1200
|
...E(e)
|
|
1201
1201
|
});
|
|
@@ -1240,7 +1240,7 @@ var Ct = class It extends L {
|
|
|
1240
1240
|
code: m.invalid_type,
|
|
1241
1241
|
expected: _.bigint,
|
|
1242
1242
|
received: r.parsedType
|
|
1243
|
-
}),
|
|
1243
|
+
}), C;
|
|
1244
1244
|
}
|
|
1245
1245
|
gte(t, r) {
|
|
1246
1246
|
return this.setLimit("min", t, !0, x.toString(r));
|
|
@@ -1323,7 +1323,7 @@ var Ct = class It extends L {
|
|
|
1323
1323
|
};
|
|
1324
1324
|
Ct.create = (e) => new Ct({
|
|
1325
1325
|
checks: [],
|
|
1326
|
-
typeName:
|
|
1326
|
+
typeName: I.ZodBigInt,
|
|
1327
1327
|
coerce: e?.coerce ?? !1,
|
|
1328
1328
|
...E(e)
|
|
1329
1329
|
});
|
|
@@ -1335,13 +1335,13 @@ var Nt = class extends L {
|
|
|
1335
1335
|
code: m.invalid_type,
|
|
1336
1336
|
expected: _.boolean,
|
|
1337
1337
|
received: t.parsedType
|
|
1338
|
-
}),
|
|
1338
|
+
}), C;
|
|
1339
1339
|
}
|
|
1340
|
-
return
|
|
1340
|
+
return B(e.data);
|
|
1341
1341
|
}
|
|
1342
1342
|
};
|
|
1343
1343
|
Nt.create = (e) => new Nt({
|
|
1344
|
-
typeName:
|
|
1344
|
+
typeName: I.ZodBoolean,
|
|
1345
1345
|
coerce: e?.coerce || !1,
|
|
1346
1346
|
...E(e)
|
|
1347
1347
|
});
|
|
@@ -1353,10 +1353,10 @@ var Et = class jr extends L {
|
|
|
1353
1353
|
code: m.invalid_type,
|
|
1354
1354
|
expected: _.date,
|
|
1355
1355
|
received: n.parsedType
|
|
1356
|
-
}),
|
|
1356
|
+
}), C;
|
|
1357
1357
|
}
|
|
1358
1358
|
if (Number.isNaN(t.data.getTime()))
|
|
1359
|
-
return b(this._getOrReturnCtx(t), { code: m.invalid_date }),
|
|
1359
|
+
return b(this._getOrReturnCtx(t), { code: m.invalid_date }), C;
|
|
1360
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, {
|
|
@@ -1413,7 +1413,7 @@ var Et = class jr extends L {
|
|
|
1413
1413
|
Et.create = (e) => new Et({
|
|
1414
1414
|
checks: [],
|
|
1415
1415
|
coerce: e?.coerce || !1,
|
|
1416
|
-
typeName:
|
|
1416
|
+
typeName: I.ZodDate,
|
|
1417
1417
|
...E(e)
|
|
1418
1418
|
});
|
|
1419
1419
|
var Mt = class extends L {
|
|
@@ -1424,13 +1424,13 @@ var Mt = class extends L {
|
|
|
1424
1424
|
code: m.invalid_type,
|
|
1425
1425
|
expected: _.symbol,
|
|
1426
1426
|
received: t.parsedType
|
|
1427
|
-
}),
|
|
1427
|
+
}), C;
|
|
1428
1428
|
}
|
|
1429
|
-
return
|
|
1429
|
+
return B(e.data);
|
|
1430
1430
|
}
|
|
1431
1431
|
};
|
|
1432
1432
|
Mt.create = (e) => new Mt({
|
|
1433
|
-
typeName:
|
|
1433
|
+
typeName: I.ZodSymbol,
|
|
1434
1434
|
...E(e)
|
|
1435
1435
|
});
|
|
1436
1436
|
var et = class extends L {
|
|
@@ -1441,13 +1441,13 @@ var et = class extends L {
|
|
|
1441
1441
|
code: m.invalid_type,
|
|
1442
1442
|
expected: _.undefined,
|
|
1443
1443
|
received: t.parsedType
|
|
1444
|
-
}),
|
|
1444
|
+
}), C;
|
|
1445
1445
|
}
|
|
1446
|
-
return
|
|
1446
|
+
return B(e.data);
|
|
1447
1447
|
}
|
|
1448
1448
|
};
|
|
1449
1449
|
et.create = (e) => new et({
|
|
1450
|
-
typeName:
|
|
1450
|
+
typeName: I.ZodUndefined,
|
|
1451
1451
|
...E(e)
|
|
1452
1452
|
});
|
|
1453
1453
|
var tt = class extends L {
|
|
@@ -1458,13 +1458,13 @@ var tt = class extends L {
|
|
|
1458
1458
|
code: m.invalid_type,
|
|
1459
1459
|
expected: _.null,
|
|
1460
1460
|
received: t.parsedType
|
|
1461
|
-
}),
|
|
1461
|
+
}), C;
|
|
1462
1462
|
}
|
|
1463
|
-
return
|
|
1463
|
+
return B(e.data);
|
|
1464
1464
|
}
|
|
1465
1465
|
};
|
|
1466
1466
|
tt.create = (e) => new tt({
|
|
1467
|
-
typeName:
|
|
1467
|
+
typeName: I.ZodNull,
|
|
1468
1468
|
...E(e)
|
|
1469
1469
|
});
|
|
1470
1470
|
var Lt = class extends L {
|
|
@@ -1472,11 +1472,11 @@ var Lt = class extends L {
|
|
|
1472
1472
|
super(...arguments), this._any = !0;
|
|
1473
1473
|
}
|
|
1474
1474
|
_parse(e) {
|
|
1475
|
-
return
|
|
1475
|
+
return B(e.data);
|
|
1476
1476
|
}
|
|
1477
1477
|
};
|
|
1478
1478
|
Lt.create = (e) => new Lt({
|
|
1479
|
-
typeName:
|
|
1479
|
+
typeName: I.ZodAny,
|
|
1480
1480
|
...E(e)
|
|
1481
1481
|
});
|
|
1482
1482
|
var Ne = class extends L {
|
|
@@ -1484,25 +1484,25 @@ var Ne = class extends L {
|
|
|
1484
1484
|
super(...arguments), this._unknown = !0;
|
|
1485
1485
|
}
|
|
1486
1486
|
_parse(e) {
|
|
1487
|
-
return
|
|
1487
|
+
return B(e.data);
|
|
1488
1488
|
}
|
|
1489
1489
|
};
|
|
1490
1490
|
Ne.create = (e) => new Ne({
|
|
1491
|
-
typeName:
|
|
1491
|
+
typeName: I.ZodUnknown,
|
|
1492
1492
|
...E(e)
|
|
1493
1493
|
});
|
|
1494
|
-
var
|
|
1494
|
+
var ve = 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
|
+
}), C;
|
|
1502
1502
|
}
|
|
1503
1503
|
};
|
|
1504
|
-
|
|
1505
|
-
typeName:
|
|
1504
|
+
ve.create = (e) => new ve({
|
|
1505
|
+
typeName: I.ZodNever,
|
|
1506
1506
|
...E(e)
|
|
1507
1507
|
});
|
|
1508
1508
|
var Tt = class extends L {
|
|
@@ -1513,13 +1513,13 @@ var Tt = class extends L {
|
|
|
1513
1513
|
code: m.invalid_type,
|
|
1514
1514
|
expected: _.void,
|
|
1515
1515
|
received: t.parsedType
|
|
1516
|
-
}),
|
|
1516
|
+
}), C;
|
|
1517
1517
|
}
|
|
1518
|
-
return
|
|
1518
|
+
return B(e.data);
|
|
1519
1519
|
}
|
|
1520
1520
|
};
|
|
1521
1521
|
Tt.create = (e) => new Tt({
|
|
1522
|
-
typeName:
|
|
1522
|
+
typeName: I.ZodVoid,
|
|
1523
1523
|
...E(e)
|
|
1524
1524
|
});
|
|
1525
1525
|
var Le = class Xe extends L {
|
|
@@ -1530,7 +1530,7 @@ var Le = class Xe extends L {
|
|
|
1530
1530
|
code: m.invalid_type,
|
|
1531
1531
|
expected: _.array,
|
|
1532
1532
|
received: r.parsedType
|
|
1533
|
-
}),
|
|
1533
|
+
}), C;
|
|
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, {
|
|
@@ -1600,7 +1600,7 @@ Le.create = (e, t) => new Le({
|
|
|
1600
1600
|
minLength: null,
|
|
1601
1601
|
maxLength: null,
|
|
1602
1602
|
exactLength: null,
|
|
1603
|
-
typeName:
|
|
1603
|
+
typeName: I.ZodArray,
|
|
1604
1604
|
...E(t)
|
|
1605
1605
|
});
|
|
1606
1606
|
function Ie(e) {
|
|
@@ -1638,33 +1638,33 @@ var te = class q extends L {
|
|
|
1638
1638
|
code: m.invalid_type,
|
|
1639
1639
|
expected: _.object,
|
|
1640
1640
|
received: l.parsedType
|
|
1641
|
-
}),
|
|
1641
|
+
}), C;
|
|
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 ve && 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) {
|
|
1648
|
-
const
|
|
1648
|
+
const d = n[l], h = a.data[l];
|
|
1649
1649
|
o.push({
|
|
1650
1650
|
key: {
|
|
1651
1651
|
status: "valid",
|
|
1652
1652
|
value: l
|
|
1653
1653
|
},
|
|
1654
|
-
value:
|
|
1654
|
+
value: d._parse(new se(a, h, 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 ve) {
|
|
1659
1659
|
const l = this._def.unknownKeys;
|
|
1660
|
-
if (l === "passthrough") for (const
|
|
1660
|
+
if (l === "passthrough") for (const d of s) o.push({
|
|
1661
1661
|
key: {
|
|
1662
1662
|
status: "valid",
|
|
1663
|
-
value:
|
|
1663
|
+
value: d
|
|
1664
1664
|
},
|
|
1665
1665
|
value: {
|
|
1666
1666
|
status: "valid",
|
|
1667
|
-
value: a.data[
|
|
1667
|
+
value: a.data[d]
|
|
1668
1668
|
}
|
|
1669
1669
|
});
|
|
1670
1670
|
else if (l === "strict")
|
|
@@ -1676,26 +1676,26 @@ var te = class q extends L {
|
|
|
1676
1676
|
throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1677
1677
|
} else {
|
|
1678
1678
|
const l = this._def.catchall;
|
|
1679
|
-
for (const
|
|
1680
|
-
const
|
|
1679
|
+
for (const d of s) {
|
|
1680
|
+
const h = a.data[d];
|
|
1681
1681
|
o.push({
|
|
1682
1682
|
key: {
|
|
1683
1683
|
status: "valid",
|
|
1684
|
-
value:
|
|
1684
|
+
value: d
|
|
1685
1685
|
},
|
|
1686
|
-
value: l._parse(new se(a,
|
|
1687
|
-
alwaysSet:
|
|
1686
|
+
value: l._parse(new se(a, h, a.path, d)),
|
|
1687
|
+
alwaysSet: d in a.data
|
|
1688
1688
|
});
|
|
1689
1689
|
}
|
|
1690
1690
|
}
|
|
1691
1691
|
return a.common.async ? Promise.resolve().then(async () => {
|
|
1692
1692
|
const l = [];
|
|
1693
|
-
for (const
|
|
1694
|
-
const
|
|
1693
|
+
for (const d of o) {
|
|
1694
|
+
const h = await d.key, u = await d.value;
|
|
1695
1695
|
l.push({
|
|
1696
|
-
key:
|
|
1697
|
-
value:
|
|
1698
|
-
alwaysSet:
|
|
1696
|
+
key: h,
|
|
1697
|
+
value: u,
|
|
1698
|
+
alwaysSet: d.alwaysSet
|
|
1699
1699
|
});
|
|
1700
1700
|
}
|
|
1701
1701
|
return l;
|
|
@@ -1743,7 +1743,7 @@ var te = class q extends L {
|
|
|
1743
1743
|
...this._def.shape(),
|
|
1744
1744
|
...t._def.shape()
|
|
1745
1745
|
}),
|
|
1746
|
-
typeName:
|
|
1746
|
+
typeName: I.ZodObject
|
|
1747
1747
|
});
|
|
1748
1748
|
}
|
|
1749
1749
|
setKey(t, r) {
|
|
@@ -1805,22 +1805,22 @@ var te = class q extends L {
|
|
|
1805
1805
|
te.create = (e, t) => new te({
|
|
1806
1806
|
shape: () => e,
|
|
1807
1807
|
unknownKeys: "strip",
|
|
1808
|
-
catchall:
|
|
1809
|
-
typeName:
|
|
1808
|
+
catchall: ve.create(),
|
|
1809
|
+
typeName: I.ZodObject,
|
|
1810
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:
|
|
1815
|
+
catchall: ve.create(),
|
|
1816
|
+
typeName: I.ZodObject,
|
|
1817
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:
|
|
1822
|
+
catchall: ve.create(),
|
|
1823
|
+
typeName: I.ZodObject,
|
|
1824
1824
|
...E(t)
|
|
1825
1825
|
});
|
|
1826
1826
|
var rt = class extends L {
|
|
@@ -1834,7 +1834,7 @@ var rt = class extends L {
|
|
|
1834
1834
|
return b(t, {
|
|
1835
1835
|
code: m.invalid_union,
|
|
1836
1836
|
unionErrors: i
|
|
1837
|
-
}),
|
|
1837
|
+
}), C;
|
|
1838
1838
|
}
|
|
1839
1839
|
if (t.common.async) return Promise.all(r.map(async (n) => {
|
|
1840
1840
|
const i = {
|
|
@@ -1865,14 +1865,14 @@ var rt = class extends L {
|
|
|
1865
1865
|
issues: []
|
|
1866
1866
|
},
|
|
1867
1867
|
parent: null
|
|
1868
|
-
},
|
|
1868
|
+
}, d = o._parseSync({
|
|
1869
1869
|
data: t.data,
|
|
1870
1870
|
path: t.path,
|
|
1871
1871
|
parent: l
|
|
1872
1872
|
});
|
|
1873
|
-
if (
|
|
1874
|
-
|
|
1875
|
-
result:
|
|
1873
|
+
if (d.status === "valid") return d;
|
|
1874
|
+
d.status === "dirty" && !n && (n = {
|
|
1875
|
+
result: d,
|
|
1876
1876
|
ctx: l
|
|
1877
1877
|
}), l.common.issues.length && i.push(l.common.issues);
|
|
1878
1878
|
}
|
|
@@ -1882,7 +1882,7 @@ var rt = class extends L {
|
|
|
1882
1882
|
return b(t, {
|
|
1883
1883
|
code: m.invalid_union,
|
|
1884
1884
|
unionErrors: s
|
|
1885
|
-
}),
|
|
1885
|
+
}), C;
|
|
1886
1886
|
}
|
|
1887
1887
|
}
|
|
1888
1888
|
get options() {
|
|
@@ -1891,7 +1891,7 @@ var rt = class extends L {
|
|
|
1891
1891
|
};
|
|
1892
1892
|
rt.create = (e, t) => new rt({
|
|
1893
1893
|
options: e,
|
|
1894
|
-
typeName:
|
|
1894
|
+
typeName: I.ZodUnion,
|
|
1895
1895
|
...E(t)
|
|
1896
1896
|
});
|
|
1897
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 {
|
|
@@ -1902,7 +1902,7 @@ var de = (e) => e instanceof nt ? de(e.schema) : e instanceof pe ? de(e.innerTyp
|
|
|
1902
1902
|
code: m.invalid_type,
|
|
1903
1903
|
expected: _.object,
|
|
1904
1904
|
received: r.parsedType
|
|
1905
|
-
}),
|
|
1905
|
+
}), C;
|
|
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 de = (e) => e instanceof nt ? de(e.schema) : e instanceof pe ? de(e.innerTyp
|
|
|
1916
1916
|
code: m.invalid_union_discriminator,
|
|
1917
1917
|
options: Array.from(this.optionsMap.keys()),
|
|
1918
1918
|
path: [a]
|
|
1919
|
-
}),
|
|
1919
|
+
}), C);
|
|
1920
1920
|
}
|
|
1921
1921
|
get discriminator() {
|
|
1922
1922
|
return this._def.discriminator;
|
|
@@ -1938,7 +1938,7 @@ var de = (e) => e instanceof nt ? de(e.schema) : e instanceof pe ? de(e.innerTyp
|
|
|
1938
1938
|
}
|
|
1939
1939
|
}
|
|
1940
1940
|
return new Zr({
|
|
1941
|
-
typeName:
|
|
1941
|
+
typeName: I.ZodDiscriminatedUnion,
|
|
1942
1942
|
discriminator: t,
|
|
1943
1943
|
options: r,
|
|
1944
1944
|
optionsMap: n,
|
|
@@ -1986,12 +1986,12 @@ function At(e, t) {
|
|
|
1986
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 C;
|
|
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 }), C);
|
|
1995
1995
|
};
|
|
1996
1996
|
return r.common.async ? Promise.all([this._def.left._parseAsync({
|
|
1997
1997
|
data: r.data,
|
|
@@ -2015,7 +2015,7 @@ var at = class extends L {
|
|
|
2015
2015
|
at.create = (e, t, r) => new at({
|
|
2016
2016
|
left: e,
|
|
2017
2017
|
right: t,
|
|
2018
|
-
typeName:
|
|
2018
|
+
typeName: I.ZodIntersection,
|
|
2019
2019
|
...E(r)
|
|
2020
2020
|
});
|
|
2021
2021
|
var be = class Or extends L {
|
|
@@ -2026,7 +2026,7 @@ var be = class Or extends L {
|
|
|
2026
2026
|
code: m.invalid_type,
|
|
2027
2027
|
expected: _.array,
|
|
2028
2028
|
received: a.parsedType
|
|
2029
|
-
}),
|
|
2029
|
+
}), C;
|
|
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 be = class Or extends L {
|
|
|
2034
2034
|
inclusive: !0,
|
|
2035
2035
|
exact: !1,
|
|
2036
2036
|
type: "array"
|
|
2037
|
-
}),
|
|
2037
|
+
}), C;
|
|
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,
|
|
@@ -2062,7 +2062,7 @@ be.create = (e, t) => {
|
|
|
2062
2062
|
if (!Array.isArray(e)) throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2063
2063
|
return new be({
|
|
2064
2064
|
items: e,
|
|
2065
|
-
typeName:
|
|
2065
|
+
typeName: I.ZodTuple,
|
|
2066
2066
|
rest: null,
|
|
2067
2067
|
...E(t)
|
|
2068
2068
|
});
|
|
@@ -2081,7 +2081,7 @@ var $a = class Rt extends L {
|
|
|
2081
2081
|
code: m.invalid_type,
|
|
2082
2082
|
expected: _.object,
|
|
2083
2083
|
received: a.parsedType
|
|
2084
|
-
}),
|
|
2084
|
+
}), C;
|
|
2085
2085
|
const n = [], i = this._def.keyType, s = this._def.valueType;
|
|
2086
2086
|
for (const o in a.data) n.push({
|
|
2087
2087
|
key: i._parse(new se(a, o, a.path, o)),
|
|
@@ -2097,12 +2097,12 @@ var $a = class Rt extends L {
|
|
|
2097
2097
|
return r instanceof L ? new Rt({
|
|
2098
2098
|
keyType: t,
|
|
2099
2099
|
valueType: r,
|
|
2100
|
-
typeName:
|
|
2100
|
+
typeName: I.ZodRecord,
|
|
2101
2101
|
...E(a)
|
|
2102
2102
|
}) : new Rt({
|
|
2103
2103
|
keyType: qe.create(),
|
|
2104
2104
|
valueType: t,
|
|
2105
|
-
typeName:
|
|
2105
|
+
typeName: I.ZodRecord,
|
|
2106
2106
|
...E(r)
|
|
2107
2107
|
});
|
|
2108
2108
|
}
|
|
@@ -2120,7 +2120,7 @@ var $a = class Rt extends L {
|
|
|
2120
2120
|
code: m.invalid_type,
|
|
2121
2121
|
expected: _.map,
|
|
2122
2122
|
received: r.parsedType
|
|
2123
|
-
}),
|
|
2123
|
+
}), C;
|
|
2124
2124
|
const a = this._def.keyType, n = this._def.valueType, i = [...r.data.entries()].map(([s, o], l) => ({
|
|
2125
2125
|
key: a._parse(new se(r, s, r.path, [l, "key"])),
|
|
2126
2126
|
value: n._parse(new se(r, o, r.path, [l, "value"]))
|
|
@@ -2129,9 +2129,9 @@ var $a = class Rt extends L {
|
|
|
2129
2129
|
const s = /* @__PURE__ */ new Map();
|
|
2130
2130
|
return Promise.resolve().then(async () => {
|
|
2131
2131
|
for (const o of i) {
|
|
2132
|
-
const l = await o.key,
|
|
2133
|
-
if (l.status === "aborted" ||
|
|
2134
|
-
(l.status === "dirty" ||
|
|
2132
|
+
const l = await o.key, d = await o.value;
|
|
2133
|
+
if (l.status === "aborted" || d.status === "aborted") return C;
|
|
2134
|
+
(l.status === "dirty" || d.status === "dirty") && t.dirty(), s.set(l.value, d.value);
|
|
2135
2135
|
}
|
|
2136
2136
|
return {
|
|
2137
2137
|
status: t.value,
|
|
@@ -2141,9 +2141,9 @@ var $a = class Rt extends L {
|
|
|
2141
2141
|
} else {
|
|
2142
2142
|
const s = /* @__PURE__ */ new Map();
|
|
2143
2143
|
for (const o of i) {
|
|
2144
|
-
const l = o.key,
|
|
2145
|
-
if (l.status === "aborted" ||
|
|
2146
|
-
(l.status === "dirty" ||
|
|
2144
|
+
const l = o.key, d = o.value;
|
|
2145
|
+
if (l.status === "aborted" || d.status === "aborted") return C;
|
|
2146
|
+
(l.status === "dirty" || d.status === "dirty") && t.dirty(), s.set(l.value, d.value);
|
|
2147
2147
|
}
|
|
2148
2148
|
return {
|
|
2149
2149
|
status: t.value,
|
|
@@ -2155,7 +2155,7 @@ var $a = class Rt extends L {
|
|
|
2155
2155
|
jt.create = (e, t, r) => new jt({
|
|
2156
2156
|
valueType: t,
|
|
2157
2157
|
keyType: e,
|
|
2158
|
-
typeName:
|
|
2158
|
+
typeName: I.ZodMap,
|
|
2159
2159
|
...E(r)
|
|
2160
2160
|
});
|
|
2161
2161
|
var Zt = class Ot extends L {
|
|
@@ -2166,7 +2166,7 @@ var Zt = class Ot extends L {
|
|
|
2166
2166
|
code: m.invalid_type,
|
|
2167
2167
|
expected: _.set,
|
|
2168
2168
|
received: a.parsedType
|
|
2169
|
-
}),
|
|
2169
|
+
}), C;
|
|
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,
|
|
@@ -2185,17 +2185,17 @@ var Zt = class Ot extends L {
|
|
|
2185
2185
|
}), r.dirty());
|
|
2186
2186
|
const i = this._def.valueType;
|
|
2187
2187
|
function s(l) {
|
|
2188
|
-
const
|
|
2189
|
-
for (const
|
|
2190
|
-
if (
|
|
2191
|
-
|
|
2188
|
+
const d = /* @__PURE__ */ new Set();
|
|
2189
|
+
for (const h of l) {
|
|
2190
|
+
if (h.status === "aborted") return C;
|
|
2191
|
+
h.status === "dirty" && r.dirty(), d.add(h.value);
|
|
2192
2192
|
}
|
|
2193
2193
|
return {
|
|
2194
2194
|
status: r.value,
|
|
2195
|
-
value:
|
|
2195
|
+
value: d
|
|
2196
2196
|
};
|
|
2197
2197
|
}
|
|
2198
|
-
const o = [...a.data.values()].map((l,
|
|
2198
|
+
const o = [...a.data.values()].map((l, d) => i._parse(new se(a, l, a.path, d)));
|
|
2199
2199
|
return a.common.async ? Promise.all(o).then((l) => s(l)) : s(o);
|
|
2200
2200
|
}
|
|
2201
2201
|
min(t, r) {
|
|
@@ -2227,7 +2227,7 @@ Zt.create = (e, t) => new Zt({
|
|
|
2227
2227
|
valueType: e,
|
|
2228
2228
|
minSize: null,
|
|
2229
2229
|
maxSize: null,
|
|
2230
|
-
typeName:
|
|
2230
|
+
typeName: I.ZodSet,
|
|
2231
2231
|
...E(t)
|
|
2232
2232
|
});
|
|
2233
2233
|
var Va = class Je extends L {
|
|
@@ -2241,7 +2241,7 @@ var Va = class Je extends L {
|
|
|
2241
2241
|
code: m.invalid_type,
|
|
2242
2242
|
expected: _.function,
|
|
2243
2243
|
received: r.parsedType
|
|
2244
|
-
}),
|
|
2244
|
+
}), C;
|
|
2245
2245
|
function a(o, l) {
|
|
2246
2246
|
return xt({
|
|
2247
2247
|
data: o,
|
|
@@ -2251,7 +2251,7 @@ var Va = class Je extends L {
|
|
|
2251
2251
|
r.schemaErrorMap,
|
|
2252
2252
|
_t(),
|
|
2253
2253
|
Oe
|
|
2254
|
-
].filter((
|
|
2254
|
+
].filter((d) => !!d),
|
|
2255
2255
|
issueData: {
|
|
2256
2256
|
code: m.invalid_arguments,
|
|
2257
2257
|
argumentsError: l
|
|
@@ -2267,7 +2267,7 @@ var Va = class Je extends L {
|
|
|
2267
2267
|
r.schemaErrorMap,
|
|
2268
2268
|
_t(),
|
|
2269
2269
|
Oe
|
|
2270
|
-
].filter((
|
|
2270
|
+
].filter((d) => !!d),
|
|
2271
2271
|
issueData: {
|
|
2272
2272
|
code: m.invalid_return_type,
|
|
2273
2273
|
returnTypeError: l
|
|
@@ -2277,22 +2277,22 @@ var Va = class Je extends L {
|
|
|
2277
2277
|
const i = { errorMap: r.common.contextualErrorMap }, s = r.data;
|
|
2278
2278
|
if (this._def.returns instanceof Fe) {
|
|
2279
2279
|
const o = this;
|
|
2280
|
-
return
|
|
2281
|
-
const
|
|
2282
|
-
throw
|
|
2283
|
-
}),
|
|
2284
|
-
return await o._def.returns._def.type.parseAsync(
|
|
2285
|
-
throw
|
|
2280
|
+
return B(async function(...l) {
|
|
2281
|
+
const d = new ie([]), h = await o._def.args.parseAsync(l, i).catch((p) => {
|
|
2282
|
+
throw d.addIssue(a(l, p)), d;
|
|
2283
|
+
}), u = await Reflect.apply(s, this, h);
|
|
2284
|
+
return await o._def.returns._def.type.parseAsync(u, i).catch((p) => {
|
|
2285
|
+
throw d.addIssue(n(u, p)), d;
|
|
2286
2286
|
});
|
|
2287
2287
|
});
|
|
2288
2288
|
} else {
|
|
2289
2289
|
const o = this;
|
|
2290
|
-
return
|
|
2291
|
-
const
|
|
2292
|
-
if (!
|
|
2293
|
-
const
|
|
2294
|
-
if (!
|
|
2295
|
-
return
|
|
2290
|
+
return B(function(...l) {
|
|
2291
|
+
const d = o._def.args.safeParse(l, i);
|
|
2292
|
+
if (!d.success) throw new ie([a(l, d.error)]);
|
|
2293
|
+
const h = Reflect.apply(s, this, d.data), u = o._def.returns.safeParse(h, i);
|
|
2294
|
+
if (!u.success) throw new ie([n(h, u.error)]);
|
|
2295
|
+
return u.data;
|
|
2296
2296
|
});
|
|
2297
2297
|
}
|
|
2298
2298
|
}
|
|
@@ -2324,7 +2324,7 @@ var Va = class Je extends L {
|
|
|
2324
2324
|
return new Je({
|
|
2325
2325
|
args: t || be.create([]).rest(Ne.create()),
|
|
2326
2326
|
returns: r || Ne.create(),
|
|
2327
|
-
typeName:
|
|
2327
|
+
typeName: I.ZodFunction,
|
|
2328
2328
|
...E(a)
|
|
2329
2329
|
});
|
|
2330
2330
|
}
|
|
@@ -2343,7 +2343,7 @@ var Va = class Je extends L {
|
|
|
2343
2343
|
};
|
|
2344
2344
|
nt.create = (e, t) => new nt({
|
|
2345
2345
|
getter: e,
|
|
2346
|
-
typeName:
|
|
2346
|
+
typeName: I.ZodLazy,
|
|
2347
2347
|
...E(t)
|
|
2348
2348
|
});
|
|
2349
2349
|
var it = class extends L {
|
|
@@ -2354,7 +2354,7 @@ var it = class extends L {
|
|
|
2354
2354
|
received: t.data,
|
|
2355
2355
|
code: m.invalid_literal,
|
|
2356
2356
|
expected: this._def.value
|
|
2357
|
-
}),
|
|
2357
|
+
}), C;
|
|
2358
2358
|
}
|
|
2359
2359
|
return {
|
|
2360
2360
|
status: "valid",
|
|
@@ -2367,13 +2367,13 @@ var it = class extends L {
|
|
|
2367
2367
|
};
|
|
2368
2368
|
it.create = (e, t) => new it({
|
|
2369
2369
|
value: e,
|
|
2370
|
-
typeName:
|
|
2370
|
+
typeName: I.ZodLiteral,
|
|
2371
2371
|
...E(t)
|
|
2372
2372
|
});
|
|
2373
2373
|
function Fr(e, t) {
|
|
2374
2374
|
return new ft({
|
|
2375
2375
|
values: e,
|
|
2376
|
-
typeName:
|
|
2376
|
+
typeName: I.ZodEnum,
|
|
2377
2377
|
...E(t)
|
|
2378
2378
|
});
|
|
2379
2379
|
}
|
|
@@ -2385,7 +2385,7 @@ var ft = class Ft extends L {
|
|
|
2385
2385
|
expected: A.joinValues(a),
|
|
2386
2386
|
received: r.parsedType,
|
|
2387
2387
|
code: m.invalid_type
|
|
2388
|
-
}),
|
|
2388
|
+
}), C;
|
|
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 L {
|
|
|
2393
2393
|
received: r.data,
|
|
2394
2394
|
code: m.invalid_enum_value,
|
|
2395
2395
|
options: a
|
|
2396
|
-
}),
|
|
2396
|
+
}), C;
|
|
2397
2397
|
}
|
|
2398
|
-
return
|
|
2398
|
+
return B(t.data);
|
|
2399
2399
|
}
|
|
2400
2400
|
get options() {
|
|
2401
2401
|
return this._def.values;
|
|
@@ -2438,7 +2438,7 @@ var st = class extends L {
|
|
|
2438
2438
|
expected: A.joinValues(a),
|
|
2439
2439
|
received: r.parsedType,
|
|
2440
2440
|
code: m.invalid_type
|
|
2441
|
-
}),
|
|
2441
|
+
}), C;
|
|
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 L {
|
|
|
2446
2446
|
received: r.data,
|
|
2447
2447
|
code: m.invalid_enum_value,
|
|
2448
2448
|
options: a
|
|
2449
|
-
}),
|
|
2449
|
+
}), C;
|
|
2450
2450
|
}
|
|
2451
|
-
return
|
|
2451
|
+
return B(e.data);
|
|
2452
2452
|
}
|
|
2453
2453
|
get enum() {
|
|
2454
2454
|
return this._def.values;
|
|
@@ -2456,7 +2456,7 @@ var st = class extends L {
|
|
|
2456
2456
|
};
|
|
2457
2457
|
st.create = (e, t) => new st({
|
|
2458
2458
|
values: e,
|
|
2459
|
-
typeName:
|
|
2459
|
+
typeName: I.ZodNativeEnum,
|
|
2460
2460
|
...E(t)
|
|
2461
2461
|
});
|
|
2462
2462
|
var Fe = class extends L {
|
|
@@ -2469,7 +2469,7 @@ var Fe = class extends L {
|
|
|
2469
2469
|
code: m.invalid_type,
|
|
2470
2470
|
expected: _.promise,
|
|
2471
2471
|
received: t.parsedType
|
|
2472
|
-
}),
|
|
2472
|
+
}), C) : B((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
|
})));
|
|
@@ -2477,7 +2477,7 @@ var Fe = class extends L {
|
|
|
2477
2477
|
};
|
|
2478
2478
|
Fe.create = (e, t) => new Fe({
|
|
2479
2479
|
type: e,
|
|
2480
|
-
typeName:
|
|
2480
|
+
typeName: I.ZodPromise,
|
|
2481
2481
|
...E(t)
|
|
2482
2482
|
});
|
|
2483
2483
|
var pe = class extends L {
|
|
@@ -2485,7 +2485,7 @@ var pe = class extends L {
|
|
|
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 === I.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 pe = class extends L {
|
|
|
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 C;
|
|
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" ? C : 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 C;
|
|
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" ? C : 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 pe = class extends L {
|
|
|
2530
2530
|
path: r.path,
|
|
2531
2531
|
parent: r
|
|
2532
2532
|
});
|
|
2533
|
-
return s.status === "aborted" ?
|
|
2533
|
+
return s.status === "aborted" ? C : (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 pe = class extends L {
|
|
|
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" ? C : (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 pe = class extends L {
|
|
|
2549
2549
|
path: r.path,
|
|
2550
2550
|
parent: r
|
|
2551
2551
|
});
|
|
2552
|
-
if (!Me(i)) return
|
|
2552
|
+
if (!Me(i)) return C;
|
|
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 {
|
|
@@ -2563,13 +2563,13 @@ var pe = class extends L {
|
|
|
2563
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
|
+
})) : C);
|
|
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: I.ZodEffects,
|
|
2573
2573
|
effect: t,
|
|
2574
2574
|
...E(r)
|
|
2575
2575
|
});
|
|
@@ -2579,12 +2579,12 @@ pe.createWithPreprocess = (e, t, r) => new pe({
|
|
|
2579
2579
|
type: "preprocess",
|
|
2580
2580
|
transform: e
|
|
2581
2581
|
},
|
|
2582
|
-
typeName:
|
|
2582
|
+
typeName: I.ZodEffects,
|
|
2583
2583
|
...E(r)
|
|
2584
2584
|
});
|
|
2585
2585
|
var fe = class extends L {
|
|
2586
2586
|
_parse(e) {
|
|
2587
|
-
return this._getType(e) === _.undefined ?
|
|
2587
|
+
return this._getType(e) === _.undefined ? B(void 0) : this._def.innerType._parse(e);
|
|
2588
2588
|
}
|
|
2589
2589
|
unwrap() {
|
|
2590
2590
|
return this._def.innerType;
|
|
@@ -2592,12 +2592,12 @@ var fe = class extends L {
|
|
|
2592
2592
|
};
|
|
2593
2593
|
fe.create = (e, t) => new fe({
|
|
2594
2594
|
innerType: e,
|
|
2595
|
-
typeName:
|
|
2595
|
+
typeName: I.ZodOptional,
|
|
2596
2596
|
...E(t)
|
|
2597
2597
|
});
|
|
2598
2598
|
var _e = class extends L {
|
|
2599
2599
|
_parse(e) {
|
|
2600
|
-
return this._getType(e) === _.null ?
|
|
2600
|
+
return this._getType(e) === _.null ? B(null) : this._def.innerType._parse(e);
|
|
2601
2601
|
}
|
|
2602
2602
|
unwrap() {
|
|
2603
2603
|
return this._def.innerType;
|
|
@@ -2605,7 +2605,7 @@ var _e = class extends L {
|
|
|
2605
2605
|
};
|
|
2606
2606
|
_e.create = (e, t) => new _e({
|
|
2607
2607
|
innerType: e,
|
|
2608
|
-
typeName:
|
|
2608
|
+
typeName: I.ZodNullable,
|
|
2609
2609
|
...E(t)
|
|
2610
2610
|
});
|
|
2611
2611
|
var ot = class extends L {
|
|
@@ -2624,7 +2624,7 @@ var ot = class extends L {
|
|
|
2624
2624
|
};
|
|
2625
2625
|
ot.create = (e, t) => new ot({
|
|
2626
2626
|
innerType: e,
|
|
2627
|
-
typeName:
|
|
2627
|
+
typeName: I.ZodDefault,
|
|
2628
2628
|
defaultValue: typeof t.default == "function" ? t.default : () => t.default,
|
|
2629
2629
|
...E(t)
|
|
2630
2630
|
});
|
|
@@ -2665,7 +2665,7 @@ var lt = class extends L {
|
|
|
2665
2665
|
};
|
|
2666
2666
|
lt.create = (e, t) => new lt({
|
|
2667
2667
|
innerType: e,
|
|
2668
|
-
typeName:
|
|
2668
|
+
typeName: I.ZodCatch,
|
|
2669
2669
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
2670
2670
|
...E(t)
|
|
2671
2671
|
});
|
|
@@ -2677,7 +2677,7 @@ var Pt = class extends L {
|
|
|
2677
2677
|
code: m.invalid_type,
|
|
2678
2678
|
expected: _.nan,
|
|
2679
2679
|
received: t.parsedType
|
|
2680
|
-
}),
|
|
2680
|
+
}), C;
|
|
2681
2681
|
}
|
|
2682
2682
|
return {
|
|
2683
2683
|
status: "valid",
|
|
@@ -2686,7 +2686,7 @@ var Pt = class extends L {
|
|
|
2686
2686
|
}
|
|
2687
2687
|
};
|
|
2688
2688
|
Pt.create = (e) => new Pt({
|
|
2689
|
-
typeName:
|
|
2689
|
+
typeName: I.ZodNaN,
|
|
2690
2690
|
...E(e)
|
|
2691
2691
|
});
|
|
2692
2692
|
var Pr = class extends L {
|
|
@@ -2711,7 +2711,7 @@ var Pr = class extends L {
|
|
|
2711
2711
|
path: a.path,
|
|
2712
2712
|
parent: a
|
|
2713
2713
|
});
|
|
2714
|
-
return i.status === "aborted" ?
|
|
2714
|
+
return i.status === "aborted" ? C : 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 L {
|
|
|
2723
2723
|
path: a.path,
|
|
2724
2724
|
parent: a
|
|
2725
2725
|
});
|
|
2726
|
-
return n.status === "aborted" ?
|
|
2726
|
+
return n.status === "aborted" ? C : n.status === "dirty" ? (r.dirty(), {
|
|
2727
2727
|
status: "dirty",
|
|
2728
2728
|
value: n.value
|
|
2729
2729
|
}) : this._def.out._parseSync({
|
|
@@ -2737,7 +2737,7 @@ var Pr = class extends L {
|
|
|
2737
2737
|
return new Vr({
|
|
2738
2738
|
in: t,
|
|
2739
2739
|
out: r,
|
|
2740
|
-
typeName:
|
|
2740
|
+
typeName: I.ZodPipeline
|
|
2741
2741
|
});
|
|
2742
2742
|
}
|
|
2743
2743
|
}, ct = class extends L {
|
|
@@ -2751,38 +2751,38 @@ var Pr = class extends L {
|
|
|
2751
2751
|
};
|
|
2752
2752
|
ct.create = (e, t) => new ct({
|
|
2753
2753
|
innerType: e,
|
|
2754
|
-
typeName:
|
|
2754
|
+
typeName: I.ZodReadonly,
|
|
2755
2755
|
...E(t)
|
|
2756
2756
|
});
|
|
2757
|
-
var
|
|
2757
|
+
var wo = { object: te.lazycreate }, I;
|
|
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
|
+
})(I || (I = {}));
|
|
2761
|
+
var W = qe.create, So = wt.create, Co = Pt.create, Io = Ct.create, vt = Nt.create, No = Et.create, Eo = Mt.create, Mo = et.create, Lo = tt.create, To = Lt.create, za = Ne.create, Ao = ve.create, Ro = Tt.create, jo = Le.create, Dt = te.create, Zo = te.strictCreate, Oo = rt.create, Fo = Pa.create, Po = at.create, $o = be.create, Wa = $a.create, Vo = jt.create, zo = Zt.create, Wo = Va.create, Do = nt.create, Uo = it.create, $t = ft.create, Bo = st.create, Go = Fe.create, Ho = pe.create, Yo = fe.create, Xo = _e.create, Jo = pe.createWithPreprocess, Qo = $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: W().optional(),
|
|
2768
|
+
fontFamily: W().optional(),
|
|
2769
|
+
borderRadius: W().optional()
|
|
2770
2770
|
}), Ua = Dt({
|
|
2771
|
-
externalId:
|
|
2772
|
-
authId:
|
|
2773
|
-
name:
|
|
2774
|
-
email:
|
|
2771
|
+
externalId: W().optional(),
|
|
2772
|
+
authId: W().optional(),
|
|
2773
|
+
name: W().optional(),
|
|
2774
|
+
email: W().optional()
|
|
2775
2775
|
}), zr = Dt({
|
|
2776
|
-
agentId:
|
|
2777
|
-
apiBaseUrl:
|
|
2778
|
-
tenantId:
|
|
2776
|
+
agentId: W().min(1, "agentId is required"),
|
|
2777
|
+
apiBaseUrl: W().url("apiBaseUrl must be a valid URL"),
|
|
2778
|
+
tenantId: W().optional(),
|
|
2779
2779
|
user: Ua.optional(),
|
|
2780
|
-
sessionId:
|
|
2780
|
+
sessionId: W().optional(),
|
|
2781
2781
|
mode: $t(["floating", "inline"]).optional(),
|
|
2782
|
-
title:
|
|
2783
|
-
subtitle:
|
|
2784
|
-
description:
|
|
2785
|
-
avatarUrl:
|
|
2782
|
+
title: W().optional(),
|
|
2783
|
+
subtitle: W().optional(),
|
|
2784
|
+
description: W().optional(),
|
|
2785
|
+
avatarUrl: W().optional(),
|
|
2786
2786
|
streaming: vt().optional(),
|
|
2787
2787
|
preview: vt().optional(),
|
|
2788
2788
|
skipServerConfigFetch: vt().optional(),
|
|
@@ -2792,7 +2792,7 @@ var z = 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(), ke = {
|
|
2796
2796
|
mode: "floating",
|
|
2797
2797
|
streaming: !0,
|
|
2798
2798
|
title: "AI Assistant",
|
|
@@ -2809,10 +2809,10 @@ function Ve(e, t) {
|
|
|
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 ?? ke.theme.mode,
|
|
2813
|
+
accentColor: i.theme?.accentColor ?? r?.accentColor ?? ke.theme.accentColor,
|
|
2814
|
+
fontFamily: i.theme?.fontFamily ?? r?.fontFamily ?? ke.theme.fontFamily,
|
|
2815
|
+
borderRadius: i.theme?.borderRadius ?? r?.borderRadius ?? ke.theme.borderRadius
|
|
2816
2816
|
};
|
|
2817
2817
|
return {
|
|
2818
2818
|
agentId: i.agentId,
|
|
@@ -2825,8 +2825,8 @@ function Ve(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 ?? ke.mode,
|
|
2829
|
+
title: i.title ?? ke.title,
|
|
2830
2830
|
subtitle: i.subtitle,
|
|
2831
2831
|
description: i.description,
|
|
2832
2832
|
suggestedQuestions: (() => {
|
|
@@ -2834,7 +2834,7 @@ function Ve(e, t) {
|
|
|
2834
2834
|
return Array.isArray(o) ? o : [];
|
|
2835
2835
|
})(),
|
|
2836
2836
|
avatarUrl: i.avatarUrl,
|
|
2837
|
-
streaming: i.streaming ??
|
|
2837
|
+
streaming: i.streaming ?? ke.streaming,
|
|
2838
2838
|
preview: i.preview === !0,
|
|
2839
2839
|
skipServerConfigFetch: i.skipServerConfigFetch === !0,
|
|
2840
2840
|
configChannel: i.configChannel,
|
|
@@ -2876,24 +2876,24 @@ function oe(e, t, r, a) {
|
|
|
2876
2876
|
});
|
|
2877
2877
|
}
|
|
2878
2878
|
return new (r || (r = Promise))(function(i, s) {
|
|
2879
|
-
function o(
|
|
2879
|
+
function o(h) {
|
|
2880
2880
|
try {
|
|
2881
|
-
|
|
2882
|
-
} catch (
|
|
2883
|
-
s(
|
|
2881
|
+
d(a.next(h));
|
|
2882
|
+
} catch (u) {
|
|
2883
|
+
s(u);
|
|
2884
2884
|
}
|
|
2885
2885
|
}
|
|
2886
|
-
function l(
|
|
2886
|
+
function l(h) {
|
|
2887
2887
|
try {
|
|
2888
|
-
|
|
2889
|
-
} catch (
|
|
2890
|
-
s(
|
|
2888
|
+
d(a.throw(h));
|
|
2889
|
+
} catch (u) {
|
|
2890
|
+
s(u);
|
|
2891
2891
|
}
|
|
2892
2892
|
}
|
|
2893
|
-
function
|
|
2894
|
-
|
|
2893
|
+
function d(h) {
|
|
2894
|
+
h.done ? i(h.value) : n(h.value).then(o, l);
|
|
2895
2895
|
}
|
|
2896
|
-
|
|
2896
|
+
d((a = a.apply(e, t || [])).next());
|
|
2897
2897
|
});
|
|
2898
2898
|
}
|
|
2899
2899
|
function le(e, t) {
|
|
@@ -2909,60 +2909,60 @@ function le(e, t) {
|
|
|
2909
2909
|
return s.next = o(0), s.throw = o(1), s.return = o(2), typeof Symbol == "function" && (s[Symbol.iterator] = function() {
|
|
2910
2910
|
return this;
|
|
2911
2911
|
}), s;
|
|
2912
|
-
function o(
|
|
2913
|
-
return function(
|
|
2914
|
-
return l([
|
|
2912
|
+
function o(d) {
|
|
2913
|
+
return function(h) {
|
|
2914
|
+
return l([d, h]);
|
|
2915
2915
|
};
|
|
2916
2916
|
}
|
|
2917
|
-
function l(
|
|
2917
|
+
function l(d) {
|
|
2918
2918
|
if (a) throw new TypeError("Generator is already executing.");
|
|
2919
|
-
for (; s && (s = 0,
|
|
2920
|
-
if (a = 1, n && (i =
|
|
2921
|
-
switch (n = 0, i && (
|
|
2919
|
+
for (; s && (s = 0, d[0] && (r = 0)), r; ) try {
|
|
2920
|
+
if (a = 1, n && (i = d[0] & 2 ? n.return : d[0] ? n.throw || ((i = n.return) && i.call(n), 0) : n.next) && !(i = i.call(n, d[1])).done) return i;
|
|
2921
|
+
switch (n = 0, i && (d = [d[0] & 2, i.value]), d[0]) {
|
|
2922
2922
|
case 0:
|
|
2923
2923
|
case 1:
|
|
2924
|
-
i =
|
|
2924
|
+
i = d;
|
|
2925
2925
|
break;
|
|
2926
2926
|
case 4:
|
|
2927
2927
|
return r.label++, {
|
|
2928
|
-
value:
|
|
2928
|
+
value: d[1],
|
|
2929
2929
|
done: !1
|
|
2930
2930
|
};
|
|
2931
2931
|
case 5:
|
|
2932
|
-
r.label++, n =
|
|
2932
|
+
r.label++, n = d[1], d = [0];
|
|
2933
2933
|
continue;
|
|
2934
2934
|
case 7:
|
|
2935
|
-
|
|
2935
|
+
d = r.ops.pop(), r.trys.pop();
|
|
2936
2936
|
continue;
|
|
2937
2937
|
default:
|
|
2938
|
-
if (i = r.trys, !(i = i.length > 0 && i[i.length - 1]) && (
|
|
2938
|
+
if (i = r.trys, !(i = i.length > 0 && i[i.length - 1]) && (d[0] === 6 || d[0] === 2)) {
|
|
2939
2939
|
r = 0;
|
|
2940
2940
|
continue;
|
|
2941
2941
|
}
|
|
2942
|
-
if (
|
|
2943
|
-
r.label =
|
|
2942
|
+
if (d[0] === 3 && (!i || d[1] > i[0] && d[1] < i[3])) {
|
|
2943
|
+
r.label = d[1];
|
|
2944
2944
|
break;
|
|
2945
2945
|
}
|
|
2946
|
-
if (
|
|
2947
|
-
r.label = i[1], i =
|
|
2946
|
+
if (d[0] === 6 && r.label < i[1]) {
|
|
2947
|
+
r.label = i[1], i = d;
|
|
2948
2948
|
break;
|
|
2949
2949
|
}
|
|
2950
2950
|
if (i && r.label < i[2]) {
|
|
2951
|
-
r.label = i[2], r.ops.push(
|
|
2951
|
+
r.label = i[2], r.ops.push(d);
|
|
2952
2952
|
break;
|
|
2953
2953
|
}
|
|
2954
2954
|
i[2] && r.ops.pop(), r.trys.pop();
|
|
2955
2955
|
continue;
|
|
2956
2956
|
}
|
|
2957
|
-
|
|
2958
|
-
} catch (
|
|
2959
|
-
|
|
2957
|
+
d = t.call(e, r);
|
|
2958
|
+
} catch (h) {
|
|
2959
|
+
d = [6, h], n = 0;
|
|
2960
2960
|
} finally {
|
|
2961
2961
|
a = i = 0;
|
|
2962
2962
|
}
|
|
2963
|
-
if (
|
|
2963
|
+
if (d[0] & 5) throw d[1];
|
|
2964
2964
|
return {
|
|
2965
|
-
value:
|
|
2965
|
+
value: d[0] ? d[1] : void 0,
|
|
2966
2966
|
done: !0
|
|
2967
2967
|
};
|
|
2968
2968
|
}
|
|
@@ -3049,7 +3049,7 @@ function ee(e) {
|
|
|
3049
3049
|
function ue(e, t) {
|
|
3050
3050
|
return typeof e == "number" && isNaN(e) ? t : e;
|
|
3051
3051
|
}
|
|
3052
|
-
function
|
|
3052
|
+
function D(e) {
|
|
3053
3053
|
return e.reduce(function(t, r) {
|
|
3054
3054
|
return t + (r ? 1 : 0);
|
|
3055
3055
|
}, 0);
|
|
@@ -3063,19 +3063,19 @@ function Ja(e) {
|
|
|
3063
3063
|
for (var t, r, a = "Unexpected syntax '".concat(e, "'"), n = /^\s*([a-z-]*)(.*)$/i.exec(e), i = n[1] || void 0, s = {}, o = /([.:#][\w-]+|\[.+?\])/gi, l = function(p, f) {
|
|
3064
3064
|
s[p] = s[p] || [], s[p].push(f);
|
|
3065
3065
|
}; ; ) {
|
|
3066
|
-
var
|
|
3067
|
-
if (!
|
|
3068
|
-
var
|
|
3069
|
-
switch (
|
|
3066
|
+
var d = o.exec(n[2]);
|
|
3067
|
+
if (!d) break;
|
|
3068
|
+
var h = d[0];
|
|
3069
|
+
switch (h[0]) {
|
|
3070
3070
|
case ".":
|
|
3071
|
-
l("class",
|
|
3071
|
+
l("class", h.slice(1));
|
|
3072
3072
|
break;
|
|
3073
3073
|
case "#":
|
|
3074
|
-
l("id",
|
|
3074
|
+
l("id", h.slice(1));
|
|
3075
3075
|
break;
|
|
3076
3076
|
case "[":
|
|
3077
|
-
var
|
|
3078
|
-
if (
|
|
3077
|
+
var u = /^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(h);
|
|
3078
|
+
if (u) l(u[1], (r = (t = u[4]) !== null && t !== void 0 ? t : u[5]) !== null && r !== void 0 ? r : "");
|
|
3079
3079
|
else throw new Error(a);
|
|
3080
3080
|
break;
|
|
3081
3081
|
default:
|
|
@@ -3093,12 +3093,12 @@ function Qa(e) {
|
|
|
3093
3093
|
return t;
|
|
3094
3094
|
}
|
|
3095
3095
|
function me(e, t) {
|
|
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,
|
|
3097
|
-
f += i +
|
|
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, d = t[1] & 65535, h = 0, u = 0, p = 0, f = 0;
|
|
3097
|
+
f += i + d, p += f >>> 16, f &= 65535, p += n + l, u += p >>> 16, p &= 65535, u += a + o, h += u >>> 16, u &= 65535, h += r + s, h &= 65535, e[0] = h << 16 | u, e[1] = p << 16 | f;
|
|
3098
3098
|
}
|
|
3099
3099
|
function Q(e, t) {
|
|
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,
|
|
3101
|
-
f += i *
|
|
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, d = t[1] & 65535, h = 0, u = 0, p = 0, f = 0;
|
|
3101
|
+
f += i * d, p += f >>> 16, f &= 65535, p += n * d, u += p >>> 16, p &= 65535, p += i * l, u += p >>> 16, p &= 65535, u += a * d, h += u >>> 16, u &= 65535, u += n * l, h += u >>> 16, u &= 65535, u += i * o, h += u >>> 16, u &= 65535, h += r * d + a * l + n * o + i * s, h &= 65535, e[0] = h << 16 | u, e[1] = p << 16 | f;
|
|
3102
3102
|
}
|
|
3103
3103
|
function xe(e, t) {
|
|
3104
3104
|
var r = e[0];
|
|
@@ -3119,42 +3119,42 @@ var Ge = [2277735313, 289559509], He = [1291169091, 658871167], or = [0, 5], en
|
|
|
3119
3119
|
function rn(e, t) {
|
|
3120
3120
|
var r = Qa(e);
|
|
3121
3121
|
t = t || 0;
|
|
3122
|
-
var a = [0, r.length], n = a[1] % 16, i = a[1] - n, s = [0, t], o = [0, t], l = [0, 0],
|
|
3123
|
-
for (
|
|
3124
|
-
l[0] = r[
|
|
3125
|
-
l[0] = 0, l[1] = 0,
|
|
3126
|
-
var
|
|
3122
|
+
var a = [0, r.length], n = a[1] % 16, i = a[1] - n, s = [0, t], o = [0, t], l = [0, 0], d = [0, 0], h;
|
|
3123
|
+
for (h = 0; h < i; h = h + 16)
|
|
3124
|
+
l[0] = r[h + 4] | r[h + 5] << 8 | r[h + 6] << 16 | r[h + 7] << 24, l[1] = r[h] | r[h + 1] << 8 | r[h + 2] << 16 | r[h + 3] << 24, d[0] = r[h + 12] | r[h + 13] << 8 | r[h + 14] << 16 | r[h + 15] << 24, d[1] = r[h + 8] | r[h + 9] << 8 | r[h + 10] << 16 | r[h + 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(d, He), xe(d, 33), Q(d, Ge), Z(o, d), xe(o, 31), me(o, s), Q(o, or), me(o, tn);
|
|
3125
|
+
l[0] = 0, l[1] = 0, d[0] = 0, d[1] = 0;
|
|
3126
|
+
var u = [0, 0];
|
|
3127
3127
|
switch (n) {
|
|
3128
3128
|
case 15:
|
|
3129
|
-
|
|
3129
|
+
u[1] = r[h + 14], H(u, 48), Z(d, u);
|
|
3130
3130
|
case 14:
|
|
3131
|
-
|
|
3131
|
+
u[1] = r[h + 13], H(u, 40), Z(d, u);
|
|
3132
3132
|
case 13:
|
|
3133
|
-
|
|
3133
|
+
u[1] = r[h + 12], H(u, 32), Z(d, u);
|
|
3134
3134
|
case 12:
|
|
3135
|
-
|
|
3135
|
+
u[1] = r[h + 11], H(u, 24), Z(d, u);
|
|
3136
3136
|
case 11:
|
|
3137
|
-
|
|
3137
|
+
u[1] = r[h + 10], H(u, 16), Z(d, u);
|
|
3138
3138
|
case 10:
|
|
3139
|
-
|
|
3139
|
+
u[1] = r[h + 9], H(u, 8), Z(d, u);
|
|
3140
3140
|
case 9:
|
|
3141
|
-
|
|
3141
|
+
u[1] = r[h + 8], Z(d, u), Q(d, He), xe(d, 33), Q(d, Ge), Z(o, d);
|
|
3142
3142
|
case 8:
|
|
3143
|
-
|
|
3143
|
+
u[1] = r[h + 7], H(u, 56), Z(l, u);
|
|
3144
3144
|
case 7:
|
|
3145
|
-
|
|
3145
|
+
u[1] = r[h + 6], H(u, 48), Z(l, u);
|
|
3146
3146
|
case 6:
|
|
3147
|
-
|
|
3147
|
+
u[1] = r[h + 5], H(u, 40), Z(l, u);
|
|
3148
3148
|
case 5:
|
|
3149
|
-
|
|
3149
|
+
u[1] = r[h + 4], H(u, 32), Z(l, u);
|
|
3150
3150
|
case 4:
|
|
3151
|
-
|
|
3151
|
+
u[1] = r[h + 3], H(u, 24), Z(l, u);
|
|
3152
3152
|
case 3:
|
|
3153
|
-
|
|
3153
|
+
u[1] = r[h + 2], H(u, 16), Z(l, u);
|
|
3154
3154
|
case 2:
|
|
3155
|
-
|
|
3155
|
+
u[1] = r[h + 1], H(u, 8), Z(l, u);
|
|
3156
3156
|
case 1:
|
|
3157
|
-
|
|
3157
|
+
u[1] = r[h], Z(l, u), Q(l, Ge), xe(l, 31), Q(l, He), Z(s, l);
|
|
3158
3158
|
}
|
|
3159
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
|
}
|
|
@@ -3193,17 +3193,17 @@ function on(e, t) {
|
|
|
3193
3193
|
};
|
|
3194
3194
|
});
|
|
3195
3195
|
a(function() {
|
|
3196
|
-
return new Promise(function(
|
|
3197
|
-
var
|
|
3196
|
+
return new Promise(function(d) {
|
|
3197
|
+
var h = Date.now();
|
|
3198
3198
|
nr(l, function() {
|
|
3199
|
-
for (var
|
|
3200
|
-
var f = o + Date.now() -
|
|
3201
|
-
if (!
|
|
3202
|
-
error:
|
|
3199
|
+
for (var u = [], p = 0; p < arguments.length; p++) u[p] = arguments[p];
|
|
3200
|
+
var f = o + Date.now() - h;
|
|
3201
|
+
if (!u[0]) return d({
|
|
3202
|
+
error: u[1],
|
|
3203
3203
|
duration: f
|
|
3204
3204
|
});
|
|
3205
|
-
|
|
3206
|
-
value:
|
|
3205
|
+
d({
|
|
3206
|
+
value: u[1],
|
|
3207
3207
|
duration: f
|
|
3208
3208
|
});
|
|
3209
3209
|
});
|
|
@@ -3225,7 +3225,7 @@ function ln(e, t, r, a) {
|
|
|
3225
3225
|
}, a));
|
|
3226
3226
|
return function() {
|
|
3227
3227
|
return oe(this, void 0, void 0, function() {
|
|
3228
|
-
var o, l,
|
|
3228
|
+
var o, l, d, h, u;
|
|
3229
3229
|
return le(this, function(p) {
|
|
3230
3230
|
switch (p.label) {
|
|
3231
3231
|
case 0:
|
|
@@ -3237,8 +3237,8 @@ function ln(e, t, r, a) {
|
|
|
3237
3237
|
case 2:
|
|
3238
3238
|
return l = p.sent(), [4, Promise.all(l)];
|
|
3239
3239
|
case 3:
|
|
3240
|
-
for (
|
|
3241
|
-
return [2,
|
|
3240
|
+
for (d = p.sent(), h = {}, u = 0; u < n.length; ++u) h[n[u]] = d[u];
|
|
3241
|
+
return [2, h];
|
|
3242
3242
|
}
|
|
3243
3243
|
});
|
|
3244
3244
|
});
|
|
@@ -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 D([
|
|
3250
3250
|
"MSCSSMatrix" in e,
|
|
3251
3251
|
"msSetImmediate" in e,
|
|
3252
3252
|
"msIndexedDB" in e,
|
|
@@ -3256,7 +3256,7 @@ function Hr() {
|
|
|
3256
3256
|
}
|
|
3257
3257
|
function cn() {
|
|
3258
3258
|
var e = window, t = navigator;
|
|
3259
|
-
return
|
|
3259
|
+
return D([
|
|
3260
3260
|
"msWriteProfilerMark" in e,
|
|
3261
3261
|
"MSStream" in e,
|
|
3262
3262
|
"msLaunchUri" in t,
|
|
@@ -3265,7 +3265,7 @@ function cn() {
|
|
|
3265
3265
|
}
|
|
3266
3266
|
function ze() {
|
|
3267
3267
|
var e = window, t = navigator;
|
|
3268
|
-
return
|
|
3268
|
+
return D([
|
|
3269
3269
|
"webkitPersistentStorage" in t,
|
|
3270
3270
|
"webkitTemporaryStorage" in t,
|
|
3271
3271
|
(t.vendor || "").indexOf("Google") === 0,
|
|
@@ -3277,7 +3277,7 @@ function ze() {
|
|
|
3277
3277
|
}
|
|
3278
3278
|
function re() {
|
|
3279
3279
|
var e = window, t = navigator;
|
|
3280
|
-
return
|
|
3280
|
+
return D([
|
|
3281
3281
|
"ApplePayError" in e,
|
|
3282
3282
|
"CSSPrimitiveValue" in e,
|
|
3283
3283
|
"Counter" in e,
|
|
@@ -3288,7 +3288,7 @@ function re() {
|
|
|
3288
3288
|
}
|
|
3289
3289
|
function Bt() {
|
|
3290
3290
|
var e = window, t = e.HTMLElement, r = e.Document;
|
|
3291
|
-
return
|
|
3291
|
+
return D([
|
|
3292
3292
|
"safari" in e,
|
|
3293
3293
|
!("ongestureend" in e),
|
|
3294
3294
|
!("TouchEvent" in e),
|
|
@@ -3303,7 +3303,7 @@ function We() {
|
|
|
3303
3303
|
}
|
|
3304
3304
|
function Yr() {
|
|
3305
3305
|
var e, t, r = window;
|
|
3306
|
-
return
|
|
3306
|
+
return D([
|
|
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 D([
|
|
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 D([
|
|
3327
3327
|
"union" in Set.prototype,
|
|
3328
3328
|
"Iterator" in e,
|
|
3329
3329
|
t && "hasRegExpGroups" in t.prototype,
|
|
@@ -3332,7 +3332,7 @@ function un() {
|
|
|
3332
3332
|
}
|
|
3333
3333
|
function hn() {
|
|
3334
3334
|
var e = window;
|
|
3335
|
-
return
|
|
3335
|
+
return D([
|
|
3336
3336
|
"DOMRectList" in e,
|
|
3337
3337
|
"RTCPeerConnectionIceEvent" in e,
|
|
3338
3338
|
"SVGGeometryElement" in e,
|
|
@@ -3341,7 +3341,7 @@ function hn() {
|
|
|
3341
3341
|
}
|
|
3342
3342
|
function De() {
|
|
3343
3343
|
var e = window, t = navigator, r = e.CSS, a = e.HTMLButtonElement;
|
|
3344
|
-
return
|
|
3344
|
+
return D([
|
|
3345
3345
|
!("getStorageUpdates" in t),
|
|
3346
3346
|
a && "popover" in a.prototype,
|
|
3347
3347
|
"CSSCounterStyleRule" in e,
|
|
@@ -3352,7 +3352,7 @@ function De() {
|
|
|
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 D([
|
|
3356
3356
|
"MediaSource" in window,
|
|
3357
3357
|
!!Element.prototype.webkitRequestFullscreen,
|
|
3358
3358
|
t > 0.65 && t < 1.53
|
|
@@ -3368,11 +3368,11 @@ function mn() {
|
|
|
3368
3368
|
}
|
|
3369
3369
|
function Gt() {
|
|
3370
3370
|
var e = ze(), t = Yr(), r = window, a = navigator, n = "connection";
|
|
3371
|
-
return e ?
|
|
3371
|
+
return e ? D([
|
|
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 ? D([
|
|
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 D([
|
|
3384
3384
|
"srLatency" in r,
|
|
3385
3385
|
"srChannelCount" in r,
|
|
3386
3386
|
"devicePosture" in e,
|
|
@@ -3399,14 +3399,14 @@ 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],
|
|
3403
|
-
return xn(
|
|
3404
|
-
}, function(
|
|
3405
|
-
if (
|
|
3406
|
-
throw
|
|
3402
|
+
var s = _n(a), o = s[0], l = s[1], d = Pe(o.then(function(h) {
|
|
3403
|
+
return xn(h.getChannelData(0).subarray(r));
|
|
3404
|
+
}, function(h) {
|
|
3405
|
+
if (h.name === "timeout" || h.name === "suspended") return -3;
|
|
3406
|
+
throw h;
|
|
3407
3407
|
}));
|
|
3408
3408
|
return function() {
|
|
3409
|
-
return l(),
|
|
3409
|
+
return l(), d;
|
|
3410
3410
|
};
|
|
3411
3411
|
}
|
|
3412
3412
|
function yn() {
|
|
@@ -3419,31 +3419,31 @@ function _n(e) {
|
|
|
3419
3419
|
var t = 3, r = 500, a = 500, n = 5e3, i = function() {
|
|
3420
3420
|
};
|
|
3421
3421
|
return [new Promise(function(s, o) {
|
|
3422
|
-
var l = !1,
|
|
3422
|
+
var l = !1, d = 0, h = 0;
|
|
3423
3423
|
e.oncomplete = function(f) {
|
|
3424
3424
|
return s(f.renderedBuffer);
|
|
3425
3425
|
};
|
|
3426
|
-
var
|
|
3426
|
+
var u = function() {
|
|
3427
3427
|
setTimeout(function() {
|
|
3428
3428
|
return o(lr("timeout"));
|
|
3429
|
-
}, Math.min(a,
|
|
3429
|
+
}, Math.min(a, h + n - Date.now()));
|
|
3430
3430
|
}, p = function() {
|
|
3431
3431
|
try {
|
|
3432
3432
|
var f = e.startRendering();
|
|
3433
3433
|
switch (Br(f) && Pe(f), e.state) {
|
|
3434
3434
|
case "running":
|
|
3435
|
-
|
|
3435
|
+
h = Date.now(), l && u();
|
|
3436
3436
|
break;
|
|
3437
3437
|
case "suspended":
|
|
3438
|
-
document.hidden ||
|
|
3438
|
+
document.hidden || d++, l && d >= t ? o(lr("suspended")) : setTimeout(p, r);
|
|
3439
3439
|
break;
|
|
3440
3440
|
}
|
|
3441
|
-
} catch (
|
|
3442
|
-
o(
|
|
3441
|
+
} catch (k) {
|
|
3442
|
+
o(k);
|
|
3443
3443
|
}
|
|
3444
3444
|
};
|
|
3445
3445
|
p(), i = function() {
|
|
3446
|
-
l || (l = !0,
|
|
3446
|
+
l || (l = !0, h > 0 && u());
|
|
3447
3447
|
};
|
|
3448
3448
|
}), i];
|
|
3449
3449
|
}
|
|
@@ -3475,20 +3475,20 @@ function Xr(e, t, r) {
|
|
|
3475
3475
|
,
|
|
3476
3476
|
10,
|
|
3477
3477
|
11
|
|
3478
|
-
]), [4, new Promise(function(
|
|
3479
|
-
var
|
|
3480
|
-
|
|
3481
|
-
}, f = function(
|
|
3482
|
-
|
|
3478
|
+
]), [4, new Promise(function(d, h) {
|
|
3479
|
+
var u = !1, p = function() {
|
|
3480
|
+
u = !0, d();
|
|
3481
|
+
}, f = function(S) {
|
|
3482
|
+
u = !0, h(S);
|
|
3483
3483
|
};
|
|
3484
3484
|
o.onload = p, o.onerror = f;
|
|
3485
|
-
var
|
|
3486
|
-
|
|
3487
|
-
var
|
|
3488
|
-
var
|
|
3489
|
-
|
|
3485
|
+
var k = o.style;
|
|
3486
|
+
k.setProperty("display", "block", "important"), k.position = "absolute", k.top = "0", k.left = "0", k.visibility = "hidden", t && "srcdoc" in o ? o.srcdoc = t : o.src = "about:blank", s.body.appendChild(o);
|
|
3487
|
+
var v = function() {
|
|
3488
|
+
var S, g;
|
|
3489
|
+
u || (((g = (S = o.contentWindow) === null || S === void 0 ? void 0 : S.document) === null || g === void 0 ? void 0 : g.readyState) === "complete" ? p() : setTimeout(v, 10));
|
|
3490
3490
|
};
|
|
3491
|
-
|
|
3491
|
+
v();
|
|
3492
3492
|
})];
|
|
3493
3493
|
case 5:
|
|
3494
3494
|
l.sent(), l.label = 6;
|
|
@@ -3600,33 +3600,33 @@ function En() {
|
|
|
3600
3600
|
return Xr(function(t, r) {
|
|
3601
3601
|
var a = r.document;
|
|
3602
3602
|
return oe(e, void 0, void 0, function() {
|
|
3603
|
-
var n, i, s, o, l,
|
|
3604
|
-
return le(this, function(
|
|
3603
|
+
var n, i, s, o, l, d, h, u, p, f, k, v;
|
|
3604
|
+
return le(this, function(S) {
|
|
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
|
|
3608
|
-
},
|
|
3609
|
-
return l("'".concat(g, "',").concat(
|
|
3610
|
-
}, u = function() {
|
|
3611
|
-
return we.map(l);
|
|
3606
|
+
var w = a.createElement("span"), R = w.style;
|
|
3607
|
+
return R.position = "absolute", R.top = "0", R.left = "0", R.fontFamily = g, w.textContent = In, i.appendChild(w), w;
|
|
3608
|
+
}, d = function(g, w) {
|
|
3609
|
+
return l("'".concat(g, "',").concat(w));
|
|
3612
3610
|
}, h = function() {
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3611
|
+
return we.map(l);
|
|
3612
|
+
}, u = function() {
|
|
3613
|
+
for (var g = {}, w = function(U) {
|
|
3614
|
+
g[U] = we.map(function(ae) {
|
|
3615
|
+
return d(U, ae);
|
|
3616
3616
|
});
|
|
3617
|
-
},
|
|
3618
|
-
var
|
|
3619
|
-
|
|
3617
|
+
}, R = 0, F = cr; R < F.length; R++) {
|
|
3618
|
+
var $ = F[R];
|
|
3619
|
+
w($);
|
|
3620
3620
|
}
|
|
3621
3621
|
return g;
|
|
3622
3622
|
}, p = function(g) {
|
|
3623
|
-
return we.some(function(
|
|
3624
|
-
return g[
|
|
3623
|
+
return we.some(function(w, R) {
|
|
3624
|
+
return g[R].offsetWidth !== s[w] || g[R].offsetHeight !== o[w];
|
|
3625
3625
|
});
|
|
3626
|
-
}, f =
|
|
3627
|
-
s[we[
|
|
3626
|
+
}, f = h(), k = u(), n.appendChild(i), v = 0; v < we.length; v++)
|
|
3627
|
+
s[we[v]] = f[v].offsetWidth, o[we[v]] = f[v].offsetHeight;
|
|
3628
3628
|
return [2, cr.filter(function(g) {
|
|
3629
|
-
return p(
|
|
3629
|
+
return p(k[g]);
|
|
3630
3630
|
})];
|
|
3631
3631
|
});
|
|
3632
3632
|
});
|
|
@@ -4208,15 +4208,15 @@ function di(e) {
|
|
|
4208
4208
|
return le(this, function(l) {
|
|
4209
4209
|
switch (l.label) {
|
|
4210
4210
|
case 0:
|
|
4211
|
-
return ui() ? (r = ci(), a = Object.keys(r), n = (o = []).concat.apply(o, a.map(function(
|
|
4212
|
-
return r[
|
|
4211
|
+
return ui() ? (r = ci(), a = Object.keys(r), n = (o = []).concat.apply(o, a.map(function(d) {
|
|
4212
|
+
return r[d];
|
|
4213
4213
|
})), [4, hi(n)]) : [2, void 0];
|
|
4214
4214
|
case 1:
|
|
4215
|
-
return i = l.sent(), t && fi(r, i), s = a.filter(function(
|
|
4216
|
-
var
|
|
4217
|
-
return
|
|
4218
|
-
return i[
|
|
4219
|
-
})) >
|
|
4215
|
+
return i = l.sent(), t && fi(r, i), s = a.filter(function(d) {
|
|
4216
|
+
var h = r[d];
|
|
4217
|
+
return D(h.map(function(u) {
|
|
4218
|
+
return i[u];
|
|
4219
|
+
})) > h.length * 0.6;
|
|
4220
4220
|
}), s.sort(), [2, s];
|
|
4221
4221
|
}
|
|
4222
4222
|
});
|
|
@@ -4229,16 +4229,16 @@ function hi(e) {
|
|
|
4229
4229
|
var t;
|
|
4230
4230
|
return oe(this, void 0, void 0, function() {
|
|
4231
4231
|
var r, a, n, i, l, s, o, l;
|
|
4232
|
-
return le(this, function(
|
|
4233
|
-
switch (
|
|
4232
|
+
return le(this, function(d) {
|
|
4233
|
+
switch (d.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)
|
|
4236
4236
|
s = wn(e[l]), s.tagName === "DIALOG" && s.show(), o = r.createElement("div"), dr(o), o.appendChild(s), a.appendChild(o), n[l] = s;
|
|
4237
|
-
|
|
4237
|
+
d.label = 1;
|
|
4238
4238
|
case 1:
|
|
4239
4239
|
return r.body ? [3, 3] : [4, dt(50)];
|
|
4240
4240
|
case 2:
|
|
4241
|
-
return
|
|
4241
|
+
return d.sent(), [3, 1];
|
|
4242
4242
|
case 3:
|
|
4243
4243
|
r.body.appendChild(a);
|
|
4244
4244
|
try {
|
|
@@ -4327,54 +4327,54 @@ function xi() {
|
|
|
4327
4327
|
function mr(e) {
|
|
4328
4328
|
return matchMedia("(dynamic-range: ".concat(e, ")")).matches;
|
|
4329
4329
|
}
|
|
4330
|
-
var
|
|
4330
|
+
var j = Math, z = function() {
|
|
4331
4331
|
return 0;
|
|
4332
4332
|
};
|
|
4333
4333
|
function wi() {
|
|
4334
|
-
var e =
|
|
4335
|
-
return
|
|
4336
|
-
},
|
|
4337
|
-
return
|
|
4334
|
+
var e = j.acos || z, t = j.acosh || z, r = j.asin || z, a = j.asinh || z, n = j.atanh || z, i = j.atan || z, s = j.sin || z, o = j.sinh || z, l = j.cos || z, d = j.cosh || z, h = j.tan || z, u = j.tanh || z, p = j.exp || z, f = j.expm1 || z, k = j.log1p || z, v = function(T) {
|
|
4335
|
+
return j.pow(j.PI, T);
|
|
4336
|
+
}, S = function(T) {
|
|
4337
|
+
return j.log(T + j.sqrt(T * T - 1));
|
|
4338
4338
|
}, g = function(T) {
|
|
4339
|
-
return
|
|
4340
|
-
},
|
|
4341
|
-
return
|
|
4342
|
-
},
|
|
4343
|
-
return
|
|
4344
|
-
},
|
|
4345
|
-
return (
|
|
4346
|
-
},
|
|
4347
|
-
return
|
|
4348
|
-
},
|
|
4349
|
-
return (
|
|
4339
|
+
return j.log(T + j.sqrt(T * T + 1));
|
|
4340
|
+
}, w = function(T) {
|
|
4341
|
+
return j.log((1 + T) / (1 - T)) / 2;
|
|
4342
|
+
}, R = function(T) {
|
|
4343
|
+
return j.exp(T) - 1 / j.exp(T) / 2;
|
|
4344
|
+
}, F = function(T) {
|
|
4345
|
+
return (j.exp(T) + 1 / j.exp(T)) / 2;
|
|
4346
|
+
}, $ = function(T) {
|
|
4347
|
+
return j.exp(T) - 1;
|
|
4348
|
+
}, U = function(T) {
|
|
4349
|
+
return (j.exp(2 * T) - 1) / (j.exp(2 * T) + 1);
|
|
4350
4350
|
}, ae = function(T) {
|
|
4351
|
-
return
|
|
4351
|
+
return j.log(1 + T);
|
|
4352
4352
|
};
|
|
4353
4353
|
return {
|
|
4354
4354
|
acos: e(0.12312423423423424),
|
|
4355
4355
|
acosh: t(1e308),
|
|
4356
|
-
acoshPf:
|
|
4356
|
+
acoshPf: S(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: w(0.5),
|
|
4362
4362
|
atan: i(0.5),
|
|
4363
4363
|
sin: s(-1e300),
|
|
4364
4364
|
sinh: o(1),
|
|
4365
|
-
sinhPf:
|
|
4365
|
+
sinhPf: R(1),
|
|
4366
4366
|
cos: l(10.000000000123),
|
|
4367
|
-
cosh:
|
|
4368
|
-
coshPf:
|
|
4369
|
-
tan:
|
|
4370
|
-
tanh:
|
|
4371
|
-
tanhPf:
|
|
4367
|
+
cosh: d(1),
|
|
4368
|
+
coshPf: F(1),
|
|
4369
|
+
tan: h(-1e300),
|
|
4370
|
+
tanh: u(1),
|
|
4371
|
+
tanhPf: U(1),
|
|
4372
4372
|
exp: p(1),
|
|
4373
4373
|
expm1: f(1),
|
|
4374
|
-
expm1Pf:
|
|
4375
|
-
log1p:
|
|
4374
|
+
expm1Pf: $(1),
|
|
4375
|
+
log1p: k(10),
|
|
4376
4376
|
log1pPf: ae(10),
|
|
4377
|
-
powPI:
|
|
4377
|
+
powPI: v(-100)
|
|
4378
4378
|
};
|
|
4379
4379
|
}
|
|
4380
4380
|
var Si = "mmMwWLliI0fiflO&1", bt = {
|
|
@@ -4389,16 +4389,16 @@ var Si = "mmMwWLliI0fiflO&1", bt = {
|
|
|
4389
4389
|
function Ci() {
|
|
4390
4390
|
return Ii(function(e, t) {
|
|
4391
4391
|
for (var r = {}, a = {}, n = 0, i = Object.keys(bt); n < i.length; n++) {
|
|
4392
|
-
var s = i[n], o = bt[s], l = o[0],
|
|
4393
|
-
p.textContent =
|
|
4394
|
-
for (var f = 0,
|
|
4395
|
-
var
|
|
4396
|
-
|
|
4392
|
+
var s = i[n], o = bt[s], l = o[0], d = l === void 0 ? {} : l, h = o[1], u = h === void 0 ? Si : h, p = e.createElement("span");
|
|
4393
|
+
p.textContent = u, p.style.whiteSpace = "nowrap";
|
|
4394
|
+
for (var f = 0, k = Object.keys(d); f < k.length; f++) {
|
|
4395
|
+
var v = k[f], S = d[v];
|
|
4396
|
+
S !== void 0 && (p.style[v] = S);
|
|
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, w = Object.keys(bt); g < w.length; g++) {
|
|
4401
|
+
var s = w[g];
|
|
4402
4402
|
a[s] = r[s].getBoundingClientRect().width;
|
|
4403
4403
|
}
|
|
4404
4404
|
return a;
|
|
@@ -4545,13 +4545,13 @@ function Pi(e) {
|
|
|
4545
4545
|
var t, r, a, n, i, s, o = e.cache, l = qr(o);
|
|
4546
4546
|
if (!l) return Jr;
|
|
4547
4547
|
if (!ta(l)) return Qr;
|
|
4548
|
-
var
|
|
4548
|
+
var d = ea() ? null : l.getExtension(Kr);
|
|
4549
4549
|
return {
|
|
4550
4550
|
version: ((t = l.getParameter(l.VERSION)) === null || t === void 0 ? void 0 : t.toString()) || "",
|
|
4551
4551
|
vendor: ((r = l.getParameter(l.VENDOR)) === null || r === void 0 ? void 0 : r.toString()) || "",
|
|
4552
|
-
vendorUnmasked:
|
|
4552
|
+
vendorUnmasked: d ? (a = l.getParameter(d.UNMASKED_VENDOR_WEBGL)) === null || a === void 0 ? void 0 : a.toString() : "",
|
|
4553
4553
|
renderer: ((n = l.getParameter(l.RENDERER)) === null || n === void 0 ? void 0 : n.toString()) || "",
|
|
4554
|
-
rendererUnmasked:
|
|
4554
|
+
rendererUnmasked: d ? (i = l.getParameter(d.UNMASKED_RENDERER_WEBGL)) === null || i === void 0 ? void 0 : i.toString() : "",
|
|
4555
4555
|
shadingLanguageVersion: ((s = l.getParameter(l.SHADING_LANGUAGE_VERSION)) === null || s === void 0 ? void 0 : s.toString()) || ""
|
|
4556
4556
|
};
|
|
4557
4557
|
}
|
|
@@ -4559,38 +4559,38 @@ function $i(e) {
|
|
|
4559
4559
|
var t = e.cache, r = qr(t);
|
|
4560
4560
|
if (!r) return Jr;
|
|
4561
4561
|
if (!ta(r)) return Qr;
|
|
4562
|
-
var a = r.getSupportedExtensions(), n = r.getContextAttributes(), i = [], s = [], o = [], l = [],
|
|
4563
|
-
if (n) for (var
|
|
4564
|
-
var p = h
|
|
4562
|
+
var a = r.getSupportedExtensions(), n = r.getContextAttributes(), i = [], s = [], o = [], l = [], d = [];
|
|
4563
|
+
if (n) for (var h = 0, u = Object.keys(n); h < u.length; h++) {
|
|
4564
|
+
var p = u[h];
|
|
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), k = 0, v = f; k < v.length; k++) {
|
|
4568
|
+
var S = v[k], g = r[S];
|
|
4569
|
+
o.push("".concat(S, "=").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 w = 0, R = a; w < R.length; w++) {
|
|
4572
|
+
var F = R[w];
|
|
4573
|
+
if (!(F === Kr && ea() || F === Fi && Wi())) {
|
|
4574
|
+
var $ = r.getExtension(F);
|
|
4575
|
+
if (!$) {
|
|
4576
|
+
i.push(F);
|
|
4577
4577
|
continue;
|
|
4578
4578
|
}
|
|
4579
|
-
for (var
|
|
4580
|
-
var
|
|
4581
|
-
l.push("".concat(
|
|
4579
|
+
for (var U = 0, ae = gr($); U < ae.length; U++) {
|
|
4580
|
+
var S = ae[U], g = $[S];
|
|
4581
|
+
l.push("".concat(S, "=").concat(g).concat(ji.has(g) ? "=".concat(r.getParameter(g)) : ""));
|
|
4582
4582
|
}
|
|
4583
4583
|
}
|
|
4584
4584
|
}
|
|
4585
|
-
for (var T = 0,
|
|
4586
|
-
for (var
|
|
4587
|
-
var Ue = Te[ce], pt = Vi(r,
|
|
4588
|
-
|
|
4585
|
+
for (var T = 0, N = Zi; T < N.length; T++)
|
|
4586
|
+
for (var P = N[T], ce = 0, Te = Oi; ce < Te.length; ce++) {
|
|
4587
|
+
var Ue = Te[ce], pt = Vi(r, P, Ue);
|
|
4588
|
+
d.push("".concat(P, ".").concat(Ue, "=").concat(pt.join(",")));
|
|
4589
4589
|
}
|
|
4590
4590
|
return l.sort(), o.sort(), {
|
|
4591
4591
|
contextAttributes: s,
|
|
4592
4592
|
parameters: o,
|
|
4593
|
-
shaderPrecisions:
|
|
4593
|
+
shaderPrecisions: d,
|
|
4594
4594
|
extensions: a,
|
|
4595
4595
|
extensionParameters: l,
|
|
4596
4596
|
unsupportedExtensions: i
|
|
@@ -4959,13 +4959,13 @@ async function* ss(e, t) {
|
|
|
4959
4959
|
const l = n.lastIndexOf(`
|
|
4960
4960
|
`);
|
|
4961
4961
|
if (l === -1) continue;
|
|
4962
|
-
const
|
|
4962
|
+
const d = n.slice(0, l);
|
|
4963
4963
|
n = n.slice(l + 1);
|
|
4964
|
-
for (const
|
|
4964
|
+
for (const h of d.split(`
|
|
4965
4965
|
`)) {
|
|
4966
|
-
const
|
|
4967
|
-
if (!
|
|
4968
|
-
const p =
|
|
4966
|
+
const u = h.trim();
|
|
4967
|
+
if (!u.startsWith("data:")) continue;
|
|
4968
|
+
const p = u.slice(5).trim();
|
|
4969
4969
|
p && (yield p);
|
|
4970
4970
|
}
|
|
4971
4971
|
}
|
|
@@ -4993,86 +4993,86 @@ async function ls(e, t, r, a = {}) {
|
|
|
4993
4993
|
})
|
|
4994
4994
|
});
|
|
4995
4995
|
if (!s.ok || !s.body) {
|
|
4996
|
-
let
|
|
4996
|
+
let h = `${s.status} ${s.statusText}`;
|
|
4997
4997
|
try {
|
|
4998
|
-
const
|
|
4999
|
-
|
|
4998
|
+
const u = await s.json();
|
|
4999
|
+
u.error && (h = u.error);
|
|
5000
5000
|
} catch {
|
|
5001
5001
|
}
|
|
5002
|
-
throw Object.assign(new Error(
|
|
5002
|
+
throw Object.assign(new Error(h), { status: s.status });
|
|
5003
5003
|
}
|
|
5004
5004
|
const o = s.headers.get("x-session-id");
|
|
5005
5005
|
o && r.onSession && r.onSession(o);
|
|
5006
5006
|
const l = s.headers.get("x-run-id");
|
|
5007
5007
|
l && r.onRunId && (i = !0, r.onRunId(l));
|
|
5008
|
-
const
|
|
5009
|
-
if (
|
|
5008
|
+
const d = (h) => {
|
|
5009
|
+
if (h === "[DONE]")
|
|
5010
5010
|
return r.onEnd(n), !0;
|
|
5011
5011
|
try {
|
|
5012
|
-
const
|
|
5013
|
-
if (!i && typeof
|
|
5014
|
-
const f =
|
|
5012
|
+
const u = JSON.parse(h);
|
|
5013
|
+
if (!i && typeof u.runId == "string" && r.onRunId && (i = !0, r.onRunId(u.runId)), u.type === "session") {
|
|
5014
|
+
const f = u.sessionId;
|
|
5015
5015
|
return f && r.onSession && r.onSession(f), !1;
|
|
5016
5016
|
}
|
|
5017
|
-
if (
|
|
5017
|
+
if (u.type === "done" || u.type === "stop")
|
|
5018
5018
|
return r.onEnd(n), !0;
|
|
5019
|
-
if (
|
|
5020
|
-
if (
|
|
5021
|
-
const f =
|
|
5019
|
+
if (u.type === "error") throw new Error(u.message ?? "Stream error");
|
|
5020
|
+
if (u.type === "images") {
|
|
5021
|
+
const f = u.images;
|
|
5022
5022
|
return f && r.onImages && r.onImages(f), !1;
|
|
5023
5023
|
}
|
|
5024
|
-
if (
|
|
5025
|
-
const f =
|
|
5024
|
+
if (u.type === "documents") {
|
|
5025
|
+
const f = u.documents;
|
|
5026
5026
|
return f && r.onDocuments && r.onDocuments(f), !1;
|
|
5027
5027
|
}
|
|
5028
|
-
if (
|
|
5029
|
-
const f =
|
|
5030
|
-
return f && r.onControlMode && r.onControlMode(f,
|
|
5028
|
+
if (u.type === "control_mode") {
|
|
5029
|
+
const f = u.mode, k = !!u.queued;
|
|
5030
|
+
return f && r.onControlMode && r.onControlMode(f, k), k ? (r.onEnd(n), !0) : !1;
|
|
5031
5031
|
}
|
|
5032
|
-
if (
|
|
5033
|
-
const f =
|
|
5032
|
+
if (u.type === "tool_calls_started") {
|
|
5033
|
+
const f = u.toolNames ?? [];
|
|
5034
5034
|
return n.length > 0 && !n.endsWith(`
|
|
5035
5035
|
|
|
5036
5036
|
`) && (n = n.replace(/\s+$/, "") + `
|
|
5037
5037
|
|
|
5038
5038
|
`, r.onDelta(`
|
|
5039
5039
|
|
|
5040
|
-
`, n)), r.onToolCallsStarted?.(f,
|
|
5040
|
+
`, n)), r.onToolCallsStarted?.(f, u.activityMode), !1;
|
|
5041
5041
|
}
|
|
5042
|
-
if (
|
|
5043
|
-
const f =
|
|
5042
|
+
if (u.type === "assistant_ack") {
|
|
5043
|
+
const f = u.text;
|
|
5044
5044
|
return f && r.onAck && r.onAck(f), !1;
|
|
5045
5045
|
}
|
|
5046
|
-
if (
|
|
5047
|
-
const f =
|
|
5048
|
-
return f &&
|
|
5046
|
+
if (u.type === "progress") {
|
|
5047
|
+
const f = u.stage, k = u.text, v = u.mode, S = u.timestamp;
|
|
5048
|
+
return f && k && r.onProgress && r.onProgress(f, k, v, S), !1;
|
|
5049
5049
|
}
|
|
5050
|
-
if (
|
|
5051
|
-
const f =
|
|
5052
|
-
return f &&
|
|
5050
|
+
if (u.type === "tool_start") {
|
|
5051
|
+
const f = u.toolId, k = u.text, v = u.toolName, S = u.mode, g = u.timestamp;
|
|
5052
|
+
return f && k && r.onToolStart && r.onToolStart(f, k, v, S, g), !1;
|
|
5053
5053
|
}
|
|
5054
|
-
if (
|
|
5055
|
-
const f =
|
|
5056
|
-
return f &&
|
|
5054
|
+
if (u.type === "tool_complete") {
|
|
5055
|
+
const f = u.toolId, k = u.text, v = u.durationMs, S = u.ok;
|
|
5056
|
+
return f && k && r.onToolComplete && r.onToolComplete(f, k, v ?? 0, S), !1;
|
|
5057
5057
|
}
|
|
5058
|
-
if (
|
|
5059
|
-
if (
|
|
5060
|
-
const f =
|
|
5058
|
+
if (u.type === "model_start" || u.type === "final_meta") {
|
|
5059
|
+
if (u.type === "final_meta" && r.onFinalMeta) {
|
|
5060
|
+
const f = u.metrics;
|
|
5061
5061
|
r.onFinalMeta(f ?? {}, {
|
|
5062
|
-
mode:
|
|
5063
|
-
collapseAfterFinal:
|
|
5062
|
+
mode: u.mode,
|
|
5063
|
+
collapseAfterFinal: u.collapseAfterFinal
|
|
5064
5064
|
});
|
|
5065
5065
|
}
|
|
5066
5066
|
return !1;
|
|
5067
5067
|
}
|
|
5068
|
-
const p = cs(
|
|
5068
|
+
const p = cs(u);
|
|
5069
5069
|
p && (n += p, r.onDelta(p, n));
|
|
5070
|
-
} catch (
|
|
5071
|
-
if (!(
|
|
5070
|
+
} catch (u) {
|
|
5071
|
+
if (!(u instanceof SyntaxError)) throw u;
|
|
5072
5072
|
}
|
|
5073
5073
|
return !1;
|
|
5074
5074
|
};
|
|
5075
|
-
for await (const
|
|
5075
|
+
for await (const h of ss(s, os)) if (d(h)) break;
|
|
5076
5076
|
r.onEnd(n);
|
|
5077
5077
|
} catch (s) {
|
|
5078
5078
|
r.onError(s instanceof Error ? s : new Error(String(s)));
|
|
@@ -5158,12 +5158,16 @@ function vr(e) {
|
|
|
5158
5158
|
} catch {
|
|
5159
5159
|
}
|
|
5160
5160
|
}
|
|
5161
|
-
function kr(e, t) {
|
|
5162
|
-
return e.map((
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5161
|
+
function kr(e, t, r) {
|
|
5162
|
+
return e.map((a) => {
|
|
5163
|
+
if (a.status !== "active" || a.stage === "calling_tool") return a;
|
|
5164
|
+
const n = r !== void 0 && a.serverTsMs !== void 0 && Number.isFinite(r) && Number.isFinite(a.serverTsMs) && r >= a.serverTsMs ? r - a.serverTsMs : void 0;
|
|
5165
|
+
return {
|
|
5166
|
+
...a,
|
|
5167
|
+
status: "done",
|
|
5168
|
+
durationMs: a.durationMs ?? n ?? (a.startedAtMs ? t - a.startedAtMs : void 0)
|
|
5169
|
+
};
|
|
5170
|
+
});
|
|
5167
5171
|
}
|
|
5168
5172
|
function gs(e) {
|
|
5169
5173
|
const t = Date.now();
|
|
@@ -5397,27 +5401,27 @@ var vs = class {
|
|
|
5397
5401
|
if (this.state.isLoading || !r || this.state.initStatus !== "ready") return;
|
|
5398
5402
|
const a = [];
|
|
5399
5403
|
if (t && t.length > 0) for (const l of t) try {
|
|
5400
|
-
const
|
|
5404
|
+
const d = await ys(l.file);
|
|
5401
5405
|
if (l.kind === "image") {
|
|
5402
|
-
const
|
|
5406
|
+
const h = await this.apiClient.uploadImage(d, l.file.type, l.file.name, this.config.agentId, this.config.tenantId);
|
|
5403
5407
|
a.push({
|
|
5404
|
-
url:
|
|
5408
|
+
url: h.url,
|
|
5405
5409
|
mimeType: l.file.type,
|
|
5406
5410
|
fileName: l.file.name,
|
|
5407
5411
|
kind: "image"
|
|
5408
5412
|
});
|
|
5409
5413
|
} else {
|
|
5410
|
-
const
|
|
5414
|
+
const h = await this.apiClient.uploadFile(d, l.file.type || "application/octet-stream", l.file.name, this.config.agentId, this.config.tenantId);
|
|
5411
5415
|
a.push({
|
|
5412
|
-
url:
|
|
5416
|
+
url: h.url,
|
|
5413
5417
|
mimeType: l.file.type || "application/octet-stream",
|
|
5414
5418
|
fileName: l.file.name,
|
|
5415
5419
|
kind: "file"
|
|
5416
5420
|
});
|
|
5417
5421
|
}
|
|
5418
|
-
} catch (
|
|
5419
|
-
const
|
|
5420
|
-
this.setState({ error:
|
|
5422
|
+
} catch (d) {
|
|
5423
|
+
const h = d instanceof Error ? d.message : "Attachment upload failed";
|
|
5424
|
+
this.setState({ error: h });
|
|
5421
5425
|
return;
|
|
5422
5426
|
}
|
|
5423
5427
|
const n = a.filter((l) => l.kind === "image"), i = {
|
|
@@ -5497,8 +5501,9 @@ var vs = class {
|
|
|
5497
5501
|
status: "streaming"
|
|
5498
5502
|
};
|
|
5499
5503
|
this.setState({ messages: [...this.state.messages, i] }), this.emitter.emit("stream:start");
|
|
5500
|
-
let s = !1, o = !1, l = null,
|
|
5504
|
+
let s = !1, o = !1, l = null, d = null;
|
|
5501
5505
|
const h = Date.now();
|
|
5506
|
+
let u = null;
|
|
5502
5507
|
await ls(this.config.apiBaseUrl, {
|
|
5503
5508
|
agentId: this.config.agentId,
|
|
5504
5509
|
message: e,
|
|
@@ -5526,56 +5531,58 @@ var vs = class {
|
|
|
5526
5531
|
this.updateMessage(n, { documents: p });
|
|
5527
5532
|
},
|
|
5528
5533
|
onToolCallsStarted: (p, f) => {
|
|
5529
|
-
f &&
|
|
5534
|
+
f && l === null && (l = f), u = null, this.updateMessage(n, { answerStartedAtMs: null }), (f ?? l) !== "off" && this.updateMessage(n, { toolStatus: ks(p) });
|
|
5530
5535
|
},
|
|
5531
5536
|
onAck: (p) => {
|
|
5532
5537
|
this.updateMessage(n, { ackText: p });
|
|
5533
5538
|
},
|
|
5534
|
-
onProgress: (p, f, v) => {
|
|
5535
|
-
const
|
|
5536
|
-
|
|
5539
|
+
onProgress: (p, f, k, v) => {
|
|
5540
|
+
const S = this.state.messages.find((F) => F.id === n)?.progressEvents ?? [], g = Date.now(), w = v ? Date.parse(v) : NaN, R = Number.isNaN(w) ? void 0 : w;
|
|
5541
|
+
k && l === null && (l = k, this.updateMessage(n, { turnMeta: {
|
|
5537
5542
|
totalMs: null,
|
|
5538
5543
|
collapseAfterFinal: null,
|
|
5539
|
-
mode:
|
|
5540
|
-
} })), this.updateMessage(n, { progressEvents: [...kr(
|
|
5544
|
+
mode: k
|
|
5545
|
+
} })), this.updateMessage(n, { progressEvents: [...kr(S, g, R), {
|
|
5541
5546
|
stage: p,
|
|
5542
5547
|
text: f,
|
|
5543
5548
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5544
5549
|
status: "active",
|
|
5545
|
-
startedAtMs:
|
|
5550
|
+
startedAtMs: g,
|
|
5551
|
+
serverTsMs: R
|
|
5546
5552
|
}] });
|
|
5547
5553
|
},
|
|
5548
|
-
onToolStart: (p, f, v,
|
|
5549
|
-
const
|
|
5550
|
-
|
|
5554
|
+
onToolStart: (p, f, k, v, S) => {
|
|
5555
|
+
const g = this.state.messages.find(($) => $.id === n)?.progressEvents ?? [], w = Date.now(), R = S ? Date.parse(S) : NaN, F = Number.isNaN(R) ? void 0 : R;
|
|
5556
|
+
v && l === null && (l = v, this.updateMessage(n, { turnMeta: {
|
|
5551
5557
|
totalMs: null,
|
|
5552
5558
|
collapseAfterFinal: null,
|
|
5553
|
-
mode:
|
|
5554
|
-
} })), this.updateMessage(n, { progressEvents: [...kr(
|
|
5559
|
+
mode: v
|
|
5560
|
+
} })), this.updateMessage(n, { progressEvents: [...kr(g, w, F), {
|
|
5555
5561
|
stage: "calling_tool",
|
|
5556
5562
|
toolId: p,
|
|
5557
|
-
toolName:
|
|
5563
|
+
toolName: k,
|
|
5558
5564
|
text: f,
|
|
5559
5565
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5560
5566
|
status: "active",
|
|
5561
|
-
startedAtMs:
|
|
5567
|
+
startedAtMs: w,
|
|
5568
|
+
serverTsMs: F
|
|
5562
5569
|
}] });
|
|
5563
5570
|
},
|
|
5564
|
-
onToolComplete: (p, f,
|
|
5565
|
-
const
|
|
5566
|
-
this.updateMessage(n, { progressEvents:
|
|
5571
|
+
onToolComplete: (p, f, k, v) => {
|
|
5572
|
+
const S = this.state.messages.find((g) => g.id === n)?.progressEvents ?? [];
|
|
5573
|
+
this.updateMessage(n, { progressEvents: S.map((g) => g.stage === "calling_tool" && g.status === "active" && g.toolId === p ? {
|
|
5567
5574
|
...g,
|
|
5568
5575
|
status: "done",
|
|
5569
5576
|
text: f,
|
|
5570
|
-
durationMs:
|
|
5571
|
-
ok:
|
|
5577
|
+
durationMs: k,
|
|
5578
|
+
ok: v
|
|
5572
5579
|
} : g) });
|
|
5573
5580
|
},
|
|
5574
5581
|
onFinalMeta: (p, f) => {
|
|
5575
|
-
l =
|
|
5582
|
+
l = f?.mode ?? l, d = f?.collapseAfterFinal ?? null;
|
|
5576
5583
|
},
|
|
5577
5584
|
onDelta: (p, f) => {
|
|
5578
|
-
f.trim() && (this.updateMessage(n, {
|
|
5585
|
+
p.trim() && u === null && (u = Date.now(), this.updateMessage(n, { answerStartedAtMs: u })), f.trim() && (this.updateMessage(n, {
|
|
5579
5586
|
content: f,
|
|
5580
5587
|
toolStatus: void 0
|
|
5581
5588
|
}), this.emitter.emit("stream:delta", {
|
|
@@ -5592,21 +5599,21 @@ var vs = class {
|
|
|
5592
5599
|
}), this.emitter.emit("stream:end", { content: "" });
|
|
5593
5600
|
return;
|
|
5594
5601
|
}
|
|
5595
|
-
const f = this.state.messages.find((g) => g.id === n),
|
|
5602
|
+
const f = this.state.messages.find((g) => g.id === n), k = l === "detailed", v = k || l === "standard";
|
|
5596
5603
|
this.updateMessage(n, {
|
|
5597
5604
|
content: p,
|
|
5598
5605
|
status: "sent",
|
|
5599
5606
|
toolStatus: void 0,
|
|
5600
|
-
progressEvents:
|
|
5601
|
-
progressCollapsed:
|
|
5602
|
-
turnMeta:
|
|
5603
|
-
totalMs:
|
|
5604
|
-
collapseAfterFinal:
|
|
5605
|
-
mode:
|
|
5607
|
+
progressEvents: k && f?.progressEvents?.length ? gs(f.progressEvents) : void 0,
|
|
5608
|
+
progressCollapsed: k ? d ?? !0 : void 0,
|
|
5609
|
+
turnMeta: v ? {
|
|
5610
|
+
totalMs: (u ?? Date.now()) - h,
|
|
5611
|
+
collapseAfterFinal: d,
|
|
5612
|
+
mode: l
|
|
5606
5613
|
} : void 0
|
|
5607
5614
|
}), this.setState({ isLoading: !1 }), this.emitter.emit("stream:end", { content: p });
|
|
5608
|
-
const
|
|
5609
|
-
|
|
5615
|
+
const S = this.state.messages.find((g) => g.id === n);
|
|
5616
|
+
S && this.emitter.emit("message:received", S);
|
|
5610
5617
|
},
|
|
5611
5618
|
onControlMode: (p, f) => {
|
|
5612
5619
|
f && p === "human" && (o = !0);
|
|
@@ -5620,9 +5627,9 @@ var vs = class {
|
|
|
5620
5627
|
return;
|
|
5621
5628
|
}
|
|
5622
5629
|
const f = (g) => {
|
|
5623
|
-
const
|
|
5630
|
+
const w = this.state.messages.find((R) => R.id === n)?.content ?? "";
|
|
5624
5631
|
this.updateMessage(n, {
|
|
5625
|
-
content:
|
|
5632
|
+
content: w || g,
|
|
5626
5633
|
status: "error"
|
|
5627
5634
|
}), this.setState({
|
|
5628
5635
|
isLoading: !1,
|
|
@@ -5631,19 +5638,19 @@ var vs = class {
|
|
|
5631
5638
|
error: g,
|
|
5632
5639
|
message: null
|
|
5633
5640
|
}), this.reportError(g, { stack: p.stack });
|
|
5634
|
-
},
|
|
5641
|
+
}, k = (g) => {
|
|
5635
5642
|
this.updateMessage(n, {
|
|
5636
5643
|
content: g,
|
|
5637
5644
|
status: "sent",
|
|
5638
5645
|
toolStatus: void 0,
|
|
5639
5646
|
progressEvents: void 0
|
|
5640
5647
|
}), this.setState({ isLoading: !1 }), this.emitter.emit("stream:end", { content: g });
|
|
5641
|
-
const
|
|
5642
|
-
|
|
5643
|
-
},
|
|
5644
|
-
if (
|
|
5645
|
-
hs(this.config.apiBaseUrl,
|
|
5646
|
-
g.status === "done" && g.finalText ?
|
|
5648
|
+
const w = this.state.messages.find((R) => R.id === n);
|
|
5649
|
+
w && this.emitter.emit("message:received", w);
|
|
5650
|
+
}, v = this.state.messages.find((g) => g.id === n)?.runId, S = this.state.sessionId;
|
|
5651
|
+
if (v && S) {
|
|
5652
|
+
hs(this.config.apiBaseUrl, S, v, { preview: this.config.preview }).then((g) => {
|
|
5653
|
+
g.status === "done" && g.finalText ? k(g.finalText) : f(g.errorMessage || p.message || "Something went wrong. Please try again.");
|
|
5647
5654
|
}).catch(() => f(p.message || "Something went wrong. Please try again."));
|
|
5648
5655
|
return;
|
|
5649
5656
|
}
|
|
@@ -5724,51 +5731,51 @@ function Yt(e, t, r, a, n) {
|
|
|
5724
5731
|
let s = !1;
|
|
5725
5732
|
const o = i && n ? Cs(n) : !i && n ? Ss(n) : ws(), l = bs(o);
|
|
5726
5733
|
_s(l.styleSlot, a);
|
|
5727
|
-
const
|
|
5728
|
-
s ||
|
|
5729
|
-
}),
|
|
5730
|
-
onOpen: () =>
|
|
5731
|
-
onClose: () =>
|
|
5734
|
+
const d = new vs(e, t, (p, f) => {
|
|
5735
|
+
s || h.update(p, f);
|
|
5736
|
+
}), h = r(l.mountPoint, e, d.getState(), {
|
|
5737
|
+
onOpen: () => u.open(),
|
|
5738
|
+
onClose: () => u.close(),
|
|
5732
5739
|
onSendMessage: (p, f) => {
|
|
5733
|
-
|
|
5740
|
+
d.sendMessage(p, f);
|
|
5734
5741
|
},
|
|
5735
5742
|
onReset: () => {
|
|
5736
|
-
|
|
5743
|
+
d.resetConversation();
|
|
5737
5744
|
}
|
|
5738
5745
|
});
|
|
5739
|
-
|
|
5740
|
-
s ||
|
|
5746
|
+
d.hydrate(), setTimeout(() => {
|
|
5747
|
+
s || d.emitter.emit("ready", d.getState());
|
|
5741
5748
|
}, 0);
|
|
5742
|
-
const
|
|
5749
|
+
const u = {
|
|
5743
5750
|
open() {
|
|
5744
|
-
s || (
|
|
5751
|
+
s || (d.setOpen(!0), d.emitter.emit("open"));
|
|
5745
5752
|
},
|
|
5746
5753
|
close() {
|
|
5747
|
-
s || (
|
|
5754
|
+
s || (d.setOpen(!1), d.emitter.emit("close"));
|
|
5748
5755
|
},
|
|
5749
5756
|
toggle() {
|
|
5750
|
-
|
|
5757
|
+
d.getState().isOpen ? u.close() : u.open();
|
|
5751
5758
|
},
|
|
5752
5759
|
async sendMessage(p, f) {
|
|
5753
|
-
await
|
|
5760
|
+
await d.sendMessage(p, f);
|
|
5754
5761
|
},
|
|
5755
5762
|
reset() {
|
|
5756
|
-
s || (
|
|
5763
|
+
s || (d.resetConversation(), d.emitter.emit("reset"));
|
|
5757
5764
|
},
|
|
5758
5765
|
destroy() {
|
|
5759
|
-
s || (s = !0,
|
|
5766
|
+
s || (s = !0, d.closeEventStream(), h.destroy(), xs(l.host), i && n ? Ns(n) : Is(o), d.emitter.emit("destroy"), d.emitter.removeAllListeners());
|
|
5760
5767
|
},
|
|
5761
5768
|
on(p, f) {
|
|
5762
|
-
|
|
5769
|
+
d.emitter.on(p, f);
|
|
5763
5770
|
},
|
|
5764
5771
|
off(p, f) {
|
|
5765
|
-
|
|
5772
|
+
d.emitter.off(p, f);
|
|
5766
5773
|
},
|
|
5767
5774
|
getState() {
|
|
5768
|
-
return
|
|
5775
|
+
return d.getState();
|
|
5769
5776
|
}
|
|
5770
5777
|
};
|
|
5771
|
-
return
|
|
5778
|
+
return u;
|
|
5772
5779
|
}
|
|
5773
5780
|
var Ee = /* @__PURE__ */ new Map(), Es = 0;
|
|
5774
5781
|
function Xt(e) {
|
|
@@ -5801,7 +5808,7 @@ function Ts(e, t, r, a) {
|
|
|
5801
5808
|
function As(e) {
|
|
5802
5809
|
e ? Ee.get(e)?.destroy() : (Ee.forEach((t) => t.destroy()), Ee.clear());
|
|
5803
5810
|
}
|
|
5804
|
-
function
|
|
5811
|
+
function Ko() {
|
|
5805
5812
|
return Array.from(Ee.keys());
|
|
5806
5813
|
}
|
|
5807
5814
|
function Rs(e) {
|
|
@@ -5846,6 +5853,9 @@ var Zs = `
|
|
|
5846
5853
|
--ak-pattern-size: 210px;
|
|
5847
5854
|
--ak-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.08);
|
|
5848
5855
|
--ak-launcher-size: 56px;
|
|
5856
|
+
/* Panel-to-launcher offset. Negative pulls the launcher up toward the panel.
|
|
5857
|
+
Applied as a margin on .ak-shell-wrap because CSS gap rejects negatives. */
|
|
5858
|
+
--ak-launcher-gap: -12px;
|
|
5849
5859
|
font-family: var(--ak-font);
|
|
5850
5860
|
-webkit-font-smoothing: antialiased;
|
|
5851
5861
|
}
|
|
@@ -5874,7 +5884,7 @@ var Zs = `
|
|
|
5874
5884
|
display: flex;
|
|
5875
5885
|
flex-direction: column;
|
|
5876
5886
|
align-items: flex-end;
|
|
5877
|
-
gap:
|
|
5887
|
+
gap: 0;
|
|
5878
5888
|
pointer-events: none;
|
|
5879
5889
|
}
|
|
5880
5890
|
.ak-floating > * {
|
|
@@ -5936,6 +5946,7 @@ var Zs = `
|
|
|
5936
5946
|
display: flex;
|
|
5937
5947
|
flex-direction: column;
|
|
5938
5948
|
align-items: flex-start;
|
|
5949
|
+
margin-bottom: var(--ak-launcher-gap);
|
|
5939
5950
|
}
|
|
5940
5951
|
|
|
5941
5952
|
/* ── Widget shell / panel ────────────────────────────────────── */
|
|
@@ -5968,6 +5979,8 @@ var Zs = `
|
|
|
5968
5979
|
.ak-inline .ak-shell-wrap {
|
|
5969
5980
|
width: 100%;
|
|
5970
5981
|
height: 100%;
|
|
5982
|
+
/* No launcher in inline mode — the negative offset would overflow the host. */
|
|
5983
|
+
margin-bottom: 0;
|
|
5971
5984
|
}
|
|
5972
5985
|
.ak-inline .ak-header {
|
|
5973
5986
|
display: none;
|
|
@@ -5986,7 +5999,7 @@ var Zs = `
|
|
|
5986
5999
|
flex-direction: row;
|
|
5987
6000
|
align-items: center;
|
|
5988
6001
|
justify-content: space-between;
|
|
5989
|
-
padding: 14px
|
|
6002
|
+
padding: 10px 14px;
|
|
5990
6003
|
background: var(--ak-accent);
|
|
5991
6004
|
color: #fff;
|
|
5992
6005
|
flex-shrink: 0;
|
|
@@ -6171,10 +6184,10 @@ var Zs = `
|
|
|
6171
6184
|
.ak-messages {
|
|
6172
6185
|
flex: 1;
|
|
6173
6186
|
overflow-y: auto;
|
|
6174
|
-
padding:
|
|
6187
|
+
padding: 12px;
|
|
6175
6188
|
display: flex;
|
|
6176
6189
|
flex-direction: column;
|
|
6177
|
-
gap:
|
|
6190
|
+
gap: 8px;
|
|
6178
6191
|
scroll-behavior: smooth;
|
|
6179
6192
|
min-height: 0; /* Allow flex child to shrink below its content height */
|
|
6180
6193
|
/* Faint doodle texture so bubbles read as objects on a surface, not floating on flat colour.
|
|
@@ -6197,8 +6210,8 @@ var Zs = `
|
|
|
6197
6210
|
display: flex;
|
|
6198
6211
|
flex-direction: column;
|
|
6199
6212
|
align-items: center;
|
|
6200
|
-
justify-content: center;
|
|
6201
|
-
padding:
|
|
6213
|
+
justify-content: safe center;
|
|
6214
|
+
padding: 16px;
|
|
6202
6215
|
text-align: center;
|
|
6203
6216
|
gap: 16px;
|
|
6204
6217
|
overflow-y: auto;
|
|
@@ -6322,7 +6335,7 @@ var Zs = `
|
|
|
6322
6335
|
.ak-message {
|
|
6323
6336
|
display: flex;
|
|
6324
6337
|
flex-direction: column;
|
|
6325
|
-
max-width:
|
|
6338
|
+
max-width: 86%;
|
|
6326
6339
|
animation: ak-msg-in 0.15s ease-out;
|
|
6327
6340
|
}
|
|
6328
6341
|
@keyframes ak-msg-in {
|
|
@@ -6338,7 +6351,7 @@ var Zs = `
|
|
|
6338
6351
|
align-items: flex-start;
|
|
6339
6352
|
}
|
|
6340
6353
|
.ak-message__bubble {
|
|
6341
|
-
padding:
|
|
6354
|
+
padding: 8px 12px;
|
|
6342
6355
|
border-radius: 16px;
|
|
6343
6356
|
font-size: 14px;
|
|
6344
6357
|
line-height: 1.55;
|
|
@@ -6371,11 +6384,16 @@ var Zs = `
|
|
|
6371
6384
|
border: 1px solid color-mix(in srgb, var(--ak-accent) 22%, var(--ak-border));
|
|
6372
6385
|
}
|
|
6373
6386
|
.ak-message__time {
|
|
6387
|
+
display: block;
|
|
6388
|
+
text-align: right;
|
|
6374
6389
|
font-size: 11px;
|
|
6375
6390
|
color: var(--ak-text-muted);
|
|
6376
|
-
margin-top:
|
|
6391
|
+
margin-top: 2px;
|
|
6377
6392
|
padding: 0 4px;
|
|
6378
6393
|
}
|
|
6394
|
+
.ak-message--user .ak-message__time {
|
|
6395
|
+
color: rgba(255, 255, 255, 0.7);
|
|
6396
|
+
}
|
|
6379
6397
|
.ak-message__sender-label {
|
|
6380
6398
|
font-size: 11px;
|
|
6381
6399
|
font-weight: 500;
|
|
@@ -6600,7 +6618,7 @@ var Zs = `
|
|
|
6600
6618
|
display: flex;
|
|
6601
6619
|
flex-direction: column;
|
|
6602
6620
|
gap: 6px;
|
|
6603
|
-
padding: 10px
|
|
6621
|
+
padding: 8px 10px 4px;
|
|
6604
6622
|
}
|
|
6605
6623
|
.ak-message__bubble--has-image .ak-message__files {
|
|
6606
6624
|
padding: 8px 8px 4px;
|
|
@@ -6823,7 +6841,7 @@ var Zs = `
|
|
|
6823
6841
|
|
|
6824
6842
|
/* Caption / text below the image, inside the same bubble */
|
|
6825
6843
|
.ak-message__image-caption {
|
|
6826
|
-
padding: 8px
|
|
6844
|
+
padding: 8px 10px 8px;
|
|
6827
6845
|
font-size: 14px;
|
|
6828
6846
|
font-style: normal;
|
|
6829
6847
|
color: var(--ak-text);
|
|
@@ -6841,7 +6859,7 @@ var Zs = `
|
|
|
6841
6859
|
display: flex;
|
|
6842
6860
|
align-items: center;
|
|
6843
6861
|
gap: 5px;
|
|
6844
|
-
padding:
|
|
6862
|
+
padding: 9px 12px;
|
|
6845
6863
|
background: var(--ak-bot-bg);
|
|
6846
6864
|
border-radius: 16px;
|
|
6847
6865
|
border-bottom-left-radius: 4px;
|
|
@@ -6894,7 +6912,7 @@ var Zs = `
|
|
|
6894
6912
|
/* ── Composer ────────────────────────────────────────────────── */
|
|
6895
6913
|
.ak-composer {
|
|
6896
6914
|
position: relative; /* establishes positioning context for the attachment submenu */
|
|
6897
|
-
padding:
|
|
6915
|
+
padding: 8px 12px 10px;
|
|
6898
6916
|
border-top: 1px solid var(--ak-border);
|
|
6899
6917
|
display: flex;
|
|
6900
6918
|
flex-direction: column;
|
|
@@ -6961,7 +6979,7 @@ var Zs = `
|
|
|
6961
6979
|
.ak-composer__attach-menu {
|
|
6962
6980
|
position: absolute;
|
|
6963
6981
|
bottom: calc(100% + 6px);
|
|
6964
|
-
left:
|
|
6982
|
+
left: 12px;
|
|
6965
6983
|
background: var(--ak-surface);
|
|
6966
6984
|
border: 1px solid var(--ak-border);
|
|
6967
6985
|
border-radius: 10px;
|
|
@@ -7622,7 +7640,7 @@ var Zs = `
|
|
|
7622
7640
|
display: inline-flex;
|
|
7623
7641
|
align-items: center;
|
|
7624
7642
|
gap: 4px;
|
|
7625
|
-
padding:
|
|
7643
|
+
padding: 3px 8px 4px;
|
|
7626
7644
|
background: var(--ak-bg);
|
|
7627
7645
|
border: 1px solid var(--ak-border);
|
|
7628
7646
|
border-top: none;
|
|
@@ -7682,6 +7700,8 @@ var Zs = `
|
|
|
7682
7700
|
min-height: 0;
|
|
7683
7701
|
width: 100%;
|
|
7684
7702
|
align-items: stretch;
|
|
7703
|
+
/* Launcher is hidden here — the negative offset would leave a dead strip. */
|
|
7704
|
+
margin-bottom: 0;
|
|
7685
7705
|
}
|
|
7686
7706
|
|
|
7687
7707
|
:host([data-open]) .ak-shell--floating {
|
|
@@ -7719,26 +7739,26 @@ function Os() {
|
|
|
7719
7739
|
strokeLinecap: "round",
|
|
7720
7740
|
strokeLinejoin: "round",
|
|
7721
7741
|
children: [
|
|
7722
|
-
/* @__PURE__ */
|
|
7742
|
+
/* @__PURE__ */ c("rect", {
|
|
7723
7743
|
x: "3",
|
|
7724
7744
|
y: "11",
|
|
7725
7745
|
width: "18",
|
|
7726
7746
|
height: "10",
|
|
7727
7747
|
rx: "2"
|
|
7728
7748
|
}),
|
|
7729
|
-
/* @__PURE__ */
|
|
7749
|
+
/* @__PURE__ */ c("circle", {
|
|
7730
7750
|
cx: "12",
|
|
7731
7751
|
cy: "5",
|
|
7732
7752
|
r: "2"
|
|
7733
7753
|
}),
|
|
7734
|
-
/* @__PURE__ */
|
|
7735
|
-
/* @__PURE__ */
|
|
7754
|
+
/* @__PURE__ */ c("path", { d: "M12 7v4" }),
|
|
7755
|
+
/* @__PURE__ */ c("line", {
|
|
7736
7756
|
x1: "8",
|
|
7737
7757
|
y1: "16",
|
|
7738
7758
|
x2: "8",
|
|
7739
7759
|
y2: "16"
|
|
7740
7760
|
}),
|
|
7741
|
-
/* @__PURE__ */
|
|
7761
|
+
/* @__PURE__ */ c("line", {
|
|
7742
7762
|
x1: "16",
|
|
7743
7763
|
y1: "16",
|
|
7744
7764
|
x2: "16",
|
|
@@ -7756,12 +7776,12 @@ function Fs() {
|
|
|
7756
7776
|
stroke: "currentColor",
|
|
7757
7777
|
strokeWidth: "2.5",
|
|
7758
7778
|
strokeLinecap: "round",
|
|
7759
|
-
children: [/* @__PURE__ */
|
|
7779
|
+
children: [/* @__PURE__ */ c("line", {
|
|
7760
7780
|
x1: "18",
|
|
7761
7781
|
y1: "6",
|
|
7762
7782
|
x2: "6",
|
|
7763
7783
|
y2: "18"
|
|
7764
|
-
}), /* @__PURE__ */
|
|
7784
|
+
}), /* @__PURE__ */ c("line", {
|
|
7765
7785
|
x1: "6",
|
|
7766
7786
|
y1: "6",
|
|
7767
7787
|
x2: "18",
|
|
@@ -7779,7 +7799,7 @@ function Ps() {
|
|
|
7779
7799
|
strokeWidth: "2",
|
|
7780
7800
|
strokeLinecap: "round",
|
|
7781
7801
|
strokeLinejoin: "round",
|
|
7782
|
-
children: [/* @__PURE__ */
|
|
7802
|
+
children: [/* @__PURE__ */ c("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), /* @__PURE__ */ c("path", { d: "M3 3v5h5" })]
|
|
7783
7803
|
});
|
|
7784
7804
|
}
|
|
7785
7805
|
function $s({ title: e, subtitle: t, avatarUrl: r, onClose: a, onReset: n, hideClose: i = !1 }) {
|
|
@@ -7789,22 +7809,22 @@ function $s({ title: e, subtitle: t, avatarUrl: r, onClose: a, onReset: n, hideC
|
|
|
7789
7809
|
children: [/* @__PURE__ */ y("div", {
|
|
7790
7810
|
className: "ak-header__row",
|
|
7791
7811
|
children: [
|
|
7792
|
-
r ? /* @__PURE__ */
|
|
7812
|
+
r ? /* @__PURE__ */ c("img", {
|
|
7793
7813
|
src: r,
|
|
7794
7814
|
alt: "",
|
|
7795
7815
|
className: "ak-header__avatar",
|
|
7796
7816
|
"aria-hidden": "true"
|
|
7797
|
-
}) : /* @__PURE__ */
|
|
7817
|
+
}) : /* @__PURE__ */ c("span", {
|
|
7798
7818
|
className: "ak-header__bot-icon",
|
|
7799
7819
|
"aria-hidden": "true",
|
|
7800
|
-
children: /* @__PURE__ */
|
|
7820
|
+
children: /* @__PURE__ */ c(Os, {})
|
|
7801
7821
|
}),
|
|
7802
7822
|
/* @__PURE__ */ y("div", {
|
|
7803
7823
|
className: "ak-header__title-group",
|
|
7804
|
-
children: [/* @__PURE__ */
|
|
7824
|
+
children: [/* @__PURE__ */ c("span", {
|
|
7805
7825
|
className: "ak-header__title",
|
|
7806
7826
|
children: e
|
|
7807
|
-
}), t && /* @__PURE__ */
|
|
7827
|
+
}), t && /* @__PURE__ */ c("span", {
|
|
7808
7828
|
className: "ak-header__subtitle",
|
|
7809
7829
|
children: t
|
|
7810
7830
|
})]
|
|
@@ -7816,24 +7836,24 @@ function $s({ title: e, subtitle: t, avatarUrl: r, onClose: a, onReset: n, hideC
|
|
|
7816
7836
|
gap: "8px"
|
|
7817
7837
|
},
|
|
7818
7838
|
children: [
|
|
7819
|
-
/* @__PURE__ */
|
|
7839
|
+
/* @__PURE__ */ c("span", {
|
|
7820
7840
|
className: "ak-header__status",
|
|
7821
7841
|
"aria-hidden": "true"
|
|
7822
7842
|
}),
|
|
7823
|
-
n && /* @__PURE__ */
|
|
7843
|
+
n && /* @__PURE__ */ c("button", {
|
|
7824
7844
|
className: `ak-header__button${s ? " ak-header__button--active" : ""}`,
|
|
7825
7845
|
onClick: () => o(!0),
|
|
7826
7846
|
"aria-label": "New conversation",
|
|
7827
7847
|
type: "button",
|
|
7828
7848
|
title: "Start a new conversation (Retains current conversation to memory)",
|
|
7829
|
-
children: /* @__PURE__ */
|
|
7849
|
+
children: /* @__PURE__ */ c(Ps, {})
|
|
7830
7850
|
}),
|
|
7831
|
-
!i && /* @__PURE__ */
|
|
7851
|
+
!i && /* @__PURE__ */ c("button", {
|
|
7832
7852
|
className: "ak-header__close",
|
|
7833
7853
|
onClick: a,
|
|
7834
7854
|
"aria-label": "Close chat",
|
|
7835
7855
|
type: "button",
|
|
7836
|
-
children: /* @__PURE__ */
|
|
7856
|
+
children: /* @__PURE__ */ c(Fs, {})
|
|
7837
7857
|
})
|
|
7838
7858
|
]
|
|
7839
7859
|
})
|
|
@@ -7843,21 +7863,21 @@ function $s({ title: e, subtitle: t, avatarUrl: r, onClose: a, onReset: n, hideC
|
|
|
7843
7863
|
role: "alert",
|
|
7844
7864
|
children: [/* @__PURE__ */ y("div", {
|
|
7845
7865
|
className: "ak-header__confirm-text",
|
|
7846
|
-
children: [/* @__PURE__ */
|
|
7866
|
+
children: [/* @__PURE__ */ c("span", {
|
|
7847
7867
|
className: "ak-header__confirm-title",
|
|
7848
7868
|
children: "End this conversation?"
|
|
7849
|
-
}), /* @__PURE__ */
|
|
7869
|
+
}), /* @__PURE__ */ c("span", {
|
|
7850
7870
|
className: "ak-header__confirm-sub",
|
|
7851
7871
|
children: "All messages will be removed"
|
|
7852
7872
|
})]
|
|
7853
7873
|
}), /* @__PURE__ */ y("div", {
|
|
7854
7874
|
className: "ak-header__confirm-actions",
|
|
7855
|
-
children: [/* @__PURE__ */
|
|
7875
|
+
children: [/* @__PURE__ */ c("button", {
|
|
7856
7876
|
className: "ak-header__confirm-cancel",
|
|
7857
7877
|
type: "button",
|
|
7858
7878
|
onClick: () => o(!1),
|
|
7859
7879
|
children: "Cancel"
|
|
7860
|
-
}), /* @__PURE__ */
|
|
7880
|
+
}), /* @__PURE__ */ c("button", {
|
|
7861
7881
|
className: "ak-header__confirm-ok",
|
|
7862
7882
|
type: "button",
|
|
7863
7883
|
onClick: () => {
|
|
@@ -7882,6 +7902,11 @@ function $e(e) {
|
|
|
7882
7902
|
"tel"
|
|
7883
7903
|
].includes(r) ? t : null : t;
|
|
7884
7904
|
}
|
|
7905
|
+
function Vs(e) {
|
|
7906
|
+
return e.replace(/\\text\{([^}]*)\}/g, "$1").replace(/\\implies/g, "→").replace(/\\Rightarrow/g, "⟹").replace(/\\times/g, "×").replace(/\\div/g, "÷").replace(/\\cdot/g, "·").replace(/\\quad/g, " ").replace(/\\qquad/g, " ").replace(/\\leq/g, "≤").replace(/\\geq/g, "≥").replace(/\\neq/g, "≠").replace(/\\approx/g, "≈").replace(/\\infty/g, "∞").replace(/\\\((.+?)\\\)/gs, "$1").replace(/\\\[[\s\S]+?\\\]/g, "").replace(/\\\$/g, "\0DOLLAR\0").replace(/\$\$(?!\d)[\s\S]+?\$\$/g, "").replace(/\$(?![\s\d])([^$\n]+?)(?<!\s)\$/g, "$1").replace(/\x00DOLLAR\x00/g, "$").replace(/\\[a-zA-Z]+\*?/g, "").replace(/\n{3,}/g, `
|
|
7907
|
+
|
|
7908
|
+
`);
|
|
7909
|
+
}
|
|
7885
7910
|
function ia(e) {
|
|
7886
7911
|
const [, t] = ne(0);
|
|
7887
7912
|
X(() => {
|
|
@@ -7890,9 +7915,9 @@ function ia(e) {
|
|
|
7890
7915
|
return () => clearInterval(r);
|
|
7891
7916
|
}, [e]);
|
|
7892
7917
|
}
|
|
7893
|
-
var
|
|
7894
|
-
function
|
|
7895
|
-
return /* @__PURE__ */
|
|
7918
|
+
var zs = 800;
|
|
7919
|
+
function Ws({ up: e }) {
|
|
7920
|
+
return /* @__PURE__ */ c("svg", {
|
|
7896
7921
|
width: "10",
|
|
7897
7922
|
height: "10",
|
|
7898
7923
|
viewBox: "0 0 24 24",
|
|
@@ -7902,14 +7927,14 @@ function zs({ up: e }) {
|
|
|
7902
7927
|
strokeLinecap: "round",
|
|
7903
7928
|
strokeLinejoin: "round",
|
|
7904
7929
|
"aria-hidden": "true",
|
|
7905
|
-
children: /* @__PURE__ */
|
|
7930
|
+
children: /* @__PURE__ */ c("polyline", { points: e ? "18 15 12 9 6 15" : "6 9 12 15 18 9" })
|
|
7906
7931
|
});
|
|
7907
7932
|
}
|
|
7908
7933
|
function ht({ event: e, active: t }) {
|
|
7909
|
-
return t ? /* @__PURE__ */
|
|
7934
|
+
return t ? /* @__PURE__ */ c("span", {
|
|
7910
7935
|
className: "ak-progress__spinner",
|
|
7911
7936
|
"aria-hidden": "true"
|
|
7912
|
-
}) : /* @__PURE__ */
|
|
7937
|
+
}) : /* @__PURE__ */ c("svg", {
|
|
7913
7938
|
className: e.ok === !1 ? "ak-progress__step-icon ak-progress__step-icon--fail" : "ak-progress__step-icon",
|
|
7914
7939
|
width: "11",
|
|
7915
7940
|
height: "11",
|
|
@@ -7920,121 +7945,125 @@ function ht({ event: e, active: t }) {
|
|
|
7920
7945
|
strokeLinecap: "round",
|
|
7921
7946
|
strokeLinejoin: "round",
|
|
7922
7947
|
"aria-hidden": "true",
|
|
7923
|
-
children: e.ok === !1 ? /* @__PURE__ */ y(
|
|
7948
|
+
children: e.ok === !1 ? /* @__PURE__ */ y(ye, { children: [/* @__PURE__ */ c("line", {
|
|
7924
7949
|
x1: "18",
|
|
7925
7950
|
y1: "6",
|
|
7926
7951
|
x2: "6",
|
|
7927
7952
|
y2: "18"
|
|
7928
|
-
}), /* @__PURE__ */
|
|
7953
|
+
}), /* @__PURE__ */ c("line", {
|
|
7929
7954
|
x1: "6",
|
|
7930
7955
|
y1: "6",
|
|
7931
7956
|
x2: "18",
|
|
7932
7957
|
y2: "18"
|
|
7933
|
-
})] }) : /* @__PURE__ */
|
|
7958
|
+
})] }) : /* @__PURE__ */ c("polyline", { points: "20 6 9 17 4 12" })
|
|
7934
7959
|
});
|
|
7935
7960
|
}
|
|
7936
|
-
function yr({ events: e, live: t }) {
|
|
7937
|
-
ia(t && e.some((
|
|
7938
|
-
const
|
|
7939
|
-
return /* @__PURE__ */
|
|
7961
|
+
function yr({ events: e, live: t, answerStartedAtMs: r }) {
|
|
7962
|
+
ia(t && !r && e.some((s) => s.status === "active"));
|
|
7963
|
+
const a = r ?? Date.now(), n = e[0]?.startedAtMs, i = e.reduce((s, o, l) => o.status === "active" ? l : s, -1);
|
|
7964
|
+
return /* @__PURE__ */ c("ul", {
|
|
7940
7965
|
className: "ak-progress__steps",
|
|
7941
7966
|
role: "list",
|
|
7942
|
-
children: e.map((
|
|
7943
|
-
const
|
|
7967
|
+
children: e.map((s, o) => {
|
|
7968
|
+
const l = t && s.status === "active", d = l && o === i ? ut(n ? a - n : void 0) : l ? null : ut(s.durationMs);
|
|
7944
7969
|
return /* @__PURE__ */ y("li", {
|
|
7945
|
-
className:
|
|
7970
|
+
className: l ? "ak-progress__step ak-progress__step--active" : "ak-progress__step",
|
|
7946
7971
|
children: [
|
|
7947
|
-
/* @__PURE__ */
|
|
7948
|
-
event:
|
|
7949
|
-
active:
|
|
7972
|
+
/* @__PURE__ */ c(ht, {
|
|
7973
|
+
event: s,
|
|
7974
|
+
active: l
|
|
7950
7975
|
}),
|
|
7951
|
-
/* @__PURE__ */
|
|
7976
|
+
/* @__PURE__ */ c("span", {
|
|
7952
7977
|
className: "ak-progress__step-text",
|
|
7953
|
-
children:
|
|
7978
|
+
children: s.text
|
|
7954
7979
|
}),
|
|
7955
|
-
|
|
7980
|
+
d && /* @__PURE__ */ y("span", {
|
|
7956
7981
|
className: "ak-progress__step-dur",
|
|
7957
|
-
children: ["· ",
|
|
7982
|
+
children: ["· ", d]
|
|
7958
7983
|
})
|
|
7959
7984
|
]
|
|
7960
|
-
}, `${
|
|
7985
|
+
}, `${s.toolId ?? s.stage}-${o}`);
|
|
7961
7986
|
})
|
|
7962
7987
|
});
|
|
7963
7988
|
}
|
|
7964
|
-
function
|
|
7965
|
-
const [
|
|
7989
|
+
function Ds({ events: e, answerStartedAtMs: t }) {
|
|
7990
|
+
const [r, a] = ne(0), n = Math.min(r, e.length - 1), i = n < e.length - 1;
|
|
7966
7991
|
X(() => {
|
|
7967
|
-
if (!
|
|
7968
|
-
const
|
|
7969
|
-
return () => clearTimeout(
|
|
7992
|
+
if (!i) return;
|
|
7993
|
+
const h = setTimeout(() => a((u) => Math.min(u + 1, e.length - 1)), zs);
|
|
7994
|
+
return () => clearTimeout(h);
|
|
7970
7995
|
}, [
|
|
7996
|
+
i,
|
|
7971
7997
|
n,
|
|
7972
|
-
a,
|
|
7973
7998
|
e.length
|
|
7974
7999
|
]);
|
|
7975
|
-
const
|
|
7976
|
-
ia(!
|
|
7977
|
-
const
|
|
7978
|
-
return /* @__PURE__ */
|
|
8000
|
+
const s = e[n], o = !i && s.status === "done";
|
|
8001
|
+
ia(!o && !t);
|
|
8002
|
+
const l = e[0]?.startedAtMs, d = o ? null : ut(l ? (t ?? Date.now()) - l : void 0);
|
|
8003
|
+
return /* @__PURE__ */ c("ul", {
|
|
7979
8004
|
className: "ak-progress__list",
|
|
7980
8005
|
role: "list",
|
|
7981
8006
|
children: /* @__PURE__ */ y("li", {
|
|
7982
8007
|
className: "ak-progress__item ak-progress__item--active",
|
|
7983
8008
|
children: [
|
|
7984
|
-
|
|
7985
|
-
event:
|
|
8009
|
+
o ? /* @__PURE__ */ c(ht, {
|
|
8010
|
+
event: s,
|
|
7986
8011
|
active: !1
|
|
7987
|
-
}) : /* @__PURE__ */
|
|
8012
|
+
}) : /* @__PURE__ */ c("span", {
|
|
7988
8013
|
className: "ak-progress__spinner",
|
|
7989
8014
|
"aria-hidden": "true"
|
|
7990
8015
|
}),
|
|
7991
|
-
/* @__PURE__ */
|
|
8016
|
+
/* @__PURE__ */ c("span", {
|
|
7992
8017
|
className: "ak-progress__text",
|
|
7993
|
-
children:
|
|
8018
|
+
children: s.text
|
|
7994
8019
|
}),
|
|
7995
|
-
|
|
8020
|
+
d && /* @__PURE__ */ y("span", {
|
|
7996
8021
|
className: "ak-progress__step-dur",
|
|
7997
|
-
children: ["· ",
|
|
8022
|
+
children: ["· ", d]
|
|
7998
8023
|
})
|
|
7999
8024
|
]
|
|
8000
8025
|
})
|
|
8001
8026
|
});
|
|
8002
8027
|
}
|
|
8003
|
-
function
|
|
8004
|
-
const [
|
|
8028
|
+
function Us({ ackText: e, events: t = [], collapsed: r = !0, isComplete: a = !1, turnMeta: n, answerStartedAtMs: i }) {
|
|
8029
|
+
const [s, o] = ne(!r);
|
|
8005
8030
|
X(() => {
|
|
8006
|
-
a &&
|
|
8031
|
+
a && o(!r);
|
|
8007
8032
|
}, [a]);
|
|
8008
|
-
const
|
|
8033
|
+
const l = n?.mode;
|
|
8009
8034
|
if (!a)
|
|
8010
|
-
return t.length === 0 ? e ? /* @__PURE__ */
|
|
8035
|
+
return t.length === 0 ? e ? /* @__PURE__ */ c("ul", {
|
|
8011
8036
|
className: "ak-progress__list",
|
|
8012
8037
|
role: "list",
|
|
8013
8038
|
children: /* @__PURE__ */ y("li", {
|
|
8014
8039
|
className: "ak-progress__item ak-progress__item--active",
|
|
8015
|
-
children: [/* @__PURE__ */
|
|
8040
|
+
children: [/* @__PURE__ */ c("span", {
|
|
8016
8041
|
className: "ak-progress__spinner",
|
|
8017
8042
|
"aria-hidden": "true"
|
|
8018
|
-
}), /* @__PURE__ */
|
|
8043
|
+
}), /* @__PURE__ */ c("span", {
|
|
8019
8044
|
className: "ak-progress__text",
|
|
8020
8045
|
children: e
|
|
8021
8046
|
})]
|
|
8022
8047
|
})
|
|
8023
|
-
}) : null :
|
|
8048
|
+
}) : null : l === "detailed" ? /* @__PURE__ */ c(yr, {
|
|
8049
|
+
events: t,
|
|
8050
|
+
live: !0,
|
|
8051
|
+
answerStartedAtMs: i
|
|
8052
|
+
}) : /* @__PURE__ */ c(Ds, {
|
|
8024
8053
|
events: t,
|
|
8025
|
-
|
|
8026
|
-
})
|
|
8027
|
-
const
|
|
8028
|
-
return
|
|
8054
|
+
answerStartedAtMs: i
|
|
8055
|
+
});
|
|
8056
|
+
const d = ut(n?.totalMs), h = d ? `Worked for ${d}` : "Finished working";
|
|
8057
|
+
return l === "detailed" && t.length > 0 ? /* @__PURE__ */ y("div", {
|
|
8029
8058
|
className: "ak-progress",
|
|
8030
8059
|
children: [/* @__PURE__ */ y("button", {
|
|
8031
8060
|
type: "button",
|
|
8032
|
-
onClick: () =>
|
|
8061
|
+
onClick: () => o((u) => !u),
|
|
8033
8062
|
className: "ak-progress__summary",
|
|
8034
|
-
"aria-expanded":
|
|
8035
|
-
"aria-label":
|
|
8063
|
+
"aria-expanded": s,
|
|
8064
|
+
"aria-label": s ? "Hide working steps" : "Show working steps",
|
|
8036
8065
|
children: [
|
|
8037
|
-
/* @__PURE__ */
|
|
8066
|
+
/* @__PURE__ */ c(ht, {
|
|
8038
8067
|
event: {
|
|
8039
8068
|
stage: "",
|
|
8040
8069
|
text: "",
|
|
@@ -8043,7 +8072,7 @@ function Ds({ ackText: e, events: t = [], collapsed: r = !0, isComplete: a = !1,
|
|
|
8043
8072
|
},
|
|
8044
8073
|
active: !1
|
|
8045
8074
|
}),
|
|
8046
|
-
/* @__PURE__ */
|
|
8075
|
+
/* @__PURE__ */ c("span", { children: h }),
|
|
8047
8076
|
/* @__PURE__ */ y("span", {
|
|
8048
8077
|
className: "ak-progress__step-dur",
|
|
8049
8078
|
children: [
|
|
@@ -8053,17 +8082,17 @@ function Ds({ ackText: e, events: t = [], collapsed: r = !0, isComplete: a = !1,
|
|
|
8053
8082
|
t.length === 1 ? "" : "s"
|
|
8054
8083
|
]
|
|
8055
8084
|
}),
|
|
8056
|
-
/* @__PURE__ */
|
|
8085
|
+
/* @__PURE__ */ c(Ws, { up: s })
|
|
8057
8086
|
]
|
|
8058
|
-
}),
|
|
8087
|
+
}), s && /* @__PURE__ */ c(yr, {
|
|
8059
8088
|
events: t,
|
|
8060
8089
|
live: !1
|
|
8061
8090
|
})]
|
|
8062
|
-
}) :
|
|
8091
|
+
}) : l === "standard" && n ? /* @__PURE__ */ c("div", {
|
|
8063
8092
|
className: "ak-progress",
|
|
8064
8093
|
children: /* @__PURE__ */ y("p", {
|
|
8065
8094
|
className: "ak-progress__summary ak-progress__summary--static",
|
|
8066
|
-
children: [/* @__PURE__ */
|
|
8095
|
+
children: [/* @__PURE__ */ c(ht, {
|
|
8067
8096
|
event: {
|
|
8068
8097
|
stage: "",
|
|
8069
8098
|
text: "",
|
|
@@ -8071,27 +8100,27 @@ function Ds({ ackText: e, events: t = [], collapsed: r = !0, isComplete: a = !1,
|
|
|
8071
8100
|
status: "done"
|
|
8072
8101
|
},
|
|
8073
8102
|
active: !1
|
|
8074
|
-
}), /* @__PURE__ */
|
|
8103
|
+
}), /* @__PURE__ */ c("span", { children: h })]
|
|
8075
8104
|
})
|
|
8076
8105
|
}) : null;
|
|
8077
8106
|
}
|
|
8078
|
-
function
|
|
8079
|
-
return /* @__PURE__ */
|
|
8107
|
+
function Bs() {
|
|
8108
|
+
return /* @__PURE__ */ c("svg", {
|
|
8080
8109
|
className: "ak-agent-status__icon",
|
|
8081
8110
|
width: "13",
|
|
8082
8111
|
height: "13",
|
|
8083
8112
|
viewBox: "0 0 24 24",
|
|
8084
8113
|
fill: "currentColor",
|
|
8085
8114
|
"aria-hidden": "true",
|
|
8086
|
-
children: /* @__PURE__ */
|
|
8115
|
+
children: /* @__PURE__ */ c("path", { d: "M12 2C12 2 12.7 8.1 14.5 9.5C16.3 10.9 22 12 22 12C22 12 16.3 13.1 14.5 14.5C12.7 15.9 12 22 12 22C12 22 11.3 15.9 9.5 14.5C7.7 13.1 2 12 2 12C2 12 7.7 10.9 9.5 9.5C11.3 8.1 12 2 12 2Z" })
|
|
8087
8116
|
});
|
|
8088
8117
|
}
|
|
8089
|
-
function
|
|
8118
|
+
function Gs({ status: e }) {
|
|
8090
8119
|
return /* @__PURE__ */ y("div", {
|
|
8091
8120
|
className: "ak-agent-status",
|
|
8092
8121
|
role: "status",
|
|
8093
8122
|
"aria-live": "polite",
|
|
8094
|
-
children: [/* @__PURE__ */
|
|
8123
|
+
children: [/* @__PURE__ */ c(Bs, {}), /* @__PURE__ */ c("span", {
|
|
8095
8124
|
className: "ak-agent-status__text",
|
|
8096
8125
|
children: e
|
|
8097
8126
|
})]
|
|
@@ -8104,17 +8133,17 @@ function br({ messageId: e, images: t, onCellClick: r }) {
|
|
|
8104
8133
|
const s = t[0];
|
|
8105
8134
|
return /* @__PURE__ */ y("div", {
|
|
8106
8135
|
className: "ak-gallery ak-gallery--single",
|
|
8107
|
-
children: [/* @__PURE__ */
|
|
8136
|
+
children: [/* @__PURE__ */ c("button", {
|
|
8108
8137
|
type: "button",
|
|
8109
8138
|
onClick: () => r(0),
|
|
8110
8139
|
className: "ak-gallery__cell ak-gallery__cell--hero",
|
|
8111
8140
|
"aria-label": "Open image preview",
|
|
8112
|
-
children: /* @__PURE__ */
|
|
8141
|
+
children: /* @__PURE__ */ c("img", {
|
|
8113
8142
|
src: s.src,
|
|
8114
8143
|
alt: s.alt,
|
|
8115
8144
|
className: "ak-gallery__img ak-gallery__img--contain"
|
|
8116
8145
|
})
|
|
8117
|
-
}), /* @__PURE__ */
|
|
8146
|
+
}), /* @__PURE__ */ c("a", {
|
|
8118
8147
|
href: $e(s.downloadHref) ?? void 0,
|
|
8119
8148
|
download: !0,
|
|
8120
8149
|
className: "ak-message__image-dl-icon",
|
|
@@ -8130,9 +8159,9 @@ function br({ messageId: e, images: t, onCellClick: r }) {
|
|
|
8130
8159
|
strokeLinecap: "round",
|
|
8131
8160
|
strokeLinejoin: "round",
|
|
8132
8161
|
children: [
|
|
8133
|
-
/* @__PURE__ */
|
|
8134
|
-
/* @__PURE__ */
|
|
8135
|
-
/* @__PURE__ */
|
|
8162
|
+
/* @__PURE__ */ c("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
8163
|
+
/* @__PURE__ */ c("polyline", { points: "7 10 12 15 17 10" }),
|
|
8164
|
+
/* @__PURE__ */ c("line", {
|
|
8136
8165
|
x1: "12",
|
|
8137
8166
|
y1: "15",
|
|
8138
8167
|
x2: "12",
|
|
@@ -8143,9 +8172,9 @@ function br({ messageId: e, images: t, onCellClick: r }) {
|
|
|
8143
8172
|
})]
|
|
8144
8173
|
});
|
|
8145
8174
|
}
|
|
8146
|
-
if (a === 2) return /* @__PURE__ */
|
|
8175
|
+
if (a === 2) return /* @__PURE__ */ c("div", {
|
|
8147
8176
|
className: "ak-gallery ak-gallery--two",
|
|
8148
|
-
children: t.map((s, o) => /* @__PURE__ */
|
|
8177
|
+
children: t.map((s, o) => /* @__PURE__ */ c(Re, {
|
|
8149
8178
|
src: s.src,
|
|
8150
8179
|
alt: s.alt,
|
|
8151
8180
|
onClick: () => r(o)
|
|
@@ -8153,17 +8182,17 @@ function br({ messageId: e, images: t, onCellClick: r }) {
|
|
|
8153
8182
|
});
|
|
8154
8183
|
if (a === 3) return /* @__PURE__ */ y("div", {
|
|
8155
8184
|
className: "ak-gallery ak-gallery--three",
|
|
8156
|
-
children: [/* @__PURE__ */
|
|
8185
|
+
children: [/* @__PURE__ */ c(Re, {
|
|
8157
8186
|
src: t[0].src,
|
|
8158
8187
|
alt: t[0].alt,
|
|
8159
8188
|
onClick: () => r(0)
|
|
8160
8189
|
}, t[0].key ?? `${e}-0`), /* @__PURE__ */ y("div", {
|
|
8161
8190
|
className: "ak-gallery__col",
|
|
8162
|
-
children: [/* @__PURE__ */
|
|
8191
|
+
children: [/* @__PURE__ */ c(Re, {
|
|
8163
8192
|
src: t[1].src,
|
|
8164
8193
|
alt: t[1].alt,
|
|
8165
8194
|
onClick: () => r(1)
|
|
8166
|
-
}, t[1].key ?? `${e}-1`), /* @__PURE__ */
|
|
8195
|
+
}, t[1].key ?? `${e}-1`), /* @__PURE__ */ c(Re, {
|
|
8167
8196
|
src: t[2].src,
|
|
8168
8197
|
alt: t[2].alt,
|
|
8169
8198
|
onClick: () => r(2)
|
|
@@ -8171,11 +8200,11 @@ function br({ messageId: e, images: t, onCellClick: r }) {
|
|
|
8171
8200
|
})]
|
|
8172
8201
|
});
|
|
8173
8202
|
const n = t.slice(0, 4), i = a > 4 ? a - 4 : 0;
|
|
8174
|
-
return /* @__PURE__ */
|
|
8203
|
+
return /* @__PURE__ */ c("div", {
|
|
8175
8204
|
className: "ak-gallery ak-gallery--grid",
|
|
8176
8205
|
children: n.map((s, o) => {
|
|
8177
8206
|
const l = o === n.length - 1;
|
|
8178
|
-
return /* @__PURE__ */
|
|
8207
|
+
return /* @__PURE__ */ c(Re, {
|
|
8179
8208
|
src: s.src,
|
|
8180
8209
|
alt: s.alt,
|
|
8181
8210
|
overlayCount: l && i > 0 ? i : 0,
|
|
@@ -8190,7 +8219,7 @@ function Re({ src: e, alt: t, overlayCount: r = 0, onClick: a }) {
|
|
|
8190
8219
|
onClick: a,
|
|
8191
8220
|
className: "ak-gallery__cell",
|
|
8192
8221
|
"aria-label": "Open image preview",
|
|
8193
|
-
children: [/* @__PURE__ */
|
|
8222
|
+
children: [/* @__PURE__ */ c("img", {
|
|
8194
8223
|
src: e,
|
|
8195
8224
|
alt: t,
|
|
8196
8225
|
className: "ak-gallery__img",
|
|
@@ -8234,7 +8263,7 @@ function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
|
|
|
8234
8263
|
e.length
|
|
8235
8264
|
]
|
|
8236
8265
|
}),
|
|
8237
|
-
/* @__PURE__ */
|
|
8266
|
+
/* @__PURE__ */ c("a", {
|
|
8238
8267
|
href: $e(s.downloadHref) ?? void 0,
|
|
8239
8268
|
download: !0,
|
|
8240
8269
|
target: "_blank",
|
|
@@ -8252,9 +8281,9 @@ function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
|
|
|
8252
8281
|
strokeLinecap: "round",
|
|
8253
8282
|
strokeLinejoin: "round",
|
|
8254
8283
|
children: [
|
|
8255
|
-
/* @__PURE__ */
|
|
8256
|
-
/* @__PURE__ */
|
|
8257
|
-
/* @__PURE__ */
|
|
8284
|
+
/* @__PURE__ */ c("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
8285
|
+
/* @__PURE__ */ c("polyline", { points: "7 10 12 15 17 10" }),
|
|
8286
|
+
/* @__PURE__ */ c("line", {
|
|
8258
8287
|
x1: "12",
|
|
8259
8288
|
y1: "15",
|
|
8260
8289
|
x2: "12",
|
|
@@ -8263,7 +8292,7 @@ function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
|
|
|
8263
8292
|
]
|
|
8264
8293
|
})
|
|
8265
8294
|
}),
|
|
8266
|
-
/* @__PURE__ */
|
|
8295
|
+
/* @__PURE__ */ c("button", {
|
|
8267
8296
|
type: "button",
|
|
8268
8297
|
onClick: r,
|
|
8269
8298
|
className: "ak-lightbox__btn",
|
|
@@ -8278,12 +8307,12 @@ function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
|
|
|
8278
8307
|
strokeWidth: "2",
|
|
8279
8308
|
strokeLinecap: "round",
|
|
8280
8309
|
strokeLinejoin: "round",
|
|
8281
|
-
children: [/* @__PURE__ */
|
|
8310
|
+
children: [/* @__PURE__ */ c("line", {
|
|
8282
8311
|
x1: "18",
|
|
8283
8312
|
y1: "6",
|
|
8284
8313
|
x2: "6",
|
|
8285
8314
|
y2: "18"
|
|
8286
|
-
}), /* @__PURE__ */
|
|
8315
|
+
}), /* @__PURE__ */ c("line", {
|
|
8287
8316
|
x1: "6",
|
|
8288
8317
|
y1: "6",
|
|
8289
8318
|
x2: "18",
|
|
@@ -8293,14 +8322,14 @@ function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
|
|
|
8293
8322
|
})
|
|
8294
8323
|
]
|
|
8295
8324
|
}),
|
|
8296
|
-
e.length > 1 && /* @__PURE__ */ y(
|
|
8325
|
+
e.length > 1 && /* @__PURE__ */ y(ye, { children: [/* @__PURE__ */ c("button", {
|
|
8297
8326
|
type: "button",
|
|
8298
8327
|
onClick: (o) => {
|
|
8299
8328
|
o.stopPropagation(), a((i - 1 + e.length) % e.length);
|
|
8300
8329
|
},
|
|
8301
8330
|
className: "ak-lightbox__nav ak-lightbox__nav--prev",
|
|
8302
8331
|
"aria-label": "Previous image",
|
|
8303
|
-
children: /* @__PURE__ */
|
|
8332
|
+
children: /* @__PURE__ */ c("svg", {
|
|
8304
8333
|
width: "20",
|
|
8305
8334
|
height: "20",
|
|
8306
8335
|
viewBox: "0 0 24 24",
|
|
@@ -8309,16 +8338,16 @@ function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
|
|
|
8309
8338
|
strokeWidth: "2",
|
|
8310
8339
|
strokeLinecap: "round",
|
|
8311
8340
|
strokeLinejoin: "round",
|
|
8312
|
-
children: /* @__PURE__ */
|
|
8341
|
+
children: /* @__PURE__ */ c("polyline", { points: "15 18 9 12 15 6" })
|
|
8313
8342
|
})
|
|
8314
|
-
}), /* @__PURE__ */
|
|
8343
|
+
}), /* @__PURE__ */ c("button", {
|
|
8315
8344
|
type: "button",
|
|
8316
8345
|
onClick: (o) => {
|
|
8317
8346
|
o.stopPropagation(), a((i + 1) % e.length);
|
|
8318
8347
|
},
|
|
8319
8348
|
className: "ak-lightbox__nav ak-lightbox__nav--next",
|
|
8320
8349
|
"aria-label": "Next image",
|
|
8321
|
-
children: /* @__PURE__ */
|
|
8350
|
+
children: /* @__PURE__ */ c("svg", {
|
|
8322
8351
|
width: "20",
|
|
8323
8352
|
height: "20",
|
|
8324
8353
|
viewBox: "0 0 24 24",
|
|
@@ -8327,10 +8356,10 @@ function _r({ images: e, index: t, onClose: r, onIndexChange: a }) {
|
|
|
8327
8356
|
strokeWidth: "2",
|
|
8328
8357
|
strokeLinecap: "round",
|
|
8329
8358
|
strokeLinejoin: "round",
|
|
8330
|
-
children: /* @__PURE__ */
|
|
8359
|
+
children: /* @__PURE__ */ c("polyline", { points: "9 18 15 12 9 6" })
|
|
8331
8360
|
})
|
|
8332
8361
|
})] }),
|
|
8333
|
-
/* @__PURE__ */
|
|
8362
|
+
/* @__PURE__ */ c("img", {
|
|
8334
8363
|
src: s.src,
|
|
8335
8364
|
alt: s.alt ?? "Image preview",
|
|
8336
8365
|
className: "ak-lightbox__img",
|
|
@@ -8370,7 +8399,7 @@ function xr({ url: e, mimeType: t, fileName: r }) {
|
|
|
8370
8399
|
rel: "noopener noreferrer",
|
|
8371
8400
|
className: "ak-file-chip",
|
|
8372
8401
|
title: a,
|
|
8373
|
-
children: [/* @__PURE__ */
|
|
8402
|
+
children: [/* @__PURE__ */ c("span", {
|
|
8374
8403
|
className: `ak-file-chip__icon ak-file-chip__icon--${i.variant}`,
|
|
8375
8404
|
"aria-hidden": !0,
|
|
8376
8405
|
children: /* @__PURE__ */ y("svg", {
|
|
@@ -8382,21 +8411,21 @@ function xr({ url: e, mimeType: t, fileName: r }) {
|
|
|
8382
8411
|
strokeWidth: "2",
|
|
8383
8412
|
strokeLinecap: "round",
|
|
8384
8413
|
strokeLinejoin: "round",
|
|
8385
|
-
children: [/* @__PURE__ */
|
|
8414
|
+
children: [/* @__PURE__ */ c("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), /* @__PURE__ */ c("polyline", { points: "14 2 14 8 20 8" })]
|
|
8386
8415
|
})
|
|
8387
8416
|
}), /* @__PURE__ */ y("span", {
|
|
8388
8417
|
className: "ak-file-chip__body",
|
|
8389
|
-
children: [/* @__PURE__ */
|
|
8418
|
+
children: [/* @__PURE__ */ c("span", {
|
|
8390
8419
|
className: "ak-file-chip__name",
|
|
8391
8420
|
children: a
|
|
8392
|
-
}), /* @__PURE__ */
|
|
8421
|
+
}), /* @__PURE__ */ c("span", {
|
|
8393
8422
|
className: "ak-file-chip__label",
|
|
8394
8423
|
children: i.label
|
|
8395
8424
|
})]
|
|
8396
8425
|
})]
|
|
8397
8426
|
});
|
|
8398
8427
|
}
|
|
8399
|
-
function
|
|
8428
|
+
function Hs(e) {
|
|
8400
8429
|
try {
|
|
8401
8430
|
return new Date(e).toLocaleTimeString([], {
|
|
8402
8431
|
hour: "2-digit",
|
|
@@ -8415,15 +8444,15 @@ function Y(e) {
|
|
|
8415
8444
|
for (; (n = wr.exec(e)) !== null; ) {
|
|
8416
8445
|
n.index > r && t.push(e.slice(r, n.index));
|
|
8417
8446
|
const i = n[0];
|
|
8418
|
-
if (i.startsWith("`")) t.push(/* @__PURE__ */
|
|
8447
|
+
if (i.startsWith("`")) t.push(/* @__PURE__ */ c("code", {
|
|
8419
8448
|
className: "ak-md-ic",
|
|
8420
8449
|
children: i.slice(1, -1)
|
|
8421
8450
|
}, a++));
|
|
8422
|
-
else if (i.startsWith("**")) t.push(/* @__PURE__ */
|
|
8423
|
-
else if (i.startsWith("*")) t.push(/* @__PURE__ */
|
|
8451
|
+
else if (i.startsWith("**")) t.push(/* @__PURE__ */ c("strong", { children: i.slice(2, -2) }, a++));
|
|
8452
|
+
else if (i.startsWith("*")) t.push(/* @__PURE__ */ c("em", { children: i.slice(1, -1) }, a++));
|
|
8424
8453
|
else if (i.startsWith("![")) {
|
|
8425
8454
|
const s = i.match(/!\[([^\]]*)\]\(([^)]+)\)/), o = $e(s?.[2]);
|
|
8426
|
-
s && o ? t.push(/* @__PURE__ */
|
|
8455
|
+
s && o ? t.push(/* @__PURE__ */ c("a", {
|
|
8427
8456
|
href: o,
|
|
8428
8457
|
target: "_blank",
|
|
8429
8458
|
rel: "noopener noreferrer",
|
|
@@ -8431,7 +8460,7 @@ function Y(e) {
|
|
|
8431
8460
|
}, a++)) : s && t.push(s[1] || "image");
|
|
8432
8461
|
} else {
|
|
8433
8462
|
const s = i.match(/\[(.+?)\]\((.+?)\)/), o = $e(s?.[2]);
|
|
8434
|
-
s && o ? t.push(/* @__PURE__ */
|
|
8463
|
+
s && o ? t.push(/* @__PURE__ */ c("a", {
|
|
8435
8464
|
href: o,
|
|
8436
8465
|
target: "_blank",
|
|
8437
8466
|
rel: "noopener noreferrer",
|
|
@@ -8442,29 +8471,27 @@ function Y(e) {
|
|
|
8442
8471
|
}
|
|
8443
8472
|
return r < e.length && t.push(e.slice(r)), t;
|
|
8444
8473
|
}
|
|
8445
|
-
function
|
|
8446
|
-
e = e
|
|
8447
|
-
|
|
8448
|
-
`);
|
|
8474
|
+
function Ys(e) {
|
|
8475
|
+
e = Vs(e);
|
|
8449
8476
|
const t = e.split(`
|
|
8450
8477
|
`), r = [];
|
|
8451
8478
|
let a = 0, n = 0;
|
|
8452
8479
|
for (; a < t.length; ) {
|
|
8453
8480
|
const i = t[a], s = i.match(/^(\s*)```/);
|
|
8454
8481
|
if (s) {
|
|
8455
|
-
const
|
|
8482
|
+
const d = s[1], h = i.trimStart().match(/^```(\w+)?\s*$/)?.[1] || "", u = [];
|
|
8456
8483
|
for (a++; a < t.length && !t[a].trimStart().startsWith("```"); )
|
|
8457
|
-
|
|
8484
|
+
u.push(t[a].startsWith(d) ? t[a].slice(d.length) : t[a]), a++;
|
|
8458
8485
|
a < t.length && t[a].trimStart().startsWith("```") && a++, r.push(/* @__PURE__ */ y("div", {
|
|
8459
8486
|
className: "ak-md-pre-wrap",
|
|
8460
|
-
children: [
|
|
8487
|
+
children: [h && /* @__PURE__ */ c("span", {
|
|
8461
8488
|
className: "ak-md-pre-lang",
|
|
8462
|
-
children:
|
|
8463
|
-
}), /* @__PURE__ */
|
|
8464
|
-
className: `ak-md-pre${
|
|
8465
|
-
children: /* @__PURE__ */
|
|
8489
|
+
children: h
|
|
8490
|
+
}), /* @__PURE__ */ c("pre", {
|
|
8491
|
+
className: `ak-md-pre${h ? ` ak-md-pre--${h}` : ""}`,
|
|
8492
|
+
children: /* @__PURE__ */ c("code", {
|
|
8466
8493
|
className: "ak-md-code",
|
|
8467
|
-
children:
|
|
8494
|
+
children: u.join(`
|
|
8468
8495
|
`)
|
|
8469
8496
|
})
|
|
8470
8497
|
})]
|
|
@@ -8473,56 +8500,56 @@ function Hs(e) {
|
|
|
8473
8500
|
}
|
|
8474
8501
|
const o = i.match(/^(#{1,6})(\s+.*)?$/);
|
|
8475
8502
|
if (o) {
|
|
8476
|
-
const
|
|
8477
|
-
|
|
8503
|
+
const d = o[1].length, h = o[2] ? Y(o[2].trim()) : "";
|
|
8504
|
+
d === 1 ? r.push(/* @__PURE__ */ c("h1", {
|
|
8478
8505
|
className: "ak-md-h1",
|
|
8479
|
-
children:
|
|
8480
|
-
}, n++)) :
|
|
8506
|
+
children: h
|
|
8507
|
+
}, n++)) : d === 2 ? r.push(/* @__PURE__ */ c("h2", {
|
|
8481
8508
|
className: "ak-md-h2",
|
|
8482
|
-
children:
|
|
8483
|
-
}, n++)) :
|
|
8509
|
+
children: h
|
|
8510
|
+
}, n++)) : d === 3 ? r.push(/* @__PURE__ */ c("h3", {
|
|
8484
8511
|
className: "ak-md-h3",
|
|
8485
|
-
children:
|
|
8486
|
-
}, n++)) :
|
|
8512
|
+
children: h
|
|
8513
|
+
}, n++)) : d === 4 ? r.push(/* @__PURE__ */ c("h4", {
|
|
8487
8514
|
className: "ak-md-h4",
|
|
8488
|
-
children:
|
|
8489
|
-
}, n++)) :
|
|
8515
|
+
children: h
|
|
8516
|
+
}, n++)) : d === 5 ? r.push(/* @__PURE__ */ c("h5", {
|
|
8490
8517
|
className: "ak-md-h5",
|
|
8491
|
-
children:
|
|
8492
|
-
}, n++)) : r.push(/* @__PURE__ */
|
|
8518
|
+
children: h
|
|
8519
|
+
}, n++)) : r.push(/* @__PURE__ */ c("h6", {
|
|
8493
8520
|
className: "ak-md-h6",
|
|
8494
|
-
children:
|
|
8521
|
+
children: h
|
|
8495
8522
|
}, n++)), a++;
|
|
8496
8523
|
continue;
|
|
8497
8524
|
}
|
|
8498
8525
|
if (/^[-*_]{3,}$/.test(i.trim())) {
|
|
8499
|
-
r.push(/* @__PURE__ */
|
|
8526
|
+
r.push(/* @__PURE__ */ c("hr", { className: "ak-md-hr" }, n++)), a++;
|
|
8500
8527
|
continue;
|
|
8501
8528
|
}
|
|
8502
8529
|
if (/^[-*+]\s/.test(i)) {
|
|
8503
|
-
const
|
|
8504
|
-
let
|
|
8505
|
-
for (;
|
|
8506
|
-
if (t[
|
|
8507
|
-
|
|
8530
|
+
const d = [];
|
|
8531
|
+
let h = a;
|
|
8532
|
+
for (; h < t.length && (/^[-*+]\s/.test(t[h]) || t[h].trim() === ""); ) {
|
|
8533
|
+
if (t[h].trim() === "") {
|
|
8534
|
+
h++;
|
|
8508
8535
|
continue;
|
|
8509
8536
|
}
|
|
8510
|
-
const
|
|
8511
|
-
let
|
|
8512
|
-
for (;
|
|
8513
|
-
const g = t[
|
|
8514
|
-
if (g.length - g.trimStart().length >
|
|
8515
|
-
const
|
|
8516
|
-
/^[-*+]\s/.test(
|
|
8537
|
+
const u = t[h].length - t[h].trimStart().length, p = t[h].replace(/^[-*+]\s+/, ""), f = [], k = [];
|
|
8538
|
+
let v = h + 1;
|
|
8539
|
+
for (; v < t.length && v < h + 20; ) {
|
|
8540
|
+
const g = t[v];
|
|
8541
|
+
if (g.length - g.trimStart().length > u && g.trim() !== "") {
|
|
8542
|
+
const w = g.trim();
|
|
8543
|
+
/^[-*+]\s/.test(w) ? f.push(/* @__PURE__ */ c("li", { children: Y(w.replace(/^[-*+]\s+/, "")) }, `nested-${v}`)) : k.push(/* @__PURE__ */ c("p", {
|
|
8517
8544
|
style: { margin: "0.2em 0 0" },
|
|
8518
|
-
children: Y(
|
|
8519
|
-
}, `cont-${
|
|
8545
|
+
children: Y(w)
|
|
8546
|
+
}, `cont-${v}`)), v++;
|
|
8520
8547
|
} else break;
|
|
8521
8548
|
}
|
|
8522
|
-
const
|
|
8549
|
+
const S = k.length > 0 || f.length > 0 ? /* @__PURE__ */ y(ye, { children: [
|
|
8523
8550
|
Y(p),
|
|
8524
|
-
|
|
8525
|
-
f.length > 0 && /* @__PURE__ */
|
|
8551
|
+
k,
|
|
8552
|
+
f.length > 0 && /* @__PURE__ */ c("ul", {
|
|
8526
8553
|
style: {
|
|
8527
8554
|
margin: "0.2em 0 0",
|
|
8528
8555
|
paddingLeft: "1.2em"
|
|
@@ -8530,38 +8557,38 @@ function Hs(e) {
|
|
|
8530
8557
|
children: f
|
|
8531
8558
|
})
|
|
8532
8559
|
] }) : Y(p);
|
|
8533
|
-
|
|
8560
|
+
d.push(/* @__PURE__ */ c("li", { children: S }, `item-${h}`)), h = v;
|
|
8534
8561
|
}
|
|
8535
|
-
r.push(/* @__PURE__ */
|
|
8562
|
+
r.push(/* @__PURE__ */ c("ul", {
|
|
8536
8563
|
className: "ak-md-ul",
|
|
8537
|
-
children:
|
|
8538
|
-
}, n++)), a =
|
|
8564
|
+
children: d
|
|
8565
|
+
}, n++)), a = h;
|
|
8539
8566
|
continue;
|
|
8540
8567
|
}
|
|
8541
8568
|
if (/^\d+\.\s/.test(i)) {
|
|
8542
|
-
const
|
|
8543
|
-
let
|
|
8544
|
-
for (;
|
|
8545
|
-
if (t[
|
|
8546
|
-
|
|
8569
|
+
const d = [];
|
|
8570
|
+
let h = a;
|
|
8571
|
+
for (; h < t.length && (/^\d+\.\s/.test(t[h]) || t[h].trim() === ""); ) {
|
|
8572
|
+
if (t[h].trim() === "") {
|
|
8573
|
+
h++;
|
|
8547
8574
|
continue;
|
|
8548
8575
|
}
|
|
8549
|
-
const
|
|
8550
|
-
let
|
|
8551
|
-
for (;
|
|
8552
|
-
const g = t[
|
|
8553
|
-
if (g.length - g.trimStart().length >
|
|
8554
|
-
const
|
|
8555
|
-
/^\d+\.\s/.test(
|
|
8576
|
+
const u = t[h].length - t[h].trimStart().length, p = t[h].replace(/^\d+\.\s+/, ""), f = [], k = [];
|
|
8577
|
+
let v = h + 1;
|
|
8578
|
+
for (; v < t.length && v < h + 20; ) {
|
|
8579
|
+
const g = t[v];
|
|
8580
|
+
if (g.length - g.trimStart().length > u && g.trim() !== "") {
|
|
8581
|
+
const w = g.trim();
|
|
8582
|
+
/^\d+\.\s/.test(w) ? f.push(/* @__PURE__ */ c("li", { children: Y(w.replace(/^\d+\.\s+/, "")) }, `nested-order-${v}`)) : /^[-*+]\s/.test(w) ? f.push(/* @__PURE__ */ c("li", { children: Y(w.replace(/^[-*+]\s+/, "")) }, `nested-unorder-${v}`)) : k.push(/* @__PURE__ */ c("p", {
|
|
8556
8583
|
style: { margin: "0.2em 0 0" },
|
|
8557
|
-
children: Y(
|
|
8558
|
-
}, `cont-${
|
|
8584
|
+
children: Y(w)
|
|
8585
|
+
}, `cont-${v}`)), v++;
|
|
8559
8586
|
} else break;
|
|
8560
8587
|
}
|
|
8561
|
-
const
|
|
8588
|
+
const S = k.length > 0 || f.length > 0 ? /* @__PURE__ */ y(ye, { children: [
|
|
8562
8589
|
Y(p),
|
|
8563
|
-
|
|
8564
|
-
f.length > 0 && /* @__PURE__ */
|
|
8590
|
+
k,
|
|
8591
|
+
f.length > 0 && /* @__PURE__ */ c("ol", {
|
|
8565
8592
|
style: {
|
|
8566
8593
|
margin: "0.2em 0 0",
|
|
8567
8594
|
paddingLeft: "1.2em"
|
|
@@ -8569,12 +8596,12 @@ function Hs(e) {
|
|
|
8569
8596
|
children: f
|
|
8570
8597
|
})
|
|
8571
8598
|
] }) : Y(p);
|
|
8572
|
-
|
|
8599
|
+
d.push(/* @__PURE__ */ c("li", { children: S }, `order-item-${h}`)), h = v;
|
|
8573
8600
|
}
|
|
8574
|
-
r.push(/* @__PURE__ */
|
|
8601
|
+
r.push(/* @__PURE__ */ c("ol", {
|
|
8575
8602
|
className: "ak-md-ol",
|
|
8576
|
-
children:
|
|
8577
|
-
}, n++)), a =
|
|
8603
|
+
children: d
|
|
8604
|
+
}, n++)), a = h;
|
|
8578
8605
|
continue;
|
|
8579
8606
|
}
|
|
8580
8607
|
if (i.trim() === "") {
|
|
@@ -8582,30 +8609,30 @@ function Hs(e) {
|
|
|
8582
8609
|
continue;
|
|
8583
8610
|
}
|
|
8584
8611
|
if (i.includes("|") && a + 1 < t.length && t[a + 1].includes("|")) {
|
|
8585
|
-
const
|
|
8586
|
-
if (/^\s*\|?[\s:|*-]+\|[\s:|*-|]+\|?[\s:|*-]*$/.test(
|
|
8587
|
-
const
|
|
8588
|
-
const
|
|
8589
|
-
return
|
|
8590
|
-
}).filter((
|
|
8612
|
+
const d = t[a + 1];
|
|
8613
|
+
if (/^\s*\|?[\s:|*-]+\|[\s:|*-|]+\|?[\s:|*-]*$/.test(d)) {
|
|
8614
|
+
const h = i.split("|").map((k) => k.trim()).filter((k) => k.length > 0), u = d.split("|").map((k) => {
|
|
8615
|
+
const v = k.trim();
|
|
8616
|
+
return v.startsWith(":") && v.endsWith(":") ? "center" : v.endsWith(":") ? "right" : (v.startsWith(":"), "left");
|
|
8617
|
+
}).filter((k, v) => v > 0 && v <= h.length), p = [];
|
|
8591
8618
|
let f = a + 2;
|
|
8592
8619
|
for (; f < t.length && t[f].includes("|") && t[f].trim() !== ""; ) {
|
|
8593
|
-
const
|
|
8594
|
-
if (
|
|
8595
|
-
p.push(
|
|
8620
|
+
const k = t[f].split("|").map((v) => v.trim()).filter((v) => v.length > 0);
|
|
8621
|
+
if (k.length > 0)
|
|
8622
|
+
p.push(k), f++;
|
|
8596
8623
|
else break;
|
|
8597
8624
|
}
|
|
8598
8625
|
r.push(/* @__PURE__ */ y("table", {
|
|
8599
8626
|
className: "ak-md-table",
|
|
8600
|
-
children: [/* @__PURE__ */
|
|
8601
|
-
style: { textAlign:
|
|
8627
|
+
children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ c("tr", { children: h.map((k, v) => /* @__PURE__ */ c("th", {
|
|
8628
|
+
style: { textAlign: u[v] || "left" },
|
|
8602
8629
|
className: "ak-md-th",
|
|
8603
|
-
children: Y(
|
|
8604
|
-
}, `th-${
|
|
8605
|
-
style: { textAlign:
|
|
8630
|
+
children: Y(k)
|
|
8631
|
+
}, `th-${v}`)) }) }), /* @__PURE__ */ c("tbody", { children: p.map((k, v) => /* @__PURE__ */ c("tr", { children: h.map((S, g) => /* @__PURE__ */ c("td", {
|
|
8632
|
+
style: { textAlign: u[g] || "left" },
|
|
8606
8633
|
className: "ak-md-td",
|
|
8607
|
-
children:
|
|
8608
|
-
}, `td-${
|
|
8634
|
+
children: k[g] ? Y(k[g]) : ""
|
|
8635
|
+
}, `td-${v}-${g}`)) }, `tr-${v}`)) })]
|
|
8609
8636
|
}, n++)), a = f;
|
|
8610
8637
|
continue;
|
|
8611
8638
|
}
|
|
@@ -8614,144 +8641,146 @@ function Hs(e) {
|
|
|
8614
8641
|
for (; a < t.length && t[a].trim() !== "" && !t[a].startsWith("#") && !/^\s*```/.test(t[a]) && !/^[-*+]\s/.test(t[a]) && !/^\d+\.\s/.test(t[a]) && !/^[-*_]{3,}$/.test(t[a].trim()); )
|
|
8615
8642
|
l.push(t[a]), a++;
|
|
8616
8643
|
if (l.length > 0) {
|
|
8617
|
-
const
|
|
8618
|
-
l.forEach((
|
|
8619
|
-
|
|
8620
|
-
}), r.push(/* @__PURE__ */
|
|
8644
|
+
const d = [];
|
|
8645
|
+
l.forEach((h, u) => {
|
|
8646
|
+
d.push(...Y(h)), u < l.length - 1 && d.push(/* @__PURE__ */ c("br", {}, `br-${u}`));
|
|
8647
|
+
}), r.push(/* @__PURE__ */ c("p", {
|
|
8621
8648
|
className: "ak-md-p",
|
|
8622
|
-
children:
|
|
8649
|
+
children: d
|
|
8623
8650
|
}, n++));
|
|
8624
8651
|
}
|
|
8625
8652
|
}
|
|
8626
|
-
return /* @__PURE__ */
|
|
8653
|
+
return /* @__PURE__ */ c(ye, { children: r });
|
|
8627
8654
|
}
|
|
8628
|
-
function
|
|
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),
|
|
8655
|
+
function Xs({ message: e }) {
|
|
8656
|
+
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), d = !!(e.documents && e.documents.length > 0), h = (() => {
|
|
8630
8657
|
if (!i) return [];
|
|
8631
|
-
const
|
|
8632
|
-
url:
|
|
8633
|
-
mimeType:
|
|
8634
|
-
fileName:
|
|
8658
|
+
const N = (e.uploadedAttachments ?? []).filter((P) => P.kind === "image").map((P) => ({
|
|
8659
|
+
url: P.url,
|
|
8660
|
+
mimeType: P.mimeType,
|
|
8661
|
+
fileName: P.fileName
|
|
8635
8662
|
}));
|
|
8636
|
-
return
|
|
8663
|
+
return N.length > 0 ? N : e.uploadedImageUrl ? [{
|
|
8637
8664
|
url: e.uploadedImageUrl,
|
|
8638
8665
|
mimeType: "image/jpeg"
|
|
8639
8666
|
}] : [];
|
|
8640
|
-
})(),
|
|
8667
|
+
})(), u = i ? (e.uploadedAttachments ?? []).filter((N) => N.kind === "file") : [], p = h.length > 0, f = u.length > 0, k = l || p, v = !!e.progressEvents && e.progressEvents.length > 0, S = o && !e.content && !e.toolStatus && !v, g = !i && !s, w = !!e.isHuman && !i, R = i ? "ak-message--user" : s ? "ak-message--assistant ak-message--error" : w ? "ak-message--assistant ak-message--operator" : "ak-message--assistant", F = [
|
|
8641
8668
|
"ak-message__bubble",
|
|
8642
8669
|
g ? "ak-message__bubble--md" : "",
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
].filter(Boolean).join(" "),
|
|
8646
|
-
className:
|
|
8670
|
+
k ? "ak-message__bubble--has-image" : "",
|
|
8671
|
+
w ? "ak-message__bubble--operator" : ""
|
|
8672
|
+
].filter(Boolean).join(" "), $ = w ? e.senderDisplay?.trim() || "Operator" : null, U = $ ? $.charAt(0).toUpperCase() : "", ae = /* @__PURE__ */ y("div", {
|
|
8673
|
+
className: F,
|
|
8647
8674
|
children: [
|
|
8648
|
-
p && /* @__PURE__ */
|
|
8675
|
+
p && /* @__PURE__ */ c(br, {
|
|
8649
8676
|
messageId: `${e.id}-up`,
|
|
8650
|
-
images:
|
|
8651
|
-
src:
|
|
8652
|
-
alt:
|
|
8653
|
-
downloadHref:
|
|
8677
|
+
images: h.map((N) => ({
|
|
8678
|
+
src: N.url,
|
|
8679
|
+
alt: N.fileName ?? "Uploaded image",
|
|
8680
|
+
downloadHref: N.url
|
|
8654
8681
|
})),
|
|
8655
|
-
onCellClick: (
|
|
8682
|
+
onCellClick: (N) => r(N)
|
|
8656
8683
|
}),
|
|
8657
|
-
f && /* @__PURE__ */
|
|
8684
|
+
f && /* @__PURE__ */ c("div", {
|
|
8658
8685
|
className: "ak-message__files",
|
|
8659
|
-
children:
|
|
8660
|
-
url:
|
|
8661
|
-
mimeType:
|
|
8662
|
-
fileName:
|
|
8663
|
-
}, `${e.id}-up-file-${
|
|
8686
|
+
children: u.map((N, P) => /* @__PURE__ */ c(xr, {
|
|
8687
|
+
url: N.url,
|
|
8688
|
+
mimeType: N.mimeType,
|
|
8689
|
+
fileName: N.fileName
|
|
8690
|
+
}, `${e.id}-up-file-${P}`))
|
|
8664
8691
|
}),
|
|
8665
|
-
l && /* @__PURE__ */
|
|
8692
|
+
l && /* @__PURE__ */ c(br, {
|
|
8666
8693
|
messageId: `${e.id}-asst`,
|
|
8667
|
-
images: e.images.map((
|
|
8668
|
-
const ce =
|
|
8694
|
+
images: e.images.map((N, P) => {
|
|
8695
|
+
const ce = N.url ?? (N.base64 ? `data:${N.mimeType};base64,${N.base64}` : null);
|
|
8669
8696
|
return ce ? {
|
|
8670
8697
|
src: ce,
|
|
8671
8698
|
alt: "Generated image",
|
|
8672
|
-
downloadHref:
|
|
8673
|
-
key: `gen-${
|
|
8699
|
+
downloadHref: N.url ?? ce,
|
|
8700
|
+
key: `gen-${P}`
|
|
8674
8701
|
} : null;
|
|
8675
|
-
}).filter((
|
|
8676
|
-
onCellClick: (
|
|
8702
|
+
}).filter((N) => N !== null),
|
|
8703
|
+
onCellClick: (N) => n(N)
|
|
8677
8704
|
}),
|
|
8678
|
-
|
|
8705
|
+
d && /* @__PURE__ */ c("div", {
|
|
8679
8706
|
className: "ak-message__files",
|
|
8680
|
-
children: e.documents.map((
|
|
8681
|
-
url:
|
|
8682
|
-
mimeType:
|
|
8683
|
-
fileName:
|
|
8684
|
-
}, `${e.id}-asst-doc-${
|
|
8707
|
+
children: e.documents.map((N, P) => N.url ? /* @__PURE__ */ c(xr, {
|
|
8708
|
+
url: N.url,
|
|
8709
|
+
mimeType: N.mimeType,
|
|
8710
|
+
fileName: N.fileName
|
|
8711
|
+
}, `${e.id}-asst-doc-${P}`) : null)
|
|
8685
8712
|
}),
|
|
8686
8713
|
e.content && /* @__PURE__ */ y("div", {
|
|
8687
|
-
className:
|
|
8688
|
-
children: [g ?
|
|
8714
|
+
className: k ? "ak-message__image-caption" : void 0,
|
|
8715
|
+
children: [g ? Ys(e.content) : e.content, o && /* @__PURE__ */ y("span", {
|
|
8689
8716
|
className: "ak-cursor",
|
|
8690
8717
|
"aria-hidden": "true",
|
|
8691
8718
|
children: [
|
|
8692
|
-
/* @__PURE__ */
|
|
8693
|
-
/* @__PURE__ */
|
|
8694
|
-
/* @__PURE__ */
|
|
8719
|
+
/* @__PURE__ */ c("span", { className: "ak-cursor__dot" }),
|
|
8720
|
+
/* @__PURE__ */ c("span", { className: "ak-cursor__dot" }),
|
|
8721
|
+
/* @__PURE__ */ c("span", { className: "ak-cursor__dot" })
|
|
8695
8722
|
]
|
|
8696
8723
|
})]
|
|
8724
|
+
}),
|
|
8725
|
+
/* @__PURE__ */ c("span", {
|
|
8726
|
+
className: "ak-message__time",
|
|
8727
|
+
children: Hs(e.createdAt)
|
|
8697
8728
|
})
|
|
8698
8729
|
]
|
|
8699
|
-
}),
|
|
8700
|
-
className: "ak-message__time",
|
|
8701
|
-
children: Gs(e.createdAt)
|
|
8702
|
-
})] }), T = !!e.content || v || f || c || !o && !e.toolStatus;
|
|
8730
|
+
}), T = !!e.content || k || f || d || !o && !e.toolStatus;
|
|
8703
8731
|
return /* @__PURE__ */ y("div", {
|
|
8704
|
-
className: `ak-message ${
|
|
8732
|
+
className: `ak-message ${R}`,
|
|
8705
8733
|
children: [
|
|
8706
|
-
!i && (e.ackText || e.progressEvents && e.progressEvents.length > 0 || e.turnMeta) && /* @__PURE__ */
|
|
8734
|
+
!i && (e.ackText || e.progressEvents && e.progressEvents.length > 0 || e.turnMeta) && /* @__PURE__ */ c(Us, {
|
|
8707
8735
|
ackText: e.ackText,
|
|
8708
8736
|
events: e.progressEvents,
|
|
8709
8737
|
collapsed: e.progressCollapsed,
|
|
8710
8738
|
isComplete: !o,
|
|
8711
|
-
turnMeta: e.turnMeta
|
|
8739
|
+
turnMeta: e.turnMeta,
|
|
8740
|
+
answerStartedAtMs: e.answerStartedAtMs
|
|
8712
8741
|
}),
|
|
8713
|
-
|
|
8742
|
+
S && /* @__PURE__ */ y("div", {
|
|
8714
8743
|
className: "ak-typing-row",
|
|
8715
8744
|
role: "status",
|
|
8716
8745
|
"aria-label": "Assistant is typing",
|
|
8717
8746
|
children: [
|
|
8718
|
-
/* @__PURE__ */
|
|
8719
|
-
/* @__PURE__ */
|
|
8720
|
-
/* @__PURE__ */
|
|
8747
|
+
/* @__PURE__ */ c("span", { className: "ak-typing-row__dot" }),
|
|
8748
|
+
/* @__PURE__ */ c("span", { className: "ak-typing-row__dot" }),
|
|
8749
|
+
/* @__PURE__ */ c("span", { className: "ak-typing-row__dot" })
|
|
8721
8750
|
]
|
|
8722
8751
|
}),
|
|
8723
|
-
!i && e.toolStatus && !(e.progressEvents && e.progressEvents.length > 0) && /* @__PURE__ */
|
|
8724
|
-
|
|
8752
|
+
!i && e.toolStatus && !(e.progressEvents && e.progressEvents.length > 0) && /* @__PURE__ */ c(Gs, { status: e.toolStatus }),
|
|
8753
|
+
w && /* @__PURE__ */ y("span", {
|
|
8725
8754
|
className: "ak-message__sender-label",
|
|
8726
|
-
children: [/* @__PURE__ */
|
|
8755
|
+
children: [/* @__PURE__ */ c("span", {
|
|
8727
8756
|
className: "ak-message__operator-avatar",
|
|
8728
8757
|
"aria-hidden": "true",
|
|
8729
|
-
children:
|
|
8730
|
-
}), /* @__PURE__ */
|
|
8758
|
+
children: U
|
|
8759
|
+
}), /* @__PURE__ */ c("span", {
|
|
8731
8760
|
className: "ak-message__operator-name",
|
|
8732
|
-
children:
|
|
8761
|
+
children: $
|
|
8733
8762
|
})]
|
|
8734
8763
|
}),
|
|
8735
8764
|
T && ae,
|
|
8736
|
-
|
|
8737
|
-
images:
|
|
8738
|
-
src:
|
|
8739
|
-
alt:
|
|
8740
|
-
downloadHref:
|
|
8765
|
+
h.length > 0 && /* @__PURE__ */ c(_r, {
|
|
8766
|
+
images: h.map((N) => ({
|
|
8767
|
+
src: N.url,
|
|
8768
|
+
alt: N.fileName ?? "Uploaded image",
|
|
8769
|
+
downloadHref: N.url
|
|
8741
8770
|
})),
|
|
8742
8771
|
index: t,
|
|
8743
8772
|
onClose: () => r(null),
|
|
8744
8773
|
onIndexChange: r
|
|
8745
8774
|
}),
|
|
8746
|
-
l && /* @__PURE__ */
|
|
8747
|
-
images: e.images.map((
|
|
8748
|
-
const
|
|
8749
|
-
return
|
|
8750
|
-
src:
|
|
8775
|
+
l && /* @__PURE__ */ c(_r, {
|
|
8776
|
+
images: e.images.map((N) => {
|
|
8777
|
+
const P = N.url ?? (N.base64 ? `data:${N.mimeType};base64,${N.base64}` : null);
|
|
8778
|
+
return P ? {
|
|
8779
|
+
src: P,
|
|
8751
8780
|
alt: "Generated image",
|
|
8752
|
-
downloadHref:
|
|
8781
|
+
downloadHref: N.url ?? P
|
|
8753
8782
|
} : null;
|
|
8754
|
-
}).filter((
|
|
8783
|
+
}).filter((N) => N !== null),
|
|
8755
8784
|
index: a,
|
|
8756
8785
|
onClose: () => n(null),
|
|
8757
8786
|
onIndexChange: n
|
|
@@ -8759,18 +8788,18 @@ function Ys({ message: e }) {
|
|
|
8759
8788
|
]
|
|
8760
8789
|
});
|
|
8761
8790
|
}
|
|
8762
|
-
function
|
|
8791
|
+
function Js() {
|
|
8763
8792
|
return /* @__PURE__ */ y("div", {
|
|
8764
8793
|
className: "ak-typing",
|
|
8765
8794
|
"aria-label": "Assistant is typing",
|
|
8766
8795
|
children: [
|
|
8767
|
-
/* @__PURE__ */
|
|
8768
|
-
/* @__PURE__ */
|
|
8769
|
-
/* @__PURE__ */
|
|
8796
|
+
/* @__PURE__ */ c("span", { className: "ak-typing__dot" }),
|
|
8797
|
+
/* @__PURE__ */ c("span", { className: "ak-typing__dot" }),
|
|
8798
|
+
/* @__PURE__ */ c("span", { className: "ak-typing__dot" })
|
|
8770
8799
|
]
|
|
8771
8800
|
});
|
|
8772
8801
|
}
|
|
8773
|
-
function
|
|
8802
|
+
function Qs(e, t) {
|
|
8774
8803
|
const r = [];
|
|
8775
8804
|
let a = null;
|
|
8776
8805
|
for (const n of e) {
|
|
@@ -8789,18 +8818,18 @@ function Js(e, t) {
|
|
|
8789
8818
|
}
|
|
8790
8819
|
return r;
|
|
8791
8820
|
}
|
|
8792
|
-
function
|
|
8793
|
-
const a = he(null), n = he(null), i = he(!0), s = Mr(() =>
|
|
8821
|
+
function Ks({ messages: e, isLoading: t, operatorFallbackLabel: r = "Operator" }) {
|
|
8822
|
+
const a = he(null), n = he(null), i = he(!0), s = Mr(() => Qs(e, r), [e, r]);
|
|
8794
8823
|
return X(() => {
|
|
8795
8824
|
if (!(a.current?.parentElement ?? a.current)) return;
|
|
8796
|
-
const o = (
|
|
8797
|
-
i.current =
|
|
8825
|
+
const o = (h) => {
|
|
8826
|
+
i.current = h.scrollHeight - h.scrollTop - h.clientHeight < 120;
|
|
8798
8827
|
};
|
|
8799
8828
|
let l = a.current;
|
|
8800
8829
|
for (; l && getComputedStyle(l).overflowY === "visible"; ) l = l.parentElement;
|
|
8801
8830
|
if (!l) return;
|
|
8802
|
-
const
|
|
8803
|
-
return l.addEventListener("scroll",
|
|
8831
|
+
const d = () => o(l);
|
|
8832
|
+
return l.addEventListener("scroll", d, { passive: !0 }), () => l.removeEventListener("scroll", d);
|
|
8804
8833
|
}, []), X(() => {
|
|
8805
8834
|
e[e.length - 1]?.role === "user" && (i.current = !0), i.current && n.current?.scrollIntoView({ behavior: "smooth" });
|
|
8806
8835
|
}, [e]), X(() => {
|
|
@@ -8812,20 +8841,20 @@ function Qs({ messages: e, isLoading: t, operatorFallbackLabel: r = "Operator" }
|
|
|
8812
8841
|
"aria-live": "polite",
|
|
8813
8842
|
"aria-label": "Conversation",
|
|
8814
8843
|
children: [
|
|
8815
|
-
s.map((o) => o.kind === "divider" ? /* @__PURE__ */
|
|
8844
|
+
s.map((o) => o.kind === "divider" ? /* @__PURE__ */ c("div", {
|
|
8816
8845
|
className: "ak-handoff-divider",
|
|
8817
8846
|
role: "separator",
|
|
8818
|
-
children: /* @__PURE__ */
|
|
8847
|
+
children: /* @__PURE__ */ c("span", {
|
|
8819
8848
|
className: "ak-handoff-divider__label",
|
|
8820
8849
|
children: o.label
|
|
8821
8850
|
})
|
|
8822
|
-
}, o.id) : /* @__PURE__ */
|
|
8823
|
-
t && !e.some((o) => o.status === "streaming") && /* @__PURE__ */
|
|
8824
|
-
/* @__PURE__ */
|
|
8851
|
+
}, o.id) : /* @__PURE__ */ c(Xs, { message: o.message }, o.message.id)),
|
|
8852
|
+
t && !e.some((o) => o.status === "streaming") && /* @__PURE__ */ c(Js, {}),
|
|
8853
|
+
/* @__PURE__ */ c("div", { ref: n })
|
|
8825
8854
|
]
|
|
8826
8855
|
});
|
|
8827
8856
|
}
|
|
8828
|
-
function
|
|
8857
|
+
function qs() {
|
|
8829
8858
|
return /* @__PURE__ */ y("svg", {
|
|
8830
8859
|
width: "30",
|
|
8831
8860
|
height: "30",
|
|
@@ -8837,26 +8866,26 @@ function Ks() {
|
|
|
8837
8866
|
strokeLinejoin: "round",
|
|
8838
8867
|
"aria-hidden": "true",
|
|
8839
8868
|
children: [
|
|
8840
|
-
/* @__PURE__ */
|
|
8869
|
+
/* @__PURE__ */ c("rect", {
|
|
8841
8870
|
x: "3",
|
|
8842
8871
|
y: "11",
|
|
8843
8872
|
width: "18",
|
|
8844
8873
|
height: "10",
|
|
8845
8874
|
rx: "2"
|
|
8846
8875
|
}),
|
|
8847
|
-
/* @__PURE__ */
|
|
8876
|
+
/* @__PURE__ */ c("circle", {
|
|
8848
8877
|
cx: "12",
|
|
8849
8878
|
cy: "5",
|
|
8850
8879
|
r: "2"
|
|
8851
8880
|
}),
|
|
8852
|
-
/* @__PURE__ */
|
|
8853
|
-
/* @__PURE__ */
|
|
8881
|
+
/* @__PURE__ */ c("path", { d: "M12 7v4" }),
|
|
8882
|
+
/* @__PURE__ */ c("line", {
|
|
8854
8883
|
x1: "8",
|
|
8855
8884
|
y1: "16",
|
|
8856
8885
|
x2: "8",
|
|
8857
8886
|
y2: "16"
|
|
8858
8887
|
}),
|
|
8859
|
-
/* @__PURE__ */
|
|
8888
|
+
/* @__PURE__ */ c("line", {
|
|
8860
8889
|
x1: "16",
|
|
8861
8890
|
y1: "16",
|
|
8862
8891
|
x2: "16",
|
|
@@ -8865,52 +8894,52 @@ function Ks() {
|
|
|
8865
8894
|
]
|
|
8866
8895
|
});
|
|
8867
8896
|
}
|
|
8868
|
-
function
|
|
8897
|
+
function eo({ title: e, description: t, suggestedQuestions: r, avatarUrl: a, onSelect: n }) {
|
|
8869
8898
|
const i = (r ?? []).filter((s) => (s.title ?? "").trim().length > 0);
|
|
8870
8899
|
return /* @__PURE__ */ y("div", {
|
|
8871
8900
|
className: "ak-empty-state",
|
|
8872
8901
|
"aria-label": "Start a conversation",
|
|
8873
8902
|
children: [
|
|
8874
|
-
/* @__PURE__ */
|
|
8903
|
+
/* @__PURE__ */ c("div", {
|
|
8875
8904
|
className: "ak-empty-state__glow",
|
|
8876
8905
|
"aria-hidden": "true"
|
|
8877
8906
|
}),
|
|
8878
8907
|
/* @__PURE__ */ y("div", {
|
|
8879
8908
|
className: "ak-empty-state__body",
|
|
8880
8909
|
children: [
|
|
8881
|
-
/* @__PURE__ */
|
|
8910
|
+
/* @__PURE__ */ c("div", {
|
|
8882
8911
|
className: "ak-empty-state__avatar",
|
|
8883
|
-
children: a ? /* @__PURE__ */
|
|
8912
|
+
children: a ? /* @__PURE__ */ c("img", {
|
|
8884
8913
|
src: a,
|
|
8885
8914
|
alt: "",
|
|
8886
8915
|
className: "ak-empty-state__avatar-img",
|
|
8887
8916
|
"aria-hidden": "true"
|
|
8888
|
-
}) : /* @__PURE__ */
|
|
8917
|
+
}) : /* @__PURE__ */ c("span", {
|
|
8889
8918
|
className: "ak-empty-state__bot-icon",
|
|
8890
8919
|
"aria-hidden": "true",
|
|
8891
|
-
children: /* @__PURE__ */
|
|
8920
|
+
children: /* @__PURE__ */ c(qs, {})
|
|
8892
8921
|
})
|
|
8893
8922
|
}),
|
|
8894
|
-
/* @__PURE__ */
|
|
8923
|
+
/* @__PURE__ */ c("p", {
|
|
8895
8924
|
className: "ak-empty-state__title",
|
|
8896
8925
|
children: e
|
|
8897
8926
|
}),
|
|
8898
|
-
t && /* @__PURE__ */
|
|
8927
|
+
t && /* @__PURE__ */ c("p", {
|
|
8899
8928
|
className: "ak-empty-state__description",
|
|
8900
8929
|
children: t
|
|
8901
8930
|
})
|
|
8902
8931
|
]
|
|
8903
8932
|
}),
|
|
8904
|
-
i.length > 0 && /* @__PURE__ */
|
|
8933
|
+
i.length > 0 && /* @__PURE__ */ c("div", {
|
|
8905
8934
|
className: "ak-empty-state__suggestions",
|
|
8906
8935
|
children: i.map((s, o) => /* @__PURE__ */ y("button", {
|
|
8907
8936
|
className: "ak-empty-state__suggestion",
|
|
8908
8937
|
onClick: () => n?.(s.prompt ?? s.title),
|
|
8909
8938
|
type: "button",
|
|
8910
|
-
children: [/* @__PURE__ */
|
|
8939
|
+
children: [/* @__PURE__ */ c("span", {
|
|
8911
8940
|
className: "ak-empty-state__suggestion-title",
|
|
8912
8941
|
children: s.title
|
|
8913
|
-
}), s.description && /* @__PURE__ */
|
|
8942
|
+
}), s.description && /* @__PURE__ */ c("span", {
|
|
8914
8943
|
className: "ak-empty-state__suggestion-desc",
|
|
8915
8944
|
children: s.description
|
|
8916
8945
|
})]
|
|
@@ -8919,8 +8948,8 @@ function qs({ title: e, description: t, suggestedQuestions: r, avatarUrl: a, onS
|
|
|
8919
8948
|
]
|
|
8920
8949
|
});
|
|
8921
8950
|
}
|
|
8922
|
-
var
|
|
8923
|
-
function
|
|
8951
|
+
var to = "https://klicforge.ai/privacy-policy", ro = "https://klicforge.ai/terms-of-service";
|
|
8952
|
+
function ao() {
|
|
8924
8953
|
return /* @__PURE__ */ y("svg", {
|
|
8925
8954
|
width: "16",
|
|
8926
8955
|
height: "16",
|
|
@@ -8930,15 +8959,15 @@ function ro() {
|
|
|
8930
8959
|
strokeWidth: "2.5",
|
|
8931
8960
|
strokeLinecap: "round",
|
|
8932
8961
|
strokeLinejoin: "round",
|
|
8933
|
-
children: [/* @__PURE__ */
|
|
8962
|
+
children: [/* @__PURE__ */ c("line", {
|
|
8934
8963
|
x1: "22",
|
|
8935
8964
|
y1: "2",
|
|
8936
8965
|
x2: "11",
|
|
8937
8966
|
y2: "13"
|
|
8938
|
-
}), /* @__PURE__ */
|
|
8967
|
+
}), /* @__PURE__ */ c("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })]
|
|
8939
8968
|
});
|
|
8940
8969
|
}
|
|
8941
|
-
function
|
|
8970
|
+
function no() {
|
|
8942
8971
|
return /* @__PURE__ */ y("svg", {
|
|
8943
8972
|
width: "14",
|
|
8944
8973
|
height: "14",
|
|
@@ -8947,12 +8976,12 @@ function ao() {
|
|
|
8947
8976
|
stroke: "currentColor",
|
|
8948
8977
|
strokeWidth: "2.5",
|
|
8949
8978
|
strokeLinecap: "round",
|
|
8950
|
-
children: [/* @__PURE__ */
|
|
8979
|
+
children: [/* @__PURE__ */ c("line", {
|
|
8951
8980
|
x1: "12",
|
|
8952
8981
|
y1: "5",
|
|
8953
8982
|
x2: "12",
|
|
8954
8983
|
y2: "19"
|
|
8955
|
-
}), /* @__PURE__ */
|
|
8984
|
+
}), /* @__PURE__ */ c("line", {
|
|
8956
8985
|
x1: "5",
|
|
8957
8986
|
y1: "12",
|
|
8958
8987
|
x2: "19",
|
|
@@ -8960,7 +8989,7 @@ function ao() {
|
|
|
8960
8989
|
})]
|
|
8961
8990
|
});
|
|
8962
8991
|
}
|
|
8963
|
-
function
|
|
8992
|
+
function io() {
|
|
8964
8993
|
return /* @__PURE__ */ y("svg", {
|
|
8965
8994
|
width: "14",
|
|
8966
8995
|
height: "14",
|
|
@@ -8970,7 +8999,7 @@ function no() {
|
|
|
8970
8999
|
strokeWidth: "2",
|
|
8971
9000
|
strokeLinecap: "round",
|
|
8972
9001
|
strokeLinejoin: "round",
|
|
8973
|
-
children: [/* @__PURE__ */
|
|
9002
|
+
children: [/* @__PURE__ */ c("path", { d: "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z" }), /* @__PURE__ */ c("circle", {
|
|
8974
9003
|
cx: "12",
|
|
8975
9004
|
cy: "13",
|
|
8976
9005
|
r: "4"
|
|
@@ -8987,7 +9016,7 @@ function Sr() {
|
|
|
8987
9016
|
strokeWidth: "2",
|
|
8988
9017
|
strokeLinecap: "round",
|
|
8989
9018
|
strokeLinejoin: "round",
|
|
8990
|
-
children: [/* @__PURE__ */
|
|
9019
|
+
children: [/* @__PURE__ */ c("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), /* @__PURE__ */ c("polyline", { points: "14 2 14 8 20 8" })]
|
|
8991
9020
|
});
|
|
8992
9021
|
}
|
|
8993
9022
|
function Cr() {
|
|
@@ -9000,12 +9029,12 @@ function Cr() {
|
|
|
9000
9029
|
strokeWidth: "3",
|
|
9001
9030
|
strokeLinecap: "round",
|
|
9002
9031
|
strokeLinejoin: "round",
|
|
9003
|
-
children: [/* @__PURE__ */
|
|
9032
|
+
children: [/* @__PURE__ */ c("line", {
|
|
9004
9033
|
x1: "18",
|
|
9005
9034
|
y1: "6",
|
|
9006
9035
|
x2: "6",
|
|
9007
9036
|
y2: "18"
|
|
9008
|
-
}), /* @__PURE__ */
|
|
9037
|
+
}), /* @__PURE__ */ c("line", {
|
|
9009
9038
|
x1: "6",
|
|
9010
9039
|
y1: "6",
|
|
9011
9040
|
x2: "18",
|
|
@@ -9023,60 +9052,60 @@ var sa = [
|
|
|
9023
9052
|
".md",
|
|
9024
9053
|
".txt",
|
|
9025
9054
|
".csv"
|
|
9026
|
-
],
|
|
9055
|
+
], so = [...oa, ...sa].join(","), la = [
|
|
9027
9056
|
"image/jpeg",
|
|
9028
9057
|
"image/png",
|
|
9029
9058
|
"image/gif",
|
|
9030
9059
|
"image/webp"
|
|
9031
|
-
],
|
|
9032
|
-
function
|
|
9060
|
+
], oo = la.join(",");
|
|
9061
|
+
function lo(e) {
|
|
9033
9062
|
if (sa.includes(e.type)) return !0;
|
|
9034
9063
|
const t = e.name.toLowerCase();
|
|
9035
9064
|
return oa.some((r) => t.endsWith(r));
|
|
9036
9065
|
}
|
|
9037
|
-
function
|
|
9066
|
+
function co(e) {
|
|
9038
9067
|
return la.includes(e.type);
|
|
9039
9068
|
}
|
|
9040
|
-
function
|
|
9041
|
-
const [o, l] = ne(""), [
|
|
9069
|
+
function uo({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…", photoSendingEnabled: a = !1, fileUploadEnabled: n = !1, attachmentMaxCount: i = 5, attachmentMaxFileSizeMb: s = 1 }) {
|
|
9070
|
+
const [o, l] = ne(""), [d, h] = ne([]), [u, p] = ne(/* @__PURE__ */ new Map()), [f, k] = ne(!1), v = he(null), S = he(null), g = he(null), w = he(null), R = he(null), F = a || n, $ = Mr(() => s * 1024 * 1024, [s]);
|
|
9042
9071
|
X(() => () => {
|
|
9043
|
-
|
|
9072
|
+
u.forEach((M) => URL.revokeObjectURL(M));
|
|
9044
9073
|
}, []), X(() => {
|
|
9045
|
-
t ||
|
|
9074
|
+
t || v.current?.focus();
|
|
9046
9075
|
}, [t]);
|
|
9047
|
-
const
|
|
9076
|
+
const U = pa((M) => {
|
|
9048
9077
|
if (!f) return;
|
|
9049
|
-
const O = M.composedPath ? M.composedPath() : [], K = !!
|
|
9050
|
-
!K &&
|
|
9078
|
+
const O = M.composedPath ? M.composedPath() : [], K = !!w.current && O.includes(w.current), V = !!R.current && O.includes(R.current);
|
|
9079
|
+
!K && !V && k(!1);
|
|
9051
9080
|
}, [f]);
|
|
9052
9081
|
X(() => {
|
|
9053
9082
|
if (f)
|
|
9054
|
-
return document.addEventListener("click",
|
|
9055
|
-
}, [f,
|
|
9056
|
-
|
|
9057
|
-
}, [
|
|
9083
|
+
return document.addEventListener("click", U), () => document.removeEventListener("click", U);
|
|
9084
|
+
}, [f, U]), X(() => {
|
|
9085
|
+
F || k(!1);
|
|
9086
|
+
}, [F]);
|
|
9058
9087
|
function ae() {
|
|
9059
|
-
|
|
9088
|
+
u.forEach((M) => URL.revokeObjectURL(M)), p(/* @__PURE__ */ new Map()), h([]), S.current && (S.current.value = ""), g.current && (g.current.value = "");
|
|
9060
9089
|
}
|
|
9061
9090
|
function T(M) {
|
|
9062
|
-
|
|
9091
|
+
h((O) => {
|
|
9063
9092
|
const K = O[M];
|
|
9064
9093
|
if (K) {
|
|
9065
|
-
const
|
|
9066
|
-
|
|
9094
|
+
const V = u.get(K.file);
|
|
9095
|
+
V && (URL.revokeObjectURL(V), p((G) => {
|
|
9067
9096
|
const Ae = new Map(G);
|
|
9068
9097
|
return Ae.delete(K.file), Ae;
|
|
9069
9098
|
}));
|
|
9070
9099
|
}
|
|
9071
|
-
return O.filter((
|
|
9100
|
+
return O.filter((V, G) => G !== M);
|
|
9072
9101
|
});
|
|
9073
9102
|
}
|
|
9074
|
-
function
|
|
9103
|
+
function N() {
|
|
9075
9104
|
const M = o.trim();
|
|
9076
|
-
!M &&
|
|
9105
|
+
!M && d.length === 0 || t || (e(M, d), l(""), ae(), v.current && (v.current.style.height = "auto"));
|
|
9077
9106
|
}
|
|
9078
|
-
function
|
|
9079
|
-
M.key === "Enter" && !M.shiftKey && (M.preventDefault(),
|
|
9107
|
+
function P(M) {
|
|
9108
|
+
M.key === "Enter" && !M.shiftKey && (M.preventDefault(), N());
|
|
9080
9109
|
}
|
|
9081
9110
|
function ce(M) {
|
|
9082
9111
|
const O = M.currentTarget;
|
|
@@ -9084,18 +9113,18 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
|
|
|
9084
9113
|
}
|
|
9085
9114
|
function Te(M, O) {
|
|
9086
9115
|
if (M.length === 0) return;
|
|
9087
|
-
const K = [],
|
|
9116
|
+
const K = [], V = [];
|
|
9088
9117
|
for (const G of M) {
|
|
9089
|
-
if (O === "image" && !
|
|
9090
|
-
|
|
9118
|
+
if (O === "image" && !co(G)) {
|
|
9119
|
+
V.push(`${G.name} (image type not supported)`);
|
|
9091
9120
|
continue;
|
|
9092
9121
|
}
|
|
9093
|
-
if (O === "file" && !
|
|
9094
|
-
|
|
9122
|
+
if (O === "file" && !lo(G)) {
|
|
9123
|
+
V.push(`${G.name} (file type not supported)`);
|
|
9095
9124
|
continue;
|
|
9096
9125
|
}
|
|
9097
|
-
if (G.size >
|
|
9098
|
-
|
|
9126
|
+
if (G.size > $) {
|
|
9127
|
+
V.push(`${G.name} (over ${s} MB)`);
|
|
9099
9128
|
continue;
|
|
9100
9129
|
}
|
|
9101
9130
|
K.push({
|
|
@@ -9103,15 +9132,15 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
|
|
|
9103
9132
|
kind: O
|
|
9104
9133
|
});
|
|
9105
9134
|
}
|
|
9106
|
-
|
|
9135
|
+
h((G) => {
|
|
9107
9136
|
const Ae = [...G, ...K], Kt = Ae.slice(0, i);
|
|
9108
|
-
return Ae.length > i &&
|
|
9137
|
+
return Ae.length > i && V.push(`max ${i} attachments allowed`), p((ha) => {
|
|
9109
9138
|
const mt = new Map(ha);
|
|
9110
9139
|
for (const Be of Kt) Be.kind === "image" && !mt.has(Be.file) && mt.set(Be.file, URL.createObjectURL(Be.file));
|
|
9111
9140
|
return mt;
|
|
9112
9141
|
}), Kt;
|
|
9113
|
-
}),
|
|
9114
|
-
• ${
|
|
9142
|
+
}), V.length > 0 && alert(`Some attachments were not added:
|
|
9143
|
+
• ${V.join(`
|
|
9115
9144
|
• `)}`);
|
|
9116
9145
|
}
|
|
9117
9146
|
function Ue(M) {
|
|
@@ -9123,17 +9152,17 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
|
|
|
9123
9152
|
M.currentTarget.value = "", Te(O, "file");
|
|
9124
9153
|
}
|
|
9125
9154
|
function ca() {
|
|
9126
|
-
|
|
9155
|
+
k(!1), S.current?.click();
|
|
9127
9156
|
}
|
|
9128
9157
|
function da() {
|
|
9129
|
-
|
|
9158
|
+
k(!1), g.current?.click();
|
|
9130
9159
|
}
|
|
9131
|
-
const ua = !t && (!!o.trim() ||
|
|
9160
|
+
const ua = !t && (!!o.trim() || d.length > 0);
|
|
9132
9161
|
return /* @__PURE__ */ y("div", {
|
|
9133
9162
|
className: "ak-composer",
|
|
9134
9163
|
children: [
|
|
9135
|
-
|
|
9136
|
-
ref:
|
|
9164
|
+
F && f && /* @__PURE__ */ y("div", {
|
|
9165
|
+
ref: w,
|
|
9137
9166
|
className: "ak-composer__attach-menu",
|
|
9138
9167
|
role: "menu",
|
|
9139
9168
|
children: [a && /* @__PURE__ */ y("button", {
|
|
@@ -9142,37 +9171,37 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
|
|
|
9142
9171
|
type: "button",
|
|
9143
9172
|
role: "menuitem",
|
|
9144
9173
|
disabled: t,
|
|
9145
|
-
children: [/* @__PURE__ */
|
|
9174
|
+
children: [/* @__PURE__ */ c(io, {}), /* @__PURE__ */ c("span", { children: "Photo" })]
|
|
9146
9175
|
}), n && /* @__PURE__ */ y("button", {
|
|
9147
9176
|
className: "ak-composer__attach-menu-item",
|
|
9148
9177
|
onClick: da,
|
|
9149
9178
|
type: "button",
|
|
9150
9179
|
role: "menuitem",
|
|
9151
9180
|
disabled: t,
|
|
9152
|
-
children: [/* @__PURE__ */
|
|
9181
|
+
children: [/* @__PURE__ */ c(Sr, {}), /* @__PURE__ */ c("span", { children: "File" })]
|
|
9153
9182
|
})]
|
|
9154
9183
|
}),
|
|
9155
|
-
|
|
9184
|
+
d.length > 0 && /* @__PURE__ */ c("div", {
|
|
9156
9185
|
className: "ak-composer__attachments",
|
|
9157
9186
|
role: "list",
|
|
9158
|
-
children:
|
|
9187
|
+
children: d.map((M, O) => {
|
|
9159
9188
|
const K = `${M.file.name}-${O}`;
|
|
9160
9189
|
if (M.kind === "image") {
|
|
9161
|
-
const
|
|
9190
|
+
const V = u.get(M.file);
|
|
9162
9191
|
return /* @__PURE__ */ y("div", {
|
|
9163
9192
|
className: "ak-composer__preview-wrap",
|
|
9164
9193
|
role: "listitem",
|
|
9165
|
-
children: [
|
|
9166
|
-
src:
|
|
9194
|
+
children: [V && /* @__PURE__ */ c("img", {
|
|
9195
|
+
src: V,
|
|
9167
9196
|
alt: M.file.name,
|
|
9168
9197
|
className: "ak-composer__preview-img"
|
|
9169
|
-
}), /* @__PURE__ */
|
|
9198
|
+
}), /* @__PURE__ */ c("button", {
|
|
9170
9199
|
className: "ak-composer__preview-remove",
|
|
9171
9200
|
onClick: () => T(O),
|
|
9172
9201
|
type: "button",
|
|
9173
9202
|
"aria-label": `Remove ${M.file.name}`,
|
|
9174
9203
|
disabled: t,
|
|
9175
|
-
children: /* @__PURE__ */
|
|
9204
|
+
children: /* @__PURE__ */ c(Cr, {})
|
|
9176
9205
|
})]
|
|
9177
9206
|
}, K);
|
|
9178
9207
|
}
|
|
@@ -9180,19 +9209,19 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
|
|
|
9180
9209
|
className: "ak-composer__file-chip",
|
|
9181
9210
|
role: "listitem",
|
|
9182
9211
|
children: [
|
|
9183
|
-
/* @__PURE__ */
|
|
9184
|
-
/* @__PURE__ */
|
|
9212
|
+
/* @__PURE__ */ c(Sr, {}),
|
|
9213
|
+
/* @__PURE__ */ c("span", {
|
|
9185
9214
|
className: "ak-composer__file-chip-name",
|
|
9186
9215
|
title: M.file.name,
|
|
9187
9216
|
children: M.file.name
|
|
9188
9217
|
}),
|
|
9189
|
-
/* @__PURE__ */
|
|
9218
|
+
/* @__PURE__ */ c("button", {
|
|
9190
9219
|
className: "ak-composer__file-chip-remove",
|
|
9191
9220
|
onClick: () => T(O),
|
|
9192
9221
|
type: "button",
|
|
9193
9222
|
"aria-label": `Remove ${M.file.name}`,
|
|
9194
9223
|
disabled: t,
|
|
9195
|
-
children: /* @__PURE__ */
|
|
9224
|
+
children: /* @__PURE__ */ c(Cr, {})
|
|
9196
9225
|
})
|
|
9197
9226
|
]
|
|
9198
9227
|
}, K);
|
|
@@ -9201,60 +9230,60 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
|
|
|
9201
9230
|
/* @__PURE__ */ y("div", {
|
|
9202
9231
|
className: "ak-composer__input-wrap",
|
|
9203
9232
|
children: [
|
|
9204
|
-
|
|
9205
|
-
a && /* @__PURE__ */
|
|
9206
|
-
ref:
|
|
9233
|
+
F && /* @__PURE__ */ y(ye, { children: [
|
|
9234
|
+
a && /* @__PURE__ */ c("input", {
|
|
9235
|
+
ref: S,
|
|
9207
9236
|
type: "file",
|
|
9208
9237
|
multiple: !0,
|
|
9209
|
-
accept:
|
|
9238
|
+
accept: oo,
|
|
9210
9239
|
className: "ak-composer__file-input",
|
|
9211
9240
|
onChange: Ue,
|
|
9212
9241
|
disabled: t,
|
|
9213
9242
|
"aria-label": "Attach images"
|
|
9214
9243
|
}),
|
|
9215
|
-
n && /* @__PURE__ */
|
|
9244
|
+
n && /* @__PURE__ */ c("input", {
|
|
9216
9245
|
ref: g,
|
|
9217
9246
|
type: "file",
|
|
9218
9247
|
multiple: !0,
|
|
9219
|
-
accept:
|
|
9248
|
+
accept: so,
|
|
9220
9249
|
className: "ak-composer__file-input",
|
|
9221
9250
|
onChange: pt,
|
|
9222
9251
|
disabled: t,
|
|
9223
9252
|
"aria-label": "Attach files"
|
|
9224
9253
|
}),
|
|
9225
|
-
/* @__PURE__ */
|
|
9254
|
+
/* @__PURE__ */ c("div", {
|
|
9226
9255
|
className: "ak-composer__attach-wrap",
|
|
9227
|
-
children: /* @__PURE__ */
|
|
9228
|
-
ref:
|
|
9256
|
+
children: /* @__PURE__ */ c("button", {
|
|
9257
|
+
ref: R,
|
|
9229
9258
|
className: `ak-composer__attach${f ? " ak-composer__attach--open" : ""}`,
|
|
9230
|
-
onClick: () =>
|
|
9259
|
+
onClick: () => k((M) => !M),
|
|
9231
9260
|
disabled: t,
|
|
9232
9261
|
"aria-label": "Attachment options",
|
|
9233
9262
|
"aria-haspopup": "true",
|
|
9234
9263
|
"aria-expanded": f,
|
|
9235
9264
|
type: "button",
|
|
9236
|
-
children: /* @__PURE__ */
|
|
9265
|
+
children: /* @__PURE__ */ c(no, {})
|
|
9237
9266
|
})
|
|
9238
9267
|
})
|
|
9239
9268
|
] }),
|
|
9240
|
-
/* @__PURE__ */
|
|
9241
|
-
ref:
|
|
9269
|
+
/* @__PURE__ */ c("textarea", {
|
|
9270
|
+
ref: v,
|
|
9242
9271
|
className: "ak-composer__input",
|
|
9243
9272
|
value: o,
|
|
9244
9273
|
onInput: ce,
|
|
9245
|
-
onKeyDown:
|
|
9274
|
+
onKeyDown: P,
|
|
9246
9275
|
placeholder: r,
|
|
9247
9276
|
disabled: t,
|
|
9248
9277
|
rows: 1,
|
|
9249
9278
|
"aria-label": "Message input"
|
|
9250
9279
|
}),
|
|
9251
|
-
/* @__PURE__ */
|
|
9280
|
+
/* @__PURE__ */ c("button", {
|
|
9252
9281
|
className: "ak-composer__send",
|
|
9253
|
-
onClick:
|
|
9282
|
+
onClick: N,
|
|
9254
9283
|
disabled: !ua,
|
|
9255
9284
|
"aria-label": "Send message",
|
|
9256
9285
|
type: "button",
|
|
9257
|
-
children: /* @__PURE__ */
|
|
9286
|
+
children: /* @__PURE__ */ c(ao, {})
|
|
9258
9287
|
})
|
|
9259
9288
|
]
|
|
9260
9289
|
}),
|
|
@@ -9263,8 +9292,8 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
|
|
|
9263
9292
|
children: [
|
|
9264
9293
|
"By chatting you agree to our",
|
|
9265
9294
|
" ",
|
|
9266
|
-
/* @__PURE__ */
|
|
9267
|
-
href:
|
|
9295
|
+
/* @__PURE__ */ c("a", {
|
|
9296
|
+
href: to,
|
|
9268
9297
|
target: "_blank",
|
|
9269
9298
|
rel: "noopener noreferrer",
|
|
9270
9299
|
children: "Privacy Policy"
|
|
@@ -9272,8 +9301,8 @@ function co({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
|
|
|
9272
9301
|
" ",
|
|
9273
9302
|
"and",
|
|
9274
9303
|
" ",
|
|
9275
|
-
/* @__PURE__ */
|
|
9276
|
-
href:
|
|
9304
|
+
/* @__PURE__ */ c("a", {
|
|
9305
|
+
href: ro,
|
|
9277
9306
|
target: "_blank",
|
|
9278
9307
|
rel: "noopener noreferrer",
|
|
9279
9308
|
children: "Terms of Service"
|
|
@@ -9289,15 +9318,15 @@ function Ir({ message: e }) {
|
|
|
9289
9318
|
return e.includes("Origin not allowed") ? /* @__PURE__ */ y("div", {
|
|
9290
9319
|
className: "ak-error ak-error--origin",
|
|
9291
9320
|
role: "alert",
|
|
9292
|
-
children: [/* @__PURE__ */
|
|
9321
|
+
children: [/* @__PURE__ */ c("div", {
|
|
9293
9322
|
className: "ak-error__icon",
|
|
9294
9323
|
children: "🔒"
|
|
9295
9324
|
}), /* @__PURE__ */ y("div", {
|
|
9296
9325
|
className: "ak-error__content",
|
|
9297
|
-
children: [/* @__PURE__ */
|
|
9326
|
+
children: [/* @__PURE__ */ c("h3", {
|
|
9298
9327
|
className: "ak-error__title",
|
|
9299
9328
|
children: "Access Restricted"
|
|
9300
|
-
}), /* @__PURE__ */
|
|
9329
|
+
}), /* @__PURE__ */ c("p", {
|
|
9301
9330
|
className: "ak-error__description",
|
|
9302
9331
|
children: "This widget has been restricted to specific websites only. Contact the website administrator if you believe this is an error."
|
|
9303
9332
|
})]
|
|
@@ -9305,19 +9334,19 @@ function Ir({ message: e }) {
|
|
|
9305
9334
|
}) : /* @__PURE__ */ y("div", {
|
|
9306
9335
|
className: "ak-error",
|
|
9307
9336
|
role: "alert",
|
|
9308
|
-
children: [/* @__PURE__ */
|
|
9337
|
+
children: [/* @__PURE__ */ c("div", {
|
|
9309
9338
|
className: "ak-error__icon",
|
|
9310
9339
|
children: "⚠️"
|
|
9311
|
-
}), /* @__PURE__ */
|
|
9340
|
+
}), /* @__PURE__ */ c("div", {
|
|
9312
9341
|
className: "ak-error__content",
|
|
9313
|
-
children: /* @__PURE__ */
|
|
9342
|
+
children: /* @__PURE__ */ c("p", {
|
|
9314
9343
|
className: "ak-error__message",
|
|
9315
9344
|
children: e
|
|
9316
9345
|
})
|
|
9317
9346
|
})]
|
|
9318
9347
|
});
|
|
9319
9348
|
}
|
|
9320
|
-
function
|
|
9349
|
+
function ho() {
|
|
9321
9350
|
return /* @__PURE__ */ y("svg", {
|
|
9322
9351
|
width: "28",
|
|
9323
9352
|
height: "28",
|
|
@@ -9328,39 +9357,39 @@ function uo() {
|
|
|
9328
9357
|
strokeLinecap: "round",
|
|
9329
9358
|
strokeLinejoin: "round",
|
|
9330
9359
|
"aria-hidden": "true",
|
|
9331
|
-
children: [/* @__PURE__ */
|
|
9360
|
+
children: [/* @__PURE__ */ c("circle", {
|
|
9332
9361
|
cx: "12",
|
|
9333
9362
|
cy: "12",
|
|
9334
9363
|
r: "9"
|
|
9335
|
-
}), /* @__PURE__ */
|
|
9364
|
+
}), /* @__PURE__ */ c("path", { d: "M12 7v5l3 2" })]
|
|
9336
9365
|
});
|
|
9337
9366
|
}
|
|
9338
|
-
function
|
|
9367
|
+
function fo() {
|
|
9339
9368
|
return /* @__PURE__ */ y("div", {
|
|
9340
9369
|
className: "ak-maintenance",
|
|
9341
9370
|
role: "status",
|
|
9342
9371
|
"aria-live": "polite",
|
|
9343
9372
|
children: [
|
|
9344
|
-
/* @__PURE__ */
|
|
9373
|
+
/* @__PURE__ */ c("div", {
|
|
9345
9374
|
className: "ak-maintenance__halo",
|
|
9346
9375
|
"aria-hidden": "true"
|
|
9347
9376
|
}),
|
|
9348
|
-
/* @__PURE__ */
|
|
9377
|
+
/* @__PURE__ */ c("div", {
|
|
9349
9378
|
className: "ak-maintenance__icon",
|
|
9350
|
-
children: /* @__PURE__ */
|
|
9379
|
+
children: /* @__PURE__ */ c(ho, {})
|
|
9351
9380
|
}),
|
|
9352
|
-
/* @__PURE__ */
|
|
9381
|
+
/* @__PURE__ */ c("p", {
|
|
9353
9382
|
className: "ak-maintenance__title",
|
|
9354
9383
|
children: "Under maintenance"
|
|
9355
9384
|
}),
|
|
9356
|
-
/* @__PURE__ */
|
|
9385
|
+
/* @__PURE__ */ c("p", {
|
|
9357
9386
|
className: "ak-maintenance__description",
|
|
9358
9387
|
children: "This assistant is temporarily unavailable. Please check back in a little while."
|
|
9359
9388
|
})
|
|
9360
9389
|
]
|
|
9361
9390
|
});
|
|
9362
9391
|
}
|
|
9363
|
-
function
|
|
9392
|
+
function po() {
|
|
9364
9393
|
return /* @__PURE__ */ y("svg", {
|
|
9365
9394
|
width: "11",
|
|
9366
9395
|
height: "11",
|
|
@@ -9368,27 +9397,27 @@ function fo() {
|
|
|
9368
9397
|
fill: "none",
|
|
9369
9398
|
"aria-hidden": "true",
|
|
9370
9399
|
className: "ak-branding__logo",
|
|
9371
|
-
children: [/* @__PURE__ */
|
|
9400
|
+
children: [/* @__PURE__ */ c("rect", {
|
|
9372
9401
|
width: "24",
|
|
9373
9402
|
height: "24",
|
|
9374
9403
|
rx: "5",
|
|
9375
9404
|
fill: "currentColor"
|
|
9376
|
-
}), /* @__PURE__ */
|
|
9405
|
+
}), /* @__PURE__ */ c("path", {
|
|
9377
9406
|
d: "M12 5L7 13h3.5v6l6.5-9H13.5V5z",
|
|
9378
9407
|
fill: "white"
|
|
9379
9408
|
})]
|
|
9380
9409
|
});
|
|
9381
9410
|
}
|
|
9382
|
-
function
|
|
9411
|
+
function mo() {
|
|
9383
9412
|
return /* @__PURE__ */ y("div", {
|
|
9384
9413
|
className: "ak-branding",
|
|
9385
9414
|
children: [
|
|
9386
|
-
/* @__PURE__ */
|
|
9387
|
-
/* @__PURE__ */
|
|
9415
|
+
/* @__PURE__ */ c(po, {}),
|
|
9416
|
+
/* @__PURE__ */ c("span", {
|
|
9388
9417
|
className: "ak-branding__label",
|
|
9389
9418
|
children: "Powered by"
|
|
9390
9419
|
}),
|
|
9391
|
-
/* @__PURE__ */
|
|
9420
|
+
/* @__PURE__ */ c("span", {
|
|
9392
9421
|
className: "ak-branding__name",
|
|
9393
9422
|
children: "KlicForge"
|
|
9394
9423
|
})
|
|
@@ -9403,7 +9432,7 @@ function Nr({ config: e, messages: t, isLoading: r, error: a, isInline: n, initS
|
|
|
9403
9432
|
role: "dialog",
|
|
9404
9433
|
"aria-label": e.title,
|
|
9405
9434
|
children: [
|
|
9406
|
-
/* @__PURE__ */
|
|
9435
|
+
/* @__PURE__ */ c($s, {
|
|
9407
9436
|
title: e.title,
|
|
9408
9437
|
subtitle: e.subtitle,
|
|
9409
9438
|
avatarUrl: e.avatarUrl,
|
|
@@ -9411,34 +9440,34 @@ function Nr({ config: e, messages: t, isLoading: r, error: a, isInline: n, initS
|
|
|
9411
9440
|
onReset: i === "ready" ? o.onReset : void 0,
|
|
9412
9441
|
hideClose: n
|
|
9413
9442
|
}),
|
|
9414
|
-
i === "validating" && /* @__PURE__ */
|
|
9443
|
+
i === "validating" && /* @__PURE__ */ c("div", {
|
|
9415
9444
|
className: "ak-init-status",
|
|
9416
|
-
children: /* @__PURE__ */
|
|
9445
|
+
children: /* @__PURE__ */ c("div", {
|
|
9417
9446
|
className: "ak-init-spinner",
|
|
9418
9447
|
"aria-label": "Connecting…"
|
|
9419
9448
|
})
|
|
9420
9449
|
}),
|
|
9421
|
-
i === "error" && /* @__PURE__ */
|
|
9450
|
+
i === "error" && /* @__PURE__ */ c("div", {
|
|
9422
9451
|
className: "ak-init-status ak-init-status--error",
|
|
9423
|
-
children: /* @__PURE__ */
|
|
9452
|
+
children: /* @__PURE__ */ c(Ir, { message: s ?? "Widget configuration is invalid." })
|
|
9424
9453
|
}),
|
|
9425
|
-
i === "disabled" && /* @__PURE__ */
|
|
9454
|
+
i === "disabled" && /* @__PURE__ */ c("div", {
|
|
9426
9455
|
className: "ak-init-status ak-init-status--maintenance",
|
|
9427
|
-
children: /* @__PURE__ */
|
|
9456
|
+
children: /* @__PURE__ */ c(fo, {})
|
|
9428
9457
|
}),
|
|
9429
|
-
i === "ready" && /* @__PURE__ */ y(
|
|
9430
|
-
t.length === 0 ? /* @__PURE__ */
|
|
9458
|
+
i === "ready" && /* @__PURE__ */ y(ye, { children: [
|
|
9459
|
+
t.length === 0 ? /* @__PURE__ */ c(eo, {
|
|
9431
9460
|
title: e.title,
|
|
9432
9461
|
description: e.description ?? e.subtitle,
|
|
9433
9462
|
suggestedQuestions: e.suggestedQuestions,
|
|
9434
9463
|
avatarUrl: e.avatarUrl,
|
|
9435
9464
|
onSelect: (l) => o.onSendMessage(l, [])
|
|
9436
|
-
}) : /* @__PURE__ */
|
|
9465
|
+
}) : /* @__PURE__ */ c(Ks, {
|
|
9437
9466
|
messages: t,
|
|
9438
9467
|
isLoading: r
|
|
9439
9468
|
}),
|
|
9440
|
-
a && /* @__PURE__ */
|
|
9441
|
-
/* @__PURE__ */
|
|
9469
|
+
a && /* @__PURE__ */ c(Ir, { message: a }),
|
|
9470
|
+
/* @__PURE__ */ c(uo, {
|
|
9442
9471
|
onSend: o.onSendMessage,
|
|
9443
9472
|
disabled: r,
|
|
9444
9473
|
placeholder: "Type a message…",
|
|
@@ -9449,11 +9478,11 @@ function Nr({ config: e, messages: t, isLoading: r, error: a, isInline: n, initS
|
|
|
9449
9478
|
})
|
|
9450
9479
|
] })
|
|
9451
9480
|
]
|
|
9452
|
-
}), !n && /* @__PURE__ */
|
|
9481
|
+
}), !n && /* @__PURE__ */ c(mo, {})]
|
|
9453
9482
|
});
|
|
9454
9483
|
}
|
|
9455
|
-
function
|
|
9456
|
-
return /* @__PURE__ */
|
|
9484
|
+
function go() {
|
|
9485
|
+
return /* @__PURE__ */ c("svg", {
|
|
9457
9486
|
width: "24",
|
|
9458
9487
|
height: "24",
|
|
9459
9488
|
viewBox: "0 0 24 24",
|
|
@@ -9462,11 +9491,11 @@ function mo() {
|
|
|
9462
9491
|
strokeWidth: "2",
|
|
9463
9492
|
strokeLinecap: "round",
|
|
9464
9493
|
strokeLinejoin: "round",
|
|
9465
|
-
children: /* @__PURE__ */
|
|
9494
|
+
children: /* @__PURE__ */ c("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
|
|
9466
9495
|
});
|
|
9467
9496
|
}
|
|
9468
|
-
function
|
|
9469
|
-
return /* @__PURE__ */
|
|
9497
|
+
function vo() {
|
|
9498
|
+
return /* @__PURE__ */ c("svg", {
|
|
9470
9499
|
width: "22",
|
|
9471
9500
|
height: "22",
|
|
9472
9501
|
viewBox: "0 0 24 24",
|
|
@@ -9475,23 +9504,23 @@ function go() {
|
|
|
9475
9504
|
strokeWidth: "2.5",
|
|
9476
9505
|
strokeLinecap: "round",
|
|
9477
9506
|
strokeLinejoin: "round",
|
|
9478
|
-
children: /* @__PURE__ */
|
|
9507
|
+
children: /* @__PURE__ */ c("polyline", { points: "6,9 12,15 18,9" })
|
|
9479
9508
|
});
|
|
9480
9509
|
}
|
|
9481
|
-
function
|
|
9510
|
+
function ko({ isOpen: e, onClick: t, avatarUrl: r, ariaLabel: a = "Toggle chat" }) {
|
|
9482
9511
|
const n = !e && !!r;
|
|
9483
|
-
return /* @__PURE__ */
|
|
9512
|
+
return /* @__PURE__ */ c("button", {
|
|
9484
9513
|
className: `ak-launcher${n ? " ak-launcher--avatar" : ""}`,
|
|
9485
9514
|
onClick: t,
|
|
9486
9515
|
"aria-label": a,
|
|
9487
9516
|
"aria-expanded": e,
|
|
9488
9517
|
type: "button",
|
|
9489
|
-
children: e ? /* @__PURE__ */
|
|
9518
|
+
children: e ? /* @__PURE__ */ c(vo, {}) : n ? /* @__PURE__ */ c("img", {
|
|
9490
9519
|
src: r,
|
|
9491
9520
|
alt: "",
|
|
9492
9521
|
className: "ak-launcher__avatar-img",
|
|
9493
9522
|
"aria-hidden": "true"
|
|
9494
|
-
}) : /* @__PURE__ */
|
|
9523
|
+
}) : /* @__PURE__ */ c(go, {})
|
|
9495
9524
|
});
|
|
9496
9525
|
}
|
|
9497
9526
|
function Er({ config: e, state: t, callbacks: r }) {
|
|
@@ -9505,10 +9534,10 @@ function Er({ config: e, state: t, callbacks: r }) {
|
|
|
9505
9534
|
if (a) return;
|
|
9506
9535
|
const i = n.current?.getRootNode()?.host;
|
|
9507
9536
|
i && (t.isOpen ? i.setAttribute("data-open", "") : i.removeAttribute("data-open"));
|
|
9508
|
-
}, [a, t.isOpen]), a ? /* @__PURE__ */
|
|
9537
|
+
}, [a, t.isOpen]), a ? /* @__PURE__ */ c("div", {
|
|
9509
9538
|
ref: n,
|
|
9510
9539
|
className: "ak-inline",
|
|
9511
|
-
children: /* @__PURE__ */
|
|
9540
|
+
children: /* @__PURE__ */ c(Nr, {
|
|
9512
9541
|
config: e,
|
|
9513
9542
|
messages: t.messages,
|
|
9514
9543
|
isLoading: t.isLoading,
|
|
@@ -9521,7 +9550,7 @@ function Er({ config: e, state: t, callbacks: r }) {
|
|
|
9521
9550
|
}) : /* @__PURE__ */ y("div", {
|
|
9522
9551
|
ref: n,
|
|
9523
9552
|
className: "ak-floating",
|
|
9524
|
-
children: [t.isOpen && /* @__PURE__ */
|
|
9553
|
+
children: [t.isOpen && /* @__PURE__ */ c(Nr, {
|
|
9525
9554
|
config: e,
|
|
9526
9555
|
messages: t.messages,
|
|
9527
9556
|
isLoading: t.isLoading,
|
|
@@ -9530,7 +9559,7 @@ function Er({ config: e, state: t, callbacks: r }) {
|
|
|
9530
9559
|
initStatus: t.initStatus,
|
|
9531
9560
|
initError: t.initError,
|
|
9532
9561
|
callbacks: r
|
|
9533
|
-
}), /* @__PURE__ */
|
|
9562
|
+
}), /* @__PURE__ */ c(ko, {
|
|
9534
9563
|
isOpen: t.isOpen,
|
|
9535
9564
|
onClick: t.isOpen ? r.onClose : r.onOpen,
|
|
9536
9565
|
avatarUrl: e.avatarUrl
|
|
@@ -9558,55 +9587,55 @@ var Jt = (e, t, r, a) => {
|
|
|
9558
9587
|
}
|
|
9559
9588
|
};
|
|
9560
9589
|
};
|
|
9561
|
-
function
|
|
9590
|
+
function yo(e) {
|
|
9562
9591
|
return Zs + `
|
|
9563
9592
|
` + Rs(e);
|
|
9564
9593
|
}
|
|
9565
9594
|
function Qt(e, t) {
|
|
9566
|
-
return
|
|
9595
|
+
return yo(Ve({
|
|
9567
9596
|
...e,
|
|
9568
9597
|
mode: t
|
|
9569
9598
|
}));
|
|
9570
9599
|
}
|
|
9571
|
-
function
|
|
9600
|
+
function qo(e, t = Jt, r) {
|
|
9572
9601
|
return Ms(e, t, r ?? Qt(e, "floating"));
|
|
9573
9602
|
}
|
|
9574
|
-
function
|
|
9603
|
+
function el(e, t, r = Jt, a) {
|
|
9575
9604
|
return Ts(e, t, r, a ?? Qt(t, "inline"));
|
|
9576
9605
|
}
|
|
9577
|
-
function
|
|
9606
|
+
function tl(e, t, r = Jt, a) {
|
|
9578
9607
|
return Ls(e, t, r, a ?? Qt(t, "floating"));
|
|
9579
9608
|
}
|
|
9580
|
-
function
|
|
9609
|
+
function rl(e) {
|
|
9581
9610
|
As(e);
|
|
9582
9611
|
}
|
|
9583
9612
|
export {
|
|
9584
9613
|
is as ApiClient,
|
|
9585
|
-
|
|
9614
|
+
uo as Composer,
|
|
9586
9615
|
Ir as ErrorState,
|
|
9587
9616
|
fs as EventEmitter,
|
|
9588
9617
|
$s as Header,
|
|
9589
|
-
|
|
9590
|
-
|
|
9591
|
-
|
|
9592
|
-
|
|
9618
|
+
ko as Launcher,
|
|
9619
|
+
Xs as MessageBubble,
|
|
9620
|
+
Ks as MessageList,
|
|
9621
|
+
Js as TypingIndicator,
|
|
9593
9622
|
Er as WidgetApp,
|
|
9594
9623
|
vs as WidgetClient,
|
|
9595
9624
|
Nr as WidgetShell,
|
|
9596
9625
|
Rs as buildThemeVars,
|
|
9597
|
-
|
|
9626
|
+
yo as buildWidgetCSS,
|
|
9598
9627
|
vr as clearSession,
|
|
9599
9628
|
ws as createFloatingContainer,
|
|
9600
9629
|
bs as createShadowHost,
|
|
9601
9630
|
Yt as createWidget,
|
|
9602
|
-
|
|
9631
|
+
rl as destroy,
|
|
9603
9632
|
As as destroyWidget,
|
|
9604
9633
|
ms as getSessionId,
|
|
9605
|
-
|
|
9634
|
+
qo as init,
|
|
9606
9635
|
_s as injectStyles,
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9636
|
+
Ko as listWidgets,
|
|
9637
|
+
el as mount,
|
|
9638
|
+
tl as mountFloating,
|
|
9610
9639
|
Ve as normalizeConfig,
|
|
9611
9640
|
Cs as prepareInlineContainer,
|
|
9612
9641
|
xs as removeShadowHost,
|