@isettingkit/business-rules 2.2.14 → 2.2.15
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/index.es.d.ts +2 -0
- package/dist/index.es.js +912 -898
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as a, jsxs as m, Fragment as V } from "react/jsx-runtime";
|
|
2
2
|
import { MdOutlineDelete as mt, MdClear as qt, MdAdd as We, MdOutlineCreate as Yn, MdExpandLess as Xn, MdExpandMore as Ot, MdInfo as Qn, MdCached as Zn, MdOutlineInfo as Jn, MdClose as Kn, MdOutlineFilterAltOff as eo, MdOutlineFilterAlt as En, MdChevronRight as tn, MdArrowRight as to, MdOutlineArrowCircleLeft as no, MdOutlineArrowCircleRight as oo } from "react-icons/md";
|
|
3
|
-
import { inube as I, Stack as
|
|
3
|
+
import { inube as I, Stack as T, Divider as Y, Icon as G, Text as $, SkeletonLine as ie, useMediaQuery as ue, Blanket as Wt, Button as Q, Grid as Ye, Toggle as bt, Checkbox as Yt, Date as Ae, Box as ro, Tag as Pe, Tabs as Nn, SkeletonIcon as io, Fieldset as Ve, OptionList as ao, Checkpicker as lo } from "@inubekit/inubekit";
|
|
4
4
|
import E, { keyframes as Xt, ThemeContext as so } from "styled-components";
|
|
5
5
|
import { ValueDataType as H, ValueHowToSetUp as j, DecisionConditionRender as pt, DecisionConditionRenderNew as nn } from "@isettingkit/input";
|
|
6
6
|
import { DecisionViewConditionRenderer as Ne, DecisionViewConditionRendererNew as it } from "@isettingkit/view";
|
|
7
7
|
import { createPortal as Qt } from "react-dom";
|
|
8
8
|
import { useFormik as Zt } from "formik";
|
|
9
9
|
import { string as ge, mixed as ve, object as J, number as pe, lazy as Ge, date as Ie } from "yup";
|
|
10
|
-
import
|
|
11
|
-
import { Link as kn,
|
|
12
|
-
import
|
|
13
|
-
import { franc as
|
|
14
|
-
const
|
|
10
|
+
import _, { useState as B, useRef as je, useEffect as Be, useContext as co } from "react";
|
|
11
|
+
import { Link as kn, useNavigate as uo, useLocation as po } from "react-router-dom";
|
|
12
|
+
import ho from "axios";
|
|
13
|
+
import { franc as go } from "franc-min";
|
|
14
|
+
const fo = E.div`
|
|
15
15
|
border-radius: 8px;
|
|
16
16
|
border: 1px solid
|
|
17
17
|
${({ theme: e }) => {
|
|
@@ -48,11 +48,11 @@ E.div`
|
|
|
48
48
|
`;
|
|
49
49
|
const Xe = (e) => {
|
|
50
50
|
const { children: t, controls: n = !0, handleDelete: o, id: r } = e;
|
|
51
|
-
return /* @__PURE__ */ a(
|
|
51
|
+
return /* @__PURE__ */ a(fo, { children: /* @__PURE__ */ m(T, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
52
52
|
t,
|
|
53
53
|
n && /* @__PURE__ */ m(V, { children: [
|
|
54
54
|
/* @__PURE__ */ a(Y, {}),
|
|
55
|
-
/* @__PURE__ */ a(
|
|
55
|
+
/* @__PURE__ */ a(T, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ a(
|
|
56
56
|
G,
|
|
57
57
|
{
|
|
58
58
|
cursorHover: !0,
|
|
@@ -66,20 +66,20 @@ const Xe = (e) => {
|
|
|
66
66
|
) })
|
|
67
67
|
] })
|
|
68
68
|
] }) });
|
|
69
|
-
},
|
|
69
|
+
}, mo = (e) => e.value, bo = (e) => e.value, vo = (e) => e.value, yo = (e) => ({
|
|
70
70
|
from: e.from ?? "",
|
|
71
71
|
to: e.to ?? ""
|
|
72
|
-
}),
|
|
72
|
+
}), To = (e) => e.value, xo = (e) => e.value, Do = (e) => e.value;
|
|
73
73
|
var k = /* @__PURE__ */ ((e) => (e.EQUAL = "EqualTo", e.GREATER_THAN = "GreaterThan", e.LESS_THAN = "LessThan", e.LIST_OF_VALUES = "ListOfValues", e.LIST_OF_VALUES_MULTI = "ListOfValuesMulti", e.RANGE = "Range", e))(k || {});
|
|
74
|
-
const
|
|
75
|
-
[k.LIST_OF_VALUES]:
|
|
76
|
-
[k.LIST_OF_VALUES_MULTI]:
|
|
77
|
-
[k.RANGE]:
|
|
78
|
-
[k.GREATER_THAN]:
|
|
79
|
-
[k.LESS_THAN]:
|
|
80
|
-
[k.EQUAL]:
|
|
74
|
+
const wo = {
|
|
75
|
+
[k.LIST_OF_VALUES]: bo,
|
|
76
|
+
[k.LIST_OF_VALUES_MULTI]: vo,
|
|
77
|
+
[k.RANGE]: yo,
|
|
78
|
+
[k.GREATER_THAN]: To,
|
|
79
|
+
[k.LESS_THAN]: xo,
|
|
80
|
+
[k.EQUAL]: Do
|
|
81
81
|
}, Ue = (e) => {
|
|
82
|
-
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), o =
|
|
82
|
+
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), o = wo[e == null ? void 0 : e.howToSetTheDecision] || mo;
|
|
83
83
|
return n && o(t) || t || void 0;
|
|
84
84
|
}, on = E.div`
|
|
85
85
|
& > div {
|
|
@@ -108,7 +108,7 @@ const Do = {
|
|
|
108
108
|
background-color: #ebecf0;
|
|
109
109
|
border-radius: 8px;
|
|
110
110
|
}
|
|
111
|
-
`,
|
|
111
|
+
`, Co = (e) => {
|
|
112
112
|
const {
|
|
113
113
|
conditionsAlignment: t,
|
|
114
114
|
decision: n,
|
|
@@ -120,8 +120,8 @@ const Do = {
|
|
|
120
120
|
textValues: l,
|
|
121
121
|
visibleConditions: u
|
|
122
122
|
} = e;
|
|
123
|
-
return i ? /* @__PURE__ */ m(
|
|
124
|
-
/* @__PURE__ */ a(
|
|
123
|
+
return i ? /* @__PURE__ */ m(T, { direction: "column", gap: "12px", children: [
|
|
124
|
+
/* @__PURE__ */ a(T, { direction: "column", alignItems: "center", children: /* @__PURE__ */ a(
|
|
125
125
|
Ne,
|
|
126
126
|
{
|
|
127
127
|
element: r,
|
|
@@ -133,7 +133,7 @@ const Do = {
|
|
|
133
133
|
) }, n.ruleName),
|
|
134
134
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
135
135
|
/* @__PURE__ */ a(rn, { children: /* @__PURE__ */ m(
|
|
136
|
-
|
|
136
|
+
T,
|
|
137
137
|
{
|
|
138
138
|
direction: "column",
|
|
139
139
|
gap: "12px",
|
|
@@ -151,7 +151,7 @@ const Do = {
|
|
|
151
151
|
children: l.factsThatConditionIt
|
|
152
152
|
}
|
|
153
153
|
),
|
|
154
|
-
u.length > 0 && u.map((p) => /* @__PURE__ */ a(on, { children: /* @__PURE__ */ a(
|
|
154
|
+
u.length > 0 && u.map((p) => /* @__PURE__ */ a(on, { children: /* @__PURE__ */ a(T, { direction: "column", padding: "8px", children: /* @__PURE__ */ a(
|
|
155
155
|
Ne,
|
|
156
156
|
{
|
|
157
157
|
element: { ...p, value: p.value },
|
|
@@ -173,24 +173,24 @@ const Do = {
|
|
|
173
173
|
]
|
|
174
174
|
}
|
|
175
175
|
) })
|
|
176
|
-
] }) : /* @__PURE__ */ m(
|
|
177
|
-
/* @__PURE__ */ m(
|
|
176
|
+
] }) : /* @__PURE__ */ m(T, { direction: "column", gap: "12px", children: [
|
|
177
|
+
/* @__PURE__ */ m(T, { direction: "column", alignItems: "center", gap: "4px", children: [
|
|
178
178
|
/* @__PURE__ */ a(ie, { animated: !0, width: "180px" }),
|
|
179
179
|
/* @__PURE__ */ a(ie, { animated: !0, width: "85px" })
|
|
180
180
|
] }, "loading"),
|
|
181
|
-
/* @__PURE__ */ m(
|
|
181
|
+
/* @__PURE__ */ m(T, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
182
182
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
183
183
|
/* @__PURE__ */ a(ie, { animated: !0, width: "150px" })
|
|
184
184
|
] }),
|
|
185
185
|
/* @__PURE__ */ a(rn, { children: /* @__PURE__ */ a(
|
|
186
|
-
|
|
186
|
+
T,
|
|
187
187
|
{
|
|
188
188
|
direction: "column",
|
|
189
189
|
gap: "12px",
|
|
190
190
|
justifyContent: "space-between",
|
|
191
191
|
height: "203px",
|
|
192
192
|
children: s.map((p, c) => /* @__PURE__ */ a(on, { children: /* @__PURE__ */ m(
|
|
193
|
-
|
|
193
|
+
T,
|
|
194
194
|
{
|
|
195
195
|
direction: "column",
|
|
196
196
|
gap: "12px",
|
|
@@ -245,7 +245,7 @@ const Do = {
|
|
|
245
245
|
(g) => !g.hidden
|
|
246
246
|
)) || [], u = Array.from({ length: 5 }), p = !!(!n && t && o && d), c = l.length < 2 ? "start" : "space-between";
|
|
247
247
|
return /* @__PURE__ */ a(
|
|
248
|
-
|
|
248
|
+
Co,
|
|
249
249
|
{
|
|
250
250
|
conditionsAlignment: c,
|
|
251
251
|
decision: t,
|
|
@@ -263,7 +263,7 @@ const Do = {
|
|
|
263
263
|
& > div {
|
|
264
264
|
padding: 24px 16px;
|
|
265
265
|
}
|
|
266
|
-
`,
|
|
266
|
+
`, Eo = E.div`
|
|
267
267
|
background-color: ${({ theme: e }) => {
|
|
268
268
|
var t, n;
|
|
269
269
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || I.palette.neutral.N0;
|
|
@@ -302,8 +302,8 @@ const Do = {
|
|
|
302
302
|
);
|
|
303
303
|
const s = ue("(max-width: 400px)");
|
|
304
304
|
return Qt(
|
|
305
|
-
/* @__PURE__ */ a(So, { smallScreen: s, children: /* @__PURE__ */ a(Wt, { children: /* @__PURE__ */ a(
|
|
306
|
-
/* @__PURE__ */ a(
|
|
305
|
+
/* @__PURE__ */ a(So, { smallScreen: s, children: /* @__PURE__ */ a(Wt, { children: /* @__PURE__ */ a(Eo, { children: /* @__PURE__ */ m(T, { direction: "column", gap: "24px", children: [
|
|
306
|
+
/* @__PURE__ */ a(T, { direction: "column", gap: "24px", children: /* @__PURE__ */ m(T, { alignItems: "center", justifyContent: "space-between", children: [
|
|
307
307
|
/* @__PURE__ */ a($, { type: "title", size: "large", appearance: "dark", weight: "bold", children: r }),
|
|
308
308
|
/* @__PURE__ */ a(qt, { size: "24px", cursor: "pointer", onClick: o })
|
|
309
309
|
] }) }),
|
|
@@ -311,7 +311,7 @@ const Do = {
|
|
|
311
311
|
] }) }) }) }),
|
|
312
312
|
i
|
|
313
313
|
);
|
|
314
|
-
},
|
|
314
|
+
}, No = Xt`
|
|
315
315
|
from {
|
|
316
316
|
opacity: 0;
|
|
317
317
|
transform: translateY(20px);
|
|
@@ -362,14 +362,14 @@ const In = E.div`
|
|
|
362
362
|
width: 100%;
|
|
363
363
|
height: 100%;
|
|
364
364
|
& > div {
|
|
365
|
-
animation: ${
|
|
365
|
+
animation: ${No} 600ms ease-out;
|
|
366
366
|
}
|
|
367
|
-
`,
|
|
367
|
+
`, ko = E.div`
|
|
368
368
|
& > div > div {
|
|
369
369
|
border-radius: 8px;
|
|
370
370
|
box-sizing: border-box;
|
|
371
371
|
}
|
|
372
|
-
`,
|
|
372
|
+
`, Ao = E.div`
|
|
373
373
|
& > div {
|
|
374
374
|
width: 100%;
|
|
375
375
|
height: 100%;
|
|
@@ -389,7 +389,7 @@ const In = E.div`
|
|
|
389
389
|
border-radius: 8px;
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
`,
|
|
392
|
+
`, Io = (e) => {
|
|
393
393
|
const { index: t, handleOpenModal: n } = e;
|
|
394
394
|
return /* @__PURE__ */ a(
|
|
395
395
|
Xe,
|
|
@@ -403,9 +403,9 @@ const In = E.div`
|
|
|
403
403
|
},
|
|
404
404
|
`loading-card-${t}`
|
|
405
405
|
);
|
|
406
|
-
},
|
|
406
|
+
}, Fo = (e) => {
|
|
407
407
|
const { decision: t, controls: n, handleOpenModal: o, handleDelete: r, textValues: i } = e;
|
|
408
|
-
return t ? /* @__PURE__ */ a(Qe, { children: /* @__PURE__ */ m(
|
|
408
|
+
return t ? /* @__PURE__ */ a(Qe, { children: /* @__PURE__ */ m(T, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
|
|
409
409
|
/* @__PURE__ */ a($, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.decisionId }),
|
|
410
410
|
/* @__PURE__ */ a(
|
|
411
411
|
Xe,
|
|
@@ -418,14 +418,14 @@ const In = E.div`
|
|
|
418
418
|
}
|
|
419
419
|
)
|
|
420
420
|
] }) }, t.decisionId) : null;
|
|
421
|
-
},
|
|
421
|
+
}, $o = (e) => {
|
|
422
422
|
const {
|
|
423
423
|
customTitleContentAddCard: t,
|
|
424
424
|
index: n,
|
|
425
425
|
handleOpenModal: o,
|
|
426
426
|
shouldRenderEmptyMessage: r
|
|
427
427
|
} = e, i = t || "Agregar decisión";
|
|
428
|
-
return /* @__PURE__ */ a(Qe, { children: r ? null : /* @__PURE__ */ m(
|
|
428
|
+
return /* @__PURE__ */ a(Qe, { children: r ? null : /* @__PURE__ */ m(T, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
|
|
429
429
|
/* @__PURE__ */ a($, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
|
|
430
430
|
/* @__PURE__ */ a(
|
|
431
431
|
In,
|
|
@@ -439,7 +439,7 @@ const In = E.div`
|
|
|
439
439
|
},
|
|
440
440
|
handleView: () => o ? o() : null,
|
|
441
441
|
controls: !1,
|
|
442
|
-
children: /* @__PURE__ */ m(
|
|
442
|
+
children: /* @__PURE__ */ m(T, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
443
443
|
/* @__PURE__ */ a(G, { appearance: "gray", icon: /* @__PURE__ */ a(We, {}), size: "35px" }),
|
|
444
444
|
/* @__PURE__ */ a($, { appearance: "gray", type: "body", size: "large", children: i })
|
|
445
445
|
] })
|
|
@@ -448,14 +448,14 @@ const In = E.div`
|
|
|
448
448
|
}
|
|
449
449
|
)
|
|
450
450
|
] }) }, `add-decision-${n}`);
|
|
451
|
-
},
|
|
452
|
-
loading:
|
|
453
|
-
decision:
|
|
454
|
-
add:
|
|
451
|
+
}, Ro = {
|
|
452
|
+
loading: Io,
|
|
453
|
+
decision: Fo,
|
|
454
|
+
add: $o
|
|
455
455
|
}, Mt = (e) => {
|
|
456
|
-
const { type: t } = e, n =
|
|
456
|
+
const { type: t } = e, n = Ro[t];
|
|
457
457
|
return n ? n(e) : null;
|
|
458
|
-
},
|
|
458
|
+
}, Lo = (e) => {
|
|
459
459
|
const {
|
|
460
460
|
controls: t,
|
|
461
461
|
customTitleContentAddCard: n,
|
|
@@ -488,7 +488,7 @@ const In = E.div`
|
|
|
488
488
|
})
|
|
489
489
|
), u = ((o == null ? void 0 : o.length) === 0 || o.length < Math.floor(window.innerWidth / 300)) && !r && t;
|
|
490
490
|
return { renderedCards: l, shouldRenderAddCard: u };
|
|
491
|
-
},
|
|
491
|
+
}, wl = (e) => {
|
|
492
492
|
const {
|
|
493
493
|
controls: t = !0,
|
|
494
494
|
customTitleContentAddCard: n,
|
|
@@ -504,7 +504,7 @@ const In = E.div`
|
|
|
504
504
|
handleSubmitForm: h,
|
|
505
505
|
handleDelete: g,
|
|
506
506
|
terms: f = !0
|
|
507
|
-
} = e,
|
|
507
|
+
} = e, x = ue("(max-width: 681px)"), y = ue("(max-width: 400px)"), { renderedCards: v, shouldRenderAddCard: w } = Lo({
|
|
508
508
|
controls: t,
|
|
509
509
|
customTitleContentAddCard: n,
|
|
510
510
|
decisions: r,
|
|
@@ -512,15 +512,15 @@ const In = E.div`
|
|
|
512
512
|
handleOpenModal: p,
|
|
513
513
|
handleDelete: g,
|
|
514
514
|
textValues: i
|
|
515
|
-
}),
|
|
515
|
+
}), S = (r == null ? void 0 : r.length) === 0 && !u;
|
|
516
516
|
return /* @__PURE__ */ m(V, { children: [
|
|
517
|
-
/* @__PURE__ */ a(
|
|
518
|
-
|
|
517
|
+
/* @__PURE__ */ a(ko, { children: /* @__PURE__ */ a(Ao, { children: /* @__PURE__ */ a(T, { direction: "column", gap: "16px", padding: "6px", children: S ? /* @__PURE__ */ m(
|
|
518
|
+
T,
|
|
519
519
|
{
|
|
520
520
|
direction: "column",
|
|
521
521
|
gap: "28px",
|
|
522
522
|
width: "100%",
|
|
523
|
-
height:
|
|
523
|
+
height: x ? "auto" : "435px",
|
|
524
524
|
justifyContent: "center",
|
|
525
525
|
alignItems: "center",
|
|
526
526
|
children: [
|
|
@@ -556,7 +556,7 @@ const In = E.div`
|
|
|
556
556
|
) : /* @__PURE__ */ m(
|
|
557
557
|
Ye,
|
|
558
558
|
{
|
|
559
|
-
templateColumns:
|
|
559
|
+
templateColumns: y ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
|
|
560
560
|
autoFlow: "row dense",
|
|
561
561
|
gap: "24px",
|
|
562
562
|
alignItems: "start",
|
|
@@ -564,10 +564,10 @@ const In = E.div`
|
|
|
564
564
|
autoRows: "1fr",
|
|
565
565
|
justifyItems: "center",
|
|
566
566
|
padding: "6px",
|
|
567
|
-
height:
|
|
567
|
+
height: x ? "auto" : "484px",
|
|
568
568
|
children: [
|
|
569
|
-
|
|
570
|
-
|
|
569
|
+
v,
|
|
570
|
+
w && Mt({
|
|
571
571
|
type: "add",
|
|
572
572
|
index: r == null ? void 0 : r.length,
|
|
573
573
|
controls: t,
|
|
@@ -577,7 +577,7 @@ const In = E.div`
|
|
|
577
577
|
handleOpenModal: p,
|
|
578
578
|
handleDelete: g,
|
|
579
579
|
textValues: i,
|
|
580
|
-
shouldRenderEmptyMessage:
|
|
580
|
+
shouldRenderEmptyMessage: S,
|
|
581
581
|
terms: f
|
|
582
582
|
})
|
|
583
583
|
]
|
|
@@ -590,7 +590,7 @@ const In = E.div`
|
|
|
590
590
|
onCloseModal: c,
|
|
591
591
|
title: l ? "Editar Decisión" : "Nueva decisión",
|
|
592
592
|
children: /* @__PURE__ */ a(
|
|
593
|
-
|
|
593
|
+
Ui,
|
|
594
594
|
{
|
|
595
595
|
decision: l || s,
|
|
596
596
|
onSubmitEvent: h,
|
|
@@ -602,12 +602,12 @@ const In = E.div`
|
|
|
602
602
|
}
|
|
603
603
|
)
|
|
604
604
|
] });
|
|
605
|
-
},
|
|
605
|
+
}, Oo = E.div`
|
|
606
606
|
position: relative;
|
|
607
607
|
& > div {
|
|
608
608
|
padding: 24px 16px;
|
|
609
609
|
}
|
|
610
|
-
`,
|
|
610
|
+
`, Mo = E.div`
|
|
611
611
|
background-color: ${({ theme: e }) => {
|
|
612
612
|
var t, n;
|
|
613
613
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || I.palette.neutral.N0;
|
|
@@ -638,7 +638,7 @@ const In = E.div`
|
|
|
638
638
|
background-color: #ebecf0;
|
|
639
639
|
border-radius: 8px;
|
|
640
640
|
}
|
|
641
|
-
`,
|
|
641
|
+
`, _o = (e) => {
|
|
642
642
|
const { children: t, portalId: n, onCloseModal: o, title: r } = e, i = document.getElementById(n);
|
|
643
643
|
if (!i)
|
|
644
644
|
throw new Error(
|
|
@@ -646,8 +646,8 @@ const In = E.div`
|
|
|
646
646
|
);
|
|
647
647
|
const s = ue("(max-width: 400px)");
|
|
648
648
|
return Qt(
|
|
649
|
-
/* @__PURE__ */ a(
|
|
650
|
-
/* @__PURE__ */ a(
|
|
649
|
+
/* @__PURE__ */ a(Oo, { $smallScreen: s, children: /* @__PURE__ */ a(Wt, { children: /* @__PURE__ */ a(Mo, { children: /* @__PURE__ */ m(T, { direction: "column", gap: "24px", children: [
|
|
650
|
+
/* @__PURE__ */ a(T, { direction: "column", gap: "24px", children: /* @__PURE__ */ m(T, { alignItems: "center", justifyContent: "space-between", children: [
|
|
651
651
|
/* @__PURE__ */ a($, { type: "title", size: "large", appearance: "dark", weight: "bold", children: r }),
|
|
652
652
|
/* @__PURE__ */ a(qt, { size: "24px", cursor: "pointer", onClick: o })
|
|
653
653
|
] }) }),
|
|
@@ -655,7 +655,7 @@ const In = E.div`
|
|
|
655
655
|
] }) }) }) }),
|
|
656
656
|
i
|
|
657
657
|
);
|
|
658
|
-
},
|
|
658
|
+
}, Po = Xt`
|
|
659
659
|
from {
|
|
660
660
|
opacity: 0;
|
|
661
661
|
transform: translateY(20px);
|
|
@@ -707,15 +707,15 @@ E.div`
|
|
|
707
707
|
width: 100%;
|
|
708
708
|
height: 100%;
|
|
709
709
|
& > div {
|
|
710
|
-
animation: ${
|
|
710
|
+
animation: ${Po} 600ms ease-out;
|
|
711
711
|
}
|
|
712
712
|
`;
|
|
713
|
-
const
|
|
713
|
+
const Vo = E.div`
|
|
714
714
|
& > div > div {
|
|
715
715
|
border-radius: 8px;
|
|
716
716
|
box-sizing: border-box;
|
|
717
717
|
}
|
|
718
|
-
`,
|
|
718
|
+
`, jo = E.div`
|
|
719
719
|
& > div {
|
|
720
720
|
width: 100%;
|
|
721
721
|
height: 100%;
|
|
@@ -735,7 +735,7 @@ const Po = E.div`
|
|
|
735
735
|
border-radius: 8px;
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
|
-
`,
|
|
738
|
+
`, Uo = (e) => {
|
|
739
739
|
const { index: t, handleOpenModal: n } = e;
|
|
740
740
|
return /* @__PURE__ */ a(
|
|
741
741
|
Xe,
|
|
@@ -749,18 +749,18 @@ const Po = E.div`
|
|
|
749
749
|
},
|
|
750
750
|
`loading-card-${t}`
|
|
751
751
|
);
|
|
752
|
-
},
|
|
752
|
+
}, zo = (e) => e.value, Ho = (e) => e.value, Go = (e) => e.value, Bo = (e) => ({
|
|
753
753
|
from: e.from ?? "",
|
|
754
754
|
to: e.to ?? ""
|
|
755
|
-
}),
|
|
756
|
-
[k.LIST_OF_VALUES]:
|
|
757
|
-
[k.LIST_OF_VALUES_MULTI]:
|
|
758
|
-
[k.RANGE]:
|
|
759
|
-
[k.GREATER_THAN]:
|
|
760
|
-
[k.LESS_THAN]:
|
|
761
|
-
[k.EQUAL]:
|
|
755
|
+
}), qo = (e) => e.value, Wo = (e) => e.value, Yo = (e) => e.value, Xo = {
|
|
756
|
+
[k.LIST_OF_VALUES]: Ho,
|
|
757
|
+
[k.LIST_OF_VALUES_MULTI]: Go,
|
|
758
|
+
[k.RANGE]: Bo,
|
|
759
|
+
[k.GREATER_THAN]: qo,
|
|
760
|
+
[k.LESS_THAN]: Wo,
|
|
761
|
+
[k.EQUAL]: Yo
|
|
762
762
|
}, ze = (e) => {
|
|
763
|
-
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), o =
|
|
763
|
+
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), o = Xo[e == null ? void 0 : e.howToSetTheDecision] || zo;
|
|
764
764
|
return n && o(t) || t || void 0;
|
|
765
765
|
}, an = E.div`
|
|
766
766
|
& > div {
|
|
@@ -789,7 +789,7 @@ const Po = E.div`
|
|
|
789
789
|
background-color: #ebecf0;
|
|
790
790
|
border-radius: 8px;
|
|
791
791
|
}
|
|
792
|
-
`,
|
|
792
|
+
`, Qo = (e) => {
|
|
793
793
|
const {
|
|
794
794
|
conditionsAlignment: t,
|
|
795
795
|
decision: n,
|
|
@@ -801,8 +801,8 @@ const Po = E.div`
|
|
|
801
801
|
textValues: l,
|
|
802
802
|
visibleConditions: u
|
|
803
803
|
} = e;
|
|
804
|
-
return i ? /* @__PURE__ */ m(
|
|
805
|
-
/* @__PURE__ */ a(
|
|
804
|
+
return i ? /* @__PURE__ */ m(T, { direction: "column", gap: "12px", children: [
|
|
805
|
+
/* @__PURE__ */ a(T, { direction: "column", alignItems: "center", children: /* @__PURE__ */ a(
|
|
806
806
|
Ne,
|
|
807
807
|
{
|
|
808
808
|
element: r,
|
|
@@ -814,7 +814,7 @@ const Po = E.div`
|
|
|
814
814
|
) }, n.ruleName),
|
|
815
815
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
816
816
|
/* @__PURE__ */ a(ln, { children: /* @__PURE__ */ m(
|
|
817
|
-
|
|
817
|
+
T,
|
|
818
818
|
{
|
|
819
819
|
direction: "column",
|
|
820
820
|
gap: "12px",
|
|
@@ -832,7 +832,7 @@ const Po = E.div`
|
|
|
832
832
|
children: l.factsThatConditionIt
|
|
833
833
|
}
|
|
834
834
|
),
|
|
835
|
-
u.length > 0 && u.map((p) => /* @__PURE__ */ a(an, { children: /* @__PURE__ */ a(
|
|
835
|
+
u.length > 0 && u.map((p) => /* @__PURE__ */ a(an, { children: /* @__PURE__ */ a(T, { direction: "column", padding: "8px", children: /* @__PURE__ */ a(
|
|
836
836
|
Ne,
|
|
837
837
|
{
|
|
838
838
|
element: { ...p, value: p.value },
|
|
@@ -854,24 +854,24 @@ const Po = E.div`
|
|
|
854
854
|
]
|
|
855
855
|
}
|
|
856
856
|
) })
|
|
857
|
-
] }) : /* @__PURE__ */ m(
|
|
858
|
-
/* @__PURE__ */ m(
|
|
857
|
+
] }) : /* @__PURE__ */ m(T, { direction: "column", gap: "12px", children: [
|
|
858
|
+
/* @__PURE__ */ m(T, { direction: "column", alignItems: "center", gap: "4px", children: [
|
|
859
859
|
/* @__PURE__ */ a(ie, { animated: !0, width: "180px" }),
|
|
860
860
|
/* @__PURE__ */ a(ie, { animated: !0, width: "85px" })
|
|
861
861
|
] }, "loading"),
|
|
862
|
-
/* @__PURE__ */ m(
|
|
862
|
+
/* @__PURE__ */ m(T, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
863
863
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
864
864
|
/* @__PURE__ */ a(ie, { animated: !0, width: "150px" })
|
|
865
865
|
] }),
|
|
866
866
|
/* @__PURE__ */ a(ln, { children: /* @__PURE__ */ a(
|
|
867
|
-
|
|
867
|
+
T,
|
|
868
868
|
{
|
|
869
869
|
direction: "column",
|
|
870
870
|
gap: "12px",
|
|
871
871
|
justifyContent: "space-between",
|
|
872
872
|
height: "203px",
|
|
873
873
|
children: s.map((p, c) => /* @__PURE__ */ a(an, { children: /* @__PURE__ */ m(
|
|
874
|
-
|
|
874
|
+
T,
|
|
875
875
|
{
|
|
876
876
|
direction: "column",
|
|
877
877
|
gap: "12px",
|
|
@@ -886,10 +886,10 @@ const Po = E.div`
|
|
|
886
886
|
}
|
|
887
887
|
) })
|
|
888
888
|
] });
|
|
889
|
-
},
|
|
889
|
+
}, Zo = (e) => Array.isArray(e) ? e[0] : e ?? null, Jo = (e) => {
|
|
890
890
|
var t;
|
|
891
|
-
return ((t =
|
|
892
|
-
},
|
|
891
|
+
return ((t = Zo(e == null ? void 0 : e.conditionGroups)) == null ? void 0 : t.conditionsThatEstablishesTheDecision) ?? [];
|
|
892
|
+
}, Ko = (e) => {
|
|
893
893
|
const { decision: t, loading: n = !1, textValues: o } = e, r = !!(t != null && t.effectiveFrom), i = !!(t != null && t.validUntil), s = r && i ? {
|
|
894
894
|
element: {
|
|
895
895
|
labelName: o == null ? void 0 : o.terms,
|
|
@@ -924,9 +924,9 @@ const Po = E.div`
|
|
|
924
924
|
decisionDataType: t.decisionDataType || "alphabetical",
|
|
925
925
|
value: ze(t),
|
|
926
926
|
howToSetTheDecision: t.howToSetTheDecision || "EqualTo"
|
|
927
|
-
} : null, l =
|
|
927
|
+
} : null, l = Jo(t).filter((h) => !(h != null && h.hidden)), u = Array.from({ length: 5 }), p = !!(!n && t && o && d), c = l.length < 2 ? "start" : "space-between";
|
|
928
928
|
return /* @__PURE__ */ a(
|
|
929
|
-
|
|
929
|
+
Qo,
|
|
930
930
|
{
|
|
931
931
|
conditionsAlignment: c,
|
|
932
932
|
decision: t,
|
|
@@ -939,7 +939,7 @@ const Po = E.div`
|
|
|
939
939
|
visibleConditions: l
|
|
940
940
|
}
|
|
941
941
|
);
|
|
942
|
-
},
|
|
942
|
+
}, er = E.div`
|
|
943
943
|
border-radius: 8px;
|
|
944
944
|
border: 1px solid
|
|
945
945
|
${({ theme: e }) => {
|
|
@@ -974,13 +974,13 @@ E.div`
|
|
|
974
974
|
border-radius: 8px;
|
|
975
975
|
}
|
|
976
976
|
`;
|
|
977
|
-
const
|
|
977
|
+
const tr = (e) => {
|
|
978
978
|
const { children: t, controls: n = !0, handleDelete: o, id: r } = e;
|
|
979
|
-
return /* @__PURE__ */ a(
|
|
979
|
+
return /* @__PURE__ */ a(er, { children: /* @__PURE__ */ m(T, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
980
980
|
t,
|
|
981
981
|
n && /* @__PURE__ */ m(V, { children: [
|
|
982
982
|
/* @__PURE__ */ a(Y, {}),
|
|
983
|
-
/* @__PURE__ */ a(
|
|
983
|
+
/* @__PURE__ */ a(T, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ a(
|
|
984
984
|
G,
|
|
985
985
|
{
|
|
986
986
|
cursorHover: !0,
|
|
@@ -994,19 +994,19 @@ const er = (e) => {
|
|
|
994
994
|
) })
|
|
995
995
|
] })
|
|
996
996
|
] }) });
|
|
997
|
-
},
|
|
997
|
+
}, nr = (e) => {
|
|
998
998
|
const { decision: t, controls: n, handleOpenModal: o, handleDelete: r, textValues: i } = e;
|
|
999
|
-
return t ? /* @__PURE__ */ a(Qe, { children: /* @__PURE__ */ m(
|
|
999
|
+
return t ? /* @__PURE__ */ a(Qe, { children: /* @__PURE__ */ m(T, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
|
|
1000
1000
|
/* @__PURE__ */ a($, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.decisionId }),
|
|
1001
1001
|
/* @__PURE__ */ a(
|
|
1002
|
-
|
|
1002
|
+
tr,
|
|
1003
1003
|
{
|
|
1004
1004
|
id: t.decisionId,
|
|
1005
1005
|
handleDelete: () => r ? r(t.decisionId) : null,
|
|
1006
1006
|
handleView: () => o ? o(t) : null,
|
|
1007
1007
|
controls: n,
|
|
1008
1008
|
children: /* @__PURE__ */ a(
|
|
1009
|
-
|
|
1009
|
+
Ko,
|
|
1010
1010
|
{
|
|
1011
1011
|
decision: t,
|
|
1012
1012
|
textValues: i
|
|
@@ -1015,14 +1015,14 @@ const er = (e) => {
|
|
|
1015
1015
|
}
|
|
1016
1016
|
)
|
|
1017
1017
|
] }) }, t.decisionId) : null;
|
|
1018
|
-
},
|
|
1018
|
+
}, or = (e) => {
|
|
1019
1019
|
const {
|
|
1020
1020
|
customTitleContentAddCard: t,
|
|
1021
1021
|
index: n,
|
|
1022
1022
|
handleOpenModal: o,
|
|
1023
1023
|
shouldRenderEmptyMessage: r
|
|
1024
1024
|
} = e, i = t || "Agregar decisión";
|
|
1025
|
-
return /* @__PURE__ */ a(Qe, { children: r ? null : /* @__PURE__ */ m(
|
|
1025
|
+
return /* @__PURE__ */ a(Qe, { children: r ? null : /* @__PURE__ */ m(T, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
|
|
1026
1026
|
/* @__PURE__ */ a($, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
|
|
1027
1027
|
/* @__PURE__ */ a(
|
|
1028
1028
|
In,
|
|
@@ -1036,7 +1036,7 @@ const er = (e) => {
|
|
|
1036
1036
|
},
|
|
1037
1037
|
handleView: () => o ? o() : null,
|
|
1038
1038
|
controls: !1,
|
|
1039
|
-
children: /* @__PURE__ */ m(
|
|
1039
|
+
children: /* @__PURE__ */ m(T, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
1040
1040
|
/* @__PURE__ */ a(G, { appearance: "gray", icon: /* @__PURE__ */ a(We, {}), size: "35px" }),
|
|
1041
1041
|
/* @__PURE__ */ a($, { appearance: "gray", type: "body", size: "large", children: i })
|
|
1042
1042
|
] })
|
|
@@ -1045,21 +1045,21 @@ const er = (e) => {
|
|
|
1045
1045
|
}
|
|
1046
1046
|
)
|
|
1047
1047
|
] }) }, `add-decision-${n}`);
|
|
1048
|
-
},
|
|
1049
|
-
loading:
|
|
1050
|
-
decision:
|
|
1051
|
-
add:
|
|
1048
|
+
}, rr = {
|
|
1049
|
+
loading: Uo,
|
|
1050
|
+
decision: nr,
|
|
1051
|
+
add: or
|
|
1052
1052
|
}, _t = (e) => {
|
|
1053
|
-
const { type: t } = e, n =
|
|
1053
|
+
const { type: t } = e, n = rr[t];
|
|
1054
1054
|
return n ? n(e) : null;
|
|
1055
|
-
},
|
|
1055
|
+
}, ir = (e) => ({
|
|
1056
1056
|
schema: ge().required("Requerido").test(
|
|
1057
1057
|
"non-empty",
|
|
1058
1058
|
"El valor no puede estar vacío",
|
|
1059
1059
|
(t) => t != null && t.trim() !== ""
|
|
1060
1060
|
),
|
|
1061
1061
|
value: e
|
|
1062
|
-
}),
|
|
1062
|
+
}), ar = (e) => ({
|
|
1063
1063
|
schema: ve().test(
|
|
1064
1064
|
"isArrayOrString",
|
|
1065
1065
|
"Debe ser un array de strings/numbers o un solo string",
|
|
@@ -1068,7 +1068,7 @@ const er = (e) => {
|
|
|
1068
1068
|
) : typeof t == "string"
|
|
1069
1069
|
),
|
|
1070
1070
|
value: e
|
|
1071
|
-
}),
|
|
1071
|
+
}), lr = (e) => ({
|
|
1072
1072
|
schema: ve().test(
|
|
1073
1073
|
"isArrayOrString",
|
|
1074
1074
|
"Debe ser un array de strings/numbers o un solo string ",
|
|
@@ -1077,7 +1077,7 @@ const er = (e) => {
|
|
|
1077
1077
|
) : typeof t == "string"
|
|
1078
1078
|
),
|
|
1079
1079
|
value: e
|
|
1080
|
-
}),
|
|
1080
|
+
}), sr = (e) => {
|
|
1081
1081
|
const t = (e == null ? void 0 : e.from) ?? 0, n = (e == null ? void 0 : e.to) ?? 0;
|
|
1082
1082
|
return {
|
|
1083
1083
|
schema: J({
|
|
@@ -1099,16 +1099,16 @@ const er = (e) => {
|
|
|
1099
1099
|
} : {
|
|
1100
1100
|
schema: ge().required("Requerido"),
|
|
1101
1101
|
value: e
|
|
1102
|
-
},
|
|
1103
|
-
[k.LIST_OF_VALUES]:
|
|
1104
|
-
[k.LIST_OF_VALUES_MULTI]:
|
|
1105
|
-
[k.RANGE]:
|
|
1102
|
+
}, dr = {
|
|
1103
|
+
[k.LIST_OF_VALUES]: ar,
|
|
1104
|
+
[k.LIST_OF_VALUES_MULTI]: lr,
|
|
1105
|
+
[k.RANGE]: sr,
|
|
1106
1106
|
[k.GREATER_THAN]: It,
|
|
1107
1107
|
[k.LESS_THAN]: It,
|
|
1108
1108
|
[k.EQUAL]: It
|
|
1109
|
-
},
|
|
1109
|
+
}, cr = (e) => dr[e] || ir;
|
|
1110
1110
|
var Kt = /* @__PURE__ */ ((e) => (e.EQUAL = "EqualTo", e.GREATER_THAN = "GreaterThan", e.LESS_THAN = "LessThan", e.LIST_OF_VALUES = "ListOfValues", e.LIST_OF_VALUES_MULTI = "ListOfValuesMulti", e.RANGE = "Range", e))(Kt || {});
|
|
1111
|
-
const ct = (e) => e != null && (typeof e != "string" || e.trim() !== "") && (!Array.isArray(e) || e.length > 0),
|
|
1111
|
+
const ct = (e) => e != null && (typeof e != "string" || e.trim() !== "") && (!Array.isArray(e) || e.length > 0), ur = (e, t) => {
|
|
1112
1112
|
var d;
|
|
1113
1113
|
const n = Object.entries((e == null ? void 0 : e.conditionsThatEstablishesTheDecision) ?? {}).filter(([, l]) => ct(l)).map(([l, u]) => ({ conditionName: l, value: u }));
|
|
1114
1114
|
let o = [];
|
|
@@ -1127,7 +1127,7 @@ const ct = (e) => e != null && (typeof e != "string" || e.trim() !== "") && (!Ar
|
|
|
1127
1127
|
};
|
|
1128
1128
|
});
|
|
1129
1129
|
};
|
|
1130
|
-
function
|
|
1130
|
+
function pr({
|
|
1131
1131
|
decision: e,
|
|
1132
1132
|
onSubmitEvent: t,
|
|
1133
1133
|
textValues: n
|
|
@@ -1152,7 +1152,7 @@ function ur({
|
|
|
1152
1152
|
let d;
|
|
1153
1153
|
const l = {
|
|
1154
1154
|
ruleName: ge().required("El nombre de la regla es requerido"),
|
|
1155
|
-
value: Ge(() =>
|
|
1155
|
+
value: Ge(() => cr(
|
|
1156
1156
|
d.values.howToSetTheDecision
|
|
1157
1157
|
)(
|
|
1158
1158
|
d.values.value,
|
|
@@ -1162,12 +1162,12 @@ function ur({
|
|
|
1162
1162
|
};
|
|
1163
1163
|
n.terms && (l.effectiveFrom = Ie().required("La fecha de inicio es requerida"), l.validUntil = Ie().when(
|
|
1164
1164
|
"checkClosed",
|
|
1165
|
-
(g, f, { parent:
|
|
1165
|
+
(g, f, { parent: x }) => (x == null ? void 0 : x.checkClosed) ? f.required("La fecha de finalización es requerida").test(
|
|
1166
1166
|
"is-after-startDate",
|
|
1167
1167
|
"La fecha de finalización debe ser mayor o igual a la fecha de inicio",
|
|
1168
|
-
function(
|
|
1169
|
-
const
|
|
1170
|
-
return !
|
|
1168
|
+
function(v) {
|
|
1169
|
+
const w = this.parent.effectiveFrom;
|
|
1170
|
+
return !w || !v ? !0 : new Date(v) >= new Date(w);
|
|
1171
1171
|
}
|
|
1172
1172
|
) : f.notRequired()
|
|
1173
1173
|
));
|
|
@@ -1177,8 +1177,8 @@ function ur({
|
|
|
1177
1177
|
validationSchema: u,
|
|
1178
1178
|
validateOnBlur: !0,
|
|
1179
1179
|
onSubmit: (g) => {
|
|
1180
|
-
var
|
|
1181
|
-
const f = ((
|
|
1180
|
+
var v;
|
|
1181
|
+
const f = ((v = e.conditionGroups) == null ? void 0 : v.ConditionGroupId) ?? "group-primary", x = g.toggleNone ? [] : ur(g, o), y = {
|
|
1182
1182
|
...e,
|
|
1183
1183
|
ruleName: g.ruleName,
|
|
1184
1184
|
decisionDataType: g.decisionDataType,
|
|
@@ -1188,10 +1188,10 @@ function ur({
|
|
|
1188
1188
|
validUntil: g.validUntil,
|
|
1189
1189
|
conditionGroups: {
|
|
1190
1190
|
ConditionGroupId: f,
|
|
1191
|
-
conditionsThatEstablishesTheDecision:
|
|
1191
|
+
conditionsThatEstablishesTheDecision: x
|
|
1192
1192
|
}
|
|
1193
1193
|
};
|
|
1194
|
-
t(
|
|
1194
|
+
t(y);
|
|
1195
1195
|
}
|
|
1196
1196
|
}), { formik: d, handleToggleNoneChange: (g) => {
|
|
1197
1197
|
d.setFieldValue("toggleNone", g), o.forEach((f) => {
|
|
@@ -1201,16 +1201,16 @@ function ur({
|
|
|
1201
1201
|
void 0
|
|
1202
1202
|
);
|
|
1203
1203
|
else if (d.values.conditionsThatEstablishesTheDecision[f.conditionName] === void 0) {
|
|
1204
|
-
const
|
|
1204
|
+
const y = f.howToSetTheCondition === Kt.LIST_OF_VALUES_MULTI ? [] : "";
|
|
1205
1205
|
d.setFieldValue(
|
|
1206
1206
|
`conditionsThatEstablishesTheDecision.${f.conditionName}`,
|
|
1207
|
-
|
|
1207
|
+
y
|
|
1208
1208
|
);
|
|
1209
1209
|
}
|
|
1210
1210
|
});
|
|
1211
1211
|
} };
|
|
1212
1212
|
}
|
|
1213
|
-
const
|
|
1213
|
+
const hr = E.div`
|
|
1214
1214
|
& > div {
|
|
1215
1215
|
border-radius: 8px;
|
|
1216
1216
|
border: 1px solid
|
|
@@ -1219,7 +1219,7 @@ const pr = E.div`
|
|
|
1219
1219
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || I.palette.neutral.N30;
|
|
1220
1220
|
}};
|
|
1221
1221
|
}
|
|
1222
|
-
`,
|
|
1222
|
+
`, gr = E.div`
|
|
1223
1223
|
width: 100%;
|
|
1224
1224
|
height: 100%;
|
|
1225
1225
|
overflow-y: auto;
|
|
@@ -1236,7 +1236,7 @@ const pr = E.div`
|
|
|
1236
1236
|
background-color: #ebecf0;
|
|
1237
1237
|
border-radius: 8px;
|
|
1238
1238
|
}
|
|
1239
|
-
`,
|
|
1239
|
+
`, fr = (e) => {
|
|
1240
1240
|
const {
|
|
1241
1241
|
checked: t,
|
|
1242
1242
|
children: n,
|
|
@@ -1247,7 +1247,7 @@ const pr = E.div`
|
|
|
1247
1247
|
valueToggle: d = ""
|
|
1248
1248
|
} = e, [l, u] = B(t);
|
|
1249
1249
|
return /* @__PURE__ */ m(V, { children: [
|
|
1250
|
-
/* @__PURE__ */ a(
|
|
1250
|
+
/* @__PURE__ */ a(T, { children: /* @__PURE__ */ a(
|
|
1251
1251
|
bt,
|
|
1252
1252
|
{
|
|
1253
1253
|
checked: l,
|
|
@@ -1263,7 +1263,7 @@ const pr = E.div`
|
|
|
1263
1263
|
) }),
|
|
1264
1264
|
l && /* @__PURE__ */ a(V, { children: n })
|
|
1265
1265
|
] });
|
|
1266
|
-
},
|
|
1266
|
+
}, mr = (e) => {
|
|
1267
1267
|
const {
|
|
1268
1268
|
onHandleStartChange: t,
|
|
1269
1269
|
onHandleEndChange: n,
|
|
@@ -1278,15 +1278,15 @@ const pr = E.div`
|
|
|
1278
1278
|
messageEnd: c = "",
|
|
1279
1279
|
statusStart: h = "pending",
|
|
1280
1280
|
statusEnd: g = "pending"
|
|
1281
|
-
} = e, [f,
|
|
1282
|
-
|
|
1283
|
-
},
|
|
1284
|
-
|
|
1281
|
+
} = e, [f, x] = B(s), [y, v] = B(l), [w, S] = B(u), N = ({ target: F }) => {
|
|
1282
|
+
x(F.checked), o && o(F.checked);
|
|
1283
|
+
}, C = (F) => {
|
|
1284
|
+
v(F.target.value), t(F);
|
|
1285
1285
|
}, A = (F) => {
|
|
1286
|
-
|
|
1286
|
+
S(F.target.value), n(F);
|
|
1287
1287
|
}, R = ue("(max-width: 400px)");
|
|
1288
1288
|
return /* @__PURE__ */ m(V, { children: [
|
|
1289
|
-
/* @__PURE__ */ m(
|
|
1289
|
+
/* @__PURE__ */ m(T, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
1290
1290
|
/* @__PURE__ */ a(
|
|
1291
1291
|
$,
|
|
1292
1292
|
{
|
|
@@ -1299,7 +1299,7 @@ const pr = E.div`
|
|
|
1299
1299
|
}
|
|
1300
1300
|
),
|
|
1301
1301
|
/* @__PURE__ */ a(
|
|
1302
|
-
|
|
1302
|
+
T,
|
|
1303
1303
|
{
|
|
1304
1304
|
alignContent: "center",
|
|
1305
1305
|
justifyContent: "center",
|
|
@@ -1318,7 +1318,7 @@ const pr = E.div`
|
|
|
1318
1318
|
)
|
|
1319
1319
|
] }),
|
|
1320
1320
|
/* @__PURE__ */ m(
|
|
1321
|
-
|
|
1321
|
+
T,
|
|
1322
1322
|
{
|
|
1323
1323
|
direction: R ? "column" : "row",
|
|
1324
1324
|
justifyContent: "space-between",
|
|
@@ -1329,8 +1329,8 @@ const pr = E.div`
|
|
|
1329
1329
|
{
|
|
1330
1330
|
id: "dateStart",
|
|
1331
1331
|
label: r,
|
|
1332
|
-
onChange:
|
|
1333
|
-
value:
|
|
1332
|
+
onChange: C,
|
|
1333
|
+
value: y,
|
|
1334
1334
|
required: d,
|
|
1335
1335
|
size: "compact",
|
|
1336
1336
|
status: h,
|
|
@@ -1343,7 +1343,7 @@ const pr = E.div`
|
|
|
1343
1343
|
id: "dateEnd",
|
|
1344
1344
|
label: i,
|
|
1345
1345
|
onChange: A,
|
|
1346
|
-
value:
|
|
1346
|
+
value: w,
|
|
1347
1347
|
required: d,
|
|
1348
1348
|
size: "compact",
|
|
1349
1349
|
status: g,
|
|
@@ -1354,7 +1354,7 @@ const pr = E.div`
|
|
|
1354
1354
|
}
|
|
1355
1355
|
)
|
|
1356
1356
|
] });
|
|
1357
|
-
},
|
|
1357
|
+
}, br = (e) => {
|
|
1358
1358
|
const {
|
|
1359
1359
|
formik: t,
|
|
1360
1360
|
textValues: n,
|
|
@@ -1367,15 +1367,15 @@ const pr = E.div`
|
|
|
1367
1367
|
termStartStatus: u,
|
|
1368
1368
|
termEndStatus: p
|
|
1369
1369
|
} = e;
|
|
1370
|
-
return /* @__PURE__ */ a("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ m(
|
|
1370
|
+
return /* @__PURE__ */ a("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ m(T, { direction: "column", gap: "24px", children: [
|
|
1371
1371
|
pt({
|
|
1372
1372
|
condition: i,
|
|
1373
1373
|
formik: t,
|
|
1374
1374
|
isDecision: !0
|
|
1375
1375
|
}),
|
|
1376
1376
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
1377
|
-
/* @__PURE__ */ a(
|
|
1378
|
-
|
|
1377
|
+
/* @__PURE__ */ a(hr, { children: /* @__PURE__ */ a(gr, { children: /* @__PURE__ */ m(
|
|
1378
|
+
T,
|
|
1379
1379
|
{
|
|
1380
1380
|
direction: "column",
|
|
1381
1381
|
padding: "6px 12px",
|
|
@@ -1383,7 +1383,7 @@ const pr = E.div`
|
|
|
1383
1383
|
height: "272px",
|
|
1384
1384
|
children: [
|
|
1385
1385
|
/* @__PURE__ */ m(
|
|
1386
|
-
|
|
1386
|
+
T,
|
|
1387
1387
|
{
|
|
1388
1388
|
justifyContent: "space-between",
|
|
1389
1389
|
alignItems: "center",
|
|
@@ -1403,10 +1403,10 @@ const pr = E.div`
|
|
|
1403
1403
|
]
|
|
1404
1404
|
}
|
|
1405
1405
|
),
|
|
1406
|
-
/* @__PURE__ */ a(
|
|
1406
|
+
/* @__PURE__ */ a(T, { direction: "column", gap: "20px", children: r == null ? void 0 : r.map((c) => {
|
|
1407
1407
|
var h;
|
|
1408
1408
|
return /* @__PURE__ */ a(
|
|
1409
|
-
|
|
1409
|
+
fr,
|
|
1410
1410
|
{
|
|
1411
1411
|
id: `toggle-${c.conditionName}`,
|
|
1412
1412
|
name: `toggle.${c.conditionName}`,
|
|
@@ -1427,7 +1427,7 @@ const pr = E.div`
|
|
|
1427
1427
|
n.terms && /* @__PURE__ */ m(V, { children: [
|
|
1428
1428
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
1429
1429
|
/* @__PURE__ */ a(
|
|
1430
|
-
|
|
1430
|
+
mr,
|
|
1431
1431
|
{
|
|
1432
1432
|
labelStart: n.termStart,
|
|
1433
1433
|
labelEnd: n.termEnd,
|
|
@@ -1448,14 +1448,14 @@ const pr = E.div`
|
|
|
1448
1448
|
] }),
|
|
1449
1449
|
/* @__PURE__ */ a(Y, {}),
|
|
1450
1450
|
l && /* @__PURE__ */ a($, { type: "label", size: "medium", appearance: "danger", children: typeof t.errors.conditionsThatEstablishesTheDecision == "string" ? t.errors.conditionsThatEstablishesTheDecision : "Existen errores en el formulario, por favor revísalos." }),
|
|
1451
|
-
/* @__PURE__ */ m(
|
|
1451
|
+
/* @__PURE__ */ m(T, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
1452
1452
|
/* @__PURE__ */ a(Q, { appearance: "gray", onClick: o, children: n.cancel }),
|
|
1453
1453
|
/* @__PURE__ */ a(Q, { type: "submit", children: n.confirm })
|
|
1454
1454
|
] })
|
|
1455
1455
|
] }) });
|
|
1456
|
-
},
|
|
1456
|
+
}, vr = (e) => {
|
|
1457
1457
|
var g, f;
|
|
1458
|
-
const { decision: t, onSubmitEvent: n, textValues: o, onCancel: r } = e, { formik: i, handleToggleNoneChange: s } =
|
|
1458
|
+
const { decision: t, onSubmitEvent: n, textValues: o, onCancel: r } = e, { formik: i, handleToggleNoneChange: s } = pr({
|
|
1459
1459
|
decision: t,
|
|
1460
1460
|
onSubmitEvent: n,
|
|
1461
1461
|
textValues: o
|
|
@@ -1466,10 +1466,10 @@ const pr = E.div`
|
|
|
1466
1466
|
decisionDataType: t.decisionDataType,
|
|
1467
1467
|
listOfPossibleValues: t.listOfPossibleValues
|
|
1468
1468
|
}, l = ((f = (g = t.conditionGroups[0]) == null ? void 0 : g.conditionsThatEstablishesTheDecision) == null ? void 0 : f.filter(
|
|
1469
|
-
(
|
|
1469
|
+
(x) => !x.hidden
|
|
1470
1470
|
)) || [], u = !!i.errors.conditionsThatEstablishesTheDecision && i.submitCount > 0, p = i.touched.effectiveFrom ? i.errors.effectiveFrom ? "invalid" : "valid" : void 0, c = i.touched.validUntil ? i.errors.validUntil ? "invalid" : "valid" : void 0;
|
|
1471
1471
|
return /* @__PURE__ */ a(
|
|
1472
|
-
|
|
1472
|
+
br,
|
|
1473
1473
|
{
|
|
1474
1474
|
formik: i,
|
|
1475
1475
|
onCancel: r,
|
|
@@ -1478,21 +1478,21 @@ const pr = E.div`
|
|
|
1478
1478
|
visibleConditions: l,
|
|
1479
1479
|
normalizedDecision: d,
|
|
1480
1480
|
handleToggleNoneChange: s,
|
|
1481
|
-
handleConditionToggleChange: (
|
|
1482
|
-
if (!
|
|
1481
|
+
handleConditionToggleChange: (x, y) => (v) => {
|
|
1482
|
+
if (!v)
|
|
1483
1483
|
i.setFieldValue(
|
|
1484
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1484
|
+
`conditionsThatEstablishesTheDecision.${x}`,
|
|
1485
1485
|
void 0
|
|
1486
1486
|
), i.setFieldTouched(
|
|
1487
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1487
|
+
`conditionsThatEstablishesTheDecision.${x}`,
|
|
1488
1488
|
!1,
|
|
1489
1489
|
!1
|
|
1490
|
-
), Object.keys(i.touched).filter((
|
|
1490
|
+
), Object.keys(i.touched).filter((S) => S.startsWith("conditionsThatEstablishesTheDecision.")).some((S) => i.touched[S] === !0) || s(!0);
|
|
1491
1491
|
else {
|
|
1492
|
-
const
|
|
1492
|
+
const w = y ? [] : "";
|
|
1493
1493
|
s(!1), i.setFieldValue(
|
|
1494
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1495
|
-
|
|
1494
|
+
`conditionsThatEstablishesTheDecision.${x}`,
|
|
1495
|
+
w
|
|
1496
1496
|
);
|
|
1497
1497
|
}
|
|
1498
1498
|
},
|
|
@@ -1501,7 +1501,7 @@ const pr = E.div`
|
|
|
1501
1501
|
termEndStatus: c
|
|
1502
1502
|
}
|
|
1503
1503
|
);
|
|
1504
|
-
},
|
|
1504
|
+
}, yr = (e) => {
|
|
1505
1505
|
const {
|
|
1506
1506
|
controls: t,
|
|
1507
1507
|
customTitleContentAddCard: n,
|
|
@@ -1534,7 +1534,7 @@ const pr = E.div`
|
|
|
1534
1534
|
})
|
|
1535
1535
|
), u = ((o == null ? void 0 : o.length) === 0 || o.length < Math.floor(window.innerWidth / 300)) && !r && t;
|
|
1536
1536
|
return { renderedCards: l, shouldRenderAddCard: u };
|
|
1537
|
-
},
|
|
1537
|
+
}, Cl = (e) => {
|
|
1538
1538
|
const {
|
|
1539
1539
|
controls: t = !0,
|
|
1540
1540
|
customTitleContentAddCard: n,
|
|
@@ -1550,7 +1550,7 @@ const pr = E.div`
|
|
|
1550
1550
|
handleSubmitForm: h,
|
|
1551
1551
|
handleDelete: g,
|
|
1552
1552
|
terms: f = !0
|
|
1553
|
-
} = e,
|
|
1553
|
+
} = e, x = ue("(max-width: 681px)"), y = ue("(max-width: 400px)"), { renderedCards: v, shouldRenderAddCard: w } = yr({
|
|
1554
1554
|
controls: t,
|
|
1555
1555
|
customTitleContentAddCard: n,
|
|
1556
1556
|
decisions: r,
|
|
@@ -1558,15 +1558,15 @@ const pr = E.div`
|
|
|
1558
1558
|
handleOpenModal: p,
|
|
1559
1559
|
handleDelete: g,
|
|
1560
1560
|
textValues: i
|
|
1561
|
-
}),
|
|
1561
|
+
}), S = (r == null ? void 0 : r.length) === 0 && !u;
|
|
1562
1562
|
return /* @__PURE__ */ m(V, { children: [
|
|
1563
|
-
/* @__PURE__ */ a(
|
|
1564
|
-
|
|
1563
|
+
/* @__PURE__ */ a(Vo, { children: /* @__PURE__ */ a(jo, { children: /* @__PURE__ */ a(T, { direction: "column", gap: "16px", padding: "6px", children: S ? /* @__PURE__ */ m(
|
|
1564
|
+
T,
|
|
1565
1565
|
{
|
|
1566
1566
|
direction: "column",
|
|
1567
1567
|
gap: "28px",
|
|
1568
1568
|
width: "100%",
|
|
1569
|
-
height:
|
|
1569
|
+
height: x ? "auto" : "435px",
|
|
1570
1570
|
justifyContent: "center",
|
|
1571
1571
|
alignItems: "center",
|
|
1572
1572
|
children: [
|
|
@@ -1602,7 +1602,7 @@ const pr = E.div`
|
|
|
1602
1602
|
) : /* @__PURE__ */ m(
|
|
1603
1603
|
Ye,
|
|
1604
1604
|
{
|
|
1605
|
-
templateColumns:
|
|
1605
|
+
templateColumns: y ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
|
|
1606
1606
|
autoFlow: "row dense",
|
|
1607
1607
|
gap: "24px",
|
|
1608
1608
|
alignItems: "start",
|
|
@@ -1610,10 +1610,10 @@ const pr = E.div`
|
|
|
1610
1610
|
autoRows: "1fr",
|
|
1611
1611
|
justifyItems: "center",
|
|
1612
1612
|
padding: "6px",
|
|
1613
|
-
height:
|
|
1613
|
+
height: x ? "auto" : "484px",
|
|
1614
1614
|
children: [
|
|
1615
|
-
|
|
1616
|
-
|
|
1615
|
+
v,
|
|
1616
|
+
w && _t({
|
|
1617
1617
|
type: "add",
|
|
1618
1618
|
index: r == null ? void 0 : r.length,
|
|
1619
1619
|
controls: t,
|
|
@@ -1623,20 +1623,20 @@ const pr = E.div`
|
|
|
1623
1623
|
handleOpenModal: p,
|
|
1624
1624
|
handleDelete: g,
|
|
1625
1625
|
textValues: i,
|
|
1626
|
-
shouldRenderEmptyMessage:
|
|
1626
|
+
shouldRenderEmptyMessage: S,
|
|
1627
1627
|
terms: f
|
|
1628
1628
|
})
|
|
1629
1629
|
]
|
|
1630
1630
|
}
|
|
1631
1631
|
) }) }) }),
|
|
1632
1632
|
d && /* @__PURE__ */ a(
|
|
1633
|
-
|
|
1633
|
+
_o,
|
|
1634
1634
|
{
|
|
1635
1635
|
portalId: "modal-portal",
|
|
1636
1636
|
onCloseModal: c,
|
|
1637
1637
|
title: l ? "Editar Decisión" : "Nueva decisión",
|
|
1638
1638
|
children: /* @__PURE__ */ a(
|
|
1639
|
-
|
|
1639
|
+
vr,
|
|
1640
1640
|
{
|
|
1641
1641
|
decision: l || s,
|
|
1642
1642
|
onSubmitEvent: h,
|
|
@@ -1651,16 +1651,16 @@ const pr = E.div`
|
|
|
1651
1651
|
}, Fn = (e) => {
|
|
1652
1652
|
const { children: t } = e;
|
|
1653
1653
|
return /* @__PURE__ */ a(ro, { width: "100%", children: t });
|
|
1654
|
-
},
|
|
1654
|
+
}, Tr = (e) => e.value, xr = (e) => e.value, Dr = (e) => e.value, wr = (e) => ({
|
|
1655
1655
|
from: e.from ?? "",
|
|
1656
1656
|
to: e.to ?? ""
|
|
1657
|
-
}),
|
|
1658
|
-
[k.LIST_OF_VALUES]:
|
|
1659
|
-
[k.LIST_OF_VALUES_MULTI]:
|
|
1660
|
-
[k.RANGE]:
|
|
1661
|
-
[k.GREATER_THAN]:
|
|
1657
|
+
}), Cr = (e) => e.value, Sr = (e) => e.value, Er = (e) => e.value, Nr = {
|
|
1658
|
+
[k.LIST_OF_VALUES]: xr,
|
|
1659
|
+
[k.LIST_OF_VALUES_MULTI]: Dr,
|
|
1660
|
+
[k.RANGE]: wr,
|
|
1661
|
+
[k.GREATER_THAN]: Cr,
|
|
1662
1662
|
[k.LESS_THAN]: Sr,
|
|
1663
|
-
[k.EQUAL]:
|
|
1663
|
+
[k.EQUAL]: Er
|
|
1664
1664
|
}, He = (e) => {
|
|
1665
1665
|
const t = e == null ? void 0 : e.value;
|
|
1666
1666
|
if (typeof t == "string" && t.includes(" a ")) {
|
|
@@ -1678,8 +1678,8 @@ const pr = E.div`
|
|
|
1678
1678
|
}
|
|
1679
1679
|
return t;
|
|
1680
1680
|
}
|
|
1681
|
-
return typeof t == "object" && t !== null && !Array.isArray(t) ? "from" in t && "to" in t ? t : (
|
|
1682
|
-
},
|
|
1681
|
+
return typeof t == "object" && t !== null && !Array.isArray(t) ? "from" in t && "to" in t ? t : (Nr[e == null ? void 0 : e.howToSetTheDecision] || Tr)(t) : t || void 0;
|
|
1682
|
+
}, kr = E.div`
|
|
1683
1683
|
display: flex;
|
|
1684
1684
|
justify-content: ${({ $justifyContent: e }) => e};
|
|
1685
1685
|
align-items: ${({ $alignItems: e }) => e};
|
|
@@ -1702,7 +1702,7 @@ const pr = E.div`
|
|
|
1702
1702
|
border-radius: ${({ $borderRadius: e }) => e};
|
|
1703
1703
|
box-sizing: ${({ $boxSizing: e }) => e};
|
|
1704
1704
|
overflow-y: ${({ $scroll: e }) => e ? "scroll" : "none"};
|
|
1705
|
-
`, ce =
|
|
1705
|
+
`, ce = _.forwardRef(
|
|
1706
1706
|
(e, t) => {
|
|
1707
1707
|
const {
|
|
1708
1708
|
children: n,
|
|
@@ -1718,12 +1718,12 @@ const pr = E.div`
|
|
|
1718
1718
|
borderRadius: h,
|
|
1719
1719
|
border: g,
|
|
1720
1720
|
margin: f = "0px",
|
|
1721
|
-
padding:
|
|
1722
|
-
boxSizing:
|
|
1723
|
-
scroll:
|
|
1721
|
+
padding: x = "0px",
|
|
1722
|
+
boxSizing: y,
|
|
1723
|
+
scroll: v = !1
|
|
1724
1724
|
} = e;
|
|
1725
1725
|
return /* @__PURE__ */ a(
|
|
1726
|
-
|
|
1726
|
+
kr,
|
|
1727
1727
|
{
|
|
1728
1728
|
ref: t,
|
|
1729
1729
|
direction: r,
|
|
@@ -1737,10 +1737,10 @@ const pr = E.div`
|
|
|
1737
1737
|
$background: c,
|
|
1738
1738
|
$border: g,
|
|
1739
1739
|
$margin: f,
|
|
1740
|
-
$padding:
|
|
1740
|
+
$padding: x,
|
|
1741
1741
|
$borderRadius: h,
|
|
1742
|
-
$boxSizing:
|
|
1743
|
-
$scroll:
|
|
1742
|
+
$boxSizing: y,
|
|
1743
|
+
$scroll: v,
|
|
1744
1744
|
children: n
|
|
1745
1745
|
}
|
|
1746
1746
|
);
|
|
@@ -1776,20 +1776,20 @@ E.div`
|
|
|
1776
1776
|
border-radius: 8px;
|
|
1777
1777
|
}
|
|
1778
1778
|
`;
|
|
1779
|
-
const
|
|
1779
|
+
const Ar = E.div`
|
|
1780
1780
|
cursor: pointer;
|
|
1781
|
-
`,
|
|
1781
|
+
`, Ir = E.div`
|
|
1782
1782
|
& > div > div > div > p {
|
|
1783
1783
|
text-wrap-mode: nowrap;
|
|
1784
1784
|
}
|
|
1785
|
-
`,
|
|
1785
|
+
`, Fr = E.div`
|
|
1786
1786
|
& > div {
|
|
1787
1787
|
justify-content: auto;
|
|
1788
1788
|
gap: 8px;
|
|
1789
1789
|
}
|
|
1790
1790
|
`;
|
|
1791
1791
|
var re = /* @__PURE__ */ ((e) => (e.EQUAL = "EqualTo", e.GREATER_THAN = "GreaterThan", e.LESS_THAN = "LessThan", e.LIST_OF_VALUES = "ListOfValues", e.LIST_OF_VALUES_MULTI = "ListOfValuesMulti", e.RANGE = "Range", e))(re || {});
|
|
1792
|
-
const
|
|
1792
|
+
const $r = (e) => {
|
|
1793
1793
|
const {
|
|
1794
1794
|
controls: t,
|
|
1795
1795
|
conditionsAlignment: n,
|
|
@@ -1805,22 +1805,22 @@ const Fr = (e) => {
|
|
|
1805
1805
|
effectiveFromRenderer: h,
|
|
1806
1806
|
validUntilRenderer: g,
|
|
1807
1807
|
onEdit: f,
|
|
1808
|
-
onDelete:
|
|
1809
|
-
tabs:
|
|
1810
|
-
selectedTab:
|
|
1811
|
-
onTabChange:
|
|
1812
|
-
currentConditions:
|
|
1808
|
+
onDelete: x,
|
|
1809
|
+
tabs: y,
|
|
1810
|
+
selectedTab: v,
|
|
1811
|
+
onTabChange: w,
|
|
1812
|
+
currentConditions: S,
|
|
1813
1813
|
hasMultipleGroups: N
|
|
1814
1814
|
} = e;
|
|
1815
|
-
return i ? /* @__PURE__ */ m(
|
|
1816
|
-
/* @__PURE__ */ a(
|
|
1817
|
-
|
|
1815
|
+
return i ? /* @__PURE__ */ m(T, { direction: "column", gap: "16px", children: [
|
|
1816
|
+
/* @__PURE__ */ a(Ar, { onClick: u, children: /* @__PURE__ */ m(
|
|
1817
|
+
T,
|
|
1818
1818
|
{
|
|
1819
1819
|
alignItems: "start",
|
|
1820
1820
|
justifyContent: "space-between",
|
|
1821
1821
|
children: [
|
|
1822
|
-
/* @__PURE__ */ m(
|
|
1823
|
-
/* @__PURE__ */ a(
|
|
1822
|
+
/* @__PURE__ */ m(T, { gap: "12px", children: [
|
|
1823
|
+
/* @__PURE__ */ a(Ir, { children: /* @__PURE__ */ a(
|
|
1824
1824
|
Pe,
|
|
1825
1825
|
{
|
|
1826
1826
|
id: "tag",
|
|
@@ -1829,7 +1829,7 @@ const Fr = (e) => {
|
|
|
1829
1829
|
displayIcon: !1
|
|
1830
1830
|
}
|
|
1831
1831
|
) }),
|
|
1832
|
-
/* @__PURE__ */ a(
|
|
1832
|
+
/* @__PURE__ */ a(Fr, { children: /* @__PURE__ */ a(
|
|
1833
1833
|
it,
|
|
1834
1834
|
{
|
|
1835
1835
|
element: r,
|
|
@@ -1840,7 +1840,7 @@ const Fr = (e) => {
|
|
|
1840
1840
|
}
|
|
1841
1841
|
) })
|
|
1842
1842
|
] }),
|
|
1843
|
-
/* @__PURE__ */ m(
|
|
1843
|
+
/* @__PURE__ */ m(T, { gap: "12px", children: [
|
|
1844
1844
|
t && /* @__PURE__ */ m(V, { children: [
|
|
1845
1845
|
/* @__PURE__ */ a(
|
|
1846
1846
|
G,
|
|
@@ -1849,8 +1849,8 @@ const Fr = (e) => {
|
|
|
1849
1849
|
icon: /* @__PURE__ */ a(Yn, {}),
|
|
1850
1850
|
size: "24px",
|
|
1851
1851
|
cursorHover: !0,
|
|
1852
|
-
onClick: (
|
|
1853
|
-
|
|
1852
|
+
onClick: (C) => {
|
|
1853
|
+
C.stopPropagation(), f == null || f();
|
|
1854
1854
|
}
|
|
1855
1855
|
}
|
|
1856
1856
|
),
|
|
@@ -1861,8 +1861,8 @@ const Fr = (e) => {
|
|
|
1861
1861
|
icon: /* @__PURE__ */ a(mt, {}),
|
|
1862
1862
|
size: "24px",
|
|
1863
1863
|
cursorHover: !0,
|
|
1864
|
-
onClick: (
|
|
1865
|
-
|
|
1864
|
+
onClick: (C) => {
|
|
1865
|
+
C.stopPropagation(), x == null || x();
|
|
1866
1866
|
}
|
|
1867
1867
|
}
|
|
1868
1868
|
)
|
|
@@ -1886,9 +1886,9 @@ const Fr = (e) => {
|
|
|
1886
1886
|
N ? /* @__PURE__ */ a(
|
|
1887
1887
|
Nn,
|
|
1888
1888
|
{
|
|
1889
|
-
tabs:
|
|
1890
|
-
selectedTab:
|
|
1891
|
-
onChange:
|
|
1889
|
+
tabs: y,
|
|
1890
|
+
selectedTab: v,
|
|
1891
|
+
onChange: w
|
|
1892
1892
|
}
|
|
1893
1893
|
) : /* @__PURE__ */ a(
|
|
1894
1894
|
$,
|
|
@@ -1902,14 +1902,14 @@ const Fr = (e) => {
|
|
|
1902
1902
|
children: s.factsThatConditionIt
|
|
1903
1903
|
}
|
|
1904
1904
|
),
|
|
1905
|
-
/* @__PURE__ */ a(
|
|
1906
|
-
|
|
1905
|
+
/* @__PURE__ */ a(T, { direction: "column", gap: "20px", children: /* @__PURE__ */ m(
|
|
1906
|
+
T,
|
|
1907
1907
|
{
|
|
1908
1908
|
direction: "column",
|
|
1909
1909
|
gap: "8px",
|
|
1910
1910
|
justifyContent: n,
|
|
1911
1911
|
children: [
|
|
1912
|
-
|
|
1912
|
+
S.map((C) => /* @__PURE__ */ a(
|
|
1913
1913
|
ce,
|
|
1914
1914
|
{
|
|
1915
1915
|
direction: "column",
|
|
@@ -1920,17 +1920,17 @@ const Fr = (e) => {
|
|
|
1920
1920
|
it,
|
|
1921
1921
|
{
|
|
1922
1922
|
element: {
|
|
1923
|
-
...
|
|
1924
|
-
value:
|
|
1925
|
-
howToSetTheCondition:
|
|
1923
|
+
...C,
|
|
1924
|
+
value: C.value,
|
|
1925
|
+
howToSetTheCondition: C.howToSetTheCondition === re.LIST_OF_VALUES ? re.LIST_OF_VALUES_MULTI : C.howToSetTheCondition
|
|
1926
1926
|
},
|
|
1927
1927
|
valueData: He(
|
|
1928
|
-
|
|
1928
|
+
C
|
|
1929
1929
|
)
|
|
1930
1930
|
}
|
|
1931
1931
|
)
|
|
1932
1932
|
},
|
|
1933
|
-
|
|
1933
|
+
C.conditionName
|
|
1934
1934
|
)),
|
|
1935
1935
|
p && h && /* @__PURE__ */ a(
|
|
1936
1936
|
ce,
|
|
@@ -1970,12 +1970,12 @@ const Fr = (e) => {
|
|
|
1970
1970
|
}
|
|
1971
1971
|
) })
|
|
1972
1972
|
] })
|
|
1973
|
-
] }) : /* @__PURE__ */ m(
|
|
1974
|
-
/* @__PURE__ */ m(
|
|
1973
|
+
] }) : /* @__PURE__ */ m(T, { justifyContent: "space-between", children: [
|
|
1974
|
+
/* @__PURE__ */ m(T, { alignItems: "center", gap: "8px", children: [
|
|
1975
1975
|
/* @__PURE__ */ a(ie, { animated: !0, width: "150px" }),
|
|
1976
1976
|
/* @__PURE__ */ a(ie, { animated: !0, width: "70px" })
|
|
1977
1977
|
] }),
|
|
1978
|
-
/* @__PURE__ */ m(
|
|
1978
|
+
/* @__PURE__ */ m(T, { alignItems: "center", gap: "8px", children: [
|
|
1979
1979
|
/* @__PURE__ */ a(ie, { animated: !0, width: "50px" }),
|
|
1980
1980
|
/* @__PURE__ */ a(io, { animated: !0 })
|
|
1981
1981
|
] })
|
|
@@ -2009,14 +2009,14 @@ const Fr = (e) => {
|
|
|
2009
2009
|
) : {};
|
|
2010
2010
|
}, $n = (e, t) => Object.fromEntries(
|
|
2011
2011
|
Object.entries(e).map(([n, o]) => [n, o.filter(t)])
|
|
2012
|
-
),
|
|
2012
|
+
), Rr = {
|
|
2013
2013
|
Year: { label: "en años", labelView: "años" },
|
|
2014
2014
|
Month: { label: "en meses", labelView: "meses" },
|
|
2015
2015
|
Day: { label: "en días", labelView: "días" }
|
|
2016
2016
|
}, Pt = (e, t, n = !1) => {
|
|
2017
|
-
const o =
|
|
2017
|
+
const o = Rr[t ?? ""];
|
|
2018
2018
|
return o ? n ? `${e} ${o.labelView}` : `${e} ${o.label}` : e;
|
|
2019
|
-
},
|
|
2019
|
+
}, Lr = (e, t) => {
|
|
2020
2020
|
if (e == null) return "";
|
|
2021
2021
|
const n = Array.isArray(e) ? e.join(", ") : typeof e == "object" && e !== null ? JSON.stringify(e) : String(e ?? "");
|
|
2022
2022
|
switch (t) {
|
|
@@ -2069,7 +2069,7 @@ const Fr = (e) => {
|
|
|
2069
2069
|
return n !== void 0 || o !== void 0 ? Vt(n) || Vt(o) : !0;
|
|
2070
2070
|
}
|
|
2071
2071
|
return !1;
|
|
2072
|
-
},
|
|
2072
|
+
}, Or = (e) => Vt(e == null ? void 0 : e.value), ht = (e, t) => e === "group-primary" ? "Condición principal" : `Condición alterna N° ${String(t).padStart(2, "0")}`, Mr = (e) => {
|
|
2073
2073
|
var i, s;
|
|
2074
2074
|
const t = ((i = e.listOfPossibleValues) == null ? void 0 : i.list) ?? [], n = e.value, o = Array.isArray(n) ? n : [n];
|
|
2075
2075
|
return { list: ((s = t.filter((d) => o.includes(d.value)).map((d, l) => ({
|
|
@@ -2116,52 +2116,52 @@ const Fr = (e) => {
|
|
|
2116
2116
|
howToSetTheDecision: j.EQUAL,
|
|
2117
2117
|
decisionDataType: H.DATE
|
|
2118
2118
|
})
|
|
2119
|
-
} : null,
|
|
2119
|
+
} : null, x = (n == null ? void 0 : n.howToSetTheDecision) || j.EQUAL, y = n && (x === j.LIST_OF_VALUES || x === j.LIST_OF_VALUES_MULTI) ? Mr(n).list : He(n), v = n ? {
|
|
2120
2120
|
labelName: t && n.labelName || "",
|
|
2121
2121
|
decisionDataType: n.decisionDataType || H.ALPHABETICAL,
|
|
2122
|
-
value:
|
|
2123
|
-
howToSetTheDecision:
|
|
2122
|
+
value: y,
|
|
2123
|
+
howToSetTheDecision: x,
|
|
2124
2124
|
validUntil: n.validUntil
|
|
2125
|
-
} : null,
|
|
2125
|
+
} : null, w = _.useMemo(
|
|
2126
2126
|
() => n ? Te(n) : {},
|
|
2127
2127
|
[n]
|
|
2128
|
-
),
|
|
2129
|
-
const O = {}, q =
|
|
2128
|
+
), S = ((Nt = (Et = n == null ? void 0 : n.conditionGroups) == null ? void 0 : Et.map((O) => O == null ? void 0 : O.ConditionGroupId)) == null ? void 0 : Nt.filter(Boolean)) || Object.keys(w), N = S[0] || "group-primary", C = _.useMemo(() => {
|
|
2129
|
+
const O = {}, q = w[N] || [], te = w["group-primary"] || [];
|
|
2130
2130
|
O["group-primary"] = N === "group-primary" ? te : [...q, ...te];
|
|
2131
|
-
for (const
|
|
2132
|
-
!
|
|
2133
|
-
for (const
|
|
2134
|
-
|
|
2131
|
+
for (const D of S)
|
|
2132
|
+
!D || D === N || D !== "group-primary" && w[D] && (O[D] = w[D]);
|
|
2133
|
+
for (const D of Object.keys(w))
|
|
2134
|
+
D === "group-primary" || D === N || D in O || (O[D] = w[D]);
|
|
2135
2135
|
return O;
|
|
2136
|
-
}, [
|
|
2136
|
+
}, [w, N, S]), A = _.useMemo(() => {
|
|
2137
2137
|
const O = {};
|
|
2138
|
-
return Object.keys(
|
|
2139
|
-
const te =
|
|
2140
|
-
te && Array.isArray(te) ? O[q] = te.map((
|
|
2141
|
-
let L =
|
|
2142
|
-
|
|
2143
|
-
let
|
|
2144
|
-
return (
|
|
2145
|
-
|
|
2146
|
-
|
|
2138
|
+
return Object.keys(C).forEach((q) => {
|
|
2139
|
+
const te = C[q];
|
|
2140
|
+
te && Array.isArray(te) ? O[q] = te.map((D) => {
|
|
2141
|
+
let L = D.labelName;
|
|
2142
|
+
D.timeUnit && D.labelName && (L = Pt(D.labelName, D.timeUnit));
|
|
2143
|
+
let P = D.value;
|
|
2144
|
+
return (D == null ? void 0 : D.howToSetTheCondition) !== void 0 && (D == null ? void 0 : D.howToSetTheCondition) !== null && (D == null ? void 0 : D.value) !== void 0 && (D == null ? void 0 : D.value) !== null && (D == null ? void 0 : D.value) !== "" && (P = Lr(
|
|
2145
|
+
D.value,
|
|
2146
|
+
D.howToSetTheCondition
|
|
2147
2147
|
)), {
|
|
2148
|
-
...
|
|
2148
|
+
...D,
|
|
2149
2149
|
labelName: L,
|
|
2150
|
-
value:
|
|
2150
|
+
value: P
|
|
2151
2151
|
};
|
|
2152
2152
|
}) : O[q] = te;
|
|
2153
2153
|
}), O;
|
|
2154
|
-
}, [
|
|
2154
|
+
}, [C]), R = $n(
|
|
2155
2155
|
A,
|
|
2156
2156
|
(O) => !O.hidden
|
|
2157
|
-
), F =
|
|
2157
|
+
), F = _.useMemo(() => {
|
|
2158
2158
|
const O = Object.entries(R).map(
|
|
2159
|
-
([te,
|
|
2159
|
+
([te, D]) => [te, D.filter(Or)]
|
|
2160
2160
|
), q = {};
|
|
2161
|
-
for (const [te,
|
|
2162
|
-
|
|
2161
|
+
for (const [te, D] of O)
|
|
2162
|
+
D.length > 0 && (q[te] = D);
|
|
2163
2163
|
return q;
|
|
2164
|
-
}, [R]), le =
|
|
2164
|
+
}, [R]), le = _.useMemo(() => {
|
|
2165
2165
|
const O = Object.keys(F);
|
|
2166
2166
|
return O.includes("group-primary") ? ["group-primary", ...O.filter((q) => q !== "group-primary")] : O;
|
|
2167
2167
|
}, [F]), se = {};
|
|
@@ -2173,18 +2173,18 @@ const Fr = (e) => {
|
|
|
2173
2173
|
label: O === "group-primary" ? ht(O, 0) : ht(O, Number(q.split("-").at(-1))),
|
|
2174
2174
|
isDisabled: !1
|
|
2175
2175
|
};
|
|
2176
|
-
}), [Je, Dt] =
|
|
2176
|
+
}), [Je, Dt] = _.useState(
|
|
2177
2177
|
((kt = Ze[0]) == null ? void 0 : kt.id) ?? "mainCondition"
|
|
2178
|
-
), Ke = (O) => Dt(O), wt = se[Je] ?? le[0] ?? "group-primary", et = F[wt] ?? [], tt = le.length > 1,
|
|
2178
|
+
), Ke = (O) => Dt(O), wt = se[Je] ?? le[0] ?? "group-primary", et = F[wt] ?? [], tt = le.length > 1, Ct = Array.from({ length: 5 }), nt = !!(!o && n && r && v), St = et.length < 2 ? "start" : "space-between", Le = `N° ${String((i ?? 0) + 1).padStart(2, "0")}`;
|
|
2179
2179
|
return /* @__PURE__ */ a(
|
|
2180
|
-
|
|
2180
|
+
$r,
|
|
2181
2181
|
{
|
|
2182
|
-
conditionsAlignment:
|
|
2182
|
+
conditionsAlignment: St,
|
|
2183
2183
|
controls: p,
|
|
2184
2184
|
decision: n,
|
|
2185
|
-
decisionMapper:
|
|
2185
|
+
decisionMapper: v,
|
|
2186
2186
|
loading: nt,
|
|
2187
|
-
skeleton:
|
|
2187
|
+
skeleton: Ct,
|
|
2188
2188
|
textValues: r,
|
|
2189
2189
|
tagLabel: Le,
|
|
2190
2190
|
isOpen: s,
|
|
@@ -2202,7 +2202,7 @@ const Fr = (e) => {
|
|
|
2202
2202
|
hasMultipleGroups: tt
|
|
2203
2203
|
}
|
|
2204
2204
|
);
|
|
2205
|
-
},
|
|
2205
|
+
}, _r = Xt`
|
|
2206
2206
|
from {
|
|
2207
2207
|
opacity: 0;
|
|
2208
2208
|
transform: translateY(20px);
|
|
@@ -2236,7 +2236,7 @@ E.div`
|
|
|
2236
2236
|
}};
|
|
2237
2237
|
}
|
|
2238
2238
|
`;
|
|
2239
|
-
const
|
|
2239
|
+
const Pr = E.div`
|
|
2240
2240
|
& > div {
|
|
2241
2241
|
box-shadow: 0px 2px 3px 0px
|
|
2242
2242
|
${({ theme: e }) => {
|
|
@@ -2245,18 +2245,18 @@ const _r = E.div`
|
|
|
2245
2245
|
}};
|
|
2246
2246
|
cursor: pointer;
|
|
2247
2247
|
}
|
|
2248
|
-
`,
|
|
2248
|
+
`, Vr = E.div`
|
|
2249
2249
|
width: 100%;
|
|
2250
2250
|
height: 100%;
|
|
2251
2251
|
& > div {
|
|
2252
|
-
animation: ${
|
|
2252
|
+
animation: ${_r} 600ms ease-out;
|
|
2253
2253
|
}
|
|
2254
|
-
`,
|
|
2254
|
+
`, jr = E.div`
|
|
2255
2255
|
& > div > div {
|
|
2256
2256
|
border-radius: 8px;
|
|
2257
2257
|
box-sizing: border-box;
|
|
2258
2258
|
}
|
|
2259
|
-
`,
|
|
2259
|
+
`, Ur = E.div`
|
|
2260
2260
|
& > div {
|
|
2261
2261
|
width: 100%;
|
|
2262
2262
|
height: 100%;
|
|
@@ -2276,7 +2276,7 @@ const _r = E.div`
|
|
|
2276
2276
|
border-radius: 8px;
|
|
2277
2277
|
}
|
|
2278
2278
|
}
|
|
2279
|
-
`,
|
|
2279
|
+
`, zr = (e) => {
|
|
2280
2280
|
const { index: t, handleOpenModal: n } = e;
|
|
2281
2281
|
return /* @__PURE__ */ a(
|
|
2282
2282
|
Fn,
|
|
@@ -2290,7 +2290,7 @@ const _r = E.div`
|
|
|
2290
2290
|
},
|
|
2291
2291
|
`loading-card-${t}`
|
|
2292
2292
|
);
|
|
2293
|
-
},
|
|
2293
|
+
}, Hr = (e) => {
|
|
2294
2294
|
const {
|
|
2295
2295
|
cardTitle: t,
|
|
2296
2296
|
decision: n,
|
|
@@ -2302,7 +2302,7 @@ const _r = E.div`
|
|
|
2302
2302
|
isOpen: l,
|
|
2303
2303
|
onToggle: u
|
|
2304
2304
|
} = e;
|
|
2305
|
-
return n ? /* @__PURE__ */ a(Qe, { children: /* @__PURE__ */ a(
|
|
2305
|
+
return n ? /* @__PURE__ */ a(Qe, { children: /* @__PURE__ */ a(T, { direction: "column", gap: "4px", width: "100%", children: /* @__PURE__ */ a(
|
|
2306
2306
|
Fn,
|
|
2307
2307
|
{
|
|
2308
2308
|
id: n.decisionId,
|
|
@@ -2324,15 +2324,15 @@ const _r = E.div`
|
|
|
2324
2324
|
)
|
|
2325
2325
|
}
|
|
2326
2326
|
) }) }, n.decisionId) : null;
|
|
2327
|
-
},
|
|
2327
|
+
}, Gr = (e) => {
|
|
2328
2328
|
const {
|
|
2329
2329
|
customTitleContentAddCard: t,
|
|
2330
2330
|
index: n,
|
|
2331
2331
|
handleOpenModal: o,
|
|
2332
2332
|
shouldRenderEmptyMessage: r
|
|
2333
2333
|
} = e;
|
|
2334
|
-
return /* @__PURE__ */ a(
|
|
2335
|
-
|
|
2334
|
+
return /* @__PURE__ */ a(Vr, { children: r ? null : /* @__PURE__ */ a(
|
|
2335
|
+
Pr,
|
|
2336
2336
|
{
|
|
2337
2337
|
onClick: () => o ? o() : null,
|
|
2338
2338
|
children: /* @__PURE__ */ a(
|
|
@@ -2345,7 +2345,7 @@ const _r = E.div`
|
|
|
2345
2345
|
background: !0,
|
|
2346
2346
|
borderRadius: "8px",
|
|
2347
2347
|
children: /* @__PURE__ */ m(
|
|
2348
|
-
|
|
2348
|
+
T,
|
|
2349
2349
|
{
|
|
2350
2350
|
justifyContent: "space-between",
|
|
2351
2351
|
alignItems: "center",
|
|
@@ -2368,14 +2368,14 @@ const _r = E.div`
|
|
|
2368
2368
|
)
|
|
2369
2369
|
}
|
|
2370
2370
|
) }, `add-decision-${n}`);
|
|
2371
|
-
},
|
|
2372
|
-
loading:
|
|
2373
|
-
decision:
|
|
2374
|
-
add:
|
|
2371
|
+
}, Br = {
|
|
2372
|
+
loading: zr,
|
|
2373
|
+
decision: Hr,
|
|
2374
|
+
add: Gr
|
|
2375
2375
|
}, jt = (e) => {
|
|
2376
|
-
const { type: t } = e, n =
|
|
2376
|
+
const { type: t } = e, n = Br[t];
|
|
2377
2377
|
return n ? n(e) : null;
|
|
2378
|
-
},
|
|
2378
|
+
}, qr = (e) => {
|
|
2379
2379
|
const {
|
|
2380
2380
|
cardTitle: t,
|
|
2381
2381
|
controls: n,
|
|
@@ -2415,13 +2415,13 @@ const _r = E.div`
|
|
|
2415
2415
|
})
|
|
2416
2416
|
), h = ((r == null ? void 0 : r.length) === 0 || r.length < Math.floor(window.innerWidth / 300)) && !i && n;
|
|
2417
2417
|
return { renderedCards: c, shouldRenderAddCard: h };
|
|
2418
|
-
},
|
|
2418
|
+
}, Wr = E.div`
|
|
2419
2419
|
position: relative;
|
|
2420
2420
|
& > div {
|
|
2421
2421
|
padding: 24px 16px;
|
|
2422
2422
|
place-items: unset;
|
|
2423
2423
|
}
|
|
2424
|
-
`,
|
|
2424
|
+
`, Yr = E.div`
|
|
2425
2425
|
background-color: ${({ theme: e }) => {
|
|
2426
2426
|
var t, n;
|
|
2427
2427
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || I.palette.neutral.N0;
|
|
@@ -2453,7 +2453,7 @@ const _r = E.div`
|
|
|
2453
2453
|
background-color: #ebecf0;
|
|
2454
2454
|
border-radius: 8px;
|
|
2455
2455
|
}
|
|
2456
|
-
`,
|
|
2456
|
+
`, Xr = (e) => {
|
|
2457
2457
|
const { children: t, description: n, portalId: o, onCloseModal: r, title: i } = e, s = document.getElementById(o);
|
|
2458
2458
|
if (!s)
|
|
2459
2459
|
throw new Error(
|
|
@@ -2461,10 +2461,10 @@ const _r = E.div`
|
|
|
2461
2461
|
);
|
|
2462
2462
|
const d = ue("(max-width: 400px)");
|
|
2463
2463
|
return Qt(
|
|
2464
|
-
/* @__PURE__ */ a(
|
|
2465
|
-
/* @__PURE__ */ m(
|
|
2466
|
-
/* @__PURE__ */ m(
|
|
2467
|
-
/* @__PURE__ */ m(
|
|
2464
|
+
/* @__PURE__ */ a(Wr, { smallScreen: d, children: /* @__PURE__ */ a(Wt, { children: /* @__PURE__ */ a(Yr, { children: /* @__PURE__ */ m(T, { direction: "column", gap: "24px", children: [
|
|
2465
|
+
/* @__PURE__ */ m(T, { direction: "column", gap: "24px", children: [
|
|
2466
|
+
/* @__PURE__ */ m(T, { alignItems: "center", justifyContent: "space-between", children: [
|
|
2467
|
+
/* @__PURE__ */ m(T, { direction: "column", gap: "8px", children: [
|
|
2468
2468
|
/* @__PURE__ */ a(
|
|
2469
2469
|
$,
|
|
2470
2470
|
{
|
|
@@ -2485,14 +2485,14 @@ const _r = E.div`
|
|
|
2485
2485
|
] }) }) }) }),
|
|
2486
2486
|
s
|
|
2487
2487
|
);
|
|
2488
|
-
},
|
|
2488
|
+
}, Qr = (e) => ({
|
|
2489
2489
|
schema: ge().required("Requerido").test(
|
|
2490
2490
|
"non-empty",
|
|
2491
2491
|
"El valor no puede estar vacío",
|
|
2492
2492
|
(t) => t != null && t.trim() !== ""
|
|
2493
2493
|
),
|
|
2494
2494
|
value: e
|
|
2495
|
-
}),
|
|
2495
|
+
}), Zr = (e) => ({
|
|
2496
2496
|
schema: ve().test(
|
|
2497
2497
|
"isArrayOrString",
|
|
2498
2498
|
"Por favor selecciona una opcion",
|
|
@@ -2501,7 +2501,7 @@ const _r = E.div`
|
|
|
2501
2501
|
) : typeof t == "string"
|
|
2502
2502
|
),
|
|
2503
2503
|
value: e
|
|
2504
|
-
}),
|
|
2504
|
+
}), Jr = (e) => ({
|
|
2505
2505
|
schema: ve().test(
|
|
2506
2506
|
"isArrayOrString",
|
|
2507
2507
|
"Por favor selecciona al menos una opcion",
|
|
@@ -2510,18 +2510,18 @@ const _r = E.div`
|
|
|
2510
2510
|
) : typeof t == "string"
|
|
2511
2511
|
),
|
|
2512
2512
|
value: e
|
|
2513
|
-
}), lt = "Por favor escribe un valor", dn = "Por favor escribe un valor mayor que 0",
|
|
2513
|
+
}), lt = "Por favor escribe un valor", dn = "Por favor escribe un valor mayor que 0", Kr = "El valor desde no puede ser mayor que el valor hasta", ei = "El valor hasta debe ser mayor que el valor desde", cn = (e, t) => {
|
|
2514
2514
|
if (t !== "")
|
|
2515
2515
|
return e;
|
|
2516
|
-
},
|
|
2516
|
+
}, ti = (e) => {
|
|
2517
2517
|
const t = (e == null ? void 0 : e.from) ?? 0, n = (e == null ? void 0 : e.to) ?? 0;
|
|
2518
2518
|
return {
|
|
2519
2519
|
schema: J({
|
|
2520
|
-
from: pe().transform(cn).typeError(lt).required(lt).moreThan(0, dn).test("from<=to",
|
|
2520
|
+
from: pe().transform(cn).typeError(lt).required(lt).moreThan(0, dn).test("from<=to", Kr, function(o) {
|
|
2521
2521
|
const { to: r } = this.parent;
|
|
2522
2522
|
return o === void 0 || r === void 0 ? !0 : o <= r;
|
|
2523
2523
|
}),
|
|
2524
|
-
to: pe().transform(cn).typeError(lt).required(lt).moreThan(0, dn).test("to>from",
|
|
2524
|
+
to: pe().transform(cn).typeError(lt).required(lt).moreThan(0, dn).test("to>from", ei, function(o) {
|
|
2525
2525
|
const { from: r } = this.parent;
|
|
2526
2526
|
return r === void 0 || o === void 0 ? !0 : o > r;
|
|
2527
2527
|
})
|
|
@@ -2561,14 +2561,14 @@ const _r = E.div`
|
|
|
2561
2561
|
schema: ve().test("required", "Requerido", (n) => n == null ? !1 : typeof n == "string" ? n.trim().length > 0 : typeof n == "number" ? !Number.isNaN(n) : !1),
|
|
2562
2562
|
value: e
|
|
2563
2563
|
};
|
|
2564
|
-
},
|
|
2565
|
-
[k.LIST_OF_VALUES]:
|
|
2566
|
-
[k.LIST_OF_VALUES_MULTI]:
|
|
2567
|
-
[k.RANGE]:
|
|
2564
|
+
}, ni = {
|
|
2565
|
+
[k.LIST_OF_VALUES]: Zr,
|
|
2566
|
+
[k.LIST_OF_VALUES_MULTI]: Jr,
|
|
2567
|
+
[k.RANGE]: ti,
|
|
2568
2568
|
[k.GREATER_THAN]: Ft,
|
|
2569
2569
|
[k.LESS_THAN]: Ft,
|
|
2570
2570
|
[k.EQUAL]: Ft
|
|
2571
|
-
}, pn = (e) =>
|
|
2571
|
+
}, pn = (e) => ni[e] || Qr, hn = (e) => {
|
|
2572
2572
|
var t;
|
|
2573
2573
|
return Array.isArray((t = e == null ? void 0 : e.listOfPossibleValues) == null ? void 0 : t.list) && e.listOfPossibleValues.list.length > 0;
|
|
2574
2574
|
}, Ut = ve().test(
|
|
@@ -2582,14 +2582,14 @@ const _r = E.div`
|
|
|
2582
2582
|
}
|
|
2583
2583
|
return typeof e == "string" ? e.trim().length > 0 : typeof e == "number" ? !Number.isNaN(e) : !1;
|
|
2584
2584
|
}
|
|
2585
|
-
),
|
|
2585
|
+
), oi = J({
|
|
2586
2586
|
from: Ut,
|
|
2587
2587
|
to: Ut
|
|
2588
2588
|
}), zt = (e) => e && typeof e == "object" && "value" in e ? e.value : e, gn = (e) => {
|
|
2589
2589
|
const t = zt(e);
|
|
2590
2590
|
return t == null ? !1 : typeof t == "string" ? t.trim().length > 0 : typeof t == "number" ? !Number.isNaN(t) : Array.isArray(t) ? t.length > 0 : typeof t == "object" ? Object.keys(t).length > 0 : !0;
|
|
2591
2591
|
};
|
|
2592
|
-
function
|
|
2592
|
+
function ri({
|
|
2593
2593
|
decision: e,
|
|
2594
2594
|
onSubmitEvent: t,
|
|
2595
2595
|
textValues: n
|
|
@@ -2599,26 +2599,26 @@ function oi({
|
|
|
2599
2599
|
), i = Object.fromEntries(
|
|
2600
2600
|
Object.entries(o).map(([h, g]) => {
|
|
2601
2601
|
const f = {};
|
|
2602
|
-
return g.forEach((
|
|
2603
|
-
const
|
|
2604
|
-
f[
|
|
2605
|
-
...
|
|
2606
|
-
value:
|
|
2602
|
+
return g.forEach((x) => {
|
|
2603
|
+
const y = x.conditionName, v = x.value !== void 0 && x.value !== null && x.value !== "", w = x.howToSetTheCondition === re.LIST_OF_VALUES_MULTI ? [] : "";
|
|
2604
|
+
f[y] = {
|
|
2605
|
+
...x,
|
|
2606
|
+
value: v ? x.value : w
|
|
2607
2607
|
};
|
|
2608
2608
|
}), [h, f];
|
|
2609
2609
|
})
|
|
2610
2610
|
), s = Object.entries(o).map(
|
|
2611
2611
|
([h, g]) => {
|
|
2612
|
-
const f = i[h] || {},
|
|
2613
|
-
const
|
|
2612
|
+
const f = i[h] || {}, x = g.map((y) => {
|
|
2613
|
+
const v = y.conditionName, w = f[v], S = w && typeof w == "object" && "value" in w ? w.value : y.value;
|
|
2614
2614
|
return {
|
|
2615
|
-
...
|
|
2616
|
-
value:
|
|
2615
|
+
...y,
|
|
2616
|
+
value: S
|
|
2617
2617
|
};
|
|
2618
2618
|
});
|
|
2619
2619
|
return {
|
|
2620
2620
|
ConditionGroupId: h,
|
|
2621
|
-
conditionsThatEstablishesTheDecision:
|
|
2621
|
+
conditionsThatEstablishesTheDecision: x
|
|
2622
2622
|
};
|
|
2623
2623
|
}
|
|
2624
2624
|
), d = {
|
|
@@ -2639,7 +2639,7 @@ function oi({
|
|
|
2639
2639
|
ruleName: ge().required("El nombre de la decision es requerido"),
|
|
2640
2640
|
value: Ge(() => {
|
|
2641
2641
|
const h = l.values.howToSetTheDecision;
|
|
2642
|
-
return h === re.RANGE && hn(e) ?
|
|
2642
|
+
return h === re.RANGE && hn(e) ? oi : hn(e) ? Ut : pn(h)(
|
|
2643
2643
|
l.values.value,
|
|
2644
2644
|
l.values.decisionDataType
|
|
2645
2645
|
).schema;
|
|
@@ -2647,29 +2647,29 @@ function oi({
|
|
|
2647
2647
|
conditionsThatEstablishesTheDecision: Ge((h, { parent: g }) => {
|
|
2648
2648
|
const f = g && g.conditionsThatEstablishesTheDecision && typeof g.conditionsThatEstablishesTheDecision == "object" && Object.keys(g.conditionsThatEstablishesTheDecision).length > 0;
|
|
2649
2649
|
if ((g == null ? void 0 : g.toggleNone) && f) return J().shape({});
|
|
2650
|
-
const
|
|
2651
|
-
for (const [
|
|
2652
|
-
const
|
|
2653
|
-
|
|
2650
|
+
const y = {};
|
|
2651
|
+
for (const [v, w] of Object.entries(o)) {
|
|
2652
|
+
const S = {};
|
|
2653
|
+
w.forEach((N) => {
|
|
2654
2654
|
var R, F;
|
|
2655
|
-
const
|
|
2655
|
+
const C = (F = (R = g == null ? void 0 : g.conditionsThatEstablishesTheDecision) == null ? void 0 : R[v]) == null ? void 0 : F[N.conditionName], A = zt(C);
|
|
2656
2656
|
if (A !== void 0) {
|
|
2657
2657
|
const le = pn(
|
|
2658
2658
|
N.howToSetTheCondition
|
|
2659
2659
|
);
|
|
2660
|
-
|
|
2660
|
+
S[N.conditionName] = le(
|
|
2661
2661
|
A,
|
|
2662
2662
|
N.conditionDataType
|
|
2663
2663
|
).schema;
|
|
2664
2664
|
}
|
|
2665
|
-
}),
|
|
2665
|
+
}), y[v] = J(S);
|
|
2666
2666
|
}
|
|
2667
|
-
return J(
|
|
2667
|
+
return J(y).test(
|
|
2668
2668
|
"at-least-one-condition",
|
|
2669
2669
|
"Debe existir al menos una condición para que la decisión se valide correctamente.",
|
|
2670
|
-
(
|
|
2671
|
-
(
|
|
2672
|
-
(
|
|
2670
|
+
(v) => !v || typeof v != "object" ? !1 : Object.values(v).some(
|
|
2671
|
+
(w) => w && typeof w == "object" && Object.values(w).some(
|
|
2672
|
+
(S) => gn(S)
|
|
2673
2673
|
)
|
|
2674
2674
|
)
|
|
2675
2675
|
);
|
|
@@ -2682,9 +2682,9 @@ function oi({
|
|
|
2682
2682
|
(h, g, { parent: f }) => (f == null ? void 0 : f.checkClosed) ? g.required("Se requiere la fecha de vigencia hasta").test(
|
|
2683
2683
|
"is-after-startDate",
|
|
2684
2684
|
"La fecha válida para la vigencia hasta debe ser mayor o igual a la fecha de inicio",
|
|
2685
|
-
function(
|
|
2686
|
-
const
|
|
2687
|
-
return !
|
|
2685
|
+
function(y) {
|
|
2686
|
+
const v = this.parent.effectiveFrom;
|
|
2687
|
+
return !v || !y ? !0 : new Date(y) >= new Date(v);
|
|
2688
2688
|
}
|
|
2689
2689
|
) : g.notRequired()
|
|
2690
2690
|
));
|
|
@@ -2695,16 +2695,16 @@ function oi({
|
|
|
2695
2695
|
validateOnBlur: !0,
|
|
2696
2696
|
onSubmit: (h) => {
|
|
2697
2697
|
const g = Object.fromEntries(
|
|
2698
|
-
Object.entries(o).map(([
|
|
2699
|
-
var
|
|
2700
|
-
const
|
|
2701
|
-
const
|
|
2698
|
+
Object.entries(o).map(([x, y]) => {
|
|
2699
|
+
var S;
|
|
2700
|
+
const v = ((S = h.conditionsThatEstablishesTheDecision) == null ? void 0 : S[x]) || {}, w = y.map((N) => {
|
|
2701
|
+
const C = N.conditionName, A = v[C], R = zt(A);
|
|
2702
2702
|
return {
|
|
2703
2703
|
...N,
|
|
2704
2704
|
value: R
|
|
2705
2705
|
};
|
|
2706
2706
|
}).filter((N) => gn(N.value));
|
|
2707
|
-
return [
|
|
2707
|
+
return [x, w];
|
|
2708
2708
|
})
|
|
2709
2709
|
), f = {
|
|
2710
2710
|
...e,
|
|
@@ -2720,16 +2720,16 @@ function oi({
|
|
|
2720
2720
|
}
|
|
2721
2721
|
}), { formik: l, handleToggleNoneChange: (h) => {
|
|
2722
2722
|
l.setFieldValue("toggleNone", h), r().forEach(({ group: g, cond: f }) => {
|
|
2723
|
-
const
|
|
2723
|
+
const x = `conditionsThatEstablishesTheDecision.${g}.${f.conditionName}`;
|
|
2724
2724
|
if (h)
|
|
2725
|
-
l.setFieldValue(
|
|
2725
|
+
l.setFieldValue(x, void 0);
|
|
2726
2726
|
else {
|
|
2727
|
-
const
|
|
2727
|
+
const y = f.howToSetTheCondition === re.LIST_OF_VALUES_MULTI ? [] : "";
|
|
2728
2728
|
l.setFieldValue(
|
|
2729
|
-
|
|
2729
|
+
x,
|
|
2730
2730
|
{
|
|
2731
2731
|
...f,
|
|
2732
|
-
value:
|
|
2732
|
+
value: y
|
|
2733
2733
|
},
|
|
2734
2734
|
!1
|
|
2735
2735
|
);
|
|
@@ -2765,7 +2765,7 @@ E.div`
|
|
|
2765
2765
|
border-radius: 8px;
|
|
2766
2766
|
}
|
|
2767
2767
|
`;
|
|
2768
|
-
const
|
|
2768
|
+
const ii = E.div`
|
|
2769
2769
|
display: flex;
|
|
2770
2770
|
width: -webkit-fill-available;
|
|
2771
2771
|
align-items: center;
|
|
@@ -2775,7 +2775,7 @@ const ri = E.div`
|
|
|
2775
2775
|
gap: 16px;
|
|
2776
2776
|
width: -webkit-fill-available;
|
|
2777
2777
|
}
|
|
2778
|
-
`,
|
|
2778
|
+
`, ai = (e) => {
|
|
2779
2779
|
const {
|
|
2780
2780
|
onHandleStartChange: t,
|
|
2781
2781
|
onHandleEndChange: n,
|
|
@@ -2790,15 +2790,15 @@ const ri = E.div`
|
|
|
2790
2790
|
messageEnd: c = "",
|
|
2791
2791
|
statusStart: h = "pending",
|
|
2792
2792
|
statusEnd: g = "pending"
|
|
2793
|
-
} = e, [f,
|
|
2794
|
-
|
|
2795
|
-
},
|
|
2796
|
-
|
|
2793
|
+
} = e, [f, x] = B(s), [y, v] = B(l), [w, S] = B(u), N = ({ target: F }) => {
|
|
2794
|
+
x(F.checked), o && o(F.checked);
|
|
2795
|
+
}, C = (F) => {
|
|
2796
|
+
v(F.target.value), t(F);
|
|
2797
2797
|
}, A = (F) => {
|
|
2798
|
-
|
|
2798
|
+
S(F.target.value), n(F);
|
|
2799
2799
|
}, R = ue("(max-width: 400px)");
|
|
2800
|
-
return /* @__PURE__ */ m(
|
|
2801
|
-
/* @__PURE__ */ m(
|
|
2800
|
+
return /* @__PURE__ */ m(T, { direction: "column", width: "100%", gap: "20px", children: [
|
|
2801
|
+
/* @__PURE__ */ m(T, { justifyContent: "space-between", children: [
|
|
2802
2802
|
/* @__PURE__ */ a($, { appearance: "dark", size: "large", type: "label", children: "¿La vigencia para este decisión es cerrada?" }),
|
|
2803
2803
|
/* @__PURE__ */ a(
|
|
2804
2804
|
Yt,
|
|
@@ -2811,7 +2811,7 @@ const ri = E.div`
|
|
|
2811
2811
|
)
|
|
2812
2812
|
] }),
|
|
2813
2813
|
/* @__PURE__ */ m(
|
|
2814
|
-
|
|
2814
|
+
T,
|
|
2815
2815
|
{
|
|
2816
2816
|
direction: R ? "column" : "row",
|
|
2817
2817
|
justifyContent: "space-between",
|
|
@@ -2822,8 +2822,8 @@ const ri = E.div`
|
|
|
2822
2822
|
{
|
|
2823
2823
|
id: "dateStart",
|
|
2824
2824
|
label: r,
|
|
2825
|
-
onChange:
|
|
2826
|
-
value:
|
|
2825
|
+
onChange: C,
|
|
2826
|
+
value: y,
|
|
2827
2827
|
required: d,
|
|
2828
2828
|
size: "compact",
|
|
2829
2829
|
status: h,
|
|
@@ -2837,7 +2837,7 @@ const ri = E.div`
|
|
|
2837
2837
|
id: "dateEnd",
|
|
2838
2838
|
label: i,
|
|
2839
2839
|
onChange: A,
|
|
2840
|
-
value:
|
|
2840
|
+
value: w,
|
|
2841
2841
|
required: d,
|
|
2842
2842
|
size: "compact",
|
|
2843
2843
|
status: g,
|
|
@@ -2849,7 +2849,7 @@ const ri = E.div`
|
|
|
2849
2849
|
}
|
|
2850
2850
|
)
|
|
2851
2851
|
] });
|
|
2852
|
-
},
|
|
2852
|
+
}, li = (e) => {
|
|
2853
2853
|
const {
|
|
2854
2854
|
activeTab: t,
|
|
2855
2855
|
conditionsErrorText: n,
|
|
@@ -2865,15 +2865,15 @@ const ri = E.div`
|
|
|
2865
2865
|
termStartStatus: h,
|
|
2866
2866
|
textValues: g,
|
|
2867
2867
|
portalId: f,
|
|
2868
|
-
showRedefineConfirm:
|
|
2869
|
-
onOpenRedefineConfirm:
|
|
2870
|
-
onCloseRedefineConfirm:
|
|
2871
|
-
onConfirmRedefine:
|
|
2868
|
+
showRedefineConfirm: x,
|
|
2869
|
+
onOpenRedefineConfirm: y,
|
|
2870
|
+
onCloseRedefineConfirm: v,
|
|
2871
|
+
onConfirmRedefine: w
|
|
2872
2872
|
} = e;
|
|
2873
2873
|
return console.log("Rendering RulesFormUI: ", r), /* @__PURE__ */ m(V, { children: [
|
|
2874
|
-
/* @__PURE__ */ a("form", { onSubmit: r.handleSubmit, children: /* @__PURE__ */ m(
|
|
2874
|
+
/* @__PURE__ */ a("form", { onSubmit: r.handleSubmit, children: /* @__PURE__ */ m(T, { direction: "column", gap: "24px", width: "100%", children: [
|
|
2875
2875
|
/* @__PURE__ */ a(Ve, { legend: "Decisión N° 01", spacing: "wide", children: /* @__PURE__ */ m(
|
|
2876
|
-
|
|
2876
|
+
T,
|
|
2877
2877
|
{
|
|
2878
2878
|
justifyContent: "center",
|
|
2879
2879
|
width: "-webkit-fill-available",
|
|
@@ -2888,7 +2888,7 @@ const ri = E.div`
|
|
|
2888
2888
|
]
|
|
2889
2889
|
}
|
|
2890
2890
|
) }),
|
|
2891
|
-
o && o.length > 0 && /* @__PURE__ */ a(Ve, { legend: "Condiciones a evaluar", spacing: "wide", children: /* @__PURE__ */ m(
|
|
2891
|
+
o && o.length > 0 && /* @__PURE__ */ a(Ve, { legend: "Condiciones a evaluar", spacing: "wide", children: /* @__PURE__ */ m(T, { direction: "column", gap: "20px", width: "100%", children: [
|
|
2892
2892
|
/* @__PURE__ */ a(
|
|
2893
2893
|
Nn,
|
|
2894
2894
|
{
|
|
@@ -2897,13 +2897,13 @@ const ri = E.div`
|
|
|
2897
2897
|
selectedTab: t
|
|
2898
2898
|
}
|
|
2899
2899
|
),
|
|
2900
|
-
/* @__PURE__ */ m(
|
|
2900
|
+
/* @__PURE__ */ m(T, { justifyContent: "flex-end", alignItems: "center", children: [
|
|
2901
2901
|
/* @__PURE__ */ a(
|
|
2902
2902
|
G,
|
|
2903
2903
|
{
|
|
2904
2904
|
icon: /* @__PURE__ */ a(Qn, {}),
|
|
2905
2905
|
appearance: "help",
|
|
2906
|
-
onClick:
|
|
2906
|
+
onClick: y,
|
|
2907
2907
|
cursorHover: !0
|
|
2908
2908
|
}
|
|
2909
2909
|
),
|
|
@@ -2914,24 +2914,24 @@ const ri = E.div`
|
|
|
2914
2914
|
iconBefore: /* @__PURE__ */ a(Zn, {}),
|
|
2915
2915
|
variant: "none",
|
|
2916
2916
|
appearance: "gray",
|
|
2917
|
-
onClick:
|
|
2917
|
+
onClick: y,
|
|
2918
2918
|
cursorHover: !0,
|
|
2919
2919
|
children: "Redefinir la condición"
|
|
2920
2920
|
}
|
|
2921
2921
|
)
|
|
2922
2922
|
] }),
|
|
2923
|
-
/* @__PURE__ */ a(
|
|
2924
|
-
const N =
|
|
2925
|
-
return /* @__PURE__ */ m(
|
|
2926
|
-
/* @__PURE__ */ m(
|
|
2923
|
+
/* @__PURE__ */ a(T, { direction: "column", gap: "20px", children: o == null ? void 0 : o.map((S) => {
|
|
2924
|
+
const N = S.__scopedName ?? `${S.groupKey}.${S.conditionName}`;
|
|
2925
|
+
return /* @__PURE__ */ m(T, { gap: "16px", alignItems: "center", children: [
|
|
2926
|
+
/* @__PURE__ */ m(ii, { children: [
|
|
2927
2927
|
/* @__PURE__ */ a(
|
|
2928
2928
|
nn,
|
|
2929
2929
|
{
|
|
2930
|
-
condition:
|
|
2930
|
+
condition: S,
|
|
2931
2931
|
formik: r
|
|
2932
2932
|
}
|
|
2933
2933
|
),
|
|
2934
|
-
|
|
2934
|
+
S.timeUnit && /* @__PURE__ */ a($, { as: "span", size: "medium", padding: "0 0 0 16px", children: S.__unitAfterInput })
|
|
2935
2935
|
] }),
|
|
2936
2936
|
/* @__PURE__ */ a(
|
|
2937
2937
|
G,
|
|
@@ -2947,7 +2947,7 @@ const ri = E.div`
|
|
|
2947
2947
|
u && /* @__PURE__ */ a($, { type: "label", size: "medium", appearance: "danger", children: n ?? "Existen errores en el formulario, por favor revísalos." })
|
|
2948
2948
|
] }) }),
|
|
2949
2949
|
/* @__PURE__ */ a(Ve, { legend: "Vigencia", spacing: "wide", children: g.terms && /* @__PURE__ */ a(
|
|
2950
|
-
|
|
2950
|
+
ai,
|
|
2951
2951
|
{
|
|
2952
2952
|
labelStart: g.termStart,
|
|
2953
2953
|
labelEnd: g.termEnd,
|
|
@@ -2957,57 +2957,57 @@ const ri = E.div`
|
|
|
2957
2957
|
messageEnd: r.errors.validUntil,
|
|
2958
2958
|
statusStart: h,
|
|
2959
2959
|
statusEnd: c,
|
|
2960
|
-
onHandleStartChange: (
|
|
2961
|
-
onHandleEndChange: (
|
|
2962
|
-
onCheckClosedChange: (
|
|
2963
|
-
r.setFieldValue("checkClosed",
|
|
2960
|
+
onHandleStartChange: (S) => r.setFieldValue("effectiveFrom", S.target.value),
|
|
2961
|
+
onHandleEndChange: (S) => r.setFieldValue("validUntil", S.target.value),
|
|
2962
|
+
onCheckClosedChange: (S) => {
|
|
2963
|
+
r.setFieldValue("checkClosed", S), S && r.setFieldValue("validUntil", "");
|
|
2964
2964
|
},
|
|
2965
2965
|
checkedClosed: r.values.checkClosed
|
|
2966
2966
|
}
|
|
2967
2967
|
) }),
|
|
2968
|
-
/* @__PURE__ */ m(
|
|
2968
|
+
/* @__PURE__ */ m(T, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
2969
2969
|
/* @__PURE__ */ a(Q, { appearance: "gray", onClick: s, variant: "outlined", children: g.cancel }),
|
|
2970
2970
|
/* @__PURE__ */ a(Q, { type: "submit", children: g.confirm })
|
|
2971
2971
|
] })
|
|
2972
2972
|
] }) }),
|
|
2973
|
-
|
|
2973
|
+
x && f && /* @__PURE__ */ a(
|
|
2974
2974
|
An,
|
|
2975
2975
|
{
|
|
2976
2976
|
portalId: f,
|
|
2977
2977
|
title: "Redefinir la condición",
|
|
2978
|
-
onCloseModal:
|
|
2979
|
-
children: /* @__PURE__ */ m(
|
|
2978
|
+
onCloseModal: v,
|
|
2979
|
+
children: /* @__PURE__ */ m(T, { direction: "column", gap: "16px", children: [
|
|
2980
2980
|
/* @__PURE__ */ a($, { type: "body", size: "large", appearance: "gray", children: "¿Estás seguro? Se perderá todo lo que tienes actualmente definido y deberás reescribir completamente la condición, de esta manera podrás usar las últimas variables condicionales que están definidas en la actualidad para esta decisión ." }),
|
|
2981
|
-
/* @__PURE__ */ m(
|
|
2981
|
+
/* @__PURE__ */ m(T, { justifyContent: "end", gap: "12px", children: [
|
|
2982
2982
|
/* @__PURE__ */ a(
|
|
2983
2983
|
Q,
|
|
2984
2984
|
{
|
|
2985
2985
|
type: "button",
|
|
2986
2986
|
appearance: "gray",
|
|
2987
2987
|
variant: "outlined",
|
|
2988
|
-
onClick:
|
|
2988
|
+
onClick: v,
|
|
2989
2989
|
cursorHover: !0,
|
|
2990
2990
|
children: "Cancelar"
|
|
2991
2991
|
}
|
|
2992
2992
|
),
|
|
2993
|
-
/* @__PURE__ */ a(Q, { type: "button", onClick:
|
|
2993
|
+
/* @__PURE__ */ a(Q, { type: "button", onClick: w, cursorHover: !0, children: "Confirmar" })
|
|
2994
2994
|
] })
|
|
2995
2995
|
] })
|
|
2996
2996
|
}
|
|
2997
2997
|
)
|
|
2998
2998
|
] });
|
|
2999
|
-
},
|
|
3000
|
-
const { label: t, howToSet: n, isFirst: o = !1 } = e, r =
|
|
2999
|
+
}, si = (e) => {
|
|
3000
|
+
const { label: t, howToSet: n, isFirst: o = !1 } = e, r = ui(t), i = ci(r), s = o ? "Que" : "Y que", d = i ? r : `${pi(r)} ${r}`, l = mi(n);
|
|
3001
3001
|
return `${s} ${d.toLowerCase()} ${l}`;
|
|
3002
|
-
},
|
|
3003
|
-
function di(e) {
|
|
3004
|
-
return si.test(e);
|
|
3005
|
-
}
|
|
3002
|
+
}, di = /^(el|la|los|las)\s/i;
|
|
3006
3003
|
function ci(e) {
|
|
3007
|
-
return
|
|
3004
|
+
return di.test(e);
|
|
3008
3005
|
}
|
|
3009
3006
|
function ui(e) {
|
|
3010
|
-
|
|
3007
|
+
return e.replace(/\s+/g, " ").trim();
|
|
3008
|
+
}
|
|
3009
|
+
function pi(e) {
|
|
3010
|
+
const t = hi(e).toLowerCase(), n = /\b(s|es)\b/.test(gi(e).toLowerCase()) && !t.endsWith("és");
|
|
3011
3011
|
return ({
|
|
3012
3012
|
mano: "f",
|
|
3013
3013
|
día: "m",
|
|
@@ -3019,21 +3019,21 @@ function ui(e) {
|
|
|
3019
3019
|
antigüedad: "f",
|
|
3020
3020
|
antiguedad: "f",
|
|
3021
3021
|
puntaje: "m"
|
|
3022
|
-
}[t] ??
|
|
3022
|
+
}[t] ?? fi(t)) === "f" ? n ? "las" : "la" : n ? "los" : "el";
|
|
3023
3023
|
}
|
|
3024
|
-
function
|
|
3024
|
+
function hi(e) {
|
|
3025
3025
|
return (e.toLowerCase().split(
|
|
3026
3026
|
/\bdel\b|\bde la\b|\bde los\b|\bde las\b|\bde\b/
|
|
3027
3027
|
)[0].trim().split(/\s+/)[0] ?? "").normalize("NFD").replace(/^[^a-záéíóúüñ]+/i, "");
|
|
3028
3028
|
}
|
|
3029
|
-
function
|
|
3029
|
+
function gi(e) {
|
|
3030
3030
|
const t = e.trim().split(/\s+/);
|
|
3031
3031
|
return t[t.length - 1] || "";
|
|
3032
3032
|
}
|
|
3033
|
-
function
|
|
3033
|
+
function fi(e) {
|
|
3034
3034
|
return /(?:dad|tad|tud|umbre|ción|sión|ie|sis|itis)$/.test(e) || e.endsWith("ez") || e.endsWith("eza") ? "f" : /(?:aje|or|án|ambre)$/.test(e) ? "m" : e.endsWith("a") ? "f" : "m";
|
|
3035
3035
|
}
|
|
3036
|
-
function
|
|
3036
|
+
function mi(e) {
|
|
3037
3037
|
switch (e) {
|
|
3038
3038
|
case k.EQUAL:
|
|
3039
3039
|
return "sea";
|
|
@@ -3075,7 +3075,7 @@ const Oe = (e) => {
|
|
|
3075
3075
|
default:
|
|
3076
3076
|
return "";
|
|
3077
3077
|
}
|
|
3078
|
-
},
|
|
3078
|
+
}, bi = (e, t, n) => {
|
|
3079
3079
|
const o = e == null ? void 0 : e.conditionGroups;
|
|
3080
3080
|
if (!Array.isArray(o)) return;
|
|
3081
3081
|
const r = o.find((s) => (s == null ? void 0 : s.ConditionGroupId) === t);
|
|
@@ -3084,10 +3084,10 @@ const Oe = (e) => {
|
|
|
3084
3084
|
(s) => (s == null ? void 0 : s.conditionName) === n
|
|
3085
3085
|
);
|
|
3086
3086
|
return i == null ? void 0 : i.value;
|
|
3087
|
-
},
|
|
3087
|
+
}, vi = (e, t, n) => {
|
|
3088
3088
|
var o, r;
|
|
3089
3089
|
return (r = (o = e == null ? void 0 : e.conditionsThatEstablishesTheDecision) == null ? void 0 : o[t]) == null ? void 0 : r[n];
|
|
3090
|
-
},
|
|
3090
|
+
}, yi = (e) => {
|
|
3091
3091
|
var q, te;
|
|
3092
3092
|
const {
|
|
3093
3093
|
decision: t,
|
|
@@ -3097,40 +3097,40 @@ const Oe = (e) => {
|
|
|
3097
3097
|
onRemoveCondition: i,
|
|
3098
3098
|
onRestoreConditions: s,
|
|
3099
3099
|
fullTemplate: d
|
|
3100
|
-
} = e, { formik: l, handleToggleNoneChange: u } =
|
|
3100
|
+
} = e, { formik: l, handleToggleNoneChange: u } = ri({
|
|
3101
3101
|
decision: t,
|
|
3102
3102
|
onSubmitEvent: n,
|
|
3103
3103
|
textValues: o
|
|
3104
3104
|
}), p = d ?? t, c = Te(p), h = Te(t), g = $n(
|
|
3105
3105
|
h,
|
|
3106
|
-
(
|
|
3107
|
-
), f = Object.keys(g),
|
|
3108
|
-
...f.filter((
|
|
3109
|
-
...f.filter((
|
|
3110
|
-
],
|
|
3111
|
-
let
|
|
3112
|
-
const
|
|
3113
|
-
const L =
|
|
3114
|
-
return
|
|
3106
|
+
(D) => !D.hidden
|
|
3107
|
+
), f = Object.keys(g), x = [
|
|
3108
|
+
...f.filter((D) => D === "group-primary"),
|
|
3109
|
+
...f.filter((D) => D !== "group-primary")
|
|
3110
|
+
], y = {};
|
|
3111
|
+
let v = 1;
|
|
3112
|
+
const w = x.map((D) => {
|
|
3113
|
+
const L = D === "group-primary" ? "mainCondition" : `alternateCondition-${v++}`;
|
|
3114
|
+
return y[L] = D, {
|
|
3115
3115
|
id: L,
|
|
3116
|
-
label:
|
|
3116
|
+
label: D === "group-primary" ? ht(D, 0) : ht(D, Number(L.split("-").at(-1))),
|
|
3117
3117
|
isDisabled: !1
|
|
3118
3118
|
};
|
|
3119
|
-
}), [
|
|
3120
|
-
((q =
|
|
3121
|
-
),
|
|
3122
|
-
|
|
3119
|
+
}), [S, N] = _.useState(
|
|
3120
|
+
((q = w[0]) == null ? void 0 : q.id) ?? "mainCondition"
|
|
3121
|
+
), C = (D) => N(D), A = y[S] ?? "group-primary";
|
|
3122
|
+
_.useEffect(() => {
|
|
3123
3123
|
var W;
|
|
3124
|
-
const
|
|
3124
|
+
const D = (W = l.values) == null ? void 0 : W.conditionsThatEstablishesTheDecision;
|
|
3125
3125
|
let L = !1;
|
|
3126
|
-
if (
|
|
3126
|
+
if (D && typeof D == "object" && (L = Object.values(D).some(
|
|
3127
3127
|
(X) => X && typeof X == "object" && Object.keys(X).length > 0
|
|
3128
3128
|
)), L) return;
|
|
3129
|
-
const
|
|
3130
|
-
if (!
|
|
3129
|
+
const P = Te(t);
|
|
3130
|
+
if (!P || Object.keys(P).length === 0)
|
|
3131
3131
|
return;
|
|
3132
3132
|
const M = Object.fromEntries(
|
|
3133
|
-
Object.entries(
|
|
3133
|
+
Object.entries(P).map(([X, U]) => {
|
|
3134
3134
|
const me = Object.fromEntries(
|
|
3135
3135
|
U.map((de) => {
|
|
3136
3136
|
const he = Oe(de.howToSetTheCondition), ye = de.value ?? Me(he);
|
|
@@ -3145,11 +3145,11 @@ const Oe = (e) => {
|
|
|
3145
3145
|
M,
|
|
3146
3146
|
!1
|
|
3147
3147
|
);
|
|
3148
|
-
}, [t]),
|
|
3148
|
+
}, [t]), _.useEffect(() => {
|
|
3149
3149
|
var U;
|
|
3150
|
-
const
|
|
3151
|
-
if (!
|
|
3152
|
-
const L = Te(p),
|
|
3150
|
+
const D = (U = l.values) == null ? void 0 : U.conditionsThatEstablishesTheDecision;
|
|
3151
|
+
if (!D || typeof D != "object") return;
|
|
3152
|
+
const L = Te(p), P = Object.entries(D).map(
|
|
3153
3153
|
([me, de]) => {
|
|
3154
3154
|
const he = L[me] || [], ye = Object.keys(de).map((be) => {
|
|
3155
3155
|
const z = de[be], ne = he.find((Wn) => Wn.conditionName === be) || {}, At = Oe(
|
|
@@ -3167,11 +3167,11 @@ const Oe = (e) => {
|
|
|
3167
3167
|
conditionsThatEstablishesTheDecision: ye
|
|
3168
3168
|
};
|
|
3169
3169
|
}
|
|
3170
|
-
), M = l.values.conditionGroups, W = JSON.stringify(
|
|
3171
|
-
W !== X && l.setFieldValue("conditionGroups",
|
|
3170
|
+
), M = l.values.conditionGroups, W = JSON.stringify(P), X = JSON.stringify(M ?? []);
|
|
3171
|
+
W !== X && l.setFieldValue("conditionGroups", P, !1);
|
|
3172
3172
|
}, [(te = l.values) == null ? void 0 : te.conditionsThatEstablishesTheDecision, p]);
|
|
3173
|
-
const R =
|
|
3174
|
-
const
|
|
3173
|
+
const R = _.useMemo(() => {
|
|
3174
|
+
const D = [
|
|
3175
3175
|
...Object.keys(g).filter(
|
|
3176
3176
|
(M) => M === "group-primary"
|
|
3177
3177
|
),
|
|
@@ -3180,19 +3180,19 @@ const Oe = (e) => {
|
|
|
3180
3180
|
)
|
|
3181
3181
|
];
|
|
3182
3182
|
let L = !1;
|
|
3183
|
-
const
|
|
3183
|
+
const P = D.map((M) => {
|
|
3184
3184
|
const X = (g[M] ?? []).map((U, me) => {
|
|
3185
3185
|
const de = !L && M === "group-primary" && me === 0;
|
|
3186
3186
|
de && (L = !0);
|
|
3187
|
-
const he = Oe(U.howToSetTheCondition), ye =
|
|
3187
|
+
const he = Oe(U.howToSetTheCondition), ye = si({
|
|
3188
3188
|
label: U.labelName || "",
|
|
3189
3189
|
howToSet: he,
|
|
3190
3190
|
isFirst: de
|
|
3191
|
-
}), be = U.timeUnit ? Pt("", U.timeUnit, !0).trim() : "", z = `${M}.${U.conditionName}`, ne =
|
|
3191
|
+
}), be = U.timeUnit ? Pt("", U.timeUnit, !0).trim() : "", z = `${M}.${U.conditionName}`, ne = bi(
|
|
3192
3192
|
l.values,
|
|
3193
3193
|
M,
|
|
3194
3194
|
U.conditionName
|
|
3195
|
-
), At =
|
|
3195
|
+
), At = vi(
|
|
3196
3196
|
l.values,
|
|
3197
3197
|
M,
|
|
3198
3198
|
U.conditionName
|
|
@@ -3212,7 +3212,7 @@ const Oe = (e) => {
|
|
|
3212
3212
|
});
|
|
3213
3213
|
return [M, X];
|
|
3214
3214
|
});
|
|
3215
|
-
return Object.fromEntries(
|
|
3215
|
+
return Object.fromEntries(P);
|
|
3216
3216
|
}, [g, l.values]), F = R[A] ?? [], le = R["group-primary"] ?? [], se = {
|
|
3217
3217
|
decisionDataType: t.decisionDataType,
|
|
3218
3218
|
howToSetTheCondition: t.howToSetTheDecision,
|
|
@@ -3220,48 +3220,48 @@ const Oe = (e) => {
|
|
|
3220
3220
|
listOfPossibleValues: t.listOfPossibleValues,
|
|
3221
3221
|
ruleName: t.ruleName,
|
|
3222
3222
|
timeUnit: t.timeUnit ? Pt("", t.timeUnit, !0).trim() : ""
|
|
3223
|
-
}, Re = l.submitCount > 0 || !!l.touched.effectiveFrom, Ze = l.submitCount > 0 || !!l.touched.validUntil, Je = Re ? l.errors.effectiveFrom ? "invalid" : "valid" : void 0, Dt = Ze ? l.errors.validUntil ? "invalid" : "valid" : void 0, Ke =
|
|
3224
|
-
const
|
|
3225
|
-
if (!
|
|
3226
|
-
if (typeof
|
|
3227
|
-
const L = (
|
|
3228
|
-
if (
|
|
3229
|
-
if (typeof
|
|
3230
|
-
if (Array.isArray(
|
|
3231
|
-
for (const M of
|
|
3223
|
+
}, Re = l.submitCount > 0 || !!l.touched.effectiveFrom, Ze = l.submitCount > 0 || !!l.touched.validUntil, Je = Re ? l.errors.effectiveFrom ? "invalid" : "valid" : void 0, Dt = Ze ? l.errors.validUntil ? "invalid" : "valid" : void 0, Ke = _.useMemo(() => {
|
|
3224
|
+
const D = l.errors.conditionsThatEstablishesTheDecision;
|
|
3225
|
+
if (!D) return;
|
|
3226
|
+
if (typeof D == "string") return D;
|
|
3227
|
+
const L = (P) => {
|
|
3228
|
+
if (P) {
|
|
3229
|
+
if (typeof P == "string") return P;
|
|
3230
|
+
if (Array.isArray(P))
|
|
3231
|
+
for (const M of P) {
|
|
3232
3232
|
const W = L(M);
|
|
3233
3233
|
if (W) return W;
|
|
3234
3234
|
}
|
|
3235
|
-
else if (typeof
|
|
3236
|
-
for (const M of Object.values(
|
|
3235
|
+
else if (typeof P == "object")
|
|
3236
|
+
for (const M of Object.values(P)) {
|
|
3237
3237
|
const W = L(M);
|
|
3238
3238
|
if (W) return W;
|
|
3239
3239
|
}
|
|
3240
3240
|
}
|
|
3241
3241
|
};
|
|
3242
|
-
return L(
|
|
3243
|
-
}, [l.errors.conditionsThatEstablishesTheDecision]), wt = l.submitCount > 0 && !!Ke, et = (
|
|
3244
|
-
const L = (
|
|
3242
|
+
return L(D);
|
|
3243
|
+
}, [l.errors.conditionsThatEstablishesTheDecision]), wt = l.submitCount > 0 && !!Ke, et = (D) => {
|
|
3244
|
+
const L = (D == null ? void 0 : D.__howToSet) ?? Oe(D == null ? void 0 : D.howToSetTheCondition);
|
|
3245
3245
|
return Me(L);
|
|
3246
|
-
}, tt = (
|
|
3246
|
+
}, tt = (D, L, P) => {
|
|
3247
3247
|
var U, me, de, he, ye;
|
|
3248
|
-
const M = `conditionsThatEstablishesTheDecision.${
|
|
3249
|
-
W && typeof W == "object" && !Array.isArray(W) ? l.setFieldValue(`${M}.value`,
|
|
3248
|
+
const M = `conditionsThatEstablishesTheDecision.${D}.${L}`, W = (de = (me = (U = l.values) == null ? void 0 : U.conditionsThatEstablishesTheDecision) == null ? void 0 : me[D]) == null ? void 0 : de[L];
|
|
3249
|
+
W && typeof W == "object" && !Array.isArray(W) ? l.setFieldValue(`${M}.value`, P, !1) : l.setFieldValue(M, P, !1);
|
|
3250
3250
|
const X = (he = l.values) == null ? void 0 : he.conditionGroups;
|
|
3251
3251
|
if (Array.isArray(X)) {
|
|
3252
|
-
const be = X.findIndex((z) => (z == null ? void 0 : z.ConditionGroupId) ===
|
|
3252
|
+
const be = X.findIndex((z) => (z == null ? void 0 : z.ConditionGroupId) === D);
|
|
3253
3253
|
if (be >= 0) {
|
|
3254
3254
|
const z = (ye = X[be].conditionsThatEstablishesTheDecision) == null ? void 0 : ye.findIndex(
|
|
3255
3255
|
(ne) => (ne == null ? void 0 : ne.conditionName) === L
|
|
3256
3256
|
);
|
|
3257
3257
|
if (z >= 0) {
|
|
3258
3258
|
const ne = JSON.parse(JSON.stringify(X));
|
|
3259
|
-
ne[be].conditionsThatEstablishesTheDecision[z].value =
|
|
3259
|
+
ne[be].conditionsThatEstablishesTheDecision[z].value = P, l.setFieldValue("conditionGroups", ne, !1);
|
|
3260
3260
|
}
|
|
3261
3261
|
}
|
|
3262
3262
|
}
|
|
3263
|
-
},
|
|
3264
|
-
const [L, ...
|
|
3263
|
+
}, Ct = (D) => {
|
|
3264
|
+
const [L, ...P] = D.split("."), M = P.join("."), W = Object.values(c).flat().find((U) => U.conditionName === M), X = et(W || {});
|
|
3265
3265
|
tt(L, M, X), l.setFieldTouched(
|
|
3266
3266
|
`conditionsThatEstablishesTheDecision.${L}.${M}`,
|
|
3267
3267
|
!1,
|
|
@@ -3269,14 +3269,14 @@ const Oe = (e) => {
|
|
|
3269
3269
|
);
|
|
3270
3270
|
}, nt = () => {
|
|
3271
3271
|
(c[A] ?? []).forEach((L) => {
|
|
3272
|
-
const
|
|
3272
|
+
const P = Oe(L == null ? void 0 : L.howToSetTheCondition), M = Me(P);
|
|
3273
3273
|
tt(A, L.conditionName, M);
|
|
3274
3274
|
});
|
|
3275
|
-
}, [
|
|
3275
|
+
}, [St, Le] = _.useState(!1);
|
|
3276
3276
|
return /* @__PURE__ */ a(
|
|
3277
|
-
|
|
3277
|
+
li,
|
|
3278
3278
|
{
|
|
3279
|
-
activeTab:
|
|
3279
|
+
activeTab: S,
|
|
3280
3280
|
conditionsErrorText: Ke,
|
|
3281
3281
|
currentConditions: F,
|
|
3282
3282
|
decision: t,
|
|
@@ -3284,12 +3284,12 @@ const Oe = (e) => {
|
|
|
3284
3284
|
normalizedDecision: se,
|
|
3285
3285
|
onCancel: r,
|
|
3286
3286
|
onRedefineCurrentTab: nt,
|
|
3287
|
-
onTabChange:
|
|
3288
|
-
onClearCondition: (
|
|
3289
|
-
|
|
3287
|
+
onTabChange: C,
|
|
3288
|
+
onClearCondition: (D) => {
|
|
3289
|
+
Ct(D), i == null || i(D);
|
|
3290
3290
|
},
|
|
3291
3291
|
showConditionsError: wt,
|
|
3292
|
-
tabs:
|
|
3292
|
+
tabs: w,
|
|
3293
3293
|
termEndStatus: Dt,
|
|
3294
3294
|
termStartStatus: Je,
|
|
3295
3295
|
textValues: o,
|
|
@@ -3297,15 +3297,15 @@ const Oe = (e) => {
|
|
|
3297
3297
|
visibleConditionsByGroup: R,
|
|
3298
3298
|
handleToggleNoneChange: u,
|
|
3299
3299
|
portalId: "redefine-confirm-portal",
|
|
3300
|
-
showRedefineConfirm:
|
|
3300
|
+
showRedefineConfirm: St,
|
|
3301
3301
|
onOpenRedefineConfirm: () => Le(!0),
|
|
3302
3302
|
onCloseRedefineConfirm: () => Le(!1),
|
|
3303
3303
|
onConfirmRedefine: () => {
|
|
3304
3304
|
nt();
|
|
3305
|
-
const
|
|
3305
|
+
const D = (c[A] ?? []).map(
|
|
3306
3306
|
(L) => `${A}.${L.conditionName}`
|
|
3307
3307
|
);
|
|
3308
|
-
s == null || s(
|
|
3308
|
+
s == null || s(D), Le(!1);
|
|
3309
3309
|
}
|
|
3310
3310
|
}
|
|
3311
3311
|
);
|
|
@@ -3325,12 +3325,12 @@ const Oe = (e) => {
|
|
|
3325
3325
|
handleCloseModal: h,
|
|
3326
3326
|
handleSubmitForm: g,
|
|
3327
3327
|
handleDelete: f,
|
|
3328
|
-
terms:
|
|
3329
|
-
onRemoveCondition:
|
|
3330
|
-
onRestoreConditions:
|
|
3331
|
-
baseDecisionTemplate:
|
|
3332
|
-
shouldRenderEmptyMessage:
|
|
3333
|
-
} = e, [N,
|
|
3328
|
+
terms: x = !0,
|
|
3329
|
+
onRemoveCondition: y,
|
|
3330
|
+
onRestoreConditions: v,
|
|
3331
|
+
baseDecisionTemplate: w,
|
|
3332
|
+
shouldRenderEmptyMessage: S = !0
|
|
3333
|
+
} = e, [N, C] = B(null), A = ue("(max-width: 681px)"), { renderedCards: R, shouldRenderAddCard: F } = qr({
|
|
3334
3334
|
cardTitle: t,
|
|
3335
3335
|
controls: n,
|
|
3336
3336
|
customTitleContentAddCard: o,
|
|
@@ -3340,11 +3340,11 @@ const Oe = (e) => {
|
|
|
3340
3340
|
handleDelete: f,
|
|
3341
3341
|
textValues: s,
|
|
3342
3342
|
isOpenFor: (se) => N === se,
|
|
3343
|
-
toggleAt: (se) =>
|
|
3343
|
+
toggleAt: (se) => C((Re) => Re === se ? null : se)
|
|
3344
3344
|
}), le = (i == null ? void 0 : i.length) === 0 && !p;
|
|
3345
3345
|
return /* @__PURE__ */ m(V, { children: [
|
|
3346
|
-
/* @__PURE__ */ a(
|
|
3347
|
-
|
|
3346
|
+
/* @__PURE__ */ a(jr, { children: /* @__PURE__ */ a(Ur, { children: /* @__PURE__ */ a(T, { direction: "column", gap: "16px", padding: "6px", children: S && (le ? /* @__PURE__ */ a(Ve, { legend: "Decisiones", children: /* @__PURE__ */ m(
|
|
3347
|
+
T,
|
|
3348
3348
|
{
|
|
3349
3349
|
direction: "column",
|
|
3350
3350
|
gap: "16px",
|
|
@@ -3400,45 +3400,45 @@ const Oe = (e) => {
|
|
|
3400
3400
|
handleOpenModal: c,
|
|
3401
3401
|
handleDelete: f,
|
|
3402
3402
|
textValues: s,
|
|
3403
|
-
shouldRenderEmptyMessage:
|
|
3404
|
-
terms:
|
|
3403
|
+
shouldRenderEmptyMessage: S,
|
|
3404
|
+
terms: x
|
|
3405
3405
|
})
|
|
3406
3406
|
]
|
|
3407
3407
|
}
|
|
3408
3408
|
)) }) }) }),
|
|
3409
3409
|
l && /* @__PURE__ */ a(
|
|
3410
|
-
|
|
3410
|
+
Xr,
|
|
3411
3411
|
{
|
|
3412
3412
|
portalId: "modal-portal",
|
|
3413
3413
|
onCloseModal: h,
|
|
3414
3414
|
title: u ? "Editar Decisión" : "Configurar Decisión",
|
|
3415
3415
|
description: "Diligencia los campos para configurar tu decisión.",
|
|
3416
3416
|
children: /* @__PURE__ */ a(
|
|
3417
|
-
|
|
3417
|
+
yi,
|
|
3418
3418
|
{
|
|
3419
3419
|
decision: u || d,
|
|
3420
|
-
fullTemplate:
|
|
3420
|
+
fullTemplate: w ?? d,
|
|
3421
3421
|
onSubmitEvent: g,
|
|
3422
3422
|
textValues: s,
|
|
3423
3423
|
onCancel: () => h ? h() : () => {
|
|
3424
3424
|
},
|
|
3425
|
-
onRemoveCondition:
|
|
3426
|
-
onRestoreConditions:
|
|
3425
|
+
onRemoveCondition: y,
|
|
3426
|
+
onRestoreConditions: v
|
|
3427
3427
|
}
|
|
3428
3428
|
)
|
|
3429
3429
|
}
|
|
3430
3430
|
)
|
|
3431
3431
|
] });
|
|
3432
|
-
},
|
|
3432
|
+
}, Ti = {
|
|
3433
3433
|
border: {
|
|
3434
3434
|
color: I.palette.neutral.N40
|
|
3435
3435
|
}
|
|
3436
|
-
},
|
|
3436
|
+
}, xi = E.div`
|
|
3437
3437
|
border-width: 1px;
|
|
3438
3438
|
border-style: solid;
|
|
3439
3439
|
border-color: ${({ theme: e }) => {
|
|
3440
3440
|
var t, n;
|
|
3441
|
-
return ((n = (t = e == null ? void 0 : e.box) == null ? void 0 : t.border) == null ? void 0 : n.color) ||
|
|
3441
|
+
return ((n = (t = e == null ? void 0 : e.box) == null ? void 0 : t.border) == null ? void 0 : n.color) || Ti.border.color;
|
|
3442
3442
|
}};
|
|
3443
3443
|
border-radius: ${({ $borderRadius: e }) => e};
|
|
3444
3444
|
margin: ${({ $margin: e }) => e};
|
|
@@ -3447,7 +3447,7 @@ const Oe = (e) => {
|
|
|
3447
3447
|
height: ${({ $height: e }) => e};
|
|
3448
3448
|
box-sizing: border-box;
|
|
3449
3449
|
`;
|
|
3450
|
-
function
|
|
3450
|
+
function Di(e) {
|
|
3451
3451
|
const {
|
|
3452
3452
|
children: t,
|
|
3453
3453
|
padding: n = "16px",
|
|
@@ -3457,7 +3457,7 @@ function xi(e) {
|
|
|
3457
3457
|
height: s
|
|
3458
3458
|
} = e;
|
|
3459
3459
|
return /* @__PURE__ */ a(
|
|
3460
|
-
|
|
3460
|
+
xi,
|
|
3461
3461
|
{
|
|
3462
3462
|
$padding: n,
|
|
3463
3463
|
$margin: o,
|
|
@@ -3468,22 +3468,22 @@ function xi(e) {
|
|
|
3468
3468
|
}
|
|
3469
3469
|
);
|
|
3470
3470
|
}
|
|
3471
|
-
const
|
|
3471
|
+
const wi = (e, t) => {
|
|
3472
3472
|
const [n, o] = B([]), [r, i] = B([]), [s, d] = B(!1), l = je(null);
|
|
3473
3473
|
return Be(() => {
|
|
3474
3474
|
if (!e.current || !l.current) return;
|
|
3475
3475
|
const u = e.current, p = l.current, c = () => {
|
|
3476
|
-
var
|
|
3476
|
+
var S;
|
|
3477
3477
|
const g = u.clientWidth, f = Array.from(
|
|
3478
3478
|
p.querySelectorAll('[data-filter-tag="true"]')
|
|
3479
|
-
),
|
|
3480
|
-
let
|
|
3481
|
-
const
|
|
3479
|
+
), x = 48;
|
|
3480
|
+
let y = 0;
|
|
3481
|
+
const v = [], w = [];
|
|
3482
3482
|
for (let N = 0; N < t.length; N++) {
|
|
3483
|
-
const
|
|
3484
|
-
|
|
3483
|
+
const C = ((S = f[N]) == null ? void 0 : S.offsetWidth) ?? 0;
|
|
3484
|
+
y + C + x <= g ? (v.push(t[N]), y += C) : w.push(t[N]);
|
|
3485
3485
|
}
|
|
3486
|
-
o(
|
|
3486
|
+
o(v), i(w), d(w.length > 0);
|
|
3487
3487
|
}, h = new ResizeObserver(() => {
|
|
3488
3488
|
requestAnimationFrame(c);
|
|
3489
3489
|
});
|
|
@@ -3495,7 +3495,7 @@ E.div`
|
|
|
3495
3495
|
width: 100%;
|
|
3496
3496
|
}
|
|
3497
3497
|
`;
|
|
3498
|
-
const
|
|
3498
|
+
const Ci = E.div`
|
|
3499
3499
|
position: absolute;
|
|
3500
3500
|
top: calc(100% + 4px);
|
|
3501
3501
|
right: 0;
|
|
@@ -3507,7 +3507,7 @@ const wi = E.div`
|
|
|
3507
3507
|
pointer-events: none;
|
|
3508
3508
|
height: 0;
|
|
3509
3509
|
overflow: hidden;
|
|
3510
|
-
`,
|
|
3510
|
+
`, Ei = E.div`
|
|
3511
3511
|
cursor: pointer;
|
|
3512
3512
|
`, Ht = {
|
|
3513
3513
|
border: {
|
|
@@ -3545,7 +3545,7 @@ const wi = E.div`
|
|
|
3545
3545
|
hover: I.palette.neutral.N30
|
|
3546
3546
|
}
|
|
3547
3547
|
}
|
|
3548
|
-
},
|
|
3548
|
+
}, Ni = E.li`
|
|
3549
3549
|
display: flex;
|
|
3550
3550
|
align-items: center;
|
|
3551
3551
|
align-self: stretch;
|
|
@@ -3563,17 +3563,17 @@ const wi = E.div`
|
|
|
3563
3563
|
return ((o = (n = (t = e == null ? void 0 : e.input) == null ? void 0 : t.background) == null ? void 0 : n.color) == null ? void 0 : o.regular) || Ht.background.color.regular;
|
|
3564
3564
|
}};
|
|
3565
3565
|
}
|
|
3566
|
-
`,
|
|
3567
|
-
var h, g, f,
|
|
3568
|
-
const { id: t, label: n, leadingIcon: o, onClose: r } = e, [i, s] = B(!1), d = () => s(!0), l = () => s(!1), u = co(so), p = ((f = (g = (h = u == null ? void 0 : u.input) == null ? void 0 : h.option) == null ? void 0 : g.appearance) == null ? void 0 : f.hover) ?? Ht.option.appearance.hover, c = ((
|
|
3566
|
+
`, ki = (e) => {
|
|
3567
|
+
var h, g, f, x, y, v;
|
|
3568
|
+
const { id: t, label: n, leadingIcon: o, onClose: r } = e, [i, s] = B(!1), d = () => s(!0), l = () => s(!1), u = co(so), p = ((f = (g = (h = u == null ? void 0 : u.input) == null ? void 0 : h.option) == null ? void 0 : g.appearance) == null ? void 0 : f.hover) ?? Ht.option.appearance.hover, c = ((v = (y = (x = u == null ? void 0 : u.input) == null ? void 0 : x.option) == null ? void 0 : y.appearance) == null ? void 0 : v.regular) ?? Ht.option.appearance.regular;
|
|
3569
3569
|
return /* @__PURE__ */ a(
|
|
3570
|
-
|
|
3570
|
+
Ni,
|
|
3571
3571
|
{
|
|
3572
3572
|
id: t,
|
|
3573
3573
|
onMouseEnter: d,
|
|
3574
3574
|
onMouseLeave: l,
|
|
3575
|
-
onClick: (
|
|
3576
|
-
|
|
3575
|
+
onClick: (w) => {
|
|
3576
|
+
w.stopPropagation();
|
|
3577
3577
|
},
|
|
3578
3578
|
children: /* @__PURE__ */ m(
|
|
3579
3579
|
Ye,
|
|
@@ -3605,8 +3605,8 @@ const wi = E.div`
|
|
|
3605
3605
|
{
|
|
3606
3606
|
icon: /* @__PURE__ */ a(Kn, {}),
|
|
3607
3607
|
size: "small",
|
|
3608
|
-
onClick: (
|
|
3609
|
-
|
|
3608
|
+
onClick: (w) => {
|
|
3609
|
+
w.stopPropagation(), r == null || r();
|
|
3610
3610
|
},
|
|
3611
3611
|
appearance: i ? p : c,
|
|
3612
3612
|
cursorHover: !0
|
|
@@ -3617,7 +3617,7 @@ const wi = E.div`
|
|
|
3617
3617
|
)
|
|
3618
3618
|
}
|
|
3619
3619
|
);
|
|
3620
|
-
},
|
|
3620
|
+
}, El = (e) => {
|
|
3621
3621
|
const {
|
|
3622
3622
|
appliedFilters: t = [],
|
|
3623
3623
|
onClear: n,
|
|
@@ -3630,38 +3630,38 @@ const wi = E.div`
|
|
|
3630
3630
|
hidden: c,
|
|
3631
3631
|
showOverflowIndicator: h,
|
|
3632
3632
|
measurementRef: g
|
|
3633
|
-
} =
|
|
3634
|
-
|
|
3633
|
+
} = wi(d, t), [f, x] = B(!1), y = (C) => {
|
|
3634
|
+
C.stopPropagation(), x((A) => !A);
|
|
3635
3635
|
};
|
|
3636
3636
|
Be(() => {
|
|
3637
|
-
const
|
|
3637
|
+
const C = (A) => {
|
|
3638
3638
|
var le, se;
|
|
3639
3639
|
const R = A.target;
|
|
3640
|
-
!((le = l.current) != null && le.contains(R)) && !((se = u.current) != null && se.contains(R)) &&
|
|
3640
|
+
!((le = l.current) != null && le.contains(R)) && !((se = u.current) != null && se.contains(R)) && x(!1);
|
|
3641
3641
|
};
|
|
3642
|
-
return f && window.addEventListener("mousedown",
|
|
3642
|
+
return f && window.addEventListener("mousedown", C), () => window.removeEventListener("mousedown", C);
|
|
3643
3643
|
}, [f]);
|
|
3644
|
-
const
|
|
3645
|
-
id:
|
|
3646
|
-
value:
|
|
3647
|
-
label:
|
|
3648
|
-
icon:
|
|
3649
|
-
})), N = (
|
|
3644
|
+
const v = t.length === 0, w = f && c.length > 0, S = c.map((C) => ({
|
|
3645
|
+
id: C.label,
|
|
3646
|
+
value: C.label,
|
|
3647
|
+
label: C.label,
|
|
3648
|
+
icon: C.icon
|
|
3649
|
+
})), N = (C) => {
|
|
3650
3650
|
var A, R;
|
|
3651
|
-
(R = (A = c.find((F) => F.label ===
|
|
3651
|
+
(R = (A = c.find((F) => F.label === C)) == null ? void 0 : A.onClose) == null || R.call(A), x(!1);
|
|
3652
3652
|
};
|
|
3653
|
-
return /* @__PURE__ */ m(
|
|
3654
|
-
/* @__PURE__ */ a(Si, { ref: g, children: t.map((
|
|
3653
|
+
return /* @__PURE__ */ m(Di, { borderRadius: "8px", width: "100%", children: [
|
|
3654
|
+
/* @__PURE__ */ a(Si, { ref: g, children: t.map((C) => /* @__PURE__ */ a("div", { "data-filter-tag": "true", children: /* @__PURE__ */ a(
|
|
3655
3655
|
Pe,
|
|
3656
3656
|
{
|
|
3657
3657
|
appearance: "primary",
|
|
3658
3658
|
displayIcon: !0,
|
|
3659
3659
|
removable: !0,
|
|
3660
|
-
icon:
|
|
3661
|
-
label:
|
|
3662
|
-
onClose:
|
|
3660
|
+
icon: C.icon,
|
|
3661
|
+
label: C.label,
|
|
3662
|
+
onClose: C.onClose
|
|
3663
3663
|
}
|
|
3664
|
-
) },
|
|
3664
|
+
) }, C.label)) }),
|
|
3665
3665
|
/* @__PURE__ */ m(Ye, { gap: "12px", templateColumns: "1fr auto auto", width: "100%", children: [
|
|
3666
3666
|
/* @__PURE__ */ a(
|
|
3667
3667
|
ce,
|
|
@@ -3675,19 +3675,19 @@ const wi = E.div`
|
|
|
3675
3675
|
alignItems: "center",
|
|
3676
3676
|
padding: "0px 8px",
|
|
3677
3677
|
border: !0,
|
|
3678
|
-
children:
|
|
3679
|
-
p.map((
|
|
3678
|
+
children: v ? /* @__PURE__ */ a($, { size: "small", type: "label", appearance: "gray", children: r }) : /* @__PURE__ */ m(V, { children: [
|
|
3679
|
+
p.map((C) => /* @__PURE__ */ a(
|
|
3680
3680
|
Pe,
|
|
3681
3681
|
{
|
|
3682
3682
|
"data-filter-tag": "true",
|
|
3683
3683
|
appearance: "primary",
|
|
3684
3684
|
displayIcon: !0,
|
|
3685
3685
|
removable: !0,
|
|
3686
|
-
icon:
|
|
3687
|
-
label:
|
|
3688
|
-
onClose:
|
|
3686
|
+
icon: C.icon,
|
|
3687
|
+
label: C.label,
|
|
3688
|
+
onClose: C.onClose
|
|
3689
3689
|
},
|
|
3690
|
-
|
|
3690
|
+
C.label
|
|
3691
3691
|
)),
|
|
3692
3692
|
h && /* @__PURE__ */ m(
|
|
3693
3693
|
"div",
|
|
@@ -3695,30 +3695,30 @@ const wi = E.div`
|
|
|
3695
3695
|
ref: u,
|
|
3696
3696
|
style: { position: "relative", display: "inline-block" },
|
|
3697
3697
|
children: [
|
|
3698
|
-
/* @__PURE__ */ a(
|
|
3698
|
+
/* @__PURE__ */ a(Ei, { onClick: y, children: /* @__PURE__ */ a(
|
|
3699
3699
|
Pe,
|
|
3700
3700
|
{
|
|
3701
3701
|
appearance: "primary",
|
|
3702
3702
|
label: `+${c.length}`
|
|
3703
3703
|
}
|
|
3704
3704
|
) }),
|
|
3705
|
-
|
|
3705
|
+
w && /* @__PURE__ */ a(Ci, { ref: l, children: /* @__PURE__ */ a(
|
|
3706
3706
|
ao,
|
|
3707
3707
|
{
|
|
3708
|
-
options:
|
|
3708
|
+
options: S,
|
|
3709
3709
|
onOptionClick: N,
|
|
3710
|
-
children: c.map((
|
|
3711
|
-
|
|
3710
|
+
children: c.map((C) => /* @__PURE__ */ a(
|
|
3711
|
+
ki,
|
|
3712
3712
|
{
|
|
3713
|
-
id:
|
|
3714
|
-
label:
|
|
3715
|
-
leadingIcon:
|
|
3713
|
+
id: C.label,
|
|
3714
|
+
label: C.label,
|
|
3715
|
+
leadingIcon: C.icon,
|
|
3716
3716
|
onClose: () => {
|
|
3717
3717
|
var A;
|
|
3718
|
-
(A =
|
|
3718
|
+
(A = C.onClose) == null || A.call(C), x(!1);
|
|
3719
3719
|
}
|
|
3720
3720
|
},
|
|
3721
|
-
|
|
3721
|
+
C.label
|
|
3722
3722
|
))
|
|
3723
3723
|
}
|
|
3724
3724
|
) })
|
|
@@ -3732,7 +3732,7 @@ const wi = E.div`
|
|
|
3732
3732
|
Q,
|
|
3733
3733
|
{
|
|
3734
3734
|
cursorHover: !0,
|
|
3735
|
-
disabled:
|
|
3735
|
+
disabled: v,
|
|
3736
3736
|
iconBefore: /* @__PURE__ */ a(eo, {}),
|
|
3737
3737
|
onClick: n,
|
|
3738
3738
|
variant: "outlined",
|
|
@@ -3751,11 +3751,11 @@ const wi = E.div`
|
|
|
3751
3751
|
)
|
|
3752
3752
|
] })
|
|
3753
3753
|
] });
|
|
3754
|
-
},
|
|
3754
|
+
}, Nl = (e) => {
|
|
3755
3755
|
const { appliedFilters: t, fields: n, onChange: o, noFiltersLabel: r } = e, i = ue("(max-width: 768px)"), s = !t || t.length === 0;
|
|
3756
|
-
return /* @__PURE__ */ m(
|
|
3756
|
+
return /* @__PURE__ */ m(T, { direction: "column", gap: "16px", children: [
|
|
3757
3757
|
i && /* @__PURE__ */ m(V, { children: [
|
|
3758
|
-
/* @__PURE__ */ m(
|
|
3758
|
+
/* @__PURE__ */ m(T, { gap: "6px", width: "100%", alignItems: "center", children: [
|
|
3759
3759
|
/* @__PURE__ */ a(G, { appearance: "gray", icon: /* @__PURE__ */ a(En, {}) }),
|
|
3760
3760
|
/* @__PURE__ */ a(
|
|
3761
3761
|
ce,
|
|
@@ -3786,8 +3786,8 @@ const wi = E.div`
|
|
|
3786
3786
|
] }),
|
|
3787
3787
|
/* @__PURE__ */ a(Y, { dashed: !0 })
|
|
3788
3788
|
] }),
|
|
3789
|
-
n.map((d) => /* @__PURE__ */ m(
|
|
3790
|
-
/* @__PURE__ */ a(
|
|
3789
|
+
n.map((d) => /* @__PURE__ */ m(T, { gap: "6px", alignItems: "center", children: [
|
|
3790
|
+
/* @__PURE__ */ a(T, { padding: "22px 0 0 0", children: /* @__PURE__ */ a(G, { appearance: "primary", icon: d.icon }) }),
|
|
3791
3791
|
/* @__PURE__ */ a(
|
|
3792
3792
|
lo,
|
|
3793
3793
|
{
|
|
@@ -3807,12 +3807,12 @@ const wi = E.div`
|
|
|
3807
3807
|
)
|
|
3808
3808
|
] }, d.name))
|
|
3809
3809
|
] });
|
|
3810
|
-
},
|
|
3810
|
+
}, Ai = (e) => {
|
|
3811
3811
|
const t = [];
|
|
3812
3812
|
return e.from !== void 0 && e.from !== null && t.push(`>${e.from}`), e.to !== void 0 && e.to !== null && t.push(`<${e.to}`), t.join(";");
|
|
3813
|
-
},
|
|
3813
|
+
}, kl = (e) => {
|
|
3814
3814
|
var s;
|
|
3815
|
-
const { decision: t, fallbackId: n, template: o } = e, r = (d) => typeof d == "object" && d !== null && "from" in d && "to" in d ?
|
|
3815
|
+
const { decision: t, fallbackId: n, template: o } = e, r = (d) => typeof d == "object" && d !== null && "from" in d && "to" in d ? Ai(d) : d, i = ((s = t.conditionsThatEstablishesTheDecision) == null ? void 0 : s.map((d, l) => {
|
|
3816
3816
|
var c;
|
|
3817
3817
|
const u = d == null ? void 0 : d.value;
|
|
3818
3818
|
return u == null || typeof u == "string" && u.trim() === "" || Array.isArray(u) && u.length === 0 ? null : {
|
|
@@ -3828,7 +3828,7 @@ const wi = E.div`
|
|
|
3828
3828
|
value: r(t.value),
|
|
3829
3829
|
conditionsThatEstablishesTheDecision: i
|
|
3830
3830
|
};
|
|
3831
|
-
},
|
|
3831
|
+
}, Al = (e) => {
|
|
3832
3832
|
if (typeof e != "string") return e;
|
|
3833
3833
|
const t = e.split(";").map((o) => o.trim()), n = {};
|
|
3834
3834
|
for (const o of t)
|
|
@@ -3840,7 +3840,7 @@ const wi = E.div`
|
|
|
3840
3840
|
isNaN(r) || (n.to = r);
|
|
3841
3841
|
}
|
|
3842
3842
|
return n.from !== void 0 || n.to !== void 0 ? n : e;
|
|
3843
|
-
},
|
|
3843
|
+
}, Il = (e) => {
|
|
3844
3844
|
const { dataDecision: t, originalDecision: n } = e, o = {
|
|
3845
3845
|
conditionName: t.ruleName || "",
|
|
3846
3846
|
labelName: t.labelName || "",
|
|
@@ -3856,7 +3856,7 @@ const wi = E.div`
|
|
|
3856
3856
|
(r) => r.hidden ? { ...o } : r
|
|
3857
3857
|
)
|
|
3858
3858
|
};
|
|
3859
|
-
},
|
|
3859
|
+
}, Fl = (e) => {
|
|
3860
3860
|
const { decisions: t } = e;
|
|
3861
3861
|
return t == null ? void 0 : t.map((n) => {
|
|
3862
3862
|
var r;
|
|
@@ -3875,14 +3875,14 @@ const wi = E.div`
|
|
|
3875
3875
|
)
|
|
3876
3876
|
} : n;
|
|
3877
3877
|
});
|
|
3878
|
-
},
|
|
3878
|
+
}, Ii = (e) => ({
|
|
3879
3879
|
schema: ge().required("Requerido").test(
|
|
3880
3880
|
"non-empty",
|
|
3881
3881
|
"El valor no puede estar vacío",
|
|
3882
3882
|
(t) => t != null && t.trim() !== ""
|
|
3883
3883
|
),
|
|
3884
3884
|
value: e
|
|
3885
|
-
}),
|
|
3885
|
+
}), Fi = (e) => ({
|
|
3886
3886
|
schema: ve().test(
|
|
3887
3887
|
"isArrayOrString",
|
|
3888
3888
|
"Debe ser un array de strings/numbers o un solo string",
|
|
@@ -3891,7 +3891,7 @@ const wi = E.div`
|
|
|
3891
3891
|
) : typeof t == "string"
|
|
3892
3892
|
),
|
|
3893
3893
|
value: e
|
|
3894
|
-
}),
|
|
3894
|
+
}), $i = (e) => ({
|
|
3895
3895
|
schema: ve().test(
|
|
3896
3896
|
"isArrayOrString",
|
|
3897
3897
|
"Debe ser un array de strings/numbers o un solo string ",
|
|
@@ -3900,7 +3900,7 @@ const wi = E.div`
|
|
|
3900
3900
|
) : typeof t == "string"
|
|
3901
3901
|
),
|
|
3902
3902
|
value: e
|
|
3903
|
-
}),
|
|
3903
|
+
}), Ri = (e) => {
|
|
3904
3904
|
const t = (e == null ? void 0 : e.from) ?? 0, n = (e == null ? void 0 : e.to) ?? 0;
|
|
3905
3905
|
return {
|
|
3906
3906
|
schema: J({
|
|
@@ -3922,15 +3922,15 @@ const wi = E.div`
|
|
|
3922
3922
|
} : {
|
|
3923
3923
|
schema: ge().required("Requerido"),
|
|
3924
3924
|
value: e
|
|
3925
|
-
},
|
|
3926
|
-
[k.LIST_OF_VALUES]:
|
|
3927
|
-
[k.LIST_OF_VALUES_MULTI]:
|
|
3928
|
-
[k.RANGE]:
|
|
3925
|
+
}, Li = {
|
|
3926
|
+
[k.LIST_OF_VALUES]: Fi,
|
|
3927
|
+
[k.LIST_OF_VALUES_MULTI]: $i,
|
|
3928
|
+
[k.RANGE]: Ri,
|
|
3929
3929
|
[k.GREATER_THAN]: $t,
|
|
3930
3930
|
[k.LESS_THAN]: $t,
|
|
3931
3931
|
[k.EQUAL]: $t
|
|
3932
|
-
}, fn = (e) =>
|
|
3933
|
-
function
|
|
3932
|
+
}, fn = (e) => Li[e] || Ii;
|
|
3933
|
+
function Oi({
|
|
3934
3934
|
decision: e,
|
|
3935
3935
|
onSubmitEvent: t,
|
|
3936
3936
|
textValues: n
|
|
@@ -3999,10 +3999,10 @@ function Li({
|
|
|
3999
3999
|
const c = ((h = e.conditionsThatEstablishesTheDecision) == null ? void 0 : h.reduce(
|
|
4000
4000
|
(g, f) => {
|
|
4001
4001
|
if (r.values.conditionsThatEstablishesTheDecision[f.conditionName] !== void 0) {
|
|
4002
|
-
const
|
|
4002
|
+
const y = fn(
|
|
4003
4003
|
f.howToSetTheCondition
|
|
4004
4004
|
);
|
|
4005
|
-
g[f.conditionName] =
|
|
4005
|
+
g[f.conditionName] = y(
|
|
4006
4006
|
f.value,
|
|
4007
4007
|
f.conditionDataType
|
|
4008
4008
|
).schema;
|
|
@@ -4070,7 +4070,7 @@ function Li({
|
|
|
4070
4070
|
});
|
|
4071
4071
|
} };
|
|
4072
4072
|
}
|
|
4073
|
-
const
|
|
4073
|
+
const Mi = E.div`
|
|
4074
4074
|
& > div {
|
|
4075
4075
|
border-radius: 8px;
|
|
4076
4076
|
border: 1px solid
|
|
@@ -4079,7 +4079,7 @@ const Oi = E.div`
|
|
|
4079
4079
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || I.palette.neutral.N30;
|
|
4080
4080
|
}};
|
|
4081
4081
|
}
|
|
4082
|
-
`,
|
|
4082
|
+
`, _i = E.div`
|
|
4083
4083
|
width: 100%;
|
|
4084
4084
|
height: 100%;
|
|
4085
4085
|
overflow-y: auto;
|
|
@@ -4096,7 +4096,7 @@ const Oi = E.div`
|
|
|
4096
4096
|
background-color: #ebecf0;
|
|
4097
4097
|
border-radius: 8px;
|
|
4098
4098
|
}
|
|
4099
|
-
`,
|
|
4099
|
+
`, Pi = (e) => {
|
|
4100
4100
|
const {
|
|
4101
4101
|
checked: t,
|
|
4102
4102
|
children: n,
|
|
@@ -4111,7 +4111,7 @@ const Oi = E.div`
|
|
|
4111
4111
|
return Be(() => {
|
|
4112
4112
|
u(t);
|
|
4113
4113
|
}, [t]), /* @__PURE__ */ m(V, { children: [
|
|
4114
|
-
/* @__PURE__ */ a(
|
|
4114
|
+
/* @__PURE__ */ a(T, { children: /* @__PURE__ */ a(
|
|
4115
4115
|
bt,
|
|
4116
4116
|
{
|
|
4117
4117
|
checked: l,
|
|
@@ -4125,7 +4125,7 @@ const Oi = E.div`
|
|
|
4125
4125
|
) }),
|
|
4126
4126
|
l && /* @__PURE__ */ a(V, { children: n })
|
|
4127
4127
|
] });
|
|
4128
|
-
},
|
|
4128
|
+
}, Vi = (e) => {
|
|
4129
4129
|
const {
|
|
4130
4130
|
onHandleStartChange: t,
|
|
4131
4131
|
onHandleEndChange: n,
|
|
@@ -4140,15 +4140,15 @@ const Oi = E.div`
|
|
|
4140
4140
|
messageEnd: c = "",
|
|
4141
4141
|
statusStart: h = "pending",
|
|
4142
4142
|
statusEnd: g = "pending"
|
|
4143
|
-
} = e, [f,
|
|
4144
|
-
|
|
4145
|
-
},
|
|
4146
|
-
|
|
4143
|
+
} = e, [f, x] = B(s), [y, v] = B(l), [w, S] = B(u), N = ({ target: F }) => {
|
|
4144
|
+
x(F.checked), o && o(F.checked);
|
|
4145
|
+
}, C = (F) => {
|
|
4146
|
+
v(F.target.value), t(F);
|
|
4147
4147
|
}, A = (F) => {
|
|
4148
|
-
|
|
4148
|
+
S(F.target.value), n(F);
|
|
4149
4149
|
}, R = ue("(max-width: 400px)");
|
|
4150
4150
|
return /* @__PURE__ */ m(V, { children: [
|
|
4151
|
-
/* @__PURE__ */ m(
|
|
4151
|
+
/* @__PURE__ */ m(T, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
4152
4152
|
/* @__PURE__ */ a(
|
|
4153
4153
|
$,
|
|
4154
4154
|
{
|
|
@@ -4161,7 +4161,7 @@ const Oi = E.div`
|
|
|
4161
4161
|
}
|
|
4162
4162
|
),
|
|
4163
4163
|
/* @__PURE__ */ a(
|
|
4164
|
-
|
|
4164
|
+
T,
|
|
4165
4165
|
{
|
|
4166
4166
|
alignContent: "center",
|
|
4167
4167
|
justifyContent: "center",
|
|
@@ -4180,7 +4180,7 @@ const Oi = E.div`
|
|
|
4180
4180
|
)
|
|
4181
4181
|
] }),
|
|
4182
4182
|
/* @__PURE__ */ m(
|
|
4183
|
-
|
|
4183
|
+
T,
|
|
4184
4184
|
{
|
|
4185
4185
|
direction: R ? "column" : "row",
|
|
4186
4186
|
justifyContent: "space-between",
|
|
@@ -4191,8 +4191,8 @@ const Oi = E.div`
|
|
|
4191
4191
|
{
|
|
4192
4192
|
id: "dateStart",
|
|
4193
4193
|
label: r,
|
|
4194
|
-
onChange:
|
|
4195
|
-
value:
|
|
4194
|
+
onChange: C,
|
|
4195
|
+
value: y,
|
|
4196
4196
|
required: d,
|
|
4197
4197
|
size: "compact",
|
|
4198
4198
|
status: h,
|
|
@@ -4205,7 +4205,7 @@ const Oi = E.div`
|
|
|
4205
4205
|
id: "dateEnd",
|
|
4206
4206
|
label: i,
|
|
4207
4207
|
onChange: A,
|
|
4208
|
-
value:
|
|
4208
|
+
value: w,
|
|
4209
4209
|
required: d,
|
|
4210
4210
|
size: "compact",
|
|
4211
4211
|
status: g,
|
|
@@ -4216,7 +4216,7 @@ const Oi = E.div`
|
|
|
4216
4216
|
}
|
|
4217
4217
|
)
|
|
4218
4218
|
] });
|
|
4219
|
-
},
|
|
4219
|
+
}, ji = (e) => {
|
|
4220
4220
|
const {
|
|
4221
4221
|
formik: t,
|
|
4222
4222
|
textValues: n,
|
|
@@ -4229,15 +4229,15 @@ const Oi = E.div`
|
|
|
4229
4229
|
termStartStatus: u,
|
|
4230
4230
|
termEndStatus: p
|
|
4231
4231
|
} = e;
|
|
4232
|
-
return /* @__PURE__ */ a("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ m(
|
|
4232
|
+
return /* @__PURE__ */ a("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ m(T, { direction: "column", gap: "24px", children: [
|
|
4233
4233
|
pt({
|
|
4234
4234
|
condition: i,
|
|
4235
4235
|
formik: t,
|
|
4236
4236
|
isDecision: !0
|
|
4237
4237
|
}),
|
|
4238
4238
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
4239
|
-
/* @__PURE__ */ a(
|
|
4240
|
-
|
|
4239
|
+
/* @__PURE__ */ a(Mi, { children: /* @__PURE__ */ a(_i, { children: /* @__PURE__ */ m(
|
|
4240
|
+
T,
|
|
4241
4241
|
{
|
|
4242
4242
|
direction: "column",
|
|
4243
4243
|
padding: "6px 12px",
|
|
@@ -4245,7 +4245,7 @@ const Oi = E.div`
|
|
|
4245
4245
|
height: "272px",
|
|
4246
4246
|
children: [
|
|
4247
4247
|
/* @__PURE__ */ m(
|
|
4248
|
-
|
|
4248
|
+
T,
|
|
4249
4249
|
{
|
|
4250
4250
|
justifyContent: "space-between",
|
|
4251
4251
|
alignItems: "center",
|
|
@@ -4265,8 +4265,8 @@ const Oi = E.div`
|
|
|
4265
4265
|
]
|
|
4266
4266
|
}
|
|
4267
4267
|
),
|
|
4268
|
-
/* @__PURE__ */ a(
|
|
4269
|
-
|
|
4268
|
+
/* @__PURE__ */ a(T, { direction: "column", gap: "20px", children: r == null ? void 0 : r.map((c) => /* @__PURE__ */ a(
|
|
4269
|
+
Pi,
|
|
4270
4270
|
{
|
|
4271
4271
|
id: `toggle-${c.conditionName}`,
|
|
4272
4272
|
name: `toggle.${c.conditionName}`,
|
|
@@ -4286,7 +4286,7 @@ const Oi = E.div`
|
|
|
4286
4286
|
n.terms && /* @__PURE__ */ m(V, { children: [
|
|
4287
4287
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
4288
4288
|
/* @__PURE__ */ a(
|
|
4289
|
-
|
|
4289
|
+
Vi,
|
|
4290
4290
|
{
|
|
4291
4291
|
labelStart: n.termStart,
|
|
4292
4292
|
labelEnd: n.termEnd,
|
|
@@ -4307,14 +4307,14 @@ const Oi = E.div`
|
|
|
4307
4307
|
] }),
|
|
4308
4308
|
/* @__PURE__ */ a(Y, {}),
|
|
4309
4309
|
l && /* @__PURE__ */ a($, { type: "label", size: "medium", appearance: "danger", children: typeof t.errors.conditionsThatEstablishesTheDecision == "string" ? t.errors.conditionsThatEstablishesTheDecision : "Existen errores en el formulario, por favor revísalos." }),
|
|
4310
|
-
/* @__PURE__ */ m(
|
|
4310
|
+
/* @__PURE__ */ m(T, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
4311
4311
|
/* @__PURE__ */ a(Q, { appearance: "gray", onClick: o, children: n.cancel }),
|
|
4312
4312
|
/* @__PURE__ */ a(Q, { type: "submit", children: n.confirm })
|
|
4313
4313
|
] })
|
|
4314
4314
|
] }) });
|
|
4315
|
-
},
|
|
4315
|
+
}, Ui = (e) => {
|
|
4316
4316
|
var g;
|
|
4317
|
-
const { decision: t, onSubmitEvent: n, textValues: o, onCancel: r } = e, { formik: i, handleToggleNoneChange: s } =
|
|
4317
|
+
const { decision: t, onSubmitEvent: n, textValues: o, onCancel: r } = e, { formik: i, handleToggleNoneChange: s } = Oi({
|
|
4318
4318
|
decision: t,
|
|
4319
4319
|
onSubmitEvent: n,
|
|
4320
4320
|
textValues: o
|
|
@@ -4328,7 +4328,7 @@ const Oi = E.div`
|
|
|
4328
4328
|
(f) => !f.hidden
|
|
4329
4329
|
)) || [], u = !!i.errors.conditionsThatEstablishesTheDecision && i.submitCount > 0, p = i.touched.effectiveFrom ? i.errors.effectiveFrom ? "invalid" : "valid" : void 0, c = i.touched.validUntil ? i.errors.validUntil ? "invalid" : "valid" : void 0;
|
|
4330
4330
|
return /* @__PURE__ */ a(
|
|
4331
|
-
|
|
4331
|
+
ji,
|
|
4332
4332
|
{
|
|
4333
4333
|
formik: i,
|
|
4334
4334
|
onCancel: r,
|
|
@@ -4337,8 +4337,8 @@ const Oi = E.div`
|
|
|
4337
4337
|
visibleConditions: l,
|
|
4338
4338
|
normalizedDecision: d,
|
|
4339
4339
|
handleToggleNoneChange: s,
|
|
4340
|
-
handleConditionToggleChange: (f,
|
|
4341
|
-
if (!
|
|
4340
|
+
handleConditionToggleChange: (f, x) => (y) => {
|
|
4341
|
+
if (!y)
|
|
4342
4342
|
i.setFieldValue(
|
|
4343
4343
|
`conditionsThatEstablishesTheDecision.${f}`,
|
|
4344
4344
|
void 0
|
|
@@ -4348,10 +4348,10 @@ const Oi = E.div`
|
|
|
4348
4348
|
!1
|
|
4349
4349
|
);
|
|
4350
4350
|
else {
|
|
4351
|
-
const
|
|
4351
|
+
const v = x ? [] : "";
|
|
4352
4352
|
i.setFieldValue(
|
|
4353
4353
|
`conditionsThatEstablishesTheDecision.${f}`,
|
|
4354
|
-
|
|
4354
|
+
v
|
|
4355
4355
|
);
|
|
4356
4356
|
}
|
|
4357
4357
|
},
|
|
@@ -4360,7 +4360,7 @@ const Oi = E.div`
|
|
|
4360
4360
|
termEndStatus: c
|
|
4361
4361
|
}
|
|
4362
4362
|
);
|
|
4363
|
-
},
|
|
4363
|
+
}, $l = (e) => {
|
|
4364
4364
|
var r;
|
|
4365
4365
|
const { decisionTemplate: t } = e, n = { ...t }, o = (r = n.conditionsThatEstablishesTheDecision) == null ? void 0 : r.find(
|
|
4366
4366
|
(i) => i.switchPlaces
|
|
@@ -4376,7 +4376,7 @@ const Oi = E.div`
|
|
|
4376
4376
|
(i) => i.conditionName === o.conditionName ? { ...i, hidden: !0 } : i
|
|
4377
4377
|
)
|
|
4378
4378
|
} : n;
|
|
4379
|
-
},
|
|
4379
|
+
}, Rl = (e) => {
|
|
4380
4380
|
const { decisions: t } = e;
|
|
4381
4381
|
return t == null ? void 0 : t.map((n) => {
|
|
4382
4382
|
var r;
|
|
@@ -4412,7 +4412,7 @@ const Oi = E.div`
|
|
|
4412
4412
|
color: I.palette.neutral.N0
|
|
4413
4413
|
}
|
|
4414
4414
|
}
|
|
4415
|
-
},
|
|
4415
|
+
}, zi = E.div`
|
|
4416
4416
|
& > div {
|
|
4417
4417
|
border: 1px solid
|
|
4418
4418
|
${({ theme: e, $active: t }) => {
|
|
@@ -4435,20 +4435,20 @@ const Oi = E.div`
|
|
|
4435
4435
|
width: 100%;
|
|
4436
4436
|
outline: none;
|
|
4437
4437
|
cursor: pointer;
|
|
4438
|
-
`,
|
|
4438
|
+
`, Hi = E.div`
|
|
4439
4439
|
display: flex;
|
|
4440
4440
|
align-items: center;
|
|
4441
4441
|
outline: none;
|
|
4442
4442
|
cursor: pointer;
|
|
4443
|
-
`,
|
|
4443
|
+
`, Gi = E(kn)`
|
|
4444
4444
|
display: flex;
|
|
4445
4445
|
align-items: center;
|
|
4446
4446
|
text-decoration: none;
|
|
4447
|
-
`,
|
|
4447
|
+
`, Bi = E(kn)`
|
|
4448
4448
|
display: block;
|
|
4449
4449
|
text-decoration: none;
|
|
4450
4450
|
color: inherit;
|
|
4451
|
-
`,
|
|
4451
|
+
`, qi = E.div`
|
|
4452
4452
|
& > div {
|
|
4453
4453
|
border-bottom: 1px solid
|
|
4454
4454
|
${({ theme: e, $active: t }) => {
|
|
@@ -4475,31 +4475,42 @@ const Oi = E.div`
|
|
|
4475
4475
|
return ((i = (r = (o = t == null ? void 0 : t.menu) == null ? void 0 : o.item) == null ? void 0 : r.background) == null ? void 0 : i.hover) || xe.item.background.hover;
|
|
4476
4476
|
}};
|
|
4477
4477
|
}
|
|
4478
|
-
`,
|
|
4478
|
+
`, Wi = E.div`
|
|
4479
4479
|
display: flex;
|
|
4480
4480
|
flex-direction: column;
|
|
4481
4481
|
|
|
4482
4482
|
& > a:last-child ${Ln} {
|
|
4483
4483
|
border-radius: 0 0 8px 8px;
|
|
4484
4484
|
}
|
|
4485
|
-
`,
|
|
4486
|
-
const { isOpen: t, links: n, onClick: o, title: r, activeId: i, headerPath: s, headerActive: d } = e,
|
|
4487
|
-
(
|
|
4488
|
-
},
|
|
4489
|
-
|
|
4490
|
-
},
|
|
4491
|
-
(
|
|
4492
|
-
},
|
|
4493
|
-
|
|
4485
|
+
`, Yi = (e) => {
|
|
4486
|
+
const { isOpen: t, links: n, onClick: o, title: r, activeId: i, headerPath: s, headerActive: d, onBeforeNavigate: l } = e, u = uo(), p = (v) => {
|
|
4487
|
+
(v.key === "Enter" || v.key === " ") && (v.preventDefault(), o());
|
|
4488
|
+
}, c = (v) => {
|
|
4489
|
+
v.preventDefault(), v.stopPropagation(), o();
|
|
4490
|
+
}, h = (v) => {
|
|
4491
|
+
(v.key === "Enter" || v.key === " ") && (v.preventDefault(), v.stopPropagation(), o());
|
|
4492
|
+
}, g = _.useCallback(
|
|
4493
|
+
async (v, w) => {
|
|
4494
|
+
l && !await l(v, w) || u(v);
|
|
4495
|
+
},
|
|
4496
|
+
[u, l]
|
|
4497
|
+
), f = t || d ? "primary" : "dark", x = t || d ? "bold" : "normal", y = _.useId();
|
|
4498
|
+
return /* @__PURE__ */ a(zi, { $active: t, children: /* @__PURE__ */ m(ce, { border: !0, borderRadius: "8px", width: "100%", children: [
|
|
4494
4499
|
/* @__PURE__ */ a(
|
|
4495
|
-
|
|
4500
|
+
qi,
|
|
4496
4501
|
{
|
|
4497
4502
|
$active: t && n.length > 0,
|
|
4498
|
-
"aria-controls":
|
|
4503
|
+
"aria-controls": y,
|
|
4499
4504
|
"aria-expanded": t,
|
|
4500
|
-
onClick:
|
|
4501
|
-
onKeyDown:
|
|
4502
|
-
children: s ? /* @__PURE__ */ a(
|
|
4505
|
+
onClick: c,
|
|
4506
|
+
onKeyDown: h,
|
|
4507
|
+
children: s ? /* @__PURE__ */ a(Gi, { to: s, onClick: async (v) => {
|
|
4508
|
+
v.preventDefault(), v.stopPropagation(), await g(s, {
|
|
4509
|
+
id: s,
|
|
4510
|
+
path: s,
|
|
4511
|
+
label: r
|
|
4512
|
+
});
|
|
4513
|
+
}, children: /* @__PURE__ */ m(
|
|
4503
4514
|
ce,
|
|
4504
4515
|
{
|
|
4505
4516
|
alignItems: "center",
|
|
@@ -4511,7 +4522,7 @@ const Oi = E.div`
|
|
|
4511
4522
|
/* @__PURE__ */ a(
|
|
4512
4523
|
G,
|
|
4513
4524
|
{
|
|
4514
|
-
appearance:
|
|
4525
|
+
appearance: f,
|
|
4515
4526
|
cursorHover: !0,
|
|
4516
4527
|
icon: t && n.length > 0 ? /* @__PURE__ */ a(Ot, {}) : /* @__PURE__ */ a(tn, {})
|
|
4517
4528
|
}
|
|
@@ -4519,11 +4530,11 @@ const Oi = E.div`
|
|
|
4519
4530
|
/* @__PURE__ */ a(mn, { children: /* @__PURE__ */ a(
|
|
4520
4531
|
$,
|
|
4521
4532
|
{
|
|
4522
|
-
appearance:
|
|
4533
|
+
appearance: f,
|
|
4523
4534
|
cursorHover: !0,
|
|
4524
4535
|
size: "small",
|
|
4525
4536
|
type: "title",
|
|
4526
|
-
weight:
|
|
4537
|
+
weight: x,
|
|
4527
4538
|
children: r
|
|
4528
4539
|
}
|
|
4529
4540
|
) })
|
|
@@ -4541,26 +4552,26 @@ const Oi = E.div`
|
|
|
4541
4552
|
/* @__PURE__ */ a(
|
|
4542
4553
|
G,
|
|
4543
4554
|
{
|
|
4544
|
-
appearance:
|
|
4555
|
+
appearance: f,
|
|
4545
4556
|
cursorHover: !0,
|
|
4546
4557
|
icon: t && n.length > 0 ? /* @__PURE__ */ a(Ot, {}) : /* @__PURE__ */ a(tn, {})
|
|
4547
4558
|
}
|
|
4548
4559
|
),
|
|
4549
4560
|
/* @__PURE__ */ a(mn, { children: /* @__PURE__ */ a(
|
|
4550
|
-
|
|
4561
|
+
Hi,
|
|
4551
4562
|
{
|
|
4552
|
-
"aria-controls":
|
|
4563
|
+
"aria-controls": y,
|
|
4553
4564
|
"aria-expanded": t,
|
|
4554
4565
|
onClick: o,
|
|
4555
|
-
onKeyDown:
|
|
4566
|
+
onKeyDown: p,
|
|
4556
4567
|
children: /* @__PURE__ */ a(
|
|
4557
4568
|
$,
|
|
4558
4569
|
{
|
|
4559
|
-
appearance:
|
|
4570
|
+
appearance: f,
|
|
4560
4571
|
cursorHover: !0,
|
|
4561
4572
|
size: "small",
|
|
4562
4573
|
type: "title",
|
|
4563
|
-
weight:
|
|
4574
|
+
weight: x,
|
|
4564
4575
|
onClick: o,
|
|
4565
4576
|
children: r
|
|
4566
4577
|
}
|
|
@@ -4572,33 +4583,35 @@ const Oi = E.div`
|
|
|
4572
4583
|
)
|
|
4573
4584
|
}
|
|
4574
4585
|
),
|
|
4575
|
-
t && n.length > 0 && /* @__PURE__ */ a(
|
|
4576
|
-
const
|
|
4577
|
-
return /* @__PURE__ */ a(
|
|
4578
|
-
|
|
4586
|
+
t && n.length > 0 && /* @__PURE__ */ a(Wi, { id: y, children: n.map((v) => {
|
|
4587
|
+
const w = v.id === i;
|
|
4588
|
+
return /* @__PURE__ */ a(Bi, { to: v.path, onClick: async (S) => {
|
|
4589
|
+
S.preventDefault(), S.stopPropagation(), await g(v.path, v);
|
|
4590
|
+
}, children: /* @__PURE__ */ a(Ln, { $active: w, children: /* @__PURE__ */ m(
|
|
4591
|
+
T,
|
|
4579
4592
|
{
|
|
4580
4593
|
alignItems: "center",
|
|
4581
4594
|
direction: "row",
|
|
4582
4595
|
gap: "8px",
|
|
4583
|
-
padding:
|
|
4596
|
+
padding: w ? "8px 4px" : "8px 32px",
|
|
4584
4597
|
children: [
|
|
4585
|
-
|
|
4598
|
+
w && /* @__PURE__ */ a(G, { appearance: "primary", icon: /* @__PURE__ */ a(to, {}) }),
|
|
4586
4599
|
/* @__PURE__ */ a(
|
|
4587
4600
|
$,
|
|
4588
4601
|
{
|
|
4589
|
-
appearance:
|
|
4602
|
+
appearance: w ? "primary" : "dark",
|
|
4590
4603
|
size: "small",
|
|
4591
4604
|
type: "title",
|
|
4592
|
-
weight:
|
|
4593
|
-
children:
|
|
4605
|
+
weight: w ? "bold" : "normal",
|
|
4606
|
+
children: v.label
|
|
4594
4607
|
}
|
|
4595
4608
|
)
|
|
4596
4609
|
]
|
|
4597
4610
|
}
|
|
4598
|
-
) }) },
|
|
4611
|
+
) }) }, v.id);
|
|
4599
4612
|
}) })
|
|
4600
4613
|
] }) });
|
|
4601
|
-
},
|
|
4614
|
+
}, Xi = E.div`
|
|
4602
4615
|
& > div {
|
|
4603
4616
|
background: ${({ $background: e, theme: t }) => {
|
|
4604
4617
|
var n, o, r, i;
|
|
@@ -4606,52 +4619,53 @@ const Oi = E.div`
|
|
|
4606
4619
|
}};
|
|
4607
4620
|
}
|
|
4608
4621
|
height: 90vh;
|
|
4609
|
-
`,
|
|
4622
|
+
`, Qi = (e, t) => {
|
|
4610
4623
|
var n;
|
|
4611
4624
|
for (const o of t)
|
|
4612
4625
|
if (o.path && (e === o.path || e.startsWith(o.path + "/")) || (n = o.links) != null && n.some((r) => r.path === e)) return o.id;
|
|
4613
4626
|
return null;
|
|
4614
|
-
},
|
|
4615
|
-
const { collapseOnNavigate: t = !1, defaultOpenId: n = null, groups: o } = e,
|
|
4616
|
-
(
|
|
4617
|
-
var
|
|
4618
|
-
return (
|
|
4627
|
+
}, Ll = (e) => {
|
|
4628
|
+
const { collapseOnNavigate: t = !1, defaultOpenId: n = null, groups: o, onBeforeNavigate: r } = e, i = po(), [s, d] = _.useState(n), l = _.useRef(i.pathname), u = _.useCallback(
|
|
4629
|
+
(c) => {
|
|
4630
|
+
var h;
|
|
4631
|
+
return (h = c.find((g) => g.path === i.pathname)) == null ? void 0 : h.id;
|
|
4619
4632
|
},
|
|
4620
|
-
[
|
|
4621
|
-
),
|
|
4622
|
-
(
|
|
4623
|
-
[
|
|
4633
|
+
[i.pathname]
|
|
4634
|
+
), p = _.useCallback(
|
|
4635
|
+
(c) => !!c && (i.pathname === c || i.pathname.startsWith(c + "/")),
|
|
4636
|
+
[i.pathname]
|
|
4624
4637
|
);
|
|
4625
|
-
return
|
|
4626
|
-
if (!(
|
|
4627
|
-
if (
|
|
4628
|
-
|
|
4638
|
+
return _.useEffect(() => {
|
|
4639
|
+
if (!(l.current !== i.pathname)) return;
|
|
4640
|
+
if (l.current = i.pathname, t) {
|
|
4641
|
+
d(null);
|
|
4629
4642
|
return;
|
|
4630
4643
|
}
|
|
4631
|
-
const
|
|
4632
|
-
if (
|
|
4633
|
-
|
|
4644
|
+
const h = Qi(i.pathname, o);
|
|
4645
|
+
if (h) {
|
|
4646
|
+
d(h);
|
|
4634
4647
|
return;
|
|
4635
4648
|
}
|
|
4636
|
-
n &&
|
|
4637
|
-
}, [t, n, o,
|
|
4638
|
-
|
|
4649
|
+
n && d(n);
|
|
4650
|
+
}, [t, n, o, i.pathname]), /* @__PURE__ */ a(Xi, { $background: !0, children: /* @__PURE__ */ a(T, { direction: "column", gap: "8px", padding: "12px", height: "100%", children: o.map((c) => /* @__PURE__ */ a(
|
|
4651
|
+
Yi,
|
|
4639
4652
|
{
|
|
4640
|
-
activeId:
|
|
4641
|
-
headerPath:
|
|
4642
|
-
headerActive:
|
|
4643
|
-
isOpen:
|
|
4644
|
-
links:
|
|
4645
|
-
onClick: () =>
|
|
4646
|
-
title:
|
|
4653
|
+
activeId: u(c.links),
|
|
4654
|
+
headerPath: c.path,
|
|
4655
|
+
headerActive: p(c.path),
|
|
4656
|
+
isOpen: s === c.id,
|
|
4657
|
+
links: c.links,
|
|
4658
|
+
onClick: () => d((h) => h === c.id ? null : c.id),
|
|
4659
|
+
title: c.title,
|
|
4660
|
+
onBeforeNavigate: r
|
|
4647
4661
|
},
|
|
4648
|
-
|
|
4662
|
+
c.id
|
|
4649
4663
|
)) }) });
|
|
4650
4664
|
};
|
|
4651
4665
|
function K(e) {
|
|
4652
4666
|
e.preventDefault();
|
|
4653
4667
|
}
|
|
4654
|
-
function
|
|
4668
|
+
function Ce(e) {
|
|
4655
4669
|
e.stopPropagation();
|
|
4656
4670
|
}
|
|
4657
4671
|
function On() {
|
|
@@ -4666,7 +4680,7 @@ function On() {
|
|
|
4666
4680
|
}];
|
|
4667
4681
|
}
|
|
4668
4682
|
var [Mn, _n] = On();
|
|
4669
|
-
function
|
|
4683
|
+
function Zi(e, t) {
|
|
4670
4684
|
return e.source === t.source && e.flags.split("").sort().join("") === t.flags.split("").sort().join("");
|
|
4671
4685
|
}
|
|
4672
4686
|
function qe(e, t, n = !0, o = ["__key"]) {
|
|
@@ -4676,7 +4690,7 @@ function qe(e, t, n = !0, o = ["__key"]) {
|
|
|
4676
4690
|
if (e instanceof Date && t instanceof Date)
|
|
4677
4691
|
return e.getTime() === t.getTime();
|
|
4678
4692
|
if (e instanceof RegExp && t instanceof RegExp)
|
|
4679
|
-
return
|
|
4693
|
+
return Zi(e, t);
|
|
4680
4694
|
if (e === null || t === null) return !1;
|
|
4681
4695
|
const r = e, i = t;
|
|
4682
4696
|
if (Object.keys(r).length !== Object.keys(i).length) return !1;
|
|
@@ -4703,7 +4717,7 @@ function Vn() {
|
|
|
4703
4717
|
const e = navigator.userAgent, t = /android|iphone|ipod/i.test(e), n = /iPad/.test(e) || e.includes("Macintosh") && navigator.maxTouchPoints > 1;
|
|
4704
4718
|
return t || n;
|
|
4705
4719
|
}
|
|
4706
|
-
var
|
|
4720
|
+
var Ji = {
|
|
4707
4721
|
affectedNodes: [],
|
|
4708
4722
|
coordinates: {
|
|
4709
4723
|
x: 0,
|
|
@@ -4737,8 +4751,8 @@ var Zi = {
|
|
|
4737
4751
|
scrollDebounceTimeout: void 0,
|
|
4738
4752
|
frameIdX: void 0,
|
|
4739
4753
|
frameIdY: void 0
|
|
4740
|
-
}, b =
|
|
4741
|
-
function
|
|
4754
|
+
}, b = Ji, we = !1, bn, Rt;
|
|
4755
|
+
function Ki() {
|
|
4742
4756
|
b.scrollDebounceTimeout && clearTimeout(b.scrollDebounceTimeout), b.longPressTimeout && clearTimeout(b.longPressTimeout), b.frameIdX !== void 0 && cancelAnimationFrame(b.frameIdX), b.frameIdY !== void 0 && cancelAnimationFrame(b.frameIdY), b = { ...{
|
|
4743
4757
|
affectedNodes: [],
|
|
4744
4758
|
coordinates: {
|
|
@@ -4782,30 +4796,30 @@ function Ji() {
|
|
|
4782
4796
|
function jn(e) {
|
|
4783
4797
|
return Object.assign(b, e), e.initialParent.data.emit("dragStarted", b), we = !1, b.emit("dragStarted", b), b;
|
|
4784
4798
|
}
|
|
4785
|
-
function Ki() {
|
|
4786
|
-
b.activeState && Ee(b.activeState.parent, void 0, b), b.selectedState && Ce(b.selectedState.nodes, b.selectedState.parent, b), b.selectedState = b.activeState = void 0;
|
|
4787
|
-
}
|
|
4788
4799
|
function ea() {
|
|
4800
|
+
b.activeState && Ee(b.activeState.parent, void 0, b), b.selectedState && Se(b.selectedState.nodes, b.selectedState.parent, b), b.selectedState = b.activeState = void 0;
|
|
4801
|
+
}
|
|
4802
|
+
function ta() {
|
|
4789
4803
|
if (b.pointerDown && (b.pointerDown.node.el.draggable = !0), b.pointerDown = void 0, !ae(b)) return;
|
|
4790
4804
|
const e = b.currentParent.data.config;
|
|
4791
4805
|
ae(b) && e.handleEnd(b);
|
|
4792
4806
|
}
|
|
4793
|
-
function ta(e) {
|
|
4794
|
-
e.key === "Escape" && (b.selectedState && Ce(b.selectedState.nodes, b.selectedState.parent, b), b.activeState && Ee(b.activeState.parent, void 0, b), b.selectedState = b.activeState = void 0);
|
|
4795
|
-
}
|
|
4796
4807
|
function na(e) {
|
|
4808
|
+
e.key === "Escape" && (b.selectedState && Se(b.selectedState.nodes, b.selectedState.parent, b), b.activeState && Ee(b.activeState.parent, void 0, b), b.selectedState = b.activeState = void 0);
|
|
4809
|
+
}
|
|
4810
|
+
function oa(e) {
|
|
4797
4811
|
if (!ee(b)) return;
|
|
4798
4812
|
we = !0;
|
|
4799
4813
|
const t = b.initialParent.data.config.handleEnd;
|
|
4800
4814
|
t(b);
|
|
4801
4815
|
}
|
|
4802
|
-
function
|
|
4816
|
+
function ra(e) {
|
|
4803
4817
|
if (!ee(b)) return;
|
|
4804
4818
|
K(e);
|
|
4805
4819
|
const { x: t, y: n } = $e(e);
|
|
4806
4820
|
ee(b) && Tt({ x: t, y: n }, e, b);
|
|
4807
4821
|
}
|
|
4808
|
-
function
|
|
4822
|
+
function ia(e) {
|
|
4809
4823
|
if (!b.pointerDown || !b.pointerDown.validated) return;
|
|
4810
4824
|
const t = b.pointerDown.parent.data.config;
|
|
4811
4825
|
if (!(e.pointerType === "mouse" && !Vn()))
|
|
@@ -4818,7 +4832,7 @@ function ra(e) {
|
|
|
4818
4832
|
}
|
|
4819
4833
|
const n = t.draggedNodes(b.pointerDown);
|
|
4820
4834
|
t.dragstartClasses(b.pointerDown.node, n, t, !0);
|
|
4821
|
-
const o = b.pointerDown.node.el.getBoundingClientRect(), r =
|
|
4835
|
+
const o = b.pointerDown.node.el.getBoundingClientRect(), r = La(
|
|
4822
4836
|
b.pointerDown.node,
|
|
4823
4837
|
b.pointerDown.parent,
|
|
4824
4838
|
e,
|
|
@@ -4829,7 +4843,7 @@ function ra(e) {
|
|
|
4829
4843
|
vn(e, r, !0);
|
|
4830
4844
|
}
|
|
4831
4845
|
}
|
|
4832
|
-
function
|
|
4846
|
+
function aa({
|
|
4833
4847
|
parent: e,
|
|
4834
4848
|
getValues: t,
|
|
4835
4849
|
setValues: n,
|
|
@@ -4838,12 +4852,12 @@ function ia({
|
|
|
4838
4852
|
var l, u, p;
|
|
4839
4853
|
if (!en) return;
|
|
4840
4854
|
bn || (bn = gt(document, {
|
|
4841
|
-
dragover:
|
|
4842
|
-
pointerdown:
|
|
4843
|
-
pointerup:
|
|
4844
|
-
keydown:
|
|
4845
|
-
drop:
|
|
4846
|
-
pointermove:
|
|
4855
|
+
dragover: ra,
|
|
4856
|
+
pointerdown: ea,
|
|
4857
|
+
pointerup: ta,
|
|
4858
|
+
keydown: na,
|
|
4859
|
+
drop: oa,
|
|
4860
|
+
pointermove: ia,
|
|
4847
4861
|
pointercancel: oe(o.handlePointercancel),
|
|
4848
4862
|
touchmove: (c) => {
|
|
4849
4863
|
ee(b) && c.cancelable && K(c);
|
|
@@ -4858,38 +4872,38 @@ function ia({
|
|
|
4858
4872
|
config: {
|
|
4859
4873
|
dragDropEffect: o.dragDropEffect ?? "move",
|
|
4860
4874
|
dragEffectAllowed: o.dragEffectAllowed ?? "move",
|
|
4861
|
-
draggedNodes:
|
|
4862
|
-
dragstartClasses:
|
|
4875
|
+
draggedNodes: ya,
|
|
4876
|
+
dragstartClasses: wa,
|
|
4863
4877
|
handleNodeKeydown: Sa,
|
|
4864
|
-
handleDragstart:
|
|
4865
|
-
handleNodeDragover:
|
|
4866
|
-
handleParentDragover:
|
|
4867
|
-
handleNodeDrop:
|
|
4868
|
-
handleNodeFocus:
|
|
4869
|
-
handleNodeBlur:
|
|
4870
|
-
handlePointercancel:
|
|
4871
|
-
handleEnd:
|
|
4872
|
-
handleDragend:
|
|
4873
|
-
handleParentFocus:
|
|
4874
|
-
handleNodePointerup:
|
|
4875
|
-
handleNodePointerover:
|
|
4876
|
-
handleParentPointerover:
|
|
4877
|
-
handleParentScroll:
|
|
4878
|
-
handleNodePointerdown:
|
|
4879
|
-
handleNodeDragenter:
|
|
4880
|
-
handleNodeDragleave:
|
|
4881
|
-
handleParentDrop:
|
|
4878
|
+
handleDragstart: xa,
|
|
4879
|
+
handleNodeDragover: Ma,
|
|
4880
|
+
handleParentDragover: _a,
|
|
4881
|
+
handleNodeDrop: Na,
|
|
4882
|
+
handleNodeFocus: ka,
|
|
4883
|
+
handleNodeBlur: Aa,
|
|
4884
|
+
handlePointercancel: Fa,
|
|
4885
|
+
handleEnd: $a,
|
|
4886
|
+
handleDragend: Ia,
|
|
4887
|
+
handleParentFocus: sa,
|
|
4888
|
+
handleNodePointerup: Ra,
|
|
4889
|
+
handleNodePointerover: Ea,
|
|
4890
|
+
handleParentPointerover: Pa,
|
|
4891
|
+
handleParentScroll: Ta,
|
|
4892
|
+
handleNodePointerdown: Da,
|
|
4893
|
+
handleNodeDragenter: ja,
|
|
4894
|
+
handleNodeDragleave: Ua,
|
|
4895
|
+
handleParentDrop: ca,
|
|
4882
4896
|
multiDrag: o.multiDrag ?? !1,
|
|
4883
4897
|
nativeDrag: o.nativeDrag ?? !0,
|
|
4884
|
-
performSort:
|
|
4885
|
-
performTransfer:
|
|
4898
|
+
performSort: la,
|
|
4899
|
+
performTransfer: da,
|
|
4886
4900
|
root: o.root ?? document,
|
|
4887
|
-
setupNode:
|
|
4901
|
+
setupNode: pa,
|
|
4888
4902
|
setupNodeRemap: Hn,
|
|
4889
|
-
reapplyDragClasses:
|
|
4890
|
-
tearDownNode:
|
|
4891
|
-
tearDownNodeRemap:
|
|
4892
|
-
remapFinished:
|
|
4903
|
+
reapplyDragClasses: ha,
|
|
4904
|
+
tearDownNode: fa,
|
|
4905
|
+
tearDownNodeRemap: ga,
|
|
4906
|
+
remapFinished: ba,
|
|
4893
4907
|
threshold: {
|
|
4894
4908
|
horizontal: 0,
|
|
4895
4909
|
vertical: 0
|
|
@@ -4902,7 +4916,7 @@ function ia({
|
|
|
4902
4916
|
on: i,
|
|
4903
4917
|
emit: r
|
|
4904
4918
|
};
|
|
4905
|
-
new MutationObserver(
|
|
4919
|
+
new MutationObserver(ma).observe(e, { childList: !0 }), Z.set(e, s), (l = o.plugins) == null || l.forEach((c) => {
|
|
4906
4920
|
var h, g;
|
|
4907
4921
|
(g = (h = c(e)) == null ? void 0 : h.tearDown) == null || g.call(h);
|
|
4908
4922
|
}), (u = o.plugins) == null || u.forEach((c) => {
|
|
@@ -4911,7 +4925,7 @@ function ia({
|
|
|
4911
4925
|
}), (p = o.plugins) == null || p.forEach((c) => {
|
|
4912
4926
|
var h, g;
|
|
4913
4927
|
(g = (h = c(e)) == null ? void 0 : h.setup) == null || g.call(h);
|
|
4914
|
-
}),
|
|
4928
|
+
}), ua(e, s), vt(e, !0);
|
|
4915
4929
|
}
|
|
4916
4930
|
function Un(e, t, n, o, r, i) {
|
|
4917
4931
|
const { x: s, y: d } = $e(n), l = e.el.getBoundingClientRect();
|
|
@@ -4948,7 +4962,7 @@ function Un(e, t, n, o, r, i) {
|
|
|
4948
4962
|
transferred: !1
|
|
4949
4963
|
};
|
|
4950
4964
|
}
|
|
4951
|
-
function
|
|
4965
|
+
function la({
|
|
4952
4966
|
parent: e,
|
|
4953
4967
|
draggedNodes: t,
|
|
4954
4968
|
targetNodes: n
|
|
@@ -4983,7 +4997,7 @@ function Ee(e, t, n) {
|
|
|
4983
4997
|
parent: e
|
|
4984
4998
|
};
|
|
4985
4999
|
}
|
|
4986
|
-
function
|
|
5000
|
+
function Se(e, t, n) {
|
|
4987
5001
|
const o = t.data.config.selectedClass;
|
|
4988
5002
|
if (!n.selectedState) return;
|
|
4989
5003
|
const r = Array.from(e);
|
|
@@ -5006,11 +5020,11 @@ function st(e, t, n, o, r = !1) {
|
|
|
5006
5020
|
parent: e
|
|
5007
5021
|
}, Ee(e, n, o);
|
|
5008
5022
|
}
|
|
5009
|
-
function
|
|
5023
|
+
function sa(e, t) {
|
|
5010
5024
|
const n = e.targetData.parent.data.enabledNodes[0];
|
|
5011
5025
|
n && (t.selectedState && t.selectedState.parent.el !== e.targetData.parent.el ? Ee(e.targetData.parent, n, t) : t.selectedState || Ee(e.targetData.parent, n, t));
|
|
5012
5026
|
}
|
|
5013
|
-
function
|
|
5027
|
+
function da({
|
|
5014
5028
|
currentParent: e,
|
|
5015
5029
|
targetParent: t,
|
|
5016
5030
|
initialParent: n,
|
|
@@ -5050,8 +5064,8 @@ function Fe(e, t) {
|
|
|
5050
5064
|
function Gt(e, t, n) {
|
|
5051
5065
|
t.setValues(n, e);
|
|
5052
5066
|
}
|
|
5053
|
-
function
|
|
5054
|
-
|
|
5067
|
+
function ca(e, t) {
|
|
5068
|
+
Ce(e.e), we = !0;
|
|
5055
5069
|
const n = t.initialParent.data.config.handleEnd;
|
|
5056
5070
|
n(t);
|
|
5057
5071
|
}
|
|
@@ -5065,7 +5079,7 @@ function ee(e) {
|
|
|
5065
5079
|
function ae(e) {
|
|
5066
5080
|
return "synthDragging" in e && !!e.synthDragging;
|
|
5067
5081
|
}
|
|
5068
|
-
function
|
|
5082
|
+
function ua(e, t) {
|
|
5069
5083
|
t.abortControllers.mainParent = gt(e, {
|
|
5070
5084
|
dragover: dt(t.config.handleParentDragover),
|
|
5071
5085
|
handleParentPointerover: t.config.handleParentPointerover,
|
|
@@ -5109,7 +5123,7 @@ function ca(e, t) {
|
|
|
5109
5123
|
}
|
|
5110
5124
|
));
|
|
5111
5125
|
}
|
|
5112
|
-
function
|
|
5126
|
+
function pa(e) {
|
|
5113
5127
|
var n;
|
|
5114
5128
|
const t = e.parent.data.config;
|
|
5115
5129
|
e.node.data.abortControllers.mainNode = gt(e.node.el, {
|
|
@@ -5144,26 +5158,26 @@ function Hn(e) {
|
|
|
5144
5158
|
(r = (o = n(e.parent.el)) == null ? void 0 : o.setupNodeRemap) == null || r.call(o, e);
|
|
5145
5159
|
});
|
|
5146
5160
|
}
|
|
5147
|
-
function
|
|
5161
|
+
function ha(e, t) {
|
|
5148
5162
|
if (!ee(b)) return;
|
|
5149
5163
|
const n = ae(b) ? t.config.synthDropZoneClass : t.config.dropZoneClass;
|
|
5150
5164
|
b.draggedNode.el === e && ke([e], n, !0);
|
|
5151
5165
|
}
|
|
5152
|
-
function
|
|
5166
|
+
function ga(e) {
|
|
5153
5167
|
var t;
|
|
5154
5168
|
(t = e.parent.data.config.plugins) == null || t.forEach((n) => {
|
|
5155
5169
|
var o, r;
|
|
5156
5170
|
(r = (o = n(e.parent.el)) == null ? void 0 : o.tearDownNodeRemap) == null || r.call(o, e);
|
|
5157
5171
|
});
|
|
5158
5172
|
}
|
|
5159
|
-
function
|
|
5173
|
+
function fa(e) {
|
|
5160
5174
|
var t, n, o, r, i;
|
|
5161
5175
|
(t = e.parent.data.config.plugins) == null || t.forEach((s) => {
|
|
5162
5176
|
var d, l;
|
|
5163
5177
|
(l = (d = s(e.parent.el)) == null ? void 0 : d.tearDownNode) == null || l.call(d, e);
|
|
5164
5178
|
}), e.node.el.draggable = !1, (o = (n = e.node.data) == null ? void 0 : n.abortControllers) != null && o.mainNode && ((i = (r = e.node.data) == null ? void 0 : r.abortControllers) == null || i.mainNode.abort());
|
|
5165
5179
|
}
|
|
5166
|
-
function
|
|
5180
|
+
function ma(e) {
|
|
5167
5181
|
if (e.length === 1 && e[0].addedNodes.length === 1 && !(e[0].addedNodes[0] instanceof HTMLElement))
|
|
5168
5182
|
return;
|
|
5169
5183
|
const t = e[0].target;
|
|
@@ -5255,13 +5269,13 @@ function vt(e, t) {
|
|
|
5255
5269
|
(p = (u = l(e)) == null ? void 0 : u.remapFinished) == null || p.call(u);
|
|
5256
5270
|
});
|
|
5257
5271
|
}
|
|
5258
|
-
function
|
|
5272
|
+
function ba() {
|
|
5259
5273
|
b.remapJustFinished = !0, "draggedNode" in b && (b.affectedNodes = []);
|
|
5260
5274
|
}
|
|
5261
|
-
function
|
|
5275
|
+
function va(e) {
|
|
5262
5276
|
return !!e.targetData.parent.data.config.nativeDrag;
|
|
5263
5277
|
}
|
|
5264
|
-
function
|
|
5278
|
+
function ya(e) {
|
|
5265
5279
|
var t;
|
|
5266
5280
|
if (e.parent.data.config.multiDrag) {
|
|
5267
5281
|
if (b.selectedState)
|
|
@@ -5274,14 +5288,14 @@ function va(e) {
|
|
|
5274
5288
|
} else return [e.node];
|
|
5275
5289
|
return [];
|
|
5276
5290
|
}
|
|
5277
|
-
function
|
|
5291
|
+
function Ta(e) {
|
|
5278
5292
|
ee(b) && (b.emit("scrollStarted", b), !ae(b) && (b.preventEnter = !0, Rt && clearTimeout(Rt), Rt = setTimeout(() => {
|
|
5279
5293
|
b.preventEnter = !1, b.emit("scrollEnded", b);
|
|
5280
5294
|
}, 100)));
|
|
5281
5295
|
}
|
|
5282
|
-
function
|
|
5296
|
+
function xa(e, t) {
|
|
5283
5297
|
const n = e.targetData.parent.data.config;
|
|
5284
|
-
if (!n.nativeDrag || !
|
|
5298
|
+
if (!n.nativeDrag || !va(e) || !Gn({
|
|
5285
5299
|
x: e.e.clientX,
|
|
5286
5300
|
y: e.e.clientY,
|
|
5287
5301
|
node: e.targetData.node,
|
|
@@ -5295,7 +5309,7 @@ function Ta(e, t) {
|
|
|
5295
5309
|
node: e.targetData.node
|
|
5296
5310
|
});
|
|
5297
5311
|
o.length === 0 && (o = [e.targetData.node]), n.dragstartClasses(e.targetData.node, o, n);
|
|
5298
|
-
const r =
|
|
5312
|
+
const r = Ca(e, o);
|
|
5299
5313
|
if (n.onDragstart) {
|
|
5300
5314
|
const i = {
|
|
5301
5315
|
parent: e.targetData.parent,
|
|
@@ -5311,9 +5325,9 @@ function Ta(e, t) {
|
|
|
5311
5325
|
n.onDragstart(i);
|
|
5312
5326
|
}
|
|
5313
5327
|
}
|
|
5314
|
-
function
|
|
5328
|
+
function Da(e, t) {
|
|
5315
5329
|
var d, l;
|
|
5316
|
-
if (
|
|
5330
|
+
if (Ce(e.e), t.pointerDown = {
|
|
5317
5331
|
parent: e.targetData.parent,
|
|
5318
5332
|
node: e.targetData.node,
|
|
5319
5333
|
validated: !1
|
|
@@ -5324,7 +5338,7 @@ function xa(e, t) {
|
|
|
5324
5338
|
config: e.targetData.parent.data.config
|
|
5325
5339
|
}))
|
|
5326
5340
|
return;
|
|
5327
|
-
t.pointerDown.validated = !0,
|
|
5341
|
+
t.pointerDown.validated = !0, Oa(e, t, e.targetData.node);
|
|
5328
5342
|
const n = e.targetData.parent.data;
|
|
5329
5343
|
let o = [e.targetData.node];
|
|
5330
5344
|
const r = e.e.ctrlKey || e.e.metaKey, i = e.e.shiftKey, s = e.targetData.node;
|
|
@@ -5346,7 +5360,7 @@ function xa(e, t) {
|
|
|
5346
5360
|
const u = e.targetData.parent.data.enabledNodes;
|
|
5347
5361
|
if (t.selectedState && t.activeState)
|
|
5348
5362
|
if (t.selectedState.parent.el !== e.targetData.parent.el) {
|
|
5349
|
-
|
|
5363
|
+
Se(t.selectedState.nodes, t.selectedState.parent, t), t.selectedState = void 0;
|
|
5350
5364
|
for (let p = 0; p <= s.data.index; p++)
|
|
5351
5365
|
o.push(u[p]);
|
|
5352
5366
|
} else {
|
|
@@ -5373,7 +5387,7 @@ function xa(e, t) {
|
|
|
5373
5387
|
}
|
|
5374
5388
|
(l = (d = t.selectedState) == null ? void 0 : d.nodes) != null && l.length ? t.selectedState.nodes.findIndex(
|
|
5375
5389
|
(p) => p.el === e.targetData.node.el
|
|
5376
|
-
) === -1 && (t.selectedState.parent.el !== e.targetData.parent.el ?
|
|
5390
|
+
) === -1 && (t.selectedState.parent.el !== e.targetData.parent.el ? Se(t.selectedState.nodes, e.targetData.parent, t) : n.config.multiDrag && Vn() ? o.push(...t.selectedState.nodes) : Se(t.selectedState.nodes, e.targetData.parent, t), st(
|
|
5377
5391
|
e.targetData.parent,
|
|
5378
5392
|
o,
|
|
5379
5393
|
e.targetData.node,
|
|
@@ -5387,7 +5401,7 @@ function xa(e, t) {
|
|
|
5387
5401
|
!0
|
|
5388
5402
|
);
|
|
5389
5403
|
}
|
|
5390
|
-
function
|
|
5404
|
+
function wa(e, t, n, o = !1) {
|
|
5391
5405
|
ke(
|
|
5392
5406
|
t.map((r) => r.el),
|
|
5393
5407
|
o ? n.synthDraggingClass : n.draggingClass
|
|
@@ -5407,8 +5421,8 @@ function Da(e, t, n, o = !1) {
|
|
|
5407
5421
|
);
|
|
5408
5422
|
});
|
|
5409
5423
|
}
|
|
5410
|
-
function
|
|
5411
|
-
|
|
5424
|
+
function Ca(e, t) {
|
|
5425
|
+
Ce(e.e);
|
|
5412
5426
|
const n = jn(
|
|
5413
5427
|
Un(
|
|
5414
5428
|
e.targetData.node,
|
|
@@ -5480,30 +5494,30 @@ function Gn({
|
|
|
5480
5494
|
}
|
|
5481
5495
|
function Sa(e) {
|
|
5482
5496
|
}
|
|
5483
|
-
function
|
|
5497
|
+
function Ea(e) {
|
|
5484
5498
|
e.detail.targetData.parent.el === e.detail.state.currentParent.el ? qn(e.detail, e.detail.state) : yt(e.detail, e.detail.state);
|
|
5485
5499
|
}
|
|
5486
|
-
function
|
|
5500
|
+
function Na(e, t) {
|
|
5487
5501
|
const n = e.targetData.parent.data.config;
|
|
5488
|
-
n.nativeDrag && (
|
|
5502
|
+
n.nativeDrag && (Ce(e.e), we = !0, n.handleEnd(t));
|
|
5489
5503
|
}
|
|
5490
|
-
function
|
|
5504
|
+
function ka(e) {
|
|
5491
5505
|
e.e.target !== e.e.currentTarget && b.pointerDown && (b.pointerDown.node.el.draggable = !1);
|
|
5492
5506
|
}
|
|
5493
|
-
function
|
|
5507
|
+
function Aa(e) {
|
|
5494
5508
|
e.e.target !== e.e.currentTarget && b.pointerDown && (b.pointerDown.node.el.draggable = !0);
|
|
5495
5509
|
}
|
|
5496
|
-
function
|
|
5510
|
+
function Ia(e, t) {
|
|
5497
5511
|
const n = e.targetData.parent.data.config;
|
|
5498
5512
|
if (n.nativeDrag) {
|
|
5499
|
-
if (K(e.e),
|
|
5513
|
+
if (K(e.e), Ce(e.e), we) {
|
|
5500
5514
|
we = !1;
|
|
5501
5515
|
return;
|
|
5502
5516
|
}
|
|
5503
5517
|
n.handleEnd(t);
|
|
5504
5518
|
}
|
|
5505
5519
|
}
|
|
5506
|
-
function
|
|
5520
|
+
function Fa(e, t) {
|
|
5507
5521
|
var o;
|
|
5508
5522
|
if (!ae(t)) return;
|
|
5509
5523
|
if (K(e.e), we) {
|
|
@@ -5519,13 +5533,13 @@ function Ia(e, t) {
|
|
|
5519
5533
|
state: t
|
|
5520
5534
|
}), n == null || n.handleEnd(t);
|
|
5521
5535
|
}
|
|
5522
|
-
function
|
|
5536
|
+
function $a(e) {
|
|
5523
5537
|
var p, c, h, g, f;
|
|
5524
5538
|
e.draggedNode && (e.draggedNode.el.draggable = !0);
|
|
5525
|
-
const t = e.draggedNodes.map((
|
|
5539
|
+
const t = e.draggedNodes.map((x) => x.el), n = e.initialParent.data, o = ae(e), r = (p = Z.get(e.initialParent.el)) == null ? void 0 : p.config, i = o ? r == null ? void 0 : r.synthDropZoneClass : r == null ? void 0 : r.dropZoneClass, s = (c = n == null ? void 0 : n.config) == null ? void 0 : c.longPressClass, d = o ? (h = n == null ? void 0 : n.config) == null ? void 0 : h.synthDragPlaceholderClass : (g = n == null ? void 0 : n.config) == null ? void 0 : g.dragPlaceholderClass, l = e.originalZIndex;
|
|
5526
5540
|
ae(e) && (e.clonedDraggedNode && e.clonedDraggedNode.remove(), e.longPressTimeout && clearTimeout(e.longPressTimeout)), Bt(e), e.lastScrollDirectionX = void 0, e.lastScrollDirectionY = void 0, e.preventEnter = !1, e.scrollDebounceTimeout && (clearTimeout(e.scrollDebounceTimeout), e.scrollDebounceTimeout = void 0), l !== void 0 && e.draggedNode && (e.draggedNode.el.style.zIndex = l), requestAnimationFrame(() => {
|
|
5527
5541
|
De(t, i), De(t, s), De(t, d);
|
|
5528
|
-
}),
|
|
5542
|
+
}), Se(e.draggedNodes, e.currentParent, e), Ee(e.currentParent, void 0, e);
|
|
5529
5543
|
const u = { ...e };
|
|
5530
5544
|
(f = r == null ? void 0 : r.onDragend) == null || f.call(r, {
|
|
5531
5545
|
parent: u.currentParent,
|
|
@@ -5536,18 +5550,18 @@ function Fa(e) {
|
|
|
5536
5550
|
draggedNode: u.draggedNode,
|
|
5537
5551
|
draggedNodes: u.draggedNodes,
|
|
5538
5552
|
state: u
|
|
5539
|
-
}), e.emit("dragEnded", u),
|
|
5553
|
+
}), e.emit("dragEnded", u), Ki();
|
|
5540
5554
|
}
|
|
5541
|
-
function
|
|
5542
|
-
|
|
5555
|
+
function Ra(e, t) {
|
|
5556
|
+
Ce(e.e), !t.pointerSelection && t.selectedState && Se(t.selectedState.nodes, e.targetData.parent, t);
|
|
5543
5557
|
const n = e.targetData.parent.data.config;
|
|
5544
5558
|
t.pointerSelection = !1, "longPressTimeout" in t && t.longPressTimeout && clearTimeout(t.longPressTimeout), t.longPress = !1, De(
|
|
5545
5559
|
e.targetData.parent.data.enabledNodes.map((o) => o.el),
|
|
5546
5560
|
n.longPressClass
|
|
5547
5561
|
), ee(t) && n.handleEnd(t);
|
|
5548
5562
|
}
|
|
5549
|
-
function
|
|
5550
|
-
var f,
|
|
5563
|
+
function La(e, t, n, o, r, i) {
|
|
5564
|
+
var f, x;
|
|
5551
5565
|
const s = t.data.config;
|
|
5552
5566
|
let d, l;
|
|
5553
5567
|
const u = [
|
|
@@ -5578,13 +5592,13 @@ function Ra(e, t, n, o, r, i) {
|
|
|
5578
5592
|
"height",
|
|
5579
5593
|
"boxSizing",
|
|
5580
5594
|
"overflow"
|
|
5581
|
-
], p = (
|
|
5582
|
-
const
|
|
5583
|
-
u.forEach((
|
|
5584
|
-
|
|
5595
|
+
], p = (y, v) => {
|
|
5596
|
+
const w = window.getComputedStyle(y);
|
|
5597
|
+
u.forEach((S) => {
|
|
5598
|
+
v.style[S] = w[S];
|
|
5585
5599
|
});
|
|
5586
|
-
}, c = (
|
|
5587
|
-
Object.assign(
|
|
5600
|
+
}, c = (y, v = {}) => {
|
|
5601
|
+
Object.assign(y.style, {
|
|
5588
5602
|
position: "absolute",
|
|
5589
5603
|
zIndex: "9999",
|
|
5590
5604
|
pointerEvents: "none",
|
|
@@ -5594,7 +5608,7 @@ function Ra(e, t, n, o, r, i) {
|
|
|
5594
5608
|
overflow: "hidden",
|
|
5595
5609
|
width: `${i.width}px`,
|
|
5596
5610
|
height: `${i.height}px`,
|
|
5597
|
-
...
|
|
5611
|
+
...v
|
|
5598
5612
|
});
|
|
5599
5613
|
};
|
|
5600
5614
|
if (s.synthDragImage)
|
|
@@ -5602,11 +5616,11 @@ function Ra(e, t, n, o, r, i) {
|
|
|
5602
5616
|
else if (!s.multiDrag || r.length === 1)
|
|
5603
5617
|
d = e.el.cloneNode(!0), p(e.el, d), d.setAttribute("popover", "manual"), c(d);
|
|
5604
5618
|
else {
|
|
5605
|
-
const
|
|
5606
|
-
|
|
5607
|
-
const
|
|
5608
|
-
p(
|
|
5609
|
-
}),
|
|
5619
|
+
const y = document.createElement("div");
|
|
5620
|
+
y.setAttribute("popover", "manual"), r.forEach((v) => {
|
|
5621
|
+
const w = v.el.cloneNode(!0);
|
|
5622
|
+
p(v.el, w), w.style.pointerEvents = "none", w.style.margin = "0", y.append(w);
|
|
5623
|
+
}), y.style.display = "flex", y.style.flexDirection = "column", y.style.padding = "0", y.style.margin = "0", y.style.position = "absolute", y.style.zIndex = "9999", y.style.pointerEvents = "none", d = y;
|
|
5610
5624
|
}
|
|
5611
5625
|
d.id = "dnd-dragged-node-clone", t.el.appendChild(d), d.showPopover();
|
|
5612
5626
|
const h = {
|
|
@@ -5615,7 +5629,7 @@ function Ra(e, t, n, o, r, i) {
|
|
|
5615
5629
|
synthDragScrolling: !1,
|
|
5616
5630
|
synthDragging: !0,
|
|
5617
5631
|
rootScrollWidth: (f = document.scrollingElement) == null ? void 0 : f.scrollWidth,
|
|
5618
|
-
rootScrollHeight: (
|
|
5632
|
+
rootScrollHeight: (x = document.scrollingElement) == null ? void 0 : x.scrollHeight
|
|
5619
5633
|
};
|
|
5620
5634
|
return jn({
|
|
5621
5635
|
...Un(
|
|
@@ -5629,7 +5643,7 @@ function Ra(e, t, n, o, r, i) {
|
|
|
5629
5643
|
...h
|
|
5630
5644
|
});
|
|
5631
5645
|
}
|
|
5632
|
-
function
|
|
5646
|
+
function Oa(e, t, n) {
|
|
5633
5647
|
const o = e.targetData.parent.data.config;
|
|
5634
5648
|
t.longPressTimeout = setTimeout(() => {
|
|
5635
5649
|
t && (t.longPress = !0, o.longPressClass && e.e.cancelable && ke([n.el], o.longPressClass), K(e.e));
|
|
@@ -5651,7 +5665,7 @@ function vn(e, t, n = !1) {
|
|
|
5651
5665
|
t.coordinates.x = o.x, t.coordinates.y = o.y, Bn(t, n), t.scrollDebounceTimeout && (clearTimeout(t.scrollDebounceTimeout), t.scrollDebounceTimeout = void 0), t.scrollDebounceTimeout = setTimeout(() => {
|
|
5652
5666
|
ae(t) && Tt(t.coordinates, e, t);
|
|
5653
5667
|
}, 16);
|
|
5654
|
-
const r =
|
|
5668
|
+
const r = Ba(o);
|
|
5655
5669
|
if (!r) {
|
|
5656
5670
|
document.dispatchEvent(
|
|
5657
5671
|
new CustomEvent("handleRootPointerover", {
|
|
@@ -5678,22 +5692,22 @@ function vn(e, t, n = !1) {
|
|
|
5678
5692
|
})
|
|
5679
5693
|
);
|
|
5680
5694
|
}
|
|
5681
|
-
function
|
|
5695
|
+
function Ma(e, t) {
|
|
5682
5696
|
var i;
|
|
5683
5697
|
if (!e.targetData.parent.data.config.nativeDrag) return;
|
|
5684
5698
|
const { x: o, y: r } = $e(e.e);
|
|
5685
|
-
t.coordinates.y = r, t.coordinates.x = o, K(e.e),
|
|
5699
|
+
t.coordinates.y = r, t.coordinates.x = o, K(e.e), Ce(e.e), ee(t) && Tt({ x: o, y: r }, e.e, t), e.targetData.parent.el === ((i = t.currentParent) == null ? void 0 : i.el) ? qn(e, t) : yt(e, t);
|
|
5686
5700
|
}
|
|
5687
|
-
function
|
|
5701
|
+
function _a(e, t) {
|
|
5688
5702
|
if (!e.targetData.parent.data.config.nativeDrag) return;
|
|
5689
|
-
K(e.e),
|
|
5703
|
+
K(e.e), Ce(e.e);
|
|
5690
5704
|
const { x: o, y: r } = $e(e.e);
|
|
5691
5705
|
ee(t) && Tt({ x: o, y: r }, e.e, t), yt(e, t);
|
|
5692
5706
|
}
|
|
5693
|
-
function
|
|
5707
|
+
function Pa(e) {
|
|
5694
5708
|
e.detail.targetData.parent.el !== e.detail.state.currentParent.el && yt(e.detail, e.detail.state);
|
|
5695
5709
|
}
|
|
5696
|
-
function
|
|
5710
|
+
function Va({
|
|
5697
5711
|
currentParent: e,
|
|
5698
5712
|
targetParent: t,
|
|
5699
5713
|
initialParent: n,
|
|
@@ -5711,13 +5725,13 @@ function Pa({
|
|
|
5711
5725
|
r
|
|
5712
5726
|
) : !(!i.group || i.group !== s.group);
|
|
5713
5727
|
}
|
|
5714
|
-
function
|
|
5728
|
+
function ja(e, t) {
|
|
5715
5729
|
K(e.e);
|
|
5716
5730
|
}
|
|
5717
|
-
function
|
|
5731
|
+
function Ua(e, t) {
|
|
5718
5732
|
K(e.e);
|
|
5719
5733
|
}
|
|
5720
|
-
function
|
|
5734
|
+
function za(e, t, n, o) {
|
|
5721
5735
|
var p;
|
|
5722
5736
|
if (t.affectedNodes.map((c) => c.data.value).includes(e.targetData.node.data.value))
|
|
5723
5737
|
return !1;
|
|
@@ -5753,7 +5767,7 @@ function Ua(e, t, n, o) {
|
|
|
5753
5767
|
}
|
|
5754
5768
|
function qn(e, t) {
|
|
5755
5769
|
const { x: n, y: o } = $e(e.e);
|
|
5756
|
-
if (!
|
|
5770
|
+
if (!za(e, t, n, o))
|
|
5757
5771
|
return;
|
|
5758
5772
|
const r = t.draggedNode.data.index > e.targetData.node.data.index ? [e.targetData.node.data.index, t.draggedNode.data.index] : [t.draggedNode.data.index, e.targetData.node.data.index];
|
|
5759
5773
|
t.targetIndex = e.targetData.node.data.index, t.affectedNodes = e.targetData.parent.data.enabledNodes.filter(
|
|
@@ -5794,7 +5808,7 @@ function oe(e) {
|
|
|
5794
5808
|
};
|
|
5795
5809
|
}
|
|
5796
5810
|
function yt(e, t) {
|
|
5797
|
-
K(e.e),
|
|
5811
|
+
K(e.e), Va({
|
|
5798
5812
|
currentParent: t.currentParent,
|
|
5799
5813
|
targetParent: e.targetData.parent,
|
|
5800
5814
|
initialParent: t.initialParent,
|
|
@@ -5838,11 +5852,11 @@ function ke(e, t, n = !1) {
|
|
|
5838
5852
|
fe.set(r, i);
|
|
5839
5853
|
}
|
|
5840
5854
|
for (const r of e) {
|
|
5841
|
-
const i = fe.get(r), s =
|
|
5855
|
+
const i = fe.get(r), s = Ha(r, t, i, n);
|
|
5842
5856
|
s && o(r, s);
|
|
5843
5857
|
}
|
|
5844
5858
|
}
|
|
5845
|
-
function
|
|
5859
|
+
function Ha(e, t, n, o = !1) {
|
|
5846
5860
|
if (!t) return;
|
|
5847
5861
|
const r = Pn(t);
|
|
5848
5862
|
if (!r.length) return;
|
|
@@ -5877,28 +5891,28 @@ function De(e, t) {
|
|
|
5877
5891
|
function yn(e, t, n, o, r) {
|
|
5878
5892
|
const s = r.axis === "x", d = e === document.scrollingElement, l = s ? "scrollLeft" : "scrollTop", u = s ? "clientWidth" : "clientHeight", p = s ? "offsetWidth" : "offsetHeight", c = s ? "scrollWidth" : "scrollHeight", h = s ? t.clientX : t.clientY, g = s ? o.left : o.top, f = s ? n.overflowX : n.overflowY;
|
|
5879
5893
|
if (d) {
|
|
5880
|
-
const
|
|
5894
|
+
const x = e[l], y = e[u], v = x > 0, w = x + y < (s ? r.state.rootScrollWidth || 0 : e[c]);
|
|
5881
5895
|
return s ? {
|
|
5882
|
-
left:
|
|
5883
|
-
right:
|
|
5896
|
+
left: v && h < y * 0.075,
|
|
5897
|
+
right: w && h > y * (1 - 0.075)
|
|
5884
5898
|
} : {
|
|
5885
|
-
up:
|
|
5886
|
-
down:
|
|
5899
|
+
up: v && h < y * 0.075,
|
|
5900
|
+
down: w && h > y * (1 - 0.075)
|
|
5887
5901
|
};
|
|
5888
5902
|
}
|
|
5889
5903
|
if ((f === "auto" || f === "scroll") && e !== document.body && e !== document.documentElement) {
|
|
5890
|
-
const
|
|
5904
|
+
const x = e[c], y = e[p], v = e[l], w = v > 0, S = v < x - y;
|
|
5891
5905
|
return s ? {
|
|
5892
|
-
left:
|
|
5893
|
-
right:
|
|
5906
|
+
left: w && h < g + y * 0.075,
|
|
5907
|
+
right: S && h > g + y * (1 - 0.075)
|
|
5894
5908
|
} : {
|
|
5895
|
-
up:
|
|
5896
|
-
down:
|
|
5909
|
+
up: w && h < g + y * 0.075,
|
|
5910
|
+
down: S && h > g + y * (1 - 0.075)
|
|
5897
5911
|
};
|
|
5898
5912
|
}
|
|
5899
5913
|
return s ? { left: !1, right: !1 } : { up: !1, down: !1 };
|
|
5900
5914
|
}
|
|
5901
|
-
function
|
|
5915
|
+
function Ga(e, t, n, o) {
|
|
5902
5916
|
if (!ee(n) || !n.draggedNode)
|
|
5903
5917
|
return;
|
|
5904
5918
|
n.preventEnter = !0;
|
|
@@ -5909,8 +5923,8 @@ function Ha(e, t, n, o) {
|
|
|
5909
5923
|
n[l] !== void 0 && (cancelAnimationFrame(n[l]), n[l] = void 0);
|
|
5910
5924
|
return;
|
|
5911
5925
|
}
|
|
5912
|
-
const p = r ? "scrollLeft" : "scrollTop", c = r ? "clientWidth" : "clientHeight", h = r ? "scrollWidth" : "scrollHeight", g = e[p], f = e[c],
|
|
5913
|
-
if (!(i > 0 ? g + f <
|
|
5926
|
+
const p = r ? "scrollLeft" : "scrollTop", c = r ? "clientWidth" : "clientHeight", h = r ? "scrollWidth" : "scrollHeight", g = e[p], f = e[c], x = e[h];
|
|
5927
|
+
if (!(i > 0 ? g + f < x : g > 0)) {
|
|
5914
5928
|
n[l] = void 0, n[d] = void 0;
|
|
5915
5929
|
return;
|
|
5916
5930
|
}
|
|
@@ -5929,7 +5943,7 @@ function Tt(e, t, n) {
|
|
|
5929
5943
|
const { x: o, y: r } = e;
|
|
5930
5944
|
let i = !1;
|
|
5931
5945
|
const s = (l, u, p) => {
|
|
5932
|
-
|
|
5946
|
+
Ga(p, t, n, { axis: l, direction: u }), i = !0;
|
|
5933
5947
|
}, d = (l) => {
|
|
5934
5948
|
const u = window.getComputedStyle(l), p = l.getBoundingClientRect(), c = yn(l, t, u, p, {
|
|
5935
5949
|
axis: "x",
|
|
@@ -5948,7 +5962,7 @@ function Tt(e, t, n) {
|
|
|
5948
5962
|
}
|
|
5949
5963
|
i || Bt(n);
|
|
5950
5964
|
}
|
|
5951
|
-
function
|
|
5965
|
+
function Ba(e) {
|
|
5952
5966
|
let t = document.elementFromPoint(e.x, e.y);
|
|
5953
5967
|
if (!xt(t)) return;
|
|
5954
5968
|
let n, o = !0;
|
|
@@ -5998,37 +6012,37 @@ function gt(e, t) {
|
|
|
5998
6012
|
}
|
|
5999
6013
|
return n;
|
|
6000
6014
|
}
|
|
6001
|
-
function
|
|
6015
|
+
function qa(e) {
|
|
6002
6016
|
if (e instanceof HTMLElement) return e;
|
|
6003
6017
|
if ("current" in e && e.current instanceof HTMLElement)
|
|
6004
6018
|
return e.current;
|
|
6005
6019
|
console.warn("Invalid parent element", e);
|
|
6006
6020
|
}
|
|
6007
|
-
function
|
|
6008
|
-
const n =
|
|
6021
|
+
function Wa(e, t) {
|
|
6022
|
+
const n = qa(e);
|
|
6009
6023
|
n && t(n);
|
|
6010
6024
|
}
|
|
6011
6025
|
var ft = /* @__PURE__ */ new WeakMap();
|
|
6012
|
-
function
|
|
6026
|
+
function Ya(e) {
|
|
6013
6027
|
const t = ft.get(e);
|
|
6014
6028
|
return t ? t[0] : (console.warn("No values found for parent element"), []);
|
|
6015
6029
|
}
|
|
6016
|
-
function
|
|
6030
|
+
function Xa(e, t) {
|
|
6017
6031
|
const n = ft.get(t);
|
|
6018
6032
|
n && n[1](e), ft.set(t, [e, n[1]]);
|
|
6019
6033
|
}
|
|
6020
|
-
function
|
|
6034
|
+
function Qa(e, t) {
|
|
6021
6035
|
return (n) => {
|
|
6022
|
-
ft.set(n, t),
|
|
6036
|
+
ft.set(n, t), aa({ parent: n, getValues: Ya, setValues: Xa, config: e });
|
|
6023
6037
|
};
|
|
6024
6038
|
}
|
|
6025
6039
|
function xn(e) {
|
|
6026
6040
|
en && (Array.isArray(e) || (e = [e]), e.forEach((t) => {
|
|
6027
6041
|
const { parent: n, state: o, ...r } = t;
|
|
6028
|
-
|
|
6042
|
+
Wa(n, Qa(r, o));
|
|
6029
6043
|
}));
|
|
6030
6044
|
}
|
|
6031
|
-
function
|
|
6045
|
+
function Za(e, t = {}) {
|
|
6032
6046
|
const n = je(null), [o, r] = B(e);
|
|
6033
6047
|
function i(s = {}) {
|
|
6034
6048
|
xn({ parent: n, state: [o, r], ...s });
|
|
@@ -6048,7 +6062,7 @@ const Dn = {
|
|
|
6048
6062
|
color: I.palette.neutral.N40
|
|
6049
6063
|
}
|
|
6050
6064
|
}
|
|
6051
|
-
},
|
|
6065
|
+
}, Ja = E.ul`
|
|
6052
6066
|
list-style: none;
|
|
6053
6067
|
padding: 0;
|
|
6054
6068
|
margin: 0;
|
|
@@ -6057,7 +6071,7 @@ const Dn = {
|
|
|
6057
6071
|
gap: 12px;
|
|
6058
6072
|
width: 100%;
|
|
6059
6073
|
justify-content: ${({ $isEmpty: e }) => e ? "center" : "flex-start"};
|
|
6060
|
-
`,
|
|
6074
|
+
`, Ka = E.li`
|
|
6061
6075
|
& > div {
|
|
6062
6076
|
border: 1px solid
|
|
6063
6077
|
${({ theme: e, $active: t }) => {
|
|
@@ -6075,48 +6089,48 @@ const Dn = {
|
|
|
6075
6089
|
highlightFirst: s,
|
|
6076
6090
|
onMove: d,
|
|
6077
6091
|
locked: l = !1
|
|
6078
|
-
} = e, u =
|
|
6092
|
+
} = e, u = _.useRef(null), p = l ? [u, i] : Za(i, { group: o }), [c, h] = p, [g, f] = _.useState(
|
|
6079
6093
|
null
|
|
6080
|
-
),
|
|
6081
|
-
|
|
6094
|
+
), x = _.useRef(i);
|
|
6095
|
+
_.useEffect(() => {
|
|
6082
6096
|
if (l) return;
|
|
6083
|
-
const N = (
|
|
6084
|
-
const A =
|
|
6097
|
+
const N = (C) => {
|
|
6098
|
+
const A = C.detail ?? null;
|
|
6085
6099
|
f(A);
|
|
6086
6100
|
};
|
|
6087
6101
|
return window.addEventListener(Lt, N), () => window.removeEventListener(Lt, N);
|
|
6088
6102
|
}, [l]);
|
|
6089
|
-
const
|
|
6103
|
+
const y = _.useCallback((N) => {
|
|
6090
6104
|
l || window.dispatchEvent(
|
|
6091
6105
|
new CustomEvent(Lt, { detail: N })
|
|
6092
6106
|
);
|
|
6093
|
-
}, [l]),
|
|
6107
|
+
}, [l]), v = (N) => {
|
|
6094
6108
|
var F;
|
|
6095
6109
|
if (l) return;
|
|
6096
|
-
const
|
|
6097
|
-
R && (f(R),
|
|
6098
|
-
},
|
|
6099
|
-
l || (f(null),
|
|
6100
|
-
}, [
|
|
6101
|
-
|
|
6110
|
+
const C = N.target, A = (F = C == null ? void 0 : C.closest) == null ? void 0 : F.call(C, "li.dnd-item"), R = (A == null ? void 0 : A.getAttribute("data-label")) || null;
|
|
6111
|
+
R && (f(R), y(R));
|
|
6112
|
+
}, w = _.useCallback(() => {
|
|
6113
|
+
l || (f(null), y(null));
|
|
6114
|
+
}, [y, l]);
|
|
6115
|
+
_.useEffect(() => {
|
|
6102
6116
|
if (l) return;
|
|
6103
|
-
const N = () =>
|
|
6117
|
+
const N = () => w();
|
|
6104
6118
|
return window.addEventListener("pointerup", N), window.addEventListener("blur", N), () => {
|
|
6105
6119
|
window.removeEventListener("pointerup", N), window.removeEventListener("blur", N);
|
|
6106
6120
|
};
|
|
6107
|
-
}, [
|
|
6121
|
+
}, [w, l]), _.useEffect(() => {
|
|
6108
6122
|
if (l) return;
|
|
6109
|
-
const N =
|
|
6123
|
+
const N = x.current;
|
|
6110
6124
|
if (h.length !== N.length && h.length === N.length + 1) {
|
|
6111
|
-
const
|
|
6125
|
+
const C = new Set(N), A = h.find((R) => !C.has(R)) || null;
|
|
6112
6126
|
if (A) {
|
|
6113
6127
|
const R = n === "left" ? "right" : "left";
|
|
6114
6128
|
d == null || d({ item: A, from: R, to: n });
|
|
6115
6129
|
}
|
|
6116
6130
|
}
|
|
6117
|
-
|
|
6131
|
+
x.current = h;
|
|
6118
6132
|
}, [h, n, d, l]);
|
|
6119
|
-
const
|
|
6133
|
+
const S = h.length === 0;
|
|
6120
6134
|
return /* @__PURE__ */ a(
|
|
6121
6135
|
Ve,
|
|
6122
6136
|
{
|
|
@@ -6125,17 +6139,17 @@ const Dn = {
|
|
|
6125
6139
|
height: "-webkit-fill-available",
|
|
6126
6140
|
spacing: "wide",
|
|
6127
6141
|
children: /* @__PURE__ */ a(
|
|
6128
|
-
|
|
6142
|
+
Ja,
|
|
6129
6143
|
{
|
|
6130
6144
|
ref: c,
|
|
6131
|
-
onPointerDownCapture: l ? void 0 :
|
|
6132
|
-
onPointerUpCapture: l ? void 0 :
|
|
6133
|
-
onPointerCancelCapture: l ? void 0 :
|
|
6134
|
-
$isEmpty:
|
|
6145
|
+
onPointerDownCapture: l ? void 0 : v,
|
|
6146
|
+
onPointerUpCapture: l ? void 0 : w,
|
|
6147
|
+
onPointerCancelCapture: l ? void 0 : w,
|
|
6148
|
+
$isEmpty: S,
|
|
6135
6149
|
$locked: l,
|
|
6136
6150
|
"aria-disabled": l,
|
|
6137
6151
|
"data-locked": l || void 0,
|
|
6138
|
-
children:
|
|
6152
|
+
children: S ? /* @__PURE__ */ a(
|
|
6139
6153
|
ce,
|
|
6140
6154
|
{
|
|
6141
6155
|
background: !0,
|
|
@@ -6145,14 +6159,14 @@ const Dn = {
|
|
|
6145
6159
|
justifyContent: "center",
|
|
6146
6160
|
children: /* @__PURE__ */ a($, { type: "label", size: "medium", appearance: "gray", padding: "12px", children: t || "No hay elementos en esta lista" })
|
|
6147
6161
|
}
|
|
6148
|
-
) : h.map((N,
|
|
6162
|
+
) : h.map((N, C) => {
|
|
6149
6163
|
const A = !l && g === N;
|
|
6150
6164
|
return /* @__PURE__ */ a(
|
|
6151
|
-
|
|
6165
|
+
Ka,
|
|
6152
6166
|
{
|
|
6153
6167
|
className: `dnd-item${A ? " is-dragging" : ""}`,
|
|
6154
6168
|
"data-label": N,
|
|
6155
|
-
"data-first": !!(s &&
|
|
6169
|
+
"data-first": !!(s && C === 0) || void 0,
|
|
6156
6170
|
$active: A,
|
|
6157
6171
|
children: /* @__PURE__ */ a(ce, { border: !0, borderRadius: "8px", width: "100%", children: /* @__PURE__ */ a(
|
|
6158
6172
|
$,
|
|
@@ -6173,12 +6187,12 @@ const Dn = {
|
|
|
6173
6187
|
)
|
|
6174
6188
|
}
|
|
6175
6189
|
);
|
|
6176
|
-
},
|
|
6190
|
+
}, Ol = (e) => {
|
|
6177
6191
|
const { group: t = "clients", left: n, right: o, onMove: r, locked: i = !1 } = e, s = (d) => {
|
|
6178
6192
|
i || r == null || r(d);
|
|
6179
6193
|
};
|
|
6180
6194
|
return /* @__PURE__ */ m(
|
|
6181
|
-
|
|
6195
|
+
T,
|
|
6182
6196
|
{
|
|
6183
6197
|
justifyContent: "space-between",
|
|
6184
6198
|
alignItems: "start",
|
|
@@ -6214,7 +6228,7 @@ const Dn = {
|
|
|
6214
6228
|
]
|
|
6215
6229
|
}
|
|
6216
6230
|
);
|
|
6217
|
-
},
|
|
6231
|
+
}, el = E.div`
|
|
6218
6232
|
& > button {
|
|
6219
6233
|
height: 66px;
|
|
6220
6234
|
min-width: 66px;
|
|
@@ -6232,7 +6246,7 @@ const Dn = {
|
|
|
6232
6246
|
}
|
|
6233
6247
|
}
|
|
6234
6248
|
}
|
|
6235
|
-
`,
|
|
6249
|
+
`, Ml = (e) => /* @__PURE__ */ a(el, { children: /* @__PURE__ */ a(Q, { ...e }) }), tl = E.div`
|
|
6236
6250
|
display: flex;
|
|
6237
6251
|
justify-content: space-between;
|
|
6238
6252
|
align-items: center;
|
|
@@ -6261,9 +6275,9 @@ const Dn = {
|
|
|
6261
6275
|
}
|
|
6262
6276
|
}
|
|
6263
6277
|
}
|
|
6264
|
-
`,
|
|
6278
|
+
`, _l = (e) => {
|
|
6265
6279
|
const { handleBack: t, handleNext: n, disabledBack: o, disabledNext: r, textValues: i } = e;
|
|
6266
|
-
return /* @__PURE__ */ m(
|
|
6280
|
+
return /* @__PURE__ */ m(tl, { children: [
|
|
6267
6281
|
/* @__PURE__ */ a(
|
|
6268
6282
|
Q,
|
|
6269
6283
|
{
|
|
@@ -6287,34 +6301,34 @@ const Dn = {
|
|
|
6287
6301
|
}
|
|
6288
6302
|
)
|
|
6289
6303
|
] });
|
|
6290
|
-
},
|
|
6304
|
+
}, Pl = (e) => Object.values(e).flat(), Vl = (e, t) => {
|
|
6291
6305
|
const n = Te(e);
|
|
6292
6306
|
return Object.fromEntries(
|
|
6293
6307
|
Object.entries(n).map(([o, r]) => [o, r.map(t)])
|
|
6294
6308
|
);
|
|
6295
|
-
},
|
|
6309
|
+
}, nl = (e) => Object.entries(e).map(([t, n]) => ({
|
|
6296
6310
|
ConditionGroupId: t,
|
|
6297
6311
|
conditionsThatEstablishesTheDecision: ut(n)
|
|
6298
|
-
})),
|
|
6312
|
+
})), jl = (e) => {
|
|
6299
6313
|
const t = Te(e);
|
|
6300
6314
|
return {
|
|
6301
6315
|
...e,
|
|
6302
|
-
conditionGroups:
|
|
6316
|
+
conditionGroups: nl(t),
|
|
6303
6317
|
// UI-only
|
|
6304
6318
|
conditionsThatEstablishesTheDecision: t
|
|
6305
6319
|
// preserve full structure
|
|
6306
6320
|
};
|
|
6307
|
-
}, _e = /* @__PURE__ */ new Map(),
|
|
6321
|
+
}, _e = /* @__PURE__ */ new Map(), ol = (e, t) => _e.get(`${t}:${e}`), rl = (e, t, n) => {
|
|
6308
6322
|
const o = `${t}:${e}`;
|
|
6309
6323
|
if (_e.set(o, n), _e.size > 1e3) {
|
|
6310
6324
|
const r = _e.keys().next().value;
|
|
6311
6325
|
r !== void 0 && _e.delete(r);
|
|
6312
6326
|
}
|
|
6313
|
-
},
|
|
6314
|
-
const t = Date.now(), n =
|
|
6315
|
-
return t - n <
|
|
6316
|
-
},
|
|
6317
|
-
const t =
|
|
6327
|
+
}, Cn = /* @__PURE__ */ new Map(), il = 1e3, al = (e) => {
|
|
6328
|
+
const t = Date.now(), n = Cn.get(e) || 0;
|
|
6329
|
+
return t - n < il ? !0 : (Cn.set(e, t), !1);
|
|
6330
|
+
}, ll = (e) => {
|
|
6331
|
+
const t = go(e);
|
|
6318
6332
|
return {
|
|
6319
6333
|
spa: "es",
|
|
6320
6334
|
eng: "en",
|
|
@@ -6323,14 +6337,14 @@ const Dn = {
|
|
|
6323
6337
|
ita: "it",
|
|
6324
6338
|
por: "pt"
|
|
6325
6339
|
}[t] || "en";
|
|
6326
|
-
},
|
|
6327
|
-
const r = `${t}:${e}`, i =
|
|
6340
|
+
}, sl = async (e, t, { url: n, apiKey: o }) => {
|
|
6341
|
+
const r = `${t}:${e}`, i = ol(e, t);
|
|
6328
6342
|
if (i) return i;
|
|
6329
|
-
if (
|
|
6343
|
+
if (al(r))
|
|
6330
6344
|
return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
|
|
6331
|
-
const s =
|
|
6345
|
+
const s = ll(e);
|
|
6332
6346
|
try {
|
|
6333
|
-
const { data: d } = await
|
|
6347
|
+
const { data: d } = await ho.post(
|
|
6334
6348
|
n,
|
|
6335
6349
|
{
|
|
6336
6350
|
q: e,
|
|
@@ -6344,25 +6358,25 @@ const Dn = {
|
|
|
6344
6358
|
}
|
|
6345
6359
|
}
|
|
6346
6360
|
), l = (d == null ? void 0 : d.translatedText) || e;
|
|
6347
|
-
return
|
|
6361
|
+
return rl(e, t, l), l;
|
|
6348
6362
|
} catch (d) {
|
|
6349
6363
|
return console.warn(`[Translation] Failed for: "${e}"`, d), e;
|
|
6350
6364
|
}
|
|
6351
|
-
},
|
|
6365
|
+
}, dl = (e) => typeof e == "string" && e.trim().length > 0, Sn = async (e, t, n) => {
|
|
6352
6366
|
const o = await Promise.all(
|
|
6353
6367
|
Object.entries(e).map(async ([r, i]) => {
|
|
6354
|
-
if (
|
|
6355
|
-
const s = await
|
|
6368
|
+
if (dl(i)) {
|
|
6369
|
+
const s = await sl(i, t, n);
|
|
6356
6370
|
return [r, s];
|
|
6357
6371
|
} else if (Array.isArray(i)) {
|
|
6358
6372
|
const s = await Promise.all(
|
|
6359
6373
|
i.map(
|
|
6360
|
-
async (d) => typeof d == "object" && d !== null ? await
|
|
6374
|
+
async (d) => typeof d == "object" && d !== null ? await Sn(d, t, n) : d
|
|
6361
6375
|
)
|
|
6362
6376
|
);
|
|
6363
6377
|
return [r, s];
|
|
6364
6378
|
} else if (typeof i == "object" && i !== null) {
|
|
6365
|
-
const s = await
|
|
6379
|
+
const s = await Sn(i, t, n);
|
|
6366
6380
|
return [r, s];
|
|
6367
6381
|
} else
|
|
6368
6382
|
return [r, i];
|
|
@@ -6371,38 +6385,38 @@ const Dn = {
|
|
|
6371
6385
|
return Object.fromEntries(o);
|
|
6372
6386
|
};
|
|
6373
6387
|
export {
|
|
6374
|
-
|
|
6388
|
+
_l as BackAndNextButton,
|
|
6375
6389
|
Xe as BusinessRuleCard,
|
|
6376
6390
|
Fn as BusinessRuleCardNew,
|
|
6377
6391
|
Jt as BusinessRuleView,
|
|
6378
6392
|
Rn as BusinessRuleViewNew,
|
|
6379
|
-
|
|
6393
|
+
wl as BusinessRules,
|
|
6380
6394
|
Sl as BusinessRulesNew,
|
|
6381
|
-
|
|
6382
|
-
|
|
6395
|
+
Cl as BusinessRulesWithGroup,
|
|
6396
|
+
Ol as DragAndDropBoxes,
|
|
6383
6397
|
wn as DraggableList,
|
|
6384
|
-
|
|
6385
|
-
|
|
6398
|
+
Yi as DropdownMenu,
|
|
6399
|
+
Ll as DropdownMenuContainer,
|
|
6386
6400
|
re as EValueHowToSetUp,
|
|
6387
|
-
|
|
6388
|
-
|
|
6401
|
+
El as Filter,
|
|
6402
|
+
Nl as FormFilter,
|
|
6389
6403
|
An as ModalRules,
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6404
|
+
Ui as RulesForm,
|
|
6405
|
+
Ml as SendButton,
|
|
6406
|
+
si as buildEsConditionSentence,
|
|
6407
|
+
Ai as convertRangeToString,
|
|
6394
6408
|
$n as filterByGroup,
|
|
6395
|
-
|
|
6396
|
-
|
|
6409
|
+
Pl as flatFromGroups,
|
|
6410
|
+
kl as formatDecisionForBackend,
|
|
6397
6411
|
Te as getConditionsByGroupNew,
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6412
|
+
nl as groupsRecordToArrayNew,
|
|
6413
|
+
Vl as mapByGroupNew,
|
|
6414
|
+
jl as normalizeDecisionToNewShape,
|
|
6415
|
+
Al as parseRangeFromString,
|
|
6416
|
+
Il as revertSortedDataSampleSwitchPlaces,
|
|
6417
|
+
Fl as revertSortedDataSwitchPlaces,
|
|
6418
|
+
$l as sortDisplayDataSampleSwitchPlaces,
|
|
6419
|
+
Rl as sortDisplayDataSwitchPlaces,
|
|
6420
|
+
Sn as translateObject,
|
|
6421
|
+
sl as translateText
|
|
6408
6422
|
};
|