@engenty/wizards 0.7.11 → 0.9.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.
@@ -839,11 +839,16 @@ var rn = [
839
839
  label: N.string().optional(),
840
840
  formats: N.array(N.enum(on)).min(1)
841
841
  }), kn = N.object({
842
+ target: N.string().min(1),
843
+ label: N.string().optional(),
844
+ values: N.record(N.string(), N.string()).optional()
845
+ }), An = N.object({
842
846
  ...gn,
843
847
  type: N.literal("result"),
844
848
  message: N.string().optional(),
845
- deliverables: N.array(On)
846
- }), An = N.discriminatedUnion("type", [
849
+ deliverables: N.array(On),
850
+ share: N.array(kn).max(12).optional()
851
+ }), jn = N.discriminatedUnion("type", [
847
852
  vn,
848
853
  bn,
849
854
  xn,
@@ -851,13 +856,13 @@ var rn = [
851
856
  En,
852
857
  wn,
853
858
  Dn,
854
- kn
859
+ An
855
860
  ]);
856
- function jn(e) {
861
+ function Mn(e) {
857
862
  return e.output.schema ? e.output.schema : e.output.fields?.length ? At(e.output.fields) : void 0;
858
863
  }
859
- function Mn(e) {
860
- return jn(e) ?? {
864
+ function Nn(e) {
865
+ return Mn(e) ?? {
861
866
  kind: "object",
862
867
  fields: { data: {
863
868
  kind: "table",
@@ -865,7 +870,7 @@ function Mn(e) {
865
870
  } }
866
871
  };
867
872
  }
868
- var Nn = N.object({
873
+ var Pn = N.object({
869
874
  id: z,
870
875
  title: N.string().min(1),
871
876
  description: N.string().optional(),
@@ -876,7 +881,7 @@ var Nn = N.object({
876
881
  status: N.string().optional()
877
882
  }).optional(),
878
883
  shared: N.boolean().optional()
879
- }), Pn = N.object({
884
+ }), Fn = N.object({
880
885
  id: z,
881
886
  kind: N.enum(It).optional(),
882
887
  connector: N.string().optional(),
@@ -892,21 +897,21 @@ N.object({
892
897
  avatar: N.enum(Gt).default("round"),
893
898
  intro: N.string().optional(),
894
899
  lang: N.string().regex(/^[a-z]{2}$/).optional(),
895
- lists: N.array(Nn).max(12).optional(),
896
- connections: N.array(Pn).max(12).optional(),
897
- steps: N.array(An).min(1)
900
+ lists: N.array(Pn).max(12).optional(),
901
+ connections: N.array(Fn).max(12).optional(),
902
+ steps: N.array(jn).min(1)
898
903
  });
899
- function Fn(e) {
904
+ function In(e) {
900
905
  return e == null || e === "" || Array.isArray(e) && e.length === 0;
901
906
  }
902
- function In(e) {
907
+ function Ln(e) {
903
908
  return e === void 0 ? [] : Array.isArray(e) ? e : [e];
904
909
  }
905
- function Ln(e, t) {
910
+ function Rn(e, t) {
906
911
  let n = t[e.field];
907
912
  switch (e.op) {
908
- case "empty": return Fn(n);
909
- case "notEmpty": return !Fn(n);
913
+ case "empty": return In(n);
914
+ case "notEmpty": return !In(n);
910
915
  case "equals": return String(n) === String(e.value);
911
916
  case "notEquals": return String(n) !== String(e.value);
912
917
  case "in": return Array.isArray(e.value) && e.value.map(String).includes(String(n));
@@ -918,23 +923,23 @@ function Ln(e, t) {
918
923
  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());
919
924
  }
920
925
  }
921
- function Rn(e, t) {
922
- return In(e).every((e) => Ln(e, t));
926
+ function zn(e, t) {
927
+ return Ln(e).every((e) => Rn(e, t));
923
928
  }
924
- function zn(e) {
929
+ function Bn(e) {
925
930
  return !!(e.ask || e.group);
926
931
  }
927
- function Bn(e, t, n) {
932
+ function Vn(e, t, n) {
928
933
  let r = {
929
934
  ...t,
930
935
  ...n
931
936
  }, i = [];
932
- for (let t of e) Rn(t.when, r) ? i.push(t) : delete r[t.id];
937
+ for (let t of e) zn(t.when, r) ? i.push(t) : delete r[t.id];
933
938
  return i;
934
939
  }
935
- var Vn = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/;
936
- function Hn(e) {
937
- let t = Vn.exec(e.trim());
940
+ var Hn = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/;
941
+ function Un(e) {
942
+ let t = Hn.exec(e.trim());
938
943
  if (!t) return null;
939
944
  let [, n, r, i, a, o] = t.map(Number), s = new Date(Date.UTC(n, r - 1, i, a, o));
940
945
  return s.getUTCMonth() !== r - 1 || s.getUTCDate() !== i || a > 23 || o > 59 || !Number.isFinite(Date.parse(e)) ? null : {
@@ -943,8 +948,8 @@ function Hn(e) {
943
948
  wall: s
944
949
  };
945
950
  }
946
- function Un(e, t = "en") {
947
- let n = Hn(e);
951
+ function Wn(e, t = "en") {
952
+ let n = Un(e);
948
953
  if (!n) return e;
949
954
  let r = Yt(t);
950
955
  return `${n.wall.toLocaleDateString(r, {
@@ -956,63 +961,63 @@ function Un(e, t = "en") {
956
961
  timeZone: "UTC"
957
962
  })}`;
958
963
  }
959
- function Wn(e, t, n) {
964
+ function Gn(e, t, n) {
960
965
  let r = Array.isArray(t) ? t : [], i = (e.columns ?? []).filter((e) => e.kind !== "text"), a = r.map((e) => {
961
- let t = i.length ? i.reduce((t, n) => t * Gn(e[n.id]), 1) : 0;
966
+ let t = i.length ? i.reduce((t, n) => t * Kn(e[n.id]), 1) : 0;
962
967
  return {
963
968
  ...e,
964
- amount: Kn(t)
969
+ amount: qn(t)
965
970
  };
966
- }), o = Kn(a.reduce((e, t) => e + t.amount, 0)), s = e.vat?.rate ?? 0;
971
+ }), o = qn(a.reduce((e, t) => e + t.amount, 0)), s = e.vat?.rate ?? 0;
967
972
  if (e.vat?.field) {
968
973
  let t = n[e.vat.field], r = yt(t, { units: !0 });
969
974
  r !== null && (s = r);
970
975
  }
971
- let c = Kn(o * s / 100);
976
+ let c = qn(o * s / 100);
972
977
  return {
973
978
  rows: a,
974
979
  net: o,
975
980
  vatRate: s,
976
981
  vat: c,
977
- gross: Kn(o + c),
982
+ gross: qn(o + c),
978
983
  currency: e.currency ?? "EUR"
979
984
  };
980
985
  }
981
- function Gn(e) {
986
+ function Kn(e) {
982
987
  return yt(e) ?? 0;
983
988
  }
984
- function Kn(e) {
989
+ function qn(e) {
985
990
  return Math.round(e * 100) / 100;
986
991
  }
987
992
  //#endregion
988
993
  //#region ../shared/src/texts.ts
989
- var qn = /* @__PURE__ */ new Map();
990
- function Jn(e) {
991
- let t = qn.get(e);
992
- return t || (t = new Intl.PluralRules(Yt(e)), qn.set(e, t)), t;
994
+ var Jn = /* @__PURE__ */ new Map();
995
+ function Yn(e) {
996
+ let t = Jn.get(e);
997
+ return t || (t = new Intl.PluralRules(Yt(e)), Jn.set(e, t)), t;
993
998
  }
994
- function Yn(e, t, n) {
995
- return typeof e == "string" ? e : typeof n == "number" ? e[Jn(t).select(n)] ?? e.other : e.other;
999
+ function Xn(e, t, n) {
1000
+ return typeof e == "string" ? e : typeof n == "number" ? e[Yn(t).select(n)] ?? e.other : e.other;
996
1001
  }
997
- function Xn(e, t) {
998
- return typeof e == "number" ? e.toLocaleString(Yt(t)) : Array.isArray(e) ? e.map((e) => Xn(e, t)).join(", ") : e;
1002
+ function Zn(e, t) {
1003
+ return typeof e == "number" ? e.toLocaleString(Yt(t)) : Array.isArray(e) ? e.map((e) => Zn(e, t)).join(", ") : e;
999
1004
  }
1000
- function Zn(e, t, n) {
1005
+ function Qn(e, t, n) {
1001
1006
  return e.replace(/\{(\w+)\}/g, (e, r) => {
1002
1007
  let i = n?.[r];
1003
- return i === void 0 ? e : Xn(i, t);
1008
+ return i === void 0 ? e : Zn(i, t);
1004
1009
  });
1005
1010
  }
1006
- function Qn(e, t, n, r) {
1011
+ function $n(e, t, n, r) {
1007
1012
  let i = e[n][t] ?? e.en[t];
1008
- return i === void 0 ? t : Zn(Yn(i, n, r?.count ?? r?.n), n, r);
1013
+ return i === void 0 ? t : Qn(Xn(i, n, r?.count ?? r?.n), n, r);
1009
1014
  }
1010
- function $n(e, t, n) {
1011
- return Zn(Yn(e, t, n?.count ?? n?.n), t, n);
1015
+ function er(e, t, n) {
1016
+ return Qn(Xn(e, t, n?.count ?? n?.n), t, n);
1012
1017
  }
1013
1018
  //#endregion
1014
1019
  //#region ../shared/src/run.ts
1015
- var er = {
1020
+ var tr = {
1016
1021
  entry: "Entry {n} of {total}",
1017
1022
  deciding: "Deciding what to do next…",
1018
1023
  choosingFields: "Choosing the right questions…",
@@ -1055,6 +1060,7 @@ var er = {
1055
1060
  looksAtPage: "Looking at the page",
1056
1061
  waitsForSignIn: "Waiting for you to sign in to {name}",
1057
1062
  downloads: "Downloading {name}",
1063
+ attaches: "Attaching {name}",
1058
1064
  runs: "Running: {command}",
1059
1065
  python: "Running Python",
1060
1066
  runsProgram: "Working through the data in one go",
@@ -1310,8 +1316,8 @@ var er = {
1310
1316
  makesVideos: "videos",
1311
1317
  makesSpeech: "speech",
1312
1318
  makesVoiceNotes: "voice notes"
1313
- }, tr = {
1314
- en: er,
1319
+ }, nr = {
1320
+ en: tr,
1315
1321
  de: {
1316
1322
  entry: "Eintrag {n} von {total}",
1317
1323
  deciding: "Entscheidet, wie es weitergeht …",
@@ -1355,6 +1361,7 @@ var er = {
1355
1361
  looksAtPage: "Sieht sich die Seite an",
1356
1362
  waitsForSignIn: "Wartet auf deine Anmeldung bei {name}",
1357
1363
  downloads: "Lädt {name} herunter",
1364
+ attaches: "Hängt {name} an",
1358
1365
  runs: "Führt aus: {command}",
1359
1366
  runsProgram: "Arbeitet die Daten in einem Zug durch",
1360
1367
  python: "Führt Python aus",
@@ -1606,17 +1613,17 @@ var er = {
1606
1613
  makesVoiceNotes: "Sprachnotizen"
1607
1614
  }
1608
1615
  };
1609
- function nr(e, t, n) {
1610
- return Array.isArray(e) ? e.map((e) => nr(e, t, n)) : typeof e == "object" && e && "code" in e ? rr(e, t, n) : e;
1611
- }
1612
1616
  function rr(e, t, n) {
1613
- if (!(e.code in er)) return "";
1617
+ return Array.isArray(e) ? e.map((e) => rr(e, t, n)) : typeof e == "object" && e && "code" in e ? ir(e, t, n) : e;
1618
+ }
1619
+ function ir(e, t, n) {
1620
+ if (!(e.code in tr)) return "";
1614
1621
  let r = {};
1615
- for (let [i, a] of Object.entries(e.params ?? {})) r[i] = a === void 0 ? void 0 : nr(a, t, n);
1622
+ for (let [i, a] of Object.entries(e.params ?? {})) r[i] = a === void 0 ? void 0 : rr(a, t, n);
1616
1623
  let i = n?.[e.code];
1617
- return i === void 0 ? Qn(tr, e.code, Jt(t) ? t : "en", r) : $n(i, t, r);
1624
+ return i === void 0 ? $n(nr, e.code, Jt(t) ? t : "en", r) : er(i, t, r);
1618
1625
  }
1619
- var ir = {
1626
+ var ar = {
1620
1627
  en: {
1621
1628
  "result.translate": "Translate",
1622
1629
  "translation.working": "Translating…",
@@ -2153,47 +2160,47 @@ var ir = {
2153
2160
  "video.you": "Du",
2154
2161
  "nav.language": "Sprache"
2155
2162
  }
2156
- }, B = "en", ar = null, or = 0, sr = /* @__PURE__ */ new Set();
2157
- function cr() {
2158
- or += 1;
2159
- for (let e of sr) e();
2160
- }
2161
- function lr(e) {
2162
- e !== B && (B = e, cr());
2163
+ }, B = "en", or = null, sr = 0, cr = /* @__PURE__ */ new Set();
2164
+ function lr() {
2165
+ sr += 1;
2166
+ for (let e of cr) e();
2163
2167
  }
2164
- function ur() {
2165
- return ar?.lang ?? B;
2168
+ function ur(e) {
2169
+ e !== B && (B = e, lr());
2166
2170
  }
2167
- function dr(e) {
2168
- return e.note && rr(e.note, ur(), ar?.notes) || e.message;
2171
+ function dr() {
2172
+ return or?.lang ?? B;
2169
2173
  }
2170
- var fr = {};
2171
- function pr(e) {
2172
- fr = e ?? {};
2174
+ function fr(e) {
2175
+ return e.note && ir(e.note, dr(), or?.notes) || e.message;
2173
2176
  }
2177
+ var pr = {};
2174
2178
  function mr(e) {
2175
- return fr[e] ?? e;
2179
+ pr = e ?? {};
2180
+ }
2181
+ function hr(e) {
2182
+ return pr[e] ?? e;
2176
2183
  }
2177
2184
  function V(e, t) {
2178
- return ar?.runner[e], Qn(ir, e, B, t);
2185
+ return or?.runner[e], $n(ar, e, B, t);
2179
2186
  }
2180
2187
  //#endregion
2181
2188
  //#region ../runner/src/api.ts
2182
- var hr = class extends Error {
2189
+ var gr = class extends Error {
2183
2190
  status;
2184
2191
  body;
2185
2192
  constructor(e, t, n) {
2186
2193
  super(e), this.status = t, this.body = n;
2187
2194
  }
2188
2195
  };
2189
- function gr(e) {
2196
+ function _r(e) {
2190
2197
  try {
2191
2198
  return JSON.parse(e);
2192
2199
  } catch {
2193
2200
  return { error: e };
2194
2201
  }
2195
2202
  }
2196
- function _r(e, t = {}, n) {
2203
+ function vr(e, t = {}, n) {
2197
2204
  async function r(r, i, a) {
2198
2205
  let o = await fetch(e(i), {
2199
2206
  method: r,
@@ -2205,9 +2212,9 @@ function _r(e, t = {}, n) {
2205
2212
  },
2206
2213
  body: a === void 0 ? void 0 : a instanceof FormData ? a : JSON.stringify(a)
2207
2214
  }).catch(() => {
2208
- throw new hr(V("common.offline"), 0, null);
2209
- }), s = await o.text(), c = s ? gr(s) : null;
2210
- if (!o.ok) throw o.status >= 500 && n?.(`${r} ${i} answered ${o.status}: ${c?.error ?? ""}`), new hr(c?.error ?? c?.message ?? o.statusText, o.status, c);
2215
+ throw new gr(V("common.offline"), 0, null);
2216
+ }), s = await o.text(), c = s ? _r(s) : null;
2217
+ if (!o.ok) throw o.status >= 500 && n?.(`${r} ${i} answered ${o.status}: ${c?.error ?? ""}`), new gr(c?.error ?? c?.message ?? o.statusText, o.status, c);
2211
2218
  return c;
2212
2219
  }
2213
2220
  return {
@@ -2224,26 +2231,26 @@ function _r(e, t = {}, n) {
2224
2231
  }
2225
2232
  //#endregion
2226
2233
  //#region ../runner/src/env.ts
2227
- var vr = {
2234
+ var yr = {
2228
2235
  can: () => !1,
2229
2236
  call: (e) => Promise.reject(/* @__PURE__ */ Error(`the app cannot ${e}`)),
2230
2237
  tell: () => void 0,
2231
2238
  download: () => !1
2232
- }, yr = null;
2233
- function br(e) {
2234
- yr = e, U = _r(e.withBase, e.headers, e.onServerError), lr(e.lang);
2239
+ }, br = null;
2240
+ function xr(e) {
2241
+ br = e, U = vr(e.withBase, e.headers, e.onServerError), ur(e.lang);
2235
2242
  }
2236
2243
  function H() {
2237
- if (!yr) throw Error("configureRunner() first");
2238
- return yr;
2244
+ if (!br) throw Error("configureRunner() first");
2245
+ return br;
2239
2246
  }
2240
- var U = _r((e) => e), W = (e) => H().withBase(e), xr = (e) => H().asset(e), G = (e) => H().runBase(e), K = (e) => (yr?.app ?? vr).can(e), Sr = (e, t) => (yr?.app ?? vr).call(e, t), Cr = (e, t) => (yr?.app ?? vr).tell(e, t), wr = (e, t, n) => (yr?.app ?? vr).download(e, t, n), Tr = () => yr?.standalone === !0;
2247
+ var U = vr((e) => e), W = (e) => H().withBase(e), Sr = (e) => H().asset(e), G = (e) => H().runBase(e), K = (e) => (br?.app ?? yr).can(e), Cr = (e, t) => (br?.app ?? yr).call(e, t), wr = (e, t) => (br?.app ?? yr).tell(e, t), Tr = (e, t, n) => (br?.app ?? yr).download(e, t, n), Er = () => br?.standalone === !0;
2241
2248
  //#endregion
2242
2249
  //#region ../runner/src/ui.tsx
2243
2250
  function q(...e) {
2244
2251
  return e.filter(Boolean).join(" ");
2245
2252
  }
2246
- var Er = {
2253
+ var Dr = {
2247
2254
  primary: "bg-primary text-primary-foreground hover:brightness-[1.06] active:brightness-95 shadow-[0_1px_0_oklch(0%_0_0/0.08)]",
2248
2255
  secondary: "bg-card text-ink border border-border hover:bg-paper-2",
2249
2256
  ghost: "text-ink-2 hover:text-ink hover:bg-accent",
@@ -2254,9 +2261,9 @@ var Er = {
2254
2261
  ref: s,
2255
2262
  type: "button",
2256
2263
  disabled: a || n,
2257
- 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]", Er[e], r),
2264
+ 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]", Dr[e], r),
2258
2265
  ...o,
2259
- children: [n ? /* @__PURE__ */ F(Lr, { className: "size-4" }) : null, i]
2266
+ children: [n ? /* @__PURE__ */ F(Rr, { className: "size-4" }) : null, i]
2260
2267
  });
2261
2268
  });
2262
2269
  function Y({ label: e, className: t, children: n, ...r }) {
@@ -2269,25 +2276,25 @@ function Y({ label: e, className: t, children: n, ...r }) {
2269
2276
  children: n
2270
2277
  });
2271
2278
  }
2272
- var Dr = "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";
2273
- function Or(e) {
2279
+ var Or = "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";
2280
+ function kr(e) {
2274
2281
  return /(^|\s)w-/.test(e ?? "") ? null : "w-full";
2275
2282
  }
2276
2283
  var X = Me(function({ className: e, ...t }, n) {
2277
2284
  return /* @__PURE__ */ F("input", {
2278
2285
  ref: n,
2279
- className: q(Dr, Or(e), "h-11", e),
2286
+ className: q(Or, kr(e), "h-11", e),
2280
2287
  ...t
2281
2288
  });
2282
2289
  });
2283
- function kr(e) {
2290
+ function Ar(e) {
2284
2291
  return /* @__PURE__ */ F("input", {
2285
2292
  type: "color",
2286
2293
  className: "swatch size-11 shrink-0 cursor-pointer rounded-lg border border-input bg-card p-1",
2287
2294
  ...e
2288
2295
  });
2289
2296
  }
2290
- var Ar = Me(function({ className: e, minRows: t = 3, maxRows: n = 14, onChange: r, ...i }, a) {
2297
+ var jr = Me(function({ className: e, minRows: t = 3, maxRows: n = 14, onChange: r, ...i }, a) {
2291
2298
  let o = j(null), s = () => {
2292
2299
  let e = o.current;
2293
2300
  if (!e) return;
@@ -2300,20 +2307,20 @@ var Ar = Me(function({ className: e, minRows: t = 3, maxRows: n = 14, onChange:
2300
2307
  ref: (e) => {
2301
2308
  o.current = e, typeof a == "function" ? a(e) : a && (a.current = e);
2302
2309
  },
2303
- className: q(Dr, Or(e), "resize-none py-2.5 leading-[1.5]", e),
2310
+ className: q(Or, kr(e), "resize-none py-2.5 leading-[1.5]", e),
2304
2311
  onChange: (e) => {
2305
2312
  s(), r?.(e);
2306
2313
  },
2307
2314
  ...i
2308
2315
  });
2309
2316
  });
2310
- function jr({ value: e, onChange: t, options: n, className: r, placeholder: i }) {
2317
+ function Mr({ value: e, onChange: t, options: n, className: r, placeholder: i }) {
2311
2318
  return /* @__PURE__ */ I("div", {
2312
2319
  className: q("relative", r),
2313
2320
  children: [/* @__PURE__ */ I("select", {
2314
2321
  value: e,
2315
2322
  onChange: (e) => t(e.target.value),
2316
- className: q(Dr, "h-11 w-full appearance-none pr-9"),
2323
+ className: q(Or, "h-11 w-full appearance-none pr-9"),
2317
2324
  children: [i === void 0 ? null : /* @__PURE__ */ F("option", {
2318
2325
  value: "",
2319
2326
  children: i
@@ -2335,7 +2342,7 @@ function jr({ value: e, onChange: t, options: n, className: r, placeholder: i })
2335
2342
  })]
2336
2343
  });
2337
2344
  }
2338
- function Mr({ value: e, onChange: t, options: n, multi: r, disabled: i, label: a }) {
2345
+ function Nr({ value: e, onChange: t, options: n, multi: r, disabled: i, label: a }) {
2339
2346
  let o = new Set(Array.isArray(e) ? e : e ? [e] : []);
2340
2347
  return /* @__PURE__ */ F("div", {
2341
2348
  className: "flex flex-wrap gap-2",
@@ -2357,8 +2364,8 @@ function Mr({ value: e, onChange: t, options: n, multi: r, disabled: i, label: a
2357
2364
  })
2358
2365
  });
2359
2366
  }
2360
- var Nr = "cubic-bezier(0.3, 0.7, 0.2, 1)";
2361
- function Pr({ value: e, onChange: t, options: n, label: r }) {
2367
+ var Pr = "cubic-bezier(0.3, 0.7, 0.2, 1)";
2368
+ function Fr({ value: e, onChange: t, options: n, label: r }) {
2362
2369
  let i = j(/* @__PURE__ */ new Map()), [a, o] = M(null);
2363
2370
  return Fe(() => {
2364
2371
  let t = i.current.get(e);
@@ -2380,7 +2387,7 @@ function Pr({ value: e, onChange: t, options: n, label: r }) {
2380
2387
  style: {
2381
2388
  width: a.w,
2382
2389
  transform: `translateX(${a.x}px)`,
2383
- transition: `transform 300ms ${Nr}, width 300ms ${Nr}`
2390
+ transition: `transform 300ms ${Pr}, width 300ms ${Pr}`
2384
2391
  }
2385
2392
  }) : null, n.map((n) => {
2386
2393
  let r = n.id === e;
@@ -2398,7 +2405,7 @@ function Pr({ value: e, onChange: t, options: n, label: r }) {
2398
2405
  })]
2399
2406
  });
2400
2407
  }
2401
- function Fr({ checked: e, onChange: t, label: n, disabled: r }) {
2408
+ function Ir({ checked: e, onChange: t, label: n, disabled: r }) {
2402
2409
  return /* @__PURE__ */ F("button", {
2403
2410
  type: "button",
2404
2411
  role: "switch",
@@ -2410,7 +2417,7 @@ function Fr({ checked: e, onChange: t, label: n, disabled: r }) {
2410
2417
  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]") })
2411
2418
  });
2412
2419
  }
2413
- function Ir({ children: e, hint: t, required: n }) {
2420
+ function Lr({ children: e, hint: t, required: n }) {
2414
2421
  return /* @__PURE__ */ I("div", {
2415
2422
  className: "mb-2",
2416
2423
  children: [/* @__PURE__ */ I("div", {
@@ -2425,7 +2432,7 @@ function Ir({ children: e, hint: t, required: n }) {
2425
2432
  }) : null]
2426
2433
  });
2427
2434
  }
2428
- function Lr({ className: e }) {
2435
+ function Rr({ className: e }) {
2429
2436
  return /* @__PURE__ */ I("svg", {
2430
2437
  className: q("size-5 animate-spin", e),
2431
2438
  viewBox: "0 0 24 24",
@@ -2445,14 +2452,14 @@ function Lr({ className: e }) {
2445
2452
  })]
2446
2453
  });
2447
2454
  }
2448
- function Rr({ className: e, children: t, ...n }) {
2455
+ function zr({ className: e, children: t, ...n }) {
2449
2456
  return /* @__PURE__ */ F("div", {
2450
2457
  className: q("rounded-xl bg-card shadow-soft ring-1 ring-border-soft", e),
2451
2458
  ...n,
2452
2459
  children: t
2453
2460
  });
2454
2461
  }
2455
- function zr({ open: e, onClose: t, title: n, children: r, wide: i, bare: a, height: o = "auto" }) {
2462
+ function Br({ open: e, onClose: t, title: n, children: r, wide: i, bare: a, height: o = "auto" }) {
2456
2463
  let s = j(null);
2457
2464
  return A(() => {
2458
2465
  let t = s.current;
@@ -2505,7 +2512,7 @@ function zr({ open: e, onClose: t, title: n, children: r, wide: i, bare: a, heig
2505
2512
  }) : null
2506
2513
  });
2507
2514
  }
2508
- function Br({ text: e }) {
2515
+ function Vr({ text: e }) {
2509
2516
  return e.split(/(https?:\/\/[^\s)]+)/).map((e, t) => t % 2 ? /* @__PURE__ */ F("a", {
2510
2517
  href: e,
2511
2518
  target: "_blank",
@@ -2516,8 +2523,8 @@ function Br({ text: e }) {
2516
2523
  }
2517
2524
  //#endregion
2518
2525
  //#region ../runner/src/browser-live.tsx
2519
- var Vr = 250;
2520
- function Hr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a, onBroken: o }) {
2526
+ var Hr = 250;
2527
+ function Ur({ runId: e, driving: t, caption: n, action: r, hint: i, className: a, onBroken: o }) {
2521
2528
  let c = j(null), l = j(null), [d, f] = M(""), [p, m] = M(!1), [h, g] = M(null), _ = async (t) => {
2522
2529
  g(null);
2523
2530
  try {
@@ -2542,7 +2549,7 @@ function Hr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a
2542
2549
  type: "scroll",
2543
2550
  dy: t
2544
2551
  }).catch(() => void 0);
2545
- }, Vr);
2552
+ }, Hr);
2546
2553
  };
2547
2554
  return n.addEventListener("wheel", a, { passive: !1 }), () => {
2548
2555
  n.removeEventListener("wheel", a), i && clearTimeout(i);
@@ -2616,7 +2623,7 @@ function Hr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a
2616
2623
  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"),
2617
2624
  children: V("ask.hide")
2618
2625
  }),
2619
- /* @__PURE__ */ F(Ur, {
2626
+ /* @__PURE__ */ F(Wr, {
2620
2627
  label: "Enter",
2621
2628
  onClick: () => void _({
2622
2629
  type: "key",
@@ -2624,7 +2631,7 @@ function Hr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a
2624
2631
  }),
2625
2632
  children: /* @__PURE__ */ F(y, { className: "size-4" })
2626
2633
  }),
2627
- /* @__PURE__ */ F(Ur, {
2634
+ /* @__PURE__ */ F(Wr, {
2628
2635
  label: V("ask.up"),
2629
2636
  onClick: () => void _({
2630
2637
  type: "scroll",
@@ -2632,7 +2639,7 @@ function Hr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a
2632
2639
  }),
2633
2640
  children: /* @__PURE__ */ F(u, { className: "size-4" })
2634
2641
  }),
2635
- /* @__PURE__ */ F(Ur, {
2642
+ /* @__PURE__ */ F(Wr, {
2636
2643
  label: V("ask.down"),
2637
2644
  onClick: () => void _({
2638
2645
  type: "scroll",
@@ -2650,7 +2657,7 @@ function Hr({ runId: e, driving: t, caption: n, action: r, hint: i, className: a
2650
2657
  }) : null]
2651
2658
  });
2652
2659
  }
2653
- function Ur({ label: e, onClick: t, children: n }) {
2660
+ function Wr({ label: e, onClick: t, children: n }) {
2654
2661
  return /* @__PURE__ */ F("button", {
2655
2662
  type: "button",
2656
2663
  "aria-label": e,
@@ -2662,16 +2669,16 @@ function Ur({ label: e, onClick: t, children: n }) {
2662
2669
  }
2663
2670
  //#endregion
2664
2671
  //#region ../runner/src/AskPanel.tsx
2665
- function Wr({ runId: e, ask: t }) {
2666
- return t.kind === "confirm" ? /* @__PURE__ */ F(Gr, {
2672
+ function Gr({ runId: e, ask: t }) {
2673
+ return t.kind === "confirm" ? /* @__PURE__ */ F(Kr, {
2667
2674
  runId: e,
2668
2675
  ask: t
2669
- }) : /* @__PURE__ */ F(Kr, {
2676
+ }) : /* @__PURE__ */ F(qr, {
2670
2677
  runId: e,
2671
2678
  ask: t
2672
2679
  });
2673
2680
  }
2674
- function Gr({ runId: e, ask: t }) {
2681
+ function Kr({ runId: e, ask: t }) {
2675
2682
  let [n, r] = M(!1), [i, a] = M(!1), [o, s] = M(null), c = async (n) => {
2676
2683
  a(!0), s(null);
2677
2684
  try {
@@ -2703,9 +2710,9 @@ function Gr({ runId: e, ask: t }) {
2703
2710
  className: "max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-xl bg-paper-2 p-4 text-[0.8125rem] leading-relaxed ring-1 ring-border-soft",
2704
2711
  children: t.input
2705
2712
  }),
2706
- /* @__PURE__ */ I("div", {
2713
+ t.once ? null : /* @__PURE__ */ I("div", {
2707
2714
  className: "mt-5 flex items-center gap-4",
2708
- children: [/* @__PURE__ */ F(Fr, {
2715
+ children: [/* @__PURE__ */ F(Ir, {
2709
2716
  checked: n,
2710
2717
  onChange: r,
2711
2718
  label: V("ask.allowRest")
@@ -2737,7 +2744,7 @@ function Gr({ runId: e, ask: t }) {
2737
2744
  ]
2738
2745
  });
2739
2746
  }
2740
- function Kr({ runId: e, ask: t }) {
2747
+ function qr({ runId: e, ask: t }) {
2741
2748
  let [n, r] = M({}), [i, a] = M(!1), [o, s] = M(!1), [c, l] = M(null), u = async (n) => {
2742
2749
  s(!0), l(null);
2743
2750
  try {
@@ -2765,7 +2772,7 @@ function Kr({ runId: e, ask: t }) {
2765
2772
  })]
2766
2773
  })]
2767
2774
  }),
2768
- /* @__PURE__ */ F(Hr, {
2775
+ /* @__PURE__ */ F(Ur, {
2769
2776
  runId: e,
2770
2777
  driving: !0
2771
2778
  }),
@@ -2782,7 +2789,7 @@ function Kr({ runId: e, ask: t }) {
2782
2789
  remember: i
2783
2790
  });
2784
2791
  },
2785
- children: [t.fields.map((e, i) => /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(Ir, { children: e.label }), /* @__PURE__ */ F(X, {
2792
+ children: [t.fields.map((e, i) => /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(Lr, { children: e.label }), /* @__PURE__ */ F(X, {
2786
2793
  autoFocus: i === 0,
2787
2794
  type: e.secret ? "password" : "text",
2788
2795
  autoComplete: "off",
@@ -2802,7 +2809,7 @@ function Kr({ runId: e, ask: t }) {
2802
2809
  }) : null,
2803
2810
  /* @__PURE__ */ I("div", {
2804
2811
  className: "mt-5 flex items-center justify-between gap-4",
2805
- children: [/* @__PURE__ */ F(Fr, {
2812
+ children: [/* @__PURE__ */ F(Ir, {
2806
2813
  checked: i,
2807
2814
  onChange: a,
2808
2815
  label: V("ask.remember")
@@ -2864,8 +2871,8 @@ function Kr({ runId: e, ask: t }) {
2864
2871
  }
2865
2872
  //#endregion
2866
2873
  //#region ../runner/src/device.ts
2867
- var qr = typeof window < "u" && window.matchMedia?.("(pointer: coarse)").matches === !0, Jr = typeof navigator < "u" && !!navigator.mediaDevices?.getUserMedia;
2868
- function Yr() {
2874
+ var Jr = typeof window < "u" && window.matchMedia?.("(pointer: coarse)").matches === !0, Yr = typeof navigator < "u" && !!navigator.mediaDevices?.getUserMedia;
2875
+ function Xr() {
2869
2876
  A(() => {
2870
2877
  let e = window.visualViewport;
2871
2878
  if (!e) return;
@@ -2881,11 +2888,11 @@ function Yr() {
2881
2888
  };
2882
2889
  }, []);
2883
2890
  }
2884
- function Xr(e) {
2891
+ function Zr(e) {
2885
2892
  let [t, n] = M(!1);
2886
2893
  return A(() => {
2887
- if (e && K("keepAwake")) return Cr("keepAwake", !0), n(!0), () => {
2888
- Cr("keepAwake", !1), n(!1);
2894
+ if (e && K("keepAwake")) return wr("keepAwake", !0), n(!0), () => {
2895
+ wr("keepAwake", !1), n(!1);
2889
2896
  };
2890
2897
  if (!e || !("wakeLock" in navigator)) return;
2891
2898
  let t = null, r = !1, i = async () => {
@@ -2905,56 +2912,56 @@ function Xr(e) {
2905
2912
  };
2906
2913
  }, [e]), t;
2907
2914
  }
2908
- var Zr = "wz.notify", Qr = /* @__PURE__ */ new Set(), $r = null;
2909
- function ei() {
2915
+ var Qr = "wz.notify", $r = /* @__PURE__ */ new Set(), ei = null;
2916
+ function ti() {
2910
2917
  try {
2911
- return localStorage.getItem(Zr) === "1";
2918
+ return localStorage.getItem(Qr) === "1";
2912
2919
  } catch {
2913
2920
  return !1;
2914
2921
  }
2915
2922
  }
2916
- function ti(e) {
2923
+ function ni(e) {
2917
2924
  try {
2918
- e ? localStorage.setItem(Zr, "1") : localStorage.removeItem(Zr);
2925
+ e ? localStorage.setItem(Qr, "1") : localStorage.removeItem(Qr);
2919
2926
  } catch {}
2920
- for (let e of Qr) e();
2921
- }
2922
- var ni = typeof window < "u" && "Notification" in window, ri = null;
2923
- function ii() {
2924
- return ei() ? K("notify") ? ri === !1 ? "quiet" : "on" : ni && Notification.permission === "granted" ? "on" : "quiet" : "off";
2927
+ for (let e of $r) e();
2925
2928
  }
2929
+ var ri = typeof window < "u" && "Notification" in window, ii = null;
2926
2930
  function ai() {
2927
- return Le((e) => (Qr.add(e), () => Qr.delete(e)), ii, () => "off");
2931
+ return ti() ? K("notify") ? ii === !1 ? "quiet" : "on" : ri && Notification.permission === "granted" ? "on" : "quiet" : "off";
2928
2932
  }
2929
2933
  function oi() {
2930
- return K("notify") ? ri === !1 : ni && Notification.permission === "denied";
2934
+ return Le((e) => ($r.add(e), () => $r.delete(e)), ai, () => "off");
2935
+ }
2936
+ function si() {
2937
+ return K("notify") ? ii === !1 : ri && Notification.permission === "denied";
2931
2938
  }
2932
- async function si() {
2933
- if (ti(!0), K("notify")) {
2934
- ri = !K("notifyPermission") || await Sr("notifyPermission").catch(() => !1);
2935
- for (let e of Qr) e();
2936
- return ii();
2939
+ async function ci() {
2940
+ if (ni(!0), K("notify")) {
2941
+ ii = !K("notifyPermission") || await Cr("notifyPermission").catch(() => !1);
2942
+ for (let e of $r) e();
2943
+ return ai();
2937
2944
  }
2938
2945
  try {
2939
- $r ??= new AudioContext(), $r.resume();
2946
+ ei ??= new AudioContext(), ei.resume();
2940
2947
  } catch {
2941
- $r = null;
2948
+ ei = null;
2942
2949
  }
2943
- if (ni && Notification.permission === "default") try {
2950
+ if (ri && Notification.permission === "default") try {
2944
2951
  await Notification.requestPermission();
2945
2952
  } catch {}
2946
- if (ni && Notification.permission === "granted") {
2953
+ if (ri && Notification.permission === "granted") {
2947
2954
  let e = H().serviceWorker;
2948
2955
  e && await navigator.serviceWorker?.register(e).catch(() => void 0);
2949
2956
  }
2950
- for (let e of Qr) e();
2951
- return ii();
2952
- }
2953
- function ci() {
2954
- ti(!1);
2957
+ for (let e of $r) e();
2958
+ return ai();
2955
2959
  }
2956
2960
  function li() {
2957
- let e = $r;
2961
+ ni(!1);
2962
+ }
2963
+ function ui() {
2964
+ let e = ei;
2958
2965
  if (e?.state !== "running") return;
2959
2966
  let t = e.currentTime;
2960
2967
  for (let [n, r] of [660, 880].entries()) {
@@ -2962,26 +2969,26 @@ function li() {
2962
2969
  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);
2963
2970
  }
2964
2971
  }
2965
- async function ui(e) {
2966
- if (!ei()) return;
2972
+ async function di(e) {
2973
+ if (!ti()) return;
2967
2974
  if (K("notify")) {
2968
- Cr("notify", e);
2975
+ wr("notify", e);
2969
2976
  return;
2970
2977
  }
2971
2978
  if (document.visibilityState === "visible") {
2972
- li(), navigator.vibrate?.([
2979
+ ui(), navigator.vibrate?.([
2973
2980
  120,
2974
2981
  60,
2975
2982
  120
2976
2983
  ]);
2977
2984
  return;
2978
2985
  }
2979
- if (!ni || Notification.permission !== "granted") return;
2986
+ if (!ri || Notification.permission !== "granted") return;
2980
2987
  let t = {
2981
2988
  body: e.body,
2982
2989
  tag: e.tag,
2983
- icon: xr("icons/icon-192.png"),
2984
- badge: xr("icons/icon-192.png"),
2990
+ icon: Sr("icons/icon-192.png"),
2991
+ badge: Sr("icons/icon-192.png"),
2985
2992
  data: { url: location.href }
2986
2993
  };
2987
2994
  try {
@@ -2995,7 +3002,7 @@ async function ui(e) {
2995
3002
  new Notification(e.title, t);
2996
3003
  } catch {}
2997
3004
  }
2998
- function di() {
3005
+ function fi() {
2999
3006
  if (typeof navigator > "u" || !navigator.canShare) return !1;
3000
3007
  try {
3001
3008
  return navigator.canShare({ files: [new File(["x"], "x.pdf", { type: "application/pdf" })] });
@@ -3005,7 +3012,7 @@ function di() {
3005
3012
  }
3006
3013
  //#endregion
3007
3014
  //#region ../runner/src/camera.tsx
3008
- async function fi(e, t = 2400) {
3015
+ async function pi(e, t = 2400) {
3009
3016
  if (!/^image\/(jpeg|png|webp)$/.test(e.type) || e.size < 12e5) return e;
3010
3017
  try {
3011
3018
  let n = await createImageBitmap(e), r = Math.min(1, t / Math.max(n.width, n.height)), i = document.createElement("canvas");
@@ -3016,17 +3023,17 @@ async function fi(e, t = 2400) {
3016
3023
  return e;
3017
3024
  }
3018
3025
  }
3019
- function pi() {
3026
+ function mi() {
3020
3027
  return (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace(/[:T]/g, "-");
3021
3028
  }
3022
- function mi(e) {
3029
+ function hi(e) {
3023
3030
  let t = e?.name;
3024
3031
  return t === "NotFoundError" || t === "OverconstrainedError" ? "missing" : t === "NotReadableError" || t === "AbortError" ? "busy" : "denied";
3025
3032
  }
3026
- function hi(e) {
3033
+ function gi(e) {
3027
3034
  return !!e?.getCapabilities?.()?.torch;
3028
3035
  }
3029
- function gi(e, t, n = !1) {
3036
+ function _i(e, t, n = !1) {
3030
3037
  let r = j(null), [i, a] = M(null), [o, s] = M(null), [c, l] = M(1), [u, d] = M(!1), [f, p] = M(!1);
3031
3038
  return A(() => {
3032
3039
  if (!e) return;
@@ -3053,11 +3060,11 @@ function gi(e, t, n = !1) {
3053
3060
  return;
3054
3061
  }
3055
3062
  a(r);
3056
- let e = r.getVideoTracks()[0], t = () => !i && d(hi(e));
3063
+ let e = r.getVideoTracks()[0], t = () => !i && d(gi(e));
3057
3064
  t(), setTimeout(t, 600);
3058
3065
  let s = await navigator.mediaDevices.enumerateDevices().catch(() => []);
3059
3066
  i || l(s.filter((e) => e.kind === "videoinput").length);
3060
- })().catch((e) => !i && s(mi(e))), () => {
3067
+ })().catch((e) => !i && s(hi(e))), () => {
3061
3068
  i = !0;
3062
3069
  for (let e of r?.getTracks() ?? []) e.stop();
3063
3070
  };
@@ -3085,7 +3092,7 @@ function gi(e, t, n = !1) {
3085
3092
  mirrored: i?.getVideoTracks()[0]?.getSettings().facingMode === "user"
3086
3093
  };
3087
3094
  }
3088
- function _i({ open: e, onClose: t, label: n, children: r }) {
3095
+ function vi({ open: e, onClose: t, label: n, children: r }) {
3089
3096
  let i = j(null);
3090
3097
  return A(() => {
3091
3098
  let t = i.current;
@@ -3101,7 +3108,7 @@ function _i({ open: e, onClose: t, label: n, children: r }) {
3101
3108
  }) : null
3102
3109
  });
3103
3110
  }
3104
- function vi({ label: e, onClick: t, active: n, children: r }) {
3111
+ function yi({ label: e, onClick: t, active: n, children: r }) {
3105
3112
  return /* @__PURE__ */ F("button", {
3106
3113
  type: "button",
3107
3114
  "aria-label": e,
@@ -3112,13 +3119,13 @@ function vi({ label: e, onClick: t, active: n, children: r }) {
3112
3119
  children: r
3113
3120
  });
3114
3121
  }
3115
- function yi({ title: e, onClose: t, camera: n, onFlip: r }) {
3122
+ function bi({ title: e, onClose: t, camera: n, onFlip: r }) {
3116
3123
  return /* @__PURE__ */ F("div", {
3117
3124
  className: "safe-top",
3118
3125
  children: /* @__PURE__ */ I("div", {
3119
3126
  className: "flex items-center gap-2 px-3 py-2",
3120
3127
  children: [
3121
- /* @__PURE__ */ F(vi, {
3128
+ /* @__PURE__ */ F(yi, {
3122
3129
  label: V("common.close"),
3123
3130
  onClick: t,
3124
3131
  children: /* @__PURE__ */ F(je, { className: "size-5" })
@@ -3127,13 +3134,13 @@ function yi({ title: e, onClose: t, camera: n, onFlip: r }) {
3127
3134
  className: "min-w-0 flex-1 truncate text-center font-medium text-[0.9375rem]",
3128
3135
  children: e
3129
3136
  }),
3130
- n.torchable ? /* @__PURE__ */ F(vi, {
3137
+ n.torchable ? /* @__PURE__ */ F(yi, {
3131
3138
  label: V("camera.torch"),
3132
3139
  active: n.torch,
3133
3140
  onClick: () => void n.setTorch(!n.torch),
3134
3141
  children: n.torch ? /* @__PURE__ */ F(te, { className: "size-5" }) : /* @__PURE__ */ F(ne, { className: "size-5" })
3135
3142
  }) : null,
3136
- n.stream && (n.cameras > 1 || qr) ? /* @__PURE__ */ F(vi, {
3143
+ n.stream && (n.cameras > 1 || Jr) ? /* @__PURE__ */ F(yi, {
3137
3144
  label: V("camera.flip"),
3138
3145
  onClick: r,
3139
3146
  children: /* @__PURE__ */ F(Ee, { className: "size-5" })
@@ -3142,7 +3149,7 @@ function yi({ title: e, onClose: t, camera: n, onFlip: r }) {
3142
3149
  })
3143
3150
  });
3144
3151
  }
3145
- function bi({ camera: e, asking: t, children: n, actions: r }) {
3152
+ function xi({ camera: e, asking: t, children: n, actions: r }) {
3146
3153
  return /* @__PURE__ */ I("div", {
3147
3154
  className: "relative min-h-0 flex-1 overflow-hidden",
3148
3155
  children: [/* @__PURE__ */ F("video", {
@@ -3159,15 +3166,15 @@ function bi({ camera: e, asking: t, children: n, actions: r }) {
3159
3166
  }), r]
3160
3167
  }) : e.stream ? n : /* @__PURE__ */ I("div", {
3161
3168
  className: "absolute inset-0 flex flex-col items-center justify-center gap-4 px-8 text-center text-white/75",
3162
- children: [/* @__PURE__ */ F(Lr, {}), /* @__PURE__ */ F("p", {
3169
+ children: [/* @__PURE__ */ F(Rr, {}), /* @__PURE__ */ F("p", {
3163
3170
  className: "max-w-xs text-[0.875rem] leading-relaxed",
3164
3171
  children: t
3165
3172
  })]
3166
3173
  })]
3167
3174
  });
3168
3175
  }
3169
- var xi = 30;
3170
- function Si() {
3176
+ var Si = 30;
3177
+ function Ci() {
3171
3178
  if (typeof MediaRecorder < "u") return [
3172
3179
  "video/mp4;codecs=avc1.42E01E,mp4a.40.2",
3173
3180
  "video/mp4",
@@ -3176,9 +3183,9 @@ function Si() {
3176
3183
  "video/webm"
3177
3184
  ].find((e) => MediaRecorder.isTypeSupported(e));
3178
3185
  }
3179
- var Ci = !!Si();
3180
- function wi({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative: a }) {
3181
- let [o, s] = M("environment"), [c, l] = M("photo"), [u, d] = M(0), [f, p] = M(!1), [g, _] = M(null), v = j(null), y = gi(e, o, c === "video");
3186
+ var wi = !!Ci();
3187
+ function Ti({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative: a }) {
3188
+ let [o, s] = M("environment"), [c, l] = M("photo"), [u, d] = M(0), [f, p] = M(!1), [g, _] = M(null), v = j(null), y = _i(e, o, c === "video");
3182
3189
  A(() => {
3183
3190
  e && (d(0), l("photo"), _(null));
3184
3191
  }, [e]);
@@ -3195,11 +3202,11 @@ function wi({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
3195
3202
  let t = document.createElement("canvas");
3196
3203
  t.width = e.videoWidth, t.height = e.videoHeight, t.getContext("2d")?.drawImage(e, 0, 0);
3197
3204
  let n = await new Promise((e) => t.toBlob(e, "image/jpeg", .9));
3198
- n && await b(new File([n], `foto-${pi()}.jpg`, { type: "image/jpeg" }));
3205
+ n && await b(new File([n], `foto-${mi()}.jpg`, { type: "image/jpeg" }));
3199
3206
  }, S = () => {
3200
3207
  v.current?.state === "recording" && v.current.stop();
3201
3208
  }, C = () => {
3202
- let e = Si();
3209
+ let e = Ci();
3203
3210
  if (!y.stream || !e) return;
3204
3211
  let t = [], n = new MediaRecorder(y.stream, {
3205
3212
  mimeType: e,
@@ -3211,13 +3218,13 @@ function wi({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
3211
3218
  let n = e.split(";")[0];
3212
3219
  if (t.length) {
3213
3220
  let e = n === "video/mp4" ? "mp4" : "webm";
3214
- b(new File(t, `video-${pi()}.${e}`, { type: n }));
3221
+ b(new File(t, `video-${mi()}.${e}`, { type: n }));
3215
3222
  }
3216
3223
  }, v.current = n, n.start(1e3), _(0);
3217
3224
  };
3218
3225
  A(() => {
3219
3226
  if (g === null) return;
3220
- if (g >= xi) {
3227
+ if (g >= Si) {
3221
3228
  v.current?.state === "recording" && v.current.stop();
3222
3229
  return;
3223
3230
  }
@@ -3227,32 +3234,32 @@ function wi({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
3227
3234
  !e && v.current && (v.current.onstop = null, v.current.stop(), v.current = null);
3228
3235
  }, [e]);
3229
3236
  let w = (e) => `0:${String(e).padStart(2, "0")}`;
3230
- return /* @__PURE__ */ I(_i, {
3237
+ return /* @__PURE__ */ I(vi, {
3231
3238
  open: e,
3232
3239
  onClose: r,
3233
3240
  label: V("camera.title"),
3234
3241
  children: [
3235
- /* @__PURE__ */ F(yi, {
3236
- title: g === null ? u ? V("camera.taken", { n: u }) : V("camera.title") : `${w(g)} / ${w(xi)}`,
3242
+ /* @__PURE__ */ F(bi, {
3243
+ title: g === null ? u ? V("camera.taken", { n: u }) : V("camera.title") : `${w(g)} / ${w(Si)}`,
3237
3244
  onClose: r,
3238
3245
  camera: y,
3239
3246
  onFlip: () => s((e) => e === "environment" ? "user" : "environment")
3240
3247
  }),
3241
- /* @__PURE__ */ F(bi, {
3248
+ /* @__PURE__ */ F(xi, {
3242
3249
  camera: y,
3243
3250
  asking: V("camera.asking"),
3244
3251
  actions: /* @__PURE__ */ I("div", {
3245
3252
  className: "flex flex-col gap-2",
3246
- children: [a ? /* @__PURE__ */ I(Ti, {
3253
+ children: [a ? /* @__PURE__ */ I(Ei, {
3247
3254
  onClick: () => {
3248
3255
  r(), a();
3249
3256
  },
3250
3257
  children: [
3251
3258
  /* @__PURE__ */ F(m, { className: "size-4" }),
3252
3259
  " ",
3253
- V(qr ? "camera.native" : "camera.pick")
3260
+ V(Jr ? "camera.native" : "camera.pick")
3254
3261
  ]
3255
- }) : null, /* @__PURE__ */ F(Ti, {
3262
+ }) : null, /* @__PURE__ */ F(Ei, {
3256
3263
  quiet: !0,
3257
3264
  onClick: r,
3258
3265
  children: V("common.close")
@@ -3261,7 +3268,7 @@ function wi({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
3261
3268
  }),
3262
3269
  /* @__PURE__ */ I("div", {
3263
3270
  className: q("safe-bottom px-4 pt-3", y.error && "invisible"),
3264
- children: [n && Ci && g === null ? /* @__PURE__ */ F("div", {
3271
+ children: [n && wi && g === null ? /* @__PURE__ */ F("div", {
3265
3272
  className: "mb-3 flex justify-center gap-1 text-[0.8125rem]",
3266
3273
  children: ["photo", "video"].map((e) => /* @__PURE__ */ F("button", {
3267
3274
  type: "button",
@@ -3275,7 +3282,7 @@ function wi({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
3275
3282
  children: [
3276
3283
  /* @__PURE__ */ F("span", {
3277
3284
  className: "text-[0.8125rem] text-white/70 leading-snug",
3278
- children: g === null ? c === "video" ? V("camera.clipHint", { s: xi }) : V(t ? "camera.hintMany" : "camera.hint") : V("camera.recording")
3285
+ children: g === null ? c === "video" ? V("camera.clipHint", { s: Si }) : V(t ? "camera.hintMany" : "camera.hint") : V("camera.recording")
3279
3286
  }),
3280
3287
  /* @__PURE__ */ F("button", {
3281
3288
  type: "button",
@@ -3283,14 +3290,14 @@ function wi({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
3283
3290
  disabled: !y.stream || f,
3284
3291
  onClick: () => c === "photo" ? void x() : g === null ? C() : S(),
3285
3292
  className: "flex size-[72px] items-center justify-center rounded-full border-4 border-white transition active:scale-95 disabled:opacity-40",
3286
- children: f ? /* @__PURE__ */ F(Lr, { className: "text-white" }) : c === "photo" ? /* @__PURE__ */ F("span", { className: "size-[54px] rounded-full bg-white" }) : g === null ? /* @__PURE__ */ F("span", {
3293
+ children: f ? /* @__PURE__ */ F(Rr, { className: "text-white" }) : c === "photo" ? /* @__PURE__ */ F("span", { className: "size-[54px] rounded-full bg-white" }) : g === null ? /* @__PURE__ */ F("span", {
3287
3294
  className: "flex size-[54px] items-center justify-center rounded-full bg-[#e5484d]",
3288
3295
  children: /* @__PURE__ */ F(Ae, { className: "size-6 text-white" })
3289
3296
  }) : /* @__PURE__ */ F("span", { className: "size-7 rounded-md bg-[#e5484d]" })
3290
3297
  }),
3291
3298
  /* @__PURE__ */ F("div", {
3292
3299
  className: "flex justify-end",
3293
- children: t && u && g === null ? /* @__PURE__ */ I(Ti, {
3300
+ children: t && u && g === null ? /* @__PURE__ */ I(Ei, {
3294
3301
  onClick: r,
3295
3302
  children: [
3296
3303
  /* @__PURE__ */ F(h, { className: "size-4" }),
@@ -3305,7 +3312,7 @@ function wi({ open: e, multiple: t, video: n, onClose: r, onCapture: i, onNative
3305
3312
  ]
3306
3313
  });
3307
3314
  }
3308
- function Ti({ onClick: e, quiet: t, children: n }) {
3315
+ function Ei({ onClick: e, quiet: t, children: n }) {
3309
3316
  return /* @__PURE__ */ F("button", {
3310
3317
  type: "button",
3311
3318
  onClick: e,
@@ -3315,54 +3322,54 @@ function Ti({ onClick: e, quiet: t, children: n }) {
3315
3322
  }
3316
3323
  //#endregion
3317
3324
  //#region ../runner/src/data.tsx
3318
- var Ei = "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", Di = "font-medium text-[0.6875rem] text-ink-3 uppercase tracking-[0.08em]", Oi = (e) => !!e && typeof e == "object" && !Array.isArray(e);
3319
- function ki(e, t, n) {
3325
+ var Di = "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", Oi = "font-medium text-[0.6875rem] text-ink-3 uppercase tracking-[0.08em]", ki = (e) => !!e && typeof e == "object" && !Array.isArray(e);
3326
+ function Ai(e, t, n) {
3320
3327
  if (!t.length) return n;
3321
3328
  let [r, ...i] = t;
3322
3329
  if (Array.isArray(e)) {
3323
3330
  let t = [...e];
3324
- return t[r] = ki(t[r], i, n), t;
3331
+ return t[r] = Ai(t[r], i, n), t;
3325
3332
  }
3326
3333
  let a = e ?? {};
3327
3334
  return {
3328
3335
  ...a,
3329
- [r]: ki(a[r], i, n)
3336
+ [r]: Ai(a[r], i, n)
3330
3337
  };
3331
3338
  }
3332
- function Ai(e, t) {
3333
- let n = e?.length ? e : [...new Set(t.filter(Oi).flatMap((e) => Object.keys(e)))];
3339
+ function ji(e, t) {
3340
+ let n = e?.length ? e : [...new Set(t.filter(ki).flatMap((e) => Object.keys(e)))];
3334
3341
  return {
3335
3342
  kind: "object",
3336
3343
  fields: Object.fromEntries(n.map((e) => [e, { kind: "text" }]))
3337
3344
  };
3338
3345
  }
3339
- var ji = (e) => e.kind !== "object" && e.kind !== "table" && (e.kind !== "list" || e.of.kind !== "object") && !(e.kind === "text" && e.long), Mi = (e) => Object.values(e.fields).every(ji), Ni = (e) => Object.values(e.fields).every((e) => e.kind !== "table" && (e.kind !== "list" || e.of.kind !== "object"));
3340
- function Pi(e, t) {
3346
+ var Mi = (e) => e.kind !== "object" && e.kind !== "table" && (e.kind !== "list" || e.of.kind !== "object") && !(e.kind === "text" && e.long), Ni = (e) => Object.values(e.fields).every(Mi), Pi = (e) => Object.values(e.fields).every((e) => e.kind !== "table" && (e.kind !== "list" || e.of.kind !== "object"));
3347
+ function Fi(e, t) {
3341
3348
  let n = jt(e);
3342
3349
  return n ? String(t[n] ?? "") : "";
3343
3350
  }
3344
- function Fi({ text: e }) {
3351
+ function Ii({ text: e }) {
3345
3352
  return /* @__PURE__ */ F("span", {
3346
3353
  className: "whitespace-pre-wrap",
3347
3354
  children: e
3348
3355
  });
3349
3356
  }
3350
- function Ii({ shape: e, value: t, path: n, ctx: r, cell: i }) {
3357
+ function Li({ shape: e, value: t, path: n, ctx: r, cell: i }) {
3351
3358
  switch (e.kind) {
3352
3359
  case "text": return r.edit ? e.long ? /* @__PURE__ */ F("textarea", {
3353
- className: q(Ei, "field-sizing-content max-h-60 resize-none"),
3360
+ className: q(Di, "field-sizing-content max-h-60 resize-none"),
3354
3361
  value: String(t ?? ""),
3355
3362
  onChange: (e) => r.set(n, e.target.value)
3356
3363
  }) : /* @__PURE__ */ F("input", {
3357
- className: Ei,
3364
+ className: Di,
3358
3365
  value: String(t ?? ""),
3359
3366
  onChange: (e) => r.set(n, e.target.value)
3360
- }) : /* @__PURE__ */ F(Fi, { text: t == null ? "" : String(t) });
3367
+ }) : /* @__PURE__ */ F(Ii, { text: t == null ? "" : String(t) });
3361
3368
  case "number": return r.edit ? /* @__PURE__ */ I("span", {
3362
3369
  className: "flex items-center gap-1",
3363
3370
  children: [/* @__PURE__ */ F("input", {
3364
3371
  type: "number",
3365
- className: q(Ei, "text-right tabular-nums", i && "w-20"),
3372
+ className: q(Di, "text-right tabular-nums", i && "w-20"),
3366
3373
  value: t == null ? "" : Number(t),
3367
3374
  onChange: (e) => r.set(n, e.target.value === "" ? null : Number(e.target.value))
3368
3375
  }), e.unit ? /* @__PURE__ */ F("span", {
@@ -3390,7 +3397,7 @@ function Ii({ shape: e, value: t, path: n, ctx: r, cell: i }) {
3390
3397
  }
3391
3398
  case "choice":
3392
3399
  case "score": return r.edit ? /* @__PURE__ */ F("select", {
3393
- className: Ei,
3400
+ className: Di,
3394
3401
  value: String(t ?? ""),
3395
3402
  onChange: (e) => r.set(n, e.target.value),
3396
3403
  children: [.../* @__PURE__ */ new Set([String(t ?? ""), ...e.options])].map((e) => /* @__PURE__ */ F("option", {
@@ -3402,9 +3409,9 @@ function Ii({ shape: e, value: t, path: n, ctx: r, cell: i }) {
3402
3409
  let i = r.shape.fields[e.to], a = i?.kind === "list" && i.of.kind === "object" ? i.of : {
3403
3410
  kind: "object",
3404
3411
  fields: {}
3405
- }, o = (Array.isArray(r.root[e.to]) ? r.root[e.to] : []).filter(Oi), s = o.find((e) => e.id === t);
3412
+ }, o = (Array.isArray(r.root[e.to]) ? r.root[e.to] : []).filter(ki), s = o.find((e) => e.id === t);
3406
3413
  return r.edit ? /* @__PURE__ */ I("select", {
3407
- className: Ei,
3414
+ className: Di,
3408
3415
  value: String(t ?? ""),
3409
3416
  onChange: (e) => r.set(n, e.target.value),
3410
3417
  children: [s ? null : /* @__PURE__ */ F("option", {
@@ -3412,13 +3419,13 @@ function Ii({ shape: e, value: t, path: n, ctx: r, cell: i }) {
3412
3419
  children: String(t ?? "")
3413
3420
  }), o.map((e) => /* @__PURE__ */ F("option", {
3414
3421
  value: String(e.id),
3415
- children: Pi(a, e) || String(e.id)
3422
+ children: Fi(a, e) || String(e.id)
3416
3423
  }, String(e.id)))]
3417
3424
  }) : s ? /* @__PURE__ */ I("button", {
3418
3425
  type: "button",
3419
3426
  onClick: () => r.open(String(s.id)),
3420
3427
  className: "inline-flex items-center gap-1 text-left text-ember-strong hover:underline",
3421
- children: [/* @__PURE__ */ F(ie, { className: "size-3.5 shrink-0" }), Pi(a, s) || String(s.id)]
3428
+ children: [/* @__PURE__ */ F(ie, { className: "size-3.5 shrink-0" }), Fi(a, s) || String(s.id)]
3422
3429
  }) : /* @__PURE__ */ F("span", {
3423
3430
  className: "text-rose",
3424
3431
  children: V("data.missing", { id: String(t ?? "") })
@@ -3426,8 +3433,8 @@ function Ii({ shape: e, value: t, path: n, ctx: r, cell: i }) {
3426
3433
  }
3427
3434
  case "table": {
3428
3435
  let i = Array.isArray(t) ? t : [];
3429
- return /* @__PURE__ */ F(Bi, {
3430
- shape: Ai(e.columns, i),
3436
+ return /* @__PURE__ */ F(Vi, {
3437
+ shape: ji(e.columns, i),
3431
3438
  value: i,
3432
3439
  path: n,
3433
3440
  ctx: r
@@ -3435,7 +3442,7 @@ function Ii({ shape: e, value: t, path: n, ctx: r, cell: i }) {
3435
3442
  }
3436
3443
  case "list":
3437
3444
  if (e.of.kind === "object") {
3438
- let i = e.of, a = Mi(i) ? Bi : Ni(i) ? Vi : Hi;
3445
+ let i = e.of, a = Ni(i) ? Vi : Pi(i) ? Hi : Ui;
3439
3446
  return /* @__PURE__ */ F(a, {
3440
3447
  shape: i,
3441
3448
  value: t,
@@ -3443,12 +3450,12 @@ function Ii({ shape: e, value: t, path: n, ctx: r, cell: i }) {
3443
3450
  ctx: r
3444
3451
  });
3445
3452
  }
3446
- return /* @__PURE__ */ F(Li, {
3453
+ return /* @__PURE__ */ F(Ri, {
3447
3454
  value: t,
3448
3455
  path: n,
3449
3456
  ctx: r
3450
3457
  });
3451
- case "object": return /* @__PURE__ */ F(Ui, {
3458
+ case "object": return /* @__PURE__ */ F(Wi, {
3452
3459
  shape: e,
3453
3460
  value: t,
3454
3461
  path: n,
@@ -3456,7 +3463,7 @@ function Ii({ shape: e, value: t, path: n, ctx: r, cell: i }) {
3456
3463
  });
3457
3464
  }
3458
3465
  }
3459
- function Li({ value: e, path: t, ctx: n }) {
3466
+ function Ri({ value: e, path: t, ctx: n }) {
3460
3467
  let r = Array.isArray(e) ? e.map(String) : [], [i, a] = M("");
3461
3468
  return /* @__PURE__ */ I("span", {
3462
3469
  className: "flex flex-wrap items-center gap-1",
@@ -3480,9 +3487,9 @@ function Li({ value: e, path: t, ctx: n }) {
3480
3487
  }) : null]
3481
3488
  });
3482
3489
  }
3483
- var Ri = (e) => (Array.isArray(e) ? e : []).filter(Oi), zi = (e) => e.fields.id ? { id: `n${Date.now().toString(36)}` } : {};
3484
- function Bi({ shape: e, value: t, path: n, ctx: r }) {
3485
- let i = Ri(t), a = Object.entries(e.fields);
3490
+ var zi = (e) => (Array.isArray(e) ? e : []).filter(ki), Bi = (e) => e.fields.id ? { id: `n${Date.now().toString(36)}` } : {};
3491
+ function Vi({ shape: e, value: t, path: n, ctx: r }) {
3492
+ let i = zi(t), a = Object.entries(e.fields);
3486
3493
  return /* @__PURE__ */ I("div", {
3487
3494
  className: "overflow-x-auto rounded-lg ring-1 ring-border-soft",
3488
3495
  children: [/* @__PURE__ */ I("table", {
@@ -3497,7 +3504,7 @@ function Bi({ shape: e, value: t, path: n, ctx: r }) {
3497
3504
  className: "group border-border-soft border-t",
3498
3505
  children: [a.map(([i, a]) => /* @__PURE__ */ F("td", {
3499
3506
  className: q("align-top", r.edit ? "p-0.5" : "px-3 py-2"),
3500
- children: /* @__PURE__ */ F(Ii, {
3507
+ children: /* @__PURE__ */ F(Li, {
3501
3508
  shape: a,
3502
3509
  value: e[i],
3503
3510
  path: [
@@ -3510,17 +3517,17 @@ function Bi({ shape: e, value: t, path: n, ctx: r }) {
3510
3517
  })
3511
3518
  }, i)), r.edit ? /* @__PURE__ */ F("td", {
3512
3519
  className: "p-0.5 align-middle",
3513
- children: /* @__PURE__ */ F(Gi, { onClick: () => r.set(n, i.filter((e, n) => n !== t)) })
3520
+ children: /* @__PURE__ */ F(Ki, { onClick: () => r.set(n, i.filter((e, n) => n !== t)) })
3514
3521
  }) : null]
3515
3522
  }, t)) })]
3516
- }), r.edit ? /* @__PURE__ */ F(Ki, {
3523
+ }), r.edit ? /* @__PURE__ */ F(qi, {
3517
3524
  what: e.label,
3518
- onClick: () => r.set(n, [...i, zi(e)])
3525
+ onClick: () => r.set(n, [...i, Bi(e)])
3519
3526
  }) : null]
3520
3527
  });
3521
3528
  }
3522
- function Vi({ shape: e, value: t, path: n, ctx: r }) {
3523
- let i = Ri(t), a = Object.entries(e.fields), o = a.filter(([, e]) => e.kind === "text" && e.long), s = a.filter(([, e]) => !(e.kind === "text" && e.long));
3529
+ function Hi({ shape: e, value: t, path: n, ctx: r }) {
3530
+ let i = zi(t), a = Object.entries(e.fields), o = a.filter(([, e]) => e.kind === "text" && e.long), s = a.filter(([, e]) => !(e.kind === "text" && e.long));
3524
3531
  return /* @__PURE__ */ I("div", {
3525
3532
  className: "overflow-hidden rounded-lg ring-1 ring-border-soft",
3526
3533
  children: [/* @__PURE__ */ F("ol", { children: i.map((e, t) => /* @__PURE__ */ I("li", {
@@ -3532,7 +3539,7 @@ function Vi({ shape: e, value: t, path: n, ctx: r }) {
3532
3539
  }),
3533
3540
  /* @__PURE__ */ F("div", {
3534
3541
  className: q("flex min-w-0 flex-col", !r.edit && "pt-1"),
3535
- children: o.map(([i, a]) => /* @__PURE__ */ F(Ii, {
3542
+ children: o.map(([i, a]) => /* @__PURE__ */ F(Li, {
3536
3543
  shape: a,
3537
3544
  value: e[i],
3538
3545
  path: [
@@ -3545,7 +3552,7 @@ function Vi({ shape: e, value: t, path: n, ctx: r }) {
3545
3552
  }),
3546
3553
  /* @__PURE__ */ I("div", {
3547
3554
  className: q("flex items-center gap-2 text-[0.8125rem] text-ink-3", !r.edit && "pt-1"),
3548
- children: [s.map(([i, a]) => /* @__PURE__ */ F(Ii, {
3555
+ children: [s.map(([i, a]) => /* @__PURE__ */ F(Li, {
3549
3556
  shape: a,
3550
3557
  value: e[i],
3551
3558
  path: [
@@ -3555,17 +3562,17 @@ function Vi({ shape: e, value: t, path: n, ctx: r }) {
3555
3562
  ],
3556
3563
  ctx: r,
3557
3564
  cell: !0
3558
- }, i)), r.edit ? /* @__PURE__ */ F(Gi, { onClick: () => r.set(n, i.filter((e, n) => n !== t)) }) : null]
3565
+ }, i)), r.edit ? /* @__PURE__ */ F(Ki, { onClick: () => r.set(n, i.filter((e, n) => n !== t)) }) : null]
3559
3566
  })
3560
3567
  ]
3561
- }, t)) }), r.edit ? /* @__PURE__ */ F(Ki, {
3568
+ }, t)) }), r.edit ? /* @__PURE__ */ F(qi, {
3562
3569
  what: e.label,
3563
- onClick: () => r.set(n, [...i, zi(e)])
3570
+ onClick: () => r.set(n, [...i, Bi(e)])
3564
3571
  }) : null]
3565
3572
  });
3566
3573
  }
3567
- function Hi({ shape: e, value: t, path: n, ctx: r }) {
3568
- let i = Ri(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");
3574
+ function Ui({ shape: e, value: t, path: n, ctx: r }) {
3575
+ let i = zi(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");
3569
3576
  return /* @__PURE__ */ I("div", {
3570
3577
  className: "flex flex-col gap-2",
3571
3578
  children: [i.map((t, a) => {
@@ -3581,7 +3588,7 @@ function Hi({ shape: e, value: t, path: n, ctx: r }) {
3581
3588
  className: "min-w-0 flex-1",
3582
3589
  children: [/* @__PURE__ */ F("span", {
3583
3590
  className: "block truncate font-medium text-[0.9375rem]",
3584
- children: Pi(e, t) || `${e.label ?? ""} ${a + 1}`.trim()
3591
+ children: Fi(e, t) || `${e.label ?? ""} ${a + 1}`.trim()
3585
3592
  }), /* @__PURE__ */ I("span", {
3586
3593
  className: "flex flex-wrap gap-x-2 text-[0.75rem] text-ink-3",
3587
3594
  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: [
@@ -3591,11 +3598,11 @@ function Hi({ shape: e, value: t, path: n, ctx: r }) {
3591
3598
  ] }, e))]
3592
3599
  })]
3593
3600
  }),
3594
- r.edit ? /* @__PURE__ */ F(Gi, { onClick: () => r.set(n, i.filter((e, t) => t !== a)) }) : null
3601
+ r.edit ? /* @__PURE__ */ F(Ki, { onClick: () => r.set(n, i.filter((e, t) => t !== a)) }) : null
3595
3602
  ]
3596
3603
  }), /* @__PURE__ */ F("div", {
3597
3604
  className: "border-border-soft border-t px-4 py-4",
3598
- children: /* @__PURE__ */ F(Ui, {
3605
+ children: /* @__PURE__ */ F(Wi, {
3599
3606
  shape: e,
3600
3607
  value: t,
3601
3608
  path: [...n, a],
@@ -3603,21 +3610,21 @@ function Hi({ shape: e, value: t, path: n, ctx: r }) {
3603
3610
  })
3604
3611
  })]
3605
3612
  }, a);
3606
- }), r.edit ? /* @__PURE__ */ F(Ki, {
3613
+ }), r.edit ? /* @__PURE__ */ F(qi, {
3607
3614
  what: e.label,
3608
- onClick: () => r.set(n, [...i, zi(e)])
3615
+ onClick: () => r.set(n, [...i, Bi(e)])
3609
3616
  }) : null]
3610
3617
  });
3611
3618
  }
3612
- function Ui({ shape: e, value: t, path: n, ctx: r }) {
3613
- let i = Oi(t) ? t : {}, a = (e) => e.kind === "list" || e.kind === "object" || e.kind === "table" || e.kind === "text" && !!e.long;
3619
+ function Wi({ shape: e, value: t, path: n, ctx: r }) {
3620
+ let i = ki(t) ? t : {}, a = (e) => e.kind === "list" || e.kind === "object" || e.kind === "table" || e.kind === "text" && !!e.long;
3614
3621
  return /* @__PURE__ */ F("div", {
3615
3622
  className: "grid grid-cols-[repeat(auto-fill,minmax(10rem,1fr))] gap-x-4 gap-y-4",
3616
- children: Object.entries(e.fields).map(([e, t]) => /* @__PURE__ */ F(Wi, {
3623
+ children: Object.entries(e.fields).map(([e, t]) => /* @__PURE__ */ F(Gi, {
3617
3624
  title: L(e, t),
3618
3625
  wide: a(t),
3619
3626
  count: Array.isArray(i[e]) ? i[e].length : null,
3620
- children: /* @__PURE__ */ F(Ii, {
3627
+ children: /* @__PURE__ */ F(Li, {
3621
3628
  shape: t,
3622
3629
  value: i[e],
3623
3630
  path: [...n, e],
@@ -3626,11 +3633,11 @@ function Ui({ shape: e, value: t, path: n, ctx: r }) {
3626
3633
  }, e))
3627
3634
  });
3628
3635
  }
3629
- function Wi({ title: e, wide: t, count: n, children: r }) {
3636
+ function Gi({ title: e, wide: t, count: n, children: r }) {
3630
3637
  return /* @__PURE__ */ I("div", {
3631
3638
  className: q("flex min-w-0 flex-col gap-1.5 text-[0.875rem]", t && "col-span-full"),
3632
3639
  children: [/* @__PURE__ */ I("span", {
3633
- className: Di,
3640
+ className: Oi,
3634
3641
  children: [e, n === null ? null : /* @__PURE__ */ F("span", {
3635
3642
  className: "ml-1 text-ink-4",
3636
3643
  children: n
@@ -3638,7 +3645,7 @@ function Wi({ title: e, wide: t, count: n, children: r }) {
3638
3645
  }), r]
3639
3646
  });
3640
3647
  }
3641
- function Gi({ onClick: e }) {
3648
+ function Ki({ onClick: e }) {
3642
3649
  return /* @__PURE__ */ F("button", {
3643
3650
  type: "button",
3644
3651
  "aria-label": V("data.remove"),
@@ -3649,7 +3656,7 @@ function Gi({ onClick: e }) {
3649
3656
  children: /* @__PURE__ */ F(De, { className: "size-3.5" })
3650
3657
  });
3651
3658
  }
3652
- function Ki({ what: e, onClick: t }) {
3659
+ function qi({ what: e, onClick: t }) {
3653
3660
  return /* @__PURE__ */ I("button", {
3654
3661
  type: "button",
3655
3662
  onClick: t,
@@ -3661,7 +3668,7 @@ function Ki({ what: e, onClick: t }) {
3661
3668
  ]
3662
3669
  });
3663
3670
  }
3664
- function qi({ shape: e, value: t, onChange: n, mode: r, onMode: i, modes: a = [
3671
+ function Ji({ shape: e, value: t, onChange: n, mode: r, onMode: i, modes: a = [
3665
3672
  "view",
3666
3673
  "edit",
3667
3674
  "json"
@@ -3671,7 +3678,7 @@ function qi({ shape: e, value: t, onChange: n, mode: r, onMode: i, modes: a = [
3671
3678
  shape: e,
3672
3679
  edit: u === "edit" && !!n,
3673
3680
  scope: f,
3674
- set: (e, r) => n?.(ki(t, e, r)),
3681
+ set: (e, r) => n?.(Ai(t, e, r)),
3675
3682
  open: (e) => {
3676
3683
  let t = document.getElementById(`${f}-${e}`);
3677
3684
  t && (t.open = !0, t.scrollIntoView({
@@ -3694,7 +3701,7 @@ function qi({ shape: e, value: t, onChange: n, mode: r, onMode: i, modes: a = [
3694
3701
  children: t[e].length
3695
3702
  }) : null]
3696
3703
  }, e)) : null
3697
- }), s.length > 1 ? /* @__PURE__ */ F(Pr, {
3704
+ }), s.length > 1 ? /* @__PURE__ */ F(Fr, {
3698
3705
  value: u,
3699
3706
  onChange: d,
3700
3707
  label: V("data.modes"),
@@ -3719,7 +3726,7 @@ function qi({ shape: e, value: t, onChange: n, mode: r, onMode: i, modes: a = [
3719
3726
  }) : null]
3720
3727
  }), /* @__PURE__ */ F("div", {
3721
3728
  className: "text-[0.9375rem] leading-relaxed",
3722
- children: /* @__PURE__ */ F(Ii, {
3729
+ children: /* @__PURE__ */ F(Li, {
3723
3730
  shape: n,
3724
3731
  value: t[e],
3725
3732
  path: [e],
@@ -3730,7 +3737,7 @@ function qi({ shape: e, value: t, onChange: n, mode: r, onMode: i, modes: a = [
3730
3737
  })]
3731
3738
  });
3732
3739
  }
3733
- function Ji({ items: e }) {
3740
+ function Yi({ items: e }) {
3734
3741
  let [t, n] = M(!1), r = j(null);
3735
3742
  return A(() => {
3736
3743
  if (!t) return;
@@ -3767,12 +3774,12 @@ function Ji({ items: e }) {
3767
3774
  }) : null]
3768
3775
  });
3769
3776
  }
3770
- function Yi(e) {
3777
+ function Xi(e) {
3771
3778
  return e.toLowerCase().replace(/ä/g, "ae").replace(/ö/g, "oe").replace(/ü/g, "ue").replace(/ß/g, "ss").replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "output";
3772
3779
  }
3773
- function Xi({ shape: e, title: t, open: n, onClose: r }) {
3780
+ function Zi({ shape: e, title: t, open: n, onClose: r }) {
3774
3781
  let [i, a] = M(!1), o = n ? JSON.stringify(Ft(e, t), null, 2) : "";
3775
- return /* @__PURE__ */ F(zr, {
3782
+ return /* @__PURE__ */ F(Br, {
3776
3783
  open: n,
3777
3784
  onClose: r,
3778
3785
  title: `${V("data.schema")} · ${t}`,
@@ -3796,7 +3803,7 @@ function Xi({ shape: e, title: t, open: n, onClose: r }) {
3796
3803
  type: "button",
3797
3804
  onClick: () => {
3798
3805
  let e = URL.createObjectURL(new Blob([o], { type: "application/schema+json" })), n = document.createElement("a");
3799
- n.href = e, n.download = `${Yi(t)}.schema.json`, n.click(), setTimeout(() => URL.revokeObjectURL(e), 1e3);
3806
+ n.href = e, n.download = `${Xi(t)}.schema.json`, n.click(), setTimeout(() => URL.revokeObjectURL(e), 1e3);
3800
3807
  },
3801
3808
  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",
3802
3809
  children: [
@@ -3809,12 +3816,12 @@ function Xi({ shape: e, title: t, open: n, onClose: r }) {
3809
3816
  })
3810
3817
  });
3811
3818
  }
3812
- function Zi(e) {
3819
+ function Qi(e) {
3813
3820
  let t = e;
3814
3821
  return t.type === "agent" && t.output.format === "json" && !t.each && !t.call;
3815
3822
  }
3816
- function Qi({ runId: e, step: t, output: n, header: r, children: i }) {
3817
- let a = Mn(t), [o, s] = M(!1), [c, l] = M(!1), [u, d] = M(null), [f, m] = M(!1), [h, g] = M(null), _ = u ?? (Oi(n.json) ? n.json : {}), v = async () => {
3823
+ function $i({ runId: e, step: t, output: n, header: r, children: i }) {
3824
+ let a = Nn(t), [o, s] = M(!1), [c, l] = M(!1), [u, d] = M(null), [f, m] = M(!1), [h, g] = M(null), _ = u ?? (ki(n.json) ? n.json : {}), v = async () => {
3818
3825
  if (u) {
3819
3826
  m(!0), g(null);
3820
3827
  try {
@@ -3825,7 +3832,7 @@ function Qi({ runId: e, step: t, output: n, header: r, children: i }) {
3825
3832
  m(!1);
3826
3833
  }
3827
3834
  }
3828
- }, y = /* @__PURE__ */ F(Ji, { items: [{
3835
+ }, y = /* @__PURE__ */ F(Yi, { items: [{
3829
3836
  label: V(o ? "data.close" : "data.open"),
3830
3837
  icon: /* @__PURE__ */ F(b, { className: "size-4 shrink-0" }),
3831
3838
  onClick: () => {
@@ -3840,7 +3847,7 @@ function Qi({ runId: e, step: t, output: n, header: r, children: i }) {
3840
3847
  r(y),
3841
3848
  o ? /* @__PURE__ */ I("div", {
3842
3849
  className: "overflow-hidden rounded-xl bg-card ring-1 ring-border-soft",
3843
- children: [/* @__PURE__ */ F(qi, {
3850
+ children: [/* @__PURE__ */ F(Ji, {
3844
3851
  shape: a,
3845
3852
  value: _,
3846
3853
  onChange: d
@@ -3866,7 +3873,7 @@ function Qi({ runId: e, step: t, output: n, header: r, children: i }) {
3866
3873
  ]
3867
3874
  }) : null]
3868
3875
  }) : i,
3869
- /* @__PURE__ */ F(Xi, {
3876
+ /* @__PURE__ */ F(Zi, {
3870
3877
  shape: a,
3871
3878
  title: t.title,
3872
3879
  open: c,
@@ -3876,11 +3883,11 @@ function Qi({ runId: e, step: t, output: n, header: r, children: i }) {
3876
3883
  }
3877
3884
  //#endregion
3878
3885
  //#region ../runner/src/location.tsx
3879
- var $i = 25, ea = 9e3;
3880
- function ta(e) {
3886
+ var ea = 25, ta = 9e3;
3887
+ function na(e) {
3881
3888
  return e.code === e.PERMISSION_DENIED ? "denied" : e.code === e.TIMEOUT ? "timeout" : "unavailable";
3882
3889
  }
3883
- function na({ value: e, runId: t, placeholder: n, onChange: r, onBusy: i }) {
3890
+ function ra({ value: e, runId: t, placeholder: n, onChange: r, onBusy: i }) {
3884
3891
  let a = Zt(e) ? e : null, [o, s] = M(!1), [c, l] = M(null), u = j(null), d = j(!!a?.label), f = j(a);
3885
3892
  f.current = a;
3886
3893
  let p = a?.lat !== void 0 && a.lng !== void 0, m = typeof navigator < "u" && "geolocation" in navigator, h = () => {
@@ -3916,13 +3923,13 @@ function na({ value: e, runId: t, placeholder: n, onChange: r, onBusy: i }) {
3916
3923
  };
3917
3924
  f.current = c, r(c);
3918
3925
  }
3919
- if (t <= $i || Date.now() - e > ea) {
3926
+ if (t <= ea || Date.now() - e > ta) {
3920
3927
  h();
3921
3928
  let e = f.current;
3922
3929
  e?.lat !== void 0 && e.lng !== void 0 && g(e.lat, e.lng);
3923
3930
  }
3924
3931
  }, (e) => {
3925
- h(), t === Infinity && l(ta(e));
3932
+ h(), t === Infinity && l(na(e));
3926
3933
  }, {
3927
3934
  enableHighAccuracy: !0,
3928
3935
  timeout: 15e3,
@@ -4002,9 +4009,9 @@ function na({ value: e, runId: t, placeholder: n, onChange: r, onBusy: i }) {
4002
4009
  }
4003
4010
  //#endregion
4004
4011
  //#region ../runner/src/scan.tsx
4005
- var ra = null;
4006
- function ia() {
4007
- return ra ??= (async () => {
4012
+ var ia = null;
4013
+ function aa() {
4014
+ return ia ??= (async () => {
4008
4015
  let e = window.BarcodeDetector;
4009
4016
  if (e) try {
4010
4017
  let t = await e.getSupportedFormats();
@@ -4030,33 +4037,33 @@ function ia() {
4030
4037
  }
4031
4038
  }
4032
4039
  };
4033
- })(), ra;
4040
+ })(), ia;
4034
4041
  }
4035
- function aa({ open: e, onClose: t, onResult: n }) {
4042
+ function oa({ open: e, onClose: t, onResult: n }) {
4036
4043
  let r = j(n);
4037
4044
  r.current = n;
4038
4045
  let i = j(t);
4039
4046
  return i.current = t, A(() => {
4040
- e && Sr("scan").then((e) => {
4047
+ e && Cr("scan").then((e) => {
4041
4048
  e && r.current(e);
4042
4049
  }).catch(() => void 0).finally(() => i.current());
4043
4050
  }, [e]), null;
4044
4051
  }
4045
- function oa(e) {
4046
- return K("scan") ? /* @__PURE__ */ F(aa, { ...e }) : /* @__PURE__ */ F(sa, { ...e });
4052
+ function sa(e) {
4053
+ return K("scan") ? /* @__PURE__ */ F(oa, { ...e }) : /* @__PURE__ */ F(ca, { ...e });
4047
4054
  }
4048
- function sa({ open: e, onClose: t, onResult: n }) {
4049
- let [r, i] = M("environment"), [a, o] = M(!1), [s, c] = M(!1), l = j(null), u = gi(e, r), d = j(n);
4055
+ function ca({ open: e, onClose: t, onResult: n }) {
4056
+ let [r, i] = M("environment"), [a, o] = M(!1), [s, c] = M(!1), l = j(null), u = _i(e, r), d = j(n);
4050
4057
  d.current = n;
4051
4058
  let f = j(t);
4052
4059
  f.current = t, A(() => {
4053
- e && (c(!1), ia().then((e) => o(e.qrOnly)));
4060
+ e && (c(!1), aa().then((e) => o(e.qrOnly)));
4054
4061
  }, [e]), A(() => {
4055
4062
  if (!e || !u.stream) return;
4056
4063
  let t = !1, n, r = async () => {
4057
4064
  let e = u.video.current;
4058
4065
  if (!t && e && e.readyState >= 2 && e.videoWidth) {
4059
- let n = await (await ia()).detect(e).catch(() => null);
4066
+ let n = await (await aa()).detect(e).catch(() => null);
4060
4067
  if (n && !t) {
4061
4068
  navigator.vibrate?.(60), d.current(n), f.current();
4062
4069
  return;
@@ -4075,33 +4082,33 @@ function sa({ open: e, onClose: t, onResult: n }) {
4075
4082
  let p = async (e) => {
4076
4083
  if (!e) return;
4077
4084
  c(!1);
4078
- let r = await createImageBitmap(e).catch(() => null), i = r ? await (await ia()).detect(r).catch(() => null) : null;
4085
+ let r = await createImageBitmap(e).catch(() => null), i = r ? await (await aa()).detect(r).catch(() => null) : null;
4079
4086
  i ? (n(i), t()) : c(!0);
4080
4087
  };
4081
- return /* @__PURE__ */ I(_i, {
4088
+ return /* @__PURE__ */ I(vi, {
4082
4089
  open: e,
4083
4090
  onClose: t,
4084
4091
  label: V("scan.title"),
4085
4092
  children: [
4086
- /* @__PURE__ */ F(yi, {
4093
+ /* @__PURE__ */ F(bi, {
4087
4094
  title: V("scan.title"),
4088
4095
  onClose: t,
4089
4096
  camera: u,
4090
4097
  onFlip: () => i((e) => e === "environment" ? "user" : "environment")
4091
4098
  }),
4092
- /* @__PURE__ */ F(bi, {
4099
+ /* @__PURE__ */ F(xi, {
4093
4100
  camera: u,
4094
4101
  asking: V("scan.asking"),
4095
4102
  actions: /* @__PURE__ */ I("div", {
4096
4103
  className: "flex flex-col gap-2",
4097
- children: [/* @__PURE__ */ I(Ti, {
4104
+ children: [/* @__PURE__ */ I(Ei, {
4098
4105
  onClick: () => l.current?.click(),
4099
4106
  children: [
4100
4107
  /* @__PURE__ */ F(D, { className: "size-4" }),
4101
4108
  " ",
4102
4109
  V("scan.fromPhoto")
4103
4110
  ]
4104
- }), /* @__PURE__ */ F(Ti, {
4111
+ }), /* @__PURE__ */ F(Ei, {
4105
4112
  quiet: !0,
4106
4113
  onClick: t,
4107
4114
  children: V("scan.typeInstead")
@@ -4117,7 +4124,7 @@ function sa({ open: e, onClose: t, onResult: n }) {
4117
4124
  children: [/* @__PURE__ */ F("p", {
4118
4125
  className: "text-[0.8125rem] text-white/75 leading-snug",
4119
4126
  children: V(s ? "scan.miss" : a ? "scan.hintQr" : "scan.hint")
4120
- }), u.stream ? /* @__PURE__ */ I(Ti, {
4127
+ }), u.stream ? /* @__PURE__ */ I(Ei, {
4121
4128
  quiet: !0,
4122
4129
  onClick: () => l.current?.click(),
4123
4130
  children: [
@@ -4141,12 +4148,12 @@ function sa({ open: e, onClose: t, onResult: n }) {
4141
4148
  }
4142
4149
  //#endregion
4143
4150
  //#region ../runner/src/signature.tsx
4144
- var ca = "#1d1a17", la = {
4151
+ var la = "#1d1a17", ua = {
4145
4152
  width: 1200,
4146
4153
  height: 480
4147
4154
  };
4148
- function ua(e, t, n, r, i) {
4149
- e.lineCap = "round", e.lineJoin = "round", e.strokeStyle = ca, e.fillStyle = ca, e.lineWidth = i;
4155
+ function da(e, t, n, r, i) {
4156
+ e.lineCap = "round", e.lineJoin = "round", e.strokeStyle = la, e.fillStyle = la, e.lineWidth = i;
4150
4157
  for (let a of t) {
4151
4158
  if (a.length === 1) {
4152
4159
  e.beginPath(), e.arc(a[0].x * n, a[0].y * r, i / 2, 0, Math.PI * 2), e.fill();
@@ -4161,14 +4168,14 @@ function ua(e, t, n, r, i) {
4161
4168
  e.lineTo(t.x * n, t.y * r), e.stroke();
4162
4169
  }
4163
4170
  }
4164
- function da({ strokes: e, onStrokes: t }) {
4171
+ function fa({ strokes: e, onStrokes: t }) {
4165
4172
  let n = j(null), r = j(null), i = j(e);
4166
4173
  i.current = e;
4167
4174
  let a = () => {
4168
4175
  let e = n.current, t = e?.getContext("2d");
4169
4176
  if (!e || !t) return;
4170
4177
  let a = window.devicePixelRatio || 1, o = Math.round(e.clientWidth * a), s = Math.round(e.clientHeight * a);
4171
- (e.width !== o || e.height !== s) && (e.width = o, e.height = s), t.clearRect(0, 0, o, s), ua(t, r.current ? [...i.current, r.current] : i.current, o, s, 2.4 * a);
4178
+ (e.width !== o || e.height !== s) && (e.width = o, e.height = s), t.clearRect(0, 0, o, s), da(t, r.current ? [...i.current, r.current] : i.current, o, s, 2.4 * a);
4172
4179
  };
4173
4180
  A(() => {
4174
4181
  a();
@@ -4215,20 +4222,20 @@ function da({ strokes: e, onStrokes: t }) {
4215
4222
  ]
4216
4223
  });
4217
4224
  }
4218
- async function fa(e) {
4225
+ async function pa(e) {
4219
4226
  let t = document.createElement("canvas");
4220
- t.width = la.width, t.height = la.height;
4227
+ t.width = ua.width, t.height = ua.height;
4221
4228
  let n = t.getContext("2d");
4222
4229
  if (!n) return null;
4223
- ua(n, e, la.width, la.height, 7);
4230
+ da(n, e, ua.width, ua.height, 7);
4224
4231
  let r = await new Promise((e) => t.toBlob(e, "image/png"));
4225
4232
  return r ? new File([r], "unterschrift.png", { type: "image/png" }) : null;
4226
4233
  }
4227
- function pa({ label: e, value: t, runId: n, onChange: r }) {
4234
+ function ma({ label: e, value: t, runId: n, onChange: r }) {
4228
4235
  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 () => {
4229
4236
  l(!0), d(null);
4230
4237
  try {
4231
- let e = await fa(o);
4238
+ let e = await pa(o);
4232
4239
  if (!e) return;
4233
4240
  r((await U.upload(`${G(n)}/uploads`, e)).id), a(!1);
4234
4241
  } catch (e) {
@@ -4263,13 +4270,13 @@ function pa({ label: e, value: t, runId: n, onChange: r }) {
4263
4270
  },
4264
4271
  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",
4265
4272
  children: [/* @__PURE__ */ F(pe, { className: "size-6" }), V("sign.open")]
4266
- }), /* @__PURE__ */ I(zr, {
4273
+ }), /* @__PURE__ */ I(Br, {
4267
4274
  open: i,
4268
4275
  onClose: () => a(!1),
4269
4276
  title: e,
4270
4277
  wide: !0,
4271
4278
  children: [
4272
- /* @__PURE__ */ F(da, {
4279
+ /* @__PURE__ */ F(fa, {
4273
4280
  strokes: o,
4274
4281
  onStrokes: s
4275
4282
  }),
@@ -4300,7 +4307,7 @@ function pa({ label: e, value: t, runId: n, onChange: r }) {
4300
4307
  }
4301
4308
  //#endregion
4302
4309
  //#region ../runner/src/store.tsx
4303
- function ma({ runId: e, connectionId: t, connector: n, onCancel: r }) {
4310
+ function ha({ runId: e, connectionId: t, connector: n, onCancel: r }) {
4304
4311
  let [i, a] = M({}), [o, s] = M(!1), [c, l] = M(null), u = async () => {
4305
4312
  s(!0), l(null);
4306
4313
  try {
@@ -4314,7 +4321,7 @@ function ma({ runId: e, connectionId: t, connector: n, onCancel: r }) {
4314
4321
  return /* @__PURE__ */ I("div", {
4315
4322
  className: "flex flex-col gap-3 rounded-xl bg-card p-4 ring-1 ring-input",
4316
4323
  children: [
4317
- (n.fields ?? []).map((e) => /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(Ir, { children: e.label }), /* @__PURE__ */ F(X, {
4324
+ (n.fields ?? []).map((e) => /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(Lr, { children: e.label }), /* @__PURE__ */ F(X, {
4318
4325
  type: e.secret ? "password" : "text",
4319
4326
  autoComplete: "off",
4320
4327
  value: i[e.key] ?? "",
@@ -4352,7 +4359,7 @@ function ma({ runId: e, connectionId: t, connector: n, onCancel: r }) {
4352
4359
  ]
4353
4360
  });
4354
4361
  }
4355
- function ha({ runId: e, connection: t }) {
4362
+ function ga({ runId: e, connection: t }) {
4356
4363
  let [n, r] = M(null), [i, a] = M(null), [o, s] = M(null);
4357
4364
  if (!t) return null;
4358
4365
  if (t.account) {
@@ -4386,7 +4393,7 @@ function ha({ runId: e, connection: t }) {
4386
4393
  if (s(null), a(null), K("signIn")) {
4387
4394
  try {
4388
4395
  let { url: r } = await U.post(`${G(e)}/connections/${t.id}/oauth/${n.id}`);
4389
- await Sr("signIn", { url: r });
4396
+ await Cr("signIn", { url: r });
4390
4397
  } catch (e) {
4391
4398
  s(e.message);
4392
4399
  }
@@ -4416,7 +4423,7 @@ function ha({ runId: e, connection: t }) {
4416
4423
  ]
4417
4424
  }, e.id))
4418
4425
  }),
4419
- l ? /* @__PURE__ */ F(ma, {
4426
+ l ? /* @__PURE__ */ F(ha, {
4420
4427
  runId: e,
4421
4428
  connectionId: t.id,
4422
4429
  connector: l,
@@ -4439,12 +4446,12 @@ function ha({ runId: e, connection: t }) {
4439
4446
  children: V("connect.none")
4440
4447
  });
4441
4448
  }
4442
- function ga(e) {
4449
+ function _a(e) {
4443
4450
  return e == null ? "" : Array.isArray(e) ? e.join(", ") : String(e);
4444
4451
  }
4445
- function _a({ column: e, value: t, boxed: n, onCommit: r }) {
4446
- let [i, a] = M(ga(t));
4447
- A(() => a(ga(t)), [t]);
4452
+ function va({ column: e, value: t, boxed: n, onCommit: r }) {
4453
+ let [i, a] = M(_a(t));
4454
+ A(() => a(_a(t)), [t]);
4448
4455
  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");
4449
4456
  return e.type === "boolean" ? /* @__PURE__ */ F("label", {
4450
4457
  className: "flex size-9 cursor-pointer items-center justify-center coarse:size-11",
@@ -4472,7 +4479,7 @@ function _a({ column: e, value: t, boxed: n, onCommit: r }) {
4472
4479
  value: i,
4473
4480
  onChange: (e) => a(e.target.value),
4474
4481
  onBlur: () => {
4475
- i !== ga(t) && r(Lt(e, i));
4482
+ i !== _a(t) && r(Lt(e, i));
4476
4483
  },
4477
4484
  onKeyDown: (e) => {
4478
4485
  e.key === "Enter" && (e.preventDefault(), e.target.blur());
@@ -4480,13 +4487,13 @@ function _a({ column: e, value: t, boxed: n, onCommit: r }) {
4480
4487
  className: q(o, e.type === "number" && "text-right tabular-nums")
4481
4488
  });
4482
4489
  }
4483
- function va({ runId: e, list: t, editable: n }) {
4490
+ function ya({ runId: e, list: t, editable: n }) {
4484
4491
  let { def: r, rows: i } = t, [a, o] = M(null), [s, c] = M({}), l = `${G(e)}/lists/${r.id}/rows`, u = async (e) => {
4485
4492
  o(null);
4486
4493
  try {
4487
4494
  await e();
4488
4495
  } catch (e) {
4489
- o(e instanceof hr ? e.message : String(e));
4496
+ o(e instanceof gr ? e.message : String(e));
4490
4497
  }
4491
4498
  }, d = () => u(async () => {
4492
4499
  await U.post(l, { cells: s }), c({});
@@ -4508,7 +4515,7 @@ function va({ runId: e, list: t, editable: n }) {
4508
4515
  children: [/* @__PURE__ */ F("div", {
4509
4516
  className: "px-1 pb-0.5 text-[0.6875rem] text-ink-3",
4510
4517
  children: t.name
4511
- }), n ? /* @__PURE__ */ F(_a, {
4518
+ }), n ? /* @__PURE__ */ F(va, {
4512
4519
  boxed: !0,
4513
4520
  column: t,
4514
4521
  value: e.cells[t.id],
@@ -4535,7 +4542,7 @@ function va({ runId: e, list: t, editable: n }) {
4535
4542
  children: [/* @__PURE__ */ F("div", {
4536
4543
  className: "px-1 pb-0.5 text-[0.6875rem] text-ink-3",
4537
4544
  children: e.name
4538
- }), /* @__PURE__ */ F(_a, {
4545
+ }), /* @__PURE__ */ F(va, {
4539
4546
  boxed: !0,
4540
4547
  column: e,
4541
4548
  value: s[e.id],
@@ -4574,7 +4581,7 @@ function va({ runId: e, list: t, editable: n }) {
4574
4581
  className: "border-border-soft border-t align-top",
4575
4582
  children: [r.columns.map((t) => /* @__PURE__ */ F("td", {
4576
4583
  className: q("min-w-[7.5rem]", n ? "px-1 py-0.5" : "px-3 py-2"),
4577
- children: n ? /* @__PURE__ */ F(_a, {
4584
+ children: n ? /* @__PURE__ */ F(va, {
4578
4585
  column: t,
4579
4586
  value: e.cells[t.id],
4580
4587
  onCommit: (n) => m(e.id, t.id, n)
@@ -4595,7 +4602,7 @@ function va({ runId: e, list: t, editable: n }) {
4595
4602
  className: "border-border-soft border-t bg-paper",
4596
4603
  children: [r.columns.map((e) => /* @__PURE__ */ F("td", {
4597
4604
  className: "px-1 py-0.5",
4598
- children: /* @__PURE__ */ F(_a, {
4605
+ children: /* @__PURE__ */ F(va, {
4599
4606
  column: e,
4600
4607
  value: s[e.id],
4601
4608
  onCommit: (t) => c((n) => ({
@@ -4621,23 +4628,23 @@ function va({ runId: e, list: t, editable: n }) {
4621
4628
  }) : null
4622
4629
  ] });
4623
4630
  }
4624
- function ya(e, t, n) {
4631
+ function ba(e, t, n) {
4625
4632
  let r = t.split("/").map(encodeURIComponent).join("/");
4626
4633
  return W(`${G(e)}/store/files/${r}${n ? "?inline=1" : ""}`);
4627
4634
  }
4628
- var ba = [
4635
+ var xa = [
4629
4636
  "bg-paper-3 text-ink-3",
4630
4637
  "bg-moss-tint text-moss",
4631
4638
  "bg-rose-tint text-rose",
4632
4639
  "bg-ember-tint text-ember-strong"
4633
4640
  ];
4634
- function xa({ runId: e, list: t }) {
4641
+ function Sa({ runId: e, list: t }) {
4635
4642
  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) => {
4636
4643
  g(null);
4637
4644
  try {
4638
4645
  await U.patch(`${_}/${e}`, { cells: t });
4639
4646
  } catch (e) {
4640
- g(e instanceof hr ? e.message : String(e));
4647
+ g(e instanceof gr ? e.message : String(e));
4641
4648
  }
4642
4649
  }, te = (e) => {
4643
4650
  let t = y.findIndex((e) => e.id === v?.id), n = y[Math.min(y.length - 1, Math.max(0, t + e))];
@@ -4653,7 +4660,7 @@ function xa({ runId: e, list: t }) {
4653
4660
  className: "text-[0.875rem] text-ink-3",
4654
4661
  children: V("list.empty")
4655
4662
  });
4656
- let E = i && v ? String(v.cells[i.id] ?? "").trim() : "", D = E.split(".").pop()?.toLowerCase() ?? "", O = (e) => ba[Math.min(Math.max(0, o.findIndex((t) => t.id === c(e))), 3)];
4663
+ let E = i && v ? String(v.cells[i.id] ?? "").trim() : "", D = E.split(".").pop()?.toLowerCase() ?? "", O = (e) => xa[Math.min(Math.max(0, o.findIndex((t) => t.id === c(e))), 3)];
4657
4664
  return /* @__PURE__ */ I("div", {
4658
4665
  className: "grid gap-4 lg:grid-cols-[minmax(280px,360px)_minmax(0,1fr)]",
4659
4666
  onKeyDown: re,
@@ -4731,7 +4738,7 @@ function xa({ runId: e, list: t }) {
4731
4738
  children: E.split("/").pop()
4732
4739
  }),
4733
4740
  /* @__PURE__ */ F("a", {
4734
- href: ya(e, E, D === "pdf"),
4741
+ href: ba(e, E, D === "pdf"),
4735
4742
  target: "_blank",
4736
4743
  rel: "noreferrer",
4737
4744
  className: "shrink-0 text-ink-2 underline-offset-2 hover:text-ink hover:underline",
@@ -4740,7 +4747,7 @@ function xa({ runId: e, list: t }) {
4740
4747
  ]
4741
4748
  }), D === "pdf" ? /* @__PURE__ */ F("iframe", {
4742
4749
  title: E,
4743
- src: `${ya(e, E, !0)}#toolbar=0&navpanes=0&view=FitH`,
4750
+ src: `${ba(e, E, !0)}#toolbar=0&navpanes=0&view=FitH`,
4744
4751
  className: "h-[46vh] w-full border-0 bg-white lg:h-[calc(100vh-27rem)] lg:min-h-[360px]"
4745
4752
  }, E) : [
4746
4753
  "png",
@@ -4750,7 +4757,7 @@ function xa({ runId: e, list: t }) {
4750
4757
  ].includes(D) ? /* @__PURE__ */ F("div", {
4751
4758
  className: "flex max-h-[46vh] justify-center overflow-auto bg-white lg:max-h-[calc(100vh-27rem)]",
4752
4759
  children: /* @__PURE__ */ F("img", {
4753
- src: ya(e, E, !0),
4760
+ src: ba(e, E, !0),
4754
4761
  alt: E,
4755
4762
  className: "max-w-full object-contain"
4756
4763
  }, E)
@@ -4769,7 +4776,7 @@ function xa({ runId: e, list: t }) {
4769
4776
  children: [/* @__PURE__ */ F("div", {
4770
4777
  className: "px-1 pb-0.5 text-[0.6875rem] text-ink-3",
4771
4778
  children: e.name
4772
- }), /* @__PURE__ */ F(_a, {
4779
+ }), /* @__PURE__ */ F(va, {
4773
4780
  boxed: !0,
4774
4781
  column: e,
4775
4782
  value: v.cells[e.id],
@@ -4785,24 +4792,24 @@ function xa({ runId: e, list: t }) {
4785
4792
  }) : null]
4786
4793
  });
4787
4794
  }
4788
- var Sa = {
4795
+ var Ca = {
4789
4796
  xlsx: "Excel",
4790
4797
  csv: "CSV",
4791
4798
  json: "JSON",
4792
4799
  md: "Markdown",
4793
4800
  zip: "ZIP"
4794
4801
  };
4795
- function Ca({ runId: e, list: t }) {
4802
+ function wa({ runId: e, list: t }) {
4796
4803
  return /* @__PURE__ */ F("div", {
4797
4804
  className: "flex flex-wrap gap-2",
4798
4805
  children: t.formats.map((n) => /* @__PURE__ */ F("a", {
4799
4806
  href: W(`${G(e)}/lists/${t.def.id}/download?format=${n}`),
4800
4807
  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",
4801
- children: Sa[n] ?? n
4808
+ children: Ca[n] ?? n
4802
4809
  }, n))
4803
4810
  });
4804
4811
  }
4805
- function wa({ runId: e }) {
4812
+ function Ta({ runId: e }) {
4806
4813
  let [t, n] = M(!1), [r, i] = M(null), [a, o] = M(!1);
4807
4814
  A(() => {
4808
4815
  t && (o(!1), U.get(`${G(e)}/store`).then(i));
@@ -4817,7 +4824,7 @@ function wa({ runId: e }) {
4817
4824
  " ",
4818
4825
  V("store.open")
4819
4826
  ]
4820
- }), /* @__PURE__ */ F(zr, {
4827
+ }), /* @__PURE__ */ F(Br, {
4821
4828
  open: t,
4822
4829
  onClose: () => n(!1),
4823
4830
  title: V("store.title"),
@@ -4915,14 +4922,14 @@ function wa({ runId: e }) {
4915
4922
  ]
4916
4923
  }) : /* @__PURE__ */ F("div", {
4917
4924
  className: "flex justify-center py-8 text-ink-4",
4918
- children: /* @__PURE__ */ F(Lr, {})
4925
+ children: /* @__PURE__ */ F(Rr, {})
4919
4926
  })
4920
4927
  })] });
4921
4928
  }
4922
4929
  //#endregion
4923
4930
  //#region ../runner/src/voice.tsx
4924
- var Ta = 300;
4925
- function Ea() {
4931
+ var Ea = 300;
4932
+ function Da() {
4926
4933
  if (typeof MediaRecorder < "u") return (K("transcribe") ? [
4927
4934
  "audio/mp4",
4928
4935
  "audio/webm;codecs=opus",
@@ -4935,9 +4942,9 @@ function Ea() {
4935
4942
  "audio/ogg;codecs=opus"
4936
4943
  ]).find((e) => MediaRecorder.isTypeSupported(e));
4937
4944
  }
4938
- async function Da(e, t) {
4945
+ async function Oa(e, t) {
4939
4946
  if (K("transcribe")) try {
4940
- let n = await Sr("transcribe", {
4947
+ let n = await Cr("transcribe", {
4941
4948
  audio: await new Promise((t, n) => {
4942
4949
  let r = new FileReader();
4943
4950
  r.onload = () => t(String(r.result).split(",")[1] ?? ""), r.onerror = () => n(r.error), r.readAsDataURL(e);
@@ -4950,11 +4957,11 @@ async function Da(e, t) {
4950
4957
  return;
4951
4958
  }
4952
4959
  }
4953
- function Oa(e) {
4960
+ function ka(e) {
4954
4961
  return `${Math.floor(e / 60)}:${String(Math.floor(e % 60)).padStart(2, "0")}`;
4955
4962
  }
4956
- function ka({ value: e, runId: t, onChange: n, onBusy: r }) {
4957
- let i = Qt(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 = Ea(), b = Jr && !!y;
4963
+ function Aa({ value: e, runId: t, onChange: n, onBusy: r }) {
4964
+ let i = Qt(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 = Da(), b = Yr && !!y;
4958
4965
  A(() => () => {
4959
4966
  _.current && (_.current.recorder.onstop = null, _.current.stop());
4960
4967
  }, []), A(() => () => {
@@ -4968,7 +4975,7 @@ function ka({ value: e, runId: t, onChange: n, onBusy: r }) {
4968
4975
  asset: r.id,
4969
4976
  url: URL.createObjectURL(e)
4970
4977
  });
4971
- let { lang: a } = H(), o = await Da(e, a);
4978
+ let { lang: a } = H(), o = await Oa(e, a);
4972
4979
  n({
4973
4980
  asset: r.id,
4974
4981
  lang: a,
@@ -5001,7 +5008,7 @@ function ka({ value: e, runId: t, onChange: n, onBusy: r }) {
5001
5008
  s.getByteTimeDomainData(l);
5002
5009
  let e = 0;
5003
5010
  for (let t of l) e = Math.max(e, Math.abs(t - 128));
5004
- if (c(Math.min(1, e / 64)), o((Date.now() - i) / 1e3), (Date.now() - i) / 1e3 >= Ta) {
5011
+ if (c(Math.min(1, e / 64)), o((Date.now() - i) / 1e3), (Date.now() - i) / 1e3 >= Ea) {
5005
5012
  p();
5006
5013
  return;
5007
5014
  }
@@ -5013,7 +5020,7 @@ function ka({ value: e, runId: t, onChange: n, onBusy: r }) {
5013
5020
  };
5014
5021
  n.ondataavailable = (e) => e.data.size && t.push(e.data), n.onstop = () => {
5015
5022
  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));
5016
- x(new File(t, `sprachnotiz-${pi()}.${r}`, { type: e }), a);
5023
+ x(new File(t, `sprachnotiz-${mi()}.${r}`, { type: e }), a);
5017
5024
  }, _.current = {
5018
5025
  recorder: n,
5019
5026
  stop: p
@@ -5042,10 +5049,10 @@ function ka({ value: e, runId: t, onChange: n, onBusy: r }) {
5042
5049
  className: "min-w-0 flex-1",
5043
5050
  children: [/* @__PURE__ */ F("div", {
5044
5051
  className: "font-medium text-[0.9375rem] tabular-nums",
5045
- children: Oa(a)
5052
+ children: ka(a)
5046
5053
  }), /* @__PURE__ */ F("div", {
5047
5054
  className: "text-[0.8125rem] text-ink-3",
5048
- children: a > 270 ? V("voice.left", { s: Math.ceil(Ta - a) }) : V("voice.recording")
5055
+ children: a > 270 ? V("voice.left", { s: Math.ceil(Ea - a) }) : V("voice.recording")
5049
5056
  })]
5050
5057
  }),
5051
5058
  /* @__PURE__ */ I(J, {
@@ -5060,7 +5067,7 @@ function ka({ value: e, runId: t, onChange: n, onBusy: r }) {
5060
5067
  }) : l ? /* @__PURE__ */ I("div", {
5061
5068
  className: "flex items-center gap-3 rounded-xl bg-card p-4 text-[0.875rem] text-ink-3 ring-1 ring-input",
5062
5069
  children: [
5063
- /* @__PURE__ */ F(Lr, { className: "size-4" }),
5070
+ /* @__PURE__ */ F(Rr, { className: "size-4" }),
5064
5071
  " ",
5065
5072
  V("run.uploading")
5066
5073
  ]
@@ -5081,7 +5088,7 @@ function ka({ value: e, runId: t, onChange: n, onBusy: r }) {
5081
5088
  className: "mt-2 flex flex-wrap items-center justify-between gap-2",
5082
5089
  children: [/* @__PURE__ */ F("span", {
5083
5090
  className: "px-1 text-[0.8125rem] text-ink-3",
5084
- children: i.seconds ? Oa(i.seconds) : null
5091
+ children: i.seconds ? ka(i.seconds) : null
5085
5092
  }), /* @__PURE__ */ I("div", {
5086
5093
  className: "flex gap-1",
5087
5094
  children: [b ? /* @__PURE__ */ I(J, {
@@ -5141,8 +5148,8 @@ function ka({ value: e, runId: t, onChange: n, onBusy: r }) {
5141
5148
  }
5142
5149
  //#endregion
5143
5150
  //#region ../runner/src/fields.tsx
5144
- function Aa({ field: e, value: t, values: n, onChange: r }) {
5145
- let i = e.columns ?? [], a = Array.isArray(t) && t.length ? t : [{}], o = Wn(e, a, n), s = (e, t, n) => {
5151
+ function ja({ field: e, value: t, values: n, onChange: r }) {
5152
+ let i = e.columns ?? [], a = Array.isArray(t) && t.length ? t : [{}], o = Gn(e, a, n), s = (e, t, n) => {
5146
5153
  r(a.map((r, i) => i === e ? {
5147
5154
  ...r,
5148
5155
  [t]: n
@@ -5230,10 +5237,10 @@ function Aa({ field: e, value: t, values: n, onChange: r }) {
5230
5237
  ]
5231
5238
  });
5232
5239
  }
5233
- function ja(e) {
5240
+ function Ma(e) {
5234
5241
  return !!e?.closest("input, textarea, [contenteditable='true']");
5235
5242
  }
5236
- function Ma({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
5243
+ function Na({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
5237
5244
  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) => {
5238
5245
  S.current = e, x(e);
5239
5246
  }, 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);
@@ -5245,7 +5252,7 @@ function Ma({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
5245
5252
  u(!0), i?.(!0), h(t.length > a && T ? V("run.maxFiles", { n: te }) : null);
5246
5253
  try {
5247
5254
  for (let e of t.slice(0, Math.max(0, a))) {
5248
- let t = await fi(e), i = await U.upload(`${G(n)}/uploads`, t);
5255
+ let t = await pi(e), i = await U.upload(`${G(n)}/uploads`, t);
5249
5256
  f((e) => ({
5250
5257
  ...e,
5251
5258
  [i.id]: {
@@ -5276,7 +5283,7 @@ function Ma({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
5276
5283
  if (!ie) return;
5277
5284
  let e = (e) => {
5278
5285
  let t = Array.from(e.clipboardData?.files ?? []), n = a.current;
5279
- if (!t.length || !n || ja(document.activeElement)) return;
5286
+ if (!t.length || !n || Ma(document.activeElement)) return;
5280
5287
  let r = document.querySelectorAll("[data-upload-field]");
5281
5288
  (n.matches(":hover") || n.contains(document.activeElement) || r.length === 1) && (e.preventDefault(), oe.current(t));
5282
5289
  };
@@ -5356,15 +5363,15 @@ function Ma({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
5356
5363
  type: "button",
5357
5364
  onClick: () => o.current?.click(),
5358
5365
  className: q(ue, "min-w-[9rem] flex-1 px-4", v && "border-ember text-ink"),
5359
- children: [F(w ? E : fe, { className: "size-6" }), l ? V("run.uploading") : O.length ? V("run.uploadMore") : V(qr ? "run.uploadTouch" : "run.upload")]
5366
+ children: [F(w ? E : fe, { className: "size-6" }), l ? V("run.uploading") : O.length ? V("run.uploadMore") : V(Jr ? "run.uploadTouch" : "run.upload")]
5360
5367
  }),
5361
5368
  ne ? /* @__PURE__ */ I("button", {
5362
5369
  type: "button",
5363
- onClick: () => Jr ? _(!0) : s.current?.click(),
5370
+ onClick: () => Yr ? _(!0) : s.current?.click(),
5364
5371
  className: q(ue, "w-28"),
5365
5372
  children: [/* @__PURE__ */ F(m, { className: "size-6" }), V("run.camera")]
5366
5373
  }) : null,
5367
- D && !(Jr && Ci) ? /* @__PURE__ */ I("button", {
5374
+ D && !(Yr && wi) ? /* @__PURE__ */ I("button", {
5368
5375
  type: "button",
5369
5376
  onClick: () => c.current?.click(),
5370
5377
  className: q(ue, "w-28"),
@@ -5402,7 +5409,7 @@ function Ma({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
5402
5409
  ae(Array.from(e.target.files ?? [])), e.target.value = "";
5403
5410
  }
5404
5411
  }) : null,
5405
- /* @__PURE__ */ F(wi, {
5412
+ /* @__PURE__ */ F(Ti, {
5406
5413
  open: g,
5407
5414
  multiple: T,
5408
5415
  video: D,
@@ -5427,7 +5434,7 @@ function Ma({ field: e, value: t, runId: n, onChange: r, onBusy: i }) {
5427
5434
  ]
5428
5435
  });
5429
5436
  }
5430
- function Na(e) {
5437
+ function Pa(e) {
5431
5438
  let t = `${e.id} ${e.label}`.toLowerCase();
5432
5439
  return /telefon|phone|handy|mobil(?!it)|\btel\b|rückruf/.test(t) ? {
5433
5440
  type: "tel",
@@ -5460,7 +5467,7 @@ function Na(e) {
5460
5467
  autoCapitalize: "words"
5461
5468
  } : { autoCapitalize: "sentences" };
5462
5469
  }
5463
- function Pa({ field: e, value: t, onChange: n }) {
5470
+ function Fa({ field: e, value: t, onChange: n }) {
5464
5471
  let [r, i] = M(!1);
5465
5472
  return /* @__PURE__ */ I("div", {
5466
5473
  className: "flex gap-2",
@@ -5483,7 +5490,7 @@ function Pa({ field: e, value: t, onChange: n }) {
5483
5490
  V("scan.button")
5484
5491
  ]
5485
5492
  }),
5486
- /* @__PURE__ */ F(oa, {
5493
+ /* @__PURE__ */ F(sa, {
5487
5494
  open: r,
5488
5495
  onClose: () => i(!1),
5489
5496
  onResult: n
@@ -5491,16 +5498,16 @@ function Pa({ field: e, value: t, onChange: n }) {
5491
5498
  ]
5492
5499
  });
5493
5500
  }
5494
- var Fa = 4;
5495
- function Ia(e) {
5501
+ var Ia = 4;
5502
+ function La(e) {
5496
5503
  let t = /* @__PURE__ */ new Map(), n = e.map((e) => ({
5497
5504
  value: e,
5498
- slot: Hn(e)
5505
+ slot: Un(e)
5499
5506
  })).filter((e) => e.slot).sort((e, t) => Date.parse(e.value) - Date.parse(t.value));
5500
5507
  for (let { value: e, slot: r } of n) {
5501
5508
  if (!r) continue;
5502
5509
  let n = t.get(r.day) ?? {
5503
- label: Un(e, B),
5510
+ label: Wn(e, B),
5504
5511
  times: []
5505
5512
  };
5506
5513
  n.times.push({
@@ -5510,13 +5517,13 @@ function Ia(e) {
5510
5517
  }
5511
5518
  return [...t.values()];
5512
5519
  }
5513
- function La({ name: e, label: t, options: n, value: r, onChange: i, disabled: a }) {
5514
- let o = Ia(n), s = o.findIndex((e) => e.times.some((e) => e.value === r)), [c, l] = M(s >= Fa);
5520
+ function Ra({ name: e, label: t, options: n, value: r, onChange: i, disabled: a }) {
5521
+ let o = La(n), s = o.findIndex((e) => e.times.some((e) => e.value === r)), [c, l] = M(s >= Ia);
5515
5522
  if (!o.length) return /* @__PURE__ */ F("p", {
5516
5523
  className: "text-[0.875rem] text-ink-3",
5517
5524
  children: V("slot.none")
5518
5525
  });
5519
- let u = c ? o : o.slice(0, Fa);
5526
+ let u = c ? o : o.slice(0, Ia);
5520
5527
  return /* @__PURE__ */ I("div", {
5521
5528
  className: "flex flex-col gap-4",
5522
5529
  children: [/* @__PURE__ */ I("fieldset", {
@@ -5554,7 +5561,7 @@ function La({ name: e, label: t, options: n, value: r, onChange: i, disabled: a
5554
5561
  }) : null]
5555
5562
  });
5556
5563
  }
5557
- function Ra({ cards: e, value: t, multi: n, runId: r, onChange: i, disabled: a }) {
5564
+ function za({ cards: e, value: t, multi: n, runId: r, onChange: i, disabled: a }) {
5558
5565
  let o = new Set(n ? Array.isArray(t) ? t.map(String) : [] : t == null || t === "" ? [] : [String(t)]), s = (e) => {
5559
5566
  i(n ? o.has(e) ? [...o].filter((t) => t !== e) : [...o, e] : o.has(e) ? "" : e);
5560
5567
  }, c = (e) => /^(https?:|data:|\/)/.test(e) ? e : W(`/api/runs/${r}/assets/${e}`);
@@ -5607,11 +5614,11 @@ function Ra({ cards: e, value: t, multi: n, runId: r, onChange: i, disabled: a }
5607
5614
  })
5608
5615
  });
5609
5616
  }
5610
- function za({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onBusy: o, error: s, closed: c }) {
5617
+ function Ba({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onBusy: o, error: s, closed: c }) {
5611
5618
  let l = t == null ? "" : String(t), u = new Set(c?.values.map(String)), d;
5612
5619
  switch (e.kind) {
5613
5620
  case "textarea":
5614
- d = /* @__PURE__ */ F(Ar, {
5621
+ d = /* @__PURE__ */ F(jr, {
5615
5622
  value: l,
5616
5623
  placeholder: e.placeholder,
5617
5624
  autoCapitalize: "sentences",
@@ -5630,33 +5637,33 @@ function za({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
5630
5637
  break;
5631
5638
  case "select": {
5632
5639
  let n = e.options ?? [], o = i?.cards?.[e.id];
5633
- d = o?.length ? /* @__PURE__ */ F(Ra, {
5640
+ d = o?.length ? /* @__PURE__ */ F(za, {
5634
5641
  cards: o,
5635
5642
  value: t,
5636
5643
  multi: !1,
5637
5644
  runId: r,
5638
5645
  onChange: a,
5639
5646
  disabled: u
5640
- }) : n.length <= 5 && n.every((e) => e.length <= 28) ? /* @__PURE__ */ F(Mr, {
5647
+ }) : n.length <= 5 && n.every((e) => e.length <= 28) ? /* @__PURE__ */ F(Nr, {
5641
5648
  value: l,
5642
5649
  options: n,
5643
5650
  onChange: a,
5644
5651
  disabled: [...u],
5645
- label: mr
5646
- }) : /* @__PURE__ */ F(jr, {
5652
+ label: hr
5653
+ }) : /* @__PURE__ */ F(Mr, {
5647
5654
  value: l,
5648
5655
  placeholder: "—",
5649
5656
  onChange: a,
5650
5657
  options: n.map((e) => ({
5651
5658
  value: e,
5652
- label: mr(e),
5659
+ label: hr(e),
5653
5660
  disabled: u.has(e)
5654
5661
  }))
5655
5662
  });
5656
5663
  break;
5657
5664
  }
5658
5665
  case "slot":
5659
- d = /* @__PURE__ */ F(La, {
5666
+ d = /* @__PURE__ */ F(Ra, {
5660
5667
  name: e.id,
5661
5668
  label: e.label,
5662
5669
  options: e.options ?? [],
@@ -5667,19 +5674,19 @@ function za({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
5667
5674
  break;
5668
5675
  case "multiselect": {
5669
5676
  let n = i?.cards?.[e.id];
5670
- d = n?.length ? /* @__PURE__ */ F(Ra, {
5677
+ d = n?.length ? /* @__PURE__ */ F(za, {
5671
5678
  cards: n,
5672
5679
  value: t,
5673
5680
  multi: !0,
5674
5681
  runId: r,
5675
5682
  onChange: a,
5676
5683
  disabled: u
5677
- }) : /* @__PURE__ */ F(Mr, {
5684
+ }) : /* @__PURE__ */ F(Nr, {
5678
5685
  multi: !0,
5679
5686
  value: Array.isArray(t) ? t : [],
5680
5687
  options: e.options ?? [],
5681
5688
  onChange: a,
5682
- label: mr
5689
+ label: hr
5683
5690
  });
5684
5691
  break;
5685
5692
  }
@@ -5718,7 +5725,7 @@ function za({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
5718
5725
  });
5719
5726
  break;
5720
5727
  case "toggle":
5721
- d = /* @__PURE__ */ F(Fr, {
5728
+ d = /* @__PURE__ */ F(Ir, {
5722
5729
  checked: t === !0,
5723
5730
  onChange: a,
5724
5731
  label: e.label,
@@ -5728,7 +5735,7 @@ function za({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
5728
5735
  case "color":
5729
5736
  d = /* @__PURE__ */ I("div", {
5730
5737
  className: "flex items-center gap-3",
5731
- children: [/* @__PURE__ */ F(kr, {
5738
+ children: [/* @__PURE__ */ F(Ar, {
5732
5739
  value: l || "#e0531b",
5733
5740
  onChange: (e) => a(e.target.value)
5734
5741
  }), /* @__PURE__ */ F(X, {
@@ -5744,7 +5751,7 @@ function za({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
5744
5751
  break;
5745
5752
  case "image":
5746
5753
  case "file":
5747
- d = /* @__PURE__ */ F(Ma, {
5754
+ d = /* @__PURE__ */ F(Na, {
5748
5755
  field: e,
5749
5756
  value: t,
5750
5757
  runId: r,
@@ -5753,7 +5760,7 @@ function za({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
5753
5760
  });
5754
5761
  break;
5755
5762
  case "items":
5756
- d = /* @__PURE__ */ F(Aa, {
5763
+ d = /* @__PURE__ */ F(ja, {
5757
5764
  field: e,
5758
5765
  value: t,
5759
5766
  values: n,
@@ -5761,14 +5768,14 @@ function za({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
5761
5768
  });
5762
5769
  break;
5763
5770
  case "connection":
5764
- d = /* @__PURE__ */ F(ha, {
5771
+ d = /* @__PURE__ */ F(ga, {
5765
5772
  runId: r,
5766
5773
  connection: i?.connections.find((t) => t.id === e.connection)
5767
5774
  });
5768
5775
  break;
5769
5776
  case "list": {
5770
5777
  let t = i?.lists.find((t) => t.def.id === e.list);
5771
- d = t ? /* @__PURE__ */ F(va, {
5778
+ d = t ? /* @__PURE__ */ F(ya, {
5772
5779
  runId: r,
5773
5780
  list: t,
5774
5781
  editable: !0
@@ -5776,7 +5783,7 @@ function za({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
5776
5783
  break;
5777
5784
  }
5778
5785
  case "location":
5779
- d = /* @__PURE__ */ F(na, {
5786
+ d = /* @__PURE__ */ F(ra, {
5780
5787
  value: t,
5781
5788
  runId: r,
5782
5789
  placeholder: e.placeholder,
@@ -5785,7 +5792,7 @@ function za({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
5785
5792
  });
5786
5793
  break;
5787
5794
  case "audio":
5788
- d = c ? null : /* @__PURE__ */ F(ka, {
5795
+ d = c ? null : /* @__PURE__ */ F(Aa, {
5789
5796
  value: t,
5790
5797
  runId: r,
5791
5798
  onChange: a,
@@ -5793,19 +5800,19 @@ function za({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
5793
5800
  });
5794
5801
  break;
5795
5802
  case "signature":
5796
- d = /* @__PURE__ */ F(pa, {
5803
+ d = /* @__PURE__ */ F(ma, {
5797
5804
  label: e.label,
5798
5805
  value: t,
5799
5806
  runId: r,
5800
5807
  onChange: a
5801
5808
  });
5802
5809
  break;
5803
- default: d = e.scan ? /* @__PURE__ */ F(Pa, {
5810
+ default: d = e.scan ? /* @__PURE__ */ F(Fa, {
5804
5811
  field: e,
5805
5812
  value: l,
5806
5813
  onChange: a
5807
5814
  }) : /* @__PURE__ */ F(X, {
5808
- ...Na(e),
5815
+ ...Pa(e),
5809
5816
  value: l,
5810
5817
  placeholder: e.placeholder,
5811
5818
  onChange: (e) => a(e.target.value)
@@ -5814,18 +5821,18 @@ function za({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
5814
5821
  return /* @__PURE__ */ I("div", { children: [
5815
5822
  e.kind === "toggle" ? /* @__PURE__ */ I("div", {
5816
5823
  className: "flex items-start justify-between gap-6",
5817
- children: [/* @__PURE__ */ F(Ir, {
5824
+ children: [/* @__PURE__ */ F(Lr, {
5818
5825
  hint: e.help,
5819
5826
  children: e.label
5820
5827
  }), d]
5821
- }) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Ir, {
5828
+ }) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Lr, {
5822
5829
  hint: e.help,
5823
5830
  required: e.required,
5824
5831
  children: e.label
5825
5832
  }), d] }),
5826
5833
  c ? /* @__PURE__ */ F("div", {
5827
5834
  className: "mt-1.5 text-[0.8125rem] text-ink-3",
5828
- children: V("run.closed", { list: c.classes.map((e) => V(`run.cls.${Ba(e)}`)).join(", ") })
5835
+ children: V("run.closed", { list: c.classes.map((e) => V(`run.cls.${Va(e)}`)).join(", ") })
5829
5836
  }) : null,
5830
5837
  s ? /* @__PURE__ */ F("div", {
5831
5838
  className: "mt-1.5 text-[0.8125rem] text-rose",
@@ -5833,10 +5840,10 @@ function za({ field: e, value: t, values: n, runId: r, view: i, onChange: a, onB
5833
5840
  }) : null
5834
5841
  ] });
5835
5842
  }
5836
- function Ba(e) {
5837
- return e in Va ? Va[e] : e === "account" ? "account" : "text";
5843
+ function Va(e) {
5844
+ return e in Ha ? Ha[e] : e === "account" ? "account" : "text";
5838
5845
  }
5839
- var Va = {
5846
+ var Ha = {
5840
5847
  classifier: "text",
5841
5848
  standard: "text",
5842
5849
  high: "text",
@@ -5845,8 +5852,8 @@ var Va = {
5845
5852
  video: "video",
5846
5853
  speech: "speech",
5847
5854
  audio: "audio"
5848
- }, Z = (e) => e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e), Ha = "mb-1.5 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]";
5849
- function Ua(e, t) {
5855
+ }, Z = (e) => e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e), Ua = "mb-1.5 font-medium text-[0.75rem] text-ink-3 uppercase tracking-[0.06em]";
5856
+ function Wa(e, t) {
5850
5857
  if (e?.kind === "object") return e;
5851
5858
  let n = [...new Set(t.flatMap((e) => Object.keys(e ?? {})))];
5852
5859
  return {
@@ -5860,11 +5867,11 @@ function Ua(e, t) {
5860
5867
  }))
5861
5868
  };
5862
5869
  }
5863
- function Wa(e) {
5870
+ function Ga(e) {
5864
5871
  let t = Object.values(e.fields), n = t.filter((e) => e.kind === "number").length;
5865
5872
  return n >= 3 && n > t.length / 2;
5866
5873
  }
5867
- function Ga(e, t, n) {
5874
+ function Ka(e, t, n) {
5868
5875
  if (t == null || t === "") return "";
5869
5876
  switch (e.kind) {
5870
5877
  case "number": return `${typeof t == "number" ? t.toLocaleString(B) : Z(t)}${e.unit ? ` ${e.unit}` : ""}`;
@@ -5876,7 +5883,7 @@ function Ga(e, t, n) {
5876
5883
  default: return Z(t);
5877
5884
  }
5878
5885
  }
5879
- function Ka({ items: e }) {
5886
+ function qa({ items: e }) {
5880
5887
  return /* @__PURE__ */ F("div", {
5881
5888
  className: "flex flex-wrap gap-1.5",
5882
5889
  children: e.map((e, t) => /* @__PURE__ */ F("span", {
@@ -5885,9 +5892,9 @@ function Ka({ items: e }) {
5885
5892
  }, t))
5886
5893
  });
5887
5894
  }
5888
- function qa({ of: e, values: t, root: n }) {
5889
- let r = t.map((t) => Ga(e, t, n)).filter(Boolean);
5890
- return r.every((e) => e.length <= 32) ? /* @__PURE__ */ F(Ka, { items: r }) : /* @__PURE__ */ F("ul", {
5895
+ function Ja({ of: e, values: t, root: n }) {
5896
+ let r = t.map((t) => Ka(e, t, n)).filter(Boolean);
5897
+ return r.every((e) => e.length <= 32) ? /* @__PURE__ */ F(qa, { items: r }) : /* @__PURE__ */ F("ul", {
5891
5898
  className: "flex list-disc flex-col gap-1 pl-5 text-[0.9375rem]",
5892
5899
  children: r.map((e, t) => /* @__PURE__ */ F("li", {
5893
5900
  className: "break-words",
@@ -5895,7 +5902,7 @@ function qa({ of: e, values: t, root: n }) {
5895
5902
  }, t))
5896
5903
  });
5897
5904
  }
5898
- function Ja({ shape: e, rows: t, root: n }) {
5905
+ function Ya({ shape: e, rows: t, root: n }) {
5899
5906
  let r = Object.entries(e.fields);
5900
5907
  return /* @__PURE__ */ F("div", {
5901
5908
  className: "overflow-x-auto rounded-lg ring-1 ring-border-soft",
@@ -5911,18 +5918,18 @@ function Ja({ shape: e, rows: t, root: n }) {
5911
5918
  className: "border-border-soft border-t",
5912
5919
  children: r.map(([t, r]) => /* @__PURE__ */ F("td", {
5913
5920
  className: q("px-3 py-2 tabular-nums", r.kind === "number" && "text-right"),
5914
- children: Ga(r, e?.[t], n)
5921
+ children: Ka(r, e?.[t], n)
5915
5922
  }, t))
5916
5923
  }, t)) })]
5917
5924
  })
5918
5925
  });
5919
5926
  }
5920
- function Ya({ shape: e, rows: t, root: n }) {
5927
+ function Xa({ shape: e, rows: t, root: n }) {
5921
5928
  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);
5922
5929
  return /* @__PURE__ */ F(o ? "ol" : "ul", {
5923
5930
  className: "flex flex-col gap-1.5 text-[0.875rem]",
5924
5931
  children: t.map((e, t) => {
5925
- let r = [i ? Z(e?.[i]) : "", ...a.map(([t, r]) => Ga(r, e?.[t], n))].filter(Boolean);
5932
+ let r = [i ? Z(e?.[i]) : "", ...a.map(([t, r]) => Ka(r, e?.[t], n))].filter(Boolean);
5926
5933
  return /* @__PURE__ */ I("li", {
5927
5934
  className: q(o && "grid grid-cols-[1.25rem_1fr] gap-1.5"),
5928
5935
  children: [o ? /* @__PURE__ */ F("span", {
@@ -5936,7 +5943,7 @@ function Ya({ shape: e, rows: t, root: n }) {
5936
5943
  })
5937
5944
  });
5938
5945
  }
5939
- function Xa({ fields: e, entry: t }) {
5946
+ function Za({ fields: e, entry: t }) {
5940
5947
  let n = e.flatMap(([e, n]) => {
5941
5948
  if (n.kind !== "yesno" || t[e] === void 0 || t[e] === null) return [];
5942
5949
  let r = t[e] ? n.yes ?? L(e, n) : n.no;
@@ -5954,7 +5961,7 @@ function Xa({ fields: e, entry: t }) {
5954
5961
  }, e.k))
5955
5962
  }) : null;
5956
5963
  }
5957
- function Za({ shape: e, rows: t, root: n }) {
5964
+ function Qa({ shape: e, rows: t, root: n }) {
5958
5965
  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");
5959
5966
  return /* @__PURE__ */ F("div", {
5960
5967
  className: "divide-y divide-border-soft overflow-hidden rounded-xl bg-card ring-1 ring-border-soft",
@@ -5967,16 +5974,16 @@ function Za({ shape: e, rows: t, root: n }) {
5967
5974
  children: i ? Z(e?.[i]) : ""
5968
5975
  }), /* @__PURE__ */ F("div", {
5969
5976
  className: "text-[0.8125rem] text-ink-3",
5970
- children: o.map(([t, r]) => Ga(r, e?.[t], n)).filter(Boolean).join(" · ")
5977
+ children: o.map(([t, r]) => Ka(r, e?.[t], n)).filter(Boolean).join(" · ")
5971
5978
  })]
5972
- }), /* @__PURE__ */ F(Xa, {
5979
+ }), /* @__PURE__ */ F(Za, {
5973
5980
  fields: a,
5974
5981
  entry: e ?? {}
5975
5982
  })]
5976
5983
  }, t))
5977
5984
  });
5978
5985
  }
5979
- function Qa({ shape: e, entry: t, root: n }) {
5986
+ function $a({ shape: e, entry: t, root: n }) {
5980
5987
  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");
5981
5988
  return /* @__PURE__ */ I("article", {
5982
5989
  className: "flex flex-col gap-2 rounded-xl bg-card p-4 ring-1 ring-border-soft",
@@ -5986,7 +5993,7 @@ function Qa({ shape: e, entry: t, root: n }) {
5986
5993
  children: [/* @__PURE__ */ F("h4", {
5987
5994
  className: "text-balance font-display font-semibold text-[1.0625rem] leading-snug",
5988
5995
  children: i ? Z(t[i]) : ""
5989
- }), /* @__PURE__ */ F(Xa, {
5996
+ }), /* @__PURE__ */ F(Za, {
5990
5997
  fields: s,
5991
5998
  entry: t
5992
5999
  })]
@@ -5997,7 +6004,7 @@ function Qa({ shape: e, entry: t, root: n }) {
5997
6004
  }) : null,
5998
6005
  o.length ? /* @__PURE__ */ F("div", {
5999
6006
  className: "flex flex-wrap gap-1.5",
6000
- children: o.map(([e, r]) => Ga(r, t[e], n)).filter(Boolean).map((e, t) => /* @__PURE__ */ F("span", {
6007
+ children: o.map(([e, r]) => Ka(r, t[e], n)).filter(Boolean).map((e, t) => /* @__PURE__ */ F("span", {
6001
6008
  className: "rounded-full bg-paper-2 px-2 py-0.5 text-[0.75rem] text-ink-2",
6002
6009
  children: e
6003
6010
  }, t))
@@ -6014,14 +6021,14 @@ function Qa({ shape: e, entry: t, root: n }) {
6014
6021
  return !Array.isArray(i) || !i.length ? null : /* @__PURE__ */ I("div", {
6015
6022
  className: "border-border-soft border-t pt-2",
6016
6023
  children: [/* @__PURE__ */ F("div", {
6017
- className: Ha,
6024
+ className: Ua,
6018
6025
  children: L(e, r)
6019
- }), r.kind === "list" && r.of.kind !== "object" ? /* @__PURE__ */ F(qa, {
6026
+ }), r.kind === "list" && r.of.kind !== "object" ? /* @__PURE__ */ F(Ja, {
6020
6027
  of: r.of,
6021
6028
  values: i,
6022
6029
  root: n
6023
- }) : /* @__PURE__ */ F(Ya, {
6024
- shape: Ua(r.kind === "list" ? r.of : void 0, i),
6030
+ }) : /* @__PURE__ */ F(Xa, {
6031
+ shape: Wa(r.kind === "list" ? r.of : void 0, i),
6025
6032
  rows: i,
6026
6033
  root: n
6027
6034
  })]
@@ -6030,41 +6037,41 @@ function Qa({ shape: e, entry: t, root: n }) {
6030
6037
  ]
6031
6038
  });
6032
6039
  }
6033
- function $a({ of: e, rows: t, root: n }) {
6034
- let r = Ua(e, t);
6035
- return Wa(r) ? /* @__PURE__ */ F(Ja, {
6040
+ function eo({ of: e, rows: t, root: n }) {
6041
+ let r = Wa(e, t);
6042
+ return Ga(r) ? /* @__PURE__ */ F(Ya, {
6036
6043
  shape: r,
6037
6044
  rows: t,
6038
6045
  root: n
6039
6046
  }) : Object.values(r.fields).some((e) => e.kind === "list" || e.kind === "table" || e.kind === "text" && e.long) ? /* @__PURE__ */ F("div", {
6040
6047
  className: "grid grid-cols-[repeat(auto-fill,minmax(min(100%,16rem),1fr))] gap-3",
6041
- children: t.map((e, t) => /* @__PURE__ */ F(Qa, {
6048
+ children: t.map((e, t) => /* @__PURE__ */ F($a, {
6042
6049
  shape: r,
6043
6050
  entry: e ?? {},
6044
6051
  root: n
6045
6052
  }, t))
6046
- }) : /* @__PURE__ */ F(Za, {
6053
+ }) : /* @__PURE__ */ F(Qa, {
6047
6054
  shape: r,
6048
6055
  rows: t,
6049
6056
  root: n
6050
6057
  });
6051
6058
  }
6052
- function eo({ step: e, json: t }) {
6059
+ function to({ step: e, json: t }) {
6053
6060
  if (!t || typeof t != "object" || Array.isArray(t)) return /* @__PURE__ */ F("pre", {
6054
6061
  className: "text-[0.8125rem]",
6055
6062
  children: JSON.stringify(t, null, 2)
6056
6063
  });
6057
- let n = t, r = Mn(e);
6064
+ let n = t, r = Nn(e);
6058
6065
  return /* @__PURE__ */ F("div", {
6059
6066
  className: "flex flex-col gap-5",
6060
6067
  children: Object.entries(n).map(([e, t]) => {
6061
6068
  let i = r.fields[e], a = i ? L(e, i) : e, o;
6062
- if (Array.isArray(t) && t.length && t.every((e) => e && typeof e == "object")) o = /* @__PURE__ */ F($a, {
6069
+ if (Array.isArray(t) && t.length && t.every((e) => e && typeof e == "object")) o = /* @__PURE__ */ F(eo, {
6063
6070
  of: i?.kind === "list" ? i.of : void 0,
6064
6071
  rows: t,
6065
6072
  root: n
6066
6073
  });
6067
- else if (Array.isArray(t)) o = /* @__PURE__ */ F(qa, {
6074
+ else if (Array.isArray(t)) o = /* @__PURE__ */ F(Ja, {
6068
6075
  of: i?.kind === "list" ? i.of : { kind: "text" },
6069
6076
  values: t,
6070
6077
  root: n
@@ -6077,11 +6084,11 @@ function eo({ step: e, json: t }) {
6077
6084
  let e = i && i.kind !== "list" && i.kind !== "table" ? i : { kind: "text" };
6078
6085
  o = /* @__PURE__ */ F("div", {
6079
6086
  className: "whitespace-pre-wrap text-[0.9375rem] leading-relaxed",
6080
- children: Ga(e, t, n)
6087
+ children: Ka(e, t, n)
6081
6088
  });
6082
6089
  }
6083
6090
  return /* @__PURE__ */ I("section", { children: [/* @__PURE__ */ F("div", {
6084
- className: Ha,
6091
+ className: Ua,
6085
6092
  children: a
6086
6093
  }), o] }, e);
6087
6094
  })
@@ -6089,7 +6096,7 @@ function eo({ step: e, json: t }) {
6089
6096
  }
6090
6097
  //#endregion
6091
6098
  //#region ../runner/src/pdf.ts
6092
- var to = "#282623", no = "#81807e", ro = "#1a5fb4", io = "#dbd9d6", ao = 483.28, oo = {
6099
+ var no = "#282623", ro = "#81807e", io = "#1a5fb4", ao = "#dbd9d6", oo = 483.28, so = {
6093
6100
  amp: "&",
6094
6101
  lt: "<",
6095
6102
  gt: ">",
@@ -6098,17 +6105,17 @@ var to = "#282623", no = "#81807e", ro = "#1a5fb4", io = "#dbd9d6", ao = 483.28,
6098
6105
  "#39": "'",
6099
6106
  nbsp: "\xA0"
6100
6107
  };
6101
- function so(e) {
6108
+ function co(e) {
6102
6109
  return e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+\d*);/gi, (e, t) => {
6103
6110
  if (t[0] === "#") {
6104
6111
  let n = t[1]?.toLowerCase() === "x" ? Number.parseInt(t.slice(2), 16) : Number(t.slice(1));
6105
6112
  return Number.isFinite(n) ? String.fromCodePoint(n) : e;
6106
6113
  }
6107
- return oo[t.toLowerCase()] ?? e;
6114
+ return so[t.toLowerCase()] ?? e;
6108
6115
  });
6109
6116
  }
6110
- function co(e) {
6111
- return so(e.replace(/<[^>]+>/g, "")).trim();
6117
+ function lo(e) {
6118
+ return co(e.replace(/<[^>]+>/g, "")).trim();
6112
6119
  }
6113
6120
  function Q(e, t = {}) {
6114
6121
  let n = [];
@@ -6117,14 +6124,14 @@ function Q(e, t = {}) {
6117
6124
  let e = r.tokens;
6118
6125
  e?.length ? n.push(...Q(e, t)) : n.push({
6119
6126
  ...t,
6120
- text: so(r.text)
6127
+ text: co(r.text)
6121
6128
  });
6122
6129
  break;
6123
6130
  }
6124
6131
  case "escape":
6125
6132
  n.push({
6126
6133
  ...t,
6127
- text: so(r.text)
6134
+ text: co(r.text)
6128
6135
  });
6129
6136
  break;
6130
6137
  case "strong":
@@ -6148,7 +6155,7 @@ function Q(e, t = {}) {
6148
6155
  case "codespan":
6149
6156
  n.push({
6150
6157
  ...t,
6151
- text: so(r.text),
6158
+ text: co(r.text),
6152
6159
  color: "#3d3b38"
6153
6160
  });
6154
6161
  break;
@@ -6157,7 +6164,7 @@ function Q(e, t = {}) {
6157
6164
  n.push(...Q(e.tokens, {
6158
6165
  ...t,
6159
6166
  link: e.href,
6160
- color: ro,
6167
+ color: io,
6161
6168
  decoration: "underline"
6162
6169
  }));
6163
6170
  break;
@@ -6177,39 +6184,39 @@ function Q(e, t = {}) {
6177
6184
  case "html":
6178
6185
  n.push({
6179
6186
  ...t,
6180
- text: co(r.text)
6187
+ text: lo(r.text)
6181
6188
  });
6182
6189
  break;
6183
6190
  default: "tokens" in r && Array.isArray(r.tokens) ? n.push(...Q(r.tokens, t)) : "text" in r && typeof r.text == "string" && n.push({
6184
6191
  ...t,
6185
- text: so(r.text)
6192
+ text: co(r.text)
6186
6193
  });
6187
6194
  }
6188
6195
  return n;
6189
6196
  }
6190
- function lo(e) {
6191
- let t = po(e);
6197
+ function uo(e) {
6198
+ let t = mo(e);
6192
6199
  if (t.length === 1 && typeof t[0] == "object" && "style" in t[0]) {
6193
6200
  let { style: e, ...n } = t[0];
6194
6201
  return n;
6195
6202
  }
6196
6203
  return t.length === 1 ? t[0] : { stack: t };
6197
6204
  }
6198
- function uo(e, t) {
6205
+ function fo(e, t) {
6199
6206
  return {
6200
6207
  text: Q(e.tokens),
6201
6208
  alignment: e.align ?? "left",
6202
6209
  ...t ? { style: "th" } : {}
6203
6210
  };
6204
6211
  }
6205
- var fo = {
6212
+ var po = {
6206
6213
  hLineWidth: () => .5,
6207
6214
  vLineWidth: () => 0,
6208
- hLineColor: () => io,
6215
+ hLineColor: () => ao,
6209
6216
  paddingTop: () => 4,
6210
6217
  paddingBottom: () => 4
6211
6218
  };
6212
- function po(e) {
6219
+ function mo(e) {
6213
6220
  let t = [];
6214
6221
  for (let n of e) switch (n.type) {
6215
6222
  case "space": break;
@@ -6234,7 +6241,7 @@ function po(e) {
6234
6241
  });
6235
6242
  break;
6236
6243
  case "list": {
6237
- let e = n, r = e.items.map((e) => lo(e.tokens));
6244
+ let e = n, r = e.items.map((e) => uo(e.tokens));
6238
6245
  t.push(e.ordered ? {
6239
6246
  ol: r,
6240
6247
  style: "list",
@@ -6252,23 +6259,23 @@ function po(e) {
6252
6259
  table: {
6253
6260
  headerRows: 1,
6254
6261
  widths: e.header.map(() => "*"),
6255
- body: [e.header.map((e) => uo(e, !0)), ...e.rows.map((e) => e.map((e) => uo(e, !1)))]
6262
+ body: [e.header.map((e) => fo(e, !0)), ...e.rows.map((e) => e.map((e) => fo(e, !1)))]
6256
6263
  },
6257
- layout: fo,
6264
+ layout: po,
6258
6265
  style: "table"
6259
6266
  });
6260
6267
  break;
6261
6268
  }
6262
6269
  case "code":
6263
6270
  t.push({
6264
- text: so(n.text),
6271
+ text: co(n.text),
6265
6272
  style: "code",
6266
6273
  preserveLeadingSpaces: !0
6267
6274
  });
6268
6275
  break;
6269
6276
  case "blockquote":
6270
6277
  t.push({
6271
- stack: po(n.tokens),
6278
+ stack: mo(n.tokens),
6272
6279
  style: "quote"
6273
6280
  });
6274
6281
  break;
@@ -6278,10 +6285,10 @@ function po(e) {
6278
6285
  type: "line",
6279
6286
  x1: 0,
6280
6287
  y1: 0,
6281
- x2: ao,
6288
+ x2: oo,
6282
6289
  y2: 0,
6283
6290
  lineWidth: .5,
6284
- lineColor: io
6291
+ lineColor: ao
6285
6292
  }],
6286
6293
  margin: [
6287
6294
  0,
@@ -6292,7 +6299,7 @@ function po(e) {
6292
6299
  });
6293
6300
  break;
6294
6301
  case "html": {
6295
- let e = co(n.text);
6302
+ let e = lo(n.text);
6296
6303
  e && t.push({
6297
6304
  text: e,
6298
6305
  style: "p"
@@ -6303,16 +6310,16 @@ function po(e) {
6303
6310
  text: Q(n.tokens),
6304
6311
  style: "p"
6305
6312
  }) : "text" in n && typeof n.text == "string" && t.push({
6306
- text: so(n.text),
6313
+ text: co(n.text),
6307
6314
  style: "p"
6308
6315
  });
6309
6316
  }
6310
6317
  return t;
6311
6318
  }
6312
- function mo(e) {
6313
- return po(ze.lexer(e));
6319
+ function ho(e) {
6320
+ return mo(ze.lexer(e));
6314
6321
  }
6315
- function ho(e, t = (e) => e) {
6322
+ function go(e, t = (e) => e) {
6316
6323
  if (!e || typeof e != "object") return [{
6317
6324
  text: JSON.stringify(e, null, 2) ?? "",
6318
6325
  style: "code"
@@ -6344,7 +6351,7 @@ function ho(e, t = (e) => e) {
6344
6351
  style: "th"
6345
6352
  })), ...e.map((e) => t.map((t) => ({ text: e[t] === null || e[t] === void 0 ? "" : String(e[t]) })))]
6346
6353
  },
6347
- layout: fo,
6354
+ layout: po,
6348
6355
  style: "table"
6349
6356
  });
6350
6357
  } else n.push({
@@ -6353,8 +6360,8 @@ function ho(e, t = (e) => e) {
6353
6360
  });
6354
6361
  return n;
6355
6362
  }
6356
- function go(e) {
6357
- let t = e.json !== void 0 && e.json !== null ? ho(e.json, e.label) : mo(e.text ?? ""), n = e.foot ?? "";
6363
+ function _o(e) {
6364
+ let t = e.json !== void 0 && e.json !== null ? go(e.json, e.label) : ho(e.text ?? ""), n = e.foot ?? "";
6358
6365
  return {
6359
6366
  info: { title: e.title },
6360
6367
  pageSize: "A4",
@@ -6368,7 +6375,7 @@ function go(e) {
6368
6375
  font: "Roboto",
6369
6376
  fontSize: 10.5,
6370
6377
  lineHeight: 1.3,
6371
- color: to
6378
+ color: no
6372
6379
  },
6373
6380
  styles: {
6374
6381
  title: {
@@ -6437,7 +6444,7 @@ function go(e) {
6437
6444
  label: {
6438
6445
  fontSize: 8,
6439
6446
  bold: !0,
6440
- color: no,
6447
+ color: ro,
6441
6448
  characterSpacing: .6,
6442
6449
  margin: [
6443
6450
  0,
@@ -6474,12 +6481,12 @@ function go(e) {
6474
6481
  footer: (e, t) => ({
6475
6482
  columns: [{
6476
6483
  text: n,
6477
- color: no,
6484
+ color: ro,
6478
6485
  fontSize: 8.5
6479
6486
  }, {
6480
6487
  text: `${e} / ${t}`,
6481
6488
  alignment: "right",
6482
- color: no,
6489
+ color: ro,
6483
6490
  fontSize: 8.5
6484
6491
  }],
6485
6492
  margin: [
@@ -6491,80 +6498,80 @@ function go(e) {
6491
6498
  })
6492
6499
  };
6493
6500
  }
6494
- var _o = { Roboto: {
6501
+ var vo = { Roboto: {
6495
6502
  normal: "Roboto-Regular.ttf",
6496
6503
  bold: "Roboto-Medium.ttf",
6497
6504
  italics: "Roboto-Italic.ttf",
6498
6505
  bolditalics: "Roboto-MediumItalic.ttf"
6499
- } }, vo = null;
6500
- function yo() {
6501
- return vo ??= Promise.all([import("pdfmake/build/pdfmake"), import("pdfmake/build/vfs_fonts")]).then(([e, t]) => {
6506
+ } }, yo = null;
6507
+ function bo() {
6508
+ return yo ??= Promise.all([import("pdfmake/build/pdfmake"), import("pdfmake/build/vfs_fonts")]).then(([e, t]) => {
6502
6509
  let n = e.default;
6503
- return n.addVirtualFileSystem(t.default), n.addFonts(_o), n;
6510
+ return n.addVirtualFileSystem(t.default), n.addFonts(vo), n;
6504
6511
  }).catch((e) => {
6505
- throw vo = null, e;
6506
- }), vo;
6512
+ throw yo = null, e;
6513
+ }), yo;
6507
6514
  }
6508
- function bo(e) {
6515
+ function xo(e) {
6509
6516
  return e.replace(/[\\/:*?"<>|]+|\p{Cc}+/gu, "-").replace(/\s+/g, " ").trim() || "result";
6510
6517
  }
6511
- async function xo(e) {
6512
- let t = await (await yo()).createPdf(go(e)).getBlob();
6513
- return new File([t], `${bo(e.title)}.pdf`, { type: "application/pdf" });
6518
+ async function So(e) {
6519
+ let t = await (await bo()).createPdf(_o(e)).getBlob();
6520
+ return new File([t], `${xo(e.title)}.pdf`, { type: "application/pdf" });
6514
6521
  }
6515
6522
  //#endregion
6516
6523
  //#region ../runner/src/surface.tsx
6517
- var $ = (e) => e == null ? "" : typeof e == "boolean" ? V(e ? "run.yes" : "run.no") : typeof e == "object" ? JSON.stringify(e) : String(e), So = (e) => {
6524
+ var $ = (e) => e == null ? "" : typeof e == "boolean" ? V(e ? "run.yes" : "run.no") : typeof e == "object" ? JSON.stringify(e) : String(e), Co = (e) => {
6518
6525
  let t = typeof e == "number" ? e : Number(String(e ?? "").replace(",", "."));
6519
6526
  return Number.isFinite(t) ? t : 0;
6520
6527
  };
6521
- function Co(e, t) {
6528
+ function wo(e, t) {
6522
6529
  let n = $(e);
6523
6530
  return n ? /^(https?:|data:|\/)/.test(n) ? n : t(n) : null;
6524
6531
  }
6525
- function wo(e, t, n, r) {
6532
+ function To(e, t, n, r) {
6526
6533
  return R(e[t], n.data, r);
6527
6534
  }
6528
- function To(e, t, n) {
6535
+ function Eo(e, t, n) {
6529
6536
  let r = $(t) || "label", i = $(n) || "value";
6530
6537
  return Array.isArray(e) ? e.map((e) => ({
6531
6538
  label: $(e?.[r]),
6532
- value: So(e?.[i])
6539
+ value: Co(e?.[i])
6533
6540
  })) : [];
6534
6541
  }
6535
- function Eo({ c: e, ctx: t, row: n }) {
6542
+ function Do({ c: e, ctx: t, row: n }) {
6536
6543
  let r = e.children;
6537
6544
  if (!r) return null;
6538
- if (Array.isArray(r)) return /* @__PURE__ */ F(P, { children: r.map((e) => /* @__PURE__ */ F(Ho, {
6545
+ if (Array.isArray(r)) return /* @__PURE__ */ F(P, { children: r.map((e) => /* @__PURE__ */ F(Uo, {
6539
6546
  id: e,
6540
6547
  ctx: t,
6541
6548
  row: n
6542
6549
  }, e)) });
6543
6550
  let i = R({ path: r.path }, t.data, n);
6544
- return /* @__PURE__ */ F(P, { children: (Array.isArray(i) ? i : []).map((e, n) => /* @__PURE__ */ F(Ho, {
6551
+ return /* @__PURE__ */ F(P, { children: (Array.isArray(i) ? i : []).map((e, n) => /* @__PURE__ */ F(Uo, {
6545
6552
  id: r.componentId,
6546
6553
  ctx: t,
6547
6554
  row: e
6548
6555
  }, n)) });
6549
6556
  }
6550
- var Do = {
6557
+ var Oo = {
6551
6558
  success: "bg-second-tint text-second",
6552
6559
  warning: "bg-amber-tint text-ink-2",
6553
6560
  accent: "bg-ember-tint text-ember-strong",
6554
6561
  default: "bg-paper-2 text-ink-2"
6555
- }, Oo = (e) => Array.isArray(e) ? e : [];
6556
- function ko(e, t) {
6562
+ }, ko = (e) => Array.isArray(e) ? e : [];
6563
+ function Ao(e, t) {
6557
6564
  return typeof e != "object" || !e ? t === "" ? e : void 0 : e[t];
6558
6565
  }
6559
- function Ao(e, t) {
6566
+ function jo(e, t) {
6560
6567
  if (typeof e != "object" || !e) return $(e);
6561
6568
  let n = e;
6562
6569
  return $(t ? n[t] : n.label ?? n.name ?? n.title ?? n.text);
6563
6570
  }
6564
- function jo(e, t, n) {
6571
+ function Mo(e, t, n) {
6565
6572
  let r = /* @__PURE__ */ new Map();
6566
6573
  for (let n of e) {
6567
- let e = $(ko(n, t));
6574
+ let e = $(Ao(n, t));
6568
6575
  r.set(e, [...r.get(e) ?? [], n]);
6569
6576
  }
6570
6577
  let i = (e) => {
@@ -6573,8 +6580,8 @@ function jo(e, t, n) {
6573
6580
  };
6574
6581
  return [...r.entries()].sort((e, t) => i(e[0]) - i(t[0]));
6575
6582
  }
6576
- var Mo = (e) => e ? `${$(e)} ${B === "de" ? "Min" : "min"}` : "";
6577
- function No({ items: e }) {
6583
+ var No = (e) => e ? `${$(e)} ${B === "de" ? "Min" : "min"}` : "";
6584
+ function Po({ items: e }) {
6578
6585
  return e.length ? /* @__PURE__ */ F("div", {
6579
6586
  className: "flex flex-wrap gap-1.5",
6580
6587
  children: e.map((e, t) => /* @__PURE__ */ F("span", {
@@ -6583,12 +6590,12 @@ function No({ items: e }) {
6583
6590
  }, t))
6584
6591
  }) : null;
6585
6592
  }
6586
- function Po(e, t, n) {
6593
+ function Fo(e, t, n) {
6587
6594
  let r = e.meta;
6588
6595
  return (Array.isArray(r) ? r : [r]).map((e) => $(R(e, t.data, n))).filter(Boolean);
6589
6596
  }
6590
- function Fo({ c: e, ctx: t, row: n }) {
6591
- let [r, i] = M("0"), a = Oo(e.tabs), o = a.map((e, r) => {
6597
+ function Io({ c: e, ctx: t, row: n }) {
6598
+ let [r, i] = M("0"), a = ko(e.tabs), o = a.map((e, r) => {
6592
6599
  let i = R(e?.count, t.data, n), a = Array.isArray(i) ? i.length : i, o = $(R(e?.label, t.data, n));
6593
6600
  return {
6594
6601
  id: String(r),
@@ -6599,24 +6606,24 @@ function Fo({ c: e, ctx: t, row: n }) {
6599
6606
  className: "flex flex-col gap-4",
6600
6607
  children: [/* @__PURE__ */ F("div", {
6601
6608
  className: "sticky top-2 z-10 max-w-full self-start overflow-x-auto rounded-full",
6602
- children: /* @__PURE__ */ F(Pr, {
6609
+ children: /* @__PURE__ */ F(Fr, {
6603
6610
  value: r,
6604
6611
  onChange: i,
6605
6612
  options: o
6606
6613
  })
6607
- }), typeof s == "string" ? /* @__PURE__ */ F(Ho, {
6614
+ }), typeof s == "string" ? /* @__PURE__ */ F(Uo, {
6608
6615
  id: s,
6609
6616
  ctx: t,
6610
6617
  row: n
6611
6618
  }) : null]
6612
6619
  });
6613
6620
  }
6614
- function Io({ c: e, ctx: t, row: n }) {
6615
- let r = (r) => wo(e, r, t, n), [i, a] = M(!1), o = Oo(r("items")), s = $(r("labelKey")), c = $(r("detailKey")) || "amount", l = $(r("noteKey")), u = $(r("noteFormat")), d = $(r("groupKey")), f = Oo(r("groupOrder")).map($), p = t.state[e.id] ?? {}, m = (e, t) => `${t}:${Ao(e, s)}`, g = o.filter((e, t) => p[m(e, t)]).length, _ = o.map((e, t) => ({
6621
+ function Lo({ c: e, ctx: t, row: n }) {
6622
+ let r = (r) => To(e, r, t, n), [i, a] = M(!1), o = ko(r("items")), s = $(r("labelKey")), c = $(r("detailKey")) || "amount", l = $(r("noteKey")), u = $(r("noteFormat")), d = $(r("groupKey")), f = ko(r("groupOrder")).map($), p = t.state[e.id] ?? {}, m = (e, t) => `${t}:${jo(e, s)}`, g = o.filter((e, t) => p[m(e, t)]).length, _ = o.map((e, t) => ({
6616
6623
  item: e,
6617
6624
  i: t
6618
- })), v = d ? jo(o, d, f).map(([e]) => [e, _.filter(({ item: t }) => $(ko(t, d)) === e)]) : [["", _]], y = (e) => $(ko(e, c)), b = r("noteMap"), x = (e) => {
6619
- let t = l ? ko(e, l) : void 0;
6625
+ })), v = d ? Mo(o, d, f).map(([e]) => [e, _.filter(({ item: t }) => $(Ao(t, d)) === e)]) : [["", _]], y = (e) => $(Ao(e, c)), b = r("noteMap"), x = (e) => {
6626
+ let t = l ? Ao(e, l) : void 0;
6620
6627
  if (typeof t == "boolean") return $((b && typeof b == "object" ? b[String(t)] : "") ?? "");
6621
6628
  let n = Array.isArray(t) ? t.map($).join(", ") : $(t);
6622
6629
  return n && u ? u.replace("{}", n) : n;
@@ -6644,7 +6651,7 @@ function Io({ c: e, ctx: t, row: n }) {
6644
6651
  type: "button",
6645
6652
  onClick: async () => {
6646
6653
  let e = v.map(([e, t]) => {
6647
- let n = t.filter(({ item: e, i: t }) => !p[m(e, t)]).map(({ item: e }) => `☐ ${Ao(e, s)}${y(e) ? ` – ${y(e)}` : ""}`);
6654
+ let n = t.filter(({ item: e, i: t }) => !p[m(e, t)]).map(({ item: e }) => `☐ ${jo(e, s)}${y(e) ? ` – ${y(e)}` : ""}`);
6648
6655
  return n.length ? [e, ...n].filter(Boolean).join("\n") : "";
6649
6656
  }).filter(Boolean).join("\n\n");
6650
6657
  try {
@@ -6676,7 +6683,7 @@ function Io({ c: e, ctx: t, row: n }) {
6676
6683
  className: "min-w-0 flex-1",
6677
6684
  children: [/* @__PURE__ */ I("span", {
6678
6685
  className: q("text-[0.9375rem]", a && "text-ink-3 line-through"),
6679
- children: [Ao(n, s), y(n) ? /* @__PURE__ */ I("span", {
6686
+ children: [jo(n, s), y(n) ? /* @__PURE__ */ I("span", {
6680
6687
  className: "text-ink-3",
6681
6688
  children: [" · ", y(n)]
6682
6689
  }) : null]
@@ -6690,7 +6697,7 @@ function Io({ c: e, ctx: t, row: n }) {
6690
6697
  }, n))]
6691
6698
  });
6692
6699
  }
6693
- function Lo({ data: e }) {
6700
+ function Ro({ data: e }) {
6694
6701
  let t = Math.max(1, ...e.map((e) => e.value));
6695
6702
  return /* @__PURE__ */ F("div", {
6696
6703
  className: "flex flex-col gap-1.5",
@@ -6716,8 +6723,8 @@ function Lo({ data: e }) {
6716
6723
  }, n))
6717
6724
  });
6718
6725
  }
6719
- function Ro({ data: e }) {
6720
- if (e.length < 2) return /* @__PURE__ */ F(Lo, { data: e });
6726
+ function zo({ data: e }) {
6727
+ if (e.length < 2) return /* @__PURE__ */ F(Ro, { data: e });
6721
6728
  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]);
6722
6729
  return /* @__PURE__ */ I("figure", { children: [/* @__PURE__ */ I("svg", {
6723
6730
  viewBox: "0 0 320 120",
@@ -6741,14 +6748,14 @@ function Ro({ data: e }) {
6741
6748
  children: [/* @__PURE__ */ F("span", { children: e[0].label }), /* @__PURE__ */ F("span", { children: e.at(-1)?.label })]
6742
6749
  })] });
6743
6750
  }
6744
- var zo = [
6751
+ var Bo = [
6745
6752
  "var(--color-ember)",
6746
6753
  "var(--color-cobalt)",
6747
6754
  "var(--color-moss)",
6748
6755
  "var(--color-amber)",
6749
6756
  "var(--color-ink-3)"
6750
6757
  ];
6751
- function Bo({ data: e }) {
6758
+ function Vo({ data: e }) {
6752
6759
  let t = e.reduce((e, t) => e + Math.max(0, t.value), 0) || 1, n = 0, r = 2 * Math.PI * 40;
6753
6760
  return /* @__PURE__ */ I("div", {
6754
6761
  className: "flex items-center gap-4",
@@ -6762,7 +6769,7 @@ function Bo({ data: e }) {
6762
6769
  cy: "50",
6763
6770
  r: 40,
6764
6771
  fill: "none",
6765
- stroke: zo[i % zo.length],
6772
+ stroke: Bo[i % Bo.length],
6766
6773
  strokeWidth: "16",
6767
6774
  strokeDasharray: `${a} ${r - a}`,
6768
6775
  strokeDashoffset: -n,
@@ -6777,7 +6784,7 @@ function Bo({ data: e }) {
6777
6784
  children: [
6778
6785
  /* @__PURE__ */ F("span", {
6779
6786
  className: "size-2.5 rounded-full",
6780
- style: { background: zo[t % zo.length] }
6787
+ style: { background: Bo[t % Bo.length] }
6781
6788
  }),
6782
6789
  /* @__PURE__ */ F("span", {
6783
6790
  className: "text-ink-2",
@@ -6792,7 +6799,7 @@ function Bo({ data: e }) {
6792
6799
  })]
6793
6800
  });
6794
6801
  }
6795
- function Vo({ title: e, children: t }) {
6802
+ function Ho({ title: e, children: t }) {
6796
6803
  return /* @__PURE__ */ I("div", {
6797
6804
  className: "rounded-xl bg-card p-4 ring-1 ring-border-soft",
6798
6805
  children: [e ? /* @__PURE__ */ F("div", {
@@ -6801,14 +6808,14 @@ function Vo({ title: e, children: t }) {
6801
6808
  }) : null, t]
6802
6809
  });
6803
6810
  }
6804
- function Ho({ id: e, ctx: t, row: n }) {
6811
+ function Uo({ id: e, ctx: t, row: n }) {
6805
6812
  let r = t.byId.get(e);
6806
6813
  if (!r) return null;
6807
- let i = (e) => wo(r, e, t, n);
6814
+ let i = (e) => To(r, e, t, n);
6808
6815
  switch (r.component) {
6809
6816
  case "Column": return /* @__PURE__ */ F("div", {
6810
6817
  className: "flex flex-col gap-4",
6811
- children: /* @__PURE__ */ F(Eo, {
6818
+ children: /* @__PURE__ */ F(Do, {
6812
6819
  c: r,
6813
6820
  ctx: t,
6814
6821
  row: n
@@ -6823,14 +6830,14 @@ function Ho({ id: e, ctx: t, row: n }) {
6823
6830
  }
6824
6831
  case "List": return /* @__PURE__ */ F("div", {
6825
6832
  className: "flex flex-col divide-y divide-border-soft overflow-hidden rounded-xl bg-card ring-1 ring-border-soft",
6826
- children: /* @__PURE__ */ F(Eo, {
6833
+ children: /* @__PURE__ */ F(Do, {
6827
6834
  c: r,
6828
6835
  ctx: t,
6829
6836
  row: n
6830
6837
  })
6831
6838
  });
6832
6839
  case "Row": {
6833
- let e = Co(i("image"), t.assetUrl), n = $(i("badge"));
6840
+ let e = wo(i("image"), t.assetUrl), n = $(i("badge"));
6834
6841
  return /* @__PURE__ */ I("div", {
6835
6842
  className: "flex items-center gap-3 px-4 py-3",
6836
6843
  children: [
@@ -6854,7 +6861,7 @@ function Ho({ id: e, ctx: t, row: n }) {
6854
6861
  children: $(i("meta"))
6855
6862
  }) : null,
6856
6863
  n ? /* @__PURE__ */ F("span", {
6857
- className: q("shrink-0 rounded-full px-2 py-0.5 text-[0.75rem]", Do[$(i("badgeTone"))] ?? Do.default),
6864
+ className: q("shrink-0 rounded-full px-2 py-0.5 text-[0.75rem]", Oo[$(i("badgeTone"))] ?? Oo.default),
6858
6865
  children: n
6859
6866
  }) : null
6860
6867
  ]
@@ -6877,15 +6884,15 @@ function Ho({ id: e, ctx: t, row: n }) {
6877
6884
  });
6878
6885
  }
6879
6886
  case "Badge": return /* @__PURE__ */ F("span", {
6880
- className: q("inline-flex w-fit rounded-full px-2.5 py-0.5 text-[0.75rem]", Do[$(i("tone"))] ?? Do.default),
6887
+ className: q("inline-flex w-fit rounded-full px-2.5 py-0.5 text-[0.75rem]", Oo[$(i("tone"))] ?? Oo.default),
6881
6888
  children: $(i("label"))
6882
6889
  });
6883
6890
  case "Grid": {
6884
- let e = Math.min(4, Math.max(1, So(i("columns")) || 2)), a = Math.min(24, Math.max(6, So(i("min")) || (e > 2 ? 9 : 12)));
6891
+ let e = Math.min(4, Math.max(1, Co(i("columns")) || 2)), a = Math.min(24, Math.max(6, Co(i("min")) || (e > 2 ? 9 : 12)));
6885
6892
  return /* @__PURE__ */ F("div", {
6886
6893
  className: "grid gap-3",
6887
6894
  style: { gridTemplateColumns: `repeat(auto-fit, minmax(min(100%, ${a}rem), 1fr))` },
6888
- children: /* @__PURE__ */ F(Eo, {
6895
+ children: /* @__PURE__ */ F(Do, {
6889
6896
  c: r,
6890
6897
  ctx: t,
6891
6898
  row: n
@@ -6938,28 +6945,28 @@ function Ho({ id: e, ctx: t, row: n }) {
6938
6945
  });
6939
6946
  }
6940
6947
  case "Image": {
6941
- let e = Co(i("src"), t.assetUrl);
6948
+ let e = wo(i("src"), t.assetUrl);
6942
6949
  return e ? /* @__PURE__ */ F("img", {
6943
6950
  src: e,
6944
6951
  alt: $(i("alt")),
6945
6952
  className: "w-full rounded-xl"
6946
6953
  }) : null;
6947
6954
  }
6948
- case "BarChart": return /* @__PURE__ */ F(Vo, {
6955
+ case "BarChart": return /* @__PURE__ */ F(Ho, {
6949
6956
  title: $(i("title")),
6950
- children: /* @__PURE__ */ F(Lo, { data: To(i("points"), i("labelKey"), i("valueKey")) })
6957
+ children: /* @__PURE__ */ F(Ro, { data: Eo(i("points"), i("labelKey"), i("valueKey")) })
6951
6958
  });
6952
- case "LineChart": return /* @__PURE__ */ F(Vo, {
6959
+ case "LineChart": return /* @__PURE__ */ F(Ho, {
6953
6960
  title: $(i("title")),
6954
- children: /* @__PURE__ */ F(Ro, { data: To(i("points"), i("labelKey"), i("valueKey")) })
6961
+ children: /* @__PURE__ */ F(zo, { data: Eo(i("points"), i("labelKey"), i("valueKey")) })
6955
6962
  });
6956
- case "DonutChart": return /* @__PURE__ */ F(Vo, {
6963
+ case "DonutChart": return /* @__PURE__ */ F(Ho, {
6957
6964
  title: $(i("title")),
6958
- children: /* @__PURE__ */ F(Bo, { data: To(i("slices"), i("labelKey"), i("valueKey")) })
6965
+ children: /* @__PURE__ */ F(Vo, { data: Eo(i("slices"), i("labelKey"), i("valueKey")) })
6959
6966
  });
6960
6967
  case "Actions": return /* @__PURE__ */ F("div", {
6961
6968
  className: "flex flex-wrap gap-2",
6962
- children: /* @__PURE__ */ F(Eo, {
6969
+ children: /* @__PURE__ */ F(Do, {
6963
6970
  c: r,
6964
6971
  ctx: t,
6965
6972
  row: n
@@ -6972,7 +6979,7 @@ function Ho({ id: e, ctx: t, row: n }) {
6972
6979
  onClick: () => {
6973
6980
  let n = i("target");
6974
6981
  if (e === "open") {
6975
- let e = Co(n, t.assetUrl);
6982
+ let e = wo(n, t.assetUrl);
6976
6983
  e && window.open(e, "_blank", "noopener");
6977
6984
  return;
6978
6985
  }
@@ -6985,13 +6992,13 @@ function Ho({ id: e, ctx: t, row: n }) {
6985
6992
  children: $(i("label"))
6986
6993
  });
6987
6994
  }
6988
- case "Tabs": return /* @__PURE__ */ F(Fo, {
6995
+ case "Tabs": return /* @__PURE__ */ F(Io, {
6989
6996
  c: r,
6990
6997
  ctx: t,
6991
6998
  row: n
6992
6999
  });
6993
7000
  case "Card": {
6994
- let e = Co(i("image"), t.assetUrl), a = $(i("eyebrow")), o = $(i("subtitle"));
7001
+ let e = wo(i("image"), t.assetUrl), a = $(i("eyebrow")), o = $(i("subtitle"));
6995
7002
  return /* @__PURE__ */ I("article", {
6996
7003
  className: "overflow-hidden rounded-xl bg-card ring-1 ring-border-soft",
6997
7004
  children: [
@@ -7015,12 +7022,12 @@ function Ho({ id: e, ctx: t, row: n }) {
7015
7022
  className: "text-[0.875rem] text-ink-3 leading-relaxed",
7016
7023
  children: o
7017
7024
  }) : null,
7018
- /* @__PURE__ */ F(No, { items: Po(r, t, n) })
7025
+ /* @__PURE__ */ F(Po, { items: Fo(r, t, n) })
7019
7026
  ]
7020
7027
  }),
7021
7028
  r.children ? /* @__PURE__ */ F("div", {
7022
7029
  className: "flex flex-col gap-3 border-border-soft border-t px-4 py-3.5 empty:hidden",
7023
- children: /* @__PURE__ */ F(Eo, {
7030
+ children: /* @__PURE__ */ F(Do, {
7024
7031
  c: r,
7025
7032
  ctx: t,
7026
7033
  row: n
@@ -7037,7 +7044,7 @@ function Ho({ id: e, ctx: t, row: n }) {
7037
7044
  children: [$(i("title")), /* @__PURE__ */ F(g, { className: "size-4 text-ink-3 transition-transform group-open:rotate-90 motion-reduce:transition-none" })]
7038
7045
  }), /* @__PURE__ */ F("div", {
7039
7046
  className: "flex flex-col gap-3 pt-3",
7040
- children: /* @__PURE__ */ F(Eo, {
7047
+ children: /* @__PURE__ */ F(Do, {
7041
7048
  c: r,
7042
7049
  ctx: t,
7043
7050
  row: n
@@ -7047,15 +7054,15 @@ function Ho({ id: e, ctx: t, row: n }) {
7047
7054
  case "Group": {
7048
7055
  let e = r.children;
7049
7056
  if (!e || Array.isArray(e)) return null;
7050
- let a = Oo(R({ path: e.path }, t.data, n));
7057
+ let a = ko(R({ path: e.path }, t.data, n));
7051
7058
  return /* @__PURE__ */ F("div", {
7052
7059
  className: "flex flex-col gap-5",
7053
- children: jo(a, $(i("by")), Oo(i("order")).map($)).map(([n, r]) => /* @__PURE__ */ I("section", {
7060
+ children: Mo(a, $(i("by")), ko(i("order")).map($)).map(([n, r]) => /* @__PURE__ */ I("section", {
7054
7061
  className: "flex flex-col gap-2",
7055
7062
  children: [n ? /* @__PURE__ */ F("h4", {
7056
7063
  className: "font-semibold text-[0.6875rem] text-second uppercase tracking-[0.14em]",
7057
7064
  children: n
7058
- }) : null, r.map((n, r) => /* @__PURE__ */ F(Ho, {
7065
+ }) : null, r.map((n, r) => /* @__PURE__ */ F(Uo, {
7059
7066
  id: e.componentId,
7060
7067
  ctx: t,
7061
7068
  row: n
@@ -7072,17 +7079,17 @@ function Ho({ id: e, ctx: t, row: n }) {
7072
7079
  children: r
7073
7080
  }) : null, /* @__PURE__ */ F("div", {
7074
7081
  className: "flex flex-wrap gap-1.5",
7075
- children: Oo(i("items")).map((r, i) => {
7076
- let a = !!(t && ko(r, t));
7082
+ children: ko(i("items")).map((r, i) => {
7083
+ let a = !!(t && Ao(r, t));
7077
7084
  return /* @__PURE__ */ I("span", {
7078
7085
  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"),
7079
- children: [Ao(r, e), a && n ? ` · ${n}` : ""]
7086
+ children: [jo(r, e), a && n ? ` · ${n}` : ""]
7080
7087
  }, i);
7081
7088
  })
7082
7089
  })]
7083
7090
  });
7084
7091
  }
7085
- case "Checklist": return /* @__PURE__ */ F(Io, {
7092
+ case "Checklist": return /* @__PURE__ */ F(Lo, {
7086
7093
  c: r,
7087
7094
  ctx: t,
7088
7095
  row: n
@@ -7091,8 +7098,8 @@ function Ho({ id: e, ctx: t, row: n }) {
7091
7098
  let e = $(i("textKey")) || "text", t = $(i("minutesKey")) || "minutes";
7092
7099
  return /* @__PURE__ */ F("ol", {
7093
7100
  className: "flex flex-col gap-3",
7094
- children: Oo(i("items")).map((n, r) => {
7095
- let i = $(typeof n == "object" ? ko(n, e) : n), a = Mo(ko(n, t));
7101
+ children: ko(i("items")).map((n, r) => {
7102
+ let i = $(typeof n == "object" ? Ao(n, e) : n), a = No(Ao(n, t));
7096
7103
  return /* @__PURE__ */ I("li", {
7097
7104
  className: "grid grid-cols-[1.5rem_1fr] gap-2",
7098
7105
  children: [/* @__PURE__ */ F("span", {
@@ -7110,9 +7117,9 @@ function Ho({ id: e, ctx: t, row: n }) {
7110
7117
  });
7111
7118
  }
7112
7119
  case "Link": {
7113
- let e = $(i("key")) || "id", n = $(i("value")), a = Oo(i("items")).find((t) => $(ko(t, e)) === n), o = r.view;
7120
+ let e = $(i("key")) || "id", n = $(i("value")), a = ko(i("items")).find((t) => $(Ao(t, e)) === n), o = r.view;
7114
7121
  if (a === void 0) return null;
7115
- let s = (e) => R(r[e], t.data, a), c = $(i("eyebrow")), l = Po(r, t, a);
7122
+ let s = (e) => R(r[e], t.data, a), c = $(i("eyebrow")), l = Fo(r, t, a);
7116
7123
  return /* @__PURE__ */ I("button", {
7117
7124
  type: "button",
7118
7125
  onClick: () => typeof o == "string" && t.open(o, a),
@@ -7153,7 +7160,7 @@ function Ho({ id: e, ctx: t, row: n }) {
7153
7160
  }
7154
7161
  return null;
7155
7162
  }
7156
- function Uo({ surface: e, assetUrl: t, onAction: n, initial: r, onState: i }) {
7163
+ function Wo({ surface: e, assetUrl: t, onAction: n, initial: r, onState: i }) {
7157
7164
  let [a, o] = M(r ?? {}), [s, c] = M(null), l = {
7158
7165
  byId: new Map(e.components.map((e) => [e.id, e])),
7159
7166
  data: e.data,
@@ -7172,16 +7179,16 @@ function Uo({ surface: e, assetUrl: t, onAction: n, initial: r, onState: i }) {
7172
7179
  row: t
7173
7180
  })
7174
7181
  };
7175
- return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Ho, {
7182
+ return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Uo, {
7176
7183
  id: "root",
7177
7184
  ctx: l
7178
- }), /* @__PURE__ */ F(zr, {
7185
+ }), /* @__PURE__ */ F(Br, {
7179
7186
  open: s !== null,
7180
7187
  onClose: () => c(null),
7181
7188
  height: "tall",
7182
7189
  children: s ? /* @__PURE__ */ I("div", {
7183
7190
  className: "flex flex-col gap-4",
7184
- children: [/* @__PURE__ */ F(Ho, {
7191
+ children: [/* @__PURE__ */ F(Uo, {
7185
7192
  id: s.view,
7186
7193
  ctx: l,
7187
7194
  row: s.row
@@ -7196,14 +7203,14 @@ function Uo({ surface: e, assetUrl: t, onAction: n, initial: r, onState: i }) {
7196
7203
  }
7197
7204
  //#endregion
7198
7205
  //#region ../runner/src/outputs.tsx
7199
- function Wo({ text: e, className: t }) {
7206
+ function Go({ text: e, className: t }) {
7200
7207
  let n = Ie(() => Re.sanitize(ze.parse(e, { async: !1 })), [e]);
7201
7208
  return /* @__PURE__ */ F("div", {
7202
7209
  className: q("prose-zen", t),
7203
7210
  dangerouslySetInnerHTML: { __html: n }
7204
7211
  });
7205
7212
  }
7206
- function Go({ src: e, page: t, height: n, fit: r, flow: i, state: a, onState: o }) {
7213
+ function Ko({ src: e, page: t, height: n, fit: r, flow: i, state: a, onState: o }) {
7207
7214
  let s = j(null), [c, l] = M(n), [u] = M(() => a ?? {}), d = j(o);
7208
7215
  d.current = o, A(() => {
7209
7216
  let e = (e) => {
@@ -7261,7 +7268,7 @@ function Go({ src: e, page: t, height: n, fit: r, flow: i, state: a, onState: o
7261
7268
  })]
7262
7269
  });
7263
7270
  }
7264
- var Ko = {
7271
+ var qo = {
7265
7272
  disc: {
7266
7273
  file: "ai",
7267
7274
  box: 566.93,
@@ -7287,10 +7294,10 @@ var Ko = {
7287
7294
  h: 266.41
7288
7295
  }
7289
7296
  };
7290
- function qo({ icon: e, tone: t, size: n, className: r }) {
7291
- let i = Ko[e], a = n / i.h;
7297
+ function Jo({ icon: e, tone: t, size: n, className: r }) {
7298
+ let i = qo[e], a = n / i.h;
7292
7299
  return /* @__PURE__ */ F("img", {
7293
- src: xr(`ai-labels/${i.file}-${t}.svg`),
7300
+ src: Sr(`ai-labels/${i.file}-${t}.svg`),
7294
7301
  alt: "",
7295
7302
  draggable: !1,
7296
7303
  className: q("pointer-events-none absolute max-w-none select-none", r),
@@ -7302,10 +7309,10 @@ function qo({ icon: e, tone: t, size: n, className: r }) {
7302
7309
  }
7303
7310
  });
7304
7311
  }
7305
- function Jo({ ai: e, className: t }) {
7312
+ function Yo({ ai: e, className: t }) {
7306
7313
  let [n, r] = M(!1);
7307
7314
  if (!e) return null;
7308
- let i = Ko[e], a = t === "static", o = a ? [["black", "dark:hidden"], ["white", "hidden dark:block"]] : [["white", ""]];
7315
+ let i = qo[e], a = t === "static", o = a ? [["black", "dark:hidden"], ["white", "hidden dark:block"]] : [["white", ""]];
7309
7316
  return /* @__PURE__ */ F("button", {
7310
7317
  type: "button",
7311
7318
  "aria-label": V(e === "edited" ? "ai.modified" : "ai.generated"),
@@ -7320,12 +7327,12 @@ function Jo({ ai: e, className: t }) {
7320
7327
  },
7321
7328
  children: o.map(([t, r]) => /* @__PURE__ */ I("span", {
7322
7329
  className: r,
7323
- children: [/* @__PURE__ */ F(qo, {
7330
+ children: [/* @__PURE__ */ F(Jo, {
7324
7331
  icon: "disc",
7325
7332
  tone: t,
7326
7333
  size: 18,
7327
7334
  className: q("transition-opacity duration-200", n ? "opacity-0" : "opacity-100 group-hover:opacity-0 group-focus-visible:opacity-0")
7328
- }), /* @__PURE__ */ F(qo, {
7335
+ }), /* @__PURE__ */ F(Jo, {
7329
7336
  icon: e,
7330
7337
  tone: t,
7331
7338
  size: 18,
@@ -7334,11 +7341,11 @@ function Jo({ ai: e, className: t }) {
7334
7341
  }, t))
7335
7342
  });
7336
7343
  }
7337
- function Yo(e, t) {
7338
- let n = e.type === "agent" ? Mn(e).fields[t] : void 0;
7344
+ function Xo(e, t) {
7345
+ let n = e.type === "agent" ? Nn(e).fields[t] : void 0;
7339
7346
  return n ? L(t, n) : t;
7340
7347
  }
7341
- function Xo({ text: e }) {
7348
+ function Zo({ text: e }) {
7342
7349
  let [t, n] = M(!1);
7343
7350
  return /* @__PURE__ */ I("button", {
7344
7351
  type: "button",
@@ -7349,10 +7356,10 @@ function Xo({ text: e }) {
7349
7356
  children: [F(t ? h : v, { className: "size-3.5" }), V(t ? "share.copied" : "run.copy")]
7350
7357
  });
7351
7358
  }
7352
- function Zo({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, picked: o, onPick: s, onSurfaceAction: c, onView: l }) {
7359
+ function Qo({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, picked: o, onPick: s, onSurfaceAction: c, onView: l }) {
7353
7360
  if (!n) return null;
7354
7361
  let u = (t) => W(`${e}/assets/${t}`);
7355
- if (n.surface) return /* @__PURE__ */ F(Uo, {
7362
+ if (n.surface) return /* @__PURE__ */ F(Wo, {
7356
7363
  surface: n.surface,
7357
7364
  assetUrl: u,
7358
7365
  onAction: c,
@@ -7370,14 +7377,14 @@ function Zo({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
7370
7377
  controls: !0,
7371
7378
  playsInline: !0,
7372
7379
  className: q("rounded-lg bg-black ring-1 ring-border-soft", i ? "max-h-[76vh]" : "w-full")
7373
- }), /* @__PURE__ */ F(Jo, {
7380
+ }), /* @__PURE__ */ F(Yo, {
7374
7381
  ai: e.ai,
7375
7382
  className: "top-2 right-2"
7376
7383
  })]
7377
7384
  });
7378
7385
  return t.type === "film" && n.text ? /* @__PURE__ */ I("div", {
7379
7386
  className: "flex flex-col gap-4",
7380
- children: [a, /* @__PURE__ */ F(Wo, {
7387
+ children: [a, /* @__PURE__ */ F(Go, {
7381
7388
  text: n.text,
7382
7389
  className: "text-[0.875rem] text-ink-2"
7383
7390
  })]
@@ -7388,7 +7395,7 @@ function Zo({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
7388
7395
  width: 1280,
7389
7396
  height: 720
7390
7397
  };
7391
- return r ? /* @__PURE__ */ F(Go, {
7398
+ return r ? /* @__PURE__ */ F(Ko, {
7392
7399
  src: u(r.id),
7393
7400
  page: i.width,
7394
7401
  height: i.height,
@@ -7409,7 +7416,7 @@ function Zo({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
7409
7416
  controls: !0,
7410
7417
  className: "w-full"
7411
7418
  }),
7412
- /* @__PURE__ */ F(Jo, {
7419
+ /* @__PURE__ */ F(Yo, {
7413
7420
  ai: e.ai,
7414
7421
  className: "static"
7415
7422
  }),
@@ -7449,7 +7456,7 @@ function Zo({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
7449
7456
  className: "absolute top-2 left-2 rounded-full bg-card/90 px-2.5 py-1 font-medium text-[0.75rem] text-ink-2",
7450
7457
  children: n + 1
7451
7458
  }),
7452
- /* @__PURE__ */ F(Jo, {
7459
+ /* @__PURE__ */ F(Yo, {
7453
7460
  ai: e.ai,
7454
7461
  className: t.asset === "image" ? "bottom-2 left-2" : "top-2 right-2"
7455
7462
  })
@@ -7464,7 +7471,7 @@ function Zo({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
7464
7471
  src: u(e.id),
7465
7472
  alt: t.title,
7466
7473
  className: "w-full rounded-lg bg-paper-2 ring-1 ring-border-soft"
7467
- }), /* @__PURE__ */ F(Jo, { ai: e.ai })]
7474
+ }), /* @__PURE__ */ F(Yo, { ai: e.ai })]
7468
7475
  });
7469
7476
  if (t.asset === "video") {
7470
7477
  let n = t.options?.aspectRatio === "9:16";
@@ -7476,17 +7483,17 @@ function Zo({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
7476
7483
  playsInline: !0,
7477
7484
  loop: !0,
7478
7485
  className: q("rounded-lg bg-black ring-1 ring-border-soft", n ? "max-h-[70vh]" : "w-full")
7479
- }), /* @__PURE__ */ F(Jo, {
7486
+ }), /* @__PURE__ */ F(Yo, {
7480
7487
  ai: e.ai,
7481
7488
  className: "top-2 left-2"
7482
7489
  })]
7483
7490
  });
7484
7491
  }
7485
- return t.asset === "document" ? /* @__PURE__ */ F(Go, {
7492
+ return t.asset === "document" ? /* @__PURE__ */ F(Ko, {
7486
7493
  src: u(e.id),
7487
7494
  page: 820,
7488
7495
  height: 1100
7489
- }) : /* @__PURE__ */ F(Go, {
7496
+ }) : /* @__PURE__ */ F(Ko, {
7490
7497
  src: u(e.id),
7491
7498
  page: null,
7492
7499
  height: 760
@@ -7497,15 +7504,15 @@ function Zo({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
7497
7504
  return /* @__PURE__ */ I("div", {
7498
7505
  className: "flex flex-col gap-4",
7499
7506
  children: [
7500
- t.output.format === "json" && n.json !== void 0 ? /* @__PURE__ */ F(eo, {
7507
+ t.output.format === "json" && n.json !== void 0 ? /* @__PURE__ */ F(to, {
7501
7508
  step: t,
7502
7509
  json: n.json
7503
- }) : r ? /* @__PURE__ */ F(Ar, {
7510
+ }) : r ? /* @__PURE__ */ F(jr, {
7504
7511
  value: i ?? n.text ?? "",
7505
7512
  onChange: (e) => a?.(e.target.value),
7506
7513
  minRows: 4,
7507
7514
  maxRows: 24
7508
- }) : t.output.format === "markdown" ? /* @__PURE__ */ F(Wo, { text: n.text ?? "" }) : /* @__PURE__ */ F("div", {
7515
+ }) : t.output.format === "markdown" ? /* @__PURE__ */ F(Go, { text: n.text ?? "" }) : /* @__PURE__ */ F("div", {
7509
7516
  className: "whitespace-pre-wrap text-[1rem] leading-relaxed",
7510
7517
  children: n.text
7511
7518
  }),
@@ -7515,7 +7522,7 @@ function Zo({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
7515
7522
  src: u(e.id),
7516
7523
  alt: "",
7517
7524
  className: "w-full rounded-lg ring-1 ring-border-soft"
7518
- }), /* @__PURE__ */ F(Jo, { ai: e.ai })]
7525
+ }), /* @__PURE__ */ F(Yo, { ai: e.ai })]
7519
7526
  }, e.id)),
7520
7527
  o.length ? /* @__PURE__ */ F("ul", {
7521
7528
  className: "overflow-hidden rounded-lg ring-1 ring-border-soft",
@@ -7524,7 +7531,7 @@ function Zo({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
7524
7531
  children: /* @__PURE__ */ I("a", {
7525
7532
  href: u(e.id),
7526
7533
  download: e.name,
7527
- onClick: (t) => wr(t, u(e.id), e.name),
7534
+ onClick: (t) => Tr(t, u(e.id), e.name),
7528
7535
  className: "flex items-center gap-2 px-3 py-2 text-[0.8125rem] hover:bg-paper-2 coarse:min-h-11",
7529
7536
  children: [/* @__PURE__ */ F(T, { className: "size-3.5 shrink-0 text-ink-3" }), /* @__PURE__ */ F("span", {
7530
7537
  className: "min-w-0 flex-1 truncate",
@@ -7533,13 +7540,13 @@ function Zo({ base: e, step: t, output: n, editable: r, draft: i, onDraft: a, pi
7533
7540
  })
7534
7541
  }, e.id))
7535
7542
  }) : null,
7536
- t.output.format !== "json" && !r && n.text ? /* @__PURE__ */ F("div", { children: /* @__PURE__ */ F(Xo, { text: n.text }) }) : null
7543
+ t.output.format !== "json" && !r && n.text ? /* @__PURE__ */ F("div", { children: /* @__PURE__ */ F(Zo, { text: n.text }) }) : null
7537
7544
  ]
7538
7545
  });
7539
7546
  }
7540
7547
  return null;
7541
7548
  }
7542
- var Qo = {
7549
+ var $o = {
7543
7550
  png: "PNG",
7544
7551
  mp4: "MP4",
7545
7552
  mp3: "MP3",
@@ -7553,17 +7560,17 @@ var Qo = {
7553
7560
  json: "JSON",
7554
7561
  zip: "ZIP"
7555
7562
  };
7556
- function $o(e, t) {
7563
+ function es(e, t) {
7557
7564
  return (e.headers.get("content-disposition") ?? "").match(/filename="([^"]+)"/)?.[1] ?? t;
7558
7565
  }
7559
- function es(e) {
7566
+ function ts(e) {
7560
7567
  let t = URL.createObjectURL(e), n = document.createElement("a");
7561
7568
  n.href = t, n.download = e.name, n.rel = "noopener", document.body.append(n), n.click(), n.remove(), setTimeout(() => URL.revokeObjectURL(t), 6e4);
7562
7569
  }
7563
- function ts({ url: e, format: t, title: n, make: r }) {
7570
+ function ns({ url: e, format: t, title: n, make: r }) {
7564
7571
  let [i, a] = M("idle"), o = j(null), s = async () => {
7565
7572
  if (K("share") && !r) {
7566
- a("busy"), await Sr("share", {
7573
+ a("busy"), await Cr("share", {
7567
7574
  url: new URL(e, location.href).href,
7568
7575
  title: n
7569
7576
  }).catch(() => void 0), a("idle");
@@ -7576,7 +7583,7 @@ function ts({ url: e, format: t, title: n, make: r }) {
7576
7583
  let n = await fetch(e, { credentials: "include" });
7577
7584
  if (!n.ok) throw Error(String(n.status));
7578
7585
  let r = await n.blob();
7579
- o.current = new File([r], $o(n, `download.${t}`), { type: r.type.split(";")[0] });
7586
+ o.current = new File([r], es(n, `download.${t}`), { type: r.type.split(";")[0] });
7580
7587
  }
7581
7588
  }
7582
7589
  let i = {
@@ -7584,7 +7591,7 @@ function ts({ url: e, format: t, title: n, make: r }) {
7584
7591
  title: n
7585
7592
  };
7586
7593
  if (!navigator.canShare(i)) {
7587
- r ? es(o.current) : location.href = e, a("idle");
7594
+ r ? ts(o.current) : location.href = e, a("idle");
7588
7595
  return;
7589
7596
  }
7590
7597
  await navigator.share(i), a("idle");
@@ -7599,24 +7606,24 @@ function ts({ url: e, format: t, title: n, make: r }) {
7599
7606
  "aria-label": V("run.shareFile"),
7600
7607
  title: V("run.shareFile"),
7601
7608
  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"),
7602
- children: [F(i === "busy" ? Lr : xe, { className: "size-3.5" }), V(i === "ready" ? "run.shareNow" : "run.share")]
7609
+ children: [F(i === "busy" ? Rr : xe, { className: "size-3.5" }), V(i === "ready" ? "run.shareNow" : "run.share")]
7603
7610
  });
7604
7611
  }
7605
- var ns = K("share") || di();
7606
- function rs({ base: e, stepId: t, formats: n, title: r, step: i, output: a, foot: o }) {
7607
- let s = (n) => W(`${e}/steps/${t}/download?format=${n}`), [c, l] = M(!1), u = j(null), d = Tr() && i?.type === "agent" && a && (a.text || a.json !== void 0) ? {
7612
+ var rs = K("share") || fi();
7613
+ function is({ base: e, stepId: t, formats: n, title: r, step: i, output: a, foot: o }) {
7614
+ let s = (n) => W(`${e}/steps/${t}/download?format=${n}`), [c, l] = M(!1), u = j(null), d = Er() && i?.type === "agent" && a && (a.text || a.json !== void 0) ? {
7608
7615
  title: r ?? i.title,
7609
7616
  text: a.text,
7610
7617
  json: i.output.format === "json" ? a.json : void 0,
7611
- label: (e) => Yo(i, e),
7618
+ label: (e) => Xo(i, e),
7612
7619
  foot: o
7613
7620
  } : null, f = async () => {
7614
7621
  if (!d) throw Error("nothing written");
7615
- return u.current ??= await xo(d), u.current;
7622
+ return u.current ??= await So(d), u.current;
7616
7623
  }, p = async () => {
7617
7624
  l(!0);
7618
7625
  try {
7619
- es(await f());
7626
+ ts(await f());
7620
7627
  } catch (e) {
7621
7628
  console.warn(`pdf: ${e.message}`), n.includes("html") && window.open(s("html"), "_blank", "noopener");
7622
7629
  } finally {
@@ -7630,8 +7637,8 @@ function rs({ base: e, stepId: t, formats: n, title: r, step: i, output: a, foot
7630
7637
  onClick: () => void p(),
7631
7638
  disabled: c,
7632
7639
  className: m(t),
7633
- children: [c ? /* @__PURE__ */ F(Lr, { className: "size-3.5" }) : t === 0 ? /* @__PURE__ */ F(x, { className: "size-3.5" }) : null, Qo[e]]
7634
- }, e) : e === "html" && Tr() ? /* @__PURE__ */ I("a", {
7640
+ children: [c ? /* @__PURE__ */ F(Rr, { className: "size-3.5" }) : t === 0 ? /* @__PURE__ */ F(x, { className: "size-3.5" }) : null, $o[e]]
7641
+ }, e) : e === "html" && Er() ? /* @__PURE__ */ I("a", {
7635
7642
  href: s(e),
7636
7643
  target: "_blank",
7637
7644
  rel: "noopener",
@@ -7639,10 +7646,10 @@ function rs({ base: e, stepId: t, formats: n, title: r, step: i, output: a, foot
7639
7646
  children: [t === 0 ? /* @__PURE__ */ F(_e, { className: "size-3.5" }) : null, V("run.print")]
7640
7647
  }, e) : /* @__PURE__ */ I("a", {
7641
7648
  href: s(e),
7642
- onClick: (t) => wr(t, s(e)),
7649
+ onClick: (t) => Tr(t, s(e)),
7643
7650
  className: m(t),
7644
- children: [t === 0 ? /* @__PURE__ */ F(x, { className: "size-3.5" }) : null, Qo[e]]
7645
- }, e)), ns && n.length ? /* @__PURE__ */ F(ts, {
7651
+ children: [t === 0 ? /* @__PURE__ */ F(x, { className: "size-3.5" }) : null, $o[e]]
7652
+ }, e)), rs && n.length ? /* @__PURE__ */ F(ns, {
7646
7653
  url: s(n[0]),
7647
7654
  format: n[0],
7648
7655
  title: r,
@@ -7652,7 +7659,7 @@ function rs({ base: e, stepId: t, formats: n, title: r, step: i, output: a, foot
7652
7659
  }
7653
7660
  //#endregion
7654
7661
  //#region ../runner/src/RunnerView.tsx
7655
- function is({ view: e }) {
7662
+ function as({ view: e }) {
7656
7663
  let t = Math.round(Math.min(e.progress.done, e.progress.total) / Math.max(1, e.progress.total) * 100);
7657
7664
  return /* @__PURE__ */ F("div", {
7658
7665
  className: "h-[3px] w-full bg-paper-2",
@@ -7662,10 +7669,10 @@ function is({ view: e }) {
7662
7669
  })
7663
7670
  });
7664
7671
  }
7665
- var as = (e, t) => (n) => {
7672
+ var os = (e, t) => (n) => {
7666
7673
  U.put(`${G(e)}/views/${t}`, { state: n }).catch(() => void 0);
7667
7674
  };
7668
- function os({ title: e, description: t, kicker: n }) {
7675
+ function ss({ title: e, description: t, kicker: n }) {
7669
7676
  return /* @__PURE__ */ I("div", {
7670
7677
  className: "kb-title mb-8",
7671
7678
  children: [
@@ -7684,16 +7691,16 @@ function os({ title: e, description: t, kicker: n }) {
7684
7691
  ]
7685
7692
  });
7686
7693
  }
7687
- function ss(e, t) {
7694
+ function cs(e, t) {
7688
7695
  let n = {};
7689
7696
  for (let r of e.fields) n[r.id] = t.values[r.id] ?? t.prefill?.[r.id] ?? r.default ?? (r.kind === "multiselect" ? [] : void 0);
7690
7697
  return n;
7691
7698
  }
7692
- function cs(e) {
7699
+ function ls(e) {
7693
7700
  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);
7694
7701
  }
7695
- function ls({ view: e, run: t, step: n }) {
7696
- let [r, i] = M(() => ss(n, e)), [a, o] = M(/* @__PURE__ */ new Set()), s = j(null), c = e.progress.done === 0, u = Bn(Ie(() => n.fields.filter((t) => !zn(t) || e.decidedFields?.includes(t.id)).map((t) => e.options?.[t.id]?.length ? {
7702
+ function us({ view: e, run: t, step: n }) {
7703
+ let [r, i] = M(() => cs(n, e)), [a, o] = M(/* @__PURE__ */ new Set()), s = j(null), c = e.progress.done === 0, u = Vn(Ie(() => n.fields.filter((t) => !Bn(t) || e.decidedFields?.includes(t.id)).map((t) => e.options?.[t.id]?.length ? {
7697
7704
  ...t,
7698
7705
  options: e.options[t.id]
7699
7706
  } : t), [
@@ -7703,7 +7710,7 @@ function ls({ view: e, run: t, step: n }) {
7703
7710
  ]), e.known ?? {}, r), d = () => void t.submitPage(n.id, r);
7704
7711
  return A(() => {
7705
7712
  if (!s.current) return;
7706
- let e = cs(s.current).filter((e) => e instanceof HTMLInputElement);
7713
+ let e = ls(s.current).filter((e) => e instanceof HTMLInputElement);
7707
7714
  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"));
7708
7715
  }), /* @__PURE__ */ I("form", {
7709
7716
  ref: s,
@@ -7714,18 +7721,18 @@ function ls({ view: e, run: t, step: n }) {
7714
7721
  onKeyDown: (e) => {
7715
7722
  let t = e.target;
7716
7723
  if (e.key !== "Enter" || e.defaultPrevented || e.nativeEvent.isComposing || !(t instanceof HTMLInputElement) || t.closest("dialog")) return;
7717
- let n = cs(e.currentTarget), r = n[n.indexOf(t) + 1];
7724
+ let n = ls(e.currentTarget), r = n[n.indexOf(t) + 1];
7718
7725
  r && (e.preventDefault(), r.focus());
7719
7726
  },
7720
7727
  children: [
7721
- /* @__PURE__ */ F(os, {
7728
+ /* @__PURE__ */ F(ss, {
7722
7729
  title: n.title,
7723
7730
  description: n.description,
7724
7731
  kicker: c ? e.wizard.intro : null
7725
7732
  }),
7726
7733
  /* @__PURE__ */ F("div", {
7727
7734
  className: "flex flex-col gap-7",
7728
- children: u.map((n) => /* @__PURE__ */ F(za, {
7735
+ children: u.map((n) => /* @__PURE__ */ F(Ba, {
7729
7736
  field: n,
7730
7737
  value: r[n.id],
7731
7738
  values: r,
@@ -7744,7 +7751,7 @@ function ls({ view: e, run: t, step: n }) {
7744
7751
  })
7745
7752
  }, n.id))
7746
7753
  }),
7747
- /* @__PURE__ */ F(us, {
7754
+ /* @__PURE__ */ F(ds, {
7748
7755
  view: e,
7749
7756
  run: t,
7750
7757
  sticky: !0,
@@ -7763,7 +7770,7 @@ function ls({ view: e, run: t, step: n }) {
7763
7770
  ]
7764
7771
  });
7765
7772
  }
7766
- function us({ view: e, run: t, sticky: n, children: r }) {
7773
+ function ds({ view: e, run: t, sticky: n, children: r }) {
7767
7774
  return /* @__PURE__ */ I("div", {
7768
7775
  className: q("mt-10 flex items-center justify-between gap-3", n && "action-bar"),
7769
7776
  children: [e.canBack ? /* @__PURE__ */ I(J, {
@@ -7778,8 +7785,8 @@ function us({ view: e, run: t, sticky: n, children: r }) {
7778
7785
  }) : /* @__PURE__ */ F("span", {}), r]
7779
7786
  });
7780
7787
  }
7781
- function ds() {
7782
- let e = ai(), [t, n] = M(!1), r = e !== "off";
7788
+ function fs() {
7789
+ let e = oi(), [t, n] = M(!1), r = e !== "off";
7783
7790
  return /* @__PURE__ */ I("div", {
7784
7791
  className: "mt-6 flex flex-col items-center gap-2",
7785
7792
  children: [/* @__PURE__ */ I("button", {
@@ -7788,20 +7795,20 @@ function ds() {
7788
7795
  disabled: t,
7789
7796
  onClick: async () => {
7790
7797
  if (r) {
7791
- ci();
7798
+ li();
7792
7799
  return;
7793
7800
  }
7794
- n(!0), await si(), n(!1);
7801
+ n(!0), await ci(), n(!1);
7795
7802
  },
7796
7803
  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"),
7797
7804
  children: [r ? /* @__PURE__ */ F(f, { className: "size-4 text-ember-strong" }) : /* @__PURE__ */ F(d, { className: "size-4" }), V(r ? "notify.on" : "notify.ask")]
7798
7805
  }), /* @__PURE__ */ F("p", {
7799
7806
  className: "max-w-xs text-[0.75rem] text-ink-4 leading-relaxed",
7800
- children: V(e === "off" ? "notify.why" : e === "on" ? "notify.onHint" : oi() ? "notify.blocked" : "notify.quiet")
7807
+ children: V(e === "off" ? "notify.why" : e === "on" ? "notify.onHint" : si() ? "notify.blocked" : "notify.quiet")
7801
7808
  })]
7802
7809
  });
7803
7810
  }
7804
- function fs({ view: e, compact: t, awake: n }) {
7811
+ function ps({ view: e, compact: t, awake: n }) {
7805
7812
  let r = Ie(() => {
7806
7813
  let t = [...e.events].reverse().find((t) => t.type === "step_started" && t.stepId === e.step?.id);
7807
7814
  return t ? new Date(t.at).getTime() : Date.now();
@@ -7841,11 +7848,11 @@ function fs({ view: e, compact: t, awake: n }) {
7841
7848
  className: q("flex items-center justify-center gap-2 text-[0.8125rem] transition-opacity", t === c.length - 1 ? "text-ink-2" : "text-ink-4"),
7842
7849
  children: [t === c.length - 1 ? /* @__PURE__ */ F(we, { className: "size-3.5 animate-breathe text-ember" }) : null, /* @__PURE__ */ F("span", {
7843
7850
  className: "truncate",
7844
- children: dr(e)
7851
+ children: fr(e)
7845
7852
  })]
7846
7853
  }, e.id))
7847
7854
  }),
7848
- t ? null : /* @__PURE__ */ F(ds, {}),
7855
+ t ? null : /* @__PURE__ */ F(fs, {}),
7849
7856
  n ? /* @__PURE__ */ F("p", {
7850
7857
  className: "mt-3 text-[0.75rem] text-ink-4",
7851
7858
  children: V("run.awake")
@@ -7853,7 +7860,7 @@ function fs({ view: e, compact: t, awake: n }) {
7853
7860
  ]
7854
7861
  });
7855
7862
  }
7856
- function ps(e) {
7863
+ function ms(e) {
7857
7864
  let t = j({
7858
7865
  running: !1,
7859
7866
  since: 0,
@@ -7862,7 +7869,7 @@ function ps(e) {
7862
7869
  A(() => {
7863
7870
  if (!e) return;
7864
7871
  let n = t.current, r = e.status === "running", i = r ? n.running ? n.since : Date.now() : 0, a = (t) => {
7865
- document.visibilityState !== "visible" && !document.title.startsWith("● ") && (document.title = `● ${document.title}`), ui({
7872
+ document.visibilityState !== "visible" && !document.title.startsWith("● ") && (document.title = `● ${document.title}`), di({
7866
7873
  title: e.wizard.title,
7867
7874
  body: t,
7868
7875
  tag: e.id
@@ -7880,14 +7887,14 @@ function ps(e) {
7880
7887
  return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
7881
7888
  }, []);
7882
7889
  }
7883
- function ms({ view: e, run: t, step: n, studio: r }) {
7890
+ function hs({ view: e, run: t, step: n, studio: r }) {
7884
7891
  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 = () => {
7885
7892
  _ && c.trim() && t.regenerate(n.id, _.step.id, c.trim(), m[_.step.id]);
7886
7893
  };
7887
7894
  return /* @__PURE__ */ I("div", {
7888
7895
  className: "animate-rise",
7889
7896
  children: [
7890
- /* @__PURE__ */ F(os, {
7897
+ /* @__PURE__ */ F(ss, {
7891
7898
  title: n.title,
7892
7899
  description: n.description
7893
7900
  }),
@@ -7895,7 +7902,7 @@ function ms({ view: e, run: t, step: n, studio: r }) {
7895
7902
  className: "flex flex-col gap-6",
7896
7903
  children: [
7897
7904
  e.shown.filter((e) => e.output).map(({ step: t, output: c }) => {
7898
- let l = Zi(t) ? t : null, u = !!n.edit && t.type === "agent" && (t.output.format !== "json" || !!l), d = i[t.id], f = (e) => /* @__PURE__ */ I("div", {
7905
+ let l = Qi(t) ? t : null, u = !!n.edit && t.type === "agent" && (t.output.format !== "json" || !!l), d = i[t.id], f = (e) => /* @__PURE__ */ I("div", {
7899
7906
  className: "mb-2 flex items-center justify-between gap-3",
7900
7907
  children: [/* @__PURE__ */ F("h3", {
7901
7908
  className: "font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.06em]",
@@ -7918,8 +7925,8 @@ function ms({ view: e, run: t, step: n, studio: r }) {
7918
7925
  })]
7919
7926
  }), _ = l && c && u && o[t.id] ? /* @__PURE__ */ F("div", {
7920
7927
  className: "overflow-hidden rounded-xl bg-card ring-1 ring-border-soft",
7921
- children: /* @__PURE__ */ F(qi, {
7922
- shape: Mn(l),
7928
+ children: /* @__PURE__ */ F(Ji, {
7929
+ shape: Nn(l),
7923
7930
  value: d && typeof d == "object" ? d : c.json ?? {},
7924
7931
  onChange: (e) => a((n) => ({
7925
7932
  ...n,
@@ -7927,11 +7934,11 @@ function ms({ view: e, run: t, step: n, studio: r }) {
7927
7934
  })),
7928
7935
  start: "edit"
7929
7936
  })
7930
- }) : /* @__PURE__ */ F(Zo, {
7937
+ }) : /* @__PURE__ */ F(Qo, {
7931
7938
  base: `${G(e.id)}`,
7932
7939
  step: t,
7933
7940
  output: c,
7934
- onView: as(e.id, t.id),
7941
+ onView: os(e.id, t.id),
7935
7942
  editable: u && o[t.id] && !l,
7936
7943
  draft: typeof d == "string" ? d : void 0,
7937
7944
  onDraft: (e) => a((n) => ({
@@ -7952,7 +7959,7 @@ function ms({ view: e, run: t, step: n, studio: r }) {
7952
7959
  p(t.id), g.current?.focus();
7953
7960
  } : void 0
7954
7961
  });
7955
- return /* @__PURE__ */ F("section", { children: r && l && c ? /* @__PURE__ */ F(Qi, {
7962
+ return /* @__PURE__ */ F("section", { children: r && l && c ? /* @__PURE__ */ F($i, {
7956
7963
  runId: e.id,
7957
7964
  step: l,
7958
7965
  output: c,
@@ -7963,15 +7970,15 @@ function ms({ view: e, run: t, step: n, studio: r }) {
7963
7970
  e.lists.map((t) => /* @__PURE__ */ I("section", { children: [/* @__PURE__ */ F("h3", {
7964
7971
  className: "mb-2 font-medium text-[0.8125rem] text-ink-3 uppercase tracking-[0.06em]",
7965
7972
  children: t.def.title
7966
- }), t.def.check ? /* @__PURE__ */ F(xa, {
7973
+ }), t.def.check ? /* @__PURE__ */ F(Sa, {
7967
7974
  runId: e.id,
7968
7975
  list: t
7969
- }) : /* @__PURE__ */ F(va, {
7976
+ }) : /* @__PURE__ */ F(ya, {
7970
7977
  runId: e.id,
7971
7978
  list: t,
7972
7979
  editable: !0
7973
7980
  })] }, t.def.id)),
7974
- n.regenerate && d.length ? /* @__PURE__ */ I(Rr, {
7981
+ n.regenerate && d.length ? /* @__PURE__ */ I(zr, {
7975
7982
  className: "p-3",
7976
7983
  children: [
7977
7984
  d.length > 1 ? /* @__PURE__ */ I("div", {
@@ -7989,7 +7996,7 @@ function ms({ view: e, run: t, step: n, studio: r }) {
7989
7996
  children: e.title
7990
7997
  }, e.id))]
7991
7998
  }) : null,
7992
- /* @__PURE__ */ F(Ar, {
7999
+ /* @__PURE__ */ F(jr, {
7993
8000
  ref: g,
7994
8001
  minRows: 2,
7995
8002
  maxRows: 8,
@@ -8023,7 +8030,7 @@ function ms({ view: e, run: t, step: n, studio: r }) {
8023
8030
  }) : null
8024
8031
  ]
8025
8032
  }),
8026
- /* @__PURE__ */ F(us, {
8033
+ /* @__PURE__ */ F(ds, {
8027
8034
  view: e,
8028
8035
  run: t,
8029
8036
  sticky: !0,
@@ -8041,7 +8048,7 @@ function ms({ view: e, run: t, step: n, studio: r }) {
8041
8048
  ]
8042
8049
  });
8043
8050
  }
8044
- function hs({ view: e, run: t, step: n, onRestart: r, studio: i }) {
8051
+ function gs({ view: e, run: t, step: n, onRestart: r, studio: i }) {
8045
8052
  let a = e.shown.filter((e) => e.output), { Mascot: o, ShareResultButton: s } = H();
8046
8053
  return /* @__PURE__ */ I("div", {
8047
8054
  className: "animate-rise",
@@ -8066,12 +8073,8 @@ function hs({ view: e, run: t, step: n, onRestart: r, studio: i }) {
8066
8073
  s && e.shown.some((e) => e.output) ? /* @__PURE__ */ F("div", {
8067
8074
  className: "max-sm:basis-full",
8068
8075
  children: /* @__PURE__ */ F(s, {
8069
- runId: e.id,
8070
- title: `${n.title} · ${e.wizard.title}`,
8071
- initial: e.shareUrl ? {
8072
- url: e.shareUrl,
8073
- expiresAt: e.expiresAt
8074
- } : null
8076
+ view: e,
8077
+ title: `${n.title} · ${e.wizard.title}`
8075
8078
  })
8076
8079
  }) : null
8077
8080
  ]
@@ -8086,7 +8089,7 @@ function hs({ view: e, run: t, step: n, onRestart: r, studio: i }) {
8086
8089
  children: o ?? n.title
8087
8090
  }), /* @__PURE__ */ I("div", {
8088
8091
  className: "flex items-center gap-1",
8089
- children: [/* @__PURE__ */ F(rs, {
8092
+ children: [/* @__PURE__ */ F(is, {
8090
8093
  base: `${G(e.id)}`,
8091
8094
  stepId: n.id,
8092
8095
  formats: a,
@@ -8096,16 +8099,16 @@ function hs({ view: e, run: t, step: n, onRestart: r, studio: i }) {
8096
8099
  foot: `${e.wizard.title} · ${(/* @__PURE__ */ new Date()).toLocaleDateString(H().lang)}`
8097
8100
  }), t]
8098
8101
  })]
8099
- }), c = /* @__PURE__ */ F(_s, {
8102
+ }), c = /* @__PURE__ */ F(vs, {
8100
8103
  view: e,
8101
8104
  run: t,
8102
8105
  step: n,
8103
8106
  output: r,
8104
- onView: as(e.id, n.id)
8107
+ onView: os(e.id, n.id)
8105
8108
  });
8106
- return /* @__PURE__ */ I(Rr, {
8109
+ return /* @__PURE__ */ I(zr, {
8107
8110
  className: "p-4 sm:p-5",
8108
- children: [i && Zi(n) && r ? /* @__PURE__ */ F(Qi, {
8111
+ children: [i && Qi(n) && r ? /* @__PURE__ */ F($i, {
8109
8112
  runId: e.id,
8110
8113
  step: n,
8111
8114
  output: r,
@@ -8116,25 +8119,25 @@ function hs({ view: e, run: t, step: n, onRestart: r, studio: i }) {
8116
8119
  children: V("ai.publish")
8117
8120
  }) : null]
8118
8121
  }, n.id);
8119
- }), e.lists.map((t) => /* @__PURE__ */ I(Rr, {
8122
+ }), e.lists.map((t) => /* @__PURE__ */ I(zr, {
8120
8123
  className: "p-4 sm:p-5",
8121
8124
  children: [/* @__PURE__ */ I("div", {
8122
8125
  className: "mb-3 flex flex-wrap items-center justify-between gap-3",
8123
8126
  children: [/* @__PURE__ */ F("h3", {
8124
8127
  className: "font-display font-semibold text-[1.0625rem]",
8125
8128
  children: t.label ?? t.def.title
8126
- }), /* @__PURE__ */ F(Ca, {
8129
+ }), /* @__PURE__ */ F(wa, {
8127
8130
  runId: e.id,
8128
8131
  list: t
8129
8132
  })]
8130
- }), /* @__PURE__ */ F(va, {
8133
+ }), /* @__PURE__ */ F(ya, {
8131
8134
  runId: e.id,
8132
8135
  list: t,
8133
8136
  editable: !0
8134
8137
  })]
8135
8138
  }, t.def.id))]
8136
8139
  }),
8137
- /* @__PURE__ */ F(us, {
8140
+ /* @__PURE__ */ F(ds, {
8138
8141
  view: e,
8139
8142
  run: t,
8140
8143
  children: r ? /* @__PURE__ */ I(J, {
@@ -8150,7 +8153,7 @@ function hs({ view: e, run: t, step: n, onRestart: r, studio: i }) {
8150
8153
  ]
8151
8154
  });
8152
8155
  }
8153
- function gs({ view: e, run: t }) {
8156
+ function _s({ view: e, run: t }) {
8154
8157
  let { Mascot: n } = H();
8155
8158
  return /* @__PURE__ */ I("div", {
8156
8159
  className: "flex animate-rise flex-col items-center pt-8 text-center",
@@ -8165,7 +8168,7 @@ function gs({ view: e, run: t }) {
8165
8168
  }),
8166
8169
  /* @__PURE__ */ F("p", {
8167
8170
  className: "mt-2 max-w-md text-[0.9375rem] text-ink-3",
8168
- children: /* @__PURE__ */ F(Br, { text: e.error ?? "" })
8171
+ children: /* @__PURE__ */ F(Vr, { text: e.error ?? "" })
8169
8172
  }),
8170
8173
  /* @__PURE__ */ I("div", {
8171
8174
  className: "mt-8 flex gap-3",
@@ -8190,9 +8193,9 @@ function gs({ view: e, run: t }) {
8190
8193
  ]
8191
8194
  });
8192
8195
  }
8193
- function _s({ view: e, run: t, step: n, output: r, onView: i }) {
8196
+ function vs({ view: e, run: t, step: n, output: r, onView: i }) {
8194
8197
  let [a, o] = M(!1), [s, c] = M(!1), l = G(e.id), u = e.translation?.results[n.id];
8195
- if (!(e.translation && r?.text && t.translateResult)) return /* @__PURE__ */ F(Zo, {
8198
+ if (!(e.translation && r?.text && t.translateResult)) return /* @__PURE__ */ F(Qo, {
8196
8199
  base: l,
8197
8200
  step: n,
8198
8201
  output: r,
@@ -8202,7 +8205,7 @@ function _s({ view: e, run: t, step: n, output: r, onView: i }) {
8202
8205
  ...r,
8203
8206
  text: u
8204
8207
  } : r;
8205
- return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Zo, {
8208
+ return /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(Qo, {
8206
8209
  base: l,
8207
8210
  step: n,
8208
8211
  output: d,
@@ -8229,31 +8232,31 @@ function _s({ view: e, run: t, step: n, output: r, onView: i }) {
8229
8232
  })
8230
8233
  })] });
8231
8234
  }
8232
- function vs({ run: e, compact: t, onRestart: n, onView: r, stickyProgress: i, studio: a }) {
8235
+ function ys({ run: e, compact: t, onRestart: n, onView: r, stickyProgress: i, studio: a }) {
8233
8236
  let { view: o } = e;
8234
- pr(o?.translation?.labels), A(() => {
8237
+ mr(o?.translation?.labels), A(() => {
8235
8238
  r?.(o);
8236
- }, [o, r]), Yr();
8237
- let s = Xr(o?.status === "running" && !o.ask);
8238
- if (ps(o), e.notFound) return /* @__PURE__ */ F("div", {
8239
+ }, [o, r]), Xr();
8240
+ let s = Zr(o?.status === "running" && !o.ask);
8241
+ if (ms(o), e.notFound) return /* @__PURE__ */ F("div", {
8239
8242
  className: "py-24 text-center text-ink-3",
8240
8243
  children: V("run.notFound")
8241
8244
  });
8242
8245
  if (!o) return /* @__PURE__ */ F("div", {
8243
8246
  className: "flex justify-center py-24 text-ink-4",
8244
- children: /* @__PURE__ */ F(Lr, {})
8247
+ children: /* @__PURE__ */ F(Rr, {})
8245
8248
  });
8246
8249
  let c = o.step, l = null;
8247
- if (o.status === "running" && o.ask) l = /* @__PURE__ */ F(Wr, {
8250
+ if (o.status === "running" && o.ask) l = /* @__PURE__ */ F(Gr, {
8248
8251
  runId: o.id,
8249
8252
  ask: o.ask
8250
8253
  }, o.ask.id);
8251
- else if (o.status === "running") l = /* @__PURE__ */ F(fs, {
8254
+ else if (o.status === "running") l = /* @__PURE__ */ F(ps, {
8252
8255
  view: o,
8253
8256
  compact: t,
8254
8257
  awake: s
8255
8258
  });
8256
- else if (o.status === "failed") l = /* @__PURE__ */ F(gs, {
8259
+ else if (o.status === "failed") l = /* @__PURE__ */ F(_s, {
8257
8260
  view: o,
8258
8261
  run: e
8259
8262
  });
@@ -8261,20 +8264,20 @@ function vs({ run: e, compact: t, onRestart: n, onView: r, stickyProgress: i, st
8261
8264
  className: "py-24 text-center text-ink-3",
8262
8265
  children: V("run.cancelled")
8263
8266
  });
8264
- else if (c?.type === "page") l = /* @__PURE__ */ F(ls, {
8267
+ else if (c?.type === "page") l = /* @__PURE__ */ F(us, {
8265
8268
  view: o,
8266
8269
  run: e,
8267
8270
  step: c
8268
8271
  }, c.id);
8269
8272
  else if (c?.type === "review") {
8270
8273
  let t = o.shown.map((e) => e.output?.at ?? "").join("|");
8271
- l = /* @__PURE__ */ F(ms, {
8274
+ l = /* @__PURE__ */ F(hs, {
8272
8275
  view: o,
8273
8276
  run: e,
8274
8277
  step: c,
8275
8278
  studio: a
8276
8279
  }, `${c.id}:${t}`);
8277
- } else c?.type === "result" && (l = /* @__PURE__ */ F(hs, {
8280
+ } else c?.type === "result" && (l = /* @__PURE__ */ F(gs, {
8278
8281
  view: o,
8279
8282
  run: e,
8280
8283
  step: c,
@@ -8286,8 +8289,8 @@ function vs({ run: e, compact: t, onRestart: n, onView: r, stickyProgress: i, st
8286
8289
  className: "flex min-h-full flex-col",
8287
8290
  children: [i ? /* @__PURE__ */ F("div", {
8288
8291
  className: "sticky top-0 z-10",
8289
- children: /* @__PURE__ */ F(is, { view: o })
8290
- }) : /* @__PURE__ */ F(is, { view: o }), /* @__PURE__ */ I("div", {
8292
+ children: /* @__PURE__ */ F(as, { view: o })
8293
+ }) : /* @__PURE__ */ F(as, { view: o }), /* @__PURE__ */ I("div", {
8291
8294
  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"),
8292
8295
  children: [
8293
8296
  l,
@@ -8297,7 +8300,7 @@ function vs({ run: e, compact: t, onRestart: n, onView: r, stickyProgress: i, st
8297
8300
  }) : null,
8298
8301
  o.keeps && o.status !== "running" ? /* @__PURE__ */ F("div", {
8299
8302
  className: "mt-10 flex justify-center",
8300
- children: /* @__PURE__ */ F(wa, { runId: o.id })
8303
+ children: /* @__PURE__ */ F(Ta, { runId: o.id })
8301
8304
  }) : null
8302
8305
  ]
8303
8306
  })]
@@ -8305,8 +8308,8 @@ function vs({ run: e, compact: t, onRestart: n, onView: r, stickyProgress: i, st
8305
8308
  }
8306
8309
  //#endregion
8307
8310
  //#region src/openui/run.ts
8308
- var ys = 45e3;
8309
- function bs(e, t) {
8311
+ var bs = 45e3;
8312
+ function xs(e, t) {
8310
8313
  let [n, r] = M(null), [i, a] = M(null), [o, s] = M(!1), [c, l] = M(!1), [u, d] = M({});
8311
8314
  A(() => {
8312
8315
  if (r(null), s(!1), !e) return;
@@ -8315,7 +8318,7 @@ function bs(e, t) {
8315
8318
  let n = await U.get(t(e));
8316
8319
  i || r(n);
8317
8320
  } catch (e) {
8318
- e instanceof hr && e.status === 404 && (i = !0, c?.close(), s(!0));
8321
+ e instanceof gr && e.status === 404 && (i = !0, c?.close(), s(!0));
8319
8322
  }
8320
8323
  }, d = () => {
8321
8324
  if (clearTimeout(o), c?.close(), i) return;
@@ -8328,7 +8331,7 @@ function bs(e, t) {
8328
8331
  s.close(), !(i || c !== s) && (c = null, u(), a = Math.min(a + 1, 6), o = setTimeout(d, 500 * 2 ** a));
8329
8332
  };
8330
8333
  }, f = setInterval(() => {
8331
- !i && c && Date.now() - l > ys && (a = 0, d());
8334
+ !i && c && Date.now() - l > bs && (a = 0, d());
8332
8335
  }, 15e3);
8333
8336
  return d(), () => {
8334
8337
  i = !0, clearTimeout(o), clearInterval(f), c?.close();
@@ -8340,7 +8343,7 @@ function bs(e, t) {
8340
8343
  try {
8341
8344
  return await U.post(`${H().runBase(e)}/${t}`, n), !0;
8342
8345
  } catch (e) {
8343
- return e instanceof hr && e.status === 422 && Array.isArray(e.body?.fields) && d(Object.fromEntries(e.body.fields.map((e) => [e.field, e.message]))), a(e.message), !1;
8346
+ return e instanceof gr && e.status === 422 && Array.isArray(e.body?.fields) && d(Object.fromEntries(e.body.fields.map((e) => [e.field, e.message]))), a(e.message), !1;
8344
8347
  } finally {
8345
8348
  l(!1);
8346
8349
  }
@@ -8355,7 +8358,7 @@ function bs(e, t) {
8355
8358
  }
8356
8359
  } : n;
8357
8360
  }, [n, t]);
8358
- return pr(n?.translation?.labels), {
8361
+ return mr(n?.translation?.labels), {
8359
8362
  view: p,
8360
8363
  notFound: o,
8361
8364
  error: i,
@@ -8379,22 +8382,22 @@ function bs(e, t) {
8379
8382
  }
8380
8383
  //#endregion
8381
8384
  //#region src/openui/message.ts
8382
- var xs = (e) => `wizard:${e}`, Ss = "wizard:empty";
8383
- function Cs(t, n) {
8385
+ var Ss = (e) => `wizard:${e}`, Cs = "wizard:empty";
8386
+ function ws(t, n) {
8384
8387
  let r = He(), i = Ve(), a = Ue(), [o, s] = M(null), [c, l] = M(null), u = j(null);
8385
8388
  return A(() => {
8386
8389
  if (r || o || c || !t) return;
8387
8390
  let d = !1;
8388
8391
  return (async () => {
8389
8392
  if (await Promise.resolve(), d) return;
8390
- let r = i(void 0, xs(t));
8393
+ let r = i(void 0, Ss(t));
8391
8394
  if (typeof r == "string") {
8392
8395
  s(r);
8393
8396
  return;
8394
8397
  }
8395
8398
  u.current ??= n(t);
8396
8399
  let o = await u.current;
8397
- d || (s(o), a(void 0, e, xs(t), o, !0));
8400
+ d || (s(o), a(void 0, e, Ss(t), o, !0));
8398
8401
  })().catch((e) => {
8399
8402
  d || l(e instanceof Error ? e.message : String(e));
8400
8403
  }), () => {
@@ -8413,10 +8416,10 @@ function Cs(t, n) {
8413
8416
  failed: c
8414
8417
  };
8415
8418
  }
8416
- function ws() {
8419
+ function Ts() {
8417
8420
  let e = Ue(), t = We();
8418
8421
  return Ne((n, r) => {
8419
- e(Ss, void 0, "empty", void 0, !1), t(n, Ss, {
8422
+ e(Cs, void 0, "empty", void 0, !1), t(n, Cs, {
8420
8423
  type: "continue_conversation",
8421
8424
  params: { context: r }
8422
8425
  });
@@ -8424,7 +8427,7 @@ function ws() {
8424
8427
  }
8425
8428
  //#endregion
8426
8429
  //#region src/openui/Wizard.tsx
8427
- function Ts({ size: e = 64 }) {
8430
+ function Es({ size: e = 64 }) {
8428
8431
  let t = Math.min(e, 72);
8429
8432
  return /* @__PURE__ */ F("span", {
8430
8433
  "aria-hidden": "true",
@@ -8435,18 +8438,18 @@ function Ts({ size: e = 64 }) {
8435
8438
  }
8436
8439
  });
8437
8440
  }
8438
- function Es(e) {
8441
+ function Ds(e) {
8439
8442
  let t = e.runtime.replace(/\/+$/, "");
8440
- br({
8443
+ xr({
8441
8444
  lang: e.lang ?? "en",
8442
8445
  runBase: (e) => `/api/runs/${e}`,
8443
8446
  withBase: (e) => `${t}${e}`,
8444
8447
  asset: (e) => `${t}/${e.replace(/^\/+/, "")}`,
8445
- Mascot: e.Mascot ?? Ts
8448
+ Mascot: e.Mascot ?? Es
8446
8449
  });
8447
8450
  }
8448
- var Ds = (e) => U.post(`/api/public/wizards/${encodeURIComponent(e)}/runs`, {}).then((e) => e.runId);
8449
- function Os(e) {
8451
+ var Os = (e) => U.post(`/api/public/wizards/${encodeURIComponent(e)}/runs`, {}).then((e) => e.runId);
8452
+ function ks(e) {
8450
8453
  let t = Object.entries(e.outputs).filter(([, e]) => typeof e.text == "string" && e.text.trim()).map(([e, t]) => ({
8451
8454
  step: e,
8452
8455
  text: (t.text ?? "").slice(0, 4e3)
@@ -8457,10 +8460,10 @@ function Os(e) {
8457
8460
  results: t
8458
8461
  };
8459
8462
  }
8460
- function ks({ props: e }) {
8461
- let { runId: t, failed: n } = Cs(e.wizard, Ds), r = bs(t, e.prefill), i = ws(), a = r.view, o = j(!1);
8463
+ function As({ props: e }) {
8464
+ let { runId: t, failed: n } = ws(e.wizard, Os), r = xs(t, e.prefill), i = Ts(), a = r.view, o = j(!1);
8462
8465
  return A(() => {
8463
- a && (a.status === "done" ? o.current && (o.current = !1, i(`The wizard “${a.wizard.title}” finished.`, Os(a))) : o.current = !0);
8466
+ a && (a.status === "done" ? o.current && (o.current = !1, i(`The wizard “${a.wizard.title}” finished.`, ks(a))) : o.current = !0);
8464
8467
  }, [a, i]), /* @__PURE__ */ I("div", {
8465
8468
  className: "engenty-runner overflow-hidden rounded-2xl border border-paper-3 bg-paper",
8466
8469
  children: [e.note ? /* @__PURE__ */ F("p", {
@@ -8471,20 +8474,20 @@ function ks({ props: e }) {
8471
8474
  children: n ? /* @__PURE__ */ F("p", {
8472
8475
  className: "py-10 text-center text-ink-3",
8473
8476
  children: n
8474
- }) : /* @__PURE__ */ F(vs, {
8477
+ }) : /* @__PURE__ */ F(ys, {
8475
8478
  run: r,
8476
8479
  compact: !0
8477
8480
  })
8478
8481
  })]
8479
8482
  });
8480
8483
  }
8481
- var As = Be({
8484
+ var js = Be({
8482
8485
  name: e,
8483
8486
  description: t,
8484
8487
  props: a,
8485
- component: ({ props: e }) => /* @__PURE__ */ F(ks, { props: e })
8488
+ component: ({ props: e }) => /* @__PURE__ */ F(As, { props: e })
8486
8489
  });
8487
8490
  //#endregion
8488
- export { e as WIZARD_COMPONENT, t as WIZARD_DESCRIPTION, As as Wizard, n as WizardSpec, r as addWizard, Es as configureWizards, i as loadWizards, bs as useWizardRun, a as wizardProps, o as wizardRules };
8491
+ export { e as WIZARD_COMPONENT, t as WIZARD_DESCRIPTION, js as Wizard, n as WizardSpec, r as addWizard, Ds as configureWizards, i as loadWizards, xs as useWizardRun, a as wizardProps, o as wizardRules };
8489
8492
 
8490
8493
  //# sourceMappingURL=index.js.map