@rytass/bpm-core-react 0.20.1 → 0.21.1

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