@isettingkit/business-rules 1.0.16 → 1.0.17
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 +219 -184
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
1
|
+
import { jsx as a, jsxs as u, Fragment as D } from "react/jsx-runtime";
|
|
2
2
|
import { MdOutlineDelete as fe, MdClear as ne, MdAdd as ae, MdOutlineFilterAltOff as ie, MdOutlineFilterAlt as oe } from "react-icons/md";
|
|
3
|
-
import { inube as w, Stack as p, Divider as S, Icon as M, Text as y, SkeletonLine as
|
|
4
|
-
import f, { keyframes as
|
|
3
|
+
import { inube as w, Stack as p, Divider as S, Icon as M, Text as y, SkeletonLine as F, useMediaQuery as $, Blanket as re, Button as N, Grid as le, Tag as se, Checkpicker as ye, Toggle as de, Checkbox as xe, Date as Q } from "@inubekit/inubekit";
|
|
4
|
+
import f, { keyframes as we } from "styled-components";
|
|
5
5
|
import { ValueDataType as k, ValueHowToSetUp as O, DecisionConditionRender as Y } from "@isettingkit/input";
|
|
6
6
|
import { DecisionViewConditionRenderer as U } from "@isettingkit/view";
|
|
7
7
|
import { createPortal as ce } from "react-dom";
|
|
8
|
-
import { useFormik as
|
|
8
|
+
import { useFormik as ve } from "formik";
|
|
9
9
|
import { string as H, mixed as he, object as V, number as q, lazy as K, date as W } from "yup";
|
|
10
|
-
import { useState as z, useEffect as
|
|
11
|
-
import
|
|
12
|
-
import { franc as
|
|
13
|
-
const
|
|
10
|
+
import { useState as z, useEffect as Ce } from "react";
|
|
11
|
+
import Se from "axios";
|
|
12
|
+
import { franc as De } from "franc-min";
|
|
13
|
+
const Ee = f.div`
|
|
14
14
|
border-radius: 8px;
|
|
15
15
|
border: 1px solid
|
|
16
16
|
${({ theme: e }) => {
|
|
@@ -47,9 +47,9 @@ f.div`
|
|
|
47
47
|
`;
|
|
48
48
|
const P = (e) => {
|
|
49
49
|
const { children: t, controls: n = !0, handleDelete: i, id: o } = e;
|
|
50
|
-
return /* @__PURE__ */ a(
|
|
50
|
+
return /* @__PURE__ */ a(Ee, { children: /* @__PURE__ */ u(p, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
51
51
|
t,
|
|
52
|
-
n && /* @__PURE__ */
|
|
52
|
+
n && /* @__PURE__ */ u(D, { children: [
|
|
53
53
|
/* @__PURE__ */ a(S, {}),
|
|
54
54
|
/* @__PURE__ */ a(p, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ a(
|
|
55
55
|
M,
|
|
@@ -92,34 +92,34 @@ const P = (e) => {
|
|
|
92
92
|
background-color: #ebecf0;
|
|
93
93
|
border-radius: 8px;
|
|
94
94
|
}
|
|
95
|
-
`,
|
|
95
|
+
`, Ne = (e) => e.value, ke = (e) => e.value, $e = (e) => e.value, Ae = (e) => ({
|
|
96
96
|
from: e.from ?? "",
|
|
97
97
|
to: e.to ?? ""
|
|
98
|
-
}),
|
|
98
|
+
}), Fe = (e) => e.value, Ie = (e) => e.value, Re = (e) => e.value;
|
|
99
99
|
var x = /* @__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))(x || {});
|
|
100
|
-
const
|
|
101
|
-
[x.LIST_OF_VALUES]:
|
|
102
|
-
[x.LIST_OF_VALUES_MULTI]:
|
|
103
|
-
[x.RANGE]:
|
|
104
|
-
[x.GREATER_THAN]:
|
|
105
|
-
[x.LESS_THAN]:
|
|
106
|
-
[x.EQUAL]:
|
|
100
|
+
const Me = {
|
|
101
|
+
[x.LIST_OF_VALUES]: ke,
|
|
102
|
+
[x.LIST_OF_VALUES_MULTI]: $e,
|
|
103
|
+
[x.RANGE]: Ae,
|
|
104
|
+
[x.GREATER_THAN]: Fe,
|
|
105
|
+
[x.LESS_THAN]: Ie,
|
|
106
|
+
[x.EQUAL]: Re
|
|
107
107
|
}, R = (e) => {
|
|
108
|
-
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), i =
|
|
108
|
+
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), i = Me[e == null ? void 0 : e.howToSetTheDecision] || Ne;
|
|
109
109
|
return n && i(t) || t || void 0;
|
|
110
|
-
},
|
|
110
|
+
}, Le = (e) => {
|
|
111
111
|
const {
|
|
112
112
|
conditionsAlignment: t,
|
|
113
113
|
decision: n,
|
|
114
114
|
decisionDateElement: i,
|
|
115
115
|
decisionMapper: o,
|
|
116
116
|
loading: r,
|
|
117
|
-
skeleton:
|
|
117
|
+
skeleton: h,
|
|
118
118
|
terms: l,
|
|
119
119
|
textValues: s,
|
|
120
120
|
visibleConditions: g
|
|
121
121
|
} = e;
|
|
122
|
-
return r ? /* @__PURE__ */
|
|
122
|
+
return r ? /* @__PURE__ */ u(p, { direction: "column", gap: "12px", children: [
|
|
123
123
|
/* @__PURE__ */ a(p, { direction: "column", alignItems: "center", children: /* @__PURE__ */ a(
|
|
124
124
|
U,
|
|
125
125
|
{
|
|
@@ -131,7 +131,7 @@ const Le = {
|
|
|
131
131
|
}
|
|
132
132
|
) }, n.ruleName),
|
|
133
133
|
/* @__PURE__ */ a(S, { dashed: !0 }),
|
|
134
|
-
/* @__PURE__ */ a(X, { children: /* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ a(X, { children: /* @__PURE__ */ u(
|
|
135
135
|
p,
|
|
136
136
|
{
|
|
137
137
|
direction: "column",
|
|
@@ -159,7 +159,7 @@ const Le = {
|
|
|
159
159
|
)
|
|
160
160
|
}
|
|
161
161
|
) }) }, c.conditionName)),
|
|
162
|
-
l && /* @__PURE__ */
|
|
162
|
+
l && /* @__PURE__ */ u(D, { children: [
|
|
163
163
|
/* @__PURE__ */ a(S, { dashed: !0 }),
|
|
164
164
|
i && /* @__PURE__ */ a(
|
|
165
165
|
U,
|
|
@@ -174,14 +174,14 @@ const Le = {
|
|
|
174
174
|
]
|
|
175
175
|
}
|
|
176
176
|
) })
|
|
177
|
-
] }) : /* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */ a(
|
|
180
|
-
/* @__PURE__ */ a(
|
|
177
|
+
] }) : /* @__PURE__ */ u(p, { direction: "column", gap: "12px", children: [
|
|
178
|
+
/* @__PURE__ */ u(p, { direction: "column", alignItems: "center", gap: "4px", children: [
|
|
179
|
+
/* @__PURE__ */ a(F, { animated: !0, width: "180px" }),
|
|
180
|
+
/* @__PURE__ */ a(F, { animated: !0, width: "85px" })
|
|
181
181
|
] }, "loading"),
|
|
182
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ u(p, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
183
183
|
/* @__PURE__ */ a(S, { dashed: !0 }),
|
|
184
|
-
/* @__PURE__ */ a(
|
|
184
|
+
/* @__PURE__ */ a(F, { animated: !0, width: "150px" })
|
|
185
185
|
] }),
|
|
186
186
|
/* @__PURE__ */ a(X, { children: /* @__PURE__ */ a(
|
|
187
187
|
p,
|
|
@@ -190,7 +190,7 @@ const Le = {
|
|
|
190
190
|
gap: "12px",
|
|
191
191
|
justifyContent: "space-between",
|
|
192
192
|
height: "203px",
|
|
193
|
-
children:
|
|
193
|
+
children: h.map((c, d) => /* @__PURE__ */ a(J, { children: /* @__PURE__ */ u(
|
|
194
194
|
p,
|
|
195
195
|
{
|
|
196
196
|
direction: "column",
|
|
@@ -198,8 +198,8 @@ const Le = {
|
|
|
198
198
|
alignItems: "start",
|
|
199
199
|
padding: "8px",
|
|
200
200
|
children: [
|
|
201
|
-
/* @__PURE__ */ a(
|
|
202
|
-
/* @__PURE__ */ a(
|
|
201
|
+
/* @__PURE__ */ a(F, { animated: !0, width: "180px" }),
|
|
202
|
+
/* @__PURE__ */ a(F, { animated: !0, width: "85px" })
|
|
203
203
|
]
|
|
204
204
|
}
|
|
205
205
|
) }, `condition-${d}`))
|
|
@@ -208,7 +208,7 @@ const Le = {
|
|
|
208
208
|
] });
|
|
209
209
|
}, ue = (e) => {
|
|
210
210
|
var b;
|
|
211
|
-
const { decision: t, loading: n = !1, textValues: i } = e, o = !!(t != null && t.effectiveFrom), r = !!(t != null && t.validUntil),
|
|
211
|
+
const { decision: t, loading: n = !1, textValues: i } = e, o = !!(t != null && t.effectiveFrom), r = !!(t != null && t.validUntil), h = o && r ? {
|
|
212
212
|
element: {
|
|
213
213
|
labelName: i == null ? void 0 : i.terms,
|
|
214
214
|
value: String(t.effectiveFrom),
|
|
@@ -246,11 +246,11 @@ const Le = {
|
|
|
246
246
|
(T) => !T.hidden
|
|
247
247
|
)) || [], g = Array.from({ length: 5 }), c = !!(!n && t && i && l), d = s.length < 2 ? "start" : "space-between";
|
|
248
248
|
return /* @__PURE__ */ a(
|
|
249
|
-
|
|
249
|
+
Le,
|
|
250
250
|
{
|
|
251
251
|
conditionsAlignment: d,
|
|
252
252
|
decision: t,
|
|
253
|
-
decisionDateElement:
|
|
253
|
+
decisionDateElement: h,
|
|
254
254
|
decisionMapper: l,
|
|
255
255
|
loading: c,
|
|
256
256
|
skeleton: g,
|
|
@@ -259,12 +259,12 @@ const Le = {
|
|
|
259
259
|
visibleConditions: s
|
|
260
260
|
}
|
|
261
261
|
);
|
|
262
|
-
},
|
|
262
|
+
}, Oe = f.div`
|
|
263
263
|
position: relative;
|
|
264
264
|
& > div {
|
|
265
265
|
padding: 24px 16px;
|
|
266
266
|
}
|
|
267
|
-
`,
|
|
267
|
+
`, Ve = f.div`
|
|
268
268
|
background-color: ${({ theme: e }) => {
|
|
269
269
|
var t, n;
|
|
270
270
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || w.palette.neutral.N0;
|
|
@@ -295,16 +295,16 @@ const Le = {
|
|
|
295
295
|
background-color: #ebecf0;
|
|
296
296
|
border-radius: 8px;
|
|
297
297
|
}
|
|
298
|
-
`,
|
|
298
|
+
`, ze = (e) => {
|
|
299
299
|
const { children: t, portalId: n, onCloseModal: i, title: o } = e, r = document.getElementById(n);
|
|
300
300
|
if (!r)
|
|
301
301
|
throw new Error(
|
|
302
302
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
303
303
|
);
|
|
304
|
-
const
|
|
304
|
+
const h = $("(max-width: 400px)");
|
|
305
305
|
return ce(
|
|
306
|
-
/* @__PURE__ */ a(
|
|
307
|
-
/* @__PURE__ */ a(p, { direction: "column", gap: "24px", children: /* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ a(Oe, { smallScreen: h, children: /* @__PURE__ */ a(re, { children: /* @__PURE__ */ a(Ve, { children: /* @__PURE__ */ u(p, { direction: "column", gap: "24px", children: [
|
|
307
|
+
/* @__PURE__ */ a(p, { direction: "column", gap: "24px", children: /* @__PURE__ */ u(p, { alignItems: "center", justifyContent: "space-between", children: [
|
|
308
308
|
/* @__PURE__ */ a(y, { type: "title", size: "large", appearance: "dark", weight: "bold", children: o }),
|
|
309
309
|
/* @__PURE__ */ a(ne, { size: "24px", cursor: "pointer", onClick: i })
|
|
310
310
|
] }) }),
|
|
@@ -312,7 +312,7 @@ const Le = {
|
|
|
312
312
|
] }) }) }) }),
|
|
313
313
|
r
|
|
314
314
|
);
|
|
315
|
-
},
|
|
315
|
+
}, _e = we`
|
|
316
316
|
from {
|
|
317
317
|
opacity: 0;
|
|
318
318
|
transform: translateY(20px);
|
|
@@ -346,7 +346,7 @@ f.div`
|
|
|
346
346
|
}};
|
|
347
347
|
}
|
|
348
348
|
`;
|
|
349
|
-
const
|
|
349
|
+
const Ue = f.div`
|
|
350
350
|
& > div {
|
|
351
351
|
background-color: ${({ theme: e }) => {
|
|
352
352
|
var t, n;
|
|
@@ -362,14 +362,14 @@ const je = f.div`
|
|
|
362
362
|
width: 100%;
|
|
363
363
|
height: 100%;
|
|
364
364
|
& > div {
|
|
365
|
-
animation: ${
|
|
365
|
+
animation: ${_e} 600ms ease-out;
|
|
366
366
|
}
|
|
367
|
-
`,
|
|
367
|
+
`, je = f.div`
|
|
368
368
|
& > div > div {
|
|
369
369
|
border-radius: 8px;
|
|
370
370
|
box-sizing: border-box;
|
|
371
371
|
}
|
|
372
|
-
`,
|
|
372
|
+
`, qe = f.div`
|
|
373
373
|
& > div {
|
|
374
374
|
width: 100%;
|
|
375
375
|
height: 100%;
|
|
@@ -390,7 +390,7 @@ const je = f.div`
|
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
`;
|
|
393
|
-
function
|
|
393
|
+
function Be(e) {
|
|
394
394
|
const { index: t, handleOpenModal: n } = e;
|
|
395
395
|
return /* @__PURE__ */ a(
|
|
396
396
|
P,
|
|
@@ -405,9 +405,9 @@ function He(e) {
|
|
|
405
405
|
`loading-card-${t}`
|
|
406
406
|
);
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function He(e) {
|
|
409
409
|
const { decision: t, controls: n, handleOpenModal: i, handleDelete: o, textValues: r } = e;
|
|
410
|
-
return t ? /* @__PURE__ */ a(pe, { children: /* @__PURE__ */
|
|
410
|
+
return t ? /* @__PURE__ */ a(pe, { children: /* @__PURE__ */ u(p, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
|
|
411
411
|
/* @__PURE__ */ a(y, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.decisionId }),
|
|
412
412
|
/* @__PURE__ */ a(
|
|
413
413
|
P,
|
|
@@ -421,17 +421,17 @@ function Pe(e) {
|
|
|
421
421
|
)
|
|
422
422
|
] }) }, t.decisionId) : null;
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function Pe(e) {
|
|
425
425
|
const {
|
|
426
426
|
customTitleContentAddCard: t,
|
|
427
427
|
index: n,
|
|
428
428
|
handleOpenModal: i,
|
|
429
429
|
shouldRenderEmptyMessage: o
|
|
430
430
|
} = e, r = t || "Agregar decisión";
|
|
431
|
-
return /* @__PURE__ */ a(pe, { children: o ? null : /* @__PURE__ */
|
|
431
|
+
return /* @__PURE__ */ a(pe, { children: o ? null : /* @__PURE__ */ u(p, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
|
|
432
432
|
/* @__PURE__ */ a(y, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
|
|
433
433
|
/* @__PURE__ */ a(
|
|
434
|
-
|
|
434
|
+
Ue,
|
|
435
435
|
{
|
|
436
436
|
onClick: () => i ? i() : null,
|
|
437
437
|
children: /* @__PURE__ */ a(
|
|
@@ -442,7 +442,7 @@ function Ge(e) {
|
|
|
442
442
|
},
|
|
443
443
|
handleView: () => i ? i() : null,
|
|
444
444
|
controls: !1,
|
|
445
|
-
children: /* @__PURE__ */
|
|
445
|
+
children: /* @__PURE__ */ u(p, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
446
446
|
/* @__PURE__ */ a(M, { appearance: "gray", icon: /* @__PURE__ */ a(ae, {}), size: "35px" }),
|
|
447
447
|
/* @__PURE__ */ a(y, { appearance: "gray", type: "body", size: "large", children: r })
|
|
448
448
|
] })
|
|
@@ -452,21 +452,21 @@ function Ge(e) {
|
|
|
452
452
|
)
|
|
453
453
|
] }) }, `add-decision-${n}`);
|
|
454
454
|
}
|
|
455
|
-
const
|
|
456
|
-
loading:
|
|
457
|
-
decision:
|
|
458
|
-
add:
|
|
455
|
+
const Ge = {
|
|
456
|
+
loading: Be,
|
|
457
|
+
decision: He,
|
|
458
|
+
add: Pe
|
|
459
459
|
}, B = (e) => {
|
|
460
|
-
const { type: t } = e, n =
|
|
460
|
+
const { type: t } = e, n = Ge[t];
|
|
461
461
|
return n ? n(e) : null;
|
|
462
|
-
},
|
|
462
|
+
}, Qe = (e) => {
|
|
463
463
|
const {
|
|
464
464
|
controls: t,
|
|
465
465
|
customTitleContentAddCard: n,
|
|
466
466
|
decisions: i,
|
|
467
467
|
loading: o,
|
|
468
468
|
handleOpenModal: r,
|
|
469
|
-
handleDelete:
|
|
469
|
+
handleDelete: h,
|
|
470
470
|
textValues: l
|
|
471
471
|
} = e, s = o ? Array.from({ length: 3 }).map(
|
|
472
472
|
(c, d) => B({
|
|
@@ -476,7 +476,7 @@ const Qe = {
|
|
|
476
476
|
customTitleContentAddCard: n,
|
|
477
477
|
loading: o,
|
|
478
478
|
handleOpenModal: r,
|
|
479
|
-
handleDelete:
|
|
479
|
+
handleDelete: h,
|
|
480
480
|
textValues: l
|
|
481
481
|
})
|
|
482
482
|
) : i == null ? void 0 : i.map(
|
|
@@ -487,7 +487,7 @@ const Qe = {
|
|
|
487
487
|
customTitleContentAddCard: n,
|
|
488
488
|
loading: o,
|
|
489
489
|
handleOpenModal: r,
|
|
490
|
-
handleDelete:
|
|
490
|
+
handleDelete: h,
|
|
491
491
|
textValues: l
|
|
492
492
|
})
|
|
493
493
|
), g = ((i == null ? void 0 : i.length) === 0 || i.length < Math.floor(window.innerWidth / 300)) && !o && t;
|
|
@@ -499,7 +499,7 @@ const Qe = {
|
|
|
499
499
|
customMessageEmptyDecisions: i,
|
|
500
500
|
decisions: o,
|
|
501
501
|
textValues: r,
|
|
502
|
-
decisionTemplate:
|
|
502
|
+
decisionTemplate: h,
|
|
503
503
|
isModalOpen: l,
|
|
504
504
|
selectedDecision: s,
|
|
505
505
|
loading: g,
|
|
@@ -508,7 +508,7 @@ const Qe = {
|
|
|
508
508
|
handleSubmitForm: b,
|
|
509
509
|
handleDelete: T,
|
|
510
510
|
terms: m = !0
|
|
511
|
-
} = e, v =
|
|
511
|
+
} = e, v = $("(max-width: 681px)"), C = $("(max-width: 400px)"), { renderedCards: A, shouldRenderAddCard: _ } = Qe({
|
|
512
512
|
controls: t,
|
|
513
513
|
customTitleContentAddCard: n,
|
|
514
514
|
decisions: o,
|
|
@@ -517,8 +517,8 @@ const Qe = {
|
|
|
517
517
|
handleDelete: T,
|
|
518
518
|
textValues: r
|
|
519
519
|
}), L = (o == null ? void 0 : o.length) === 0 && !g;
|
|
520
|
-
return /* @__PURE__ */
|
|
521
|
-
/* @__PURE__ */ a(
|
|
520
|
+
return /* @__PURE__ */ u(D, { children: [
|
|
521
|
+
/* @__PURE__ */ a(je, { children: /* @__PURE__ */ a(qe, { children: /* @__PURE__ */ a(p, { direction: "column", gap: "16px", padding: "6px", children: L ? /* @__PURE__ */ u(
|
|
522
522
|
p,
|
|
523
523
|
{
|
|
524
524
|
direction: "column",
|
|
@@ -528,9 +528,9 @@ const Qe = {
|
|
|
528
528
|
justifyContent: "center",
|
|
529
529
|
alignItems: "center",
|
|
530
530
|
children: [
|
|
531
|
-
/* @__PURE__ */ a(y, { as: "span", type: "label", size: "large", appearance: "gray", children: i || /* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ a(y, { as: "span", type: "label", size: "large", appearance: "gray", children: i || /* @__PURE__ */ u(D, { children: [
|
|
532
532
|
"Aún NO tienes definidas tasas de interés efectivas . Presiona",
|
|
533
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ u(
|
|
534
534
|
y,
|
|
535
535
|
{
|
|
536
536
|
as: "span",
|
|
@@ -557,7 +557,7 @@ const Qe = {
|
|
|
557
557
|
)
|
|
558
558
|
]
|
|
559
559
|
}
|
|
560
|
-
) : /* @__PURE__ */
|
|
560
|
+
) : /* @__PURE__ */ u(
|
|
561
561
|
le,
|
|
562
562
|
{
|
|
563
563
|
templateColumns: C ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
|
|
@@ -570,7 +570,7 @@ const Qe = {
|
|
|
570
570
|
padding: "6px",
|
|
571
571
|
height: v ? "auto" : "484px",
|
|
572
572
|
children: [
|
|
573
|
-
|
|
573
|
+
A,
|
|
574
574
|
_ && B({
|
|
575
575
|
type: "add",
|
|
576
576
|
index: o == null ? void 0 : o.length,
|
|
@@ -588,15 +588,15 @@ const Qe = {
|
|
|
588
588
|
}
|
|
589
589
|
) }) }) }),
|
|
590
590
|
l && /* @__PURE__ */ a(
|
|
591
|
-
|
|
591
|
+
ze,
|
|
592
592
|
{
|
|
593
593
|
portalId: "modal-portal",
|
|
594
594
|
onCloseModal: d,
|
|
595
595
|
title: s ? "Editar Decisión" : "Nueva decisión",
|
|
596
596
|
children: /* @__PURE__ */ a(
|
|
597
|
-
|
|
597
|
+
ct,
|
|
598
598
|
{
|
|
599
|
-
decision: s ||
|
|
599
|
+
decision: s || h,
|
|
600
600
|
onSubmitEvent: b,
|
|
601
601
|
textValues: r,
|
|
602
602
|
onCancel: () => d ? d() : () => {
|
|
@@ -606,7 +606,7 @@ const Qe = {
|
|
|
606
606
|
}
|
|
607
607
|
)
|
|
608
608
|
] });
|
|
609
|
-
},
|
|
609
|
+
}, Ye = f.div`
|
|
610
610
|
display: flex;
|
|
611
611
|
justify-content: ${({ justifyContent: e }) => e};
|
|
612
612
|
align-items: ${({ alignItems: e }) => e};
|
|
@@ -636,7 +636,7 @@ const Qe = {
|
|
|
636
636
|
direction: i = "column",
|
|
637
637
|
justifyContent: o,
|
|
638
638
|
alignItems: r,
|
|
639
|
-
alignContent:
|
|
639
|
+
alignContent: h,
|
|
640
640
|
height: l,
|
|
641
641
|
width: s,
|
|
642
642
|
gap: g,
|
|
@@ -649,12 +649,12 @@ const Qe = {
|
|
|
649
649
|
scroll: C = !1
|
|
650
650
|
} = e;
|
|
651
651
|
return /* @__PURE__ */ a(
|
|
652
|
-
|
|
652
|
+
Ye,
|
|
653
653
|
{
|
|
654
654
|
direction: i,
|
|
655
655
|
justifyContent: o,
|
|
656
656
|
alignItems: r,
|
|
657
|
-
alignContent:
|
|
657
|
+
alignContent: h,
|
|
658
658
|
height: l,
|
|
659
659
|
width: s,
|
|
660
660
|
wrap: n,
|
|
@@ -669,20 +669,55 @@ const Qe = {
|
|
|
669
669
|
children: t
|
|
670
670
|
}
|
|
671
671
|
);
|
|
672
|
-
},
|
|
673
|
-
|
|
674
|
-
|
|
672
|
+
}, Ke = {
|
|
673
|
+
border: {
|
|
674
|
+
color: w.palette.neutral.N40
|
|
675
675
|
}
|
|
676
|
-
|
|
676
|
+
}, We = f.div`
|
|
677
|
+
border-width: 1px;
|
|
678
|
+
border-style: solid;
|
|
679
|
+
border-color: ${({ theme: e }) => {
|
|
680
|
+
var t, n;
|
|
681
|
+
return ((n = (t = e == null ? void 0 : e.box) == null ? void 0 : t.border) == null ? void 0 : n.color) || Ke.border.color;
|
|
682
|
+
}};
|
|
683
|
+
border-radius: ${({ $borderRadius: e }) => e};
|
|
684
|
+
margin: ${({ $margin: e }) => e};
|
|
685
|
+
padding: ${({ $padding: e }) => e};
|
|
686
|
+
width: ${({ $width: e }) => e};
|
|
687
|
+
height: ${({ $height: e }) => e};
|
|
688
|
+
box-sizing: border-box;
|
|
689
|
+
`;
|
|
690
|
+
function Je(e) {
|
|
691
|
+
const {
|
|
692
|
+
children: t,
|
|
693
|
+
padding: n = "16px",
|
|
694
|
+
margin: i,
|
|
695
|
+
borderRadius: o = "8px",
|
|
696
|
+
width: r,
|
|
697
|
+
height: h
|
|
698
|
+
} = e;
|
|
699
|
+
return /* @__PURE__ */ a(
|
|
700
|
+
We,
|
|
701
|
+
{
|
|
702
|
+
$padding: n,
|
|
703
|
+
$margin: i,
|
|
704
|
+
$borderRadius: o,
|
|
705
|
+
$width: r,
|
|
706
|
+
$height: h,
|
|
707
|
+
children: t
|
|
708
|
+
}
|
|
709
|
+
);
|
|
710
|
+
}
|
|
711
|
+
const Ft = (e) => {
|
|
677
712
|
const {
|
|
678
713
|
appliedFilters: t,
|
|
679
714
|
onClear: n,
|
|
680
715
|
onClick: i,
|
|
681
716
|
noFiltersLabel: o,
|
|
682
717
|
titleClearFilter: r,
|
|
683
|
-
titleFilter:
|
|
718
|
+
titleFilter: h
|
|
684
719
|
} = e, l = !t || t.length === 0;
|
|
685
|
-
return /* @__PURE__ */ a(
|
|
720
|
+
return /* @__PURE__ */ a(Je, { borderRadius: "8px", width: "100%", children: /* @__PURE__ */ u(le, { gap: "12px", templateColumns: "1fr auto auto", width: "100%", children: [
|
|
686
721
|
/* @__PURE__ */ a(
|
|
687
722
|
ge,
|
|
688
723
|
{
|
|
@@ -726,11 +761,11 @@ const Qe = {
|
|
|
726
761
|
iconBefore: /* @__PURE__ */ a(oe, {}),
|
|
727
762
|
onClick: i,
|
|
728
763
|
variant: "outlined",
|
|
729
|
-
children:
|
|
764
|
+
children: h
|
|
730
765
|
}
|
|
731
766
|
)
|
|
732
|
-
] }) })
|
|
733
|
-
},
|
|
767
|
+
] }) });
|
|
768
|
+
}, Xe = f.div`
|
|
734
769
|
display: flex;
|
|
735
770
|
flex-direction: column;
|
|
736
771
|
background-color: ${({ theme: e }) => {
|
|
@@ -743,34 +778,34 @@ const Qe = {
|
|
|
743
778
|
padding: 24px;
|
|
744
779
|
gap: 24px;
|
|
745
780
|
box-sizing: border-box;
|
|
746
|
-
`,
|
|
781
|
+
`, It = (e) => {
|
|
747
782
|
const {
|
|
748
783
|
actionButtonLabel: t,
|
|
749
784
|
cancelButtonLabel: n,
|
|
750
785
|
children: i,
|
|
751
786
|
loading: o,
|
|
752
787
|
onClick: r,
|
|
753
|
-
onCloseModal:
|
|
788
|
+
onCloseModal: h,
|
|
754
789
|
portalId: l,
|
|
755
790
|
title: s
|
|
756
|
-
} = e, g =
|
|
791
|
+
} = e, g = $("(max-width: 768px)"), c = document.getElementById(l);
|
|
757
792
|
if (!c)
|
|
758
793
|
throw new Error(
|
|
759
794
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
760
795
|
);
|
|
761
796
|
return ce(
|
|
762
|
-
/* @__PURE__ */ a(re, { children: /* @__PURE__ */
|
|
763
|
-
/* @__PURE__ */
|
|
764
|
-
/* @__PURE__ */
|
|
797
|
+
/* @__PURE__ */ a(re, { children: /* @__PURE__ */ u(Xe, { $smallScreen: g, children: [
|
|
798
|
+
/* @__PURE__ */ u(p, { direction: "column", gap: "16px", children: [
|
|
799
|
+
/* @__PURE__ */ u(p, { alignContent: "center", justifyContent: "space-between", children: [
|
|
765
800
|
/* @__PURE__ */ a(y, { appearance: "dark", size: "small", type: "headline", children: s }),
|
|
766
|
-
/* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ u(p, { alignItems: "center", children: [
|
|
767
802
|
/* @__PURE__ */ a(y, { children: "Cerrar" }),
|
|
768
803
|
/* @__PURE__ */ a(
|
|
769
804
|
M,
|
|
770
805
|
{
|
|
771
806
|
appearance: "dark",
|
|
772
807
|
icon: /* @__PURE__ */ a(ne, {}),
|
|
773
|
-
onClick:
|
|
808
|
+
onClick: h,
|
|
774
809
|
cursorHover: !0
|
|
775
810
|
}
|
|
776
811
|
)
|
|
@@ -779,12 +814,12 @@ const Qe = {
|
|
|
779
814
|
/* @__PURE__ */ a(S, {})
|
|
780
815
|
] }),
|
|
781
816
|
i,
|
|
782
|
-
/* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ u(p, { gap: "20px", justifyContent: "flex-end", children: [
|
|
783
818
|
/* @__PURE__ */ a(
|
|
784
819
|
N,
|
|
785
820
|
{
|
|
786
821
|
appearance: "gray",
|
|
787
|
-
onClick:
|
|
822
|
+
onClick: h,
|
|
788
823
|
iconBefore: /* @__PURE__ */ a(ie, {}),
|
|
789
824
|
spacing: "wide",
|
|
790
825
|
variant: "outlined",
|
|
@@ -806,11 +841,11 @@ const Qe = {
|
|
|
806
841
|
] }) }),
|
|
807
842
|
c
|
|
808
843
|
);
|
|
809
|
-
},
|
|
810
|
-
const { appliedFilters: t, fields: n, onChange: i, noFiltersLabel: o } = e, r =
|
|
811
|
-
return /* @__PURE__ */
|
|
812
|
-
r && /* @__PURE__ */
|
|
813
|
-
/* @__PURE__ */
|
|
844
|
+
}, Rt = (e) => {
|
|
845
|
+
const { appliedFilters: t, fields: n, onChange: i, noFiltersLabel: o } = e, r = $("(max-width: 768px)"), h = !t || t.length === 0;
|
|
846
|
+
return /* @__PURE__ */ u(p, { direction: "column", gap: "16px", children: [
|
|
847
|
+
r && /* @__PURE__ */ u(D, { children: [
|
|
848
|
+
/* @__PURE__ */ u(p, { gap: "6px", width: "100%", alignItems: "center", children: [
|
|
814
849
|
/* @__PURE__ */ a(M, { appearance: "gray", icon: /* @__PURE__ */ a(oe, {}) }),
|
|
815
850
|
/* @__PURE__ */ a(
|
|
816
851
|
ge,
|
|
@@ -824,7 +859,7 @@ const Qe = {
|
|
|
824
859
|
border: !0,
|
|
825
860
|
width: "100%",
|
|
826
861
|
height: "32px",
|
|
827
|
-
children:
|
|
862
|
+
children: h ? /* @__PURE__ */ a(y, { size: "small", type: "label", appearance: "gray", children: o }) : t == null ? void 0 : t.map((l) => /* @__PURE__ */ a(
|
|
828
863
|
se,
|
|
829
864
|
{
|
|
830
865
|
appearance: "primary",
|
|
@@ -841,10 +876,10 @@ const Qe = {
|
|
|
841
876
|
] }),
|
|
842
877
|
/* @__PURE__ */ a(S, { dashed: !0 })
|
|
843
878
|
] }),
|
|
844
|
-
n.map((l) => /* @__PURE__ */
|
|
879
|
+
n.map((l) => /* @__PURE__ */ u(p, { gap: "6px", alignItems: "center", children: [
|
|
845
880
|
/* @__PURE__ */ a(p, { padding: "22px 0 0 0", children: /* @__PURE__ */ a(M, { appearance: "primary", icon: l.icon }) }),
|
|
846
881
|
/* @__PURE__ */ a(
|
|
847
|
-
|
|
882
|
+
ye,
|
|
848
883
|
{
|
|
849
884
|
disabled: l.disabled,
|
|
850
885
|
invalid: l.invalid,
|
|
@@ -862,7 +897,7 @@ const Qe = {
|
|
|
862
897
|
)
|
|
863
898
|
] }, l.name))
|
|
864
899
|
] });
|
|
865
|
-
},
|
|
900
|
+
}, Mt = (e) => {
|
|
866
901
|
console.log(e);
|
|
867
902
|
const { dataDecision: t, originalDecision: n } = e, i = {
|
|
868
903
|
conditionName: t.ruleName || "",
|
|
@@ -879,7 +914,7 @@ const Qe = {
|
|
|
879
914
|
(o) => o.hidden ? { ...i } : o
|
|
880
915
|
)
|
|
881
916
|
};
|
|
882
|
-
},
|
|
917
|
+
}, Lt = (e) => {
|
|
883
918
|
const { decisions: t } = e;
|
|
884
919
|
return t == null ? void 0 : t.map((n) => {
|
|
885
920
|
var o;
|
|
@@ -898,14 +933,14 @@ const Qe = {
|
|
|
898
933
|
)
|
|
899
934
|
} : n;
|
|
900
935
|
});
|
|
901
|
-
},
|
|
936
|
+
}, Ze = (e) => ({
|
|
902
937
|
schema: H().required("Required").test(
|
|
903
938
|
"non-empty",
|
|
904
939
|
"Value cannot be empty",
|
|
905
940
|
(t) => t != null && t.trim() !== ""
|
|
906
941
|
),
|
|
907
942
|
value: e
|
|
908
|
-
}),
|
|
943
|
+
}), et = (e) => ({
|
|
909
944
|
schema: he().test(
|
|
910
945
|
"isArrayOrString",
|
|
911
946
|
"Must be an array of strings/numbers or a single string",
|
|
@@ -914,7 +949,7 @@ const Qe = {
|
|
|
914
949
|
) : typeof t == "string"
|
|
915
950
|
),
|
|
916
951
|
value: e
|
|
917
|
-
}),
|
|
952
|
+
}), tt = (e) => ({
|
|
918
953
|
schema: he().test(
|
|
919
954
|
"isArrayOrString",
|
|
920
955
|
"Must be an array of strings/numbers or a single string",
|
|
@@ -923,7 +958,7 @@ const Qe = {
|
|
|
923
958
|
) : typeof t == "string"
|
|
924
959
|
),
|
|
925
960
|
value: e
|
|
926
|
-
}),
|
|
961
|
+
}), nt = (e) => {
|
|
927
962
|
const t = (e == null ? void 0 : e.from) ?? 0, n = (e == null ? void 0 : e.to) ?? 0;
|
|
928
963
|
return {
|
|
929
964
|
schema: V({
|
|
@@ -945,15 +980,15 @@ const Qe = {
|
|
|
945
980
|
} : {
|
|
946
981
|
schema: H().required("Required"),
|
|
947
982
|
value: e
|
|
948
|
-
},
|
|
949
|
-
[x.LIST_OF_VALUES]:
|
|
950
|
-
[x.LIST_OF_VALUES_MULTI]:
|
|
951
|
-
[x.RANGE]:
|
|
983
|
+
}, at = {
|
|
984
|
+
[x.LIST_OF_VALUES]: et,
|
|
985
|
+
[x.LIST_OF_VALUES_MULTI]: tt,
|
|
986
|
+
[x.RANGE]: nt,
|
|
952
987
|
[x.GREATER_THAN]: j,
|
|
953
988
|
[x.LESS_THAN]: j,
|
|
954
989
|
[x.EQUAL]: j
|
|
955
|
-
}, Z = (e) =>
|
|
956
|
-
function
|
|
990
|
+
}, Z = (e) => at[e] || Ze;
|
|
991
|
+
function it({
|
|
957
992
|
decision: e,
|
|
958
993
|
onSubmitEvent: t,
|
|
959
994
|
textValues: n
|
|
@@ -1019,10 +1054,10 @@ function at({
|
|
|
1019
1054
|
}
|
|
1020
1055
|
) : g.notRequired()
|
|
1021
1056
|
));
|
|
1022
|
-
const
|
|
1023
|
-
return o =
|
|
1057
|
+
const h = V(r);
|
|
1058
|
+
return o = ve({
|
|
1024
1059
|
initialValues: i,
|
|
1025
|
-
validationSchema:
|
|
1060
|
+
validationSchema: h,
|
|
1026
1061
|
validateOnBlur: !0,
|
|
1027
1062
|
onSubmit: (s) => {
|
|
1028
1063
|
var c;
|
|
@@ -1062,7 +1097,7 @@ function at({
|
|
|
1062
1097
|
});
|
|
1063
1098
|
} };
|
|
1064
1099
|
}
|
|
1065
|
-
const
|
|
1100
|
+
const ot = f.div`
|
|
1066
1101
|
& > div {
|
|
1067
1102
|
border-radius: 8px;
|
|
1068
1103
|
border: 1px solid
|
|
@@ -1071,7 +1106,7 @@ const it = f.div`
|
|
|
1071
1106
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || w.palette.neutral.N30;
|
|
1072
1107
|
}};
|
|
1073
1108
|
}
|
|
1074
|
-
`,
|
|
1109
|
+
`, rt = f.div`
|
|
1075
1110
|
width: 100%;
|
|
1076
1111
|
height: 100%;
|
|
1077
1112
|
overflow-y: auto;
|
|
@@ -1088,27 +1123,27 @@ const it = f.div`
|
|
|
1088
1123
|
background-color: #ebecf0;
|
|
1089
1124
|
border-radius: 8px;
|
|
1090
1125
|
}
|
|
1091
|
-
`,
|
|
1126
|
+
`, lt = (e) => {
|
|
1092
1127
|
const {
|
|
1093
1128
|
checked: t,
|
|
1094
1129
|
children: n,
|
|
1095
1130
|
handleToggleChange: i,
|
|
1096
1131
|
id: o,
|
|
1097
1132
|
labelToggle: r,
|
|
1098
|
-
name:
|
|
1133
|
+
name: h,
|
|
1099
1134
|
valueToggle: l = ""
|
|
1100
1135
|
} = e, [s, g] = z(t), c = (d) => {
|
|
1101
1136
|
g(d.target.checked), i(d);
|
|
1102
1137
|
};
|
|
1103
|
-
return
|
|
1138
|
+
return Ce(() => {
|
|
1104
1139
|
g(t);
|
|
1105
|
-
}, [t]), /* @__PURE__ */
|
|
1140
|
+
}, [t]), /* @__PURE__ */ u(D, { children: [
|
|
1106
1141
|
/* @__PURE__ */ a(p, { children: /* @__PURE__ */ a(
|
|
1107
1142
|
de,
|
|
1108
1143
|
{
|
|
1109
1144
|
checked: s,
|
|
1110
1145
|
id: o,
|
|
1111
|
-
name:
|
|
1146
|
+
name: h,
|
|
1112
1147
|
onChange: c,
|
|
1113
1148
|
size: "small",
|
|
1114
1149
|
value: l,
|
|
@@ -1117,14 +1152,14 @@ const it = f.div`
|
|
|
1117
1152
|
) }),
|
|
1118
1153
|
s && /* @__PURE__ */ a(D, { children: n })
|
|
1119
1154
|
] });
|
|
1120
|
-
},
|
|
1155
|
+
}, st = (e) => {
|
|
1121
1156
|
const {
|
|
1122
1157
|
onHandleStartChange: t,
|
|
1123
1158
|
onHandleEndChange: n,
|
|
1124
1159
|
onCheckClosedChange: i,
|
|
1125
1160
|
labelStart: o,
|
|
1126
1161
|
labelEnd: r,
|
|
1127
|
-
checkedClosed:
|
|
1162
|
+
checkedClosed: h = !1,
|
|
1128
1163
|
required: l = !1,
|
|
1129
1164
|
valueStart: s = "",
|
|
1130
1165
|
valueEnd: g = "",
|
|
@@ -1132,15 +1167,15 @@ const it = f.div`
|
|
|
1132
1167
|
messageEnd: d = "",
|
|
1133
1168
|
statusStart: b = "pending",
|
|
1134
1169
|
statusEnd: T = "pending"
|
|
1135
|
-
} = e, [m, v] = z(
|
|
1170
|
+
} = e, [m, v] = z(h), [C, A] = z(s), [_, L] = z(g), G = ({ target: E }) => {
|
|
1136
1171
|
v(E.checked), i && i(E.checked);
|
|
1137
1172
|
}, me = (E) => {
|
|
1138
|
-
|
|
1173
|
+
A(E.target.value), t(E);
|
|
1139
1174
|
}, be = (E) => {
|
|
1140
1175
|
L(E.target.value), n(E);
|
|
1141
|
-
}, Te =
|
|
1142
|
-
return /* @__PURE__ */
|
|
1143
|
-
/* @__PURE__ */
|
|
1176
|
+
}, Te = $("(max-width: 400px)");
|
|
1177
|
+
return /* @__PURE__ */ u(D, { children: [
|
|
1178
|
+
/* @__PURE__ */ u(p, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
1144
1179
|
/* @__PURE__ */ a(
|
|
1145
1180
|
y,
|
|
1146
1181
|
{
|
|
@@ -1160,7 +1195,7 @@ const it = f.div`
|
|
|
1160
1195
|
wrap: "wrap",
|
|
1161
1196
|
gap: "4px",
|
|
1162
1197
|
children: /* @__PURE__ */ a(
|
|
1163
|
-
|
|
1198
|
+
xe,
|
|
1164
1199
|
{
|
|
1165
1200
|
label: "Cerrada",
|
|
1166
1201
|
onChange: G,
|
|
@@ -1171,7 +1206,7 @@ const it = f.div`
|
|
|
1171
1206
|
}
|
|
1172
1207
|
)
|
|
1173
1208
|
] }),
|
|
1174
|
-
/* @__PURE__ */
|
|
1209
|
+
/* @__PURE__ */ u(
|
|
1175
1210
|
p,
|
|
1176
1211
|
{
|
|
1177
1212
|
direction: Te ? "column" : "row",
|
|
@@ -1208,27 +1243,27 @@ const it = f.div`
|
|
|
1208
1243
|
}
|
|
1209
1244
|
)
|
|
1210
1245
|
] });
|
|
1211
|
-
},
|
|
1246
|
+
}, dt = (e) => {
|
|
1212
1247
|
const {
|
|
1213
1248
|
formik: t,
|
|
1214
1249
|
textValues: n,
|
|
1215
1250
|
onCancel: i,
|
|
1216
1251
|
visibleConditions: o,
|
|
1217
1252
|
normalizedDecision: r,
|
|
1218
|
-
handleToggleNoneChange:
|
|
1253
|
+
handleToggleNoneChange: h,
|
|
1219
1254
|
handleConditionToggleChange: l,
|
|
1220
1255
|
showConditionsError: s,
|
|
1221
1256
|
termStartStatus: g,
|
|
1222
1257
|
termEndStatus: c
|
|
1223
1258
|
} = e;
|
|
1224
|
-
return /* @__PURE__ */ a("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */
|
|
1259
|
+
return /* @__PURE__ */ a("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ u(p, { direction: "column", gap: "24px", children: [
|
|
1225
1260
|
Y({
|
|
1226
1261
|
condition: r,
|
|
1227
1262
|
formik: t,
|
|
1228
1263
|
isDecision: !0
|
|
1229
1264
|
}),
|
|
1230
1265
|
/* @__PURE__ */ a(S, { dashed: !0 }),
|
|
1231
|
-
/* @__PURE__ */ a(
|
|
1266
|
+
/* @__PURE__ */ a(ot, { children: /* @__PURE__ */ a(rt, { children: /* @__PURE__ */ u(
|
|
1232
1267
|
p,
|
|
1233
1268
|
{
|
|
1234
1269
|
direction: "column",
|
|
@@ -1236,7 +1271,7 @@ const it = f.div`
|
|
|
1236
1271
|
gap: "16px",
|
|
1237
1272
|
height: "272px",
|
|
1238
1273
|
children: [
|
|
1239
|
-
/* @__PURE__ */
|
|
1274
|
+
/* @__PURE__ */ u(
|
|
1240
1275
|
p,
|
|
1241
1276
|
{
|
|
1242
1277
|
justifyContent: "space-between",
|
|
@@ -1248,7 +1283,7 @@ const it = f.div`
|
|
|
1248
1283
|
de,
|
|
1249
1284
|
{
|
|
1250
1285
|
id: "toggleNone",
|
|
1251
|
-
onChange: () =>
|
|
1286
|
+
onChange: () => h(!t.values.toggleNone),
|
|
1252
1287
|
checked: t.values.toggleNone,
|
|
1253
1288
|
size: "small",
|
|
1254
1289
|
children: /* @__PURE__ */ a(y, { as: "span", size: "medium", type: "label", weight: "bold", children: n.none })
|
|
@@ -1258,7 +1293,7 @@ const it = f.div`
|
|
|
1258
1293
|
}
|
|
1259
1294
|
),
|
|
1260
1295
|
/* @__PURE__ */ a(p, { direction: "column", gap: "20px", children: o == null ? void 0 : o.map((d) => /* @__PURE__ */ a(
|
|
1261
|
-
|
|
1296
|
+
lt,
|
|
1262
1297
|
{
|
|
1263
1298
|
id: `toggle-${d.conditionName}`,
|
|
1264
1299
|
name: `toggle.${d.conditionName}`,
|
|
@@ -1275,10 +1310,10 @@ const it = f.div`
|
|
|
1275
1310
|
]
|
|
1276
1311
|
}
|
|
1277
1312
|
) }) }),
|
|
1278
|
-
n.terms && /* @__PURE__ */
|
|
1313
|
+
n.terms && /* @__PURE__ */ u(D, { children: [
|
|
1279
1314
|
/* @__PURE__ */ a(S, { dashed: !0 }),
|
|
1280
1315
|
/* @__PURE__ */ a(
|
|
1281
|
-
|
|
1316
|
+
st,
|
|
1282
1317
|
{
|
|
1283
1318
|
labelStart: n.termStart,
|
|
1284
1319
|
labelEnd: n.termEnd,
|
|
@@ -1299,14 +1334,14 @@ const it = f.div`
|
|
|
1299
1334
|
] }),
|
|
1300
1335
|
/* @__PURE__ */ a(S, {}),
|
|
1301
1336
|
s && /* @__PURE__ */ a(y, { type: "label", size: "medium", appearance: "danger", children: String(t.errors.conditionsThatEstablishesTheDecision) }),
|
|
1302
|
-
/* @__PURE__ */
|
|
1337
|
+
/* @__PURE__ */ u(p, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
1303
1338
|
/* @__PURE__ */ a(N, { appearance: "gray", onClick: i, children: n.cancel }),
|
|
1304
1339
|
/* @__PURE__ */ a(N, { type: "submit", children: n.confirm })
|
|
1305
1340
|
] })
|
|
1306
1341
|
] }) });
|
|
1307
|
-
},
|
|
1342
|
+
}, ct = (e) => {
|
|
1308
1343
|
var T;
|
|
1309
|
-
const { decision: t, onSubmitEvent: n, textValues: i, onCancel: o } = e, { formik: r, handleToggleNoneChange:
|
|
1344
|
+
const { decision: t, onSubmitEvent: n, textValues: i, onCancel: o } = e, { formik: r, handleToggleNoneChange: h } = it({
|
|
1310
1345
|
decision: t,
|
|
1311
1346
|
onSubmitEvent: n,
|
|
1312
1347
|
textValues: i
|
|
@@ -1320,7 +1355,7 @@ const it = f.div`
|
|
|
1320
1355
|
(m) => !m.hidden
|
|
1321
1356
|
)) || [], g = !!r.errors.conditionsThatEstablishesTheDecision && r.submitCount > 0, c = r.touched.effectiveFrom ? r.errors.effectiveFrom ? "invalid" : "valid" : void 0, d = r.touched.validUntil ? r.errors.validUntil ? "invalid" : "valid" : void 0;
|
|
1322
1357
|
return /* @__PURE__ */ a(
|
|
1323
|
-
|
|
1358
|
+
dt,
|
|
1324
1359
|
{
|
|
1325
1360
|
formik: r,
|
|
1326
1361
|
onCancel: o,
|
|
@@ -1328,7 +1363,7 @@ const it = f.div`
|
|
|
1328
1363
|
decision: t,
|
|
1329
1364
|
visibleConditions: s,
|
|
1330
1365
|
normalizedDecision: l,
|
|
1331
|
-
handleToggleNoneChange:
|
|
1366
|
+
handleToggleNoneChange: h,
|
|
1332
1367
|
handleConditionToggleChange: (m, v) => (C) => {
|
|
1333
1368
|
if (!C)
|
|
1334
1369
|
r.setFieldValue(
|
|
@@ -1340,10 +1375,10 @@ const it = f.div`
|
|
|
1340
1375
|
!1
|
|
1341
1376
|
);
|
|
1342
1377
|
else {
|
|
1343
|
-
const
|
|
1378
|
+
const A = v ? [] : "";
|
|
1344
1379
|
r.setFieldValue(
|
|
1345
1380
|
`conditionsThatEstablishesTheDecision.${m}`,
|
|
1346
|
-
|
|
1381
|
+
A
|
|
1347
1382
|
);
|
|
1348
1383
|
}
|
|
1349
1384
|
},
|
|
@@ -1352,7 +1387,7 @@ const it = f.div`
|
|
|
1352
1387
|
termEndStatus: d
|
|
1353
1388
|
}
|
|
1354
1389
|
);
|
|
1355
|
-
},
|
|
1390
|
+
}, Ot = (e) => {
|
|
1356
1391
|
var o;
|
|
1357
1392
|
const { decisionTemplate: t } = e, n = { ...t }, i = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
|
|
1358
1393
|
(r) => r.switchPlaces
|
|
@@ -1368,7 +1403,7 @@ const it = f.div`
|
|
|
1368
1403
|
(r) => r.conditionName === i.conditionName ? { ...r, hidden: !0 } : r
|
|
1369
1404
|
)
|
|
1370
1405
|
} : n;
|
|
1371
|
-
},
|
|
1406
|
+
}, Vt = (e) => {
|
|
1372
1407
|
const { decisions: t } = e;
|
|
1373
1408
|
return t == null ? void 0 : t.map((n) => {
|
|
1374
1409
|
var o;
|
|
@@ -1387,17 +1422,17 @@ const it = f.div`
|
|
|
1387
1422
|
)
|
|
1388
1423
|
} : n;
|
|
1389
1424
|
});
|
|
1390
|
-
}, I = /* @__PURE__ */ new Map(),
|
|
1425
|
+
}, I = /* @__PURE__ */ new Map(), ht = (e, t) => I.get(`${t}:${e}`), ut = (e, t, n) => {
|
|
1391
1426
|
const i = `${t}:${e}`;
|
|
1392
1427
|
if (I.set(i, n), I.size > 1e3) {
|
|
1393
1428
|
const o = I.keys().next().value;
|
|
1394
1429
|
o !== void 0 && I.delete(o);
|
|
1395
1430
|
}
|
|
1396
|
-
}, ee = /* @__PURE__ */ new Map(),
|
|
1431
|
+
}, ee = /* @__PURE__ */ new Map(), pt = 1e3, gt = (e) => {
|
|
1397
1432
|
const t = Date.now(), n = ee.get(e) || 0;
|
|
1398
|
-
return t - n <
|
|
1399
|
-
},
|
|
1400
|
-
const t =
|
|
1433
|
+
return t - n < pt ? !0 : (ee.set(e, t), !1);
|
|
1434
|
+
}, mt = (e) => {
|
|
1435
|
+
const t = De(e);
|
|
1401
1436
|
return {
|
|
1402
1437
|
spa: "es",
|
|
1403
1438
|
eng: "en",
|
|
@@ -1406,18 +1441,18 @@ const it = f.div`
|
|
|
1406
1441
|
ita: "it",
|
|
1407
1442
|
por: "pt"
|
|
1408
1443
|
}[t] || "en";
|
|
1409
|
-
},
|
|
1410
|
-
const o = `${t}:${e}`, r =
|
|
1444
|
+
}, bt = async (e, t, { url: n, apiKey: i }) => {
|
|
1445
|
+
const o = `${t}:${e}`, r = ht(e, t);
|
|
1411
1446
|
if (r) return r;
|
|
1412
|
-
if (
|
|
1447
|
+
if (gt(o))
|
|
1413
1448
|
return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
|
|
1414
|
-
const
|
|
1449
|
+
const h = mt(e);
|
|
1415
1450
|
try {
|
|
1416
|
-
const { data: l } = await
|
|
1451
|
+
const { data: l } = await Se.post(
|
|
1417
1452
|
n,
|
|
1418
1453
|
{
|
|
1419
1454
|
q: e,
|
|
1420
|
-
source:
|
|
1455
|
+
source: h,
|
|
1421
1456
|
target: t,
|
|
1422
1457
|
api_key: i
|
|
1423
1458
|
},
|
|
@@ -1427,26 +1462,26 @@ const it = f.div`
|
|
|
1427
1462
|
}
|
|
1428
1463
|
}
|
|
1429
1464
|
), s = (l == null ? void 0 : l.translatedText) || e;
|
|
1430
|
-
return
|
|
1465
|
+
return ut(e, t, s), s;
|
|
1431
1466
|
} catch (l) {
|
|
1432
1467
|
return console.warn(`[Translation] Failed for: "${e}"`, l), e;
|
|
1433
1468
|
}
|
|
1434
|
-
},
|
|
1469
|
+
}, Tt = (e) => typeof e == "string" && e.trim().length > 0, te = async (e, t, n) => {
|
|
1435
1470
|
const i = await Promise.all(
|
|
1436
1471
|
Object.entries(e).map(async ([o, r]) => {
|
|
1437
|
-
if (
|
|
1438
|
-
const
|
|
1439
|
-
return [o,
|
|
1472
|
+
if (Tt(r)) {
|
|
1473
|
+
const h = await bt(r, t, n);
|
|
1474
|
+
return [o, h];
|
|
1440
1475
|
} else if (Array.isArray(r)) {
|
|
1441
|
-
const
|
|
1476
|
+
const h = await Promise.all(
|
|
1442
1477
|
r.map(
|
|
1443
1478
|
async (l) => typeof l == "object" && l !== null ? await te(l, t, n) : l
|
|
1444
1479
|
)
|
|
1445
1480
|
);
|
|
1446
|
-
return [o,
|
|
1481
|
+
return [o, h];
|
|
1447
1482
|
} else if (typeof r == "object" && r !== null) {
|
|
1448
|
-
const
|
|
1449
|
-
return [o,
|
|
1483
|
+
const h = await te(r, t, n);
|
|
1484
|
+
return [o, h];
|
|
1450
1485
|
} else
|
|
1451
1486
|
return [o, r];
|
|
1452
1487
|
})
|
|
@@ -1458,14 +1493,14 @@ export {
|
|
|
1458
1493
|
ue as BusinessRuleView,
|
|
1459
1494
|
At as BusinessRules,
|
|
1460
1495
|
Ft as Filter,
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1496
|
+
It as FilterModal,
|
|
1497
|
+
Rt as FormFilter,
|
|
1498
|
+
ze as ModalRules,
|
|
1499
|
+
ct as RulesForm,
|
|
1500
|
+
Mt as revertSortedDataSampleSwitchPlaces,
|
|
1501
|
+
Lt as revertSortedDataSwitchPlaces,
|
|
1502
|
+
Ot as sortDisplayDataSampleSwitchPlaces,
|
|
1503
|
+
Vt as sortDisplayDataSwitchPlaces,
|
|
1469
1504
|
te as translateObject,
|
|
1470
|
-
|
|
1505
|
+
bt as translateText
|
|
1471
1506
|
};
|