@opencxh/domain 1.245.0 → 1.246.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/document-template/tokens.d.ts +8 -0
- package/dist/index.cjs +9 -9
- package/dist/index.js +403 -399
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -473,11 +473,11 @@ function us(e) {
|
|
|
473
473
|
function ds(e) {
|
|
474
474
|
return w(e)?.channelKind;
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function Et(e) {
|
|
477
477
|
return e === "message" || e === "note";
|
|
478
478
|
}
|
|
479
479
|
function ps(e) {
|
|
480
|
-
return
|
|
480
|
+
return Et(w(e)?.shape);
|
|
481
481
|
}
|
|
482
482
|
function It(e) {
|
|
483
483
|
return e === "note";
|
|
@@ -508,11 +508,11 @@ function dn(e) {
|
|
|
508
508
|
const t = w(e.type)?.snippet;
|
|
509
509
|
return t ? t(e) : "";
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function _s(e, t) {
|
|
512
512
|
const n = w(e.type)?.timeline;
|
|
513
513
|
return n ? n(e, t) : e.type.replace(/_/g, " ").toLowerCase();
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function As(e) {
|
|
516
516
|
const t = w(e.type)?.joinUrl;
|
|
517
517
|
return t ? t(e) : void 0;
|
|
518
518
|
}
|
|
@@ -547,7 +547,7 @@ function fn(e) {
|
|
|
547
547
|
const t = e.trim();
|
|
548
548
|
return t.length <= Ue ? t : `${t.slice(0, Ue - 1).trimEnd()}…`;
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function Ss(e, t) {
|
|
551
551
|
const n = pn(t?.text, e), r = t ? me(t.text, e, (o) => o) : null;
|
|
552
552
|
return {
|
|
553
553
|
activityId: e.id,
|
|
@@ -649,7 +649,7 @@ class hn {
|
|
|
649
649
|
* {@link ResolvedActivityType}.
|
|
650
650
|
*/
|
|
651
651
|
isMessage(t) {
|
|
652
|
-
return
|
|
652
|
+
return Et(this.get(t)?.shape);
|
|
653
653
|
}
|
|
654
654
|
/** Folds into the list under the message it answers. See {@link isNoteShape}. */
|
|
655
655
|
nestsUnderParent(t) {
|
|
@@ -681,7 +681,7 @@ class hn {
|
|
|
681
681
|
return this.translate;
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
|
-
const
|
|
684
|
+
const Es = new hn();
|
|
685
685
|
function Is(e, t, n = []) {
|
|
686
686
|
const r = e.createdAt;
|
|
687
687
|
if (!r) return [];
|
|
@@ -846,18 +846,18 @@ function H(e, t) {
|
|
|
846
846
|
const n = new Date(e);
|
|
847
847
|
return n.setUTCMinutes(0, 0, 0), t === "day" && n.setUTCHours(0), n.getTime();
|
|
848
848
|
}
|
|
849
|
-
const bn = 36e5,
|
|
849
|
+
const bn = 36e5, _n = 864e5;
|
|
850
850
|
function $s(e, t, n) {
|
|
851
|
-
const r = n === "hour" ? bn :
|
|
851
|
+
const r = n === "hour" ? bn : _n, o = [];
|
|
852
852
|
for (let i = H(e, n); i <= t; i += r)
|
|
853
853
|
o.push(j(i, n));
|
|
854
854
|
return o;
|
|
855
855
|
}
|
|
856
|
-
const
|
|
856
|
+
const An = /* @__PURE__ */ new Set(["time"]);
|
|
857
857
|
function Ls(e, t, n) {
|
|
858
858
|
if (!e) return [];
|
|
859
859
|
const r = new Set(e.supportedDimensions ?? []);
|
|
860
|
-
return t.filter((o) => r.has(o.id) && !
|
|
860
|
+
return t.filter((o) => r.has(o.id) && !An.has(o.id)).map((o) => ({
|
|
861
861
|
id: o.id,
|
|
862
862
|
label: o.label,
|
|
863
863
|
options: o.options?.length ? o.options : n[o.id] ?? []
|
|
@@ -870,10 +870,10 @@ function Ps(e, t) {
|
|
|
870
870
|
function Ks(e) {
|
|
871
871
|
return { value: e.id, label: `${e.category} · ${e.label}` };
|
|
872
872
|
}
|
|
873
|
-
const
|
|
873
|
+
const Sn = [
|
|
874
874
|
{ id: "resource", label: "Resource", labelSource: "raw" },
|
|
875
875
|
{ id: "origin", label: "Herkomst", labelSource: "raw" }
|
|
876
|
-
],
|
|
876
|
+
], En = Sn.map((e) => e.id);
|
|
877
877
|
function In(e, t) {
|
|
878
878
|
return `${e}.usage.${t}`;
|
|
879
879
|
}
|
|
@@ -886,7 +886,7 @@ function Us(e, t) {
|
|
|
886
886
|
aggregation: "sum",
|
|
887
887
|
supportedDimensions: [
|
|
888
888
|
"provider",
|
|
889
|
-
...
|
|
889
|
+
...En,
|
|
890
890
|
...n.extraDimensions ?? [],
|
|
891
891
|
"time"
|
|
892
892
|
]
|
|
@@ -932,8 +932,8 @@ function Cn(e) {
|
|
|
932
932
|
t += e[n], n += 1;
|
|
933
933
|
continue;
|
|
934
934
|
}
|
|
935
|
-
const a = e.slice(o, i),
|
|
936
|
-
t += r || !Me(
|
|
935
|
+
const a = e.slice(o, i), u = e.slice(i + 2, s).trim().split(/\s+/)[0] ?? "";
|
|
936
|
+
t += r || !Me(u) ? a : e.slice(n, s + 1), n = s + 1;
|
|
937
937
|
}
|
|
938
938
|
return t;
|
|
939
939
|
}
|
|
@@ -1028,69 +1028,69 @@ function Bs(e, t = () => {
|
|
|
1028
1028
|
break;
|
|
1029
1029
|
case "list": {
|
|
1030
1030
|
const s = Array.isArray(o.items) ? o.items : [], a = [];
|
|
1031
|
-
for (const
|
|
1031
|
+
for (const l of s) {
|
|
1032
1032
|
if (a.length >= Ge) {
|
|
1033
1033
|
t(`more than ${Ge} list items`);
|
|
1034
1034
|
break;
|
|
1035
1035
|
}
|
|
1036
|
-
const d = T(
|
|
1036
|
+
const d = T(l?.text);
|
|
1037
1037
|
if (!d) continue;
|
|
1038
|
-
const
|
|
1039
|
-
a.push(
|
|
1038
|
+
const c = T(l?.lead, 200);
|
|
1039
|
+
a.push(c ? { lead: c, text: d } : { text: d });
|
|
1040
1040
|
}
|
|
1041
1041
|
if (a.length === 0) {
|
|
1042
1042
|
t("a list without usable items");
|
|
1043
1043
|
continue;
|
|
1044
1044
|
}
|
|
1045
|
-
const
|
|
1046
|
-
n.push({ ...i, type: "list", style:
|
|
1045
|
+
const u = o.style === "numbered" ? "numbered" : "bulleted";
|
|
1046
|
+
n.push({ ...i, type: "list", style: u, items: a });
|
|
1047
1047
|
break;
|
|
1048
1048
|
}
|
|
1049
1049
|
case "table": {
|
|
1050
1050
|
const s = Array.isArray(o.columns) ? o.columns : [], a = [];
|
|
1051
|
-
for (const
|
|
1051
|
+
for (const c of s) {
|
|
1052
1052
|
if (a.length >= Ve) {
|
|
1053
1053
|
t(`more than ${Ve} table columns`);
|
|
1054
1054
|
break;
|
|
1055
1055
|
}
|
|
1056
|
-
const p = T(
|
|
1056
|
+
const p = T(c?.label, q), f = c?.align === "right" ? "right" : void 0;
|
|
1057
1057
|
a.push(f ? { label: p, align: f } : { label: p });
|
|
1058
1058
|
}
|
|
1059
1059
|
if (a.length === 0) {
|
|
1060
1060
|
t("a table without columns");
|
|
1061
1061
|
continue;
|
|
1062
1062
|
}
|
|
1063
|
-
const
|
|
1064
|
-
for (const
|
|
1065
|
-
if (
|
|
1063
|
+
const u = Array.isArray(o.rows) ? o.rows : [], l = [];
|
|
1064
|
+
for (const c of u) {
|
|
1065
|
+
if (l.length >= We) {
|
|
1066
1066
|
t(`more than ${We} table rows`);
|
|
1067
1067
|
break;
|
|
1068
1068
|
}
|
|
1069
|
-
const p = Array.isArray(
|
|
1070
|
-
|
|
1069
|
+
const p = Array.isArray(c) ? c : [];
|
|
1070
|
+
l.push(a.map((f, y) => T(p[y], q)));
|
|
1071
1071
|
}
|
|
1072
1072
|
const d = T(o.caption, q);
|
|
1073
1073
|
n.push({
|
|
1074
1074
|
...i,
|
|
1075
1075
|
type: "table",
|
|
1076
1076
|
columns: a,
|
|
1077
|
-
rows:
|
|
1077
|
+
rows: l,
|
|
1078
1078
|
...d ? { caption: d } : {}
|
|
1079
1079
|
});
|
|
1080
1080
|
break;
|
|
1081
1081
|
}
|
|
1082
1082
|
case "kpi": {
|
|
1083
1083
|
const s = Array.isArray(o.items) ? o.items : [], a = [];
|
|
1084
|
-
for (const
|
|
1084
|
+
for (const u of s) {
|
|
1085
1085
|
if (a.length >= ze) {
|
|
1086
1086
|
t(`more than ${ze} kpi items`);
|
|
1087
1087
|
break;
|
|
1088
1088
|
}
|
|
1089
|
-
const
|
|
1090
|
-
if (!
|
|
1091
|
-
const
|
|
1089
|
+
const l = T(u?.value, 40), d = T(u?.label, 80);
|
|
1090
|
+
if (!l || !d) continue;
|
|
1091
|
+
const c = u?.tone;
|
|
1092
1092
|
a.push(
|
|
1093
|
-
typeof
|
|
1093
|
+
typeof c == "string" && wt.has(c) ? { value: l, label: d, tone: c } : { value: l, label: d }
|
|
1094
1094
|
);
|
|
1095
1095
|
}
|
|
1096
1096
|
if (a.length === 0) {
|
|
@@ -1106,13 +1106,13 @@ function Bs(e, t = () => {
|
|
|
1106
1106
|
t("an image without a usable url");
|
|
1107
1107
|
continue;
|
|
1108
1108
|
}
|
|
1109
|
-
const a = T(o.alt, 200),
|
|
1109
|
+
const a = T(o.alt, 200), u = T(o.caption, q);
|
|
1110
1110
|
n.push({
|
|
1111
1111
|
...i,
|
|
1112
1112
|
type: "image",
|
|
1113
1113
|
url: s,
|
|
1114
1114
|
...a ? { alt: a } : {},
|
|
1115
|
-
...
|
|
1115
|
+
...u ? { caption: u } : {}
|
|
1116
1116
|
});
|
|
1117
1117
|
break;
|
|
1118
1118
|
}
|
|
@@ -1123,13 +1123,13 @@ function Bs(e, t = () => {
|
|
|
1123
1123
|
t(`more than ${Xe} letterhead fields`);
|
|
1124
1124
|
break;
|
|
1125
1125
|
}
|
|
1126
|
-
const
|
|
1126
|
+
const c = d, p = typeof c?.key == "string" ? c.key.slice(0, 48) : "", f = U(c?.value);
|
|
1127
1127
|
if (!p || !f) continue;
|
|
1128
|
-
const y = U(
|
|
1128
|
+
const y = U(c?.label, 80);
|
|
1129
1129
|
a.push(y ? { key: p, label: y, value: f } : { key: p, value: f });
|
|
1130
1130
|
}
|
|
1131
|
-
const
|
|
1132
|
-
if (a.length === 0 &&
|
|
1131
|
+
const l = (Array.isArray(o.recipient) ? o.recipient : []).slice(0, Tn).map((d) => U(d)).filter(Boolean);
|
|
1132
|
+
if (a.length === 0 && l.length === 0) {
|
|
1133
1133
|
t("a letterhead without fields or recipient");
|
|
1134
1134
|
continue;
|
|
1135
1135
|
}
|
|
@@ -1137,31 +1137,31 @@ function Bs(e, t = () => {
|
|
|
1137
1137
|
...i,
|
|
1138
1138
|
type: "letterhead",
|
|
1139
1139
|
fields: a,
|
|
1140
|
-
...
|
|
1140
|
+
...l.length > 0 ? { recipient: l } : {}
|
|
1141
1141
|
});
|
|
1142
1142
|
break;
|
|
1143
1143
|
}
|
|
1144
1144
|
case "totals": {
|
|
1145
|
-
const s = (
|
|
1146
|
-
const d = Array.isArray(
|
|
1145
|
+
const s = (l) => {
|
|
1146
|
+
const d = Array.isArray(l) ? l : [], c = [];
|
|
1147
1147
|
for (const p of d) {
|
|
1148
|
-
if (
|
|
1148
|
+
if (c.length >= Ye) {
|
|
1149
1149
|
t(`more than ${Ye} totals rows`);
|
|
1150
1150
|
break;
|
|
1151
1151
|
}
|
|
1152
1152
|
const f = p, y = U(f?.label), m = U(f?.amount, 40);
|
|
1153
|
-
!y || !m ||
|
|
1153
|
+
!y || !m || c.push(
|
|
1154
1154
|
f?.emphasis === !0 ? { label: y, amount: m, emphasis: !0 } : { label: y, amount: m }
|
|
1155
1155
|
);
|
|
1156
1156
|
}
|
|
1157
|
-
return
|
|
1157
|
+
return c;
|
|
1158
1158
|
}, a = s(o.rows);
|
|
1159
1159
|
if (a.length === 0 && !o.block_id) {
|
|
1160
1160
|
t("a totals block without usable rows");
|
|
1161
1161
|
continue;
|
|
1162
1162
|
}
|
|
1163
|
-
const
|
|
1164
|
-
n.push({ ...i, type: "totals", rows: a, ...
|
|
1163
|
+
const u = s(o.taxRows);
|
|
1164
|
+
n.push({ ...i, type: "totals", rows: a, ...u.length > 0 ? { taxRows: u } : {} });
|
|
1165
1165
|
break;
|
|
1166
1166
|
}
|
|
1167
1167
|
case "pagebreak":
|
|
@@ -1350,32 +1350,32 @@ function G(e) {
|
|
|
1350
1350
|
}
|
|
1351
1351
|
function Fn(e, t) {
|
|
1352
1352
|
if (t.length === 0) return [];
|
|
1353
|
-
const n = t.reduce((
|
|
1354
|
-
if (n === 0) return t.map((
|
|
1355
|
-
const r = t.map((
|
|
1356
|
-
let i = e - o.reduce((
|
|
1357
|
-
const s = r.map((
|
|
1358
|
-
for (let
|
|
1359
|
-
o[s[
|
|
1353
|
+
const n = t.reduce((u, l) => u + l, 0);
|
|
1354
|
+
if (n === 0) return t.map((u, l) => l === 0 ? e : 0);
|
|
1355
|
+
const r = t.map((u) => e * u / n), o = r.map((u) => Math.trunc(u));
|
|
1356
|
+
let i = e - o.reduce((u, l) => u + l, 0);
|
|
1357
|
+
const s = r.map((u, l) => ({ index: l, fraction: Math.abs(u - o[l]) })).sort((u, l) => l.fraction - u.fraction), a = i < 0 ? -1 : 1;
|
|
1358
|
+
for (let u = 0; i !== 0 && u < s.length; u++)
|
|
1359
|
+
o[s[u].index] += a, i -= a;
|
|
1360
1360
|
return o;
|
|
1361
1361
|
}
|
|
1362
1362
|
function D(e, t = {}) {
|
|
1363
1363
|
const n = t.decimal ?? ",", r = t.group ?? ".", o = e < 0, i = Math.abs(Math.trunc(e)).toString().padStart(3, "0"), s = i.slice(0, -2), a = i.slice(-2);
|
|
1364
|
-
let
|
|
1365
|
-
for (let
|
|
1366
|
-
|
|
1367
|
-
return `${o ? "-" : ""}${
|
|
1364
|
+
let u = "";
|
|
1365
|
+
for (let l = 0; l < s.length; l++)
|
|
1366
|
+
l > 0 && (s.length - l) % 3 === 0 && (u += r), u += s[l];
|
|
1367
|
+
return `${o ? "-" : ""}${u}${n}${a}`;
|
|
1368
1368
|
}
|
|
1369
1369
|
function ta(e) {
|
|
1370
1370
|
const t = e.trim().replace(/[\s ]/g, "");
|
|
1371
1371
|
if (!t) return;
|
|
1372
1372
|
const n = t.replace(/^[-+]?[^\d.,-]*/, "").replace(/[^\d.,-]+$/, ""), r = /^-/.test(t) || /-$/.test(t), o = n.replace(/-/g, "");
|
|
1373
1373
|
if (!o || !/^[\d.,]+$/.test(o)) return;
|
|
1374
|
-
const i = o.lastIndexOf(","), s = o.lastIndexOf("."), a = Math.max(i, s),
|
|
1374
|
+
const i = o.lastIndexOf(","), s = o.lastIndexOf("."), a = Math.max(i, s), u = a === -1 ? "" : o.slice(a + 1), l = a !== -1 && u.length >= 1 && u.length <= 2, d = l ? o.slice(0, a) : o;
|
|
1375
1375
|
if (!Bn(d)) return;
|
|
1376
|
-
const
|
|
1377
|
-
if (
|
|
1378
|
-
const f = Number(
|
|
1376
|
+
const c = d.replace(/[.,]/g, ""), p = l ? u.padEnd(2, "0") : "00";
|
|
1377
|
+
if (c === "") return;
|
|
1378
|
+
const f = Number(c) * 100 + Number(p);
|
|
1379
1379
|
return r ? -f : f;
|
|
1380
1380
|
}
|
|
1381
1381
|
function Bn(e) {
|
|
@@ -1414,7 +1414,7 @@ function ra(e, t, n) {
|
|
|
1414
1414
|
const i = r.filter((a) => o.matches(a, t));
|
|
1415
1415
|
if (i.length === 0) continue;
|
|
1416
1416
|
const s = i.reduce(
|
|
1417
|
-
(a,
|
|
1417
|
+
(a, u) => (u.minQuantity ?? 0) >= (a.minQuantity ?? 0) ? u : a
|
|
1418
1418
|
);
|
|
1419
1419
|
return {
|
|
1420
1420
|
unitPriceCents: Hn(s, e.listPriceCents),
|
|
@@ -1486,97 +1486,101 @@ function Xn(e, t) {
|
|
|
1486
1486
|
return e.equals !== void 0 ? n === e.equals : !0;
|
|
1487
1487
|
}
|
|
1488
1488
|
function ua(e, t, n, r, o) {
|
|
1489
|
-
const i = [], s = [], a = (
|
|
1490
|
-
const
|
|
1491
|
-
for (const
|
|
1492
|
-
return
|
|
1489
|
+
const i = [], s = [], a = /* @__PURE__ */ new Set(), u = (l) => {
|
|
1490
|
+
const d = zn(l, t, o);
|
|
1491
|
+
for (const c of d.unresolved) i.includes(c) || i.push(c);
|
|
1492
|
+
return d.text;
|
|
1493
1493
|
};
|
|
1494
|
-
for (const
|
|
1495
|
-
if (
|
|
1496
|
-
const
|
|
1497
|
-
if (
|
|
1498
|
-
s.push(...
|
|
1494
|
+
for (const l of e) {
|
|
1495
|
+
if (l.block_id && !Xn(n?.[l.block_id], t)) continue;
|
|
1496
|
+
const d = l.block_id ? r?.[l.block_id] : void 0;
|
|
1497
|
+
if (d && l.block_id) {
|
|
1498
|
+
a.add(l.block_id), s.push(...d);
|
|
1499
1499
|
continue;
|
|
1500
1500
|
}
|
|
1501
|
-
switch (
|
|
1501
|
+
switch (l.type) {
|
|
1502
1502
|
case "heading":
|
|
1503
1503
|
case "paragraph":
|
|
1504
1504
|
case "quote":
|
|
1505
|
-
s.push({ ...
|
|
1505
|
+
s.push({ ...l, text: u(l.text) });
|
|
1506
1506
|
break;
|
|
1507
1507
|
case "callout":
|
|
1508
1508
|
s.push({
|
|
1509
|
-
...
|
|
1510
|
-
...
|
|
1511
|
-
text:
|
|
1509
|
+
...l,
|
|
1510
|
+
...l.title ? { title: u(l.title) } : {},
|
|
1511
|
+
text: u(l.text)
|
|
1512
1512
|
});
|
|
1513
1513
|
break;
|
|
1514
1514
|
case "code":
|
|
1515
|
-
s.push(
|
|
1515
|
+
s.push(l);
|
|
1516
1516
|
break;
|
|
1517
1517
|
case "list":
|
|
1518
1518
|
s.push({
|
|
1519
|
-
...
|
|
1520
|
-
items:
|
|
1521
|
-
...
|
|
1522
|
-
text:
|
|
1519
|
+
...l,
|
|
1520
|
+
items: l.items.map((c) => ({
|
|
1521
|
+
...c.lead ? { lead: u(c.lead) } : {},
|
|
1522
|
+
text: u(c.text)
|
|
1523
1523
|
}))
|
|
1524
1524
|
});
|
|
1525
1525
|
break;
|
|
1526
1526
|
case "table":
|
|
1527
1527
|
s.push({
|
|
1528
|
-
...
|
|
1529
|
-
columns:
|
|
1530
|
-
rows:
|
|
1531
|
-
...
|
|
1528
|
+
...l,
|
|
1529
|
+
columns: l.columns.map((c) => ({ ...c, label: u(c.label) })),
|
|
1530
|
+
rows: l.rows.map((c) => c.map(u)),
|
|
1531
|
+
...l.caption ? { caption: u(l.caption) } : {}
|
|
1532
1532
|
});
|
|
1533
1533
|
break;
|
|
1534
1534
|
case "kpi":
|
|
1535
1535
|
s.push({
|
|
1536
|
-
...
|
|
1537
|
-
items:
|
|
1538
|
-
...
|
|
1539
|
-
value:
|
|
1540
|
-
label:
|
|
1536
|
+
...l,
|
|
1537
|
+
items: l.items.map((c) => ({
|
|
1538
|
+
...c,
|
|
1539
|
+
value: u(c.value),
|
|
1540
|
+
label: u(c.label)
|
|
1541
1541
|
}))
|
|
1542
1542
|
});
|
|
1543
1543
|
break;
|
|
1544
1544
|
case "letterhead":
|
|
1545
1545
|
s.push({
|
|
1546
|
-
...
|
|
1547
|
-
fields:
|
|
1548
|
-
...
|
|
1546
|
+
...l,
|
|
1547
|
+
fields: l.fields.map((c) => ({ ...c, value: u(c.value) })),
|
|
1548
|
+
...l.recipient ? { recipient: l.recipient.map(u) } : {}
|
|
1549
1549
|
});
|
|
1550
1550
|
break;
|
|
1551
1551
|
case "totals":
|
|
1552
1552
|
s.push({
|
|
1553
|
-
...
|
|
1554
|
-
rows:
|
|
1555
|
-
...
|
|
1556
|
-
label:
|
|
1557
|
-
amount:
|
|
1553
|
+
...l,
|
|
1554
|
+
rows: l.rows.map((c) => ({
|
|
1555
|
+
...c,
|
|
1556
|
+
label: u(c.label),
|
|
1557
|
+
amount: u(c.amount)
|
|
1558
1558
|
})),
|
|
1559
|
-
...
|
|
1560
|
-
taxRows:
|
|
1561
|
-
...
|
|
1562
|
-
label:
|
|
1563
|
-
amount:
|
|
1559
|
+
...l.taxRows ? {
|
|
1560
|
+
taxRows: l.taxRows.map((c) => ({
|
|
1561
|
+
...c,
|
|
1562
|
+
label: u(c.label),
|
|
1563
|
+
amount: u(c.amount)
|
|
1564
1564
|
}))
|
|
1565
1565
|
} : {}
|
|
1566
1566
|
});
|
|
1567
1567
|
break;
|
|
1568
1568
|
case "image":
|
|
1569
1569
|
s.push({
|
|
1570
|
-
...
|
|
1571
|
-
url:
|
|
1572
|
-
...
|
|
1570
|
+
...l,
|
|
1571
|
+
url: u(l.url),
|
|
1572
|
+
...l.alt ? { alt: u(l.alt) } : {}
|
|
1573
1573
|
});
|
|
1574
1574
|
break;
|
|
1575
1575
|
default:
|
|
1576
|
-
s.push(
|
|
1576
|
+
s.push(l);
|
|
1577
1577
|
}
|
|
1578
1578
|
}
|
|
1579
|
-
return {
|
|
1579
|
+
return {
|
|
1580
|
+
blocks: s,
|
|
1581
|
+
unresolved: i,
|
|
1582
|
+
unusedSlots: Object.keys(r ?? {}).filter((l) => !a.has(l))
|
|
1583
|
+
};
|
|
1580
1584
|
}
|
|
1581
1585
|
function da(e) {
|
|
1582
1586
|
const t = e?.billing, n = e?.address, r = e?.houseStyle, o = [n?.street, n?.houseNumber].filter(Boolean).join(" "), i = [n?.postalCode, n?.city].filter(Boolean).join(" ");
|
|
@@ -1675,7 +1679,7 @@ function fr(e, t) {
|
|
|
1675
1679
|
const n = e.lastActivityPreview;
|
|
1676
1680
|
return n?.direction !== "outbound" || !xt(n.type) ? !1 : ve(e, t) < cr;
|
|
1677
1681
|
}
|
|
1678
|
-
function
|
|
1682
|
+
function _a(e, t) {
|
|
1679
1683
|
if (!Nt(e.status)) return { score: L, reasons: [] };
|
|
1680
1684
|
if (e.snoozedTill && e.snoozedTill > t.now) return { score: L, reasons: [] };
|
|
1681
1685
|
if (fr(e, t.now)) return { score: L, reasons: [] };
|
|
@@ -1685,13 +1689,13 @@ function Aa(e, t) {
|
|
|
1685
1689
|
J[o] > 0 && (n += J[o], r.push(`priority:${o}`)), or(e, t.userId) && (n += 20, r.push("unseen")), e.assignedUserId && e.assignedUserId === t.userId && (n += 15, r.push("assigned-to-you"));
|
|
1686
1690
|
const i = ve(e, t.now);
|
|
1687
1691
|
if (i > 0) {
|
|
1688
|
-
const
|
|
1689
|
-
n +=
|
|
1692
|
+
const u = Math.min(i * 2, 30);
|
|
1693
|
+
n += u, i >= 1 && r.push(`waiting:${Math.round(i)}h`);
|
|
1690
1694
|
}
|
|
1691
1695
|
const s = e.lastActivityPreview;
|
|
1692
|
-
return s?.type === "AI_ACTION_PROPOSED" && (n += 30, r.push("awaiting-approval")), s?.direction === "outbound" && xt(s.type) && (n += 10, r.push("no-reply")), !e.firstResponseAt && e.lastActivityPreview?.direction === "inbound" && (n += 10, r.push("awaiting-reply")), (e.tags?.some((
|
|
1696
|
+
return s?.type === "AI_ACTION_PROPOSED" && (n += 30, r.push("awaiting-approval")), s?.direction === "outbound" && xt(s.type) && (n += 10, r.push("no-reply")), !e.firstResponseAt && e.lastActivityPreview?.direction === "inbound" && (n += 10, r.push("awaiting-reply")), (e.tags?.some((u) => u === "marketing" || u === "automated") || Zn(e.remoteParty?.resource, e.lastActivityPreview?.snippet)) && (n -= sr, r.push("bulk")), { score: n, reasons: r };
|
|
1693
1697
|
}
|
|
1694
|
-
const
|
|
1698
|
+
const Aa = (e) => !!e.assignedUserId || !!e.assignedInboxId, Sa = (e) => e.status === "closed", Ea = (e) => ({
|
|
1695
1699
|
urgent: 10,
|
|
1696
1700
|
high: 5,
|
|
1697
1701
|
normal: 2,
|
|
@@ -1815,11 +1819,11 @@ function Na(e) {
|
|
|
1815
1819
|
function Ra(e) {
|
|
1816
1820
|
return `mcp__${e}__`;
|
|
1817
1821
|
}
|
|
1818
|
-
const Da = 1e3, $a = 2e3, La = 500, Pa = 12e3, Ka = 4e3,
|
|
1822
|
+
const Da = 1e3, $a = 2e3, La = 500, Pa = 12e3, Ka = 4e3, _r = ["contact", "company", "work_item"];
|
|
1819
1823
|
function Ua(e) {
|
|
1820
1824
|
if (!e) return !1;
|
|
1821
1825
|
const t = e.slice(0, e.indexOf(":"));
|
|
1822
|
-
return
|
|
1826
|
+
return _r.includes(t);
|
|
1823
1827
|
}
|
|
1824
1828
|
const Fa = [
|
|
1825
1829
|
{ key: "high", label: "tax_high", percent: 21, kind: "standard" },
|
|
@@ -1828,7 +1832,7 @@ const Fa = [
|
|
|
1828
1832
|
{ key: "reverse_charge", label: "tax_reverse_charge", percent: 0, kind: "reverse_charge" },
|
|
1829
1833
|
{ key: "exempt", label: "tax_exempt", percent: 0, kind: "exempt" }
|
|
1830
1834
|
];
|
|
1831
|
-
function
|
|
1835
|
+
function Ar(e, t) {
|
|
1832
1836
|
return t.find((n) => n.key === e) ?? {
|
|
1833
1837
|
key: e,
|
|
1834
1838
|
label: e,
|
|
@@ -1836,30 +1840,30 @@ function _r(e, t) {
|
|
|
1836
1840
|
kind: "zero"
|
|
1837
1841
|
};
|
|
1838
1842
|
}
|
|
1839
|
-
function
|
|
1843
|
+
function Sr(e) {
|
|
1840
1844
|
if (e.kind !== "product") return 0;
|
|
1841
1845
|
const t = 1 - (e.discountPercent ?? 0) / 100;
|
|
1842
1846
|
return G(e.quantity * e.unitPriceCents * t);
|
|
1843
1847
|
}
|
|
1844
1848
|
function Ba(e, t, n) {
|
|
1845
|
-
const r = e.map((
|
|
1846
|
-
for (let
|
|
1847
|
-
if (r[
|
|
1848
|
-
const d = n ?? r[
|
|
1849
|
-
|
|
1849
|
+
const r = e.map((l) => ({ ...l, netCents: Sr(l), taxCents: 0 })), o = /* @__PURE__ */ new Map();
|
|
1850
|
+
for (let l = 0; l < r.length; l++) {
|
|
1851
|
+
if (r[l].kind !== "product" || r[l].optional) continue;
|
|
1852
|
+
const d = n ?? r[l].taxRateKey, c = o.get(d);
|
|
1853
|
+
c ? c.push(l) : o.set(d, [l]);
|
|
1850
1854
|
}
|
|
1851
1855
|
const i = [];
|
|
1852
1856
|
let s = 0, a = 0;
|
|
1853
|
-
for (const [
|
|
1854
|
-
const
|
|
1857
|
+
for (const [l, d] of o) {
|
|
1858
|
+
const c = Ar(l, t), p = d.reduce((m, E) => m + r[E].netCents, 0), f = G(p * c.percent / 100), y = Fn(
|
|
1855
1859
|
f,
|
|
1856
1860
|
d.map((m) => r[m].netCents)
|
|
1857
1861
|
);
|
|
1858
1862
|
for (let m = 0; m < d.length; m++) r[d[m]].taxCents = y[m];
|
|
1859
|
-
i.push({ taxRateKey:
|
|
1863
|
+
i.push({ taxRateKey: l, netCents: p, taxCents: f }), s += p, a += f;
|
|
1860
1864
|
}
|
|
1861
|
-
const
|
|
1862
|
-
(
|
|
1865
|
+
const u = r.reduce(
|
|
1866
|
+
(l, d) => d.costPriceCents == null || d.optional ? l : l + G(d.costPriceCents * d.quantity),
|
|
1863
1867
|
0
|
|
1864
1868
|
);
|
|
1865
1869
|
return {
|
|
@@ -1868,7 +1872,7 @@ function Ba(e, t, n) {
|
|
|
1868
1872
|
netCents: s,
|
|
1869
1873
|
taxCents: a,
|
|
1870
1874
|
grossCents: s + a,
|
|
1871
|
-
costCents:
|
|
1875
|
+
costCents: u,
|
|
1872
1876
|
byRate: i
|
|
1873
1877
|
}
|
|
1874
1878
|
};
|
|
@@ -1947,7 +1951,7 @@ const ja = "onboarding-source", Ha = ["support", "billing", "availability", "sal
|
|
|
1947
1951
|
absent: !0,
|
|
1948
1952
|
icon: "party-popper"
|
|
1949
1953
|
}
|
|
1950
|
-
],
|
|
1954
|
+
], Er = {
|
|
1951
1955
|
key: "unknown",
|
|
1952
1956
|
label: "kind_unknown",
|
|
1953
1957
|
capacity: !1,
|
|
@@ -1955,7 +1959,7 @@ const ja = "onboarding-source", Ha = ["support", "billing", "availability", "sal
|
|
|
1955
1959
|
absent: !1
|
|
1956
1960
|
};
|
|
1957
1961
|
function N(e, t = Ce) {
|
|
1958
|
-
return t.find((n) => n.key === e) ?? { ...
|
|
1962
|
+
return t.find((n) => n.key === e) ?? { ...Er, key: e };
|
|
1959
1963
|
}
|
|
1960
1964
|
function W(e) {
|
|
1961
1965
|
return e === "published" || e === "approved";
|
|
@@ -1987,7 +1991,7 @@ function Ut(e, t) {
|
|
|
1987
1991
|
function Ft(e, t, n, r) {
|
|
1988
1992
|
const o = e.filter(
|
|
1989
1993
|
(a) => a.effectiveFrom === void 0 || a.effectiveFrom <= r
|
|
1990
|
-
), i = (a) => a.sort((
|
|
1994
|
+
), i = (a) => a.sort((u, l) => (l.effectiveFrom ?? 0) - (u.effectiveFrom ?? 0))[0], s = i(o.filter((a) => a.userId === t));
|
|
1991
1995
|
return s || i(
|
|
1992
1996
|
o.filter((a) => !a.userId && a.teamId && n.includes(a.teamId))
|
|
1993
1997
|
);
|
|
@@ -2009,32 +2013,32 @@ function ge(e, t, n, r) {
|
|
|
2009
2013
|
const tt = { interval: 0, day: 1, week: 2 };
|
|
2010
2014
|
function Va(e, t) {
|
|
2011
2015
|
const { entries: n, patterns: r = [], terms: o = [] } = t, i = n.filter(
|
|
2012
|
-
(
|
|
2016
|
+
(c) => c.userId && W(c.status) && N(c.kindKey).capacity
|
|
2013
2017
|
), s = n.filter(
|
|
2014
|
-
(
|
|
2018
|
+
(c) => c.userId && W(c.status) && N(c.kindKey).absent
|
|
2015
2019
|
), a = t.userIds ?? [
|
|
2016
2020
|
.../* @__PURE__ */ new Set([
|
|
2017
|
-
...i.map((
|
|
2018
|
-
...r.map((
|
|
2019
|
-
...o.map((
|
|
2021
|
+
...i.map((c) => c.userId),
|
|
2022
|
+
...r.map((c) => c.userId),
|
|
2023
|
+
...o.map((c) => c.userId)
|
|
2020
2024
|
])
|
|
2021
|
-
].filter((
|
|
2022
|
-
let
|
|
2023
|
-
const d = (
|
|
2024
|
-
tt[
|
|
2025
|
+
].filter((c) => !!c), u = {};
|
|
2026
|
+
let l = "interval";
|
|
2027
|
+
const d = (c) => {
|
|
2028
|
+
tt[c] > tt[l] && (l = c);
|
|
2025
2029
|
};
|
|
2026
|
-
for (const
|
|
2027
|
-
const p = t.teamIdsOf?.(
|
|
2030
|
+
for (const c of a) {
|
|
2031
|
+
const p = t.teamIdsOf?.(c) ?? [];
|
|
2028
2032
|
let f = 0, y = 0, m = 0;
|
|
2029
2033
|
for (const h of kr(e)) {
|
|
2030
|
-
const
|
|
2034
|
+
const S = Math.max(h, e.from), x = Math.min(h + he, e.to);
|
|
2031
2035
|
m++;
|
|
2032
|
-
const C = i.filter((k) => k.userId ===
|
|
2036
|
+
const C = i.filter((k) => k.userId === c).reduce((k, $e) => k + ge($e.start, $e.end, S, x), 0);
|
|
2033
2037
|
if (C > 0) {
|
|
2034
2038
|
f += C;
|
|
2035
2039
|
continue;
|
|
2036
2040
|
}
|
|
2037
|
-
const M = Ft(r,
|
|
2041
|
+
const M = Ft(r, c, p, h), O = M ? Kt(M, h) : 0;
|
|
2038
2042
|
if (M && O > 0) {
|
|
2039
2043
|
f += O * 60, d(Ut(M, h) ? "interval" : "day");
|
|
2040
2044
|
continue;
|
|
@@ -2042,41 +2046,41 @@ function Va(e, t) {
|
|
|
2042
2046
|
M || y++;
|
|
2043
2047
|
}
|
|
2044
2048
|
if (y > 0) {
|
|
2045
|
-
const h = wr(o,
|
|
2049
|
+
const h = wr(o, c, e.from);
|
|
2046
2050
|
h && (f += h.weeklyMinutes * 60 * (y / 7), d("week"));
|
|
2047
2051
|
}
|
|
2048
|
-
const
|
|
2049
|
-
(h,
|
|
2052
|
+
const E = s.filter((h) => h.userId === c).reduce(
|
|
2053
|
+
(h, S) => h + ge(S.start, S.end, e.from, e.to),
|
|
2050
2054
|
0
|
|
2051
|
-
), g = Math.max(0, f -
|
|
2052
|
-
(g > 0 || m > 0) && (c
|
|
2055
|
+
), g = Math.max(0, f - E);
|
|
2056
|
+
(g > 0 || m > 0) && (u[c] = g);
|
|
2053
2057
|
}
|
|
2054
2058
|
return {
|
|
2055
|
-
seconds: Object.values(
|
|
2056
|
-
precision:
|
|
2057
|
-
byUser:
|
|
2059
|
+
seconds: Object.values(u).reduce((c, p) => c + p, 0),
|
|
2060
|
+
precision: l,
|
|
2061
|
+
byUser: u
|
|
2058
2062
|
};
|
|
2059
2063
|
}
|
|
2060
2064
|
function za(e, t) {
|
|
2061
2065
|
if (!e.some((a) => a.userId)) return [];
|
|
2062
2066
|
const n = "", r = /* @__PURE__ */ new Map();
|
|
2063
2067
|
for (const a of e) {
|
|
2064
|
-
const
|
|
2065
|
-
r.set(
|
|
2068
|
+
const u = a.userId ?? n;
|
|
2069
|
+
r.set(u, (r.get(u) ?? 0) + a.seconds);
|
|
2066
2070
|
}
|
|
2067
2071
|
const i = [.../* @__PURE__ */ new Set([
|
|
2068
2072
|
...Object.keys(t.byUser),
|
|
2069
2073
|
...[...r.keys()].filter((a) => a !== n)
|
|
2070
2074
|
])].map((a) => {
|
|
2071
|
-
const
|
|
2075
|
+
const u = r.get(a) ?? 0, l = t.byUser[a] ?? 0;
|
|
2072
2076
|
return {
|
|
2073
2077
|
userId: a,
|
|
2074
|
-
requiredSeconds:
|
|
2075
|
-
capacitySeconds:
|
|
2076
|
-
netSeconds:
|
|
2078
|
+
requiredSeconds: u,
|
|
2079
|
+
capacitySeconds: l,
|
|
2080
|
+
netSeconds: l - u
|
|
2077
2081
|
};
|
|
2078
2082
|
});
|
|
2079
|
-
i.sort((a,
|
|
2083
|
+
i.sort((a, u) => a.netSeconds - u.netSeconds);
|
|
2080
2084
|
const s = r.get(n) ?? 0;
|
|
2081
2085
|
return s > 0 && i.push({ requiredSeconds: s, capacitySeconds: 0, netSeconds: -s }), i;
|
|
2082
2086
|
}
|
|
@@ -2085,18 +2089,18 @@ function Xa(e, t, n, r) {
|
|
|
2085
2089
|
(s) => s.userId && W(s.status) && !N(s.kindKey).absent
|
|
2086
2090
|
), i = Object.entries(r.byUser).map(
|
|
2087
2091
|
([s, a]) => {
|
|
2088
|
-
let
|
|
2092
|
+
let u = 0, l = 0;
|
|
2089
2093
|
for (const d of o) {
|
|
2090
2094
|
if (d.userId !== s || N(d.kindKey).capacity && !d.workstreamId) continue;
|
|
2091
|
-
const
|
|
2092
|
-
|
|
2095
|
+
const c = ge(d.start, d.end, n.from, n.to);
|
|
2096
|
+
c <= 0 || (Lt(d, t) ? u += c : l += c);
|
|
2093
2097
|
}
|
|
2094
2098
|
return {
|
|
2095
2099
|
userId: s,
|
|
2096
2100
|
capacitySeconds: a,
|
|
2097
|
-
onThisSeconds:
|
|
2098
|
-
elsewhereSeconds:
|
|
2099
|
-
freeSeconds: Math.max(0, a -
|
|
2101
|
+
onThisSeconds: u,
|
|
2102
|
+
elsewhereSeconds: l,
|
|
2103
|
+
freeSeconds: Math.max(0, a - u - l)
|
|
2100
2104
|
};
|
|
2101
2105
|
}
|
|
2102
2106
|
);
|
|
@@ -2154,16 +2158,16 @@ function $r(e, t, n) {
|
|
|
2154
2158
|
return { seconds: o, headcount: o / n * s };
|
|
2155
2159
|
}
|
|
2156
2160
|
function Qa(e) {
|
|
2157
|
-
const { entries: t, workstreamId: n, staffing: r, demand: o, range: i } = e, s = e.grain ?? "hour", a = Dr(s),
|
|
2161
|
+
const { entries: t, workstreamId: n, staffing: r, demand: o, range: i } = e, s = e.grain ?? "hour", a = Dr(s), u = a / 1e3, l = e.kinds, d = t.filter((m) => W(m.status)), c = d.filter((m) => Lt(m, n, l)), p = d.filter((m) => N(m.kindKey, l).capacity), f = d.filter((m) => N(m.kindKey, l).absent), y = [];
|
|
2158
2162
|
for (let m = H(i.from, s); m < i.to; m += a) {
|
|
2159
|
-
const
|
|
2163
|
+
const E = m + a, g = j(m, s);
|
|
2160
2164
|
let h = 0;
|
|
2161
|
-
for (const k of
|
|
2162
|
-
let
|
|
2163
|
-
for (const k of p)
|
|
2165
|
+
for (const k of c) h += ce(k, m, E);
|
|
2166
|
+
let S = 0;
|
|
2167
|
+
for (const k of p) S += ce(k, m, E);
|
|
2164
2168
|
let x = 0;
|
|
2165
|
-
for (const k of f) x += ce(k, m,
|
|
2166
|
-
const C = o?.[g] ?? {}, M = $r(C, r,
|
|
2169
|
+
for (const k of f) x += ce(k, m, E);
|
|
2170
|
+
const C = o?.[g] ?? {}, M = $r(C, r, u), O = h / u;
|
|
2167
2171
|
y.push({
|
|
2168
2172
|
period: g,
|
|
2169
2173
|
forecastVolume: C.volume,
|
|
@@ -2172,7 +2176,7 @@ function Qa(e) {
|
|
|
2172
2176
|
scheduledSeconds: h,
|
|
2173
2177
|
scheduledHeadcount: O,
|
|
2174
2178
|
netHeadcount: O - M.headcount,
|
|
2175
|
-
capacitySeconds:
|
|
2179
|
+
capacitySeconds: S,
|
|
2176
2180
|
absentSeconds: x
|
|
2177
2181
|
});
|
|
2178
2182
|
}
|
|
@@ -2199,10 +2203,10 @@ function jr(e, t, n) {
|
|
|
2199
2203
|
const r = [];
|
|
2200
2204
|
for (let i = 0; i < n; i++) {
|
|
2201
2205
|
const s = t - i * ye, a = s - ye;
|
|
2202
|
-
let
|
|
2203
|
-
for (const [d,
|
|
2204
|
-
d >= a && d < s && (
|
|
2205
|
-
|
|
2206
|
+
let u = 0, l = !1;
|
|
2207
|
+
for (const [d, c] of e)
|
|
2208
|
+
d >= a && d < s && (u += c, l = !0);
|
|
2209
|
+
l && r.push(u);
|
|
2206
2210
|
}
|
|
2207
2211
|
if (r.length < 2) return 1;
|
|
2208
2212
|
const o = r.reduce((i, s) => i + s, 0) / r.length;
|
|
@@ -2217,20 +2221,20 @@ function Hr(e, t) {
|
|
|
2217
2221
|
}
|
|
2218
2222
|
function ec(e, t, n) {
|
|
2219
2223
|
const r = Math.max(1, n?.weeks ?? Kr), o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
|
|
2220
|
-
for (const
|
|
2221
|
-
o.set(Br(
|
|
2224
|
+
for (const u of e)
|
|
2225
|
+
o.set(Br(u.period), u.value), i.add(u.period.slice(0, 10));
|
|
2222
2226
|
const s = jr(o, H(t.from, "hour"), r), a = [];
|
|
2223
|
-
for (let
|
|
2224
|
-
let
|
|
2227
|
+
for (let u = H(t.from, "hour"); u < t.to; u += Pr) {
|
|
2228
|
+
let l = 0, d = 0;
|
|
2225
2229
|
for (let f = 1; f <= r; f++) {
|
|
2226
|
-
const y =
|
|
2227
|
-
if (
|
|
2230
|
+
const y = u - f * ye, E = o.get(y) ?? (i.has(j(y, "day")) ? 0 : void 0);
|
|
2231
|
+
if (E === void 0) continue;
|
|
2228
2232
|
const g = r - f + 1;
|
|
2229
|
-
|
|
2233
|
+
l += E * g, d += g;
|
|
2230
2234
|
}
|
|
2231
|
-
let
|
|
2232
|
-
const p = Hr(n?.adjustments,
|
|
2233
|
-
p?.absoluteVolume !== void 0 ?
|
|
2235
|
+
let c = d > 0 ? l / d * s : 0;
|
|
2236
|
+
const p = Hr(n?.adjustments, u);
|
|
2237
|
+
p?.absoluteVolume !== void 0 ? c = p.absoluteVolume : p?.factor !== void 0 && (c *= p.factor), a.push({ period: j(u, "hour"), volume: c });
|
|
2234
2238
|
}
|
|
2235
2239
|
return a;
|
|
2236
2240
|
}
|
|
@@ -2256,47 +2260,47 @@ function le(e, t, n, r) {
|
|
|
2256
2260
|
return o > 0 ? o / 1e3 : 0;
|
|
2257
2261
|
}
|
|
2258
2262
|
function rc(e, t, n = {}) {
|
|
2259
|
-
const r = n.grain ?? "hour", o = Vr(t, r), i = r === "day" ? K : be, s = new Map(o.map((
|
|
2260
|
-
for (const
|
|
2261
|
-
if (!(
|
|
2263
|
+
const r = n.grain ?? "hour", o = Vr(t, r), i = r === "day" ? K : be, s = new Map(o.map((c) => [c, 0])), a = e.filter((c) => c.userId && N(c.kindKey).capacity), u = n.userIds?.length ? new Set(n.userIds) : null, l = /* @__PURE__ */ new Set();
|
|
2264
|
+
for (const c of a)
|
|
2265
|
+
if (!(u && c.userId && !u.has(c.userId))) {
|
|
2262
2266
|
for (const p of o) {
|
|
2263
|
-
const f = le(
|
|
2267
|
+
const f = le(c.start, c.end, p, p + i);
|
|
2264
2268
|
f > 0 && s.set(p, (s.get(p) ?? 0) + f);
|
|
2265
2269
|
}
|
|
2266
2270
|
for (const p of rt(t))
|
|
2267
|
-
le(
|
|
2271
|
+
le(c.start, c.end, p, p + K) > 0 && l.add(`${c.userId}:${p}`);
|
|
2268
2272
|
}
|
|
2269
2273
|
const d = n.userIds ?? [
|
|
2270
2274
|
.../* @__PURE__ */ new Set([
|
|
2271
|
-
...a.map((
|
|
2272
|
-
...(n.patterns ?? []).map((
|
|
2275
|
+
...a.map((c) => c.userId),
|
|
2276
|
+
...(n.patterns ?? []).map((c) => c.userId)
|
|
2273
2277
|
])
|
|
2274
|
-
].filter((
|
|
2278
|
+
].filter((c) => !!c);
|
|
2275
2279
|
if (n.patterns?.length)
|
|
2276
|
-
for (const
|
|
2277
|
-
const p = n.teamIdsOf?.(
|
|
2280
|
+
for (const c of d) {
|
|
2281
|
+
const p = n.teamIdsOf?.(c) ?? [];
|
|
2278
2282
|
for (const f of rt(t)) {
|
|
2279
|
-
if (
|
|
2280
|
-
const y = Ft(n.patterns,
|
|
2283
|
+
if (l.has(`${c}:${f}`)) continue;
|
|
2284
|
+
const y = Ft(n.patterns, c, p, f);
|
|
2281
2285
|
if (!y) continue;
|
|
2282
2286
|
const m = Kt(y, f);
|
|
2283
2287
|
if (m <= 0) continue;
|
|
2284
|
-
const
|
|
2285
|
-
if (
|
|
2286
|
-
const [
|
|
2288
|
+
const E = Ut(y, f);
|
|
2289
|
+
if (E) {
|
|
2290
|
+
const [S, x] = E.split(":").map(Number), C = f + S * be + (x ?? 0) * 6e4, M = C + m * 6e4;
|
|
2287
2291
|
for (const O of o) {
|
|
2288
2292
|
const k = le(C, M, O, O + i);
|
|
2289
2293
|
k > 0 && s.set(O, (s.get(O) ?? 0) + k);
|
|
2290
2294
|
}
|
|
2291
2295
|
continue;
|
|
2292
2296
|
}
|
|
2293
|
-
const g = o.filter((
|
|
2297
|
+
const g = o.filter((S) => S >= f && S < f + K);
|
|
2294
2298
|
if (!g.length) continue;
|
|
2295
2299
|
const h = m * 60 / g.length;
|
|
2296
|
-
for (const
|
|
2300
|
+
for (const S of g) s.set(S, (s.get(S) ?? 0) + h);
|
|
2297
2301
|
}
|
|
2298
2302
|
}
|
|
2299
|
-
return o.map((
|
|
2303
|
+
return o.map((c) => ({ period: j(c, r), weight: s.get(c) ?? 0 }));
|
|
2300
2304
|
}
|
|
2301
2305
|
function zr(e, t) {
|
|
2302
2306
|
if (e <= 0 || !t.length) return [];
|
|
@@ -2312,8 +2316,8 @@ function oc(e, t, n) {
|
|
|
2312
2316
|
for (const o of e) {
|
|
2313
2317
|
const i = o.by ? t.filter((a) => n(a.period) < o.by) : t, s = i.length ? i : t;
|
|
2314
2318
|
for (const a of zr(o.seconds, s)) {
|
|
2315
|
-
const
|
|
2316
|
-
|
|
2319
|
+
const u = `${a.period}|${o.userId ?? ""}`, l = r.get(u);
|
|
2320
|
+
l ? l.seconds += a.seconds : r.set(u, { ...a, userId: o.userId });
|
|
2317
2321
|
}
|
|
2318
2322
|
}
|
|
2319
2323
|
return [...r.values()].sort(
|
|
@@ -2467,24 +2471,24 @@ function oo(e) {
|
|
|
2467
2471
|
return { total: n, rate: n ? t / n : 0 };
|
|
2468
2472
|
}
|
|
2469
2473
|
const io = 10, so = 0.9;
|
|
2470
|
-
function
|
|
2474
|
+
function _c(e) {
|
|
2471
2475
|
const { total: t, rate: n } = oo(e);
|
|
2472
2476
|
return t >= io && n >= so;
|
|
2473
2477
|
}
|
|
2474
2478
|
const ao = ["done", "escalated", "failed", "stopped"];
|
|
2475
|
-
function
|
|
2479
|
+
function Ac(e) {
|
|
2476
2480
|
return ao.includes(e);
|
|
2477
2481
|
}
|
|
2478
2482
|
function co(e) {
|
|
2479
2483
|
return e === "waiting";
|
|
2480
2484
|
}
|
|
2481
|
-
function
|
|
2485
|
+
function Sc(e) {
|
|
2482
2486
|
return e === "running" || co(e);
|
|
2483
2487
|
}
|
|
2484
2488
|
function Bt(e) {
|
|
2485
2489
|
return e.subjectKind && e.subjectId ? { type: e.subjectKind, id: e.subjectId } : void 0;
|
|
2486
2490
|
}
|
|
2487
|
-
function
|
|
2491
|
+
function Ec(e) {
|
|
2488
2492
|
const t = Bt(e);
|
|
2489
2493
|
return t ? Jr(t) : void 0;
|
|
2490
2494
|
}
|
|
@@ -2510,7 +2514,7 @@ const lo = (e, t) => (e.createdAt ?? 0) - (t.createdAt ?? 0);
|
|
|
2510
2514
|
function wc(e, t) {
|
|
2511
2515
|
return t ? e.actors.some((n) => n.type === "user" && n.id === t) : !1;
|
|
2512
2516
|
}
|
|
2513
|
-
const
|
|
2517
|
+
const _e = 6e4, uo = 36e5, V = 864e5, jt = 800;
|
|
2514
2518
|
function ot(e, t) {
|
|
2515
2519
|
const n = Date.UTC(e, t + 1, 0);
|
|
2516
2520
|
return n - new Date(n).getUTCDay() * V + uo;
|
|
@@ -2521,7 +2525,7 @@ function po(e) {
|
|
|
2521
2525
|
}
|
|
2522
2526
|
function Ht(e, t) {
|
|
2523
2527
|
const n = t.dst === "eu" && po(e) ? 60 : 0;
|
|
2524
|
-
return (t.utcOffsetMinutes + n) *
|
|
2528
|
+
return (t.utcOffsetMinutes + n) * _e;
|
|
2525
2529
|
}
|
|
2526
2530
|
function fo(e) {
|
|
2527
2531
|
return (e + 3) % 7 + 1;
|
|
@@ -2531,23 +2535,23 @@ function Gt(e, t) {
|
|
|
2531
2535
|
if (!t.days.includes(fo(o))) return null;
|
|
2532
2536
|
const i = o * V;
|
|
2533
2537
|
return {
|
|
2534
|
-
open: i + t.fromMinutes *
|
|
2535
|
-
close: i + t.toMinutes *
|
|
2538
|
+
open: i + t.fromMinutes * _e - n,
|
|
2539
|
+
close: i + t.toMinutes * _e - n
|
|
2536
2540
|
};
|
|
2537
2541
|
}
|
|
2538
2542
|
function Wt(e, t) {
|
|
2539
2543
|
const n = Ht(e, t), r = e + n;
|
|
2540
2544
|
return (Math.floor(r / V) + 1) * V - n;
|
|
2541
2545
|
}
|
|
2542
|
-
function
|
|
2546
|
+
function Ae(e, t, n) {
|
|
2543
2547
|
if (t <= e) return 0;
|
|
2544
2548
|
if (!n) return t - e;
|
|
2545
2549
|
let r = 0, o = e;
|
|
2546
2550
|
for (let i = 0; i < jt && o < t; i++) {
|
|
2547
2551
|
const s = Gt(o, n);
|
|
2548
2552
|
if (s) {
|
|
2549
|
-
const a = Math.max(o, s.open),
|
|
2550
|
-
|
|
2553
|
+
const a = Math.max(o, s.open), u = Math.min(t, s.close);
|
|
2554
|
+
u > a && (r += u - a);
|
|
2551
2555
|
}
|
|
2552
2556
|
o = Wt(o, n);
|
|
2553
2557
|
}
|
|
@@ -2561,9 +2565,9 @@ function Oe(e, t, n) {
|
|
|
2561
2565
|
if (s) {
|
|
2562
2566
|
const a = Math.max(o, s.open);
|
|
2563
2567
|
if (s.close > a) {
|
|
2564
|
-
const
|
|
2565
|
-
if (r <=
|
|
2566
|
-
r -=
|
|
2568
|
+
const u = s.close - a;
|
|
2569
|
+
if (r <= u) return a + r;
|
|
2570
|
+
r -= u;
|
|
2567
2571
|
}
|
|
2568
2572
|
}
|
|
2569
2573
|
o = Wt(o, n);
|
|
@@ -2574,9 +2578,9 @@ function kc(e) {
|
|
|
2574
2578
|
const t = /^([01]\d|2[0-3]):([0-5]\d)$/.exec(e);
|
|
2575
2579
|
return t ? Number(t[1]) * 60 + Number(t[2]) : null;
|
|
2576
2580
|
}
|
|
2577
|
-
const
|
|
2581
|
+
const Se = 1, Ee = 2;
|
|
2578
2582
|
function Mc(e) {
|
|
2579
|
-
return e === "snoozed" ?
|
|
2583
|
+
return e === "snoozed" ? Se : Ee;
|
|
2580
2584
|
}
|
|
2581
2585
|
function xe(e) {
|
|
2582
2586
|
const t = e.calendar;
|
|
@@ -2601,7 +2605,7 @@ function it(e) {
|
|
|
2601
2605
|
function yo(e, t, n, r) {
|
|
2602
2606
|
if (!z(e) || (e.pauseBits & t) !== 0) return null;
|
|
2603
2607
|
const o = e.pauseBits | t;
|
|
2604
|
-
return e.state === "paused" ? { pauseBits: o } : { pauseBits: o, state: "paused", remainingMs:
|
|
2608
|
+
return e.state === "paused" ? { pauseBits: o } : { pauseBits: o, state: "paused", remainingMs: Ae(n, e.dueAt, r) };
|
|
2605
2609
|
}
|
|
2606
2610
|
function bo(e, t, n, r) {
|
|
2607
2611
|
if (!z(e) || (e.pauseBits & t) === 0) return null;
|
|
@@ -2609,23 +2613,23 @@ function bo(e, t, n, r) {
|
|
|
2609
2613
|
return o !== 0 ? { pauseBits: o } : { pauseBits: o, state: "running", dueAt: Oe(n, e.remainingMs, r) };
|
|
2610
2614
|
}
|
|
2611
2615
|
function Oc({ event: e, at: t, now: n, clocks: r, profile: o }) {
|
|
2612
|
-
const i = xe(o), s = Math.min(t, n), a = r.map((g) => ({ ...g })),
|
|
2613
|
-
h && (
|
|
2616
|
+
const i = xe(o), s = Math.min(t, n), a = r.map((g) => ({ ...g })), u = [], l = (g, h) => {
|
|
2617
|
+
h && (u.push({ op: "patch", clockId: g.id, patch: h }), Object.assign(g, h));
|
|
2614
2618
|
}, d = (g) => {
|
|
2615
2619
|
for (const h of a)
|
|
2616
|
-
h.metric === g &&
|
|
2617
|
-
},
|
|
2620
|
+
h.metric === g && l(h, go(h, s));
|
|
2621
|
+
}, c = (g) => {
|
|
2618
2622
|
for (const h of a)
|
|
2619
|
-
g.includes(h.metric) &&
|
|
2623
|
+
g.includes(h.metric) && l(h, it(h));
|
|
2620
2624
|
}, p = (g) => {
|
|
2621
|
-
for (const h of a)
|
|
2625
|
+
for (const h of a) l(h, yo(h, g, s, i));
|
|
2622
2626
|
}, f = (g) => {
|
|
2623
|
-
for (const h of a)
|
|
2624
|
-
}, y = (g) => a.reduce((h,
|
|
2625
|
-
const
|
|
2626
|
-
if (!
|
|
2627
|
-
const x =
|
|
2628
|
-
|
|
2627
|
+
for (const h of a) l(h, bo(h, g, s, i));
|
|
2628
|
+
}, y = (g) => a.reduce((h, S) => S.metric === g ? Math.max(h, S.attempt) : h, 0) + 1, m = (g) => a.some((h) => h.metric === g && z(h)), E = (g, h) => {
|
|
2629
|
+
const S = o.targets.find((C) => C.metric === g);
|
|
2630
|
+
if (!S) return;
|
|
2631
|
+
const x = S.minutes * mo;
|
|
2632
|
+
u.push({
|
|
2629
2633
|
op: "start",
|
|
2630
2634
|
metric: g,
|
|
2631
2635
|
attempt: y(g),
|
|
@@ -2637,12 +2641,12 @@ function Oc({ event: e, at: t, now: n, clocks: r, profile: o }) {
|
|
|
2637
2641
|
switch (e) {
|
|
2638
2642
|
case "apply": {
|
|
2639
2643
|
for (const g of a)
|
|
2640
|
-
g.profileId !== o.id &&
|
|
2644
|
+
g.profileId !== o.id && l(g, it(g));
|
|
2641
2645
|
for (const g of o.targets) {
|
|
2642
2646
|
if (g.metric === "next_response") continue;
|
|
2643
2647
|
a.some(
|
|
2644
|
-
(
|
|
2645
|
-
) ||
|
|
2648
|
+
(S) => S.metric === g.metric && S.profileId === o.id
|
|
2649
|
+
) || E(g.metric, s);
|
|
2646
2650
|
}
|
|
2647
2651
|
break;
|
|
2648
2652
|
}
|
|
@@ -2650,46 +2654,46 @@ function Oc({ event: e, at: t, now: n, clocks: r, profile: o }) {
|
|
|
2650
2654
|
d("speed_of_answer");
|
|
2651
2655
|
break;
|
|
2652
2656
|
case "outbound": {
|
|
2653
|
-
d("first_response"), d("next_response"), o.pauseOn.includes("waiting_for_customer") && p(
|
|
2657
|
+
d("first_response"), d("next_response"), o.pauseOn.includes("waiting_for_customer") && p(Ee);
|
|
2654
2658
|
break;
|
|
2655
2659
|
}
|
|
2656
2660
|
case "inbound": {
|
|
2657
|
-
f(
|
|
2661
|
+
f(Ee), !m("first_response") && !m("next_response") && E("next_response", s);
|
|
2658
2662
|
break;
|
|
2659
2663
|
}
|
|
2660
2664
|
case "resolved":
|
|
2661
2665
|
d("resolution");
|
|
2662
2666
|
break;
|
|
2663
2667
|
case "closed":
|
|
2664
|
-
d("close"), d("resolution"),
|
|
2668
|
+
d("close"), d("resolution"), c(Vt);
|
|
2665
2669
|
break;
|
|
2666
2670
|
case "reopened":
|
|
2667
|
-
m("resolution") ||
|
|
2671
|
+
m("resolution") || E("resolution", s), m("close") || E("close", s);
|
|
2668
2672
|
break;
|
|
2669
2673
|
case "snoozed":
|
|
2670
|
-
o.pauseOn.includes("snoozed") && p(
|
|
2674
|
+
o.pauseOn.includes("snoozed") && p(Se);
|
|
2671
2675
|
break;
|
|
2672
2676
|
case "unsnoozed":
|
|
2673
|
-
f(
|
|
2677
|
+
f(Se);
|
|
2674
2678
|
break;
|
|
2675
2679
|
case "discarded":
|
|
2676
|
-
|
|
2680
|
+
c(ho);
|
|
2677
2681
|
break;
|
|
2678
2682
|
}
|
|
2679
|
-
return
|
|
2683
|
+
return u;
|
|
2680
2684
|
}
|
|
2681
|
-
function
|
|
2685
|
+
function _o(e) {
|
|
2682
2686
|
return e.state === "running" || e.state === "paused";
|
|
2683
2687
|
}
|
|
2684
2688
|
function Ie(e, t) {
|
|
2685
2689
|
const n = xe(e);
|
|
2686
|
-
return e.state === "paused" ? e.remainingMs : t >= e.dueAt ? -
|
|
2690
|
+
return e.state === "paused" ? e.remainingMs : t >= e.dueAt ? -Ae(e.dueAt, t, n) : Ae(t, e.dueAt, n);
|
|
2687
2691
|
}
|
|
2688
2692
|
function xc(e, t) {
|
|
2689
2693
|
return e.state === "paused" ? Oe(t, e.remainingMs, xe(e)) : e.dueAt;
|
|
2690
2694
|
}
|
|
2691
2695
|
function Nc(e, t) {
|
|
2692
|
-
const n = e.filter(
|
|
2696
|
+
const n = e.filter(_o);
|
|
2693
2697
|
if (!n.length) return;
|
|
2694
2698
|
const r = n.filter((i) => i.state === "running");
|
|
2695
2699
|
return (r.length ? r : n).reduce(
|
|
@@ -2708,9 +2712,9 @@ function Dc(e) {
|
|
|
2708
2712
|
const t = Math.floor(Math.abs(e) / 1e3), n = Math.floor(t / 86400), r = Math.floor(t % 86400 / 3600), o = Math.floor(t % 3600 / 60);
|
|
2709
2713
|
return n ? r ? `${n}d ${r}u` : `${n}d` : r ? o ? `${r}u ${o}m` : `${r}u` : o ? `${o}m` : `${t % 60}s`;
|
|
2710
2714
|
}
|
|
2711
|
-
const
|
|
2715
|
+
const Ao = "strategy_item";
|
|
2712
2716
|
function zt(e) {
|
|
2713
|
-
return `${
|
|
2717
|
+
return `${Ao}:${e}`;
|
|
2714
2718
|
}
|
|
2715
2719
|
function $c(e, t = 25) {
|
|
2716
2720
|
const n = /* @__PURE__ */ new Set([zt(e.id)]);
|
|
@@ -2724,12 +2728,12 @@ const ne = [
|
|
|
2724
2728
|
{ key: "area", label: "level_area", order: 10, measurable: !1, icon: "compass" },
|
|
2725
2729
|
{ key: "objective", label: "level_objective", order: 20, measurable: !0, icon: "target" },
|
|
2726
2730
|
{ key: "key_result", label: "level_key_result", order: 30, measurable: !0, icon: "gauge" }
|
|
2727
|
-
],
|
|
2731
|
+
], So = 999, Eo = 7;
|
|
2728
2732
|
function Io(e, t = ne) {
|
|
2729
2733
|
return t.find((n) => n.key === e);
|
|
2730
2734
|
}
|
|
2731
2735
|
function Te(e, t = ne) {
|
|
2732
|
-
return Io(e, t)?.order ??
|
|
2736
|
+
return Io(e, t)?.order ?? So;
|
|
2733
2737
|
}
|
|
2734
2738
|
function Pc(e, t, n = ne) {
|
|
2735
2739
|
return Te(t, n) <= Te(e, n);
|
|
@@ -2790,7 +2794,7 @@ function Vc(e) {
|
|
|
2790
2794
|
function zc(e, t) {
|
|
2791
2795
|
const n = e.lastCheckInAt ?? e.createdAt;
|
|
2792
2796
|
if (typeof n != "number") return 0;
|
|
2793
|
-
const r = (e.checkInEveryDays ??
|
|
2797
|
+
const r = (e.checkInEveryDays ?? Eo) * To, o = t - n - r;
|
|
2794
2798
|
return o > 0 ? o : 0;
|
|
2795
2799
|
}
|
|
2796
2800
|
function Xc(e) {
|
|
@@ -3003,7 +3007,7 @@ function cl(e, t = {}) {
|
|
|
3003
3007
|
};
|
|
3004
3008
|
}
|
|
3005
3009
|
function ll(e, t = [], n = $o) {
|
|
3006
|
-
const r = e.totals ?? { netCents: 0, grossCents: 0, byRate: [] }, o = (a) => t.find((
|
|
3010
|
+
const r = e.totals ?? { netCents: 0, grossCents: 0, byRate: [] }, o = (a) => t.find((u) => u.key === a)?.percent ?? 0, i = {
|
|
3007
3011
|
block_id: "lines",
|
|
3008
3012
|
type: "table",
|
|
3009
3013
|
columns: [
|
|
@@ -3138,14 +3142,14 @@ const Ne = [
|
|
|
3138
3142
|
{ key: "subtask", label: "type_subtask" },
|
|
3139
3143
|
{ key: "case", label: "type_case" },
|
|
3140
3144
|
{ key: "deal", label: "type_deal" }
|
|
3141
|
-
],
|
|
3142
|
-
function
|
|
3145
|
+
], _l = Ne.map((e) => e.key);
|
|
3146
|
+
function Al(e) {
|
|
3143
3147
|
return e?.types?.length ? e.types : Ne;
|
|
3144
3148
|
}
|
|
3145
|
-
function
|
|
3149
|
+
function Sl(e, t) {
|
|
3146
3150
|
return t.find((n) => n.key === e);
|
|
3147
3151
|
}
|
|
3148
|
-
function
|
|
3152
|
+
function El(e) {
|
|
3149
3153
|
const t = e.trim().toLowerCase();
|
|
3150
3154
|
return t ? t.includes("sub-task") || t.includes("subtask") || t.includes("sub task") ? "subtask" : t.includes("bug") || t.includes("defect") ? "bug" : t.includes("epic") ? "epic" : t.includes("story") ? "story" : t.includes("incident") || t.includes("problem") || t.includes("service request") || t.includes("change") ? "case" : t.includes("task") ? "task" : null : null;
|
|
3151
3155
|
}
|
|
@@ -3407,7 +3411,7 @@ const nu = "message_window", ru = "message_templates", ou = {
|
|
|
3407
3411
|
ok: !1,
|
|
3408
3412
|
code: "UNSUPPORTED",
|
|
3409
3413
|
message: "Provider does not support this op"
|
|
3410
|
-
}, uu = "connector", du = "context.collect",
|
|
3414
|
+
}, uu = "connector", du = "context.collect", A = (e) => ({ type: "string", description: e }), _ = (e) => ({ type: "number", description: e }), Q = (e) => ({ type: "boolean", description: e }), v = A("Sheet name. Omit for the sheet the user is looking at."), lt = A("Slide id, as `inspect` reports it.");
|
|
3411
3415
|
function b(e, t, n, r, o, i) {
|
|
3412
3416
|
return {
|
|
3413
3417
|
op: e,
|
|
@@ -3423,7 +3427,7 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3423
3427
|
"pdf.goToPage",
|
|
3424
3428
|
["pdf"],
|
|
3425
3429
|
"Scroll the viewer to a page.",
|
|
3426
|
-
{ page:
|
|
3430
|
+
{ page: _("1-based page number.") },
|
|
3427
3431
|
["page"],
|
|
3428
3432
|
B
|
|
3429
3433
|
),
|
|
@@ -3431,7 +3435,7 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3431
3435
|
"pdf.search",
|
|
3432
3436
|
["pdf"],
|
|
3433
3437
|
"Search the document and highlight the matches, as the find bar does.",
|
|
3434
|
-
{ query:
|
|
3438
|
+
{ query: A("Text to find."), next: Q("Jump to the next match instead of the first.") },
|
|
3435
3439
|
["query"],
|
|
3436
3440
|
B
|
|
3437
3441
|
),
|
|
@@ -3454,7 +3458,7 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3454
3458
|
["pdf"],
|
|
3455
3459
|
"Fill one form field of a fillable PDF.",
|
|
3456
3460
|
{
|
|
3457
|
-
field:
|
|
3461
|
+
field: A("Field name, exactly as `inspect` reports it under `fields`."),
|
|
3458
3462
|
value: {
|
|
3459
3463
|
type: ["string", "boolean"],
|
|
3460
3464
|
description: "Text for a text field, true/false for a checkbox or radio."
|
|
@@ -3490,13 +3494,13 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3490
3494
|
["pdf"],
|
|
3491
3495
|
"Place a text note on a page. Written on save; not visible before that.",
|
|
3492
3496
|
{
|
|
3493
|
-
page:
|
|
3494
|
-
text:
|
|
3495
|
-
left:
|
|
3496
|
-
top:
|
|
3497
|
-
width:
|
|
3498
|
-
height:
|
|
3499
|
-
fontSize:
|
|
3497
|
+
page: _("1-based page number."),
|
|
3498
|
+
text: A("The note's text."),
|
|
3499
|
+
left: _("Distance from the left edge, in PDF points (72 per inch)."),
|
|
3500
|
+
top: _("Distance from the top edge, in PDF points."),
|
|
3501
|
+
width: _("Box width in points. Omit for a sensible default."),
|
|
3502
|
+
height: _("Box height in points. Omit for a sensible default."),
|
|
3503
|
+
fontSize: _("Font size in points. Omit for 12.")
|
|
3500
3504
|
},
|
|
3501
3505
|
["page", "text", "left", "top"],
|
|
3502
3506
|
ee
|
|
@@ -3506,9 +3510,9 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3506
3510
|
["pdf"],
|
|
3507
3511
|
"Highlight a phrase on a page. Written on save; not visible before that.",
|
|
3508
3512
|
{
|
|
3509
|
-
page:
|
|
3510
|
-
text:
|
|
3511
|
-
occurrence:
|
|
3513
|
+
page: _("1-based page number."),
|
|
3514
|
+
text: A("The exact phrase to highlight, as it appears in the page's text."),
|
|
3515
|
+
occurrence: _("Which occurrence on that page, 1-based. Omit for the first.")
|
|
3512
3516
|
},
|
|
3513
3517
|
["page", "text"],
|
|
3514
3518
|
ee
|
|
@@ -3520,7 +3524,7 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3520
3524
|
"Write a block of values. The block's shape must match the range.",
|
|
3521
3525
|
{
|
|
3522
3526
|
sheet: v,
|
|
3523
|
-
range:
|
|
3527
|
+
range: A("A1 notation, e.g. `B2:D5` or a single `A1`."),
|
|
3524
3528
|
values: {
|
|
3525
3529
|
type: "array",
|
|
3526
3530
|
items: { type: "array", items: { type: ["string", "number", "boolean", "null"] } },
|
|
@@ -3534,7 +3538,7 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3534
3538
|
"sheet.setFormula",
|
|
3535
3539
|
["sheet"],
|
|
3536
3540
|
"Put a formula in every cell of a range.",
|
|
3537
|
-
{ sheet: v, range:
|
|
3541
|
+
{ sheet: v, range: A("A1 notation."), formula: A("Including the leading `=`.") },
|
|
3538
3542
|
["range", "formula"],
|
|
3539
3543
|
I
|
|
3540
3544
|
),
|
|
@@ -3544,18 +3548,18 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3544
3548
|
"Change the look of a range. Only the properties you pass are touched.",
|
|
3545
3549
|
{
|
|
3546
3550
|
sheet: v,
|
|
3547
|
-
range:
|
|
3551
|
+
range: A("A1 notation."),
|
|
3548
3552
|
bold: Q("Bold on or off."),
|
|
3549
3553
|
italic: Q("Italic on or off."),
|
|
3550
|
-
fontSize:
|
|
3551
|
-
fontColor:
|
|
3552
|
-
background:
|
|
3554
|
+
fontSize: _("Point size."),
|
|
3555
|
+
fontColor: A("CSS colour, e.g. `#b91c1c`."),
|
|
3556
|
+
background: A("CSS colour for the cell fill."),
|
|
3553
3557
|
horizontalAlignment: {
|
|
3554
3558
|
type: "string",
|
|
3555
3559
|
enum: ["left", "center", "right"],
|
|
3556
3560
|
description: "Horizontal alignment."
|
|
3557
3561
|
},
|
|
3558
|
-
numberFormat:
|
|
3562
|
+
numberFormat: A("Number format pattern, e.g. `#,##0.00` or `0%`.")
|
|
3559
3563
|
},
|
|
3560
3564
|
["range"],
|
|
3561
3565
|
I
|
|
@@ -3566,8 +3570,8 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3566
3570
|
"Insert empty rows, pushing the rest down.",
|
|
3567
3571
|
{
|
|
3568
3572
|
sheet: v,
|
|
3569
|
-
at:
|
|
3570
|
-
count:
|
|
3573
|
+
at: _("1-based row number to insert before."),
|
|
3574
|
+
count: _("How many. Omit for 1.")
|
|
3571
3575
|
},
|
|
3572
3576
|
["at"],
|
|
3573
3577
|
I
|
|
@@ -3576,7 +3580,7 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3576
3580
|
"sheet.deleteRows",
|
|
3577
3581
|
["sheet"],
|
|
3578
3582
|
"Delete rows, pulling the rest up.",
|
|
3579
|
-
{ sheet: v, at:
|
|
3583
|
+
{ sheet: v, at: _("1-based first row to delete."), count: _("How many. Omit for 1.") },
|
|
3580
3584
|
["at"],
|
|
3581
3585
|
I
|
|
3582
3586
|
),
|
|
@@ -3586,8 +3590,8 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3586
3590
|
"Insert empty columns, pushing the rest right.",
|
|
3587
3591
|
{
|
|
3588
3592
|
sheet: v,
|
|
3589
|
-
at:
|
|
3590
|
-
count:
|
|
3593
|
+
at: _("1-based column number to insert before."),
|
|
3594
|
+
count: _("How many. Omit for 1.")
|
|
3591
3595
|
},
|
|
3592
3596
|
["at"],
|
|
3593
3597
|
I
|
|
@@ -3598,8 +3602,8 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3598
3602
|
"Delete columns, pulling the rest left.",
|
|
3599
3603
|
{
|
|
3600
3604
|
sheet: v,
|
|
3601
|
-
at:
|
|
3602
|
-
count:
|
|
3605
|
+
at: _("1-based first column to delete."),
|
|
3606
|
+
count: _("How many. Omit for 1.")
|
|
3603
3607
|
},
|
|
3604
3608
|
["at"],
|
|
3605
3609
|
I
|
|
@@ -3608,7 +3612,7 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3608
3612
|
"sheet.merge",
|
|
3609
3613
|
["sheet"],
|
|
3610
3614
|
"Merge a range into one cell.",
|
|
3611
|
-
{ sheet: v, range:
|
|
3615
|
+
{ sheet: v, range: A("A1 notation.") },
|
|
3612
3616
|
["range"],
|
|
3613
3617
|
I
|
|
3614
3618
|
),
|
|
@@ -3616,7 +3620,7 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3616
3620
|
"sheet.unmerge",
|
|
3617
3621
|
["sheet"],
|
|
3618
3622
|
"Break merged cells in a range apart.",
|
|
3619
|
-
{ sheet: v, range:
|
|
3623
|
+
{ sheet: v, range: A("A1 notation.") },
|
|
3620
3624
|
["range"],
|
|
3621
3625
|
I
|
|
3622
3626
|
),
|
|
@@ -3626,8 +3630,8 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3626
3630
|
"Sort a range on one of its columns.",
|
|
3627
3631
|
{
|
|
3628
3632
|
sheet: v,
|
|
3629
|
-
range:
|
|
3630
|
-
column:
|
|
3633
|
+
range: A("A1 notation covering the rows to sort, header excluded."),
|
|
3634
|
+
column: _("1-based column *within the range*, not within the sheet."),
|
|
3631
3635
|
ascending: Q("Ascending. Omit for ascending.")
|
|
3632
3636
|
},
|
|
3633
3637
|
["range", "column"],
|
|
@@ -3637,7 +3641,7 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3637
3641
|
"sheet.insertSheet",
|
|
3638
3642
|
["sheet"],
|
|
3639
3643
|
"Add a new sheet.",
|
|
3640
|
-
{ name:
|
|
3644
|
+
{ name: A("Name for the new sheet.") },
|
|
3641
3645
|
["name"],
|
|
3642
3646
|
I
|
|
3643
3647
|
),
|
|
@@ -3645,7 +3649,7 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3645
3649
|
"sheet.renameSheet",
|
|
3646
3650
|
["sheet"],
|
|
3647
3651
|
"Rename a sheet.",
|
|
3648
|
-
{ sheet:
|
|
3652
|
+
{ sheet: A("Current name."), name: A("New name.") },
|
|
3649
3653
|
["sheet", "name"],
|
|
3650
3654
|
I
|
|
3651
3655
|
),
|
|
@@ -3653,7 +3657,7 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3653
3657
|
"sheet.deleteSheet",
|
|
3654
3658
|
["sheet"],
|
|
3655
3659
|
"Remove a sheet and everything on it.",
|
|
3656
|
-
{ sheet:
|
|
3660
|
+
{ sheet: A("Name of the sheet to delete.") },
|
|
3657
3661
|
["sheet"],
|
|
3658
3662
|
I
|
|
3659
3663
|
),
|
|
@@ -3661,7 +3665,7 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3661
3665
|
"sheet.activate",
|
|
3662
3666
|
["sheet"],
|
|
3663
3667
|
"Show the user a sheet and select a range on it.",
|
|
3664
|
-
{ sheet: v, range:
|
|
3668
|
+
{ sheet: v, range: A("A1 notation to select. Omit to only switch sheets.") },
|
|
3665
3669
|
[],
|
|
3666
3670
|
B
|
|
3667
3671
|
)
|
|
@@ -3671,8 +3675,8 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3671
3675
|
["word"],
|
|
3672
3676
|
"Rewrite one whole paragraph, keeping its style. This is the verb for shortening or rephrasing something; call it once per paragraph.",
|
|
3673
3677
|
{
|
|
3674
|
-
at:
|
|
3675
|
-
text:
|
|
3678
|
+
at: _("The offset the paragraph starts at, exactly as `inspect` prints it."),
|
|
3679
|
+
text: A("The new text for that paragraph. A newline starts a further paragraph.")
|
|
3676
3680
|
},
|
|
3677
3681
|
["at", "text"],
|
|
3678
3682
|
I
|
|
@@ -3682,9 +3686,9 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3682
3686
|
["word"],
|
|
3683
3687
|
"Replace a stretch of text inside a paragraph - a sentence, a phrase. To rewrite whole paragraphs use word.replaceParagraph: a range covering several paragraph styles is refused, because a replacement carries one style and would set the whole span in the first.",
|
|
3684
3688
|
{
|
|
3685
|
-
start:
|
|
3686
|
-
end:
|
|
3687
|
-
text:
|
|
3689
|
+
start: _("Character offset where the replaced text starts, as `inspect` reports offsets."),
|
|
3690
|
+
end: _("Character offset just past the last character to replace."),
|
|
3691
|
+
text: A("The replacement text. A newline starts a new paragraph.")
|
|
3688
3692
|
},
|
|
3689
3693
|
["start", "end", "text"],
|
|
3690
3694
|
I
|
|
@@ -3694,8 +3698,8 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3694
3698
|
["word"],
|
|
3695
3699
|
"Insert text at a character offset, without removing anything.",
|
|
3696
3700
|
{
|
|
3697
|
-
index:
|
|
3698
|
-
text:
|
|
3701
|
+
index: _("Character offset, as `inspect` reports offsets."),
|
|
3702
|
+
text: A("The text to insert.")
|
|
3699
3703
|
},
|
|
3700
3704
|
["index", "text"],
|
|
3701
3705
|
I
|
|
@@ -3704,7 +3708,7 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3704
3708
|
"word.appendText",
|
|
3705
3709
|
["word"],
|
|
3706
3710
|
"Add text at the end of the document.",
|
|
3707
|
-
{ text:
|
|
3711
|
+
{ text: A("The text to append.") },
|
|
3708
3712
|
["text"],
|
|
3709
3713
|
I
|
|
3710
3714
|
),
|
|
@@ -3713,8 +3717,8 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3713
3717
|
["word"],
|
|
3714
3718
|
"Start a new paragraph, optionally with text in it.",
|
|
3715
3719
|
{
|
|
3716
|
-
text:
|
|
3717
|
-
index:
|
|
3720
|
+
text: A("Paragraph text. Newlines start further paragraphs."),
|
|
3721
|
+
index: _("Character offset to insert at. Omit for the end of the document.")
|
|
3718
3722
|
},
|
|
3719
3723
|
[],
|
|
3720
3724
|
I
|
|
@@ -3723,7 +3727,7 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3723
3727
|
"word.setSelection",
|
|
3724
3728
|
["word"],
|
|
3725
3729
|
"Put the user's cursor on a stretch of text, and move the reading window there: the page context carries one window of a long document, and the text around this offset arrives in the next turn.",
|
|
3726
|
-
{ start:
|
|
3730
|
+
{ start: _("Start character offset."), end: _("End character offset. Omit for a caret.") },
|
|
3727
3731
|
["start"],
|
|
3728
3732
|
B
|
|
3729
3733
|
)
|
|
@@ -3734,8 +3738,8 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3734
3738
|
"Replace the text of one shape. Written on save; not visible before that, and not undoable.",
|
|
3735
3739
|
{
|
|
3736
3740
|
slide: lt,
|
|
3737
|
-
element:
|
|
3738
|
-
text:
|
|
3741
|
+
element: A("Element id, as `inspect` reports it."),
|
|
3742
|
+
text: A("The new text.")
|
|
3739
3743
|
},
|
|
3740
3744
|
["slide", "element", "text"],
|
|
3741
3745
|
ee
|
|
@@ -3746,11 +3750,11 @@ const B = { undoable: !1, visible: !0 }, I = { undoable: !0, visible: !0 }, ut =
|
|
|
3746
3750
|
"Move or resize one shape. Only the values you pass change. Written on save; not visible before that, and not undoable.",
|
|
3747
3751
|
{
|
|
3748
3752
|
slide: lt,
|
|
3749
|
-
element:
|
|
3750
|
-
left:
|
|
3751
|
-
top:
|
|
3752
|
-
width:
|
|
3753
|
-
height:
|
|
3753
|
+
element: A("Element id."),
|
|
3754
|
+
left: _("Distance from the left edge, in pixels."),
|
|
3755
|
+
top: _("Distance from the top edge, in pixels."),
|
|
3756
|
+
width: _("Width in pixels."),
|
|
3757
|
+
height: _("Height in pixels.")
|
|
3754
3758
|
},
|
|
3755
3759
|
["slide", "element"],
|
|
3756
3760
|
ee
|
|
@@ -3783,26 +3787,26 @@ function mu(e) {
|
|
|
3783
3787
|
r && r.style !== p && o(), r ? r.items.push(pt(f)) : r = { style: p, items: [pt(f)] };
|
|
3784
3788
|
};
|
|
3785
3789
|
let s = [], a = [];
|
|
3786
|
-
const
|
|
3790
|
+
const u = () => {
|
|
3787
3791
|
if (s.length) {
|
|
3788
3792
|
const p = s.join("").trim();
|
|
3789
3793
|
p && n.push({ type: "paragraph", text: p }), s = [];
|
|
3790
3794
|
}
|
|
3791
|
-
},
|
|
3795
|
+
}, l = () => {
|
|
3792
3796
|
a.length && (n.push({ type: "quote", text: a.join(`
|
|
3793
3797
|
`) }), a = []);
|
|
3794
3798
|
}, d = () => {
|
|
3795
|
-
|
|
3799
|
+
u(), l(), o();
|
|
3796
3800
|
};
|
|
3797
|
-
let
|
|
3798
|
-
for (;
|
|
3799
|
-
const p = t[
|
|
3801
|
+
let c = 0;
|
|
3802
|
+
for (; c < t.length; ) {
|
|
3803
|
+
const p = t[c] ?? "", f = p.match(/^```(\w*)\s*$/);
|
|
3800
3804
|
if (f) {
|
|
3801
3805
|
d();
|
|
3802
3806
|
const g = [];
|
|
3803
|
-
for (
|
|
3804
|
-
g.push(t[
|
|
3805
|
-
|
|
3807
|
+
for (c++; c < t.length && !/^```\s*$/.test(t[c] ?? ""); )
|
|
3808
|
+
g.push(t[c] ?? ""), c++;
|
|
3809
|
+
c++, n.push({ type: "code", ...f[1] ? { lang: f[1] } : {}, text: g.join(`
|
|
3806
3810
|
`) });
|
|
3807
3811
|
continue;
|
|
3808
3812
|
}
|
|
@@ -3812,7 +3816,7 @@ function mu(e) {
|
|
|
3812
3816
|
type: "heading",
|
|
3813
3817
|
level: y[1].length,
|
|
3814
3818
|
text: y[2].trim()
|
|
3815
|
-
}),
|
|
3819
|
+
}), c++;
|
|
3816
3820
|
continue;
|
|
3817
3821
|
}
|
|
3818
3822
|
const m = p.match(/^!\[([^\]]*)\]\(([^)\s]+)\)\s*$/);
|
|
@@ -3821,33 +3825,33 @@ function mu(e) {
|
|
|
3821
3825
|
type: "image",
|
|
3822
3826
|
url: m[2],
|
|
3823
3827
|
...m[1] ? { alt: m[1] } : {}
|
|
3824
|
-
}),
|
|
3828
|
+
}), c++;
|
|
3825
3829
|
continue;
|
|
3826
3830
|
}
|
|
3827
3831
|
if (/^\s*[-*]\s+/.test(p)) {
|
|
3828
|
-
|
|
3832
|
+
u(), l(), i("bulleted", p.replace(/^\s*[-*]\s+/, "")), c++;
|
|
3829
3833
|
continue;
|
|
3830
3834
|
}
|
|
3831
3835
|
if (/^\s*\d+\.\s+/.test(p)) {
|
|
3832
|
-
|
|
3836
|
+
u(), l(), i("numbered", p.replace(/^\s*\d+\.\s+/, "")), c++;
|
|
3833
3837
|
continue;
|
|
3834
3838
|
}
|
|
3835
3839
|
if (/^\s*(-{3,}|\*{3,}|_{3,})\s*$/.test(p)) {
|
|
3836
|
-
d(), n.push({ type: "divider" }),
|
|
3840
|
+
d(), n.push({ type: "divider" }), c++;
|
|
3837
3841
|
continue;
|
|
3838
3842
|
}
|
|
3839
3843
|
if (/^>\s?/.test(p)) {
|
|
3840
|
-
|
|
3844
|
+
u(), o(), a.push(p.replace(/^>\s?/, "")), c++;
|
|
3841
3845
|
continue;
|
|
3842
3846
|
}
|
|
3843
3847
|
if (p.trim() === "") {
|
|
3844
|
-
d(),
|
|
3848
|
+
d(), c++;
|
|
3845
3849
|
continue;
|
|
3846
3850
|
}
|
|
3847
|
-
|
|
3848
|
-
const
|
|
3849
|
-
s.push(p.replace(dt, "").trim() + (
|
|
3850
|
-
` : " ")),
|
|
3851
|
+
l(), o();
|
|
3852
|
+
const E = dt.test(p);
|
|
3853
|
+
s.push(p.replace(dt, "").trim() + (E ? `
|
|
3854
|
+
` : " ")), c++;
|
|
3851
3855
|
}
|
|
3852
3856
|
return d(), n;
|
|
3853
3857
|
}
|
|
@@ -3857,21 +3861,21 @@ function hu(e, t) {
|
|
|
3857
3861
|
`).trim();
|
|
3858
3862
|
}
|
|
3859
3863
|
const gu = "documents.describe", yu = "documents.inspect", bu = "documents.apply";
|
|
3860
|
-
function
|
|
3864
|
+
function _u(e) {
|
|
3861
3865
|
const t = e.indexOf(":");
|
|
3862
3866
|
if (t !== -1) return e.slice(0, t);
|
|
3863
3867
|
const n = e.indexOf(".");
|
|
3864
3868
|
return n === -1 ? e : e.slice(0, n);
|
|
3865
3869
|
}
|
|
3866
|
-
const
|
|
3867
|
-
function
|
|
3870
|
+
const Au = "installation-id";
|
|
3871
|
+
function Su(e) {
|
|
3868
3872
|
const t = [];
|
|
3869
3873
|
for (const n of Object.keys(e))
|
|
3870
3874
|
for (const r of Object.keys(e[n]))
|
|
3871
3875
|
t.push({ lang: n, key: r, value: e[n][r] });
|
|
3872
3876
|
return t;
|
|
3873
3877
|
}
|
|
3874
|
-
const
|
|
3878
|
+
const Eu = "notification-source", Iu = (e, t) => `${e}.pref.${t}`, Tu = {
|
|
3875
3879
|
ai: [
|
|
3876
3880
|
"account.read",
|
|
3877
3881
|
"account.write",
|
|
@@ -4051,8 +4055,8 @@ function hi(e, t) {
|
|
|
4051
4055
|
const n = e.split("/").filter(Boolean), r = t.split("/").filter(Boolean), o = {};
|
|
4052
4056
|
return n.forEach((i, s) => {
|
|
4053
4057
|
if (i.startsWith(":")) {
|
|
4054
|
-
const a = i.endsWith("?") ? i.slice(1, -1) : i.slice(1),
|
|
4055
|
-
|
|
4058
|
+
const a = i.endsWith("?") ? i.slice(1, -1) : i.slice(1), u = r[s];
|
|
4059
|
+
u && (o[a] = u);
|
|
4056
4060
|
}
|
|
4057
4061
|
}), o;
|
|
4058
4062
|
}
|
|
@@ -4095,7 +4099,7 @@ function bi(e, t) {
|
|
|
4095
4099
|
function Uu(e, t) {
|
|
4096
4100
|
return bi(e, t) !== null;
|
|
4097
4101
|
}
|
|
4098
|
-
const Fu = 10 * 1024 * 1024, Bu = 25 * 1024 * 1024, ju = "sync-target", Hu = 20,
|
|
4102
|
+
const Fu = 10 * 1024 * 1024, Bu = 25 * 1024 * 1024, ju = "sync-target", Hu = 20, _i = {
|
|
4099
4103
|
afrikaans: [
|
|
4100
4104
|
"[Muziek]",
|
|
4101
4105
|
"(C) TV GELDERLAND 2021",
|
|
@@ -4245,14 +4249,14 @@ const Fu = 10 * 1024 * 1024, Bu = 25 * 1024 * 1024, ju = "sync-target", Hu = 20,
|
|
|
4245
4249
|
"[MÚSICA]",
|
|
4246
4250
|
"[Music cuts in British]"
|
|
4247
4251
|
]
|
|
4248
|
-
},
|
|
4252
|
+
}, Ai = (e) => {
|
|
4249
4253
|
let t = e;
|
|
4250
|
-
return Object.values(
|
|
4254
|
+
return Object.values(_i).forEach((n) => {
|
|
4251
4255
|
n.forEach((r) => {
|
|
4252
4256
|
t = t.replaceAll(r, "");
|
|
4253
4257
|
});
|
|
4254
4258
|
}), t = t.replace(/\(.*?\)/g, ""), t = t.replace(/\[.*?\]/g, ""), t;
|
|
4255
|
-
},
|
|
4259
|
+
}, Si = 6e4, Ei = 8e3, Ii = 2, Ti = 0.4, wi = 3, ki = /* @__PURE__ */ new Set([
|
|
4256
4260
|
"aan",
|
|
4257
4261
|
"als",
|
|
4258
4262
|
"ben",
|
|
@@ -4379,11 +4383,11 @@ function vi(e, t) {
|
|
|
4379
4383
|
for (const i of r) n.has(i) || (o += 1);
|
|
4380
4384
|
return o / r.size;
|
|
4381
4385
|
}
|
|
4382
|
-
function Ci(e, t =
|
|
4386
|
+
function Ci(e, t = Si) {
|
|
4383
4387
|
const n = e.filter((s) => !s.partial && typeof s.text == "string");
|
|
4384
4388
|
if (!n.length) return { text: "", segmentCount: 0 };
|
|
4385
4389
|
const o = n.reduce((s, a) => Math.max(s, a.endedAt ?? 0), 0) - t;
|
|
4386
|
-
return { text: n.filter((s) => (s.endedAt ?? 0) >= o).map((s) =>
|
|
4390
|
+
return { text: n.filter((s) => (s.endedAt ?? 0) >= o).map((s) => Ai(s.text).trim()).filter(Boolean).join(" ").replace(/\s+/g, " ").trim(), segmentCount: n.length };
|
|
4387
4391
|
}
|
|
4388
4392
|
const Oi = 60;
|
|
4389
4393
|
function Gu(e, t, n = Oi) {
|
|
@@ -4394,7 +4398,7 @@ function Gu(e, t, n = Oi) {
|
|
|
4394
4398
|
}
|
|
4395
4399
|
function Wu(e) {
|
|
4396
4400
|
const { segments: t, now: n, state: r } = e;
|
|
4397
|
-
if (r.lastTriggerAt && n - r.lastTriggerAt <
|
|
4401
|
+
if (r.lastTriggerAt && n - r.lastTriggerAt < Ei)
|
|
4398
4402
|
return { trigger: !1, reason: "too_soon" };
|
|
4399
4403
|
const o = Ci(t, e.windowMs);
|
|
4400
4404
|
if (!o.text) return { trigger: !1, reason: "no_speech" };
|
|
@@ -4664,13 +4668,13 @@ function es(e) {
|
|
|
4664
4668
|
const t = [];
|
|
4665
4669
|
for (const s of e.matchAll(zi)) {
|
|
4666
4670
|
const a = [];
|
|
4667
|
-
for (const
|
|
4668
|
-
const
|
|
4669
|
-
if (Yi(
|
|
4670
|
-
a.push({ text:
|
|
4671
|
+
for (const u of s[1].matchAll(Xi)) {
|
|
4672
|
+
const l = Ji(u[3]);
|
|
4673
|
+
if (Yi(u[3], l)) return null;
|
|
4674
|
+
a.push({ text: l, align: Zi(u[2]) });
|
|
4671
4675
|
}
|
|
4672
4676
|
if (a.length === 0) return null;
|
|
4673
|
-
a.some((
|
|
4677
|
+
a.some((u) => u.text !== "") && t.push(a);
|
|
4674
4678
|
}
|
|
4675
4679
|
const n = t[0]?.length ?? 0;
|
|
4676
4680
|
if (t.length < 2 || n < 2 || t.some((s) => s.length !== n)) return null;
|
|
@@ -4710,7 +4714,7 @@ function bt(e, t) {
|
|
|
4710
4714
|
`), n = n.replace(/<\/(div|li|tr)>/gi, `
|
|
4711
4715
|
`), n = n.replace(/<\/(td|th)>/gi, " "), n = n.replace(/<[^>]+>/g, ""), n = n.replace(/<[^>]*$/, ""), n;
|
|
4712
4716
|
}
|
|
4713
|
-
function
|
|
4717
|
+
function _t(e) {
|
|
4714
4718
|
return !Number.isInteger(e) || e < 0 || e > 1114111 ? null : String.fromCodePoint(e);
|
|
4715
4719
|
}
|
|
4716
4720
|
const rs = {
|
|
@@ -4735,10 +4739,10 @@ const rs = {
|
|
|
4735
4739
|
rdquo: "”",
|
|
4736
4740
|
apos: "'"
|
|
4737
4741
|
};
|
|
4738
|
-
function
|
|
4739
|
-
return e.replace(/ /gi, " ").replace(/&([a-z]+);/gi, (t, n) => rs[n.toLowerCase()] ?? t).replace(/</gi, "<").replace(/>/gi, ">").replace(/"/gi, '"').replace(/&#(\d+);/g, (t, n) =>
|
|
4742
|
+
function At(e) {
|
|
4743
|
+
return e.replace(/ /gi, " ").replace(/&([a-z]+);/gi, (t, n) => rs[n.toLowerCase()] ?? t).replace(/</gi, "<").replace(/>/gi, ">").replace(/"/gi, '"').replace(/&#(\d+);/g, (t, n) => _t(Number(n)) ?? t).replace(/&#x([0-9a-f]+);/gi, (t, n) => _t(parseInt(n, 16)) ?? t).replace(/&/gi, "&");
|
|
4740
4744
|
}
|
|
4741
|
-
function
|
|
4745
|
+
function St(e) {
|
|
4742
4746
|
return e.replace(/\r/g, "").replace(/[ \t]+/g, " ").replace(/ *\n */g, `
|
|
4743
4747
|
`).replace(/\n{3,}/g, `
|
|
4744
4748
|
|
|
@@ -4762,8 +4766,8 @@ function rn(e, t) {
|
|
|
4762
4766
|
a >= 0 && a < n && (n = a);
|
|
4763
4767
|
}
|
|
4764
4768
|
const r = e.slice(0, n);
|
|
4765
|
-
let o =
|
|
4766
|
-
return o || (o =
|
|
4769
|
+
let o = St(At(bt(r, t)));
|
|
4770
|
+
return o || (o = St(At(bt(e, t)))), Bi(o) || o;
|
|
4767
4771
|
}
|
|
4768
4772
|
export {
|
|
4769
4773
|
zs as ACTIVE_ASSIGNMENT_STATUSES,
|
|
@@ -4791,19 +4795,19 @@ export {
|
|
|
4791
4795
|
io as AUTO_READY_MIN_PROPOSALS,
|
|
4792
4796
|
so as AUTO_READY_RATE,
|
|
4793
4797
|
hn as ActivityTypeRegistry,
|
|
4794
|
-
|
|
4798
|
+
Es as BUILT_IN_ONLY,
|
|
4795
4799
|
sr as BULK_PENALTY,
|
|
4796
|
-
|
|
4800
|
+
Ei as CADENCE_FLOOR_MS,
|
|
4797
4801
|
Ii as CADENCE_MIN_NEW_SEGMENTS,
|
|
4798
4802
|
Ti as CADENCE_MIN_NOVELTY,
|
|
4799
|
-
|
|
4803
|
+
Si as CADENCE_WINDOW_MS,
|
|
4800
4804
|
mc as CLASSIFY_VARS,
|
|
4801
4805
|
uu as CONNECTOR_PROVIDER_GROUP,
|
|
4802
4806
|
du as CONTEXT_COLLECT_SERVICE,
|
|
4803
4807
|
Ds as CORE_DIMENSIONS,
|
|
4804
4808
|
ii as CommunicationScheme,
|
|
4805
4809
|
qn as DAY_MS,
|
|
4806
|
-
|
|
4810
|
+
Eo as DEFAULT_CHECK_IN_DAYS,
|
|
4807
4811
|
Kr as DEFAULT_FORECAST_WEEKS,
|
|
4808
4812
|
Ka as DEFAULT_MEMORY_BUDGET,
|
|
4809
4813
|
xi as DEFAULT_PHONE_REGION,
|
|
@@ -4838,7 +4842,7 @@ export {
|
|
|
4838
4842
|
Yn as HOUR_MS,
|
|
4839
4843
|
os as HTML_BODY_RE,
|
|
4840
4844
|
L as INELIGIBLE,
|
|
4841
|
-
|
|
4845
|
+
Au as INSTALLATION_HEADER,
|
|
4842
4846
|
eo as INTERACTION_KIND,
|
|
4843
4847
|
ou as InteractionParticipantRole,
|
|
4844
4848
|
gr as KB_FALLBACK_LOCALE,
|
|
@@ -4864,11 +4868,11 @@ export {
|
|
|
4864
4868
|
La as MIN_MEMORY_BUDGET,
|
|
4865
4869
|
zu as NAV_NOTICE_SLOT,
|
|
4866
4870
|
Fa as NL_TAX_RATES,
|
|
4867
|
-
|
|
4871
|
+
Eu as NOTIFICATION_SOURCE_PROVIDER_GROUP,
|
|
4868
4872
|
ko as OFF_TRACK_GAP,
|
|
4869
4873
|
ja as ONBOARDING_SOURCE_PROVIDER_GROUP,
|
|
4870
|
-
|
|
4871
|
-
|
|
4874
|
+
Se as PAUSE_SNOOZED,
|
|
4875
|
+
Ee as PAUSE_WAITING_FOR_CUSTOMER,
|
|
4872
4876
|
De as PHONE_REGIONS,
|
|
4873
4877
|
Zt as PRESENCE_ONLINE_WINDOW_MS,
|
|
4874
4878
|
pi as PRESENCE_SURVIVES_OFFLINE,
|
|
@@ -4878,9 +4882,9 @@ export {
|
|
|
4878
4882
|
nu as PROVIDER_FEATURE_MESSAGE_WINDOW,
|
|
4879
4883
|
Ki as PUBLIC_EMAIL_DOMAINS,
|
|
4880
4884
|
Je as READ_STEP_TYPES,
|
|
4881
|
-
|
|
4885
|
+
_r as RELATED_SUBJECT_KINDS,
|
|
4882
4886
|
qt as RESERVED_STATUS_KEYS,
|
|
4883
|
-
|
|
4887
|
+
_l as RESERVED_TYPE_KEYS,
|
|
4884
4888
|
Nu as RESOURCE_ATTACHED_SERVICE,
|
|
4885
4889
|
Cu as RESOURCE_DESCRIBE_SERVICE,
|
|
4886
4890
|
xu as RESOURCE_RESOLVE_SERVICE,
|
|
@@ -4895,7 +4899,7 @@ export {
|
|
|
4895
4899
|
Cc as SLA_PAUSE_REASONS,
|
|
4896
4900
|
ro as STEP_MAX_TOKENS_MAX,
|
|
4897
4901
|
no as STEP_MAX_TOKENS_MIN,
|
|
4898
|
-
|
|
4902
|
+
Ao as STRATEGY_ITEM_SCOPE_KIND,
|
|
4899
4903
|
er as SUMMARY_MIN_LAST_CHARS,
|
|
4900
4904
|
Jn as SUMMARY_MIN_MESSAGES,
|
|
4901
4905
|
Hu as SYNC_RUN_MAX_ERRORS,
|
|
@@ -4905,11 +4909,11 @@ export {
|
|
|
4905
4909
|
Xt as TRANSACTION_KINDS,
|
|
4906
4910
|
Uo as TRANSACTION_SCOPE_KINDS,
|
|
4907
4911
|
fc as TRIGGER_VARS,
|
|
4908
|
-
|
|
4909
|
-
|
|
4912
|
+
Er as UNKNOWN_KIND,
|
|
4913
|
+
So as UNKNOWN_LEVEL_ORDER,
|
|
4910
4914
|
lu as UNSUPPORTED,
|
|
4911
|
-
|
|
4912
|
-
|
|
4915
|
+
Sn as USAGE_DIMENSIONS,
|
|
4916
|
+
En as USAGE_DIMENSION_IDS,
|
|
4913
4917
|
Wr as WORKSTREAM_SCOPE_KIND,
|
|
4914
4918
|
Go as WORK_ACTIVITY_SCOPE_KIND,
|
|
4915
4919
|
Ha as WORK_AREAS,
|
|
@@ -4924,10 +4928,10 @@ export {
|
|
|
4924
4928
|
Yr as actingIdentityKey,
|
|
4925
4929
|
tl as activeWorkTypes,
|
|
4926
4930
|
us as activityIconOf,
|
|
4927
|
-
|
|
4931
|
+
As as activityJoinUrl,
|
|
4928
4932
|
dn as activitySnippet,
|
|
4929
4933
|
pn as activityTextParams,
|
|
4930
|
-
|
|
4934
|
+
_s as activityTimelineText,
|
|
4931
4935
|
gn as activityTimestamp,
|
|
4932
4936
|
w as activityTypeInfo,
|
|
4933
4937
|
ac as actorKey,
|
|
@@ -4958,7 +4962,7 @@ export {
|
|
|
4958
4962
|
Zs as assignmentSubject,
|
|
4959
4963
|
Xa as availabilityByPerson,
|
|
4960
4964
|
Wa as belongsOnCalendar,
|
|
4961
|
-
|
|
4965
|
+
Ss as buildActivityPreview,
|
|
4962
4966
|
Ql as buildChannelIntents,
|
|
4963
4967
|
Gs as buildShareKeys,
|
|
4964
4968
|
Ci as buildWindow,
|
|
@@ -5001,7 +5005,7 @@ export {
|
|
|
5001
5005
|
Ps as describeClause,
|
|
5002
5006
|
ql as disabledIntentsFromCapabilities,
|
|
5003
5007
|
js as documentBodyBytes,
|
|
5004
|
-
|
|
5008
|
+
_u as documentKindOf,
|
|
5005
5009
|
Hs as documentOutline,
|
|
5006
5010
|
Dn as documentToMarkdown,
|
|
5007
5011
|
hu as documentToText,
|
|
@@ -5020,9 +5024,9 @@ export {
|
|
|
5020
5024
|
Ls as filterableDimensions,
|
|
5021
5025
|
te as findAiVendor,
|
|
5022
5026
|
Uc as fixedLevelForName,
|
|
5023
|
-
|
|
5027
|
+
El as fixedTypeForName,
|
|
5024
5028
|
Il as fixedTypes,
|
|
5025
|
-
|
|
5029
|
+
Su as flattenLocales,
|
|
5026
5030
|
H as floorToPeriod,
|
|
5027
5031
|
ec as forecastIntervals,
|
|
5028
5032
|
Xr as formatActingIdentity,
|
|
@@ -5036,7 +5040,7 @@ export {
|
|
|
5036
5040
|
Is as getActivitySeenUserIds,
|
|
5037
5041
|
aa as getContactEndpoints,
|
|
5038
5042
|
Ia as getShortTitle,
|
|
5039
|
-
|
|
5043
|
+
Ea as getUrgencyScore,
|
|
5040
5044
|
wc as hasReacted,
|
|
5041
5045
|
Fc as healthCategory,
|
|
5042
5046
|
Bc as healthsInCategory,
|
|
@@ -5045,13 +5049,13 @@ export {
|
|
|
5045
5049
|
pc as humanizeAction,
|
|
5046
5050
|
to as interactionIdOf,
|
|
5047
5051
|
ml as isAgentUser,
|
|
5048
|
-
|
|
5052
|
+
Aa as isAssigned,
|
|
5049
5053
|
Xs as isAssignmentTerminal,
|
|
5050
5054
|
Zr as isAssignmentTrigger,
|
|
5051
|
-
|
|
5055
|
+
_c as isAutoReady,
|
|
5052
5056
|
fr as isAwaitingThem,
|
|
5053
5057
|
ws as isChatMessageActivity,
|
|
5054
|
-
|
|
5058
|
+
Sa as isClosed,
|
|
5055
5059
|
ys as isConnectedType,
|
|
5056
5060
|
Lu as isDeepLink,
|
|
5057
5061
|
hr as isDescendant,
|
|
@@ -5059,15 +5063,15 @@ export {
|
|
|
5059
5063
|
Ts as isEmailActivity,
|
|
5060
5064
|
il as isFrozen,
|
|
5061
5065
|
ed as isHtmlBody,
|
|
5062
|
-
|
|
5066
|
+
Sc as isInFlight,
|
|
5063
5067
|
or as isInteractionUnseen,
|
|
5064
5068
|
Pu as isLandingPath,
|
|
5065
5069
|
Zn as isLikelyBulk,
|
|
5066
|
-
|
|
5070
|
+
Et as isMessageShape,
|
|
5067
5071
|
ps as isMessageType,
|
|
5068
5072
|
yi as isMoreSpecificPattern,
|
|
5069
5073
|
It as isNoteShape,
|
|
5070
|
-
|
|
5074
|
+
_o as isOpenClock,
|
|
5071
5075
|
Bl as isOutwardTool,
|
|
5072
5076
|
ur as isParked,
|
|
5073
5077
|
co as isPaused,
|
|
@@ -5077,7 +5081,7 @@ export {
|
|
|
5077
5081
|
dr as isReminderActive,
|
|
5078
5082
|
ms as isReplyableType,
|
|
5079
5083
|
ba as isSlaAtRisk,
|
|
5080
|
-
|
|
5084
|
+
Ac as isTerminal,
|
|
5081
5085
|
ma as isThreadLongEnough,
|
|
5082
5086
|
bs as isTranscriptType,
|
|
5083
5087
|
Rl as isWorkClosed,
|
|
@@ -5087,7 +5091,7 @@ export {
|
|
|
5087
5091
|
Vo as ladderFor,
|
|
5088
5092
|
Io as levelIn,
|
|
5089
5093
|
Te as levelOrder,
|
|
5090
|
-
|
|
5094
|
+
Sr as lineNet,
|
|
5091
5095
|
Ta as linkLabel,
|
|
5092
5096
|
Rs as listeningAllowed,
|
|
5093
5097
|
Ma as localeInstruction,
|
|
@@ -5173,9 +5177,9 @@ export {
|
|
|
5173
5177
|
sc as runActor,
|
|
5174
5178
|
Ic as runInteractionId,
|
|
5175
5179
|
On as sanitizeInline,
|
|
5176
|
-
|
|
5180
|
+
Ai as sanitizeTranscript,
|
|
5177
5181
|
tc as scheduleEntryScopeKey,
|
|
5178
|
-
|
|
5182
|
+
_a as scoreInteraction,
|
|
5179
5183
|
bl as scoreWorkItem,
|
|
5180
5184
|
xa as selectLenses,
|
|
5181
5185
|
Cr as serviceLevel,
|
|
@@ -5198,7 +5202,7 @@ export {
|
|
|
5198
5202
|
$c as strategyDossierKeys,
|
|
5199
5203
|
zt as strategyItemScopeKey,
|
|
5200
5204
|
ln as stripHtml,
|
|
5201
|
-
|
|
5205
|
+
Ec as subjectKeyOf,
|
|
5202
5206
|
Bt as subjectOf,
|
|
5203
5207
|
Wl as subjectRef,
|
|
5204
5208
|
vl as suggestProjectKey,
|
|
@@ -5207,7 +5211,7 @@ export {
|
|
|
5207
5211
|
uc as targetById,
|
|
5208
5212
|
lc as targetForActivityType,
|
|
5209
5213
|
Xc as targetOrder,
|
|
5210
|
-
|
|
5214
|
+
Ar as taxRateFor,
|
|
5211
5215
|
wr as termsFor,
|
|
5212
5216
|
qr as toActingIdentity,
|
|
5213
5217
|
ht as toE164,
|
|
@@ -5222,8 +5226,8 @@ export {
|
|
|
5222
5226
|
ll as transactionSlots,
|
|
5223
5227
|
Ba as transactionTotals,
|
|
5224
5228
|
xo as truncateExample,
|
|
5225
|
-
|
|
5226
|
-
|
|
5229
|
+
Sl as typeIn,
|
|
5230
|
+
Al as typesFor,
|
|
5227
5231
|
Dl as uniqueWorkStatusKey,
|
|
5228
5232
|
Jc as uniqueWorkTypeKey,
|
|
5229
5233
|
In as usageMetricId,
|
|
@@ -5238,6 +5242,6 @@ export {
|
|
|
5238
5242
|
Wc as workRatio,
|
|
5239
5243
|
Yo as workStatusKey,
|
|
5240
5244
|
Mo as workTypeKey,
|
|
5241
|
-
|
|
5245
|
+
Ae as workingMsBetween,
|
|
5242
5246
|
nc as workstreamScopeKey
|
|
5243
5247
|
};
|