@rytass/bpm-core-react 0.21.0 → 0.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/chunks/{FormBuilderView-WtC2iW5f.js → FormBuilderView-6KdApi-D.js} +8 -8
  3. package/dist/chunks/{FormBuilderView-WtC2iW5f.js.map → FormBuilderView-6KdApi-D.js.map} +1 -1
  4. package/dist/chunks/{FormBuilderView-DjPGrOJ2.cjs → FormBuilderView-CGKkuVFi.cjs} +3 -3
  5. package/dist/chunks/{FormBuilderView-DjPGrOJ2.cjs.map → FormBuilderView-CGKkuVFi.cjs.map} +1 -1
  6. package/dist/chunks/{approval-instance-list-page-Bth7Raya.js → approval-instance-list-page-BI5fIXc-.js} +26 -26
  7. package/dist/chunks/{approval-instance-list-page-Bth7Raya.js.map → approval-instance-list-page-BI5fIXc-.js.map} +1 -1
  8. package/dist/chunks/{approval-instance-list-page-Dcvo6TrT.cjs → approval-instance-list-page-Cv5I1YPX.cjs} +2 -2
  9. package/dist/chunks/{approval-instance-list-page-Dcvo6TrT.cjs.map → approval-instance-list-page-Cv5I1YPX.cjs.map} +1 -1
  10. package/dist/chunks/compose-CtWuunwB.cjs +2 -0
  11. package/dist/chunks/compose-CtWuunwB.cjs.map +1 -0
  12. package/dist/chunks/{compose-DZvIspW3.js → compose-M-GR6smM.js} +4 -4
  13. package/dist/chunks/{compose-DZvIspW3.js.map → compose-M-GR6smM.js.map} +1 -1
  14. package/dist/chunks/{designer-CWubIE69.js → designer-BnMeiMVe.js} +2192 -1609
  15. package/dist/chunks/designer-BnMeiMVe.js.map +1 -0
  16. package/dist/chunks/designer-D6fCDq_q.cjs +69 -0
  17. package/dist/chunks/designer-D6fCDq_q.cjs.map +1 -0
  18. package/dist/chunks/detail-C5KrUC7s.cjs +5 -0
  19. package/dist/chunks/detail-C5KrUC7s.cjs.map +1 -0
  20. package/dist/chunks/{detail-Bv90gvy0.js → detail-Dnc4PPWO.js} +768 -742
  21. package/dist/chunks/detail-Dnc4PPWO.js.map +1 -0
  22. package/dist/chunks/{instance-error-message-CAP1vJhX.js → instance-error-message-BEM4O_Kj.js} +6 -2
  23. package/dist/chunks/instance-error-message-BEM4O_Kj.js.map +1 -0
  24. package/dist/chunks/instance-error-message-BpCLCOjp.cjs +2 -0
  25. package/dist/chunks/instance-error-message-BpCLCOjp.cjs.map +1 -0
  26. package/dist/chunks/organization-time-zone-provider-B7CXQril.cjs +2 -0
  27. package/dist/chunks/organization-time-zone-provider-B7CXQril.cjs.map +1 -0
  28. package/dist/chunks/organization-time-zone-provider-DNL8yo4-.js +42 -0
  29. package/dist/chunks/organization-time-zone-provider-DNL8yo4-.js.map +1 -0
  30. package/dist/chunks/{providers-BbCs23sk.js → providers-CQWekD7_.js} +197 -196
  31. package/dist/chunks/providers-CQWekD7_.js.map +1 -0
  32. package/dist/chunks/providers-VUOh6i0i.cjs +2 -0
  33. package/dist/chunks/providers-VUOh6i0i.cjs.map +1 -0
  34. package/dist/components/notification-drawer-options.d.cts +18 -0
  35. package/dist/components/notification-drawer-options.d.ts +18 -0
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +1 -0
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.js +23 -23
  41. package/dist/index.js.map +1 -1
  42. package/dist/lib/organization-time-zone-provider.d.cts +20 -0
  43. package/dist/lib/organization-time-zone-provider.d.ts +20 -0
  44. package/dist/lib/organization-time-zone.d.cts +8 -0
  45. package/dist/lib/organization-time-zone.d.ts +8 -0
  46. package/dist/lib/providers.d.cts +10 -1
  47. package/dist/lib/providers.d.ts +10 -1
  48. package/dist/next/BPMNextProviders.d.cts +8 -1
  49. package/dist/next/BPMNextProviders.d.ts +8 -1
  50. package/dist/next/index.cjs +1 -1
  51. package/dist/next/index.cjs.map +1 -1
  52. package/dist/next/index.js +12 -11
  53. package/dist/next/index.js.map +1 -1
  54. package/dist/pages/instances/detail/index.cjs +1 -1
  55. package/dist/pages/instances/detail/index.js +1 -1
  56. package/dist/pages/templates/compose/index.cjs +1 -1
  57. package/dist/pages/templates/compose/index.js +1 -1
  58. package/dist/pages/templates/designer/index.cjs +1 -1
  59. package/dist/pages/templates/designer/index.js +1 -1
  60. package/dist/views/cc/index.cjs +1 -1
  61. package/dist/views/cc/index.js +1 -1
  62. package/dist/views/forms/builder/index.cjs +1 -1
  63. package/dist/views/forms/builder/index.js +1 -1
  64. package/dist/views/instances/detail/index.cjs +1 -1
  65. package/dist/views/instances/detail/index.js +1 -1
  66. package/dist/views/instances/detail/sections/shared.d.cts +0 -1
  67. package/dist/views/instances/detail/sections/shared.d.ts +0 -1
  68. package/dist/views/instances/new/index.cjs +1 -1
  69. package/dist/views/instances/new/index.js +1 -1
  70. package/dist/views/search/index.cjs +1 -1
  71. package/dist/views/search/index.js +1 -1
  72. package/dist/views/sent/index.cjs +1 -1
  73. package/dist/views/sent/index.js +1 -1
  74. package/dist/views/templates/compose/index.cjs +1 -1
  75. package/dist/views/templates/compose/index.js +1 -1
  76. package/dist/views/templates/designer/approver-resolver-model.d.cts +105 -1
  77. package/dist/views/templates/designer/approver-resolver-model.d.ts +105 -1
  78. package/dist/views/templates/designer/dynamic-form-resolver-options.d.cts +5 -0
  79. package/dist/views/templates/designer/dynamic-form-resolver-options.d.ts +5 -0
  80. package/dist/views/templates/designer/index.cjs +1 -1
  81. package/dist/views/templates/designer/index.js +1 -1
  82. package/dist/views/templates/designer/node-actor-resolver-options.d.cts +44 -1
  83. package/dist/views/templates/designer/node-actor-resolver-options.d.ts +44 -1
  84. package/dist/views/templates/designer/notify-recipient-options.d.cts +81 -0
  85. package/dist/views/templates/designer/notify-recipient-options.d.ts +81 -0
  86. package/dist/views/templates/designer/position-level-options.d.cts +3 -1
  87. package/dist/views/templates/designer/position-level-options.d.ts +3 -1
  88. package/dist/views/templates/designer/position-scope.d.cts +51 -0
  89. package/dist/views/templates/designer/position-scope.d.ts +51 -0
  90. package/package.json +3 -3
  91. package/dist/chunks/compose-BKUTsB2W.cjs +0 -2
  92. package/dist/chunks/compose-BKUTsB2W.cjs.map +0 -1
  93. package/dist/chunks/designer-CWubIE69.js.map +0 -1
  94. package/dist/chunks/designer-C_m8DmMl.cjs +0 -69
  95. package/dist/chunks/designer-C_m8DmMl.cjs.map +0 -1
  96. package/dist/chunks/detail-Bv90gvy0.js.map +0 -1
  97. package/dist/chunks/detail-DNzqesdI.cjs +0 -5
  98. package/dist/chunks/detail-DNzqesdI.cjs.map +0 -1
  99. package/dist/chunks/instance-error-message-BW464LRQ.cjs +0 -2
  100. package/dist/chunks/instance-error-message-BW464LRQ.cjs.map +0 -1
  101. package/dist/chunks/instance-error-message-CAP1vJhX.js.map +0 -1
  102. package/dist/chunks/language-provider-Bdnx3Gxl.cjs +0 -2
  103. package/dist/chunks/language-provider-Bdnx3Gxl.cjs.map +0 -1
  104. package/dist/chunks/language-provider-phkWOapf.js +0 -17
  105. package/dist/chunks/language-provider-phkWOapf.js.map +0 -1
  106. package/dist/chunks/providers-BbCs23sk.js.map +0 -1
  107. package/dist/chunks/providers-D_KAgOOu.cjs +0 -2
  108. package/dist/chunks/providers-D_KAgOOu.cjs.map +0 -1
@@ -7,32 +7,32 @@ import { t as r } from "./use-bpm-member-BPzcNU1g.js";
7
7
  import { l as i, n as a, o, t as s } from "./FormRendererView-BcQKUi1A.js";
8
8
  import { a as c, n as l, o as u, r as d, t as f } from "./task-decision-3d17ZvZE.js";
9
9
  import { t as p } from "./format-member-label-C73FuP-d.js";
10
- import { a as m, c as h, d as g, f as ee, i as te, l as ne, n as re, o as ie, r as ae, s as oe, t as _, u as se } from "./instance-error-message-CAP1vJhX.js";
11
- import { Fragment as v, forwardRef as y, useCallback as ce, useEffect as b, useImperativeHandle as le, useMemo as x, useRef as ue, useState as S } from "react";
12
- import { AutoComplete as de, Badge as fe, Button as C, Description as w, DescriptionContent as pe, InlineMessage as me, Input as he, Message as ge, Modal as T, PageHeader as _e, Section as E, SectionGroup as ve, Select as ye, Stepper as be, Table as xe, Textarea as Se, Tooltip as Ce, Typography as D } from "@mezzanine-ui/react";
13
- import { readFormDataIssues as we } from "@rytass/bpm-core-client";
14
- import { Fragment as Te, jsx as O, jsxs as k } from "react/jsx-runtime";
10
+ import { a as m, c as h, d as g, f as ee, i as te, l as ne, n as re, o as ie, r as ae, s as oe, t as _, u as v } from "./instance-error-message-BEM4O_Kj.js";
11
+ import { Fragment as se, forwardRef as y, useCallback as ce, useEffect as le, useImperativeHandle as ue, useMemo as b, useRef as de, useState as x } from "react";
12
+ import { AutoComplete as fe, Badge as pe, Button as S, Description as C, DescriptionContent as me, InlineMessage as he, Input as ge, Message as _e, Modal as w, PageHeader as ve, Section as T, SectionGroup as ye, Select as be, Stepper as xe, Table as Se, Textarea as Ce, Tooltip as we, Typography as E } from "@mezzanine-ui/react";
13
+ import { readFormDataIssues as Te } from "@rytass/bpm-core-client";
14
+ import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
15
15
  import { cancelAdhocDirective as Ee, cancelApprovalInstance as De, configureAdhocCompletionNotification as Oe, configureAdhocStageNotification as ke, decideTask as A, listAdhocDirectives as Ae, listAttachments as je, listTaskDecisions as Me, listWorkflowWebhookDeliveries as Ne, readApprovalInstance as Pe, readAttachmentDownloadUrl as Fe, readAttachmentPreviewUrl as Ie, readInstanceSignatures as Le, requestAdhocCountersign as Re, requestAdhocPreApproval as ze, resolveMemberProfiles as Be, resubmitApprovalInstance as Ve, retryWorkflowWebhookDelivery as He, searchMembers as Ue, uploadAttachment as We } from "@rytass/bpm-core-client/workflow";
16
- import Ge from "@mezzanine-ui/react/ContentHeader";
17
- import { readNodeFillableFieldKeys as Ke, readRevealedFieldKeys as qe, readTopLevelFieldKey as j, resolveFieldAccess as M } from "@rytass/bpm-core-shared";
16
+ import { readNodeFillableFieldKeys as Ge, readRevealedFieldKeys as Ke, readTopLevelFieldKey as j, resolveFieldAccess as qe } from "@rytass/bpm-core-shared";
17
+ import M from "@mezzanine-ui/react/ContentHeader";
18
18
  import { buildFormRendererValues as Je, focusFormRendererField as Ye, validateFormRendererValuesInWorker as Xe } from "@rytass/bpm-core-client/form";
19
- import { CheckedIcon as Ze, ChevronLeftIcon as Qe, ChevronRightIcon as N, DangerousOutlineIcon as $e, DownloadIcon as P, FileSearchIcon as et, NotificationUnreadIcon as tt, PlusIcon as nt, RefreshCcwIcon as rt, ResetIcon as F, ShareIcon as I, UserIcon as it, ZoomInIcon as at, ZoomOutIcon as ot } from "@mezzanine-ui/icons";
20
- import { resolveOrgUnitOptions as st } from "@rytass/bpm-core-client/organization";
21
- import { Background as ct, Controls as lt, Handle as ut, Position as L, ReactFlow as dt } from "@xyflow/react";
19
+ import { CheckedIcon as Ze, ChevronLeftIcon as Qe, ChevronRightIcon as $e, DangerousOutlineIcon as et, DownloadIcon as N, FileSearchIcon as tt, NotificationUnreadIcon as nt, PlusIcon as rt, RefreshCcwIcon as it, ResetIcon as at, ShareIcon as P, UserIcon as F, ZoomInIcon as ot, ZoomOutIcon as st } from "@mezzanine-ui/icons";
20
+ import { resolveOrgUnitOptions as ct } from "@rytass/bpm-core-client/organization";
21
+ import { Background as lt, Controls as ut, Handle as I, Position as L, ReactFlow as dt } from "@xyflow/react";
22
22
  import * as ft from "dagre";
23
23
  import { Document as pt, Page as mt } from "react-pdf";
24
24
  import { readSelectableReturnTargetNodeIds as ht } from "@rytass/bpm-core-shared/workflow-graph";
25
25
  import { stepClasses as R } from "@mezzanine-ui/core/stepper";
26
26
  function gt(e) {
27
- let [t, n] = S(/* @__PURE__ */ new Map()), r = e.join("\n");
28
- return b(() => {
27
+ let [t, n] = x(/* @__PURE__ */ new Map()), r = e.join("\n");
28
+ return le(() => {
29
29
  let e = r ? [...new Set(r.split("\n"))].filter((e) => !t.has(e)) : [], i = !1;
30
- return e.length === 0 ? () => void 0 : (st(e).then((e) => e.map(a)).catch(() => []).then((t) => {
30
+ return e.length === 0 ? () => void 0 : (ct(e).then((e) => e.map(a)).catch(() => []).then((t) => {
31
31
  i || n((n) => new Map([...n, ...e.map((e) => [e, t.find((t) => t.id.toLowerCase() === e.toLowerCase())?.name ?? null])]));
32
32
  }), () => {
33
33
  i = !0;
34
34
  });
35
- }, [r, t]), x(() => new Map((r ? [...new Set(r.split("\n"))] : []).flatMap((e) => {
35
+ }, [r, t]), b(() => new Map((r ? [...new Set(r.split("\n"))] : []).flatMap((e) => {
36
36
  let n = t.get(e);
37
37
  return n === null ? [] : [[e, n ?? "讀取中…"]];
38
38
  })), [r, t]);
@@ -48,8 +48,8 @@ var z = {
48
48
  state: "bpm_state_bpgp3"
49
49
  }, _t = 760, vt = 920, yt = 320, bt = 32, xt = .75, St = 1.75, B = .25;
50
50
  function Ct({ filename: e, fileUrl: t, onDownload: n }) {
51
- let r = ue(null), [i, a] = S(null), [o, s] = S(1), [c, l] = S(1), [u, d] = S(_t);
52
- b(() => {
51
+ let r = de(null), [i, a] = x(null), [o, s] = x(1), [c, l] = x(1), [u, d] = x(_t);
52
+ le(() => {
53
53
  let e = r.current;
54
54
  if (!e || typeof ResizeObserver > "u") return;
55
55
  let t = new ResizeObserver((e) => {
@@ -57,10 +57,10 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
57
57
  t && d(t);
58
58
  });
59
59
  return t.observe(e), () => t.disconnect();
60
- }, []), b(() => {
60
+ }, []), le(() => {
61
61
  a(null), s(1), l(1);
62
62
  }, [t]);
63
- let f = x(() => {
63
+ let f = b(() => {
64
64
  let e = Math.max(yt, u - bt);
65
65
  return Math.round(Math.min(vt, e) * c);
66
66
  }, [c, u]), p = ce((e) => {
@@ -76,7 +76,7 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
76
76
  className: z.pageControls,
77
77
  "aria-label": "頁面切換",
78
78
  children: [
79
- /* @__PURE__ */ O(C, {
79
+ /* @__PURE__ */ O(S, {
80
80
  "aria-label": "上一頁",
81
81
  disabled: !m,
82
82
  icon: Qe,
@@ -86,16 +86,16 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
86
86
  size: "minor",
87
87
  variant: "base-secondary"
88
88
  }),
89
- /* @__PURE__ */ O(D, {
89
+ /* @__PURE__ */ O(E, {
90
90
  className: z.counter,
91
91
  component: "span",
92
92
  variant: "body",
93
93
  children: te
94
94
  }),
95
- /* @__PURE__ */ O(C, {
95
+ /* @__PURE__ */ O(S, {
96
96
  "aria-label": "下一頁",
97
97
  disabled: !h,
98
- icon: N,
98
+ icon: $e,
99
99
  onClick: () => {
100
100
  s((e) => i === null ? e : Math.min(i, e + 1));
101
101
  },
@@ -108,26 +108,26 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
108
108
  className: z.zoomControls,
109
109
  "aria-label": "縮放",
110
110
  children: [
111
- /* @__PURE__ */ O(C, {
111
+ /* @__PURE__ */ O(S, {
112
112
  "aria-label": "縮小",
113
113
  disabled: !g,
114
- icon: ot,
114
+ icon: st,
115
115
  onClick: () => {
116
116
  l((e) => Math.max(xt, e - B));
117
117
  },
118
118
  size: "minor",
119
119
  variant: "base-secondary"
120
120
  }),
121
- /* @__PURE__ */ O(D, {
121
+ /* @__PURE__ */ O(E, {
122
122
  className: z.counter,
123
123
  component: "span",
124
124
  variant: "body",
125
125
  children: ne
126
126
  }),
127
- /* @__PURE__ */ O(C, {
127
+ /* @__PURE__ */ O(S, {
128
128
  "aria-label": "放大",
129
129
  disabled: !ee,
130
- icon: at,
130
+ icon: ot,
131
131
  onClick: () => {
132
132
  l((e) => Math.min(St, e + B));
133
133
  },
@@ -136,8 +136,8 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
136
136
  })
137
137
  ]
138
138
  }),
139
- n ? /* @__PURE__ */ O(C, {
140
- icon: P,
139
+ n ? /* @__PURE__ */ O(S, {
140
+ icon: N,
141
141
  iconType: "leading",
142
142
  onClick: n,
143
143
  size: "minor",
@@ -149,15 +149,15 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
149
149
  className: z.viewport,
150
150
  ref: r,
151
151
  children: /* @__PURE__ */ O(pt, {
152
- error: /* @__PURE__ */ O(wt, { message: "PDF 無法載入。" }),
152
+ error: /* @__PURE__ */ O(V, { message: "PDF 無法載入。" }),
153
153
  file: t,
154
- loading: /* @__PURE__ */ O(wt, { message: "正在載入 PDF..." }),
155
- noData: /* @__PURE__ */ O(wt, { message: "沒有可預覽的 PDF。" }),
154
+ loading: /* @__PURE__ */ O(V, { message: "正在載入 PDF..." }),
155
+ noData: /* @__PURE__ */ O(V, { message: "沒有可預覽的 PDF。" }),
156
156
  onLoadSuccess: p,
157
157
  suspense: !1,
158
158
  children: /* @__PURE__ */ O(mt, {
159
159
  className: z.page,
160
- loading: /* @__PURE__ */ O(wt, { message: "正在載入頁面..." }),
160
+ loading: /* @__PURE__ */ O(V, { message: "正在載入頁面..." }),
161
161
  pageNumber: o,
162
162
  renderAnnotationLayer: !0,
163
163
  renderTextLayer: !0,
@@ -167,10 +167,10 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
167
167
  })]
168
168
  });
169
169
  }
170
- function wt({ message: e }) {
170
+ function V({ message: e }) {
171
171
  return /* @__PURE__ */ O("div", {
172
172
  className: z.state,
173
- children: /* @__PURE__ */ O(D, {
173
+ children: /* @__PURE__ */ O(E, {
174
174
  color: "text-neutral",
175
175
  variant: "body",
176
176
  children: e
@@ -178,106 +178,111 @@ function wt({ message: e }) {
178
178
  });
179
179
  }
180
180
  // src/views/instances/detail/submitted-by.ts
181
- function Tt({ initiatorMemberId: e, submittedByMemberId: t }) {
181
+ function wt({ initiatorMemberId: e, submittedByMemberId: t }) {
182
182
  return t && t !== e ? t : null;
183
183
  }
184
- function Et(e, t) {
185
- let n = Tt(e);
184
+ function Tt(e, t) {
185
+ let n = wt(e);
186
186
  if (!n || !e.initiatorMemberId) return null;
187
187
  let r = (e) => t.get(e)?.name ?? e;
188
188
  return `由 ${r(n)} 代 ${r(e.initiatorMemberId)} 送出`;
189
189
  }
190
190
  // src/views/instances/detail/sections/shared.ts
191
- function Dt(e) {
192
- let t = V(e, "from"), n = V(e, "to"), r = V(e, "reason");
191
+ function Et(e) {
192
+ let t = H(e, "from"), n = H(e, "to"), r = H(e, "reason");
193
193
  return !t || !n || !r ? null : {
194
194
  from: t,
195
195
  reason: r,
196
- ruleId: V(e, "ruleId"),
196
+ ruleId: H(e, "ruleId"),
197
197
  to: n
198
198
  };
199
199
  }
200
- function Ot(e) {
200
+ function Dt(e) {
201
201
  try {
202
202
  let t = JSON.parse(e);
203
- return Array.isArray(t) ? t.map((e) => At(e) ? Dt(e) : null).filter((e) => e !== null) : [];
203
+ return Array.isArray(t) ? t.map((e) => kt(e) ? Et(e) : null).filter((e) => e !== null) : [];
204
204
  } catch {
205
205
  return [];
206
206
  }
207
207
  }
208
- function V(e, t) {
208
+ function H(e, t) {
209
209
  let n = e[t];
210
210
  return typeof n == "string" ? n : null;
211
211
  }
212
- function kt(e, t) {
212
+ function Ot(e, t) {
213
213
  let n = e[t];
214
214
  return Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
215
215
  }
216
- function H(e, t) {
216
+ function U(e, t) {
217
217
  let n = e[t];
218
218
  return typeof n == "number" ? n : null;
219
219
  }
220
- function U(e) {
220
+ function W(e) {
221
221
  return typeof e == "string" && e.trim().length > 0;
222
222
  }
223
- function At(e) {
223
+ function kt(e) {
224
224
  return typeof e == "object" && !!e;
225
225
  }
226
- function jt(e) {
226
+ function At(e) {
227
227
  return e.status === "PENDING" || e.status === "IN_PROGRESS";
228
228
  }
229
- function Mt(e) {
229
+ function jt(e) {
230
230
  return !Number.isFinite(e) || e <= 0 ? "-" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
231
231
  }
232
- function W(e) {
232
+ function G(e) {
233
233
  return e.length > 16 ? `${e.slice(0, 12)}...` : e;
234
234
  }
235
- function Nt(e) {
235
+ function Mt(e) {
236
236
  return e === "APPROVED" ? "已同意" : e === "CANCELLED" ? "已取消" : e === "DRAFT" ? "草稿" : e === "EXPIRED" ? "已逾期" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "RUNNING" ? "進行中" : e;
237
237
  }
238
- function G(e) {
238
+ function K(e) {
239
239
  return e === "PENDING" ? "待處理" : e === "IN_PROGRESS" ? "處理中" : e === "COMPLETED" ? "已完成" : e === "CANCELLED" ? "已取消" : e === "TRANSFERRED" ? "已轉派" : e;
240
240
  }
241
- function Pt(e) {
241
+ function Nt(e) {
242
242
  return e === "APPROVED" ? "同意" : e === "REJECTED" ? "拒絕" : e === "RETURNED" ? "退回" : e === "TRANSFERRED" ? "轉派" : e;
243
243
  }
244
- function Ft(e) {
244
+ function Pt(e) {
245
245
  return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
246
246
  }
247
- function It(e, t) {
247
+ function Ft(e, t) {
248
248
  return t?.nodes.find((t) => t.id === e)?.data.label ?? e;
249
249
  }
250
- function K(e, t) {
250
+ function It(e, t) {
251
+ return e.name.trim() ? e.name : t;
252
+ }
253
+ function q(e, t) {
251
254
  if (!e) return "-";
252
255
  let n = t.get(e);
253
- return n ? p(n.name, n.email, "fullwidth") : e;
256
+ return n ? p(It(n, e), n.email, "fullwidth") : e;
254
257
  }
255
- function Lt(e, t = /* @__PURE__ */ new Map()) {
256
- let n = Ot(e.delegationChainJson);
257
- if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => K(e, t)).join("、")}` : "未指定";
258
- let r = K(e.assigneeMemberId, t), i = K(e.originalAssigneeMemberId, t);
259
- return n.length === 0 || e.originalAssigneeMemberId === e.assigneeMemberId ? r : `${r}(原:${i})`;
258
+ function Lt(e) {
259
+ return !!e.assigneeMemberId && !!e.originalAssigneeMemberId && e.originalAssigneeMemberId !== e.assigneeMemberId && Dt(e.delegationChainJson).length > 0;
260
260
  }
261
- function Rt(e, t) {
262
- return t ? e.assigneeMemberId === t || (e.openCandidateMemberIds ?? e.candidateMemberIds).includes(t) : !1;
261
+ function Rt(e, t = /* @__PURE__ */ new Map()) {
262
+ if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => q(e, t)).join("、")}` : "未指定";
263
+ let n = q(e.assigneeMemberId, t);
264
+ return Lt(e) ? `${n}(原:${q(e.originalAssigneeMemberId, t)})` : n;
263
265
  }
264
266
  function zt(e, t) {
265
- let n = e.filter((e) => Rt(e, t) && (e.status === "PENDING" || e.status === "IN_PROGRESS"));
266
- return n.find((e) => !e.isAdhoc) ?? n[0] ?? null;
267
+ return t ? e.assigneeMemberId === t || (e.openCandidateMemberIds ?? e.candidateMemberIds).includes(t) : !1;
267
268
  }
268
269
  function Bt(e, t) {
270
+ let n = e.filter((e) => zt(e, t) && (e.status === "PENDING" || e.status === "IN_PROGRESS"));
271
+ return n.find((e) => !e.isAdhoc) ?? n[0] ?? null;
272
+ }
273
+ function J(e, t) {
269
274
  if (t.type !== "userTask" || !t.data.returnBehavior.allowReturn) return [];
270
275
  if (t.data.returnBehavior.allowedTargets === "ANY") {
271
276
  let n = ht(e, t.id);
272
277
  return e.nodes.filter((e) => n.includes(e.id)).map((e) => ({
273
278
  id: e.id,
274
- name: `${e.data.label}(${Ft(e.type)})`
279
+ name: `${e.data.label}(${Pt(e.type)})`
275
280
  }));
276
281
  }
277
282
  let n = t.data.returnBehavior.allowedTargets === "INITIATOR" ? e.nodes.find((e) => e.type === "startEvent")?.id : e.edges.find((e) => e.target === t.id)?.source, r = e.nodes.find((e) => e.id === n);
278
283
  return r ? [{
279
284
  id: r.id,
280
- name: `${r.data.label}(${Ft(r.type)})`
285
+ name: `${r.data.label}(${Pt(r.type)})`
281
286
  }] : [];
282
287
  }
283
288
  function Vt(e) {
@@ -287,7 +292,7 @@ function Vt(e) {
287
292
  name: p(e.name, e.email, "dot")
288
293
  };
289
294
  }
290
- function q({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
295
+ function Ht({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
291
296
  if (t) {
292
297
  let e = n.trim();
293
298
  return e ? {
@@ -312,11 +317,11 @@ function q({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
312
317
  valid: !1
313
318
  };
314
319
  }
315
- function Ht(e) {
320
+ function Ut(e) {
316
321
  return !!e;
317
322
  }
318
- function Ut(e) {
319
- if (!At(e)) return null;
323
+ function Wt(e) {
324
+ if (!kt(e)) return null;
320
325
  let t = e.email, n = e.id, r = e.name;
321
326
  return typeof n == "string" && typeof r == "string" ? {
322
327
  email: typeof t == "string" ? t : null,
@@ -324,7 +329,7 @@ function Ut(e) {
324
329
  name: r
325
330
  } : null;
326
331
  }
327
- function Wt(e, t) {
332
+ function Gt(e, t) {
328
333
  let n = e.trim().toLocaleLowerCase();
329
334
  if (!n) return null;
330
335
  let r = t.filter((e) => [
@@ -334,67 +339,79 @@ function Wt(e, t) {
334
339
  ].some((e) => e.toLocaleLowerCase().includes(n)));
335
340
  return r.length === 1 ? r[0] ?? null : null;
336
341
  }
337
- function J(e) {
338
- return U(e) ? {
342
+ function Y(e) {
343
+ return W(e) ? {
339
344
  text: e,
340
345
  type: "text"
341
346
  } : null;
342
347
  }
343
- function Gt(e, t, n = "neutral") {
344
- return U(t) ? {
348
+ function Kt(e, t, n = "neutral") {
349
+ return W(t) ? {
345
350
  label: e,
346
351
  text: t,
347
352
  tone: n,
348
353
  type: "comment"
349
354
  } : null;
350
355
  }
351
- function Kt(e, t, n, r) {
356
+ function qt(e, t, n, r) {
352
357
  let i = t ? n.get(t) : null;
353
358
  return {
354
359
  email: i?.email ?? null,
355
- label: i?.name ?? r,
360
+ label: i ? It(i, r) : r,
356
361
  memberId: t,
357
362
  prefix: e,
358
363
  type: "member"
359
364
  };
360
365
  }
361
- function Y(e) {
366
+ function X(e, t) {
367
+ let n = e.originalAssigneeMemberId;
368
+ return !n || !Lt(e) ? null : qt("原簽核人", n, t, n);
369
+ }
370
+ function Z(e) {
362
371
  return !!e;
363
372
  }
364
- function qt(e) {
373
+ function Q(e) {
365
374
  let t = e.findIndex((e) => e.id.startsWith("pending-task-") || e.id.startsWith("future-node-"));
366
375
  return t === -1 ? e.length : t;
367
376
  }
368
- function X(e) {
369
- return e.eventType === "INSTANCE_STARTED" || e.eventType === "INSTANCE_CANCELLED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "INSTANCE_RESUBMITTED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED" || e.eventType === "TASK_CANDIDATE_ACTIVATED" || e.eventType === "TASK_REASSIGNED" || Z(e) || Yt(e.eventType, $t(e));
377
+ function Jt(e) {
378
+ return e.eventType === "INSTANCE_STARTED" || e.eventType === "INSTANCE_CANCELLED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "INSTANCE_RESUBMITTED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED" || e.eventType === "TASK_CANDIDATE_ACTIVATED" || e.eventType === "TASK_REASSIGNED" || Yt(e) || Qt(e.eventType, nn(e));
370
379
  }
371
- function Z(e) {
372
- return e.eventType === "TASK_CREATED" && kt($t(e), "sequentialCandidateMemberIds").length > 0;
380
+ function Yt(e) {
381
+ return e.eventType === "TASK_CREATED" && Ot(nn(e), "sequentialCandidateMemberIds").length > 0;
373
382
  }
374
- function Q(e) {
383
+ function Xt(e) {
384
+ if (e.eventType === "TASK_REASSIGNED") {
385
+ let t = nn(e);
386
+ return [
387
+ H(t, "fromMemberId"),
388
+ H(t, "toMemberId"),
389
+ H(t, "actorMemberId")
390
+ ].filter(W);
391
+ }
375
392
  if (e.eventType !== "TASK_CANDIDATE_ACTIVATED" && e.eventType !== "TASK_CREATED") return [];
376
- let t = $t(e);
393
+ let t = nn(e);
377
394
  return [
378
- ...kt(t, "sequentialCandidateMemberIds"),
379
- V(t, "candidateMemberId"),
380
- V(t, "previousMemberId")
381
- ].filter(U);
395
+ ...Ot(t, "sequentialCandidateMemberIds"),
396
+ H(t, "candidateMemberId"),
397
+ H(t, "previousMemberId")
398
+ ].filter(W);
382
399
  }
383
- var Jt = /* @__PURE__ */ new Set([
400
+ var Zt = /* @__PURE__ */ new Set([
384
401
  "SERVICE_TASK_EXECUTED",
385
402
  "SERVICE_TASK_FAILED",
386
403
  "WEBHOOK_DELIVERY_RETRIED"
387
404
  ]);
388
- function Yt(e, t) {
389
- return Jt.has(e) && V(t, "action") === "NOTIFY_WEBHOOK";
405
+ function Qt(e, t) {
406
+ return Zt.has(e) && H(t, "action") === "NOTIFY_WEBHOOK";
390
407
  }
391
- function Xt(e) {
392
- return V(e, "endpointLabel") ?? V(e, "endpointKey") ?? "外部系統";
408
+ function $t(e) {
409
+ return H(e, "endpointLabel") ?? H(e, "endpointKey") ?? "外部系統";
393
410
  }
394
- function Zt(e) {
411
+ function en(e) {
395
412
  return e === "APPROVED" ? "已同意" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "TRANSFERRED" ? "已轉派" : "簽核已決議";
396
413
  }
397
- function Qt(e, t) {
414
+ function tn(e, t) {
398
415
  if (e === "INSTANCE_STARTED") return "案件已發起";
399
416
  if (e === "INSTANCE_CANCELLED") return "案件已取消";
400
417
  if (e === "INSTANCE_EXPIRED") return "案件逾期,已由系統終止";
@@ -404,102 +421,107 @@ function Qt(e, t) {
404
421
  if (e === "TOKEN_ADVANCED") return "流程已前進";
405
422
  if (e === "TASK_CREATED") return "待簽任務已建立";
406
423
  if (e === "TASK_CANDIDATE_ACTIVATED") return "輪到下一位簽核";
407
- if (e === "TASK_DECIDED") return Zt(V(t, "action"));
424
+ if (e === "TASK_DECIDED") return en(H(t, "action"));
408
425
  if (e === "SLA_TRIGGERED") return "時限提醒已觸發";
409
426
  if (e === "TASK_REASSIGNED") return "管理者改派待辦";
410
- if (Yt(e, t)) {
411
- let n = Xt(t);
427
+ if (Qt(e, t)) {
428
+ let n = $t(t);
412
429
  return e === "SERVICE_TASK_EXECUTED" ? `已通知外部系統:${n}` : e === "SERVICE_TASK_FAILED" ? `通知外部系統失敗:${n}` : `管理者重新傳送外部系統通知:${n}`;
413
430
  }
414
431
  return e;
415
432
  }
416
- function $t(e) {
433
+ function nn(e) {
417
434
  try {
418
435
  let t = JSON.parse(e.payloadJson);
419
- return At(t) ? t : {};
436
+ return kt(t) ? t : {};
420
437
  } catch {
421
438
  return {};
422
439
  }
423
440
  }
424
- function en(e, t) {
425
- return e.eventType === "SLA_TRIGGERED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "SERVICE_TASK_FAILED" && Yt(e.eventType, t) || V(t, "action") === "REJECTED" || V(t, "instanceState") === "REJECTED";
441
+ function rn(e, t) {
442
+ return e.eventType === "SLA_TRIGGERED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "SERVICE_TASK_FAILED" && Qt(e.eventType, t) || H(t, "action") === "REJECTED" || H(t, "instanceState") === "REJECTED";
426
443
  }
427
- function tn(e) {
444
+ function an(e) {
428
445
  return t(e);
429
446
  }
430
- function nn(e, t, n, r) {
431
- if (e.eventType === "INSTANCE_STARTED") return Et({
447
+ function on(e, t) {
448
+ let n = H(e, "fromMemberId"), r = H(e, "toMemberId"), i = H(e, "reason"), a = e.assigneeChanged === !1 ? "原座位" : "原簽核人", o = i?.trim();
449
+ return [[n ? `${a}:${q(n, t)}` : null, r ? `改派給:${q(r, t)}` : null].filter(W).join(" → "), o ? `原因:${o}` : null].filter(W).join(" · ") || null;
450
+ }
451
+ function sn(e, t, n, r) {
452
+ if (e.eventType === "INSTANCE_STARTED") return Tt({
432
453
  initiatorMemberId: e.actorMemberId,
433
- submittedByMemberId: V(t, "submittedByMemberId")
454
+ submittedByMemberId: H(t, "submittedByMemberId")
434
455
  }, r);
456
+ if (e.eventType === "TASK_REASSIGNED") return on(t, r);
435
457
  if (e.eventType === "TASK_CANDIDATE_ACTIVATED") {
436
- let e = V(t, "candidateMemberId"), n = V(t, "previousMemberId");
458
+ let e = H(t, "candidateMemberId"), n = H(t, "previousMemberId");
437
459
  if (!e) return null;
438
- let i = K(e, r);
439
- return n ? `輪到:${i}(前一位:${K(n, r)})` : `輪到:${i}`;
460
+ let i = q(e, r);
461
+ return n ? `輪到:${i}(前一位:${q(n, r)})` : `輪到:${i}`;
440
462
  }
441
463
  if (e.eventType === "TASK_CREATED") {
442
- let e = kt(t, "sequentialCandidateMemberIds");
443
- if (e.length) return `簽核順序:${e.map((e) => K(e, r)).join(" → ")}`;
444
- let n = V(t, "assigneeMemberId"), i = V(t, "originalAssigneeMemberId");
464
+ let e = Ot(t, "sequentialCandidateMemberIds");
465
+ if (e.length) return `簽核順序:${e.map((e) => q(e, r)).join(" → ")}`;
466
+ let n = H(t, "assigneeMemberId"), i = H(t, "originalAssigneeMemberId");
445
467
  if (!n) {
446
- let e = kt(t, "candidateMemberIds");
447
- return e.length ? `候選簽核人:${e.map((e) => K(e, r)).join("、")}` : null;
468
+ let e = Ot(t, "candidateMemberIds");
469
+ return e.length ? `候選簽核人:${e.map((e) => q(e, r)).join("、")}` : null;
448
470
  }
449
- let a = K(n, r), o = K(i, r);
471
+ let a = q(n, r), o = q(i, r);
450
472
  return i && i !== n ? `待簽人:${a}(原簽核人:${o})` : `待簽人:${a}`;
451
473
  }
452
474
  if (e.eventType === "TASK_DECIDED") {
453
- let e = V(t, "action"), n = V(t, "comment"), i = e ? `決議:${Pt(e)}` : null, a = V(t, "transferToMemberId");
454
- return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(U).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(U).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${K(a, r)}`].filter(U).join(" · ") : i;
475
+ let e = H(t, "action"), n = H(t, "comment"), i = e ? `決議:${Nt(e)}` : null, a = H(t, "transferToMemberId");
476
+ return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(W).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(W).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${q(a, r)}`].filter(W).join(" · ") : i;
455
477
  }
456
478
  if (e.eventType === "TOKEN_ADVANCED") {
457
- let e = V(t, "action");
458
- if (e) return `流程結果:${Pt(e)}`;
459
- let r = H(t, "arrivedCount"), i = H(t, "requiredCount");
479
+ let e = H(t, "action");
480
+ if (e) return `流程結果:${Nt(e)}`;
481
+ let r = U(t, "arrivedCount"), i = U(t, "requiredCount");
460
482
  if (r !== null && i !== null) return `等待匯合:${r}/${i}`;
461
- let a = V(t, "fromNodeId"), o = V(t, "toNodeId");
462
- if (a && o) return `由 ${It(a, n)} 前進至 ${It(o, n)}`;
483
+ let a = H(t, "fromNodeId"), o = H(t, "toNodeId");
484
+ if (a && o) return `由 ${Ft(a, n)} 前進至 ${Ft(o, n)}`;
463
485
  }
464
486
  if (e.eventType === "ENGINE_PROCESS_REQUESTED") {
465
- let e = V(t, "state");
466
- return e ? `案件狀態:${Nt(e)}` : null;
487
+ let e = H(t, "state");
488
+ return e ? `案件狀態:${Mt(e)}` : null;
467
489
  }
468
490
  return null;
469
491
  }
470
- function rn(e, t, n, r, i, a, o, s = null, c = null) {
471
- if (e.eventType === "INSTANCE_RESUBMITTED") return [Gt("簽核意見", V(t, "comment"))].filter(Y);
472
- if (e.eventType !== "TASK_DECIDED") return [J(nn(e, t, n, o))].filter(Y);
473
- let l = an(e, t, r, c), u = V(t, "action") ?? l?.action ?? null, d = V(t, "comment") ?? l?.comment ?? null, f = V(t, "transferToMemberId") ?? l?.transferToMemberId ?? null, p = V(t, "signatureId") ?? l?.signatureId ?? null, m = p ? i.get(p) : null;
492
+ function cn(e, t, n, r, i, a, o, s = null, c = null) {
493
+ if (e.eventType === "INSTANCE_RESUBMITTED") return [Kt("簽核意見", H(t, "comment"))].filter(Z);
494
+ if (e.eventType !== "TASK_DECIDED") return [Y(sn(e, t, n, o))].filter(Z);
495
+ let l = ln(e, t, r, c), u = H(t, "action") ?? l?.action ?? null, d = H(t, "comment") ?? l?.comment ?? null, f = H(t, "transferToMemberId") ?? l?.transferToMemberId ?? null, p = H(t, "signatureId") ?? l?.signatureId ?? null, m = p ? i.get(p) : null;
474
496
  return [
475
- J(u ? `決議:${Pt(u)}` : null),
476
- u === "REJECTED" ? Gt("拒絕原因", d ?? "-", "danger") : null,
477
- u === "APPROVED" ? Gt("同意說明", d) : null,
478
- u === "RETURNED" ? Gt("退回說明", d ?? "-") : null,
479
- u === "TRANSFERRED" ? J(`轉派給:${K(f, o)}`) : null,
480
- u === "TRANSFERRED" ? Gt("轉派說明", d ?? "-") : null,
481
- J(sn(t, s)),
482
- m ? J(a?.valid ? `簽章:已驗證(${W(m.signedPayloadHash)})` : `簽章:待檢查(${W(m.signedPayloadHash)})`) : null
483
- ].filter(Y);
484
- }
485
- function an(e, t, n, r) {
497
+ Y(u ? `決議:${Nt(u)}` : null),
498
+ u === "REJECTED" ? Kt("拒絕原因", d ?? "-", "danger") : null,
499
+ u === "APPROVED" ? Kt("同意說明", d) : null,
500
+ u === "RETURNED" ? Kt("退回說明", d ?? "-") : null,
501
+ u === "TRANSFERRED" ? Y(`轉派給:${q(f, o)}`) : null,
502
+ u === "TRANSFERRED" ? Kt("轉派說明", d ?? "-") : null,
503
+ Y(dn(t, s)),
504
+ m ? Y(a?.valid ? `簽章:已驗證(${G(m.signedPayloadHash)})` : `簽章:待檢查(${G(m.signedPayloadHash)})`) : null
505
+ ].filter(Z);
506
+ }
507
+ function ln(e, t, n, r) {
486
508
  let i = e.taskId;
487
509
  if (!i) return null;
488
- let a = V(t, "decisionId"), o = (t) => a ? t.id === a : t.decidedByMemberId === e.actorMemberId;
510
+ let a = H(t, "decisionId"), o = (t) => a ? t.id === a : t.decidedByMemberId === e.actorMemberId;
489
511
  if (!r) {
490
512
  let e = n.get(i) ?? null;
491
513
  return e && o(e) ? e : null;
492
514
  }
493
- return on(r.filter((e) => e.taskId === i && o(e)), new Date(e.createdAt).getTime());
515
+ return un(r.filter((e) => e.taskId === i && o(e)), new Date(e.createdAt).getTime());
494
516
  }
495
- function on(e, t) {
517
+ function un(e, t) {
496
518
  let n = (e) => Math.abs(d(e) - t), r = (e, t) => {
497
519
  let r = n(e) - n(t);
498
520
  return r < 0 || !(r > 0) && f(e, t) < 0;
499
521
  };
500
522
  return e.reduce((e, t) => !e || r(t, e) ? t : e, null);
501
523
  }
502
- function sn(e, t) {
524
+ function dn(e, t) {
503
525
  let n = e.changedFieldKeys;
504
526
  if (!Array.isArray(n)) return null;
505
527
  let r = n.filter((e) => typeof e == "string" && e !== "");
@@ -507,86 +529,87 @@ function sn(e, t) {
507
529
  let i = r.map((e) => t?.fields.find((t) => t.fieldKey === e)?.label || e);
508
530
  return `補填 ${r.length} 個欄位:${i.join("、")}`;
509
531
  }
510
- function cn(e, t, n, r, i) {
532
+ function fn(e, t, n, r, i) {
511
533
  if (e.type === "startEvent" || i.has(e.id)) return !1;
512
534
  if (r === "REJECTED") return !0;
513
- let a = vn(e, t, n, r);
535
+ let a = xn(e, t, n, r);
514
536
  return a.tone === "neutral" || a.tone === "waiting";
515
537
  }
516
- function ln(e, t, n, r, i) {
538
+ function pn(e, t, n, r, i) {
517
539
  if (r !== "RUNNING" && r !== "REJECTED") return [];
518
- let a = e.nodes.filter((e) => cn(e, t, n, r, i)), o = un(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
540
+ let a = e.nodes.filter((e) => fn(e, t, n, r, i)), o = mn(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
519
541
  return a.filter((e) => o.has(e.id)).sort((e, t) => {
520
542
  let n = o.get(e.id) ?? 0, r = o.get(t.id) ?? 0;
521
543
  return n === r ? e.position.x === t.position.x ? e.position.y === t.position.y ? (s.get(e.id) ?? 0) - (s.get(t.id) ?? 0) : e.position.y - t.position.y : e.position.x - t.position.x : n - r;
522
544
  });
523
545
  }
524
- function un(e, t, n, r, i) {
546
+ function mn(e, t, n, r, i) {
525
547
  let a = new Set(t.map((e) => e.id)), o = e.edges.reduce((e, t) => {
526
548
  let n = [...e.get(t.source) ?? [], t.target];
527
549
  return new Map(e).set(t.source, n);
528
550
  }, /* @__PURE__ */ new Map());
529
- return dn(e, n, r, i).reduce((e, t) => mn(e, fn(t, o, a)), /* @__PURE__ */ new Map());
551
+ return hn(e, n, r, i).reduce((e, t) => vn(e, gn(t, o, a)), /* @__PURE__ */ new Map());
530
552
  }
531
- function dn(e, t, n, r) {
532
- let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(jt).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [.../* @__PURE__ */ new Set([
553
+ function hn(e, t, n, r) {
554
+ let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(At).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [.../* @__PURE__ */ new Set([
533
555
  ...i,
534
556
  ...a,
535
557
  ...o
536
558
  ])], c = e.nodes.filter((e) => e.type === "startEvent").map((e) => e.id);
537
559
  return s.length > 0 ? s : c;
538
560
  }
539
- function fn(e, t, n) {
540
- return pn([{
561
+ function gn(e, t, n) {
562
+ return _n([{
541
563
  distance: 0,
542
564
  nodeId: e
543
565
  }], t, n);
544
566
  }
545
- function pn(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
567
+ function _n(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
546
568
  let [a, ...o] = e;
547
569
  if (!a) return i;
548
- if (r.has(a.nodeId)) return pn(o, t, n, r, i);
570
+ if (r.has(a.nodeId)) return _n(o, t, n, r, i);
549
571
  let s = new Set(r).add(a.nodeId), c = n.has(a.nodeId) ? new Map(i).set(a.nodeId, Math.min(i.get(a.nodeId) ?? a.distance, a.distance)) : i;
550
- return pn([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
572
+ return _n([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
551
573
  distance: a.distance + 1,
552
574
  nodeId: e
553
575
  }))], t, n, s, c);
554
576
  }
555
- function mn(e, t) {
577
+ function vn(e, t) {
556
578
  return [...t.entries()].reduce((e, [t, n]) => new Map(e).set(t, Math.min(e.get(t) ?? n, n)), e);
557
579
  }
558
- function hn(e) {
580
+ function yn(e) {
559
581
  return e.type === "userTask" ? `未來簽核:${e.data.label}` : e.type === "serviceTask" ? `未來知會:${e.data.label}` : e.type === "exclusiveGateway" ? `未來分流:${e.data.label}` : e.type === "parallelGateway" ? `未來匯合:${e.data.label}` : e.type === "endEvent" ? `流程完成:${e.data.label}` : `未來節點:${e.data.label}`;
560
582
  }
561
- function gn(e, t, n, r, i, a, o, s, c, u = null, d = null) {
562
- let f = d ? l(d) : null, p = e.filter(X).map((e) => {
563
- let t = $t(e), n = e.nodeId ? It(e.nodeId, r) : null;
583
+ function $(e, t, n, r, i, a, o, s, c, u = null, d = null) {
584
+ let f = d ? l(d) : null, p = e.filter(Jt).map((e) => {
585
+ let t = nn(e), n = e.nodeId ? Ft(e.nodeId, r) : null;
564
586
  return {
565
587
  descriptionParts: [
566
- J(n ? `節點:${n}` : "節點:全流程"),
567
- Kt("操作者", e.actorMemberId, a, "系統"),
568
- J(`時間:${tn(e.createdAt)}`),
569
- ...rn(e, t, r, o, s, c, a, u, f ? f.get(e.taskId ?? "") ?? [] : null)
570
- ].filter(Y),
571
- error: en(e, t),
588
+ Y(n ? `節點:${n}` : "節點:全流程"),
589
+ qt("操作者", e.actorMemberId, a, "系統"),
590
+ Y(`時間:${an(e.createdAt)}`),
591
+ ...cn(e, t, r, o, s, c, a, u, f ? f.get(e.taskId ?? "") ?? [] : null)
592
+ ].filter(Z),
593
+ error: rn(e, t),
572
594
  id: e.id,
573
- title: Qt(e.eventType, t)
595
+ title: tn(e.eventType, t)
574
596
  };
575
- }), m = t.filter(jt).map((e) => ({
597
+ }), m = t.filter(At).map((e) => ({
576
598
  descriptionParts: [
577
- J(`節點:${It(e.nodeId, r)}`),
578
- Kt("處理者", e.assigneeMemberId, a, "未指定"),
579
- J(`建立時間:${tn(e.createdAt)}`)
580
- ].filter(Y),
599
+ Y(`節點:${Ft(e.nodeId, r)}`),
600
+ qt("處理者", e.assigneeMemberId, a, "未指定"),
601
+ X(e, a),
602
+ Y(`建立時間:${an(e.createdAt)}`)
603
+ ].filter(Z),
581
604
  error: !1,
582
605
  id: `pending-task-${e.id}`,
583
606
  title: e.status === "IN_PROGRESS" ? "簽核處理中" : "等待簽核處理"
584
- })), h = new Set([...e.filter(X).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(U)), g = r ? ln(r, t, n, i, h).map((e) => ({
585
- descriptionParts: [J(`${Ft(e.type)} · 尚未抵達`)].filter(Y),
607
+ })), h = new Set([...e.filter(Jt).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(W)), g = r ? pn(r, t, n, i, h).map((e) => ({
608
+ descriptionParts: [Y(`${Pt(e.type)} · 尚未抵達`)].filter(Z),
586
609
  error: !1,
587
610
  forcePending: !0,
588
611
  id: `future-node-${e.id}`,
589
- title: hn(e)
612
+ title: yn(e)
590
613
  })) : [];
591
614
  return [
592
615
  ...p,
@@ -594,7 +617,7 @@ function gn(e, t, n, r, i, a, o, s, c, u = null, d = null) {
594
617
  ...g
595
618
  ];
596
619
  }
597
- var _n = {
620
+ var bn = {
598
621
  APPROVED: {
599
622
  statusLabel: "已完成",
600
623
  tone: "completed"
@@ -612,20 +635,20 @@ var _n = {
612
635
  tone: "cancelled"
613
636
  }
614
637
  };
615
- function vn(e, t, n, r) {
638
+ function xn(e, t, n, r) {
616
639
  let i = t.filter((t) => t.nodeId === e.id), a = i.find((e) => e.status === "PENDING" || e.status === "IN_PROGRESS"), o = i.find((e) => e.status === "CANCELLED"), s = i.find((e) => e.status === "COMPLETED"), c = n.filter((t) => t.currentNodeId === e.id), l = c.find((e) => e.status === "ACTIVE"), u = c.find((e) => e.status === "WAITING");
617
640
  if (a) return {
618
- secondaryLabel: `處理者 ${Lt(a)}`,
641
+ secondaryLabel: `處理者 ${Rt(a)}`,
619
642
  statusLabel: "待處理",
620
643
  tone: "current"
621
644
  };
622
645
  if (o) return {
623
- secondaryLabel: `已取消 ${Lt(o)}`,
646
+ secondaryLabel: `已取消 ${Rt(o)}`,
624
647
  statusLabel: "已取消",
625
648
  tone: "cancelled"
626
649
  };
627
650
  if (s) return {
628
- secondaryLabel: `已完成 ${Lt(s)}`,
651
+ secondaryLabel: `已完成 ${Rt(s)}`,
629
652
  statusLabel: "已完成",
630
653
  tone: "completed"
631
654
  };
@@ -644,48 +667,48 @@ function vn(e, t, n, r) {
644
667
  statusLabel: "已發起",
645
668
  tone: "completed"
646
669
  };
647
- let d = e.type === "endEvent" ? _n[r] : void 0;
670
+ let d = e.type === "endEvent" ? bn[r] : void 0;
648
671
  return d ? {
649
672
  ...d,
650
673
  secondaryLabel: r
651
674
  } : {
652
- secondaryLabel: Ft(e.type),
675
+ secondaryLabel: Pt(e.type),
653
676
  statusLabel: "未抵達",
654
677
  tone: "neutral"
655
678
  };
656
679
  }
657
680
  // src/views/instances/detail/sections/container-helpers.ts
658
- async function yn({ activityLogs: e, adhocDirectives: t = [], instance: n, tasks: r }) {
681
+ async function Sn({ activityLogs: e, adhocDirectives: t = [], instance: n, tasks: r }) {
659
682
  let i = [...new Set([
660
683
  n?.initiatorMemberId ?? null,
661
684
  n?.submittedByMemberId ?? null,
662
685
  ...e.map((e) => e.actorMemberId),
663
- ...e.flatMap(Q),
686
+ ...e.flatMap(Xt),
664
687
  ...r.map((e) => e.assigneeMemberId),
665
688
  ...r.map((e) => e.originalAssigneeMemberId),
666
689
  ...r.flatMap((e) => e.candidateMemberIds),
667
- ...r.flatMap((e) => Ot(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
668
- ...t.flatMap((e) => [e.createdByMemberId, ...bn(e.targetValueJson)])
669
- ].filter(U))];
690
+ ...r.flatMap((e) => Dt(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
691
+ ...t.flatMap((e) => [e.createdByMemberId, ...Cn(e.targetValueJson)])
692
+ ].filter(W))];
670
693
  try {
671
694
  return await Be(i);
672
695
  } catch {
673
696
  return [];
674
697
  }
675
698
  }
676
- function bn(e) {
699
+ function Cn(e) {
677
700
  try {
678
701
  return (JSON.parse(e).memberIds ?? []).filter((e) => typeof e == "string");
679
702
  } catch {
680
703
  return [];
681
704
  }
682
705
  }
683
- async function xn(e) {
706
+ async function wn(e) {
684
707
  return (await Promise.all(e.map((e) => Me(e.id)))).flat();
685
708
  }
686
709
  // src/views/instances/detail/use-resubmit-comment-draft.ts
687
- function Sn(e) {
688
- let [t, n] = S({
710
+ function Tn(e) {
711
+ let [t, n] = x({
689
712
  instanceId: e,
690
713
  text: ""
691
714
  }), r = ce((t) => n({
@@ -702,50 +725,50 @@ function Sn(e) {
702
725
  };
703
726
  }
704
727
  // src/views/instances/detail/sections/InstanceFormSection.tsx
705
- var $ = {
728
+ var En = {
706
729
  display: "grid",
707
730
  gap: 16
708
- }, Cn = {
731
+ }, Dn = {
709
732
  display: "flex",
710
733
  flexWrap: "wrap",
711
734
  gap: 8
712
- }, wn = 2e3, Tn = {
735
+ }, On = 2e3, kn = {
713
736
  minWidth: "100%",
714
737
  width: "100%"
715
738
  };
716
- function En(e) {
739
+ function An(e) {
717
740
  e && (e.style.width = "100%");
718
741
  }
719
- function Dn({ attachments: t, canResubmitInstance: n, deciding: r, error: i, fieldAccess: a, fieldLabelMarkers: o, fill: c = null, instance: l, loading: u, onDataSourceStateChange: d, onDownloadAttachment: f, onFileUploadStateChange: p, onResubmitFormChange: m, onReloadAfterConflict: h = null, onResubmitCommentChange: g = null, onResubmitInstance: ee, onUploadAttachment: te, resubmitComment: ne = "", resubmitFormData: re, resubmitFormErrors: ie }) {
720
- let oe = l?.formDefinitionSnapshot.schema, _ = l?.workflowSnapshot, se = x(() => n && oe && _ ? ae(oe, _) : c?.schema ?? oe, [
742
+ function jn({ attachments: t, canResubmitInstance: n, deciding: r, error: i, fieldAccess: a, fieldLabelMarkers: o, fill: c = null, instance: l, loading: u, onDataSourceStateChange: d, onDownloadAttachment: f, onFileUploadStateChange: p, onResubmitFormChange: m, onReloadAfterConflict: h = null, onResubmitCommentChange: g = null, onResubmitInstance: ee, onUploadAttachment: te, resubmitComment: ne = "", resubmitFormData: re, resubmitFormErrors: ie }) {
743
+ let oe = l?.formDefinitionSnapshot.schema, _ = l?.workflowSnapshot, v = b(() => n && oe && _ ? ae(oe, _) : c?.schema ?? oe, [
721
744
  n,
722
745
  c?.schema,
723
746
  oe,
724
747
  _
725
- ]), v = !n && c !== null;
748
+ ]), se = !n && c !== null;
726
749
  return /* @__PURE__ */ k("div", {
727
- style: $,
750
+ style: En,
728
751
  children: [
729
- i ? /* @__PURE__ */ O(D, {
752
+ i ? /* @__PURE__ */ O(E, {
730
753
  color: "text-error",
731
754
  variant: "body",
732
755
  children: i
733
756
  }) : null,
734
- u ? /* @__PURE__ */ O(D, {
757
+ u ? /* @__PURE__ */ O(E, {
735
758
  color: "text-neutral",
736
759
  variant: "body",
737
760
  children: "載入中..."
738
761
  }) : null,
739
762
  h ? /* @__PURE__ */ k("div", {
740
- style: $,
741
- children: [/* @__PURE__ */ O(me, {
763
+ style: En,
764
+ children: [/* @__PURE__ */ O(he, {
742
765
  content: "表單在你填寫期間被更新了,你填的內容還在。請重新載入後確認再同意。",
743
766
  severity: "error"
744
767
  }), /* @__PURE__ */ O("div", {
745
- style: Cn,
746
- children: /* @__PURE__ */ O(C, {
768
+ style: Dn,
769
+ children: /* @__PURE__ */ O(S, {
747
770
  disabled: u,
748
- icon: rt,
771
+ icon: it,
749
772
  iconType: "leading",
750
773
  onClick: h,
751
774
  variant: "base-secondary",
@@ -753,11 +776,11 @@ function Dn({ attachments: t, canResubmitInstance: n, deciding: r, error: i, fie
753
776
  })
754
777
  })]
755
778
  }) : null,
756
- v && c.fieldCount > 0 ? /* @__PURE__ */ O(me, {
779
+ se && c.fieldCount > 0 ? /* @__PURE__ */ O(he, {
757
780
  content: `本關需要你補填 ${c.fieldCount} 個欄位,按「同意」時會一起送出並納入簽章。`,
758
781
  severity: "info"
759
782
  }) : null,
760
- se && l?.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ k(Te, { children: [
783
+ v && l?.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ k(D, { children: [
761
784
  /* @__PURE__ */ O(s, {
762
785
  attachments: t,
763
786
  dataSourceContext: n ? {
@@ -765,11 +788,11 @@ function Dn({ attachments: t, canResubmitInstance: n, deciding: r, error: i, fie
765
788
  kind: "runtime"
766
789
  } : void 0,
767
790
  dataSourceInitialValues: l.formData,
768
- errors: v ? c.errors : ie,
791
+ errors: se ? c.errors : ie,
769
792
  ...!n && a ? { fieldAccess: a } : {},
770
793
  ...!n && o ? { fieldLabelMarkers: o } : {},
771
794
  onChange: (e) => {
772
- v ? c.onChange(e) : m(e);
795
+ se ? c.onChange(e) : m(e);
773
796
  },
774
797
  onDataSourceStateChange: d,
775
798
  onDownloadAttachment: f,
@@ -777,37 +800,37 @@ function Dn({ attachments: t, canResubmitInstance: n, deciding: r, error: i, fie
777
800
  onUploadAttachment: n ? te : void 0,
778
801
  optionSnapshots: l.formDataOptionSnapshot,
779
802
  readonly: !n,
780
- schema: se,
803
+ schema: v,
781
804
  uiSchema: l.formDefinitionSnapshot.uiSchema,
782
- value: n ? re : v ? c.value : l.formData
805
+ value: n ? re : se ? c.value : l.formData
783
806
  }),
784
807
  n && g ? /* @__PURE__ */ O(e, {
785
808
  label: "簽核意見",
786
809
  name: "resubmitComment",
787
- children: /* @__PURE__ */ O(Se, {
810
+ children: /* @__PURE__ */ O(Ce, {
788
811
  disabled: r,
789
812
  onChange: (e) => g(e.target.value),
790
813
  placeholder: "選填,例如說明這次補正或修改了哪些內容",
791
- maxLength: wn,
792
- ref: En,
814
+ maxLength: On,
815
+ ref: An,
793
816
  resize: "vertical",
794
817
  rows: 4,
795
- style: Tn,
818
+ style: kn,
796
819
  value: ne
797
820
  })
798
821
  }) : null,
799
822
  n ? /* @__PURE__ */ O("div", {
800
- style: Cn,
801
- children: /* @__PURE__ */ O(C, {
823
+ style: Dn,
824
+ children: /* @__PURE__ */ O(S, {
802
825
  disabled: r,
803
- icon: rt,
826
+ icon: it,
804
827
  iconType: "leading",
805
828
  onClick: ee,
806
829
  variant: "base-primary",
807
830
  children: "重新送出"
808
831
  })
809
832
  }) : null
810
- ] }) : /* @__PURE__ */ O(D, {
833
+ ] }) : /* @__PURE__ */ O(E, {
811
834
  color: "text-neutral",
812
835
  variant: "body",
813
836
  children: "此案件沒有可顯示的表單快照。"
@@ -816,20 +839,20 @@ function Dn({ attachments: t, canResubmitInstance: n, deciding: r, error: i, fie
816
839
  });
817
840
  }
818
841
  // src/views/instances/detail/sections/InstanceAttachmentsSection.tsx
819
- var On = {
842
+ var Mn = {
820
843
  display: "grid",
821
844
  gap: 16
822
845
  };
823
- function kn({ attachments: e, onDownload: n, onPreview: r }) {
824
- let i = x(() => e.map((e) => ({
846
+ function Nn({ attachments: e, onDownload: n, onPreview: r }) {
847
+ let i = b(() => e.map((e) => ({
825
848
  attachment: e,
826
849
  createdAt: e.createdAt,
827
850
  filename: e.filename,
828
851
  id: e.id,
829
852
  key: e.id,
830
853
  mimeType: e.mimeType,
831
- sizeLabel: Mt(Number(e.sizeBytes))
832
- })), [e]), a = x(() => [
854
+ sizeLabel: jt(Number(e.sizeBytes))
855
+ })), [e]), a = b(() => [
833
856
  {
834
857
  dataIndex: "filename",
835
858
  key: "filename",
@@ -850,7 +873,7 @@ function kn({ attachments: e, onDownload: n, onPreview: r }) {
850
873
  },
851
874
  {
852
875
  key: "createdAt",
853
- render: (e) => /* @__PURE__ */ O(D, {
876
+ render: (e) => /* @__PURE__ */ O(E, {
854
877
  component: "span",
855
878
  variant: "body",
856
879
  children: t(e.createdAt)
@@ -858,16 +881,16 @@ function kn({ attachments: e, onDownload: n, onPreview: r }) {
858
881
  title: "上傳時間",
859
882
  width: 220
860
883
  }
861
- ], []), o = x(() => ({
884
+ ], []), o = b(() => ({
862
885
  render: (e) => [...e.mimeType === "application/pdf" ? [{
863
- icon: et,
886
+ icon: tt,
864
887
  iconType: "leading",
865
888
  name: "預覽",
866
889
  onClick: () => {
867
890
  r(e.attachment);
868
891
  }
869
892
  }] : [], {
870
- icon: P,
893
+ icon: N,
871
894
  iconType: "leading",
872
895
  name: "下載",
873
896
  onClick: () => {
@@ -878,17 +901,17 @@ function kn({ attachments: e, onDownload: n, onPreview: r }) {
878
901
  width: 160
879
902
  }), [n, r]);
880
903
  return /* @__PURE__ */ k("div", {
881
- style: On,
882
- children: [/* @__PURE__ */ O(D, {
904
+ style: Mn,
905
+ children: [/* @__PURE__ */ O(E, {
883
906
  component: "h2",
884
907
  variant: "h3",
885
908
  children: "附件"
886
- }), i.length > 0 ? /* @__PURE__ */ O(xe, {
909
+ }), i.length > 0 ? /* @__PURE__ */ O(Se, {
887
910
  actions: o,
888
911
  columns: a,
889
912
  dataSource: i,
890
913
  fullWidth: !0
891
- }) : /* @__PURE__ */ O(D, {
914
+ }) : /* @__PURE__ */ O(E, {
892
915
  color: "text-neutral",
893
916
  variant: "body",
894
917
  children: "此案件沒有附件。"
@@ -896,63 +919,63 @@ function kn({ attachments: e, onDownload: n, onPreview: r }) {
896
919
  });
897
920
  }
898
921
  // src/views/instances/detail/sections/InstanceTasksSection.tsx
899
- var An = {
922
+ var Pn = {
900
923
  display: "grid",
901
924
  gap: 12,
902
925
  width: "100%"
903
- }, jn = {
926
+ }, Fn = {
904
927
  minWidth: "100%",
905
928
  width: "100%"
906
- }, Mn = {
929
+ }, In = {
907
930
  display: "grid",
908
931
  gap: 12,
909
932
  width: "100%"
910
- }, Nn = { marginTop: 12 }, Pn = { marginTop: 24 };
911
- function Fn(e) {
933
+ }, Ln = { marginTop: 12 }, Rn = { marginTop: 24 };
934
+ function zn(e) {
912
935
  e && (e.style.width = "100%");
913
936
  }
914
- var In = {
937
+ var Bn = {
915
938
  COMPLETION_NOTIFY: "結案通知",
916
939
  COUNTERSIGN: "臨時會簽",
917
940
  PRE_APPROVAL: "臨時加簽",
918
941
  STAGE_NOTIFY: "階段完成通知"
919
- }, Ln = {
942
+ }, Vn = {
920
943
  COMPLETION_NOTIFY: "本張單到達結案狀態(核准 / 拒絕 / 取消)後,通知指定對象。",
921
944
  COUNTERSIGN: "指定對象會併入下一層簽核,下一層需所有人都完成才會繼續。",
922
945
  PRE_APPROVAL: "指定對象需先完成加簽,本階段才會往下一層繼續。",
923
946
  STAGE_NOTIFY: "本階段完成後(不論通過與否)通知指定對象。"
924
- }, Rn = [{
947
+ }, Hn = [{
925
948
  id: "REJECT_INSTANCE",
926
949
  name: "加簽拒絕時整單駁回"
927
950
  }, {
928
951
  id: "RETURN_TO_ORIGIN",
929
952
  name: "加簽拒絕時退回給我重新處理"
930
- }], zn = [{
953
+ }], Un = [{
931
954
  id: "MEMBER",
932
955
  name: "指定成員"
933
956
  }, {
934
957
  id: "WEBHOOK",
935
958
  name: "Webhook"
936
- }], Bn = y(function({ adhocDirectives: n, currentMemberId: r, fill: i = null, instance: a, memberProfilesById: o, onChanged: s, onDecidingChange: c, onFillApproveError: l, tasks: d }, f) {
937
- let [p, m] = S(!1), [h, g] = S(null);
938
- b(() => {
959
+ }], Wn = y(function({ adhocDirectives: n, currentMemberId: r, fill: i = null, instance: a, memberProfilesById: o, onChanged: s, onDecidingChange: c, onFillApproveError: l, tasks: d }, f) {
960
+ let [p, m] = x(!1), [h, g] = x(null);
961
+ le(() => {
939
962
  c?.(p);
940
963
  }, [p, c]);
941
- let [ee, te] = S(""), [ne, re] = S(!1), [ie, ae] = S(""), [oe, se] = S(null), [v, y] = S(!1), [ce, ue] = S(""), [me, ge] = S(!1), [_e, E] = S(null), [ve, be] = S(""), [Ce, De] = S(null), [Ae, je] = S(!1), [Me, Ne] = S([]), [Pe, Fe] = S(!1), [Ie, Le] = S(""), [Be, Ve] = S([]), [He, We] = S(!1), [Ge, Ke] = S([]), [qe, j] = S(!1), [M, Je] = S("COUNTERSIGN"), [Ye, Xe] = S("REJECT_INSTANCE"), [Ze, Qe] = S(!1), [N, $e] = S("MEMBER"), [P, et] = S(""), tt = ie.trim(), nt = ce.trim(), rt = ve.trim(), F = x(() => zt(d, r), [r, d]), I = x(() => F && a ? a.workflowSnapshot.nodes.find((e) => e.id === F.nodeId) ?? null : null, [F, a]), it = x(() => I && a ? Bt(a.workflowSnapshot, I) : [], [I, a]), at = I?.type === "userTask" && I.data.returnBehavior.allowReturn, ot = I?.type === "userTask" && I.data.allowReject !== !1, st = I?.type === "userTask" && I.data.allowTransfer !== !1, ct = I?.type === "userTask" && I.data.returnBehavior.requireComment === !0, lt = I?.type === "userTask" && I.data.allowAddSigner, ut = x(() => n.filter((e) => e.status === "PENDING"), [n]), L = it.find((e) => e.id === _e) ?? it[0] ?? null, dt = x(() => d.map((e) => ({
964
+ let [ee, te] = x(""), [ne, re] = x(!1), [ie, ae] = x(""), [oe, v] = x(null), [se, y] = x(!1), [ce, de] = x(""), [he, _e] = x(!1), [ve, T] = x(null), [ye, xe] = x(""), [we, De] = x(null), [Ae, je] = x(!1), [Me, Ne] = x([]), [Pe, Fe] = x(!1), [Ie, Le] = x(""), [Be, Ve] = x([]), [He, We] = x(!1), [Ge, Ke] = x([]), [j, qe] = x(!1), [M, Je] = x("COUNTERSIGN"), [Ye, Xe] = x("REJECT_INSTANCE"), [Ze, Qe] = x(!1), [$e, et] = x("MEMBER"), [N, tt] = x(""), nt = ie.trim(), rt = ee.trim(), it = ce.trim(), at = ye.trim(), P = b(() => Bt(d, r), [r, d]), F = b(() => P && a ? a.workflowSnapshot.nodes.find((e) => e.id === P.nodeId) ?? null : null, [P, a]), ot = b(() => F && a ? J(a.workflowSnapshot, F) : [], [F, a]), st = F?.type === "userTask" && F.data.returnBehavior.allowReturn, ct = F?.type === "userTask" && F.data.allowReject !== !1, lt = F?.type === "userTask" && F.data.allowTransfer !== !1, ut = F?.type === "userTask" && F.data.returnBehavior.requireComment === !0, I = F?.type === "userTask" && F.data.requireApprovalComment === !0, L = I && !rt, dt = F?.type === "userTask" && F.data.allowAddSigner, ft = b(() => n.filter((e) => e.status === "PENDING"), [n]), pt = ot.find((e) => e.id === ve) ?? ot[0] ?? null, mt = b(() => d.map((e) => ({
942
965
  ...e,
943
- assigneeLabel: Lt(e, o),
944
- fillFieldCount: Hn(e, a?.workflowSnapshot ?? null),
966
+ assigneeLabel: Rt(e, o),
967
+ fillFieldCount: Kn(e, a?.workflowSnapshot ?? null),
945
968
  key: e.id,
946
969
  nodeLabel: u({
947
970
  ...e,
948
- nodeLabel: It(e.nodeId, a?.workflowSnapshot ?? null)
971
+ nodeLabel: Ft(e.nodeId, a?.workflowSnapshot ?? null)
949
972
  }),
950
- statusLabel: G(e.status)
973
+ statusLabel: K(e.status)
951
974
  })), [
952
975
  a,
953
976
  o,
954
977
  d
955
- ]), ft = x(() => [
978
+ ]), ht = b(() => [
956
979
  {
957
980
  dataIndex: "nodeLabel",
958
981
  key: "nodeLabel",
@@ -962,7 +985,7 @@ var In = {
962
985
  {
963
986
  key: "assigneeMemberId",
964
987
  title: "處理者",
965
- render: (e) => /* @__PURE__ */ O(D, {
988
+ render: (e) => /* @__PURE__ */ O(E, {
966
989
  component: "span",
967
990
  variant: "body",
968
991
  children: e.assigneeLabel
@@ -977,7 +1000,7 @@ var In = {
977
1000
  },
978
1001
  {
979
1002
  key: "fill",
980
- render: (e) => e.fillFieldCount > 0 ? /* @__PURE__ */ O(fe, {
1003
+ render: (e) => e.fillFieldCount > 0 ? /* @__PURE__ */ O(pe, {
981
1004
  size: "sub",
982
1005
  text: `需補填 ${e.fillFieldCount} 欄`,
983
1006
  variant: "dot-warning"
@@ -987,7 +1010,7 @@ var In = {
987
1010
  },
988
1011
  {
989
1012
  key: "createdAt",
990
- render: (e) => /* @__PURE__ */ O(D, {
1013
+ render: (e) => /* @__PURE__ */ O(E, {
991
1014
  component: "span",
992
1015
  variant: "body",
993
1016
  children: t(e.createdAt)
@@ -995,13 +1018,13 @@ var In = {
995
1018
  title: "建立時間",
996
1019
  width: 220
997
1020
  }
998
- ], []), pt = x(() => ut.map((e) => ({
1021
+ ], []), R = b(() => ft.map((e) => ({
999
1022
  ...e,
1000
- createdByLabel: K(e.createdByMemberId, o),
1023
+ createdByLabel: q(e.createdByMemberId, o),
1001
1024
  key: e.id,
1002
- targetLabel: Vn(e, o),
1003
- typeLabel: In[e.type]
1004
- })), [o, ut]), mt = x(() => [
1025
+ targetLabel: Gn(e, o),
1026
+ typeLabel: Bn[e.type]
1027
+ })), [o, ft]), gt = b(() => [
1005
1028
  {
1006
1029
  dataIndex: "typeLabel",
1007
1030
  key: "typeLabel",
@@ -1010,7 +1033,7 @@ var In = {
1010
1033
  },
1011
1034
  {
1012
1035
  key: "targetLabel",
1013
- render: (e) => /* @__PURE__ */ O(D, {
1036
+ render: (e) => /* @__PURE__ */ O(E, {
1014
1037
  component: "span",
1015
1038
  variant: "body",
1016
1039
  children: e.targetLabel
@@ -1020,7 +1043,7 @@ var In = {
1020
1043
  },
1021
1044
  {
1022
1045
  key: "createdByLabel",
1023
- render: (e) => /* @__PURE__ */ O(D, {
1046
+ render: (e) => /* @__PURE__ */ O(E, {
1024
1047
  component: "span",
1025
1048
  variant: "body",
1026
1049
  children: e.createdByLabel
@@ -1030,7 +1053,7 @@ var In = {
1030
1053
  },
1031
1054
  {
1032
1055
  key: "createdAt",
1033
- render: (e) => /* @__PURE__ */ O(D, {
1056
+ render: (e) => /* @__PURE__ */ O(E, {
1034
1057
  component: "span",
1035
1058
  variant: "body",
1036
1059
  children: t(e.createdAt)
@@ -1040,21 +1063,21 @@ var In = {
1040
1063
  },
1041
1064
  {
1042
1065
  key: "actions",
1043
- render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ O(C, {
1066
+ render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ O(S, {
1044
1067
  disabled: Ze,
1045
- onClick: () => void H(e.id),
1068
+ onClick: () => void At(e.id),
1046
1069
  size: "minor",
1047
1070
  variant: "destructive-secondary",
1048
1071
  children: "撤回"
1049
- }) : /* @__PURE__ */ O(Te, {}),
1072
+ }) : /* @__PURE__ */ O(D, {}),
1050
1073
  title: "操作",
1051
1074
  width: 100
1052
1075
  }
1053
1076
  ], [Ze, r]);
1054
- async function ht({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: a = null }) {
1055
- if (!r || !F || e === "REJECTED" && !ot || e === "TRANSFERRED" && !st) return !1;
1077
+ async function z({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: a = null }) {
1078
+ if (!r || !P || e === "REJECTED" && !ct || e === "TRANSFERRED" && !lt) return !1;
1056
1079
  m(!0), g(null);
1057
- let o = e === "APPROVED" && i !== null && !F.isAdhoc ? {
1080
+ let o = e === "APPROVED" && i !== null && !P.isAdhoc ? {
1058
1081
  expectedFormDataFingerprint: i.expectedFormDataFingerprint,
1059
1082
  formData: i.formData
1060
1083
  } : null;
@@ -1065,11 +1088,11 @@ var In = {
1065
1088
  decidedByMemberId: r,
1066
1089
  fill: o,
1067
1090
  returnToNodeId: n,
1068
- taskId: F.id,
1091
+ taskId: P.id,
1069
1092
  transferToMemberId: a
1070
- }), y(!1), ge(!1), Fe(!1), ae(""), ue(""), be(""), De(null), E(null), se(null);
1093
+ }), y(!1), _e(!1), Fe(!1), ae(""), de(""), xe(""), De(null), T(null), v(null);
1071
1094
  } catch (e) {
1072
- return m(!1), o !== null && e instanceof Error && l?.(e.message, we(e)) === !0 ? (re(!1), !1) : (g(_(e)), !1);
1095
+ return m(!1), o !== null && e instanceof Error && l?.(e.message, Te(e)) === !0 ? (re(!1), !1) : (g(_(e)), !1);
1073
1096
  }
1074
1097
  try {
1075
1098
  await s();
@@ -1080,37 +1103,37 @@ var In = {
1080
1103
  }
1081
1104
  return !0;
1082
1105
  }
1083
- function R() {
1084
- r && F && (g(null), re(!0));
1106
+ function _t() {
1107
+ r && P && (g(null), re(!0));
1085
1108
  }
1086
- function gt() {
1109
+ function vt() {
1087
1110
  p || (re(!1), te(""));
1088
1111
  }
1089
- async function z() {
1090
- p || await ht({
1112
+ async function yt() {
1113
+ p || L || await z({
1091
1114
  action: "APPROVED",
1092
- comment: ee.trim() || null
1115
+ comment: rt || null
1093
1116
  }) && (re(!1), te(""));
1094
1117
  }
1095
- function _t() {
1096
- ot && (ae(""), se(null), y(!0));
1097
- }
1098
- function vt() {
1099
- p || (y(!1), ae(""), se(null));
1100
- }
1101
- function yt() {
1102
- ue(""), E(it[0]?.id ?? null), ge(!0);
1103
- }
1104
1118
  function bt() {
1105
- p || (ge(!1), ue(""), E(null));
1119
+ ct && (ae(""), v(null), y(!0));
1106
1120
  }
1107
1121
  function xt() {
1108
- st && (be(""), De(null), Fe(!0), B(""));
1122
+ p || (y(!1), ae(""), v(null));
1109
1123
  }
1110
1124
  function St() {
1111
- p || (Fe(!1), be(""), De(null));
1125
+ de(""), T(ot[0]?.id ?? null), _e(!0);
1126
+ }
1127
+ function B() {
1128
+ p || (_e(!1), de(""), T(null));
1129
+ }
1130
+ function Ct() {
1131
+ lt && (xe(""), De(null), Fe(!0), wt(""));
1132
+ }
1133
+ function V() {
1134
+ p || (Fe(!1), xe(""), De(null));
1112
1135
  }
1113
- async function B(e) {
1136
+ async function wt(e) {
1114
1137
  je(!0);
1115
1138
  try {
1116
1139
  Ne((await Ue(e)).filter((e) => e.memberId !== r).map(Vt));
@@ -1120,36 +1143,36 @@ var In = {
1120
1143
  je(!1);
1121
1144
  }
1122
1145
  }
1123
- async function Ct() {
1124
- ot && (tt ? await ht({
1146
+ async function Tt() {
1147
+ ct && (nt ? await z({
1125
1148
  action: "REJECTED",
1126
- comment: tt
1127
- }) : se("請輸入拒絕原因"));
1149
+ comment: nt
1150
+ }) : v("請輸入拒絕原因"));
1128
1151
  }
1129
- async function wt() {
1130
- st && (Ce ? await ht({
1152
+ async function Et() {
1153
+ lt && (we ? await z({
1131
1154
  action: "TRANSFERRED",
1132
- comment: rt || null,
1133
- transferToMemberId: Ce.id
1155
+ comment: at || null,
1156
+ transferToMemberId: we.id
1134
1157
  }) : g("請選擇轉派對象"));
1135
1158
  }
1136
- async function Tt() {
1137
- await ht({
1159
+ async function Dt() {
1160
+ await z({
1138
1161
  action: "RETURNED",
1139
- comment: nt || null,
1140
- returnToNodeId: L?.id ?? null
1162
+ comment: it || null,
1163
+ returnToNodeId: pt?.id ?? null
1141
1164
  });
1142
1165
  }
1143
- function Et() {
1144
- Le(""), Ve([]), Xe("REJECT_INSTANCE"), $e("MEMBER"), et("");
1166
+ function H() {
1167
+ Le(""), Ve([]), Xe("REJECT_INSTANCE"), et("MEMBER"), tt("");
1145
1168
  }
1146
- function Dt(e) {
1147
- Je(e), Et(), j(!0), V("");
1169
+ function Ot(e) {
1170
+ Je(e), H(), qe(!0), W("");
1148
1171
  }
1149
- function Ot() {
1150
- Ze || (j(!1), Et());
1172
+ function U() {
1173
+ Ze || (qe(!1), H());
1151
1174
  }
1152
- async function V(e) {
1175
+ async function W(e) {
1153
1176
  We(!0);
1154
1177
  try {
1155
1178
  Ke((await Ue(e)).map(Vt));
@@ -1160,11 +1183,11 @@ var In = {
1160
1183
  }
1161
1184
  }
1162
1185
  async function kt() {
1163
- if (!F) return;
1164
- let e = (M === "STAGE_NOTIFY" || M === "COMPLETION_NOTIFY") && N === "WEBHOOK", t = q({
1186
+ if (!P) return;
1187
+ let e = (M === "STAGE_NOTIFY" || M === "COMPLETION_NOTIFY") && $e === "WEBHOOK", t = Ht({
1165
1188
  memberIds: Be.map((e) => e.id),
1166
1189
  useWebhookTarget: e,
1167
- webhookUrl: P
1190
+ webhookUrl: N
1168
1191
  });
1169
1192
  if (!t.valid) {
1170
1193
  g(t.error);
@@ -1176,26 +1199,26 @@ var In = {
1176
1199
  M === "COUNTERSIGN" ? await Re({
1177
1200
  comment: r,
1178
1201
  target: n,
1179
- taskId: F.id
1202
+ taskId: P.id
1180
1203
  }) : M === "PRE_APPROVAL" ? await ze({
1181
1204
  comment: r,
1182
1205
  onReject: Ye,
1183
1206
  target: n,
1184
- taskId: F.id
1207
+ taskId: P.id
1185
1208
  }) : M === "STAGE_NOTIFY" ? await ke({
1186
1209
  target: n,
1187
- taskId: F.id
1210
+ taskId: P.id
1188
1211
  }) : await Oe({
1189
1212
  target: n,
1190
- taskId: F.id
1191
- }), j(!1), Et(), await s();
1213
+ taskId: P.id
1214
+ }), qe(!1), H(), await s();
1192
1215
  } catch (e) {
1193
1216
  g(_(e));
1194
1217
  } finally {
1195
1218
  Qe(!1);
1196
1219
  }
1197
1220
  }
1198
- async function H(e) {
1221
+ async function At(e) {
1199
1222
  Qe(!0), g(null);
1200
1223
  try {
1201
1224
  await Ee(e), await s();
@@ -1205,164 +1228,167 @@ var In = {
1205
1228
  Qe(!1);
1206
1229
  }
1207
1230
  }
1208
- le(f, () => ({
1209
- canAddSignerCurrentTask: lt,
1210
- canRejectCurrentTask: ot,
1211
- canReturnCurrentTask: at,
1212
- canTransferCurrentTask: st,
1231
+ ue(f, () => ({
1232
+ canAddSignerCurrentTask: dt,
1233
+ canRejectCurrentTask: ct,
1234
+ canReturnCurrentTask: st,
1235
+ canTransferCurrentTask: lt,
1213
1236
  deciding: p,
1214
- handleApprove: R,
1215
- hasCurrentTask: F !== null,
1216
- openAdhocModal: Dt,
1217
- openRejectModal: _t,
1218
- openReturnModal: yt,
1219
- openTransferModal: xt
1237
+ handleApprove: _t,
1238
+ hasCurrentTask: P !== null,
1239
+ openAdhocModal: Ot,
1240
+ openRejectModal: bt,
1241
+ openReturnModal: St,
1242
+ openTransferModal: Ct
1220
1243
  }), [
1221
- lt,
1222
- ot,
1223
- at,
1244
+ dt,
1245
+ ct,
1224
1246
  st,
1247
+ lt,
1225
1248
  r,
1226
- F,
1249
+ P,
1227
1250
  p
1228
1251
  ]);
1229
- let U = M === "STAGE_NOTIFY" || M === "COMPLETION_NOTIFY", At = U && N === "WEBHOOK" ? !P.trim() : Be.length === 0, jt = Rn.find((e) => e.id === Ye) ?? Rn[0], Mt = zn.find((e) => e.id === N) ?? zn[0];
1230
- return /* @__PURE__ */ k(Te, { children: [
1231
- /* @__PURE__ */ O(D, {
1252
+ let jt = M === "STAGE_NOTIFY" || M === "COMPLETION_NOTIFY", G = jt && $e === "WEBHOOK" ? !N.trim() : Be.length === 0, Mt = Hn.find((e) => e.id === Ye) ?? Hn[0], Nt = Un.find((e) => e.id === $e) ?? Un[0];
1253
+ return /* @__PURE__ */ k(D, { children: [
1254
+ /* @__PURE__ */ O(E, {
1232
1255
  component: "h2",
1233
1256
  variant: "h3",
1234
1257
  children: "任務"
1235
1258
  }),
1236
- h ? /* @__PURE__ */ O(D, {
1259
+ h ? /* @__PURE__ */ O(E, {
1237
1260
  color: "text-error",
1238
1261
  variant: "body",
1239
1262
  children: h
1240
1263
  }) : null,
1241
1264
  /* @__PURE__ */ O("div", {
1242
- style: Nn,
1243
- children: /* @__PURE__ */ O(xe, {
1244
- columns: ft,
1245
- dataSource: dt,
1265
+ style: Ln,
1266
+ children: /* @__PURE__ */ O(Se, {
1267
+ columns: ht,
1268
+ dataSource: mt,
1246
1269
  fullWidth: !0
1247
1270
  })
1248
1271
  }),
1249
- ut.length > 0 ? /* @__PURE__ */ k(Te, { children: [/* @__PURE__ */ O(D, {
1272
+ ft.length > 0 ? /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(E, {
1250
1273
  component: "h3",
1251
- style: Pn,
1274
+ style: Rn,
1252
1275
  variant: "h3",
1253
1276
  children: "待生效的臨時設定"
1254
1277
  }), /* @__PURE__ */ O("div", {
1255
- style: Nn,
1256
- children: /* @__PURE__ */ O(xe, {
1257
- columns: mt,
1258
- dataSource: pt,
1278
+ style: Ln,
1279
+ children: /* @__PURE__ */ O(Se, {
1280
+ columns: gt,
1281
+ dataSource: R,
1259
1282
  fullWidth: !0
1260
1283
  })
1261
1284
  })] }) : null,
1262
- /* @__PURE__ */ k(T, {
1285
+ /* @__PURE__ */ k(w, {
1263
1286
  cancelText: "取消",
1287
+ confirmButtonProps: { disabled: L },
1264
1288
  confirmText: "送出同意",
1265
1289
  loading: p,
1266
1290
  modalType: "standard",
1267
- onCancel: gt,
1268
- onClose: gt,
1269
- onConfirm: () => void z(),
1291
+ onCancel: vt,
1292
+ onClose: vt,
1293
+ onConfirm: () => void yt(),
1270
1294
  open: ne,
1271
1295
  showModalFooter: !0,
1272
1296
  showModalHeader: !0,
1273
1297
  size: "regular",
1274
- supportingText: "可以留下同意的說明,內容會記錄在簽核歷程;不填也可以直接送出。",
1298
+ supportingText: I ? "此關卡設定核准時必須填寫意見,內容會記錄在簽核歷程。" : "可以留下同意的說明,內容會記錄在簽核歷程;不填也可以直接送出。",
1275
1299
  title: "簽核意見",
1276
1300
  children: [
1277
- h ? /* @__PURE__ */ O(D, {
1301
+ h ? /* @__PURE__ */ O(E, {
1278
1302
  color: "text-error",
1279
1303
  role: "alert",
1280
1304
  variant: "body",
1281
1305
  children: h
1282
1306
  }) : null,
1283
1307
  i !== null && i.summary.length > 0 ? /* @__PURE__ */ k("div", {
1284
- style: An,
1285
- children: [/* @__PURE__ */ O(D, {
1308
+ style: Pn,
1309
+ children: [/* @__PURE__ */ O(E, {
1286
1310
  variant: "body",
1287
1311
  children: "將一併送出的補填欄位:"
1288
- }), i.summary.map((e) => /* @__PURE__ */ O(w, {
1312
+ }), i.summary.map((e) => /* @__PURE__ */ O(C, {
1289
1313
  title: e.label,
1290
- children: /* @__PURE__ */ O(pe, { children: e.text })
1314
+ children: /* @__PURE__ */ O(me, { children: e.text })
1291
1315
  }, e.fieldKey))]
1292
1316
  }) : null,
1293
1317
  /* @__PURE__ */ O("div", {
1294
- style: An,
1318
+ style: Pn,
1295
1319
  children: /* @__PURE__ */ O(e, {
1320
+ hintText: I ? "此關卡設定核准時必須填寫意見。" : void 0,
1296
1321
  label: "簽核意見",
1297
1322
  name: "approveComment",
1298
- children: /* @__PURE__ */ O(Se, {
1323
+ required: I,
1324
+ children: /* @__PURE__ */ O(Ce, {
1299
1325
  autoFocus: !0,
1300
1326
  onChange: (e) => te(e.target.value),
1301
- placeholder: "選填,例如補充核准的條件或提醒事項",
1302
- ref: Fn,
1327
+ placeholder: I ? "請說明同意的原因或條件" : "選填,例如補充核准的條件或提醒事項",
1328
+ ref: zn,
1303
1329
  resize: "vertical",
1304
1330
  rows: 4,
1305
- style: jn,
1331
+ style: Fn,
1306
1332
  value: ee
1307
1333
  })
1308
1334
  })
1309
1335
  })
1310
1336
  ]
1311
1337
  }),
1312
- /* @__PURE__ */ O(T, {
1338
+ /* @__PURE__ */ O(w, {
1313
1339
  cancelText: "取消",
1314
1340
  confirmButtonProps: {
1315
- disabled: !tt,
1341
+ disabled: !nt,
1316
1342
  variant: "destructive-primary"
1317
1343
  },
1318
1344
  confirmText: "送出拒絕",
1319
1345
  loading: p,
1320
1346
  modalStatusType: "error",
1321
1347
  modalType: "standard",
1322
- onCancel: vt,
1323
- onClose: vt,
1324
- onConfirm: () => void Ct(),
1325
- open: v,
1348
+ onCancel: xt,
1349
+ onClose: xt,
1350
+ onConfirm: () => void Tt(),
1351
+ open: se,
1326
1352
  showModalFooter: !0,
1327
1353
  showModalHeader: !0,
1328
1354
  size: "regular",
1329
1355
  supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
1330
1356
  title: "拒絕原因",
1331
1357
  children: /* @__PURE__ */ k("div", {
1332
- style: An,
1358
+ style: Pn,
1333
1359
  children: [/* @__PURE__ */ O(e, {
1334
1360
  label: "拒絕原因",
1335
1361
  name: "rejectReason",
1336
1362
  required: !0,
1337
- children: /* @__PURE__ */ O(Se, {
1363
+ children: /* @__PURE__ */ O(Ce, {
1338
1364
  autoFocus: !0,
1339
1365
  onChange: (e) => {
1340
- ae(e.target.value), se(null);
1366
+ ae(e.target.value), v(null);
1341
1367
  },
1342
1368
  placeholder: "請說明拒絕原因",
1343
- ref: Fn,
1369
+ ref: zn,
1344
1370
  resize: "vertical",
1345
1371
  rows: 4,
1346
- style: jn,
1372
+ style: Fn,
1347
1373
  type: oe ? "error" : "default",
1348
1374
  value: ie
1349
1375
  })
1350
- }), oe ? /* @__PURE__ */ O(D, {
1376
+ }), oe ? /* @__PURE__ */ O(E, {
1351
1377
  color: "text-error",
1352
1378
  variant: "body",
1353
1379
  children: oe
1354
1380
  }) : null]
1355
1381
  })
1356
1382
  }),
1357
- /* @__PURE__ */ O(T, {
1383
+ /* @__PURE__ */ O(w, {
1358
1384
  cancelText: "取消",
1359
- confirmButtonProps: { disabled: !Ce },
1385
+ confirmButtonProps: { disabled: !we },
1360
1386
  confirmText: "送出轉派",
1361
1387
  loading: p,
1362
1388
  modalType: "standard",
1363
- onCancel: St,
1364
- onClose: St,
1365
- onConfirm: () => void wt(),
1389
+ onCancel: V,
1390
+ onClose: V,
1391
+ onConfirm: () => void Et(),
1366
1392
  open: Pe,
1367
1393
  showModalFooter: !0,
1368
1394
  showModalHeader: !0,
@@ -1370,12 +1396,12 @@ var In = {
1370
1396
  supportingText: "轉派後,原任務會保留轉派紀錄,新的待簽任務會指派給指定成員。",
1371
1397
  title: "轉派簽核",
1372
1398
  children: /* @__PURE__ */ k("div", {
1373
- style: Mn,
1399
+ style: In,
1374
1400
  children: [/* @__PURE__ */ O(e, {
1375
1401
  label: "轉派對象",
1376
1402
  name: "transferToMemberId",
1377
1403
  required: !0,
1378
- children: /* @__PURE__ */ O(de, {
1404
+ children: /* @__PURE__ */ O(fe, {
1379
1405
  asyncData: !0,
1380
1406
  disabledOptionsFilter: !0,
1381
1407
  emptyText: "沒有符合的成員",
@@ -1388,144 +1414,144 @@ var In = {
1388
1414
  loading: Ae,
1389
1415
  loadingText: "搜尋成員中...",
1390
1416
  mode: "single",
1391
- onChange: (e) => De(Ut(e)),
1392
- onSearch: B,
1393
- onSearchTextChange: (e) => De(Wt(e, Me)),
1417
+ onChange: (e) => De(Wt(e)),
1418
+ onSearch: wt,
1419
+ onSearchTextChange: (e) => De(Gt(e, Me)),
1394
1420
  onVisibilityChange: (e) => {
1395
- e && B("");
1421
+ e && wt("");
1396
1422
  },
1397
1423
  options: [...Me],
1398
1424
  placeholder: "搜尋姓名或信箱",
1399
1425
  searchDebounceTime: 300,
1400
- value: Ce
1426
+ value: we
1401
1427
  })
1402
1428
  }), /* @__PURE__ */ O(e, {
1403
1429
  label: "轉派說明",
1404
1430
  name: "transferComment",
1405
- children: /* @__PURE__ */ O(Se, {
1406
- onChange: (e) => be(e.target.value),
1431
+ children: /* @__PURE__ */ O(Ce, {
1432
+ onChange: (e) => xe(e.target.value),
1407
1433
  placeholder: "可補充轉派原因",
1408
- ref: Fn,
1434
+ ref: zn,
1409
1435
  resize: "vertical",
1410
1436
  rows: 4,
1411
- style: jn,
1412
- value: ve
1437
+ style: Fn,
1438
+ value: ye
1413
1439
  })
1414
1440
  })]
1415
1441
  })
1416
1442
  }),
1417
- /* @__PURE__ */ O(T, {
1443
+ /* @__PURE__ */ O(w, {
1418
1444
  cancelText: "取消",
1419
- confirmButtonProps: { disabled: !L || ct && !nt },
1445
+ confirmButtonProps: { disabled: !pt || ut && !it },
1420
1446
  confirmText: "送出退回",
1421
1447
  loading: p,
1422
1448
  modalType: "standard",
1423
- onCancel: bt,
1424
- onClose: bt,
1425
- onConfirm: () => void Tt(),
1426
- open: me,
1449
+ onCancel: B,
1450
+ onClose: B,
1451
+ onConfirm: () => void Dt(),
1452
+ open: he,
1427
1453
  showModalFooter: !0,
1428
1454
  showModalHeader: !0,
1429
1455
  size: "regular",
1430
1456
  supportingText: "退回後,流程會回到指定節點並等待重新處理。",
1431
1457
  title: "退回簽核",
1432
1458
  children: /* @__PURE__ */ k("div", {
1433
- style: Mn,
1459
+ style: In,
1434
1460
  children: [/* @__PURE__ */ O(e, {
1435
1461
  label: "退回節點",
1436
1462
  name: "returnTargetNodeId",
1437
1463
  required: !0,
1438
- children: /* @__PURE__ */ O(ye, {
1464
+ children: /* @__PURE__ */ O(be, {
1439
1465
  clearable: !1,
1440
1466
  fullWidth: !0,
1441
- onChange: (e) => E(e?.id ?? null),
1442
- options: [...it],
1467
+ onChange: (e) => T(e?.id ?? null),
1468
+ options: [...ot],
1443
1469
  placeholder: "選擇退回節點",
1444
- value: L
1470
+ value: pt
1445
1471
  })
1446
1472
  }), /* @__PURE__ */ O(e, {
1447
- hintText: ct ? "此關卡設定退回時必須填寫意見。" : void 0,
1473
+ hintText: ut ? "此關卡設定退回時必須填寫意見。" : void 0,
1448
1474
  label: "退回說明",
1449
1475
  name: "returnComment",
1450
- required: ct,
1451
- children: /* @__PURE__ */ O(Se, {
1452
- onChange: (e) => ue(e.target.value),
1453
- placeholder: ct ? "請說明退回原因" : "可補充需要修改的內容",
1454
- ref: Fn,
1476
+ required: ut,
1477
+ children: /* @__PURE__ */ O(Ce, {
1478
+ onChange: (e) => de(e.target.value),
1479
+ placeholder: ut ? "請說明退回原因" : "可補充需要修改的內容",
1480
+ ref: zn,
1455
1481
  resize: "vertical",
1456
1482
  rows: 4,
1457
- style: jn,
1483
+ style: Fn,
1458
1484
  value: ce
1459
1485
  })
1460
1486
  })]
1461
1487
  })
1462
1488
  }),
1463
- /* @__PURE__ */ O(T, {
1489
+ /* @__PURE__ */ O(w, {
1464
1490
  cancelText: "取消",
1465
- confirmButtonProps: { disabled: At },
1491
+ confirmButtonProps: { disabled: G },
1466
1492
  confirmText: "送出",
1467
1493
  loading: Ze,
1468
1494
  modalType: "standard",
1469
- onCancel: Ot,
1470
- onClose: Ot,
1495
+ onCancel: U,
1496
+ onClose: U,
1471
1497
  onConfirm: () => void kt(),
1472
- open: qe,
1498
+ open: j,
1473
1499
  showModalFooter: !0,
1474
1500
  showModalHeader: !0,
1475
1501
  size: "regular",
1476
- supportingText: Ln[M],
1477
- title: In[M],
1502
+ supportingText: Vn[M],
1503
+ title: Bn[M],
1478
1504
  children: /* @__PURE__ */ k("div", {
1479
- style: Mn,
1505
+ style: In,
1480
1506
  children: [
1481
- U ? /* @__PURE__ */ O(e, {
1507
+ jt ? /* @__PURE__ */ O(e, {
1482
1508
  label: "通知時機",
1483
1509
  name: "adhocNotifyMode",
1484
1510
  required: !0,
1485
- children: /* @__PURE__ */ O(ye, {
1511
+ children: /* @__PURE__ */ O(be, {
1486
1512
  clearable: !1,
1487
1513
  fullWidth: !0,
1488
1514
  onChange: (e) => Je(e?.id === "COMPLETION_NOTIFY" ? "COMPLETION_NOTIFY" : "STAGE_NOTIFY"),
1489
1515
  options: [{
1490
1516
  id: "STAGE_NOTIFY",
1491
- name: In.STAGE_NOTIFY
1517
+ name: Bn.STAGE_NOTIFY
1492
1518
  }, {
1493
1519
  id: "COMPLETION_NOTIFY",
1494
- name: In.COMPLETION_NOTIFY
1520
+ name: Bn.COMPLETION_NOTIFY
1495
1521
  }],
1496
1522
  value: {
1497
1523
  id: M,
1498
- name: In[M]
1524
+ name: Bn[M]
1499
1525
  }
1500
1526
  })
1501
1527
  }) : null,
1502
- U ? /* @__PURE__ */ O(e, {
1528
+ jt ? /* @__PURE__ */ O(e, {
1503
1529
  label: "通知對象類型",
1504
1530
  name: "adhocTargetKind",
1505
1531
  required: !0,
1506
- children: /* @__PURE__ */ O(ye, {
1532
+ children: /* @__PURE__ */ O(be, {
1507
1533
  clearable: !1,
1508
1534
  fullWidth: !0,
1509
- onChange: (e) => $e(e?.id === "WEBHOOK" ? "WEBHOOK" : "MEMBER"),
1510
- options: [...zn],
1511
- value: Mt
1535
+ onChange: (e) => et(e?.id === "WEBHOOK" ? "WEBHOOK" : "MEMBER"),
1536
+ options: [...Un],
1537
+ value: Nt
1512
1538
  })
1513
1539
  }) : null,
1514
- U && N === "WEBHOOK" ? /* @__PURE__ */ O(e, {
1540
+ jt && $e === "WEBHOOK" ? /* @__PURE__ */ O(e, {
1515
1541
  label: "Webhook URL",
1516
1542
  name: "adhocWebhookUrl",
1517
1543
  required: !0,
1518
- children: /* @__PURE__ */ O(he, {
1544
+ children: /* @__PURE__ */ O(ge, {
1519
1545
  fullWidth: !0,
1520
- onChange: (e) => et(e.target.value),
1546
+ onChange: (e) => tt(e.target.value),
1521
1547
  placeholder: "https://example.com/webhook",
1522
- value: P
1548
+ value: N
1523
1549
  })
1524
1550
  }) : /* @__PURE__ */ O(e, {
1525
- label: U ? "通知對象" : "簽核對象",
1551
+ label: jt ? "通知對象" : "簽核對象",
1526
1552
  name: "adhocMemberId",
1527
1553
  required: !0,
1528
- children: /* @__PURE__ */ O(de, {
1554
+ children: /* @__PURE__ */ O(fe, {
1529
1555
  asyncData: !0,
1530
1556
  disabledOptionsFilter: !0,
1531
1557
  emptyText: "沒有符合的成員",
@@ -1539,10 +1565,10 @@ var In = {
1539
1565
  loadingText: "搜尋成員中...",
1540
1566
  menuMaxHeight: 320,
1541
1567
  mode: "multiple",
1542
- onChange: (e) => Ve(e.map(Ut).filter(Ht)),
1543
- onSearch: V,
1568
+ onChange: (e) => Ve(e.map(Wt).filter(Ut)),
1569
+ onSearch: W,
1544
1570
  onVisibilityChange: (e) => {
1545
- e && V("");
1571
+ e && W("");
1546
1572
  },
1547
1573
  options: [...Ge],
1548
1574
  overflowStrategy: "wrap",
@@ -1555,24 +1581,24 @@ var In = {
1555
1581
  label: "拒簽處理方式",
1556
1582
  name: "adhocOnReject",
1557
1583
  required: !0,
1558
- children: /* @__PURE__ */ O(ye, {
1584
+ children: /* @__PURE__ */ O(be, {
1559
1585
  clearable: !1,
1560
1586
  fullWidth: !0,
1561
1587
  onChange: (e) => Xe(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
1562
- options: [...Rn],
1563
- value: jt
1588
+ options: [...Hn],
1589
+ value: Mt
1564
1590
  })
1565
1591
  }) : null,
1566
- U ? null : /* @__PURE__ */ O(e, {
1592
+ jt ? null : /* @__PURE__ */ O(e, {
1567
1593
  label: "說明",
1568
1594
  name: "adhocComment",
1569
- children: /* @__PURE__ */ O(Se, {
1595
+ children: /* @__PURE__ */ O(Ce, {
1570
1596
  onChange: (e) => Le(e.target.value),
1571
1597
  placeholder: "可補充原因",
1572
- ref: Fn,
1598
+ ref: zn,
1573
1599
  resize: "vertical",
1574
1600
  rows: 3,
1575
- style: jn,
1601
+ style: Fn,
1576
1602
  value: Ie
1577
1603
  })
1578
1604
  })
@@ -1581,35 +1607,35 @@ var In = {
1581
1607
  })
1582
1608
  ] });
1583
1609
  });
1584
- function Vn(e, t) {
1610
+ function Gn(e, t) {
1585
1611
  try {
1586
1612
  let n = JSON.parse(e.targetValueJson);
1587
- if (n.memberIds?.length) return n.memberIds.map((e) => K(e, t)).join("、");
1613
+ if (n.memberIds?.length) return n.memberIds.map((e) => q(e, t)).join("、");
1588
1614
  if (n.webhookUrl) return n.webhookUrl;
1589
1615
  if (n.positionId) return `職位 ${n.positionId}`;
1590
1616
  if (n.orgUnitId) return `部門 ${n.orgUnitId}`;
1591
1617
  } catch {}
1592
1618
  return e.targetKind;
1593
1619
  }
1594
- function Hn(e, t) {
1620
+ function Kn(e, t) {
1595
1621
  if (e.isAdhoc || e.status !== "PENDING" && e.status !== "IN_PROGRESS") return 0;
1596
1622
  let n = t?.nodes.find((t) => t.id === e.nodeId);
1597
- return n?.type === "userTask" ? Ke(n).size : 0;
1623
+ return n?.type === "userTask" ? Ge(n).size : 0;
1598
1624
  }
1599
1625
  // src/views/instances/detail/sections/InstanceSignaturesSection.tsx
1600
- var Un = {
1626
+ var qn = {
1601
1627
  display: "grid",
1602
1628
  gap: 16
1603
1629
  };
1604
- function Wn({ signatureVerification: e, signatures: n }) {
1605
- let r = x(() => n.map((e) => ({
1630
+ function Jn({ signatureVerification: e, signatures: n }) {
1631
+ let r = b(() => n.map((e) => ({
1606
1632
  algorithm: e.algorithm,
1607
- hashLabel: W(e.signedPayloadHash),
1633
+ hashLabel: G(e.signedPayloadHash),
1608
1634
  key: e.id,
1609
1635
  keyVersion: e.keyVersion,
1610
1636
  signedAtLabel: t(e.signedAt),
1611
1637
  signerMemberId: e.signerMemberId
1612
- })), [n]), i = x(() => [
1638
+ })), [n]), i = b(() => [
1613
1639
  {
1614
1640
  dataIndex: "signerMemberId",
1615
1641
  key: "signerMemberId",
@@ -1642,19 +1668,19 @@ function Wn({ signatureVerification: e, signatures: n }) {
1642
1668
  }
1643
1669
  ], []);
1644
1670
  return /* @__PURE__ */ k("div", {
1645
- style: Un,
1671
+ style: qn,
1646
1672
  children: [
1647
- /* @__PURE__ */ O(D, {
1673
+ /* @__PURE__ */ O(E, {
1648
1674
  component: "h2",
1649
1675
  variant: "h3",
1650
1676
  children: "簽章"
1651
1677
  }),
1652
- /* @__PURE__ */ O(D, {
1678
+ /* @__PURE__ */ O(E, {
1653
1679
  color: e?.valid ? "text-success" : "text-error",
1654
1680
  variant: "body",
1655
1681
  children: e ? e.valid ? `簽章鏈已驗證,共 ${e.checkedCount} 筆。` : `簽章鏈驗證失敗:${e.errors.join("、")}` : "尚無簽章紀錄。"
1656
1682
  }),
1657
- r.length > 0 ? /* @__PURE__ */ O(xe, {
1683
+ r.length > 0 ? /* @__PURE__ */ O(Se, {
1658
1684
  columns: i,
1659
1685
  dataSource: r,
1660
1686
  fullWidth: !0
@@ -1663,14 +1689,14 @@ function Wn({ signatureVerification: e, signatures: n }) {
1663
1689
  });
1664
1690
  }
1665
1691
  // src/views/instances/detail/sections/InstanceHistorySection.tsx
1666
- var Gn = {
1692
+ var Yn = {
1667
1693
  display: "grid",
1668
1694
  gap: 16
1669
- }, Kn = {
1695
+ }, Xn = {
1670
1696
  cursor: "help",
1671
1697
  textDecoration: "underline dotted",
1672
1698
  textUnderlineOffset: 3
1673
- }, qn = {
1699
+ }, Zn = {
1674
1700
  borderLeftColor: "var(--mzn-color-border)",
1675
1701
  borderLeftStyle: "solid",
1676
1702
  borderLeftWidth: 2,
@@ -1679,42 +1705,42 @@ var Gn = {
1679
1705
  marginTop: 4,
1680
1706
  paddingLeft: 8,
1681
1707
  whiteSpace: "pre-wrap"
1682
- }, Jn = { color: "var(--mzn-color-text-secondary)" }, Yn = {
1683
- ...qn,
1708
+ }, Qn = { color: "var(--mzn-color-text-secondary)" }, $n = {
1709
+ ...Zn,
1684
1710
  borderLeftColor: "var(--mzn-color-text-error)",
1685
1711
  color: "var(--mzn-color-text-error)"
1686
1712
  };
1687
- function Xn(...e) {
1688
- return e.filter((e) => U(e ?? null)).join(" ");
1713
+ function er(...e) {
1714
+ return e.filter((e) => W(e ?? null)).join(" ");
1689
1715
  }
1690
- var Zn = y(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: i = 0, orientation: a, status: o = "pending", title: s, type: c = "number", ...l }, u) {
1716
+ var tr = y(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: i = 0, orientation: a, status: o = "pending", title: s, type: c = "number", ...l }, u) {
1691
1717
  let d = r ? "pending" : o, f = t.filter((e) => e.type !== "comment"), p = t.filter((e) => e.type === "comment");
1692
1718
  return /* @__PURE__ */ k("div", {
1693
1719
  ...l,
1694
- className: Xn(R.host, c === "dot" ? R.dot : null, n && d !== "processing" ? R.error : null, a === "horizontal" ? R.horizontal : null, c === "number" ? R.number : null, d === "pending" ? R.pending : null, d === "processing" ? R.processing : null, n && d === "processing" ? R.processingError : null, !n && d === "succeeded" ? R.succeeded : null, a === "vertical" ? R.vertical : null, e),
1720
+ className: er(R.host, c === "dot" ? R.dot : null, n && d !== "processing" ? R.error : null, a === "horizontal" ? R.horizontal : null, c === "number" ? R.number : null, d === "pending" ? R.pending : null, d === "processing" ? R.processing : null, n && d === "processing" ? R.processingError : null, !n && d === "succeeded" ? R.succeeded : null, a === "vertical" ? R.vertical : null, e),
1695
1721
  ref: u,
1696
- children: [c === "dot" ? /* @__PURE__ */ O("span", { className: Xn(R.statusIndicator, R.statusIndicatorDot) }) : /* @__PURE__ */ O("span", {
1722
+ children: [c === "dot" ? /* @__PURE__ */ O("span", { className: er(R.statusIndicator, R.statusIndicatorDot) }) : /* @__PURE__ */ O("span", {
1697
1723
  className: R.statusIndicator,
1698
1724
  children: i + 1
1699
1725
  }), /* @__PURE__ */ k("div", {
1700
1726
  className: R.textContainer,
1701
1727
  children: [
1702
- /* @__PURE__ */ k(D, {
1728
+ /* @__PURE__ */ k(E, {
1703
1729
  className: R.title,
1704
1730
  variant: "label-primary-highlight",
1705
1731
  children: [s, /* @__PURE__ */ O("span", { className: R.titleConnectLine })]
1706
1732
  }),
1707
- f.length > 0 ? /* @__PURE__ */ O(D, {
1733
+ f.length > 0 ? /* @__PURE__ */ O(E, {
1708
1734
  className: R.description,
1709
1735
  component: "div",
1710
1736
  variant: "body",
1711
- children: f.map((e, t) => /* @__PURE__ */ k(v, { children: [t > 0 ? " · " : null, Qn(e)] }, `${e.type}-${t}`))
1737
+ children: f.map((e, t) => /* @__PURE__ */ k(se, { children: [t > 0 ? " · " : null, nr(e)] }, `${e.type}-${t}`))
1712
1738
  }) : null,
1713
- p.map((e, t) => /* @__PURE__ */ k(D, {
1714
- style: e.tone === "danger" ? Yn : qn,
1739
+ p.map((e, t) => /* @__PURE__ */ k(E, {
1740
+ style: e.tone === "danger" ? $n : Zn,
1715
1741
  variant: "body",
1716
1742
  children: [/* @__PURE__ */ k("span", {
1717
- style: e.tone === "danger" ? void 0 : Jn,
1743
+ style: e.tone === "danger" ? void 0 : Qn,
1718
1744
  children: [e.label, ":"]
1719
1745
  }), e.text]
1720
1746
  }, `comment-${t}`))
@@ -1722,24 +1748,24 @@ var Zn = y(function({ className: e, descriptionParts: t, error: n, forcePending:
1722
1748
  })]
1723
1749
  });
1724
1750
  });
1725
- function Qn(e) {
1726
- return e.type === "text" ? e.text : e.email?.trim() ? /* @__PURE__ */ k(Te, { children: [
1751
+ function nr(e) {
1752
+ return e.type === "text" ? e.text : e.email?.trim() ? /* @__PURE__ */ k(D, { children: [
1727
1753
  e.prefix,
1728
1754
  ":",
1729
- /* @__PURE__ */ O(Ce, {
1755
+ /* @__PURE__ */ O(we, {
1730
1756
  title: e.email,
1731
1757
  children: ({ ref: t, ...n }) => /* @__PURE__ */ O("span", {
1732
1758
  ...n,
1733
1759
  "data-testid": e.memberId ? `member-tooltip-${e.memberId}` : void 0,
1734
1760
  ref: t,
1735
- style: Kn,
1761
+ style: Xn,
1736
1762
  children: e.label
1737
1763
  })
1738
1764
  })
1739
1765
  ] }) : `${e.prefix}:${e.label}`;
1740
1766
  }
1741
- function $n({ activityLogs: e, formSchema: t = null, instanceState: n, memberProfilesById: r, signatureVerification: i, signaturesById: a, taskDecisions: o = null, taskDecisionsByTaskId: s, tasks: c, workflowSnapshot: l, workflowTokens: u }) {
1742
- let d = x(() => gn(e, c, u, l, n, r, s, a, i, t, o), [
1767
+ function rr({ activityLogs: e, formSchema: t = null, instanceState: n, memberProfilesById: r, signatureVerification: i, signaturesById: a, taskDecisions: o = null, taskDecisionsByTaskId: s, tasks: c, workflowSnapshot: l, workflowTokens: u }) {
1768
+ let d = b(() => $(e, c, u, l, n, r, s, a, i, t, o), [
1743
1769
  e,
1744
1770
  t,
1745
1771
  n,
@@ -1751,27 +1777,27 @@ function $n({ activityLogs: e, formSchema: t = null, instanceState: n, memberPro
1751
1777
  c,
1752
1778
  l,
1753
1779
  u
1754
- ]), f = qt(d), p = d.map((e) => ({
1780
+ ]), f = Q(d), p = d.map((e) => ({
1755
1781
  ...e,
1756
- descriptionParts: e.descriptionParts.filter(Y)
1782
+ descriptionParts: e.descriptionParts.filter(Z)
1757
1783
  }));
1758
1784
  return /* @__PURE__ */ k("div", {
1759
- style: Gn,
1760
- children: [/* @__PURE__ */ O(D, {
1785
+ style: Yn,
1786
+ children: [/* @__PURE__ */ O(E, {
1761
1787
  component: "h2",
1762
1788
  variant: "h3",
1763
1789
  children: "歷程"
1764
- }), p.length > 0 ? /* @__PURE__ */ O(be, {
1790
+ }), p.length > 0 ? /* @__PURE__ */ O(xe, {
1765
1791
  currentStep: f,
1766
1792
  orientation: "vertical",
1767
1793
  type: "dot",
1768
- children: p.map((e) => /* @__PURE__ */ O(Zn, {
1794
+ children: p.map((e) => /* @__PURE__ */ O(tr, {
1769
1795
  descriptionParts: e.descriptionParts,
1770
1796
  error: e.error,
1771
1797
  forcePending: e.forcePending,
1772
1798
  title: e.title
1773
1799
  }, e.id))
1774
- }) : /* @__PURE__ */ O(D, {
1800
+ }) : /* @__PURE__ */ O(E, {
1775
1801
  color: "text-neutral",
1776
1802
  variant: "body",
1777
1803
  children: "尚無歷程紀錄。"
@@ -1779,30 +1805,30 @@ function $n({ activityLogs: e, formSchema: t = null, instanceState: n, memberPro
1779
1805
  });
1780
1806
  }
1781
1807
  // src/views/instances/detail/sections/InstanceWebhookDeliveriesSection.tsx
1782
- var er = {
1808
+ var ir = {
1783
1809
  display: "grid",
1784
1810
  gap: 16
1785
- }, tr = {
1811
+ }, ar = {
1786
1812
  display: "grid",
1787
1813
  gap: 2
1788
- }, nr = {
1814
+ }, or = {
1789
1815
  overflowWrap: "anywhere",
1790
1816
  whiteSpace: "pre-wrap"
1791
1817
  };
1792
- function rr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1793
- let [r, i] = S(null), [a, o] = S(!1), [s, c] = S(null), l = x(() => e.map((e) => ({
1818
+ function sr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1819
+ let [r, i] = x(null), [a, o] = x(!1), [s, c] = x(null), l = b(() => e.map((e) => ({
1794
1820
  delivery: e,
1795
1821
  key: e.id
1796
- })), [e]), u = x(() => [
1822
+ })), [e]), u = b(() => [
1797
1823
  {
1798
1824
  key: "endpoint",
1799
1825
  render: ({ delivery: e }) => /* @__PURE__ */ k("div", {
1800
- style: tr,
1801
- children: [/* @__PURE__ */ O(D, {
1826
+ style: ar,
1827
+ children: [/* @__PURE__ */ O(E, {
1802
1828
  component: "span",
1803
1829
  variant: "body",
1804
1830
  children: e.endpointLabel ?? e.endpointKey
1805
- }), /* @__PURE__ */ k(D, {
1831
+ }), /* @__PURE__ */ k(E, {
1806
1832
  color: "text-neutral",
1807
1833
  component: "span",
1808
1834
  variant: "caption",
@@ -1821,13 +1847,13 @@ function rr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1821
1847
  },
1822
1848
  {
1823
1849
  key: "status",
1824
- render: ({ delivery: e }) => /* @__PURE__ */ O(ir, { status: e.status }),
1850
+ render: ({ delivery: e }) => /* @__PURE__ */ O(cr, { status: e.status }),
1825
1851
  title: "狀態",
1826
1852
  width: 120
1827
1853
  },
1828
1854
  {
1829
1855
  key: "attemptCount",
1830
- render: ({ delivery: e }) => /* @__PURE__ */ O(D, {
1856
+ render: ({ delivery: e }) => /* @__PURE__ */ O(E, {
1831
1857
  component: "span",
1832
1858
  variant: "body",
1833
1859
  children: e.attemptCount
@@ -1838,20 +1864,20 @@ function rr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1838
1864
  {
1839
1865
  key: "lastError",
1840
1866
  render: ({ delivery: e }) => e.lastErrorCode && e.status !== "SENT" ? /* @__PURE__ */ k("div", {
1841
- style: tr,
1842
- children: [/* @__PURE__ */ O(D, {
1867
+ style: ar,
1868
+ children: [/* @__PURE__ */ O(E, {
1843
1869
  color: "text-error",
1844
1870
  component: "span",
1845
1871
  variant: "body",
1846
1872
  children: e.lastErrorCode
1847
- }), e.lastErrorDetail ? /* @__PURE__ */ O(D, {
1873
+ }), e.lastErrorDetail ? /* @__PURE__ */ O(E, {
1848
1874
  color: "text-neutral",
1849
1875
  component: "span",
1850
- style: nr,
1876
+ style: or,
1851
1877
  variant: "caption",
1852
1878
  children: e.lastErrorDetail
1853
1879
  }) : null]
1854
- }) : /* @__PURE__ */ O(D, {
1880
+ }) : /* @__PURE__ */ O(E, {
1855
1881
  color: "text-neutral",
1856
1882
  component: "span",
1857
1883
  variant: "body",
@@ -1862,18 +1888,18 @@ function rr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1862
1888
  },
1863
1889
  {
1864
1890
  key: "time",
1865
- render: ({ delivery: e }) => /* @__PURE__ */ O(D, {
1891
+ render: ({ delivery: e }) => /* @__PURE__ */ O(E, {
1866
1892
  component: "span",
1867
1893
  variant: "body",
1868
- children: ar(e)
1894
+ children: lr(e)
1869
1895
  }),
1870
1896
  title: "時間",
1871
1897
  width: 220
1872
1898
  }
1873
- ], [n]), d = x(() => ({
1899
+ ], [n]), d = b(() => ({
1874
1900
  render: ({ delivery: e }) => e.status === "FAILED" && e.attemptCount > 0 ? [{
1875
1901
  disabled: () => a,
1876
- icon: F,
1902
+ icon: at,
1877
1903
  iconType: "leading",
1878
1904
  name: "重新傳送",
1879
1905
  onClick: () => {
@@ -1896,29 +1922,29 @@ function rr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1896
1922
  }
1897
1923
  }
1898
1924
  return /* @__PURE__ */ k("div", {
1899
- style: er,
1925
+ style: ir,
1900
1926
  children: [
1901
- /* @__PURE__ */ O(D, {
1927
+ /* @__PURE__ */ O(E, {
1902
1928
  component: "h2",
1903
1929
  variant: "h3",
1904
1930
  children: "外部系統通知"
1905
1931
  }),
1906
- s ? /* @__PURE__ */ O(D, {
1932
+ s ? /* @__PURE__ */ O(E, {
1907
1933
  color: "text-error",
1908
1934
  variant: "body",
1909
1935
  children: s
1910
1936
  }) : null,
1911
- l.length > 0 ? /* @__PURE__ */ O(xe, {
1937
+ l.length > 0 ? /* @__PURE__ */ O(Se, {
1912
1938
  actions: d,
1913
1939
  columns: u,
1914
1940
  dataSource: l,
1915
1941
  fullWidth: !0
1916
- }) : /* @__PURE__ */ O(D, {
1942
+ }) : /* @__PURE__ */ O(E, {
1917
1943
  color: "text-neutral",
1918
1944
  variant: "body",
1919
1945
  children: "此案件沒有外部系統通知。"
1920
1946
  }),
1921
- /* @__PURE__ */ O(T, {
1947
+ /* @__PURE__ */ O(w, {
1922
1948
  cancelText: "取消",
1923
1949
  confirmText: "重新傳送",
1924
1950
  loading: a,
@@ -1932,7 +1958,7 @@ function rr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1932
1958
  showModalHeader: !0,
1933
1959
  supportingText: "會以相同的投遞編號重新送出,接收端可據此避免重複處理。",
1934
1960
  title: "重新傳送通知",
1935
- children: /* @__PURE__ */ k(D, {
1961
+ children: /* @__PURE__ */ k(E, {
1936
1962
  variant: "body",
1937
1963
  children: [
1938
1964
  "確定要重新通知「",
@@ -1944,47 +1970,47 @@ function rr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1944
1970
  ]
1945
1971
  });
1946
1972
  }
1947
- function ir({ status: e }) {
1948
- return e === "SENT" ? /* @__PURE__ */ O(fe, {
1973
+ function cr({ status: e }) {
1974
+ return e === "SENT" ? /* @__PURE__ */ O(pe, {
1949
1975
  size: "sub",
1950
1976
  text: "已送達",
1951
1977
  variant: "dot-success"
1952
- }) : e === "FAILED" ? /* @__PURE__ */ O(fe, {
1978
+ }) : e === "FAILED" ? /* @__PURE__ */ O(pe, {
1953
1979
  size: "sub",
1954
1980
  text: "失敗",
1955
1981
  variant: "dot-error"
1956
- }) : /* @__PURE__ */ O(fe, {
1982
+ }) : /* @__PURE__ */ O(pe, {
1957
1983
  size: "sub",
1958
1984
  text: e === "PENDING" ? "等待傳送" : "傳送中",
1959
1985
  variant: "dot-info"
1960
1986
  });
1961
1987
  }
1962
- function ar(e) {
1988
+ function lr(e) {
1963
1989
  return e.sentAt ? `送達:${t(e.sentAt)}` : e.status === "PENDING" && e.nextRetryAt ? `下次重試:${t(e.nextRetryAt)}` : e.lastAttemptAt ? `最後嘗試:${t(e.lastAttemptAt)}` : `建立:${t(e.createdAt)}`;
1964
1990
  }
1965
1991
  // src/views/instances/viewer-field-access.ts
1966
- function or(e, t) {
1992
+ function ur(e, t) {
1967
1993
  let n = new Map(t.map((e) => [e.id, e]));
1968
1994
  return new Set(e.filter((e) => e.eventType === "TASK_CREATED").map((e) => e.taskId === null ? void 0 : n.get(e.taskId)).filter((e) => e !== void 0 && !e.isAdhoc).map((e) => e.nodeId));
1969
1995
  }
1970
- function sr({ activityLogs: e, actingTask: t, instance: n, tasks: r }) {
1996
+ function dr({ activityLogs: e, actingTask: t, instance: n, tasks: r }) {
1971
1997
  let i = n.workflowSnapshot;
1972
- return M({
1998
+ return qe({
1973
1999
  definition: i,
1974
2000
  fieldKeys: (n.formDefinitionSnapshot.schema?.fields ?? []).map((e) => e.fieldKey),
1975
2001
  isAdhocTask: t?.isAdhoc ?? !1,
1976
2002
  nodeId: t?.nodeId ?? null,
1977
- revealedFieldKeys: qe(i, or(e, r))
2003
+ revealedFieldKeys: Ke(i, ur(e, r))
1978
2004
  });
1979
2005
  }
1980
2006
  // src/views/instances/detail/InstanceDetailView.tsx
1981
- function cr(e) {
2007
+ function fr(e) {
1982
2008
  return `還有 ${new Set(Object.keys(e).map(j)).size} 個補填欄位需要完成`;
1983
2009
  }
1984
- var lr = 3e3, ur = 40, dr = 184, fr = 96, pr = {
2010
+ var pr = 3e3, mr = 40, hr = 184, gr = 96, _r = {
1985
2011
  display: "grid",
1986
2012
  gap: 16
1987
- }, mr = {
2013
+ }, vr = {
1988
2014
  background: "#f8fafc",
1989
2015
  border: "1px solid #e2e8f0",
1990
2016
  borderRadius: 8,
@@ -1992,7 +2018,7 @@ var lr = 3e3, ur = 40, dr = 184, fr = 96, pr = {
1992
2018
  minHeight: 440,
1993
2019
  overflow: "hidden",
1994
2020
  width: "min(80vw, 1040px)"
1995
- }, hr = {
2021
+ }, yr = {
1996
2022
  background: "#ffffff",
1997
2023
  border: "1px solid #cbd5e1",
1998
2024
  borderRadius: 8,
@@ -2002,24 +2028,24 @@ var lr = 3e3, ur = 40, dr = 184, fr = 96, pr = {
2002
2028
  minHeight: 82,
2003
2029
  padding: 12,
2004
2030
  width: 184
2005
- }, gr = {
2031
+ }, br = {
2006
2032
  borderRadius: 999,
2007
2033
  fontSize: 12,
2008
2034
  fontWeight: 600,
2009
2035
  justifySelf: "start",
2010
2036
  lineHeight: "18px",
2011
2037
  padding: "0 8px"
2012
- }, _r = {
2038
+ }, xr = {
2013
2039
  color: "#64748b",
2014
2040
  fontSize: 12,
2015
2041
  overflow: "hidden",
2016
2042
  textOverflow: "ellipsis",
2017
2043
  whiteSpace: "nowrap"
2018
- }, vr = { opacity: 0 }, yr = {
2044
+ }, Sr = { opacity: 0 }, Cr = {
2019
2045
  display: "flex",
2020
2046
  flexWrap: "wrap",
2021
2047
  gap: 8
2022
- }, br = {
2048
+ }, wr = {
2023
2049
  alignItems: "center",
2024
2050
  background: "#ffffff",
2025
2051
  border: "1px solid #cbd5e1",
@@ -2031,28 +2057,28 @@ var lr = 3e3, ur = 40, dr = 184, fr = 96, pr = {
2031
2057
  gap: 6,
2032
2058
  lineHeight: "20px",
2033
2059
  padding: "4px 8px"
2034
- }, xr = {
2060
+ }, Tr = {
2035
2061
  display: "grid",
2036
2062
  gap: 16
2037
- }, Sr = { workflowRuntime: Mr };
2038
- function Cr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHistory: u = !0, showSignatures: d = !0, showTasks: f = !0, showWebhookDeliveries: p = !0 }) {
2039
- let { member: v } = n(), y = v?.memberId ?? null, le = p && r(v), [de, fe] = S([]), [w, pe] = S(null), [me, he] = S([]), [ye, be] = S([]), [xe, Ce] = S([]), [we, Ee] = S([]), [Oe, ke] = S(null), [A, Me] = S([]), [Re, ze] = S([]), [Be, Ue] = S([]), [qe, j] = S(null), [M, Qe] = S(!0), [N, P] = S(!1), [et, F] = S(!1), [at, ot] = S(!1), [st, ut] = S(!1), [L, ft] = S(""), [pt, mt] = S(!1), [ht, R] = S({}), [z, _t] = S({}), { clearAfterResubmit: vt, comment: yt, setComment: bt } = Sn(a), [xt, St] = S({}), [B, wt] = S(null), [Tt, Dt] = S(null), [Ot, V] = S([]), kt = L.trim(), H = ue(null), At = ue(0), jt = we.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS");
2040
- b(() => {
2063
+ }, Er = { workflowRuntime: Ir };
2064
+ function Dr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHistory: u = !0, showSignatures: d = !0, showTasks: f = !0, showWebhookDeliveries: p = !0 }) {
2065
+ let { member: se } = n(), y = se?.memberId ?? null, ue = p && r(se), [fe, pe] = x([]), [C, me] = x(null), [he, ge] = x([]), [be, xe] = x([]), [Se, we] = x([]), [Te, Ee] = x([]), [Oe, ke] = x(null), [A, Me] = x([]), [Re, ze] = x([]), [Be, Ue] = x([]), [Ke, j] = x(null), [qe, Qe] = x(!0), [$e, N] = x(!1), [tt, at] = x(!1), [ot, st] = x(!1), [ct, I] = x(!1), [L, ft] = x(""), [pt, mt] = x(!1), [ht, R] = x({}), [z, _t] = x({}), { clearAfterResubmit: vt, comment: yt, setComment: bt } = Tn(a), [xt, St] = x({}), [B, V] = x(null), [wt, Et] = x(null), [Dt, H] = x([]), Ot = L.trim(), U = de(null), kt = de(0), At = Te.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS");
2066
+ le(() => {
2041
2067
  dn();
2042
- }, [y, a]), b(() => {
2043
- if (!le || !jt || At.current >= ur) return;
2068
+ }, [y, a]), le(() => {
2069
+ if (!ue || !At || kt.current >= mr) return;
2044
2070
  let e = setTimeout(() => {
2045
- At.current += 1, mn();
2046
- }, lr);
2071
+ kt.current += 1, mn();
2072
+ }, pr);
2047
2073
  return () => clearTimeout(e);
2048
2074
  }, [
2049
- le,
2050
- jt,
2051
- we
2052
- ]), b(() => {
2053
- _t(w?.formData ?? {}), St({});
2054
- }, [w]);
2055
- let Mt = ce((e, t) => {
2075
+ ue,
2076
+ At,
2077
+ Te
2078
+ ]), le(() => {
2079
+ _t(C?.formData ?? {}), St({});
2080
+ }, [C]);
2081
+ let jt = ce((e, t) => {
2056
2082
  St((n) => {
2057
2083
  let r = n[e];
2058
2084
  return r?.hasValue === t.hasValue && r.selectionExpired === (t.selectionExpired === !0) && r.status === t.status ? n : {
@@ -2064,102 +2090,102 @@ function Cr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2064
2090
  }
2065
2091
  };
2066
2092
  });
2067
- }, []), W = x(() => zt(A, y), [y, A]), G = x(() => W && w ? w.workflowSnapshot.nodes.find((e) => e.id === W.nodeId) ?? null : null, [W, w]), Pt = G?.type === "userTask" && G.data.returnBehavior.allowReturn, Ft = G?.type === "userTask" && G.data.allowReject !== !1, Lt = G?.type === "userTask" && G.data.allowTransfer !== !1, Rt = G?.type === "userTask" && G.data.allowAddSigner, Bt = !(!w || w.initiatorMemberId !== y || w.state !== "RUNNING" && w.state !== "RETURNED"), Vt = !!(w && w.initiatorMemberId === y && w.state === "RETURNED"), q = x(() => W && !W.isAdhoc && G?.type === "userTask" && Ke(G).size > 0 ? G : null, [W, G]), Ht = q ? W?.id ?? null : null, Ut = o(), [Wt, J] = S({}), [Gt, Kt] = S({}), [Y, qt] = S(!1);
2068
- b(() => {
2069
- J({}), Kt({}), qt(!1);
2070
- }, [Ht]);
2071
- let X = w?.formDefinitionSnapshot.schema ?? null, Z = x(() => q && X ? ie(X, q) : null, [q, X]), Q = x(() => Z && w ? Je(Z.fields, {
2072
- ...w.formData,
2073
- ...Wt
2093
+ }, []), G = b(() => Bt(A, y), [y, A]), K = b(() => G && C ? C.workflowSnapshot.nodes.find((e) => e.id === G.nodeId) ?? null : null, [G, C]), Nt = K?.type === "userTask" && K.data.returnBehavior.allowReturn, Pt = K?.type === "userTask" && K.data.allowReject !== !1, It = K?.type === "userTask" && K.data.allowTransfer !== !1, Lt = K?.type === "userTask" && K.data.allowAddSigner, Rt = !(!C || C.initiatorMemberId !== y || C.state !== "RUNNING" && C.state !== "RETURNED"), zt = !!(C && C.initiatorMemberId === y && C.state === "RETURNED"), J = b(() => G && !G.isAdhoc && K?.type === "userTask" && Ge(K).size > 0 ? K : null, [G, K]), Vt = J ? G?.id ?? null : null, Ht = o(), [Ut, Wt] = x({}), [Gt, Y] = x({}), [Kt, qt] = x(!1);
2094
+ le(() => {
2095
+ Wt({}), Y({}), qt(!1);
2096
+ }, [Vt]);
2097
+ let X = C?.formDefinitionSnapshot.schema ?? null, Z = b(() => J && X ? ie(X, J) : null, [J, X]), Q = b(() => Z && C ? Je(Z.fields, {
2098
+ ...C.formData,
2099
+ ...Ut
2074
2100
  }) : null, [
2075
- Wt,
2101
+ Ut,
2076
2102
  Z,
2077
- w
2078
- ]), Jt = x(() => q && Z && Q && w ? m({
2079
- draft: Wt,
2080
- node: q,
2103
+ C
2104
+ ]), Jt = b(() => J && Z && Q && C ? m({
2105
+ draft: Ut,
2106
+ node: J,
2081
2107
  schema: Z,
2082
- stored: w.formData,
2108
+ stored: C.formData,
2083
2109
  values: Q
2084
2110
  }) : {}, [
2085
- Wt,
2086
- q,
2111
+ Ut,
2112
+ J,
2087
2113
  Z,
2088
2114
  Q,
2089
- w
2090
- ]), Yt = x(() => w ? sr({
2091
- activityLogs: de,
2092
- actingTask: W,
2093
- instance: w,
2115
+ C
2116
+ ]), Yt = b(() => C ? dr({
2117
+ activityLogs: fe,
2118
+ actingTask: G,
2119
+ instance: C,
2094
2120
  tasks: A
2095
2121
  }) : void 0, [
2096
- de,
2097
- W,
2098
- w,
2122
+ fe,
2123
+ G,
2124
+ C,
2099
2125
  A
2100
- ]), Xt = x(() => w ? oe(w.workflowSnapshot, q) : void 0, [q, w]), Zt = x(() => new Map(Be.map((e) => [e.memberId, e])), [Be]), Qt = gt(x(() => X ? h(X, Jt) : [], [Jt, X])), $t = x(() => q && Q && X && w?.formDataFingerprint ? {
2101
- expectedFormDataFingerprint: w.formDataFingerprint,
2102
- formData: ne(Jt, q),
2103
- summary: g(X, q, Jt, new Map([...Zt.keys()].map((e) => [e, K(e, Zt)])), Qt)
2126
+ ]), Xt = b(() => C ? oe(C.workflowSnapshot, J) : void 0, [J, C]), Zt = b(() => new Map(Be.map((e) => [e.memberId, e])), [Be]), Qt = gt(b(() => X ? h(X, Jt) : [], [Jt, X])), $t = b(() => J && Q && X && C?.formDataFingerprint ? {
2127
+ expectedFormDataFingerprint: C.formDataFingerprint,
2128
+ formData: ne(Jt, J),
2129
+ summary: g(X, J, Jt, new Map([...Zt.keys()].map((e) => [e, q(e, Zt)])), Qt)
2104
2130
  } : null, [
2105
2131
  Jt,
2106
- q,
2132
+ J,
2107
2133
  Qt,
2108
2134
  Q,
2109
- w,
2135
+ C,
2110
2136
  Zt,
2111
2137
  X
2112
2138
  ]);
2113
2139
  function en(e) {
2114
- if (!q) return;
2115
- let t = Ke(q), n = Object.entries(e).filter(([e, n]) => t.has(e) && JSON.stringify(n) !== JSON.stringify(Q?.[e]));
2116
- J((e) => ({
2140
+ if (!J) return;
2141
+ let t = Ge(J), n = Object.entries(e).filter(([e, n]) => t.has(e) && JSON.stringify(n) !== JSON.stringify(Q?.[e]));
2142
+ Wt((e) => ({
2117
2143
  ...e,
2118
2144
  ...Object.fromEntries(n)
2119
- })), Kt({});
2145
+ })), Y({});
2120
2146
  }
2121
2147
  async function tn() {
2122
- if (q && !w?.formDataFingerprint) ge.error("無法確認表單版本,請重新整理頁面後再同意。");
2148
+ if (J && !C?.formDataFingerprint) _e.error("無法確認表單版本,請重新整理頁面後再同意。");
2123
2149
  else {
2124
- if (q && Q && X && w?.formDefinitionSnapshot.uiSchema) {
2125
- F(!0);
2150
+ if (J && Q && X && C?.formDefinitionSnapshot.uiSchema) {
2151
+ at(!0);
2126
2152
  let e = await Xe({
2127
- schema: ee(X, q),
2128
- uiSchema: w.formDefinitionSnapshot.uiSchema,
2153
+ schema: ee(X, J),
2154
+ uiSchema: C.formDefinitionSnapshot.uiSchema,
2129
2155
  values: Q
2130
- }).catch((e) => (ge.error(_(e)), null)).finally(() => F(!1));
2156
+ }).catch((e) => (_e.error(_(e)), null)).finally(() => at(!1));
2131
2157
  if (!e) return;
2132
2158
  if (!e.valid) {
2133
- Kt(e.errors), e.firstInvalidFieldKey && Ye(e.firstInvalidFieldKey), ge.warning(cr(e.errors));
2159
+ Y(e.errors), e.firstInvalidFieldKey && Ye(e.firstInvalidFieldKey), _e.warning(fr(e.errors));
2134
2160
  return;
2135
2161
  }
2136
2162
  }
2137
- H.current?.handleApprove();
2163
+ U.current?.handleApprove();
2138
2164
  }
2139
2165
  }
2140
2166
  function nn(e, t = []) {
2141
- if (!q || !X) return !1;
2167
+ if (!J || !X) return !1;
2142
2168
  if (re(e)) return qt(!0), !0;
2143
- let n = se(e, X, q, t);
2144
- return n ? (Kt(n), Ye(Object.keys(n)[0] ?? ""), ge.warning(cr(n)), !0) : !1;
2169
+ let n = v(e, X, J, t);
2170
+ return n ? (Y(n), Ye(Object.keys(n)[0] ?? ""), _e.warning(fr(n)), !0) : !1;
2145
2171
  }
2146
2172
  async function rn() {
2147
2173
  await dn(), qt(!1);
2148
2174
  }
2149
- let an = x(() => c(me), [me]), on = x(() => new Map(xe.map((e) => [e.id, e])), [xe]), sn = x(() => w ? Or(w.workflowSnapshot) : null, [w]), cn = x(() => w && sn ? Dr(sn, A, Re, w.state) : [], [
2150
- w,
2175
+ let an = b(() => c(he), [he]), on = b(() => new Map(Se.map((e) => [e.id, e])), [Se]), sn = b(() => C ? Mr(C.workflowSnapshot) : null, [C]), cn = b(() => C && sn ? jr(sn, A, Re, C.state) : [], [
2176
+ C,
2151
2177
  sn,
2152
2178
  A,
2153
2179
  Re
2154
- ]), ln = x(() => sn ? kr(sn) : [], [sn]), un = x(() => w ? Tr(w.workflowSnapshot) : [], [w]);
2180
+ ]), ln = b(() => sn ? Nr(sn) : [], [sn]), un = b(() => C ? kr(C.workflowSnapshot) : [], [C]);
2155
2181
  async function dn() {
2156
2182
  Qe(!0), j(null);
2157
2183
  try {
2158
2184
  let e = await Pe(a);
2159
- fe(e.activityLogs), pe(e.instance), Me(e.tasks), ze(e.workflowTokens);
2185
+ pe(e.activityLogs), me(e.instance), Me(e.tasks), ze(e.workflowTokens);
2160
2186
  let t = await Ae(e.instance.id), [n, r, i, o, s] = await Promise.all([
2161
- xn(e.tasks),
2162
- yn({
2187
+ wn(e.tasks),
2188
+ Sn({
2163
2189
  ...e,
2164
2190
  adhocDirectives: t
2165
2191
  }),
@@ -2167,7 +2193,7 @@ function Cr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2167
2193
  Le(e.instance.id),
2168
2194
  fn(e.instance.id)
2169
2195
  ]);
2170
- he(n), Ue(r), be(i), Ce(o.signatures), ke(o.verification), V(t), Ee(s);
2196
+ ge(n), Ue(r), xe(i), we(o.signatures), ke(o.verification), H(t), Ee(s);
2171
2197
  } catch (e) {
2172
2198
  j(_(e));
2173
2199
  } finally {
@@ -2175,10 +2201,10 @@ function Cr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2175
2201
  }
2176
2202
  }
2177
2203
  async function fn(e) {
2178
- return le ? Ne(e).catch(() => []) : [];
2204
+ return ue ? Ne(e).catch(() => []) : [];
2179
2205
  }
2180
2206
  async function pn(e) {
2181
- await He(e.id), At.current = 0, await dn();
2207
+ await He(e.id), kt.current = 0, await dn();
2182
2208
  }
2183
2209
  async function mn() {
2184
2210
  let e = await fn(a);
@@ -2196,48 +2222,48 @@ function Cr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2196
2222
  let t = await Fe({ id: e });
2197
2223
  window.open(t, "_blank", "noopener,noreferrer");
2198
2224
  } catch (e) {
2199
- ge.error(_(e));
2225
+ _e.error(_(e));
2200
2226
  }
2201
2227
  }
2202
2228
  async function _n(e) {
2203
2229
  if (!y) return;
2204
2230
  let t = await Ie({ id: e.id });
2205
- wt(e), Dt(t);
2231
+ V(e), Et(t);
2206
2232
  }
2207
2233
  async function vn() {
2208
- if (y && w && Bt) {
2209
- P(!0), j(null), R({});
2234
+ if (y && C && Rt) {
2235
+ N(!0), j(null), R({});
2210
2236
  try {
2211
2237
  await De({
2212
2238
  cancelledByMemberId: y,
2213
- comment: kt || null,
2214
- instanceId: w.id
2239
+ comment: Ot || null,
2240
+ instanceId: C.id
2215
2241
  }), ft(""), mt(!1), await dn();
2216
2242
  } catch (e) {
2217
2243
  j(_(e));
2218
2244
  } finally {
2219
- P(!1);
2245
+ N(!1);
2220
2246
  }
2221
2247
  }
2222
2248
  }
2223
- async function bn() {
2224
- if (!y || !w || !Vt) return;
2225
- P(!0), j(null), R({});
2249
+ async function yn() {
2250
+ if (!y || !C || !zt) return;
2251
+ N(!0), j(null), R({});
2226
2252
  let e = i(Object.values(xt));
2227
2253
  if (e) {
2228
- j(e), P(!1);
2254
+ j(e), N(!1);
2229
2255
  return;
2230
2256
  }
2231
- if (Ut.blockMessage) {
2232
- j(Ut.blockMessage), P(!1);
2257
+ if (Ht.blockMessage) {
2258
+ j(Ht.blockMessage), N(!1);
2233
2259
  return;
2234
2260
  }
2235
- let t = w.formDefinitionSnapshot.schema ? ae(w.formDefinitionSnapshot.schema, w.workflowSnapshot) : null, n = te(t ? Je(t.fields, z) : z, w.workflowSnapshot);
2261
+ let t = C.formDefinitionSnapshot.schema ? ae(C.formDefinitionSnapshot.schema, C.workflowSnapshot) : null, n = te(t ? Je(t.fields, z) : z, C.workflowSnapshot);
2236
2262
  try {
2237
- if (t && w.formDefinitionSnapshot.uiSchema) {
2263
+ if (t && C.formDefinitionSnapshot.uiSchema) {
2238
2264
  let e = await Xe({
2239
2265
  schema: t,
2240
- uiSchema: w.formDefinitionSnapshot.uiSchema,
2266
+ uiSchema: C.formDefinitionSnapshot.uiSchema,
2241
2267
  values: n
2242
2268
  });
2243
2269
  if (!e.valid) {
@@ -2249,91 +2275,91 @@ function Cr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2249
2275
  comment: yt,
2250
2276
  formData: n,
2251
2277
  initiatorMemberId: y,
2252
- instanceId: w.id,
2253
- title: w.title
2254
- }), vt(w.id), await dn();
2278
+ instanceId: C.id,
2279
+ title: C.title
2280
+ }), vt(C.id), await dn();
2255
2281
  } catch (e) {
2256
2282
  j(_(e));
2257
2283
  } finally {
2258
- P(!1);
2284
+ N(!1);
2259
2285
  }
2260
2286
  }
2261
- let $ = N || at || et;
2262
- return /* @__PURE__ */ k(Te, { children: [
2263
- /* @__PURE__ */ O(_e, { children: /* @__PURE__ */ k(Ge, {
2264
- description: w ? [
2265
- Nt(w.state),
2266
- t(w.startedAt),
2267
- Et(w, Zt)
2268
- ].filter(U).join(" · ") : "載入案件內容。",
2269
- title: w?.title ?? "簽核案件",
2287
+ let $ = $e || ot || tt;
2288
+ return /* @__PURE__ */ k(D, { children: [
2289
+ /* @__PURE__ */ O(ve, { children: /* @__PURE__ */ k(M, {
2290
+ description: C ? [
2291
+ Mt(C.state),
2292
+ t(C.startedAt),
2293
+ Tt(C, Zt)
2294
+ ].filter(W).join(" · ") : "載入案件內容。",
2295
+ title: C?.title ?? "簽核案件",
2270
2296
  children: [
2271
- w ? /* @__PURE__ */ O(C, {
2297
+ C ? /* @__PURE__ */ O(S, {
2272
2298
  "aria-label": "查看流程圖",
2273
- icon: I,
2299
+ icon: P,
2274
2300
  iconType: "icon-only",
2275
- onClick: () => ut(!0),
2301
+ onClick: () => I(!0),
2276
2302
  title: "查看流程圖",
2277
2303
  variant: "base-secondary",
2278
2304
  children: "流程圖"
2279
2305
  }) : null,
2280
- Bt ? /* @__PURE__ */ O(C, {
2306
+ Rt ? /* @__PURE__ */ O(S, {
2281
2307
  disabled: $,
2282
- icon: $e,
2308
+ icon: et,
2283
2309
  iconType: "leading",
2284
2310
  onClick: () => mt(!0),
2285
2311
  variant: "destructive-secondary",
2286
2312
  children: "取消案件"
2287
2313
  }) : null,
2288
- W ? /* @__PURE__ */ k(Te, { children: [
2289
- Rt ? /* @__PURE__ */ k(Te, { children: [/* @__PURE__ */ O(C, {
2314
+ G ? /* @__PURE__ */ k(D, { children: [
2315
+ Lt ? /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(S, {
2290
2316
  disabled: $,
2291
- icon: nt,
2317
+ icon: rt,
2292
2318
  iconType: "leading",
2293
- onClick: () => H.current?.openAdhocModal("COUNTERSIGN"),
2319
+ onClick: () => U.current?.openAdhocModal("COUNTERSIGN"),
2294
2320
  variant: "base-secondary",
2295
2321
  children: "會簽"
2296
- }, "adhoc-countersign"), /* @__PURE__ */ O(C, {
2322
+ }, "adhoc-countersign"), /* @__PURE__ */ O(S, {
2297
2323
  disabled: $,
2298
- icon: nt,
2324
+ icon: rt,
2299
2325
  iconType: "leading",
2300
- onClick: () => H.current?.openAdhocModal("PRE_APPROVAL"),
2326
+ onClick: () => U.current?.openAdhocModal("PRE_APPROVAL"),
2301
2327
  variant: "base-secondary",
2302
2328
  children: "加簽"
2303
2329
  }, "adhoc-pre-approval")] }) : null,
2304
- /* @__PURE__ */ O(C, {
2330
+ /* @__PURE__ */ O(S, {
2305
2331
  disabled: $,
2306
- icon: tt,
2332
+ icon: nt,
2307
2333
  iconType: "leading",
2308
- onClick: () => H.current?.openAdhocModal("STAGE_NOTIFY"),
2334
+ onClick: () => U.current?.openAdhocModal("STAGE_NOTIFY"),
2309
2335
  variant: "base-secondary",
2310
2336
  children: "通知設定"
2311
2337
  }, "adhoc-notify"),
2312
- Pt ? /* @__PURE__ */ O(C, {
2338
+ Nt ? /* @__PURE__ */ O(S, {
2313
2339
  disabled: $,
2314
- icon: rt,
2340
+ icon: it,
2315
2341
  iconType: "leading",
2316
- onClick: () => H.current?.openReturnModal(),
2342
+ onClick: () => U.current?.openReturnModal(),
2317
2343
  variant: "base-secondary",
2318
2344
  children: "退回"
2319
2345
  }, "task-return") : null,
2320
- Lt ? /* @__PURE__ */ O(C, {
2346
+ It ? /* @__PURE__ */ O(S, {
2321
2347
  disabled: $,
2322
- icon: it,
2348
+ icon: F,
2323
2349
  iconType: "leading",
2324
- onClick: () => H.current?.openTransferModal(),
2350
+ onClick: () => U.current?.openTransferModal(),
2325
2351
  variant: "base-secondary",
2326
2352
  children: "轉派"
2327
2353
  }, "task-transfer") : null,
2328
- Ft ? /* @__PURE__ */ O(C, {
2354
+ Pt ? /* @__PURE__ */ O(S, {
2329
2355
  disabled: $,
2330
- icon: $e,
2356
+ icon: et,
2331
2357
  iconType: "leading",
2332
- onClick: () => H.current?.openRejectModal(),
2358
+ onClick: () => U.current?.openRejectModal(),
2333
2359
  variant: "destructive-secondary",
2334
2360
  children: "拒絕"
2335
2361
  }, "task-reject") : null,
2336
- /* @__PURE__ */ O(C, {
2362
+ /* @__PURE__ */ O(S, {
2337
2363
  disabled: $,
2338
2364
  icon: Ze,
2339
2365
  iconType: "leading",
@@ -2346,41 +2372,41 @@ function Cr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2346
2372
  ] }) : null
2347
2373
  ]
2348
2374
  }) }),
2349
- /* @__PURE__ */ k(ve, { children: [
2350
- l ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O(Dn, {
2351
- attachments: ye,
2352
- canResubmitInstance: Vt,
2353
- deciding: N,
2354
- error: qe,
2375
+ /* @__PURE__ */ k(ye, { children: [
2376
+ l ? /* @__PURE__ */ O(T, { children: /* @__PURE__ */ O(jn, {
2377
+ attachments: be,
2378
+ canResubmitInstance: zt,
2379
+ deciding: $e,
2380
+ error: Ke,
2355
2381
  fieldAccess: Yt,
2356
2382
  fieldLabelMarkers: Xt,
2357
- fill: Z && Q && q ? {
2383
+ fill: Z && Q && J ? {
2358
2384
  errors: Gt,
2359
- fieldCount: Ke(q).size,
2385
+ fieldCount: Ge(J).size,
2360
2386
  onChange: en,
2361
2387
  schema: Z,
2362
2388
  value: Q
2363
2389
  } : null,
2364
- instance: w,
2365
- loading: M,
2366
- onDataSourceStateChange: Mt,
2390
+ instance: C,
2391
+ loading: qe,
2392
+ onDataSourceStateChange: jt,
2367
2393
  onDownloadAttachment: (e) => {
2368
2394
  gn(e);
2369
2395
  },
2370
- onFileUploadStateChange: Ut.onFileUploadStateChange,
2371
- onReloadAfterConflict: Y ? () => void rn() : null,
2396
+ onFileUploadStateChange: Ht.onFileUploadStateChange,
2397
+ onReloadAfterConflict: Kt ? () => void rn() : null,
2372
2398
  onResubmitFormChange: (e) => {
2373
2399
  _t(e), R({});
2374
2400
  },
2375
2401
  onResubmitCommentChange: bt,
2376
- onResubmitInstance: () => void bn(),
2402
+ onResubmitInstance: () => void yn(),
2377
2403
  onUploadAttachment: hn,
2378
2404
  resubmitComment: yt,
2379
2405
  resubmitFormData: z,
2380
2406
  resubmitFormErrors: ht
2381
2407
  }) }) : null,
2382
- s ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O(kn, {
2383
- attachments: ye,
2408
+ s ? /* @__PURE__ */ O(T, { children: /* @__PURE__ */ O(Nn, {
2409
+ attachments: be,
2384
2410
  onDownload: (e) => {
2385
2411
  gn(e.id);
2386
2412
  },
@@ -2388,53 +2414,53 @@ function Cr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2388
2414
  _n(e);
2389
2415
  }
2390
2416
  }) }) : null,
2391
- f ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O(Bn, {
2392
- adhocDirectives: Ot,
2417
+ f ? /* @__PURE__ */ O(T, { children: /* @__PURE__ */ O(Wn, {
2418
+ adhocDirectives: Dt,
2393
2419
  currentMemberId: y,
2394
2420
  fill: $t,
2395
- instance: w,
2421
+ instance: C,
2396
2422
  memberProfilesById: Zt,
2397
2423
  onChanged: dn,
2398
- onDecidingChange: ot,
2424
+ onDecidingChange: st,
2399
2425
  onFillApproveError: nn,
2400
- ref: H,
2426
+ ref: U,
2401
2427
  tasks: A
2402
2428
  }) }) : null,
2403
- d ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O(Wn, {
2429
+ d ? /* @__PURE__ */ O(T, { children: /* @__PURE__ */ O(Jn, {
2404
2430
  signatureVerification: Oe,
2405
- signatures: xe
2431
+ signatures: Se
2406
2432
  }) }) : null,
2407
- le && we.length > 0 ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O(rr, {
2408
- deliveries: we,
2433
+ ue && Te.length > 0 ? /* @__PURE__ */ O(T, { children: /* @__PURE__ */ O(sr, {
2434
+ deliveries: Te,
2409
2435
  onRetry: pn,
2410
- readNodeLabel: (e) => It(e, w?.workflowSnapshot ?? null)
2436
+ readNodeLabel: (e) => Ft(e, C?.workflowSnapshot ?? null)
2411
2437
  }) }) : null,
2412
- u ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O($n, {
2413
- activityLogs: de,
2438
+ u ? /* @__PURE__ */ O(T, { children: /* @__PURE__ */ O(rr, {
2439
+ activityLogs: fe,
2414
2440
  formSchema: X,
2415
- instanceState: w?.state ?? "RUNNING",
2441
+ instanceState: C?.state ?? "RUNNING",
2416
2442
  memberProfilesById: Zt,
2417
2443
  signatureVerification: Oe,
2418
2444
  signaturesById: on,
2419
- taskDecisions: me,
2445
+ taskDecisions: he,
2420
2446
  taskDecisionsByTaskId: an,
2421
2447
  tasks: A,
2422
- workflowSnapshot: w?.workflowSnapshot ?? null,
2448
+ workflowSnapshot: C?.workflowSnapshot ?? null,
2423
2449
  workflowTokens: Re
2424
2450
  }) }) : null
2425
2451
  ] }),
2426
- w ? /* @__PURE__ */ O(T, {
2452
+ C ? /* @__PURE__ */ O(w, {
2427
2453
  modalType: "standard",
2428
- onClose: () => ut(!1),
2429
- open: st,
2454
+ onClose: () => I(!1),
2455
+ open: ct,
2430
2456
  showModalHeader: !0,
2431
2457
  size: "wide",
2432
- supportingText: `${Nt(w.state)} · ${t(w.startedAt)}`,
2458
+ supportingText: `${Mt(C.state)} · ${t(C.startedAt)}`,
2433
2459
  title: "流程圖",
2434
2460
  children: /* @__PURE__ */ k("div", {
2435
- style: pr,
2461
+ style: _r,
2436
2462
  children: [/* @__PURE__ */ O("div", {
2437
- style: mr,
2463
+ style: vr,
2438
2464
  children: /* @__PURE__ */ k(dt, {
2439
2465
  edges: ln,
2440
2466
  fitView: !0,
@@ -2444,41 +2470,41 @@ function Cr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2444
2470
  nodes: cn,
2445
2471
  nodesDraggable: !1,
2446
2472
  nodesFocusable: !1,
2447
- nodeTypes: Sr,
2473
+ nodeTypes: Er,
2448
2474
  panOnDrag: !0,
2449
2475
  proOptions: { hideAttribution: !0 },
2450
- children: [/* @__PURE__ */ O(ct, {}), /* @__PURE__ */ O(lt, { showInteractive: !1 })]
2476
+ children: [/* @__PURE__ */ O(lt, {}), /* @__PURE__ */ O(ut, { showInteractive: !1 })]
2451
2477
  })
2452
2478
  }), un.length > 0 ? /* @__PURE__ */ O("div", {
2453
- style: yr,
2479
+ style: Cr,
2454
2480
  children: un.map((e) => /* @__PURE__ */ O("span", {
2455
- style: br,
2481
+ style: wr,
2456
2482
  children: e
2457
2483
  }, e))
2458
2484
  }) : null]
2459
2485
  })
2460
2486
  }) : null,
2461
- /* @__PURE__ */ O(T, {
2487
+ /* @__PURE__ */ O(w, {
2462
2488
  modalType: "standard",
2463
2489
  onClose: () => {
2464
- wt(null), Dt(null);
2490
+ V(null), Et(null);
2465
2491
  },
2466
- open: !!(B && Tt),
2492
+ open: !!(B && wt),
2467
2493
  showModalHeader: !0,
2468
2494
  size: "wide",
2469
2495
  supportingText: B?.filename ?? void 0,
2470
2496
  title: "PDF 預覽",
2471
- children: Tt ? /* @__PURE__ */ O(Ct, {
2497
+ children: wt ? /* @__PURE__ */ O(Ct, {
2472
2498
  filename: B?.filename ?? "PDF 預覽",
2473
- fileUrl: Tt,
2499
+ fileUrl: wt,
2474
2500
  onDownload: B ? () => void gn(B.id) : void 0
2475
2501
  }) : null
2476
2502
  }),
2477
- /* @__PURE__ */ O(T, {
2503
+ /* @__PURE__ */ O(w, {
2478
2504
  cancelText: "保留案件",
2479
2505
  confirmButtonProps: { variant: "destructive-primary" },
2480
2506
  confirmText: "確認取消",
2481
- loading: N,
2507
+ loading: $e,
2482
2508
  modalStatusType: "error",
2483
2509
  modalType: "standard",
2484
2510
  onCancel: () => mt(!1),
@@ -2490,18 +2516,18 @@ function Cr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2490
2516
  supportingText: "取消後會關閉目前待簽任務與候選簽核人。",
2491
2517
  title: "取消案件",
2492
2518
  children: /* @__PURE__ */ k("div", {
2493
- style: xr,
2494
- children: [/* @__PURE__ */ k(D, {
2519
+ style: Tr,
2520
+ children: [/* @__PURE__ */ k(E, {
2495
2521
  variant: "body",
2496
2522
  children: [
2497
2523
  "確定要取消「",
2498
- w?.title ?? "",
2524
+ C?.title ?? "",
2499
2525
  "」嗎?"
2500
2526
  ]
2501
2527
  }), /* @__PURE__ */ O(e, {
2502
2528
  label: "取消原因",
2503
2529
  name: "cancelComment",
2504
- children: /* @__PURE__ */ O(Se, {
2530
+ children: /* @__PURE__ */ O(Ce, {
2505
2531
  onChange: (e) => ft(e.target.value),
2506
2532
  placeholder: "可填寫取消原因",
2507
2533
  resize: "vertical",
@@ -2513,21 +2539,21 @@ function Cr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2513
2539
  })
2514
2540
  ] });
2515
2541
  }
2516
- function wr(e) {
2542
+ function Or(e) {
2517
2543
  return e.data.label ? e.data.label : e.data.isDefault ? "其他情況" : e.data.condition ?? "";
2518
2544
  }
2519
- function Tr(e) {
2520
- return e.edges.map(wr).filter((e) => e.trim().length > 0);
2545
+ function kr(e) {
2546
+ return e.edges.map(Or).filter((e) => e.trim().length > 0);
2521
2547
  }
2522
- function Er(e) {
2548
+ function Ar(e) {
2523
2549
  return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
2524
2550
  }
2525
- function Dr(e, t, n, r) {
2551
+ function jr(e, t, n, r) {
2526
2552
  return e.nodes.map((e) => {
2527
- let i = vn(e, t, n, r);
2553
+ let i = xn(e, t, n, r);
2528
2554
  return {
2529
2555
  data: {
2530
- kindLabel: Er(e.type),
2556
+ kindLabel: Ar(e.type),
2531
2557
  label: e.data.label,
2532
2558
  secondaryLabel: i.secondaryLabel,
2533
2559
  statusLabel: i.statusLabel,
@@ -2541,7 +2567,7 @@ function Dr(e, t, n, r) {
2541
2567
  };
2542
2568
  });
2543
2569
  }
2544
- function Or(e) {
2570
+ function Mr(e) {
2545
2571
  let t = new ft.graphlib.Graph();
2546
2572
  return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
2547
2573
  nodesep: 56,
@@ -2549,8 +2575,8 @@ function Or(e) {
2549
2575
  ranksep: 120
2550
2576
  }), e.nodes.forEach((e) => {
2551
2577
  t.setNode(e.id, {
2552
- height: fr,
2553
- width: dr
2578
+ height: gr,
2579
+ width: hr
2554
2580
  });
2555
2581
  }), e.edges.forEach((e) => {
2556
2582
  t.setEdge(e.source, e.target);
@@ -2561,16 +2587,16 @@ function Or(e) {
2561
2587
  return n ? {
2562
2588
  ...e,
2563
2589
  position: {
2564
- x: n.x - dr / 2,
2565
- y: n.y - fr / 2
2590
+ x: n.x - hr / 2,
2591
+ y: n.y - gr / 2
2566
2592
  }
2567
2593
  } : e;
2568
2594
  })
2569
2595
  };
2570
2596
  }
2571
- function kr(e) {
2597
+ function Nr(e) {
2572
2598
  return e.edges.map((e) => {
2573
- let t = wr(e);
2599
+ let t = Or(e);
2574
2600
  return {
2575
2601
  animated: !1,
2576
2602
  id: e.id,
@@ -2598,25 +2624,25 @@ function kr(e) {
2598
2624
  };
2599
2625
  });
2600
2626
  }
2601
- function Ar(e) {
2627
+ function Pr(e) {
2602
2628
  return e === "current" ? {
2603
- ...hr,
2629
+ ...yr,
2604
2630
  border: "1px solid var(--mzn-color-primary, #0057ff)",
2605
2631
  boxShadow: "0 0 0 3px rgba(0, 87, 255, 0.14)"
2606
2632
  } : e === "completed" ? {
2607
- ...hr,
2633
+ ...yr,
2608
2634
  border: "1px solid #16a34a"
2609
2635
  } : e === "cancelled" ? {
2610
- ...hr,
2636
+ ...yr,
2611
2637
  border: "1px solid #dc2626",
2612
2638
  opacity: .72
2613
2639
  } : e === "waiting" ? {
2614
- ...hr,
2640
+ ...yr,
2615
2641
  border: "1px dashed #64748b"
2616
- } : hr;
2642
+ } : yr;
2617
2643
  }
2618
- function jr(e) {
2619
- let t = gr;
2644
+ function Fr(e) {
2645
+ let t = br;
2620
2646
  return e === "current" ? {
2621
2647
  ...t,
2622
2648
  background: "#eff6ff",
@@ -2639,17 +2665,17 @@ function jr(e) {
2639
2665
  color: "#64748b"
2640
2666
  };
2641
2667
  }
2642
- function Mr({ data: e }) {
2668
+ function Ir({ data: e }) {
2643
2669
  return /* @__PURE__ */ k("div", {
2644
- style: Ar(e.tone),
2670
+ style: Pr(e.tone),
2645
2671
  children: [
2646
- /* @__PURE__ */ O(ut, {
2672
+ /* @__PURE__ */ O(I, {
2647
2673
  isConnectable: !1,
2648
2674
  position: L.Left,
2649
- style: vr,
2675
+ style: Sr,
2650
2676
  type: "target"
2651
2677
  }),
2652
- /* @__PURE__ */ O(D, {
2678
+ /* @__PURE__ */ O(E, {
2653
2679
  component: "span",
2654
2680
  ellipsis: !0,
2655
2681
  title: e.label,
@@ -2657,23 +2683,23 @@ function Mr({ data: e }) {
2657
2683
  children: e.label
2658
2684
  }),
2659
2685
  /* @__PURE__ */ O("span", {
2660
- style: jr(e.tone),
2686
+ style: Fr(e.tone),
2661
2687
  children: e.statusLabel
2662
2688
  }),
2663
2689
  /* @__PURE__ */ O("span", {
2664
2690
  title: e.secondaryLabel,
2665
- style: _r,
2691
+ style: xr,
2666
2692
  children: e.secondaryLabel || e.kindLabel
2667
2693
  }),
2668
- /* @__PURE__ */ O(ut, {
2694
+ /* @__PURE__ */ O(I, {
2669
2695
  isConnectable: !1,
2670
2696
  position: L.Right,
2671
- style: vr,
2697
+ style: Sr,
2672
2698
  type: "source"
2673
2699
  })
2674
2700
  ]
2675
2701
  });
2676
2702
  }
2677
- export { Bn as a, Wn as i, rr as n, kn as o, $n as r, Dn as s, Cr as t };
2703
+ export { Wn as a, Jn as i, sr as n, Nn as o, rr as r, jn as s, Dr as t };
2678
2704
 
2679
- //# sourceMappingURL=detail-Bv90gvy0.js.map
2705
+ //# sourceMappingURL=detail-Dnc4PPWO.js.map