@isettingkit/business-rules 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.d.ts +8 -2
- package/dist/index.es.js +478 -440
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { MdOutlineDelete as
|
|
3
|
-
import { inube as
|
|
1
|
+
import { jsx as i, jsxs as h, Fragment as D } from "react/jsx-runtime";
|
|
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 u, Divider as S, Icon as M, Text as x, SkeletonLine as $, useMediaQuery as A, Blanket as re, Button as N, Grid as le, Box as ye, Tag as se, Checkpicker as xe, Toggle as de, Checkbox as we, Date as Q } from "@inubekit/inubekit";
|
|
4
4
|
import f, { keyframes as ve } from "styled-components";
|
|
5
|
-
import { ValueDataType as k, ValueHowToSetUp as
|
|
5
|
+
import { ValueDataType as k, ValueHowToSetUp as O, DecisionConditionRender as Y } from "@isettingkit/input";
|
|
6
6
|
import { DecisionViewConditionRenderer as z } from "@isettingkit/view";
|
|
7
|
-
import { createPortal as
|
|
8
|
-
import { useFormik as
|
|
9
|
-
import { string as H, mixed as
|
|
10
|
-
import { useState as
|
|
11
|
-
import
|
|
12
|
-
import { franc as
|
|
13
|
-
const
|
|
7
|
+
import { createPortal as ce } from "react-dom";
|
|
8
|
+
import { useFormik as Ce } from "formik";
|
|
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 _, useEffect as Se } from "react";
|
|
11
|
+
import De from "axios";
|
|
12
|
+
import { franc as Ee } from "franc-min";
|
|
13
|
+
const Ne = f.div`
|
|
14
14
|
border-radius: 8px;
|
|
15
|
-
border: 1px solid ${
|
|
15
|
+
border: 1px solid ${w.palette.neutral.N30};
|
|
16
16
|
box-sizing: border-box;
|
|
17
17
|
display: flex;
|
|
18
18
|
flex-direction: column;
|
|
@@ -42,20 +42,20 @@ f.div`
|
|
|
42
42
|
}
|
|
43
43
|
`;
|
|
44
44
|
const P = (e) => {
|
|
45
|
-
const { children: t, controls: n = !0, handleDelete: a, id:
|
|
46
|
-
return /* @__PURE__ */ i(
|
|
45
|
+
const { children: t, controls: n = !0, handleDelete: a, id: r } = e;
|
|
46
|
+
return /* @__PURE__ */ i(Ne, { children: /* @__PURE__ */ h(u, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
47
47
|
t,
|
|
48
|
-
n && /* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */ i(
|
|
48
|
+
n && /* @__PURE__ */ h(D, { children: [
|
|
49
|
+
/* @__PURE__ */ i(S, {}),
|
|
50
50
|
/* @__PURE__ */ i(u, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ i(
|
|
51
|
-
|
|
51
|
+
M,
|
|
52
52
|
{
|
|
53
53
|
cursorHover: !0,
|
|
54
54
|
appearance: "danger",
|
|
55
55
|
size: "24px",
|
|
56
|
-
icon: /* @__PURE__ */ i(
|
|
56
|
+
icon: /* @__PURE__ */ i(fe, {}),
|
|
57
57
|
onClick: () => {
|
|
58
|
-
a(
|
|
58
|
+
a(r);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
) })
|
|
@@ -67,7 +67,7 @@ const P = (e) => {
|
|
|
67
67
|
border: 1px solid
|
|
68
68
|
${({ theme: e }) => {
|
|
69
69
|
var t, n;
|
|
70
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) ||
|
|
70
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || w.palette.neutral.N30;
|
|
71
71
|
}};
|
|
72
72
|
}
|
|
73
73
|
`, X = f.div`
|
|
@@ -88,46 +88,46 @@ const P = (e) => {
|
|
|
88
88
|
background-color: #ebecf0;
|
|
89
89
|
border-radius: 8px;
|
|
90
90
|
}
|
|
91
|
-
`,
|
|
91
|
+
`, ke = (e) => e.value, Ae = (e) => e.value, Fe = (e) => e.value, $e = (e) => ({
|
|
92
92
|
from: e.from ?? "",
|
|
93
93
|
to: e.to ?? ""
|
|
94
|
-
}),
|
|
94
|
+
}), Ie = (e) => e.value, Re = (e) => e.value, Me = (e) => e.value;
|
|
95
95
|
var y = /* @__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))(y || {});
|
|
96
|
-
const
|
|
97
|
-
[y.LIST_OF_VALUES]:
|
|
98
|
-
[y.LIST_OF_VALUES_MULTI]:
|
|
99
|
-
[y.RANGE]:
|
|
100
|
-
[y.GREATER_THAN]:
|
|
101
|
-
[y.LESS_THAN]:
|
|
102
|
-
[y.EQUAL]:
|
|
103
|
-
},
|
|
104
|
-
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), a =
|
|
96
|
+
const Le = {
|
|
97
|
+
[y.LIST_OF_VALUES]: Ae,
|
|
98
|
+
[y.LIST_OF_VALUES_MULTI]: Fe,
|
|
99
|
+
[y.RANGE]: $e,
|
|
100
|
+
[y.GREATER_THAN]: Ie,
|
|
101
|
+
[y.LESS_THAN]: Re,
|
|
102
|
+
[y.EQUAL]: Me
|
|
103
|
+
}, R = (e) => {
|
|
104
|
+
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), a = Le[e == null ? void 0 : e.howToSetTheDecision] || ke;
|
|
105
105
|
return n && a(t) || t || void 0;
|
|
106
|
-
},
|
|
106
|
+
}, Oe = (e) => {
|
|
107
107
|
const {
|
|
108
108
|
conditionsAlignment: t,
|
|
109
109
|
decision: n,
|
|
110
110
|
decisionDateElement: a,
|
|
111
|
-
decisionMapper:
|
|
112
|
-
loading:
|
|
113
|
-
skeleton:
|
|
114
|
-
terms:
|
|
115
|
-
textValues:
|
|
116
|
-
visibleConditions:
|
|
111
|
+
decisionMapper: r,
|
|
112
|
+
loading: o,
|
|
113
|
+
skeleton: p,
|
|
114
|
+
terms: c,
|
|
115
|
+
textValues: s,
|
|
116
|
+
visibleConditions: g
|
|
117
117
|
} = e;
|
|
118
|
-
return
|
|
118
|
+
return o ? /* @__PURE__ */ h(u, { direction: "column", gap: "12px", children: [
|
|
119
119
|
/* @__PURE__ */ i(u, { direction: "column", alignItems: "center", children: /* @__PURE__ */ i(
|
|
120
120
|
z,
|
|
121
121
|
{
|
|
122
|
-
element:
|
|
123
|
-
valueData:
|
|
124
|
-
|
|
122
|
+
element: r,
|
|
123
|
+
valueData: R(
|
|
124
|
+
r
|
|
125
125
|
),
|
|
126
126
|
type: "decision"
|
|
127
127
|
}
|
|
128
128
|
) }, n.ruleName),
|
|
129
|
-
/* @__PURE__ */ i(
|
|
130
|
-
/* @__PURE__ */ i(X, { children: /* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ i(S, { dashed: !0 }),
|
|
130
|
+
/* @__PURE__ */ i(X, { children: /* @__PURE__ */ h(
|
|
131
131
|
u,
|
|
132
132
|
{
|
|
133
133
|
direction: "column",
|
|
@@ -143,20 +143,20 @@ const Me = {
|
|
|
143
143
|
appearance: "dark",
|
|
144
144
|
weight: "bold",
|
|
145
145
|
textAlign: "center",
|
|
146
|
-
children:
|
|
146
|
+
children: s.factsThatConditionIt
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
|
-
|
|
149
|
+
g.map((d) => /* @__PURE__ */ i(J, { children: /* @__PURE__ */ i(u, { direction: "column", padding: "8px", children: /* @__PURE__ */ i(
|
|
150
150
|
z,
|
|
151
151
|
{
|
|
152
|
-
element: { ...
|
|
153
|
-
valueData:
|
|
154
|
-
|
|
152
|
+
element: { ...d, value: d.value },
|
|
153
|
+
valueData: R(
|
|
154
|
+
d
|
|
155
155
|
)
|
|
156
156
|
}
|
|
157
|
-
) }) },
|
|
158
|
-
|
|
159
|
-
/* @__PURE__ */ i(
|
|
157
|
+
) }) }, d.conditionName)),
|
|
158
|
+
c && /* @__PURE__ */ h(D, { children: [
|
|
159
|
+
/* @__PURE__ */ i(S, { dashed: !0 }),
|
|
160
160
|
a && /* @__PURE__ */ i(
|
|
161
161
|
z,
|
|
162
162
|
{
|
|
@@ -164,20 +164,20 @@ const Me = {
|
|
|
164
164
|
valueData: a.valueData,
|
|
165
165
|
type: "decision"
|
|
166
166
|
},
|
|
167
|
-
|
|
167
|
+
s.terms
|
|
168
168
|
)
|
|
169
169
|
] })
|
|
170
170
|
]
|
|
171
171
|
}
|
|
172
172
|
) })
|
|
173
|
-
] }) : /* @__PURE__ */
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
/* @__PURE__ */ i(
|
|
176
|
-
/* @__PURE__ */ i(
|
|
173
|
+
] }) : /* @__PURE__ */ h(u, { direction: "column", gap: "12px", children: [
|
|
174
|
+
/* @__PURE__ */ h(u, { direction: "column", alignItems: "center", gap: "4px", children: [
|
|
175
|
+
/* @__PURE__ */ i($, { animated: !0, width: "180px" }),
|
|
176
|
+
/* @__PURE__ */ i($, { animated: !0, width: "85px" })
|
|
177
177
|
] }, "loading"),
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */ i(
|
|
180
|
-
/* @__PURE__ */ i(
|
|
178
|
+
/* @__PURE__ */ h(u, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
179
|
+
/* @__PURE__ */ i(S, { dashed: !0 }),
|
|
180
|
+
/* @__PURE__ */ i($, { animated: !0, width: "150px" })
|
|
181
181
|
] }),
|
|
182
182
|
/* @__PURE__ */ i(X, { children: /* @__PURE__ */ i(
|
|
183
183
|
u,
|
|
@@ -186,7 +186,7 @@ const Me = {
|
|
|
186
186
|
gap: "12px",
|
|
187
187
|
justifyContent: "space-between",
|
|
188
188
|
height: "203px",
|
|
189
|
-
children:
|
|
189
|
+
children: p.map((d, l) => /* @__PURE__ */ i(J, { children: /* @__PURE__ */ h(
|
|
190
190
|
u,
|
|
191
191
|
{
|
|
192
192
|
direction: "column",
|
|
@@ -194,76 +194,76 @@ const Me = {
|
|
|
194
194
|
alignItems: "start",
|
|
195
195
|
padding: "8px",
|
|
196
196
|
children: [
|
|
197
|
-
/* @__PURE__ */ i(
|
|
198
|
-
/* @__PURE__ */ i(
|
|
197
|
+
/* @__PURE__ */ i($, { animated: !0, width: "180px" }),
|
|
198
|
+
/* @__PURE__ */ i($, { animated: !0, width: "85px" })
|
|
199
199
|
]
|
|
200
200
|
}
|
|
201
201
|
) }, `condition-${l}`))
|
|
202
202
|
}
|
|
203
203
|
) })
|
|
204
204
|
] });
|
|
205
|
-
},
|
|
205
|
+
}, ue = (e) => {
|
|
206
206
|
var b;
|
|
207
|
-
const { decision: t, loading: n = !1, textValues: a } = e,
|
|
207
|
+
const { decision: t, loading: n = !1, textValues: a } = e, r = !!(t != null && t.effectiveFrom), o = !!(t != null && t.validUntil), p = r && o ? {
|
|
208
208
|
element: {
|
|
209
209
|
labelName: a == null ? void 0 : a.terms,
|
|
210
210
|
value: String(t.effectiveFrom),
|
|
211
|
-
howToSetTheDecision:
|
|
211
|
+
howToSetTheDecision: O.RANGE,
|
|
212
212
|
decisionDataType: k.DATE
|
|
213
213
|
},
|
|
214
|
-
valueData:
|
|
214
|
+
valueData: R({
|
|
215
215
|
labelName: a == null ? void 0 : a.terms,
|
|
216
216
|
value: {
|
|
217
217
|
from: String(t.effectiveFrom),
|
|
218
218
|
to: String(t.validUntil)
|
|
219
219
|
},
|
|
220
|
-
howToSetTheDecision:
|
|
220
|
+
howToSetTheDecision: O.RANGE,
|
|
221
221
|
decisionDataType: k.DATE
|
|
222
222
|
})
|
|
223
|
-
} :
|
|
223
|
+
} : r && !o ? {
|
|
224
224
|
element: {
|
|
225
225
|
labelName: a == null ? void 0 : a.terms,
|
|
226
226
|
value: String(t.effectiveFrom),
|
|
227
|
-
howToSetTheDecision:
|
|
227
|
+
howToSetTheDecision: O.EQUAL,
|
|
228
228
|
decisionDataType: k.DATE
|
|
229
229
|
},
|
|
230
|
-
valueData:
|
|
230
|
+
valueData: R({
|
|
231
231
|
labelName: a == null ? void 0 : a.terms,
|
|
232
232
|
value: String(t.effectiveFrom),
|
|
233
|
-
howToSetTheDecision:
|
|
233
|
+
howToSetTheDecision: O.EQUAL,
|
|
234
234
|
decisionDataType: k.DATE
|
|
235
235
|
})
|
|
236
|
-
} : null,
|
|
236
|
+
} : null, c = t ? {
|
|
237
237
|
labelName: t.labelName || "",
|
|
238
238
|
decisionDataType: t.decisionDataType || "alphabetical",
|
|
239
|
-
value:
|
|
239
|
+
value: R(t),
|
|
240
240
|
howToSetTheDecision: t.howToSetTheDecision || "EqualTo"
|
|
241
|
-
} : null,
|
|
241
|
+
} : null, s = ((b = t == null ? void 0 : t.conditionsThatEstablishesTheDecision) == null ? void 0 : b.filter(
|
|
242
242
|
(T) => !T.hidden
|
|
243
|
-
)) || [],
|
|
243
|
+
)) || [], g = Array.from({ length: 5 }), d = !!(!n && t && a && c), l = s.length < 2 ? "start" : "space-between";
|
|
244
244
|
return /* @__PURE__ */ i(
|
|
245
|
-
|
|
245
|
+
Oe,
|
|
246
246
|
{
|
|
247
247
|
conditionsAlignment: l,
|
|
248
248
|
decision: t,
|
|
249
|
-
decisionDateElement:
|
|
250
|
-
decisionMapper:
|
|
251
|
-
loading:
|
|
252
|
-
skeleton:
|
|
249
|
+
decisionDateElement: p,
|
|
250
|
+
decisionMapper: c,
|
|
251
|
+
loading: d,
|
|
252
|
+
skeleton: g,
|
|
253
253
|
terms: !!(a != null && a.terms),
|
|
254
254
|
textValues: a,
|
|
255
|
-
visibleConditions:
|
|
255
|
+
visibleConditions: s
|
|
256
256
|
}
|
|
257
257
|
);
|
|
258
|
-
},
|
|
258
|
+
}, Ve = f.div`
|
|
259
259
|
position: relative;
|
|
260
260
|
& > div {
|
|
261
261
|
padding: 24px 16px;
|
|
262
262
|
}
|
|
263
|
-
`,
|
|
263
|
+
`, _e = f.div`
|
|
264
264
|
background-color: ${({ theme: e }) => {
|
|
265
265
|
var t, n;
|
|
266
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) ||
|
|
266
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || w.palette.neutral.N0;
|
|
267
267
|
}};
|
|
268
268
|
max-width: 450px;
|
|
269
269
|
max-height: 90vh;
|
|
@@ -292,23 +292,23 @@ const Me = {
|
|
|
292
292
|
border-radius: 8px;
|
|
293
293
|
}
|
|
294
294
|
`, Ue = (e) => {
|
|
295
|
-
const { children: t, portalId: n, onCloseModal: a, title:
|
|
296
|
-
if (!
|
|
295
|
+
const { children: t, portalId: n, onCloseModal: a, title: r } = e, o = document.getElementById(n);
|
|
296
|
+
if (!o)
|
|
297
297
|
throw new Error(
|
|
298
298
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
299
299
|
);
|
|
300
|
-
const
|
|
301
|
-
return
|
|
302
|
-
/* @__PURE__ */ i(
|
|
303
|
-
/* @__PURE__ */ i(u, { direction: "column", gap: "24px", children: /* @__PURE__ */
|
|
304
|
-
/* @__PURE__ */ i(x, { type: "title", size: "large", appearance: "dark", weight: "bold", children:
|
|
300
|
+
const p = A("(max-width: 400px)");
|
|
301
|
+
return ce(
|
|
302
|
+
/* @__PURE__ */ i(Ve, { smallScreen: p, children: /* @__PURE__ */ i(re, { children: /* @__PURE__ */ i(_e, { children: /* @__PURE__ */ h(u, { direction: "column", gap: "24px", children: [
|
|
303
|
+
/* @__PURE__ */ i(u, { direction: "column", gap: "24px", children: /* @__PURE__ */ h(u, { alignItems: "center", justifyContent: "space-between", children: [
|
|
304
|
+
/* @__PURE__ */ i(x, { type: "title", size: "large", appearance: "dark", weight: "bold", children: r }),
|
|
305
305
|
/* @__PURE__ */ i(ne, { size: "24px", cursor: "pointer", onClick: a })
|
|
306
306
|
] }) }),
|
|
307
307
|
t
|
|
308
308
|
] }) }) }) }),
|
|
309
|
-
|
|
309
|
+
o
|
|
310
310
|
);
|
|
311
|
-
},
|
|
311
|
+
}, ze = ve`
|
|
312
312
|
from {
|
|
313
313
|
opacity: 0;
|
|
314
314
|
transform: translateY(20px);
|
|
@@ -323,7 +323,7 @@ f.div`
|
|
|
323
323
|
border: 1px solid
|
|
324
324
|
${({ theme: e }) => {
|
|
325
325
|
var t, n;
|
|
326
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) ||
|
|
326
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || w.palette.neutral.N30;
|
|
327
327
|
}};
|
|
328
328
|
box-sizing: border-box;
|
|
329
329
|
display: flex;
|
|
@@ -338,15 +338,15 @@ f.div`
|
|
|
338
338
|
border: 1px solid
|
|
339
339
|
${({ theme: e }) => {
|
|
340
340
|
var t, n;
|
|
341
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) ||
|
|
341
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || w.palette.neutral.N30;
|
|
342
342
|
}};
|
|
343
343
|
}
|
|
344
344
|
`;
|
|
345
|
-
const
|
|
345
|
+
const je = f.div`
|
|
346
346
|
& > div {
|
|
347
347
|
background-color: ${({ theme: e }) => {
|
|
348
348
|
var t, n;
|
|
349
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N10) ||
|
|
349
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N10) || w.palette.neutral.N10;
|
|
350
350
|
}};
|
|
351
351
|
justify-content: center;
|
|
352
352
|
}
|
|
@@ -354,18 +354,18 @@ const ze = f.div`
|
|
|
354
354
|
width: 100%;
|
|
355
355
|
height: 100%;
|
|
356
356
|
padding-bottom: 12px;
|
|
357
|
-
`,
|
|
357
|
+
`, pe = f.div`
|
|
358
358
|
width: 100%;
|
|
359
359
|
height: 100%;
|
|
360
360
|
& > div {
|
|
361
|
-
animation: ${
|
|
361
|
+
animation: ${ze} 600ms ease-out;
|
|
362
362
|
}
|
|
363
|
-
`,
|
|
363
|
+
`, qe = f.div`
|
|
364
364
|
& > div > div {
|
|
365
365
|
border-radius: 8px;
|
|
366
366
|
box-sizing: border-box;
|
|
367
367
|
}
|
|
368
|
-
`,
|
|
368
|
+
`, Be = f.div`
|
|
369
369
|
& > div {
|
|
370
370
|
width: 100%;
|
|
371
371
|
height: 100%;
|
|
@@ -386,7 +386,7 @@ const ze = f.div`
|
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
`;
|
|
389
|
-
function
|
|
389
|
+
function He(e) {
|
|
390
390
|
const { index: t, handleOpenModal: n } = e;
|
|
391
391
|
return /* @__PURE__ */ i(
|
|
392
392
|
P,
|
|
@@ -396,38 +396,38 @@ function Be(e) {
|
|
|
396
396
|
},
|
|
397
397
|
handleView: () => n ? n() : null,
|
|
398
398
|
controls: !1,
|
|
399
|
-
children: /* @__PURE__ */ i(
|
|
399
|
+
children: /* @__PURE__ */ i(ue, { loading: !0 })
|
|
400
400
|
},
|
|
401
401
|
`loading-card-${t}`
|
|
402
402
|
);
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
const { decision: t, controls: n, handleOpenModal: a, handleDelete:
|
|
406
|
-
return t ? /* @__PURE__ */ i(
|
|
404
|
+
function Pe(e) {
|
|
405
|
+
const { decision: t, controls: n, handleOpenModal: a, handleDelete: r, textValues: o } = e;
|
|
406
|
+
return t ? /* @__PURE__ */ i(pe, { children: /* @__PURE__ */ h(u, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
|
|
407
407
|
/* @__PURE__ */ i(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.decisionId }),
|
|
408
408
|
/* @__PURE__ */ i(
|
|
409
409
|
P,
|
|
410
410
|
{
|
|
411
411
|
id: t.decisionId,
|
|
412
|
-
handleDelete: () =>
|
|
412
|
+
handleDelete: () => r ? r(t.decisionId) : null,
|
|
413
413
|
handleView: () => a ? a(t) : null,
|
|
414
414
|
controls: n,
|
|
415
|
-
children: /* @__PURE__ */ i(
|
|
415
|
+
children: /* @__PURE__ */ i(ue, { decision: t, textValues: o })
|
|
416
416
|
}
|
|
417
417
|
)
|
|
418
418
|
] }) }, t.decisionId) : null;
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function Ge(e) {
|
|
421
421
|
const {
|
|
422
422
|
customTitleContentAddCard: t,
|
|
423
423
|
index: n,
|
|
424
424
|
handleOpenModal: a,
|
|
425
|
-
shouldRenderEmptyMessage:
|
|
426
|
-
} = e,
|
|
427
|
-
return /* @__PURE__ */ i(
|
|
425
|
+
shouldRenderEmptyMessage: r
|
|
426
|
+
} = e, o = t || "Agregar decisión";
|
|
427
|
+
return /* @__PURE__ */ i(pe, { children: r ? null : /* @__PURE__ */ h(u, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
|
|
428
428
|
/* @__PURE__ */ i(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
|
|
429
429
|
/* @__PURE__ */ i(
|
|
430
|
-
|
|
430
|
+
je,
|
|
431
431
|
{
|
|
432
432
|
onClick: () => a ? a() : null,
|
|
433
433
|
children: /* @__PURE__ */ i(
|
|
@@ -438,9 +438,9 @@ function Pe(e) {
|
|
|
438
438
|
},
|
|
439
439
|
handleView: () => a ? a() : null,
|
|
440
440
|
controls: !1,
|
|
441
|
-
children: /* @__PURE__ */
|
|
442
|
-
/* @__PURE__ */ i(
|
|
443
|
-
/* @__PURE__ */ i(x, { appearance: "gray", type: "body", size: "large", children:
|
|
441
|
+
children: /* @__PURE__ */ h(u, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
442
|
+
/* @__PURE__ */ i(M, { appearance: "gray", icon: /* @__PURE__ */ i(ae, {}), size: "35px" }),
|
|
443
|
+
/* @__PURE__ */ i(x, { appearance: "gray", type: "body", size: "large", children: o })
|
|
444
444
|
] })
|
|
445
445
|
}
|
|
446
446
|
)
|
|
@@ -448,85 +448,85 @@ function Pe(e) {
|
|
|
448
448
|
)
|
|
449
449
|
] }) }, `add-decision-${n}`);
|
|
450
450
|
}
|
|
451
|
-
const
|
|
452
|
-
loading:
|
|
453
|
-
decision:
|
|
454
|
-
add:
|
|
451
|
+
const Qe = {
|
|
452
|
+
loading: He,
|
|
453
|
+
decision: Pe,
|
|
454
|
+
add: Ge
|
|
455
455
|
}, B = (e) => {
|
|
456
|
-
const { type: t } = e, n =
|
|
456
|
+
const { type: t } = e, n = Qe[t];
|
|
457
457
|
return n ? n(e) : null;
|
|
458
|
-
},
|
|
458
|
+
}, Ye = (e) => {
|
|
459
459
|
const {
|
|
460
460
|
controls: t,
|
|
461
461
|
customTitleContentAddCard: n,
|
|
462
462
|
decisions: a,
|
|
463
|
-
loading:
|
|
464
|
-
handleOpenModal:
|
|
465
|
-
handleDelete:
|
|
466
|
-
textValues:
|
|
467
|
-
} = e,
|
|
468
|
-
(
|
|
463
|
+
loading: r,
|
|
464
|
+
handleOpenModal: o,
|
|
465
|
+
handleDelete: p,
|
|
466
|
+
textValues: c
|
|
467
|
+
} = e, s = r ? Array.from({ length: 3 }).map(
|
|
468
|
+
(d, l) => B({
|
|
469
469
|
type: "loading",
|
|
470
470
|
index: l,
|
|
471
471
|
controls: t,
|
|
472
472
|
customTitleContentAddCard: n,
|
|
473
|
-
loading:
|
|
474
|
-
handleOpenModal:
|
|
475
|
-
handleDelete:
|
|
476
|
-
textValues:
|
|
473
|
+
loading: r,
|
|
474
|
+
handleOpenModal: o,
|
|
475
|
+
handleDelete: p,
|
|
476
|
+
textValues: c
|
|
477
477
|
})
|
|
478
478
|
) : a == null ? void 0 : a.map(
|
|
479
|
-
(
|
|
479
|
+
(d) => B({
|
|
480
480
|
type: "decision",
|
|
481
|
-
decision:
|
|
481
|
+
decision: d,
|
|
482
482
|
controls: t,
|
|
483
483
|
customTitleContentAddCard: n,
|
|
484
|
-
loading:
|
|
485
|
-
handleOpenModal:
|
|
486
|
-
handleDelete:
|
|
487
|
-
textValues:
|
|
484
|
+
loading: r,
|
|
485
|
+
handleOpenModal: o,
|
|
486
|
+
handleDelete: p,
|
|
487
|
+
textValues: c
|
|
488
488
|
})
|
|
489
|
-
),
|
|
490
|
-
return { renderedCards:
|
|
491
|
-
},
|
|
489
|
+
), g = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !r && t;
|
|
490
|
+
return { renderedCards: s, shouldRenderAddCard: g };
|
|
491
|
+
}, kt = (e) => {
|
|
492
492
|
const {
|
|
493
493
|
controls: t = !0,
|
|
494
494
|
customTitleContentAddCard: n,
|
|
495
495
|
customMessageEmptyDecisions: a,
|
|
496
|
-
decisions:
|
|
497
|
-
textValues:
|
|
498
|
-
decisionTemplate:
|
|
499
|
-
isModalOpen:
|
|
500
|
-
selectedDecision:
|
|
501
|
-
loading:
|
|
502
|
-
handleOpenModal:
|
|
496
|
+
decisions: r,
|
|
497
|
+
textValues: o,
|
|
498
|
+
decisionTemplate: p,
|
|
499
|
+
isModalOpen: c,
|
|
500
|
+
selectedDecision: s,
|
|
501
|
+
loading: g,
|
|
502
|
+
handleOpenModal: d,
|
|
503
503
|
handleCloseModal: l,
|
|
504
504
|
handleSubmitForm: b,
|
|
505
505
|
handleDelete: T,
|
|
506
506
|
terms: m = !0
|
|
507
|
-
} = e,
|
|
507
|
+
} = e, v = A("(max-width: 681px)"), C = A("(max-width: 400px)"), { renderedCards: F, shouldRenderAddCard: U } = Ye({
|
|
508
508
|
controls: t,
|
|
509
509
|
customTitleContentAddCard: n,
|
|
510
|
-
decisions:
|
|
511
|
-
loading:
|
|
512
|
-
handleOpenModal:
|
|
510
|
+
decisions: r,
|
|
511
|
+
loading: g,
|
|
512
|
+
handleOpenModal: d,
|
|
513
513
|
handleDelete: T,
|
|
514
|
-
textValues:
|
|
515
|
-
}),
|
|
516
|
-
return /* @__PURE__ */
|
|
517
|
-
/* @__PURE__ */ i(
|
|
514
|
+
textValues: o
|
|
515
|
+
}), L = (r == null ? void 0 : r.length) === 0 && !g;
|
|
516
|
+
return /* @__PURE__ */ h(D, { children: [
|
|
517
|
+
/* @__PURE__ */ i(qe, { children: /* @__PURE__ */ i(Be, { children: /* @__PURE__ */ i(u, { direction: "column", gap: "16px", padding: "6px", children: L ? /* @__PURE__ */ h(
|
|
518
518
|
u,
|
|
519
519
|
{
|
|
520
520
|
direction: "column",
|
|
521
521
|
gap: "28px",
|
|
522
522
|
width: "100%",
|
|
523
|
-
height:
|
|
523
|
+
height: v ? "auto" : "435px",
|
|
524
524
|
justifyContent: "center",
|
|
525
525
|
alignItems: "center",
|
|
526
526
|
children: [
|
|
527
|
-
/* @__PURE__ */ i(x, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ i(x, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */ h(D, { children: [
|
|
528
528
|
"Aún NO tienes definidas tasas de interés efectivas . Presiona",
|
|
529
|
-
/* @__PURE__ */
|
|
529
|
+
/* @__PURE__ */ h(
|
|
530
530
|
x,
|
|
531
531
|
{
|
|
532
532
|
as: "span",
|
|
@@ -547,14 +547,14 @@ const Ge = {
|
|
|
547
547
|
N,
|
|
548
548
|
{
|
|
549
549
|
iconBefore: /* @__PURE__ */ i(ae, {}),
|
|
550
|
-
onClick: () =>
|
|
550
|
+
onClick: () => d ? d() : null,
|
|
551
551
|
children: n || "Agregar decisión"
|
|
552
552
|
}
|
|
553
553
|
)
|
|
554
554
|
]
|
|
555
555
|
}
|
|
556
|
-
) : /* @__PURE__ */
|
|
557
|
-
|
|
556
|
+
) : /* @__PURE__ */ h(
|
|
557
|
+
le,
|
|
558
558
|
{
|
|
559
559
|
templateColumns: C ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
|
|
560
560
|
autoFlow: "row dense",
|
|
@@ -564,37 +564,37 @@ const Ge = {
|
|
|
564
564
|
autoRows: "1fr",
|
|
565
565
|
justifyItems: "center",
|
|
566
566
|
padding: "6px",
|
|
567
|
-
height:
|
|
567
|
+
height: v ? "auto" : "484px",
|
|
568
568
|
children: [
|
|
569
|
-
|
|
570
|
-
|
|
569
|
+
F,
|
|
570
|
+
U && B({
|
|
571
571
|
type: "add",
|
|
572
|
-
index:
|
|
572
|
+
index: r == null ? void 0 : r.length,
|
|
573
573
|
controls: t,
|
|
574
574
|
customTitleContentAddCard: n,
|
|
575
575
|
customMessageEmptyDecisions: a,
|
|
576
|
-
loading:
|
|
577
|
-
handleOpenModal:
|
|
576
|
+
loading: g,
|
|
577
|
+
handleOpenModal: d,
|
|
578
578
|
handleDelete: T,
|
|
579
|
-
textValues:
|
|
580
|
-
shouldRenderEmptyMessage:
|
|
579
|
+
textValues: o,
|
|
580
|
+
shouldRenderEmptyMessage: L,
|
|
581
581
|
terms: m
|
|
582
582
|
})
|
|
583
583
|
]
|
|
584
584
|
}
|
|
585
585
|
) }) }) }),
|
|
586
|
-
|
|
586
|
+
c && /* @__PURE__ */ i(
|
|
587
587
|
Ue,
|
|
588
588
|
{
|
|
589
589
|
portalId: "modal-portal",
|
|
590
590
|
onCloseModal: l,
|
|
591
|
-
title:
|
|
591
|
+
title: s ? "Editar Decisión" : "Nueva decisión",
|
|
592
592
|
children: /* @__PURE__ */ i(
|
|
593
593
|
st,
|
|
594
594
|
{
|
|
595
|
-
decision:
|
|
595
|
+
decision: s || p,
|
|
596
596
|
onSubmitEvent: b,
|
|
597
|
-
textValues:
|
|
597
|
+
textValues: o,
|
|
598
598
|
onCancel: () => l ? l() : () => {
|
|
599
599
|
}
|
|
600
600
|
}
|
|
@@ -602,7 +602,7 @@ const Ge = {
|
|
|
602
602
|
}
|
|
603
603
|
)
|
|
604
604
|
] });
|
|
605
|
-
},
|
|
605
|
+
}, Ke = f.div`
|
|
606
606
|
display: flex;
|
|
607
607
|
justify-content: ${({ justifyContent: e }) => e};
|
|
608
608
|
align-items: ${({ alignItems: e }) => e};
|
|
@@ -615,61 +615,61 @@ const Ge = {
|
|
|
615
615
|
margin: ${({ margin: e }) => e};
|
|
616
616
|
padding: ${({ padding: e }) => e};
|
|
617
617
|
background: ${({ background: e, theme: t }) => {
|
|
618
|
-
var n, a,
|
|
619
|
-
return e ? `${((a = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : a.N10) ||
|
|
618
|
+
var n, a, r, o;
|
|
619
|
+
return e ? `${((a = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : a.N10) || w.palette.neutral.N10}` : `${((o = (r = t == null ? void 0 : t.palette) == null ? void 0 : r.neutral) == null ? void 0 : o.N0) || w.palette.neutral.N0}`;
|
|
620
620
|
}};
|
|
621
621
|
border: ${({ border: e, theme: t }) => {
|
|
622
622
|
var n, a;
|
|
623
|
-
return e ? `1px solid ${((a = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : a.N40) ||
|
|
623
|
+
return e ? `1px solid ${((a = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : a.N40) || w.palette.neutral.N40}` : "none";
|
|
624
624
|
}};
|
|
625
625
|
border-radius: ${({ borderRadius: e }) => e};
|
|
626
626
|
box-sizing: ${({ boxSizing: e }) => e};
|
|
627
627
|
overflow-y: ${({ scroll: e }) => e ? "scroll" : "none"};
|
|
628
|
-
`,
|
|
628
|
+
`, ge = (e) => {
|
|
629
629
|
const {
|
|
630
630
|
children: t,
|
|
631
631
|
wrap: n,
|
|
632
632
|
direction: a = "column",
|
|
633
|
-
justifyContent:
|
|
634
|
-
alignItems:
|
|
635
|
-
alignContent:
|
|
636
|
-
height:
|
|
637
|
-
width:
|
|
638
|
-
gap:
|
|
639
|
-
background:
|
|
633
|
+
justifyContent: r,
|
|
634
|
+
alignItems: o,
|
|
635
|
+
alignContent: p,
|
|
636
|
+
height: c,
|
|
637
|
+
width: s,
|
|
638
|
+
gap: g,
|
|
639
|
+
background: d,
|
|
640
640
|
borderRadius: l,
|
|
641
641
|
border: b,
|
|
642
642
|
margin: T = "0px",
|
|
643
643
|
padding: m = "0px",
|
|
644
|
-
boxSizing:
|
|
644
|
+
boxSizing: v,
|
|
645
645
|
scroll: C = !1
|
|
646
646
|
} = e;
|
|
647
647
|
return /* @__PURE__ */ i(
|
|
648
|
-
|
|
648
|
+
Ke,
|
|
649
649
|
{
|
|
650
650
|
direction: a,
|
|
651
|
-
justifyContent:
|
|
652
|
-
alignItems:
|
|
653
|
-
alignContent:
|
|
654
|
-
height:
|
|
655
|
-
width:
|
|
651
|
+
justifyContent: r,
|
|
652
|
+
alignItems: o,
|
|
653
|
+
alignContent: p,
|
|
654
|
+
height: c,
|
|
655
|
+
width: s,
|
|
656
656
|
wrap: n,
|
|
657
|
-
gap:
|
|
658
|
-
background:
|
|
657
|
+
gap: g,
|
|
658
|
+
background: d,
|
|
659
659
|
border: b,
|
|
660
660
|
margin: T,
|
|
661
661
|
padding: m,
|
|
662
662
|
borderRadius: l,
|
|
663
|
-
boxSizing:
|
|
663
|
+
boxSizing: v,
|
|
664
664
|
scroll: C,
|
|
665
665
|
children: t
|
|
666
666
|
}
|
|
667
667
|
);
|
|
668
|
-
},
|
|
669
|
-
const { appliedFilters: t, onClear: n, onClick: a, titleClearFilter:
|
|
670
|
-
return /* @__PURE__ */ i(
|
|
668
|
+
}, At = (e) => {
|
|
669
|
+
const { appliedFilters: t, onClear: n, onClick: a, titleClearFilter: r, titleFilter: o } = e, p = !t || t.length === 0;
|
|
670
|
+
return /* @__PURE__ */ i(ye, { borderRadius: "8px", children: /* @__PURE__ */ h(le, { gap: "12px", templateColumns: "1fr auto auto", children: [
|
|
671
671
|
/* @__PURE__ */ i(
|
|
672
|
-
|
|
672
|
+
ge,
|
|
673
673
|
{
|
|
674
674
|
background: !0,
|
|
675
675
|
borderRadius: "8px",
|
|
@@ -678,15 +678,15 @@ const Ge = {
|
|
|
678
678
|
gap: "8px",
|
|
679
679
|
alignItems: "center",
|
|
680
680
|
padding: "0px 8px",
|
|
681
|
-
children: t == null ? void 0 : t.map((
|
|
682
|
-
|
|
681
|
+
children: t == null ? void 0 : t.map((c) => /* @__PURE__ */ i(
|
|
682
|
+
se,
|
|
683
683
|
{
|
|
684
684
|
appearance: "primary",
|
|
685
685
|
displayIcon: !0,
|
|
686
|
-
icon:
|
|
687
|
-
label:
|
|
686
|
+
icon: c.icon,
|
|
687
|
+
label: c.label
|
|
688
688
|
},
|
|
689
|
-
|
|
689
|
+
c.label
|
|
690
690
|
))
|
|
691
691
|
}
|
|
692
692
|
),
|
|
@@ -694,21 +694,21 @@ const Ge = {
|
|
|
694
694
|
N,
|
|
695
695
|
{
|
|
696
696
|
cursorHover: !0,
|
|
697
|
-
disabled:
|
|
698
|
-
iconBefore: /* @__PURE__ */ i(
|
|
697
|
+
disabled: p,
|
|
698
|
+
iconBefore: /* @__PURE__ */ i(ie, {}),
|
|
699
699
|
onClick: n,
|
|
700
700
|
variant: "outlined",
|
|
701
|
-
children:
|
|
701
|
+
children: r
|
|
702
702
|
}
|
|
703
703
|
),
|
|
704
704
|
/* @__PURE__ */ i(
|
|
705
705
|
N,
|
|
706
706
|
{
|
|
707
707
|
cursorHover: !0,
|
|
708
|
-
iconBefore: /* @__PURE__ */ i(
|
|
708
|
+
iconBefore: /* @__PURE__ */ i(oe, {}),
|
|
709
709
|
onClick: a,
|
|
710
710
|
variant: "outlined",
|
|
711
|
-
children:
|
|
711
|
+
children: o
|
|
712
712
|
}
|
|
713
713
|
)
|
|
714
714
|
] }) });
|
|
@@ -717,56 +717,57 @@ const Ge = {
|
|
|
717
717
|
flex-direction: column;
|
|
718
718
|
background-color: ${({ theme: e }) => {
|
|
719
719
|
var t, n;
|
|
720
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) ||
|
|
720
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || w.palette.neutral.N0;
|
|
721
721
|
}};
|
|
722
|
-
width: ${({ smallScreen: e }) => e ? "
|
|
722
|
+
width: ${({ $smallScreen: e }) => e ? "auto" : "450px"};
|
|
723
723
|
height: auto;
|
|
724
724
|
border-radius: 8px;
|
|
725
725
|
padding: 24px;
|
|
726
726
|
gap: 24px;
|
|
727
727
|
box-sizing: border-box;
|
|
728
|
-
`,
|
|
728
|
+
`, Ft = (e) => {
|
|
729
729
|
const {
|
|
730
730
|
actionButtonLabel: t,
|
|
731
731
|
cancelButtonLabel: n,
|
|
732
732
|
children: a,
|
|
733
|
-
loading:
|
|
734
|
-
onClick:
|
|
735
|
-
onCloseModal:
|
|
736
|
-
portalId:
|
|
737
|
-
title:
|
|
738
|
-
} = e,
|
|
739
|
-
if (!
|
|
733
|
+
loading: r,
|
|
734
|
+
onClick: o,
|
|
735
|
+
onCloseModal: p,
|
|
736
|
+
portalId: c,
|
|
737
|
+
title: s
|
|
738
|
+
} = e, g = A("(max-width: 768px)"), d = document.getElementById(c);
|
|
739
|
+
if (!d)
|
|
740
740
|
throw new Error(
|
|
741
741
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
742
742
|
);
|
|
743
|
-
return
|
|
744
|
-
/* @__PURE__ */ i(
|
|
745
|
-
/* @__PURE__ */
|
|
746
|
-
/* @__PURE__ */
|
|
747
|
-
/* @__PURE__ */ i(x, { appearance: "dark", size: "small", type: "headline", children:
|
|
748
|
-
/* @__PURE__ */
|
|
743
|
+
return ce(
|
|
744
|
+
/* @__PURE__ */ i(re, { children: /* @__PURE__ */ h(We, { $smallScreen: g, children: [
|
|
745
|
+
/* @__PURE__ */ h(u, { direction: "column", gap: "16px", children: [
|
|
746
|
+
/* @__PURE__ */ h(u, { alignContent: "center", justifyContent: "space-between", children: [
|
|
747
|
+
/* @__PURE__ */ i(x, { appearance: "dark", size: "small", type: "headline", children: s }),
|
|
748
|
+
/* @__PURE__ */ h(u, { alignItems: "center", children: [
|
|
749
749
|
/* @__PURE__ */ i(x, { children: "Cerrar" }),
|
|
750
750
|
/* @__PURE__ */ i(
|
|
751
|
-
|
|
751
|
+
M,
|
|
752
752
|
{
|
|
753
753
|
appearance: "dark",
|
|
754
754
|
icon: /* @__PURE__ */ i(ne, {}),
|
|
755
|
-
onClick:
|
|
755
|
+
onClick: p,
|
|
756
756
|
cursorHover: !0
|
|
757
757
|
}
|
|
758
758
|
)
|
|
759
759
|
] })
|
|
760
760
|
] }),
|
|
761
|
-
/* @__PURE__ */ i(
|
|
761
|
+
/* @__PURE__ */ i(S, {})
|
|
762
762
|
] }),
|
|
763
763
|
a,
|
|
764
|
-
/* @__PURE__ */
|
|
764
|
+
/* @__PURE__ */ h(u, { gap: "20px", justifyContent: "flex-end", children: [
|
|
765
765
|
/* @__PURE__ */ i(
|
|
766
766
|
N,
|
|
767
767
|
{
|
|
768
768
|
appearance: "gray",
|
|
769
|
-
onClick:
|
|
769
|
+
onClick: p,
|
|
770
|
+
iconBefore: /* @__PURE__ */ i(ie, {}),
|
|
770
771
|
spacing: "wide",
|
|
771
772
|
variant: "outlined",
|
|
772
773
|
children: n
|
|
@@ -776,8 +777,8 @@ const Ge = {
|
|
|
776
777
|
N,
|
|
777
778
|
{
|
|
778
779
|
appearance: "primary",
|
|
779
|
-
loading:
|
|
780
|
-
onClick:
|
|
780
|
+
loading: r,
|
|
781
|
+
onClick: o,
|
|
781
782
|
spacing: "wide",
|
|
782
783
|
variant: "filled",
|
|
783
784
|
children: t
|
|
@@ -785,31 +786,61 @@ const Ge = {
|
|
|
785
786
|
)
|
|
786
787
|
] })
|
|
787
788
|
] }) }),
|
|
788
|
-
|
|
789
|
+
d
|
|
789
790
|
);
|
|
791
|
+
}, $t = (e) => {
|
|
792
|
+
const { appliedFilters: t, fields: n, onChange: a } = e, r = A("(max-width: 768px)");
|
|
793
|
+
return /* @__PURE__ */ h(u, { direction: "column", gap: "16px", children: [
|
|
794
|
+
r && (t != null && t.length) && t.length > 0 ? /* @__PURE__ */ h(D, { children: [
|
|
795
|
+
/* @__PURE__ */ h(u, { gap: "6px", children: [
|
|
796
|
+
/* @__PURE__ */ i(M, { appearance: "primary", icon: /* @__PURE__ */ i(oe, {}) }),
|
|
797
|
+
/* @__PURE__ */ i(
|
|
798
|
+
ge,
|
|
799
|
+
{
|
|
800
|
+
background: !0,
|
|
801
|
+
borderRadius: "8px",
|
|
802
|
+
height: "100%",
|
|
803
|
+
direction: "row",
|
|
804
|
+
gap: "8px",
|
|
805
|
+
alignItems: "center",
|
|
806
|
+
padding: "0px 8px",
|
|
807
|
+
children: t == null ? void 0 : t.map((o) => /* @__PURE__ */ i(
|
|
808
|
+
se,
|
|
809
|
+
{
|
|
810
|
+
appearance: "primary",
|
|
811
|
+
displayIcon: !0,
|
|
812
|
+
icon: o.icon,
|
|
813
|
+
label: o.label
|
|
814
|
+
},
|
|
815
|
+
o.label
|
|
816
|
+
))
|
|
817
|
+
}
|
|
818
|
+
)
|
|
819
|
+
] }),
|
|
820
|
+
/* @__PURE__ */ i(S, { dashed: !0 })
|
|
821
|
+
] }) : null,
|
|
822
|
+
n.map((o) => /* @__PURE__ */ h(u, { gap: "6px", alignItems: "center", children: [
|
|
823
|
+
/* @__PURE__ */ i(u, { padding: "22px 0 0 0", children: /* @__PURE__ */ i(M, { appearance: "primary", icon: o.icon }) }),
|
|
824
|
+
/* @__PURE__ */ i(
|
|
825
|
+
xe,
|
|
826
|
+
{
|
|
827
|
+
disabled: o.disabled,
|
|
828
|
+
invalid: o.invalid,
|
|
829
|
+
label: o.label,
|
|
830
|
+
message: o.message,
|
|
831
|
+
name: o.name,
|
|
832
|
+
onChange: a,
|
|
833
|
+
options: o.options,
|
|
834
|
+
placeholder: o.placeholder,
|
|
835
|
+
required: o.required,
|
|
836
|
+
values: o.values,
|
|
837
|
+
fullwidth: !0
|
|
838
|
+
},
|
|
839
|
+
o.name
|
|
840
|
+
)
|
|
841
|
+
] }, o.name))
|
|
842
|
+
] });
|
|
790
843
|
}, It = (e) => {
|
|
791
|
-
const { fields: t, onChange: n } = e;
|
|
792
|
-
return /* @__PURE__ */ i(u, { direction: "column", gap: "16px", children: t.map((a) => /* @__PURE__ */ p(u, { gap: "6px", alignItems: "center", children: [
|
|
793
|
-
/* @__PURE__ */ i(u, { padding: "22px 0 0 0", children: /* @__PURE__ */ i(U, { appearance: "primary", icon: a.icon }) }),
|
|
794
|
-
/* @__PURE__ */ i(
|
|
795
|
-
ye,
|
|
796
|
-
{
|
|
797
|
-
disabled: a.disabled,
|
|
798
|
-
invalid: a.invalid,
|
|
799
|
-
label: a.label,
|
|
800
|
-
message: a.message,
|
|
801
|
-
name: a.name,
|
|
802
|
-
onChange: n,
|
|
803
|
-
options: a.options,
|
|
804
|
-
placeholder: a.placeholder,
|
|
805
|
-
required: a.required,
|
|
806
|
-
values: a.values,
|
|
807
|
-
fullwidth: !0
|
|
808
|
-
},
|
|
809
|
-
a.name
|
|
810
|
-
)
|
|
811
|
-
] }, a.name)) });
|
|
812
|
-
}, Rt = (e) => {
|
|
813
844
|
console.log(e);
|
|
814
845
|
const { dataDecision: t, originalDecision: n } = e, a = {
|
|
815
846
|
conditionName: t.ruleName || "",
|
|
@@ -823,15 +854,15 @@ const Ge = {
|
|
|
823
854
|
return {
|
|
824
855
|
...n,
|
|
825
856
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
826
|
-
(
|
|
857
|
+
(r) => r.hidden ? { ...a } : r
|
|
827
858
|
)
|
|
828
859
|
};
|
|
829
|
-
},
|
|
860
|
+
}, Rt = (e) => {
|
|
830
861
|
const { decisions: t } = e;
|
|
831
862
|
return t == null ? void 0 : t.map((n) => {
|
|
832
|
-
var
|
|
833
|
-
const a = (
|
|
834
|
-
(
|
|
863
|
+
var r;
|
|
864
|
+
const a = (r = n.conditionsThatEstablishesTheDecision) == null ? void 0 : r.find(
|
|
865
|
+
(o) => o.hidden
|
|
835
866
|
);
|
|
836
867
|
return a ? {
|
|
837
868
|
...n,
|
|
@@ -841,7 +872,7 @@ const Ge = {
|
|
|
841
872
|
value: n.value,
|
|
842
873
|
howToSetTheDecision: n.howToSetTheDecision,
|
|
843
874
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
844
|
-
(
|
|
875
|
+
(o) => o.hidden ? { ...a, hidden: !1 } : o
|
|
845
876
|
)
|
|
846
877
|
} : n;
|
|
847
878
|
});
|
|
@@ -853,7 +884,7 @@ const Ge = {
|
|
|
853
884
|
),
|
|
854
885
|
value: e
|
|
855
886
|
}), Xe = (e) => ({
|
|
856
|
-
schema:
|
|
887
|
+
schema: he().test(
|
|
857
888
|
"isArrayOrString",
|
|
858
889
|
"Must be an array of strings/numbers or a single string",
|
|
859
890
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -862,7 +893,7 @@ const Ge = {
|
|
|
862
893
|
),
|
|
863
894
|
value: e
|
|
864
895
|
}), Ze = (e) => ({
|
|
865
|
-
schema:
|
|
896
|
+
schema: he().test(
|
|
866
897
|
"isArrayOrString",
|
|
867
898
|
"Must be an array of strings/numbers or a single string",
|
|
868
899
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -873,14 +904,14 @@ const Ge = {
|
|
|
873
904
|
}), et = (e) => {
|
|
874
905
|
const t = (e == null ? void 0 : e.from) ?? 0, n = (e == null ? void 0 : e.to) ?? 0;
|
|
875
906
|
return {
|
|
876
|
-
schema:
|
|
907
|
+
schema: V({
|
|
877
908
|
from: q().required("Range From is required").max(n, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
|
|
878
909
|
to: q().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
|
|
879
910
|
"is-greater",
|
|
880
911
|
"To value must be greater than From value",
|
|
881
912
|
function(a) {
|
|
882
|
-
const { from:
|
|
883
|
-
return a >
|
|
913
|
+
const { from: r } = this.parent;
|
|
914
|
+
return a > r;
|
|
884
915
|
}
|
|
885
916
|
)
|
|
886
917
|
}),
|
|
@@ -917,21 +948,21 @@ function nt({
|
|
|
917
948
|
checkClosed: !1,
|
|
918
949
|
terms: !0
|
|
919
950
|
};
|
|
920
|
-
let
|
|
921
|
-
const
|
|
951
|
+
let r;
|
|
952
|
+
const o = {
|
|
922
953
|
ruleName: H().required("Name is required"),
|
|
923
954
|
value: K(() => Z(
|
|
924
|
-
|
|
955
|
+
r.values.howToSetTheDecision
|
|
925
956
|
)(
|
|
926
|
-
|
|
927
|
-
|
|
957
|
+
r.values.value,
|
|
958
|
+
r.values.decisionDataType
|
|
928
959
|
).schema),
|
|
929
|
-
conditionsThatEstablishesTheDecision: K((
|
|
960
|
+
conditionsThatEstablishesTheDecision: K((s, { parent: g }) => {
|
|
930
961
|
var b;
|
|
931
|
-
if ((
|
|
962
|
+
if ((g == null ? void 0 : g.toggleNone) && Object.keys(g.conditionsThatEstablishesTheDecision || {}).length > 0) return V().shape({});
|
|
932
963
|
const l = (b = e.conditionsThatEstablishesTheDecision) == null ? void 0 : b.reduce(
|
|
933
964
|
(T, m) => {
|
|
934
|
-
if (
|
|
965
|
+
if (r.values.conditionsThatEstablishesTheDecision[m.conditionName] !== void 0) {
|
|
935
966
|
const C = Z(
|
|
936
967
|
m.howToSetTheCondition
|
|
937
968
|
);
|
|
@@ -944,7 +975,7 @@ function nt({
|
|
|
944
975
|
},
|
|
945
976
|
{}
|
|
946
977
|
);
|
|
947
|
-
return
|
|
978
|
+
return V(l).test(
|
|
948
979
|
"at-least-one-condition",
|
|
949
980
|
"It must be at least one condition in order for the decision to be validated correctly.",
|
|
950
981
|
(T) => T ? Object.values(T).some(
|
|
@@ -953,56 +984,56 @@ function nt({
|
|
|
953
984
|
);
|
|
954
985
|
})
|
|
955
986
|
};
|
|
956
|
-
n.terms && (
|
|
987
|
+
n.terms && (o.effectiveFrom = W().required(
|
|
957
988
|
"effective From date is required"
|
|
958
|
-
),
|
|
989
|
+
), o.validUntil = W().when(
|
|
959
990
|
"checkClosed",
|
|
960
|
-
(
|
|
991
|
+
(s, g, { parent: d }) => (d == null ? void 0 : d.checkClosed) ? g.required("valid Until date is required").test(
|
|
961
992
|
"is-after-startDate",
|
|
962
993
|
"valid Until date must be greater than or equal to Start date",
|
|
963
994
|
function(b) {
|
|
964
995
|
const T = this.parent.effectiveFrom;
|
|
965
996
|
return !T || !b ? !0 : new Date(b) >= new Date(T);
|
|
966
997
|
}
|
|
967
|
-
) :
|
|
998
|
+
) : g.notRequired()
|
|
968
999
|
));
|
|
969
|
-
const
|
|
970
|
-
return
|
|
1000
|
+
const p = V(o);
|
|
1001
|
+
return r = Ce({
|
|
971
1002
|
initialValues: a,
|
|
972
|
-
validationSchema:
|
|
1003
|
+
validationSchema: p,
|
|
973
1004
|
validateOnBlur: !0,
|
|
974
|
-
onSubmit: (
|
|
975
|
-
var
|
|
976
|
-
const
|
|
1005
|
+
onSubmit: (s) => {
|
|
1006
|
+
var d;
|
|
1007
|
+
const g = {
|
|
977
1008
|
...e,
|
|
978
|
-
ruleName:
|
|
979
|
-
decisionDataType:
|
|
980
|
-
howToSetTheDecision:
|
|
981
|
-
value:
|
|
982
|
-
effectiveFrom:
|
|
983
|
-
validUntil:
|
|
984
|
-
conditionsThatEstablishesTheDecision: (
|
|
985
|
-
const b =
|
|
1009
|
+
ruleName: s.ruleName,
|
|
1010
|
+
decisionDataType: s.decisionDataType,
|
|
1011
|
+
howToSetTheDecision: s.howToSetTheDecision,
|
|
1012
|
+
value: s.value,
|
|
1013
|
+
effectiveFrom: s.effectiveFrom,
|
|
1014
|
+
validUntil: s.validUntil,
|
|
1015
|
+
conditionsThatEstablishesTheDecision: (d = e.conditionsThatEstablishesTheDecision) == null ? void 0 : d.filter((l) => {
|
|
1016
|
+
const b = s.conditionsThatEstablishesTheDecision[l.conditionName];
|
|
986
1017
|
return b != null && b !== "";
|
|
987
1018
|
}).map((l) => ({
|
|
988
1019
|
...l,
|
|
989
|
-
value:
|
|
1020
|
+
value: s.conditionsThatEstablishesTheDecision[l.conditionName]
|
|
990
1021
|
}))
|
|
991
1022
|
};
|
|
992
|
-
t(
|
|
1023
|
+
t(g);
|
|
993
1024
|
}
|
|
994
|
-
}), { formik:
|
|
995
|
-
var
|
|
996
|
-
|
|
997
|
-
if (
|
|
998
|
-
|
|
999
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1025
|
+
}), { formik: r, handleToggleNoneChange: (s) => {
|
|
1026
|
+
var g;
|
|
1027
|
+
r.setFieldValue("toggleNone", s), (g = e.conditionsThatEstablishesTheDecision) == null || g.forEach((d) => {
|
|
1028
|
+
if (s)
|
|
1029
|
+
r.setFieldValue(
|
|
1030
|
+
`conditionsThatEstablishesTheDecision.${d.conditionName}`,
|
|
1000
1031
|
void 0
|
|
1001
1032
|
);
|
|
1002
1033
|
else {
|
|
1003
|
-
const l =
|
|
1004
|
-
|
|
1005
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1034
|
+
const l = d.howToSetTheCondition === y.LIST_OF_VALUES_MULTI ? [] : "";
|
|
1035
|
+
r.setFieldValue(
|
|
1036
|
+
`conditionsThatEstablishesTheDecision.${d.conditionName}`,
|
|
1006
1037
|
l
|
|
1007
1038
|
);
|
|
1008
1039
|
}
|
|
@@ -1015,7 +1046,7 @@ const at = f.div`
|
|
|
1015
1046
|
border: 1px solid
|
|
1016
1047
|
${({ theme: e }) => {
|
|
1017
1048
|
var t, n;
|
|
1018
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) ||
|
|
1049
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || w.palette.neutral.N30;
|
|
1019
1050
|
}};
|
|
1020
1051
|
}
|
|
1021
1052
|
`, it = f.div`
|
|
@@ -1040,54 +1071,54 @@ const at = f.div`
|
|
|
1040
1071
|
checked: t,
|
|
1041
1072
|
children: n,
|
|
1042
1073
|
handleToggleChange: a,
|
|
1043
|
-
id:
|
|
1044
|
-
labelToggle:
|
|
1045
|
-
name:
|
|
1046
|
-
valueToggle:
|
|
1047
|
-
} = e, [
|
|
1048
|
-
|
|
1074
|
+
id: r,
|
|
1075
|
+
labelToggle: o,
|
|
1076
|
+
name: p,
|
|
1077
|
+
valueToggle: c = ""
|
|
1078
|
+
} = e, [s, g] = _(t), d = (l) => {
|
|
1079
|
+
g(l.target.checked), a(l);
|
|
1049
1080
|
};
|
|
1050
|
-
return
|
|
1051
|
-
|
|
1052
|
-
}, [t]), /* @__PURE__ */
|
|
1081
|
+
return Se(() => {
|
|
1082
|
+
g(t);
|
|
1083
|
+
}, [t]), /* @__PURE__ */ h(D, { children: [
|
|
1053
1084
|
/* @__PURE__ */ i(u, { children: /* @__PURE__ */ i(
|
|
1054
|
-
|
|
1085
|
+
de,
|
|
1055
1086
|
{
|
|
1056
|
-
checked:
|
|
1057
|
-
id:
|
|
1058
|
-
name:
|
|
1059
|
-
onChange:
|
|
1087
|
+
checked: s,
|
|
1088
|
+
id: r,
|
|
1089
|
+
name: p,
|
|
1090
|
+
onChange: d,
|
|
1060
1091
|
size: "small",
|
|
1061
|
-
value:
|
|
1062
|
-
children: /* @__PURE__ */ i(x, { size: "medium", type: "label", weight: "bold", children:
|
|
1092
|
+
value: c,
|
|
1093
|
+
children: /* @__PURE__ */ i(x, { size: "medium", type: "label", weight: "bold", children: o })
|
|
1063
1094
|
}
|
|
1064
1095
|
) }),
|
|
1065
|
-
|
|
1096
|
+
s && /* @__PURE__ */ i(D, { children: n })
|
|
1066
1097
|
] });
|
|
1067
1098
|
}, rt = (e) => {
|
|
1068
1099
|
const {
|
|
1069
1100
|
onHandleStartChange: t,
|
|
1070
1101
|
onHandleEndChange: n,
|
|
1071
1102
|
onCheckClosedChange: a,
|
|
1072
|
-
labelStart:
|
|
1073
|
-
labelEnd:
|
|
1074
|
-
checkedClosed:
|
|
1075
|
-
required:
|
|
1076
|
-
valueStart:
|
|
1077
|
-
valueEnd:
|
|
1078
|
-
messageStart:
|
|
1103
|
+
labelStart: r,
|
|
1104
|
+
labelEnd: o,
|
|
1105
|
+
checkedClosed: p = !1,
|
|
1106
|
+
required: c = !1,
|
|
1107
|
+
valueStart: s = "",
|
|
1108
|
+
valueEnd: g = "",
|
|
1109
|
+
messageStart: d = "",
|
|
1079
1110
|
messageEnd: l = "",
|
|
1080
1111
|
statusStart: b = "pending",
|
|
1081
1112
|
statusEnd: T = "pending"
|
|
1082
|
-
} = e, [m,
|
|
1083
|
-
|
|
1084
|
-
},
|
|
1085
|
-
|
|
1086
|
-
},
|
|
1087
|
-
|
|
1088
|
-
},
|
|
1089
|
-
return /* @__PURE__ */
|
|
1090
|
-
/* @__PURE__ */
|
|
1113
|
+
} = e, [m, v] = _(p), [C, F] = _(s), [U, L] = _(g), G = ({ target: E }) => {
|
|
1114
|
+
v(E.checked), a && a(E.checked);
|
|
1115
|
+
}, me = (E) => {
|
|
1116
|
+
F(E.target.value), t(E);
|
|
1117
|
+
}, be = (E) => {
|
|
1118
|
+
L(E.target.value), n(E);
|
|
1119
|
+
}, Te = A("(max-width: 400px)");
|
|
1120
|
+
return /* @__PURE__ */ h(D, { children: [
|
|
1121
|
+
/* @__PURE__ */ h(u, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
1091
1122
|
/* @__PURE__ */ i(
|
|
1092
1123
|
x,
|
|
1093
1124
|
{
|
|
@@ -1107,7 +1138,7 @@ const at = f.div`
|
|
|
1107
1138
|
wrap: "wrap",
|
|
1108
1139
|
gap: "4px",
|
|
1109
1140
|
children: /* @__PURE__ */ i(
|
|
1110
|
-
|
|
1141
|
+
we,
|
|
1111
1142
|
{
|
|
1112
1143
|
label: "Cerrada",
|
|
1113
1144
|
onChange: G,
|
|
@@ -1118,10 +1149,10 @@ const at = f.div`
|
|
|
1118
1149
|
}
|
|
1119
1150
|
)
|
|
1120
1151
|
] }),
|
|
1121
|
-
/* @__PURE__ */
|
|
1152
|
+
/* @__PURE__ */ h(
|
|
1122
1153
|
u,
|
|
1123
1154
|
{
|
|
1124
|
-
direction:
|
|
1155
|
+
direction: Te ? "column" : "row",
|
|
1125
1156
|
justifyContent: "space-between",
|
|
1126
1157
|
gap: "24px",
|
|
1127
1158
|
children: [
|
|
@@ -1129,23 +1160,23 @@ const at = f.div`
|
|
|
1129
1160
|
Q,
|
|
1130
1161
|
{
|
|
1131
1162
|
id: "dateStart",
|
|
1132
|
-
label:
|
|
1133
|
-
onChange:
|
|
1163
|
+
label: r,
|
|
1164
|
+
onChange: me,
|
|
1134
1165
|
value: C,
|
|
1135
|
-
required:
|
|
1166
|
+
required: c,
|
|
1136
1167
|
size: "compact",
|
|
1137
1168
|
status: b,
|
|
1138
|
-
message:
|
|
1169
|
+
message: d
|
|
1139
1170
|
}
|
|
1140
1171
|
),
|
|
1141
1172
|
m && /* @__PURE__ */ i(
|
|
1142
1173
|
Q,
|
|
1143
1174
|
{
|
|
1144
1175
|
id: "dateEnd",
|
|
1145
|
-
label:
|
|
1146
|
-
onChange:
|
|
1147
|
-
value:
|
|
1148
|
-
required:
|
|
1176
|
+
label: o,
|
|
1177
|
+
onChange: be,
|
|
1178
|
+
value: U,
|
|
1179
|
+
required: c,
|
|
1149
1180
|
size: "compact",
|
|
1150
1181
|
status: T,
|
|
1151
1182
|
message: l
|
|
@@ -1160,22 +1191,22 @@ const at = f.div`
|
|
|
1160
1191
|
formik: t,
|
|
1161
1192
|
textValues: n,
|
|
1162
1193
|
onCancel: a,
|
|
1163
|
-
visibleConditions:
|
|
1164
|
-
normalizedDecision:
|
|
1165
|
-
handleToggleNoneChange:
|
|
1166
|
-
handleConditionToggleChange:
|
|
1167
|
-
showConditionsError:
|
|
1168
|
-
termStartStatus:
|
|
1169
|
-
termEndStatus:
|
|
1194
|
+
visibleConditions: r,
|
|
1195
|
+
normalizedDecision: o,
|
|
1196
|
+
handleToggleNoneChange: p,
|
|
1197
|
+
handleConditionToggleChange: c,
|
|
1198
|
+
showConditionsError: s,
|
|
1199
|
+
termStartStatus: g,
|
|
1200
|
+
termEndStatus: d
|
|
1170
1201
|
} = e;
|
|
1171
|
-
return /* @__PURE__ */ i("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */
|
|
1202
|
+
return /* @__PURE__ */ i("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ h(u, { direction: "column", gap: "24px", children: [
|
|
1172
1203
|
Y({
|
|
1173
|
-
condition:
|
|
1204
|
+
condition: o,
|
|
1174
1205
|
formik: t,
|
|
1175
1206
|
isDecision: !0
|
|
1176
1207
|
}),
|
|
1177
|
-
/* @__PURE__ */ i(
|
|
1178
|
-
/* @__PURE__ */ i(at, { children: /* @__PURE__ */ i(it, { children: /* @__PURE__ */
|
|
1208
|
+
/* @__PURE__ */ i(S, { dashed: !0 }),
|
|
1209
|
+
/* @__PURE__ */ i(at, { children: /* @__PURE__ */ i(it, { children: /* @__PURE__ */ h(
|
|
1179
1210
|
u,
|
|
1180
1211
|
{
|
|
1181
1212
|
direction: "column",
|
|
@@ -1183,7 +1214,7 @@ const at = f.div`
|
|
|
1183
1214
|
gap: "16px",
|
|
1184
1215
|
height: "272px",
|
|
1185
1216
|
children: [
|
|
1186
|
-
/* @__PURE__ */
|
|
1217
|
+
/* @__PURE__ */ h(
|
|
1187
1218
|
u,
|
|
1188
1219
|
{
|
|
1189
1220
|
justifyContent: "space-between",
|
|
@@ -1192,10 +1223,10 @@ const at = f.div`
|
|
|
1192
1223
|
children: [
|
|
1193
1224
|
/* @__PURE__ */ i(x, { type: "title", size: "small", weight: "bold", appearance: "gray", children: n.factsThatConditionIt }),
|
|
1194
1225
|
/* @__PURE__ */ i(
|
|
1195
|
-
|
|
1226
|
+
de,
|
|
1196
1227
|
{
|
|
1197
1228
|
id: "toggleNone",
|
|
1198
|
-
onChange: () =>
|
|
1229
|
+
onChange: () => p(!t.values.toggleNone),
|
|
1199
1230
|
checked: t.values.toggleNone,
|
|
1200
1231
|
size: "small",
|
|
1201
1232
|
children: /* @__PURE__ */ i(x, { as: "span", size: "medium", type: "label", weight: "bold", children: n.none })
|
|
@@ -1204,14 +1235,14 @@ const at = f.div`
|
|
|
1204
1235
|
]
|
|
1205
1236
|
}
|
|
1206
1237
|
),
|
|
1207
|
-
/* @__PURE__ */ i(u, { direction: "column", gap: "20px", children:
|
|
1238
|
+
/* @__PURE__ */ i(u, { direction: "column", gap: "20px", children: r == null ? void 0 : r.map((l) => /* @__PURE__ */ i(
|
|
1208
1239
|
ot,
|
|
1209
1240
|
{
|
|
1210
1241
|
id: `toggle-${l.conditionName}`,
|
|
1211
1242
|
name: `toggle.${l.conditionName}`,
|
|
1212
1243
|
labelToggle: l.labelName,
|
|
1213
1244
|
checked: !t.values.toggleNone && t.values.conditionsThatEstablishesTheDecision[l.conditionName] !== void 0,
|
|
1214
|
-
handleToggleChange: (b) =>
|
|
1245
|
+
handleToggleChange: (b) => c(
|
|
1215
1246
|
l.conditionName,
|
|
1216
1247
|
l.howToSetTheCondition === y.LIST_OF_VALUES_MULTI
|
|
1217
1248
|
)(b.target.checked),
|
|
@@ -1222,8 +1253,8 @@ const at = f.div`
|
|
|
1222
1253
|
]
|
|
1223
1254
|
}
|
|
1224
1255
|
) }) }),
|
|
1225
|
-
n.terms && /* @__PURE__ */
|
|
1226
|
-
/* @__PURE__ */ i(
|
|
1256
|
+
n.terms && /* @__PURE__ */ h(D, { children: [
|
|
1257
|
+
/* @__PURE__ */ i(S, { dashed: !0 }),
|
|
1227
1258
|
/* @__PURE__ */ i(
|
|
1228
1259
|
rt,
|
|
1229
1260
|
{
|
|
@@ -1233,8 +1264,8 @@ const at = f.div`
|
|
|
1233
1264
|
valueEnd: t.values.validUntil,
|
|
1234
1265
|
messageStart: t.errors.effectiveFrom,
|
|
1235
1266
|
messageEnd: t.errors.validUntil,
|
|
1236
|
-
statusStart:
|
|
1237
|
-
statusEnd:
|
|
1267
|
+
statusStart: g,
|
|
1268
|
+
statusEnd: d,
|
|
1238
1269
|
onHandleStartChange: (l) => t.setFieldValue("effectiveFrom", l.target.value),
|
|
1239
1270
|
onHandleEndChange: (l) => t.setFieldValue("validUntil", l.target.value),
|
|
1240
1271
|
onCheckClosedChange: (l) => {
|
|
@@ -1244,65 +1275,65 @@ const at = f.div`
|
|
|
1244
1275
|
}
|
|
1245
1276
|
)
|
|
1246
1277
|
] }),
|
|
1247
|
-
/* @__PURE__ */ i(
|
|
1248
|
-
|
|
1249
|
-
/* @__PURE__ */
|
|
1278
|
+
/* @__PURE__ */ i(S, {}),
|
|
1279
|
+
s && /* @__PURE__ */ i(x, { type: "label", size: "medium", appearance: "danger", children: String(t.errors.conditionsThatEstablishesTheDecision) }),
|
|
1280
|
+
/* @__PURE__ */ h(u, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
1250
1281
|
/* @__PURE__ */ i(N, { appearance: "gray", onClick: a, children: n.cancel }),
|
|
1251
1282
|
/* @__PURE__ */ i(N, { type: "submit", children: n.confirm })
|
|
1252
1283
|
] })
|
|
1253
1284
|
] }) });
|
|
1254
1285
|
}, st = (e) => {
|
|
1255
1286
|
var T;
|
|
1256
|
-
const { decision: t, onSubmitEvent: n, textValues: a, onCancel:
|
|
1287
|
+
const { decision: t, onSubmitEvent: n, textValues: a, onCancel: r } = e, { formik: o, handleToggleNoneChange: p } = nt({
|
|
1257
1288
|
decision: t,
|
|
1258
1289
|
onSubmitEvent: n,
|
|
1259
1290
|
textValues: a
|
|
1260
|
-
}),
|
|
1291
|
+
}), c = {
|
|
1261
1292
|
ruleName: t.ruleName,
|
|
1262
1293
|
labelName: t.labelName,
|
|
1263
1294
|
howToSetTheCondition: t.howToSetTheDecision,
|
|
1264
1295
|
decisionDataType: t.decisionDataType,
|
|
1265
1296
|
listOfPossibleValues: t.listOfPossibleValues
|
|
1266
|
-
},
|
|
1297
|
+
}, s = ((T = t.conditionsThatEstablishesTheDecision) == null ? void 0 : T.filter(
|
|
1267
1298
|
(m) => !m.hidden
|
|
1268
|
-
)) || [],
|
|
1299
|
+
)) || [], g = !!o.errors.conditionsThatEstablishesTheDecision && o.submitCount > 0, d = o.touched.effectiveFrom ? o.errors.effectiveFrom ? "invalid" : "valid" : void 0, l = o.touched.validUntil ? o.errors.validUntil ? "invalid" : "valid" : void 0;
|
|
1269
1300
|
return /* @__PURE__ */ i(
|
|
1270
1301
|
lt,
|
|
1271
1302
|
{
|
|
1272
|
-
formik:
|
|
1273
|
-
onCancel:
|
|
1303
|
+
formik: o,
|
|
1304
|
+
onCancel: r,
|
|
1274
1305
|
textValues: a,
|
|
1275
1306
|
decision: t,
|
|
1276
|
-
visibleConditions:
|
|
1277
|
-
normalizedDecision:
|
|
1278
|
-
handleToggleNoneChange:
|
|
1279
|
-
handleConditionToggleChange: (m,
|
|
1307
|
+
visibleConditions: s,
|
|
1308
|
+
normalizedDecision: c,
|
|
1309
|
+
handleToggleNoneChange: p,
|
|
1310
|
+
handleConditionToggleChange: (m, v) => (C) => {
|
|
1280
1311
|
if (!C)
|
|
1281
|
-
|
|
1312
|
+
o.setFieldValue(
|
|
1282
1313
|
`conditionsThatEstablishesTheDecision.${m}`,
|
|
1283
1314
|
void 0
|
|
1284
|
-
),
|
|
1315
|
+
), o.setFieldTouched(
|
|
1285
1316
|
`conditionsThatEstablishesTheDecision.${m}`,
|
|
1286
1317
|
!1,
|
|
1287
1318
|
!1
|
|
1288
1319
|
);
|
|
1289
1320
|
else {
|
|
1290
|
-
const
|
|
1291
|
-
|
|
1321
|
+
const F = v ? [] : "";
|
|
1322
|
+
o.setFieldValue(
|
|
1292
1323
|
`conditionsThatEstablishesTheDecision.${m}`,
|
|
1293
|
-
|
|
1324
|
+
F
|
|
1294
1325
|
);
|
|
1295
1326
|
}
|
|
1296
1327
|
},
|
|
1297
|
-
showConditionsError:
|
|
1298
|
-
termStartStatus:
|
|
1328
|
+
showConditionsError: g,
|
|
1329
|
+
termStartStatus: d,
|
|
1299
1330
|
termEndStatus: l
|
|
1300
1331
|
}
|
|
1301
1332
|
);
|
|
1302
|
-
},
|
|
1303
|
-
var
|
|
1304
|
-
const { decisionTemplate: t } = e, n = { ...t }, a = (
|
|
1305
|
-
(
|
|
1333
|
+
}, Mt = (e) => {
|
|
1334
|
+
var r;
|
|
1335
|
+
const { decisionTemplate: t } = e, n = { ...t }, a = (r = n.conditionsThatEstablishesTheDecision) == null ? void 0 : r.find(
|
|
1336
|
+
(o) => o.switchPlaces
|
|
1306
1337
|
);
|
|
1307
1338
|
return a ? {
|
|
1308
1339
|
...n,
|
|
@@ -1312,15 +1343,15 @@ const at = f.div`
|
|
|
1312
1343
|
value: a.value,
|
|
1313
1344
|
howToSetTheDecision: a.howToSetTheCondition,
|
|
1314
1345
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
1315
|
-
(
|
|
1346
|
+
(o) => o.conditionName === a.conditionName ? { ...o, hidden: !0 } : o
|
|
1316
1347
|
)
|
|
1317
1348
|
} : n;
|
|
1318
|
-
},
|
|
1349
|
+
}, Lt = (e) => {
|
|
1319
1350
|
const { decisions: t } = e;
|
|
1320
1351
|
return t == null ? void 0 : t.map((n) => {
|
|
1321
|
-
var
|
|
1322
|
-
const a = (
|
|
1323
|
-
(
|
|
1352
|
+
var r;
|
|
1353
|
+
const a = (r = n.conditionsThatEstablishesTheDecision) == null ? void 0 : r.find(
|
|
1354
|
+
(o) => o.switchPlaces
|
|
1324
1355
|
);
|
|
1325
1356
|
return a ? {
|
|
1326
1357
|
...n,
|
|
@@ -1330,21 +1361,21 @@ const at = f.div`
|
|
|
1330
1361
|
value: a.value,
|
|
1331
1362
|
howToSetTheDecision: a.howToSetTheCondition,
|
|
1332
1363
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
1333
|
-
(
|
|
1364
|
+
(o) => o.conditionName === a.conditionName ? { ...o, hidden: !0 } : o
|
|
1334
1365
|
)
|
|
1335
1366
|
} : n;
|
|
1336
1367
|
});
|
|
1337
|
-
},
|
|
1368
|
+
}, I = /* @__PURE__ */ new Map(), dt = (e, t) => I.get(`${t}:${e}`), ct = (e, t, n) => {
|
|
1338
1369
|
const a = `${t}:${e}`;
|
|
1339
|
-
if (
|
|
1340
|
-
const
|
|
1341
|
-
|
|
1370
|
+
if (I.set(a, n), I.size > 1e3) {
|
|
1371
|
+
const r = I.keys().next().value;
|
|
1372
|
+
r !== void 0 && I.delete(r);
|
|
1342
1373
|
}
|
|
1343
1374
|
}, ee = /* @__PURE__ */ new Map(), ht = 1e3, ut = (e) => {
|
|
1344
1375
|
const t = Date.now(), n = ee.get(e) || 0;
|
|
1345
1376
|
return t - n < ht ? !0 : (ee.set(e, t), !1);
|
|
1346
1377
|
}, pt = (e) => {
|
|
1347
|
-
const t =
|
|
1378
|
+
const t = Ee(e);
|
|
1348
1379
|
return {
|
|
1349
1380
|
spa: "es",
|
|
1350
1381
|
eng: "en",
|
|
@@ -1353,59 +1384,66 @@ const at = f.div`
|
|
|
1353
1384
|
ita: "it",
|
|
1354
1385
|
por: "pt"
|
|
1355
1386
|
}[t] || "en";
|
|
1356
|
-
}, gt =
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
if (
|
|
1360
|
-
if (ut(n))
|
|
1387
|
+
}, gt = async (e, t, { url: n, apiKey: a }) => {
|
|
1388
|
+
const r = `${t}:${e}`, o = dt(e, t);
|
|
1389
|
+
if (o) return o;
|
|
1390
|
+
if (ut(r))
|
|
1361
1391
|
return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
|
|
1362
|
-
const
|
|
1392
|
+
const p = pt(e);
|
|
1363
1393
|
try {
|
|
1364
|
-
const { data: c } = await
|
|
1365
|
-
|
|
1394
|
+
const { data: c } = await De.post(
|
|
1395
|
+
n,
|
|
1396
|
+
{
|
|
1366
1397
|
q: e,
|
|
1367
|
-
|
|
1398
|
+
source: p,
|
|
1399
|
+
target: t,
|
|
1400
|
+
api_key: a
|
|
1401
|
+
},
|
|
1402
|
+
{
|
|
1403
|
+
headers: {
|
|
1404
|
+
"Content-Type": "application/json"
|
|
1405
|
+
}
|
|
1368
1406
|
}
|
|
1369
|
-
|
|
1370
|
-
return ct(e, t,
|
|
1407
|
+
), s = (c == null ? void 0 : c.translatedText) || e;
|
|
1408
|
+
return ct(e, t, s), s;
|
|
1371
1409
|
} catch (c) {
|
|
1372
1410
|
return console.warn(`[Translation] Failed for: "${e}"`, c), e;
|
|
1373
1411
|
}
|
|
1374
|
-
},
|
|
1375
|
-
const
|
|
1376
|
-
Object.entries(e).map(async ([
|
|
1377
|
-
if (
|
|
1378
|
-
const
|
|
1379
|
-
return [
|
|
1412
|
+
}, mt = (e) => typeof e == "string" && e.trim().length > 0, te = async (e, t, n) => {
|
|
1413
|
+
const a = await Promise.all(
|
|
1414
|
+
Object.entries(e).map(async ([r, o]) => {
|
|
1415
|
+
if (mt(o)) {
|
|
1416
|
+
const p = await gt(o, t, n);
|
|
1417
|
+
return [r, p];
|
|
1380
1418
|
} else if (Array.isArray(o)) {
|
|
1381
|
-
const
|
|
1419
|
+
const p = await Promise.all(
|
|
1382
1420
|
o.map(
|
|
1383
|
-
async (c) => typeof c == "object" && c !== null ? await te(c, t) : c
|
|
1421
|
+
async (c) => typeof c == "object" && c !== null ? await te(c, t, n) : c
|
|
1384
1422
|
)
|
|
1385
1423
|
);
|
|
1386
|
-
return [
|
|
1424
|
+
return [r, p];
|
|
1387
1425
|
} else if (typeof o == "object" && o !== null) {
|
|
1388
|
-
const
|
|
1389
|
-
return [
|
|
1426
|
+
const p = await te(o, t, n);
|
|
1427
|
+
return [r, p];
|
|
1390
1428
|
} else
|
|
1391
|
-
return [
|
|
1429
|
+
return [r, o];
|
|
1392
1430
|
})
|
|
1393
1431
|
);
|
|
1394
|
-
return Object.fromEntries(
|
|
1432
|
+
return Object.fromEntries(a);
|
|
1395
1433
|
};
|
|
1396
1434
|
export {
|
|
1397
1435
|
P as BusinessRuleCard,
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1436
|
+
ue as BusinessRuleView,
|
|
1437
|
+
kt as BusinessRules,
|
|
1438
|
+
At as Filter,
|
|
1439
|
+
Ft as FilterModal,
|
|
1440
|
+
$t as FormFilter,
|
|
1403
1441
|
Ue as ModalRules,
|
|
1404
1442
|
st as RulesForm,
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1443
|
+
It as revertSortedDataSampleSwitchPlaces,
|
|
1444
|
+
Rt as revertSortedDataSwitchPlaces,
|
|
1445
|
+
Mt as sortDisplayDataSampleSwitchPlaces,
|
|
1446
|
+
Lt as sortDisplayDataSwitchPlaces,
|
|
1409
1447
|
te as translateObject,
|
|
1410
|
-
|
|
1448
|
+
gt as translateText
|
|
1411
1449
|
};
|