@isettingkit/business-rules 2.2.36 → 2.2.37
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.js +485 -486
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as a, jsxs as v, Fragment as U } from "react/jsx-runtime";
|
|
2
|
-
import { MdOutlineDelete as St, MdClear as Jt, MdAdd as
|
|
3
|
-
import { inube as N, Stack as w, Divider as Y, Icon as B, Text as L, SkeletonLine as
|
|
2
|
+
import { MdOutlineDelete as St, MdClear as Jt, MdAdd as Ke, MdOutlineCreate as br, MdExpandLess as vr, MdExpandMore as jt, MdInfo as yr, MdCached as Tr, MdOutlineInfo as xr, MdClose as wr, MdOutlineFilterAltOff as Sr, MdOutlineFilterAlt as Wn, MdChevronRight as hn, MdArrowRight as Cr, MdOutlineArrowCircleLeft as Dr, MdOutlineArrowCircleRight as Er, MdKeyboardArrowUp as Nr, MdKeyboardArrowDown as Ar, MdOutlineArrowBack as kr } from "react-icons/md";
|
|
3
|
+
import { inube as N, Stack as w, Divider as Y, Icon as B, Text as L, SkeletonLine as se, useMediaQuery as fe, Blanket as Zt, Button as X, Grid as we, Toggle as Ct, Checkbox as Kt, Date as Oe, Box as $r, Tag as qe, Tabs as Yn, SkeletonIcon as Ir, Fieldset as We, OptionList as Rr, Checkpicker as Or } from "@inubekit/inubekit";
|
|
4
4
|
import D, { keyframes as en, ThemeContext as Fr } from "styled-components";
|
|
5
5
|
import { ValueDataType as G, ValueHowToSetUp as _, DecisionConditionRender as Tt, DecisionConditionRenderNew as gn } from "@isettingkit/input";
|
|
6
|
-
import { DecisionViewConditionRenderer as
|
|
6
|
+
import { DecisionViewConditionRenderer as Ie, DecisionViewConditionRendererNew as pt } from "@isettingkit/view";
|
|
7
7
|
import { createPortal as tn } from "react-dom";
|
|
8
8
|
import { useFormik as nn } from "formik";
|
|
9
|
-
import { string as
|
|
10
|
-
import V, { useState as q, useEffect as
|
|
9
|
+
import { string as ve, mixed as xe, object as W, number as me, lazy as Je, date as Fe } from "yup";
|
|
10
|
+
import V, { useState as q, useEffect as Le, useRef as Ye, useContext as Lr, useMemo as Xn } from "react";
|
|
11
11
|
import { Link as Qn, useNavigate as Mr, useLocation as Pr } from "react-router-dom";
|
|
12
12
|
import jr from "axios";
|
|
13
13
|
import { franc as _r } from "franc-min";
|
|
@@ -46,7 +46,7 @@ D.div`
|
|
|
46
46
|
border-radius: 8px;
|
|
47
47
|
}
|
|
48
48
|
`;
|
|
49
|
-
const
|
|
49
|
+
const et = (e) => {
|
|
50
50
|
const { children: t, controls: n = !0, handleDelete: r, id: o } = e;
|
|
51
51
|
return /* @__PURE__ */ a(Vr, { children: /* @__PURE__ */ v(w, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
52
52
|
t,
|
|
@@ -78,7 +78,7 @@ const Yr = {
|
|
|
78
78
|
[O.GREATER_THAN]: Br,
|
|
79
79
|
[O.LESS_THAN]: qr,
|
|
80
80
|
[O.EQUAL]: Wr
|
|
81
|
-
},
|
|
81
|
+
}, Xe = (e) => {
|
|
82
82
|
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), r = Yr[e == null ? void 0 : e.howToSetTheDecision] || Gr;
|
|
83
83
|
return n && r(t) || t || void 0;
|
|
84
84
|
}, fn = D.div`
|
|
@@ -122,10 +122,10 @@ const Yr = {
|
|
|
122
122
|
} = e;
|
|
123
123
|
return i ? /* @__PURE__ */ v(w, { direction: "column", gap: "12px", children: [
|
|
124
124
|
/* @__PURE__ */ a(w, { direction: "column", alignItems: "center", children: /* @__PURE__ */ a(
|
|
125
|
-
|
|
125
|
+
Ie,
|
|
126
126
|
{
|
|
127
127
|
element: o,
|
|
128
|
-
valueData:
|
|
128
|
+
valueData: Xe(
|
|
129
129
|
o
|
|
130
130
|
),
|
|
131
131
|
type: "decision"
|
|
@@ -152,17 +152,17 @@ const Yr = {
|
|
|
152
152
|
}
|
|
153
153
|
),
|
|
154
154
|
s.length > 0 && s.map((p) => /* @__PURE__ */ a(fn, { children: /* @__PURE__ */ a(w, { direction: "column", padding: "8px", children: /* @__PURE__ */ a(
|
|
155
|
-
|
|
155
|
+
Ie,
|
|
156
156
|
{
|
|
157
157
|
element: { ...p, value: p.value },
|
|
158
|
-
valueData:
|
|
158
|
+
valueData: Xe(
|
|
159
159
|
p
|
|
160
160
|
)
|
|
161
161
|
}
|
|
162
162
|
) }) }, p.conditionName)),
|
|
163
163
|
s.length > 0 && /* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
164
164
|
u && /* @__PURE__ */ a(U, { children: r && /* @__PURE__ */ a(
|
|
165
|
-
|
|
165
|
+
Ie,
|
|
166
166
|
{
|
|
167
167
|
element: r.element,
|
|
168
168
|
valueData: r.valueData,
|
|
@@ -175,12 +175,12 @@ const Yr = {
|
|
|
175
175
|
) })
|
|
176
176
|
] }) : /* @__PURE__ */ v(w, { direction: "column", gap: "12px", children: [
|
|
177
177
|
/* @__PURE__ */ v(w, { direction: "column", alignItems: "center", gap: "4px", children: [
|
|
178
|
-
/* @__PURE__ */ a(
|
|
179
|
-
/* @__PURE__ */ a(
|
|
178
|
+
/* @__PURE__ */ a(se, { animated: !0, width: "180px" }),
|
|
179
|
+
/* @__PURE__ */ a(se, { animated: !0, width: "85px" })
|
|
180
180
|
] }, "loading"),
|
|
181
181
|
/* @__PURE__ */ v(w, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
182
182
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
183
|
-
/* @__PURE__ */ a(
|
|
183
|
+
/* @__PURE__ */ a(se, { animated: !0, width: "150px" })
|
|
184
184
|
] }),
|
|
185
185
|
/* @__PURE__ */ a(mn, { children: /* @__PURE__ */ a(
|
|
186
186
|
w,
|
|
@@ -197,8 +197,8 @@ const Yr = {
|
|
|
197
197
|
alignItems: "start",
|
|
198
198
|
padding: "8px",
|
|
199
199
|
children: [
|
|
200
|
-
/* @__PURE__ */ a(
|
|
201
|
-
/* @__PURE__ */ a(
|
|
200
|
+
/* @__PURE__ */ a(se, { animated: !0, width: "180px" }),
|
|
201
|
+
/* @__PURE__ */ a(se, { animated: !0, width: "85px" })
|
|
202
202
|
]
|
|
203
203
|
}
|
|
204
204
|
) }, `condition-${c}`))
|
|
@@ -214,7 +214,7 @@ const Yr = {
|
|
|
214
214
|
howToSetTheDecision: _.RANGE,
|
|
215
215
|
decisionDataType: G.DATE
|
|
216
216
|
},
|
|
217
|
-
valueData:
|
|
217
|
+
valueData: Xe({
|
|
218
218
|
labelName: r == null ? void 0 : r.terms,
|
|
219
219
|
value: {
|
|
220
220
|
from: String(t.effectiveFrom),
|
|
@@ -230,7 +230,7 @@ const Yr = {
|
|
|
230
230
|
howToSetTheDecision: _.EQUAL,
|
|
231
231
|
decisionDataType: G.DATE
|
|
232
232
|
},
|
|
233
|
-
valueData:
|
|
233
|
+
valueData: Xe({
|
|
234
234
|
labelName: r == null ? void 0 : r.terms,
|
|
235
235
|
value: String(t.effectiveFrom),
|
|
236
236
|
howToSetTheDecision: _.EQUAL,
|
|
@@ -239,7 +239,7 @@ const Yr = {
|
|
|
239
239
|
} : null, u = t ? {
|
|
240
240
|
labelName: t.labelName || "",
|
|
241
241
|
decisionDataType: t.decisionDataType || "alphabetical",
|
|
242
|
-
value:
|
|
242
|
+
value: Xe(t),
|
|
243
243
|
howToSetTheDecision: t.howToSetTheDecision || "EqualTo"
|
|
244
244
|
} : null, l = ((g = t == null ? void 0 : t.conditionsThatEstablishesTheDecision) == null ? void 0 : g.filter(
|
|
245
245
|
(h) => !h.hidden
|
|
@@ -294,13 +294,13 @@ const Yr = {
|
|
|
294
294
|
background-color: #ebecf0;
|
|
295
295
|
border-radius: 8px;
|
|
296
296
|
}
|
|
297
|
-
`,
|
|
297
|
+
`, Zr = (e) => {
|
|
298
298
|
const { children: t, portalId: n, onCloseModal: r, title: o } = e, i = document.getElementById(n);
|
|
299
299
|
if (!i)
|
|
300
300
|
throw new Error(
|
|
301
301
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
302
302
|
);
|
|
303
|
-
const d =
|
|
303
|
+
const d = fe("(max-width: 400px)");
|
|
304
304
|
return tn(
|
|
305
305
|
/* @__PURE__ */ a(Qr, { smallScreen: d, children: /* @__PURE__ */ a(Zt, { children: /* @__PURE__ */ a(Jr, { children: /* @__PURE__ */ v(w, { direction: "column", gap: "24px", children: [
|
|
306
306
|
/* @__PURE__ */ a(w, { direction: "column", gap: "24px", children: /* @__PURE__ */ v(w, { alignItems: "center", justifyContent: "space-between", children: [
|
|
@@ -311,7 +311,7 @@ const Yr = {
|
|
|
311
311
|
] }) }) }) }),
|
|
312
312
|
i
|
|
313
313
|
);
|
|
314
|
-
},
|
|
314
|
+
}, Kr = en`
|
|
315
315
|
from {
|
|
316
316
|
opacity: 0;
|
|
317
317
|
transform: translateY(20px);
|
|
@@ -345,7 +345,7 @@ D.div`
|
|
|
345
345
|
}};
|
|
346
346
|
}
|
|
347
347
|
`;
|
|
348
|
-
const
|
|
348
|
+
const Jn = D.div`
|
|
349
349
|
& > div {
|
|
350
350
|
background-color: ${({ theme: e }) => {
|
|
351
351
|
var t, n;
|
|
@@ -358,18 +358,18 @@ const Zn = D.div`
|
|
|
358
358
|
height: 100%;
|
|
359
359
|
padding-bottom: 12px;
|
|
360
360
|
cursor: pointer;
|
|
361
|
-
`,
|
|
361
|
+
`, tt = D.div`
|
|
362
362
|
width: 100%;
|
|
363
363
|
height: 100%;
|
|
364
364
|
& > div {
|
|
365
|
-
animation: ${
|
|
365
|
+
animation: ${Kr} 600ms ease-out;
|
|
366
366
|
}
|
|
367
|
-
`,
|
|
367
|
+
`, eo = D.div`
|
|
368
368
|
& > div > div {
|
|
369
369
|
border-radius: 8px;
|
|
370
370
|
box-sizing: border-box;
|
|
371
371
|
}
|
|
372
|
-
`,
|
|
372
|
+
`, to = D.div`
|
|
373
373
|
& > div {
|
|
374
374
|
width: 100%;
|
|
375
375
|
height: 100%;
|
|
@@ -389,10 +389,10 @@ const Zn = D.div`
|
|
|
389
389
|
border-radius: 8px;
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
`,
|
|
392
|
+
`, no = (e) => {
|
|
393
393
|
const { index: t, handleOpenModal: n } = e;
|
|
394
394
|
return /* @__PURE__ */ a(
|
|
395
|
-
|
|
395
|
+
et,
|
|
396
396
|
{
|
|
397
397
|
id: `loading-card-${t}`,
|
|
398
398
|
handleDelete: () => {
|
|
@@ -403,12 +403,12 @@ const Zn = D.div`
|
|
|
403
403
|
},
|
|
404
404
|
`loading-card-${t}`
|
|
405
405
|
);
|
|
406
|
-
},
|
|
406
|
+
}, ro = (e) => {
|
|
407
407
|
const { decision: t, controls: n, handleOpenModal: r, handleDelete: o, textValues: i } = e;
|
|
408
|
-
return t ? /* @__PURE__ */ a(
|
|
408
|
+
return t ? /* @__PURE__ */ a(tt, { children: /* @__PURE__ */ v(w, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
|
|
409
409
|
/* @__PURE__ */ a(L, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.decisionId }),
|
|
410
410
|
/* @__PURE__ */ a(
|
|
411
|
-
|
|
411
|
+
et,
|
|
412
412
|
{
|
|
413
413
|
id: t.decisionId,
|
|
414
414
|
handleDelete: () => o ? o(t.decisionId) : null,
|
|
@@ -418,21 +418,21 @@ const Zn = D.div`
|
|
|
418
418
|
}
|
|
419
419
|
)
|
|
420
420
|
] }) }, t.decisionId) : null;
|
|
421
|
-
},
|
|
421
|
+
}, oo = (e) => {
|
|
422
422
|
const {
|
|
423
423
|
customTitleContentAddCard: t,
|
|
424
424
|
index: n,
|
|
425
425
|
handleOpenModal: r,
|
|
426
426
|
shouldRenderEmptyMessage: o
|
|
427
427
|
} = e, i = t || "Agregar decisión";
|
|
428
|
-
return /* @__PURE__ */ a(
|
|
428
|
+
return /* @__PURE__ */ a(tt, { children: o ? null : /* @__PURE__ */ v(w, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
|
|
429
429
|
/* @__PURE__ */ a(L, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
|
|
430
430
|
/* @__PURE__ */ a(
|
|
431
|
-
|
|
431
|
+
Jn,
|
|
432
432
|
{
|
|
433
433
|
onClick: () => r ? r() : null,
|
|
434
434
|
children: /* @__PURE__ */ a(
|
|
435
|
-
|
|
435
|
+
et,
|
|
436
436
|
{
|
|
437
437
|
id: `add-decision-${n}`,
|
|
438
438
|
handleDelete: () => {
|
|
@@ -440,7 +440,7 @@ const Zn = D.div`
|
|
|
440
440
|
handleView: () => r ? r() : null,
|
|
441
441
|
controls: !1,
|
|
442
442
|
children: /* @__PURE__ */ v(w, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
443
|
-
/* @__PURE__ */ a(B, { appearance: "gray", icon: /* @__PURE__ */ a(
|
|
443
|
+
/* @__PURE__ */ a(B, { appearance: "gray", icon: /* @__PURE__ */ a(Ke, {}), size: "35px" }),
|
|
444
444
|
/* @__PURE__ */ a(L, { appearance: "gray", type: "body", size: "large", children: i })
|
|
445
445
|
] })
|
|
446
446
|
}
|
|
@@ -448,14 +448,14 @@ const Zn = D.div`
|
|
|
448
448
|
}
|
|
449
449
|
)
|
|
450
450
|
] }) }, `add-decision-${n}`);
|
|
451
|
-
},
|
|
452
|
-
loading:
|
|
453
|
-
decision:
|
|
454
|
-
add:
|
|
451
|
+
}, io = {
|
|
452
|
+
loading: no,
|
|
453
|
+
decision: ro,
|
|
454
|
+
add: oo
|
|
455
455
|
}, _t = (e) => {
|
|
456
|
-
const { type: t } = e, n =
|
|
456
|
+
const { type: t } = e, n = io[t];
|
|
457
457
|
return n ? n(e) : null;
|
|
458
|
-
},
|
|
458
|
+
}, ao = (e) => {
|
|
459
459
|
const {
|
|
460
460
|
controls: t,
|
|
461
461
|
customTitleContentAddCard: n,
|
|
@@ -504,7 +504,7 @@ const Zn = D.div`
|
|
|
504
504
|
handleSubmitForm: g,
|
|
505
505
|
handleDelete: h,
|
|
506
506
|
terms: f = !0
|
|
507
|
-
} = e, m =
|
|
507
|
+
} = e, m = fe("(max-width: 681px)"), y = fe("(max-width: 400px)"), { renderedCards: T, shouldRenderAddCard: S } = ao({
|
|
508
508
|
controls: t,
|
|
509
509
|
customTitleContentAddCard: n,
|
|
510
510
|
decisions: o,
|
|
@@ -514,7 +514,7 @@ const Zn = D.div`
|
|
|
514
514
|
textValues: i
|
|
515
515
|
}), k = (o == null ? void 0 : o.length) === 0 && !s;
|
|
516
516
|
return /* @__PURE__ */ v(U, { children: [
|
|
517
|
-
/* @__PURE__ */ a(
|
|
517
|
+
/* @__PURE__ */ a(eo, { children: /* @__PURE__ */ a(to, { children: /* @__PURE__ */ a(w, { direction: "column", gap: "16px", padding: "6px", children: k ? /* @__PURE__ */ v(
|
|
518
518
|
w,
|
|
519
519
|
{
|
|
520
520
|
direction: "column",
|
|
@@ -546,7 +546,7 @@ const Zn = D.div`
|
|
|
546
546
|
/* @__PURE__ */ a(
|
|
547
547
|
X,
|
|
548
548
|
{
|
|
549
|
-
iconBefore: /* @__PURE__ */ a(
|
|
549
|
+
iconBefore: /* @__PURE__ */ a(Ke, {}),
|
|
550
550
|
onClick: () => p ? p() : null,
|
|
551
551
|
children: n || "Agregar decisión"
|
|
552
552
|
}
|
|
@@ -554,7 +554,7 @@ const Zn = D.div`
|
|
|
554
554
|
]
|
|
555
555
|
}
|
|
556
556
|
) : /* @__PURE__ */ v(
|
|
557
|
-
|
|
557
|
+
we,
|
|
558
558
|
{
|
|
559
559
|
templateColumns: y ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
|
|
560
560
|
autoFlow: "row dense",
|
|
@@ -584,7 +584,7 @@ const Zn = D.div`
|
|
|
584
584
|
}
|
|
585
585
|
) }) }) }),
|
|
586
586
|
u && /* @__PURE__ */ a(
|
|
587
|
-
|
|
587
|
+
Zr,
|
|
588
588
|
{
|
|
589
589
|
portalId: "modal-portal",
|
|
590
590
|
onCloseModal: c,
|
|
@@ -602,12 +602,12 @@ const Zn = D.div`
|
|
|
602
602
|
}
|
|
603
603
|
)
|
|
604
604
|
] });
|
|
605
|
-
},
|
|
605
|
+
}, lo = D.div`
|
|
606
606
|
position: relative;
|
|
607
607
|
& > div {
|
|
608
608
|
padding: 24px 16px;
|
|
609
609
|
}
|
|
610
|
-
`,
|
|
610
|
+
`, so = D.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) || N.palette.neutral.N0;
|
|
@@ -638,15 +638,15 @@ const Zn = D.div`
|
|
|
638
638
|
background-color: #ebecf0;
|
|
639
639
|
border-radius: 8px;
|
|
640
640
|
}
|
|
641
|
-
`,
|
|
641
|
+
`, co = (e) => {
|
|
642
642
|
const { children: t, portalId: n, onCloseModal: r, title: o } = e, i = document.getElementById(n);
|
|
643
643
|
if (!i)
|
|
644
644
|
throw new Error(
|
|
645
645
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
646
646
|
);
|
|
647
|
-
const d =
|
|
647
|
+
const d = fe("(max-width: 400px)");
|
|
648
648
|
return tn(
|
|
649
|
-
/* @__PURE__ */ a(
|
|
649
|
+
/* @__PURE__ */ a(lo, { $smallScreen: d, children: /* @__PURE__ */ a(Zt, { children: /* @__PURE__ */ a(so, { children: /* @__PURE__ */ v(w, { direction: "column", gap: "24px", children: [
|
|
650
650
|
/* @__PURE__ */ a(w, { direction: "column", gap: "24px", children: /* @__PURE__ */ v(w, { alignItems: "center", justifyContent: "space-between", children: [
|
|
651
651
|
/* @__PURE__ */ a(L, { type: "title", size: "large", appearance: "dark", weight: "bold", children: o }),
|
|
652
652
|
/* @__PURE__ */ a(Jt, { size: "24px", cursor: "pointer", onClick: r })
|
|
@@ -655,7 +655,7 @@ const Zn = D.div`
|
|
|
655
655
|
] }) }) }) }),
|
|
656
656
|
i
|
|
657
657
|
);
|
|
658
|
-
},
|
|
658
|
+
}, uo = en`
|
|
659
659
|
from {
|
|
660
660
|
opacity: 0;
|
|
661
661
|
transform: translateY(20px);
|
|
@@ -707,15 +707,15 @@ D.div`
|
|
|
707
707
|
width: 100%;
|
|
708
708
|
height: 100%;
|
|
709
709
|
& > div {
|
|
710
|
-
animation: ${
|
|
710
|
+
animation: ${uo} 600ms ease-out;
|
|
711
711
|
}
|
|
712
712
|
`;
|
|
713
|
-
const
|
|
713
|
+
const po = D.div`
|
|
714
714
|
& > div > div {
|
|
715
715
|
border-radius: 8px;
|
|
716
716
|
box-sizing: border-box;
|
|
717
717
|
}
|
|
718
|
-
`,
|
|
718
|
+
`, ho = D.div`
|
|
719
719
|
& > div {
|
|
720
720
|
width: 100%;
|
|
721
721
|
height: 100%;
|
|
@@ -735,10 +735,10 @@ const uo = D.div`
|
|
|
735
735
|
border-radius: 8px;
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
|
-
`,
|
|
738
|
+
`, go = (e) => {
|
|
739
739
|
const { index: t, handleOpenModal: n } = e;
|
|
740
740
|
return /* @__PURE__ */ a(
|
|
741
|
-
|
|
741
|
+
et,
|
|
742
742
|
{
|
|
743
743
|
id: `loading-card-${t}`,
|
|
744
744
|
handleDelete: () => {
|
|
@@ -749,17 +749,17 @@ const uo = D.div`
|
|
|
749
749
|
},
|
|
750
750
|
`loading-card-${t}`
|
|
751
751
|
);
|
|
752
|
-
},
|
|
752
|
+
}, fo = (e) => e.value, mo = (e) => e.value, bo = (e) => e.value, vo = (e) => ({
|
|
753
753
|
from: e.from ?? "",
|
|
754
754
|
to: e.to ?? ""
|
|
755
|
-
}),
|
|
756
|
-
[O.LIST_OF_VALUES]:
|
|
757
|
-
[O.LIST_OF_VALUES_MULTI]:
|
|
758
|
-
[O.RANGE]:
|
|
759
|
-
[O.GREATER_THAN]:
|
|
760
|
-
[O.LESS_THAN]:
|
|
761
|
-
[O.EQUAL]:
|
|
762
|
-
},
|
|
755
|
+
}), yo = (e) => e.value, To = (e) => e.value, xo = (e) => e.value, wo = {
|
|
756
|
+
[O.LIST_OF_VALUES]: mo,
|
|
757
|
+
[O.LIST_OF_VALUES_MULTI]: bo,
|
|
758
|
+
[O.RANGE]: vo,
|
|
759
|
+
[O.GREATER_THAN]: yo,
|
|
760
|
+
[O.LESS_THAN]: To,
|
|
761
|
+
[O.EQUAL]: xo
|
|
762
|
+
}, So = (e, t) => {
|
|
763
763
|
if (!e || e.decisionDataType !== G.PERCENTAGE || t == null || typeof t == "string" && t.endsWith("%"))
|
|
764
764
|
return t;
|
|
765
765
|
const n = (r) => typeof r == "string" ? r.replace(/%$/, "") : r;
|
|
@@ -768,9 +768,9 @@ const uo = D.div`
|
|
|
768
768
|
from: `${n(t.from)}%`,
|
|
769
769
|
to: `${n(t.to)}%`
|
|
770
770
|
} : t;
|
|
771
|
-
},
|
|
772
|
-
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), r =
|
|
773
|
-
return
|
|
771
|
+
}, Qe = (e) => {
|
|
772
|
+
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), r = wo[e == null ? void 0 : e.howToSetTheDecision] || fo, o = n && r(t) || t || void 0;
|
|
773
|
+
return So(e, o);
|
|
774
774
|
}, bn = D.div`
|
|
775
775
|
& > div {
|
|
776
776
|
border-radius: 8px;
|
|
@@ -798,7 +798,7 @@ const uo = D.div`
|
|
|
798
798
|
background-color: #ebecf0;
|
|
799
799
|
border-radius: 8px;
|
|
800
800
|
}
|
|
801
|
-
`,
|
|
801
|
+
`, Co = (e) => {
|
|
802
802
|
const {
|
|
803
803
|
conditionsAlignment: t,
|
|
804
804
|
decision: n,
|
|
@@ -812,10 +812,10 @@ const uo = D.div`
|
|
|
812
812
|
} = e;
|
|
813
813
|
return i ? /* @__PURE__ */ v(w, { direction: "column", gap: "12px", children: [
|
|
814
814
|
/* @__PURE__ */ a(w, { direction: "column", alignItems: "center", children: /* @__PURE__ */ a(
|
|
815
|
-
|
|
815
|
+
Ie,
|
|
816
816
|
{
|
|
817
817
|
element: o,
|
|
818
|
-
valueData:
|
|
818
|
+
valueData: Qe(
|
|
819
819
|
o
|
|
820
820
|
),
|
|
821
821
|
type: "decision"
|
|
@@ -842,17 +842,17 @@ const uo = D.div`
|
|
|
842
842
|
}
|
|
843
843
|
),
|
|
844
844
|
s.length > 0 && s.map((p) => /* @__PURE__ */ a(bn, { children: /* @__PURE__ */ a(w, { direction: "column", padding: "8px", children: /* @__PURE__ */ a(
|
|
845
|
-
|
|
845
|
+
Ie,
|
|
846
846
|
{
|
|
847
847
|
element: { ...p, value: p.value },
|
|
848
|
-
valueData:
|
|
848
|
+
valueData: Qe(
|
|
849
849
|
p
|
|
850
850
|
)
|
|
851
851
|
}
|
|
852
852
|
) }) }, p.conditionName)),
|
|
853
853
|
s.length > 0 && /* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
854
854
|
u && /* @__PURE__ */ a(U, { children: r && /* @__PURE__ */ a(
|
|
855
|
-
|
|
855
|
+
Ie,
|
|
856
856
|
{
|
|
857
857
|
element: r.element,
|
|
858
858
|
valueData: r.valueData,
|
|
@@ -865,12 +865,12 @@ const uo = D.div`
|
|
|
865
865
|
) })
|
|
866
866
|
] }) : /* @__PURE__ */ v(w, { direction: "column", gap: "12px", children: [
|
|
867
867
|
/* @__PURE__ */ v(w, { direction: "column", alignItems: "center", gap: "4px", children: [
|
|
868
|
-
/* @__PURE__ */ a(
|
|
869
|
-
/* @__PURE__ */ a(
|
|
868
|
+
/* @__PURE__ */ a(se, { animated: !0, width: "180px" }),
|
|
869
|
+
/* @__PURE__ */ a(se, { animated: !0, width: "85px" })
|
|
870
870
|
] }, "loading"),
|
|
871
871
|
/* @__PURE__ */ v(w, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
872
872
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
873
|
-
/* @__PURE__ */ a(
|
|
873
|
+
/* @__PURE__ */ a(se, { animated: !0, width: "150px" })
|
|
874
874
|
] }),
|
|
875
875
|
/* @__PURE__ */ a(vn, { children: /* @__PURE__ */ a(
|
|
876
876
|
w,
|
|
@@ -887,18 +887,18 @@ const uo = D.div`
|
|
|
887
887
|
alignItems: "start",
|
|
888
888
|
padding: "8px",
|
|
889
889
|
children: [
|
|
890
|
-
/* @__PURE__ */ a(
|
|
891
|
-
/* @__PURE__ */ a(
|
|
890
|
+
/* @__PURE__ */ a(se, { animated: !0, width: "180px" }),
|
|
891
|
+
/* @__PURE__ */ a(se, { animated: !0, width: "85px" })
|
|
892
892
|
]
|
|
893
893
|
}
|
|
894
894
|
) }, `condition-${c}`))
|
|
895
895
|
}
|
|
896
896
|
) })
|
|
897
897
|
] });
|
|
898
|
-
},
|
|
898
|
+
}, Do = (e) => Array.isArray(e) ? e[0] : e ?? null, Eo = (e) => {
|
|
899
899
|
var t;
|
|
900
|
-
return ((t =
|
|
901
|
-
},
|
|
900
|
+
return ((t = Do(e == null ? void 0 : e.conditionGroups)) == null ? void 0 : t.conditionsThatEstablishesTheDecision) ?? [];
|
|
901
|
+
}, No = (e) => {
|
|
902
902
|
const { decision: t, loading: n = !1, textValues: r } = e, o = !!(t != null && t.effectiveFrom), i = !!(t != null && t.validUntil), d = o && i ? {
|
|
903
903
|
element: {
|
|
904
904
|
labelName: r == null ? void 0 : r.terms,
|
|
@@ -906,7 +906,7 @@ const uo = D.div`
|
|
|
906
906
|
howToSetTheDecision: _.RANGE,
|
|
907
907
|
decisionDataType: G.DATE
|
|
908
908
|
},
|
|
909
|
-
valueData:
|
|
909
|
+
valueData: Qe({
|
|
910
910
|
labelName: r == null ? void 0 : r.terms,
|
|
911
911
|
value: {
|
|
912
912
|
from: String(t.effectiveFrom),
|
|
@@ -922,7 +922,7 @@ const uo = D.div`
|
|
|
922
922
|
howToSetTheDecision: _.EQUAL,
|
|
923
923
|
decisionDataType: G.DATE
|
|
924
924
|
},
|
|
925
|
-
valueData:
|
|
925
|
+
valueData: Qe({
|
|
926
926
|
labelName: r == null ? void 0 : r.terms,
|
|
927
927
|
value: String(t.effectiveFrom),
|
|
928
928
|
howToSetTheDecision: _.EQUAL,
|
|
@@ -931,11 +931,11 @@ const uo = D.div`
|
|
|
931
931
|
} : null, u = t ? {
|
|
932
932
|
labelName: t.labelName || "",
|
|
933
933
|
decisionDataType: t.decisionDataType || "alphabetical",
|
|
934
|
-
value:
|
|
934
|
+
value: Qe(t),
|
|
935
935
|
howToSetTheDecision: t.howToSetTheDecision || "EqualTo"
|
|
936
|
-
} : null, l =
|
|
936
|
+
} : null, l = Eo(t).filter((g) => !(g != null && g.hidden)), s = Array.from({ length: 5 }), p = !!(!n && t && r && u), c = l.length < 2 ? "start" : "space-between";
|
|
937
937
|
return /* @__PURE__ */ a(
|
|
938
|
-
|
|
938
|
+
Co,
|
|
939
939
|
{
|
|
940
940
|
conditionsAlignment: c,
|
|
941
941
|
decision: t,
|
|
@@ -948,7 +948,7 @@ const uo = D.div`
|
|
|
948
948
|
visibleConditions: l
|
|
949
949
|
}
|
|
950
950
|
);
|
|
951
|
-
},
|
|
951
|
+
}, Ao = D.div`
|
|
952
952
|
border-radius: 8px;
|
|
953
953
|
border: 1px solid
|
|
954
954
|
${({ theme: e }) => {
|
|
@@ -983,9 +983,9 @@ D.div`
|
|
|
983
983
|
border-radius: 8px;
|
|
984
984
|
}
|
|
985
985
|
`;
|
|
986
|
-
const
|
|
986
|
+
const ko = (e) => {
|
|
987
987
|
const { children: t, controls: n = !0, handleDelete: r, id: o } = e;
|
|
988
|
-
return /* @__PURE__ */ a(
|
|
988
|
+
return /* @__PURE__ */ a(Ao, { children: /* @__PURE__ */ v(w, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
989
989
|
t,
|
|
990
990
|
n && /* @__PURE__ */ v(U, { children: [
|
|
991
991
|
/* @__PURE__ */ a(Y, {}),
|
|
@@ -1003,21 +1003,21 @@ const Ao = (e) => {
|
|
|
1003
1003
|
) })
|
|
1004
1004
|
] })
|
|
1005
1005
|
] }) });
|
|
1006
|
-
},
|
|
1006
|
+
}, $o = (e) => {
|
|
1007
1007
|
const { decision: t, controls: n, handleOpenModal: r, handleDelete: o, textValues: i, index: d } = e;
|
|
1008
1008
|
if (!t) return null;
|
|
1009
1009
|
const u = typeof d == "number" ? `Decisión ${d + 1}` : t.decisionId;
|
|
1010
|
-
return /* @__PURE__ */ a(
|
|
1010
|
+
return /* @__PURE__ */ a(tt, { children: /* @__PURE__ */ v(w, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
|
|
1011
1011
|
/* @__PURE__ */ a(L, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: u }),
|
|
1012
1012
|
/* @__PURE__ */ a(
|
|
1013
|
-
|
|
1013
|
+
ko,
|
|
1014
1014
|
{
|
|
1015
1015
|
id: t.decisionId,
|
|
1016
1016
|
handleDelete: () => o ? o(t.decisionId) : null,
|
|
1017
1017
|
handleView: () => r ? r(t) : null,
|
|
1018
1018
|
controls: n,
|
|
1019
1019
|
children: /* @__PURE__ */ a(
|
|
1020
|
-
|
|
1020
|
+
No,
|
|
1021
1021
|
{
|
|
1022
1022
|
decision: t,
|
|
1023
1023
|
textValues: i
|
|
@@ -1026,21 +1026,21 @@ const Ao = (e) => {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
)
|
|
1028
1028
|
] }) }, t.decisionId);
|
|
1029
|
-
},
|
|
1029
|
+
}, Io = (e) => {
|
|
1030
1030
|
const {
|
|
1031
1031
|
customTitleContentAddCard: t,
|
|
1032
1032
|
index: n,
|
|
1033
1033
|
handleOpenModal: r,
|
|
1034
1034
|
shouldRenderEmptyMessage: o
|
|
1035
1035
|
} = e, i = t || "Agregar decisión";
|
|
1036
|
-
return /* @__PURE__ */ a(
|
|
1036
|
+
return /* @__PURE__ */ a(tt, { children: o ? null : /* @__PURE__ */ v(w, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
|
|
1037
1037
|
/* @__PURE__ */ a(L, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
|
|
1038
1038
|
/* @__PURE__ */ a(
|
|
1039
|
-
|
|
1039
|
+
Jn,
|
|
1040
1040
|
{
|
|
1041
1041
|
onClick: () => r ? r() : null,
|
|
1042
1042
|
children: /* @__PURE__ */ a(
|
|
1043
|
-
|
|
1043
|
+
et,
|
|
1044
1044
|
{
|
|
1045
1045
|
id: `add-decision-${n}`,
|
|
1046
1046
|
handleDelete: () => {
|
|
@@ -1048,7 +1048,7 @@ const Ao = (e) => {
|
|
|
1048
1048
|
handleView: () => r ? r() : null,
|
|
1049
1049
|
controls: !1,
|
|
1050
1050
|
children: /* @__PURE__ */ v(w, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
1051
|
-
/* @__PURE__ */ a(B, { appearance: "gray", icon: /* @__PURE__ */ a(
|
|
1051
|
+
/* @__PURE__ */ a(B, { appearance: "gray", icon: /* @__PURE__ */ a(Ke, {}), size: "35px" }),
|
|
1052
1052
|
/* @__PURE__ */ a(L, { appearance: "gray", type: "body", size: "large", children: i })
|
|
1053
1053
|
] })
|
|
1054
1054
|
}
|
|
@@ -1056,22 +1056,22 @@ const Ao = (e) => {
|
|
|
1056
1056
|
}
|
|
1057
1057
|
)
|
|
1058
1058
|
] }) }, `add-decision-${n}`);
|
|
1059
|
-
},
|
|
1060
|
-
loading:
|
|
1061
|
-
decision:
|
|
1062
|
-
add:
|
|
1059
|
+
}, Ro = {
|
|
1060
|
+
loading: go,
|
|
1061
|
+
decision: $o,
|
|
1062
|
+
add: Io
|
|
1063
1063
|
}, Vt = (e) => {
|
|
1064
|
-
const { type: t } = e, n =
|
|
1064
|
+
const { type: t } = e, n = Ro[t];
|
|
1065
1065
|
return n ? n(e) : null;
|
|
1066
|
-
},
|
|
1067
|
-
schema:
|
|
1066
|
+
}, Oo = (e) => ({
|
|
1067
|
+
schema: ve().required("Requerido").test(
|
|
1068
1068
|
"non-empty",
|
|
1069
1069
|
"El valor no puede estar vacío",
|
|
1070
1070
|
(t) => t != null && t.trim() !== ""
|
|
1071
1071
|
),
|
|
1072
1072
|
value: e
|
|
1073
|
-
}),
|
|
1074
|
-
schema:
|
|
1073
|
+
}), Fo = (e) => ({
|
|
1074
|
+
schema: xe().test(
|
|
1075
1075
|
"isArrayOrString",
|
|
1076
1076
|
"Debe ser un array de strings/numbers o un solo string",
|
|
1077
1077
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -1079,8 +1079,8 @@ const Ao = (e) => {
|
|
|
1079
1079
|
) : typeof t == "string"
|
|
1080
1080
|
),
|
|
1081
1081
|
value: e
|
|
1082
|
-
}),
|
|
1083
|
-
schema:
|
|
1082
|
+
}), Lo = (e) => ({
|
|
1083
|
+
schema: xe().test(
|
|
1084
1084
|
"isArrayOrString",
|
|
1085
1085
|
"Debe ser un array de strings/numbers o un solo string ",
|
|
1086
1086
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -1088,7 +1088,7 @@ const Ao = (e) => {
|
|
|
1088
1088
|
) : typeof t == "string"
|
|
1089
1089
|
),
|
|
1090
1090
|
value: e
|
|
1091
|
-
}),
|
|
1091
|
+
}), Mo = (e) => {
|
|
1092
1092
|
const t = (e == null ? void 0 : e.from) ?? 0, n = (e == null ? void 0 : e.to) ?? 0;
|
|
1093
1093
|
return {
|
|
1094
1094
|
schema: W({
|
|
@@ -1108,16 +1108,16 @@ const Ao = (e) => {
|
|
|
1108
1108
|
schema: me().required("El campo tipo porcentaje es requerido").min(0, "El campo tipo porcentaje no puede ser menor que 0").max(100, "El campo tipo porcentaje no puede ser mayor que 100"),
|
|
1109
1109
|
value: e
|
|
1110
1110
|
} : {
|
|
1111
|
-
schema:
|
|
1111
|
+
schema: ve().required("Requerido"),
|
|
1112
1112
|
value: e
|
|
1113
|
-
},
|
|
1114
|
-
[O.LIST_OF_VALUES]:
|
|
1115
|
-
[O.LIST_OF_VALUES_MULTI]:
|
|
1116
|
-
[O.RANGE]:
|
|
1113
|
+
}, Po = {
|
|
1114
|
+
[O.LIST_OF_VALUES]: Fo,
|
|
1115
|
+
[O.LIST_OF_VALUES_MULTI]: Lo,
|
|
1116
|
+
[O.RANGE]: Mo,
|
|
1117
1117
|
[O.GREATER_THAN]: It,
|
|
1118
1118
|
[O.LESS_THAN]: It,
|
|
1119
1119
|
[O.EQUAL]: It
|
|
1120
|
-
},
|
|
1120
|
+
}, jo = (e) => Po[e] || Oo, vt = (e) => e != null && (typeof e != "string" || e.trim() !== "") && (!Array.isArray(e) || e.length > 0), yn = (e, t) => {
|
|
1121
1121
|
var u;
|
|
1122
1122
|
const n = Object.entries((e == null ? void 0 : e.conditionsThatEstablishesTheDecision) ?? {}).filter(([, l]) => vt(l)).map(([l, s]) => ({ conditionName: l, value: s }));
|
|
1123
1123
|
let r = [];
|
|
@@ -1136,7 +1136,7 @@ const Ao = (e) => {
|
|
|
1136
1136
|
};
|
|
1137
1137
|
});
|
|
1138
1138
|
};
|
|
1139
|
-
function
|
|
1139
|
+
function _o({
|
|
1140
1140
|
decision: e,
|
|
1141
1141
|
onSubmitEvent: t,
|
|
1142
1142
|
textValues: n
|
|
@@ -1160,8 +1160,8 @@ function jo({
|
|
|
1160
1160
|
};
|
|
1161
1161
|
let u;
|
|
1162
1162
|
const l = {
|
|
1163
|
-
ruleName:
|
|
1164
|
-
value:
|
|
1163
|
+
ruleName: ve().required("El nombre de la regla es requerido"),
|
|
1164
|
+
value: Je(() => jo(
|
|
1165
1165
|
u.values.howToSetTheDecision
|
|
1166
1166
|
)(
|
|
1167
1167
|
u.values.value,
|
|
@@ -1169,7 +1169,7 @@ function jo({
|
|
|
1169
1169
|
).schema),
|
|
1170
1170
|
conditionsThatEstablishesTheDecision: W().shape({})
|
|
1171
1171
|
};
|
|
1172
|
-
n.terms && (l.effectiveFrom =
|
|
1172
|
+
n.terms && (l.effectiveFrom = Fe().required("La fecha de inicio es requerida"), l.validUntil = Fe().when(
|
|
1173
1173
|
"checkClosed",
|
|
1174
1174
|
(h, f, { parent: m }) => (m == null ? void 0 : m.checkClosed) ? f.required("La fecha de finalización es requerida").test(
|
|
1175
1175
|
"is-after-startDate",
|
|
@@ -1231,7 +1231,7 @@ function jo({
|
|
|
1231
1231
|
});
|
|
1232
1232
|
} };
|
|
1233
1233
|
}
|
|
1234
|
-
const
|
|
1234
|
+
const Vo = D.div`
|
|
1235
1235
|
& > div {
|
|
1236
1236
|
border-radius: 8px;
|
|
1237
1237
|
border: 1px solid
|
|
@@ -1240,7 +1240,7 @@ const _o = D.div`
|
|
|
1240
1240
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || N.palette.neutral.N30;
|
|
1241
1241
|
}};
|
|
1242
1242
|
}
|
|
1243
|
-
`,
|
|
1243
|
+
`, Go = D.div`
|
|
1244
1244
|
width: 100%;
|
|
1245
1245
|
height: 100%;
|
|
1246
1246
|
overflow-y: auto;
|
|
@@ -1257,7 +1257,7 @@ const _o = D.div`
|
|
|
1257
1257
|
background-color: #ebecf0;
|
|
1258
1258
|
border-radius: 8px;
|
|
1259
1259
|
}
|
|
1260
|
-
`,
|
|
1260
|
+
`, zo = (e) => {
|
|
1261
1261
|
const {
|
|
1262
1262
|
checked: t,
|
|
1263
1263
|
children: n,
|
|
@@ -1267,7 +1267,7 @@ const _o = D.div`
|
|
|
1267
1267
|
name: d,
|
|
1268
1268
|
valueToggle: u = ""
|
|
1269
1269
|
} = e, [l, s] = q(t);
|
|
1270
|
-
return
|
|
1270
|
+
return Le(() => {
|
|
1271
1271
|
s(t);
|
|
1272
1272
|
}, [t]), /* @__PURE__ */ v(U, { children: [
|
|
1273
1273
|
/* @__PURE__ */ a(w, { children: /* @__PURE__ */ a(
|
|
@@ -1286,7 +1286,7 @@ const _o = D.div`
|
|
|
1286
1286
|
) }),
|
|
1287
1287
|
l && /* @__PURE__ */ a(U, { children: n })
|
|
1288
1288
|
] });
|
|
1289
|
-
},
|
|
1289
|
+
}, Uo = (e) => {
|
|
1290
1290
|
const {
|
|
1291
1291
|
onHandleStartChange: t,
|
|
1292
1292
|
onHandleEndChange: n,
|
|
@@ -1307,7 +1307,7 @@ const _o = D.div`
|
|
|
1307
1307
|
T(M.target.value), t(M);
|
|
1308
1308
|
}, $ = (M) => {
|
|
1309
1309
|
k(M.target.value), n(M);
|
|
1310
|
-
}, P =
|
|
1310
|
+
}, P = fe("(max-width: 400px)");
|
|
1311
1311
|
return /* @__PURE__ */ v(U, { children: [
|
|
1312
1312
|
/* @__PURE__ */ v(w, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
1313
1313
|
/* @__PURE__ */ a(
|
|
@@ -1348,7 +1348,7 @@ const _o = D.div`
|
|
|
1348
1348
|
gap: "24px",
|
|
1349
1349
|
children: [
|
|
1350
1350
|
/* @__PURE__ */ a(
|
|
1351
|
-
|
|
1351
|
+
Oe,
|
|
1352
1352
|
{
|
|
1353
1353
|
id: "dateStart",
|
|
1354
1354
|
label: o,
|
|
@@ -1361,7 +1361,7 @@ const _o = D.div`
|
|
|
1361
1361
|
}
|
|
1362
1362
|
),
|
|
1363
1363
|
f && /* @__PURE__ */ a(
|
|
1364
|
-
|
|
1364
|
+
Oe,
|
|
1365
1365
|
{
|
|
1366
1366
|
id: "dateEnd",
|
|
1367
1367
|
label: i,
|
|
@@ -1378,8 +1378,8 @@ const _o = D.div`
|
|
|
1378
1378
|
)
|
|
1379
1379
|
] });
|
|
1380
1380
|
};
|
|
1381
|
-
var
|
|
1382
|
-
const
|
|
1381
|
+
var Zn = /* @__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))(Zn || {});
|
|
1382
|
+
const Ho = (e) => {
|
|
1383
1383
|
const {
|
|
1384
1384
|
formik: t,
|
|
1385
1385
|
textValues: n,
|
|
@@ -1399,7 +1399,7 @@ const Uo = (e) => {
|
|
|
1399
1399
|
isDecision: !0
|
|
1400
1400
|
}),
|
|
1401
1401
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
1402
|
-
/* @__PURE__ */ a(
|
|
1402
|
+
/* @__PURE__ */ a(Vo, { children: /* @__PURE__ */ a(Go, { children: /* @__PURE__ */ v(
|
|
1403
1403
|
w,
|
|
1404
1404
|
{
|
|
1405
1405
|
direction: "column",
|
|
@@ -1431,7 +1431,7 @@ const Uo = (e) => {
|
|
|
1431
1431
|
/* @__PURE__ */ a(w, { direction: "column", gap: "20px", children: o == null ? void 0 : o.map((c) => {
|
|
1432
1432
|
var g;
|
|
1433
1433
|
return /* @__PURE__ */ a(
|
|
1434
|
-
|
|
1434
|
+
zo,
|
|
1435
1435
|
{
|
|
1436
1436
|
id: `toggle-${c.conditionName}`,
|
|
1437
1437
|
name: `toggle.${c.conditionName}`,
|
|
@@ -1439,7 +1439,7 @@ const Uo = (e) => {
|
|
|
1439
1439
|
checked: !t.values.toggleNone && ((g = t.values.conditionsThatEstablishesTheDecision) == null ? void 0 : g[c.conditionName]) !== void 0,
|
|
1440
1440
|
handleToggleChange: (h) => u(
|
|
1441
1441
|
c.conditionName,
|
|
1442
|
-
c.howToSetTheCondition ===
|
|
1442
|
+
c.howToSetTheCondition === Zn.LIST_OF_VALUES_MULTI
|
|
1443
1443
|
)(h.target.checked),
|
|
1444
1444
|
children: Tt({ condition: c, formik: t })
|
|
1445
1445
|
},
|
|
@@ -1452,7 +1452,7 @@ const Uo = (e) => {
|
|
|
1452
1452
|
n.terms && /* @__PURE__ */ v(U, { children: [
|
|
1453
1453
|
/* @__PURE__ */ a(Y, { dashed: !0 }),
|
|
1454
1454
|
/* @__PURE__ */ a(
|
|
1455
|
-
|
|
1455
|
+
Uo,
|
|
1456
1456
|
{
|
|
1457
1457
|
labelStart: n.termStart,
|
|
1458
1458
|
labelEnd: n.termEnd,
|
|
@@ -1478,9 +1478,9 @@ const Uo = (e) => {
|
|
|
1478
1478
|
/* @__PURE__ */ a(X, { type: "submit", children: n.confirm })
|
|
1479
1479
|
] })
|
|
1480
1480
|
] }) });
|
|
1481
|
-
},
|
|
1481
|
+
}, Bo = (e) => {
|
|
1482
1482
|
var h, f;
|
|
1483
|
-
const { decision: t, onSubmitEvent: n, textValues: r, onCancel: o } = e, { formik: i, handleToggleNoneChange: d } =
|
|
1483
|
+
const { decision: t, onSubmitEvent: n, textValues: r, onCancel: o } = e, { formik: i, handleToggleNoneChange: d } = _o({
|
|
1484
1484
|
decision: t,
|
|
1485
1485
|
onSubmitEvent: n,
|
|
1486
1486
|
textValues: r
|
|
@@ -1494,7 +1494,7 @@ const Uo = (e) => {
|
|
|
1494
1494
|
(m) => !m.hidden
|
|
1495
1495
|
)) || [], s = !!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;
|
|
1496
1496
|
return /* @__PURE__ */ a(
|
|
1497
|
-
|
|
1497
|
+
Ho,
|
|
1498
1498
|
{
|
|
1499
1499
|
formik: i,
|
|
1500
1500
|
onCancel: o,
|
|
@@ -1530,7 +1530,7 @@ const Uo = (e) => {
|
|
|
1530
1530
|
termEndStatus: c
|
|
1531
1531
|
}
|
|
1532
1532
|
);
|
|
1533
|
-
},
|
|
1533
|
+
}, qo = (e) => {
|
|
1534
1534
|
const {
|
|
1535
1535
|
controls: t,
|
|
1536
1536
|
customTitleContentAddCard: n,
|
|
@@ -1580,7 +1580,7 @@ const Uo = (e) => {
|
|
|
1580
1580
|
handleSubmitForm: g,
|
|
1581
1581
|
handleDelete: h,
|
|
1582
1582
|
terms: f = !0
|
|
1583
|
-
} = e, m =
|
|
1583
|
+
} = e, m = fe("(max-width: 681px)"), y = fe("(max-width: 400px)"), { renderedCards: T, shouldRenderAddCard: S } = qo({
|
|
1584
1584
|
controls: t,
|
|
1585
1585
|
customTitleContentAddCard: n,
|
|
1586
1586
|
decisions: o,
|
|
@@ -1590,7 +1590,7 @@ const Uo = (e) => {
|
|
|
1590
1590
|
textValues: i
|
|
1591
1591
|
}), k = (o == null ? void 0 : o.length) === 0 && !s;
|
|
1592
1592
|
return /* @__PURE__ */ v(U, { children: [
|
|
1593
|
-
/* @__PURE__ */ a(
|
|
1593
|
+
/* @__PURE__ */ a(po, { children: /* @__PURE__ */ a(ho, { children: /* @__PURE__ */ a(w, { direction: "column", gap: "16px", padding: "6px", children: k ? /* @__PURE__ */ v(
|
|
1594
1594
|
w,
|
|
1595
1595
|
{
|
|
1596
1596
|
direction: "column",
|
|
@@ -1622,7 +1622,7 @@ const Uo = (e) => {
|
|
|
1622
1622
|
/* @__PURE__ */ a(
|
|
1623
1623
|
X,
|
|
1624
1624
|
{
|
|
1625
|
-
iconBefore: /* @__PURE__ */ a(
|
|
1625
|
+
iconBefore: /* @__PURE__ */ a(Ke, {}),
|
|
1626
1626
|
onClick: () => p ? p() : null,
|
|
1627
1627
|
children: n || "Agregar decisión"
|
|
1628
1628
|
}
|
|
@@ -1630,7 +1630,7 @@ const Uo = (e) => {
|
|
|
1630
1630
|
]
|
|
1631
1631
|
}
|
|
1632
1632
|
) : /* @__PURE__ */ v(
|
|
1633
|
-
|
|
1633
|
+
we,
|
|
1634
1634
|
{
|
|
1635
1635
|
templateColumns: y ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
|
|
1636
1636
|
autoFlow: "row dense",
|
|
@@ -1660,13 +1660,13 @@ const Uo = (e) => {
|
|
|
1660
1660
|
}
|
|
1661
1661
|
) }) }) }),
|
|
1662
1662
|
u && /* @__PURE__ */ a(
|
|
1663
|
-
|
|
1663
|
+
co,
|
|
1664
1664
|
{
|
|
1665
1665
|
portalId: "modal-portal",
|
|
1666
1666
|
onCloseModal: c,
|
|
1667
1667
|
title: l ? "Editar Decisión" : "Nueva decisión",
|
|
1668
1668
|
children: /* @__PURE__ */ a(
|
|
1669
|
-
|
|
1669
|
+
Bo,
|
|
1670
1670
|
{
|
|
1671
1671
|
decision: l || d,
|
|
1672
1672
|
onSubmitEvent: g,
|
|
@@ -1678,20 +1678,20 @@ const Uo = (e) => {
|
|
|
1678
1678
|
}
|
|
1679
1679
|
)
|
|
1680
1680
|
] });
|
|
1681
|
-
},
|
|
1681
|
+
}, Kn = (e) => {
|
|
1682
1682
|
const { children: t } = e;
|
|
1683
1683
|
return /* @__PURE__ */ a($r, { width: "100%", children: t });
|
|
1684
|
-
},
|
|
1684
|
+
}, Wo = (e) => e.value, Yo = (e) => e.value, Xo = (e) => e.value, Qo = (e) => ({
|
|
1685
1685
|
from: e.from ?? "",
|
|
1686
1686
|
to: e.to ?? ""
|
|
1687
|
-
}),
|
|
1688
|
-
[O.LIST_OF_VALUES]:
|
|
1689
|
-
[O.LIST_OF_VALUES_MULTI]:
|
|
1690
|
-
[O.RANGE]:
|
|
1691
|
-
[O.GREATER_THAN]:
|
|
1692
|
-
[O.LESS_THAN]:
|
|
1693
|
-
[O.EQUAL]:
|
|
1694
|
-
},
|
|
1687
|
+
}), Jo = (e) => e.value, Zo = (e) => e.value, Ko = (e) => e.value, ei = {
|
|
1688
|
+
[O.LIST_OF_VALUES]: Yo,
|
|
1689
|
+
[O.LIST_OF_VALUES_MULTI]: Xo,
|
|
1690
|
+
[O.RANGE]: Qo,
|
|
1691
|
+
[O.GREATER_THAN]: Jo,
|
|
1692
|
+
[O.LESS_THAN]: Zo,
|
|
1693
|
+
[O.EQUAL]: Ko
|
|
1694
|
+
}, $e = (e) => {
|
|
1695
1695
|
const t = e == null ? void 0 : e.value;
|
|
1696
1696
|
if (typeof t == "string" && t.includes(" a ")) {
|
|
1697
1697
|
const n = [
|
|
@@ -1708,8 +1708,8 @@ const Uo = (e) => {
|
|
|
1708
1708
|
}
|
|
1709
1709
|
return t;
|
|
1710
1710
|
}
|
|
1711
|
-
return typeof t == "object" && t !== null && !Array.isArray(t) ? "from" in t && "to" in t ? t : (
|
|
1712
|
-
},
|
|
1711
|
+
return typeof t == "object" && t !== null && !Array.isArray(t) ? "from" in t && "to" in t ? t : (ei[e == null ? void 0 : e.howToSetTheDecision] || Wo)(t) : t ?? void 0;
|
|
1712
|
+
}, ti = D.div`
|
|
1713
1713
|
display: flex;
|
|
1714
1714
|
justify-content: ${({ $justifyContent: e }) => e};
|
|
1715
1715
|
align-items: ${({ $alignItems: e }) => e};
|
|
@@ -1753,7 +1753,7 @@ const Uo = (e) => {
|
|
|
1753
1753
|
scroll: T = !1
|
|
1754
1754
|
} = e;
|
|
1755
1755
|
return /* @__PURE__ */ a(
|
|
1756
|
-
|
|
1756
|
+
ti,
|
|
1757
1757
|
{
|
|
1758
1758
|
ref: t,
|
|
1759
1759
|
direction: o,
|
|
@@ -1806,20 +1806,20 @@ D.div`
|
|
|
1806
1806
|
border-radius: 8px;
|
|
1807
1807
|
}
|
|
1808
1808
|
`;
|
|
1809
|
-
const
|
|
1809
|
+
const ni = D.div`
|
|
1810
1810
|
cursor: pointer;
|
|
1811
|
-
`,
|
|
1811
|
+
`, ri = D.div`
|
|
1812
1812
|
& > div > div > div > p {
|
|
1813
1813
|
text-wrap-mode: nowrap;
|
|
1814
1814
|
}
|
|
1815
|
-
`,
|
|
1815
|
+
`, oi = D.div`
|
|
1816
1816
|
& > div {
|
|
1817
1817
|
justify-content: auto;
|
|
1818
1818
|
gap: 8px;
|
|
1819
1819
|
}
|
|
1820
1820
|
`;
|
|
1821
|
-
var
|
|
1822
|
-
const
|
|
1821
|
+
var le = /* @__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))(le || {});
|
|
1822
|
+
const ii = (e) => {
|
|
1823
1823
|
const {
|
|
1824
1824
|
controls: t,
|
|
1825
1825
|
conditionsAlignment: n,
|
|
@@ -1844,15 +1844,15 @@ const oi = (e) => {
|
|
|
1844
1844
|
editionMode: C = "versioned"
|
|
1845
1845
|
} = e;
|
|
1846
1846
|
return i ? /* @__PURE__ */ v(w, { direction: "column", gap: "16px", children: [
|
|
1847
|
-
/* @__PURE__ */ a(
|
|
1847
|
+
/* @__PURE__ */ a(ni, { onClick: s, children: /* @__PURE__ */ v(
|
|
1848
1848
|
w,
|
|
1849
1849
|
{
|
|
1850
1850
|
alignItems: "start",
|
|
1851
1851
|
justifyContent: "space-between",
|
|
1852
1852
|
children: [
|
|
1853
1853
|
/* @__PURE__ */ v(w, { gap: "12px", children: [
|
|
1854
|
-
/* @__PURE__ */ a(
|
|
1855
|
-
|
|
1854
|
+
/* @__PURE__ */ a(ri, { children: /* @__PURE__ */ a(
|
|
1855
|
+
qe,
|
|
1856
1856
|
{
|
|
1857
1857
|
id: "tag",
|
|
1858
1858
|
appearance: "gray",
|
|
@@ -1860,11 +1860,11 @@ const oi = (e) => {
|
|
|
1860
1860
|
displayIcon: !1
|
|
1861
1861
|
}
|
|
1862
1862
|
) }),
|
|
1863
|
-
/* @__PURE__ */ a(
|
|
1863
|
+
/* @__PURE__ */ a(oi, { children: /* @__PURE__ */ a(
|
|
1864
1864
|
pt,
|
|
1865
1865
|
{
|
|
1866
1866
|
element: o,
|
|
1867
|
-
valueData:
|
|
1867
|
+
valueData: $e(
|
|
1868
1868
|
o
|
|
1869
1869
|
),
|
|
1870
1870
|
type: "decision",
|
|
@@ -1954,9 +1954,9 @@ const oi = (e) => {
|
|
|
1954
1954
|
element: {
|
|
1955
1955
|
...$,
|
|
1956
1956
|
value: $.value,
|
|
1957
|
-
howToSetTheCondition: $.howToSetTheCondition ===
|
|
1957
|
+
howToSetTheCondition: $.howToSetTheCondition === le.LIST_OF_VALUES ? le.LIST_OF_VALUES_MULTI : $.howToSetTheCondition
|
|
1958
1958
|
},
|
|
1959
|
-
valueData:
|
|
1959
|
+
valueData: $e(
|
|
1960
1960
|
$
|
|
1961
1961
|
),
|
|
1962
1962
|
editionMode: C
|
|
@@ -2007,11 +2007,11 @@ const oi = (e) => {
|
|
|
2007
2007
|
] })
|
|
2008
2008
|
] }) : /* @__PURE__ */ v(w, { justifyContent: "space-between", children: [
|
|
2009
2009
|
/* @__PURE__ */ v(w, { alignItems: "center", gap: "8px", children: [
|
|
2010
|
-
/* @__PURE__ */ a(
|
|
2011
|
-
/* @__PURE__ */ a(
|
|
2010
|
+
/* @__PURE__ */ a(se, { animated: !0, width: "150px" }),
|
|
2011
|
+
/* @__PURE__ */ a(se, { animated: !0, width: "70px" })
|
|
2012
2012
|
] }),
|
|
2013
2013
|
/* @__PURE__ */ v(w, { alignItems: "center", gap: "8px", children: [
|
|
2014
|
-
/* @__PURE__ */ a(
|
|
2014
|
+
/* @__PURE__ */ a(se, { animated: !0, width: "50px" }),
|
|
2015
2015
|
/* @__PURE__ */ a(Ir, { animated: !0 })
|
|
2016
2016
|
] })
|
|
2017
2017
|
] });
|
|
@@ -2022,7 +2022,7 @@ const oi = (e) => {
|
|
|
2022
2022
|
t.has(o) || (t.add(o), n.push(r));
|
|
2023
2023
|
}
|
|
2024
2024
|
return n;
|
|
2025
|
-
},
|
|
2025
|
+
}, Te = (e) => {
|
|
2026
2026
|
if (!e) return {};
|
|
2027
2027
|
if (Tn(e.conditionsThatEstablishesTheDecision)) {
|
|
2028
2028
|
const t = e.conditionsThatEstablishesTheDecision;
|
|
@@ -2042,14 +2042,14 @@ const oi = (e) => {
|
|
|
2042
2042
|
return Tn(e) ? Object.fromEntries(
|
|
2043
2043
|
Object.entries(e).map(([t, n]) => [t, yt(n)])
|
|
2044
2044
|
) : {};
|
|
2045
|
-
},
|
|
2045
|
+
}, er = (e, t) => Object.fromEntries(
|
|
2046
2046
|
Object.entries(e).map(([n, r]) => [n, r.filter(t)])
|
|
2047
|
-
),
|
|
2047
|
+
), ai = {
|
|
2048
2048
|
Year: { label: "en años", labelView: "años" },
|
|
2049
2049
|
Month: { label: "en meses", labelView: "meses" },
|
|
2050
2050
|
Day: { label: "en días", labelView: "días" }
|
|
2051
2051
|
}, Gt = (e, t, n = !1) => {
|
|
2052
|
-
const r =
|
|
2052
|
+
const r = ai[t ?? ""];
|
|
2053
2053
|
return r ? n ? `${e} ${r.labelView}` : `${e} ${r.label}` : e;
|
|
2054
2054
|
}, xn = (e, t) => {
|
|
2055
2055
|
if (e == null) return "";
|
|
@@ -2104,7 +2104,7 @@ const oi = (e) => {
|
|
|
2104
2104
|
return n !== void 0 || r !== void 0 ? zt(n) || zt(r) : !0;
|
|
2105
2105
|
}
|
|
2106
2106
|
return !1;
|
|
2107
|
-
},
|
|
2107
|
+
}, li = (e) => zt(e == null ? void 0 : e.value), Ut = (e, t) => e === "group-primary" ? "Condición principal" : `Condición alterna N° ${String(t).padStart(2, "0")}`, si = (e) => {
|
|
2108
2108
|
var i, d;
|
|
2109
2109
|
const t = ((i = e.listOfPossibleValues) == null ? void 0 : i.list) ?? [], n = e.value, r = Array.isArray(n) ? n : [n];
|
|
2110
2110
|
return { list: ((d = t.filter((u) => r.includes(u.value)).map((u, l) => ({
|
|
@@ -2112,8 +2112,8 @@ const oi = (e) => {
|
|
|
2112
2112
|
label: u.label,
|
|
2113
2113
|
value: u.label
|
|
2114
2114
|
}))[0]) == null ? void 0 : d.label) ?? "" };
|
|
2115
|
-
},
|
|
2116
|
-
var
|
|
2115
|
+
}, tr = (e) => {
|
|
2116
|
+
var Ge, ze, R;
|
|
2117
2117
|
const {
|
|
2118
2118
|
cardTitle: t = !0,
|
|
2119
2119
|
decision: n,
|
|
@@ -2131,10 +2131,10 @@ const oi = (e) => {
|
|
|
2131
2131
|
const { howToSetTheDecision: A, decisionDataType: F, value: I } = n;
|
|
2132
2132
|
if (!(A === _.RANGE && F === G.PERCENTAGE && I && typeof I == "object" && !Array.isArray(I) && "from" in I && "to" in I))
|
|
2133
2133
|
return n;
|
|
2134
|
-
const { from: z, to: j } = I, ce = String(z).trim(),
|
|
2134
|
+
const { from: z, to: j } = I, ce = String(z).trim(), ne = String(j).trim();
|
|
2135
2135
|
return {
|
|
2136
2136
|
...n,
|
|
2137
|
-
i18nValue: `De ${ce}% a ${
|
|
2137
|
+
i18nValue: `De ${ce}% a ${ne}%`
|
|
2138
2138
|
};
|
|
2139
2139
|
}, [n]) ?? n, f = !!(h != null && h.effectiveFrom), m = !!(h != null && h.validUntil), y = f ? {
|
|
2140
2140
|
element: {
|
|
@@ -2143,7 +2143,7 @@ const oi = (e) => {
|
|
|
2143
2143
|
howToSetTheDecision: _.EQUAL,
|
|
2144
2144
|
decisionDataType: G.DATE
|
|
2145
2145
|
},
|
|
2146
|
-
valueData:
|
|
2146
|
+
valueData: $e({
|
|
2147
2147
|
labelName: o == null ? void 0 : o.effectiveFrom,
|
|
2148
2148
|
value: ht(h.effectiveFrom),
|
|
2149
2149
|
howToSetTheDecision: _.EQUAL,
|
|
@@ -2156,23 +2156,23 @@ const oi = (e) => {
|
|
|
2156
2156
|
howToSetTheDecision: _.EQUAL,
|
|
2157
2157
|
decisionDataType: G.DATE
|
|
2158
2158
|
},
|
|
2159
|
-
valueData:
|
|
2159
|
+
valueData: $e({
|
|
2160
2160
|
labelName: o == null ? void 0 : o.validUntil,
|
|
2161
2161
|
value: ht(h.validUntil),
|
|
2162
2162
|
howToSetTheDecision: _.EQUAL,
|
|
2163
2163
|
decisionDataType: G.DATE
|
|
2164
2164
|
})
|
|
2165
|
-
} : null, S = (h == null ? void 0 : h.howToSetTheDecision) || _.EQUAL, k = S === _.RANGE && h && h.value && typeof h.value == "object" && "from" in h.value && "to" in h.value && h.value.from === h.value.to, E = S === _.LIST_OF_VALUES || S === _.LIST_OF_VALUES_MULTI, C = h && (E ?
|
|
2165
|
+
} : null, S = (h == null ? void 0 : h.howToSetTheDecision) || _.EQUAL, k = S === _.RANGE && h && h.value && typeof h.value == "object" && "from" in h.value && "to" in h.value && h.value.from === h.value.to, E = S === _.LIST_OF_VALUES || S === _.LIST_OF_VALUES_MULTI, C = h && (E ? si(h).list : (() => {
|
|
2166
2166
|
const A = h.i18nValue;
|
|
2167
2167
|
if (k) {
|
|
2168
|
-
const { from: b } = h.value, z =
|
|
2168
|
+
const { from: b } = h.value, z = $e({
|
|
2169
2169
|
...h,
|
|
2170
2170
|
howToSetTheDecision: _.EQUAL,
|
|
2171
2171
|
value: b
|
|
2172
2172
|
}), j = h.decisionDataType === G.PERCENTAGE ? "%" : "";
|
|
2173
2173
|
return `Del ${z}${j}`.trim();
|
|
2174
2174
|
}
|
|
2175
|
-
const F =
|
|
2175
|
+
const F = $e(
|
|
2176
2176
|
h
|
|
2177
2177
|
);
|
|
2178
2178
|
let I = A ?? F;
|
|
@@ -2184,9 +2184,9 @@ const oi = (e) => {
|
|
|
2184
2184
|
howToSetTheDecision: h.i18nValue || k ? _.EQUAL : S,
|
|
2185
2185
|
validUntil: h.validUntil
|
|
2186
2186
|
} : null, P = V.useMemo(
|
|
2187
|
-
() => h ?
|
|
2187
|
+
() => h ? Te(h) : {},
|
|
2188
2188
|
[h]
|
|
2189
|
-
), M = ((
|
|
2189
|
+
), M = ((ze = (Ge = h == null ? void 0 : h.conditionGroups) == null ? void 0 : Ge.map((A) => A == null ? void 0 : A.ConditionGroupId)) == null ? void 0 : ze.filter(Boolean)) || Object.keys(P), ee = M[0] || "group-primary", te = V.useMemo(() => {
|
|
2190
2190
|
const A = {}, F = P[ee] || [], I = P["group-primary"] || [];
|
|
2191
2191
|
A["group-primary"] = ee === "group-primary" ? I : [...F, ...I];
|
|
2192
2192
|
for (const b of M)
|
|
@@ -2194,16 +2194,16 @@ const oi = (e) => {
|
|
|
2194
2194
|
for (const b of Object.keys(P))
|
|
2195
2195
|
b === "group-primary" || b === ee || b in A || (A[b] = P[b]);
|
|
2196
2196
|
return A;
|
|
2197
|
-
}, [P, ee, M]),
|
|
2197
|
+
}, [P, ee, M]), Ne = V.useMemo(() => {
|
|
2198
2198
|
const A = {};
|
|
2199
|
-
return Object.keys(
|
|
2200
|
-
const I =
|
|
2199
|
+
return Object.keys(te).forEach((F) => {
|
|
2200
|
+
const I = te[F];
|
|
2201
2201
|
I && Array.isArray(I) ? A[F] = I.map((b) => {
|
|
2202
2202
|
let z = b.labelName;
|
|
2203
2203
|
b.timeUnit && b.labelName && (z = Gt(b.labelName, b.timeUnit));
|
|
2204
2204
|
let j = b.value;
|
|
2205
2205
|
if ((b == null ? void 0 : b.howToSetTheCondition) === _.RANGE && (b == null ? void 0 : b.conditionDataType) === G.PERCENTAGE && (b == null ? void 0 : b.value) && typeof b.value == "object" && !Array.isArray(b.value) && "from" in b.value && "to" in b.value) {
|
|
2206
|
-
const { from:
|
|
2206
|
+
const { from: re, to: oe } = b.value, H = String(re).trim(), J = String(oe).trim();
|
|
2207
2207
|
return j = `De ${H}% a ${J}%`, {
|
|
2208
2208
|
...b,
|
|
2209
2209
|
labelName: z,
|
|
@@ -2212,8 +2212,8 @@ const oi = (e) => {
|
|
|
2212
2212
|
};
|
|
2213
2213
|
}
|
|
2214
2214
|
if ((b == null ? void 0 : b.howToSetTheCondition) === _.GREATER_THAN && (b == null ? void 0 : b.conditionDataType) === G.PERCENTAGE && (b == null ? void 0 : b.value) !== void 0 && (b == null ? void 0 : b.value) !== null && (b == null ? void 0 : b.value) !== "") {
|
|
2215
|
-
const
|
|
2216
|
-
return j = `Mayor a ${String(
|
|
2215
|
+
const re = b.value;
|
|
2216
|
+
return j = `Mayor a ${String(re).trim()}%`, {
|
|
2217
2217
|
...b,
|
|
2218
2218
|
labelName: z,
|
|
2219
2219
|
value: j,
|
|
@@ -2221,8 +2221,8 @@ const oi = (e) => {
|
|
|
2221
2221
|
};
|
|
2222
2222
|
}
|
|
2223
2223
|
if ((b == null ? void 0 : b.howToSetTheCondition) === _.LESS_THAN && (b == null ? void 0 : b.conditionDataType) === G.PERCENTAGE && (b == null ? void 0 : b.value) !== void 0 && (b == null ? void 0 : b.value) !== null && (b == null ? void 0 : b.value) !== "") {
|
|
2224
|
-
const
|
|
2225
|
-
return j = `Menor a ${String(
|
|
2224
|
+
const re = b.value;
|
|
2225
|
+
return j = `Menor a ${String(re).trim()}%`, {
|
|
2226
2226
|
...b,
|
|
2227
2227
|
labelName: z,
|
|
2228
2228
|
value: j,
|
|
@@ -2243,22 +2243,22 @@ const oi = (e) => {
|
|
|
2243
2243
|
};
|
|
2244
2244
|
}) : A[F] = I;
|
|
2245
2245
|
}), A;
|
|
2246
|
-
}, [
|
|
2247
|
-
|
|
2246
|
+
}, [te]), nt = er(
|
|
2247
|
+
Ne,
|
|
2248
2248
|
(A) => !A.hidden
|
|
2249
|
-
),
|
|
2250
|
-
const A = Object.entries(
|
|
2251
|
-
([I, b]) => [I, b.filter(
|
|
2249
|
+
), je = V.useMemo(() => {
|
|
2250
|
+
const A = Object.entries(nt).map(
|
|
2251
|
+
([I, b]) => [I, b.filter(li)]
|
|
2252
2252
|
), F = {};
|
|
2253
2253
|
for (const [I, b] of A)
|
|
2254
2254
|
b.length > 0 && (F[I] = b);
|
|
2255
2255
|
return F;
|
|
2256
|
-
}, [
|
|
2257
|
-
const A = Object.keys(
|
|
2256
|
+
}, [nt]), _e = V.useMemo(() => {
|
|
2257
|
+
const A = Object.keys(je);
|
|
2258
2258
|
return A.includes("group-primary") ? ["group-primary", ...A.filter((F) => F !== "group-primary")] : A;
|
|
2259
|
-
}, [
|
|
2259
|
+
}, [je]), rt = {};
|
|
2260
2260
|
let ot = 1;
|
|
2261
|
-
const it =
|
|
2261
|
+
const it = _e.map((A) => {
|
|
2262
2262
|
const F = A === "group-primary" ? "mainCondition" : `alternateCondition-${ot++}`;
|
|
2263
2263
|
return rt[F] = A, {
|
|
2264
2264
|
id: F,
|
|
@@ -2267,9 +2267,9 @@ const oi = (e) => {
|
|
|
2267
2267
|
};
|
|
2268
2268
|
}), [at, lt] = V.useState(
|
|
2269
2269
|
((R = it[0]) == null ? void 0 : R.id) ?? "mainCondition"
|
|
2270
|
-
), kt = (A) => lt(A), st = rt[at] ??
|
|
2270
|
+
), kt = (A) => lt(A), st = rt[at] ?? _e[0] ?? "group-primary", dt = je[st] ?? [], Ve = _e.length > 1, dn = Array.from({ length: 5 }), cn = !!(!r && h && o && $), un = dt.length < 2 ? "start" : "space-between", pn = `N° ${String((i ?? 0) + 1).padStart(2, "0")}`;
|
|
2271
2271
|
return /* @__PURE__ */ a(
|
|
2272
|
-
|
|
2272
|
+
ii,
|
|
2273
2273
|
{
|
|
2274
2274
|
conditionsAlignment: un,
|
|
2275
2275
|
controls: p,
|
|
@@ -2291,11 +2291,11 @@ const oi = (e) => {
|
|
|
2291
2291
|
selectedTab: at,
|
|
2292
2292
|
onTabChange: kt,
|
|
2293
2293
|
currentConditions: dt,
|
|
2294
|
-
hasMultipleGroups:
|
|
2294
|
+
hasMultipleGroups: Ve,
|
|
2295
2295
|
editionMode: c
|
|
2296
2296
|
}
|
|
2297
2297
|
);
|
|
2298
|
-
},
|
|
2298
|
+
}, di = en`
|
|
2299
2299
|
from {
|
|
2300
2300
|
opacity: 0;
|
|
2301
2301
|
transform: translateY(20px);
|
|
@@ -2329,7 +2329,7 @@ D.div`
|
|
|
2329
2329
|
}};
|
|
2330
2330
|
}
|
|
2331
2331
|
`;
|
|
2332
|
-
const
|
|
2332
|
+
const ci = D.div`
|
|
2333
2333
|
& > div {
|
|
2334
2334
|
box-shadow: 0px 2px 3px 0px
|
|
2335
2335
|
${({ theme: e }) => {
|
|
@@ -2338,18 +2338,18 @@ const di = D.div`
|
|
|
2338
2338
|
}};
|
|
2339
2339
|
cursor: pointer;
|
|
2340
2340
|
}
|
|
2341
|
-
`,
|
|
2341
|
+
`, ui = D.div`
|
|
2342
2342
|
width: 100%;
|
|
2343
2343
|
height: 100%;
|
|
2344
2344
|
& > div {
|
|
2345
|
-
animation: ${
|
|
2345
|
+
animation: ${di} 600ms ease-out;
|
|
2346
2346
|
}
|
|
2347
|
-
`,
|
|
2347
|
+
`, pi = D.div`
|
|
2348
2348
|
& > div > div {
|
|
2349
2349
|
border-radius: 8px;
|
|
2350
2350
|
box-sizing: border-box;
|
|
2351
2351
|
}
|
|
2352
|
-
`,
|
|
2352
|
+
`, hi = D.div`
|
|
2353
2353
|
& > div {
|
|
2354
2354
|
width: 100%;
|
|
2355
2355
|
height: 100%;
|
|
@@ -2369,21 +2369,21 @@ const di = D.div`
|
|
|
2369
2369
|
border-radius: 8px;
|
|
2370
2370
|
}
|
|
2371
2371
|
}
|
|
2372
|
-
`,
|
|
2372
|
+
`, gi = (e) => {
|
|
2373
2373
|
const { index: t, handleOpenModal: n } = e;
|
|
2374
2374
|
return /* @__PURE__ */ a(
|
|
2375
|
-
|
|
2375
|
+
Kn,
|
|
2376
2376
|
{
|
|
2377
2377
|
id: `loading-card-${t}`,
|
|
2378
2378
|
handleDelete: () => {
|
|
2379
2379
|
},
|
|
2380
2380
|
handleView: () => n ? n() : null,
|
|
2381
2381
|
controls: !1,
|
|
2382
|
-
children: /* @__PURE__ */ a(
|
|
2382
|
+
children: /* @__PURE__ */ a(tr, { loading: !0 })
|
|
2383
2383
|
},
|
|
2384
2384
|
`loading-card-${t}`
|
|
2385
2385
|
);
|
|
2386
|
-
},
|
|
2386
|
+
}, fi = (e) => {
|
|
2387
2387
|
const {
|
|
2388
2388
|
cardTitle: t,
|
|
2389
2389
|
decision: n,
|
|
@@ -2396,14 +2396,14 @@ const di = D.div`
|
|
|
2396
2396
|
onToggle: s,
|
|
2397
2397
|
editionMode: p
|
|
2398
2398
|
} = e;
|
|
2399
|
-
return n ? /* @__PURE__ */ a(
|
|
2400
|
-
|
|
2399
|
+
return n ? /* @__PURE__ */ a(tt, { children: /* @__PURE__ */ a(w, { direction: "column", gap: "4px", width: "100%", children: /* @__PURE__ */ a(
|
|
2400
|
+
Kn,
|
|
2401
2401
|
{
|
|
2402
2402
|
id: n.decisionId,
|
|
2403
2403
|
handleDelete: () => i ? i(n.decisionId) : null,
|
|
2404
2404
|
handleView: () => o ? o(n) : null,
|
|
2405
2405
|
children: /* @__PURE__ */ a(
|
|
2406
|
-
|
|
2406
|
+
tr,
|
|
2407
2407
|
{
|
|
2408
2408
|
cardTitle: t,
|
|
2409
2409
|
controls: r,
|
|
@@ -2419,15 +2419,15 @@ const di = D.div`
|
|
|
2419
2419
|
)
|
|
2420
2420
|
}
|
|
2421
2421
|
) }) }, n.decisionId) : null;
|
|
2422
|
-
},
|
|
2422
|
+
}, mi = (e) => {
|
|
2423
2423
|
const {
|
|
2424
2424
|
customTitleContentAddCard: t,
|
|
2425
2425
|
index: n,
|
|
2426
2426
|
handleOpenModal: r,
|
|
2427
2427
|
shouldRenderEmptyMessage: o
|
|
2428
2428
|
} = e;
|
|
2429
|
-
return /* @__PURE__ */ a(
|
|
2430
|
-
|
|
2429
|
+
return /* @__PURE__ */ a(ui, { children: o ? null : /* @__PURE__ */ a(
|
|
2430
|
+
ci,
|
|
2431
2431
|
{
|
|
2432
2432
|
onClick: () => r ? r() : null,
|
|
2433
2433
|
children: /* @__PURE__ */ a(
|
|
@@ -2451,7 +2451,7 @@ const di = D.div`
|
|
|
2451
2451
|
B,
|
|
2452
2452
|
{
|
|
2453
2453
|
appearance: "gray",
|
|
2454
|
-
icon: /* @__PURE__ */ a(
|
|
2454
|
+
icon: /* @__PURE__ */ a(Ke, {}),
|
|
2455
2455
|
size: "24px",
|
|
2456
2456
|
cursorHover: !0
|
|
2457
2457
|
}
|
|
@@ -2463,14 +2463,14 @@ const di = D.div`
|
|
|
2463
2463
|
)
|
|
2464
2464
|
}
|
|
2465
2465
|
) }, `add-decision-${n}`);
|
|
2466
|
-
},
|
|
2467
|
-
loading:
|
|
2468
|
-
decision:
|
|
2469
|
-
add:
|
|
2466
|
+
}, bi = {
|
|
2467
|
+
loading: gi,
|
|
2468
|
+
decision: fi,
|
|
2469
|
+
add: mi
|
|
2470
2470
|
}, Ht = (e) => {
|
|
2471
|
-
const { type: t } = e, n =
|
|
2471
|
+
const { type: t } = e, n = bi[t];
|
|
2472
2472
|
return n ? n(e) : null;
|
|
2473
|
-
},
|
|
2473
|
+
}, vi = (e) => {
|
|
2474
2474
|
const {
|
|
2475
2475
|
cardTitle: t,
|
|
2476
2476
|
controls: n,
|
|
@@ -2513,20 +2513,20 @@ const di = D.div`
|
|
|
2513
2513
|
})
|
|
2514
2514
|
), h = ((o == null ? void 0 : o.length) === 0 || o.length < Math.floor(window.innerWidth / 300)) && !i && n;
|
|
2515
2515
|
return { renderedCards: g, shouldRenderAddCard: h };
|
|
2516
|
-
},
|
|
2516
|
+
}, yi = D.div`
|
|
2517
2517
|
position: relative;
|
|
2518
2518
|
& > div {
|
|
2519
2519
|
padding: 24px 16px;
|
|
2520
2520
|
place-items: unset;
|
|
2521
2521
|
}
|
|
2522
2522
|
z-index: 3;
|
|
2523
|
-
`,
|
|
2523
|
+
`, Ti = D.div`
|
|
2524
2524
|
background-color: ${({ theme: e }) => {
|
|
2525
2525
|
var t, n;
|
|
2526
2526
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || N.palette.neutral.N0;
|
|
2527
2527
|
}};
|
|
2528
2528
|
max-height: 90vh;
|
|
2529
|
-
width: 100
|
|
2529
|
+
width: ${({ $size: e }) => e || "100%"};
|
|
2530
2530
|
max-width: 50rem;
|
|
2531
2531
|
overflow-y: ${({ smallScreen: e }) => e ? "hidden" : "auto"};
|
|
2532
2532
|
border-radius: 8px;
|
|
@@ -2552,15 +2552,14 @@ const di = D.div`
|
|
|
2552
2552
|
background-color: #ebecf0;
|
|
2553
2553
|
border-radius: 8px;
|
|
2554
2554
|
}
|
|
2555
|
-
`,
|
|
2556
|
-
const { children: t, description: n, portalId: r, onCloseModal: o, title: i } = e,
|
|
2557
|
-
if (!
|
|
2555
|
+
`, nr = (e) => {
|
|
2556
|
+
const { children: t, description: n, portalId: r, onCloseModal: o, title: i, size: d } = e, u = document.getElementById(r);
|
|
2557
|
+
if (!u)
|
|
2558
2558
|
throw new Error(
|
|
2559
2559
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
2560
2560
|
);
|
|
2561
|
-
const u = se("(max-width: 400px)");
|
|
2562
2561
|
return tn(
|
|
2563
|
-
/* @__PURE__ */ a(
|
|
2562
|
+
/* @__PURE__ */ a(yi, { children: /* @__PURE__ */ a(Zt, { children: /* @__PURE__ */ a(Ti, { $size: d, children: /* @__PURE__ */ v(w, { direction: "column", gap: "24px", children: [
|
|
2564
2563
|
/* @__PURE__ */ v(w, { direction: "column", gap: "24px", children: [
|
|
2565
2564
|
/* @__PURE__ */ v(w, { alignItems: "center", justifyContent: "space-between", children: [
|
|
2566
2565
|
/* @__PURE__ */ v(w, { direction: "column", gap: "8px", children: [
|
|
@@ -2582,17 +2581,17 @@ const di = D.div`
|
|
|
2582
2581
|
] }),
|
|
2583
2582
|
t
|
|
2584
2583
|
] }) }) }) }),
|
|
2585
|
-
|
|
2584
|
+
u
|
|
2586
2585
|
);
|
|
2587
2586
|
}, xi = (e) => ({
|
|
2588
|
-
schema:
|
|
2587
|
+
schema: ve().required("Requerido").test(
|
|
2589
2588
|
"non-empty",
|
|
2590
2589
|
"El valor no puede estar vacío",
|
|
2591
2590
|
(t) => t != null && t.trim() !== ""
|
|
2592
2591
|
),
|
|
2593
2592
|
value: e
|
|
2594
2593
|
}), wi = (e) => ({
|
|
2595
|
-
schema:
|
|
2594
|
+
schema: xe().test(
|
|
2596
2595
|
"isArrayOrString",
|
|
2597
2596
|
"Por favor selecciona una opcion",
|
|
2598
2597
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -2601,7 +2600,7 @@ const di = D.div`
|
|
|
2601
2600
|
),
|
|
2602
2601
|
value: e
|
|
2603
2602
|
}), Si = (e) => ({
|
|
2604
|
-
schema:
|
|
2603
|
+
schema: xe().test(
|
|
2605
2604
|
"isArrayOrString",
|
|
2606
2605
|
"Por favor selecciona al menos una opcion",
|
|
2607
2606
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -2645,7 +2644,7 @@ const di = D.div`
|
|
|
2645
2644
|
}), An = (e) => e && typeof e == "object" && !Array.isArray(e) && "value" in e && e.value !== "" && e.value != null, Rt = (e, t) => {
|
|
2646
2645
|
if (An(e))
|
|
2647
2646
|
return {
|
|
2648
|
-
schema:
|
|
2647
|
+
schema: xe().test(
|
|
2649
2648
|
"required-option",
|
|
2650
2649
|
"Por favor selecciona una opcion",
|
|
2651
2650
|
(n) => An(n)
|
|
@@ -2659,8 +2658,8 @@ const di = D.div`
|
|
|
2659
2658
|
value: n
|
|
2660
2659
|
} : {
|
|
2661
2660
|
schema: W({
|
|
2662
|
-
from:
|
|
2663
|
-
to:
|
|
2661
|
+
from: ve().required("Requerido"),
|
|
2662
|
+
to: ve().required("Requerido")
|
|
2664
2663
|
}),
|
|
2665
2664
|
value: n
|
|
2666
2665
|
};
|
|
@@ -2669,7 +2668,7 @@ const di = D.div`
|
|
|
2669
2668
|
schema: me().required("El campo porcentaje es requerido").min(0, "El porcentaje no puede ser menor a 0").max(100, "El porcentaje no puede ser mayor a 100"),
|
|
2670
2669
|
value: e
|
|
2671
2670
|
} : {
|
|
2672
|
-
schema:
|
|
2671
|
+
schema: xe().test("required", "Requerido", (n) => n == null ? !1 : typeof n == "string" ? n.trim().length > 0 : typeof n == "number" ? !Number.isNaN(n) : !1),
|
|
2673
2672
|
value: e
|
|
2674
2673
|
};
|
|
2675
2674
|
}, Ei = {
|
|
@@ -2682,7 +2681,7 @@ const di = D.div`
|
|
|
2682
2681
|
}, kn = (e) => Ei[e] || xi, $n = "El valor desde no puede ser mayor que el valor hasta", In = (e) => {
|
|
2683
2682
|
var t;
|
|
2684
2683
|
return Array.isArray((t = e == null ? void 0 : e.listOfPossibleValues) == null ? void 0 : t.list) && e.listOfPossibleValues.list.length > 0;
|
|
2685
|
-
}, Bt =
|
|
2684
|
+
}, Bt = xe().test(
|
|
2686
2685
|
"required-option",
|
|
2687
2686
|
"Por favor selecciona una opcion",
|
|
2688
2687
|
(e) => {
|
|
@@ -2726,13 +2725,13 @@ function ki({
|
|
|
2726
2725
|
onSubmitEvent: t,
|
|
2727
2726
|
textValues: n
|
|
2728
2727
|
}) {
|
|
2729
|
-
const r =
|
|
2728
|
+
const r = Te(e) || {}, o = () => Object.entries(r).flatMap(
|
|
2730
2729
|
([g, h]) => h.map((f) => ({ group: g, cond: f }))
|
|
2731
2730
|
), i = Object.fromEntries(
|
|
2732
2731
|
Object.entries(r).map(([g, h]) => {
|
|
2733
2732
|
const f = {};
|
|
2734
2733
|
return h.forEach((m) => {
|
|
2735
|
-
const y = m.conditionName, T = m.value !== void 0 && m.value !== null && m.value !== "", S = m.howToSetTheCondition ===
|
|
2734
|
+
const y = m.conditionName, T = m.value !== void 0 && m.value !== null && m.value !== "", S = m.howToSetTheCondition === le.LIST_OF_VALUES_MULTI ? [] : "";
|
|
2736
2735
|
f[y] = {
|
|
2737
2736
|
...m,
|
|
2738
2737
|
value: T ? m.value : S
|
|
@@ -2768,16 +2767,16 @@ function ki({
|
|
|
2768
2767
|
};
|
|
2769
2768
|
let l;
|
|
2770
2769
|
const s = {
|
|
2771
|
-
ruleName:
|
|
2772
|
-
value:
|
|
2770
|
+
ruleName: ve().required("El nombre de la decision es requerido"),
|
|
2771
|
+
value: Je(() => {
|
|
2773
2772
|
const g = l.values.howToSetTheDecision;
|
|
2774
|
-
return g ===
|
|
2773
|
+
return g === le.RANGE && In(e) ? Ni : In(e) ? Bt : kn(g)(
|
|
2775
2774
|
l.values.value,
|
|
2776
2775
|
l.values.decisionDataType
|
|
2777
2776
|
).schema;
|
|
2778
2777
|
}),
|
|
2779
|
-
conditionsThatEstablishesTheDecision:
|
|
2780
|
-
const f =
|
|
2778
|
+
conditionsThatEstablishesTheDecision: Je((g, { parent: h }) => {
|
|
2779
|
+
const f = Te(e) || {};
|
|
2781
2780
|
if (Object.keys(f).length === 0) return W().shape({});
|
|
2782
2781
|
const m = h == null ? void 0 : h.conditionsThatEstablishesTheDecision, y = !!(h != null && h.toggleNone);
|
|
2783
2782
|
let T = !1;
|
|
@@ -2791,21 +2790,21 @@ function ki({
|
|
|
2791
2790
|
E.forEach((P) => {
|
|
2792
2791
|
const M = C == null ? void 0 : C[P.conditionName];
|
|
2793
2792
|
if (!Ot(M)) return;
|
|
2794
|
-
const ee = qt(M),
|
|
2793
|
+
const ee = qt(M), Ne = kn(
|
|
2795
2794
|
P.howToSetTheCondition
|
|
2796
2795
|
)(
|
|
2797
2796
|
ee,
|
|
2798
2797
|
P.conditionDataType
|
|
2799
2798
|
).schema;
|
|
2800
|
-
$[P.conditionName] = Ai(
|
|
2799
|
+
$[P.conditionName] = Ai(Ne);
|
|
2801
2800
|
}), S[k] = W($);
|
|
2802
2801
|
}
|
|
2803
2802
|
return W(S);
|
|
2804
2803
|
})
|
|
2805
2804
|
};
|
|
2806
|
-
n.terms && (s.effectiveFrom =
|
|
2805
|
+
n.terms && (s.effectiveFrom = Fe().required(
|
|
2807
2806
|
"Se requiere la fecha de vigencia desde"
|
|
2808
|
-
), s.validUntil =
|
|
2807
|
+
), s.validUntil = Fe().when(
|
|
2809
2808
|
"checkClosed",
|
|
2810
2809
|
(g, h, { parent: f }) => (f == null ? void 0 : f.checkClosed) ? h.required("Se requiere la fecha de vigencia hasta").test(
|
|
2811
2810
|
"is-after-startDate",
|
|
@@ -2852,7 +2851,7 @@ function ki({
|
|
|
2852
2851
|
if (g)
|
|
2853
2852
|
l.setFieldValue(m, void 0);
|
|
2854
2853
|
else {
|
|
2855
|
-
const y = f.howToSetTheCondition ===
|
|
2854
|
+
const y = f.howToSetTheCondition === le.LIST_OF_VALUES_MULTI ? [] : "";
|
|
2856
2855
|
l.setFieldValue(
|
|
2857
2856
|
m,
|
|
2858
2857
|
{
|
|
@@ -2924,7 +2923,7 @@ const $i = D.div`
|
|
|
2924
2923
|
T(M.target.value), t(M);
|
|
2925
2924
|
}, $ = (M) => {
|
|
2926
2925
|
k(M.target.value), n(M);
|
|
2927
|
-
}, P =
|
|
2926
|
+
}, P = fe("(max-width: 400px)");
|
|
2928
2927
|
return /* @__PURE__ */ v(w, { direction: "column", width: "100%", gap: "20px", children: [
|
|
2929
2928
|
/* @__PURE__ */ v(w, { justifyContent: "space-between", children: [
|
|
2930
2929
|
/* @__PURE__ */ a(L, { appearance: "dark", size: "large", type: "label", children: "¿La vigencia para este decisión es cerrada?" }),
|
|
@@ -2946,7 +2945,7 @@ const $i = D.div`
|
|
|
2946
2945
|
gap: "24px",
|
|
2947
2946
|
children: [
|
|
2948
2947
|
/* @__PURE__ */ a(
|
|
2949
|
-
|
|
2948
|
+
Oe,
|
|
2950
2949
|
{
|
|
2951
2950
|
id: "dateStart",
|
|
2952
2951
|
label: o,
|
|
@@ -2960,7 +2959,7 @@ const $i = D.div`
|
|
|
2960
2959
|
}
|
|
2961
2960
|
),
|
|
2962
2961
|
f && /* @__PURE__ */ a(
|
|
2963
|
-
|
|
2962
|
+
Oe,
|
|
2964
2963
|
{
|
|
2965
2964
|
id: "dateEnd",
|
|
2966
2965
|
label: i,
|
|
@@ -3000,7 +2999,7 @@ const $i = D.div`
|
|
|
3000
2999
|
} = e;
|
|
3001
3000
|
return /* @__PURE__ */ v(U, { children: [
|
|
3002
3001
|
/* @__PURE__ */ a("form", { onSubmit: r.handleSubmit, children: /* @__PURE__ */ v(w, { direction: "column", gap: "24px", width: "100%", children: [
|
|
3003
|
-
/* @__PURE__ */ a(
|
|
3002
|
+
/* @__PURE__ */ a(We, { legend: "Decisión N° 01", spacing: "wide", children: /* @__PURE__ */ v(
|
|
3004
3003
|
w,
|
|
3005
3004
|
{
|
|
3006
3005
|
justifyContent: "center",
|
|
@@ -3016,7 +3015,7 @@ const $i = D.div`
|
|
|
3016
3015
|
]
|
|
3017
3016
|
}
|
|
3018
3017
|
) }),
|
|
3019
|
-
n && n.length > 0 && /* @__PURE__ */ a(
|
|
3018
|
+
n && n.length > 0 && /* @__PURE__ */ a(We, { legend: "Condiciones a evaluar", spacing: "wide", children: /* @__PURE__ */ v(w, { direction: "column", gap: "20px", width: "100%", children: [
|
|
3020
3019
|
/* @__PURE__ */ a(
|
|
3021
3020
|
Yn,
|
|
3022
3021
|
{
|
|
@@ -3074,7 +3073,7 @@ const $i = D.div`
|
|
|
3074
3073
|
}) }),
|
|
3075
3074
|
l && /* @__PURE__ */ a(L, { type: "label", size: "medium", appearance: "danger", children: "Existen errores en el formulario, por favor revísalos." })
|
|
3076
3075
|
] }) }),
|
|
3077
|
-
/* @__PURE__ */ a(
|
|
3076
|
+
/* @__PURE__ */ a(We, { legend: "Vigencia", spacing: "wide", children: g.terms && /* @__PURE__ */ a(
|
|
3078
3077
|
Ii,
|
|
3079
3078
|
{
|
|
3080
3079
|
labelStart: g.termStart,
|
|
@@ -3099,11 +3098,12 @@ const $i = D.div`
|
|
|
3099
3098
|
] })
|
|
3100
3099
|
] }) }),
|
|
3101
3100
|
f && h && /* @__PURE__ */ a(
|
|
3102
|
-
|
|
3101
|
+
nr,
|
|
3103
3102
|
{
|
|
3104
3103
|
portalId: h,
|
|
3105
3104
|
title: "Redefinir la condición",
|
|
3106
3105
|
onCloseModal: y,
|
|
3106
|
+
size: "600px",
|
|
3107
3107
|
children: /* @__PURE__ */ v(w, { direction: "column", gap: "16px", children: [
|
|
3108
3108
|
/* @__PURE__ */ a(L, { 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 ." }),
|
|
3109
3109
|
/* @__PURE__ */ v(w, { justifyContent: "end", gap: "12px", children: [
|
|
@@ -3178,19 +3178,19 @@ function Gi(e) {
|
|
|
3178
3178
|
return "sea";
|
|
3179
3179
|
}
|
|
3180
3180
|
}
|
|
3181
|
-
const
|
|
3181
|
+
const Ue = (e) => {
|
|
3182
3182
|
if (typeof e == "string") {
|
|
3183
3183
|
const t = e.toLowerCase();
|
|
3184
|
-
if (t.includes("equal")) return
|
|
3185
|
-
if (t.includes("greater")) return
|
|
3186
|
-
if (t.includes("less")) return
|
|
3187
|
-
if (t.includes("range") || t.includes("between")) return
|
|
3188
|
-
if (t.includes("multi")) return
|
|
3184
|
+
if (t.includes("equal")) return le.EQUAL;
|
|
3185
|
+
if (t.includes("greater")) return le.GREATER_THAN;
|
|
3186
|
+
if (t.includes("less")) return le.LESS_THAN;
|
|
3187
|
+
if (t.includes("range") || t.includes("between")) return le.RANGE;
|
|
3188
|
+
if (t.includes("multi")) return le.LIST_OF_VALUES_MULTI;
|
|
3189
3189
|
if (t.includes("list_of_values") || t.includes("among") || t.includes("in"))
|
|
3190
|
-
return
|
|
3190
|
+
return le.LIST_OF_VALUES;
|
|
3191
3191
|
}
|
|
3192
|
-
return e ??
|
|
3193
|
-
},
|
|
3192
|
+
return e ?? le.EQUAL;
|
|
3193
|
+
}, He = (e) => {
|
|
3194
3194
|
switch (e) {
|
|
3195
3195
|
case _.LIST_OF_VALUES_MULTI:
|
|
3196
3196
|
return [];
|
|
@@ -3216,7 +3216,7 @@ const He = (e) => {
|
|
|
3216
3216
|
var r, o;
|
|
3217
3217
|
return (o = (r = e == null ? void 0 : e.conditionsThatEstablishesTheDecision) == null ? void 0 : r[t]) == null ? void 0 : o[n];
|
|
3218
3218
|
}, Hi = (e) => {
|
|
3219
|
-
var
|
|
3219
|
+
var Ge, ze;
|
|
3220
3220
|
const {
|
|
3221
3221
|
decision: t,
|
|
3222
3222
|
onSubmitEvent: n,
|
|
@@ -3229,7 +3229,7 @@ const He = (e) => {
|
|
|
3229
3229
|
decision: t,
|
|
3230
3230
|
onSubmitEvent: n,
|
|
3231
3231
|
textValues: r
|
|
3232
|
-
}), p = u ?? t, c =
|
|
3232
|
+
}), p = u ?? t, c = Te(p), g = Te(t), h = er(
|
|
3233
3233
|
g,
|
|
3234
3234
|
(R) => !R.hidden
|
|
3235
3235
|
), f = Object.keys(h), m = f.includes("group-primary") && f.length > 0 ? "group-primary" : f[0], y = m != null ? [
|
|
@@ -3245,7 +3245,7 @@ const He = (e) => {
|
|
|
3245
3245
|
isDisabled: !1
|
|
3246
3246
|
};
|
|
3247
3247
|
}), [E, C] = V.useState(
|
|
3248
|
-
((
|
|
3248
|
+
((Ge = k[0]) == null ? void 0 : Ge.id) ?? "mainCondition"
|
|
3249
3249
|
), $ = (R) => C(R), P = T[E] ?? m ?? "group-primary";
|
|
3250
3250
|
V.useEffect(() => {
|
|
3251
3251
|
var b;
|
|
@@ -3254,15 +3254,15 @@ const He = (e) => {
|
|
|
3254
3254
|
if (R && typeof R == "object" && (A = Object.values(R).some(
|
|
3255
3255
|
(z) => z && typeof z == "object" && Object.keys(z).length > 0
|
|
3256
3256
|
)), A) return;
|
|
3257
|
-
const F =
|
|
3257
|
+
const F = Te(t);
|
|
3258
3258
|
if (!F || Object.keys(F).length === 0)
|
|
3259
3259
|
return;
|
|
3260
3260
|
const I = Object.fromEntries(
|
|
3261
3261
|
Object.entries(F).map(([z, j]) => {
|
|
3262
3262
|
const ce = Object.fromEntries(
|
|
3263
|
-
j.map((
|
|
3264
|
-
const
|
|
3265
|
-
return [
|
|
3263
|
+
j.map((ne) => {
|
|
3264
|
+
const ge = Ue(ne.howToSetTheCondition), re = ne.value ?? He(ge);
|
|
3265
|
+
return [ne.conditionName, re];
|
|
3266
3266
|
})
|
|
3267
3267
|
);
|
|
3268
3268
|
return [z, ce];
|
|
@@ -3277,38 +3277,38 @@ const He = (e) => {
|
|
|
3277
3277
|
var j;
|
|
3278
3278
|
const R = (j = l.values) == null ? void 0 : j.conditionsThatEstablishesTheDecision;
|
|
3279
3279
|
if (!R || typeof R != "object") return;
|
|
3280
|
-
const A =
|
|
3281
|
-
([ce,
|
|
3282
|
-
const
|
|
3283
|
-
const H =
|
|
3280
|
+
const A = Te(p), F = Object.entries(R).map(
|
|
3281
|
+
([ce, ne]) => {
|
|
3282
|
+
const ge = A[ce] || [], re = Object.keys(ne).map((oe) => {
|
|
3283
|
+
const H = ne[oe], J = ge.find((mr) => mr.conditionName === oe) || {}, $t = Ue(
|
|
3284
3284
|
J.howToSetTheCondition ?? (H == null ? void 0 : H.howToSetTheCondition)
|
|
3285
|
-
), ct = J.value ??
|
|
3285
|
+
), ct = J.value ?? He($t), ut = H && typeof H == "object" && "value" in H ? H.value : H;
|
|
3286
3286
|
return {
|
|
3287
3287
|
...J,
|
|
3288
3288
|
...typeof H == "object" && !Array.isArray(H) ? H : {},
|
|
3289
|
-
conditionName:
|
|
3289
|
+
conditionName: oe,
|
|
3290
3290
|
value: ut !== void 0 ? ut : ct
|
|
3291
3291
|
};
|
|
3292
3292
|
});
|
|
3293
3293
|
return {
|
|
3294
3294
|
ConditionGroupId: ce,
|
|
3295
|
-
conditionsThatEstablishesTheDecision:
|
|
3295
|
+
conditionsThatEstablishesTheDecision: re
|
|
3296
3296
|
};
|
|
3297
3297
|
}
|
|
3298
3298
|
), I = l.values.conditionGroups, b = JSON.stringify(F), z = JSON.stringify(I ?? []);
|
|
3299
3299
|
b !== z && l.setFieldValue("conditionGroups", F, !1);
|
|
3300
|
-
}, [(
|
|
3300
|
+
}, [(ze = l.values) == null ? void 0 : ze.conditionsThatEstablishesTheDecision, p]);
|
|
3301
3301
|
const M = V.useMemo(() => {
|
|
3302
3302
|
const R = Object.keys(h), F = (m != null ? [
|
|
3303
3303
|
...R.filter((I) => I === m),
|
|
3304
3304
|
...R.filter((I) => I !== m)
|
|
3305
3305
|
] : R).map((I) => {
|
|
3306
3306
|
const z = (h[I] ?? []).map((j, ce) => {
|
|
3307
|
-
const
|
|
3307
|
+
const ne = ce === 0, ge = Ue(j.howToSetTheCondition), re = Oi({
|
|
3308
3308
|
label: j.labelName || "",
|
|
3309
|
-
howToSet:
|
|
3310
|
-
isFirst:
|
|
3311
|
-
}),
|
|
3309
|
+
howToSet: ge,
|
|
3310
|
+
isFirst: ne
|
|
3311
|
+
}), oe = j.timeUnit ? Gt("", j.timeUnit, !0).trim() : "", H = `${I}.${j.conditionName}`, J = zi(
|
|
3312
3312
|
l.values,
|
|
3313
3313
|
I,
|
|
3314
3314
|
j.conditionName
|
|
@@ -3316,24 +3316,24 @@ const He = (e) => {
|
|
|
3316
3316
|
l.values,
|
|
3317
3317
|
I,
|
|
3318
3318
|
j.conditionName
|
|
3319
|
-
), ct = J !== void 0 ? J : $t, ut = ct !== void 0 ? ct :
|
|
3319
|
+
), ct = J !== void 0 ? J : $t, ut = ct !== void 0 ? ct : He(ge);
|
|
3320
3320
|
return {
|
|
3321
3321
|
...j,
|
|
3322
3322
|
__originalConditionName: j.conditionName,
|
|
3323
3323
|
__groupKey: I,
|
|
3324
|
-
__howToSet:
|
|
3324
|
+
__howToSet: ge,
|
|
3325
3325
|
__scopedName: H,
|
|
3326
3326
|
conditionName: j.conditionName,
|
|
3327
3327
|
groupKey: I,
|
|
3328
|
-
labelName:
|
|
3329
|
-
__unitAfterInput:
|
|
3328
|
+
labelName: re,
|
|
3329
|
+
__unitAfterInput: oe,
|
|
3330
3330
|
value: ut
|
|
3331
3331
|
};
|
|
3332
3332
|
});
|
|
3333
3333
|
return [I, z];
|
|
3334
3334
|
});
|
|
3335
3335
|
return Object.fromEntries(F);
|
|
3336
|
-
}, [h, l.values, m]), ee = M[P] ?? [],
|
|
3336
|
+
}, [h, l.values, m]), ee = M[P] ?? [], te = M[m ?? "group-primary"] ?? [], Ne = {
|
|
3337
3337
|
decisionDataType: t.decisionDataType,
|
|
3338
3338
|
howToSetTheCondition: t.howToSetTheDecision,
|
|
3339
3339
|
labelName: t.labelName,
|
|
@@ -3341,7 +3341,7 @@ const He = (e) => {
|
|
|
3341
3341
|
listOfPossibleValues: t.listOfPossibleValues,
|
|
3342
3342
|
ruleName: t.ruleName,
|
|
3343
3343
|
timeUnit: t.timeUnit ? Gt("", t.timeUnit, !0).trim() : ""
|
|
3344
|
-
},
|
|
3344
|
+
}, nt = l.submitCount > 0 || !!l.touched.effectiveFrom, je = l.submitCount > 0 || !!l.touched.validUntil, _e = nt ? l.errors.effectiveFrom ? "invalid" : "valid" : void 0, rt = je ? l.errors.validUntil ? "invalid" : "valid" : void 0, ot = V.useMemo(() => {
|
|
3345
3345
|
const R = l.errors.conditionsThatEstablishesTheDecision;
|
|
3346
3346
|
if (!R) return;
|
|
3347
3347
|
if (typeof R == "string") return R;
|
|
@@ -3362,22 +3362,22 @@ const He = (e) => {
|
|
|
3362
3362
|
};
|
|
3363
3363
|
return A(R);
|
|
3364
3364
|
}, [l.errors.conditionsThatEstablishesTheDecision]), it = l.submitCount > 0 && !!ot, at = (R) => {
|
|
3365
|
-
const A = (R == null ? void 0 : R.__howToSet) ??
|
|
3366
|
-
return
|
|
3365
|
+
const A = (R == null ? void 0 : R.__howToSet) ?? Ue(R == null ? void 0 : R.howToSetTheCondition);
|
|
3366
|
+
return He(A);
|
|
3367
3367
|
}, lt = (R, A, F) => {
|
|
3368
|
-
var j, ce,
|
|
3369
|
-
const I = `conditionsThatEstablishesTheDecision.${R}.${A}`, b = (
|
|
3368
|
+
var j, ce, ne, ge, re;
|
|
3369
|
+
const I = `conditionsThatEstablishesTheDecision.${R}.${A}`, b = (ne = (ce = (j = l.values) == null ? void 0 : j.conditionsThatEstablishesTheDecision) == null ? void 0 : ce[R]) == null ? void 0 : ne[A];
|
|
3370
3370
|
b && typeof b == "object" && !Array.isArray(b) ? l.setFieldValue(`${I}.value`, F, !1) : l.setFieldValue(I, F, !1);
|
|
3371
|
-
const z = (
|
|
3371
|
+
const z = (ge = l.values) == null ? void 0 : ge.conditionGroups;
|
|
3372
3372
|
if (Array.isArray(z)) {
|
|
3373
|
-
const
|
|
3374
|
-
if (
|
|
3375
|
-
const H = (
|
|
3373
|
+
const oe = z.findIndex((H) => (H == null ? void 0 : H.ConditionGroupId) === R);
|
|
3374
|
+
if (oe >= 0) {
|
|
3375
|
+
const H = (re = z[oe].conditionsThatEstablishesTheDecision) == null ? void 0 : re.findIndex(
|
|
3376
3376
|
(J) => (J == null ? void 0 : J.conditionName) === A
|
|
3377
3377
|
);
|
|
3378
3378
|
if (H >= 0) {
|
|
3379
3379
|
const J = JSON.parse(JSON.stringify(z));
|
|
3380
|
-
J[
|
|
3380
|
+
J[oe].conditionsThatEstablishesTheDecision[H].value = F, l.setFieldValue("conditionGroups", J, !1);
|
|
3381
3381
|
}
|
|
3382
3382
|
}
|
|
3383
3383
|
}
|
|
@@ -3390,10 +3390,10 @@ const He = (e) => {
|
|
|
3390
3390
|
);
|
|
3391
3391
|
}, st = () => {
|
|
3392
3392
|
(c[P] ?? []).forEach((A) => {
|
|
3393
|
-
const F =
|
|
3393
|
+
const F = Ue(A == null ? void 0 : A.howToSetTheCondition), I = He(F);
|
|
3394
3394
|
lt(P, A.conditionName, I);
|
|
3395
3395
|
});
|
|
3396
|
-
}, [dt,
|
|
3396
|
+
}, [dt, Ve] = V.useState(!1);
|
|
3397
3397
|
return /* @__PURE__ */ a(
|
|
3398
3398
|
Ri,
|
|
3399
3399
|
{
|
|
@@ -3402,7 +3402,7 @@ const He = (e) => {
|
|
|
3402
3402
|
currentConditions: ee,
|
|
3403
3403
|
decision: t,
|
|
3404
3404
|
formik: l,
|
|
3405
|
-
normalizedDecision:
|
|
3405
|
+
normalizedDecision: Ne,
|
|
3406
3406
|
onCancel: o,
|
|
3407
3407
|
onRedefineCurrentTab: st,
|
|
3408
3408
|
onTabChange: $,
|
|
@@ -3412,21 +3412,21 @@ const He = (e) => {
|
|
|
3412
3412
|
showConditionsError: it,
|
|
3413
3413
|
tabs: k,
|
|
3414
3414
|
termEndStatus: rt,
|
|
3415
|
-
termStartStatus:
|
|
3415
|
+
termStartStatus: _e,
|
|
3416
3416
|
textValues: r,
|
|
3417
|
-
visibleConditions:
|
|
3417
|
+
visibleConditions: te,
|
|
3418
3418
|
visibleConditionsByGroup: M,
|
|
3419
3419
|
handleToggleNoneChange: s,
|
|
3420
3420
|
portalId: "redefine-confirm-portal",
|
|
3421
3421
|
showRedefineConfirm: dt,
|
|
3422
|
-
onOpenRedefineConfirm: () =>
|
|
3423
|
-
onCloseRedefineConfirm: () =>
|
|
3422
|
+
onOpenRedefineConfirm: () => Ve(!0),
|
|
3423
|
+
onCloseRedefineConfirm: () => Ve(!1),
|
|
3424
3424
|
onConfirmRedefine: () => {
|
|
3425
3425
|
st();
|
|
3426
3426
|
const R = (c[P] ?? []).map(
|
|
3427
3427
|
(A) => `${P}.${A.conditionName}`
|
|
3428
3428
|
);
|
|
3429
|
-
d == null || d(R),
|
|
3429
|
+
d == null || d(R), Ve(!1);
|
|
3430
3430
|
}
|
|
3431
3431
|
}
|
|
3432
3432
|
);
|
|
@@ -3452,7 +3452,7 @@ const He = (e) => {
|
|
|
3452
3452
|
onRestoreConditions: S,
|
|
3453
3453
|
baseDecisionTemplate: k,
|
|
3454
3454
|
shouldRenderEmptyMessage: E = !0
|
|
3455
|
-
} = e, [C, $] = q(null),
|
|
3455
|
+
} = e, [C, $] = q(null), { renderedCards: P, shouldRenderAddCard: M } = vi({
|
|
3456
3456
|
cardTitle: t,
|
|
3457
3457
|
controls: n,
|
|
3458
3458
|
customTitleContentAddCard: r,
|
|
@@ -3461,12 +3461,12 @@ const He = (e) => {
|
|
|
3461
3461
|
handleOpenModal: g,
|
|
3462
3462
|
handleDelete: m,
|
|
3463
3463
|
textValues: d,
|
|
3464
|
-
isOpenFor: (
|
|
3465
|
-
toggleAt: (
|
|
3464
|
+
isOpenFor: (te) => C === te,
|
|
3465
|
+
toggleAt: (te) => $((Ne) => Ne === te ? null : te),
|
|
3466
3466
|
editionMode: l
|
|
3467
|
-
}),
|
|
3467
|
+
}), ee = (i == null ? void 0 : i.length) === 0 && !c;
|
|
3468
3468
|
return /* @__PURE__ */ v(U, { children: [
|
|
3469
|
-
/* @__PURE__ */ a(
|
|
3469
|
+
/* @__PURE__ */ a(pi, { children: /* @__PURE__ */ a(hi, { children: /* @__PURE__ */ a(w, { direction: "column", gap: "16px", padding: "6px", children: E && (ee ? /* @__PURE__ */ a(We, { legend: "Decisiones", children: /* @__PURE__ */ v(
|
|
3470
3470
|
w,
|
|
3471
3471
|
{
|
|
3472
3472
|
direction: "column",
|
|
@@ -3500,7 +3500,7 @@ const He = (e) => {
|
|
|
3500
3500
|
]
|
|
3501
3501
|
}
|
|
3502
3502
|
) }) : /* @__PURE__ */ v(
|
|
3503
|
-
|
|
3503
|
+
we,
|
|
3504
3504
|
{
|
|
3505
3505
|
templateColumns: "1fr",
|
|
3506
3506
|
autoFlow: "row dense",
|
|
@@ -3510,10 +3510,9 @@ const He = (e) => {
|
|
|
3510
3510
|
autoRows: "auto",
|
|
3511
3511
|
justifyItems: "center",
|
|
3512
3512
|
padding: "6px",
|
|
3513
|
-
height: P ? "auto" : "484px",
|
|
3514
3513
|
children: [
|
|
3515
|
-
|
|
3516
|
-
|
|
3514
|
+
P,
|
|
3515
|
+
M && Ht({
|
|
3517
3516
|
type: "add",
|
|
3518
3517
|
index: i == null ? void 0 : i.length,
|
|
3519
3518
|
controls: n,
|
|
@@ -3531,7 +3530,7 @@ const He = (e) => {
|
|
|
3531
3530
|
}
|
|
3532
3531
|
)) }) }) }),
|
|
3533
3532
|
s && /* @__PURE__ */ a(
|
|
3534
|
-
|
|
3533
|
+
nr,
|
|
3535
3534
|
{
|
|
3536
3535
|
portalId: "modal-portal",
|
|
3537
3536
|
onCloseModal: h,
|
|
@@ -3593,8 +3592,8 @@ function Wi(e) {
|
|
|
3593
3592
|
);
|
|
3594
3593
|
}
|
|
3595
3594
|
const Yi = (e, t) => {
|
|
3596
|
-
const [n, r] = q([]), [o, i] = q([]), [d, u] = q(!1), l =
|
|
3597
|
-
return
|
|
3595
|
+
const [n, r] = q([]), [o, i] = q([]), [d, u] = q(!1), l = Ye(null);
|
|
3596
|
+
return Le(() => {
|
|
3598
3597
|
if (!e.current || !l.current) return;
|
|
3599
3598
|
const s = e.current, p = l.current, c = () => {
|
|
3600
3599
|
var k;
|
|
@@ -3700,7 +3699,7 @@ const Xi = D.div`
|
|
|
3700
3699
|
S.stopPropagation();
|
|
3701
3700
|
},
|
|
3702
3701
|
children: /* @__PURE__ */ v(
|
|
3703
|
-
|
|
3702
|
+
we,
|
|
3704
3703
|
{
|
|
3705
3704
|
alignItems: "center",
|
|
3706
3705
|
gap: "8px",
|
|
@@ -3749,7 +3748,7 @@ const Xi = D.div`
|
|
|
3749
3748
|
noFiltersLabel: o,
|
|
3750
3749
|
titleClearFilter: i,
|
|
3751
3750
|
titleFilter: d
|
|
3752
|
-
} = e, u =
|
|
3751
|
+
} = e, u = Ye(null), l = Ye(null), s = Ye(null), {
|
|
3753
3752
|
visible: p,
|
|
3754
3753
|
hidden: c,
|
|
3755
3754
|
showOverflowIndicator: g,
|
|
@@ -3757,11 +3756,11 @@ const Xi = D.div`
|
|
|
3757
3756
|
} = Yi(u, t), [f, m] = q(!1), y = (C) => {
|
|
3758
3757
|
C.stopPropagation(), m(($) => !$);
|
|
3759
3758
|
};
|
|
3760
|
-
|
|
3759
|
+
Le(() => {
|
|
3761
3760
|
const C = ($) => {
|
|
3762
|
-
var ee,
|
|
3761
|
+
var ee, te;
|
|
3763
3762
|
const P = $.target;
|
|
3764
|
-
!((ee = l.current) != null && ee.contains(P)) && !((
|
|
3763
|
+
!((ee = l.current) != null && ee.contains(P)) && !((te = s.current) != null && te.contains(P)) && m(!1);
|
|
3765
3764
|
};
|
|
3766
3765
|
return f && window.addEventListener("mousedown", C), () => window.removeEventListener("mousedown", C);
|
|
3767
3766
|
}, [f]);
|
|
@@ -3776,7 +3775,7 @@ const Xi = D.div`
|
|
|
3776
3775
|
};
|
|
3777
3776
|
return /* @__PURE__ */ v(Wi, { borderRadius: "8px", width: "100%", children: [
|
|
3778
3777
|
/* @__PURE__ */ a(Qi, { ref: h, children: t.map((C) => /* @__PURE__ */ a("div", { "data-filter-tag": "true", children: /* @__PURE__ */ a(
|
|
3779
|
-
|
|
3778
|
+
qe,
|
|
3780
3779
|
{
|
|
3781
3780
|
appearance: "primary",
|
|
3782
3781
|
displayIcon: !0,
|
|
@@ -3786,7 +3785,7 @@ const Xi = D.div`
|
|
|
3786
3785
|
onClose: C.onClose
|
|
3787
3786
|
}
|
|
3788
3787
|
) }, C.label)) }),
|
|
3789
|
-
/* @__PURE__ */ v(
|
|
3788
|
+
/* @__PURE__ */ v(we, { gap: "12px", templateColumns: "1fr auto auto", width: "100%", children: [
|
|
3790
3789
|
/* @__PURE__ */ a(
|
|
3791
3790
|
pe,
|
|
3792
3791
|
{
|
|
@@ -3801,7 +3800,7 @@ const Xi = D.div`
|
|
|
3801
3800
|
border: !0,
|
|
3802
3801
|
children: T ? /* @__PURE__ */ a(L, { size: "small", type: "label", appearance: "gray", children: o }) : /* @__PURE__ */ v(U, { children: [
|
|
3803
3802
|
p.map((C) => /* @__PURE__ */ a(
|
|
3804
|
-
|
|
3803
|
+
qe,
|
|
3805
3804
|
{
|
|
3806
3805
|
"data-filter-tag": "true",
|
|
3807
3806
|
appearance: "primary",
|
|
@@ -3820,7 +3819,7 @@ const Xi = D.div`
|
|
|
3820
3819
|
style: { position: "relative", display: "inline-block" },
|
|
3821
3820
|
children: [
|
|
3822
3821
|
/* @__PURE__ */ a(Ji, { onClick: y, children: /* @__PURE__ */ a(
|
|
3823
|
-
|
|
3822
|
+
qe,
|
|
3824
3823
|
{
|
|
3825
3824
|
appearance: "primary",
|
|
3826
3825
|
label: `+${c.length}`
|
|
@@ -3876,7 +3875,7 @@ const Xi = D.div`
|
|
|
3876
3875
|
] })
|
|
3877
3876
|
] });
|
|
3878
3877
|
}, Ds = (e) => {
|
|
3879
|
-
const { appliedFilters: t, fields: n, onChange: r, noFiltersLabel: o } = e, i =
|
|
3878
|
+
const { appliedFilters: t, fields: n, onChange: r, noFiltersLabel: o } = e, i = fe("(max-width: 768px)"), d = !t || t.length === 0;
|
|
3880
3879
|
return /* @__PURE__ */ v(w, { direction: "column", gap: "16px", children: [
|
|
3881
3880
|
i && /* @__PURE__ */ v(U, { children: [
|
|
3882
3881
|
/* @__PURE__ */ v(w, { gap: "6px", width: "100%", alignItems: "center", children: [
|
|
@@ -3894,7 +3893,7 @@ const Xi = D.div`
|
|
|
3894
3893
|
width: "100%",
|
|
3895
3894
|
height: "36px",
|
|
3896
3895
|
children: d ? /* @__PURE__ */ a(L, { size: "small", type: "label", appearance: "gray", children: o }) : t == null ? void 0 : t.map((u) => /* @__PURE__ */ a(
|
|
3897
|
-
|
|
3896
|
+
qe,
|
|
3898
3897
|
{
|
|
3899
3898
|
appearance: "primary",
|
|
3900
3899
|
displayIcon: !0,
|
|
@@ -4000,14 +3999,14 @@ const Xi = D.div`
|
|
|
4000
3999
|
} : n;
|
|
4001
4000
|
});
|
|
4002
4001
|
}, ta = (e) => ({
|
|
4003
|
-
schema:
|
|
4002
|
+
schema: ve().required("Requerido").test(
|
|
4004
4003
|
"non-empty",
|
|
4005
4004
|
"El valor no puede estar vacío",
|
|
4006
4005
|
(t) => t != null && t.trim() !== ""
|
|
4007
4006
|
),
|
|
4008
4007
|
value: e
|
|
4009
4008
|
}), na = (e) => ({
|
|
4010
|
-
schema:
|
|
4009
|
+
schema: xe().test(
|
|
4011
4010
|
"isArrayOrString",
|
|
4012
4011
|
"Debe ser un array de strings/numbers o un solo string",
|
|
4013
4012
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -4016,7 +4015,7 @@ const Xi = D.div`
|
|
|
4016
4015
|
),
|
|
4017
4016
|
value: e
|
|
4018
4017
|
}), ra = (e) => ({
|
|
4019
|
-
schema:
|
|
4018
|
+
schema: xe().test(
|
|
4020
4019
|
"isArrayOrString",
|
|
4021
4020
|
"Debe ser un array de strings/numbers o un solo string ",
|
|
4022
4021
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -4044,7 +4043,7 @@ const Xi = D.div`
|
|
|
4044
4043
|
schema: me().required("El campo tipo porcentaje es requerido").min(0, "El campo tipo porcentaje no puede ser menor que 0").max(100, "El campo tipo porcentaje no puede ser mayor que 100"),
|
|
4045
4044
|
value: e
|
|
4046
4045
|
} : {
|
|
4047
|
-
schema:
|
|
4046
|
+
schema: ve().required("Requerido"),
|
|
4048
4047
|
value: e
|
|
4049
4048
|
}, ia = {
|
|
4050
4049
|
[O.LIST_OF_VALUES]: na,
|
|
@@ -4073,8 +4072,8 @@ function aa({
|
|
|
4073
4072
|
};
|
|
4074
4073
|
let o;
|
|
4075
4074
|
const i = {
|
|
4076
|
-
ruleName:
|
|
4077
|
-
value:
|
|
4075
|
+
ruleName: ve().required("El nombre de la regla es requerido"),
|
|
4076
|
+
value: Je(() => On(
|
|
4078
4077
|
o.values.howToSetTheDecision
|
|
4079
4078
|
)(
|
|
4080
4079
|
o.values.value,
|
|
@@ -4117,7 +4116,7 @@ function aa({
|
|
|
4117
4116
|
// },
|
|
4118
4117
|
// );
|
|
4119
4118
|
// }),
|
|
4120
|
-
conditionsThatEstablishesTheDecision:
|
|
4119
|
+
conditionsThatEstablishesTheDecision: Je((l, { parent: s }) => {
|
|
4121
4120
|
var g;
|
|
4122
4121
|
if ((s == null ? void 0 : s.toggleNone) && Object.keys(s.conditionsThatEstablishesTheDecision || {}).length > 0) return W().shape({});
|
|
4123
4122
|
const c = ((g = e.conditionsThatEstablishesTheDecision) == null ? void 0 : g.reduce(
|
|
@@ -4138,9 +4137,9 @@ function aa({
|
|
|
4138
4137
|
return W(c);
|
|
4139
4138
|
})
|
|
4140
4139
|
};
|
|
4141
|
-
n.terms && (i.effectiveFrom =
|
|
4140
|
+
n.terms && (i.effectiveFrom = Fe().required(
|
|
4142
4141
|
"La fecha de inicio es requerida"
|
|
4143
|
-
), i.validUntil =
|
|
4142
|
+
), i.validUntil = Fe().when(
|
|
4144
4143
|
"checkClosed",
|
|
4145
4144
|
(l, s, { parent: p }) => (p == null ? void 0 : p.checkClosed) ? s.required("La fecha de finalización es requerida").test(
|
|
4146
4145
|
"is-after-startDate",
|
|
@@ -4232,7 +4231,7 @@ const la = D.div`
|
|
|
4232
4231
|
} = e, [l, s] = q(t), p = (c) => {
|
|
4233
4232
|
s(c.target.checked), r(c);
|
|
4234
4233
|
};
|
|
4235
|
-
return
|
|
4234
|
+
return Le(() => {
|
|
4236
4235
|
s(t);
|
|
4237
4236
|
}, [t]), /* @__PURE__ */ v(U, { children: [
|
|
4238
4237
|
/* @__PURE__ */ a(w, { children: /* @__PURE__ */ a(
|
|
@@ -4270,7 +4269,7 @@ const la = D.div`
|
|
|
4270
4269
|
T(M.target.value), t(M);
|
|
4271
4270
|
}, $ = (M) => {
|
|
4272
4271
|
k(M.target.value), n(M);
|
|
4273
|
-
}, P =
|
|
4272
|
+
}, P = fe("(max-width: 400px)");
|
|
4274
4273
|
return /* @__PURE__ */ v(U, { children: [
|
|
4275
4274
|
/* @__PURE__ */ v(w, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
4276
4275
|
/* @__PURE__ */ a(
|
|
@@ -4311,7 +4310,7 @@ const la = D.div`
|
|
|
4311
4310
|
gap: "24px",
|
|
4312
4311
|
children: [
|
|
4313
4312
|
/* @__PURE__ */ a(
|
|
4314
|
-
|
|
4313
|
+
Oe,
|
|
4315
4314
|
{
|
|
4316
4315
|
id: "dateStart",
|
|
4317
4316
|
label: o,
|
|
@@ -4324,7 +4323,7 @@ const la = D.div`
|
|
|
4324
4323
|
}
|
|
4325
4324
|
),
|
|
4326
4325
|
f && /* @__PURE__ */ a(
|
|
4327
|
-
|
|
4326
|
+
Oe,
|
|
4328
4327
|
{
|
|
4329
4328
|
id: "dateEnd",
|
|
4330
4329
|
label: i,
|
|
@@ -4519,7 +4518,7 @@ const la = D.div`
|
|
|
4519
4518
|
)
|
|
4520
4519
|
} : n;
|
|
4521
4520
|
});
|
|
4522
|
-
},
|
|
4521
|
+
}, Se = {
|
|
4523
4522
|
item: {
|
|
4524
4523
|
background: {
|
|
4525
4524
|
active: N.palette.blue.B50,
|
|
@@ -4541,7 +4540,7 @@ const la = D.div`
|
|
|
4541
4540
|
border: 1px solid
|
|
4542
4541
|
${({ theme: e, $active: t }) => {
|
|
4543
4542
|
var n, r, o, i;
|
|
4544
|
-
return t ? ((r = (n = e == null ? void 0 : e.border) == null ? void 0 : n.expanded) == null ? void 0 : r.color) ||
|
|
4543
|
+
return t ? ((r = (n = e == null ? void 0 : e.border) == null ? void 0 : n.expanded) == null ? void 0 : r.color) || Se.border.expanded.color : ((i = (o = e == null ? void 0 : e.border) == null ? void 0 : o.contracted) == null ? void 0 : i.color) || Se.border.contracted.color;
|
|
4545
4544
|
}};
|
|
4546
4545
|
}
|
|
4547
4546
|
&:hover {
|
|
@@ -4549,7 +4548,7 @@ const la = D.div`
|
|
|
4549
4548
|
background-color: ${({ theme: e, $disabled: t }) => {
|
|
4550
4549
|
var n, r, o;
|
|
4551
4550
|
if (!t)
|
|
4552
|
-
return ((o = (r = (n = e == null ? void 0 : e.menu) == null ? void 0 : n.item) == null ? void 0 : r.background) == null ? void 0 : o.hover) ||
|
|
4551
|
+
return ((o = (r = (n = e == null ? void 0 : e.menu) == null ? void 0 : n.item) == null ? void 0 : r.background) == null ? void 0 : o.hover) || Se.item.background.hover;
|
|
4553
4552
|
}};
|
|
4554
4553
|
}
|
|
4555
4554
|
`, Fn = D.div`
|
|
@@ -4577,7 +4576,7 @@ const la = D.div`
|
|
|
4577
4576
|
border-bottom: 1px solid
|
|
4578
4577
|
${({ theme: e, $active: t }) => {
|
|
4579
4578
|
var n, r, o, i;
|
|
4580
|
-
return t ? ((r = (n = e == null ? void 0 : e.border) == null ? void 0 : n.expanded) == null ? void 0 : r.color) ||
|
|
4579
|
+
return t ? ((r = (n = e == null ? void 0 : e.border) == null ? void 0 : n.expanded) == null ? void 0 : r.color) || Se.border.expanded.color : ((i = (o = e == null ? void 0 : e.border) == null ? void 0 : o.contracted) == null ? void 0 : i.color) || Se.border.contracted.color;
|
|
4581
4580
|
}};
|
|
4582
4581
|
border-radius: 8px 8px 0 0;
|
|
4583
4582
|
}
|
|
@@ -4586,7 +4585,7 @@ const la = D.div`
|
|
|
4586
4585
|
text-decoration: none;
|
|
4587
4586
|
background-color: ${({ theme: e, $active: t }) => {
|
|
4588
4587
|
var n, r, o, i, d, u;
|
|
4589
|
-
return t ? ((o = (r = (n = e == null ? void 0 : e.menu) == null ? void 0 : n.item) == null ? void 0 : r.background) == null ? void 0 : o.active) ||
|
|
4588
|
+
return t ? ((o = (r = (n = e == null ? void 0 : e.menu) == null ? void 0 : n.item) == null ? void 0 : r.background) == null ? void 0 : o.active) || Se.item.background.active : ((u = (d = (i = e == null ? void 0 : e.menu) == null ? void 0 : i.item) == null ? void 0 : d.background) == null ? void 0 : u.inactive) || Se.item.background.inactive;
|
|
4590
4589
|
}};
|
|
4591
4590
|
&:last-child {
|
|
4592
4591
|
border-radius: 0 0 8px 8px;
|
|
@@ -4596,7 +4595,7 @@ const la = D.div`
|
|
|
4596
4595
|
background-color: ${({ $active: e, theme: t, $disabled: n }) => {
|
|
4597
4596
|
var r, o, i;
|
|
4598
4597
|
if (!n && !e)
|
|
4599
|
-
return ((i = (o = (r = t == null ? void 0 : t.menu) == null ? void 0 : r.item) == null ? void 0 : o.background) == null ? void 0 : i.hover) ||
|
|
4598
|
+
return ((i = (o = (r = t == null ? void 0 : t.menu) == null ? void 0 : r.item) == null ? void 0 : o.background) == null ? void 0 : i.hover) || Se.item.background.hover;
|
|
4600
4599
|
}};
|
|
4601
4600
|
}
|
|
4602
4601
|
`, va = D.div`
|
|
@@ -4789,7 +4788,7 @@ const la = D.div`
|
|
|
4789
4788
|
function Z(e) {
|
|
4790
4789
|
e.preventDefault();
|
|
4791
4790
|
}
|
|
4792
|
-
function
|
|
4791
|
+
function Ee(e) {
|
|
4793
4792
|
e.stopPropagation();
|
|
4794
4793
|
}
|
|
4795
4794
|
function or() {
|
|
@@ -4807,7 +4806,7 @@ var [ir, ar] = or();
|
|
|
4807
4806
|
function wa(e, t) {
|
|
4808
4807
|
return e.source === t.source && e.flags.split("").sort().join("") === t.flags.split("").sort().join("");
|
|
4809
4808
|
}
|
|
4810
|
-
function
|
|
4809
|
+
function Ze(e, t, n = !0, r = ["__key"]) {
|
|
4811
4810
|
if (e === t) return !0;
|
|
4812
4811
|
if (typeof t == "object" && typeof e == "object" && e !== null && t !== null) {
|
|
4813
4812
|
if (e instanceof Map || e instanceof Set) return !1;
|
|
@@ -4821,7 +4820,7 @@ function Ke(e, t, n = !0, r = ["__key"]) {
|
|
|
4821
4820
|
for (const d of r)
|
|
4822
4821
|
if ((d in o || d in i) && o[d] !== i[d]) return !1;
|
|
4823
4822
|
for (const d in o)
|
|
4824
|
-
if (!(d in i) || o[d] !== i[d] && !n || n && !
|
|
4823
|
+
if (!(d in i) || o[d] !== i[d] && !n || n && !Ze(o[d], i[d], n, r)) return !1;
|
|
4825
4824
|
return !0;
|
|
4826
4825
|
}
|
|
4827
4826
|
return !1;
|
|
@@ -4829,11 +4828,11 @@ function Ke(e, t, n = !0, r = ["__key"]) {
|
|
|
4829
4828
|
function lr(e) {
|
|
4830
4829
|
return e.split(" ").filter((t) => t);
|
|
4831
4830
|
}
|
|
4832
|
-
function
|
|
4831
|
+
function Pe(e) {
|
|
4833
4832
|
return { x: e.clientX, y: e.clientY };
|
|
4834
4833
|
}
|
|
4835
4834
|
Array();
|
|
4836
|
-
var on = typeof window < "u", Q = /* @__PURE__ */ new WeakMap(),
|
|
4835
|
+
var on = typeof window < "u", Q = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakMap();
|
|
4837
4836
|
function sr() {
|
|
4838
4837
|
if (!on) return !1;
|
|
4839
4838
|
if ("userAgentData" in navigator)
|
|
@@ -4875,7 +4874,7 @@ var Sa = {
|
|
|
4875
4874
|
scrollDebounceTimeout: void 0,
|
|
4876
4875
|
frameIdX: void 0,
|
|
4877
4876
|
frameIdY: void 0
|
|
4878
|
-
}, x = Sa,
|
|
4877
|
+
}, x = Sa, De = !1, Ln, Lt;
|
|
4879
4878
|
function Ca() {
|
|
4880
4879
|
x.scrollDebounceTimeout && clearTimeout(x.scrollDebounceTimeout), x.longPressTimeout && clearTimeout(x.longPressTimeout), x.frameIdX !== void 0 && cancelAnimationFrame(x.frameIdX), x.frameIdY !== void 0 && cancelAnimationFrame(x.frameIdY), x = { ...{
|
|
4881
4880
|
affectedNodes: [],
|
|
@@ -4918,7 +4917,7 @@ function Ca() {
|
|
|
4918
4917
|
} };
|
|
4919
4918
|
}
|
|
4920
4919
|
function dr(e) {
|
|
4921
|
-
return Object.assign(x, e), e.initialParent.data.emit("dragStarted", x),
|
|
4920
|
+
return Object.assign(x, e), e.initialParent.data.emit("dragStarted", x), De = !1, x.emit("dragStarted", x), x;
|
|
4922
4921
|
}
|
|
4923
4922
|
function Da() {
|
|
4924
4923
|
x.activeState && ke(x.activeState.parent, void 0, x), x.selectedState && Ae(x.selectedState.nodes, x.selectedState.parent, x), x.selectedState = x.activeState = void 0;
|
|
@@ -4933,14 +4932,14 @@ function Na(e) {
|
|
|
4933
4932
|
}
|
|
4934
4933
|
function Aa(e) {
|
|
4935
4934
|
if (!K(x)) return;
|
|
4936
|
-
|
|
4935
|
+
De = !0;
|
|
4937
4936
|
const t = x.initialParent.data.config.handleEnd;
|
|
4938
4937
|
t(x);
|
|
4939
4938
|
}
|
|
4940
4939
|
function ka(e) {
|
|
4941
4940
|
if (!K(x)) return;
|
|
4942
4941
|
Z(e);
|
|
4943
|
-
const { x: t, y: n } =
|
|
4942
|
+
const { x: t, y: n } = Pe(e);
|
|
4944
4943
|
K(x) && Nt({ x: t, y: n }, e, x);
|
|
4945
4944
|
}
|
|
4946
4945
|
function $a(e) {
|
|
@@ -4982,7 +4981,7 @@ function Ia({
|
|
|
4982
4981
|
keydown: Na,
|
|
4983
4982
|
drop: Aa,
|
|
4984
4983
|
pointermove: $a,
|
|
4985
|
-
pointercancel:
|
|
4984
|
+
pointercancel: ie(r.handlePointercancel),
|
|
4986
4985
|
touchmove: (c) => {
|
|
4987
4986
|
K(x) && c.cancelable && Z(c);
|
|
4988
4987
|
},
|
|
@@ -5052,7 +5051,7 @@ function Ia({
|
|
|
5052
5051
|
}), Ma(e, d), Dt(e, !0);
|
|
5053
5052
|
}
|
|
5054
5053
|
function cr(e, t, n, r, o, i) {
|
|
5055
|
-
const { x: d, y: u } =
|
|
5054
|
+
const { x: d, y: u } = Pe(n), l = e.el.getBoundingClientRect();
|
|
5056
5055
|
return {
|
|
5057
5056
|
affectedNodes: [],
|
|
5058
5057
|
ascendingDirection: !1,
|
|
@@ -5092,8 +5091,8 @@ function Ra({
|
|
|
5092
5091
|
targetNodes: n
|
|
5093
5092
|
}) {
|
|
5094
5093
|
Dt(e.el);
|
|
5095
|
-
const r = t.map((l) => l.data.value), o =
|
|
5096
|
-
...o.filter((l) => !r.some((s) =>
|
|
5094
|
+
const r = t.map((l) => l.data.value), o = Me(e.el, e.data), i = t[0].data.index, d = [...e.data.enabledNodes], u = [
|
|
5095
|
+
...o.filter((l) => !r.some((s) => Ze(l, s)))
|
|
5097
5096
|
];
|
|
5098
5097
|
u.splice(n[0].data.index, 0, ...r), "draggedNode" in x && (x.currentTargetValue = n[0].data.value), Yt(e.el, e.data, [...u]), e.data.config.onSort && e.data.config.onSort({
|
|
5099
5098
|
parent: {
|
|
@@ -5125,7 +5124,7 @@ function Ae(e, t, n) {
|
|
|
5125
5124
|
const r = t.data.config.selectedClass;
|
|
5126
5125
|
if (!n.selectedState) return;
|
|
5127
5126
|
const o = Array.from(e);
|
|
5128
|
-
|
|
5127
|
+
Ce(
|
|
5129
5128
|
e.map((i) => i.el),
|
|
5130
5129
|
r
|
|
5131
5130
|
);
|
|
@@ -5138,7 +5137,7 @@ function Ae(e, t, n) {
|
|
|
5138
5137
|
function mt(e, t, n, r, o = !1) {
|
|
5139
5138
|
r.pointerSelection = o;
|
|
5140
5139
|
for (const i of t)
|
|
5141
|
-
i.el.setAttribute("aria-selected", "true"),
|
|
5140
|
+
i.el.setAttribute("aria-selected", "true"), Re([i.el], e.data.config.selectedClass, !0);
|
|
5142
5141
|
r.selectedState = {
|
|
5143
5142
|
nodes: t,
|
|
5144
5143
|
parent: e
|
|
@@ -5159,10 +5158,10 @@ function Fa({
|
|
|
5159
5158
|
}) {
|
|
5160
5159
|
Dt(n.el);
|
|
5161
5160
|
const u = r.map((g) => g.data.value), l = [
|
|
5162
|
-
...
|
|
5163
|
-
(g) => !u.some((h) =>
|
|
5161
|
+
...Me(e.el, e.data).filter(
|
|
5162
|
+
(g) => !u.some((h) => Ze(g, h))
|
|
5164
5163
|
)
|
|
5165
|
-
], s =
|
|
5164
|
+
], s = Me(t.el, t.data), p = n.el === t.el && t.data.config.sortable === !1;
|
|
5166
5165
|
let c;
|
|
5167
5166
|
i.length ? (p ? c = o : t.data.config.sortable === !1 ? c = t.data.enabledNodes.length : c = i[0].data.index, s.splice(c, 0, ...u)) : (c = p ? o : t.data.enabledNodes.length, s.splice(c, 0, ...u)), Yt(e.el, e.data, l), Yt(t.el, t.data, s), t.data.config.onTransfer && t.data.config.onTransfer({
|
|
5168
5167
|
sourceParent: e,
|
|
@@ -5182,14 +5181,14 @@ function Fa({
|
|
|
5182
5181
|
targetNodes: i || []
|
|
5183
5182
|
});
|
|
5184
5183
|
}
|
|
5185
|
-
function
|
|
5184
|
+
function Me(e, t) {
|
|
5186
5185
|
return [...t.getValues(e)];
|
|
5187
5186
|
}
|
|
5188
5187
|
function Yt(e, t, n) {
|
|
5189
5188
|
t.setValues(n, e);
|
|
5190
5189
|
}
|
|
5191
5190
|
function La(e, t) {
|
|
5192
|
-
|
|
5191
|
+
Ee(e.e), De = !0;
|
|
5193
5192
|
const n = t.initialParent.data.config.handleEnd;
|
|
5194
5193
|
n(t);
|
|
5195
5194
|
}
|
|
@@ -5227,7 +5226,7 @@ function Ma(e, t) {
|
|
|
5227
5226
|
);
|
|
5228
5227
|
return;
|
|
5229
5228
|
}
|
|
5230
|
-
const o =
|
|
5229
|
+
const o = ye.get(r);
|
|
5231
5230
|
if (!o) return;
|
|
5232
5231
|
const i = r.parentNode;
|
|
5233
5232
|
if (!(i instanceof HTMLElement)) return;
|
|
@@ -5251,18 +5250,18 @@ function Pa(e) {
|
|
|
5251
5250
|
var n;
|
|
5252
5251
|
const t = e.parent.data.config;
|
|
5253
5252
|
e.node.data.abortControllers.mainNode = xt(e.node.el, {
|
|
5254
|
-
keydown:
|
|
5255
|
-
dragstart:
|
|
5256
|
-
dragover:
|
|
5257
|
-
dragenter:
|
|
5258
|
-
dragleave:
|
|
5259
|
-
dragend:
|
|
5260
|
-
drop:
|
|
5261
|
-
focus:
|
|
5262
|
-
blur:
|
|
5263
|
-
pointerup:
|
|
5264
|
-
pointercancel:
|
|
5265
|
-
pointerdown:
|
|
5253
|
+
keydown: ie(t.handleNodeKeydown),
|
|
5254
|
+
dragstart: ie(t.handleDragstart),
|
|
5255
|
+
dragover: ie(t.handleNodeDragover),
|
|
5256
|
+
dragenter: ie(t.handleNodeDragenter),
|
|
5257
|
+
dragleave: ie(t.handleNodeDragleave),
|
|
5258
|
+
dragend: ie(t.handleDragend),
|
|
5259
|
+
drop: ie(t.handleNodeDrop),
|
|
5260
|
+
focus: ie(t.handleNodeFocus),
|
|
5261
|
+
blur: ie(t.handleNodeBlur),
|
|
5262
|
+
pointerup: ie(t.handleNodePointerup),
|
|
5263
|
+
pointercancel: ie(t.handlePointercancel),
|
|
5264
|
+
pointerdown: ie(t.handleNodePointerdown),
|
|
5266
5265
|
handleNodePointerover: t.handleNodePointerover,
|
|
5267
5266
|
touchmove: (r) => {
|
|
5268
5267
|
K(x) && r.cancelable && Z(r);
|
|
@@ -5277,7 +5276,7 @@ function Pa(e) {
|
|
|
5277
5276
|
}
|
|
5278
5277
|
function pr(e) {
|
|
5279
5278
|
var t;
|
|
5280
|
-
|
|
5279
|
+
ye.set(e.node.el, e.node.data), (t = e.parent.data.config.plugins) == null || t.forEach((n) => {
|
|
5281
5280
|
var r, o;
|
|
5282
5281
|
(o = (r = n(e.parent.el)) == null ? void 0 : r.setupNodeRemap) == null || o.call(r, e);
|
|
5283
5282
|
});
|
|
@@ -5285,7 +5284,7 @@ function pr(e) {
|
|
|
5285
5284
|
function ja(e, t) {
|
|
5286
5285
|
if (!K(x)) return;
|
|
5287
5286
|
const n = de(x) ? t.config.synthDropZoneClass : t.config.dropZoneClass;
|
|
5288
|
-
x.draggedNode.el === e &&
|
|
5287
|
+
x.draggedNode.el === e && Re([e], n, !0);
|
|
5289
5288
|
}
|
|
5290
5289
|
function _a(e) {
|
|
5291
5290
|
var t;
|
|
@@ -5316,7 +5315,7 @@ function Dt(e, t) {
|
|
|
5316
5315
|
for (let l = 0; l < e.children.length; l++) {
|
|
5317
5316
|
const s = e.children[l];
|
|
5318
5317
|
if (!At(s) || s.id === "dnd-dragged-node-clone") continue;
|
|
5319
|
-
const p =
|
|
5318
|
+
const p = ye.get(s);
|
|
5320
5319
|
(t || !p) && o.tearDownNode({
|
|
5321
5320
|
parent: {
|
|
5322
5321
|
el: e,
|
|
@@ -5336,7 +5335,7 @@ function Dt(e, t) {
|
|
|
5336
5335
|
}
|
|
5337
5336
|
const i = n.getValues(e), d = [];
|
|
5338
5337
|
for (let l = 0; l < r.length; l++) {
|
|
5339
|
-
const s = r[l], p =
|
|
5338
|
+
const s = r[l], p = ye.get(s);
|
|
5340
5339
|
if (o.draggableValue && !o.draggableValue(i[l])) continue;
|
|
5341
5340
|
const c = Object.assign(
|
|
5342
5341
|
p ?? {
|
|
@@ -5348,7 +5347,7 @@ function Dt(e, t) {
|
|
|
5348
5347
|
index: l
|
|
5349
5348
|
}
|
|
5350
5349
|
);
|
|
5351
|
-
if (!K(x) && x.activeState &&
|
|
5350
|
+
if (!K(x) && x.activeState && Ze(x.activeState.node.data.value, c.value) && ke(
|
|
5352
5351
|
{
|
|
5353
5352
|
data: n,
|
|
5354
5353
|
el: e
|
|
@@ -5358,7 +5357,7 @@ function Dt(e, t) {
|
|
|
5358
5357
|
data: c
|
|
5359
5358
|
},
|
|
5360
5359
|
x
|
|
5361
|
-
), K(x) &&
|
|
5360
|
+
), K(x) && Ze(x.draggedNode.data.value, c.value)) {
|
|
5362
5361
|
x.draggedNode.data = c, x.draggedNode.el = s;
|
|
5363
5362
|
const g = x.draggedNodes.find(
|
|
5364
5363
|
(h) => h.data.value === c.value
|
|
@@ -5437,7 +5436,7 @@ function qa(e, t) {
|
|
|
5437
5436
|
if (n.onDragstart) {
|
|
5438
5437
|
const i = {
|
|
5439
5438
|
parent: e.targetData.parent,
|
|
5440
|
-
values:
|
|
5439
|
+
values: Me(
|
|
5441
5440
|
e.targetData.parent.el,
|
|
5442
5441
|
e.targetData.parent.data
|
|
5443
5442
|
),
|
|
@@ -5451,7 +5450,7 @@ function qa(e, t) {
|
|
|
5451
5450
|
}
|
|
5452
5451
|
function Wa(e, t) {
|
|
5453
5452
|
var u, l;
|
|
5454
|
-
if (
|
|
5453
|
+
if (Ee(e.e), t.pointerDown = {
|
|
5455
5454
|
parent: e.targetData.parent,
|
|
5456
5455
|
node: e.targetData.node,
|
|
5457
5456
|
validated: !1
|
|
@@ -5526,27 +5525,27 @@ function Wa(e, t) {
|
|
|
5526
5525
|
);
|
|
5527
5526
|
}
|
|
5528
5527
|
function Ya(e, t, n, r = !1) {
|
|
5529
|
-
|
|
5528
|
+
Re(
|
|
5530
5529
|
t.map((o) => o.el),
|
|
5531
5530
|
r ? n.synthDraggingClass : n.draggingClass
|
|
5532
5531
|
), setTimeout(() => {
|
|
5533
|
-
|
|
5532
|
+
Ce(
|
|
5534
5533
|
t.map((o) => o.el),
|
|
5535
5534
|
r ? n.synthDraggingClass : n.draggingClass
|
|
5536
|
-
),
|
|
5535
|
+
), Re(
|
|
5537
5536
|
t.map((o) => o.el),
|
|
5538
5537
|
r ? n.synthDragPlaceholderClass : n.dragPlaceholderClass
|
|
5539
|
-
),
|
|
5538
|
+
), Re(
|
|
5540
5539
|
t.map((o) => o.el),
|
|
5541
5540
|
r ? n.synthDropZoneClass : n.dropZoneClass
|
|
5542
|
-
),
|
|
5541
|
+
), Ce(
|
|
5543
5542
|
t.map((o) => o.el),
|
|
5544
5543
|
n.selectedClass
|
|
5545
5544
|
);
|
|
5546
5545
|
});
|
|
5547
5546
|
}
|
|
5548
5547
|
function Xa(e, t) {
|
|
5549
|
-
|
|
5548
|
+
Ee(e.e);
|
|
5550
5549
|
const n = dr(
|
|
5551
5550
|
cr(
|
|
5552
5551
|
e.targetData.node,
|
|
@@ -5623,7 +5622,7 @@ function Ja(e) {
|
|
|
5623
5622
|
}
|
|
5624
5623
|
function Za(e, t) {
|
|
5625
5624
|
const n = e.targetData.parent.data.config;
|
|
5626
|
-
n.nativeDrag && (
|
|
5625
|
+
n.nativeDrag && (Ee(e.e), De = !0, n.handleEnd(t));
|
|
5627
5626
|
}
|
|
5628
5627
|
function Ka(e) {
|
|
5629
5628
|
e.e.target !== e.e.currentTarget && x.pointerDown && (x.pointerDown.node.el.draggable = !1);
|
|
@@ -5634,8 +5633,8 @@ function el(e) {
|
|
|
5634
5633
|
function tl(e, t) {
|
|
5635
5634
|
const n = e.targetData.parent.data.config;
|
|
5636
5635
|
if (n.nativeDrag) {
|
|
5637
|
-
if (Z(e.e),
|
|
5638
|
-
|
|
5636
|
+
if (Z(e.e), Ee(e.e), De) {
|
|
5637
|
+
De = !1;
|
|
5639
5638
|
return;
|
|
5640
5639
|
}
|
|
5641
5640
|
n.handleEnd(t);
|
|
@@ -5644,14 +5643,14 @@ function tl(e, t) {
|
|
|
5644
5643
|
function nl(e, t) {
|
|
5645
5644
|
var r;
|
|
5646
5645
|
if (!de(t)) return;
|
|
5647
|
-
if (Z(e.e),
|
|
5648
|
-
|
|
5646
|
+
if (Z(e.e), De) {
|
|
5647
|
+
De = !1;
|
|
5649
5648
|
return;
|
|
5650
5649
|
}
|
|
5651
5650
|
const n = (r = Q.get(t.initialParent.el)) == null ? void 0 : r.config;
|
|
5652
5651
|
n != null && n.onDragend && n.onDragend({
|
|
5653
5652
|
parent: t.currentParent,
|
|
5654
|
-
values:
|
|
5653
|
+
values: Me(t.currentParent.el, t.currentParent.data),
|
|
5655
5654
|
draggedNode: t.draggedNode,
|
|
5656
5655
|
draggedNodes: t.draggedNodes,
|
|
5657
5656
|
state: t
|
|
@@ -5662,12 +5661,12 @@ function rl(e) {
|
|
|
5662
5661
|
e.draggedNode && (e.draggedNode.el.draggable = !0);
|
|
5663
5662
|
const t = e.draggedNodes.map((m) => m.el), n = e.initialParent.data, r = de(e), o = (p = Q.get(e.initialParent.el)) == null ? void 0 : p.config, i = r ? o == null ? void 0 : o.synthDropZoneClass : o == null ? void 0 : o.dropZoneClass, d = (c = n == null ? void 0 : n.config) == null ? void 0 : c.longPressClass, u = r ? (g = n == null ? void 0 : n.config) == null ? void 0 : g.synthDragPlaceholderClass : (h = n == null ? void 0 : n.config) == null ? void 0 : h.dragPlaceholderClass, l = e.originalZIndex;
|
|
5664
5663
|
de(e) && (e.clonedDraggedNode && e.clonedDraggedNode.remove(), e.longPressTimeout && clearTimeout(e.longPressTimeout)), Xt(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(() => {
|
|
5665
|
-
|
|
5664
|
+
Ce(t, i), Ce(t, d), Ce(t, u);
|
|
5666
5665
|
}), Ae(e.draggedNodes, e.currentParent, e), ke(e.currentParent, void 0, e);
|
|
5667
5666
|
const s = { ...e };
|
|
5668
5667
|
(f = o == null ? void 0 : o.onDragend) == null || f.call(o, {
|
|
5669
5668
|
parent: s.currentParent,
|
|
5670
|
-
values:
|
|
5669
|
+
values: Me(
|
|
5671
5670
|
s.currentParent.el,
|
|
5672
5671
|
s.currentParent.data
|
|
5673
5672
|
),
|
|
@@ -5677,9 +5676,9 @@ function rl(e) {
|
|
|
5677
5676
|
}), e.emit("dragEnded", s), Ca();
|
|
5678
5677
|
}
|
|
5679
5678
|
function ol(e, t) {
|
|
5680
|
-
|
|
5679
|
+
Ee(e.e), !t.pointerSelection && t.selectedState && Ae(t.selectedState.nodes, e.targetData.parent, t);
|
|
5681
5680
|
const n = e.targetData.parent.data.config;
|
|
5682
|
-
t.pointerSelection = !1, "longPressTimeout" in t && t.longPressTimeout && clearTimeout(t.longPressTimeout), t.longPress = !1,
|
|
5681
|
+
t.pointerSelection = !1, "longPressTimeout" in t && t.longPressTimeout && clearTimeout(t.longPressTimeout), t.longPress = !1, Ce(
|
|
5683
5682
|
e.targetData.parent.data.enabledNodes.map((r) => r.el),
|
|
5684
5683
|
n.longPressClass
|
|
5685
5684
|
), K(t) && n.handleEnd(t);
|
|
@@ -5770,7 +5769,7 @@ function il(e, t, n, r, o, i) {
|
|
|
5770
5769
|
function al(e, t, n) {
|
|
5771
5770
|
const r = e.targetData.parent.data.config;
|
|
5772
5771
|
t.longPressTimeout = setTimeout(() => {
|
|
5773
|
-
t && (t.longPress = !0, r.longPressClass && e.e.cancelable &&
|
|
5772
|
+
t && (t.longPress = !0, r.longPressClass && e.e.cancelable && Re([n.el], r.longPressClass), Z(e.e));
|
|
5774
5773
|
}, r.longPressDuration || 1e3);
|
|
5775
5774
|
}
|
|
5776
5775
|
function Xt(e, t = !0, n = !0) {
|
|
@@ -5779,13 +5778,13 @@ function Xt(e, t = !0, n = !0) {
|
|
|
5779
5778
|
function gr(e, t = !1) {
|
|
5780
5779
|
var p;
|
|
5781
5780
|
const { x: n, y: r } = e.coordinates, o = e.startLeft ?? 0, i = e.startTop ?? 0, d = window.scrollX ?? 0, u = window.scrollY ?? 0, l = n - o + d, s = r - i + u;
|
|
5782
|
-
e.clonedDraggedNode.style.transform = `translate3d(${l}px, ${s}px, 0px)`, t && (e.clonedDraggedNode.style.opacity = "1",
|
|
5781
|
+
e.clonedDraggedNode.style.transform = `translate3d(${l}px, ${s}px, 0px)`, t && (e.clonedDraggedNode.style.opacity = "1", Ce(
|
|
5783
5782
|
e.draggedNodes.map((c) => c.el),
|
|
5784
5783
|
(p = e.initialParent.data.config) == null ? void 0 : p.longPressClass
|
|
5785
5784
|
));
|
|
5786
5785
|
}
|
|
5787
5786
|
function Mn(e, t, n = !1) {
|
|
5788
|
-
const r =
|
|
5787
|
+
const r = Pe(e);
|
|
5789
5788
|
t.coordinates.x = r.x, t.coordinates.y = r.y, gr(t, n), t.scrollDebounceTimeout && (clearTimeout(t.scrollDebounceTimeout), t.scrollDebounceTimeout = void 0), t.scrollDebounceTimeout = setTimeout(() => {
|
|
5790
5789
|
de(t) && Nt(t.coordinates, e, t);
|
|
5791
5790
|
}, 16);
|
|
@@ -5819,13 +5818,13 @@ function Mn(e, t, n = !1) {
|
|
|
5819
5818
|
function ll(e, t) {
|
|
5820
5819
|
var i;
|
|
5821
5820
|
if (!e.targetData.parent.data.config.nativeDrag) return;
|
|
5822
|
-
const { x: r, y: o } =
|
|
5823
|
-
t.coordinates.y = o, t.coordinates.x = r, Z(e.e),
|
|
5821
|
+
const { x: r, y: o } = Pe(e.e);
|
|
5822
|
+
t.coordinates.y = o, t.coordinates.x = r, Z(e.e), Ee(e.e), K(t) && Nt({ x: r, y: o }, e.e, t), e.targetData.parent.el === ((i = t.currentParent) == null ? void 0 : i.el) ? fr(e, t) : Et(e, t);
|
|
5824
5823
|
}
|
|
5825
5824
|
function sl(e, t) {
|
|
5826
5825
|
if (!e.targetData.parent.data.config.nativeDrag) return;
|
|
5827
|
-
Z(e.e),
|
|
5828
|
-
const { x: r, y: o } =
|
|
5826
|
+
Z(e.e), Ee(e.e);
|
|
5827
|
+
const { x: r, y: o } = Pe(e.e);
|
|
5829
5828
|
K(t) && Nt({ x: r, y: o }, e.e, t), Et(e, t);
|
|
5830
5829
|
}
|
|
5831
5830
|
function dl(e) {
|
|
@@ -5890,7 +5889,7 @@ function hl(e, t, n, r) {
|
|
|
5890
5889
|
return !1;
|
|
5891
5890
|
}
|
|
5892
5891
|
function fr(e, t) {
|
|
5893
|
-
const { x: n, y: r } =
|
|
5892
|
+
const { x: n, y: r } = Pe(e.e);
|
|
5894
5893
|
if (!hl(e, t, n, r))
|
|
5895
5894
|
return;
|
|
5896
5895
|
const o = 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];
|
|
@@ -5902,9 +5901,9 @@ function fr(e, t) {
|
|
|
5902
5901
|
targetNodes: [e.targetData.node]
|
|
5903
5902
|
});
|
|
5904
5903
|
}
|
|
5905
|
-
function
|
|
5904
|
+
function ie(e) {
|
|
5906
5905
|
function t(n) {
|
|
5907
|
-
const r =
|
|
5906
|
+
const r = ye.get(n);
|
|
5908
5907
|
if (!r) return;
|
|
5909
5908
|
const o = Q.get(n.parentNode);
|
|
5910
5909
|
if (o)
|
|
@@ -5971,12 +5970,12 @@ function bt(e) {
|
|
|
5971
5970
|
);
|
|
5972
5971
|
};
|
|
5973
5972
|
}
|
|
5974
|
-
function
|
|
5973
|
+
function Re(e, t, n = !1) {
|
|
5975
5974
|
function r(o, i) {
|
|
5976
|
-
|
|
5975
|
+
ye.set(o, i);
|
|
5977
5976
|
}
|
|
5978
5977
|
for (const o of e) {
|
|
5979
|
-
const i =
|
|
5978
|
+
const i = ye.get(o), d = gl(o, t, i, n);
|
|
5980
5979
|
d && r(o, d);
|
|
5981
5980
|
}
|
|
5982
5981
|
}
|
|
@@ -5997,7 +5996,7 @@ function gl(e, t, n, r = !1) {
|
|
|
5997
5996
|
) : e.classList.add(d);
|
|
5998
5997
|
return n.privateClasses = i, n;
|
|
5999
5998
|
}
|
|
6000
|
-
function
|
|
5999
|
+
function Ce(e, t) {
|
|
6001
6000
|
if (!t) return;
|
|
6002
6001
|
const n = lr(t);
|
|
6003
6002
|
if (n.length)
|
|
@@ -6006,7 +6005,7 @@ function De(e, t) {
|
|
|
6006
6005
|
r.classList.remove(...n);
|
|
6007
6006
|
continue;
|
|
6008
6007
|
}
|
|
6009
|
-
const o =
|
|
6008
|
+
const o = ye.get(r) || Q.get(r);
|
|
6010
6009
|
if (o)
|
|
6011
6010
|
for (const i of n)
|
|
6012
6011
|
o.privateClasses.includes(i) || r.classList.remove(i);
|
|
@@ -6091,7 +6090,7 @@ function ml(e) {
|
|
|
6091
6090
|
if (!At(t)) return;
|
|
6092
6091
|
let n, r = !0;
|
|
6093
6092
|
for (; t && r; ) {
|
|
6094
|
-
if (
|
|
6093
|
+
if (ye.has(t) || Q.has(t)) {
|
|
6095
6094
|
r = !1, n = Q.has(t);
|
|
6096
6095
|
break;
|
|
6097
6096
|
}
|
|
@@ -6106,7 +6105,7 @@ function ml(e) {
|
|
|
6106
6105
|
}
|
|
6107
6106
|
} : void 0;
|
|
6108
6107
|
} else {
|
|
6109
|
-
const o =
|
|
6108
|
+
const o = ye.get(t);
|
|
6110
6109
|
if (!o) return;
|
|
6111
6110
|
const i = Q.get(t.parentNode);
|
|
6112
6111
|
return i ? {
|
|
@@ -6167,13 +6166,13 @@ function _n(e) {
|
|
|
6167
6166
|
}));
|
|
6168
6167
|
}
|
|
6169
6168
|
function wl(e, t = {}) {
|
|
6170
|
-
const n =
|
|
6169
|
+
const n = Ye(null), [r, o] = q(e);
|
|
6171
6170
|
function i(d = {}) {
|
|
6172
6171
|
_n({ parent: n, state: [r, o], ...d });
|
|
6173
6172
|
}
|
|
6174
|
-
return
|
|
6173
|
+
return Le(() => {
|
|
6175
6174
|
_n({ parent: n, state: [r, o], ...t });
|
|
6176
|
-
}, [r]),
|
|
6175
|
+
}, [r]), Le(() => () => {
|
|
6177
6176
|
n.current && ur(n.current);
|
|
6178
6177
|
}, []), [n, r, o, i];
|
|
6179
6178
|
}
|
|
@@ -6258,7 +6257,7 @@ const Vn = {
|
|
|
6258
6257
|
}, [g, n, u, l]);
|
|
6259
6258
|
const k = g.length === 0;
|
|
6260
6259
|
return /* @__PURE__ */ a(
|
|
6261
|
-
|
|
6260
|
+
We,
|
|
6262
6261
|
{
|
|
6263
6262
|
legend: o,
|
|
6264
6263
|
width: "100%",
|
|
@@ -6428,7 +6427,7 @@ const Vn = {
|
|
|
6428
6427
|
)
|
|
6429
6428
|
] });
|
|
6430
6429
|
}, Ms = (e) => Object.values(e).flat(), Ps = (e, t) => {
|
|
6431
|
-
const n =
|
|
6430
|
+
const n = Te(e);
|
|
6432
6431
|
return Object.fromEntries(
|
|
6433
6432
|
Object.entries(n).map(([r, o]) => [r, o.map(t)])
|
|
6434
6433
|
);
|
|
@@ -6436,7 +6435,7 @@ const Vn = {
|
|
|
6436
6435
|
ConditionGroupId: t,
|
|
6437
6436
|
conditionsThatEstablishesTheDecision: yt(n)
|
|
6438
6437
|
})), js = (e) => {
|
|
6439
|
-
const t =
|
|
6438
|
+
const t = Te(e);
|
|
6440
6439
|
return {
|
|
6441
6440
|
...e,
|
|
6442
6441
|
conditionGroups: Nl(t),
|
|
@@ -6444,11 +6443,11 @@ const Vn = {
|
|
|
6444
6443
|
conditionsThatEstablishesTheDecision: t
|
|
6445
6444
|
// preserve full structure
|
|
6446
6445
|
};
|
|
6447
|
-
},
|
|
6446
|
+
}, Be = /* @__PURE__ */ new Map(), Al = (e, t) => Be.get(`${t}:${e}`), kl = (e, t, n) => {
|
|
6448
6447
|
const r = `${t}:${e}`;
|
|
6449
|
-
if (
|
|
6450
|
-
const o =
|
|
6451
|
-
o !== void 0 &&
|
|
6448
|
+
if (Be.set(r, n), Be.size > 1e3) {
|
|
6449
|
+
const o = Be.keys().next().value;
|
|
6450
|
+
o !== void 0 && Be.delete(o);
|
|
6452
6451
|
}
|
|
6453
6452
|
}, zn = /* @__PURE__ */ new Map(), $l = 1e3, Il = (e) => {
|
|
6454
6453
|
const t = Date.now(), n = zn.get(e) || 0;
|
|
@@ -6752,7 +6751,7 @@ const Ul = (e) => {
|
|
|
6752
6751
|
onClickButton: u,
|
|
6753
6752
|
withTag: l,
|
|
6754
6753
|
children: s
|
|
6755
|
-
} = e, p =
|
|
6754
|
+
} = e, p = fe("(max-width: 1281px)");
|
|
6756
6755
|
return /* @__PURE__ */ a(
|
|
6757
6756
|
ln,
|
|
6758
6757
|
{
|
|
@@ -6762,7 +6761,7 @@ const Ul = (e) => {
|
|
|
6762
6761
|
boxSizing: "border-box",
|
|
6763
6762
|
backgroundColor: he.GRAY,
|
|
6764
6763
|
children: /* @__PURE__ */ v(
|
|
6765
|
-
|
|
6764
|
+
we,
|
|
6766
6765
|
{
|
|
6767
6766
|
templateColumns: d === "column" ? "1fr" : "auto 1fr",
|
|
6768
6767
|
templateRows: "auto auto",
|
|
@@ -6820,7 +6819,7 @@ function ql(e) {
|
|
|
6820
6819
|
const { ctx: t, node: n } = e, r = n.layout ?? {}, o = an(n.entries, t.data);
|
|
6821
6820
|
if (!o || o.length === 0) return null;
|
|
6822
6821
|
const i = /* @__PURE__ */ a(
|
|
6823
|
-
|
|
6822
|
+
we,
|
|
6824
6823
|
{
|
|
6825
6824
|
width: "100%",
|
|
6826
6825
|
height: "auto",
|
|
@@ -6863,7 +6862,7 @@ function Yl(e) {
|
|
|
6863
6862
|
const n = (e.split(".").pop() ?? e).replace(/([A-Z])/g, " $1").trim();
|
|
6864
6863
|
return n.charAt(0).toUpperCase() + n.slice(1);
|
|
6865
6864
|
}
|
|
6866
|
-
function
|
|
6865
|
+
function be(e) {
|
|
6867
6866
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
6868
6867
|
}
|
|
6869
6868
|
function Xl(e) {
|
|
@@ -6910,7 +6909,7 @@ function Jl(e, t) {
|
|
|
6910
6909
|
d(p, g);
|
|
6911
6910
|
return;
|
|
6912
6911
|
}
|
|
6913
|
-
if (
|
|
6912
|
+
if (be(s)) {
|
|
6914
6913
|
if (i.has(s)) {
|
|
6915
6914
|
d(p, "[Circular]");
|
|
6916
6915
|
return;
|
|
@@ -6922,10 +6921,10 @@ function Jl(e, t) {
|
|
|
6922
6921
|
return;
|
|
6923
6922
|
}
|
|
6924
6923
|
for (const [h, f] of g) {
|
|
6925
|
-
if (!
|
|
6924
|
+
if (!be(f) && !Array.isArray(f) && u(f))
|
|
6926
6925
|
continue;
|
|
6927
6926
|
const m = n.has(h) ? p : Ql(p, h);
|
|
6928
|
-
|
|
6927
|
+
be(f) || Array.isArray(f) ? l(f, m, c + 1) : d(m || h, f);
|
|
6929
6928
|
}
|
|
6930
6929
|
return;
|
|
6931
6930
|
}
|
|
@@ -6960,7 +6959,7 @@ function Qt(e) {
|
|
|
6960
6959
|
skipKeys: ["values"],
|
|
6961
6960
|
maxDepth: 4
|
|
6962
6961
|
}), o = n || r.length === 1 ? "1fr" : "repeat(2, 1fr)";
|
|
6963
|
-
return /* @__PURE__ */ a(
|
|
6962
|
+
return /* @__PURE__ */ a(we, { width: "100%", templateColumns: o, gap: "8px", autoRows: "unset", children: r.map((i) => /* @__PURE__ */ a(
|
|
6964
6963
|
sn,
|
|
6965
6964
|
{
|
|
6966
6965
|
direction: "column",
|
|
@@ -6992,7 +6991,7 @@ function es(e) {
|
|
|
6992
6991
|
}).filter(Boolean);
|
|
6993
6992
|
if (o.length === 0)
|
|
6994
6993
|
return null;
|
|
6995
|
-
const d = o.length === 1 ? "1fr" : t.isMobile ? ((l = r.columns) == null ? void 0 : l.mobile) ?? "1fr" : ((s = r.columns) == null ? void 0 : s.desktop) ?? "repeat(2, 1fr)", u = /* @__PURE__ */ a(
|
|
6994
|
+
const d = o.length === 1 ? "1fr" : t.isMobile ? ((l = r.columns) == null ? void 0 : l.mobile) ?? "1fr" : ((s = r.columns) == null ? void 0 : s.desktop) ?? "repeat(2, 1fr)", u = /* @__PURE__ */ a(we, { width: "100%", templateColumns: d, gap: "8px 16px", autoRows: "unset", children: o.map(({ item: p, valueNode: c, shouldUseChildren: g }) => /* @__PURE__ */ a(
|
|
6996
6995
|
sn,
|
|
6997
6996
|
{
|
|
6998
6997
|
direction: "column",
|
|
@@ -7088,20 +7087,20 @@ const rs = D.div`
|
|
|
7088
7087
|
] })
|
|
7089
7088
|
] });
|
|
7090
7089
|
};
|
|
7091
|
-
function
|
|
7090
|
+
function ae(e) {
|
|
7092
7091
|
const t = e.replace(/([A-Z])/g, " $1").trim();
|
|
7093
7092
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
7094
7093
|
}
|
|
7095
7094
|
function qn(e, t) {
|
|
7096
7095
|
return Object.keys(t).map((r) => ({
|
|
7097
7096
|
id: `${e}.${r}`,
|
|
7098
|
-
label:
|
|
7097
|
+
label: ae(r),
|
|
7099
7098
|
value: `${e}.${r}`,
|
|
7100
7099
|
render: (o) => ue(o)
|
|
7101
7100
|
}));
|
|
7102
7101
|
}
|
|
7103
7102
|
function as(e) {
|
|
7104
|
-
if (!
|
|
7103
|
+
if (!be(e) && !Array.isArray(e))
|
|
7105
7104
|
return {
|
|
7106
7105
|
steps: [
|
|
7107
7106
|
{
|
|
@@ -7161,10 +7160,10 @@ function as(e) {
|
|
|
7161
7160
|
const t = e;
|
|
7162
7161
|
return { steps: Object.keys(t).map((o, i) => {
|
|
7163
7162
|
const d = String(i + 1), u = t[o];
|
|
7164
|
-
if (!
|
|
7163
|
+
if (!be(u) && !Array.isArray(u))
|
|
7165
7164
|
return {
|
|
7166
7165
|
id: d,
|
|
7167
|
-
name:
|
|
7166
|
+
name: ae(o),
|
|
7168
7167
|
nodes: [
|
|
7169
7168
|
{
|
|
7170
7169
|
id: `${o}-primitive`,
|
|
@@ -7176,7 +7175,7 @@ function as(e) {
|
|
|
7176
7175
|
items: [
|
|
7177
7176
|
{
|
|
7178
7177
|
id: `${o}.value`,
|
|
7179
|
-
label:
|
|
7178
|
+
label: ae(o),
|
|
7180
7179
|
value: (l) => l == null ? void 0 : l[o],
|
|
7181
7180
|
render: (l) => ue(l)
|
|
7182
7181
|
}
|
|
@@ -7185,9 +7184,9 @@ function as(e) {
|
|
|
7185
7184
|
]
|
|
7186
7185
|
};
|
|
7187
7186
|
if (Array.isArray(u))
|
|
7188
|
-
return u.some((s) =>
|
|
7187
|
+
return u.some((s) => be(s)) ? {
|
|
7189
7188
|
id: d,
|
|
7190
|
-
name:
|
|
7189
|
+
name: ae(o),
|
|
7191
7190
|
nodes: u.map((s, p) => {
|
|
7192
7191
|
const g = Object.keys(s);
|
|
7193
7192
|
return {
|
|
@@ -7199,7 +7198,7 @@ function as(e) {
|
|
|
7199
7198
|
},
|
|
7200
7199
|
items: g.map((h) => ({
|
|
7201
7200
|
id: `${o}[${p}].${h}`,
|
|
7202
|
-
label:
|
|
7201
|
+
label: ae(h),
|
|
7203
7202
|
value: (f) => {
|
|
7204
7203
|
var m, y;
|
|
7205
7204
|
return (y = (m = f == null ? void 0 : f[o]) == null ? void 0 : m[p]) == null ? void 0 : y[h];
|
|
@@ -7210,7 +7209,7 @@ function as(e) {
|
|
|
7210
7209
|
})
|
|
7211
7210
|
} : {
|
|
7212
7211
|
id: d,
|
|
7213
|
-
name:
|
|
7212
|
+
name: ae(o),
|
|
7214
7213
|
nodes: [
|
|
7215
7214
|
{
|
|
7216
7215
|
id: `${o}-entries`,
|
|
@@ -7224,11 +7223,11 @@ function as(e) {
|
|
|
7224
7223
|
}
|
|
7225
7224
|
]
|
|
7226
7225
|
};
|
|
7227
|
-
if (
|
|
7226
|
+
if (be(u) && "values" in u) {
|
|
7228
7227
|
const l = u.values;
|
|
7229
|
-
return Array.isArray(l) ? l.length > 0 && l.every((c) =>
|
|
7228
|
+
return Array.isArray(l) ? l.length > 0 && l.every((c) => be(c) && "labelName" in c && "value" in c) ? {
|
|
7230
7229
|
id: d,
|
|
7231
|
-
name:
|
|
7230
|
+
name: ae(o),
|
|
7232
7231
|
nodes: [
|
|
7233
7232
|
{
|
|
7234
7233
|
id: `${o}-values`,
|
|
@@ -7244,9 +7243,9 @@ function as(e) {
|
|
|
7244
7243
|
valueOf: (c) => "labelName" in (c ?? {}) && "value" in (c ?? {}) ? `${String(c.labelName)}: ${ue(c.value)}` : ue(c)
|
|
7245
7244
|
}
|
|
7246
7245
|
]
|
|
7247
|
-
} : l.some((c) =>
|
|
7246
|
+
} : l.some((c) => be(c)) ? {
|
|
7248
7247
|
id: d,
|
|
7249
|
-
name:
|
|
7248
|
+
name: ae(o),
|
|
7250
7249
|
nodes: l.map((c, g) => {
|
|
7251
7250
|
const f = Object.keys(c);
|
|
7252
7251
|
return {
|
|
@@ -7258,7 +7257,7 @@ function as(e) {
|
|
|
7258
7257
|
},
|
|
7259
7258
|
items: f.map((m) => ({
|
|
7260
7259
|
id: `${o}.values[${g}].${m}`,
|
|
7261
|
-
label:
|
|
7260
|
+
label: ae(m),
|
|
7262
7261
|
value: (y) => {
|
|
7263
7262
|
var T, S, k;
|
|
7264
7263
|
return (k = (S = (T = y == null ? void 0 : y[o]) == null ? void 0 : T.values) == null ? void 0 : S[g]) == null ? void 0 : k[m];
|
|
@@ -7269,7 +7268,7 @@ function as(e) {
|
|
|
7269
7268
|
})
|
|
7270
7269
|
} : {
|
|
7271
7270
|
id: d,
|
|
7272
|
-
name:
|
|
7271
|
+
name: ae(o),
|
|
7273
7272
|
nodes: [
|
|
7274
7273
|
{
|
|
7275
7274
|
id: `${o}-values`,
|
|
@@ -7285,9 +7284,9 @@ function as(e) {
|
|
|
7285
7284
|
valueOf: (c) => ue(c)
|
|
7286
7285
|
}
|
|
7287
7286
|
]
|
|
7288
|
-
} :
|
|
7287
|
+
} : be(l) ? {
|
|
7289
7288
|
id: d,
|
|
7290
|
-
name:
|
|
7289
|
+
name: ae(o),
|
|
7291
7290
|
nodes: [
|
|
7292
7291
|
{
|
|
7293
7292
|
id: `${o}-values`,
|
|
@@ -7308,7 +7307,7 @@ function as(e) {
|
|
|
7308
7307
|
]
|
|
7309
7308
|
} : {
|
|
7310
7309
|
id: d,
|
|
7311
|
-
name:
|
|
7310
|
+
name: ae(o),
|
|
7312
7311
|
nodes: [
|
|
7313
7312
|
{
|
|
7314
7313
|
id: `${o}-values`,
|
|
@@ -7335,7 +7334,7 @@ function as(e) {
|
|
|
7335
7334
|
}
|
|
7336
7335
|
return {
|
|
7337
7336
|
id: d,
|
|
7338
|
-
name:
|
|
7337
|
+
name: ae(o),
|
|
7339
7338
|
nodes: [
|
|
7340
7339
|
{
|
|
7341
7340
|
id: `${o}-object`,
|
|
@@ -7387,10 +7386,10 @@ function _s(e) {
|
|
|
7387
7386
|
}
|
|
7388
7387
|
export {
|
|
7389
7388
|
Ls as BackAndNextButton,
|
|
7390
|
-
|
|
7391
|
-
|
|
7389
|
+
et as BusinessRuleCard,
|
|
7390
|
+
Kn as BusinessRuleCardNew,
|
|
7392
7391
|
rn as BusinessRuleView,
|
|
7393
|
-
|
|
7392
|
+
tr as BusinessRuleViewNew,
|
|
7394
7393
|
xs as BusinessRules,
|
|
7395
7394
|
Ss as BusinessRulesNew,
|
|
7396
7395
|
ws as BusinessRulesWithGroup,
|
|
@@ -7398,19 +7397,19 @@ export {
|
|
|
7398
7397
|
Gn as DraggableList,
|
|
7399
7398
|
ya as DropdownMenu,
|
|
7400
7399
|
Rs as DropdownMenuContainer,
|
|
7401
|
-
|
|
7400
|
+
le as EValueHowToSetUp,
|
|
7402
7401
|
Cs as Filter,
|
|
7403
7402
|
Ds as FormFilter,
|
|
7404
|
-
|
|
7403
|
+
Zr as ModalRules,
|
|
7405
7404
|
pa as RulesForm,
|
|
7406
7405
|
Fs as SendButton,
|
|
7407
7406
|
_s as Verification,
|
|
7408
7407
|
Oi as buildEsConditionSentence,
|
|
7409
7408
|
ea as convertRangeToString,
|
|
7410
|
-
|
|
7409
|
+
er as filterByGroup,
|
|
7411
7410
|
Ms as flatFromGroups,
|
|
7412
7411
|
Es as formatDecisionForBackend,
|
|
7413
|
-
|
|
7412
|
+
Te as getConditionsByGroupNew,
|
|
7414
7413
|
Nl as groupsRecordToArrayNew,
|
|
7415
7414
|
Ps as mapByGroupNew,
|
|
7416
7415
|
js as normalizeDecisionToNewShape,
|