@realtek/zinnext-theme 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -2
- package/dist-lib/DocumentViewer-BaSdIaiX.js +575 -0
- package/dist-lib/DocumentViewer-BaSdIaiX.js.map +1 -0
- package/dist-lib/DocumentViewer-DyVOzGFs.cjs +2 -0
- package/dist-lib/DocumentViewer-DyVOzGFs.cjs.map +1 -0
- package/dist-lib/FileField-CYCUE0OI.js +2887 -0
- package/dist-lib/FileField-CYCUE0OI.js.map +1 -0
- package/dist-lib/FileField-DsQMJqXA.cjs +3 -0
- package/dist-lib/FileField-DsQMJqXA.cjs.map +1 -0
- package/dist-lib/LinkedRecordFileField-IXUcG6eb.js +3834 -0
- package/dist-lib/LinkedRecordFileField-IXUcG6eb.js.map +1 -0
- package/dist-lib/LinkedRecordFileField-hK12u1Pu.cjs +4 -0
- package/dist-lib/LinkedRecordFileField-hK12u1Pu.cjs.map +1 -0
- package/dist-lib/addFormApi-DEuEstyI.js +63 -0
- package/dist-lib/addFormApi-DEuEstyI.js.map +1 -0
- package/dist-lib/addFormApi-_5jnZVE1.cjs +2 -0
- package/dist-lib/addFormApi-_5jnZVE1.cjs.map +1 -0
- package/dist-lib/authApi-CERg2tGa.js +429 -0
- package/dist-lib/authApi-CERg2tGa.js.map +1 -0
- package/dist-lib/authApi-D4ufO1Os.cjs +2 -0
- package/dist-lib/authApi-D4ufO1Os.cjs.map +1 -0
- package/dist-lib/diceCandidateMapper-BjMhHno3.cjs +2 -0
- package/dist-lib/diceCandidateMapper-BjMhHno3.cjs.map +1 -0
- package/dist-lib/diceCandidateMapper-DqBO4EhL.js +201 -0
- package/dist-lib/diceCandidateMapper-DqBO4EhL.js.map +1 -0
- package/dist-lib/dropdownApi-BSlu1x_6.cjs +2 -0
- package/dist-lib/dropdownApi-BSlu1x_6.cjs.map +1 -0
- package/dist-lib/dropdownApi-C-DH4cqu.js +583 -0
- package/dist-lib/dropdownApi-C-DH4cqu.js.map +1 -0
- package/dist-lib/formGroupsCache-Bbz-28ws.cjs +2 -0
- package/dist-lib/formGroupsCache-Bbz-28ws.cjs.map +1 -0
- package/dist-lib/formGroupsCache-JeC59oNe.js +24 -0
- package/dist-lib/formGroupsCache-JeC59oNe.js.map +1 -0
- package/dist-lib/index.cjs +10 -0
- package/dist-lib/index.cjs.map +1 -0
- package/dist-lib/index.js +71151 -0
- package/dist-lib/index.js.map +1 -0
- package/dist-lib/jobsApi-0Z3ckOL3.cjs +2 -0
- package/dist-lib/jobsApi-0Z3ckOL3.cjs.map +1 -0
- package/dist-lib/jobsApi-BWnuOB-d.js +82 -0
- package/dist-lib/jobsApi-BWnuOB-d.js.map +1 -0
- package/dist-lib/recordAccess-BxBh-Qea.js +37 -0
- package/dist-lib/recordAccess-BxBh-Qea.js.map +1 -0
- package/dist-lib/recordAccess-C0idY6GV.cjs +2 -0
- package/dist-lib/recordAccess-C0idY6GV.cjs.map +1 -0
- package/dist-lib/rolldown-runtime-Chgba0Kb.cjs +1 -0
- package/dist-lib/rolldown-runtime-Dy4uBu1J.js +11 -0
- package/dist-lib/style.css +2 -0
- package/package.json +121 -4
|
@@ -0,0 +1,2887 @@
|
|
|
1
|
+
import { S as e, a as t, o as n, t as r } from "./authApi-CERg2tGa.js";
|
|
2
|
+
import { r as i } from "./formGroupsCache-JeC59oNe.js";
|
|
3
|
+
import { n as a, r as o } from "./diceCandidateMapper-DqBO4EhL.js";
|
|
4
|
+
import { Button as s } from "antd";
|
|
5
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
6
|
+
import l from "dayjs";
|
|
7
|
+
import u from "dayjs/plugin/utc";
|
|
8
|
+
import d from "dayjs/plugin/timezone";
|
|
9
|
+
import { Link as f } from "react-router-dom";
|
|
10
|
+
import p from "dompurify";
|
|
11
|
+
//#region src/services/adminApi.js
|
|
12
|
+
var m = "/admin/field-config", h = [
|
|
13
|
+
{
|
|
14
|
+
key: "clients",
|
|
15
|
+
apiModule: "clients"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
key: "job",
|
|
19
|
+
apiModule: "jobs"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
key: "candidate",
|
|
23
|
+
apiModule: "candidates"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
key: "submissions",
|
|
27
|
+
apiModule: "submissions"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
key: "onboarding",
|
|
31
|
+
apiModule: "onboarding"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
key: "billing",
|
|
35
|
+
apiModule: "billing"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: "payroll",
|
|
39
|
+
apiModule: "payroll"
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
function g(...e) {
|
|
43
|
+
return e.find(Array.isArray) ?? [];
|
|
44
|
+
}
|
|
45
|
+
function _(e, t, n) {
|
|
46
|
+
return t.map((t) => e?.[t]).find((e) => e != null && e !== "") ?? n;
|
|
47
|
+
}
|
|
48
|
+
function v(e, t) {
|
|
49
|
+
return e?.total ?? e?.totalCount ?? e?.count ?? e?.recordsTotal ?? e?.meta?.total ?? e?.pagination?.total ?? t.length;
|
|
50
|
+
}
|
|
51
|
+
function y(e, t) {
|
|
52
|
+
let n = _(e, [
|
|
53
|
+
"label",
|
|
54
|
+
"Label",
|
|
55
|
+
"fieldName",
|
|
56
|
+
"field_name",
|
|
57
|
+
"name",
|
|
58
|
+
"fieldLabel",
|
|
59
|
+
"value"
|
|
60
|
+
], `Field ${t + 1}`), r = _(e, [
|
|
61
|
+
"field",
|
|
62
|
+
"Field",
|
|
63
|
+
"fieldKey",
|
|
64
|
+
"field_key",
|
|
65
|
+
"key",
|
|
66
|
+
"value",
|
|
67
|
+
"fieldName",
|
|
68
|
+
"name"
|
|
69
|
+
], n), i = _(e, [
|
|
70
|
+
"isVisible",
|
|
71
|
+
"is_visible",
|
|
72
|
+
"visible",
|
|
73
|
+
"show",
|
|
74
|
+
"is_show",
|
|
75
|
+
"isShow",
|
|
76
|
+
"enabled"
|
|
77
|
+
], !0), a = _(e, [
|
|
78
|
+
"ismandatory",
|
|
79
|
+
"isMandatory",
|
|
80
|
+
"is_mandatory",
|
|
81
|
+
"mandatory",
|
|
82
|
+
"required",
|
|
83
|
+
"req"
|
|
84
|
+
], !1), o = _(e, [
|
|
85
|
+
"order",
|
|
86
|
+
"Order",
|
|
87
|
+
"sortOrder",
|
|
88
|
+
"position"
|
|
89
|
+
], t);
|
|
90
|
+
return {
|
|
91
|
+
...e,
|
|
92
|
+
fieldKey: r,
|
|
93
|
+
fieldName: n,
|
|
94
|
+
type: _(e, ["type", "Type"], "text"),
|
|
95
|
+
isVisible: typeof i == "string" ? ![
|
|
96
|
+
"false",
|
|
97
|
+
"0",
|
|
98
|
+
"hide",
|
|
99
|
+
"hidden",
|
|
100
|
+
"no"
|
|
101
|
+
].includes(i.toLowerCase()) : !!i,
|
|
102
|
+
ismandatory: typeof a == "string" ? [
|
|
103
|
+
"true",
|
|
104
|
+
"1",
|
|
105
|
+
"yes",
|
|
106
|
+
"required"
|
|
107
|
+
].includes(a.toLowerCase()) : !!a,
|
|
108
|
+
order: typeof o == "number" ? o : t,
|
|
109
|
+
isLink: !!e.isLink,
|
|
110
|
+
linkTemplate: e.linkTemplate ?? "",
|
|
111
|
+
linkType: e.linkType ?? "internal",
|
|
112
|
+
linkTarget: e.linkTarget ?? "_self",
|
|
113
|
+
action: e.action ?? "navigate",
|
|
114
|
+
secondaryField: e.secondaryField ?? "",
|
|
115
|
+
secondaryLabel: e.secondaryLabel ?? "",
|
|
116
|
+
secondaryFields: Array.isArray(e.secondaryFields) ? e.secondaryFields : [],
|
|
117
|
+
secondarySeparator: e.secondarySeparator ?? "",
|
|
118
|
+
lookup: e.lookup ? {
|
|
119
|
+
...e.lookup,
|
|
120
|
+
projectFields: Array.isArray(e.lookup.projectFields) ? e.lookup.projectFields : []
|
|
121
|
+
} : null,
|
|
122
|
+
derived: e.derived ?? null,
|
|
123
|
+
computed: e.computed ? {
|
|
124
|
+
...e.computed,
|
|
125
|
+
operands: Array.isArray(e.computed.operands) ? e.computed.operands : []
|
|
126
|
+
} : null,
|
|
127
|
+
actionButtons: Array.isArray(e.actionButtons) ? e.actionButtons : [],
|
|
128
|
+
renderType: e.renderType ?? "",
|
|
129
|
+
renderConfig: e.renderConfig ? {
|
|
130
|
+
...e.renderConfig,
|
|
131
|
+
treatZeroAsEmpty: !!e.renderConfig.treatZeroAsEmpty,
|
|
132
|
+
cleanEmptyTemplateSeparators: !!e.renderConfig.cleanEmptyTemplateSeparators
|
|
133
|
+
} : null,
|
|
134
|
+
valueStyles: Array.isArray(e.valueStyles) ? e.valueStyles : [],
|
|
135
|
+
commonStyle: e.commonStyle ?? null,
|
|
136
|
+
displayTemplate: e.displayTemplate ?? "",
|
|
137
|
+
defaultValue: e.defaultValue ?? "",
|
|
138
|
+
dataSource: e.dataSource ?? "module",
|
|
139
|
+
groupName: e.groupName ?? "",
|
|
140
|
+
filterGroupFields: Array.isArray(e.filterGroupFields) ? e.filterGroupFields : [],
|
|
141
|
+
filterGroupSeparator: e.filterGroupSeparator ?? " ",
|
|
142
|
+
filterArrayLabelField: e.filterArrayLabelField ?? "",
|
|
143
|
+
filterArrayValueField: e.filterArrayValueField ?? ""
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function b(e) {
|
|
147
|
+
if (typeof e == "string") return {
|
|
148
|
+
key: e,
|
|
149
|
+
apiModule: e
|
|
150
|
+
};
|
|
151
|
+
let t = _(e, [
|
|
152
|
+
"key",
|
|
153
|
+
"moduleKey",
|
|
154
|
+
"value",
|
|
155
|
+
"module",
|
|
156
|
+
"apiModule",
|
|
157
|
+
"name",
|
|
158
|
+
"modulename",
|
|
159
|
+
"menuName"
|
|
160
|
+
], "");
|
|
161
|
+
return t ? {
|
|
162
|
+
key: t,
|
|
163
|
+
apiModule: _(e, [
|
|
164
|
+
"apiModule",
|
|
165
|
+
"api_module",
|
|
166
|
+
"module",
|
|
167
|
+
"value",
|
|
168
|
+
"key",
|
|
169
|
+
"name",
|
|
170
|
+
"modulename",
|
|
171
|
+
"menuName"
|
|
172
|
+
], t)
|
|
173
|
+
} : null;
|
|
174
|
+
}
|
|
175
|
+
function ee(e = h) {
|
|
176
|
+
let t = Array.isArray(e) && e.length ? e : h, n = /* @__PURE__ */ new Set();
|
|
177
|
+
return t.map(b).filter(Boolean).filter((e) => !n.has(e.key) && (n.add(e.key), !0));
|
|
178
|
+
}
|
|
179
|
+
var te = "/admin/modules";
|
|
180
|
+
async function ne() {
|
|
181
|
+
let t = await n(e, te), r = t?.data;
|
|
182
|
+
return Array.isArray(r) ? r : Array.isArray(t) ? t : [];
|
|
183
|
+
}
|
|
184
|
+
async function re(t) {
|
|
185
|
+
let r = await n(e, `${te}/${encodeURIComponent(t)}/automations`), i = r?.data ?? r ?? {};
|
|
186
|
+
return {
|
|
187
|
+
gateway: i.gateway ?? null,
|
|
188
|
+
strategies: i.strategies ?? null
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
async function ie(t) {
|
|
192
|
+
let r = await n(e, `/admin/platform/${t}`), i = r?.data ?? r;
|
|
193
|
+
return Array.isArray(i) ? i : [];
|
|
194
|
+
}
|
|
195
|
+
async function ae(t, r) {
|
|
196
|
+
return n(e, `/admin/platform/${t}`, {
|
|
197
|
+
method: "POST",
|
|
198
|
+
headers: { "Content-Type": "application/json" },
|
|
199
|
+
body: JSON.stringify(r)
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
async function oe(t, r) {
|
|
203
|
+
return n(e, `/admin/platform/${t}/${encodeURIComponent(r)}`, { method: "DELETE" });
|
|
204
|
+
}
|
|
205
|
+
async function se(t, { gateway: r, strategies: i }) {
|
|
206
|
+
return n(e, `${te}/${encodeURIComponent(t)}/automations`, {
|
|
207
|
+
method: "PUT",
|
|
208
|
+
headers: { "Content-Type": "application/json" },
|
|
209
|
+
body: JSON.stringify({
|
|
210
|
+
gateway: r,
|
|
211
|
+
strategies: i
|
|
212
|
+
})
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
async function ce() {
|
|
216
|
+
let e = [];
|
|
217
|
+
try {
|
|
218
|
+
e = await jt();
|
|
219
|
+
} catch {
|
|
220
|
+
e = [];
|
|
221
|
+
}
|
|
222
|
+
let t = (Array.isArray(e) ? e : []).filter((e) => e?.isDeleted !== !0 && String(e?.status ?? "active").toLowerCase() !== "inactive" && String(e?.status ?? "active").toLowerCase() !== "disabled");
|
|
223
|
+
return t.length > 0 ? t : ne();
|
|
224
|
+
}
|
|
225
|
+
async function le() {
|
|
226
|
+
let e;
|
|
227
|
+
try {
|
|
228
|
+
e = await ne();
|
|
229
|
+
} catch {
|
|
230
|
+
return {};
|
|
231
|
+
}
|
|
232
|
+
let t = {}, n = (e, n, r) => {
|
|
233
|
+
let i = String(e ?? "").trim().toLowerCase();
|
|
234
|
+
!i || !n || (r || t[i] === void 0) && (t[i] = n);
|
|
235
|
+
};
|
|
236
|
+
for (let t of Array.isArray(e) ? e : []) {
|
|
237
|
+
let e = String(t?.collectionName ?? "").trim();
|
|
238
|
+
e && n(t?.key, e, !0);
|
|
239
|
+
}
|
|
240
|
+
for (let t of Array.isArray(e) ? e : []) {
|
|
241
|
+
let e = String(t?.collectionName ?? "").trim(), r = String(t?.key ?? "").trim().toLowerCase();
|
|
242
|
+
!e || !r || (r.endsWith("s") ? n(r.slice(0, -1), e, !1) : n(`${r}s`, e, !1));
|
|
243
|
+
}
|
|
244
|
+
return t;
|
|
245
|
+
}
|
|
246
|
+
var x = "/admin/form-groups", ue = "/admin/config-defaults";
|
|
247
|
+
async function de(t, r = {}) {
|
|
248
|
+
let i = await n(e, `/admin/form-group-seeds/export${S({
|
|
249
|
+
...r,
|
|
250
|
+
module: t
|
|
251
|
+
})}`);
|
|
252
|
+
return i?.data ?? i;
|
|
253
|
+
}
|
|
254
|
+
async function fe(t, r, i, a) {
|
|
255
|
+
let o = await n(e, `/admin/form-group-seeds/preview${S({
|
|
256
|
+
...r,
|
|
257
|
+
module: t
|
|
258
|
+
})}`, {
|
|
259
|
+
method: "POST",
|
|
260
|
+
headers: { "Content-Type": "application/json" },
|
|
261
|
+
body: JSON.stringify({
|
|
262
|
+
seed: i,
|
|
263
|
+
mode: a
|
|
264
|
+
})
|
|
265
|
+
});
|
|
266
|
+
return o?.data ?? o;
|
|
267
|
+
}
|
|
268
|
+
async function pe(t, r, a, o, s) {
|
|
269
|
+
let c = await n(e, `/admin/form-group-seeds/apply${S({
|
|
270
|
+
...r,
|
|
271
|
+
module: t
|
|
272
|
+
})}`, {
|
|
273
|
+
method: "POST",
|
|
274
|
+
headers: { "Content-Type": "application/json" },
|
|
275
|
+
body: JSON.stringify({
|
|
276
|
+
seed: a,
|
|
277
|
+
mode: o,
|
|
278
|
+
revision: s
|
|
279
|
+
})
|
|
280
|
+
});
|
|
281
|
+
return i(), c?.data ?? c;
|
|
282
|
+
}
|
|
283
|
+
async function me(t) {
|
|
284
|
+
let r = await n(e, `/admin/form-group-seeds/backups/${encodeURIComponent(t)}`);
|
|
285
|
+
return r?.data ?? r;
|
|
286
|
+
}
|
|
287
|
+
var he = "000000000000000000000000";
|
|
288
|
+
function ge(e) {
|
|
289
|
+
let t = String(e ?? "").trim();
|
|
290
|
+
return t === "" || t === he;
|
|
291
|
+
}
|
|
292
|
+
function S(e = {}) {
|
|
293
|
+
let t = new URLSearchParams();
|
|
294
|
+
e.module && t.set("module", e.module), e.clientId && t.set("clientId", e.clientId), e.region && t.set("region", e.region);
|
|
295
|
+
let n = t.toString();
|
|
296
|
+
return n ? `?${n}` : "";
|
|
297
|
+
}
|
|
298
|
+
async function _e(t = "", r = {}) {
|
|
299
|
+
let i = `${x}${S({
|
|
300
|
+
...r,
|
|
301
|
+
module: t || r.module || ""
|
|
302
|
+
})}`, a = await n(e, i), o = a?.data;
|
|
303
|
+
return Array.isArray(o) ? o : o && Array.isArray(o.groups) ? o.groups : Array.isArray(a) ? a : a && Array.isArray(a.groups) ? a.groups : [];
|
|
304
|
+
}
|
|
305
|
+
async function ve(t = "", r = {}) {
|
|
306
|
+
let i = S({
|
|
307
|
+
...r,
|
|
308
|
+
module: t || r.module || ""
|
|
309
|
+
}), a = await n(e, `${x}/preview-config${i}`);
|
|
310
|
+
return a?.data ?? a ?? {};
|
|
311
|
+
}
|
|
312
|
+
async function ye(t = "", r = {}, i = {}) {
|
|
313
|
+
let a = S(i);
|
|
314
|
+
return n(e, `${x}/preview-config${a}`, {
|
|
315
|
+
method: "PUT",
|
|
316
|
+
headers: { "Content-Type": "application/json" },
|
|
317
|
+
body: JSON.stringify({
|
|
318
|
+
module: t,
|
|
319
|
+
...r
|
|
320
|
+
})
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
async function be({ offset: t = 0, limit: r = 100, sortBy: i = "new", searchvalue: a = "" } = {}) {
|
|
324
|
+
let o = new URLSearchParams({
|
|
325
|
+
offset: String(t),
|
|
326
|
+
limit: String(r),
|
|
327
|
+
sortBy: i,
|
|
328
|
+
searchvalue: a
|
|
329
|
+
}), s = localStorage.getItem("tenantId") || "", c = localStorage.getItem("businessId") || "", l = localStorage.getItem("businessUnitId") || "";
|
|
330
|
+
s && o.set("tenantId", s), c && o.set("businessId", c), l && o.set("businessUnitId", l);
|
|
331
|
+
let u = await n(e, `/client/view?${o.toString()}`), d = u?.data ?? u;
|
|
332
|
+
return d?.clients ?? d?.Clients ?? d?.items ?? [];
|
|
333
|
+
}
|
|
334
|
+
async function xe(t) {
|
|
335
|
+
let r = await n(e, `/filter-dropdown-fields?module=${encodeURIComponent(t)}`), i = r?.data ?? r;
|
|
336
|
+
return Array.isArray(i) ? i : [];
|
|
337
|
+
}
|
|
338
|
+
async function Se(t, r = {}) {
|
|
339
|
+
return n(e, `${x}${S(r)}`, {
|
|
340
|
+
method: "POST",
|
|
341
|
+
headers: { "Content-Type": "application/json" },
|
|
342
|
+
body: JSON.stringify(t)
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
async function Ce(t, r, i = {}) {
|
|
346
|
+
return n(e, `${x}/${t}${S(i)}`, {
|
|
347
|
+
method: "PUT",
|
|
348
|
+
headers: { "Content-Type": "application/json" },
|
|
349
|
+
body: JSON.stringify(r)
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
async function we(t, r = {}) {
|
|
353
|
+
return n(e, `${x}/${t}${S(r)}`, { method: "DELETE" });
|
|
354
|
+
}
|
|
355
|
+
async function Te(t, r) {
|
|
356
|
+
return n(e, `${ue}/request-otp`, {
|
|
357
|
+
method: "POST",
|
|
358
|
+
body: JSON.stringify({
|
|
359
|
+
scope: t,
|
|
360
|
+
action: r
|
|
361
|
+
})
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
async function Ee(t, r, i) {
|
|
365
|
+
return n(e, `${ue}/apply`, {
|
|
366
|
+
method: "POST",
|
|
367
|
+
body: JSON.stringify({
|
|
368
|
+
scope: t,
|
|
369
|
+
action: r,
|
|
370
|
+
otp: i
|
|
371
|
+
})
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
var De = "/admin/detail-config";
|
|
375
|
+
async function Oe(t, r = {}) {
|
|
376
|
+
let i = S({
|
|
377
|
+
module: t,
|
|
378
|
+
clientId: r.clientId
|
|
379
|
+
}), a = await n(e, `${De}${i}`), o = a?.data ?? a ?? {};
|
|
380
|
+
return {
|
|
381
|
+
module: o.module ?? t,
|
|
382
|
+
clientId: ge(o.clientId) ? "" : String(o.clientId),
|
|
383
|
+
fields: Array.isArray(o.fields) ? o.fields : [],
|
|
384
|
+
merges: Array.isArray(o.merges) ? o.merges : [],
|
|
385
|
+
sourceFields: Array.isArray(o.sourceFields) ? o.sourceFields : [],
|
|
386
|
+
groups: Array.isArray(o.groups) ? o.groups : []
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
async function ke({ module: t, fields: r = [], merges: i = [], sourceFields: a = [], groups: o = [], clientId: s = "" }) {
|
|
390
|
+
return n(e, De, {
|
|
391
|
+
method: "POST",
|
|
392
|
+
headers: { "Content-Type": "application/json" },
|
|
393
|
+
body: JSON.stringify({
|
|
394
|
+
module: t,
|
|
395
|
+
fields: r,
|
|
396
|
+
merges: i,
|
|
397
|
+
sourceFields: a,
|
|
398
|
+
groups: o,
|
|
399
|
+
...s ? { clientId: s } : {}
|
|
400
|
+
})
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
async function Ae({ module: t, clientId: r = "", otp: i }) {
|
|
404
|
+
return n(e, `${De}/discover-fields`, {
|
|
405
|
+
method: "POST",
|
|
406
|
+
headers: { "Content-Type": "application/json" },
|
|
407
|
+
body: JSON.stringify({
|
|
408
|
+
module: t,
|
|
409
|
+
otp: i,
|
|
410
|
+
...r ? { clientId: r } : {}
|
|
411
|
+
})
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
var je = "/admin/detail-defaults";
|
|
415
|
+
async function Me() {
|
|
416
|
+
let t = await n(e, je);
|
|
417
|
+
return t?.data ?? t ?? {};
|
|
418
|
+
}
|
|
419
|
+
async function Ne(t) {
|
|
420
|
+
return n(e, je, {
|
|
421
|
+
method: "POST",
|
|
422
|
+
headers: { "Content-Type": "application/json" },
|
|
423
|
+
body: JSON.stringify(t)
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
var C = "/admin/ai-service-config";
|
|
427
|
+
async function Pe() {
|
|
428
|
+
let t = await n(e, C);
|
|
429
|
+
return t?.data ?? t ?? [];
|
|
430
|
+
}
|
|
431
|
+
async function Fe(t) {
|
|
432
|
+
return n(e, C, {
|
|
433
|
+
method: "POST",
|
|
434
|
+
headers: { "Content-Type": "application/json" },
|
|
435
|
+
body: JSON.stringify(t)
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
async function Ie(t) {
|
|
439
|
+
return n(e, `${C}?serviceKey=${encodeURIComponent(t)}`, { method: "DELETE" });
|
|
440
|
+
}
|
|
441
|
+
async function Le({ baseUrl: t, authHeader: r, authValue: i }) {
|
|
442
|
+
let a = await n(e, `${C}/test`, {
|
|
443
|
+
method: "POST",
|
|
444
|
+
headers: { "Content-Type": "application/json" },
|
|
445
|
+
body: JSON.stringify({
|
|
446
|
+
baseUrl: t,
|
|
447
|
+
authHeader: r,
|
|
448
|
+
authValue: i
|
|
449
|
+
})
|
|
450
|
+
});
|
|
451
|
+
return a?.data ?? a;
|
|
452
|
+
}
|
|
453
|
+
var Re = "/admin/bgc-integration-config";
|
|
454
|
+
async function ze() {
|
|
455
|
+
let t = await n(e, Re);
|
|
456
|
+
return t?.data ?? t ?? {
|
|
457
|
+
updateMethod: "MANUAL",
|
|
458
|
+
enabled: !0
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
async function Be(t) {
|
|
462
|
+
return n(e, Re, {
|
|
463
|
+
method: "PUT",
|
|
464
|
+
headers: { "Content-Type": "application/json" },
|
|
465
|
+
body: JSON.stringify(t)
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
async function Ve() {
|
|
469
|
+
let t = await n(e, "/integration-config/bgc/summary");
|
|
470
|
+
return t?.data ?? t ?? {
|
|
471
|
+
updateMethod: "MANUAL",
|
|
472
|
+
enabled: !0
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
var w = "/admin/integration-config";
|
|
476
|
+
async function He() {
|
|
477
|
+
let t = await n(e, w);
|
|
478
|
+
return t?.data ?? t ?? [];
|
|
479
|
+
}
|
|
480
|
+
async function Ue(t) {
|
|
481
|
+
let r = await n(e, `${w}/${encodeURIComponent(t)}`);
|
|
482
|
+
return r?.data ?? r;
|
|
483
|
+
}
|
|
484
|
+
async function We(t) {
|
|
485
|
+
let r = t?.integrationKey, i = r ? `${w}/${encodeURIComponent(r)}` : w;
|
|
486
|
+
return n(e, i, {
|
|
487
|
+
method: r ? "PUT" : "POST",
|
|
488
|
+
headers: { "Content-Type": "application/json" },
|
|
489
|
+
body: JSON.stringify(t)
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
async function Ge(t) {
|
|
493
|
+
return n(e, `${w}/${encodeURIComponent(t)}`, { method: "DELETE" });
|
|
494
|
+
}
|
|
495
|
+
async function Ke(t) {
|
|
496
|
+
let r = await n(e, `${w}/test`, {
|
|
497
|
+
method: "POST",
|
|
498
|
+
headers: { "Content-Type": "application/json" },
|
|
499
|
+
body: JSON.stringify(t)
|
|
500
|
+
});
|
|
501
|
+
return r?.data ?? r;
|
|
502
|
+
}
|
|
503
|
+
async function qe(t) {
|
|
504
|
+
let r = await n(e, `/integration-config/${encodeURIComponent(t)}/summary`);
|
|
505
|
+
return r?.data ?? r;
|
|
506
|
+
}
|
|
507
|
+
async function Je(t, r, i) {
|
|
508
|
+
let a = await n(e, `/integration-config/${encodeURIComponent(t)}/apply-status/${encodeURIComponent(r)}`, {
|
|
509
|
+
method: "POST",
|
|
510
|
+
headers: { "Content-Type": "application/json" },
|
|
511
|
+
body: JSON.stringify(i)
|
|
512
|
+
});
|
|
513
|
+
return a?.data ?? a;
|
|
514
|
+
}
|
|
515
|
+
function Ye(e) {
|
|
516
|
+
return {
|
|
517
|
+
key: e.role_id ?? e.id,
|
|
518
|
+
roleId: e.role_id ?? e.id,
|
|
519
|
+
roleName: e.role_name ?? "N/A",
|
|
520
|
+
description: e.role_description ?? "N/A",
|
|
521
|
+
userCount: e.user_count ?? 0,
|
|
522
|
+
roleType: e.role_type ?? 0,
|
|
523
|
+
raw: e
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
function T(e) {
|
|
527
|
+
return e?.raw?.role_id ?? e?.roleId ?? e?.key;
|
|
528
|
+
}
|
|
529
|
+
async function Xe() {
|
|
530
|
+
let t = await n(e, "/get-roles"), r = t.data ?? t, i = g(r?.zinnext_default).map(Ye), a = g(r?.custom_roles).map(Ye), o = [...i, ...a];
|
|
531
|
+
return {
|
|
532
|
+
roles: o,
|
|
533
|
+
total: o.length
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
function Ze(e) {
|
|
537
|
+
return {
|
|
538
|
+
key: e.teamId,
|
|
539
|
+
teamId: e.teamId,
|
|
540
|
+
teamName: e.teamName ?? "N/A",
|
|
541
|
+
manager: e.reportingManager ?? "N/A",
|
|
542
|
+
managerId: e.reportingManagerId ?? 0,
|
|
543
|
+
memberCount: e.noOfTeamMembers ?? 0,
|
|
544
|
+
members: g(e.teamMembers),
|
|
545
|
+
memberIds: g(e.teamMembersIds),
|
|
546
|
+
raw: e
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
function E(e) {
|
|
550
|
+
return e?.raw?.teamId ?? e?.teamId ?? e?.key;
|
|
551
|
+
}
|
|
552
|
+
async function Qe({ offset: t = 0, limit: r = 10, sortBy: i = "new", search: a = "" } = {}) {
|
|
553
|
+
let o = new URLSearchParams({
|
|
554
|
+
searchquery: a,
|
|
555
|
+
sortBy: i,
|
|
556
|
+
limit: String(r),
|
|
557
|
+
offset: String(t)
|
|
558
|
+
}), s = await n(e, `/get-teams?${o}`), c = s.data ?? s, l = g(c?.teams, c, s?.teams), u = c?.totalCount ?? c?.total ?? l.length;
|
|
559
|
+
return {
|
|
560
|
+
teams: l.map(Ze),
|
|
561
|
+
total: u
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
async function $e(t, { teamName: r, managerId: i, memberIds: a = [] }) {
|
|
565
|
+
let o = E(t);
|
|
566
|
+
return n(e, `/team/edit?teamId=${o}`, {
|
|
567
|
+
method: "PUT",
|
|
568
|
+
body: JSON.stringify({
|
|
569
|
+
team_name: r,
|
|
570
|
+
team_manager: i,
|
|
571
|
+
other_team_members: a,
|
|
572
|
+
reporting_team_member: []
|
|
573
|
+
})
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
async function et(t, r, i, a = "listView", o = !1) {
|
|
577
|
+
let s = new URLSearchParams({
|
|
578
|
+
module: t,
|
|
579
|
+
userId: "0",
|
|
580
|
+
[r]: String(i),
|
|
581
|
+
configType: a
|
|
582
|
+
});
|
|
583
|
+
o && s.set("includeMeta", "1");
|
|
584
|
+
let c = await n(e, `${m}?${s}`), l = c.data ?? c, u = g(l, l?.visibleFields, c?.visibleFields);
|
|
585
|
+
return o ? {
|
|
586
|
+
fields: u,
|
|
587
|
+
dataVisibilityMode: l?.dataVisibilityMode ?? c?.dataVisibilityMode ?? "all",
|
|
588
|
+
dataOwnerField: l?.dataOwnerField ?? c?.dataOwnerField ?? "createdBy",
|
|
589
|
+
filterDisplayMode: l?.filterDisplayMode === "top" ? "top" : "popup",
|
|
590
|
+
exportEnabled: l?.exportEnabled !== !1
|
|
591
|
+
} : u;
|
|
592
|
+
}
|
|
593
|
+
async function tt(e, t = "listView", n = h) {
|
|
594
|
+
let r = T(e), i = ee(n), a = await Promise.all(i.map(async ({ key: e, apiModule: n }) => [e, (await et(n, "roleId", r, t)).map((t, i) => ({
|
|
595
|
+
...y(t, i),
|
|
596
|
+
module: e,
|
|
597
|
+
apiModule: n,
|
|
598
|
+
roleId: r
|
|
599
|
+
}))]));
|
|
600
|
+
return Object.fromEntries(a);
|
|
601
|
+
}
|
|
602
|
+
async function nt(e, t = "listView", n = h) {
|
|
603
|
+
let r = T(e), i = ee(n), a = await Promise.all(i.map(async ({ key: e, apiModule: n }) => {
|
|
604
|
+
let i = await et(n, "roleId", r, t, !0);
|
|
605
|
+
return [e, {
|
|
606
|
+
fields: i.fields.map((t, i) => ({
|
|
607
|
+
...y(t, i),
|
|
608
|
+
module: e,
|
|
609
|
+
apiModule: n,
|
|
610
|
+
roleId: r
|
|
611
|
+
})),
|
|
612
|
+
dataVisibilityMode: i.dataVisibilityMode ?? "all",
|
|
613
|
+
dataOwnerField: i.dataOwnerField ?? "createdBy",
|
|
614
|
+
filterDisplayMode: i.filterDisplayMode ?? "popup",
|
|
615
|
+
exportEnabled: i.exportEnabled !== !1
|
|
616
|
+
}];
|
|
617
|
+
}));
|
|
618
|
+
return Object.fromEntries(a);
|
|
619
|
+
}
|
|
620
|
+
async function rt(e, t = "listView") {
|
|
621
|
+
let n = E(e), r = await Promise.all(h.map(async ({ key: e, apiModule: r }) => [e, (await et(r, "teamId", n, t)).map((t, i) => ({
|
|
622
|
+
...y(t, i),
|
|
623
|
+
module: e,
|
|
624
|
+
apiModule: r,
|
|
625
|
+
teamId: n
|
|
626
|
+
}))]));
|
|
627
|
+
return Object.fromEntries(r);
|
|
628
|
+
}
|
|
629
|
+
function it(e) {
|
|
630
|
+
if (!e?.lookup) return null;
|
|
631
|
+
let t = { ...e.lookup }, n = String(t.localField ?? "").trim() || String(e.fieldKey ?? "").trim(), r = String(t.valueField ?? t.foreignField ?? "").trim() || "_id", i = String(t.displayField ?? t.projectField ?? "").trim(), a = String(t.displayField2 ?? "").trim(), o = Array.isArray(t.projectFields) ? t.projectFields.map((e) => String(e ?? "").trim()).filter(Boolean) : [];
|
|
632
|
+
return o.length === 0 && (o = [i, a].filter(Boolean)), {
|
|
633
|
+
...t,
|
|
634
|
+
localField: n,
|
|
635
|
+
valueField: r,
|
|
636
|
+
displayField: i,
|
|
637
|
+
...a ? { displayField2: a } : {},
|
|
638
|
+
projectFields: o
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
function at(e, t) {
|
|
642
|
+
let n = !t || t === "listView";
|
|
643
|
+
return e.map((e, r) => {
|
|
644
|
+
let i = {
|
|
645
|
+
label: e.fieldName,
|
|
646
|
+
field: e.fieldKey,
|
|
647
|
+
isVisible: e.isVisible,
|
|
648
|
+
type: e.type ?? "text",
|
|
649
|
+
order: e.order ?? r
|
|
650
|
+
};
|
|
651
|
+
return n ? Object.assign(i, {
|
|
652
|
+
...typeof e.exportable == "boolean" ? { exportable: e.exportable } : {},
|
|
653
|
+
...typeof e.showByDefault == "boolean" ? { showByDefault: e.showByDefault } : {},
|
|
654
|
+
isLink: e.isLink ?? !1,
|
|
655
|
+
linkTemplate: e.linkTemplate ?? "",
|
|
656
|
+
linkType: e.linkType ?? "internal",
|
|
657
|
+
linkTarget: e.linkTarget ?? "_self",
|
|
658
|
+
action: e.action ?? "navigate",
|
|
659
|
+
secondaryField: e.secondaryField ?? "",
|
|
660
|
+
secondaryLabel: e.secondaryLabel ?? "",
|
|
661
|
+
secondaryFields: Array.isArray(e.secondaryFields) ? e.secondaryFields : [],
|
|
662
|
+
secondarySeparator: e.secondarySeparator ?? "",
|
|
663
|
+
lookup: it(e),
|
|
664
|
+
actionButtons: e.actionButtons ?? [],
|
|
665
|
+
derived: e.derived ?? null,
|
|
666
|
+
computed: e.computed ?? null,
|
|
667
|
+
renderType: e.renderType ?? "",
|
|
668
|
+
valueStyles: Array.isArray(e.valueStyles) ? e.valueStyles : [],
|
|
669
|
+
commonStyle: e.commonStyle ?? null,
|
|
670
|
+
displayTemplate: e.displayTemplate ?? "",
|
|
671
|
+
defaultValue: e.defaultValue ?? "",
|
|
672
|
+
renderConfig: e.renderConfig ? {
|
|
673
|
+
...e.renderConfig,
|
|
674
|
+
treatZeroAsEmpty: !!e.renderConfig.treatZeroAsEmpty,
|
|
675
|
+
cleanEmptyTemplateSeparators: !!e.renderConfig.cleanEmptyTemplateSeparators
|
|
676
|
+
} : null
|
|
677
|
+
}) : (i.isEditable = e.isEditable ?? !1, i.ismandatory = e.ismandatory ?? e.isMandatory ?? !1, t === "filter" ? (i.filterInputType = e.filterInputType ?? "dropdown", i.filterToolbar = !!e.filterToolbar, i.filterOptions = Array.isArray(e.filterOptions) ? e.filterOptions : [], i.quickFilterOptions = Array.isArray(e.quickFilterOptions) ? e.quickFilterOptions : [], i.isDefaultFilter = !!e.isDefaultFilter, i.dataSource = e.dataSource ?? "module", e.dataSource === "group" && (i.groupName = e.groupName ?? ""), i.filterGroupFields = Array.isArray(e.filterGroupFields) ? e.filterGroupFields : [], i.filterGroupSeparator = e.filterGroupSeparator ?? " ", i.filterArrayLabelField = e.filterArrayLabelField ?? "", i.filterArrayValueField = e.filterArrayValueField ?? "", e.lookup && (i.lookup = e.lookup)) : [
|
|
678
|
+
"select",
|
|
679
|
+
"radio",
|
|
680
|
+
"checkbox"
|
|
681
|
+
].includes(e.type) && (i.dataSource = e.dataSource ?? "module", e.dataSource === "group" && (i.groupName = e.groupName ?? ""))), i;
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
async function ot(t, r, i, a = "listView", o = h, s = "", c = "createdBy", l = !1, u = "popup", d = !0) {
|
|
685
|
+
let f = T(t), p = ee(o).find((e) => e.key === r)?.apiModule ?? r;
|
|
686
|
+
return n(e, `${m}/role`, {
|
|
687
|
+
method: "PUT",
|
|
688
|
+
body: JSON.stringify({
|
|
689
|
+
module: p,
|
|
690
|
+
roleId: f,
|
|
691
|
+
configType: a,
|
|
692
|
+
updateAllRoles: l,
|
|
693
|
+
...!a || a === "listView" ? { exportEnabled: d } : {},
|
|
694
|
+
...a === "filter" ? { filterDisplayMode: u } : {},
|
|
695
|
+
visibleFields: at(i, a),
|
|
696
|
+
...(!a || a === "listView") && s ? {
|
|
697
|
+
dataVisibilityMode: s,
|
|
698
|
+
dataOwnerField: String(c || "createdBy").trim() || "createdBy"
|
|
699
|
+
} : {}
|
|
700
|
+
})
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
var st = "/admin/role-form-permissions";
|
|
704
|
+
function ct(e) {
|
|
705
|
+
return `__group__:${e}`;
|
|
706
|
+
}
|
|
707
|
+
async function lt(t, r, i = {}) {
|
|
708
|
+
let a = T(t), o = new URLSearchParams({
|
|
709
|
+
module: r,
|
|
710
|
+
roleId: String(a ?? "")
|
|
711
|
+
});
|
|
712
|
+
i.clientId && o.set("clientId", i.clientId), i.region && o.set("region", i.region);
|
|
713
|
+
let s = await n(e, `${st}?${o}`), c = s?.data ?? s;
|
|
714
|
+
return Array.isArray(c) ? c : [];
|
|
715
|
+
}
|
|
716
|
+
async function ut(t, r, i) {
|
|
717
|
+
let a = T(t), o = [], s = 0;
|
|
718
|
+
for (let e of i) {
|
|
719
|
+
e.locked || o.push({
|
|
720
|
+
label: e.label,
|
|
721
|
+
field: ct(e.name),
|
|
722
|
+
isVisible: e.enabled,
|
|
723
|
+
isEditable: e.editable !== !1,
|
|
724
|
+
order: s++
|
|
725
|
+
});
|
|
726
|
+
for (let t of e.fields ?? []) t.locked || o.push({
|
|
727
|
+
label: t.label,
|
|
728
|
+
field: t.field,
|
|
729
|
+
isVisible: t.enabled,
|
|
730
|
+
isEditable: t.editable !== !1,
|
|
731
|
+
order: s++
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
return n(e, `${m}/role`, {
|
|
735
|
+
method: "PUT",
|
|
736
|
+
body: JSON.stringify({
|
|
737
|
+
module: r,
|
|
738
|
+
roleId: a,
|
|
739
|
+
configType: "form",
|
|
740
|
+
visibleFields: o
|
|
741
|
+
})
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
async function dt(t, r, i, a = "listView") {
|
|
745
|
+
let o = E(t), s = h.find((e) => e.key === r)?.apiModule ?? r;
|
|
746
|
+
return n(e, `${m}/team`, {
|
|
747
|
+
method: "PUT",
|
|
748
|
+
body: JSON.stringify({
|
|
749
|
+
module: s,
|
|
750
|
+
teamId: o,
|
|
751
|
+
configType: a,
|
|
752
|
+
visibleFields: at(i, a)
|
|
753
|
+
})
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
async function ft({ offset: t = 0, limit: r = 10, sortBy: i = "new", searchQuery: a = "" } = {}) {
|
|
757
|
+
let o = new URLSearchParams({
|
|
758
|
+
offset: String(t),
|
|
759
|
+
limit: String(r),
|
|
760
|
+
sortBy: i
|
|
761
|
+
});
|
|
762
|
+
a && o.set("searchquery", a);
|
|
763
|
+
let s = await n(e, `/get-all-users?${o}`), c = s.data ?? s, l = g(c, s.users, s.rows, s.items, s.records, c?.users, c?.data, c?.rows, c?.items, c?.records, c?.docs, c?.result, c?.results);
|
|
764
|
+
return {
|
|
765
|
+
users: l,
|
|
766
|
+
total: v({
|
|
767
|
+
...s,
|
|
768
|
+
...c
|
|
769
|
+
}, l)
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
async function pt(t = []) {
|
|
773
|
+
return n(e, `${m}/seed`, {
|
|
774
|
+
method: "POST",
|
|
775
|
+
headers: { "Content-Type": "application/json" },
|
|
776
|
+
body: JSON.stringify({ collections: t })
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
async function mt() {
|
|
780
|
+
let t = await n(e, `${m}/seed-status`), r = t?.data ?? t ?? {};
|
|
781
|
+
return {
|
|
782
|
+
modules: Array.isArray(r.modules) ? r.modules : [],
|
|
783
|
+
seededModules: r.seededModules ?? {}
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
async function ht(t) {
|
|
787
|
+
let n = localStorage.getItem("authToken"), r = new FormData();
|
|
788
|
+
r.append("icon", t);
|
|
789
|
+
let i = await fetch(`${e}/admin/field-config/action-icon`, {
|
|
790
|
+
method: "POST",
|
|
791
|
+
headers: { Authorization: `Bearer ${n}` },
|
|
792
|
+
body: r
|
|
793
|
+
});
|
|
794
|
+
if (!i.ok) {
|
|
795
|
+
let e = /* @__PURE__ */ Error(`Upload failed: ${i.status}`);
|
|
796
|
+
throw e.status = i.status, e;
|
|
797
|
+
}
|
|
798
|
+
let a = await i.json();
|
|
799
|
+
return a.data ?? a;
|
|
800
|
+
}
|
|
801
|
+
async function gt() {
|
|
802
|
+
let [e, t, n] = await Promise.all([
|
|
803
|
+
ce().catch(() => []),
|
|
804
|
+
Ot().catch(() => []),
|
|
805
|
+
Jt().catch(() => [])
|
|
806
|
+
]), r = Array.isArray(e) ? e : [], i = n.map((e) => String(e?.module ?? "").trim()).filter(Boolean);
|
|
807
|
+
return [
|
|
808
|
+
...r,
|
|
809
|
+
...Array.isArray(t) ? t : [],
|
|
810
|
+
...i
|
|
811
|
+
];
|
|
812
|
+
}
|
|
813
|
+
async function _t(t, { page: r = 1, limit: i = 100 } = {}) {
|
|
814
|
+
let a = new URLSearchParams({
|
|
815
|
+
module: t,
|
|
816
|
+
page: String(r),
|
|
817
|
+
limit: String(i)
|
|
818
|
+
}), o = await n(e, `/module/list?${a}`), s = o?.data ?? o ?? {};
|
|
819
|
+
return {
|
|
820
|
+
items: Array.isArray(s.data) ? s.data : [],
|
|
821
|
+
total: s.pagination?.total ?? 0
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
async function vt(t, r) {
|
|
825
|
+
return n(e, `/module/create?module=${encodeURIComponent(t)}`, {
|
|
826
|
+
method: "POST",
|
|
827
|
+
headers: { "Content-Type": "application/json" },
|
|
828
|
+
body: JSON.stringify(r)
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
async function yt(t, r, i) {
|
|
832
|
+
return n(e, `/module/update/${encodeURIComponent(r)}?module=${encodeURIComponent(t)}`, {
|
|
833
|
+
method: "PUT",
|
|
834
|
+
headers: { "Content-Type": "application/json" },
|
|
835
|
+
body: JSON.stringify(i)
|
|
836
|
+
});
|
|
837
|
+
}
|
|
838
|
+
async function bt(t, r) {
|
|
839
|
+
return n(e, `/module/delete/${encodeURIComponent(r)}?module=${encodeURIComponent(t)}`, { method: "DELETE" });
|
|
840
|
+
}
|
|
841
|
+
async function xt(t = "", r = 50) {
|
|
842
|
+
let i = new URLSearchParams({
|
|
843
|
+
search: t,
|
|
844
|
+
limit: String(r),
|
|
845
|
+
offset: "0"
|
|
846
|
+
}), a = await n(e, `/admin/location-dropdown-values?${i}`), o = a?.data ?? a ?? [];
|
|
847
|
+
return (Array.isArray(o) ? o : []).map((e) => {
|
|
848
|
+
let t = typeof e == "string" ? e : e.label ?? e.value ?? "";
|
|
849
|
+
return {
|
|
850
|
+
label: t,
|
|
851
|
+
value: t
|
|
852
|
+
};
|
|
853
|
+
}).filter((e) => e.label);
|
|
854
|
+
}
|
|
855
|
+
async function St(t, r, i = "_id") {
|
|
856
|
+
let a = new URLSearchParams({
|
|
857
|
+
collection: String(t),
|
|
858
|
+
displayField: String(r),
|
|
859
|
+
valueField: String(i)
|
|
860
|
+
}), o = await n(e, `/admin/lookup-dropdown-values?${a}`), s = o?.data ?? o ?? [];
|
|
861
|
+
return (Array.isArray(s) ? s : []).map((e) => ({
|
|
862
|
+
label: e.label ?? e.displayValue ?? e[r] ?? String(e.value ?? ""),
|
|
863
|
+
value: String(e.value ?? e._id ?? e.id ?? "")
|
|
864
|
+
})).filter((e) => e.value && e.label);
|
|
865
|
+
}
|
|
866
|
+
function Ct(e) {
|
|
867
|
+
if (typeof e == "string") {
|
|
868
|
+
let t = e.trim();
|
|
869
|
+
return t ? {
|
|
870
|
+
field: t,
|
|
871
|
+
locked: !0,
|
|
872
|
+
forceShow: !0,
|
|
873
|
+
forceReq: !0
|
|
874
|
+
} : null;
|
|
875
|
+
}
|
|
876
|
+
if (!e || typeof e != "object") return null;
|
|
877
|
+
let t = String(e.field ?? "").trim();
|
|
878
|
+
return t ? {
|
|
879
|
+
field: t,
|
|
880
|
+
locked: e.locked === !0,
|
|
881
|
+
forceShow: e.forceShow === !0,
|
|
882
|
+
forceReq: e.forceReq === !0
|
|
883
|
+
} : null;
|
|
884
|
+
}
|
|
885
|
+
function wt(e) {
|
|
886
|
+
let t = /* @__PURE__ */ new Map();
|
|
887
|
+
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
888
|
+
let n = Ct(e);
|
|
889
|
+
n && !t.has(n.field) && t.set(n.field, n);
|
|
890
|
+
}), t;
|
|
891
|
+
}
|
|
892
|
+
async function Tt(t) {
|
|
893
|
+
let r = await n(e, `/admin/default-fields?module=${encodeURIComponent(t)}`), i = r?.data ?? r ?? {};
|
|
894
|
+
return Array.isArray(i.fields) ? i.fields : [];
|
|
895
|
+
}
|
|
896
|
+
async function Et(t, r, i) {
|
|
897
|
+
return n(e, "/admin/default-fields", {
|
|
898
|
+
method: "PUT",
|
|
899
|
+
headers: { "Content-Type": "application/json" },
|
|
900
|
+
body: JSON.stringify({
|
|
901
|
+
module: t,
|
|
902
|
+
fields: r,
|
|
903
|
+
otp: i
|
|
904
|
+
})
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
async function Dt(t) {
|
|
908
|
+
let r = await n(e, "/email-verify", {
|
|
909
|
+
method: "POST",
|
|
910
|
+
headers: { "Content-Type": "application/json" },
|
|
911
|
+
body: JSON.stringify({ email: t })
|
|
912
|
+
}), i = r?.data ?? r ?? {};
|
|
913
|
+
return {
|
|
914
|
+
valid: !!i.valid,
|
|
915
|
+
reason: i.reason ?? "",
|
|
916
|
+
result: i.result ?? "",
|
|
917
|
+
mailboxConfirmed: !!i.mailboxConfirmed,
|
|
918
|
+
catchAll: !!i.catchAll,
|
|
919
|
+
disposable: !!i.disposable,
|
|
920
|
+
roleAddress: !!i.roleAddress,
|
|
921
|
+
risk: i.risk ?? "",
|
|
922
|
+
checks: Array.isArray(i.checks) ? i.checks : []
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
async function Ot() {
|
|
926
|
+
let t = await n(e, "/admin/lookup/collections"), r = t.data ?? t;
|
|
927
|
+
return Array.isArray(r) ? r : [];
|
|
928
|
+
}
|
|
929
|
+
async function kt(t) {
|
|
930
|
+
let r = await n(e, `/admin/lookup/collection-fields?collection=${encodeURIComponent(t)}`), i = r.data ?? r;
|
|
931
|
+
return Array.isArray(i) ? i : [];
|
|
932
|
+
}
|
|
933
|
+
async function At(t, r) {
|
|
934
|
+
let i = await n(e, `/admin/field-array-subfields?module=${encodeURIComponent(t)}&field=${encodeURIComponent(r)}`), a = i.data ?? i;
|
|
935
|
+
return Array.isArray(a?.fields) ? a.fields : [];
|
|
936
|
+
}
|
|
937
|
+
async function jt() {
|
|
938
|
+
let t = await n(e, "/admin/menu-modules");
|
|
939
|
+
return g(t.data, t);
|
|
940
|
+
}
|
|
941
|
+
async function Mt({ menuName: t, apiUrl: r = "", menuType: i = "menu", parentMenuId: a = 0, displayOrder: o = 0 }) {
|
|
942
|
+
let s = await n(e, "/admin/menu-modules", {
|
|
943
|
+
method: "POST",
|
|
944
|
+
body: JSON.stringify({
|
|
945
|
+
menuName: t,
|
|
946
|
+
apiUrl: r,
|
|
947
|
+
menuType: i,
|
|
948
|
+
parentMenuId: a,
|
|
949
|
+
displayOrder: o
|
|
950
|
+
})
|
|
951
|
+
});
|
|
952
|
+
return s.data ?? s;
|
|
953
|
+
}
|
|
954
|
+
async function Nt(t, { menuName: r }) {
|
|
955
|
+
let i = await n(e, `/admin/menu-modules/${t}`, {
|
|
956
|
+
method: "PUT",
|
|
957
|
+
body: JSON.stringify({ menuName: r })
|
|
958
|
+
});
|
|
959
|
+
return i.data ?? i;
|
|
960
|
+
}
|
|
961
|
+
async function Pt(t) {
|
|
962
|
+
let r = await n(e, `/admin/menu-modules/${t}`, { method: "DELETE" });
|
|
963
|
+
return r.data ?? r;
|
|
964
|
+
}
|
|
965
|
+
async function Ft() {
|
|
966
|
+
let t = await n(e, "/admin/menu-actions");
|
|
967
|
+
return g(t.data, t);
|
|
968
|
+
}
|
|
969
|
+
async function It({ permissionName: t, permissionKey: r }) {
|
|
970
|
+
let i = await n(e, "/admin/menu-actions", {
|
|
971
|
+
method: "POST",
|
|
972
|
+
body: JSON.stringify({
|
|
973
|
+
permissionName: t,
|
|
974
|
+
permissionKey: r
|
|
975
|
+
})
|
|
976
|
+
});
|
|
977
|
+
return i.data ?? i;
|
|
978
|
+
}
|
|
979
|
+
async function Lt(t, { permissionName: r }) {
|
|
980
|
+
let i = await n(e, `/admin/menu-actions/${t}`, {
|
|
981
|
+
method: "PUT",
|
|
982
|
+
body: JSON.stringify({ permissionName: r })
|
|
983
|
+
});
|
|
984
|
+
return i.data ?? i;
|
|
985
|
+
}
|
|
986
|
+
async function Rt(t) {
|
|
987
|
+
let r = await n(e, `/admin/menu-actions/${t}`, { method: "DELETE" });
|
|
988
|
+
return r.data ?? r;
|
|
989
|
+
}
|
|
990
|
+
function zt(e) {
|
|
991
|
+
if (e && typeof e == "object" && !Array.isArray(e)) return zt(e.value ?? e.access_value ?? e.accessValue ?? e.permissionValue ?? e.enabled);
|
|
992
|
+
if (e === !0 || e === 1 || e === "1") return "1";
|
|
993
|
+
let t = String(e ?? "").trim().toLowerCase();
|
|
994
|
+
return t === "true" || t === "yes" || t === "active" ? "1" : "0";
|
|
995
|
+
}
|
|
996
|
+
function Bt(e = {}) {
|
|
997
|
+
return !e || typeof e != "object" || Array.isArray(e) ? e : Object.fromEntries(Object.entries(e).map(([e, t]) => [e, {
|
|
998
|
+
...t,
|
|
999
|
+
menuId: t?.menuId ?? t?.menu_id ?? 0,
|
|
1000
|
+
permissions: Object.fromEntries(Object.entries(t?.permissions ?? {}).map(([e, t]) => [e, {
|
|
1001
|
+
...t && typeof t == "object" && !Array.isArray(t) ? t : {},
|
|
1002
|
+
id: t?.id ?? t?.permission_id ?? t?.permissionId ?? 0,
|
|
1003
|
+
value: zt(t)
|
|
1004
|
+
}]))
|
|
1005
|
+
}]));
|
|
1006
|
+
}
|
|
1007
|
+
async function Vt(t) {
|
|
1008
|
+
let r = await n(e, `/get-role-details?roleid=${t}`);
|
|
1009
|
+
return r?.data ?? r ?? {};
|
|
1010
|
+
}
|
|
1011
|
+
async function Ht(t, r) {
|
|
1012
|
+
return n(e, "/edit-role-details", {
|
|
1013
|
+
method: "PUT",
|
|
1014
|
+
headers: { "Content-Type": "application/json" },
|
|
1015
|
+
body: JSON.stringify({
|
|
1016
|
+
roleId: t,
|
|
1017
|
+
menus: Bt(r)
|
|
1018
|
+
})
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
var D = "/admin/custom-forms";
|
|
1022
|
+
async function Ut(t = "", r = "", i = "") {
|
|
1023
|
+
let a = new URLSearchParams();
|
|
1024
|
+
t && a.append("module", t), r && a.append("formType", r), i && a.append("action", i);
|
|
1025
|
+
let o = `${D}?${a.toString()}`, s = await n(e, o), c = s?.data;
|
|
1026
|
+
return Array.isArray(c) ? c : Array.isArray(s) ? s : [];
|
|
1027
|
+
}
|
|
1028
|
+
async function Wt(t) {
|
|
1029
|
+
return n(e, D, {
|
|
1030
|
+
method: "POST",
|
|
1031
|
+
headers: { "Content-Type": "application/json" },
|
|
1032
|
+
body: JSON.stringify(t)
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
async function Gt(t, r) {
|
|
1036
|
+
return n(e, `${D}/${t}`, {
|
|
1037
|
+
method: "PUT",
|
|
1038
|
+
headers: { "Content-Type": "application/json" },
|
|
1039
|
+
body: JSON.stringify(r)
|
|
1040
|
+
});
|
|
1041
|
+
}
|
|
1042
|
+
async function Kt(t) {
|
|
1043
|
+
return n(e, `${D}/${t}`, { method: "DELETE" });
|
|
1044
|
+
}
|
|
1045
|
+
var O = "/admin/row-action-config";
|
|
1046
|
+
function qt(e) {
|
|
1047
|
+
return String(e ?? "").trim().toLowerCase();
|
|
1048
|
+
}
|
|
1049
|
+
async function Jt(t = "") {
|
|
1050
|
+
let r = qt(t), i = r ? `${O}?module=${encodeURIComponent(r)}` : O, a = await n(e, i), o = a?.data;
|
|
1051
|
+
return Array.isArray(o) ? o : Array.isArray(a) ? a : [];
|
|
1052
|
+
}
|
|
1053
|
+
async function Yt({ module: t, roleId: r = 0, rowActions: i = [] }) {
|
|
1054
|
+
let a = qt(t);
|
|
1055
|
+
return n(e, O, {
|
|
1056
|
+
method: "POST",
|
|
1057
|
+
headers: { "Content-Type": "application/json" },
|
|
1058
|
+
body: JSON.stringify({
|
|
1059
|
+
module: a,
|
|
1060
|
+
roleId: r,
|
|
1061
|
+
rowActions: i
|
|
1062
|
+
})
|
|
1063
|
+
});
|
|
1064
|
+
}
|
|
1065
|
+
async function Xt(t, r = []) {
|
|
1066
|
+
return n(e, `${O}/${t}`, {
|
|
1067
|
+
method: "PUT",
|
|
1068
|
+
headers: { "Content-Type": "application/json" },
|
|
1069
|
+
body: JSON.stringify({ rowActions: r })
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
async function Zt(t) {
|
|
1073
|
+
return n(e, `${O}/${t}`, { method: "DELETE" });
|
|
1074
|
+
}
|
|
1075
|
+
var k = "/admin/module-action-rules";
|
|
1076
|
+
async function Qt(t) {
|
|
1077
|
+
let r = await n(e, `${k}?module=${encodeURIComponent(t)}`), i = r?.data;
|
|
1078
|
+
return Array.isArray(i) ? i : Array.isArray(r) ? r : [];
|
|
1079
|
+
}
|
|
1080
|
+
async function $t({ module: t, name: r, description: i = "", conditions: a = [], blockedActions: o = [], disabledActions: s = [], allowedActions: c = void 0, primaryAction: l = void 0, appliesTo: u = void 0, isActive: d = !0 }) {
|
|
1081
|
+
return n(e, k, {
|
|
1082
|
+
method: "POST",
|
|
1083
|
+
headers: { "Content-Type": "application/json" },
|
|
1084
|
+
body: JSON.stringify({
|
|
1085
|
+
module: t,
|
|
1086
|
+
name: r,
|
|
1087
|
+
description: i,
|
|
1088
|
+
conditions: a,
|
|
1089
|
+
blockedActions: o,
|
|
1090
|
+
disabledActions: s,
|
|
1091
|
+
allowedActions: c,
|
|
1092
|
+
primaryAction: l,
|
|
1093
|
+
appliesTo: u,
|
|
1094
|
+
isActive: d
|
|
1095
|
+
})
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
async function en(t, { name: r, description: i = "", conditions: a = [], blockedActions: o = [], disabledActions: s = [], allowedActions: c = void 0, primaryAction: l = void 0, appliesTo: u = void 0, isActive: d = !0 }) {
|
|
1099
|
+
return n(e, `${k}/${t}`, {
|
|
1100
|
+
method: "PUT",
|
|
1101
|
+
headers: { "Content-Type": "application/json" },
|
|
1102
|
+
body: JSON.stringify({
|
|
1103
|
+
name: r,
|
|
1104
|
+
description: i,
|
|
1105
|
+
conditions: a,
|
|
1106
|
+
blockedActions: o,
|
|
1107
|
+
disabledActions: s,
|
|
1108
|
+
allowedActions: c,
|
|
1109
|
+
primaryAction: l,
|
|
1110
|
+
appliesTo: u,
|
|
1111
|
+
isActive: d
|
|
1112
|
+
})
|
|
1113
|
+
});
|
|
1114
|
+
}
|
|
1115
|
+
async function tn(t) {
|
|
1116
|
+
return n(e, `${k}/${t}`, { method: "DELETE" });
|
|
1117
|
+
}
|
|
1118
|
+
async function nn(t) {
|
|
1119
|
+
let r = new URLSearchParams({
|
|
1120
|
+
module: "onboarding",
|
|
1121
|
+
configType: "tabs",
|
|
1122
|
+
userId: "0",
|
|
1123
|
+
roleId: String(T(t))
|
|
1124
|
+
}), i = await n(e, `${m}?${r}`);
|
|
1125
|
+
return i.data ?? i;
|
|
1126
|
+
}
|
|
1127
|
+
async function rn(t, r) {
|
|
1128
|
+
return n(e, `${m}/role`, {
|
|
1129
|
+
method: "PUT",
|
|
1130
|
+
body: JSON.stringify({
|
|
1131
|
+
module: "onboarding",
|
|
1132
|
+
roleId: T(t),
|
|
1133
|
+
configType: "tabs",
|
|
1134
|
+
onboardingTabs: r
|
|
1135
|
+
})
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1138
|
+
//#endregion
|
|
1139
|
+
//#region src/components/detailViewMode.js
|
|
1140
|
+
var an = [
|
|
1141
|
+
{
|
|
1142
|
+
value: "self",
|
|
1143
|
+
label: "Same page"
|
|
1144
|
+
},
|
|
1145
|
+
{
|
|
1146
|
+
value: "newTab",
|
|
1147
|
+
label: "New tab"
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
value: "popup",
|
|
1151
|
+
label: "Popup"
|
|
1152
|
+
}
|
|
1153
|
+
], on = an.map((e) => e.value);
|
|
1154
|
+
function sn(e) {
|
|
1155
|
+
return {
|
|
1156
|
+
self: "self",
|
|
1157
|
+
newtab: "newTab",
|
|
1158
|
+
popup: "popup"
|
|
1159
|
+
}[String(e ?? "").trim().toLowerCase()] || "popup";
|
|
1160
|
+
}
|
|
1161
|
+
var cn = "/popup/candidate-detail";
|
|
1162
|
+
function ln(e, { href: t, navigate: n, location: r } = {}) {
|
|
1163
|
+
if (!t) return !1;
|
|
1164
|
+
let i = sn(e);
|
|
1165
|
+
if (i === "self") return !1;
|
|
1166
|
+
if (i === "newTab") return window.open(t, "_blank", "noopener"), !0;
|
|
1167
|
+
let a = String(t), o = (a.split("/detailview/")[1] ?? a.split("/detail-view/")[1])?.split(/[/?#]/)[0];
|
|
1168
|
+
if (!o || typeof n != "function") return !1;
|
|
1169
|
+
let s = r || (typeof window < "u" ? {
|
|
1170
|
+
pathname: window.location.pathname,
|
|
1171
|
+
search: window.location.search,
|
|
1172
|
+
hash: window.location.hash
|
|
1173
|
+
} : void 0);
|
|
1174
|
+
return n(`${cn}/${o}`, { state: { background: s } }), !0;
|
|
1175
|
+
}
|
|
1176
|
+
//#endregion
|
|
1177
|
+
//#region src/services/detailDefaults.js
|
|
1178
|
+
var A = Object.freeze({
|
|
1179
|
+
s3BaseUrl: "https://zinnext-devlopment-ap-south-1.s3.ap-south-1.amazonaws.com".replace(/\/+$/, ""),
|
|
1180
|
+
dateFormat: "DD MMM YYYY",
|
|
1181
|
+
dateTimeFormat: "MMM DD, YYYY | hh:mm A",
|
|
1182
|
+
showTimeZoneLabel: !0,
|
|
1183
|
+
timeZone: "",
|
|
1184
|
+
timeZoneAliases: {},
|
|
1185
|
+
region: "",
|
|
1186
|
+
booleanTrueLabel: "Yes",
|
|
1187
|
+
booleanFalseLabel: "No",
|
|
1188
|
+
emptyPlaceholder: "-",
|
|
1189
|
+
emptyTexts: {},
|
|
1190
|
+
separator: " - ",
|
|
1191
|
+
documentNameOrder: [
|
|
1192
|
+
"name",
|
|
1193
|
+
"documentName",
|
|
1194
|
+
"uploadName",
|
|
1195
|
+
"uploadedFileName",
|
|
1196
|
+
"uniqueName"
|
|
1197
|
+
],
|
|
1198
|
+
phoneFormat: "3-3-4",
|
|
1199
|
+
phoneCountryCode: "",
|
|
1200
|
+
candidateDetailViewMode: "popup"
|
|
1201
|
+
}), j = { ...A }, un = null;
|
|
1202
|
+
function M() {
|
|
1203
|
+
return j;
|
|
1204
|
+
}
|
|
1205
|
+
function dn(e) {
|
|
1206
|
+
if (!e || typeof e != "object") return {};
|
|
1207
|
+
let t = {};
|
|
1208
|
+
if (e.s3BaseUrl && (t.s3BaseUrl = String(e.s3BaseUrl).replace(/\/+$/, "")), e.dateFormat && (t.dateFormat = e.dateFormat), e.dateTimeFormat && (t.dateTimeFormat = e.dateTimeFormat), typeof e.showTimeZoneLabel == "boolean" && (t.showTimeZoneLabel = e.showTimeZoneLabel), typeof e.timeZone == "string" && (t.timeZone = e.timeZone.trim()), typeof e.region == "string" && (t.region = e.region.trim()), e.timeZoneAliases && typeof e.timeZoneAliases == "object" && !Array.isArray(e.timeZoneAliases) && (t.timeZoneAliases = {
|
|
1209
|
+
...j.timeZoneAliases,
|
|
1210
|
+
...e.timeZoneAliases
|
|
1211
|
+
}), e.booleanTrueLabel && (t.booleanTrueLabel = e.booleanTrueLabel), e.booleanFalseLabel && (t.booleanFalseLabel = e.booleanFalseLabel), e.emptyPlaceholder && (t.emptyPlaceholder = e.emptyPlaceholder), e.emptyTexts && typeof e.emptyTexts == "object" && !Array.isArray(e.emptyTexts)) {
|
|
1212
|
+
let n = {};
|
|
1213
|
+
Object.entries(e.emptyTexts).forEach(([e, t]) => {
|
|
1214
|
+
typeof t == "string" && t.trim() !== "" && (n[e] = t.trim());
|
|
1215
|
+
}), Object.keys(n).length && (t.emptyTexts = {
|
|
1216
|
+
...j.emptyTexts,
|
|
1217
|
+
...n
|
|
1218
|
+
});
|
|
1219
|
+
}
|
|
1220
|
+
if (typeof e.separator == "string" && e.separator !== "" && (t.separator = e.separator), typeof e.phoneFormat == "string" && e.phoneFormat.trim() !== "" && (t.phoneFormat = e.phoneFormat.trim()), typeof e.phoneCountryCode == "string" && (t.phoneCountryCode = e.phoneCountryCode.trim()), typeof e.phoneCountryCode == "string" && (t.phoneCountryCode = e.phoneCountryCode.trim()), Array.isArray(e.documentNameOrder) && e.documentNameOrder.length && (t.documentNameOrder = e.documentNameOrder), on.includes(e.candidateDetailViewMode) && (t.candidateDetailViewMode = e.candidateDetailViewMode), e.formDateFormats && typeof e.formDateFormats == "object" && !Array.isArray(e.formDateFormats)) {
|
|
1221
|
+
let n = {};
|
|
1222
|
+
Object.entries(e.formDateFormats).forEach(([e, t]) => {
|
|
1223
|
+
typeof t == "string" && t.trim() !== "" && (n[e] = t.trim());
|
|
1224
|
+
}), t.formDateFormats = n;
|
|
1225
|
+
}
|
|
1226
|
+
return t;
|
|
1227
|
+
}
|
|
1228
|
+
function fn(e = N()) {
|
|
1229
|
+
let t = (String(e).match(/\d+/g) ?? [
|
|
1230
|
+
"3",
|
|
1231
|
+
"3",
|
|
1232
|
+
"4"
|
|
1233
|
+
]).map(Number).filter((e) => e > 0), n = String(e).match(/\D+/)?.[0] ?? "-", r = t.length ? t : [
|
|
1234
|
+
3,
|
|
1235
|
+
3,
|
|
1236
|
+
4
|
|
1237
|
+
];
|
|
1238
|
+
return {
|
|
1239
|
+
groups: r,
|
|
1240
|
+
sep: n,
|
|
1241
|
+
total: r.reduce((e, t) => e + t, 0)
|
|
1242
|
+
};
|
|
1243
|
+
}
|
|
1244
|
+
function N() {
|
|
1245
|
+
return j.phoneFormat || A.phoneFormat;
|
|
1246
|
+
}
|
|
1247
|
+
function pn() {
|
|
1248
|
+
return j.phoneCountryCode ?? A.phoneCountryCode;
|
|
1249
|
+
}
|
|
1250
|
+
function mn(e, t = N()) {
|
|
1251
|
+
let { total: n } = fn(t);
|
|
1252
|
+
return String(e ?? "").replace(/\D/g, "").slice(0, n);
|
|
1253
|
+
}
|
|
1254
|
+
function hn(e, t = N()) {
|
|
1255
|
+
let { groups: n, sep: r } = fn(t), i = mn(e, t);
|
|
1256
|
+
if (!i) return "";
|
|
1257
|
+
let a = [], o = 0;
|
|
1258
|
+
for (let e of n) {
|
|
1259
|
+
if (o >= i.length) break;
|
|
1260
|
+
a.push(i.slice(o, o + e)), o += e;
|
|
1261
|
+
}
|
|
1262
|
+
return a.join(r);
|
|
1263
|
+
}
|
|
1264
|
+
function gn(e) {
|
|
1265
|
+
let t = dn(e);
|
|
1266
|
+
return Object.keys(t).forEach((e) => _n.add(e)), j = {
|
|
1267
|
+
...j,
|
|
1268
|
+
...t
|
|
1269
|
+
}, j;
|
|
1270
|
+
}
|
|
1271
|
+
var _n = /* @__PURE__ */ new Set();
|
|
1272
|
+
function vn() {
|
|
1273
|
+
return _n.has("dateFormat") ? j.dateFormat : void 0;
|
|
1274
|
+
}
|
|
1275
|
+
function yn(e) {
|
|
1276
|
+
let t = j.formDateFormats, n = String(e ?? "").trim().toLowerCase();
|
|
1277
|
+
if (!t || !n) return;
|
|
1278
|
+
let r = n.endsWith("s") ? n.slice(0, -1) : n, i = Object.keys(t).find((e) => {
|
|
1279
|
+
let t = e.trim().toLowerCase();
|
|
1280
|
+
return t === n || t === r || t === `${r}s`;
|
|
1281
|
+
});
|
|
1282
|
+
return i ? t[i] : void 0;
|
|
1283
|
+
}
|
|
1284
|
+
function bn(e = !1) {
|
|
1285
|
+
return un && !e || (un = Promise.resolve().then(() => Me()).then((e) => gn(e)).catch(() => j)), un;
|
|
1286
|
+
}
|
|
1287
|
+
l.extend(u), l.extend(d);
|
|
1288
|
+
var P = null;
|
|
1289
|
+
function xn() {
|
|
1290
|
+
if (P === null) try {
|
|
1291
|
+
P = l.tz.guess() || "UTC";
|
|
1292
|
+
} catch {
|
|
1293
|
+
P = "UTC";
|
|
1294
|
+
}
|
|
1295
|
+
return P;
|
|
1296
|
+
}
|
|
1297
|
+
function Sn(e) {
|
|
1298
|
+
let t = String(e ?? "").trim();
|
|
1299
|
+
if (!t || t !== "UTC" && !t.includes("/")) return !1;
|
|
1300
|
+
try {
|
|
1301
|
+
return new Intl.DateTimeFormat("en-US", { timeZone: t }), !0;
|
|
1302
|
+
} catch {
|
|
1303
|
+
return !1;
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
function F(e = M()) {
|
|
1307
|
+
let t = String(e?.timeZone ?? "").trim();
|
|
1308
|
+
return Sn(t) ? t : xn();
|
|
1309
|
+
}
|
|
1310
|
+
function Cn(e) {
|
|
1311
|
+
return l().tz(F(e));
|
|
1312
|
+
}
|
|
1313
|
+
function wn(e, t) {
|
|
1314
|
+
let n = l(e?.$date ?? e);
|
|
1315
|
+
return n.isValid() ? n.tz(F(t)) : n;
|
|
1316
|
+
}
|
|
1317
|
+
function Tn(e, t, n = M()) {
|
|
1318
|
+
let r = wn(e, n);
|
|
1319
|
+
return r.isValid() ? r.format(t || n?.dateFormat || "DD MMM YYYY") : "";
|
|
1320
|
+
}
|
|
1321
|
+
function En(e = M(), t) {
|
|
1322
|
+
let n = F(e), r = Pn(n, e);
|
|
1323
|
+
if (r && r.includes("/")) {
|
|
1324
|
+
let e = Dn(n, t);
|
|
1325
|
+
if (e) return r.split("/").map((e) => e.trim()).find((t) => t.toUpperCase() === e.toUpperCase()) || e;
|
|
1326
|
+
}
|
|
1327
|
+
return r || Dn(n, t) || n;
|
|
1328
|
+
}
|
|
1329
|
+
function Dn(e, t) {
|
|
1330
|
+
try {
|
|
1331
|
+
let n = t === void 0 ? /* @__PURE__ */ new Date() : new Date(l(t?.$date ?? t).valueOf());
|
|
1332
|
+
if (Number.isNaN(n.valueOf())) return "";
|
|
1333
|
+
let r = new Intl.DateTimeFormat("en-US", {
|
|
1334
|
+
timeZone: e,
|
|
1335
|
+
timeZoneName: "short"
|
|
1336
|
+
}).formatToParts(n).find((e) => e.type === "timeZoneName")?.value ?? "";
|
|
1337
|
+
return /^[A-Za-z]+$/.test(r) ? r : "";
|
|
1338
|
+
} catch {
|
|
1339
|
+
return "";
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
function On(e, t = M()) {
|
|
1343
|
+
let n = Tn(e, t?.dateTimeFormat || "MMM DD, YYYY | hh:mm A", t);
|
|
1344
|
+
if (!n) return "";
|
|
1345
|
+
if (t?.showTimeZoneLabel === !1) return n;
|
|
1346
|
+
let r = En(t, e);
|
|
1347
|
+
return r ? `${n} ${r}` : n;
|
|
1348
|
+
}
|
|
1349
|
+
function kn(e) {
|
|
1350
|
+
if (!e) return !1;
|
|
1351
|
+
if (e.tzAware === !0) return !0;
|
|
1352
|
+
if (e.tzAware === !1) return !1;
|
|
1353
|
+
let t = String(e.type ?? "").toLowerCase();
|
|
1354
|
+
return t === "datetime" || t === "time" || t === "datetime-local";
|
|
1355
|
+
}
|
|
1356
|
+
function An(e, t) {
|
|
1357
|
+
if (e == null || e === "") return null;
|
|
1358
|
+
let n = l(e);
|
|
1359
|
+
if (!n.isValid()) return null;
|
|
1360
|
+
let r = F(t);
|
|
1361
|
+
return l.tz(n.format("YYYY-MM-DDTHH:mm:ss"), r);
|
|
1362
|
+
}
|
|
1363
|
+
function jn(e = F()) {
|
|
1364
|
+
try {
|
|
1365
|
+
let t = l().tz(e).utcOffset(), n = t < 0 ? "-" : "+", r = Math.abs(t);
|
|
1366
|
+
return `UTC${n}${String(Math.floor(r / 60)).padStart(2, "0")}:${String(r % 60).padStart(2, "0")}`;
|
|
1367
|
+
} catch {
|
|
1368
|
+
return "";
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
function Mn(e = M()) {
|
|
1372
|
+
let t = F(e);
|
|
1373
|
+
return `${Pn(t, e) || t} (${jn(t)})`;
|
|
1374
|
+
}
|
|
1375
|
+
var Nn = Object.freeze({
|
|
1376
|
+
UTC: "UTC",
|
|
1377
|
+
"Asia/Kolkata": "IST",
|
|
1378
|
+
"Asia/Calcutta": "IST",
|
|
1379
|
+
"Asia/Dubai": "GST",
|
|
1380
|
+
"America/New_York": "EST/EDT",
|
|
1381
|
+
"America/Chicago": "CST/CDT",
|
|
1382
|
+
"America/Denver": "MST/MDT",
|
|
1383
|
+
"America/Los_Angeles": "PST/PDT",
|
|
1384
|
+
"Europe/London": "GMT/BST",
|
|
1385
|
+
"Europe/Berlin": "CET/CEST",
|
|
1386
|
+
"Asia/Singapore": "SGT",
|
|
1387
|
+
"Asia/Tokyo": "JST",
|
|
1388
|
+
"Australia/Sydney": "AEST/AEDT"
|
|
1389
|
+
});
|
|
1390
|
+
function Pn(e, t = M()) {
|
|
1391
|
+
return (t?.timeZoneAliases ?? {})[e] ?? Nn[e] ?? "";
|
|
1392
|
+
}
|
|
1393
|
+
function Fn(e = M()) {
|
|
1394
|
+
let t = [];
|
|
1395
|
+
try {
|
|
1396
|
+
t = Intl.supportedValuesOf("timeZone") ?? [];
|
|
1397
|
+
} catch {
|
|
1398
|
+
t = [];
|
|
1399
|
+
}
|
|
1400
|
+
let n = [
|
|
1401
|
+
"UTC",
|
|
1402
|
+
...Object.keys(Nn),
|
|
1403
|
+
...Object.keys(e?.timeZoneAliases ?? {})
|
|
1404
|
+
];
|
|
1405
|
+
return [.../* @__PURE__ */ new Set([...n, ...t])].filter(Sn).map((t) => {
|
|
1406
|
+
let n = 0;
|
|
1407
|
+
try {
|
|
1408
|
+
n = l().tz(t).utcOffset();
|
|
1409
|
+
} catch {
|
|
1410
|
+
return null;
|
|
1411
|
+
}
|
|
1412
|
+
let r = Pn(t, e), i = jn(t);
|
|
1413
|
+
return {
|
|
1414
|
+
value: t,
|
|
1415
|
+
alias: r,
|
|
1416
|
+
offsetLabel: i,
|
|
1417
|
+
offsetMinutes: n,
|
|
1418
|
+
label: `${r ? `${r} — ` : ""}${t} (${i})`
|
|
1419
|
+
};
|
|
1420
|
+
}).filter(Boolean).sort((e, t) => e.offsetMinutes - t.offsetMinutes || e.value.localeCompare(t.value));
|
|
1421
|
+
}
|
|
1422
|
+
//#endregion
|
|
1423
|
+
//#region src/utils/modulePath.js
|
|
1424
|
+
function In(e) {
|
|
1425
|
+
let t = String(e ?? "").trim();
|
|
1426
|
+
if (!t) return {
|
|
1427
|
+
baseModule: "",
|
|
1428
|
+
nestedPath: ""
|
|
1429
|
+
};
|
|
1430
|
+
let [n, ...r] = t.split(".");
|
|
1431
|
+
return {
|
|
1432
|
+
baseModule: n.trim(),
|
|
1433
|
+
nestedPath: r.map((e) => e.trim()).filter(Boolean).join(".")
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
function I(e) {
|
|
1437
|
+
return In(e).baseModule;
|
|
1438
|
+
}
|
|
1439
|
+
//#endregion
|
|
1440
|
+
//#region src/services/moduleDataApi.js
|
|
1441
|
+
var Ln = "test-flows", Rn = "lms-flows";
|
|
1442
|
+
function zn(e) {
|
|
1443
|
+
let t = (Array.isArray(e) ? e : [e]).flat().map((e) => e && typeof e == "object" ? e.value ?? e.label ?? e.name ?? "" : e).map((e) => String(e ?? "").trim().toLowerCase()).filter(Boolean);
|
|
1444
|
+
return t.includes("dice") ? "dice" : t.includes("internal") ? "internal" : t[0] || "";
|
|
1445
|
+
}
|
|
1446
|
+
function Bn(...e) {
|
|
1447
|
+
for (let t of e) {
|
|
1448
|
+
let e = Number(t);
|
|
1449
|
+
if (Number.isFinite(e)) return e;
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
function Vn(e, t, n, r = "") {
|
|
1453
|
+
let i = e?.count, a = t?.count, o = String(r ?? "").trim().toLowerCase();
|
|
1454
|
+
if (i && typeof i == "object") {
|
|
1455
|
+
let e = Bn(o ? i[o] : void 0, i.total, i.searchCount, i.count);
|
|
1456
|
+
if (e !== void 0) return e;
|
|
1457
|
+
}
|
|
1458
|
+
if (a && typeof a == "object") {
|
|
1459
|
+
let e = Bn(o ? a[o] : void 0, a.total, a.searchCount, a.count);
|
|
1460
|
+
if (e !== void 0) return e;
|
|
1461
|
+
}
|
|
1462
|
+
return Bn(e?.total, typeof i == "object" ? void 0 : i, e?.totalCount, t?.total, typeof a == "object" ? void 0 : a, t?.totalCount, n.length) ?? 0;
|
|
1463
|
+
}
|
|
1464
|
+
function Hn(e, t) {
|
|
1465
|
+
let n = {};
|
|
1466
|
+
return [e?.count, t?.count].forEach((e) => {
|
|
1467
|
+
!e || typeof e != "object" || Object.entries(e).forEach(([e, t]) => {
|
|
1468
|
+
let r = Number(t);
|
|
1469
|
+
Number.isFinite(r) && (n[String(e).trim().toLowerCase()] = r);
|
|
1470
|
+
});
|
|
1471
|
+
}), n;
|
|
1472
|
+
}
|
|
1473
|
+
async function Un(t, n, i = "", a = 50, o = 0, s = {}) {
|
|
1474
|
+
let c = new URLSearchParams({
|
|
1475
|
+
module: I(t),
|
|
1476
|
+
field: n,
|
|
1477
|
+
value: i,
|
|
1478
|
+
limit: String(a),
|
|
1479
|
+
offset: String(o)
|
|
1480
|
+
});
|
|
1481
|
+
return s.dataSource && c.set("dataSource", s.dataSource), s.masterName && c.set("masterName", s.masterName), s.groupName && c.set("groupName", s.groupName), s.scope && c.set("scope", s.scope), s.arrayLabelField && c.set("arrayLabelField", s.arrayLabelField), s.arrayValueField && c.set("arrayValueField", s.arrayValueField), r(e, `/filter-dropdown-values?${c}`);
|
|
1482
|
+
}
|
|
1483
|
+
async function Wn(t, r = 10, i = 0, a = {}) {
|
|
1484
|
+
let { scope: o = "", sort: s = "", sortDir: c = "", filters: l = [] } = a;
|
|
1485
|
+
if (t === Ln) {
|
|
1486
|
+
let { getTestFlows: e } = await import("./index.js").then((e) => e.t), t = await e({
|
|
1487
|
+
limit: r,
|
|
1488
|
+
offset: i
|
|
1489
|
+
}), n = Array.isArray(t?.items) ? t.items : [], a = Number(t?.total) || 0;
|
|
1490
|
+
return {
|
|
1491
|
+
items: n,
|
|
1492
|
+
total: a,
|
|
1493
|
+
limit: r,
|
|
1494
|
+
offset: i,
|
|
1495
|
+
tabs: [{
|
|
1496
|
+
key: "all",
|
|
1497
|
+
title: "Test Cases",
|
|
1498
|
+
count: a
|
|
1499
|
+
}]
|
|
1500
|
+
};
|
|
1501
|
+
}
|
|
1502
|
+
if (t === Rn) {
|
|
1503
|
+
let { getLmsFlows: e } = await import("./index.js").then((e) => e.t), t = await e({
|
|
1504
|
+
limit: r,
|
|
1505
|
+
offset: i
|
|
1506
|
+
}), n = Array.isArray(t?.items) ? t.items : [], a = Number(t?.total) || 0;
|
|
1507
|
+
return {
|
|
1508
|
+
items: n,
|
|
1509
|
+
total: a,
|
|
1510
|
+
limit: r,
|
|
1511
|
+
offset: i,
|
|
1512
|
+
tabs: [{
|
|
1513
|
+
key: "all",
|
|
1514
|
+
title: "LMS Cases",
|
|
1515
|
+
count: a
|
|
1516
|
+
}]
|
|
1517
|
+
};
|
|
1518
|
+
}
|
|
1519
|
+
let u = new URLSearchParams({
|
|
1520
|
+
module: I(t),
|
|
1521
|
+
limit: String(r),
|
|
1522
|
+
offset: String(i)
|
|
1523
|
+
}), d = String(o ?? "").trim();
|
|
1524
|
+
return d && u.set("scope", d), s && u.set("sort", s), c && u.set("sortDir", c), Array.isArray(l) && l.some((e) => e?.field) && u.set("filters", JSON.stringify(l)), n(e, `/module-data-list?${u.toString()}`);
|
|
1525
|
+
}
|
|
1526
|
+
async function Gn(t, r) {
|
|
1527
|
+
if (!t || !r) return null;
|
|
1528
|
+
try {
|
|
1529
|
+
let i = await n(e, `/module/list?module=${encodeURIComponent(t)}&id=${encodeURIComponent(r)}`), a = i?.data?.data ?? i?.data ?? i, o = Array.isArray(a) ? a[0] : a;
|
|
1530
|
+
return o && typeof o == "object" ? o : null;
|
|
1531
|
+
} catch {
|
|
1532
|
+
return null;
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
async function Kn(t, r = {}, i = {}, a = {}) {
|
|
1536
|
+
let { limit: o = 10, offset: s = 0 } = i, { sort: c = "", sortDir: l = "", scope: u = "", filters: d = [] } = a, f = zn(u || String(r.selectedSource ?? "").split(",")), p = new URLSearchParams();
|
|
1537
|
+
p.append("module", I(t)), p.append("limit", String(o)), p.append("offset", String(s)), f && (p.set("scope", f), console.log("[searchModuleData] Adding scope to query:", f)), c && p.set("sort", c), l && p.set("sortDir", l), Array.isArray(d) && d.some((e) => e?.field) && p.set("filters", JSON.stringify(d)), console.log("[searchModuleData] Final query string:", p.toString()), Object.entries(r).forEach(([e, t]) => {
|
|
1538
|
+
if (t == null || t === "") return;
|
|
1539
|
+
let n = t;
|
|
1540
|
+
n = typeof t == "object" ? t.value ?? t.label ?? t.name ?? String(t) : String(t), p.append(e, n);
|
|
1541
|
+
});
|
|
1542
|
+
let m = await n(e, `/module-data-list?${p.toString()}`), h = m?.data ?? m, g = Array.isArray(h) ? h : h?.rows ?? h?.records ?? h?.items ?? h?.list ?? h?.data ?? [], _ = Vn(m, h, g, f), v = Hn(m, h);
|
|
1543
|
+
f && v[f] === void 0 && Number.isFinite(_) && (v[f] = _);
|
|
1544
|
+
let y = g.some((e) => [
|
|
1545
|
+
e?.sourceType,
|
|
1546
|
+
e?.profileSource,
|
|
1547
|
+
e?.selectedSource,
|
|
1548
|
+
e?.customFields?.sourceType,
|
|
1549
|
+
e?.customFields?.profileSource
|
|
1550
|
+
].flat().some((e) => String(e ?? "").trim().toLowerCase() === "dice") || !!e?.customFields?.diceProfileData), b = g;
|
|
1551
|
+
if (y) try {
|
|
1552
|
+
let { transformDiceResponseToInternalFormat: e } = await import("./diceCandidateMapper-DqBO4EhL.js").then((e) => e.t);
|
|
1553
|
+
b = e(m, m)?.data?.data ?? g;
|
|
1554
|
+
} catch (e) {
|
|
1555
|
+
console.error("[searchModuleData] Dice transformation failed:", e), b = g.map(Yn);
|
|
1556
|
+
}
|
|
1557
|
+
else b = Array.isArray(g) ? g.map(Yn) : [];
|
|
1558
|
+
return {
|
|
1559
|
+
rows: b,
|
|
1560
|
+
total: Number(_) || 0,
|
|
1561
|
+
counts: v,
|
|
1562
|
+
tabs: m?.tabs ?? m?.tabList ?? h?.tabs ?? h?.tabList ?? [],
|
|
1563
|
+
fields: m?.fields ?? m?.fieldConfig ?? h?.fields ?? h?.fieldConfig ?? [],
|
|
1564
|
+
tabField: m?.tabField ?? h?.tabField ?? "",
|
|
1565
|
+
actionRules: h?.actionRules ?? [],
|
|
1566
|
+
actions: h?.actions ?? [],
|
|
1567
|
+
columnActions: h?.columnActions ?? []
|
|
1568
|
+
};
|
|
1569
|
+
}
|
|
1570
|
+
function qn(e, t) {
|
|
1571
|
+
return String(t).split(".").reduce((e, t) => e?.[t], e);
|
|
1572
|
+
}
|
|
1573
|
+
function Jn(e, t, n) {
|
|
1574
|
+
let r = String(t).split(".").filter(Boolean);
|
|
1575
|
+
if (!r.length) return e;
|
|
1576
|
+
let i = { ...e }, a = i, o = e;
|
|
1577
|
+
return r.slice(0, -1).forEach((e) => {
|
|
1578
|
+
let t = o?.[e], n = t && typeof t == "object" && !Array.isArray(t) ? { ...t } : {};
|
|
1579
|
+
a[e] = n, a = n, o = t;
|
|
1580
|
+
}), a[r[r.length - 1]] = n, i;
|
|
1581
|
+
}
|
|
1582
|
+
function Yn(e) {
|
|
1583
|
+
if (!e || typeof e != "object") return e;
|
|
1584
|
+
let t = [
|
|
1585
|
+
"skills",
|
|
1586
|
+
"technicalSkills",
|
|
1587
|
+
"primarySkills",
|
|
1588
|
+
"keySkills",
|
|
1589
|
+
"customFields.diceProfileData.skills"
|
|
1590
|
+
], n = e, r = null;
|
|
1591
|
+
if (t.forEach((e) => {
|
|
1592
|
+
let t = qn(n, e);
|
|
1593
|
+
if (t == null) return;
|
|
1594
|
+
let i = a(t);
|
|
1595
|
+
i.length === 0 && Array.isArray(t) && t.length > 0 || (r ??= i, n = Jn(n, e, i));
|
|
1596
|
+
}), r && qn(n, "skills") === void 0 && (n = Jn(n, "skills", r)), [
|
|
1597
|
+
n?.sourceType,
|
|
1598
|
+
n?.profileSource,
|
|
1599
|
+
n?.selectedSource,
|
|
1600
|
+
n?.customFields?.sourceType,
|
|
1601
|
+
n?.customFields?.profileSource
|
|
1602
|
+
].flat().some((e) => String(e ?? "").trim().toLowerCase() === "dice") || n?.customFields?.diceProfileData) {
|
|
1603
|
+
let e = o(n), t = n?.candidateId ?? n?.customFields?.diceProfileData?.candidateId ?? "";
|
|
1604
|
+
n = {
|
|
1605
|
+
...n,
|
|
1606
|
+
id: n?.id ?? e,
|
|
1607
|
+
diceId: e,
|
|
1608
|
+
candidateId: t
|
|
1609
|
+
};
|
|
1610
|
+
}
|
|
1611
|
+
return n;
|
|
1612
|
+
}
|
|
1613
|
+
//#endregion
|
|
1614
|
+
//#region src/services/documentApi.js
|
|
1615
|
+
function Xn(e) {
|
|
1616
|
+
return String(e ?? "").replace(/^__mw__.*?__/, "").replace(/\[\d+\]$/, "").trim() || "file";
|
|
1617
|
+
}
|
|
1618
|
+
async function Zn(n, r, i = [], a = {}) {
|
|
1619
|
+
if (!n) throw Error("moduleName is required to upload documents");
|
|
1620
|
+
if (!r) throw Error("refId (created record id) is required to upload documents");
|
|
1621
|
+
if (!i.length) return {
|
|
1622
|
+
data: [],
|
|
1623
|
+
total: 0
|
|
1624
|
+
};
|
|
1625
|
+
let o = await t(), s = new FormData();
|
|
1626
|
+
i.forEach(({ formKey: e, file: t }) => {
|
|
1627
|
+
let n = t?.name ?? void 0;
|
|
1628
|
+
s.append(Xn(e), t, n);
|
|
1629
|
+
}), a && Object.keys(a).length > 0 && s.append("metadata", JSON.stringify(a));
|
|
1630
|
+
let c = new URLSearchParams({
|
|
1631
|
+
module: n,
|
|
1632
|
+
refId: String(r)
|
|
1633
|
+
}), l;
|
|
1634
|
+
try {
|
|
1635
|
+
l = await fetch(`${e}/documents/upload?${c.toString()}`, {
|
|
1636
|
+
method: "POST",
|
|
1637
|
+
headers: { Authorization: `Bearer ${o}` },
|
|
1638
|
+
body: s
|
|
1639
|
+
});
|
|
1640
|
+
} catch (e) {
|
|
1641
|
+
let t = /* @__PURE__ */ Error("Unable to connect to the server. Please check your network connection.");
|
|
1642
|
+
throw t.originalError = e, t;
|
|
1643
|
+
}
|
|
1644
|
+
let u = (l.headers.get("content-type") || "").includes("application/json") ? await l.json() : await l.text();
|
|
1645
|
+
if (!l.ok) {
|
|
1646
|
+
let e = (typeof u == "object" ? u?.error || u?.message : u) || `Server returned status ${l.status}`, t = Error(e);
|
|
1647
|
+
throw t.status = l.status, t.data = u, t;
|
|
1648
|
+
}
|
|
1649
|
+
return u?.data ?? u;
|
|
1650
|
+
}
|
|
1651
|
+
async function Qn(t, r, i = "") {
|
|
1652
|
+
if (!t) throw Error("moduleName is required to fetch documents");
|
|
1653
|
+
if (!r) throw Error("refId is required to fetch documents");
|
|
1654
|
+
let a = new URLSearchParams({
|
|
1655
|
+
module: t,
|
|
1656
|
+
refId: String(r)
|
|
1657
|
+
});
|
|
1658
|
+
i && a.set("fieldName", i);
|
|
1659
|
+
let o = await n(e, `/documents?${a.toString()}`), s = o?.data ?? o ?? {};
|
|
1660
|
+
return {
|
|
1661
|
+
data: Array.isArray(s?.data) ? s.data : Array.isArray(s) ? s : [],
|
|
1662
|
+
total: s?.total ?? 0
|
|
1663
|
+
};
|
|
1664
|
+
}
|
|
1665
|
+
async function $n(t) {
|
|
1666
|
+
if (!t) return !1;
|
|
1667
|
+
try {
|
|
1668
|
+
return await n(e, `/documents/${encodeURIComponent(String(t))}`, { method: "DELETE" }), !0;
|
|
1669
|
+
} catch {
|
|
1670
|
+
return !1;
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
function er() {
|
|
1674
|
+
let e = Math.floor(Date.now() / 1e3).toString(16).padStart(8, "0").slice(0, 8), t = /* @__PURE__ */ new Uint8Array(8);
|
|
1675
|
+
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") crypto.getRandomValues(t);
|
|
1676
|
+
else for (let e = 0; e < t.length; e += 1) t[e] = Math.floor(Math.random() * 256);
|
|
1677
|
+
return `${e}${Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("")}`;
|
|
1678
|
+
}
|
|
1679
|
+
function tr(e) {
|
|
1680
|
+
return (Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []).map((e) => String(e?.id ?? e?._id ?? "").trim()).filter(Boolean);
|
|
1681
|
+
}
|
|
1682
|
+
async function nr(e = []) {
|
|
1683
|
+
let t = Array.from(new Set((e || []).map((e) => String(e || "").trim()).filter(Boolean)));
|
|
1684
|
+
t.length !== 0 && await Promise.allSettled(t.map((e) => $n(e)));
|
|
1685
|
+
}
|
|
1686
|
+
//#endregion
|
|
1687
|
+
//#region src/components/form/inputSecurity.js
|
|
1688
|
+
var rr = [
|
|
1689
|
+
"p",
|
|
1690
|
+
"br",
|
|
1691
|
+
"strong",
|
|
1692
|
+
"b",
|
|
1693
|
+
"em",
|
|
1694
|
+
"i",
|
|
1695
|
+
"u",
|
|
1696
|
+
"s",
|
|
1697
|
+
"ul",
|
|
1698
|
+
"ol",
|
|
1699
|
+
"li",
|
|
1700
|
+
"blockquote",
|
|
1701
|
+
"h1",
|
|
1702
|
+
"h2",
|
|
1703
|
+
"h3",
|
|
1704
|
+
"h4",
|
|
1705
|
+
"h5",
|
|
1706
|
+
"h6",
|
|
1707
|
+
"a",
|
|
1708
|
+
"code",
|
|
1709
|
+
"pre"
|
|
1710
|
+
], ir = [
|
|
1711
|
+
"href",
|
|
1712
|
+
"title",
|
|
1713
|
+
"target",
|
|
1714
|
+
"rel"
|
|
1715
|
+
], ar = /[\u200B-\u200D\u2060\uFEFF]/g, or = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, sr = /^[\p{L}\p{M}\p{N} .'-]+$/u, cr = /^\+?[0-9 ()-]+$/, lr = /^-?(?:\d+|\d*\.\d+)$/, ur = [
|
|
1716
|
+
{
|
|
1717
|
+
re: /<\s*\/?\s*(?:script|iframe|object|embed|svg|img|form|input|style|link|meta|base|applet|frame|frameset)\b/i,
|
|
1718
|
+
message: "HTML/script content is not allowed"
|
|
1719
|
+
},
|
|
1720
|
+
{
|
|
1721
|
+
re: /\b(?:javascript|vbscript)\s*:|\bdata\s*:\s*text\/html/i,
|
|
1722
|
+
message: "Unsafe URL protocol is not allowed"
|
|
1723
|
+
},
|
|
1724
|
+
{
|
|
1725
|
+
re: /\bon[a-z]+\s*=/i,
|
|
1726
|
+
message: "HTML event handlers are not allowed"
|
|
1727
|
+
},
|
|
1728
|
+
{
|
|
1729
|
+
re: /["']?\$(?:where|gt|gte|lt|lte|ne|nin|regex|or|and|not|nor|expr|function|jsonSchema|accumulator)\b/i,
|
|
1730
|
+
message: "MongoDB operators are not allowed in input values"
|
|
1731
|
+
},
|
|
1732
|
+
{
|
|
1733
|
+
re: /(?:\.\.[/\\])|(?:%2e%2e|%5c)/i,
|
|
1734
|
+
message: "Path traversal is not allowed"
|
|
1735
|
+
},
|
|
1736
|
+
{
|
|
1737
|
+
re: /<\/?[a-zA-Z][a-zA-Z0-9]*(?:\s[^<>]*)?>/,
|
|
1738
|
+
message: "HTML tags are not allowed",
|
|
1739
|
+
plainOnly: !0
|
|
1740
|
+
}
|
|
1741
|
+
];
|
|
1742
|
+
function dr(e) {
|
|
1743
|
+
if (typeof document > "u") return e;
|
|
1744
|
+
let t = document.createElement("textarea");
|
|
1745
|
+
return t.innerHTML = e, t.value;
|
|
1746
|
+
}
|
|
1747
|
+
function fr(e) {
|
|
1748
|
+
let t = String(e ?? "");
|
|
1749
|
+
for (let e = 0; e < 2; e += 1) try {
|
|
1750
|
+
let e = decodeURIComponent(t);
|
|
1751
|
+
if (e === t) break;
|
|
1752
|
+
t = e;
|
|
1753
|
+
} catch {
|
|
1754
|
+
break;
|
|
1755
|
+
}
|
|
1756
|
+
return t = dr(t).replace(/\\x([0-9a-f]{2})/gi, (e, t) => String.fromCharCode(Number.parseInt(t, 16))).replace(/\\u([0-9a-f]{4})/gi, (e, t) => String.fromCharCode(Number.parseInt(t, 16))), t.normalize("NFC");
|
|
1757
|
+
}
|
|
1758
|
+
function pr(e) {
|
|
1759
|
+
return p.sanitize(String(e ?? ""), {
|
|
1760
|
+
ALLOWED_TAGS: rr,
|
|
1761
|
+
ALLOWED_ATTR: ir,
|
|
1762
|
+
ALLOW_DATA_ATTR: !1,
|
|
1763
|
+
FORBID_TAGS: [
|
|
1764
|
+
"script",
|
|
1765
|
+
"style",
|
|
1766
|
+
"iframe",
|
|
1767
|
+
"object",
|
|
1768
|
+
"embed",
|
|
1769
|
+
"svg",
|
|
1770
|
+
"img",
|
|
1771
|
+
"form",
|
|
1772
|
+
"input"
|
|
1773
|
+
],
|
|
1774
|
+
FORBID_ATTR: [
|
|
1775
|
+
"style",
|
|
1776
|
+
"src",
|
|
1777
|
+
"srcset"
|
|
1778
|
+
]
|
|
1779
|
+
});
|
|
1780
|
+
}
|
|
1781
|
+
function mr(e) {
|
|
1782
|
+
let t = (e.validations ?? []).find((e) => e?.type === "max"), n = Number(e.validator?.maxLength ?? t?.value ?? e.maxLength);
|
|
1783
|
+
return Number.isFinite(n) && n > 0 ? n : e.type === "email" || e.formatter === "email" ? 255 : e.formatter === "phone" || e.formatter === "digits" ? 32 : e.formatter === "name" ? 100 : e.type === "text-editor" ? 5e4 : (e.type, 5e3);
|
|
1784
|
+
}
|
|
1785
|
+
function hr(e) {
|
|
1786
|
+
return e.type === "textarea" || e.type === "text-editor";
|
|
1787
|
+
}
|
|
1788
|
+
function gr(e, t = {}) {
|
|
1789
|
+
if (typeof e != "string") return e;
|
|
1790
|
+
if (t.type === "text-editor") return pr(e.normalize("NFC"));
|
|
1791
|
+
let n = e.normalize("NFC").replace(ar, "").replace(/\u00A0/g, " ").replace(or, "");
|
|
1792
|
+
return n = hr(t) ? n.replace(/\r\n?/g, "\n").replace(/[ \t]{2,}/g, " ").trim() : n.replace(/\s+/g, " ").trim(), n;
|
|
1793
|
+
}
|
|
1794
|
+
function _r(e, t = {}) {
|
|
1795
|
+
if (typeof e != "string" || e === "") return null;
|
|
1796
|
+
let n = t.label || t.field || "Field", r = fr(e);
|
|
1797
|
+
if (r.includes("\0") || r.includes("\0")) return `${n} contains a null byte`;
|
|
1798
|
+
let i = t.type === "text-editor", a = ur.find(({ re: e, plainOnly: t }) => (!t || !i) && e.test(r));
|
|
1799
|
+
if (a) return `${n}: ${a.message}`;
|
|
1800
|
+
let o = gr(e, t);
|
|
1801
|
+
return [...o].length > mr(t) ? `${n} is too long` : t.formatter === "name" && o && !sr.test(o) ? `${n} allows only letters, numbers, spaces, apostrophes, hyphens and periods` : (t.formatter === "phone" || t.formatter === "digits") && o && !cr.test(o) ? `${n} contains invalid phone characters` : t.type === "number" && o && !lr.test(o) ? `${n} must contain only a valid number` : (t.type === "url" || t.formatter === "url") && o && !/^https?:\/\//i.test(o) ? `${n} must use http:// or https://` : null;
|
|
1802
|
+
}
|
|
1803
|
+
function vr(e) {
|
|
1804
|
+
return { validator: (t, n) => {
|
|
1805
|
+
let r = (Array.isArray(n) ? n : [n]).map((t) => _r(t, e)).find(Boolean);
|
|
1806
|
+
return r ? Promise.reject(Error(r)) : Promise.resolve();
|
|
1807
|
+
} };
|
|
1808
|
+
}
|
|
1809
|
+
function yr(e = []) {
|
|
1810
|
+
let t = /* @__PURE__ */ new Map();
|
|
1811
|
+
return e.forEach((e) => {
|
|
1812
|
+
(e.fields ?? []).forEach((n) => {
|
|
1813
|
+
if (n.type === "file") return;
|
|
1814
|
+
let r = n.payloadKey || n.field;
|
|
1815
|
+
if (!r) return;
|
|
1816
|
+
let i = e.addRow ? `${e.payloadKey || e.name}[].${r}` : r;
|
|
1817
|
+
t.set(i, n);
|
|
1818
|
+
});
|
|
1819
|
+
}), t;
|
|
1820
|
+
}
|
|
1821
|
+
function br(e, t = []) {
|
|
1822
|
+
let n = yr(t), r = (e, t = "") => {
|
|
1823
|
+
if (typeof e == "string") {
|
|
1824
|
+
let r = n.get(t) ?? {}, i = _r(e, r);
|
|
1825
|
+
if (i) throw Error(i);
|
|
1826
|
+
return gr(e, r);
|
|
1827
|
+
}
|
|
1828
|
+
return Array.isArray(e) ? e.map((e) => r(e, `${t}[]`)) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, n]) => {
|
|
1829
|
+
if (e.startsWith("$") || e.includes(".") || e.includes("\0")) throw Error(`Unsafe object key: ${e}`);
|
|
1830
|
+
let i = t ? `${t}.${e}` : e;
|
|
1831
|
+
return [e, r(n, i)];
|
|
1832
|
+
})) : e;
|
|
1833
|
+
};
|
|
1834
|
+
return r(e);
|
|
1835
|
+
}
|
|
1836
|
+
//#endregion
|
|
1837
|
+
//#region src/components/form/validationOverride.js
|
|
1838
|
+
var xr = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
1839
|
+
function L(e) {
|
|
1840
|
+
let t = e?.overrideCheckbox;
|
|
1841
|
+
return !t || typeof t != "object" ? null : Cr(e).size > 0 ? t : null;
|
|
1842
|
+
}
|
|
1843
|
+
function Sr(e) {
|
|
1844
|
+
return String(e?.overrideCheckbox?.field ?? "").trim() || `${String(e?.field ?? "").replace(/\./g, "_")}__override`;
|
|
1845
|
+
}
|
|
1846
|
+
function Cr(e) {
|
|
1847
|
+
let t = e?.overrideCheckbox?.skipValidations, n = Array.isArray(t) ? t : String(t ?? "").split(",");
|
|
1848
|
+
return new Set(n.map((e) => String(e ?? "").trim()).filter(Boolean));
|
|
1849
|
+
}
|
|
1850
|
+
function wr(e) {
|
|
1851
|
+
return e?.overrideCheckbox?.store !== !1;
|
|
1852
|
+
}
|
|
1853
|
+
function Tr(e, t, n) {
|
|
1854
|
+
let r = Sr(e);
|
|
1855
|
+
if (typeof n == "function") {
|
|
1856
|
+
let e = n(r);
|
|
1857
|
+
if (Array.isArray(e) && e.length) return [...e, r];
|
|
1858
|
+
}
|
|
1859
|
+
return Array.isArray(t) && t.length >= 3 && typeof t[1] == "number" ? [
|
|
1860
|
+
t[0],
|
|
1861
|
+
t[1],
|
|
1862
|
+
r
|
|
1863
|
+
] : [r];
|
|
1864
|
+
}
|
|
1865
|
+
function Er(e, t) {
|
|
1866
|
+
return (n) => {
|
|
1867
|
+
let r = !1;
|
|
1868
|
+
try {
|
|
1869
|
+
r = xr(n?.getFieldValue?.(t));
|
|
1870
|
+
} catch {
|
|
1871
|
+
r = !1;
|
|
1872
|
+
}
|
|
1873
|
+
return r ? {} : e;
|
|
1874
|
+
};
|
|
1875
|
+
}
|
|
1876
|
+
function Dr(e, t, n, r) {
|
|
1877
|
+
if (!L(e)) return r;
|
|
1878
|
+
let i = Cr(e), a = Tr(e, t, n);
|
|
1879
|
+
return (e) => {
|
|
1880
|
+
let t = r(e), n = typeof e == "string" ? e : e?.type;
|
|
1881
|
+
return i.has(n) ? Er(t, a) : t;
|
|
1882
|
+
};
|
|
1883
|
+
}
|
|
1884
|
+
function Or(e) {
|
|
1885
|
+
let t = L(e) ?? {}, n = e?.label ?? e?.field ?? "this field";
|
|
1886
|
+
return {
|
|
1887
|
+
tone: t.tone ?? "overwrite",
|
|
1888
|
+
title: t.confirmTitle || "Remove the validation on this field?",
|
|
1889
|
+
body: t.confirmBody || `The check that keeps ${n} within its allowed limit will be turned off for this record, and a value above that limit will be accepted. The override is recorded against the record. Do you want to continue?`,
|
|
1890
|
+
okText: t.confirmOkText || "Yes, remove the limit",
|
|
1891
|
+
cancelText: t.confirmCancelText || "Keep the limit"
|
|
1892
|
+
};
|
|
1893
|
+
}
|
|
1894
|
+
//#endregion
|
|
1895
|
+
//#region src/components/form/optionMatching.js
|
|
1896
|
+
function R(e) {
|
|
1897
|
+
return String(e ?? "").normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
1898
|
+
}
|
|
1899
|
+
function kr(e) {
|
|
1900
|
+
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
1901
|
+
let r = R(e);
|
|
1902
|
+
r && !t.has(r) && t.set(r, n);
|
|
1903
|
+
};
|
|
1904
|
+
return (Array.isArray(e?.options) ? e.options : []).forEach((e) => {
|
|
1905
|
+
if (e == null) return;
|
|
1906
|
+
let t = typeof e == "object" ? e.value : e;
|
|
1907
|
+
t != null && t !== "" && (n(t, t), typeof e == "object" && e.label !== void 0 && n(e.label, t));
|
|
1908
|
+
}), Object.entries(e?.optionAliases ?? {}).forEach(([e, r]) => {
|
|
1909
|
+
let i = t.get(R(r));
|
|
1910
|
+
i !== void 0 && n(e, i);
|
|
1911
|
+
}), t;
|
|
1912
|
+
}
|
|
1913
|
+
var Ar = (e) => Array.isArray(e?.options) && e.options.length > 0;
|
|
1914
|
+
function jr(e, t) {
|
|
1915
|
+
if (t == null || t === "" || typeof t == "object") return t;
|
|
1916
|
+
let n = e.get(R(t));
|
|
1917
|
+
return n === void 0 ? t : n;
|
|
1918
|
+
}
|
|
1919
|
+
function Mr(e, t) {
|
|
1920
|
+
if (!Ar(e)) return t;
|
|
1921
|
+
let n = kr(e);
|
|
1922
|
+
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) => jr(n, e)) : jr(n, t);
|
|
1923
|
+
}
|
|
1924
|
+
//#endregion
|
|
1925
|
+
//#region src/components/form/mountDefaultValue.js
|
|
1926
|
+
function Nr(e = {}) {
|
|
1927
|
+
let t = e?.defaultValue;
|
|
1928
|
+
if (t === void 0 || t === "") return;
|
|
1929
|
+
if (e?.type === "time") return Ir(t);
|
|
1930
|
+
if (e?.type === "date") return zr(t);
|
|
1931
|
+
if (e?.type !== "checkbox") return t;
|
|
1932
|
+
let n = Array.isArray(e.options) ? e.options : [];
|
|
1933
|
+
if (!n.length) return t;
|
|
1934
|
+
let r = n.map((e) => String(e && typeof e == "object" ? e.value : e));
|
|
1935
|
+
return (Array.isArray(t) ? t : [t]).some((e) => r.includes(String(e))) ? t : void 0;
|
|
1936
|
+
}
|
|
1937
|
+
var Pr = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*([ap]\.?\s?m\.?)?$/i, Fr = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;
|
|
1938
|
+
function Ir(e) {
|
|
1939
|
+
if (e == null || e === "") return;
|
|
1940
|
+
if (l.isDayjs(e)) return e.isValid() ? e : void 0;
|
|
1941
|
+
if (typeof e != "string") return;
|
|
1942
|
+
let t = e.trim(), n = t.match(Pr);
|
|
1943
|
+
if (n) {
|
|
1944
|
+
let e = Number(n[1]), t = Number(n[2]), r = Number(n[3] ?? 0), i = n[4]?.replace(/[.\s]/g, "").toLowerCase();
|
|
1945
|
+
if (i) {
|
|
1946
|
+
if (e < 1 || e > 12) return;
|
|
1947
|
+
e = e % 12 + (i === "pm" ? 12 : 0);
|
|
1948
|
+
}
|
|
1949
|
+
return e > 23 || t > 59 || r > 59 ? void 0 : l().hour(e).minute(t).second(r).millisecond(0);
|
|
1950
|
+
}
|
|
1951
|
+
if (Fr.test(t)) {
|
|
1952
|
+
let e = l(t);
|
|
1953
|
+
return e.isValid() ? e : void 0;
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1956
|
+
var Lr = /^today\s*(?:([+-])\s*(\d{1,4}))?$/i, Rr = /^\d{4}-\d{2}-\d{2}(?:[T ].*)?$/;
|
|
1957
|
+
function zr(e, t = l()) {
|
|
1958
|
+
if (e == null || e === "") return;
|
|
1959
|
+
if (l.isDayjs(e)) return e.isValid() ? e : void 0;
|
|
1960
|
+
if (e instanceof Date) {
|
|
1961
|
+
let t = l(e);
|
|
1962
|
+
return t.isValid() ? t : void 0;
|
|
1963
|
+
}
|
|
1964
|
+
if (typeof e != "string") return;
|
|
1965
|
+
let n = e.trim(), r = n.match(Lr);
|
|
1966
|
+
if (r) {
|
|
1967
|
+
let e = r[2] ? Number(r[2]) * (r[1] === "-" ? -1 : 1) : 0;
|
|
1968
|
+
return l(t).startOf("day").add(e, "day");
|
|
1969
|
+
}
|
|
1970
|
+
if (Rr.test(n)) {
|
|
1971
|
+
let e = l(n);
|
|
1972
|
+
return e.isValid() ? e : void 0;
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
//#endregion
|
|
1976
|
+
//#region src/components/form/csvTags.js
|
|
1977
|
+
var Br = "csvTags", Vr = (e) => e.toLowerCase();
|
|
1978
|
+
function Hr(e) {
|
|
1979
|
+
let t = Array.isArray(e) ? e : [e], n = [], r = /* @__PURE__ */ new Set();
|
|
1980
|
+
return t.forEach((e) => {
|
|
1981
|
+
e != null && typeof e != "object" && String(e).split(",").forEach((e) => {
|
|
1982
|
+
let t = e.trim().replace(/\s+/g, " ");
|
|
1983
|
+
!t || r.has(Vr(t)) || (r.add(Vr(t)), n.push(t));
|
|
1984
|
+
});
|
|
1985
|
+
}), n;
|
|
1986
|
+
}
|
|
1987
|
+
function Ur(e, t = ", ") {
|
|
1988
|
+
return Hr(e).join(t || ", ");
|
|
1989
|
+
}
|
|
1990
|
+
//#endregion
|
|
1991
|
+
//#region src/components/form/payloadTransformer.js
|
|
1992
|
+
var z = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0, Wr = (e) => e === !0 || e === 1 || e === "1", B = (e) => typeof e == "object" && !!e && !Array.isArray(e) && !V(e);
|
|
1993
|
+
function V(e) {
|
|
1994
|
+
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
1995
|
+
}
|
|
1996
|
+
function Gr(e) {
|
|
1997
|
+
return V(e) || e instanceof Date;
|
|
1998
|
+
}
|
|
1999
|
+
function Kr(e) {
|
|
2000
|
+
return e instanceof Date ? e.toISOString() : V(e) ? e.isValid() ? e.toISOString() : null : e;
|
|
2001
|
+
}
|
|
2002
|
+
function qr(e, t) {
|
|
2003
|
+
if (!kn(t)) return Kr(e);
|
|
2004
|
+
let n = An(e);
|
|
2005
|
+
return n ? n.toISOString() : Kr(e);
|
|
2006
|
+
}
|
|
2007
|
+
function H(e, t) {
|
|
2008
|
+
if (!t) return;
|
|
2009
|
+
let n = String(t).split("."), r = e;
|
|
2010
|
+
for (let e of n) {
|
|
2011
|
+
if (r == null) return;
|
|
2012
|
+
r = r[e];
|
|
2013
|
+
}
|
|
2014
|
+
return r;
|
|
2015
|
+
}
|
|
2016
|
+
function U(e, t) {
|
|
2017
|
+
return e && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : H(e, t);
|
|
2018
|
+
}
|
|
2019
|
+
function W(e, t) {
|
|
2020
|
+
return e && Object.prototype.hasOwnProperty.call(e, t) ? !0 : H(e, t) !== void 0;
|
|
2021
|
+
}
|
|
2022
|
+
function G(e, t, n) {
|
|
2023
|
+
let r = String(t).split("."), i = e;
|
|
2024
|
+
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2025
|
+
let t = r[e];
|
|
2026
|
+
B(i[t]) || (i[t] = {}), i = i[t];
|
|
2027
|
+
}
|
|
2028
|
+
return i[r[r.length - 1]] = n, e;
|
|
2029
|
+
}
|
|
2030
|
+
function Jr(e, t, n) {
|
|
2031
|
+
let r = String(t).split("."), i = e;
|
|
2032
|
+
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2033
|
+
let t = r[e];
|
|
2034
|
+
B(i[t]) || (i[t] = {}), i = i[t];
|
|
2035
|
+
}
|
|
2036
|
+
let a = r[r.length - 1];
|
|
2037
|
+
return i[a] = B(i[a]) && B(n) ? {
|
|
2038
|
+
...n,
|
|
2039
|
+
...i[a]
|
|
2040
|
+
} : n, e;
|
|
2041
|
+
}
|
|
2042
|
+
function Yr(e) {
|
|
2043
|
+
let t = Array.isArray(e) ? e : e == null ? [] : [e];
|
|
2044
|
+
if (!t.length || t.some((e) => e?.originFileObj)) return;
|
|
2045
|
+
let n = t.map((e) => e?.stored).filter((e) => e != null);
|
|
2046
|
+
if (n.length) return n.length === 1 && t.length === 1 ? n[0] : n;
|
|
2047
|
+
}
|
|
2048
|
+
function Xr(e, t) {
|
|
2049
|
+
return Object.entries(t ?? {}).forEach(([t, n]) => {
|
|
2050
|
+
B(n) && B(e[t]) ? Xr(e[t], n) : e[t] = n;
|
|
2051
|
+
}), e;
|
|
2052
|
+
}
|
|
2053
|
+
function Zr(e, t) {
|
|
2054
|
+
let n = e.options ?? e.values ?? [];
|
|
2055
|
+
for (let e of n) if (typeof e == "string") {
|
|
2056
|
+
if (e === t) return e;
|
|
2057
|
+
} else if ((e.value ?? e.id ?? e.name ?? e.label) === t) return e.label ?? e.name ?? e.value;
|
|
2058
|
+
}
|
|
2059
|
+
function Qr(e, t) {
|
|
2060
|
+
if (B(e)) {
|
|
2061
|
+
let n = (t.valueKey && e[t.valueKey]) ?? e.value ?? e.id ?? e._id ?? e.key ?? e.code;
|
|
2062
|
+
return {
|
|
2063
|
+
value: n,
|
|
2064
|
+
label: (t.displayKey && e[t.displayKey]) ?? e.label ?? e.name ?? e.text ?? e.title ?? n
|
|
2065
|
+
};
|
|
2066
|
+
}
|
|
2067
|
+
return {
|
|
2068
|
+
value: e,
|
|
2069
|
+
label: Zr(t, e) ?? e
|
|
2070
|
+
};
|
|
2071
|
+
}
|
|
2072
|
+
function K(e = {}) {
|
|
2073
|
+
if (e.dataType && e.dataType !== "auto") return e.dataType;
|
|
2074
|
+
if (e.multiSelect || e.mode === "multiple" || e.addRow) return "array";
|
|
2075
|
+
if (e.type === "csvTags") return "csv";
|
|
2076
|
+
switch (e.type) {
|
|
2077
|
+
case "number": return "number";
|
|
2078
|
+
case "date":
|
|
2079
|
+
case "time": return "date";
|
|
2080
|
+
default: return "auto";
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
function q(e, t, n = {}) {
|
|
2084
|
+
if (Gr(e)) {
|
|
2085
|
+
if (t === "string") return qr(e, n);
|
|
2086
|
+
if (t === "number") {
|
|
2087
|
+
let t = V(e) ? e.valueOf() : e.getTime();
|
|
2088
|
+
return Number.isNaN(t) ? null : t;
|
|
2089
|
+
}
|
|
2090
|
+
if (t === "date" || t === "auto" || !t) return qr(e, n);
|
|
2091
|
+
}
|
|
2092
|
+
switch (t) {
|
|
2093
|
+
case "string": return e == null ? "" : String(e);
|
|
2094
|
+
case "csv": return Ur(e, n.csvSeparator);
|
|
2095
|
+
case "number": {
|
|
2096
|
+
if (z(e)) return null;
|
|
2097
|
+
let t = Number(e);
|
|
2098
|
+
return Number.isNaN(t) ? null : t;
|
|
2099
|
+
}
|
|
2100
|
+
case "boolean": return e === !0 || e === 1 || e === "1" || e === "true";
|
|
2101
|
+
case "array": {
|
|
2102
|
+
let t;
|
|
2103
|
+
return t = Array.isArray(e) ? e : z(e) ? [] : typeof e == "string" && e.includes(",") ? e.split(",").map((e) => e.trim()).filter(Boolean) : [e], n.elementType ? t.map((e) => q(e, n.elementType, {})).filter((e) => e != null && e !== "") : t;
|
|
2104
|
+
}
|
|
2105
|
+
case "object": return B(e), e;
|
|
2106
|
+
case "date": return qr(e, n);
|
|
2107
|
+
case "custom":
|
|
2108
|
+
case "auto":
|
|
2109
|
+
case void 0:
|
|
2110
|
+
default: return e;
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
var J = {
|
|
2114
|
+
firstChecked: (e) => Array.isArray(e) ? e[0] : e,
|
|
2115
|
+
csvToArray: (e) => typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : e,
|
|
2116
|
+
arrayToCsv: (e) => Array.isArray(e) ? e.join(",") : e,
|
|
2117
|
+
trim: (e) => typeof e == "string" ? e.trim() : e,
|
|
2118
|
+
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
2119
|
+
lower: (e) => typeof e == "string" ? e.toLowerCase() : e
|
|
2120
|
+
};
|
|
2121
|
+
function $r(e, t) {
|
|
2122
|
+
if (!t) return e;
|
|
2123
|
+
let n = t;
|
|
2124
|
+
if (typeof n == "string") {
|
|
2125
|
+
if (J[n]) return J[n](e);
|
|
2126
|
+
try {
|
|
2127
|
+
n = JSON.parse(n);
|
|
2128
|
+
} catch {
|
|
2129
|
+
return e;
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
let r = e;
|
|
2133
|
+
if (n.name && J[n.name] && (r = J[n.name](r)), n.map && typeof n.map == "object") {
|
|
2134
|
+
let e = String(Array.isArray(r) ? r[0] : r);
|
|
2135
|
+
Object.prototype.hasOwnProperty.call(n.map, e) ? r = n.map[e] : n.default !== void 0 && (r = n.default);
|
|
2136
|
+
}
|
|
2137
|
+
return r;
|
|
2138
|
+
}
|
|
2139
|
+
var ei = /\{\{\s*([\w.]+)\s*\}\}/g;
|
|
2140
|
+
function ti(e, t) {
|
|
2141
|
+
let [n, ...r] = e.split("."), i;
|
|
2142
|
+
if (n === "value") i = t.value;
|
|
2143
|
+
else if (n === "label") i = t.label;
|
|
2144
|
+
else if (n === "raw") i = t.raw;
|
|
2145
|
+
else return;
|
|
2146
|
+
return r.length ? H(i, r.join(".")) : i;
|
|
2147
|
+
}
|
|
2148
|
+
function ni(e, t) {
|
|
2149
|
+
if (typeof e == "string") {
|
|
2150
|
+
let n = e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);
|
|
2151
|
+
return n ? ti(n[1], t) : e.replace(ei, (e, n) => {
|
|
2152
|
+
let r = ti(n, t);
|
|
2153
|
+
return r == null ? "" : String(r);
|
|
2154
|
+
});
|
|
2155
|
+
}
|
|
2156
|
+
if (Array.isArray(e)) return e.map((e) => ni(e, t));
|
|
2157
|
+
if (B(e)) {
|
|
2158
|
+
let n = {};
|
|
2159
|
+
return Object.entries(e).forEach(([e, r]) => {
|
|
2160
|
+
n[e] = ni(r, t);
|
|
2161
|
+
}), n;
|
|
2162
|
+
}
|
|
2163
|
+
return e;
|
|
2164
|
+
}
|
|
2165
|
+
function ri(e) {
|
|
2166
|
+
if (!e) return null;
|
|
2167
|
+
if (typeof e == "string") try {
|
|
2168
|
+
return JSON.parse(e);
|
|
2169
|
+
} catch {
|
|
2170
|
+
return null;
|
|
2171
|
+
}
|
|
2172
|
+
return e;
|
|
2173
|
+
}
|
|
2174
|
+
function ii(e, t) {
|
|
2175
|
+
let n = e.payloadMode || "auto", r = K(e), { value: i, label: a } = Qr(t, e);
|
|
2176
|
+
switch (n) {
|
|
2177
|
+
case "value": return {
|
|
2178
|
+
kind: "scalar",
|
|
2179
|
+
out: q(i, r, e)
|
|
2180
|
+
};
|
|
2181
|
+
case "label": return {
|
|
2182
|
+
kind: "scalar",
|
|
2183
|
+
out: q(a, e.dataType || "string", e)
|
|
2184
|
+
};
|
|
2185
|
+
case "object": {
|
|
2186
|
+
let t = e.valueKey || "id", n = e.displayKey || "name";
|
|
2187
|
+
return {
|
|
2188
|
+
kind: "scalar",
|
|
2189
|
+
out: {
|
|
2190
|
+
[t]: q(i, e.elementType || "auto", {}),
|
|
2191
|
+
[n]: a
|
|
2192
|
+
}
|
|
2193
|
+
};
|
|
2194
|
+
}
|
|
2195
|
+
case "custom":
|
|
2196
|
+
case "template": {
|
|
2197
|
+
let n = ri(e.payloadTemplate);
|
|
2198
|
+
if (!n) return {
|
|
2199
|
+
kind: "scalar",
|
|
2200
|
+
out: q(i, r, e)
|
|
2201
|
+
};
|
|
2202
|
+
let o = ni(n, {
|
|
2203
|
+
value: q(i, e.elementType || "auto", {}),
|
|
2204
|
+
label: a,
|
|
2205
|
+
raw: t
|
|
2206
|
+
});
|
|
2207
|
+
return {
|
|
2208
|
+
kind: e.payloadKey ? "scalar" : "spread",
|
|
2209
|
+
out: o
|
|
2210
|
+
};
|
|
2211
|
+
}
|
|
2212
|
+
default: return {
|
|
2213
|
+
kind: "scalar",
|
|
2214
|
+
out: q(i, r, e)
|
|
2215
|
+
};
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
function ai(e = {}) {
|
|
2219
|
+
let t = e.defaultValue;
|
|
2220
|
+
if (t !== void 0 && t !== "") return e.type === "time" ? Ir(t) : e.type === "date" ? zr(t) : t;
|
|
2221
|
+
}
|
|
2222
|
+
function oi(e, t) {
|
|
2223
|
+
if (e.payloadMode === "skip") return { kind: "skip" };
|
|
2224
|
+
let n = t;
|
|
2225
|
+
if (z(n)) {
|
|
2226
|
+
let t = ai(e);
|
|
2227
|
+
t !== void 0 && (n = t);
|
|
2228
|
+
}
|
|
2229
|
+
return n = $r(n, e.transformRule), z(n) && e.omitEmpty ? { kind: "skip" } : Array.isArray(n) && (K(e) === "array" || e.payloadMode === "object") && e.payloadMode && e.payloadMode !== "value" && e.payloadMode !== "auto" ? {
|
|
2230
|
+
kind: "scalar",
|
|
2231
|
+
out: n.map((t) => ii(e, t).out)
|
|
2232
|
+
} : ii(e, n);
|
|
2233
|
+
}
|
|
2234
|
+
function si(e = {}) {
|
|
2235
|
+
return !!e.richValue || [
|
|
2236
|
+
"label",
|
|
2237
|
+
"object",
|
|
2238
|
+
"custom",
|
|
2239
|
+
"template"
|
|
2240
|
+
].includes(e.payloadMode);
|
|
2241
|
+
}
|
|
2242
|
+
function ci(e, t, n = []) {
|
|
2243
|
+
if (!si(e) || t == null) return t;
|
|
2244
|
+
let r = (e) => {
|
|
2245
|
+
if (B(e) && e.value !== void 0) return e;
|
|
2246
|
+
let t = n.find((t) => String(t?.value ?? "") === String(e) || String(t?.label ?? "") === String(e));
|
|
2247
|
+
return {
|
|
2248
|
+
value: t?.value ?? e,
|
|
2249
|
+
label: t?.label ?? String(e)
|
|
2250
|
+
};
|
|
2251
|
+
};
|
|
2252
|
+
return Array.isArray(t) ? t.map(r) : r(t);
|
|
2253
|
+
}
|
|
2254
|
+
function li(e, t, n) {
|
|
2255
|
+
if (!e?.field) return !0;
|
|
2256
|
+
let r = W(t, e.field) ? U(t, e.field) : U(n ?? t, e.field), i = () => String(e.value ?? "").split(",").map((e) => e.trim());
|
|
2257
|
+
switch (e.operator) {
|
|
2258
|
+
case "eq": return String(r ?? "") === String(e.value ?? "");
|
|
2259
|
+
case "neq": return String(r ?? "") !== String(e.value ?? "");
|
|
2260
|
+
case "truthy": return r != null && r !== "" && r !== !1;
|
|
2261
|
+
case "falsy": return r == null || r === "" || r === !1;
|
|
2262
|
+
case "notEmpty": return Array.isArray(r) ? r.length > 0 : !!r;
|
|
2263
|
+
case "in": return i().includes(String(r ?? ""));
|
|
2264
|
+
case "notIn": return !i().includes(String(r ?? ""));
|
|
2265
|
+
default: return !0;
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
function ui(e) {
|
|
2269
|
+
let t = [];
|
|
2270
|
+
return e?.field && t.push(e.field), Array.isArray(e?.conditions) && e.conditions.forEach((e) => {
|
|
2271
|
+
e?.field && t.push(e.field);
|
|
2272
|
+
}), t;
|
|
2273
|
+
}
|
|
2274
|
+
function di(e, t, n) {
|
|
2275
|
+
if (!e) return !0;
|
|
2276
|
+
let r = Array.isArray(e.conditions) ? e.conditions.filter((e) => e?.field) : [];
|
|
2277
|
+
if (r.length) {
|
|
2278
|
+
let i = r.map((e) => li(e, t, n)), a = String(e.logic ?? "and").toLowerCase() === "or", o = a ? i.some(Boolean) : i.every(Boolean);
|
|
2279
|
+
if (e.field) {
|
|
2280
|
+
let r = li(e, t, n);
|
|
2281
|
+
o = a ? o || r : o && r;
|
|
2282
|
+
}
|
|
2283
|
+
return o;
|
|
2284
|
+
}
|
|
2285
|
+
return li(e, t, n);
|
|
2286
|
+
}
|
|
2287
|
+
function fi(e, t, n, r, i = /* @__PURE__ */ new Set()) {
|
|
2288
|
+
let a = ui(e?.showIf);
|
|
2289
|
+
return !a.length || i.has(e.field) ? !0 : (i.add(e.field), di(e.showIf, t, n) ? a.every((e) => {
|
|
2290
|
+
let a = r?.get?.(e);
|
|
2291
|
+
return !a || fi(a, t, n, r, i);
|
|
2292
|
+
}) : !1);
|
|
2293
|
+
}
|
|
2294
|
+
function pi(e = []) {
|
|
2295
|
+
let t = /* @__PURE__ */ new Map();
|
|
2296
|
+
return e.forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
2297
|
+
e?.field && !t.has(e.field) && t.set(e.field, e);
|
|
2298
|
+
})), t;
|
|
2299
|
+
}
|
|
2300
|
+
function mi(e = {}, { editing: t = !1 } = {}) {
|
|
2301
|
+
let n = {};
|
|
2302
|
+
return (e.fields ?? []).forEach((e) => {
|
|
2303
|
+
if (!(!e.field || Y(e)) && !(t && !e.defaultOnEdit) && e.defaultValue !== void 0 && e.defaultValue !== "") {
|
|
2304
|
+
if (e.type === "time") {
|
|
2305
|
+
let t = Ir(e.defaultValue);
|
|
2306
|
+
t !== void 0 && (n[e.field] = t);
|
|
2307
|
+
return;
|
|
2308
|
+
}
|
|
2309
|
+
if (e.type === "date") {
|
|
2310
|
+
let t = zr(e.defaultValue);
|
|
2311
|
+
t !== void 0 && (n[e.field] = t);
|
|
2312
|
+
return;
|
|
2313
|
+
}
|
|
2314
|
+
n[e.field] = e.defaultValue;
|
|
2315
|
+
}
|
|
2316
|
+
}), n;
|
|
2317
|
+
}
|
|
2318
|
+
function hi(e = []) {
|
|
2319
|
+
let t = [];
|
|
2320
|
+
return e.forEach((e) => {
|
|
2321
|
+
(e.fields ?? []).forEach((n) => {
|
|
2322
|
+
t.push({
|
|
2323
|
+
field: n,
|
|
2324
|
+
group: e
|
|
2325
|
+
});
|
|
2326
|
+
});
|
|
2327
|
+
}), t;
|
|
2328
|
+
}
|
|
2329
|
+
var gi = [
|
|
2330
|
+
"file",
|
|
2331
|
+
"document",
|
|
2332
|
+
"image",
|
|
2333
|
+
"upload",
|
|
2334
|
+
"attachment"
|
|
2335
|
+
];
|
|
2336
|
+
function Y(e) {
|
|
2337
|
+
return gi.includes(String(e?.type ?? "").trim().toLowerCase());
|
|
2338
|
+
}
|
|
2339
|
+
function _i(e = []) {
|
|
2340
|
+
return hi(e).map(({ field: e }) => e).filter(Y);
|
|
2341
|
+
}
|
|
2342
|
+
function vi(e) {
|
|
2343
|
+
return String(e ?? "").trim().toLowerCase();
|
|
2344
|
+
}
|
|
2345
|
+
function yi(e, t) {
|
|
2346
|
+
return !!t && vi(e.moduleName) === t;
|
|
2347
|
+
}
|
|
2348
|
+
function bi(e, t = [], n = {}) {
|
|
2349
|
+
let r = [], i = n.scope ?? "all", a = vi(n.module), o = (e, t) => {
|
|
2350
|
+
t != null && (Array.isArray(t) ? t : [t]).forEach((t) => {
|
|
2351
|
+
let n = t?.originFileObj || t;
|
|
2352
|
+
(typeof File < "u" && n instanceof File || typeof Blob < "u" && n instanceof Blob) && r.push({
|
|
2353
|
+
formKey: e,
|
|
2354
|
+
file: n
|
|
2355
|
+
});
|
|
2356
|
+
});
|
|
2357
|
+
};
|
|
2358
|
+
return (t ?? []).forEach((t) => {
|
|
2359
|
+
let r = (t.fields ?? []).filter(Y);
|
|
2360
|
+
if (!r.length) return;
|
|
2361
|
+
let s = t.moduleName && !yi(t, a), c = (e) => s ? `__mw__${t.moduleName}__${e}` : e;
|
|
2362
|
+
if (t.addRow) {
|
|
2363
|
+
if (i === "flat") return;
|
|
2364
|
+
let a = e[t.name];
|
|
2365
|
+
if (!Array.isArray(a)) return;
|
|
2366
|
+
r.forEach((e) => {
|
|
2367
|
+
let t = e.fileKey ?? String(e.field).split(".")[0];
|
|
2368
|
+
a.forEach((r, i) => {
|
|
2369
|
+
let a = c(n.indexed ? `${t}[${i}]` : t);
|
|
2370
|
+
o(a, U(r, e.field));
|
|
2371
|
+
});
|
|
2372
|
+
});
|
|
2373
|
+
return;
|
|
2374
|
+
}
|
|
2375
|
+
i !== "addRow" && r.forEach((t) => {
|
|
2376
|
+
let n = c(t.fileKey ?? String(t.field).split(".")[0]);
|
|
2377
|
+
o(n, U(e, t.field));
|
|
2378
|
+
});
|
|
2379
|
+
}), r;
|
|
2380
|
+
}
|
|
2381
|
+
function xi(e, t, n = {}) {
|
|
2382
|
+
let r = B(n.base) ? structuredClone(n.base) : {};
|
|
2383
|
+
_i(t).forEach((e) => {
|
|
2384
|
+
(e.payloadKey || e.field) && (wi(r, e.payloadKey || e.field), wi(r, e.field));
|
|
2385
|
+
});
|
|
2386
|
+
let i = vi(n.module), a = pi(t), o = /* @__PURE__ */ new Map(), s = (e) => !e.moduleName || yi(e, i) ? r : (o.has(e.moduleName) || o.set(e.moduleName, {}), o.get(e.moduleName));
|
|
2387
|
+
return (t ?? []).forEach((t) => {
|
|
2388
|
+
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField && W(e, t.toggleField) ? !!U(e, t.toggleField) : !1;
|
|
2389
|
+
if (t.toggleEnabled && t.toggleField && W(e, t.toggleField) && (G(n, t.toggleField, i), i && t.addRow)) {
|
|
2390
|
+
G(n, t.payloadKey || t.name, []);
|
|
2391
|
+
return;
|
|
2392
|
+
}
|
|
2393
|
+
if (t.addRow) {
|
|
2394
|
+
let i = e[t.name];
|
|
2395
|
+
if (!Array.isArray(i)) return;
|
|
2396
|
+
G(n, t.payloadKey || t.name, i.map((t) => Ci(r, t, e, a)).filter((e) => e && Object.keys(e).length > 0));
|
|
2397
|
+
return;
|
|
2398
|
+
}
|
|
2399
|
+
r.forEach((t) => Si(t, e, n, e, a));
|
|
2400
|
+
}), o.size > 0 && (r.moduleWrites = Array.from(o, ([e, t]) => ({
|
|
2401
|
+
moduleName: e,
|
|
2402
|
+
data: t
|
|
2403
|
+
}))), br(r, t);
|
|
2404
|
+
}
|
|
2405
|
+
function Si(e, t, n, r, i) {
|
|
2406
|
+
if (L(e) && wr(e)) {
|
|
2407
|
+
let r = Sr(e);
|
|
2408
|
+
W(t, r) && G(n, r, !!U(t, r));
|
|
2409
|
+
}
|
|
2410
|
+
if (Y(e)) {
|
|
2411
|
+
let i = Yr(U(t, e.field));
|
|
2412
|
+
if (i !== void 0) {
|
|
2413
|
+
let a = r !== void 0 && r !== t;
|
|
2414
|
+
Jr(n, e.payloadKey || (a ? e.field : e.fileKey || e.field), i);
|
|
2415
|
+
}
|
|
2416
|
+
return;
|
|
2417
|
+
}
|
|
2418
|
+
if (ui(e.showIf).length && !fi(e, t, r, i)) {
|
|
2419
|
+
(r === void 0 || r === t) && W(t, e.field) && G(n, e.payloadKey || e.field, null);
|
|
2420
|
+
return;
|
|
2421
|
+
}
|
|
2422
|
+
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
2423
|
+
if (!W(t, e.field)) return;
|
|
2424
|
+
let a = U(t, e.field);
|
|
2425
|
+
if (!Array.isArray(a)) return;
|
|
2426
|
+
let o = a.map((t) => Ci(e.subFields, t, r, i)).filter((e) => e && Object.keys(e).length > 0);
|
|
2427
|
+
G(n, e.payloadKey || e.field, o);
|
|
2428
|
+
return;
|
|
2429
|
+
}
|
|
2430
|
+
if (!W(t, e.field)) return;
|
|
2431
|
+
if (Wr(e.addRow) && (!Array.isArray(e.subFields) || e.subFields.length === 0)) {
|
|
2432
|
+
let r = U(t, e.field), i = Array.isArray(r) ? r : z(r) ? [] : [r], a = Ei(e), o = i.map((e) => oi(a, e)).filter((e) => e.kind !== "skip").map((e) => e.out);
|
|
2433
|
+
G(n, e.payloadKey || e.field, o);
|
|
2434
|
+
return;
|
|
2435
|
+
}
|
|
2436
|
+
let a = oi(e, U(t, e.field));
|
|
2437
|
+
if (a.kind !== "skip") {
|
|
2438
|
+
if (a.kind === "spread" && B(a.out)) {
|
|
2439
|
+
Xr(n, a.out);
|
|
2440
|
+
return;
|
|
2441
|
+
}
|
|
2442
|
+
G(n, e.payloadKey || e.field, a.out);
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2445
|
+
function Ci(e, t, n, r) {
|
|
2446
|
+
let i = {};
|
|
2447
|
+
return e.forEach((e) => Si(e, t, i, n ?? t, r)), i;
|
|
2448
|
+
}
|
|
2449
|
+
function wi(e, t) {
|
|
2450
|
+
let n = String(t).split("."), r = e;
|
|
2451
|
+
for (let e = 0; e < n.length - 1; e += 1) {
|
|
2452
|
+
if (!B(r[n[e]])) return;
|
|
2453
|
+
r = r[n[e]];
|
|
2454
|
+
}
|
|
2455
|
+
delete r[n[n.length - 1]];
|
|
2456
|
+
}
|
|
2457
|
+
var Ti = /* @__PURE__ */ new Set([
|
|
2458
|
+
"text",
|
|
2459
|
+
"textarea",
|
|
2460
|
+
"email",
|
|
2461
|
+
"phone",
|
|
2462
|
+
"tel",
|
|
2463
|
+
"number",
|
|
2464
|
+
"date",
|
|
2465
|
+
"time",
|
|
2466
|
+
"datetime",
|
|
2467
|
+
"password"
|
|
2468
|
+
]);
|
|
2469
|
+
function X(e, t) {
|
|
2470
|
+
let n = (t) => (Array.isArray(e.emptyValues) ? e.emptyValues : []).some((e) => String(e) === String(t)), r = () => e.defaultOnEdit ? ai(e) : void 0;
|
|
2471
|
+
if (t == null) return r() ?? t;
|
|
2472
|
+
if (n(t) || z(t) && r() !== void 0) return r();
|
|
2473
|
+
if (Ti.has(e.type) && B(t)) {
|
|
2474
|
+
let n = String(e.payloadKey || e.field || "").split(".").pop(), r = n ? t[n] : void 0;
|
|
2475
|
+
if (r === void 0 || B(r)) return;
|
|
2476
|
+
t = r;
|
|
2477
|
+
}
|
|
2478
|
+
if (e.type === "csvTags") return Hr(t);
|
|
2479
|
+
if (e.type === "date" || e.type === "time") {
|
|
2480
|
+
if (!t || t === "0001-01-01T00:00:00Z") return null;
|
|
2481
|
+
let e = l(t);
|
|
2482
|
+
return e.isValid() ? e : null;
|
|
2483
|
+
}
|
|
2484
|
+
t = Mr(e, t);
|
|
2485
|
+
let i = (t) => B(t) ? (e.valueKey && t[e.valueKey]) ?? t.id ?? t._id ?? t.value ?? t.userId ?? t.recruiterId : t, a = e.type !== "radio" && K(e) === "array", o = (t) => {
|
|
2486
|
+
if (t == null || t === "" || !Array.isArray(e.options)) return t;
|
|
2487
|
+
let n = e.options.find((e) => String(e?.value ?? "").toLowerCase() === String(t).toLowerCase());
|
|
2488
|
+
return n ? n.value : t;
|
|
2489
|
+
};
|
|
2490
|
+
if (e.type === "select" || e.type === "radio" || e.type === "checkbox") {
|
|
2491
|
+
if (a) return (Array.isArray(t) ? t : [t]).map(i).map(o).filter((e) => e != null && e !== "" && !n(e));
|
|
2492
|
+
let e = o(i(Array.isArray(t) ? t[0] : t));
|
|
2493
|
+
return n(e) ? r() : e;
|
|
2494
|
+
}
|
|
2495
|
+
return t;
|
|
2496
|
+
}
|
|
2497
|
+
function Ei(e = {}) {
|
|
2498
|
+
return {
|
|
2499
|
+
...e,
|
|
2500
|
+
addRow: !1,
|
|
2501
|
+
multiSelect: !1,
|
|
2502
|
+
mode: void 0,
|
|
2503
|
+
dataType: void 0
|
|
2504
|
+
};
|
|
2505
|
+
}
|
|
2506
|
+
function Di(e, t) {
|
|
2507
|
+
let n = Math.max(0, Number(e.minRows ?? 0) || 0), r = e.initialRows !== void 0 && e.initialRows !== "" ? Math.max(n, Math.max(0, Number(e.initialRows) || 0)) : n;
|
|
2508
|
+
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
2509
|
+
let i = [];
|
|
2510
|
+
Array.isArray(t) && (i = t.map((t) => {
|
|
2511
|
+
let n = {};
|
|
2512
|
+
return e.subFields.forEach((e) => {
|
|
2513
|
+
if (!e.field || Y(e)) return;
|
|
2514
|
+
let r = H(t ?? {}, e.field) ?? (t ?? {})[e.field];
|
|
2515
|
+
r != null && (n[e.field] = X(e, r));
|
|
2516
|
+
}), n;
|
|
2517
|
+
}));
|
|
2518
|
+
let a = i.length > 0 ? n : Math.max(n, r);
|
|
2519
|
+
for (; i.length < a;) i.push({});
|
|
2520
|
+
return i;
|
|
2521
|
+
}
|
|
2522
|
+
let i = Ei(e), a = [];
|
|
2523
|
+
if (Array.isArray(t)) a = t.map((e) => X(i, e)).filter((e) => e != null && e !== "");
|
|
2524
|
+
else if (t != null && t !== "") {
|
|
2525
|
+
let e = X(i, t);
|
|
2526
|
+
e != null && e !== "" && (a = [e]);
|
|
2527
|
+
}
|
|
2528
|
+
let o = a.length > 0 ? n : Math.max(n, r);
|
|
2529
|
+
for (; a.length < o;) a.push(void 0);
|
|
2530
|
+
return a;
|
|
2531
|
+
}
|
|
2532
|
+
//#endregion
|
|
2533
|
+
//#region src/components/detail/phoneDisplay.js
|
|
2534
|
+
var Oi = (e) => e == null || e === "";
|
|
2535
|
+
function ki(e, t) {
|
|
2536
|
+
return String(t ?? "").split(".").filter(Boolean).reduce((e, t) => e?.[t], e);
|
|
2537
|
+
}
|
|
2538
|
+
function Z(e) {
|
|
2539
|
+
let t = String(e ?? "").trim().replace(/[\s()-]/g, "");
|
|
2540
|
+
if (!t) return "";
|
|
2541
|
+
let n = t.replace(/^\+/, "");
|
|
2542
|
+
return /^\d{1,4}$/.test(n) ? `+${n}` : "";
|
|
2543
|
+
}
|
|
2544
|
+
function Ai(e) {
|
|
2545
|
+
let t = String(e?.field ?? "").trim(), n = t.replace(/(number|no|phone|mobile|contact)$/i, "");
|
|
2546
|
+
return [
|
|
2547
|
+
...t ? [`${t}CountryCode`, `${t}Code`] : [],
|
|
2548
|
+
...n && n !== t ? [`${n}CountryCode`] : [],
|
|
2549
|
+
"countryCode",
|
|
2550
|
+
"phoneCountryCode",
|
|
2551
|
+
"mobileCountryCode",
|
|
2552
|
+
"contactCountryCode",
|
|
2553
|
+
"dialCode",
|
|
2554
|
+
"isdCode"
|
|
2555
|
+
];
|
|
2556
|
+
}
|
|
2557
|
+
function ji(e, t, n = "") {
|
|
2558
|
+
let r = e?.renderOptions?.countryCodeField ?? e?.countryCodeField, i = r ? [r, ...Ai(e)] : Ai(e);
|
|
2559
|
+
for (let e of i) {
|
|
2560
|
+
let n = Z(ki(t, e));
|
|
2561
|
+
if (n) return n;
|
|
2562
|
+
}
|
|
2563
|
+
return Z(n);
|
|
2564
|
+
}
|
|
2565
|
+
function Mi(e) {
|
|
2566
|
+
let t = String(e ?? "").trim(), n = t.match(/^(\+\d{1,4})[\s-]*(.*)$/);
|
|
2567
|
+
return n ? {
|
|
2568
|
+
code: n[1],
|
|
2569
|
+
rest: n[2]
|
|
2570
|
+
} : {
|
|
2571
|
+
code: "",
|
|
2572
|
+
rest: t
|
|
2573
|
+
};
|
|
2574
|
+
}
|
|
2575
|
+
function Ni(e, t = "") {
|
|
2576
|
+
if (Oi(e)) return "";
|
|
2577
|
+
let { code: n, rest: r } = Mi(e), i = n || Z(t), a = hn(r) || r;
|
|
2578
|
+
return `${i ? `${i} ` : ""}${a}`.trim();
|
|
2579
|
+
}
|
|
2580
|
+
function Pi(e, t, n) {
|
|
2581
|
+
return Ni(t, ji(e, n, pn()));
|
|
2582
|
+
}
|
|
2583
|
+
//#endregion
|
|
2584
|
+
//#region src/components/detail/renderConfig.js
|
|
2585
|
+
var Fi = [
|
|
2586
|
+
{
|
|
2587
|
+
value: "auto",
|
|
2588
|
+
label: "Default (auto)"
|
|
2589
|
+
},
|
|
2590
|
+
{
|
|
2591
|
+
value: "text",
|
|
2592
|
+
label: "Text"
|
|
2593
|
+
},
|
|
2594
|
+
{
|
|
2595
|
+
value: "tag",
|
|
2596
|
+
label: "Tag"
|
|
2597
|
+
},
|
|
2598
|
+
{
|
|
2599
|
+
value: "tags",
|
|
2600
|
+
label: "Multi Tag (Skills)"
|
|
2601
|
+
},
|
|
2602
|
+
{
|
|
2603
|
+
value: "badge",
|
|
2604
|
+
label: "Badge"
|
|
2605
|
+
},
|
|
2606
|
+
{
|
|
2607
|
+
value: "chip",
|
|
2608
|
+
label: "Chip"
|
|
2609
|
+
},
|
|
2610
|
+
{
|
|
2611
|
+
value: "document",
|
|
2612
|
+
label: "Document"
|
|
2613
|
+
},
|
|
2614
|
+
{
|
|
2615
|
+
value: "link",
|
|
2616
|
+
label: "Link"
|
|
2617
|
+
},
|
|
2618
|
+
{
|
|
2619
|
+
value: "email",
|
|
2620
|
+
label: "Email"
|
|
2621
|
+
},
|
|
2622
|
+
{
|
|
2623
|
+
value: "phone",
|
|
2624
|
+
label: "Phone"
|
|
2625
|
+
},
|
|
2626
|
+
{
|
|
2627
|
+
value: "date",
|
|
2628
|
+
label: "Date"
|
|
2629
|
+
},
|
|
2630
|
+
{
|
|
2631
|
+
value: "currency",
|
|
2632
|
+
label: "Currency"
|
|
2633
|
+
},
|
|
2634
|
+
{
|
|
2635
|
+
value: "budget",
|
|
2636
|
+
label: "Budget"
|
|
2637
|
+
},
|
|
2638
|
+
{
|
|
2639
|
+
value: "html",
|
|
2640
|
+
label: "HTML"
|
|
2641
|
+
}
|
|
2642
|
+
], Ii = [
|
|
2643
|
+
{
|
|
2644
|
+
value: "preview",
|
|
2645
|
+
label: "Preview (viewer)"
|
|
2646
|
+
},
|
|
2647
|
+
{
|
|
2648
|
+
value: "download",
|
|
2649
|
+
label: "Download button"
|
|
2650
|
+
},
|
|
2651
|
+
{
|
|
2652
|
+
value: "link",
|
|
2653
|
+
label: "Link (filename)"
|
|
2654
|
+
},
|
|
2655
|
+
{
|
|
2656
|
+
value: "tag",
|
|
2657
|
+
label: "Tag"
|
|
2658
|
+
},
|
|
2659
|
+
{
|
|
2660
|
+
value: "text",
|
|
2661
|
+
label: "Text (filename)"
|
|
2662
|
+
}
|
|
2663
|
+
], Li = [
|
|
2664
|
+
{
|
|
2665
|
+
value: "none",
|
|
2666
|
+
label: "None"
|
|
2667
|
+
},
|
|
2668
|
+
{
|
|
2669
|
+
value: "upper",
|
|
2670
|
+
label: "UPPERCASE"
|
|
2671
|
+
},
|
|
2672
|
+
{
|
|
2673
|
+
value: "lower",
|
|
2674
|
+
label: "lowercase"
|
|
2675
|
+
},
|
|
2676
|
+
{
|
|
2677
|
+
value: "title",
|
|
2678
|
+
label: "Title Case"
|
|
2679
|
+
}
|
|
2680
|
+
], Ri = [
|
|
2681
|
+
"location",
|
|
2682
|
+
"path",
|
|
2683
|
+
"url",
|
|
2684
|
+
"key"
|
|
2685
|
+
], zi = [
|
|
2686
|
+
"location",
|
|
2687
|
+
"filepath",
|
|
2688
|
+
"path",
|
|
2689
|
+
"url",
|
|
2690
|
+
"key"
|
|
2691
|
+
], Bi = [
|
|
2692
|
+
"uploadedfilename",
|
|
2693
|
+
"uploadname",
|
|
2694
|
+
"originalname",
|
|
2695
|
+
"displayname",
|
|
2696
|
+
"documentname",
|
|
2697
|
+
"filename"
|
|
2698
|
+
], Vi = ["name"], Hi = (e) => String(e).toLowerCase(), Ui = (e) => e == null || e === "";
|
|
2699
|
+
function Wi(e, t) {
|
|
2700
|
+
for (let n of t) {
|
|
2701
|
+
let t = e[n];
|
|
2702
|
+
if (typeof t == "string" && t) return t;
|
|
2703
|
+
}
|
|
2704
|
+
return "";
|
|
2705
|
+
}
|
|
2706
|
+
function Gi(e, t) {
|
|
2707
|
+
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r && Hi(t).endsWith(n)) return r;
|
|
2708
|
+
return "";
|
|
2709
|
+
}
|
|
2710
|
+
function Q(e) {
|
|
2711
|
+
if (!e) return "";
|
|
2712
|
+
let t = String(e).split("?")[0].split("#")[0];
|
|
2713
|
+
return decodeURIComponent(t.split("/").pop() || "");
|
|
2714
|
+
}
|
|
2715
|
+
function Ki(e) {
|
|
2716
|
+
if (!e) return "";
|
|
2717
|
+
let t = String(e);
|
|
2718
|
+
return /^https?:\/\//i.test(t) ? t : "";
|
|
2719
|
+
}
|
|
2720
|
+
function qi(e) {
|
|
2721
|
+
let t = String(e ?? "").trim();
|
|
2722
|
+
return !t || /^https?:\/\//i.test(t) || t.startsWith("blob:") || t.startsWith("data:") ? !1 : t.includes("/");
|
|
2723
|
+
}
|
|
2724
|
+
function Ji(e) {
|
|
2725
|
+
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : Wi(e, Ri) || Gi(e, zi);
|
|
2726
|
+
}
|
|
2727
|
+
function Yi(e) {
|
|
2728
|
+
return e ? typeof e == "string" ? Q(e) || e : typeof e == "object" && (Wi(e, M().documentNameOrder ?? []) || Gi(e, Bi) || Q(Ji(e)) || Gi(e, Vi)) || "Document" : "Document";
|
|
2729
|
+
}
|
|
2730
|
+
function Xi(e) {
|
|
2731
|
+
if (Ui(e)) return [];
|
|
2732
|
+
let t = Array.isArray(e) ? e : [e], n = [];
|
|
2733
|
+
for (let e of t) if (!Ui(e)) {
|
|
2734
|
+
if (typeof e == "string") {
|
|
2735
|
+
let t = e.includes("/") ? e : "";
|
|
2736
|
+
n.push({
|
|
2737
|
+
location: t,
|
|
2738
|
+
name: Q(e) || e,
|
|
2739
|
+
url: Ki(t),
|
|
2740
|
+
needsAuthFetch: qi(t)
|
|
2741
|
+
});
|
|
2742
|
+
} else if (typeof e == "object") {
|
|
2743
|
+
let t = Ji(e), r = e.fileUrl || e.downloadUrl || e.signedUrl || "";
|
|
2744
|
+
n.push({
|
|
2745
|
+
location: t,
|
|
2746
|
+
name: Yi(e),
|
|
2747
|
+
url: r || Ki(t),
|
|
2748
|
+
documentId: e.id || e._id || e.documentId || "",
|
|
2749
|
+
needsAuthFetch: !r && qi(t)
|
|
2750
|
+
});
|
|
2751
|
+
}
|
|
2752
|
+
}
|
|
2753
|
+
return n;
|
|
2754
|
+
}
|
|
2755
|
+
//#endregion
|
|
2756
|
+
//#region src/components/form/repeatableRowShape.js
|
|
2757
|
+
function Zi(e) {
|
|
2758
|
+
return e?.primaryField ? e.primaryField : (e?.fields ?? []).find((e) => e?.field)?.field ?? null;
|
|
2759
|
+
}
|
|
2760
|
+
function Qi(e, t) {
|
|
2761
|
+
if (!Array.isArray(t) || t.length === 0) return t;
|
|
2762
|
+
let n = Zi(e);
|
|
2763
|
+
if (!n) return t;
|
|
2764
|
+
let r = !1, i = t.map((e) => typeof e == "object" && e && !Array.isArray(e) ? e : e == null || String(e).trim() === "" ? (r = !0, {}) : (r = !0, { [n]: e }));
|
|
2765
|
+
return r ? i : t;
|
|
2766
|
+
}
|
|
2767
|
+
//#endregion
|
|
2768
|
+
//#region src/components/AppButton.jsx
|
|
2769
|
+
function $i({ children: e, className: t = "", icon: n, to: r, variant: i = "default", ...a }) {
|
|
2770
|
+
let o = /* @__PURE__ */ c(s, {
|
|
2771
|
+
className: `app-button app-button--${i} ${t}`.trim(),
|
|
2772
|
+
icon: n,
|
|
2773
|
+
...a,
|
|
2774
|
+
children: e
|
|
2775
|
+
});
|
|
2776
|
+
return r ? /* @__PURE__ */ c(f, {
|
|
2777
|
+
className: "app-button-link",
|
|
2778
|
+
to: r,
|
|
2779
|
+
children: o
|
|
2780
|
+
}) : o;
|
|
2781
|
+
}
|
|
2782
|
+
//#endregion
|
|
2783
|
+
//#region src/components/detail/userNames.js
|
|
2784
|
+
function ea(e) {
|
|
2785
|
+
return !e || typeof e != "object" ? "" : [e.first_name ?? e.firstName ?? e.FIRST_NAME, e.last_name ?? e.lastName ?? e.LAST_NAME].filter(Boolean).join(" ").trim() || e.name || e.user_name || e.userName || e.username || e.email || "";
|
|
2786
|
+
}
|
|
2787
|
+
function ta(e) {
|
|
2788
|
+
let t = {};
|
|
2789
|
+
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
2790
|
+
let n = ea(e);
|
|
2791
|
+
n && [
|
|
2792
|
+
e.legacyUserId,
|
|
2793
|
+
e.userId,
|
|
2794
|
+
e.user_id,
|
|
2795
|
+
e._id,
|
|
2796
|
+
e.id
|
|
2797
|
+
].forEach((e) => {
|
|
2798
|
+
if (e == null || e === "") return;
|
|
2799
|
+
let r = String(typeof e == "object" ? e.$oid ?? e.id ?? "" : e);
|
|
2800
|
+
r && t[r] === void 0 && (t[r] = n);
|
|
2801
|
+
});
|
|
2802
|
+
}), t;
|
|
2803
|
+
}
|
|
2804
|
+
var na = /* @__PURE__ */ new Map();
|
|
2805
|
+
function ra(t) {
|
|
2806
|
+
let r = String(t ?? "").trim();
|
|
2807
|
+
if (!r) return Promise.resolve("");
|
|
2808
|
+
if (na.has(r)) return na.get(r);
|
|
2809
|
+
let i = n(e, `/get-detailed-view?userId=${encodeURIComponent(r)}`).then((e) => ea(e?.data ?? e ?? null)).catch(() => "");
|
|
2810
|
+
return na.set(r, i), i;
|
|
2811
|
+
}
|
|
2812
|
+
//#endregion
|
|
2813
|
+
//#region src/utils/roleAllowsAction.js
|
|
2814
|
+
function ia(e) {
|
|
2815
|
+
return e == null ? !0 : typeof e == "object" ? ia(e.permission ?? e.allowed ?? e.value) : e !== !1 && e !== 0 && e !== "0";
|
|
2816
|
+
}
|
|
2817
|
+
function aa(e, t) {
|
|
2818
|
+
let n = String(t ?? "").trim().toLowerCase();
|
|
2819
|
+
if (!(!n || !e || typeof e != "object")) for (let [t, r] of Object.entries(e)) {
|
|
2820
|
+
let e = String(t).trim().toLowerCase();
|
|
2821
|
+
if (e === n || e === `${n}s` || `${e}s` === n) return r && typeof r == "object" ? r : void 0;
|
|
2822
|
+
}
|
|
2823
|
+
}
|
|
2824
|
+
function oa(e, t) {
|
|
2825
|
+
if (Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
2826
|
+
let n = `${t}Access`;
|
|
2827
|
+
if (Object.prototype.hasOwnProperty.call(e, n)) return e[n];
|
|
2828
|
+
}
|
|
2829
|
+
function sa(e, t) {
|
|
2830
|
+
if (!e) return !0;
|
|
2831
|
+
try {
|
|
2832
|
+
let n = JSON.parse(localStorage.getItem("menuPermission") || "{}"), [r, i] = String(e).split("."), a = i ?? r, o = i ? [r, t] : [t];
|
|
2833
|
+
for (let e of o) {
|
|
2834
|
+
let t = aa(n, e);
|
|
2835
|
+
if (t) return ia(oa(t, a));
|
|
2836
|
+
}
|
|
2837
|
+
return !0;
|
|
2838
|
+
} catch {
|
|
2839
|
+
return !0;
|
|
2840
|
+
}
|
|
2841
|
+
}
|
|
2842
|
+
//#endregion
|
|
2843
|
+
//#region src/components/form/conditionalFieldLabel.js
|
|
2844
|
+
function ca(e) {
|
|
2845
|
+
return Array.isArray(e) ? e.map((e) => String(e ?? "").trim()) : String(e ?? "").split(",").map((e) => e.trim());
|
|
2846
|
+
}
|
|
2847
|
+
function $(e, t) {
|
|
2848
|
+
if (!e?.field) return !1;
|
|
2849
|
+
switch (e.operator ?? "eq") {
|
|
2850
|
+
case "eq": return String(t ?? "") === String(e.value ?? "");
|
|
2851
|
+
case "neq": return String(t ?? "") !== String(e.value ?? "");
|
|
2852
|
+
case "truthy": return t != null && t !== "" && t !== !1;
|
|
2853
|
+
case "falsy": return t == null || t === "" || t === !1;
|
|
2854
|
+
case "notEmpty": return Array.isArray(t) ? t.length > 0 : !!t;
|
|
2855
|
+
case "in": return ca(e.value).includes(String(t ?? ""));
|
|
2856
|
+
case "notIn": return !ca(e.value).includes(String(t ?? ""));
|
|
2857
|
+
default: return !1;
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
function la(e, t, n = !1) {
|
|
2861
|
+
let r = n ? e?.combineLabel ?? e?.label : e?.label, i = e?.labelWhen;
|
|
2862
|
+
return $(i, t) && i?.label ? i.label : r;
|
|
2863
|
+
}
|
|
2864
|
+
function ua(e) {
|
|
2865
|
+
return e ? [...e.field ? [e] : [], ...(e.conditions ?? []).filter((e) => e?.field)] : [];
|
|
2866
|
+
}
|
|
2867
|
+
function da(e, t) {
|
|
2868
|
+
let n = ua(e);
|
|
2869
|
+
if (!n.length) return !0;
|
|
2870
|
+
let r = n.map((e) => $(e, t(e.field)));
|
|
2871
|
+
return e.logic === "or" ? r.some(Boolean) : r.every(Boolean);
|
|
2872
|
+
}
|
|
2873
|
+
function fa(e) {
|
|
2874
|
+
let t = e?.colWhen;
|
|
2875
|
+
return t ? (Array.isArray(t) ? t : [t]).filter((e) => e?.field && Number(e?.col) > 0) : [];
|
|
2876
|
+
}
|
|
2877
|
+
function pa(e, t, n) {
|
|
2878
|
+
for (let t of fa(e)) if ($(t, n(t))) return Number(t.col);
|
|
2879
|
+
return t;
|
|
2880
|
+
}
|
|
2881
|
+
function ma(e, t) {
|
|
2882
|
+
return e?.field ? t == null ? [e.field] : [...Array.isArray(t) ? t : [t], e.field] : ["__noop_conditional_label__"];
|
|
2883
|
+
}
|
|
2884
|
+
//#endregion
|
|
2885
|
+
export { nr as $, pt as $n, be as $t, H as A, tt as An, pe as At, kr as B, fe as Bn, Ie as Bt, Mi as C, re as Cn, mn as Ct, bi as D, ve as Dn, sn as Dt, Di as E, xe as En, cn as Et, si as F, rt as Fn, Mt as Ft, Dr as G, Ne as Gn, tn as Gt, L as H, Fe as Hn, Ge as Ht, Br as I, _t as In, $t as It, _r as J, Et as Jn, Zt as Jt, pr as K, We as Kn, bt as Kt, Hr as L, ie as Ln, vt as Lt, mi as M, nn as Mn, Se as Mt, Ei as N, Vt as Nn, Wt as Nt, ai as O, lt as On, ln as Ot, ci as P, Jt as Pn, It as Pt, Qn as Q, rn as Qn, gt as Qt, Nr as R, Ct as Rn, Yt as Rt, Z as S, Qt as Sn, fn as St, xi as T, Tt as Tn, on as Tt, Or as U, Be as Un, Rt as Ut, Mr as V, Te as Vn, Kt as Vt, Tr as W, ke as Wn, Pt as Wt, tr as X, ye as Xn, me as Xt, $n as Y, ae as Yn, Ae as Yt, er as Z, ut as Zn, de as Zt, Li as _, qe as _n, hn as _t, da as a, At as an, Nt as ar, I as at, Ai as b, Ft as bn, yn as bt, ia as c, ze as cn, ot as cr, Tn as ct, ta as d, Ut as dn, $e as dr, Fn as dt, _e as en, Le as er, Zn as et, ea as f, Oe as fn, dt as fr, wn as ft, Fi as g, He as gn, gn as gt, Ii as h, Ue as hn, A as ht, la as i, ft as in, Lt as ir, Kn as it, Y as j, nt as jn, Je as jt, K as k, T as kn, Ee as kt, sa as l, Ve as ln, Ht as lr, On as lt, Qi as m, mt as mn, Dt as mr, En as mt, ma as n, Xe as nn, Ce as nr, Wn as nt, pa as o, Ot as on, en as or, In as ot, $i as p, Me as pn, ht as pr, Mn as pt, vr as q, se as qn, oe as qt, $ as r, Qe as rn, Gt as rr, Gn as rt, ua as s, ce as sn, yt as sr, Cn as st, fa as t, Pe as tn, Ke as tr, Un as tt, ra as u, kt as un, Xt as ur, F as ut, Ki as v, xt as vn, vn as vt, X as w, le as wn, an as wt, Pi as x, jt as xn, bn as xt, Xi as y, St as yn, M as yt, R as z, wt as zn, we as zt };
|
|
2886
|
+
|
|
2887
|
+
//# sourceMappingURL=FileField-CYCUE0OI.js.map
|