@rytass/bpm-core-react 0.17.7 → 0.17.8

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 (33) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/chunks/{compose-DjEJi5Dv.cjs → compose-Cock_B2Q.cjs} +2 -2
  3. package/dist/chunks/{compose-DjEJi5Dv.cjs.map → compose-Cock_B2Q.cjs.map} +1 -1
  4. package/dist/chunks/{compose-WekGZj74.js → compose-jnvnnVfN.js} +2 -2
  5. package/dist/chunks/{compose-WekGZj74.js.map → compose-jnvnnVfN.js.map} +1 -1
  6. package/dist/chunks/{designer-D87ILhjz.js → designer-B8Gvew_k.js} +6 -2
  7. package/dist/chunks/designer-B8Gvew_k.js.map +1 -0
  8. package/dist/chunks/{designer-DESS0CMl.cjs → designer-CAEFV1ve.cjs} +2 -2
  9. package/dist/chunks/designer-CAEFV1ve.cjs.map +1 -0
  10. package/dist/chunks/detail-COh5sjAt.cjs +2 -0
  11. package/dist/chunks/detail-COh5sjAt.cjs.map +1 -0
  12. package/dist/chunks/{detail-URwxkcro.js → detail-D6X61pkg.js} +744 -739
  13. package/dist/chunks/detail-D6X61pkg.js.map +1 -0
  14. package/dist/pages/instances/detail/index.cjs +1 -1
  15. package/dist/pages/instances/detail/index.js +1 -1
  16. package/dist/pages/templates/compose/index.cjs +1 -1
  17. package/dist/pages/templates/compose/index.js +1 -1
  18. package/dist/pages/templates/designer/index.cjs +1 -1
  19. package/dist/pages/templates/designer/index.js +1 -1
  20. package/dist/views/instances/detail/index.cjs +1 -1
  21. package/dist/views/instances/detail/index.js +1 -1
  22. package/dist/views/instances/detail/sections/InstanceTasksSection.d.cts +7 -0
  23. package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +7 -0
  24. package/dist/views/templates/compose/index.cjs +1 -1
  25. package/dist/views/templates/compose/index.js +1 -1
  26. package/dist/views/templates/designer/index.cjs +1 -1
  27. package/dist/views/templates/designer/index.js +1 -1
  28. package/package.json +3 -3
  29. package/dist/chunks/designer-D87ILhjz.js.map +0 -1
  30. package/dist/chunks/designer-DESS0CMl.cjs.map +0 -1
  31. package/dist/chunks/detail-D49NuNCn.cjs +0 -2
  32. package/dist/chunks/detail-D49NuNCn.cjs.map +0 -1
  33. package/dist/chunks/detail-URwxkcro.js.map +0 -1
@@ -5,22 +5,22 @@ import { t as n } from "./bpm-form-field-Cao0rMol.js";
5
5
  import { t as r } from "./use-bpm-member-D57LKe_u.js";
6
6
  import { t as i } from "./format-member-label-DudVI55w.js";
7
7
  import { t as a } from "./task-node-label-CWZgOBj0.js";
8
- import { a as o, c as s, i as c, l, n as u, o as d, r as f, s as p, t as ee, u as m } from "./approver-filled-form-DuQGPtNB.js";
9
- import { o as te, t as ne } from "./FormRendererView-BsTwZkqU.js";
8
+ import { a as o, c as s, i as c, l, n as u, o as d, r as f, s as p, t as ee, u as te } from "./approver-filled-form-DuQGPtNB.js";
9
+ import { o as m, t as ne } from "./FormRendererView-BsTwZkqU.js";
10
10
  import '../style.css';import '../detail.css';/* empty css */
11
- import { Fragment as re, forwardRef as h, useCallback as ie, useEffect as g, useImperativeHandle as ae, useMemo as _, useRef as oe, useState as v } from "react";
11
+ import { Fragment as h, forwardRef as re, useCallback as g, useEffect as ie, useImperativeHandle as ae, useMemo as _, useRef as oe, useState as v } from "react";
12
12
  import { AutoComplete as se, Badge as ce, Button as y, Description as b, DescriptionContent as le, InlineMessage as x, Input as ue, Message as de, Modal as S, PageHeader as fe, Section as pe, SectionGroup as me, Select as C, Stepper as he, Table as ge, Textarea as _e, Tooltip as ve, Typography as w } from "@mezzanine-ui/react";
13
- import { Fragment as ye, jsx as T, jsxs as E } from "react/jsx-runtime";
14
- import { cancelAdhocDirective as be, cancelApprovalInstance as xe, configureAdhocCompletionNotification as Se, configureAdhocStageNotification as Ce, decideTask as we, listAdhocDirectives as Te, listAttachments as Ee, listTaskDecisions as D, listWorkflowWebhookDeliveries as De, readApprovalInstance as Oe, readAttachmentDownloadUrl as ke, readAttachmentPreviewUrl as Ae, readInstanceSignatures as je, requestAdhocCountersign as Me, requestAdhocPreApproval as Ne, resolveMemberProfiles as Pe, resubmitApprovalInstance as Fe, retryWorkflowWebhookDelivery as Ie, searchMembers as O, uploadAttachment as Le } from "@rytass/bpm-core-client/workflow";
15
- import Re from "@mezzanine-ui/react/ContentHeader";
16
- import { CheckedIcon as ze, ChevronLeftIcon as Be, ChevronRightIcon as Ve, DangerousOutlineIcon as He, DownloadIcon as Ue, FileSearchIcon as We, NotificationUnreadIcon as Ge, PlusIcon as Ke, RefreshCcwIcon as k, ResetIcon as qe, ShareIcon as Je, UserIcon as Ye, ZoomInIcon as Xe, ZoomOutIcon as A } from "@mezzanine-ui/icons";
17
- import { readNodeFillableFieldKeys as Ze, readRevealedFieldKeys as Qe, readTopLevelFieldKey as $e, resolveFieldAccess as et } from "@rytass/bpm-core-shared";
18
- import { buildFormRendererValues as tt, focusFormRendererField as nt, readFormDataSourceErrorMessage as rt, validateFormRendererValues as j } from "@rytass/bpm-core-client/form";
19
- import { Background as M, Controls as it, Handle as at, Position as N, ReactFlow as ot } from "@xyflow/react";
20
- import * as P from "dagre";
21
- import { Document as st, Page as ct } from "react-pdf";
22
- import { stepClasses as F } from "@mezzanine-ui/core/stepper";
23
- var I = {
13
+ import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
14
+ import { cancelAdhocDirective as ye, cancelApprovalInstance as be, configureAdhocCompletionNotification as xe, configureAdhocStageNotification as Se, decideTask as Ce, listAdhocDirectives as we, listAttachments as Te, listTaskDecisions as O, listWorkflowWebhookDeliveries as Ee, readApprovalInstance as De, readAttachmentDownloadUrl as Oe, readAttachmentPreviewUrl as ke, readInstanceSignatures as Ae, requestAdhocCountersign as je, requestAdhocPreApproval as Me, resolveMemberProfiles as Ne, resubmitApprovalInstance as Pe, retryWorkflowWebhookDelivery as Fe, searchMembers as k, uploadAttachment as Ie } from "@rytass/bpm-core-client/workflow";
15
+ import Le from "@mezzanine-ui/react/ContentHeader";
16
+ import { CheckedIcon as Re, ChevronLeftIcon as ze, ChevronRightIcon as Be, DangerousOutlineIcon as Ve, DownloadIcon as He, FileSearchIcon as Ue, NotificationUnreadIcon as We, PlusIcon as Ge, RefreshCcwIcon as Ke, ResetIcon as qe, ShareIcon as A, UserIcon as Je, ZoomInIcon as Ye, ZoomOutIcon as j } from "@mezzanine-ui/icons";
17
+ import { readNodeFillableFieldKeys as M, readRevealedFieldKeys as Xe, readTopLevelFieldKey as Ze, resolveFieldAccess as Qe } from "@rytass/bpm-core-shared";
18
+ import { buildFormRendererValues as $e, focusFormRendererField as et, readFormDataSourceErrorMessage as N, validateFormRendererValues as tt } from "@rytass/bpm-core-client/form";
19
+ import { Background as nt, Controls as P, Handle as F, Position as I, ReactFlow as rt } from "@xyflow/react";
20
+ import * as L from "dagre";
21
+ import { Document as it, Page as at } from "react-pdf";
22
+ import { stepClasses as R } from "@mezzanine-ui/core/stepper";
23
+ var z = {
24
24
  root: "bpm_root_ehm7w",
25
25
  toolbar: "bpm_toolbar_R-tis",
26
26
  pageControls: "bpm_pageControls_jM-rC",
@@ -29,10 +29,10 @@ var I = {
29
29
  viewport: "bpm_viewport_DQXms",
30
30
  page: "bpm_page_Cv5Rg",
31
31
  state: "bpm_state_bpgp3"
32
- }, lt = 760, ut = 920, dt = 320, ft = 32, pt = .75, L = 1.75, mt = .25;
33
- function ht({ filename: e, fileUrl: t, onDownload: n }) {
34
- let r = oe(null), [i, a] = v(null), [o, s] = v(1), [c, l] = v(1), [u, d] = v(lt);
35
- g(() => {
32
+ }, ot = 760, st = 920, ct = 320, lt = 32, ut = .75, dt = 1.75, ft = .25;
33
+ function pt({ filename: e, fileUrl: t, onDownload: n }) {
34
+ let r = oe(null), [i, a] = v(null), [o, s] = v(1), [c, l] = v(1), [u, d] = v(ot);
35
+ ie(() => {
36
36
  let e = r.current;
37
37
  if (!e || typeof ResizeObserver > "u") return;
38
38
  let t = new ResizeObserver((e) => {
@@ -40,45 +40,45 @@ function ht({ filename: e, fileUrl: t, onDownload: n }) {
40
40
  t && d(t);
41
41
  });
42
42
  return t.observe(e), () => t.disconnect();
43
- }, []), g(() => {
43
+ }, []), ie(() => {
44
44
  a(null), s(1), l(1);
45
45
  }, [t]);
46
46
  let f = _(() => {
47
- let e = Math.max(dt, u - ft);
48
- return Math.round(Math.min(ut, e) * c);
49
- }, [c, u]), p = ie((e) => {
47
+ let e = Math.max(ct, u - lt);
48
+ return Math.round(Math.min(st, e) * c);
49
+ }, [c, u]), p = g((e) => {
50
50
  a(e.numPages), s(1);
51
- }, []), ee = o > 1, m = i !== null && o < i, te = c > pt, ne = c < L, re = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, h = `${Math.round(c * 100)}%`;
52
- return /* @__PURE__ */ E("section", {
51
+ }, []), ee = o > 1, te = i !== null && o < i, m = c > ut, ne = c < dt, h = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, re = `${Math.round(c * 100)}%`;
52
+ return /* @__PURE__ */ D("section", {
53
53
  "aria-label": `${e} PDF 預覽`,
54
- className: I.root,
55
- children: [/* @__PURE__ */ E("div", {
56
- className: I.toolbar,
54
+ className: z.root,
55
+ children: [/* @__PURE__ */ D("div", {
56
+ className: z.toolbar,
57
57
  children: [
58
- /* @__PURE__ */ E("div", {
59
- className: I.pageControls,
58
+ /* @__PURE__ */ D("div", {
59
+ className: z.pageControls,
60
60
  "aria-label": "頁面切換",
61
61
  children: [
62
- /* @__PURE__ */ T(y, {
62
+ /* @__PURE__ */ E(y, {
63
63
  "aria-label": "上一頁",
64
64
  disabled: !ee,
65
- icon: Be,
65
+ icon: ze,
66
66
  onClick: () => {
67
67
  s((e) => Math.max(1, e - 1));
68
68
  },
69
69
  size: "minor",
70
70
  variant: "base-secondary"
71
71
  }),
72
- /* @__PURE__ */ T(w, {
73
- className: I.counter,
72
+ /* @__PURE__ */ E(w, {
73
+ className: z.counter,
74
74
  component: "span",
75
75
  variant: "body",
76
- children: re
76
+ children: h
77
77
  }),
78
- /* @__PURE__ */ T(y, {
78
+ /* @__PURE__ */ E(y, {
79
79
  "aria-label": "下一頁",
80
- disabled: !m,
81
- icon: Ve,
80
+ disabled: !te,
81
+ icon: Be,
82
82
  onClick: () => {
83
83
  s((e) => i === null ? e : Math.min(i, e + 1));
84
84
  },
@@ -87,40 +87,40 @@ function ht({ filename: e, fileUrl: t, onDownload: n }) {
87
87
  })
88
88
  ]
89
89
  }),
90
- /* @__PURE__ */ E("div", {
91
- className: I.zoomControls,
90
+ /* @__PURE__ */ D("div", {
91
+ className: z.zoomControls,
92
92
  "aria-label": "縮放",
93
93
  children: [
94
- /* @__PURE__ */ T(y, {
94
+ /* @__PURE__ */ E(y, {
95
95
  "aria-label": "縮小",
96
- disabled: !te,
97
- icon: A,
96
+ disabled: !m,
97
+ icon: j,
98
98
  onClick: () => {
99
- l((e) => Math.max(pt, e - mt));
99
+ l((e) => Math.max(ut, e - ft));
100
100
  },
101
101
  size: "minor",
102
102
  variant: "base-secondary"
103
103
  }),
104
- /* @__PURE__ */ T(w, {
105
- className: I.counter,
104
+ /* @__PURE__ */ E(w, {
105
+ className: z.counter,
106
106
  component: "span",
107
107
  variant: "body",
108
- children: h
108
+ children: re
109
109
  }),
110
- /* @__PURE__ */ T(y, {
110
+ /* @__PURE__ */ E(y, {
111
111
  "aria-label": "放大",
112
112
  disabled: !ne,
113
- icon: Xe,
113
+ icon: Ye,
114
114
  onClick: () => {
115
- l((e) => Math.min(L, e + mt));
115
+ l((e) => Math.min(dt, e + ft));
116
116
  },
117
117
  size: "minor",
118
118
  variant: "base-secondary"
119
119
  })
120
120
  ]
121
121
  }),
122
- n ? /* @__PURE__ */ T(y, {
123
- icon: Ue,
122
+ n ? /* @__PURE__ */ E(y, {
123
+ icon: He,
124
124
  iconType: "leading",
125
125
  onClick: n,
126
126
  size: "minor",
@@ -128,19 +128,19 @@ function ht({ filename: e, fileUrl: t, onDownload: n }) {
128
128
  children: "下載"
129
129
  }) : null
130
130
  ]
131
- }), /* @__PURE__ */ T("div", {
132
- className: I.viewport,
131
+ }), /* @__PURE__ */ E("div", {
132
+ className: z.viewport,
133
133
  ref: r,
134
- children: /* @__PURE__ */ T(st, {
135
- error: /* @__PURE__ */ T(R, { message: "PDF 無法載入。" }),
134
+ children: /* @__PURE__ */ E(it, {
135
+ error: /* @__PURE__ */ E(B, { message: "PDF 無法載入。" }),
136
136
  file: t,
137
- loading: /* @__PURE__ */ T(R, { message: "正在載入 PDF..." }),
138
- noData: /* @__PURE__ */ T(R, { message: "沒有可預覽的 PDF。" }),
137
+ loading: /* @__PURE__ */ E(B, { message: "正在載入 PDF..." }),
138
+ noData: /* @__PURE__ */ E(B, { message: "沒有可預覽的 PDF。" }),
139
139
  onLoadSuccess: p,
140
140
  suspense: !1,
141
- children: /* @__PURE__ */ T(ct, {
142
- className: I.page,
143
- loading: /* @__PURE__ */ T(R, { message: "正在載入頁面..." }),
141
+ children: /* @__PURE__ */ E(at, {
142
+ className: z.page,
143
+ loading: /* @__PURE__ */ E(B, { message: "正在載入頁面..." }),
144
144
  pageNumber: o,
145
145
  renderAnnotationLayer: !0,
146
146
  renderTextLayer: !0,
@@ -150,10 +150,10 @@ function ht({ filename: e, fileUrl: t, onDownload: n }) {
150
150
  })]
151
151
  });
152
152
  }
153
- function R({ message: e }) {
154
- return /* @__PURE__ */ T("div", {
155
- className: I.state,
156
- children: /* @__PURE__ */ T(w, {
153
+ function B({ message: e }) {
154
+ return /* @__PURE__ */ E("div", {
155
+ className: z.state,
156
+ children: /* @__PURE__ */ E(w, {
157
157
  color: "text-neutral",
158
158
  variant: "body",
159
159
  children: e
@@ -162,110 +162,110 @@ function R({ message: e }) {
162
162
  }
163
163
  //#endregion
164
164
  //#region src/views/instances/detail/submitted-by.ts
165
- function gt({ initiatorMemberId: e, submittedByMemberId: t }) {
165
+ function mt({ initiatorMemberId: e, submittedByMemberId: t }) {
166
166
  return t && t !== e ? t : null;
167
167
  }
168
- function _t(e, t) {
169
- let n = gt(e);
168
+ function ht(e, t) {
169
+ let n = mt(e);
170
170
  if (!n || !e.initiatorMemberId) return null;
171
171
  let r = (e) => t.get(e)?.name ?? e;
172
172
  return `由 ${r(n)} 代 ${r(e.initiatorMemberId)} 送出`;
173
173
  }
174
174
  //#endregion
175
175
  //#region src/views/instances/detail/sections/shared.ts
176
- function vt(e) {
177
- let t = z(e, "from"), n = z(e, "to"), r = z(e, "reason");
176
+ function gt(e) {
177
+ let t = V(e, "from"), n = V(e, "to"), r = V(e, "reason");
178
178
  return !t || !n || !r ? null : {
179
179
  from: t,
180
180
  reason: r,
181
- ruleId: z(e, "ruleId"),
181
+ ruleId: V(e, "ruleId"),
182
182
  to: n
183
183
  };
184
184
  }
185
- function yt(e) {
185
+ function _t(e) {
186
186
  try {
187
187
  let t = JSON.parse(e);
188
- return Array.isArray(t) ? t.map((e) => xt(e) ? vt(e) : null).filter((e) => e !== null) : [];
188
+ return Array.isArray(t) ? t.map((e) => U(e) ? gt(e) : null).filter((e) => e !== null) : [];
189
189
  } catch {
190
190
  return [];
191
191
  }
192
192
  }
193
- function z(e, t) {
193
+ function V(e, t) {
194
194
  let n = e[t];
195
195
  return typeof n == "string" ? n : null;
196
196
  }
197
- function B(e, t) {
197
+ function vt(e, t) {
198
198
  let n = e[t];
199
199
  return Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
200
200
  }
201
- function bt(e, t) {
201
+ function yt(e, t) {
202
202
  let n = e[t];
203
203
  return typeof n == "number" ? n : null;
204
204
  }
205
- function V(e) {
205
+ function H(e) {
206
206
  return typeof e == "string" && e.trim().length > 0;
207
207
  }
208
- function xt(e) {
208
+ function U(e) {
209
209
  return typeof e == "object" && !!e;
210
210
  }
211
- function St(e) {
211
+ function bt(e) {
212
212
  return e.status === "PENDING" || e.status === "IN_PROGRESS";
213
213
  }
214
- function H(e) {
215
- return rt(e) || (e instanceof Error ? e.message : "發生未知錯誤");
214
+ function W(e) {
215
+ return N(e) || (e instanceof Error ? e.message : "發生未知錯誤");
216
216
  }
217
- function U(e) {
217
+ function xt(e) {
218
218
  return !Number.isFinite(e) || e <= 0 ? "-" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
219
219
  }
220
- function W(e) {
220
+ function St(e) {
221
221
  return e.length > 16 ? `${e.slice(0, 12)}...` : e;
222
222
  }
223
223
  function Ct(e) {
224
224
  return e === "APPROVED" ? "已同意" : e === "CANCELLED" ? "已取消" : e === "DRAFT" ? "草稿" : e === "EXPIRED" ? "已逾期" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "RUNNING" ? "進行中" : e;
225
225
  }
226
- function wt(e) {
226
+ function G(e) {
227
227
  return e === "PENDING" ? "待處理" : e === "IN_PROGRESS" ? "處理中" : e === "COMPLETED" ? "已完成" : e === "CANCELLED" ? "已取消" : e === "TRANSFERRED" ? "已轉派" : e;
228
228
  }
229
- function Tt(e) {
229
+ function K(e) {
230
230
  return e === "APPROVED" ? "同意" : e === "REJECTED" ? "拒絕" : e === "RETURNED" ? "退回" : e === "TRANSFERRED" ? "轉派" : e;
231
231
  }
232
- function G(e) {
232
+ function wt(e) {
233
233
  return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
234
234
  }
235
- function Et(e, t) {
235
+ function Tt(e, t) {
236
236
  return t?.nodes.find((t) => t.id === e)?.data.label ?? e;
237
237
  }
238
- function K(e, t) {
238
+ function q(e, t) {
239
239
  if (!e) return "-";
240
240
  let n = t.get(e);
241
241
  return n ? i(n.name, n.email, "fullwidth") : e;
242
242
  }
243
- function Dt(e, t = /* @__PURE__ */ new Map()) {
244
- let n = yt(e.delegationChainJson);
245
- if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => K(e, t)).join("、")}` : "未指定";
246
- let r = K(e.assigneeMemberId, t), i = K(e.originalAssigneeMemberId, t);
243
+ function Et(e, t = /* @__PURE__ */ new Map()) {
244
+ let n = _t(e.delegationChainJson);
245
+ if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => q(e, t)).join("、")}` : "未指定";
246
+ let r = q(e.assigneeMemberId, t), i = q(e.originalAssigneeMemberId, t);
247
247
  return n.length === 0 || e.originalAssigneeMemberId === e.assigneeMemberId ? r : `${r}(原:${i})`;
248
248
  }
249
- function Ot(e, t) {
249
+ function Dt(e, t) {
250
250
  return t ? e.assigneeMemberId === t || (e.openCandidateMemberIds ?? e.candidateMemberIds).includes(t) : !1;
251
251
  }
252
- function kt(e, t) {
253
- let n = e.filter((e) => Ot(e, t) && (e.status === "PENDING" || e.status === "IN_PROGRESS"));
252
+ function Ot(e, t) {
253
+ let n = e.filter((e) => Dt(e, t) && (e.status === "PENDING" || e.status === "IN_PROGRESS"));
254
254
  return n.find((e) => !e.isAdhoc) ?? n[0] ?? null;
255
255
  }
256
- function At(e, t) {
256
+ function kt(e, t) {
257
257
  if (t.type !== "userTask" || !t.data.returnBehavior.allowReturn) return [];
258
258
  if (t.data.returnBehavior.allowedTargets === "ANY") return e.nodes.filter((e) => e.id !== t.id).map((e) => ({
259
259
  id: e.id,
260
- name: `${e.data.label}(${G(e.type)})`
260
+ name: `${e.data.label}(${wt(e.type)})`
261
261
  }));
262
262
  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);
263
263
  return r ? [{
264
264
  id: r.id,
265
- name: `${r.data.label}(${G(r.type)})`
265
+ name: `${r.data.label}(${wt(r.type)})`
266
266
  }] : [];
267
267
  }
268
- function q(e) {
268
+ function At(e) {
269
269
  return {
270
270
  email: e.email,
271
271
  id: e.memberId,
@@ -297,11 +297,11 @@ function jt({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
297
297
  valid: !1
298
298
  };
299
299
  }
300
- function Mt(e) {
300
+ function J(e) {
301
301
  return !!e;
302
302
  }
303
- function Nt(e) {
304
- if (!xt(e)) return null;
303
+ function Mt(e) {
304
+ if (!U(e)) return null;
305
305
  let t = e.email, n = e.id, r = e.name;
306
306
  return typeof n == "string" && typeof r == "string" ? {
307
307
  email: typeof t == "string" ? t : null,
@@ -309,7 +309,7 @@ function Nt(e) {
309
309
  name: r
310
310
  } : null;
311
311
  }
312
- function Pt(e, t) {
312
+ function Nt(e, t) {
313
313
  let n = e.trim().toLocaleLowerCase();
314
314
  if (!n) return null;
315
315
  let r = t.filter((e) => [
@@ -319,21 +319,21 @@ function Pt(e, t) {
319
319
  ].some((e) => e.toLocaleLowerCase().includes(n)));
320
320
  return r.length === 1 ? r[0] ?? null : null;
321
321
  }
322
- function J(e) {
323
- return V(e) ? {
322
+ function Y(e) {
323
+ return H(e) ? {
324
324
  text: e,
325
325
  type: "text"
326
326
  } : null;
327
327
  }
328
- function Ft(e, t, n = "neutral") {
329
- return V(t) ? {
328
+ function Pt(e, t, n = "neutral") {
329
+ return H(t) ? {
330
330
  label: e,
331
331
  text: t,
332
332
  tone: n,
333
333
  type: "comment"
334
334
  } : null;
335
335
  }
336
- function It(e, t, n, r) {
336
+ function Ft(e, t, n, r) {
337
337
  let i = t ? n.get(t) : null;
338
338
  return {
339
339
  email: i?.email ?? null,
@@ -343,38 +343,38 @@ function It(e, t, n, r) {
343
343
  type: "member"
344
344
  };
345
345
  }
346
- function Y(e) {
346
+ function It(e) {
347
347
  return !!e;
348
348
  }
349
- function X(e) {
349
+ function Lt(e) {
350
350
  let t = e.findIndex((e) => e.id.startsWith("pending-task-") || e.id.startsWith("future-node-"));
351
351
  return t === -1 ? e.length : t;
352
352
  }
353
- function Z(e) {
354
- return e.eventType === "INSTANCE_STARTED" || e.eventType === "INSTANCE_CANCELLED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED" || e.eventType === "TASK_CANDIDATE_ACTIVATED" || e.eventType === "TASK_REASSIGNED" || Lt(e) || Q(e.eventType, Ut(e));
353
+ function X(e) {
354
+ return e.eventType === "INSTANCE_STARTED" || e.eventType === "INSTANCE_CANCELLED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED" || e.eventType === "TASK_CANDIDATE_ACTIVATED" || e.eventType === "TASK_REASSIGNED" || Z(e) || zt(e.eventType, Ut(e));
355
355
  }
356
- function Lt(e) {
357
- return e.eventType === "TASK_CREATED" && B(Ut(e), "sequentialCandidateMemberIds").length > 0;
356
+ function Z(e) {
357
+ return e.eventType === "TASK_CREATED" && vt(Ut(e), "sequentialCandidateMemberIds").length > 0;
358
358
  }
359
- function Rt(e) {
359
+ function Q(e) {
360
360
  if (e.eventType !== "TASK_CANDIDATE_ACTIVATED" && e.eventType !== "TASK_CREATED") return [];
361
361
  let t = Ut(e);
362
362
  return [
363
- ...B(t, "sequentialCandidateMemberIds"),
364
- z(t, "candidateMemberId"),
365
- z(t, "previousMemberId")
366
- ].filter(V);
363
+ ...vt(t, "sequentialCandidateMemberIds"),
364
+ V(t, "candidateMemberId"),
365
+ V(t, "previousMemberId")
366
+ ].filter(H);
367
367
  }
368
- var zt = /* @__PURE__ */ new Set([
368
+ var Rt = /* @__PURE__ */ new Set([
369
369
  "SERVICE_TASK_EXECUTED",
370
370
  "SERVICE_TASK_FAILED",
371
371
  "WEBHOOK_DELIVERY_RETRIED"
372
372
  ]);
373
- function Q(e, t) {
374
- return zt.has(e) && z(t, "action") === "NOTIFY_WEBHOOK";
373
+ function zt(e, t) {
374
+ return Rt.has(e) && V(t, "action") === "NOTIFY_WEBHOOK";
375
375
  }
376
376
  function Bt(e) {
377
- return z(e, "endpointLabel") ?? z(e, "endpointKey") ?? "外部系統";
377
+ return V(e, "endpointLabel") ?? V(e, "endpointKey") ?? "外部系統";
378
378
  }
379
379
  function Vt(e) {
380
380
  return e === "APPROVED" ? "已同意" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "TRANSFERRED" ? "已轉派" : "簽核已決議";
@@ -388,10 +388,10 @@ function Ht(e, t) {
388
388
  if (e === "TOKEN_ADVANCED") return "流程已前進";
389
389
  if (e === "TASK_CREATED") return "待簽任務已建立";
390
390
  if (e === "TASK_CANDIDATE_ACTIVATED") return "輪到下一位簽核";
391
- if (e === "TASK_DECIDED") return Vt(z(t, "action"));
391
+ if (e === "TASK_DECIDED") return Vt(V(t, "action"));
392
392
  if (e === "SLA_TRIGGERED") return "時限提醒已觸發";
393
393
  if (e === "TASK_REASSIGNED") return "管理者改派待辦";
394
- if (Q(e, t)) {
394
+ if (zt(e, t)) {
395
395
  let n = Bt(t);
396
396
  return e === "SERVICE_TASK_EXECUTED" ? `已通知外部系統:${n}` : e === "SERVICE_TASK_FAILED" ? `通知外部系統失敗:${n}` : `管理者重新傳送外部系統通知:${n}`;
397
397
  }
@@ -400,70 +400,70 @@ function Ht(e, t) {
400
400
  function Ut(e) {
401
401
  try {
402
402
  let t = JSON.parse(e.payloadJson);
403
- return xt(t) ? t : {};
403
+ return U(t) ? t : {};
404
404
  } catch {
405
405
  return {};
406
406
  }
407
407
  }
408
408
  function Wt(e, t) {
409
- return e.eventType === "SLA_TRIGGERED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "SERVICE_TASK_FAILED" && Q(e.eventType, t) || z(t, "action") === "REJECTED" || z(t, "instanceState") === "REJECTED";
409
+ return e.eventType === "SLA_TRIGGERED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "SERVICE_TASK_FAILED" && zt(e.eventType, t) || V(t, "action") === "REJECTED" || V(t, "instanceState") === "REJECTED";
410
410
  }
411
411
  function Gt(e) {
412
412
  return t(e);
413
413
  }
414
414
  function Kt(e, t, n, r) {
415
- if (e.eventType === "INSTANCE_STARTED") return _t({
415
+ if (e.eventType === "INSTANCE_STARTED") return ht({
416
416
  initiatorMemberId: e.actorMemberId,
417
- submittedByMemberId: z(t, "submittedByMemberId")
417
+ submittedByMemberId: V(t, "submittedByMemberId")
418
418
  }, r);
419
419
  if (e.eventType === "TASK_CANDIDATE_ACTIVATED") {
420
- let e = z(t, "candidateMemberId"), n = z(t, "previousMemberId");
420
+ let e = V(t, "candidateMemberId"), n = V(t, "previousMemberId");
421
421
  if (!e) return null;
422
- let i = K(e, r);
423
- return n ? `輪到:${i}(前一位:${K(n, r)})` : `輪到:${i}`;
422
+ let i = q(e, r);
423
+ return n ? `輪到:${i}(前一位:${q(n, r)})` : `輪到:${i}`;
424
424
  }
425
425
  if (e.eventType === "TASK_CREATED") {
426
- let e = B(t, "sequentialCandidateMemberIds");
427
- if (e.length) return `簽核順序:${e.map((e) => K(e, r)).join(" → ")}`;
428
- let n = z(t, "assigneeMemberId"), i = z(t, "originalAssigneeMemberId");
426
+ let e = vt(t, "sequentialCandidateMemberIds");
427
+ if (e.length) return `簽核順序:${e.map((e) => q(e, r)).join(" → ")}`;
428
+ let n = V(t, "assigneeMemberId"), i = V(t, "originalAssigneeMemberId");
429
429
  if (!n) {
430
- let e = B(t, "candidateMemberIds");
431
- return e.length ? `候選簽核人:${e.map((e) => K(e, r)).join("、")}` : null;
430
+ let e = vt(t, "candidateMemberIds");
431
+ return e.length ? `候選簽核人:${e.map((e) => q(e, r)).join("、")}` : null;
432
432
  }
433
- let a = K(n, r), o = K(i, r);
433
+ let a = q(n, r), o = q(i, r);
434
434
  return i && i !== n ? `待簽人:${a}(原簽核人:${o})` : `待簽人:${a}`;
435
435
  }
436
436
  if (e.eventType === "TASK_DECIDED") {
437
- let e = z(t, "action"), n = z(t, "comment"), i = e ? `決議:${Tt(e)}` : null, a = z(t, "transferToMemberId");
438
- return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(V).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(V).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${K(a, r)}`].filter(V).join(" · ") : i;
437
+ let e = V(t, "action"), n = V(t, "comment"), i = e ? `決議:${K(e)}` : null, a = V(t, "transferToMemberId");
438
+ return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(H).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(H).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${q(a, r)}`].filter(H).join(" · ") : i;
439
439
  }
440
440
  if (e.eventType === "TOKEN_ADVANCED") {
441
- let e = z(t, "action");
442
- if (e) return `流程結果:${Tt(e)}`;
443
- let r = bt(t, "arrivedCount"), i = bt(t, "requiredCount");
441
+ let e = V(t, "action");
442
+ if (e) return `流程結果:${K(e)}`;
443
+ let r = yt(t, "arrivedCount"), i = yt(t, "requiredCount");
444
444
  if (r !== null && i !== null) return `等待匯合:${r}/${i}`;
445
- let a = z(t, "fromNodeId"), o = z(t, "toNodeId");
446
- if (a && o) return `由 ${Et(a, n)} 前進至 ${Et(o, n)}`;
445
+ let a = V(t, "fromNodeId"), o = V(t, "toNodeId");
446
+ if (a && o) return `由 ${Tt(a, n)} 前進至 ${Tt(o, n)}`;
447
447
  }
448
448
  if (e.eventType === "ENGINE_PROCESS_REQUESTED") {
449
- let e = z(t, "state");
449
+ let e = V(t, "state");
450
450
  return e ? `案件狀態:${Ct(e)}` : null;
451
451
  }
452
452
  return null;
453
453
  }
454
454
  function qt(e, t, n, r, i, a, o, s = null) {
455
- if (e.eventType !== "TASK_DECIDED") return [J(Kt(e, t, n, o))].filter(Y);
456
- let c = e.taskId ? r.get(e.taskId) : null, l = z(t, "action") ?? c?.action ?? null, u = z(t, "comment") ?? c?.comment ?? null, d = z(t, "transferToMemberId") ?? c?.transferToMemberId ?? null, f = z(t, "signatureId") ?? c?.signatureId ?? null, p = f ? i.get(f) : null;
455
+ if (e.eventType !== "TASK_DECIDED") return [Y(Kt(e, t, n, o))].filter(It);
456
+ let c = e.taskId ? r.get(e.taskId) : null, l = V(t, "action") ?? c?.action ?? null, u = V(t, "comment") ?? c?.comment ?? null, d = V(t, "transferToMemberId") ?? c?.transferToMemberId ?? null, f = V(t, "signatureId") ?? c?.signatureId ?? null, p = f ? i.get(f) : null;
457
457
  return [
458
- J(l ? `決議:${Tt(l)}` : null),
459
- l === "REJECTED" ? Ft("拒絕原因", u ?? "-", "danger") : null,
460
- l === "APPROVED" ? Ft("同意說明", u) : null,
461
- l === "RETURNED" ? Ft("退回說明", u ?? "-") : null,
462
- l === "TRANSFERRED" ? J(`轉派給:${K(d, o)}`) : null,
463
- l === "TRANSFERRED" ? Ft("轉派說明", u ?? "-") : null,
464
- J(Jt(t, s)),
465
- p ? J(a?.valid ? `簽章:已驗證(${W(p.signedPayloadHash)})` : `簽章:待檢查(${W(p.signedPayloadHash)})`) : null
466
- ].filter(Y);
458
+ Y(l ? `決議:${K(l)}` : null),
459
+ l === "REJECTED" ? Pt("拒絕原因", u ?? "-", "danger") : null,
460
+ l === "APPROVED" ? Pt("同意說明", u) : null,
461
+ l === "RETURNED" ? Pt("退回說明", u ?? "-") : null,
462
+ l === "TRANSFERRED" ? Y(`轉派給:${q(d, o)}`) : null,
463
+ l === "TRANSFERRED" ? Pt("轉派說明", u ?? "-") : null,
464
+ Y(Jt(t, s)),
465
+ p ? Y(a?.valid ? `簽章:已驗證(${St(p.signedPayloadHash)})` : `簽章:待檢查(${St(p.signedPayloadHash)})`) : null
466
+ ].filter(It);
467
467
  }
468
468
  function Jt(e, t) {
469
469
  let n = e.changedFieldKeys;
@@ -495,7 +495,7 @@ function Zt(e, t, n, r, i) {
495
495
  return Qt(e, n, r, i).reduce((e, t) => tn(e, $t(t, o, a)), /* @__PURE__ */ new Map());
496
496
  }
497
497
  function Qt(e, t, n, r) {
498
- let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(St).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [.../* @__PURE__ */ new Set([
498
+ let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(bt).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [.../* @__PURE__ */ new Set([
499
499
  ...i,
500
500
  ...a,
501
501
  ...o
@@ -525,30 +525,30 @@ function nn(e) {
525
525
  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}`;
526
526
  }
527
527
  function rn(e, t, n, r, i, a, o, s, c, l = null) {
528
- let u = e.filter(Z).map((e) => {
529
- let t = Ut(e), n = e.nodeId ? Et(e.nodeId, r) : null;
528
+ let u = e.filter(X).map((e) => {
529
+ let t = Ut(e), n = e.nodeId ? Tt(e.nodeId, r) : null;
530
530
  return {
531
531
  descriptionParts: [
532
- J(n ? `節點:${n}` : "節點:全流程"),
533
- It("操作者", e.actorMemberId, a, "系統"),
534
- J(`時間:${Gt(e.createdAt)}`),
532
+ Y(n ? `節點:${n}` : "節點:全流程"),
533
+ Ft("操作者", e.actorMemberId, a, "系統"),
534
+ Y(`時間:${Gt(e.createdAt)}`),
535
535
  ...qt(e, t, r, o, s, c, a, l)
536
- ].filter(Y),
536
+ ].filter(It),
537
537
  error: Wt(e, t),
538
538
  id: e.id,
539
539
  title: Ht(e.eventType, t)
540
540
  };
541
- }), d = t.filter(St).map((e) => ({
541
+ }), d = t.filter(bt).map((e) => ({
542
542
  descriptionParts: [
543
- J(`節點:${Et(e.nodeId, r)}`),
544
- It("處理者", e.assigneeMemberId, a, "未指定"),
545
- J(`建立時間:${Gt(e.createdAt)}`)
546
- ].filter(Y),
543
+ Y(`節點:${Tt(e.nodeId, r)}`),
544
+ Ft("處理者", e.assigneeMemberId, a, "未指定"),
545
+ Y(`建立時間:${Gt(e.createdAt)}`)
546
+ ].filter(It),
547
547
  error: !1,
548
548
  id: `pending-task-${e.id}`,
549
549
  title: e.status === "IN_PROGRESS" ? "簽核處理中" : "等待簽核處理"
550
- })), f = new Set([...e.filter(Z).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(V)), p = r ? Xt(r, t, n, i, f).map((e) => ({
551
- descriptionParts: [J(`${G(e.type)} · 尚未抵達`)].filter(Y),
550
+ })), f = new Set([...e.filter(X).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(H)), p = r ? Xt(r, t, n, i, f).map((e) => ({
551
+ descriptionParts: [Y(`${wt(e.type)} · 尚未抵達`)].filter(It),
552
552
  error: !1,
553
553
  forcePending: !0,
554
554
  id: `future-node-${e.id}`,
@@ -581,17 +581,17 @@ var an = {
581
581
  function on(e, t, n, r) {
582
582
  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");
583
583
  if (a) return {
584
- secondaryLabel: `處理者 ${Dt(a)}`,
584
+ secondaryLabel: `處理者 ${Et(a)}`,
585
585
  statusLabel: "待處理",
586
586
  tone: "current"
587
587
  };
588
588
  if (o) return {
589
- secondaryLabel: `已取消 ${Dt(o)}`,
589
+ secondaryLabel: `已取消 ${Et(o)}`,
590
590
  statusLabel: "已取消",
591
591
  tone: "cancelled"
592
592
  };
593
593
  if (s) return {
594
- secondaryLabel: `已完成 ${Dt(s)}`,
594
+ secondaryLabel: `已完成 ${Et(s)}`,
595
595
  statusLabel: "已完成",
596
596
  tone: "completed"
597
597
  };
@@ -615,7 +615,7 @@ function on(e, t, n, r) {
615
615
  ...d,
616
616
  secondaryLabel: r
617
617
  } : {
618
- secondaryLabel: G(e.type),
618
+ secondaryLabel: wt(e.type),
619
619
  statusLabel: "未抵達",
620
620
  tone: "neutral"
621
621
  };
@@ -627,15 +627,15 @@ async function sn({ activityLogs: e, adhocDirectives: t = [], instance: n, tasks
627
627
  n?.initiatorMemberId ?? null,
628
628
  n?.submittedByMemberId ?? null,
629
629
  ...e.map((e) => e.actorMemberId),
630
- ...e.flatMap(Rt),
630
+ ...e.flatMap(Q),
631
631
  ...r.map((e) => e.assigneeMemberId),
632
632
  ...r.map((e) => e.originalAssigneeMemberId),
633
633
  ...r.flatMap((e) => e.candidateMemberIds),
634
- ...r.flatMap((e) => yt(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
634
+ ...r.flatMap((e) => _t(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
635
635
  ...t.flatMap((e) => [e.createdByMemberId, ...cn(e.targetValueJson)])
636
- ].filter(V))];
636
+ ].filter(H))];
637
637
  try {
638
- return await Pe(i);
638
+ return await Ne(i);
639
639
  } catch {
640
640
  return [];
641
641
  }
@@ -648,7 +648,7 @@ function cn(e) {
648
648
  }
649
649
  }
650
650
  async function ln(e) {
651
- return (await Promise.all(e.map((e) => D(e.id)))).flat();
651
+ return (await Promise.all(e.map((e) => O(e.id)))).flat();
652
652
  }
653
653
  function un(e) {
654
654
  return e.reduce((e, t) => {
@@ -658,44 +658,44 @@ function un(e) {
658
658
  }
659
659
  //#endregion
660
660
  //#region src/views/instances/detail/sections/InstanceFormSection.tsx
661
- var $ = {
661
+ var dn = {
662
662
  display: "grid",
663
663
  gap: 16
664
- }, dn = {
664
+ }, $ = {
665
665
  display: "flex",
666
666
  flexWrap: "wrap",
667
667
  gap: 8
668
668
  };
669
- function fn({ canResubmitInstance: e, deciding: t, error: n, fieldAccess: r, fieldLabelMarkers: i, fill: a = null, instance: o, loading: s, onDataSourceStateChange: c, onResubmitFormChange: l, onReloadAfterConflict: d = null, onResubmitInstance: f, onUploadAttachment: p, resubmitFormData: ee, resubmitFormErrors: m }) {
670
- let te = o?.formDefinitionSnapshot.schema, re = o?.workflowSnapshot, h = _(() => e && te && re ? u(te, re) : a?.schema ?? te, [
669
+ function fn({ canResubmitInstance: e, deciding: t, error: n, fieldAccess: r, fieldLabelMarkers: i, fill: a = null, instance: o, loading: s, onDataSourceStateChange: c, onResubmitFormChange: l, onReloadAfterConflict: d = null, onResubmitInstance: f, onUploadAttachment: p, resubmitFormData: ee, resubmitFormErrors: te }) {
670
+ let m = o?.formDefinitionSnapshot.schema, h = o?.workflowSnapshot, re = _(() => e && m && h ? u(m, h) : a?.schema ?? m, [
671
671
  e,
672
672
  a?.schema,
673
- te,
674
- re
675
- ]), ie = !e && a !== null;
676
- return /* @__PURE__ */ E("div", {
677
- style: $,
673
+ m,
674
+ h
675
+ ]), g = !e && a !== null;
676
+ return /* @__PURE__ */ D("div", {
677
+ style: dn,
678
678
  children: [
679
- n ? /* @__PURE__ */ T(w, {
679
+ n ? /* @__PURE__ */ E(w, {
680
680
  color: "text-error",
681
681
  variant: "body",
682
682
  children: n
683
683
  }) : null,
684
- s ? /* @__PURE__ */ T(w, {
684
+ s ? /* @__PURE__ */ E(w, {
685
685
  color: "text-neutral",
686
686
  variant: "body",
687
687
  children: "載入中..."
688
688
  }) : null,
689
- d ? /* @__PURE__ */ E("div", {
690
- style: $,
691
- children: [/* @__PURE__ */ T(x, {
689
+ d ? /* @__PURE__ */ D("div", {
690
+ style: dn,
691
+ children: [/* @__PURE__ */ E(x, {
692
692
  content: "表單在你填寫期間被更新了,你填的內容還在。請重新載入後確認再同意。",
693
693
  severity: "error"
694
- }), /* @__PURE__ */ T("div", {
695
- style: dn,
696
- children: /* @__PURE__ */ T(y, {
694
+ }), /* @__PURE__ */ E("div", {
695
+ style: $,
696
+ children: /* @__PURE__ */ E(y, {
697
697
  disabled: s,
698
- icon: k,
698
+ icon: Ke,
699
699
  iconType: "leading",
700
700
  onClick: d,
701
701
  variant: "base-secondary",
@@ -703,40 +703,40 @@ function fn({ canResubmitInstance: e, deciding: t, error: n, fieldAccess: r, fie
703
703
  })
704
704
  })]
705
705
  }) : null,
706
- ie && a.fieldCount > 0 ? /* @__PURE__ */ T(x, {
706
+ g && a.fieldCount > 0 ? /* @__PURE__ */ E(x, {
707
707
  content: `本關需要你補填 ${a.fieldCount} 個欄位,按「同意」時會一起送出並納入簽章。`,
708
708
  severity: "info"
709
709
  }) : null,
710
- h && o?.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ E(ye, { children: [/* @__PURE__ */ T(ne, {
710
+ re && o?.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(ne, {
711
711
  dataSourceContext: e ? {
712
712
  instanceId: o.id,
713
713
  kind: "runtime"
714
714
  } : void 0,
715
715
  dataSourceInitialValues: o.formData,
716
- errors: ie ? a.errors : m,
716
+ errors: g ? a.errors : te,
717
717
  ...!e && r ? { fieldAccess: r } : {},
718
718
  ...!e && i ? { fieldLabelMarkers: i } : {},
719
719
  onChange: (e) => {
720
- ie ? a.onChange(e) : l(e);
720
+ g ? a.onChange(e) : l(e);
721
721
  },
722
722
  onDataSourceStateChange: c,
723
723
  onUploadAttachment: e ? p : void 0,
724
724
  optionSnapshots: o.formDataOptionSnapshot,
725
725
  readonly: !e,
726
- schema: h,
726
+ schema: re,
727
727
  uiSchema: o.formDefinitionSnapshot.uiSchema,
728
- value: e ? ee : ie ? a.value : o.formData
729
- }), e ? /* @__PURE__ */ T("div", {
730
- style: dn,
731
- children: /* @__PURE__ */ T(y, {
728
+ value: e ? ee : g ? a.value : o.formData
729
+ }), e ? /* @__PURE__ */ E("div", {
730
+ style: $,
731
+ children: /* @__PURE__ */ E(y, {
732
732
  disabled: t,
733
- icon: k,
733
+ icon: Ke,
734
734
  iconType: "leading",
735
735
  onClick: f,
736
736
  variant: "base-primary",
737
737
  children: "重新送出"
738
738
  })
739
- }) : null] }) : /* @__PURE__ */ T(w, {
739
+ }) : null] }) : /* @__PURE__ */ E(w, {
740
740
  color: "text-neutral",
741
741
  variant: "body",
742
742
  children: "此案件沒有可顯示的表單快照。"
@@ -758,7 +758,7 @@ function mn({ attachments: e, onDownload: n, onPreview: r }) {
758
758
  id: e.id,
759
759
  key: e.id,
760
760
  mimeType: e.mimeType,
761
- sizeLabel: U(Number(e.sizeBytes))
761
+ sizeLabel: xt(Number(e.sizeBytes))
762
762
  })), [e]), a = _(() => [
763
763
  {
764
764
  dataIndex: "filename",
@@ -780,7 +780,7 @@ function mn({ attachments: e, onDownload: n, onPreview: r }) {
780
780
  },
781
781
  {
782
782
  key: "createdAt",
783
- render: (e) => /* @__PURE__ */ T(w, {
783
+ render: (e) => /* @__PURE__ */ E(w, {
784
784
  component: "span",
785
785
  variant: "body",
786
786
  children: t(e.createdAt)
@@ -790,14 +790,14 @@ function mn({ attachments: e, onDownload: n, onPreview: r }) {
790
790
  }
791
791
  ], []), o = _(() => ({
792
792
  render: (e) => [...e.mimeType === "application/pdf" ? [{
793
- icon: We,
793
+ icon: Ue,
794
794
  iconType: "leading",
795
795
  name: "預覽",
796
796
  onClick: () => {
797
797
  r(e.attachment);
798
798
  }
799
799
  }] : [], {
800
- icon: Ue,
800
+ icon: He,
801
801
  iconType: "leading",
802
802
  name: "下載",
803
803
  onClick: () => {
@@ -807,18 +807,18 @@ function mn({ attachments: e, onDownload: n, onPreview: r }) {
807
807
  variant: "base-secondary",
808
808
  width: 160
809
809
  }), [n, r]);
810
- return /* @__PURE__ */ E("div", {
810
+ return /* @__PURE__ */ D("div", {
811
811
  style: pn,
812
- children: [/* @__PURE__ */ T(w, {
812
+ children: [/* @__PURE__ */ E(w, {
813
813
  component: "h2",
814
814
  variant: "h3",
815
815
  children: "附件"
816
- }), i.length > 0 ? /* @__PURE__ */ T(ge, {
816
+ }), i.length > 0 ? /* @__PURE__ */ E(ge, {
817
817
  actions: o,
818
818
  columns: a,
819
819
  dataSource: i,
820
820
  fullWidth: !0
821
- }) : /* @__PURE__ */ T(w, {
821
+ }) : /* @__PURE__ */ E(w, {
822
822
  color: "text-neutral",
823
823
  variant: "body",
824
824
  children: "此案件沒有附件。"
@@ -864,22 +864,26 @@ var xn = {
864
864
  }, {
865
865
  id: "WEBHOOK",
866
866
  name: "Webhook"
867
- }], Tn = h(function({ adhocDirectives: e, currentMemberId: r, fill: i = null, instance: o, memberProfilesById: s, onChanged: c, onFillApproveError: l, tasks: u }, d) {
868
- let [f, p] = v(!1), [ee, m] = v(null), [te, ne] = v(""), [re, h] = v(!1), [ie, g] = v(""), [oe, x] = v(null), [de, fe] = v(!1), [pe, me] = v(""), [he, ve] = v(!1), [xe, Te] = v(null), [Ee, D] = v(""), [De, Oe] = v(null), [ke, Ae] = v(!1), [je, Pe] = v([]), [Fe, Ie] = v(!1), [Le, Re] = v(""), [ze, Be] = v([]), [Ve, He] = v(!1), [Ue, We] = v([]), [Ge, Ke] = v(!1), [k, qe] = v("COUNTERSIGN"), [Je, Ye] = v("REJECT_INSTANCE"), [Xe, A] = v(!1), [Ze, Qe] = v("MEMBER"), [$e, et] = v(""), tt = ie.trim(), nt = pe.trim(), rt = Ee.trim(), j = _(() => kt(u, r), [r, u]), M = _(() => j && o ? o.workflowSnapshot.nodes.find((e) => e.id === j.nodeId) ?? null : null, [j, o]), it = _(() => M && o ? At(o.workflowSnapshot, M) : [], [M, o]), at = M?.type === "userTask" && M.data.returnBehavior.allowReturn, N = M?.type === "userTask" && M.data.allowReject !== !1, ot = M?.type === "userTask" && M.data.allowTransfer !== !1, P = M?.type === "userTask" && M.data.returnBehavior.requireComment === !0, st = M?.type === "userTask" && M.data.allowAddSigner, ct = _(() => e.filter((e) => e.status === "PENDING"), [e]), F = it.find((e) => e.id === xe) ?? it[0] ?? null, I = _(() => u.map((e) => ({
867
+ }], Tn = re(function({ adhocDirectives: e, currentMemberId: r, fill: i = null, instance: o, memberProfilesById: s, onChanged: c, onDecidingChange: l, onFillApproveError: u, tasks: d }, f) {
868
+ let [p, ee] = v(!1), [te, m] = v(null);
869
+ ie(() => {
870
+ l?.(p);
871
+ }, [p, l]);
872
+ let [ne, h] = v(""), [re, g] = v(!1), [oe, x] = v(""), [de, fe] = v(null), [pe, me] = v(!1), [he, ve] = v(""), [be, we] = v(!1), [Te, O] = v(null), [Ee, De] = v(""), [Oe, ke] = v(null), [Ae, Ne] = v(!1), [Pe, Fe] = v([]), [Ie, Le] = v(!1), [Re, ze] = v(""), [Be, Ve] = v([]), [He, Ue] = v(!1), [We, Ge] = v([]), [Ke, qe] = v(!1), [A, Je] = v("COUNTERSIGN"), [Ye, j] = v("REJECT_INSTANCE"), [M, Xe] = v(!1), [Ze, Qe] = v("MEMBER"), [$e, et] = v(""), N = oe.trim(), tt = he.trim(), nt = Ee.trim(), P = _(() => Ot(d, r), [r, d]), F = _(() => P && o ? o.workflowSnapshot.nodes.find((e) => e.id === P.nodeId) ?? null : null, [P, o]), I = _(() => F && o ? kt(o.workflowSnapshot, F) : [], [F, o]), rt = F?.type === "userTask" && F.data.returnBehavior.allowReturn, L = F?.type === "userTask" && F.data.allowReject !== !1, it = F?.type === "userTask" && F.data.allowTransfer !== !1, at = F?.type === "userTask" && F.data.returnBehavior.requireComment === !0, R = F?.type === "userTask" && F.data.allowAddSigner, z = _(() => e.filter((e) => e.status === "PENDING"), [e]), ot = I.find((e) => e.id === Te) ?? I[0] ?? null, st = _(() => d.map((e) => ({
869
873
  ...e,
870
- assigneeLabel: Dt(e, s),
874
+ assigneeLabel: Et(e, s),
871
875
  fillFieldCount: Dn(e, o?.workflowSnapshot ?? null),
872
876
  key: e.id,
873
877
  nodeLabel: a({
874
878
  ...e,
875
- nodeLabel: Et(e.nodeId, o?.workflowSnapshot ?? null)
879
+ nodeLabel: Tt(e.nodeId, o?.workflowSnapshot ?? null)
876
880
  }),
877
- statusLabel: wt(e.status)
881
+ statusLabel: G(e.status)
878
882
  })), [
879
883
  o,
880
884
  s,
881
- u
882
- ]), lt = _(() => [
885
+ d
886
+ ]), ct = _(() => [
883
887
  {
884
888
  dataIndex: "nodeLabel",
885
889
  key: "nodeLabel",
@@ -889,7 +893,7 @@ var xn = {
889
893
  {
890
894
  key: "assigneeMemberId",
891
895
  title: "處理者",
892
- render: (e) => /* @__PURE__ */ T(w, {
896
+ render: (e) => /* @__PURE__ */ E(w, {
893
897
  component: "span",
894
898
  variant: "body",
895
899
  children: e.assigneeLabel
@@ -904,7 +908,7 @@ var xn = {
904
908
  },
905
909
  {
906
910
  key: "fill",
907
- render: (e) => e.fillFieldCount > 0 ? /* @__PURE__ */ T(ce, {
911
+ render: (e) => e.fillFieldCount > 0 ? /* @__PURE__ */ E(ce, {
908
912
  size: "sub",
909
913
  text: `需補填 ${e.fillFieldCount} 欄`,
910
914
  variant: "dot-warning"
@@ -914,7 +918,7 @@ var xn = {
914
918
  },
915
919
  {
916
920
  key: "createdAt",
917
- render: (e) => /* @__PURE__ */ T(w, {
921
+ render: (e) => /* @__PURE__ */ E(w, {
918
922
  component: "span",
919
923
  variant: "body",
920
924
  children: t(e.createdAt)
@@ -922,13 +926,13 @@ var xn = {
922
926
  title: "建立時間",
923
927
  width: 220
924
928
  }
925
- ], []), ut = _(() => ct.map((e) => ({
929
+ ], []), lt = _(() => z.map((e) => ({
926
930
  ...e,
927
- createdByLabel: K(e.createdByMemberId, s),
931
+ createdByLabel: q(e.createdByMemberId, s),
928
932
  key: e.id,
929
933
  targetLabel: En(e, s),
930
934
  typeLabel: xn[e.type]
931
- })), [s, ct]), dt = _(() => [
935
+ })), [s, z]), ut = _(() => [
932
936
  {
933
937
  dataIndex: "typeLabel",
934
938
  key: "typeLabel",
@@ -937,7 +941,7 @@ var xn = {
937
941
  },
938
942
  {
939
943
  key: "targetLabel",
940
- render: (e) => /* @__PURE__ */ T(w, {
944
+ render: (e) => /* @__PURE__ */ E(w, {
941
945
  component: "span",
942
946
  variant: "body",
943
947
  children: e.targetLabel
@@ -947,7 +951,7 @@ var xn = {
947
951
  },
948
952
  {
949
953
  key: "createdByLabel",
950
- render: (e) => /* @__PURE__ */ T(w, {
954
+ render: (e) => /* @__PURE__ */ E(w, {
951
955
  component: "span",
952
956
  variant: "body",
953
957
  children: e.createdByLabel
@@ -957,7 +961,7 @@ var xn = {
957
961
  },
958
962
  {
959
963
  key: "createdAt",
960
- render: (e) => /* @__PURE__ */ T(w, {
964
+ render: (e) => /* @__PURE__ */ E(w, {
961
965
  component: "span",
962
966
  variant: "body",
963
967
  children: t(e.createdAt)
@@ -967,129 +971,129 @@ var xn = {
967
971
  },
968
972
  {
969
973
  key: "actions",
970
- render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ T(y, {
971
- disabled: Xe,
972
- onClick: () => void Tt(e.id),
974
+ render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ E(y, {
975
+ disabled: M,
976
+ onClick: () => void Dt(e.id),
973
977
  size: "minor",
974
978
  variant: "destructive-secondary",
975
979
  children: "撤回"
976
- }) : /* @__PURE__ */ T(ye, {}),
980
+ }) : /* @__PURE__ */ E(T, {}),
977
981
  title: "操作",
978
982
  width: 100
979
983
  }
980
- ], [Xe, r]);
981
- async function ft({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: a = null }) {
982
- if (!r || !j || e === "REJECTED" && !N || e === "TRANSFERRED" && !ot) return !1;
983
- p(!0), m(null);
984
- let o = e === "APPROVED" && i !== null && !j.isAdhoc ? {
984
+ ], [M, r]);
985
+ async function dt({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: a = null }) {
986
+ if (!r || !P || e === "REJECTED" && !L || e === "TRANSFERRED" && !it) return !1;
987
+ ee(!0), m(null);
988
+ let o = e === "APPROVED" && i !== null && !P.isAdhoc ? {
985
989
  expectedFormDataFingerprint: i.expectedFormDataFingerprint,
986
990
  formData: i.formData
987
991
  } : null;
988
992
  try {
989
- await we({
993
+ await Ce({
990
994
  action: e,
991
995
  comment: t,
992
996
  decidedByMemberId: r,
993
997
  fill: o,
994
998
  returnToNodeId: n,
995
- taskId: j.id,
999
+ taskId: P.id,
996
1000
  transferToMemberId: a
997
- }), fe(!1), ve(!1), Ie(!1), g(""), me(""), D(""), Oe(null), Te(null), x(null);
1001
+ }), me(!1), we(!1), Le(!1), x(""), ve(""), De(""), ke(null), O(null), fe(null);
998
1002
  } catch (e) {
999
- return p(!1), o !== null && e instanceof Error && l?.(e.message) === !0 ? (h(!1), !1) : (m(H(e)), !1);
1003
+ return ee(!1), o !== null && e instanceof Error && u?.(e.message) === !0 ? (g(!1), !1) : (m(W(e)), !1);
1000
1004
  }
1001
1005
  try {
1002
1006
  await c();
1003
1007
  } catch (e) {
1004
- m(H(e));
1008
+ m(W(e));
1005
1009
  } finally {
1006
- p(!1);
1010
+ ee(!1);
1007
1011
  }
1008
1012
  return !0;
1009
1013
  }
1010
- function pt() {
1011
- r && j && (m(null), h(!0));
1014
+ function ft() {
1015
+ r && P && (m(null), g(!0));
1012
1016
  }
1013
- function L() {
1014
- f || (h(!1), ne(""));
1017
+ function pt() {
1018
+ p || (g(!1), h(""));
1015
1019
  }
1016
- async function mt() {
1017
- f || await ft({
1020
+ async function B() {
1021
+ p || await dt({
1018
1022
  action: "APPROVED",
1019
- comment: te.trim() || null
1020
- }) && (h(!1), ne(""));
1023
+ comment: ne.trim() || null
1024
+ }) && (g(!1), h(""));
1021
1025
  }
1022
- function ht() {
1023
- N && (g(""), x(null), fe(!0));
1026
+ function mt() {
1027
+ L && (x(""), fe(null), me(!0));
1024
1028
  }
1025
- function R() {
1026
- f || (fe(!1), g(""), x(null));
1029
+ function ht() {
1030
+ p || (me(!1), x(""), fe(null));
1027
1031
  }
1028
1032
  function gt() {
1029
- me(""), Te(it[0]?.id ?? null), ve(!0);
1033
+ ve(""), O(I[0]?.id ?? null), we(!0);
1030
1034
  }
1031
1035
  function _t() {
1032
- f || (ve(!1), me(""), Te(null));
1036
+ p || (we(!1), ve(""), O(null));
1033
1037
  }
1034
- function vt() {
1035
- ot && (D(""), Oe(null), Ie(!0), z(""));
1038
+ function V() {
1039
+ it && (De(""), ke(null), Le(!0), yt(""));
1036
1040
  }
1037
- function yt() {
1038
- f || (Ie(!1), D(""), Oe(null));
1041
+ function vt() {
1042
+ p || (Le(!1), De(""), ke(null));
1039
1043
  }
1040
- async function z(e) {
1041
- Ae(!0);
1044
+ async function yt(e) {
1045
+ Ne(!0);
1042
1046
  try {
1043
- Pe((await O(e)).filter((e) => e.memberId !== r).map(q));
1047
+ Fe((await k(e)).filter((e) => e.memberId !== r).map(At));
1044
1048
  } catch (e) {
1045
- m(H(e));
1049
+ m(W(e));
1046
1050
  } finally {
1047
- Ae(!1);
1051
+ Ne(!1);
1048
1052
  }
1049
1053
  }
1050
- async function B() {
1051
- N && (tt ? await ft({
1054
+ async function H() {
1055
+ L && (N ? await dt({
1052
1056
  action: "REJECTED",
1053
- comment: tt
1054
- }) : x("請輸入拒絕原因"));
1057
+ comment: N
1058
+ }) : fe("請輸入拒絕原因"));
1055
1059
  }
1056
- async function bt() {
1057
- ot && (De ? await ft({
1060
+ async function U() {
1061
+ it && (Oe ? await dt({
1058
1062
  action: "TRANSFERRED",
1059
- comment: rt || null,
1060
- transferToMemberId: De.id
1063
+ comment: nt || null,
1064
+ transferToMemberId: Oe.id
1061
1065
  }) : m("請選擇轉派對象"));
1062
1066
  }
1063
- async function V() {
1064
- await ft({
1067
+ async function bt() {
1068
+ await dt({
1065
1069
  action: "RETURNED",
1066
- comment: nt || null,
1067
- returnToNodeId: F?.id ?? null
1070
+ comment: tt || null,
1071
+ returnToNodeId: ot?.id ?? null
1068
1072
  });
1069
1073
  }
1070
1074
  function xt() {
1071
- Re(""), Be([]), Ye("REJECT_INSTANCE"), Qe("MEMBER"), et("");
1075
+ ze(""), Ve([]), j("REJECT_INSTANCE"), Qe("MEMBER"), et("");
1072
1076
  }
1073
1077
  function St(e) {
1074
- qe(e), xt(), Ke(!0), W("");
1078
+ Je(e), xt(), qe(!0), K("");
1075
1079
  }
1076
- function U() {
1077
- Xe || (Ke(!1), xt());
1080
+ function Ct() {
1081
+ M || (qe(!1), xt());
1078
1082
  }
1079
- async function W(e) {
1080
- He(!0);
1083
+ async function K(e) {
1084
+ Ue(!0);
1081
1085
  try {
1082
- We((await O(e)).map(q));
1086
+ Ge((await k(e)).map(At));
1083
1087
  } catch (e) {
1084
- m(H(e));
1088
+ m(W(e));
1085
1089
  } finally {
1086
- He(!1);
1090
+ Ue(!1);
1087
1091
  }
1088
1092
  }
1089
- async function Ct() {
1090
- if (!j) return;
1091
- let e = (k === "STAGE_NOTIFY" || k === "COMPLETION_NOTIFY") && Ze === "WEBHOOK", t = jt({
1092
- memberIds: ze.map((e) => e.id),
1093
+ async function wt() {
1094
+ if (!P) return;
1095
+ let e = (A === "STAGE_NOTIFY" || A === "COMPLETION_NOTIFY") && Ze === "WEBHOOK", t = jt({
1096
+ memberIds: Be.map((e) => e.id),
1093
1097
  useWebhookTarget: e,
1094
1098
  webhookUrl: $e
1095
1099
  });
@@ -1097,103 +1101,103 @@ var xn = {
1097
1101
  m(t.error);
1098
1102
  return;
1099
1103
  }
1100
- let { target: n } = t, r = Le.trim() || null;
1101
- A(!0), m(null);
1104
+ let { target: n } = t, r = Re.trim() || null;
1105
+ Xe(!0), m(null);
1102
1106
  try {
1103
- k === "COUNTERSIGN" ? await Me({
1107
+ A === "COUNTERSIGN" ? await je({
1104
1108
  comment: r,
1105
1109
  target: n,
1106
- taskId: j.id
1107
- }) : k === "PRE_APPROVAL" ? await Ne({
1110
+ taskId: P.id
1111
+ }) : A === "PRE_APPROVAL" ? await Me({
1108
1112
  comment: r,
1109
- onReject: Je,
1113
+ onReject: Ye,
1110
1114
  target: n,
1111
- taskId: j.id
1112
- }) : k === "STAGE_NOTIFY" ? await Ce({
1115
+ taskId: P.id
1116
+ }) : A === "STAGE_NOTIFY" ? await Se({
1113
1117
  target: n,
1114
- taskId: j.id
1115
- }) : await Se({
1118
+ taskId: P.id
1119
+ }) : await xe({
1116
1120
  target: n,
1117
- taskId: j.id
1118
- }), Ke(!1), xt(), await c();
1121
+ taskId: P.id
1122
+ }), qe(!1), xt(), await c();
1119
1123
  } catch (e) {
1120
- m(H(e));
1124
+ m(W(e));
1121
1125
  } finally {
1122
- A(!1);
1126
+ Xe(!1);
1123
1127
  }
1124
1128
  }
1125
- async function Tt(e) {
1126
- A(!0), m(null);
1129
+ async function Dt(e) {
1130
+ Xe(!0), m(null);
1127
1131
  try {
1128
- await be(e), await c();
1132
+ await ye(e), await c();
1129
1133
  } catch (e) {
1130
- m(H(e));
1134
+ m(W(e));
1131
1135
  } finally {
1132
- A(!1);
1136
+ Xe(!1);
1133
1137
  }
1134
1138
  }
1135
- ae(d, () => ({
1136
- canAddSignerCurrentTask: st,
1137
- canRejectCurrentTask: N,
1138
- canReturnCurrentTask: at,
1139
- canTransferCurrentTask: ot,
1140
- deciding: f,
1141
- handleApprove: pt,
1142
- hasCurrentTask: j !== null,
1139
+ ae(f, () => ({
1140
+ canAddSignerCurrentTask: R,
1141
+ canRejectCurrentTask: L,
1142
+ canReturnCurrentTask: rt,
1143
+ canTransferCurrentTask: it,
1144
+ deciding: p,
1145
+ handleApprove: ft,
1146
+ hasCurrentTask: P !== null,
1143
1147
  openAdhocModal: St,
1144
- openRejectModal: ht,
1148
+ openRejectModal: mt,
1145
1149
  openReturnModal: gt,
1146
- openTransferModal: vt
1150
+ openTransferModal: V
1147
1151
  }), [
1148
- st,
1149
- N,
1150
- at,
1151
- ot,
1152
+ R,
1153
+ L,
1154
+ rt,
1155
+ it,
1152
1156
  r,
1153
- j,
1154
- f
1157
+ P,
1158
+ p
1155
1159
  ]);
1156
- let G = k === "STAGE_NOTIFY" || k === "COMPLETION_NOTIFY", Ot = G && Ze === "WEBHOOK" ? !$e.trim() : ze.length === 0, J = Cn.find((e) => e.id === Je) ?? Cn[0], Ft = wn.find((e) => e.id === Ze) ?? wn[0];
1157
- return /* @__PURE__ */ E(ye, { children: [
1158
- /* @__PURE__ */ T(w, {
1160
+ let Y = A === "STAGE_NOTIFY" || A === "COMPLETION_NOTIFY", Pt = Y && Ze === "WEBHOOK" ? !$e.trim() : Be.length === 0, Ft = Cn.find((e) => e.id === Ye) ?? Cn[0], It = wn.find((e) => e.id === Ze) ?? wn[0];
1161
+ return /* @__PURE__ */ D(T, { children: [
1162
+ /* @__PURE__ */ E(w, {
1159
1163
  component: "h2",
1160
1164
  variant: "h3",
1161
1165
  children: "任務"
1162
1166
  }),
1163
- ee ? /* @__PURE__ */ T(w, {
1167
+ te ? /* @__PURE__ */ E(w, {
1164
1168
  color: "text-error",
1165
1169
  variant: "body",
1166
- children: ee
1170
+ children: te
1167
1171
  }) : null,
1168
- /* @__PURE__ */ T("div", {
1172
+ /* @__PURE__ */ E("div", {
1169
1173
  style: vn,
1170
- children: /* @__PURE__ */ T(ge, {
1171
- columns: lt,
1172
- dataSource: I,
1174
+ children: /* @__PURE__ */ E(ge, {
1175
+ columns: ct,
1176
+ dataSource: st,
1173
1177
  fullWidth: !0
1174
1178
  })
1175
1179
  }),
1176
- ct.length > 0 ? /* @__PURE__ */ E(ye, { children: [/* @__PURE__ */ T(w, {
1180
+ z.length > 0 ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(w, {
1177
1181
  component: "h3",
1178
1182
  style: yn,
1179
1183
  variant: "h3",
1180
1184
  children: "待生效的臨時設定"
1181
- }), /* @__PURE__ */ T("div", {
1185
+ }), /* @__PURE__ */ E("div", {
1182
1186
  style: vn,
1183
- children: /* @__PURE__ */ T(ge, {
1184
- columns: dt,
1185
- dataSource: ut,
1187
+ children: /* @__PURE__ */ E(ge, {
1188
+ columns: ut,
1189
+ dataSource: lt,
1186
1190
  fullWidth: !0
1187
1191
  })
1188
1192
  })] }) : null,
1189
- /* @__PURE__ */ E(S, {
1193
+ /* @__PURE__ */ D(S, {
1190
1194
  cancelText: "取消",
1191
1195
  confirmText: "送出同意",
1192
- loading: f,
1196
+ loading: p,
1193
1197
  modalType: "standard",
1194
- onCancel: L,
1195
- onClose: L,
1196
- onConfirm: () => void mt(),
1198
+ onCancel: pt,
1199
+ onClose: pt,
1200
+ onConfirm: () => void B(),
1197
1201
  open: re,
1198
1202
  showModalFooter: !0,
1199
1203
  showModalHeader: !0,
@@ -1201,108 +1205,108 @@ var xn = {
1201
1205
  supportingText: "可以留下同意的說明,內容會記錄在簽核歷程;不填也可以直接送出。",
1202
1206
  title: "簽核意見",
1203
1207
  children: [
1204
- ee ? /* @__PURE__ */ T(w, {
1208
+ te ? /* @__PURE__ */ E(w, {
1205
1209
  color: "text-error",
1206
1210
  role: "alert",
1207
1211
  variant: "body",
1208
- children: ee
1212
+ children: te
1209
1213
  }) : null,
1210
- i !== null && i.summary.length > 0 ? /* @__PURE__ */ E("div", {
1214
+ i !== null && i.summary.length > 0 ? /* @__PURE__ */ D("div", {
1211
1215
  style: hn,
1212
- children: [/* @__PURE__ */ T(w, {
1216
+ children: [/* @__PURE__ */ E(w, {
1213
1217
  variant: "body",
1214
1218
  children: "將一併送出的補填欄位:"
1215
- }), i.summary.map((e) => /* @__PURE__ */ T(b, {
1219
+ }), i.summary.map((e) => /* @__PURE__ */ E(b, {
1216
1220
  title: e.label,
1217
- children: /* @__PURE__ */ T(le, { children: e.text })
1221
+ children: /* @__PURE__ */ E(le, { children: e.text })
1218
1222
  }, e.fieldKey))]
1219
1223
  }) : null,
1220
- /* @__PURE__ */ T("div", {
1224
+ /* @__PURE__ */ E("div", {
1221
1225
  style: hn,
1222
- children: /* @__PURE__ */ T(n, {
1226
+ children: /* @__PURE__ */ E(n, {
1223
1227
  label: "簽核意見",
1224
1228
  name: "approveComment",
1225
- children: /* @__PURE__ */ T(_e, {
1229
+ children: /* @__PURE__ */ E(_e, {
1226
1230
  autoFocus: !0,
1227
- onChange: (e) => ne(e.target.value),
1231
+ onChange: (e) => h(e.target.value),
1228
1232
  placeholder: "選填,例如補充核准的條件或提醒事項",
1229
1233
  ref: bn,
1230
1234
  resize: "vertical",
1231
1235
  rows: 4,
1232
1236
  style: gn,
1233
- value: te
1237
+ value: ne
1234
1238
  })
1235
1239
  })
1236
1240
  })
1237
1241
  ]
1238
1242
  }),
1239
- /* @__PURE__ */ T(S, {
1243
+ /* @__PURE__ */ E(S, {
1240
1244
  cancelText: "取消",
1241
1245
  confirmButtonProps: {
1242
- disabled: !tt,
1246
+ disabled: !N,
1243
1247
  variant: "destructive-primary"
1244
1248
  },
1245
1249
  confirmText: "送出拒絕",
1246
- loading: f,
1250
+ loading: p,
1247
1251
  modalStatusType: "error",
1248
1252
  modalType: "standard",
1249
- onCancel: R,
1250
- onClose: R,
1251
- onConfirm: () => void B(),
1252
- open: de,
1253
+ onCancel: ht,
1254
+ onClose: ht,
1255
+ onConfirm: () => void H(),
1256
+ open: pe,
1253
1257
  showModalFooter: !0,
1254
1258
  showModalHeader: !0,
1255
1259
  size: "regular",
1256
1260
  supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
1257
1261
  title: "拒絕原因",
1258
- children: /* @__PURE__ */ E("div", {
1262
+ children: /* @__PURE__ */ D("div", {
1259
1263
  style: hn,
1260
- children: [/* @__PURE__ */ T(n, {
1264
+ children: [/* @__PURE__ */ E(n, {
1261
1265
  label: "拒絕原因",
1262
1266
  name: "rejectReason",
1263
1267
  required: !0,
1264
- children: /* @__PURE__ */ T(_e, {
1268
+ children: /* @__PURE__ */ E(_e, {
1265
1269
  autoFocus: !0,
1266
1270
  onChange: (e) => {
1267
- g(e.target.value), x(null);
1271
+ x(e.target.value), fe(null);
1268
1272
  },
1269
1273
  placeholder: "請說明拒絕原因",
1270
1274
  ref: bn,
1271
1275
  resize: "vertical",
1272
1276
  rows: 4,
1273
1277
  style: gn,
1274
- type: oe ? "error" : "default",
1275
- value: ie
1278
+ type: de ? "error" : "default",
1279
+ value: oe
1276
1280
  })
1277
- }), oe ? /* @__PURE__ */ T(w, {
1281
+ }), de ? /* @__PURE__ */ E(w, {
1278
1282
  color: "text-error",
1279
1283
  variant: "body",
1280
- children: oe
1284
+ children: de
1281
1285
  }) : null]
1282
1286
  })
1283
1287
  }),
1284
- /* @__PURE__ */ T(S, {
1288
+ /* @__PURE__ */ E(S, {
1285
1289
  cancelText: "取消",
1286
- confirmButtonProps: { disabled: !De },
1290
+ confirmButtonProps: { disabled: !Oe },
1287
1291
  confirmText: "送出轉派",
1288
- loading: f,
1292
+ loading: p,
1289
1293
  modalType: "standard",
1290
- onCancel: yt,
1291
- onClose: yt,
1292
- onConfirm: () => void bt(),
1293
- open: Fe,
1294
+ onCancel: vt,
1295
+ onClose: vt,
1296
+ onConfirm: () => void U(),
1297
+ open: Ie,
1294
1298
  showModalFooter: !0,
1295
1299
  showModalHeader: !0,
1296
1300
  size: "regular",
1297
1301
  supportingText: "轉派後,原任務會保留轉派紀錄,新的待簽任務會指派給指定成員。",
1298
1302
  title: "轉派簽核",
1299
- children: /* @__PURE__ */ E("div", {
1303
+ children: /* @__PURE__ */ D("div", {
1300
1304
  style: _n,
1301
- children: [/* @__PURE__ */ T(n, {
1305
+ children: [/* @__PURE__ */ E(n, {
1302
1306
  label: "轉派對象",
1303
1307
  name: "transferToMemberId",
1304
1308
  required: !0,
1305
- children: /* @__PURE__ */ T(se, {
1309
+ children: /* @__PURE__ */ E(se, {
1306
1310
  asyncData: !0,
1307
1311
  disabledOptionsFilter: !0,
1308
1312
  emptyText: "沒有符合的成員",
@@ -1312,25 +1316,25 @@ var xn = {
1312
1316
  name: "transfer-member-search",
1313
1317
  spellCheck: !1
1314
1318
  },
1315
- loading: ke,
1319
+ loading: Ae,
1316
1320
  loadingText: "搜尋成員中...",
1317
1321
  mode: "single",
1318
- onChange: (e) => Oe(Nt(e)),
1319
- onSearch: z,
1320
- onSearchTextChange: (e) => Oe(Pt(e, je)),
1322
+ onChange: (e) => ke(Mt(e)),
1323
+ onSearch: yt,
1324
+ onSearchTextChange: (e) => ke(Nt(e, Pe)),
1321
1325
  onVisibilityChange: (e) => {
1322
- e && z("");
1326
+ e && yt("");
1323
1327
  },
1324
- options: [...je],
1328
+ options: [...Pe],
1325
1329
  placeholder: "搜尋姓名或信箱",
1326
1330
  searchDebounceTime: 300,
1327
- value: De
1331
+ value: Oe
1328
1332
  })
1329
- }), /* @__PURE__ */ T(n, {
1333
+ }), /* @__PURE__ */ E(n, {
1330
1334
  label: "轉派說明",
1331
1335
  name: "transferComment",
1332
- children: /* @__PURE__ */ T(_e, {
1333
- onChange: (e) => D(e.target.value),
1336
+ children: /* @__PURE__ */ E(_e, {
1337
+ onChange: (e) => De(e.target.value),
1334
1338
  placeholder: "可補充轉派原因",
1335
1339
  ref: bn,
1336
1340
  resize: "vertical",
@@ -1341,78 +1345,78 @@ var xn = {
1341
1345
  })]
1342
1346
  })
1343
1347
  }),
1344
- /* @__PURE__ */ T(S, {
1348
+ /* @__PURE__ */ E(S, {
1345
1349
  cancelText: "取消",
1346
- confirmButtonProps: { disabled: !F || P && !nt },
1350
+ confirmButtonProps: { disabled: !ot || at && !tt },
1347
1351
  confirmText: "送出退回",
1348
- loading: f,
1352
+ loading: p,
1349
1353
  modalType: "standard",
1350
1354
  onCancel: _t,
1351
1355
  onClose: _t,
1352
- onConfirm: () => void V(),
1353
- open: he,
1356
+ onConfirm: () => void bt(),
1357
+ open: be,
1354
1358
  showModalFooter: !0,
1355
1359
  showModalHeader: !0,
1356
1360
  size: "regular",
1357
1361
  supportingText: "退回後,流程會回到指定節點並等待重新處理。",
1358
1362
  title: "退回簽核",
1359
- children: /* @__PURE__ */ E("div", {
1363
+ children: /* @__PURE__ */ D("div", {
1360
1364
  style: _n,
1361
- children: [/* @__PURE__ */ T(n, {
1365
+ children: [/* @__PURE__ */ E(n, {
1362
1366
  label: "退回節點",
1363
1367
  name: "returnTargetNodeId",
1364
1368
  required: !0,
1365
- children: /* @__PURE__ */ T(C, {
1369
+ children: /* @__PURE__ */ E(C, {
1366
1370
  clearable: !1,
1367
1371
  fullWidth: !0,
1368
- onChange: (e) => Te(e?.id ?? null),
1369
- options: [...it],
1372
+ onChange: (e) => O(e?.id ?? null),
1373
+ options: [...I],
1370
1374
  placeholder: "選擇退回節點",
1371
- value: F
1375
+ value: ot
1372
1376
  })
1373
- }), /* @__PURE__ */ T(n, {
1374
- hintText: P ? "此關卡設定退回時必須填寫意見。" : void 0,
1377
+ }), /* @__PURE__ */ E(n, {
1378
+ hintText: at ? "此關卡設定退回時必須填寫意見。" : void 0,
1375
1379
  label: "退回說明",
1376
1380
  name: "returnComment",
1377
- required: P,
1378
- children: /* @__PURE__ */ T(_e, {
1379
- onChange: (e) => me(e.target.value),
1380
- placeholder: P ? "請說明退回原因" : "可補充需要修改的內容",
1381
+ required: at,
1382
+ children: /* @__PURE__ */ E(_e, {
1383
+ onChange: (e) => ve(e.target.value),
1384
+ placeholder: at ? "請說明退回原因" : "可補充需要修改的內容",
1381
1385
  ref: bn,
1382
1386
  resize: "vertical",
1383
1387
  rows: 4,
1384
1388
  style: gn,
1385
- value: pe
1389
+ value: he
1386
1390
  })
1387
1391
  })]
1388
1392
  })
1389
1393
  }),
1390
- /* @__PURE__ */ T(S, {
1394
+ /* @__PURE__ */ E(S, {
1391
1395
  cancelText: "取消",
1392
- confirmButtonProps: { disabled: Ot },
1396
+ confirmButtonProps: { disabled: Pt },
1393
1397
  confirmText: "送出",
1394
- loading: Xe,
1398
+ loading: M,
1395
1399
  modalType: "standard",
1396
- onCancel: U,
1397
- onClose: U,
1398
- onConfirm: () => void Ct(),
1399
- open: Ge,
1400
+ onCancel: Ct,
1401
+ onClose: Ct,
1402
+ onConfirm: () => void wt(),
1403
+ open: Ke,
1400
1404
  showModalFooter: !0,
1401
1405
  showModalHeader: !0,
1402
1406
  size: "regular",
1403
- supportingText: Sn[k],
1404
- title: xn[k],
1405
- children: /* @__PURE__ */ E("div", {
1407
+ supportingText: Sn[A],
1408
+ title: xn[A],
1409
+ children: /* @__PURE__ */ D("div", {
1406
1410
  style: _n,
1407
1411
  children: [
1408
- G ? /* @__PURE__ */ T(n, {
1412
+ Y ? /* @__PURE__ */ E(n, {
1409
1413
  label: "通知時機",
1410
1414
  name: "adhocNotifyMode",
1411
1415
  required: !0,
1412
- children: /* @__PURE__ */ T(C, {
1416
+ children: /* @__PURE__ */ E(C, {
1413
1417
  clearable: !1,
1414
1418
  fullWidth: !0,
1415
- onChange: (e) => qe(e?.id === "COMPLETION_NOTIFY" ? "COMPLETION_NOTIFY" : "STAGE_NOTIFY"),
1419
+ onChange: (e) => Je(e?.id === "COMPLETION_NOTIFY" ? "COMPLETION_NOTIFY" : "STAGE_NOTIFY"),
1416
1420
  options: [{
1417
1421
  id: "STAGE_NOTIFY",
1418
1422
  name: xn.STAGE_NOTIFY
@@ -1421,38 +1425,38 @@ var xn = {
1421
1425
  name: xn.COMPLETION_NOTIFY
1422
1426
  }],
1423
1427
  value: {
1424
- id: k,
1425
- name: xn[k]
1428
+ id: A,
1429
+ name: xn[A]
1426
1430
  }
1427
1431
  })
1428
1432
  }) : null,
1429
- G ? /* @__PURE__ */ T(n, {
1433
+ Y ? /* @__PURE__ */ E(n, {
1430
1434
  label: "通知對象類型",
1431
1435
  name: "adhocTargetKind",
1432
1436
  required: !0,
1433
- children: /* @__PURE__ */ T(C, {
1437
+ children: /* @__PURE__ */ E(C, {
1434
1438
  clearable: !1,
1435
1439
  fullWidth: !0,
1436
1440
  onChange: (e) => Qe(e?.id === "WEBHOOK" ? "WEBHOOK" : "MEMBER"),
1437
1441
  options: [...wn],
1438
- value: Ft
1442
+ value: It
1439
1443
  })
1440
1444
  }) : null,
1441
- G && Ze === "WEBHOOK" ? /* @__PURE__ */ T(n, {
1445
+ Y && Ze === "WEBHOOK" ? /* @__PURE__ */ E(n, {
1442
1446
  label: "Webhook URL",
1443
1447
  name: "adhocWebhookUrl",
1444
1448
  required: !0,
1445
- children: /* @__PURE__ */ T(ue, {
1449
+ children: /* @__PURE__ */ E(ue, {
1446
1450
  fullWidth: !0,
1447
1451
  onChange: (e) => et(e.target.value),
1448
1452
  placeholder: "https://example.com/webhook",
1449
1453
  value: $e
1450
1454
  })
1451
- }) : /* @__PURE__ */ T(n, {
1452
- label: G ? "通知對象" : "簽核對象",
1455
+ }) : /* @__PURE__ */ E(n, {
1456
+ label: Y ? "通知對象" : "簽核對象",
1453
1457
  name: "adhocMemberId",
1454
1458
  required: !0,
1455
- children: /* @__PURE__ */ T(se, {
1459
+ children: /* @__PURE__ */ E(se, {
1456
1460
  asyncData: !0,
1457
1461
  disabledOptionsFilter: !0,
1458
1462
  emptyText: "沒有符合的成員",
@@ -1462,45 +1466,45 @@ var xn = {
1462
1466
  name: "adhoc-member-search",
1463
1467
  spellCheck: !1
1464
1468
  },
1465
- loading: Ve,
1469
+ loading: He,
1466
1470
  loadingText: "搜尋成員中...",
1467
1471
  menuMaxHeight: 320,
1468
1472
  mode: "multiple",
1469
- onChange: (e) => Be(e.map(Nt).filter(Mt)),
1470
- onSearch: W,
1473
+ onChange: (e) => Ve(e.map(Mt).filter(J)),
1474
+ onSearch: K,
1471
1475
  onVisibilityChange: (e) => {
1472
- e && W("");
1476
+ e && K("");
1473
1477
  },
1474
- options: [...Ue],
1478
+ options: [...We],
1475
1479
  overflowStrategy: "wrap",
1476
1480
  placeholder: "搜尋姓名或信箱,可加入多位",
1477
1481
  searchDebounceTime: 300,
1478
- value: [...ze]
1482
+ value: [...Be]
1479
1483
  })
1480
1484
  }),
1481
- k === "PRE_APPROVAL" ? /* @__PURE__ */ T(n, {
1485
+ A === "PRE_APPROVAL" ? /* @__PURE__ */ E(n, {
1482
1486
  label: "拒簽處理方式",
1483
1487
  name: "adhocOnReject",
1484
1488
  required: !0,
1485
- children: /* @__PURE__ */ T(C, {
1489
+ children: /* @__PURE__ */ E(C, {
1486
1490
  clearable: !1,
1487
1491
  fullWidth: !0,
1488
- onChange: (e) => Ye(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
1492
+ onChange: (e) => j(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
1489
1493
  options: [...Cn],
1490
- value: J
1494
+ value: Ft
1491
1495
  })
1492
1496
  }) : null,
1493
- G ? null : /* @__PURE__ */ T(n, {
1497
+ Y ? null : /* @__PURE__ */ E(n, {
1494
1498
  label: "說明",
1495
1499
  name: "adhocComment",
1496
- children: /* @__PURE__ */ T(_e, {
1497
- onChange: (e) => Re(e.target.value),
1500
+ children: /* @__PURE__ */ E(_e, {
1501
+ onChange: (e) => ze(e.target.value),
1498
1502
  placeholder: "可補充原因",
1499
1503
  ref: bn,
1500
1504
  resize: "vertical",
1501
1505
  rows: 3,
1502
1506
  style: gn,
1503
- value: Le
1507
+ value: Re
1504
1508
  })
1505
1509
  })
1506
1510
  ]
@@ -1511,7 +1515,7 @@ var xn = {
1511
1515
  function En(e, t) {
1512
1516
  try {
1513
1517
  let n = JSON.parse(e.targetValueJson);
1514
- if (n.memberIds?.length) return n.memberIds.map((e) => K(e, t)).join("、");
1518
+ if (n.memberIds?.length) return n.memberIds.map((e) => q(e, t)).join("、");
1515
1519
  if (n.webhookUrl) return n.webhookUrl;
1516
1520
  if (n.positionId) return `職位 ${n.positionId}`;
1517
1521
  if (n.orgUnitId) return `部門 ${n.orgUnitId}`;
@@ -1521,7 +1525,7 @@ function En(e, t) {
1521
1525
  function Dn(e, t) {
1522
1526
  if (e.isAdhoc || e.status !== "PENDING" && e.status !== "IN_PROGRESS") return 0;
1523
1527
  let n = t?.nodes.find((t) => t.id === e.nodeId);
1524
- return n?.type === "userTask" ? Ze(n).size : 0;
1528
+ return n?.type === "userTask" ? M(n).size : 0;
1525
1529
  }
1526
1530
  //#endregion
1527
1531
  //#region src/views/instances/detail/sections/InstanceSignaturesSection.tsx
@@ -1532,7 +1536,7 @@ var On = {
1532
1536
  function kn({ signatureVerification: e, signatures: n }) {
1533
1537
  let r = _(() => n.map((e) => ({
1534
1538
  algorithm: e.algorithm,
1535
- hashLabel: W(e.signedPayloadHash),
1539
+ hashLabel: St(e.signedPayloadHash),
1536
1540
  key: e.id,
1537
1541
  keyVersion: e.keyVersion,
1538
1542
  signedAtLabel: t(e.signedAt),
@@ -1569,20 +1573,20 @@ function kn({ signatureVerification: e, signatures: n }) {
1569
1573
  width: 220
1570
1574
  }
1571
1575
  ], []);
1572
- return /* @__PURE__ */ E("div", {
1576
+ return /* @__PURE__ */ D("div", {
1573
1577
  style: On,
1574
1578
  children: [
1575
- /* @__PURE__ */ T(w, {
1579
+ /* @__PURE__ */ E(w, {
1576
1580
  component: "h2",
1577
1581
  variant: "h3",
1578
1582
  children: "簽章"
1579
1583
  }),
1580
- /* @__PURE__ */ T(w, {
1584
+ /* @__PURE__ */ E(w, {
1581
1585
  color: e?.valid ? "text-success" : "text-error",
1582
1586
  variant: "body",
1583
1587
  children: e ? e.valid ? `簽章鏈已驗證,共 ${e.checkedCount} 筆。` : `簽章鏈驗證失敗:${e.errors.join("、")}` : "尚無簽章紀錄。"
1584
1588
  }),
1585
- r.length > 0 ? /* @__PURE__ */ T(ge, {
1589
+ r.length > 0 ? /* @__PURE__ */ E(ge, {
1586
1590
  columns: i,
1587
1591
  dataSource: r,
1588
1592
  fullWidth: !0
@@ -1614,34 +1618,34 @@ var An = {
1614
1618
  color: "var(--mzn-color-text-error)"
1615
1619
  };
1616
1620
  function Fn(...e) {
1617
- return e.filter((e) => V(e ?? null)).join(" ");
1621
+ return e.filter((e) => H(e ?? null)).join(" ");
1618
1622
  }
1619
- var In = h(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) {
1623
+ var In = re(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) {
1620
1624
  let d = r ? "pending" : o, f = t.filter((e) => e.type !== "comment"), p = t.filter((e) => e.type === "comment");
1621
- return /* @__PURE__ */ E("div", {
1625
+ return /* @__PURE__ */ D("div", {
1622
1626
  ...l,
1623
- className: Fn(F.host, c === "dot" ? F.dot : null, n && d !== "processing" ? F.error : null, a === "horizontal" ? F.horizontal : null, c === "number" ? F.number : null, d === "pending" ? F.pending : null, d === "processing" ? F.processing : null, n && d === "processing" ? F.processingError : null, !n && d === "succeeded" ? F.succeeded : null, a === "vertical" ? F.vertical : null, e),
1627
+ className: Fn(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),
1624
1628
  ref: u,
1625
- children: [c === "dot" ? /* @__PURE__ */ T("span", { className: Fn(F.statusIndicator, F.statusIndicatorDot) }) : /* @__PURE__ */ T("span", {
1626
- className: F.statusIndicator,
1629
+ children: [c === "dot" ? /* @__PURE__ */ E("span", { className: Fn(R.statusIndicator, R.statusIndicatorDot) }) : /* @__PURE__ */ E("span", {
1630
+ className: R.statusIndicator,
1627
1631
  children: i + 1
1628
- }), /* @__PURE__ */ E("div", {
1629
- className: F.textContainer,
1632
+ }), /* @__PURE__ */ D("div", {
1633
+ className: R.textContainer,
1630
1634
  children: [
1631
- /* @__PURE__ */ E(w, {
1632
- className: F.title,
1635
+ /* @__PURE__ */ D(w, {
1636
+ className: R.title,
1633
1637
  variant: "label-primary-highlight",
1634
- children: [s, /* @__PURE__ */ T("span", { className: F.titleConnectLine })]
1638
+ children: [s, /* @__PURE__ */ E("span", { className: R.titleConnectLine })]
1635
1639
  }),
1636
- f.length > 0 ? /* @__PURE__ */ T(w, {
1637
- className: F.description,
1640
+ f.length > 0 ? /* @__PURE__ */ E(w, {
1641
+ className: R.description,
1638
1642
  variant: "caption",
1639
- children: f.map((e, t) => /* @__PURE__ */ E(re, { children: [t > 0 ? " · " : null, Ln(e)] }, `${e.type}-${t}`))
1643
+ children: f.map((e, t) => /* @__PURE__ */ D(h, { children: [t > 0 ? " · " : null, Ln(e)] }, `${e.type}-${t}`))
1640
1644
  }) : null,
1641
- p.map((e, t) => /* @__PURE__ */ E(w, {
1645
+ p.map((e, t) => /* @__PURE__ */ D(w, {
1642
1646
  style: e.tone === "danger" ? Pn : Mn,
1643
1647
  variant: "body",
1644
- children: [/* @__PURE__ */ E("span", {
1648
+ children: [/* @__PURE__ */ D("span", {
1645
1649
  style: e.tone === "danger" ? void 0 : Nn,
1646
1650
  children: [e.label, ":"]
1647
1651
  }), e.text]
@@ -1651,12 +1655,12 @@ var In = h(function({ className: e, descriptionParts: t, error: n, forcePending:
1651
1655
  });
1652
1656
  });
1653
1657
  function Ln(e) {
1654
- return e.type === "text" ? e.text : e.email?.trim() ? /* @__PURE__ */ E(ye, { children: [
1658
+ return e.type === "text" ? e.text : e.email?.trim() ? /* @__PURE__ */ D(T, { children: [
1655
1659
  e.prefix,
1656
1660
  ":",
1657
- /* @__PURE__ */ T(ve, {
1661
+ /* @__PURE__ */ E(ve, {
1658
1662
  title: e.email,
1659
- children: ({ ref: t, ...n }) => /* @__PURE__ */ T("span", {
1663
+ children: ({ ref: t, ...n }) => /* @__PURE__ */ E("span", {
1660
1664
  ...n,
1661
1665
  "data-testid": e.memberId ? `member-tooltip-${e.memberId}` : void 0,
1662
1666
  ref: t,
@@ -1667,27 +1671,27 @@ function Ln(e) {
1667
1671
  ] }) : `${e.prefix}:${e.label}`;
1668
1672
  }
1669
1673
  function Rn({ activityLogs: e, formSchema: t = null, instanceState: n, memberProfilesById: r, signatureVerification: i, signaturesById: a, taskDecisionsByTaskId: o, tasks: s, workflowSnapshot: c, workflowTokens: l }) {
1670
- let u = rn(e, s, l, c, n, r, o, a, i, t), d = X(u), f = u.map((e) => ({
1674
+ let u = rn(e, s, l, c, n, r, o, a, i, t), d = Lt(u), f = u.map((e) => ({
1671
1675
  ...e,
1672
- descriptionParts: e.descriptionParts.filter(Y)
1676
+ descriptionParts: e.descriptionParts.filter(It)
1673
1677
  }));
1674
- return /* @__PURE__ */ E("div", {
1678
+ return /* @__PURE__ */ D("div", {
1675
1679
  style: An,
1676
- children: [/* @__PURE__ */ T(w, {
1680
+ children: [/* @__PURE__ */ E(w, {
1677
1681
  component: "h2",
1678
1682
  variant: "h3",
1679
1683
  children: "歷程"
1680
- }), f.length > 0 ? /* @__PURE__ */ T(he, {
1684
+ }), f.length > 0 ? /* @__PURE__ */ E(he, {
1681
1685
  currentStep: d,
1682
1686
  orientation: "vertical",
1683
1687
  type: "dot",
1684
- children: f.map((e) => /* @__PURE__ */ T(In, {
1688
+ children: f.map((e) => /* @__PURE__ */ E(In, {
1685
1689
  descriptionParts: e.descriptionParts,
1686
1690
  error: e.error,
1687
1691
  forcePending: e.forcePending,
1688
1692
  title: e.title
1689
1693
  }, e.id))
1690
- }) : /* @__PURE__ */ T(w, {
1694
+ }) : /* @__PURE__ */ E(w, {
1691
1695
  color: "text-neutral",
1692
1696
  variant: "body",
1693
1697
  children: "尚無歷程紀錄。"
@@ -1713,13 +1717,13 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1713
1717
  })), [e]), u = _(() => [
1714
1718
  {
1715
1719
  key: "endpoint",
1716
- render: ({ delivery: e }) => /* @__PURE__ */ E("div", {
1720
+ render: ({ delivery: e }) => /* @__PURE__ */ D("div", {
1717
1721
  style: Bn,
1718
- children: [/* @__PURE__ */ T(w, {
1722
+ children: [/* @__PURE__ */ E(w, {
1719
1723
  component: "span",
1720
1724
  variant: "body",
1721
1725
  children: e.endpointLabel ?? e.endpointKey
1722
- }), /* @__PURE__ */ E(w, {
1726
+ }), /* @__PURE__ */ D(w, {
1723
1727
  color: "text-neutral",
1724
1728
  component: "span",
1725
1729
  variant: "caption",
@@ -1738,13 +1742,13 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1738
1742
  },
1739
1743
  {
1740
1744
  key: "status",
1741
- render: ({ delivery: e }) => /* @__PURE__ */ T(Un, { status: e.status }),
1745
+ render: ({ delivery: e }) => /* @__PURE__ */ E(Un, { status: e.status }),
1742
1746
  title: "狀態",
1743
1747
  width: 120
1744
1748
  },
1745
1749
  {
1746
1750
  key: "attemptCount",
1747
- render: ({ delivery: e }) => /* @__PURE__ */ T(w, {
1751
+ render: ({ delivery: e }) => /* @__PURE__ */ E(w, {
1748
1752
  component: "span",
1749
1753
  variant: "body",
1750
1754
  children: e.attemptCount
@@ -1754,21 +1758,21 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1754
1758
  },
1755
1759
  {
1756
1760
  key: "lastError",
1757
- render: ({ delivery: e }) => e.lastErrorCode && e.status !== "SENT" ? /* @__PURE__ */ E("div", {
1761
+ render: ({ delivery: e }) => e.lastErrorCode && e.status !== "SENT" ? /* @__PURE__ */ D("div", {
1758
1762
  style: Bn,
1759
- children: [/* @__PURE__ */ T(w, {
1763
+ children: [/* @__PURE__ */ E(w, {
1760
1764
  color: "text-error",
1761
1765
  component: "span",
1762
1766
  variant: "body",
1763
1767
  children: e.lastErrorCode
1764
- }), e.lastErrorDetail ? /* @__PURE__ */ T(w, {
1768
+ }), e.lastErrorDetail ? /* @__PURE__ */ E(w, {
1765
1769
  color: "text-neutral",
1766
1770
  component: "span",
1767
1771
  style: Vn,
1768
1772
  variant: "caption",
1769
1773
  children: e.lastErrorDetail
1770
1774
  }) : null]
1771
- }) : /* @__PURE__ */ T(w, {
1775
+ }) : /* @__PURE__ */ E(w, {
1772
1776
  color: "text-neutral",
1773
1777
  component: "span",
1774
1778
  variant: "body",
@@ -1779,7 +1783,7 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1779
1783
  },
1780
1784
  {
1781
1785
  key: "time",
1782
- render: ({ delivery: e }) => /* @__PURE__ */ T(w, {
1786
+ render: ({ delivery: e }) => /* @__PURE__ */ E(w, {
1783
1787
  component: "span",
1784
1788
  variant: "body",
1785
1789
  children: Wn(e)
@@ -1812,30 +1816,30 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1812
1816
  }
1813
1817
  }
1814
1818
  }
1815
- return /* @__PURE__ */ E("div", {
1819
+ return /* @__PURE__ */ D("div", {
1816
1820
  style: zn,
1817
1821
  children: [
1818
- /* @__PURE__ */ T(w, {
1822
+ /* @__PURE__ */ E(w, {
1819
1823
  component: "h2",
1820
1824
  variant: "h3",
1821
1825
  children: "外部系統通知"
1822
1826
  }),
1823
- s ? /* @__PURE__ */ T(w, {
1827
+ s ? /* @__PURE__ */ E(w, {
1824
1828
  color: "text-error",
1825
1829
  variant: "body",
1826
1830
  children: s
1827
1831
  }) : null,
1828
- l.length > 0 ? /* @__PURE__ */ T(ge, {
1832
+ l.length > 0 ? /* @__PURE__ */ E(ge, {
1829
1833
  actions: d,
1830
1834
  columns: u,
1831
1835
  dataSource: l,
1832
1836
  fullWidth: !0
1833
- }) : /* @__PURE__ */ T(w, {
1837
+ }) : /* @__PURE__ */ E(w, {
1834
1838
  color: "text-neutral",
1835
1839
  variant: "body",
1836
1840
  children: "此案件沒有外部系統通知。"
1837
1841
  }),
1838
- /* @__PURE__ */ T(S, {
1842
+ /* @__PURE__ */ E(S, {
1839
1843
  cancelText: "取消",
1840
1844
  confirmText: "重新傳送",
1841
1845
  loading: a,
@@ -1849,7 +1853,7 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1849
1853
  showModalHeader: !0,
1850
1854
  supportingText: "會以相同的投遞編號重新送出,接收端可據此避免重複處理。",
1851
1855
  title: "重新傳送通知",
1852
- children: /* @__PURE__ */ E(w, {
1856
+ children: /* @__PURE__ */ D(w, {
1853
1857
  variant: "body",
1854
1858
  children: [
1855
1859
  "確定要重新通知「",
@@ -1862,15 +1866,15 @@ function Hn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1862
1866
  });
1863
1867
  }
1864
1868
  function Un({ status: e }) {
1865
- return e === "SENT" ? /* @__PURE__ */ T(ce, {
1869
+ return e === "SENT" ? /* @__PURE__ */ E(ce, {
1866
1870
  size: "sub",
1867
1871
  text: "已送達",
1868
1872
  variant: "dot-success"
1869
- }) : e === "FAILED" ? /* @__PURE__ */ T(ce, {
1873
+ }) : e === "FAILED" ? /* @__PURE__ */ E(ce, {
1870
1874
  size: "sub",
1871
1875
  text: "失敗",
1872
1876
  variant: "dot-error"
1873
- }) : /* @__PURE__ */ T(ce, {
1877
+ }) : /* @__PURE__ */ E(ce, {
1874
1878
  size: "sub",
1875
1879
  text: e === "PENDING" ? "等待傳送" : "傳送中",
1876
1880
  variant: "dot-info"
@@ -1887,18 +1891,18 @@ function Gn(e, t) {
1887
1891
  }
1888
1892
  function Kn({ activityLogs: e, actingTask: t, instance: n, tasks: r }) {
1889
1893
  let i = n.workflowSnapshot;
1890
- return et({
1894
+ return Qe({
1891
1895
  definition: i,
1892
1896
  fieldKeys: (n.formDefinitionSnapshot.schema?.fields ?? []).map((e) => e.fieldKey),
1893
1897
  isAdhocTask: t?.isAdhoc ?? !1,
1894
1898
  nodeId: t?.nodeId ?? null,
1895
- revealedFieldKeys: Qe(i, Gn(e, r))
1899
+ revealedFieldKeys: Xe(i, Gn(e, r))
1896
1900
  });
1897
1901
  }
1898
1902
  //#endregion
1899
1903
  //#region src/views/instances/detail/InstanceDetailView.tsx
1900
1904
  function qn(e) {
1901
- return `還有 ${new Set(Object.keys(e).map($e)).size} 個補填欄位需要完成`;
1905
+ return `還有 ${new Set(Object.keys(e).map(Ze)).size} 個補填欄位需要完成`;
1902
1906
  }
1903
1907
  var Jn = 3e3, Yn = 40, Xn = 184, Zn = 96, Qn = {
1904
1908
  display: "grid",
@@ -1954,25 +1958,25 @@ var Jn = 3e3, Yn = 40, Xn = 184, Zn = 96, Qn = {
1954
1958
  display: "grid",
1955
1959
  gap: 16
1956
1960
  }, sr = { workflowRuntime: _r };
1957
- function cr({ instanceId: i, showAttachments: a = !0, showForm: ne = !0, showHistory: re = !0, showSignatures: h = !0, showTasks: ae = !0, showWebhookDeliveries: se = !0 }) {
1958
- let { member: ce } = e(), b = ce?.memberId ?? null, le = se && r(ce), [x, ue] = v([]), [C, he] = v(null), [ge, ve] = v([]), [be, Se] = v([]), [Ce, we] = v([]), [D, Me] = v([]), [Ne, Pe] = v(null), [O, Be] = v([]), [Ve, Ue] = v([]), [We, qe] = v([]), [Xe, A] = v(null), [Qe, $e] = v(!0), [et, rt] = v(!1), [at, N] = v(!1), [P, st] = v(""), [ct, F] = v(!1), [I, lt] = v({}), [ut, dt] = v({}), [ft, pt] = v({}), [L, mt] = v(null), [R, gt] = v(null), [vt, yt] = v([]), z = P.trim(), B = oe(null), bt = oe(0), xt = D.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS");
1959
- g(() => {
1960
- Zt();
1961
- }, [b, i]), g(() => {
1961
+ function cr({ instanceId: i, showAttachments: a = !0, showForm: ne = !0, showHistory: h = !0, showSignatures: re = !0, showTasks: ae = !0, showWebhookDeliveries: se = !0 }) {
1962
+ let { member: ce } = e(), b = ce?.memberId ?? null, le = se && r(ce), [x, ue] = v([]), [C, he] = v(null), [ge, ve] = v([]), [ye, xe] = v([]), [Se, Ce] = v([]), [O, je] = v([]), [Me, Ne] = v(null), [k, ze] = v([]), [Be, He] = v([]), [Ue, qe] = v([]), [Ye, j] = v(null), [Xe, Ze] = v(!0), [Qe, N] = v(!1), [F, I] = v(!1), [L, it] = v(!1), [at, R] = v(""), [z, ot] = v(!1), [st, ct] = v({}), [lt, ut] = v({}), [dt, ft] = v({}), [B, mt] = v(null), [gt, _t] = v(null), [V, vt] = v([]), yt = at.trim(), U = oe(null), bt = oe(0), xt = O.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS");
1963
+ ie(() => {
1964
+ $t();
1965
+ }, [b, i]), ie(() => {
1962
1966
  if (!le || !xt || bt.current >= Yn) return;
1963
1967
  let e = setTimeout(() => {
1964
- bt.current += 1, en();
1968
+ bt.current += 1, nn();
1965
1969
  }, Jn);
1966
1970
  return () => clearTimeout(e);
1967
1971
  }, [
1968
1972
  le,
1969
1973
  xt,
1970
- D
1971
- ]), g(() => {
1972
- dt(C?.formData ?? {}), pt({});
1974
+ O
1975
+ ]), ie(() => {
1976
+ ut(C?.formData ?? {}), ft({});
1973
1977
  }, [C]);
1974
- let St = ie((e, t) => {
1975
- pt((n) => {
1978
+ let St = g((e, t) => {
1979
+ ft((n) => {
1976
1980
  let r = n[e];
1977
1981
  return r?.hasValue === t.hasValue && r.status === t.status ? n : {
1978
1982
  ...n,
@@ -1982,427 +1986,428 @@ function cr({ instanceId: i, showAttachments: a = !0, showForm: ne = !0, showHis
1982
1986
  }
1983
1987
  };
1984
1988
  });
1985
- }, []), U = _(() => kt(O, b), [b, O]), W = _(() => U && C ? C.workflowSnapshot.nodes.find((e) => e.id === U.nodeId) ?? null : null, [U, C]), wt = W?.type === "userTask" && W.data.returnBehavior.allowReturn, Tt = W?.type === "userTask" && W.data.allowReject !== !1, G = W?.type === "userTask" && W.data.allowTransfer !== !1, Dt = W?.type === "userTask" && W.data.allowAddSigner, Ot = !(!C || C.initiatorMemberId !== b || C.state !== "RUNNING" && C.state !== "RETURNED"), At = !!(C && C.initiatorMemberId === b && C.state === "RETURNED"), q = _(() => U && !U.isAdhoc && W?.type === "userTask" && Ze(W).size > 0 ? W : null, [U, W]), jt = q ? U?.id ?? null : null, [Mt, Nt] = v({}), [Pt, J] = v({}), [Ft, It] = v(!1);
1986
- g(() => {
1987
- Nt({}), J({}), It(!1);
1988
- }, [jt]);
1989
- let Y = C?.formDefinitionSnapshot.schema ?? null, X = _(() => q && Y ? o(Y, q) : null, [q, Y]), Z = _(() => X && C ? tt(X.fields, {
1989
+ }, []), G = _(() => Ot(k, b), [b, k]), K = _(() => G && C ? C.workflowSnapshot.nodes.find((e) => e.id === G.nodeId) ?? null : null, [G, C]), wt = K?.type === "userTask" && K.data.returnBehavior.allowReturn, Et = K?.type === "userTask" && K.data.allowReject !== !1, Dt = K?.type === "userTask" && K.data.allowTransfer !== !1, kt = K?.type === "userTask" && K.data.allowAddSigner, At = !(!C || C.initiatorMemberId !== b || C.state !== "RUNNING" && C.state !== "RETURNED"), jt = !!(C && C.initiatorMemberId === b && C.state === "RETURNED"), J = _(() => G && !G.isAdhoc && K?.type === "userTask" && M(K).size > 0 ? K : null, [G, K]), Mt = J ? G?.id ?? null : null, [Nt, Y] = v({}), [Pt, Ft] = v({}), [It, Lt] = v(!1);
1990
+ ie(() => {
1991
+ Y({}), Ft({}), Lt(!1);
1992
+ }, [Mt]);
1993
+ let X = C?.formDefinitionSnapshot.schema ?? null, Z = _(() => J && X ? o(X, J) : null, [J, X]), Q = _(() => Z && C ? $e(Z.fields, {
1990
1994
  ...C.formData,
1991
- ...Mt
1995
+ ...Nt
1992
1996
  }) : null, [
1993
- Mt,
1994
- X,
1997
+ Nt,
1998
+ Z,
1995
1999
  C
1996
- ]), Lt = _(() => q && X && Z && C ? c({
1997
- draft: Mt,
1998
- node: q,
1999
- schema: X,
2000
+ ]), Rt = _(() => J && Z && Q && C ? c({
2001
+ draft: Nt,
2002
+ node: J,
2003
+ schema: Z,
2000
2004
  stored: C.formData,
2001
- values: Z
2005
+ values: Q
2002
2006
  }) : {}, [
2003
- Mt,
2004
- q,
2005
- X,
2007
+ Nt,
2008
+ J,
2006
2009
  Z,
2010
+ Q,
2007
2011
  C
2008
- ]), Rt = _(() => C ? Kn({
2012
+ ]), zt = _(() => C ? Kn({
2009
2013
  activityLogs: x,
2010
- actingTask: U,
2014
+ actingTask: G,
2011
2015
  instance: C,
2012
- tasks: O
2016
+ tasks: k
2013
2017
  }) : void 0, [
2014
2018
  x,
2015
- U,
2019
+ G,
2016
2020
  C,
2017
- O
2018
- ]), zt = _(() => C ? d(C.workflowSnapshot, q) : void 0, [q, C]), Q = _(() => new Map(We.map((e) => [e.memberId, e])), [We]), Bt = _(() => q && Z && Y && C?.formDataFingerprint ? {
2021
+ k
2022
+ ]), Bt = _(() => C ? d(C.workflowSnapshot, J) : void 0, [J, C]), Vt = _(() => new Map(Ue.map((e) => [e.memberId, e])), [Ue]), Ht = _(() => J && Q && X && C?.formDataFingerprint ? {
2019
2023
  expectedFormDataFingerprint: C.formDataFingerprint,
2020
- formData: p(Lt, q),
2021
- summary: l(Y, q, Lt, new Map([...Q.keys()].map((e) => [e, K(e, Q)])))
2024
+ formData: p(Rt, J),
2025
+ summary: l(X, J, Rt, new Map([...Vt.keys()].map((e) => [e, q(e, Vt)])))
2022
2026
  } : null, [
2023
- Lt,
2024
- q,
2025
- Z,
2026
- C,
2027
+ Rt,
2028
+ J,
2027
2029
  Q,
2028
- Y
2030
+ C,
2031
+ Vt,
2032
+ X
2029
2033
  ]);
2030
- function Vt(e) {
2031
- if (!q) return;
2032
- let t = Ze(q), n = Object.entries(e).filter(([e, n]) => t.has(e) && JSON.stringify(n) !== JSON.stringify(Z?.[e]));
2033
- Nt((e) => ({
2034
+ function Ut(e) {
2035
+ if (!J) return;
2036
+ let t = M(J), n = Object.entries(e).filter(([e, n]) => t.has(e) && JSON.stringify(n) !== JSON.stringify(Q?.[e]));
2037
+ Y((e) => ({
2034
2038
  ...e,
2035
2039
  ...Object.fromEntries(n)
2036
- })), J({});
2040
+ })), Ft({});
2037
2041
  }
2038
- function Ht() {
2039
- if (q && !C?.formDataFingerprint) de.error("無法確認表單版本,請重新整理頁面後再同意。");
2042
+ function Wt() {
2043
+ if (J && !C?.formDataFingerprint) de.error("無法確認表單版本,請重新整理頁面後再同意。");
2040
2044
  else {
2041
- if (q && Z && Y && C?.formDefinitionSnapshot.uiSchema) {
2042
- let e = j({
2043
- schema: m(Y, q),
2045
+ if (J && Q && X && C?.formDefinitionSnapshot.uiSchema) {
2046
+ let e = tt({
2047
+ schema: te(X, J),
2044
2048
  uiSchema: C.formDefinitionSnapshot.uiSchema,
2045
- values: Z
2049
+ values: Q
2046
2050
  });
2047
2051
  if (!e.valid) {
2048
- J(e.errors), e.firstInvalidFieldKey && nt(e.firstInvalidFieldKey), de.warning(qn(e.errors));
2052
+ Ft(e.errors), e.firstInvalidFieldKey && et(e.firstInvalidFieldKey), de.warning(qn(e.errors));
2049
2053
  return;
2050
2054
  }
2051
2055
  }
2052
- B.current?.handleApprove();
2056
+ U.current?.handleApprove();
2053
2057
  }
2054
2058
  }
2055
- function Ut(e) {
2056
- if (!q || !Y) return !1;
2057
- if (ee(e)) return It(!0), !0;
2058
- let t = s(e, Y, q);
2059
- return t ? (J(t), nt(Object.keys(t)[0] ?? ""), de.warning(qn(t)), !0) : !1;
2059
+ function Gt(e) {
2060
+ if (!J || !X) return !1;
2061
+ if (ee(e)) return Lt(!0), !0;
2062
+ let t = s(e, X, J);
2063
+ return t ? (Ft(t), et(Object.keys(t)[0] ?? ""), de.warning(qn(t)), !0) : !1;
2060
2064
  }
2061
- async function Wt() {
2062
- await Zt(), It(!1);
2065
+ async function Kt() {
2066
+ await $t(), Lt(!1);
2063
2067
  }
2064
- let Gt = _(() => un(ge), [ge]), Kt = _(() => new Map(Ce.map((e) => [e.id, e])), [Ce]), qt = _(() => C ? pr(C.workflowSnapshot) : null, [C]), Jt = _(() => C && qt ? fr(qt, O, Ve, C.state) : [], [
2068
+ let qt = _(() => un(ge), [ge]), Jt = _(() => new Map(Se.map((e) => [e.id, e])), [Se]), Yt = _(() => C ? pr(C.workflowSnapshot) : null, [C]), Xt = _(() => C && Yt ? fr(Yt, k, Be, C.state) : [], [
2065
2069
  C,
2066
- qt,
2067
- O,
2068
- Ve
2069
- ]), Yt = _(() => qt ? mr(qt) : [], [qt]), Xt = _(() => C ? ur(C.workflowSnapshot) : [], [C]);
2070
- async function Zt() {
2071
- $e(!0), A(null);
2070
+ Yt,
2071
+ k,
2072
+ Be
2073
+ ]), Zt = _(() => Yt ? mr(Yt) : [], [Yt]), Qt = _(() => C ? ur(C.workflowSnapshot) : [], [C]);
2074
+ async function $t() {
2075
+ Ze(!0), j(null);
2072
2076
  try {
2073
- let e = await Oe(i);
2074
- ue(e.activityLogs), he(e.instance), Be(e.tasks), Ue(e.workflowTokens);
2075
- let t = await Te(e.instance.id), [n, r, a, o, s] = await Promise.all([
2077
+ let e = await De(i);
2078
+ ue(e.activityLogs), he(e.instance), ze(e.tasks), He(e.workflowTokens);
2079
+ let t = await we(e.instance.id), [n, r, a, o, s] = await Promise.all([
2076
2080
  ln(e.tasks),
2077
2081
  sn({
2078
2082
  ...e,
2079
2083
  adhocDirectives: t
2080
2084
  }),
2081
- Ee(e.instance.id),
2082
- je(e.instance.id),
2083
- Qt(e.instance.id)
2085
+ Te(e.instance.id),
2086
+ Ae(e.instance.id),
2087
+ en(e.instance.id)
2084
2088
  ]);
2085
- ve(n), qe(r), Se(a), we(o.signatures), Pe(o.verification), yt(t), Me(s);
2089
+ ve(n), qe(r), xe(a), Ce(o.signatures), Ne(o.verification), vt(t), je(s);
2086
2090
  } catch (e) {
2087
- A(H(e));
2091
+ j(W(e));
2088
2092
  } finally {
2089
- $e(!1);
2093
+ Ze(!1);
2090
2094
  }
2091
2095
  }
2092
- async function Qt(e) {
2093
- return le ? De(e).catch(() => []) : [];
2096
+ async function en(e) {
2097
+ return le ? Ee(e).catch(() => []) : [];
2094
2098
  }
2095
- async function $t(e) {
2096
- await Ie(e.id), bt.current = 0, await Zt();
2099
+ async function tn(e) {
2100
+ await Fe(e.id), bt.current = 0, await $t();
2097
2101
  }
2098
- async function en() {
2099
- let e = await Qt(i);
2100
- e.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS") ? Me(e) : await Zt();
2102
+ async function nn() {
2103
+ let e = await en(i);
2104
+ e.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS") ? je(e) : await $t();
2101
2105
  }
2102
- async function tn(e, t) {
2106
+ async function rn(e, t) {
2103
2107
  if (!b) throw Error("尚未登入,無法上傳附件");
2104
- return { id: (await Le({
2108
+ return { id: (await Ie({
2105
2109
  file: t,
2106
2110
  formFieldPath: `form.${e.fieldKey}`
2107
2111
  })).id };
2108
2112
  }
2109
- async function nn(e) {
2113
+ async function an(e) {
2110
2114
  if (!b) return;
2111
- let t = await ke({ id: e.id });
2115
+ let t = await Oe({ id: e.id });
2112
2116
  window.open(t, "_blank", "noopener,noreferrer");
2113
2117
  }
2114
- async function rn(e) {
2118
+ async function on(e) {
2115
2119
  if (!b) return;
2116
- let t = await Ae({ id: e.id });
2117
- mt(e), gt(t);
2120
+ let t = await ke({ id: e.id });
2121
+ mt(e), _t(t);
2118
2122
  }
2119
- async function an() {
2120
- if (b && C && Ot) {
2121
- rt(!0), A(null), lt({});
2123
+ async function cn() {
2124
+ if (b && C && At) {
2125
+ N(!0), j(null), ct({});
2122
2126
  try {
2123
- await xe({
2127
+ await be({
2124
2128
  cancelledByMemberId: b,
2125
- comment: z || null,
2129
+ comment: yt || null,
2126
2130
  instanceId: C.id
2127
- }), st(""), F(!1), await Zt();
2131
+ }), R(""), ot(!1), await $t();
2128
2132
  } catch (e) {
2129
- A(H(e));
2133
+ j(W(e));
2130
2134
  } finally {
2131
- rt(!1);
2135
+ N(!1);
2132
2136
  }
2133
2137
  }
2134
2138
  }
2135
- async function on() {
2136
- if (!b || !C || !At) return;
2137
- rt(!0), A(null), lt({});
2138
- let e = te(Object.values(ft));
2139
+ async function dn() {
2140
+ if (!b || !C || !jt) return;
2141
+ N(!0), j(null), ct({});
2142
+ let e = m(Object.values(dt));
2139
2143
  if (e) {
2140
- A(e), rt(!1);
2144
+ j(e), N(!1);
2141
2145
  return;
2142
2146
  }
2143
- let t = C.formDefinitionSnapshot.schema ? u(C.formDefinitionSnapshot.schema, C.workflowSnapshot) : null, n = f(t ? tt(t.fields, ut) : ut, C.workflowSnapshot);
2147
+ let t = C.formDefinitionSnapshot.schema ? u(C.formDefinitionSnapshot.schema, C.workflowSnapshot) : null, n = f(t ? $e(t.fields, lt) : lt, C.workflowSnapshot);
2144
2148
  if (t && C.formDefinitionSnapshot.uiSchema) {
2145
- let e = j({
2149
+ let e = tt({
2146
2150
  schema: t,
2147
2151
  uiSchema: C.formDefinitionSnapshot.uiSchema,
2148
2152
  values: n
2149
2153
  });
2150
2154
  if (!e.valid) {
2151
- lt(e.errors), A("請先補齊必填欄位。"), e.firstInvalidFieldKey && nt(e.firstInvalidFieldKey), rt(!1);
2155
+ ct(e.errors), j("請先補齊必填欄位。"), e.firstInvalidFieldKey && et(e.firstInvalidFieldKey), N(!1);
2152
2156
  return;
2153
2157
  }
2154
2158
  }
2155
2159
  try {
2156
- await Fe({
2160
+ await Pe({
2157
2161
  formData: n,
2158
2162
  initiatorMemberId: b,
2159
2163
  instanceId: C.id,
2160
2164
  title: C.title
2161
- }), await Zt();
2165
+ }), await $t();
2162
2166
  } catch (e) {
2163
- A(H(e));
2167
+ j(W(e));
2164
2168
  } finally {
2165
- rt(!1);
2169
+ N(!1);
2166
2170
  }
2167
2171
  }
2168
- let cn = B.current?.deciding ?? !1, $ = et || cn;
2169
- return /* @__PURE__ */ E(ye, { children: [
2170
- /* @__PURE__ */ T(fe, { children: /* @__PURE__ */ E(Re, {
2172
+ let $ = Qe || F;
2173
+ return /* @__PURE__ */ D(T, { children: [
2174
+ /* @__PURE__ */ E(fe, { children: /* @__PURE__ */ D(Le, {
2171
2175
  description: C ? [
2172
2176
  Ct(C.state),
2173
2177
  t(C.startedAt),
2174
- _t(C, Q)
2175
- ].filter(V).join(" · ") : "載入案件內容。",
2178
+ ht(C, Vt)
2179
+ ].filter(H).join(" · ") : "載入案件內容。",
2176
2180
  title: C?.title ?? "簽核案件",
2177
2181
  children: [
2178
- C ? /* @__PURE__ */ T(y, {
2182
+ C ? /* @__PURE__ */ E(y, {
2179
2183
  "aria-label": "查看流程圖",
2180
- icon: Je,
2184
+ icon: A,
2181
2185
  iconType: "icon-only",
2182
- onClick: () => N(!0),
2186
+ onClick: () => it(!0),
2183
2187
  title: "查看流程圖",
2184
2188
  variant: "base-secondary",
2185
2189
  children: "流程圖"
2186
2190
  }) : null,
2187
- Ot ? /* @__PURE__ */ T(y, {
2191
+ At ? /* @__PURE__ */ E(y, {
2188
2192
  disabled: $,
2189
- icon: He,
2193
+ icon: Ve,
2190
2194
  iconType: "leading",
2191
- onClick: () => F(!0),
2195
+ onClick: () => ot(!0),
2192
2196
  variant: "destructive-secondary",
2193
2197
  children: "取消案件"
2194
2198
  }) : null,
2195
- U ? /* @__PURE__ */ E(ye, { children: [
2196
- Dt ? /* @__PURE__ */ E(ye, { children: [/* @__PURE__ */ T(y, {
2199
+ G ? /* @__PURE__ */ D(T, { children: [
2200
+ kt ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(y, {
2197
2201
  disabled: $,
2198
- icon: Ke,
2202
+ icon: Ge,
2199
2203
  iconType: "leading",
2200
- onClick: () => B.current?.openAdhocModal("COUNTERSIGN"),
2204
+ onClick: () => U.current?.openAdhocModal("COUNTERSIGN"),
2201
2205
  variant: "base-secondary",
2202
2206
  children: "會簽"
2203
- }, "adhoc-countersign"), /* @__PURE__ */ T(y, {
2207
+ }, "adhoc-countersign"), /* @__PURE__ */ E(y, {
2204
2208
  disabled: $,
2205
- icon: Ke,
2209
+ icon: Ge,
2206
2210
  iconType: "leading",
2207
- onClick: () => B.current?.openAdhocModal("PRE_APPROVAL"),
2211
+ onClick: () => U.current?.openAdhocModal("PRE_APPROVAL"),
2208
2212
  variant: "base-secondary",
2209
2213
  children: "加簽"
2210
2214
  }, "adhoc-pre-approval")] }) : null,
2211
- /* @__PURE__ */ T(y, {
2215
+ /* @__PURE__ */ E(y, {
2212
2216
  disabled: $,
2213
- icon: Ge,
2217
+ icon: We,
2214
2218
  iconType: "leading",
2215
- onClick: () => B.current?.openAdhocModal("STAGE_NOTIFY"),
2219
+ onClick: () => U.current?.openAdhocModal("STAGE_NOTIFY"),
2216
2220
  variant: "base-secondary",
2217
2221
  children: "通知設定"
2218
2222
  }, "adhoc-notify"),
2219
- wt ? /* @__PURE__ */ T(y, {
2223
+ wt ? /* @__PURE__ */ E(y, {
2220
2224
  disabled: $,
2221
- icon: k,
2225
+ icon: Ke,
2222
2226
  iconType: "leading",
2223
- onClick: () => B.current?.openReturnModal(),
2227
+ onClick: () => U.current?.openReturnModal(),
2224
2228
  variant: "base-secondary",
2225
2229
  children: "退回"
2226
2230
  }, "task-return") : null,
2227
- G ? /* @__PURE__ */ T(y, {
2231
+ Dt ? /* @__PURE__ */ E(y, {
2228
2232
  disabled: $,
2229
- icon: Ye,
2233
+ icon: Je,
2230
2234
  iconType: "leading",
2231
- onClick: () => B.current?.openTransferModal(),
2235
+ onClick: () => U.current?.openTransferModal(),
2232
2236
  variant: "base-secondary",
2233
2237
  children: "轉派"
2234
2238
  }, "task-transfer") : null,
2235
- Tt ? /* @__PURE__ */ T(y, {
2239
+ Et ? /* @__PURE__ */ E(y, {
2236
2240
  disabled: $,
2237
- icon: He,
2241
+ icon: Ve,
2238
2242
  iconType: "leading",
2239
- onClick: () => B.current?.openRejectModal(),
2243
+ onClick: () => U.current?.openRejectModal(),
2240
2244
  variant: "destructive-secondary",
2241
2245
  children: "拒絕"
2242
2246
  }, "task-reject") : null,
2243
- /* @__PURE__ */ T(y, {
2247
+ /* @__PURE__ */ E(y, {
2244
2248
  disabled: $,
2245
- icon: ze,
2249
+ icon: Re,
2246
2250
  iconType: "leading",
2247
- onClick: Ht,
2251
+ onClick: Wt,
2248
2252
  variant: "base-primary",
2249
2253
  children: "同意"
2250
2254
  }, "task-approve")
2251
2255
  ] }) : null
2252
2256
  ]
2253
2257
  }) }),
2254
- /* @__PURE__ */ E(me, { children: [
2255
- ne ? /* @__PURE__ */ T(pe, { children: /* @__PURE__ */ T(fn, {
2256
- canResubmitInstance: At,
2257
- deciding: et,
2258
- error: Xe,
2259
- fieldAccess: Rt,
2260
- fieldLabelMarkers: zt,
2261
- fill: X && Z && q ? {
2258
+ /* @__PURE__ */ D(me, { children: [
2259
+ ne ? /* @__PURE__ */ E(pe, { children: /* @__PURE__ */ E(fn, {
2260
+ canResubmitInstance: jt,
2261
+ deciding: Qe,
2262
+ error: Ye,
2263
+ fieldAccess: zt,
2264
+ fieldLabelMarkers: Bt,
2265
+ fill: Z && Q && J ? {
2262
2266
  errors: Pt,
2263
- fieldCount: Ze(q).size,
2264
- onChange: Vt,
2265
- schema: X,
2266
- value: Z
2267
+ fieldCount: M(J).size,
2268
+ onChange: Ut,
2269
+ schema: Z,
2270
+ value: Q
2267
2271
  } : null,
2268
2272
  instance: C,
2269
- loading: Qe,
2273
+ loading: Xe,
2270
2274
  onDataSourceStateChange: St,
2271
- onReloadAfterConflict: Ft ? () => void Wt() : null,
2275
+ onReloadAfterConflict: It ? () => void Kt() : null,
2272
2276
  onResubmitFormChange: (e) => {
2273
- dt(e), lt({});
2277
+ ut(e), ct({});
2274
2278
  },
2275
- onResubmitInstance: () => void on(),
2276
- onUploadAttachment: tn,
2277
- resubmitFormData: ut,
2278
- resubmitFormErrors: I
2279
+ onResubmitInstance: () => void dn(),
2280
+ onUploadAttachment: rn,
2281
+ resubmitFormData: lt,
2282
+ resubmitFormErrors: st
2279
2283
  }) }) : null,
2280
- a ? /* @__PURE__ */ T(pe, { children: /* @__PURE__ */ T(mn, {
2281
- attachments: be,
2284
+ a ? /* @__PURE__ */ E(pe, { children: /* @__PURE__ */ E(mn, {
2285
+ attachments: ye,
2282
2286
  onDownload: (e) => {
2283
- nn(e);
2287
+ an(e);
2284
2288
  },
2285
2289
  onPreview: (e) => {
2286
- rn(e);
2290
+ on(e);
2287
2291
  }
2288
2292
  }) }) : null,
2289
- ae ? /* @__PURE__ */ T(pe, { children: /* @__PURE__ */ T(Tn, {
2290
- adhocDirectives: vt,
2293
+ ae ? /* @__PURE__ */ E(pe, { children: /* @__PURE__ */ E(Tn, {
2294
+ adhocDirectives: V,
2291
2295
  currentMemberId: b,
2292
- fill: Bt,
2296
+ fill: Ht,
2293
2297
  instance: C,
2294
- memberProfilesById: Q,
2295
- onChanged: Zt,
2296
- onFillApproveError: Ut,
2297
- ref: B,
2298
- tasks: O
2298
+ memberProfilesById: Vt,
2299
+ onChanged: $t,
2300
+ onDecidingChange: I,
2301
+ onFillApproveError: Gt,
2302
+ ref: U,
2303
+ tasks: k
2299
2304
  }) }) : null,
2300
- h ? /* @__PURE__ */ T(pe, { children: /* @__PURE__ */ T(kn, {
2301
- signatureVerification: Ne,
2302
- signatures: Ce
2305
+ re ? /* @__PURE__ */ E(pe, { children: /* @__PURE__ */ E(kn, {
2306
+ signatureVerification: Me,
2307
+ signatures: Se
2303
2308
  }) }) : null,
2304
- le && D.length > 0 ? /* @__PURE__ */ T(pe, { children: /* @__PURE__ */ T(Hn, {
2305
- deliveries: D,
2306
- onRetry: $t,
2307
- readNodeLabel: (e) => Et(e, C?.workflowSnapshot ?? null)
2309
+ le && O.length > 0 ? /* @__PURE__ */ E(pe, { children: /* @__PURE__ */ E(Hn, {
2310
+ deliveries: O,
2311
+ onRetry: tn,
2312
+ readNodeLabel: (e) => Tt(e, C?.workflowSnapshot ?? null)
2308
2313
  }) }) : null,
2309
- re ? /* @__PURE__ */ T(pe, { children: /* @__PURE__ */ T(Rn, {
2314
+ h ? /* @__PURE__ */ E(pe, { children: /* @__PURE__ */ E(Rn, {
2310
2315
  activityLogs: x,
2311
- formSchema: Y,
2316
+ formSchema: X,
2312
2317
  instanceState: C?.state ?? "RUNNING",
2313
- memberProfilesById: Q,
2314
- signatureVerification: Ne,
2315
- signaturesById: Kt,
2316
- taskDecisionsByTaskId: Gt,
2317
- tasks: O,
2318
+ memberProfilesById: Vt,
2319
+ signatureVerification: Me,
2320
+ signaturesById: Jt,
2321
+ taskDecisionsByTaskId: qt,
2322
+ tasks: k,
2318
2323
  workflowSnapshot: C?.workflowSnapshot ?? null,
2319
- workflowTokens: Ve
2324
+ workflowTokens: Be
2320
2325
  }) }) : null
2321
2326
  ] }),
2322
- C ? /* @__PURE__ */ T(S, {
2327
+ C ? /* @__PURE__ */ E(S, {
2323
2328
  modalType: "standard",
2324
- onClose: () => N(!1),
2325
- open: at,
2329
+ onClose: () => it(!1),
2330
+ open: L,
2326
2331
  showModalHeader: !0,
2327
2332
  size: "wide",
2328
2333
  supportingText: `${Ct(C.state)} · ${t(C.startedAt)}`,
2329
2334
  title: "流程圖",
2330
- children: /* @__PURE__ */ E("div", {
2335
+ children: /* @__PURE__ */ D("div", {
2331
2336
  style: Qn,
2332
- children: [/* @__PURE__ */ T("div", {
2337
+ children: [/* @__PURE__ */ E("div", {
2333
2338
  style: $n,
2334
- children: /* @__PURE__ */ E(ot, {
2335
- edges: Yt,
2339
+ children: /* @__PURE__ */ D(rt, {
2340
+ edges: Zt,
2336
2341
  fitView: !0,
2337
2342
  fitViewOptions: { padding: .18 },
2338
2343
  maxZoom: 1.2,
2339
2344
  minZoom: .2,
2340
- nodes: Jt,
2345
+ nodes: Xt,
2341
2346
  nodesDraggable: !1,
2342
2347
  nodesFocusable: !1,
2343
2348
  nodeTypes: sr,
2344
2349
  panOnDrag: !0,
2345
2350
  proOptions: { hideAttribution: !0 },
2346
- children: [/* @__PURE__ */ T(M, {}), /* @__PURE__ */ T(it, { showInteractive: !1 })]
2351
+ children: [/* @__PURE__ */ E(nt, {}), /* @__PURE__ */ E(P, { showInteractive: !1 })]
2347
2352
  })
2348
- }), Xt.length > 0 ? /* @__PURE__ */ T("div", {
2353
+ }), Qt.length > 0 ? /* @__PURE__ */ E("div", {
2349
2354
  style: ir,
2350
- children: Xt.map((e) => /* @__PURE__ */ T("span", {
2355
+ children: Qt.map((e) => /* @__PURE__ */ E("span", {
2351
2356
  style: ar,
2352
2357
  children: e
2353
2358
  }, e))
2354
2359
  }) : null]
2355
2360
  })
2356
2361
  }) : null,
2357
- /* @__PURE__ */ T(S, {
2362
+ /* @__PURE__ */ E(S, {
2358
2363
  modalType: "standard",
2359
2364
  onClose: () => {
2360
- mt(null), gt(null);
2365
+ mt(null), _t(null);
2361
2366
  },
2362
- open: !!(L && R),
2367
+ open: !!(B && gt),
2363
2368
  showModalHeader: !0,
2364
2369
  size: "wide",
2365
- supportingText: L?.filename ?? void 0,
2370
+ supportingText: B?.filename ?? void 0,
2366
2371
  title: "PDF 預覽",
2367
- children: R ? /* @__PURE__ */ T(ht, {
2368
- filename: L?.filename ?? "PDF 預覽",
2369
- fileUrl: R,
2370
- onDownload: L ? () => void nn(L) : void 0
2372
+ children: gt ? /* @__PURE__ */ E(pt, {
2373
+ filename: B?.filename ?? "PDF 預覽",
2374
+ fileUrl: gt,
2375
+ onDownload: B ? () => void an(B) : void 0
2371
2376
  }) : null
2372
2377
  }),
2373
- /* @__PURE__ */ T(S, {
2378
+ /* @__PURE__ */ E(S, {
2374
2379
  cancelText: "保留案件",
2375
2380
  confirmButtonProps: { variant: "destructive-primary" },
2376
2381
  confirmText: "確認取消",
2377
- loading: et,
2382
+ loading: Qe,
2378
2383
  modalStatusType: "error",
2379
2384
  modalType: "standard",
2380
- onCancel: () => F(!1),
2381
- onClose: () => F(!1),
2382
- onConfirm: () => void an(),
2383
- open: ct,
2385
+ onCancel: () => ot(!1),
2386
+ onClose: () => ot(!1),
2387
+ onConfirm: () => void cn(),
2388
+ open: z,
2384
2389
  showModalFooter: !0,
2385
2390
  showModalHeader: !0,
2386
2391
  supportingText: "取消後會關閉目前待簽任務與候選簽核人。",
2387
2392
  title: "取消案件",
2388
- children: /* @__PURE__ */ E("div", {
2393
+ children: /* @__PURE__ */ D("div", {
2389
2394
  style: or,
2390
- children: [/* @__PURE__ */ E(w, {
2395
+ children: [/* @__PURE__ */ D(w, {
2391
2396
  variant: "body",
2392
2397
  children: [
2393
2398
  "確定要取消「",
2394
2399
  C?.title ?? "",
2395
2400
  "」嗎?"
2396
2401
  ]
2397
- }), /* @__PURE__ */ T(n, {
2402
+ }), /* @__PURE__ */ E(n, {
2398
2403
  label: "取消原因",
2399
2404
  name: "cancelComment",
2400
- children: /* @__PURE__ */ T(_e, {
2401
- onChange: (e) => st(e.target.value),
2405
+ children: /* @__PURE__ */ E(_e, {
2406
+ onChange: (e) => R(e.target.value),
2402
2407
  placeholder: "可填寫取消原因",
2403
2408
  resize: "vertical",
2404
2409
  rows: 3,
2405
- value: P
2410
+ value: at
2406
2411
  })
2407
2412
  })]
2408
2413
  })
@@ -2431,14 +2436,14 @@ function fr(e, t, n, r) {
2431
2436
  },
2432
2437
  id: e.id,
2433
2438
  position: e.position,
2434
- sourcePosition: N.Right,
2435
- targetPosition: N.Left,
2439
+ sourcePosition: I.Right,
2440
+ targetPosition: I.Left,
2436
2441
  type: "workflowRuntime"
2437
2442
  };
2438
2443
  });
2439
2444
  }
2440
2445
  function pr(e) {
2441
- let t = new P.graphlib.Graph();
2446
+ let t = new L.graphlib.Graph();
2442
2447
  return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
2443
2448
  nodesep: 56,
2444
2449
  rankdir: "LR",
@@ -2450,7 +2455,7 @@ function pr(e) {
2450
2455
  });
2451
2456
  }), e.edges.forEach((e) => {
2452
2457
  t.setEdge(e.source, e.target);
2453
- }), P.layout(t), {
2458
+ }), L.layout(t), {
2454
2459
  ...e,
2455
2460
  nodes: e.nodes.map((e) => {
2456
2461
  let n = t.node(e.id);
@@ -2536,34 +2541,34 @@ function gr(e) {
2536
2541
  };
2537
2542
  }
2538
2543
  function _r({ data: e }) {
2539
- return /* @__PURE__ */ E("div", {
2544
+ return /* @__PURE__ */ D("div", {
2540
2545
  style: hr(e.tone),
2541
2546
  children: [
2542
- /* @__PURE__ */ T(at, {
2547
+ /* @__PURE__ */ E(F, {
2543
2548
  isConnectable: !1,
2544
- position: N.Left,
2549
+ position: I.Left,
2545
2550
  style: rr,
2546
2551
  type: "target"
2547
2552
  }),
2548
- /* @__PURE__ */ T(w, {
2553
+ /* @__PURE__ */ E(w, {
2549
2554
  component: "span",
2550
2555
  ellipsis: !0,
2551
2556
  title: e.label,
2552
2557
  variant: "label-primary",
2553
2558
  children: e.label
2554
2559
  }),
2555
- /* @__PURE__ */ T("span", {
2560
+ /* @__PURE__ */ E("span", {
2556
2561
  style: gr(e.tone),
2557
2562
  children: e.statusLabel
2558
2563
  }),
2559
- /* @__PURE__ */ T("span", {
2564
+ /* @__PURE__ */ E("span", {
2560
2565
  title: e.secondaryLabel,
2561
2566
  style: nr,
2562
2567
  children: e.secondaryLabel || e.kindLabel
2563
2568
  }),
2564
- /* @__PURE__ */ T(at, {
2569
+ /* @__PURE__ */ E(F, {
2565
2570
  isConnectable: !1,
2566
- position: N.Right,
2571
+ position: I.Right,
2567
2572
  style: rr,
2568
2573
  type: "source"
2569
2574
  })
@@ -2573,4 +2578,4 @@ function _r({ data: e }) {
2573
2578
  //#endregion
2574
2579
  export { Tn as a, kn as i, Hn as n, mn as o, Rn as r, fn as s, cr as t };
2575
2580
 
2576
- //# sourceMappingURL=detail-URwxkcro.js.map
2581
+ //# sourceMappingURL=detail-D6X61pkg.js.map