@openbkn/workshop 0.2.3 → 0.3.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +1 -1
  2. package/dist/{ActionConfirm-ITBip2Ic.js → ActionConfirm-BX1dlrAM.js} +5 -5
  3. package/dist/{ActionFailure-CWifUJ2j.js → ActionFailure-xcSfKJYC.js} +2 -2
  4. package/dist/{AgentChat-C1uyzwuA.js → AgentChat-DHdX_6W7.js} +407 -383
  5. package/dist/AppListPage-DsUvFo6B.js +1549 -0
  6. package/dist/{AskDrawer-Bw1NM5v_.js → AskDrawer-j-CR4yXP.js} +4 -4
  7. package/dist/{ComputedView-_CaPjqhY.js → ComputedView-dWFlHngu.js} +1035 -1016
  8. package/dist/{ConclusionApply-CG5wSeVp.js → ConclusionApply-BAoZpxl-.js} +4 -4
  9. package/dist/{CypherEditor-DbLHQoJJ.js → CypherEditor-CZ5Z4SGH.js} +47 -47
  10. package/dist/{LandingList-BMPCXj6K.js → LandingList-BUO6-at_.js} +5 -5
  11. package/dist/{MenuUnfoldOutlined-BoARCVho.js → MenuUnfoldOutlined-DAeIeIap.js} +3 -3
  12. package/dist/{ModelTrial-DZjC0E8E.js → ModelTrial-C7XvLVY7.js} +4 -4
  13. package/dist/{PageRenderer-Debi-U0v.js → PageRenderer-CkmvW4aO.js} +21264 -20549
  14. package/dist/{ScenarioApply-BNFfjIwR.js → ScenarioApply-COdlyvrC.js} +6 -6
  15. package/dist/{SimulateForm-CEqqMjks.js → SimulateForm-B_9laTIl.js} +4 -4
  16. package/dist/{Subgraph-C0VjOnZf.js → Subgraph-CDY3wvCA.js} +3 -3
  17. package/dist/WorkshopLabPage-BtYnBpk4.js +12020 -0
  18. package/dist/{WorkshopRunPage-BlyM18id.js → WorkshopRunPage-DHMJ3b8k.js} +24 -24
  19. package/dist/{abnfDiagram-WEYOIA3C-wqYhe75a.js → abnfDiagram-WEYOIA3C-Blje2Kbf.js} +3 -3
  20. package/dist/{action-type-tool.service-CtCfESYq.js → action-type-tool.service-BN-W_Az_.js} +1 -1
  21. package/dist/{architectureDiagram-ZHVYKT53-BYJ2H7bS.js → architectureDiagram-ZHVYKT53-B_FkRXc3.js} +3 -3
  22. package/dist/{bkn-agent-execution.service-ogW6NIAz.js → bkn-agent-execution.service-CJalMVIc.js} +1 -1
  23. package/dist/{blockDiagram-RJAE7QA3-DZfrfHRw.js → blockDiagram-RJAE7QA3-CYJLthoI.js} +3 -3
  24. package/dist/{c4Diagram-XDPPPE54--S7sRxgd.js → c4Diagram-XDPPPE54-CmMaN3M4.js} +2 -2
  25. package/dist/{channel-Ca2_7Xkz.js → channel-Dp24Bgua.js} +1 -1
  26. package/dist/{chunk-2E7WHVMD-BMnl6-jy.js → chunk-2E7WHVMD-DrnpfYKB.js} +1 -1
  27. package/dist/{chunk-2Q5K7J3B-BNVTYluA.js → chunk-2Q5K7J3B-BXqKcHlQ.js} +1 -1
  28. package/dist/{chunk-4EMNKR2T-CKorQf5z.js → chunk-4EMNKR2T-DYgY_0_y.js} +1 -1
  29. package/dist/{chunk-55XCU76K-C4xutPQ4.js → chunk-55XCU76K-Bja7bE8g.js} +1 -1
  30. package/dist/{chunk-5VM5RSS4-BM5F2WnL.js → chunk-5VM5RSS4-CGTnbRRi.js} +1 -1
  31. package/dist/{chunk-JWPE2WC7-CSU5SIs8.js → chunk-JWPE2WC7-2AyjxdJR.js} +1 -1
  32. package/dist/{chunk-VQ5W62QI-Dtk59D_l.js → chunk-VQ5W62QI-B3PGCKOg.js} +1 -1
  33. package/dist/{chunk-XXDRQBXY-DzVLFl9c.js → chunk-XXDRQBXY-RrIsI-B5.js} +1 -1
  34. package/dist/{chunk-ZCHMQSOR-cdQdJeDJ.js → chunk-ZCHMQSOR-COJTBW1i.js} +2 -2
  35. package/dist/{classDiagram-v2-4MYWR3UA-CABAzYlW.js → classDiagram-v2-4MYWR3UA-DolLxH6t.js} +5 -5
  36. package/dist/{cose-bilkent-JH36ORCC-Ca8GJbqv.js → cose-bilkent-JH36ORCC-DMSYgFxc.js} +2 -2
  37. package/dist/customComponents-DasaZ6pq.js +1 -1
  38. package/dist/customComponents.en-US-CkabuCXg.js +1 -1
  39. package/dist/{customParseFormat-H00Ur3YB.js → customParseFormat-C9WAjjqH.js} +1 -1
  40. package/dist/{cynefinDiagram-WF24UDRP-iIy_O6OH.js → cynefinDiagram-WF24UDRP-DrksRWCn.js} +2 -2
  41. package/dist/{dagre-NK4GIZVX-lW5Hra0G.js → dagre-NK4GIZVX-CFRT2dAc.js} +2 -2
  42. package/dist/{dayjs.min-C8_4Wqpb.js → dayjs.min-CziT8yW9.js} +1 -1
  43. package/dist/{diagram-CBK3MWTC-l5LVSm6X.js → diagram-CBK3MWTC-DzZ_sQCl.js} +3 -3
  44. package/dist/{diagram-I5XIIV2D-ChpwB8Wz.js → diagram-I5XIIV2D-RYNBUOF4.js} +2 -2
  45. package/dist/{diagram-ODIL2UCW-DBavGl7R.js → diagram-ODIL2UCW-DqJETE9R.js} +3 -3
  46. package/dist/{diagram-PFBEJUXE-B3fNIQm9.js → diagram-PFBEJUXE-BekIE7hh.js} +2 -2
  47. package/dist/{diagram-RJA3I4VV-Dmj0Shdh.js → diagram-RJA3I4VV-DAIwlMxl.js} +2 -2
  48. package/dist/{diagram-TYUNFSNR-D98rsKpY.js → diagram-TYUNFSNR-CLJ0Ou9i.js} +6 -6
  49. package/dist/{ebnfDiagram-V4P3TTPT-Bxr2oP9U.js → ebnfDiagram-V4P3TTPT-CRs8ppfT.js} +3 -3
  50. package/dist/{elk-QONTBCTQ-CvFT6Pst.js → elk-QONTBCTQ-Bqoh6AYY.js} +5 -5
  51. package/dist/{erDiagram-KYQIGQAA-dgeEoLzk.js → erDiagram-KYQIGQAA-BSp8Z7uQ.js} +4 -4
  52. package/dist/{flowDiagram-IUGLLWBU-ChsJgBPn.js → flowDiagram-IUGLLWBU-WKILTCDc.js} +7 -7
  53. package/dist/{ganttDiagram-R7GPNTJY-C9WcR8Tf.js → ganttDiagram-R7GPNTJY-CaTn_Mmr.js} +4 -4
  54. package/dist/generateCypher-BE_4YCWB.js +1032 -0
  55. package/dist/{gitGraphDiagram-PDYL7XHY-CeZTDs7V.js → gitGraphDiagram-PDYL7XHY-DGPs-RF6.js} +3 -3
  56. package/dist/{infoDiagram-MVDRKAX5-CzfcVWVf.js → infoDiagram-MVDRKAX5-HIQg7U3R.js} +1 -1
  57. package/dist/{ishikawaDiagram-HPEHV2GE-BK4ExPHB.js → ishikawaDiagram-HPEHV2GE-C84x8n2j.js} +2 -2
  58. package/dist/{journeyDiagram-BOSHW7O7-DXJ-ihrY.js → journeyDiagram-BOSHW7O7-CvYDNxSY.js} +4 -4
  59. package/dist/{kanban-definition-FNSA4HC5-C9rAkIZN.js → kanban-definition-FNSA4HC5-B586ryFD.js} +2 -2
  60. package/dist/{mermaid.core-uROF3Ult.js → mermaid.core-3J01L12Z.js} +5803 -5740
  61. package/dist/{mindmap-definition-6OY57UG3-DC9FfvxT.js → mindmap-definition-6OY57UG3-Donc6BMy.js} +3 -3
  62. package/dist/{models-D5Mffixi.js → models-Rf3LB8wS.js} +1 -1
  63. package/dist/{object-metric-numeric-DIgqXqB5.js → object-metric-numeric-BcgaJ6EW.js} +1 -1
  64. package/dist/{object-metric.service-B3PtIPEA.js → object-metric.service-CKiaFYcp.js} +2 -2
  65. package/dist/{pegDiagram-ECIUJNBX-CUCvcOc0.js → pegDiagram-ECIUJNBX-CYVi7x6D.js} +3 -3
  66. package/dist/{pieDiagram-GNMPY74T-DprBId-p.js → pieDiagram-GNMPY74T-4iWKYTTS.js} +2 -2
  67. package/dist/{prompt-D9VtVs5i.js → prompt-BQzBLrua.js} +110 -100
  68. package/dist/{quadrantDiagram-D57K4MC3-CcvW9eIV.js → quadrantDiagram-D57K4MC3-Bm6Cyi1I.js} +1 -1
  69. package/dist/{railroadDiagram-Y72NRBL7-DH43paGB.js → railroadDiagram-Y72NRBL7-Du6iN-Jz.js} +3 -3
  70. package/dist/{requirementDiagram-EQYSW5RA-CBY8WT39.js → requirementDiagram-EQYSW5RA-BGxpuSlc.js} +3 -3
  71. package/dist/{sankeyDiagram-SY24JHO5-DD80tYLM.js → sankeyDiagram-SY24JHO5-CsHmu__D.js} +2 -2
  72. package/dist/{sequenceDiagram-BLEHNHQU-Bo9dDD6b.js → sequenceDiagram-BLEHNHQU-DBNi943L.js} +3 -3
  73. package/dist/{sizeCapture-INFHLROL-BQTwKEEH.js → sizeCapture-INFHLROL-CcGr2ilA.js} +1 -1
  74. package/dist/{stateDiagram-v2-A6IESKWZ-um_LWxkE.js → stateDiagram-v2-A6IESKWZ-C78tVzaF.js} +4 -4
  75. package/dist/{swimlanes-B3ENRKFQ-DyYkLRSQ.js → swimlanes-B3ENRKFQ-BROc4LGM.js} +3 -3
  76. package/dist/{swimlanesDiagram-AYQRV4AK-DlAG_Vwl.js → swimlanesDiagram-AYQRV4AK-C0RDY4m2.js} +3 -3
  77. package/dist/{text-BqSVQKS6.js → text-CzC6K33E.js} +7 -3
  78. package/dist/{text.en-US-BhAxy_LE.js → text.en-US-D8mxBP0p.js} +6 -2
  79. package/dist/{timeline-definition-JXYKGLGB-DVH8Jsv4.js → timeline-definition-JXYKGLGB-C6WGe4xl.js} +1 -1
  80. package/dist/toolMatchLines-DrXpUwcl.js +4675 -0
  81. package/dist/{useLabData-fKy_tVvS.js → useLabData-B-3UW8zF.js} +8007 -7251
  82. package/dist/{usecaseDiagram-WPOLBNNX-DvsgvjCb.js → usecaseDiagram-WPOLBNNX-yMP7SDIg.js} +3 -3
  83. package/dist/{vennDiagram-Q3Y3IDCW-BQcWfjtm.js → vennDiagram-Q3Y3IDCW-bZW2LzBB.js} +2 -2
  84. package/dist/{wardleyDiagram-IVAIDKWA-M_Wv4tRx.js → wardleyDiagram-IVAIDKWA-DBbog93x.js} +2 -2
  85. package/dist/{workshop-app-wZ37Phc-.js → workshop-app-ByYXbgcn.js} +5008 -4707
  86. package/dist/workshop-app.css +1 -1
  87. package/dist/workshop-app.js +1 -1
  88. package/dist/{xychartDiagram-4URNHDU4-DBviJ7Ux.js → xychartDiagram-4URNHDU4-CVLJNXOt.js} +1 -1
  89. package/dist-cli/workshop.js +182 -140
  90. package/package.json +1 -1
  91. package/skill/SKILL.en-US.md +5 -0
  92. package/skill/SKILL.md +3 -0
  93. package/dist/AppFormModal-ByNEloW-.js +0 -4282
  94. package/dist/AppListPage-D2NVBJs7.js +0 -1465
  95. package/dist/WorkshopLabPage-C7hssyUo.js +0 -11364
  96. package/dist/generateCypher-kvNYDLY4.js +0 -399
@@ -1,11 +1,11 @@
1
- import { Q as ea, $ as Me, C as aa, u as _, j as e, i as F, a as $, I, a0 as sa, a1 as Ae, r as A, c as ge, _ as xe, a2 as Le, a3 as Q, a4 as te, a5 as _e, y as me, a6 as ye, x as oa, V as la, X as ue, a7 as ta, b as na, a8 as fe, a9 as q, aa as Ie, ab as je, ac as ra, ad as ia, ae as ca, af as pa, ag as da, ah as ma, z as de } from "./workshop-app-wZ37Phc-.js";
2
- import { M as ua, e as Re, d as ha, w as ba } from "./generateCypher-kvNYDLY4.js";
3
- import { X as n, T as G, R as Y, a6 as K, a7 as ee, a8 as ka, a9 as ja, aa as U, ab as ke, ac as wa, ad as ga, i as xa, a3 as he, ae as fa, F as De, af as va } from "./PageRenderer-Debi-U0v.js";
4
- import { ap as P, p as ne, as as La, a as be, at as ya, au as Na, M as ae, av as Be, aw as Sa, ax as Ca, ay as Ta, A as re, T as J, az as za, aA as $a, aB as Oa, aC as Fa, aD as Pa, aE as Ea, aF as Ma, aG as Aa, aH as Ne, aI as Se, aJ as _a, aK as Ia, aL as Ce, ab as He, aM as Ra, aN as Ve, aO as Da, aP as Ba, aQ as Ha, aR as Va, aS as Ua, aT as Ga, aU as Xa, aV as Wa, u as Ka, b as Ja } from "./useLabData-fKy_tVvS.js";
1
+ import { _ as ea, a0 as Me, C as aa, u as A, j as e, i as O, a as $, I, a1 as sa, a2 as Ae, r as E, c as xe, Y as ge, a3 as ve, a4 as Y, a5 as te, a6 as _e, y as me, a7 as ye, x as oa, T as la, U as he, a8 as ta, b as na, a9 as fe, aa as q, ab as Ie, ac as je, ad as ra, ae as ia, af as ca, ag as pa, ah as da, ai as ma, z as de } from "./workshop-app-ByYXbgcn.js";
2
+ import { M as ha, e as Re, d as ua, w as ba } from "./generateCypher-BE_4YCWB.js";
3
+ import { W as n, T as G, R as Q, a6 as X, a7 as ka, a8 as ee, a9 as ja, aa as U, ab as ke, ac as wa, ad as xa, i as ga, a2 as ue, ae as fa, F as De, af as La } from "./PageRenderer-CkmvW4aO.js";
4
+ import { am as F, p as ne, as as va, a as be, at as ya, au as Na, M as ae, av as Be, aw as Sa, ax as Ca, ay as Ta, A as re, T as J, az as za, aA as $a, aB as Oa, aC as Fa, aD as Pa, aE as Ea, aF as Ma, aG as Aa, aH as Ne, aI as Se, aJ as _a, aK as Ia, aL as Ce, a6 as He, aM as Ra, aN as Ve, aO as Da, aP as Ba, aQ as Ha, aR as Va, aS as Ua, aT as Ga, aU as Wa, aV as Ka, u as Xa, b as Ja } from "./useLabData-B-3UW8zF.js";
5
5
  function Za(a, i) {
6
- const t = a.fields.map((w) => {
7
- const p = a.samples[w.name];
8
- return `- ${w.name}:${w.type}(${w.label})${p?.length ? `,取值如:${p.join("、")}` : ""}`;
6
+ const t = a.fields.map((k) => {
7
+ const p = a.samples[k.name];
8
+ return `- ${k.name}:${k.type}(${k.label})${p?.length ? `,取值如:${p.join("、")}` : ""}`;
9
9
  }).join(`
10
10
  `);
11
11
  return `你为业务应用的数据源「${a.sourceLabel}」(对象类 ${a.context.objectType})写一个计算列。
@@ -19,7 +19,7 @@ ${i}
19
19
  字段名、关系 id、属性名一律照清单原样写,不要猜;和文本值比较时用上面列出的取值。
20
20
  关联统计(related)用下面网络里的关系:
21
21
 
22
- ${ha(a.context.kn)}
22
+ ${ua(a.context.kn)}
23
23
 
24
24
  只输出 JSON:{"field": { name, label, kind, ... }, "explanation": "一句话说明规则"}。`;
25
25
  }
@@ -33,41 +33,41 @@ function qa(a) {
33
33
  explanation: typeof t.explanation == "string" ? t.explanation : ""
34
34
  };
35
35
  }
36
- async function Qa(a) {
37
- const { model: i, scope: t, instruction: w, current: p, taken: k, signal: c, onStep: s } = a, o = a.maxAttempts ?? 3, d = p?.name || void 0, h = d ? `字段名固定为 ${d}。` : `字段名自拟(字母开头的英文标识),不能用:${k.join("、") || "(无)"}。`, r = [
36
+ async function Ya(a) {
37
+ const { model: i, scope: t, instruction: k, current: p, taken: j, signal: c, onStep: s } = a, o = a.maxAttempts ?? 3, d = p?.name || void 0, m = d ? `字段名固定为 ${d}。` : `字段名自拟(字母开头的英文标识),不能用:${j.join("、") || "(无)"}。`, r = [
38
38
  {
39
39
  role: "user",
40
40
  content: p?.label ? `当前字段:
41
41
  ${JSON.stringify(p)}
42
42
 
43
- 修改要求:${w}` : w
43
+ 修改要求:${k}` : k
44
44
  }
45
45
  ];
46
46
  let u = "";
47
47
  for (let l = 1; l <= o; l++) {
48
48
  s?.({ kind: "generating", attempt: l });
49
- const { text: j } = await ea({
49
+ const { text: w } = await ea({
50
50
  model: i,
51
- system: Za(t, h),
51
+ system: Za(t, m),
52
52
  messages: r,
53
- maxOutputTokens: ua,
53
+ maxOutputTokens: ha,
54
54
  maxRetries: 0,
55
55
  abortSignal: c
56
56
  });
57
57
  try {
58
- const g = qa(j), b = {
59
- ...g.field,
58
+ const f = qa(w), h = {
59
+ ...f.field,
60
60
  ...d ? { name: d } : {}
61
61
  };
62
- if (!d && k.includes(b.name))
63
- throw new Error(`字段名 ${b.name} 已被占用`);
64
- const T = Me([b], t.fields, "field", t.context);
65
- if (T.length > 0) throw new Error(T.slice(0, 6).join(";"));
66
- return { ok: !0, field: b, explanation: g.explanation, attempts: l };
67
- } catch (g) {
68
- if (c?.aborted) throw g;
69
- u = Re(g), s?.({ kind: "failed", error: u }), r.push(
70
- { role: "assistant", content: j },
62
+ if (!d && j.includes(h.name))
63
+ throw new Error(`字段名 ${h.name} 已被占用`);
64
+ const C = Me([h], t.fields, "field", t.context);
65
+ if (C.length > 0) throw new Error(C.slice(0, 6).join(";"));
66
+ return { ok: !0, field: h, explanation: f.explanation, attempts: l };
67
+ } catch (f) {
68
+ if (c?.aborted) throw f;
69
+ u = Re(f), s?.({ kind: "failed", error: u }), r.push(
70
+ { role: "assistant", content: w },
71
71
  { role: "user", content: `校验未通过:${u}
72
72
  请对照字段清单修正,仍只输出 JSON。` }
73
73
  );
@@ -75,38 +75,38 @@ ${JSON.stringify(p)}
75
75
  }
76
76
  return { ok: !1, error: u, attempts: o };
77
77
  }
78
- function Ya(a, i, t = 12) {
79
- const w = {};
78
+ function Qa(a, i, t = 12) {
79
+ const k = {};
80
80
  for (const p of i) {
81
81
  if (p.type !== "text") continue;
82
- const k = /* @__PURE__ */ new Set();
82
+ const j = /* @__PURE__ */ new Set();
83
83
  for (const c of a) {
84
84
  const s = c[p.name];
85
- if (!(s == null || s === "") && (k.add(String(s)), k.size > t))
85
+ if (!(s == null || s === "") && (j.add(String(s)), j.size > t))
86
86
  break;
87
87
  }
88
- k.size > 0 && k.size <= t && (w[p.name] = [...k]);
88
+ j.size > 0 && j.size <= t && (k[p.name] = [...j]);
89
89
  }
90
- return w;
90
+ return k;
91
91
  }
92
- function es({ source: a, fields: i, save: t, onClose: w }) {
93
- const { t: p } = _(), k = a.formats ?? {}, c = Object.keys(k), s = i.filter((l) => !c.includes(l.name)), o = (l) => i.find((j) => j.name === l)?.label ?? l, d = (l) => i.find((j) => j.name === l)?.type, h = (l, j) => {
94
- const g = { ...k };
95
- j === null ? delete g[l] : g[l] = j, t({ ...a, formats: Object.keys(g).length > 0 ? g : void 0 });
96
- }, r = (l, j) => {
97
- const g = { ...k[l], ...j };
98
- for (const b of Object.keys(g))
99
- (g[b] === void 0 || Array.isArray(g[b]) && g[b].length === 0) && delete g[b];
100
- h(l, g);
101
- }, u = (l, j) => {
102
- const g = j.trim() || void 0;
103
- g !== k[l]?.unit && r(l, { unit: g });
92
+ function es({ source: a, fields: i, save: t, onClose: k }) {
93
+ const { t: p } = A(), j = a.formats ?? {}, c = Object.keys(j), s = i.filter((l) => !c.includes(l.name)), o = (l) => i.find((w) => w.name === l)?.label ?? l, d = (l) => i.find((w) => w.name === l)?.type, m = (l, w) => {
94
+ const f = { ...j };
95
+ w === null ? delete f[l] : f[l] = w, t({ ...a, formats: Object.keys(f).length > 0 ? f : void 0 });
96
+ }, r = (l, w) => {
97
+ const f = { ...j[l], ...w };
98
+ for (const h of Object.keys(f))
99
+ (f[h] === void 0 || Array.isArray(f[h]) && f[h].length === 0) && delete f[h];
100
+ m(l, f);
101
+ }, u = (l, w) => {
102
+ const f = w.trim() || void 0;
103
+ f !== j[l]?.unit && r(l, { unit: f });
104
104
  };
105
105
  return /* @__PURE__ */ e.jsxs("div", { className: n.formats, children: [
106
106
  /* @__PURE__ */ e.jsxs("div", { className: n.formatsHead, children: [
107
107
  /* @__PURE__ */ e.jsx("span", { className: n.fieldLabel, children: p("workshopLab.formats.title") }),
108
108
  /* @__PURE__ */ e.jsx(
109
- F,
109
+ O,
110
110
  {
111
111
  size: "small",
112
112
  showSearch: !0,
@@ -115,15 +115,15 @@ function es({ source: a, fields: i, save: t, onClose: w }) {
115
115
  value: null,
116
116
  placeholder: p("workshopLab.formats.add"),
117
117
  options: s.map((l) => ({ value: l.name, label: l.label })),
118
- onChange: (l) => h(l, {})
118
+ onChange: (l) => m(l, {})
119
119
  }
120
120
  ),
121
- c.length === 0 && w && /* @__PURE__ */ e.jsx($, { size: "small", type: "link", onClick: w, children: p("workshopLab.blocks.cancel") })
121
+ c.length === 0 && k && /* @__PURE__ */ e.jsx($, { size: "small", type: "link", onClick: k, children: p("workshopLab.blocks.cancel") })
122
122
  ] }),
123
123
  c.map((l) => {
124
- const j = k[l], g = j.colors ?? [];
124
+ const w = j[l], f = w.colors ?? [];
125
125
  return /* @__PURE__ */ e.jsxs("div", { className: n.formatItem, children: [
126
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
126
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
127
127
  /* @__PURE__ */ e.jsx("b", { children: o(l) }),
128
128
  /* @__PURE__ */ e.jsx("span", { className: n.mono, children: l }),
129
129
  d(l) === "number" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
@@ -134,11 +134,11 @@ function es({ source: a, fields: i, save: t, onClose: w }) {
134
134
  size: "small",
135
135
  className: n.unitInput,
136
136
  maxLength: 8,
137
- defaultValue: j.unit ?? "",
138
- onBlur: (b) => u(l, b.target.value),
139
- onPressEnter: (b) => !b.nativeEvent.isComposing && u(l, b.currentTarget.value)
137
+ defaultValue: w.unit ?? "",
138
+ onBlur: (h) => u(l, h.target.value),
139
+ onPressEnter: (h) => !h.nativeEvent.isComposing && u(l, h.currentTarget.value)
140
140
  },
141
- j.unit ?? ""
141
+ w.unit ?? ""
142
142
  ),
143
143
  /* @__PURE__ */ e.jsx("span", { children: p("workshopLab.formats.decimals") }),
144
144
  /* @__PURE__ */ e.jsx(
@@ -147,8 +147,8 @@ function es({ source: a, fields: i, save: t, onClose: w }) {
147
147
  size: "small",
148
148
  min: 0,
149
149
  max: sa,
150
- value: j.decimals ?? null,
151
- onChange: (b) => r(l, { decimals: b ?? void 0 })
150
+ value: w.decimals ?? null,
151
+ onChange: (h) => r(l, { decimals: h ?? void 0 })
152
152
  }
153
153
  )
154
154
  ] }),
@@ -159,26 +159,26 @@ function es({ source: a, fields: i, save: t, onClose: w }) {
159
159
  size: "small",
160
160
  type: "link",
161
161
  icon: /* @__PURE__ */ e.jsx(ne, {}),
162
- onClick: () => r(l, { colors: [...g, { when: [], tone: "danger" }] }),
162
+ onClick: () => r(l, { colors: [...f, { when: [], tone: "danger" }] }),
163
163
  children: p("workshopLab.formats.addColor")
164
164
  }
165
165
  ),
166
- /* @__PURE__ */ e.jsx($, { size: "small", type: "link", danger: !0, onClick: () => h(l, null), children: p("workshopLab.formats.remove") })
166
+ /* @__PURE__ */ e.jsx($, { size: "small", type: "link", danger: !0, onClick: () => m(l, null), children: p("workshopLab.formats.remove") })
167
167
  ] }),
168
- g.map((b, T) => /* @__PURE__ */ e.jsxs("div", { className: n.colorRule, children: [
169
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
168
+ f.map((h, C) => /* @__PURE__ */ e.jsxs("div", { className: n.colorRule, children: [
169
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
170
170
  /* @__PURE__ */ e.jsx("span", { children: p("workshopLab.formats.when") }),
171
171
  /* @__PURE__ */ e.jsx(
172
- F,
172
+ O,
173
173
  {
174
174
  size: "small",
175
- value: b.tone,
176
- options: Ae.map((v) => ({
177
- value: v,
178
- label: p(`workshopLab.computed.tones.${v}`)
175
+ value: h.tone,
176
+ options: Ae.map((L) => ({
177
+ value: L,
178
+ label: p(`workshopLab.computed.tones.${L}`)
179
179
  })),
180
- onChange: (v) => r(l, {
181
- colors: g.map((C, S) => S === T ? { ...C, tone: v } : C)
180
+ onChange: (L) => r(l, {
181
+ colors: f.map((N, S) => S === C ? { ...N, tone: L } : N)
182
182
  })
183
183
  }
184
184
  ),
@@ -187,40 +187,100 @@ function es({ source: a, fields: i, save: t, onClose: w }) {
187
187
  {
188
188
  size: "small",
189
189
  type: "text",
190
- icon: /* @__PURE__ */ e.jsx(Y, {}),
190
+ icon: /* @__PURE__ */ e.jsx(Q, {}),
191
191
  "aria-label": p("workshopLab.formats.removeColor"),
192
- onClick: () => r(l, { colors: g.filter((v, C) => C !== T) })
192
+ onClick: () => r(l, { colors: f.filter((L, N) => N !== C) })
193
193
  }
194
194
  )
195
195
  ] }),
196
196
  /* @__PURE__ */ e.jsx(
197
- K,
197
+ X,
198
198
  {
199
- value: b.when,
199
+ value: h.when,
200
200
  fields: i,
201
201
  source: a,
202
- onChange: (v) => r(l, {
203
- colors: g.map((C, S) => S === T ? { ...C, when: v } : C)
202
+ onChange: (L) => r(l, {
203
+ colors: f.map((N, S) => S === C ? { ...N, when: L } : N)
204
204
  })
205
205
  }
206
206
  )
207
- ] }, T))
207
+ ] }, C))
208
208
  ] }, l);
209
209
  })
210
210
  ] });
211
211
  }
212
+ function as({
213
+ value: a,
214
+ onChange: i
215
+ }) {
216
+ const { t } = A(), { boxes: k, tools: p } = ka(a.box), j = (o) => k?.find((d) => d.boxId === o)?.boxName, c = k?.some((o) => o.boxId === a.box) ?? !0, s = !!a.tool && k !== null && (!c || p !== null && !p.some((o) => o.toolId === a.tool));
217
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
218
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
219
+ /* @__PURE__ */ e.jsx(
220
+ O,
221
+ {
222
+ size: "small",
223
+ showSearch: !0,
224
+ optionFilterProp: "label",
225
+ className: n.fieldSelect,
226
+ "aria-label": t("workshopLab.models.box"),
227
+ placeholder: t("workshopLab.models.box"),
228
+ loading: k === null,
229
+ value: a.box || void 0,
230
+ options: [
231
+ ...(k ?? []).map((o) => ({ value: o.boxId, label: o.boxName })),
232
+ // A box saved before but not listed now still shows, by the name it was saved with.
233
+ ...a.box && !c ? [{ value: a.box, label: a.boxName ?? a.box }] : []
234
+ ],
235
+ onChange: (o) => {
236
+ const d = j(o);
237
+ i({ box: o, tool: "", ...d ? { boxName: d } : {} });
238
+ }
239
+ }
240
+ ),
241
+ /* @__PURE__ */ e.jsx(
242
+ O,
243
+ {
244
+ size: "small",
245
+ showSearch: !0,
246
+ optionFilterProp: "label",
247
+ className: n.fieldSelect,
248
+ "aria-label": t("workshopLab.models.toolName"),
249
+ placeholder: t("workshopLab.models.toolName"),
250
+ disabled: !a.box,
251
+ loading: !!a.box && p === null,
252
+ value: a.tool || void 0,
253
+ options: [
254
+ ...(p ?? []).map((o) => ({ value: o.toolId, label: o.toolName })),
255
+ ...a.tool && p && !p.some((o) => o.toolId === a.tool) ? [{ value: a.tool, label: a.name ?? a.tool }] : []
256
+ ],
257
+ onChange: (o) => {
258
+ const d = p?.find((r) => r.toolId === o)?.toolName, m = j(a.box) ?? a.boxName;
259
+ i({
260
+ box: a.box,
261
+ tool: o,
262
+ ...d ? { name: d } : {},
263
+ ...m ? { boxName: m } : {}
264
+ });
265
+ }
266
+ }
267
+ )
268
+ ] }),
269
+ s && /* @__PURE__ */ e.jsx("span", { className: n.error, children: t("workshopLab.models.toolGone") })
270
+ ] });
271
+ }
212
272
  const Te = ["number", "date", "text"], ze = /* @__PURE__ */ new Set(["sum", "avg", "min", "max"]), we = (a, i) => {
213
273
  for (let t = 1; ; t++) if (!a.includes(`${i}${t}`)) return `${i}${t}`;
214
274
  };
215
- function as({
275
+ function ss({
216
276
  source: a,
217
277
  network: i,
218
278
  scenarioParams: t = [],
219
- save: w,
279
+ save: k,
220
280
  adding: p = !1,
221
- onClose: k
281
+ onClose: j
222
282
  }) {
223
- const { t: c } = _(), s = a.models ?? [], o = () => ({
283
+ const { t: c } = A(), s = a.models ?? [], o = () => ({
224
284
  index: s.length,
225
285
  model: {
226
286
  id: we(
@@ -234,9 +294,9 @@ function as({
234
294
  outputs: [{ name: "result", label: "", type: "number" }],
235
295
  measures: []
236
296
  }
237
- }), [d, h] = A.useState(
297
+ }), [d, m] = E.useState(
238
298
  () => p && s.length === 0 ? o() : null
239
- ), r = (u) => w({ ...a, models: u.length > 0 ? u : void 0 });
299
+ ), r = (u) => k({ ...a, models: u.length > 0 ? u : void 0 });
240
300
  return /* @__PURE__ */ e.jsxs("div", { className: n.computedItem, children: [
241
301
  /* @__PURE__ */ e.jsxs("div", { className: n.computedHead, children: [
242
302
  /* @__PURE__ */ e.jsx("b", { children: c("workshopLab.models.title") }),
@@ -246,14 +306,14 @@ function as({
246
306
  {
247
307
  size: "small",
248
308
  icon: /* @__PURE__ */ e.jsx(ne, {}),
249
- disabled: s.length >= La,
250
- onClick: () => h(o()),
309
+ disabled: s.length >= va,
310
+ onClick: () => m(o()),
251
311
  children: c("workshopLab.models.add")
252
312
  }
253
313
  )
254
314
  ] }),
255
315
  s.map((u, l) => {
256
- const j = u.action ? be(i, u.action.id) : void 0;
316
+ const w = u.action ? be(i, u.action.id) : void 0;
257
317
  return /* @__PURE__ */ e.jsxs("div", { className: n.operationItem, children: [
258
318
  /* @__PURE__ */ e.jsxs("span", { children: [
259
319
  /* @__PURE__ */ e.jsx("b", { children: u.label }),
@@ -261,18 +321,18 @@ function as({
261
321
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: u.tool.name ?? u.tool.tool })
262
322
  ] }),
263
323
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: c("workshopLab.models.summary", {
264
- params: u.params.map((g) => g.label).join("、") || "—",
265
- outputs: u.outputs.map((g) => g.label).join("、"),
266
- measures: u.measures.map((g) => g.label).join("、")
324
+ params: u.params.map((f) => f.label).join("、") || "—",
325
+ outputs: u.outputs.map((f) => f.label).join("、"),
326
+ measures: u.measures.map((f) => f.label).join("、")
267
327
  }) }),
268
- /* @__PURE__ */ e.jsx("span", { className: n.muted, children: j ? c("workshopLab.models.actionText", { name: j.name }) : c("workshopLab.models.noAction") }),
269
- /* @__PURE__ */ e.jsxs(P, { size: 4, children: [
270
- /* @__PURE__ */ e.jsx($, { size: "small", type: "link", onClick: () => h({ index: l, model: u }), children: c("workshopLab.computed.edit") }),
328
+ /* @__PURE__ */ e.jsx("span", { className: n.muted, children: w ? c("workshopLab.models.actionText", { name: w.name }) : c("workshopLab.models.noAction") }),
329
+ /* @__PURE__ */ e.jsxs(F, { size: 4, children: [
330
+ /* @__PURE__ */ e.jsx($, { size: "small", type: "link", onClick: () => m({ index: l, model: u }), children: c("workshopLab.computed.edit") }),
271
331
  /* @__PURE__ */ e.jsx(
272
332
  ee,
273
333
  {
274
334
  title: c("workshopLab.models.removeConfirm", { name: u.label }),
275
- onConfirm: () => r(s.filter((g, b) => b !== l)),
335
+ onConfirm: () => r(s.filter((f, h) => h !== l)),
276
336
  children: /* @__PURE__ */ e.jsx($, { size: "small", type: "link", danger: !0, children: c("workshopLab.computed.remove") })
277
337
  }
278
338
  )
@@ -280,7 +340,7 @@ function as({
280
340
  ] }, u.id);
281
341
  }),
282
342
  d && /* @__PURE__ */ e.jsx(
283
- ss,
343
+ os,
284
344
  {
285
345
  initial: d.model,
286
346
  source: a,
@@ -288,44 +348,44 @@ function as({
288
348
  scenarioParams: t,
289
349
  others: s.filter((u, l) => l !== d.index),
290
350
  onCancel: () => {
291
- h(null), s.length === 0 && k?.();
351
+ m(null), s.length === 0 && j?.();
292
352
  },
293
353
  onSave: (u) => {
294
354
  const l = [...s];
295
- l[d.index] = u, r(l) && h(null);
355
+ l[d.index] = u, r(l) && m(null);
296
356
  }
297
357
  }
298
358
  )
299
359
  ] });
300
360
  }
301
- function ss({
361
+ function os({
302
362
  initial: a,
303
363
  source: i,
304
364
  network: t,
305
- scenarioParams: w,
365
+ scenarioParams: k,
306
366
  others: p,
307
- onCancel: k,
367
+ onCancel: j,
308
368
  onSave: c
309
369
  }) {
310
- const { t: s } = _(), [o, d] = A.useState(a), h = (m) => d({ ...o, ...m }), { boxes: r, tools: u } = ka(o.tool.box), l = ge(i, t), j = t.objectTypes[i.objectType]?.properties ?? [], g = ya(i, t, o), b = (t.actionTypes ?? []).filter(
311
- (m) => m.objectType === i.objectType
312
- ), T = o.action ? be(t, o.action.id) : void 0, v = {
370
+ const { t: s } = A(), [o, d] = E.useState(a), m = (x) => d({ ...o, ...x }), r = xe(i, t), u = t.objectTypes[i.objectType]?.properties ?? [], l = ya(i, t, o), w = (t.actionTypes ?? []).filter(
371
+ (x) => x.objectType === i.objectType
372
+ ), f = o.action ? be(t, o.action.id) : void 0, h = {
313
373
  ...o,
314
374
  label: o.label.trim(),
315
375
  ...o.description?.trim() ? { description: o.description.trim() } : {}
316
376
  };
317
- v.description || delete v.description;
318
- const C = v.label ? Na([...p, v], i, t, "model").filter(
319
- (m) => m.startsWith(`model[${p.length}]`)
320
- ) : [s("workshopLab.models.needLabel")], S = (m, x, y) => h({
321
- [m]: o[m].map(
322
- (R, M) => M === x ? { ...R, ...y } : R
377
+ h.description || delete h.description;
378
+ const C = h.label ? Na([...p, h], i, t, "model").filter(
379
+ (x) => x.startsWith(`model[${p.length}]`)
380
+ ) : [s("workshopLab.models.needLabel")], L = (x, b, g) => m({
381
+ [x]: o[x].map(
382
+ (T, _) => _ === b ? { ...T, ...g } : T
323
383
  )
324
- }), N = (m, x) => h({ [m]: o[m].filter((y, R) => R !== x) }), O = (m, x) => {
384
+ }), N = (x, b) => m({ [x]: o[x].filter((g, T) => T !== b) }), S = (x, b) => {
325
385
  if (!o.action) return;
326
- const y = { ...o.action.params };
327
- x ? y[m] = x : delete y[m], h({ action: { ...o.action, params: y } });
328
- }, L = (m) => m ? m.from === "const" ? "const" : `${m.from}:${m.name}` : void 0;
386
+ const g = { ...o.action.params };
387
+ b ? g[x] = b : delete g[x], m({ action: { ...o.action, params: g } });
388
+ }, y = (x) => x ? x.from === "const" ? "const" : `${x.from}:${x.name}` : void 0;
329
389
  return /* @__PURE__ */ e.jsx(
330
390
  ae,
331
391
  {
@@ -334,11 +394,11 @@ function ss({
334
394
  title: a.label ? s("workshopLab.models.editTitle", { name: a.label }) : s("workshopLab.models.newTitle"),
335
395
  okText: s("workshopLab.computed.save"),
336
396
  okButtonProps: { disabled: C.length > 0 },
337
- onOk: () => c(v),
338
- onCancel: k,
397
+ onOk: () => c(h),
398
+ onCancel: j,
339
399
  children: /* @__PURE__ */ e.jsxs("div", { className: n.computedForm, children: [
340
400
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.models.hint") }),
341
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
401
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
342
402
  /* @__PURE__ */ e.jsx("span", { children: s("workshopLab.models.label") }),
343
403
  /* @__PURE__ */ e.jsx(
344
404
  I,
@@ -348,7 +408,7 @@ function ss({
348
408
  maxLength: 30,
349
409
  placeholder: s("workshopLab.models.labelHint"),
350
410
  value: o.label,
351
- onChange: (m) => h({ label: m.target.value })
411
+ onChange: (x) => m({ label: x.target.value })
352
412
  }
353
413
  )
354
414
  ] }),
@@ -358,70 +418,28 @@ function ss({
358
418
  size: "small",
359
419
  placeholder: s("workshopLab.models.description"),
360
420
  value: o.description ?? "",
361
- onChange: (m) => h({ description: m.target.value })
421
+ onChange: (x) => m({ description: x.target.value })
362
422
  }
363
423
  ),
364
424
  /* @__PURE__ */ e.jsx("b", { children: s("workshopLab.models.tool") }),
365
425
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.models.toolHint") }),
366
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
367
- /* @__PURE__ */ e.jsx(
368
- F,
369
- {
370
- size: "small",
371
- showSearch: !0,
372
- optionFilterProp: "label",
373
- className: n.fieldSelect,
374
- "aria-label": s("workshopLab.models.box"),
375
- placeholder: s("workshopLab.models.box"),
376
- loading: r === null,
377
- value: o.tool.box || void 0,
378
- options: [
379
- ...(r ?? []).map((m) => ({ value: m.boxId, label: m.boxName })),
380
- // A box saved before but not listed now still shows, by its id.
381
- ...o.tool.box && r && !r.some((m) => m.boxId === o.tool.box) ? [{ value: o.tool.box, label: o.tool.box }] : []
382
- ],
383
- onChange: (m) => h({ tool: { box: m, tool: "" } })
384
- }
385
- ),
386
- /* @__PURE__ */ e.jsx(
387
- F,
388
- {
389
- size: "small",
390
- showSearch: !0,
391
- optionFilterProp: "label",
392
- className: n.fieldSelect,
393
- "aria-label": s("workshopLab.models.toolName"),
394
- placeholder: s("workshopLab.models.toolName"),
395
- disabled: !o.tool.box,
396
- loading: !!o.tool.box && u === null,
397
- value: o.tool.tool || void 0,
398
- options: [
399
- ...(u ?? []).map((m) => ({ value: m.toolId, label: m.toolName })),
400
- ...o.tool.tool && u && !u.some((m) => m.toolId === o.tool.tool) ? [{ value: o.tool.tool, label: o.tool.name ?? o.tool.tool }] : []
401
- ],
402
- onChange: (m) => {
403
- const x = u?.find((y) => y.toolId === m)?.toolName;
404
- h({ tool: { box: o.tool.box, tool: m, ...x ? { name: x } : {} } });
405
- }
406
- }
407
- )
408
- ] }),
426
+ /* @__PURE__ */ e.jsx(as, { value: o.tool, onChange: (x) => m({ tool: x }) }),
409
427
  /* @__PURE__ */ e.jsx("b", { children: s("workshopLab.models.inputs") }),
410
428
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.models.inputsHint") }),
411
429
  /* @__PURE__ */ e.jsx(
412
- F,
430
+ O,
413
431
  {
414
432
  size: "small",
415
433
  mode: "multiple",
416
434
  "aria-label": s("workshopLab.models.inputs"),
417
435
  value: o.inputs,
418
- options: l.map((m) => ({ value: m.name, label: m.label })),
419
- onChange: (m) => h({ inputs: m })
436
+ options: r.map((x) => ({ value: x.name, label: x.label })),
437
+ onChange: (x) => m({ inputs: x })
420
438
  }
421
439
  ),
422
440
  /* @__PURE__ */ e.jsx("b", { children: s("workshopLab.models.params") }),
423
441
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.models.paramsHint") }),
424
- o.params.map((m, x) => /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
442
+ o.params.map((x, b) => /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
425
443
  /* @__PURE__ */ e.jsx(
426
444
  I,
427
445
  {
@@ -429,8 +447,8 @@ function ss({
429
447
  className: n.fieldSelect,
430
448
  "aria-label": s("workshopLab.models.paramName"),
431
449
  placeholder: s("workshopLab.models.paramName"),
432
- value: m.name,
433
- onChange: (y) => S("params", x, { name: y.target.value.trim() })
450
+ value: x.name,
451
+ onChange: (g) => L("params", b, { name: g.target.value.trim() })
434
452
  }
435
453
  ),
436
454
  /* @__PURE__ */ e.jsx(
@@ -440,22 +458,22 @@ function ss({
440
458
  className: n.fieldSelect,
441
459
  "aria-label": s("workshopLab.models.paramLabel"),
442
460
  placeholder: s("workshopLab.models.paramLabel"),
443
- value: m.label,
444
- onChange: (y) => S("params", x, { label: y.target.value })
461
+ value: x.label,
462
+ onChange: (g) => L("params", b, { label: g.target.value })
445
463
  }
446
464
  ),
447
465
  /* @__PURE__ */ e.jsx(
448
- F,
466
+ O,
449
467
  {
450
468
  size: "small",
451
469
  "aria-label": s("workshopLab.models.paramType"),
452
- value: m.type,
453
- options: Te.map((y) => ({
454
- value: y,
455
- label: s(`workshopLab.operations.types.${y}`)
470
+ value: x.type,
471
+ options: Te.map((g) => ({
472
+ value: g,
473
+ label: s(`workshopLab.operations.types.${g}`)
456
474
  })),
457
- onChange: (y) => S("params", x, {
458
- type: y,
475
+ onChange: (g) => L("params", b, {
476
+ type: g,
459
477
  min: void 0,
460
478
  max: void 0,
461
479
  default: void 0,
@@ -464,26 +482,26 @@ function ss({
464
482
  }
465
483
  ),
466
484
  /* @__PURE__ */ e.jsx(
467
- F,
485
+ O,
468
486
  {
469
487
  size: "small",
470
488
  allowClear: !0,
471
489
  className: n.fieldSelect,
472
490
  "aria-label": s("workshopLab.models.scenarioParam"),
473
491
  placeholder: s("workshopLab.models.scenarioParam"),
474
- value: m.scenarioParam,
475
- options: w.filter((y) => y.type === m.type).map((y) => ({ value: y.name, label: y.label })),
476
- onChange: (y) => S("params", x, { scenarioParam: y })
492
+ value: x.scenarioParam,
493
+ options: k.filter((g) => g.type === x.type).map((g) => ({ value: g.name, label: g.label })),
494
+ onChange: (g) => L("params", b, { scenarioParam: g })
477
495
  }
478
496
  ),
479
- m.type === "number" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
497
+ x.type === "number" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
480
498
  /* @__PURE__ */ e.jsx(
481
499
  G,
482
500
  {
483
501
  size: "small",
484
502
  placeholder: s("workshopLab.operations.min"),
485
- value: m.min ?? null,
486
- onChange: (y) => S("params", x, { min: y ?? void 0 })
503
+ value: x.min ?? null,
504
+ onChange: (g) => L("params", b, { min: g ?? void 0 })
487
505
  }
488
506
  ),
489
507
  /* @__PURE__ */ e.jsx(
@@ -491,8 +509,8 @@ function ss({
491
509
  {
492
510
  size: "small",
493
511
  placeholder: s("workshopLab.operations.max"),
494
- value: m.max ?? null,
495
- onChange: (y) => S("params", x, { max: y ?? void 0 })
512
+ value: x.max ?? null,
513
+ onChange: (g) => L("params", b, { max: g ?? void 0 })
496
514
  }
497
515
  ),
498
516
  /* @__PURE__ */ e.jsx(
@@ -500,8 +518,8 @@ function ss({
500
518
  {
501
519
  size: "small",
502
520
  placeholder: s("workshopLab.operations.default"),
503
- value: typeof m.default == "number" ? m.default : null,
504
- onChange: (y) => S("params", x, { default: y ?? void 0 })
521
+ value: typeof x.default == "number" ? x.default : null,
522
+ onChange: (g) => L("params", b, { default: g ?? void 0 })
505
523
  }
506
524
  )
507
525
  ] }) : /* @__PURE__ */ e.jsx(
@@ -509,10 +527,10 @@ function ss({
509
527
  {
510
528
  size: "small",
511
529
  className: n.fieldSelect,
512
- type: m.type === "date" ? "date" : "text",
530
+ type: x.type === "date" ? "date" : "text",
513
531
  placeholder: s("workshopLab.operations.default"),
514
- value: typeof m.default == "string" ? m.default : "",
515
- onChange: (y) => S("params", x, { default: y.target.value || void 0 })
532
+ value: typeof x.default == "string" ? x.default : "",
533
+ onChange: (g) => L("params", b, { default: g.target.value || void 0 })
516
534
  }
517
535
  ),
518
536
  /* @__PURE__ */ e.jsx(
@@ -521,23 +539,23 @@ function ss({
521
539
  size: "small",
522
540
  type: "text",
523
541
  danger: !0,
524
- icon: /* @__PURE__ */ e.jsx(Y, {}),
542
+ icon: /* @__PURE__ */ e.jsx(Q, {}),
525
543
  "aria-label": s("workshopLab.config.removeItem"),
526
- onClick: () => N("params", x)
544
+ onClick: () => N("params", b)
527
545
  }
528
546
  )
529
- ] }, x)),
547
+ ] }, b)),
530
548
  /* @__PURE__ */ e.jsx(
531
549
  $,
532
550
  {
533
551
  size: "small",
534
552
  disabled: o.params.length >= Be,
535
- onClick: () => h({
553
+ onClick: () => m({
536
554
  params: [
537
555
  ...o.params,
538
556
  {
539
557
  name: we(
540
- o.params.map((m) => m.name),
558
+ o.params.map((x) => x.name),
541
559
  "p"
542
560
  ),
543
561
  label: "",
@@ -550,7 +568,7 @@ function ss({
550
568
  ),
551
569
  /* @__PURE__ */ e.jsx("b", { children: s("workshopLab.models.outputs") }),
552
570
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.models.outputsHint") }),
553
- o.outputs.map((m, x) => /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
571
+ o.outputs.map((x, b) => /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
554
572
  /* @__PURE__ */ e.jsx(
555
573
  I,
556
574
  {
@@ -558,8 +576,8 @@ function ss({
558
576
  className: n.fieldSelect,
559
577
  "aria-label": s("workshopLab.models.outputName"),
560
578
  placeholder: s("workshopLab.models.outputName"),
561
- value: m.name,
562
- onChange: (y) => S("outputs", x, { name: y.target.value.trim() })
579
+ value: x.name,
580
+ onChange: (g) => L("outputs", b, { name: g.target.value.trim() })
563
581
  }
564
582
  ),
565
583
  /* @__PURE__ */ e.jsx(
@@ -569,21 +587,21 @@ function ss({
569
587
  className: n.fieldSelect,
570
588
  "aria-label": s("workshopLab.models.outputLabel"),
571
589
  placeholder: s("workshopLab.models.outputLabel"),
572
- value: m.label,
573
- onChange: (y) => S("outputs", x, { label: y.target.value })
590
+ value: x.label,
591
+ onChange: (g) => L("outputs", b, { label: g.target.value })
574
592
  }
575
593
  ),
576
594
  /* @__PURE__ */ e.jsx(
577
- F,
595
+ O,
578
596
  {
579
597
  size: "small",
580
598
  "aria-label": s("workshopLab.models.outputType"),
581
- value: m.type,
582
- options: Te.map((y) => ({
583
- value: y,
584
- label: s(`workshopLab.operations.types.${y}`)
599
+ value: x.type,
600
+ options: Te.map((g) => ({
601
+ value: g,
602
+ label: s(`workshopLab.operations.types.${g}`)
585
603
  })),
586
- onChange: (y) => S("outputs", x, { type: y })
604
+ onChange: (g) => L("outputs", b, { type: g })
587
605
  }
588
606
  ),
589
607
  /* @__PURE__ */ e.jsx(
@@ -592,24 +610,24 @@ function ss({
592
610
  size: "small",
593
611
  type: "text",
594
612
  danger: !0,
595
- icon: /* @__PURE__ */ e.jsx(Y, {}),
613
+ icon: /* @__PURE__ */ e.jsx(Q, {}),
596
614
  "aria-label": s("workshopLab.config.removeItem"),
597
615
  disabled: o.outputs.length <= 1,
598
- onClick: () => N("outputs", x)
616
+ onClick: () => N("outputs", b)
599
617
  }
600
618
  )
601
- ] }, x)),
619
+ ] }, b)),
602
620
  /* @__PURE__ */ e.jsx(
603
621
  $,
604
622
  {
605
623
  size: "small",
606
624
  disabled: o.outputs.length >= Sa,
607
- onClick: () => h({
625
+ onClick: () => m({
608
626
  outputs: [
609
627
  ...o.outputs,
610
628
  {
611
629
  name: we(
612
- o.outputs.map((m) => m.name),
630
+ o.outputs.map((x) => x.name),
613
631
  "result"
614
632
  ),
615
633
  label: "",
@@ -622,8 +640,8 @@ function ss({
622
640
  ),
623
641
  /* @__PURE__ */ e.jsx("b", { children: s("workshopLab.models.measures") }),
624
642
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.models.measuresHint") }),
625
- o.measures.map((m, x) => /* @__PURE__ */ e.jsxs("div", { className: n.computedItem, children: [
626
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
643
+ o.measures.map((x, b) => /* @__PURE__ */ e.jsxs("div", { className: n.computedItem, children: [
644
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
627
645
  /* @__PURE__ */ e.jsx(
628
646
  I,
629
647
  {
@@ -631,36 +649,36 @@ function ss({
631
649
  className: n.fieldSelect,
632
650
  "aria-label": s("workshopLab.models.measureLabel"),
633
651
  placeholder: s("workshopLab.models.measureLabel"),
634
- value: m.label,
635
- onChange: (y) => S("measures", x, { label: y.target.value })
652
+ value: x.label,
653
+ onChange: (g) => L("measures", b, { label: g.target.value })
636
654
  }
637
655
  ),
638
656
  /* @__PURE__ */ e.jsx(
639
- F,
657
+ O,
640
658
  {
641
659
  size: "small",
642
660
  "aria-label": s("workshopLab.models.measureAggregate"),
643
- value: m.aggregate,
644
- options: Ca.map((y) => ({
645
- value: y,
646
- label: s(`workshopLab.models.aggregates.${y}`)
661
+ value: x.aggregate,
662
+ options: Ca.map((g) => ({
663
+ value: g,
664
+ label: s(`workshopLab.models.aggregates.${g}`)
647
665
  })),
648
- onChange: (y) => S("measures", x, {
649
- aggregate: y,
650
- ...ze.has(y) ? {} : { valueField: void 0 }
666
+ onChange: (g) => L("measures", b, {
667
+ aggregate: g,
668
+ ...ze.has(g) ? {} : { valueField: void 0 }
651
669
  })
652
670
  }
653
671
  ),
654
- ze.has(m.aggregate) && /* @__PURE__ */ e.jsx(
655
- F,
672
+ ze.has(x.aggregate) && /* @__PURE__ */ e.jsx(
673
+ O,
656
674
  {
657
675
  size: "small",
658
676
  className: n.fieldSelect,
659
677
  "aria-label": s("workshopLab.models.valueField"),
660
678
  placeholder: s("workshopLab.models.valueField"),
661
- value: m.valueField,
662
- options: g.filter((y) => y.type === "number").map((y) => ({ value: y.name, label: y.label || y.name })),
663
- onChange: (y) => S("measures", x, { valueField: y })
679
+ value: x.valueField,
680
+ options: l.filter((g) => g.type === "number").map((g) => ({ value: g.name, label: g.label || g.name })),
681
+ onChange: (g) => L("measures", b, { valueField: g })
664
682
  }
665
683
  ),
666
684
  /* @__PURE__ */ e.jsx(
@@ -669,102 +687,102 @@ function ss({
669
687
  size: "small",
670
688
  type: "text",
671
689
  danger: !0,
672
- icon: /* @__PURE__ */ e.jsx(Y, {}),
690
+ icon: /* @__PURE__ */ e.jsx(Q, {}),
673
691
  "aria-label": s("workshopLab.config.removeItem"),
674
- onClick: () => N("measures", x)
692
+ onClick: () => N("measures", b)
675
693
  }
676
694
  )
677
695
  ] }),
678
696
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.models.measureWhen") }),
679
697
  /* @__PURE__ */ e.jsx(
680
- K,
698
+ X,
681
699
  {
682
- value: m.when,
683
- onChange: (y) => S("measures", x, { when: y.length ? y : void 0 }),
684
- fields: g,
700
+ value: x.when,
701
+ onChange: (g) => L("measures", b, { when: g.length ? g : void 0 }),
702
+ fields: l,
685
703
  source: i
686
704
  }
687
705
  )
688
- ] }, x)),
706
+ ] }, b)),
689
707
  /* @__PURE__ */ e.jsx(
690
708
  $,
691
709
  {
692
710
  size: "small",
693
711
  disabled: o.measures.length >= Ta,
694
- onClick: () => h({ measures: [...o.measures, { label: "", aggregate: "count" }] }),
712
+ onClick: () => m({ measures: [...o.measures, { label: "", aggregate: "count" }] }),
695
713
  children: s("workshopLab.models.addMeasure")
696
714
  }
697
715
  ),
698
716
  /* @__PURE__ */ e.jsx("b", { children: s("workshopLab.models.action") }),
699
717
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.models.actionHint") }),
700
718
  /* @__PURE__ */ e.jsx(
701
- F,
719
+ O,
702
720
  {
703
721
  size: "small",
704
722
  allowClear: !0,
705
723
  "aria-label": s("workshopLab.models.action"),
706
724
  placeholder: s("workshopLab.models.noAction"),
707
725
  value: o.action?.id,
708
- options: b.map((m) => ({ value: m.id, label: m.name })),
709
- onChange: (m) => {
710
- const x = { ...o };
711
- m ? x.action = { id: m, params: {} } : delete x.action, d(x);
726
+ options: w.map((x) => ({ value: x.id, label: x.name })),
727
+ onChange: (x) => {
728
+ const b = { ...o };
729
+ x ? b.action = { id: x, params: {} } : delete b.action, d(b);
712
730
  }
713
731
  }
714
732
  ),
715
- T?.inputs.map((m) => /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
716
- /* @__PURE__ */ e.jsx("span", { children: m.name }),
733
+ f?.inputs.map((x) => /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
734
+ /* @__PURE__ */ e.jsx("span", { children: x.name }),
717
735
  /* @__PURE__ */ e.jsx(
718
- F,
736
+ O,
719
737
  {
720
738
  size: "small",
721
739
  className: n.fieldSelect,
722
740
  allowClear: !0,
723
- "aria-label": m.name,
741
+ "aria-label": x.name,
724
742
  placeholder: s("workshopLab.models.sameName"),
725
- value: L(o.action?.params?.[m.name]),
743
+ value: y(o.action?.params?.[x.name]),
726
744
  options: [
727
- ...o.outputs.map((x) => ({
728
- value: `output:${x.name}`,
729
- label: s("workshopLab.models.fromOutput", { name: x.label || x.name })
745
+ ...o.outputs.map((b) => ({
746
+ value: `output:${b.name}`,
747
+ label: s("workshopLab.models.fromOutput", { name: b.label || b.name })
730
748
  })),
731
- ...o.params.map((x) => ({
732
- value: `param:${x.name}`,
733
- label: s("workshopLab.operations.fromParam", { name: x.label || x.name })
749
+ ...o.params.map((b) => ({
750
+ value: `param:${b.name}`,
751
+ label: s("workshopLab.operations.fromParam", { name: b.label || b.name })
734
752
  })),
735
- ...j.map((x) => ({
736
- value: `field:${x.name}`,
737
- label: s("workshopLab.models.fromField", { name: x.label })
753
+ ...u.map((b) => ({
754
+ value: `field:${b.name}`,
755
+ label: s("workshopLab.models.fromField", { name: b.label })
738
756
  })),
739
757
  { value: "const", label: s("workshopLab.operations.fromConst") }
740
758
  ],
741
- onChange: (x) => {
742
- if (!x) return O(m.name, void 0);
743
- if (x === "const") return O(m.name, { from: "const", value: "" });
744
- const [y, R] = x.split(/:(.*)/s);
745
- O(m.name, { from: y, name: R });
759
+ onChange: (b) => {
760
+ if (!b) return S(x.name, void 0);
761
+ if (b === "const") return S(x.name, { from: "const", value: "" });
762
+ const [g, T] = b.split(/:(.*)/s);
763
+ S(x.name, { from: g, name: T });
746
764
  }
747
765
  }
748
766
  ),
749
- o.action?.params?.[m.name]?.from === "const" && /* @__PURE__ */ e.jsx(
767
+ o.action?.params?.[x.name]?.from === "const" && /* @__PURE__ */ e.jsx(
750
768
  I,
751
769
  {
752
770
  size: "small",
753
771
  className: n.fieldSelect,
754
- "aria-label": `${m.name} ${s("workshopLab.operations.fromConst")}`,
772
+ "aria-label": `${x.name} ${s("workshopLab.operations.fromConst")}`,
755
773
  value: String(
756
- o.action.params[m.name].value ?? ""
774
+ o.action.params[x.name].value ?? ""
757
775
  ),
758
- onChange: (x) => O(m.name, { from: "const", value: x.target.value })
776
+ onChange: (b) => S(x.name, { from: "const", value: b.target.value })
759
777
  }
760
778
  )
761
- ] }, m.name)),
762
- C.length > 0 && v.label && /* @__PURE__ */ e.jsx(
779
+ ] }, x.name)),
780
+ C.length > 0 && h.label && /* @__PURE__ */ e.jsx(
763
781
  re,
764
782
  {
765
783
  type: "warning",
766
784
  showIcon: !0,
767
- message: C.slice(0, 3).map((m) => m.replace(/^model\[\d+\]\.?/, "")).join(";")
785
+ message: C.slice(0, 3).map((x) => x.replace(/^model\[\d+\]\.?/, "")).join(";")
768
786
  }
769
787
  )
770
788
  ] })
@@ -772,110 +790,110 @@ function ss({
772
790
  );
773
791
  }
774
792
  function $e() {
775
- const { t: a } = _();
776
- return /* @__PURE__ */ e.jsx(xe, { title: a("workshopLab.generated.tagHint"), children: /* @__PURE__ */ e.jsx(J, { color: "blue", children: a("workshopLab.generated.tag") }) });
793
+ const { t: a } = A();
794
+ return /* @__PURE__ */ e.jsx(ge, { title: a("workshopLab.generated.tagHint"), children: /* @__PURE__ */ e.jsx(J, { color: "blue", children: a("workshopLab.generated.tag") }) });
777
795
  }
778
796
  function Ue(a, i, t) {
779
797
  if (!a?.length) return t("workshopLab.dataView.allObjects");
780
- const w = (p) => p === Q ? t("workshopLab.computed.asOf") : i.find((k) => k.name === p)?.label ?? p;
798
+ const k = (p) => p === Y ? t("workshopLab.computed.asOf") : i.find((j) => j.name === p)?.label ?? p;
781
799
  return a.map((p) => {
782
- const k = p.ref !== void 0 ? w(p.ref) : p.values ? p.values.map((c) => Le(p.field, c)).join("、") : p.value !== void 0 ? Le(p.field, String(p.value)) : "";
783
- return [w(p.field), t(`workshopLab.computed.ops.${p.op}`), k].filter(Boolean).join(" ");
800
+ const j = p.ref !== void 0 ? k(p.ref) : p.values ? p.values.map((c) => ve(p.field, c)).join("、") : p.value !== void 0 ? ve(p.field, String(p.value)) : "";
801
+ return [k(p.field), t(`workshopLab.computed.ops.${p.op}`), j].filter(Boolean).join(" ");
784
802
  }).join(",");
785
803
  }
786
804
  const Oe = { sources: /* @__PURE__ */ new Map(), columns: /* @__PURE__ */ new Map() };
787
- function os(a, i, t) {
788
- const w = a.scheduleModel;
789
- if (!w) return Oe;
805
+ function ls(a, i, t) {
806
+ const k = a.scheduleModel;
807
+ if (!k) return Oe;
790
808
  let p;
791
809
  try {
792
- p = ja(w, i);
810
+ p = ja(k, i);
793
811
  } catch {
794
812
  return Oe;
795
813
  }
796
- const k = new Map(a.sources.map((b) => [b.id, b])), c = (b) => i.objectTypes[b]?.name ?? b, s = (b) => k.get(b)?.label ?? p.sources.find((T) => T.id === b)?.label ?? b, o = (b) => b ? [
797
- ...i.objectTypes[b.objectType]?.properties ?? [],
798
- ...(b.computed ?? []).map(te)
799
- ] : [], d = (b, T) => o(b).find((v) => v.name === T)?.label ?? T, h = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), u = w.result === "record" ? w.record : void 0, l = k.get(U.task(0)), j = u?.active?.length ? U.activePlan : U.plan;
800
- for (const b of p.sources) {
801
- const T = k.get(b.id);
802
- if (!T) continue;
803
- const v = c(b.objectType), C = /^scheduleTask(\d+)$/.exec(b.id);
814
+ const j = new Map(a.sources.map((h) => [h.id, h])), c = (h) => i.objectTypes[h]?.name ?? h, s = (h) => j.get(h)?.label ?? p.sources.find((C) => C.id === h)?.label ?? h, o = (h) => h ? [
815
+ ...i.objectTypes[h.objectType]?.properties ?? [],
816
+ ...(h.computed ?? []).map(te)
817
+ ] : [], d = (h, C) => o(h).find((L) => L.name === C)?.label ?? C, m = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), u = k.result === "record" ? k.record : void 0, l = j.get(U.task(0)), w = u?.active?.length ? U.activePlan : U.plan;
818
+ for (const h of p.sources) {
819
+ const C = j.get(h.id);
820
+ if (!C) continue;
821
+ const L = c(h.objectType), N = /^scheduleTask(\d+)$/.exec(h.id);
804
822
  let S;
805
- C && u ? S = t("workshopLab.generated.sources.demand", { type: v }) : C ? S = t("workshopLab.generated.sources.task", { type: v }) : b.id === U.unplanned ? S = t(
806
- l?.computed?.some((O) => O.name === ke.open) ? "workshopLab.generated.sources.unplannedOpen" : "workshopLab.generated.sources.unplanned",
807
- { type: v }
808
- ) : b.id === U.plan ? S = t("workshopLab.generated.sources.plan", { type: v }) : b.id === U.activePlan ? S = t("workshopLab.generated.sources.activePlan", {
823
+ N && u ? S = t("workshopLab.generated.sources.demand", { type: L }) : N ? S = t("workshopLab.generated.sources.task", { type: L }) : h.id === U.unplanned ? S = t(
824
+ l?.computed?.some((x) => x.name === ke.open) ? "workshopLab.generated.sources.unplannedOpen" : "workshopLab.generated.sources.unplanned",
825
+ { type: L }
826
+ ) : h.id === U.plan ? S = t("workshopLab.generated.sources.plan", { type: L }) : h.id === U.activePlan ? S = t("workshopLab.generated.sources.activePlan", {
809
827
  plan: s(U.plan),
810
- when: Ue(T.from?.where, o(k.get(U.plan)), t)
811
- }) : b.id === U.resource ? S = t("workshopLab.generated.sources.resource", { type: v }) : b.id.startsWith("scheduleCalendar") && (S = t("workshopLab.generated.sources.calendar", { type: v })), S && h.set(b.id, S);
812
- const N = /* @__PURE__ */ new Map();
813
- for (const O of b.computed ?? []) {
814
- const L = T.computed?.find((x) => x.name === O.name);
815
- if (!L) continue;
816
- const m = g(L, T);
817
- m && N.set(L.name, m);
828
+ when: Ue(C.from?.where, o(j.get(U.plan)), t)
829
+ }) : h.id === U.resource ? S = t("workshopLab.generated.sources.resource", { type: L }) : h.id.startsWith("scheduleCalendar") && (S = t("workshopLab.generated.sources.calendar", { type: L })), S && m.set(h.id, S);
830
+ const y = /* @__PURE__ */ new Map();
831
+ for (const x of h.computed ?? []) {
832
+ const b = C.computed?.find((T) => T.name === x.name);
833
+ if (!b) continue;
834
+ const g = f(b, C);
835
+ g && y.set(b.name, g);
818
836
  }
819
- N.size > 0 && r.set(b.id, N);
837
+ y.size > 0 && r.set(h.id, y);
820
838
  }
821
- return { sources: h, columns: r };
822
- function g(b, T) {
823
- if (b.kind === "matched") {
824
- const v = b.pairs.map((S) => d(T, S.field)).join(t("workshopLab.scheduleModel.wizard.listJoiner")), C = s(
825
- b.source === U.plan && b.where?.length ? j : b.source
839
+ return { sources: m, columns: r };
840
+ function f(h, C) {
841
+ if (h.kind === "matched") {
842
+ const L = h.pairs.map((S) => d(C, S.field)).join(t("workshopLab.scheduleModel.wizard.listJoiner")), N = s(
843
+ h.source === U.plan && h.where?.length ? w : h.source
826
844
  );
827
- return b.field ? t("workshopLab.generated.columns.matchedValue", { label: b.label, pairs: v, from: C }) : t("workshopLab.generated.columns.matchedCount", { label: b.label, pairs: v, from: C });
845
+ return h.field ? t("workshopLab.generated.columns.matchedValue", { label: h.label, pairs: L, from: N }) : t("workshopLab.generated.columns.matchedCount", { label: h.label, pairs: L, from: N });
828
846
  }
829
- if (b.kind === "classify" && b.name === ke.scheduled) {
830
- const v = b.cases.map((C) => C.value);
847
+ if (h.kind === "classify" && h.name === ke.scheduled) {
848
+ const L = h.cases.map((N) => N.value);
831
849
  return t("workshopLab.generated.columns.planned", {
832
- label: b.label,
833
- yes: v[0] ?? "",
834
- unknown: v[1] ?? "",
835
- no: b.otherwise.value
850
+ label: h.label,
851
+ yes: L[0] ?? "",
852
+ unknown: L[1] ?? "",
853
+ no: h.otherwise.value
836
854
  });
837
855
  }
838
- if (b.kind === "classify" && b.name === ke.open)
856
+ if (h.kind === "classify" && h.name === ke.open)
839
857
  return t("workshopLab.generated.columns.open", {
840
- label: b.label,
841
- done: b.cases[0]?.value ?? "",
842
- open: b.otherwise.value
858
+ label: h.label,
859
+ done: h.cases[0]?.value ?? "",
860
+ open: h.otherwise.value
843
861
  });
844
- if (b.kind === "related" && b.name === U.groupName)
845
- return t("workshopLab.generated.columns.groupName", { label: b.label });
862
+ if (h.kind === "related" && h.name === U.groupName)
863
+ return t("workshopLab.generated.columns.groupName", { label: h.label });
846
864
  }
847
865
  }
848
866
  const Fe = {
849
867
  date: ["shiftDays", "fromAsOf", "set"],
850
868
  number: ["add", "set"],
851
869
  text: ["set"]
852
- }, ls = (a, i) => a !== "set" ? ["number"] : i === "date" ? ["date", "datetime"] : [i === "number" ? "number" : "text"], Ge = (a, i) => {
870
+ }, ts = (a, i) => a !== "set" ? ["number"] : i === "date" ? ["date", "datetime"] : [i === "number" ? "number" : "text"], Ge = (a, i) => {
853
871
  for (let t = 1; ; t++) if (!a.includes(`${i}${t}`)) return `${i}${t}`;
854
872
  };
855
- function ts({
873
+ function ns({
856
874
  source: a,
857
875
  network: i,
858
876
  save: t,
859
- adding: w = !1,
877
+ adding: k = !1,
860
878
  onClose: p
861
879
  }) {
862
- const { t: k } = _(), c = a.operations ?? [], s = () => ({
880
+ const { t: j } = A(), c = a.operations ?? [], s = () => ({
863
881
  index: c.length,
864
882
  operation: {
865
883
  id: Ge(
866
- c.map((j) => j.id),
884
+ c.map((w) => w.id),
867
885
  "op"
868
886
  ),
869
887
  label: "",
870
888
  params: [{ name: "p1", label: "", type: "number" }],
871
889
  effects: []
872
890
  }
873
- }), [o, d] = A.useState(
874
- () => w && c.length === 0 ? s() : null
875
- ), h = i.objectTypes[a.objectType]?.properties ?? [], r = ge(a, i), u = (j) => r.find((g) => g.name === j)?.label ?? j, l = (j) => t({ ...a, operations: j.length > 0 ? j : void 0 });
891
+ }), [o, d] = E.useState(
892
+ () => k && c.length === 0 ? s() : null
893
+ ), m = i.objectTypes[a.objectType]?.properties ?? [], r = xe(a, i), u = (w) => r.find((f) => f.name === w)?.label ?? w, l = (w) => t({ ...a, operations: w.length > 0 ? w : void 0 });
876
894
  return /* @__PURE__ */ e.jsxs("div", { className: n.computedItem, children: [
877
895
  /* @__PURE__ */ e.jsxs("div", { className: n.computedHead, children: [
878
- /* @__PURE__ */ e.jsx("b", { children: k("workshopLab.operations.title") }),
896
+ /* @__PURE__ */ e.jsx("b", { children: j("workshopLab.operations.title") }),
879
897
  /* @__PURE__ */ e.jsx("span", { className: n.spacer }),
880
898
  /* @__PURE__ */ e.jsx(
881
899
  $,
@@ -884,89 +902,89 @@ function ts({
884
902
  icon: /* @__PURE__ */ e.jsx(ne, {}),
885
903
  disabled: c.length >= za,
886
904
  onClick: () => d(s()),
887
- children: k("workshopLab.operations.add")
905
+ children: j("workshopLab.operations.add")
888
906
  }
889
907
  )
890
908
  ] }),
891
- c.map((j, g) => {
892
- const b = j.action ? be(i, j.action.id) : void 0;
909
+ c.map((w, f) => {
910
+ const h = w.action ? be(i, w.action.id) : void 0;
893
911
  return /* @__PURE__ */ e.jsxs("div", { className: n.operationItem, children: [
894
912
  /* @__PURE__ */ e.jsxs("span", { children: [
895
- /* @__PURE__ */ e.jsx("b", { children: j.label }),
913
+ /* @__PURE__ */ e.jsx("b", { children: w.label }),
896
914
  " ",
897
- /* @__PURE__ */ e.jsx("span", { className: n.muted, children: k("workshopLab.operations.on", {
898
- conditions: Ue(j.when, r, k)
915
+ /* @__PURE__ */ e.jsx("span", { className: n.muted, children: j("workshopLab.operations.on", {
916
+ conditions: Ue(w.when, r, j)
899
917
  }) })
900
918
  ] }),
901
- /* @__PURE__ */ e.jsx("span", { className: n.muted, children: j.effects.map(
902
- (T) => k(`workshopLab.operations.effectText.${T.kind}`, {
903
- field: u(T.field),
904
- param: j.params.find((v) => v.name === T.param)?.label ?? T.param
919
+ /* @__PURE__ */ e.jsx("span", { className: n.muted, children: w.effects.map(
920
+ (C) => j(`workshopLab.operations.effectText.${C.kind}`, {
921
+ field: u(C.field),
922
+ param: w.params.find((L) => L.name === C.param)?.label ?? C.param
905
923
  })
906
924
  ).join(";") }),
907
- /* @__PURE__ */ e.jsx("span", { className: n.muted, children: b ? k("workshopLab.operations.actionText", { name: b.name }) : k("workshopLab.operations.noAction") }),
908
- /* @__PURE__ */ e.jsxs(P, { size: 4, children: [
909
- /* @__PURE__ */ e.jsx($, { size: "small", type: "link", onClick: () => d({ index: g, operation: j }), children: k("workshopLab.computed.edit") }),
925
+ /* @__PURE__ */ e.jsx("span", { className: n.muted, children: h ? j("workshopLab.operations.actionText", { name: h.name }) : j("workshopLab.operations.noAction") }),
926
+ /* @__PURE__ */ e.jsxs(F, { size: 4, children: [
927
+ /* @__PURE__ */ e.jsx($, { size: "small", type: "link", onClick: () => d({ index: f, operation: w }), children: j("workshopLab.computed.edit") }),
910
928
  /* @__PURE__ */ e.jsx(
911
929
  ee,
912
930
  {
913
- title: k("workshopLab.operations.removeConfirm", { name: j.label }),
914
- onConfirm: () => l(c.filter((T, v) => v !== g)),
915
- children: /* @__PURE__ */ e.jsx($, { size: "small", type: "link", danger: !0, children: k("workshopLab.computed.remove") })
931
+ title: j("workshopLab.operations.removeConfirm", { name: w.label }),
932
+ onConfirm: () => l(c.filter((C, L) => L !== f)),
933
+ children: /* @__PURE__ */ e.jsx($, { size: "small", type: "link", danger: !0, children: j("workshopLab.computed.remove") })
916
934
  }
917
935
  )
918
936
  ] })
919
- ] }, j.id);
937
+ ] }, w.id);
920
938
  }),
921
939
  o && /* @__PURE__ */ e.jsx(
922
- ns,
940
+ rs,
923
941
  {
924
942
  initial: o.operation,
925
943
  source: a,
926
944
  network: i,
927
- properties: h,
928
- others: c.filter((j, g) => g !== o.index),
945
+ properties: m,
946
+ others: c.filter((w, f) => f !== o.index),
929
947
  onCancel: () => {
930
948
  d(null), c.length === 0 && p?.();
931
949
  },
932
- onSave: (j) => {
933
- const g = [...c];
934
- g[o.index] = j, l(g) && d(null);
950
+ onSave: (w) => {
951
+ const f = [...c];
952
+ f[o.index] = w, l(f) && d(null);
935
953
  }
936
954
  }
937
955
  )
938
956
  ] });
939
957
  }
940
- function ns({
958
+ function rs({
941
959
  initial: a,
942
960
  source: i,
943
961
  network: t,
944
- properties: w,
962
+ properties: k,
945
963
  others: p,
946
- onCancel: k,
964
+ onCancel: j,
947
965
  onSave: c
948
966
  }) {
949
- const { t: s } = _(), [o, d] = A.useState(a), h = (L) => d({ ...o, ...L }), r = ge(i, t), u = (L) => w.find((m) => m.name === L)?.type, l = (t.actionTypes ?? []).filter(
950
- (L) => L.objectType === i.objectType
951
- ), j = o.action ? be(t, o.action.id) : void 0, g = t.objectTypes[i.objectType]?.primaryKeys ?? [], b = w.filter(
952
- (L) => L.name !== i.key && !g.includes(L.name)
953
- ), T = {
967
+ const { t: s } = A(), [o, d] = E.useState(a), m = (b) => d({ ...o, ...b }), r = xe(i, t), u = (b) => k.find((g) => g.name === b)?.type, l = (t.actionTypes ?? []).filter(
968
+ (b) => b.objectType === i.objectType
969
+ ), w = o.action ? be(t, o.action.id) : void 0, f = t.objectTypes[i.objectType]?.primaryKeys ?? [], h = k.filter(
970
+ (b) => b.name !== i.key && !f.includes(b.name)
971
+ ), C = {
954
972
  ...o,
955
973
  label: o.label.trim(),
956
974
  ...o.when?.length ? { when: o.when } : { when: void 0 }
957
975
  };
958
- T.when || delete T.when;
959
- const v = T.label ? $a([...p, T], i, t, "operation").filter(
960
- (L) => L.startsWith(`operation[${p.length}]`)
961
- ) : [s("workshopLab.operations.needLabel")], C = (L, m) => h({
962
- params: o.params.map((x, y) => y === L ? { ...x, ...m } : x)
963
- }), S = (L, m) => h({
964
- effects: o.effects.map((x, y) => y === L ? { ...x, ...m } : x)
965
- }), N = (L, m) => {
976
+ C.when || delete C.when;
977
+ const L = C.label ? $a([...p, C], i, t, "operation").filter(
978
+ (b) => b.startsWith(`operation[${p.length}]`)
979
+ ) : [s("workshopLab.operations.needLabel")], N = (b, g) => m({
980
+ params: o.params.map((T, _) => _ === b ? { ...T, ...g } : T)
981
+ }), S = (b, g) => m({
982
+ effects: o.effects.map((T, _) => _ === b ? { ...T, ...g } : T)
983
+ }), y = (b, g) => {
966
984
  if (!o.action) return;
967
- const x = { ...o.action.params };
968
- m ? x[L] = m : delete x[L], h({ action: { ...o.action, params: x } });
969
- }, O = (L) => L ? L.from === "const" ? "const" : `${L.from}:${L.name}` : void 0;
985
+ const T = { ...o.action.params };
986
+ g ? T[b] = g : delete T[b], m({ action: { ...o.action, params: T } });
987
+ }, x = (b) => b ? b.from === "const" ? "const" : `${b.from}:${b.name}` : void 0;
970
988
  return /* @__PURE__ */ e.jsx(
971
989
  ae,
972
990
  {
@@ -974,12 +992,12 @@ function ns({
974
992
  width: 720,
975
993
  title: a.label ? s("workshopLab.operations.editTitle", { name: a.label }) : s("workshopLab.operations.newTitle"),
976
994
  okText: s("workshopLab.computed.save"),
977
- okButtonProps: { disabled: v.length > 0 },
978
- onOk: () => c(T),
979
- onCancel: k,
995
+ okButtonProps: { disabled: L.length > 0 },
996
+ onOk: () => c(C),
997
+ onCancel: j,
980
998
  children: /* @__PURE__ */ e.jsxs("div", { className: n.computedForm, children: [
981
999
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.operations.hint") }),
982
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
1000
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
983
1001
  /* @__PURE__ */ e.jsx("span", { children: s("workshopLab.operations.label") }),
984
1002
  /* @__PURE__ */ e.jsx(
985
1003
  I,
@@ -989,52 +1007,52 @@ function ns({
989
1007
  maxLength: 30,
990
1008
  placeholder: s("workshopLab.operations.labelHint"),
991
1009
  value: o.label,
992
- onChange: (L) => h({ label: L.target.value })
1010
+ onChange: (b) => m({ label: b.target.value })
993
1011
  }
994
1012
  )
995
1013
  ] }),
996
1014
  /* @__PURE__ */ e.jsx("b", { children: s("workshopLab.operations.when") }),
997
1015
  /* @__PURE__ */ e.jsx(
998
- K,
1016
+ X,
999
1017
  {
1000
1018
  value: o.when,
1001
- onChange: (L) => h({ when: L }),
1019
+ onChange: (b) => m({ when: b }),
1002
1020
  fields: r,
1003
1021
  source: i
1004
1022
  }
1005
1023
  ),
1006
1024
  /* @__PURE__ */ e.jsx("b", { children: s("workshopLab.operations.params") }),
1007
- o.params.map((L, m) => /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
1025
+ o.params.map((b, g) => /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
1008
1026
  /* @__PURE__ */ e.jsx(
1009
1027
  I,
1010
1028
  {
1011
1029
  size: "small",
1012
1030
  className: n.fieldSelect,
1013
1031
  placeholder: s("workshopLab.operations.paramLabel"),
1014
- value: L.label,
1015
- onChange: (x) => C(m, { label: x.target.value })
1032
+ value: b.label,
1033
+ onChange: (T) => N(g, { label: T.target.value })
1016
1034
  }
1017
1035
  ),
1018
1036
  /* @__PURE__ */ e.jsx(
1019
- F,
1037
+ O,
1020
1038
  {
1021
1039
  size: "small",
1022
- value: L.type,
1023
- options: Oa.map((x) => ({
1024
- value: x,
1025
- label: s(`workshopLab.operations.types.${x}`)
1040
+ value: b.type,
1041
+ options: Oa.map((T) => ({
1042
+ value: T,
1043
+ label: s(`workshopLab.operations.types.${T}`)
1026
1044
  })),
1027
- onChange: (x) => C(m, { type: x })
1045
+ onChange: (T) => N(g, { type: T })
1028
1046
  }
1029
1047
  ),
1030
- L.type === "number" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1048
+ b.type === "number" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1031
1049
  /* @__PURE__ */ e.jsx(
1032
1050
  G,
1033
1051
  {
1034
1052
  size: "small",
1035
1053
  placeholder: s("workshopLab.operations.min"),
1036
- value: L.min ?? null,
1037
- onChange: (x) => C(m, { min: x ?? void 0 })
1054
+ value: b.min ?? null,
1055
+ onChange: (T) => N(g, { min: T ?? void 0 })
1038
1056
  }
1039
1057
  ),
1040
1058
  /* @__PURE__ */ e.jsx(
@@ -1042,8 +1060,8 @@ function ns({
1042
1060
  {
1043
1061
  size: "small",
1044
1062
  placeholder: s("workshopLab.operations.max"),
1045
- value: L.max ?? null,
1046
- onChange: (x) => C(m, { max: x ?? void 0 })
1063
+ value: b.max ?? null,
1064
+ onChange: (T) => N(g, { max: T ?? void 0 })
1047
1065
  }
1048
1066
  ),
1049
1067
  /* @__PURE__ */ e.jsx(
@@ -1051,8 +1069,8 @@ function ns({
1051
1069
  {
1052
1070
  size: "small",
1053
1071
  placeholder: s("workshopLab.operations.default"),
1054
- value: typeof L.default == "number" ? L.default : null,
1055
- onChange: (x) => C(m, { default: x ?? void 0 })
1072
+ value: typeof b.default == "number" ? b.default : null,
1073
+ onChange: (T) => N(g, { default: T ?? void 0 })
1056
1074
  }
1057
1075
  )
1058
1076
  ] }),
@@ -1062,27 +1080,27 @@ function ns({
1062
1080
  size: "small",
1063
1081
  type: "text",
1064
1082
  danger: !0,
1065
- icon: /* @__PURE__ */ e.jsx(Y, {}),
1083
+ icon: /* @__PURE__ */ e.jsx(Q, {}),
1066
1084
  "aria-label": s("workshopLab.config.removeItem"),
1067
1085
  disabled: o.params.length <= 1,
1068
- onClick: () => h({
1069
- params: o.params.filter((x, y) => y !== m),
1070
- effects: o.effects.filter((x) => x.param !== L.name)
1086
+ onClick: () => m({
1087
+ params: o.params.filter((T, _) => _ !== g),
1088
+ effects: o.effects.filter((T) => T.param !== b.name)
1071
1089
  })
1072
1090
  }
1073
1091
  )
1074
- ] }, L.name)),
1092
+ ] }, b.name)),
1075
1093
  /* @__PURE__ */ e.jsx(
1076
1094
  $,
1077
1095
  {
1078
1096
  size: "small",
1079
1097
  disabled: o.params.length >= Be,
1080
- onClick: () => h({
1098
+ onClick: () => m({
1081
1099
  params: [
1082
1100
  ...o.params,
1083
1101
  {
1084
1102
  name: Ge(
1085
- o.params.map((L) => L.name),
1103
+ o.params.map((b) => b.name),
1086
1104
  "p"
1087
1105
  ),
1088
1106
  label: "",
@@ -1095,47 +1113,47 @@ function ns({
1095
1113
  ),
1096
1114
  /* @__PURE__ */ e.jsx("b", { children: s("workshopLab.operations.effects") }),
1097
1115
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.operations.effectsHint") }),
1098
- o.effects.map((L, m) => {
1099
- const x = u(L.field) ?? "text", y = Fe[x] ?? ["set"], R = ls(L.kind, x);
1100
- return /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
1116
+ o.effects.map((b, g) => {
1117
+ const T = u(b.field) ?? "text", _ = Fe[T] ?? ["set"], H = ts(b.kind, T);
1118
+ return /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
1101
1119
  /* @__PURE__ */ e.jsx(
1102
- F,
1120
+ O,
1103
1121
  {
1104
1122
  size: "small",
1105
1123
  className: n.fieldSelect,
1106
- value: L.field || void 0,
1124
+ value: b.field || void 0,
1107
1125
  placeholder: s("workshopLab.operations.field"),
1108
- options: b.map((M) => ({
1126
+ options: h.map((M) => ({
1109
1127
  value: M.name,
1110
1128
  label: M.label
1111
1129
  })),
1112
1130
  onChange: (M) => {
1113
- const B = (Fe[u(M) ?? "text"] ?? ["set"])[0];
1114
- S(m, { field: M, kind: B });
1131
+ const D = (Fe[u(M) ?? "text"] ?? ["set"])[0];
1132
+ S(g, { field: M, kind: D });
1115
1133
  }
1116
1134
  }
1117
1135
  ),
1118
1136
  /* @__PURE__ */ e.jsx(
1119
- F,
1137
+ O,
1120
1138
  {
1121
1139
  size: "small",
1122
- value: L.kind,
1123
- options: y.map((M) => ({
1140
+ value: b.kind,
1141
+ options: _.map((M) => ({
1124
1142
  value: M,
1125
1143
  label: s(`workshopLab.operations.kinds.${M}`)
1126
1144
  })),
1127
- onChange: (M) => S(m, { kind: M })
1145
+ onChange: (M) => S(g, { kind: M })
1128
1146
  }
1129
1147
  ),
1130
1148
  /* @__PURE__ */ e.jsx(
1131
- F,
1149
+ O,
1132
1150
  {
1133
1151
  size: "small",
1134
1152
  className: n.fieldSelect,
1135
- value: L.param || void 0,
1153
+ value: b.param || void 0,
1136
1154
  placeholder: s("workshopLab.operations.param"),
1137
- options: o.params.filter((M) => R.includes(M.type)).map((M) => ({ value: M.name, label: M.label || M.name })),
1138
- onChange: (M) => S(m, { param: M })
1155
+ options: o.params.filter((M) => H.includes(M.type)).map((M) => ({ value: M.name, label: M.label || M.name })),
1156
+ onChange: (M) => S(g, { param: M })
1139
1157
  }
1140
1158
  ),
1141
1159
  /* @__PURE__ */ e.jsx(
@@ -1144,19 +1162,19 @@ function ns({
1144
1162
  size: "small",
1145
1163
  type: "text",
1146
1164
  danger: !0,
1147
- icon: /* @__PURE__ */ e.jsx(Y, {}),
1165
+ icon: /* @__PURE__ */ e.jsx(Q, {}),
1148
1166
  "aria-label": s("workshopLab.config.removeItem"),
1149
- onClick: () => h({ effects: o.effects.filter((M, B) => B !== m) })
1167
+ onClick: () => m({ effects: o.effects.filter((M, D) => D !== g) })
1150
1168
  }
1151
1169
  )
1152
- ] }, m);
1170
+ ] }, g);
1153
1171
  }),
1154
1172
  /* @__PURE__ */ e.jsx(
1155
1173
  $,
1156
1174
  {
1157
1175
  size: "small",
1158
1176
  disabled: o.effects.length >= Fa,
1159
- onClick: () => h({
1177
+ onClick: () => m({
1160
1178
  effects: [...o.effects, { field: "", kind: "set", param: "" }]
1161
1179
  }),
1162
1180
  children: s("workshopLab.operations.addEffect")
@@ -1165,66 +1183,66 @@ function ns({
1165
1183
  /* @__PURE__ */ e.jsx("b", { children: s("workshopLab.operations.action") }),
1166
1184
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.operations.actionHint") }),
1167
1185
  /* @__PURE__ */ e.jsx(
1168
- F,
1186
+ O,
1169
1187
  {
1170
1188
  size: "small",
1171
1189
  allowClear: !0,
1172
1190
  placeholder: s("workshopLab.operations.noAction"),
1173
1191
  value: o.action?.id,
1174
- options: l.map((L) => ({ value: L.id, label: L.name })),
1175
- onChange: (L) => {
1176
- const m = { ...o };
1177
- L ? m.action = { id: L, params: {} } : delete m.action, d(m);
1192
+ options: l.map((b) => ({ value: b.id, label: b.name })),
1193
+ onChange: (b) => {
1194
+ const g = { ...o };
1195
+ b ? g.action = { id: b, params: {} } : delete g.action, d(g);
1178
1196
  }
1179
1197
  }
1180
1198
  ),
1181
- j?.inputs.map((L) => /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
1182
- /* @__PURE__ */ e.jsx("span", { children: L.name }),
1199
+ w?.inputs.map((b) => /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
1200
+ /* @__PURE__ */ e.jsx("span", { children: b.name }),
1183
1201
  /* @__PURE__ */ e.jsx(
1184
- F,
1202
+ O,
1185
1203
  {
1186
1204
  size: "small",
1187
1205
  className: n.fieldSelect,
1188
1206
  allowClear: !0,
1189
1207
  placeholder: s("workshopLab.operations.sameName"),
1190
- value: O(o.action?.params[L.name]),
1208
+ value: x(o.action?.params[b.name]),
1191
1209
  options: [
1192
- ...o.params.map((m) => ({
1193
- value: `param:${m.name}`,
1194
- label: s("workshopLab.operations.fromParam", { name: m.label || m.name })
1210
+ ...o.params.map((g) => ({
1211
+ value: `param:${g.name}`,
1212
+ label: s("workshopLab.operations.fromParam", { name: g.label || g.name })
1195
1213
  })),
1196
- ...w.map((m) => ({
1197
- value: `field:${m.name}`,
1198
- label: s("workshopLab.operations.fromField", { name: m.label })
1214
+ ...k.map((g) => ({
1215
+ value: `field:${g.name}`,
1216
+ label: s("workshopLab.operations.fromField", { name: g.label })
1199
1217
  })),
1200
1218
  { value: "const", label: s("workshopLab.operations.fromConst") }
1201
1219
  ],
1202
- onChange: (m) => {
1203
- if (!m) return N(L.name, void 0);
1204
- if (m === "const") return N(L.name, { from: "const", value: "" });
1205
- const [x, y] = m.split(/:(.*)/s);
1206
- N(L.name, { from: x, name: y });
1220
+ onChange: (g) => {
1221
+ if (!g) return y(b.name, void 0);
1222
+ if (g === "const") return y(b.name, { from: "const", value: "" });
1223
+ const [T, _] = g.split(/:(.*)/s);
1224
+ y(b.name, { from: T, name: _ });
1207
1225
  }
1208
1226
  }
1209
1227
  ),
1210
- o.action?.params[L.name]?.from === "const" && /* @__PURE__ */ e.jsx(
1228
+ o.action?.params[b.name]?.from === "const" && /* @__PURE__ */ e.jsx(
1211
1229
  I,
1212
1230
  {
1213
1231
  size: "small",
1214
1232
  className: n.fieldSelect,
1215
1233
  value: String(
1216
- o.action.params[L.name].value ?? ""
1234
+ o.action.params[b.name].value ?? ""
1217
1235
  ),
1218
- onChange: (m) => N(L.name, { from: "const", value: m.target.value })
1236
+ onChange: (g) => y(b.name, { from: "const", value: g.target.value })
1219
1237
  }
1220
1238
  )
1221
- ] }, L.name)),
1222
- v.length > 0 && T.label && /* @__PURE__ */ e.jsx(
1239
+ ] }, b.name)),
1240
+ L.length > 0 && C.label && /* @__PURE__ */ e.jsx(
1223
1241
  re,
1224
1242
  {
1225
1243
  type: "warning",
1226
1244
  showIcon: !0,
1227
- message: v.slice(0, 3).map((L) => L.replace(/^operation\[\d+\]\.?/, "")).join(";")
1245
+ message: L.slice(0, 3).map((b) => b.replace(/^operation\[\d+\]\.?/, "")).join(";")
1228
1246
  }
1229
1247
  )
1230
1248
  ] })
@@ -1234,11 +1252,11 @@ function ns({
1234
1252
  const Pe = (a, i) => {
1235
1253
  for (let t = 1; ; t++) if (!a.includes(`${i}${t}`)) return `${i}${t}`;
1236
1254
  };
1237
- function rs({ source: a, network: i, sources: t, states: w, run: p, save: k, onClose: c }) {
1238
- const { t: s } = _(), o = a.follows ?? [], d = a.relatedTo ?? [], [h, r] = A.useState(null), [u, l] = A.useState(null), j = Pa(t), g = (N, O) => i.objectTypes[N]?.properties.find((L) => L.name === O)?.label ?? O, b = (N) => t.find((O) => O.id === N), T = (N, O) => {
1239
- const L = b(N);
1240
- return L ? _e(i, L.objectType, O) : O.join(" → ");
1241
- }, v = (N) => k({ ...a, follows: N.length > 0 ? N : void 0 }), C = (N) => k({ ...a, relatedTo: N.length > 0 ? N : void 0 }), S = o.length + d.length === 0;
1255
+ function is({ source: a, network: i, sources: t, states: k, run: p, save: j, onClose: c }) {
1256
+ const { t: s } = A(), o = a.follows ?? [], d = a.relatedTo ?? [], [m, r] = E.useState(null), [u, l] = E.useState(null), w = Pa(t), f = (y, x) => i.objectTypes[y]?.properties.find((b) => b.name === x)?.label ?? x, h = (y) => t.find((x) => x.id === y), C = (y, x) => {
1257
+ const b = h(y);
1258
+ return b ? _e(i, b.objectType, x) : x.join(" → ");
1259
+ }, L = (y) => j({ ...a, follows: y.length > 0 ? y : void 0 }), N = (y) => j({ ...a, relatedTo: y.length > 0 ? y : void 0 }), S = o.length + d.length === 0;
1242
1260
  return /* @__PURE__ */ e.jsxs("div", { className: n.computedItem, children: [
1243
1261
  /* @__PURE__ */ e.jsxs("div", { className: n.computedHead, children: [
1244
1262
  /* @__PURE__ */ e.jsx("b", { children: s("workshopLab.links.title") }),
@@ -1253,7 +1271,7 @@ function rs({ source: a, network: i, sources: t, states: w, run: p, save: k, onC
1253
1271
  index: o.length,
1254
1272
  rule: {
1255
1273
  id: Pe(
1256
- o.map((N) => N.id),
1274
+ o.map((y) => y.id),
1257
1275
  "follow"
1258
1276
  ),
1259
1277
  field: "",
@@ -1275,7 +1293,7 @@ function rs({ source: a, network: i, sources: t, states: w, run: p, save: k, onC
1275
1293
  index: d.length,
1276
1294
  link: {
1277
1295
  id: Pe(
1278
- d.map((N) => N.id),
1296
+ d.map((y) => y.id),
1279
1297
  "related"
1280
1298
  ),
1281
1299
  from: "",
@@ -1286,139 +1304,139 @@ function rs({ source: a, network: i, sources: t, states: w, run: p, save: k, onC
1286
1304
  }
1287
1305
  )
1288
1306
  ] }),
1289
- o.map((N, O) => {
1290
- const L = b(N.from);
1307
+ o.map((y, x) => {
1308
+ const b = h(y.from);
1291
1309
  return /* @__PURE__ */ e.jsxs("div", { className: n.operationItem, children: [
1292
1310
  /* @__PURE__ */ e.jsxs("span", { children: [
1293
1311
  s(
1294
- N.gapMinutes ? "workshopLab.links.ruleTextMinutes" : "workshopLab.links.ruleText",
1312
+ y.gapMinutes ? "workshopLab.links.ruleTextMinutes" : "workshopLab.links.ruleText",
1295
1313
  {
1296
- field: g(a.objectType, N.field),
1297
- from: L?.label ?? N.from,
1298
- fromField: L ? g(L.objectType, N.fromField) : N.fromField,
1299
- gap: N.gapDays,
1300
- minutes: N.gapMinutes
1314
+ field: f(a.objectType, y.field),
1315
+ from: b?.label ?? y.from,
1316
+ fromField: b ? f(b.objectType, y.fromField) : y.fromField,
1317
+ gap: y.gapDays,
1318
+ minutes: y.gapMinutes
1301
1319
  }
1302
1320
  ),
1303
- N.keepDuration && s("workshopLab.links.keepText", {
1304
- field: g(a.objectType, N.keepDuration)
1321
+ y.keepDuration && s("workshopLab.links.keepText", {
1322
+ field: f(a.objectType, y.keepDuration)
1305
1323
  })
1306
1324
  ] }),
1307
- /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.links.via", { path: T(N.from, N.path) }) }),
1325
+ /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.links.via", { path: C(y.from, y.path) }) }),
1308
1326
  /* @__PURE__ */ e.jsx(
1309
- ps,
1327
+ ds,
1310
1328
  {
1311
- rule: N,
1329
+ rule: y,
1312
1330
  source: a,
1313
1331
  network: i,
1314
1332
  sources: t,
1315
- states: w,
1333
+ states: k,
1316
1334
  run: p
1317
1335
  },
1318
- JSON.stringify(N)
1336
+ JSON.stringify(y)
1319
1337
  ),
1320
- /* @__PURE__ */ e.jsxs(P, { size: 4, children: [
1321
- /* @__PURE__ */ e.jsx($, { size: "small", type: "link", onClick: () => r({ index: O, rule: N }), children: s("workshopLab.computed.edit") }),
1338
+ /* @__PURE__ */ e.jsxs(F, { size: 4, children: [
1339
+ /* @__PURE__ */ e.jsx($, { size: "small", type: "link", onClick: () => r({ index: x, rule: y }), children: s("workshopLab.computed.edit") }),
1322
1340
  /* @__PURE__ */ e.jsx(
1323
1341
  ee,
1324
1342
  {
1325
1343
  title: s("workshopLab.links.removeConfirm"),
1326
- onConfirm: () => v(o.filter((m, x) => x !== O)),
1344
+ onConfirm: () => L(o.filter((g, T) => T !== x)),
1327
1345
  children: /* @__PURE__ */ e.jsx($, { size: "small", type: "link", danger: !0, children: s("workshopLab.computed.remove") })
1328
1346
  }
1329
1347
  )
1330
1348
  ] })
1331
- ] }, N.id);
1349
+ ] }, y.id);
1332
1350
  }),
1333
- d.map((N, O) => /* @__PURE__ */ e.jsxs("div", { className: n.operationItem, children: [
1351
+ d.map((y, x) => /* @__PURE__ */ e.jsxs("div", { className: n.operationItem, children: [
1334
1352
  /* @__PURE__ */ e.jsx("span", { children: s("workshopLab.links.relatedText", {
1335
- from: b(N.from)?.label ?? N.from
1353
+ from: h(y.from)?.label ?? y.from
1336
1354
  }) }),
1337
- /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.links.via", { path: T(N.from, N.path) }) }),
1338
- /* @__PURE__ */ e.jsxs(P, { size: 4, children: [
1339
- /* @__PURE__ */ e.jsx($, { size: "small", type: "link", onClick: () => l({ index: O, link: N }), children: s("workshopLab.computed.edit") }),
1355
+ /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.links.via", { path: C(y.from, y.path) }) }),
1356
+ /* @__PURE__ */ e.jsxs(F, { size: 4, children: [
1357
+ /* @__PURE__ */ e.jsx($, { size: "small", type: "link", onClick: () => l({ index: x, link: y }), children: s("workshopLab.computed.edit") }),
1340
1358
  /* @__PURE__ */ e.jsx(
1341
1359
  ee,
1342
1360
  {
1343
1361
  title: s("workshopLab.links.removeConfirm"),
1344
- onConfirm: () => C(d.filter((L, m) => m !== O)),
1362
+ onConfirm: () => N(d.filter((b, g) => g !== x)),
1345
1363
  children: /* @__PURE__ */ e.jsx($, { size: "small", type: "link", danger: !0, children: s("workshopLab.computed.remove") })
1346
1364
  }
1347
1365
  )
1348
1366
  ] })
1349
- ] }, N.id)),
1350
- h && /* @__PURE__ */ e.jsx(
1351
- is,
1367
+ ] }, y.id)),
1368
+ m && /* @__PURE__ */ e.jsx(
1369
+ cs,
1352
1370
  {
1353
- initial: h.rule,
1371
+ initial: m.rule,
1354
1372
  source: a,
1355
1373
  network: i,
1356
- starts: j,
1374
+ starts: w,
1357
1375
  sources: t,
1358
- others: o.filter((N, O) => O !== h.index),
1376
+ others: o.filter((y, x) => x !== m.index),
1359
1377
  onCancel: () => r(null),
1360
- onSave: (N) => {
1361
- const O = [...o];
1362
- O[h.index] = N, v(O) && r(null);
1378
+ onSave: (y) => {
1379
+ const x = [...o];
1380
+ x[m.index] = y, L(x) && r(null);
1363
1381
  }
1364
1382
  }
1365
1383
  ),
1366
1384
  u && /* @__PURE__ */ e.jsx(
1367
- cs,
1385
+ ps,
1368
1386
  {
1369
1387
  initial: u.link,
1370
1388
  source: a,
1371
1389
  network: i,
1372
- starts: j,
1390
+ starts: w,
1373
1391
  sources: t,
1374
- others: d.filter((N, O) => O !== u.index),
1392
+ others: d.filter((y, x) => x !== u.index),
1375
1393
  onCancel: () => l(null),
1376
- onSave: (N) => {
1377
- const O = [...d];
1378
- O[u.index] = N, C(O) && l(null);
1394
+ onSave: (y) => {
1395
+ const x = [...d];
1396
+ x[u.index] = y, N(x) && l(null);
1379
1397
  }
1380
1398
  }
1381
1399
  )
1382
1400
  ] });
1383
1401
  }
1384
- function Xe({
1402
+ function We({
1385
1403
  from: a,
1386
1404
  path: i,
1387
1405
  source: t,
1388
- network: w,
1406
+ network: k,
1389
1407
  starts: p,
1390
- onChange: k
1408
+ onChange: j
1391
1409
  }) {
1392
- const { t: c } = _(), s = p.find((h) => h.id === a), o = s ? ye(w, s.objectType, t.objectType, Ce).filter(
1393
- (h) => h.length > 0
1394
- ) : [], d = (h) => `${_e(w, s?.objectType ?? "", h)}(${(me(w, s?.objectType ?? "", h) ?? []).map(
1395
- (r, u) => oa(h[u]).reversed ? c("workshopLab.config.pathReversed", { name: r.relation.name }) : r.relation.name
1410
+ const { t: c } = A(), s = p.find((m) => m.id === a), o = s ? ye(k, s.objectType, t.objectType, Ce).filter(
1411
+ (m) => m.length > 0
1412
+ ) : [], d = (m) => `${_e(k, s?.objectType ?? "", m)}(${(me(k, s?.objectType ?? "", m) ?? []).map(
1413
+ (r, u) => oa(m[u]).reversed ? c("workshopLab.config.pathReversed", { name: r.relation.name }) : r.relation.name
1396
1414
  ).join("、")})`;
1397
1415
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1398
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
1416
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
1399
1417
  /* @__PURE__ */ e.jsx("span", { children: c("workshopLab.links.from") }),
1400
1418
  /* @__PURE__ */ e.jsx(
1401
- F,
1419
+ O,
1402
1420
  {
1403
1421
  size: "small",
1404
1422
  className: n.fieldSelect,
1405
1423
  "aria-label": c("workshopLab.links.from"),
1406
1424
  value: a || void 0,
1407
1425
  placeholder: c("workshopLab.links.fromHint"),
1408
- options: p.map((h) => ({ value: h.id, label: h.label })),
1409
- onChange: (h) => {
1410
- const r = p.find((l) => l.id === h), u = r ? ye(w, r.objectType, t.objectType, Ce).find(
1426
+ options: p.map((m) => ({ value: m.id, label: m.label })),
1427
+ onChange: (m) => {
1428
+ const r = p.find((l) => l.id === m), u = r ? ye(k, r.objectType, t.objectType, Ce).find(
1411
1429
  (l) => l.length > 0
1412
1430
  ) : void 0;
1413
- k({ from: h, path: u ?? [] });
1431
+ j({ from: m, path: u ?? [] });
1414
1432
  }
1415
1433
  }
1416
1434
  )
1417
1435
  ] }),
1418
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
1436
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
1419
1437
  /* @__PURE__ */ e.jsx("span", { children: c("workshopLab.links.path") }),
1420
1438
  /* @__PURE__ */ e.jsx(
1421
- F,
1439
+ O,
1422
1440
  {
1423
1441
  size: "small",
1424
1442
  className: n.pathSelect,
@@ -1426,26 +1444,26 @@ function Xe({
1426
1444
  value: i.length > 0 ? i.join(">") : void 0,
1427
1445
  placeholder: s && o.length === 0 ? c("workshopLab.links.noPath") : c("workshopLab.links.path"),
1428
1446
  disabled: !s || o.length === 0,
1429
- options: o.map((h) => ({ value: h.join(">"), label: d(h) })),
1430
- onChange: (h) => k({ path: h.split(">") })
1447
+ options: o.map((m) => ({ value: m.join(">"), label: d(m) })),
1448
+ onChange: (m) => j({ path: m.split(">") })
1431
1449
  }
1432
1450
  )
1433
1451
  ] })
1434
1452
  ] });
1435
1453
  }
1436
- const We = (a) => a.slice(0, 3).map((i) => i.replace(/^item\[\d+\]\.?/, "")).join(";");
1437
- function is({
1454
+ const Ke = (a) => a.slice(0, 3).map((i) => i.replace(/^item\[\d+\]\.?/, "")).join(";");
1455
+ function cs({
1438
1456
  initial: a,
1439
1457
  source: i,
1440
1458
  network: t,
1441
- starts: w,
1459
+ starts: k,
1442
1460
  sources: p,
1443
- others: k,
1461
+ others: j,
1444
1462
  onCancel: c,
1445
1463
  onSave: s
1446
1464
  }) {
1447
- const { t: o } = _(), [d, h] = A.useState(a), r = (b) => h({ ...d, ...b }), u = t.objectTypes[i.objectType]?.primaryKeys ?? [], l = (b) => (t.objectTypes[b]?.properties ?? []).filter((T) => T.type === "date"), j = w.find((b) => b.id === d.from), g = Aa([...k, d], i, p, t, "item").filter(
1448
- (b) => b.startsWith(`item[${k.length}]`)
1465
+ const { t: o } = A(), [d, m] = E.useState(a), r = (h) => m({ ...d, ...h }), u = t.objectTypes[i.objectType]?.primaryKeys ?? [], l = (h) => (t.objectTypes[h]?.properties ?? []).filter((C) => C.type === "date"), w = k.find((h) => h.id === d.from), f = Aa([...j, d], i, p, t, "item").filter(
1466
+ (h) => h.startsWith(`item[${j.length}]`)
1449
1467
  );
1450
1468
  return /* @__PURE__ */ e.jsx(
1451
1469
  ae,
@@ -1454,54 +1472,54 @@ function is({
1454
1472
  width: 640,
1455
1473
  title: o("workshopLab.links.ruleTitle"),
1456
1474
  okText: o("workshopLab.computed.save"),
1457
- okButtonProps: { disabled: g.length > 0 },
1475
+ okButtonProps: { disabled: f.length > 0 },
1458
1476
  onOk: () => s(d),
1459
1477
  onCancel: c,
1460
1478
  children: /* @__PURE__ */ e.jsxs("div", { className: n.computedForm, children: [
1461
1479
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: o("workshopLab.links.ruleHint") }),
1462
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
1480
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
1463
1481
  /* @__PURE__ */ e.jsx("span", { children: o("workshopLab.links.field") }),
1464
1482
  /* @__PURE__ */ e.jsx(
1465
- F,
1483
+ O,
1466
1484
  {
1467
1485
  size: "small",
1468
1486
  className: n.fieldSelect,
1469
1487
  "aria-label": o("workshopLab.links.fieldLabel"),
1470
1488
  value: d.field || void 0,
1471
- options: l(i.objectType).filter((b) => b.name !== i.key && !u.includes(b.name)).map((b) => ({ value: b.name, label: b.label })),
1472
- onChange: (b) => r(b === d.keepDuration ? { field: b, keepDuration: void 0 } : { field: b })
1489
+ options: l(i.objectType).filter((h) => h.name !== i.key && !u.includes(h.name)).map((h) => ({ value: h.name, label: h.label })),
1490
+ onChange: (h) => r(h === d.keepDuration ? { field: h, keepDuration: void 0 } : { field: h })
1473
1491
  }
1474
1492
  ),
1475
1493
  /* @__PURE__ */ e.jsx("span", { children: o("workshopLab.links.notBefore") })
1476
1494
  ] }),
1477
1495
  /* @__PURE__ */ e.jsx(
1478
- Xe,
1496
+ We,
1479
1497
  {
1480
1498
  from: d.from,
1481
1499
  path: d.path,
1482
1500
  source: i,
1483
1501
  network: t,
1484
- starts: w,
1485
- onChange: (b) => r(
1486
- b.from !== void 0 && b.from !== d.from ? { ...b, fromField: "" } : b
1502
+ starts: k,
1503
+ onChange: (h) => r(
1504
+ h.from !== void 0 && h.from !== d.from ? { ...h, fromField: "" } : h
1487
1505
  )
1488
1506
  }
1489
1507
  ),
1490
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
1508
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
1491
1509
  /* @__PURE__ */ e.jsx("span", { children: o("workshopLab.links.fromField") }),
1492
1510
  /* @__PURE__ */ e.jsx(
1493
- F,
1511
+ O,
1494
1512
  {
1495
1513
  size: "small",
1496
1514
  className: n.fieldSelect,
1497
1515
  "aria-label": o("workshopLab.links.fromFieldLabel"),
1498
1516
  value: d.fromField || void 0,
1499
- disabled: !j,
1500
- options: (j ? l(j.objectType) : []).map((b) => ({
1501
- value: b.name,
1502
- label: b.label
1517
+ disabled: !w,
1518
+ options: (w ? l(w.objectType) : []).map((h) => ({
1519
+ value: h.name,
1520
+ label: h.label
1503
1521
  })),
1504
- onChange: (b) => r({ fromField: b })
1522
+ onChange: (h) => r({ fromField: h })
1505
1523
  }
1506
1524
  ),
1507
1525
  /* @__PURE__ */ e.jsx("span", { children: o("workshopLab.links.plus") }),
@@ -1514,7 +1532,7 @@ function is({
1514
1532
  max: Ne,
1515
1533
  precision: 0,
1516
1534
  value: d.gapDays,
1517
- onChange: (b) => r({ gapDays: b ?? 0 })
1535
+ onChange: (h) => r({ gapDays: h ?? 0 })
1518
1536
  }
1519
1537
  ),
1520
1538
  /* @__PURE__ */ e.jsx("span", { children: o("workshopLab.links.days") }),
@@ -1527,15 +1545,15 @@ function is({
1527
1545
  max: Se,
1528
1546
  precision: 0,
1529
1547
  value: d.gapMinutes ?? 0,
1530
- onChange: (b) => r({ gapMinutes: b || void 0 })
1548
+ onChange: (h) => r({ gapMinutes: h || void 0 })
1531
1549
  }
1532
1550
  ),
1533
1551
  /* @__PURE__ */ e.jsx("span", { children: o("workshopLab.links.minutes") })
1534
1552
  ] }),
1535
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
1553
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
1536
1554
  /* @__PURE__ */ e.jsx("span", { children: o("workshopLab.links.keepDuration") }),
1537
1555
  /* @__PURE__ */ e.jsx(
1538
- F,
1556
+ O,
1539
1557
  {
1540
1558
  size: "small",
1541
1559
  allowClear: !0,
@@ -1544,29 +1562,29 @@ function is({
1544
1562
  placeholder: o("workshopLab.links.keepNone"),
1545
1563
  value: d.keepDuration,
1546
1564
  disabled: !d.field,
1547
- options: l(i.objectType).filter((b) => b.name !== d.field && !u.includes(b.name)).map((b) => ({ value: b.name, label: b.label })),
1548
- onChange: (b) => r({ keepDuration: b })
1565
+ options: l(i.objectType).filter((h) => h.name !== d.field && !u.includes(h.name)).map((h) => ({ value: h.name, label: h.label })),
1566
+ onChange: (h) => r({ keepDuration: h })
1549
1567
  }
1550
1568
  )
1551
1569
  ] }),
1552
1570
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: o("workshopLab.links.minutesHint") }),
1553
- g.length > 0 && d.field && d.from && d.fromField && /* @__PURE__ */ e.jsx(re, { type: "warning", showIcon: !0, message: We(g) })
1571
+ f.length > 0 && d.field && d.from && d.fromField && /* @__PURE__ */ e.jsx(re, { type: "warning", showIcon: !0, message: Ke(f) })
1554
1572
  ] })
1555
1573
  }
1556
1574
  );
1557
1575
  }
1558
- function cs({
1576
+ function ps({
1559
1577
  initial: a,
1560
1578
  source: i,
1561
1579
  network: t,
1562
- starts: w,
1580
+ starts: k,
1563
1581
  sources: p,
1564
- others: k,
1582
+ others: j,
1565
1583
  onCancel: c,
1566
1584
  onSave: s
1567
1585
  }) {
1568
- const { t: o } = _(), [d, h] = A.useState(a), r = _a([...k, d], i, p, t, "item").filter(
1569
- (u) => u.startsWith(`item[${k.length}]`)
1586
+ const { t: o } = A(), [d, m] = E.useState(a), r = _a([...j, d], i, p, t, "item").filter(
1587
+ (u) => u.startsWith(`item[${j.length}]`)
1570
1588
  );
1571
1589
  return /* @__PURE__ */ e.jsx(
1572
1590
  ae,
@@ -1581,42 +1599,42 @@ function cs({
1581
1599
  children: /* @__PURE__ */ e.jsxs("div", { className: n.computedForm, children: [
1582
1600
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: o("workshopLab.links.relatedHint") }),
1583
1601
  /* @__PURE__ */ e.jsx(
1584
- Xe,
1602
+ We,
1585
1603
  {
1586
1604
  from: d.from,
1587
1605
  path: d.path,
1588
1606
  source: i,
1589
1607
  network: t,
1590
- starts: w,
1591
- onChange: (u) => h({ ...d, ...u })
1608
+ starts: k,
1609
+ onChange: (u) => m({ ...d, ...u })
1592
1610
  }
1593
1611
  ),
1594
- r.length > 0 && d.from && /* @__PURE__ */ e.jsx(re, { type: "warning", showIcon: !0, message: We(r) })
1612
+ r.length > 0 && d.from && /* @__PURE__ */ e.jsx(re, { type: "warning", showIcon: !0, message: Ke(r) })
1595
1613
  ] })
1596
1614
  }
1597
1615
  );
1598
1616
  }
1599
- function ps({
1617
+ function ds({
1600
1618
  rule: a,
1601
1619
  source: i,
1602
1620
  network: t,
1603
- sources: w,
1621
+ sources: k,
1604
1622
  states: p,
1605
- run: k
1623
+ run: j
1606
1624
  }) {
1607
- const { t: c } = _(), [s, o] = A.useState(null), d = w.find((j) => j.id === a.from), h = d ? p[d.id] : void 0, r = p[i.id], u = h?.status === "ready" && r?.status === "ready", l = async () => {
1608
- if (!(!d || h?.status !== "ready" || r?.status !== "ready")) {
1625
+ const { t: c } = A(), [s, o] = E.useState(null), d = k.find((w) => w.id === a.from), m = d ? p[d.id] : void 0, r = p[i.id], u = m?.status === "ready" && r?.status === "ready", l = async () => {
1626
+ if (!(!d || m?.status !== "ready" || r?.status !== "ready")) {
1609
1627
  o({ status: "running" });
1610
1628
  try {
1611
- const j = me(t, d.objectType, a.path) ?? [], g = await Ia(
1612
- k,
1629
+ const w = me(t, d.objectType, a.path) ?? [], f = await Ia(
1630
+ j,
1613
1631
  t,
1614
1632
  d,
1615
1633
  i,
1616
- j,
1617
- h.rows.map((b) => b.$key)
1634
+ w,
1635
+ m.rows.map((h) => h.$key)
1618
1636
  );
1619
- o({ status: "done", ...wa(a, r.rows, h.rows, g) });
1637
+ o({ status: "done", ...wa(a, r.rows, m.rows, f) });
1620
1638
  } catch {
1621
1639
  o({ status: "error" });
1622
1640
  }
@@ -1640,48 +1658,48 @@ function ps({
1640
1658
  s?.status === "done" && (s.covered === 0 ? c("workshopLab.links.checkNone") : c("workshopLab.links.checkResult", {
1641
1659
  covered: s.covered,
1642
1660
  holds: s.holds,
1643
- diffs: s.diffs.map(([j, g]) => c("workshopLab.links.checkDiff", { days: j, count: g })).join("、")
1661
+ diffs: s.diffs.map(([w, f]) => c("workshopLab.links.checkDiff", { days: w, count: f })).join("、")
1644
1662
  }))
1645
1663
  ] });
1646
1664
  }
1647
- const Ke = /^[A-Za-z][A-Za-z0-9_]*$/, ds = 4;
1665
+ const Xe = /^[A-Za-z][A-Za-z0-9_]*$/, ms = 4;
1648
1666
  function Je(a, i) {
1649
- const w = (a.match(/[A-Za-z][A-Za-z0-9]*|[0-9]+/g) ?? []).map(
1650
- (k, c) => c === 0 ? k.charAt(0).toLowerCase() + k.slice(1) : k.charAt(0).toUpperCase() + k.slice(1)
1651
- ).join(""), p = Ke.test(w) ? w.slice(0, 40) : "column";
1667
+ const k = (a.match(/[A-Za-z][A-Za-z0-9]*|[0-9]+/g) ?? []).map(
1668
+ (j, c) => c === 0 ? j.charAt(0).toLowerCase() + j.slice(1) : j.charAt(0).toUpperCase() + j.slice(1)
1669
+ ).join(""), p = Xe.test(k) ? k.slice(0, 40) : "column";
1652
1670
  if (!i.includes(p) && p !== "column") return p;
1653
- for (let k = p === "column" ? 1 : 2; ; k += 1)
1654
- if (!i.includes(`${p}${k}`)) return `${p}${k}`;
1671
+ for (let j = p === "column" ? 1 : 2; ; j += 1)
1672
+ if (!i.includes(`${p}${j}`)) return `${p}${j}`;
1655
1673
  }
1656
- const ms = 3, us = 6;
1657
- function hs() {
1674
+ const hs = 3, us = 6;
1675
+ function bs() {
1658
1676
  const { message: a } = na();
1659
1677
  return (i) => (i.length > 0 && a.error(i.slice(0, 3).join(";")), i.length === 0);
1660
1678
  }
1661
- function bs(a, i, t) {
1662
- const w = hs(), p = A.useMemo(() => Ve(i, a.sources), [i, a.sources]), k = A.useMemo(() => {
1679
+ function ks(a, i, t) {
1680
+ const k = bs(), p = E.useMemo(() => Ve(i, a.sources), [i, a.sources]), j = E.useMemo(() => {
1663
1681
  const s = a.variables.find((d) => d.kind === "asOf"), o = s ? He(a.variables, {})[s.name] : void 0;
1664
1682
  return typeof o == "string" ? o : la();
1665
1683
  }, [a.variables]);
1666
- return { network: p, asOf: k, save: (s, o) => {
1684
+ return { network: p, asOf: j, save: (s, o) => {
1667
1685
  const d = {
1668
1686
  ...a,
1669
- sources: a.sources.map((h) => h.id === s.id ? s : h)
1687
+ sources: a.sources.map((m) => m.id === s.id ? s : m)
1670
1688
  };
1671
- return w(
1689
+ return k(
1672
1690
  t(o ? Ha(d, s.id, o.field, o.renames) : d)
1673
1691
  );
1674
1692
  } };
1675
1693
  }
1676
- function ks({ app: a, kn: i, sources: t, run: w, chatModel: p = () => null, apply: k }) {
1677
- const { t: c } = _(), { network: s, asOf: o, save: d } = bs(a, i, k), h = A.useMemo(() => He(a.variables, {}), [a.variables]), r = ga(a.sources, i, w, h, t), u = A.useMemo(() => os(a, i, c), [a, i, c]);
1694
+ function js({ app: a, kn: i, sources: t, run: k, chatModel: p = () => null, apply: j }) {
1695
+ const { t: c } = A(), { network: s, asOf: o, save: d } = ks(a, i, j), m = E.useMemo(() => He(a.variables, {}), [a.variables]), r = xa(a.sources, i, k, m, t), u = E.useMemo(() => ls(a, i, c), [a, i, c]);
1678
1696
  return /* @__PURE__ */ e.jsxs("div", { className: n.library, children: [
1679
1697
  /* @__PURE__ */ e.jsx("header", { className: n.listHeader, children: /* @__PURE__ */ e.jsxs("div", { children: [
1680
1698
  /* @__PURE__ */ e.jsx("h3", { className: n.sectionTitle, children: c("workshopLab.computed.title") }),
1681
1699
  /* @__PURE__ */ e.jsx("p", { className: n.muted, children: c("workshopLab.computed.hint", { date: o }) })
1682
1700
  ] }) }),
1683
1701
  a.sources.filter((l) => !l.from).map((l) => /* @__PURE__ */ e.jsx(
1684
- xs,
1702
+ fs,
1685
1703
  {
1686
1704
  source: l,
1687
1705
  properties: s.objectTypes[l.objectType]?.properties ?? [],
@@ -1690,7 +1708,7 @@ function ks({ app: a, kn: i, sources: t, run: w, chatModel: p = () => null, appl
1690
1708
  sources: a.sources,
1691
1709
  asOf: o,
1692
1710
  usage: Ra(a, l.id),
1693
- tools: { network: s, run: w, chatModel: p },
1711
+ tools: { network: s, run: k, chatModel: p },
1694
1712
  generatedSource: u.sources.get(l.id),
1695
1713
  generatedColumns: u.columns.get(l.id),
1696
1714
  scenarioParams: a.scenarioParams ?? gs,
@@ -1700,50 +1718,50 @@ function ks({ app: a, kn: i, sources: t, run: w, chatModel: p = () => null, appl
1700
1718
  ))
1701
1719
  ] });
1702
1720
  }
1703
- const js = ["operations", "links", "models"], ws = ["operations"], gs = [];
1704
- function xs({
1721
+ const ws = ["operations", "links", "models"], xs = ["operations"], gs = [];
1722
+ function fs({
1705
1723
  source: a,
1706
1724
  properties: i,
1707
1725
  state: t,
1708
- states: w,
1726
+ states: k,
1709
1727
  sources: p,
1710
- asOf: k,
1728
+ asOf: j,
1711
1729
  usage: c,
1712
1730
  tools: s,
1713
1731
  scenarioParams: o,
1714
1732
  generatedSource: d,
1715
- generatedColumns: h,
1733
+ generatedColumns: m,
1716
1734
  save: r
1717
1735
  }) {
1718
- const { t: u } = _(), l = a.computed ?? [], [j, g] = A.useState(null), [b, T] = A.useState(!1), [v, C] = A.useState([]), S = t?.status === "ready" ? t.rows : null, N = A.useMemo(
1719
- () => S ? ue(S, a, k) : null,
1720
- [S, a, k]
1721
- ), O = (z) => [
1736
+ const { t: u } = A(), l = a.computed ?? [], [w, f] = E.useState(null), [h, C] = E.useState(!1), [L, N] = E.useState([]), S = t?.status === "ready" ? t.rows : null, y = E.useMemo(
1737
+ () => S ? he(S, a, j) : null,
1738
+ [S, a, j]
1739
+ ), x = (z) => [
1722
1740
  ...i,
1723
1741
  ...fe(a.progress),
1724
- ...l.filter((f, E) => E !== z).map(te)
1725
- ], L = (z, f, E) => {
1726
- const D = [...l];
1727
- return f === null ? D.splice(z, 1) : D[z] = f, r({ ...a, computed: D.length > 0 ? D : void 0 }, E);
1728
- }, m = !a.cypher && !a.events, x = {
1742
+ ...l.filter((v, P) => P !== z).map(te)
1743
+ ], b = (z, v, P) => {
1744
+ const R = [...l];
1745
+ return v === null ? R.splice(z, 1) : R[z] = v, r({ ...a, computed: R.length > 0 ? R : void 0 }, P);
1746
+ }, g = !a.cypher && !a.events, T = {
1729
1747
  formats: Object.keys(a.formats ?? {}).length > 0,
1730
1748
  operations: (a.operations ?? []).length > 0,
1731
1749
  links: (a.follows ?? []).length + (a.relatedTo ?? []).length > 0,
1732
1750
  models: (a.models ?? []).length > 0
1733
- }, y = (z) => x[z] || v.includes(z), R = (z) => C((f) => f.filter((E) => E !== z)), M = (z) => (f) => {
1734
- const E = r(f);
1735
- return E && R(z), E;
1736
- }, B = (z) => ({
1751
+ }, _ = (z) => T[z] || L.includes(z), H = (z) => N((v) => v.filter((P) => P !== z)), M = (z) => (v) => {
1752
+ const P = r(v);
1753
+ return P && H(z), P;
1754
+ }, D = (z) => ({
1737
1755
  key: z,
1738
1756
  label: /* @__PURE__ */ e.jsxs("span", { className: n.addItem, children: [
1739
1757
  /* @__PURE__ */ e.jsx("span", { children: u(`workshopLab.blocks.items.${z}.label`) }),
1740
1758
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: u(`workshopLab.blocks.items.${z}.description`) })
1741
1759
  ] })
1742
- }), X = !!a.model, ie = X ? ws : js, ce = [
1743
- ...a.progress || X ? [] : [B("progress")],
1744
- ...X ? [] : [B("computed")],
1745
- ...y("formats") ? [] : [B("formats")]
1746
- ], se = m ? ie.filter((z) => !y(z)).map(B) : [], pe = [
1760
+ }), W = !!a.model, ie = W ? xs : ws, ce = [
1761
+ ...a.progress || W ? [] : [D("progress")],
1762
+ ...W ? [] : [D("computed")],
1763
+ ..._("formats") ? [] : [D("formats")]
1764
+ ], se = g ? ie.filter((z) => !_(z)).map(D) : [], pe = [
1747
1765
  {
1748
1766
  type: "group",
1749
1767
  key: "columns",
@@ -1758,18 +1776,18 @@ function xs({
1758
1776
  children: se
1759
1777
  }
1760
1778
  ] : []
1761
- ], W = (z) => {
1762
- z === "progress" ? T(!0) : z === "computed" ? g({
1779
+ ], K = (z) => {
1780
+ z === "progress" ? C(!0) : z === "computed" ? f({
1763
1781
  index: l.length,
1764
1782
  field: { name: "", label: "", kind: "classify", cases: [], otherwise: { value: "" } }
1765
- }) : C((f) => [...f, z]);
1766
- }, Z = !!a.progress || l.length > 0 || y("formats"), oe = m && ie.some(y);
1783
+ }) : N((v) => [...v, z]);
1784
+ }, Z = !!a.progress || l.length > 0 || _("formats"), oe = g && ie.some(_);
1767
1785
  return /* @__PURE__ */ e.jsxs("section", { className: n.entry, "aria-label": a.label, children: [
1768
1786
  /* @__PURE__ */ e.jsxs("header", { className: n.entryHeader, children: [
1769
1787
  /* @__PURE__ */ e.jsx("b", { children: a.label }),
1770
1788
  d !== void 0 && /* @__PURE__ */ e.jsx($e, {}),
1771
1789
  /* @__PURE__ */ e.jsx("span", { className: n.spacer }),
1772
- /* @__PURE__ */ e.jsx(Da, { trigger: ["click"], menu: { items: pe, onClick: ({ key: z }) => W(z) }, children: /* @__PURE__ */ e.jsxs($, { size: "small", type: "primary", icon: /* @__PURE__ */ e.jsx(ne, {}), children: [
1790
+ /* @__PURE__ */ e.jsx(Da, { trigger: ["click"], menu: { items: pe, onClick: ({ key: z }) => K(z) }, children: /* @__PURE__ */ e.jsxs($, { size: "small", type: "primary", icon: /* @__PURE__ */ e.jsx(ne, {}), children: [
1773
1791
  u("workshopLab.blocks.add"),
1774
1792
  " ",
1775
1793
  /* @__PURE__ */ e.jsx(ta, {})
@@ -1779,30 +1797,30 @@ function xs({
1779
1797
  !Z && !oe && /* @__PURE__ */ e.jsx("span", { className: n.muted, children: u("workshopLab.blocks.empty") }),
1780
1798
  Z && /* @__PURE__ */ e.jsx("span", { className: n.blockGroup, children: u("workshopLab.blocks.groups.columns") }),
1781
1799
  /* @__PURE__ */ e.jsx(
1782
- Ps,
1800
+ Es,
1783
1801
  {
1784
1802
  source: a,
1785
1803
  properties: i,
1786
- rows: N,
1804
+ rows: y,
1787
1805
  usage: c,
1788
- onEdit: () => T(!0),
1806
+ onEdit: () => C(!0),
1789
1807
  onRemove: () => r({ ...a, progress: void 0 })
1790
1808
  }
1791
1809
  ),
1792
- l.length > 0 && /* @__PURE__ */ e.jsx("ul", { className: n.computedList, children: l.map((z, f) => {
1793
- const E = c.get(z.name) ?? [];
1810
+ l.length > 0 && /* @__PURE__ */ e.jsx("ul", { className: n.computedList, children: l.map((z, v) => {
1811
+ const P = c.get(z.name) ?? [];
1794
1812
  return /* @__PURE__ */ e.jsxs("li", { className: n.computedItem, children: [
1795
1813
  /* @__PURE__ */ e.jsxs("div", { className: n.computedHead, children: [
1796
1814
  /* @__PURE__ */ e.jsx("b", { children: z.label }),
1797
1815
  /* @__PURE__ */ e.jsx(J, { children: u(`workshopLab.computed.kinds.${z.kind}`) }),
1798
- h?.has(z.name) && /* @__PURE__ */ e.jsx($e, {}),
1816
+ m?.has(z.name) && /* @__PURE__ */ e.jsx($e, {}),
1799
1817
  /* @__PURE__ */ e.jsx("span", { className: n.spacer }),
1800
- /* @__PURE__ */ e.jsx($, { size: "small", type: "link", onClick: () => g({ index: f, field: z }), children: u("workshopLab.computed.edit") }),
1801
- E.length > 0 ? /* @__PURE__ */ e.jsx(
1802
- xe,
1818
+ /* @__PURE__ */ e.jsx($, { size: "small", type: "link", onClick: () => f({ index: v, field: z }), children: u("workshopLab.computed.edit") }),
1819
+ P.length > 0 ? /* @__PURE__ */ e.jsx(
1820
+ ge,
1803
1821
  {
1804
1822
  title: u("workshopLab.computed.removeBlocked", {
1805
- names: E.map((D) => D.label).join("、")
1823
+ names: P.map((R) => R.label).join("、")
1806
1824
  }),
1807
1825
  children: /* @__PURE__ */ e.jsx($, { size: "small", type: "link", danger: !0, disabled: !0, children: u("workshopLab.computed.remove") })
1808
1826
  }
@@ -1810,131 +1828,131 @@ function xs({
1810
1828
  ee,
1811
1829
  {
1812
1830
  title: u("workshopLab.computed.removeConfirm", { name: z.label }),
1813
- onConfirm: () => L(f, null),
1831
+ onConfirm: () => b(v, null),
1814
1832
  children: /* @__PURE__ */ e.jsx($, { size: "small", type: "link", danger: !0, children: u("workshopLab.computed.remove") })
1815
1833
  }
1816
1834
  )
1817
1835
  ] }),
1818
- h?.has(z.name) && /* @__PURE__ */ e.jsx("span", { className: n.muted, children: h.get(z.name) }),
1819
- /* @__PURE__ */ e.jsx("span", { className: n.muted, children: Ls(z, O(f), u, s.network, a.objectType, p) }),
1820
- /* @__PURE__ */ e.jsx(qe, { field: z, rows: N }),
1821
- /* @__PURE__ */ e.jsx("span", { className: n.muted, children: E.length > 0 ? u("workshopLab.computed.usedBy", {
1822
- names: E.map((D) => D.label).join("、")
1836
+ m?.has(z.name) && /* @__PURE__ */ e.jsx("span", { className: n.muted, children: m.get(z.name) }),
1837
+ /* @__PURE__ */ e.jsx("span", { className: n.muted, children: ys(z, x(v), u, s.network, a.objectType, p) }),
1838
+ /* @__PURE__ */ e.jsx(qe, { field: z, rows: y }),
1839
+ /* @__PURE__ */ e.jsx("span", { className: n.muted, children: P.length > 0 ? u("workshopLab.computed.usedBy", {
1840
+ names: P.map((R) => R.label).join("、")
1823
1841
  }) : u("workshopLab.computed.unused") })
1824
1842
  ] }, z.name);
1825
1843
  }) }),
1826
- y("formats") && /* @__PURE__ */ e.jsx(
1844
+ _("formats") && /* @__PURE__ */ e.jsx(
1827
1845
  es,
1828
1846
  {
1829
1847
  source: a,
1830
- fields: O(l.length),
1848
+ fields: x(l.length),
1831
1849
  save: M("formats"),
1832
- onClose: () => R("formats")
1850
+ onClose: () => H("formats")
1833
1851
  }
1834
1852
  ),
1835
1853
  oe && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1836
1854
  /* @__PURE__ */ e.jsx("span", { className: n.blockGroup, children: u("workshopLab.blocks.groups.scenario") }),
1837
- y("operations") && /* @__PURE__ */ e.jsx(
1838
- ts,
1855
+ _("operations") && /* @__PURE__ */ e.jsx(
1856
+ ns,
1839
1857
  {
1840
1858
  source: a,
1841
1859
  network: s.network,
1842
1860
  save: M("operations"),
1843
- adding: v.includes("operations"),
1844
- onClose: () => R("operations")
1861
+ adding: L.includes("operations"),
1862
+ onClose: () => H("operations")
1845
1863
  }
1846
1864
  ),
1847
- y("links") && /* @__PURE__ */ e.jsx(
1848
- rs,
1865
+ _("links") && /* @__PURE__ */ e.jsx(
1866
+ is,
1849
1867
  {
1850
1868
  source: a,
1851
1869
  network: s.network,
1852
1870
  sources: p,
1853
- states: w,
1871
+ states: k,
1854
1872
  run: s.run,
1855
1873
  save: M("links"),
1856
- onClose: () => R("links")
1874
+ onClose: () => H("links")
1857
1875
  }
1858
1876
  ),
1859
- y("models") && /* @__PURE__ */ e.jsx(
1860
- as,
1877
+ _("models") && /* @__PURE__ */ e.jsx(
1878
+ ss,
1861
1879
  {
1862
1880
  source: a,
1863
1881
  network: s.network,
1864
1882
  scenarioParams: o,
1865
1883
  save: M("models"),
1866
- adding: v.includes("models"),
1867
- onClose: () => R("models")
1884
+ adding: L.includes("models"),
1885
+ onClose: () => H("models")
1868
1886
  }
1869
1887
  )
1870
1888
  ] }),
1871
- j && /* @__PURE__ */ e.jsx(
1872
- Qe,
1889
+ w && /* @__PURE__ */ e.jsx(
1890
+ Ye,
1873
1891
  {
1874
- field: j.field,
1875
- isNew: j.index === l.length,
1876
- fields: O(j.index),
1892
+ field: w.field,
1893
+ isNew: w.index === l.length,
1894
+ fields: x(w.index),
1877
1895
  source: a,
1878
1896
  rows: S,
1879
- asOf: k,
1897
+ asOf: j,
1880
1898
  tools: s,
1881
- others: { sources: p, states: w },
1882
- taken: O(j.index).map((z) => z.name),
1883
- onCancel: () => g(null),
1899
+ others: { sources: p, states: k },
1900
+ taken: x(w.index).map((z) => z.name),
1901
+ onCancel: () => f(null),
1884
1902
  onSave: (z) => {
1885
- const f = Ba(j.field, z), E = f.size > 0 ? { field: z.name, renames: f } : void 0;
1886
- L(j.index, z, E) && g(null);
1903
+ const v = Ba(w.field, z), P = v.size > 0 ? { field: z.name, renames: v } : void 0;
1904
+ b(w.index, z, P) && f(null);
1887
1905
  }
1888
1906
  }
1889
1907
  ),
1890
- b && /* @__PURE__ */ e.jsx(
1891
- Ms,
1908
+ h && /* @__PURE__ */ e.jsx(
1909
+ As,
1892
1910
  {
1893
1911
  initial: a.progress,
1894
1912
  source: a,
1895
- asOf: k,
1913
+ asOf: j,
1896
1914
  properties: i,
1897
1915
  rows: S,
1898
- onCancel: () => T(!1),
1916
+ onCancel: () => C(!1),
1899
1917
  onSave: (z) => {
1900
- r({ ...a, progress: z }) && T(!1);
1918
+ r({ ...a, progress: z }) && C(!1);
1901
1919
  }
1902
1920
  }
1903
1921
  )
1904
1922
  ] });
1905
1923
  }
1906
- function fs({
1924
+ function Ls({
1907
1925
  source: a,
1908
1926
  spec: i,
1909
1927
  onCancel: t,
1910
- onSave: w
1928
+ onSave: k
1911
1929
  }) {
1912
- return /* @__PURE__ */ e.jsx(Ze, { source: a, spec: i, onCancel: t, onSave: w });
1930
+ return /* @__PURE__ */ e.jsx(Ze, { source: a, spec: i, onCancel: t, onSave: k });
1913
1931
  }
1914
1932
  function vs({
1915
1933
  source: a,
1916
1934
  spec: i,
1917
1935
  name: t,
1918
- onCancel: w,
1936
+ onCancel: k,
1919
1937
  onSave: p
1920
1938
  }) {
1921
- const k = a.computed?.find((c) => c.name === t);
1922
- return k ? /* @__PURE__ */ e.jsx(Ze, { source: a, spec: i, field: k, onCancel: w, onSave: p }) : null;
1939
+ const j = a.computed?.find((c) => c.name === t);
1940
+ return j ? /* @__PURE__ */ e.jsx(Ze, { source: a, spec: i, field: j, onCancel: k, onSave: p }) : null;
1923
1941
  }
1924
1942
  function Ze({
1925
1943
  source: a,
1926
1944
  spec: i,
1927
1945
  field: t,
1928
- onCancel: w,
1946
+ onCancel: k,
1929
1947
  onSave: p
1930
1948
  }) {
1931
- const { kn: k, sources: c, run: s, values: o } = Ka(), d = va(), h = A.useMemo(() => Ve(k, i.sources), [k, i.sources]), r = c[a.id], u = [
1932
- ...h.objectTypes[a.objectType]?.properties ?? [],
1949
+ const { kn: j, sources: c, run: s, values: o } = Xa(), d = La(), m = E.useMemo(() => Ve(j, i.sources), [j, i.sources]), r = c[a.id], u = [
1950
+ ...m.objectTypes[a.objectType]?.properties ?? [],
1933
1951
  ...fe(a.progress),
1934
1952
  ...(a.computed ?? []).filter((l) => l.name !== t?.name).map(te)
1935
1953
  ];
1936
1954
  return /* @__PURE__ */ e.jsx(
1937
- Qe,
1955
+ Ye,
1938
1956
  {
1939
1957
  field: t ?? { name: "", label: "", kind: "classify", cases: [], otherwise: { value: "" } },
1940
1958
  isNew: !t,
@@ -1942,16 +1960,16 @@ function Ze({
1942
1960
  source: a,
1943
1961
  rows: r?.status === "ready" ? r.rows : null,
1944
1962
  asOf: Ja(i, o),
1945
- tools: { network: h, run: s, chatModel: d?.chatModel ?? (() => null) },
1963
+ tools: { network: m, run: s, chatModel: d?.chatModel ?? (() => null) },
1946
1964
  others: { sources: i.sources, states: c },
1947
1965
  taken: u.map((l) => l.name),
1948
- onCancel: w,
1966
+ onCancel: k,
1949
1967
  onSave: p
1950
1968
  }
1951
1969
  );
1952
1970
  }
1953
- function Ls(a, i, t, w, p, k = []) {
1954
- const c = (s) => s === Q ? t("workshopLab.computed.asOf") : i.find((o) => o.name === s)?.label ?? s;
1971
+ function ys(a, i, t, k, p, j = []) {
1972
+ const c = (s) => s === Y ? t("workshopLab.computed.asOf") : i.find((o) => o.name === s)?.label ?? s;
1955
1973
  switch (a.kind) {
1956
1974
  case "classify":
1957
1975
  return [
@@ -1976,19 +1994,19 @@ function Ls(a, i, t, w, p, k = []) {
1976
1994
  expr: a.expr.replace(/[A-Za-z_][A-Za-z0-9_]*/g, (s) => c(s))
1977
1995
  });
1978
1996
  case "related": {
1979
- const s = me(w, p, a.path) ?? [], o = s.length > 0 ? w.objectTypes[s[s.length - 1].to] : void 0, d = (h) => o?.properties.find((r) => r.name === h)?.label ?? h ?? "";
1997
+ const s = me(k, p, a.path) ?? [], o = s.length > 0 ? k.objectTypes[s[s.length - 1].to] : void 0, d = (m) => o?.properties.find((r) => r.name === m)?.label ?? m ?? "";
1980
1998
  return t("workshopLab.computed.relatedLine", {
1981
- path: s.map((h) => h.relation.name).join(" → ") || "—",
1999
+ path: s.map((m) => m.relation.name).join(" → ") || "—",
1982
2000
  target: o?.name ?? "—",
1983
2001
  what: t(`workshopLab.computed.aggregates.${a.aggregate}`, {
1984
2002
  field: d(a.field)
1985
2003
  }),
1986
2004
  where: a.where?.length ? t("workshopLab.computed.relatedWhere", {
1987
2005
  when: a.where.map(
1988
- (h) => [
1989
- d(h.field),
1990
- t(`workshopLab.computed.ops.${h.op}`),
1991
- h.values?.join("、") ?? String(h.value ?? "")
2006
+ (m) => [
2007
+ d(m.field),
2008
+ t(`workshopLab.computed.ops.${m.op}`),
2009
+ m.values?.join("、") ?? String(m.value ?? "")
1992
2010
  ].filter(Boolean).join(" ")
1993
2011
  ).join(t("workshopLab.computed.and"))
1994
2012
  }) : ""
@@ -2000,27 +2018,27 @@ function Ls(a, i, t, w, p, k = []) {
2000
2018
  scope: t(`workshopLab.basemaps.${a.scope ?? "china"}`)
2001
2019
  });
2002
2020
  case "matched": {
2003
- const s = k.find((h) => h.id === a.source), o = s ? [
2004
- ...w.objectTypes[s.objectType]?.properties ?? [],
2021
+ const s = j.find((m) => m.id === a.source), o = s ? [
2022
+ ...k.objectTypes[s.objectType]?.properties ?? [],
2005
2023
  ...(s.computed ?? []).map(te)
2006
- ] : [], d = (h) => o.find((r) => r.name === h)?.label ?? h;
2024
+ ] : [], d = (m) => o.find((r) => r.name === m)?.label ?? m;
2007
2025
  return t(
2008
2026
  a.field ? "workshopLab.computed.matchedValueLine" : "workshopLab.computed.matchedCountLine",
2009
2027
  {
2010
2028
  source: s?.label ?? t("workshopLab.computed.matchedMissing"),
2011
2029
  pairs: a.pairs.map(
2012
- (h) => t("workshopLab.computed.matchedPair", {
2013
- own: c(h.field),
2014
- other: d(h.other)
2030
+ (m) => t("workshopLab.computed.matchedPair", {
2031
+ own: c(m.field),
2032
+ other: d(m.other)
2015
2033
  })
2016
2034
  ).join("、"),
2017
2035
  field: a.field ? d(a.field) : "",
2018
2036
  where: a.where?.length ? t("workshopLab.computed.relatedWhere", {
2019
2037
  when: a.where.map(
2020
- (h) => [
2021
- d(h.field),
2022
- t(`workshopLab.computed.ops.${h.op}`),
2023
- h.ref !== void 0 ? d(h.ref) : h.values?.join("、") ?? String(h.value ?? "")
2038
+ (m) => [
2039
+ d(m.field),
2040
+ t(`workshopLab.computed.ops.${m.op}`),
2041
+ m.ref !== void 0 ? d(m.ref) : m.values?.join("、") ?? String(m.value ?? "")
2024
2042
  ].filter(Boolean).join(" ")
2025
2043
  ).join(t("workshopLab.computed.and"))
2026
2044
  }) : ""
@@ -2037,20 +2055,20 @@ function Ls(a, i, t, w, p, k = []) {
2037
2055
  }
2038
2056
  }
2039
2057
  function qe({ field: a, rows: i }) {
2040
- const { t } = _();
2058
+ const { t } = A();
2041
2059
  if (!i) return /* @__PURE__ */ e.jsx("span", { className: n.muted, children: t("workshopLab.computed.notLoaded") });
2042
- const w = i.map((o) => o[a.name]);
2060
+ const k = i.map((o) => o[a.name]);
2043
2061
  if (a.kind === "classify") {
2044
2062
  const o = /* @__PURE__ */ new Map();
2045
- for (const d of w) o.set(String(d), (o.get(String(d)) ?? 0) + 1);
2046
- return /* @__PURE__ */ e.jsx("span", { className: n.computedPreview, children: [...a.cases, a.otherwise].map((d, h) => /* @__PURE__ */ e.jsxs(J, { color: ve(d.tone), children: [
2063
+ for (const d of k) o.set(String(d), (o.get(String(d)) ?? 0) + 1);
2064
+ return /* @__PURE__ */ e.jsx("span", { className: n.computedPreview, children: [...a.cases, a.otherwise].map((d, m) => /* @__PURE__ */ e.jsxs(J, { color: Le(d.tone), children: [
2047
2065
  d.value,
2048
2066
  " ",
2049
2067
  o.get(d.value) ?? 0
2050
- ] }, h)) });
2068
+ ] }, m)) });
2051
2069
  }
2052
- const p = w.filter((o) => o != null && o !== ""), k = a.kind === "matched" && a.field !== void 0 && a.type !== "number" || a.kind === "related" && (a.aggregate === "list" || a.aggregate === "one" && a.type !== "number");
2053
- if (a.kind === "text" || k) {
2070
+ const p = k.filter((o) => o != null && o !== ""), j = a.kind === "matched" && a.field !== void 0 && a.type !== "number" || a.kind === "related" && (a.aggregate === "list" || a.aggregate === "one" && a.type !== "number");
2071
+ if (a.kind === "text" || j) {
2054
2072
  const o = [...new Set(p.map(String))].slice(0, 3).join("、");
2055
2073
  return /* @__PURE__ */ e.jsx("span", { className: n.muted, children: t("workshopLab.computed.textPreview", {
2056
2074
  count: p.length,
@@ -2059,7 +2077,7 @@ function qe({ field: a, rows: i }) {
2059
2077
  }) });
2060
2078
  }
2061
2079
  if (a.kind !== "region") {
2062
- const o = p.map(Number), d = (h) => h.toLocaleString(void 0, { maximumFractionDigits: 2 });
2080
+ const o = p.map(Number), d = (m) => m.toLocaleString(void 0, { maximumFractionDigits: 2 });
2063
2081
  return /* @__PURE__ */ e.jsx("span", { className: n.muted, children: o.length === 0 ? t("workshopLab.computed.daysNone", { total: i.length }) : t("workshopLab.computed.numberPreview", {
2064
2082
  count: o.length,
2065
2083
  total: i.length,
@@ -2070,19 +2088,19 @@ function qe({ field: a, rows: i }) {
2070
2088
  }
2071
2089
  const c = /* @__PURE__ */ new Map();
2072
2090
  for (const o of p) c.set(String(o), (c.get(String(o)) ?? 0) + 1);
2073
- const s = [...c].sort((o, d) => d[1] - o[1]).slice(0, ms).map(([o, d]) => `${o} ${d}`).join("、");
2091
+ const s = [...c].sort((o, d) => d[1] - o[1]).slice(0, hs).map(([o, d]) => `${o} ${d}`).join("、");
2074
2092
  return /* @__PURE__ */ e.jsx("span", { className: n.muted, children: t("workshopLab.computed.regionPreview", {
2075
2093
  count: p.length,
2076
2094
  missing: i.length - p.length,
2077
2095
  top: s || "—"
2078
2096
  }) });
2079
2097
  }
2080
- function ys({
2098
+ function Ns({
2081
2099
  field: a,
2082
2100
  rows: i,
2083
2101
  fields: t
2084
2102
  }) {
2085
- const { t: w } = _(), [p, k] = A.useState(null);
2103
+ const { t: k } = A(), [p, j] = E.useState(null);
2086
2104
  if (!i) return null;
2087
2105
  const c = (r) => r == null || r === "", s = a.kind === "classify" ? [...a.cases, a.otherwise].map((r) => ({
2088
2106
  key: r.value,
@@ -2091,22 +2109,22 @@ function ys({
2091
2109
  })) : [
2092
2110
  {
2093
2111
  key: "set",
2094
- label: w("workshopLab.computed.withValue"),
2112
+ label: k("workshopLab.computed.withValue"),
2095
2113
  test: (r) => !c(r[a.name])
2096
2114
  },
2097
2115
  {
2098
2116
  key: "empty",
2099
- label: w("workshopLab.computed.withoutValue"),
2117
+ label: k("workshopLab.computed.withoutValue"),
2100
2118
  test: (r) => c(r[a.name])
2101
2119
  }
2102
- ], o = s.find((r) => r.key === p), d = [...new Set(ma(a))], h = (r) => t.find((u) => u.name === r)?.label ?? r;
2120
+ ], o = s.find((r) => r.key === p), d = [...new Set(ma(a))], m = (r) => t.find((u) => u.name === r)?.label ?? r;
2103
2121
  return /* @__PURE__ */ e.jsxs("div", { className: n.computedSamples, children: [
2104
- /* @__PURE__ */ e.jsx("span", { className: n.muted, children: w("workshopLab.computed.samplesHint") }),
2105
- /* @__PURE__ */ e.jsx(P, { size: 4, wrap: !0, children: s.map((r) => /* @__PURE__ */ e.jsx(
2122
+ /* @__PURE__ */ e.jsx("span", { className: n.muted, children: k("workshopLab.computed.samplesHint") }),
2123
+ /* @__PURE__ */ e.jsx(F, { size: 4, wrap: !0, children: s.map((r) => /* @__PURE__ */ e.jsx(
2106
2124
  J.CheckableTag,
2107
2125
  {
2108
2126
  checked: p === r.key,
2109
- onChange: (u) => k(u ? r.key : null),
2127
+ onChange: (u) => j(u ? r.key : null),
2110
2128
  children: r.label
2111
2129
  },
2112
2130
  r.key
@@ -2120,10 +2138,10 @@ function ys({
2120
2138
  scroll: { x: "max-content" },
2121
2139
  dataSource: i.filter(o.test).slice(0, us),
2122
2140
  columns: [
2123
- { key: "$key", title: w("workshopLab.computed.object"), dataIndex: "$key" },
2141
+ { key: "$key", title: k("workshopLab.computed.object"), dataIndex: "$key" },
2124
2142
  ...d.map((r) => ({
2125
2143
  key: r,
2126
- title: h(r),
2144
+ title: m(r),
2127
2145
  dataIndex: r,
2128
2146
  render: (u) => c(u) ? "—" : String(u).slice(0, 24)
2129
2147
  })),
@@ -2138,119 +2156,119 @@ function ys({
2138
2156
  )
2139
2157
  ] });
2140
2158
  }
2141
- function ve(a) {
2159
+ function Le(a) {
2142
2160
  return a === "danger" ? "error" : a === "success" ? "success" : a === "warning" ? "warning" : a === "info" ? "processing" : "default";
2143
2161
  }
2144
- function Qe({
2162
+ function Ye({
2145
2163
  field: a,
2146
2164
  isNew: i,
2147
2165
  fields: t,
2148
- source: w,
2166
+ source: k,
2149
2167
  rows: p,
2150
- asOf: k,
2168
+ asOf: j,
2151
2169
  tools: c,
2152
2170
  others: s,
2153
2171
  taken: o,
2154
2172
  onCancel: d,
2155
- onSave: h
2173
+ onSave: m
2156
2174
  }) {
2157
- const { t: r } = _(), { network: u } = c, [l, j] = A.useState(a), [g, b] = A.useState(!i || !!a.name), [T, v] = A.useState(!1), C = (f) => j(
2158
- g || f.label === l.label ? f : { ...f, name: f.label.trim() ? Je(f.label, o) : "" }
2159
- ), S = t.filter((f) => f.type === "date"), N = t.filter((f) => f.type === "text"), O = [
2160
- { value: Q, label: r("workshopLab.computed.asOf") },
2161
- ...S.map((f) => ({ value: f.name, label: f.label }))
2162
- ], L = {
2175
+ const { t: r } = A(), { network: u } = c, [l, w] = E.useState(a), [f, h] = E.useState(!i || !!a.name), [C, L] = E.useState(!1), N = (v) => w(
2176
+ f || v.label === l.label ? v : { ...v, name: v.label.trim() ? Je(v.label, o) : "" }
2177
+ ), S = t.filter((v) => v.type === "date"), y = t.filter((v) => v.type === "text"), x = [
2178
+ { value: Y, label: r("workshopLab.computed.asOf") },
2179
+ ...S.map((v) => ({ value: v.name, label: v.label }))
2180
+ ], b = {
2163
2181
  kn: u,
2164
- objectType: w.objectType,
2165
- cypher: w.cypher !== void 0,
2166
- progress: !!w.progress,
2182
+ objectType: k.objectType,
2183
+ cypher: k.cypher !== void 0,
2184
+ progress: !!k.progress,
2167
2185
  sources: s.sources.map(
2168
- (f) => f.id === w.id ? {
2169
- ...f,
2186
+ (v) => v.id === k.id ? {
2187
+ ...v,
2170
2188
  computed: [
2171
- ...(f.computed ?? []).filter(
2172
- (E) => E.name !== a.name && E.name !== l.name
2189
+ ...(v.computed ?? []).filter(
2190
+ (P) => P.name !== a.name && P.name !== l.name
2173
2191
  ),
2174
2192
  l
2175
2193
  ]
2176
- } : f
2194
+ } : v
2177
2195
  ),
2178
- source: w.id
2179
- }, m = l.name ? Me([l], t, "field", L) : [], x = l.kind === "related" && m.length === 0 ? l : null, y = x ? `${Va(u, w, x)}|${p?.length}` : null, R = xa(
2180
- y,
2181
- (f) => Wa(
2196
+ source: k.id
2197
+ }, g = l.name ? Me([l], t, "field", b) : [], T = l.kind === "related" && g.length === 0 ? l : null, _ = T ? `${Va(u, k, T)}|${p?.length}` : null, H = ga(
2198
+ _,
2199
+ (v) => Ka(
2182
2200
  c.run,
2183
2201
  u,
2184
- w,
2185
- x,
2186
- f,
2187
- p?.map((E) => E.$key)
2202
+ k,
2203
+ T,
2204
+ v,
2205
+ p?.map((P) => P.$key)
2188
2206
  )
2189
- ), M = A.useMemo(() => {
2207
+ ), M = E.useMemo(() => {
2190
2208
  if (!p || !l.name) return null;
2191
- let f = p;
2209
+ let v = p;
2192
2210
  if (l.kind === "matched") {
2193
- const D = Cs(l, s, k);
2194
- if (!D || !l.pairs.length || l.pairs.some((V) => !V.field || !V.other))
2211
+ const R = Ts(l, s, j);
2212
+ if (!R || !l.pairs.length || l.pairs.some((V) => !V.field || !V.other))
2195
2213
  return null;
2196
- const H = Ua(p, D, l, k);
2197
- f = p.map((V) => ({
2214
+ const B = Ua(p, R, l, j);
2215
+ v = p.map((V) => ({
2198
2216
  ...V,
2199
- [l.name]: Ga(l, H.get(V.$key))
2217
+ [l.name]: Ga(l, B.get(V.$key))
2200
2218
  }));
2201
2219
  }
2202
2220
  if (l.kind === "related") {
2203
- if (R.status !== "ready") return null;
2204
- const { values: D, fallback: H } = R.value;
2205
- f = p.map((V) => ({ ...V, [l.name]: D.get(V.$key) ?? H }));
2221
+ if (H.status !== "ready") return null;
2222
+ const { values: R, fallback: B } = H.value;
2223
+ v = p.map((V) => ({ ...V, [l.name]: R.get(V.$key) ?? B }));
2206
2224
  }
2207
- const E = (w.computed ?? []).filter(
2208
- (D) => D.name !== l.name && D.name !== a.name
2225
+ const P = (k.computed ?? []).filter(
2226
+ (R) => R.name !== l.name && R.name !== a.name
2209
2227
  );
2210
- return ue(f, { ...w, computed: [...E, l] }, k);
2211
- }, [p, l, a.name, w, k, R, s]), B = l.name && (!Ke.test(l.name) || i && o.includes(l.name)) ? r("workshopLab.computed.nameError") : null, [X, ie] = A.useState(""), [ce, se] = A.useState(!1), [pe, W] = A.useState(null), Z = A.useRef(null), oe = async () => {
2212
- const f = c.chatModel();
2213
- if (!f) return W(r("workshopLab.computed.noModel"));
2214
- const E = new AbortController();
2215
- Z.current = E, se(!0), W(r("workshopLab.computed.generating"));
2216
- const D = performance.now();
2228
+ return he(v, { ...k, computed: [...P, l] }, j);
2229
+ }, [p, l, a.name, k, j, H, s]), D = l.name && (!Xe.test(l.name) || i && o.includes(l.name)) ? r("workshopLab.computed.nameError") : null, [W, ie] = E.useState(""), [ce, se] = E.useState(!1), [pe, K] = E.useState(null), Z = E.useRef(null), oe = async () => {
2230
+ const v = c.chatModel();
2231
+ if (!v) return K(r("workshopLab.computed.noModel"));
2232
+ const P = new AbortController();
2233
+ Z.current = P, se(!0), K(r("workshopLab.computed.generating"));
2234
+ const R = performance.now();
2217
2235
  try {
2218
- const H = await Qa({
2219
- model: f,
2236
+ const B = await Ya({
2237
+ model: v,
2220
2238
  scope: {
2221
- sourceLabel: w.label,
2239
+ sourceLabel: k.label,
2222
2240
  fields: t,
2223
- samples: p ? Ya(p, t) : {},
2224
- context: L
2241
+ samples: p ? Qa(p, t) : {},
2242
+ context: b
2225
2243
  },
2226
- instruction: X,
2244
+ instruction: W,
2227
2245
  current: i && !l.label ? void 0 : l,
2228
2246
  taken: o,
2229
- signal: E.signal,
2230
- onStep: (V) => W(
2247
+ signal: P.signal,
2248
+ onStep: (V) => K(
2231
2249
  V.kind === "generating" ? r("workshopLab.computed.attempt", { attempt: V.attempt }) : r("workshopLab.computed.retry", { error: V.error })
2232
2250
  )
2233
2251
  });
2234
- H.ok ? (C({
2235
- ...H.field,
2236
- name: l.name || H.field.name,
2237
- label: l.label || H.field.label
2238
- }), W(
2252
+ B.ok ? (N({
2253
+ ...B.field,
2254
+ name: l.name || B.field.name,
2255
+ label: l.label || B.field.label
2256
+ }), K(
2239
2257
  r("workshopLab.computed.generated", {
2240
- seconds: ((performance.now() - D) / 1e3).toFixed(1),
2241
- explanation: H.explanation
2258
+ seconds: ((performance.now() - R) / 1e3).toFixed(1),
2259
+ explanation: B.explanation
2242
2260
  })
2243
- )) : W(
2244
- r("workshopLab.computed.gaveUp", { attempts: H.attempts, error: H.error })
2261
+ )) : K(
2262
+ r("workshopLab.computed.gaveUp", { attempts: B.attempts, error: B.error })
2245
2263
  );
2246
- } catch (H) {
2247
- W(E.signal.aborted ? null : Re(H));
2264
+ } catch (B) {
2265
+ K(P.signal.aborted ? null : Re(B));
2248
2266
  } finally {
2249
2267
  se(!1);
2250
2268
  }
2251
- }, z = (f) => {
2252
- const E = { name: l.name, label: l.label };
2253
- f === "classify" && C({ ...E, kind: f, cases: [], otherwise: { value: "" } }), f === "days" && C({ ...E, kind: f, from: S[0]?.name ?? Q, to: Q }), f === "formula" && C({ ...E, kind: f, expr: "" }), f === "related" && C({ ...E, kind: f, path: [], aggregate: "count" }), f === "region" && C({ ...E, kind: f, from: N[0]?.name ?? "" }), f === "text" && C({ ...E, kind: f, template: "" }), f === "matched" && C({ ...E, kind: f, source: "", pairs: [] });
2269
+ }, z = (v) => {
2270
+ const P = { name: l.name, label: l.label };
2271
+ v === "classify" && N({ ...P, kind: v, cases: [], otherwise: { value: "" } }), v === "days" && N({ ...P, kind: v, from: S[0]?.name ?? Y, to: Y }), v === "formula" && N({ ...P, kind: v, expr: "" }), v === "related" && N({ ...P, kind: v, path: [], aggregate: "count" }), v === "region" && N({ ...P, kind: v, from: y[0]?.name ?? "" }), v === "text" && N({ ...P, kind: v, template: "" }), v === "matched" && N({ ...P, kind: v, source: "", pairs: [] });
2254
2272
  };
2255
2273
  return /* @__PURE__ */ e.jsx(
2256
2274
  ae,
@@ -2259,8 +2277,8 @@ function Qe({
2259
2277
  width: 800,
2260
2278
  title: r(i ? "workshopLab.computed.newTitle" : "workshopLab.computed.editTitle"),
2261
2279
  okText: r("workshopLab.computed.save"),
2262
- okButtonProps: { disabled: !l.name || !l.label || !!B },
2263
- onOk: () => h(l),
2280
+ okButtonProps: { disabled: !l.name || !l.label || !!D },
2281
+ onOk: () => m(l),
2264
2282
  onCancel: () => {
2265
2283
  Z.current?.abort(), d();
2266
2284
  },
@@ -2271,9 +2289,9 @@ function Qe({
2271
2289
  {
2272
2290
  variant: "borderless",
2273
2291
  placeholder: r("workshopLab.computed.askPlaceholder"),
2274
- value: X,
2275
- onChange: (f) => ie(f.target.value),
2276
- onPressEnter: (f) => !f.nativeEvent.isComposing && X.trim() && !ce && void oe()
2292
+ value: W,
2293
+ onChange: (v) => ie(v.target.value),
2294
+ onPressEnter: (v) => !v.nativeEvent.isComposing && W.trim() && !ce && void oe()
2277
2295
  }
2278
2296
  ),
2279
2297
  ce ? /* @__PURE__ */ e.jsx($, { size: "small", onClick: () => Z.current?.abort(), children: r("workshopLab.computed.stop") }) : /* @__PURE__ */ e.jsx(
@@ -2281,7 +2299,7 @@ function Qe({
2281
2299
  {
2282
2300
  size: "small",
2283
2301
  type: "primary",
2284
- disabled: !X.trim(),
2302
+ disabled: !W.trim(),
2285
2303
  onClick: () => {
2286
2304
  oe();
2287
2305
  },
@@ -2292,14 +2310,14 @@ function Qe({
2292
2310
  )
2293
2311
  ] }),
2294
2312
  pe && /* @__PURE__ */ e.jsx("span", { className: n.muted, children: pe }),
2295
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, align: "end", children: [
2313
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, align: "end", children: [
2296
2314
  /* @__PURE__ */ e.jsxs("label", { className: n.field, children: [
2297
2315
  /* @__PURE__ */ e.jsx("span", { className: n.fieldLabel, children: r("workshopLab.computed.label") }),
2298
2316
  /* @__PURE__ */ e.jsx(
2299
2317
  I,
2300
2318
  {
2301
2319
  value: l.label,
2302
- onChange: (f) => C({ ...l, label: f.target.value })
2320
+ onChange: (v) => N({ ...l, label: v.target.value })
2303
2321
  }
2304
2322
  )
2305
2323
  ] }),
@@ -2308,172 +2326,172 @@ function Qe({
2308
2326
  {
2309
2327
  size: "small",
2310
2328
  type: "link",
2311
- "aria-expanded": T,
2312
- onClick: () => v(!T),
2313
- children: r(T ? "workshopLab.computed.hideAdvanced" : "workshopLab.computed.advanced")
2329
+ "aria-expanded": C,
2330
+ onClick: () => L(!C),
2331
+ children: r(C ? "workshopLab.computed.hideAdvanced" : "workshopLab.computed.advanced")
2314
2332
  }
2315
2333
  )
2316
2334
  ] }),
2317
- T && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2335
+ C && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2318
2336
  /* @__PURE__ */ e.jsxs("label", { className: n.field, children: [
2319
2337
  /* @__PURE__ */ e.jsx("span", { className: n.fieldLabel, children: r("workshopLab.computed.name") }),
2320
2338
  /* @__PURE__ */ e.jsx(
2321
2339
  I,
2322
2340
  {
2323
2341
  disabled: !i,
2324
- status: B ? "error" : void 0,
2342
+ status: D ? "error" : void 0,
2325
2343
  value: l.name,
2326
- onChange: (f) => {
2327
- b(!0), j({ ...l, name: f.target.value.trim() });
2344
+ onChange: (v) => {
2345
+ h(!0), w({ ...l, name: v.target.value.trim() });
2328
2346
  }
2329
2347
  }
2330
2348
  )
2331
2349
  ] }),
2332
2350
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: r(i ? "workshopLab.computed.nameHint" : "workshopLab.computed.nameKept") })
2333
2351
  ] }),
2334
- B && /* @__PURE__ */ e.jsx("span", { className: n.error, children: B }),
2352
+ D && /* @__PURE__ */ e.jsx("span", { className: n.error, children: D }),
2335
2353
  /* @__PURE__ */ e.jsx(
2336
- he.Group,
2354
+ ue.Group,
2337
2355
  {
2338
2356
  optionType: "button",
2339
2357
  size: "small",
2340
2358
  value: l.kind,
2341
- onChange: (f) => z(f.target.value),
2342
- options: ra.map((f) => ({
2343
- value: f,
2344
- label: r(`workshopLab.computed.kinds.${f}`)
2359
+ onChange: (v) => z(v.target.value),
2360
+ options: ra.map((v) => ({
2361
+ value: v,
2362
+ label: r(`workshopLab.computed.kinds.${v}`)
2345
2363
  }))
2346
2364
  }
2347
2365
  ),
2348
2366
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: r(`workshopLab.computed.kindHints.${l.kind}`) }),
2349
2367
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: r(`workshopLab.computed.kindExamples.${l.kind}`) }),
2350
- l.kind === "classify" && /* @__PURE__ */ e.jsx(Fs, { field: l, fields: t, source: w, onChange: C }),
2368
+ l.kind === "classify" && /* @__PURE__ */ e.jsx(Ps, { field: l, fields: t, source: k, onChange: N }),
2351
2369
  l.kind === "days" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2352
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
2370
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
2353
2371
  /* @__PURE__ */ e.jsx("span", { children: r("workshopLab.computed.from") }),
2354
2372
  /* @__PURE__ */ e.jsx(
2355
- F,
2373
+ O,
2356
2374
  {
2357
2375
  size: "small",
2358
2376
  className: n.fieldSelect,
2359
2377
  value: l.from,
2360
- options: O,
2361
- onChange: (f) => C({ ...l, from: f })
2378
+ options: x,
2379
+ onChange: (v) => N({ ...l, from: v })
2362
2380
  }
2363
2381
  ),
2364
2382
  /* @__PURE__ */ e.jsx("span", { children: r("workshopLab.computed.to") }),
2365
2383
  /* @__PURE__ */ e.jsx(
2366
- F,
2384
+ O,
2367
2385
  {
2368
2386
  size: "small",
2369
2387
  className: n.fieldSelect,
2370
2388
  value: l.to,
2371
- options: O,
2372
- onChange: (f) => C({ ...l, to: f })
2389
+ options: x,
2390
+ onChange: (v) => N({ ...l, to: v })
2373
2391
  }
2374
2392
  )
2375
2393
  ] }),
2376
2394
  /* @__PURE__ */ e.jsx("span", { className: n.fieldLabel, children: r("workshopLab.computed.onlyWhen") }),
2377
2395
  /* @__PURE__ */ e.jsx(
2378
- K,
2396
+ X,
2379
2397
  {
2380
2398
  value: l.when,
2381
2399
  fields: t,
2382
- source: w,
2383
- onChange: (f) => C({ ...l, when: f.length > 0 ? f : void 0 })
2400
+ source: k,
2401
+ onChange: (v) => N({ ...l, when: v.length > 0 ? v : void 0 })
2384
2402
  }
2385
2403
  )
2386
2404
  ] }),
2387
- l.kind === "formula" && /* @__PURE__ */ e.jsx($s, { field: l, fields: t, onChange: C }),
2388
- l.kind === "text" && /* @__PURE__ */ e.jsx(zs, { field: l, fields: t, onChange: C }),
2405
+ l.kind === "formula" && /* @__PURE__ */ e.jsx(Os, { field: l, fields: t, onChange: N }),
2406
+ l.kind === "text" && /* @__PURE__ */ e.jsx($s, { field: l, fields: t, onChange: N }),
2389
2407
  l.kind === "matched" && /* @__PURE__ */ e.jsx(
2390
- Ts,
2408
+ zs,
2391
2409
  {
2392
2410
  field: l,
2393
2411
  fields: t,
2394
- source: w,
2412
+ source: k,
2395
2413
  others: s,
2396
2414
  kn: u,
2397
- onChange: C
2415
+ onChange: N
2398
2416
  }
2399
2417
  ),
2400
- l.kind === "related" && /* @__PURE__ */ e.jsx(Os, { field: l, source: w, kn: u, onChange: C }),
2401
- l.kind === "region" && /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
2418
+ l.kind === "related" && /* @__PURE__ */ e.jsx(Fs, { field: l, source: k, kn: u, onChange: N }),
2419
+ l.kind === "region" && /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
2402
2420
  /* @__PURE__ */ e.jsx("span", { children: r("workshopLab.computed.regionFrom") }),
2403
2421
  /* @__PURE__ */ e.jsx(
2404
- F,
2422
+ O,
2405
2423
  {
2406
2424
  size: "small",
2407
2425
  className: n.fieldSelect,
2408
2426
  value: l.from || void 0,
2409
- options: N.map((f) => ({ value: f.name, label: f.label })),
2410
- onChange: (f) => C({ ...l, from: f })
2427
+ options: y.map((v) => ({ value: v.name, label: v.label })),
2428
+ onChange: (v) => N({ ...l, from: v })
2411
2429
  }
2412
2430
  ),
2413
2431
  /* @__PURE__ */ e.jsx("span", { children: r("workshopLab.computed.regionScope") }),
2414
2432
  /* @__PURE__ */ e.jsx(
2415
- F,
2433
+ O,
2416
2434
  {
2417
2435
  size: "small",
2418
2436
  value: l.scope ?? "china",
2419
- options: ia.map((f) => ({
2420
- value: f,
2421
- label: r(`workshopLab.basemaps.${f}`)
2437
+ options: ia.map((v) => ({
2438
+ value: v,
2439
+ label: r(`workshopLab.basemaps.${v}`)
2422
2440
  })),
2423
- onChange: (f) => C(
2424
- f === "china" ? { name: l.name, label: l.label, kind: "region", from: l.from } : { ...l, scope: f }
2441
+ onChange: (v) => N(
2442
+ v === "china" ? { name: l.name, label: l.label, kind: "region", from: l.from } : { ...l, scope: v }
2425
2443
  )
2426
2444
  }
2427
2445
  )
2428
2446
  ] }),
2429
- m.length > 0 && /* @__PURE__ */ e.jsx("ul", { className: n.computedProblems, children: m.slice(0, 4).map((f) => /* @__PURE__ */ e.jsx("li", { children: f.replace(/^field\[0\]\.?/, "") }, f)) }),
2447
+ g.length > 0 && /* @__PURE__ */ e.jsx("ul", { className: n.computedProblems, children: g.slice(0, 4).map((v) => /* @__PURE__ */ e.jsx("li", { children: v.replace(/^field\[0\]\.?/, "") }, v)) }),
2430
2448
  /* @__PURE__ */ e.jsxs("div", { className: n.computedPreviewBox, children: [
2431
- /* @__PURE__ */ e.jsx("span", { className: n.fieldLabel, children: r("workshopLab.computed.previewTitle", { date: k }) }),
2432
- l.name ? l.kind === "matched" && m.length > 0 ? /* @__PURE__ */ e.jsx("span", { className: n.muted, children: r("workshopLab.computed.fixFirst") }) : l.kind === "matched" && !M ? /* @__PURE__ */ e.jsx("span", { className: n.muted, children: r("workshopLab.computed.matchedNotLoaded") }) : l.kind === "related" && R.status === "error" ? /* @__PURE__ */ e.jsx("span", { className: n.error, children: r("workshopLab.computed.relatedFailed") }) : l.kind === "related" && m.length > 0 ? /* @__PURE__ */ e.jsx("span", { className: n.muted, children: r("workshopLab.computed.fixFirst") }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2449
+ /* @__PURE__ */ e.jsx("span", { className: n.fieldLabel, children: r("workshopLab.computed.previewTitle", { date: j }) }),
2450
+ l.name ? l.kind === "matched" && g.length > 0 ? /* @__PURE__ */ e.jsx("span", { className: n.muted, children: r("workshopLab.computed.fixFirst") }) : l.kind === "matched" && !M ? /* @__PURE__ */ e.jsx("span", { className: n.muted, children: r("workshopLab.computed.matchedNotLoaded") }) : l.kind === "related" && H.status === "error" ? /* @__PURE__ */ e.jsx("span", { className: n.error, children: r("workshopLab.computed.relatedFailed") }) : l.kind === "related" && g.length > 0 ? /* @__PURE__ */ e.jsx("span", { className: n.muted, children: r("workshopLab.computed.fixFirst") }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2433
2451
  /* @__PURE__ */ e.jsx(qe, { field: l, rows: M }),
2434
- /* @__PURE__ */ e.jsx(ys, { field: l, rows: M, fields: t })
2452
+ /* @__PURE__ */ e.jsx(Ns, { field: l, rows: M, fields: t })
2435
2453
  ] }) : /* @__PURE__ */ e.jsx("span", { className: n.muted, children: r("workshopLab.computed.needName") })
2436
2454
  ] })
2437
2455
  ] })
2438
2456
  }
2439
2457
  );
2440
2458
  }
2441
- function Ns(a, i) {
2459
+ function Ss(a, i) {
2442
2460
  return a.sources.filter(
2443
2461
  (t) => t.id !== i.id && !t.from && !t.cypher && !t.events && !t.model
2444
2462
  );
2445
2463
  }
2446
- function Ss(a, i) {
2464
+ function Cs(a, i) {
2447
2465
  return a ? [
2448
2466
  ...i.objectTypes[a.objectType]?.properties ?? [],
2449
2467
  ...(a.computed ?? []).map(te)
2450
2468
  ] : [];
2451
2469
  }
2452
- function Cs(a, i, t) {
2453
- const w = i.sources.find((k) => k.id === a.source), p = i.states[a.source];
2454
- return !w || p?.status !== "ready" || p.truncated ? null : ue(p.rows, w, t);
2470
+ function Ts(a, i, t) {
2471
+ const k = i.sources.find((j) => j.id === a.source), p = i.states[a.source];
2472
+ return !k || p?.status !== "ready" || p.truncated ? null : he(p.rows, k, t);
2455
2473
  }
2456
- function Ts({
2474
+ function zs({
2457
2475
  field: a,
2458
2476
  fields: i,
2459
2477
  source: t,
2460
- others: w,
2478
+ others: k,
2461
2479
  kn: p,
2462
- onChange: k
2480
+ onChange: j
2463
2481
  }) {
2464
- const { t: c } = _(), s = Ns(w, t), o = s.find((l) => l.id === a.source), d = Ss(o, p), h = i.filter((l) => l.type !== "date" || l.name !== Q), r = (l, j) => {
2465
- const g = [...a.pairs];
2466
- j === null ? g.splice(l, 1) : g[l] = j, k({ ...a, pairs: g });
2482
+ const { t: c } = A(), s = Ss(k, t), o = s.find((l) => l.id === a.source), d = Cs(o, p), m = i.filter((l) => l.type !== "date" || l.name !== Y), r = (l, w) => {
2483
+ const f = [...a.pairs];
2484
+ w === null ? f.splice(l, 1) : f[l] = w, j({ ...a, pairs: f });
2467
2485
  }, u = (l) => {
2468
- const j = { ...a };
2469
- delete j.field, delete j.type;
2470
- const g = d.find((b) => b.name === l)?.type;
2471
- k(l ? { ...j, field: l, ...g ? { type: g } : {} } : j);
2486
+ const w = { ...a };
2487
+ delete w.field, delete w.type;
2488
+ const f = d.find((h) => h.name === l)?.type;
2489
+ j(l ? { ...w, field: l, ...f ? { type: f } : {} } : w);
2472
2490
  };
2473
2491
  return /* @__PURE__ */ e.jsxs("div", { className: n.matchedForm, children: [
2474
2492
  /* @__PURE__ */ e.jsx("span", { className: n.fieldLabel, children: c("workshopLab.computed.matchedFrom") }),
2475
2493
  /* @__PURE__ */ e.jsx(
2476
- F,
2494
+ O,
2477
2495
  {
2478
2496
  size: "small",
2479
2497
  className: n.fieldSelect,
@@ -2483,7 +2501,7 @@ function Ts({
2483
2501
  options: s.map((l) => ({ value: l.id, label: l.label })),
2484
2502
  onChange: (l) => (
2485
2503
  // Another source has other fields: the pairs, conditions and value start again.
2486
- k({
2504
+ j({
2487
2505
  name: a.name,
2488
2506
  label: a.label,
2489
2507
  kind: "matched",
@@ -2496,45 +2514,45 @@ function Ts({
2496
2514
  o && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2497
2515
  /* @__PURE__ */ e.jsx("span", { className: n.fieldLabel, children: c("workshopLab.computed.matchedPairs") }),
2498
2516
  /* @__PURE__ */ e.jsxs("div", { className: n.matchedPairs, children: [
2499
- a.pairs.map((l, j) => /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
2517
+ a.pairs.map((l, w) => /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
2500
2518
  /* @__PURE__ */ e.jsx(
2501
- F,
2519
+ O,
2502
2520
  {
2503
2521
  size: "small",
2504
2522
  showSearch: !0,
2505
2523
  optionFilterProp: "label",
2506
2524
  className: n.fieldSelect,
2507
- "aria-label": c("workshopLab.computed.matchedOwn", { n: j + 1 }),
2525
+ "aria-label": c("workshopLab.computed.matchedOwn", { n: w + 1 }),
2508
2526
  placeholder: c("workshopLab.computed.matchedOwnField", { source: t.label }),
2509
2527
  value: l.field || void 0,
2510
- options: h.map((g) => ({ value: g.name, label: g.label })),
2511
- onChange: (g) => r(j, { ...l, field: g })
2528
+ options: m.map((f) => ({ value: f.name, label: f.label })),
2529
+ onChange: (f) => r(w, { ...l, field: f })
2512
2530
  }
2513
2531
  ),
2514
2532
  /* @__PURE__ */ e.jsx("span", { children: "=" }),
2515
2533
  /* @__PURE__ */ e.jsx(
2516
- F,
2534
+ O,
2517
2535
  {
2518
2536
  size: "small",
2519
2537
  showSearch: !0,
2520
2538
  optionFilterProp: "label",
2521
2539
  className: n.fieldSelect,
2522
- "aria-label": c("workshopLab.computed.matchedOther", { n: j + 1 }),
2540
+ "aria-label": c("workshopLab.computed.matchedOther", { n: w + 1 }),
2523
2541
  placeholder: c("workshopLab.computed.matchedOwnField", { source: o.label }),
2524
2542
  value: l.other || void 0,
2525
- options: d.map((g) => ({ value: g.name, label: g.label })),
2526
- onChange: (g) => r(j, { ...l, other: g })
2543
+ options: d.map((f) => ({ value: f.name, label: f.label })),
2544
+ onChange: (f) => r(w, { ...l, other: f })
2527
2545
  }
2528
2546
  ),
2529
- a.pairs.length > 1 && /* @__PURE__ */ e.jsx($, { size: "small", type: "link", danger: !0, onClick: () => r(j, null), children: c("workshopLab.computed.removeCondition") })
2530
- ] }, j)),
2531
- a.pairs.length < ds && /* @__PURE__ */ e.jsx(
2547
+ a.pairs.length > 1 && /* @__PURE__ */ e.jsx($, { size: "small", type: "link", danger: !0, onClick: () => r(w, null), children: c("workshopLab.computed.removeCondition") })
2548
+ ] }, w)),
2549
+ a.pairs.length < ms && /* @__PURE__ */ e.jsx(
2532
2550
  $,
2533
2551
  {
2534
2552
  size: "small",
2535
2553
  type: "dashed",
2536
2554
  icon: /* @__PURE__ */ e.jsx(ne, {}),
2537
- onClick: () => k({ ...a, pairs: [...a.pairs, { field: "", other: "" }] }),
2555
+ onClick: () => j({ ...a, pairs: [...a.pairs, { field: "", other: "" }] }),
2538
2556
  children: c("workshopLab.computed.matchedAddPair")
2539
2557
  }
2540
2558
  )
@@ -2542,18 +2560,18 @@ function Ts({
2542
2560
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: c("workshopLab.computed.matchedPairsHint") }),
2543
2561
  /* @__PURE__ */ e.jsx("span", { className: n.fieldLabel, children: c("workshopLab.computed.matchedOnly", { source: o.label }) }),
2544
2562
  /* @__PURE__ */ e.jsx(
2545
- K,
2563
+ X,
2546
2564
  {
2547
2565
  value: a.where,
2548
2566
  fields: d,
2549
2567
  source: o,
2550
- onChange: (l) => k({ ...a, where: l.length > 0 ? l : void 0 })
2568
+ onChange: (l) => j({ ...a, where: l.length > 0 ? l : void 0 })
2551
2569
  }
2552
2570
  ),
2553
2571
  /* @__PURE__ */ e.jsx("span", { className: n.fieldLabel, children: c("workshopLab.computed.matchedTake") }),
2554
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
2572
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
2555
2573
  /* @__PURE__ */ e.jsx(
2556
- he.Group,
2574
+ ue.Group,
2557
2575
  {
2558
2576
  size: "small",
2559
2577
  optionType: "button",
@@ -2566,7 +2584,7 @@ function Ts({
2566
2584
  }
2567
2585
  ),
2568
2586
  a.field !== void 0 && /* @__PURE__ */ e.jsx(
2569
- F,
2587
+ O,
2570
2588
  {
2571
2589
  size: "small",
2572
2590
  showSearch: !0,
@@ -2583,12 +2601,12 @@ function Ts({
2583
2601
  ] })
2584
2602
  ] });
2585
2603
  }
2586
- function zs({
2604
+ function $s({
2587
2605
  field: a,
2588
2606
  fields: i,
2589
2607
  onChange: t
2590
2608
  }) {
2591
- const { t: w } = _();
2609
+ const { t: k } = A();
2592
2610
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2593
2611
  /* @__PURE__ */ e.jsx(
2594
2612
  I,
@@ -2600,17 +2618,17 @@ function zs({
2600
2618
  onChange: (p) => t({ ...a, template: p.target.value })
2601
2619
  }
2602
2620
  ),
2603
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
2604
- /* @__PURE__ */ e.jsx("span", { className: n.fieldLabel, children: w("workshopLab.computed.insertField") }),
2621
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
2622
+ /* @__PURE__ */ e.jsx("span", { className: n.fieldLabel, children: k("workshopLab.computed.insertField") }),
2605
2623
  /* @__PURE__ */ e.jsx(
2606
- F,
2624
+ O,
2607
2625
  {
2608
2626
  size: "small",
2609
2627
  showSearch: !0,
2610
2628
  optionFilterProp: "label",
2611
2629
  className: n.fieldSelect,
2612
2630
  value: null,
2613
- placeholder: w("workshopLab.computed.anyFields"),
2631
+ placeholder: k("workshopLab.computed.anyFields"),
2614
2632
  options: i.map((p) => ({ value: p.name, label: p.label })),
2615
2633
  onChange: (p) => t({
2616
2634
  ...a,
@@ -2621,12 +2639,12 @@ function zs({
2621
2639
  ] })
2622
2640
  ] });
2623
2641
  }
2624
- function $s({
2642
+ function Os({
2625
2643
  field: a,
2626
2644
  fields: i,
2627
2645
  onChange: t
2628
2646
  }) {
2629
- const { t: w } = _(), p = i.filter((s) => s.type === "number"), k = a.expr.trim() ? ca(a.expr) : null, c = k?.ok === !0 ? pa(k.node).filter((s) => !p.some((o) => o.name === s)) : [];
2647
+ const { t: k } = A(), p = i.filter((s) => s.type === "number"), j = a.expr.trim() ? ca(a.expr) : null, c = j?.ok === !0 ? pa(j.node).filter((s) => !p.some((o) => o.name === s)) : [];
2630
2648
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2631
2649
  /* @__PURE__ */ e.jsx(
2632
2650
  I.TextArea,
@@ -2639,54 +2657,54 @@ function $s({
2639
2657
  onChange: (s) => t({ ...a, expr: s.target.value })
2640
2658
  }
2641
2659
  ),
2642
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
2643
- /* @__PURE__ */ e.jsx("span", { className: n.fieldLabel, children: w("workshopLab.computed.insertField") }),
2660
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
2661
+ /* @__PURE__ */ e.jsx("span", { className: n.fieldLabel, children: k("workshopLab.computed.insertField") }),
2644
2662
  /* @__PURE__ */ e.jsx(
2645
- F,
2663
+ O,
2646
2664
  {
2647
2665
  size: "small",
2648
2666
  showSearch: !0,
2649
2667
  optionFilterProp: "label",
2650
2668
  className: n.fieldSelect,
2651
2669
  value: null,
2652
- placeholder: w("workshopLab.computed.numberFields"),
2670
+ placeholder: k("workshopLab.computed.numberFields"),
2653
2671
  options: p.map((s) => ({ value: s.name, label: s.label })),
2654
2672
  onChange: (s) => t({ ...a, expr: `${a.expr}${a.expr.trim() ? " " : ""}${s}` })
2655
2673
  }
2656
2674
  )
2657
2675
  ] }),
2658
- k && !k.ok && /* @__PURE__ */ e.jsx("span", { className: n.error, children: k.error }),
2659
- c.length > 0 && /* @__PURE__ */ e.jsx("span", { className: n.error, children: w("workshopLab.computed.formulaUnknown", { names: c.join("、") }) })
2676
+ j && !j.ok && /* @__PURE__ */ e.jsx("span", { className: n.error, children: j.error }),
2677
+ c.length > 0 && /* @__PURE__ */ e.jsx("span", { className: n.error, children: k("workshopLab.computed.formulaUnknown", { names: c.join("、") }) })
2660
2678
  ] });
2661
2679
  }
2662
- function Os({
2680
+ function Fs({
2663
2681
  field: a,
2664
2682
  source: i,
2665
2683
  kn: t,
2666
- onChange: w
2684
+ onChange: k
2667
2685
  }) {
2668
- const { t: p } = _(), k = me(t, i.objectType, a.path), c = k && k.length > 0 ? k[k.length - 1].to : i.objectType, s = t.objectTypes[c], o = s?.properties ?? [], d = t.relations.filter(
2686
+ const { t: p } = A(), j = me(t, i.objectType, a.path), c = j && j.length > 0 ? j[j.length - 1].to : i.objectType, s = t.objectTypes[c], o = s?.properties ?? [], d = t.relations.filter(
2669
2687
  (r) => r.source === c || r.target === c
2670
- ), h = (r) => t.objectTypes[r]?.name ?? r;
2688
+ ), m = (r) => t.objectTypes[r]?.name ?? r;
2671
2689
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2672
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
2690
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
2673
2691
  /* @__PURE__ */ e.jsx("span", { children: p("workshopLab.computed.relatedPath") }),
2674
- /* @__PURE__ */ e.jsx("span", { className: n.mono, children: h(i.objectType) }),
2675
- (k ?? []).map((r, u) => /* @__PURE__ */ e.jsxs(
2692
+ /* @__PURE__ */ e.jsx("span", { className: n.mono, children: m(i.objectType) }),
2693
+ (j ?? []).map((r, u) => /* @__PURE__ */ e.jsxs(
2676
2694
  J,
2677
2695
  {
2678
- closable: u === (k?.length ?? 0) - 1,
2679
- onClose: () => w({ ...a, path: a.path.slice(0, -1), where: void 0 }),
2696
+ closable: u === (j?.length ?? 0) - 1,
2697
+ onClose: () => k({ ...a, path: a.path.slice(0, -1), where: void 0 }),
2680
2698
  children: [
2681
2699
  r.relation.name,
2682
2700
  " → ",
2683
- h(r.to)
2701
+ m(r.to)
2684
2702
  ]
2685
2703
  },
2686
2704
  u
2687
2705
  )),
2688
2706
  /* @__PURE__ */ e.jsx(
2689
- F,
2707
+ O,
2690
2708
  {
2691
2709
  size: "small",
2692
2710
  showSearch: !0,
@@ -2696,24 +2714,24 @@ function Os({
2696
2714
  placeholder: p("workshopLab.computed.relatedNext"),
2697
2715
  options: d.map((r) => ({
2698
2716
  value: r.id,
2699
- label: `${r.name}(→ ${h(r.source === c ? r.target : r.source)})`
2717
+ label: `${r.name}(→ ${m(r.source === c ? r.target : r.source)})`
2700
2718
  })),
2701
- onChange: (r) => w({ ...a, path: [...a.path, r], field: void 0, where: void 0 })
2719
+ onChange: (r) => k({ ...a, path: [...a.path, r], field: void 0, where: void 0 })
2702
2720
  }
2703
2721
  )
2704
2722
  ] }),
2705
2723
  a.path.length > 0 && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2706
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
2724
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
2707
2725
  /* @__PURE__ */ e.jsx("span", { children: p("workshopLab.computed.relatedHow") }),
2708
2726
  /* @__PURE__ */ e.jsx(
2709
- he.Group,
2727
+ ue.Group,
2710
2728
  {
2711
2729
  size: "small",
2712
2730
  optionType: "button",
2713
2731
  value: a.aggregate,
2714
2732
  onChange: (r) => {
2715
- const u = r.target.value, l = o.find((g) => g.name === a.field)?.type, j = { ...a, aggregate: u };
2716
- delete j.type, w({ ...j, ...u === "one" && l ? { type: l } : {} });
2733
+ const u = r.target.value, l = o.find((f) => f.name === a.field)?.type, w = { ...a, aggregate: u };
2734
+ delete w.type, k({ ...w, ...u === "one" && l ? { type: l } : {} });
2717
2735
  },
2718
2736
  options: da.map((r) => ({
2719
2737
  value: r,
@@ -2722,7 +2740,7 @@ function Os({
2722
2740
  }
2723
2741
  ),
2724
2742
  a.aggregate !== "count" && /* @__PURE__ */ e.jsx(
2725
- F,
2743
+ O,
2726
2744
  {
2727
2745
  size: "small",
2728
2746
  className: n.fieldSelect,
@@ -2735,7 +2753,7 @@ function Os({
2735
2753
  ).map((r) => ({ value: r.name, label: r.label })),
2736
2754
  onChange: (r) => {
2737
2755
  const u = o.find((l) => l.name === r)?.type;
2738
- w({
2756
+ k({
2739
2757
  ...a,
2740
2758
  field: r,
2741
2759
  ...a.aggregate === "one" && u ? { type: u } : {}
@@ -2746,27 +2764,27 @@ function Os({
2746
2764
  ] }),
2747
2765
  /* @__PURE__ */ e.jsx("span", { className: n.fieldLabel, children: p("workshopLab.computed.relatedOnly", { target: s?.name ?? "" }) }),
2748
2766
  /* @__PURE__ */ e.jsx(
2749
- K,
2767
+ X,
2750
2768
  {
2751
2769
  literalOnly: !0,
2752
2770
  value: a.where,
2753
2771
  fields: o,
2754
- onChange: (r) => w({ ...a, where: r.length > 0 ? r : void 0 })
2772
+ onChange: (r) => k({ ...a, where: r.length > 0 ? r : void 0 })
2755
2773
  }
2756
2774
  ),
2757
2775
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: p("workshopLab.computed.relatedNote") })
2758
2776
  ] })
2759
2777
  ] });
2760
2778
  }
2761
- function Fs({
2779
+ function Ps({
2762
2780
  field: a,
2763
2781
  fields: i,
2764
2782
  source: t,
2765
- onChange: w
2783
+ onChange: k
2766
2784
  }) {
2767
- const { t: p } = _(), k = (c, s) => {
2785
+ const { t: p } = A(), j = (c, s) => {
2768
2786
  const o = [...a.cases];
2769
- s === null ? o.splice(c, 1) : o[c] = s, w({ ...a, cases: o });
2787
+ s === null ? o.splice(c, 1) : o[c] = s, k({ ...a, cases: o });
2770
2788
  };
2771
2789
  return /* @__PURE__ */ e.jsxs("div", { className: n.computedCases, children: [
2772
2790
  a.cases.map((c, s) => /* @__PURE__ */ e.jsxs("div", { className: n.computedCase, children: [
@@ -2776,20 +2794,20 @@ function Fs({
2776
2794
  Ee,
2777
2795
  {
2778
2796
  outcome: c,
2779
- onChange: (o) => k(s, { ...c, ...o })
2797
+ onChange: (o) => j(s, { ...c, ...o })
2780
2798
  }
2781
2799
  ),
2782
2800
  /* @__PURE__ */ e.jsx("span", { className: n.spacer }),
2783
- /* @__PURE__ */ e.jsx($, { size: "small", type: "link", danger: !0, onClick: () => k(s, null), children: p("workshopLab.computed.removeCase") })
2801
+ /* @__PURE__ */ e.jsx($, { size: "small", type: "link", danger: !0, onClick: () => j(s, null), children: p("workshopLab.computed.removeCase") })
2784
2802
  ] }),
2785
2803
  /* @__PURE__ */ e.jsx("span", { className: n.fieldLabel, children: p("workshopLab.computed.when") }),
2786
2804
  /* @__PURE__ */ e.jsx(
2787
- K,
2805
+ X,
2788
2806
  {
2789
2807
  value: c.when,
2790
2808
  fields: i,
2791
2809
  source: t,
2792
- onChange: (o) => k(s, { ...c, when: o })
2810
+ onChange: (o) => j(s, { ...c, when: o })
2793
2811
  }
2794
2812
  )
2795
2813
  ] }, s)),
@@ -2798,7 +2816,7 @@ function Fs({
2798
2816
  {
2799
2817
  size: "small",
2800
2818
  type: "dashed",
2801
- onClick: () => w({ ...a, cases: [...a.cases, { value: "", when: [] }] }),
2819
+ onClick: () => k({ ...a, cases: [...a.cases, { value: "", when: [] }] }),
2802
2820
  children: p("workshopLab.computed.addCase")
2803
2821
  }
2804
2822
  ),
@@ -2808,7 +2826,7 @@ function Fs({
2808
2826
  Ee,
2809
2827
  {
2810
2828
  outcome: a.otherwise,
2811
- onChange: (c) => w({ ...a, otherwise: c })
2829
+ onChange: (c) => k({ ...a, otherwise: c })
2812
2830
  }
2813
2831
  )
2814
2832
  ] })
@@ -2818,45 +2836,45 @@ function Ee({
2818
2836
  outcome: a,
2819
2837
  onChange: i
2820
2838
  }) {
2821
- const { t } = _();
2822
- return /* @__PURE__ */ e.jsxs(P.Compact, { children: [
2839
+ const { t } = A();
2840
+ return /* @__PURE__ */ e.jsxs(F.Compact, { children: [
2823
2841
  /* @__PURE__ */ e.jsx(
2824
2842
  I,
2825
2843
  {
2826
2844
  size: "small",
2827
2845
  placeholder: t("workshopLab.computed.valuePlaceholder"),
2828
2846
  value: a.value,
2829
- onChange: (w) => i({ ...a, value: w.target.value })
2847
+ onChange: (k) => i({ ...a, value: k.target.value })
2830
2848
  }
2831
2849
  ),
2832
2850
  /* @__PURE__ */ e.jsx(
2833
- F,
2851
+ O,
2834
2852
  {
2835
2853
  size: "small",
2836
2854
  className: n.toneSelect,
2837
2855
  value: a.tone ?? "neutral",
2838
- options: Ae.map((w) => ({
2839
- value: w,
2840
- label: t(`workshopLab.computed.tones.${w}`)
2856
+ options: Ae.map((k) => ({
2857
+ value: k,
2858
+ label: t(`workshopLab.computed.tones.${k}`)
2841
2859
  })),
2842
- onChange: (w) => i({ ...a, tone: w })
2860
+ onChange: (k) => i({ ...a, tone: k })
2843
2861
  }
2844
2862
  )
2845
2863
  ] });
2846
2864
  }
2847
- function Ps({
2865
+ function Es({
2848
2866
  source: a,
2849
2867
  properties: i,
2850
2868
  rows: t,
2851
- usage: w,
2869
+ usage: k,
2852
2870
  onEdit: p,
2853
- onRemove: k
2871
+ onRemove: j
2854
2872
  }) {
2855
- const { t: c } = _(), s = a.progress;
2873
+ const { t: c } = A(), s = a.progress;
2856
2874
  if (!s) return null;
2857
- const o = (u) => i.find((l) => l.name === u)?.label ?? u, d = fe(s), h = [
2875
+ const o = (u) => i.find((l) => l.name === u)?.label ?? u, d = fe(s), m = [
2858
2876
  ...new Map(
2859
- d.flatMap((u) => w.get(u.name) ?? []).map((u) => [u.id, u])
2877
+ d.flatMap((u) => k.get(u.name) ?? []).map((u) => [u.id, u])
2860
2878
  ).values()
2861
2879
  ], r = /* @__PURE__ */ new Map();
2862
2880
  for (const u of t ?? []) {
@@ -2868,15 +2886,15 @@ function Ps({
2868
2886
  /* @__PURE__ */ e.jsx("b", { children: c("workshopLab.progress.title") }),
2869
2887
  /* @__PURE__ */ e.jsx("span", { className: n.spacer }),
2870
2888
  /* @__PURE__ */ e.jsx($, { size: "small", type: "link", onClick: p, children: c("workshopLab.computed.edit") }),
2871
- h.length > 0 ? /* @__PURE__ */ e.jsx(
2872
- xe,
2889
+ m.length > 0 ? /* @__PURE__ */ e.jsx(
2890
+ ge,
2873
2891
  {
2874
2892
  title: c("workshopLab.computed.removeBlocked", {
2875
- names: h.map((u) => u.label).join("、")
2893
+ names: m.map((u) => u.label).join("、")
2876
2894
  }),
2877
2895
  children: /* @__PURE__ */ e.jsx($, { size: "small", type: "link", danger: !0, disabled: !0, children: c("workshopLab.computed.remove") })
2878
2896
  }
2879
- ) : /* @__PURE__ */ e.jsx(ee, { title: c("workshopLab.progress.removeConfirm"), onConfirm: k, children: /* @__PURE__ */ e.jsx($, { size: "small", type: "link", danger: !0, children: c("workshopLab.computed.remove") }) })
2897
+ ) : /* @__PURE__ */ e.jsx(ee, { title: c("workshopLab.progress.removeConfirm"), onConfirm: j, children: /* @__PURE__ */ e.jsx($, { size: "small", type: "link", danger: !0, children: c("workshopLab.computed.remove") }) })
2880
2898
  ] }),
2881
2899
  /* @__PURE__ */ e.jsxs("span", { children: [
2882
2900
  s.steps.map(
@@ -2893,15 +2911,15 @@ function Ps({
2893
2911
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: c("workshopLab.progress.columns", {
2894
2912
  names: d.map((u) => `${u.label}(${u.name})`).join("、")
2895
2913
  }) }),
2896
- t ? /* @__PURE__ */ e.jsx("span", { className: n.computedPreview, children: Ie.map((u) => /* @__PURE__ */ e.jsxs(J, { color: ve(u.tone), children: [
2914
+ t ? /* @__PURE__ */ e.jsx("span", { className: n.computedPreview, children: Ie.map((u) => /* @__PURE__ */ e.jsxs(J, { color: Le(u.tone), children: [
2897
2915
  je(u.value),
2898
2916
  " ",
2899
2917
  r.get(u.value) ?? 0
2900
2918
  ] }, u.value)) }) : /* @__PURE__ */ e.jsx("span", { className: n.muted, children: c("workshopLab.computed.notLoaded") }),
2901
- /* @__PURE__ */ e.jsx("span", { className: n.muted, children: h.length > 0 ? c("workshopLab.computed.usedBy", { names: h.map((u) => u.label).join("、") }) : c("workshopLab.computed.unused") })
2919
+ /* @__PURE__ */ e.jsx("span", { className: n.muted, children: m.length > 0 ? c("workshopLab.computed.usedBy", { names: m.map((u) => u.label).join("、") }) : c("workshopLab.computed.unused") })
2902
2920
  ] });
2903
2921
  }
2904
- function Es(a) {
2922
+ function Ms(a) {
2905
2923
  return a ? {
2906
2924
  steps: a.steps.map((i) => {
2907
2925
  const t = i.done?.[0];
@@ -2923,35 +2941,35 @@ function Es(a) {
2923
2941
  dueLabel: ""
2924
2942
  };
2925
2943
  }
2926
- function Ms({
2944
+ function As({
2927
2945
  initial: a,
2928
2946
  source: i,
2929
2947
  asOf: t,
2930
- properties: w,
2948
+ properties: k,
2931
2949
  rows: p,
2932
- onCancel: k,
2950
+ onCancel: j,
2933
2951
  onSave: c
2934
2952
  }) {
2935
- const { t: s } = _(), o = w.filter((v) => v.type === "date"), [d, h] = A.useState(() => Es(a)), r = (v, C) => h({
2953
+ const { t: s } = A(), o = k.filter((L) => L.type === "date"), [d, m] = E.useState(() => Ms(a)), r = (L, N) => m({
2936
2954
  ...d,
2937
- steps: d.steps.map((S, N) => N === v ? { ...S, ...C } : S)
2938
- }), u = (v) => {
2939
- if (!p || !v) return [];
2940
- const C = /* @__PURE__ */ new Map();
2955
+ steps: d.steps.map((S, y) => y === L ? { ...S, ...N } : S)
2956
+ }), u = (L) => {
2957
+ if (!p || !L) return [];
2958
+ const N = /* @__PURE__ */ new Map();
2941
2959
  for (const S of p) {
2942
- const N = S[v];
2943
- N != null && N !== "" && C.set(String(N), (C.get(String(N)) ?? 0) + 1);
2960
+ const y = S[L];
2961
+ y != null && y !== "" && N.set(String(y), (N.get(String(y)) ?? 0) + 1);
2944
2962
  }
2945
- return [...C].sort((S, N) => N[1] - S[1]);
2963
+ return [...N].sort((S, y) => y[1] - S[1]);
2946
2964
  }, l = d.steps.every(
2947
- (v) => v.label.trim() !== "" && (v.by === "date" ? !!v.field : !!(v.doneField && v.doneValue))
2948
- ), j = () => ({
2949
- steps: d.steps.map((v) => ({
2950
- label: v.label.trim(),
2951
- ...v.field ? { field: v.field } : {},
2952
- ...v.by === "field" && v.doneField ? {
2965
+ (L) => L.label.trim() !== "" && (L.by === "date" ? !!L.field : !!(L.doneField && L.doneValue))
2966
+ ), w = () => ({
2967
+ steps: d.steps.map((L) => ({
2968
+ label: L.label.trim(),
2969
+ ...L.field ? { field: L.field } : {},
2970
+ ...L.by === "field" && L.doneField ? {
2953
2971
  done: [
2954
- { field: v.doneField, op: "eq", value: v.doneValue ?? "" }
2972
+ { field: L.doneField, op: "eq", value: L.doneValue ?? "" }
2955
2973
  ]
2956
2974
  } : {}
2957
2975
  })),
@@ -2961,11 +2979,11 @@ function Ms({
2961
2979
  ...d.dueLabel.trim() ? { label: d.dueLabel.trim() } : {}
2962
2980
  }
2963
2981
  } : {}
2964
- }), g = o.map((v) => ({ value: v.name, label: v.label })), b = l && d.steps.length > 0 ? j() : void 0, T = A.useMemo(
2965
- () => p && b ? ue(p, { ...i, progress: b }, t) : null,
2982
+ }), f = o.map((L) => ({ value: L.name, label: L.label })), h = l && d.steps.length > 0 ? w() : void 0, C = E.useMemo(
2983
+ () => p && h ? he(p, { ...i, progress: h }, t) : null,
2966
2984
  // The draft is rebuilt each render; its JSON says when it really changed.
2967
2985
  // eslint-disable-next-line react-hooks/exhaustive-deps
2968
- [p, i, t, JSON.stringify(b)]
2986
+ [p, i, t, JSON.stringify(h)]
2969
2987
  );
2970
2988
  return /* @__PURE__ */ e.jsx(
2971
2989
  ae,
@@ -2975,35 +2993,35 @@ function Ms({
2975
2993
  title: s("workshopLab.progress.dialogTitle"),
2976
2994
  okText: s("workshopLab.computed.save"),
2977
2995
  okButtonProps: { disabled: !l || d.steps.length === 0 },
2978
- onOk: () => c(j()),
2979
- onCancel: k,
2996
+ onOk: () => c(w()),
2997
+ onCancel: j,
2980
2998
  children: /* @__PURE__ */ e.jsxs("div", { className: n.computedForm, children: [
2981
2999
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.progress.dialogHint") }),
2982
3000
  /* @__PURE__ */ e.jsx("b", { children: s("workshopLab.progress.stepsTitle") }),
2983
3001
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.progress.stepDateHint") }),
2984
- d.steps.map((v, C) => /* @__PURE__ */ e.jsxs("div", { className: n.computedCase, children: [
2985
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
2986
- /* @__PURE__ */ e.jsx("span", { children: s("workshopLab.progress.stepN", { n: C + 1 }) }),
3002
+ d.steps.map((L, N) => /* @__PURE__ */ e.jsxs("div", { className: n.computedCase, children: [
3003
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
3004
+ /* @__PURE__ */ e.jsx("span", { children: s("workshopLab.progress.stepN", { n: N + 1 }) }),
2987
3005
  /* @__PURE__ */ e.jsx(
2988
3006
  I,
2989
3007
  {
2990
3008
  size: "small",
2991
3009
  className: n.fieldSelect,
2992
3010
  placeholder: s("workshopLab.progress.stepLabel"),
2993
- value: v.label,
2994
- onChange: (S) => r(C, { label: S.target.value })
3011
+ value: L.label,
3012
+ onChange: (S) => r(N, { label: S.target.value })
2995
3013
  }
2996
3014
  ),
2997
3015
  /* @__PURE__ */ e.jsx("span", { children: s("workshopLab.progress.stepDate") }),
2998
3016
  /* @__PURE__ */ e.jsx(
2999
- F,
3017
+ O,
3000
3018
  {
3001
3019
  size: "small",
3002
3020
  className: n.fieldSelect,
3003
- allowClear: v.by === "field",
3004
- value: v.field,
3005
- options: g,
3006
- onChange: (S) => r(C, { field: S })
3021
+ allowClear: L.by === "field",
3022
+ value: L.field,
3023
+ options: f,
3024
+ onChange: (S) => r(N, { field: S })
3007
3025
  }
3008
3026
  ),
3009
3027
  /* @__PURE__ */ e.jsx(
@@ -3013,34 +3031,34 @@ function Ms({
3013
3031
  type: "link",
3014
3032
  danger: !0,
3015
3033
  disabled: d.steps.length <= 1,
3016
- onClick: () => h({ ...d, steps: d.steps.filter((S, N) => N !== C) }),
3034
+ onClick: () => m({ ...d, steps: d.steps.filter((S, y) => y !== N) }),
3017
3035
  children: s("workshopLab.computed.removeCase")
3018
3036
  }
3019
3037
  )
3020
3038
  ] }),
3021
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
3039
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
3022
3040
  /* @__PURE__ */ e.jsx("span", { children: s("workshopLab.progress.doneBy") }),
3023
3041
  /* @__PURE__ */ e.jsx(
3024
- he.Group,
3042
+ ue.Group,
3025
3043
  {
3026
3044
  size: "small",
3027
- value: v.by,
3028
- onChange: (S) => r(C, { by: S.target.value }),
3045
+ value: L.by,
3046
+ onChange: (S) => r(N, { by: S.target.value }),
3029
3047
  options: [
3030
3048
  { value: "date", label: s("workshopLab.progress.doneByDate") },
3031
3049
  { value: "field", label: s("workshopLab.progress.doneByField") }
3032
3050
  ]
3033
3051
  }
3034
3052
  ),
3035
- v.by === "field" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3053
+ L.by === "field" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3036
3054
  /* @__PURE__ */ e.jsx(
3037
- F,
3055
+ O,
3038
3056
  {
3039
3057
  size: "small",
3040
3058
  className: n.fieldSelect,
3041
- value: v.doneField,
3042
- options: w.filter((S) => S.type !== "date").map((S) => ({ value: S.name, label: S.label })),
3043
- onChange: (S) => r(C, { doneField: S, doneValue: void 0 })
3059
+ value: L.doneField,
3060
+ options: k.filter((S) => S.type !== "date").map((S) => ({ value: S.name, label: S.label })),
3061
+ onChange: (S) => r(N, { doneField: S, doneValue: void 0 })
3044
3062
  }
3045
3063
  ),
3046
3064
  /* @__PURE__ */ e.jsx("span", { children: s("workshopLab.computed.ops.eq") }),
@@ -3049,40 +3067,40 @@ function Ms({
3049
3067
  {
3050
3068
  size: "small",
3051
3069
  className: n.fieldSelect,
3052
- value: v.doneValue,
3053
- options: u(v.doneField).map(([S, N]) => ({
3070
+ value: L.doneValue,
3071
+ options: u(L.doneField).map(([S, y]) => ({
3054
3072
  value: S,
3055
- label: `${S}(${N})`
3073
+ label: `${S}(${y})`
3056
3074
  })),
3057
- filterOption: (S, N) => String(N?.value ?? "").includes(S),
3058
- onChange: (S) => r(C, { doneValue: S })
3075
+ filterOption: (S, y) => String(y?.value ?? "").includes(S),
3076
+ onChange: (S) => r(N, { doneValue: S })
3059
3077
  }
3060
3078
  )
3061
3079
  ] })
3062
3080
  ] })
3063
- ] }, C)),
3081
+ ] }, N)),
3064
3082
  /* @__PURE__ */ e.jsx(
3065
3083
  $,
3066
3084
  {
3067
3085
  size: "small",
3068
- disabled: d.steps.length >= Xa,
3069
- onClick: () => h({ ...d, steps: [...d.steps, { label: "", by: "date" }] }),
3086
+ disabled: d.steps.length >= Wa,
3087
+ onClick: () => m({ ...d, steps: [...d.steps, { label: "", by: "date" }] }),
3070
3088
  children: s("workshopLab.progress.addStep")
3071
3089
  }
3072
3090
  ),
3073
3091
  /* @__PURE__ */ e.jsx("b", { children: s("workshopLab.progress.dueTitle") }),
3074
3092
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.progress.dueHint") }),
3075
- /* @__PURE__ */ e.jsxs(P, { wrap: !0, children: [
3093
+ /* @__PURE__ */ e.jsxs(F, { wrap: !0, children: [
3076
3094
  /* @__PURE__ */ e.jsx(
3077
- F,
3095
+ O,
3078
3096
  {
3079
3097
  size: "small",
3080
3098
  allowClear: !0,
3081
3099
  className: n.fieldSelect,
3082
3100
  placeholder: s("workshopLab.progress.noDue"),
3083
3101
  value: d.due,
3084
- options: g,
3085
- onChange: (v) => h({ ...d, due: v })
3102
+ options: f,
3103
+ onChange: (L) => m({ ...d, due: L })
3086
3104
  }
3087
3105
  ),
3088
3106
  /* @__PURE__ */ e.jsx(
@@ -3092,19 +3110,19 @@ function Ms({
3092
3110
  className: n.fieldSelect,
3093
3111
  placeholder: s("workshopLab.progress.dueLabel"),
3094
3112
  value: d.dueLabel,
3095
- onChange: (v) => h({ ...d, dueLabel: v.target.value })
3113
+ onChange: (L) => m({ ...d, dueLabel: L.target.value })
3096
3114
  }
3097
3115
  )
3098
3116
  ] }),
3099
- d.due && d.steps.some((v) => v.by === "date" && v.field === d.due) && /* @__PURE__ */ e.jsx(re, { type: "warning", showIcon: !0, message: s("workshopLab.progress.sameAsDue") }),
3117
+ d.due && d.steps.some((L) => L.by === "date" && L.field === d.due) && /* @__PURE__ */ e.jsx(re, { type: "warning", showIcon: !0, message: s("workshopLab.progress.sameAsDue") }),
3100
3118
  /* @__PURE__ */ e.jsx("span", { className: n.muted, children: s("workshopLab.progress.makes") }),
3101
3119
  /* @__PURE__ */ e.jsx(
3102
- Ye,
3120
+ Qe,
3103
3121
  {
3104
- rows: T,
3122
+ rows: C,
3105
3123
  loaded: p !== null,
3106
- progress: b,
3107
- properties: w,
3124
+ progress: h,
3125
+ properties: k,
3108
3126
  asOf: t
3109
3127
  }
3110
3128
  )
@@ -3112,52 +3130,52 @@ function Ms({
3112
3130
  }
3113
3131
  );
3114
3132
  }
3115
- const As = [
3133
+ const _s = [
3116
3134
  de.overdue.value,
3117
3135
  de.active.value,
3118
3136
  de.done.value
3119
- ], _s = 6;
3120
- function Ye({
3137
+ ], Is = 6;
3138
+ function Qe({
3121
3139
  rows: a,
3122
3140
  loaded: i,
3123
3141
  progress: t,
3124
- properties: w,
3142
+ properties: k,
3125
3143
  asOf: p
3126
3144
  }) {
3127
- const { t: k } = _(), [c, s] = A.useState(), o = (h) => w.find((r) => r.name === h)?.label ?? h, d = (() => {
3128
- if (!i) return /* @__PURE__ */ e.jsx("span", { className: n.muted, children: k("workshopLab.computed.notLoaded") });
3145
+ const { t: j } = A(), [c, s] = E.useState(), o = (m) => k.find((r) => r.name === m)?.label ?? m, d = (() => {
3146
+ if (!i) return /* @__PURE__ */ e.jsx("span", { className: n.muted, children: j("workshopLab.computed.notLoaded") });
3129
3147
  if (!t || !a)
3130
- return /* @__PURE__ */ e.jsx("span", { className: n.muted, children: k("workshopLab.progress.previewIncomplete") });
3131
- const h = /* @__PURE__ */ new Map();
3132
- for (const j of a) {
3133
- const g = String(j[le] ?? "");
3134
- h.set(g, (h.get(g) ?? 0) + 1);
3148
+ return /* @__PURE__ */ e.jsx("span", { className: n.muted, children: j("workshopLab.progress.previewIncomplete") });
3149
+ const m = /* @__PURE__ */ new Map();
3150
+ for (const w of a) {
3151
+ const f = String(w[le] ?? "");
3152
+ m.set(f, (m.get(f) ?? 0) + 1);
3135
3153
  }
3136
- const r = c ? a.filter((j) => j[le] === c).slice(0, _s) : As.flatMap(
3137
- (j) => a.filter((g) => g[le] === j).slice(0, 2)
3154
+ const r = c ? a.filter((w) => w[le] === c).slice(0, Is) : _s.flatMap(
3155
+ (w) => a.filter((f) => f[le] === w).slice(0, 2)
3138
3156
  ), u = [
3139
3157
  .../* @__PURE__ */ new Set([
3140
- ...t.steps.flatMap((j) => j.field ? [j.field] : []),
3158
+ ...t.steps.flatMap((w) => w.field ? [w.field] : []),
3141
3159
  ...t.due ? [t.due.field] : []
3142
3160
  ])
3143
- ], l = (j) => j == null || j === "";
3161
+ ], l = (w) => w == null || w === "";
3144
3162
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3145
- /* @__PURE__ */ e.jsx("span", { className: n.computedPreview, children: Ie.map((j) => /* @__PURE__ */ e.jsxs(
3163
+ /* @__PURE__ */ e.jsx("span", { className: n.computedPreview, children: Ie.map((w) => /* @__PURE__ */ e.jsxs(
3146
3164
  J,
3147
3165
  {
3148
- color: ve(j.tone),
3166
+ color: Le(w.tone),
3149
3167
  className: n.previewTag,
3150
- "data-dim": c !== void 0 && c !== j.value || void 0,
3151
- onClick: () => s(c === j.value ? void 0 : j.value),
3168
+ "data-dim": c !== void 0 && c !== w.value || void 0,
3169
+ onClick: () => s(c === w.value ? void 0 : w.value),
3152
3170
  children: [
3153
- je(j.value),
3171
+ je(w.value),
3154
3172
  " ",
3155
- h.get(j.value) ?? 0
3173
+ m.get(w.value) ?? 0
3156
3174
  ]
3157
3175
  },
3158
- j.value
3176
+ w.value
3159
3177
  )) }),
3160
- t.due && (h.get(de.overdue.value) ?? 0) === 0 && /* @__PURE__ */ e.jsx("span", { className: n.muted, children: k("workshopLab.progress.previewNoOverdue") }),
3178
+ t.due && (m.get(de.overdue.value) ?? 0) === 0 && /* @__PURE__ */ e.jsx("span", { className: n.muted, children: j("workshopLab.progress.previewNoOverdue") }),
3161
3179
  /* @__PURE__ */ e.jsx(
3162
3180
  De,
3163
3181
  {
@@ -3167,31 +3185,31 @@ function Ye({
3167
3185
  scroll: { x: "max-content" },
3168
3186
  dataSource: r,
3169
3187
  columns: [
3170
- { key: "$key", title: k("workshopLab.computed.object"), dataIndex: "$key" },
3171
- ...u.map((j) => ({
3172
- key: j,
3173
- title: j === t.due?.field ? k("workshopLab.progress.previewDue", { label: o(j) }) : o(j),
3174
- dataIndex: j,
3175
- render: (g) => l(g) ? "—" : String(g).slice(0, 10)
3188
+ { key: "$key", title: j("workshopLab.computed.object"), dataIndex: "$key" },
3189
+ ...u.map((w) => ({
3190
+ key: w,
3191
+ title: w === t.due?.field ? j("workshopLab.progress.previewDue", { label: o(w) }) : o(w),
3192
+ dataIndex: w,
3193
+ render: (f) => l(f) ? "—" : String(f).slice(0, 10)
3176
3194
  })),
3177
3195
  {
3178
3196
  key: q.stage,
3179
- title: k("workshopLab.progress.previewStage"),
3197
+ title: j("workshopLab.progress.previewStage"),
3180
3198
  dataIndex: q.stage,
3181
- render: (j) => l(j) ? "—" : String(j)
3199
+ render: (w) => l(w) ? "—" : String(w)
3182
3200
  },
3183
3201
  {
3184
3202
  key: le,
3185
- title: k("workshopLab.progress.title"),
3203
+ title: j("workshopLab.progress.title"),
3186
3204
  dataIndex: le,
3187
- render: (j) => je(String(j ?? ""))
3205
+ render: (w) => je(String(w ?? ""))
3188
3206
  },
3189
3207
  ...t.due ? [
3190
3208
  {
3191
3209
  key: q.overdueDays,
3192
- title: k("workshopLab.progress.previewOverdue"),
3210
+ title: j("workshopLab.progress.previewOverdue"),
3193
3211
  dataIndex: q.overdueDays,
3194
- render: (j) => l(j) || j === 0 ? "—" : String(j)
3212
+ render: (w) => l(w) || w === 0 ? "—" : String(w)
3195
3213
  }
3196
3214
  ] : []
3197
3215
  ]
@@ -3199,23 +3217,24 @@ function Ye({
3199
3217
  )
3200
3218
  ] });
3201
3219
  })();
3202
- return /* @__PURE__ */ e.jsxs("div", { className: n.computedPreviewBox, "aria-label": k("workshopLab.progress.previewTitle"), children: [
3203
- /* @__PURE__ */ e.jsx("b", { children: k("workshopLab.progress.previewTitle", { date: p }) }),
3220
+ return /* @__PURE__ */ e.jsxs("div", { className: n.computedPreviewBox, "aria-label": j("workshopLab.progress.previewTitle"), children: [
3221
+ /* @__PURE__ */ e.jsx("b", { children: j("workshopLab.progress.previewTitle", { date: p }) }),
3204
3222
  d
3205
3223
  ] });
3206
3224
  }
3207
- const le = q.status, Hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3225
+ const le = q.status, Vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3208
3226
  __proto__: null,
3209
- ComputedView: ks,
3227
+ ComputedView: js,
3210
3228
  EditColumnDialog: vs,
3211
- NewColumnDialog: fs,
3212
- ProgressPreview: Ye,
3229
+ NewColumnDialog: Ls,
3230
+ ProgressPreview: Qe,
3213
3231
  columnName: Je
3214
3232
  }, Symbol.toStringTag, { value: "Module" }));
3215
3233
  export {
3216
- ks as C,
3234
+ js as C,
3217
3235
  $e as G,
3218
- Hs as a,
3236
+ as as M,
3237
+ Vs as a,
3219
3238
  Ue as c,
3220
- os as s
3239
+ ls as s
3221
3240
  };