@engenty/wizards 0.9.6 → 0.10.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/openui/index.d.ts +2324 -2317
- package/dist/openui/index.js +817 -779
- package/dist/openui/index.js.map +1 -1
- package/dist/plugin/index.d.ts +2 -2
- package/dist/plugin/studio.d.ts +1 -1
- package/package.json +1 -1
package/dist/openui/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WIZARD_COMPONENT as e, WIZARD_DESCRIPTION as t, WizardSpec as n, addWizard as r, loadWizards as i, wizardProps as a, wizardRules as o } from "./server.js";
|
|
2
|
-
import { ArrowDown as s, ArrowLeft as c, ArrowRight as l, ArrowUp as u, Bell as d, BellRing as f, Braces as p, Camera as m, Check as h, ChevronRight as g, Clock as _, Copy as v, CornerDownLeft as y, Database as b, Download as x, Eraser as S, ExternalLink as C, FileAudio as w, FileText as T, Film as ee, Flashlight as te, FlashlightOff as ne, GripVertical as re, ImagePlus as E, ImageUp as
|
|
2
|
+
import { ArrowDown as s, ArrowLeft as c, ArrowRight as l, ArrowUp as u, Bell as d, BellRing as f, Braces as p, Camera as m, Check as h, ChevronRight as g, Clock as _, Copy as v, CornerDownLeft as y, Database as b, Download as x, Eraser as S, ExternalLink as C, FileAudio as w, FileText as T, Film as ee, Flashlight as te, FlashlightOff as ne, GripVertical as re, ImagePlus as E, ImageUp as D, Languages as O, Lightbulb as k, Link2 as ie, LocateFixed as ae, LockKeyhole as oe, MapPin as se, Maximize2 as ce, Mic as le, MoreVertical as ue, MousePointerClick as de, Paperclip as fe, PenLine as pe, Pencil as me, PencilLine as he, Plus as ge, Printer as _e, RefreshCw as ve, RotateCcw as ye, ScanLine as be, Share as xe, Share2 as Se, ShieldCheck as Ce, Sparkles as we, Square as Te, SwitchCamera as Ee, Trash2 as De, TriangleAlert as Oe, Unplug as ke, Video as Ae, X as je } from "lucide-react";
|
|
3
3
|
import { forwardRef as Me, useCallback as Ne, useEffect as A, useId as Pe, useLayoutEffect as Fe, useMemo as Ie, useRef as j, useState as M, useSyncExternalStore as Le } from "react";
|
|
4
4
|
import { z as N } from "zod";
|
|
5
5
|
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
@@ -593,9 +593,9 @@ var tn = [
|
|
|
593
593
|
"code"
|
|
594
594
|
], nn = /^[a-z][a-z0-9-]{0,39}$/, rn = /^[a-z][a-z0-9_]{0,39}$/, an = [
|
|
595
595
|
"classifier",
|
|
596
|
+
"low",
|
|
596
597
|
"standard",
|
|
597
|
-
"high"
|
|
598
|
-
"highest"
|
|
598
|
+
"high"
|
|
599
599
|
];
|
|
600
600
|
[...an];
|
|
601
601
|
var on = [
|
|
@@ -894,9 +894,34 @@ var In = N.object({
|
|
|
894
894
|
policy: N.record(N.string(), N.enum(["allow", "ask"])).optional(),
|
|
895
895
|
title: N.string().optional(),
|
|
896
896
|
description: N.string().optional()
|
|
897
|
-
})
|
|
898
|
-
|
|
899
|
-
|
|
897
|
+
}), Rn = {
|
|
898
|
+
standard: "low",
|
|
899
|
+
high: "standard",
|
|
900
|
+
highest: "high"
|
|
901
|
+
};
|
|
902
|
+
function zn(e, t = 1) {
|
|
903
|
+
if (!e || typeof e != "object" || Array.isArray(e)) return e;
|
|
904
|
+
let n = e, r = n.version ?? t;
|
|
905
|
+
if (r === 2) return n.version === void 0 ? {
|
|
906
|
+
...n,
|
|
907
|
+
version: r
|
|
908
|
+
} : n;
|
|
909
|
+
if (r !== 1) return e;
|
|
910
|
+
let i = Array.isArray(n.steps) ? n.steps.map((e) => {
|
|
911
|
+
let t = e?.model;
|
|
912
|
+
return typeof t == "string" && Rn[t] ? {
|
|
913
|
+
...e,
|
|
914
|
+
model: Rn[t]
|
|
915
|
+
} : e;
|
|
916
|
+
}) : n.steps;
|
|
917
|
+
return {
|
|
918
|
+
...n,
|
|
919
|
+
version: 2,
|
|
920
|
+
steps: i
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
var Bn = N.object({
|
|
924
|
+
version: N.literal(2).default(2),
|
|
900
925
|
title: N.string().min(1),
|
|
901
926
|
description: N.string().default(""),
|
|
902
927
|
avatar: N.enum(Gt).default("round"),
|
|
@@ -908,17 +933,18 @@ N.object({
|
|
|
908
933
|
themes: N.array(N.string().regex(qt)).max(8).optional(),
|
|
909
934
|
steps: N.array(Nn).min(1)
|
|
910
935
|
});
|
|
911
|
-
|
|
936
|
+
N.preprocess((e) => zn(e), Bn);
|
|
937
|
+
function Vn(e) {
|
|
912
938
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
913
939
|
}
|
|
914
|
-
function
|
|
940
|
+
function Hn(e) {
|
|
915
941
|
return e === void 0 ? [] : Array.isArray(e) ? e : [e];
|
|
916
942
|
}
|
|
917
|
-
function
|
|
943
|
+
function Un(e, t) {
|
|
918
944
|
let n = t[e.field];
|
|
919
945
|
switch (e.op) {
|
|
920
|
-
case "empty": return
|
|
921
|
-
case "notEmpty": return !
|
|
946
|
+
case "empty": return Vn(n);
|
|
947
|
+
case "notEmpty": return !Vn(n);
|
|
922
948
|
case "equals": return String(n) === String(e.value);
|
|
923
949
|
case "notEquals": return String(n) !== String(e.value);
|
|
924
950
|
case "in": return Array.isArray(e.value) && e.value.map(String).includes(String(n));
|
|
@@ -930,23 +956,23 @@ function Bn(e, t) {
|
|
|
930
956
|
case "contains": return Array.isArray(n) ? n.map(String).includes(String(e.value)) : typeof n == "string" && e.value !== void 0 && n.toLowerCase().includes(String(e.value).toLowerCase());
|
|
931
957
|
}
|
|
932
958
|
}
|
|
933
|
-
function
|
|
934
|
-
return
|
|
959
|
+
function Wn(e, t) {
|
|
960
|
+
return Hn(e).every((e) => Un(e, t));
|
|
935
961
|
}
|
|
936
|
-
function
|
|
962
|
+
function Gn(e) {
|
|
937
963
|
return !!(e.ask || e.group);
|
|
938
964
|
}
|
|
939
|
-
function
|
|
965
|
+
function Kn(e, t, n) {
|
|
940
966
|
let r = {
|
|
941
967
|
...t,
|
|
942
968
|
...n
|
|
943
969
|
}, i = [];
|
|
944
|
-
for (let t of e)
|
|
970
|
+
for (let t of e) Wn(t.when, r) ? i.push(t) : delete r[t.id];
|
|
945
971
|
return i;
|
|
946
972
|
}
|
|
947
|
-
var
|
|
948
|
-
function
|
|
949
|
-
let t =
|
|
973
|
+
var qn = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/;
|
|
974
|
+
function Jn(e) {
|
|
975
|
+
let t = qn.exec(e.trim());
|
|
950
976
|
if (!t) return null;
|
|
951
977
|
let [, n, r, i, a, o] = t.map(Number), s = new Date(Date.UTC(n, r - 1, i, a, o));
|
|
952
978
|
return s.getUTCMonth() !== r - 1 || s.getUTCDate() !== i || a > 23 || o > 59 || !Number.isFinite(Date.parse(e)) ? null : {
|
|
@@ -955,8 +981,8 @@ function Gn(e) {
|
|
|
955
981
|
wall: s
|
|
956
982
|
};
|
|
957
983
|
}
|
|
958
|
-
function
|
|
959
|
-
let n =
|
|
984
|
+
function Yn(e, t = "en") {
|
|
985
|
+
let n = Jn(e);
|
|
960
986
|
if (!n) return e;
|
|
961
987
|
let r = Zt(t);
|
|
962
988
|
return `${n.wall.toLocaleDateString(r, {
|
|
@@ -968,63 +994,63 @@ function Kn(e, t = "en") {
|
|
|
968
994
|
timeZone: "UTC"
|
|
969
995
|
})}`;
|
|
970
996
|
}
|
|
971
|
-
function
|
|
997
|
+
function Xn(e, t, n) {
|
|
972
998
|
let r = Array.isArray(t) ? t : [], i = (e.columns ?? []).filter((e) => e.kind !== "text"), a = r.map((e) => {
|
|
973
|
-
let t = i.length ? i.reduce((t, n) => t *
|
|
999
|
+
let t = i.length ? i.reduce((t, n) => t * Zn(e[n.id]), 1) : 0;
|
|
974
1000
|
return {
|
|
975
1001
|
...e,
|
|
976
|
-
amount:
|
|
1002
|
+
amount: Qn(t)
|
|
977
1003
|
};
|
|
978
|
-
}), o =
|
|
1004
|
+
}), o = Qn(a.reduce((e, t) => e + t.amount, 0)), s = e.vat?.rate ?? 0;
|
|
979
1005
|
if (e.vat?.field) {
|
|
980
1006
|
let t = n[e.vat.field], r = yt(t, { units: !0 });
|
|
981
1007
|
r !== null && (s = r);
|
|
982
1008
|
}
|
|
983
|
-
let c =
|
|
1009
|
+
let c = Qn(o * s / 100);
|
|
984
1010
|
return {
|
|
985
1011
|
rows: a,
|
|
986
1012
|
net: o,
|
|
987
1013
|
vatRate: s,
|
|
988
1014
|
vat: c,
|
|
989
|
-
gross:
|
|
1015
|
+
gross: Qn(o + c),
|
|
990
1016
|
currency: e.currency ?? "EUR"
|
|
991
1017
|
};
|
|
992
1018
|
}
|
|
993
|
-
function
|
|
1019
|
+
function Zn(e) {
|
|
994
1020
|
return yt(e) ?? 0;
|
|
995
1021
|
}
|
|
996
|
-
function
|
|
1022
|
+
function Qn(e) {
|
|
997
1023
|
return Math.round(e * 100) / 100;
|
|
998
1024
|
}
|
|
999
1025
|
//#endregion
|
|
1000
1026
|
//#region ../shared/src/texts.ts
|
|
1001
|
-
var
|
|
1002
|
-
function
|
|
1003
|
-
let t =
|
|
1004
|
-
return t || (t = new Intl.PluralRules(Zt(e)),
|
|
1027
|
+
var $n = /* @__PURE__ */ new Map();
|
|
1028
|
+
function er(e) {
|
|
1029
|
+
let t = $n.get(e);
|
|
1030
|
+
return t || (t = new Intl.PluralRules(Zt(e)), $n.set(e, t)), t;
|
|
1005
1031
|
}
|
|
1006
|
-
function
|
|
1007
|
-
return typeof e == "string" ? e : typeof n == "number" ? e[
|
|
1032
|
+
function tr(e, t, n) {
|
|
1033
|
+
return typeof e == "string" ? e : typeof n == "number" ? e[er(t).select(n)] ?? e.other : e.other;
|
|
1008
1034
|
}
|
|
1009
|
-
function
|
|
1010
|
-
return typeof e == "number" ? e.toLocaleString(Zt(t)) : Array.isArray(e) ? e.map((e) =>
|
|
1035
|
+
function nr(e, t) {
|
|
1036
|
+
return typeof e == "number" ? e.toLocaleString(Zt(t)) : Array.isArray(e) ? e.map((e) => nr(e, t)).join(", ") : e;
|
|
1011
1037
|
}
|
|
1012
|
-
function
|
|
1038
|
+
function rr(e, t, n) {
|
|
1013
1039
|
return e.replace(/\{(\w+)\}/g, (e, r) => {
|
|
1014
1040
|
let i = n?.[r];
|
|
1015
|
-
return i === void 0 ? e :
|
|
1041
|
+
return i === void 0 ? e : nr(i, t);
|
|
1016
1042
|
});
|
|
1017
1043
|
}
|
|
1018
|
-
function
|
|
1044
|
+
function ir(e, t, n, r) {
|
|
1019
1045
|
let i = e[n][t] ?? e.en[t];
|
|
1020
|
-
return i === void 0 ? t :
|
|
1046
|
+
return i === void 0 ? t : rr(tr(i, n, r?.count ?? r?.n), n, r);
|
|
1021
1047
|
}
|
|
1022
|
-
function
|
|
1023
|
-
return
|
|
1048
|
+
function ar(e, t, n) {
|
|
1049
|
+
return rr(tr(e, t, n?.count ?? n?.n), t, n);
|
|
1024
1050
|
}
|
|
1025
1051
|
//#endregion
|
|
1026
1052
|
//#region ../shared/src/run.ts
|
|
1027
|
-
var
|
|
1053
|
+
var or = {
|
|
1028
1054
|
entry: "Entry {n} of {total}",
|
|
1029
1055
|
deciding: "Deciding what to do next…",
|
|
1030
1056
|
choosingFields: "Choosing the right questions…",
|
|
@@ -1209,7 +1235,7 @@ var rr = {
|
|
|
1209
1235
|
},
|
|
1210
1236
|
twoEntriesSameKey: "Two entries have the same key.",
|
|
1211
1237
|
pageSlugInvalid: "A page address holds lower-case letters a–z, digits and hyphens.",
|
|
1212
|
-
pageSlugTaken: "Another space of your
|
|
1238
|
+
pageSlugTaken: "Another space of your organization has this address.",
|
|
1213
1239
|
pageTaken: "The page is already at “{space}”.",
|
|
1214
1240
|
notDeleteLastSpace: "You can’t delete the last space.",
|
|
1215
1241
|
notFound: "This doesn’t exist or was deleted.",
|
|
@@ -1261,7 +1287,7 @@ var rr = {
|
|
|
1261
1287
|
pageNeedsTitle: "A page needs a title.",
|
|
1262
1288
|
unknownSpace: "There’s no space “{space}”.",
|
|
1263
1289
|
noParentPage: "There’s no page with the key “{parent}” to put this page under.",
|
|
1264
|
-
|
|
1290
|
+
onlyOrganizationAdmins: "Only organization admins can do that. As a member, you can edit the wizards that already exist.",
|
|
1265
1291
|
spaceEditedLocally: "You edit this space in engenty wizards on your computer, not here.",
|
|
1266
1292
|
wizardsRunOncePublished: "Wizards run here once you publish them in engenty wizards on your computer. You build and edit them there.",
|
|
1267
1293
|
logoImagePngSvg: "A logo is an image (PNG, SVG, JPEG, WebP).",
|
|
@@ -1279,6 +1305,12 @@ var rr = {
|
|
|
1279
1305
|
},
|
|
1280
1306
|
accountSignedOut: "The account is signed out. Sign in again.",
|
|
1281
1307
|
cloudNotReachedRight: "The cloud can’t be reached right now.",
|
|
1308
|
+
syncUpdateHere: "The cloud runs a newer version than this computer. Update engenty wizards, then your changes arrive in the cloud again.",
|
|
1309
|
+
syncUpdateCloud: "This computer runs a newer version than the cloud. Your changes arrive there once the cloud is updated.",
|
|
1310
|
+
syncSpaceNotInCloud: "This space isn’t in the cloud.",
|
|
1311
|
+
syncOtherSpace: "In the cloud this belongs to another space.",
|
|
1312
|
+
syncChangeRefused: "The cloud doesn’t take this change: {detail}",
|
|
1313
|
+
syncFileMissing: "A file of this change hasn’t arrived in the cloud yet. It’s sent again.",
|
|
1282
1314
|
publishWizardFirst: "Publish the wizard first.",
|
|
1283
1315
|
wizardJsonUnreadable: "This isn’t a wizard file: its wizard.json can’t be read.",
|
|
1284
1316
|
wizardFileComesNewer: "This wizard file comes from a newer version, or it’s damaged. Update engenty wizards or export the wizard again.",
|
|
@@ -1332,8 +1364,8 @@ var rr = {
|
|
|
1332
1364
|
makesVideos: "videos",
|
|
1333
1365
|
makesSpeech: "speech",
|
|
1334
1366
|
makesVoiceNotes: "voice notes"
|
|
1335
|
-
},
|
|
1336
|
-
en:
|
|
1367
|
+
}, sr = {
|
|
1368
|
+
en: or,
|
|
1337
1369
|
de: {
|
|
1338
1370
|
entry: "Eintrag {n} von {total}",
|
|
1339
1371
|
deciding: "Entscheidet, wie es weitergeht …",
|
|
@@ -1519,7 +1551,7 @@ var rr = {
|
|
|
1519
1551
|
},
|
|
1520
1552
|
twoEntriesSameKey: "Zwei Einträge haben denselben Schlüssel.",
|
|
1521
1553
|
pageSlugInvalid: "Eine Seitenadresse besteht aus Kleinbuchstaben a–z, Ziffern und Bindestrichen.",
|
|
1522
|
-
pageSlugTaken: "Ein anderer Space
|
|
1554
|
+
pageSlugTaken: "Ein anderer Space deiner Organisation hat diese Adresse.",
|
|
1523
1555
|
pageTaken: "Die Seite ist schon bei „{space}“.",
|
|
1524
1556
|
notDeleteLastSpace: "Der letzte Space lässt sich nicht löschen.",
|
|
1525
1557
|
notFound: "Das gibt es nicht oder nicht mehr.",
|
|
@@ -1571,7 +1603,7 @@ var rr = {
|
|
|
1571
1603
|
pageNeedsTitle: "Eine Seite braucht einen Titel.",
|
|
1572
1604
|
unknownSpace: "Den Space „{space}“ gibt es nicht.",
|
|
1573
1605
|
noParentPage: "Es gibt keine Seite mit dem Schlüssel „{parent}“, unter die diese Seite könnte.",
|
|
1574
|
-
|
|
1606
|
+
onlyOrganizationAdmins: "Das dürfen nur Admins der Organisation. Als Mitglied bearbeitest du die Wizards, die es schon gibt.",
|
|
1575
1607
|
spaceEditedLocally: "Diesen Space bearbeitest du in engenty wizards auf deinem Computer, nicht hier.",
|
|
1576
1608
|
wizardsRunOncePublished: "Hier laufen die Wizards, die du in engenty wizards auf deinem Computer veröffentlichst. Gebaut und bearbeitet wird dort.",
|
|
1577
1609
|
logoImagePngSvg: "Ein Logo ist ein Bild (PNG, SVG, JPEG, WebP).",
|
|
@@ -1589,6 +1621,12 @@ var rr = {
|
|
|
1589
1621
|
},
|
|
1590
1622
|
accountSignedOut: "Das Konto ist abgemeldet. Melde dich neu an.",
|
|
1591
1623
|
cloudNotReachedRight: "Die Cloud ist gerade nicht erreichbar.",
|
|
1624
|
+
syncUpdateHere: "Die Cloud hat eine neuere Version als dieser Computer. Aktualisiere engenty wizards, dann kommen deine Änderungen wieder in der Cloud an.",
|
|
1625
|
+
syncUpdateCloud: "Dieser Computer hat eine neuere Version als die Cloud. Deine Änderungen kommen dort an, sobald die Cloud aktualisiert ist.",
|
|
1626
|
+
syncSpaceNotInCloud: "Diesen Space gibt es in der Cloud nicht.",
|
|
1627
|
+
syncOtherSpace: "In der Cloud gehört das zu einem anderen Space.",
|
|
1628
|
+
syncChangeRefused: "Diese Änderung nimmt die Cloud nicht an: {detail}",
|
|
1629
|
+
syncFileMissing: "Eine Datei dieser Änderung ist noch nicht in der Cloud angekommen. Sie wird noch einmal gesendet.",
|
|
1592
1630
|
publishWizardFirst: "Veröffentliche den Wizard zuerst.",
|
|
1593
1631
|
wizardJsonUnreadable: "Das ist keine Wizard-Datei: Die wizard.json darin lässt sich nicht lesen.",
|
|
1594
1632
|
wizardFileComesNewer: "Diese Wizard-Datei stammt aus einer neueren Version oder ist beschädigt. Aktualisiere engenty wizards oder exportiere den Wizard neu.",
|
|
@@ -1638,17 +1676,17 @@ var rr = {
|
|
|
1638
1676
|
makesVoiceNotes: "Sprachnotizen"
|
|
1639
1677
|
}
|
|
1640
1678
|
};
|
|
1641
|
-
function
|
|
1642
|
-
return Array.isArray(e) ? e.map((e) =>
|
|
1679
|
+
function cr(e, t, n) {
|
|
1680
|
+
return Array.isArray(e) ? e.map((e) => cr(e, t, n)) : typeof e == "object" && e && "code" in e ? lr(e, t, n) : e;
|
|
1643
1681
|
}
|
|
1644
|
-
function
|
|
1645
|
-
if (!(e.code in
|
|
1682
|
+
function lr(e, t, n) {
|
|
1683
|
+
if (!(e.code in or)) return "";
|
|
1646
1684
|
let r = {};
|
|
1647
|
-
for (let [i, a] of Object.entries(e.params ?? {})) r[i] = a === void 0 ? void 0 :
|
|
1685
|
+
for (let [i, a] of Object.entries(e.params ?? {})) r[i] = a === void 0 ? void 0 : cr(a, t, n);
|
|
1648
1686
|
let i = n?.[e.code];
|
|
1649
|
-
return i === void 0 ?
|
|
1687
|
+
return i === void 0 ? ir(sr, e.code, Xt(t) ? t : "en", r) : ar(i, t, r);
|
|
1650
1688
|
}
|
|
1651
|
-
var
|
|
1689
|
+
var ur = {
|
|
1652
1690
|
en: {
|
|
1653
1691
|
"result.translate": "Translate",
|
|
1654
1692
|
"translation.working": "Translating…",
|
|
@@ -2185,47 +2223,47 @@ var sr = {
|
|
|
2185
2223
|
"video.you": "Du",
|
|
2186
2224
|
"nav.language": "Sprache"
|
|
2187
2225
|
}
|
|
2188
|
-
}, B = "en",
|
|
2189
|
-
function
|
|
2190
|
-
|
|
2191
|
-
for (let e of
|
|
2226
|
+
}, B = "en", dr = null, fr = 0, pr = /* @__PURE__ */ new Set();
|
|
2227
|
+
function mr() {
|
|
2228
|
+
fr += 1;
|
|
2229
|
+
for (let e of pr) e();
|
|
2192
2230
|
}
|
|
2193
|
-
function
|
|
2194
|
-
e !== B && (B = e,
|
|
2231
|
+
function hr(e) {
|
|
2232
|
+
e !== B && (B = e, mr());
|
|
2195
2233
|
}
|
|
2196
|
-
function
|
|
2197
|
-
return
|
|
2234
|
+
function gr() {
|
|
2235
|
+
return dr?.lang ?? B;
|
|
2198
2236
|
}
|
|
2199
|
-
function
|
|
2200
|
-
return e.note &&
|
|
2237
|
+
function _r(e) {
|
|
2238
|
+
return e.note && lr(e.note, gr(), dr?.notes) || e.message;
|
|
2201
2239
|
}
|
|
2202
|
-
var
|
|
2203
|
-
function
|
|
2204
|
-
|
|
2240
|
+
var vr = {};
|
|
2241
|
+
function yr(e) {
|
|
2242
|
+
vr = e ?? {};
|
|
2205
2243
|
}
|
|
2206
|
-
function
|
|
2207
|
-
return
|
|
2244
|
+
function br(e) {
|
|
2245
|
+
return vr[e] ?? e;
|
|
2208
2246
|
}
|
|
2209
2247
|
function V(e, t) {
|
|
2210
|
-
return
|
|
2248
|
+
return dr?.runner[e], ir(ur, e, B, t);
|
|
2211
2249
|
}
|
|
2212
2250
|
//#endregion
|
|
2213
2251
|
//#region ../runner/src/api.ts
|
|
2214
|
-
var
|
|
2252
|
+
var xr = class extends Error {
|
|
2215
2253
|
status;
|
|
2216
2254
|
body;
|
|
2217
2255
|
constructor(e, t, n) {
|
|
2218
2256
|
super(e), this.status = t, this.body = n;
|
|
2219
2257
|
}
|
|
2220
2258
|
};
|
|
2221
|
-
function
|
|
2259
|
+
function Sr(e) {
|
|
2222
2260
|
try {
|
|
2223
2261
|
return JSON.parse(e);
|
|
2224
2262
|
} catch {
|
|
2225
2263
|
return { error: e };
|
|
2226
2264
|
}
|
|
2227
2265
|
}
|
|
2228
|
-
function
|
|
2266
|
+
function Cr(e, t = {}, n) {
|
|
2229
2267
|
async function r(r, i, a) {
|
|
2230
2268
|
let o = await fetch(e(i), {
|
|
2231
2269
|
method: r,
|
|
@@ -2237,9 +2275,9 @@ function br(e, t = {}, n) {
|
|
|
2237
2275
|
},
|
|
2238
2276
|
body: a === void 0 ? void 0 : a instanceof FormData ? a : JSON.stringify(a)
|
|
2239
2277
|
}).catch(() => {
|
|
2240
|
-
throw new
|
|
2241
|
-
}), s = await o.text(), c = s ?
|
|
2242
|
-
if (!o.ok) throw o.status >= 500 && n?.(`${r} ${i} answered ${o.status}: ${c?.error ?? ""}`), new
|
|
2278
|
+
throw new xr(V("common.offline"), 0, null);
|
|
2279
|
+
}), s = await o.text(), c = s ? Sr(s) : null;
|
|
2280
|
+
if (!o.ok) throw o.status >= 500 && n?.(`${r} ${i} answered ${o.status}: ${c?.error ?? ""}`), new xr(c?.error ?? c?.message ?? o.statusText, o.status, c);
|
|
2243
2281
|
return c;
|
|
2244
2282
|
}
|
|
2245
2283
|
return {
|
|
@@ -2256,26 +2294,26 @@ function br(e, t = {}, n) {
|
|
|
2256
2294
|
}
|
|
2257
2295
|
//#endregion
|
|
2258
2296
|
//#region ../runner/src/env.ts
|
|
2259
|
-
var
|
|
2297
|
+
var wr = {
|
|
2260
2298
|
can: () => !1,
|
|
2261
2299
|
call: (e) => Promise.reject(/* @__PURE__ */ Error(`the app cannot ${e}`)),
|
|
2262
2300
|
tell: () => void 0,
|
|
2263
2301
|
download: () => !1
|
|
2264
|
-
},
|
|
2265
|
-
function
|
|
2266
|
-
|
|
2302
|
+
}, Tr = null;
|
|
2303
|
+
function Er(e) {
|
|
2304
|
+
Tr = e, U = Cr(e.withBase, e.headers, e.onServerError), hr(e.lang);
|
|
2267
2305
|
}
|
|
2268
2306
|
function H() {
|
|
2269
|
-
if (!
|
|
2270
|
-
return
|
|
2307
|
+
if (!Tr) throw Error("configureRunner() first");
|
|
2308
|
+
return Tr;
|
|
2271
2309
|
}
|
|
2272
|
-
var U =
|
|
2310
|
+
var U = Cr((e) => e), W = (e) => H().withBase(e), Dr = (e) => H().asset(e), G = (e) => H().runBase(e), K = (e) => (Tr?.app ?? wr).can(e), Or = (e, t) => (Tr?.app ?? wr).call(e, t), kr = (e, t) => (Tr?.app ?? wr).tell(e, t), Ar = (e, t, n) => (Tr?.app ?? wr).download(e, t, n), jr = () => Tr?.standalone === !0;
|
|
2273
2311
|
//#endregion
|
|
2274
2312
|
//#region ../runner/src/ui.tsx
|
|
2275
2313
|
function q(...e) {
|
|
2276
2314
|
return e.filter(Boolean).join(" ");
|
|
2277
2315
|
}
|
|
2278
|
-
var
|
|
2316
|
+
var Mr = {
|
|
2279
2317
|
primary: "bg-primary text-primary-foreground hover:brightness-[1.06] active:brightness-95 shadow-[0_1px_0_oklch(0%_0_0/0.08)]",
|
|
2280
2318
|
secondary: "bg-card text-ink border border-border hover:bg-paper-2",
|
|
2281
2319
|
ghost: "text-ink-2 hover:text-ink hover:bg-accent",
|
|
@@ -2287,9 +2325,9 @@ var kr = {
|
|
|
2287
2325
|
type: "button",
|
|
2288
2326
|
"data-variant": e,
|
|
2289
2327
|
disabled: a || n,
|
|
2290
|
-
className: q("inline-flex select-none items-center justify-center gap-2 whitespace-nowrap rounded-full font-medium transition-[background,filter,color,transform] duration-150 active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50", t === "sm" && "h-8 px-3 text-[0.8125rem] coarse:h-11 coarse:px-4", t === "md" && "h-10 px-4 text-sm coarse:h-11", t === "lg" && "h-12 px-6 text-[0.9375rem]",
|
|
2328
|
+
className: q("inline-flex select-none items-center justify-center gap-2 whitespace-nowrap rounded-full font-medium transition-[background,filter,color,transform] duration-150 active:scale-[0.98] disabled:pointer-events-none disabled:opacity-50", t === "sm" && "h-8 px-3 text-[0.8125rem] coarse:h-11 coarse:px-4", t === "md" && "h-10 px-4 text-sm coarse:h-11", t === "lg" && "h-12 px-6 text-[0.9375rem]", Mr[e], e === "primary" && "wizard-button", r),
|
|
2291
2329
|
...o,
|
|
2292
|
-
children: [n ? /* @__PURE__ */ F(
|
|
2330
|
+
children: [n ? /* @__PURE__ */ F(Ur, { className: "size-4" }) : null, i]
|
|
2293
2331
|
});
|
|
2294
2332
|
});
|
|
2295
2333
|
function Y({ label: e, className: t, children: n, ...r }) {
|
|
@@ -2302,25 +2340,25 @@ function Y({ label: e, className: t, children: n, ...r }) {
|
|
|
2302
2340
|
children: n
|
|
2303
2341
|
});
|
|
2304
2342
|
}
|
|
2305
|
-
var
|
|
2306
|
-
function
|
|
2343
|
+
var Nr = "wizard-field rounded-lg border border-input bg-card px-3.5 text-[0.9375rem] text-ink shadow-[inset_0_1px_0_oklch(0%_0_0/0.02)] outline-none transition placeholder:text-ink-4 focus:border-focus focus:ring-4 focus:ring-focus-glow disabled:opacity-60";
|
|
2344
|
+
function Pr(e) {
|
|
2307
2345
|
return /(^|\s)w-/.test(e ?? "") ? null : "w-full";
|
|
2308
2346
|
}
|
|
2309
2347
|
var X = Me(function({ className: e, ...t }, n) {
|
|
2310
2348
|
return /* @__PURE__ */ F("input", {
|
|
2311
2349
|
ref: n,
|
|
2312
|
-
className: q(
|
|
2350
|
+
className: q(Nr, Pr(e), "h-11", e),
|
|
2313
2351
|
...t
|
|
2314
2352
|
});
|
|
2315
2353
|
});
|
|
2316
|
-
function
|
|
2354
|
+
function Fr(e) {
|
|
2317
2355
|
return /* @__PURE__ */ F("input", {
|
|
2318
2356
|
type: "color",
|
|
2319
2357
|
className: "swatch size-11 shrink-0 cursor-pointer rounded-lg border border-input bg-card p-1",
|
|
2320
2358
|
...e
|
|
2321
2359
|
});
|
|
2322
2360
|
}
|
|
2323
|
-
var
|
|
2361
|
+
var Ir = Me(function({ className: e, minRows: t = 3, maxRows: n = 14, onChange: r, ...i }, a) {
|
|
2324
2362
|
let o = j(null), s = () => {
|
|
2325
2363
|
let e = o.current;
|
|
2326
2364
|
if (!e) return;
|
|
@@ -2333,20 +2371,20 @@ var Nr = Me(function({ className: e, minRows: t = 3, maxRows: n = 14, onChange:
|
|
|
2333
2371
|
ref: (e) => {
|
|
2334
2372
|
o.current = e, typeof a == "function" ? a(e) : a && (a.current = e);
|
|
2335
2373
|
},
|
|
2336
|
-
className: q(
|
|
2374
|
+
className: q(Nr, Pr(e), "resize-none py-2.5 leading-[1.5]", e),
|
|
2337
2375
|
onChange: (e) => {
|
|
2338
2376
|
s(), r?.(e);
|
|
2339
2377
|
},
|
|
2340
2378
|
...i
|
|
2341
2379
|
});
|
|
2342
2380
|
});
|
|
2343
|
-
function
|
|
2381
|
+
function Lr({ value: e, onChange: t, options: n, className: r, placeholder: i }) {
|
|
2344
2382
|
return /* @__PURE__ */ I("div", {
|
|
2345
2383
|
className: q("relative", r),
|
|
2346
2384
|
children: [/* @__PURE__ */ I("select", {
|
|
2347
2385
|
value: e,
|
|
2348
2386
|
onChange: (e) => t(e.target.value),
|
|
2349
|
-
className: q(
|
|
2387
|
+
className: q(Nr, "h-11 w-full appearance-none pr-9"),
|
|
2350
2388
|
children: [i === void 0 ? null : /* @__PURE__ */ F("option", {
|
|
2351
2389
|
value: "",
|
|
2352
2390
|
children: i
|
|
@@ -2368,7 +2406,7 @@ function Pr({ value: e, onChange: t, options: n, className: r, placeholder: i })
|
|
|
2368
2406
|
})]
|
|
2369
2407
|
});
|
|
2370
2408
|
}
|
|
2371
|
-
function
|
|
2409
|
+
function Rr({ value: e, onChange: t, options: n, multi: r, disabled: i, label: a }) {
|
|
2372
2410
|
let o = new Set(Array.isArray(e) ? e : e ? [e] : []);
|
|
2373
2411
|
return /* @__PURE__ */ F("div", {
|
|
2374
2412
|
className: "flex flex-wrap gap-2",
|
|
@@ -2390,8 +2428,8 @@ function Fr({ value: e, onChange: t, options: n, multi: r, disabled: i, label: a
|
|
|
2390
2428
|
})
|
|
2391
2429
|
});
|
|
2392
2430
|
}
|
|
2393
|
-
var
|
|
2394
|
-
function
|
|
2431
|
+
var zr = "cubic-bezier(0.3, 0.7, 0.2, 1)";
|
|
2432
|
+
function Br({ value: e, onChange: t, options: n, label: r }) {
|
|
2395
2433
|
let i = j(/* @__PURE__ */ new Map()), [a, o] = M(null);
|
|
2396
2434
|
return Fe(() => {
|
|
2397
2435
|
let t = i.current.get(e);
|
|
@@ -2413,7 +2451,7 @@ function Lr({ value: e, onChange: t, options: n, label: r }) {
|
|
|
2413
2451
|
style: {
|
|
2414
2452
|
width: a.w,
|
|
2415
2453
|
transform: `translateX(${a.x}px)`,
|
|
2416
|
-
transition: `transform 300ms ${
|
|
2454
|
+
transition: `transform 300ms ${zr}, width 300ms ${zr}`
|
|
2417
2455
|
}
|
|
2418
2456
|
}) : null, n.map((n) => {
|
|
2419
2457
|
let r = n.id === e;
|
|
@@ -2431,7 +2469,7 @@ function Lr({ value: e, onChange: t, options: n, label: r }) {
|
|
|
2431
2469
|
})]
|
|
2432
2470
|
});
|
|
2433
2471
|
}
|
|
2434
|
-
function
|
|
2472
|
+
function Vr({ checked: e, onChange: t, label: n, disabled: r }) {
|
|
2435
2473
|
return /* @__PURE__ */ F("button", {
|
|
2436
2474
|
type: "button",
|
|
2437
2475
|
role: "switch",
|
|
@@ -2443,7 +2481,7 @@ function Rr({ checked: e, onChange: t, label: n, disabled: r }) {
|
|
|
2443
2481
|
children: /* @__PURE__ */ F("span", { className: q("inline-block size-5 rounded-full bg-white shadow-sm transition-transform", e ? "translate-x-[22px]" : "translate-x-[2px]") })
|
|
2444
2482
|
});
|
|
2445
2483
|
}
|
|
2446
|
-
function
|
|
2484
|
+
function Hr({ children: e, hint: t, required: n }) {
|
|
2447
2485
|
return /* @__PURE__ */ I("div", {
|
|
2448
2486
|
className: "mb-2",
|
|
2449
2487
|
children: [/* @__PURE__ */ I("div", {
|
|
@@ -2458,7 +2496,7 @@ function zr({ children: e, hint: t, required: n }) {
|
|
|
2458
2496
|
}) : null]
|
|
2459
2497
|
});
|
|
2460
2498
|
}
|
|
2461
|
-
function
|
|
2499
|
+
function Ur({ className: e }) {
|
|
2462
2500
|
return /* @__PURE__ */ I("svg", {
|
|
2463
2501
|
className: q("size-5 animate-spin", e),
|
|
2464
2502
|
viewBox: "0 0 24 24",
|
|
@@ -2478,14 +2516,14 @@ function Br({ className: e }) {
|
|
|
2478
2516
|
})]
|
|
2479
2517
|
});
|
|
2480
2518
|
}
|
|
2481
|
-
function
|
|
2519
|
+
function Wr({ className: e, children: t, ...n }) {
|
|
2482
2520
|
return /* @__PURE__ */ F("div", {
|
|
2483
2521
|
className: q("wizard-card rounded-xl bg-card shadow-soft ring-1 ring-border-soft", e),
|
|
2484
2522
|
...n,
|
|
2485
2523
|
children: t
|
|
2486
2524
|
});
|
|
2487
2525
|
}
|
|
2488
|
-
function
|
|
2526
|
+
function Gr({ open: e, onClose: t, title: n, children: r, wide: i, bare: a, height: o = "auto" }) {
|
|
2489
2527
|
let s = j(null);
|
|
2490
2528
|
return A(() => {
|
|
2491
2529
|
let t = s.current;
|
|
@@ -2538,7 +2576,7 @@ function Hr({ open: e, onClose: t, title: n, children: r, wide: i, bare: a, heig
|
|
|
2538
2576
|
}) : null
|
|
2539
2577
|
});
|
|
2540
2578
|
}
|
|
2541
|
-
function
|
|
2579
|
+
function Kr({ text: e }) {
|
|
2542
2580
|
return e.split(/(https?:\/\/[^\s)]+)/).map((e, t) => t % 2 ? /* @__PURE__ */ F("a", {
|
|
2543
2581
|
href: e,
|
|
2544
2582
|
target: "_blank",
|
|
@@ -2549,8 +2587,8 @@ function Ur({ text: e }) {
|
|
|
2549
2587
|
}
|
|
2550
2588
|
//#endregion
|
|
2551
2589
|
//#region ../runner/src/browser-live.tsx
|
|
2552
|
-
var
|
|
2553
|
-
function
|
|
2590
|
+
var qr = 250;
|
|
2591
|
+
function Jr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a, onBroken: o }) {
|
|
2554
2592
|
let c = j(null), l = j(null), [d, f] = M(""), [p, m] = M(!1), [h, g] = M(null), _ = async (t) => {
|
|
2555
2593
|
g(null);
|
|
2556
2594
|
try {
|
|
@@ -2575,7 +2613,7 @@ function Gr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a
|
|
|
2575
2613
|
type: "scroll",
|
|
2576
2614
|
dy: t
|
|
2577
2615
|
}).catch(() => void 0);
|
|
2578
|
-
},
|
|
2616
|
+
}, qr);
|
|
2579
2617
|
};
|
|
2580
2618
|
return n.addEventListener("wheel", a, { passive: !1 }), () => {
|
|
2581
2619
|
n.removeEventListener("wheel", a), i && clearTimeout(i);
|
|
@@ -2649,7 +2687,7 @@ function Gr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a
|
|
|
2649
2687
|
className: q("h-9 shrink-0 rounded-md px-2.5 text-[0.75rem] coarse:h-11 coarse:px-3.5", p ? "bg-ember-veil text-ink" : "text-ink-3 hover:bg-paper-2"),
|
|
2650
2688
|
children: V("ask.hide")
|
|
2651
2689
|
}),
|
|
2652
|
-
/* @__PURE__ */ F(
|
|
2690
|
+
/* @__PURE__ */ F(Yr, {
|
|
2653
2691
|
label: "Enter",
|
|
2654
2692
|
onClick: () => void _({
|
|
2655
2693
|
type: "key",
|
|
@@ -2657,7 +2695,7 @@ function Gr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a
|
|
|
2657
2695
|
}),
|
|
2658
2696
|
children: /* @__PURE__ */ F(y, { className: "size-4" })
|
|
2659
2697
|
}),
|
|
2660
|
-
/* @__PURE__ */ F(
|
|
2698
|
+
/* @__PURE__ */ F(Yr, {
|
|
2661
2699
|
label: V("ask.up"),
|
|
2662
2700
|
onClick: () => void _({
|
|
2663
2701
|
type: "scroll",
|
|
@@ -2665,7 +2703,7 @@ function Gr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a
|
|
|
2665
2703
|
}),
|
|
2666
2704
|
children: /* @__PURE__ */ F(u, { className: "size-4" })
|
|
2667
2705
|
}),
|
|
2668
|
-
/* @__PURE__ */ F(
|
|
2706
|
+
/* @__PURE__ */ F(Yr, {
|
|
2669
2707
|
label: V("ask.down"),
|
|
2670
2708
|
onClick: () => void _({
|
|
2671
2709
|
type: "scroll",
|
|
@@ -2683,7 +2721,7 @@ function Gr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a
|
|
|
2683
2721
|
}) : null]
|
|
2684
2722
|
});
|
|
2685
2723
|
}
|
|
2686
|
-
function
|
|
2724
|
+
function Yr({ label: e, onClick: t, children: n }) {
|
|
2687
2725
|
return /* @__PURE__ */ F("button", {
|
|
2688
2726
|
type: "button",
|
|
2689
2727
|
"aria-label": e,
|
|
@@ -2695,16 +2733,16 @@ function Kr({ label: e, onClick: t, children: n }) {
|
|
|
2695
2733
|
}
|
|
2696
2734
|
//#endregion
|
|
2697
2735
|
//#region ../runner/src/AskPanel.tsx
|
|
2698
|
-
function
|
|
2699
|
-
return t.kind === "confirm" ? /* @__PURE__ */ F(
|
|
2736
|
+
function Xr({ runId: e, ask: t }) {
|
|
2737
|
+
return t.kind === "confirm" ? /* @__PURE__ */ F(Zr, {
|
|
2700
2738
|
runId: e,
|
|
2701
2739
|
ask: t
|
|
2702
|
-
}) : /* @__PURE__ */ F(
|
|
2740
|
+
}) : /* @__PURE__ */ F(Qr, {
|
|
2703
2741
|
runId: e,
|
|
2704
2742
|
ask: t
|
|
2705
2743
|
});
|
|
2706
2744
|
}
|
|
2707
|
-
function
|
|
2745
|
+
function Zr({ runId: e, ask: t }) {
|
|
2708
2746
|
let [n, r] = M(!1), [i, a] = M(!1), [o, s] = M(null), c = async (n) => {
|
|
2709
2747
|
a(!0), s(null);
|
|
2710
2748
|
try {
|
|
@@ -2738,7 +2776,7 @@ function Jr({ runId: e, ask: t }) {
|
|
|
2738
2776
|
}),
|
|
2739
2777
|
t.once ? null : /* @__PURE__ */ I("div", {
|
|
2740
2778
|
className: "mt-5 flex items-center gap-4",
|
|
2741
|
-
children: [/* @__PURE__ */ F(
|
|
2779
|
+
children: [/* @__PURE__ */ F(Vr, {
|
|
2742
2780
|
checked: n,
|
|
2743
2781
|
onChange: r,
|
|
2744
2782
|
label: V("ask.allowRest")
|
|
@@ -2770,7 +2808,7 @@ function Jr({ runId: e, ask: t }) {
|
|
|
2770
2808
|
]
|
|
2771
2809
|
});
|
|
2772
2810
|
}
|
|
2773
|
-
function
|
|
2811
|
+
function Qr({ runId: e, ask: t }) {
|
|
2774
2812
|
let [n, r] = M({}), [i, a] = M(!1), [o, s] = M(!1), [c, l] = M(null), u = async (n) => {
|
|
2775
2813
|
s(!0), l(null);
|
|
2776
2814
|
try {
|
|
@@ -2798,7 +2836,7 @@ function Yr({ runId: e, ask: t }) {
|
|
|
2798
2836
|
})]
|
|
2799
2837
|
})]
|
|
2800
2838
|
}),
|
|
2801
|
-
/* @__PURE__ */ F(
|
|
2839
|
+
/* @__PURE__ */ F(Jr, {
|
|
2802
2840
|
runId: e,
|
|
2803
2841
|
driving: !0
|
|
2804
2842
|
}),
|
|
@@ -2815,7 +2853,7 @@ function Yr({ runId: e, ask: t }) {
|
|
|
2815
2853
|
remember: i
|
|
2816
2854
|
});
|
|
2817
2855
|
},
|
|
2818
|
-
children: [t.fields.map((e, i) => /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(
|
|
2856
|
+
children: [t.fields.map((e, i) => /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(Hr, { children: e.label }), /* @__PURE__ */ F(X, {
|
|
2819
2857
|
autoFocus: i === 0,
|
|
2820
2858
|
type: e.secret ? "password" : "text",
|
|
2821
2859
|
autoComplete: "off",
|
|
@@ -2835,7 +2873,7 @@ function Yr({ runId: e, ask: t }) {
|
|
|
2835
2873
|
}) : null,
|
|
2836
2874
|
/* @__PURE__ */ I("div", {
|
|
2837
2875
|
className: "mt-5 flex items-center justify-between gap-4",
|
|
2838
|
-
children: [/* @__PURE__ */ F(
|
|
2876
|
+
children: [/* @__PURE__ */ F(Vr, {
|
|
2839
2877
|
checked: i,
|
|
2840
2878
|
onChange: a,
|
|
2841
2879
|
label: V("ask.remember")
|
|
@@ -2897,8 +2935,8 @@ function Yr({ runId: e, ask: t }) {
|
|
|
2897
2935
|
}
|
|
2898
2936
|
//#endregion
|
|
2899
2937
|
//#region ../runner/src/device.ts
|
|
2900
|
-
var
|
|
2901
|
-
function
|
|
2938
|
+
var $r = typeof window < "u" && window.matchMedia?.("(pointer: coarse)").matches === !0, ei = typeof navigator < "u" && !!navigator.mediaDevices?.getUserMedia;
|
|
2939
|
+
function ti() {
|
|
2902
2940
|
A(() => {
|
|
2903
2941
|
let e = window.visualViewport;
|
|
2904
2942
|
if (!e) return;
|
|
@@ -2914,11 +2952,11 @@ function Qr() {
|
|
|
2914
2952
|
};
|
|
2915
2953
|
}, []);
|
|
2916
2954
|
}
|
|
2917
|
-
function
|
|
2955
|
+
function ni(e) {
|
|
2918
2956
|
let [t, n] = M(!1);
|
|
2919
2957
|
return A(() => {
|
|
2920
|
-
if (e && K("keepAwake")) return
|
|
2921
|
-
|
|
2958
|
+
if (e && K("keepAwake")) return kr("keepAwake", !0), n(!0), () => {
|
|
2959
|
+
kr("keepAwake", !1), n(!1);
|
|
2922
2960
|
};
|
|
2923
2961
|
if (!e || !("wakeLock" in navigator)) return;
|
|
2924
2962
|
let t = null, r = !1, i = async () => {
|
|
@@ -2938,56 +2976,56 @@ function $r(e) {
|
|
|
2938
2976
|
};
|
|
2939
2977
|
}, [e]), t;
|
|
2940
2978
|
}
|
|
2941
|
-
var
|
|
2942
|
-
function
|
|
2979
|
+
var ri = "wz.notify", ii = /* @__PURE__ */ new Set(), ai = null;
|
|
2980
|
+
function oi() {
|
|
2943
2981
|
try {
|
|
2944
|
-
return localStorage.getItem(
|
|
2982
|
+
return localStorage.getItem(ri) === "1";
|
|
2945
2983
|
} catch {
|
|
2946
2984
|
return !1;
|
|
2947
2985
|
}
|
|
2948
2986
|
}
|
|
2949
|
-
function
|
|
2987
|
+
function si(e) {
|
|
2950
2988
|
try {
|
|
2951
|
-
e ? localStorage.setItem(
|
|
2989
|
+
e ? localStorage.setItem(ri, "1") : localStorage.removeItem(ri);
|
|
2952
2990
|
} catch {}
|
|
2953
|
-
for (let e of
|
|
2991
|
+
for (let e of ii) e();
|
|
2954
2992
|
}
|
|
2955
|
-
var
|
|
2956
|
-
function
|
|
2957
|
-
return
|
|
2993
|
+
var ci = typeof window < "u" && "Notification" in window, li = null;
|
|
2994
|
+
function ui() {
|
|
2995
|
+
return oi() ? K("notify") ? li === !1 ? "quiet" : "on" : ci && Notification.permission === "granted" ? "on" : "quiet" : "off";
|
|
2958
2996
|
}
|
|
2959
|
-
function
|
|
2960
|
-
return Le((e) => (
|
|
2997
|
+
function di() {
|
|
2998
|
+
return Le((e) => (ii.add(e), () => ii.delete(e)), ui, () => "off");
|
|
2961
2999
|
}
|
|
2962
|
-
function
|
|
2963
|
-
return K("notify") ?
|
|
3000
|
+
function fi() {
|
|
3001
|
+
return K("notify") ? li === !1 : ci && Notification.permission === "denied";
|
|
2964
3002
|
}
|
|
2965
|
-
async function
|
|
2966
|
-
if (
|
|
2967
|
-
|
|
2968
|
-
for (let e of
|
|
2969
|
-
return
|
|
3003
|
+
async function pi() {
|
|
3004
|
+
if (si(!0), K("notify")) {
|
|
3005
|
+
li = !K("notifyPermission") || await Or("notifyPermission").catch(() => !1);
|
|
3006
|
+
for (let e of ii) e();
|
|
3007
|
+
return ui();
|
|
2970
3008
|
}
|
|
2971
3009
|
try {
|
|
2972
|
-
|
|
3010
|
+
ai ??= new AudioContext(), ai.resume();
|
|
2973
3011
|
} catch {
|
|
2974
|
-
|
|
3012
|
+
ai = null;
|
|
2975
3013
|
}
|
|
2976
|
-
if (
|
|
3014
|
+
if (ci && Notification.permission === "default") try {
|
|
2977
3015
|
await Notification.requestPermission();
|
|
2978
3016
|
} catch {}
|
|
2979
|
-
if (
|
|
3017
|
+
if (ci && Notification.permission === "granted") {
|
|
2980
3018
|
let e = H().serviceWorker;
|
|
2981
3019
|
e && await navigator.serviceWorker?.register(e).catch(() => void 0);
|
|
2982
3020
|
}
|
|
2983
|
-
for (let e of
|
|
2984
|
-
return
|
|
3021
|
+
for (let e of ii) e();
|
|
3022
|
+
return ui();
|
|
2985
3023
|
}
|
|
2986
|
-
function
|
|
2987
|
-
|
|
3024
|
+
function mi() {
|
|
3025
|
+
si(!1);
|
|
2988
3026
|
}
|
|
2989
|
-
function
|
|
2990
|
-
let e =
|
|
3027
|
+
function hi() {
|
|
3028
|
+
let e = ai;
|
|
2991
3029
|
if (e?.state !== "running") return;
|
|
2992
3030
|
let t = e.currentTime;
|
|
2993
3031
|
for (let [n, r] of [660, 880].entries()) {
|
|
@@ -2995,26 +3033,26 @@ function fi() {
|
|
|
2995
3033
|
i.frequency.value = r, a.gain.setValueAtTime(0, t + n * .16), a.gain.linearRampToValueAtTime(.18, t + n * .16 + .02), a.gain.exponentialRampToValueAtTime(.001, t + n * .16 + .32), i.connect(a).connect(e.destination), i.start(t + n * .16), i.stop(t + n * .16 + .34);
|
|
2996
3034
|
}
|
|
2997
3035
|
}
|
|
2998
|
-
async function
|
|
2999
|
-
if (!
|
|
3036
|
+
async function gi(e) {
|
|
3037
|
+
if (!oi()) return;
|
|
3000
3038
|
if (K("notify")) {
|
|
3001
|
-
|
|
3039
|
+
kr("notify", e);
|
|
3002
3040
|
return;
|
|
3003
3041
|
}
|
|
3004
3042
|
if (document.visibilityState === "visible") {
|
|
3005
|
-
|
|
3043
|
+
hi(), navigator.vibrate?.([
|
|
3006
3044
|
120,
|
|
3007
3045
|
60,
|
|
3008
3046
|
120
|
|
3009
3047
|
]);
|
|
3010
3048
|
return;
|
|
3011
3049
|
}
|
|
3012
|
-
if (!
|
|
3050
|
+
if (!ci || Notification.permission !== "granted") return;
|
|
3013
3051
|
let t = {
|
|
3014
3052
|
body: e.body,
|
|
3015
3053
|
tag: e.tag,
|
|
3016
|
-
icon:
|
|
3017
|
-
badge:
|
|
3054
|
+
icon: Dr("icons/icon-192.png"),
|
|
3055
|
+
badge: Dr("icons/icon-192.png"),
|
|
3018
3056
|
data: { url: location.href }
|
|
3019
3057
|
};
|
|
3020
3058
|
try {
|
|
@@ -3028,7 +3066,7 @@ async function pi(e) {
|
|
|
3028
3066
|
new Notification(e.title, t);
|
|
3029
3067
|
} catch {}
|
|
3030
3068
|
}
|
|
3031
|
-
function
|
|
3069
|
+
function _i() {
|
|
3032
3070
|
if (typeof navigator > "u" || !navigator.canShare) return !1;
|
|
3033
3071
|
try {
|
|
3034
3072
|
return navigator.canShare({ files: [new File(["x"], "x.pdf", { type: "application/pdf" })] });
|
|
@@ -3038,7 +3076,7 @@ function mi() {
|
|
|
3038
3076
|
}
|
|
3039
3077
|
//#endregion
|
|
3040
3078
|
//#region ../runner/src/camera.tsx
|
|
3041
|
-
async function
|
|
3079
|
+
async function vi(e, t = 2400) {
|
|
3042
3080
|
if (!/^image\/(jpeg|png|webp)$/.test(e.type) || e.size < 12e5) return e;
|
|
3043
3081
|
try {
|
|
3044
3082
|
let n = await createImageBitmap(e), r = Math.min(1, t / Math.max(n.width, n.height)), i = document.createElement("canvas");
|
|
@@ -3049,17 +3087,17 @@ async function hi(e, t = 2400) {
|
|
|
3049
3087
|
return e;
|
|
3050
3088
|
}
|
|
3051
3089
|
}
|
|
3052
|
-
function
|
|
3090
|
+
function yi() {
|
|
3053
3091
|
return (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace(/[:T]/g, "-");
|
|
3054
3092
|
}
|
|
3055
|
-
function
|
|
3093
|
+
function bi(e) {
|
|
3056
3094
|
let t = e?.name;
|
|
3057
3095
|
return t === "NotFoundError" || t === "OverconstrainedError" ? "missing" : t === "NotReadableError" || t === "AbortError" ? "busy" : "denied";
|
|
3058
3096
|
}
|
|
3059
|
-
function
|
|
3097
|
+
function xi(e) {
|
|
3060
3098
|
return !!e?.getCapabilities?.()?.torch;
|
|
3061
3099
|
}
|
|
3062
|
-
function
|
|
3100
|
+
function Si(e, t, n = !1) {
|
|
3063
3101
|
let r = j(null), [i, a] = M(null), [o, s] = M(null), [c, l] = M(1), [u, d] = M(!1), [f, p] = M(!1);
|
|
3064
3102
|
return A(() => {
|
|
3065
3103
|
if (!e) return;
|
|
@@ -3086,11 +3124,11 @@ function yi(e, t, n = !1) {
|
|
|
3086
3124
|
return;
|
|
3087
3125
|
}
|
|
3088
3126
|
a(r);
|
|
3089
|
-
let e = r.getVideoTracks()[0], t = () => !i && d(
|
|
3127
|
+
let e = r.getVideoTracks()[0], t = () => !i && d(xi(e));
|
|
3090
3128
|
t(), setTimeout(t, 600);
|
|
3091
3129
|
let s = await navigator.mediaDevices.enumerateDevices().catch(() => []);
|
|
3092
3130
|
i || l(s.filter((e) => e.kind === "videoinput").length);
|
|
3093
|
-
})().catch((e) => !i && s(
|
|
3131
|
+
})().catch((e) => !i && s(bi(e))), () => {
|
|
3094
3132
|
i = !0;
|
|
3095
3133
|
for (let e of r?.getTracks() ?? []) e.stop();
|
|
3096
3134
|
};
|
|
@@ -3118,7 +3156,7 @@ function yi(e, t, n = !1) {
|
|
|
3118
3156
|
mirrored: i?.getVideoTracks()[0]?.getSettings().facingMode === "user"
|
|
3119
3157
|
};
|
|
3120
3158
|
}
|
|
3121
|
-
function
|
|
3159
|
+
function Ci({ open: e, onClose: t, label: n, children: r }) {
|
|
3122
3160
|
let i = j(null);
|
|
3123
3161
|
return A(() => {
|
|
3124
3162
|
let t = i.current;
|
|
@@ -3134,7 +3172,7 @@ function bi({ open: e, onClose: t, label: n, children: r }) {
|
|
|
3134
3172
|
}) : null
|
|
3135
3173
|
});
|
|
3136
3174
|
}
|
|
3137
|
-
function
|
|
3175
|
+
function wi({ label: e, onClick: t, active: n, children: r }) {
|
|
3138
3176
|
return /* @__PURE__ */ F("button", {
|
|
3139
3177
|
type: "button",
|
|
3140
3178
|
"aria-label": e,
|
|
@@ -3145,13 +3183,13 @@ function xi({ label: e, onClick: t, active: n, children: r }) {
|
|
|
3145
3183
|
children: r
|
|
3146
3184
|
});
|
|
3147
3185
|
}
|
|
3148
|
-
function
|
|
3186
|
+
function Ti({ title: e, onClose: t, camera: n, onFlip: r }) {
|
|
3149
3187
|
return /* @__PURE__ */ F("div", {
|
|
3150
3188
|
className: "safe-top",
|
|
3151
3189
|
children: /* @__PURE__ */ I("div", {
|
|
3152
3190
|
className: "flex items-center gap-2 px-3 py-2",
|
|
3153
3191
|
children: [
|
|
3154
|
-
/* @__PURE__ */ F(
|
|
3192
|
+
/* @__PURE__ */ F(wi, {
|
|
3155
3193
|
label: V("common.close"),
|
|
3156
3194
|
onClick: t,
|
|
3157
3195
|
children: /* @__PURE__ */ F(je, { className: "size-5" })
|
|
@@ -3160,13 +3198,13 @@ function Si({ title: e, onClose: t, camera: n, onFlip: r }) {
|
|
|
3160
3198
|
className: "min-w-0 flex-1 truncate text-center font-medium text-[0.9375rem]",
|
|
3161
3199
|
children: e
|
|
3162
3200
|
}),
|
|
3163
|
-
n.torchable ? /* @__PURE__ */ F(
|
|
3201
|
+
n.torchable ? /* @__PURE__ */ F(wi, {
|
|
3164
3202
|
label: V("camera.torch"),
|
|
3165
3203
|
active: n.torch,
|
|
3166
3204
|
onClick: () => void n.setTorch(!n.torch),
|
|
3167
3205
|
children: n.torch ? /* @__PURE__ */ F(te, { className: "size-5" }) : /* @__PURE__ */ F(ne, { className: "size-5" })
|
|
3168
3206
|
}) : null,
|
|
3169
|
-
n.stream && (n.cameras > 1 ||
|
|
3207
|
+
n.stream && (n.cameras > 1 || $r) ? /* @__PURE__ */ F(wi, {
|
|
3170
3208
|
label: V("camera.flip"),
|
|
3171
3209
|
onClick: r,
|
|
3172
3210
|
children: /* @__PURE__ */ F(Ee, { className: "size-5" })
|
|
@@ -3175,7 +3213,7 @@ function Si({ title: e, onClose: t, camera: n, onFlip: r }) {
|
|
|
3175
3213
|
})
|
|
3176
3214
|
});
|
|
3177
3215
|
}
|
|
3178
|
-
function
|
|
3216
|
+
function Ei({ camera: e, asking: t, children: n, actions: r }) {
|
|
3179
3217
|
return /* @__PURE__ */ I("div", {
|
|
3180
3218
|
className: "relative min-h-0 flex-1 overflow-hidden",
|
|
3181
3219
|
children: [/* @__PURE__ */ F("video", {
|
|
@@ -3192,15 +3230,15 @@ function Ci({ camera: e, asking: t, children: n, actions: r }) {
|
|
|
3192
3230
|
}), r]
|
|
3193
3231
|
}) : e.stream ? n : /* @__PURE__ */ I("div", {
|
|
3194
3232
|
className: "absolute inset-0 flex flex-col items-center justify-center gap-4 px-8 text-center text-white/75",
|
|
3195
|
-
children: [/* @__PURE__ */ F(
|
|
3233
|
+
children: [/* @__PURE__ */ F(Ur, {}), /* @__PURE__ */ F("p", {
|
|
3196
3234
|
className: "max-w-xs text-[0.875rem] leading-relaxed",
|
|
3197
3235
|
children: t
|
|
3198
3236
|
})]
|
|
3199
3237
|
})]
|
|
3200
3238
|
});
|
|
3201
3239
|
}
|
|
3202
|
-
var
|
|
3203
|
-
function
|
|
3240
|
+
var Di = 30;
|
|
3241
|
+
function Oi() {
|
|
3204
3242
|
if (typeof MediaRecorder < "u") return [
|
|
3205
3243
|
"video/mp4;codecs=avc1.42E01E,mp4a.40.2",
|
|
3206
3244
|
"video/mp4",
|
|
@@ -3209,9 +3247,9 @@ function Ti() {
|
|
|
3209
3247
|
"video/webm"
|
|
3210
3248
|
].find((e) => MediaRecorder.isTypeSupported(e));
|
|
3211
3249
|
}
|
|
3212
|
-
var
|
|
3213
|
-
function
|
|
3214
|
-
let [o, s] = M("environment"), [c, l] = M("photo"), [u, d] = M(0), [f, p] = M(!1), [g, _] = M(null), v = j(null), y =
|
|
3250
|
+
var ki = !!Oi();
|
|
3251
|
+
function Ai({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative: a }) {
|
|
3252
|
+
let [o, s] = M("environment"), [c, l] = M("photo"), [u, d] = M(0), [f, p] = M(!1), [g, _] = M(null), v = j(null), y = Si(e, o, c === "video");
|
|
3215
3253
|
A(() => {
|
|
3216
3254
|
e && (d(0), l("photo"), _(null));
|
|
3217
3255
|
}, [e]);
|
|
@@ -3228,11 +3266,11 @@ function Di({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
|
|
|
3228
3266
|
let t = document.createElement("canvas");
|
|
3229
3267
|
t.width = e.videoWidth, t.height = e.videoHeight, t.getContext("2d")?.drawImage(e, 0, 0);
|
|
3230
3268
|
let n = await new Promise((e) => t.toBlob(e, "image/jpeg", .9));
|
|
3231
|
-
n && await b(new File([n], `foto-${
|
|
3269
|
+
n && await b(new File([n], `foto-${yi()}.jpg`, { type: "image/jpeg" }));
|
|
3232
3270
|
}, S = () => {
|
|
3233
3271
|
v.current?.state === "recording" && v.current.stop();
|
|
3234
3272
|
}, C = () => {
|
|
3235
|
-
let e =
|
|
3273
|
+
let e = Oi();
|
|
3236
3274
|
if (!y.stream || !e) return;
|
|
3237
3275
|
let t = [], n = new MediaRecorder(y.stream, {
|
|
3238
3276
|
mimeType: e,
|
|
@@ -3244,13 +3282,13 @@ function Di({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
|
|
|
3244
3282
|
let n = e.split(";")[0];
|
|
3245
3283
|
if (t.length) {
|
|
3246
3284
|
let e = n === "video/mp4" ? "mp4" : "webm";
|
|
3247
|
-
b(new File(t, `video-${
|
|
3285
|
+
b(new File(t, `video-${yi()}.${e}`, { type: n }));
|
|
3248
3286
|
}
|
|
3249
3287
|
}, v.current = n, n.start(1e3), _(0);
|
|
3250
3288
|
};
|
|
3251
3289
|
A(() => {
|
|
3252
3290
|
if (g === null) return;
|
|
3253
|
-
if (g >=
|
|
3291
|
+
if (g >= Di) {
|
|
3254
3292
|
v.current?.state === "recording" && v.current.stop();
|
|
3255
3293
|
return;
|
|
3256
3294
|
}
|
|
@@ -3260,32 +3298,32 @@ function Di({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
|
|
|
3260
3298
|
!e && v.current && (v.current.onstop = null, v.current.stop(), v.current = null);
|
|
3261
3299
|
}, [e]);
|
|
3262
3300
|
let w = (e) => `0:${String(e).padStart(2, "0")}`;
|
|
3263
|
-
return /* @__PURE__ */ I(
|
|
3301
|
+
return /* @__PURE__ */ I(Ci, {
|
|
3264
3302
|
open: e,
|
|
3265
3303
|
onClose: r,
|
|
3266
3304
|
label: V("camera.title"),
|
|
3267
3305
|
children: [
|
|
3268
|
-
/* @__PURE__ */ F(
|
|
3269
|
-
title: g === null ? u ? V("camera.taken", { n: u }) : V("camera.title") : `${w(g)} / ${w(
|
|
3306
|
+
/* @__PURE__ */ F(Ti, {
|
|
3307
|
+
title: g === null ? u ? V("camera.taken", { n: u }) : V("camera.title") : `${w(g)} / ${w(Di)}`,
|
|
3270
3308
|
onClose: r,
|
|
3271
3309
|
camera: y,
|
|
3272
3310
|
onFlip: () => s((e) => e === "environment" ? "user" : "environment")
|
|
3273
3311
|
}),
|
|
3274
|
-
/* @__PURE__ */ F(
|
|
3312
|
+
/* @__PURE__ */ F(Ei, {
|
|
3275
3313
|
camera: y,
|
|
3276
3314
|
asking: V("camera.asking"),
|
|
3277
3315
|
actions: /* @__PURE__ */ I("div", {
|
|
3278
3316
|
className: "flex flex-col gap-2",
|
|
3279
|
-
children: [a ? /* @__PURE__ */ I(
|
|
3317
|
+
children: [a ? /* @__PURE__ */ I(ji, {
|
|
3280
3318
|
onClick: () => {
|
|
3281
3319
|
r(), a();
|
|
3282
3320
|
},
|
|
3283
3321
|
children: [
|
|
3284
3322
|
/* @__PURE__ */ F(m, { className: "size-4" }),
|
|
3285
3323
|
" ",
|
|
3286
|
-
V(
|
|
3324
|
+
V($r ? "camera.native" : "camera.pick")
|
|
3287
3325
|
]
|
|
3288
|
-
}) : null, /* @__PURE__ */ F(
|
|
3326
|
+
}) : null, /* @__PURE__ */ F(ji, {
|
|
3289
3327
|
quiet: !0,
|
|
3290
3328
|
onClick: r,
|
|
3291
3329
|
children: V("common.close")
|
|
@@ -3294,7 +3332,7 @@ function Di({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
|
|
|
3294
3332
|
}),
|
|
3295
3333
|
/* @__PURE__ */ I("div", {
|
|
3296
3334
|
className: q("safe-bottom px-4 pt-3", y.error && "invisible"),
|
|
3297
|
-
children: [n &&
|
|
3335
|
+
children: [n && ki && g === null ? /* @__PURE__ */ F("div", {
|
|
3298
3336
|
className: "mb-3 flex justify-center gap-1 text-[0.8125rem]",
|
|
3299
3337
|
children: ["photo", "video"].map((e) => /* @__PURE__ */ F("button", {
|
|
3300
3338
|
type: "button",
|
|
@@ -3308,7 +3346,7 @@ function Di({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
|
|
|
3308
3346
|
children: [
|
|
3309
3347
|
/* @__PURE__ */ F("span", {
|
|
3310
3348
|
className: "text-[0.8125rem] text-white/70 leading-snug",
|
|
3311
|
-
children: g === null ? c === "video" ? V("camera.clipHint", { s:
|
|
3349
|
+
children: g === null ? c === "video" ? V("camera.clipHint", { s: Di }) : V(t ? "camera.hintMany" : "camera.hint") : V("camera.recording")
|
|
3312
3350
|
}),
|
|
3313
3351
|
/* @__PURE__ */ F("button", {
|
|
3314
3352
|
type: "button",
|
|
@@ -3316,14 +3354,14 @@ function Di({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
|
|
|
3316
3354
|
disabled: !y.stream || f,
|
|
3317
3355
|
onClick: () => c === "photo" ? void x() : g === null ? C() : S(),
|
|
3318
3356
|
className: "flex size-[72px] items-center justify-center rounded-full border-4 border-white transition active:scale-95 disabled:opacity-40",
|
|
3319
|
-
children: f ? /* @__PURE__ */ F(
|
|
3357
|
+
children: f ? /* @__PURE__ */ F(Ur, { className: "text-white" }) : c === "photo" ? /* @__PURE__ */ F("span", { className: "size-[54px] rounded-full bg-white" }) : g === null ? /* @__PURE__ */ F("span", {
|
|
3320
3358
|
className: "flex size-[54px] items-center justify-center rounded-full bg-[#e5484d]",
|
|
3321
3359
|
children: /* @__PURE__ */ F(Ae, { className: "size-6 text-white" })
|
|
3322
3360
|
}) : /* @__PURE__ */ F("span", { className: "size-7 rounded-md bg-[#e5484d]" })
|
|
3323
3361
|
}),
|
|
3324
3362
|
/* @__PURE__ */ F("div", {
|
|
3325
3363
|
className: "flex justify-end",
|
|
3326
|
-
children: t && u && g === null ? /* @__PURE__ */ I(
|
|
3364
|
+
children: t && u && g === null ? /* @__PURE__ */ I(ji, {
|
|
3327
3365
|
onClick: r,
|
|
3328
3366
|
children: [
|
|
3329
3367
|
/* @__PURE__ */ F(h, { className: "size-4" }),
|
|
@@ -3338,7 +3376,7 @@ function Di({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
|
|
|
3338
3376
|
]
|
|
3339
3377
|
});
|
|
3340
3378
|
}
|
|
3341
|
-
function
|
|
3379
|
+
function ji({ onClick: e, quiet: t, children: n }) {
|
|
3342
3380
|
return /* @__PURE__ */ F("button", {
|
|
3343
3381
|
type: "button",
|
|
3344
3382
|
onClick: e,
|
|
@@ -3348,54 +3386,54 @@ function Oi({ onClick: e, quiet: t, children: n }) {
|
|
|
3348
3386
|
}
|
|
3349
3387
|
//#endregion
|
|
3350
3388
|
//#region ../runner/src/data.tsx
|
|
3351
|
-
var
|
|
3352
|
-
function
|
|
3389
|
+
var Mi = "w-full min-w-0 rounded-md bg-transparent px-2 py-1.5 text-[0.875rem] outline-none transition placeholder:text-ink-4 hover:bg-accent focus:bg-paper focus:ring-1 focus:ring-ring", Ni = "font-medium text-[0.6875rem] text-ink-3 uppercase tracking-[0.08em]", Pi = (e) => !!e && typeof e == "object" && !Array.isArray(e);
|
|
3390
|
+
function Fi(e, t, n) {
|
|
3353
3391
|
if (!t.length) return n;
|
|
3354
3392
|
let [r, ...i] = t;
|
|
3355
3393
|
if (Array.isArray(e)) {
|
|
3356
3394
|
let t = [...e];
|
|
3357
|
-
return t[r] =
|
|
3395
|
+
return t[r] = Fi(t[r], i, n), t;
|
|
3358
3396
|
}
|
|
3359
3397
|
let a = e ?? {};
|
|
3360
3398
|
return {
|
|
3361
3399
|
...a,
|
|
3362
|
-
[r]:
|
|
3400
|
+
[r]: Fi(a[r], i, n)
|
|
3363
3401
|
};
|
|
3364
3402
|
}
|
|
3365
|
-
function
|
|
3366
|
-
let n = e?.length ? e : [...new Set(t.filter(
|
|
3403
|
+
function Ii(e, t) {
|
|
3404
|
+
let n = e?.length ? e : [...new Set(t.filter(Pi).flatMap((e) => Object.keys(e)))];
|
|
3367
3405
|
return {
|
|
3368
3406
|
kind: "object",
|
|
3369
3407
|
fields: Object.fromEntries(n.map((e) => [e, { kind: "text" }]))
|
|
3370
3408
|
};
|
|
3371
3409
|
}
|
|
3372
|
-
var
|
|
3373
|
-
function
|
|
3410
|
+
var Li = (e) => e.kind !== "object" && e.kind !== "table" && (e.kind !== "list" || e.of.kind !== "object") && !(e.kind === "text" && e.long), Ri = (e) => Object.values(e.fields).every(Li), zi = (e) => Object.values(e.fields).every((e) => e.kind !== "table" && (e.kind !== "list" || e.of.kind !== "object"));
|
|
3411
|
+
function Bi(e, t) {
|
|
3374
3412
|
let n = jt(e);
|
|
3375
3413
|
return n ? String(t[n] ?? "") : "";
|
|
3376
3414
|
}
|
|
3377
|
-
function
|
|
3415
|
+
function Vi({ text: e }) {
|
|
3378
3416
|
return /* @__PURE__ */ F("span", {
|
|
3379
3417
|
className: "whitespace-pre-wrap",
|
|
3380
3418
|
children: e
|
|
3381
3419
|
});
|
|
3382
3420
|
}
|
|
3383
|
-
function
|
|
3421
|
+
function Hi({ shape: e, value: t, path: n, ctx: r, cell: i }) {
|
|
3384
3422
|
switch (e.kind) {
|
|
3385
3423
|
case "text": return r.edit ? e.long ? /* @__PURE__ */ F("textarea", {
|
|
3386
|
-
className: q(
|
|
3424
|
+
className: q(Mi, "field-sizing-content max-h-60 resize-none"),
|
|
3387
3425
|
value: String(t ?? ""),
|
|
3388
3426
|
onChange: (e) => r.set(n, e.target.value)
|
|
3389
3427
|
}) : /* @__PURE__ */ F("input", {
|
|
3390
|
-
className:
|
|
3428
|
+
className: Mi,
|
|
3391
3429
|
value: String(t ?? ""),
|
|
3392
3430
|
onChange: (e) => r.set(n, e.target.value)
|
|
3393
|
-
}) : /* @__PURE__ */ F(
|
|
3431
|
+
}) : /* @__PURE__ */ F(Vi, { text: t == null ? "" : String(t) });
|
|
3394
3432
|
case "number": return r.edit ? /* @__PURE__ */ I("span", {
|
|
3395
3433
|
className: "flex items-center gap-1",
|
|
3396
3434
|
children: [/* @__PURE__ */ F("input", {
|
|
3397
3435
|
type: "number",
|
|
3398
|
-
className: q(
|
|
3436
|
+
className: q(Mi, "text-right tabular-nums", i && "w-20"),
|
|
3399
3437
|
value: t == null ? "" : Number(t),
|
|
3400
3438
|
onChange: (e) => r.set(n, e.target.value === "" ? null : Number(e.target.value))
|
|
3401
3439
|
}), e.unit ? /* @__PURE__ */ F("span", {
|
|
@@ -3423,7 +3461,7 @@ function zi({ shape: e, value: t, path: n, ctx: r, cell: i }) {
|
|
|
3423
3461
|
}
|
|
3424
3462
|
case "choice":
|
|
3425
3463
|
case "score": return r.edit ? /* @__PURE__ */ F("select", {
|
|
3426
|
-
className:
|
|
3464
|
+
className: Mi,
|
|
3427
3465
|
value: String(t ?? ""),
|
|
3428
3466
|
onChange: (e) => r.set(n, e.target.value),
|
|
3429
3467
|
children: [.../* @__PURE__ */ new Set([String(t ?? ""), ...e.options])].map((e) => /* @__PURE__ */ F("option", {
|
|
@@ -3435,9 +3473,9 @@ function zi({ shape: e, value: t, path: n, ctx: r, cell: i }) {
|
|
|
3435
3473
|
let i = r.shape.fields[e.to], a = i?.kind === "list" && i.of.kind === "object" ? i.of : {
|
|
3436
3474
|
kind: "object",
|
|
3437
3475
|
fields: {}
|
|
3438
|
-
}, o = (Array.isArray(r.root[e.to]) ? r.root[e.to] : []).filter(
|
|
3476
|
+
}, o = (Array.isArray(r.root[e.to]) ? r.root[e.to] : []).filter(Pi), s = o.find((e) => e.id === t);
|
|
3439
3477
|
return r.edit ? /* @__PURE__ */ I("select", {
|
|
3440
|
-
className:
|
|
3478
|
+
className: Mi,
|
|
3441
3479
|
value: String(t ?? ""),
|
|
3442
3480
|
onChange: (e) => r.set(n, e.target.value),
|
|
3443
3481
|
children: [s ? null : /* @__PURE__ */ F("option", {
|
|
@@ -3445,13 +3483,13 @@ function zi({ shape: e, value: t, path: n, ctx: r, cell: i }) {
|
|
|
3445
3483
|
children: String(t ?? "")
|
|
3446
3484
|
}), o.map((e) => /* @__PURE__ */ F("option", {
|
|
3447
3485
|
value: String(e.id),
|
|
3448
|
-
children:
|
|
3486
|
+
children: Bi(a, e) || String(e.id)
|
|
3449
3487
|
}, String(e.id)))]
|
|
3450
3488
|
}) : s ? /* @__PURE__ */ I("button", {
|
|
3451
3489
|
type: "button",
|
|
3452
3490
|
onClick: () => r.open(String(s.id)),
|
|
3453
3491
|
className: "inline-flex items-center gap-1 text-left text-ember-strong hover:underline",
|
|
3454
|
-
children: [/* @__PURE__ */ F(
|
|
3492
|
+
children: [/* @__PURE__ */ F(ie, { className: "size-3.5 shrink-0" }), Bi(a, s) || String(s.id)]
|
|
3455
3493
|
}) : /* @__PURE__ */ F("span", {
|
|
3456
3494
|
className: "text-rose",
|
|
3457
3495
|
children: V("data.missing", { id: String(t ?? "") })
|
|
@@ -3459,8 +3497,8 @@ function zi({ shape: e, value: t, path: n, ctx: r, cell: i }) {
|
|
|
3459
3497
|
}
|
|
3460
3498
|
case "table": {
|
|
3461
3499
|
let i = Array.isArray(t) ? t : [];
|
|
3462
|
-
return /* @__PURE__ */ F(
|
|
3463
|
-
shape:
|
|
3500
|
+
return /* @__PURE__ */ F(Ki, {
|
|
3501
|
+
shape: Ii(e.columns, i),
|
|
3464
3502
|
value: i,
|
|
3465
3503
|
path: n,
|
|
3466
3504
|
ctx: r
|
|
@@ -3468,7 +3506,7 @@ function zi({ shape: e, value: t, path: n, ctx: r, cell: i }) {
|
|
|
3468
3506
|
}
|
|
3469
3507
|
case "list":
|
|
3470
3508
|
if (e.of.kind === "object") {
|
|
3471
|
-
let i = e.of, a =
|
|
3509
|
+
let i = e.of, a = Ri(i) ? Ki : zi(i) ? qi : Ji;
|
|
3472
3510
|
return /* @__PURE__ */ F(a, {
|
|
3473
3511
|
shape: i,
|
|
3474
3512
|
value: t,
|
|
@@ -3476,12 +3514,12 @@ function zi({ shape: e, value: t, path: n, ctx: r, cell: i }) {
|
|
|
3476
3514
|
ctx: r
|
|
3477
3515
|
});
|
|
3478
3516
|
}
|
|
3479
|
-
return /* @__PURE__ */ F(
|
|
3517
|
+
return /* @__PURE__ */ F(Ui, {
|
|
3480
3518
|
value: t,
|
|
3481
3519
|
path: n,
|
|
3482
3520
|
ctx: r
|
|
3483
3521
|
});
|
|
3484
|
-
case "object": return /* @__PURE__ */ F(
|
|
3522
|
+
case "object": return /* @__PURE__ */ F(Yi, {
|
|
3485
3523
|
shape: e,
|
|
3486
3524
|
value: t,
|
|
3487
3525
|
path: n,
|
|
@@ -3489,7 +3527,7 @@ function zi({ shape: e, value: t, path: n, ctx: r, cell: i }) {
|
|
|
3489
3527
|
});
|
|
3490
3528
|
}
|
|
3491
3529
|
}
|
|
3492
|
-
function
|
|
3530
|
+
function Ui({ value: e, path: t, ctx: n }) {
|
|
3493
3531
|
let r = Array.isArray(e) ? e.map(String) : [], [i, a] = M("");
|
|
3494
3532
|
return /* @__PURE__ */ I("span", {
|
|
3495
3533
|
className: "flex flex-wrap items-center gap-1",
|
|
@@ -3513,9 +3551,9 @@ function Bi({ value: e, path: t, ctx: n }) {
|
|
|
3513
3551
|
}) : null]
|
|
3514
3552
|
});
|
|
3515
3553
|
}
|
|
3516
|
-
var
|
|
3517
|
-
function
|
|
3518
|
-
let i =
|
|
3554
|
+
var Wi = (e) => (Array.isArray(e) ? e : []).filter(Pi), Gi = (e) => e.fields.id ? { id: `n${Date.now().toString(36)}` } : {};
|
|
3555
|
+
function Ki({ shape: e, value: t, path: n, ctx: r }) {
|
|
3556
|
+
let i = Wi(t), a = Object.entries(e.fields);
|
|
3519
3557
|
return /* @__PURE__ */ I("div", {
|
|
3520
3558
|
className: "overflow-x-auto rounded-lg ring-1 ring-border-soft",
|
|
3521
3559
|
children: [/* @__PURE__ */ I("table", {
|
|
@@ -3530,7 +3568,7 @@ function Ui({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3530
3568
|
className: "group border-border-soft border-t",
|
|
3531
3569
|
children: [a.map(([i, a]) => /* @__PURE__ */ F("td", {
|
|
3532
3570
|
className: q("align-top", r.edit ? "p-0.5" : "px-3 py-2"),
|
|
3533
|
-
children: /* @__PURE__ */ F(
|
|
3571
|
+
children: /* @__PURE__ */ F(Hi, {
|
|
3534
3572
|
shape: a,
|
|
3535
3573
|
value: e[i],
|
|
3536
3574
|
path: [
|
|
@@ -3543,17 +3581,17 @@ function Ui({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3543
3581
|
})
|
|
3544
3582
|
}, i)), r.edit ? /* @__PURE__ */ F("td", {
|
|
3545
3583
|
className: "p-0.5 align-middle",
|
|
3546
|
-
children: /* @__PURE__ */ F(
|
|
3584
|
+
children: /* @__PURE__ */ F(Zi, { onClick: () => r.set(n, i.filter((e, n) => n !== t)) })
|
|
3547
3585
|
}) : null]
|
|
3548
3586
|
}, t)) })]
|
|
3549
|
-
}), r.edit ? /* @__PURE__ */ F(
|
|
3587
|
+
}), r.edit ? /* @__PURE__ */ F(Qi, {
|
|
3550
3588
|
what: e.label,
|
|
3551
|
-
onClick: () => r.set(n, [...i,
|
|
3589
|
+
onClick: () => r.set(n, [...i, Gi(e)])
|
|
3552
3590
|
}) : null]
|
|
3553
3591
|
});
|
|
3554
3592
|
}
|
|
3555
|
-
function
|
|
3556
|
-
let i =
|
|
3593
|
+
function qi({ shape: e, value: t, path: n, ctx: r }) {
|
|
3594
|
+
let i = Wi(t), a = Object.entries(e.fields), o = a.filter(([, e]) => e.kind === "text" && e.long), s = a.filter(([, e]) => !(e.kind === "text" && e.long));
|
|
3557
3595
|
return /* @__PURE__ */ I("div", {
|
|
3558
3596
|
className: "overflow-hidden rounded-lg ring-1 ring-border-soft",
|
|
3559
3597
|
children: [/* @__PURE__ */ F("ol", { children: i.map((e, t) => /* @__PURE__ */ I("li", {
|
|
@@ -3565,7 +3603,7 @@ function Wi({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3565
3603
|
}),
|
|
3566
3604
|
/* @__PURE__ */ F("div", {
|
|
3567
3605
|
className: q("flex min-w-0 flex-col", !r.edit && "pt-1"),
|
|
3568
|
-
children: o.map(([i, a]) => /* @__PURE__ */ F(
|
|
3606
|
+
children: o.map(([i, a]) => /* @__PURE__ */ F(Hi, {
|
|
3569
3607
|
shape: a,
|
|
3570
3608
|
value: e[i],
|
|
3571
3609
|
path: [
|
|
@@ -3578,7 +3616,7 @@ function Wi({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3578
3616
|
}),
|
|
3579
3617
|
/* @__PURE__ */ I("div", {
|
|
3580
3618
|
className: q("flex items-center gap-2 text-[0.8125rem] text-ink-3", !r.edit && "pt-1"),
|
|
3581
|
-
children: [s.map(([i, a]) => /* @__PURE__ */ F(
|
|
3619
|
+
children: [s.map(([i, a]) => /* @__PURE__ */ F(Hi, {
|
|
3582
3620
|
shape: a,
|
|
3583
3621
|
value: e[i],
|
|
3584
3622
|
path: [
|
|
@@ -3588,17 +3626,17 @@ function Wi({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3588
3626
|
],
|
|
3589
3627
|
ctx: r,
|
|
3590
3628
|
cell: !0
|
|
3591
|
-
}, i)), r.edit ? /* @__PURE__ */ F(
|
|
3629
|
+
}, i)), r.edit ? /* @__PURE__ */ F(Zi, { onClick: () => r.set(n, i.filter((e, n) => n !== t)) }) : null]
|
|
3592
3630
|
})
|
|
3593
3631
|
]
|
|
3594
|
-
}, t)) }), r.edit ? /* @__PURE__ */ F(
|
|
3632
|
+
}, t)) }), r.edit ? /* @__PURE__ */ F(Qi, {
|
|
3595
3633
|
what: e.label,
|
|
3596
|
-
onClick: () => r.set(n, [...i,
|
|
3634
|
+
onClick: () => r.set(n, [...i, Gi(e)])
|
|
3597
3635
|
}) : null]
|
|
3598
3636
|
});
|
|
3599
3637
|
}
|
|
3600
|
-
function
|
|
3601
|
-
let i =
|
|
3638
|
+
function Ji({ shape: e, value: t, path: n, ctx: r }) {
|
|
3639
|
+
let i = Wi(t), a = Object.entries(e.fields), o = jt(e), s = a.filter(([e, t]) => e !== o && e !== "id" && (t.kind === "text" && !t.long || t.kind === "number" || t.kind === "choice")), c = a.filter(([, e]) => e.kind === "list" && e.of.kind === "object");
|
|
3602
3640
|
return /* @__PURE__ */ I("div", {
|
|
3603
3641
|
className: "flex flex-col gap-2",
|
|
3604
3642
|
children: [i.map((t, a) => {
|
|
@@ -3614,7 +3652,7 @@ function Gi({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3614
3652
|
className: "min-w-0 flex-1",
|
|
3615
3653
|
children: [/* @__PURE__ */ F("span", {
|
|
3616
3654
|
className: "block truncate font-medium text-[0.9375rem]",
|
|
3617
|
-
children:
|
|
3655
|
+
children: Bi(e, t) || `${e.label ?? ""} ${a + 1}`.trim()
|
|
3618
3656
|
}), /* @__PURE__ */ I("span", {
|
|
3619
3657
|
className: "flex flex-wrap gap-x-2 text-[0.75rem] text-ink-3",
|
|
3620
3658
|
children: [s.map(([e, n]) => t[e] === void 0 || t[e] === "" ? null : /* @__PURE__ */ F("span", { children: n.kind === "number" && n.unit ? `${t[e]} ${n.unit}` : String(t[e]) }, e)), c.map(([e, n]) => /* @__PURE__ */ I("span", { children: [
|
|
@@ -3624,11 +3662,11 @@ function Gi({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3624
3662
|
] }, e))]
|
|
3625
3663
|
})]
|
|
3626
3664
|
}),
|
|
3627
|
-
r.edit ? /* @__PURE__ */ F(
|
|
3665
|
+
r.edit ? /* @__PURE__ */ F(Zi, { onClick: () => r.set(n, i.filter((e, t) => t !== a)) }) : null
|
|
3628
3666
|
]
|
|
3629
3667
|
}), /* @__PURE__ */ F("div", {
|
|
3630
3668
|
className: "border-border-soft border-t px-4 py-4",
|
|
3631
|
-
children: /* @__PURE__ */ F(
|
|
3669
|
+
children: /* @__PURE__ */ F(Yi, {
|
|
3632
3670
|
shape: e,
|
|
3633
3671
|
value: t,
|
|
3634
3672
|
path: [...n, a],
|
|
@@ -3636,21 +3674,21 @@ function Gi({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3636
3674
|
})
|
|
3637
3675
|
})]
|
|
3638
3676
|
}, a);
|
|
3639
|
-
}), r.edit ? /* @__PURE__ */ F(
|
|
3677
|
+
}), r.edit ? /* @__PURE__ */ F(Qi, {
|
|
3640
3678
|
what: e.label,
|
|
3641
|
-
onClick: () => r.set(n, [...i,
|
|
3679
|
+
onClick: () => r.set(n, [...i, Gi(e)])
|
|
3642
3680
|
}) : null]
|
|
3643
3681
|
});
|
|
3644
3682
|
}
|
|
3645
|
-
function
|
|
3646
|
-
let i =
|
|
3683
|
+
function Yi({ shape: e, value: t, path: n, ctx: r }) {
|
|
3684
|
+
let i = Pi(t) ? t : {}, a = (e) => e.kind === "list" || e.kind === "object" || e.kind === "table" || e.kind === "text" && !!e.long;
|
|
3647
3685
|
return /* @__PURE__ */ F("div", {
|
|
3648
3686
|
className: "grid grid-cols-[repeat(auto-fill,minmax(10rem,1fr))] gap-x-4 gap-y-4",
|
|
3649
|
-
children: Object.entries(e.fields).map(([e, t]) => /* @__PURE__ */ F(
|
|
3687
|
+
children: Object.entries(e.fields).map(([e, t]) => /* @__PURE__ */ F(Xi, {
|
|
3650
3688
|
title: L(e, t),
|
|
3651
3689
|
wide: a(t),
|
|
3652
3690
|
count: Array.isArray(i[e]) ? i[e].length : null,
|
|
3653
|
-
children: /* @__PURE__ */ F(
|
|
3691
|
+
children: /* @__PURE__ */ F(Hi, {
|
|
3654
3692
|
shape: t,
|
|
3655
3693
|
value: i[e],
|
|
3656
3694
|
path: [...n, e],
|
|
@@ -3659,11 +3697,11 @@ function Ki({ shape: e, value: t, path: n, ctx: r }) {
|
|
|
3659
3697
|
}, e))
|
|
3660
3698
|
});
|
|
3661
3699
|
}
|
|
3662
|
-
function
|
|
3700
|
+
function Xi({ title: e, wide: t, count: n, children: r }) {
|
|
3663
3701
|
return /* @__PURE__ */ I("div", {
|
|
3664
3702
|
className: q("flex min-w-0 flex-col gap-1.5 text-[0.875rem]", t && "col-span-full"),
|
|
3665
3703
|
children: [/* @__PURE__ */ I("span", {
|
|
3666
|
-
className:
|
|
3704
|
+
className: Ni,
|
|
3667
3705
|
children: [e, n === null ? null : /* @__PURE__ */ F("span", {
|
|
3668
3706
|
className: "ml-1 text-ink-4",
|
|
3669
3707
|
children: n
|
|
@@ -3671,7 +3709,7 @@ function qi({ title: e, wide: t, count: n, children: r }) {
|
|
|
3671
3709
|
}), r]
|
|
3672
3710
|
});
|
|
3673
3711
|
}
|
|
3674
|
-
function
|
|
3712
|
+
function Zi({ onClick: e }) {
|
|
3675
3713
|
return /* @__PURE__ */ F("button", {
|
|
3676
3714
|
type: "button",
|
|
3677
3715
|
"aria-label": V("data.remove"),
|
|
@@ -3682,7 +3720,7 @@ function Ji({ onClick: e }) {
|
|
|
3682
3720
|
children: /* @__PURE__ */ F(De, { className: "size-3.5" })
|
|
3683
3721
|
});
|
|
3684
3722
|
}
|
|
3685
|
-
function
|
|
3723
|
+
function Qi({ what: e, onClick: t }) {
|
|
3686
3724
|
return /* @__PURE__ */ I("button", {
|
|
3687
3725
|
type: "button",
|
|
3688
3726
|
onClick: t,
|
|
@@ -3694,7 +3732,7 @@ function Yi({ what: e, onClick: t }) {
|
|
|
3694
3732
|
]
|
|
3695
3733
|
});
|
|
3696
3734
|
}
|
|
3697
|
-
function
|
|
3735
|
+
function $i({ shape: e, value: t, onChange: n, mode: r, onMode: i, modes: a = [
|
|
3698
3736
|
"view",
|
|
3699
3737
|
"edit",
|
|
3700
3738
|
"json"
|
|
@@ -3704,7 +3742,7 @@ function Xi({ shape: e, value: t, onChange: n, mode: r, onMode: i, modes: a = [
|
|
|
3704
3742
|
shape: e,
|
|
3705
3743
|
edit: u === "edit" && !!n,
|
|
3706
3744
|
scope: f,
|
|
3707
|
-
set: (e, r) => n?.(
|
|
3745
|
+
set: (e, r) => n?.(Fi(t, e, r)),
|
|
3708
3746
|
open: (e) => {
|
|
3709
3747
|
let t = document.getElementById(`${f}-${e}`);
|
|
3710
3748
|
t && (t.open = !0, t.scrollIntoView({
|
|
@@ -3727,7 +3765,7 @@ function Xi({ shape: e, value: t, onChange: n, mode: r, onMode: i, modes: a = [
|
|
|
3727
3765
|
children: t[e].length
|
|
3728
3766
|
}) : null]
|
|
3729
3767
|
}, e)) : null
|
|
3730
|
-
}), s.length > 1 ? /* @__PURE__ */ F(
|
|
3768
|
+
}), s.length > 1 ? /* @__PURE__ */ F(Br, {
|
|
3731
3769
|
value: u,
|
|
3732
3770
|
onChange: d,
|
|
3733
3771
|
label: V("data.modes"),
|
|
@@ -3752,7 +3790,7 @@ function Xi({ shape: e, value: t, onChange: n, mode: r, onMode: i, modes: a = [
|
|
|
3752
3790
|
}) : null]
|
|
3753
3791
|
}), /* @__PURE__ */ F("div", {
|
|
3754
3792
|
className: "text-[0.9375rem] leading-relaxed",
|
|
3755
|
-
children: /* @__PURE__ */ F(
|
|
3793
|
+
children: /* @__PURE__ */ F(Hi, {
|
|
3756
3794
|
shape: n,
|
|
3757
3795
|
value: t[e],
|
|
3758
3796
|
path: [e],
|
|
@@ -3763,7 +3801,7 @@ function Xi({ shape: e, value: t, onChange: n, mode: r, onMode: i, modes: a = [
|
|
|
3763
3801
|
})]
|
|
3764
3802
|
});
|
|
3765
3803
|
}
|
|
3766
|
-
function
|
|
3804
|
+
function ea({ items: e }) {
|
|
3767
3805
|
let [t, n] = M(!1), r = j(null);
|
|
3768
3806
|
return A(() => {
|
|
3769
3807
|
if (!t) return;
|
|
@@ -3800,12 +3838,12 @@ function Zi({ items: e }) {
|
|
|
3800
3838
|
}) : null]
|
|
3801
3839
|
});
|
|
3802
3840
|
}
|
|
3803
|
-
function
|
|
3841
|
+
function ta(e) {
|
|
3804
3842
|
return e.toLowerCase().replace(/ä/g, "ae").replace(/ö/g, "oe").replace(/ü/g, "ue").replace(/ß/g, "ss").replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "output";
|
|
3805
3843
|
}
|
|
3806
|
-
function
|
|
3844
|
+
function na({ shape: e, title: t, open: n, onClose: r }) {
|
|
3807
3845
|
let [i, a] = M(!1), o = n ? JSON.stringify(Ft(e, t), null, 2) : "";
|
|
3808
|
-
return /* @__PURE__ */ F(
|
|
3846
|
+
return /* @__PURE__ */ F(Gr, {
|
|
3809
3847
|
open: n,
|
|
3810
3848
|
onClose: r,
|
|
3811
3849
|
title: `${V("data.schema")} · ${t}`,
|
|
@@ -3829,7 +3867,7 @@ function $i({ shape: e, title: t, open: n, onClose: r }) {
|
|
|
3829
3867
|
type: "button",
|
|
3830
3868
|
onClick: () => {
|
|
3831
3869
|
let e = URL.createObjectURL(new Blob([o], { type: "application/schema+json" })), n = document.createElement("a");
|
|
3832
|
-
n.href = e, n.download = `${
|
|
3870
|
+
n.href = e, n.download = `${ta(t)}.schema.json`, n.click(), setTimeout(() => URL.revokeObjectURL(e), 1e3);
|
|
3833
3871
|
},
|
|
3834
3872
|
className: "inline-flex h-8 items-center gap-1.5 rounded-full bg-paper-2 px-3 text-[0.8125rem] text-ink-2 hover:text-ink coarse:h-11 coarse:px-4",
|
|
3835
3873
|
children: [
|
|
@@ -3842,12 +3880,12 @@ function $i({ shape: e, title: t, open: n, onClose: r }) {
|
|
|
3842
3880
|
})
|
|
3843
3881
|
});
|
|
3844
3882
|
}
|
|
3845
|
-
function
|
|
3883
|
+
function ra(e) {
|
|
3846
3884
|
let t = e;
|
|
3847
3885
|
return t.type === "agent" && t.output.format === "json" && !t.each && !t.call;
|
|
3848
3886
|
}
|
|
3849
|
-
function
|
|
3850
|
-
let a = Fn(t), [o, s] = M(!1), [c, l] = M(!1), [u, d] = M(null), [f, m] = M(!1), [h, g] = M(null), _ = u ?? (
|
|
3887
|
+
function ia({ runId: e, step: t, output: n, header: r, children: i }) {
|
|
3888
|
+
let a = Fn(t), [o, s] = M(!1), [c, l] = M(!1), [u, d] = M(null), [f, m] = M(!1), [h, g] = M(null), _ = u ?? (Pi(n.json) ? n.json : {}), v = async () => {
|
|
3851
3889
|
if (u) {
|
|
3852
3890
|
m(!0), g(null);
|
|
3853
3891
|
try {
|
|
@@ -3858,7 +3896,7 @@ function ta({ runId: e, step: t, output: n, header: r, children: i }) {
|
|
|
3858
3896
|
m(!1);
|
|
3859
3897
|
}
|
|
3860
3898
|
}
|
|
3861
|
-
}, y = /* @__PURE__ */ F(
|
|
3899
|
+
}, y = /* @__PURE__ */ F(ea, { items: [{
|
|
3862
3900
|
label: V(o ? "data.close" : "data.open"),
|
|
3863
3901
|
icon: /* @__PURE__ */ F(b, { className: "size-4 shrink-0" }),
|
|
3864
3902
|
onClick: () => {
|
|
@@ -3873,7 +3911,7 @@ function ta({ runId: e, step: t, output: n, header: r, children: i }) {
|
|
|
3873
3911
|
r(y),
|
|
3874
3912
|
o ? /* @__PURE__ */ I("div", {
|
|
3875
3913
|
className: "overflow-hidden rounded-xl bg-card ring-1 ring-border-soft",
|
|
3876
|
-
children: [/* @__PURE__ */ F(
|
|
3914
|
+
children: [/* @__PURE__ */ F($i, {
|
|
3877
3915
|
shape: a,
|
|
3878
3916
|
value: _,
|
|
3879
3917
|
onChange: d
|
|
@@ -3899,7 +3937,7 @@ function ta({ runId: e, step: t, output: n, header: r, children: i }) {
|
|
|
3899
3937
|
]
|
|
3900
3938
|
}) : null]
|
|
3901
3939
|
}) : i,
|
|
3902
|
-
/* @__PURE__ */ F(
|
|
3940
|
+
/* @__PURE__ */ F(na, {
|
|
3903
3941
|
shape: a,
|
|
3904
3942
|
title: t.title,
|
|
3905
3943
|
open: c,
|
|
@@ -3909,11 +3947,11 @@ function ta({ runId: e, step: t, output: n, header: r, children: i }) {
|
|
|
3909
3947
|
}
|
|
3910
3948
|
//#endregion
|
|
3911
3949
|
//#region ../runner/src/location.tsx
|
|
3912
|
-
var
|
|
3913
|
-
function
|
|
3950
|
+
var aa = 25, oa = 9e3;
|
|
3951
|
+
function sa(e) {
|
|
3914
3952
|
return e.code === e.PERMISSION_DENIED ? "denied" : e.code === e.TIMEOUT ? "timeout" : "unavailable";
|
|
3915
3953
|
}
|
|
3916
|
-
function
|
|
3954
|
+
function ca({ value: e, runId: t, placeholder: n, onChange: r, onBusy: i }) {
|
|
3917
3955
|
let a = $t(e) ? e : null, [o, s] = M(!1), [c, l] = M(null), u = j(null), d = j(!!a?.label), f = j(a);
|
|
3918
3956
|
f.current = a;
|
|
3919
3957
|
let p = a?.lat !== void 0 && a.lng !== void 0, m = typeof navigator < "u" && "geolocation" in navigator, h = () => {
|
|
@@ -3949,13 +3987,13 @@ function aa({ value: e, runId: t, placeholder: n, onChange: r, onBusy: i }) {
|
|
|
3949
3987
|
};
|
|
3950
3988
|
f.current = c, r(c);
|
|
3951
3989
|
}
|
|
3952
|
-
if (t <=
|
|
3990
|
+
if (t <= aa || Date.now() - e > oa) {
|
|
3953
3991
|
h();
|
|
3954
3992
|
let e = f.current;
|
|
3955
3993
|
e?.lat !== void 0 && e.lng !== void 0 && g(e.lat, e.lng);
|
|
3956
3994
|
}
|
|
3957
3995
|
}, (e) => {
|
|
3958
|
-
h(), t === Infinity && l(
|
|
3996
|
+
h(), t === Infinity && l(sa(e));
|
|
3959
3997
|
}, {
|
|
3960
3998
|
enableHighAccuracy: !0,
|
|
3961
3999
|
timeout: 15e3,
|
|
@@ -4035,9 +4073,9 @@ function aa({ value: e, runId: t, placeholder: n, onChange: r, onBusy: i }) {
|
|
|
4035
4073
|
}
|
|
4036
4074
|
//#endregion
|
|
4037
4075
|
//#region ../runner/src/scan.tsx
|
|
4038
|
-
var
|
|
4039
|
-
function
|
|
4040
|
-
return
|
|
4076
|
+
var la = null;
|
|
4077
|
+
function ua() {
|
|
4078
|
+
return la ??= (async () => {
|
|
4041
4079
|
let e = window.BarcodeDetector;
|
|
4042
4080
|
if (e) try {
|
|
4043
4081
|
let t = await e.getSupportedFormats();
|
|
@@ -4063,33 +4101,33 @@ function sa() {
|
|
|
4063
4101
|
}
|
|
4064
4102
|
}
|
|
4065
4103
|
};
|
|
4066
|
-
})(),
|
|
4104
|
+
})(), la;
|
|
4067
4105
|
}
|
|
4068
|
-
function
|
|
4106
|
+
function da({ open: e, onClose: t, onResult: n }) {
|
|
4069
4107
|
let r = j(n);
|
|
4070
4108
|
r.current = n;
|
|
4071
4109
|
let i = j(t);
|
|
4072
4110
|
return i.current = t, A(() => {
|
|
4073
|
-
e &&
|
|
4111
|
+
e && Or("scan").then((e) => {
|
|
4074
4112
|
e && r.current(e);
|
|
4075
4113
|
}).catch(() => void 0).finally(() => i.current());
|
|
4076
4114
|
}, [e]), null;
|
|
4077
4115
|
}
|
|
4078
|
-
function
|
|
4079
|
-
return K("scan") ? /* @__PURE__ */ F(
|
|
4116
|
+
function fa(e) {
|
|
4117
|
+
return K("scan") ? /* @__PURE__ */ F(da, { ...e }) : /* @__PURE__ */ F(pa, { ...e });
|
|
4080
4118
|
}
|
|
4081
|
-
function
|
|
4082
|
-
let [r, i] = M("environment"), [a, o] = M(!1), [s, c] = M(!1), l = j(null), u =
|
|
4119
|
+
function pa({ open: e, onClose: t, onResult: n }) {
|
|
4120
|
+
let [r, i] = M("environment"), [a, o] = M(!1), [s, c] = M(!1), l = j(null), u = Si(e, r), d = j(n);
|
|
4083
4121
|
d.current = n;
|
|
4084
4122
|
let f = j(t);
|
|
4085
4123
|
f.current = t, A(() => {
|
|
4086
|
-
e && (c(!1),
|
|
4124
|
+
e && (c(!1), ua().then((e) => o(e.qrOnly)));
|
|
4087
4125
|
}, [e]), A(() => {
|
|
4088
4126
|
if (!e || !u.stream) return;
|
|
4089
4127
|
let t = !1, n, r = async () => {
|
|
4090
4128
|
let e = u.video.current;
|
|
4091
4129
|
if (!t && e && e.readyState >= 2 && e.videoWidth) {
|
|
4092
|
-
let n = await (await
|
|
4130
|
+
let n = await (await ua()).detect(e).catch(() => null);
|
|
4093
4131
|
if (n && !t) {
|
|
4094
4132
|
navigator.vibrate?.(60), d.current(n), f.current();
|
|
4095
4133
|
return;
|
|
@@ -4108,33 +4146,33 @@ function ua({ open: e, onClose: t, onResult: n }) {
|
|
|
4108
4146
|
let p = async (e) => {
|
|
4109
4147
|
if (!e) return;
|
|
4110
4148
|
c(!1);
|
|
4111
|
-
let r = await createImageBitmap(e).catch(() => null), i = r ? await (await
|
|
4149
|
+
let r = await createImageBitmap(e).catch(() => null), i = r ? await (await ua()).detect(r).catch(() => null) : null;
|
|
4112
4150
|
i ? (n(i), t()) : c(!0);
|
|
4113
4151
|
};
|
|
4114
|
-
return /* @__PURE__ */ I(
|
|
4152
|
+
return /* @__PURE__ */ I(Ci, {
|
|
4115
4153
|
open: e,
|
|
4116
4154
|
onClose: t,
|
|
4117
4155
|
label: V("scan.title"),
|
|
4118
4156
|
children: [
|
|
4119
|
-
/* @__PURE__ */ F(
|
|
4157
|
+
/* @__PURE__ */ F(Ti, {
|
|
4120
4158
|
title: V("scan.title"),
|
|
4121
4159
|
onClose: t,
|
|
4122
4160
|
camera: u,
|
|
4123
4161
|
onFlip: () => i((e) => e === "environment" ? "user" : "environment")
|
|
4124
4162
|
}),
|
|
4125
|
-
/* @__PURE__ */ F(
|
|
4163
|
+
/* @__PURE__ */ F(Ei, {
|
|
4126
4164
|
camera: u,
|
|
4127
4165
|
asking: V("scan.asking"),
|
|
4128
4166
|
actions: /* @__PURE__ */ I("div", {
|
|
4129
4167
|
className: "flex flex-col gap-2",
|
|
4130
|
-
children: [/* @__PURE__ */ I(
|
|
4168
|
+
children: [/* @__PURE__ */ I(ji, {
|
|
4131
4169
|
onClick: () => l.current?.click(),
|
|
4132
4170
|
children: [
|
|
4133
|
-
/* @__PURE__ */ F(
|
|
4171
|
+
/* @__PURE__ */ F(D, { className: "size-4" }),
|
|
4134
4172
|
" ",
|
|
4135
4173
|
V("scan.fromPhoto")
|
|
4136
4174
|
]
|
|
4137
|
-
}), /* @__PURE__ */ F(
|
|
4175
|
+
}), /* @__PURE__ */ F(ji, {
|
|
4138
4176
|
quiet: !0,
|
|
4139
4177
|
onClick: t,
|
|
4140
4178
|
children: V("scan.typeInstead")
|
|
@@ -4150,11 +4188,11 @@ function ua({ open: e, onClose: t, onResult: n }) {
|
|
|
4150
4188
|
children: [/* @__PURE__ */ F("p", {
|
|
4151
4189
|
className: "text-[0.8125rem] text-white/75 leading-snug",
|
|
4152
4190
|
children: V(s ? "scan.miss" : a ? "scan.hintQr" : "scan.hint")
|
|
4153
|
-
}), u.stream ? /* @__PURE__ */ I(
|
|
4191
|
+
}), u.stream ? /* @__PURE__ */ I(ji, {
|
|
4154
4192
|
quiet: !0,
|
|
4155
4193
|
onClick: () => l.current?.click(),
|
|
4156
4194
|
children: [
|
|
4157
|
-
/* @__PURE__ */ F(
|
|
4195
|
+
/* @__PURE__ */ F(D, { className: "size-4" }),
|
|
4158
4196
|
" ",
|
|
4159
4197
|
V("scan.fromPhoto")
|
|
4160
4198
|
]
|
|
@@ -4174,12 +4212,12 @@ function ua({ open: e, onClose: t, onResult: n }) {
|
|
|
4174
4212
|
}
|
|
4175
4213
|
//#endregion
|
|
4176
4214
|
//#region ../runner/src/signature.tsx
|
|
4177
|
-
var
|
|
4215
|
+
var ma = "#1d1a17", ha = {
|
|
4178
4216
|
width: 1200,
|
|
4179
4217
|
height: 480
|
|
4180
4218
|
};
|
|
4181
|
-
function
|
|
4182
|
-
e.lineCap = "round", e.lineJoin = "round", e.strokeStyle =
|
|
4219
|
+
function ga(e, t, n, r, i) {
|
|
4220
|
+
e.lineCap = "round", e.lineJoin = "round", e.strokeStyle = ma, e.fillStyle = ma, e.lineWidth = i;
|
|
4183
4221
|
for (let a of t) {
|
|
4184
4222
|
if (a.length === 1) {
|
|
4185
4223
|
e.beginPath(), e.arc(a[0].x * n, a[0].y * r, i / 2, 0, Math.PI * 2), e.fill();
|
|
@@ -4194,14 +4232,14 @@ function pa(e, t, n, r, i) {
|
|
|
4194
4232
|
e.lineTo(t.x * n, t.y * r), e.stroke();
|
|
4195
4233
|
}
|
|
4196
4234
|
}
|
|
4197
|
-
function
|
|
4235
|
+
function _a({ strokes: e, onStrokes: t }) {
|
|
4198
4236
|
let n = j(null), r = j(null), i = j(e);
|
|
4199
4237
|
i.current = e;
|
|
4200
4238
|
let a = () => {
|
|
4201
4239
|
let e = n.current, t = e?.getContext("2d");
|
|
4202
4240
|
if (!e || !t) return;
|
|
4203
4241
|
let a = window.devicePixelRatio || 1, o = Math.round(e.clientWidth * a), s = Math.round(e.clientHeight * a);
|
|
4204
|
-
(e.width !== o || e.height !== s) && (e.width = o, e.height = s), t.clearRect(0, 0, o, s),
|
|
4242
|
+
(e.width !== o || e.height !== s) && (e.width = o, e.height = s), t.clearRect(0, 0, o, s), ga(t, r.current ? [...i.current, r.current] : i.current, o, s, 2.4 * a);
|
|
4205
4243
|
};
|
|
4206
4244
|
A(() => {
|
|
4207
4245
|
a();
|
|
@@ -4248,20 +4286,20 @@ function ma({ strokes: e, onStrokes: t }) {
|
|
|
4248
4286
|
]
|
|
4249
4287
|
});
|
|
4250
4288
|
}
|
|
4251
|
-
async function
|
|
4289
|
+
async function va(e) {
|
|
4252
4290
|
let t = document.createElement("canvas");
|
|
4253
|
-
t.width =
|
|
4291
|
+
t.width = ha.width, t.height = ha.height;
|
|
4254
4292
|
let n = t.getContext("2d");
|
|
4255
4293
|
if (!n) return null;
|
|
4256
|
-
|
|
4294
|
+
ga(n, e, ha.width, ha.height, 7);
|
|
4257
4295
|
let r = await new Promise((e) => t.toBlob(e, "image/png"));
|
|
4258
4296
|
return r ? new File([r], "unterschrift.png", { type: "image/png" }) : null;
|
|
4259
4297
|
}
|
|
4260
|
-
function
|
|
4298
|
+
function ya({ label: e, value: t, runId: n, onChange: r }) {
|
|
4261
4299
|
let [i, a] = M(!1), [o, s] = M([]), [c, l] = M(!1), [u, d] = M(null), f = typeof t == "string" && t ? t : null, p = async () => {
|
|
4262
4300
|
l(!0), d(null);
|
|
4263
4301
|
try {
|
|
4264
|
-
let e = await
|
|
4302
|
+
let e = await va(o);
|
|
4265
4303
|
if (!e) return;
|
|
4266
4304
|
r((await U.upload(`${G(n)}/uploads`, e)).id), a(!1);
|
|
4267
4305
|
} catch (e) {
|
|
@@ -4296,13 +4334,13 @@ function ga({ label: e, value: t, runId: n, onChange: r }) {
|
|
|
4296
4334
|
},
|
|
4297
4335
|
className: "flex w-full flex-col items-center justify-center gap-2 rounded-xl border border-input border-dashed bg-card px-4 py-7 text-[0.875rem] text-ink-3 transition hover:border-ember hover:text-ink",
|
|
4298
4336
|
children: [/* @__PURE__ */ F(pe, { className: "size-6" }), V("sign.open")]
|
|
4299
|
-
}), /* @__PURE__ */ I(
|
|
4337
|
+
}), /* @__PURE__ */ I(Gr, {
|
|
4300
4338
|
open: i,
|
|
4301
4339
|
onClose: () => a(!1),
|
|
4302
4340
|
title: e,
|
|
4303
4341
|
wide: !0,
|
|
4304
4342
|
children: [
|
|
4305
|
-
/* @__PURE__ */ F(
|
|
4343
|
+
/* @__PURE__ */ F(_a, {
|
|
4306
4344
|
strokes: o,
|
|
4307
4345
|
onStrokes: s
|
|
4308
4346
|
}),
|
|
@@ -4333,7 +4371,7 @@ function ga({ label: e, value: t, runId: n, onChange: r }) {
|
|
|
4333
4371
|
}
|
|
4334
4372
|
//#endregion
|
|
4335
4373
|
//#region ../runner/src/store.tsx
|
|
4336
|
-
function
|
|
4374
|
+
function ba({ runId: e, connectionId: t, connector: n, onCancel: r }) {
|
|
4337
4375
|
let [i, a] = M({}), [o, s] = M(!1), [c, l] = M(null), u = async () => {
|
|
4338
4376
|
s(!0), l(null);
|
|
4339
4377
|
try {
|
|
@@ -4347,7 +4385,7 @@ function _a({ runId: e, connectionId: t, connector: n, onCancel: r }) {
|
|
|
4347
4385
|
return /* @__PURE__ */ I("div", {
|
|
4348
4386
|
className: "flex flex-col gap-3 rounded-xl bg-card p-4 ring-1 ring-input",
|
|
4349
4387
|
children: [
|
|
4350
|
-
(n.fields ?? []).map((e) => /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(
|
|
4388
|
+
(n.fields ?? []).map((e) => /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(Hr, { children: e.label }), /* @__PURE__ */ F(X, {
|
|
4351
4389
|
type: e.secret ? "password" : "text",
|
|
4352
4390
|
autoComplete: "off",
|
|
4353
4391
|
value: i[e.key] ?? "",
|
|
@@ -4385,7 +4423,7 @@ function _a({ runId: e, connectionId: t, connector: n, onCancel: r }) {
|
|
|
4385
4423
|
]
|
|
4386
4424
|
});
|
|
4387
4425
|
}
|
|
4388
|
-
function
|
|
4426
|
+
function xa({ runId: e, connection: t }) {
|
|
4389
4427
|
let [n, r] = M(null), [i, a] = M(null), [o, s] = M(null);
|
|
4390
4428
|
if (!t) return null;
|
|
4391
4429
|
if (t.account) {
|
|
@@ -4419,7 +4457,7 @@ function va({ runId: e, connection: t }) {
|
|
|
4419
4457
|
if (s(null), a(null), K("signIn")) {
|
|
4420
4458
|
try {
|
|
4421
4459
|
let { url: r } = await U.post(`${G(e)}/connections/${t.id}/oauth/${n.id}`);
|
|
4422
|
-
await
|
|
4460
|
+
await Or("signIn", { url: r });
|
|
4423
4461
|
} catch (e) {
|
|
4424
4462
|
s(e.message);
|
|
4425
4463
|
}
|
|
@@ -4443,13 +4481,13 @@ function va({ runId: e, connection: t }) {
|
|
|
4443
4481
|
onClick: () => e.auth === "oauth2" ? void c(e) : r(n === e.id ? null : e.id),
|
|
4444
4482
|
className: q("inline-flex h-11 items-center gap-2 rounded-full px-4 font-medium text-[0.875rem] ring-1 transition", n === e.id ? "bg-ember-veil text-ink ring-ember" : "bg-card text-ink-2 ring-input hover:text-ink hover:ring-ember"),
|
|
4445
4483
|
children: [
|
|
4446
|
-
/* @__PURE__ */ F(
|
|
4484
|
+
/* @__PURE__ */ F(ie, { className: "size-4" }),
|
|
4447
4485
|
" ",
|
|
4448
4486
|
e.name
|
|
4449
4487
|
]
|
|
4450
4488
|
}, e.id))
|
|
4451
4489
|
}),
|
|
4452
|
-
l ? /* @__PURE__ */ F(
|
|
4490
|
+
l ? /* @__PURE__ */ F(ba, {
|
|
4453
4491
|
runId: e,
|
|
4454
4492
|
connectionId: t.id,
|
|
4455
4493
|
connector: l,
|
|
@@ -4472,12 +4510,12 @@ function va({ runId: e, connection: t }) {
|
|
|
4472
4510
|
children: V("connect.none")
|
|
4473
4511
|
});
|
|
4474
4512
|
}
|
|
4475
|
-
function
|
|
4513
|
+
function Sa(e) {
|
|
4476
4514
|
return e == null ? "" : Array.isArray(e) ? e.join(", ") : String(e);
|
|
4477
4515
|
}
|
|
4478
|
-
function
|
|
4479
|
-
let [i, a] = M(
|
|
4480
|
-
A(() => a(
|
|
4516
|
+
function Ca({ column: e, value: t, boxed: n, onCommit: r }) {
|
|
4517
|
+
let [i, a] = M(Sa(t));
|
|
4518
|
+
A(() => a(Sa(t)), [t]);
|
|
4481
4519
|
let o = q("w-full min-w-0 rounded-md border border-transparent px-2 text-[0.8125rem] outline-none focus:border-ember focus:bg-card", n ? "h-11 bg-paper-2" : "h-9 bg-transparent hover:bg-paper-2 coarse:h-11");
|
|
4482
4520
|
return e.type === "boolean" ? /* @__PURE__ */ F("label", {
|
|
4483
4521
|
className: "flex size-9 cursor-pointer items-center justify-center coarse:size-11",
|
|
@@ -4505,7 +4543,7 @@ function ba({ column: e, value: t, boxed: n, onCommit: r }) {
|
|
|
4505
4543
|
value: i,
|
|
4506
4544
|
onChange: (e) => a(e.target.value),
|
|
4507
4545
|
onBlur: () => {
|
|
4508
|
-
i !==
|
|
4546
|
+
i !== Sa(t) && r(Lt(e, i));
|
|
4509
4547
|
},
|
|
4510
4548
|
onKeyDown: (e) => {
|
|
4511
4549
|
e.key === "Enter" && (e.preventDefault(), e.target.blur());
|
|
@@ -4513,13 +4551,13 @@ function ba({ column: e, value: t, boxed: n, onCommit: r }) {
|
|
|
4513
4551
|
className: q(o, e.type === "number" && "text-right tabular-nums")
|
|
4514
4552
|
});
|
|
4515
4553
|
}
|
|
4516
|
-
function
|
|
4554
|
+
function wa({ runId: e, list: t, editable: n }) {
|
|
4517
4555
|
let { def: r, rows: i } = t, [a, o] = M(null), [s, c] = M({}), l = `${G(e)}/lists/${r.id}/rows`, u = async (e) => {
|
|
4518
4556
|
o(null);
|
|
4519
4557
|
try {
|
|
4520
4558
|
await e();
|
|
4521
4559
|
} catch (e) {
|
|
4522
|
-
o(e instanceof
|
|
4560
|
+
o(e instanceof xr ? e.message : String(e));
|
|
4523
4561
|
}
|
|
4524
4562
|
}, d = () => u(async () => {
|
|
4525
4563
|
await U.post(l, { cells: s }), c({});
|
|
@@ -4541,7 +4579,7 @@ function xa({ runId: e, list: t, editable: n }) {
|
|
|
4541
4579
|
children: [/* @__PURE__ */ F("div", {
|
|
4542
4580
|
className: "px-1 pb-0.5 text-[0.6875rem] text-ink-3",
|
|
4543
4581
|
children: t.name
|
|
4544
|
-
}), n ? /* @__PURE__ */ F(
|
|
4582
|
+
}), n ? /* @__PURE__ */ F(Ca, {
|
|
4545
4583
|
boxed: !0,
|
|
4546
4584
|
column: t,
|
|
4547
4585
|
value: e.cells[t.id],
|
|
@@ -4568,7 +4606,7 @@ function xa({ runId: e, list: t, editable: n }) {
|
|
|
4568
4606
|
children: [/* @__PURE__ */ F("div", {
|
|
4569
4607
|
className: "px-1 pb-0.5 text-[0.6875rem] text-ink-3",
|
|
4570
4608
|
children: e.name
|
|
4571
|
-
}), /* @__PURE__ */ F(
|
|
4609
|
+
}), /* @__PURE__ */ F(Ca, {
|
|
4572
4610
|
boxed: !0,
|
|
4573
4611
|
column: e,
|
|
4574
4612
|
value: s[e.id],
|
|
@@ -4607,7 +4645,7 @@ function xa({ runId: e, list: t, editable: n }) {
|
|
|
4607
4645
|
className: "border-border-soft border-t align-top",
|
|
4608
4646
|
children: [r.columns.map((t) => /* @__PURE__ */ F("td", {
|
|
4609
4647
|
className: q("min-w-[7.5rem]", n ? "px-1 py-0.5" : "px-3 py-2"),
|
|
4610
|
-
children: n ? /* @__PURE__ */ F(
|
|
4648
|
+
children: n ? /* @__PURE__ */ F(Ca, {
|
|
4611
4649
|
column: t,
|
|
4612
4650
|
value: e.cells[t.id],
|
|
4613
4651
|
onCommit: (n) => m(e.id, t.id, n)
|
|
@@ -4628,7 +4666,7 @@ function xa({ runId: e, list: t, editable: n }) {
|
|
|
4628
4666
|
className: "border-border-soft border-t bg-paper",
|
|
4629
4667
|
children: [r.columns.map((e) => /* @__PURE__ */ F("td", {
|
|
4630
4668
|
className: "px-1 py-0.5",
|
|
4631
|
-
children: /* @__PURE__ */ F(
|
|
4669
|
+
children: /* @__PURE__ */ F(Ca, {
|
|
4632
4670
|
column: e,
|
|
4633
4671
|
value: s[e.id],
|
|
4634
4672
|
onCommit: (t) => c((n) => ({
|
|
@@ -4654,23 +4692,23 @@ function xa({ runId: e, list: t, editable: n }) {
|
|
|
4654
4692
|
}) : null
|
|
4655
4693
|
] });
|
|
4656
4694
|
}
|
|
4657
|
-
function
|
|
4695
|
+
function Ta(e, t, n) {
|
|
4658
4696
|
let r = t.split("/").map(encodeURIComponent).join("/");
|
|
4659
4697
|
return W(`${G(e)}/store/files/${r}${n ? "?inline=1" : ""}`);
|
|
4660
4698
|
}
|
|
4661
|
-
var
|
|
4699
|
+
var Ea = [
|
|
4662
4700
|
"bg-paper-3 text-ink-3",
|
|
4663
4701
|
"bg-moss-tint text-moss",
|
|
4664
4702
|
"bg-rose-tint text-rose",
|
|
4665
4703
|
"bg-ember-tint text-ember-strong"
|
|
4666
4704
|
];
|
|
4667
|
-
function
|
|
4705
|
+
function Da({ runId: e, list: t }) {
|
|
4668
4706
|
let { def: n, rows: r } = t, i = n.columns.find((e) => e.id === n.check?.file), a = n.columns.find((e) => e.id === n.check?.status), o = a?.type === "select" ? a.format.options : [], s = o[0]?.id, c = (e) => a ? String(e.cells[a.id] ?? s ?? "") : "", l = (e) => !a || c(e) === s, [u, d] = M(() => (r.find(l) ?? r[0])?.id ?? null), [f, p] = M(!1), [m, g] = M(null), _ = `${G(e)}/lists/${n.id}/rows`, v = r.find((e) => e.id === u) ?? r[0], y = f ? r.filter((e) => l(e) || e.id === v?.id) : r, b = r.filter((e) => !l(e)).length, x = n.columns.filter((e) => e !== i && e !== a), S = x.filter((e) => e.id !== n.key), C = S.find((e) => e.type === "text") ?? S[0], w = S.filter((e) => e !== C), ee = async (e, t) => {
|
|
4669
4707
|
g(null);
|
|
4670
4708
|
try {
|
|
4671
4709
|
await U.patch(`${_}/${e}`, { cells: t });
|
|
4672
4710
|
} catch (e) {
|
|
4673
|
-
g(e instanceof
|
|
4711
|
+
g(e instanceof xr ? e.message : String(e));
|
|
4674
4712
|
}
|
|
4675
4713
|
}, te = (e) => {
|
|
4676
4714
|
let t = y.findIndex((e) => e.id === v?.id), n = y[Math.min(y.length - 1, Math.max(0, t + e))];
|
|
@@ -4686,7 +4724,7 @@ function wa({ runId: e, list: t }) {
|
|
|
4686
4724
|
className: "text-[0.875rem] text-ink-3",
|
|
4687
4725
|
children: V("list.empty")
|
|
4688
4726
|
});
|
|
4689
|
-
let E = i && v ? String(v.cells[i.id] ?? "").trim() : "",
|
|
4727
|
+
let E = i && v ? String(v.cells[i.id] ?? "").trim() : "", D = E.split(".").pop()?.toLowerCase() ?? "", O = (e) => Ea[Math.min(Math.max(0, o.findIndex((t) => t.id === c(e))), 3)];
|
|
4690
4728
|
return /* @__PURE__ */ I("div", {
|
|
4691
4729
|
className: "grid gap-4 lg:grid-cols-[minmax(280px,360px)_minmax(0,1fr)]",
|
|
4692
4730
|
onKeyDown: re,
|
|
@@ -4724,7 +4762,7 @@ function wa({ runId: e, list: t }) {
|
|
|
4724
4762
|
children: w.slice(0, 2).map((t) => _t(t, e.cells[t.id], B)).filter(Boolean).join(" · ")
|
|
4725
4763
|
})]
|
|
4726
4764
|
}), a ? /* @__PURE__ */ F("span", {
|
|
4727
|
-
className: q("shrink-0 rounded-full px-2 py-0.5 font-medium text-[0.6875rem]",
|
|
4765
|
+
className: q("shrink-0 rounded-full px-2 py-0.5 font-medium text-[0.6875rem]", O(e)),
|
|
4728
4766
|
children: o.find((t) => t.id === c(e))?.label ?? c(e)
|
|
4729
4767
|
}) : null]
|
|
4730
4768
|
}) }, e.id))
|
|
@@ -4764,26 +4802,26 @@ function wa({ runId: e, list: t }) {
|
|
|
4764
4802
|
children: E.split("/").pop()
|
|
4765
4803
|
}),
|
|
4766
4804
|
/* @__PURE__ */ F("a", {
|
|
4767
|
-
href:
|
|
4805
|
+
href: Ta(e, E, D === "pdf"),
|
|
4768
4806
|
target: "_blank",
|
|
4769
4807
|
rel: "noreferrer",
|
|
4770
4808
|
className: "shrink-0 text-ink-2 underline-offset-2 hover:text-ink hover:underline",
|
|
4771
4809
|
children: V("run.openFull")
|
|
4772
4810
|
})
|
|
4773
4811
|
]
|
|
4774
|
-
}),
|
|
4812
|
+
}), D === "pdf" ? /* @__PURE__ */ F("iframe", {
|
|
4775
4813
|
title: E,
|
|
4776
|
-
src: `${
|
|
4814
|
+
src: `${Ta(e, E, !0)}#toolbar=0&navpanes=0&view=FitH`,
|
|
4777
4815
|
className: "h-[46vh] w-full border-0 bg-white lg:h-[calc(100vh-27rem)] lg:min-h-[360px]"
|
|
4778
4816
|
}, E) : [
|
|
4779
4817
|
"png",
|
|
4780
4818
|
"jpg",
|
|
4781
4819
|
"jpeg",
|
|
4782
4820
|
"webp"
|
|
4783
|
-
].includes(
|
|
4821
|
+
].includes(D) ? /* @__PURE__ */ F("div", {
|
|
4784
4822
|
className: "flex max-h-[46vh] justify-center overflow-auto bg-white lg:max-h-[calc(100vh-27rem)]",
|
|
4785
4823
|
children: /* @__PURE__ */ F("img", {
|
|
4786
|
-
src:
|
|
4824
|
+
src: Ta(e, E, !0),
|
|
4787
4825
|
alt: E,
|
|
4788
4826
|
className: "max-w-full object-contain"
|
|
4789
4827
|
}, E)
|
|
@@ -4802,7 +4840,7 @@ function wa({ runId: e, list: t }) {
|
|
|
4802
4840
|
children: [/* @__PURE__ */ F("div", {
|
|
4803
4841
|
className: "px-1 pb-0.5 text-[0.6875rem] text-ink-3",
|
|
4804
4842
|
children: e.name
|
|
4805
|
-
}), /* @__PURE__ */ F(
|
|
4843
|
+
}), /* @__PURE__ */ F(Ca, {
|
|
4806
4844
|
boxed: !0,
|
|
4807
4845
|
column: e,
|
|
4808
4846
|
value: v.cells[e.id],
|
|
@@ -4818,24 +4856,24 @@ function wa({ runId: e, list: t }) {
|
|
|
4818
4856
|
}) : null]
|
|
4819
4857
|
});
|
|
4820
4858
|
}
|
|
4821
|
-
var
|
|
4859
|
+
var Oa = {
|
|
4822
4860
|
xlsx: "Excel",
|
|
4823
4861
|
csv: "CSV",
|
|
4824
4862
|
json: "JSON",
|
|
4825
4863
|
md: "Markdown",
|
|
4826
4864
|
zip: "ZIP"
|
|
4827
4865
|
};
|
|
4828
|
-
function
|
|
4866
|
+
function ka({ runId: e, list: t }) {
|
|
4829
4867
|
return /* @__PURE__ */ F("div", {
|
|
4830
4868
|
className: "flex flex-wrap gap-2",
|
|
4831
4869
|
children: t.formats.map((n) => /* @__PURE__ */ F("a", {
|
|
4832
4870
|
href: W(`${G(e)}/lists/${t.def.id}/download?format=${n}`),
|
|
4833
4871
|
className: "inline-flex h-9 items-center rounded-full bg-paper-2 px-3.5 font-medium text-[0.8125rem] text-ink-2 transition hover:bg-paper-3 hover:text-ink coarse:h-11 coarse:px-4",
|
|
4834
|
-
children:
|
|
4872
|
+
children: Oa[n] ?? n
|
|
4835
4873
|
}, n))
|
|
4836
4874
|
});
|
|
4837
4875
|
}
|
|
4838
|
-
function
|
|
4876
|
+
function Aa({ runId: e }) {
|
|
4839
4877
|
let [t, n] = M(!1), [r, i] = M(null), [a, o] = M(!1);
|
|
4840
4878
|
A(() => {
|
|
4841
4879
|
t && (o(!1), U.get(`${G(e)}/store`).then(i));
|
|
@@ -4850,7 +4888,7 @@ function Da({ runId: e }) {
|
|
|
4850
4888
|
" ",
|
|
4851
4889
|
V("store.open")
|
|
4852
4890
|
]
|
|
4853
|
-
}), /* @__PURE__ */ F(
|
|
4891
|
+
}), /* @__PURE__ */ F(Gr, {
|
|
4854
4892
|
open: t,
|
|
4855
4893
|
onClose: () => n(!1),
|
|
4856
4894
|
title: V("store.title"),
|
|
@@ -4879,7 +4917,7 @@ function Da({ runId: e }) {
|
|
|
4879
4917
|
r.connections.map((e) => /* @__PURE__ */ I("div", {
|
|
4880
4918
|
className: "flex items-center gap-2",
|
|
4881
4919
|
children: [
|
|
4882
|
-
/* @__PURE__ */ F(
|
|
4920
|
+
/* @__PURE__ */ F(ie, { className: "size-4 text-ink-3" }),
|
|
4883
4921
|
" ",
|
|
4884
4922
|
e.account?.label
|
|
4885
4923
|
]
|
|
@@ -4948,14 +4986,14 @@ function Da({ runId: e }) {
|
|
|
4948
4986
|
]
|
|
4949
4987
|
}) : /* @__PURE__ */ F("div", {
|
|
4950
4988
|
className: "flex justify-center py-8 text-ink-4",
|
|
4951
|
-
children: /* @__PURE__ */ F(
|
|
4989
|
+
children: /* @__PURE__ */ F(Ur, {})
|
|
4952
4990
|
})
|
|
4953
4991
|
})] });
|
|
4954
4992
|
}
|
|
4955
4993
|
//#endregion
|
|
4956
4994
|
//#region ../runner/src/voice.tsx
|
|
4957
|
-
var
|
|
4958
|
-
function
|
|
4995
|
+
var ja = 300;
|
|
4996
|
+
function Ma() {
|
|
4959
4997
|
if (typeof MediaRecorder < "u") return (K("transcribe") ? [
|
|
4960
4998
|
"audio/mp4",
|
|
4961
4999
|
"audio/webm;codecs=opus",
|
|
@@ -4968,9 +5006,9 @@ function ka() {
|
|
|
4968
5006
|
"audio/ogg;codecs=opus"
|
|
4969
5007
|
]).find((e) => MediaRecorder.isTypeSupported(e));
|
|
4970
5008
|
}
|
|
4971
|
-
async function
|
|
5009
|
+
async function Na(e, t) {
|
|
4972
5010
|
if (K("transcribe")) try {
|
|
4973
|
-
let n = await
|
|
5011
|
+
let n = await Or("transcribe", {
|
|
4974
5012
|
audio: await new Promise((t, n) => {
|
|
4975
5013
|
let r = new FileReader();
|
|
4976
5014
|
r.onload = () => t(String(r.result).split(",")[1] ?? ""), r.onerror = () => n(r.error), r.readAsDataURL(e);
|
|
@@ -4983,11 +5021,11 @@ async function Aa(e, t) {
|
|
|
4983
5021
|
return;
|
|
4984
5022
|
}
|
|
4985
5023
|
}
|
|
4986
|
-
function
|
|
5024
|
+
function Pa(e) {
|
|
4987
5025
|
return `${Math.floor(e / 60)}:${String(Math.floor(e % 60)).padStart(2, "0")}`;
|
|
4988
5026
|
}
|
|
4989
|
-
function
|
|
4990
|
-
let i = en(e) ? e : null, [a, o] = M(null), [s, c] = M(0), [l, u] = M(!1), [d, f] = M(null), [p, m] = M(!1), [h, g] = M(null), _ = j(null), v = j(null), y =
|
|
5027
|
+
function Fa({ value: e, runId: t, onChange: n, onBusy: r }) {
|
|
5028
|
+
let i = en(e) ? e : null, [a, o] = M(null), [s, c] = M(0), [l, u] = M(!1), [d, f] = M(null), [p, m] = M(!1), [h, g] = M(null), _ = j(null), v = j(null), y = Ma(), b = ei && !!y;
|
|
4991
5029
|
A(() => () => {
|
|
4992
5030
|
_.current && (_.current.recorder.onstop = null, _.current.stop());
|
|
4993
5031
|
}, []), A(() => () => {
|
|
@@ -5001,7 +5039,7 @@ function Ma({ value: e, runId: t, onChange: n, onBusy: r }) {
|
|
|
5001
5039
|
asset: r.id,
|
|
5002
5040
|
url: URL.createObjectURL(e)
|
|
5003
5041
|
});
|
|
5004
|
-
let { lang: a } = H(), o = await
|
|
5042
|
+
let { lang: a } = H(), o = await Na(e, a);
|
|
5005
5043
|
n({
|
|
5006
5044
|
asset: r.id,
|
|
5007
5045
|
lang: a,
|
|
@@ -5034,7 +5072,7 @@ function Ma({ value: e, runId: t, onChange: n, onBusy: r }) {
|
|
|
5034
5072
|
s.getByteTimeDomainData(l);
|
|
5035
5073
|
let e = 0;
|
|
5036
5074
|
for (let t of l) e = Math.max(e, Math.abs(t - 128));
|
|
5037
|
-
if (c(Math.min(1, e / 64)), o((Date.now() - i) / 1e3), (Date.now() - i) / 1e3 >=
|
|
5075
|
+
if (c(Math.min(1, e / 64)), o((Date.now() - i) / 1e3), (Date.now() - i) / 1e3 >= ja) {
|
|
5038
5076
|
p();
|
|
5039
5077
|
return;
|
|
5040
5078
|
}
|
|
@@ -5046,7 +5084,7 @@ function Ma({ value: e, runId: t, onChange: n, onBusy: r }) {
|
|
|
5046
5084
|
};
|
|
5047
5085
|
n.ondataavailable = (e) => e.data.size && t.push(e.data), n.onstop = () => {
|
|
5048
5086
|
let e = (n.mimeType || y || "audio/webm").split(";")[0], r = e === "audio/mp4" ? "m4a" : e === "audio/ogg" ? "ogg" : "webm", a = Math.max(1, Math.round((Date.now() - i) / 1e3));
|
|
5049
|
-
x(new File(t, `sprachnotiz-${
|
|
5087
|
+
x(new File(t, `sprachnotiz-${yi()}.${r}`, { type: e }), a);
|
|
5050
5088
|
}, _.current = {
|
|
5051
5089
|
recorder: n,
|
|
5052
5090
|
stop: p
|
|
@@ -5075,10 +5113,10 @@ function Ma({ value: e, runId: t, onChange: n, onBusy: r }) {
|
|
|
5075
5113
|
className: "min-w-0 flex-1",
|
|
5076
5114
|
children: [/* @__PURE__ */ F("div", {
|
|
5077
5115
|
className: "font-medium text-[0.9375rem] tabular-nums",
|
|
5078
|
-
children:
|
|
5116
|
+
children: Pa(a)
|
|
5079
5117
|
}), /* @__PURE__ */ F("div", {
|
|
5080
5118
|
className: "text-[0.8125rem] text-ink-3",
|
|
5081
|
-
children: a > 270 ? V("voice.left", { s: Math.ceil(
|
|
5119
|
+
children: a > 270 ? V("voice.left", { s: Math.ceil(ja - a) }) : V("voice.recording")
|
|
5082
5120
|
})]
|
|
5083
5121
|
}),
|
|
5084
5122
|
/* @__PURE__ */ I(J, {
|
|
@@ -5093,7 +5131,7 @@ function Ma({ value: e, runId: t, onChange: n, onBusy: r }) {
|
|
|
5093
5131
|
}) : l ? /* @__PURE__ */ I("div", {
|
|
5094
5132
|
className: "flex items-center gap-3 rounded-xl bg-card p-4 text-[0.875rem] text-ink-3 ring-1 ring-input",
|
|
5095
5133
|
children: [
|
|
5096
|
-
/* @__PURE__ */ F(
|
|
5134
|
+
/* @__PURE__ */ F(Ur, { className: "size-4" }),
|
|
5097
5135
|
" ",
|
|
5098
5136
|
V("run.uploading")
|
|
5099
5137
|
]
|
|
@@ -5114,7 +5152,7 @@ function Ma({ value: e, runId: t, onChange: n, onBusy: r }) {
|
|
|
5114
5152
|
className: "mt-2 flex flex-wrap items-center justify-between gap-2",
|
|
5115
5153
|
children: [/* @__PURE__ */ F("span", {
|
|
5116
5154
|
className: "px-1 text-[0.8125rem] text-ink-3",
|
|
5117
|
-
children: i.seconds ?
|
|
5155
|
+
children: i.seconds ? Pa(i.seconds) : null
|
|
5118
5156
|
}), /* @__PURE__ */ I("div", {
|
|
5119
5157
|
className: "flex gap-1",
|
|
5120
5158
|
children: [b ? /* @__PURE__ */ I(J, {
|
|
@@ -5174,8 +5212,8 @@ function Ma({ value: e, runId: t, onChange: n, onBusy: r }) {
|
|
|
5174
5212
|
}
|
|
5175
5213
|
//#endregion
|
|
5176
5214
|
//#region ../runner/src/fields.tsx
|
|
5177
|
-
function
|
|
5178
|
-
let i = e.columns ?? [], a = Array.isArray(t) && t.length ? t : [{}], o =
|
|
5215
|
+
function Ia({ field: e, value: t, values: n, onChange: r }) {
|
|
5216
|
+
let i = e.columns ?? [], a = Array.isArray(t) && t.length ? t : [{}], o = Xn(e, a, n), s = (e, t, n) => {
|
|
5179
5217
|
r(a.map((r, i) => i === e ? {
|
|
5180
5218
|
...r,
|
|
5181
5219
|
[t]: n
|
|
@@ -5263,22 +5301,22 @@ function Na({ field: e, value: t, values: n, onChange: r }) {
|
|
|
5263
5301
|
]
|
|
5264
5302
|
});
|
|
5265
5303
|
}
|
|
5266
|
-
function
|
|
5304
|
+
function La(e) {
|
|
5267
5305
|
return !!e?.closest("input, textarea, [contenteditable='true']");
|
|
5268
5306
|
}
|
|
5269
|
-
function
|
|
5307
|
+
function Ra({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
|
|
5270
5308
|
let a = j(null), o = j(null), s = j(null), c = j(null), [l, u] = M(!1), [d, f] = M({}), [p, h] = M(null), [g, _] = M(!1), [v, y] = M(!1), [b, x] = M(null), S = j(null), C = (e) => {
|
|
5271
5309
|
S.current = e, x(e);
|
|
5272
|
-
}, w = e.kind === "image", T = !!e.multiple, te = T ? e.max ?? 30 : 1, ne = w || !!e.camera || !!e.video,
|
|
5273
|
-
|
|
5274
|
-
let
|
|
5310
|
+
}, w = e.kind === "image", T = !!e.multiple, te = T ? e.max ?? 30 : 1, ne = w || !!e.camera || !!e.video, D = !w && !!e.video, O = Array.isArray(t) ? t : typeof t == "string" && t ? [t] : [], k = j(O);
|
|
5311
|
+
k.current = O;
|
|
5312
|
+
let ie = O.length < te, ae = async (e) => {
|
|
5275
5313
|
let t = (w ? e.filter((e) => e.type.startsWith("image/")) : e).sort((e, t) => e.name.localeCompare(t.name, void 0, { numeric: !0 }));
|
|
5276
5314
|
if (!t.length) return;
|
|
5277
|
-
let a = te - (T ?
|
|
5315
|
+
let a = te - (T ? k.current.length : 0);
|
|
5278
5316
|
u(!0), i?.(!0), h(t.length > a && T ? V("run.maxFiles", { n: te }) : null);
|
|
5279
5317
|
try {
|
|
5280
5318
|
for (let e of t.slice(0, Math.max(0, a))) {
|
|
5281
|
-
let t = await
|
|
5319
|
+
let t = await vi(e), i = await U.upload(`${G(n)}/uploads`, t);
|
|
5282
5320
|
f((e) => ({
|
|
5283
5321
|
...e,
|
|
5284
5322
|
[i.id]: {
|
|
@@ -5286,8 +5324,8 @@ function Fa({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
|
|
|
5286
5324
|
mime: i.mime
|
|
5287
5325
|
}
|
|
5288
5326
|
}));
|
|
5289
|
-
let a = T ? [...
|
|
5290
|
-
|
|
5327
|
+
let a = T ? [...k.current, i.id] : i.id;
|
|
5328
|
+
k.current = T ? a : [i.id], r(a);
|
|
5291
5329
|
}
|
|
5292
5330
|
} catch (e) {
|
|
5293
5331
|
h(e.message);
|
|
@@ -5297,39 +5335,39 @@ function Fa({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
|
|
|
5297
5335
|
}, oe = j(ae);
|
|
5298
5336
|
oe.current = ae;
|
|
5299
5337
|
let se = (e) => {
|
|
5300
|
-
let t =
|
|
5338
|
+
let t = O.filter((t) => t !== e);
|
|
5301
5339
|
r(T ? t : void 0);
|
|
5302
5340
|
}, ce = (e, t) => {
|
|
5303
|
-
let n =
|
|
5341
|
+
let n = k.current.indexOf(e), i = Math.min(k.current.length - 1, Math.max(0, t));
|
|
5304
5342
|
if (n < 0 || n === i) return;
|
|
5305
|
-
let a =
|
|
5306
|
-
a.splice(i, 0, e),
|
|
5307
|
-
}, le = T &&
|
|
5343
|
+
let a = k.current.filter((t) => t !== e);
|
|
5344
|
+
a.splice(i, 0, e), k.current = a, r(a);
|
|
5345
|
+
}, le = T && O.length > 1;
|
|
5308
5346
|
A(() => {
|
|
5309
|
-
if (!
|
|
5347
|
+
if (!ie) return;
|
|
5310
5348
|
let e = (e) => {
|
|
5311
5349
|
let t = Array.from(e.clipboardData?.files ?? []), n = a.current;
|
|
5312
|
-
if (!t.length || !n ||
|
|
5350
|
+
if (!t.length || !n || La(document.activeElement)) return;
|
|
5313
5351
|
let r = document.querySelectorAll("[data-upload-field]");
|
|
5314
5352
|
(n.matches(":hover") || n.contains(document.activeElement) || r.length === 1) && (e.preventDefault(), oe.current(t));
|
|
5315
5353
|
};
|
|
5316
5354
|
return document.addEventListener("paste", e), () => document.removeEventListener("paste", e);
|
|
5317
|
-
}, [
|
|
5318
|
-
let ue = q("flex flex-col items-center justify-center gap-2 rounded-xl border border-input border-dashed bg-card px-3 text-[0.875rem] text-ink-3 transition hover:border-ember hover:text-ink",
|
|
5355
|
+
}, [ie]);
|
|
5356
|
+
let ue = q("flex flex-col items-center justify-center gap-2 rounded-xl border border-input border-dashed bg-card px-3 text-[0.875rem] text-ink-3 transition hover:border-ember hover:text-ink", O.length ? "py-4" : "py-8");
|
|
5319
5357
|
return /* @__PURE__ */ I("div", {
|
|
5320
5358
|
ref: a,
|
|
5321
5359
|
"data-upload-field": "",
|
|
5322
5360
|
onDragOver: (e) => {
|
|
5323
|
-
|
|
5361
|
+
ie && (e.preventDefault(), y(!0));
|
|
5324
5362
|
},
|
|
5325
5363
|
onDragLeave: () => y(!1),
|
|
5326
5364
|
onDrop: (e) => {
|
|
5327
|
-
y(!1),
|
|
5365
|
+
y(!1), ie && (e.preventDefault(), ae(Array.from(e.dataTransfer.files)));
|
|
5328
5366
|
},
|
|
5329
5367
|
children: [
|
|
5330
|
-
|
|
5368
|
+
O.length ? /* @__PURE__ */ F("div", {
|
|
5331
5369
|
className: "mb-2 flex flex-col gap-2",
|
|
5332
|
-
children:
|
|
5370
|
+
children: O.map((e, t) => {
|
|
5333
5371
|
let r = d[e], i = r?.mime ?? (w ? "image/" : "");
|
|
5334
5372
|
return /* @__PURE__ */ I("div", {
|
|
5335
5373
|
"data-file-id": e,
|
|
@@ -5349,7 +5387,7 @@ function Fa({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
|
|
|
5349
5387
|
onPointerMove: (t) => {
|
|
5350
5388
|
if (S.current !== e) return;
|
|
5351
5389
|
let n = document.elementFromPoint(t.clientX, t.clientY)?.closest("[data-file-id]"), r = n?.getAttribute("data-file-id");
|
|
5352
|
-
r && r !== e && a.current?.contains(n ?? null) && ce(e,
|
|
5390
|
+
r && r !== e && a.current?.contains(n ?? null) && ce(e, k.current.indexOf(r));
|
|
5353
5391
|
},
|
|
5354
5392
|
onPointerUp: () => C(null),
|
|
5355
5393
|
onPointerCancel: () => C(null),
|
|
@@ -5382,22 +5420,22 @@ function Fa({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
|
|
|
5382
5420
|
}, e);
|
|
5383
5421
|
})
|
|
5384
5422
|
}) : null,
|
|
5385
|
-
|
|
5423
|
+
ie ? /* @__PURE__ */ I("div", {
|
|
5386
5424
|
className: "flex flex-wrap gap-2",
|
|
5387
5425
|
children: [
|
|
5388
5426
|
/* @__PURE__ */ I("button", {
|
|
5389
5427
|
type: "button",
|
|
5390
5428
|
onClick: () => o.current?.click(),
|
|
5391
5429
|
className: q(ue, "min-w-[9rem] flex-1 px-4", v && "border-ember text-ink"),
|
|
5392
|
-
children: [F(w ? E : fe, { className: "size-6" }), l ? V("run.uploading") :
|
|
5430
|
+
children: [F(w ? E : fe, { className: "size-6" }), l ? V("run.uploading") : O.length ? V("run.uploadMore") : V($r ? "run.uploadTouch" : "run.upload")]
|
|
5393
5431
|
}),
|
|
5394
5432
|
ne ? /* @__PURE__ */ I("button", {
|
|
5395
5433
|
type: "button",
|
|
5396
|
-
onClick: () =>
|
|
5434
|
+
onClick: () => ei ? _(!0) : s.current?.click(),
|
|
5397
5435
|
className: q(ue, "w-28"),
|
|
5398
5436
|
children: [/* @__PURE__ */ F(m, { className: "size-6" }), V("run.camera")]
|
|
5399
5437
|
}) : null,
|
|
5400
|
-
|
|
5438
|
+
D && !(ei && ki) ? /* @__PURE__ */ I("button", {
|
|
5401
5439
|
type: "button",
|
|
5402
5440
|
onClick: () => c.current?.click(),
|
|
5403
5441
|
className: q(ue, "w-28"),
|
|
@@ -5425,7 +5463,7 @@ function Fa({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
|
|
|
5425
5463
|
ae(Array.from(e.target.files ?? [])), e.target.value = "";
|
|
5426
5464
|
}
|
|
5427
5465
|
}),
|
|
5428
|
-
|
|
5466
|
+
D ? /* @__PURE__ */ F("input", {
|
|
5429
5467
|
ref: c,
|
|
5430
5468
|
type: "file",
|
|
5431
5469
|
hidden: !0,
|
|
@@ -5435,21 +5473,21 @@ function Fa({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
|
|
|
5435
5473
|
ae(Array.from(e.target.files ?? [])), e.target.value = "";
|
|
5436
5474
|
}
|
|
5437
5475
|
}) : null,
|
|
5438
|
-
/* @__PURE__ */ F(
|
|
5476
|
+
/* @__PURE__ */ F(Ai, {
|
|
5439
5477
|
open: g,
|
|
5440
5478
|
multiple: T,
|
|
5441
|
-
video:
|
|
5479
|
+
video: D,
|
|
5442
5480
|
onClose: () => _(!1),
|
|
5443
5481
|
onCapture: (e) => ae([e]),
|
|
5444
5482
|
onNative: () => s.current?.click()
|
|
5445
5483
|
}),
|
|
5446
5484
|
T && (e.min || e.max) ? /* @__PURE__ */ F("div", {
|
|
5447
5485
|
className: "mt-2 text-[0.8125rem] text-ink-3 tabular-nums",
|
|
5448
|
-
children: e.min &&
|
|
5449
|
-
n:
|
|
5486
|
+
children: e.min && O.length < e.min ? V("run.filesMin", {
|
|
5487
|
+
n: O.length,
|
|
5450
5488
|
min: e.min
|
|
5451
5489
|
}) : e.max ? V("run.filesOf", {
|
|
5452
|
-
n:
|
|
5490
|
+
n: O.length,
|
|
5453
5491
|
max: e.max
|
|
5454
5492
|
}) : null
|
|
5455
5493
|
}) : null,
|
|
@@ -5460,7 +5498,7 @@ function Fa({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
|
|
|
5460
5498
|
]
|
|
5461
5499
|
});
|
|
5462
5500
|
}
|
|
5463
|
-
function
|
|
5501
|
+
function za(e) {
|
|
5464
5502
|
let t = `${e.id} ${e.label}`.toLowerCase();
|
|
5465
5503
|
return /telefon|phone|handy|mobil(?!it)|\btel\b|rückruf/.test(t) ? {
|
|
5466
5504
|
type: "tel",
|
|
@@ -5493,7 +5531,7 @@ function Ia(e) {
|
|
|
5493
5531
|
autoCapitalize: "words"
|
|
5494
5532
|
} : { autoCapitalize: "sentences" };
|
|
5495
5533
|
}
|
|
5496
|
-
function
|
|
5534
|
+
function Ba({ field: e, value: t, onChange: n }) {
|
|
5497
5535
|
let [r, i] = M(!1);
|
|
5498
5536
|
return /* @__PURE__ */ I("div", {
|
|
5499
5537
|
className: "flex gap-2",
|
|
@@ -5516,7 +5554,7 @@ function La({ field: e, value: t, onChange: n }) {
|
|
|
5516
5554
|
V("scan.button")
|
|
5517
5555
|
]
|
|
5518
5556
|
}),
|
|
5519
|
-
/* @__PURE__ */ F(
|
|
5557
|
+
/* @__PURE__ */ F(fa, {
|
|
5520
5558
|
open: r,
|
|
5521
5559
|
onClose: () => i(!1),
|
|
5522
5560
|
onResult: n
|
|
@@ -5524,16 +5562,16 @@ function La({ field: e, value: t, onChange: n }) {
|
|
|
5524
5562
|
]
|
|
5525
5563
|
});
|
|
5526
5564
|
}
|
|
5527
|
-
var
|
|
5528
|
-
function
|
|
5565
|
+
var Va = 4;
|
|
5566
|
+
function Ha(e) {
|
|
5529
5567
|
let t = /* @__PURE__ */ new Map(), n = e.map((e) => ({
|
|
5530
5568
|
value: e,
|
|
5531
|
-
slot:
|
|
5569
|
+
slot: Jn(e)
|
|
5532
5570
|
})).filter((e) => e.slot).sort((e, t) => Date.parse(e.value) - Date.parse(t.value));
|
|
5533
5571
|
for (let { value: e, slot: r } of n) {
|
|
5534
5572
|
if (!r) continue;
|
|
5535
5573
|
let n = t.get(r.day) ?? {
|
|
5536
|
-
label:
|
|
5574
|
+
label: Yn(e, B),
|
|
5537
5575
|
times: []
|
|
5538
5576
|
};
|
|
5539
5577
|
n.times.push({
|
|
@@ -5543,13 +5581,13 @@ function za(e) {
|
|
|
5543
5581
|
}
|
|
5544
5582
|
return [...t.values()];
|
|
5545
5583
|
}
|
|
5546
|
-
function
|
|
5547
|
-
let o =
|
|
5584
|
+
function Ua({ name: e, label: t, options: n, value: r, onChange: i, disabled: a }) {
|
|
5585
|
+
let o = Ha(n), s = o.findIndex((e) => e.times.some((e) => e.value === r)), [c, l] = M(s >= Va);
|
|
5548
5586
|
if (!o.length) return /* @__PURE__ */ F("p", {
|
|
5549
5587
|
className: "text-[0.875rem] text-ink-3",
|
|
5550
5588
|
children: V("slot.none")
|
|
5551
5589
|
});
|
|
5552
|
-
let u = c ? o : o.slice(0,
|
|
5590
|
+
let u = c ? o : o.slice(0, Va);
|
|
5553
5591
|
return /* @__PURE__ */ I("div", {
|
|
5554
5592
|
className: "flex flex-col gap-4",
|
|
5555
5593
|
children: [/* @__PURE__ */ I("fieldset", {
|
|
@@ -5587,7 +5625,7 @@ function Ba({ name: e, label: t, options: n, value: r, onChange: i, disabled: a
|
|
|
5587
5625
|
}) : null]
|
|
5588
5626
|
});
|
|
5589
5627
|
}
|
|
5590
|
-
function
|
|
5628
|
+
function Wa({ cards: e, value: t, multi: n, runId: r, onChange: i, disabled: a }) {
|
|
5591
5629
|
let o = new Set(n ? Array.isArray(t) ? t.map(String) : [] : t == null || t === "" ? [] : [String(t)]), s = (e) => {
|
|
5592
5630
|
i(n ? o.has(e) ? [...o].filter((t) => t !== e) : [...o, e] : o.has(e) ? "" : e);
|
|
5593
5631
|
}, c = (e) => /^(https?:|data:|\/)/.test(e) ? e : W(`/api/runs/${r}/assets/${e}`);
|
|
@@ -5640,11 +5678,11 @@ function Va({ cards: e, value: t, multi: n, runId: r, onChange: i, disabled: a }
|
|
|
5640
5678
|
})
|
|
5641
5679
|
});
|
|
5642
5680
|
}
|
|
5643
|
-
function
|
|
5681
|
+
function Ga({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onBusy: o, error: s, closed: c }) {
|
|
5644
5682
|
let l = t == null ? "" : String(t), u = new Set(c?.values.map(String)), d;
|
|
5645
5683
|
switch (e.kind) {
|
|
5646
5684
|
case "textarea":
|
|
5647
|
-
d = /* @__PURE__ */ F(
|
|
5685
|
+
d = /* @__PURE__ */ F(Ir, {
|
|
5648
5686
|
value: l,
|
|
5649
5687
|
placeholder: e.placeholder,
|
|
5650
5688
|
autoCapitalize: "sentences",
|
|
@@ -5663,33 +5701,33 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5663
5701
|
break;
|
|
5664
5702
|
case "select": {
|
|
5665
5703
|
let n = e.options ?? [], o = i?.cards?.[e.id];
|
|
5666
|
-
d = o?.length ? /* @__PURE__ */ F(
|
|
5704
|
+
d = o?.length ? /* @__PURE__ */ F(Wa, {
|
|
5667
5705
|
cards: o,
|
|
5668
5706
|
value: t,
|
|
5669
5707
|
multi: !1,
|
|
5670
5708
|
runId: r,
|
|
5671
5709
|
onChange: a,
|
|
5672
5710
|
disabled: u
|
|
5673
|
-
}) : n.length <= 5 && n.every((e) => e.length <= 28) ? /* @__PURE__ */ F(
|
|
5711
|
+
}) : n.length <= 5 && n.every((e) => e.length <= 28) ? /* @__PURE__ */ F(Rr, {
|
|
5674
5712
|
value: l,
|
|
5675
5713
|
options: n,
|
|
5676
5714
|
onChange: a,
|
|
5677
5715
|
disabled: [...u],
|
|
5678
|
-
label:
|
|
5679
|
-
}) : /* @__PURE__ */ F(
|
|
5716
|
+
label: br
|
|
5717
|
+
}) : /* @__PURE__ */ F(Lr, {
|
|
5680
5718
|
value: l,
|
|
5681
5719
|
placeholder: "—",
|
|
5682
5720
|
onChange: a,
|
|
5683
5721
|
options: n.map((e) => ({
|
|
5684
5722
|
value: e,
|
|
5685
|
-
label:
|
|
5723
|
+
label: br(e),
|
|
5686
5724
|
disabled: u.has(e)
|
|
5687
5725
|
}))
|
|
5688
5726
|
});
|
|
5689
5727
|
break;
|
|
5690
5728
|
}
|
|
5691
5729
|
case "slot":
|
|
5692
|
-
d = /* @__PURE__ */ F(
|
|
5730
|
+
d = /* @__PURE__ */ F(Ua, {
|
|
5693
5731
|
name: e.id,
|
|
5694
5732
|
label: e.label,
|
|
5695
5733
|
options: e.options ?? [],
|
|
@@ -5700,19 +5738,19 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5700
5738
|
break;
|
|
5701
5739
|
case "multiselect": {
|
|
5702
5740
|
let n = i?.cards?.[e.id];
|
|
5703
|
-
d = n?.length ? /* @__PURE__ */ F(
|
|
5741
|
+
d = n?.length ? /* @__PURE__ */ F(Wa, {
|
|
5704
5742
|
cards: n,
|
|
5705
5743
|
value: t,
|
|
5706
5744
|
multi: !0,
|
|
5707
5745
|
runId: r,
|
|
5708
5746
|
onChange: a,
|
|
5709
5747
|
disabled: u
|
|
5710
|
-
}) : /* @__PURE__ */ F(
|
|
5748
|
+
}) : /* @__PURE__ */ F(Rr, {
|
|
5711
5749
|
multi: !0,
|
|
5712
5750
|
value: Array.isArray(t) ? t : [],
|
|
5713
5751
|
options: e.options ?? [],
|
|
5714
5752
|
onChange: a,
|
|
5715
|
-
label:
|
|
5753
|
+
label: br
|
|
5716
5754
|
});
|
|
5717
5755
|
break;
|
|
5718
5756
|
}
|
|
@@ -5751,7 +5789,7 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5751
5789
|
});
|
|
5752
5790
|
break;
|
|
5753
5791
|
case "toggle":
|
|
5754
|
-
d = /* @__PURE__ */ F(
|
|
5792
|
+
d = /* @__PURE__ */ F(Vr, {
|
|
5755
5793
|
checked: t === !0,
|
|
5756
5794
|
onChange: a,
|
|
5757
5795
|
label: e.label,
|
|
@@ -5761,7 +5799,7 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5761
5799
|
case "color":
|
|
5762
5800
|
d = /* @__PURE__ */ I("div", {
|
|
5763
5801
|
className: "flex items-center gap-3",
|
|
5764
|
-
children: [/* @__PURE__ */ F(
|
|
5802
|
+
children: [/* @__PURE__ */ F(Fr, {
|
|
5765
5803
|
value: l || "#e0531b",
|
|
5766
5804
|
onChange: (e) => a(e.target.value)
|
|
5767
5805
|
}), /* @__PURE__ */ F(X, {
|
|
@@ -5777,7 +5815,7 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5777
5815
|
break;
|
|
5778
5816
|
case "image":
|
|
5779
5817
|
case "file":
|
|
5780
|
-
d = /* @__PURE__ */ F(
|
|
5818
|
+
d = /* @__PURE__ */ F(Ra, {
|
|
5781
5819
|
field: e,
|
|
5782
5820
|
value: t,
|
|
5783
5821
|
runId: r,
|
|
@@ -5786,7 +5824,7 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5786
5824
|
});
|
|
5787
5825
|
break;
|
|
5788
5826
|
case "items":
|
|
5789
|
-
d = /* @__PURE__ */ F(
|
|
5827
|
+
d = /* @__PURE__ */ F(Ia, {
|
|
5790
5828
|
field: e,
|
|
5791
5829
|
value: t,
|
|
5792
5830
|
values: n,
|
|
@@ -5794,14 +5832,14 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5794
5832
|
});
|
|
5795
5833
|
break;
|
|
5796
5834
|
case "connection":
|
|
5797
|
-
d = /* @__PURE__ */ F(
|
|
5835
|
+
d = /* @__PURE__ */ F(xa, {
|
|
5798
5836
|
runId: r,
|
|
5799
5837
|
connection: i?.connections.find((t) => t.id === e.connection)
|
|
5800
5838
|
});
|
|
5801
5839
|
break;
|
|
5802
5840
|
case "list": {
|
|
5803
5841
|
let t = i?.lists.find((t) => t.def.id === e.list);
|
|
5804
|
-
d = t ? /* @__PURE__ */ F(
|
|
5842
|
+
d = t ? /* @__PURE__ */ F(wa, {
|
|
5805
5843
|
runId: r,
|
|
5806
5844
|
list: t,
|
|
5807
5845
|
editable: !0
|
|
@@ -5809,7 +5847,7 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5809
5847
|
break;
|
|
5810
5848
|
}
|
|
5811
5849
|
case "location":
|
|
5812
|
-
d = /* @__PURE__ */ F(
|
|
5850
|
+
d = /* @__PURE__ */ F(ca, {
|
|
5813
5851
|
value: t,
|
|
5814
5852
|
runId: r,
|
|
5815
5853
|
placeholder: e.placeholder,
|
|
@@ -5818,7 +5856,7 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5818
5856
|
});
|
|
5819
5857
|
break;
|
|
5820
5858
|
case "audio":
|
|
5821
|
-
d = c ? null : /* @__PURE__ */ F(
|
|
5859
|
+
d = c ? null : /* @__PURE__ */ F(Fa, {
|
|
5822
5860
|
value: t,
|
|
5823
5861
|
runId: r,
|
|
5824
5862
|
onChange: a,
|
|
@@ -5826,19 +5864,19 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5826
5864
|
});
|
|
5827
5865
|
break;
|
|
5828
5866
|
case "signature":
|
|
5829
|
-
d = /* @__PURE__ */ F(
|
|
5867
|
+
d = /* @__PURE__ */ F(ya, {
|
|
5830
5868
|
label: e.label,
|
|
5831
5869
|
value: t,
|
|
5832
5870
|
runId: r,
|
|
5833
5871
|
onChange: a
|
|
5834
5872
|
});
|
|
5835
5873
|
break;
|
|
5836
|
-
default: d = e.scan ? /* @__PURE__ */ F(
|
|
5874
|
+
default: d = e.scan ? /* @__PURE__ */ F(Ba, {
|
|
5837
5875
|
field: e,
|
|
5838
5876
|
value: l,
|
|
5839
5877
|
onChange: a
|
|
5840
5878
|
}) : /* @__PURE__ */ F(X, {
|
|
5841
|
-
...
|
|
5879
|
+
...za(e),
|
|
5842
5880
|
value: l,
|
|
5843
5881
|
placeholder: e.placeholder,
|
|
5844
5882
|
onChange: (e) => a(e.target.value)
|
|
@@ -5847,18 +5885,18 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5847
5885
|
return /* @__PURE__ */ I("div", { children: [
|
|
5848
5886
|
e.kind === "toggle" ? /* @__PURE__ */ I("div", {
|
|
5849
5887
|
className: "flex items-start justify-between gap-6",
|
|
5850
|
-
children: [/* @__PURE__ */ F(
|
|
5888
|
+
children: [/* @__PURE__ */ F(Hr, {
|
|
5851
5889
|
hint: e.help,
|
|
5852
5890
|
children: e.label
|
|
5853
5891
|
}), d]
|
|
5854
|
-
}) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(
|
|
5892
|
+
}) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Hr, {
|
|
5855
5893
|
hint: e.help,
|
|
5856
5894
|
required: e.required,
|
|
5857
5895
|
children: e.label
|
|
5858
5896
|
}), d] }),
|
|
5859
5897
|
c ? /* @__PURE__ */ F("div", {
|
|
5860
5898
|
className: "mt-1.5 text-[0.8125rem] text-ink-3",
|
|
5861
|
-
children: V("run.closed", { list: c.classes.map((e) => V(`run.cls.${
|
|
5899
|
+
children: V("run.closed", { list: c.classes.map((e) => V(`run.cls.${Ka(e)}`)).join(", ") })
|
|
5862
5900
|
}) : null,
|
|
5863
5901
|
s ? /* @__PURE__ */ F("div", {
|
|
5864
5902
|
className: "mt-1.5 text-[0.8125rem] text-rose",
|
|
@@ -5866,24 +5904,24 @@ function Ha({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
|
|
|
5866
5904
|
}) : null
|
|
5867
5905
|
] });
|
|
5868
5906
|
}
|
|
5869
|
-
function
|
|
5870
|
-
return e in
|
|
5907
|
+
function Ka(e) {
|
|
5908
|
+
return e in qa ? qa[e] : e === "account" ? "account" : "text";
|
|
5871
5909
|
}
|
|
5872
|
-
var
|
|
5910
|
+
var qa = {
|
|
5873
5911
|
classifier: "text",
|
|
5912
|
+
low: "text",
|
|
5874
5913
|
standard: "text",
|
|
5875
5914
|
high: "text",
|
|
5876
|
-
highest: "text",
|
|
5877
5915
|
image: "image",
|
|
5878
5916
|
video: "video",
|
|
5879
5917
|
speech: "speech",
|
|
5880
5918
|
audio: "audio"
|
|
5881
|
-
},
|
|
5882
|
-
function
|
|
5919
|
+
}, Ja = 3e3, Ya = /* @__PURE__ */ new Set();
|
|
5920
|
+
function Xa(e, t, n) {
|
|
5883
5921
|
let r = `${e.family}\n${e.url}`;
|
|
5884
|
-
if (
|
|
5885
|
-
|
|
5886
|
-
let i = !1, a = setTimeout(() => i || n(),
|
|
5922
|
+
if (Ya.has(r)) return;
|
|
5923
|
+
Ya.add(r);
|
|
5924
|
+
let i = !1, a = setTimeout(() => i || n(), Ja), o = () => {
|
|
5887
5925
|
i = !0, clearTimeout(a);
|
|
5888
5926
|
}, s = () => {
|
|
5889
5927
|
o(), n();
|
|
@@ -5904,8 +5942,8 @@ function qa(e, t, n) {
|
|
|
5904
5942
|
}
|
|
5905
5943
|
//#endregion
|
|
5906
5944
|
//#region ../runner/src/json-view.tsx
|
|
5907
|
-
var Z = (e) => e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e),
|
|
5908
|
-
function
|
|
5945
|
+
var Z = (e) => e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e), Za = "mb-1.5 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]";
|
|
5946
|
+
function Qa(e, t) {
|
|
5909
5947
|
if (e?.kind === "object") return e;
|
|
5910
5948
|
let n = [...new Set(t.flatMap((e) => Object.keys(e ?? {})))];
|
|
5911
5949
|
return {
|
|
@@ -5919,11 +5957,11 @@ function Ya(e, t) {
|
|
|
5919
5957
|
}))
|
|
5920
5958
|
};
|
|
5921
5959
|
}
|
|
5922
|
-
function
|
|
5960
|
+
function $a(e) {
|
|
5923
5961
|
let t = Object.values(e.fields), n = t.filter((e) => e.kind === "number").length;
|
|
5924
5962
|
return n >= 3 && n > t.length / 2;
|
|
5925
5963
|
}
|
|
5926
|
-
function
|
|
5964
|
+
function eo(e, t, n) {
|
|
5927
5965
|
if (t == null || t === "") return "";
|
|
5928
5966
|
switch (e.kind) {
|
|
5929
5967
|
case "number": return `${typeof t == "number" ? t.toLocaleString(B) : Z(t)}${e.unit ? ` ${e.unit}` : ""}`;
|
|
@@ -5935,7 +5973,7 @@ function Za(e, t, n) {
|
|
|
5935
5973
|
default: return Z(t);
|
|
5936
5974
|
}
|
|
5937
5975
|
}
|
|
5938
|
-
function
|
|
5976
|
+
function to({ items: e }) {
|
|
5939
5977
|
return /* @__PURE__ */ F("div", {
|
|
5940
5978
|
className: "flex flex-wrap gap-1.5",
|
|
5941
5979
|
children: e.map((e, t) => /* @__PURE__ */ F("span", {
|
|
@@ -5944,9 +5982,9 @@ function Qa({ items: e }) {
|
|
|
5944
5982
|
}, t))
|
|
5945
5983
|
});
|
|
5946
5984
|
}
|
|
5947
|
-
function
|
|
5948
|
-
let r = t.map((t) =>
|
|
5949
|
-
return r.every((e) => e.length <= 32) ? /* @__PURE__ */ F(
|
|
5985
|
+
function no({ of: e, values: t, root: n }) {
|
|
5986
|
+
let r = t.map((t) => eo(e, t, n)).filter(Boolean);
|
|
5987
|
+
return r.every((e) => e.length <= 32) ? /* @__PURE__ */ F(to, { items: r }) : /* @__PURE__ */ F("ul", {
|
|
5950
5988
|
className: "flex list-disc flex-col gap-1 pl-5 text-[0.9375rem]",
|
|
5951
5989
|
children: r.map((e, t) => /* @__PURE__ */ F("li", {
|
|
5952
5990
|
className: "break-words",
|
|
@@ -5954,7 +5992,7 @@ function $a({ of: e, values: t, root: n }) {
|
|
|
5954
5992
|
}, t))
|
|
5955
5993
|
});
|
|
5956
5994
|
}
|
|
5957
|
-
function
|
|
5995
|
+
function ro({ shape: e, rows: t, root: n }) {
|
|
5958
5996
|
let r = Object.entries(e.fields);
|
|
5959
5997
|
return /* @__PURE__ */ F("div", {
|
|
5960
5998
|
className: "overflow-x-auto rounded-lg ring-1 ring-border-soft",
|
|
@@ -5970,18 +6008,18 @@ function eo({ shape: e, rows: t, root: n }) {
|
|
|
5970
6008
|
className: "border-border-soft border-t",
|
|
5971
6009
|
children: r.map(([t, r]) => /* @__PURE__ */ F("td", {
|
|
5972
6010
|
className: q("px-3 py-2 tabular-nums", r.kind === "number" && "text-right"),
|
|
5973
|
-
children:
|
|
6011
|
+
children: eo(r, e?.[t], n)
|
|
5974
6012
|
}, t))
|
|
5975
6013
|
}, t)) })]
|
|
5976
6014
|
})
|
|
5977
6015
|
});
|
|
5978
6016
|
}
|
|
5979
|
-
function
|
|
6017
|
+
function io({ shape: e, rows: t, root: n }) {
|
|
5980
6018
|
let r = Object.entries(e.fields), i = r.find(([, e]) => e.kind === "text" && e.long)?.[0] ?? jt(e), a = r.filter(([e, t]) => e !== i && e !== "id" && t.kind !== "list"), o = !!r.find(([, e]) => e.kind === "text" && e.long);
|
|
5981
6019
|
return /* @__PURE__ */ F(o ? "ol" : "ul", {
|
|
5982
6020
|
className: "flex flex-col gap-1.5 text-[0.875rem]",
|
|
5983
6021
|
children: t.map((e, t) => {
|
|
5984
|
-
let r = [i ? Z(e?.[i]) : "", ...a.map(([t, r]) =>
|
|
6022
|
+
let r = [i ? Z(e?.[i]) : "", ...a.map(([t, r]) => eo(r, e?.[t], n))].filter(Boolean);
|
|
5985
6023
|
return /* @__PURE__ */ I("li", {
|
|
5986
6024
|
className: q(o && "grid grid-cols-[1.25rem_1fr] gap-1.5"),
|
|
5987
6025
|
children: [o ? /* @__PURE__ */ F("span", {
|
|
@@ -5995,7 +6033,7 @@ function to({ shape: e, rows: t, root: n }) {
|
|
|
5995
6033
|
})
|
|
5996
6034
|
});
|
|
5997
6035
|
}
|
|
5998
|
-
function
|
|
6036
|
+
function ao({ fields: e, entry: t }) {
|
|
5999
6037
|
let n = e.flatMap(([e, n]) => {
|
|
6000
6038
|
if (n.kind !== "yesno" || t[e] === void 0 || t[e] === null) return [];
|
|
6001
6039
|
let r = t[e] ? n.yes ?? L(e, n) : n.no;
|
|
@@ -6013,7 +6051,7 @@ function no({ fields: e, entry: t }) {
|
|
|
6013
6051
|
}, e.k))
|
|
6014
6052
|
}) : null;
|
|
6015
6053
|
}
|
|
6016
|
-
function
|
|
6054
|
+
function oo({ shape: e, rows: t, root: n }) {
|
|
6017
6055
|
let r = Object.entries(e.fields).filter(([e]) => e !== "id"), i = jt(e), a = r.filter(([, e]) => e.kind === "yesno"), o = r.filter(([e, t]) => e !== i && t.kind !== "yesno");
|
|
6018
6056
|
return /* @__PURE__ */ F("div", {
|
|
6019
6057
|
className: "divide-y divide-border-soft overflow-hidden rounded-xl bg-card ring-1 ring-border-soft",
|
|
@@ -6026,16 +6064,16 @@ function ro({ shape: e, rows: t, root: n }) {
|
|
|
6026
6064
|
children: i ? Z(e?.[i]) : ""
|
|
6027
6065
|
}), /* @__PURE__ */ F("div", {
|
|
6028
6066
|
className: "text-[0.8125rem] text-ink-3",
|
|
6029
|
-
children: o.map(([t, r]) =>
|
|
6067
|
+
children: o.map(([t, r]) => eo(r, e?.[t], n)).filter(Boolean).join(" · ")
|
|
6030
6068
|
})]
|
|
6031
|
-
}), /* @__PURE__ */ F(
|
|
6069
|
+
}), /* @__PURE__ */ F(ao, {
|
|
6032
6070
|
fields: a,
|
|
6033
6071
|
entry: e ?? {}
|
|
6034
6072
|
})]
|
|
6035
6073
|
}, t))
|
|
6036
6074
|
});
|
|
6037
6075
|
}
|
|
6038
|
-
function
|
|
6076
|
+
function so({ shape: e, entry: t, root: n }) {
|
|
6039
6077
|
let r = Object.entries(e.fields).filter(([e]) => e !== "id"), i = jt(e), a = r.find(([, e]) => e.kind === "text" && e.long), o = r.filter(([e, t]) => e !== i && e !== a?.[0] && (t.kind === "number" || t.kind === "choice" || t.kind === "score" || t.kind === "ref" || t.kind === "text" && !t.long)), s = r.filter(([, e]) => e.kind === "yesno"), c = r.filter(([e, t]) => t.kind === "text" && t.long && e !== a?.[0]), l = r.filter(([, e]) => e.kind === "list" || e.kind === "table");
|
|
6040
6078
|
return /* @__PURE__ */ I("article", {
|
|
6041
6079
|
className: "flex flex-col gap-2 rounded-xl bg-card p-4 ring-1 ring-border-soft",
|
|
@@ -6045,7 +6083,7 @@ function io({ shape: e, entry: t, root: n }) {
|
|
|
6045
6083
|
children: [/* @__PURE__ */ F("h4", {
|
|
6046
6084
|
className: "text-balance font-display font-semibold text-[1.0625rem] leading-snug",
|
|
6047
6085
|
children: i ? Z(t[i]) : ""
|
|
6048
|
-
}), /* @__PURE__ */ F(
|
|
6086
|
+
}), /* @__PURE__ */ F(ao, {
|
|
6049
6087
|
fields: s,
|
|
6050
6088
|
entry: t
|
|
6051
6089
|
})]
|
|
@@ -6056,7 +6094,7 @@ function io({ shape: e, entry: t, root: n }) {
|
|
|
6056
6094
|
}) : null,
|
|
6057
6095
|
o.length ? /* @__PURE__ */ F("div", {
|
|
6058
6096
|
className: "flex flex-wrap gap-1.5",
|
|
6059
|
-
children: o.map(([e, r]) =>
|
|
6097
|
+
children: o.map(([e, r]) => eo(r, t[e], n)).filter(Boolean).map((e, t) => /* @__PURE__ */ F("span", {
|
|
6060
6098
|
className: "rounded-full bg-paper-2 px-2 py-0.5 text-[0.75rem] text-ink-2",
|
|
6061
6099
|
children: e
|
|
6062
6100
|
}, t))
|
|
@@ -6073,14 +6111,14 @@ function io({ shape: e, entry: t, root: n }) {
|
|
|
6073
6111
|
return !Array.isArray(i) || !i.length ? null : /* @__PURE__ */ I("div", {
|
|
6074
6112
|
className: "border-border-soft border-t pt-2",
|
|
6075
6113
|
children: [/* @__PURE__ */ F("div", {
|
|
6076
|
-
className:
|
|
6114
|
+
className: Za,
|
|
6077
6115
|
children: L(e, r)
|
|
6078
|
-
}), r.kind === "list" && r.of.kind !== "object" ? /* @__PURE__ */ F(
|
|
6116
|
+
}), r.kind === "list" && r.of.kind !== "object" ? /* @__PURE__ */ F(no, {
|
|
6079
6117
|
of: r.of,
|
|
6080
6118
|
values: i,
|
|
6081
6119
|
root: n
|
|
6082
|
-
}) : /* @__PURE__ */ F(
|
|
6083
|
-
shape:
|
|
6120
|
+
}) : /* @__PURE__ */ F(io, {
|
|
6121
|
+
shape: Qa(r.kind === "list" ? r.of : void 0, i),
|
|
6084
6122
|
rows: i,
|
|
6085
6123
|
root: n
|
|
6086
6124
|
})]
|
|
@@ -6089,26 +6127,26 @@ function io({ shape: e, entry: t, root: n }) {
|
|
|
6089
6127
|
]
|
|
6090
6128
|
});
|
|
6091
6129
|
}
|
|
6092
|
-
function
|
|
6093
|
-
let r =
|
|
6094
|
-
return
|
|
6130
|
+
function co({ of: e, rows: t, root: n }) {
|
|
6131
|
+
let r = Qa(e, t);
|
|
6132
|
+
return $a(r) ? /* @__PURE__ */ F(ro, {
|
|
6095
6133
|
shape: r,
|
|
6096
6134
|
rows: t,
|
|
6097
6135
|
root: n
|
|
6098
6136
|
}) : Object.values(r.fields).some((e) => e.kind === "list" || e.kind === "table" || e.kind === "text" && e.long) ? /* @__PURE__ */ F("div", {
|
|
6099
6137
|
className: "grid grid-cols-[repeat(auto-fill,minmax(min(100%,16rem),1fr))] gap-3",
|
|
6100
|
-
children: t.map((e, t) => /* @__PURE__ */ F(
|
|
6138
|
+
children: t.map((e, t) => /* @__PURE__ */ F(so, {
|
|
6101
6139
|
shape: r,
|
|
6102
6140
|
entry: e ?? {},
|
|
6103
6141
|
root: n
|
|
6104
6142
|
}, t))
|
|
6105
|
-
}) : /* @__PURE__ */ F(
|
|
6143
|
+
}) : /* @__PURE__ */ F(oo, {
|
|
6106
6144
|
shape: r,
|
|
6107
6145
|
rows: t,
|
|
6108
6146
|
root: n
|
|
6109
6147
|
});
|
|
6110
6148
|
}
|
|
6111
|
-
function
|
|
6149
|
+
function lo({ step: e, json: t }) {
|
|
6112
6150
|
if (!t || typeof t != "object" || Array.isArray(t)) return /* @__PURE__ */ F("pre", {
|
|
6113
6151
|
className: "text-[0.8125rem]",
|
|
6114
6152
|
children: JSON.stringify(t, null, 2)
|
|
@@ -6118,12 +6156,12 @@ function oo({ step: e, json: t }) {
|
|
|
6118
6156
|
className: "flex flex-col gap-5",
|
|
6119
6157
|
children: Object.entries(n).map(([e, t]) => {
|
|
6120
6158
|
let i = r.fields[e], a = i ? L(e, i) : e, o;
|
|
6121
|
-
if (Array.isArray(t) && t.length && t.every((e) => e && typeof e == "object")) o = /* @__PURE__ */ F(
|
|
6159
|
+
if (Array.isArray(t) && t.length && t.every((e) => e && typeof e == "object")) o = /* @__PURE__ */ F(co, {
|
|
6122
6160
|
of: i?.kind === "list" ? i.of : void 0,
|
|
6123
6161
|
rows: t,
|
|
6124
6162
|
root: n
|
|
6125
6163
|
});
|
|
6126
|
-
else if (Array.isArray(t)) o = /* @__PURE__ */ F(
|
|
6164
|
+
else if (Array.isArray(t)) o = /* @__PURE__ */ F(no, {
|
|
6127
6165
|
of: i?.kind === "list" ? i.of : { kind: "text" },
|
|
6128
6166
|
values: t,
|
|
6129
6167
|
root: n
|
|
@@ -6136,11 +6174,11 @@ function oo({ step: e, json: t }) {
|
|
|
6136
6174
|
let e = i && i.kind !== "list" && i.kind !== "table" ? i : { kind: "text" };
|
|
6137
6175
|
o = /* @__PURE__ */ F("div", {
|
|
6138
6176
|
className: "whitespace-pre-wrap text-[0.9375rem] leading-relaxed",
|
|
6139
|
-
children:
|
|
6177
|
+
children: eo(e, t, n)
|
|
6140
6178
|
});
|
|
6141
6179
|
}
|
|
6142
6180
|
return /* @__PURE__ */ I("section", { children: [/* @__PURE__ */ F("div", {
|
|
6143
|
-
className:
|
|
6181
|
+
className: Za,
|
|
6144
6182
|
children: a
|
|
6145
6183
|
}), o] }, e);
|
|
6146
6184
|
})
|
|
@@ -6148,7 +6186,7 @@ function oo({ step: e, json: t }) {
|
|
|
6148
6186
|
}
|
|
6149
6187
|
//#endregion
|
|
6150
6188
|
//#region ../runner/src/pdf.ts
|
|
6151
|
-
var
|
|
6189
|
+
var uo = "#282623", fo = "#81807e", po = "#1a5fb4", mo = "#dbd9d6", ho = 483.28, go = {
|
|
6152
6190
|
amp: "&",
|
|
6153
6191
|
lt: "<",
|
|
6154
6192
|
gt: ">",
|
|
@@ -6157,17 +6195,17 @@ var so = "#282623", co = "#81807e", lo = "#1a5fb4", uo = "#dbd9d6", fo = 483.28,
|
|
|
6157
6195
|
"#39": "'",
|
|
6158
6196
|
nbsp: "\xA0"
|
|
6159
6197
|
};
|
|
6160
|
-
function
|
|
6198
|
+
function _o(e) {
|
|
6161
6199
|
return e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+\d*);/gi, (e, t) => {
|
|
6162
6200
|
if (t[0] === "#") {
|
|
6163
6201
|
let n = t[1]?.toLowerCase() === "x" ? Number.parseInt(t.slice(2), 16) : Number(t.slice(1));
|
|
6164
6202
|
return Number.isFinite(n) ? String.fromCodePoint(n) : e;
|
|
6165
6203
|
}
|
|
6166
|
-
return
|
|
6204
|
+
return go[t.toLowerCase()] ?? e;
|
|
6167
6205
|
});
|
|
6168
6206
|
}
|
|
6169
|
-
function
|
|
6170
|
-
return
|
|
6207
|
+
function vo(e) {
|
|
6208
|
+
return _o(e.replace(/<[^>]+>/g, "")).trim();
|
|
6171
6209
|
}
|
|
6172
6210
|
function Q(e, t = {}) {
|
|
6173
6211
|
let n = [];
|
|
@@ -6176,14 +6214,14 @@ function Q(e, t = {}) {
|
|
|
6176
6214
|
let e = r.tokens;
|
|
6177
6215
|
e?.length ? n.push(...Q(e, t)) : n.push({
|
|
6178
6216
|
...t,
|
|
6179
|
-
text:
|
|
6217
|
+
text: _o(r.text)
|
|
6180
6218
|
});
|
|
6181
6219
|
break;
|
|
6182
6220
|
}
|
|
6183
6221
|
case "escape":
|
|
6184
6222
|
n.push({
|
|
6185
6223
|
...t,
|
|
6186
|
-
text:
|
|
6224
|
+
text: _o(r.text)
|
|
6187
6225
|
});
|
|
6188
6226
|
break;
|
|
6189
6227
|
case "strong":
|
|
@@ -6207,7 +6245,7 @@ function Q(e, t = {}) {
|
|
|
6207
6245
|
case "codespan":
|
|
6208
6246
|
n.push({
|
|
6209
6247
|
...t,
|
|
6210
|
-
text:
|
|
6248
|
+
text: _o(r.text),
|
|
6211
6249
|
color: "#3d3b38"
|
|
6212
6250
|
});
|
|
6213
6251
|
break;
|
|
@@ -6216,7 +6254,7 @@ function Q(e, t = {}) {
|
|
|
6216
6254
|
n.push(...Q(e.tokens, {
|
|
6217
6255
|
...t,
|
|
6218
6256
|
link: e.href,
|
|
6219
|
-
color:
|
|
6257
|
+
color: po,
|
|
6220
6258
|
decoration: "underline"
|
|
6221
6259
|
}));
|
|
6222
6260
|
break;
|
|
@@ -6236,39 +6274,39 @@ function Q(e, t = {}) {
|
|
|
6236
6274
|
case "html":
|
|
6237
6275
|
n.push({
|
|
6238
6276
|
...t,
|
|
6239
|
-
text:
|
|
6277
|
+
text: vo(r.text)
|
|
6240
6278
|
});
|
|
6241
6279
|
break;
|
|
6242
6280
|
default: "tokens" in r && Array.isArray(r.tokens) ? n.push(...Q(r.tokens, t)) : "text" in r && typeof r.text == "string" && n.push({
|
|
6243
6281
|
...t,
|
|
6244
|
-
text:
|
|
6282
|
+
text: _o(r.text)
|
|
6245
6283
|
});
|
|
6246
6284
|
}
|
|
6247
6285
|
return n;
|
|
6248
6286
|
}
|
|
6249
|
-
function
|
|
6250
|
-
let t =
|
|
6287
|
+
function yo(e) {
|
|
6288
|
+
let t = So(e);
|
|
6251
6289
|
if (t.length === 1 && typeof t[0] == "object" && "style" in t[0]) {
|
|
6252
6290
|
let { style: e, ...n } = t[0];
|
|
6253
6291
|
return n;
|
|
6254
6292
|
}
|
|
6255
6293
|
return t.length === 1 ? t[0] : { stack: t };
|
|
6256
6294
|
}
|
|
6257
|
-
function
|
|
6295
|
+
function bo(e, t) {
|
|
6258
6296
|
return {
|
|
6259
6297
|
text: Q(e.tokens),
|
|
6260
6298
|
alignment: e.align ?? "left",
|
|
6261
6299
|
...t ? { style: "th" } : {}
|
|
6262
6300
|
};
|
|
6263
6301
|
}
|
|
6264
|
-
var
|
|
6302
|
+
var xo = {
|
|
6265
6303
|
hLineWidth: () => .5,
|
|
6266
6304
|
vLineWidth: () => 0,
|
|
6267
|
-
hLineColor: () =>
|
|
6305
|
+
hLineColor: () => mo,
|
|
6268
6306
|
paddingTop: () => 4,
|
|
6269
6307
|
paddingBottom: () => 4
|
|
6270
6308
|
};
|
|
6271
|
-
function
|
|
6309
|
+
function So(e) {
|
|
6272
6310
|
let t = [];
|
|
6273
6311
|
for (let n of e) switch (n.type) {
|
|
6274
6312
|
case "space": break;
|
|
@@ -6293,7 +6331,7 @@ function yo(e) {
|
|
|
6293
6331
|
});
|
|
6294
6332
|
break;
|
|
6295
6333
|
case "list": {
|
|
6296
|
-
let e = n, r = e.items.map((e) =>
|
|
6334
|
+
let e = n, r = e.items.map((e) => yo(e.tokens));
|
|
6297
6335
|
t.push(e.ordered ? {
|
|
6298
6336
|
ol: r,
|
|
6299
6337
|
style: "list",
|
|
@@ -6311,23 +6349,23 @@ function yo(e) {
|
|
|
6311
6349
|
table: {
|
|
6312
6350
|
headerRows: 1,
|
|
6313
6351
|
widths: e.header.map(() => "*"),
|
|
6314
|
-
body: [e.header.map((e) =>
|
|
6352
|
+
body: [e.header.map((e) => bo(e, !0)), ...e.rows.map((e) => e.map((e) => bo(e, !1)))]
|
|
6315
6353
|
},
|
|
6316
|
-
layout:
|
|
6354
|
+
layout: xo,
|
|
6317
6355
|
style: "table"
|
|
6318
6356
|
});
|
|
6319
6357
|
break;
|
|
6320
6358
|
}
|
|
6321
6359
|
case "code":
|
|
6322
6360
|
t.push({
|
|
6323
|
-
text:
|
|
6361
|
+
text: _o(n.text),
|
|
6324
6362
|
style: "code",
|
|
6325
6363
|
preserveLeadingSpaces: !0
|
|
6326
6364
|
});
|
|
6327
6365
|
break;
|
|
6328
6366
|
case "blockquote":
|
|
6329
6367
|
t.push({
|
|
6330
|
-
stack:
|
|
6368
|
+
stack: So(n.tokens),
|
|
6331
6369
|
style: "quote"
|
|
6332
6370
|
});
|
|
6333
6371
|
break;
|
|
@@ -6337,10 +6375,10 @@ function yo(e) {
|
|
|
6337
6375
|
type: "line",
|
|
6338
6376
|
x1: 0,
|
|
6339
6377
|
y1: 0,
|
|
6340
|
-
x2:
|
|
6378
|
+
x2: ho,
|
|
6341
6379
|
y2: 0,
|
|
6342
6380
|
lineWidth: .5,
|
|
6343
|
-
lineColor:
|
|
6381
|
+
lineColor: mo
|
|
6344
6382
|
}],
|
|
6345
6383
|
margin: [
|
|
6346
6384
|
0,
|
|
@@ -6351,7 +6389,7 @@ function yo(e) {
|
|
|
6351
6389
|
});
|
|
6352
6390
|
break;
|
|
6353
6391
|
case "html": {
|
|
6354
|
-
let e =
|
|
6392
|
+
let e = vo(n.text);
|
|
6355
6393
|
e && t.push({
|
|
6356
6394
|
text: e,
|
|
6357
6395
|
style: "p"
|
|
@@ -6362,16 +6400,16 @@ function yo(e) {
|
|
|
6362
6400
|
text: Q(n.tokens),
|
|
6363
6401
|
style: "p"
|
|
6364
6402
|
}) : "text" in n && typeof n.text == "string" && t.push({
|
|
6365
|
-
text:
|
|
6403
|
+
text: _o(n.text),
|
|
6366
6404
|
style: "p"
|
|
6367
6405
|
});
|
|
6368
6406
|
}
|
|
6369
6407
|
return t;
|
|
6370
6408
|
}
|
|
6371
|
-
function
|
|
6372
|
-
return
|
|
6409
|
+
function Co(e) {
|
|
6410
|
+
return So(ze.lexer(e));
|
|
6373
6411
|
}
|
|
6374
|
-
function
|
|
6412
|
+
function wo(e, t = (e) => e) {
|
|
6375
6413
|
if (!e || typeof e != "object") return [{
|
|
6376
6414
|
text: JSON.stringify(e, null, 2) ?? "",
|
|
6377
6415
|
style: "code"
|
|
@@ -6403,7 +6441,7 @@ function xo(e, t = (e) => e) {
|
|
|
6403
6441
|
style: "th"
|
|
6404
6442
|
})), ...e.map((e) => t.map((t) => ({ text: e[t] === null || e[t] === void 0 ? "" : String(e[t]) })))]
|
|
6405
6443
|
},
|
|
6406
|
-
layout:
|
|
6444
|
+
layout: xo,
|
|
6407
6445
|
style: "table"
|
|
6408
6446
|
});
|
|
6409
6447
|
} else n.push({
|
|
@@ -6412,8 +6450,8 @@ function xo(e, t = (e) => e) {
|
|
|
6412
6450
|
});
|
|
6413
6451
|
return n;
|
|
6414
6452
|
}
|
|
6415
|
-
function
|
|
6416
|
-
let t = e.json !== void 0 && e.json !== null ?
|
|
6453
|
+
function To(e) {
|
|
6454
|
+
let t = e.json !== void 0 && e.json !== null ? wo(e.json, e.label) : Co(e.text ?? ""), n = e.foot ?? "";
|
|
6417
6455
|
return {
|
|
6418
6456
|
info: { title: e.title },
|
|
6419
6457
|
pageSize: "A4",
|
|
@@ -6427,7 +6465,7 @@ function So(e) {
|
|
|
6427
6465
|
font: "Roboto",
|
|
6428
6466
|
fontSize: 10.5,
|
|
6429
6467
|
lineHeight: 1.3,
|
|
6430
|
-
color:
|
|
6468
|
+
color: uo
|
|
6431
6469
|
},
|
|
6432
6470
|
styles: {
|
|
6433
6471
|
title: {
|
|
@@ -6496,7 +6534,7 @@ function So(e) {
|
|
|
6496
6534
|
label: {
|
|
6497
6535
|
fontSize: 8,
|
|
6498
6536
|
bold: !0,
|
|
6499
|
-
color:
|
|
6537
|
+
color: fo,
|
|
6500
6538
|
characterSpacing: .6,
|
|
6501
6539
|
margin: [
|
|
6502
6540
|
0,
|
|
@@ -6533,12 +6571,12 @@ function So(e) {
|
|
|
6533
6571
|
footer: (e, t) => ({
|
|
6534
6572
|
columns: [{
|
|
6535
6573
|
text: n,
|
|
6536
|
-
color:
|
|
6574
|
+
color: fo,
|
|
6537
6575
|
fontSize: 8.5
|
|
6538
6576
|
}, {
|
|
6539
6577
|
text: `${e} / ${t}`,
|
|
6540
6578
|
alignment: "right",
|
|
6541
|
-
color:
|
|
6579
|
+
color: fo,
|
|
6542
6580
|
fontSize: 8.5
|
|
6543
6581
|
}],
|
|
6544
6582
|
margin: [
|
|
@@ -6550,80 +6588,80 @@ function So(e) {
|
|
|
6550
6588
|
})
|
|
6551
6589
|
};
|
|
6552
6590
|
}
|
|
6553
|
-
var
|
|
6591
|
+
var Eo = { Roboto: {
|
|
6554
6592
|
normal: "Roboto-Regular.ttf",
|
|
6555
6593
|
bold: "Roboto-Medium.ttf",
|
|
6556
6594
|
italics: "Roboto-Italic.ttf",
|
|
6557
6595
|
bolditalics: "Roboto-MediumItalic.ttf"
|
|
6558
|
-
} },
|
|
6559
|
-
function
|
|
6560
|
-
return
|
|
6596
|
+
} }, Do = null;
|
|
6597
|
+
function Oo() {
|
|
6598
|
+
return Do ??= Promise.all([import("pdfmake/build/pdfmake"), import("pdfmake/build/vfs_fonts")]).then(([e, t]) => {
|
|
6561
6599
|
let n = e.default;
|
|
6562
|
-
return n.addVirtualFileSystem(t.default), n.addFonts(
|
|
6600
|
+
return n.addVirtualFileSystem(t.default), n.addFonts(Eo), n;
|
|
6563
6601
|
}).catch((e) => {
|
|
6564
|
-
throw
|
|
6565
|
-
}),
|
|
6602
|
+
throw Do = null, e;
|
|
6603
|
+
}), Do;
|
|
6566
6604
|
}
|
|
6567
|
-
function
|
|
6605
|
+
function ko(e) {
|
|
6568
6606
|
return e.replace(/[\\/:*?"<>|]+|\p{Cc}+/gu, "-").replace(/\s+/g, " ").trim() || "result";
|
|
6569
6607
|
}
|
|
6570
|
-
async function
|
|
6571
|
-
let t = await (await
|
|
6572
|
-
return new File([t], `${
|
|
6608
|
+
async function Ao(e) {
|
|
6609
|
+
let t = await (await Oo()).createPdf(To(e)).getBlob();
|
|
6610
|
+
return new File([t], `${ko(e.title)}.pdf`, { type: "application/pdf" });
|
|
6573
6611
|
}
|
|
6574
6612
|
//#endregion
|
|
6575
6613
|
//#region ../runner/src/surface.tsx
|
|
6576
|
-
var $ = (e) => e == null ? "" : typeof e == "boolean" ? V(e ? "run.yes" : "run.no") : typeof e == "object" ? JSON.stringify(e) : String(e),
|
|
6614
|
+
var $ = (e) => e == null ? "" : typeof e == "boolean" ? V(e ? "run.yes" : "run.no") : typeof e == "object" ? JSON.stringify(e) : String(e), jo = (e) => {
|
|
6577
6615
|
let t = typeof e == "number" ? e : Number(String(e ?? "").replace(",", "."));
|
|
6578
6616
|
return Number.isFinite(t) ? t : 0;
|
|
6579
6617
|
};
|
|
6580
|
-
function
|
|
6618
|
+
function Mo(e, t) {
|
|
6581
6619
|
let n = $(e);
|
|
6582
6620
|
return n ? /^(https?:|data:|\/)/.test(n) ? n : t(n) : null;
|
|
6583
6621
|
}
|
|
6584
|
-
function
|
|
6622
|
+
function No(e, t, n, r) {
|
|
6585
6623
|
return R(e[t], n.data, r);
|
|
6586
6624
|
}
|
|
6587
|
-
function
|
|
6625
|
+
function Po(e, t, n) {
|
|
6588
6626
|
let r = $(t) || "label", i = $(n) || "value";
|
|
6589
6627
|
return Array.isArray(e) ? e.map((e) => ({
|
|
6590
6628
|
label: $(e?.[r]),
|
|
6591
|
-
value:
|
|
6629
|
+
value: jo(e?.[i])
|
|
6592
6630
|
})) : [];
|
|
6593
6631
|
}
|
|
6594
|
-
function
|
|
6632
|
+
function Fo({ c: e, ctx: t, row: n }) {
|
|
6595
6633
|
let r = e.children;
|
|
6596
6634
|
if (!r) return null;
|
|
6597
|
-
if (Array.isArray(r)) return /* @__PURE__ */ F(P, { children: r.map((e) => /* @__PURE__ */ F(
|
|
6635
|
+
if (Array.isArray(r)) return /* @__PURE__ */ F(P, { children: r.map((e) => /* @__PURE__ */ F(Zo, {
|
|
6598
6636
|
id: e,
|
|
6599
6637
|
ctx: t,
|
|
6600
6638
|
row: n
|
|
6601
6639
|
}, e)) });
|
|
6602
6640
|
let i = R({ path: r.path }, t.data, n);
|
|
6603
|
-
return /* @__PURE__ */ F(P, { children: (Array.isArray(i) ? i : []).map((e, n) => /* @__PURE__ */ F(
|
|
6641
|
+
return /* @__PURE__ */ F(P, { children: (Array.isArray(i) ? i : []).map((e, n) => /* @__PURE__ */ F(Zo, {
|
|
6604
6642
|
id: r.componentId,
|
|
6605
6643
|
ctx: t,
|
|
6606
6644
|
row: e
|
|
6607
6645
|
}, n)) });
|
|
6608
6646
|
}
|
|
6609
|
-
var
|
|
6647
|
+
var Io = {
|
|
6610
6648
|
success: "bg-second-tint text-second",
|
|
6611
6649
|
warning: "bg-amber-tint text-ink-2",
|
|
6612
6650
|
accent: "bg-ember-tint text-ember-strong",
|
|
6613
6651
|
default: "bg-paper-2 text-ink-2"
|
|
6614
|
-
},
|
|
6615
|
-
function
|
|
6652
|
+
}, Lo = (e) => Array.isArray(e) ? e : [];
|
|
6653
|
+
function Ro(e, t) {
|
|
6616
6654
|
return typeof e != "object" || !e ? t === "" ? e : void 0 : e[t];
|
|
6617
6655
|
}
|
|
6618
|
-
function
|
|
6656
|
+
function zo(e, t) {
|
|
6619
6657
|
if (typeof e != "object" || !e) return $(e);
|
|
6620
6658
|
let n = e;
|
|
6621
6659
|
return $(t ? n[t] : n.label ?? n.name ?? n.title ?? n.text);
|
|
6622
6660
|
}
|
|
6623
|
-
function
|
|
6661
|
+
function Bo(e, t, n) {
|
|
6624
6662
|
let r = /* @__PURE__ */ new Map();
|
|
6625
6663
|
for (let n of e) {
|
|
6626
|
-
let e = $(
|
|
6664
|
+
let e = $(Ro(n, t));
|
|
6627
6665
|
r.set(e, [...r.get(e) ?? [], n]);
|
|
6628
6666
|
}
|
|
6629
6667
|
let i = (e) => {
|
|
@@ -6632,8 +6670,8 @@ function Lo(e, t, n) {
|
|
|
6632
6670
|
};
|
|
6633
6671
|
return [...r.entries()].sort((e, t) => i(e[0]) - i(t[0]));
|
|
6634
6672
|
}
|
|
6635
|
-
var
|
|
6636
|
-
function
|
|
6673
|
+
var Vo = (e) => e ? `${$(e)} ${B === "de" ? "Min" : "min"}` : "";
|
|
6674
|
+
function Ho({ items: e }) {
|
|
6637
6675
|
return e.length ? /* @__PURE__ */ F("div", {
|
|
6638
6676
|
className: "flex flex-wrap gap-1.5",
|
|
6639
6677
|
children: e.map((e, t) => /* @__PURE__ */ F("span", {
|
|
@@ -6642,12 +6680,12 @@ function zo({ items: e }) {
|
|
|
6642
6680
|
}, t))
|
|
6643
6681
|
}) : null;
|
|
6644
6682
|
}
|
|
6645
|
-
function
|
|
6683
|
+
function Uo(e, t, n) {
|
|
6646
6684
|
let r = e.meta;
|
|
6647
6685
|
return (Array.isArray(r) ? r : [r]).map((e) => $(R(e, t.data, n))).filter(Boolean);
|
|
6648
6686
|
}
|
|
6649
|
-
function
|
|
6650
|
-
let [r, i] = M("0"), a =
|
|
6687
|
+
function Wo({ c: e, ctx: t, row: n }) {
|
|
6688
|
+
let [r, i] = M("0"), a = Lo(e.tabs), o = a.map((e, r) => {
|
|
6651
6689
|
let i = R(e?.count, t.data, n), a = Array.isArray(i) ? i.length : i, o = $(R(e?.label, t.data, n));
|
|
6652
6690
|
return {
|
|
6653
6691
|
id: String(r),
|
|
@@ -6658,24 +6696,24 @@ function Vo({ c: e, ctx: t, row: n }) {
|
|
|
6658
6696
|
className: "flex flex-col gap-4",
|
|
6659
6697
|
children: [/* @__PURE__ */ F("div", {
|
|
6660
6698
|
className: "sticky top-2 z-10 max-w-full self-start overflow-x-auto rounded-full",
|
|
6661
|
-
children: /* @__PURE__ */ F(
|
|
6699
|
+
children: /* @__PURE__ */ F(Br, {
|
|
6662
6700
|
value: r,
|
|
6663
6701
|
onChange: i,
|
|
6664
6702
|
options: o
|
|
6665
6703
|
})
|
|
6666
|
-
}), typeof s == "string" ? /* @__PURE__ */ F(
|
|
6704
|
+
}), typeof s == "string" ? /* @__PURE__ */ F(Zo, {
|
|
6667
6705
|
id: s,
|
|
6668
6706
|
ctx: t,
|
|
6669
6707
|
row: n
|
|
6670
6708
|
}) : null]
|
|
6671
6709
|
});
|
|
6672
6710
|
}
|
|
6673
|
-
function
|
|
6674
|
-
let r = (r) =>
|
|
6711
|
+
function Go({ c: e, ctx: t, row: n }) {
|
|
6712
|
+
let r = (r) => No(e, r, t, n), [i, a] = M(!1), o = Lo(r("items")), s = $(r("labelKey")), c = $(r("detailKey")) || "amount", l = $(r("noteKey")), u = $(r("noteFormat")), d = $(r("groupKey")), f = Lo(r("groupOrder")).map($), p = t.state[e.id] ?? {}, m = (e, t) => `${t}:${zo(e, s)}`, g = o.filter((e, t) => p[m(e, t)]).length, _ = o.map((e, t) => ({
|
|
6675
6713
|
item: e,
|
|
6676
6714
|
i: t
|
|
6677
|
-
})), v = d ?
|
|
6678
|
-
let t = l ?
|
|
6715
|
+
})), v = d ? Bo(o, d, f).map(([e]) => [e, _.filter(({ item: t }) => $(Ro(t, d)) === e)]) : [["", _]], y = (e) => $(Ro(e, c)), b = r("noteMap"), x = (e) => {
|
|
6716
|
+
let t = l ? Ro(e, l) : void 0;
|
|
6679
6717
|
if (typeof t == "boolean") return $((b && typeof b == "object" ? b[String(t)] : "") ?? "");
|
|
6680
6718
|
let n = Array.isArray(t) ? t.map($).join(", ") : $(t);
|
|
6681
6719
|
return n && u ? u.replace("{}", n) : n;
|
|
@@ -6703,7 +6741,7 @@ function Ho({ c: e, ctx: t, row: n }) {
|
|
|
6703
6741
|
type: "button",
|
|
6704
6742
|
onClick: async () => {
|
|
6705
6743
|
let e = v.map(([e, t]) => {
|
|
6706
|
-
let n = t.filter(({ item: e, i: t }) => !p[m(e, t)]).map(({ item: e }) => `☐ ${
|
|
6744
|
+
let n = t.filter(({ item: e, i: t }) => !p[m(e, t)]).map(({ item: e }) => `☐ ${zo(e, s)}${y(e) ? ` – ${y(e)}` : ""}`);
|
|
6707
6745
|
return n.length ? [e, ...n].filter(Boolean).join("\n") : "";
|
|
6708
6746
|
}).filter(Boolean).join("\n\n");
|
|
6709
6747
|
try {
|
|
@@ -6735,7 +6773,7 @@ function Ho({ c: e, ctx: t, row: n }) {
|
|
|
6735
6773
|
className: "min-w-0 flex-1",
|
|
6736
6774
|
children: [/* @__PURE__ */ I("span", {
|
|
6737
6775
|
className: q("text-[0.9375rem]", a && "text-ink-3 line-through"),
|
|
6738
|
-
children: [
|
|
6776
|
+
children: [zo(n, s), y(n) ? /* @__PURE__ */ I("span", {
|
|
6739
6777
|
className: "text-ink-3",
|
|
6740
6778
|
children: [" · ", y(n)]
|
|
6741
6779
|
}) : null]
|
|
@@ -6749,7 +6787,7 @@ function Ho({ c: e, ctx: t, row: n }) {
|
|
|
6749
6787
|
}, n))]
|
|
6750
6788
|
});
|
|
6751
6789
|
}
|
|
6752
|
-
function
|
|
6790
|
+
function Ko({ data: e }) {
|
|
6753
6791
|
let t = Math.max(1, ...e.map((e) => e.value));
|
|
6754
6792
|
return /* @__PURE__ */ F("div", {
|
|
6755
6793
|
className: "flex flex-col gap-1.5",
|
|
@@ -6775,8 +6813,8 @@ function Uo({ data: e }) {
|
|
|
6775
6813
|
}, n))
|
|
6776
6814
|
});
|
|
6777
6815
|
}
|
|
6778
|
-
function
|
|
6779
|
-
if (e.length < 2) return /* @__PURE__ */ F(
|
|
6816
|
+
function qo({ data: e }) {
|
|
6817
|
+
if (e.length < 2) return /* @__PURE__ */ F(Ko, { data: e });
|
|
6780
6818
|
let t = Math.max(...e.map((e) => e.value)), n = Math.min(...e.map((e) => e.value)), r = t - n || 1, i = e.map((t, i) => [i / (e.length - 1) * 312 + 4, 116 - (t.value - n) / r * 112]);
|
|
6781
6819
|
return /* @__PURE__ */ I("figure", { children: [/* @__PURE__ */ I("svg", {
|
|
6782
6820
|
viewBox: "0 0 320 120",
|
|
@@ -6800,14 +6838,14 @@ function Wo({ data: e }) {
|
|
|
6800
6838
|
children: [/* @__PURE__ */ F("span", { children: e[0].label }), /* @__PURE__ */ F("span", { children: e.at(-1)?.label })]
|
|
6801
6839
|
})] });
|
|
6802
6840
|
}
|
|
6803
|
-
var
|
|
6841
|
+
var Jo = [
|
|
6804
6842
|
"var(--color-ember)",
|
|
6805
6843
|
"var(--color-cobalt)",
|
|
6806
6844
|
"var(--color-moss)",
|
|
6807
6845
|
"var(--color-amber)",
|
|
6808
6846
|
"var(--color-ink-3)"
|
|
6809
6847
|
];
|
|
6810
|
-
function
|
|
6848
|
+
function Yo({ data: e }) {
|
|
6811
6849
|
let t = e.reduce((e, t) => e + Math.max(0, t.value), 0) || 1, n = 0, r = 2 * Math.PI * 40;
|
|
6812
6850
|
return /* @__PURE__ */ I("div", {
|
|
6813
6851
|
className: "flex items-center gap-4",
|
|
@@ -6821,7 +6859,7 @@ function Ko({ data: e }) {
|
|
|
6821
6859
|
cy: "50",
|
|
6822
6860
|
r: 40,
|
|
6823
6861
|
fill: "none",
|
|
6824
|
-
stroke:
|
|
6862
|
+
stroke: Jo[i % Jo.length],
|
|
6825
6863
|
strokeWidth: "16",
|
|
6826
6864
|
strokeDasharray: `${a} ${r - a}`,
|
|
6827
6865
|
strokeDashoffset: -n,
|
|
@@ -6836,7 +6874,7 @@ function Ko({ data: e }) {
|
|
|
6836
6874
|
children: [
|
|
6837
6875
|
/* @__PURE__ */ F("span", {
|
|
6838
6876
|
className: "size-2.5 rounded-full",
|
|
6839
|
-
style: { background:
|
|
6877
|
+
style: { background: Jo[t % Jo.length] }
|
|
6840
6878
|
}),
|
|
6841
6879
|
/* @__PURE__ */ F("span", {
|
|
6842
6880
|
className: "text-ink-2",
|
|
@@ -6851,7 +6889,7 @@ function Ko({ data: e }) {
|
|
|
6851
6889
|
})]
|
|
6852
6890
|
});
|
|
6853
6891
|
}
|
|
6854
|
-
function
|
|
6892
|
+
function Xo({ title: e, children: t }) {
|
|
6855
6893
|
return /* @__PURE__ */ I("div", {
|
|
6856
6894
|
className: "rounded-xl bg-card p-4 ring-1 ring-border-soft",
|
|
6857
6895
|
children: [e ? /* @__PURE__ */ F("div", {
|
|
@@ -6860,14 +6898,14 @@ function qo({ title: e, children: t }) {
|
|
|
6860
6898
|
}) : null, t]
|
|
6861
6899
|
});
|
|
6862
6900
|
}
|
|
6863
|
-
function
|
|
6901
|
+
function Zo({ id: e, ctx: t, row: n }) {
|
|
6864
6902
|
let r = t.byId.get(e);
|
|
6865
6903
|
if (!r) return null;
|
|
6866
|
-
let i = (e) =>
|
|
6904
|
+
let i = (e) => No(r, e, t, n);
|
|
6867
6905
|
switch (r.component) {
|
|
6868
6906
|
case "Column": return /* @__PURE__ */ F("div", {
|
|
6869
6907
|
className: "flex flex-col gap-4",
|
|
6870
|
-
children: /* @__PURE__ */ F(
|
|
6908
|
+
children: /* @__PURE__ */ F(Fo, {
|
|
6871
6909
|
c: r,
|
|
6872
6910
|
ctx: t,
|
|
6873
6911
|
row: n
|
|
@@ -6882,14 +6920,14 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
6882
6920
|
}
|
|
6883
6921
|
case "List": return /* @__PURE__ */ F("div", {
|
|
6884
6922
|
className: "flex flex-col divide-y divide-border-soft overflow-hidden rounded-xl bg-card ring-1 ring-border-soft",
|
|
6885
|
-
children: /* @__PURE__ */ F(
|
|
6923
|
+
children: /* @__PURE__ */ F(Fo, {
|
|
6886
6924
|
c: r,
|
|
6887
6925
|
ctx: t,
|
|
6888
6926
|
row: n
|
|
6889
6927
|
})
|
|
6890
6928
|
});
|
|
6891
6929
|
case "Row": {
|
|
6892
|
-
let e =
|
|
6930
|
+
let e = Mo(i("image"), t.assetUrl), n = $(i("badge"));
|
|
6893
6931
|
return /* @__PURE__ */ I("div", {
|
|
6894
6932
|
className: "flex items-center gap-3 px-4 py-3",
|
|
6895
6933
|
children: [
|
|
@@ -6913,7 +6951,7 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
6913
6951
|
children: $(i("meta"))
|
|
6914
6952
|
}) : null,
|
|
6915
6953
|
n ? /* @__PURE__ */ F("span", {
|
|
6916
|
-
className: q("shrink-0 rounded-full px-2 py-0.5 text-[0.75rem]",
|
|
6954
|
+
className: q("shrink-0 rounded-full px-2 py-0.5 text-[0.75rem]", Io[$(i("badgeTone"))] ?? Io.default),
|
|
6917
6955
|
children: n
|
|
6918
6956
|
}) : null
|
|
6919
6957
|
]
|
|
@@ -6936,15 +6974,15 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
6936
6974
|
});
|
|
6937
6975
|
}
|
|
6938
6976
|
case "Badge": return /* @__PURE__ */ F("span", {
|
|
6939
|
-
className: q("inline-flex w-fit rounded-full px-2.5 py-0.5 text-[0.75rem]",
|
|
6977
|
+
className: q("inline-flex w-fit rounded-full px-2.5 py-0.5 text-[0.75rem]", Io[$(i("tone"))] ?? Io.default),
|
|
6940
6978
|
children: $(i("label"))
|
|
6941
6979
|
});
|
|
6942
6980
|
case "Grid": {
|
|
6943
|
-
let e = Math.min(4, Math.max(1,
|
|
6981
|
+
let e = Math.min(4, Math.max(1, jo(i("columns")) || 2)), a = Math.min(24, Math.max(6, jo(i("min")) || (e > 2 ? 9 : 12)));
|
|
6944
6982
|
return /* @__PURE__ */ F("div", {
|
|
6945
6983
|
className: "grid gap-3",
|
|
6946
6984
|
style: { gridTemplateColumns: `repeat(auto-fit, minmax(min(100%, ${a}rem), 1fr))` },
|
|
6947
|
-
children: /* @__PURE__ */ F(
|
|
6985
|
+
children: /* @__PURE__ */ F(Fo, {
|
|
6948
6986
|
c: r,
|
|
6949
6987
|
ctx: t,
|
|
6950
6988
|
row: n
|
|
@@ -6997,28 +7035,28 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
6997
7035
|
});
|
|
6998
7036
|
}
|
|
6999
7037
|
case "Image": {
|
|
7000
|
-
let e =
|
|
7038
|
+
let e = Mo(i("src"), t.assetUrl);
|
|
7001
7039
|
return e ? /* @__PURE__ */ F("img", {
|
|
7002
7040
|
src: e,
|
|
7003
7041
|
alt: $(i("alt")),
|
|
7004
7042
|
className: "w-full rounded-xl"
|
|
7005
7043
|
}) : null;
|
|
7006
7044
|
}
|
|
7007
|
-
case "BarChart": return /* @__PURE__ */ F(
|
|
7045
|
+
case "BarChart": return /* @__PURE__ */ F(Xo, {
|
|
7008
7046
|
title: $(i("title")),
|
|
7009
|
-
children: /* @__PURE__ */ F(
|
|
7047
|
+
children: /* @__PURE__ */ F(Ko, { data: Po(i("points"), i("labelKey"), i("valueKey")) })
|
|
7010
7048
|
});
|
|
7011
|
-
case "LineChart": return /* @__PURE__ */ F(
|
|
7049
|
+
case "LineChart": return /* @__PURE__ */ F(Xo, {
|
|
7012
7050
|
title: $(i("title")),
|
|
7013
|
-
children: /* @__PURE__ */ F(
|
|
7051
|
+
children: /* @__PURE__ */ F(qo, { data: Po(i("points"), i("labelKey"), i("valueKey")) })
|
|
7014
7052
|
});
|
|
7015
|
-
case "DonutChart": return /* @__PURE__ */ F(
|
|
7053
|
+
case "DonutChart": return /* @__PURE__ */ F(Xo, {
|
|
7016
7054
|
title: $(i("title")),
|
|
7017
|
-
children: /* @__PURE__ */ F(
|
|
7055
|
+
children: /* @__PURE__ */ F(Yo, { data: Po(i("slices"), i("labelKey"), i("valueKey")) })
|
|
7018
7056
|
});
|
|
7019
7057
|
case "Actions": return /* @__PURE__ */ F("div", {
|
|
7020
7058
|
className: "flex flex-wrap gap-2",
|
|
7021
|
-
children: /* @__PURE__ */ F(
|
|
7059
|
+
children: /* @__PURE__ */ F(Fo, {
|
|
7022
7060
|
c: r,
|
|
7023
7061
|
ctx: t,
|
|
7024
7062
|
row: n
|
|
@@ -7031,7 +7069,7 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7031
7069
|
onClick: () => {
|
|
7032
7070
|
let n = i("target");
|
|
7033
7071
|
if (e === "open") {
|
|
7034
|
-
let e =
|
|
7072
|
+
let e = Mo(n, t.assetUrl);
|
|
7035
7073
|
e && window.open(e, "_blank", "noopener");
|
|
7036
7074
|
return;
|
|
7037
7075
|
}
|
|
@@ -7044,13 +7082,13 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7044
7082
|
children: $(i("label"))
|
|
7045
7083
|
});
|
|
7046
7084
|
}
|
|
7047
|
-
case "Tabs": return /* @__PURE__ */ F(
|
|
7085
|
+
case "Tabs": return /* @__PURE__ */ F(Wo, {
|
|
7048
7086
|
c: r,
|
|
7049
7087
|
ctx: t,
|
|
7050
7088
|
row: n
|
|
7051
7089
|
});
|
|
7052
7090
|
case "Card": {
|
|
7053
|
-
let e =
|
|
7091
|
+
let e = Mo(i("image"), t.assetUrl), a = $(i("eyebrow")), o = $(i("subtitle"));
|
|
7054
7092
|
return /* @__PURE__ */ I("article", {
|
|
7055
7093
|
className: "overflow-hidden rounded-xl bg-card ring-1 ring-border-soft",
|
|
7056
7094
|
children: [
|
|
@@ -7074,12 +7112,12 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7074
7112
|
className: "text-[0.875rem] text-ink-3 leading-relaxed",
|
|
7075
7113
|
children: o
|
|
7076
7114
|
}) : null,
|
|
7077
|
-
/* @__PURE__ */ F(
|
|
7115
|
+
/* @__PURE__ */ F(Ho, { items: Uo(r, t, n) })
|
|
7078
7116
|
]
|
|
7079
7117
|
}),
|
|
7080
7118
|
r.children ? /* @__PURE__ */ F("div", {
|
|
7081
7119
|
className: "flex flex-col gap-3 border-border-soft border-t px-4 py-3.5 empty:hidden",
|
|
7082
|
-
children: /* @__PURE__ */ F(
|
|
7120
|
+
children: /* @__PURE__ */ F(Fo, {
|
|
7083
7121
|
c: r,
|
|
7084
7122
|
ctx: t,
|
|
7085
7123
|
row: n
|
|
@@ -7096,7 +7134,7 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7096
7134
|
children: [$(i("title")), /* @__PURE__ */ F(g, { className: "size-4 text-ink-3 transition-transform group-open:rotate-90 motion-reduce:transition-none" })]
|
|
7097
7135
|
}), /* @__PURE__ */ F("div", {
|
|
7098
7136
|
className: "flex flex-col gap-3 pt-3",
|
|
7099
|
-
children: /* @__PURE__ */ F(
|
|
7137
|
+
children: /* @__PURE__ */ F(Fo, {
|
|
7100
7138
|
c: r,
|
|
7101
7139
|
ctx: t,
|
|
7102
7140
|
row: n
|
|
@@ -7106,15 +7144,15 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7106
7144
|
case "Group": {
|
|
7107
7145
|
let e = r.children;
|
|
7108
7146
|
if (!e || Array.isArray(e)) return null;
|
|
7109
|
-
let a =
|
|
7147
|
+
let a = Lo(R({ path: e.path }, t.data, n));
|
|
7110
7148
|
return /* @__PURE__ */ F("div", {
|
|
7111
7149
|
className: "flex flex-col gap-5",
|
|
7112
|
-
children:
|
|
7150
|
+
children: Bo(a, $(i("by")), Lo(i("order")).map($)).map(([n, r]) => /* @__PURE__ */ I("section", {
|
|
7113
7151
|
className: "flex flex-col gap-2",
|
|
7114
7152
|
children: [n ? /* @__PURE__ */ F("h4", {
|
|
7115
7153
|
className: "font-semibold text-[0.6875rem] text-second uppercase tracking-[0.14em]",
|
|
7116
7154
|
children: n
|
|
7117
|
-
}) : null, r.map((n, r) => /* @__PURE__ */ F(
|
|
7155
|
+
}) : null, r.map((n, r) => /* @__PURE__ */ F(Zo, {
|
|
7118
7156
|
id: e.componentId,
|
|
7119
7157
|
ctx: t,
|
|
7120
7158
|
row: n
|
|
@@ -7131,17 +7169,17 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7131
7169
|
children: r
|
|
7132
7170
|
}) : null, /* @__PURE__ */ F("div", {
|
|
7133
7171
|
className: "flex flex-wrap gap-1.5",
|
|
7134
|
-
children:
|
|
7135
|
-
let a = !!(t &&
|
|
7172
|
+
children: Lo(i("items")).map((r, i) => {
|
|
7173
|
+
let a = !!(t && Ro(r, t));
|
|
7136
7174
|
return /* @__PURE__ */ I("span", {
|
|
7137
7175
|
className: q("rounded-full px-2.5 py-1 text-[0.8125rem]", a ? "bg-amber-tint font-medium text-ink ring-1 ring-amber/60" : "bg-card text-ink-2 ring-1 ring-border-soft"),
|
|
7138
|
-
children: [
|
|
7176
|
+
children: [zo(r, e), a && n ? ` · ${n}` : ""]
|
|
7139
7177
|
}, i);
|
|
7140
7178
|
})
|
|
7141
7179
|
})]
|
|
7142
7180
|
});
|
|
7143
7181
|
}
|
|
7144
|
-
case "Checklist": return /* @__PURE__ */ F(
|
|
7182
|
+
case "Checklist": return /* @__PURE__ */ F(Go, {
|
|
7145
7183
|
c: r,
|
|
7146
7184
|
ctx: t,
|
|
7147
7185
|
row: n
|
|
@@ -7150,8 +7188,8 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7150
7188
|
let e = $(i("textKey")) || "text", t = $(i("minutesKey")) || "minutes";
|
|
7151
7189
|
return /* @__PURE__ */ F("ol", {
|
|
7152
7190
|
className: "flex flex-col gap-3",
|
|
7153
|
-
children:
|
|
7154
|
-
let i = $(typeof n == "object" ?
|
|
7191
|
+
children: Lo(i("items")).map((n, r) => {
|
|
7192
|
+
let i = $(typeof n == "object" ? Ro(n, e) : n), a = Vo(Ro(n, t));
|
|
7155
7193
|
return /* @__PURE__ */ I("li", {
|
|
7156
7194
|
className: "grid grid-cols-[1.5rem_1fr] gap-2",
|
|
7157
7195
|
children: [/* @__PURE__ */ F("span", {
|
|
@@ -7169,9 +7207,9 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7169
7207
|
});
|
|
7170
7208
|
}
|
|
7171
7209
|
case "Link": {
|
|
7172
|
-
let e = $(i("key")) || "id", n = $(i("value")), a =
|
|
7210
|
+
let e = $(i("key")) || "id", n = $(i("value")), a = Lo(i("items")).find((t) => $(Ro(t, e)) === n), o = r.view;
|
|
7173
7211
|
if (a === void 0) return null;
|
|
7174
|
-
let s = (e) => R(r[e], t.data, a), c = $(i("eyebrow")), l =
|
|
7212
|
+
let s = (e) => R(r[e], t.data, a), c = $(i("eyebrow")), l = Uo(r, t, a);
|
|
7175
7213
|
return /* @__PURE__ */ I("button", {
|
|
7176
7214
|
type: "button",
|
|
7177
7215
|
onClick: () => typeof o == "string" && t.open(o, a),
|
|
@@ -7203,7 +7241,7 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7203
7241
|
let e = $(i("tone")) || "tip", t = $(i("title"));
|
|
7204
7242
|
return /* @__PURE__ */ I("div", {
|
|
7205
7243
|
className: q("flex gap-2.5 rounded-xl px-4 py-3 text-[0.875rem] leading-relaxed", e === "tip" && "bg-second-tint", e === "note" && "bg-paper-2", e === "warning" && "bg-amber-tint"),
|
|
7206
|
-
children: [/* @__PURE__ */ F(
|
|
7244
|
+
children: [/* @__PURE__ */ F(k, { className: q("mt-0.5 size-4 shrink-0", e === "tip" ? "text-second" : "text-ink-3") }), /* @__PURE__ */ I("p", { children: [t ? /* @__PURE__ */ I("b", {
|
|
7207
7245
|
className: "font-semibold",
|
|
7208
7246
|
children: [t, " "]
|
|
7209
7247
|
}) : null, $(i("text"))] })]
|
|
@@ -7212,7 +7250,7 @@ function Jo({ id: e, ctx: t, row: n }) {
|
|
|
7212
7250
|
}
|
|
7213
7251
|
return null;
|
|
7214
7252
|
}
|
|
7215
|
-
function
|
|
7253
|
+
function Qo({ surface: e, assetUrl: t, onAction: n, initial: r, onState: i }) {
|
|
7216
7254
|
let [a, o] = M(r ?? {}), [s, c] = M(null), l = {
|
|
7217
7255
|
byId: new Map(e.components.map((e) => [e.id, e])),
|
|
7218
7256
|
data: e.data,
|
|
@@ -7231,16 +7269,16 @@ function Yo({ surface: e, assetUrl: t, onAction: n, initial: r, onState: i }) {
|
|
|
7231
7269
|
row: t
|
|
7232
7270
|
})
|
|
7233
7271
|
};
|
|
7234
|
-
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(
|
|
7272
|
+
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Zo, {
|
|
7235
7273
|
id: "root",
|
|
7236
7274
|
ctx: l
|
|
7237
|
-
}), /* @__PURE__ */ F(
|
|
7275
|
+
}), /* @__PURE__ */ F(Gr, {
|
|
7238
7276
|
open: s !== null,
|
|
7239
7277
|
onClose: () => c(null),
|
|
7240
7278
|
height: "tall",
|
|
7241
7279
|
children: s ? /* @__PURE__ */ I("div", {
|
|
7242
7280
|
className: "flex flex-col gap-4",
|
|
7243
|
-
children: [/* @__PURE__ */ F(
|
|
7281
|
+
children: [/* @__PURE__ */ F(Zo, {
|
|
7244
7282
|
id: s.view,
|
|
7245
7283
|
ctx: l,
|
|
7246
7284
|
row: s.row
|
|
@@ -7255,14 +7293,14 @@ function Yo({ surface: e, assetUrl: t, onAction: n, initial: r, onState: i }) {
|
|
|
7255
7293
|
}
|
|
7256
7294
|
//#endregion
|
|
7257
7295
|
//#region ../runner/src/outputs.tsx
|
|
7258
|
-
function
|
|
7296
|
+
function $o({ text: e, className: t }) {
|
|
7259
7297
|
let n = Ie(() => Re.sanitize(ze.parse(e, { async: !1 })), [e]);
|
|
7260
7298
|
return /* @__PURE__ */ F("div", {
|
|
7261
7299
|
className: q("prose-zen", t),
|
|
7262
7300
|
dangerouslySetInnerHTML: { __html: n }
|
|
7263
7301
|
});
|
|
7264
7302
|
}
|
|
7265
|
-
function
|
|
7303
|
+
function es({ src: e, page: t, height: n, fit: r, flow: i, state: a, onState: o }) {
|
|
7266
7304
|
let s = j(null), [c, l] = M(n), [u] = M(() => a ?? {}), d = j(o);
|
|
7267
7305
|
d.current = o, A(() => {
|
|
7268
7306
|
let e = (e) => {
|
|
@@ -7320,7 +7358,7 @@ function Zo({ src: e, page: t, height: n, fit: r, flow: i, state: a, onState: o
|
|
|
7320
7358
|
})]
|
|
7321
7359
|
});
|
|
7322
7360
|
}
|
|
7323
|
-
var
|
|
7361
|
+
var ts = {
|
|
7324
7362
|
disc: {
|
|
7325
7363
|
file: "ai",
|
|
7326
7364
|
box: 566.93,
|
|
@@ -7346,10 +7384,10 @@ var Qo = {
|
|
|
7346
7384
|
h: 266.41
|
|
7347
7385
|
}
|
|
7348
7386
|
};
|
|
7349
|
-
function
|
|
7350
|
-
let i =
|
|
7387
|
+
function ns({ icon: e, tone: t, size: n, className: r }) {
|
|
7388
|
+
let i = ts[e], a = n / i.h;
|
|
7351
7389
|
return /* @__PURE__ */ F("img", {
|
|
7352
|
-
src:
|
|
7390
|
+
src: Dr(`ai-labels/${i.file}-${t}.svg`),
|
|
7353
7391
|
alt: "",
|
|
7354
7392
|
draggable: !1,
|
|
7355
7393
|
className: q("pointer-events-none absolute max-w-none select-none", r),
|
|
@@ -7361,10 +7399,10 @@ function $o({ icon: e, tone: t, size: n, className: r }) {
|
|
|
7361
7399
|
}
|
|
7362
7400
|
});
|
|
7363
7401
|
}
|
|
7364
|
-
function
|
|
7402
|
+
function rs({ ai: e, className: t }) {
|
|
7365
7403
|
let [n, r] = M(!1);
|
|
7366
7404
|
if (!e) return null;
|
|
7367
|
-
let i =
|
|
7405
|
+
let i = ts[e], a = t === "static", o = a ? [["black", "dark:hidden"], ["white", "hidden dark:block"]] : [["white", ""]];
|
|
7368
7406
|
return /* @__PURE__ */ F("button", {
|
|
7369
7407
|
type: "button",
|
|
7370
7408
|
"aria-label": V(e === "edited" ? "ai.modified" : "ai.generated"),
|
|
@@ -7379,12 +7417,12 @@ function es({ ai: e, className: t }) {
|
|
|
7379
7417
|
},
|
|
7380
7418
|
children: o.map(([t, r]) => /* @__PURE__ */ I("span", {
|
|
7381
7419
|
className: r,
|
|
7382
|
-
children: [/* @__PURE__ */ F(
|
|
7420
|
+
children: [/* @__PURE__ */ F(ns, {
|
|
7383
7421
|
icon: "disc",
|
|
7384
7422
|
tone: t,
|
|
7385
7423
|
size: 18,
|
|
7386
7424
|
className: q("transition-opacity duration-200", n ? "opacity-0" : "opacity-100 group-hover:opacity-0 group-focus-visible:opacity-0")
|
|
7387
|
-
}), /* @__PURE__ */ F(
|
|
7425
|
+
}), /* @__PURE__ */ F(ns, {
|
|
7388
7426
|
icon: e,
|
|
7389
7427
|
tone: t,
|
|
7390
7428
|
size: 18,
|
|
@@ -7393,11 +7431,11 @@ function es({ ai: e, className: t }) {
|
|
|
7393
7431
|
}, t))
|
|
7394
7432
|
});
|
|
7395
7433
|
}
|
|
7396
|
-
function
|
|
7434
|
+
function is(e, t) {
|
|
7397
7435
|
let n = e.type === "agent" ? Fn(e).fields[t] : void 0;
|
|
7398
7436
|
return n ? L(t, n) : t;
|
|
7399
7437
|
}
|
|
7400
|
-
function
|
|
7438
|
+
function as({ text: e }) {
|
|
7401
7439
|
let [t, n] = M(!1);
|
|
7402
7440
|
return /* @__PURE__ */ I("button", {
|
|
7403
7441
|
type: "button",
|
|
@@ -7408,10 +7446,10 @@ function ns({ text: e }) {
|
|
|
7408
7446
|
children: [F(t ? h : v, { className: "size-3.5" }), V(t ? "share.copied" : "run.copy")]
|
|
7409
7447
|
});
|
|
7410
7448
|
}
|
|
7411
|
-
function
|
|
7449
|
+
function os({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, picked: o, onPick: s, onSurfaceAction: c, onView: l }) {
|
|
7412
7450
|
if (!n) return null;
|
|
7413
7451
|
let u = (t) => W(`${e}/assets/${t}`);
|
|
7414
|
-
if (n.surface) return /* @__PURE__ */ F(
|
|
7452
|
+
if (n.surface) return /* @__PURE__ */ F(Qo, {
|
|
7415
7453
|
surface: n.surface,
|
|
7416
7454
|
assetUrl: u,
|
|
7417
7455
|
onAction: c,
|
|
@@ -7429,14 +7467,14 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7429
7467
|
controls: !0,
|
|
7430
7468
|
playsInline: !0,
|
|
7431
7469
|
className: q("rounded-lg bg-black ring-1 ring-border-soft", i ? "max-h-[76vh]" : "w-full")
|
|
7432
|
-
}), /* @__PURE__ */ F(
|
|
7470
|
+
}), /* @__PURE__ */ F(rs, {
|
|
7433
7471
|
ai: e.ai,
|
|
7434
7472
|
className: "top-2 right-2"
|
|
7435
7473
|
})]
|
|
7436
7474
|
});
|
|
7437
7475
|
return t.type === "film" && n.text ? /* @__PURE__ */ I("div", {
|
|
7438
7476
|
className: "flex flex-col gap-4",
|
|
7439
|
-
children: [a, /* @__PURE__ */ F(
|
|
7477
|
+
children: [a, /* @__PURE__ */ F($o, {
|
|
7440
7478
|
text: n.text,
|
|
7441
7479
|
className: "text-[0.875rem] text-ink-2"
|
|
7442
7480
|
})]
|
|
@@ -7447,7 +7485,7 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7447
7485
|
width: 1280,
|
|
7448
7486
|
height: 720
|
|
7449
7487
|
};
|
|
7450
|
-
return r ? /* @__PURE__ */ F(
|
|
7488
|
+
return r ? /* @__PURE__ */ F(es, {
|
|
7451
7489
|
src: u(r.id),
|
|
7452
7490
|
page: i.width,
|
|
7453
7491
|
height: i.height,
|
|
@@ -7468,7 +7506,7 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7468
7506
|
controls: !0,
|
|
7469
7507
|
className: "w-full"
|
|
7470
7508
|
}),
|
|
7471
|
-
/* @__PURE__ */ F(
|
|
7509
|
+
/* @__PURE__ */ F(rs, {
|
|
7472
7510
|
ai: e.ai,
|
|
7473
7511
|
className: "static"
|
|
7474
7512
|
}),
|
|
@@ -7508,7 +7546,7 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7508
7546
|
className: "absolute top-2 left-2 rounded-full bg-card/90 px-2.5 py-1 font-medium text-[0.75rem] text-ink-2",
|
|
7509
7547
|
children: n + 1
|
|
7510
7548
|
}),
|
|
7511
|
-
/* @__PURE__ */ F(
|
|
7549
|
+
/* @__PURE__ */ F(rs, {
|
|
7512
7550
|
ai: e.ai,
|
|
7513
7551
|
className: t.asset === "image" ? "bottom-2 left-2" : "top-2 right-2"
|
|
7514
7552
|
})
|
|
@@ -7523,7 +7561,7 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7523
7561
|
src: u(e.id),
|
|
7524
7562
|
alt: t.title,
|
|
7525
7563
|
className: "w-full rounded-lg bg-paper-2 ring-1 ring-border-soft"
|
|
7526
|
-
}), /* @__PURE__ */ F(
|
|
7564
|
+
}), /* @__PURE__ */ F(rs, { ai: e.ai })]
|
|
7527
7565
|
});
|
|
7528
7566
|
if (t.asset === "video") {
|
|
7529
7567
|
let n = t.options?.aspectRatio === "9:16";
|
|
@@ -7535,17 +7573,17 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7535
7573
|
playsInline: !0,
|
|
7536
7574
|
loop: !0,
|
|
7537
7575
|
className: q("rounded-lg bg-black ring-1 ring-border-soft", n ? "max-h-[70vh]" : "w-full")
|
|
7538
|
-
}), /* @__PURE__ */ F(
|
|
7576
|
+
}), /* @__PURE__ */ F(rs, {
|
|
7539
7577
|
ai: e.ai,
|
|
7540
7578
|
className: "top-2 left-2"
|
|
7541
7579
|
})]
|
|
7542
7580
|
});
|
|
7543
7581
|
}
|
|
7544
|
-
return t.asset === "document" ? /* @__PURE__ */ F(
|
|
7582
|
+
return t.asset === "document" ? /* @__PURE__ */ F(es, {
|
|
7545
7583
|
src: u(e.id),
|
|
7546
7584
|
page: 820,
|
|
7547
7585
|
height: 1100
|
|
7548
|
-
}) : /* @__PURE__ */ F(
|
|
7586
|
+
}) : /* @__PURE__ */ F(es, {
|
|
7549
7587
|
src: u(e.id),
|
|
7550
7588
|
page: null,
|
|
7551
7589
|
height: 760
|
|
@@ -7556,15 +7594,15 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7556
7594
|
return /* @__PURE__ */ I("div", {
|
|
7557
7595
|
className: "flex flex-col gap-4",
|
|
7558
7596
|
children: [
|
|
7559
|
-
t.output.format === "json" && n.json !== void 0 ? /* @__PURE__ */ F(
|
|
7597
|
+
t.output.format === "json" && n.json !== void 0 ? /* @__PURE__ */ F(lo, {
|
|
7560
7598
|
step: t,
|
|
7561
7599
|
json: n.json
|
|
7562
|
-
}) : r ? /* @__PURE__ */ F(
|
|
7600
|
+
}) : r ? /* @__PURE__ */ F(Ir, {
|
|
7563
7601
|
value: i ?? n.text ?? "",
|
|
7564
7602
|
onChange: (e) => a?.(e.target.value),
|
|
7565
7603
|
minRows: 4,
|
|
7566
7604
|
maxRows: 24
|
|
7567
|
-
}) : t.output.format === "markdown" ? /* @__PURE__ */ F(
|
|
7605
|
+
}) : t.output.format === "markdown" ? /* @__PURE__ */ F($o, { text: n.text ?? "" }) : /* @__PURE__ */ F("div", {
|
|
7568
7606
|
className: "whitespace-pre-wrap text-[1rem] leading-relaxed",
|
|
7569
7607
|
children: n.text
|
|
7570
7608
|
}),
|
|
@@ -7574,7 +7612,7 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7574
7612
|
src: u(e.id),
|
|
7575
7613
|
alt: "",
|
|
7576
7614
|
className: "w-full rounded-lg ring-1 ring-border-soft"
|
|
7577
|
-
}), /* @__PURE__ */ F(
|
|
7615
|
+
}), /* @__PURE__ */ F(rs, { ai: e.ai })]
|
|
7578
7616
|
}, e.id)),
|
|
7579
7617
|
o.length ? /* @__PURE__ */ F("ul", {
|
|
7580
7618
|
className: "overflow-hidden rounded-lg ring-1 ring-border-soft",
|
|
@@ -7583,7 +7621,7 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7583
7621
|
children: /* @__PURE__ */ I("a", {
|
|
7584
7622
|
href: u(e.id),
|
|
7585
7623
|
download: e.name,
|
|
7586
|
-
onClick: (t) =>
|
|
7624
|
+
onClick: (t) => Ar(t, u(e.id), e.name),
|
|
7587
7625
|
className: "flex items-center gap-2 px-3 py-2 text-[0.8125rem] hover:bg-paper-2 coarse:min-h-11",
|
|
7588
7626
|
children: [/* @__PURE__ */ F(T, { className: "size-3.5 shrink-0 text-ink-3" }), /* @__PURE__ */ F("span", {
|
|
7589
7627
|
className: "min-w-0 flex-1 truncate",
|
|
@@ -7592,13 +7630,13 @@ function rs({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
|
|
|
7592
7630
|
})
|
|
7593
7631
|
}, e.id))
|
|
7594
7632
|
}) : null,
|
|
7595
|
-
t.output.format !== "json" && !r && n.text ? /* @__PURE__ */ F("div", { children: /* @__PURE__ */ F(
|
|
7633
|
+
t.output.format !== "json" && !r && n.text ? /* @__PURE__ */ F("div", { children: /* @__PURE__ */ F(as, { text: n.text }) }) : null
|
|
7596
7634
|
]
|
|
7597
7635
|
});
|
|
7598
7636
|
}
|
|
7599
7637
|
return null;
|
|
7600
7638
|
}
|
|
7601
|
-
var
|
|
7639
|
+
var ss = {
|
|
7602
7640
|
png: "PNG",
|
|
7603
7641
|
mp4: "MP4",
|
|
7604
7642
|
mp3: "MP3",
|
|
@@ -7612,17 +7650,17 @@ var is = {
|
|
|
7612
7650
|
json: "JSON",
|
|
7613
7651
|
zip: "ZIP"
|
|
7614
7652
|
};
|
|
7615
|
-
function
|
|
7653
|
+
function cs(e, t) {
|
|
7616
7654
|
return (e.headers.get("content-disposition") ?? "").match(/filename="([^"]+)"/)?.[1] ?? t;
|
|
7617
7655
|
}
|
|
7618
|
-
function
|
|
7656
|
+
function ls(e) {
|
|
7619
7657
|
let t = URL.createObjectURL(e), n = document.createElement("a");
|
|
7620
7658
|
n.href = t, n.download = e.name, n.rel = "noopener", document.body.append(n), n.click(), n.remove(), setTimeout(() => URL.revokeObjectURL(t), 6e4);
|
|
7621
7659
|
}
|
|
7622
|
-
function
|
|
7660
|
+
function us({ url: e, format: t, title: n, make: r }) {
|
|
7623
7661
|
let [i, a] = M("idle"), o = j(null), s = async () => {
|
|
7624
7662
|
if (K("share") && !r) {
|
|
7625
|
-
a("busy"), await
|
|
7663
|
+
a("busy"), await Or("share", {
|
|
7626
7664
|
url: new URL(e, location.href).href,
|
|
7627
7665
|
title: n
|
|
7628
7666
|
}).catch(() => void 0), a("idle");
|
|
@@ -7635,7 +7673,7 @@ function ss({ url: e, format: t, title: n, make: r }) {
|
|
|
7635
7673
|
let n = await fetch(e, { credentials: "include" });
|
|
7636
7674
|
if (!n.ok) throw Error(String(n.status));
|
|
7637
7675
|
let r = await n.blob();
|
|
7638
|
-
o.current = new File([r],
|
|
7676
|
+
o.current = new File([r], cs(n, `download.${t}`), { type: r.type.split(";")[0] });
|
|
7639
7677
|
}
|
|
7640
7678
|
}
|
|
7641
7679
|
let i = {
|
|
@@ -7643,7 +7681,7 @@ function ss({ url: e, format: t, title: n, make: r }) {
|
|
|
7643
7681
|
title: n
|
|
7644
7682
|
};
|
|
7645
7683
|
if (!navigator.canShare(i)) {
|
|
7646
|
-
r ?
|
|
7684
|
+
r ? ls(o.current) : location.href = e, a("idle");
|
|
7647
7685
|
return;
|
|
7648
7686
|
}
|
|
7649
7687
|
await navigator.share(i), a("idle");
|
|
@@ -7658,24 +7696,24 @@ function ss({ url: e, format: t, title: n, make: r }) {
|
|
|
7658
7696
|
"aria-label": V("run.shareFile"),
|
|
7659
7697
|
title: V("run.shareFile"),
|
|
7660
7698
|
className: q("inline-flex h-9 items-center gap-1.5 rounded-full px-3 font-medium text-[0.8125rem] transition coarse:h-11 coarse:px-4", i === "ready" ? "bg-ember-tint text-ink ring-1 ring-ember" : "bg-paper-2 text-ink-2 hover:bg-paper-3 hover:text-ink"),
|
|
7661
|
-
children: [F(i === "busy" ?
|
|
7699
|
+
children: [F(i === "busy" ? Ur : xe, { className: "size-3.5" }), V(i === "ready" ? "run.shareNow" : "run.share")]
|
|
7662
7700
|
});
|
|
7663
7701
|
}
|
|
7664
|
-
var
|
|
7665
|
-
function
|
|
7666
|
-
let s = (n) => W(`${e}/steps/${t}/download?format=${n}`), [c, l] = M(!1), u = j(null), d =
|
|
7702
|
+
var ds = K("share") || _i();
|
|
7703
|
+
function fs({ base: e, stepId: t, formats: n, title: r, step: i, output: a, foot: o }) {
|
|
7704
|
+
let s = (n) => W(`${e}/steps/${t}/download?format=${n}`), [c, l] = M(!1), u = j(null), d = jr() && i?.type === "agent" && a && (a.text || a.json !== void 0) ? {
|
|
7667
7705
|
title: r ?? i.title,
|
|
7668
7706
|
text: a.text,
|
|
7669
7707
|
json: i.output.format === "json" ? a.json : void 0,
|
|
7670
|
-
label: (e) =>
|
|
7708
|
+
label: (e) => is(i, e),
|
|
7671
7709
|
foot: o
|
|
7672
7710
|
} : null, f = async () => {
|
|
7673
7711
|
if (!d) throw Error("nothing written");
|
|
7674
|
-
return u.current ??= await
|
|
7712
|
+
return u.current ??= await Ao(d), u.current;
|
|
7675
7713
|
}, p = async () => {
|
|
7676
7714
|
l(!0);
|
|
7677
7715
|
try {
|
|
7678
|
-
|
|
7716
|
+
ls(await f());
|
|
7679
7717
|
} catch (e) {
|
|
7680
7718
|
console.warn(`pdf: ${e.message}`), n.includes("html") && window.open(s("html"), "_blank", "noopener");
|
|
7681
7719
|
} finally {
|
|
@@ -7689,8 +7727,8 @@ function ls({ base: e, stepId: t, formats: n, title: r, step: i, output: a, foot
|
|
|
7689
7727
|
onClick: () => void p(),
|
|
7690
7728
|
disabled: c,
|
|
7691
7729
|
className: m(t),
|
|
7692
|
-
children: [c ? /* @__PURE__ */ F(
|
|
7693
|
-
}, e) : e === "html" &&
|
|
7730
|
+
children: [c ? /* @__PURE__ */ F(Ur, { className: "size-3.5" }) : t === 0 ? /* @__PURE__ */ F(x, { className: "size-3.5" }) : null, ss[e]]
|
|
7731
|
+
}, e) : e === "html" && jr() ? /* @__PURE__ */ I("a", {
|
|
7694
7732
|
href: s(e),
|
|
7695
7733
|
target: "_blank",
|
|
7696
7734
|
rel: "noopener",
|
|
@@ -7698,10 +7736,10 @@ function ls({ base: e, stepId: t, formats: n, title: r, step: i, output: a, foot
|
|
|
7698
7736
|
children: [t === 0 ? /* @__PURE__ */ F(_e, { className: "size-3.5" }) : null, V("run.print")]
|
|
7699
7737
|
}, e) : /* @__PURE__ */ I("a", {
|
|
7700
7738
|
href: s(e),
|
|
7701
|
-
onClick: (t) =>
|
|
7739
|
+
onClick: (t) => Ar(t, s(e)),
|
|
7702
7740
|
className: m(t),
|
|
7703
|
-
children: [t === 0 ? /* @__PURE__ */ F(x, { className: "size-3.5" }) : null,
|
|
7704
|
-
}, e)),
|
|
7741
|
+
children: [t === 0 ? /* @__PURE__ */ F(x, { className: "size-3.5" }) : null, ss[e]]
|
|
7742
|
+
}, e)), ds && n.length ? /* @__PURE__ */ F(us, {
|
|
7705
7743
|
url: s(n[0]),
|
|
7706
7744
|
format: n[0],
|
|
7707
7745
|
title: r,
|
|
@@ -7711,7 +7749,7 @@ function ls({ base: e, stepId: t, formats: n, title: r, step: i, output: a, foot
|
|
|
7711
7749
|
}
|
|
7712
7750
|
//#endregion
|
|
7713
7751
|
//#region ../runner/src/RunnerView.tsx
|
|
7714
|
-
function
|
|
7752
|
+
function ps({ view: e }) {
|
|
7715
7753
|
let t = Math.round(Math.min(e.progress.done, e.progress.total) / Math.max(1, e.progress.total) * 100);
|
|
7716
7754
|
return /* @__PURE__ */ F("div", {
|
|
7717
7755
|
className: "h-[3px] w-full bg-paper-2",
|
|
@@ -7721,10 +7759,10 @@ function us({ view: e }) {
|
|
|
7721
7759
|
})
|
|
7722
7760
|
});
|
|
7723
7761
|
}
|
|
7724
|
-
var
|
|
7762
|
+
var ms = (e, t) => (n) => {
|
|
7725
7763
|
U.put(`${G(e)}/views/${t}`, { state: n }).catch(() => void 0);
|
|
7726
7764
|
};
|
|
7727
|
-
function
|
|
7765
|
+
function hs({ title: e, description: t, kicker: n }) {
|
|
7728
7766
|
return /* @__PURE__ */ I("div", {
|
|
7729
7767
|
className: "kb-title mb-8",
|
|
7730
7768
|
children: [
|
|
@@ -7743,16 +7781,16 @@ function fs({ title: e, description: t, kicker: n }) {
|
|
|
7743
7781
|
]
|
|
7744
7782
|
});
|
|
7745
7783
|
}
|
|
7746
|
-
function
|
|
7784
|
+
function gs(e, t) {
|
|
7747
7785
|
let n = {};
|
|
7748
7786
|
for (let r of e.fields) n[r.id] = t.values[r.id] ?? t.prefill?.[r.id] ?? r.default ?? (r.kind === "multiselect" ? [] : void 0);
|
|
7749
7787
|
return n;
|
|
7750
7788
|
}
|
|
7751
|
-
function
|
|
7789
|
+
function _s(e) {
|
|
7752
7790
|
return Array.from(e.querySelectorAll("input:not([type=\"hidden\"], [type=\"file\"], [type=\"checkbox\"], [type=\"color\"], [type=\"range\"], [disabled]), textarea:not([disabled])")).filter((e) => !e.closest("dialog") && e.offsetParent !== null);
|
|
7753
7791
|
}
|
|
7754
|
-
function
|
|
7755
|
-
let [r, i] = M(() =>
|
|
7792
|
+
function vs({ view: e, run: t, step: n }) {
|
|
7793
|
+
let [r, i] = M(() => gs(n, e)), [a, o] = M(/* @__PURE__ */ new Set()), s = j(null), c = e.progress.done === 0, u = Kn(Ie(() => n.fields.filter((t) => !Gn(t) || e.decidedFields?.includes(t.id)).map((t) => e.options?.[t.id]?.length ? {
|
|
7756
7794
|
...t,
|
|
7757
7795
|
options: e.options[t.id]
|
|
7758
7796
|
} : t), [
|
|
@@ -7762,7 +7800,7 @@ function hs({ view: e, run: t, step: n }) {
|
|
|
7762
7800
|
]), e.known ?? {}, r), d = () => void t.submitPage(n.id, r);
|
|
7763
7801
|
return A(() => {
|
|
7764
7802
|
if (!s.current) return;
|
|
7765
|
-
let e =
|
|
7803
|
+
let e = _s(s.current).filter((e) => e instanceof HTMLInputElement);
|
|
7766
7804
|
for (let [t, n] of e.entries()) (n.dataset.hint || !n.hasAttribute("enterkeyhint")) && (n.dataset.hint = "1", n.setAttribute("enterkeyhint", t === e.length - 1 ? "go" : "next"));
|
|
7767
7805
|
}), /* @__PURE__ */ I("form", {
|
|
7768
7806
|
ref: s,
|
|
@@ -7773,18 +7811,18 @@ function hs({ view: e, run: t, step: n }) {
|
|
|
7773
7811
|
onKeyDown: (e) => {
|
|
7774
7812
|
let t = e.target;
|
|
7775
7813
|
if (e.key !== "Enter" || e.defaultPrevented || e.nativeEvent.isComposing || !(t instanceof HTMLInputElement) || t.closest("dialog")) return;
|
|
7776
|
-
let n =
|
|
7814
|
+
let n = _s(e.currentTarget), r = n[n.indexOf(t) + 1];
|
|
7777
7815
|
r && (e.preventDefault(), r.focus());
|
|
7778
7816
|
},
|
|
7779
7817
|
children: [
|
|
7780
|
-
/* @__PURE__ */ F(
|
|
7818
|
+
/* @__PURE__ */ F(hs, {
|
|
7781
7819
|
title: n.title,
|
|
7782
7820
|
description: n.description,
|
|
7783
7821
|
kicker: c ? e.wizard.intro : null
|
|
7784
7822
|
}),
|
|
7785
7823
|
/* @__PURE__ */ F("div", {
|
|
7786
7824
|
className: "flex flex-col gap-7",
|
|
7787
|
-
children: u.map((n) => /* @__PURE__ */ F(
|
|
7825
|
+
children: u.map((n) => /* @__PURE__ */ F(Ga, {
|
|
7788
7826
|
field: n,
|
|
7789
7827
|
value: r[n.id],
|
|
7790
7828
|
values: r,
|
|
@@ -7803,7 +7841,7 @@ function hs({ view: e, run: t, step: n }) {
|
|
|
7803
7841
|
})
|
|
7804
7842
|
}, n.id))
|
|
7805
7843
|
}),
|
|
7806
|
-
/* @__PURE__ */ F(
|
|
7844
|
+
/* @__PURE__ */ F(ys, {
|
|
7807
7845
|
view: e,
|
|
7808
7846
|
run: t,
|
|
7809
7847
|
sticky: !0,
|
|
@@ -7822,7 +7860,7 @@ function hs({ view: e, run: t, step: n }) {
|
|
|
7822
7860
|
]
|
|
7823
7861
|
});
|
|
7824
7862
|
}
|
|
7825
|
-
function
|
|
7863
|
+
function ys({ view: e, run: t, sticky: n, children: r }) {
|
|
7826
7864
|
return /* @__PURE__ */ I("div", {
|
|
7827
7865
|
className: q("mt-10 flex items-center justify-between gap-3", n && "action-bar"),
|
|
7828
7866
|
children: [e.canBack ? /* @__PURE__ */ I(J, {
|
|
@@ -7837,8 +7875,8 @@ function gs({ view: e, run: t, sticky: n, children: r }) {
|
|
|
7837
7875
|
}) : /* @__PURE__ */ F("span", {}), r]
|
|
7838
7876
|
});
|
|
7839
7877
|
}
|
|
7840
|
-
function
|
|
7841
|
-
let e =
|
|
7878
|
+
function bs() {
|
|
7879
|
+
let e = di(), [t, n] = M(!1), r = e !== "off";
|
|
7842
7880
|
return /* @__PURE__ */ I("div", {
|
|
7843
7881
|
className: "mt-6 flex flex-col items-center gap-2",
|
|
7844
7882
|
children: [/* @__PURE__ */ I("button", {
|
|
@@ -7847,20 +7885,20 @@ function _s() {
|
|
|
7847
7885
|
disabled: t,
|
|
7848
7886
|
onClick: async () => {
|
|
7849
7887
|
if (r) {
|
|
7850
|
-
|
|
7888
|
+
mi();
|
|
7851
7889
|
return;
|
|
7852
7890
|
}
|
|
7853
|
-
n(!0), await
|
|
7891
|
+
n(!0), await pi(), n(!1);
|
|
7854
7892
|
},
|
|
7855
7893
|
className: q("inline-flex h-11 items-center gap-2 rounded-full px-4 font-medium text-[0.875rem] ring-1 transition", r ? "bg-ember-tint text-ink ring-ember" : "bg-card text-ink-2 ring-input hover:text-ink hover:ring-ink-4"),
|
|
7856
7894
|
children: [r ? /* @__PURE__ */ F(f, { className: "size-4 text-ember-strong" }) : /* @__PURE__ */ F(d, { className: "size-4" }), V(r ? "notify.on" : "notify.ask")]
|
|
7857
7895
|
}), /* @__PURE__ */ F("p", {
|
|
7858
7896
|
className: "max-w-xs text-[0.75rem] text-ink-4 leading-relaxed",
|
|
7859
|
-
children: V(e === "off" ? "notify.why" : e === "on" ? "notify.onHint" :
|
|
7897
|
+
children: V(e === "off" ? "notify.why" : e === "on" ? "notify.onHint" : fi() ? "notify.blocked" : "notify.quiet")
|
|
7860
7898
|
})]
|
|
7861
7899
|
});
|
|
7862
7900
|
}
|
|
7863
|
-
function
|
|
7901
|
+
function xs({ view: e, compact: t, awake: n }) {
|
|
7864
7902
|
let r = Ie(() => {
|
|
7865
7903
|
let t = [...e.events].reverse().find((t) => t.type === "step_started" && t.stepId === e.step?.id);
|
|
7866
7904
|
return t ? new Date(t.at).getTime() : Date.now();
|
|
@@ -7901,11 +7939,11 @@ function vs({ view: e, compact: t, awake: n }) {
|
|
|
7901
7939
|
className: q("flex items-center justify-center gap-2 text-[0.8125rem] transition-opacity", t === c.length - 1 ? "text-ink-2" : "text-ink-4"),
|
|
7902
7940
|
children: [t === c.length - 1 ? /* @__PURE__ */ F(we, { className: "size-3.5 animate-breathe text-ember" }) : null, /* @__PURE__ */ F("span", {
|
|
7903
7941
|
className: "truncate",
|
|
7904
|
-
children:
|
|
7942
|
+
children: _r(e)
|
|
7905
7943
|
})]
|
|
7906
7944
|
}, e.id))
|
|
7907
7945
|
}),
|
|
7908
|
-
t ? null : /* @__PURE__ */ F(
|
|
7946
|
+
t ? null : /* @__PURE__ */ F(bs, {}),
|
|
7909
7947
|
n ? /* @__PURE__ */ F("p", {
|
|
7910
7948
|
className: "mt-3 text-[0.75rem] text-ink-4",
|
|
7911
7949
|
children: V("run.awake")
|
|
@@ -7913,7 +7951,7 @@ function vs({ view: e, compact: t, awake: n }) {
|
|
|
7913
7951
|
]
|
|
7914
7952
|
});
|
|
7915
7953
|
}
|
|
7916
|
-
function
|
|
7954
|
+
function Ss(e) {
|
|
7917
7955
|
let t = j({
|
|
7918
7956
|
running: !1,
|
|
7919
7957
|
since: 0,
|
|
@@ -7922,7 +7960,7 @@ function ys(e) {
|
|
|
7922
7960
|
A(() => {
|
|
7923
7961
|
if (!e) return;
|
|
7924
7962
|
let n = t.current, r = e.status === "running", i = r ? n.running ? n.since : Date.now() : 0, a = (t) => {
|
|
7925
|
-
document.visibilityState !== "visible" && !document.title.startsWith("● ") && (document.title = `● ${document.title}`),
|
|
7963
|
+
document.visibilityState !== "visible" && !document.title.startsWith("● ") && (document.title = `● ${document.title}`), gi({
|
|
7926
7964
|
title: e.wizard.title,
|
|
7927
7965
|
body: t,
|
|
7928
7966
|
tag: e.id
|
|
@@ -7940,14 +7978,14 @@ function ys(e) {
|
|
|
7940
7978
|
return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
|
|
7941
7979
|
}, []);
|
|
7942
7980
|
}
|
|
7943
|
-
function
|
|
7981
|
+
function Cs({ view: e, run: t, step: n, studio: r }) {
|
|
7944
7982
|
let [i, a] = M({}), [o, s] = M({}), [c, u] = M(""), d = e.shown.filter((e) => e.output), [f, p] = M(d.length === 1 ? d[0].step.id : null), [m, h] = M({}), g = j(null), _ = d.find((e) => e.step.id === f), v = _?.step.type === "generate" && (_.output?.assets?.length ?? 0) > 1, y = () => {
|
|
7945
7983
|
_ && c.trim() && t.regenerate(n.id, _.step.id, c.trim(), m[_.step.id]);
|
|
7946
7984
|
};
|
|
7947
7985
|
return /* @__PURE__ */ I("div", {
|
|
7948
7986
|
className: "animate-rise",
|
|
7949
7987
|
children: [
|
|
7950
|
-
/* @__PURE__ */ F(
|
|
7988
|
+
/* @__PURE__ */ F(hs, {
|
|
7951
7989
|
title: n.title,
|
|
7952
7990
|
description: n.description
|
|
7953
7991
|
}),
|
|
@@ -7955,7 +7993,7 @@ function bs({ view: e, run: t, step: n, studio: r }) {
|
|
|
7955
7993
|
className: "flex flex-col gap-6",
|
|
7956
7994
|
children: [
|
|
7957
7995
|
e.shown.filter((e) => e.output).map(({ step: t, output: c }) => {
|
|
7958
|
-
let l =
|
|
7996
|
+
let l = ra(t) ? t : null, u = !!n.edit && t.type === "agent" && (t.output.format !== "json" || !!l), d = i[t.id], f = (e) => /* @__PURE__ */ I("div", {
|
|
7959
7997
|
className: "mb-2 flex items-center justify-between gap-3",
|
|
7960
7998
|
children: [/* @__PURE__ */ F("h3", {
|
|
7961
7999
|
className: "font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.06em]",
|
|
@@ -7978,7 +8016,7 @@ function bs({ view: e, run: t, step: n, studio: r }) {
|
|
|
7978
8016
|
})]
|
|
7979
8017
|
}), _ = l && c && u && o[t.id] ? /* @__PURE__ */ F("div", {
|
|
7980
8018
|
className: "overflow-hidden rounded-xl bg-card ring-1 ring-border-soft",
|
|
7981
|
-
children: /* @__PURE__ */ F(
|
|
8019
|
+
children: /* @__PURE__ */ F($i, {
|
|
7982
8020
|
shape: Fn(l),
|
|
7983
8021
|
value: d && typeof d == "object" ? d : c.json ?? {},
|
|
7984
8022
|
onChange: (e) => a((n) => ({
|
|
@@ -7987,11 +8025,11 @@ function bs({ view: e, run: t, step: n, studio: r }) {
|
|
|
7987
8025
|
})),
|
|
7988
8026
|
start: "edit"
|
|
7989
8027
|
})
|
|
7990
|
-
}) : /* @__PURE__ */ F(
|
|
8028
|
+
}) : /* @__PURE__ */ F(os, {
|
|
7991
8029
|
base: `${G(e.id)}`,
|
|
7992
8030
|
step: t,
|
|
7993
8031
|
output: c,
|
|
7994
|
-
onView:
|
|
8032
|
+
onView: ms(e.id, t.id),
|
|
7995
8033
|
editable: u && o[t.id] && !l,
|
|
7996
8034
|
draft: typeof d == "string" ? d : void 0,
|
|
7997
8035
|
onDraft: (e) => a((n) => ({
|
|
@@ -8012,7 +8050,7 @@ function bs({ view: e, run: t, step: n, studio: r }) {
|
|
|
8012
8050
|
p(t.id), g.current?.focus();
|
|
8013
8051
|
} : void 0
|
|
8014
8052
|
});
|
|
8015
|
-
return /* @__PURE__ */ F("section", { children: r && l && c ? /* @__PURE__ */ F(
|
|
8053
|
+
return /* @__PURE__ */ F("section", { children: r && l && c ? /* @__PURE__ */ F(ia, {
|
|
8016
8054
|
runId: e.id,
|
|
8017
8055
|
step: l,
|
|
8018
8056
|
output: c,
|
|
@@ -8023,15 +8061,15 @@ function bs({ view: e, run: t, step: n, studio: r }) {
|
|
|
8023
8061
|
e.lists.map((t) => /* @__PURE__ */ I("section", { children: [/* @__PURE__ */ F("h3", {
|
|
8024
8062
|
className: "mb-2 font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.06em]",
|
|
8025
8063
|
children: t.def.title
|
|
8026
|
-
}), t.def.check ? /* @__PURE__ */ F(
|
|
8064
|
+
}), t.def.check ? /* @__PURE__ */ F(Da, {
|
|
8027
8065
|
runId: e.id,
|
|
8028
8066
|
list: t
|
|
8029
|
-
}) : /* @__PURE__ */ F(
|
|
8067
|
+
}) : /* @__PURE__ */ F(wa, {
|
|
8030
8068
|
runId: e.id,
|
|
8031
8069
|
list: t,
|
|
8032
8070
|
editable: !0
|
|
8033
8071
|
})] }, t.def.id)),
|
|
8034
|
-
n.regenerate && d.length ? /* @__PURE__ */ I(
|
|
8072
|
+
n.regenerate && d.length ? /* @__PURE__ */ I(Wr, {
|
|
8035
8073
|
className: "p-3",
|
|
8036
8074
|
children: [
|
|
8037
8075
|
d.length > 1 ? /* @__PURE__ */ I("div", {
|
|
@@ -8049,7 +8087,7 @@ function bs({ view: e, run: t, step: n, studio: r }) {
|
|
|
8049
8087
|
children: e.title
|
|
8050
8088
|
}, e.id))]
|
|
8051
8089
|
}) : null,
|
|
8052
|
-
/* @__PURE__ */ F(
|
|
8090
|
+
/* @__PURE__ */ F(Ir, {
|
|
8053
8091
|
ref: g,
|
|
8054
8092
|
minRows: 2,
|
|
8055
8093
|
maxRows: 8,
|
|
@@ -8083,7 +8121,7 @@ function bs({ view: e, run: t, step: n, studio: r }) {
|
|
|
8083
8121
|
}) : null
|
|
8084
8122
|
]
|
|
8085
8123
|
}),
|
|
8086
|
-
/* @__PURE__ */ F(
|
|
8124
|
+
/* @__PURE__ */ F(ys, {
|
|
8087
8125
|
view: e,
|
|
8088
8126
|
run: t,
|
|
8089
8127
|
sticky: !0,
|
|
@@ -8101,7 +8139,7 @@ function bs({ view: e, run: t, step: n, studio: r }) {
|
|
|
8101
8139
|
]
|
|
8102
8140
|
});
|
|
8103
8141
|
}
|
|
8104
|
-
function
|
|
8142
|
+
function ws({ view: e, run: t, step: n, onRestart: r, studio: i }) {
|
|
8105
8143
|
let a = e.shown.filter((e) => e.output), { Mascot: o, ShareResultButton: s } = H();
|
|
8106
8144
|
return /* @__PURE__ */ I("div", {
|
|
8107
8145
|
className: "animate-rise",
|
|
@@ -8143,7 +8181,7 @@ function xs({ view: e, run: t, step: n, onRestart: r, studio: i }) {
|
|
|
8143
8181
|
children: o ?? n.title
|
|
8144
8182
|
}), /* @__PURE__ */ I("div", {
|
|
8145
8183
|
className: "flex items-center gap-1",
|
|
8146
|
-
children: [/* @__PURE__ */ F(
|
|
8184
|
+
children: [/* @__PURE__ */ F(fs, {
|
|
8147
8185
|
base: `${G(e.id)}`,
|
|
8148
8186
|
stepId: n.id,
|
|
8149
8187
|
formats: a,
|
|
@@ -8153,16 +8191,16 @@ function xs({ view: e, run: t, step: n, onRestart: r, studio: i }) {
|
|
|
8153
8191
|
foot: `${e.wizard.title} · ${(/* @__PURE__ */ new Date()).toLocaleDateString(H().lang)}`
|
|
8154
8192
|
}), t]
|
|
8155
8193
|
})]
|
|
8156
|
-
}), c = /* @__PURE__ */ F(
|
|
8194
|
+
}), c = /* @__PURE__ */ F(Es, {
|
|
8157
8195
|
view: e,
|
|
8158
8196
|
run: t,
|
|
8159
8197
|
step: n,
|
|
8160
8198
|
output: r,
|
|
8161
|
-
onView:
|
|
8199
|
+
onView: ms(e.id, n.id)
|
|
8162
8200
|
});
|
|
8163
|
-
return /* @__PURE__ */ I(
|
|
8201
|
+
return /* @__PURE__ */ I(Wr, {
|
|
8164
8202
|
className: "p-4 sm:p-5",
|
|
8165
|
-
children: [i &&
|
|
8203
|
+
children: [i && ra(n) && r ? /* @__PURE__ */ F(ia, {
|
|
8166
8204
|
runId: e.id,
|
|
8167
8205
|
step: n,
|
|
8168
8206
|
output: r,
|
|
@@ -8173,25 +8211,25 @@ function xs({ view: e, run: t, step: n, onRestart: r, studio: i }) {
|
|
|
8173
8211
|
children: V("ai.publish")
|
|
8174
8212
|
}) : null]
|
|
8175
8213
|
}, n.id);
|
|
8176
|
-
}), e.lists.map((t) => /* @__PURE__ */ I(
|
|
8214
|
+
}), e.lists.map((t) => /* @__PURE__ */ I(Wr, {
|
|
8177
8215
|
className: "p-4 sm:p-5",
|
|
8178
8216
|
children: [/* @__PURE__ */ I("div", {
|
|
8179
8217
|
className: "mb-3 flex flex-wrap items-center justify-between gap-3",
|
|
8180
8218
|
children: [/* @__PURE__ */ F("h3", {
|
|
8181
8219
|
className: "font-display font-semibold text-[1.0625rem]",
|
|
8182
8220
|
children: t.label ?? t.def.title
|
|
8183
|
-
}), /* @__PURE__ */ F(
|
|
8221
|
+
}), /* @__PURE__ */ F(ka, {
|
|
8184
8222
|
runId: e.id,
|
|
8185
8223
|
list: t
|
|
8186
8224
|
})]
|
|
8187
|
-
}), /* @__PURE__ */ F(
|
|
8225
|
+
}), /* @__PURE__ */ F(wa, {
|
|
8188
8226
|
runId: e.id,
|
|
8189
8227
|
list: t,
|
|
8190
8228
|
editable: !0
|
|
8191
8229
|
})]
|
|
8192
8230
|
}, t.def.id))]
|
|
8193
8231
|
}),
|
|
8194
|
-
/* @__PURE__ */ F(
|
|
8232
|
+
/* @__PURE__ */ F(ys, {
|
|
8195
8233
|
view: e,
|
|
8196
8234
|
run: t,
|
|
8197
8235
|
children: r ? /* @__PURE__ */ I(J, {
|
|
@@ -8207,7 +8245,7 @@ function xs({ view: e, run: t, step: n, onRestart: r, studio: i }) {
|
|
|
8207
8245
|
]
|
|
8208
8246
|
});
|
|
8209
8247
|
}
|
|
8210
|
-
function
|
|
8248
|
+
function Ts({ view: e, run: t }) {
|
|
8211
8249
|
let { Mascot: n } = H();
|
|
8212
8250
|
return /* @__PURE__ */ I("div", {
|
|
8213
8251
|
className: "flex animate-rise flex-col items-center pt-8 text-center",
|
|
@@ -8223,7 +8261,7 @@ function Ss({ view: e, run: t }) {
|
|
|
8223
8261
|
}),
|
|
8224
8262
|
/* @__PURE__ */ F("p", {
|
|
8225
8263
|
className: "mt-2 max-w-md text-[0.9375rem] text-ink-3",
|
|
8226
|
-
children: /* @__PURE__ */ F(
|
|
8264
|
+
children: /* @__PURE__ */ F(Kr, { text: e.error ?? "" })
|
|
8227
8265
|
}),
|
|
8228
8266
|
/* @__PURE__ */ I("div", {
|
|
8229
8267
|
className: "mt-8 flex gap-3",
|
|
@@ -8248,9 +8286,9 @@ function Ss({ view: e, run: t }) {
|
|
|
8248
8286
|
]
|
|
8249
8287
|
});
|
|
8250
8288
|
}
|
|
8251
|
-
function
|
|
8289
|
+
function Es({ view: e, run: t, step: n, output: r, onView: i }) {
|
|
8252
8290
|
let [a, o] = M(!1), [s, c] = M(!1), l = G(e.id), u = e.translation?.results[n.id];
|
|
8253
|
-
if (!(e.translation && r?.text && t.translateResult)) return /* @__PURE__ */ F(
|
|
8291
|
+
if (!(e.translation && r?.text && t.translateResult)) return /* @__PURE__ */ F(os, {
|
|
8254
8292
|
base: l,
|
|
8255
8293
|
step: n,
|
|
8256
8294
|
output: r,
|
|
@@ -8260,7 +8298,7 @@ function Cs({ view: e, run: t, step: n, output: r, onView: i }) {
|
|
|
8260
8298
|
...r,
|
|
8261
8299
|
text: u
|
|
8262
8300
|
} : r;
|
|
8263
|
-
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(
|
|
8301
|
+
return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(os, {
|
|
8264
8302
|
base: l,
|
|
8265
8303
|
step: n,
|
|
8266
8304
|
output: d,
|
|
@@ -8280,38 +8318,38 @@ function Cs({ view: e, run: t, step: n, output: r, onView: i }) {
|
|
|
8280
8318
|
c(!0), await t.translateResult?.(n.id), c(!1);
|
|
8281
8319
|
},
|
|
8282
8320
|
children: [
|
|
8283
|
-
/* @__PURE__ */ F(
|
|
8321
|
+
/* @__PURE__ */ F(O, { className: "size-4" }),
|
|
8284
8322
|
" ",
|
|
8285
8323
|
V(s ? "translation.working" : "result.translate")
|
|
8286
8324
|
]
|
|
8287
8325
|
})
|
|
8288
8326
|
})] });
|
|
8289
8327
|
}
|
|
8290
|
-
function
|
|
8328
|
+
function Ds({ run: e, compact: t, onRestart: n, onView: r, stickyProgress: i, studio: a }) {
|
|
8291
8329
|
let { view: o } = e;
|
|
8292
|
-
|
|
8330
|
+
yr(o?.translation?.labels), A(() => {
|
|
8293
8331
|
r?.(o);
|
|
8294
|
-
}, [o, r]),
|
|
8295
|
-
let s =
|
|
8296
|
-
if (
|
|
8332
|
+
}, [o, r]), ti();
|
|
8333
|
+
let s = ni(o?.status === "running" && !o.ask);
|
|
8334
|
+
if (Ss(o), e.notFound) return /* @__PURE__ */ F("div", {
|
|
8297
8335
|
className: "py-24 text-center text-ink-3",
|
|
8298
8336
|
children: V("run.notFound")
|
|
8299
8337
|
});
|
|
8300
8338
|
if (!o) return /* @__PURE__ */ F("div", {
|
|
8301
8339
|
className: "flex justify-center py-24 text-ink-4",
|
|
8302
|
-
children: /* @__PURE__ */ F(
|
|
8340
|
+
children: /* @__PURE__ */ F(Ur, {})
|
|
8303
8341
|
});
|
|
8304
8342
|
let c = o.step, l = null;
|
|
8305
|
-
if (o.status === "running" && o.ask) l = /* @__PURE__ */ F(
|
|
8343
|
+
if (o.status === "running" && o.ask) l = /* @__PURE__ */ F(Xr, {
|
|
8306
8344
|
runId: o.id,
|
|
8307
8345
|
ask: o.ask
|
|
8308
8346
|
}, o.ask.id);
|
|
8309
|
-
else if (o.status === "running") l = /* @__PURE__ */ F(
|
|
8347
|
+
else if (o.status === "running") l = /* @__PURE__ */ F(xs, {
|
|
8310
8348
|
view: o,
|
|
8311
8349
|
compact: t,
|
|
8312
8350
|
awake: s
|
|
8313
8351
|
});
|
|
8314
|
-
else if (o.status === "failed") l = /* @__PURE__ */ F(
|
|
8352
|
+
else if (o.status === "failed") l = /* @__PURE__ */ F(Ts, {
|
|
8315
8353
|
view: o,
|
|
8316
8354
|
run: e
|
|
8317
8355
|
});
|
|
@@ -8319,20 +8357,20 @@ function ws({ run: e, compact: t, onRestart: n, onView: r, stickyProgress: i, st
|
|
|
8319
8357
|
className: "py-24 text-center text-ink-3",
|
|
8320
8358
|
children: V("run.cancelled")
|
|
8321
8359
|
});
|
|
8322
|
-
else if (c?.type === "page") l = /* @__PURE__ */ F(
|
|
8360
|
+
else if (c?.type === "page") l = /* @__PURE__ */ F(vs, {
|
|
8323
8361
|
view: o,
|
|
8324
8362
|
run: e,
|
|
8325
8363
|
step: c
|
|
8326
8364
|
}, c.id);
|
|
8327
8365
|
else if (c?.type === "review") {
|
|
8328
8366
|
let t = o.shown.map((e) => e.output?.at ?? "").join("|");
|
|
8329
|
-
l = /* @__PURE__ */ F(
|
|
8367
|
+
l = /* @__PURE__ */ F(Cs, {
|
|
8330
8368
|
view: o,
|
|
8331
8369
|
run: e,
|
|
8332
8370
|
step: c,
|
|
8333
8371
|
studio: a
|
|
8334
8372
|
}, `${c.id}:${t}`);
|
|
8335
|
-
} else c?.type === "result" && (l = /* @__PURE__ */ F(
|
|
8373
|
+
} else c?.type === "result" && (l = /* @__PURE__ */ F(ws, {
|
|
8336
8374
|
view: o,
|
|
8337
8375
|
run: e,
|
|
8338
8376
|
step: c,
|
|
@@ -8344,8 +8382,8 @@ function ws({ run: e, compact: t, onRestart: n, onView: r, stickyProgress: i, st
|
|
|
8344
8382
|
className: "flex min-h-full flex-col",
|
|
8345
8383
|
children: [i ? /* @__PURE__ */ F("div", {
|
|
8346
8384
|
className: "sticky top-0 z-10",
|
|
8347
|
-
children: /* @__PURE__ */ F(
|
|
8348
|
-
}) : /* @__PURE__ */ F(
|
|
8385
|
+
children: /* @__PURE__ */ F(ps, { view: o })
|
|
8386
|
+
}) : /* @__PURE__ */ F(ps, { view: o }), /* @__PURE__ */ I("div", {
|
|
8349
8387
|
className: q("safe-x kb-tight mx-auto w-full flex-1", u ? "max-w-[1240px] py-8" : t ? "max-w-[620px] py-8" : "max-w-[640px] py-8 sm:py-16"),
|
|
8350
8388
|
children: [
|
|
8351
8389
|
l,
|
|
@@ -8355,7 +8393,7 @@ function ws({ run: e, compact: t, onRestart: n, onView: r, stickyProgress: i, st
|
|
|
8355
8393
|
}) : null,
|
|
8356
8394
|
o.keeps && o.status !== "running" ? /* @__PURE__ */ F("div", {
|
|
8357
8395
|
className: "mt-10 flex justify-center",
|
|
8358
|
-
children: /* @__PURE__ */ F(
|
|
8396
|
+
children: /* @__PURE__ */ F(Aa, { runId: o.id })
|
|
8359
8397
|
}) : null
|
|
8360
8398
|
]
|
|
8361
8399
|
})]
|
|
@@ -8363,13 +8401,13 @@ function ws({ run: e, compact: t, onRestart: n, onView: r, stickyProgress: i, st
|
|
|
8363
8401
|
}
|
|
8364
8402
|
//#endregion
|
|
8365
8403
|
//#region ../shared/src/theme.ts
|
|
8366
|
-
var
|
|
8404
|
+
var Os = [
|
|
8367
8405
|
"brand",
|
|
8368
8406
|
"host",
|
|
8369
8407
|
"default"
|
|
8370
8408
|
];
|
|
8371
|
-
[...
|
|
8372
|
-
var
|
|
8409
|
+
[...Os];
|
|
8410
|
+
var ks = [
|
|
8373
8411
|
"Inter",
|
|
8374
8412
|
"Figtree",
|
|
8375
8413
|
"DM Sans",
|
|
@@ -8383,11 +8421,11 @@ var Es = [
|
|
|
8383
8421
|
"Caveat",
|
|
8384
8422
|
"Creepster",
|
|
8385
8423
|
"Nosifer"
|
|
8386
|
-
],
|
|
8387
|
-
accent:
|
|
8388
|
-
background:
|
|
8389
|
-
text:
|
|
8390
|
-
}).extend({ scheme: N.enum(["light", "dark"]) }),
|
|
8424
|
+
], As = N.string().regex(/^#[0-9a-fA-F]{6}$/, "a colour as #rrggbb"), js = N.object({
|
|
8425
|
+
accent: As.optional(),
|
|
8426
|
+
background: As.optional(),
|
|
8427
|
+
text: As.optional()
|
|
8428
|
+
}).extend({ scheme: N.enum(["light", "dark"]) }), Ms = N.object({
|
|
8391
8429
|
radius: N.enum([
|
|
8392
8430
|
"sharp",
|
|
8393
8431
|
"soft",
|
|
@@ -8399,33 +8437,33 @@ var Es = [
|
|
|
8399
8437
|
"glass"
|
|
8400
8438
|
]).optional(),
|
|
8401
8439
|
headings: N.enum(["normal", "uppercase"]).optional()
|
|
8402
|
-
}),
|
|
8440
|
+
}), Ns = N.object({ id: N.string().min(1).max(40) }).catchall(N.union([
|
|
8403
8441
|
N.string().max(40),
|
|
8404
8442
|
N.number(),
|
|
8405
8443
|
N.boolean()
|
|
8406
|
-
])),
|
|
8444
|
+
])), Ps = N.string().min(1).max(60).regex(/^[A-Za-z0-9 -]+$/, "a font by its family name, or brand");
|
|
8407
8445
|
N.object({
|
|
8408
8446
|
id: N.string().regex(qt, "a theme id: lowercase letters, digits and dashes"),
|
|
8409
8447
|
name: N.string().min(1).max(80),
|
|
8410
8448
|
version: N.string().regex(/^\d+\.\d+\.\d+$/).default("1.0.0"),
|
|
8411
|
-
base: N.enum(
|
|
8412
|
-
colors: N.array(
|
|
8449
|
+
base: N.enum(Os).default("brand"),
|
|
8450
|
+
colors: N.array(js).min(1).max(2).refine((e) => new Set(e.map((e) => e.scheme)).size === e.length, { message: "Each scheme once: light, dark." }).optional(),
|
|
8413
8451
|
fonts: N.object({
|
|
8414
|
-
heading:
|
|
8415
|
-
text:
|
|
8452
|
+
heading: Ps.optional(),
|
|
8453
|
+
text: Ps.optional()
|
|
8416
8454
|
}).optional(),
|
|
8417
|
-
shape:
|
|
8418
|
-
effects: N.array(
|
|
8455
|
+
shape: Ms.optional(),
|
|
8456
|
+
effects: N.array(Ns).max(8).optional()
|
|
8419
8457
|
});
|
|
8420
|
-
var
|
|
8421
|
-
function
|
|
8422
|
-
return
|
|
8458
|
+
var Fs = "ui-sans-serif, system-ui, sans-serif", Is = "ui-serif, Georgia, serif", Ls = /serif|fraunces|playfair|lora|garamond|antiqua|baskerville|caslon|bodoni|didot|times|georgia|merriweather|tiempos/i, Rs = (e) => Ls.test(e) && !/sans/i.test(e), zs = (e) => Rs(e) ? "Lora" : "Inter", Bs = (e) => e.toLowerCase().replace(/ /g, "-");
|
|
8459
|
+
function Vs(e) {
|
|
8460
|
+
return ks.includes(e) ? `/api/public/fonts/shipped/${Bs(e)}.css` : null;
|
|
8423
8461
|
}
|
|
8424
|
-
function
|
|
8425
|
-
let n = t.some((t) => t.family === e) ? `"${
|
|
8426
|
-
return `"${e.replace(/"/g, "")}", ${n}${
|
|
8462
|
+
function Hs(e, t = []) {
|
|
8463
|
+
let n = t.some((t) => t.family === e) ? `"${zs(e)}", ` : "";
|
|
8464
|
+
return `"${e.replace(/"/g, "")}", ${n}${Rs(e) ? Is : Fs}`;
|
|
8427
8465
|
}
|
|
8428
|
-
function
|
|
8466
|
+
function Us(e, t) {
|
|
8429
8467
|
let n = e.modes?.[t];
|
|
8430
8468
|
return {
|
|
8431
8469
|
accent: n?.accent ?? e.accent,
|
|
@@ -8435,30 +8473,30 @@ function Bs(e, t) {
|
|
|
8435
8473
|
}
|
|
8436
8474
|
//#endregion
|
|
8437
8475
|
//#region src/openui/fonts.ts
|
|
8438
|
-
var
|
|
8439
|
-
function
|
|
8440
|
-
let n = e ?
|
|
8441
|
-
if (!n ||
|
|
8442
|
-
|
|
8476
|
+
var Ws = /* @__PURE__ */ new Set();
|
|
8477
|
+
function Gs(e, t) {
|
|
8478
|
+
let n = e ? Vs(e) : null;
|
|
8479
|
+
if (!n || Ws.has(n)) return;
|
|
8480
|
+
Ws.add(n);
|
|
8443
8481
|
let r = document.createElement("link");
|
|
8444
8482
|
r.rel = "stylesheet", r.href = `${t}${n}`, document.head.append(r);
|
|
8445
8483
|
}
|
|
8446
|
-
function
|
|
8447
|
-
for (let n of e.faces)
|
|
8448
|
-
|
|
8484
|
+
function Ks(e, t) {
|
|
8485
|
+
for (let n of e.faces) Xa(n, n.url.startsWith("/") ? `${t}${n.url}` : n.url, () => Gs(zs(n.family), t));
|
|
8486
|
+
Gs(e.display, t), Gs(e.body, t);
|
|
8449
8487
|
}
|
|
8450
8488
|
//#endregion
|
|
8451
8489
|
//#region src/openui/look.ts
|
|
8452
|
-
var
|
|
8490
|
+
var qs = ["glow", "pattern"], Js = {
|
|
8453
8491
|
sharp: "0.25rem",
|
|
8454
8492
|
soft: "0.5rem",
|
|
8455
8493
|
round: "0.8rem"
|
|
8456
8494
|
};
|
|
8457
|
-
function
|
|
8458
|
-
let n = e.dark ? "dark" : "light", r =
|
|
8495
|
+
function Ys(e, t = {}) {
|
|
8496
|
+
let n = e.dark ? "dark" : "light", r = Us(e, e.pinned ? n : t.mode ?? e.prefer ?? n), i = {}, a = (e, t) => {
|
|
8459
8497
|
t && (i[e] = t);
|
|
8460
8498
|
};
|
|
8461
|
-
a("--wizard-accent", r.accent), a("--wizard-background", r.background), a("--wizard-text", r.text), a("--wizard-font-heading", e.display ?
|
|
8499
|
+
a("--wizard-accent", r.accent), a("--wizard-background", r.background), a("--wizard-text", r.text), a("--wizard-font-heading", e.display ? Hs(e.display, e.faces) : null), a("--wizard-font-text", e.body ? Hs(e.body, e.faces) : null), a("--wizard-radius", e.shape?.radius ? Js[e.shape.radius] : null), a("backgroundColor", r.background ? "var(--paper)" : null);
|
|
8462
8500
|
let o = new Set(t.effects ?? []), s = e.effects.flatMap((e) => o.has(e.id) ? e.id === "glow" ? ["glow"] : e.id === "pattern" ? [`pattern-${e.kind === "grid" ? "grid" : "dots"}`] : [] : []);
|
|
8463
8501
|
return {
|
|
8464
8502
|
style: i,
|
|
@@ -8469,8 +8507,8 @@ function Ks(e, t = {}) {
|
|
|
8469
8507
|
}
|
|
8470
8508
|
//#endregion
|
|
8471
8509
|
//#region src/openui/run.ts
|
|
8472
|
-
var
|
|
8473
|
-
function
|
|
8510
|
+
var Xs = 45e3;
|
|
8511
|
+
function Zs(e, t) {
|
|
8474
8512
|
let [n, r] = M(null), [i, a] = M(null), [o, s] = M(!1), [c, l] = M(!1), [u, d] = M({});
|
|
8475
8513
|
A(() => {
|
|
8476
8514
|
if (r(null), s(!1), !e) return;
|
|
@@ -8479,7 +8517,7 @@ function Js(e, t) {
|
|
|
8479
8517
|
let n = await U.get(t(e));
|
|
8480
8518
|
i || r(n);
|
|
8481
8519
|
} catch (e) {
|
|
8482
|
-
e instanceof
|
|
8520
|
+
e instanceof xr && e.status === 404 && (i = !0, c?.close(), s(!0));
|
|
8483
8521
|
}
|
|
8484
8522
|
}, d = () => {
|
|
8485
8523
|
if (clearTimeout(o), c?.close(), i) return;
|
|
@@ -8492,7 +8530,7 @@ function Js(e, t) {
|
|
|
8492
8530
|
s.close(), !(i || c !== s) && (c = null, u(), a = Math.min(a + 1, 6), o = setTimeout(d, 500 * 2 ** a));
|
|
8493
8531
|
};
|
|
8494
8532
|
}, f = setInterval(() => {
|
|
8495
|
-
!i && c && Date.now() - l >
|
|
8533
|
+
!i && c && Date.now() - l > Xs && (a = 0, d());
|
|
8496
8534
|
}, 15e3);
|
|
8497
8535
|
return d(), () => {
|
|
8498
8536
|
i = !0, clearTimeout(o), clearInterval(f), c?.close();
|
|
@@ -8504,7 +8542,7 @@ function Js(e, t) {
|
|
|
8504
8542
|
try {
|
|
8505
8543
|
return await U.post(`${H().runBase(e)}/${t}`, n), !0;
|
|
8506
8544
|
} catch (e) {
|
|
8507
|
-
return e instanceof
|
|
8545
|
+
return e instanceof xr && e.status === 422 && Array.isArray(e.body?.fields) && d(Object.fromEntries(e.body.fields.map((e) => [e.field, e.message]))), a(e.message), !1;
|
|
8508
8546
|
} finally {
|
|
8509
8547
|
l(!1);
|
|
8510
8548
|
}
|
|
@@ -8519,7 +8557,7 @@ function Js(e, t) {
|
|
|
8519
8557
|
}
|
|
8520
8558
|
} : n;
|
|
8521
8559
|
}, [n, t]);
|
|
8522
|
-
return
|
|
8560
|
+
return yr(n?.translation?.labels), {
|
|
8523
8561
|
view: p,
|
|
8524
8562
|
notFound: o,
|
|
8525
8563
|
error: i,
|
|
@@ -8543,22 +8581,22 @@ function Js(e, t) {
|
|
|
8543
8581
|
}
|
|
8544
8582
|
//#endregion
|
|
8545
8583
|
//#region src/openui/message.ts
|
|
8546
|
-
var
|
|
8547
|
-
function
|
|
8584
|
+
var Qs = (e) => `wizard:${e}`, $s = "wizard:empty";
|
|
8585
|
+
function ec(t, n) {
|
|
8548
8586
|
let r = He(), i = Ve(), a = Ue(), [o, s] = M(null), [c, l] = M(null), u = j(null);
|
|
8549
8587
|
return A(() => {
|
|
8550
8588
|
if (r || o || c || !t) return;
|
|
8551
8589
|
let d = !1;
|
|
8552
8590
|
return (async () => {
|
|
8553
8591
|
if (await Promise.resolve(), d) return;
|
|
8554
|
-
let r = i(void 0,
|
|
8592
|
+
let r = i(void 0, Qs(t));
|
|
8555
8593
|
if (typeof r == "string") {
|
|
8556
8594
|
s(r);
|
|
8557
8595
|
return;
|
|
8558
8596
|
}
|
|
8559
8597
|
u.current ??= n(t);
|
|
8560
8598
|
let o = await u.current;
|
|
8561
|
-
d || (s(o), a(void 0, e,
|
|
8599
|
+
d || (s(o), a(void 0, e, Qs(t), o, !0));
|
|
8562
8600
|
})().catch((e) => {
|
|
8563
8601
|
d || l(e instanceof Error ? e.message : String(e));
|
|
8564
8602
|
}), () => {
|
|
@@ -8577,10 +8615,10 @@ function Zs(t, n) {
|
|
|
8577
8615
|
failed: c
|
|
8578
8616
|
};
|
|
8579
8617
|
}
|
|
8580
|
-
function
|
|
8618
|
+
function tc() {
|
|
8581
8619
|
let e = Ue(), t = We();
|
|
8582
8620
|
return Ne((n, r) => {
|
|
8583
|
-
e(
|
|
8621
|
+
e($s, void 0, "empty", void 0, !1), t(n, $s, {
|
|
8584
8622
|
type: "continue_conversation",
|
|
8585
8623
|
params: { context: r }
|
|
8586
8624
|
});
|
|
@@ -8588,8 +8626,8 @@ function Qs() {
|
|
|
8588
8626
|
}
|
|
8589
8627
|
//#endregion
|
|
8590
8628
|
//#region src/openui/Wizard.tsx
|
|
8591
|
-
var
|
|
8592
|
-
function
|
|
8629
|
+
var nc = {}, rc = "";
|
|
8630
|
+
function ic({ size: e = 64 }) {
|
|
8593
8631
|
let t = Math.min(e, 72);
|
|
8594
8632
|
return /* @__PURE__ */ F("span", {
|
|
8595
8633
|
"aria-hidden": "true",
|
|
@@ -8600,44 +8638,44 @@ function tc({ size: e = 64 }) {
|
|
|
8600
8638
|
}
|
|
8601
8639
|
});
|
|
8602
8640
|
}
|
|
8603
|
-
function
|
|
8641
|
+
function ac(e) {
|
|
8604
8642
|
let t = e.runtime.replace(/\/+$/, "");
|
|
8605
|
-
|
|
8643
|
+
rc = t, Er({
|
|
8606
8644
|
lang: e.lang ?? "en",
|
|
8607
8645
|
runBase: (e) => `/api/runs/${e}`,
|
|
8608
8646
|
withBase: (e) => `${t}${e}`,
|
|
8609
8647
|
asset: (e) => `${t}/${e.replace(/^\/+/, "")}`,
|
|
8610
|
-
Mascot: e.Mascot ??
|
|
8611
|
-
}),
|
|
8648
|
+
Mascot: e.Mascot ?? ic
|
|
8649
|
+
}), nc = {
|
|
8612
8650
|
theme: e.theme,
|
|
8613
8651
|
mode: e.mode,
|
|
8614
8652
|
effects: e.effects
|
|
8615
|
-
},
|
|
8653
|
+
}, oc.clear();
|
|
8616
8654
|
}
|
|
8617
|
-
var
|
|
8618
|
-
function
|
|
8619
|
-
let t =
|
|
8655
|
+
var oc = /* @__PURE__ */ new Map();
|
|
8656
|
+
function sc(e) {
|
|
8657
|
+
let t = oc.get(e);
|
|
8620
8658
|
if (!t) {
|
|
8621
|
-
let n =
|
|
8622
|
-
t = U.get(`/api/public/wizards/${encodeURIComponent(e)}${n}`).then((e) => (
|
|
8659
|
+
let n = nc.theme ? `?theme=${encodeURIComponent(nc.theme)}` : "";
|
|
8660
|
+
t = U.get(`/api/public/wizards/${encodeURIComponent(e)}${n}`).then((e) => (Ks(e.brand.theme, rc), e.brand.theme), () => null), oc.set(e, t);
|
|
8623
8661
|
}
|
|
8624
8662
|
return t;
|
|
8625
8663
|
}
|
|
8626
|
-
function
|
|
8664
|
+
function cc(e) {
|
|
8627
8665
|
let [t, n] = M(null);
|
|
8628
8666
|
return A(() => {
|
|
8629
|
-
if (
|
|
8667
|
+
if (nc.theme === "host") return;
|
|
8630
8668
|
let t = !0;
|
|
8631
|
-
return
|
|
8669
|
+
return sc(e).then((e) => t && n(e)), () => {
|
|
8632
8670
|
t = !1;
|
|
8633
8671
|
};
|
|
8634
|
-
}, [e]), t ?
|
|
8635
|
-
mode:
|
|
8636
|
-
effects:
|
|
8672
|
+
}, [e]), t ? Ys(t, {
|
|
8673
|
+
mode: nc.mode,
|
|
8674
|
+
effects: nc.effects
|
|
8637
8675
|
}) : null;
|
|
8638
8676
|
}
|
|
8639
|
-
var
|
|
8640
|
-
function
|
|
8677
|
+
var lc = (e) => U.post(`/api/public/wizards/${encodeURIComponent(e)}/runs`, {}).then((e) => e.runId);
|
|
8678
|
+
function uc(e) {
|
|
8641
8679
|
let t = Object.entries(e.outputs).filter(([, e]) => typeof e.text == "string" && e.text.trim()).map(([e, t]) => ({
|
|
8642
8680
|
step: e,
|
|
8643
8681
|
text: (t.text ?? "").slice(0, 4e3)
|
|
@@ -8648,10 +8686,10 @@ function sc(e) {
|
|
|
8648
8686
|
results: t
|
|
8649
8687
|
};
|
|
8650
8688
|
}
|
|
8651
|
-
function
|
|
8652
|
-
let { runId: t, failed: n } =
|
|
8689
|
+
function dc({ props: e }) {
|
|
8690
|
+
let { runId: t, failed: n } = ec(e.wizard, lc), r = Zs(t, e.prefill), i = tc(), a = cc(e.wizard), o = r.view, s = j(!1);
|
|
8653
8691
|
return A(() => {
|
|
8654
|
-
o && (o.status === "done" ? s.current && (s.current = !1, i(`The wizard “${o.wizard.title}” finished.`,
|
|
8692
|
+
o && (o.status === "done" ? s.current && (s.current = !1, i(`The wizard “${o.wizard.title}” finished.`, uc(o))) : s.current = !0);
|
|
8655
8693
|
}, [o, i]), /* @__PURE__ */ I("div", {
|
|
8656
8694
|
...a,
|
|
8657
8695
|
style: a?.style,
|
|
@@ -8664,20 +8702,20 @@ function cc({ props: e }) {
|
|
|
8664
8702
|
children: n ? /* @__PURE__ */ F("p", {
|
|
8665
8703
|
className: "py-10 text-center text-ink-3",
|
|
8666
8704
|
children: n
|
|
8667
|
-
}) : /* @__PURE__ */ F(
|
|
8705
|
+
}) : /* @__PURE__ */ F(Ds, {
|
|
8668
8706
|
run: r,
|
|
8669
8707
|
compact: !0
|
|
8670
8708
|
})
|
|
8671
8709
|
})]
|
|
8672
8710
|
});
|
|
8673
8711
|
}
|
|
8674
|
-
var
|
|
8712
|
+
var fc = Be({
|
|
8675
8713
|
name: e,
|
|
8676
8714
|
description: t,
|
|
8677
8715
|
props: a,
|
|
8678
|
-
component: ({ props: e }) => /* @__PURE__ */ F(
|
|
8716
|
+
component: ({ props: e }) => /* @__PURE__ */ F(dc, { props: e })
|
|
8679
8717
|
});
|
|
8680
8718
|
//#endregion
|
|
8681
|
-
export {
|
|
8719
|
+
export { qs as CARD_EFFECTS, e as WIZARD_COMPONENT, t as WIZARD_DESCRIPTION, fc as Wizard, n as WizardSpec, r as addWizard, ac as configureWizards, Ks as loadLookFonts, i as loadWizards, Zs as useWizardRun, Ys as wizardLook, a as wizardProps, o as wizardRules };
|
|
8682
8720
|
|
|
8683
8721
|
//# sourceMappingURL=index.js.map
|