@isettingkit/business-rules 1.0.16 → 1.0.18
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 +1 -1
- package/dist/index.es.js +933 -667
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { MdOutlineDelete as
|
|
3
|
-
import { inube as
|
|
4
|
-
import
|
|
5
|
-
import { ValueDataType as
|
|
6
|
-
import { DecisionViewConditionRenderer as
|
|
7
|
-
import { createPortal as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import { franc as
|
|
13
|
-
const
|
|
1
|
+
import { jsx as o, jsxs as p, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { MdOutlineDelete as Ce, MdClear as pe, MdAdd as ge, MdClose as Se, MdOutlineFilterAltOff as me, MdOutlineFilterAlt as be } from "react-icons/md";
|
|
3
|
+
import { inube as y, Stack as g, Divider as I, Icon as M, Text as C, SkeletonLine as _, useMediaQuery as V, Blanket as fe, Button as L, Grid as J, Tag as B, OptionList as De, Checkpicker as ke, Toggle as Te, Checkbox as Ne, Date as ae } from "@inubekit/inubekit";
|
|
4
|
+
import v, { keyframes as Ee, ThemeContext as $e } from "styled-components";
|
|
5
|
+
import { ValueDataType as z, ValueHowToSetUp as q, DecisionConditionRender as ie } from "@isettingkit/input";
|
|
6
|
+
import { DecisionViewConditionRenderer as G } from "@isettingkit/view";
|
|
7
|
+
import { createPortal as ye } from "react-dom";
|
|
8
|
+
import Ae, { useState as R, useRef as H, useEffect as X, useContext as Fe } from "react";
|
|
9
|
+
import { useFormik as Ie } from "formik";
|
|
10
|
+
import { string as Z, mixed as ve, object as P, number as W, lazy as re, date as le } from "yup";
|
|
11
|
+
import Re from "axios";
|
|
12
|
+
import { franc as Oe } from "franc-min";
|
|
13
|
+
const Me = v.div`
|
|
14
14
|
border-radius: 8px;
|
|
15
15
|
border: 1px solid
|
|
16
16
|
${({ theme: e }) => {
|
|
17
17
|
var t, n;
|
|
18
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) ||
|
|
18
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
|
|
19
19
|
}};
|
|
20
20
|
box-sizing: border-box;
|
|
21
21
|
display: flex;
|
|
@@ -26,7 +26,7 @@ const Ne = f.div`
|
|
|
26
26
|
height: 100%;
|
|
27
27
|
box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
|
|
28
28
|
`;
|
|
29
|
-
|
|
29
|
+
v.div`
|
|
30
30
|
width: 100%;
|
|
31
31
|
height: 100%;
|
|
32
32
|
overflow-y: auto;
|
|
@@ -45,36 +45,36 @@ f.div`
|
|
|
45
45
|
border-radius: 8px;
|
|
46
46
|
}
|
|
47
47
|
`;
|
|
48
|
-
const
|
|
49
|
-
const { children: t, controls: n = !0, handleDelete:
|
|
50
|
-
return /* @__PURE__ */
|
|
48
|
+
const ee = (e) => {
|
|
49
|
+
const { children: t, controls: n = !0, handleDelete: a, id: i } = e;
|
|
50
|
+
return /* @__PURE__ */ o(Me, { children: /* @__PURE__ */ p(g, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
51
51
|
t,
|
|
52
|
-
n && /* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
52
|
+
n && /* @__PURE__ */ p(A, { children: [
|
|
53
|
+
/* @__PURE__ */ o(I, {}),
|
|
54
|
+
/* @__PURE__ */ o(g, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ o(
|
|
55
55
|
M,
|
|
56
56
|
{
|
|
57
57
|
cursorHover: !0,
|
|
58
58
|
appearance: "danger",
|
|
59
59
|
size: "24px",
|
|
60
|
-
icon: /* @__PURE__ */
|
|
60
|
+
icon: /* @__PURE__ */ o(Ce, {}),
|
|
61
61
|
onClick: () => {
|
|
62
|
-
i
|
|
62
|
+
a(i);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
) })
|
|
66
66
|
] })
|
|
67
67
|
] }) });
|
|
68
|
-
},
|
|
68
|
+
}, se = v.div`
|
|
69
69
|
& > div {
|
|
70
70
|
border-radius: 8px;
|
|
71
71
|
border: 1px solid
|
|
72
72
|
${({ theme: e }) => {
|
|
73
73
|
var t, n;
|
|
74
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) ||
|
|
74
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
|
|
75
75
|
}};
|
|
76
76
|
}
|
|
77
|
-
`,
|
|
77
|
+
`, de = v.div`
|
|
78
78
|
width: 100%;
|
|
79
79
|
height: 100%;
|
|
80
80
|
overflow-y: auto;
|
|
@@ -92,182 +92,182 @@ const P = (e) => {
|
|
|
92
92
|
background-color: #ebecf0;
|
|
93
93
|
border-radius: 8px;
|
|
94
94
|
}
|
|
95
|
-
`,
|
|
95
|
+
`, Le = (e) => e.value, ze = (e) => e.value, Ve = (e) => e.value, _e = (e) => ({
|
|
96
96
|
from: e.from ?? "",
|
|
97
97
|
to: e.to ?? ""
|
|
98
|
-
}),
|
|
99
|
-
var
|
|
100
|
-
const
|
|
101
|
-
[
|
|
102
|
-
[
|
|
103
|
-
[
|
|
104
|
-
[
|
|
105
|
-
[
|
|
106
|
-
[
|
|
107
|
-
},
|
|
108
|
-
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t),
|
|
109
|
-
return n &&
|
|
110
|
-
},
|
|
98
|
+
}), Ue = (e) => e.value, je = (e) => e.value, qe = (e) => e.value;
|
|
99
|
+
var D = /* @__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))(D || {});
|
|
100
|
+
const Be = {
|
|
101
|
+
[D.LIST_OF_VALUES]: ze,
|
|
102
|
+
[D.LIST_OF_VALUES_MULTI]: Ve,
|
|
103
|
+
[D.RANGE]: _e,
|
|
104
|
+
[D.GREATER_THAN]: Ue,
|
|
105
|
+
[D.LESS_THAN]: je,
|
|
106
|
+
[D.EQUAL]: qe
|
|
107
|
+
}, j = (e) => {
|
|
108
|
+
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), a = Be[e == null ? void 0 : e.howToSetTheDecision] || Le;
|
|
109
|
+
return n && a(t) || t || void 0;
|
|
110
|
+
}, He = (e) => {
|
|
111
111
|
const {
|
|
112
112
|
conditionsAlignment: t,
|
|
113
113
|
decision: n,
|
|
114
|
-
decisionDateElement:
|
|
115
|
-
decisionMapper:
|
|
114
|
+
decisionDateElement: a,
|
|
115
|
+
decisionMapper: i,
|
|
116
116
|
loading: r,
|
|
117
|
-
skeleton:
|
|
117
|
+
skeleton: h,
|
|
118
118
|
terms: l,
|
|
119
|
-
textValues:
|
|
120
|
-
visibleConditions:
|
|
119
|
+
textValues: d,
|
|
120
|
+
visibleConditions: c
|
|
121
121
|
} = e;
|
|
122
|
-
return r ? /* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
|
|
122
|
+
return r ? /* @__PURE__ */ p(g, { direction: "column", gap: "12px", children: [
|
|
123
|
+
/* @__PURE__ */ o(g, { direction: "column", alignItems: "center", children: /* @__PURE__ */ o(
|
|
124
|
+
G,
|
|
125
125
|
{
|
|
126
|
-
element:
|
|
127
|
-
valueData:
|
|
128
|
-
|
|
126
|
+
element: i,
|
|
127
|
+
valueData: j(
|
|
128
|
+
i
|
|
129
129
|
),
|
|
130
130
|
type: "decision"
|
|
131
131
|
}
|
|
132
132
|
) }, n.ruleName),
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
|
|
133
|
+
/* @__PURE__ */ o(I, { dashed: !0 }),
|
|
134
|
+
/* @__PURE__ */ o(de, { children: /* @__PURE__ */ p(
|
|
135
|
+
g,
|
|
136
136
|
{
|
|
137
137
|
direction: "column",
|
|
138
138
|
gap: "12px",
|
|
139
139
|
justifyContent: t,
|
|
140
140
|
height: "203px",
|
|
141
141
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
142
|
+
/* @__PURE__ */ o(
|
|
143
|
+
C,
|
|
144
144
|
{
|
|
145
145
|
type: "label",
|
|
146
146
|
size: "large",
|
|
147
147
|
appearance: "dark",
|
|
148
148
|
weight: "bold",
|
|
149
149
|
textAlign: "center",
|
|
150
|
-
children:
|
|
150
|
+
children: d.factsThatConditionIt
|
|
151
151
|
}
|
|
152
152
|
),
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
c.map((u) => /* @__PURE__ */ o(se, { children: /* @__PURE__ */ o(g, { direction: "column", padding: "8px", children: /* @__PURE__ */ o(
|
|
154
|
+
G,
|
|
155
155
|
{
|
|
156
|
-
element: { ...
|
|
157
|
-
valueData:
|
|
158
|
-
|
|
156
|
+
element: { ...u, value: u.value },
|
|
157
|
+
valueData: j(
|
|
158
|
+
u
|
|
159
159
|
)
|
|
160
160
|
}
|
|
161
|
-
) }) },
|
|
162
|
-
l && /* @__PURE__ */
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
|
|
165
|
-
|
|
161
|
+
) }) }, u.conditionName)),
|
|
162
|
+
l && /* @__PURE__ */ p(A, { children: [
|
|
163
|
+
/* @__PURE__ */ o(I, { dashed: !0 }),
|
|
164
|
+
a && /* @__PURE__ */ o(
|
|
165
|
+
G,
|
|
166
166
|
{
|
|
167
|
-
element:
|
|
168
|
-
valueData:
|
|
167
|
+
element: a.element,
|
|
168
|
+
valueData: a.valueData,
|
|
169
169
|
type: "decision"
|
|
170
170
|
},
|
|
171
|
-
|
|
171
|
+
d.terms
|
|
172
172
|
)
|
|
173
173
|
] })
|
|
174
174
|
]
|
|
175
175
|
}
|
|
176
176
|
) })
|
|
177
|
-
] }) : /* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
/* @__PURE__ */
|
|
177
|
+
] }) : /* @__PURE__ */ p(g, { direction: "column", gap: "12px", children: [
|
|
178
|
+
/* @__PURE__ */ p(g, { direction: "column", alignItems: "center", gap: "4px", children: [
|
|
179
|
+
/* @__PURE__ */ o(_, { animated: !0, width: "180px" }),
|
|
180
|
+
/* @__PURE__ */ o(_, { animated: !0, width: "85px" })
|
|
181
181
|
] }, "loading"),
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ p(g, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
183
|
+
/* @__PURE__ */ o(I, { dashed: !0 }),
|
|
184
|
+
/* @__PURE__ */ o(_, { animated: !0, width: "150px" })
|
|
185
185
|
] }),
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
|
|
186
|
+
/* @__PURE__ */ o(de, { children: /* @__PURE__ */ o(
|
|
187
|
+
g,
|
|
188
188
|
{
|
|
189
189
|
direction: "column",
|
|
190
190
|
gap: "12px",
|
|
191
191
|
justifyContent: "space-between",
|
|
192
192
|
height: "203px",
|
|
193
|
-
children:
|
|
194
|
-
|
|
193
|
+
children: h.map((u, s) => /* @__PURE__ */ o(se, { children: /* @__PURE__ */ p(
|
|
194
|
+
g,
|
|
195
195
|
{
|
|
196
196
|
direction: "column",
|
|
197
197
|
gap: "12px",
|
|
198
198
|
alignItems: "start",
|
|
199
199
|
padding: "8px",
|
|
200
200
|
children: [
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ o(_, { animated: !0, width: "180px" }),
|
|
202
|
+
/* @__PURE__ */ o(_, { animated: !0, width: "85px" })
|
|
203
203
|
]
|
|
204
204
|
}
|
|
205
|
-
) }, `condition-${
|
|
205
|
+
) }, `condition-${s}`))
|
|
206
206
|
}
|
|
207
207
|
) })
|
|
208
208
|
] });
|
|
209
|
-
},
|
|
210
|
-
var
|
|
211
|
-
const { decision: t, loading: n = !1, textValues:
|
|
209
|
+
}, xe = (e) => {
|
|
210
|
+
var f;
|
|
211
|
+
const { decision: t, loading: n = !1, textValues: a } = e, i = !!(t != null && t.effectiveFrom), r = !!(t != null && t.validUntil), h = i && r ? {
|
|
212
212
|
element: {
|
|
213
|
-
labelName:
|
|
213
|
+
labelName: a == null ? void 0 : a.terms,
|
|
214
214
|
value: String(t.effectiveFrom),
|
|
215
|
-
howToSetTheDecision:
|
|
216
|
-
decisionDataType:
|
|
215
|
+
howToSetTheDecision: q.RANGE,
|
|
216
|
+
decisionDataType: z.DATE
|
|
217
217
|
},
|
|
218
|
-
valueData:
|
|
219
|
-
labelName:
|
|
218
|
+
valueData: j({
|
|
219
|
+
labelName: a == null ? void 0 : a.terms,
|
|
220
220
|
value: {
|
|
221
221
|
from: String(t.effectiveFrom),
|
|
222
222
|
to: String(t.validUntil)
|
|
223
223
|
},
|
|
224
|
-
howToSetTheDecision:
|
|
225
|
-
decisionDataType:
|
|
224
|
+
howToSetTheDecision: q.RANGE,
|
|
225
|
+
decisionDataType: z.DATE
|
|
226
226
|
})
|
|
227
|
-
} :
|
|
227
|
+
} : i && !r ? {
|
|
228
228
|
element: {
|
|
229
|
-
labelName:
|
|
229
|
+
labelName: a == null ? void 0 : a.terms,
|
|
230
230
|
value: String(t.effectiveFrom),
|
|
231
|
-
howToSetTheDecision:
|
|
232
|
-
decisionDataType:
|
|
231
|
+
howToSetTheDecision: q.EQUAL,
|
|
232
|
+
decisionDataType: z.DATE
|
|
233
233
|
},
|
|
234
|
-
valueData:
|
|
235
|
-
labelName:
|
|
234
|
+
valueData: j({
|
|
235
|
+
labelName: a == null ? void 0 : a.terms,
|
|
236
236
|
value: String(t.effectiveFrom),
|
|
237
|
-
howToSetTheDecision:
|
|
238
|
-
decisionDataType:
|
|
237
|
+
howToSetTheDecision: q.EQUAL,
|
|
238
|
+
decisionDataType: z.DATE
|
|
239
239
|
})
|
|
240
240
|
} : null, l = t ? {
|
|
241
241
|
labelName: t.labelName || "",
|
|
242
242
|
decisionDataType: t.decisionDataType || "alphabetical",
|
|
243
|
-
value:
|
|
243
|
+
value: j(t),
|
|
244
244
|
howToSetTheDecision: t.howToSetTheDecision || "EqualTo"
|
|
245
|
-
} : null,
|
|
245
|
+
} : null, d = ((f = t == null ? void 0 : t.conditionsThatEstablishesTheDecision) == null ? void 0 : f.filter(
|
|
246
246
|
(T) => !T.hidden
|
|
247
|
-
)) || [],
|
|
248
|
-
return /* @__PURE__ */
|
|
249
|
-
|
|
247
|
+
)) || [], c = Array.from({ length: 5 }), u = !!(!n && t && a && l), s = d.length < 2 ? "start" : "space-between";
|
|
248
|
+
return /* @__PURE__ */ o(
|
|
249
|
+
He,
|
|
250
250
|
{
|
|
251
|
-
conditionsAlignment:
|
|
251
|
+
conditionsAlignment: s,
|
|
252
252
|
decision: t,
|
|
253
|
-
decisionDateElement:
|
|
253
|
+
decisionDateElement: h,
|
|
254
254
|
decisionMapper: l,
|
|
255
|
-
loading:
|
|
256
|
-
skeleton:
|
|
257
|
-
terms: !!(
|
|
258
|
-
textValues:
|
|
259
|
-
visibleConditions:
|
|
255
|
+
loading: u,
|
|
256
|
+
skeleton: c,
|
|
257
|
+
terms: !!(a != null && a.terms),
|
|
258
|
+
textValues: a,
|
|
259
|
+
visibleConditions: d
|
|
260
260
|
}
|
|
261
261
|
);
|
|
262
|
-
},
|
|
262
|
+
}, Pe = v.div`
|
|
263
263
|
position: relative;
|
|
264
264
|
& > div {
|
|
265
265
|
padding: 24px 16px;
|
|
266
266
|
}
|
|
267
|
-
`,
|
|
267
|
+
`, Ge = v.div`
|
|
268
268
|
background-color: ${({ theme: e }) => {
|
|
269
269
|
var t, n;
|
|
270
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) ||
|
|
270
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || y.palette.neutral.N0;
|
|
271
271
|
}};
|
|
272
272
|
max-width: 450px;
|
|
273
273
|
max-height: 90vh;
|
|
@@ -295,24 +295,24 @@ const Le = {
|
|
|
295
295
|
background-color: #ebecf0;
|
|
296
296
|
border-radius: 8px;
|
|
297
297
|
}
|
|
298
|
-
`,
|
|
299
|
-
const { children: t, portalId: n, onCloseModal:
|
|
298
|
+
`, Qe = (e) => {
|
|
299
|
+
const { children: t, portalId: n, onCloseModal: a, title: i } = 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
|
|
305
|
-
return
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
/* @__PURE__ */
|
|
304
|
+
const h = V("(max-width: 400px)");
|
|
305
|
+
return ye(
|
|
306
|
+
/* @__PURE__ */ o(Pe, { smallScreen: h, children: /* @__PURE__ */ o(fe, { children: /* @__PURE__ */ o(Ge, { children: /* @__PURE__ */ p(g, { direction: "column", gap: "24px", children: [
|
|
307
|
+
/* @__PURE__ */ o(g, { direction: "column", gap: "24px", children: /* @__PURE__ */ p(g, { alignItems: "center", justifyContent: "space-between", children: [
|
|
308
|
+
/* @__PURE__ */ o(C, { type: "title", size: "large", appearance: "dark", weight: "bold", children: i }),
|
|
309
|
+
/* @__PURE__ */ o(pe, { size: "24px", cursor: "pointer", onClick: a })
|
|
310
310
|
] }) }),
|
|
311
311
|
t
|
|
312
312
|
] }) }) }) }),
|
|
313
313
|
r
|
|
314
314
|
);
|
|
315
|
-
},
|
|
315
|
+
}, We = Ee`
|
|
316
316
|
from {
|
|
317
317
|
opacity: 0;
|
|
318
318
|
transform: translateY(20px);
|
|
@@ -322,12 +322,12 @@ const Le = {
|
|
|
322
322
|
transform: translateY(0);
|
|
323
323
|
}
|
|
324
324
|
`;
|
|
325
|
-
|
|
325
|
+
v.div`
|
|
326
326
|
border-radius: 8px;
|
|
327
327
|
border: 1px solid
|
|
328
328
|
${({ theme: e }) => {
|
|
329
329
|
var t, n;
|
|
330
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) ||
|
|
330
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
|
|
331
331
|
}};
|
|
332
332
|
box-sizing: border-box;
|
|
333
333
|
display: flex;
|
|
@@ -336,21 +336,21 @@ f.div`
|
|
|
336
336
|
height: 100%;
|
|
337
337
|
box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
|
|
338
338
|
`;
|
|
339
|
-
|
|
339
|
+
v.div`
|
|
340
340
|
& > div {
|
|
341
341
|
border-radius: 8px;
|
|
342
342
|
border: 1px solid
|
|
343
343
|
${({ theme: e }) => {
|
|
344
344
|
var t, n;
|
|
345
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) ||
|
|
345
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
|
|
346
346
|
}};
|
|
347
347
|
}
|
|
348
348
|
`;
|
|
349
|
-
const
|
|
349
|
+
const Ye = v.div`
|
|
350
350
|
& > div {
|
|
351
351
|
background-color: ${({ theme: e }) => {
|
|
352
352
|
var t, n;
|
|
353
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N10) ||
|
|
353
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N10) || y.palette.neutral.N10;
|
|
354
354
|
}};
|
|
355
355
|
justify-content: center;
|
|
356
356
|
}
|
|
@@ -358,18 +358,18 @@ const je = f.div`
|
|
|
358
358
|
width: 100%;
|
|
359
359
|
height: 100%;
|
|
360
360
|
padding-bottom: 12px;
|
|
361
|
-
`,
|
|
361
|
+
`, we = v.div`
|
|
362
362
|
width: 100%;
|
|
363
363
|
height: 100%;
|
|
364
364
|
& > div {
|
|
365
|
-
animation: ${
|
|
365
|
+
animation: ${We} 600ms ease-out;
|
|
366
366
|
}
|
|
367
|
-
`,
|
|
367
|
+
`, Ke = v.div`
|
|
368
368
|
& > div > div {
|
|
369
369
|
border-radius: 8px;
|
|
370
370
|
box-sizing: border-box;
|
|
371
371
|
}
|
|
372
|
-
`,
|
|
372
|
+
`, Je = v.div`
|
|
373
373
|
& > div {
|
|
374
374
|
width: 100%;
|
|
375
375
|
height: 100%;
|
|
@@ -390,61 +390,61 @@ const je = f.div`
|
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
`;
|
|
393
|
-
function
|
|
393
|
+
function Xe(e) {
|
|
394
394
|
const { index: t, handleOpenModal: n } = e;
|
|
395
|
-
return /* @__PURE__ */
|
|
396
|
-
|
|
395
|
+
return /* @__PURE__ */ o(
|
|
396
|
+
ee,
|
|
397
397
|
{
|
|
398
398
|
id: `loading-card-${t}`,
|
|
399
399
|
handleDelete: () => {
|
|
400
400
|
},
|
|
401
401
|
handleView: () => n ? n() : null,
|
|
402
402
|
controls: !1,
|
|
403
|
-
children: /* @__PURE__ */
|
|
403
|
+
children: /* @__PURE__ */ o(xe, { loading: !0 })
|
|
404
404
|
},
|
|
405
405
|
`loading-card-${t}`
|
|
406
406
|
);
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
const { decision: t, controls: n, handleOpenModal:
|
|
410
|
-
return t ? /* @__PURE__ */
|
|
411
|
-
/* @__PURE__ */
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
|
|
408
|
+
function Ze(e) {
|
|
409
|
+
const { decision: t, controls: n, handleOpenModal: a, handleDelete: i, textValues: r } = e;
|
|
410
|
+
return t ? /* @__PURE__ */ o(we, { children: /* @__PURE__ */ p(g, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
|
|
411
|
+
/* @__PURE__ */ o(C, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.decisionId }),
|
|
412
|
+
/* @__PURE__ */ o(
|
|
413
|
+
ee,
|
|
414
414
|
{
|
|
415
415
|
id: t.decisionId,
|
|
416
|
-
handleDelete: () =>
|
|
417
|
-
handleView: () =>
|
|
416
|
+
handleDelete: () => i ? i(t.decisionId) : null,
|
|
417
|
+
handleView: () => a ? a(t) : null,
|
|
418
418
|
controls: n,
|
|
419
|
-
children: /* @__PURE__ */
|
|
419
|
+
children: /* @__PURE__ */ o(xe, { decision: t, textValues: r })
|
|
420
420
|
}
|
|
421
421
|
)
|
|
422
422
|
] }) }, t.decisionId) : null;
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function et(e) {
|
|
425
425
|
const {
|
|
426
426
|
customTitleContentAddCard: t,
|
|
427
427
|
index: n,
|
|
428
|
-
handleOpenModal:
|
|
429
|
-
shouldRenderEmptyMessage:
|
|
428
|
+
handleOpenModal: a,
|
|
429
|
+
shouldRenderEmptyMessage: i
|
|
430
430
|
} = e, r = t || "Agregar decisión";
|
|
431
|
-
return /* @__PURE__ */
|
|
432
|
-
/* @__PURE__ */
|
|
433
|
-
/* @__PURE__ */
|
|
434
|
-
|
|
431
|
+
return /* @__PURE__ */ o(we, { children: i ? null : /* @__PURE__ */ p(g, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
|
|
432
|
+
/* @__PURE__ */ o(C, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
|
|
433
|
+
/* @__PURE__ */ o(
|
|
434
|
+
Ye,
|
|
435
435
|
{
|
|
436
|
-
onClick: () =>
|
|
437
|
-
children: /* @__PURE__ */
|
|
438
|
-
|
|
436
|
+
onClick: () => a ? a() : null,
|
|
437
|
+
children: /* @__PURE__ */ o(
|
|
438
|
+
ee,
|
|
439
439
|
{
|
|
440
440
|
id: `add-decision-${n}`,
|
|
441
441
|
handleDelete: () => {
|
|
442
442
|
},
|
|
443
|
-
handleView: () =>
|
|
443
|
+
handleView: () => a ? a() : null,
|
|
444
444
|
controls: !1,
|
|
445
|
-
children: /* @__PURE__ */
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
/* @__PURE__ */
|
|
445
|
+
children: /* @__PURE__ */ p(g, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
446
|
+
/* @__PURE__ */ o(M, { appearance: "gray", icon: /* @__PURE__ */ o(ge, {}), size: "35px" }),
|
|
447
|
+
/* @__PURE__ */ o(C, { appearance: "gray", type: "body", size: "large", children: r })
|
|
448
448
|
] })
|
|
449
449
|
}
|
|
450
450
|
)
|
|
@@ -452,86 +452,86 @@ function Ge(e) {
|
|
|
452
452
|
)
|
|
453
453
|
] }) }, `add-decision-${n}`);
|
|
454
454
|
}
|
|
455
|
-
const
|
|
456
|
-
loading:
|
|
457
|
-
decision:
|
|
458
|
-
add:
|
|
459
|
-
},
|
|
460
|
-
const { type: t } = e, n =
|
|
455
|
+
const tt = {
|
|
456
|
+
loading: Xe,
|
|
457
|
+
decision: Ze,
|
|
458
|
+
add: et
|
|
459
|
+
}, Y = (e) => {
|
|
460
|
+
const { type: t } = e, n = tt[t];
|
|
461
461
|
return n ? n(e) : null;
|
|
462
|
-
},
|
|
462
|
+
}, nt = (e) => {
|
|
463
463
|
const {
|
|
464
464
|
controls: t,
|
|
465
465
|
customTitleContentAddCard: n,
|
|
466
|
-
decisions:
|
|
467
|
-
loading:
|
|
466
|
+
decisions: a,
|
|
467
|
+
loading: i,
|
|
468
468
|
handleOpenModal: r,
|
|
469
|
-
handleDelete:
|
|
469
|
+
handleDelete: h,
|
|
470
470
|
textValues: l
|
|
471
|
-
} = e,
|
|
472
|
-
(
|
|
471
|
+
} = e, d = i ? Array.from({ length: 3 }).map(
|
|
472
|
+
(u, s) => Y({
|
|
473
473
|
type: "loading",
|
|
474
|
-
index:
|
|
474
|
+
index: s,
|
|
475
475
|
controls: t,
|
|
476
476
|
customTitleContentAddCard: n,
|
|
477
|
-
loading:
|
|
477
|
+
loading: i,
|
|
478
478
|
handleOpenModal: r,
|
|
479
|
-
handleDelete:
|
|
479
|
+
handleDelete: h,
|
|
480
480
|
textValues: l
|
|
481
481
|
})
|
|
482
|
-
) :
|
|
483
|
-
(
|
|
482
|
+
) : a == null ? void 0 : a.map(
|
|
483
|
+
(u) => Y({
|
|
484
484
|
type: "decision",
|
|
485
|
-
decision:
|
|
485
|
+
decision: u,
|
|
486
486
|
controls: t,
|
|
487
487
|
customTitleContentAddCard: n,
|
|
488
|
-
loading:
|
|
488
|
+
loading: i,
|
|
489
489
|
handleOpenModal: r,
|
|
490
|
-
handleDelete:
|
|
490
|
+
handleDelete: h,
|
|
491
491
|
textValues: l
|
|
492
492
|
})
|
|
493
|
-
),
|
|
494
|
-
return { renderedCards:
|
|
495
|
-
},
|
|
493
|
+
), c = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !i && t;
|
|
494
|
+
return { renderedCards: d, shouldRenderAddCard: c };
|
|
495
|
+
}, Pt = (e) => {
|
|
496
496
|
const {
|
|
497
497
|
controls: t = !0,
|
|
498
498
|
customTitleContentAddCard: n,
|
|
499
|
-
customMessageEmptyDecisions:
|
|
500
|
-
decisions:
|
|
499
|
+
customMessageEmptyDecisions: a,
|
|
500
|
+
decisions: i,
|
|
501
501
|
textValues: r,
|
|
502
|
-
decisionTemplate:
|
|
502
|
+
decisionTemplate: h,
|
|
503
503
|
isModalOpen: l,
|
|
504
|
-
selectedDecision:
|
|
505
|
-
loading:
|
|
506
|
-
handleOpenModal:
|
|
507
|
-
handleCloseModal:
|
|
508
|
-
handleSubmitForm:
|
|
504
|
+
selectedDecision: d,
|
|
505
|
+
loading: c,
|
|
506
|
+
handleOpenModal: u,
|
|
507
|
+
handleCloseModal: s,
|
|
508
|
+
handleSubmitForm: f,
|
|
509
509
|
handleDelete: T,
|
|
510
|
-
terms:
|
|
511
|
-
} = e,
|
|
510
|
+
terms: b = !0
|
|
511
|
+
} = e, x = V("(max-width: 681px)"), w = V("(max-width: 400px)"), { renderedCards: S, shouldRenderAddCard: k } = nt({
|
|
512
512
|
controls: t,
|
|
513
513
|
customTitleContentAddCard: n,
|
|
514
|
-
decisions:
|
|
515
|
-
loading:
|
|
516
|
-
handleOpenModal:
|
|
514
|
+
decisions: i,
|
|
515
|
+
loading: c,
|
|
516
|
+
handleOpenModal: u,
|
|
517
517
|
handleDelete: T,
|
|
518
518
|
textValues: r
|
|
519
|
-
}),
|
|
520
|
-
return /* @__PURE__ */
|
|
521
|
-
/* @__PURE__ */
|
|
522
|
-
|
|
519
|
+
}), F = (i == null ? void 0 : i.length) === 0 && !c;
|
|
520
|
+
return /* @__PURE__ */ p(A, { children: [
|
|
521
|
+
/* @__PURE__ */ o(Ke, { children: /* @__PURE__ */ o(Je, { children: /* @__PURE__ */ o(g, { direction: "column", gap: "16px", padding: "6px", children: F ? /* @__PURE__ */ p(
|
|
522
|
+
g,
|
|
523
523
|
{
|
|
524
524
|
direction: "column",
|
|
525
525
|
gap: "28px",
|
|
526
526
|
width: "100%",
|
|
527
|
-
height:
|
|
527
|
+
height: x ? "auto" : "435px",
|
|
528
528
|
justifyContent: "center",
|
|
529
529
|
alignItems: "center",
|
|
530
530
|
children: [
|
|
531
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ o(C, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */ p(A, { children: [
|
|
532
532
|
"Aún NO tienes definidas tasas de interés efectivas . Presiona",
|
|
533
|
-
/* @__PURE__ */
|
|
534
|
-
|
|
533
|
+
/* @__PURE__ */ p(
|
|
534
|
+
C,
|
|
535
535
|
{
|
|
536
536
|
as: "span",
|
|
537
537
|
type: "label",
|
|
@@ -547,20 +547,20 @@ const Qe = {
|
|
|
547
547
|
),
|
|
548
548
|
"para empezar."
|
|
549
549
|
] }) }),
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
|
|
550
|
+
/* @__PURE__ */ o(
|
|
551
|
+
L,
|
|
552
552
|
{
|
|
553
|
-
iconBefore: /* @__PURE__ */
|
|
554
|
-
onClick: () =>
|
|
553
|
+
iconBefore: /* @__PURE__ */ o(ge, {}),
|
|
554
|
+
onClick: () => u ? u() : null,
|
|
555
555
|
children: n || "Agregar decisión"
|
|
556
556
|
}
|
|
557
557
|
)
|
|
558
558
|
]
|
|
559
559
|
}
|
|
560
|
-
) : /* @__PURE__ */
|
|
561
|
-
|
|
560
|
+
) : /* @__PURE__ */ p(
|
|
561
|
+
J,
|
|
562
562
|
{
|
|
563
|
-
templateColumns:
|
|
563
|
+
templateColumns: w ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
|
|
564
564
|
autoFlow: "row dense",
|
|
565
565
|
gap: "24px",
|
|
566
566
|
alignItems: "start",
|
|
@@ -568,174 +568,440 @@ const Qe = {
|
|
|
568
568
|
autoRows: "1fr",
|
|
569
569
|
justifyItems: "center",
|
|
570
570
|
padding: "6px",
|
|
571
|
-
height:
|
|
571
|
+
height: x ? "auto" : "484px",
|
|
572
572
|
children: [
|
|
573
|
-
|
|
574
|
-
|
|
573
|
+
S,
|
|
574
|
+
k && Y({
|
|
575
575
|
type: "add",
|
|
576
|
-
index:
|
|
576
|
+
index: i == null ? void 0 : i.length,
|
|
577
577
|
controls: t,
|
|
578
578
|
customTitleContentAddCard: n,
|
|
579
|
-
customMessageEmptyDecisions:
|
|
580
|
-
loading:
|
|
581
|
-
handleOpenModal:
|
|
579
|
+
customMessageEmptyDecisions: a,
|
|
580
|
+
loading: c,
|
|
581
|
+
handleOpenModal: u,
|
|
582
582
|
handleDelete: T,
|
|
583
583
|
textValues: r,
|
|
584
|
-
shouldRenderEmptyMessage:
|
|
585
|
-
terms:
|
|
584
|
+
shouldRenderEmptyMessage: F,
|
|
585
|
+
terms: b
|
|
586
586
|
})
|
|
587
587
|
]
|
|
588
588
|
}
|
|
589
589
|
) }) }) }),
|
|
590
|
-
l && /* @__PURE__ */
|
|
591
|
-
|
|
590
|
+
l && /* @__PURE__ */ o(
|
|
591
|
+
Qe,
|
|
592
592
|
{
|
|
593
593
|
portalId: "modal-portal",
|
|
594
|
-
onCloseModal:
|
|
595
|
-
title:
|
|
596
|
-
children: /* @__PURE__ */
|
|
597
|
-
|
|
594
|
+
onCloseModal: s,
|
|
595
|
+
title: d ? "Editar Decisión" : "Nueva decisión",
|
|
596
|
+
children: /* @__PURE__ */ o(
|
|
597
|
+
Dt,
|
|
598
598
|
{
|
|
599
|
-
decision:
|
|
600
|
-
onSubmitEvent:
|
|
599
|
+
decision: d || h,
|
|
600
|
+
onSubmitEvent: f,
|
|
601
601
|
textValues: r,
|
|
602
|
-
onCancel: () =>
|
|
602
|
+
onCancel: () => s ? s() : () => {
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
605
|
)
|
|
606
606
|
}
|
|
607
607
|
)
|
|
608
608
|
] });
|
|
609
|
-
},
|
|
609
|
+
}, ot = v.div`
|
|
610
610
|
display: flex;
|
|
611
|
-
justify-content: ${({ justifyContent: e }) => e};
|
|
612
|
-
align-items: ${({ alignItems: e }) => e};
|
|
613
|
-
align-content: ${({ alignContent: e }) => e};
|
|
611
|
+
justify-content: ${({ $justifyContent: e }) => e};
|
|
612
|
+
align-items: ${({ $alignItems: e }) => e};
|
|
613
|
+
align-content: ${({ $alignContent: e }) => e};
|
|
614
614
|
flex-direction: ${({ direction: e }) => e};
|
|
615
|
-
flex-wrap: ${({ wrap: e }) => e};
|
|
615
|
+
flex-wrap: ${({ $wrap: e }) => e};
|
|
616
616
|
height: ${({ height: e }) => e};
|
|
617
617
|
width: ${({ width: e }) => e};
|
|
618
|
-
gap: ${({ gap: e }) => e};
|
|
619
|
-
margin: ${({ margin: e }) => e};
|
|
620
|
-
padding: ${({ padding: e }) => e};
|
|
621
|
-
background: ${({ background: e, theme: t }) => {
|
|
622
|
-
var n,
|
|
623
|
-
return e ? `${((
|
|
618
|
+
gap: ${({ $gap: e }) => e};
|
|
619
|
+
margin: ${({ $margin: e }) => e};
|
|
620
|
+
padding: ${({ $padding: e }) => e};
|
|
621
|
+
background: ${({ $background: e, theme: t }) => {
|
|
622
|
+
var n, a, i, r;
|
|
623
|
+
return e ? `${((a = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : a.N10) || y.palette.neutral.N10}` : `${((r = (i = t == null ? void 0 : t.palette) == null ? void 0 : i.neutral) == null ? void 0 : r.N0) || y.palette.neutral.N0}`;
|
|
624
|
+
}};
|
|
625
|
+
border: ${({ $border: e, theme: t }) => {
|
|
626
|
+
var n, a;
|
|
627
|
+
return e ? `1px solid ${((a = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : a.N40) || y.palette.neutral.N40}` : "none";
|
|
624
628
|
}};
|
|
625
|
-
border: ${({
|
|
626
|
-
|
|
627
|
-
|
|
629
|
+
border-radius: ${({ $borderRadius: e }) => e};
|
|
630
|
+
box-sizing: ${({ $boxSizing: e }) => e};
|
|
631
|
+
overflow-y: ${({ $scroll: e }) => e ? "scroll" : "none"};
|
|
632
|
+
`, te = Ae.forwardRef(
|
|
633
|
+
(e, t) => {
|
|
634
|
+
const {
|
|
635
|
+
children: n,
|
|
636
|
+
wrap: a,
|
|
637
|
+
direction: i = "column",
|
|
638
|
+
justifyContent: r,
|
|
639
|
+
alignItems: h,
|
|
640
|
+
alignContent: l,
|
|
641
|
+
height: d,
|
|
642
|
+
width: c,
|
|
643
|
+
gap: u,
|
|
644
|
+
background: s,
|
|
645
|
+
borderRadius: f,
|
|
646
|
+
border: T,
|
|
647
|
+
margin: b = "0px",
|
|
648
|
+
padding: x = "0px",
|
|
649
|
+
boxSizing: w,
|
|
650
|
+
scroll: S = !1
|
|
651
|
+
} = e;
|
|
652
|
+
return /* @__PURE__ */ o(
|
|
653
|
+
ot,
|
|
654
|
+
{
|
|
655
|
+
ref: t,
|
|
656
|
+
direction: i,
|
|
657
|
+
$justifyContent: r,
|
|
658
|
+
$alignItems: h,
|
|
659
|
+
$alignContent: l,
|
|
660
|
+
height: d,
|
|
661
|
+
width: c,
|
|
662
|
+
wrap: a,
|
|
663
|
+
$gap: u,
|
|
664
|
+
$background: s,
|
|
665
|
+
$border: T,
|
|
666
|
+
$margin: b,
|
|
667
|
+
$padding: x,
|
|
668
|
+
$borderRadius: f,
|
|
669
|
+
$boxSizing: w,
|
|
670
|
+
$scroll: S,
|
|
671
|
+
children: n
|
|
672
|
+
}
|
|
673
|
+
);
|
|
674
|
+
}
|
|
675
|
+
);
|
|
676
|
+
te.displayName = "BorderStack";
|
|
677
|
+
const at = {
|
|
678
|
+
border: {
|
|
679
|
+
color: y.palette.neutral.N40
|
|
680
|
+
}
|
|
681
|
+
}, it = v.div`
|
|
682
|
+
border-width: 1px;
|
|
683
|
+
border-style: solid;
|
|
684
|
+
border-color: ${({ theme: e }) => {
|
|
685
|
+
var t, n;
|
|
686
|
+
return ((n = (t = e == null ? void 0 : e.box) == null ? void 0 : t.border) == null ? void 0 : n.color) || at.border.color;
|
|
628
687
|
}};
|
|
629
|
-
border-radius: ${({ borderRadius: e }) => e};
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
688
|
+
border-radius: ${({ $borderRadius: e }) => e};
|
|
689
|
+
margin: ${({ $margin: e }) => e};
|
|
690
|
+
padding: ${({ $padding: e }) => e};
|
|
691
|
+
width: ${({ $width: e }) => e};
|
|
692
|
+
height: ${({ $height: e }) => e};
|
|
693
|
+
box-sizing: border-box;
|
|
694
|
+
`;
|
|
695
|
+
function rt(e) {
|
|
633
696
|
const {
|
|
634
697
|
children: t,
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
height: l,
|
|
641
|
-
width: s,
|
|
642
|
-
gap: g,
|
|
643
|
-
background: c,
|
|
644
|
-
borderRadius: d,
|
|
645
|
-
border: b,
|
|
646
|
-
margin: T = "0px",
|
|
647
|
-
padding: m = "0px",
|
|
648
|
-
boxSizing: v,
|
|
649
|
-
scroll: C = !1
|
|
698
|
+
padding: n = "16px",
|
|
699
|
+
margin: a,
|
|
700
|
+
borderRadius: i = "8px",
|
|
701
|
+
width: r,
|
|
702
|
+
height: h
|
|
650
703
|
} = e;
|
|
651
|
-
return /* @__PURE__ */
|
|
652
|
-
|
|
704
|
+
return /* @__PURE__ */ o(
|
|
705
|
+
it,
|
|
653
706
|
{
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
height:
|
|
659
|
-
width: s,
|
|
660
|
-
wrap: n,
|
|
661
|
-
gap: g,
|
|
662
|
-
background: c,
|
|
663
|
-
border: b,
|
|
664
|
-
margin: T,
|
|
665
|
-
padding: m,
|
|
666
|
-
borderRadius: d,
|
|
667
|
-
boxSizing: v,
|
|
668
|
-
scroll: C,
|
|
707
|
+
$padding: n,
|
|
708
|
+
$margin: a,
|
|
709
|
+
$borderRadius: i,
|
|
710
|
+
$width: r,
|
|
711
|
+
$height: h,
|
|
669
712
|
children: t
|
|
670
713
|
}
|
|
671
714
|
);
|
|
672
|
-
}
|
|
715
|
+
}
|
|
716
|
+
const lt = (e, t) => {
|
|
717
|
+
const [n, a] = R([]), [i, r] = R([]), [h, l] = R(!1), d = H(null);
|
|
718
|
+
return X(() => {
|
|
719
|
+
if (!e.current || !d.current) return;
|
|
720
|
+
const c = e.current, u = d.current, s = () => {
|
|
721
|
+
var F;
|
|
722
|
+
const T = c.clientWidth, b = Array.from(
|
|
723
|
+
u.querySelectorAll('[data-filter-tag="true"]')
|
|
724
|
+
), x = 48;
|
|
725
|
+
let w = 0;
|
|
726
|
+
const S = [], k = [];
|
|
727
|
+
for (let $ = 0; $ < t.length; $++) {
|
|
728
|
+
const m = ((F = b[$]) == null ? void 0 : F.offsetWidth) ?? 0;
|
|
729
|
+
w + m + x <= T ? (S.push(t[$]), w += m) : k.push(t[$]);
|
|
730
|
+
}
|
|
731
|
+
a(S), r(k), l(k.length > 0);
|
|
732
|
+
}, f = new ResizeObserver(() => {
|
|
733
|
+
requestAnimationFrame(s);
|
|
734
|
+
});
|
|
735
|
+
return f.observe(c), () => f.disconnect();
|
|
736
|
+
}, [t, e]), { visible: n, hidden: i, showOverflowIndicator: h, measurementRef: d };
|
|
737
|
+
};
|
|
738
|
+
v.div`
|
|
673
739
|
& > div {
|
|
674
740
|
width: 100%;
|
|
675
741
|
}
|
|
676
|
-
|
|
742
|
+
`;
|
|
743
|
+
const st = v.div`
|
|
744
|
+
position: absolute;
|
|
745
|
+
top: calc(100% + 4px);
|
|
746
|
+
right: 0;
|
|
747
|
+
z-index: 1000;
|
|
748
|
+
width: 170px;
|
|
749
|
+
`, dt = v.div`
|
|
750
|
+
position: absolute;
|
|
751
|
+
visibility: hidden;
|
|
752
|
+
pointer-events: none;
|
|
753
|
+
height: 0;
|
|
754
|
+
overflow: hidden;
|
|
755
|
+
`, ct = v.div`
|
|
756
|
+
cursor: pointer;
|
|
757
|
+
`, K = {
|
|
758
|
+
border: {
|
|
759
|
+
color: {
|
|
760
|
+
regular: y.palette.neutral.N40,
|
|
761
|
+
disabled: y.palette.neutral.N40,
|
|
762
|
+
focus: y.palette.blue.B300,
|
|
763
|
+
invalid: y.palette.red.R400
|
|
764
|
+
}
|
|
765
|
+
},
|
|
766
|
+
background: {
|
|
767
|
+
color: {
|
|
768
|
+
regular: y.palette.neutral.N0,
|
|
769
|
+
disabled: y.palette.neutral.N10
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
content: {
|
|
773
|
+
color: {
|
|
774
|
+
regular: y.palette.neutral.N900,
|
|
775
|
+
disabled: y.palette.neutral.N70
|
|
776
|
+
}
|
|
777
|
+
},
|
|
778
|
+
placeholder: {
|
|
779
|
+
color: {
|
|
780
|
+
regular: y.palette.neutral.N300
|
|
781
|
+
}
|
|
782
|
+
},
|
|
783
|
+
option: {
|
|
784
|
+
appearance: {
|
|
785
|
+
regular: "dark",
|
|
786
|
+
hover: "primary"
|
|
787
|
+
},
|
|
788
|
+
background: {
|
|
789
|
+
regular: y.palette.neutral.N0,
|
|
790
|
+
hover: y.palette.neutral.N30
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
}, ut = v.li`
|
|
794
|
+
display: flex;
|
|
795
|
+
align-items: center;
|
|
796
|
+
align-self: stretch;
|
|
797
|
+
min-height: 40px;
|
|
798
|
+
border-left: 4px solid transparent;
|
|
799
|
+
padding: 4px 16px 4px 12px;
|
|
800
|
+
cursor: pointer;
|
|
801
|
+
|
|
802
|
+
border-left-width: 4px;
|
|
803
|
+
border-left-style: solid;
|
|
804
|
+
|
|
805
|
+
&:hover {
|
|
806
|
+
background-color: ${({ theme: e }) => {
|
|
807
|
+
var t, n, a;
|
|
808
|
+
return ((a = (n = (t = e == null ? void 0 : e.input) == null ? void 0 : t.background) == null ? void 0 : n.color) == null ? void 0 : a.regular) || K.background.color.regular;
|
|
809
|
+
}};
|
|
810
|
+
}
|
|
811
|
+
`, ht = (e) => {
|
|
812
|
+
var f, T, b, x, w, S;
|
|
813
|
+
const { id: t, label: n, leadingIcon: a, onClose: i } = e, [r, h] = R(!1), l = () => h(!0), d = () => h(!1), c = Fe($e), u = ((b = (T = (f = c == null ? void 0 : c.input) == null ? void 0 : f.option) == null ? void 0 : T.appearance) == null ? void 0 : b.hover) ?? K.option.appearance.hover, s = ((S = (w = (x = c == null ? void 0 : c.input) == null ? void 0 : x.option) == null ? void 0 : w.appearance) == null ? void 0 : S.regular) ?? K.option.appearance.regular;
|
|
814
|
+
return /* @__PURE__ */ o(
|
|
815
|
+
ut,
|
|
816
|
+
{
|
|
817
|
+
id: t,
|
|
818
|
+
onMouseEnter: l,
|
|
819
|
+
onMouseLeave: d,
|
|
820
|
+
onClick: (k) => {
|
|
821
|
+
k.stopPropagation();
|
|
822
|
+
},
|
|
823
|
+
children: /* @__PURE__ */ p(
|
|
824
|
+
J,
|
|
825
|
+
{
|
|
826
|
+
alignItems: "center",
|
|
827
|
+
gap: "8px",
|
|
828
|
+
templateColumns: "auto 1fr auto",
|
|
829
|
+
width: "100%",
|
|
830
|
+
children: [
|
|
831
|
+
a && /* @__PURE__ */ o(
|
|
832
|
+
M,
|
|
833
|
+
{
|
|
834
|
+
icon: a,
|
|
835
|
+
size: "medium",
|
|
836
|
+
appearance: r ? u : s
|
|
837
|
+
}
|
|
838
|
+
),
|
|
839
|
+
/* @__PURE__ */ o(
|
|
840
|
+
C,
|
|
841
|
+
{
|
|
842
|
+
textAlign: "start",
|
|
843
|
+
size: "medium",
|
|
844
|
+
appearance: r ? u : s,
|
|
845
|
+
children: n
|
|
846
|
+
}
|
|
847
|
+
),
|
|
848
|
+
/* @__PURE__ */ o(
|
|
849
|
+
M,
|
|
850
|
+
{
|
|
851
|
+
icon: /* @__PURE__ */ o(Se, {}),
|
|
852
|
+
size: "small",
|
|
853
|
+
onClick: (k) => {
|
|
854
|
+
k.stopPropagation(), i == null || i();
|
|
855
|
+
},
|
|
856
|
+
appearance: r ? u : s,
|
|
857
|
+
cursorHover: !0
|
|
858
|
+
}
|
|
859
|
+
)
|
|
860
|
+
]
|
|
861
|
+
}
|
|
862
|
+
)
|
|
863
|
+
}
|
|
864
|
+
);
|
|
865
|
+
}, Gt = (e) => {
|
|
677
866
|
const {
|
|
678
|
-
appliedFilters: t,
|
|
867
|
+
appliedFilters: t = [],
|
|
679
868
|
onClear: n,
|
|
680
|
-
onClick:
|
|
681
|
-
noFiltersLabel:
|
|
869
|
+
onClick: a,
|
|
870
|
+
noFiltersLabel: i,
|
|
682
871
|
titleClearFilter: r,
|
|
683
|
-
titleFilter:
|
|
684
|
-
} = e, l =
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
),
|
|
711
|
-
|
|
712
|
-
N,
|
|
713
|
-
{
|
|
714
|
-
cursorHover: !0,
|
|
715
|
-
disabled: l,
|
|
716
|
-
iconBefore: /* @__PURE__ */ a(ie, {}),
|
|
717
|
-
onClick: n,
|
|
718
|
-
variant: "outlined",
|
|
719
|
-
children: r
|
|
720
|
-
}
|
|
721
|
-
),
|
|
722
|
-
/* @__PURE__ */ a(
|
|
723
|
-
N,
|
|
872
|
+
titleFilter: h
|
|
873
|
+
} = e, l = H(null), d = H(null), c = H(null), {
|
|
874
|
+
visible: u,
|
|
875
|
+
hidden: s,
|
|
876
|
+
showOverflowIndicator: f,
|
|
877
|
+
measurementRef: T
|
|
878
|
+
} = lt(l, t), [b, x] = R(!1), w = (m) => {
|
|
879
|
+
m.stopPropagation(), x((N) => !N);
|
|
880
|
+
};
|
|
881
|
+
X(() => {
|
|
882
|
+
const m = (N) => {
|
|
883
|
+
var ne, oe;
|
|
884
|
+
const O = N.target;
|
|
885
|
+
!((ne = d.current) != null && ne.contains(O)) && !((oe = c.current) != null && oe.contains(O)) && x(!1);
|
|
886
|
+
};
|
|
887
|
+
return b && window.addEventListener("mousedown", m), () => window.removeEventListener("mousedown", m);
|
|
888
|
+
}, [b]);
|
|
889
|
+
const S = t.length === 0, k = b && s.length > 0, F = s.map((m) => ({
|
|
890
|
+
id: m.label,
|
|
891
|
+
value: m.label,
|
|
892
|
+
label: m.label,
|
|
893
|
+
icon: m.icon
|
|
894
|
+
})), $ = (m) => {
|
|
895
|
+
var N, O;
|
|
896
|
+
(O = (N = s.find((E) => E.label === m)) == null ? void 0 : N.onClose) == null || O.call(N), x(!1);
|
|
897
|
+
};
|
|
898
|
+
return /* @__PURE__ */ p(rt, { borderRadius: "8px", width: "100%", children: [
|
|
899
|
+
/* @__PURE__ */ o(dt, { ref: T, children: t.map((m) => /* @__PURE__ */ o("div", { "data-filter-tag": "true", children: /* @__PURE__ */ o(
|
|
900
|
+
B,
|
|
724
901
|
{
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
902
|
+
appearance: "primary",
|
|
903
|
+
displayIcon: !0,
|
|
904
|
+
removable: !0,
|
|
905
|
+
icon: m.icon,
|
|
906
|
+
label: m.label,
|
|
907
|
+
onClose: m.onClose
|
|
730
908
|
}
|
|
731
|
-
)
|
|
732
|
-
|
|
733
|
-
|
|
909
|
+
) }, m.label)) }),
|
|
910
|
+
/* @__PURE__ */ p(J, { gap: "12px", templateColumns: "1fr auto auto", width: "100%", children: [
|
|
911
|
+
/* @__PURE__ */ o(
|
|
912
|
+
te,
|
|
913
|
+
{
|
|
914
|
+
ref: l,
|
|
915
|
+
background: !0,
|
|
916
|
+
borderRadius: "8px",
|
|
917
|
+
height: "100%",
|
|
918
|
+
direction: "row",
|
|
919
|
+
gap: "8px",
|
|
920
|
+
alignItems: "center",
|
|
921
|
+
padding: "0px 8px",
|
|
922
|
+
border: !0,
|
|
923
|
+
children: S ? /* @__PURE__ */ o(C, { size: "small", type: "label", appearance: "gray", children: i }) : /* @__PURE__ */ p(A, { children: [
|
|
924
|
+
u.map((m) => /* @__PURE__ */ o(
|
|
925
|
+
B,
|
|
926
|
+
{
|
|
927
|
+
"data-filter-tag": "true",
|
|
928
|
+
appearance: "primary",
|
|
929
|
+
displayIcon: !0,
|
|
930
|
+
removable: !0,
|
|
931
|
+
icon: m.icon,
|
|
932
|
+
label: m.label,
|
|
933
|
+
onClose: m.onClose
|
|
934
|
+
},
|
|
935
|
+
m.label
|
|
936
|
+
)),
|
|
937
|
+
f && /* @__PURE__ */ p(
|
|
938
|
+
"div",
|
|
939
|
+
{
|
|
940
|
+
ref: c,
|
|
941
|
+
style: { position: "relative", display: "inline-block" },
|
|
942
|
+
children: [
|
|
943
|
+
/* @__PURE__ */ o(ct, { onClick: w, children: /* @__PURE__ */ o(
|
|
944
|
+
B,
|
|
945
|
+
{
|
|
946
|
+
appearance: "primary",
|
|
947
|
+
label: `+${s.length}`
|
|
948
|
+
}
|
|
949
|
+
) }),
|
|
950
|
+
k && /* @__PURE__ */ o(st, { ref: d, children: /* @__PURE__ */ o(
|
|
951
|
+
De,
|
|
952
|
+
{
|
|
953
|
+
options: F,
|
|
954
|
+
onOptionClick: $,
|
|
955
|
+
children: s.map((m) => /* @__PURE__ */ o(
|
|
956
|
+
ht,
|
|
957
|
+
{
|
|
958
|
+
id: m.label,
|
|
959
|
+
label: m.label,
|
|
960
|
+
leadingIcon: m.icon,
|
|
961
|
+
onClose: () => {
|
|
962
|
+
var N;
|
|
963
|
+
(N = m.onClose) == null || N.call(m), x(!1);
|
|
964
|
+
}
|
|
965
|
+
},
|
|
966
|
+
m.label
|
|
967
|
+
))
|
|
968
|
+
}
|
|
969
|
+
) })
|
|
970
|
+
]
|
|
971
|
+
}
|
|
972
|
+
)
|
|
973
|
+
] })
|
|
974
|
+
}
|
|
975
|
+
),
|
|
976
|
+
/* @__PURE__ */ o(
|
|
977
|
+
L,
|
|
978
|
+
{
|
|
979
|
+
cursorHover: !0,
|
|
980
|
+
disabled: S,
|
|
981
|
+
iconBefore: /* @__PURE__ */ o(me, {}),
|
|
982
|
+
onClick: n,
|
|
983
|
+
variant: "outlined",
|
|
984
|
+
children: r
|
|
985
|
+
}
|
|
986
|
+
),
|
|
987
|
+
/* @__PURE__ */ o(
|
|
988
|
+
L,
|
|
989
|
+
{
|
|
990
|
+
cursorHover: !0,
|
|
991
|
+
iconBefore: /* @__PURE__ */ o(be, {}),
|
|
992
|
+
onClick: a,
|
|
993
|
+
variant: "outlined",
|
|
994
|
+
children: h
|
|
995
|
+
}
|
|
996
|
+
)
|
|
997
|
+
] })
|
|
998
|
+
] });
|
|
999
|
+
}, pt = v.div`
|
|
734
1000
|
display: flex;
|
|
735
1001
|
flex-direction: column;
|
|
736
1002
|
background-color: ${({ theme: e }) => {
|
|
737
1003
|
var t, n;
|
|
738
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) ||
|
|
1004
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || y.palette.neutral.N0;
|
|
739
1005
|
}};
|
|
740
1006
|
width: ${({ $smallScreen: e }) => e ? "auto" : "450px"};
|
|
741
1007
|
height: auto;
|
|
@@ -743,59 +1009,59 @@ const Qe = {
|
|
|
743
1009
|
padding: 24px;
|
|
744
1010
|
gap: 24px;
|
|
745
1011
|
box-sizing: border-box;
|
|
746
|
-
`,
|
|
1012
|
+
`, Qt = (e) => {
|
|
747
1013
|
const {
|
|
748
1014
|
actionButtonLabel: t,
|
|
749
1015
|
cancelButtonLabel: n,
|
|
750
|
-
children:
|
|
751
|
-
loading:
|
|
1016
|
+
children: a,
|
|
1017
|
+
loading: i,
|
|
752
1018
|
onClick: r,
|
|
753
|
-
onCloseModal:
|
|
1019
|
+
onCloseModal: h,
|
|
754
1020
|
portalId: l,
|
|
755
|
-
title:
|
|
756
|
-
} = e,
|
|
757
|
-
if (!
|
|
1021
|
+
title: d
|
|
1022
|
+
} = e, c = V("(max-width: 768px)"), u = document.getElementById(l);
|
|
1023
|
+
if (!u)
|
|
758
1024
|
throw new Error(
|
|
759
1025
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
760
1026
|
);
|
|
761
|
-
return
|
|
762
|
-
/* @__PURE__ */
|
|
763
|
-
/* @__PURE__ */
|
|
764
|
-
/* @__PURE__ */
|
|
765
|
-
/* @__PURE__ */
|
|
766
|
-
/* @__PURE__ */
|
|
767
|
-
/* @__PURE__ */
|
|
768
|
-
/* @__PURE__ */
|
|
1027
|
+
return ye(
|
|
1028
|
+
/* @__PURE__ */ o(fe, { children: /* @__PURE__ */ p(pt, { $smallScreen: c, children: [
|
|
1029
|
+
/* @__PURE__ */ p(g, { direction: "column", gap: "16px", children: [
|
|
1030
|
+
/* @__PURE__ */ p(g, { alignContent: "center", justifyContent: "space-between", children: [
|
|
1031
|
+
/* @__PURE__ */ o(C, { appearance: "dark", size: "small", type: "headline", children: d }),
|
|
1032
|
+
/* @__PURE__ */ p(g, { alignItems: "center", children: [
|
|
1033
|
+
/* @__PURE__ */ o(C, { children: "Cerrar" }),
|
|
1034
|
+
/* @__PURE__ */ o(
|
|
769
1035
|
M,
|
|
770
1036
|
{
|
|
771
1037
|
appearance: "dark",
|
|
772
|
-
icon: /* @__PURE__ */
|
|
773
|
-
onClick:
|
|
1038
|
+
icon: /* @__PURE__ */ o(pe, {}),
|
|
1039
|
+
onClick: h,
|
|
774
1040
|
cursorHover: !0
|
|
775
1041
|
}
|
|
776
1042
|
)
|
|
777
1043
|
] })
|
|
778
1044
|
] }),
|
|
779
|
-
/* @__PURE__ */
|
|
1045
|
+
/* @__PURE__ */ o(I, {})
|
|
780
1046
|
] }),
|
|
781
|
-
|
|
782
|
-
/* @__PURE__ */
|
|
783
|
-
/* @__PURE__ */
|
|
784
|
-
|
|
1047
|
+
a,
|
|
1048
|
+
/* @__PURE__ */ p(g, { gap: "20px", justifyContent: "flex-end", children: [
|
|
1049
|
+
/* @__PURE__ */ o(
|
|
1050
|
+
L,
|
|
785
1051
|
{
|
|
786
1052
|
appearance: "gray",
|
|
787
|
-
onClick:
|
|
788
|
-
iconBefore: /* @__PURE__ */
|
|
1053
|
+
onClick: h,
|
|
1054
|
+
iconBefore: /* @__PURE__ */ o(me, {}),
|
|
789
1055
|
spacing: "wide",
|
|
790
1056
|
variant: "outlined",
|
|
791
1057
|
children: n
|
|
792
1058
|
}
|
|
793
1059
|
),
|
|
794
|
-
/* @__PURE__ */
|
|
795
|
-
|
|
1060
|
+
/* @__PURE__ */ o(
|
|
1061
|
+
L,
|
|
796
1062
|
{
|
|
797
1063
|
appearance: "primary",
|
|
798
|
-
loading:
|
|
1064
|
+
loading: i,
|
|
799
1065
|
onClick: r,
|
|
800
1066
|
spacing: "wide",
|
|
801
1067
|
variant: "filled",
|
|
@@ -804,16 +1070,16 @@ const Qe = {
|
|
|
804
1070
|
)
|
|
805
1071
|
] })
|
|
806
1072
|
] }) }),
|
|
807
|
-
|
|
1073
|
+
u
|
|
808
1074
|
);
|
|
809
|
-
},
|
|
810
|
-
const { appliedFilters: t, fields: n, onChange:
|
|
811
|
-
return /* @__PURE__ */
|
|
812
|
-
r && /* @__PURE__ */
|
|
813
|
-
/* @__PURE__ */
|
|
814
|
-
/* @__PURE__ */
|
|
815
|
-
/* @__PURE__ */
|
|
816
|
-
|
|
1075
|
+
}, Wt = (e) => {
|
|
1076
|
+
const { appliedFilters: t, fields: n, onChange: a, noFiltersLabel: i } = e, r = V("(max-width: 768px)"), h = !t || t.length === 0;
|
|
1077
|
+
return /* @__PURE__ */ p(g, { direction: "column", gap: "16px", children: [
|
|
1078
|
+
r && /* @__PURE__ */ p(A, { children: [
|
|
1079
|
+
/* @__PURE__ */ p(g, { gap: "6px", width: "100%", alignItems: "center", children: [
|
|
1080
|
+
/* @__PURE__ */ o(M, { appearance: "gray", icon: /* @__PURE__ */ o(be, {}) }),
|
|
1081
|
+
/* @__PURE__ */ o(
|
|
1082
|
+
te,
|
|
817
1083
|
{
|
|
818
1084
|
background: !0,
|
|
819
1085
|
borderRadius: "8px",
|
|
@@ -823,9 +1089,9 @@ const Qe = {
|
|
|
823
1089
|
padding: "0px 8px",
|
|
824
1090
|
border: !0,
|
|
825
1091
|
width: "100%",
|
|
826
|
-
height: "
|
|
827
|
-
children:
|
|
828
|
-
|
|
1092
|
+
height: "36px",
|
|
1093
|
+
children: h ? /* @__PURE__ */ o(C, { size: "small", type: "label", appearance: "gray", children: i }) : t == null ? void 0 : t.map((l) => /* @__PURE__ */ o(
|
|
1094
|
+
B,
|
|
829
1095
|
{
|
|
830
1096
|
appearance: "primary",
|
|
831
1097
|
displayIcon: !0,
|
|
@@ -839,19 +1105,19 @@ const Qe = {
|
|
|
839
1105
|
}
|
|
840
1106
|
)
|
|
841
1107
|
] }),
|
|
842
|
-
/* @__PURE__ */
|
|
1108
|
+
/* @__PURE__ */ o(I, { dashed: !0 })
|
|
843
1109
|
] }),
|
|
844
|
-
n.map((l) => /* @__PURE__ */
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
/* @__PURE__ */
|
|
847
|
-
|
|
1110
|
+
n.map((l) => /* @__PURE__ */ p(g, { gap: "6px", alignItems: "center", children: [
|
|
1111
|
+
/* @__PURE__ */ o(g, { padding: "22px 0 0 0", children: /* @__PURE__ */ o(M, { appearance: "primary", icon: l.icon }) }),
|
|
1112
|
+
/* @__PURE__ */ o(
|
|
1113
|
+
ke,
|
|
848
1114
|
{
|
|
849
1115
|
disabled: l.disabled,
|
|
850
1116
|
invalid: l.invalid,
|
|
851
1117
|
label: l.label,
|
|
852
1118
|
message: l.message,
|
|
853
1119
|
name: l.name,
|
|
854
|
-
onChange:
|
|
1120
|
+
onChange: a,
|
|
855
1121
|
options: l.options,
|
|
856
1122
|
placeholder: l.placeholder,
|
|
857
1123
|
required: l.required,
|
|
@@ -862,9 +1128,9 @@ const Qe = {
|
|
|
862
1128
|
)
|
|
863
1129
|
] }, l.name))
|
|
864
1130
|
] });
|
|
865
|
-
},
|
|
1131
|
+
}, Yt = (e) => {
|
|
866
1132
|
console.log(e);
|
|
867
|
-
const { dataDecision: t, originalDecision: n } = e,
|
|
1133
|
+
const { dataDecision: t, originalDecision: n } = e, a = {
|
|
868
1134
|
conditionName: t.ruleName || "",
|
|
869
1135
|
labelName: t.labelName || "",
|
|
870
1136
|
conditionDataType: t.decisionDataType || "alphabetical",
|
|
@@ -876,17 +1142,17 @@ const Qe = {
|
|
|
876
1142
|
return {
|
|
877
1143
|
...n,
|
|
878
1144
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
879
|
-
(
|
|
1145
|
+
(i) => i.hidden ? { ...a } : i
|
|
880
1146
|
)
|
|
881
1147
|
};
|
|
882
|
-
},
|
|
1148
|
+
}, Kt = (e) => {
|
|
883
1149
|
const { decisions: t } = e;
|
|
884
1150
|
return t == null ? void 0 : t.map((n) => {
|
|
885
|
-
var
|
|
886
|
-
const
|
|
1151
|
+
var i;
|
|
1152
|
+
const a = (i = n.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
|
|
887
1153
|
(r) => r.hidden
|
|
888
1154
|
);
|
|
889
|
-
return
|
|
1155
|
+
return a ? {
|
|
890
1156
|
...n,
|
|
891
1157
|
ruleName: n.ruleName,
|
|
892
1158
|
labelName: n.labelName,
|
|
@@ -894,19 +1160,19 @@ const Qe = {
|
|
|
894
1160
|
value: n.value,
|
|
895
1161
|
howToSetTheDecision: n.howToSetTheDecision,
|
|
896
1162
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
897
|
-
(r) => r.hidden ? { ...
|
|
1163
|
+
(r) => r.hidden ? { ...a, hidden: !1 } : r
|
|
898
1164
|
)
|
|
899
1165
|
} : n;
|
|
900
1166
|
});
|
|
901
|
-
},
|
|
902
|
-
schema:
|
|
1167
|
+
}, gt = (e) => ({
|
|
1168
|
+
schema: Z().required("Required").test(
|
|
903
1169
|
"non-empty",
|
|
904
1170
|
"Value cannot be empty",
|
|
905
1171
|
(t) => t != null && t.trim() !== ""
|
|
906
1172
|
),
|
|
907
1173
|
value: e
|
|
908
|
-
}),
|
|
909
|
-
schema:
|
|
1174
|
+
}), mt = (e) => ({
|
|
1175
|
+
schema: ve().test(
|
|
910
1176
|
"isArrayOrString",
|
|
911
1177
|
"Must be an array of strings/numbers or a single string",
|
|
912
1178
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -914,8 +1180,8 @@ const Qe = {
|
|
|
914
1180
|
) : typeof t == "string"
|
|
915
1181
|
),
|
|
916
1182
|
value: e
|
|
917
|
-
}),
|
|
918
|
-
schema:
|
|
1183
|
+
}), bt = (e) => ({
|
|
1184
|
+
schema: ve().test(
|
|
919
1185
|
"isArrayOrString",
|
|
920
1186
|
"Must be an array of strings/numbers or a single string",
|
|
921
1187
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -923,44 +1189,44 @@ const Qe = {
|
|
|
923
1189
|
) : typeof t == "string"
|
|
924
1190
|
),
|
|
925
1191
|
value: e
|
|
926
|
-
}),
|
|
1192
|
+
}), ft = (e) => {
|
|
927
1193
|
const t = (e == null ? void 0 : e.from) ?? 0, n = (e == null ? void 0 : e.to) ?? 0;
|
|
928
1194
|
return {
|
|
929
|
-
schema:
|
|
930
|
-
from:
|
|
931
|
-
to:
|
|
1195
|
+
schema: P({
|
|
1196
|
+
from: W().required("Range From is required").max(n, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
|
|
1197
|
+
to: W().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
|
|
932
1198
|
"is-greater",
|
|
933
1199
|
"To value must be greater than From value",
|
|
934
|
-
function(
|
|
935
|
-
const { from:
|
|
936
|
-
return
|
|
1200
|
+
function(a) {
|
|
1201
|
+
const { from: i } = this.parent;
|
|
1202
|
+
return a > i;
|
|
937
1203
|
}
|
|
938
1204
|
)
|
|
939
1205
|
}),
|
|
940
1206
|
value: { from: t, to: n }
|
|
941
1207
|
};
|
|
942
|
-
},
|
|
943
|
-
schema:
|
|
1208
|
+
}, Q = (e, t) => t === z.PERCENTAGE ? {
|
|
1209
|
+
schema: W().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
|
|
944
1210
|
value: e
|
|
945
1211
|
} : {
|
|
946
|
-
schema:
|
|
1212
|
+
schema: Z().required("Required"),
|
|
947
1213
|
value: e
|
|
948
|
-
},
|
|
949
|
-
[
|
|
950
|
-
[
|
|
951
|
-
[
|
|
952
|
-
[
|
|
953
|
-
[
|
|
954
|
-
[
|
|
955
|
-
},
|
|
956
|
-
function
|
|
1214
|
+
}, Tt = {
|
|
1215
|
+
[D.LIST_OF_VALUES]: mt,
|
|
1216
|
+
[D.LIST_OF_VALUES_MULTI]: bt,
|
|
1217
|
+
[D.RANGE]: ft,
|
|
1218
|
+
[D.GREATER_THAN]: Q,
|
|
1219
|
+
[D.LESS_THAN]: Q,
|
|
1220
|
+
[D.EQUAL]: Q
|
|
1221
|
+
}, ce = (e) => Tt[e] || gt;
|
|
1222
|
+
function yt({
|
|
957
1223
|
decision: e,
|
|
958
1224
|
onSubmitEvent: t,
|
|
959
1225
|
textValues: n
|
|
960
1226
|
}) {
|
|
961
|
-
const
|
|
1227
|
+
const a = {
|
|
962
1228
|
ruleName: e.ruleName || "",
|
|
963
|
-
decisionDataType: e.decisionDataType ||
|
|
1229
|
+
decisionDataType: e.decisionDataType || z.ALPHABETICAL,
|
|
964
1230
|
howToSetTheDecision: e.howToSetTheDecision || "",
|
|
965
1231
|
value: e.value || "",
|
|
966
1232
|
effectiveFrom: e.effectiveFrom || "",
|
|
@@ -970,108 +1236,108 @@ function at({
|
|
|
970
1236
|
checkClosed: !1,
|
|
971
1237
|
terms: !0
|
|
972
1238
|
};
|
|
973
|
-
let
|
|
1239
|
+
let i;
|
|
974
1240
|
const r = {
|
|
975
|
-
ruleName:
|
|
976
|
-
value:
|
|
977
|
-
|
|
1241
|
+
ruleName: Z().required("Name is required"),
|
|
1242
|
+
value: re(() => ce(
|
|
1243
|
+
i.values.howToSetTheDecision
|
|
978
1244
|
)(
|
|
979
|
-
|
|
980
|
-
|
|
1245
|
+
i.values.value,
|
|
1246
|
+
i.values.decisionDataType
|
|
981
1247
|
).schema),
|
|
982
|
-
conditionsThatEstablishesTheDecision:
|
|
983
|
-
var
|
|
984
|
-
if ((
|
|
985
|
-
const
|
|
986
|
-
(T,
|
|
987
|
-
if (
|
|
988
|
-
const
|
|
989
|
-
|
|
1248
|
+
conditionsThatEstablishesTheDecision: re((d, { parent: c }) => {
|
|
1249
|
+
var f;
|
|
1250
|
+
if ((c == null ? void 0 : c.toggleNone) && Object.keys(c.conditionsThatEstablishesTheDecision || {}).length > 0) return P().shape({});
|
|
1251
|
+
const s = (f = e.conditionsThatEstablishesTheDecision) == null ? void 0 : f.reduce(
|
|
1252
|
+
(T, b) => {
|
|
1253
|
+
if (i.values.conditionsThatEstablishesTheDecision[b.conditionName] !== void 0) {
|
|
1254
|
+
const w = ce(
|
|
1255
|
+
b.howToSetTheCondition
|
|
990
1256
|
);
|
|
991
|
-
T[
|
|
992
|
-
|
|
993
|
-
|
|
1257
|
+
T[b.conditionName] = w(
|
|
1258
|
+
b.value,
|
|
1259
|
+
b.conditionDataType
|
|
994
1260
|
).schema;
|
|
995
1261
|
}
|
|
996
1262
|
return T;
|
|
997
1263
|
},
|
|
998
1264
|
{}
|
|
999
1265
|
);
|
|
1000
|
-
return
|
|
1266
|
+
return P(s).test(
|
|
1001
1267
|
"at-least-one-condition",
|
|
1002
1268
|
"It must be at least one condition in order for the decision to be validated correctly.",
|
|
1003
1269
|
(T) => T ? Object.values(T).some(
|
|
1004
|
-
(
|
|
1270
|
+
(b) => b != null && b !== ""
|
|
1005
1271
|
) : !1
|
|
1006
1272
|
);
|
|
1007
1273
|
})
|
|
1008
1274
|
};
|
|
1009
|
-
n.terms && (r.effectiveFrom =
|
|
1275
|
+
n.terms && (r.effectiveFrom = le().required(
|
|
1010
1276
|
"effective From date is required"
|
|
1011
|
-
), r.validUntil =
|
|
1277
|
+
), r.validUntil = le().when(
|
|
1012
1278
|
"checkClosed",
|
|
1013
|
-
(
|
|
1279
|
+
(d, c, { parent: u }) => (u == null ? void 0 : u.checkClosed) ? c.required("valid Until date is required").test(
|
|
1014
1280
|
"is-after-startDate",
|
|
1015
1281
|
"valid Until date must be greater than or equal to Start date",
|
|
1016
|
-
function(
|
|
1282
|
+
function(f) {
|
|
1017
1283
|
const T = this.parent.effectiveFrom;
|
|
1018
|
-
return !T || !
|
|
1284
|
+
return !T || !f ? !0 : new Date(f) >= new Date(T);
|
|
1019
1285
|
}
|
|
1020
|
-
) :
|
|
1286
|
+
) : c.notRequired()
|
|
1021
1287
|
));
|
|
1022
|
-
const
|
|
1023
|
-
return
|
|
1024
|
-
initialValues:
|
|
1025
|
-
validationSchema:
|
|
1288
|
+
const h = P(r);
|
|
1289
|
+
return i = Ie({
|
|
1290
|
+
initialValues: a,
|
|
1291
|
+
validationSchema: h,
|
|
1026
1292
|
validateOnBlur: !0,
|
|
1027
|
-
onSubmit: (
|
|
1028
|
-
var
|
|
1029
|
-
const
|
|
1293
|
+
onSubmit: (d) => {
|
|
1294
|
+
var u;
|
|
1295
|
+
const c = {
|
|
1030
1296
|
...e,
|
|
1031
|
-
ruleName:
|
|
1032
|
-
decisionDataType:
|
|
1033
|
-
howToSetTheDecision:
|
|
1034
|
-
value:
|
|
1035
|
-
effectiveFrom:
|
|
1036
|
-
validUntil:
|
|
1037
|
-
conditionsThatEstablishesTheDecision: (
|
|
1038
|
-
const
|
|
1039
|
-
return
|
|
1040
|
-
}).map((
|
|
1041
|
-
...
|
|
1042
|
-
value:
|
|
1297
|
+
ruleName: d.ruleName,
|
|
1298
|
+
decisionDataType: d.decisionDataType,
|
|
1299
|
+
howToSetTheDecision: d.howToSetTheDecision,
|
|
1300
|
+
value: d.value,
|
|
1301
|
+
effectiveFrom: d.effectiveFrom,
|
|
1302
|
+
validUntil: d.validUntil,
|
|
1303
|
+
conditionsThatEstablishesTheDecision: (u = e.conditionsThatEstablishesTheDecision) == null ? void 0 : u.filter((s) => {
|
|
1304
|
+
const f = d.conditionsThatEstablishesTheDecision[s.conditionName];
|
|
1305
|
+
return f != null && f !== "";
|
|
1306
|
+
}).map((s) => ({
|
|
1307
|
+
...s,
|
|
1308
|
+
value: d.conditionsThatEstablishesTheDecision[s.conditionName]
|
|
1043
1309
|
}))
|
|
1044
1310
|
};
|
|
1045
|
-
t(
|
|
1311
|
+
t(c);
|
|
1046
1312
|
}
|
|
1047
|
-
}), { formik:
|
|
1048
|
-
var
|
|
1049
|
-
|
|
1050
|
-
if (
|
|
1051
|
-
|
|
1052
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1313
|
+
}), { formik: i, handleToggleNoneChange: (d) => {
|
|
1314
|
+
var c;
|
|
1315
|
+
i.setFieldValue("toggleNone", d), (c = e.conditionsThatEstablishesTheDecision) == null || c.forEach((u) => {
|
|
1316
|
+
if (d)
|
|
1317
|
+
i.setFieldValue(
|
|
1318
|
+
`conditionsThatEstablishesTheDecision.${u.conditionName}`,
|
|
1053
1319
|
void 0
|
|
1054
1320
|
);
|
|
1055
1321
|
else {
|
|
1056
|
-
const
|
|
1057
|
-
|
|
1058
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1059
|
-
|
|
1322
|
+
const s = u.howToSetTheCondition === D.LIST_OF_VALUES_MULTI ? [] : "";
|
|
1323
|
+
i.setFieldValue(
|
|
1324
|
+
`conditionsThatEstablishesTheDecision.${u.conditionName}`,
|
|
1325
|
+
s
|
|
1060
1326
|
);
|
|
1061
1327
|
}
|
|
1062
1328
|
});
|
|
1063
1329
|
} };
|
|
1064
1330
|
}
|
|
1065
|
-
const
|
|
1331
|
+
const vt = v.div`
|
|
1066
1332
|
& > div {
|
|
1067
1333
|
border-radius: 8px;
|
|
1068
1334
|
border: 1px solid
|
|
1069
1335
|
${({ theme: e }) => {
|
|
1070
1336
|
var t, n;
|
|
1071
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) ||
|
|
1337
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
|
|
1072
1338
|
}};
|
|
1073
1339
|
}
|
|
1074
|
-
`,
|
|
1340
|
+
`, xt = v.div`
|
|
1075
1341
|
width: 100%;
|
|
1076
1342
|
height: 100%;
|
|
1077
1343
|
overflow-y: auto;
|
|
@@ -1088,61 +1354,61 @@ const it = f.div`
|
|
|
1088
1354
|
background-color: #ebecf0;
|
|
1089
1355
|
border-radius: 8px;
|
|
1090
1356
|
}
|
|
1091
|
-
`,
|
|
1357
|
+
`, wt = (e) => {
|
|
1092
1358
|
const {
|
|
1093
1359
|
checked: t,
|
|
1094
1360
|
children: n,
|
|
1095
|
-
handleToggleChange:
|
|
1096
|
-
id:
|
|
1361
|
+
handleToggleChange: a,
|
|
1362
|
+
id: i,
|
|
1097
1363
|
labelToggle: r,
|
|
1098
|
-
name:
|
|
1364
|
+
name: h,
|
|
1099
1365
|
valueToggle: l = ""
|
|
1100
|
-
} = e, [
|
|
1101
|
-
|
|
1366
|
+
} = e, [d, c] = R(t), u = (s) => {
|
|
1367
|
+
c(s.target.checked), a(s);
|
|
1102
1368
|
};
|
|
1103
|
-
return
|
|
1104
|
-
|
|
1105
|
-
}, [t]), /* @__PURE__ */
|
|
1106
|
-
/* @__PURE__ */
|
|
1107
|
-
|
|
1369
|
+
return X(() => {
|
|
1370
|
+
c(t);
|
|
1371
|
+
}, [t]), /* @__PURE__ */ p(A, { children: [
|
|
1372
|
+
/* @__PURE__ */ o(g, { children: /* @__PURE__ */ o(
|
|
1373
|
+
Te,
|
|
1108
1374
|
{
|
|
1109
|
-
checked:
|
|
1110
|
-
id:
|
|
1111
|
-
name:
|
|
1112
|
-
onChange:
|
|
1375
|
+
checked: d,
|
|
1376
|
+
id: i,
|
|
1377
|
+
name: h,
|
|
1378
|
+
onChange: u,
|
|
1113
1379
|
size: "small",
|
|
1114
1380
|
value: l,
|
|
1115
|
-
children: /* @__PURE__ */
|
|
1381
|
+
children: /* @__PURE__ */ o(C, { size: "medium", type: "label", weight: "bold", children: r })
|
|
1116
1382
|
}
|
|
1117
1383
|
) }),
|
|
1118
|
-
|
|
1384
|
+
d && /* @__PURE__ */ o(A, { children: n })
|
|
1119
1385
|
] });
|
|
1120
|
-
},
|
|
1386
|
+
}, Ct = (e) => {
|
|
1121
1387
|
const {
|
|
1122
1388
|
onHandleStartChange: t,
|
|
1123
1389
|
onHandleEndChange: n,
|
|
1124
|
-
onCheckClosedChange:
|
|
1125
|
-
labelStart:
|
|
1390
|
+
onCheckClosedChange: a,
|
|
1391
|
+
labelStart: i,
|
|
1126
1392
|
labelEnd: r,
|
|
1127
|
-
checkedClosed:
|
|
1393
|
+
checkedClosed: h = !1,
|
|
1128
1394
|
required: l = !1,
|
|
1129
|
-
valueStart:
|
|
1130
|
-
valueEnd:
|
|
1131
|
-
messageStart:
|
|
1132
|
-
messageEnd:
|
|
1133
|
-
statusStart:
|
|
1395
|
+
valueStart: d = "",
|
|
1396
|
+
valueEnd: c = "",
|
|
1397
|
+
messageStart: u = "",
|
|
1398
|
+
messageEnd: s = "",
|
|
1399
|
+
statusStart: f = "pending",
|
|
1134
1400
|
statusEnd: T = "pending"
|
|
1135
|
-
} = e, [
|
|
1136
|
-
|
|
1137
|
-
},
|
|
1138
|
-
|
|
1139
|
-
},
|
|
1140
|
-
|
|
1141
|
-
},
|
|
1142
|
-
return /* @__PURE__ */
|
|
1143
|
-
/* @__PURE__ */
|
|
1144
|
-
/* @__PURE__ */
|
|
1145
|
-
|
|
1401
|
+
} = e, [b, x] = R(h), [w, S] = R(d), [k, F] = R(c), $ = ({ target: E }) => {
|
|
1402
|
+
x(E.checked), a && a(E.checked);
|
|
1403
|
+
}, m = (E) => {
|
|
1404
|
+
S(E.target.value), t(E);
|
|
1405
|
+
}, N = (E) => {
|
|
1406
|
+
F(E.target.value), n(E);
|
|
1407
|
+
}, O = V("(max-width: 400px)");
|
|
1408
|
+
return /* @__PURE__ */ p(A, { children: [
|
|
1409
|
+
/* @__PURE__ */ p(g, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
1410
|
+
/* @__PURE__ */ o(
|
|
1411
|
+
C,
|
|
1146
1412
|
{
|
|
1147
1413
|
appearance: "gray",
|
|
1148
1414
|
margin: "10px 0",
|
|
@@ -1152,133 +1418,133 @@ const it = f.div`
|
|
|
1152
1418
|
children: "Vigencia"
|
|
1153
1419
|
}
|
|
1154
1420
|
),
|
|
1155
|
-
/* @__PURE__ */
|
|
1156
|
-
|
|
1421
|
+
/* @__PURE__ */ o(
|
|
1422
|
+
g,
|
|
1157
1423
|
{
|
|
1158
1424
|
alignContent: "center",
|
|
1159
1425
|
justifyContent: "center",
|
|
1160
1426
|
wrap: "wrap",
|
|
1161
1427
|
gap: "4px",
|
|
1162
|
-
children: /* @__PURE__ */
|
|
1163
|
-
|
|
1428
|
+
children: /* @__PURE__ */ o(
|
|
1429
|
+
Ne,
|
|
1164
1430
|
{
|
|
1165
1431
|
label: "Cerrada",
|
|
1166
|
-
onChange:
|
|
1167
|
-
checked:
|
|
1432
|
+
onChange: $,
|
|
1433
|
+
checked: b,
|
|
1168
1434
|
value: ""
|
|
1169
1435
|
}
|
|
1170
1436
|
)
|
|
1171
1437
|
}
|
|
1172
1438
|
)
|
|
1173
1439
|
] }),
|
|
1174
|
-
/* @__PURE__ */
|
|
1175
|
-
|
|
1440
|
+
/* @__PURE__ */ p(
|
|
1441
|
+
g,
|
|
1176
1442
|
{
|
|
1177
|
-
direction:
|
|
1443
|
+
direction: O ? "column" : "row",
|
|
1178
1444
|
justifyContent: "space-between",
|
|
1179
1445
|
gap: "24px",
|
|
1180
1446
|
children: [
|
|
1181
|
-
/* @__PURE__ */
|
|
1182
|
-
|
|
1447
|
+
/* @__PURE__ */ o(
|
|
1448
|
+
ae,
|
|
1183
1449
|
{
|
|
1184
1450
|
id: "dateStart",
|
|
1185
|
-
label:
|
|
1186
|
-
onChange:
|
|
1187
|
-
value:
|
|
1451
|
+
label: i,
|
|
1452
|
+
onChange: m,
|
|
1453
|
+
value: w,
|
|
1188
1454
|
required: l,
|
|
1189
1455
|
size: "compact",
|
|
1190
|
-
status:
|
|
1191
|
-
message:
|
|
1456
|
+
status: f,
|
|
1457
|
+
message: u
|
|
1192
1458
|
}
|
|
1193
1459
|
),
|
|
1194
|
-
|
|
1195
|
-
|
|
1460
|
+
b && /* @__PURE__ */ o(
|
|
1461
|
+
ae,
|
|
1196
1462
|
{
|
|
1197
1463
|
id: "dateEnd",
|
|
1198
1464
|
label: r,
|
|
1199
|
-
onChange:
|
|
1200
|
-
value:
|
|
1465
|
+
onChange: N,
|
|
1466
|
+
value: k,
|
|
1201
1467
|
required: l,
|
|
1202
1468
|
size: "compact",
|
|
1203
1469
|
status: T,
|
|
1204
|
-
message:
|
|
1470
|
+
message: s
|
|
1205
1471
|
}
|
|
1206
1472
|
)
|
|
1207
1473
|
]
|
|
1208
1474
|
}
|
|
1209
1475
|
)
|
|
1210
1476
|
] });
|
|
1211
|
-
},
|
|
1477
|
+
}, St = (e) => {
|
|
1212
1478
|
const {
|
|
1213
1479
|
formik: t,
|
|
1214
1480
|
textValues: n,
|
|
1215
|
-
onCancel:
|
|
1216
|
-
visibleConditions:
|
|
1481
|
+
onCancel: a,
|
|
1482
|
+
visibleConditions: i,
|
|
1217
1483
|
normalizedDecision: r,
|
|
1218
|
-
handleToggleNoneChange:
|
|
1484
|
+
handleToggleNoneChange: h,
|
|
1219
1485
|
handleConditionToggleChange: l,
|
|
1220
|
-
showConditionsError:
|
|
1221
|
-
termStartStatus:
|
|
1222
|
-
termEndStatus:
|
|
1486
|
+
showConditionsError: d,
|
|
1487
|
+
termStartStatus: c,
|
|
1488
|
+
termEndStatus: u
|
|
1223
1489
|
} = e;
|
|
1224
|
-
return /* @__PURE__ */
|
|
1225
|
-
|
|
1490
|
+
return /* @__PURE__ */ o("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ p(g, { direction: "column", gap: "24px", children: [
|
|
1491
|
+
ie({
|
|
1226
1492
|
condition: r,
|
|
1227
1493
|
formik: t,
|
|
1228
1494
|
isDecision: !0
|
|
1229
1495
|
}),
|
|
1230
|
-
/* @__PURE__ */
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
-
|
|
1496
|
+
/* @__PURE__ */ o(I, { dashed: !0 }),
|
|
1497
|
+
/* @__PURE__ */ o(vt, { children: /* @__PURE__ */ o(xt, { children: /* @__PURE__ */ p(
|
|
1498
|
+
g,
|
|
1233
1499
|
{
|
|
1234
1500
|
direction: "column",
|
|
1235
1501
|
padding: "6px 12px",
|
|
1236
1502
|
gap: "16px",
|
|
1237
1503
|
height: "272px",
|
|
1238
1504
|
children: [
|
|
1239
|
-
/* @__PURE__ */
|
|
1240
|
-
|
|
1505
|
+
/* @__PURE__ */ p(
|
|
1506
|
+
g,
|
|
1241
1507
|
{
|
|
1242
1508
|
justifyContent: "space-between",
|
|
1243
1509
|
alignItems: "center",
|
|
1244
1510
|
gap: "64px",
|
|
1245
1511
|
children: [
|
|
1246
|
-
/* @__PURE__ */
|
|
1247
|
-
/* @__PURE__ */
|
|
1248
|
-
|
|
1512
|
+
/* @__PURE__ */ o(C, { type: "title", size: "small", weight: "bold", appearance: "gray", children: n.factsThatConditionIt }),
|
|
1513
|
+
/* @__PURE__ */ o(
|
|
1514
|
+
Te,
|
|
1249
1515
|
{
|
|
1250
1516
|
id: "toggleNone",
|
|
1251
|
-
onChange: () =>
|
|
1517
|
+
onChange: () => h(!t.values.toggleNone),
|
|
1252
1518
|
checked: t.values.toggleNone,
|
|
1253
1519
|
size: "small",
|
|
1254
|
-
children: /* @__PURE__ */
|
|
1520
|
+
children: /* @__PURE__ */ o(C, { as: "span", size: "medium", type: "label", weight: "bold", children: n.none })
|
|
1255
1521
|
}
|
|
1256
1522
|
)
|
|
1257
1523
|
]
|
|
1258
1524
|
}
|
|
1259
1525
|
),
|
|
1260
|
-
/* @__PURE__ */
|
|
1261
|
-
|
|
1526
|
+
/* @__PURE__ */ o(g, { direction: "column", gap: "20px", children: i == null ? void 0 : i.map((s) => /* @__PURE__ */ o(
|
|
1527
|
+
wt,
|
|
1262
1528
|
{
|
|
1263
|
-
id: `toggle-${
|
|
1264
|
-
name: `toggle.${
|
|
1265
|
-
labelToggle:
|
|
1266
|
-
checked: !t.values.toggleNone && t.values.conditionsThatEstablishesTheDecision[
|
|
1267
|
-
handleToggleChange: (
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
)(
|
|
1271
|
-
children:
|
|
1529
|
+
id: `toggle-${s.conditionName}`,
|
|
1530
|
+
name: `toggle.${s.conditionName}`,
|
|
1531
|
+
labelToggle: s.labelName,
|
|
1532
|
+
checked: !t.values.toggleNone && t.values.conditionsThatEstablishesTheDecision[s.conditionName] !== void 0,
|
|
1533
|
+
handleToggleChange: (f) => l(
|
|
1534
|
+
s.conditionName,
|
|
1535
|
+
s.howToSetTheCondition === D.LIST_OF_VALUES_MULTI
|
|
1536
|
+
)(f.target.checked),
|
|
1537
|
+
children: ie({ condition: s, formik: t })
|
|
1272
1538
|
},
|
|
1273
|
-
|
|
1539
|
+
s.conditionName
|
|
1274
1540
|
)) })
|
|
1275
1541
|
]
|
|
1276
1542
|
}
|
|
1277
1543
|
) }) }),
|
|
1278
|
-
n.terms && /* @__PURE__ */
|
|
1279
|
-
/* @__PURE__ */
|
|
1280
|
-
/* @__PURE__ */
|
|
1281
|
-
|
|
1544
|
+
n.terms && /* @__PURE__ */ p(A, { children: [
|
|
1545
|
+
/* @__PURE__ */ o(I, { dashed: !0 }),
|
|
1546
|
+
/* @__PURE__ */ o(
|
|
1547
|
+
Ct,
|
|
1282
1548
|
{
|
|
1283
1549
|
labelStart: n.termStart,
|
|
1284
1550
|
labelEnd: n.termEnd,
|
|
@@ -1286,118 +1552,118 @@ const it = f.div`
|
|
|
1286
1552
|
valueEnd: t.values.validUntil,
|
|
1287
1553
|
messageStart: t.errors.effectiveFrom,
|
|
1288
1554
|
messageEnd: t.errors.validUntil,
|
|
1289
|
-
statusStart:
|
|
1290
|
-
statusEnd:
|
|
1291
|
-
onHandleStartChange: (
|
|
1292
|
-
onHandleEndChange: (
|
|
1293
|
-
onCheckClosedChange: (
|
|
1294
|
-
t.setFieldValue("checkClosed",
|
|
1555
|
+
statusStart: c,
|
|
1556
|
+
statusEnd: u,
|
|
1557
|
+
onHandleStartChange: (s) => t.setFieldValue("effectiveFrom", s.target.value),
|
|
1558
|
+
onHandleEndChange: (s) => t.setFieldValue("validUntil", s.target.value),
|
|
1559
|
+
onCheckClosedChange: (s) => {
|
|
1560
|
+
t.setFieldValue("checkClosed", s), s && t.setFieldValue("validUntil", "");
|
|
1295
1561
|
},
|
|
1296
1562
|
checkedClosed: t.values.checkClosed
|
|
1297
1563
|
}
|
|
1298
1564
|
)
|
|
1299
1565
|
] }),
|
|
1300
|
-
/* @__PURE__ */
|
|
1301
|
-
|
|
1302
|
-
/* @__PURE__ */
|
|
1303
|
-
/* @__PURE__ */
|
|
1304
|
-
/* @__PURE__ */
|
|
1566
|
+
/* @__PURE__ */ o(I, {}),
|
|
1567
|
+
d && /* @__PURE__ */ o(C, { type: "label", size: "medium", appearance: "danger", children: String(t.errors.conditionsThatEstablishesTheDecision) }),
|
|
1568
|
+
/* @__PURE__ */ p(g, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
1569
|
+
/* @__PURE__ */ o(L, { appearance: "gray", onClick: a, children: n.cancel }),
|
|
1570
|
+
/* @__PURE__ */ o(L, { type: "submit", children: n.confirm })
|
|
1305
1571
|
] })
|
|
1306
1572
|
] }) });
|
|
1307
|
-
},
|
|
1573
|
+
}, Dt = (e) => {
|
|
1308
1574
|
var T;
|
|
1309
|
-
const { decision: t, onSubmitEvent: n, textValues:
|
|
1575
|
+
const { decision: t, onSubmitEvent: n, textValues: a, onCancel: i } = e, { formik: r, handleToggleNoneChange: h } = yt({
|
|
1310
1576
|
decision: t,
|
|
1311
1577
|
onSubmitEvent: n,
|
|
1312
|
-
textValues:
|
|
1578
|
+
textValues: a
|
|
1313
1579
|
}), l = {
|
|
1314
1580
|
ruleName: t.ruleName,
|
|
1315
1581
|
labelName: t.labelName,
|
|
1316
1582
|
howToSetTheCondition: t.howToSetTheDecision,
|
|
1317
1583
|
decisionDataType: t.decisionDataType,
|
|
1318
1584
|
listOfPossibleValues: t.listOfPossibleValues
|
|
1319
|
-
},
|
|
1320
|
-
(
|
|
1321
|
-
)) || [],
|
|
1322
|
-
return /* @__PURE__ */
|
|
1323
|
-
|
|
1585
|
+
}, d = ((T = t.conditionsThatEstablishesTheDecision) == null ? void 0 : T.filter(
|
|
1586
|
+
(b) => !b.hidden
|
|
1587
|
+
)) || [], c = !!r.errors.conditionsThatEstablishesTheDecision && r.submitCount > 0, u = r.touched.effectiveFrom ? r.errors.effectiveFrom ? "invalid" : "valid" : void 0, s = r.touched.validUntil ? r.errors.validUntil ? "invalid" : "valid" : void 0;
|
|
1588
|
+
return /* @__PURE__ */ o(
|
|
1589
|
+
St,
|
|
1324
1590
|
{
|
|
1325
1591
|
formik: r,
|
|
1326
|
-
onCancel:
|
|
1327
|
-
textValues:
|
|
1592
|
+
onCancel: i,
|
|
1593
|
+
textValues: a,
|
|
1328
1594
|
decision: t,
|
|
1329
|
-
visibleConditions:
|
|
1595
|
+
visibleConditions: d,
|
|
1330
1596
|
normalizedDecision: l,
|
|
1331
|
-
handleToggleNoneChange:
|
|
1332
|
-
handleConditionToggleChange: (
|
|
1333
|
-
if (!
|
|
1597
|
+
handleToggleNoneChange: h,
|
|
1598
|
+
handleConditionToggleChange: (b, x) => (w) => {
|
|
1599
|
+
if (!w)
|
|
1334
1600
|
r.setFieldValue(
|
|
1335
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1601
|
+
`conditionsThatEstablishesTheDecision.${b}`,
|
|
1336
1602
|
void 0
|
|
1337
1603
|
), r.setFieldTouched(
|
|
1338
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1604
|
+
`conditionsThatEstablishesTheDecision.${b}`,
|
|
1339
1605
|
!1,
|
|
1340
1606
|
!1
|
|
1341
1607
|
);
|
|
1342
1608
|
else {
|
|
1343
|
-
const
|
|
1609
|
+
const S = x ? [] : "";
|
|
1344
1610
|
r.setFieldValue(
|
|
1345
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1346
|
-
|
|
1611
|
+
`conditionsThatEstablishesTheDecision.${b}`,
|
|
1612
|
+
S
|
|
1347
1613
|
);
|
|
1348
1614
|
}
|
|
1349
1615
|
},
|
|
1350
|
-
showConditionsError:
|
|
1351
|
-
termStartStatus:
|
|
1352
|
-
termEndStatus:
|
|
1616
|
+
showConditionsError: c,
|
|
1617
|
+
termStartStatus: u,
|
|
1618
|
+
termEndStatus: s
|
|
1353
1619
|
}
|
|
1354
1620
|
);
|
|
1355
|
-
},
|
|
1356
|
-
var
|
|
1357
|
-
const { decisionTemplate: t } = e, n = { ...t },
|
|
1621
|
+
}, Jt = (e) => {
|
|
1622
|
+
var i;
|
|
1623
|
+
const { decisionTemplate: t } = e, n = { ...t }, a = (i = n.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
|
|
1358
1624
|
(r) => r.switchPlaces
|
|
1359
1625
|
);
|
|
1360
|
-
return
|
|
1626
|
+
return a ? {
|
|
1361
1627
|
...n,
|
|
1362
|
-
ruleName:
|
|
1363
|
-
labelName:
|
|
1364
|
-
decisionDataType:
|
|
1365
|
-
value:
|
|
1366
|
-
howToSetTheDecision:
|
|
1628
|
+
ruleName: a.conditionName,
|
|
1629
|
+
labelName: a.labelName,
|
|
1630
|
+
decisionDataType: a.conditionDataType,
|
|
1631
|
+
value: a.value,
|
|
1632
|
+
howToSetTheDecision: a.howToSetTheCondition,
|
|
1367
1633
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
1368
|
-
(r) => r.conditionName ===
|
|
1634
|
+
(r) => r.conditionName === a.conditionName ? { ...r, hidden: !0 } : r
|
|
1369
1635
|
)
|
|
1370
1636
|
} : n;
|
|
1371
|
-
},
|
|
1637
|
+
}, Xt = (e) => {
|
|
1372
1638
|
const { decisions: t } = e;
|
|
1373
1639
|
return t == null ? void 0 : t.map((n) => {
|
|
1374
|
-
var
|
|
1375
|
-
const
|
|
1640
|
+
var i;
|
|
1641
|
+
const a = (i = n.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
|
|
1376
1642
|
(r) => r.switchPlaces
|
|
1377
1643
|
);
|
|
1378
|
-
return
|
|
1644
|
+
return a ? {
|
|
1379
1645
|
...n,
|
|
1380
|
-
ruleName:
|
|
1381
|
-
labelName:
|
|
1382
|
-
decisionDataType:
|
|
1383
|
-
value:
|
|
1384
|
-
howToSetTheDecision:
|
|
1646
|
+
ruleName: a.conditionName,
|
|
1647
|
+
labelName: a.labelName,
|
|
1648
|
+
decisionDataType: a.conditionDataType,
|
|
1649
|
+
value: a.value,
|
|
1650
|
+
howToSetTheDecision: a.howToSetTheCondition,
|
|
1385
1651
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
1386
|
-
(r) => r.conditionName ===
|
|
1652
|
+
(r) => r.conditionName === a.conditionName ? { ...r, hidden: !0 } : r
|
|
1387
1653
|
)
|
|
1388
1654
|
} : n;
|
|
1389
1655
|
});
|
|
1390
|
-
},
|
|
1391
|
-
const
|
|
1392
|
-
if (
|
|
1393
|
-
const
|
|
1394
|
-
|
|
1656
|
+
}, U = /* @__PURE__ */ new Map(), kt = (e, t) => U.get(`${t}:${e}`), Nt = (e, t, n) => {
|
|
1657
|
+
const a = `${t}:${e}`;
|
|
1658
|
+
if (U.set(a, n), U.size > 1e3) {
|
|
1659
|
+
const i = U.keys().next().value;
|
|
1660
|
+
i !== void 0 && U.delete(i);
|
|
1395
1661
|
}
|
|
1396
|
-
},
|
|
1397
|
-
const t = Date.now(), n =
|
|
1398
|
-
return t - n <
|
|
1399
|
-
},
|
|
1400
|
-
const t =
|
|
1662
|
+
}, ue = /* @__PURE__ */ new Map(), Et = 1e3, $t = (e) => {
|
|
1663
|
+
const t = Date.now(), n = ue.get(e) || 0;
|
|
1664
|
+
return t - n < Et ? !0 : (ue.set(e, t), !1);
|
|
1665
|
+
}, At = (e) => {
|
|
1666
|
+
const t = Oe(e);
|
|
1401
1667
|
return {
|
|
1402
1668
|
spa: "es",
|
|
1403
1669
|
eng: "en",
|
|
@@ -1406,66 +1672,66 @@ const it = f.div`
|
|
|
1406
1672
|
ita: "it",
|
|
1407
1673
|
por: "pt"
|
|
1408
1674
|
}[t] || "en";
|
|
1409
|
-
},
|
|
1410
|
-
const
|
|
1675
|
+
}, Ft = async (e, t, { url: n, apiKey: a }) => {
|
|
1676
|
+
const i = `${t}:${e}`, r = kt(e, t);
|
|
1411
1677
|
if (r) return r;
|
|
1412
|
-
if (
|
|
1678
|
+
if ($t(i))
|
|
1413
1679
|
return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
|
|
1414
|
-
const
|
|
1680
|
+
const h = At(e);
|
|
1415
1681
|
try {
|
|
1416
|
-
const { data: l } = await
|
|
1682
|
+
const { data: l } = await Re.post(
|
|
1417
1683
|
n,
|
|
1418
1684
|
{
|
|
1419
1685
|
q: e,
|
|
1420
|
-
source:
|
|
1686
|
+
source: h,
|
|
1421
1687
|
target: t,
|
|
1422
|
-
api_key:
|
|
1688
|
+
api_key: a
|
|
1423
1689
|
},
|
|
1424
1690
|
{
|
|
1425
1691
|
headers: {
|
|
1426
1692
|
"Content-Type": "application/json"
|
|
1427
1693
|
}
|
|
1428
1694
|
}
|
|
1429
|
-
),
|
|
1430
|
-
return
|
|
1695
|
+
), d = (l == null ? void 0 : l.translatedText) || e;
|
|
1696
|
+
return Nt(e, t, d), d;
|
|
1431
1697
|
} catch (l) {
|
|
1432
1698
|
return console.warn(`[Translation] Failed for: "${e}"`, l), e;
|
|
1433
1699
|
}
|
|
1434
|
-
},
|
|
1435
|
-
const
|
|
1436
|
-
Object.entries(e).map(async ([
|
|
1437
|
-
if (
|
|
1438
|
-
const
|
|
1439
|
-
return [
|
|
1700
|
+
}, It = (e) => typeof e == "string" && e.trim().length > 0, he = async (e, t, n) => {
|
|
1701
|
+
const a = await Promise.all(
|
|
1702
|
+
Object.entries(e).map(async ([i, r]) => {
|
|
1703
|
+
if (It(r)) {
|
|
1704
|
+
const h = await Ft(r, t, n);
|
|
1705
|
+
return [i, h];
|
|
1440
1706
|
} else if (Array.isArray(r)) {
|
|
1441
|
-
const
|
|
1707
|
+
const h = await Promise.all(
|
|
1442
1708
|
r.map(
|
|
1443
|
-
async (l) => typeof l == "object" && l !== null ? await
|
|
1709
|
+
async (l) => typeof l == "object" && l !== null ? await he(l, t, n) : l
|
|
1444
1710
|
)
|
|
1445
1711
|
);
|
|
1446
|
-
return [
|
|
1712
|
+
return [i, h];
|
|
1447
1713
|
} else if (typeof r == "object" && r !== null) {
|
|
1448
|
-
const
|
|
1449
|
-
return [
|
|
1714
|
+
const h = await he(r, t, n);
|
|
1715
|
+
return [i, h];
|
|
1450
1716
|
} else
|
|
1451
|
-
return [
|
|
1717
|
+
return [i, r];
|
|
1452
1718
|
})
|
|
1453
1719
|
);
|
|
1454
|
-
return Object.fromEntries(
|
|
1720
|
+
return Object.fromEntries(a);
|
|
1455
1721
|
};
|
|
1456
1722
|
export {
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1723
|
+
ee as BusinessRuleCard,
|
|
1724
|
+
xe as BusinessRuleView,
|
|
1725
|
+
Pt as BusinessRules,
|
|
1726
|
+
Gt as Filter,
|
|
1727
|
+
Qt as FilterModal,
|
|
1728
|
+
Wt as FormFilter,
|
|
1729
|
+
Qe as ModalRules,
|
|
1730
|
+
Dt as RulesForm,
|
|
1731
|
+
Yt as revertSortedDataSampleSwitchPlaces,
|
|
1732
|
+
Kt as revertSortedDataSwitchPlaces,
|
|
1733
|
+
Jt as sortDisplayDataSampleSwitchPlaces,
|
|
1734
|
+
Xt as sortDisplayDataSwitchPlaces,
|
|
1735
|
+
he as translateObject,
|
|
1736
|
+
Ft as translateText
|
|
1471
1737
|
};
|