@rytass/bpm-core-react 0.14.0 → 0.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/dist/chunks/{FormBuilderView-BYLN6W-P.js → FormBuilderView-BYL42M0d.js} +499 -476
  3. package/dist/chunks/FormBuilderView-BYL42M0d.js.map +1 -0
  4. package/dist/chunks/FormBuilderView-aBcA-_tt.cjs +3 -0
  5. package/dist/chunks/FormBuilderView-aBcA-_tt.cjs.map +1 -0
  6. package/dist/chunks/FormRendererView-DRFi_IH7.cjs +4 -0
  7. package/dist/chunks/FormRendererView-DRFi_IH7.cjs.map +1 -0
  8. package/dist/chunks/FormRendererView-cZGOOjU5.js +986 -0
  9. package/dist/chunks/FormRendererView-cZGOOjU5.js.map +1 -0
  10. package/dist/chunks/{admin-pickers-DLlG_1du.js → admin-pickers-DxhzECkD.js} +52 -51
  11. package/dist/chunks/admin-pickers-DxhzECkD.js.map +1 -0
  12. package/dist/chunks/admin-pickers-qe3j--gX.cjs +2 -0
  13. package/dist/chunks/admin-pickers-qe3j--gX.cjs.map +1 -0
  14. package/dist/chunks/approval-instance-list-page-CPXMP3PL.js.map +1 -1
  15. package/dist/chunks/approval-instance-list-page-ax0pm8bt.cjs.map +1 -1
  16. package/dist/chunks/auth-provider-4BeCw7cI.cjs.map +1 -1
  17. package/dist/chunks/auth-provider-B5oPmvk2.js.map +1 -1
  18. package/dist/chunks/bpm-form-field-Bc6k4ZEO.cjs.map +1 -1
  19. package/dist/chunks/bpm-form-field-Cao0rMol.js.map +1 -1
  20. package/dist/chunks/{categories-DGlxuC6X.js → categories-1gKxeEqw.js} +4 -10
  21. package/dist/chunks/categories-1gKxeEqw.js.map +1 -0
  22. package/dist/chunks/{categories-Yid05WAX.cjs → categories-DjENouRm.cjs} +2 -2
  23. package/dist/chunks/categories-DjENouRm.cjs.map +1 -0
  24. package/dist/chunks/{compose-CSWbRgJJ.js → compose-DO6n0NJi.js} +5 -5
  25. package/dist/chunks/compose-DO6n0NJi.js.map +1 -0
  26. package/dist/chunks/compose-DUH9cQ-L.cjs +2 -0
  27. package/dist/chunks/compose-DUH9cQ-L.cjs.map +1 -0
  28. package/dist/chunks/dashboard-page-BWQBSGDq.cjs +2 -0
  29. package/dist/chunks/dashboard-page-BWQBSGDq.cjs.map +1 -0
  30. package/dist/chunks/{dashboard-page-CeCLV1tp.js → dashboard-page-DdBvV6YI.js} +15 -16
  31. package/dist/chunks/dashboard-page-DdBvV6YI.js.map +1 -0
  32. package/dist/chunks/delegations-BLzYnOae.cjs +2 -0
  33. package/dist/chunks/delegations-BLzYnOae.cjs.map +1 -0
  34. package/dist/chunks/delegations-Ckf03icM.cjs +2 -0
  35. package/dist/chunks/delegations-Ckf03icM.cjs.map +1 -0
  36. package/dist/chunks/{delegations-DRupxJ4_.js → delegations-MxF3uJGW.js} +205 -215
  37. package/dist/chunks/delegations-MxF3uJGW.js.map +1 -0
  38. package/dist/chunks/{delegations-B8gLSt0i.js → delegations-_b4_xBit.js} +167 -173
  39. package/dist/chunks/delegations-_b4_xBit.js.map +1 -0
  40. package/dist/chunks/designer-2YvjP_GU.cjs +65 -0
  41. package/dist/chunks/designer-2YvjP_GU.cjs.map +1 -0
  42. package/dist/chunks/{designer-BtsIL0BB.js → designer-B-cfiob9.js} +1334 -1254
  43. package/dist/chunks/designer-B-cfiob9.js.map +1 -0
  44. package/dist/chunks/{detail-C8NOqY0p.js → detail-C6NdVijG.js} +852 -841
  45. package/dist/chunks/detail-C6NdVijG.js.map +1 -0
  46. package/dist/chunks/detail-DKobK4Cg.cjs +2 -0
  47. package/dist/chunks/detail-DKobK4Cg.cjs.map +1 -0
  48. package/dist/chunks/format-date-time-CB-LxzqT.js.map +1 -1
  49. package/dist/chunks/format-date-time-D-cx5M8z.cjs.map +1 -1
  50. package/dist/chunks/format-member-label-DudVI55w.js +13 -0
  51. package/dist/chunks/format-member-label-DudVI55w.js.map +1 -0
  52. package/dist/chunks/format-member-label-t7ANTF62.cjs +2 -0
  53. package/dist/chunks/format-member-label-t7ANTF62.cjs.map +1 -0
  54. package/dist/chunks/login-AtVxZBsC.cjs.map +1 -1
  55. package/dist/chunks/login-C6qlTC6F.js.map +1 -1
  56. package/dist/chunks/notifications-Bc4mgSds.cjs.map +1 -1
  57. package/dist/chunks/notifications-DJ5wzCye.js.map +1 -1
  58. package/dist/chunks/{orgs-BpqVu5ka.js → orgs-Bpp1U60k.js} +538 -557
  59. package/dist/chunks/orgs-Bpp1U60k.js.map +1 -0
  60. package/dist/chunks/orgs-ywaE1_02.cjs +2 -0
  61. package/dist/chunks/orgs-ywaE1_02.cjs.map +1 -0
  62. package/dist/chunks/providers-DHtDZFNA.cjs.map +1 -1
  63. package/dist/chunks/providers-J5eyByQj.js.map +1 -1
  64. package/dist/chunks/router-adapter--gYs13E8.cjs.map +1 -1
  65. package/dist/chunks/router-adapter-DftlFTOd.js.map +1 -1
  66. package/dist/chunks/routes-config-C1j_vFKo.cjs.map +1 -1
  67. package/dist/chunks/routes-config-yZbESPlw.js.map +1 -1
  68. package/dist/chunks/task-node-label-BF6UllxP.cjs +2 -0
  69. package/dist/chunks/task-node-label-BF6UllxP.cjs.map +1 -0
  70. package/dist/chunks/task-node-label-CWZgOBj0.js +9 -0
  71. package/dist/chunks/task-node-label-CWZgOBj0.js.map +1 -0
  72. package/dist/chunks/use-bpm-member-D57LKe_u.js.map +1 -1
  73. package/dist/chunks/use-bpm-member-DpNAQtNC.cjs.map +1 -1
  74. package/dist/chunks/users-BSVo_eNe.js +215 -0
  75. package/dist/chunks/users-BSVo_eNe.js.map +1 -0
  76. package/dist/chunks/users-DFSBTDMy.cjs +2 -0
  77. package/dist/chunks/users-DFSBTDMy.cjs.map +1 -0
  78. package/dist/index.cjs +1 -1
  79. package/dist/index.cjs.map +1 -1
  80. package/dist/index.js +2 -2
  81. package/dist/index.js.map +1 -1
  82. package/dist/lib/format-member-label.d.ts +12 -0
  83. package/dist/lib/member-profile-resolution.d.ts +48 -0
  84. package/dist/lib/routes-config.d.ts +1 -1
  85. package/dist/lib/task-node-label.d.ts +10 -0
  86. package/dist/next/index.cjs.map +1 -1
  87. package/dist/next/index.js.map +1 -1
  88. package/dist/next/workflow-chat-route.cjs.map +1 -1
  89. package/dist/next/workflow-chat-route.js.map +1 -1
  90. package/dist/pages/admin/delegations/index.cjs +1 -1
  91. package/dist/pages/admin/delegations/index.cjs.map +1 -1
  92. package/dist/pages/admin/delegations/index.js +1 -1
  93. package/dist/pages/admin/delegations/index.js.map +1 -1
  94. package/dist/pages/admin/orgs/index.cjs +1 -1
  95. package/dist/pages/admin/orgs/index.cjs.map +1 -1
  96. package/dist/pages/admin/orgs/index.js +1 -1
  97. package/dist/pages/admin/orgs/index.js.map +1 -1
  98. package/dist/pages/admin/users/index.cjs +1 -1
  99. package/dist/pages/admin/users/index.cjs.map +1 -1
  100. package/dist/pages/admin/users/index.js +1 -1
  101. package/dist/pages/admin/users/index.js.map +1 -1
  102. package/dist/pages/admin/webhook-endpoints/index.cjs.map +1 -1
  103. package/dist/pages/admin/webhook-endpoints/index.js.map +1 -1
  104. package/dist/pages/cc/index.cjs.map +1 -1
  105. package/dist/pages/cc/index.js.map +1 -1
  106. package/dist/pages/dashboard/index.cjs.map +1 -1
  107. package/dist/pages/dashboard/index.js.map +1 -1
  108. package/dist/pages/delegations/index.cjs +1 -1
  109. package/dist/pages/delegations/index.cjs.map +1 -1
  110. package/dist/pages/delegations/index.js +1 -1
  111. package/dist/pages/delegations/index.js.map +1 -1
  112. package/dist/pages/inbox/index.cjs.map +1 -1
  113. package/dist/pages/inbox/index.js.map +1 -1
  114. package/dist/pages/instances/detail/index.cjs +1 -1
  115. package/dist/pages/instances/detail/index.cjs.map +1 -1
  116. package/dist/pages/instances/detail/index.js +1 -1
  117. package/dist/pages/instances/detail/index.js.map +1 -1
  118. package/dist/pages/instances/new/index.cjs.map +1 -1
  119. package/dist/pages/instances/new/index.js.map +1 -1
  120. package/dist/pages/login/index.cjs.map +1 -1
  121. package/dist/pages/login/index.js.map +1 -1
  122. package/dist/pages/root/index.cjs.map +1 -1
  123. package/dist/pages/root/index.js.map +1 -1
  124. package/dist/pages/search/index.cjs.map +1 -1
  125. package/dist/pages/search/index.js.map +1 -1
  126. package/dist/pages/sent/index.cjs.map +1 -1
  127. package/dist/pages/sent/index.js.map +1 -1
  128. package/dist/pages/settings/notifications/index.cjs.map +1 -1
  129. package/dist/pages/settings/notifications/index.js.map +1 -1
  130. package/dist/pages/templates/categories/index.cjs +1 -1
  131. package/dist/pages/templates/categories/index.cjs.map +1 -1
  132. package/dist/pages/templates/categories/index.js +1 -1
  133. package/dist/pages/templates/categories/index.js.map +1 -1
  134. package/dist/pages/templates/compose/index.cjs +1 -1
  135. package/dist/pages/templates/compose/index.cjs.map +1 -1
  136. package/dist/pages/templates/compose/index.js +1 -1
  137. package/dist/pages/templates/compose/index.js.map +1 -1
  138. package/dist/pages/templates/designer/index.cjs +1 -1
  139. package/dist/pages/templates/designer/index.cjs.map +1 -1
  140. package/dist/pages/templates/designer/index.js +1 -1
  141. package/dist/pages/templates/designer/index.js.map +1 -1
  142. package/dist/pages/templates/index.cjs.map +1 -1
  143. package/dist/pages/templates/index.js.map +1 -1
  144. package/dist/pages/templates/versions/index.cjs.map +1 -1
  145. package/dist/pages/templates/versions/index.js.map +1 -1
  146. package/dist/views/admin/delegations/index.cjs +1 -1
  147. package/dist/views/admin/delegations/index.js +1 -2
  148. package/dist/views/admin/index.cjs +1 -1
  149. package/dist/views/admin/index.js +3 -3
  150. package/dist/views/admin/orgs/index.cjs +1 -1
  151. package/dist/views/admin/orgs/index.js +1 -2
  152. package/dist/views/admin/users/index.cjs +1 -1
  153. package/dist/views/admin/users/index.js +1 -2
  154. package/dist/views/admin/webhook-endpoints/index.cjs.map +1 -1
  155. package/dist/views/admin/webhook-endpoints/index.js.map +1 -1
  156. package/dist/views/cc/index.cjs.map +1 -1
  157. package/dist/views/cc/index.js.map +1 -1
  158. package/dist/views/dashboard/index.cjs +1 -1
  159. package/dist/views/dashboard/index.cjs.map +1 -1
  160. package/dist/views/dashboard/index.js +1 -1
  161. package/dist/views/dashboard/index.js.map +1 -1
  162. package/dist/views/delegations/index.cjs +1 -1
  163. package/dist/views/delegations/index.js +1 -2
  164. package/dist/views/forms/builder/index.cjs +1 -1
  165. package/dist/views/forms/builder/index.js +1 -2
  166. package/dist/views/forms/renderer/form-field-link.d.ts +16 -0
  167. package/dist/views/forms/renderer/index.cjs +1 -1
  168. package/dist/views/forms/renderer/index.js +1 -2
  169. package/dist/views/forms/renderer/member-field-options.d.ts +39 -0
  170. package/dist/views/forms/renderer/member-field.d.ts +21 -0
  171. package/dist/views/inbox/index.cjs +1 -1
  172. package/dist/views/inbox/index.cjs.map +1 -1
  173. package/dist/views/inbox/index.js +101 -102
  174. package/dist/views/inbox/index.js.map +1 -1
  175. package/dist/views/instances/detail/index.cjs +1 -1
  176. package/dist/views/instances/detail/index.js +1 -2
  177. package/dist/views/instances/detail/sections/container-helpers.d.ts +3 -2
  178. package/dist/views/instances/detail/submitted-by.d.ts +23 -0
  179. package/dist/views/instances/index.js +1 -2
  180. package/dist/views/instances/new/index.cjs +1 -1
  181. package/dist/views/instances/new/index.cjs.map +1 -1
  182. package/dist/views/instances/new/index.js +4 -11
  183. package/dist/views/instances/new/index.js.map +1 -1
  184. package/dist/views/login/index.js +1 -2
  185. package/dist/views/search/index.cjs.map +1 -1
  186. package/dist/views/search/index.js.map +1 -1
  187. package/dist/views/sent/SentView.d.ts +1 -1
  188. package/dist/views/sent/index.cjs +1 -1
  189. package/dist/views/sent/index.cjs.map +1 -1
  190. package/dist/views/sent/index.js +2 -2
  191. package/dist/views/sent/index.js.map +1 -1
  192. package/dist/views/settings/index.js +1 -2
  193. package/dist/views/settings/notifications/index.js +1 -2
  194. package/dist/views/templates/categories/index.cjs +1 -1
  195. package/dist/views/templates/categories/index.js +1 -2
  196. package/dist/views/templates/compose/index.cjs +1 -1
  197. package/dist/views/templates/compose/index.js +1 -2
  198. package/dist/views/templates/designer/designer-version-labels.d.ts +12 -0
  199. package/dist/views/templates/designer/dry-run-assignee-label.d.ts +28 -0
  200. package/dist/views/templates/designer/dry-run-sample-data.d.ts +9 -0
  201. package/dist/views/templates/designer/dynamic-form-resolver-options.d.ts +35 -0
  202. package/dist/views/templates/designer/index.cjs +1 -1
  203. package/dist/views/templates/designer/index.js +1 -2
  204. package/dist/views/templates/index.cjs +1 -1
  205. package/dist/views/templates/index.cjs.map +1 -1
  206. package/dist/views/templates/index.js +1 -1
  207. package/dist/views/templates/index.js.map +1 -1
  208. package/dist/views/templates/versions/index.cjs.map +1 -1
  209. package/dist/views/templates/versions/index.js.map +1 -1
  210. package/package.json +5 -5
  211. package/dist/chunks/FormBuilderView-BYLN6W-P.js.map +0 -1
  212. package/dist/chunks/FormBuilderView-VmdPVbg7.cjs +0 -3
  213. package/dist/chunks/FormBuilderView-VmdPVbg7.cjs.map +0 -1
  214. package/dist/chunks/FormRendererView-Bs8lTb4k.cjs +0 -2
  215. package/dist/chunks/FormRendererView-Bs8lTb4k.cjs.map +0 -1
  216. package/dist/chunks/FormRendererView-UPowZZgw.js +0 -798
  217. package/dist/chunks/FormRendererView-UPowZZgw.js.map +0 -1
  218. package/dist/chunks/admin-pickers-Btvij1at.cjs +0 -2
  219. package/dist/chunks/admin-pickers-Btvij1at.cjs.map +0 -1
  220. package/dist/chunks/admin-pickers-DLlG_1du.js.map +0 -1
  221. package/dist/chunks/categories-DGlxuC6X.js.map +0 -1
  222. package/dist/chunks/categories-Yid05WAX.cjs.map +0 -1
  223. package/dist/chunks/compose-CHZoX-H0.cjs +0 -2
  224. package/dist/chunks/compose-CHZoX-H0.cjs.map +0 -1
  225. package/dist/chunks/compose-CSWbRgJJ.js.map +0 -1
  226. package/dist/chunks/dashboard-page-CeCLV1tp.js.map +0 -1
  227. package/dist/chunks/dashboard-page-DooFJsxM.cjs +0 -2
  228. package/dist/chunks/dashboard-page-DooFJsxM.cjs.map +0 -1
  229. package/dist/chunks/delegations-8LsxcQM4.cjs +0 -2
  230. package/dist/chunks/delegations-8LsxcQM4.cjs.map +0 -1
  231. package/dist/chunks/delegations-B8gLSt0i.js.map +0 -1
  232. package/dist/chunks/delegations-DRupxJ4_.js.map +0 -1
  233. package/dist/chunks/delegations-DlYwMiAW.cjs +0 -2
  234. package/dist/chunks/delegations-DlYwMiAW.cjs.map +0 -1
  235. package/dist/chunks/designer-BtsIL0BB.js.map +0 -1
  236. package/dist/chunks/designer-Dm6cX2kZ.cjs +0 -65
  237. package/dist/chunks/designer-Dm6cX2kZ.cjs.map +0 -1
  238. package/dist/chunks/detail-C8NOqY0p.js.map +0 -1
  239. package/dist/chunks/detail-CX-3hZoL.cjs +0 -2
  240. package/dist/chunks/detail-CX-3hZoL.cjs.map +0 -1
  241. package/dist/chunks/orgs-BpqVu5ka.js.map +0 -1
  242. package/dist/chunks/orgs-D0-5BaHT.cjs +0 -2
  243. package/dist/chunks/orgs-D0-5BaHT.cjs.map +0 -1
  244. package/dist/chunks/users-C9LA-Rd7.cjs +0 -2
  245. package/dist/chunks/users-C9LA-Rd7.cjs.map +0 -1
  246. package/dist/chunks/users-FWrb3ehW.js +0 -214
  247. package/dist/chunks/users-FWrb3ehW.js.map +0 -1
@@ -1,23 +1,24 @@
1
1
  "use client";
2
2
  import { t as e } from "./bpm-form-field-Cao0rMol.js";
3
- import { a as t, i as n, n as r, o as i, r as a, t as o } from "./admin-pickers-DLlG_1du.js";
3
+ import { t } from "./format-member-label-DudVI55w.js";
4
+ import { a as n, i as r, n as i, o as a, r as o, t as s } from "./admin-pickers-DxhzECkD.js";
4
5
  import '../style.css';import '../orgs.css';/* empty css */
5
- import { forwardRef as s, useCallback as c, useEffect as l, useImperativeHandle as u, useMemo as d, useRef as f, useState as p } from "react";
6
- import { AutoComplete as m, Button as h, DatePicker as g, Filter as _, FilterArea as v, FilterLine as y, FormField as b, Input as x, Modal as S, PageHeader as C, Section as w, SectionGroup as T, Select as E, Tab as D, TabItem as O, Table as k, Typography as A } from "@mezzanine-ui/react";
7
- import { resolveMembers as j } from "@rytass/bpm-core-client";
8
- import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
9
- import { FormFieldLayout as F } from "@mezzanine-ui/core/form";
10
- import I from "@mezzanine-ui/react/ContentHeader";
11
- import { CloseIcon as L, EditIcon as R, PlusIcon as z, SaveIcon as B } from "@mezzanine-ui/icons";
12
- import { commitOrgUnitTreeDraft as ee, createManagerResolution as V, createMembership as te, createOrgUnit as ne, createPosition as re, deleteManagerResolution as ie, deleteMembership as ae, deleteOrgUnit as oe, deletePosition as se, readOrganizationDashboard as ce, updateManagerResolution as le, updateMembership as ue, updateOrgUnit as de, updatePosition as fe } from "@rytass/bpm-core-client/organization";
13
- import { Background as pe, ConnectionMode as me, Controls as he, Handle as ge, MiniMap as _e, Panel as ve, Position as H, ReactFlow as ye, applyNodeChanges as be } from "@xyflow/react";
14
- import * as xe from "dagre";
6
+ import { forwardRef as c, useCallback as l, useEffect as u, useImperativeHandle as d, useMemo as f, useRef as p, useState as m } from "react";
7
+ import { AutoComplete as h, Button as g, DatePicker as _, Filter as v, FilterArea as y, FilterLine as b, FormField as x, Input as S, Modal as C, PageHeader as w, Section as T, SectionGroup as E, Select as D, Tab as O, TabItem as k, Table as A, Typography as j } from "@mezzanine-ui/react";
8
+ import { resolveMembers as M } from "@rytass/bpm-core-client";
9
+ import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
10
+ import { FormFieldLayout as I } from "@mezzanine-ui/core/form";
11
+ import L from "@mezzanine-ui/react/ContentHeader";
12
+ import { CloseIcon as R, EditIcon as z, PlusIcon as B, SaveIcon as ee } from "@mezzanine-ui/icons";
13
+ import { commitOrgUnitTreeDraft as V, createManagerResolution as te, createMembership as ne, createOrgUnit as re, createPosition as ie, deleteManagerResolution as ae, deleteMembership as oe, deleteOrgUnit as se, deletePosition as ce, readOrganizationDashboard as le, updateManagerResolution as ue, updateMembership as de, updateOrgUnit as fe, updatePosition as pe } from "@rytass/bpm-core-client/organization";
14
+ import { Background as me, ConnectionMode as he, Controls as ge, Handle as _e, MiniMap as ve, Panel as ye, Position as H, ReactFlow as be, applyNodeChanges as xe } from "@xyflow/react";
15
+ import * as Se from "dagre";
15
16
  //#region src/lib/org-tree-draft.ts
16
- function Se(e) {
17
+ function Ce(e) {
17
18
  return new Map(e.map((e) => [e.id, e.parentId]));
18
19
  }
19
- function Ce({ orgUnitId: e, parentDraft: t, parentId: n }) {
20
- let r = n === e ? e : n, i = Te({
20
+ function we({ orgUnitId: e, parentDraft: t, parentId: n }) {
21
+ let r = n === e ? e : n, i = U({
21
22
  orgUnitId: e,
22
23
  parentDraft: t,
23
24
  parentId: r
@@ -39,7 +40,7 @@ function Ce({ orgUnitId: e, parentDraft: t, parentId: n }) {
39
40
  status: "UPDATED"
40
41
  };
41
42
  }
42
- function we({ orgUnits: e, parentDraft: t }) {
43
+ function Te({ orgUnits: e, parentDraft: t }) {
43
44
  return e.map((e) => {
44
45
  let n = t.get(e.id) ?? null;
45
46
  return n === e.parentId ? null : {
@@ -49,14 +50,14 @@ function we({ orgUnits: e, parentDraft: t }) {
49
50
  };
50
51
  }).filter((e) => !!e);
51
52
  }
52
- function Te({ orgUnitId: e, parentDraft: t, parentId: n }) {
53
- return t.has(e) ? n ? t.has(n) ? n === e ? "組織不可成為自己的上層。" : U({
53
+ function U({ orgUnitId: e, parentDraft: t, parentId: n }) {
54
+ return t.has(e) ? n ? t.has(n) ? n === e ? "組織不可成為自己的上層。" : Ee({
54
55
  orgUnitId: e,
55
56
  parentDraft: t,
56
57
  parentId: n
57
58
  }) ? "不可搬移到自己的下層組織。" : null : "找不到新的上層組織。" : null : "找不到要搬移的組織節點。";
58
59
  }
59
- function U({ orgUnitId: e, parentDraft: t, parentId: n }) {
60
+ function Ee({ orgUnitId: e, parentDraft: t, parentId: n }) {
60
61
  let r = /* @__PURE__ */ new Set(), i = n;
61
62
  for (; i;) {
62
63
  if (i === e || r.has(i)) return !0;
@@ -78,28 +79,28 @@ var W = {
78
79
  orgTreeNodeHeader: "bpm_orgTreeNodeHeader_LEXl-",
79
80
  orgTreeNodeBadge: "bpm_orgTreeNodeBadge_zLc7t",
80
81
  orgTreeNodeActions: "bpm_orgTreeNodeActions_cMldI"
81
- }, G = "__org-tree-root__", K = 232, Ee = 118, De = 232, Oe = 86, ke = 320, Ae = 1.4, je = .25, Me = .005, Ne = 250, Pe = 80, q = .85, Fe = .7, Ie = 1200, Le = 600, Re = 96, ze = {
82
+ }, G = "__org-tree-root__", De = 232, K = 118, Oe = 232, ke = 86, Ae = 320, je = 1.4, Me = .25, Ne = .005, Pe = 250, q = 80, Fe = .85, Ie = .7, Le = 1200, Re = 600, ze = 96, Be = {
82
83
  COMPANY: "公司",
83
84
  DEPARTMENT: "部門",
84
85
  DIVISION: "事業群",
85
86
  TEAM: "小組"
86
- }, Be = { orgUnit: He }, Ve = s(function({ onCreateChild: e, onCreateRoot: t, onEditOrgUnit: n, onSaveDraft: r, onStateChange: i, orgUnits: a }, o) {
87
- let [s, m] = p(!1), [g, _] = p(null), [v, y] = p(null), [b, x] = p(() => Se(a)), [S, C] = p(() => /* @__PURE__ */ new Set()), [w, T] = p(() => /* @__PURE__ */ new Map()), [E, D] = p([]), O = f(null), k = f(null), j = c((e) => {
87
+ }, Ve = { orgUnit: Ue }, He = c(function({ onCreateChild: e, onCreateRoot: t, onEditOrgUnit: n, onSaveDraft: r, onStateChange: i, orgUnits: a }, o) {
88
+ let [s, c] = m(!1), [h, _] = m(null), [v, y] = m(null), [b, x] = m(() => Ce(a)), [S, C] = m(() => /* @__PURE__ */ new Set()), [w, T] = m(() => /* @__PURE__ */ new Map()), [E, D] = m([]), O = p(null), k = p(null), A = l((e) => {
88
89
  k.current = e, C((t) => {
89
90
  let n = new Set(t);
90
91
  return n.has(e) ? n.delete(e) : n.add(e), n;
91
92
  });
92
- }, []), M = c(() => {
93
+ }, []), M = l(() => {
93
94
  k.current = G, C(/* @__PURE__ */ new Set());
94
- }, []), F = c(() => {
95
+ }, []), N = l(() => {
95
96
  k.current = G, C(() => {
96
- let e = Ue(a, b);
97
+ let e = We(a, b);
97
98
  return new Set([...e.keys()].filter((e) => e !== G));
98
99
  });
99
- }, [a, b]), I = d(() => new Map(a.map((e) => [e.id, e])), [a]), L = d(() => we({
100
+ }, [a, b]), I = f(() => new Map(a.map((e) => [e.id, e])), [a]), L = f(() => Te({
100
101
  orgUnits: a,
101
102
  parentDraft: b
102
- }), [a, b]), R = d(() => Ge({
103
+ }), [a, b]), R = f(() => Ke({
103
104
  collapsedIds: S,
104
105
  isEditing: s,
105
106
  measuredHeights: w,
@@ -110,14 +111,14 @@ var W = {
110
111
  let t = I.get(e);
111
112
  t && n(t);
112
113
  },
113
- onToggleCollapse: j,
114
+ onToggleCollapse: A,
114
115
  orgUnits: a,
115
116
  orgUnitsById: I,
116
117
  parentDraft: b,
117
118
  selectedOrgUnitId: v
118
119
  }), [
119
120
  S,
120
- j,
121
+ A,
121
122
  s,
122
123
  w,
123
124
  e,
@@ -127,32 +128,32 @@ var W = {
127
128
  I,
128
129
  b,
129
130
  v
130
- ]), z = f(R);
131
+ ]), z = p(R);
131
132
  z.current = R;
132
- let B = L.length > 0, ee = d(() => {
133
+ let B = L.length > 0, ee = f(() => {
133
134
  let e = Math.max(R.bounds.width, R.bounds.height);
134
- return e <= 0 ? je : Math.min(je, Math.max(Me, Ne / e));
135
- }, [R.bounds.height, R.bounds.width]), V = a.length <= Pe, te = c(() => {
135
+ return e <= 0 ? Me : Math.min(Me, Math.max(Ne, Pe / e));
136
+ }, [R.bounds.height, R.bounds.width]), V = a.length <= q, te = l(() => {
136
137
  let e = O.current;
137
138
  if (!e) return;
138
- let { bounds: t, rootCenter: n } = z.current, r = t.width > 0 ? Ie / t.width : Infinity, i = t.height > 0 ? Le / t.height : Infinity, a = Math.min(r, i);
139
- if (!Number.isFinite(a) || a >= Fe) {
139
+ let { bounds: t, rootCenter: n } = z.current, r = t.width > 0 ? Le / t.width : Infinity, i = t.height > 0 ? Re / t.height : Infinity, a = Math.min(r, i);
140
+ if (!Number.isFinite(a) || a >= Ie) {
140
141
  e.fitView({ padding: .18 });
141
142
  return;
142
143
  }
143
- let o = Le / (2 * q);
144
+ let o = Re / (2 * Fe);
144
145
  e.setCenter(n.x, Math.min(t.height / 2, o), {
145
146
  duration: 0,
146
- zoom: q
147
+ zoom: Fe
147
148
  });
148
- }, []), ne = c((e) => {
149
+ }, []), ne = l((e) => {
149
150
  O.current = e, te();
150
151
  }, [te]);
151
- u(o, () => ({
152
+ d(o, () => ({
152
153
  cancelEditing: ce,
153
154
  saveDraft: le,
154
155
  startEditing: se
155
- })), l(() => {
156
+ })), u(() => {
156
157
  i({
157
158
  hasDraftChanges: B,
158
159
  isEditing: s
@@ -161,45 +162,41 @@ var W = {
161
162
  B,
162
163
  s,
163
164
  i
164
- ]), l(() => {
165
- let e = Se(a);
166
- x(e), C(/* @__PURE__ */ new Set()), T(/* @__PURE__ */ new Map()), y(null), _(null), m(!1);
167
- }, [a]), l(() => {
165
+ ]), u(() => {
166
+ let e = Ce(a);
167
+ x(e), C(/* @__PURE__ */ new Set()), T(/* @__PURE__ */ new Map()), y(null), _(null), c(!1);
168
+ }, [a]), u(() => {
168
169
  D(R.nodes);
169
- }, [R.nodes]), l(() => {
170
+ }, [R.nodes]), u(() => {
170
171
  if (typeof window > "u") return () => void 0;
171
172
  let e = window.requestAnimationFrame(() => {
172
173
  te();
173
174
  });
174
175
  return () => window.cancelAnimationFrame(e);
175
- }, [te, a]), l(() => {
176
+ }, [te, a]), u(() => {
176
177
  let e = k.current;
177
178
  if (!e) return;
178
179
  k.current = null;
179
180
  let t = O.current, n = R.nodes.find((t) => t.id === e);
180
- t && n && t.setCenter(n.position.x + (n.width ?? K) / 2, n.position.y + (n.initialHeight ?? Ee) / 2, {
181
+ t && n && t.setCenter(n.position.x + (n.width ?? De) / 2, n.position.y + (n.initialHeight ?? K) / 2, {
181
182
  duration: 200,
182
183
  zoom: t.getZoom()
183
184
  });
184
185
  }, [R.nodes]);
185
- let re = c((e, t) => {
186
+ let re = l((e, t) => {
186
187
  x((n) => {
187
- let r = Ce({
188
+ let r = we({
188
189
  orgUnitId: e,
189
190
  parentDraft: n,
190
191
  parentId: t
191
192
  });
192
193
  return _(r.message), r.parentDraft;
193
194
  });
194
- }, []), ie = c((e) => {
195
+ }, []), ie = l((e) => {
195
196
  if (!s || !e.target || !e.source) return;
196
197
  let t = e.source === G ? null : e.source;
197
- if (e.target === G) {
198
- _("根節點不能搬移到其他節點下。");
199
- return;
200
- }
201
- re(e.target, t);
202
- }, [re, s]), ae = c((e) => {
198
+ e.target === G ? _("根節點不能搬移到其他節點下。") : re(e.target, t);
199
+ }, [re, s]), ae = l((e) => {
203
200
  let t = e.filter((e) => e.type === "dimensions" && e.dimensions);
204
201
  t.length > 0 && T((e) => {
205
202
  let n = new Map(e);
@@ -208,63 +205,55 @@ var W = {
208
205
  let r = Math.ceil(t.dimensions.height);
209
206
  return Math.abs((n.get(t.id) ?? 0) - r) <= 1 ? e : (n.set(t.id, r), !0);
210
207
  }, !1) ? n : e;
211
- }), s && D((t) => be(e, [...t]));
212
- }, [s]), oe = c((e, t, n) => {
208
+ }), s && D((t) => xe(e, [...t]));
209
+ }, [s]), oe = l((e, t, n) => {
213
210
  if (!s || t.id === G) return;
214
- let r = Je(e, t.id) ?? qe(t, n);
215
- if (r === void 0) {
216
- _("拖曳到目標父節點附近,或從父節點拉線到子節點。");
217
- return;
218
- }
219
- re(t.id, r === G ? null : r);
211
+ let r = Ye(e, t.id) ?? Je(t, n);
212
+ r === void 0 ? _("拖曳到目標父節點附近,或從父節點拉線到子節點。") : re(t.id, r === G ? null : r);
220
213
  }, [re, s]);
221
214
  function se() {
222
- m(!0), x(Se(a)), _("已進入編輯模式,拖曳節點或拉線只會更新前端草稿。");
215
+ c(!0), x(Ce(a)), _("已進入編輯模式,拖曳節點或拉線只會更新前端草稿。");
223
216
  }
224
217
  function ce() {
225
- m(!1), x(Se(a)), _("已取消草稿變更。");
218
+ c(!1), x(Ce(a)), _("已取消草稿變更。");
226
219
  }
227
220
  async function le() {
228
- if (!r) {
229
- _("批次儲存 API 尚未接上,草稿仍保留在前端。");
230
- return;
231
- }
232
- await r(L), m(!1), _("組織樹草稿已儲存。");
221
+ r ? (await r(L), c(!1), _("組織樹草稿已儲存。")) : _("批次儲存 API 尚未接上,草稿仍保留在前端。");
233
222
  }
234
- return /* @__PURE__ */ P("div", {
223
+ return /* @__PURE__ */ F("div", {
235
224
  className: W.orgTreeEditor,
236
- children: [/* @__PURE__ */ P("div", {
225
+ children: [/* @__PURE__ */ F("div", {
237
226
  className: W.orgTreeSummary,
238
- children: [/* @__PURE__ */ N(A, {
227
+ children: [/* @__PURE__ */ P(j, {
239
228
  color: "text-neutral",
240
229
  variant: "caption",
241
- children: g ?? (B ? `目前有 ${L.length} 筆父子關係草稿變更。` : "目前沒有草稿變更。")
242
- }), B ? /* @__PURE__ */ N("ul", {
230
+ children: h ?? (B ? `目前有 ${L.length} 筆父子關係草稿變更。` : "目前沒有草稿變更。")
231
+ }), B ? /* @__PURE__ */ P("ul", {
243
232
  className: W.orgTreeChangeList,
244
- children: L.map((e) => /* @__PURE__ */ P("li", { children: [
245
- et(e.orgUnitId, I),
233
+ children: L.map((e) => /* @__PURE__ */ F("li", { children: [
234
+ tt(e.orgUnitId, I),
246
235
  ":",
247
- et(e.previousParentId, I),
236
+ tt(e.previousParentId, I),
248
237
  " -> ",
249
- et(e.parentId, I)
238
+ tt(e.parentId, I)
250
239
  ] }, e.orgUnitId))
251
240
  }) : null]
252
- }), /* @__PURE__ */ N("div", {
241
+ }), /* @__PURE__ */ P("div", {
253
242
  className: W.orgTreeCanvas,
254
- children: /* @__PURE__ */ P(ye, {
255
- connectionMode: me.Strict,
243
+ children: /* @__PURE__ */ F(be, {
244
+ connectionMode: he.Strict,
256
245
  edges: [...R.edges],
257
246
  fitViewOptions: {
258
247
  minZoom: ee,
259
248
  padding: .18
260
249
  },
261
- isValidConnection: (e) => $e({
250
+ isValidConnection: (e) => et({
262
251
  source: e.source,
263
252
  target: e.target
264
253
  }, b),
265
- maxZoom: Ae,
254
+ maxZoom: je,
266
255
  minZoom: ee,
267
- nodeTypes: Be,
256
+ nodeTypes: Ve,
268
257
  nodes: [...E],
269
258
  nodesConnectable: s,
270
259
  nodesDraggable: s,
@@ -285,24 +274,24 @@ var W = {
285
274
  panOnDrag: !0,
286
275
  proOptions: { hideAttribution: !0 },
287
276
  children: [
288
- /* @__PURE__ */ N(pe, {}),
289
- /* @__PURE__ */ N(he, {}),
290
- /* @__PURE__ */ P(ve, {
277
+ /* @__PURE__ */ P(me, {}),
278
+ /* @__PURE__ */ P(ge, {}),
279
+ /* @__PURE__ */ F(ye, {
291
280
  className: `${W.orgTreePanel} nopan nodrag`,
292
281
  position: "top-right",
293
- children: [/* @__PURE__ */ N(h, {
282
+ children: [/* @__PURE__ */ P(g, {
294
283
  onClick: M,
295
284
  size: "sub",
296
285
  variant: "base-secondary",
297
286
  children: "全部展開"
298
- }), /* @__PURE__ */ N(h, {
299
- onClick: F,
287
+ }), /* @__PURE__ */ P(g, {
288
+ onClick: N,
300
289
  size: "sub",
301
290
  variant: "base-secondary",
302
291
  children: "全部收合"
303
292
  })]
304
293
  }),
305
- V ? /* @__PURE__ */ N(_e, {
294
+ V ? /* @__PURE__ */ P(ve, {
306
295
  pannable: !0,
307
296
  zoomable: !0
308
297
  }) : null
@@ -311,8 +300,8 @@ var W = {
311
300
  })]
312
301
  });
313
302
  });
314
- function He({ data: e, selected: t }) {
315
- return /* @__PURE__ */ P("div", {
303
+ function Ue({ data: e, selected: t }) {
304
+ return /* @__PURE__ */ F("div", {
316
305
  className: [
317
306
  W.orgTreeNode,
318
307
  e.isSyntheticRoot ? W.orgTreeNodeRoot : "",
@@ -321,32 +310,32 @@ function He({ data: e, selected: t }) {
321
310
  t ? W.orgTreeNodeSelected : ""
322
311
  ].filter(Boolean).join(" "),
323
312
  children: [
324
- e.isSyntheticRoot ? null : /* @__PURE__ */ N(ge, {
313
+ e.isSyntheticRoot ? null : /* @__PURE__ */ P(_e, {
325
314
  id: "target",
326
315
  isConnectable: e.isEditing,
327
316
  position: H.Top,
328
317
  type: "target"
329
318
  }),
330
- /* @__PURE__ */ N(ge, {
319
+ /* @__PURE__ */ P(_e, {
331
320
  id: "source",
332
321
  isConnectable: e.isEditing,
333
322
  position: H.Bottom,
334
323
  type: "source"
335
324
  }),
336
- /* @__PURE__ */ P("div", {
325
+ /* @__PURE__ */ F("div", {
337
326
  className: W.orgTreeNodeHeader,
338
- children: [/* @__PURE__ */ N(A, {
327
+ children: [/* @__PURE__ */ P(j, {
339
328
  component: "span",
340
329
  ellipsis: !0,
341
330
  title: e.name,
342
331
  variant: "label-primary",
343
332
  children: e.name
344
- }), e.changed ? /* @__PURE__ */ N("span", {
333
+ }), e.changed ? /* @__PURE__ */ P("span", {
345
334
  className: W.orgTreeNodeBadge,
346
335
  children: "草稿"
347
336
  }) : null]
348
337
  }),
349
- /* @__PURE__ */ N(A, {
338
+ /* @__PURE__ */ P(j, {
350
339
  color: "text-neutral",
351
340
  component: "span",
352
341
  ellipsis: !0,
@@ -354,7 +343,7 @@ function He({ data: e, selected: t }) {
354
343
  variant: "caption",
355
344
  children: e.isSyntheticRoot ? "根節點容器" : `${e.typeLabel} · ${e.code}`
356
345
  }),
357
- e.isSyntheticRoot ? null : /* @__PURE__ */ P(A, {
346
+ e.isSyntheticRoot ? null : /* @__PURE__ */ F(j, {
358
347
  color: "text-neutral",
359
348
  component: "span",
360
349
  ellipsis: !0,
@@ -362,24 +351,24 @@ function He({ data: e, selected: t }) {
362
351
  variant: "caption",
363
352
  children: ["上層:", e.parentLabel]
364
353
  }),
365
- /* @__PURE__ */ P("div", {
354
+ /* @__PURE__ */ F("div", {
366
355
  className: `${W.orgTreeNodeActions} nodrag nopan`,
367
- children: [e.childCount > 0 ? /* @__PURE__ */ N(h, {
356
+ children: [e.childCount > 0 ? /* @__PURE__ */ P(g, {
368
357
  onClick: (t) => {
369
358
  t.stopPropagation(), e.onToggleCollapse(e.orgUnitId ?? G);
370
359
  },
371
360
  size: "sub",
372
361
  variant: "base-secondary",
373
362
  children: e.collapsed ? `展開 (${e.childCount})` : `收合 (${e.childCount})`
374
- }) : null, e.isSyntheticRoot ? /* @__PURE__ */ N(h, {
375
- icon: z,
363
+ }) : null, e.isSyntheticRoot ? /* @__PURE__ */ P(g, {
364
+ icon: B,
376
365
  iconType: "leading",
377
366
  onClick: () => e.onCreateChild(null),
378
367
  size: "sub",
379
368
  variant: "base-secondary",
380
369
  children: "新增根節點"
381
- }) : /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(h, {
382
- icon: R,
370
+ }) : /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(g, {
371
+ icon: z,
383
372
  iconType: "leading",
384
373
  onClick: () => {
385
374
  e.orgUnitId && e.onEdit(e.orgUnitId);
@@ -387,8 +376,8 @@ function He({ data: e, selected: t }) {
387
376
  size: "sub",
388
377
  variant: "base-secondary",
389
378
  children: "編輯"
390
- }), /* @__PURE__ */ N(h, {
391
- icon: z,
379
+ }), /* @__PURE__ */ P(g, {
380
+ icon: B,
392
381
  iconType: "leading",
393
382
  onClick: () => e.onCreateChild(e.orgUnitId),
394
383
  size: "sub",
@@ -399,14 +388,14 @@ function He({ data: e, selected: t }) {
399
388
  ]
400
389
  });
401
390
  }
402
- function Ue(e, t) {
391
+ function We(e, t) {
403
392
  let n = /* @__PURE__ */ new Map();
404
393
  return e.forEach((e) => {
405
394
  let r = t.get(e.id) ?? G;
406
395
  n.set(r, [...n.get(r) ?? [], e.id]);
407
396
  }), n;
408
397
  }
409
- function We({ childrenMap: e, collapsedIds: t }) {
398
+ function Ge({ childrenMap: e, collapsedIds: t }) {
410
399
  let n = /* @__PURE__ */ new Set(), r = (i) => {
411
400
  t.has(i) || (e.get(i) ?? []).forEach((e) => {
412
401
  n.add(e), r(e);
@@ -414,29 +403,29 @@ function We({ childrenMap: e, collapsedIds: t }) {
414
403
  };
415
404
  return r(G), n;
416
405
  }
417
- function Ge({ collapsedIds: e, isEditing: t, measuredHeights: n, onCreateChild: r, onEditOrgUnit: i, onToggleCollapse: a, orgUnits: o, orgUnitsById: s, parentDraft: c, selectedOrgUnitId: l }) {
418
- let u = Ue(o, c), d = We({
406
+ function Ke({ collapsedIds: e, isEditing: t, measuredHeights: n, onCreateChild: r, onEditOrgUnit: i, onToggleCollapse: a, orgUnits: o, orgUnitsById: s, parentDraft: c, selectedOrgUnitId: l }) {
407
+ let u = We(o, c), d = Ge({
419
408
  childrenMap: u,
420
409
  collapsedIds: e
421
- }), f = o.filter((e) => d.has(e.id)), p = (e) => u.get(e)?.length ?? 0, m = (e, t) => Math.max(t, n.get(e) ?? 0), h = new xe.graphlib.Graph();
410
+ }), f = o.filter((e) => d.has(e.id)), p = (e) => u.get(e)?.length ?? 0, m = (e, t) => Math.max(t, n.get(e) ?? 0), h = new Se.graphlib.Graph();
422
411
  h.setDefaultEdgeLabel(() => ({})), h.setGraph({
423
412
  marginx: 36,
424
413
  marginy: 36,
425
414
  nodesep: 44,
426
415
  rankdir: "TB",
427
- ranksep: Re
416
+ ranksep: ze
428
417
  }), h.setNode(G, {
429
- height: m(G, Oe),
430
- width: De
418
+ height: m(G, ke),
419
+ width: Oe
431
420
  }), f.forEach((e) => {
432
421
  h.setNode(e.id, {
433
- height: m(e.id, Ee),
434
- width: K
422
+ height: m(e.id, K),
423
+ width: De
435
424
  });
436
425
  }), f.forEach((e) => {
437
426
  let t = c.get(e.id) ?? null;
438
427
  h.setEdge(t ?? G, e.id);
439
- }), xe.layout(h);
428
+ }), Se.layout(h);
440
429
  let g = h.graph(), _ = {
441
430
  height: g.height ?? 0,
442
431
  width: g.width ?? 0
@@ -444,7 +433,7 @@ function Ge({ collapsedIds: e, isEditing: t, measuredHeights: n, onCreateChild:
444
433
  x: _.width > 0 ? _.width / 2 : v?.x ?? 0,
445
434
  y: v?.y ?? 0
446
435
  }, b = {
447
- ...Ke({
436
+ ...qe({
448
437
  data: {
449
438
  changed: !1,
450
439
  childCount: p(G),
@@ -463,18 +452,18 @@ function Ge({ collapsedIds: e, isEditing: t, measuredHeights: n, onCreateChild:
463
452
  typeLabel: ""
464
453
  },
465
454
  graph: h,
466
- height: m(G, Oe),
455
+ height: m(G, ke),
467
456
  id: G,
468
457
  selected: l === null,
469
- width: De
458
+ width: Oe
470
459
  }),
471
460
  position: {
472
- x: y.x - De / 2,
473
- y: y.y - m(G, Oe) / 2
461
+ x: y.x - Oe / 2,
462
+ y: y.y - m(G, ke) / 2
474
463
  }
475
464
  }, x = f.map((n) => {
476
- let o = c.get(n.id) ?? null, u = et(o, s);
477
- return Ke({
465
+ let o = c.get(n.id) ?? null, u = tt(o, s);
466
+ return qe({
478
467
  data: {
479
468
  changed: o !== n.parentId,
480
469
  childCount: p(n.id),
@@ -490,13 +479,13 @@ function Ge({ collapsedIds: e, isEditing: t, measuredHeights: n, onCreateChild:
490
479
  orgUnitId: n.id,
491
480
  parentLabel: u,
492
481
  path: n.path,
493
- typeLabel: tt(n.type)
482
+ typeLabel: J(n.type)
494
483
  },
495
484
  graph: h,
496
- height: m(n.id, Ee),
485
+ height: m(n.id, K),
497
486
  id: n.id,
498
487
  selected: l === n.id,
499
- width: K
488
+ width: De
500
489
  });
501
490
  });
502
491
  return {
@@ -522,7 +511,7 @@ function Ge({ collapsedIds: e, isEditing: t, measuredHeights: n, onCreateChild:
522
511
  rootCenter: y
523
512
  };
524
513
  }
525
- function Ke({ data: e, graph: t, height: n, id: r, selected: i, width: a }) {
514
+ function qe({ data: e, graph: t, height: n, id: r, selected: i, width: a }) {
526
515
  let o = t.node(r);
527
516
  return {
528
517
  data: e,
@@ -543,15 +532,15 @@ function Ke({ data: e, graph: t, height: n, id: r, selected: i, width: a }) {
543
532
  width: a
544
533
  };
545
534
  }
546
- function qe(e, t) {
547
- let n = Ze(e);
535
+ function Je(e, t) {
536
+ let n = Qe(e);
548
537
  return t.filter((t) => t.id !== e.id).map((e) => ({
549
- distance: Qe(n, Ze(e)),
538
+ distance: $e(n, Qe(e)),
550
539
  id: e.id
551
- })).filter((e) => e.distance <= ke).sort((e, t) => e.distance - t.distance)[0]?.id;
540
+ })).filter((e) => e.distance <= Ae).sort((e, t) => e.distance - t.distance)[0]?.id;
552
541
  }
553
- function Je(e, t) {
554
- let n = Ye(e);
542
+ function Ye(e, t) {
543
+ let n = Xe(e);
555
544
  if (n) return Array.from(document.querySelectorAll(".react-flow__node[data-id]")).map((e) => {
556
545
  let r = e.dataset.id;
557
546
  if (!r || r === t) return null;
@@ -560,45 +549,45 @@ function Je(e, t) {
560
549
  y: i.top + i.height / 2
561
550
  };
562
551
  return {
563
- distance: Qe(n, a),
552
+ distance: $e(n, a),
564
553
  id: r
565
554
  };
566
- }).filter((e) => !!e).filter((e) => e.distance <= ke).sort((e, t) => e.distance - t.distance)[0]?.id;
555
+ }).filter((e) => !!e).filter((e) => e.distance <= Ae).sort((e, t) => e.distance - t.distance)[0]?.id;
567
556
  }
568
- function Ye(e) {
569
- return Xe(e) ? {
557
+ function Xe(e) {
558
+ return Ze(e) ? {
570
559
  x: e.clientX,
571
560
  y: e.clientY
572
561
  } : null;
573
562
  }
574
- function Xe(e) {
563
+ function Ze(e) {
575
564
  return typeof e == "object" && !!e && "clientX" in e && "clientY" in e && typeof e.clientX == "number" && typeof e.clientY == "number";
576
565
  }
577
- function Ze(e) {
566
+ function Qe(e) {
578
567
  return {
579
- x: e.position.x + (e.width ?? K) / 2,
580
- y: e.position.y + (e.measured?.height ?? e.initialHeight ?? Ee) / 2
568
+ x: e.position.x + (e.width ?? De) / 2,
569
+ y: e.position.y + (e.measured?.height ?? e.initialHeight ?? K) / 2
581
570
  };
582
571
  }
583
- function Qe(e, t) {
572
+ function $e(e, t) {
584
573
  return Math.hypot(e.x - t.x, e.y - t.y);
585
574
  }
586
- function $e(e, t) {
587
- return !e.source || !e.target || e.target === G ? !1 : Te({
575
+ function et(e, t) {
576
+ return !e.source || !e.target || e.target === G ? !1 : U({
588
577
  orgUnitId: e.target,
589
578
  parentDraft: t,
590
579
  parentId: e.source === G ? null : e.source
591
580
  }) === null;
592
581
  }
593
- function et(e, t) {
582
+ function tt(e, t) {
594
583
  if (!e) return "根節點";
595
584
  let n = t.get(e);
596
585
  return n ? `${n.name} · ${n.code}` : "未知組織";
597
586
  }
598
- function tt(e) {
599
- return ze[e.toUpperCase()] ?? "未知類型";
587
+ function J(e) {
588
+ return Be[e.toUpperCase()] ?? "未知類型";
600
589
  }
601
- var J = {
590
+ var Y = {
602
591
  tableIntroActions: "bpm_tableIntroActions_WO4XU",
603
592
  modalFields: "bpm_modalFields_juyv6",
604
593
  tableIntro: "bpm_tableIntro_u3hcm",
@@ -609,7 +598,7 @@ var J = {
609
598
  }, nt = {
610
599
  hasDraftChanges: !1,
611
600
  isEditing: !1
612
- }, rt = 100, Y = [
601
+ }, rt = 100, X = [
613
602
  {
614
603
  id: "COMPANY",
615
604
  name: "公司"
@@ -629,7 +618,7 @@ var J = {
629
618
  ], it = {
630
619
  id: "ALL",
631
620
  name: "全部類型"
632
- }, at = [it, ...Y], X = [
621
+ }, Z = [it, ...X], Q = [
633
622
  {
634
623
  id: "MEMBER",
635
624
  name: "指定會員"
@@ -642,18 +631,18 @@ var J = {
642
631
  id: "POSITION",
643
632
  name: "指定職位"
644
633
  }
645
- ], ot = {
634
+ ], at = {
646
635
  id: "ALL",
647
636
  name: "全部範圍"
648
- }, st = [ot, ...X], ct = {
637
+ }, $ = [at, ...Q], ot = {
649
638
  activeOnly: !1,
650
639
  id: "ALL",
651
640
  name: "全部狀態"
652
- }, Z = [ct, {
641
+ }, st = [ot, {
653
642
  activeOnly: !0,
654
643
  id: "ACTIVE",
655
644
  name: "目前有效"
656
- }], Q = [{
645
+ }], ct = [{
657
646
  id: "true",
658
647
  name: "主要歸屬",
659
648
  value: !0
@@ -667,92 +656,92 @@ var J = {
667
656
  50
668
657
  ], ut = 1368, dt = 948, ft = 1292, pt = 1124;
669
658
  function mt() {
670
- let [e, t] = p("ORG_UNITS"), [n, r] = p(null), [i, a] = p(null), [o, s] = p(null), [u, f] = p(!0), [m, h] = p(null), [g, _] = p(ct), [v, y] = p(1), [b, x] = p(10), [E, k] = p(ot), [F, L] = p(0), [R, z] = p([]), [B, pe] = p(null), [me, he] = p(null), [ge, _e] = p(null), [ve, H] = p(1), [ye, be] = p(10), [xe, Se] = p(null), [Ce, we] = p(0), [Te, U] = p(null), [W, G] = p(1), [K, Ee] = p(10), [De, Oe] = p(""), [ke, Ae] = p(0), [je, Me] = p(it), [Ne, Pe] = p("TABLE"), [q, Fe] = p([]), [Ie, Le] = p([]), [Re, ze] = p([]), [Be, Ve] = p(null), [He, Ue] = p(1), [We, Ge] = p(10), [Ke, qe] = p(""), [Je, Ye] = p(0), [Xe, Ze] = p([]), [Qe, $e] = p([]), [et, tt] = p([]), [J, nt] = p(!1);
671
- l(() => {
659
+ let [e, t] = m("ORG_UNITS"), [n, r] = m(null), [i, a] = m(null), [o, s] = m(null), [c, d] = m(!0), [p, h] = m(null), [g, _] = m(ot), [v, y] = m(1), [b, x] = m(10), [S, D] = m(at), [A, I] = m(0), [R, z] = m([]), [B, ee] = m(null), [me, he] = m(null), [ge, _e] = m(null), [ve, ye] = m(1), [H, be] = m(10), [xe, Se] = m(null), [Ce, we] = m(0), [Te, U] = m(null), [Ee, W] = m(1), [G, De] = m(10), [K, Oe] = m(""), [ke, Ae] = m(0), [je, Me] = m(it), [Ne, Pe] = m("TABLE"), [q, Fe] = m([]), [Ie, Le] = m([]), [Re, ze] = m([]), [Be, Ve] = m(null), [He, Ue] = m(1), [We, Ge] = m(10), [Ke, qe] = m(""), [Je, Ye] = m(0), [Xe, Ze] = m([]), [Qe, $e] = m([]), [et, tt] = m([]), [J, Y] = m(!1);
660
+ u(() => {
672
661
  n && a(n);
673
662
  }, [n]);
674
- let Y = n ?? i, at = c(async () => {
675
- f(!0), s(null);
663
+ let nt = n ?? i, X = l(async () => {
664
+ d(!0), s(null);
676
665
  try {
677
- let e = await ce({
666
+ let e = await le({
678
667
  managerActiveOnly: g.activeOnly,
679
668
  managerPage: v,
680
669
  managerPageSize: b,
681
- managerScopeType: E.id === "ALL" ? null : E.id,
670
+ managerScopeType: S.id === "ALL" ? null : S.id,
682
671
  membershipActiveOnly: B?.activeOnly ?? !1,
683
672
  membershipOrgUnitId: ge?.id ?? null,
684
673
  membershipPage: ve,
685
- membershipPageSize: ye,
674
+ membershipPageSize: H,
686
675
  membershipPositionId: xe?.id ?? null,
687
- orgUnitPage: W,
688
- orgUnitPageSize: K,
689
- orgUnitSearchText: De,
676
+ orgUnitPage: Ee,
677
+ orgUnitPageSize: G,
678
+ orgUnitSearchText: K,
690
679
  orgUnitType: je.id === "ALL" ? null : je.id,
691
680
  positionPage: He,
692
681
  positionPageSize: We,
693
682
  positionSearchText: Ke
694
- }), t = kt(e.memberships, e.managerResolutions), n = await j(t);
695
- z(n), Fe(e.orgUnits), Ae(e.orgUnitCount), Le(e.filteredOrgUnits), Ze(e.positions), Ye(e.positionCount), ze(e.filteredPositions), we(e.membershipCount), tt(e.filteredMemberships), L(e.managerResolutionCount), $e(e.filteredManagerResolutions);
683
+ }), t = At(e.memberships, e.managerResolutions), n = await M(t);
684
+ z(n), Fe(e.orgUnits), Ae(e.orgUnitCount), Le(e.filteredOrgUnits), Ze(e.positions), Ye(e.positionCount), ze(e.filteredPositions), we(e.membershipCount), tt(e.filteredMemberships), I(e.managerResolutionCount), $e(e.filteredManagerResolutions);
696
685
  } catch (e) {
697
- s(Qt(e));
686
+ s($t(e));
698
687
  } finally {
699
- f(!1);
688
+ d(!1);
700
689
  }
701
690
  }, [
702
691
  g,
703
692
  v,
704
693
  b,
705
- E,
694
+ S,
706
695
  B,
707
696
  ge,
708
697
  ve,
709
- ye,
698
+ H,
710
699
  xe,
711
- W,
700
+ Ee,
701
+ G,
712
702
  K,
713
- De,
714
703
  je,
715
704
  He,
716
705
  We,
717
706
  Ke
718
707
  ]);
719
- l(() => {
720
- at();
721
- }, [at]);
722
- let X = d(() => new Map(q.map((e) => [e.id, e])), [q]), st = d(() => new Map(Xe.map((e) => [e.id, e])), [Xe]), Z = d(() => new Map(R.map((e) => [e.memberId, e])), [R]), Q = d(() => Ie.map((e) => ({
708
+ u(() => {
709
+ X();
710
+ }, [X]);
711
+ let Z = f(() => new Map(q.map((e) => [e.id, e])), [q]), Q = f(() => new Map(Xe.map((e) => [e.id, e])), [Xe]), $ = f(() => new Map(R.map((e) => [e.memberId, e])), [R]), st = f(() => Ie.map((e) => ({
723
712
  ...e,
724
713
  key: e.id,
725
- parentName: e.parentId ? Mt(X.get(e.parentId)) : "根節點",
726
- typeLabel: Nt(e.type)
727
- })), [Ie, X]), lt = d(() => Re.map((e) => ({
714
+ parentName: e.parentId ? Nt(Z.get(e.parentId)) : "根節點",
715
+ typeLabel: Pt(e.type)
716
+ })), [Ie, Z]), ct = f(() => Re.map((e) => ({
728
717
  ...e,
729
718
  key: e.id
730
- })), [Re]), ut = d(() => et.map((e) => ({
719
+ })), [Re]), lt = f(() => et.map((e) => ({
731
720
  ...e,
732
721
  key: e.id,
733
- memberName: jt(Z.get(e.memberId)),
734
- orgUnitName: Mt(X.get(e.orgUnitId)),
735
- positionName: e.positionId ? Pt(st.get(e.positionId)) : "未指定"
722
+ memberName: Mt($.get(e.memberId)),
723
+ orgUnitName: Nt(Z.get(e.orgUnitId)),
724
+ positionName: e.positionId ? Ft(Q.get(e.positionId)) : "未指定"
736
725
  })), [
737
- Z,
726
+ $,
738
727
  et,
739
- X,
740
- st
741
- ]), dt = d(() => Qe.map((e) => ({
728
+ Z,
729
+ Q
730
+ ]), ut = f(() => Qe.map((e) => ({
742
731
  ...e,
743
732
  key: e.id,
744
- managerName: jt(Z.get(e.managerMemberId)),
745
- scopeLabel: At(e, {
746
- membersById: Z,
747
- orgUnitsById: X,
748
- positionsById: st
733
+ managerName: Mt($.get(e.managerMemberId)),
734
+ scopeLabel: jt(e, {
735
+ membersById: $,
736
+ orgUnitsById: Z,
737
+ positionsById: Q
749
738
  })
750
739
  })), [
751
740
  Qe,
741
+ $,
752
742
  Z,
753
- X,
754
- st
755
- ]), ft = d(() => ({
743
+ Q
744
+ ]), dt = f(() => ({
756
745
  render: (e) => [{
757
746
  name: "編輯",
758
747
  onClick: () => U({
@@ -772,7 +761,7 @@ function mt() {
772
761
  }],
773
762
  variant: "base-secondary",
774
763
  width: 128
775
- }), []), pt = d(() => ({
764
+ }), []), ft = f(() => ({
776
765
  render: (e) => [{
777
766
  name: "編輯",
778
767
  onClick: () => Ve({
@@ -792,7 +781,7 @@ function mt() {
792
781
  }],
793
782
  variant: "base-secondary",
794
783
  width: 128
795
- }), []), mt = d(() => ({
784
+ }), []), pt = f(() => ({
796
785
  render: (e) => [{
797
786
  name: "編輯",
798
787
  onClick: () => he({
@@ -812,7 +801,7 @@ function mt() {
812
801
  }],
813
802
  variant: "base-secondary",
814
803
  width: 128
815
- }), []), yt = d(() => ({
804
+ }), []), mt = f(() => ({
816
805
  render: (e) => [{
817
806
  name: "編輯",
818
807
  onClick: () => h({
@@ -833,87 +822,87 @@ function mt() {
833
822
  variant: "base-secondary",
834
823
  width: 128
835
824
  }), []);
825
+ function yt(e) {
826
+ W(1), Oe(e);
827
+ }
836
828
  function bt(e) {
837
- G(1), Oe(e);
829
+ W(1), Me(e);
838
830
  }
839
831
  function xt(e) {
840
- G(1), Me(e);
832
+ Ue(1), qe(e);
841
833
  }
842
834
  function St(e) {
843
- Ue(1), qe(e);
835
+ ye(1), ee(e);
844
836
  }
845
837
  function Ct(e) {
846
- H(1), pe(e);
847
- }
848
- function $(e) {
849
- H(1), _e(e);
838
+ ye(1), _e(e);
850
839
  }
851
840
  function Ot(e) {
852
- H(1), Se(e);
841
+ ye(1), Se(e);
853
842
  }
854
- function It(e) {
843
+ function kt(e) {
855
844
  y(1), _(e);
856
845
  }
857
846
  function Lt(e) {
858
- y(1), k(e);
847
+ y(1), D(e);
859
848
  }
860
849
  function Rt() {
861
850
  J || r(null);
862
851
  }
863
852
  async function zt() {
864
853
  n && await Vt(async () => {
865
- n.type === "ORG_UNIT" && await oe(n.id), n.type === "POSITION" && await se(n.id), n.type === "MEMBERSHIP" && await ae(n.id), n.type === "MANAGER_RESOLUTION" && await ie(n.id), r(null);
854
+ n.type === "ORG_UNIT" && await se(n.id), n.type === "POSITION" && await ce(n.id), n.type === "MEMBERSHIP" && await oe(n.id), n.type === "MANAGER_RESOLUTION" && await ae(n.id), r(null);
866
855
  });
867
856
  }
868
857
  async function Bt(e) {
869
- nt(!0), s(null);
858
+ Y(!0), s(null);
870
859
  try {
871
- await ee({ moves: e.map((e) => ({
872
- baseUpdatedAt: X.get(e.orgUnitId)?.updatedAt ?? "",
860
+ await V({ moves: e.map((e) => ({
861
+ baseUpdatedAt: Z.get(e.orgUnitId)?.updatedAt ?? "",
873
862
  id: e.orgUnitId,
874
863
  parentId: e.parentId
875
- })) }), await at();
864
+ })) }), await X();
876
865
  } catch (e) {
877
- throw s(Qt(e)), e;
866
+ throw s($t(e)), e;
878
867
  } finally {
879
- nt(!1);
868
+ Y(!1);
880
869
  }
881
870
  }
882
871
  async function Vt(e) {
883
- nt(!0), s(null);
872
+ Y(!0), s(null);
884
873
  try {
885
- await e(), await at();
874
+ await e(), await X();
886
875
  } catch (e) {
887
- s(Qt(e));
876
+ s($t(e));
888
877
  } finally {
889
- nt(!1);
878
+ Y(!1);
890
879
  }
891
880
  }
892
- return /* @__PURE__ */ P(M, { children: [
893
- /* @__PURE__ */ N(C, { children: /* @__PURE__ */ N(I, {
881
+ return /* @__PURE__ */ F(N, { children: [
882
+ /* @__PURE__ */ P(w, { children: /* @__PURE__ */ P(L, {
894
883
  description: "維護組織樹、職位、會員歸屬與簽核主管解析規則。",
895
884
  title: "組織管理"
896
885
  }) }),
897
- /* @__PURE__ */ N(T, { children: /* @__PURE__ */ P(w, {
898
- tab: /* @__PURE__ */ P(D, {
886
+ /* @__PURE__ */ P(E, { children: /* @__PURE__ */ F(T, {
887
+ tab: /* @__PURE__ */ F(O, {
899
888
  activeKey: e,
900
- onChange: (e) => t(Ft(e)),
889
+ onChange: (e) => t(It(e)),
901
890
  children: [
902
- /* @__PURE__ */ N(O, { children: "組織樹" }, "ORG_UNITS"),
903
- /* @__PURE__ */ N(O, { children: "職位" }, "POSITIONS"),
904
- /* @__PURE__ */ N(O, { children: "會員歸屬" }, "MEMBERSHIPS"),
905
- /* @__PURE__ */ N(O, { children: "簽核主管" }, "MANAGERS")
891
+ /* @__PURE__ */ P(k, { children: "組織樹" }, "ORG_UNITS"),
892
+ /* @__PURE__ */ P(k, { children: "職位" }, "POSITIONS"),
893
+ /* @__PURE__ */ P(k, { children: "會員歸屬" }, "MEMBERSHIPS"),
894
+ /* @__PURE__ */ P(k, { children: "簽核主管" }, "MANAGERS")
906
895
  ]
907
896
  }),
908
897
  children: [
909
- o ? /* @__PURE__ */ N(A, {
898
+ o ? /* @__PURE__ */ P(j, {
910
899
  color: "text-error",
911
900
  variant: "body",
912
901
  children: o
913
902
  }) : null,
914
- e === "ORG_UNITS" ? /* @__PURE__ */ N(ht, {
915
- actions: ft,
916
- loading: u,
903
+ e === "ORG_UNITS" ? /* @__PURE__ */ P(ht, {
904
+ actions: dt,
905
+ loading: c,
917
906
  onCreate: () => U({
918
907
  parentId: null,
919
908
  record: null,
@@ -928,27 +917,27 @@ function mt() {
928
917
  record: e,
929
918
  type: "EDIT"
930
919
  }),
931
- onPageChange: G,
920
+ onPageChange: W,
932
921
  onSaveDraft: Bt,
933
922
  onPageSizeChange: (e) => {
934
- G(1), Ee(e);
923
+ W(1), De(e);
935
924
  },
936
- onSearchTextChange: bt,
937
- onTypeFilterChange: xt,
925
+ onSearchTextChange: yt,
926
+ onTypeFilterChange: bt,
938
927
  orgUnits: q,
939
- page: W,
940
- pageSize: K,
941
- rows: Q,
942
- searchText: De,
928
+ page: Ee,
929
+ pageSize: G,
930
+ rows: st,
931
+ searchText: K,
943
932
  saving: J,
944
933
  total: ke,
945
934
  typeFilter: je,
946
935
  viewMode: Ne,
947
936
  onViewModeChange: Pe
948
937
  }) : null,
949
- e === "POSITIONS" ? /* @__PURE__ */ N(gt, {
950
- actions: pt,
951
- loading: u,
938
+ e === "POSITIONS" ? /* @__PURE__ */ P(gt, {
939
+ actions: ft,
940
+ loading: c,
952
941
  onCreate: () => Ve({
953
942
  record: null,
954
943
  type: "CREATE"
@@ -957,45 +946,45 @@ function mt() {
957
946
  onPageSizeChange: (e) => {
958
947
  Ue(1), Ge(e);
959
948
  },
960
- onSearchTextChange: St,
949
+ onSearchTextChange: xt,
961
950
  page: He,
962
951
  pageSize: We,
963
- rows: lt,
952
+ rows: ct,
964
953
  searchText: Ke,
965
954
  total: Je
966
955
  }) : null,
967
- e === "MEMBERSHIPS" ? /* @__PURE__ */ N(_t, {
968
- actions: mt,
969
- loading: u,
956
+ e === "MEMBERSHIPS" ? /* @__PURE__ */ P(_t, {
957
+ actions: pt,
958
+ loading: c,
970
959
  onCreate: () => he({
971
960
  record: null,
972
961
  type: "CREATE"
973
962
  }),
974
- onActiveFilterChange: Ct,
975
- onOrgUnitFilterChange: $,
976
- onPageChange: H,
963
+ onActiveFilterChange: St,
964
+ onOrgUnitFilterChange: Ct,
965
+ onPageChange: ye,
977
966
  onPageSizeChange: (e) => {
978
- H(1), be(e);
967
+ ye(1), be(e);
979
968
  },
980
969
  onPositionFilterChange: Ot,
981
970
  orgUnitFilter: ge,
982
971
  orgUnits: q,
983
972
  page: ve,
984
- pageSize: ye,
973
+ pageSize: H,
985
974
  positionFilter: xe,
986
975
  positions: Xe,
987
- rows: ut,
976
+ rows: lt,
988
977
  statusFilter: B,
989
978
  total: Ce
990
979
  }) : null,
991
- e === "MANAGERS" ? /* @__PURE__ */ N(vt, {
992
- actions: yt,
993
- loading: u,
980
+ e === "MANAGERS" ? /* @__PURE__ */ P(vt, {
981
+ actions: mt,
982
+ loading: c,
994
983
  onCreate: () => h({
995
984
  record: null,
996
985
  type: "CREATE"
997
986
  }),
998
- onActiveFilterChange: It,
987
+ onActiveFilterChange: kt,
999
988
  onPageChange: y,
1000
989
  onPageSizeChange: (e) => {
1001
990
  y(1), x(e);
@@ -1003,22 +992,22 @@ function mt() {
1003
992
  onScopeTypeFilterChange: Lt,
1004
993
  page: v,
1005
994
  pageSize: b,
1006
- rows: dt,
1007
- scopeTypeFilter: E,
995
+ rows: ut,
996
+ scopeTypeFilter: S,
1008
997
  statusFilter: g,
1009
- total: F
998
+ total: A
1010
999
  }) : null
1011
1000
  ]
1012
1001
  }) }),
1013
- /* @__PURE__ */ N(wt, {
1002
+ /* @__PURE__ */ P(wt, {
1014
1003
  modal: Te,
1015
1004
  onClose: () => U(null),
1016
1005
  onSubmit: (e) => Vt(async () => {
1017
- Te?.type === "EDIT" && Te.record ? await de({
1006
+ Te?.type === "EDIT" && Te.record ? await fe({
1018
1007
  ...e,
1019
1008
  id: Te.record.id,
1020
1009
  metadataJson: null
1021
- }) : await ne({
1010
+ }) : await re({
1022
1011
  code: e.code ?? "",
1023
1012
  metadataJson: "{}",
1024
1013
  name: e.name ?? "",
@@ -1029,15 +1018,15 @@ function mt() {
1029
1018
  orgUnits: q,
1030
1019
  saving: J
1031
1020
  }),
1032
- /* @__PURE__ */ N(Tt, {
1021
+ /* @__PURE__ */ P(Tt, {
1033
1022
  modal: Be,
1034
1023
  onClose: () => Ve(null),
1035
1024
  onSubmit: (e) => Vt(async () => {
1036
- Be?.type === "EDIT" && Be.record ? await fe({
1025
+ Be?.type === "EDIT" && Be.record ? await pe({
1037
1026
  ...e,
1038
1027
  id: Be.record.id,
1039
1028
  metadataJson: null
1040
- }) : await re({
1029
+ }) : await ie({
1041
1030
  code: e.code ?? "",
1042
1031
  level: e.level ?? 0,
1043
1032
  metadataJson: "{}",
@@ -1046,16 +1035,16 @@ function mt() {
1046
1035
  }),
1047
1036
  saving: J
1048
1037
  }),
1049
- /* @__PURE__ */ N(Et, {
1050
- membersById: Z,
1038
+ /* @__PURE__ */ P(Et, {
1039
+ membersById: $,
1051
1040
  modal: me,
1052
1041
  onClose: () => he(null),
1053
1042
  onSubmit: (e) => Vt(async () => {
1054
- me?.type === "EDIT" && me.record ? await ue({
1043
+ me?.type === "EDIT" && me.record ? await de({
1055
1044
  ...e,
1056
1045
  id: me.record.id
1057
- }) : await te({
1058
- effectiveFrom: e.effectiveFrom ?? Jt(),
1046
+ }) : await ne({
1047
+ effectiveFrom: e.effectiveFrom ?? Yt(),
1059
1048
  effectiveTo: e.effectiveTo,
1060
1049
  isPrimary: e.isPrimary ?? !1,
1061
1050
  memberId: e.memberId ?? "",
@@ -1067,16 +1056,16 @@ function mt() {
1067
1056
  positions: Xe,
1068
1057
  saving: J
1069
1058
  }),
1070
- /* @__PURE__ */ N(Dt, {
1071
- membersById: Z,
1072
- modal: m,
1059
+ /* @__PURE__ */ P(Dt, {
1060
+ membersById: $,
1061
+ modal: p,
1073
1062
  onClose: () => h(null),
1074
1063
  onSubmit: (e) => Vt(async () => {
1075
- m?.type === "EDIT" && m.record ? await le({
1064
+ p?.type === "EDIT" && p.record ? await ue({
1076
1065
  ...e,
1077
- id: m.record.id
1078
- }) : await V({
1079
- effectiveFrom: e.effectiveFrom ?? Jt(),
1066
+ id: p.record.id
1067
+ }) : await te({
1068
+ effectiveFrom: e.effectiveFrom ?? Yt(),
1080
1069
  effectiveTo: e.effectiveTo,
1081
1070
  managerMemberId: e.managerMemberId ?? "",
1082
1071
  priority: e.priority ?? rt,
@@ -1088,10 +1077,10 @@ function mt() {
1088
1077
  positions: Xe,
1089
1078
  saving: J
1090
1079
  }),
1091
- /* @__PURE__ */ P(S, {
1080
+ /* @__PURE__ */ F(C, {
1092
1081
  cancelText: "取消",
1093
1082
  confirmButtonProps: { variant: "destructive-primary" },
1094
- confirmText: Y?.confirmText ?? "",
1083
+ confirmText: nt?.confirmText ?? "",
1095
1084
  loading: J,
1096
1085
  modalStatusType: "error",
1097
1086
  modalType: "standard",
@@ -1103,12 +1092,12 @@ function mt() {
1103
1092
  showModalHeader: !0,
1104
1093
  size: "regular",
1105
1094
  supportingText: "此操作會立即套用,請確認後再繼續。",
1106
- title: Y?.title ?? "",
1107
- children: [/* @__PURE__ */ N(A, {
1095
+ title: nt?.title ?? "",
1096
+ children: [/* @__PURE__ */ P(j, {
1108
1097
  color: "text-neutral",
1109
1098
  variant: "body",
1110
- children: Y?.description ?? ""
1111
- }), o ? /* @__PURE__ */ N(A, {
1099
+ children: nt?.description ?? ""
1100
+ }), o ? /* @__PURE__ */ P(j, {
1112
1101
  color: "text-error",
1113
1102
  variant: "body",
1114
1103
  children: o
@@ -1116,20 +1105,20 @@ function mt() {
1116
1105
  })
1117
1106
  ] });
1118
1107
  }
1119
- function ht({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUnit: i, onPageChange: a, onSaveDraft: o, onPageSizeChange: s, onSearchTextChange: c, onTypeFilterChange: u, onViewModeChange: m, orgUnits: g, page: S, pageSize: C, rows: w, searchText: T, saving: D, total: O, typeFilter: A, viewMode: j }) {
1120
- let I = f(null), [R, z] = p(nt), B = j === "TABLE" ? "FLOW" : "TABLE", ee = j === "TABLE" ? "切換樹狀圖" : "切換表格", V = j === "FLOW", te = bt({
1108
+ function ht({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUnit: i, onPageChange: a, onSaveDraft: o, onPageSizeChange: s, onSearchTextChange: c, onTypeFilterChange: l, onViewModeChange: d, orgUnits: h, page: _, pageSize: C, rows: w, searchText: T, saving: E, total: O, typeFilter: k, viewMode: j }) {
1109
+ let M = p(null), [L, z] = m(nt), B = j === "TABLE" ? "FLOW" : "TABLE", ee = j === "TABLE" ? "切換樹狀圖" : "切換表格", V = j === "FLOW", te = bt({
1121
1110
  isTreeMode: V,
1122
- isTreeEditing: R.isEditing
1111
+ isTreeEditing: L.isEditing
1123
1112
  }), ne = xt({
1124
1113
  isTreeMode: V,
1125
- isTreeEditing: R.isEditing
1114
+ isTreeEditing: L.isEditing
1126
1115
  }), re = St({
1127
- hasDraftChanges: R.hasDraftChanges,
1128
- isTreeEditing: R.isEditing,
1116
+ hasDraftChanges: L.hasDraftChanges,
1117
+ isTreeEditing: L.isEditing,
1129
1118
  isTreeMode: V,
1130
1119
  loading: t,
1131
- saving: D
1132
- }), ie = d(() => [
1120
+ saving: E
1121
+ }), ie = f(() => [
1133
1122
  {
1134
1123
  dataIndex: "code",
1135
1124
  key: "code",
@@ -1161,47 +1150,39 @@ function ht({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
1161
1150
  width: 420
1162
1151
  }
1163
1152
  ], []);
1164
- return l(() => {
1153
+ return u(() => {
1165
1154
  j === "TABLE" && z(nt);
1166
- }, [j]), /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(Ct, {
1155
+ }, [j]), /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(Ct, {
1167
1156
  actionDisabled: re,
1168
1157
  actionIcon: ne,
1169
1158
  actionLabel: te,
1170
- actions: /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(h, {
1171
- onClick: () => m(B),
1159
+ actions: /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(g, {
1160
+ onClick: () => d(B),
1172
1161
  variant: "base-secondary",
1173
1162
  children: ee
1174
- }), V && R.isEditing ? /* @__PURE__ */ N(h, {
1175
- disabled: D,
1176
- icon: L,
1163
+ }), V && L.isEditing ? /* @__PURE__ */ P(g, {
1164
+ disabled: E,
1165
+ icon: R,
1177
1166
  iconType: "leading",
1178
- onClick: () => I.current?.cancelEditing(),
1167
+ onClick: () => M.current?.cancelEditing(),
1179
1168
  variant: "base-secondary",
1180
1169
  children: "取消"
1181
1170
  }) : null] }),
1182
1171
  description: "組織節點使用 ltree path 維護階層,搬移節點會同步更新子節點 path。",
1183
1172
  onCreate: () => {
1184
- if (!V) {
1185
- n();
1186
- return;
1187
- }
1188
- if (R.isEditing) {
1189
- I.current?.saveDraft();
1190
- return;
1191
- }
1192
- I.current?.startEditing();
1173
+ V ? L.isEditing ? M.current?.saveDraft() : M.current?.startEditing() : n();
1193
1174
  },
1194
1175
  title: "組織樹"
1195
- }), j === "TABLE" ? /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(v, {
1196
- className: J.orgFilterArea,
1176
+ }), j === "TABLE" ? /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(y, {
1177
+ className: Y.orgFilterArea,
1197
1178
  size: "sub",
1198
- children: /* @__PURE__ */ P(y, { children: [/* @__PURE__ */ N(_, {
1179
+ children: /* @__PURE__ */ F(b, { children: [/* @__PURE__ */ P(v, {
1199
1180
  span: 3,
1200
- children: /* @__PURE__ */ N(b, {
1181
+ children: /* @__PURE__ */ P(x, {
1201
1182
  fullWidth: !0,
1202
- layout: F.VERTICAL,
1183
+ layout: I.VERTICAL,
1203
1184
  name: "orgUnitSearchText",
1204
- children: /* @__PURE__ */ N(x, {
1185
+ children: /* @__PURE__ */ P(S, {
1205
1186
  fullWidth: !0,
1206
1187
  onChange: (e) => c(e.target.value),
1207
1188
  placeholder: "搜尋組織名稱或代碼",
@@ -1210,26 +1191,26 @@ function ht({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
1210
1191
  variant: "base"
1211
1192
  })
1212
1193
  })
1213
- }), /* @__PURE__ */ N(_, {
1194
+ }), /* @__PURE__ */ P(v, {
1214
1195
  span: 2,
1215
- children: /* @__PURE__ */ N(b, {
1196
+ children: /* @__PURE__ */ P(x, {
1216
1197
  fullWidth: !0,
1217
- layout: F.VERTICAL,
1198
+ layout: I.VERTICAL,
1218
1199
  name: "orgUnitTypeFilter",
1219
- children: /* @__PURE__ */ N(E, {
1200
+ children: /* @__PURE__ */ P(D, {
1220
1201
  clearable: !1,
1221
1202
  fullWidth: !0,
1222
- onChange: (e) => u(Lt(e)),
1223
- options: [...at],
1203
+ onChange: (e) => l(Rt(e)),
1204
+ options: [...Z],
1224
1205
  placeholder: "類型",
1225
1206
  size: "sub",
1226
- value: A
1207
+ value: k
1227
1208
  })
1228
1209
  })
1229
1210
  })] })
1230
- }), /* @__PURE__ */ N("div", {
1231
- className: J.tableFrame,
1232
- children: /* @__PURE__ */ N(k, {
1211
+ }), /* @__PURE__ */ P("div", {
1212
+ className: Y.tableFrame,
1213
+ children: /* @__PURE__ */ P(A, {
1233
1214
  actions: e,
1234
1215
  columns: ie,
1235
1216
  dataSource: [...w],
@@ -1238,25 +1219,25 @@ function ht({ actions: e, loading: t, onCreate: n, onCreateChild: r, onEditOrgUn
1238
1219
  pagination: yt({
1239
1220
  onPageChange: a,
1240
1221
  onPageSizeChange: s,
1241
- page: S,
1222
+ page: _,
1242
1223
  pageSize: C,
1243
1224
  total: O
1244
1225
  }),
1245
1226
  style: { minWidth: ut }
1246
1227
  })
1247
- })] }) : /* @__PURE__ */ N(Ve, {
1248
- ref: I,
1228
+ })] }) : /* @__PURE__ */ P(He, {
1229
+ ref: M,
1249
1230
  onCreateChild: r,
1250
1231
  onCreateRoot: n,
1251
1232
  onEditOrgUnit: i,
1252
1233
  onSaveDraft: o,
1253
1234
  onStateChange: z,
1254
- orgUnits: g,
1255
- saving: D
1235
+ orgUnits: h,
1236
+ saving: E
1256
1237
  })] });
1257
1238
  }
1258
1239
  function gt({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeChange: i, onSearchTextChange: a, page: o, pageSize: s, rows: c, searchText: l, total: u }) {
1259
- let f = d(() => [
1240
+ let d = f(() => [
1260
1241
  {
1261
1242
  dataIndex: "code",
1262
1243
  key: "code",
@@ -1282,23 +1263,23 @@ function gt({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeCh
1282
1263
  width: 220
1283
1264
  }
1284
1265
  ], []);
1285
- return /* @__PURE__ */ P(M, { children: [
1286
- /* @__PURE__ */ N(Ct, {
1266
+ return /* @__PURE__ */ F(N, { children: [
1267
+ /* @__PURE__ */ P(Ct, {
1287
1268
  actionLabel: "新增職位",
1288
1269
  description: "職位提供會員歸屬與主管解析規則使用。",
1289
1270
  onCreate: n,
1290
1271
  title: "職位"
1291
1272
  }),
1292
- /* @__PURE__ */ N(v, {
1293
- className: J.orgFilterArea,
1273
+ /* @__PURE__ */ P(y, {
1274
+ className: Y.orgFilterArea,
1294
1275
  size: "sub",
1295
- children: /* @__PURE__ */ N(y, { children: /* @__PURE__ */ N(_, {
1276
+ children: /* @__PURE__ */ P(b, { children: /* @__PURE__ */ P(v, {
1296
1277
  span: 3,
1297
- children: /* @__PURE__ */ N(b, {
1278
+ children: /* @__PURE__ */ P(x, {
1298
1279
  fullWidth: !0,
1299
- layout: F.VERTICAL,
1280
+ layout: I.VERTICAL,
1300
1281
  name: "positionSearchText",
1301
- children: /* @__PURE__ */ N(x, {
1282
+ children: /* @__PURE__ */ P(S, {
1302
1283
  fullWidth: !0,
1303
1284
  onChange: (e) => a(e.target.value),
1304
1285
  placeholder: "搜尋職位名稱或代碼",
@@ -1309,11 +1290,11 @@ function gt({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeCh
1309
1290
  })
1310
1291
  }) })
1311
1292
  }),
1312
- /* @__PURE__ */ N("div", {
1313
- className: J.tableFrame,
1314
- children: /* @__PURE__ */ N(k, {
1293
+ /* @__PURE__ */ P("div", {
1294
+ className: Y.tableFrame,
1295
+ children: /* @__PURE__ */ P(A, {
1315
1296
  actions: e,
1316
- columns: f,
1297
+ columns: d,
1317
1298
  dataSource: [...c],
1318
1299
  fullWidth: !0,
1319
1300
  loading: t,
@@ -1329,8 +1310,8 @@ function gt({ actions: e, loading: t, onCreate: n, onPageChange: r, onPageSizeCh
1329
1310
  })
1330
1311
  ] });
1331
1312
  }
1332
- function _t({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOrgUnitFilterChange: o, onPageChange: s, onPageSizeChange: c, onPositionFilterChange: l, orgUnitFilter: u, orgUnits: f, page: p, pageSize: h, positionFilter: g, positions: x, rows: S, statusFilter: C, total: w }) {
1333
- let T = d(() => [
1313
+ function _t({ actions: e, loading: t, onCreate: r, onActiveFilterChange: i, onOrgUnitFilterChange: o, onPageChange: s, onPageSizeChange: c, onPositionFilterChange: l, orgUnitFilter: u, orgUnits: d, page: p, pageSize: m, positionFilter: g, positions: _, rows: S, statusFilter: C, total: w }) {
1314
+ let T = f(() => [
1334
1315
  {
1335
1316
  dataIndex: "memberName",
1336
1317
  key: "memberName",
@@ -1367,25 +1348,25 @@ function _t({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
1367
1348
  title: "結束日",
1368
1349
  width: 140
1369
1350
  }
1370
- ], []), E = d(() => f.map(t), [f]), D = d(() => x.map(i), [x]);
1371
- return /* @__PURE__ */ P(M, { children: [
1372
- /* @__PURE__ */ N(Ct, {
1351
+ ], []), E = f(() => d.map(n), [d]), D = f(() => _.map(a), [_]);
1352
+ return /* @__PURE__ */ F(N, { children: [
1353
+ /* @__PURE__ */ P(Ct, {
1373
1354
  actionLabel: "新增歸屬",
1374
1355
  description: "會員歸屬是 BPM 內部組織權限、主管解析與條件判斷的來源。",
1375
1356
  onCreate: r,
1376
1357
  title: "會員歸屬"
1377
1358
  }),
1378
- /* @__PURE__ */ N(v, {
1379
- className: [J.orgFilterArea, J.membershipFilterArea].join(" "),
1359
+ /* @__PURE__ */ P(y, {
1360
+ className: [Y.orgFilterArea, Y.membershipFilterArea].join(" "),
1380
1361
  size: "sub",
1381
- children: /* @__PURE__ */ P(y, { children: [
1382
- /* @__PURE__ */ N(_, {
1362
+ children: /* @__PURE__ */ F(b, { children: [
1363
+ /* @__PURE__ */ P(v, {
1383
1364
  span: 2,
1384
- children: /* @__PURE__ */ N(b, {
1365
+ children: /* @__PURE__ */ P(x, {
1385
1366
  fullWidth: !0,
1386
- layout: F.VERTICAL,
1367
+ layout: I.VERTICAL,
1387
1368
  name: "membershipOrgUnitFilter",
1388
- children: /* @__PURE__ */ N(m, {
1369
+ children: /* @__PURE__ */ P(h, {
1389
1370
  disabledOptionsFilter: !0,
1390
1371
  emptyText: "沒有符合的組織",
1391
1372
  inputProps: {
@@ -1396,7 +1377,7 @@ function _t({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
1396
1377
  },
1397
1378
  mode: "single",
1398
1379
  name: "membershipOrgUnitFilter",
1399
- onChange: (e) => o(Ht(e)),
1380
+ onChange: (e) => o(Ut(e)),
1400
1381
  options: [...E],
1401
1382
  placeholder: "全部組織",
1402
1383
  size: "sub",
@@ -1404,13 +1385,13 @@ function _t({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
1404
1385
  })
1405
1386
  })
1406
1387
  }),
1407
- /* @__PURE__ */ N(_, {
1388
+ /* @__PURE__ */ P(v, {
1408
1389
  span: 2,
1409
- children: /* @__PURE__ */ N(b, {
1390
+ children: /* @__PURE__ */ P(x, {
1410
1391
  fullWidth: !0,
1411
- layout: F.VERTICAL,
1392
+ layout: I.VERTICAL,
1412
1393
  name: "membershipPositionFilter",
1413
- children: /* @__PURE__ */ N(m, {
1394
+ children: /* @__PURE__ */ P(h, {
1414
1395
  disabledOptionsFilter: !0,
1415
1396
  emptyText: "沒有符合的職位",
1416
1397
  inputProps: {
@@ -1421,7 +1402,7 @@ function _t({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
1421
1402
  },
1422
1403
  mode: "single",
1423
1404
  name: "membershipPositionFilter",
1424
- onChange: (e) => l(Ut(e)),
1405
+ onChange: (e) => l(Wt(e)),
1425
1406
  options: [...D],
1426
1407
  placeholder: "全部職位",
1427
1408
  size: "sub",
@@ -1429,13 +1410,13 @@ function _t({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
1429
1410
  })
1430
1411
  })
1431
1412
  }),
1432
- /* @__PURE__ */ N(_, {
1413
+ /* @__PURE__ */ P(v, {
1433
1414
  span: 2,
1434
- children: /* @__PURE__ */ N(b, {
1415
+ children: /* @__PURE__ */ P(x, {
1435
1416
  fullWidth: !0,
1436
- layout: F.VERTICAL,
1417
+ layout: I.VERTICAL,
1437
1418
  name: "membershipStatusFilter",
1438
- children: /* @__PURE__ */ N(m, {
1419
+ children: /* @__PURE__ */ P(h, {
1439
1420
  disabledOptionsFilter: !0,
1440
1421
  emptyText: "沒有符合的狀態",
1441
1422
  inputProps: {
@@ -1446,8 +1427,8 @@ function _t({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
1446
1427
  },
1447
1428
  mode: "single",
1448
1429
  name: "membershipStatusFilter",
1449
- onChange: (e) => a(Vt(e)),
1450
- options: [...Z],
1430
+ onChange: (e) => i(Ht(e)),
1431
+ options: [...st],
1451
1432
  placeholder: "全部狀態",
1452
1433
  size: "sub",
1453
1434
  value: C
@@ -1456,19 +1437,19 @@ function _t({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
1456
1437
  })
1457
1438
  ] })
1458
1439
  }),
1459
- /* @__PURE__ */ N("div", {
1460
- className: J.tableFrame,
1461
- children: /* @__PURE__ */ N(k, {
1440
+ /* @__PURE__ */ P("div", {
1441
+ className: Y.tableFrame,
1442
+ children: /* @__PURE__ */ P(A, {
1462
1443
  actions: e,
1463
1444
  columns: T,
1464
1445
  dataSource: [...S],
1465
1446
  fullWidth: !0,
1466
- loading: n,
1447
+ loading: t,
1467
1448
  pagination: yt({
1468
1449
  onPageChange: s,
1469
1450
  onPageSizeChange: c,
1470
1451
  page: p,
1471
- pageSize: h,
1452
+ pageSize: m,
1472
1453
  total: w
1473
1454
  }),
1474
1455
  style: { minWidth: ft }
@@ -1476,8 +1457,8 @@ function _t({ actions: e, loading: n, onCreate: r, onActiveFilterChange: a, onOr
1476
1457
  })
1477
1458
  ] });
1478
1459
  }
1479
- function vt({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPageChange: i, onPageSizeChange: a, onScopeTypeFilterChange: o, page: s, pageSize: c, rows: l, scopeTypeFilter: u, statusFilter: f, total: p }) {
1480
- let m = d(() => [
1460
+ function vt({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPageChange: i, onPageSizeChange: a, onScopeTypeFilterChange: o, page: s, pageSize: c, rows: l, scopeTypeFilter: u, statusFilter: d, total: p }) {
1461
+ let m = f(() => [
1481
1462
  {
1482
1463
  dataIndex: "scopeLabel",
1483
1464
  key: "scopeLabel",
@@ -1509,53 +1490,53 @@ function vt({ actions: e, loading: t, onCreate: n, onActiveFilterChange: r, onPa
1509
1490
  width: 140
1510
1491
  }
1511
1492
  ], []);
1512
- return /* @__PURE__ */ P(M, { children: [
1513
- /* @__PURE__ */ N(Ct, {
1493
+ return /* @__PURE__ */ F(N, { children: [
1494
+ /* @__PURE__ */ P(Ct, {
1514
1495
  actionLabel: "新增主管規則",
1515
1496
  description: "簽核主管規則獨立於組織樹 parent,解析優先序為會員、組織、職位。",
1516
1497
  onCreate: n,
1517
1498
  title: "簽核主管"
1518
1499
  }),
1519
- /* @__PURE__ */ N(v, {
1520
- className: J.orgFilterArea,
1500
+ /* @__PURE__ */ P(y, {
1501
+ className: Y.orgFilterArea,
1521
1502
  size: "sub",
1522
- children: /* @__PURE__ */ P(y, { children: [/* @__PURE__ */ N(_, {
1503
+ children: /* @__PURE__ */ F(b, { children: [/* @__PURE__ */ P(v, {
1523
1504
  span: 3,
1524
- children: /* @__PURE__ */ N(b, {
1505
+ children: /* @__PURE__ */ P(x, {
1525
1506
  fullWidth: !0,
1526
- layout: F.VERTICAL,
1507
+ layout: I.VERTICAL,
1527
1508
  name: "managerScopeTypeFilter",
1528
- children: /* @__PURE__ */ N(E, {
1509
+ children: /* @__PURE__ */ P(D, {
1529
1510
  clearable: !1,
1530
1511
  fullWidth: !0,
1531
- onChange: (e) => o(zt(e)),
1532
- options: [...st],
1512
+ onChange: (e) => o(Bt(e)),
1513
+ options: [...$],
1533
1514
  placeholder: "套用範圍",
1534
1515
  size: "sub",
1535
1516
  value: u
1536
1517
  })
1537
1518
  })
1538
- }), /* @__PURE__ */ N(_, {
1519
+ }), /* @__PURE__ */ P(v, {
1539
1520
  span: 2,
1540
- children: /* @__PURE__ */ N(b, {
1521
+ children: /* @__PURE__ */ P(x, {
1541
1522
  fullWidth: !0,
1542
- layout: F.VERTICAL,
1523
+ layout: I.VERTICAL,
1543
1524
  name: "managerStatusFilter",
1544
- children: /* @__PURE__ */ N(E, {
1525
+ children: /* @__PURE__ */ P(D, {
1545
1526
  clearable: !1,
1546
1527
  fullWidth: !0,
1547
- onChange: (e) => r(Bt(e)),
1548
- options: [...Z],
1528
+ onChange: (e) => r(Vt(e)),
1529
+ options: [...st],
1549
1530
  placeholder: "狀態",
1550
1531
  size: "sub",
1551
- value: f
1532
+ value: d
1552
1533
  })
1553
1534
  })
1554
1535
  })] })
1555
1536
  }),
1556
- /* @__PURE__ */ N("div", {
1557
- className: J.tableFrame,
1558
- children: /* @__PURE__ */ N(k, {
1537
+ /* @__PURE__ */ P("div", {
1538
+ className: Y.tableFrame,
1539
+ children: /* @__PURE__ */ P(A, {
1559
1540
  actions: e,
1560
1541
  columns: m,
1561
1542
  dataSource: [...l],
@@ -1590,25 +1571,25 @@ function bt({ isTreeEditing: e, isTreeMode: t }) {
1590
1571
  return t ? e ? "儲存" : "開始編輯" : "新增組織";
1591
1572
  }
1592
1573
  function xt({ isTreeEditing: e, isTreeMode: t }) {
1593
- return t ? e ? B : R : z;
1574
+ return t ? e ? ee : z : B;
1594
1575
  }
1595
1576
  function St({ hasDraftChanges: e, isTreeEditing: t, isTreeMode: n, loading: r, saving: i }) {
1596
1577
  return n ? t ? !e || i : r : !1;
1597
1578
  }
1598
- function Ct({ actionDisabled: e = !1, actionIcon: t = z, actionLabel: n, actions: r, description: i, onCreate: a, title: o }) {
1599
- return /* @__PURE__ */ P("div", {
1600
- className: J.tableIntro,
1601
- children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(A, {
1579
+ function Ct({ actionDisabled: e = !1, actionIcon: t = B, actionLabel: n, actions: r, description: i, onCreate: a, title: o }) {
1580
+ return /* @__PURE__ */ F("div", {
1581
+ className: Y.tableIntro,
1582
+ children: [/* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P(j, {
1602
1583
  component: "h2",
1603
1584
  variant: "h3",
1604
1585
  children: o
1605
- }), /* @__PURE__ */ N(A, {
1586
+ }), /* @__PURE__ */ P(j, {
1606
1587
  color: "text-neutral",
1607
1588
  variant: "body",
1608
1589
  children: i
1609
- })] }), /* @__PURE__ */ P("div", {
1610
- className: J.tableIntroActions,
1611
- children: [r, /* @__PURE__ */ N(h, {
1590
+ })] }), /* @__PURE__ */ F("div", {
1591
+ className: Y.tableIntroActions,
1592
+ children: [r, /* @__PURE__ */ P(g, {
1612
1593
  disabled: e,
1613
1594
  icon: t,
1614
1595
  iconType: "leading",
@@ -1618,69 +1599,69 @@ function Ct({ actionDisabled: e = !1, actionIcon: t = z, actionLabel: n, actions
1618
1599
  })]
1619
1600
  });
1620
1601
  }
1621
- function wt({ modal: n, onClose: i, onSubmit: a, orgUnits: o, saving: s }) {
1622
- let [c, u] = p(""), [d, f] = p(""), [m, h] = p(null), [g, _] = p(Y[2]);
1623
- return l(() => {
1624
- if (!n) return;
1625
- let e = n.record, r = e?.parentId ?? n.parentId ?? null, i = r ? o.find((e) => e.id === r) ?? null : null;
1626
- u(e?.code ?? ""), f(e?.name ?? ""), h(i ? t(i) : null), _(Y.find((t) => t.id === e?.type) ?? Y[2]);
1627
- }, [n, o]), /* @__PURE__ */ N(S, {
1602
+ function wt({ modal: t, onClose: r, onSubmit: a, orgUnits: o, saving: s }) {
1603
+ let [c, l] = m(""), [d, f] = m(""), [p, h] = m(null), [g, _] = m(X[2]);
1604
+ return u(() => {
1605
+ if (!t) return;
1606
+ let e = t.record, r = e?.parentId ?? t.parentId ?? null, i = r ? o.find((e) => e.id === r) ?? null : null;
1607
+ l(e?.code ?? ""), f(e?.name ?? ""), h(i ? n(i) : null), _(X.find((t) => t.id === e?.type) ?? X[2]);
1608
+ }, [t, o]), /* @__PURE__ */ P(C, {
1628
1609
  cancelText: "取消",
1629
1610
  confirmButtonProps: { disabled: !c || !d },
1630
- confirmText: n?.type === "EDIT" ? "儲存" : "建立",
1611
+ confirmText: t?.type === "EDIT" ? "儲存" : "建立",
1631
1612
  loading: s,
1632
1613
  modalType: "standard",
1633
- onCancel: i,
1634
- onClose: i,
1614
+ onCancel: r,
1615
+ onClose: r,
1635
1616
  onConfirm: () => void a({
1636
1617
  code: c,
1637
1618
  name: d,
1638
- parentId: m?.id ?? null,
1619
+ parentId: p?.id ?? null,
1639
1620
  type: g.id
1640
1621
  }),
1641
- open: !!n,
1622
+ open: !!t,
1642
1623
  showModalFooter: !0,
1643
1624
  showModalHeader: !0,
1644
1625
  size: "regular",
1645
- title: n?.type === "EDIT" ? "編輯組織" : "新增組織",
1646
- children: /* @__PURE__ */ P("div", {
1647
- className: J.modalFields,
1626
+ title: t?.type === "EDIT" ? "編輯組織" : "新增組織",
1627
+ children: /* @__PURE__ */ F("div", {
1628
+ className: Y.modalFields,
1648
1629
  children: [
1649
- /* @__PURE__ */ N($, {
1630
+ /* @__PURE__ */ P(Ot, {
1650
1631
  label: "代碼",
1651
1632
  name: "orgCode",
1652
- onChange: u,
1633
+ onChange: l,
1653
1634
  placeholder: "例如 FIN-TW",
1654
1635
  value: c
1655
1636
  }),
1656
- /* @__PURE__ */ N($, {
1637
+ /* @__PURE__ */ P(Ot, {
1657
1638
  label: "名稱",
1658
1639
  name: "orgName",
1659
1640
  onChange: f,
1660
1641
  placeholder: "例如 財務部",
1661
1642
  value: d
1662
1643
  }),
1663
- /* @__PURE__ */ N(e, {
1644
+ /* @__PURE__ */ P(e, {
1664
1645
  label: "類型",
1665
1646
  name: "orgType",
1666
- children: /* @__PURE__ */ N(E, {
1647
+ children: /* @__PURE__ */ P(D, {
1667
1648
  clearable: !1,
1668
1649
  fullWidth: !0,
1669
- onChange: (e) => _(It(e)),
1670
- options: [...Y],
1650
+ onChange: (e) => _(Lt(e)),
1651
+ options: [...X],
1671
1652
  placeholder: "選擇組織類型",
1672
1653
  value: g
1673
1654
  })
1674
1655
  }),
1675
- /* @__PURE__ */ N(e, {
1656
+ /* @__PURE__ */ P(e, {
1676
1657
  label: "上層組織",
1677
1658
  name: "parentId",
1678
- children: /* @__PURE__ */ N(r, {
1659
+ children: /* @__PURE__ */ P(i, {
1679
1660
  name: "parentId",
1680
1661
  onChange: h,
1681
- orgUnits: o.filter((e) => e.id !== n?.record?.id),
1662
+ orgUnits: o.filter((e) => e.id !== t?.record?.id),
1682
1663
  placeholder: "選擇上層組織",
1683
- value: m
1664
+ value: p
1684
1665
  })
1685
1666
  })
1686
1667
  ]
@@ -1688,10 +1669,10 @@ function wt({ modal: n, onClose: i, onSubmit: a, orgUnits: o, saving: s }) {
1688
1669
  });
1689
1670
  }
1690
1671
  function Tt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
1691
- let [i, a] = p(""), [o, s] = p("0"), [c, u] = p("");
1692
- return l(() => {
1693
- e && (a(e.record?.code ?? ""), s(String(e.record?.level ?? 0)), u(e.record?.name ?? ""));
1694
- }, [e]), /* @__PURE__ */ N(S, {
1672
+ let [i, a] = m(""), [o, s] = m("0"), [c, l] = m("");
1673
+ return u(() => {
1674
+ e && (a(e.record?.code ?? ""), s(String(e.record?.level ?? 0)), l(e.record?.name ?? ""));
1675
+ }, [e]), /* @__PURE__ */ P(C, {
1695
1676
  cancelText: "取消",
1696
1677
  confirmButtonProps: { disabled: !i || !c },
1697
1678
  confirmText: e?.type === "EDIT" ? "儲存" : "建立",
@@ -1709,24 +1690,24 @@ function Tt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
1709
1690
  showModalHeader: !0,
1710
1691
  size: "regular",
1711
1692
  title: e?.type === "EDIT" ? "編輯職位" : "新增職位",
1712
- children: /* @__PURE__ */ P("div", {
1713
- className: J.modalFields,
1693
+ children: /* @__PURE__ */ F("div", {
1694
+ className: Y.modalFields,
1714
1695
  children: [
1715
- /* @__PURE__ */ N($, {
1696
+ /* @__PURE__ */ P(Ot, {
1716
1697
  label: "代碼",
1717
1698
  name: "positionCode",
1718
1699
  onChange: a,
1719
1700
  placeholder: "例如 FIN-MGR",
1720
1701
  value: i
1721
1702
  }),
1722
- /* @__PURE__ */ N($, {
1703
+ /* @__PURE__ */ P(Ot, {
1723
1704
  label: "名稱",
1724
1705
  name: "positionName",
1725
- onChange: u,
1706
+ onChange: l,
1726
1707
  placeholder: "例如 財務主管",
1727
1708
  value: c
1728
1709
  }),
1729
- /* @__PURE__ */ N($, {
1710
+ /* @__PURE__ */ P(Ot, {
1730
1711
  label: "職等",
1731
1712
  name: "positionLevel",
1732
1713
  onChange: s,
@@ -1737,30 +1718,30 @@ function Tt({ modal: e, onClose: t, onSubmit: n, saving: r }) {
1737
1718
  })
1738
1719
  });
1739
1720
  }
1740
- function Et({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, positions: m, saving: h }) {
1741
- let [g, _] = p(Jt()), [v, y] = p(""), [b, x] = p(Q[1]), [C, w] = p(null), [T, D] = p(null), [O, k] = p(null);
1742
- return l(() => {
1721
+ function Et({ membersById: t, modal: c, onClose: l, onSubmit: d, orgUnits: f, positions: p, saving: h }) {
1722
+ let [g, _] = m(Yt()), [v, y] = m(""), [b, x] = m(ct[1]), [S, w] = m(null), [T, E] = m(null), [O, k] = m(null);
1723
+ return u(() => {
1743
1724
  if (!c) return;
1744
- let e = c.record, r = e ? s.get(e.memberId) : null;
1745
- _(e?.effectiveFrom ?? Jt()), y(e?.effectiveTo ?? ""), x(Q.find((t) => t.value === e?.isPrimary) ?? Q[1]), w(r ? n(r) : null), D(qt(f.find((t) => t.id === e?.orgUnitId), t)), k(qt(m.find((t) => t.id === e?.positionId), i));
1725
+ let e = c.record, i = e ? t.get(e.memberId) : null;
1726
+ _(e?.effectiveFrom ?? Yt()), y(e?.effectiveTo ?? ""), x(ct.find((t) => t.value === e?.isPrimary) ?? ct[1]), w(i ? r(i) : null), E(Jt(f.find((t) => t.id === e?.orgUnitId), n)), k(Jt(p.find((t) => t.id === e?.positionId), a));
1746
1727
  }, [
1747
- s,
1728
+ t,
1748
1729
  c,
1749
1730
  f,
1750
- m
1751
- ]), /* @__PURE__ */ N(S, {
1731
+ p
1732
+ ]), /* @__PURE__ */ P(C, {
1752
1733
  cancelText: "取消",
1753
- confirmButtonProps: { disabled: !C || !T },
1734
+ confirmButtonProps: { disabled: !S || !T },
1754
1735
  confirmText: c?.type === "EDIT" ? "儲存" : "建立",
1755
1736
  loading: h,
1756
1737
  modalType: "standard",
1757
- onCancel: u,
1758
- onClose: u,
1738
+ onCancel: l,
1739
+ onClose: l,
1759
1740
  onConfirm: () => void d({
1760
1741
  effectiveFrom: g,
1761
1742
  effectiveTo: v || null,
1762
1743
  isPrimary: b.value,
1763
- memberId: C?.id ?? null,
1744
+ memberId: S?.id ?? null,
1764
1745
  orgUnitId: T?.id ?? null,
1765
1746
  positionId: O?.id ?? null
1766
1747
  }),
@@ -1769,61 +1750,61 @@ function Et({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
1769
1750
  showModalHeader: !0,
1770
1751
  size: "regular",
1771
1752
  title: c?.type === "EDIT" ? "編輯會員歸屬" : "新增會員歸屬",
1772
- children: /* @__PURE__ */ P("div", {
1773
- className: J.modalFields,
1753
+ children: /* @__PURE__ */ F("div", {
1754
+ className: Y.modalFields,
1774
1755
  children: [
1775
- /* @__PURE__ */ N(e, {
1756
+ /* @__PURE__ */ P(e, {
1776
1757
  label: "會員",
1777
1758
  name: "memberId",
1778
- children: /* @__PURE__ */ N(o, {
1759
+ children: /* @__PURE__ */ P(s, {
1779
1760
  name: "memberId",
1780
1761
  onChange: w,
1781
1762
  placeholder: "搜尋會員姓名或信箱",
1782
- value: C
1763
+ value: S
1783
1764
  })
1784
1765
  }),
1785
- /* @__PURE__ */ N(e, {
1766
+ /* @__PURE__ */ P(e, {
1786
1767
  label: "組織",
1787
1768
  name: "orgUnitId",
1788
- children: /* @__PURE__ */ N(r, {
1769
+ children: /* @__PURE__ */ P(i, {
1789
1770
  name: "orgUnitId",
1790
- onChange: D,
1771
+ onChange: E,
1791
1772
  orgUnits: f,
1792
1773
  placeholder: "選擇歸屬組織",
1793
1774
  value: T
1794
1775
  })
1795
1776
  }),
1796
- /* @__PURE__ */ N(e, {
1777
+ /* @__PURE__ */ P(e, {
1797
1778
  label: "職位",
1798
1779
  name: "positionId",
1799
- children: /* @__PURE__ */ N(a, {
1780
+ children: /* @__PURE__ */ P(o, {
1800
1781
  name: "positionId",
1801
1782
  onChange: k,
1802
1783
  placeholder: "選擇職位",
1803
- positions: m,
1784
+ positions: p,
1804
1785
  value: O
1805
1786
  })
1806
1787
  }),
1807
- /* @__PURE__ */ N(e, {
1788
+ /* @__PURE__ */ P(e, {
1808
1789
  label: "歸屬類型",
1809
1790
  name: "isPrimary",
1810
- children: /* @__PURE__ */ N(E, {
1791
+ children: /* @__PURE__ */ P(D, {
1811
1792
  clearable: !1,
1812
1793
  fullWidth: !0,
1813
- onChange: (e) => x(Wt(e)),
1814
- options: [...Q],
1794
+ onChange: (e) => x(Gt(e)),
1795
+ options: [...ct],
1815
1796
  placeholder: "選擇歸屬類型",
1816
1797
  value: b
1817
1798
  })
1818
1799
  }),
1819
- /* @__PURE__ */ N(Ot, {
1800
+ /* @__PURE__ */ P(kt, {
1820
1801
  label: "生效日",
1821
1802
  name: "membershipEffectiveFrom",
1822
1803
  onChange: _,
1823
1804
  placeholder: "YYYY-MM-DD",
1824
1805
  value: g
1825
1806
  }),
1826
- /* @__PURE__ */ N(Ot, {
1807
+ /* @__PURE__ */ P(kt, {
1827
1808
  label: "結束日",
1828
1809
  name: "membershipEffectiveTo",
1829
1810
  onChange: y,
@@ -1834,69 +1815,69 @@ function Et({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
1834
1815
  })
1835
1816
  });
1836
1817
  }
1837
- function Dt({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, positions: m, saving: h }) {
1838
- let [g, _] = p(Jt()), [v, y] = p(""), [b, x] = p(null), [C, w] = p(String(rt)), [T, D] = p(null), [O, k] = p(null), [j, M] = p(null), [F, I] = p(X[0]);
1839
- l(() => {
1818
+ function Dt({ membersById: t, modal: c, onClose: l, onSubmit: d, orgUnits: f, positions: p, saving: h }) {
1819
+ let [g, _] = m(Yt()), [v, y] = m(""), [b, x] = m(null), [S, w] = m(String(rt)), [T, E] = m(null), [O, k] = m(null), [A, M] = m(null), [N, I] = m(Q[0]);
1820
+ u(() => {
1840
1821
  if (!c) return;
1841
- let e = c.record, r = X.find((t) => t.id === e?.scopeType) ?? X[0];
1842
- _(e?.effectiveFrom ?? Jt()), y(e?.effectiveTo ?? ""), x(qt(e ? s.get(e.managerMemberId) : null, n)), w(String(e?.priority ?? rt)), D(r.id === "MEMBER" ? qt(e ? s.get(e.scopeId) : null, n) : null), k(r.id === "ORG_UNIT" ? qt(f.find((t) => t.id === e?.scopeId), t) : null), M(r.id === "POSITION" ? qt(m.find((t) => t.id === e?.scopeId), i) : null), I(r);
1822
+ let e = c.record, i = Q.find((t) => t.id === e?.scopeType) ?? Q[0];
1823
+ _(e?.effectiveFrom ?? Yt()), y(e?.effectiveTo ?? ""), x(Jt(e ? t.get(e.managerMemberId) : null, r)), w(String(e?.priority ?? rt)), E(i.id === "MEMBER" ? Jt(e ? t.get(e.scopeId) : null, r) : null), k(i.id === "ORG_UNIT" ? Jt(f.find((t) => t.id === e?.scopeId), n) : null), M(i.id === "POSITION" ? Jt(p.find((t) => t.id === e?.scopeId), a) : null), I(i);
1843
1824
  }, [
1844
- s,
1825
+ t,
1845
1826
  c,
1846
1827
  f,
1847
- m
1828
+ p
1848
1829
  ]);
1849
- let L = F.id === "MEMBER" ? T?.id : F.id === "ORG_UNIT" ? O?.id : j?.id, R = !!(F.id === "MEMBER" && T?.id && b?.id && T.id === b.id);
1850
- return /* @__PURE__ */ N(S, {
1830
+ let L = N.id === "MEMBER" ? T?.id : N.id === "ORG_UNIT" ? O?.id : A?.id, R = !!(N.id === "MEMBER" && T?.id && b?.id && T.id === b.id);
1831
+ return /* @__PURE__ */ P(C, {
1851
1832
  cancelText: "取消",
1852
1833
  confirmButtonProps: { disabled: !b || !L || R },
1853
1834
  confirmText: c?.type === "EDIT" ? "儲存" : "建立",
1854
1835
  loading: h,
1855
1836
  modalType: "standard",
1856
- onCancel: u,
1857
- onClose: u,
1837
+ onCancel: l,
1838
+ onClose: l,
1858
1839
  onConfirm: () => void d({
1859
1840
  effectiveFrom: g,
1860
1841
  effectiveTo: v || null,
1861
1842
  managerMemberId: b?.id ?? null,
1862
- priority: Number(C),
1843
+ priority: Number(S),
1863
1844
  scopeId: L ?? null,
1864
- scopeType: F.id
1845
+ scopeType: N.id
1865
1846
  }),
1866
1847
  open: !!c,
1867
1848
  showModalFooter: !0,
1868
1849
  showModalHeader: !0,
1869
1850
  size: "regular",
1870
1851
  title: c?.type === "EDIT" ? "編輯主管規則" : "新增主管規則",
1871
- children: /* @__PURE__ */ P("div", {
1872
- className: J.modalFields,
1852
+ children: /* @__PURE__ */ F("div", {
1853
+ className: Y.modalFields,
1873
1854
  children: [
1874
- /* @__PURE__ */ N(e, {
1855
+ /* @__PURE__ */ P(e, {
1875
1856
  label: "套用範圍",
1876
1857
  name: "scopeType",
1877
- children: /* @__PURE__ */ N(E, {
1858
+ children: /* @__PURE__ */ P(D, {
1878
1859
  clearable: !1,
1879
1860
  fullWidth: !0,
1880
- onChange: (e) => I(Rt(e)),
1881
- options: [...X],
1861
+ onChange: (e) => I(zt(e)),
1862
+ options: [...Q],
1882
1863
  placeholder: "選擇套用範圍",
1883
- value: F
1864
+ value: N
1884
1865
  })
1885
1866
  }),
1886
- F.id === "MEMBER" ? /* @__PURE__ */ N(e, {
1867
+ N.id === "MEMBER" ? /* @__PURE__ */ P(e, {
1887
1868
  label: "會員",
1888
1869
  name: "scopeMemberId",
1889
- children: /* @__PURE__ */ N(o, {
1870
+ children: /* @__PURE__ */ P(s, {
1890
1871
  name: "scopeMemberId",
1891
- onChange: D,
1872
+ onChange: E,
1892
1873
  placeholder: "搜尋套用會員",
1893
1874
  value: T
1894
1875
  })
1895
1876
  }) : null,
1896
- F.id === "ORG_UNIT" ? /* @__PURE__ */ N(e, {
1877
+ N.id === "ORG_UNIT" ? /* @__PURE__ */ P(e, {
1897
1878
  label: "組織",
1898
1879
  name: "scopeOrgUnitId",
1899
- children: /* @__PURE__ */ N(r, {
1880
+ children: /* @__PURE__ */ P(i, {
1900
1881
  name: "scopeOrgUnitId",
1901
1882
  onChange: k,
1902
1883
  orgUnits: f,
@@ -1904,48 +1885,48 @@ function Dt({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
1904
1885
  value: O
1905
1886
  })
1906
1887
  }) : null,
1907
- F.id === "POSITION" ? /* @__PURE__ */ N(e, {
1888
+ N.id === "POSITION" ? /* @__PURE__ */ P(e, {
1908
1889
  label: "職位",
1909
1890
  name: "scopePositionId",
1910
- children: /* @__PURE__ */ N(a, {
1891
+ children: /* @__PURE__ */ P(o, {
1911
1892
  name: "scopePositionId",
1912
1893
  onChange: M,
1913
1894
  placeholder: "選擇套用職位",
1914
- positions: m,
1915
- value: j
1895
+ positions: p,
1896
+ value: A
1916
1897
  })
1917
1898
  }) : null,
1918
- /* @__PURE__ */ N(e, {
1899
+ /* @__PURE__ */ P(e, {
1919
1900
  label: "簽核主管",
1920
1901
  name: "managerMemberId",
1921
- children: /* @__PURE__ */ N(o, {
1902
+ children: /* @__PURE__ */ P(s, {
1922
1903
  name: "managerMemberId",
1923
1904
  onChange: x,
1924
1905
  placeholder: "搜尋簽核主管",
1925
1906
  value: b
1926
1907
  })
1927
1908
  }),
1928
- R ? /* @__PURE__ */ N(A, {
1909
+ R ? /* @__PURE__ */ P(j, {
1929
1910
  color: "text-error",
1930
1911
  variant: "caption",
1931
1912
  children: "簽核主管不可設定為套用會員本人。"
1932
1913
  }) : null,
1933
- /* @__PURE__ */ N($, {
1914
+ /* @__PURE__ */ P(Ot, {
1934
1915
  hintText: "數字越大越優先,同一位成員命中多條規則時只會採用最高的那一層。建議:指定到人 200、部門主管 100、全公司通用的墊底規則 10。",
1935
1916
  label: "優先序",
1936
1917
  name: "managerPriority",
1937
1918
  onChange: w,
1938
1919
  placeholder: "例如 100",
1939
- value: C
1920
+ value: S
1940
1921
  }),
1941
- /* @__PURE__ */ N(Ot, {
1922
+ /* @__PURE__ */ P(kt, {
1942
1923
  label: "生效日",
1943
1924
  name: "managerEffectiveFrom",
1944
1925
  onChange: _,
1945
1926
  placeholder: "YYYY-MM-DD",
1946
1927
  value: g
1947
1928
  }),
1948
- /* @__PURE__ */ N(Ot, {
1929
+ /* @__PURE__ */ P(kt, {
1949
1930
  label: "結束日",
1950
1931
  name: "managerEffectiveTo",
1951
1932
  onChange: y,
@@ -1956,12 +1937,12 @@ function Dt({ membersById: s, modal: c, onClose: u, onSubmit: d, orgUnits: f, po
1956
1937
  })
1957
1938
  });
1958
1939
  }
1959
- function $({ hintText: t, label: n, name: r, onChange: i, placeholder: a, value: o }) {
1960
- return /* @__PURE__ */ N(e, {
1940
+ function Ot({ hintText: t, label: n, name: r, onChange: i, placeholder: a, value: o }) {
1941
+ return /* @__PURE__ */ P(e, {
1961
1942
  hintText: t,
1962
1943
  label: n,
1963
1944
  name: r,
1964
- children: /* @__PURE__ */ N(x, {
1945
+ children: /* @__PURE__ */ P(S, {
1965
1946
  fullWidth: !0,
1966
1947
  name: r,
1967
1948
  onChange: (e) => i(e.target.value),
@@ -1970,118 +1951,118 @@ function $({ hintText: t, label: n, name: r, onChange: i, placeholder: a, value:
1970
1951
  })
1971
1952
  });
1972
1953
  }
1973
- function Ot({ label: t, name: n, onChange: r, placeholder: i, value: a }) {
1974
- return /* @__PURE__ */ N(e, {
1954
+ function kt({ label: t, name: n, onChange: r, placeholder: i, value: a }) {
1955
+ return /* @__PURE__ */ P(e, {
1975
1956
  label: t,
1976
1957
  name: n,
1977
- children: /* @__PURE__ */ N(g, {
1958
+ children: /* @__PURE__ */ P(_, {
1978
1959
  format: "YYYY-MM-DD",
1979
1960
  fullWidth: !0,
1980
1961
  inputProps: { name: n },
1981
- onChange: (e) => r(Yt(e)),
1962
+ onChange: (e) => r(Xt(e)),
1982
1963
  placeholder: i,
1983
1964
  value: a.trim() ? a : void 0
1984
1965
  })
1985
1966
  });
1986
1967
  }
1987
- function kt(e, t) {
1968
+ function At(e, t) {
1988
1969
  return [.../* @__PURE__ */ new Set([
1989
1970
  ...e.map((e) => e.memberId),
1990
1971
  ...t.map((e) => e.managerMemberId),
1991
1972
  ...t.filter((e) => e.scopeType === "MEMBER").map((e) => e.scopeId)
1992
1973
  ])];
1993
1974
  }
1994
- function At(e, t) {
1995
- return e.scopeType === "MEMBER" ? `會員:${jt(t.membersById.get(e.scopeId))}` : e.scopeType === "ORG_UNIT" ? `組織:${Mt(t.orgUnitsById.get(e.scopeId))}` : `職位:${Pt(t.positionsById.get(e.scopeId))}`;
1996
- }
1997
- function jt(e) {
1998
- return e ? `${e.name} · ${e.email}` : "未知會員";
1975
+ function jt(e, t) {
1976
+ return e.scopeType === "MEMBER" ? `會員:${Mt(t.membersById.get(e.scopeId))}` : e.scopeType === "ORG_UNIT" ? `組織:${Nt(t.orgUnitsById.get(e.scopeId))}` : `職位:${Ft(t.positionsById.get(e.scopeId))}`;
1999
1977
  }
2000
1978
  function Mt(e) {
2001
- return e ? `${e.name} · ${e.code}` : "未知組織";
1979
+ return e ? t(e.name, e.email, "dot") : "未知會員";
2002
1980
  }
2003
1981
  function Nt(e) {
2004
- return Y.find((t) => t.id.toLowerCase() === e.toLowerCase())?.name ?? "未知類型";
1982
+ return e ? `${e.name} · ${e.code}` : "未知組織";
2005
1983
  }
2006
1984
  function Pt(e) {
2007
- return e ? `${e.name} · ${e.code}` : "未指定";
1985
+ return X.find((t) => t.id.toLowerCase() === e.toLowerCase())?.name ?? "未知類型";
2008
1986
  }
2009
1987
  function Ft(e) {
2010
- return e === "MANAGERS" || e === "MEMBERSHIPS" || e === "POSITIONS" ? e : "ORG_UNITS";
1988
+ return e ? `${e.name} · ${e.code}` : "未指定";
2011
1989
  }
2012
1990
  function It(e) {
2013
- let t = Kt(e) ? e : null;
1991
+ return e === "MANAGERS" || e === "MEMBERSHIPS" || e === "POSITIONS" ? e : "ORG_UNITS";
1992
+ }
1993
+ function Lt(e) {
1994
+ let t = qt(e) ? e : null;
2014
1995
  if (typeof t?.id == "string") {
2015
1996
  let e = t.id;
2016
- return Y.find((t) => t.id.toLowerCase() === e.toLowerCase()) ?? Y[2];
1997
+ return X.find((t) => t.id.toLowerCase() === e.toLowerCase()) ?? X[2];
2017
1998
  }
2018
- return Y[2];
1999
+ return X[2];
2019
2000
  }
2020
- function Lt(e) {
2021
- let t = Kt(e) ? e : null;
2001
+ function Rt(e) {
2002
+ let t = qt(e) ? e : null;
2022
2003
  if (typeof t?.id == "string") {
2023
2004
  let e = t.id;
2024
- return at.find((t) => t.id.toLowerCase() === e.toLowerCase()) ?? it;
2005
+ return Z.find((t) => t.id.toLowerCase() === e.toLowerCase()) ?? it;
2025
2006
  }
2026
2007
  return it;
2027
2008
  }
2028
- function Rt(e) {
2029
- return Gt(e, X, X[0]);
2030
- }
2031
2009
  function zt(e) {
2032
- return Gt(e, st, ot);
2010
+ return Kt(e, Q, Q[0]);
2033
2011
  }
2034
2012
  function Bt(e) {
2035
- return Gt(e, Z, ct);
2013
+ return Kt(e, $, at);
2036
2014
  }
2037
2015
  function Vt(e) {
2038
- let t = Kt(e) ? e : null, n = typeof t?.id == "string" ? t.id : null;
2039
- return Z.find((e) => e.id === n) ?? null;
2016
+ return Kt(e, st, ot);
2040
2017
  }
2041
2018
  function Ht(e) {
2042
- let t = Kt(e) ? e : null, n = typeof t?.id == "string" ? t.id : null, r = typeof t?.name == "string" ? t.name : null;
2019
+ let t = qt(e) ? e : null, n = typeof t?.id == "string" ? t.id : null;
2020
+ return st.find((e) => e.id === n) ?? null;
2021
+ }
2022
+ function Ut(e) {
2023
+ let t = qt(e) ? e : null, n = typeof t?.id == "string" ? t.id : null, r = typeof t?.name == "string" ? t.name : null;
2043
2024
  return n && r ? {
2044
2025
  id: n,
2045
2026
  name: r
2046
2027
  } : null;
2047
2028
  }
2048
- function Ut(e) {
2049
- let t = Kt(e) ? e : null, n = typeof t?.id == "string" ? t.id : null, r = typeof t?.name == "string" ? t.name : null;
2029
+ function Wt(e) {
2030
+ let t = qt(e) ? e : null, n = typeof t?.id == "string" ? t.id : null, r = typeof t?.name == "string" ? t.name : null;
2050
2031
  return n && r ? {
2051
2032
  id: n,
2052
2033
  name: r
2053
2034
  } : null;
2054
2035
  }
2055
- function Wt(e) {
2056
- return Gt(e, Q, Q[1]);
2036
+ function Gt(e) {
2037
+ return Kt(e, ct, ct[1]);
2057
2038
  }
2058
- function Gt(e, t, n) {
2059
- let r = Kt(e) ? e : null, i = typeof r?.id == "string" ? r.id : null;
2039
+ function Kt(e, t, n) {
2040
+ let r = qt(e) ? e : null, i = typeof r?.id == "string" ? r.id : null;
2060
2041
  return t.find((e) => e.id === i) ?? n;
2061
2042
  }
2062
- function Kt(e) {
2043
+ function qt(e) {
2063
2044
  return typeof e == "object" && !!e && !Array.isArray(e);
2064
2045
  }
2065
- function qt(e, t) {
2046
+ function Jt(e, t) {
2066
2047
  return e ? t(e) : null;
2067
2048
  }
2068
- function Jt() {
2069
- return Xt(/* @__PURE__ */ new Date());
2070
- }
2071
- function Yt(e) {
2072
- let t = e ? new Date(e) : null;
2073
- return t && !Number.isNaN(t.getTime()) ? Xt(t) : "";
2049
+ function Yt() {
2050
+ return Zt(/* @__PURE__ */ new Date());
2074
2051
  }
2075
2052
  function Xt(e) {
2076
- return `${e.getFullYear()}-${Zt(e.getMonth() + 1)}-${Zt(e.getDate())}`;
2053
+ let t = e ? new Date(e) : null;
2054
+ return t && !Number.isNaN(t.getTime()) ? Zt(t) : "";
2077
2055
  }
2078
2056
  function Zt(e) {
2079
- return String(e).padStart(2, "0");
2057
+ return `${e.getFullYear()}-${Qt(e.getMonth() + 1)}-${Qt(e.getDate())}`;
2080
2058
  }
2081
2059
  function Qt(e) {
2060
+ return String(e).padStart(2, "0");
2061
+ }
2062
+ function $t(e) {
2082
2063
  return e instanceof Error ? e.message : "讀取組織資料失敗。";
2083
2064
  }
2084
2065
  //#endregion
2085
2066
  export { mt as t };
2086
2067
 
2087
- //# sourceMappingURL=orgs-BpqVu5ka.js.map
2068
+ //# sourceMappingURL=orgs-Bpp1U60k.js.map