@feedmepos/mf-hrm-portal 2.3.2-dev.8 → 2.3.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 (114) hide show
  1. package/dist/{ApprovalCodeList-DIYhVMGW.js → ApprovalCodeList-C9r8CGNH.js} +15 -14
  2. package/dist/{AuditLogList-DIc3Jgpr.js → AuditLogList-Cu-KcQKa.js} +152 -147
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BQ-uIsTN.js +438 -0
  4. package/dist/EmployeeList-BaFqZnFM.js +776 -0
  5. package/dist/FormItem.vue_vue_type_script_setup_true_lang-Be1OU1_r.js +45 -0
  6. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  7. package/dist/{GrantUserList-8zmzFk9z.js → GrantUserList-Bjhx60M7.js} +16 -15
  8. package/dist/Main-CJQpjOgY.js +96 -0
  9. package/dist/{Main-DYzFd_qa.js → Main-DHiTgiDR.js} +5 -5
  10. package/dist/{Main-gRu17-N6.js → Main-LpfQqR_u.js} +999 -1005
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
  12. package/dist/{PermissionSetList-CL42jQY4.js → PermissionSetList-C0OZ_dvE.js} +76 -76
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-T7dkd5Uv.js +4167 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-EwU7gHP7.js +35 -0
  15. package/dist/RoleList-DpyW5XLs.js +740 -0
  16. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-B9NMhw9Z.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CqP-Dn1X.js} +1 -1
  17. package/dist/{ScheduleGeneralPage-751cEUwS.js → ScheduleGeneralPage-BNHi5jGf.js} +2 -2
  18. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-CBDNfiIM.js → ScheduleModal.vue_vue_type_script_setup_true_lang-B609MZoP.js} +186 -187
  19. package/dist/{SchedulePage-C-NcbGIl.js → SchedulePage-CrP5_m3p.js} +13 -13
  20. package/dist/{SchedulePositionPage-Ba0iiSRg.js → SchedulePositionPage-ei_NKAUw.js} +3 -3
  21. package/dist/{SelectFilter-Dpsq165k.js → SelectFilter-CEYQ-ViE.js} +1 -1
  22. package/dist/TeamMemberList-rPiKKu2b.js +1154 -0
  23. package/dist/TimesheetList-B1L4WkNh.js +402 -0
  24. package/dist/TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-By6YR-k2.js +58 -0
  25. package/dist/{app-DXkKrcRn.js → app-BzlH-2cN.js} +4015 -7756
  26. package/dist/app.js +3 -3
  27. package/dist/{approval-code-D2pGW-sI.js → approval-code-CWq2ce3u.js} +1 -1
  28. package/dist/{dayjs.min-BAz84JAQ.js → dayjs.min-D6T4JzVv.js} +21 -21
  29. package/dist/employee-Bw7kRokg.js +209 -0
  30. package/dist/{grant-user-B95RDjkR.js → grant-user-q_mkj3Vh.js} +1 -1
  31. package/dist/{index-TrBkLxJe.js → iteration-Dz0e08VH.js} +726 -698
  32. package/dist/{lodash-DXRsZpTB.js → lodash-DGG_-VgI.js} +1 -1
  33. package/dist/restaurant-DJBQY9N5.js +2688 -0
  34. package/dist/role-CiRbkZSm.js +92 -0
  35. package/dist/rule-DMgkHpva.js +783 -0
  36. package/dist/src/api/employee/index.d.ts +2 -1
  37. package/dist/src/api/timesheet/index.d.ts +1 -1
  38. package/dist/src/components/CollapsibleWrapper.vue.d.ts +3 -11
  39. package/dist/src/helpers/permission-set.d.ts +102 -1
  40. package/dist/src/helpers/rule.d.ts +2 -2
  41. package/dist/src/helpers/string.d.ts +1 -10
  42. package/dist/src/router/shared.d.ts +1 -3
  43. package/dist/src/stores/employee.d.ts +7 -1
  44. package/dist/src/stores/restaurant.d.ts +8 -68
  45. package/dist/src/stores/team.d.ts +0 -30
  46. package/dist/src/stores/timesheet.d.ts +51 -66
  47. package/dist/src/types/team.d.ts +1 -17
  48. package/dist/src/types/timesheet.d.ts +0 -3
  49. package/dist/src/views/audit-log/constants.d.ts +1 -1
  50. package/dist/src/views/audit-log/locales/index.d.ts +16 -12
  51. package/dist/src/views/hr/locales/index.d.ts +0 -20
  52. package/dist/src/views/hr/role/RoleForm.vue.d.ts +2 -29
  53. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
  54. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
  55. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
  56. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
  57. package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -11
  58. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +0 -11
  59. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +0 -21
  60. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +0 -11
  61. package/dist/src/views/team/locales/index.d.ts +0 -716
  62. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -48
  63. package/dist/src/views/team/{components/MemberStatusBadge.vue.d.ts → member/MemberInfo.vue.d.ts} +2 -2
  64. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +0 -1
  65. package/dist/string-VNuQNweN.js +15 -0
  66. package/dist/style.css +1 -1
  67. package/dist/tsconfig.app.tsbuildinfo +1 -1
  68. package/dist/{useAppStore-7O0GMkXY.js → useAppStore-TRX-PQD4.js} +1 -1
  69. package/dist/{useLoading-BZXydjer.js → useLoading-W3YSF8OB.js} +1 -1
  70. package/dist/{useReportPermissions-Cn3ntCJ9.js → useReportPermissions-CCkCAaGO.js} +3 -3
  71. package/package.json +3 -3
  72. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-4YsF7lXu.js +0 -459
  73. package/dist/EmployeeList-iVg4pI9Y.js +0 -896
  74. package/dist/FormSection.vue_vue_type_script_setup_true_lang-C9AE0EHw.js +0 -90
  75. package/dist/Main-ClJox3pV.js +0 -101
  76. package/dist/MyPosProfile-ARRrolbz.js +0 -290
  77. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +0 -126
  78. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DkA0XbZw.js +0 -4208
  79. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-CA87qQ4b.js +0 -1831
  80. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-B3N3hTcU.js +0 -547
  81. package/dist/RoleList-F9ZORhgE.js +0 -265
  82. package/dist/TeamMemberList-DZ0aRbxg.js +0 -2087
  83. package/dist/TimesheetList-DO5T__dL.js +0 -437
  84. package/dist/employee-yYhuhc9L.js +0 -172
  85. package/dist/iteration-CcXrOMQe.js +0 -30
  86. package/dist/member-grant-ByAQ1Qja.js +0 -54
  87. package/dist/restaurant-COSpCpTQ.js +0 -52
  88. package/dist/role-ZmCd2yG4.js +0 -98
  89. package/dist/rule-Bty9eoI3.js +0 -843
  90. package/dist/src/api/my-pos-profile/index.d.ts +0 -3
  91. package/dist/src/api/sso-provider/index.d.ts +0 -5
  92. package/dist/src/api/staff-invite/index.d.ts +0 -16
  93. package/dist/src/components/form/SegmentedTabs.vue.d.ts +0 -23
  94. package/dist/src/composables/useMenuAccess.d.ts +0 -56
  95. package/dist/src/composables/useSsoProviders.d.ts +0 -19
  96. package/dist/src/composables/useStaffInviteProviders.d.ts +0 -8
  97. package/dist/src/helpers/member-grant.d.ts +0 -36
  98. package/dist/src/helpers/my-pos-profile.d.ts +0 -37
  99. package/dist/src/helpers/pos-assignment-rows.d.ts +0 -28
  100. package/dist/src/helpers/staff-invite.d.ts +0 -54
  101. package/dist/src/router/menu-access-guard.d.ts +0 -17
  102. package/dist/src/types/my-pos-profile.d.ts +0 -24
  103. package/dist/src/types/sso-provider.d.ts +0 -10
  104. package/dist/src/types/staff-invite.d.ts +0 -100
  105. package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +0 -2
  106. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +0 -4
  107. package/dist/src/views/my-pos-profile/locales/index.d.ts +0 -196
  108. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +0 -51
  109. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +0 -44
  110. package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +0 -11
  111. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +0 -35
  112. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +0 -19
  113. package/dist/string-DZQ1uNjn.js +0 -22
  114. package/dist/timesheet-CFD6XPiG.js +0 -76
@@ -1,4208 +0,0 @@
1
- import { getCurrentInstance as Bt, inject as ur, ref as st, shallowRef as dr, computed as z, watch as Mt, onMounted as Un, onUnmounted as mr, defineComponent as ke, h as Vn, createVNode as oe, Text as fr, Fragment as Me, resolveComponent as De, createBlock as Ce, openBlock as J, withCtx as ce, createElementVNode as ie, createElementBlock as re, toDisplayString as Oe, unref as X, renderList as Ee, toRef as qt, normalizeStyle as rt, renderSlot as Se, createCommentVNode as Ne, normalizeClass as ye, createTextVNode as _r, useSlots as pr, createSlots as tt, mergeModels as en, useModel as vr } from "vue";
2
- import { useI18n as ze, useCoreStore as br } from "@feedmepos/mf-common";
3
- import { useDialog as hr, useBreakpoints as gr } from "@feedmepos/ui-library";
4
- import "@vue/devtools-api";
5
- import { p as Wn, i as Gn, V as tn, K as Ir, a as yr, j as Er, H as Nr, L as Cr, D as Tr, x as Or } from "./rule-Bty9eoI3.js";
6
- import { _ as Zt, a as Sr, b as nn, u as Lr } from "./ConditionBuilderForm.vue_vue_type_script_setup_true_lang-4YsF7lXu.js";
7
- import { u as kr, v as Ar, g as Rr, b as Mr, P as Yn, S as Dt, A as nt, m as Be, j as rn } from "./app-DXkKrcRn.js";
8
- import { c as Bn } from "./iteration-CcXrOMQe.js";
9
- import { r as Dr, s as Zn } from "./string-DZQ1uNjn.js";
10
- import "./index-TrBkLxJe.js";
11
- import { W as wr } from "./member-grant-ByAQ1Qja.js";
12
- import { u as Fr } from "./role-ZmCd2yG4.js";
13
- function St(e, t, n) {
14
- const r = /* @__PURE__ */ new Map();
15
- return e.forEach(
16
- ({ name: a, permissions: o }) => o.forEach(({ conditions: f, actions: m }) => {
17
- var h, E;
18
- const i = JSON.parse(f || "{}");
19
- (h = i[t]) != null && h.$in ? (E = i[t]) == null || E.$in.forEach(
20
- (C) => (r.get(C) ?? r.set(C, /* @__PURE__ */ new Set()).get(C)).add(a)
21
- ) : m[0] === "manage" && n.forEach((C) => {
22
- (r.get(C) ?? r.set(C, /* @__PURE__ */ new Set()).get(C)).add(a);
23
- });
24
- })
25
- ), [...r].map(([a, o]) => ({
26
- id: a,
27
- setNames: [...o]
28
- }));
29
- }
30
- /*!
31
- * shared v10.0.5
32
- * (c) 2024 kazuya kawaguchi
33
- * Released under the MIT License.
34
- */
35
- const sn = typeof window < "u", Ke = (e, t = !1) => t ? Symbol.for(e) : Symbol(e), Pr = (e, t, n) => jr({ l: e, k: t, s: n }), jr = (e) => JSON.stringify(e).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/\u0027/g, "\\u0027"), he = (e) => typeof e == "number" && isFinite(e), xr = (e) => Xt(e) === "[object Date]", yt = (e) => Xt(e) === "[object RegExp]", Nt = (e) => q(e) && Object.keys(e).length === 0, ge = Object.assign, Ur = Object.create, se = (e = null) => Ur(e);
36
- let an;
37
- const $e = () => an || (an = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : se());
38
- function on(e) {
39
- return e.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
40
- }
41
- const Vr = Object.prototype.hasOwnProperty;
42
- function Le(e, t) {
43
- return Vr.call(e, t);
44
- }
45
- const pe = Array.isArray, ue = (e) => typeof e == "function", W = (e) => typeof e == "string", _e = (e) => typeof e == "boolean", ee = (e) => e !== null && typeof e == "object", Wr = (e) => ee(e) && ue(e.then) && ue(e.catch), Xn = Object.prototype.toString, Xt = (e) => Xn.call(e), q = (e) => Xt(e) === "[object Object]", Gr = (e) => e == null ? "" : pe(e) || q(e) && e.toString === Xn ? JSON.stringify(e, null, 2) : String(e);
46
- function Ht(e, t = "") {
47
- return e.reduce((n, r, a) => a === 0 ? n + r : n + t + r, "");
48
- }
49
- function Yr(e, t) {
50
- typeof console < "u" && (console.warn("[intlify] " + e), t && console.warn(t.stack));
51
- }
52
- const ft = (e) => !ee(e) || pe(e);
53
- function It(e, t) {
54
- if (ft(e) || ft(t))
55
- throw new Error("Invalid value");
56
- const n = [{ src: e, des: t }];
57
- for (; n.length; ) {
58
- const { src: r, des: a } = n.pop();
59
- Object.keys(r).forEach((o) => {
60
- o !== "__proto__" && (ee(r[o]) && !ee(a[o]) && (a[o] = Array.isArray(r[o]) ? [] : se()), ft(a[o]) || ft(r[o]) ? a[o] = r[o] : n.push({ src: r[o], des: a[o] }));
61
- });
62
- }
63
- }
64
- function Br(e, t, n) {
65
- return { line: e, column: t, offset: n };
66
- }
67
- function wt(e, t, n) {
68
- return { start: e, end: t };
69
- }
70
- const ne = {
71
- // tokenizer error codes
72
- EXPECTED_TOKEN: 1,
73
- INVALID_TOKEN_IN_PLACEHOLDER: 2,
74
- UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3,
75
- UNKNOWN_ESCAPE_SEQUENCE: 4,
76
- INVALID_UNICODE_ESCAPE_SEQUENCE: 5,
77
- UNBALANCED_CLOSING_BRACE: 6,
78
- UNTERMINATED_CLOSING_BRACE: 7,
79
- EMPTY_PLACEHOLDER: 8,
80
- NOT_ALLOW_NEST_PLACEHOLDER: 9,
81
- INVALID_LINKED_FORMAT: 10,
82
- // parser error codes
83
- MUST_HAVE_MESSAGES_IN_PLURAL: 11,
84
- UNEXPECTED_EMPTY_LINKED_MODIFIER: 12,
85
- UNEXPECTED_EMPTY_LINKED_KEY: 13,
86
- UNEXPECTED_LEXICAL_ANALYSIS: 14
87
- }, Zr = 17;
88
- function Ct(e, t, n = {}) {
89
- const { domain: r, messages: a, args: o } = n, f = e, m = new SyntaxError(String(f));
90
- return m.code = e, t && (m.location = t), m.domain = r, m;
91
- }
92
- function Xr(e) {
93
- throw e;
94
- }
95
- const je = " ", Hr = "\r", Ie = `
96
- `, Jr = "\u2028", $r = "\u2029";
97
- function zr(e) {
98
- const t = e;
99
- let n = 0, r = 1, a = 1, o = 0;
100
- const f = (v) => t[v] === Hr && t[v + 1] === Ie, m = (v) => t[v] === Ie, i = (v) => t[v] === $r, h = (v) => t[v] === Jr, E = (v) => f(v) || m(v) || i(v) || h(v), C = () => n, T = () => r, D = () => a, R = () => o, k = (v) => f(v) || i(v) || h(v) ? Ie : t[v], M = () => k(n), p = () => k(n + o);
101
- function b() {
102
- return o = 0, E(n) && (r++, a = 0), f(n) && n++, n++, a++, t[n];
103
- }
104
- function S() {
105
- return f(n + o) && o++, o++, t[n + o];
106
- }
107
- function d() {
108
- n = 0, r = 1, a = 1, o = 0;
109
- }
110
- function g(v = 0) {
111
- o = v;
112
- }
113
- function y() {
114
- const v = n + o;
115
- for (; v !== n; )
116
- b();
117
- o = 0;
118
- }
119
- return {
120
- index: C,
121
- line: T,
122
- column: D,
123
- peekOffset: R,
124
- charAt: k,
125
- currentChar: M,
126
- currentPeek: p,
127
- next: b,
128
- peek: S,
129
- reset: d,
130
- resetPeek: g,
131
- skipToPeek: y
132
- };
133
- }
134
- const Ye = void 0, Kr = ".", ln = "'", Qr = "tokenizer";
135
- function qr(e, t = {}) {
136
- const n = t.location !== !1, r = zr(e), a = () => r.index(), o = () => Br(r.line(), r.column(), r.index()), f = o(), m = a(), i = {
137
- currentType: 13,
138
- offset: m,
139
- startLoc: f,
140
- endLoc: f,
141
- lastType: 13,
142
- lastOffset: m,
143
- lastStartLoc: f,
144
- lastEndLoc: f,
145
- braceNest: 0,
146
- inLinked: !1,
147
- text: ""
148
- }, h = () => i, { onError: E } = t;
149
- function C(l, s, c, ...I) {
150
- const x = h();
151
- if (s.column += c, s.offset += c, E) {
152
- const G = n ? wt(x.startLoc, s) : null, u = Ct(l, G, {
153
- domain: Qr,
154
- args: I
155
- });
156
- E(u);
157
- }
158
- }
159
- function T(l, s, c) {
160
- l.endLoc = o(), l.currentType = s;
161
- const I = { type: s };
162
- return n && (I.loc = wt(l.startLoc, l.endLoc)), c != null && (I.value = c), I;
163
- }
164
- const D = (l) => T(
165
- l,
166
- 13
167
- /* TokenTypes.EOF */
168
- );
169
- function R(l, s) {
170
- return l.currentChar() === s ? (l.next(), s) : (C(ne.EXPECTED_TOKEN, o(), 0, s), "");
171
- }
172
- function k(l) {
173
- let s = "";
174
- for (; l.currentPeek() === je || l.currentPeek() === Ie; )
175
- s += l.currentPeek(), l.peek();
176
- return s;
177
- }
178
- function M(l) {
179
- const s = k(l);
180
- return l.skipToPeek(), s;
181
- }
182
- function p(l) {
183
- if (l === Ye)
184
- return !1;
185
- const s = l.charCodeAt(0);
186
- return s >= 97 && s <= 122 || // a-z
187
- s >= 65 && s <= 90 || // A-Z
188
- s === 95;
189
- }
190
- function b(l) {
191
- if (l === Ye)
192
- return !1;
193
- const s = l.charCodeAt(0);
194
- return s >= 48 && s <= 57;
195
- }
196
- function S(l, s) {
197
- const { currentType: c } = s;
198
- if (c !== 2)
199
- return !1;
200
- k(l);
201
- const I = p(l.currentPeek());
202
- return l.resetPeek(), I;
203
- }
204
- function d(l, s) {
205
- const { currentType: c } = s;
206
- if (c !== 2)
207
- return !1;
208
- k(l);
209
- const I = l.currentPeek() === "-" ? l.peek() : l.currentPeek(), x = b(I);
210
- return l.resetPeek(), x;
211
- }
212
- function g(l, s) {
213
- const { currentType: c } = s;
214
- if (c !== 2)
215
- return !1;
216
- k(l);
217
- const I = l.currentPeek() === ln;
218
- return l.resetPeek(), I;
219
- }
220
- function y(l, s) {
221
- const { currentType: c } = s;
222
- if (c !== 7)
223
- return !1;
224
- k(l);
225
- const I = l.currentPeek() === ".";
226
- return l.resetPeek(), I;
227
- }
228
- function v(l, s) {
229
- const { currentType: c } = s;
230
- if (c !== 8)
231
- return !1;
232
- k(l);
233
- const I = p(l.currentPeek());
234
- return l.resetPeek(), I;
235
- }
236
- function A(l, s) {
237
- const { currentType: c } = s;
238
- if (!(c === 7 || c === 11))
239
- return !1;
240
- k(l);
241
- const I = l.currentPeek() === ":";
242
- return l.resetPeek(), I;
243
- }
244
- function L(l, s) {
245
- const { currentType: c } = s;
246
- if (c !== 9)
247
- return !1;
248
- const I = () => {
249
- const G = l.currentPeek();
250
- return G === "{" ? p(l.peek()) : G === "@" || G === "|" || G === ":" || G === "." || G === je || !G ? !1 : G === Ie ? (l.peek(), I()) : U(l, !1);
251
- }, x = I();
252
- return l.resetPeek(), x;
253
- }
254
- function H(l) {
255
- k(l);
256
- const s = l.currentPeek() === "|";
257
- return l.resetPeek(), s;
258
- }
259
- function U(l, s = !0) {
260
- const c = (x = !1, G = "") => {
261
- const u = l.currentPeek();
262
- return u === "{" || u === "@" || !u ? x : u === "|" ? !(G === je || G === Ie) : u === je ? (l.peek(), c(!0, je)) : u === Ie ? (l.peek(), c(!0, Ie)) : !0;
263
- }, I = c();
264
- return s && l.resetPeek(), I;
265
- }
266
- function _(l, s) {
267
- const c = l.currentChar();
268
- return c === Ye ? Ye : s(c) ? (l.next(), c) : null;
269
- }
270
- function O(l) {
271
- const s = l.charCodeAt(0);
272
- return s >= 97 && s <= 122 || // a-z
273
- s >= 65 && s <= 90 || // A-Z
274
- s >= 48 && s <= 57 || // 0-9
275
- s === 95 || // _
276
- s === 36;
277
- }
278
- function P(l) {
279
- return _(l, O);
280
- }
281
- function F(l) {
282
- const s = l.charCodeAt(0);
283
- return s >= 97 && s <= 122 || // a-z
284
- s >= 65 && s <= 90 || // A-Z
285
- s >= 48 && s <= 57 || // 0-9
286
- s === 95 || // _
287
- s === 36 || // $
288
- s === 45;
289
- }
290
- function w(l) {
291
- return _(l, F);
292
- }
293
- function V(l) {
294
- const s = l.charCodeAt(0);
295
- return s >= 48 && s <= 57;
296
- }
297
- function j(l) {
298
- return _(l, V);
299
- }
300
- function Y(l) {
301
- const s = l.charCodeAt(0);
302
- return s >= 48 && s <= 57 || // 0-9
303
- s >= 65 && s <= 70 || // A-F
304
- s >= 97 && s <= 102;
305
- }
306
- function Z(l) {
307
- return _(l, Y);
308
- }
309
- function te(l) {
310
- let s = "", c = "";
311
- for (; s = j(l); )
312
- c += s;
313
- return c;
314
- }
315
- function K(l) {
316
- let s = "";
317
- for (; ; ) {
318
- const c = l.currentChar();
319
- if (c === "{" || c === "}" || c === "@" || c === "|" || !c)
320
- break;
321
- if (c === je || c === Ie)
322
- if (U(l))
323
- s += c, l.next();
324
- else {
325
- if (H(l))
326
- break;
327
- s += c, l.next();
328
- }
329
- else
330
- s += c, l.next();
331
- }
332
- return s;
333
- }
334
- function me(l) {
335
- M(l);
336
- let s = "", c = "";
337
- for (; s = w(l); )
338
- c += s;
339
- return l.currentChar() === Ye && C(ne.UNTERMINATED_CLOSING_BRACE, o(), 0), c;
340
- }
341
- function ve(l) {
342
- M(l);
343
- let s = "";
344
- return l.currentChar() === "-" ? (l.next(), s += `-${te(l)}`) : s += te(l), l.currentChar() === Ye && C(ne.UNTERMINATED_CLOSING_BRACE, o(), 0), s;
345
- }
346
- function be(l) {
347
- return l !== ln && l !== Ie;
348
- }
349
- function ae(l) {
350
- M(l), R(l, "'");
351
- let s = "", c = "";
352
- for (; s = _(l, be); )
353
- s === "\\" ? c += le(l) : c += s;
354
- const I = l.currentChar();
355
- return I === Ie || I === Ye ? (C(ne.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, o(), 0), I === Ie && (l.next(), R(l, "'")), c) : (R(l, "'"), c);
356
- }
357
- function le(l) {
358
- const s = l.currentChar();
359
- switch (s) {
360
- case "\\":
361
- case "'":
362
- return l.next(), `\\${s}`;
363
- case "u":
364
- return Ae(l, s, 4);
365
- case "U":
366
- return Ae(l, s, 6);
367
- default:
368
- return C(ne.UNKNOWN_ESCAPE_SEQUENCE, o(), 0, s), "";
369
- }
370
- }
371
- function Ae(l, s, c) {
372
- R(l, s);
373
- let I = "";
374
- for (let x = 0; x < c; x++) {
375
- const G = Z(l);
376
- if (!G) {
377
- C(ne.INVALID_UNICODE_ESCAPE_SEQUENCE, o(), 0, `\\${s}${I}${l.currentChar()}`);
378
- break;
379
- }
380
- I += G;
381
- }
382
- return `\\${s}${I}`;
383
- }
384
- function B(l) {
385
- return l !== "{" && l !== "}" && l !== je && l !== Ie;
386
- }
387
- function fe(l) {
388
- M(l);
389
- let s = "", c = "";
390
- for (; s = _(l, B); )
391
- c += s;
392
- return c;
393
- }
394
- function Je(l) {
395
- let s = "", c = "";
396
- for (; s = P(l); )
397
- c += s;
398
- return c;
399
- }
400
- function Qe(l) {
401
- const s = (c) => {
402
- const I = l.currentChar();
403
- return I === "{" || I === "@" || I === "|" || I === "(" || I === ")" || !I || I === je ? c : (c += I, l.next(), s(c));
404
- };
405
- return s("");
406
- }
407
- function Ve(l) {
408
- M(l);
409
- const s = R(
410
- l,
411
- "|"
412
- /* TokenChars.Pipe */
413
- );
414
- return M(l), s;
415
- }
416
- function we(l, s) {
417
- let c = null;
418
- switch (l.currentChar()) {
419
- case "{":
420
- return s.braceNest >= 1 && C(ne.NOT_ALLOW_NEST_PLACEHOLDER, o(), 0), l.next(), c = T(
421
- s,
422
- 2,
423
- "{"
424
- /* TokenChars.BraceLeft */
425
- ), M(l), s.braceNest++, c;
426
- case "}":
427
- return s.braceNest > 0 && s.currentType === 2 && C(ne.EMPTY_PLACEHOLDER, o(), 0), l.next(), c = T(
428
- s,
429
- 3,
430
- "}"
431
- /* TokenChars.BraceRight */
432
- ), s.braceNest--, s.braceNest > 0 && M(l), s.inLinked && s.braceNest === 0 && (s.inLinked = !1), c;
433
- case "@":
434
- return s.braceNest > 0 && C(ne.UNTERMINATED_CLOSING_BRACE, o(), 0), c = Fe(l, s) || D(s), s.braceNest = 0, c;
435
- default: {
436
- let x = !0, G = !0, u = !0;
437
- if (H(l))
438
- return s.braceNest > 0 && C(ne.UNTERMINATED_CLOSING_BRACE, o(), 0), c = T(s, 1, Ve(l)), s.braceNest = 0, s.inLinked = !1, c;
439
- if (s.braceNest > 0 && (s.currentType === 4 || s.currentType === 5 || s.currentType === 6))
440
- return C(ne.UNTERMINATED_CLOSING_BRACE, o(), 0), s.braceNest = 0, We(l, s);
441
- if (x = S(l, s))
442
- return c = T(s, 4, me(l)), M(l), c;
443
- if (G = d(l, s))
444
- return c = T(s, 5, ve(l)), M(l), c;
445
- if (u = g(l, s))
446
- return c = T(s, 6, ae(l)), M(l), c;
447
- if (!x && !G && !u)
448
- return c = T(s, 12, fe(l)), C(ne.INVALID_TOKEN_IN_PLACEHOLDER, o(), 0, c.value), M(l), c;
449
- break;
450
- }
451
- }
452
- return c;
453
- }
454
- function Fe(l, s) {
455
- const { currentType: c } = s;
456
- let I = null;
457
- const x = l.currentChar();
458
- switch ((c === 7 || c === 8 || c === 11 || c === 9) && (x === Ie || x === je) && C(ne.INVALID_LINKED_FORMAT, o(), 0), x) {
459
- case "@":
460
- return l.next(), I = T(
461
- s,
462
- 7,
463
- "@"
464
- /* TokenChars.LinkedAlias */
465
- ), s.inLinked = !0, I;
466
- case ".":
467
- return M(l), l.next(), T(
468
- s,
469
- 8,
470
- "."
471
- /* TokenChars.LinkedDot */
472
- );
473
- case ":":
474
- return M(l), l.next(), T(
475
- s,
476
- 9,
477
- ":"
478
- /* TokenChars.LinkedDelimiter */
479
- );
480
- default:
481
- return H(l) ? (I = T(s, 1, Ve(l)), s.braceNest = 0, s.inLinked = !1, I) : y(l, s) || A(l, s) ? (M(l), Fe(l, s)) : v(l, s) ? (M(l), T(s, 11, Je(l))) : L(l, s) ? (M(l), x === "{" ? we(l, s) || I : T(s, 10, Qe(l))) : (c === 7 && C(ne.INVALID_LINKED_FORMAT, o(), 0), s.braceNest = 0, s.inLinked = !1, We(l, s));
482
- }
483
- }
484
- function We(l, s) {
485
- let c = {
486
- type: 13
487
- /* TokenTypes.EOF */
488
- };
489
- if (s.braceNest > 0)
490
- return we(l, s) || D(s);
491
- if (s.inLinked)
492
- return Fe(l, s) || D(s);
493
- switch (l.currentChar()) {
494
- case "{":
495
- return we(l, s) || D(s);
496
- case "}":
497
- return C(ne.UNBALANCED_CLOSING_BRACE, o(), 0), l.next(), T(
498
- s,
499
- 3,
500
- "}"
501
- /* TokenChars.BraceRight */
502
- );
503
- case "@":
504
- return Fe(l, s) || D(s);
505
- default: {
506
- if (H(l))
507
- return c = T(s, 1, Ve(l)), s.braceNest = 0, s.inLinked = !1, c;
508
- if (U(l))
509
- return T(s, 0, K(l));
510
- break;
511
- }
512
- }
513
- return c;
514
- }
515
- function Pe() {
516
- const { currentType: l, offset: s, startLoc: c, endLoc: I } = i;
517
- return i.lastType = l, i.lastOffset = s, i.lastStartLoc = c, i.lastEndLoc = I, i.offset = a(), i.startLoc = o(), r.currentChar() === Ye ? T(
518
- i,
519
- 13
520
- /* TokenTypes.EOF */
521
- ) : We(r, i);
522
- }
523
- return {
524
- nextToken: Pe,
525
- currentOffset: a,
526
- currentPosition: o,
527
- context: h
528
- };
529
- }
530
- const es = "parser", ts = /(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;
531
- function ns(e, t, n) {
532
- switch (e) {
533
- case "\\\\":
534
- return "\\";
535
- case "\\'":
536
- return "'";
537
- default: {
538
- const r = parseInt(t || n, 16);
539
- return r <= 55295 || r >= 57344 ? String.fromCodePoint(r) : "�";
540
- }
541
- }
542
- }
543
- function rs(e = {}) {
544
- const t = e.location !== !1, { onError: n } = e;
545
- function r(p, b, S, d, ...g) {
546
- const y = p.currentPosition();
547
- if (y.offset += d, y.column += d, n) {
548
- const v = t ? wt(S, y) : null, A = Ct(b, v, {
549
- domain: es,
550
- args: g
551
- });
552
- n(A);
553
- }
554
- }
555
- function a(p, b, S) {
556
- const d = { type: p };
557
- return t && (d.start = b, d.end = b, d.loc = { start: S, end: S }), d;
558
- }
559
- function o(p, b, S, d) {
560
- t && (p.end = b, p.loc && (p.loc.end = S));
561
- }
562
- function f(p, b) {
563
- const S = p.context(), d = a(3, S.offset, S.startLoc);
564
- return d.value = b, o(d, p.currentOffset(), p.currentPosition()), d;
565
- }
566
- function m(p, b) {
567
- const S = p.context(), { lastOffset: d, lastStartLoc: g } = S, y = a(5, d, g);
568
- return y.index = parseInt(b, 10), p.nextToken(), o(y, p.currentOffset(), p.currentPosition()), y;
569
- }
570
- function i(p, b) {
571
- const S = p.context(), { lastOffset: d, lastStartLoc: g } = S, y = a(4, d, g);
572
- return y.key = b, p.nextToken(), o(y, p.currentOffset(), p.currentPosition()), y;
573
- }
574
- function h(p, b) {
575
- const S = p.context(), { lastOffset: d, lastStartLoc: g } = S, y = a(9, d, g);
576
- return y.value = b.replace(ts, ns), p.nextToken(), o(y, p.currentOffset(), p.currentPosition()), y;
577
- }
578
- function E(p) {
579
- const b = p.nextToken(), S = p.context(), { lastOffset: d, lastStartLoc: g } = S, y = a(8, d, g);
580
- return b.type !== 11 ? (r(p, ne.UNEXPECTED_EMPTY_LINKED_MODIFIER, S.lastStartLoc, 0), y.value = "", o(y, d, g), {
581
- nextConsumeToken: b,
582
- node: y
583
- }) : (b.value == null && r(p, ne.UNEXPECTED_LEXICAL_ANALYSIS, S.lastStartLoc, 0, Re(b)), y.value = b.value || "", o(y, p.currentOffset(), p.currentPosition()), {
584
- node: y
585
- });
586
- }
587
- function C(p, b) {
588
- const S = p.context(), d = a(7, S.offset, S.startLoc);
589
- return d.value = b, o(d, p.currentOffset(), p.currentPosition()), d;
590
- }
591
- function T(p) {
592
- const b = p.context(), S = a(6, b.offset, b.startLoc);
593
- let d = p.nextToken();
594
- if (d.type === 8) {
595
- const g = E(p);
596
- S.modifier = g.node, d = g.nextConsumeToken || p.nextToken();
597
- }
598
- switch (d.type !== 9 && r(p, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, Re(d)), d = p.nextToken(), d.type === 2 && (d = p.nextToken()), d.type) {
599
- case 10:
600
- d.value == null && r(p, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, Re(d)), S.key = C(p, d.value || "");
601
- break;
602
- case 4:
603
- d.value == null && r(p, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, Re(d)), S.key = i(p, d.value || "");
604
- break;
605
- case 5:
606
- d.value == null && r(p, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, Re(d)), S.key = m(p, d.value || "");
607
- break;
608
- case 6:
609
- d.value == null && r(p, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, Re(d)), S.key = h(p, d.value || "");
610
- break;
611
- default: {
612
- r(p, ne.UNEXPECTED_EMPTY_LINKED_KEY, b.lastStartLoc, 0);
613
- const g = p.context(), y = a(7, g.offset, g.startLoc);
614
- return y.value = "", o(y, g.offset, g.startLoc), S.key = y, o(S, g.offset, g.startLoc), {
615
- nextConsumeToken: d,
616
- node: S
617
- };
618
- }
619
- }
620
- return o(S, p.currentOffset(), p.currentPosition()), {
621
- node: S
622
- };
623
- }
624
- function D(p) {
625
- const b = p.context(), S = b.currentType === 1 ? p.currentOffset() : b.offset, d = b.currentType === 1 ? b.endLoc : b.startLoc, g = a(2, S, d);
626
- g.items = [];
627
- let y = null;
628
- do {
629
- const L = y || p.nextToken();
630
- switch (y = null, L.type) {
631
- case 0:
632
- L.value == null && r(p, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, Re(L)), g.items.push(f(p, L.value || ""));
633
- break;
634
- case 5:
635
- L.value == null && r(p, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, Re(L)), g.items.push(m(p, L.value || ""));
636
- break;
637
- case 4:
638
- L.value == null && r(p, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, Re(L)), g.items.push(i(p, L.value || ""));
639
- break;
640
- case 6:
641
- L.value == null && r(p, ne.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, Re(L)), g.items.push(h(p, L.value || ""));
642
- break;
643
- case 7: {
644
- const H = T(p);
645
- g.items.push(H.node), y = H.nextConsumeToken || null;
646
- break;
647
- }
648
- }
649
- } while (b.currentType !== 13 && b.currentType !== 1);
650
- const v = b.currentType === 1 ? b.lastOffset : p.currentOffset(), A = b.currentType === 1 ? b.lastEndLoc : p.currentPosition();
651
- return o(g, v, A), g;
652
- }
653
- function R(p, b, S, d) {
654
- const g = p.context();
655
- let y = d.items.length === 0;
656
- const v = a(1, b, S);
657
- v.cases = [], v.cases.push(d);
658
- do {
659
- const A = D(p);
660
- y || (y = A.items.length === 0), v.cases.push(A);
661
- } while (g.currentType !== 13);
662
- return y && r(p, ne.MUST_HAVE_MESSAGES_IN_PLURAL, S, 0), o(v, p.currentOffset(), p.currentPosition()), v;
663
- }
664
- function k(p) {
665
- const b = p.context(), { offset: S, startLoc: d } = b, g = D(p);
666
- return b.currentType === 13 ? g : R(p, S, d, g);
667
- }
668
- function M(p) {
669
- const b = qr(p, ge({}, e)), S = b.context(), d = a(0, S.offset, S.startLoc);
670
- return t && d.loc && (d.loc.source = p), d.body = k(b), e.onCacheKey && (d.cacheKey = e.onCacheKey(p)), S.currentType !== 13 && r(b, ne.UNEXPECTED_LEXICAL_ANALYSIS, S.lastStartLoc, 0, p[S.offset] || ""), o(d, b.currentOffset(), b.currentPosition()), d;
671
- }
672
- return { parse: M };
673
- }
674
- function Re(e) {
675
- if (e.type === 13)
676
- return "EOF";
677
- const t = (e.value || "").replace(/\r?\n/gu, "\\n");
678
- return t.length > 10 ? t.slice(0, 9) + "…" : t;
679
- }
680
- function ss(e, t = {}) {
681
- const n = {
682
- ast: e,
683
- helpers: /* @__PURE__ */ new Set()
684
- };
685
- return { context: () => n, helper: (o) => (n.helpers.add(o), o) };
686
- }
687
- function cn(e, t) {
688
- for (let n = 0; n < e.length; n++)
689
- Jt(e[n], t);
690
- }
691
- function Jt(e, t) {
692
- switch (e.type) {
693
- case 1:
694
- cn(e.cases, t), t.helper(
695
- "plural"
696
- /* HelperNameMap.PLURAL */
697
- );
698
- break;
699
- case 2:
700
- cn(e.items, t);
701
- break;
702
- case 6: {
703
- Jt(e.key, t), t.helper(
704
- "linked"
705
- /* HelperNameMap.LINKED */
706
- ), t.helper(
707
- "type"
708
- /* HelperNameMap.TYPE */
709
- );
710
- break;
711
- }
712
- case 5:
713
- t.helper(
714
- "interpolate"
715
- /* HelperNameMap.INTERPOLATE */
716
- ), t.helper(
717
- "list"
718
- /* HelperNameMap.LIST */
719
- );
720
- break;
721
- case 4:
722
- t.helper(
723
- "interpolate"
724
- /* HelperNameMap.INTERPOLATE */
725
- ), t.helper(
726
- "named"
727
- /* HelperNameMap.NAMED */
728
- );
729
- break;
730
- }
731
- }
732
- function as(e, t = {}) {
733
- const n = ss(e);
734
- n.helper(
735
- "normalize"
736
- /* HelperNameMap.NORMALIZE */
737
- ), e.body && Jt(e.body, n);
738
- const r = n.context();
739
- e.helpers = Array.from(r.helpers);
740
- }
741
- function os(e) {
742
- const t = e.body;
743
- return t.type === 2 ? un(t) : t.cases.forEach((n) => un(n)), e;
744
- }
745
- function un(e) {
746
- if (e.items.length === 1) {
747
- const t = e.items[0];
748
- (t.type === 3 || t.type === 9) && (e.static = t.value, delete t.value);
749
- } else {
750
- const t = [];
751
- for (let n = 0; n < e.items.length; n++) {
752
- const r = e.items[n];
753
- if (!(r.type === 3 || r.type === 9) || r.value == null)
754
- break;
755
- t.push(r.value);
756
- }
757
- if (t.length === e.items.length) {
758
- e.static = Ht(t);
759
- for (let n = 0; n < e.items.length; n++) {
760
- const r = e.items[n];
761
- (r.type === 3 || r.type === 9) && delete r.value;
762
- }
763
- }
764
- }
765
- }
766
- function et(e) {
767
- switch (e.t = e.type, e.type) {
768
- case 0: {
769
- const t = e;
770
- et(t.body), t.b = t.body, delete t.body;
771
- break;
772
- }
773
- case 1: {
774
- const t = e, n = t.cases;
775
- for (let r = 0; r < n.length; r++)
776
- et(n[r]);
777
- t.c = n, delete t.cases;
778
- break;
779
- }
780
- case 2: {
781
- const t = e, n = t.items;
782
- for (let r = 0; r < n.length; r++)
783
- et(n[r]);
784
- t.i = n, delete t.items, t.static && (t.s = t.static, delete t.static);
785
- break;
786
- }
787
- case 3:
788
- case 9:
789
- case 8:
790
- case 7: {
791
- const t = e;
792
- t.value && (t.v = t.value, delete t.value);
793
- break;
794
- }
795
- case 6: {
796
- const t = e;
797
- et(t.key), t.k = t.key, delete t.key, t.modifier && (et(t.modifier), t.m = t.modifier, delete t.modifier);
798
- break;
799
- }
800
- case 5: {
801
- const t = e;
802
- t.i = t.index, delete t.index;
803
- break;
804
- }
805
- case 4: {
806
- const t = e;
807
- t.k = t.key, delete t.key;
808
- break;
809
- }
810
- }
811
- delete e.type;
812
- }
813
- function ls(e, t) {
814
- const { filename: n, breakLineCode: r, needIndent: a } = t, o = t.location !== !1, f = {
815
- filename: n,
816
- code: "",
817
- column: 1,
818
- line: 1,
819
- offset: 0,
820
- map: void 0,
821
- breakLineCode: r,
822
- needIndent: a,
823
- indentLevel: 0
824
- };
825
- o && e.loc && (f.source = e.loc.source);
826
- const m = () => f;
827
- function i(k, M) {
828
- f.code += k;
829
- }
830
- function h(k, M = !0) {
831
- const p = M ? r : "";
832
- i(a ? p + " ".repeat(k) : p);
833
- }
834
- function E(k = !0) {
835
- const M = ++f.indentLevel;
836
- k && h(M);
837
- }
838
- function C(k = !0) {
839
- const M = --f.indentLevel;
840
- k && h(M);
841
- }
842
- function T() {
843
- h(f.indentLevel);
844
- }
845
- return {
846
- context: m,
847
- push: i,
848
- indent: E,
849
- deindent: C,
850
- newline: T,
851
- helper: (k) => `_${k}`,
852
- needIndent: () => f.needIndent
853
- };
854
- }
855
- function is(e, t) {
856
- const { helper: n } = e;
857
- e.push(`${n(
858
- "linked"
859
- /* HelperNameMap.LINKED */
860
- )}(`), at(e, t.key), t.modifier ? (e.push(", "), at(e, t.modifier), e.push(", _type")) : e.push(", undefined, _type"), e.push(")");
861
- }
862
- function cs(e, t) {
863
- const { helper: n, needIndent: r } = e;
864
- e.push(`${n(
865
- "normalize"
866
- /* HelperNameMap.NORMALIZE */
867
- )}([`), e.indent(r());
868
- const a = t.items.length;
869
- for (let o = 0; o < a && (at(e, t.items[o]), o !== a - 1); o++)
870
- e.push(", ");
871
- e.deindent(r()), e.push("])");
872
- }
873
- function us(e, t) {
874
- const { helper: n, needIndent: r } = e;
875
- if (t.cases.length > 1) {
876
- e.push(`${n(
877
- "plural"
878
- /* HelperNameMap.PLURAL */
879
- )}([`), e.indent(r());
880
- const a = t.cases.length;
881
- for (let o = 0; o < a && (at(e, t.cases[o]), o !== a - 1); o++)
882
- e.push(", ");
883
- e.deindent(r()), e.push("])");
884
- }
885
- }
886
- function ds(e, t) {
887
- t.body ? at(e, t.body) : e.push("null");
888
- }
889
- function at(e, t) {
890
- const { helper: n } = e;
891
- switch (t.type) {
892
- case 0:
893
- ds(e, t);
894
- break;
895
- case 1:
896
- us(e, t);
897
- break;
898
- case 2:
899
- cs(e, t);
900
- break;
901
- case 6:
902
- is(e, t);
903
- break;
904
- case 8:
905
- e.push(JSON.stringify(t.value), t);
906
- break;
907
- case 7:
908
- e.push(JSON.stringify(t.value), t);
909
- break;
910
- case 5:
911
- e.push(`${n(
912
- "interpolate"
913
- /* HelperNameMap.INTERPOLATE */
914
- )}(${n(
915
- "list"
916
- /* HelperNameMap.LIST */
917
- )}(${t.index}))`, t);
918
- break;
919
- case 4:
920
- e.push(`${n(
921
- "interpolate"
922
- /* HelperNameMap.INTERPOLATE */
923
- )}(${n(
924
- "named"
925
- /* HelperNameMap.NAMED */
926
- )}(${JSON.stringify(t.key)}))`, t);
927
- break;
928
- case 9:
929
- e.push(JSON.stringify(t.value), t);
930
- break;
931
- case 3:
932
- e.push(JSON.stringify(t.value), t);
933
- break;
934
- }
935
- }
936
- const ms = (e, t = {}) => {
937
- const n = W(t.mode) ? t.mode : "normal", r = W(t.filename) ? t.filename : "message.intl";
938
- t.sourceMap;
939
- const a = t.breakLineCode != null ? t.breakLineCode : n === "arrow" ? ";" : `
940
- `, o = t.needIndent ? t.needIndent : n !== "arrow", f = e.helpers || [], m = ls(e, {
941
- filename: r,
942
- breakLineCode: a,
943
- needIndent: o
944
- });
945
- m.push(n === "normal" ? "function __msg__ (ctx) {" : "(ctx) => {"), m.indent(o), f.length > 0 && (m.push(`const { ${Ht(f.map((E) => `${E}: _${E}`), ", ")} } = ctx`), m.newline()), m.push("return "), at(m, e), m.deindent(o), m.push("}"), delete e.helpers;
946
- const { code: i, map: h } = m.context();
947
- return {
948
- ast: e,
949
- code: i,
950
- map: h ? h.toJSON() : void 0
951
- // eslint-disable-line @typescript-eslint/no-explicit-any
952
- };
953
- };
954
- function fs(e, t = {}) {
955
- const n = ge({}, t), r = !!n.jit, a = !!n.minify, o = n.optimize == null ? !0 : n.optimize, m = rs(n).parse(e);
956
- return r ? (o && os(m), a && et(m), { ast: m, code: "" }) : (as(m, n), ms(m, n));
957
- }
958
- var _s = { env: { NODE_ENV: "production" } };
959
- function ps() {
960
- typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" && ($e().__INTLIFY_PROD_DEVTOOLS__ = !1), typeof __INTLIFY_DROP_MESSAGE_COMPILER__ != "boolean" && ($e().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1);
961
- }
962
- function Lt(e) {
963
- return (n) => vs(n, e);
964
- }
965
- function vs(e, t) {
966
- const n = hs(t);
967
- if (n == null)
968
- throw ct(
969
- 0
970
- /* NodeTypes.Resource */
971
- );
972
- if ($t(n) === 1) {
973
- const o = Is(n);
974
- return e.plural(o.reduce((f, m) => [
975
- ...f,
976
- dn(e, m)
977
- ], []));
978
- } else
979
- return dn(e, n);
980
- }
981
- const bs = ["b", "body"];
982
- function hs(e) {
983
- return Xe(e, bs);
984
- }
985
- const gs = ["c", "cases"];
986
- function Is(e) {
987
- return Xe(e, gs, []);
988
- }
989
- function dn(e, t) {
990
- const n = Es(t);
991
- if (n != null)
992
- return e.type === "text" ? n : e.normalize([n]);
993
- {
994
- const r = Cs(t).reduce((a, o) => [...a, Ft(e, o)], []);
995
- return e.normalize(r);
996
- }
997
- }
998
- const ys = ["s", "static"];
999
- function Es(e) {
1000
- return Xe(e, ys);
1001
- }
1002
- const Ns = ["i", "items"];
1003
- function Cs(e) {
1004
- return Xe(e, Ns, []);
1005
- }
1006
- function Ft(e, t) {
1007
- const n = $t(t);
1008
- switch (n) {
1009
- case 3:
1010
- return _t(t, n);
1011
- case 9:
1012
- return _t(t, n);
1013
- case 4: {
1014
- const r = t;
1015
- if (Le(r, "k") && r.k)
1016
- return e.interpolate(e.named(r.k));
1017
- if (Le(r, "key") && r.key)
1018
- return e.interpolate(e.named(r.key));
1019
- throw ct(n);
1020
- }
1021
- case 5: {
1022
- const r = t;
1023
- if (Le(r, "i") && he(r.i))
1024
- return e.interpolate(e.list(r.i));
1025
- if (Le(r, "index") && he(r.index))
1026
- return e.interpolate(e.list(r.index));
1027
- throw ct(n);
1028
- }
1029
- case 6: {
1030
- const r = t, a = Ls(r), o = As(r);
1031
- return e.linked(Ft(e, o), a ? Ft(e, a) : void 0, e.type);
1032
- }
1033
- case 7:
1034
- return _t(t, n);
1035
- case 8:
1036
- return _t(t, n);
1037
- default:
1038
- throw new Error(`unhandled node on format message part: ${n}`);
1039
- }
1040
- }
1041
- const Ts = ["t", "type"];
1042
- function $t(e) {
1043
- return Xe(e, Ts);
1044
- }
1045
- const Os = ["v", "value"];
1046
- function _t(e, t) {
1047
- const n = Xe(e, Os);
1048
- if (n)
1049
- return n;
1050
- throw ct(t);
1051
- }
1052
- const Ss = ["m", "modifier"];
1053
- function Ls(e) {
1054
- return Xe(e, Ss);
1055
- }
1056
- const ks = ["k", "key"];
1057
- function As(e) {
1058
- const t = Xe(e, ks);
1059
- if (t)
1060
- return t;
1061
- throw ct(
1062
- 6
1063
- /* NodeTypes.Linked */
1064
- );
1065
- }
1066
- function Xe(e, t, n) {
1067
- for (let r = 0; r < t.length; r++) {
1068
- const a = t[r];
1069
- if (Le(e, a) && e[a] != null)
1070
- return e[a];
1071
- }
1072
- return n;
1073
- }
1074
- function ct(e) {
1075
- return new Error(`unhandled node type: ${e}`);
1076
- }
1077
- const Rs = (e) => e;
1078
- let pt = se();
1079
- function ot(e) {
1080
- return ee(e) && $t(e) === 0 && (Le(e, "b") || Le(e, "body"));
1081
- }
1082
- function Ms(e, t = {}) {
1083
- let n = !1;
1084
- const r = t.onError || Xr;
1085
- return t.onError = (a) => {
1086
- n = !0, r(a);
1087
- }, { ...fs(e, t), detectError: n };
1088
- }
1089
- // @__NO_SIDE_EFFECTS__
1090
- function Ds(e, t) {
1091
- if (!__INTLIFY_DROP_MESSAGE_COMPILER__ && W(e)) {
1092
- _e(t.warnHtmlMessage) && t.warnHtmlMessage;
1093
- const r = (t.onCacheKey || Rs)(e), a = pt[r];
1094
- if (a)
1095
- return a;
1096
- const { ast: o, detectError: f } = Ms(e, {
1097
- ...t,
1098
- location: _s.env.NODE_ENV !== "production",
1099
- jit: !0
1100
- }), m = Lt(o);
1101
- return f ? m : pt[r] = m;
1102
- } else {
1103
- const n = e.cacheKey;
1104
- if (n) {
1105
- const r = pt[n];
1106
- return r || (pt[n] = Lt(e));
1107
- } else
1108
- return Lt(e);
1109
- }
1110
- }
1111
- let ut = null;
1112
- function ws(e) {
1113
- ut = e;
1114
- }
1115
- function Fs(e, t, n) {
1116
- ut && ut.emit("i18n:init", {
1117
- timestamp: Date.now(),
1118
- i18n: e,
1119
- version: t,
1120
- meta: n
1121
- });
1122
- }
1123
- const Ps = /* @__PURE__ */ js("function:translate");
1124
- function js(e) {
1125
- return (t) => ut && ut.emit(e, t);
1126
- }
1127
- const xe = {
1128
- INVALID_ARGUMENT: Zr,
1129
- // 17
1130
- INVALID_DATE_ARGUMENT: 18,
1131
- INVALID_ISO_DATE_ARGUMENT: 19,
1132
- NOT_SUPPORT_LOCALE_PROMISE_VALUE: 21,
1133
- NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 22,
1134
- NOT_SUPPORT_LOCALE_TYPE: 23
1135
- }, xs = 24;
1136
- function Ue(e) {
1137
- return Ct(e, null, void 0);
1138
- }
1139
- function zt(e, t) {
1140
- return t.locale != null ? mn(t.locale) : mn(e.locale);
1141
- }
1142
- let kt;
1143
- function mn(e) {
1144
- if (W(e))
1145
- return e;
1146
- if (ue(e)) {
1147
- if (e.resolvedOnce && kt != null)
1148
- return kt;
1149
- if (e.constructor.name === "Function") {
1150
- const t = e();
1151
- if (Wr(t))
1152
- throw Ue(xe.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
1153
- return kt = t;
1154
- } else
1155
- throw Ue(xe.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
1156
- } else
1157
- throw Ue(xe.NOT_SUPPORT_LOCALE_TYPE);
1158
- }
1159
- function Us(e, t, n) {
1160
- return [.../* @__PURE__ */ new Set([
1161
- n,
1162
- ...pe(t) ? t : ee(t) ? Object.keys(t) : W(t) ? [t] : [n]
1163
- ])];
1164
- }
1165
- function Hn(e, t, n) {
1166
- const r = W(n) ? n : Et, a = e;
1167
- a.__localeChainCache || (a.__localeChainCache = /* @__PURE__ */ new Map());
1168
- let o = a.__localeChainCache.get(r);
1169
- if (!o) {
1170
- o = [];
1171
- let f = [n];
1172
- for (; pe(f); )
1173
- f = fn(o, f, t);
1174
- const m = pe(t) || !q(t) ? t : t.default ? t.default : null;
1175
- f = W(m) ? [m] : m, pe(f) && fn(o, f, !1), a.__localeChainCache.set(r, o);
1176
- }
1177
- return o;
1178
- }
1179
- function fn(e, t, n) {
1180
- let r = !0;
1181
- for (let a = 0; a < t.length && _e(r); a++) {
1182
- const o = t[a];
1183
- W(o) && (r = Vs(e, t[a], n));
1184
- }
1185
- return r;
1186
- }
1187
- function Vs(e, t, n) {
1188
- let r;
1189
- const a = t.split("-");
1190
- do {
1191
- const o = a.join("-");
1192
- r = Ws(e, o, n), a.splice(-1, 1);
1193
- } while (a.length && r === !0);
1194
- return r;
1195
- }
1196
- function Ws(e, t, n) {
1197
- let r = !1;
1198
- if (!e.includes(t) && (r = !0, t)) {
1199
- r = t[t.length - 1] !== "!";
1200
- const a = t.replace(/!/g, "");
1201
- e.push(a), (pe(n) || q(n)) && n[a] && (r = n[a]);
1202
- }
1203
- return r;
1204
- }
1205
- const He = [];
1206
- He[
1207
- 0
1208
- /* States.BEFORE_PATH */
1209
- ] = {
1210
- w: [
1211
- 0
1212
- /* States.BEFORE_PATH */
1213
- ],
1214
- i: [
1215
- 3,
1216
- 0
1217
- /* Actions.APPEND */
1218
- ],
1219
- "[": [
1220
- 4
1221
- /* States.IN_SUB_PATH */
1222
- ],
1223
- o: [
1224
- 7
1225
- /* States.AFTER_PATH */
1226
- ]
1227
- };
1228
- He[
1229
- 1
1230
- /* States.IN_PATH */
1231
- ] = {
1232
- w: [
1233
- 1
1234
- /* States.IN_PATH */
1235
- ],
1236
- ".": [
1237
- 2
1238
- /* States.BEFORE_IDENT */
1239
- ],
1240
- "[": [
1241
- 4
1242
- /* States.IN_SUB_PATH */
1243
- ],
1244
- o: [
1245
- 7
1246
- /* States.AFTER_PATH */
1247
- ]
1248
- };
1249
- He[
1250
- 2
1251
- /* States.BEFORE_IDENT */
1252
- ] = {
1253
- w: [
1254
- 2
1255
- /* States.BEFORE_IDENT */
1256
- ],
1257
- i: [
1258
- 3,
1259
- 0
1260
- /* Actions.APPEND */
1261
- ],
1262
- 0: [
1263
- 3,
1264
- 0
1265
- /* Actions.APPEND */
1266
- ]
1267
- };
1268
- He[
1269
- 3
1270
- /* States.IN_IDENT */
1271
- ] = {
1272
- i: [
1273
- 3,
1274
- 0
1275
- /* Actions.APPEND */
1276
- ],
1277
- 0: [
1278
- 3,
1279
- 0
1280
- /* Actions.APPEND */
1281
- ],
1282
- w: [
1283
- 1,
1284
- 1
1285
- /* Actions.PUSH */
1286
- ],
1287
- ".": [
1288
- 2,
1289
- 1
1290
- /* Actions.PUSH */
1291
- ],
1292
- "[": [
1293
- 4,
1294
- 1
1295
- /* Actions.PUSH */
1296
- ],
1297
- o: [
1298
- 7,
1299
- 1
1300
- /* Actions.PUSH */
1301
- ]
1302
- };
1303
- He[
1304
- 4
1305
- /* States.IN_SUB_PATH */
1306
- ] = {
1307
- "'": [
1308
- 5,
1309
- 0
1310
- /* Actions.APPEND */
1311
- ],
1312
- '"': [
1313
- 6,
1314
- 0
1315
- /* Actions.APPEND */
1316
- ],
1317
- "[": [
1318
- 4,
1319
- 2
1320
- /* Actions.INC_SUB_PATH_DEPTH */
1321
- ],
1322
- "]": [
1323
- 1,
1324
- 3
1325
- /* Actions.PUSH_SUB_PATH */
1326
- ],
1327
- o: 8,
1328
- l: [
1329
- 4,
1330
- 0
1331
- /* Actions.APPEND */
1332
- ]
1333
- };
1334
- He[
1335
- 5
1336
- /* States.IN_SINGLE_QUOTE */
1337
- ] = {
1338
- "'": [
1339
- 4,
1340
- 0
1341
- /* Actions.APPEND */
1342
- ],
1343
- o: 8,
1344
- l: [
1345
- 5,
1346
- 0
1347
- /* Actions.APPEND */
1348
- ]
1349
- };
1350
- He[
1351
- 6
1352
- /* States.IN_DOUBLE_QUOTE */
1353
- ] = {
1354
- '"': [
1355
- 4,
1356
- 0
1357
- /* Actions.APPEND */
1358
- ],
1359
- o: 8,
1360
- l: [
1361
- 6,
1362
- 0
1363
- /* Actions.APPEND */
1364
- ]
1365
- };
1366
- const Gs = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
1367
- function Ys(e) {
1368
- return Gs.test(e);
1369
- }
1370
- function Bs(e) {
1371
- const t = e.charCodeAt(0), n = e.charCodeAt(e.length - 1);
1372
- return t === n && (t === 34 || t === 39) ? e.slice(1, -1) : e;
1373
- }
1374
- function Zs(e) {
1375
- if (e == null)
1376
- return "o";
1377
- switch (e.charCodeAt(0)) {
1378
- case 91:
1379
- case 93:
1380
- case 46:
1381
- case 34:
1382
- case 39:
1383
- return e;
1384
- case 95:
1385
- case 36:
1386
- case 45:
1387
- return "i";
1388
- case 9:
1389
- case 10:
1390
- case 13:
1391
- case 160:
1392
- case 65279:
1393
- case 8232:
1394
- case 8233:
1395
- return "w";
1396
- }
1397
- return "i";
1398
- }
1399
- function Xs(e) {
1400
- const t = e.trim();
1401
- return e.charAt(0) === "0" && isNaN(parseInt(e)) ? !1 : Ys(t) ? Bs(t) : "*" + t;
1402
- }
1403
- function Hs(e) {
1404
- const t = [];
1405
- let n = -1, r = 0, a = 0, o, f, m, i, h, E, C;
1406
- const T = [];
1407
- T[
1408
- 0
1409
- /* Actions.APPEND */
1410
- ] = () => {
1411
- f === void 0 ? f = m : f += m;
1412
- }, T[
1413
- 1
1414
- /* Actions.PUSH */
1415
- ] = () => {
1416
- f !== void 0 && (t.push(f), f = void 0);
1417
- }, T[
1418
- 2
1419
- /* Actions.INC_SUB_PATH_DEPTH */
1420
- ] = () => {
1421
- T[
1422
- 0
1423
- /* Actions.APPEND */
1424
- ](), a++;
1425
- }, T[
1426
- 3
1427
- /* Actions.PUSH_SUB_PATH */
1428
- ] = () => {
1429
- if (a > 0)
1430
- a--, r = 4, T[
1431
- 0
1432
- /* Actions.APPEND */
1433
- ]();
1434
- else {
1435
- if (a = 0, f === void 0 || (f = Xs(f), f === !1))
1436
- return !1;
1437
- T[
1438
- 1
1439
- /* Actions.PUSH */
1440
- ]();
1441
- }
1442
- };
1443
- function D() {
1444
- const R = e[n + 1];
1445
- if (r === 5 && R === "'" || r === 6 && R === '"')
1446
- return n++, m = "\\" + R, T[
1447
- 0
1448
- /* Actions.APPEND */
1449
- ](), !0;
1450
- }
1451
- for (; r !== null; )
1452
- if (n++, o = e[n], !(o === "\\" && D())) {
1453
- if (i = Zs(o), C = He[r], h = C[i] || C.l || 8, h === 8 || (r = h[0], h[1] !== void 0 && (E = T[h[1]], E && (m = o, E() === !1))))
1454
- return;
1455
- if (r === 7)
1456
- return t;
1457
- }
1458
- }
1459
- const _n = /* @__PURE__ */ new Map();
1460
- function Js(e, t) {
1461
- return ee(e) ? e[t] : null;
1462
- }
1463
- function $s(e, t) {
1464
- if (!ee(e))
1465
- return null;
1466
- let n = _n.get(t);
1467
- if (n || (n = Hs(t), n && _n.set(t, n)), !n)
1468
- return null;
1469
- const r = n.length;
1470
- let a = e, o = 0;
1471
- for (; o < r; ) {
1472
- const f = a[n[o]];
1473
- if (f === void 0 || ue(a))
1474
- return null;
1475
- a = f, o++;
1476
- }
1477
- return a;
1478
- }
1479
- const zs = "10.0.5", Tt = -1, Et = "en-US", pn = "", vn = (e) => `${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;
1480
- function Ks() {
1481
- return {
1482
- upper: (e, t) => t === "text" && W(e) ? e.toUpperCase() : t === "vnode" && ee(e) && "__v_isVNode" in e ? e.children.toUpperCase() : e,
1483
- lower: (e, t) => t === "text" && W(e) ? e.toLowerCase() : t === "vnode" && ee(e) && "__v_isVNode" in e ? e.children.toLowerCase() : e,
1484
- capitalize: (e, t) => t === "text" && W(e) ? vn(e) : t === "vnode" && ee(e) && "__v_isVNode" in e ? vn(e.children) : e
1485
- };
1486
- }
1487
- let Jn;
1488
- function Qs(e) {
1489
- Jn = e;
1490
- }
1491
- let $n;
1492
- function qs(e) {
1493
- $n = e;
1494
- }
1495
- let zn;
1496
- function ea(e) {
1497
- zn = e;
1498
- }
1499
- let Kn = null;
1500
- const ta = /* @__NO_SIDE_EFFECTS__ */ (e) => {
1501
- Kn = e;
1502
- }, na = /* @__NO_SIDE_EFFECTS__ */ () => Kn;
1503
- let Qn = null;
1504
- const bn = (e) => {
1505
- Qn = e;
1506
- }, ra = () => Qn;
1507
- let hn = 0;
1508
- function sa(e = {}) {
1509
- const t = ue(e.onWarn) ? e.onWarn : Yr, n = W(e.version) ? e.version : zs, r = W(e.locale) || ue(e.locale) ? e.locale : Et, a = ue(r) ? Et : r, o = pe(e.fallbackLocale) || q(e.fallbackLocale) || W(e.fallbackLocale) || e.fallbackLocale === !1 ? e.fallbackLocale : a, f = q(e.messages) ? e.messages : At(a), m = q(e.datetimeFormats) ? e.datetimeFormats : At(a), i = q(e.numberFormats) ? e.numberFormats : At(a), h = ge(se(), e.modifiers, Ks()), E = e.pluralRules || se(), C = ue(e.missing) ? e.missing : null, T = _e(e.missingWarn) || yt(e.missingWarn) ? e.missingWarn : !0, D = _e(e.fallbackWarn) || yt(e.fallbackWarn) ? e.fallbackWarn : !0, R = !!e.fallbackFormat, k = !!e.unresolving, M = ue(e.postTranslation) ? e.postTranslation : null, p = q(e.processor) ? e.processor : null, b = _e(e.warnHtmlMessage) ? e.warnHtmlMessage : !0, S = !!e.escapeParameter, d = ue(e.messageCompiler) ? e.messageCompiler : Jn, g = ue(e.messageResolver) ? e.messageResolver : $n || Js, y = ue(e.localeFallbacker) ? e.localeFallbacker : zn || Us, v = ee(e.fallbackContext) ? e.fallbackContext : void 0, A = e, L = ee(A.__datetimeFormatters) ? A.__datetimeFormatters : /* @__PURE__ */ new Map(), H = ee(A.__numberFormatters) ? A.__numberFormatters : /* @__PURE__ */ new Map(), U = ee(A.__meta) ? A.__meta : {};
1510
- hn++;
1511
- const _ = {
1512
- version: n,
1513
- cid: hn,
1514
- locale: r,
1515
- fallbackLocale: o,
1516
- messages: f,
1517
- modifiers: h,
1518
- pluralRules: E,
1519
- missing: C,
1520
- missingWarn: T,
1521
- fallbackWarn: D,
1522
- fallbackFormat: R,
1523
- unresolving: k,
1524
- postTranslation: M,
1525
- processor: p,
1526
- warnHtmlMessage: b,
1527
- escapeParameter: S,
1528
- messageCompiler: d,
1529
- messageResolver: g,
1530
- localeFallbacker: y,
1531
- fallbackContext: v,
1532
- onWarn: t,
1533
- __meta: U
1534
- };
1535
- return _.datetimeFormats = m, _.numberFormats = i, _.__datetimeFormatters = L, _.__numberFormatters = H, __INTLIFY_PROD_DEVTOOLS__ && Fs(_, n, U), _;
1536
- }
1537
- const At = (e) => ({ [e]: se() });
1538
- function Kt(e, t, n, r, a) {
1539
- const { missing: o, onWarn: f } = e;
1540
- if (o !== null) {
1541
- const m = o(e, n, t, a);
1542
- return W(m) ? m : t;
1543
- } else
1544
- return t;
1545
- }
1546
- function it(e, t, n) {
1547
- const r = e;
1548
- r.__localeChainCache = /* @__PURE__ */ new Map(), e.localeFallbacker(e, n, t);
1549
- }
1550
- function aa(e, t) {
1551
- return e === t ? !1 : e.split("-")[0] === t.split("-")[0];
1552
- }
1553
- function oa(e, t) {
1554
- const n = t.indexOf(e);
1555
- if (n === -1)
1556
- return !1;
1557
- for (let r = n + 1; r < t.length; r++)
1558
- if (aa(e, t[r]))
1559
- return !0;
1560
- return !1;
1561
- }
1562
- function gn(e, ...t) {
1563
- const { datetimeFormats: n, unresolving: r, fallbackLocale: a, onWarn: o, localeFallbacker: f } = e, { __datetimeFormatters: m } = e, [i, h, E, C] = Pt(...t), T = _e(E.missingWarn) ? E.missingWarn : e.missingWarn;
1564
- _e(E.fallbackWarn) ? E.fallbackWarn : e.fallbackWarn;
1565
- const D = !!E.part, R = zt(e, E), k = f(
1566
- e,
1567
- // eslint-disable-line @typescript-eslint/no-explicit-any
1568
- a,
1569
- R
1570
- );
1571
- if (!W(i) || i === "")
1572
- return new Intl.DateTimeFormat(R, C).format(h);
1573
- let M = {}, p, b = null;
1574
- const S = "datetime format";
1575
- for (let y = 0; y < k.length && (p = k[y], M = n[p] || {}, b = M[i], !q(b)); y++)
1576
- Kt(e, i, p, T, S);
1577
- if (!q(b) || !W(p))
1578
- return r ? Tt : i;
1579
- let d = `${p}__${i}`;
1580
- Nt(C) || (d = `${d}__${JSON.stringify(C)}`);
1581
- let g = m.get(d);
1582
- return g || (g = new Intl.DateTimeFormat(p, ge({}, b, C)), m.set(d, g)), D ? g.formatToParts(h) : g.format(h);
1583
- }
1584
- const qn = [
1585
- "localeMatcher",
1586
- "weekday",
1587
- "era",
1588
- "year",
1589
- "month",
1590
- "day",
1591
- "hour",
1592
- "minute",
1593
- "second",
1594
- "timeZoneName",
1595
- "formatMatcher",
1596
- "hour12",
1597
- "timeZone",
1598
- "dateStyle",
1599
- "timeStyle",
1600
- "calendar",
1601
- "dayPeriod",
1602
- "numberingSystem",
1603
- "hourCycle",
1604
- "fractionalSecondDigits"
1605
- ];
1606
- function Pt(...e) {
1607
- const [t, n, r, a] = e, o = se();
1608
- let f = se(), m;
1609
- if (W(t)) {
1610
- const i = t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);
1611
- if (!i)
1612
- throw Ue(xe.INVALID_ISO_DATE_ARGUMENT);
1613
- const h = i[3] ? i[3].trim().startsWith("T") ? `${i[1].trim()}${i[3].trim()}` : `${i[1].trim()}T${i[3].trim()}` : i[1].trim();
1614
- m = new Date(h);
1615
- try {
1616
- m.toISOString();
1617
- } catch {
1618
- throw Ue(xe.INVALID_ISO_DATE_ARGUMENT);
1619
- }
1620
- } else if (xr(t)) {
1621
- if (isNaN(t.getTime()))
1622
- throw Ue(xe.INVALID_DATE_ARGUMENT);
1623
- m = t;
1624
- } else if (he(t))
1625
- m = t;
1626
- else
1627
- throw Ue(xe.INVALID_ARGUMENT);
1628
- return W(n) ? o.key = n : q(n) && Object.keys(n).forEach((i) => {
1629
- qn.includes(i) ? f[i] = n[i] : o[i] = n[i];
1630
- }), W(r) ? o.locale = r : q(r) && (f = r), q(a) && (f = a), [o.key || "", m, o, f];
1631
- }
1632
- function In(e, t, n) {
1633
- const r = e;
1634
- for (const a in n) {
1635
- const o = `${t}__${a}`;
1636
- r.__datetimeFormatters.has(o) && r.__datetimeFormatters.delete(o);
1637
- }
1638
- }
1639
- function yn(e, ...t) {
1640
- const { numberFormats: n, unresolving: r, fallbackLocale: a, onWarn: o, localeFallbacker: f } = e, { __numberFormatters: m } = e, [i, h, E, C] = jt(...t), T = _e(E.missingWarn) ? E.missingWarn : e.missingWarn;
1641
- _e(E.fallbackWarn) ? E.fallbackWarn : e.fallbackWarn;
1642
- const D = !!E.part, R = zt(e, E), k = f(
1643
- e,
1644
- // eslint-disable-line @typescript-eslint/no-explicit-any
1645
- a,
1646
- R
1647
- );
1648
- if (!W(i) || i === "")
1649
- return new Intl.NumberFormat(R, C).format(h);
1650
- let M = {}, p, b = null;
1651
- const S = "number format";
1652
- for (let y = 0; y < k.length && (p = k[y], M = n[p] || {}, b = M[i], !q(b)); y++)
1653
- Kt(e, i, p, T, S);
1654
- if (!q(b) || !W(p))
1655
- return r ? Tt : i;
1656
- let d = `${p}__${i}`;
1657
- Nt(C) || (d = `${d}__${JSON.stringify(C)}`);
1658
- let g = m.get(d);
1659
- return g || (g = new Intl.NumberFormat(p, ge({}, b, C)), m.set(d, g)), D ? g.formatToParts(h) : g.format(h);
1660
- }
1661
- const er = [
1662
- "localeMatcher",
1663
- "style",
1664
- "currency",
1665
- "currencyDisplay",
1666
- "currencySign",
1667
- "useGrouping",
1668
- "minimumIntegerDigits",
1669
- "minimumFractionDigits",
1670
- "maximumFractionDigits",
1671
- "minimumSignificantDigits",
1672
- "maximumSignificantDigits",
1673
- "compactDisplay",
1674
- "notation",
1675
- "signDisplay",
1676
- "unit",
1677
- "unitDisplay",
1678
- "roundingMode",
1679
- "roundingPriority",
1680
- "roundingIncrement",
1681
- "trailingZeroDisplay"
1682
- ];
1683
- function jt(...e) {
1684
- const [t, n, r, a] = e, o = se();
1685
- let f = se();
1686
- if (!he(t))
1687
- throw Ue(xe.INVALID_ARGUMENT);
1688
- const m = t;
1689
- return W(n) ? o.key = n : q(n) && Object.keys(n).forEach((i) => {
1690
- er.includes(i) ? f[i] = n[i] : o[i] = n[i];
1691
- }), W(r) ? o.locale = r : q(r) && (f = r), q(a) && (f = a), [o.key || "", m, o, f];
1692
- }
1693
- function En(e, t, n) {
1694
- const r = e;
1695
- for (const a in n) {
1696
- const o = `${t}__${a}`;
1697
- r.__numberFormatters.has(o) && r.__numberFormatters.delete(o);
1698
- }
1699
- }
1700
- const la = (e) => e, ia = (e) => "", ca = "text", ua = (e) => e.length === 0 ? "" : Ht(e), da = Gr;
1701
- function Nn(e, t) {
1702
- return e = Math.abs(e), t === 2 ? e ? e > 1 ? 1 : 0 : 1 : e ? Math.min(e, 2) : 0;
1703
- }
1704
- function ma(e) {
1705
- const t = he(e.pluralIndex) ? e.pluralIndex : -1;
1706
- return e.named && (he(e.named.count) || he(e.named.n)) ? he(e.named.count) ? e.named.count : he(e.named.n) ? e.named.n : t : t;
1707
- }
1708
- function fa(e, t) {
1709
- t.count || (t.count = e), t.n || (t.n = e);
1710
- }
1711
- function _a(e = {}) {
1712
- const t = e.locale, n = ma(e), r = ee(e.pluralRules) && W(t) && ue(e.pluralRules[t]) ? e.pluralRules[t] : Nn, a = ee(e.pluralRules) && W(t) && ue(e.pluralRules[t]) ? Nn : void 0, o = (p) => p[r(n, p.length, a)], f = e.list || [], m = (p) => f[p], i = e.named || se();
1713
- he(e.pluralIndex) && fa(n, i);
1714
- const h = (p) => i[p];
1715
- function E(p, b) {
1716
- const S = ue(e.messages) ? e.messages(p, !!b) : ee(e.messages) ? e.messages[p] : !1;
1717
- return S || (e.parent ? e.parent.message(p) : ia);
1718
- }
1719
- const C = (p) => e.modifiers ? e.modifiers[p] : la, T = q(e.processor) && ue(e.processor.normalize) ? e.processor.normalize : ua, D = q(e.processor) && ue(e.processor.interpolate) ? e.processor.interpolate : da, R = q(e.processor) && W(e.processor.type) ? e.processor.type : ca, M = {
1720
- list: m,
1721
- named: h,
1722
- plural: o,
1723
- linked: (p, ...b) => {
1724
- const [S, d] = b;
1725
- let g = "text", y = "";
1726
- b.length === 1 ? ee(S) ? (y = S.modifier || y, g = S.type || g) : W(S) && (y = S || y) : b.length === 2 && (W(S) && (y = S || y), W(d) && (g = d || g));
1727
- const v = E(p, !0)(M), A = (
1728
- // The message in vnode resolved with linked are returned as an array by processor.nomalize
1729
- g === "vnode" && pe(v) && y ? v[0] : v
1730
- );
1731
- return y ? C(y)(A, g) : A;
1732
- },
1733
- message: E,
1734
- type: R,
1735
- interpolate: D,
1736
- normalize: T,
1737
- values: ge(se(), f, i)
1738
- };
1739
- return M;
1740
- }
1741
- const Cn = () => "", Te = (e) => ue(e);
1742
- function Tn(e, ...t) {
1743
- const { fallbackFormat: n, postTranslation: r, unresolving: a, messageCompiler: o, fallbackLocale: f, messages: m } = e, [i, h] = xt(...t), E = _e(h.missingWarn) ? h.missingWarn : e.missingWarn, C = _e(h.fallbackWarn) ? h.fallbackWarn : e.fallbackWarn, T = _e(h.escapeParameter) ? h.escapeParameter : e.escapeParameter, D = !!h.resolvedMessage, R = W(h.default) || _e(h.default) ? _e(h.default) ? o ? i : () => i : h.default : n ? o ? i : () => i : null, k = n || R != null && (W(R) || ue(R)), M = zt(e, h);
1744
- T && pa(h);
1745
- let [p, b, S] = D ? [
1746
- i,
1747
- M,
1748
- m[M] || se()
1749
- ] : tr(e, i, M, f, C, E), d = p, g = i;
1750
- if (!D && !(W(d) || ot(d) || Te(d)) && k && (d = R, g = d), !D && (!(W(d) || ot(d) || Te(d)) || !W(b)))
1751
- return a ? Tt : i;
1752
- let y = !1;
1753
- const v = () => {
1754
- y = !0;
1755
- }, A = Te(d) ? d : nr(e, i, b, d, g, v);
1756
- if (y)
1757
- return d;
1758
- const L = ha(e, b, S, h), H = _a(L), U = va(e, A, H), _ = r ? r(U, i) : U;
1759
- if (__INTLIFY_PROD_DEVTOOLS__) {
1760
- const O = {
1761
- timestamp: Date.now(),
1762
- key: W(i) ? i : Te(d) ? d.key : "",
1763
- locale: b || (Te(d) ? d.locale : ""),
1764
- format: W(d) ? d : Te(d) ? d.source : "",
1765
- message: _
1766
- };
1767
- O.meta = ge({}, e.__meta, /* @__PURE__ */ na() || {}), Ps(O);
1768
- }
1769
- return _;
1770
- }
1771
- function pa(e) {
1772
- pe(e.list) ? e.list = e.list.map((t) => W(t) ? on(t) : t) : ee(e.named) && Object.keys(e.named).forEach((t) => {
1773
- W(e.named[t]) && (e.named[t] = on(e.named[t]));
1774
- });
1775
- }
1776
- function tr(e, t, n, r, a, o) {
1777
- const { messages: f, onWarn: m, messageResolver: i, localeFallbacker: h } = e, E = h(e, r, n);
1778
- let C = se(), T, D = null;
1779
- const R = "translate";
1780
- for (let k = 0; k < E.length && (T = E[k], C = f[T] || se(), (D = i(C, t)) === null && (D = C[t]), !(W(D) || ot(D) || Te(D))); k++)
1781
- if (!oa(T, E)) {
1782
- const M = Kt(
1783
- e,
1784
- // eslint-disable-line @typescript-eslint/no-explicit-any
1785
- t,
1786
- T,
1787
- o,
1788
- R
1789
- );
1790
- M !== t && (D = M);
1791
- }
1792
- return [D, T, C];
1793
- }
1794
- function nr(e, t, n, r, a, o) {
1795
- const { messageCompiler: f, warnHtmlMessage: m } = e;
1796
- if (Te(r)) {
1797
- const h = r;
1798
- return h.locale = h.locale || n, h.key = h.key || t, h;
1799
- }
1800
- if (f == null) {
1801
- const h = () => r;
1802
- return h.locale = n, h.key = t, h;
1803
- }
1804
- const i = f(r, ba(e, n, a, r, m, o));
1805
- return i.locale = n, i.key = t, i.source = r, i;
1806
- }
1807
- function va(e, t, n) {
1808
- return t(n);
1809
- }
1810
- function xt(...e) {
1811
- const [t, n, r] = e, a = se();
1812
- if (!W(t) && !he(t) && !Te(t) && !ot(t))
1813
- throw Ue(xe.INVALID_ARGUMENT);
1814
- const o = he(t) ? String(t) : (Te(t), t);
1815
- return he(n) ? a.plural = n : W(n) ? a.default = n : q(n) && !Nt(n) ? a.named = n : pe(n) && (a.list = n), he(r) ? a.plural = r : W(r) ? a.default = r : q(r) && ge(a, r), [o, a];
1816
- }
1817
- function ba(e, t, n, r, a, o) {
1818
- return {
1819
- locale: t,
1820
- key: n,
1821
- warnHtmlMessage: a,
1822
- onError: (f) => {
1823
- throw o && o(f), f;
1824
- },
1825
- onCacheKey: (f) => Pr(t, n, f)
1826
- };
1827
- }
1828
- function ha(e, t, n, r) {
1829
- const { modifiers: a, pluralRules: o, messageResolver: f, fallbackLocale: m, fallbackWarn: i, missingWarn: h, fallbackContext: E } = e, T = {
1830
- locale: t,
1831
- modifiers: a,
1832
- pluralRules: o,
1833
- messages: (D, R) => {
1834
- let k = f(n, D);
1835
- if (k == null && (E || R)) {
1836
- const [, , M] = tr(
1837
- E || e,
1838
- // NOTE: if has fallbackContext, fallback to root, else if use linked, fallback to local context
1839
- D,
1840
- t,
1841
- m,
1842
- i,
1843
- h
1844
- );
1845
- k = f(M, D);
1846
- }
1847
- if (W(k) || ot(k)) {
1848
- let M = !1;
1849
- const b = nr(e, D, t, k, D, () => {
1850
- M = !0;
1851
- });
1852
- return M ? Cn : b;
1853
- } else return Te(k) ? k : Cn;
1854
- }
1855
- };
1856
- return e.processor && (T.processor = e.processor), r.list && (T.list = r.list), r.named && (T.named = r.named), he(r.plural) && (T.pluralIndex = r.plural), T;
1857
- }
1858
- ps();
1859
- var ga = { env: { GITHUB_STATE: "/home/runner/work/_temp/_runner_file_commands/save_state_1f76aeb9-3c56-48b2-9364-2a567abb244a", DOTNET_NOLOGO: "1", USER: "runner", npm_config_always_auth: "", npm_config_user_agent: "pnpm/10.8.0 npm/? node/v24.5.0 linux x64", CI: "true", USE_BAZEL_FALLBACK_VERSION: "silent:", RUNNER_ENVIRONMENT: "github-hosted", GITHUB_ENV: "/home/runner/work/_temp/_runner_file_commands/set_env_1f76aeb9-3c56-48b2-9364-2a567abb244a", PIPX_HOME: "/opt/pipx", npm_node_execpath: "/opt/hostedtoolcache/node/24.5.0/x64/bin/node", JAVA_HOME_8_X64: "/usr/lib/jvm/temurin-8-jdk-amd64", NODE_AUTH_TOKEN: "XXXXX-XXXXX-XXXXX-XXXXX", SHLVL: "1", HCA_CLOUD_PROVIDER: "azure", HOME: "/home/runner", RUNNER_TEMP: "/home/runner/work/_temp", GITHUB_EVENT_PATH: "/home/runner/work/_temp/_github_workflow/event.json", npm_config_save_workspace_protocol: "true", JAVA_HOME_11_X64: "/usr/lib/jvm/temurin-11-jdk-amd64", PIPX_BIN_DIR: "/opt/pipx_bin", GITHUB_REPOSITORY_OWNER: "feedmepos", NODE_OPTIONS: "--max-old-space-size=10240", GRADLE_HOME: "/usr/share/gradle-9.8.1", ANDROID_NDK_LATEST_HOME: "/usr/local/lib/android/sdk/ndk/30.0.16248370", JAVA_HOME_21_X64: "/usr/lib/jvm/temurin-21-jdk-amd64", GITHUB_RETENTION_DAYS: "90", GITHUB_REPOSITORY_OWNER_ID: "54831515", POWERSHELL_DISTRIBUTION_CHANNEL: "GitHub-Actions-Linux", AZURE_EXTENSION_DIR: "/opt/az/azcliextensions", GITHUB_HEAD_REF: "", npm_config_userconfig: "/home/runner/work/_temp/.npmrc", SYSTEMD_EXEC_PID: "1820", ACTIONS_ORCHESTRATION_ID: "7bdc4ac0-ce00-46a1-a4d2-be49f3091a9e.publish.publish.__default", npm_config_engine_strict: "true", GITHUB_GRAPHQL_URL: "https://api.github.com/graphql", JAVA_HOME_25_X64: "/usr/lib/jvm/temurin-25-jdk-amd64", NVM_DIR: "/home/runner/.nvm", npm_config_prefer_workspace_packages: "true", DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1", JAVA_HOME_17_X64: "/usr/lib/jvm/temurin-17-jdk-amd64", ImageVersion: "20261023.334.3", LOGNAME: "runner", RUNNER_OS: "Linux", GITHUB_API_URL: "https://api.github.com", GITHUB_ARTIFACTS: "/home/runner/work/_temp/_runner_file_commands/artifacts_1f76aeb9-3c56-48b2-9364-2a567abb244a", SWIFT_PATH: "/usr/share/swift/usr/bin", CHROMEWEBDRIVER: "/usr/local/share/chromedriver-linux64", JOURNAL_STREAM: "9:10591", GITHUB_WORKFLOW: "Publish hrm-portal", _: "/home/runner/setup-pnpm/node_modules/.bin/pnpm", MEMORY_PRESSURE_WATCH: "/sys/fs/cgroup/system.slice/hosted-compute-agent.service/memory.pressure", GOROOT_1_24_X64: "/opt/hostedtoolcache/go/1.24.13/x64", npm_config_registry: "https://registry.npmjs.org/", ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE: "/opt/actionarchivecache", GOROOT_1_25_X64: "/opt/hostedtoolcache/go/1.25.14/x64", GITHUB_RUN_ID: "40484032854", GITHUB_REF_TYPE: "branch", BOOTSTRAP_HASKELL_NONINTERACTIVE: "1", GITHUB_WORKFLOW_SHA: "76cb51cdc4cb137f67030266f8c8288f3c81e232", GOROOT_1_26_X64: "/opt/hostedtoolcache/go/1.26.9/x64", GITHUB_BASE_REF: "", ImageOS: "ubuntu24", GITHUB_WORKFLOW_REF: "feedmepos/hrm-service/.github/workflows/publish-hrm-portal-trusted.yml@refs/heads/dev", ACTIONS_ID_TOKEN_REQUEST_TOKEN: "eyJhbGciOiJSUzI1NiIsImtpZCI6IjM4ODI2YjE3LTZhMzAtNWY5Yi1iMTY5LThiZWI4MjAyZjcyMyIsInR5cCI6IkpXVCIsIng1dCI6InlrTmFZNHFNX3RhNGsyVGdaT0NFWUxrY1lsQSJ9.eyJJZGVudGl0eVR5cGVDbGFpbSI6IlN5c3RlbTpTZXJ2aWNlSWRlbnRpdHkiLCJhYyI6Ilt7XCJTY29wZVwiOlwicmVmcy9oZWFkcy9kZXZcIixcIlBlcm1pc3Npb25cIjozfSx7XCJTY29wZVwiOlwicmVmcy9oZWFkcy9tYWluXCIsXCJQZXJtaXNzaW9uXCI6MX1dIiwiYWNzbCI6IjEwIiwiYXVkIjoidnNvOjZmOTZmYTg5LWI3YmYtNDg3OC1iYWQzLTg5ODAwNjU2NmI2ZSIsImJpbGxpbmdfb3duZXJfaWQiOiJFX2tnRE9BQUpvWVEiLCJleHAiOjE3OTMxMTY5MjUsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcHJpbWFyeXNpZCI6ImRkZGRkZGRkLWRkZGQtZGRkZC1kZGRkLWRkZGRkZGRkZGRkZCIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL3NpZCI6ImRkZGRkZGRkLWRkZGQtZGRkZC1kZGRkLWRkZGRkZGRkZGRkZCIsImlhdCI6MTc5MzA5NDcyNSwiaXNzIjoiaHR0cHM6Ly90b2tlbi5hY3Rpb25zLmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImpvYl9pZCI6IjExNjJiYjk4LTlkNWYtNTNhMi05MjlkLTE0Yzg4NmIxNjQ2OSIsImpvYl93b3JrZmxvd19yZWYiOiJmZWVkbWVwb3MvYWN0aW9ucy8uZ2l0aHViL3dvcmtmbG93cy9wdWJsaXNoLW5wbS1naXRodWIueWFtbEByZWZzL2hlYWRzL21haW4iLCJqb2Jfd29ya2Zsb3dfc2hhIjoiNTBmOTYzNDk4MWZjYjJjYTcwZjRlMTFkODNhMzM2Y2VhYmZjOGI3YSIsIm5hbWVpZCI6ImRkZGRkZGRkLWRkZGQtZGRkZC1kZGRkLWRkZGRkZGRkZGRkZCIsIm5iZiI6MTc5MzA5NDQyNSwib2lkY19leHRyYSI6IntcImFjdG9yXCI6XCJqdW4tbGVlLWZlZWRtZVwiLFwiYWN0b3JfaWRcIjpcIjIzOTI4Mjg2MlwiLFwiYmFzZV9yZWZcIjpcIlwiLFwiY2hlY2tfcnVuX2lkXCI6XCIxMjIxMjEyNjc5OTNcIixcImV2ZW50X25hbWVcIjpcIndvcmtmbG93X2Rpc3BhdGNoXCIsXCJoZWFkX3JlZlwiOlwiXCIsXCJqb2Jfd29ya2Zsb3dfcmVmXCI6XCJmZWVkbWVwb3MvYWN0aW9ucy8uZ2l0aHViL3dvcmtmbG93cy9wdWJsaXNoLW5wbS1naXRodWIueWFtbEByZWZzL2hlYWRzL21haW5cIixcImpvYl93b3JrZmxvd19zaGFcIjpcIjUwZjk2MzQ5ODFmY2IyY2E3MGY0ZTExZDgzYTMzNmNlYWJmYzhiN2FcIixcInJlZlwiOlwicmVmcy9oZWFkcy9kZXZcIixcInJlZl9wcm90ZWN0ZWRcIjpcImZhbHNlXCIsXCJyZWZfdHlwZVwiOlwiYnJhbmNoXCIsXCJyZXBvc2l0b3J5XCI6XCJmZWVkbWVwb3MvaHJtLXNlcnZpY2VcIixcInJlcG9zaXRvcnlfaWRcIjpcIjExMjQ2NzIyMzVcIixcInJlcG9zaXRvcnlfb3duZXJcIjpcImZlZWRtZXBvc1wiLFwicmVwb3NpdG9yeV9vd25lcl9pZFwiOlwiNTQ4MzE1MTVcIixcInJlcG9zaXRvcnlfdmlzaWJpbGl0eVwiOlwicHJpdmF0ZVwiLFwicnVuX2F0dGVtcHRcIjpcIjFcIixcInJ1bl9pZFwiOlwiNDA0ODQwMzI4NTRcIixcInJ1bl9udW1iZXJcIjpcIjIzMlwiLFwicnVubmVyX2Vudmlyb25tZW50XCI6XCJnaXRodWItaG9zdGVkXCIsXCJzaGFcIjpcIjc2Y2I1MWNkYzRjYjEzN2Y2NzAzMDI2NmY4YzgyODhmM2M4MWUyMzJcIixcIndvcmtmbG93XCI6XCJQdWJsaXNoIGhybS1wb3J0YWxcIixcIndvcmtmbG93X3JlZlwiOlwiZmVlZG1lcG9zL2hybS1zZXJ2aWNlLy5naXRodWIvd29ya2Zsb3dzL3B1Ymxpc2gtaHJtLXBvcnRhbC10cnVzdGVkLnltbEByZWZzL2hlYWRzL2RldlwiLFwid29ya2Zsb3dfc2hhXCI6XCI3NmNiNTFjZGM0Y2IxMzdmNjcwMzAyNjZmOGM4Mjg4ZjNjODFlMjMyXCJ9Iiwib2lkY19zdWIiOiJyZXBvOmZlZWRtZXBvcy9ocm0tc2VydmljZTpyZWY6cmVmcy9oZWFkcy9kZXYiLCJvcmNoX2lkIjoiN2JkYzRhYzAtY2UwMC00NmExLWE0ZDItYmU0OWYzMDkxYTllLnB1Ymxpc2gucHVibGlzaC5fX2RlZmF1bHQiLCJvd25lcl9pZCI6IkVfa2dET0FBSm9ZUSIsInBsYW5faWQiOiI3YmRjNGFjMC1jZTAwLTQ2YTEtYTRkMi1iZTQ5ZjMwOTFhOWUiLCJyZXBvc2l0b3J5X2lkIjoiMTEyNDY3MjIzNSIsInJlcG9zaXRvcnlfb3duZXJfaWQiOiI1NDgzMTUxNSIsInJlcG9zaXRvcnlfdmlzaWJpbGl0eSI6InByaXZhdGUiLCJydW5faWQiOiI0MDQ4NDAzMjg1NCIsInJ1bl9udW1iZXIiOiIyMzIiLCJydW5fdHlwZSI6ImZ1bGwiLCJydW5uZXJfaWQiOiIxMDAwMjMxMDU0IiwicnVubmVyX3R5cGUiOiJob3N0ZWQiLCJzY3AiOiJBY3Rpb25zLlJlc3VsdHM6N2JkYzRhYzAtY2UwMC00NmExLWE0ZDItYmU0OWYzMDkxYTllOjExNjJiYjk4LTlkNWYtNTNhMi05MjlkLTE0Yzg4NmIxNjQ2OSBBY3Rpb25zLlJ1bm5lcjo3YmRjNGFjMC1jZTAwLTQ2YTEtYTRkMi1iZTQ5ZjMwOTFhOWU6MTE2MmJiOTgtOWQ1Zi01M2EyLTkyOWQtMTRjODg2YjE2NDY5IEFjdGlvbnMuVXBsb2FkQXJ0aWZhY3RzOjdiZGM0YWMwLWNlMDAtNDZhMS1hNGQyLWJlNDlmMzA5MWE5ZToxMTYyYmI5OC05ZDVmLTUzYTItOTI5ZC0xNGM4ODZiMTY0NjkgZ2VuZXJhdGVfaWRfdG9rZW46N2JkYzRhYzAtY2UwMC00NmExLWE0ZDItYmU0OWYzMDkxYTllOjExNjJiYjk4LTlkNWYtNTNhMi05MjlkLTE0Yzg4NmIxNjQ2OSBBY3Rpb25zLkdlbmVyaWNSZWFkOjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCIsInNoYSI6Ijc2Y2I1MWNkYzRjYjEzN2Y2NzAzMDI2NmY4YzgyODhmM2M4MWUyMzIiLCJ0cnVzdF90aWVyIjoiMSJ9.YwtZ0IH1H5a-4NleSOx297db1WSt9inwPti_XK4RxvBRgVyMM7xInLCWDrMr7L-ElxYXGsbzPy01tvEGyKtO1W2HFDum8ZlLGYAsyKkop5JbNx2AhzGBSv0Li03QuWekLhelvXGDCYwcsfn1Tz8OoMr_6W7jgX78JWZ33PmVRUv728rwVdsNIi6vt-bkg5f_XV7xONlQn8vGtBflG9VV6y2qViRPD64aoihSB9jyFduMjjh3Ju-nY8X5AP80Q5Fxcjo4kRpp4_5DjynRaH_T5GEp8wFyo7Yc-NV5phbqBx45EPZ9TooAM-BQSJD1tisysDkzcxoCrjKLSz3GJEKa1A", GITHUB_ACTION_REPOSITORY: "", ENABLE_RUNNER_TRACING: "true", npm_config_node_gyp: "/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js", PATH: "/home/runner/work/hrm-service/hrm-service/apps/hrm-portal/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules/pnpm/dist/node-gyp-bin:/home/runner/work/hrm-service/hrm-service/node_modules/.bin:/home/runner/work/hrm-service/hrm-service/apps/hrm-portal/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules/pnpm/dist/node-gyp-bin:/home/runner/work/hrm-service/hrm-service/node_modules/.bin:/home/runner/setup-pnpm/node_modules/.bin:/opt/hostedtoolcache/node/24.5.0/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin", ANT_HOME: "/usr/share/ant", DOTNET_MULTILEVEL_LOOKUP: "0", RUNNER_TRACKING_ID: "github_30208c36-d402-4601-9cc0-1c28bef61dad", INVOCATION_ID: "bdd0eb567fb34100bee80df53abfc43b", NPM_CONFIG_USERCONFIG: "/home/runner/work/_temp/.npmrc", RUNNER_TOOL_CACHE: "/opt/hostedtoolcache", NODE: "/opt/hostedtoolcache/node/24.5.0/x64/bin/node", npm_package_name: "@feedmepos/mf-hrm-portal", GITHUB_ACTION: "__run_5", GITHUB_RUN_NUMBER: "232", GITHUB_TRIGGERING_ACTOR: "jun-lee-feedme", RUNNER_ARCH: "X64", XDG_RUNTIME_DIR: "/run/user/1001", AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache", npm_config_frozen_lockfile: "", LANG: "C.UTF-8", VCPKG_INSTALLATION_ROOT: "/usr/local/share/vcpkg", CONDA: "/usr/share/miniconda", RUNNER_NAME: "GitHub Actions 1000231054", XDG_CONFIG_HOME: "/home/runner/.config", GITHUB_REF_NAME: "dev", GITHUB_REPOSITORY: "feedmepos/hrm-service", npm_lifecycle_script: "vite build --mode fmmf", ANDROID_NDK_ROOT: "/usr/local/lib/android/sdk/ndk/27.3.13750724", GITHUB_ACTION_REF: "", DEBIAN_FRONTEND: "noninteractive", SHELL: "/bin/bash", GITHUB_REPOSITORY_ID: "1124672235", GITHUB_ACTIONS: "true", NODE_PATH: "/home/runner/work/hrm-service/hrm-service/node_modules/.pnpm/vite@5.4.21_@types+node@18.19.130_sass-embedded@1.97.1_sass@1.97.1_terser@5.44.1/node_modules/vite/bin/node_modules:/home/runner/work/hrm-service/hrm-service/node_modules/.pnpm/vite@5.4.21_@types+node@18.19.130_sass-embedded@1.97.1_sass@1.97.1_terser@5.44.1/node_modules/vite/node_modules:/home/runner/work/hrm-service/hrm-service/node_modules/.pnpm/vite@5.4.21_@types+node@18.19.130_sass-embedded@1.97.1_sass@1.97.1_terser@5.44.1/node_modules:/home/runner/work/hrm-service/hrm-service/node_modules/.pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules/pnpm/bin/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules/pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules/pnpm/bin/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules/pnpm/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules:/home/runner/setup-pnpm/node_modules/.pnpm/node_modules", npm_package_version: "2.3.2-dev.8", npm_config_verify_deps_before_run: "false", npm_lifecycle_event: "build:mf", GITHUB_REF_PROTECTED: "false", GITHUB_WORKSPACE: "/home/runner/work/hrm-service/hrm-service", ACCEPT_EULA: "Y", GITHUB_JOB: "publish", npm_config_overrides: '{"proxy-addr":">=2.0.8 <3","@fastify/busboy":">=3.2.1 <4","@grpc/grpc-js":">=1.14.5 <2","brace-expansion@^2":"^2.1.6","js-yaml@^4":"^4.3.2","source-map-js":"^1.2.2","dompurify":">=3.4.17 <4","undici@^6":">=6.29.1 <7","body-parser@^1":">=1.20.9 <2","multer":">=2.5.0 <3"}', npm_config_package_extensions: '{"@feedmepos/entity":{"dependencies":{"@feedmepos/core":"2.14.52"}}}', GITHUB_SHA: "76cb51cdc4cb137f67030266f8c8288f3c81e232", GITHUB_RUN_ATTEMPT: "1", ACTIONS_RUNNER_RETURN_JOB_RESULT_FOR_HOSTED: "1", GITHUB_REF: "refs/heads/dev", GITHUB_ACTOR: "jun-lee-feedme", ANDROID_SDK_ROOT: "/usr/local/lib/android/sdk", VITE_TARGET_ENV: "dev", GITHUB_PATH: "/home/runner/work/_temp/_runner_file_commands/add_path_1f76aeb9-3c56-48b2-9364-2a567abb244a", JAVA_HOME: "/usr/lib/jvm/temurin-17-jdk-amd64", PWD: "/home/runner/work/hrm-service/hrm-service/apps/hrm-portal", GITHUB_ACTOR_ID: "239282862", RUNNER_WORKSPACE: "/home/runner/work/hrm-service", npm_config_link_workspace_packages: "true", npm_execpath: "/home/runner/setup-pnpm/node_modules/.pnpm/pnpm@10.8.0/node_modules/pnpm/bin/pnpm.cjs", HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: "3650", GITHUB_EVENT_NAME: "workflow_dispatch", HOMEBREW_NO_AUTO_UPDATE: "1", ANDROID_HOME: "/usr/local/lib/android/sdk", GITHUB_SERVER_URL: "https://github.com", GECKOWEBDRIVER: "/usr/local/share/gecko_driver", ACTIONS_ID_TOKEN_REQUEST_URL: "https://run-actions-2-azure-eastus.actions.githubusercontent.com/127//idtoken/7bdc4ac0-ce00-46a1-a4d2-be49f3091a9e/1162bb98-9d5f-53a2-929d-14c886b16469?api-version=2.0", GHCUP_INSTALL_BASE_PREFIX: "/usr/local", GITHUB_OUTPUT: "/home/runner/work/_temp/_runner_file_commands/set_output_1f76aeb9-3c56-48b2-9364-2a567abb244a", EDGEWEBDRIVER: "/usr/local/share/edge_driver", PNPM_SCRIPT_SRC_DIR: "/home/runner/work/hrm-service/hrm-service/apps/hrm-portal", npm_command: "run-script", ANDROID_NDK: "/usr/local/lib/android/sdk/ndk/27.3.13750724", GITHUB_ARTIFACTS_LIST: "/home/runner/work/_temp/_runner_file_commands/artifacts_list_1f76aeb9-3c56-48b2-9364-2a567abb244a", SGX_AESM_ADDR: "1", PSModulePath: "/root/.local/share/powershell/Modules:/usr/local/share/powershell/Modules:/opt/microsoft/powershell/7/Modules:/usr/share/az_15.6.1", CHROME_BIN: "/usr/bin/google-chrome", SELENIUM_JAR_PATH: "/usr/share/java/selenium-server.jar", MEMORY_PRESSURE_WRITE: "c29tZSAyMDAwMDAgMjAwMDAwMAA=", PNPM_HOME: "/home/runner/setup-pnpm/node_modules/.bin", ANDROID_NDK_HOME: "/usr/local/lib/android/sdk/ndk/27.3.13750724", GITHUB_STEP_SUMMARY: "/home/runner/work/_temp/_runner_file_commands/step_summary_1f76aeb9-3c56-48b2-9364-2a567abb244a", INIT_CWD: "/home/runner/work/hrm-service/hrm-service/apps/hrm-portal", NODE_ENV: "production" } };
1860
- const Ia = "10.0.5";
1861
- function ya() {
1862
- typeof __VUE_I18N_FULL_INSTALL__ != "boolean" && ($e().__VUE_I18N_FULL_INSTALL__ = !0), typeof __VUE_I18N_LEGACY_API__ != "boolean" && ($e().__VUE_I18N_LEGACY_API__ = !0), typeof __INTLIFY_DROP_MESSAGE_COMPILER__ != "boolean" && ($e().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1), typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" && ($e().__INTLIFY_PROD_DEVTOOLS__ = !1);
1863
- }
1864
- const lt = {
1865
- // composer module errors
1866
- UNEXPECTED_RETURN_TYPE: xs,
1867
- // 24
1868
- // legacy module errors
1869
- INVALID_ARGUMENT: 25,
1870
- // i18n module errors
1871
- MUST_BE_CALL_SETUP_TOP: 26,
1872
- NOT_INSTALLED: 27,
1873
- NOT_INSTALLED_WITH_PROVIDE: 31,
1874
- // unexpected error
1875
- UNEXPECTED_ERROR: 32
1876
- };
1877
- function dt(e, ...t) {
1878
- return Ct(e, null, void 0);
1879
- }
1880
- const Ut = /* @__PURE__ */ Ke("__translateVNode"), Vt = /* @__PURE__ */ Ke("__datetimeParts"), Wt = /* @__PURE__ */ Ke("__numberParts"), Ea = Ke("__setPluralRules"), rr = /* @__PURE__ */ Ke("__injectWithOption"), Gt = /* @__PURE__ */ Ke("__dispose");
1881
- function mt(e) {
1882
- if (!ee(e))
1883
- return e;
1884
- for (const t in e)
1885
- if (Le(e, t))
1886
- if (!t.includes("."))
1887
- ee(e[t]) && mt(e[t]);
1888
- else {
1889
- const n = t.split("."), r = n.length - 1;
1890
- let a = e, o = !1;
1891
- for (let f = 0; f < r; f++) {
1892
- if (n[f] in a || (a[n[f]] = se()), !ee(a[n[f]])) {
1893
- o = !0;
1894
- break;
1895
- }
1896
- a = a[n[f]];
1897
- }
1898
- o || (a[n[r]] = e[t], delete e[t]), ee(a[n[r]]) && mt(a[n[r]]);
1899
- }
1900
- return e;
1901
- }
1902
- function sr(e, t) {
1903
- const { messages: n, __i18n: r, messageResolver: a, flatJson: o } = t, f = q(n) ? n : pe(r) ? se() : { [e]: se() };
1904
- if (pe(r) && r.forEach((m) => {
1905
- if ("locale" in m && "resource" in m) {
1906
- const { locale: i, resource: h } = m;
1907
- i ? (f[i] = f[i] || se(), It(h, f[i])) : It(h, f);
1908
- } else
1909
- W(m) && It(JSON.parse(m), f);
1910
- }), a == null && o)
1911
- for (const m in f)
1912
- Le(f, m) && mt(f[m]);
1913
- return f;
1914
- }
1915
- function ar(e) {
1916
- return e.type;
1917
- }
1918
- function Na(e, t, n) {
1919
- let r = ee(t.messages) ? t.messages : se();
1920
- "__i18nGlobal" in n && (r = sr(e.locale.value, {
1921
- messages: r,
1922
- __i18n: n.__i18nGlobal
1923
- }));
1924
- const a = Object.keys(r);
1925
- a.length && a.forEach((o) => {
1926
- e.mergeLocaleMessage(o, r[o]);
1927
- });
1928
- {
1929
- if (ee(t.datetimeFormats)) {
1930
- const o = Object.keys(t.datetimeFormats);
1931
- o.length && o.forEach((f) => {
1932
- e.mergeDateTimeFormat(f, t.datetimeFormats[f]);
1933
- });
1934
- }
1935
- if (ee(t.numberFormats)) {
1936
- const o = Object.keys(t.numberFormats);
1937
- o.length && o.forEach((f) => {
1938
- e.mergeNumberFormat(f, t.numberFormats[f]);
1939
- });
1940
- }
1941
- }
1942
- }
1943
- function On(e) {
1944
- return oe(fr, null, e, 0);
1945
- }
1946
- const Sn = "__INTLIFY_META__", Ln = () => [], Ca = () => !1;
1947
- let kn = 0;
1948
- function An(e) {
1949
- return (t, n, r, a) => e(n, r, Bt() || void 0, a);
1950
- }
1951
- const Ta = /* @__NO_SIDE_EFFECTS__ */ () => {
1952
- const e = Bt();
1953
- let t = null;
1954
- return e && (t = ar(e)[Sn]) ? { [Sn]: t } : null;
1955
- };
1956
- function Oa(e = {}) {
1957
- const { __root: t, __injectWithOption: n } = e, r = t === void 0, a = e.flatJson, o = sn ? st : dr;
1958
- let f = _e(e.inheritLocale) ? e.inheritLocale : !0;
1959
- const m = o(
1960
- // prettier-ignore
1961
- t && f ? t.locale.value : W(e.locale) ? e.locale : Et
1962
- ), i = o(
1963
- // prettier-ignore
1964
- t && f ? t.fallbackLocale.value : W(e.fallbackLocale) || pe(e.fallbackLocale) || q(e.fallbackLocale) || e.fallbackLocale === !1 ? e.fallbackLocale : m.value
1965
- ), h = o(sr(m.value, e)), E = o(q(e.datetimeFormats) ? e.datetimeFormats : { [m.value]: {} }), C = o(q(e.numberFormats) ? e.numberFormats : { [m.value]: {} });
1966
- let T = t ? t.missingWarn : _e(e.missingWarn) || yt(e.missingWarn) ? e.missingWarn : !0, D = t ? t.fallbackWarn : _e(e.fallbackWarn) || yt(e.fallbackWarn) ? e.fallbackWarn : !0, R = t ? t.fallbackRoot : _e(e.fallbackRoot) ? e.fallbackRoot : !0, k = !!e.fallbackFormat, M = ue(e.missing) ? e.missing : null, p = ue(e.missing) ? An(e.missing) : null, b = ue(e.postTranslation) ? e.postTranslation : null, S = t ? t.warnHtmlMessage : _e(e.warnHtmlMessage) ? e.warnHtmlMessage : !0, d = !!e.escapeParameter;
1967
- const g = t ? t.modifiers : q(e.modifiers) ? e.modifiers : {};
1968
- let y = e.pluralRules || t && t.pluralRules, v;
1969
- v = (() => {
1970
- r && bn(null);
1971
- const u = {
1972
- version: Ia,
1973
- locale: m.value,
1974
- fallbackLocale: i.value,
1975
- messages: h.value,
1976
- modifiers: g,
1977
- pluralRules: y,
1978
- missing: p === null ? void 0 : p,
1979
- missingWarn: T,
1980
- fallbackWarn: D,
1981
- fallbackFormat: k,
1982
- unresolving: !0,
1983
- postTranslation: b === null ? void 0 : b,
1984
- warnHtmlMessage: S,
1985
- escapeParameter: d,
1986
- messageResolver: e.messageResolver,
1987
- messageCompiler: e.messageCompiler,
1988
- __meta: { framework: "vue" }
1989
- };
1990
- u.datetimeFormats = E.value, u.numberFormats = C.value, u.__datetimeFormatters = q(v) ? v.__datetimeFormatters : void 0, u.__numberFormatters = q(v) ? v.__numberFormatters : void 0;
1991
- const N = sa(u);
1992
- return r && bn(N), N;
1993
- })(), it(v, m.value, i.value);
1994
- function L() {
1995
- return [
1996
- m.value,
1997
- i.value,
1998
- h.value,
1999
- E.value,
2000
- C.value
2001
- ];
2002
- }
2003
- const H = z({
2004
- get: () => m.value,
2005
- set: (u) => {
2006
- m.value = u, v.locale = m.value;
2007
- }
2008
- }), U = z({
2009
- get: () => i.value,
2010
- set: (u) => {
2011
- i.value = u, v.fallbackLocale = i.value, it(v, m.value, u);
2012
- }
2013
- }), _ = z(() => h.value), O = /* @__PURE__ */ z(() => E.value), P = /* @__PURE__ */ z(() => C.value);
2014
- function F() {
2015
- return ue(b) ? b : null;
2016
- }
2017
- function w(u) {
2018
- b = u, v.postTranslation = u;
2019
- }
2020
- function V() {
2021
- return M;
2022
- }
2023
- function j(u) {
2024
- u !== null && (p = An(u)), M = u, v.missing = p;
2025
- }
2026
- const Y = (u, N, Q, $, de, Ge) => {
2027
- L();
2028
- let qe;
2029
- try {
2030
- ga.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__, r || (v.fallbackContext = t ? ra() : void 0), qe = u(v);
2031
- } finally {
2032
- __INTLIFY_PROD_DEVTOOLS__, r || (v.fallbackContext = void 0);
2033
- }
2034
- if (Q !== "translate exists" && // for not `te` (e.g `t`)
2035
- he(qe) && qe === Tt || Q === "translate exists" && !qe) {
2036
- const [cr, po] = N();
2037
- return t && R ? $(t) : de(cr);
2038
- } else {
2039
- if (Ge(qe))
2040
- return qe;
2041
- throw dt(lt.UNEXPECTED_RETURN_TYPE);
2042
- }
2043
- };
2044
- function Z(...u) {
2045
- return Y((N) => Reflect.apply(Tn, null, [N, ...u]), () => xt(...u), "translate", (N) => Reflect.apply(N.t, N, [...u]), (N) => N, (N) => W(N));
2046
- }
2047
- function te(...u) {
2048
- const [N, Q, $] = u;
2049
- if ($ && !ee($))
2050
- throw dt(lt.INVALID_ARGUMENT);
2051
- return Z(N, Q, ge({ resolvedMessage: !0 }, $ || {}));
2052
- }
2053
- function K(...u) {
2054
- return Y((N) => Reflect.apply(gn, null, [N, ...u]), () => Pt(...u), "datetime format", (N) => Reflect.apply(N.d, N, [...u]), () => pn, (N) => W(N));
2055
- }
2056
- function me(...u) {
2057
- return Y((N) => Reflect.apply(yn, null, [N, ...u]), () => jt(...u), "number format", (N) => Reflect.apply(N.n, N, [...u]), () => pn, (N) => W(N));
2058
- }
2059
- function ve(u) {
2060
- return u.map((N) => W(N) || he(N) || _e(N) ? On(String(N)) : N);
2061
- }
2062
- const ae = {
2063
- normalize: ve,
2064
- interpolate: (u) => u,
2065
- type: "vnode"
2066
- };
2067
- function le(...u) {
2068
- return Y((N) => {
2069
- let Q;
2070
- const $ = N;
2071
- try {
2072
- $.processor = ae, Q = Reflect.apply(Tn, null, [$, ...u]);
2073
- } finally {
2074
- $.processor = null;
2075
- }
2076
- return Q;
2077
- }, () => xt(...u), "translate", (N) => N[Ut](...u), (N) => [On(N)], (N) => pe(N));
2078
- }
2079
- function Ae(...u) {
2080
- return Y((N) => Reflect.apply(yn, null, [N, ...u]), () => jt(...u), "number format", (N) => N[Wt](...u), Ln, (N) => W(N) || pe(N));
2081
- }
2082
- function B(...u) {
2083
- return Y((N) => Reflect.apply(gn, null, [N, ...u]), () => Pt(...u), "datetime format", (N) => N[Vt](...u), Ln, (N) => W(N) || pe(N));
2084
- }
2085
- function fe(u) {
2086
- y = u, v.pluralRules = y;
2087
- }
2088
- function Je(u, N) {
2089
- return Y(() => {
2090
- if (!u)
2091
- return !1;
2092
- const Q = W(N) ? N : m.value, $ = we(Q), de = v.messageResolver($, u);
2093
- return ot(de) || Te(de) || W(de);
2094
- }, () => [u], "translate exists", (Q) => Reflect.apply(Q.te, Q, [u, N]), Ca, (Q) => _e(Q));
2095
- }
2096
- function Qe(u) {
2097
- let N = null;
2098
- const Q = Hn(v, i.value, m.value);
2099
- for (let $ = 0; $ < Q.length; $++) {
2100
- const de = h.value[Q[$]] || {}, Ge = v.messageResolver(de, u);
2101
- if (Ge != null) {
2102
- N = Ge;
2103
- break;
2104
- }
2105
- }
2106
- return N;
2107
- }
2108
- function Ve(u) {
2109
- const N = Qe(u);
2110
- return N ?? (t ? t.tm(u) || {} : {});
2111
- }
2112
- function we(u) {
2113
- return h.value[u] || {};
2114
- }
2115
- function Fe(u, N) {
2116
- if (a) {
2117
- const Q = { [u]: N };
2118
- for (const $ in Q)
2119
- Le(Q, $) && mt(Q[$]);
2120
- N = Q[u];
2121
- }
2122
- h.value[u] = N, v.messages = h.value;
2123
- }
2124
- function We(u, N) {
2125
- h.value[u] = h.value[u] || {};
2126
- const Q = { [u]: N };
2127
- if (a)
2128
- for (const $ in Q)
2129
- Le(Q, $) && mt(Q[$]);
2130
- N = Q[u], It(N, h.value[u]), v.messages = h.value;
2131
- }
2132
- function Pe(u) {
2133
- return E.value[u] || {};
2134
- }
2135
- function l(u, N) {
2136
- E.value[u] = N, v.datetimeFormats = E.value, In(v, u, N);
2137
- }
2138
- function s(u, N) {
2139
- E.value[u] = ge(E.value[u] || {}, N), v.datetimeFormats = E.value, In(v, u, N);
2140
- }
2141
- function c(u) {
2142
- return C.value[u] || {};
2143
- }
2144
- function I(u, N) {
2145
- C.value[u] = N, v.numberFormats = C.value, En(v, u, N);
2146
- }
2147
- function x(u, N) {
2148
- C.value[u] = ge(C.value[u] || {}, N), v.numberFormats = C.value, En(v, u, N);
2149
- }
2150
- kn++, t && sn && (Mt(t.locale, (u) => {
2151
- f && (m.value = u, v.locale = u, it(v, m.value, i.value));
2152
- }), Mt(t.fallbackLocale, (u) => {
2153
- f && (i.value = u, v.fallbackLocale = u, it(v, m.value, i.value));
2154
- }));
2155
- const G = {
2156
- id: kn,
2157
- locale: H,
2158
- fallbackLocale: U,
2159
- get inheritLocale() {
2160
- return f;
2161
- },
2162
- set inheritLocale(u) {
2163
- f = u, u && t && (m.value = t.locale.value, i.value = t.fallbackLocale.value, it(v, m.value, i.value));
2164
- },
2165
- get availableLocales() {
2166
- return Object.keys(h.value).sort();
2167
- },
2168
- messages: _,
2169
- get modifiers() {
2170
- return g;
2171
- },
2172
- get pluralRules() {
2173
- return y || {};
2174
- },
2175
- get isGlobal() {
2176
- return r;
2177
- },
2178
- get missingWarn() {
2179
- return T;
2180
- },
2181
- set missingWarn(u) {
2182
- T = u, v.missingWarn = T;
2183
- },
2184
- get fallbackWarn() {
2185
- return D;
2186
- },
2187
- set fallbackWarn(u) {
2188
- D = u, v.fallbackWarn = D;
2189
- },
2190
- get fallbackRoot() {
2191
- return R;
2192
- },
2193
- set fallbackRoot(u) {
2194
- R = u;
2195
- },
2196
- get fallbackFormat() {
2197
- return k;
2198
- },
2199
- set fallbackFormat(u) {
2200
- k = u, v.fallbackFormat = k;
2201
- },
2202
- get warnHtmlMessage() {
2203
- return S;
2204
- },
2205
- set warnHtmlMessage(u) {
2206
- S = u, v.warnHtmlMessage = u;
2207
- },
2208
- get escapeParameter() {
2209
- return d;
2210
- },
2211
- set escapeParameter(u) {
2212
- d = u, v.escapeParameter = u;
2213
- },
2214
- t: Z,
2215
- getLocaleMessage: we,
2216
- setLocaleMessage: Fe,
2217
- mergeLocaleMessage: We,
2218
- getPostTranslationHandler: F,
2219
- setPostTranslationHandler: w,
2220
- getMissingHandler: V,
2221
- setMissingHandler: j,
2222
- [Ea]: fe
2223
- };
2224
- return G.datetimeFormats = O, G.numberFormats = P, G.rt = te, G.te = Je, G.tm = Ve, G.d = K, G.n = me, G.getDateTimeFormat = Pe, G.setDateTimeFormat = l, G.mergeDateTimeFormat = s, G.getNumberFormat = c, G.setNumberFormat = I, G.mergeNumberFormat = x, G[rr] = n, G[Ut] = le, G[Vt] = B, G[Wt] = Ae, G;
2225
- }
2226
- const Qt = {
2227
- tag: {
2228
- type: [String, Object]
2229
- },
2230
- locale: {
2231
- type: String
2232
- },
2233
- scope: {
2234
- type: String,
2235
- // NOTE: avoid https://github.com/microsoft/rushstack/issues/1050
2236
- validator: (e) => e === "parent" || e === "global",
2237
- default: "parent"
2238
- /* ComponentI18nScope */
2239
- },
2240
- i18n: {
2241
- type: Object
2242
- }
2243
- };
2244
- function Sa({ slots: e }, t) {
2245
- return t.length === 1 && t[0] === "default" ? (e.default ? e.default() : []).reduce((r, a) => [
2246
- ...r,
2247
- // prettier-ignore
2248
- ...a.type === Me ? a.children : [a]
2249
- ], []) : t.reduce((n, r) => {
2250
- const a = e[r];
2251
- return a && (n[r] = a()), n;
2252
- }, se());
2253
- }
2254
- function or() {
2255
- return Me;
2256
- }
2257
- ge({
2258
- keypath: {
2259
- type: String,
2260
- required: !0
2261
- },
2262
- plural: {
2263
- type: [Number, String],
2264
- validator: (e) => he(e) || !isNaN(e)
2265
- }
2266
- }, Qt);
2267
- function La(e) {
2268
- return pe(e) && !W(e[0]);
2269
- }
2270
- function lr(e, t, n, r) {
2271
- const { slots: a, attrs: o } = t;
2272
- return () => {
2273
- const f = { part: !0 };
2274
- let m = se();
2275
- e.locale && (f.locale = e.locale), W(e.format) ? f.key = e.format : ee(e.format) && (W(e.format.key) && (f.key = e.format.key), m = Object.keys(e.format).reduce((T, D) => n.includes(D) ? ge(se(), T, { [D]: e.format[D] }) : T, se()));
2276
- const i = r(e.value, f, m);
2277
- let h = [f.key];
2278
- pe(i) ? h = i.map((T, D) => {
2279
- const R = a[T.type], k = R ? R({ [T.type]: T.value, index: D, parts: i }) : [T.value];
2280
- return La(k) && (k[0].key = `${T.type}-${D}`), k;
2281
- }) : W(i) && (h = [i]);
2282
- const E = ge(se(), o), C = W(e.tag) || ee(e.tag) ? e.tag : or();
2283
- return Vn(C, E, h);
2284
- };
2285
- }
2286
- ge({
2287
- value: {
2288
- type: Number,
2289
- required: !0
2290
- },
2291
- format: {
2292
- type: [String, Object]
2293
- }
2294
- }, Qt);
2295
- ge({
2296
- value: {
2297
- type: [Number, Date],
2298
- required: !0
2299
- },
2300
- format: {
2301
- type: [String, Object]
2302
- }
2303
- }, Qt);
2304
- const ka = /* @__PURE__ */ Ke("global-vue-i18n");
2305
- function Ot(e = {}) {
2306
- const t = Bt();
2307
- if (t == null)
2308
- throw dt(lt.MUST_BE_CALL_SETUP_TOP);
2309
- if (!t.isCE && t.appContext.app != null && !t.appContext.app.__VUE_I18N_SYMBOL__)
2310
- throw dt(lt.NOT_INSTALLED);
2311
- const n = Aa(t), r = Ma(n), a = ar(t), o = Ra(e, a);
2312
- if (o === "global")
2313
- return Na(r, e, a), r;
2314
- if (o === "parent") {
2315
- let i = Da(n, t, e.__useComponent);
2316
- return i == null && (i = r), i;
2317
- }
2318
- const f = n;
2319
- let m = f.__getInstance(t);
2320
- if (m == null) {
2321
- const i = ge({}, e);
2322
- "__i18n" in a && (i.__i18n = a.__i18n), r && (i.__root = r), m = Oa(i), f.__composerExtend && (m[Gt] = f.__composerExtend(m)), Fa(f, t, m), f.__setInstance(t, m);
2323
- }
2324
- return m;
2325
- }
2326
- function Aa(e) {
2327
- const t = ur(e.isCE ? ka : e.appContext.app.__VUE_I18N_SYMBOL__);
2328
- if (!t)
2329
- throw dt(e.isCE ? lt.NOT_INSTALLED_WITH_PROVIDE : lt.UNEXPECTED_ERROR);
2330
- return t;
2331
- }
2332
- function Ra(e, t) {
2333
- return Nt(e) ? "__i18n" in t ? "local" : "global" : e.useScope ? e.useScope : "local";
2334
- }
2335
- function Ma(e) {
2336
- return e.mode === "composition" ? e.global : e.global.__composer;
2337
- }
2338
- function Da(e, t, n = !1) {
2339
- let r = null;
2340
- const a = t.root;
2341
- let o = wa(t, n);
2342
- for (; o != null; ) {
2343
- const f = e;
2344
- if (e.mode === "composition")
2345
- r = f.__getInstance(o);
2346
- else if (__VUE_I18N_LEGACY_API__) {
2347
- const m = f.__getInstance(o);
2348
- m != null && (r = m.__composer, n && r && !r[rr] && (r = null));
2349
- }
2350
- if (r != null || a === o)
2351
- break;
2352
- o = o.parent;
2353
- }
2354
- return r;
2355
- }
2356
- function wa(e, t = !1) {
2357
- return e == null ? null : t && e.vnode.ctx || e.parent;
2358
- }
2359
- function Fa(e, t, n) {
2360
- Un(() => {
2361
- }, t), mr(() => {
2362
- const r = n;
2363
- e.__deleteInstance(t);
2364
- const a = r[Gt];
2365
- a && (a(), delete r[Gt]);
2366
- }, t);
2367
- }
2368
- ya();
2369
- Qs(Ds);
2370
- qs($s);
2371
- ea(Hn);
2372
- if (__INTLIFY_PROD_DEVTOOLS__) {
2373
- const e = $e();
2374
- e.__INTLIFY__ = !0, ws(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
2375
- }
2376
- const vt = /* @__PURE__ */ ke({
2377
- __name: "InheritPermissionTooltip",
2378
- props: {
2379
- item: {
2380
- type: Object,
2381
- required: !0
2382
- }
2383
- },
2384
- setup(e) {
2385
- const { t } = Ot();
2386
- return (n, r) => {
2387
- const a = De("FmIcon"), o = De("FmTooltip");
2388
- return J(), Ce(o, {
2389
- variant: "plain",
2390
- placement: "right",
2391
- "z-index": 50
2392
- }, {
2393
- content: ce(() => [
2394
- ie("div", null, Oe(X(t)("team.memberForm.permissions.inherited")), 1),
2395
- (J(!0), re(Me, null, Ee(e.item.setNames, (f) => (J(), re("div", { key: f }, [
2396
- ie("div", null, "- " + Oe(f), 1)
2397
- ]))), 128))
2398
- ]),
2399
- default: ce(() => [
2400
- oe(a, {
2401
- name: "admin_panel_settings",
2402
- size: "sm",
2403
- class: "ml-1 text-fm-color-typo-info"
2404
- })
2405
- ]),
2406
- _: 1
2407
- });
2408
- };
2409
- }
2410
- });
2411
- function Rn(e, t, n) {
2412
- const r = n.filter((m) => m !== "manage");
2413
- if (r.length === 0) return;
2414
- const a = e.findIndex((m) => m.subject === t && !m.inverted);
2415
- if (a < 0) return;
2416
- const o = new Set(e[a].actions), f = r.every((m) => o.has(m));
2417
- f && !o.has("manage") ? (o.add("manage"), e[a] = {
2418
- ...e[a],
2419
- actions: Array.from(o)
2420
- }) : !f && o.has("manage") && (o.delete("manage"), o.size === 0 ? e.splice(a, 1) : e[a] = {
2421
- ...e[a],
2422
- actions: Array.from(o)
2423
- });
2424
- }
2425
- const Mn = Object.values(Ar), Pa = {
2426
- read: "View",
2427
- create: "Duplicate",
2428
- update: "Edit"
2429
- };
2430
- function ja(e, t, n, r) {
2431
- const { t: a } = ze(), { getFlagValue: o, getFlag: f } = kr(), m = z(() => {
2432
- var w;
2433
- const _ = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map();
2434
- for (const V of t.value) {
2435
- const j = V.category;
2436
- if (!j) continue;
2437
- const Y = V.subject;
2438
- if (n.value.includes(V.subject) || V.showByFeatureFlag && ((w = f(V.showByFeatureFlag)) == null ? void 0 : w.enabled) === !1 && o(V.showByFeatureFlag) === "true")
2439
- continue;
2440
- _.has(j) || _.set(j, []);
2441
- const Z = P.get(Y) ?? 0;
2442
- P.set(Y, Z + 1), _.get(j).push({
2443
- label: a(`permissionSet.permissionLabels.${Y}`, V.label),
2444
- value: Y,
2445
- optionKey: `${Y}::${Z}`
2446
- }), O.has(Y) || O.set(Y, V);
2447
- }
2448
- return [..._.keys()].sort((V, j) => {
2449
- const Y = Mn.indexOf(V), Z = Mn.indexOf(j);
2450
- return Y === -1 && Z === -1 ? V.localeCompare(j) : Y === -1 ? 1 : Z === -1 ? -1 : Y - Z;
2451
- }).map((V) => {
2452
- const j = _.get(V), Y = a(`permissionSet.categoryLabels.${V}`, V), Z = /* @__PURE__ */ new Map();
2453
- for (const B of j) {
2454
- const fe = O.get(B.value);
2455
- fe && Z.set(B.value, fe.actions);
2456
- }
2457
- const te = j.some((B) => {
2458
- const fe = Z.get(B.value);
2459
- return fe && fe.length > 1;
2460
- }), K = te ? [
2461
- ...new Set(
2462
- j.flatMap((B) => Z.get(B.value) ?? []).filter((B) => B !== "manage")
2463
- )
2464
- ] : [], me = /* @__PURE__ */ new Map();
2465
- for (const B of e.value)
2466
- j.some((fe) => fe.value === B.subject) && !B.inverted && me.set(B.subject, new Set(B.actions));
2467
- const ve = te ? e.value.filter(
2468
- (B) => j.some((fe) => fe.value === B.subject) && !B.inverted && B.actions.includes("manage")
2469
- ).map((B) => B.subject) : e.value.filter((B) => j.some((fe) => fe.value === B.subject) && !B.inverted).map((B) => B.subject), be = j.find((B) => {
2470
- var fe;
2471
- return (fe = O.get(B.value)) == null ? void 0 : fe.isCategoryCover;
2472
- }), ae = (be == null ? void 0 : be.value) ?? null, le = ae ? me.get(ae) ?? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set(), Ae = le.has("manage");
2473
- return {
2474
- category: V,
2475
- label: Y,
2476
- options: j,
2477
- selectedSubjects: ve,
2478
- isMultiAction: te,
2479
- actionColumns: K,
2480
- permissionActionsMap: Z,
2481
- selectedActionsMap: me,
2482
- coverSubject: ae,
2483
- coverSelectedActions: le,
2484
- coverCoversAll: Ae
2485
- };
2486
- });
2487
- });
2488
- function i(_, O) {
2489
- const P = m.value.find((K) => K.category === _), F = (P == null ? void 0 : P.options) ?? [], w = new Set(F.map((K) => K.value)), V = new Set(O), j = /* @__PURE__ */ new Map();
2490
- for (const K of e.value)
2491
- w.has(K.subject) && !K.inverted && j.set(K.subject, K.conditions);
2492
- const Y = P != null && P.coverSubject ? j.get(P.coverSubject) : void 0, Z = /* @__PURE__ */ new Set(), te = t.value.flatMap(
2493
- ({ category: K, showByFeatureFlag: me, isCategoryCover: ve, ...be }) => {
2494
- const ae = be.subject;
2495
- if (!V.has(ae) || Z.has(ae)) return [];
2496
- Z.add(ae);
2497
- let le;
2498
- return j.has(ae) ? le = j.get(ae) : P != null && P.coverSubject && ae !== P.coverSubject && (le = Y), [
2499
- { ...be, ...le !== void 0 && { conditions: le } }
2500
- ];
2501
- }
2502
- );
2503
- r("update:model-value", [
2504
- ...e.value.filter((K) => !w.has(K.subject)),
2505
- ...te
2506
- ]);
2507
- }
2508
- function h(_, O) {
2509
- return D(_, O) || d(_, O);
2510
- }
2511
- function E(_) {
2512
- return _.options.length > 0 && _.options.every((O) => h(_, O.value));
2513
- }
2514
- function C(_) {
2515
- return _.options.length === 0 || E(_) ? !1 : _.options.some(
2516
- (O) => h(_, O.value) || R(_, O.value).length > 0
2517
- );
2518
- }
2519
- function T(_) {
2520
- const O = new Set(_.options.map((F) => F.value)), P = e.value.filter((F) => !O.has(F.subject));
2521
- if (E(_))
2522
- r("update:model-value", P);
2523
- else {
2524
- const F = /* @__PURE__ */ new Map();
2525
- for (const Y of e.value)
2526
- O.has(Y.subject) && !Y.inverted && F.set(Y.subject, Y.conditions);
2527
- const w = _.coverSubject ? F.get(_.coverSubject) : void 0, V = /* @__PURE__ */ new Set(), j = t.value.flatMap(
2528
- ({ category: Y, showByFeatureFlag: Z, isCategoryCover: te, ...K }) => {
2529
- const me = K.subject;
2530
- if (!O.has(me) || V.has(me)) return [];
2531
- V.add(me);
2532
- let ve;
2533
- return F.has(me) ? ve = F.get(me) : _.coverSubject && me !== _.coverSubject && (ve = w), [
2534
- { ...K, ...ve !== void 0 && { conditions: ve } }
2535
- ];
2536
- }
2537
- );
2538
- r("update:model-value", [...P, ...j]);
2539
- }
2540
- }
2541
- function D(_, O) {
2542
- const P = _.selectedActionsMap.get(O);
2543
- return P ? P.has("manage") : !1;
2544
- }
2545
- function R(_, O) {
2546
- const P = _.permissionActionsMap.get(O);
2547
- return P ? P.filter((w) => w !== "manage").filter(
2548
- (w) => S(_, O, w) || g(_, O, w)
2549
- ) : [];
2550
- }
2551
- function k(_, O) {
2552
- return d(_, O) ? !1 : !D(_, O) && R(_, O).length > 0;
2553
- }
2554
- function M(_, O) {
2555
- if (!_.coverSubject || O === _.coverSubject) return;
2556
- const P = e.value.find(
2557
- (F) => !F.inverted && F.subject === _.coverSubject
2558
- );
2559
- return (P == null ? void 0 : P.conditions) || void 0;
2560
- }
2561
- function p(_, O, P) {
2562
- if (P) {
2563
- const F = t.value.find((K) => K.subject === O);
2564
- if (!F) return;
2565
- const {
2566
- category: w,
2567
- showByFeatureFlag: V,
2568
- isCategoryCover: j,
2569
- ...Y
2570
- } = F, Z = M(_, O), te = e.value.filter((K) => K.subject !== O);
2571
- te.push({
2572
- ...Y,
2573
- ...Z !== void 0 && { conditions: Z }
2574
- }), r("update:model-value", te);
2575
- } else
2576
- r(
2577
- "update:model-value",
2578
- e.value.filter((F) => F.subject !== O)
2579
- );
2580
- }
2581
- function b(_, O) {
2582
- const P = _.permissionActionsMap.get(O);
2583
- return P ? P.some((F) => F !== "manage") : !1;
2584
- }
2585
- function S(_, O, P) {
2586
- const F = _.selectedActionsMap.get(O);
2587
- return F ? F.has(P) : !1;
2588
- }
2589
- function d(_, O) {
2590
- return !_.coverSubject || O === _.coverSubject ? !1 : _.coverCoversAll;
2591
- }
2592
- function g(_, O, P) {
2593
- return !_.coverSubject || O === _.coverSubject ? !1 : _.coverCoversAll ? !0 : _.coverSelectedActions.has(P);
2594
- }
2595
- function y(_, O, P) {
2596
- const F = _.permissionActionsMap.get(O);
2597
- return F ? F.includes(P) : !1;
2598
- }
2599
- function v(_, O, P) {
2600
- const F = [...e.value], w = F.findIndex((j) => j.subject === _ && !j.inverted);
2601
- if (P)
2602
- if (w >= 0) {
2603
- const j = { ...F[w] }, Y = new Set(j.actions);
2604
- Y.add(O), j.actions = Array.from(Y), F[w] = j;
2605
- } else {
2606
- const j = t.value.find((be) => be.subject === _);
2607
- if (!j) return;
2608
- const {
2609
- category: Y,
2610
- showByFeatureFlag: Z,
2611
- isCategoryCover: te,
2612
- ...K
2613
- } = j, me = m.value.find(
2614
- (be) => be.options.some((ae) => ae.value === _)
2615
- ), ve = me ? M(me, _) : void 0;
2616
- F.push({
2617
- ...K,
2618
- actions: [O],
2619
- ...ve !== void 0 && { conditions: ve }
2620
- });
2621
- }
2622
- else if (w >= 0) {
2623
- const j = { ...F[w] }, Y = j.actions.filter((Z) => Z !== O);
2624
- Y.length === 0 ? F.splice(w, 1) : (j.actions = Y, F[w] = j);
2625
- }
2626
- const V = t.value.find((j) => j.subject === _);
2627
- V && Rn(F, _, V.actions), r("update:model-value", F);
2628
- }
2629
- function A(_, O) {
2630
- const P = _.options.filter(
2631
- (F) => y(_, F.value, O)
2632
- );
2633
- return P.length === 0 ? !1 : P.every(
2634
- (F) => S(_, F.value, O) || g(_, F.value, O)
2635
- );
2636
- }
2637
- function L(_, O) {
2638
- const P = _.options.filter(
2639
- (w) => y(_, w.value, O)
2640
- );
2641
- if (P.length === 0) return !1;
2642
- const F = P.filter(
2643
- (w) => S(_, w.value, O) || g(_, w.value, O)
2644
- ).length;
2645
- return F > 0 && F < P.length;
2646
- }
2647
- function H(_, O, P) {
2648
- const F = [...e.value];
2649
- for (const w of _.options) {
2650
- if (!y(_, w.value, O)) continue;
2651
- const V = w.value, j = F.findIndex(
2652
- (Z) => Z.subject === V && !Z.inverted
2653
- );
2654
- if (P)
2655
- if (j >= 0) {
2656
- const Z = { ...F[j] }, te = new Set(Z.actions);
2657
- te.add(O), Z.actions = Array.from(te), F[j] = Z;
2658
- } else {
2659
- const Z = t.value.find((ae) => ae.subject === V);
2660
- if (!Z) continue;
2661
- const {
2662
- category: te,
2663
- showByFeatureFlag: K,
2664
- isCategoryCover: me,
2665
- ...ve
2666
- } = Z, be = M(_, V);
2667
- F.push({
2668
- ...ve,
2669
- actions: [O],
2670
- ...be !== void 0 && { conditions: be }
2671
- });
2672
- }
2673
- else if (j >= 0) {
2674
- const Z = { ...F[j] }, te = Z.actions.filter((K) => K !== O);
2675
- te.length === 0 ? F.splice(j, 1) : (Z.actions = te, F[j] = Z);
2676
- }
2677
- const Y = t.value.find((Z) => Z.subject === V);
2678
- Y && Rn(F, V, Y.actions);
2679
- }
2680
- r("update:model-value", F);
2681
- }
2682
- function U(_) {
2683
- const O = `permissionSet.actionLabels.${_}`, P = Pa[_] ?? _.charAt(0).toUpperCase() + _.slice(1);
2684
- return a(O, P);
2685
- }
2686
- return {
2687
- categoryGroups: m,
2688
- toggleCategory: i,
2689
- isAllManageChecked: E,
2690
- isAllManageIndeterminate: C,
2691
- toggleAllManage: T,
2692
- isManageChecked: D,
2693
- isManageIndeterminate: k,
2694
- toggleManage: p,
2695
- hasNonManageActions: b,
2696
- isActionChecked: S,
2697
- isRowFullyCoveredByCover: d,
2698
- isActionCoveredByCover: g,
2699
- permissionDefinesAction: y,
2700
- toggleAction: v,
2701
- isAllActionChecked: A,
2702
- isAllActionIndeterminate: L,
2703
- toggleAllAction: H,
2704
- actionLabel: U
2705
- };
2706
- }
2707
- const xa = { class: "flex flex-col gap-16" }, Ua = { class: "mt-16" }, Va = { class: "text-center text-sm font-semibold text-fm-color-typo-primary" }, Wa = ["onClick"], Ga = { class: "flex justify-center" }, Ya = { class: "flex items-center min-w-0 gap-8" }, Ba = ["title", "onClick"], Za = { class: "flex justify-center" }, Xa = /* @__PURE__ */ ke({
2708
- __name: "BasePermission",
2709
- props: {
2710
- modelValue: {
2711
- type: Array,
2712
- required: !0
2713
- },
2714
- disable: {
2715
- type: Boolean,
2716
- default: !1
2717
- },
2718
- excludedSubjects: {
2719
- type: Array,
2720
- required: !0
2721
- },
2722
- additionalPermissions: {
2723
- type: Array,
2724
- default: () => []
2725
- },
2726
- /** 'leading': the member sheet's layout, collapsed with the count under each category. */
2727
- layout: {
2728
- type: String,
2729
- default: "trailing"
2730
- }
2731
- },
2732
- emits: ["update:model-value"],
2733
- setup(e, { emit: t }) {
2734
- const n = e, r = t, { t: a } = ze(), o = z(() => [...Wn, ...n.additionalPermissions]), {
2735
- categoryGroups: f,
2736
- isAllManageChecked: m,
2737
- isAllManageIndeterminate: i,
2738
- toggleAllManage: h,
2739
- isManageChecked: E,
2740
- isManageIndeterminate: C,
2741
- toggleManage: T,
2742
- isActionChecked: D,
2743
- isRowFullyCoveredByCover: R,
2744
- isActionCoveredByCover: k,
2745
- permissionDefinesAction: M,
2746
- toggleAction: p,
2747
- isAllActionChecked: b,
2748
- isAllActionIndeterminate: S,
2749
- toggleAllAction: d,
2750
- actionLabel: g
2751
- } = ja(
2752
- qt(n, "modelValue"),
2753
- o,
2754
- qt(n, "excludedSubjects"),
2755
- (A, L) => r("update:model-value", L)
2756
- );
2757
- function y(A) {
2758
- const L = A.selectedSubjects.length;
2759
- return L === 0 && n.layout !== "leading" ? "" : a("team.memberForm.permissions.allowedCount", { count: L });
2760
- }
2761
- function v(A, L) {
2762
- return E(A, L) || R(A, L) ? !0 : A.actionColumns.some(
2763
- (H) => M(A, L, H) && (D(A, L, H) || k(A, L, H))
2764
- );
2765
- }
2766
- return (A, L) => {
2767
- const H = De("FmCheckbox");
2768
- return J(), re("div", xa, [
2769
- (J(!0), re(Me, null, Ee(X(f), (U) => (J(), Ce(Zt, {
2770
- key: U.category,
2771
- subtitle: y(U),
2772
- layout: e.layout,
2773
- "initially-collapsed": e.layout === "leading"
2774
- }, {
2775
- title: ce(() => [
2776
- ie("p", {
2777
- class: ye(e.layout === "leading" ? "text-[18px] font-semibold leading-[24px] tracking-[-0.27px]" : "fm-typo-en-title-sm-600")
2778
- }, Oe(U.label), 3)
2779
- ]),
2780
- default: ce(() => [
2781
- ie("div", Ua, [
2782
- ie("div", {
2783
- class: "grid items-center px-12 py-8",
2784
- style: rt({
2785
- gridTemplateColumns: `minmax(0, 1fr) repeat(${U.actionColumns.length + 1}, 80px)`
2786
- })
2787
- }, [
2788
- L[0] || (L[0] = ie("div", null, null, -1)),
2789
- ie("div", Va, Oe(X(a)("team.memberForm.permissions.columnManage")), 1),
2790
- (J(!0), re(Me, null, Ee(U.actionColumns, (_) => (J(), re("div", {
2791
- key: `header-${_}`,
2792
- class: "text-center text-sm font-semibold text-fm-color-typo-primary"
2793
- }, Oe(X(g)(_)), 1))), 128))
2794
- ], 4),
2795
- ie("div", {
2796
- class: "grid items-center bg-fm-color-neutral-gray-100 px-12 py-8",
2797
- style: rt({
2798
- gridTemplateColumns: `minmax(0, 1fr) repeat(${U.actionColumns.length + 1}, 80px)`
2799
- })
2800
- }, [
2801
- ie("div", {
2802
- class: "cursor-pointer font-semibold",
2803
- onClick: (_) => !e.disable && X(h)(U)
2804
- }, Oe(X(a)("team.labels.all")), 9, Wa),
2805
- ie("div", Ga, [
2806
- oe(H, {
2807
- "model-value": X(m)(U),
2808
- indeterminate: X(i)(U),
2809
- value: !0,
2810
- disabled: e.disable,
2811
- size: "sm",
2812
- dense: "",
2813
- "onUpdate:modelValue": (_) => X(h)(U)
2814
- }, null, 8, ["model-value", "indeterminate", "disabled", "onUpdate:modelValue"])
2815
- ]),
2816
- (J(!0), re(Me, null, Ee(U.actionColumns, (_) => (J(), re("div", {
2817
- key: `all-${_}`,
2818
- class: "flex justify-center"
2819
- }, [
2820
- oe(H, {
2821
- "model-value": X(b)(U, _),
2822
- indeterminate: X(S)(U, _),
2823
- value: _,
2824
- disabled: e.disable,
2825
- size: "sm",
2826
- dense: "",
2827
- "onUpdate:modelValue": (O) => X(d)(U, _, O)
2828
- }, null, 8, ["model-value", "indeterminate", "value", "disabled", "onUpdate:modelValue"])
2829
- ]))), 128))
2830
- ], 4),
2831
- L[1] || (L[1] = ie("div", { class: "h-px bg-fm-color-neutral-gray-200" }, null, -1)),
2832
- (J(!0), re(Me, null, Ee(U.options, (_) => (J(), re("div", {
2833
- key: _.optionKey,
2834
- class: "grid items-center rounded px-12 py-8 transition-colors hover:bg-fm-color-neutral-gray-100",
2835
- style: rt({
2836
- gridTemplateColumns: `minmax(0, 1fr) repeat(${U.actionColumns.length + 1}, 80px)`
2837
- })
2838
- }, [
2839
- ie("div", Ya, [
2840
- ie("span", {
2841
- class: "block truncate cursor-pointer",
2842
- title: _.label,
2843
- onClick: (O) => !e.disable && !X(R)(U, _.value) && X(T)(U, _.value, !X(E)(U, _.value))
2844
- }, Oe(_.label), 9, Ba),
2845
- Se(A.$slots, `checkbox-${_.value}-append`, {
2846
- option: _,
2847
- isEffectiveSelected: v(U, _.value),
2848
- isCoveredByCover: X(R)(U, _.value) || U.actionColumns.some((O) => X(k)(U, _.value, O))
2849
- }),
2850
- Se(A.$slots, `checkbox-${_.value}-icon`, {
2851
- option: _,
2852
- isEffectiveSelected: v(U, _.value),
2853
- isCoveredByCover: X(R)(U, _.value) || U.actionColumns.some((O) => X(k)(U, _.value, O))
2854
- })
2855
- ]),
2856
- ie("div", Za, [
2857
- oe(H, {
2858
- "model-value": X(E)(U, _.value) || X(R)(U, _.value),
2859
- value: _.value,
2860
- disabled: e.disable || X(R)(U, _.value),
2861
- indeterminate: X(C)(U, _.value),
2862
- size: "sm",
2863
- "onUpdate:modelValue": (O) => X(T)(U, _.value, O)
2864
- }, null, 8, ["model-value", "value", "disabled", "indeterminate", "onUpdate:modelValue"])
2865
- ]),
2866
- (J(!0), re(Me, null, Ee(U.actionColumns, (O) => (J(), re("div", {
2867
- key: `${_.optionKey}-${O}`,
2868
- class: "flex justify-center"
2869
- }, [
2870
- X(M)(U, _.value, O) ? (J(), Ce(H, {
2871
- key: 0,
2872
- "model-value": X(D)(U, _.value, O) || X(k)(U, _.value, O),
2873
- value: O,
2874
- disabled: e.disable || X(k)(U, _.value, O),
2875
- size: "sm",
2876
- "onUpdate:modelValue": (P) => X(p)(_.value, O, P)
2877
- }, null, 8, ["model-value", "value", "disabled", "onUpdate:modelValue"])) : Ne("", !0)
2878
- ]))), 128))
2879
- ], 4))), 128))
2880
- ])
2881
- ]),
2882
- _: 2
2883
- }, 1032, ["subtitle", "layout", "initially-collapsed"]))), 128))
2884
- ]);
2885
- };
2886
- }
2887
- }), Ha = { class: "space-y-16" }, Ja = {
2888
- key: 0,
2889
- class: "flex fm-typo-en-title-sm-600"
2890
- }, $a = {
2891
- key: 0,
2892
- class: "q-mr-xs text-red col"
2893
- }, za = { class: "form-input" }, Ka = /* @__PURE__ */ ke({
2894
- __name: "AppForm",
2895
- props: {
2896
- title: {
2897
- type: String,
2898
- default: void 0
2899
- },
2900
- required: {
2901
- type: [Boolean, String],
2902
- default: !1
2903
- },
2904
- inline: {
2905
- type: Boolean,
2906
- default: !1
2907
- }
2908
- },
2909
- setup(e) {
2910
- const t = e;
2911
- return (n, r) => (J(), re("div", Ha, [
2912
- Se(n.$slots, "top", {}, () => [
2913
- t.title ? (J(), re("div", Ja, [
2914
- ie("div", null, [
2915
- t.required ? (J(), re("span", $a, "*")) : Ne("", !0),
2916
- _r(Oe(t.title), 1)
2917
- ]),
2918
- Se(n.$slots, "title-right")
2919
- ])) : Ne("", !0)
2920
- ]),
2921
- ie("div", za, [
2922
- Se(n.$slots, "default")
2923
- ])
2924
- ]));
2925
- }
2926
- }), Qa = { class: "col flex items-center" }, qa = {
2927
- key: 1,
2928
- class: "q-pa-sm form-error-message text-error"
2929
- }, ir = /* @__PURE__ */ ke({
2930
- __name: "CheckboxInput",
2931
- props: {
2932
- options: {
2933
- type: Array,
2934
- required: !0
2935
- },
2936
- title: {
2937
- type: String,
2938
- required: !0
2939
- },
2940
- modelValue: {
2941
- type: Array,
2942
- required: !0
2943
- },
2944
- showAllToggle: {
2945
- type: [Boolean, String],
2946
- default: !0
2947
- },
2948
- includeDisabledOptionsWhenSelectAll: {
2949
- type: Boolean,
2950
- default: !1
2951
- },
2952
- disable: {
2953
- type: Boolean,
2954
- default: !1
2955
- },
2956
- min: {
2957
- type: Number,
2958
- default: 0
2959
- },
2960
- max: {
2961
- type: Number,
2962
- default: void 0
2963
- },
2964
- showIntermediate: {
2965
- type: Boolean,
2966
- default: !0
2967
- },
2968
- gutter: {
2969
- type: Number,
2970
- default: void 0
2971
- },
2972
- falsyShowSlot: {
2973
- type: Boolean,
2974
- default: !1
2975
- },
2976
- bottomSlotIndent: {
2977
- type: String,
2978
- default: "36px"
2979
- },
2980
- alignCenter: {
2981
- type: Boolean,
2982
- default: !0
2983
- }
2984
- },
2985
- emits: ["update:model-value"],
2986
- setup(e, { emit: t }) {
2987
- const n = e, r = t, { t: a } = ze(), o = st(!1), f = pr(), m = z(() => n.modelValue.length < n.min ? `Min selection ${n.min}` : n.max !== void 0 && n.modelValue.length > n.max ? `Max selection ${n.max}` : !0), i = `checkbox-${Dr(6)}`, h = z(() => m.value !== !0), E = z(
2988
- () => n.modelValue.filter((k) => n.options.some((M) => M.value === k))
2989
- ), C = z(
2990
- () => typeof n.showAllToggle == "boolean" ? a("team.labels.all") : n.showAllToggle
2991
- ), T = z(() => n.options.length > 0 && n.options.length === E.value.length);
2992
- function D() {
2993
- const k = n.modelValue.filter((M) => !E.value.includes(M));
2994
- if (T.value === !0)
2995
- r("update:model-value", k);
2996
- else {
2997
- const M = n.includeDisabledOptionsWhenSelectAll ? n.options.map((p) => p.value) : n.options.filter((p) => !p.disabled).map((p) => p.value);
2998
- r("update:model-value", [...k, ...M]);
2999
- }
3000
- }
3001
- function R(k, M) {
3002
- let p = Bn(n.modelValue);
3003
- M ? p.every((b) => b !== k) && p.push(k) : p = p.filter((b) => b !== k), r("update:model-value", p);
3004
- }
3005
- return (k, M) => {
3006
- const p = De("FmCheckbox");
3007
- return J(), Ce(Ka, {
3008
- id: i,
3009
- title: e.title,
3010
- required: !1
3011
- }, {
3012
- top: ce(() => [
3013
- Se(k.$slots, "top")
3014
- ]),
3015
- default: ce(() => [
3016
- n.showAllToggle ? (J(), Ce(p, {
3017
- key: 0,
3018
- "model-value": T.value,
3019
- disabled: e.disable,
3020
- label: C.value,
3021
- style: rt(`margin-bottom: ${n.gutter}px`),
3022
- size: "sm",
3023
- dense: "",
3024
- value: C.value,
3025
- "onUpdate:modelValue": D
3026
- }, null, 8, ["model-value", "disabled", "label", "style", "value"])) : Ne("", !0),
3027
- (J(!0), re(Me, null, Ee(e.options, (b, S) => (J(), re("div", {
3028
- key: b.value,
3029
- style: rt(`margin-bottom: ${S < e.options.length - 1 ? n.gutter : 0}px`),
3030
- class: ye(S < e.options.length - 1 ? "q-mb-sm" : "")
3031
- }, [
3032
- ie("div", {
3033
- class: ye(["row justify-between", e.alignCenter ? "items-center" : "items-start"])
3034
- }, [
3035
- ie("div", Qa, [
3036
- oe(p, {
3037
- "model-value": e.modelValue.includes(b.value),
3038
- disabled: e.disable || b.disabled,
3039
- size: "sm",
3040
- label: b.label,
3041
- value: b.label,
3042
- "onUpdate:modelValue": (d) => R(b.value, d)
3043
- }, null, 8, ["model-value", "disabled", "label", "value", "onUpdate:modelValue"]),
3044
- Se(k.$slots, `checkbox-${b.key || b.value}-append`, {
3045
- option: b,
3046
- selected: e.modelValue.includes(b.value)
3047
- })
3048
- ]),
3049
- X(f)[`checkbox-${b.key || b.value}-end`] && (e.modelValue.includes(b.value) || e.falsyShowSlot) ? (J(), re("div", {
3050
- key: 0,
3051
- class: ye([{ "q-checkbox disabled": e.disable || b.disabled }, "col"])
3052
- }, [
3053
- Se(k.$slots, `checkbox-${b.key || b.value}-end`, {
3054
- option: b,
3055
- value: e.modelValue.includes(b.value),
3056
- disable: e.disable || b.disabled
3057
- })
3058
- ], 2)) : Ne("", !0)
3059
- ], 2),
3060
- X(f)[`checkbox-${b.key || b.value}-bottom`] && (e.modelValue.includes(b.value) || e.falsyShowSlot) ? (J(), re("div", {
3061
- key: 0,
3062
- class: ye(["q-mt-sm", { "q-checkbox disabled": e.disable || b.disabled }]),
3063
- style: rt(`margin-left: ${e.bottomSlotIndent}`)
3064
- }, [
3065
- Se(k.$slots, `checkbox-${b.key || b.value}-bottom`, {
3066
- option: b,
3067
- disable: e.disable || b.disabled,
3068
- value: e.modelValue.includes(b.value)
3069
- })
3070
- ], 6)) : Ne("", !0)
3071
- ], 6))), 128)),
3072
- o.value && h.value ? (J(), re("div", qa, Oe(m.value), 1)) : Ne("", !0)
3073
- ]),
3074
- _: 3
3075
- }, 8, ["title"]);
3076
- };
3077
- }
3078
- }), bt = "includedFuture", Dn = /* @__PURE__ */ ke({
3079
- __name: "ConditionPermission",
3080
- props: {
3081
- modelValue: {
3082
- type: Array,
3083
- default: null
3084
- },
3085
- options: {
3086
- type: Array,
3087
- required: !0
3088
- },
3089
- disable: {
3090
- type: Boolean,
3091
- default: !1
3092
- },
3093
- context: {
3094
- type: String,
3095
- required: !0
3096
- },
3097
- /** 'leading': the member sheet's layout, with the chosen names under the title. */
3098
- layout: {
3099
- type: String,
3100
- default: "trailing"
3101
- }
3102
- },
3103
- emits: ["update:model-value"],
3104
- setup(e, { emit: t }) {
3105
- const n = e, r = t, { t: a } = ze(), o = z(() => [
3106
- {
3107
- label: a("team.memberForm.permissions.includedFuture", { context: n.context }),
3108
- value: bt,
3109
- // Can only be selected if all other options are selected
3110
- disabled: !!n.modelValue && n.options.length > n.modelValue.length
3111
- },
3112
- ...n.options.filter(
3113
- (E) => E.label.toLocaleLowerCase().includes(h.value.toLocaleLowerCase())
3114
- )
3115
- ]), f = z(() => n.modelValue ? n.modelValue : [bt, ...n.options.map((E) => E.value)]), m = z(() => {
3116
- if (n.layout === "leading") {
3117
- const C = n.modelValue ? n.options.filter((T) => n.modelValue.includes(T.value)).map((T) => T.label) : null;
3118
- return Zn(C, {
3119
- all: a("team.labels.all"),
3120
- none: a("team.labels.none"),
3121
- more: (T) => a("team.labels.more", { count: T })
3122
- });
3123
- }
3124
- const E = f.value.filter((C) => C !== bt).length;
3125
- return E === 0 ? "" : a("team.memberForm.permissions.allowedCount", { count: E });
3126
- });
3127
- function i(E) {
3128
- const C = E.length === o.value.length;
3129
- r("update:model-value", C ? null : E.filter((T) => T !== bt));
3130
- }
3131
- const h = st("");
3132
- return (E, C) => {
3133
- const T = De("fm-search");
3134
- return J(), Ce(Zt, {
3135
- subtitle: m.value,
3136
- layout: e.layout,
3137
- "initially-collapsed": e.layout === "leading"
3138
- }, {
3139
- title: ce(() => [
3140
- ie("p", {
3141
- class: ye(
3142
- e.layout === "leading" ? "text-[18px] font-semibold leading-[24px] tracking-[-0.27px]" : "fm-typo-en-title-sm-600"
3143
- )
3144
- }, Oe(X(a)("team.memberForm.permissions.manageable", { context: e.context })), 3)
3145
- ]),
3146
- default: ce(() => [
3147
- e.options.length > 1 ? (J(), Ce(T, {
3148
- key: 0,
3149
- modelValue: h.value,
3150
- "onUpdate:modelValue": C[0] || (C[0] = (D) => h.value = D),
3151
- class: "mt-16",
3152
- placeholder: X(a)("team.memberForm.permissions.search", { context: e.context })
3153
- }, null, 8, ["modelValue", "placeholder"])) : Ne("", !0),
3154
- oe(ir, {
3155
- "model-value": f.value,
3156
- options: o.value,
3157
- "show-intermediate": !1,
3158
- "show-all-toggle": !0,
3159
- disable: e.disable,
3160
- "include-disabled-options-when-select-all": !0,
3161
- title: "",
3162
- class: "mt-16",
3163
- "onUpdate:modelValue": i
3164
- }, tt({ _: 2 }, [
3165
- Ee(o.value, (D) => ({
3166
- name: `checkbox-${D.value}-append`,
3167
- fn: ce(({ option: R }) => [
3168
- Se(E.$slots, `checkbox-${D.value}-append`, { option: R })
3169
- ])
3170
- }))
3171
- ]), 1032, ["model-value", "options", "disable"])
3172
- ]),
3173
- _: 3
3174
- }, 8, ["subtitle", "layout", "initially-collapsed"]);
3175
- };
3176
- }
3177
- }), ht = "includedNewRole", eo = /* @__PURE__ */ ke({
3178
- __name: "PosRolePermission",
3179
- props: {
3180
- modelValue: {
3181
- type: Array,
3182
- default: null
3183
- },
3184
- roles: {
3185
- type: Array,
3186
- required: !0
3187
- },
3188
- restaurantIds: {
3189
- type: Array,
3190
- default: null
3191
- },
3192
- disable: {
3193
- type: Boolean,
3194
- default: !1
3195
- },
3196
- /** 'leading': the member sheet's layout, with the chosen roles under the title. */
3197
- layout: {
3198
- type: String,
3199
- default: "trailing"
3200
- }
3201
- },
3202
- emits: ["update:model-value"],
3203
- setup(e, { emit: t }) {
3204
- const n = e, r = t, { t: a } = ze(), o = z(() => {
3205
- const h = n.restaurantIds;
3206
- return [
3207
- {
3208
- label: a("team.memberForm.permissions.includedNewRole"),
3209
- value: ht,
3210
- disabled: !!n.modelValue && n.roles.length > n.modelValue.length
3211
- },
3212
- ...n.roles.map((E) => ({
3213
- label: E.name,
3214
- value: E._id,
3215
- disabled: !!h && E.restaurants.every(({ id: C }) => !h.includes(C))
3216
- }))
3217
- ];
3218
- }), f = z(() => n.modelValue ? n.modelValue : [ht, ...n.roles.map((h) => h._id)]), m = z(() => {
3219
- if (n.layout === "leading") {
3220
- const E = n.modelValue ? n.roles.filter((C) => n.modelValue.includes(C._id)).map((C) => C.name) : null;
3221
- return Zn(E, {
3222
- all: a("team.labels.all"),
3223
- none: a("team.labels.none"),
3224
- more: (C) => a("team.labels.more", { count: C })
3225
- });
3226
- }
3227
- const h = f.value.filter((E) => E !== ht).length;
3228
- return h === 0 ? "" : a("team.memberForm.permissions.allowedCount", { count: h });
3229
- });
3230
- function i(h) {
3231
- const E = h.length === o.value.length;
3232
- r("update:model-value", E ? null : h.filter((C) => C !== ht));
3233
- }
3234
- return (h, E) => (J(), Ce(Zt, {
3235
- subtitle: m.value,
3236
- layout: e.layout,
3237
- "initially-collapsed": e.layout === "leading"
3238
- }, {
3239
- title: ce(() => [
3240
- ie("p", {
3241
- class: ye(
3242
- e.layout === "leading" ? "text-[18px] font-semibold leading-[24px] tracking-[-0.27px]" : "fm-typo-en-title-sm-600"
3243
- )
3244
- }, Oe(X(a)("team.memberForm.permissions.roles")), 3)
3245
- ]),
3246
- default: ce(() => [
3247
- oe(ir, {
3248
- "model-value": f.value,
3249
- options: o.value,
3250
- "show-intermediate": !1,
3251
- "show-all-toggle": !1,
3252
- disable: e.disable,
3253
- title: "",
3254
- class: "mt-16",
3255
- "onUpdate:modelValue": i
3256
- }, tt({ _: 2 }, [
3257
- Ee(o.value, (C) => ({
3258
- name: `checkbox-${C.value}-append`,
3259
- fn: ce(({ option: T }) => [
3260
- Se(h.$slots, `checkbox-${C.value}-append`, { option: T })
3261
- ])
3262
- }))
3263
- ]), 1032, ["model-value", "options", "disable"])
3264
- ]),
3265
- _: 3
3266
- }, 8, ["subtitle", "layout", "initially-collapsed"]));
3267
- }
3268
- }), to = {
3269
- key: 0,
3270
- class: "flex flex-col gap-8"
3271
- }, no = {
3272
- key: 0,
3273
- class: "ml-32",
3274
- style: { "font-size": "12px", "line-height": "16px", color: "#8a8f98", "font-weight": "400" }
3275
- }, ro = {
3276
- key: 0,
3277
- class: "ml-32"
3278
- }, wn = /* @__PURE__ */ ke({
3279
- __name: "PortalConditionForm",
3280
- props: {
3281
- entry: {},
3282
- builders: {},
3283
- subject: {},
3284
- timeZone: {},
3285
- coverOverride: {},
3286
- inheritModeFor: {},
3287
- formValueFor: {},
3288
- hasChanges: { type: Boolean },
3289
- disable: { type: Boolean, default: !1 },
3290
- fullWidth: { type: Boolean, default: !1 },
3291
- title: { default: "" }
3292
- },
3293
- emits: ["update-inherit-mode", "update-form", "apply"],
3294
- setup(e, { emit: t }) {
3295
- const n = t, { t: r } = ze();
3296
- return (a, o) => {
3297
- const f = De("FmRadio"), m = De("FmRadioGroup");
3298
- return J(), Ce(Sr, {
3299
- title: e.title,
3300
- builders: e.builders,
3301
- "form-value-for": e.formValueFor,
3302
- "has-changes": e.hasChanges,
3303
- disable: e.disable,
3304
- "full-width": e.fullWidth,
3305
- onUpdateForm: o[0] || (o[0] = (i) => n("update-form", i)),
3306
- onApply: o[1] || (o[1] = (i) => n("apply"))
3307
- }, {
3308
- section: ce(({ builder: i }) => [
3309
- e.coverOverride.shouldShowInheritToggle(e.entry, i) ? (J(), re("div", to, [
3310
- oe(m, {
3311
- "model-value": e.inheritModeFor(i),
3312
- disabled: e.disable,
3313
- "onUpdate:modelValue": (h) => n("update-inherit-mode", { builder: i, mode: h })
3314
- }, {
3315
- default: ce(() => [
3316
- ie("div", null, [
3317
- oe(f, {
3318
- value: "inherit",
3319
- label: X(r)("team.memberForm.permissions.conditionCover.inherit", {
3320
- cover: e.coverOverride.coverLabel(e.subject)
3321
- })
3322
- }, null, 8, ["label"]),
3323
- e.coverOverride.inheritedSummary(e.entry, i, e.timeZone) ? (J(), re("p", no, " (" + Oe(X(r)(
3324
- e.coverOverride.inheritedSummary(e.entry, i, e.timeZone).labelKey,
3325
- e.coverOverride.inheritedSummary(e.entry, i, e.timeZone).params ?? {}
3326
- )) + ") ", 1)) : Ne("", !0)
3327
- ]),
3328
- oe(f, {
3329
- value: "custom",
3330
- label: X(r)("team.memberForm.permissions.conditionCover.custom")
3331
- }, null, 8, ["label"])
3332
- ]),
3333
- _: 2
3334
- }, 1032, ["model-value", "disabled", "onUpdate:modelValue"]),
3335
- e.inheritModeFor(i) === "custom" ? (J(), re("div", ro, [
3336
- oe(nn, {
3337
- builder: i,
3338
- "model-value": e.formValueFor(i),
3339
- disable: e.disable,
3340
- "onUpdate:modelValue": (h) => n("update-form", { builder: i, form: h })
3341
- }, null, 8, ["builder", "model-value", "disable", "onUpdate:modelValue"])
3342
- ])) : Ne("", !0)
3343
- ])) : (J(), Ce(nn, {
3344
- key: 1,
3345
- builder: i,
3346
- "model-value": e.formValueFor(i),
3347
- disable: e.disable,
3348
- "onUpdate:modelValue": (h) => n("update-form", { builder: i, form: h })
3349
- }, null, 8, ["builder", "model-value", "disable", "onUpdate:modelValue"]))
3350
- ]),
3351
- _: 1
3352
- }, 8, ["title", "builders", "form-value-for", "has-changes", "disable", "full-width"]);
3353
- };
3354
- }
3355
- }), so = {
3356
- async readWarehouses() {
3357
- return Rr(await Mr().get("/warehouses"));
3358
- }
3359
- };
3360
- function Fn(e, t) {
3361
- return Gn(e, Yn).some(
3362
- (n) => n.subject === t && !n.inverted && n.actions.includes("manage")
3363
- );
3364
- }
3365
- function Pn(e, t) {
3366
- return e.some((n) => n.subject === t && n.inverted) ? e : [...e, { subject: t, actions: ["manage"], inverted: !0 }];
3367
- }
3368
- function jn(e, t, n) {
3369
- const { category: r, showByFeatureFlag: a, isCategoryCover: o, ...f } = e;
3370
- return {
3371
- ...f,
3372
- actions: t,
3373
- ...n !== void 0 && { conditions: n }
3374
- };
3375
- }
3376
- function ao(e, t, n, r) {
3377
- const a = new Set(
3378
- e.filter((i) => !i.inverted).map((i) => i.subject)
3379
- ), o = new Set(
3380
- t.filter((i) => !i.inverted).map((i) => i.subject)
3381
- ), f = new Set(
3382
- n.filter((i) => !i.inverted).map((i) => i.subject)
3383
- );
3384
- let m = [...n];
3385
- for (const i of a)
3386
- o.has(i) || (f.has(i) && (m = m.filter((E) => E.subject !== i)), (!f.has(i) || Fn(m, i)) && (m = Pn(m, i)));
3387
- for (const i of o)
3388
- if (!a.has(i)) {
3389
- const h = m.some((E) => E.subject === i && E.inverted);
3390
- if (m = m.filter((E) => !(E.subject === i && E.inverted)), !h && !f.has(i)) {
3391
- const E = t.find(
3392
- (T) => T.subject === i && !T.inverted
3393
- ), C = r(i);
3394
- C && E && m.push(jn(C, E.actions, E.conditions));
3395
- }
3396
- }
3397
- for (const i of o) {
3398
- if (!a.has(i)) continue;
3399
- const h = e.find((R) => R.subject === i && !R.inverted), E = t.find((R) => R.subject === i && !R.inverted);
3400
- if (!h || !E) continue;
3401
- const C = new Set(h.actions), T = new Set(E.actions);
3402
- if (C.size === T.size && [...C].every((R) => T.has(R)))
3403
- continue;
3404
- const D = m.findIndex((R) => R.subject === i && !R.inverted);
3405
- if (D >= 0)
3406
- m[D] = {
3407
- ...m[D],
3408
- actions: Array.from(T)
3409
- };
3410
- else {
3411
- const R = r(i);
3412
- R && m.push(jn(R, Array.from(T)));
3413
- }
3414
- C.has("manage") && !T.has("manage") && Fn(m, i) && (m = Pn(m, i)), !C.has("manage") && T.has("manage") && (m = m.filter((R) => !(R.subject === i && R.inverted)));
3415
- }
3416
- return m;
3417
- }
3418
- const oo = {
3419
- MY: "Asia/Kuala_Lumpur",
3420
- SG: "Asia/Singapore",
3421
- TH: "Asia/Bangkok",
3422
- ID: "Asia/Jakarta",
3423
- MO: "Asia/Macau",
3424
- BN: "Asia/Brunei",
3425
- PK: "Asia/Karachi",
3426
- MV: "Indian/Maldives",
3427
- VN: "Asia/Ho_Chi_Minh",
3428
- JP: "Asia/Tokyo",
3429
- AU: "Australia/Sydney",
3430
- AE: "Asia/Dubai",
3431
- UK: "Europe/London"
3432
- };
3433
- function lo(e) {
3434
- const t = (e || "").toUpperCase();
3435
- return oo[t] ?? Intl.DateTimeFormat().resolvedOptions().timeZone;
3436
- }
3437
- function io(e, t) {
3438
- return e != null && e.timezone ? e.timezone : e != null && e.timeZone ? e.timeZone : lo((e == null ? void 0 : e.country) ?? t);
3439
- }
3440
- function gt(e, t) {
3441
- return `${e}::${t.builderKey}`;
3442
- }
3443
- function Ze(e) {
3444
- try {
3445
- return e.conditions ? JSON.parse(e.conditions) : void 0;
3446
- } catch {
3447
- return;
3448
- }
3449
- }
3450
- function co(e, t) {
3451
- return e.find((n) => !n.inverted && n.subject === t);
3452
- }
3453
- function Rt(e, t) {
3454
- const n = new Set(e.actions);
3455
- return n.has(Be.Action.manage) ? !0 : t.actions.every((r) => n.has(r));
3456
- }
3457
- function Yt(e, t) {
3458
- const n = Ze(e);
3459
- return Dt(n, [{ builder: t, formValue: t.fromCondition(void 0) }]);
3460
- }
3461
- function xn(e, t, n) {
3462
- return {
3463
- ...Yt(e, n),
3464
- ...nt(Ze(t), n)
3465
- };
3466
- }
3467
- function uo(e, t, n) {
3468
- const r = st(/* @__PURE__ */ new Set());
3469
- function a(d) {
3470
- return Ir(d, t.value);
3471
- }
3472
- function o(d) {
3473
- return t.value.find((g) => g.subject === d);
3474
- }
3475
- function f(d) {
3476
- var y;
3477
- const g = a(d);
3478
- return g ? (y = o(g)) == null ? void 0 : y.label : void 0;
3479
- }
3480
- function m(d) {
3481
- return co(e.value, d);
3482
- }
3483
- function i(d, g) {
3484
- return nt(Ze(d), g);
3485
- }
3486
- function h(d, g) {
3487
- var A;
3488
- if (!(((A = g.appliesToActions) == null ? void 0 : A.call(g, d.actions)) ?? !0)) return !1;
3489
- const y = a(d.subject);
3490
- if (!y) return !1;
3491
- const v = m(y);
3492
- return v ? Object.keys(i(v, g)).length > 0 : !1;
3493
- }
3494
- function E(d, g) {
3495
- if (!h(d, g) || r.value.has(gt(d.subject, g))) return "custom";
3496
- if (d.index === null) return "inherit";
3497
- const y = e.value[d.index], v = a(d.subject), A = v ? m(v) : void 0;
3498
- if (y && A) {
3499
- const L = nt(Ze(y), g), H = i(A, g);
3500
- if (JSON.stringify(L) === JSON.stringify(H)) return "inherit";
3501
- }
3502
- return "custom";
3503
- }
3504
- function C(d, g, y) {
3505
- if (!g.summarizeForm) return;
3506
- const v = a(d.subject);
3507
- if (!v) return;
3508
- const A = m(v);
3509
- if (!A) return;
3510
- const L = g.fromCondition(i(A, g));
3511
- return g.summarizeForm(L, { timeZone: y });
3512
- }
3513
- function T(d, g) {
3514
- if (d.index === null) return;
3515
- const y = [...e.value], v = { ...y[d.index] }, A = Yt(v, g), L = Object.keys(A).length === 0, H = a(d.subject), U = H ? m(H) : void 0, _ = U ? Rt(U, v) : !1;
3516
- if (L && _)
3517
- y.splice(d.index, 1);
3518
- else if (U) {
3519
- const O = xn(v, U, g);
3520
- Object.keys(O).length === 0 ? delete v.conditions : v.conditions = JSON.stringify(O), y[d.index] = v;
3521
- } else
3522
- L ? delete v.conditions : v.conditions = JSON.stringify(A), y[d.index] = v;
3523
- n(y);
3524
- }
3525
- function D(d, g, y) {
3526
- const v = gt(d.subject, g);
3527
- if (y === "inherit") {
3528
- const L = new Set(r.value);
3529
- L.delete(v), r.value = L, T(d, g);
3530
- return;
3531
- }
3532
- const A = new Set(r.value);
3533
- A.add(v), r.value = A, d.index === null && b(d, g, g.fromCondition(void 0), {
3534
- forceCreateRule: !0
3535
- });
3536
- }
3537
- function R(d) {
3538
- const g = a(d);
3539
- if (!g) return [];
3540
- const y = m(g);
3541
- return (y == null ? void 0 : y.actions) ?? [];
3542
- }
3543
- function k(d, g) {
3544
- return e.value.filter((y) => {
3545
- if (y.inverted) return !1;
3546
- const v = y.subject;
3547
- return v === d || a(v) !== d ? !1 : r.value.has(gt(v, g)) ? !0 : Object.keys(nt(Ze(y), g)).length > 0;
3548
- });
3549
- }
3550
- function M(d, g) {
3551
- const y = `::${g.builderKey}`, v = new Set(r.value);
3552
- for (const A of v) {
3553
- if (!A.endsWith(y)) continue;
3554
- const L = A.slice(0, -y.length);
3555
- a(L) === d && v.delete(A);
3556
- }
3557
- r.value = v;
3558
- }
3559
- function p(d, g, y) {
3560
- const v = g.subject;
3561
- return d.reduce((A, L) => {
3562
- if (L.inverted)
3563
- return A.push(L), A;
3564
- const H = L.subject;
3565
- if (H === v || a(H) !== v)
3566
- return A.push(L), A;
3567
- if (Rt(g, L) && Object.keys(Yt(L, y)).length === 0)
3568
- return A;
3569
- const _ = xn(L, g, y);
3570
- if (Object.keys(_).length === 0) {
3571
- const { conditions: O, ...P } = L;
3572
- A.push(P);
3573
- } else
3574
- A.push({ ...L, conditions: JSON.stringify(_) });
3575
- return A;
3576
- }, []);
3577
- }
3578
- function b(d, g, y, v = {}) {
3579
- var F;
3580
- const A = [...e.value];
3581
- let L = d.index;
3582
- const H = g.toCondition(y), U = Object.keys(H).length > 0;
3583
- if (L === null && !U && !v.forceCreateRule) return;
3584
- if (L === null) {
3585
- const w = A.findIndex((V) => !V.inverted && V.subject === d.subject);
3586
- if (w !== -1)
3587
- L = w;
3588
- else {
3589
- const V = t.value.find((K) => K.subject === d.subject);
3590
- if (!V) return;
3591
- const {
3592
- category: j,
3593
- showByFeatureFlag: Y,
3594
- isCategoryCover: Z,
3595
- ...te
3596
- } = V;
3597
- A.push({
3598
- ...te,
3599
- actions: d.actions.length > 0 ? d.actions : te.actions
3600
- }), L = A.length - 1;
3601
- }
3602
- }
3603
- const _ = { ...A[L] };
3604
- _.actions = [
3605
- .../* @__PURE__ */ new Set([..._.actions, ...d.actions])
3606
- ];
3607
- const O = Ze(_), P = Dt(O, [{ builder: g, formValue: y }]);
3608
- if (Object.keys(P).length === 0 ? delete _.conditions : _.conditions = JSON.stringify(P), A[L] = _, tn(d.subject, t.value)) {
3609
- const w = k(d.subject, g), V = () => {
3610
- var Y;
3611
- M(d.subject, g), n(p(A, _, g)), (Y = v.afterCommit) == null || Y.call(v);
3612
- }, j = () => {
3613
- var Y;
3614
- n(A), (Y = v.afterCommit) == null || Y.call(v);
3615
- };
3616
- if (w.length === 0) {
3617
- V();
3618
- return;
3619
- }
3620
- v.onOverridesConflict ? v.onOverridesConflict({ override: V, keep: j }) : j();
3621
- return;
3622
- }
3623
- n(A), (F = v.afterCommit) == null || F.call(v);
3624
- }
3625
- function S(d, g, y = {}) {
3626
- if (g.length === 0) return;
3627
- const v = [...e.value];
3628
- let A = v.findIndex((w) => !w.inverted && w.subject === d.subject), L = A === -1 ? void 0 : { ...v[A] }, H = Ze(L ?? {}) ?? {};
3629
- for (const w of g) {
3630
- const V = w.mode === "inherit" ? w.builder.fromCondition(void 0) : w.form;
3631
- H = Dt(H, [{ builder: w.builder, formValue: V }]);
3632
- }
3633
- const U = g.some((w) => w.mode === "custom");
3634
- if (!L && (Object.keys(H).length > 0 || U)) {
3635
- const w = t.value.find((te) => te.subject === d.subject);
3636
- if (!w) return;
3637
- const {
3638
- category: V,
3639
- showByFeatureFlag: j,
3640
- isCategoryCover: Y,
3641
- ...Z
3642
- } = w;
3643
- L = {
3644
- ...Z,
3645
- actions: d.actions.length > 0 ? d.actions : Z.actions
3646
- }, v.push(L), A = v.length - 1;
3647
- }
3648
- if (L) {
3649
- const w = a(d.subject), V = w ? m(w) : void 0;
3650
- if (!U && Object.keys(H).length === 0 && !!V && Rt(V, L))
3651
- v.splice(A, 1), L = void 0;
3652
- else {
3653
- if (L.actions = [
3654
- .../* @__PURE__ */ new Set([...L.actions, ...d.actions])
3655
- ], V)
3656
- for (const Y of g)
3657
- Y.mode === "inherit" && (H = {
3658
- ...H,
3659
- ...nt(Ze(V), Y.builder)
3660
- });
3661
- Object.keys(H).length === 0 ? delete L.conditions : L.conditions = JSON.stringify(H), v[A] = L;
3662
- }
3663
- }
3664
- const _ = () => {
3665
- const w = new Set(r.value);
3666
- for (const V of g) {
3667
- const j = gt(d.subject, V.builder);
3668
- V.mode === "custom" ? w.add(j) : w.delete(j);
3669
- }
3670
- r.value = w;
3671
- }, O = (w) => {
3672
- var V;
3673
- _(), n(w), (V = y.afterCommit) == null || V.call(y);
3674
- };
3675
- if (!tn(d.subject, t.value) || !L) {
3676
- O(v);
3677
- return;
3678
- }
3679
- const P = g.map((w) => w.builder).filter((w) => k(d.subject, w).length > 0), F = () => {
3680
- let w = v;
3681
- for (const V of g.map((j) => j.builder))
3682
- M(d.subject, V), w = p(w, L, V);
3683
- O(w);
3684
- };
3685
- if (P.length > 0 && y.onOverridesConflict) {
3686
- y.onOverridesConflict({ override: F, keep: () => O(v) });
3687
- return;
3688
- }
3689
- P.length > 0 ? O(v) : F();
3690
- }
3691
- return {
3692
- getCoverSubject: a,
3693
- coverLabel: f,
3694
- shouldShowInheritToggle: h,
3695
- inheritMode: E,
3696
- setInheritMode: D,
3697
- inheritedSummary: C,
3698
- getEffectiveActions: R,
3699
- updateBuilderCondition: b,
3700
- applyConditionDrafts: S
3701
- };
3702
- }
3703
- const mo = { class: "h-[24px] w-[24px] flex items-center justify-center" }, fo = { class: "h-[24px] w-[24px] flex items-center justify-center" }, _o = "condition-form-select-menu", Lo = /* @__PURE__ */ ke({
3704
- __name: "PortalPermissionEditor",
3705
- props: /* @__PURE__ */ en({
3706
- disable: {
3707
- type: Boolean,
3708
- default: !1
3709
- },
3710
- inheritPermissions: {
3711
- type: Array,
3712
- default: () => []
3713
- },
3714
- /**
3715
- * 'all': every section in its own box (permission roles page).
3716
- * 'workplace': only manageable restaurant / warehouse / usable POS roles ("Where they work").
3717
- * 'portal': only the portal permission categories ("Portal access").
3718
- * The member sheet renders the two parts in separate cards over the same rules.
3719
- */
3720
- part: {
3721
- type: String,
3722
- default: "all"
3723
- }
3724
- }, {
3725
- modelValue: { default: () => [] },
3726
- modelModifiers: {}
3727
- }),
3728
- emits: /* @__PURE__ */ en(["permissionChanged"], ["update:modelValue"]),
3729
- setup(e, { emit: t }) {
3730
- const n = vr(e, "modelValue"), r = e, a = z(() => r.part === "all" ? "trailing" : "leading"), o = z(
3731
- () => r.part === "all" ? "p-16 fm-corner-radius-lg border border-fm-color-neutral-gray-200" : ""
3732
- ), f = t, { t: m } = ze(), i = br(), h = hr(), { breakpoints: E } = gr(), C = z(() => E.value.xs || E.value.sm), {
3733
- fetchCustomReportPermissions: T,
3734
- customReportPermissions: D
3735
- } = yr(), R = z(() => [
3736
- ...Wn,
3737
- ...D.value
3738
- ]), k = z(() => {
3739
- const s = i.currentBusiness.value, c = i.currentCountry.value, I = c instanceof Object ? c.code : c;
3740
- return io(s, I);
3741
- });
3742
- function M(s) {
3743
- return R.value.find((c) => c.subject === s);
3744
- }
3745
- function p(s, c) {
3746
- return rn(s).filter(
3747
- (I) => {
3748
- var x;
3749
- return ((x = I.appliesToActions) == null ? void 0 : x.call(I, c)) ?? !0;
3750
- }
3751
- );
3752
- }
3753
- const b = z(() => {
3754
- const s = R.value.filter((I) => !y.includes(I.subject)).map((I) => I.subject);
3755
- return Er(
3756
- r.inheritPermissions.map((I) => ({
3757
- ...I,
3758
- permissions: I.permissions.filter((x) => s.includes(x.subject))
3759
- }))
3760
- ).map((I) => ({
3761
- id: I.subject,
3762
- setNames: I.setNames
3763
- }));
3764
- }), S = z(() => {
3765
- const s = r.inheritPermissions.map((c) => ({
3766
- ...c,
3767
- permissions: c.permissions.filter(
3768
- (I) => I.subject === Be.Subject.Business.inventory_stock
3769
- )
3770
- }));
3771
- return St(
3772
- s,
3773
- "warehouseId",
3774
- A.value.map((c) => c._id)
3775
- );
3776
- }), d = z(() => {
3777
- const s = r.inheritPermissions.map((c) => ({
3778
- ...c,
3779
- permissions: c.permissions.filter(
3780
- (I) => I.subject === Be.Subject.Restaurant.restaurant
3781
- )
3782
- }));
3783
- return St(
3784
- s,
3785
- "restaurantId",
3786
- _.value.map((c) => c._id)
3787
- );
3788
- }), g = z(() => {
3789
- const s = r.inheritPermissions.map((c) => ({
3790
- ...c,
3791
- permissions: c.permissions.filter((I) => I.subject === Be.Subject.Business.role)
3792
- }));
3793
- return St(
3794
- s,
3795
- "roleId",
3796
- O.value.map((c) => c._id)
3797
- );
3798
- }), y = [...wr], v = z(() => {
3799
- var c;
3800
- const s = (c = n.value) == null ? void 0 : c.find(
3801
- (I) => I.subject === Be.Subject.Business.inventory_stock
3802
- );
3803
- return s ? s.conditions ? JSON.parse(s.conditions).warehouseId.$in : null : [];
3804
- }), A = st([]), L = z(() => A.value.map((s) => ({
3805
- label: s.profile.name,
3806
- value: s._id
3807
- })));
3808
- function H(s) {
3809
- const c = U(n.value, s);
3810
- n.value = c;
3811
- }
3812
- function U(s, c) {
3813
- let I = Bn(
3814
- s.filter((x) => x.subject !== Be.Subject.Business.inventory_stock)
3815
- );
3816
- if (!c || c.length > 0) {
3817
- const x = {
3818
- actions: [Be.Action.manage],
3819
- subject: Be.Subject.Business.inventory_stock
3820
- };
3821
- c && (x.conditions = JSON.stringify({ warehouseId: { $in: c } })), I.push(x);
3822
- }
3823
- return I;
3824
- }
3825
- const { restaurants: _ } = i, O = Fr().roles, P = z(() => _.value.map((s) => ({
3826
- label: `${s.profile.code ? s.profile.code + "-" : ""}${s.profile.name}`,
3827
- value: s._id
3828
- }))), F = z(() => _.value.reduce((s, c) => (s[c._id] = O.value.filter((I) => I.restaurants.some((x) => x.id === c._id)).map((I) => I._id), s), {})), w = z(() => Nr(n.value));
3829
- function V(s) {
3830
- const c = Y(n.value, s);
3831
- n.value = c;
3832
- }
3833
- const j = z(() => Cr(n.value));
3834
- function Y(s, c) {
3835
- return Tr(s, c, {
3836
- restaurantRoles: F.value,
3837
- allRoleIds: O.value.map((I) => I._id)
3838
- });
3839
- }
3840
- function Z(s) {
3841
- const c = te(n.value, s);
3842
- n.value = c;
3843
- }
3844
- function te(s, c) {
3845
- return Or(s, c);
3846
- }
3847
- Un(async () => {
3848
- await Promise.all([
3849
- r.part !== "portal" && so.readWarehouses().then((s) => A.value = s),
3850
- T()
3851
- ]);
3852
- });
3853
- const K = z(() => Gn(
3854
- n.value,
3855
- Yn
3856
- ).filter((I) => {
3857
- const x = I.source;
3858
- return (x == null ? void 0 : x.type) !== "systemPermissionSet" ? !0 : I.actions.includes("manage");
3859
- }).map((I) => {
3860
- if (I.inverted) return I;
3861
- const x = I.actions;
3862
- if (!x.includes("manage")) return I;
3863
- const G = M(I.subject);
3864
- if (!G) return I;
3865
- const u = G.actions;
3866
- return u.length <= 1 || u.filter((Q) => !x.includes(Q)).length === 0 ? I : { ...I, actions: [...u] };
3867
- }));
3868
- function me(s) {
3869
- n.value = ao(
3870
- K.value,
3871
- s,
3872
- n.value,
3873
- M
3874
- );
3875
- }
3876
- const ve = z(() => new Set(
3877
- R.value.filter((s) => rn(s.subject).length > 0).map((s) => s.subject)
3878
- )), be = z(() => {
3879
- const s = /* @__PURE__ */ new Map();
3880
- return K.value.map((c) => ({
3881
- rule: c,
3882
- index: n.value.findIndex(
3883
- (I) => !I.inverted && I.subject === c.subject
3884
- )
3885
- })).filter(({ rule: c }) => !c.inverted).forEach(({ rule: c, index: I }) => {
3886
- var N;
3887
- const x = c.actions, G = p(c.subject, x);
3888
- if (G.length === 0) return;
3889
- let u;
3890
- try {
3891
- u = c.conditions ? JSON.parse(c.conditions) : void 0;
3892
- } catch {
3893
- u = void 0;
3894
- }
3895
- s.set(c.subject, {
3896
- index: I >= 0 ? I : null,
3897
- subject: c.subject,
3898
- label: ((N = M(c.subject)) == null ? void 0 : N.label) ?? c.subject,
3899
- actions: x,
3900
- // Each builder only ever sees its own slice of the stored condition.
3901
- sections: G.map((Q) => ({
3902
- builder: Q,
3903
- formValue: Q.fromCondition(nt(u, Q))
3904
- }))
3905
- });
3906
- }), s;
3907
- }), ae = uo(n, R, (s) => {
3908
- n.value = s;
3909
- }), le = Lr(n), Ae = st(null);
3910
- function B(s, c) {
3911
- const I = be.value.get(s);
3912
- if (I) return I;
3913
- const x = ae.getEffectiveActions(s), G = p(s, x);
3914
- if (G.length !== 0)
3915
- return {
3916
- index: null,
3917
- subject: s,
3918
- label: c,
3919
- actions: x,
3920
- sections: G.map((u) => ({
3921
- builder: u,
3922
- formValue: u.fromCondition(void 0)
3923
- }))
3924
- };
3925
- }
3926
- function fe(s, c) {
3927
- const I = le.getDraft({ subject: s.subject, builderKey: c.builderKey });
3928
- if (I) return I.formValue;
3929
- const x = s.sections.find((G) => G.builder.builderKey === c.builderKey);
3930
- return x == null ? void 0 : x.formValue;
3931
- }
3932
- function Je(s, c) {
3933
- const I = le.getDraft({ subject: s.subject, builderKey: c.builderKey });
3934
- return I != null && I.inheritMode ? I.inheritMode : ae.inheritMode(s, c);
3935
- }
3936
- function Qe(s, c, I) {
3937
- const x = le.getDraft({
3938
- subject: s.subject,
3939
- builderKey: c.builderKey
3940
- });
3941
- le.setDraft(
3942
- { subject: s.subject, builderKey: c.builderKey },
3943
- {
3944
- formValue: I,
3945
- inheritMode: (x == null ? void 0 : x.inheritMode) ?? Je(s, c)
3946
- }
3947
- );
3948
- }
3949
- function Ve(s, c, I) {
3950
- const x = le.getDraft({
3951
- subject: s.subject,
3952
- builderKey: c.builderKey
3953
- }), G = s.sections.find((u) => u.builder.builderKey === c.builderKey);
3954
- le.setDraft(
3955
- { subject: s.subject, builderKey: c.builderKey },
3956
- {
3957
- formValue: (x == null ? void 0 : x.formValue) ?? (G == null ? void 0 : G.formValue),
3958
- inheritMode: I
3959
- }
3960
- );
3961
- }
3962
- function we(s) {
3963
- return le.hasDraftsForSubject(s);
3964
- }
3965
- function Fe(s, c) {
3966
- const I = s.sections.flatMap((x) => {
3967
- const G = le.getDraft({
3968
- subject: s.subject,
3969
- builderKey: x.builder.builderKey
3970
- });
3971
- return G ? [{ builder: x.builder, form: G.formValue, mode: G.inheritMode ?? "custom" }] : [];
3972
- });
3973
- ae.applyConditionDrafts(s, I, {
3974
- afterCommit: () => {
3975
- le.clearDraftsForSubject(s.subject), c();
3976
- },
3977
- onOverridesConflict: l(s).onOverridesConflict
3978
- });
3979
- }
3980
- function We(s) {
3981
- return s.sections.some((c) => ae.shouldShowInheritToggle(s, c.builder) ? ae.inheritMode(s, c.builder) === "custom" : Object.keys(c.builder.toCondition(c.formValue)).length > 0);
3982
- }
3983
- let Pe = !1;
3984
- function l(s, c = {}) {
3985
- return {
3986
- ...c,
3987
- onOverridesConflict: ({ override: I, keep: x }) => {
3988
- Pe || (Pe = !0, h.open({
3989
- title: m("team.memberForm.permissions.conditionCover.confirmTitle"),
3990
- message: m("team.memberForm.permissions.conditionCover.confirmMessage", {
3991
- cover: s.label
3992
- }),
3993
- minWidth: E.value.lg ? 588 : 0,
3994
- zIndex: 200,
3995
- primaryActions: {
3996
- text: m("team.memberForm.permissions.conditionCover.override"),
3997
- close: !1
3998
- },
3999
- secondaryActions: {
4000
- text: m("team.memberForm.permissions.conditionCover.keep"),
4001
- close: !1
4002
- }
4003
- }).onPrimary(() => {
4004
- I(), Pe = !1, h.close();
4005
- }).onSecondary(() => {
4006
- x(), Pe = !1, h.close();
4007
- }).onClose(() => {
4008
- Pe = !1;
4009
- }));
4010
- }
4011
- };
4012
- }
4013
- return Mt(
4014
- n,
4015
- (s) => {
4016
- f("permissionChanged", s);
4017
- },
4018
- { deep: !0 }
4019
- ), (s, c) => {
4020
- const I = De("FmIcon"), x = De("FmBottomSheet"), G = De("FmPopover");
4021
- return J(), re("div", {
4022
- class: ye(["flex flex-col", e.part === "all" ? "gap-32" : "gap-16"])
4023
- }, [
4024
- e.part !== "workplace" ? (J(), re("div", {
4025
- key: 0,
4026
- class: ye(o.value)
4027
- }, [
4028
- oe(Xa, {
4029
- "model-value": K.value,
4030
- "excluded-subjects": y,
4031
- "additional-permissions": X(D),
4032
- layout: a.value,
4033
- "onUpdate:modelValue": me
4034
- }, tt({ _: 2 }, [
4035
- Ee(b.value, (u) => ({
4036
- name: `checkbox-${u.id}-append`,
4037
- fn: ce(() => [
4038
- oe(vt, { item: u }, null, 8, ["item"])
4039
- ])
4040
- })),
4041
- Ee(ve.value, (u) => ({
4042
- name: `checkbox-${u}-icon`,
4043
- fn: ce(({ option: N, isEffectiveSelected: Q }) => [
4044
- Q && B(u, N.label) ? (J(), re(Me, { key: 0 }, [
4045
- C.value ? (J(), Ce(x, {
4046
- key: 0,
4047
- "model-value": Ae.value === u,
4048
- header: X(m)("team.memberForm.permissions.conditionTitle", {
4049
- context: B(u, N.label).label
4050
- }),
4051
- "dismiss-away": "",
4052
- "z-index": 100,
4053
- class: "h-5 flex items-center",
4054
- "onUpdate:modelValue": ($) => {
4055
- Ae.value = $ ? u : null, $ || X(le).clearDraftsForSubject(u);
4056
- }
4057
- }, {
4058
- "bottom-sheet-button": ce(() => [
4059
- ie("div", mo, [
4060
- oe(I, {
4061
- name: "settings",
4062
- size: "sm",
4063
- class: ye([
4064
- "cursor-pointer transition-colors",
4065
- We(B(u, N.label)) ? "text-fm-color-primary-main" : "text-fm-color-neutral-gray-400 hover:text-fm-color-neutral-gray-600"
4066
- ])
4067
- }, null, 8, ["class"])
4068
- ])
4069
- ]),
4070
- default: ce(() => [
4071
- oe(wn, {
4072
- entry: B(u, N.label),
4073
- builders: B(u, N.label).sections.map(($) => $.builder),
4074
- subject: u,
4075
- "time-zone": k.value,
4076
- "cover-override": X(ae),
4077
- "inherit-mode-for": ($) => Je(B(u, N.label), $),
4078
- "form-value-for": ($) => fe(B(u, N.label), $),
4079
- "has-changes": we(u),
4080
- disable: e.disable,
4081
- "full-width": !0,
4082
- onUpdateInheritMode: ({ builder: $, mode: de }) => Ve(B(u, N.label), $, de),
4083
- onUpdateForm: ({ builder: $, form: de }) => Qe(B(u, N.label), $, de),
4084
- onApply: ($) => Fe(B(u, N.label), () => Ae.value = null)
4085
- }, null, 8, ["entry", "builders", "subject", "time-zone", "cover-override", "inherit-mode-for", "form-value-for", "has-changes", "disable", "onUpdateInheritMode", "onUpdateForm", "onApply"])
4086
- ]),
4087
- _: 2
4088
- }, 1032, ["model-value", "header", "onUpdate:modelValue"])) : (J(), Ce(G, {
4089
- key: 1,
4090
- disabled: e.disable,
4091
- "z-index": 100,
4092
- "exclude-el-from-click-outside": [_o],
4093
- class: "h-5 flex items-center",
4094
- onPopoverChanged: ($) => {
4095
- $ || X(le).clearDraftsForSubject(u);
4096
- }
4097
- }, {
4098
- "popover-button": ce(() => [
4099
- ie("div", fo, [
4100
- oe(I, {
4101
- name: "settings",
4102
- size: "sm",
4103
- class: ye([
4104
- "cursor-pointer transition-colors",
4105
- We(B(u, N.label)) ? "text-fm-color-primary-main" : "text-fm-color-neutral-gray-400 hover:text-fm-color-neutral-gray-600"
4106
- ])
4107
- }, null, 8, ["class"])
4108
- ])
4109
- ]),
4110
- default: ce(({ hide: $ }) => [
4111
- oe(wn, {
4112
- entry: B(u, N.label),
4113
- builders: B(u, N.label).sections.map((de) => de.builder),
4114
- subject: u,
4115
- "time-zone": k.value,
4116
- "cover-override": X(ae),
4117
- title: X(m)("team.memberForm.permissions.conditionTitle", {
4118
- context: B(u, N.label).label
4119
- }),
4120
- "inherit-mode-for": (de) => Je(B(u, N.label), de),
4121
- "form-value-for": (de) => fe(B(u, N.label), de),
4122
- "has-changes": we(u),
4123
- disable: e.disable,
4124
- onUpdateInheritMode: ({ builder: de, mode: Ge }) => Ve(
4125
- B(u, N.label),
4126
- de,
4127
- Ge
4128
- ),
4129
- onUpdateForm: ({ builder: de, form: Ge }) => Qe(B(u, N.label), de, Ge),
4130
- onApply: (de) => Fe(B(u, N.label), $)
4131
- }, null, 8, ["entry", "builders", "subject", "time-zone", "cover-override", "title", "inherit-mode-for", "form-value-for", "has-changes", "disable", "onUpdateInheritMode", "onUpdateForm", "onApply"])
4132
- ]),
4133
- _: 2
4134
- }, 1032, ["disabled", "exclude-el-from-click-outside", "onPopoverChanged"]))
4135
- ], 64)) : (J(), Ce(I, {
4136
- key: 1,
4137
- name: "settings",
4138
- size: "sm",
4139
- class: "invisible"
4140
- }))
4141
- ])
4142
- }))
4143
- ]), 1032, ["model-value", "additional-permissions", "layout"])
4144
- ], 2)) : Ne("", !0),
4145
- e.part !== "portal" ? (J(), re("div", {
4146
- key: 1,
4147
- class: ye(o.value)
4148
- }, [
4149
- oe(Dn, {
4150
- "model-value": v.value,
4151
- options: L.value,
4152
- context: X(m)("team.labels.warehouse"),
4153
- layout: a.value,
4154
- "onUpdate:modelValue": H
4155
- }, tt({ _: 2 }, [
4156
- Ee(S.value, (u) => ({
4157
- name: `checkbox-${u.id}-append`,
4158
- fn: ce(() => [
4159
- oe(vt, { item: u }, null, 8, ["item"])
4160
- ])
4161
- }))
4162
- ]), 1032, ["model-value", "options", "context", "layout"])
4163
- ], 2)) : Ne("", !0),
4164
- e.part !== "portal" ? (J(), re("div", {
4165
- key: 2,
4166
- class: ye([o.value, { "order-first": e.part === "workplace" }])
4167
- }, [
4168
- oe(Dn, {
4169
- "model-value": w.value,
4170
- options: P.value,
4171
- context: X(m)("team.labels.restaurant"),
4172
- layout: a.value,
4173
- "onUpdate:modelValue": V
4174
- }, tt({ _: 2 }, [
4175
- Ee(d.value, (u) => ({
4176
- name: `checkbox-${u.id}-append`,
4177
- fn: ce(() => [
4178
- oe(vt, { item: u }, null, 8, ["item"])
4179
- ])
4180
- }))
4181
- ]), 1032, ["model-value", "options", "context", "layout"])
4182
- ], 2)) : Ne("", !0),
4183
- e.part !== "portal" ? (J(), re("div", {
4184
- key: 3,
4185
- class: ye(o.value)
4186
- }, [
4187
- oe(eo, {
4188
- roles: X(O),
4189
- "model-value": j.value,
4190
- "restaurant-ids": w.value,
4191
- layout: a.value,
4192
- "onUpdate:modelValue": Z
4193
- }, tt({ _: 2 }, [
4194
- Ee(g.value, (u) => ({
4195
- name: `checkbox-${u.id}-append`,
4196
- fn: ce(() => [
4197
- oe(vt, { item: u }, null, 8, ["item"])
4198
- ])
4199
- }))
4200
- ]), 1032, ["roles", "model-value", "restaurant-ids", "layout"])
4201
- ], 2)) : Ne("", !0)
4202
- ], 2);
4203
- };
4204
- }
4205
- });
4206
- export {
4207
- Lo as _
4208
- };