@realtek/core-theme 0.0.255 → 0.0.256
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/dist-lib/Breadcrumb-C2tIzwqU.cjs +3 -0
- package/dist-lib/Breadcrumb-C2tIzwqU.cjs.map +1 -0
- package/dist-lib/{Breadcrumb-BFq5E87_.js → Breadcrumb-DD-QBb4T.js} +1106 -837
- package/dist-lib/Breadcrumb-DD-QBb4T.js.map +1 -0
- package/dist-lib/index.cjs +7 -7
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +8302 -7166
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/style.css +1 -1
- package/package.json +1 -1
- package/dist-lib/Breadcrumb-BFq5E87_.js.map +0 -1
- package/dist-lib/Breadcrumb-CeJ3Xmr0.cjs +0 -3
- package/dist-lib/Breadcrumb-CeJ3Xmr0.cjs.map +0 -1
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { C as e, S as t, a as n, b as r, i, t as a,
|
|
2
|
-
import { i as
|
|
3
|
-
import { Suspense as
|
|
4
|
-
import { Breadcrumb as
|
|
5
|
-
import { CloseOutlined as
|
|
6
|
-
import { Fragment as
|
|
1
|
+
import { C as e, S as t, a as n, b as r, i, t as a, u as o, x as s } from "./authApi-CVxnHdIU.js";
|
|
2
|
+
import { i as c, r as l } from "./diceCandidateMapper-BKRGwz7g.js";
|
|
3
|
+
import { Suspense as u, lazy as d, useCallback as f, useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
4
|
+
import { Breadcrumb as _, Button as v, Form as y, Modal as b, Space as ee, Spin as te, Tooltip as x, Typography as ne, message as S } from "antd";
|
|
5
|
+
import { CloseOutlined as re, DownOutlined as ie, DownloadOutlined as ae, EditOutlined as oe, ExclamationCircleFilled as se, FileUnknownOutlined as ce, LeftOutlined as le, PlusOutlined as ue, RightOutlined as de, ZoomInOutlined as fe, ZoomOutOutlined as pe } from "@ant-design/icons";
|
|
6
|
+
import { Fragment as me, jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
7
|
+
import { Link as he } from "react-router-dom";
|
|
7
8
|
import ge from "dayjs";
|
|
8
9
|
import { EditorContent as _e, useEditor as ve } from "@tiptap/react";
|
|
9
10
|
import ye from "@tiptap/starter-kit";
|
|
10
11
|
import be from "@tiptap/extension-link";
|
|
11
12
|
import xe from "@tiptap/extension-underline";
|
|
12
|
-
import
|
|
13
|
+
import T from "prop-types";
|
|
13
14
|
import { Document as Se, Page as Ce, pdfjs as we } from "react-pdf";
|
|
14
15
|
import { renderAsync as Te } from "docx-preview";
|
|
15
16
|
import Ee from "dompurify";
|
|
16
17
|
import "react-pdf/dist/Page/AnnotationLayer.css";
|
|
17
18
|
import "react-pdf/dist/Page/TextLayer.css";
|
|
18
19
|
//#region src/theme/colors/colors.js
|
|
19
|
-
var
|
|
20
|
+
var E = {
|
|
20
21
|
brand: "#0053a5",
|
|
21
22
|
brandDark: "#1d4ed8",
|
|
22
23
|
brandDarker: "#1e40af",
|
|
@@ -92,8 +93,8 @@ var C = {
|
|
|
92
93
|
avatarGreen: "#10b981",
|
|
93
94
|
linkedIn: "#0077b5"
|
|
94
95
|
};
|
|
95
|
-
|
|
96
|
-
var
|
|
96
|
+
E.textPrimary, E.textSecondary, E.textMuted, E.textSubtle, E.textInverse, E.textLink, E.danger, E.success, E.danger, E.textLink, E.surfaceSoft, E.textSecondary, E.success, E.warning;
|
|
97
|
+
var D = {
|
|
97
98
|
brand: "var(--color-brand)",
|
|
98
99
|
brandDark: "var(--color-brand-dark)",
|
|
99
100
|
brandDarker: "var(--color-brand-darker)",
|
|
@@ -162,7 +163,7 @@ var w = {
|
|
|
162
163
|
avatarPurpleBg: "var(--color-avatar-purple-bg)",
|
|
163
164
|
avatarMoreBg: "var(--color-avatar-more-bg)",
|
|
164
165
|
avatarMoreText: "var(--color-avatar-more-text)"
|
|
165
|
-
}, { Text: De, Title: Oe, Paragraph: ke, Link: Ae } =
|
|
166
|
+
}, { Text: De, Title: Oe, Paragraph: ke, Link: Ae } = ne, je = {
|
|
166
167
|
display: "h1",
|
|
167
168
|
h1: "h1",
|
|
168
169
|
h2: "h2",
|
|
@@ -201,14 +202,14 @@ var w = {
|
|
|
201
202
|
normal: "var(--line-height-normal)",
|
|
202
203
|
relaxed: "var(--line-height-relaxed)"
|
|
203
204
|
}, Fe = {
|
|
204
|
-
primary:
|
|
205
|
-
secondary:
|
|
206
|
-
muted:
|
|
207
|
-
subtle:
|
|
208
|
-
inverse:
|
|
209
|
-
link:
|
|
210
|
-
danger:
|
|
211
|
-
success:
|
|
205
|
+
primary: D.textPrimary,
|
|
206
|
+
secondary: D.textSecondary,
|
|
207
|
+
muted: D.textMuted,
|
|
208
|
+
subtle: D.textSubtle,
|
|
209
|
+
inverse: D.textInverse,
|
|
210
|
+
link: D.textLink,
|
|
211
|
+
danger: D.danger,
|
|
212
|
+
success: D.success
|
|
212
213
|
};
|
|
213
214
|
function Ie(...e) {
|
|
214
215
|
return e.filter(Boolean).join(" ");
|
|
@@ -238,7 +239,7 @@ function Be({ as: e, tag: t, variant: n = "body", color: r, size: i, weight: a,
|
|
|
238
239
|
display: l,
|
|
239
240
|
...d
|
|
240
241
|
};
|
|
241
|
-
return /* @__PURE__ */
|
|
242
|
+
return /* @__PURE__ */ C(h, {
|
|
242
243
|
...g ? { level: g } : {},
|
|
243
244
|
className: Ie("app-typography", `app-typography--${n}`, r && Fe[r] && `app-typography--${r}`, s && `app-typography--${s}`, c && "app-typography--truncate", u),
|
|
244
245
|
style: _,
|
|
@@ -248,8 +249,8 @@ function Be({ as: e, tag: t, variant: n = "body", color: r, size: i, weight: a,
|
|
|
248
249
|
}
|
|
249
250
|
//#endregion
|
|
250
251
|
//#region src/components/TipTapEditor.jsx
|
|
251
|
-
function
|
|
252
|
-
return /* @__PURE__ */
|
|
252
|
+
function O({ onClick: e, active: t, disabled: n, title: r, children: i }) {
|
|
253
|
+
return /* @__PURE__ */ C("button", {
|
|
253
254
|
type: "button",
|
|
254
255
|
title: r,
|
|
255
256
|
disabled: n,
|
|
@@ -261,55 +262,55 @@ function T({ onClick: e, active: t, disabled: n, title: r, children: i }) {
|
|
|
261
262
|
});
|
|
262
263
|
}
|
|
263
264
|
function Ve({ editor: e, disabled: t }) {
|
|
264
|
-
return e ? /* @__PURE__ */
|
|
265
|
+
return e ? /* @__PURE__ */ w("div", {
|
|
265
266
|
className: `tte-toolbar${t ? " tte-toolbar--disabled" : ""}`,
|
|
266
267
|
children: [
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ w("div", {
|
|
268
269
|
className: "tte-toolbar-group",
|
|
269
270
|
children: [
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ C(O, {
|
|
271
272
|
title: "Bold",
|
|
272
273
|
disabled: t,
|
|
273
274
|
active: e.isActive("bold"),
|
|
274
275
|
onClick: () => e.chain().focus().toggleBold().run(),
|
|
275
|
-
children: /* @__PURE__ */
|
|
276
|
+
children: /* @__PURE__ */ C("strong", { children: "B" })
|
|
276
277
|
}),
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ C(O, {
|
|
278
279
|
title: "Italic",
|
|
279
280
|
disabled: t,
|
|
280
281
|
active: e.isActive("italic"),
|
|
281
282
|
onClick: () => e.chain().focus().toggleItalic().run(),
|
|
282
|
-
children: /* @__PURE__ */
|
|
283
|
+
children: /* @__PURE__ */ C("em", { children: "I" })
|
|
283
284
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ C(O, {
|
|
285
286
|
title: "Underline",
|
|
286
287
|
disabled: t,
|
|
287
288
|
active: e.isActive("underline"),
|
|
288
289
|
onClick: () => e.chain().focus().toggleUnderline().run(),
|
|
289
|
-
children: /* @__PURE__ */
|
|
290
|
+
children: /* @__PURE__ */ C("span", {
|
|
290
291
|
style: { textDecoration: "underline" },
|
|
291
292
|
children: "U"
|
|
292
293
|
})
|
|
293
294
|
}),
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ C(O, {
|
|
295
296
|
title: "Strikethrough",
|
|
296
297
|
disabled: t,
|
|
297
298
|
active: e.isActive("strike"),
|
|
298
299
|
onClick: () => e.chain().focus().toggleStrike().run(),
|
|
299
|
-
children: /* @__PURE__ */
|
|
300
|
+
children: /* @__PURE__ */ C("s", { children: "S" })
|
|
300
301
|
})
|
|
301
302
|
]
|
|
302
303
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ C("div", { className: "tte-toolbar-divider" }),
|
|
305
|
+
/* @__PURE__ */ w("div", {
|
|
305
306
|
className: "tte-toolbar-group",
|
|
306
|
-
children: [/* @__PURE__ */
|
|
307
|
+
children: [/* @__PURE__ */ C(O, {
|
|
307
308
|
title: "Bullet List",
|
|
308
309
|
disabled: t,
|
|
309
310
|
active: e.isActive("bulletList"),
|
|
310
311
|
onClick: () => e.chain().focus().toggleBulletList().run(),
|
|
311
312
|
children: "≡"
|
|
312
|
-
}), /* @__PURE__ */
|
|
313
|
+
}), /* @__PURE__ */ C(O, {
|
|
313
314
|
title: "Ordered List",
|
|
314
315
|
disabled: t,
|
|
315
316
|
active: e.isActive("orderedList"),
|
|
@@ -317,10 +318,10 @@ function Ve({ editor: e, disabled: t }) {
|
|
|
317
318
|
children: "1."
|
|
318
319
|
})]
|
|
319
320
|
}),
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ C("div", { className: "tte-toolbar-divider" }),
|
|
322
|
+
/* @__PURE__ */ C("div", {
|
|
322
323
|
className: "tte-toolbar-group",
|
|
323
|
-
children: /* @__PURE__ */
|
|
324
|
+
children: /* @__PURE__ */ C(O, {
|
|
324
325
|
title: "Link",
|
|
325
326
|
disabled: t,
|
|
326
327
|
active: e.isActive("link"),
|
|
@@ -335,10 +336,10 @@ function Ve({ editor: e, disabled: t }) {
|
|
|
335
336
|
children: "🔗"
|
|
336
337
|
})
|
|
337
338
|
}),
|
|
338
|
-
/* @__PURE__ */
|
|
339
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ C("div", { className: "tte-toolbar-divider" }),
|
|
340
|
+
/* @__PURE__ */ C("div", {
|
|
340
341
|
className: "tte-toolbar-group",
|
|
341
|
-
children: /* @__PURE__ */
|
|
342
|
+
children: /* @__PURE__ */ C(O, {
|
|
342
343
|
title: "Clear formatting",
|
|
343
344
|
disabled: t,
|
|
344
345
|
onClick: () => e.chain().focus().clearNodes().unsetAllMarks().run(),
|
|
@@ -349,7 +350,7 @@ function Ve({ editor: e, disabled: t }) {
|
|
|
349
350
|
}) : null;
|
|
350
351
|
}
|
|
351
352
|
function He({ value: e = "", onChange: t, disabled: n = !1, placeholder: r = "" }) {
|
|
352
|
-
let i =
|
|
353
|
+
let i = h(e ?? ""), a = ve({
|
|
353
354
|
extensions: [
|
|
354
355
|
ye,
|
|
355
356
|
xe,
|
|
@@ -366,21 +367,21 @@ function He({ value: e = "", onChange: t, disabled: n = !1, placeholder: r = ""
|
|
|
366
367
|
i.current = r, t?.(r);
|
|
367
368
|
}
|
|
368
369
|
});
|
|
369
|
-
return
|
|
370
|
+
return p(() => {
|
|
370
371
|
if (!a || a.isDestroyed) return;
|
|
371
372
|
let t = e || "";
|
|
372
373
|
t !== (i.current || "") && (i.current = t, a.commands.setContent(t, !1));
|
|
373
|
-
}, [e, a]),
|
|
374
|
+
}, [e, a]), p(() => {
|
|
374
375
|
a && a.setEditable(!n);
|
|
375
|
-
}, [n, a]), /* @__PURE__ */
|
|
376
|
+
}, [n, a]), /* @__PURE__ */ w("div", {
|
|
376
377
|
className: `tte-wrapper${n ? " tte-wrapper--disabled" : ""}`,
|
|
377
378
|
children: [
|
|
378
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ C(Ve, {
|
|
379
380
|
editor: a,
|
|
380
381
|
disabled: n
|
|
381
382
|
}),
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
-
!e && !a?.isFocused && r && /* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ C(_e, { editor: a }),
|
|
384
|
+
!e && !a?.isFocused && r && /* @__PURE__ */ C("div", {
|
|
384
385
|
className: "tte-placeholder",
|
|
385
386
|
children: r
|
|
386
387
|
})
|
|
@@ -457,30 +458,30 @@ function et(e) {
|
|
|
457
458
|
}).filter((e) => e.url || e.content);
|
|
458
459
|
}
|
|
459
460
|
function tt({ url: e, scale: t, onNativeFallback: n }) {
|
|
460
|
-
let r =
|
|
461
|
-
return
|
|
461
|
+
let r = h(null), [i, a] = g(0), [o, s] = g(0), [c, l] = g(!1);
|
|
462
|
+
return p(() => {
|
|
462
463
|
let e = r.current;
|
|
463
464
|
if (!e) return;
|
|
464
465
|
let t = () => s(e.clientWidth);
|
|
465
466
|
t();
|
|
466
467
|
let n = new ResizeObserver(t);
|
|
467
468
|
return n.observe(e), () => n.disconnect();
|
|
468
|
-
}, []), c ? /* @__PURE__ */
|
|
469
|
+
}, []), c ? /* @__PURE__ */ C("iframe", {
|
|
469
470
|
title: "PDF preview",
|
|
470
471
|
src: e,
|
|
471
472
|
className: "dv-pdf-native"
|
|
472
|
-
}) : /* @__PURE__ */
|
|
473
|
+
}) : /* @__PURE__ */ C("div", {
|
|
473
474
|
ref: r,
|
|
474
475
|
className: "dv-pdf-wrap",
|
|
475
|
-
children: /* @__PURE__ */
|
|
476
|
+
children: /* @__PURE__ */ C(Se, {
|
|
476
477
|
file: e,
|
|
477
|
-
loading: /* @__PURE__ */
|
|
478
|
-
error: /* @__PURE__ */
|
|
478
|
+
loading: /* @__PURE__ */ C(te, {}),
|
|
479
|
+
error: /* @__PURE__ */ C(k, { label: "This PDF could not be displayed." }),
|
|
479
480
|
onLoadSuccess: ({ numPages: e }) => a(e),
|
|
480
481
|
onLoadError: () => {
|
|
481
482
|
l(!0), n?.();
|
|
482
483
|
},
|
|
483
|
-
children: Array.from({ length: i }, (e, n) => /* @__PURE__ */
|
|
484
|
+
children: Array.from({ length: i }, (e, n) => /* @__PURE__ */ C(Ce, {
|
|
484
485
|
pageNumber: n + 1,
|
|
485
486
|
width: o ? o * t : void 0,
|
|
486
487
|
className: "dv-pdf-page",
|
|
@@ -491,13 +492,13 @@ function tt({ url: e, scale: t, onNativeFallback: n }) {
|
|
|
491
492
|
});
|
|
492
493
|
}
|
|
493
494
|
tt.propTypes = {
|
|
494
|
-
url:
|
|
495
|
-
scale:
|
|
496
|
-
onNativeFallback:
|
|
495
|
+
url: T.string.isRequired,
|
|
496
|
+
scale: T.number.isRequired,
|
|
497
|
+
onNativeFallback: T.func
|
|
497
498
|
};
|
|
498
499
|
function nt({ url: e }) {
|
|
499
|
-
let t =
|
|
500
|
-
return
|
|
500
|
+
let t = h(null), [n, r] = g("loading");
|
|
501
|
+
return p(() => {
|
|
501
502
|
let n = !1;
|
|
502
503
|
return fetch(e).then((e) => {
|
|
503
504
|
if (!e.ok) throw Error(`HTTP ${e.status}`);
|
|
@@ -516,21 +517,21 @@ function nt({ url: e }) {
|
|
|
516
517
|
}), () => {
|
|
517
518
|
n = !0;
|
|
518
519
|
};
|
|
519
|
-
}, [e]), n === "error" ? /* @__PURE__ */
|
|
520
|
+
}, [e]), n === "error" ? /* @__PURE__ */ C(k, { label: "This document could not be displayed." }) : /* @__PURE__ */ w("div", {
|
|
520
521
|
className: "dv-docx-scroll",
|
|
521
|
-
children: [n === "loading" && /* @__PURE__ */
|
|
522
|
+
children: [n === "loading" && /* @__PURE__ */ C("div", {
|
|
522
523
|
className: "dv-center",
|
|
523
|
-
children: /* @__PURE__ */
|
|
524
|
-
}), /* @__PURE__ */
|
|
524
|
+
children: /* @__PURE__ */ C(te, {})
|
|
525
|
+
}), /* @__PURE__ */ C("div", {
|
|
525
526
|
ref: t,
|
|
526
527
|
style: { visibility: n === "ready" ? "visible" : "hidden" }
|
|
527
528
|
})]
|
|
528
529
|
});
|
|
529
530
|
}
|
|
530
|
-
nt.propTypes = { url:
|
|
531
|
+
nt.propTypes = { url: T.string.isRequired };
|
|
531
532
|
function rt({ url: e, content: t = "" }) {
|
|
532
|
-
let [n, r] =
|
|
533
|
-
return
|
|
533
|
+
let [n, r] = g(null), [i, a] = g("loading");
|
|
534
|
+
return p(() => {
|
|
534
535
|
if (t) return;
|
|
535
536
|
let n = !1;
|
|
536
537
|
return fetch(e).then((e) => {
|
|
@@ -541,33 +542,33 @@ function rt({ url: e, content: t = "" }) {
|
|
|
541
542
|
}).catch(() => !n && a("error")), () => {
|
|
542
543
|
n = !0;
|
|
543
544
|
};
|
|
544
|
-
}, [t, e]), t ? /* @__PURE__ */
|
|
545
|
+
}, [t, e]), t ? /* @__PURE__ */ C("pre", {
|
|
545
546
|
className: "dv-text",
|
|
546
547
|
children: t
|
|
547
|
-
}) : i === "loading" ? /* @__PURE__ */
|
|
548
|
+
}) : i === "loading" ? /* @__PURE__ */ C("div", {
|
|
548
549
|
className: "dv-center",
|
|
549
|
-
children: /* @__PURE__ */
|
|
550
|
-
}) : i === "error" ? /* @__PURE__ */
|
|
550
|
+
children: /* @__PURE__ */ C(te, {})
|
|
551
|
+
}) : i === "error" ? /* @__PURE__ */ C(k, { label: "This file could not be displayed." }) : /* @__PURE__ */ C("pre", {
|
|
551
552
|
className: "dv-text",
|
|
552
553
|
children: n
|
|
553
554
|
});
|
|
554
555
|
}
|
|
555
556
|
rt.propTypes = {
|
|
556
|
-
url:
|
|
557
|
-
content:
|
|
557
|
+
url: T.string,
|
|
558
|
+
content: T.string
|
|
558
559
|
};
|
|
559
560
|
function it({ content: e }) {
|
|
560
|
-
return /* @__PURE__ */
|
|
561
|
+
return /* @__PURE__ */ C("div", {
|
|
561
562
|
className: "dv-html",
|
|
562
|
-
dangerouslySetInnerHTML: { __html:
|
|
563
|
+
dangerouslySetInnerHTML: { __html: m(() => Ee.sanitize(e), [e]) }
|
|
563
564
|
});
|
|
564
565
|
}
|
|
565
|
-
it.propTypes = { content:
|
|
566
|
+
it.propTypes = { content: T.string.isRequired };
|
|
566
567
|
function at({ url: e, name: t, scale: n }) {
|
|
567
|
-
let [r, i] =
|
|
568
|
-
return r ? /* @__PURE__ */
|
|
568
|
+
let [r, i] = g(!1);
|
|
569
|
+
return r ? /* @__PURE__ */ C(k, { label: "This image could not be displayed." }) : /* @__PURE__ */ C("div", {
|
|
569
570
|
className: "dv-image-wrap",
|
|
570
|
-
children: /* @__PURE__ */
|
|
571
|
+
children: /* @__PURE__ */ C("img", {
|
|
571
572
|
className: "dv-image",
|
|
572
573
|
src: e,
|
|
573
574
|
alt: t,
|
|
@@ -577,15 +578,15 @@ function at({ url: e, name: t, scale: n }) {
|
|
|
577
578
|
});
|
|
578
579
|
}
|
|
579
580
|
at.propTypes = {
|
|
580
|
-
url:
|
|
581
|
-
name:
|
|
582
|
-
scale:
|
|
581
|
+
url: T.string.isRequired,
|
|
582
|
+
name: T.string.isRequired,
|
|
583
|
+
scale: T.number.isRequired
|
|
583
584
|
};
|
|
584
585
|
function ot({ url: e, name: t }) {
|
|
585
|
-
let [n, r] =
|
|
586
|
-
return n ? /* @__PURE__ */
|
|
586
|
+
let [n, r] = g(!1);
|
|
587
|
+
return n ? /* @__PURE__ */ C(k, { label: "This video could not be played." }) : /* @__PURE__ */ C("div", {
|
|
587
588
|
className: "dv-video-wrap",
|
|
588
|
-
children: /* @__PURE__ */
|
|
589
|
+
children: /* @__PURE__ */ C("video", {
|
|
589
590
|
className: "dv-video",
|
|
590
591
|
src: e,
|
|
591
592
|
title: t,
|
|
@@ -597,38 +598,38 @@ function ot({ url: e, name: t }) {
|
|
|
597
598
|
});
|
|
598
599
|
}
|
|
599
600
|
ot.propTypes = {
|
|
600
|
-
url:
|
|
601
|
-
name:
|
|
601
|
+
url: T.string.isRequired,
|
|
602
|
+
name: T.string.isRequired
|
|
602
603
|
};
|
|
603
|
-
function
|
|
604
|
-
return /* @__PURE__ */
|
|
604
|
+
function k({ label: e }) {
|
|
605
|
+
return /* @__PURE__ */ w("div", {
|
|
605
606
|
className: "dv-center dv-fallback",
|
|
606
607
|
children: [
|
|
607
|
-
/* @__PURE__ */
|
|
608
|
-
/* @__PURE__ */
|
|
609
|
-
/* @__PURE__ */
|
|
608
|
+
/* @__PURE__ */ C(ce, { className: "dv-fallback-icon" }),
|
|
609
|
+
/* @__PURE__ */ C("p", { children: e }),
|
|
610
|
+
/* @__PURE__ */ C("span", {
|
|
610
611
|
className: "dv-fallback-hint",
|
|
611
612
|
children: "Use the download button to open it."
|
|
612
613
|
})
|
|
613
614
|
]
|
|
614
615
|
});
|
|
615
616
|
}
|
|
616
|
-
|
|
617
|
+
k.propTypes = { label: T.string.isRequired };
|
|
617
618
|
function st({ docs: e, initialIndex: t, onClose: n }) {
|
|
618
|
-
let r = e.length, [i, a] =
|
|
619
|
+
let r = e.length, [i, a] = g(Math.min(Math.max(t, 0), Math.max(0, r - 1))), [o, s] = g(1), [c, l] = g(!1), u = e[i], d = u ? $e(u) : "unknown", m = d === "pdf" && !c || d === "image", h = f((e) => {
|
|
619
620
|
a(e), s(1), l(!1);
|
|
620
|
-
}, []), _ =
|
|
621
|
+
}, []), _ = f(() => h(Math.max(0, i - 1)), [i, h]), v = f(() => h(Math.min(r - 1, i + 1)), [
|
|
621
622
|
i,
|
|
622
623
|
r,
|
|
623
|
-
|
|
624
|
+
h
|
|
624
625
|
]);
|
|
625
|
-
|
|
626
|
+
p(() => {
|
|
626
627
|
let e = (e) => {
|
|
627
628
|
e.target?.tagName !== "VIDEO" && (e.key === "ArrowLeft" ? _() : e.key === "ArrowRight" && v());
|
|
628
629
|
};
|
|
629
630
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
630
631
|
}, [_, v]);
|
|
631
|
-
let y =
|
|
632
|
+
let y = f(async (e) => {
|
|
632
633
|
if (e) try {
|
|
633
634
|
let t;
|
|
634
635
|
if (e.content) {
|
|
@@ -642,47 +643,47 @@ function st({ docs: e, initialIndex: t, onClose: n }) {
|
|
|
642
643
|
let n = URL.createObjectURL(t), r = document.createElement("a");
|
|
643
644
|
r.href = n, r.download = e.name || "document", document.body.appendChild(r), r.click(), r.remove(), URL.revokeObjectURL(n);
|
|
644
645
|
} catch {
|
|
645
|
-
|
|
646
|
+
S.info("Opening file in a new tab…"), e.url && window.open(e.url, "_blank", "noopener,noreferrer");
|
|
646
647
|
}
|
|
647
648
|
}, []);
|
|
648
|
-
function
|
|
649
|
-
if (!u) return /* @__PURE__ */
|
|
650
|
-
switch (
|
|
651
|
-
case "pdf": return /* @__PURE__ */
|
|
649
|
+
function b() {
|
|
650
|
+
if (!u) return /* @__PURE__ */ C(k, { label: "No document to preview." });
|
|
651
|
+
switch (d) {
|
|
652
|
+
case "pdf": return /* @__PURE__ */ C(tt, {
|
|
652
653
|
url: u.url,
|
|
653
654
|
scale: o,
|
|
654
655
|
onNativeFallback: () => l(!0)
|
|
655
656
|
}, u.key);
|
|
656
|
-
case "docx": return /* @__PURE__ */
|
|
657
|
-
case "image": return /* @__PURE__ */
|
|
657
|
+
case "docx": return /* @__PURE__ */ C(nt, { url: u.url }, u.key);
|
|
658
|
+
case "image": return /* @__PURE__ */ C(at, {
|
|
658
659
|
url: u.url,
|
|
659
660
|
name: u.name,
|
|
660
661
|
scale: o
|
|
661
662
|
}, u.key);
|
|
662
|
-
case "text": return /* @__PURE__ */
|
|
663
|
+
case "text": return /* @__PURE__ */ C(rt, {
|
|
663
664
|
url: u.url,
|
|
664
665
|
content: u.content
|
|
665
666
|
}, u.key);
|
|
666
|
-
case "html": return /* @__PURE__ */
|
|
667
|
-
case "video": return /* @__PURE__ */
|
|
667
|
+
case "html": return /* @__PURE__ */ C(it, { content: u.content }, u.key);
|
|
668
|
+
case "video": return /* @__PURE__ */ C(ot, {
|
|
668
669
|
url: u.url,
|
|
669
670
|
name: u.name
|
|
670
671
|
}, u.key);
|
|
671
|
-
default: return /* @__PURE__ */
|
|
672
|
+
default: return /* @__PURE__ */ C(k, { label: "Preview is not available for this file type." });
|
|
672
673
|
}
|
|
673
674
|
}
|
|
674
|
-
return /* @__PURE__ */
|
|
675
|
+
return /* @__PURE__ */ w("div", {
|
|
675
676
|
className: "dv-root",
|
|
676
677
|
children: [
|
|
677
|
-
/* @__PURE__ */
|
|
678
|
+
/* @__PURE__ */ w("div", {
|
|
678
679
|
className: "dv-toolbar",
|
|
679
|
-
children: [/* @__PURE__ */
|
|
680
|
+
children: [/* @__PURE__ */ w("div", {
|
|
680
681
|
className: "dv-title",
|
|
681
682
|
title: u?.name,
|
|
682
|
-
children: [/* @__PURE__ */
|
|
683
|
+
children: [/* @__PURE__ */ C("span", {
|
|
683
684
|
className: "dv-title-text",
|
|
684
685
|
children: u?.name || "Document"
|
|
685
|
-
}), r > 1 && /* @__PURE__ */
|
|
686
|
+
}), r > 1 && /* @__PURE__ */ w("span", {
|
|
686
687
|
className: "dv-counter",
|
|
687
688
|
children: [
|
|
688
689
|
i + 1,
|
|
@@ -690,88 +691,88 @@ function st({ docs: e, initialIndex: t, onClose: n }) {
|
|
|
690
691
|
r
|
|
691
692
|
]
|
|
692
693
|
})]
|
|
693
|
-
}), /* @__PURE__ */
|
|
694
|
+
}), /* @__PURE__ */ w("div", {
|
|
694
695
|
className: "dv-actions",
|
|
695
696
|
children: [
|
|
696
|
-
m && /* @__PURE__ */
|
|
697
|
-
/* @__PURE__ */
|
|
697
|
+
m && /* @__PURE__ */ w(me, { children: [
|
|
698
|
+
/* @__PURE__ */ C(x, {
|
|
698
699
|
title: "Zoom out",
|
|
699
|
-
children: /* @__PURE__ */
|
|
700
|
+
children: /* @__PURE__ */ C("button", {
|
|
700
701
|
type: "button",
|
|
701
702
|
className: "dv-icon-btn",
|
|
702
703
|
onClick: () => s((e) => Math.max(qe, +(e - Ke).toFixed(2))),
|
|
703
704
|
disabled: o <= qe,
|
|
704
|
-
children: /* @__PURE__ */
|
|
705
|
+
children: /* @__PURE__ */ C(pe, {})
|
|
705
706
|
})
|
|
706
707
|
}),
|
|
707
|
-
/* @__PURE__ */
|
|
708
|
+
/* @__PURE__ */ w("span", {
|
|
708
709
|
className: "dv-zoom-label",
|
|
709
710
|
children: [Math.round(o * 100), "%"]
|
|
710
711
|
}),
|
|
711
|
-
/* @__PURE__ */
|
|
712
|
+
/* @__PURE__ */ C(x, {
|
|
712
713
|
title: "Zoom in",
|
|
713
|
-
children: /* @__PURE__ */
|
|
714
|
+
children: /* @__PURE__ */ C("button", {
|
|
714
715
|
type: "button",
|
|
715
716
|
className: "dv-icon-btn",
|
|
716
717
|
onClick: () => s((e) => Math.min(Je, +(e + Ke).toFixed(2))),
|
|
717
718
|
disabled: o >= Je,
|
|
718
|
-
children: /* @__PURE__ */
|
|
719
|
+
children: /* @__PURE__ */ C(fe, {})
|
|
719
720
|
})
|
|
720
721
|
}),
|
|
721
|
-
/* @__PURE__ */
|
|
722
|
+
/* @__PURE__ */ C("span", { className: "dv-divider" })
|
|
722
723
|
] }),
|
|
723
|
-
/* @__PURE__ */
|
|
724
|
+
/* @__PURE__ */ C(x, {
|
|
724
725
|
title: "Download",
|
|
725
|
-
children: /* @__PURE__ */
|
|
726
|
+
children: /* @__PURE__ */ C("button", {
|
|
726
727
|
type: "button",
|
|
727
728
|
className: "dv-icon-btn dv-download",
|
|
728
729
|
onClick: () => y(u),
|
|
729
|
-
children: /* @__PURE__ */
|
|
730
|
+
children: /* @__PURE__ */ C(ae, {})
|
|
730
731
|
})
|
|
731
732
|
}),
|
|
732
|
-
/* @__PURE__ */
|
|
733
|
+
/* @__PURE__ */ C(x, {
|
|
733
734
|
title: "Close",
|
|
734
|
-
children: /* @__PURE__ */
|
|
735
|
+
children: /* @__PURE__ */ C("button", {
|
|
735
736
|
type: "button",
|
|
736
737
|
className: "dv-icon-btn",
|
|
737
738
|
onClick: n,
|
|
738
|
-
children: /* @__PURE__ */
|
|
739
|
+
children: /* @__PURE__ */ C(re, {})
|
|
739
740
|
})
|
|
740
741
|
})
|
|
741
742
|
]
|
|
742
743
|
})]
|
|
743
744
|
}),
|
|
744
|
-
/* @__PURE__ */
|
|
745
|
+
/* @__PURE__ */ w("div", {
|
|
745
746
|
className: "dv-stage",
|
|
746
747
|
children: [
|
|
747
|
-
r > 1 && /* @__PURE__ */
|
|
748
|
+
r > 1 && /* @__PURE__ */ C("button", {
|
|
748
749
|
type: "button",
|
|
749
750
|
className: "dv-nav dv-nav--prev",
|
|
750
751
|
onClick: _,
|
|
751
752
|
disabled: i === 0,
|
|
752
753
|
"aria-label": "Previous document",
|
|
753
|
-
children: /* @__PURE__ */
|
|
754
|
+
children: /* @__PURE__ */ C(le, {})
|
|
754
755
|
}),
|
|
755
|
-
/* @__PURE__ */
|
|
756
|
+
/* @__PURE__ */ C("div", {
|
|
756
757
|
className: "dv-canvas",
|
|
757
|
-
children:
|
|
758
|
+
children: b()
|
|
758
759
|
}),
|
|
759
|
-
r > 1 && /* @__PURE__ */
|
|
760
|
+
r > 1 && /* @__PURE__ */ C("button", {
|
|
760
761
|
type: "button",
|
|
761
762
|
className: "dv-nav dv-nav--next",
|
|
762
763
|
onClick: v,
|
|
763
764
|
disabled: i === r - 1,
|
|
764
765
|
"aria-label": "Next document",
|
|
765
|
-
children: /* @__PURE__ */
|
|
766
|
+
children: /* @__PURE__ */ C(de, {})
|
|
766
767
|
})
|
|
767
768
|
]
|
|
768
769
|
}),
|
|
769
|
-
r > 1 && /* @__PURE__ */
|
|
770
|
+
r > 1 && /* @__PURE__ */ C("div", {
|
|
770
771
|
className: "dv-dots",
|
|
771
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
772
|
+
children: e.map((e, t) => /* @__PURE__ */ C("button", {
|
|
772
773
|
type: "button",
|
|
773
774
|
className: `dv-dot${t === i ? " dv-dot--active" : ""}`,
|
|
774
|
-
onClick: () =>
|
|
775
|
+
onClick: () => h(t),
|
|
775
776
|
"aria-label": `Go to document ${t + 1}`
|
|
776
777
|
}, e.key))
|
|
777
778
|
})
|
|
@@ -779,20 +780,20 @@ function st({ docs: e, initialIndex: t, onClose: n }) {
|
|
|
779
780
|
});
|
|
780
781
|
}
|
|
781
782
|
st.propTypes = {
|
|
782
|
-
docs:
|
|
783
|
-
initialIndex:
|
|
784
|
-
onClose:
|
|
783
|
+
docs: T.arrayOf(T.object).isRequired,
|
|
784
|
+
initialIndex: T.number.isRequired,
|
|
785
|
+
onClose: T.func.isRequired
|
|
785
786
|
};
|
|
786
787
|
function ct({ documents: e, open: t, onClose: n, initialIndex: r = 0, inline: i = !1 }) {
|
|
787
|
-
let a =
|
|
788
|
-
return i ? /* @__PURE__ */
|
|
788
|
+
let a = m(() => et(e), [e]);
|
|
789
|
+
return i ? /* @__PURE__ */ C("div", {
|
|
789
790
|
className: "dv-root--inline",
|
|
790
|
-
children: /* @__PURE__ */
|
|
791
|
+
children: /* @__PURE__ */ C(st, {
|
|
791
792
|
docs: a,
|
|
792
793
|
initialIndex: r,
|
|
793
794
|
onClose: n ?? (() => {})
|
|
794
795
|
})
|
|
795
|
-
}) : /* @__PURE__ */ b
|
|
796
|
+
}) : /* @__PURE__ */ C(b, {
|
|
796
797
|
open: t,
|
|
797
798
|
onCancel: n,
|
|
798
799
|
footer: null,
|
|
@@ -810,7 +811,7 @@ function ct({ documents: e, open: t, onClose: n, initialIndex: r = 0, inline: i
|
|
|
810
811
|
body: { padding: 0 }
|
|
811
812
|
},
|
|
812
813
|
destroyOnHidden: !0,
|
|
813
|
-
children: /* @__PURE__ */
|
|
814
|
+
children: /* @__PURE__ */ C(st, {
|
|
814
815
|
docs: a,
|
|
815
816
|
initialIndex: r,
|
|
816
817
|
onClose: n
|
|
@@ -818,11 +819,11 @@ function ct({ documents: e, open: t, onClose: n, initialIndex: r = 0, inline: i
|
|
|
818
819
|
});
|
|
819
820
|
}
|
|
820
821
|
ct.propTypes = {
|
|
821
|
-
documents:
|
|
822
|
-
open:
|
|
823
|
-
onClose:
|
|
824
|
-
initialIndex:
|
|
825
|
-
inline:
|
|
822
|
+
documents: T.arrayOf(T.oneOfType([T.string, T.object])).isRequired,
|
|
823
|
+
open: T.bool,
|
|
824
|
+
onClose: T.func,
|
|
825
|
+
initialIndex: T.number,
|
|
826
|
+
inline: T.bool
|
|
826
827
|
};
|
|
827
828
|
//#endregion
|
|
828
829
|
//#region src/utils/modulePath.js
|
|
@@ -838,35 +839,35 @@ function lt(e) {
|
|
|
838
839
|
nestedPath: r.map((e) => e.trim()).filter(Boolean).join(".")
|
|
839
840
|
};
|
|
840
841
|
}
|
|
841
|
-
function
|
|
842
|
+
function ut(e) {
|
|
842
843
|
return lt(e).baseModule;
|
|
843
844
|
}
|
|
844
845
|
//#endregion
|
|
845
846
|
//#region src/services/moduleDataApi.js
|
|
846
|
-
var
|
|
847
|
-
function
|
|
847
|
+
var dt = "test-flows", ft = "lms-flows";
|
|
848
|
+
function pt(e) {
|
|
848
849
|
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);
|
|
849
850
|
return t.includes("dice") ? "dice" : t.includes("internal") ? "internal" : t[0] || "";
|
|
850
851
|
}
|
|
851
|
-
function
|
|
852
|
+
function mt(...e) {
|
|
852
853
|
for (let t of e) {
|
|
853
854
|
let e = Number(t);
|
|
854
855
|
if (Number.isFinite(e)) return e;
|
|
855
856
|
}
|
|
856
857
|
}
|
|
857
|
-
function
|
|
858
|
+
function ht(e, t, n, r = "") {
|
|
858
859
|
let i = e?.count, a = t?.count, o = String(r ?? "").trim().toLowerCase();
|
|
859
860
|
if (i && typeof i == "object") {
|
|
860
|
-
let e =
|
|
861
|
+
let e = mt(o ? i[o] : void 0, i.total, i.searchCount, i.count);
|
|
861
862
|
if (e !== void 0) return e;
|
|
862
863
|
}
|
|
863
864
|
if (a && typeof a == "object") {
|
|
864
|
-
let e =
|
|
865
|
+
let e = mt(o ? a[o] : void 0, a.total, a.searchCount, a.count);
|
|
865
866
|
if (e !== void 0) return e;
|
|
866
867
|
}
|
|
867
|
-
return
|
|
868
|
+
return mt(e?.total, typeof i == "object" ? void 0 : i, e?.totalCount, t?.total, typeof a == "object" ? void 0 : a, t?.totalCount, n.length) ?? 0;
|
|
868
869
|
}
|
|
869
|
-
function
|
|
870
|
+
function gt(e, t) {
|
|
870
871
|
let n = {};
|
|
871
872
|
return [e?.count, t?.count].forEach((e) => {
|
|
872
873
|
!e || typeof e != "object" || Object.entries(e).forEach(([e, t]) => {
|
|
@@ -875,9 +876,9 @@ function ht(e, t) {
|
|
|
875
876
|
});
|
|
876
877
|
}), n;
|
|
877
878
|
}
|
|
878
|
-
async function
|
|
879
|
+
async function _t(e, t, n = "", i = 50, o = 0, s = {}) {
|
|
879
880
|
let c = new URLSearchParams({
|
|
880
|
-
module:
|
|
881
|
+
module: ut(e),
|
|
881
882
|
field: t,
|
|
882
883
|
value: n,
|
|
883
884
|
limit: String(i),
|
|
@@ -885,9 +886,9 @@ async function gt(e, t, n = "", i = 50, o = 0, s = {}) {
|
|
|
885
886
|
});
|
|
886
887
|
return s.dataSource && c.set("dataSource", s.dataSource), s.masterName && c.set("masterName", s.masterName), s.groupName && c.set("groupName", s.groupName), a(r, `/filter-dropdown-values?${c}`);
|
|
887
888
|
}
|
|
888
|
-
async function
|
|
889
|
+
async function vt(e, t = 10, i = 0, a = {}) {
|
|
889
890
|
let { scope: o = "", sort: s = "", sortDir: c = "", filters: l = [] } = a;
|
|
890
|
-
if (e ===
|
|
891
|
+
if (e === dt) {
|
|
891
892
|
let { getTestFlows: e } = await import("./index.js").then((e) => e.t), n = await e({
|
|
892
893
|
limit: t,
|
|
893
894
|
offset: i
|
|
@@ -904,7 +905,7 @@ async function _t(e, t = 10, i = 0, a = {}) {
|
|
|
904
905
|
}]
|
|
905
906
|
};
|
|
906
907
|
}
|
|
907
|
-
if (e ===
|
|
908
|
+
if (e === ft) {
|
|
908
909
|
let { getLmsFlows: e } = await import("./index.js").then((e) => e.t), n = await e({
|
|
909
910
|
limit: t,
|
|
910
911
|
offset: i
|
|
@@ -922,20 +923,20 @@ async function _t(e, t = 10, i = 0, a = {}) {
|
|
|
922
923
|
};
|
|
923
924
|
}
|
|
924
925
|
let u = new URLSearchParams({
|
|
925
|
-
module:
|
|
926
|
+
module: ut(e),
|
|
926
927
|
limit: String(t),
|
|
927
928
|
offset: String(i)
|
|
928
929
|
}), d = String(o ?? "").trim();
|
|
929
930
|
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(r, `/module-data-list?${u.toString()}`);
|
|
930
931
|
}
|
|
931
|
-
async function
|
|
932
|
-
let { limit: o = 10, offset: s = 0 } = i, { sort: c = "", sortDir: l = "", scope: u = "" } = a, d =
|
|
933
|
-
f.append("module",
|
|
932
|
+
async function yt(e, t = {}, i = {}, a = {}) {
|
|
933
|
+
let { limit: o = 10, offset: s = 0 } = i, { sort: c = "", sortDir: l = "", scope: u = "" } = a, d = pt(u || t.selectedSource), f = new URLSearchParams();
|
|
934
|
+
f.append("module", ut(e)), f.append("limit", String(o)), f.append("offset", String(s)), d && (f.set("scope", d), console.log("[searchModuleData] Adding scope to query:", d)), c && f.set("sort", c), l && f.set("sortDir", l), console.log("[searchModuleData] Final query string:", f.toString()), Object.entries(t).forEach(([e, t]) => {
|
|
934
935
|
if (t == null || t === "") return;
|
|
935
936
|
let n = t;
|
|
936
937
|
n = typeof t == "object" ? t.value ?? t.label ?? t.name ?? String(t) : String(t), f.append(e, n);
|
|
937
938
|
});
|
|
938
|
-
let p = await n(r, `/module-data-list?${f.toString()}`), m = p?.data ?? p, h = Array.isArray(m) ? m : m?.rows ?? m?.records ?? m?.items ?? m?.list ?? m?.data ?? [], g =
|
|
939
|
+
let p = await n(r, `/module-data-list?${f.toString()}`), m = p?.data ?? p, h = Array.isArray(m) ? m : m?.rows ?? m?.records ?? m?.items ?? m?.list ?? m?.data ?? [], g = ht(p, m, h, d), _ = gt(p, m);
|
|
939
940
|
d && _[d] === void 0 && Number.isFinite(g) && (_[d] = g);
|
|
940
941
|
let v = h.some((e) => [
|
|
941
942
|
e?.sourceType,
|
|
@@ -948,9 +949,9 @@ async function vt(e, t = {}, i = {}, a = {}) {
|
|
|
948
949
|
let { transformDiceResponseToInternalFormat: e } = await import("./diceCandidateMapper-CB9x_ZiS.js");
|
|
949
950
|
y = e(p, p)?.data?.data ?? h;
|
|
950
951
|
} catch (e) {
|
|
951
|
-
console.error("[searchModuleData] Dice transformation failed:", e), y = h.map(
|
|
952
|
+
console.error("[searchModuleData] Dice transformation failed:", e), y = h.map(St);
|
|
952
953
|
}
|
|
953
|
-
else y = Array.isArray(h) ? h.map(
|
|
954
|
+
else y = Array.isArray(h) ? h.map(St) : [];
|
|
954
955
|
return {
|
|
955
956
|
rows: y,
|
|
956
957
|
total: Number(g) || 0,
|
|
@@ -963,10 +964,10 @@ async function vt(e, t = {}, i = {}, a = {}) {
|
|
|
963
964
|
columnActions: m?.columnActions ?? []
|
|
964
965
|
};
|
|
965
966
|
}
|
|
966
|
-
function
|
|
967
|
+
function bt(e, t) {
|
|
967
968
|
return String(t).split(".").reduce((e, t) => e?.[t], e);
|
|
968
969
|
}
|
|
969
|
-
function
|
|
970
|
+
function xt(e, t, n) {
|
|
970
971
|
let r = String(t).split(".").filter(Boolean);
|
|
971
972
|
if (!r.length) return e;
|
|
972
973
|
let i = { ...e }, a = i, o = e;
|
|
@@ -975,7 +976,7 @@ function bt(e, t, n) {
|
|
|
975
976
|
a[e] = n, a = n, o = t;
|
|
976
977
|
}), a[r[r.length - 1]] = n, i;
|
|
977
978
|
}
|
|
978
|
-
function
|
|
979
|
+
function St(e) {
|
|
979
980
|
if (!e || typeof e != "object") return e;
|
|
980
981
|
let t = [
|
|
981
982
|
"skills",
|
|
@@ -985,18 +986,18 @@ function xt(e) {
|
|
|
985
986
|
"customFields.diceProfileData.skills"
|
|
986
987
|
], n = e, r = null;
|
|
987
988
|
if (t.forEach((e) => {
|
|
988
|
-
let t =
|
|
989
|
+
let t = bt(n, e);
|
|
989
990
|
if (t == null) return;
|
|
990
|
-
let i =
|
|
991
|
-
i.length === 0 && Array.isArray(t) && t.length > 0 || (r ??= i, n =
|
|
992
|
-
}), r &&
|
|
991
|
+
let i = l(t);
|
|
992
|
+
i.length === 0 && Array.isArray(t) && t.length > 0 || (r ??= i, n = xt(n, e, i));
|
|
993
|
+
}), r && bt(n, "skills") === void 0 && (n = xt(n, "skills", r)), [
|
|
993
994
|
n?.sourceType,
|
|
994
995
|
n?.profileSource,
|
|
995
996
|
n?.selectedSource,
|
|
996
997
|
n?.customFields?.sourceType,
|
|
997
998
|
n?.customFields?.profileSource
|
|
998
999
|
].flat().some((e) => String(e ?? "").trim().toLowerCase() === "dice") || n?.customFields?.diceProfileData) {
|
|
999
|
-
let e =
|
|
1000
|
+
let e = c(n), t = n?.candidateId ?? n?.customFields?.diceProfileData?.candidateId ?? "";
|
|
1000
1001
|
n = {
|
|
1001
1002
|
...n,
|
|
1002
1003
|
id: n?.id ?? e,
|
|
@@ -1008,11 +1009,11 @@ function xt(e) {
|
|
|
1008
1009
|
}
|
|
1009
1010
|
//#endregion
|
|
1010
1011
|
//#region src/services/addFormApi.js
|
|
1011
|
-
function
|
|
1012
|
+
function Ct(e) {
|
|
1012
1013
|
let t = e?.data ?? e;
|
|
1013
1014
|
return Array.isArray(t) ? t : Array.isArray(t?.groups) ? t.groups : Array.isArray(e?.groups) ? e.groups : [];
|
|
1014
1015
|
}
|
|
1015
|
-
async function
|
|
1016
|
+
async function wt({ module: e, id: t, action: n, clientId: a, region: o, group: s } = {}) {
|
|
1016
1017
|
if (!e) throw Error("module is required to fetch form groups");
|
|
1017
1018
|
let c = await i(), l = new URLSearchParams({ module: e });
|
|
1018
1019
|
t && l.set("id", t), n && l.set("action", n), a && l.set("clientId", a), o && l.set("region", o), s && l.set("group", s);
|
|
@@ -1024,9 +1025,9 @@ async function Ct({ module: e, id: t, action: n, clientId: a, region: o, group:
|
|
|
1024
1025
|
}
|
|
1025
1026
|
});
|
|
1026
1027
|
if (!u.ok) throw Error(`API ${u.status}: ${u.statusText}`);
|
|
1027
|
-
return
|
|
1028
|
+
return Ct(await u.json());
|
|
1028
1029
|
}
|
|
1029
|
-
async function
|
|
1030
|
+
async function Tt(e, t) {
|
|
1030
1031
|
let n = await i(), a = await fetch(`${r}/module/create?module=${encodeURIComponent(e)}`, {
|
|
1031
1032
|
method: "POST",
|
|
1032
1033
|
headers: { Authorization: `Bearer ${n}` },
|
|
@@ -1042,7 +1043,7 @@ async function wt(e, t) {
|
|
|
1042
1043
|
}
|
|
1043
1044
|
//#endregion
|
|
1044
1045
|
//#region src/services/adminApi.js
|
|
1045
|
-
var
|
|
1046
|
+
var A = "/admin/field-config", j = [
|
|
1046
1047
|
{
|
|
1047
1048
|
key: "clients",
|
|
1048
1049
|
apiModule: "clients"
|
|
@@ -1072,17 +1073,17 @@ var O = "/admin/field-config", k = [
|
|
|
1072
1073
|
apiModule: "payroll"
|
|
1073
1074
|
}
|
|
1074
1075
|
];
|
|
1075
|
-
function
|
|
1076
|
+
function M(...e) {
|
|
1076
1077
|
return e.find(Array.isArray) ?? [];
|
|
1077
1078
|
}
|
|
1078
|
-
function
|
|
1079
|
+
function N(e, t, n) {
|
|
1079
1080
|
return t.map((t) => e?.[t]).find((e) => e != null && e !== "") ?? n;
|
|
1080
1081
|
}
|
|
1081
|
-
function
|
|
1082
|
+
function Et(e, t) {
|
|
1082
1083
|
return e?.total ?? e?.totalCount ?? e?.count ?? e?.recordsTotal ?? e?.meta?.total ?? e?.pagination?.total ?? t.length;
|
|
1083
1084
|
}
|
|
1084
|
-
function
|
|
1085
|
-
let n =
|
|
1085
|
+
function Dt(e, t) {
|
|
1086
|
+
let n = N(e, [
|
|
1086
1087
|
"label",
|
|
1087
1088
|
"Label",
|
|
1088
1089
|
"fieldName",
|
|
@@ -1090,7 +1091,7 @@ function Et(e, t) {
|
|
|
1090
1091
|
"name",
|
|
1091
1092
|
"fieldLabel",
|
|
1092
1093
|
"value"
|
|
1093
|
-
], `Field ${t + 1}`), r =
|
|
1094
|
+
], `Field ${t + 1}`), r = N(e, [
|
|
1094
1095
|
"field",
|
|
1095
1096
|
"Field",
|
|
1096
1097
|
"fieldKey",
|
|
@@ -1099,7 +1100,7 @@ function Et(e, t) {
|
|
|
1099
1100
|
"value",
|
|
1100
1101
|
"fieldName",
|
|
1101
1102
|
"name"
|
|
1102
|
-
], n), i =
|
|
1103
|
+
], n), i = N(e, [
|
|
1103
1104
|
"isVisible",
|
|
1104
1105
|
"is_visible",
|
|
1105
1106
|
"visible",
|
|
@@ -1107,14 +1108,14 @@ function Et(e, t) {
|
|
|
1107
1108
|
"is_show",
|
|
1108
1109
|
"isShow",
|
|
1109
1110
|
"enabled"
|
|
1110
|
-
], !0), a =
|
|
1111
|
+
], !0), a = N(e, [
|
|
1111
1112
|
"ismandatory",
|
|
1112
1113
|
"isMandatory",
|
|
1113
1114
|
"is_mandatory",
|
|
1114
1115
|
"mandatory",
|
|
1115
1116
|
"required",
|
|
1116
1117
|
"req"
|
|
1117
|
-
], !1), o =
|
|
1118
|
+
], !1), o = N(e, [
|
|
1118
1119
|
"order",
|
|
1119
1120
|
"Order",
|
|
1120
1121
|
"sortOrder",
|
|
@@ -1124,7 +1125,7 @@ function Et(e, t) {
|
|
|
1124
1125
|
...e,
|
|
1125
1126
|
fieldKey: r,
|
|
1126
1127
|
fieldName: n,
|
|
1127
|
-
type:
|
|
1128
|
+
type: N(e, ["type", "Type"], "text"),
|
|
1128
1129
|
isVisible: typeof i == "string" ? ![
|
|
1129
1130
|
"false",
|
|
1130
1131
|
"0",
|
|
@@ -1167,12 +1168,12 @@ function Et(e, t) {
|
|
|
1167
1168
|
groupName: e.groupName ?? ""
|
|
1168
1169
|
};
|
|
1169
1170
|
}
|
|
1170
|
-
function
|
|
1171
|
+
function Ot(e) {
|
|
1171
1172
|
if (typeof e == "string") return {
|
|
1172
1173
|
key: e,
|
|
1173
1174
|
apiModule: e
|
|
1174
1175
|
};
|
|
1175
|
-
let t =
|
|
1176
|
+
let t = N(e, [
|
|
1176
1177
|
"key",
|
|
1177
1178
|
"moduleKey",
|
|
1178
1179
|
"value",
|
|
@@ -1184,7 +1185,7 @@ function Dt(e) {
|
|
|
1184
1185
|
], "");
|
|
1185
1186
|
return t ? {
|
|
1186
1187
|
key: t,
|
|
1187
|
-
apiModule:
|
|
1188
|
+
apiModule: N(e, [
|
|
1188
1189
|
"apiModule",
|
|
1189
1190
|
"api_module",
|
|
1190
1191
|
"module",
|
|
@@ -1196,38 +1197,38 @@ function Dt(e) {
|
|
|
1196
1197
|
], t)
|
|
1197
1198
|
} : null;
|
|
1198
1199
|
}
|
|
1199
|
-
function
|
|
1200
|
-
let t = Array.isArray(e) && e.length ? e :
|
|
1201
|
-
return t.map(
|
|
1200
|
+
function kt(e = j) {
|
|
1201
|
+
let t = Array.isArray(e) && e.length ? e : j, n = /* @__PURE__ */ new Set();
|
|
1202
|
+
return t.map(Ot).filter(Boolean).filter((e) => n.has(e.key) ? !1 : (n.add(e.key), !0));
|
|
1202
1203
|
}
|
|
1203
|
-
var
|
|
1204
|
-
async function
|
|
1205
|
-
let e = await n(r,
|
|
1204
|
+
var At = "/admin/modules";
|
|
1205
|
+
async function jt() {
|
|
1206
|
+
let e = await n(r, At), t = e?.data;
|
|
1206
1207
|
return Array.isArray(t) ? t : Array.isArray(e) ? e : [];
|
|
1207
1208
|
}
|
|
1208
|
-
async function
|
|
1209
|
-
let t = await n(r, `${
|
|
1209
|
+
async function Mt(e) {
|
|
1210
|
+
let t = await n(r, `${At}/${encodeURIComponent(e)}/automations`), i = t?.data ?? t ?? {};
|
|
1210
1211
|
return {
|
|
1211
1212
|
gateway: i.gateway ?? null,
|
|
1212
1213
|
strategies: i.strategies ?? null
|
|
1213
1214
|
};
|
|
1214
1215
|
}
|
|
1215
|
-
async function
|
|
1216
|
+
async function Nt(e) {
|
|
1216
1217
|
let t = await n(r, `/admin/platform/${e}`), i = t?.data ?? t;
|
|
1217
1218
|
return Array.isArray(i) ? i : [];
|
|
1218
1219
|
}
|
|
1219
|
-
async function
|
|
1220
|
+
async function Pt(e, t) {
|
|
1220
1221
|
return n(r, `/admin/platform/${e}`, {
|
|
1221
1222
|
method: "POST",
|
|
1222
1223
|
headers: { "Content-Type": "application/json" },
|
|
1223
1224
|
body: JSON.stringify(t)
|
|
1224
1225
|
});
|
|
1225
1226
|
}
|
|
1226
|
-
async function
|
|
1227
|
+
async function Ft(e, t) {
|
|
1227
1228
|
return n(r, `/admin/platform/${e}/${encodeURIComponent(t)}`, { method: "DELETE" });
|
|
1228
1229
|
}
|
|
1229
|
-
async function
|
|
1230
|
-
return n(r, `${
|
|
1230
|
+
async function It(e, { gateway: t, strategies: i }) {
|
|
1231
|
+
return n(r, `${At}/${encodeURIComponent(e)}/automations`, {
|
|
1231
1232
|
method: "PUT",
|
|
1232
1233
|
headers: { "Content-Type": "application/json" },
|
|
1233
1234
|
body: JSON.stringify({
|
|
@@ -1236,35 +1237,35 @@ async function Ft(e, { gateway: t, strategies: i }) {
|
|
|
1236
1237
|
})
|
|
1237
1238
|
});
|
|
1238
1239
|
}
|
|
1239
|
-
async function
|
|
1240
|
+
async function Lt() {
|
|
1240
1241
|
let e = [];
|
|
1241
1242
|
try {
|
|
1242
|
-
e = await
|
|
1243
|
+
e = await Qn();
|
|
1243
1244
|
} catch {
|
|
1244
1245
|
e = [];
|
|
1245
1246
|
}
|
|
1246
1247
|
let t = (Array.isArray(e) ? e : []).filter((e) => e?.isDeleted !== !0 && String(e?.status ?? "active").toLowerCase() !== "inactive" && String(e?.status ?? "active").toLowerCase() !== "disabled");
|
|
1247
|
-
return t.length > 0 ? t :
|
|
1248
|
+
return t.length > 0 ? t : jt();
|
|
1248
1249
|
}
|
|
1249
|
-
var
|
|
1250
|
-
function
|
|
1250
|
+
var P = "/admin/form-groups", Rt = "/admin/config-defaults", zt = "000000000000000000000000";
|
|
1251
|
+
function Bt(e) {
|
|
1251
1252
|
let t = String(e ?? "").trim();
|
|
1252
|
-
return t === "" || t ===
|
|
1253
|
+
return t === "" || t === zt;
|
|
1253
1254
|
}
|
|
1254
|
-
function
|
|
1255
|
+
function Vt(e = {}) {
|
|
1255
1256
|
let t = new URLSearchParams();
|
|
1256
1257
|
e.module && t.set("module", e.module), e.clientId && t.set("clientId", e.clientId), e.region && t.set("region", e.region);
|
|
1257
1258
|
let n = t.toString();
|
|
1258
1259
|
return n ? `?${n}` : "";
|
|
1259
1260
|
}
|
|
1260
|
-
async function
|
|
1261
|
-
let i = await n(r, `${
|
|
1261
|
+
async function Ht(e = "", t = {}) {
|
|
1262
|
+
let i = await n(r, `${P}${Vt({
|
|
1262
1263
|
...t,
|
|
1263
1264
|
module: e || t.module || ""
|
|
1264
1265
|
})}`), a = i?.data;
|
|
1265
1266
|
return Array.isArray(a) ? a : a && Array.isArray(a.groups) ? a.groups : Array.isArray(i) ? i : i && Array.isArray(i.groups) ? i.groups : [];
|
|
1266
1267
|
}
|
|
1267
|
-
async function
|
|
1268
|
+
async function Ut({ offset: e = 0, limit: t = 100, sortBy: i = "new", searchvalue: a = "" } = {}) {
|
|
1268
1269
|
let o = new URLSearchParams({
|
|
1269
1270
|
offset: String(e),
|
|
1270
1271
|
limit: String(t),
|
|
@@ -1275,29 +1276,29 @@ async function Vt({ offset: e = 0, limit: t = 100, sortBy: i = "new", searchvalu
|
|
|
1275
1276
|
let u = await n(r, `/client/view?${o.toString()}`), d = u?.data ?? u;
|
|
1276
1277
|
return d?.clients ?? d?.Clients ?? d?.items ?? [];
|
|
1277
1278
|
}
|
|
1278
|
-
async function
|
|
1279
|
+
async function Wt(e) {
|
|
1279
1280
|
let t = await n(r, `/filter-dropdown-fields?module=${encodeURIComponent(e)}`), i = t?.data ?? t;
|
|
1280
1281
|
return Array.isArray(i) ? i : [];
|
|
1281
1282
|
}
|
|
1282
|
-
async function
|
|
1283
|
-
return n(r, `${
|
|
1283
|
+
async function Gt(e, t = {}) {
|
|
1284
|
+
return n(r, `${P}${Vt(t)}`, {
|
|
1284
1285
|
method: "POST",
|
|
1285
1286
|
headers: { "Content-Type": "application/json" },
|
|
1286
1287
|
body: JSON.stringify(e)
|
|
1287
1288
|
});
|
|
1288
1289
|
}
|
|
1289
|
-
async function
|
|
1290
|
-
return n(r, `${
|
|
1290
|
+
async function Kt(e, t, i = {}) {
|
|
1291
|
+
return n(r, `${P}/${e}${Vt(i)}`, {
|
|
1291
1292
|
method: "PUT",
|
|
1292
1293
|
headers: { "Content-Type": "application/json" },
|
|
1293
1294
|
body: JSON.stringify(t)
|
|
1294
1295
|
});
|
|
1295
1296
|
}
|
|
1296
|
-
async function
|
|
1297
|
-
return n(r, `${
|
|
1297
|
+
async function qt(e, t = {}) {
|
|
1298
|
+
return n(r, `${P}/${e}${Vt(t)}`, { method: "DELETE" });
|
|
1298
1299
|
}
|
|
1299
|
-
async function
|
|
1300
|
-
return n(r, `${
|
|
1300
|
+
async function Jt(e, t) {
|
|
1301
|
+
return n(r, `${Rt}/request-otp`, {
|
|
1301
1302
|
method: "POST",
|
|
1302
1303
|
body: JSON.stringify({
|
|
1303
1304
|
scope: e,
|
|
@@ -1305,8 +1306,8 @@ async function Kt(e, t) {
|
|
|
1305
1306
|
})
|
|
1306
1307
|
});
|
|
1307
1308
|
}
|
|
1308
|
-
async function
|
|
1309
|
-
return n(r, `${
|
|
1309
|
+
async function Yt(e, t, i) {
|
|
1310
|
+
return n(r, `${Rt}/apply`, {
|
|
1310
1311
|
method: "POST",
|
|
1311
1312
|
body: JSON.stringify({
|
|
1312
1313
|
scope: e,
|
|
@@ -1315,21 +1316,21 @@ async function qt(e, t, i) {
|
|
|
1315
1316
|
})
|
|
1316
1317
|
});
|
|
1317
1318
|
}
|
|
1318
|
-
var
|
|
1319
|
-
async function
|
|
1320
|
-
let i = await n(r, `${
|
|
1319
|
+
var Xt = "/admin/detail-config";
|
|
1320
|
+
async function Zt(e, t = {}) {
|
|
1321
|
+
let i = await n(r, `${Xt}${Vt({
|
|
1321
1322
|
module: e,
|
|
1322
1323
|
clientId: t.clientId
|
|
1323
1324
|
})}`), a = i?.data ?? i ?? {};
|
|
1324
1325
|
return {
|
|
1325
1326
|
module: a.module ?? e,
|
|
1326
|
-
clientId:
|
|
1327
|
+
clientId: Bt(a.clientId) ? "" : String(a.clientId),
|
|
1327
1328
|
fields: Array.isArray(a.fields) ? a.fields : [],
|
|
1328
1329
|
merges: Array.isArray(a.merges) ? a.merges : []
|
|
1329
1330
|
};
|
|
1330
1331
|
}
|
|
1331
|
-
async function
|
|
1332
|
-
return n(r,
|
|
1332
|
+
async function Qt({ module: e, fields: t = [], merges: i = [], clientId: a = "" }) {
|
|
1333
|
+
return n(r, Xt, {
|
|
1333
1334
|
method: "POST",
|
|
1334
1335
|
headers: { "Content-Type": "application/json" },
|
|
1335
1336
|
body: JSON.stringify({
|
|
@@ -1340,88 +1341,88 @@ async function Xt({ module: e, fields: t = [], merges: i = [], clientId: a = ""
|
|
|
1340
1341
|
})
|
|
1341
1342
|
});
|
|
1342
1343
|
}
|
|
1343
|
-
var
|
|
1344
|
-
async function
|
|
1345
|
-
let e = await n(r,
|
|
1344
|
+
var $t = "/admin/detail-defaults";
|
|
1345
|
+
async function en() {
|
|
1346
|
+
let e = await n(r, $t);
|
|
1346
1347
|
return e?.data ?? e ?? {};
|
|
1347
1348
|
}
|
|
1348
|
-
async function
|
|
1349
|
-
return n(r,
|
|
1349
|
+
async function tn(e) {
|
|
1350
|
+
return n(r, $t, {
|
|
1350
1351
|
method: "POST",
|
|
1351
1352
|
headers: { "Content-Type": "application/json" },
|
|
1352
1353
|
body: JSON.stringify(e)
|
|
1353
1354
|
});
|
|
1354
1355
|
}
|
|
1355
|
-
var
|
|
1356
|
-
async function
|
|
1357
|
-
let e = await n(r,
|
|
1356
|
+
var nn = "/admin/ai-service-config";
|
|
1357
|
+
async function rn() {
|
|
1358
|
+
let e = await n(r, nn);
|
|
1358
1359
|
return e?.data ?? e ?? [];
|
|
1359
1360
|
}
|
|
1360
|
-
async function
|
|
1361
|
-
return n(r,
|
|
1361
|
+
async function an(e) {
|
|
1362
|
+
return n(r, nn, {
|
|
1362
1363
|
method: "POST",
|
|
1363
1364
|
headers: { "Content-Type": "application/json" },
|
|
1364
1365
|
body: JSON.stringify(e)
|
|
1365
1366
|
});
|
|
1366
1367
|
}
|
|
1367
|
-
async function
|
|
1368
|
-
return n(r, `${
|
|
1368
|
+
async function on(e) {
|
|
1369
|
+
return n(r, `${nn}?serviceKey=${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
1369
1370
|
}
|
|
1370
|
-
var
|
|
1371
|
-
async function
|
|
1372
|
-
let e = await n(r,
|
|
1371
|
+
var sn = "/admin/bgc-integration-config";
|
|
1372
|
+
async function cn() {
|
|
1373
|
+
let e = await n(r, sn);
|
|
1373
1374
|
return e?.data ?? e ?? {
|
|
1374
1375
|
updateMethod: "MANUAL",
|
|
1375
1376
|
enabled: !0
|
|
1376
1377
|
};
|
|
1377
1378
|
}
|
|
1378
|
-
async function
|
|
1379
|
-
return n(r,
|
|
1379
|
+
async function ln(e) {
|
|
1380
|
+
return n(r, sn, {
|
|
1380
1381
|
method: "PUT",
|
|
1381
1382
|
headers: { "Content-Type": "application/json" },
|
|
1382
1383
|
body: JSON.stringify(e)
|
|
1383
1384
|
});
|
|
1384
1385
|
}
|
|
1385
|
-
async function
|
|
1386
|
+
async function un() {
|
|
1386
1387
|
let e = await n(r, "/integration-config/bgc/summary");
|
|
1387
1388
|
return e?.data ?? e ?? {
|
|
1388
1389
|
updateMethod: "MANUAL",
|
|
1389
1390
|
enabled: !0
|
|
1390
1391
|
};
|
|
1391
1392
|
}
|
|
1392
|
-
var
|
|
1393
|
-
async function
|
|
1394
|
-
let e = await n(r,
|
|
1393
|
+
var F = "/admin/integration-config";
|
|
1394
|
+
async function dn() {
|
|
1395
|
+
let e = await n(r, F);
|
|
1395
1396
|
return e?.data ?? e ?? [];
|
|
1396
1397
|
}
|
|
1397
|
-
async function
|
|
1398
|
-
let t = await n(r, `${
|
|
1398
|
+
async function fn(e) {
|
|
1399
|
+
let t = await n(r, `${F}/${encodeURIComponent(e)}`);
|
|
1399
1400
|
return t?.data ?? t;
|
|
1400
1401
|
}
|
|
1401
|
-
async function
|
|
1402
|
+
async function pn(e) {
|
|
1402
1403
|
let t = e?.integrationKey;
|
|
1403
|
-
return n(r, t ? `${
|
|
1404
|
+
return n(r, t ? `${F}/${encodeURIComponent(t)}` : F, {
|
|
1404
1405
|
method: t ? "PUT" : "POST",
|
|
1405
1406
|
headers: { "Content-Type": "application/json" },
|
|
1406
1407
|
body: JSON.stringify(e)
|
|
1407
1408
|
});
|
|
1408
1409
|
}
|
|
1409
|
-
async function
|
|
1410
|
-
return n(r, `${
|
|
1410
|
+
async function mn(e) {
|
|
1411
|
+
return n(r, `${F}/${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
1411
1412
|
}
|
|
1412
|
-
async function
|
|
1413
|
-
let t = await n(r, `${
|
|
1413
|
+
async function hn(e) {
|
|
1414
|
+
let t = await n(r, `${F}/test`, {
|
|
1414
1415
|
method: "POST",
|
|
1415
1416
|
headers: { "Content-Type": "application/json" },
|
|
1416
1417
|
body: JSON.stringify(e)
|
|
1417
1418
|
});
|
|
1418
1419
|
return t?.data ?? t;
|
|
1419
1420
|
}
|
|
1420
|
-
async function
|
|
1421
|
+
async function gn(e) {
|
|
1421
1422
|
let t = await n(r, `/integration-config/${encodeURIComponent(e)}/summary`);
|
|
1422
1423
|
return t?.data ?? t;
|
|
1423
1424
|
}
|
|
1424
|
-
async function
|
|
1425
|
+
async function _n(e, t, i) {
|
|
1425
1426
|
let a = await n(r, `/integration-config/${encodeURIComponent(e)}/apply-status/${encodeURIComponent(t)}`, {
|
|
1426
1427
|
method: "POST",
|
|
1427
1428
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1429,11 +1430,11 @@ async function hn(e, t, i) {
|
|
|
1429
1430
|
});
|
|
1430
1431
|
return a?.data ?? a;
|
|
1431
1432
|
}
|
|
1432
|
-
async function
|
|
1433
|
-
let i = await n(r, `${
|
|
1433
|
+
async function vn(e, t) {
|
|
1434
|
+
let i = await n(r, `${P}?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}&view=detail`), a = i?.data ?? i;
|
|
1434
1435
|
return Array.isArray(a) ? a : [];
|
|
1435
1436
|
}
|
|
1436
|
-
function
|
|
1437
|
+
function yn(e) {
|
|
1437
1438
|
return {
|
|
1438
1439
|
key: e.role_id ?? e.id,
|
|
1439
1440
|
roleId: e.role_id ?? e.id,
|
|
@@ -1444,17 +1445,17 @@ function _n(e) {
|
|
|
1444
1445
|
raw: e
|
|
1445
1446
|
};
|
|
1446
1447
|
}
|
|
1447
|
-
function
|
|
1448
|
+
function I(e) {
|
|
1448
1449
|
return e?.raw?.role_id ?? e?.roleId ?? e?.key;
|
|
1449
1450
|
}
|
|
1450
|
-
async function
|
|
1451
|
-
let e = await n(r, "/get-roles"), t = e.data ?? e, i =
|
|
1451
|
+
async function bn() {
|
|
1452
|
+
let e = await n(r, "/get-roles"), t = e.data ?? e, i = M(t?.zinnext_default).map(yn), a = M(t?.custom_roles).map(yn), o = [...i, ...a];
|
|
1452
1453
|
return {
|
|
1453
1454
|
roles: o,
|
|
1454
1455
|
total: o.length
|
|
1455
1456
|
};
|
|
1456
1457
|
}
|
|
1457
|
-
function
|
|
1458
|
+
function xn(e) {
|
|
1458
1459
|
return {
|
|
1459
1460
|
key: e.teamId,
|
|
1460
1461
|
teamId: e.teamId,
|
|
@@ -1462,28 +1463,28 @@ function yn(e) {
|
|
|
1462
1463
|
manager: e.reportingManager ?? "N/A",
|
|
1463
1464
|
managerId: e.reportingManagerId ?? 0,
|
|
1464
1465
|
memberCount: e.noOfTeamMembers ?? 0,
|
|
1465
|
-
members:
|
|
1466
|
-
memberIds:
|
|
1466
|
+
members: M(e.teamMembers),
|
|
1467
|
+
memberIds: M(e.teamMembersIds),
|
|
1467
1468
|
raw: e
|
|
1468
1469
|
};
|
|
1469
1470
|
}
|
|
1470
|
-
function
|
|
1471
|
+
function Sn(e) {
|
|
1471
1472
|
return e?.raw?.teamId ?? e?.teamId ?? e?.key;
|
|
1472
1473
|
}
|
|
1473
|
-
async function
|
|
1474
|
+
async function Cn({ offset: e = 0, limit: t = 10, sortBy: i = "new", search: a = "" } = {}) {
|
|
1474
1475
|
let o = await n(r, `/get-teams?${new URLSearchParams({
|
|
1475
1476
|
searchquery: a,
|
|
1476
1477
|
sortBy: i,
|
|
1477
1478
|
limit: String(t),
|
|
1478
1479
|
offset: String(e)
|
|
1479
|
-
})}`), s = o.data ?? o, c =
|
|
1480
|
+
})}`), s = o.data ?? o, c = M(s?.teams, s, o?.teams), l = s?.totalCount ?? s?.total ?? c.length;
|
|
1480
1481
|
return {
|
|
1481
|
-
teams: c.map(
|
|
1482
|
+
teams: c.map(xn),
|
|
1482
1483
|
total: l
|
|
1483
1484
|
};
|
|
1484
1485
|
}
|
|
1485
|
-
async function
|
|
1486
|
-
return n(r, `/team/edit?teamId=${
|
|
1486
|
+
async function wn(e, { teamName: t, managerId: i, memberIds: a = [] }) {
|
|
1487
|
+
return n(r, `/team/edit?teamId=${Sn(e)}`, {
|
|
1487
1488
|
method: "PUT",
|
|
1488
1489
|
body: JSON.stringify({
|
|
1489
1490
|
team_name: t,
|
|
@@ -1493,34 +1494,34 @@ async function Sn(e, { teamName: t, managerId: i, memberIds: a = [] }) {
|
|
|
1493
1494
|
})
|
|
1494
1495
|
});
|
|
1495
1496
|
}
|
|
1496
|
-
async function
|
|
1497
|
-
let o = await n(r, `${
|
|
1497
|
+
async function Tn(e, t, i, a = "listView") {
|
|
1498
|
+
let o = await n(r, `${A}?${new URLSearchParams({
|
|
1498
1499
|
module: e,
|
|
1499
1500
|
userId: "0",
|
|
1500
1501
|
[t]: String(i),
|
|
1501
1502
|
configType: a
|
|
1502
1503
|
})}`), s = o.data ?? o;
|
|
1503
|
-
return
|
|
1504
|
+
return M(s, s?.visibleFields, o?.visibleFields);
|
|
1504
1505
|
}
|
|
1505
|
-
async function
|
|
1506
|
-
let r =
|
|
1507
|
-
...
|
|
1506
|
+
async function En(e, t = "listView", n = j) {
|
|
1507
|
+
let r = I(e), i = kt(n), a = await Promise.all(i.map(async ({ key: e, apiModule: n }) => [e, (await Tn(n, "roleId", r, t)).map((t, i) => ({
|
|
1508
|
+
...Dt(t, i),
|
|
1508
1509
|
module: e,
|
|
1509
1510
|
apiModule: n,
|
|
1510
1511
|
roleId: r
|
|
1511
1512
|
}))]));
|
|
1512
1513
|
return Object.fromEntries(a);
|
|
1513
1514
|
}
|
|
1514
|
-
async function
|
|
1515
|
-
let n =
|
|
1516
|
-
...
|
|
1515
|
+
async function Dn(e, t = "listView") {
|
|
1516
|
+
let n = Sn(e), r = await Promise.all(j.map(async ({ key: e, apiModule: r }) => [e, (await Tn(r, "teamId", n, t)).map((t, i) => ({
|
|
1517
|
+
...Dt(t, i),
|
|
1517
1518
|
module: e,
|
|
1518
1519
|
apiModule: r,
|
|
1519
1520
|
teamId: n
|
|
1520
1521
|
}))]));
|
|
1521
1522
|
return Object.fromEntries(r);
|
|
1522
1523
|
}
|
|
1523
|
-
function
|
|
1524
|
+
function On(e, t) {
|
|
1524
1525
|
let n = !t || t === "listView";
|
|
1525
1526
|
return e.map((e, r) => {
|
|
1526
1527
|
let i = {
|
|
@@ -1556,37 +1557,37 @@ function En(e, t) {
|
|
|
1556
1557
|
].includes(e.type) && (i.dataSource = e.dataSource ?? "module", e.dataSource === "group" && (i.groupName = e.groupName ?? ""))), i;
|
|
1557
1558
|
});
|
|
1558
1559
|
}
|
|
1559
|
-
async function
|
|
1560
|
-
let s =
|
|
1561
|
-
return n(r, `${
|
|
1560
|
+
async function kn(e, t, i, a = "listView", o = j) {
|
|
1561
|
+
let s = I(e), c = kt(o).find((e) => e.key === t)?.apiModule ?? t;
|
|
1562
|
+
return n(r, `${A}/role`, {
|
|
1562
1563
|
method: "PUT",
|
|
1563
1564
|
body: JSON.stringify({
|
|
1564
1565
|
module: c,
|
|
1565
1566
|
roleId: s,
|
|
1566
1567
|
configType: a,
|
|
1567
|
-
visibleFields:
|
|
1568
|
+
visibleFields: On(i, a)
|
|
1568
1569
|
})
|
|
1569
1570
|
});
|
|
1570
1571
|
}
|
|
1571
|
-
var
|
|
1572
|
-
function
|
|
1572
|
+
var An = "/admin/role-form-permissions";
|
|
1573
|
+
function jn(e) {
|
|
1573
1574
|
return `__group__:${e}`;
|
|
1574
1575
|
}
|
|
1575
|
-
async function
|
|
1576
|
-
let a =
|
|
1576
|
+
async function Mn(e, t, i = {}) {
|
|
1577
|
+
let a = I(e), o = new URLSearchParams({
|
|
1577
1578
|
module: t,
|
|
1578
1579
|
roleId: String(a ?? "")
|
|
1579
1580
|
});
|
|
1580
1581
|
i.clientId && o.set("clientId", i.clientId), i.region && o.set("region", i.region);
|
|
1581
|
-
let s = await n(r, `${
|
|
1582
|
+
let s = await n(r, `${An}?${o}`), c = s?.data ?? s;
|
|
1582
1583
|
return Array.isArray(c) ? c : [];
|
|
1583
1584
|
}
|
|
1584
|
-
async function
|
|
1585
|
-
let a =
|
|
1585
|
+
async function Nn(e, t, i) {
|
|
1586
|
+
let a = I(e), o = [], s = 0;
|
|
1586
1587
|
for (let e of i) {
|
|
1587
1588
|
e.locked || o.push({
|
|
1588
1589
|
label: e.label,
|
|
1589
|
-
field:
|
|
1590
|
+
field: jn(e.name),
|
|
1590
1591
|
isVisible: e.enabled,
|
|
1591
1592
|
isEditable: e.editable !== !1,
|
|
1592
1593
|
order: s++
|
|
@@ -1599,7 +1600,7 @@ async function jn(e, t, i) {
|
|
|
1599
1600
|
order: s++
|
|
1600
1601
|
});
|
|
1601
1602
|
}
|
|
1602
|
-
return n(r, `${
|
|
1603
|
+
return n(r, `${A}/role`, {
|
|
1603
1604
|
method: "PUT",
|
|
1604
1605
|
body: JSON.stringify({
|
|
1605
1606
|
module: t,
|
|
@@ -1609,49 +1610,49 @@ async function jn(e, t, i) {
|
|
|
1609
1610
|
})
|
|
1610
1611
|
});
|
|
1611
1612
|
}
|
|
1612
|
-
async function
|
|
1613
|
-
let o =
|
|
1614
|
-
return n(r, `${
|
|
1613
|
+
async function Pn(e, t, i, a = "listView") {
|
|
1614
|
+
let o = Sn(e), s = j.find((e) => e.key === t)?.apiModule ?? t;
|
|
1615
|
+
return n(r, `${A}/team`, {
|
|
1615
1616
|
method: "PUT",
|
|
1616
1617
|
body: JSON.stringify({
|
|
1617
1618
|
module: s,
|
|
1618
1619
|
teamId: o,
|
|
1619
1620
|
configType: a,
|
|
1620
|
-
visibleFields:
|
|
1621
|
+
visibleFields: On(i, a)
|
|
1621
1622
|
})
|
|
1622
1623
|
});
|
|
1623
1624
|
}
|
|
1624
|
-
async function
|
|
1625
|
+
async function Fn({ offset: e = 0, limit: t = 10, sortBy: i = "new", searchQuery: a = "" } = {}) {
|
|
1625
1626
|
let o = new URLSearchParams({
|
|
1626
1627
|
offset: String(e),
|
|
1627
1628
|
limit: String(t),
|
|
1628
1629
|
sortBy: i
|
|
1629
1630
|
});
|
|
1630
1631
|
a && o.set("searchquery", a);
|
|
1631
|
-
let s = await n(r, `/get-all-users?${o}`), c = s.data ?? s, l =
|
|
1632
|
+
let s = await n(r, `/get-all-users?${o}`), c = s.data ?? s, l = M(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);
|
|
1632
1633
|
return {
|
|
1633
1634
|
users: l,
|
|
1634
|
-
total:
|
|
1635
|
+
total: Et({
|
|
1635
1636
|
...s,
|
|
1636
1637
|
...c
|
|
1637
1638
|
}, l)
|
|
1638
1639
|
};
|
|
1639
1640
|
}
|
|
1640
|
-
async function
|
|
1641
|
-
return n(r, `${
|
|
1641
|
+
async function In(e = []) {
|
|
1642
|
+
return n(r, `${A}/seed`, {
|
|
1642
1643
|
method: "POST",
|
|
1643
1644
|
headers: { "Content-Type": "application/json" },
|
|
1644
1645
|
body: JSON.stringify({ collections: e })
|
|
1645
1646
|
});
|
|
1646
1647
|
}
|
|
1647
|
-
async function
|
|
1648
|
-
let e = await n(r, `${
|
|
1648
|
+
async function Ln() {
|
|
1649
|
+
let e = await n(r, `${A}/seed-status`), t = e?.data ?? e ?? {};
|
|
1649
1650
|
return {
|
|
1650
1651
|
modules: Array.isArray(t.modules) ? t.modules : [],
|
|
1651
1652
|
seededModules: t.seededModules ?? {}
|
|
1652
1653
|
};
|
|
1653
1654
|
}
|
|
1654
|
-
async function
|
|
1655
|
+
async function Rn(e) {
|
|
1655
1656
|
let t = localStorage.getItem("authToken"), n = new FormData();
|
|
1656
1657
|
n.append("icon", e);
|
|
1657
1658
|
let i = await fetch(`${r}/admin/field-config/action-icon`, {
|
|
@@ -1666,11 +1667,11 @@ async function In(e) {
|
|
|
1666
1667
|
let a = await i.json();
|
|
1667
1668
|
return a.data ?? a;
|
|
1668
1669
|
}
|
|
1669
|
-
async function
|
|
1670
|
+
async function zn() {
|
|
1670
1671
|
let [e, t, n] = await Promise.all([
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1672
|
+
Lt().catch(() => []),
|
|
1673
|
+
Yn().catch(() => []),
|
|
1674
|
+
mr().catch(() => [])
|
|
1674
1675
|
]), r = Array.isArray(e) ? e : [], i = n.map((e) => String(e?.module ?? "").trim()).filter(Boolean);
|
|
1675
1676
|
return [
|
|
1676
1677
|
...r,
|
|
@@ -1678,7 +1679,7 @@ async function Ln() {
|
|
|
1678
1679
|
...i
|
|
1679
1680
|
];
|
|
1680
1681
|
}
|
|
1681
|
-
async function
|
|
1682
|
+
async function Bn(e, { page: t = 1, limit: i = 100 } = {}) {
|
|
1682
1683
|
let a = await n(r, `/module/list?${new URLSearchParams({
|
|
1683
1684
|
module: e,
|
|
1684
1685
|
page: String(t),
|
|
@@ -1689,24 +1690,24 @@ async function Rn(e, { page: t = 1, limit: i = 100 } = {}) {
|
|
|
1689
1690
|
total: o.pagination?.total ?? 0
|
|
1690
1691
|
};
|
|
1691
1692
|
}
|
|
1692
|
-
async function
|
|
1693
|
+
async function Vn(e, t) {
|
|
1693
1694
|
return n(r, `/module/create?module=${encodeURIComponent(e)}`, {
|
|
1694
1695
|
method: "POST",
|
|
1695
1696
|
headers: { "Content-Type": "application/json" },
|
|
1696
1697
|
body: JSON.stringify(t)
|
|
1697
1698
|
});
|
|
1698
1699
|
}
|
|
1699
|
-
async function
|
|
1700
|
+
async function Hn(e, t, i) {
|
|
1700
1701
|
return n(r, `/module/update/${encodeURIComponent(t)}?module=${encodeURIComponent(e)}`, {
|
|
1701
1702
|
method: "PUT",
|
|
1702
1703
|
headers: { "Content-Type": "application/json" },
|
|
1703
1704
|
body: JSON.stringify(i)
|
|
1704
1705
|
});
|
|
1705
1706
|
}
|
|
1706
|
-
async function
|
|
1707
|
+
async function Un(e, t) {
|
|
1707
1708
|
return n(r, `/module/delete/${encodeURIComponent(t)}?module=${encodeURIComponent(e)}`, { method: "DELETE" });
|
|
1708
1709
|
}
|
|
1709
|
-
async function
|
|
1710
|
+
async function Wn(e = "", t = 50) {
|
|
1710
1711
|
let i = await n(r, `/admin/location-dropdown-values?${new URLSearchParams({
|
|
1711
1712
|
search: e,
|
|
1712
1713
|
limit: String(t),
|
|
@@ -1720,7 +1721,7 @@ async function Hn(e = "", t = 50) {
|
|
|
1720
1721
|
};
|
|
1721
1722
|
}).filter((e) => e.label);
|
|
1722
1723
|
}
|
|
1723
|
-
async function
|
|
1724
|
+
async function Gn(e, t, i = "_id") {
|
|
1724
1725
|
let a = await n(r, `/admin/lookup-dropdown-values?${new URLSearchParams({
|
|
1725
1726
|
collection: String(e),
|
|
1726
1727
|
displayField: String(t),
|
|
@@ -1731,11 +1732,11 @@ async function Un(e, t, i = "_id") {
|
|
|
1731
1732
|
value: String(e.value ?? e._id ?? e.id ?? "")
|
|
1732
1733
|
})).filter((e) => e.value && e.label);
|
|
1733
1734
|
}
|
|
1734
|
-
async function
|
|
1735
|
+
async function Kn(e) {
|
|
1735
1736
|
let t = await n(r, `/admin/default-fields?module=${encodeURIComponent(e)}`), i = t?.data ?? t ?? {};
|
|
1736
1737
|
return Array.isArray(i.fields) ? i.fields : [];
|
|
1737
1738
|
}
|
|
1738
|
-
async function
|
|
1739
|
+
async function qn(e, t, i) {
|
|
1739
1740
|
return n(r, "/admin/default-fields", {
|
|
1740
1741
|
method: "PUT",
|
|
1741
1742
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1746,7 +1747,7 @@ async function Gn(e, t, i) {
|
|
|
1746
1747
|
})
|
|
1747
1748
|
});
|
|
1748
1749
|
}
|
|
1749
|
-
async function
|
|
1750
|
+
async function Jn(e) {
|
|
1750
1751
|
let t = await n(r, "/email-verify", {
|
|
1751
1752
|
method: "POST",
|
|
1752
1753
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1764,23 +1765,23 @@ async function Kn(e) {
|
|
|
1764
1765
|
checks: Array.isArray(i.checks) ? i.checks : []
|
|
1765
1766
|
};
|
|
1766
1767
|
}
|
|
1767
|
-
async function
|
|
1768
|
+
async function Yn() {
|
|
1768
1769
|
let e = await n(r, "/admin/lookup/collections"), t = e.data ?? e;
|
|
1769
1770
|
return Array.isArray(t) ? t : [];
|
|
1770
1771
|
}
|
|
1771
|
-
async function
|
|
1772
|
+
async function Xn(e) {
|
|
1772
1773
|
let t = await n(r, `/admin/lookup/collection-fields?collection=${encodeURIComponent(e)}`), i = t.data ?? t;
|
|
1773
1774
|
return Array.isArray(i) ? i : [];
|
|
1774
1775
|
}
|
|
1775
|
-
async function
|
|
1776
|
+
async function Zn(e, t) {
|
|
1776
1777
|
let i = await n(r, `/admin/field-array-subfields?module=${encodeURIComponent(e)}&field=${encodeURIComponent(t)}`), a = i.data ?? i;
|
|
1777
1778
|
return Array.isArray(a?.fields) ? a.fields : [];
|
|
1778
1779
|
}
|
|
1779
|
-
async function
|
|
1780
|
+
async function Qn() {
|
|
1780
1781
|
let e = await n(r, "/admin/menu-modules");
|
|
1781
|
-
return
|
|
1782
|
+
return M(e.data, e);
|
|
1782
1783
|
}
|
|
1783
|
-
async function
|
|
1784
|
+
async function $n({ menuName: e, apiUrl: t = "", menuType: i = "menu", parentMenuId: a = 0, displayOrder: o = 0 }) {
|
|
1784
1785
|
let s = await n(r, "/admin/menu-modules", {
|
|
1785
1786
|
method: "POST",
|
|
1786
1787
|
body: JSON.stringify({
|
|
@@ -1793,22 +1794,22 @@ async function Zn({ menuName: e, apiUrl: t = "", menuType: i = "menu", parentMen
|
|
|
1793
1794
|
});
|
|
1794
1795
|
return s.data ?? s;
|
|
1795
1796
|
}
|
|
1796
|
-
async function
|
|
1797
|
+
async function er(e, { menuName: t }) {
|
|
1797
1798
|
let i = await n(r, `/admin/menu-modules/${e}`, {
|
|
1798
1799
|
method: "PUT",
|
|
1799
1800
|
body: JSON.stringify({ menuName: t })
|
|
1800
1801
|
});
|
|
1801
1802
|
return i.data ?? i;
|
|
1802
1803
|
}
|
|
1803
|
-
async function
|
|
1804
|
+
async function tr(e) {
|
|
1804
1805
|
let t = await n(r, `/admin/menu-modules/${e}`, { method: "DELETE" });
|
|
1805
1806
|
return t.data ?? t;
|
|
1806
1807
|
}
|
|
1807
|
-
async function
|
|
1808
|
+
async function nr() {
|
|
1808
1809
|
let e = await n(r, "/admin/menu-actions");
|
|
1809
|
-
return
|
|
1810
|
+
return M(e.data, e);
|
|
1810
1811
|
}
|
|
1811
|
-
async function
|
|
1812
|
+
async function rr({ permissionName: e, permissionKey: t }) {
|
|
1812
1813
|
let i = await n(r, "/admin/menu-actions", {
|
|
1813
1814
|
method: "POST",
|
|
1814
1815
|
body: JSON.stringify({
|
|
@@ -1818,22 +1819,22 @@ async function tr({ permissionName: e, permissionKey: t }) {
|
|
|
1818
1819
|
});
|
|
1819
1820
|
return i.data ?? i;
|
|
1820
1821
|
}
|
|
1821
|
-
async function
|
|
1822
|
+
async function ir(e, { permissionName: t }) {
|
|
1822
1823
|
let i = await n(r, `/admin/menu-actions/${e}`, {
|
|
1823
1824
|
method: "PUT",
|
|
1824
1825
|
body: JSON.stringify({ permissionName: t })
|
|
1825
1826
|
});
|
|
1826
1827
|
return i.data ?? i;
|
|
1827
1828
|
}
|
|
1828
|
-
async function
|
|
1829
|
+
async function ar(e) {
|
|
1829
1830
|
let t = await n(r, `/admin/menu-actions/${e}`, { method: "DELETE" });
|
|
1830
1831
|
return t.data ?? t;
|
|
1831
1832
|
}
|
|
1832
|
-
async function
|
|
1833
|
+
async function or(e) {
|
|
1833
1834
|
let t = await n(r, `/get-role-details?roleid=${e}`);
|
|
1834
1835
|
return t?.data ?? t ?? {};
|
|
1835
1836
|
}
|
|
1836
|
-
async function
|
|
1837
|
+
async function sr(e, t) {
|
|
1837
1838
|
return n(r, "/edit-role-details", {
|
|
1838
1839
|
method: "PUT",
|
|
1839
1840
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1843,40 +1844,40 @@ async function ar(e, t) {
|
|
|
1843
1844
|
})
|
|
1844
1845
|
});
|
|
1845
1846
|
}
|
|
1846
|
-
var
|
|
1847
|
-
async function
|
|
1847
|
+
var cr = "/admin/custom-forms";
|
|
1848
|
+
async function lr(e = "", t = "", i = "") {
|
|
1848
1849
|
let a = new URLSearchParams();
|
|
1849
1850
|
e && a.append("module", e), t && a.append("formType", t), i && a.append("action", i);
|
|
1850
|
-
let o = await n(r, `${
|
|
1851
|
+
let o = await n(r, `${cr}?${a.toString()}`), s = o?.data;
|
|
1851
1852
|
return Array.isArray(s) ? s : Array.isArray(o) ? o : [];
|
|
1852
1853
|
}
|
|
1853
|
-
async function
|
|
1854
|
-
return n(r,
|
|
1854
|
+
async function ur(e) {
|
|
1855
|
+
return n(r, cr, {
|
|
1855
1856
|
method: "POST",
|
|
1856
1857
|
headers: { "Content-Type": "application/json" },
|
|
1857
1858
|
body: JSON.stringify(e)
|
|
1858
1859
|
});
|
|
1859
1860
|
}
|
|
1860
|
-
async function
|
|
1861
|
-
return n(r, `${
|
|
1861
|
+
async function dr(e, t) {
|
|
1862
|
+
return n(r, `${cr}/${e}`, {
|
|
1862
1863
|
method: "PUT",
|
|
1863
1864
|
headers: { "Content-Type": "application/json" },
|
|
1864
1865
|
body: JSON.stringify(t)
|
|
1865
1866
|
});
|
|
1866
1867
|
}
|
|
1867
|
-
async function
|
|
1868
|
-
return n(r, `${
|
|
1868
|
+
async function fr(e) {
|
|
1869
|
+
return n(r, `${cr}/${e}`, { method: "DELETE" });
|
|
1869
1870
|
}
|
|
1870
1871
|
var L = "/admin/row-action-config";
|
|
1871
|
-
function
|
|
1872
|
+
function pr(e) {
|
|
1872
1873
|
return String(e ?? "").trim().toLowerCase();
|
|
1873
1874
|
}
|
|
1874
|
-
async function
|
|
1875
|
-
let t =
|
|
1875
|
+
async function mr(e = "") {
|
|
1876
|
+
let t = pr(e), i = await n(r, t ? `${L}?module=${encodeURIComponent(t)}` : L), a = i?.data;
|
|
1876
1877
|
return Array.isArray(a) ? a : Array.isArray(i) ? i : [];
|
|
1877
1878
|
}
|
|
1878
|
-
async function
|
|
1879
|
-
let a =
|
|
1879
|
+
async function hr({ module: e, roleId: t = 0, rowActions: i = [] }) {
|
|
1880
|
+
let a = pr(e);
|
|
1880
1881
|
return n(r, L, {
|
|
1881
1882
|
method: "POST",
|
|
1882
1883
|
headers: { "Content-Type": "application/json" },
|
|
@@ -1887,23 +1888,23 @@ async function fr({ module: e, roleId: t = 0, rowActions: i = [] }) {
|
|
|
1887
1888
|
})
|
|
1888
1889
|
});
|
|
1889
1890
|
}
|
|
1890
|
-
async function
|
|
1891
|
+
async function gr(e, t = []) {
|
|
1891
1892
|
return n(r, `${L}/${e}`, {
|
|
1892
1893
|
method: "PUT",
|
|
1893
1894
|
headers: { "Content-Type": "application/json" },
|
|
1894
1895
|
body: JSON.stringify({ rowActions: t })
|
|
1895
1896
|
});
|
|
1896
1897
|
}
|
|
1897
|
-
async function
|
|
1898
|
+
async function _r(e) {
|
|
1898
1899
|
return n(r, `${L}/${e}`, { method: "DELETE" });
|
|
1899
1900
|
}
|
|
1900
|
-
var
|
|
1901
|
-
async function
|
|
1902
|
-
let t = await n(r, `${
|
|
1901
|
+
var vr = "/admin/module-action-rules";
|
|
1902
|
+
async function yr(e) {
|
|
1903
|
+
let t = await n(r, `${vr}?module=${encodeURIComponent(e)}`), i = t?.data;
|
|
1903
1904
|
return Array.isArray(i) ? i : Array.isArray(t) ? t : [];
|
|
1904
1905
|
}
|
|
1905
|
-
async function
|
|
1906
|
-
return n(r,
|
|
1906
|
+
async function br({ module: e, name: t, description: i = "", conditions: a = [], blockedActions: o = [], disabledActions: s = [], isActive: c = !0 }) {
|
|
1907
|
+
return n(r, vr, {
|
|
1907
1908
|
method: "POST",
|
|
1908
1909
|
headers: { "Content-Type": "application/json" },
|
|
1909
1910
|
body: JSON.stringify({
|
|
@@ -1917,8 +1918,8 @@ async function gr({ module: e, name: t, description: i = "", conditions: a = [],
|
|
|
1917
1918
|
})
|
|
1918
1919
|
});
|
|
1919
1920
|
}
|
|
1920
|
-
async function
|
|
1921
|
-
return n(r, `${
|
|
1921
|
+
async function xr(e, { name: t, description: i = "", conditions: a = [], blockedActions: o = [], disabledActions: s = [], isActive: c = !0 }) {
|
|
1922
|
+
return n(r, `${vr}/${e}`, {
|
|
1922
1923
|
method: "PUT",
|
|
1923
1924
|
headers: { "Content-Type": "application/json" },
|
|
1924
1925
|
body: JSON.stringify({
|
|
@@ -1931,15 +1932,15 @@ async function _r(e, { name: t, description: i = "", conditions: a = [], blocked
|
|
|
1931
1932
|
})
|
|
1932
1933
|
});
|
|
1933
1934
|
}
|
|
1934
|
-
async function
|
|
1935
|
-
return n(r, `${
|
|
1935
|
+
async function Sr(e) {
|
|
1936
|
+
return n(r, `${vr}/${e}`, { method: "DELETE" });
|
|
1936
1937
|
}
|
|
1937
1938
|
//#endregion
|
|
1938
1939
|
//#region src/services/documentApi.js
|
|
1939
|
-
function
|
|
1940
|
+
function Cr(e) {
|
|
1940
1941
|
return String(e ?? "").replace(/^__mw__.*?__/, "").replace(/\[\d+\]$/, "").trim() || "file";
|
|
1941
1942
|
}
|
|
1942
|
-
async function
|
|
1943
|
+
async function wr(e, t, n = [], a = {}) {
|
|
1943
1944
|
if (!e) throw Error("moduleName is required to upload documents");
|
|
1944
1945
|
if (!t) throw Error("refId (created record id) is required to upload documents");
|
|
1945
1946
|
if (!n.length) return {
|
|
@@ -1949,7 +1950,7 @@ async function br(e, t, n = [], a = {}) {
|
|
|
1949
1950
|
let o = await i(), s = new FormData();
|
|
1950
1951
|
n.forEach(({ formKey: e, file: t }) => {
|
|
1951
1952
|
let n = t?.name ?? void 0;
|
|
1952
|
-
s.append(
|
|
1953
|
+
s.append(Cr(e), t, n);
|
|
1953
1954
|
}), a && Object.keys(a).length > 0 && s.append("metadata", JSON.stringify(a));
|
|
1954
1955
|
let c = new URLSearchParams({
|
|
1955
1956
|
module: e,
|
|
@@ -1965,7 +1966,7 @@ async function br(e, t, n = [], a = {}) {
|
|
|
1965
1966
|
}
|
|
1966
1967
|
return u?.data ?? u;
|
|
1967
1968
|
}
|
|
1968
|
-
async function
|
|
1969
|
+
async function Tr(e, t, i = "") {
|
|
1969
1970
|
if (!e) throw Error("moduleName is required to fetch documents");
|
|
1970
1971
|
if (!t) throw Error("refId is required to fetch documents");
|
|
1971
1972
|
let a = new URLSearchParams({
|
|
@@ -1981,12 +1982,12 @@ async function xr(e, t, i = "") {
|
|
|
1981
1982
|
}
|
|
1982
1983
|
//#endregion
|
|
1983
1984
|
//#region src/services/detailedViewApi.js
|
|
1984
|
-
var
|
|
1985
|
+
var Er = {
|
|
1985
1986
|
job: { fetchUrl: (e) => `${t}/edit/detailed-view/${encodeURIComponent(e)}` },
|
|
1986
|
-
candidates: { fetchUrl: (e) => `${
|
|
1987
|
+
candidates: { fetchUrl: (e) => `${s}/edit/detailed-view?_id=${encodeURIComponent(e)}` },
|
|
1987
1988
|
submission: { fetchUrl: (t) => `${e}/edit/detailed-view?_id=${encodeURIComponent(t)}` }
|
|
1988
1989
|
};
|
|
1989
|
-
async function
|
|
1990
|
+
async function Dr(e, t) {
|
|
1990
1991
|
let i = String(e ?? "").trim().toLowerCase();
|
|
1991
1992
|
if (i === "job" || i === "jobs") {
|
|
1992
1993
|
let { getJobDetailView: e } = await import("./index.js").then((e) => e.r);
|
|
@@ -1997,17 +1998,17 @@ async function Cr(e, t) {
|
|
|
1997
1998
|
id: String(t)
|
|
1998
1999
|
}).toString()}`);
|
|
1999
2000
|
}
|
|
2000
|
-
async function
|
|
2001
|
+
async function Or(e) {
|
|
2001
2002
|
let t = await n(r, `/module-actions?module=${encodeURIComponent(e)}`), i = t?.data ?? t ?? {};
|
|
2002
2003
|
return {
|
|
2003
2004
|
actions: Array.isArray(i.actions) ? i.actions : [],
|
|
2004
2005
|
actionRules: Array.isArray(i.actionRules) ? i.actionRules : []
|
|
2005
2006
|
};
|
|
2006
2007
|
}
|
|
2007
|
-
async function
|
|
2008
|
+
async function kr(e, t) {
|
|
2008
2009
|
if (!e) throw Error("module is required");
|
|
2009
2010
|
if (!t) throw Error("id is required");
|
|
2010
|
-
let n =
|
|
2011
|
+
let n = Er[e];
|
|
2011
2012
|
if (!n) throw Error(`No edit config for module: ${e}`);
|
|
2012
2013
|
let r = await i(), a = await fetch(n.fetchUrl(t), {
|
|
2013
2014
|
method: "GET",
|
|
@@ -2020,7 +2021,7 @@ async function Tr(e, t) {
|
|
|
2020
2021
|
let o = await a.json();
|
|
2021
2022
|
return o.data ?? o;
|
|
2022
2023
|
}
|
|
2023
|
-
async function
|
|
2024
|
+
async function Ar(e, t, n, a = []) {
|
|
2024
2025
|
if (!e) throw Error("module is required");
|
|
2025
2026
|
if (!t) throw Error("id is required");
|
|
2026
2027
|
let o = await i(), s = new FormData();
|
|
@@ -2032,12 +2033,12 @@ async function Er(e, t, n, a = []) {
|
|
|
2032
2033
|
});
|
|
2033
2034
|
if (!c.ok) {
|
|
2034
2035
|
let e = await c.text();
|
|
2035
|
-
throw console.error("[updateRecord] Error response:", e), Error(
|
|
2036
|
+
throw console.error("[updateRecord] Error response:", e), Error(jr(e) || `API ${c.status}: ${c.statusText}`);
|
|
2036
2037
|
}
|
|
2037
2038
|
let l = await c.json();
|
|
2038
2039
|
return l.data ?? l;
|
|
2039
2040
|
}
|
|
2040
|
-
function
|
|
2041
|
+
function jr(e) {
|
|
2041
2042
|
let t = String(e ?? "").trim();
|
|
2042
2043
|
if (!t.startsWith("{")) return t;
|
|
2043
2044
|
try {
|
|
@@ -2047,22 +2048,22 @@ function Dr(e) {
|
|
|
2047
2048
|
return t;
|
|
2048
2049
|
}
|
|
2049
2050
|
}
|
|
2050
|
-
var
|
|
2051
|
-
async function
|
|
2051
|
+
var Mr = (e) => e?.data ?? e;
|
|
2052
|
+
async function Nr(e, t) {
|
|
2052
2053
|
if (!e || !t) return [];
|
|
2053
|
-
let i =
|
|
2054
|
+
let i = Mr(await n(r, `/module-activity?${new URLSearchParams({
|
|
2054
2055
|
module: e,
|
|
2055
2056
|
id: String(t)
|
|
2056
2057
|
}).toString()}`));
|
|
2057
2058
|
return Array.isArray(i) ? i : [];
|
|
2058
2059
|
}
|
|
2059
|
-
async function
|
|
2060
|
+
async function Pr(e) {
|
|
2060
2061
|
if (!e) return [];
|
|
2061
|
-
let t =
|
|
2062
|
+
let t = Mr(await n(r, `/notes?relatedId=${encodeURIComponent(e)}`));
|
|
2062
2063
|
return Array.isArray(t) ? t : [];
|
|
2063
2064
|
}
|
|
2064
|
-
async function
|
|
2065
|
-
return
|
|
2065
|
+
async function Fr({ relatedId: e, notes: t, title: i, notesFor: a }) {
|
|
2066
|
+
return Mr(await n(r, "/notes", {
|
|
2066
2067
|
method: "POST",
|
|
2067
2068
|
body: JSON.stringify({
|
|
2068
2069
|
relatedId: e,
|
|
@@ -2074,7 +2075,7 @@ async function jr({ relatedId: e, notes: t, title: i, notesFor: a }) {
|
|
|
2074
2075
|
}
|
|
2075
2076
|
//#endregion
|
|
2076
2077
|
//#region src/services/detailDefaults.js
|
|
2077
|
-
var
|
|
2078
|
+
var Ir = Object.freeze({
|
|
2078
2079
|
s3BaseUrl: "https://zinnext-devlopment-ap-south-1.s3.ap-south-1.amazonaws.com".replace(/\/+$/, ""),
|
|
2079
2080
|
dateFormat: "DD MMM YYYY",
|
|
2080
2081
|
booleanTrueLabel: "Yes",
|
|
@@ -2088,17 +2089,18 @@ var Mr = Object.freeze({
|
|
|
2088
2089
|
"uploadedFileName",
|
|
2089
2090
|
"uniqueName"
|
|
2090
2091
|
],
|
|
2091
|
-
phoneFormat: "3-3-4"
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2092
|
+
phoneFormat: "3-3-4",
|
|
2093
|
+
phoneCountryCode: ""
|
|
2094
|
+
}), R = { ...Ir }, Lr = null;
|
|
2095
|
+
function Rr() {
|
|
2096
|
+
return R;
|
|
2095
2097
|
}
|
|
2096
|
-
function
|
|
2098
|
+
function zr(e) {
|
|
2097
2099
|
if (!e || typeof e != "object") return {};
|
|
2098
2100
|
let t = {};
|
|
2099
|
-
return e.s3BaseUrl && (t.s3BaseUrl = String(e.s3BaseUrl).replace(/\/+$/, "")), e.dateFormat && (t.dateFormat = e.dateFormat), e.booleanTrueLabel && (t.booleanTrueLabel = e.booleanTrueLabel), e.booleanFalseLabel && (t.booleanFalseLabel = e.booleanFalseLabel), e.emptyPlaceholder && (t.emptyPlaceholder = e.emptyPlaceholder), typeof e.separator == "string" && e.separator !== "" && (t.separator = e.separator), typeof e.phoneFormat == "string" && e.phoneFormat.trim() !== "" && (t.phoneFormat = e.phoneFormat.trim()), Array.isArray(e.documentNameOrder) && e.documentNameOrder.length && (t.documentNameOrder = e.documentNameOrder), t;
|
|
2101
|
+
return e.s3BaseUrl && (t.s3BaseUrl = String(e.s3BaseUrl).replace(/\/+$/, "")), e.dateFormat && (t.dateFormat = e.dateFormat), e.booleanTrueLabel && (t.booleanTrueLabel = e.booleanTrueLabel), e.booleanFalseLabel && (t.booleanFalseLabel = e.booleanFalseLabel), e.emptyPlaceholder && (t.emptyPlaceholder = e.emptyPlaceholder), 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), t;
|
|
2100
2102
|
}
|
|
2101
|
-
function
|
|
2103
|
+
function Br(e = Vr()) {
|
|
2102
2104
|
let t = (String(e).match(/\d+/g) ?? [
|
|
2103
2105
|
"3",
|
|
2104
2106
|
"3",
|
|
@@ -2114,15 +2116,18 @@ function Ir(e = Lr()) {
|
|
|
2114
2116
|
total: r.reduce((e, t) => e + t, 0)
|
|
2115
2117
|
};
|
|
2116
2118
|
}
|
|
2117
|
-
function
|
|
2118
|
-
return
|
|
2119
|
+
function Vr() {
|
|
2120
|
+
return R.phoneFormat || Ir.phoneFormat;
|
|
2119
2121
|
}
|
|
2120
|
-
function
|
|
2121
|
-
|
|
2122
|
+
function Hr() {
|
|
2123
|
+
return R.phoneCountryCode ?? Ir.phoneCountryCode;
|
|
2124
|
+
}
|
|
2125
|
+
function Ur(e, t = Vr()) {
|
|
2126
|
+
let { total: n } = Br(t);
|
|
2122
2127
|
return String(e ?? "").replace(/\D/g, "").slice(0, n);
|
|
2123
2128
|
}
|
|
2124
|
-
function
|
|
2125
|
-
let { groups: n, sep: r } =
|
|
2129
|
+
function Wr(e, t = Vr()) {
|
|
2130
|
+
let { groups: n, sep: r } = Br(t), i = Ur(e, t);
|
|
2126
2131
|
if (!i) return "";
|
|
2127
2132
|
let a = [], o = 0;
|
|
2128
2133
|
for (let e of n) {
|
|
@@ -2131,30 +2136,30 @@ function zr(e, t = Lr()) {
|
|
|
2131
2136
|
}
|
|
2132
2137
|
return a.join(r);
|
|
2133
2138
|
}
|
|
2134
|
-
function
|
|
2135
|
-
return
|
|
2136
|
-
...
|
|
2137
|
-
...
|
|
2138
|
-
},
|
|
2139
|
+
function Gr(e) {
|
|
2140
|
+
return R = {
|
|
2141
|
+
...R,
|
|
2142
|
+
...zr(e)
|
|
2143
|
+
}, R;
|
|
2139
2144
|
}
|
|
2140
|
-
function
|
|
2141
|
-
return
|
|
2145
|
+
function Kr(e = !1) {
|
|
2146
|
+
return Lr && !e || (Lr = en().then((e) => Gr(e)).catch(() => R)), Lr;
|
|
2142
2147
|
}
|
|
2143
2148
|
//#endregion
|
|
2144
2149
|
//#region src/utils/roleFormPermissionGate.js
|
|
2145
|
-
function
|
|
2150
|
+
function qr(e, t) {
|
|
2146
2151
|
if (!e) return !0;
|
|
2147
2152
|
let n = e.find((e) => e.name === t);
|
|
2148
2153
|
return n ? n.enabled !== !1 : !0;
|
|
2149
2154
|
}
|
|
2150
|
-
function
|
|
2155
|
+
function Jr(e, t, n) {
|
|
2151
2156
|
if (!e) return !0;
|
|
2152
2157
|
let r = e.find((e) => e.name === t);
|
|
2153
2158
|
if (!r) return !0;
|
|
2154
2159
|
let i = r.fields?.find((e) => e.field === n);
|
|
2155
2160
|
return i ? i.enabled !== !1 : !0;
|
|
2156
2161
|
}
|
|
2157
|
-
function
|
|
2162
|
+
function Yr(e, t, n) {
|
|
2158
2163
|
if (!e) return !0;
|
|
2159
2164
|
let r = e.find((e) => e.name === t);
|
|
2160
2165
|
if (!r) return !0;
|
|
@@ -2164,7 +2169,7 @@ function Wr(e, t, n) {
|
|
|
2164
2169
|
}
|
|
2165
2170
|
//#endregion
|
|
2166
2171
|
//#region src/components/form/inputSecurity.js
|
|
2167
|
-
var
|
|
2172
|
+
var Xr = [
|
|
2168
2173
|
"p",
|
|
2169
2174
|
"br",
|
|
2170
2175
|
"strong",
|
|
@@ -2186,12 +2191,12 @@ var Gr = [
|
|
|
2186
2191
|
"a",
|
|
2187
2192
|
"code",
|
|
2188
2193
|
"pre"
|
|
2189
|
-
],
|
|
2194
|
+
], Zr = [
|
|
2190
2195
|
"href",
|
|
2191
2196
|
"title",
|
|
2192
2197
|
"target",
|
|
2193
2198
|
"rel"
|
|
2194
|
-
],
|
|
2199
|
+
], Qr = /[\u200B-\u200D\u2060\uFEFF]/g, $r = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, ei = /^[\p{L}\p{M}\p{N} .'-]+$/u, ti = /^\+?[0-9 ()-]+$/, ni = /^-?(?:\d+|\d*\.\d+)$/, ri = [
|
|
2195
2200
|
{
|
|
2196
2201
|
re: /<\s*\/?\s*(?:script|iframe|object|embed|svg|img|form|input|style|link|meta)\b/i,
|
|
2197
2202
|
message: "HTML/script content is not allowed"
|
|
@@ -2225,12 +2230,12 @@ var Gr = [
|
|
|
2225
2230
|
message: "Command execution patterns are not allowed"
|
|
2226
2231
|
}
|
|
2227
2232
|
];
|
|
2228
|
-
function
|
|
2233
|
+
function ii(e) {
|
|
2229
2234
|
if (typeof document > "u") return e;
|
|
2230
2235
|
let t = document.createElement("textarea");
|
|
2231
2236
|
return t.innerHTML = e, t.value;
|
|
2232
2237
|
}
|
|
2233
|
-
function
|
|
2238
|
+
function ai(e) {
|
|
2234
2239
|
let t = String(e ?? "");
|
|
2235
2240
|
for (let e = 0; e < 2; e += 1) try {
|
|
2236
2241
|
let e = decodeURIComponent(t);
|
|
@@ -2239,12 +2244,12 @@ function ei(e) {
|
|
|
2239
2244
|
} catch {
|
|
2240
2245
|
break;
|
|
2241
2246
|
}
|
|
2242
|
-
return t =
|
|
2247
|
+
return t = ii(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");
|
|
2243
2248
|
}
|
|
2244
|
-
function
|
|
2249
|
+
function oi(e) {
|
|
2245
2250
|
return Ee.sanitize(String(e ?? ""), {
|
|
2246
|
-
ALLOWED_TAGS:
|
|
2247
|
-
ALLOWED_ATTR:
|
|
2251
|
+
ALLOWED_TAGS: Xr,
|
|
2252
|
+
ALLOWED_ATTR: Zr,
|
|
2248
2253
|
ALLOW_DATA_ATTR: !1,
|
|
2249
2254
|
FORBID_TAGS: [
|
|
2250
2255
|
"script",
|
|
@@ -2264,40 +2269,40 @@ function ti(e) {
|
|
|
2264
2269
|
]
|
|
2265
2270
|
});
|
|
2266
2271
|
}
|
|
2267
|
-
function
|
|
2272
|
+
function si(e) {
|
|
2268
2273
|
let t = (e.validations ?? []).find((e) => e?.type === "max"), n = Number(e.validator?.maxLength ?? t?.value ?? e.maxLength);
|
|
2269
2274
|
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);
|
|
2270
2275
|
}
|
|
2271
|
-
function
|
|
2276
|
+
function ci(e) {
|
|
2272
2277
|
return e.type === "textarea" || e.type === "text-editor";
|
|
2273
2278
|
}
|
|
2274
|
-
function
|
|
2279
|
+
function li(e, t = {}) {
|
|
2275
2280
|
if (typeof e != "string") return e;
|
|
2276
|
-
if (t.type === "text-editor") return
|
|
2277
|
-
let n = e.normalize("NFC").replace(
|
|
2278
|
-
return n =
|
|
2281
|
+
if (t.type === "text-editor") return oi(e.normalize("NFC"));
|
|
2282
|
+
let n = e.normalize("NFC").replace(Qr, "").replace(/\u00A0/g, " ").replace($r, "");
|
|
2283
|
+
return n = ci(t) ? n.replace(/\r\n?/g, "\n").replace(/[ \t]{2,}/g, " ").trim() : n.replace(/\s+/g, " ").trim(), n;
|
|
2279
2284
|
}
|
|
2280
|
-
function
|
|
2285
|
+
function ui(e, t = {}) {
|
|
2281
2286
|
if (typeof e != "string" || e === "") return null;
|
|
2282
|
-
let n = t.label || t.field || "Field", r =
|
|
2287
|
+
let n = t.label || t.field || "Field", r = ai(e);
|
|
2283
2288
|
if (r.includes("\0") || r.includes("\0")) return `${n} contains a null byte`;
|
|
2284
2289
|
if (t.type !== "text-editor") {
|
|
2285
|
-
let e =
|
|
2290
|
+
let e = ri.find(({ re: e }) => e.test(r));
|
|
2286
2291
|
if (e) return `${n}: ${e.message}`;
|
|
2287
2292
|
} else {
|
|
2288
|
-
let e =
|
|
2293
|
+
let e = ri.slice(0, 3).find(({ re: e }) => e.test(r));
|
|
2289
2294
|
if (e) return `${n}: ${e.message}`;
|
|
2290
2295
|
}
|
|
2291
|
-
let i =
|
|
2292
|
-
return [...i].length >
|
|
2296
|
+
let i = li(e, t);
|
|
2297
|
+
return [...i].length > si(t) ? `${n} is too long` : t.formatter === "name" && i && !ei.test(i) ? `${n} allows only letters, numbers, spaces, apostrophes, hyphens and periods` : (t.formatter === "phone" || t.formatter === "digits") && i && !ti.test(i) ? `${n} contains invalid phone characters` : t.type === "number" && i && !ni.test(i) ? `${n} must contain only a valid number` : (t.type === "url" || t.formatter === "url") && i && !/^https?:\/\//i.test(i) ? `${n} must use http:// or https://` : null;
|
|
2293
2298
|
}
|
|
2294
|
-
function
|
|
2299
|
+
function di(e) {
|
|
2295
2300
|
return { validator: (t, n) => {
|
|
2296
|
-
let r = (Array.isArray(n) ? n : [n]).map((t) =>
|
|
2301
|
+
let r = (Array.isArray(n) ? n : [n]).map((t) => ui(t, e)).find(Boolean);
|
|
2297
2302
|
return r ? Promise.reject(Error(r)) : Promise.resolve();
|
|
2298
2303
|
} };
|
|
2299
2304
|
}
|
|
2300
|
-
function
|
|
2305
|
+
function fi(e = []) {
|
|
2301
2306
|
let t = /* @__PURE__ */ new Map();
|
|
2302
2307
|
return e.forEach((e) => {
|
|
2303
2308
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2309,12 +2314,12 @@ function si(e = []) {
|
|
|
2309
2314
|
});
|
|
2310
2315
|
}), t;
|
|
2311
2316
|
}
|
|
2312
|
-
function
|
|
2313
|
-
let n =
|
|
2317
|
+
function pi(e, t = []) {
|
|
2318
|
+
let n = fi(t), r = (e, t = "") => {
|
|
2314
2319
|
if (typeof e == "string") {
|
|
2315
|
-
let r = n.get(t) ?? {}, i =
|
|
2320
|
+
let r = n.get(t) ?? {}, i = ui(e, r);
|
|
2316
2321
|
if (i) throw Error(i);
|
|
2317
|
-
return
|
|
2322
|
+
return li(e, r);
|
|
2318
2323
|
}
|
|
2319
2324
|
return Array.isArray(e) ? e.map((e) => r(e, `${t}[]`)) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, n]) => {
|
|
2320
2325
|
if (e.startsWith("$") || e.includes(".") || e.includes("\0")) throw Error(`Unsafe object key: ${e}`);
|
|
@@ -2325,12 +2330,12 @@ function ci(e, t = []) {
|
|
|
2325
2330
|
}
|
|
2326
2331
|
//#endregion
|
|
2327
2332
|
//#region src/components/form/optionMatching.js
|
|
2328
|
-
function
|
|
2333
|
+
function mi(e) {
|
|
2329
2334
|
return String(e ?? "").normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
2330
2335
|
}
|
|
2331
|
-
function
|
|
2336
|
+
function hi(e) {
|
|
2332
2337
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
2333
|
-
let r =
|
|
2338
|
+
let r = mi(e);
|
|
2334
2339
|
r && !t.has(r) && t.set(r, n);
|
|
2335
2340
|
};
|
|
2336
2341
|
return (Array.isArray(e?.options) ? e.options : []).forEach((e) => {
|
|
@@ -2338,34 +2343,34 @@ function ui(e) {
|
|
|
2338
2343
|
let t = typeof e == "object" ? e.value : e;
|
|
2339
2344
|
t == null || t === "" || (n(t, t), typeof e == "object" && e.label !== void 0 && n(e.label, t));
|
|
2340
2345
|
}), Object.entries(e?.optionAliases ?? {}).forEach(([e, r]) => {
|
|
2341
|
-
let i = t.get(
|
|
2346
|
+
let i = t.get(mi(r));
|
|
2342
2347
|
i !== void 0 && n(e, i);
|
|
2343
2348
|
}), t;
|
|
2344
2349
|
}
|
|
2345
|
-
var
|
|
2346
|
-
function
|
|
2350
|
+
var gi = (e) => Array.isArray(e?.options) && e.options.length > 0;
|
|
2351
|
+
function _i(e, t) {
|
|
2347
2352
|
if (t == null || t === "" || typeof t == "object") return t;
|
|
2348
|
-
let n = e.get(
|
|
2353
|
+
let n = e.get(mi(t));
|
|
2349
2354
|
return n === void 0 ? t : n;
|
|
2350
2355
|
}
|
|
2351
|
-
function
|
|
2352
|
-
if (!
|
|
2353
|
-
let n =
|
|
2354
|
-
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) =>
|
|
2356
|
+
function vi(e, t) {
|
|
2357
|
+
if (!gi(e)) return t;
|
|
2358
|
+
let n = hi(e);
|
|
2359
|
+
return n.size === 0 ? t : Array.isArray(t) ? t.map((e) => _i(n, e)) : _i(n, t);
|
|
2355
2360
|
}
|
|
2356
2361
|
//#endregion
|
|
2357
2362
|
//#region src/components/form/payloadTransformer.js
|
|
2358
|
-
var
|
|
2359
|
-
function
|
|
2363
|
+
var z = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0, yi = (e) => e === !0 || e === 1 || e === "1", B = (e) => typeof e == "object" && !!e && !Array.isArray(e) && !bi(e);
|
|
2364
|
+
function bi(e) {
|
|
2360
2365
|
return e && typeof e == "object" && typeof e.format == "function" && typeof e.isValid == "function";
|
|
2361
2366
|
}
|
|
2362
|
-
function
|
|
2363
|
-
return
|
|
2367
|
+
function xi(e) {
|
|
2368
|
+
return bi(e) || e instanceof Date;
|
|
2364
2369
|
}
|
|
2365
|
-
function
|
|
2366
|
-
return e instanceof Date ? e.toISOString() :
|
|
2370
|
+
function Si(e) {
|
|
2371
|
+
return e instanceof Date ? e.toISOString() : bi(e) ? e.isValid() ? e.toISOString() : null : e;
|
|
2367
2372
|
}
|
|
2368
|
-
function
|
|
2373
|
+
function V(e, t) {
|
|
2369
2374
|
if (!t) return;
|
|
2370
2375
|
let n = String(t).split("."), r = e;
|
|
2371
2376
|
for (let e of n) {
|
|
@@ -2374,51 +2379,51 @@ function U(e, t) {
|
|
|
2374
2379
|
}
|
|
2375
2380
|
return r;
|
|
2376
2381
|
}
|
|
2377
|
-
function
|
|
2378
|
-
return e && Object.prototype.hasOwnProperty.call(e, t) ? e[t] :
|
|
2382
|
+
function H(e, t) {
|
|
2383
|
+
return e && Object.prototype.hasOwnProperty.call(e, t) ? e[t] : V(e, t);
|
|
2379
2384
|
}
|
|
2380
|
-
function
|
|
2381
|
-
return e && Object.prototype.hasOwnProperty.call(e, t) ? !0 :
|
|
2385
|
+
function U(e, t) {
|
|
2386
|
+
return e && Object.prototype.hasOwnProperty.call(e, t) ? !0 : V(e, t) !== void 0;
|
|
2382
2387
|
}
|
|
2383
|
-
function
|
|
2388
|
+
function W(e, t, n) {
|
|
2384
2389
|
let r = String(t).split("."), i = e;
|
|
2385
2390
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2386
2391
|
let t = r[e];
|
|
2387
|
-
|
|
2392
|
+
B(i[t]) || (i[t] = {}), i = i[t];
|
|
2388
2393
|
}
|
|
2389
2394
|
return i[r[r.length - 1]] = n, e;
|
|
2390
2395
|
}
|
|
2391
|
-
function
|
|
2396
|
+
function Ci(e, t, n) {
|
|
2392
2397
|
let r = String(t).split("."), i = e;
|
|
2393
2398
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
2394
2399
|
let t = r[e];
|
|
2395
|
-
|
|
2400
|
+
B(i[t]) || (i[t] = {}), i = i[t];
|
|
2396
2401
|
}
|
|
2397
2402
|
let a = r[r.length - 1];
|
|
2398
|
-
return i[a] =
|
|
2403
|
+
return i[a] = B(i[a]) && B(n) ? {
|
|
2399
2404
|
...n,
|
|
2400
2405
|
...i[a]
|
|
2401
2406
|
} : n, e;
|
|
2402
2407
|
}
|
|
2403
|
-
function
|
|
2408
|
+
function wi(e) {
|
|
2404
2409
|
let t = Array.isArray(e) ? e : e == null ? [] : [e];
|
|
2405
2410
|
if (!t.length || t.some((e) => e?.originFileObj)) return;
|
|
2406
2411
|
let n = t.map((e) => e?.stored).filter((e) => e != null);
|
|
2407
2412
|
if (n.length) return n.length === 1 && t.length === 1 ? n[0] : n;
|
|
2408
2413
|
}
|
|
2409
|
-
function
|
|
2414
|
+
function Ti(e, t) {
|
|
2410
2415
|
return Object.entries(t ?? {}).forEach(([t, n]) => {
|
|
2411
|
-
|
|
2416
|
+
B(n) && B(e[t]) ? Ti(e[t], n) : e[t] = n;
|
|
2412
2417
|
}), e;
|
|
2413
2418
|
}
|
|
2414
|
-
function
|
|
2419
|
+
function Ei(e, t) {
|
|
2415
2420
|
let n = e.options ?? e.values ?? [];
|
|
2416
2421
|
for (let e of n) if (typeof e == "string") {
|
|
2417
2422
|
if (e === t) return e;
|
|
2418
2423
|
} else if ((e.value ?? e.id ?? e.name ?? e.label) === t) return e.label ?? e.name ?? e.value;
|
|
2419
2424
|
}
|
|
2420
|
-
function
|
|
2421
|
-
if (
|
|
2425
|
+
function Di(e, t) {
|
|
2426
|
+
if (B(e)) {
|
|
2422
2427
|
let n = (t.valueKey && e[t.valueKey]) ?? e.value ?? e.id ?? e._id ?? e.key ?? e.code;
|
|
2423
2428
|
return {
|
|
2424
2429
|
value: n,
|
|
@@ -2427,10 +2432,10 @@ function xi(e, t) {
|
|
|
2427
2432
|
}
|
|
2428
2433
|
return {
|
|
2429
2434
|
value: e,
|
|
2430
|
-
label:
|
|
2435
|
+
label: Ei(t, e) ?? e
|
|
2431
2436
|
};
|
|
2432
2437
|
}
|
|
2433
|
-
function
|
|
2438
|
+
function Oi(e = {}) {
|
|
2434
2439
|
if (e.dataType && e.dataType !== "auto") return e.dataType;
|
|
2435
2440
|
if (e.multiSelect || e.mode === "multiple" || e.addRow) return "array";
|
|
2436
2441
|
switch (e.type) {
|
|
@@ -2440,36 +2445,36 @@ function Si(e = {}) {
|
|
|
2440
2445
|
default: return "auto";
|
|
2441
2446
|
}
|
|
2442
2447
|
}
|
|
2443
|
-
function
|
|
2444
|
-
if (
|
|
2445
|
-
if (t === "string") return
|
|
2448
|
+
function G(e, t, n = {}) {
|
|
2449
|
+
if (xi(e)) {
|
|
2450
|
+
if (t === "string") return Si(e);
|
|
2446
2451
|
if (t === "number") {
|
|
2447
|
-
let t =
|
|
2452
|
+
let t = bi(e) ? e.valueOf() : e.getTime();
|
|
2448
2453
|
return Number.isNaN(t) ? null : t;
|
|
2449
2454
|
}
|
|
2450
|
-
if (t === "date" || t === "auto" || !t) return
|
|
2455
|
+
if (t === "date" || t === "auto" || !t) return Si(e);
|
|
2451
2456
|
}
|
|
2452
2457
|
switch (t) {
|
|
2453
2458
|
case "string": return e == null ? "" : String(e);
|
|
2454
2459
|
case "number": {
|
|
2455
|
-
if (
|
|
2460
|
+
if (z(e)) return null;
|
|
2456
2461
|
let t = Number(e);
|
|
2457
2462
|
return Number.isNaN(t) ? null : t;
|
|
2458
2463
|
}
|
|
2459
2464
|
case "boolean": return e === !0 || e === 1 || e === "1" || e === "true";
|
|
2460
2465
|
case "array": {
|
|
2461
2466
|
let t;
|
|
2462
|
-
return t = Array.isArray(e) ? e :
|
|
2467
|
+
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) => G(e, n.elementType, {})).filter((e) => e != null && e !== "") : t;
|
|
2463
2468
|
}
|
|
2464
|
-
case "object": return
|
|
2465
|
-
case "date": return
|
|
2469
|
+
case "object": return B(e), e;
|
|
2470
|
+
case "date": return Si(e);
|
|
2466
2471
|
case "custom":
|
|
2467
2472
|
case "auto":
|
|
2468
2473
|
case void 0:
|
|
2469
2474
|
default: return e;
|
|
2470
2475
|
}
|
|
2471
2476
|
}
|
|
2472
|
-
var
|
|
2477
|
+
var ki = {
|
|
2473
2478
|
firstChecked: (e) => Array.isArray(e) ? e[0] : e,
|
|
2474
2479
|
csvToArray: (e) => typeof e == "string" ? e.split(",").map((e) => e.trim()).filter(Boolean) : e,
|
|
2475
2480
|
arrayToCsv: (e) => Array.isArray(e) ? e.join(",") : e,
|
|
@@ -2477,11 +2482,11 @@ var J = {
|
|
|
2477
2482
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
2478
2483
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e
|
|
2479
2484
|
};
|
|
2480
|
-
function
|
|
2485
|
+
function Ai(e, t) {
|
|
2481
2486
|
if (!t) return e;
|
|
2482
2487
|
let n = t;
|
|
2483
2488
|
if (typeof n == "string") {
|
|
2484
|
-
if (
|
|
2489
|
+
if (ki[n]) return ki[n](e);
|
|
2485
2490
|
try {
|
|
2486
2491
|
n = JSON.parse(n);
|
|
2487
2492
|
} catch {
|
|
@@ -2489,39 +2494,39 @@ function Ci(e, t) {
|
|
|
2489
2494
|
}
|
|
2490
2495
|
}
|
|
2491
2496
|
let r = e;
|
|
2492
|
-
if (n.name &&
|
|
2497
|
+
if (n.name && ki[n.name] && (r = ki[n.name](r)), n.map && typeof n.map == "object") {
|
|
2493
2498
|
let e = String(Array.isArray(r) ? r[0] : r);
|
|
2494
2499
|
Object.prototype.hasOwnProperty.call(n.map, e) ? r = n.map[e] : n.default !== void 0 && (r = n.default);
|
|
2495
2500
|
}
|
|
2496
2501
|
return r;
|
|
2497
2502
|
}
|
|
2498
|
-
var
|
|
2499
|
-
function
|
|
2503
|
+
var ji = /\{\{\s*([\w.]+)\s*\}\}/g;
|
|
2504
|
+
function Mi(e, t) {
|
|
2500
2505
|
let [n, ...r] = e.split("."), i;
|
|
2501
2506
|
if (n === "value") i = t.value;
|
|
2502
2507
|
else if (n === "label") i = t.label;
|
|
2503
2508
|
else if (n === "raw") i = t.raw;
|
|
2504
2509
|
else return;
|
|
2505
|
-
return r.length ?
|
|
2510
|
+
return r.length ? V(i, r.join(".")) : i;
|
|
2506
2511
|
}
|
|
2507
|
-
function
|
|
2512
|
+
function Ni(e, t) {
|
|
2508
2513
|
if (typeof e == "string") {
|
|
2509
2514
|
let n = e.match(/^\{\{\s*([\w.]+)\s*\}\}$/);
|
|
2510
|
-
return n ?
|
|
2511
|
-
let r =
|
|
2515
|
+
return n ? Mi(n[1], t) : e.replace(ji, (e, n) => {
|
|
2516
|
+
let r = Mi(n, t);
|
|
2512
2517
|
return r == null ? "" : String(r);
|
|
2513
2518
|
});
|
|
2514
2519
|
}
|
|
2515
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
2516
|
-
if (
|
|
2520
|
+
if (Array.isArray(e)) return e.map((e) => Ni(e, t));
|
|
2521
|
+
if (B(e)) {
|
|
2517
2522
|
let n = {};
|
|
2518
2523
|
return Object.entries(e).forEach(([e, r]) => {
|
|
2519
|
-
n[e] =
|
|
2524
|
+
n[e] = Ni(r, t);
|
|
2520
2525
|
}), n;
|
|
2521
2526
|
}
|
|
2522
2527
|
return e;
|
|
2523
2528
|
}
|
|
2524
|
-
function
|
|
2529
|
+
function Pi(e) {
|
|
2525
2530
|
if (!e) return null;
|
|
2526
2531
|
if (typeof e == "string") try {
|
|
2527
2532
|
return JSON.parse(e);
|
|
@@ -2530,36 +2535,36 @@ function Di(e) {
|
|
|
2530
2535
|
}
|
|
2531
2536
|
return e;
|
|
2532
2537
|
}
|
|
2533
|
-
function
|
|
2534
|
-
let n = e.payloadMode || "auto", r =
|
|
2538
|
+
function Fi(e, t) {
|
|
2539
|
+
let n = e.payloadMode || "auto", r = Oi(e), { value: i, label: a } = Di(t, e);
|
|
2535
2540
|
switch (n) {
|
|
2536
2541
|
case "value": return {
|
|
2537
2542
|
kind: "scalar",
|
|
2538
|
-
out:
|
|
2543
|
+
out: G(i, r, e)
|
|
2539
2544
|
};
|
|
2540
2545
|
case "label": return {
|
|
2541
2546
|
kind: "scalar",
|
|
2542
|
-
out:
|
|
2547
|
+
out: G(a, e.dataType || "string", e)
|
|
2543
2548
|
};
|
|
2544
2549
|
case "object": {
|
|
2545
2550
|
let t = e.valueKey || "id", n = e.displayKey || "name";
|
|
2546
2551
|
return {
|
|
2547
2552
|
kind: "scalar",
|
|
2548
2553
|
out: {
|
|
2549
|
-
[t]:
|
|
2554
|
+
[t]: G(i, e.elementType || "auto", {}),
|
|
2550
2555
|
[n]: a
|
|
2551
2556
|
}
|
|
2552
2557
|
};
|
|
2553
2558
|
}
|
|
2554
2559
|
case "custom":
|
|
2555
2560
|
case "template": {
|
|
2556
|
-
let n =
|
|
2561
|
+
let n = Pi(e.payloadTemplate);
|
|
2557
2562
|
if (!n) return {
|
|
2558
2563
|
kind: "scalar",
|
|
2559
|
-
out:
|
|
2564
|
+
out: G(i, r, e)
|
|
2560
2565
|
};
|
|
2561
|
-
let o =
|
|
2562
|
-
value:
|
|
2566
|
+
let o = Ni(n, {
|
|
2567
|
+
value: G(i, e.elementType || "auto", {}),
|
|
2563
2568
|
label: a,
|
|
2564
2569
|
raw: t
|
|
2565
2570
|
});
|
|
@@ -2570,19 +2575,19 @@ function Oi(e, t) {
|
|
|
2570
2575
|
}
|
|
2571
2576
|
default: return {
|
|
2572
2577
|
kind: "scalar",
|
|
2573
|
-
out:
|
|
2578
|
+
out: G(i, r, e)
|
|
2574
2579
|
};
|
|
2575
2580
|
}
|
|
2576
2581
|
}
|
|
2577
|
-
function
|
|
2582
|
+
function Ii(e, t) {
|
|
2578
2583
|
if (e.payloadMode === "skip") return { kind: "skip" };
|
|
2579
2584
|
let n = t;
|
|
2580
|
-
return
|
|
2585
|
+
return z(n) && e.defaultValue !== void 0 && e.defaultValue !== "" && (n = e.defaultValue), n = Ai(n, e.transformRule), z(n) && e.omitEmpty ? { kind: "skip" } : Array.isArray(n) && (Oi(e) === "array" || e.payloadMode === "object") && e.payloadMode && e.payloadMode !== "value" && e.payloadMode !== "auto" ? {
|
|
2581
2586
|
kind: "scalar",
|
|
2582
|
-
out: n.map((t) =>
|
|
2583
|
-
} :
|
|
2587
|
+
out: n.map((t) => Fi(e, t).out)
|
|
2588
|
+
} : Fi(e, n);
|
|
2584
2589
|
}
|
|
2585
|
-
function
|
|
2590
|
+
function Li(e = {}) {
|
|
2586
2591
|
return !!e.richValue || [
|
|
2587
2592
|
"label",
|
|
2588
2593
|
"object",
|
|
@@ -2590,10 +2595,10 @@ function Ai(e = {}) {
|
|
|
2590
2595
|
"template"
|
|
2591
2596
|
].includes(e.payloadMode);
|
|
2592
2597
|
}
|
|
2593
|
-
function
|
|
2594
|
-
if (!
|
|
2598
|
+
function Ri(e, t, n = []) {
|
|
2599
|
+
if (!Li(e) || t == null) return t;
|
|
2595
2600
|
let r = (e) => {
|
|
2596
|
-
if (
|
|
2601
|
+
if (B(e) && e.value !== void 0) return e;
|
|
2597
2602
|
let t = n.find((t) => String(t?.value ?? "") === String(e) || String(t?.label ?? "") === String(e));
|
|
2598
2603
|
return {
|
|
2599
2604
|
value: t?.value ?? e,
|
|
@@ -2602,9 +2607,9 @@ function ji(e, t, n = []) {
|
|
|
2602
2607
|
};
|
|
2603
2608
|
return Array.isArray(t) ? t.map(r) : r(t);
|
|
2604
2609
|
}
|
|
2605
|
-
function
|
|
2610
|
+
function zi(e, t, n) {
|
|
2606
2611
|
if (!e?.field) return !0;
|
|
2607
|
-
let r =
|
|
2612
|
+
let r = U(t, e.field) ? H(t, e.field) : H(n ?? t, e.field), i = () => String(e.value ?? "").split(",").map((e) => e.trim());
|
|
2608
2613
|
switch (e.operator) {
|
|
2609
2614
|
case "eq": return String(r ?? "") === String(e.value ?? "");
|
|
2610
2615
|
case "neq": return String(r ?? "") !== String(e.value ?? "");
|
|
@@ -2616,45 +2621,45 @@ function Mi(e, t, n) {
|
|
|
2616
2621
|
default: return !0;
|
|
2617
2622
|
}
|
|
2618
2623
|
}
|
|
2619
|
-
function
|
|
2624
|
+
function Bi(e) {
|
|
2620
2625
|
let t = [];
|
|
2621
2626
|
return e?.field && t.push(e.field), Array.isArray(e?.conditions) && e.conditions.forEach((e) => {
|
|
2622
2627
|
e?.field && t.push(e.field);
|
|
2623
2628
|
}), t;
|
|
2624
2629
|
}
|
|
2625
|
-
function
|
|
2630
|
+
function Vi(e, t, n) {
|
|
2626
2631
|
if (!e) return !0;
|
|
2627
2632
|
let r = Array.isArray(e.conditions) ? e.conditions.filter((e) => e?.field) : [];
|
|
2628
2633
|
if (r.length) {
|
|
2629
|
-
let i = r.map((e) =>
|
|
2634
|
+
let i = r.map((e) => zi(e, t, n)), a = String(e.logic ?? "and").toLowerCase() === "or", o = a ? i.some(Boolean) : i.every(Boolean);
|
|
2630
2635
|
if (e.field) {
|
|
2631
|
-
let r =
|
|
2636
|
+
let r = zi(e, t, n);
|
|
2632
2637
|
o = a ? o || r : o && r;
|
|
2633
2638
|
}
|
|
2634
2639
|
return o;
|
|
2635
2640
|
}
|
|
2636
|
-
return
|
|
2641
|
+
return zi(e, t, n);
|
|
2637
2642
|
}
|
|
2638
|
-
function
|
|
2639
|
-
let a =
|
|
2640
|
-
return !a.length || i.has(e.field) ? !0 : (i.add(e.field),
|
|
2643
|
+
function Hi(e, t, n, r, i = /* @__PURE__ */ new Set()) {
|
|
2644
|
+
let a = Bi(e?.showIf);
|
|
2645
|
+
return !a.length || i.has(e.field) ? !0 : (i.add(e.field), Vi(e.showIf, t, n) ? a.every((e) => {
|
|
2641
2646
|
let a = r?.get?.(e);
|
|
2642
|
-
return a ?
|
|
2647
|
+
return a ? Hi(a, t, n, r, i) : !0;
|
|
2643
2648
|
}) : !1);
|
|
2644
2649
|
}
|
|
2645
|
-
function
|
|
2650
|
+
function Ui(e = []) {
|
|
2646
2651
|
let t = /* @__PURE__ */ new Map();
|
|
2647
2652
|
return e.forEach((e) => (e.fields ?? []).forEach((e) => {
|
|
2648
2653
|
e?.field && !t.has(e.field) && t.set(e.field, e);
|
|
2649
2654
|
})), t;
|
|
2650
2655
|
}
|
|
2651
|
-
function
|
|
2656
|
+
function Wi(e = {}, { editing: t = !1 } = {}) {
|
|
2652
2657
|
let n = {};
|
|
2653
2658
|
return (e.fields ?? []).forEach((e) => {
|
|
2654
|
-
!e.field || e
|
|
2659
|
+
!e.field || K(e) || t && !e.defaultOnEdit || e.defaultValue === void 0 || e.defaultValue === "" || (n[e.field] = e.defaultValue);
|
|
2655
2660
|
}), n;
|
|
2656
2661
|
}
|
|
2657
|
-
function
|
|
2662
|
+
function Gi(e = []) {
|
|
2658
2663
|
let t = [];
|
|
2659
2664
|
return e.forEach((e) => {
|
|
2660
2665
|
(e.fields ?? []).forEach((n) => {
|
|
@@ -2665,27 +2670,27 @@ function Ri(e = []) {
|
|
|
2665
2670
|
});
|
|
2666
2671
|
}), t;
|
|
2667
2672
|
}
|
|
2668
|
-
var
|
|
2673
|
+
var Ki = [
|
|
2669
2674
|
"file",
|
|
2670
2675
|
"document",
|
|
2671
2676
|
"image",
|
|
2672
2677
|
"upload",
|
|
2673
2678
|
"attachment"
|
|
2674
2679
|
];
|
|
2675
|
-
function
|
|
2676
|
-
return
|
|
2680
|
+
function K(e) {
|
|
2681
|
+
return Ki.includes(String(e?.type ?? "").trim().toLowerCase());
|
|
2677
2682
|
}
|
|
2678
|
-
function
|
|
2679
|
-
return
|
|
2683
|
+
function qi(e = []) {
|
|
2684
|
+
return Gi(e).map(({ field: e }) => e).filter(K);
|
|
2680
2685
|
}
|
|
2681
|
-
function
|
|
2686
|
+
function Ji(e) {
|
|
2682
2687
|
return String(e ?? "").trim().toLowerCase();
|
|
2683
2688
|
}
|
|
2684
|
-
function
|
|
2685
|
-
return !!t &&
|
|
2689
|
+
function Yi(e, t) {
|
|
2690
|
+
return !!t && Ji(e.moduleName) === t;
|
|
2686
2691
|
}
|
|
2687
|
-
function
|
|
2688
|
-
let r = [], i = n.scope ?? "all", a =
|
|
2692
|
+
function Xi(e, t = [], n = {}) {
|
|
2693
|
+
let r = [], i = n.scope ?? "all", a = Ji(n.module), o = (e, t) => {
|
|
2689
2694
|
t != null && (Array.isArray(t) ? t : [t]).forEach((t) => {
|
|
2690
2695
|
let n = t?.originFileObj || t;
|
|
2691
2696
|
(typeof File < "u" && n instanceof File || typeof Blob < "u" && n instanceof Blob) && r.push({
|
|
@@ -2695,9 +2700,9 @@ function Wi(e, t = [], n = {}) {
|
|
|
2695
2700
|
});
|
|
2696
2701
|
};
|
|
2697
2702
|
return (t ?? []).forEach((t) => {
|
|
2698
|
-
let r = (t.fields ?? []).filter(
|
|
2703
|
+
let r = (t.fields ?? []).filter(K);
|
|
2699
2704
|
if (!r.length) return;
|
|
2700
|
-
let s = t.moduleName && !
|
|
2705
|
+
let s = t.moduleName && !Yi(t, a), c = (e) => s ? `__mw__${t.moduleName}__${e}` : e;
|
|
2701
2706
|
if (t.addRow) {
|
|
2702
2707
|
if (i === "flat") return;
|
|
2703
2708
|
let a = e[t.name];
|
|
@@ -2705,89 +2710,89 @@ function Wi(e, t = [], n = {}) {
|
|
|
2705
2710
|
r.forEach((e) => {
|
|
2706
2711
|
let t = e.fileKey ?? String(e.field).split(".")[0];
|
|
2707
2712
|
a.forEach((r, i) => {
|
|
2708
|
-
o(c(n.indexed ? `${t}[${i}]` : t),
|
|
2713
|
+
o(c(n.indexed ? `${t}[${i}]` : t), H(r, e.field));
|
|
2709
2714
|
});
|
|
2710
2715
|
});
|
|
2711
2716
|
return;
|
|
2712
2717
|
}
|
|
2713
2718
|
i !== "addRow" && r.forEach((t) => {
|
|
2714
|
-
o(c(t.fileKey ?? String(t.field).split(".")[0]),
|
|
2719
|
+
o(c(t.fileKey ?? String(t.field).split(".")[0]), H(e, t.field));
|
|
2715
2720
|
});
|
|
2716
2721
|
}), r;
|
|
2717
2722
|
}
|
|
2718
|
-
function
|
|
2719
|
-
let r =
|
|
2720
|
-
|
|
2721
|
-
(e.payloadKey || e.field) && (
|
|
2723
|
+
function Zi(e, t, n = {}) {
|
|
2724
|
+
let r = B(n.base) ? structuredClone(n.base) : {};
|
|
2725
|
+
qi(t).forEach((e) => {
|
|
2726
|
+
(e.payloadKey || e.field) && (ea(r, e.payloadKey || e.field), ea(r, e.field));
|
|
2722
2727
|
});
|
|
2723
|
-
let i =
|
|
2728
|
+
let i = Ji(n.module), a = Ui(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));
|
|
2724
2729
|
return (t ?? []).forEach((t) => {
|
|
2725
|
-
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField &&
|
|
2726
|
-
if (t.toggleEnabled && t.toggleField &&
|
|
2727
|
-
|
|
2730
|
+
let n = s(t), r = t.fields ?? [], i = t.toggleEnabled && t.toggleField && U(e, t.toggleField) ? !!H(e, t.toggleField) : !1;
|
|
2731
|
+
if (t.toggleEnabled && t.toggleField && U(e, t.toggleField) && (W(n, t.toggleField, i), i && t.addRow)) {
|
|
2732
|
+
W(n, t.payloadKey || t.name, []);
|
|
2728
2733
|
return;
|
|
2729
2734
|
}
|
|
2730
2735
|
if (t.addRow) {
|
|
2731
2736
|
let i = e[t.name];
|
|
2732
2737
|
if (!Array.isArray(i)) return;
|
|
2733
|
-
|
|
2738
|
+
W(n, t.payloadKey || t.name, i.map((t) => $i(r, t, e, a)).filter((e) => e && Object.keys(e).length > 0));
|
|
2734
2739
|
return;
|
|
2735
2740
|
}
|
|
2736
|
-
r.forEach((t) =>
|
|
2741
|
+
r.forEach((t) => Qi(t, e, n, e, a));
|
|
2737
2742
|
}), o.size > 0 && (r.moduleWrites = Array.from(o, ([e, t]) => ({
|
|
2738
2743
|
moduleName: e,
|
|
2739
2744
|
data: t
|
|
2740
|
-
}))),
|
|
2745
|
+
}))), pi(r, t);
|
|
2741
2746
|
}
|
|
2742
|
-
function
|
|
2743
|
-
if (e
|
|
2744
|
-
let i =
|
|
2747
|
+
function Qi(e, t, n, r, i) {
|
|
2748
|
+
if (K(e)) {
|
|
2749
|
+
let i = wi(H(t, e.field));
|
|
2745
2750
|
if (i !== void 0) {
|
|
2746
2751
|
let a = r !== void 0 && r !== t;
|
|
2747
|
-
|
|
2752
|
+
Ci(n, e.payloadKey || (a ? e.field : e.fileKey || e.field), i);
|
|
2748
2753
|
}
|
|
2749
2754
|
return;
|
|
2750
2755
|
}
|
|
2751
|
-
if (
|
|
2752
|
-
(r === void 0 || r === t) &&
|
|
2756
|
+
if (Bi(e.showIf).length && !Hi(e, t, r, i)) {
|
|
2757
|
+
(r === void 0 || r === t) && U(t, e.field) && W(n, e.payloadKey || e.field, null);
|
|
2753
2758
|
return;
|
|
2754
2759
|
}
|
|
2755
2760
|
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
2756
|
-
if (!
|
|
2757
|
-
let a =
|
|
2761
|
+
if (!U(t, e.field)) return;
|
|
2762
|
+
let a = H(t, e.field);
|
|
2758
2763
|
if (!Array.isArray(a)) return;
|
|
2759
|
-
let o = a.map((t) =>
|
|
2760
|
-
|
|
2764
|
+
let o = a.map((t) => $i(e.subFields, t, r, i)).filter((e) => e && Object.keys(e).length > 0);
|
|
2765
|
+
W(n, e.payloadKey || e.field, o);
|
|
2761
2766
|
return;
|
|
2762
2767
|
}
|
|
2763
|
-
if (!
|
|
2764
|
-
if (
|
|
2765
|
-
let r =
|
|
2766
|
-
|
|
2768
|
+
if (!U(t, e.field)) return;
|
|
2769
|
+
if (yi(e.addRow) && (!Array.isArray(e.subFields) || e.subFields.length === 0)) {
|
|
2770
|
+
let r = H(t, e.field), i = Array.isArray(r) ? r : z(r) ? [] : [r], a = na(e), o = i.map((e) => Ii(a, e)).filter((e) => e.kind !== "skip").map((e) => e.out);
|
|
2771
|
+
W(n, e.payloadKey || e.field, o);
|
|
2767
2772
|
return;
|
|
2768
2773
|
}
|
|
2769
|
-
let a =
|
|
2774
|
+
let a = Ii(e, H(t, e.field));
|
|
2770
2775
|
if (a.kind !== "skip") {
|
|
2771
|
-
if (a.kind === "spread" &&
|
|
2772
|
-
|
|
2776
|
+
if (a.kind === "spread" && B(a.out)) {
|
|
2777
|
+
Ti(n, a.out);
|
|
2773
2778
|
return;
|
|
2774
2779
|
}
|
|
2775
|
-
|
|
2780
|
+
W(n, e.payloadKey || e.field, a.out);
|
|
2776
2781
|
}
|
|
2777
2782
|
}
|
|
2778
|
-
function
|
|
2783
|
+
function $i(e, t, n, r) {
|
|
2779
2784
|
let i = {};
|
|
2780
|
-
return e.forEach((e) =>
|
|
2785
|
+
return e.forEach((e) => Qi(e, t, i, n ?? t, r)), i;
|
|
2781
2786
|
}
|
|
2782
|
-
function
|
|
2787
|
+
function ea(e, t) {
|
|
2783
2788
|
let n = String(t).split("."), r = e;
|
|
2784
2789
|
for (let e = 0; e < n.length - 1; e += 1) {
|
|
2785
|
-
if (!
|
|
2790
|
+
if (!B(r[n[e]])) return;
|
|
2786
2791
|
r = r[n[e]];
|
|
2787
2792
|
}
|
|
2788
2793
|
delete r[n[n.length - 1]];
|
|
2789
2794
|
}
|
|
2790
|
-
var
|
|
2795
|
+
var ta = new Set([
|
|
2791
2796
|
"text",
|
|
2792
2797
|
"textarea",
|
|
2793
2798
|
"email",
|
|
@@ -2799,14 +2804,14 @@ var Yi = new Set([
|
|
|
2799
2804
|
"datetime",
|
|
2800
2805
|
"password"
|
|
2801
2806
|
]);
|
|
2802
|
-
function
|
|
2807
|
+
function q(e, t) {
|
|
2803
2808
|
let n = (t) => (Array.isArray(e.emptyValues) ? e.emptyValues : []).some((e) => String(e) === String(t)), r = () => e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "" ? e.defaultValue : void 0;
|
|
2804
2809
|
if (t == null) return r() ?? t;
|
|
2805
2810
|
if (n(t)) return r();
|
|
2806
|
-
if (
|
|
2807
|
-
if (
|
|
2811
|
+
if (z(t) && e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "") return e.defaultValue;
|
|
2812
|
+
if (ta.has(e.type) && B(t)) {
|
|
2808
2813
|
let n = String(e.payloadKey || e.field || "").split(".").pop(), r = n ? t[n] : void 0;
|
|
2809
|
-
if (r === void 0 ||
|
|
2814
|
+
if (r === void 0 || B(r)) return;
|
|
2810
2815
|
t = r;
|
|
2811
2816
|
}
|
|
2812
2817
|
if (e.type === "date" || e.type === "time") {
|
|
@@ -2814,8 +2819,8 @@ function Y(e, t) {
|
|
|
2814
2819
|
let e = ge(t);
|
|
2815
2820
|
return e.isValid() ? e : null;
|
|
2816
2821
|
}
|
|
2817
|
-
t =
|
|
2818
|
-
let i = (t) =>
|
|
2822
|
+
t = vi(e, t);
|
|
2823
|
+
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" ? !1 : Oi(e) === "array", o = (t) => {
|
|
2819
2824
|
if (t == null || t === "" || !Array.isArray(e.options)) return t;
|
|
2820
2825
|
let n = e.options.find((e) => String(e?.value ?? "").toLowerCase() === String(t).toLowerCase());
|
|
2821
2826
|
return n ? n.value : t;
|
|
@@ -2827,7 +2832,7 @@ function Y(e, t) {
|
|
|
2827
2832
|
}
|
|
2828
2833
|
return t;
|
|
2829
2834
|
}
|
|
2830
|
-
function
|
|
2835
|
+
function na(e = {}) {
|
|
2831
2836
|
return {
|
|
2832
2837
|
...e,
|
|
2833
2838
|
addRow: !1,
|
|
@@ -2836,26 +2841,26 @@ function Xi(e = {}) {
|
|
|
2836
2841
|
dataType: void 0
|
|
2837
2842
|
};
|
|
2838
2843
|
}
|
|
2839
|
-
function
|
|
2844
|
+
function ra(e, t) {
|
|
2840
2845
|
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;
|
|
2841
2846
|
if (Array.isArray(e.subFields) && e.subFields.length > 0) {
|
|
2842
2847
|
let i = [];
|
|
2843
2848
|
Array.isArray(t) && (i = t.map((t) => {
|
|
2844
2849
|
let n = {};
|
|
2845
2850
|
return e.subFields.forEach((e) => {
|
|
2846
|
-
if (!e.field || e
|
|
2847
|
-
let r =
|
|
2848
|
-
r != null && (n[e.field] =
|
|
2851
|
+
if (!e.field || K(e)) return;
|
|
2852
|
+
let r = V(t ?? {}, e.field) ?? (t ?? {})[e.field];
|
|
2853
|
+
r != null && (n[e.field] = q(e, r));
|
|
2849
2854
|
}), n;
|
|
2850
2855
|
}));
|
|
2851
2856
|
let a = i.length > 0 ? n : Math.max(n, r);
|
|
2852
2857
|
for (; i.length < a;) i.push({});
|
|
2853
2858
|
return i;
|
|
2854
2859
|
}
|
|
2855
|
-
let i =
|
|
2856
|
-
if (Array.isArray(t)) a = t.map((e) =>
|
|
2860
|
+
let i = na(e), a = [];
|
|
2861
|
+
if (Array.isArray(t)) a = t.map((e) => q(i, e)).filter((e) => e != null && e !== "");
|
|
2857
2862
|
else if (t != null && t !== "") {
|
|
2858
|
-
let e =
|
|
2863
|
+
let e = q(i, t);
|
|
2859
2864
|
e != null && e !== "" && (a = [e]);
|
|
2860
2865
|
}
|
|
2861
2866
|
let o = a.length > 0 ? n : Math.max(n, r);
|
|
@@ -2864,12 +2869,12 @@ function Zi(e, t) {
|
|
|
2864
2869
|
}
|
|
2865
2870
|
//#endregion
|
|
2866
2871
|
//#region src/components/form/linkedAddRowGroups.js
|
|
2867
|
-
var
|
|
2868
|
-
function
|
|
2872
|
+
var ia = (e) => e === !0 || e === 1 || e === "1";
|
|
2873
|
+
function aa(e = []) {
|
|
2869
2874
|
let t = /* @__PURE__ */ new Map();
|
|
2870
2875
|
e.forEach((e) => {
|
|
2871
2876
|
let n = e?.linkGroup;
|
|
2872
|
-
!
|
|
2877
|
+
!ia(e?.addRow) || !n || (t.has(n) || t.set(n, []), t.get(n).push(e.name));
|
|
2873
2878
|
});
|
|
2874
2879
|
let n = /* @__PURE__ */ new Map();
|
|
2875
2880
|
return t.forEach((e, t) => {
|
|
@@ -2879,11 +2884,11 @@ function $i(e = []) {
|
|
|
2879
2884
|
});
|
|
2880
2885
|
}), n;
|
|
2881
2886
|
}
|
|
2882
|
-
function
|
|
2887
|
+
function oa(e, t) {
|
|
2883
2888
|
for (let n of e.values()) if (n.memberNames.includes(t)) return n;
|
|
2884
2889
|
return null;
|
|
2885
2890
|
}
|
|
2886
|
-
function
|
|
2891
|
+
function sa(e, t = {}) {
|
|
2887
2892
|
let n = { ...t };
|
|
2888
2893
|
return e.forEach(({ memberNames: e }) => {
|
|
2889
2894
|
let t = Math.max(...e.map((e) => (n[e] ?? []).length));
|
|
@@ -2895,7 +2900,7 @@ function ta(e, t = {}) {
|
|
|
2895
2900
|
}
|
|
2896
2901
|
//#endregion
|
|
2897
2902
|
//#region src/services/aiActionApi.js
|
|
2898
|
-
async function
|
|
2903
|
+
async function ca({ module: e, group: t, field: n, actionKey: a, inputs: o = {}, files: s = {} }) {
|
|
2899
2904
|
if (!e || !t || !n || !a) throw Error("module, group, field and actionKey are required to run an AI action");
|
|
2900
2905
|
let c = await i(), l = new FormData();
|
|
2901
2906
|
l.append("json", JSON.stringify({ inputs: o })), Object.entries(s).forEach(([e, t]) => {
|
|
@@ -2921,7 +2926,7 @@ async function na({ module: e, group: t, field: n, actionKey: a, inputs: o = {},
|
|
|
2921
2926
|
}
|
|
2922
2927
|
//#endregion
|
|
2923
2928
|
//#region src/components/detail/renderConfig.js
|
|
2924
|
-
var
|
|
2929
|
+
var la = [
|
|
2925
2930
|
{
|
|
2926
2931
|
value: "auto",
|
|
2927
2932
|
label: "Default (auto)"
|
|
@@ -2978,7 +2983,7 @@ var ra = [
|
|
|
2978
2983
|
value: "html",
|
|
2979
2984
|
label: "HTML"
|
|
2980
2985
|
}
|
|
2981
|
-
],
|
|
2986
|
+
], ua = [
|
|
2982
2987
|
{
|
|
2983
2988
|
value: "preview",
|
|
2984
2989
|
label: "Preview (viewer)"
|
|
@@ -2999,7 +3004,7 @@ var ra = [
|
|
|
2999
3004
|
value: "text",
|
|
3000
3005
|
label: "Text (filename)"
|
|
3001
3006
|
}
|
|
3002
|
-
],
|
|
3007
|
+
], da = [
|
|
3003
3008
|
{
|
|
3004
3009
|
value: "none",
|
|
3005
3010
|
label: "None"
|
|
@@ -3016,71 +3021,71 @@ var ra = [
|
|
|
3016
3021
|
value: "title",
|
|
3017
3022
|
label: "Title Case"
|
|
3018
3023
|
}
|
|
3019
|
-
],
|
|
3024
|
+
], fa = [
|
|
3020
3025
|
"location",
|
|
3021
3026
|
"path",
|
|
3022
3027
|
"url",
|
|
3023
3028
|
"key"
|
|
3024
|
-
],
|
|
3029
|
+
], pa = [
|
|
3025
3030
|
"location",
|
|
3026
3031
|
"filepath",
|
|
3027
3032
|
"path",
|
|
3028
3033
|
"url",
|
|
3029
3034
|
"key"
|
|
3030
|
-
],
|
|
3035
|
+
], ma = [
|
|
3031
3036
|
"uploadedfilename",
|
|
3032
3037
|
"uploadname",
|
|
3033
3038
|
"originalname",
|
|
3034
3039
|
"displayname",
|
|
3035
3040
|
"documentname",
|
|
3036
3041
|
"filename"
|
|
3037
|
-
],
|
|
3038
|
-
function
|
|
3042
|
+
], ha = ["name"], ga = (e) => String(e).toLowerCase(), _a = (e) => e == null || e === "";
|
|
3043
|
+
function va(e, t) {
|
|
3039
3044
|
for (let n of t) {
|
|
3040
3045
|
let t = e[n];
|
|
3041
3046
|
if (typeof t == "string" && t) return t;
|
|
3042
3047
|
}
|
|
3043
3048
|
return "";
|
|
3044
3049
|
}
|
|
3045
|
-
function
|
|
3046
|
-
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r &&
|
|
3050
|
+
function ya(e, t) {
|
|
3051
|
+
for (let n of t) for (let [t, r] of Object.entries(e)) if (typeof r == "string" && r && ga(t).endsWith(n)) return r;
|
|
3047
3052
|
return "";
|
|
3048
3053
|
}
|
|
3049
|
-
function
|
|
3054
|
+
function ba(e) {
|
|
3050
3055
|
if (!e) return "";
|
|
3051
3056
|
let t = String(e).split("?")[0].split("#")[0];
|
|
3052
3057
|
return decodeURIComponent(t.split("/").pop() || "");
|
|
3053
3058
|
}
|
|
3054
|
-
function
|
|
3059
|
+
function J(e) {
|
|
3055
3060
|
if (!e) return "";
|
|
3056
3061
|
let t = String(e);
|
|
3057
3062
|
if (/^https?:\/\//i.test(t)) return t;
|
|
3058
|
-
let n =
|
|
3063
|
+
let n = Rr().s3BaseUrl || "";
|
|
3059
3064
|
return n ? `${n}/${t.replace(/^\/+/, "")}` : "";
|
|
3060
3065
|
}
|
|
3061
|
-
function
|
|
3062
|
-
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" :
|
|
3066
|
+
function xa(e) {
|
|
3067
|
+
return typeof e == "string" ? e.includes("/") ? e : "" : !e || typeof e != "object" ? "" : va(e, fa) || ya(e, pa);
|
|
3063
3068
|
}
|
|
3064
|
-
function
|
|
3065
|
-
return e ? typeof e == "string" ?
|
|
3069
|
+
function Sa(e) {
|
|
3070
|
+
return e ? typeof e == "string" ? ba(e) || e : typeof e == "object" && (va(e, Rr().documentNameOrder ?? []) || ya(e, ma) || ba(xa(e)) || ya(e, ha)) || "Document" : "Document";
|
|
3066
3071
|
}
|
|
3067
|
-
function
|
|
3068
|
-
if (
|
|
3072
|
+
function Ca(e) {
|
|
3073
|
+
if (_a(e)) return [];
|
|
3069
3074
|
let t = Array.isArray(e) ? e : [e], n = [];
|
|
3070
|
-
for (let e of t) if (!
|
|
3075
|
+
for (let e of t) if (!_a(e)) {
|
|
3071
3076
|
if (typeof e == "string") {
|
|
3072
3077
|
let t = e.includes("/") ? e : "";
|
|
3073
3078
|
n.push({
|
|
3074
3079
|
location: t,
|
|
3075
|
-
name:
|
|
3076
|
-
url:
|
|
3080
|
+
name: ba(e) || e,
|
|
3081
|
+
url: J(t)
|
|
3077
3082
|
});
|
|
3078
3083
|
} else if (typeof e == "object") {
|
|
3079
|
-
let t =
|
|
3084
|
+
let t = xa(e), r = e.fileUrl || e.downloadUrl || e.signedUrl || "";
|
|
3080
3085
|
n.push({
|
|
3081
3086
|
location: t,
|
|
3082
|
-
name:
|
|
3083
|
-
url: r ||
|
|
3087
|
+
name: Sa(e),
|
|
3088
|
+
url: r || J(t)
|
|
3084
3089
|
});
|
|
3085
3090
|
}
|
|
3086
3091
|
}
|
|
@@ -3088,12 +3093,12 @@ function _a(e) {
|
|
|
3088
3093
|
}
|
|
3089
3094
|
//#endregion
|
|
3090
3095
|
//#region src/components/form/applyGroupValues.js
|
|
3091
|
-
var
|
|
3092
|
-
function
|
|
3096
|
+
var wa = (e) => e === !0 || e === 1 || e === "1", Ta = (e) => e == null || e === "";
|
|
3097
|
+
function Ea(e) {
|
|
3093
3098
|
return String(e ?? "").split(".").map((e) => e.trim()).filter(Boolean);
|
|
3094
3099
|
}
|
|
3095
|
-
function
|
|
3096
|
-
let r = Array.isArray(t) ? t :
|
|
3100
|
+
function Y(e, t, n) {
|
|
3101
|
+
let r = Array.isArray(t) ? t : Ea(t);
|
|
3097
3102
|
if (!r.length) return e;
|
|
3098
3103
|
let i = e;
|
|
3099
3104
|
for (let e = 0; e < r.length - 1; e += 1) {
|
|
@@ -3102,23 +3107,23 @@ function Z(e, t, n) {
|
|
|
3102
3107
|
}
|
|
3103
3108
|
return i[r[r.length - 1]] = n, e;
|
|
3104
3109
|
}
|
|
3105
|
-
function
|
|
3110
|
+
function Da(e, t = []) {
|
|
3106
3111
|
if (!(!e || typeof e != "object")) for (let n of t) {
|
|
3107
3112
|
if (!n) continue;
|
|
3108
|
-
let t =
|
|
3109
|
-
if (!
|
|
3113
|
+
let t = V(e, n);
|
|
3114
|
+
if (!Ta(t)) return t;
|
|
3110
3115
|
}
|
|
3111
3116
|
}
|
|
3112
|
-
function
|
|
3117
|
+
function X(e, t) {
|
|
3113
3118
|
if (!e || typeof e != "object") return;
|
|
3114
|
-
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !
|
|
3119
|
+
let n = Object.entries(e), r = n.find(([e, n]) => t.test(e) && !Ta(n));
|
|
3115
3120
|
if (r) return r[1];
|
|
3116
3121
|
for (let [, e] of n) if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
3117
|
-
let n =
|
|
3118
|
-
if (!
|
|
3122
|
+
let n = X(e, t);
|
|
3123
|
+
if (!Ta(n)) return n;
|
|
3119
3124
|
}
|
|
3120
3125
|
}
|
|
3121
|
-
function
|
|
3126
|
+
function Oa(e, t) {
|
|
3122
3127
|
let n = Array.isArray(e) ? e : e ? [e] : [];
|
|
3123
3128
|
if (!n.length) return;
|
|
3124
3129
|
let r = n.map((e, n) => {
|
|
@@ -3128,9 +3133,9 @@ function Sa(e, t) {
|
|
|
3128
3133
|
status: "done"
|
|
3129
3134
|
};
|
|
3130
3135
|
if (!e || typeof e != "object") return null;
|
|
3131
|
-
let r =
|
|
3136
|
+
let r = Da(e, [t.fileUrlKey, t.locationKey]) ?? X(e, /(location|url|path)$/i) ?? "", i = Da(e, [t.fileNameKey]) ?? X(e, /(uploadName|uploadedFileName|fileName|name)$/i) ?? "";
|
|
3132
3137
|
if (!r && !i) return null;
|
|
3133
|
-
let a = r && !String(r).startsWith("http") ?
|
|
3138
|
+
let a = r && !String(r).startsWith("http") ? J(r) : r;
|
|
3134
3139
|
return {
|
|
3135
3140
|
uid: String(e.id ?? e._id ?? e.uniqueName ?? e.documentCopyUniqueName ?? `${t.field}-${n}`),
|
|
3136
3141
|
name: i || "file",
|
|
@@ -3142,11 +3147,11 @@ function Sa(e, t) {
|
|
|
3142
3147
|
}).filter(Boolean);
|
|
3143
3148
|
return r.length ? r : void 0;
|
|
3144
3149
|
}
|
|
3145
|
-
function
|
|
3150
|
+
function ka(e, t) {
|
|
3146
3151
|
if (!e || typeof e != "object") return;
|
|
3147
|
-
let n =
|
|
3152
|
+
let n = Da(e, [t.fileNameKey, t.field]) ?? X(e, /(uploadName|uploadedFileName|fileName|name)$/i), r = Da(e, [t.fileUrlKey, t.locationKey]) ?? X(e, /(location|url|path)$/i) ?? "";
|
|
3148
3153
|
if (!n && !r) return;
|
|
3149
|
-
let i = r && !String(r).startsWith("http") ?
|
|
3154
|
+
let i = r && !String(r).startsWith("http") ? J(r) : r, a = e.documentCopyUniqueName ?? e.uniqueName ?? n ?? `${t.field}-0`;
|
|
3150
3155
|
return [{
|
|
3151
3156
|
uid: String(a),
|
|
3152
3157
|
name: n ?? "file",
|
|
@@ -3155,42 +3160,42 @@ function Ca(e, t) {
|
|
|
3155
3160
|
url: i || void 0
|
|
3156
3161
|
}];
|
|
3157
3162
|
}
|
|
3158
|
-
function
|
|
3163
|
+
function Aa(e) {
|
|
3159
3164
|
let t = Array.isArray(e.rows) ? e.rows : null, n = Math.max(0, Number(e.minRows ?? 0) || 0), r = (t, n, r) => {
|
|
3160
3165
|
let i = {};
|
|
3161
3166
|
return (e.fields ?? []).forEach((e) => {
|
|
3162
3167
|
if (!e.field) return;
|
|
3163
3168
|
if (e.type === "file") {
|
|
3164
3169
|
let r = n(t, e);
|
|
3165
|
-
r &&
|
|
3170
|
+
r && Y(i, e.field, r);
|
|
3166
3171
|
return;
|
|
3167
3172
|
}
|
|
3168
3173
|
let a = r(t, e);
|
|
3169
3174
|
if (a == null) {
|
|
3170
|
-
e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "" &&
|
|
3175
|
+
e.defaultOnEdit && e.defaultValue !== void 0 && e.defaultValue !== "" && Y(i, e.field, e.defaultValue);
|
|
3171
3176
|
return;
|
|
3172
3177
|
}
|
|
3173
|
-
|
|
3178
|
+
Y(i, e.field, wa(e.addRow) ? ra(e, a) : q(e, a));
|
|
3174
3179
|
}), i;
|
|
3175
|
-
}, i =
|
|
3180
|
+
}, i = Wi(e, { editing: !0 });
|
|
3176
3181
|
if (t && t.length > 0) {
|
|
3177
|
-
let e = t.map((e) => r(e, (e, t) =>
|
|
3182
|
+
let e = t.map((e) => r(e, (e, t) => ka(e, t), (e, t) => V(e, t.field)));
|
|
3178
3183
|
for (; e.length < n;) e.push({ ...i });
|
|
3179
3184
|
return e;
|
|
3180
3185
|
}
|
|
3181
|
-
let a = r(e, (e, t) =>
|
|
3186
|
+
let a = r(e, (e, t) => Oa(t.value, t), (e, t) => t.value), o = Object.keys(a).length > 0 ? [a] : [];
|
|
3182
3187
|
for (; o.length < n;) o.push({ ...i });
|
|
3183
3188
|
return o;
|
|
3184
3189
|
}
|
|
3185
|
-
function
|
|
3190
|
+
function ja(e, t = []) {
|
|
3186
3191
|
let n = {};
|
|
3187
3192
|
return t.forEach((e) => {
|
|
3188
|
-
e.toggleEnabled && e.toggleField &&
|
|
3193
|
+
e.toggleEnabled && e.toggleField && Y(n, e.toggleField, !!e.toggleValue), !e.addRow && (e.fields ?? []).forEach((e) => {
|
|
3189
3194
|
if (!e.field || e.addRow) return;
|
|
3190
3195
|
let t = e.value, r = e.field;
|
|
3191
3196
|
if (e.type === "file") {
|
|
3192
|
-
let i =
|
|
3193
|
-
i &&
|
|
3197
|
+
let i = Oa(t, e);
|
|
3198
|
+
i && Y(n, r, i);
|
|
3194
3199
|
return;
|
|
3195
3200
|
}
|
|
3196
3201
|
if (t != null) {
|
|
@@ -3198,38 +3203,38 @@ function Ta(e, t = []) {
|
|
|
3198
3203
|
let i = e.transformRule?.map;
|
|
3199
3204
|
if (i) {
|
|
3200
3205
|
let e = Object.entries(i).find(([, e]) => String(e) === String(t));
|
|
3201
|
-
|
|
3202
|
-
} else
|
|
3206
|
+
Y(n, r, e ? [e[0]] : []);
|
|
3207
|
+
} else Y(n, r, vi(e, Array.isArray(t) ? t : [t]));
|
|
3203
3208
|
return;
|
|
3204
3209
|
}
|
|
3205
|
-
|
|
3210
|
+
Y(n, r, q(e, t));
|
|
3206
3211
|
}
|
|
3207
3212
|
});
|
|
3208
3213
|
}), Object.keys(n).length > 0 && e.setFieldsValue(n), n;
|
|
3209
3214
|
}
|
|
3210
3215
|
//#endregion
|
|
3211
3216
|
//#region src/components/form/useAiActions.js
|
|
3212
|
-
function
|
|
3217
|
+
function Ma(e) {
|
|
3213
3218
|
let t = document.createElement("div");
|
|
3214
3219
|
return t.innerHTML = String(e ?? ""), t.textContent || t.innerText || "";
|
|
3215
3220
|
}
|
|
3216
|
-
function
|
|
3217
|
-
return t && t === "stripHtml" ?
|
|
3221
|
+
function Na(e, t) {
|
|
3222
|
+
return t && t === "stripHtml" ? Ma(e) : e;
|
|
3218
3223
|
}
|
|
3219
|
-
function
|
|
3224
|
+
function Pa(e) {
|
|
3220
3225
|
return String(e ?? "").trim().split(/\s+/).filter(Boolean).length;
|
|
3221
3226
|
}
|
|
3222
|
-
function
|
|
3227
|
+
function Fa(e) {
|
|
3223
3228
|
return Object.values(e || {}).some((e) => e != null && e !== "");
|
|
3224
3229
|
}
|
|
3225
|
-
function
|
|
3230
|
+
function Ia(e, t) {
|
|
3226
3231
|
if (e.kind === "file") return Array.isArray(t) ? t.length > 0 : !!t;
|
|
3227
|
-
let n =
|
|
3232
|
+
let n = Na(t, e.transform), r = String(n ?? "").trim();
|
|
3228
3233
|
if (!r) return !1;
|
|
3229
3234
|
let i = Number(e.minWords) || 0;
|
|
3230
|
-
return i > 0 ?
|
|
3235
|
+
return i > 0 ? Pa(r) >= i : !0;
|
|
3231
3236
|
}
|
|
3232
|
-
function
|
|
3237
|
+
function La(e, t) {
|
|
3233
3238
|
let n = e.inputs || [];
|
|
3234
3239
|
if (n.length === 0) return !0;
|
|
3235
3240
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -3237,35 +3242,35 @@ function ja(e, t) {
|
|
|
3237
3242
|
let n = e.group || `__solo_${t}`;
|
|
3238
3243
|
r.has(n) || r.set(n, []), r.get(n).push(e);
|
|
3239
3244
|
});
|
|
3240
|
-
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) =>
|
|
3245
|
+
for (let e of r.values()) if (e.some((e) => e.required || Number(e.minWords) > 0) && !e.some((e) => Ia(e, t(e.sourceField)))) return !1;
|
|
3241
3246
|
return !0;
|
|
3242
3247
|
}
|
|
3243
|
-
var
|
|
3248
|
+
var Ra = [
|
|
3244
3249
|
"top-left",
|
|
3245
3250
|
"top-center",
|
|
3246
3251
|
"top-right",
|
|
3247
3252
|
"bottom-left",
|
|
3248
3253
|
"bottom-center",
|
|
3249
3254
|
"bottom-right"
|
|
3250
|
-
],
|
|
3251
|
-
function
|
|
3255
|
+
], za = "bottom-left";
|
|
3256
|
+
function Ba(e = []) {
|
|
3252
3257
|
let t = {};
|
|
3253
3258
|
return e.forEach((e) => {
|
|
3254
|
-
let n =
|
|
3259
|
+
let n = Ra.includes(e.position) ? e.position : za;
|
|
3255
3260
|
(t[n] ??= []).push(e);
|
|
3256
3261
|
}), t;
|
|
3257
3262
|
}
|
|
3258
|
-
function
|
|
3259
|
-
let [r, i] =
|
|
3263
|
+
function Va({ form: e, groups: t, module: n }) {
|
|
3264
|
+
let [r, i] = g(null), a = y.useWatch((e) => e, e), o = f((e) => La(e, (e) => (a || {})[e]), [a]), s = f((t) => {
|
|
3260
3265
|
if (!Array.isArray(t) || t.length === 0) return !1;
|
|
3261
|
-
let n =
|
|
3266
|
+
let n = ja(e, t.filter((e) => !e.addRow)), r = Object.keys(n).length > 0;
|
|
3262
3267
|
return t.forEach((t) => {
|
|
3263
3268
|
if (!t.addRow || !Array.isArray(t.rows) || t.rows.length === 0) return;
|
|
3264
|
-
let n =
|
|
3269
|
+
let n = Aa(t);
|
|
3265
3270
|
if (n.length === 0) return;
|
|
3266
3271
|
r = !0;
|
|
3267
3272
|
let i = () => e.setFieldsValue({ [t.name]: n }), a = e.getFieldValue(t.name) || [];
|
|
3268
|
-
a.some(
|
|
3273
|
+
a.some(Fa) ? b.confirm({
|
|
3269
3274
|
title: "Replace existing rows?",
|
|
3270
3275
|
content: `This will replace ${a.length} existing row(s) in "${t.label || t.name}".`,
|
|
3271
3276
|
okText: "Replace",
|
|
@@ -3275,7 +3280,7 @@ function Fa({ form: e, groups: t, module: n }) {
|
|
|
3275
3280
|
}), r;
|
|
3276
3281
|
}, [e]);
|
|
3277
3282
|
return {
|
|
3278
|
-
runAction:
|
|
3283
|
+
runAction: f(async (t, r, a, o) => {
|
|
3279
3284
|
i(a.key);
|
|
3280
3285
|
try {
|
|
3281
3286
|
let i = {}, c = {};
|
|
@@ -3285,12 +3290,12 @@ function Fa({ form: e, groups: t, module: n }) {
|
|
|
3285
3290
|
r && (c[t.param] = r);
|
|
3286
3291
|
} else {
|
|
3287
3292
|
let n = e.getFieldValue(t.sourceField);
|
|
3288
|
-
n != null && n !== "" && (i[t.param] =
|
|
3293
|
+
n != null && n !== "" && (i[t.param] = Na(n, t.transform));
|
|
3289
3294
|
}
|
|
3290
3295
|
}), (a.inputs || []).forEach((e) => {
|
|
3291
3296
|
!e.group || e.kind !== "text" || (a.inputs || []).some((t) => t.group === e.group && t.kind === "file" && c[t.param]) && delete i[e.param];
|
|
3292
3297
|
});
|
|
3293
|
-
let l = await
|
|
3298
|
+
let l = await ca({
|
|
3294
3299
|
module: n,
|
|
3295
3300
|
group: t,
|
|
3296
3301
|
field: r.field,
|
|
@@ -3298,9 +3303,9 @@ function Fa({ form: e, groups: t, module: n }) {
|
|
|
3298
3303
|
inputs: i,
|
|
3299
3304
|
files: c
|
|
3300
3305
|
}), u = s(l?.groups), d = a.label || "AI action";
|
|
3301
|
-
return u ?
|
|
3306
|
+
return u ? S.success(`${d} completed successfully.`) : S.info(`${d} completed, but no matching details were found.`), l;
|
|
3302
3307
|
} catch (e) {
|
|
3303
|
-
|
|
3308
|
+
S.error(e?.message || `${a.label || "AI action"} failed`);
|
|
3304
3309
|
return;
|
|
3305
3310
|
} finally {
|
|
3306
3311
|
i(null);
|
|
@@ -3317,15 +3322,15 @@ function Fa({ form: e, groups: t, module: n }) {
|
|
|
3317
3322
|
}
|
|
3318
3323
|
//#endregion
|
|
3319
3324
|
//#region src/components/form/AiActionButtons.jsx
|
|
3320
|
-
function
|
|
3321
|
-
return !t || t.length === 0 ? null : /* @__PURE__ */
|
|
3325
|
+
function Ha({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
3326
|
+
return !t || t.length === 0 ? null : /* @__PURE__ */ C(ee, {
|
|
3322
3327
|
size: 8,
|
|
3323
3328
|
className: "v1-ai-action-buttons",
|
|
3324
3329
|
style: {
|
|
3325
3330
|
width: "100%",
|
|
3326
3331
|
justifyContent: e.endsWith("center") ? "center" : e.endsWith("right") ? "flex-end" : "flex-start"
|
|
3327
3332
|
},
|
|
3328
|
-
children: t.map((e) => /* @__PURE__ */
|
|
3333
|
+
children: t.map((e) => /* @__PURE__ */ C(v, {
|
|
3329
3334
|
size: "small",
|
|
3330
3335
|
loading: n.loadingKey === e.key,
|
|
3331
3336
|
disabled: n.busy || !n.isActionEnabled(e),
|
|
@@ -3336,18 +3341,18 @@ function Ia({ position: e, actions: t, aiActions: n, groupName: r, field: i }) {
|
|
|
3336
3341
|
}
|
|
3337
3342
|
//#endregion
|
|
3338
3343
|
//#region src/components/form/emailValidator.js
|
|
3339
|
-
function
|
|
3344
|
+
function Ua(e) {
|
|
3340
3345
|
let t = String(e ?? "").trim(), n = /^([^\s@]+)@([^\s@]+)\.([A-Za-z]{2,})$/.exec(t);
|
|
3341
3346
|
if (!n) return !1;
|
|
3342
3347
|
let [, r, i] = n;
|
|
3343
3348
|
return /[A-Za-z]/.test(r) && /[A-Za-z]/.test(i);
|
|
3344
3349
|
}
|
|
3345
|
-
function
|
|
3346
|
-
return { validator: (n, r) => r == null || r === "" ||
|
|
3350
|
+
function Wa(e = "Email", t) {
|
|
3351
|
+
return { validator: (n, r) => r == null || r === "" || Ua(r) ? Promise.resolve() : Promise.reject(Error(t ?? `Enter a valid ${e}; numeric-only email addresses are not allowed`)) };
|
|
3347
3352
|
}
|
|
3348
3353
|
//#endregion
|
|
3349
3354
|
//#region src/components/form/inputValidator.js
|
|
3350
|
-
var
|
|
3355
|
+
var Ga = [
|
|
3351
3356
|
{
|
|
3352
3357
|
label: "Only Numbers",
|
|
3353
3358
|
value: "onlyNumber"
|
|
@@ -3416,7 +3421,7 @@ var za = [
|
|
|
3416
3421
|
label: "Website URL",
|
|
3417
3422
|
value: "websiteUrl"
|
|
3418
3423
|
}
|
|
3419
|
-
],
|
|
3424
|
+
], Ka = {
|
|
3420
3425
|
onlyNumber: /^[0-9]$/,
|
|
3421
3426
|
experience: /^[0-9]$/,
|
|
3422
3427
|
numericTwoDigits: /^[0-9]$/,
|
|
@@ -3431,10 +3436,10 @@ var za = [
|
|
|
3431
3436
|
decimalRange: /^[0-9.]$/,
|
|
3432
3437
|
contactNumber: /^[0-9()\-+\s]$/
|
|
3433
3438
|
};
|
|
3434
|
-
function
|
|
3435
|
-
return
|
|
3439
|
+
function qa(e) {
|
|
3440
|
+
return Ka[e] ?? null;
|
|
3436
3441
|
}
|
|
3437
|
-
function
|
|
3442
|
+
function Ja(e, t = {}, n = "change") {
|
|
3438
3443
|
if (!t?.type || e == null) return {
|
|
3439
3444
|
cleaned: e ?? "",
|
|
3440
3445
|
error: null
|
|
@@ -3512,7 +3517,7 @@ function Ha(e, t = {}, n = "change") {
|
|
|
3512
3517
|
break;
|
|
3513
3518
|
}
|
|
3514
3519
|
case "email":
|
|
3515
|
-
c = n === "blur" ? r.trim() : r, c && !
|
|
3520
|
+
c = n === "blur" ? r.trim() : r, c && !Ua(c) && (l = `${s} must be a valid email address; numeric-only email addresses are not allowed.`);
|
|
3516
3521
|
break;
|
|
3517
3522
|
case "websiteUrl":
|
|
3518
3523
|
c = n === "blur" ? r.trim() : r, c && !/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/i.test(c) && (l = `${s} must be a valid URL.`);
|
|
@@ -3526,7 +3531,7 @@ function Ha(e, t = {}, n = "change") {
|
|
|
3526
3531
|
}
|
|
3527
3532
|
//#endregion
|
|
3528
3533
|
//#region src/components/form/uploadAccept.js
|
|
3529
|
-
var
|
|
3534
|
+
var Ya = [
|
|
3530
3535
|
"jpg",
|
|
3531
3536
|
"jpeg",
|
|
3532
3537
|
"png",
|
|
@@ -3535,18 +3540,18 @@ var Ua = [
|
|
|
3535
3540
|
"bmp",
|
|
3536
3541
|
"svg",
|
|
3537
3542
|
"avif"
|
|
3538
|
-
],
|
|
3543
|
+
], Xa = [
|
|
3539
3544
|
"mp4",
|
|
3540
3545
|
"webm",
|
|
3541
3546
|
"ogg",
|
|
3542
3547
|
"ogv",
|
|
3543
3548
|
"mov",
|
|
3544
3549
|
"m4v"
|
|
3545
|
-
],
|
|
3550
|
+
], Za = [
|
|
3546
3551
|
"pdf",
|
|
3547
3552
|
"doc",
|
|
3548
3553
|
"docx"
|
|
3549
|
-
],
|
|
3554
|
+
], Qa = [
|
|
3550
3555
|
{
|
|
3551
3556
|
label: "Any file",
|
|
3552
3557
|
value: "any"
|
|
@@ -3567,162 +3572,426 @@ var Ua = [
|
|
|
3567
3572
|
label: "Images & Videos",
|
|
3568
3573
|
value: "imagesAndVideos"
|
|
3569
3574
|
}
|
|
3570
|
-
],
|
|
3575
|
+
], $a = {
|
|
3571
3576
|
documents: {
|
|
3572
|
-
exts: [...
|
|
3577
|
+
exts: [...Za, ...Ya],
|
|
3573
3578
|
hint: "PDF, DOC or image files",
|
|
3574
3579
|
error: "Only document (PDF/DOC) or image files are allowed"
|
|
3575
3580
|
},
|
|
3576
3581
|
images: {
|
|
3577
|
-
exts:
|
|
3582
|
+
exts: Ya,
|
|
3578
3583
|
hint: "Image files",
|
|
3579
3584
|
error: "Only image files are allowed"
|
|
3580
3585
|
},
|
|
3581
3586
|
videos: {
|
|
3582
|
-
exts:
|
|
3587
|
+
exts: Xa,
|
|
3583
3588
|
hint: "Video files",
|
|
3584
3589
|
error: "Only video files are allowed"
|
|
3585
3590
|
},
|
|
3586
3591
|
imagesAndVideos: {
|
|
3587
|
-
exts: [...
|
|
3592
|
+
exts: [...Ya, ...Xa],
|
|
3588
3593
|
hint: "Image or video files",
|
|
3589
3594
|
error: "Only image or video files are allowed"
|
|
3590
3595
|
}
|
|
3591
3596
|
};
|
|
3592
|
-
function
|
|
3593
|
-
return
|
|
3597
|
+
function eo(e) {
|
|
3598
|
+
return $a[String(e?.accept ?? "").trim()] ?? null;
|
|
3599
|
+
}
|
|
3600
|
+
//#endregion
|
|
3601
|
+
//#region src/components/AppButton.jsx
|
|
3602
|
+
function to({ children: e, className: t = "", icon: n, to: r, variant: i = "default", ...a }) {
|
|
3603
|
+
let o = /* @__PURE__ */ C(v, {
|
|
3604
|
+
className: `app-button app-button--${i} ${t}`.trim(),
|
|
3605
|
+
icon: n,
|
|
3606
|
+
...a,
|
|
3607
|
+
children: e
|
|
3608
|
+
});
|
|
3609
|
+
return r ? /* @__PURE__ */ C(he, {
|
|
3610
|
+
className: "app-button-link",
|
|
3611
|
+
to: r,
|
|
3612
|
+
children: o
|
|
3613
|
+
}) : o;
|
|
3614
|
+
}
|
|
3615
|
+
//#endregion
|
|
3616
|
+
//#region src/components/detail/userNames.js
|
|
3617
|
+
function no(e) {
|
|
3618
|
+
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 || "";
|
|
3619
|
+
}
|
|
3620
|
+
function ro(e) {
|
|
3621
|
+
let t = {};
|
|
3622
|
+
return (Array.isArray(e) ? e : []).forEach((e) => {
|
|
3623
|
+
let n = no(e);
|
|
3624
|
+
n && [
|
|
3625
|
+
e.legacyUserId,
|
|
3626
|
+
e.userId,
|
|
3627
|
+
e.user_id,
|
|
3628
|
+
e._id,
|
|
3629
|
+
e.id
|
|
3630
|
+
].forEach((e) => {
|
|
3631
|
+
if (e == null || e === "") return;
|
|
3632
|
+
let r = String(typeof e == "object" ? e.$oid ?? e.id ?? "" : e);
|
|
3633
|
+
r && t[r] === void 0 && (t[r] = n);
|
|
3634
|
+
});
|
|
3635
|
+
}), t;
|
|
3636
|
+
}
|
|
3637
|
+
var io = /* @__PURE__ */ new Map();
|
|
3638
|
+
function ao(e) {
|
|
3639
|
+
let t = String(e ?? "").trim();
|
|
3640
|
+
if (!t) return Promise.resolve("");
|
|
3641
|
+
if (io.has(t)) return io.get(t);
|
|
3642
|
+
let i = n(r, `/get-detailed-view?userId=${encodeURIComponent(t)}`).then((e) => no(e?.data ?? e ?? null)).catch(() => "");
|
|
3643
|
+
return io.set(t, i), i;
|
|
3644
|
+
}
|
|
3645
|
+
var Z = (e) => e == null ? "" : String(e).trim();
|
|
3646
|
+
function oo(e) {
|
|
3647
|
+
let t = e?.quickCreateNotice;
|
|
3648
|
+
return !t || typeof t != "object" || t.enabled === !1 ? null : {
|
|
3649
|
+
enabled: !0,
|
|
3650
|
+
title: Z(t.title) || "New record created",
|
|
3651
|
+
message: Z(t.message) || "A new client has been created successfully. Please contact your Organization Admin to configure the required forms, workflows, permissions, and client-specific details before proceeding with further operations.",
|
|
3652
|
+
showCreator: t.showCreator !== !1,
|
|
3653
|
+
showRecordName: t.showRecordName !== !1,
|
|
3654
|
+
recordNameField: Z(t.recordNameField),
|
|
3655
|
+
recordLabel: Z(t.recordLabel) || "Record name",
|
|
3656
|
+
creatorLabel: Z(t.creatorLabel) || "Created by"
|
|
3657
|
+
};
|
|
3658
|
+
}
|
|
3659
|
+
var so = [
|
|
3660
|
+
"clientName",
|
|
3661
|
+
"companyName",
|
|
3662
|
+
"name",
|
|
3663
|
+
"title",
|
|
3664
|
+
"fullName",
|
|
3665
|
+
"displayName",
|
|
3666
|
+
"label",
|
|
3667
|
+
"employerName",
|
|
3668
|
+
"vendorName"
|
|
3669
|
+
], co = (e, t) => {
|
|
3670
|
+
if (!(!e || !t)) return String(t).split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
|
|
3671
|
+
}, lo = (e) => typeof e == "string" || typeof e == "number" ? Z(e) : e && typeof e == "object" ? Z(e.label ?? e.name ?? e.title ?? "") : "";
|
|
3672
|
+
function uo(e, { recordNameField: t = "", displayField: n = "" } = {}) {
|
|
3673
|
+
if (!e || typeof e != "object") return "";
|
|
3674
|
+
for (let r of [
|
|
3675
|
+
t,
|
|
3676
|
+
n,
|
|
3677
|
+
...so
|
|
3678
|
+
]) {
|
|
3679
|
+
if (!r) continue;
|
|
3680
|
+
let t = lo(co(e, r));
|
|
3681
|
+
if (t) return t;
|
|
3682
|
+
}
|
|
3683
|
+
let r = Object.keys(e).find((t) => /name$/i.test(t) && typeof e[t] == "string" && e[t].trim());
|
|
3684
|
+
return r ? Z(e[r]) : "";
|
|
3685
|
+
}
|
|
3686
|
+
function fo(e) {
|
|
3687
|
+
if (!e || typeof e != "object") return "";
|
|
3688
|
+
let t = [
|
|
3689
|
+
e.createdBy,
|
|
3690
|
+
e.created_by,
|
|
3691
|
+
e.createdById,
|
|
3692
|
+
e.createdUserId,
|
|
3693
|
+
e.recordMeta?.createdBy,
|
|
3694
|
+
e.ownerId
|
|
3695
|
+
];
|
|
3696
|
+
for (let e of t) {
|
|
3697
|
+
if (e == null || e === "") continue;
|
|
3698
|
+
if (typeof e == "object") {
|
|
3699
|
+
let t = Z(e.$oid ?? e.userId ?? e._id ?? e.id);
|
|
3700
|
+
if (t) return t;
|
|
3701
|
+
continue;
|
|
3702
|
+
}
|
|
3703
|
+
let t = Z(e);
|
|
3704
|
+
if (t) return t;
|
|
3705
|
+
}
|
|
3706
|
+
return "";
|
|
3707
|
+
}
|
|
3708
|
+
function po(e = o) {
|
|
3709
|
+
try {
|
|
3710
|
+
return no(e()) || "";
|
|
3711
|
+
} catch {
|
|
3712
|
+
return "";
|
|
3713
|
+
}
|
|
3714
|
+
}
|
|
3715
|
+
var mo = (e, t) => n(r, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`).then((e) => {
|
|
3716
|
+
let t = e?.data?.data ?? e?.data ?? [];
|
|
3717
|
+
return Array.isArray(t) ? t[0] : t;
|
|
3718
|
+
});
|
|
3719
|
+
async function ho({ module: e, recordId: t, notice: n, displayField: r = "", deps: i = {} } = {}) {
|
|
3720
|
+
let { fetchRecord: a = mo, fetchUserNameFn: s = ao, getUser: c = o } = i, l = null;
|
|
3721
|
+
if (e && t) try {
|
|
3722
|
+
l = await a(e, t);
|
|
3723
|
+
} catch {
|
|
3724
|
+
l = null;
|
|
3725
|
+
}
|
|
3726
|
+
let u = n?.showRecordName === !1 ? "" : uo(l, {
|
|
3727
|
+
recordNameField: n?.recordNameField,
|
|
3728
|
+
displayField: r
|
|
3729
|
+
}), d = "";
|
|
3730
|
+
if (n?.showCreator !== !1) {
|
|
3731
|
+
let e = fo(l);
|
|
3732
|
+
if (e) try {
|
|
3733
|
+
d = Z(await s(e));
|
|
3734
|
+
} catch {
|
|
3735
|
+
d = "";
|
|
3736
|
+
}
|
|
3737
|
+
d ||= po(c);
|
|
3738
|
+
}
|
|
3739
|
+
return {
|
|
3740
|
+
recordName: u,
|
|
3741
|
+
creatorName: d
|
|
3742
|
+
};
|
|
3594
3743
|
}
|
|
3595
3744
|
//#endregion
|
|
3596
3745
|
//#region src/components/form/QuickCreateEditField.jsx
|
|
3597
|
-
var
|
|
3598
|
-
function
|
|
3746
|
+
var go = d(() => import("./index.js").then((e) => e.i)), _o = d(() => import("./index.js").then((e) => e.n)), vo = (e) => e == null || e === "", yo = (e) => typeof e == "string" && e.includes(".") ? e.split(".") : [e];
|
|
3747
|
+
function bo(e, t, n, r, i) {
|
|
3599
3748
|
let a = e.quickEditIdFrom;
|
|
3600
3749
|
if (a) {
|
|
3601
|
-
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...
|
|
3602
|
-
return
|
|
3750
|
+
let e = Array.isArray(n) && n.length >= 3 && typeof n[1] == "number" ? [...n.slice(0, 2), ...yo(a)] : yo(a), i = t?.getFieldValue?.(e);
|
|
3751
|
+
return vo(i) && (i = r?.[a]), vo(i) ? null : i;
|
|
3603
3752
|
}
|
|
3604
|
-
return i && typeof i == "object" ? i.value ?? null :
|
|
3753
|
+
return i && typeof i == "object" ? i.value ?? null : vo(i) ? null : i;
|
|
3605
3754
|
}
|
|
3606
|
-
function
|
|
3607
|
-
let [s, c] =
|
|
3608
|
-
|
|
3755
|
+
function xo({ field: e, form: t, name: n, moduleName: r, scopeValues: i, ownValue: a, onDone: o }) {
|
|
3756
|
+
let [s, c] = g(null), [l, d] = g(null), f = !!e?.quickCreate, p = !!e?.quickEdit, h = e?.quickCreateModule || e?.lookupCollection || "", _ = e?.quickEditModule || e?.lookupCollection || "", y = m(() => p ? bo(e, t, n, i, a) : null, [
|
|
3757
|
+
p,
|
|
3609
3758
|
e,
|
|
3610
3759
|
t,
|
|
3611
3760
|
n,
|
|
3612
3761
|
i,
|
|
3613
3762
|
a
|
|
3614
3763
|
]);
|
|
3615
|
-
if (!
|
|
3764
|
+
if (!f && !p) return {
|
|
3616
3765
|
footer: null,
|
|
3617
3766
|
modal: null
|
|
3618
3767
|
};
|
|
3619
|
-
let
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3768
|
+
let x = () => c(null), ne = () => {
|
|
3769
|
+
if (e?.quickCreateRoute) {
|
|
3770
|
+
window.open(e.quickCreateRoute, "_blank", "noopener,noreferrer");
|
|
3771
|
+
return;
|
|
3772
|
+
}
|
|
3773
|
+
h && c({
|
|
3774
|
+
mode: "create",
|
|
3775
|
+
module: h
|
|
3776
|
+
});
|
|
3777
|
+
}, S = () => _ && y && c({
|
|
3778
|
+
mode: "edit",
|
|
3779
|
+
module: _,
|
|
3780
|
+
recordId: String(y)
|
|
3781
|
+
}), re = (t) => {
|
|
3782
|
+
let n = oo(e);
|
|
3783
|
+
n && (d({
|
|
3784
|
+
...n,
|
|
3785
|
+
recordName: "",
|
|
3786
|
+
creatorName: ""
|
|
3787
|
+
}), ho({
|
|
3788
|
+
module: h,
|
|
3789
|
+
recordId: t,
|
|
3790
|
+
notice: n,
|
|
3791
|
+
displayField: e?.displayField || ""
|
|
3792
|
+
}).then(({ recordName: e, creatorName: t }) => {
|
|
3793
|
+
d((n) => n && {
|
|
3794
|
+
...n,
|
|
3795
|
+
recordName: e,
|
|
3796
|
+
creatorName: t
|
|
3797
|
+
});
|
|
3798
|
+
}).catch(() => {}));
|
|
3799
|
+
}, ie = /* @__PURE__ */ C("div", {
|
|
3800
|
+
className: "v1-quick-actions",
|
|
3801
|
+
role: "presentation",
|
|
3802
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
3803
|
+
style: {
|
|
3804
|
+
display: "flex",
|
|
3805
|
+
gap: 8,
|
|
3806
|
+
padding: "6px 8px",
|
|
3807
|
+
borderTop: "1px solid rgba(0,0,0,0.06)"
|
|
3808
|
+
},
|
|
3809
|
+
children: /* @__PURE__ */ w(ee, {
|
|
3810
|
+
size: 8,
|
|
3811
|
+
children: [f && /* @__PURE__ */ C(v, {
|
|
3812
|
+
type: "link",
|
|
3813
|
+
size: "small",
|
|
3814
|
+
icon: /* @__PURE__ */ C(ue, {}),
|
|
3815
|
+
onClick: ne,
|
|
3816
|
+
style: { paddingLeft: 0 },
|
|
3817
|
+
children: e.quickCreateLabel || "Add More"
|
|
3818
|
+
}), p && /* @__PURE__ */ C(v, {
|
|
3819
|
+
type: "link",
|
|
3820
|
+
size: "small",
|
|
3821
|
+
icon: /* @__PURE__ */ C(oe, {}),
|
|
3822
|
+
onClick: S,
|
|
3823
|
+
disabled: !y,
|
|
3824
|
+
title: y ? void 0 : "Select a record first",
|
|
3825
|
+
children: e.quickEditLabel || "Edit"
|
|
3826
|
+
})]
|
|
3827
|
+
})
|
|
3828
|
+
}), ae = s ? /* @__PURE__ */ C(b, {
|
|
3829
|
+
open: !0,
|
|
3830
|
+
title: s.mode === "create" ? e.quickCreateLabel || "Add More" : e.quickEditLabel || "Edit",
|
|
3831
|
+
width: "min(1080px, 96vw)",
|
|
3832
|
+
footer: null,
|
|
3833
|
+
destroyOnClose: !0,
|
|
3834
|
+
maskClosable: !1,
|
|
3835
|
+
onCancel: x,
|
|
3836
|
+
styles: { body: {
|
|
3837
|
+
maxHeight: "78vh",
|
|
3838
|
+
overflowY: "auto"
|
|
3839
|
+
} },
|
|
3840
|
+
children: /* @__PURE__ */ C(u, {
|
|
3841
|
+
fallback: /* @__PURE__ */ C("div", {
|
|
3842
|
+
style: {
|
|
3843
|
+
padding: 48,
|
|
3844
|
+
textAlign: "center"
|
|
3845
|
+
},
|
|
3846
|
+
children: /* @__PURE__ */ C(te, {})
|
|
3847
|
+
}),
|
|
3848
|
+
children: s.mode === "create" ? /* @__PURE__ */ C(go, {
|
|
3849
|
+
moduleName: s.module,
|
|
3850
|
+
embedded: !0,
|
|
3851
|
+
breadcrumbItems: [],
|
|
3852
|
+
onCancel: x,
|
|
3853
|
+
onSuccess: (e) => {
|
|
3854
|
+
x(), re(e), o?.("create", e);
|
|
3855
|
+
}
|
|
3856
|
+
}) : /* @__PURE__ */ C(_o, {
|
|
3857
|
+
moduleName: s.module,
|
|
3858
|
+
recordId: s.recordId,
|
|
3859
|
+
embedded: !0,
|
|
3860
|
+
breadcrumbItems: [],
|
|
3861
|
+
onCancel: x,
|
|
3862
|
+
onSuccess: (e) => {
|
|
3863
|
+
x(), o?.("edit", e);
|
|
3864
|
+
}
|
|
3865
|
+
})
|
|
3866
|
+
})
|
|
3867
|
+
}) : null, ce = l ? /* @__PURE__ */ w(b, {
|
|
3868
|
+
open: !0,
|
|
3869
|
+
title: /* @__PURE__ */ w("span", {
|
|
3625
3870
|
style: {
|
|
3626
|
-
display: "flex",
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
borderTop: "1px solid rgba(0,0,0,0.06)"
|
|
3871
|
+
display: "inline-flex",
|
|
3872
|
+
alignItems: "center",
|
|
3873
|
+
gap: 8
|
|
3630
3874
|
},
|
|
3631
|
-
children: /* @__PURE__ */
|
|
3632
|
-
size: 8,
|
|
3633
|
-
children: [u && /* @__PURE__ */ b(_, {
|
|
3634
|
-
type: "link",
|
|
3635
|
-
size: "small",
|
|
3636
|
-
icon: /* @__PURE__ */ b(de, {}),
|
|
3637
|
-
onClick: () => {
|
|
3638
|
-
if (e?.quickCreateRoute) {
|
|
3639
|
-
window.open(e.quickCreateRoute, "_blank", "noopener,noreferrer");
|
|
3640
|
-
return;
|
|
3641
|
-
}
|
|
3642
|
-
f && c({
|
|
3643
|
-
mode: "create",
|
|
3644
|
-
module: f
|
|
3645
|
-
});
|
|
3646
|
-
},
|
|
3647
|
-
style: { paddingLeft: 0 },
|
|
3648
|
-
children: e.quickCreateLabel || "Add More"
|
|
3649
|
-
}), d && /* @__PURE__ */ b(_, {
|
|
3650
|
-
type: "link",
|
|
3651
|
-
size: "small",
|
|
3652
|
-
icon: /* @__PURE__ */ b(ce, {}),
|
|
3653
|
-
onClick: () => m && g && c({
|
|
3654
|
-
mode: "edit",
|
|
3655
|
-
module: m,
|
|
3656
|
-
recordId: String(g)
|
|
3657
|
-
}),
|
|
3658
|
-
disabled: !g,
|
|
3659
|
-
title: g ? void 0 : "Select a record first",
|
|
3660
|
-
children: e.quickEditLabel || "Edit"
|
|
3661
|
-
})]
|
|
3662
|
-
})
|
|
3875
|
+
children: [/* @__PURE__ */ C(se, { style: { color: "#faad14" } }), l.title]
|
|
3663
3876
|
}),
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
}
|
|
3701
|
-
})
|
|
3702
|
-
})
|
|
3703
|
-
}) : null
|
|
3877
|
+
width: "min(520px, 94vw)",
|
|
3878
|
+
maskClosable: !1,
|
|
3879
|
+
onCancel: () => d(null),
|
|
3880
|
+
footer: /* @__PURE__ */ C(to, {
|
|
3881
|
+
variant: "primary",
|
|
3882
|
+
type: "primary",
|
|
3883
|
+
onClick: () => d(null),
|
|
3884
|
+
children: "OK"
|
|
3885
|
+
}),
|
|
3886
|
+
children: [/* @__PURE__ */ C("p", {
|
|
3887
|
+
style: {
|
|
3888
|
+
marginTop: 0,
|
|
3889
|
+
marginBottom: 16
|
|
3890
|
+
},
|
|
3891
|
+
children: l.message
|
|
3892
|
+
}), (l.recordName || l.creatorName) && /* @__PURE__ */ w("div", {
|
|
3893
|
+
style: {
|
|
3894
|
+
display: "grid",
|
|
3895
|
+
gridTemplateColumns: "auto 1fr",
|
|
3896
|
+
gap: "6px 12px",
|
|
3897
|
+
padding: "10px 12px",
|
|
3898
|
+
borderRadius: 6,
|
|
3899
|
+
background: "rgba(0,0,0,0.03)"
|
|
3900
|
+
},
|
|
3901
|
+
children: [l.recordName && /* @__PURE__ */ w(me, { children: [/* @__PURE__ */ C("span", {
|
|
3902
|
+
style: { color: "rgba(0,0,0,0.55)" },
|
|
3903
|
+
children: l.recordLabel
|
|
3904
|
+
}), /* @__PURE__ */ C("strong", { children: l.recordName })] }), l.creatorName && /* @__PURE__ */ w(me, { children: [/* @__PURE__ */ C("span", {
|
|
3905
|
+
style: { color: "rgba(0,0,0,0.55)" },
|
|
3906
|
+
children: l.creatorLabel
|
|
3907
|
+
}), /* @__PURE__ */ C("strong", { children: l.creatorName })] })]
|
|
3908
|
+
})]
|
|
3909
|
+
}) : null;
|
|
3910
|
+
return {
|
|
3911
|
+
footer: ie,
|
|
3912
|
+
modal: ae || ce ? /* @__PURE__ */ w(me, { children: [ae, ce] }) : null
|
|
3704
3913
|
};
|
|
3705
3914
|
}
|
|
3706
3915
|
//#endregion
|
|
3916
|
+
//#region src/components/form/crossFieldRules.js
|
|
3917
|
+
var So = (e) => e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
3918
|
+
function Co(e, t, n) {
|
|
3919
|
+
let r = String(t ?? "").includes(".") ? String(t).split(".") : [t];
|
|
3920
|
+
if (typeof n == "function") {
|
|
3921
|
+
let e = n(t);
|
|
3922
|
+
return Array.isArray(e) && e.length ? [...e, ...r] : r;
|
|
3923
|
+
}
|
|
3924
|
+
return Array.isArray(e) && e.length > 1 ? [...e.slice(0, -1), ...r] : r;
|
|
3925
|
+
}
|
|
3926
|
+
function wo({ label: e, message: t, rule: n = {}, value: r, form: i, name: a, prefixFor: o }) {
|
|
3927
|
+
let s = n.field ?? n.compareField ?? r;
|
|
3928
|
+
return { validator: async (n, r) => {
|
|
3929
|
+
if (!s || So(r)) return Promise.resolve();
|
|
3930
|
+
let c = i?.getFieldValue?.(Co(a, s, o));
|
|
3931
|
+
if (So(c)) return Promise.resolve();
|
|
3932
|
+
let l = Number(c), u = Number(r);
|
|
3933
|
+
return Number.isNaN(l) || Number.isNaN(u) || u <= l ? Promise.resolve() : Promise.reject(Error(t ?? `${e} must not exceed ${s}`));
|
|
3934
|
+
} };
|
|
3935
|
+
}
|
|
3936
|
+
function To(e = {}, t, n) {
|
|
3937
|
+
let r = e.field ?? e.compareField ?? e.value;
|
|
3938
|
+
return r ? Co(t, r, n) : null;
|
|
3939
|
+
}
|
|
3940
|
+
//#endregion
|
|
3941
|
+
//#region src/components/form/optionConstraints.js
|
|
3942
|
+
var Q = (e) => String(e ?? "").trim().toLowerCase();
|
|
3943
|
+
function Eo(e) {
|
|
3944
|
+
let t = Array.isArray(e) ? e : [e], n = [];
|
|
3945
|
+
return t.forEach((e) => {
|
|
3946
|
+
if (!(e == null || e === "")) {
|
|
3947
|
+
if (typeof e == "object") {
|
|
3948
|
+
[
|
|
3949
|
+
e.value,
|
|
3950
|
+
e.id,
|
|
3951
|
+
e._id,
|
|
3952
|
+
e.label,
|
|
3953
|
+
e.name
|
|
3954
|
+
].forEach((e) => {
|
|
3955
|
+
e != null && e !== "" && n.push(Q(e));
|
|
3956
|
+
});
|
|
3957
|
+
return;
|
|
3958
|
+
}
|
|
3959
|
+
n.push(Q(e));
|
|
3960
|
+
}
|
|
3961
|
+
}), n;
|
|
3962
|
+
}
|
|
3963
|
+
function Do(e = [], t) {
|
|
3964
|
+
let n = Eo(t);
|
|
3965
|
+
if (!n.length || !Array.isArray(e) || e.length === 0) return e;
|
|
3966
|
+
let r = new Set(n), i = e.filter((e) => e == null ? !1 : typeof e == "object" ? r.has(Q(e.value)) || r.has(Q(e.label)) : r.has(Q(e)));
|
|
3967
|
+
return i.length > 0 ? i : e;
|
|
3968
|
+
}
|
|
3969
|
+
//#endregion
|
|
3970
|
+
//#region src/components/form/fieldTooltip.js
|
|
3971
|
+
var Oo = (e) => e == null || String(e).trim() === "", ko = (e) => e === !0 || e === 1 || e === "1" || e === "true";
|
|
3972
|
+
function Ao(e) {
|
|
3973
|
+
return Oo(e?.tooltip) ? ko(e?.infoEnabled) && !Oo(e?.infoText) ? String(e.infoText) : "" : String(e.tooltip);
|
|
3974
|
+
}
|
|
3975
|
+
//#endregion
|
|
3707
3976
|
//#region src/utils/roleAllowsAction.js
|
|
3708
|
-
function
|
|
3709
|
-
return e == null ? !0 : typeof e == "object" ?
|
|
3977
|
+
function jo(e) {
|
|
3978
|
+
return e == null ? !0 : typeof e == "object" ? jo(e.permission ?? e.allowed ?? e.value) : e !== !1 && e !== 0 && e !== "0";
|
|
3710
3979
|
}
|
|
3711
|
-
function
|
|
3980
|
+
function Mo(e, t) {
|
|
3712
3981
|
if (!e) return !0;
|
|
3713
3982
|
try {
|
|
3714
3983
|
let n = JSON.parse(localStorage.getItem("menuPermission") || "{}"), [r, i] = String(e).split(".");
|
|
3715
|
-
return
|
|
3984
|
+
return jo((n[r || String(t || "").replace(/s$/i, "")] ?? n[String(t || "")] ?? n[String(t || "").replace(/s$/i, "")] ?? {})[i]);
|
|
3716
3985
|
} catch {
|
|
3717
3986
|
return !0;
|
|
3718
3987
|
}
|
|
3719
3988
|
}
|
|
3720
3989
|
//#endregion
|
|
3721
3990
|
//#region src/utils/afterSubmitNav.js
|
|
3722
|
-
function
|
|
3991
|
+
function No(e) {
|
|
3723
3992
|
return (e ?? []).filter((e) => e?.afterSubmit?.mode).sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.afterSubmit ?? null;
|
|
3724
3993
|
}
|
|
3725
|
-
function
|
|
3994
|
+
function Po(e, t, n) {
|
|
3726
3995
|
let r = String(e ?? "").trim();
|
|
3727
3996
|
return !r || !r.startsWith("/") || r.startsWith("//") || /^[a-z][a-z0-9+.-]*:/i.test(r) ? null : r.replace(/:([A-Za-z_][\w]*)/g, (e, r) => {
|
|
3728
3997
|
let i = r === "id" ? t : n?.[r];
|
|
@@ -3731,29 +4000,29 @@ function io(e, t, n) {
|
|
|
3731
4000
|
}
|
|
3732
4001
|
//#endregion
|
|
3733
4002
|
//#region src/utils/submitMessages.js
|
|
3734
|
-
function
|
|
4003
|
+
function Fo(e) {
|
|
3735
4004
|
return (e ?? []).filter((e) => e?.submitMessages && typeof e.submitMessages == "object").sort((e, t) => (e.order ?? 0) - (t.order ?? 0))[0]?.submitMessages ?? null;
|
|
3736
4005
|
}
|
|
3737
4006
|
function $(e) {
|
|
3738
4007
|
let t = String(e ?? "").trim();
|
|
3739
4008
|
return t ? t.charAt(0).toUpperCase() + t.slice(1) : "Record";
|
|
3740
4009
|
}
|
|
3741
|
-
function
|
|
4010
|
+
function Io(e, t) {
|
|
3742
4011
|
return String(e).replaceAll("${module}", $(t)).replaceAll("${moduleName}", $(t));
|
|
3743
4012
|
}
|
|
3744
|
-
function
|
|
3745
|
-
let r =
|
|
4013
|
+
function Lo(e, t, n) {
|
|
4014
|
+
let r = Fo(e);
|
|
3746
4015
|
if (r?.suppress) return null;
|
|
3747
4016
|
let i = n === "edit" ? r?.editSuccess : r?.addSuccess;
|
|
3748
|
-
return i && String(i).trim() ?
|
|
4017
|
+
return i && String(i).trim() ? Io(i, t) : n === "edit" ? `${$(t)} has Updated successfully` : `${$(t)} has added successfully`;
|
|
3749
4018
|
}
|
|
3750
|
-
function
|
|
3751
|
-
let i =
|
|
3752
|
-
return a && String(a).trim() ?
|
|
4019
|
+
function Ro(e, t, n, r) {
|
|
4020
|
+
let i = Fo(e), a = n === "edit" ? i?.editError : i?.addError;
|
|
4021
|
+
return a && String(a).trim() ? Io(a, t) : r && String(r).trim() ? String(r) : n === "edit" ? `Failed to update ${$(t)}` : `Failed to create ${$(t)}`;
|
|
3753
4022
|
}
|
|
3754
4023
|
//#endregion
|
|
3755
4024
|
//#region src/utils/scrollToFirstFormError.js
|
|
3756
|
-
function
|
|
4025
|
+
function zo({ errorFields: e } = {}, t) {
|
|
3757
4026
|
if (!e?.length) return;
|
|
3758
4027
|
let n = e[0]?.name;
|
|
3759
4028
|
setTimeout(() => {
|
|
@@ -3778,10 +4047,10 @@ function lo({ errorFields: e } = {}, t) {
|
|
|
3778
4047
|
}
|
|
3779
4048
|
//#endregion
|
|
3780
4049
|
//#region src/components/form/conditionalFieldLabel.js
|
|
3781
|
-
function
|
|
4050
|
+
function Bo(e) {
|
|
3782
4051
|
return Array.isArray(e) ? e.map((e) => String(e ?? "").trim()) : String(e ?? "").split(",").map((e) => e.trim());
|
|
3783
4052
|
}
|
|
3784
|
-
function
|
|
4053
|
+
function Vo(e, t) {
|
|
3785
4054
|
if (!e?.field) return !1;
|
|
3786
4055
|
switch (e.operator ?? "eq") {
|
|
3787
4056
|
case "eq": return String(t ?? "") === String(e.value ?? "");
|
|
@@ -3789,53 +4058,53 @@ function fo(e, t) {
|
|
|
3789
4058
|
case "truthy": return t != null && t !== "" && t !== !1;
|
|
3790
4059
|
case "falsy": return t == null || t === "" || t === !1;
|
|
3791
4060
|
case "notEmpty": return Array.isArray(t) ? t.length > 0 : !!t;
|
|
3792
|
-
case "in": return
|
|
3793
|
-
case "notIn": return !
|
|
4061
|
+
case "in": return Bo(e.value).includes(String(t ?? ""));
|
|
4062
|
+
case "notIn": return !Bo(e.value).includes(String(t ?? ""));
|
|
3794
4063
|
default: return !1;
|
|
3795
4064
|
}
|
|
3796
4065
|
}
|
|
3797
|
-
function
|
|
4066
|
+
function Ho(e, t, n = !1) {
|
|
3798
4067
|
let r = n ? e?.combineLabel ?? e?.label : e?.label, i = e?.labelWhen;
|
|
3799
|
-
return
|
|
4068
|
+
return Vo(i, t) && i?.label ? i.label : r;
|
|
3800
4069
|
}
|
|
3801
|
-
function
|
|
4070
|
+
function Uo(e) {
|
|
3802
4071
|
return e ? [...e.field ? [e] : [], ...(e.conditions ?? []).filter((e) => e?.field)] : [];
|
|
3803
4072
|
}
|
|
3804
|
-
function
|
|
3805
|
-
let n =
|
|
4073
|
+
function Wo(e, t) {
|
|
4074
|
+
let n = Uo(e);
|
|
3806
4075
|
if (!n.length) return !0;
|
|
3807
|
-
let r = n.map((e) =>
|
|
4076
|
+
let r = n.map((e) => Vo(e, t(e.field)));
|
|
3808
4077
|
return e.logic === "or" ? r.some(Boolean) : r.every(Boolean);
|
|
3809
4078
|
}
|
|
3810
|
-
function
|
|
4079
|
+
function Go(e) {
|
|
3811
4080
|
let t = e?.colWhen;
|
|
3812
4081
|
return t ? (Array.isArray(t) ? t : [t]).filter((e) => e?.field && Number(e?.col) > 0) : [];
|
|
3813
4082
|
}
|
|
3814
|
-
function
|
|
3815
|
-
for (let t of
|
|
4083
|
+
function Ko(e, t, n) {
|
|
4084
|
+
for (let t of Go(e)) if (Vo(t, n(t))) return Number(t.col);
|
|
3816
4085
|
return t;
|
|
3817
4086
|
}
|
|
3818
|
-
function
|
|
4087
|
+
function qo(e, t) {
|
|
3819
4088
|
return e?.field ? t == null ? [e.field] : [...Array.isArray(t) ? t : [t], e.field] : ["__noop_conditional_label__"];
|
|
3820
4089
|
}
|
|
3821
4090
|
//#endregion
|
|
3822
4091
|
//#region src/components/Breadcrumb.jsx
|
|
3823
|
-
function
|
|
3824
|
-
return /* @__PURE__ */
|
|
4092
|
+
function Jo({ items: e = [] }) {
|
|
4093
|
+
return /* @__PURE__ */ C(_, { items: e.map((t, n) => ({ title: n === e.length - 1 ? /* @__PURE__ */ C(Be, {
|
|
3825
4094
|
variant: "body",
|
|
3826
4095
|
weight: "medium",
|
|
3827
4096
|
color: "link",
|
|
3828
4097
|
children: t.label
|
|
3829
|
-
}) : /* @__PURE__ */
|
|
4098
|
+
}) : /* @__PURE__ */ w("a", {
|
|
3830
4099
|
href: t.href,
|
|
3831
|
-
children: [/* @__PURE__ */
|
|
4100
|
+
children: [/* @__PURE__ */ C(Be, {
|
|
3832
4101
|
variant: "body",
|
|
3833
4102
|
color: "secondary",
|
|
3834
4103
|
children: t.label
|
|
3835
|
-
}), t.dropdown && /* @__PURE__ */
|
|
4104
|
+
}), t.dropdown && /* @__PURE__ */ C(ie, {})]
|
|
3836
4105
|
}) })) });
|
|
3837
4106
|
}
|
|
3838
4107
|
//#endregion
|
|
3839
|
-
export {
|
|
4108
|
+
export { Ri as $, vt as $n, Xn as $t, Ha as A, pn as An, hr as At, Ca as B, er as Bn, _r as Bt, to as C, Bn as Cn, _n as Ct, Ja as D, ln as Dn, $n as Dt, Ga as E, an as En, rr as Et, Ea as F, In as Fn, ar as Ft, Zi as G, gr as Gn, bn as Gt, oa as H, Hn, Ut as Ht, ua as I, hn as In, tr as It, Oi as J, Rn as Jn, Zn as Jt, ra as K, wn as Kn, Cn as Kt, la as L, Kt as Ln, Sr as Lt, Va as M, qn as Mn, on as Mt, ja as N, Pt as Nn, fr as Nt, qa as O, Qt as On, br as Ot, Aa as P, Nn as Pn, mn as Pt, na as Q, _t as Qn, un as Qt, da as R, dr as Rn, Un as Rt, ro as S, Dn as Sn, Yt as St, eo as T, Jt as Tn, ur as Tt, sa as U, kn as Un, Ht as Ut, aa as V, xr as Vn, zn as Vt, q as W, sr as Wn, rn as Wt, K as X, Tt as Xn, Lt as Xt, V as Y, Jn as Yn, Yn as Yt, Wi as Z, wt as Zn, cn as Zt, Do as _, Mn as _n, Pr as _t, Ho as a, dn as an, Be as ar, Ir as at, xo as b, or as bn, Tr as bt, Uo as c, Gn as cn, Rr as ct, Lo as d, yr as dn, Br as dt, lr as en, yt as er, Li as et, No as f, Mt as fn, Ur as ft, Ao as g, jt as gn, Dr as gt, Mo as h, Wt as hn, Or as ht, Vo as i, fn as in, He as ir, qr as it, Ba as j, It as jn, qt as jt, Wa as k, tn as kn, Vn as kt, zo as l, nr as ln, Hr as lt, jo as m, vn as mn, Nr as mt, Go as n, en as nn, lt as nr, Jr as nt, Wo as o, gn as on, D as or, Gr as ot, Po as p, Kn as pn, Fr as pt, Xi as q, Pn as qn, Fn as qt, qo as r, Ln as rn, ct as rr, Yr as rt, Ko as s, Wn as sn, E as sr, Wr as st, Jo as t, Zt as tn, ut as tr, di as tt, Ro as u, Qn as un, Kr as ut, To as v, I as vn, kr as vt, Qa as w, Nt as wn, Gt as wt, ao as x, mr as xn, wr as xt, wo as y, En as yn, Ar as yt, J as z, ir as zn, Ft as zt };
|
|
3840
4109
|
|
|
3841
|
-
//# sourceMappingURL=Breadcrumb-
|
|
4110
|
+
//# sourceMappingURL=Breadcrumb-DD-QBb4T.js.map
|