@isettingkit/business-rules 2.1.4 → 2.1.5
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 +378 -364
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as a, jsxs as m, Fragment as O } from "react/jsx-runtime";
|
|
2
|
-
import { MdOutlineDelete as rn, MdClear as on, MdAdd as
|
|
3
|
-
import { inube as S, Stack as v, Divider as
|
|
2
|
+
import { MdOutlineDelete as rn, MdClear as on, MdAdd as qe, MdOutlineCreate as Tt, MdExpandLess as Ct, MdExpandMore as vn, MdInfo as Dt, MdCached as St, MdOutlineInfo as Et, MdClose as Nt, MdOutlineFilterAltOff as Jn, MdOutlineFilterAlt as et, MdChevronRight as Fn, MdArrowRight as kt, MdOutlineArrowCircleLeft as $t, MdOutlineArrowCircleRight as At, MdOutlineChevronRight as It, MdOutlineError as Rt } from "react-icons/md";
|
|
3
|
+
import { inube as S, Stack as v, Divider as U, Icon as P, Text as k, SkeletonLine as Q, useMediaQuery as J, Blanket as an, Button as H, Grid as Be, Toggle as ln, Checkbox as Sn, Date as ke, Box as Ft, Tag as ve, SkeletonIcon as Lt, Fieldset as ze, Tabs as Ot, OptionList as Pt, Checkpicker as Mt, Label as zt, OptionItem as Vt } from "@inubekit/inubekit";
|
|
4
4
|
import C, { keyframes as En, ThemeContext as Nn } from "styled-components";
|
|
5
|
-
import { ValueDataType as
|
|
5
|
+
import { ValueDataType as z, ValueHowToSetUp as K, DecisionConditionRender as Je, DecisionConditionRenderNew as Ln } from "@isettingkit/input";
|
|
6
6
|
import { DecisionViewConditionRenderer as Se, DecisionViewConditionRendererNew as Xe } from "@isettingkit/view";
|
|
7
7
|
import { createPortal as sn } from "react-dom";
|
|
8
8
|
import { useFormik as kn } from "formik";
|
|
9
|
-
import { string as
|
|
10
|
-
import
|
|
11
|
-
import { Link as tt, useLocation as
|
|
12
|
-
import
|
|
13
|
-
import { franc as
|
|
14
|
-
const
|
|
9
|
+
import { string as re, mixed as Ie, object as Z, number as oe, lazy as je, date as $e } from "yup";
|
|
10
|
+
import j, { useState as M, useRef as Ee, useEffect as xe, useContext as $n, forwardRef as Ht, useMemo as nt, useCallback as Ut } from "react";
|
|
11
|
+
import { Link as tt, useLocation as jt } from "react-router-dom";
|
|
12
|
+
import _t from "axios";
|
|
13
|
+
import { franc as qt } from "franc-min";
|
|
14
|
+
const Bt = C.div`
|
|
15
15
|
border-radius: 8px;
|
|
16
16
|
border: 1px solid
|
|
17
17
|
${({ theme: e }) => {
|
|
@@ -48,10 +48,10 @@ C.div`
|
|
|
48
48
|
`;
|
|
49
49
|
const Ge = (e) => {
|
|
50
50
|
const { children: n, controls: t = !0, handleDelete: r, id: o } = e;
|
|
51
|
-
return /* @__PURE__ */ a(
|
|
51
|
+
return /* @__PURE__ */ a(Bt, { children: /* @__PURE__ */ m(v, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
52
52
|
n,
|
|
53
53
|
t && /* @__PURE__ */ m(O, { children: [
|
|
54
|
-
/* @__PURE__ */ a(
|
|
54
|
+
/* @__PURE__ */ a(U, {}),
|
|
55
55
|
/* @__PURE__ */ a(v, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ a(
|
|
56
56
|
P,
|
|
57
57
|
{
|
|
@@ -131,7 +131,7 @@ const Jt = {
|
|
|
131
131
|
type: "decision"
|
|
132
132
|
}
|
|
133
133
|
) }, t.ruleName),
|
|
134
|
-
/* @__PURE__ */ a(
|
|
134
|
+
/* @__PURE__ */ a(U, { dashed: !0 }),
|
|
135
135
|
/* @__PURE__ */ a(Pn, { children: /* @__PURE__ */ m(
|
|
136
136
|
v,
|
|
137
137
|
{
|
|
@@ -160,7 +160,7 @@ const Jt = {
|
|
|
160
160
|
)
|
|
161
161
|
}
|
|
162
162
|
) }) }, u.conditionName)),
|
|
163
|
-
p.length > 0 && /* @__PURE__ */ a(
|
|
163
|
+
p.length > 0 && /* @__PURE__ */ a(U, { dashed: !0 }),
|
|
164
164
|
d && /* @__PURE__ */ a(O, { children: r && /* @__PURE__ */ a(
|
|
165
165
|
Se,
|
|
166
166
|
{
|
|
@@ -179,7 +179,7 @@ const Jt = {
|
|
|
179
179
|
/* @__PURE__ */ a(Q, { animated: !0, width: "85px" })
|
|
180
180
|
] }, "loading"),
|
|
181
181
|
/* @__PURE__ */ m(v, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
182
|
-
/* @__PURE__ */ a(
|
|
182
|
+
/* @__PURE__ */ a(U, { dashed: !0 }),
|
|
183
183
|
/* @__PURE__ */ a(Q, { animated: !0, width: "150px" })
|
|
184
184
|
] }),
|
|
185
185
|
/* @__PURE__ */ a(Pn, { children: /* @__PURE__ */ a(
|
|
@@ -212,7 +212,7 @@ const Jt = {
|
|
|
212
212
|
labelName: r == null ? void 0 : r.terms,
|
|
213
213
|
value: String(n.effectiveFrom),
|
|
214
214
|
howToSetTheDecision: K.RANGE,
|
|
215
|
-
decisionDataType:
|
|
215
|
+
decisionDataType: z.DATE
|
|
216
216
|
},
|
|
217
217
|
valueData: Ve({
|
|
218
218
|
labelName: r == null ? void 0 : r.terms,
|
|
@@ -221,20 +221,20 @@ const Jt = {
|
|
|
221
221
|
to: String(n.validUntil)
|
|
222
222
|
},
|
|
223
223
|
howToSetTheDecision: K.RANGE,
|
|
224
|
-
decisionDataType:
|
|
224
|
+
decisionDataType: z.DATE
|
|
225
225
|
})
|
|
226
226
|
} : o && !i ? {
|
|
227
227
|
element: {
|
|
228
228
|
labelName: r == null ? void 0 : r.terms,
|
|
229
229
|
value: String(n.effectiveFrom),
|
|
230
230
|
howToSetTheDecision: K.EQUAL,
|
|
231
|
-
decisionDataType:
|
|
231
|
+
decisionDataType: z.DATE
|
|
232
232
|
},
|
|
233
233
|
valueData: Ve({
|
|
234
234
|
labelName: r == null ? void 0 : r.terms,
|
|
235
235
|
value: String(n.effectiveFrom),
|
|
236
236
|
howToSetTheDecision: K.EQUAL,
|
|
237
|
-
decisionDataType:
|
|
237
|
+
decisionDataType: z.DATE
|
|
238
238
|
})
|
|
239
239
|
} : null, d = n ? {
|
|
240
240
|
labelName: n.labelName || "",
|
|
@@ -300,7 +300,7 @@ const Jt = {
|
|
|
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 s =
|
|
303
|
+
const s = J("(max-width: 400px)");
|
|
304
304
|
return sn(
|
|
305
305
|
/* @__PURE__ */ a(nr, { smallScreen: s, children: /* @__PURE__ */ a(an, { children: /* @__PURE__ */ a(tr, { children: /* @__PURE__ */ m(v, { direction: "column", gap: "24px", children: [
|
|
306
306
|
/* @__PURE__ */ a(v, { direction: "column", gap: "24px", children: /* @__PURE__ */ m(v, { alignItems: "center", justifyContent: "space-between", children: [
|
|
@@ -440,7 +440,7 @@ const ot = C.div`
|
|
|
440
440
|
handleView: () => r ? r() : null,
|
|
441
441
|
controls: !1,
|
|
442
442
|
children: /* @__PURE__ */ m(v, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
443
|
-
/* @__PURE__ */ a(P, { appearance: "gray", icon: /* @__PURE__ */ a(
|
|
443
|
+
/* @__PURE__ */ a(P, { appearance: "gray", icon: /* @__PURE__ */ a(qe, {}), size: "35px" }),
|
|
444
444
|
/* @__PURE__ */ a(k, { appearance: "gray", type: "body", size: "large", children: i })
|
|
445
445
|
] })
|
|
446
446
|
}
|
|
@@ -504,7 +504,7 @@ const ot = C.div`
|
|
|
504
504
|
handleSubmitForm: g,
|
|
505
505
|
handleDelete: h,
|
|
506
506
|
terms: f = !0
|
|
507
|
-
} = e, w =
|
|
507
|
+
} = e, w = J("(max-width: 681px)"), y = J("(max-width: 400px)"), { renderedCards: x, shouldRenderAddCard: T } = cr({
|
|
508
508
|
controls: n,
|
|
509
509
|
customTitleContentAddCard: t,
|
|
510
510
|
decisions: o,
|
|
@@ -546,7 +546,7 @@ const ot = C.div`
|
|
|
546
546
|
/* @__PURE__ */ a(
|
|
547
547
|
H,
|
|
548
548
|
{
|
|
549
|
-
iconBefore: /* @__PURE__ */ a(
|
|
549
|
+
iconBefore: /* @__PURE__ */ a(qe, {}),
|
|
550
550
|
onClick: () => u ? u() : null,
|
|
551
551
|
children: t || "Agregar decisión"
|
|
552
552
|
}
|
|
@@ -554,7 +554,7 @@ const ot = C.div`
|
|
|
554
554
|
]
|
|
555
555
|
}
|
|
556
556
|
) : /* @__PURE__ */ m(
|
|
557
|
-
|
|
557
|
+
Be,
|
|
558
558
|
{
|
|
559
559
|
templateColumns: y ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
|
|
560
560
|
autoFlow: "row dense",
|
|
@@ -644,7 +644,7 @@ const ot = C.div`
|
|
|
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 s =
|
|
647
|
+
const s = J("(max-width: 400px)");
|
|
648
648
|
return sn(
|
|
649
649
|
/* @__PURE__ */ a(ur, { $smallScreen: s, children: /* @__PURE__ */ a(an, { children: /* @__PURE__ */ a(pr, { children: /* @__PURE__ */ m(v, { direction: "column", gap: "24px", children: [
|
|
650
650
|
/* @__PURE__ */ a(v, { direction: "column", gap: "24px", children: /* @__PURE__ */ m(v, { alignItems: "center", justifyContent: "space-between", children: [
|
|
@@ -812,7 +812,7 @@ const fr = C.div`
|
|
|
812
812
|
type: "decision"
|
|
813
813
|
}
|
|
814
814
|
) }, t.ruleName),
|
|
815
|
-
/* @__PURE__ */ a(
|
|
815
|
+
/* @__PURE__ */ a(U, { dashed: !0 }),
|
|
816
816
|
/* @__PURE__ */ a(zn, { children: /* @__PURE__ */ m(
|
|
817
817
|
v,
|
|
818
818
|
{
|
|
@@ -841,7 +841,7 @@ const fr = C.div`
|
|
|
841
841
|
)
|
|
842
842
|
}
|
|
843
843
|
) }) }, u.conditionName)),
|
|
844
|
-
p.length > 0 && /* @__PURE__ */ a(
|
|
844
|
+
p.length > 0 && /* @__PURE__ */ a(U, { dashed: !0 }),
|
|
845
845
|
d && /* @__PURE__ */ a(O, { children: r && /* @__PURE__ */ a(
|
|
846
846
|
Se,
|
|
847
847
|
{
|
|
@@ -860,7 +860,7 @@ const fr = C.div`
|
|
|
860
860
|
/* @__PURE__ */ a(Q, { animated: !0, width: "85px" })
|
|
861
861
|
] }, "loading"),
|
|
862
862
|
/* @__PURE__ */ m(v, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
863
|
-
/* @__PURE__ */ a(
|
|
863
|
+
/* @__PURE__ */ a(U, { dashed: !0 }),
|
|
864
864
|
/* @__PURE__ */ a(Q, { animated: !0, width: "150px" })
|
|
865
865
|
] }),
|
|
866
866
|
/* @__PURE__ */ a(zn, { children: /* @__PURE__ */ a(
|
|
@@ -895,7 +895,7 @@ const fr = C.div`
|
|
|
895
895
|
labelName: r == null ? void 0 : r.terms,
|
|
896
896
|
value: String(n.effectiveFrom),
|
|
897
897
|
howToSetTheDecision: K.RANGE,
|
|
898
|
-
decisionDataType:
|
|
898
|
+
decisionDataType: z.DATE
|
|
899
899
|
},
|
|
900
900
|
valueData: He({
|
|
901
901
|
labelName: r == null ? void 0 : r.terms,
|
|
@@ -904,20 +904,20 @@ const fr = C.div`
|
|
|
904
904
|
to: String(n.validUntil)
|
|
905
905
|
},
|
|
906
906
|
howToSetTheDecision: K.RANGE,
|
|
907
|
-
decisionDataType:
|
|
907
|
+
decisionDataType: z.DATE
|
|
908
908
|
})
|
|
909
909
|
} : o && !i ? {
|
|
910
910
|
element: {
|
|
911
911
|
labelName: r == null ? void 0 : r.terms,
|
|
912
912
|
value: String(n.effectiveFrom),
|
|
913
913
|
howToSetTheDecision: K.EQUAL,
|
|
914
|
-
decisionDataType:
|
|
914
|
+
decisionDataType: z.DATE
|
|
915
915
|
},
|
|
916
916
|
valueData: He({
|
|
917
917
|
labelName: r == null ? void 0 : r.terms,
|
|
918
918
|
value: String(n.effectiveFrom),
|
|
919
919
|
howToSetTheDecision: K.EQUAL,
|
|
920
|
-
decisionDataType:
|
|
920
|
+
decisionDataType: z.DATE
|
|
921
921
|
})
|
|
922
922
|
} : null, d = n ? {
|
|
923
923
|
labelName: n.labelName || "",
|
|
@@ -979,7 +979,7 @@ const Ir = (e) => {
|
|
|
979
979
|
return /* @__PURE__ */ a(Ar, { children: /* @__PURE__ */ m(v, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
980
980
|
n,
|
|
981
981
|
t && /* @__PURE__ */ m(O, { children: [
|
|
982
|
-
/* @__PURE__ */ a(
|
|
982
|
+
/* @__PURE__ */ a(U, {}),
|
|
983
983
|
/* @__PURE__ */ a(v, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ a(
|
|
984
984
|
P,
|
|
985
985
|
{
|
|
@@ -994,7 +994,7 @@ const Ir = (e) => {
|
|
|
994
994
|
) })
|
|
995
995
|
] })
|
|
996
996
|
] }) });
|
|
997
|
-
},
|
|
997
|
+
}, Rr = (e) => {
|
|
998
998
|
const { decision: n, controls: t, handleOpenModal: r, handleDelete: o, textValues: i } = e;
|
|
999
999
|
return n ? /* @__PURE__ */ a(Ye, { children: /* @__PURE__ */ m(v, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
|
|
1000
1000
|
/* @__PURE__ */ a(k, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: n.decisionId }),
|
|
@@ -1015,7 +1015,7 @@ const Ir = (e) => {
|
|
|
1015
1015
|
}
|
|
1016
1016
|
)
|
|
1017
1017
|
] }) }, n.decisionId) : null;
|
|
1018
|
-
},
|
|
1018
|
+
}, Fr = (e) => {
|
|
1019
1019
|
const {
|
|
1020
1020
|
customTitleContentAddCard: n,
|
|
1021
1021
|
index: t,
|
|
@@ -1037,7 +1037,7 @@ const Ir = (e) => {
|
|
|
1037
1037
|
handleView: () => r ? r() : null,
|
|
1038
1038
|
controls: !1,
|
|
1039
1039
|
children: /* @__PURE__ */ m(v, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
1040
|
-
/* @__PURE__ */ a(P, { appearance: "gray", icon: /* @__PURE__ */ a(
|
|
1040
|
+
/* @__PURE__ */ a(P, { appearance: "gray", icon: /* @__PURE__ */ a(qe, {}), size: "35px" }),
|
|
1041
1041
|
/* @__PURE__ */ a(k, { appearance: "gray", type: "body", size: "large", children: i })
|
|
1042
1042
|
] })
|
|
1043
1043
|
}
|
|
@@ -1047,13 +1047,13 @@ const Ir = (e) => {
|
|
|
1047
1047
|
] }) }, `add-decision-${t}`);
|
|
1048
1048
|
}, Lr = {
|
|
1049
1049
|
loading: br,
|
|
1050
|
-
decision:
|
|
1051
|
-
add:
|
|
1050
|
+
decision: Rr,
|
|
1051
|
+
add: Fr
|
|
1052
1052
|
}, xn = (e) => {
|
|
1053
1053
|
const { type: n } = e, t = Lr[n];
|
|
1054
1054
|
return t ? t(e) : null;
|
|
1055
1055
|
}, Or = (e) => ({
|
|
1056
|
-
schema:
|
|
1056
|
+
schema: re().required("Requerido").test(
|
|
1057
1057
|
"non-empty",
|
|
1058
1058
|
"El valor no puede estar vacío",
|
|
1059
1059
|
(n) => n != null && n.trim() !== ""
|
|
@@ -1080,9 +1080,9 @@ const Ir = (e) => {
|
|
|
1080
1080
|
}), zr = (e) => {
|
|
1081
1081
|
const n = (e == null ? void 0 : e.from) ?? 0, t = (e == null ? void 0 : e.to) ?? 0;
|
|
1082
1082
|
return {
|
|
1083
|
-
schema:
|
|
1084
|
-
from:
|
|
1085
|
-
to:
|
|
1083
|
+
schema: Z({
|
|
1084
|
+
from: oe().required("El campo 'Rango desde' es requerido").max(t, "'Rango desde' no puede ser mayor que 'Rango hasta'").min(0, "'Rango desde' no puede ser menor que 0"),
|
|
1085
|
+
to: oe().min(0, "El campo 'Rango hasta' debe ser mayor o igual a 0").required("El campo 'Rango hasta' es requerido").test(
|
|
1086
1086
|
"is-greater",
|
|
1087
1087
|
"El campo 'Rango hasta' debe ser mayor que 'Rango desde'",
|
|
1088
1088
|
function(r) {
|
|
@@ -1093,11 +1093,11 @@ const Ir = (e) => {
|
|
|
1093
1093
|
}),
|
|
1094
1094
|
value: { from: n, to: t }
|
|
1095
1095
|
};
|
|
1096
|
-
}, gn = (e, n) => n ===
|
|
1097
|
-
schema:
|
|
1096
|
+
}, gn = (e, n) => n === z.PERCENTAGE ? {
|
|
1097
|
+
schema: oe().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"),
|
|
1098
1098
|
value: e
|
|
1099
1099
|
} : {
|
|
1100
|
-
schema:
|
|
1100
|
+
schema: re().required("Requerido"),
|
|
1101
1101
|
value: e
|
|
1102
1102
|
}, Vr = {
|
|
1103
1103
|
[N.LIST_OF_VALUES]: Pr,
|
|
@@ -1108,7 +1108,7 @@ const Ir = (e) => {
|
|
|
1108
1108
|
[N.EQUAL]: gn
|
|
1109
1109
|
}, Hr = (e) => Vr[e] || Or;
|
|
1110
1110
|
var In = /* @__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))(In || {});
|
|
1111
|
-
const Ze = (e) => e != null && (typeof e != "string" || e.trim() !== "") && (!Array.isArray(e) || e.length > 0),
|
|
1111
|
+
const Ze = (e) => e != null && (typeof e != "string" || e.trim() !== "") && (!Array.isArray(e) || e.length > 0), Ur = (e, n) => {
|
|
1112
1112
|
var d;
|
|
1113
1113
|
const t = Object.entries((e == null ? void 0 : e.conditionsThatEstablishesTheDecision) ?? {}).filter(([, l]) => Ze(l)).map(([l, p]) => ({ conditionName: l, value: p }));
|
|
1114
1114
|
let r = [];
|
|
@@ -1127,7 +1127,7 @@ const Ze = (e) => e != null && (typeof e != "string" || e.trim() !== "") && (!Ar
|
|
|
1127
1127
|
};
|
|
1128
1128
|
});
|
|
1129
1129
|
};
|
|
1130
|
-
function
|
|
1130
|
+
function jr({
|
|
1131
1131
|
decision: e,
|
|
1132
1132
|
onSubmitEvent: n,
|
|
1133
1133
|
textValues: t
|
|
@@ -1135,7 +1135,7 @@ function Ur({
|
|
|
1135
1135
|
var c, g;
|
|
1136
1136
|
const r = ((c = e.conditionGroups[0]) == null ? void 0 : c.conditionsThatEstablishesTheDecision) ?? [], o = r.reduce((h, f) => (Ze(f.value) && (h[f.conditionName] = f.value), h), {}), i = Object.keys(o).length > 0, s = {
|
|
1137
1137
|
ruleName: e.ruleName || "",
|
|
1138
|
-
decisionDataType: e.decisionDataType ||
|
|
1138
|
+
decisionDataType: e.decisionDataType || z.ALPHABETICAL,
|
|
1139
1139
|
howToSetTheDecision: e.howToSetTheDecision || "",
|
|
1140
1140
|
value: e.value ?? "",
|
|
1141
1141
|
effectiveFrom: e.effectiveFrom || "",
|
|
@@ -1151,14 +1151,14 @@ function Ur({
|
|
|
1151
1151
|
};
|
|
1152
1152
|
let d;
|
|
1153
1153
|
const l = {
|
|
1154
|
-
ruleName:
|
|
1155
|
-
value:
|
|
1154
|
+
ruleName: re().required("El nombre de la regla es requerido"),
|
|
1155
|
+
value: je(() => Hr(
|
|
1156
1156
|
d.values.howToSetTheDecision
|
|
1157
1157
|
)(
|
|
1158
1158
|
d.values.value,
|
|
1159
1159
|
d.values.decisionDataType
|
|
1160
1160
|
).schema),
|
|
1161
|
-
conditionsThatEstablishesTheDecision:
|
|
1161
|
+
conditionsThatEstablishesTheDecision: Z().shape({})
|
|
1162
1162
|
};
|
|
1163
1163
|
t.terms && (l.effectiveFrom = $e().required("La fecha de inicio es requerida"), l.validUntil = $e().when(
|
|
1164
1164
|
"checkClosed",
|
|
@@ -1171,14 +1171,14 @@ function Ur({
|
|
|
1171
1171
|
}
|
|
1172
1172
|
) : f.notRequired()
|
|
1173
1173
|
));
|
|
1174
|
-
const p =
|
|
1174
|
+
const p = Z(l);
|
|
1175
1175
|
return d = kn({
|
|
1176
1176
|
initialValues: s,
|
|
1177
1177
|
validationSchema: p,
|
|
1178
1178
|
validateOnBlur: !0,
|
|
1179
1179
|
onSubmit: (h) => {
|
|
1180
1180
|
var x;
|
|
1181
|
-
const f = ((x = e.conditionGroups) == null ? void 0 : x.ConditionGroupId) ?? "group-primary", w = h.toggleNone ? [] :
|
|
1181
|
+
const f = ((x = e.conditionGroups) == null ? void 0 : x.ConditionGroupId) ?? "group-primary", w = h.toggleNone ? [] : Ur(h, r), y = {
|
|
1182
1182
|
...e,
|
|
1183
1183
|
ruleName: h.ruleName,
|
|
1184
1184
|
decisionDataType: h.decisionDataType,
|
|
@@ -1210,7 +1210,7 @@ function Ur({
|
|
|
1210
1210
|
});
|
|
1211
1211
|
} };
|
|
1212
1212
|
}
|
|
1213
|
-
const
|
|
1213
|
+
const _r = C.div`
|
|
1214
1214
|
& > div {
|
|
1215
1215
|
border-radius: 8px;
|
|
1216
1216
|
border: 1px solid
|
|
@@ -1219,7 +1219,7 @@ const jr = C.div`
|
|
|
1219
1219
|
return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || S.palette.neutral.N30;
|
|
1220
1220
|
}};
|
|
1221
1221
|
}
|
|
1222
|
-
`,
|
|
1222
|
+
`, qr = C.div`
|
|
1223
1223
|
width: 100%;
|
|
1224
1224
|
height: 100%;
|
|
1225
1225
|
overflow-y: auto;
|
|
@@ -1236,7 +1236,7 @@ const jr = C.div`
|
|
|
1236
1236
|
background-color: #ebecf0;
|
|
1237
1237
|
border-radius: 8px;
|
|
1238
1238
|
}
|
|
1239
|
-
`,
|
|
1239
|
+
`, Br = (e) => {
|
|
1240
1240
|
const {
|
|
1241
1241
|
checked: n,
|
|
1242
1242
|
children: t,
|
|
@@ -1282,9 +1282,9 @@ const jr = C.div`
|
|
|
1282
1282
|
w($.checked), r && r($.checked);
|
|
1283
1283
|
}, E = ($) => {
|
|
1284
1284
|
x($.target.value), n($);
|
|
1285
|
-
},
|
|
1285
|
+
}, R = ($) => {
|
|
1286
1286
|
D($.target.value), t($);
|
|
1287
|
-
},
|
|
1287
|
+
}, F = J("(max-width: 400px)");
|
|
1288
1288
|
return /* @__PURE__ */ m(O, { children: [
|
|
1289
1289
|
/* @__PURE__ */ m(v, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
1290
1290
|
/* @__PURE__ */ a(
|
|
@@ -1320,7 +1320,7 @@ const jr = C.div`
|
|
|
1320
1320
|
/* @__PURE__ */ m(
|
|
1321
1321
|
v,
|
|
1322
1322
|
{
|
|
1323
|
-
direction:
|
|
1323
|
+
direction: F ? "column" : "row",
|
|
1324
1324
|
justifyContent: "space-between",
|
|
1325
1325
|
gap: "24px",
|
|
1326
1326
|
children: [
|
|
@@ -1342,7 +1342,7 @@ const jr = C.div`
|
|
|
1342
1342
|
{
|
|
1343
1343
|
id: "dateEnd",
|
|
1344
1344
|
label: i,
|
|
1345
|
-
onChange:
|
|
1345
|
+
onChange: R,
|
|
1346
1346
|
value: T,
|
|
1347
1347
|
required: d,
|
|
1348
1348
|
size: "compact",
|
|
@@ -1373,8 +1373,8 @@ const jr = C.div`
|
|
|
1373
1373
|
formik: n,
|
|
1374
1374
|
isDecision: !0
|
|
1375
1375
|
}),
|
|
1376
|
-
/* @__PURE__ */ a(
|
|
1377
|
-
/* @__PURE__ */ a(
|
|
1376
|
+
/* @__PURE__ */ a(U, { dashed: !0 }),
|
|
1377
|
+
/* @__PURE__ */ a(_r, { children: /* @__PURE__ */ a(qr, { children: /* @__PURE__ */ m(
|
|
1378
1378
|
v,
|
|
1379
1379
|
{
|
|
1380
1380
|
direction: "column",
|
|
@@ -1406,7 +1406,7 @@ const jr = C.div`
|
|
|
1406
1406
|
/* @__PURE__ */ a(v, { direction: "column", gap: "20px", children: o == null ? void 0 : o.map((c) => {
|
|
1407
1407
|
var g;
|
|
1408
1408
|
return /* @__PURE__ */ a(
|
|
1409
|
-
|
|
1409
|
+
Br,
|
|
1410
1410
|
{
|
|
1411
1411
|
id: `toggle-${c.conditionName}`,
|
|
1412
1412
|
name: `toggle.${c.conditionName}`,
|
|
@@ -1425,7 +1425,7 @@ const jr = C.div`
|
|
|
1425
1425
|
}
|
|
1426
1426
|
) }) }),
|
|
1427
1427
|
t.terms && /* @__PURE__ */ m(O, { children: [
|
|
1428
|
-
/* @__PURE__ */ a(
|
|
1428
|
+
/* @__PURE__ */ a(U, { dashed: !0 }),
|
|
1429
1429
|
/* @__PURE__ */ a(
|
|
1430
1430
|
Gr,
|
|
1431
1431
|
{
|
|
@@ -1446,7 +1446,7 @@ const jr = C.div`
|
|
|
1446
1446
|
}
|
|
1447
1447
|
)
|
|
1448
1448
|
] }),
|
|
1449
|
-
/* @__PURE__ */ a(
|
|
1449
|
+
/* @__PURE__ */ a(U, {}),
|
|
1450
1450
|
l && /* @__PURE__ */ a(k, { type: "label", size: "medium", appearance: "danger", children: typeof n.errors.conditionsThatEstablishesTheDecision == "string" ? n.errors.conditionsThatEstablishesTheDecision : "Existen errores en el formulario, por favor revísalos." }),
|
|
1451
1451
|
/* @__PURE__ */ m(v, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
1452
1452
|
/* @__PURE__ */ a(H, { appearance: "gray", onClick: r, children: t.cancel }),
|
|
@@ -1455,7 +1455,7 @@ const jr = C.div`
|
|
|
1455
1455
|
] }) });
|
|
1456
1456
|
}, Wr = (e) => {
|
|
1457
1457
|
var h, f;
|
|
1458
|
-
const { decision: n, onSubmitEvent: t, textValues: r, onCancel: o } = e, { formik: i, handleToggleNoneChange: s } =
|
|
1458
|
+
const { decision: n, onSubmitEvent: t, textValues: r, onCancel: o } = e, { formik: i, handleToggleNoneChange: s } = jr({
|
|
1459
1459
|
decision: n,
|
|
1460
1460
|
onSubmitEvent: t,
|
|
1461
1461
|
textValues: r
|
|
@@ -1550,7 +1550,7 @@ const jr = C.div`
|
|
|
1550
1550
|
handleSubmitForm: g,
|
|
1551
1551
|
handleDelete: h,
|
|
1552
1552
|
terms: f = !0
|
|
1553
|
-
} = e, w =
|
|
1553
|
+
} = e, w = J("(max-width: 681px)"), y = J("(max-width: 400px)"), { renderedCards: x, shouldRenderAddCard: T } = Xr({
|
|
1554
1554
|
controls: n,
|
|
1555
1555
|
customTitleContentAddCard: t,
|
|
1556
1556
|
decisions: o,
|
|
@@ -1592,7 +1592,7 @@ const jr = C.div`
|
|
|
1592
1592
|
/* @__PURE__ */ a(
|
|
1593
1593
|
H,
|
|
1594
1594
|
{
|
|
1595
|
-
iconBefore: /* @__PURE__ */ a(
|
|
1595
|
+
iconBefore: /* @__PURE__ */ a(qe, {}),
|
|
1596
1596
|
onClick: () => u ? u() : null,
|
|
1597
1597
|
children: t || "Agregar decisión"
|
|
1598
1598
|
}
|
|
@@ -1600,7 +1600,7 @@ const jr = C.div`
|
|
|
1600
1600
|
]
|
|
1601
1601
|
}
|
|
1602
1602
|
) : /* @__PURE__ */ m(
|
|
1603
|
-
|
|
1603
|
+
Be,
|
|
1604
1604
|
{
|
|
1605
1605
|
templateColumns: y ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
|
|
1606
1606
|
autoFlow: "row dense",
|
|
@@ -1650,7 +1650,7 @@ const jr = C.div`
|
|
|
1650
1650
|
] });
|
|
1651
1651
|
}, at = (e) => {
|
|
1652
1652
|
const { children: n } = e;
|
|
1653
|
-
return /* @__PURE__ */ a(
|
|
1653
|
+
return /* @__PURE__ */ a(Ft, { width: "100%", children: n });
|
|
1654
1654
|
}, Qr = (e) => e.value, Kr = (e) => e.value, Zr = (e) => e.value, Jr = (e) => ({
|
|
1655
1655
|
from: e.from ?? "",
|
|
1656
1656
|
to: e.to ?? ""
|
|
@@ -1661,7 +1661,7 @@ const jr = C.div`
|
|
|
1661
1661
|
[N.GREATER_THAN]: eo,
|
|
1662
1662
|
[N.LESS_THAN]: no,
|
|
1663
1663
|
[N.EQUAL]: to
|
|
1664
|
-
},
|
|
1664
|
+
}, Ue = (e) => {
|
|
1665
1665
|
const n = e == null ? void 0 : e.value;
|
|
1666
1666
|
if (typeof n == "string" && n.includes(" a ")) {
|
|
1667
1667
|
const t = [
|
|
@@ -1673,11 +1673,7 @@ const jr = C.div`
|
|
|
1673
1673
|
const o = n.match(r);
|
|
1674
1674
|
if (o) {
|
|
1675
1675
|
const i = o[1], s = o[2];
|
|
1676
|
-
return
|
|
1677
|
-
from: i,
|
|
1678
|
-
to: s,
|
|
1679
|
-
original: n
|
|
1680
|
-
}), { from: i, to: s };
|
|
1676
|
+
return { from: i, to: s };
|
|
1681
1677
|
}
|
|
1682
1678
|
}
|
|
1683
1679
|
return n;
|
|
@@ -1706,7 +1702,7 @@ const jr = C.div`
|
|
|
1706
1702
|
border-radius: ${({ $borderRadius: e }) => e};
|
|
1707
1703
|
box-sizing: ${({ $boxSizing: e }) => e};
|
|
1708
1704
|
overflow-y: ${({ $scroll: e }) => e ? "scroll" : "none"};
|
|
1709
|
-
`,
|
|
1705
|
+
`, ne = j.forwardRef(
|
|
1710
1706
|
(e, n) => {
|
|
1711
1707
|
const {
|
|
1712
1708
|
children: t,
|
|
@@ -1750,7 +1746,7 @@ const jr = C.div`
|
|
|
1750
1746
|
);
|
|
1751
1747
|
}
|
|
1752
1748
|
);
|
|
1753
|
-
|
|
1749
|
+
ne.displayName = "BorderStack";
|
|
1754
1750
|
C.div`
|
|
1755
1751
|
& > div {
|
|
1756
1752
|
border-radius: 8px;
|
|
@@ -1831,7 +1827,7 @@ const ao = C.div`
|
|
|
1831
1827
|
Xe,
|
|
1832
1828
|
{
|
|
1833
1829
|
element: o,
|
|
1834
|
-
valueData:
|
|
1830
|
+
valueData: Ue(
|
|
1835
1831
|
o
|
|
1836
1832
|
),
|
|
1837
1833
|
type: "decision"
|
|
@@ -1880,7 +1876,7 @@ const ao = C.div`
|
|
|
1880
1876
|
r.ruleName
|
|
1881
1877
|
) }),
|
|
1882
1878
|
p && /* @__PURE__ */ m(O, { children: [
|
|
1883
|
-
/* @__PURE__ */ a(
|
|
1879
|
+
/* @__PURE__ */ a(U, { dashed: !0 }),
|
|
1884
1880
|
/* @__PURE__ */ m(v, { direction: "column", gap: "12px", children: [
|
|
1885
1881
|
/* @__PURE__ */ a(
|
|
1886
1882
|
k,
|
|
@@ -1902,7 +1898,7 @@ const ao = C.div`
|
|
|
1902
1898
|
justifyContent: t,
|
|
1903
1899
|
children: [
|
|
1904
1900
|
d.map((x) => /* @__PURE__ */ a(
|
|
1905
|
-
|
|
1901
|
+
ne,
|
|
1906
1902
|
{
|
|
1907
1903
|
direction: "column",
|
|
1908
1904
|
padding: "6px 12px",
|
|
@@ -1912,7 +1908,7 @@ const ao = C.div`
|
|
|
1912
1908
|
Xe,
|
|
1913
1909
|
{
|
|
1914
1910
|
element: { ...x, value: x.value },
|
|
1915
|
-
valueData:
|
|
1911
|
+
valueData: Ue(
|
|
1916
1912
|
x
|
|
1917
1913
|
)
|
|
1918
1914
|
}
|
|
@@ -1921,7 +1917,7 @@ const ao = C.div`
|
|
|
1921
1917
|
x.conditionName
|
|
1922
1918
|
)),
|
|
1923
1919
|
c && h && /* @__PURE__ */ a(
|
|
1924
|
-
|
|
1920
|
+
ne,
|
|
1925
1921
|
{
|
|
1926
1922
|
direction: "column",
|
|
1927
1923
|
padding: "6px 12px",
|
|
@@ -1938,7 +1934,7 @@ const ao = C.div`
|
|
|
1938
1934
|
}
|
|
1939
1935
|
),
|
|
1940
1936
|
g && f && /* @__PURE__ */ a(
|
|
1941
|
-
|
|
1937
|
+
ne,
|
|
1942
1938
|
{
|
|
1943
1939
|
direction: "column",
|
|
1944
1940
|
padding: "6px 12px",
|
|
@@ -1987,33 +1983,33 @@ const ao = C.div`
|
|
|
1987
1983
|
labelName: r == null ? void 0 : r.effectiveFrom,
|
|
1988
1984
|
value: String(n.effectiveFrom),
|
|
1989
1985
|
howToSetTheDecision: K.EQUAL,
|
|
1990
|
-
decisionDataType:
|
|
1986
|
+
decisionDataType: z.DATE
|
|
1991
1987
|
},
|
|
1992
|
-
valueData:
|
|
1988
|
+
valueData: Ue({
|
|
1993
1989
|
labelName: r == null ? void 0 : r.effectiveFrom,
|
|
1994
1990
|
value: String(n.effectiveFrom),
|
|
1995
1991
|
howToSetTheDecision: K.EQUAL,
|
|
1996
|
-
decisionDataType:
|
|
1992
|
+
decisionDataType: z.DATE
|
|
1997
1993
|
})
|
|
1998
1994
|
} : null, h = c ? {
|
|
1999
1995
|
element: {
|
|
2000
1996
|
labelName: r == null ? void 0 : r.validUntil,
|
|
2001
|
-
value:
|
|
1997
|
+
value: n.validUntil instanceof Date ? n.validUntil.toISOString() : n.validUntil,
|
|
2002
1998
|
howToSetTheDecision: K.EQUAL,
|
|
2003
|
-
decisionDataType:
|
|
1999
|
+
decisionDataType: z.DATE
|
|
2004
2000
|
},
|
|
2005
|
-
valueData:
|
|
2001
|
+
valueData: Ue({
|
|
2006
2002
|
labelName: r == null ? void 0 : r.validUntil,
|
|
2007
|
-
value:
|
|
2003
|
+
value: n.validUntil instanceof Date ? n.validUntil.toISOString() : n.validUntil,
|
|
2008
2004
|
howToSetTheDecision: K.EQUAL,
|
|
2009
|
-
decisionDataType:
|
|
2005
|
+
decisionDataType: z.DATE
|
|
2010
2006
|
})
|
|
2011
2007
|
} : null, f = n ? {
|
|
2012
2008
|
labelName: n.labelName || "",
|
|
2013
|
-
decisionDataType: n.decisionDataType ||
|
|
2014
|
-
value:
|
|
2009
|
+
decisionDataType: n.decisionDataType || z.ALPHABETICAL,
|
|
2010
|
+
value: Ue(n),
|
|
2015
2011
|
howToSetTheDecision: n.howToSetTheDecision || K.EQUAL
|
|
2016
|
-
} : null, w = n ? en(n) : {}, y = it(w, (
|
|
2012
|
+
} : null, w = n ? en(n) : {}, y = it(w, (R) => !R.hidden), x = Object.values(y).flat(), T = Array.from({ length: 5 }), D = !!(!t && n && r && f), I = x.length < 2 ? "start" : "space-between", E = `N° ${String((o ?? 0) + 1).padStart(2, "0")}`;
|
|
2017
2013
|
return /* @__PURE__ */ a(
|
|
2018
2014
|
so,
|
|
2019
2015
|
{
|
|
@@ -2168,7 +2164,7 @@ const uo = C.div`
|
|
|
2168
2164
|
{
|
|
2169
2165
|
onClick: () => r ? r() : null,
|
|
2170
2166
|
children: /* @__PURE__ */ a(
|
|
2171
|
-
|
|
2167
|
+
ne,
|
|
2172
2168
|
{
|
|
2173
2169
|
direction: "column",
|
|
2174
2170
|
gap: "4px",
|
|
@@ -2188,7 +2184,7 @@ const uo = C.div`
|
|
|
2188
2184
|
P,
|
|
2189
2185
|
{
|
|
2190
2186
|
appearance: "gray",
|
|
2191
|
-
icon: /* @__PURE__ */ a(
|
|
2187
|
+
icon: /* @__PURE__ */ a(qe, {}),
|
|
2192
2188
|
size: "24px",
|
|
2193
2189
|
cursorHover: !0
|
|
2194
2190
|
}
|
|
@@ -2289,7 +2285,7 @@ const uo = C.div`
|
|
|
2289
2285
|
throw new Error(
|
|
2290
2286
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
2291
2287
|
);
|
|
2292
|
-
const d =
|
|
2288
|
+
const d = J("(max-width: 400px)");
|
|
2293
2289
|
return sn(
|
|
2294
2290
|
/* @__PURE__ */ a(xo, { smallScreen: d, children: /* @__PURE__ */ a(an, { children: /* @__PURE__ */ a(wo, { children: /* @__PURE__ */ m(v, { direction: "column", gap: "24px", children: [
|
|
2295
2291
|
/* @__PURE__ */ m(v, { direction: "column", gap: "24px", children: [
|
|
@@ -2309,14 +2305,14 @@ const uo = C.div`
|
|
|
2309
2305
|
] }),
|
|
2310
2306
|
/* @__PURE__ */ a(on, { size: "24px", cursor: "pointer", onClick: o })
|
|
2311
2307
|
] }),
|
|
2312
|
-
/* @__PURE__ */ a(
|
|
2308
|
+
/* @__PURE__ */ a(U, { dashed: !0 })
|
|
2313
2309
|
] }),
|
|
2314
2310
|
n
|
|
2315
2311
|
] }) }) }) }),
|
|
2316
2312
|
s
|
|
2317
2313
|
);
|
|
2318
2314
|
}, Co = (e) => ({
|
|
2319
|
-
schema:
|
|
2315
|
+
schema: re().required("Requerido").test(
|
|
2320
2316
|
"non-empty",
|
|
2321
2317
|
"El valor no puede estar vacío",
|
|
2322
2318
|
(n) => n != null && n.trim() !== ""
|
|
@@ -2343,9 +2339,9 @@ const uo = C.div`
|
|
|
2343
2339
|
}), Eo = (e) => {
|
|
2344
2340
|
const n = (e == null ? void 0 : e.from) ?? 0, t = (e == null ? void 0 : e.to) ?? 0;
|
|
2345
2341
|
return {
|
|
2346
|
-
schema:
|
|
2347
|
-
from:
|
|
2348
|
-
to:
|
|
2342
|
+
schema: Z({
|
|
2343
|
+
from: oe().required("El campo de tipo rango es requerido").max(t, "El rango desde no puede ser mayor al rango hasta").min(0, "El rango desde no puede ser menor a 0"),
|
|
2344
|
+
to: oe().min(0, "El rengo hasta debe ser mayor o igual a 0").required("El rango hasta es requerido").test(
|
|
2349
2345
|
"is-greater",
|
|
2350
2346
|
"El rengo hasta debe ser mayor a el rango desde",
|
|
2351
2347
|
function(r) {
|
|
@@ -2356,12 +2352,30 @@ const uo = C.div`
|
|
|
2356
2352
|
}),
|
|
2357
2353
|
value: { from: n, to: t }
|
|
2358
2354
|
};
|
|
2359
|
-
}, hn = (e, n) =>
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2355
|
+
}, hn = (e, n) => {
|
|
2356
|
+
if (typeof e == "object" && e !== null && "from" in e && "to" in e) {
|
|
2357
|
+
const t = e;
|
|
2358
|
+
return n === z.PERCENTAGE ? {
|
|
2359
|
+
schema: Z({
|
|
2360
|
+
from: oe().required("El campo desde es requerido").min(0, "El porcentaje no puede ser menor a 0").max(100, "El porcentaje no puede ser mayor a 100"),
|
|
2361
|
+
to: oe().required("El campo hasta es requerido").min(0, "El porcentaje no puede ser menor a 0").max(100, "El porcentaje no puede ser mayor a 100")
|
|
2362
|
+
}),
|
|
2363
|
+
value: t
|
|
2364
|
+
} : {
|
|
2365
|
+
schema: Z({
|
|
2366
|
+
from: re().required("Requerido"),
|
|
2367
|
+
to: re().required("Requerido")
|
|
2368
|
+
}),
|
|
2369
|
+
value: t
|
|
2370
|
+
};
|
|
2371
|
+
}
|
|
2372
|
+
return n === z.PERCENTAGE ? {
|
|
2373
|
+
schema: oe().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"),
|
|
2374
|
+
value: e
|
|
2375
|
+
} : {
|
|
2376
|
+
schema: re().required("Requerido"),
|
|
2377
|
+
value: e
|
|
2378
|
+
};
|
|
2365
2379
|
}, No = {
|
|
2366
2380
|
[N.LIST_OF_VALUES]: Do,
|
|
2367
2381
|
[N.LIST_OF_VALUES_MULTI]: So,
|
|
@@ -2378,7 +2392,7 @@ function ko({
|
|
|
2378
2392
|
}) {
|
|
2379
2393
|
const r = en(e) || {}, o = () => Object.values(r).flat(), i = {
|
|
2380
2394
|
ruleName: e.ruleName || "",
|
|
2381
|
-
decisionDataType: e.decisionDataType ||
|
|
2395
|
+
decisionDataType: e.decisionDataType || z.ALPHABETICAL,
|
|
2382
2396
|
howToSetTheDecision: e.howToSetTheDecision || "",
|
|
2383
2397
|
value: e.value || "",
|
|
2384
2398
|
effectiveFrom: e.effectiveFrom || "",
|
|
@@ -2391,15 +2405,15 @@ function ko({
|
|
|
2391
2405
|
};
|
|
2392
2406
|
let s;
|
|
2393
2407
|
const d = {
|
|
2394
|
-
ruleName:
|
|
2395
|
-
value:
|
|
2408
|
+
ruleName: re().required("El nombre de la decision es requerido"),
|
|
2409
|
+
value: je(() => Vn(
|
|
2396
2410
|
s.values.howToSetTheDecision
|
|
2397
2411
|
)(
|
|
2398
2412
|
s.values.value,
|
|
2399
2413
|
s.values.decisionDataType
|
|
2400
2414
|
).schema),
|
|
2401
|
-
conditionsThatEstablishesTheDecision:
|
|
2402
|
-
if ((c == null ? void 0 : c.toggleNone) && Object.keys(c.conditionsThatEstablishesTheDecision || {}).length > 0) return
|
|
2415
|
+
conditionsThatEstablishesTheDecision: je((u, { parent: c }) => {
|
|
2416
|
+
if ((c == null ? void 0 : c.toggleNone) && Object.keys(c.conditionsThatEstablishesTheDecision || {}).length > 0) return Z().shape({});
|
|
2403
2417
|
const f = o().reduce(
|
|
2404
2418
|
(w, y) => {
|
|
2405
2419
|
var T;
|
|
@@ -2416,7 +2430,7 @@ function ko({
|
|
|
2416
2430
|
},
|
|
2417
2431
|
{}
|
|
2418
2432
|
);
|
|
2419
|
-
return
|
|
2433
|
+
return Z(f).test(
|
|
2420
2434
|
"at-least-one-condition",
|
|
2421
2435
|
"Debe existir al menos una condición para que la decisión se valide correctamente.",
|
|
2422
2436
|
(w) => w ? Object.values(w).some(
|
|
@@ -2438,7 +2452,7 @@ function ko({
|
|
|
2438
2452
|
}
|
|
2439
2453
|
) : c.notRequired()
|
|
2440
2454
|
));
|
|
2441
|
-
const l =
|
|
2455
|
+
const l = Z(d);
|
|
2442
2456
|
return s = kn({
|
|
2443
2457
|
initialValues: i,
|
|
2444
2458
|
validationSchema: l,
|
|
@@ -2544,9 +2558,9 @@ const $o = C.div`
|
|
|
2544
2558
|
w($.checked), r && r($.checked);
|
|
2545
2559
|
}, E = ($) => {
|
|
2546
2560
|
x($.target.value), n($);
|
|
2547
|
-
},
|
|
2561
|
+
}, R = ($) => {
|
|
2548
2562
|
D($.target.value), t($);
|
|
2549
|
-
},
|
|
2563
|
+
}, F = J("(max-width: 400px)");
|
|
2550
2564
|
return /* @__PURE__ */ m(v, { direction: "column", width: "100%", gap: "20px", children: [
|
|
2551
2565
|
/* @__PURE__ */ m(v, { justifyContent: "space-between", children: [
|
|
2552
2566
|
/* @__PURE__ */ a(k, { appearance: "dark", size: "large", type: "label", children: "¿La vigencia para este decisión es cerrada?" }),
|
|
@@ -2563,7 +2577,7 @@ const $o = C.div`
|
|
|
2563
2577
|
/* @__PURE__ */ m(
|
|
2564
2578
|
v,
|
|
2565
2579
|
{
|
|
2566
|
-
direction:
|
|
2580
|
+
direction: F ? "column" : "row",
|
|
2567
2581
|
justifyContent: "space-between",
|
|
2568
2582
|
gap: "24px",
|
|
2569
2583
|
children: [
|
|
@@ -2586,7 +2600,7 @@ const $o = C.div`
|
|
|
2586
2600
|
{
|
|
2587
2601
|
id: "dateEnd",
|
|
2588
2602
|
label: i,
|
|
2589
|
-
onChange:
|
|
2603
|
+
onChange: R,
|
|
2590
2604
|
value: T,
|
|
2591
2605
|
required: d,
|
|
2592
2606
|
size: "compact",
|
|
@@ -2737,7 +2751,7 @@ const $o = C.div`
|
|
|
2737
2751
|
}
|
|
2738
2752
|
)
|
|
2739
2753
|
] });
|
|
2740
|
-
}, Hn = (e, n) => e === "group-primary" ? "Condición principal" : `Condición alterna N° ${String(n).padStart(2, "0")}`,
|
|
2754
|
+
}, Hn = (e, n) => e === "group-primary" ? "Condición principal" : `Condición alterna N° ${String(n).padStart(2, "0")}`, Ro = (e) => {
|
|
2741
2755
|
var We;
|
|
2742
2756
|
const {
|
|
2743
2757
|
decision: n,
|
|
@@ -2760,42 +2774,42 @@ const $o = C.div`
|
|
|
2760
2774
|
], y = {};
|
|
2761
2775
|
let x = 1;
|
|
2762
2776
|
const T = w.map((A) => {
|
|
2763
|
-
const
|
|
2764
|
-
return y[
|
|
2765
|
-
id:
|
|
2766
|
-
label: A === "group-primary" ? Hn(A, 0) : Hn(A, Number(
|
|
2777
|
+
const q = A === "group-primary" ? "mainCondition" : `alternateCondition-${x++}`;
|
|
2778
|
+
return y[q] = A, {
|
|
2779
|
+
id: q,
|
|
2780
|
+
label: A === "group-primary" ? Hn(A, 0) : Hn(A, Number(q.split("-").at(-1))),
|
|
2767
2781
|
isDisabled: !1
|
|
2768
2782
|
};
|
|
2769
|
-
}), [D, I] =
|
|
2783
|
+
}), [D, I] = j.useState(
|
|
2770
2784
|
((We = T[0]) == null ? void 0 : We.id) ?? "mainCondition"
|
|
2771
|
-
), E = (A) => I(A),
|
|
2785
|
+
), E = (A) => I(A), R = y[D] ?? "group-primary", F = h[R] ?? [], $ = h["group-primary"] ?? [], _ = {
|
|
2772
2786
|
decisionDataType: n.decisionDataType,
|
|
2773
2787
|
howToSetTheCondition: n.howToSetTheDecision,
|
|
2774
2788
|
labelName: n.labelName,
|
|
2775
2789
|
listOfPossibleValues: n.listOfPossibleValues,
|
|
2776
2790
|
ruleName: n.ruleName
|
|
2777
|
-
}, se = l.submitCount > 0 || !!l.touched.effectiveFrom, Te = l.submitCount > 0 || !!l.touched.validUntil, Ce = se ? l.errors.effectiveFrom ? "invalid" : "valid" : void 0, he = Te ? l.errors.validUntil ? "invalid" : "valid" : void 0,
|
|
2791
|
+
}, se = l.submitCount > 0 || !!l.touched.effectiveFrom, Te = l.submitCount > 0 || !!l.touched.validUntil, Ce = se ? l.errors.effectiveFrom ? "invalid" : "valid" : void 0, he = Te ? l.errors.validUntil ? "invalid" : "valid" : void 0, ae = j.useMemo(() => {
|
|
2778
2792
|
const A = l.errors.conditionsThatEstablishesTheDecision;
|
|
2779
2793
|
if (!A) return;
|
|
2780
2794
|
if (typeof A == "string") return A;
|
|
2781
|
-
const
|
|
2782
|
-
if (
|
|
2783
|
-
if (typeof
|
|
2784
|
-
if (Array.isArray(
|
|
2785
|
-
for (const Pe of
|
|
2786
|
-
const be =
|
|
2795
|
+
const q = (te) => {
|
|
2796
|
+
if (te) {
|
|
2797
|
+
if (typeof te == "string") return te;
|
|
2798
|
+
if (Array.isArray(te))
|
|
2799
|
+
for (const Pe of te) {
|
|
2800
|
+
const be = q(Pe);
|
|
2787
2801
|
if (be) return be;
|
|
2788
2802
|
}
|
|
2789
|
-
else if (typeof
|
|
2790
|
-
for (const Pe of Object.values(
|
|
2791
|
-
const be =
|
|
2803
|
+
else if (typeof te == "object")
|
|
2804
|
+
for (const Pe of Object.values(te)) {
|
|
2805
|
+
const be = q(Pe);
|
|
2792
2806
|
if (be) return be;
|
|
2793
2807
|
}
|
|
2794
2808
|
}
|
|
2795
2809
|
};
|
|
2796
|
-
return
|
|
2797
|
-
}, [l.errors.conditionsThatEstablishesTheDecision]),
|
|
2798
|
-
const
|
|
2810
|
+
return q(A);
|
|
2811
|
+
}, [l.errors.conditionsThatEstablishesTheDecision]), Fe = l.submitCount > 0 && !!ae, De = (A) => A != null && A.isMulti || A != null && A.multiple || (A == null ? void 0 : A.valueUse) === "Among" ? [] : "", fe = (A) => {
|
|
2812
|
+
const te = Object.values(c).flat().find((be) => be.conditionName === A), Pe = De(te);
|
|
2799
2813
|
l.setFieldValue(
|
|
2800
2814
|
`conditionsThatEstablishesTheDecision.${A}`,
|
|
2801
2815
|
Pe
|
|
@@ -2805,27 +2819,27 @@ const $o = C.div`
|
|
|
2805
2819
|
!1
|
|
2806
2820
|
);
|
|
2807
2821
|
}, me = () => {
|
|
2808
|
-
|
|
2809
|
-
const
|
|
2810
|
-
l.setFieldValue(
|
|
2822
|
+
F.forEach((A) => {
|
|
2823
|
+
const q = `conditionsThatEstablishesTheDecision.${A.conditionName}`;
|
|
2824
|
+
l.setFieldValue(q, De(A)), l.setFieldTouched(q, !1, !1);
|
|
2811
2825
|
});
|
|
2812
|
-
}, [Le, de] =
|
|
2826
|
+
}, [Le, de] = j.useState(!1);
|
|
2813
2827
|
return /* @__PURE__ */ a(
|
|
2814
2828
|
Io,
|
|
2815
2829
|
{
|
|
2816
2830
|
activeTab: D,
|
|
2817
|
-
conditionsErrorText:
|
|
2818
|
-
currentConditions:
|
|
2831
|
+
conditionsErrorText: ae,
|
|
2832
|
+
currentConditions: F,
|
|
2819
2833
|
decision: n,
|
|
2820
2834
|
formik: l,
|
|
2821
|
-
normalizedDecision:
|
|
2835
|
+
normalizedDecision: _,
|
|
2822
2836
|
onCancel: o,
|
|
2823
2837
|
onRedefineCurrentTab: me,
|
|
2824
2838
|
onTabChange: E,
|
|
2825
2839
|
onClearCondition: (A) => {
|
|
2826
2840
|
fe(A), i == null || i(A);
|
|
2827
2841
|
},
|
|
2828
|
-
showConditionsError:
|
|
2842
|
+
showConditionsError: Fe,
|
|
2829
2843
|
tabs: T,
|
|
2830
2844
|
termEndStatus: he,
|
|
2831
2845
|
termStartStatus: Ce,
|
|
@@ -2839,8 +2853,8 @@ const $o = C.div`
|
|
|
2839
2853
|
onCloseRedefineConfirm: () => de(!1),
|
|
2840
2854
|
onConfirmRedefine: () => {
|
|
2841
2855
|
me();
|
|
2842
|
-
const A = (c[
|
|
2843
|
-
(
|
|
2856
|
+
const A = (c[R] ?? []).map(
|
|
2857
|
+
(q) => q.conditionName
|
|
2844
2858
|
);
|
|
2845
2859
|
s == null || s(A), de(!1);
|
|
2846
2860
|
}
|
|
@@ -2865,7 +2879,7 @@ const $o = C.div`
|
|
|
2865
2879
|
onRemoveCondition: w,
|
|
2866
2880
|
onRestoreConditions: y,
|
|
2867
2881
|
baseDecisionTemplate: x
|
|
2868
|
-
} = e, [T, D] = M(null), I =
|
|
2882
|
+
} = e, [T, D] = M(null), I = J("(max-width: 681px)"), { renderedCards: E, shouldRenderAddCard: R } = yo({
|
|
2869
2883
|
controls: n,
|
|
2870
2884
|
customTitleContentAddCard: t,
|
|
2871
2885
|
decisions: o,
|
|
@@ -2874,10 +2888,10 @@ const $o = C.div`
|
|
|
2874
2888
|
handleDelete: h,
|
|
2875
2889
|
textValues: i,
|
|
2876
2890
|
isOpenFor: ($) => T === $,
|
|
2877
|
-
toggleAt: ($) => D((
|
|
2878
|
-
}),
|
|
2891
|
+
toggleAt: ($) => D((_) => _ === $ ? null : $)
|
|
2892
|
+
}), F = (o == null ? void 0 : o.length) === 0 && !p;
|
|
2879
2893
|
return /* @__PURE__ */ m(O, { children: [
|
|
2880
|
-
/* @__PURE__ */ a(go, { children: /* @__PURE__ */ a(ho, { children: /* @__PURE__ */ a(v, { direction: "column", gap: "16px", padding: "6px", children:
|
|
2894
|
+
/* @__PURE__ */ a(go, { children: /* @__PURE__ */ a(ho, { children: /* @__PURE__ */ a(v, { direction: "column", gap: "16px", padding: "6px", children: F ? /* @__PURE__ */ a(ze, { legend: "Decisiones", children: /* @__PURE__ */ m(
|
|
2881
2895
|
v,
|
|
2882
2896
|
{
|
|
2883
2897
|
direction: "column",
|
|
@@ -2911,7 +2925,7 @@ const $o = C.div`
|
|
|
2911
2925
|
]
|
|
2912
2926
|
}
|
|
2913
2927
|
) }) : /* @__PURE__ */ m(
|
|
2914
|
-
|
|
2928
|
+
Be,
|
|
2915
2929
|
{
|
|
2916
2930
|
templateColumns: "1fr",
|
|
2917
2931
|
autoFlow: "row dense",
|
|
@@ -2924,7 +2938,7 @@ const $o = C.div`
|
|
|
2924
2938
|
height: I ? "auto" : "484px",
|
|
2925
2939
|
children: [
|
|
2926
2940
|
E,
|
|
2927
|
-
|
|
2941
|
+
R && wn({
|
|
2928
2942
|
type: "add",
|
|
2929
2943
|
index: o == null ? void 0 : o.length,
|
|
2930
2944
|
controls: n,
|
|
@@ -2934,7 +2948,7 @@ const $o = C.div`
|
|
|
2934
2948
|
handleOpenModal: u,
|
|
2935
2949
|
handleDelete: h,
|
|
2936
2950
|
textValues: i,
|
|
2937
|
-
shouldRenderEmptyMessage:
|
|
2951
|
+
shouldRenderEmptyMessage: F,
|
|
2938
2952
|
terms: f
|
|
2939
2953
|
})
|
|
2940
2954
|
]
|
|
@@ -2948,7 +2962,7 @@ const $o = C.div`
|
|
|
2948
2962
|
title: l ? "Editar Decisión" : "Configurar Decisión",
|
|
2949
2963
|
description: "Diligencia los campos para configurar tu decisión.",
|
|
2950
2964
|
children: /* @__PURE__ */ a(
|
|
2951
|
-
|
|
2965
|
+
Ro,
|
|
2952
2966
|
{
|
|
2953
2967
|
decision: l || s,
|
|
2954
2968
|
fullTemplate: x ?? s,
|
|
@@ -2963,7 +2977,7 @@ const $o = C.div`
|
|
|
2963
2977
|
}
|
|
2964
2978
|
)
|
|
2965
2979
|
] });
|
|
2966
|
-
},
|
|
2980
|
+
}, Fo = {
|
|
2967
2981
|
border: {
|
|
2968
2982
|
color: S.palette.neutral.N40
|
|
2969
2983
|
}
|
|
@@ -2972,7 +2986,7 @@ const $o = C.div`
|
|
|
2972
2986
|
border-style: solid;
|
|
2973
2987
|
border-color: ${({ theme: e }) => {
|
|
2974
2988
|
var n, t;
|
|
2975
|
-
return ((t = (n = e == null ? void 0 : e.box) == null ? void 0 : n.border) == null ? void 0 : t.color) ||
|
|
2989
|
+
return ((t = (n = e == null ? void 0 : e.box) == null ? void 0 : n.border) == null ? void 0 : t.color) || Fo.border.color;
|
|
2976
2990
|
}};
|
|
2977
2991
|
border-radius: ${({ $borderRadius: e }) => e};
|
|
2978
2992
|
margin: ${({ $margin: e }) => e};
|
|
@@ -3097,7 +3111,7 @@ const Mo = C.div`
|
|
|
3097
3111
|
return ((r = (t = (n = e == null ? void 0 : e.input) == null ? void 0 : n.background) == null ? void 0 : t.color) == null ? void 0 : r.regular) || Tn.background.color.regular;
|
|
3098
3112
|
}};
|
|
3099
3113
|
}
|
|
3100
|
-
`,
|
|
3114
|
+
`, Uo = (e) => {
|
|
3101
3115
|
var g, h, f, w, y, x;
|
|
3102
3116
|
const { id: n, label: t, leadingIcon: r, onClose: o } = e, [i, s] = M(!1), d = () => s(!0), l = () => s(!1), p = $n(Nn), u = ((f = (h = (g = p == null ? void 0 : p.input) == null ? void 0 : g.option) == null ? void 0 : h.appearance) == null ? void 0 : f.hover) ?? Tn.option.appearance.hover, c = ((x = (y = (w = p == null ? void 0 : p.input) == null ? void 0 : w.option) == null ? void 0 : y.appearance) == null ? void 0 : x.regular) ?? Tn.option.appearance.regular;
|
|
3103
3117
|
return /* @__PURE__ */ a(
|
|
@@ -3110,7 +3124,7 @@ const Mo = C.div`
|
|
|
3110
3124
|
T.stopPropagation();
|
|
3111
3125
|
},
|
|
3112
3126
|
children: /* @__PURE__ */ m(
|
|
3113
|
-
|
|
3127
|
+
Be,
|
|
3114
3128
|
{
|
|
3115
3129
|
alignItems: "center",
|
|
3116
3130
|
gap: "8px",
|
|
@@ -3165,13 +3179,13 @@ const Mo = C.div`
|
|
|
3165
3179
|
showOverflowIndicator: g,
|
|
3166
3180
|
measurementRef: h
|
|
3167
3181
|
} = Po(d, n), [f, w] = M(!1), y = (E) => {
|
|
3168
|
-
E.stopPropagation(), w((
|
|
3182
|
+
E.stopPropagation(), w((R) => !R);
|
|
3169
3183
|
};
|
|
3170
3184
|
xe(() => {
|
|
3171
|
-
const E = (
|
|
3172
|
-
var
|
|
3173
|
-
const
|
|
3174
|
-
!((
|
|
3185
|
+
const E = (R) => {
|
|
3186
|
+
var _, se;
|
|
3187
|
+
const F = R.target;
|
|
3188
|
+
!((_ = l.current) != null && _.contains(F)) && !((se = p.current) != null && se.contains(F)) && w(!1);
|
|
3175
3189
|
};
|
|
3176
3190
|
return f && window.addEventListener("mousedown", E), () => window.removeEventListener("mousedown", E);
|
|
3177
3191
|
}, [f]);
|
|
@@ -3181,8 +3195,8 @@ const Mo = C.div`
|
|
|
3181
3195
|
label: E.label,
|
|
3182
3196
|
icon: E.icon
|
|
3183
3197
|
})), I = (E) => {
|
|
3184
|
-
var
|
|
3185
|
-
(
|
|
3198
|
+
var R, F;
|
|
3199
|
+
(F = (R = c.find(($) => $.label === E)) == null ? void 0 : R.onClose) == null || F.call(R), w(!1);
|
|
3186
3200
|
};
|
|
3187
3201
|
return /* @__PURE__ */ m(Oo, { borderRadius: "8px", width: "100%", children: [
|
|
3188
3202
|
/* @__PURE__ */ a(zo, { ref: h, children: n.map((E) => /* @__PURE__ */ a("div", { "data-filter-tag": "true", children: /* @__PURE__ */ a(
|
|
@@ -3196,9 +3210,9 @@ const Mo = C.div`
|
|
|
3196
3210
|
onClose: E.onClose
|
|
3197
3211
|
}
|
|
3198
3212
|
) }, E.label)) }),
|
|
3199
|
-
/* @__PURE__ */ m(
|
|
3213
|
+
/* @__PURE__ */ m(Be, { gap: "12px", templateColumns: "1fr auto auto", width: "100%", children: [
|
|
3200
3214
|
/* @__PURE__ */ a(
|
|
3201
|
-
|
|
3215
|
+
ne,
|
|
3202
3216
|
{
|
|
3203
3217
|
ref: d,
|
|
3204
3218
|
background: !0,
|
|
@@ -3242,14 +3256,14 @@ const Mo = C.div`
|
|
|
3242
3256
|
options: D,
|
|
3243
3257
|
onOptionClick: I,
|
|
3244
3258
|
children: c.map((E) => /* @__PURE__ */ a(
|
|
3245
|
-
|
|
3259
|
+
Uo,
|
|
3246
3260
|
{
|
|
3247
3261
|
id: E.label,
|
|
3248
3262
|
label: E.label,
|
|
3249
3263
|
leadingIcon: E.icon,
|
|
3250
3264
|
onClose: () => {
|
|
3251
|
-
var
|
|
3252
|
-
(
|
|
3265
|
+
var R;
|
|
3266
|
+
(R = E.onClose) == null || R.call(E), w(!1);
|
|
3253
3267
|
}
|
|
3254
3268
|
},
|
|
3255
3269
|
E.label
|
|
@@ -3285,7 +3299,7 @@ const Mo = C.div`
|
|
|
3285
3299
|
)
|
|
3286
3300
|
] })
|
|
3287
3301
|
] });
|
|
3288
|
-
},
|
|
3302
|
+
}, jo = C.div`
|
|
3289
3303
|
display: flex;
|
|
3290
3304
|
flex-direction: column;
|
|
3291
3305
|
background-color: ${({ theme: e }) => {
|
|
@@ -3308,13 +3322,13 @@ const Mo = C.div`
|
|
|
3308
3322
|
onCloseModal: s,
|
|
3309
3323
|
portalId: d,
|
|
3310
3324
|
title: l
|
|
3311
|
-
} = e, p =
|
|
3325
|
+
} = e, p = J("(max-width: 768px)"), u = document.getElementById(d);
|
|
3312
3326
|
if (!u)
|
|
3313
3327
|
throw new Error(
|
|
3314
3328
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
3315
3329
|
);
|
|
3316
3330
|
return sn(
|
|
3317
|
-
/* @__PURE__ */ a(an, { children: /* @__PURE__ */ m(
|
|
3331
|
+
/* @__PURE__ */ a(an, { children: /* @__PURE__ */ m(jo, { $smallScreen: p, children: [
|
|
3318
3332
|
/* @__PURE__ */ m(v, { direction: "column", gap: "16px", children: [
|
|
3319
3333
|
/* @__PURE__ */ m(v, { alignContent: "center", justifyContent: "space-between", children: [
|
|
3320
3334
|
/* @__PURE__ */ a(k, { appearance: "dark", size: "small", type: "headline", children: l }),
|
|
@@ -3331,7 +3345,7 @@ const Mo = C.div`
|
|
|
3331
3345
|
)
|
|
3332
3346
|
] })
|
|
3333
3347
|
] }),
|
|
3334
|
-
/* @__PURE__ */ a(
|
|
3348
|
+
/* @__PURE__ */ a(U, {})
|
|
3335
3349
|
] }),
|
|
3336
3350
|
r,
|
|
3337
3351
|
/* @__PURE__ */ m(v, { gap: "20px", justifyContent: "flex-end", children: [
|
|
@@ -3362,13 +3376,13 @@ const Mo = C.div`
|
|
|
3362
3376
|
u
|
|
3363
3377
|
);
|
|
3364
3378
|
}, il = (e) => {
|
|
3365
|
-
const { appliedFilters: n, fields: t, onChange: r, noFiltersLabel: o } = e, i =
|
|
3379
|
+
const { appliedFilters: n, fields: t, onChange: r, noFiltersLabel: o } = e, i = J("(max-width: 768px)"), s = !n || n.length === 0;
|
|
3366
3380
|
return /* @__PURE__ */ m(v, { direction: "column", gap: "16px", children: [
|
|
3367
3381
|
i && /* @__PURE__ */ m(O, { children: [
|
|
3368
3382
|
/* @__PURE__ */ m(v, { gap: "6px", width: "100%", alignItems: "center", children: [
|
|
3369
3383
|
/* @__PURE__ */ a(P, { appearance: "gray", icon: /* @__PURE__ */ a(et, {}) }),
|
|
3370
3384
|
/* @__PURE__ */ a(
|
|
3371
|
-
|
|
3385
|
+
ne,
|
|
3372
3386
|
{
|
|
3373
3387
|
background: !0,
|
|
3374
3388
|
borderRadius: "8px",
|
|
@@ -3394,7 +3408,7 @@ const Mo = C.div`
|
|
|
3394
3408
|
}
|
|
3395
3409
|
)
|
|
3396
3410
|
] }),
|
|
3397
|
-
/* @__PURE__ */ a(
|
|
3411
|
+
/* @__PURE__ */ a(U, { dashed: !0 })
|
|
3398
3412
|
] }),
|
|
3399
3413
|
t.map((d) => /* @__PURE__ */ m(v, { gap: "6px", alignItems: "center", children: [
|
|
3400
3414
|
/* @__PURE__ */ a(v, { padding: "22px 0 0 0", children: /* @__PURE__ */ a(P, { appearance: "primary", icon: d.icon }) }),
|
|
@@ -3417,12 +3431,12 @@ const Mo = C.div`
|
|
|
3417
3431
|
)
|
|
3418
3432
|
] }, d.name))
|
|
3419
3433
|
] });
|
|
3420
|
-
},
|
|
3434
|
+
}, _o = (e) => {
|
|
3421
3435
|
const n = [];
|
|
3422
3436
|
return e.from !== void 0 && e.from !== null && n.push(`>${e.from}`), e.to !== void 0 && e.to !== null && n.push(`<${e.to}`), n.join(";");
|
|
3423
3437
|
}, ll = (e) => {
|
|
3424
3438
|
var s;
|
|
3425
|
-
const { decision: n, fallbackId: t, template: r } = e, o = (d) => typeof d == "object" && d !== null && "from" in d && "to" in d ?
|
|
3439
|
+
const { decision: n, fallbackId: t, template: r } = e, o = (d) => typeof d == "object" && d !== null && "from" in d && "to" in d ? _o(d) : d, i = ((s = n.conditionsThatEstablishesTheDecision) == null ? void 0 : s.map((d, l) => {
|
|
3426
3440
|
var c;
|
|
3427
3441
|
const p = d == null ? void 0 : d.value;
|
|
3428
3442
|
return p == null || typeof p == "string" && p.trim() === "" || Array.isArray(p) && p.length === 0 ? null : {
|
|
@@ -3485,14 +3499,14 @@ const Mo = C.div`
|
|
|
3485
3499
|
)
|
|
3486
3500
|
} : t;
|
|
3487
3501
|
});
|
|
3488
|
-
},
|
|
3489
|
-
schema:
|
|
3502
|
+
}, qo = (e) => ({
|
|
3503
|
+
schema: re().required("Requerido").test(
|
|
3490
3504
|
"non-empty",
|
|
3491
3505
|
"El valor no puede estar vacío",
|
|
3492
3506
|
(n) => n != null && n.trim() !== ""
|
|
3493
3507
|
),
|
|
3494
3508
|
value: e
|
|
3495
|
-
}),
|
|
3509
|
+
}), Bo = (e) => ({
|
|
3496
3510
|
schema: Ie().test(
|
|
3497
3511
|
"isArrayOrString",
|
|
3498
3512
|
"Debe ser un array de strings/numbers o un solo string",
|
|
@@ -3513,9 +3527,9 @@ const Mo = C.div`
|
|
|
3513
3527
|
}), Yo = (e) => {
|
|
3514
3528
|
const n = (e == null ? void 0 : e.from) ?? 0, t = (e == null ? void 0 : e.to) ?? 0;
|
|
3515
3529
|
return {
|
|
3516
|
-
schema:
|
|
3517
|
-
from:
|
|
3518
|
-
to:
|
|
3530
|
+
schema: Z({
|
|
3531
|
+
from: oe().required("El campo 'Rango desde' es requerido").max(t, "'Rango desde' no puede ser mayor que 'Rango hasta'").min(0, "'Rango desde' no puede ser menor que 0"),
|
|
3532
|
+
to: oe().min(0, "El campo 'Rango hasta' debe ser mayor o igual a 0").required("El campo 'Rango hasta' es requerido").test(
|
|
3519
3533
|
"is-greater",
|
|
3520
3534
|
"El campo 'Rango hasta' debe ser mayor que 'Rango desde'",
|
|
3521
3535
|
function(r) {
|
|
@@ -3526,20 +3540,20 @@ const Mo = C.div`
|
|
|
3526
3540
|
}),
|
|
3527
3541
|
value: { from: n, to: t }
|
|
3528
3542
|
};
|
|
3529
|
-
}, fn = (e, n) => n ===
|
|
3530
|
-
schema:
|
|
3543
|
+
}, fn = (e, n) => n === z.PERCENTAGE ? {
|
|
3544
|
+
schema: oe().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"),
|
|
3531
3545
|
value: e
|
|
3532
3546
|
} : {
|
|
3533
|
-
schema:
|
|
3547
|
+
schema: re().required("Requerido"),
|
|
3534
3548
|
value: e
|
|
3535
3549
|
}, Wo = {
|
|
3536
|
-
[N.LIST_OF_VALUES]:
|
|
3550
|
+
[N.LIST_OF_VALUES]: Bo,
|
|
3537
3551
|
[N.LIST_OF_VALUES_MULTI]: Go,
|
|
3538
3552
|
[N.RANGE]: Yo,
|
|
3539
3553
|
[N.GREATER_THAN]: fn,
|
|
3540
3554
|
[N.LESS_THAN]: fn,
|
|
3541
3555
|
[N.EQUAL]: fn
|
|
3542
|
-
},
|
|
3556
|
+
}, Un = (e) => Wo[e] || qo;
|
|
3543
3557
|
function Xo({
|
|
3544
3558
|
decision: e,
|
|
3545
3559
|
onSubmitEvent: n,
|
|
@@ -3547,7 +3561,7 @@ function Xo({
|
|
|
3547
3561
|
}) {
|
|
3548
3562
|
const r = {
|
|
3549
3563
|
ruleName: e.ruleName || "",
|
|
3550
|
-
decisionDataType: e.decisionDataType ||
|
|
3564
|
+
decisionDataType: e.decisionDataType || z.ALPHABETICAL,
|
|
3551
3565
|
howToSetTheDecision: e.howToSetTheDecision || "",
|
|
3552
3566
|
value: e.value || "",
|
|
3553
3567
|
effectiveFrom: e.effectiveFrom || "",
|
|
@@ -3559,8 +3573,8 @@ function Xo({
|
|
|
3559
3573
|
};
|
|
3560
3574
|
let o;
|
|
3561
3575
|
const i = {
|
|
3562
|
-
ruleName:
|
|
3563
|
-
value:
|
|
3576
|
+
ruleName: re().required("El nombre de la regla es requerido"),
|
|
3577
|
+
value: je(() => Un(
|
|
3564
3578
|
o.values.howToSetTheDecision
|
|
3565
3579
|
)(
|
|
3566
3580
|
o.values.value,
|
|
@@ -3603,13 +3617,13 @@ function Xo({
|
|
|
3603
3617
|
// },
|
|
3604
3618
|
// );
|
|
3605
3619
|
// }),
|
|
3606
|
-
conditionsThatEstablishesTheDecision:
|
|
3620
|
+
conditionsThatEstablishesTheDecision: je((l, { parent: p }) => {
|
|
3607
3621
|
var g;
|
|
3608
|
-
if ((p == null ? void 0 : p.toggleNone) && Object.keys(p.conditionsThatEstablishesTheDecision || {}).length > 0) return
|
|
3622
|
+
if ((p == null ? void 0 : p.toggleNone) && Object.keys(p.conditionsThatEstablishesTheDecision || {}).length > 0) return Z().shape({});
|
|
3609
3623
|
const c = ((g = e.conditionsThatEstablishesTheDecision) == null ? void 0 : g.reduce(
|
|
3610
3624
|
(h, f) => {
|
|
3611
3625
|
if (o.values.conditionsThatEstablishesTheDecision[f.conditionName] !== void 0) {
|
|
3612
|
-
const y =
|
|
3626
|
+
const y = Un(
|
|
3613
3627
|
f.howToSetTheCondition
|
|
3614
3628
|
);
|
|
3615
3629
|
h[f.conditionName] = y(
|
|
@@ -3621,7 +3635,7 @@ function Xo({
|
|
|
3621
3635
|
},
|
|
3622
3636
|
{}
|
|
3623
3637
|
)) ?? {};
|
|
3624
|
-
return
|
|
3638
|
+
return Z(c);
|
|
3625
3639
|
})
|
|
3626
3640
|
};
|
|
3627
3641
|
t.terms && (i.effectiveFrom = $e().required(
|
|
@@ -3637,7 +3651,7 @@ function Xo({
|
|
|
3637
3651
|
}
|
|
3638
3652
|
) : p.notRequired()
|
|
3639
3653
|
));
|
|
3640
|
-
const s =
|
|
3654
|
+
const s = Z(i);
|
|
3641
3655
|
return o = kn({
|
|
3642
3656
|
initialValues: r,
|
|
3643
3657
|
validationSchema: s,
|
|
@@ -3754,9 +3768,9 @@ const Qo = C.div`
|
|
|
3754
3768
|
w($.checked), r && r($.checked);
|
|
3755
3769
|
}, E = ($) => {
|
|
3756
3770
|
x($.target.value), n($);
|
|
3757
|
-
},
|
|
3771
|
+
}, R = ($) => {
|
|
3758
3772
|
D($.target.value), t($);
|
|
3759
|
-
},
|
|
3773
|
+
}, F = J("(max-width: 400px)");
|
|
3760
3774
|
return /* @__PURE__ */ m(O, { children: [
|
|
3761
3775
|
/* @__PURE__ */ m(v, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
3762
3776
|
/* @__PURE__ */ a(
|
|
@@ -3792,7 +3806,7 @@ const Qo = C.div`
|
|
|
3792
3806
|
/* @__PURE__ */ m(
|
|
3793
3807
|
v,
|
|
3794
3808
|
{
|
|
3795
|
-
direction:
|
|
3809
|
+
direction: F ? "column" : "row",
|
|
3796
3810
|
justifyContent: "space-between",
|
|
3797
3811
|
gap: "24px",
|
|
3798
3812
|
children: [
|
|
@@ -3814,7 +3828,7 @@ const Qo = C.div`
|
|
|
3814
3828
|
{
|
|
3815
3829
|
id: "dateEnd",
|
|
3816
3830
|
label: i,
|
|
3817
|
-
onChange:
|
|
3831
|
+
onChange: R,
|
|
3818
3832
|
value: T,
|
|
3819
3833
|
required: d,
|
|
3820
3834
|
size: "compact",
|
|
@@ -3845,7 +3859,7 @@ const Qo = C.div`
|
|
|
3845
3859
|
formik: n,
|
|
3846
3860
|
isDecision: !0
|
|
3847
3861
|
}),
|
|
3848
|
-
/* @__PURE__ */ a(
|
|
3862
|
+
/* @__PURE__ */ a(U, { dashed: !0 }),
|
|
3849
3863
|
/* @__PURE__ */ a(Qo, { children: /* @__PURE__ */ a(Ko, { children: /* @__PURE__ */ m(
|
|
3850
3864
|
v,
|
|
3851
3865
|
{
|
|
@@ -3894,7 +3908,7 @@ const Qo = C.div`
|
|
|
3894
3908
|
}
|
|
3895
3909
|
) }) }),
|
|
3896
3910
|
t.terms && /* @__PURE__ */ m(O, { children: [
|
|
3897
|
-
/* @__PURE__ */ a(
|
|
3911
|
+
/* @__PURE__ */ a(U, { dashed: !0 }),
|
|
3898
3912
|
/* @__PURE__ */ a(
|
|
3899
3913
|
Jo,
|
|
3900
3914
|
{
|
|
@@ -3915,7 +3929,7 @@ const Qo = C.div`
|
|
|
3915
3929
|
}
|
|
3916
3930
|
)
|
|
3917
3931
|
] }),
|
|
3918
|
-
/* @__PURE__ */ a(
|
|
3932
|
+
/* @__PURE__ */ a(U, {}),
|
|
3919
3933
|
l && /* @__PURE__ */ a(k, { type: "label", size: "medium", appearance: "danger", children: typeof n.errors.conditionsThatEstablishesTheDecision == "string" ? n.errors.conditionsThatEstablishesTheDecision : "Existen errores en el formulario, por favor revísalos." }),
|
|
3920
3934
|
/* @__PURE__ */ m(v, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
3921
3935
|
/* @__PURE__ */ a(H, { appearance: "gray", onClick: r, children: t.cancel }),
|
|
@@ -4038,7 +4052,7 @@ const Qo = C.div`
|
|
|
4038
4052
|
return ((o = (r = (t = e == null ? void 0 : e.menu) == null ? void 0 : t.item) == null ? void 0 : r.background) == null ? void 0 : o.hover) || ce.item.background.hover;
|
|
4039
4053
|
}};
|
|
4040
4054
|
}
|
|
4041
|
-
`,
|
|
4055
|
+
`, jn = C.div`
|
|
4042
4056
|
display: flex;
|
|
4043
4057
|
align-items: center;
|
|
4044
4058
|
gap: 12px;
|
|
@@ -4099,8 +4113,8 @@ const Qo = C.div`
|
|
|
4099
4113
|
f.preventDefault(), f.stopPropagation(), r();
|
|
4100
4114
|
}, u = (f) => {
|
|
4101
4115
|
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), f.stopPropagation(), r());
|
|
4102
|
-
}, c = n || d ? "primary" : "dark", g = n || d ? "bold" : "normal", h =
|
|
4103
|
-
return /* @__PURE__ */ a(ta, { $active: n, children: /* @__PURE__ */ m(
|
|
4116
|
+
}, c = n || d ? "primary" : "dark", g = n || d ? "bold" : "normal", h = j.useId();
|
|
4117
|
+
return /* @__PURE__ */ a(ta, { $active: n, children: /* @__PURE__ */ m(ne, { border: !0, borderRadius: "8px", width: "100%", children: [
|
|
4104
4118
|
/* @__PURE__ */ a(
|
|
4105
4119
|
ia,
|
|
4106
4120
|
{
|
|
@@ -4110,7 +4124,7 @@ const Qo = C.div`
|
|
|
4110
4124
|
onClick: p,
|
|
4111
4125
|
onKeyDown: u,
|
|
4112
4126
|
children: s ? /* @__PURE__ */ a(oa, { to: s, children: /* @__PURE__ */ m(
|
|
4113
|
-
|
|
4127
|
+
ne,
|
|
4114
4128
|
{
|
|
4115
4129
|
alignItems: "center",
|
|
4116
4130
|
borderRadius: "8px",
|
|
@@ -4123,10 +4137,10 @@ const Qo = C.div`
|
|
|
4123
4137
|
{
|
|
4124
4138
|
appearance: c,
|
|
4125
4139
|
cursorHover: !0,
|
|
4126
|
-
icon: n && t.length > 0 ? /* @__PURE__ */ a(vn, {}) : /* @__PURE__ */ a(
|
|
4140
|
+
icon: n && t.length > 0 ? /* @__PURE__ */ a(vn, {}) : /* @__PURE__ */ a(Fn, {})
|
|
4127
4141
|
}
|
|
4128
4142
|
),
|
|
4129
|
-
/* @__PURE__ */ a(
|
|
4143
|
+
/* @__PURE__ */ a(jn, { children: /* @__PURE__ */ a(
|
|
4130
4144
|
k,
|
|
4131
4145
|
{
|
|
4132
4146
|
appearance: c,
|
|
@@ -4140,7 +4154,7 @@ const Qo = C.div`
|
|
|
4140
4154
|
]
|
|
4141
4155
|
}
|
|
4142
4156
|
) }) : /* @__PURE__ */ m(
|
|
4143
|
-
|
|
4157
|
+
ne,
|
|
4144
4158
|
{
|
|
4145
4159
|
alignItems: "center",
|
|
4146
4160
|
borderRadius: "8px",
|
|
@@ -4153,10 +4167,10 @@ const Qo = C.div`
|
|
|
4153
4167
|
{
|
|
4154
4168
|
appearance: c,
|
|
4155
4169
|
cursorHover: !0,
|
|
4156
|
-
icon: n && t.length > 0 ? /* @__PURE__ */ a(vn, {}) : /* @__PURE__ */ a(
|
|
4170
|
+
icon: n && t.length > 0 ? /* @__PURE__ */ a(vn, {}) : /* @__PURE__ */ a(Fn, {})
|
|
4157
4171
|
}
|
|
4158
4172
|
),
|
|
4159
|
-
/* @__PURE__ */ a(
|
|
4173
|
+
/* @__PURE__ */ a(jn, { children: /* @__PURE__ */ a(
|
|
4160
4174
|
ra,
|
|
4161
4175
|
{
|
|
4162
4176
|
"aria-controls": h,
|
|
@@ -4222,17 +4236,17 @@ const Qo = C.div`
|
|
|
4222
4236
|
if (r.path && (e === r.path || e.startsWith(r.path + "/")) || (t = r.links) != null && t.some((o) => o.path === e)) return r.id;
|
|
4223
4237
|
return null;
|
|
4224
4238
|
}, gl = (e) => {
|
|
4225
|
-
const { collapseOnNavigate: n = !1, defaultOpenId: t = null, groups: r } = e, o =
|
|
4239
|
+
const { collapseOnNavigate: n = !1, defaultOpenId: t = null, groups: r } = e, o = jt(), [i, s] = j.useState(t), d = j.useRef(o.pathname), l = j.useCallback(
|
|
4226
4240
|
(u) => {
|
|
4227
4241
|
var c;
|
|
4228
4242
|
return (c = u.find((g) => g.path === o.pathname)) == null ? void 0 : c.id;
|
|
4229
4243
|
},
|
|
4230
4244
|
[o.pathname]
|
|
4231
|
-
), p =
|
|
4245
|
+
), p = j.useCallback(
|
|
4232
4246
|
(u) => !!u && (o.pathname === u || o.pathname.startsWith(u + "/")),
|
|
4233
4247
|
[o.pathname]
|
|
4234
4248
|
);
|
|
4235
|
-
return
|
|
4249
|
+
return j.useEffect(() => {
|
|
4236
4250
|
if (!(d.current !== o.pathname)) return;
|
|
4237
4251
|
if (d.current = o.pathname, n) {
|
|
4238
4252
|
s(null);
|
|
@@ -4279,7 +4293,7 @@ var [ut, pt] = ct();
|
|
|
4279
4293
|
function ua(e, n) {
|
|
4280
4294
|
return e.source === n.source && e.flags.split("").sort().join("") === n.flags.split("").sort().join("");
|
|
4281
4295
|
}
|
|
4282
|
-
function
|
|
4296
|
+
function _e(e, n, t = !0, r = ["__key"]) {
|
|
4283
4297
|
if (e === n) return !0;
|
|
4284
4298
|
if (typeof n == "object" && typeof e == "object" && e !== null && n !== null) {
|
|
4285
4299
|
if (e instanceof Map || e instanceof Set) return !1;
|
|
@@ -4293,7 +4307,7 @@ function je(e, n, t = !0, r = ["__key"]) {
|
|
|
4293
4307
|
for (const s of r)
|
|
4294
4308
|
if ((s in o || s in i) && o[s] !== i[s]) return !1;
|
|
4295
4309
|
for (const s in o)
|
|
4296
|
-
if (!(s in i) || o[s] !== i[s] && !t || t && !
|
|
4310
|
+
if (!(s in i) || o[s] !== i[s] && !t || t && !_e(o[s], i[s], t, r)) return !1;
|
|
4297
4311
|
return !0;
|
|
4298
4312
|
}
|
|
4299
4313
|
return !1;
|
|
@@ -4301,13 +4315,13 @@ function je(e, n, t = !0, r = ["__key"]) {
|
|
|
4301
4315
|
function gt(e) {
|
|
4302
4316
|
return e.split(" ").filter((n) => n);
|
|
4303
4317
|
}
|
|
4304
|
-
function
|
|
4318
|
+
function Re(e) {
|
|
4305
4319
|
return { x: e.clientX, y: e.clientY };
|
|
4306
4320
|
}
|
|
4307
4321
|
Array();
|
|
4308
|
-
var
|
|
4322
|
+
var Rn = typeof window < "u", B = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakMap();
|
|
4309
4323
|
function ht() {
|
|
4310
|
-
if (!
|
|
4324
|
+
if (!Rn) return !1;
|
|
4311
4325
|
if ("userAgentData" in navigator)
|
|
4312
4326
|
return navigator.userAgentData.mobile === !0;
|
|
4313
4327
|
const e = navigator.userAgent, n = /android|iphone|ipod/i.test(e), t = /iPad/.test(e) || e.includes("Macintosh") && navigator.maxTouchPoints > 1;
|
|
@@ -4347,7 +4361,7 @@ var pa = {
|
|
|
4347
4361
|
scrollDebounceTimeout: void 0,
|
|
4348
4362
|
frameIdX: void 0,
|
|
4349
4363
|
frameIdY: void 0
|
|
4350
|
-
}, b = pa, pe = !1,
|
|
4364
|
+
}, b = pa, pe = !1, _n, mn;
|
|
4351
4365
|
function ga() {
|
|
4352
4366
|
b.scrollDebounceTimeout && clearTimeout(b.scrollDebounceTimeout), b.longPressTimeout && clearTimeout(b.longPressTimeout), b.frameIdX !== void 0 && cancelAnimationFrame(b.frameIdX), b.frameIdY !== void 0 && cancelAnimationFrame(b.frameIdY), b = { ...{
|
|
4353
4367
|
affectedNodes: [],
|
|
@@ -4396,9 +4410,9 @@ function ha() {
|
|
|
4396
4410
|
b.activeState && we(b.activeState.parent, void 0, b), b.selectedState && ye(b.selectedState.nodes, b.selectedState.parent, b), b.selectedState = b.activeState = void 0;
|
|
4397
4411
|
}
|
|
4398
4412
|
function fa() {
|
|
4399
|
-
if (b.pointerDown && (b.pointerDown.node.el.draggable = !0), b.pointerDown = void 0, !
|
|
4413
|
+
if (b.pointerDown && (b.pointerDown.node.el.draggable = !0), b.pointerDown = void 0, !ee(b)) return;
|
|
4400
4414
|
const e = b.currentParent.data.config;
|
|
4401
|
-
|
|
4415
|
+
ee(b) && e.handleEnd(b);
|
|
4402
4416
|
}
|
|
4403
4417
|
function ma(e) {
|
|
4404
4418
|
e.key === "Escape" && (b.selectedState && ye(b.selectedState.nodes, b.selectedState.parent, b), b.activeState && we(b.activeState.parent, void 0, b), b.selectedState = b.activeState = void 0);
|
|
@@ -4412,15 +4426,15 @@ function ba(e) {
|
|
|
4412
4426
|
function va(e) {
|
|
4413
4427
|
if (!Y(b)) return;
|
|
4414
4428
|
G(e);
|
|
4415
|
-
const { x: n, y: t } =
|
|
4429
|
+
const { x: n, y: t } = Re(e);
|
|
4416
4430
|
Y(b) && un({ x: n, y: t }, e, b);
|
|
4417
4431
|
}
|
|
4418
4432
|
function ya(e) {
|
|
4419
4433
|
if (!b.pointerDown || !b.pointerDown.validated) return;
|
|
4420
4434
|
const n = b.pointerDown.parent.data.config;
|
|
4421
4435
|
if (!(e.pointerType === "mouse" && !ht()))
|
|
4422
|
-
if (
|
|
4423
|
-
|
|
4436
|
+
if (ee(b))
|
|
4437
|
+
ee(b) && qn(e, b);
|
|
4424
4438
|
else {
|
|
4425
4439
|
if (G(e), n.longPress && !b.longPress) {
|
|
4426
4440
|
clearTimeout(b.longPressTimeout), b.longPress = !1;
|
|
@@ -4436,7 +4450,7 @@ function ya(e) {
|
|
|
4436
4450
|
t,
|
|
4437
4451
|
r
|
|
4438
4452
|
);
|
|
4439
|
-
|
|
4453
|
+
qn(e, o, !0);
|
|
4440
4454
|
}
|
|
4441
4455
|
}
|
|
4442
4456
|
function xa({
|
|
@@ -4446,8 +4460,8 @@ function xa({
|
|
|
4446
4460
|
config: r = {}
|
|
4447
4461
|
}) {
|
|
4448
4462
|
var l, p, u;
|
|
4449
|
-
if (!
|
|
4450
|
-
|
|
4463
|
+
if (!Rn) return;
|
|
4464
|
+
_n || (_n = nn(document, {
|
|
4451
4465
|
dragover: va,
|
|
4452
4466
|
pointerdown: ha,
|
|
4453
4467
|
pointerup: fa,
|
|
@@ -4459,7 +4473,7 @@ function xa({
|
|
|
4459
4473
|
Y(b) && c.cancelable && G(c);
|
|
4460
4474
|
},
|
|
4461
4475
|
contextmenu: (c) => {
|
|
4462
|
-
|
|
4476
|
+
ee(b) && G(c);
|
|
4463
4477
|
}
|
|
4464
4478
|
})), bt(e);
|
|
4465
4479
|
const [o, i] = ct(), s = {
|
|
@@ -4468,18 +4482,18 @@ function xa({
|
|
|
4468
4482
|
config: {
|
|
4469
4483
|
dragDropEffect: r.dragDropEffect ?? "move",
|
|
4470
4484
|
dragEffectAllowed: r.dragEffectAllowed ?? "move",
|
|
4471
|
-
draggedNodes:
|
|
4485
|
+
draggedNodes: Fa,
|
|
4472
4486
|
dragstartClasses: Ma,
|
|
4473
4487
|
handleNodeKeydown: Va,
|
|
4474
4488
|
handleDragstart: Oa,
|
|
4475
4489
|
handleNodeDragover: Qa,
|
|
4476
4490
|
handleParentDragover: Ka,
|
|
4477
|
-
handleNodeDrop:
|
|
4478
|
-
handleNodeFocus:
|
|
4479
|
-
handleNodeBlur:
|
|
4480
|
-
handlePointercancel:
|
|
4491
|
+
handleNodeDrop: Ua,
|
|
4492
|
+
handleNodeFocus: ja,
|
|
4493
|
+
handleNodeBlur: _a,
|
|
4494
|
+
handlePointercancel: Ba,
|
|
4481
4495
|
handleEnd: Ga,
|
|
4482
|
-
handleDragend:
|
|
4496
|
+
handleDragend: qa,
|
|
4483
4497
|
handleParentFocus: Ta,
|
|
4484
4498
|
handleNodePointerup: Ya,
|
|
4485
4499
|
handleNodePointerover: Ha,
|
|
@@ -4512,7 +4526,7 @@ function xa({
|
|
|
4512
4526
|
on: i,
|
|
4513
4527
|
emit: o
|
|
4514
4528
|
};
|
|
4515
|
-
new MutationObserver(Aa).observe(e, { childList: !0 }),
|
|
4529
|
+
new MutationObserver(Aa).observe(e, { childList: !0 }), B.set(e, s), (l = r.plugins) == null || l.forEach((c) => {
|
|
4516
4530
|
var g, h;
|
|
4517
4531
|
(h = (g = c(e)) == null ? void 0 : g.tearDown) == null || h.call(g);
|
|
4518
4532
|
}), (p = r.plugins) == null || p.forEach((c) => {
|
|
@@ -4524,7 +4538,7 @@ function xa({
|
|
|
4524
4538
|
}), Sa(e, s), dn(e, !0);
|
|
4525
4539
|
}
|
|
4526
4540
|
function mt(e, n, t, r, o, i) {
|
|
4527
|
-
const { x: s, y: d } =
|
|
4541
|
+
const { x: s, y: d } = Re(t), l = e.el.getBoundingClientRect();
|
|
4528
4542
|
return {
|
|
4529
4543
|
affectedNodes: [],
|
|
4530
4544
|
ascendingDirection: !1,
|
|
@@ -4565,7 +4579,7 @@ function wa({
|
|
|
4565
4579
|
}) {
|
|
4566
4580
|
dn(e.el);
|
|
4567
4581
|
const r = n.map((l) => l.data.value), o = Ae(e.el, e.data), i = n[0].data.index, s = [...e.data.enabledNodes], d = [
|
|
4568
|
-
...o.filter((l) => !r.some((p) =>
|
|
4582
|
+
...o.filter((l) => !r.some((p) => _e(l, p)))
|
|
4569
4583
|
];
|
|
4570
4584
|
d.splice(t[0].data.index, 0, ...r), "draggedNode" in b && (b.currentTargetValue = t[0].data.value), Cn(e.el, e.data, [...d]), e.data.config.onSort && e.data.config.onSort({
|
|
4571
4585
|
parent: {
|
|
@@ -4632,7 +4646,7 @@ function Ca({
|
|
|
4632
4646
|
dn(t.el);
|
|
4633
4647
|
const d = r.map((g) => g.data.value), l = [
|
|
4634
4648
|
...Ae(e.el, e.data).filter(
|
|
4635
|
-
(g) => !d.some((h) =>
|
|
4649
|
+
(g) => !d.some((h) => _e(g, h))
|
|
4636
4650
|
)
|
|
4637
4651
|
], p = Ae(n.el, n.data), u = t.el === n.el && n.data.config.sortable === !1;
|
|
4638
4652
|
let c;
|
|
@@ -4666,13 +4680,13 @@ function Da(e, n) {
|
|
|
4666
4680
|
t(n);
|
|
4667
4681
|
}
|
|
4668
4682
|
function bt(e) {
|
|
4669
|
-
const n =
|
|
4683
|
+
const n = B.get(e);
|
|
4670
4684
|
n && n.abortControllers.mainParent && n.abortControllers.mainParent.abort();
|
|
4671
4685
|
}
|
|
4672
4686
|
function Y(e) {
|
|
4673
4687
|
return "draggedNode" in e && !!e.draggedNode;
|
|
4674
4688
|
}
|
|
4675
|
-
function
|
|
4689
|
+
function ee(e) {
|
|
4676
4690
|
return "synthDragging" in e && !!e.synthDragging;
|
|
4677
4691
|
}
|
|
4678
4692
|
function Sa(e, n) {
|
|
@@ -4682,7 +4696,7 @@ function Sa(e, n) {
|
|
|
4682
4696
|
scroll: Ke(n.config.handleParentScroll),
|
|
4683
4697
|
drop: Ke(n.config.handleParentDrop),
|
|
4684
4698
|
hasNestedParent: (t) => {
|
|
4685
|
-
const r =
|
|
4699
|
+
const r = B.get(t.target);
|
|
4686
4700
|
r && (r.nestedParent = t.detail.parent);
|
|
4687
4701
|
},
|
|
4688
4702
|
focus: Ke(n.config.handleParentFocus)
|
|
@@ -4699,11 +4713,11 @@ function Sa(e, n) {
|
|
|
4699
4713
|
);
|
|
4700
4714
|
return;
|
|
4701
4715
|
}
|
|
4702
|
-
const o =
|
|
4716
|
+
const o = le.get(r);
|
|
4703
4717
|
if (!o) return;
|
|
4704
4718
|
const i = r.parentNode;
|
|
4705
4719
|
if (!(i instanceof HTMLElement)) return;
|
|
4706
|
-
const s =
|
|
4720
|
+
const s = B.get(i);
|
|
4707
4721
|
s && (b.pointerDown = {
|
|
4708
4722
|
parent: {
|
|
4709
4723
|
el: i,
|
|
@@ -4740,7 +4754,7 @@ function Ea(e) {
|
|
|
4740
4754
|
Y(b) && r.cancelable && G(r);
|
|
4741
4755
|
},
|
|
4742
4756
|
contextmenu: (r) => {
|
|
4743
|
-
|
|
4757
|
+
ee(b) && G(r);
|
|
4744
4758
|
}
|
|
4745
4759
|
}), e.node.el.draggable = !0, n.reapplyDragClasses(e.node.el, e.parent.data), (t = e.parent.data.config.plugins) == null || t.forEach((r) => {
|
|
4746
4760
|
var o, i;
|
|
@@ -4749,14 +4763,14 @@ function Ea(e) {
|
|
|
4749
4763
|
}
|
|
4750
4764
|
function vt(e) {
|
|
4751
4765
|
var n;
|
|
4752
|
-
|
|
4766
|
+
le.set(e.node.el, e.node.data), (n = e.parent.data.config.plugins) == null || n.forEach((t) => {
|
|
4753
4767
|
var r, o;
|
|
4754
4768
|
(o = (r = t(e.parent.el)) == null ? void 0 : r.setupNodeRemap) == null || o.call(r, e);
|
|
4755
4769
|
});
|
|
4756
4770
|
}
|
|
4757
4771
|
function Na(e, n) {
|
|
4758
4772
|
if (!Y(b)) return;
|
|
4759
|
-
const t =
|
|
4773
|
+
const t = ee(b) ? n.config.synthDropZoneClass : n.config.dropZoneClass;
|
|
4760
4774
|
b.draggedNode.el === e && Ne([e], t, !0);
|
|
4761
4775
|
}
|
|
4762
4776
|
function ka(e) {
|
|
@@ -4777,18 +4791,18 @@ function Aa(e) {
|
|
|
4777
4791
|
if (e.length === 1 && e[0].addedNodes.length === 1 && !(e[0].addedNodes[0] instanceof HTMLElement))
|
|
4778
4792
|
return;
|
|
4779
4793
|
const n = e[0].target;
|
|
4780
|
-
!(n instanceof HTMLElement) || !
|
|
4794
|
+
!(n instanceof HTMLElement) || !B.get(n) || dn(n);
|
|
4781
4795
|
}
|
|
4782
4796
|
function dn(e, n) {
|
|
4783
4797
|
var d;
|
|
4784
|
-
const t =
|
|
4798
|
+
const t = B.get(e);
|
|
4785
4799
|
if (!t) return;
|
|
4786
4800
|
t.privateClasses = Array.from(e.classList);
|
|
4787
4801
|
const r = [], o = t.config;
|
|
4788
4802
|
for (let l = 0; l < e.children.length; l++) {
|
|
4789
4803
|
const p = e.children[l];
|
|
4790
4804
|
if (!pn(p) || p.id === "dnd-dragged-node-clone") continue;
|
|
4791
|
-
const u =
|
|
4805
|
+
const u = le.get(p);
|
|
4792
4806
|
(n || !u) && o.tearDownNode({
|
|
4793
4807
|
parent: {
|
|
4794
4808
|
el: e,
|
|
@@ -4808,7 +4822,7 @@ function dn(e, n) {
|
|
|
4808
4822
|
}
|
|
4809
4823
|
const i = t.getValues(e), s = [];
|
|
4810
4824
|
for (let l = 0; l < r.length; l++) {
|
|
4811
|
-
const p = r[l], u =
|
|
4825
|
+
const p = r[l], u = le.get(p);
|
|
4812
4826
|
if (o.draggableValue && !o.draggableValue(i[l])) continue;
|
|
4813
4827
|
const c = Object.assign(
|
|
4814
4828
|
u ?? {
|
|
@@ -4820,7 +4834,7 @@ function dn(e, n) {
|
|
|
4820
4834
|
index: l
|
|
4821
4835
|
}
|
|
4822
4836
|
);
|
|
4823
|
-
if (!Y(b) && b.activeState &&
|
|
4837
|
+
if (!Y(b) && b.activeState && _e(b.activeState.node.data.value, c.value) && we(
|
|
4824
4838
|
{
|
|
4825
4839
|
data: t,
|
|
4826
4840
|
el: e
|
|
@@ -4830,7 +4844,7 @@ function dn(e, n) {
|
|
|
4830
4844
|
data: c
|
|
4831
4845
|
},
|
|
4832
4846
|
b
|
|
4833
|
-
), Y(b) &&
|
|
4847
|
+
), Y(b) && _e(b.draggedNode.data.value, c.value)) {
|
|
4834
4848
|
b.draggedNode.data = c, b.draggedNode.el = p;
|
|
4835
4849
|
const g = b.draggedNodes.find(
|
|
4836
4850
|
(h) => h.data.value === c.value
|
|
@@ -4860,7 +4874,7 @@ function dn(e, n) {
|
|
|
4860
4874
|
}
|
|
4861
4875
|
});
|
|
4862
4876
|
}
|
|
4863
|
-
|
|
4877
|
+
B.set(e, { ...t, enabledNodes: s }), o.remapFinished(t), (d = t.config.plugins) == null || d.forEach((l) => {
|
|
4864
4878
|
var p, u;
|
|
4865
4879
|
(u = (p = l(e)) == null ? void 0 : p.remapFinished) == null || u.call(p);
|
|
4866
4880
|
});
|
|
@@ -4868,10 +4882,10 @@ function dn(e, n) {
|
|
|
4868
4882
|
function Ia() {
|
|
4869
4883
|
b.remapJustFinished = !0, "draggedNode" in b && (b.affectedNodes = []);
|
|
4870
4884
|
}
|
|
4871
|
-
function
|
|
4885
|
+
function Ra(e) {
|
|
4872
4886
|
return !!e.targetData.parent.data.config.nativeDrag;
|
|
4873
4887
|
}
|
|
4874
|
-
function
|
|
4888
|
+
function Fa(e) {
|
|
4875
4889
|
var n;
|
|
4876
4890
|
if (e.parent.data.config.multiDrag) {
|
|
4877
4891
|
if (b.selectedState)
|
|
@@ -4885,13 +4899,13 @@ function Ra(e) {
|
|
|
4885
4899
|
return [];
|
|
4886
4900
|
}
|
|
4887
4901
|
function La(e) {
|
|
4888
|
-
Y(b) && (b.emit("scrollStarted", b), !
|
|
4902
|
+
Y(b) && (b.emit("scrollStarted", b), !ee(b) && (b.preventEnter = !0, mn && clearTimeout(mn), mn = setTimeout(() => {
|
|
4889
4903
|
b.preventEnter = !1, b.emit("scrollEnded", b);
|
|
4890
4904
|
}, 100)));
|
|
4891
4905
|
}
|
|
4892
4906
|
function Oa(e, n) {
|
|
4893
4907
|
const t = e.targetData.parent.data.config;
|
|
4894
|
-
if (!t.nativeDrag || !
|
|
4908
|
+
if (!t.nativeDrag || !Ra(e) || !yt({
|
|
4895
4909
|
x: e.e.clientX,
|
|
4896
4910
|
y: e.e.clientY,
|
|
4897
4911
|
node: e.targetData.node,
|
|
@@ -5093,17 +5107,17 @@ function Va(e) {
|
|
|
5093
5107
|
function Ha(e) {
|
|
5094
5108
|
e.detail.targetData.parent.el === e.detail.state.currentParent.el ? wt(e.detail, e.detail.state) : cn(e.detail, e.detail.state);
|
|
5095
5109
|
}
|
|
5096
|
-
function
|
|
5110
|
+
function Ua(e, n) {
|
|
5097
5111
|
const t = e.targetData.parent.data.config;
|
|
5098
5112
|
t.nativeDrag && (ge(e.e), pe = !0, t.handleEnd(n));
|
|
5099
5113
|
}
|
|
5100
|
-
function
|
|
5114
|
+
function ja(e) {
|
|
5101
5115
|
e.e.target !== e.e.currentTarget && b.pointerDown && (b.pointerDown.node.el.draggable = !1);
|
|
5102
5116
|
}
|
|
5103
|
-
function
|
|
5117
|
+
function _a(e) {
|
|
5104
5118
|
e.e.target !== e.e.currentTarget && b.pointerDown && (b.pointerDown.node.el.draggable = !0);
|
|
5105
5119
|
}
|
|
5106
|
-
function
|
|
5120
|
+
function qa(e, n) {
|
|
5107
5121
|
const t = e.targetData.parent.data.config;
|
|
5108
5122
|
if (t.nativeDrag) {
|
|
5109
5123
|
if (G(e.e), ge(e.e), pe) {
|
|
@@ -5113,14 +5127,14 @@ function Ba(e, n) {
|
|
|
5113
5127
|
t.handleEnd(n);
|
|
5114
5128
|
}
|
|
5115
5129
|
}
|
|
5116
|
-
function
|
|
5130
|
+
function Ba(e, n) {
|
|
5117
5131
|
var r;
|
|
5118
|
-
if (!
|
|
5132
|
+
if (!ee(n)) return;
|
|
5119
5133
|
if (G(e.e), pe) {
|
|
5120
5134
|
pe = !1;
|
|
5121
5135
|
return;
|
|
5122
5136
|
}
|
|
5123
|
-
const t = (r =
|
|
5137
|
+
const t = (r = B.get(n.initialParent.el)) == null ? void 0 : r.config;
|
|
5124
5138
|
t != null && t.onDragend && t.onDragend({
|
|
5125
5139
|
parent: n.currentParent,
|
|
5126
5140
|
values: Ae(n.currentParent.el, n.currentParent.data),
|
|
@@ -5132,8 +5146,8 @@ function qa(e, n) {
|
|
|
5132
5146
|
function Ga(e) {
|
|
5133
5147
|
var u, c, g, h, f;
|
|
5134
5148
|
e.draggedNode && (e.draggedNode.el.draggable = !0);
|
|
5135
|
-
const n = e.draggedNodes.map((w) => w.el), t = e.initialParent.data, r =
|
|
5136
|
-
|
|
5149
|
+
const n = e.draggedNodes.map((w) => w.el), t = e.initialParent.data, r = ee(e), o = (u = B.get(e.initialParent.el)) == null ? void 0 : u.config, i = r ? o == null ? void 0 : o.synthDropZoneClass : o == null ? void 0 : o.dropZoneClass, s = (c = t == null ? void 0 : t.config) == null ? void 0 : c.longPressClass, d = r ? (g = t == null ? void 0 : t.config) == null ? void 0 : g.synthDragPlaceholderClass : (h = t == null ? void 0 : t.config) == null ? void 0 : h.dragPlaceholderClass, l = e.originalZIndex;
|
|
5150
|
+
ee(e) && (e.clonedDraggedNode && e.clonedDraggedNode.remove(), e.longPressTimeout && clearTimeout(e.longPressTimeout)), Dn(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(() => {
|
|
5137
5151
|
ue(n, i), ue(n, s), ue(n, d);
|
|
5138
5152
|
}), ye(e.draggedNodes, e.currentParent, e), we(e.currentParent, void 0, e);
|
|
5139
5153
|
const p = { ...e };
|
|
@@ -5256,10 +5270,10 @@ function xt(e, n = !1) {
|
|
|
5256
5270
|
(u = e.initialParent.data.config) == null ? void 0 : u.longPressClass
|
|
5257
5271
|
));
|
|
5258
5272
|
}
|
|
5259
|
-
function
|
|
5260
|
-
const r =
|
|
5273
|
+
function qn(e, n, t = !1) {
|
|
5274
|
+
const r = Re(e);
|
|
5261
5275
|
n.coordinates.x = r.x, n.coordinates.y = r.y, xt(n, t), n.scrollDebounceTimeout && (clearTimeout(n.scrollDebounceTimeout), n.scrollDebounceTimeout = void 0), n.scrollDebounceTimeout = setTimeout(() => {
|
|
5262
|
-
|
|
5276
|
+
ee(n) && un(n.coordinates, e, n);
|
|
5263
5277
|
}, 16);
|
|
5264
5278
|
const o = ai(r);
|
|
5265
5279
|
if (!o) {
|
|
@@ -5291,13 +5305,13 @@ function Bn(e, n, t = !1) {
|
|
|
5291
5305
|
function Qa(e, n) {
|
|
5292
5306
|
var i;
|
|
5293
5307
|
if (!e.targetData.parent.data.config.nativeDrag) return;
|
|
5294
|
-
const { x: r, y: o } =
|
|
5308
|
+
const { x: r, y: o } = Re(e.e);
|
|
5295
5309
|
n.coordinates.y = o, n.coordinates.x = r, G(e.e), ge(e.e), Y(n) && un({ x: r, y: o }, e.e, n), e.targetData.parent.el === ((i = n.currentParent) == null ? void 0 : i.el) ? wt(e, n) : cn(e, n);
|
|
5296
5310
|
}
|
|
5297
5311
|
function Ka(e, n) {
|
|
5298
5312
|
if (!e.targetData.parent.data.config.nativeDrag) return;
|
|
5299
5313
|
G(e.e), ge(e.e);
|
|
5300
|
-
const { x: r, y: o } =
|
|
5314
|
+
const { x: r, y: o } = Re(e.e);
|
|
5301
5315
|
Y(n) && un({ x: r, y: o }, e.e, n), cn(e, n);
|
|
5302
5316
|
}
|
|
5303
5317
|
function Za(e) {
|
|
@@ -5362,7 +5376,7 @@ function ti(e, n, t, r) {
|
|
|
5362
5376
|
return !1;
|
|
5363
5377
|
}
|
|
5364
5378
|
function wt(e, n) {
|
|
5365
|
-
const { x: t, y: r } =
|
|
5379
|
+
const { x: t, y: r } = Re(e.e);
|
|
5366
5380
|
if (!ti(e, n, t, r))
|
|
5367
5381
|
return;
|
|
5368
5382
|
const o = n.draggedNode.data.index > e.targetData.node.data.index ? [e.targetData.node.data.index, n.draggedNode.data.index] : [n.draggedNode.data.index, e.targetData.node.data.index];
|
|
@@ -5376,9 +5390,9 @@ function wt(e, n) {
|
|
|
5376
5390
|
}
|
|
5377
5391
|
function X(e) {
|
|
5378
5392
|
function n(t) {
|
|
5379
|
-
const r =
|
|
5393
|
+
const r = le.get(t);
|
|
5380
5394
|
if (!r) return;
|
|
5381
|
-
const o =
|
|
5395
|
+
const o = B.get(t.parentNode);
|
|
5382
5396
|
if (o)
|
|
5383
5397
|
return {
|
|
5384
5398
|
node: {
|
|
@@ -5422,7 +5436,7 @@ function cn(e, n) {
|
|
|
5422
5436
|
}
|
|
5423
5437
|
function Ke(e) {
|
|
5424
5438
|
function n(t) {
|
|
5425
|
-
const r =
|
|
5439
|
+
const r = B.get(t);
|
|
5426
5440
|
if (r)
|
|
5427
5441
|
return {
|
|
5428
5442
|
parent: {
|
|
@@ -5445,10 +5459,10 @@ function Ke(e) {
|
|
|
5445
5459
|
}
|
|
5446
5460
|
function Ne(e, n, t = !1) {
|
|
5447
5461
|
function r(o, i) {
|
|
5448
|
-
|
|
5462
|
+
le.set(o, i);
|
|
5449
5463
|
}
|
|
5450
5464
|
for (const o of e) {
|
|
5451
|
-
const i =
|
|
5465
|
+
const i = le.get(o), s = ri(o, n, i, t);
|
|
5452
5466
|
s && r(o, s);
|
|
5453
5467
|
}
|
|
5454
5468
|
}
|
|
@@ -5478,13 +5492,13 @@ function ue(e, n) {
|
|
|
5478
5492
|
r.classList.remove(...t);
|
|
5479
5493
|
continue;
|
|
5480
5494
|
}
|
|
5481
|
-
const o =
|
|
5495
|
+
const o = le.get(r) || B.get(r);
|
|
5482
5496
|
if (o)
|
|
5483
5497
|
for (const i of t)
|
|
5484
5498
|
o.privateClasses.includes(i) || r.classList.remove(i);
|
|
5485
5499
|
}
|
|
5486
5500
|
}
|
|
5487
|
-
function
|
|
5501
|
+
function Bn(e, n, t, r, o) {
|
|
5488
5502
|
const s = o.axis === "x", d = e === document.scrollingElement, l = s ? "scrollLeft" : "scrollTop", p = s ? "clientWidth" : "clientHeight", u = s ? "offsetWidth" : "offsetHeight", c = s ? "scrollWidth" : "scrollHeight", g = s ? n.clientX : n.clientY, h = s ? r.left : r.top, f = s ? t.overflowX : t.overflowY;
|
|
5489
5503
|
if (d) {
|
|
5490
5504
|
const w = e[l], y = e[p], x = w > 0, T = w + y < (s ? o.state.rootScrollWidth || 0 : e[c]);
|
|
@@ -5524,7 +5538,7 @@ function oi(e, n, t, r) {
|
|
|
5524
5538
|
t[l] = void 0, t[d] = void 0;
|
|
5525
5539
|
return;
|
|
5526
5540
|
}
|
|
5527
|
-
e[u] += s * i,
|
|
5541
|
+
e[u] += s * i, ee(t) && xt(t), t[l] = requestAnimationFrame(p);
|
|
5528
5542
|
};
|
|
5529
5543
|
t[l] = requestAnimationFrame(p);
|
|
5530
5544
|
}
|
|
@@ -5541,10 +5555,10 @@ function un(e, n, t) {
|
|
|
5541
5555
|
const s = (l, p, u) => {
|
|
5542
5556
|
oi(u, n, t, { axis: l, direction: p }), i = !0;
|
|
5543
5557
|
}, d = (l) => {
|
|
5544
|
-
const p = window.getComputedStyle(l), u = l.getBoundingClientRect(), c =
|
|
5558
|
+
const p = window.getComputedStyle(l), u = l.getBoundingClientRect(), c = Bn(l, n, p, u, {
|
|
5545
5559
|
axis: "x",
|
|
5546
5560
|
state: t
|
|
5547
|
-
}), g =
|
|
5561
|
+
}), g = Bn(l, n, p, u, { axis: "y" });
|
|
5548
5562
|
(c.left || c.right) && (t.lastScrollContainerX = l, s("x", c.right ? "positive" : "negative", l)), (g.up || g.down) && (t.lastScrollContainerY = l, s("y", g.down ? "positive" : "negative", l));
|
|
5549
5563
|
};
|
|
5550
5564
|
if (t.lastScrollContainerX && Gn(t.lastScrollContainerX, r, o) && d(t.lastScrollContainerX), !i && t.lastScrollContainerY && Gn(t.lastScrollContainerY, r, o) && d(t.lastScrollContainerY), !i) {
|
|
@@ -5563,14 +5577,14 @@ function ai(e) {
|
|
|
5563
5577
|
if (!pn(n)) return;
|
|
5564
5578
|
let t, r = !0;
|
|
5565
5579
|
for (; n && r; ) {
|
|
5566
|
-
if (
|
|
5567
|
-
r = !1, t =
|
|
5580
|
+
if (le.has(n) || B.has(n)) {
|
|
5581
|
+
r = !1, t = B.has(n);
|
|
5568
5582
|
break;
|
|
5569
5583
|
}
|
|
5570
5584
|
n = n.parentNode;
|
|
5571
5585
|
}
|
|
5572
5586
|
if (t) {
|
|
5573
|
-
const o =
|
|
5587
|
+
const o = B.get(n);
|
|
5574
5588
|
return o ? {
|
|
5575
5589
|
parent: {
|
|
5576
5590
|
el: n,
|
|
@@ -5578,9 +5592,9 @@ function ai(e) {
|
|
|
5578
5592
|
}
|
|
5579
5593
|
} : void 0;
|
|
5580
5594
|
} else {
|
|
5581
|
-
const o =
|
|
5595
|
+
const o = le.get(n);
|
|
5582
5596
|
if (!o) return;
|
|
5583
|
-
const i =
|
|
5597
|
+
const i = B.get(n.parentNode);
|
|
5584
5598
|
return i ? {
|
|
5585
5599
|
node: {
|
|
5586
5600
|
el: n,
|
|
@@ -5633,7 +5647,7 @@ function ci(e, n) {
|
|
|
5633
5647
|
};
|
|
5634
5648
|
}
|
|
5635
5649
|
function Yn(e) {
|
|
5636
|
-
|
|
5650
|
+
Rn && (Array.isArray(e) || (e = [e]), e.forEach((n) => {
|
|
5637
5651
|
const { parent: t, state: r, ...o } = n;
|
|
5638
5652
|
li(t, ci(o, r));
|
|
5639
5653
|
}));
|
|
@@ -5687,17 +5701,17 @@ const Wn = {
|
|
|
5687
5701
|
} = e, [l, p] = ui(
|
|
5688
5702
|
i,
|
|
5689
5703
|
{ group: r }
|
|
5690
|
-
), [u, c] =
|
|
5704
|
+
), [u, c] = j.useState(
|
|
5691
5705
|
null
|
|
5692
|
-
), g =
|
|
5693
|
-
|
|
5706
|
+
), g = j.useRef(i);
|
|
5707
|
+
j.useEffect(() => {
|
|
5694
5708
|
const x = (T) => {
|
|
5695
5709
|
const D = T.detail ?? null;
|
|
5696
5710
|
c(D);
|
|
5697
5711
|
};
|
|
5698
5712
|
return window.addEventListener(bn, x), () => window.removeEventListener(bn, x);
|
|
5699
5713
|
}, []);
|
|
5700
|
-
const h =
|
|
5714
|
+
const h = j.useCallback((x) => {
|
|
5701
5715
|
window.dispatchEvent(
|
|
5702
5716
|
new CustomEvent(bn, { detail: x })
|
|
5703
5717
|
);
|
|
@@ -5705,15 +5719,15 @@ const Wn = {
|
|
|
5705
5719
|
var E;
|
|
5706
5720
|
const T = x.target, D = (E = T == null ? void 0 : T.closest) == null ? void 0 : E.call(T, "li.dnd-item"), I = (D == null ? void 0 : D.getAttribute("data-label")) || null;
|
|
5707
5721
|
I && (c(I), h(I));
|
|
5708
|
-
}, w =
|
|
5722
|
+
}, w = j.useCallback(() => {
|
|
5709
5723
|
c(null), h(null);
|
|
5710
5724
|
}, [h]);
|
|
5711
|
-
|
|
5725
|
+
j.useEffect(() => {
|
|
5712
5726
|
const x = () => w();
|
|
5713
5727
|
return window.addEventListener("pointerup", x), window.addEventListener("blur", x), () => {
|
|
5714
5728
|
window.removeEventListener("pointerup", x), window.removeEventListener("blur", x);
|
|
5715
5729
|
};
|
|
5716
|
-
}, [w]),
|
|
5730
|
+
}, [w]), j.useEffect(() => {
|
|
5717
5731
|
const x = g.current;
|
|
5718
5732
|
if (p.length !== x.length && p.length === x.length + 1) {
|
|
5719
5733
|
const T = new Set(x), D = p.find((I) => !T.has(I)) || null;
|
|
@@ -5741,7 +5755,7 @@ const Wn = {
|
|
|
5741
5755
|
onPointerCancelCapture: w,
|
|
5742
5756
|
$isEmpty: y,
|
|
5743
5757
|
children: y ? /* @__PURE__ */ a(
|
|
5744
|
-
|
|
5758
|
+
ne,
|
|
5745
5759
|
{
|
|
5746
5760
|
background: !0,
|
|
5747
5761
|
borderRadius: "8px",
|
|
@@ -5759,7 +5773,7 @@ const Wn = {
|
|
|
5759
5773
|
"data-label": x,
|
|
5760
5774
|
"data-first": !!(s && T === 0) || void 0,
|
|
5761
5775
|
$active: D,
|
|
5762
|
-
children: /* @__PURE__ */ a(
|
|
5776
|
+
children: /* @__PURE__ */ a(ne, { border: !0, borderRadius: "8px", width: "100%", children: /* @__PURE__ */ a(
|
|
5763
5777
|
k,
|
|
5764
5778
|
{
|
|
5765
5779
|
type: "title",
|
|
@@ -5890,7 +5904,7 @@ const Wn = {
|
|
|
5890
5904
|
}
|
|
5891
5905
|
)
|
|
5892
5906
|
] });
|
|
5893
|
-
},
|
|
5907
|
+
}, ie = {
|
|
5894
5908
|
border: {
|
|
5895
5909
|
color: {
|
|
5896
5910
|
regular: S.palette.neutral.N40,
|
|
@@ -5939,7 +5953,7 @@ const Wn = {
|
|
|
5939
5953
|
border-radius: 4px;
|
|
5940
5954
|
background: ${({ theme: e }) => {
|
|
5941
5955
|
var n, t, r;
|
|
5942
|
-
return ((r = (t = (n = e == null ? void 0 : e.input) == null ? void 0 : n.option) == null ? void 0 : t.background) == null ? void 0 : r.regular) ||
|
|
5956
|
+
return ((r = (t = (n = e == null ? void 0 : e.input) == null ? void 0 : n.option) == null ? void 0 : t.background) == null ? void 0 : r.regular) || ie.option.background.regular;
|
|
5943
5957
|
}};
|
|
5944
5958
|
box-shadow:
|
|
5945
5959
|
0px 1px 2px rgba(0, 0, 0, 0.3),
|
|
@@ -5976,7 +5990,7 @@ const Wn = {
|
|
|
5976
5990
|
& > li:hover {
|
|
5977
5991
|
background: ${({ theme: e }) => {
|
|
5978
5992
|
var n, t, r;
|
|
5979
|
-
return ((r = (t = (n = e == null ? void 0 : e.input) == null ? void 0 : n.option) == null ? void 0 : t.background) == null ? void 0 : r.hover) ||
|
|
5993
|
+
return ((r = (t = (n = e == null ? void 0 : e.input) == null ? void 0 : n.option) == null ? void 0 : t.background) == null ? void 0 : r.hover) || ie.option.background.hover;
|
|
5980
5994
|
}};
|
|
5981
5995
|
}
|
|
5982
5996
|
`, bi = (e) => {
|
|
@@ -6029,13 +6043,13 @@ const Wn = {
|
|
|
6029
6043
|
cursor: ${({ $disabled: e }) => e ? "not-allowed" : "pointer"};
|
|
6030
6044
|
background-color: ${({ $disabled: e, theme: n }) => {
|
|
6031
6045
|
var t, r, o, i, s, d;
|
|
6032
|
-
return e ? ((o = (r = (t = n == null ? void 0 : n.input) == null ? void 0 : t.background) == null ? void 0 : r.color) == null ? void 0 : o.disabled) ||
|
|
6046
|
+
return e ? ((o = (r = (t = n == null ? void 0 : n.input) == null ? void 0 : t.background) == null ? void 0 : r.color) == null ? void 0 : o.disabled) || ie.background.color.disabled : ((d = (s = (i = n == null ? void 0 : n.input) == null ? void 0 : i.background) == null ? void 0 : s.color) == null ? void 0 : d.regular) || ie.background.color.regular;
|
|
6033
6047
|
}};
|
|
6034
6048
|
|
|
6035
6049
|
border: 1px solid
|
|
6036
6050
|
${({ $disabled: e, $invalid: n, $focused: t, theme: r }) => {
|
|
6037
6051
|
var i, s;
|
|
6038
|
-
const o = ((s = (i = r == null ? void 0 : r.input) == null ? void 0 : i.border) == null ? void 0 : s.color) ||
|
|
6052
|
+
const o = ((s = (i = r == null ? void 0 : r.input) == null ? void 0 : i.border) == null ? void 0 : s.color) || ie.border.color;
|
|
6039
6053
|
return e ? o.disabled : n ? o.invalid : t ? o.focus : o.regular;
|
|
6040
6054
|
}};
|
|
6041
6055
|
`, wi = C.input`
|
|
@@ -6070,13 +6084,13 @@ const Wn = {
|
|
|
6070
6084
|
}};
|
|
6071
6085
|
color: ${({ $disabled: e, theme: n }) => {
|
|
6072
6086
|
var t, r, o, i, s, d;
|
|
6073
|
-
return e ? ((o = (r = (t = n == null ? void 0 : n.input) == null ? void 0 : t.content) == null ? void 0 : r.color) == null ? void 0 : o.disabled) ||
|
|
6087
|
+
return e ? ((o = (r = (t = n == null ? void 0 : n.input) == null ? void 0 : t.content) == null ? void 0 : r.color) == null ? void 0 : o.disabled) || ie.content.color.disabled : ((d = (s = (i = n == null ? void 0 : n.input) == null ? void 0 : i.content) == null ? void 0 : s.color) == null ? void 0 : d.regular) || ie.content.color.regular;
|
|
6074
6088
|
}};
|
|
6075
6089
|
|
|
6076
6090
|
::placeholder {
|
|
6077
6091
|
color: ${({ theme: e }) => {
|
|
6078
6092
|
var n, t, r;
|
|
6079
|
-
return ((r = (t = (n = e == null ? void 0 : e.input) == null ? void 0 : n.placeholder) == null ? void 0 : t.color) == null ? void 0 : r.regular) ||
|
|
6093
|
+
return ((r = (t = (n = e == null ? void 0 : e.input) == null ? void 0 : n.placeholder) == null ? void 0 : t.color) == null ? void 0 : r.regular) || ie.placeholder.color.regular;
|
|
6080
6094
|
}};
|
|
6081
6095
|
}
|
|
6082
6096
|
|
|
@@ -6109,13 +6123,13 @@ function Qn(e, n) {
|
|
|
6109
6123
|
}
|
|
6110
6124
|
const Di = (e) => {
|
|
6111
6125
|
var o, i;
|
|
6112
|
-
const { message: n } = e, t = $n(Nn), r = ((i = (o = t == null ? void 0 : t.input) == null ? void 0 : o.message) == null ? void 0 : i.appearance) ||
|
|
6126
|
+
const { message: n } = e, t = $n(Nn), r = ((i = (o = t == null ? void 0 : t.input) == null ? void 0 : o.message) == null ? void 0 : i.appearance) || ie.message.appearance;
|
|
6113
6127
|
return /* @__PURE__ */ m(v, { alignItems: "center", gap: "4px", margin: "4px 0 0 16px", children: [
|
|
6114
6128
|
/* @__PURE__ */ a(
|
|
6115
6129
|
P,
|
|
6116
6130
|
{
|
|
6117
6131
|
appearance: r,
|
|
6118
|
-
icon: /* @__PURE__ */ a(
|
|
6132
|
+
icon: /* @__PURE__ */ a(Rt, {}),
|
|
6119
6133
|
size: "14px"
|
|
6120
6134
|
}
|
|
6121
6135
|
),
|
|
@@ -6153,19 +6167,19 @@ const Di = (e) => {
|
|
|
6153
6167
|
checkedItems: D,
|
|
6154
6168
|
editable: I = !1,
|
|
6155
6169
|
clearable: E,
|
|
6156
|
-
onKeyUp:
|
|
6157
|
-
onBlur:
|
|
6170
|
+
onKeyUp: R,
|
|
6171
|
+
onBlur: F,
|
|
6158
6172
|
onChange: $,
|
|
6159
|
-
onClick:
|
|
6173
|
+
onClick: _,
|
|
6160
6174
|
onFocus: se,
|
|
6161
6175
|
onOptionClick: Te,
|
|
6162
6176
|
onCheckboxChange: Ce,
|
|
6163
6177
|
handleClear: he
|
|
6164
|
-
} = e,
|
|
6165
|
-
() => g.filter((
|
|
6178
|
+
} = e, ae = $n(Nn), Fe = ((Oe = (de = ae == null ? void 0 : ae.input) == null ? void 0 : de.required) == null ? void 0 : Oe.appearance) || ie.required.appearance, De = f && !r, fe = x || y === "" ? "" : Qn(g, y), me = nt(
|
|
6179
|
+
() => g.filter((V) => D.includes(V.id)),
|
|
6166
6180
|
[g, D]
|
|
6167
|
-
), Le = (
|
|
6168
|
-
|
|
6181
|
+
), Le = (V, L) => {
|
|
6182
|
+
V.stopPropagation(), Ce({
|
|
6169
6183
|
target: { checked: !1, value: L }
|
|
6170
6184
|
});
|
|
6171
6185
|
};
|
|
@@ -6189,7 +6203,7 @@ const Di = (e) => {
|
|
|
6189
6203
|
children: l
|
|
6190
6204
|
}
|
|
6191
6205
|
),
|
|
6192
|
-
De && /* @__PURE__ */ a(k, { appearance:
|
|
6206
|
+
De && /* @__PURE__ */ a(k, { appearance: Fe, size: "small", type: "body", children: "(Requerido)" })
|
|
6193
6207
|
]
|
|
6194
6208
|
}
|
|
6195
6209
|
),
|
|
@@ -6199,7 +6213,7 @@ const Di = (e) => {
|
|
|
6199
6213
|
$disabled: r,
|
|
6200
6214
|
$focused: o,
|
|
6201
6215
|
$invalid: d,
|
|
6202
|
-
onClick: I ? void 0 :
|
|
6216
|
+
onClick: I ? void 0 : _,
|
|
6203
6217
|
$value: y,
|
|
6204
6218
|
$size: w,
|
|
6205
6219
|
children: [
|
|
@@ -6219,10 +6233,10 @@ const Di = (e) => {
|
|
|
6219
6233
|
$focused: o,
|
|
6220
6234
|
readOnly: !I,
|
|
6221
6235
|
onFocus: se,
|
|
6222
|
-
onBlur:
|
|
6223
|
-
onChange: (
|
|
6224
|
-
onClick: I ?
|
|
6225
|
-
onKeyUp:
|
|
6236
|
+
onBlur: F,
|
|
6237
|
+
onChange: (V) => $(c, V.target.value),
|
|
6238
|
+
onClick: I ? _ : void 0,
|
|
6239
|
+
onKeyUp: R
|
|
6226
6240
|
}
|
|
6227
6241
|
),
|
|
6228
6242
|
/* @__PURE__ */ m(
|
|
@@ -6233,16 +6247,16 @@ const Di = (e) => {
|
|
|
6233
6247
|
alignItems: "center",
|
|
6234
6248
|
justifyContent: "space-between",
|
|
6235
6249
|
children: [
|
|
6236
|
-
/* @__PURE__ */ a(v, { gap: "8px", alignItems: "center", wrap: "wrap", children: E && !r && (x ? me.map((
|
|
6250
|
+
/* @__PURE__ */ a(v, { gap: "8px", alignItems: "center", wrap: "wrap", children: E && !r && (x ? me.map((V) => /* @__PURE__ */ a(
|
|
6237
6251
|
ve,
|
|
6238
6252
|
{
|
|
6239
6253
|
appearance: "gray",
|
|
6240
|
-
label:
|
|
6254
|
+
label: V.label,
|
|
6241
6255
|
removable: !0,
|
|
6242
6256
|
displayIcon: !1,
|
|
6243
|
-
onClose: (L) => Le(L,
|
|
6257
|
+
onClose: (L) => Le(L, V.id)
|
|
6244
6258
|
},
|
|
6245
|
-
|
|
6259
|
+
V.id
|
|
6246
6260
|
)) : (y ?? "") !== "" && /* @__PURE__ */ a(
|
|
6247
6261
|
ve,
|
|
6248
6262
|
{
|
|
@@ -6250,8 +6264,8 @@ const Di = (e) => {
|
|
|
6250
6264
|
label: Qn(g, y),
|
|
6251
6265
|
removable: !0,
|
|
6252
6266
|
displayIcon: !1,
|
|
6253
|
-
onClose: (
|
|
6254
|
-
|
|
6267
|
+
onClose: (V) => {
|
|
6268
|
+
V.stopPropagation(), he();
|
|
6255
6269
|
}
|
|
6256
6270
|
}
|
|
6257
6271
|
)) }),
|
|
@@ -6277,16 +6291,16 @@ const Di = (e) => {
|
|
|
6277
6291
|
maxItems: p,
|
|
6278
6292
|
onOptionClick: Te,
|
|
6279
6293
|
options: g,
|
|
6280
|
-
children: g.map((
|
|
6294
|
+
children: g.map((V) => /* @__PURE__ */ a(
|
|
6281
6295
|
Vt,
|
|
6282
6296
|
{
|
|
6283
|
-
id:
|
|
6284
|
-
label:
|
|
6285
|
-
checked: D.includes(
|
|
6297
|
+
id: V.id,
|
|
6298
|
+
label: V.label,
|
|
6299
|
+
checked: D.includes(V.id),
|
|
6286
6300
|
onCheckboxChange: Ce,
|
|
6287
6301
|
picker: x
|
|
6288
6302
|
},
|
|
6289
|
-
|
|
6303
|
+
V.id
|
|
6290
6304
|
))
|
|
6291
6305
|
}
|
|
6292
6306
|
)
|
|
@@ -6314,21 +6328,21 @@ const Di = (e) => {
|
|
|
6314
6328
|
showOptions: D = !1,
|
|
6315
6329
|
picker: I = !1,
|
|
6316
6330
|
showChevron: E = !0,
|
|
6317
|
-
editable:
|
|
6318
|
-
clearable:
|
|
6319
|
-
} = e, [$,
|
|
6331
|
+
editable: R = !1,
|
|
6332
|
+
clearable: F = !0
|
|
6333
|
+
} = e, [$, _] = M(!1), [se, Te] = M(!1), [Ce, he] = M([]), ae = Ee(null);
|
|
6320
6334
|
xe(() => {
|
|
6321
6335
|
if (I) {
|
|
6322
6336
|
const L = T ? T.split(",").map((W) => W.trim()) : [];
|
|
6323
6337
|
he(L);
|
|
6324
6338
|
}
|
|
6325
6339
|
}, [T, I]);
|
|
6326
|
-
function
|
|
6327
|
-
u(l, ""), he([]),
|
|
6340
|
+
function Fe() {
|
|
6341
|
+
u(l, ""), he([]), _(!1);
|
|
6328
6342
|
}
|
|
6329
6343
|
function De(L) {
|
|
6330
6344
|
if (!n) {
|
|
6331
|
-
|
|
6345
|
+
_(!$);
|
|
6332
6346
|
try {
|
|
6333
6347
|
c && c(L);
|
|
6334
6348
|
} catch (W) {
|
|
@@ -6336,8 +6350,8 @@ const Di = (e) => {
|
|
|
6336
6350
|
}
|
|
6337
6351
|
}
|
|
6338
6352
|
}
|
|
6339
|
-
const fe =
|
|
6340
|
-
|
|
6353
|
+
const fe = Ut((L) => {
|
|
6354
|
+
ae.current && L.target && !ae.current.contains(L.target) && _(!1);
|
|
6341
6355
|
}, []);
|
|
6342
6356
|
function me(L) {
|
|
6343
6357
|
try {
|
|
@@ -6347,7 +6361,7 @@ const Di = (e) => {
|
|
|
6347
6361
|
}
|
|
6348
6362
|
}
|
|
6349
6363
|
function Le(L) {
|
|
6350
|
-
|
|
6364
|
+
_(!1);
|
|
6351
6365
|
try {
|
|
6352
6366
|
u && u(l, L);
|
|
6353
6367
|
} catch (W) {
|
|
@@ -6355,7 +6369,7 @@ const Di = (e) => {
|
|
|
6355
6369
|
}
|
|
6356
6370
|
}
|
|
6357
6371
|
function de(L) {
|
|
6358
|
-
L.key === "Escape" &&
|
|
6372
|
+
L.key === "Escape" && _(!1), _(!$);
|
|
6359
6373
|
try {
|
|
6360
6374
|
h && h(L);
|
|
6361
6375
|
} catch (W) {
|
|
@@ -6365,18 +6379,18 @@ const Di = (e) => {
|
|
|
6365
6379
|
function Oe(L) {
|
|
6366
6380
|
const { value: W, checked: We } = L.target;
|
|
6367
6381
|
he((A) => {
|
|
6368
|
-
const
|
|
6369
|
-
return u(l,
|
|
6382
|
+
const q = We ? [...A, W] : A.filter((te) => te !== W);
|
|
6383
|
+
return u(l, q.join(",")), q;
|
|
6370
6384
|
});
|
|
6371
6385
|
}
|
|
6372
6386
|
xe(() => (document.addEventListener("click", fe), () => {
|
|
6373
6387
|
document.removeEventListener("click", fe);
|
|
6374
6388
|
}), [fe]);
|
|
6375
|
-
const
|
|
6389
|
+
const V = nt(() => F || I ? f : [{ id: "empty-option", label: "", value: "" }, ...f], [f, F, I]);
|
|
6376
6390
|
return /* @__PURE__ */ a(
|
|
6377
6391
|
Si,
|
|
6378
6392
|
{
|
|
6379
|
-
ref:
|
|
6393
|
+
ref: ae,
|
|
6380
6394
|
disabled: n,
|
|
6381
6395
|
displayList: $ || D,
|
|
6382
6396
|
focused: se,
|
|
@@ -6387,7 +6401,7 @@ const Di = (e) => {
|
|
|
6387
6401
|
maxItems: s,
|
|
6388
6402
|
message: d,
|
|
6389
6403
|
name: l,
|
|
6390
|
-
options:
|
|
6404
|
+
options: V,
|
|
6391
6405
|
placeholder: w,
|
|
6392
6406
|
required: y,
|
|
6393
6407
|
size: x,
|
|
@@ -6395,9 +6409,9 @@ const Di = (e) => {
|
|
|
6395
6409
|
picker: I,
|
|
6396
6410
|
showChevron: E,
|
|
6397
6411
|
checkedItems: Ce,
|
|
6398
|
-
editable:
|
|
6399
|
-
clearable:
|
|
6400
|
-
handleClear:
|
|
6412
|
+
editable: R,
|
|
6413
|
+
clearable: F,
|
|
6414
|
+
handleClear: Fe,
|
|
6401
6415
|
onBlur: me,
|
|
6402
6416
|
onChange: u,
|
|
6403
6417
|
onClick: De,
|
|
@@ -6455,7 +6469,7 @@ function $i(e) {
|
|
|
6455
6469
|
return e.replace(/\s+/g, " ").trim();
|
|
6456
6470
|
}
|
|
6457
6471
|
function Ai(e) {
|
|
6458
|
-
const n = Ii(e).toLowerCase(), t = /\b(s|es)\b/.test(
|
|
6472
|
+
const n = Ii(e).toLowerCase(), t = /\b(s|es)\b/.test(Ri(e).toLowerCase()) && !n.endsWith("és");
|
|
6459
6473
|
return ({
|
|
6460
6474
|
mano: "f",
|
|
6461
6475
|
día: "m",
|
|
@@ -6467,18 +6481,18 @@ function Ai(e) {
|
|
|
6467
6481
|
antigüedad: "f",
|
|
6468
6482
|
antiguedad: "f",
|
|
6469
6483
|
puntaje: "m"
|
|
6470
|
-
}[n] ??
|
|
6484
|
+
}[n] ?? Fi(n)) === "f" ? t ? "las" : "la" : t ? "los" : "el";
|
|
6471
6485
|
}
|
|
6472
6486
|
function Ii(e) {
|
|
6473
6487
|
return (e.toLowerCase().split(
|
|
6474
6488
|
/\bdel\b|\bde la\b|\bde los\b|\bde las\b|\bde\b/
|
|
6475
6489
|
)[0].trim().split(/\s+/)[0] ?? "").normalize("NFD").replace(/^[^a-záéíóúüñ]+/i, "");
|
|
6476
6490
|
}
|
|
6477
|
-
function
|
|
6491
|
+
function Ri(e) {
|
|
6478
6492
|
const n = e.trim().split(/\s+/);
|
|
6479
6493
|
return n[n.length - 1] || "";
|
|
6480
6494
|
}
|
|
6481
|
-
function
|
|
6495
|
+
function Fi(e) {
|
|
6482
6496
|
return /(?:dad|tad|tud|umbre|ción|sión|ie|sis|itis)$/.test(e) || e.endsWith("ez") || e.endsWith("eza") ? "f" : /(?:aje|or|án|ambre)$/.test(e) ? "m" : e.endsWith("a") ? "f" : "m";
|
|
6483
6497
|
}
|
|
6484
6498
|
function Li(e) {
|
|
@@ -6511,7 +6525,7 @@ const yl = (e) => Object.values(e).flat(), xl = (e, n) => Object.fromEntries(
|
|
|
6511
6525
|
const n = Date.now(), t = Kn.get(e) || 0;
|
|
6512
6526
|
return n - t < Mi ? !0 : (Kn.set(e, n), !1);
|
|
6513
6527
|
}, Vi = (e) => {
|
|
6514
|
-
const n =
|
|
6528
|
+
const n = qt(e);
|
|
6515
6529
|
return {
|
|
6516
6530
|
spa: "es",
|
|
6517
6531
|
eng: "en",
|
|
@@ -6527,7 +6541,7 @@ const yl = (e) => Object.values(e).flat(), xl = (e, n) => Object.fromEntries(
|
|
|
6527
6541
|
return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
|
|
6528
6542
|
const s = Vi(e);
|
|
6529
6543
|
try {
|
|
6530
|
-
const { data: d } = await
|
|
6544
|
+
const { data: d } = await _t.post(
|
|
6531
6545
|
t,
|
|
6532
6546
|
{
|
|
6533
6547
|
q: e,
|
|
@@ -6545,10 +6559,10 @@ const yl = (e) => Object.values(e).flat(), xl = (e, n) => Object.fromEntries(
|
|
|
6545
6559
|
} catch (d) {
|
|
6546
6560
|
return console.warn(`[Translation] Failed for: "${e}"`, d), e;
|
|
6547
6561
|
}
|
|
6548
|
-
},
|
|
6562
|
+
}, Ui = (e) => typeof e == "string" && e.trim().length > 0, Zn = async (e, n, t) => {
|
|
6549
6563
|
const r = await Promise.all(
|
|
6550
6564
|
Object.entries(e).map(async ([o, i]) => {
|
|
6551
|
-
if (
|
|
6565
|
+
if (Ui(i)) {
|
|
6552
6566
|
const s = await Hi(i, n, t);
|
|
6553
6567
|
return [o, s];
|
|
6554
6568
|
} else if (Array.isArray(i)) {
|
|
@@ -6589,7 +6603,7 @@ export {
|
|
|
6589
6603
|
na as RulesForm,
|
|
6590
6604
|
fl as SendButton,
|
|
6591
6605
|
vl as buildEsConditionSentence,
|
|
6592
|
-
|
|
6606
|
+
_o as convertRangeToString,
|
|
6593
6607
|
it as filterByGroup,
|
|
6594
6608
|
yl as flatFromGroups,
|
|
6595
6609
|
ll as formatDecisionForBackend,
|