@rytass/bpm-core-react 0.18.0 → 0.19.0

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