@isettingkit/business-rules 1.0.20 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,21 +1,22 @@
1
- import { jsx as o, jsxs as h, Fragment as k } from "react/jsx-runtime";
2
- import { MdOutlineDelete as Te, MdClear as xe, MdAdd as Y, MdExpandLess as Re, MdExpandMore as Oe, MdClose as Me, MdOutlineFilterAltOff as ve, MdOutlineFilterAlt as ye } from "react-icons/md";
3
- import { inube as v, Stack as g, Divider as R, Icon as L, Text as S, SkeletonLine as z, useMediaQuery as B, Blanket as we, Button as U, Grid as K, Box as Le, Tag as H, SkeletonIcon as Ue, OptionList as ze, Checkpicker as Ve, Toggle as Ce, Checkbox as je, Date as de } from "@inubekit/inubekit";
4
- import x, { keyframes as De, ThemeContext as Be } from "styled-components";
5
- import { ValueDataType as I, ValueHowToSetUp as V, DecisionConditionRender as ce } from "@isettingkit/input";
6
- import { DecisionViewConditionRenderer as X, DecisionViewConditionRendererNew as G } from "@isettingkit/view";
7
- import { createPortal as Se } from "react-dom";
8
- import _e, { useState as O, useRef as Q, useEffect as oe, useContext as He } from "react";
9
- import { useFormik as qe } from "formik";
10
- import { string as ie, mixed as Ne, object as W, number as ee, lazy as ue, date as pe } from "yup";
11
- import Pe from "axios";
12
- import { franc as Ge } from "franc-min";
13
- const Qe = x.div`
1
+ import { jsx as o, jsxs as h, Fragment as E } from "react/jsx-runtime";
2
+ import { MdOutlineDelete as Te, MdClear as ye, MdAdd as J, MdExpandLess as Me, MdExpandMore as we, MdClose as Le, MdOutlineFilterAltOff as Ce, MdOutlineFilterAlt as De, MdChevronRight as ze, MdArrowRight as Ue } from "react-icons/md";
3
+ import { inube as x, Stack as g, Divider as F, Icon as R, Text as w, SkeletonLine as V, useMediaQuery as H, Blanket as Se, Button as U, Grid as X, Box as Ve, Tag as q, SkeletonIcon as Be, OptionList as He, Checkpicker as je, Toggle as ke, Checkbox as _e, Date as ue } from "@inubekit/inubekit";
4
+ import T, { keyframes as Ne, ThemeContext as qe } from "styled-components";
5
+ import { ValueDataType as O, ValueHowToSetUp as B, DecisionConditionRender as pe } from "@isettingkit/input";
6
+ import { DecisionViewConditionRenderer as Z, DecisionViewConditionRendererNew as Q } from "@isettingkit/view";
7
+ import { createPortal as Ee } from "react-dom";
8
+ import W, { useState as M, useRef as K, useEffect as re, useContext as Pe } from "react";
9
+ import { useFormik as Ge } from "formik";
10
+ import { string as ie, mixed as $e, object as Y, number as ne, lazy as he, date as ge } from "yup";
11
+ import { Link as Qe, useLocation as We } from "react-router-dom";
12
+ import Ke from "axios";
13
+ import { franc as Ye } from "franc-min";
14
+ const Je = T.div`
14
15
  border-radius: 8px;
15
16
  border: 1px solid
16
17
  ${({ theme: e }) => {
17
18
  var n, t;
18
- return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
19
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || x.palette.neutral.N30;
19
20
  }};
20
21
  box-sizing: border-box;
21
22
  display: flex;
@@ -26,7 +27,7 @@ const Qe = x.div`
26
27
  height: 100%;
27
28
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
28
29
  `;
29
- x.div`
30
+ T.div`
30
31
  width: 100%;
31
32
  height: 100%;
32
33
  overflow-y: auto;
@@ -45,51 +46,51 @@ x.div`
45
46
  border-radius: 8px;
46
47
  }
47
48
  `;
48
- const re = (e) => {
49
- const { children: n, controls: t = !0, handleDelete: a, id: i } = e;
50
- return /* @__PURE__ */ o(Qe, { children: /* @__PURE__ */ h(g, { direction: "column", gap: "16px", padding: "12px 16px", children: [
49
+ const le = (e) => {
50
+ const { children: n, controls: t = !0, handleDelete: a, id: r } = e;
51
+ return /* @__PURE__ */ o(Je, { children: /* @__PURE__ */ h(g, { direction: "column", gap: "16px", padding: "12px 16px", children: [
51
52
  n,
52
- t && /* @__PURE__ */ h(k, { children: [
53
- /* @__PURE__ */ o(R, {}),
53
+ t && /* @__PURE__ */ h(E, { children: [
54
+ /* @__PURE__ */ o(F, {}),
54
55
  /* @__PURE__ */ o(g, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ o(
55
- L,
56
+ R,
56
57
  {
57
58
  cursorHover: !0,
58
59
  appearance: "danger",
59
60
  size: "24px",
60
61
  icon: /* @__PURE__ */ o(Te, {}),
61
62
  onClick: () => {
62
- a(i);
63
+ a(r);
63
64
  }
64
65
  }
65
66
  ) })
66
67
  ] })
67
68
  ] }) });
68
- }, We = (e) => e.value, Ye = (e) => e.value, Ke = (e) => e.value, Je = (e) => ({
69
+ }, Xe = (e) => e.value, Ze = (e) => e.value, en = (e) => e.value, nn = (e) => ({
69
70
  from: e.from ?? "",
70
71
  to: e.to ?? ""
71
- }), Xe = (e) => e.value, Ze = (e) => e.value, en = (e) => e.value;
72
- 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 || {});
73
- const nn = {
74
- [D.LIST_OF_VALUES]: Ye,
75
- [D.LIST_OF_VALUES_MULTI]: Ke,
76
- [D.RANGE]: Je,
77
- [D.GREATER_THAN]: Xe,
78
- [D.LESS_THAN]: Ze,
79
- [D.EQUAL]: en
80
- }, q = (e) => {
81
- const n = e == null ? void 0 : e.value, t = typeof n == "object" && n !== null && !Array.isArray(n), a = nn[e == null ? void 0 : e.howToSetTheDecision] || We;
72
+ }), tn = (e) => e.value, an = (e) => e.value, on = (e) => e.value;
73
+ var S = /* @__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))(S || {});
74
+ const rn = {
75
+ [S.LIST_OF_VALUES]: Ze,
76
+ [S.LIST_OF_VALUES_MULTI]: en,
77
+ [S.RANGE]: nn,
78
+ [S.GREATER_THAN]: tn,
79
+ [S.LESS_THAN]: an,
80
+ [S.EQUAL]: on
81
+ }, P = (e) => {
82
+ const n = e == null ? void 0 : e.value, t = typeof n == "object" && n !== null && !Array.isArray(n), a = rn[e == null ? void 0 : e.howToSetTheDecision] || Xe;
82
83
  return t && a(n) || n || void 0;
83
- }, he = x.div`
84
+ }, be = T.div`
84
85
  & > div {
85
86
  border-radius: 8px;
86
87
  border: 1px solid
87
88
  ${({ theme: e }) => {
88
89
  var n, t;
89
- return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
90
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || x.palette.neutral.N30;
90
91
  }};
91
92
  }
92
- `, ge = x.div`
93
+ `, me = T.div`
93
94
  width: 100%;
94
95
  height: 100%;
95
96
  overflow-y: auto;
@@ -107,31 +108,31 @@ const nn = {
107
108
  background-color: #ebecf0;
108
109
  border-radius: 8px;
109
110
  }
110
- `, tn = (e) => {
111
+ `, ln = (e) => {
111
112
  const {
112
113
  conditionsAlignment: n,
113
114
  decision: t,
114
115
  decisionDateElement: a,
115
- decisionMapper: i,
116
- loading: r,
117
- skeleton: p,
116
+ decisionMapper: r,
117
+ loading: i,
118
+ skeleton: u,
118
119
  terms: l,
119
- textValues: s,
120
- visibleConditions: c
120
+ textValues: d,
121
+ visibleConditions: s
121
122
  } = e;
122
- return r ? /* @__PURE__ */ h(g, { direction: "column", gap: "12px", children: [
123
+ return i ? /* @__PURE__ */ h(g, { direction: "column", gap: "12px", children: [
123
124
  /* @__PURE__ */ o(g, { direction: "column", alignItems: "center", children: /* @__PURE__ */ o(
124
- X,
125
+ Z,
125
126
  {
126
- element: i,
127
- valueData: q(
128
- i
127
+ element: r,
128
+ valueData: P(
129
+ r
129
130
  ),
130
131
  type: "decision"
131
132
  }
132
133
  ) }, t.ruleName),
133
- /* @__PURE__ */ o(R, { dashed: !0 }),
134
- /* @__PURE__ */ o(ge, { children: /* @__PURE__ */ h(
134
+ /* @__PURE__ */ o(F, { dashed: !0 }),
135
+ /* @__PURE__ */ o(me, { children: /* @__PURE__ */ h(
135
136
  g,
136
137
  {
137
138
  direction: "column",
@@ -140,35 +141,35 @@ const nn = {
140
141
  height: "203px",
141
142
  children: [
142
143
  /* @__PURE__ */ o(
143
- S,
144
+ w,
144
145
  {
145
146
  type: "label",
146
147
  size: "large",
147
148
  appearance: "dark",
148
149
  weight: "bold",
149
150
  textAlign: "center",
150
- children: s.factsThatConditionIt
151
+ children: d.factsThatConditionIt
151
152
  }
152
153
  ),
153
- c.map((u) => /* @__PURE__ */ o(he, { children: /* @__PURE__ */ o(g, { direction: "column", padding: "8px", children: /* @__PURE__ */ o(
154
- X,
154
+ s.map((p) => /* @__PURE__ */ o(be, { children: /* @__PURE__ */ o(g, { direction: "column", padding: "8px", children: /* @__PURE__ */ o(
155
+ Z,
155
156
  {
156
- element: { ...u, value: u.value },
157
- valueData: q(
158
- u
157
+ element: { ...p, value: p.value },
158
+ valueData: P(
159
+ p
159
160
  )
160
161
  }
161
- ) }) }, u.conditionName)),
162
- l && /* @__PURE__ */ h(k, { children: [
163
- /* @__PURE__ */ o(R, { dashed: !0 }),
162
+ ) }) }, p.conditionName)),
163
+ l && /* @__PURE__ */ h(E, { children: [
164
+ /* @__PURE__ */ o(F, { dashed: !0 }),
164
165
  a && /* @__PURE__ */ o(
165
- X,
166
+ Z,
166
167
  {
167
168
  element: a.element,
168
169
  valueData: a.valueData,
169
170
  type: "decision"
170
171
  },
171
- s.terms
172
+ d.terms
172
173
  )
173
174
  ] })
174
175
  ]
@@ -176,21 +177,21 @@ const nn = {
176
177
  ) })
177
178
  ] }) : /* @__PURE__ */ h(g, { direction: "column", gap: "12px", children: [
178
179
  /* @__PURE__ */ h(g, { direction: "column", alignItems: "center", gap: "4px", children: [
179
- /* @__PURE__ */ o(z, { animated: !0, width: "180px" }),
180
- /* @__PURE__ */ o(z, { animated: !0, width: "85px" })
180
+ /* @__PURE__ */ o(V, { animated: !0, width: "180px" }),
181
+ /* @__PURE__ */ o(V, { animated: !0, width: "85px" })
181
182
  ] }, "loading"),
182
183
  /* @__PURE__ */ h(g, { direction: "column", gap: "12px", alignItems: "center", children: [
183
- /* @__PURE__ */ o(R, { dashed: !0 }),
184
- /* @__PURE__ */ o(z, { animated: !0, width: "150px" })
184
+ /* @__PURE__ */ o(F, { dashed: !0 }),
185
+ /* @__PURE__ */ o(V, { animated: !0, width: "150px" })
185
186
  ] }),
186
- /* @__PURE__ */ o(ge, { children: /* @__PURE__ */ o(
187
+ /* @__PURE__ */ o(me, { children: /* @__PURE__ */ o(
187
188
  g,
188
189
  {
189
190
  direction: "column",
190
191
  gap: "12px",
191
192
  justifyContent: "space-between",
192
193
  height: "203px",
193
- children: p.map((u, d) => /* @__PURE__ */ o(he, { children: /* @__PURE__ */ h(
194
+ children: u.map((p, c) => /* @__PURE__ */ o(be, { children: /* @__PURE__ */ h(
194
195
  g,
195
196
  {
196
197
  direction: "column",
@@ -198,76 +199,76 @@ const nn = {
198
199
  alignItems: "start",
199
200
  padding: "8px",
200
201
  children: [
201
- /* @__PURE__ */ o(z, { animated: !0, width: "180px" }),
202
- /* @__PURE__ */ o(z, { animated: !0, width: "85px" })
202
+ /* @__PURE__ */ o(V, { animated: !0, width: "180px" }),
203
+ /* @__PURE__ */ o(V, { animated: !0, width: "85px" })
203
204
  ]
204
205
  }
205
- ) }, `condition-${d}`))
206
+ ) }, `condition-${c}`))
206
207
  }
207
208
  ) })
208
209
  ] });
209
- }, Ee = (e) => {
210
- var b;
211
- const { decision: n, loading: t = !1, textValues: a } = e, i = !!(n != null && n.effectiveFrom), r = !!(n != null && n.validUntil), p = i && r ? {
210
+ }, Ae = (e) => {
211
+ var m;
212
+ const { decision: n, loading: t = !1, textValues: a } = e, r = !!(n != null && n.effectiveFrom), i = !!(n != null && n.validUntil), u = r && i ? {
212
213
  element: {
213
214
  labelName: a == null ? void 0 : a.terms,
214
215
  value: String(n.effectiveFrom),
215
- howToSetTheDecision: V.RANGE,
216
- decisionDataType: I.DATE
216
+ howToSetTheDecision: B.RANGE,
217
+ decisionDataType: O.DATE
217
218
  },
218
- valueData: q({
219
+ valueData: P({
219
220
  labelName: a == null ? void 0 : a.terms,
220
221
  value: {
221
222
  from: String(n.effectiveFrom),
222
223
  to: String(n.validUntil)
223
224
  },
224
- howToSetTheDecision: V.RANGE,
225
- decisionDataType: I.DATE
225
+ howToSetTheDecision: B.RANGE,
226
+ decisionDataType: O.DATE
226
227
  })
227
- } : i && !r ? {
228
+ } : r && !i ? {
228
229
  element: {
229
230
  labelName: a == null ? void 0 : a.terms,
230
231
  value: String(n.effectiveFrom),
231
- howToSetTheDecision: V.EQUAL,
232
- decisionDataType: I.DATE
232
+ howToSetTheDecision: B.EQUAL,
233
+ decisionDataType: O.DATE
233
234
  },
234
- valueData: q({
235
+ valueData: P({
235
236
  labelName: a == null ? void 0 : a.terms,
236
237
  value: String(n.effectiveFrom),
237
- howToSetTheDecision: V.EQUAL,
238
- decisionDataType: I.DATE
238
+ howToSetTheDecision: B.EQUAL,
239
+ decisionDataType: O.DATE
239
240
  })
240
241
  } : null, l = n ? {
241
242
  labelName: n.labelName || "",
242
243
  decisionDataType: n.decisionDataType || "alphabetical",
243
- value: q(n),
244
+ value: P(n),
244
245
  howToSetTheDecision: n.howToSetTheDecision || "EqualTo"
245
- } : null, s = ((b = n == null ? void 0 : n.conditionsThatEstablishesTheDecision) == null ? void 0 : b.filter(
246
- (m) => !m.hidden
247
- )) || [], c = Array.from({ length: 5 }), u = !!(!t && n && a && l), d = s.length < 2 ? "start" : "space-between";
246
+ } : null, d = ((m = n == null ? void 0 : n.conditionsThatEstablishesTheDecision) == null ? void 0 : m.filter(
247
+ (b) => !b.hidden
248
+ )) || [], s = Array.from({ length: 5 }), p = !!(!t && n && a && l), c = d.length < 2 ? "start" : "space-between";
248
249
  return /* @__PURE__ */ o(
249
- tn,
250
+ ln,
250
251
  {
251
- conditionsAlignment: d,
252
+ conditionsAlignment: c,
252
253
  decision: n,
253
- decisionDateElement: p,
254
+ decisionDateElement: u,
254
255
  decisionMapper: l,
255
- loading: u,
256
- skeleton: c,
256
+ loading: p,
257
+ skeleton: s,
257
258
  terms: !!(a != null && a.terms),
258
259
  textValues: a,
259
- visibleConditions: s
260
+ visibleConditions: d
260
261
  }
261
262
  );
262
- }, an = x.div`
263
+ }, dn = T.div`
263
264
  position: relative;
264
265
  & > div {
265
266
  padding: 24px 16px;
266
267
  }
267
- `, on = x.div`
268
+ `, sn = T.div`
268
269
  background-color: ${({ theme: e }) => {
269
270
  var n, t;
270
- return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N0) || v.palette.neutral.N0;
271
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N0) || x.palette.neutral.N0;
271
272
  }};
272
273
  max-width: 450px;
273
274
  max-height: 90vh;
@@ -295,24 +296,24 @@ const nn = {
295
296
  background-color: #ebecf0;
296
297
  border-radius: 8px;
297
298
  }
298
- `, ke = (e) => {
299
- const { children: n, portalId: t, onCloseModal: a, title: i } = e, r = document.getElementById(t);
300
- if (!r)
299
+ `, Ie = (e) => {
300
+ const { children: n, portalId: t, onCloseModal: a, title: r } = e, i = document.getElementById(t);
301
+ if (!i)
301
302
  throw new Error(
302
303
  "The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
303
304
  );
304
- const p = B("(max-width: 400px)");
305
- return Se(
306
- /* @__PURE__ */ o(an, { smallScreen: p, children: /* @__PURE__ */ o(we, { children: /* @__PURE__ */ o(on, { children: /* @__PURE__ */ h(g, { direction: "column", gap: "24px", children: [
305
+ const u = H("(max-width: 400px)");
306
+ return Ee(
307
+ /* @__PURE__ */ o(dn, { smallScreen: u, children: /* @__PURE__ */ o(Se, { children: /* @__PURE__ */ o(sn, { children: /* @__PURE__ */ h(g, { direction: "column", gap: "24px", children: [
307
308
  /* @__PURE__ */ o(g, { direction: "column", gap: "24px", children: /* @__PURE__ */ h(g, { alignItems: "center", justifyContent: "space-between", children: [
308
- /* @__PURE__ */ o(S, { type: "title", size: "large", appearance: "dark", weight: "bold", children: i }),
309
- /* @__PURE__ */ o(xe, { size: "24px", cursor: "pointer", onClick: a })
309
+ /* @__PURE__ */ o(w, { type: "title", size: "large", appearance: "dark", weight: "bold", children: r }),
310
+ /* @__PURE__ */ o(ye, { size: "24px", cursor: "pointer", onClick: a })
310
311
  ] }) }),
311
312
  n
312
313
  ] }) }) }) }),
313
- r
314
+ i
314
315
  );
315
- }, rn = De`
316
+ }, cn = Ne`
316
317
  from {
317
318
  opacity: 0;
318
319
  transform: translateY(20px);
@@ -322,12 +323,12 @@ const nn = {
322
323
  transform: translateY(0);
323
324
  }
324
325
  `;
325
- x.div`
326
+ T.div`
326
327
  border-radius: 8px;
327
328
  border: 1px solid
328
329
  ${({ theme: e }) => {
329
330
  var n, t;
330
- return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
331
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || x.palette.neutral.N30;
331
332
  }};
332
333
  box-sizing: border-box;
333
334
  display: flex;
@@ -336,37 +337,41 @@ x.div`
336
337
  height: 100%;
337
338
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
338
339
  `;
339
- x.div`
340
+ T.div`
340
341
  & > div {
341
342
  border-radius: 8px;
342
343
  border: 1px solid
343
344
  ${({ theme: e }) => {
344
345
  var n, t;
345
- return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
346
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || x.palette.neutral.N30;
346
347
  }};
347
348
  }
348
349
  `;
349
- const Ae = x.div`
350
+ const un = T.div`
350
351
  & > div {
351
- box-shadow: 0px 2px 3px 0px
352
- ${({ theme: e }) => {
352
+ background-color: ${({ theme: e }) => {
353
353
  var n, t;
354
- return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutralAlpha) == null ? void 0 : t.N700A) || v.palette.neutralAlpha.N30A;
354
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N10) || x.palette.neutral.N10;
355
355
  }};
356
- cursor: pointer;
356
+ justify-content: center;
357
357
  }
358
- `, J = x.div`
358
+ min-height: 350px;
359
+ width: 100%;
360
+ height: 100%;
361
+ padding-bottom: 12px;
362
+ cursor: pointer;
363
+ `, de = T.div`
359
364
  width: 100%;
360
365
  height: 100%;
361
366
  & > div {
362
- animation: ${rn} 600ms ease-out;
367
+ animation: ${cn} 600ms ease-out;
363
368
  }
364
- `, ln = x.div`
369
+ `, pn = T.div`
365
370
  & > div > div {
366
371
  border-radius: 8px;
367
372
  box-sizing: border-box;
368
373
  }
369
- `, sn = x.div`
374
+ `, hn = T.div`
370
375
  & > div {
371
376
  width: 100%;
372
377
  height: 100%;
@@ -386,50 +391,50 @@ const Ae = x.div`
386
391
  border-radius: 8px;
387
392
  }
388
393
  }
389
- `, dn = (e) => {
394
+ `, gn = (e) => {
390
395
  const { index: n, handleOpenModal: t } = e;
391
396
  return /* @__PURE__ */ o(
392
- re,
397
+ le,
393
398
  {
394
399
  id: `loading-card-${n}`,
395
400
  handleDelete: () => {
396
401
  },
397
402
  handleView: () => t ? t() : null,
398
403
  controls: !1,
399
- children: /* @__PURE__ */ o(Ee, { loading: !0 })
404
+ children: /* @__PURE__ */ o(Ae, { loading: !0 })
400
405
  },
401
406
  `loading-card-${n}`
402
407
  );
403
- }, cn = (e) => {
404
- const { decision: n, controls: t, handleOpenModal: a, handleDelete: i, textValues: r } = e;
405
- return n ? /* @__PURE__ */ o(J, { children: /* @__PURE__ */ h(g, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
406
- /* @__PURE__ */ o(S, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: n.decisionId }),
408
+ }, bn = (e) => {
409
+ const { decision: n, controls: t, handleOpenModal: a, handleDelete: r, textValues: i } = e;
410
+ return n ? /* @__PURE__ */ o(de, { children: /* @__PURE__ */ h(g, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
411
+ /* @__PURE__ */ o(w, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: n.decisionId }),
407
412
  /* @__PURE__ */ o(
408
- re,
413
+ le,
409
414
  {
410
415
  id: n.decisionId,
411
- handleDelete: () => i ? i(n.decisionId) : null,
416
+ handleDelete: () => r ? r(n.decisionId) : null,
412
417
  handleView: () => a ? a(n) : null,
413
418
  controls: t,
414
- children: /* @__PURE__ */ o(Ee, { decision: n, textValues: r })
419
+ children: /* @__PURE__ */ o(Ae, { decision: n, textValues: i })
415
420
  }
416
421
  )
417
422
  ] }) }, n.decisionId) : null;
418
- }, un = (e) => {
423
+ }, mn = (e) => {
419
424
  const {
420
425
  customTitleContentAddCard: n,
421
426
  index: t,
422
427
  handleOpenModal: a,
423
- shouldRenderEmptyMessage: i
424
- } = e, r = n || "Agregar decisión";
425
- return /* @__PURE__ */ o(J, { children: i ? null : /* @__PURE__ */ h(g, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
426
- /* @__PURE__ */ o(S, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
428
+ shouldRenderEmptyMessage: r
429
+ } = e, i = n || "Agregar decisión";
430
+ return /* @__PURE__ */ o(de, { children: r ? null : /* @__PURE__ */ h(g, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
431
+ /* @__PURE__ */ o(w, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
427
432
  /* @__PURE__ */ o(
428
- Ae,
433
+ un,
429
434
  {
430
435
  onClick: () => a ? a() : null,
431
436
  children: /* @__PURE__ */ o(
432
- re,
437
+ le,
433
438
  {
434
439
  id: `add-decision-${t}`,
435
440
  handleDelete: () => {
@@ -437,81 +442,81 @@ const Ae = x.div`
437
442
  handleView: () => a ? a() : null,
438
443
  controls: !1,
439
444
  children: /* @__PURE__ */ h(g, { direction: "column", gap: "12px", alignItems: "center", children: [
440
- /* @__PURE__ */ o(L, { appearance: "gray", icon: /* @__PURE__ */ o(Y, {}), size: "35px" }),
441
- /* @__PURE__ */ o(S, { appearance: "gray", type: "body", size: "large", children: r })
445
+ /* @__PURE__ */ o(R, { appearance: "gray", icon: /* @__PURE__ */ o(J, {}), size: "35px" }),
446
+ /* @__PURE__ */ o(w, { appearance: "gray", type: "body", size: "large", children: i })
442
447
  ] })
443
448
  }
444
449
  )
445
450
  }
446
451
  )
447
452
  ] }) }, `add-decision-${t}`);
448
- }, pn = {
449
- loading: dn,
450
- decision: cn,
451
- add: un
452
- }, ne = (e) => {
453
- const { type: n } = e, t = pn[n];
453
+ }, fn = {
454
+ loading: gn,
455
+ decision: bn,
456
+ add: mn
457
+ }, te = (e) => {
458
+ const { type: n } = e, t = fn[n];
454
459
  return t ? t(e) : null;
455
- }, hn = (e) => {
460
+ }, vn = (e) => {
456
461
  const {
457
462
  controls: n,
458
463
  customTitleContentAddCard: t,
459
464
  decisions: a,
460
- loading: i,
461
- handleOpenModal: r,
462
- handleDelete: p,
465
+ loading: r,
466
+ handleOpenModal: i,
467
+ handleDelete: u,
463
468
  textValues: l
464
- } = e, s = i ? Array.from({ length: 3 }).map(
465
- (u, d) => ne({
469
+ } = e, d = r ? Array.from({ length: 3 }).map(
470
+ (p, c) => te({
466
471
  type: "loading",
467
- index: d,
472
+ index: c,
468
473
  controls: n,
469
474
  customTitleContentAddCard: t,
470
- loading: i,
471
- handleOpenModal: r,
472
- handleDelete: p,
475
+ loading: r,
476
+ handleOpenModal: i,
477
+ handleDelete: u,
473
478
  textValues: l
474
479
  })
475
480
  ) : a == null ? void 0 : a.map(
476
- (u) => ne({
481
+ (p) => te({
477
482
  type: "decision",
478
- decision: u,
483
+ decision: p,
479
484
  controls: n,
480
485
  customTitleContentAddCard: t,
481
- loading: i,
482
- handleOpenModal: r,
483
- handleDelete: p,
486
+ loading: r,
487
+ handleOpenModal: i,
488
+ handleDelete: u,
484
489
  textValues: l
485
490
  })
486
- ), c = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !i && n;
487
- return { renderedCards: s, shouldRenderAddCard: c };
488
- }, xt = (e) => {
491
+ ), s = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !r && n;
492
+ return { renderedCards: d, shouldRenderAddCard: s };
493
+ }, It = (e) => {
489
494
  const {
490
495
  controls: n = !0,
491
496
  customTitleContentAddCard: t,
492
497
  customMessageEmptyDecisions: a,
493
- decisions: i,
494
- textValues: r,
495
- decisionTemplate: p,
498
+ decisions: r,
499
+ textValues: i,
500
+ decisionTemplate: u,
496
501
  isModalOpen: l,
497
- selectedDecision: s,
498
- loading: c,
499
- handleOpenModal: u,
500
- handleCloseModal: d,
501
- handleSubmitForm: b,
502
- handleDelete: m,
502
+ selectedDecision: d,
503
+ loading: s,
504
+ handleOpenModal: p,
505
+ handleCloseModal: c,
506
+ handleSubmitForm: m,
507
+ handleDelete: b,
503
508
  terms: f = !0
504
- } = e, y = B("(max-width: 681px)"), C = B("(max-width: 400px)"), { renderedCards: w, shouldRenderAddCard: E } = hn({
509
+ } = e, y = H("(max-width: 681px)"), D = H("(max-width: 400px)"), { renderedCards: C, shouldRenderAddCard: N } = vn({
505
510
  controls: n,
506
511
  customTitleContentAddCard: t,
507
- decisions: i,
508
- loading: c,
509
- handleOpenModal: u,
510
- handleDelete: m,
511
- textValues: r
512
- }), $ = (i == null ? void 0 : i.length) === 0 && !c;
513
- return /* @__PURE__ */ h(k, { children: [
514
- /* @__PURE__ */ o(ln, { children: /* @__PURE__ */ o(sn, { children: /* @__PURE__ */ o(g, { direction: "column", gap: "16px", padding: "6px", children: $ ? /* @__PURE__ */ h(
512
+ decisions: r,
513
+ loading: s,
514
+ handleOpenModal: p,
515
+ handleDelete: b,
516
+ textValues: i
517
+ }), A = (r == null ? void 0 : r.length) === 0 && !s;
518
+ return /* @__PURE__ */ h(E, { children: [
519
+ /* @__PURE__ */ o(pn, { children: /* @__PURE__ */ o(hn, { children: /* @__PURE__ */ o(g, { direction: "column", gap: "16px", padding: "6px", children: A ? /* @__PURE__ */ h(
515
520
  g,
516
521
  {
517
522
  direction: "column",
@@ -521,10 +526,10 @@ const Ae = x.div`
521
526
  justifyContent: "center",
522
527
  alignItems: "center",
523
528
  children: [
524
- /* @__PURE__ */ o(S, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */ h(k, { children: [
529
+ /* @__PURE__ */ o(w, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */ h(E, { children: [
525
530
  "Aún NO tienes definidas tasas de interés efectivas . Presiona",
526
531
  /* @__PURE__ */ h(
527
- S,
532
+ w,
528
533
  {
529
534
  as: "span",
530
535
  type: "label",
@@ -543,17 +548,17 @@ const Ae = x.div`
543
548
  /* @__PURE__ */ o(
544
549
  U,
545
550
  {
546
- iconBefore: /* @__PURE__ */ o(Y, {}),
547
- onClick: () => u ? u() : null,
551
+ iconBefore: /* @__PURE__ */ o(J, {}),
552
+ onClick: () => p ? p() : null,
548
553
  children: t || "Agregar decisión"
549
554
  }
550
555
  )
551
556
  ]
552
557
  }
553
558
  ) : /* @__PURE__ */ h(
554
- K,
559
+ X,
555
560
  {
556
- templateColumns: C ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
561
+ templateColumns: D ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
557
562
  autoFlow: "row dense",
558
563
  gap: "24px",
559
564
  alignItems: "start",
@@ -563,47 +568,47 @@ const Ae = x.div`
563
568
  padding: "6px",
564
569
  height: y ? "auto" : "484px",
565
570
  children: [
566
- w,
567
- E && ne({
571
+ C,
572
+ N && te({
568
573
  type: "add",
569
- index: i == null ? void 0 : i.length,
574
+ index: r == null ? void 0 : r.length,
570
575
  controls: n,
571
576
  customTitleContentAddCard: t,
572
577
  customMessageEmptyDecisions: a,
573
- loading: c,
574
- handleOpenModal: u,
575
- handleDelete: m,
576
- textValues: r,
577
- shouldRenderEmptyMessage: $,
578
+ loading: s,
579
+ handleOpenModal: p,
580
+ handleDelete: b,
581
+ textValues: i,
582
+ shouldRenderEmptyMessage: A,
578
583
  terms: f
579
584
  })
580
585
  ]
581
586
  }
582
587
  ) }) }) }),
583
588
  l && /* @__PURE__ */ o(
584
- ke,
589
+ Ie,
585
590
  {
586
591
  portalId: "modal-portal",
587
- onCloseModal: d,
588
- title: s ? "Editar Decisión" : "Nueva decisión",
592
+ onCloseModal: c,
593
+ title: d ? "Editar Decisión" : "Nueva decisión",
589
594
  children: /* @__PURE__ */ o(
590
- Ie,
595
+ Oe,
591
596
  {
592
- decision: s || p,
593
- onSubmitEvent: b,
594
- textValues: r,
595
- onCancel: () => d ? d() : () => {
597
+ decision: d || u,
598
+ onSubmitEvent: m,
599
+ textValues: i,
600
+ onCancel: () => c ? c() : () => {
596
601
  }
597
602
  }
598
603
  )
599
604
  }
600
605
  )
601
606
  ] });
602
- }, $e = (e) => {
603
- const { children: n, controls: t = !0, handleDelete: a, id: i } = e;
604
- return /* @__PURE__ */ h(Le, { width: "100%", children: [
607
+ }, Fe = (e) => {
608
+ const { children: n, controls: t = !0, handleDelete: a, id: r } = e;
609
+ return /* @__PURE__ */ h(Ve, { width: "100%", children: [
605
610
  n,
606
- t && /* @__PURE__ */ o(k, { children: /* @__PURE__ */ o(g, { gap: "16px", justifyContent: "end", margin: "16px 0 0 0", children: /* @__PURE__ */ o(
611
+ t && /* @__PURE__ */ o(E, { children: /* @__PURE__ */ o(g, { gap: "16px", justifyContent: "end", margin: "16px 0 0 0", children: /* @__PURE__ */ o(
607
612
  U,
608
613
  {
609
614
  cursorHover: !0,
@@ -612,26 +617,26 @@ const Ae = x.div`
612
617
  variant: "outlined",
613
618
  iconBefore: /* @__PURE__ */ o(Te, {}),
614
619
  onClick: () => {
615
- a(i);
620
+ a(r);
616
621
  },
617
622
  children: "Eliminar"
618
623
  }
619
624
  ) }) })
620
625
  ] });
621
- }, gn = (e) => e.value, mn = (e) => e.value, bn = (e) => e.value, fn = (e) => ({
626
+ }, xn = (e) => e.value, Tn = (e) => e.value, yn = (e) => e.value, wn = (e) => ({
622
627
  from: e.from ?? "",
623
628
  to: e.to ?? ""
624
- }), Tn = (e) => e.value, xn = (e) => e.value, vn = (e) => e.value, yn = {
625
- [D.LIST_OF_VALUES]: mn,
626
- [D.LIST_OF_VALUES_MULTI]: bn,
627
- [D.RANGE]: fn,
628
- [D.GREATER_THAN]: Tn,
629
- [D.LESS_THAN]: xn,
630
- [D.EQUAL]: vn
631
- }, P = (e) => {
632
- const n = e == null ? void 0 : e.value, t = typeof n == "object" && n !== null && !Array.isArray(n), a = yn[e == null ? void 0 : e.howToSetTheDecision] || gn;
629
+ }), Cn = (e) => e.value, Dn = (e) => e.value, Sn = (e) => e.value, kn = {
630
+ [S.LIST_OF_VALUES]: Tn,
631
+ [S.LIST_OF_VALUES_MULTI]: yn,
632
+ [S.RANGE]: wn,
633
+ [S.GREATER_THAN]: Cn,
634
+ [S.LESS_THAN]: Dn,
635
+ [S.EQUAL]: Sn
636
+ }, G = (e) => {
637
+ const n = e == null ? void 0 : e.value, t = typeof n == "object" && n !== null && !Array.isArray(n), a = kn[e == null ? void 0 : e.howToSetTheDecision] || xn;
633
638
  return t && a(n) || n || void 0;
634
- }, wn = x.div`
639
+ }, Nn = T.div`
635
640
  display: flex;
636
641
  justify-content: ${({ $justifyContent: e }) => e};
637
642
  align-items: ${({ $alignItems: e }) => e};
@@ -644,78 +649,78 @@ const Ae = x.div`
644
649
  margin: ${({ $margin: e }) => e};
645
650
  padding: ${({ $padding: e }) => e};
646
651
  background: ${({ $background: e, theme: n }) => {
647
- var t, a, i, r;
648
- return e ? `${((a = (t = n == null ? void 0 : n.palette) == null ? void 0 : t.neutral) == null ? void 0 : a.N10) || v.palette.neutral.N10}` : `${((r = (i = n == null ? void 0 : n.palette) == null ? void 0 : i.neutral) == null ? void 0 : r.N0) || v.palette.neutral.N0}`;
652
+ var t, a, r, i;
653
+ return e ? `${((a = (t = n == null ? void 0 : n.palette) == null ? void 0 : t.neutral) == null ? void 0 : a.N10) || x.palette.neutral.N10}` : `${((i = (r = n == null ? void 0 : n.palette) == null ? void 0 : r.neutral) == null ? void 0 : i.N0) || x.palette.neutral.N0}`;
649
654
  }};
650
655
  border: ${({ $border: e, theme: n }) => {
651
656
  var t, a;
652
- return e ? `1px solid ${((a = (t = n == null ? void 0 : n.palette) == null ? void 0 : t.neutral) == null ? void 0 : a.N40) || v.palette.neutral.N40}` : "none";
657
+ return e ? `1px solid ${((a = (t = n == null ? void 0 : n.palette) == null ? void 0 : t.neutral) == null ? void 0 : a.N40) || x.palette.neutral.N40}` : "none";
653
658
  }};
654
659
  border-radius: ${({ $borderRadius: e }) => e};
655
660
  box-sizing: ${({ $boxSizing: e }) => e};
656
661
  overflow-y: ${({ $scroll: e }) => e ? "scroll" : "none"};
657
- `, j = _e.forwardRef(
662
+ `, z = W.forwardRef(
658
663
  (e, n) => {
659
664
  const {
660
665
  children: t,
661
666
  wrap: a,
662
- direction: i = "column",
663
- justifyContent: r,
664
- alignItems: p,
667
+ direction: r = "column",
668
+ justifyContent: i,
669
+ alignItems: u,
665
670
  alignContent: l,
666
- height: s,
667
- width: c,
668
- gap: u,
669
- background: d,
670
- borderRadius: b,
671
- border: m,
671
+ height: d,
672
+ width: s,
673
+ gap: p,
674
+ background: c,
675
+ borderRadius: m,
676
+ border: b,
672
677
  margin: f = "0px",
673
678
  padding: y = "0px",
674
- boxSizing: C,
675
- scroll: w = !1
679
+ boxSizing: D,
680
+ scroll: C = !1
676
681
  } = e;
677
682
  return /* @__PURE__ */ o(
678
- wn,
683
+ Nn,
679
684
  {
680
685
  ref: n,
681
- direction: i,
682
- $justifyContent: r,
683
- $alignItems: p,
686
+ direction: r,
687
+ $justifyContent: i,
688
+ $alignItems: u,
684
689
  $alignContent: l,
685
- height: s,
686
- width: c,
690
+ height: d,
691
+ width: s,
687
692
  wrap: a,
688
- $gap: u,
689
- $background: d,
690
- $border: m,
693
+ $gap: p,
694
+ $background: c,
695
+ $border: b,
691
696
  $margin: f,
692
697
  $padding: y,
693
- $borderRadius: b,
694
- $boxSizing: C,
695
- $scroll: w,
698
+ $borderRadius: m,
699
+ $boxSizing: D,
700
+ $scroll: C,
696
701
  children: t
697
702
  }
698
703
  );
699
704
  }
700
705
  );
701
- j.displayName = "BorderStack";
702
- const Cn = (e) => {
706
+ z.displayName = "BorderStack";
707
+ const En = (e) => {
703
708
  const {
704
709
  conditionsAlignment: n,
705
710
  decision: t,
706
711
  decisionMapper: a,
707
- loading: i,
708
- textValues: r,
709
- visibleConditions: p,
712
+ loading: r,
713
+ textValues: i,
714
+ visibleConditions: u,
710
715
  tagLabel: l,
711
- isOpen: s,
712
- onToggle: c,
713
- hasEffectiveFrom: u,
714
- hasValidUntil: d,
715
- effectiveFromRenderer: b,
716
- validUntilRenderer: m
716
+ isOpen: d,
717
+ onToggle: s,
718
+ hasEffectiveFrom: p,
719
+ hasValidUntil: c,
720
+ effectiveFromRenderer: m,
721
+ validUntilRenderer: b
717
722
  } = e;
718
- return i ? /* @__PURE__ */ h(g, { direction: "column", gap: "16px", children: [
723
+ return r ? /* @__PURE__ */ h(g, { direction: "column", gap: "16px", children: [
719
724
  /* @__PURE__ */ h(
720
725
  g,
721
726
  {
@@ -723,23 +728,23 @@ const Cn = (e) => {
723
728
  justifyContent: "space-between",
724
729
  children: [
725
730
  /* @__PURE__ */ o(
726
- G,
731
+ Q,
727
732
  {
728
733
  element: a,
729
- valueData: P(
734
+ valueData: G(
730
735
  a
731
736
  ),
732
737
  type: "decision"
733
738
  }
734
739
  ),
735
740
  /* @__PURE__ */ h(g, { gap: "8px", children: [
736
- /* @__PURE__ */ o(H, { appearance: "gray", label: l, displayIcon: !1 }),
741
+ /* @__PURE__ */ o(q, { appearance: "gray", label: l, displayIcon: !1 }),
737
742
  /* @__PURE__ */ o(
738
- L,
743
+ R,
739
744
  {
740
745
  appearance: "dark",
741
- icon: s ? /* @__PURE__ */ o(Re, {}) : /* @__PURE__ */ o(Oe, {}),
742
- onClick: c,
746
+ icon: d ? /* @__PURE__ */ o(Me, {}) : /* @__PURE__ */ o(we, {}),
747
+ onClick: s,
743
748
  size: "24px",
744
749
  cursorHover: !0
745
750
  }
@@ -749,11 +754,11 @@ const Cn = (e) => {
749
754
  },
750
755
  t.ruleName
751
756
  ),
752
- s && /* @__PURE__ */ h(k, { children: [
753
- /* @__PURE__ */ o(R, { dashed: !0 }),
757
+ d && /* @__PURE__ */ h(E, { children: [
758
+ /* @__PURE__ */ o(F, { dashed: !0 }),
754
759
  /* @__PURE__ */ h(g, { direction: "column", gap: "12px", children: [
755
760
  /* @__PURE__ */ o(
756
- S,
761
+ w,
757
762
  {
758
763
  type: "label",
759
764
  size: "large",
@@ -761,7 +766,7 @@ const Cn = (e) => {
761
766
  weight: "bold",
762
767
  textAlign: "start",
763
768
  padding: "0 12px",
764
- children: r.factsThatConditionIt
769
+ children: i.factsThatConditionIt
765
770
  }
766
771
  ),
767
772
  /* @__PURE__ */ h(
@@ -771,18 +776,18 @@ const Cn = (e) => {
771
776
  gap: "8px",
772
777
  justifyContent: n,
773
778
  children: [
774
- p.map((f) => /* @__PURE__ */ o(
775
- j,
779
+ u.map((f) => /* @__PURE__ */ o(
780
+ z,
776
781
  {
777
782
  direction: "column",
778
783
  padding: "6px 12px",
779
784
  borderRadius: "8px",
780
785
  background: !0,
781
786
  children: /* @__PURE__ */ o(
782
- G,
787
+ Q,
783
788
  {
784
789
  element: { ...f, value: f.value },
785
- valueData: P(
790
+ valueData: G(
786
791
  f
787
792
  )
788
793
  }
@@ -790,35 +795,35 @@ const Cn = (e) => {
790
795
  },
791
796
  f.conditionName
792
797
  )),
793
- u && b && /* @__PURE__ */ o(
794
- j,
798
+ p && m && /* @__PURE__ */ o(
799
+ z,
795
800
  {
796
801
  direction: "column",
797
802
  padding: "6px 12px",
798
803
  borderRadius: "8px",
799
804
  background: !0,
800
805
  children: /* @__PURE__ */ o(
801
- G,
806
+ Q,
802
807
  {
803
- element: b.element,
804
- valueData: b.valueData
808
+ element: m.element,
809
+ valueData: m.valueData
805
810
  },
806
811
  "effectiveFrom"
807
812
  )
808
813
  }
809
814
  ),
810
- d && m && /* @__PURE__ */ o(
811
- j,
815
+ c && b && /* @__PURE__ */ o(
816
+ z,
812
817
  {
813
818
  direction: "column",
814
819
  padding: "6px 12px",
815
820
  borderRadius: "8px",
816
821
  background: !0,
817
822
  children: /* @__PURE__ */ o(
818
- G,
823
+ Q,
819
824
  {
820
- element: m.element,
821
- valueData: m.valueData
825
+ element: b.element,
826
+ valueData: b.valueData
822
827
  },
823
828
  "validUntil"
824
829
  )
@@ -831,77 +836,77 @@ const Cn = (e) => {
831
836
  ] })
832
837
  ] }) : /* @__PURE__ */ h(g, { justifyContent: "space-between", children: [
833
838
  /* @__PURE__ */ h(g, { alignItems: "center", gap: "8px", children: [
834
- /* @__PURE__ */ o(z, { animated: !0, width: "150px" }),
835
- /* @__PURE__ */ o(z, { animated: !0, width: "70px" })
839
+ /* @__PURE__ */ o(V, { animated: !0, width: "150px" }),
840
+ /* @__PURE__ */ o(V, { animated: !0, width: "70px" })
836
841
  ] }),
837
842
  /* @__PURE__ */ h(g, { alignItems: "center", gap: "8px", children: [
838
- /* @__PURE__ */ o(z, { animated: !0, width: "50px" }),
839
- /* @__PURE__ */ o(Ue, { animated: !0 })
843
+ /* @__PURE__ */ o(V, { animated: !0, width: "50px" }),
844
+ /* @__PURE__ */ o(Be, { animated: !0 })
840
845
  ] })
841
846
  ] });
842
- }, Fe = (e) => {
843
- var w;
847
+ }, Re = (e) => {
848
+ var C;
844
849
  const {
845
850
  decision: n,
846
851
  loading: t = !1,
847
852
  textValues: a,
848
- position: i,
849
- isOpen: r = !1,
850
- onToggle: p
851
- } = e, l = !!(n != null && n.effectiveFrom), s = !!(n != null && n.validUntil), c = l ? {
853
+ position: r,
854
+ isOpen: i = !1,
855
+ onToggle: u
856
+ } = e, l = !!(n != null && n.effectiveFrom), d = !!(n != null && n.validUntil), s = l ? {
852
857
  element: {
853
858
  labelName: a == null ? void 0 : a.effectiveFrom,
854
859
  value: String(n.effectiveFrom),
855
- howToSetTheDecision: V.EQUAL,
856
- decisionDataType: I.DATE
860
+ howToSetTheDecision: B.EQUAL,
861
+ decisionDataType: O.DATE
857
862
  },
858
- valueData: P({
863
+ valueData: G({
859
864
  labelName: a == null ? void 0 : a.effectiveFrom,
860
865
  value: String(n.effectiveFrom),
861
- howToSetTheDecision: V.EQUAL,
862
- decisionDataType: I.DATE
866
+ howToSetTheDecision: B.EQUAL,
867
+ decisionDataType: O.DATE
863
868
  })
864
- } : null, u = s ? {
869
+ } : null, p = d ? {
865
870
  element: {
866
871
  labelName: a == null ? void 0 : a.validUntil,
867
872
  value: String(n.validUntil),
868
- howToSetTheDecision: V.EQUAL,
869
- decisionDataType: I.DATE
873
+ howToSetTheDecision: B.EQUAL,
874
+ decisionDataType: O.DATE
870
875
  },
871
- valueData: P({
876
+ valueData: G({
872
877
  labelName: a == null ? void 0 : a.validUntil,
873
878
  value: String(n.validUntil),
874
- howToSetTheDecision: V.EQUAL,
875
- decisionDataType: I.DATE
879
+ howToSetTheDecision: B.EQUAL,
880
+ decisionDataType: O.DATE
876
881
  })
877
- } : null, d = n ? {
882
+ } : null, c = n ? {
878
883
  labelName: n.labelName || "",
879
884
  decisionDataType: n.decisionDataType || "alphabetical",
880
- value: P(n),
885
+ value: G(n),
881
886
  howToSetTheDecision: n.howToSetTheDecision || "EqualTo"
882
- } : null, b = ((w = n == null ? void 0 : n.conditionsThatEstablishesTheDecision) == null ? void 0 : w.filter(
883
- (E) => !E.hidden
884
- )) || [], m = Array.from({ length: 5 }), f = !!(!t && n && a && d), y = b.length < 2 ? "start" : "space-between", C = `N° ${String((i ?? 0) + 1).padStart(2, "0")}`;
887
+ } : null, m = ((C = n == null ? void 0 : n.conditionsThatEstablishesTheDecision) == null ? void 0 : C.filter(
888
+ (N) => !N.hidden
889
+ )) || [], b = Array.from({ length: 5 }), f = !!(!t && n && a && c), y = m.length < 2 ? "start" : "space-between", D = `N° ${String((r ?? 0) + 1).padStart(2, "0")}`;
885
890
  return /* @__PURE__ */ o(
886
- Cn,
891
+ En,
887
892
  {
888
893
  conditionsAlignment: y,
889
894
  decision: n,
890
- decisionMapper: d,
895
+ decisionMapper: c,
891
896
  loading: f,
892
- skeleton: m,
897
+ skeleton: b,
893
898
  textValues: a,
894
- visibleConditions: b,
895
- tagLabel: C,
896
- isOpen: r,
897
- onToggle: p,
899
+ visibleConditions: m,
900
+ tagLabel: D,
901
+ isOpen: i,
902
+ onToggle: u,
898
903
  hasEffectiveFrom: l,
899
- hasValidUntil: s,
900
- effectiveFromRenderer: c,
901
- validUntilRenderer: u
904
+ hasValidUntil: d,
905
+ effectiveFromRenderer: s,
906
+ validUntilRenderer: p
902
907
  }
903
908
  );
904
- }, Dn = De`
909
+ }, $n = Ne`
905
910
  from {
906
911
  opacity: 0;
907
912
  transform: translateY(20px);
@@ -911,12 +916,12 @@ const Cn = (e) => {
911
916
  transform: translateY(0);
912
917
  }
913
918
  `;
914
- x.div`
919
+ T.div`
915
920
  border-radius: 8px;
916
921
  border: 1px solid
917
922
  ${({ theme: e }) => {
918
923
  var n, t;
919
- return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
924
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || x.palette.neutral.N30;
920
925
  }};
921
926
  box-sizing: border-box;
922
927
  display: flex;
@@ -925,43 +930,37 @@ x.div`
925
930
  height: 100%;
926
931
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
927
932
  `;
928
- x.div`
933
+ T.div`
929
934
  & > div {
930
935
  border-radius: 8px;
931
936
  border: 1px solid
932
937
  ${({ theme: e }) => {
933
938
  var n, t;
934
- return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
939
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || x.palette.neutral.N30;
935
940
  }};
936
941
  }
937
942
  `;
938
- x.div`
943
+ const An = T.div`
939
944
  & > div {
940
- background-color: ${({ theme: e }) => {
945
+ box-shadow: 0px 2px 3px 0px
946
+ ${({ theme: e }) => {
941
947
  var n, t;
942
- return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N10) || v.palette.neutral.N10;
948
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutralAlpha) == null ? void 0 : t.N30A) || x.palette.neutralAlpha.N30A;
943
949
  }};
944
- justify-content: center;
950
+ cursor: pointer;
945
951
  }
946
- min-height: 350px;
947
- width: 100%;
948
- height: 100%;
949
- padding-bottom: 12px;
950
- cursor: pointer;
951
- `;
952
- x.div`
952
+ `, In = T.div`
953
953
  width: 100%;
954
954
  height: 100%;
955
955
  & > div {
956
- animation: ${Dn} 600ms ease-out;
956
+ animation: ${$n} 600ms ease-out;
957
957
  }
958
- `;
959
- const Sn = x.div`
958
+ `, Fn = T.div`
960
959
  & > div > div {
961
960
  border-radius: 8px;
962
961
  box-sizing: border-box;
963
962
  }
964
- `, Nn = x.div`
963
+ `, Rn = T.div`
965
964
  & > div {
966
965
  width: 100%;
967
966
  height: 100%;
@@ -981,63 +980,63 @@ const Sn = x.div`
981
980
  border-radius: 8px;
982
981
  }
983
982
  }
984
- `, En = (e) => {
983
+ `, On = (e) => {
985
984
  const { index: n, handleOpenModal: t } = e;
986
985
  return /* @__PURE__ */ o(
987
- $e,
986
+ Fe,
988
987
  {
989
988
  id: `loading-card-${n}`,
990
989
  handleDelete: () => {
991
990
  },
992
991
  handleView: () => t ? t() : null,
993
992
  controls: !1,
994
- children: /* @__PURE__ */ o(Fe, { loading: !0 })
993
+ children: /* @__PURE__ */ o(Re, { loading: !0 })
995
994
  },
996
995
  `loading-card-${n}`
997
996
  );
998
- }, kn = (e) => {
997
+ }, Mn = (e) => {
999
998
  const {
1000
999
  decision: n,
1001
1000
  controls: t,
1002
1001
  handleOpenModal: a,
1003
- handleDelete: i,
1004
- textValues: r,
1005
- index: p,
1002
+ handleDelete: r,
1003
+ textValues: i,
1004
+ index: u,
1006
1005
  isOpen: l,
1007
- onToggle: s
1006
+ onToggle: d
1008
1007
  } = e;
1009
- return n ? /* @__PURE__ */ o(J, { children: /* @__PURE__ */ o(g, { direction: "column", gap: "4px", width: "100%", children: /* @__PURE__ */ o(
1010
- $e,
1008
+ return n ? /* @__PURE__ */ o(de, { children: /* @__PURE__ */ o(g, { direction: "column", gap: "4px", width: "100%", children: /* @__PURE__ */ o(
1009
+ Fe,
1011
1010
  {
1012
1011
  id: n.decisionId,
1013
- handleDelete: () => i ? i(n.decisionId) : null,
1012
+ handleDelete: () => r ? r(n.decisionId) : null,
1014
1013
  handleView: () => a ? a(n) : null,
1015
1014
  controls: t,
1016
1015
  children: /* @__PURE__ */ o(
1017
- Fe,
1016
+ Re,
1018
1017
  {
1019
1018
  decision: n,
1020
- textValues: r,
1021
- position: p,
1019
+ textValues: i,
1020
+ position: u,
1022
1021
  isOpen: !!l,
1023
- onToggle: () => s == null ? void 0 : s(!l)
1022
+ onToggle: () => d == null ? void 0 : d(!l)
1024
1023
  }
1025
1024
  )
1026
1025
  }
1027
1026
  ) }) }, n.decisionId) : null;
1028
- }, An = (e) => {
1027
+ }, Ln = (e) => {
1029
1028
  const {
1030
1029
  customTitleContentAddCard: n,
1031
1030
  index: t,
1032
1031
  handleOpenModal: a,
1033
- shouldRenderEmptyMessage: i
1032
+ shouldRenderEmptyMessage: r
1034
1033
  } = e;
1035
- return /* @__PURE__ */ o(J, { children: i ? null : /* @__PURE__ */ o(
1036
- Ae,
1034
+ return /* @__PURE__ */ o(In, { children: r ? null : /* @__PURE__ */ o(
1035
+ An,
1037
1036
  {
1038
1037
  onClick: () => a ? a() : null,
1039
1038
  children: /* @__PURE__ */ o(
1040
- j,
1039
+ z,
1041
1040
  {
1042
1041
  direction: "column",
1043
1042
  gap: "4px",
@@ -1052,12 +1051,12 @@ const Sn = x.div`
1052
1051
  alignItems: "center",
1053
1052
  padding: "16px",
1054
1053
  children: [
1055
- /* @__PURE__ */ o(S, { appearance: "gray", type: "label", size: "large", weight: "bold", children: n || "Agregar decisión" }),
1054
+ /* @__PURE__ */ o(w, { appearance: "gray", type: "label", size: "large", weight: "bold", children: n || "Agregar decisión" }),
1056
1055
  /* @__PURE__ */ o(
1057
- L,
1056
+ R,
1058
1057
  {
1059
1058
  appearance: "gray",
1060
- icon: /* @__PURE__ */ o(Y, {}),
1059
+ icon: /* @__PURE__ */ o(J, {}),
1061
1060
  size: "24px",
1062
1061
  cursorHover: !0
1063
1062
  }
@@ -1069,93 +1068,93 @@ const Sn = x.div`
1069
1068
  )
1070
1069
  }
1071
1070
  ) }, `add-decision-${t}`);
1072
- }, $n = {
1073
- loading: En,
1074
- decision: kn,
1075
- add: An
1076
- }, te = (e) => {
1077
- const { type: n } = e, t = $n[n];
1071
+ }, zn = {
1072
+ loading: On,
1073
+ decision: Mn,
1074
+ add: Ln
1075
+ }, ae = (e) => {
1076
+ const { type: n } = e, t = zn[n];
1078
1077
  return t ? t(e) : null;
1079
- }, Fn = (e) => {
1078
+ }, Un = (e) => {
1080
1079
  const {
1081
1080
  controls: n,
1082
1081
  customTitleContentAddCard: t,
1083
1082
  decisions: a,
1084
- loading: i,
1085
- handleOpenModal: r,
1086
- handleDelete: p,
1083
+ loading: r,
1084
+ handleOpenModal: i,
1085
+ handleDelete: u,
1087
1086
  textValues: l,
1088
- isOpenFor: s,
1089
- toggleAt: c
1090
- } = e, u = i ? Array.from({ length: 3 }).map(
1091
- (b, m) => te({
1087
+ isOpenFor: d,
1088
+ toggleAt: s
1089
+ } = e, p = r ? Array.from({ length: 3 }).map(
1090
+ (m, b) => ae({
1092
1091
  type: "loading",
1093
- index: m,
1092
+ index: b,
1094
1093
  controls: n,
1095
1094
  customTitleContentAddCard: t,
1096
- loading: i,
1097
- handleOpenModal: r,
1098
- handleDelete: p,
1095
+ loading: r,
1096
+ handleOpenModal: i,
1097
+ handleDelete: u,
1099
1098
  textValues: l
1100
1099
  })
1101
1100
  ) : a == null ? void 0 : a.map(
1102
- (b, m) => te({
1101
+ (m, b) => ae({
1103
1102
  type: "decision",
1104
- decision: b,
1105
- controls: s ? s(m) : !1,
1103
+ decision: m,
1104
+ controls: d ? d(b) : !1,
1106
1105
  customTitleContentAddCard: t,
1107
- loading: i,
1108
- handleOpenModal: r,
1109
- handleDelete: p,
1106
+ loading: r,
1107
+ handleOpenModal: i,
1108
+ handleDelete: u,
1110
1109
  textValues: l,
1111
- index: m,
1112
- isOpen: s ? s(m) : !1,
1113
- onToggle: c ? () => c(m) : void 0
1110
+ index: b,
1111
+ isOpen: d ? d(b) : !1,
1112
+ onToggle: s ? () => s(b) : void 0
1114
1113
  })
1115
- ), d = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !i && n;
1116
- return { renderedCards: u, shouldRenderAddCard: d };
1117
- }, vt = (e) => {
1114
+ ), c = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !r && n;
1115
+ return { renderedCards: p, shouldRenderAddCard: c };
1116
+ }, Ft = (e) => {
1118
1117
  const {
1119
1118
  controls: n = !0,
1120
1119
  customTitleContentAddCard: t,
1121
1120
  customMessageEmptyDecisions: a,
1122
- decisions: i,
1123
- textValues: r,
1124
- decisionTemplate: p,
1121
+ decisions: r,
1122
+ textValues: i,
1123
+ decisionTemplate: u,
1125
1124
  isModalOpen: l,
1126
- selectedDecision: s,
1127
- loading: c,
1128
- handleOpenModal: u,
1129
- handleCloseModal: d,
1130
- handleSubmitForm: b,
1131
- handleDelete: m,
1125
+ selectedDecision: d,
1126
+ loading: s,
1127
+ handleOpenModal: p,
1128
+ handleCloseModal: c,
1129
+ handleSubmitForm: m,
1130
+ handleDelete: b,
1132
1131
  terms: f = !0
1133
- } = e, [y, C] = O(null), w = B("(max-width: 681px)"), { renderedCards: E, shouldRenderAddCard: $ } = Fn({
1132
+ } = e, [y, D] = M(null), C = H("(max-width: 681px)"), { renderedCards: N, shouldRenderAddCard: A } = Un({
1134
1133
  controls: n,
1135
1134
  customTitleContentAddCard: t,
1136
- decisions: i,
1137
- loading: c,
1138
- handleOpenModal: u,
1139
- handleDelete: m,
1140
- textValues: r,
1141
- isOpenFor: (N) => y === N,
1142
- toggleAt: (N) => C((M) => M === N ? null : N)
1143
- }), A = (i == null ? void 0 : i.length) === 0 && !c;
1144
- return /* @__PURE__ */ h(k, { children: [
1145
- /* @__PURE__ */ o(Sn, { children: /* @__PURE__ */ o(Nn, { children: /* @__PURE__ */ o(g, { direction: "column", gap: "16px", padding: "6px", children: A ? /* @__PURE__ */ h(
1135
+ decisions: r,
1136
+ loading: s,
1137
+ handleOpenModal: p,
1138
+ handleDelete: b,
1139
+ textValues: i,
1140
+ isOpenFor: (k) => y === k,
1141
+ toggleAt: (k) => D((L) => L === k ? null : k)
1142
+ }), $ = (r == null ? void 0 : r.length) === 0 && !s;
1143
+ return /* @__PURE__ */ h(E, { children: [
1144
+ /* @__PURE__ */ o(Fn, { children: /* @__PURE__ */ o(Rn, { children: /* @__PURE__ */ o(g, { direction: "column", gap: "16px", padding: "6px", children: $ ? /* @__PURE__ */ h(
1146
1145
  g,
1147
1146
  {
1148
1147
  direction: "column",
1149
1148
  gap: "28px",
1150
1149
  width: "100%",
1151
- height: w ? "auto" : "435px",
1150
+ height: C ? "auto" : "435px",
1152
1151
  justifyContent: "center",
1153
1152
  alignItems: "center",
1154
1153
  children: [
1155
- /* @__PURE__ */ o(S, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */ h(k, { children: [
1154
+ /* @__PURE__ */ o(w, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */ h(E, { children: [
1156
1155
  "Aún NO tienes definidas tasas de interés efectivas . Presiona",
1157
1156
  /* @__PURE__ */ h(
1158
- S,
1157
+ w,
1159
1158
  {
1160
1159
  as: "span",
1161
1160
  type: "label",
@@ -1174,15 +1173,15 @@ const Sn = x.div`
1174
1173
  /* @__PURE__ */ o(
1175
1174
  U,
1176
1175
  {
1177
- iconBefore: /* @__PURE__ */ o(Y, {}),
1178
- onClick: () => u ? u() : null,
1176
+ iconBefore: /* @__PURE__ */ o(J, {}),
1177
+ onClick: () => p ? p() : null,
1179
1178
  children: t || "Agregar decisión"
1180
1179
  }
1181
1180
  )
1182
1181
  ]
1183
1182
  }
1184
1183
  ) : /* @__PURE__ */ h(
1185
- K,
1184
+ X,
1186
1185
  {
1187
1186
  templateColumns: "1fr",
1188
1187
  autoFlow: "row dense",
@@ -1192,54 +1191,54 @@ const Sn = x.div`
1192
1191
  autoRows: "auto",
1193
1192
  justifyItems: "center",
1194
1193
  padding: "6px",
1195
- height: w ? "auto" : "484px",
1194
+ height: C ? "auto" : "484px",
1196
1195
  children: [
1197
- E,
1198
- $ && te({
1196
+ N,
1197
+ A && ae({
1199
1198
  type: "add",
1200
- index: i == null ? void 0 : i.length,
1199
+ index: r == null ? void 0 : r.length,
1201
1200
  controls: n,
1202
1201
  customTitleContentAddCard: t,
1203
1202
  customMessageEmptyDecisions: a,
1204
- loading: c,
1205
- handleOpenModal: u,
1206
- handleDelete: m,
1207
- textValues: r,
1208
- shouldRenderEmptyMessage: A,
1203
+ loading: s,
1204
+ handleOpenModal: p,
1205
+ handleDelete: b,
1206
+ textValues: i,
1207
+ shouldRenderEmptyMessage: $,
1209
1208
  terms: f
1210
1209
  })
1211
1210
  ]
1212
1211
  }
1213
1212
  ) }) }) }),
1214
1213
  l && /* @__PURE__ */ o(
1215
- ke,
1214
+ Ie,
1216
1215
  {
1217
1216
  portalId: "modal-portal",
1218
- onCloseModal: d,
1219
- title: s ? "Editar Decisión" : "Nueva decisión",
1217
+ onCloseModal: c,
1218
+ title: d ? "Editar Decisión" : "Nueva decisión",
1220
1219
  children: /* @__PURE__ */ o(
1221
- Ie,
1220
+ Oe,
1222
1221
  {
1223
- decision: s || p,
1224
- onSubmitEvent: b,
1225
- textValues: r,
1226
- onCancel: () => d ? d() : () => {
1222
+ decision: d || u,
1223
+ onSubmitEvent: m,
1224
+ textValues: i,
1225
+ onCancel: () => c ? c() : () => {
1227
1226
  }
1228
1227
  }
1229
1228
  )
1230
1229
  }
1231
1230
  )
1232
1231
  ] });
1233
- }, In = {
1232
+ }, Vn = {
1234
1233
  border: {
1235
- color: v.palette.neutral.N40
1234
+ color: x.palette.neutral.N40
1236
1235
  }
1237
- }, Rn = x.div`
1236
+ }, Bn = T.div`
1238
1237
  border-width: 1px;
1239
1238
  border-style: solid;
1240
1239
  border-color: ${({ theme: e }) => {
1241
1240
  var n, t;
1242
- return ((t = (n = e == null ? void 0 : e.box) == null ? void 0 : n.border) == null ? void 0 : t.color) || In.border.color;
1241
+ return ((t = (n = e == null ? void 0 : e.box) == null ? void 0 : n.border) == null ? void 0 : t.color) || Vn.border.color;
1243
1242
  }};
1244
1243
  border-radius: ${({ $borderRadius: e }) => e};
1245
1244
  margin: ${({ $margin: e }) => e};
@@ -1248,92 +1247,92 @@ const Sn = x.div`
1248
1247
  height: ${({ $height: e }) => e};
1249
1248
  box-sizing: border-box;
1250
1249
  `;
1251
- function On(e) {
1250
+ function Hn(e) {
1252
1251
  const {
1253
1252
  children: n,
1254
1253
  padding: t = "16px",
1255
1254
  margin: a,
1256
- borderRadius: i = "8px",
1257
- width: r,
1258
- height: p
1255
+ borderRadius: r = "8px",
1256
+ width: i,
1257
+ height: u
1259
1258
  } = e;
1260
1259
  return /* @__PURE__ */ o(
1261
- Rn,
1260
+ Bn,
1262
1261
  {
1263
1262
  $padding: t,
1264
1263
  $margin: a,
1265
- $borderRadius: i,
1266
- $width: r,
1267
- $height: p,
1264
+ $borderRadius: r,
1265
+ $width: i,
1266
+ $height: u,
1268
1267
  children: n
1269
1268
  }
1270
1269
  );
1271
1270
  }
1272
- const Mn = (e, n) => {
1273
- const [t, a] = O([]), [i, r] = O([]), [p, l] = O(!1), s = Q(null);
1274
- return oe(() => {
1275
- if (!e.current || !s.current) return;
1276
- const c = e.current, u = s.current, d = () => {
1277
- var $;
1278
- const m = c.clientWidth, f = Array.from(
1279
- u.querySelectorAll('[data-filter-tag="true"]')
1271
+ const jn = (e, n) => {
1272
+ const [t, a] = M([]), [r, i] = M([]), [u, l] = M(!1), d = K(null);
1273
+ return re(() => {
1274
+ if (!e.current || !d.current) return;
1275
+ const s = e.current, p = d.current, c = () => {
1276
+ var A;
1277
+ const b = s.clientWidth, f = Array.from(
1278
+ p.querySelectorAll('[data-filter-tag="true"]')
1280
1279
  ), y = 48;
1281
- let C = 0;
1282
- const w = [], E = [];
1283
- for (let A = 0; A < n.length; A++) {
1284
- const T = (($ = f[A]) == null ? void 0 : $.offsetWidth) ?? 0;
1285
- C + T + y <= m ? (w.push(n[A]), C += T) : E.push(n[A]);
1280
+ let D = 0;
1281
+ const C = [], N = [];
1282
+ for (let $ = 0; $ < n.length; $++) {
1283
+ const v = ((A = f[$]) == null ? void 0 : A.offsetWidth) ?? 0;
1284
+ D + v + y <= b ? (C.push(n[$]), D += v) : N.push(n[$]);
1286
1285
  }
1287
- a(w), r(E), l(E.length > 0);
1288
- }, b = new ResizeObserver(() => {
1289
- requestAnimationFrame(d);
1286
+ a(C), i(N), l(N.length > 0);
1287
+ }, m = new ResizeObserver(() => {
1288
+ requestAnimationFrame(c);
1290
1289
  });
1291
- return b.observe(c), () => b.disconnect();
1292
- }, [n, e]), { visible: t, hidden: i, showOverflowIndicator: p, measurementRef: s };
1290
+ return m.observe(s), () => m.disconnect();
1291
+ }, [n, e]), { visible: t, hidden: r, showOverflowIndicator: u, measurementRef: d };
1293
1292
  };
1294
- x.div`
1293
+ T.div`
1295
1294
  & > div {
1296
1295
  width: 100%;
1297
1296
  }
1298
1297
  `;
1299
- const Ln = x.div`
1298
+ const _n = T.div`
1300
1299
  position: absolute;
1301
1300
  top: calc(100% + 4px);
1302
1301
  right: 0;
1303
1302
  z-index: 1000;
1304
1303
  width: 170px;
1305
- `, Un = x.div`
1304
+ `, qn = T.div`
1306
1305
  position: absolute;
1307
1306
  visibility: hidden;
1308
1307
  pointer-events: none;
1309
1308
  height: 0;
1310
1309
  overflow: hidden;
1311
- `, zn = x.div`
1310
+ `, Pn = T.div`
1312
1311
  cursor: pointer;
1313
- `, ae = {
1312
+ `, oe = {
1314
1313
  border: {
1315
1314
  color: {
1316
- regular: v.palette.neutral.N40,
1317
- disabled: v.palette.neutral.N40,
1318
- focus: v.palette.blue.B300,
1319
- invalid: v.palette.red.R400
1315
+ regular: x.palette.neutral.N40,
1316
+ disabled: x.palette.neutral.N40,
1317
+ focus: x.palette.blue.B300,
1318
+ invalid: x.palette.red.R400
1320
1319
  }
1321
1320
  },
1322
1321
  background: {
1323
1322
  color: {
1324
- regular: v.palette.neutral.N0,
1325
- disabled: v.palette.neutral.N10
1323
+ regular: x.palette.neutral.N0,
1324
+ disabled: x.palette.neutral.N10
1326
1325
  }
1327
1326
  },
1328
1327
  content: {
1329
1328
  color: {
1330
- regular: v.palette.neutral.N900,
1331
- disabled: v.palette.neutral.N70
1329
+ regular: x.palette.neutral.N900,
1330
+ disabled: x.palette.neutral.N70
1332
1331
  }
1333
1332
  },
1334
1333
  placeholder: {
1335
1334
  color: {
1336
- regular: v.palette.neutral.N300
1335
+ regular: x.palette.neutral.N300
1337
1336
  }
1338
1337
  },
1339
1338
  option: {
@@ -1342,11 +1341,11 @@ const Ln = x.div`
1342
1341
  hover: "primary"
1343
1342
  },
1344
1343
  background: {
1345
- regular: v.palette.neutral.N0,
1346
- hover: v.palette.neutral.N30
1344
+ regular: x.palette.neutral.N0,
1345
+ hover: x.palette.neutral.N30
1347
1346
  }
1348
1347
  }
1349
- }, Vn = x.li`
1348
+ }, Gn = T.li`
1350
1349
  display: flex;
1351
1350
  align-items: center;
1352
1351
  align-self: stretch;
@@ -1361,23 +1360,23 @@ const Ln = x.div`
1361
1360
  &:hover {
1362
1361
  background-color: ${({ theme: e }) => {
1363
1362
  var n, t, a;
1364
- return ((a = (t = (n = e == null ? void 0 : e.input) == null ? void 0 : n.background) == null ? void 0 : t.color) == null ? void 0 : a.regular) || ae.background.color.regular;
1363
+ return ((a = (t = (n = e == null ? void 0 : e.input) == null ? void 0 : n.background) == null ? void 0 : t.color) == null ? void 0 : a.regular) || oe.background.color.regular;
1365
1364
  }};
1366
1365
  }
1367
- `, jn = (e) => {
1368
- var b, m, f, y, C, w;
1369
- const { id: n, label: t, leadingIcon: a, onClose: i } = e, [r, p] = O(!1), l = () => p(!0), s = () => p(!1), c = He(Be), u = ((f = (m = (b = c == null ? void 0 : c.input) == null ? void 0 : b.option) == null ? void 0 : m.appearance) == null ? void 0 : f.hover) ?? ae.option.appearance.hover, d = ((w = (C = (y = c == null ? void 0 : c.input) == null ? void 0 : y.option) == null ? void 0 : C.appearance) == null ? void 0 : w.regular) ?? ae.option.appearance.regular;
1366
+ `, Qn = (e) => {
1367
+ var m, b, f, y, D, C;
1368
+ const { id: n, label: t, leadingIcon: a, onClose: r } = e, [i, u] = M(!1), l = () => u(!0), d = () => u(!1), s = Pe(qe), p = ((f = (b = (m = s == null ? void 0 : s.input) == null ? void 0 : m.option) == null ? void 0 : b.appearance) == null ? void 0 : f.hover) ?? oe.option.appearance.hover, c = ((C = (D = (y = s == null ? void 0 : s.input) == null ? void 0 : y.option) == null ? void 0 : D.appearance) == null ? void 0 : C.regular) ?? oe.option.appearance.regular;
1370
1369
  return /* @__PURE__ */ o(
1371
- Vn,
1370
+ Gn,
1372
1371
  {
1373
1372
  id: n,
1374
1373
  onMouseEnter: l,
1375
- onMouseLeave: s,
1376
- onClick: (E) => {
1377
- E.stopPropagation();
1374
+ onMouseLeave: d,
1375
+ onClick: (N) => {
1376
+ N.stopPropagation();
1378
1377
  },
1379
1378
  children: /* @__PURE__ */ h(
1380
- K,
1379
+ X,
1381
1380
  {
1382
1381
  alignItems: "center",
1383
1382
  gap: "8px",
@@ -1385,31 +1384,31 @@ const Ln = x.div`
1385
1384
  width: "100%",
1386
1385
  children: [
1387
1386
  a && /* @__PURE__ */ o(
1388
- L,
1387
+ R,
1389
1388
  {
1390
1389
  icon: a,
1391
1390
  size: "medium",
1392
- appearance: r ? u : d
1391
+ appearance: i ? p : c
1393
1392
  }
1394
1393
  ),
1395
1394
  /* @__PURE__ */ o(
1396
- S,
1395
+ w,
1397
1396
  {
1398
1397
  textAlign: "start",
1399
1398
  size: "medium",
1400
- appearance: r ? u : d,
1399
+ appearance: i ? p : c,
1401
1400
  children: t
1402
1401
  }
1403
1402
  ),
1404
1403
  /* @__PURE__ */ o(
1405
- L,
1404
+ R,
1406
1405
  {
1407
- icon: /* @__PURE__ */ o(Me, {}),
1406
+ icon: /* @__PURE__ */ o(Le, {}),
1408
1407
  size: "small",
1409
- onClick: (E) => {
1410
- E.stopPropagation(), i == null || i();
1408
+ onClick: (N) => {
1409
+ N.stopPropagation(), r == null || r();
1411
1410
  },
1412
- appearance: r ? u : d,
1411
+ appearance: i ? p : c,
1413
1412
  cursorHover: !0
1414
1413
  }
1415
1414
  )
@@ -1418,54 +1417,54 @@ const Ln = x.div`
1418
1417
  )
1419
1418
  }
1420
1419
  );
1421
- }, yt = (e) => {
1420
+ }, Rt = (e) => {
1422
1421
  const {
1423
1422
  appliedFilters: n = [],
1424
1423
  onClear: t,
1425
1424
  onClick: a,
1426
- noFiltersLabel: i,
1427
- titleClearFilter: r,
1428
- titleFilter: p
1429
- } = e, l = Q(null), s = Q(null), c = Q(null), {
1430
- visible: u,
1431
- hidden: d,
1432
- showOverflowIndicator: b,
1433
- measurementRef: m
1434
- } = Mn(l, n), [f, y] = O(!1), C = (T) => {
1435
- T.stopPropagation(), y((N) => !N);
1425
+ noFiltersLabel: r,
1426
+ titleClearFilter: i,
1427
+ titleFilter: u
1428
+ } = e, l = K(null), d = K(null), s = K(null), {
1429
+ visible: p,
1430
+ hidden: c,
1431
+ showOverflowIndicator: m,
1432
+ measurementRef: b
1433
+ } = jn(l, n), [f, y] = M(!1), D = (v) => {
1434
+ v.stopPropagation(), y((k) => !k);
1436
1435
  };
1437
- oe(() => {
1438
- const T = (N) => {
1439
- var le, se;
1440
- const M = N.target;
1441
- !((le = s.current) != null && le.contains(M)) && !((se = c.current) != null && se.contains(M)) && y(!1);
1436
+ re(() => {
1437
+ const v = (k) => {
1438
+ var se, ce;
1439
+ const L = k.target;
1440
+ !((se = d.current) != null && se.contains(L)) && !((ce = s.current) != null && ce.contains(L)) && y(!1);
1442
1441
  };
1443
- return f && window.addEventListener("mousedown", T), () => window.removeEventListener("mousedown", T);
1442
+ return f && window.addEventListener("mousedown", v), () => window.removeEventListener("mousedown", v);
1444
1443
  }, [f]);
1445
- const w = n.length === 0, E = f && d.length > 0, $ = d.map((T) => ({
1446
- id: T.label,
1447
- value: T.label,
1448
- label: T.label,
1449
- icon: T.icon
1450
- })), A = (T) => {
1451
- var N, M;
1452
- (M = (N = d.find((F) => F.label === T)) == null ? void 0 : N.onClose) == null || M.call(N), y(!1);
1444
+ const C = n.length === 0, N = f && c.length > 0, A = c.map((v) => ({
1445
+ id: v.label,
1446
+ value: v.label,
1447
+ label: v.label,
1448
+ icon: v.icon
1449
+ })), $ = (v) => {
1450
+ var k, L;
1451
+ (L = (k = c.find((I) => I.label === v)) == null ? void 0 : k.onClose) == null || L.call(k), y(!1);
1453
1452
  };
1454
- return /* @__PURE__ */ h(On, { borderRadius: "8px", width: "100%", children: [
1455
- /* @__PURE__ */ o(Un, { ref: m, children: n.map((T) => /* @__PURE__ */ o("div", { "data-filter-tag": "true", children: /* @__PURE__ */ o(
1456
- H,
1453
+ return /* @__PURE__ */ h(Hn, { borderRadius: "8px", width: "100%", children: [
1454
+ /* @__PURE__ */ o(qn, { ref: b, children: n.map((v) => /* @__PURE__ */ o("div", { "data-filter-tag": "true", children: /* @__PURE__ */ o(
1455
+ q,
1457
1456
  {
1458
1457
  appearance: "primary",
1459
1458
  displayIcon: !0,
1460
1459
  removable: !0,
1461
- icon: T.icon,
1462
- label: T.label,
1463
- onClose: T.onClose
1460
+ icon: v.icon,
1461
+ label: v.label,
1462
+ onClose: v.onClose
1464
1463
  }
1465
- ) }, T.label)) }),
1466
- /* @__PURE__ */ h(K, { gap: "12px", templateColumns: "1fr auto auto", width: "100%", children: [
1464
+ ) }, v.label)) }),
1465
+ /* @__PURE__ */ h(X, { gap: "12px", templateColumns: "1fr auto auto", width: "100%", children: [
1467
1466
  /* @__PURE__ */ o(
1468
- j,
1467
+ z,
1469
1468
  {
1470
1469
  ref: l,
1471
1470
  background: !0,
@@ -1476,50 +1475,50 @@ const Ln = x.div`
1476
1475
  alignItems: "center",
1477
1476
  padding: "0px 8px",
1478
1477
  border: !0,
1479
- children: w ? /* @__PURE__ */ o(S, { size: "small", type: "label", appearance: "gray", children: i }) : /* @__PURE__ */ h(k, { children: [
1480
- u.map((T) => /* @__PURE__ */ o(
1481
- H,
1478
+ children: C ? /* @__PURE__ */ o(w, { size: "small", type: "label", appearance: "gray", children: r }) : /* @__PURE__ */ h(E, { children: [
1479
+ p.map((v) => /* @__PURE__ */ o(
1480
+ q,
1482
1481
  {
1483
1482
  "data-filter-tag": "true",
1484
1483
  appearance: "primary",
1485
1484
  displayIcon: !0,
1486
1485
  removable: !0,
1487
- icon: T.icon,
1488
- label: T.label,
1489
- onClose: T.onClose
1486
+ icon: v.icon,
1487
+ label: v.label,
1488
+ onClose: v.onClose
1490
1489
  },
1491
- T.label
1490
+ v.label
1492
1491
  )),
1493
- b && /* @__PURE__ */ h(
1492
+ m && /* @__PURE__ */ h(
1494
1493
  "div",
1495
1494
  {
1496
- ref: c,
1495
+ ref: s,
1497
1496
  style: { position: "relative", display: "inline-block" },
1498
1497
  children: [
1499
- /* @__PURE__ */ o(zn, { onClick: C, children: /* @__PURE__ */ o(
1500
- H,
1498
+ /* @__PURE__ */ o(Pn, { onClick: D, children: /* @__PURE__ */ o(
1499
+ q,
1501
1500
  {
1502
1501
  appearance: "primary",
1503
- label: `+${d.length}`
1502
+ label: `+${c.length}`
1504
1503
  }
1505
1504
  ) }),
1506
- E && /* @__PURE__ */ o(Ln, { ref: s, children: /* @__PURE__ */ o(
1507
- ze,
1505
+ N && /* @__PURE__ */ o(_n, { ref: d, children: /* @__PURE__ */ o(
1506
+ He,
1508
1507
  {
1509
- options: $,
1510
- onOptionClick: A,
1511
- children: d.map((T) => /* @__PURE__ */ o(
1512
- jn,
1508
+ options: A,
1509
+ onOptionClick: $,
1510
+ children: c.map((v) => /* @__PURE__ */ o(
1511
+ Qn,
1513
1512
  {
1514
- id: T.label,
1515
- label: T.label,
1516
- leadingIcon: T.icon,
1513
+ id: v.label,
1514
+ label: v.label,
1515
+ leadingIcon: v.icon,
1517
1516
  onClose: () => {
1518
- var N;
1519
- (N = T.onClose) == null || N.call(T), y(!1);
1517
+ var k;
1518
+ (k = v.onClose) == null || k.call(v), y(!1);
1520
1519
  }
1521
1520
  },
1522
- T.label
1521
+ v.label
1523
1522
  ))
1524
1523
  }
1525
1524
  ) })
@@ -1533,31 +1532,31 @@ const Ln = x.div`
1533
1532
  U,
1534
1533
  {
1535
1534
  cursorHover: !0,
1536
- disabled: w,
1537
- iconBefore: /* @__PURE__ */ o(ve, {}),
1535
+ disabled: C,
1536
+ iconBefore: /* @__PURE__ */ o(Ce, {}),
1538
1537
  onClick: t,
1539
1538
  variant: "outlined",
1540
- children: r
1539
+ children: i
1541
1540
  }
1542
1541
  ),
1543
1542
  /* @__PURE__ */ o(
1544
1543
  U,
1545
1544
  {
1546
1545
  cursorHover: !0,
1547
- iconBefore: /* @__PURE__ */ o(ye, {}),
1546
+ iconBefore: /* @__PURE__ */ o(De, {}),
1548
1547
  onClick: a,
1549
1548
  variant: "outlined",
1550
- children: p
1549
+ children: u
1551
1550
  }
1552
1551
  )
1553
1552
  ] })
1554
1553
  ] });
1555
- }, Bn = x.div`
1554
+ }, Wn = T.div`
1556
1555
  display: flex;
1557
1556
  flex-direction: column;
1558
1557
  background-color: ${({ theme: e }) => {
1559
1558
  var n, t;
1560
- return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N0) || v.palette.neutral.N0;
1559
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N0) || x.palette.neutral.N0;
1561
1560
  }};
1562
1561
  width: ${({ $smallScreen: e }) => e ? "auto" : "450px"};
1563
1562
  height: auto;
@@ -1565,40 +1564,40 @@ const Ln = x.div`
1565
1564
  padding: 24px;
1566
1565
  gap: 24px;
1567
1566
  box-sizing: border-box;
1568
- `, wt = (e) => {
1567
+ `, Ot = (e) => {
1569
1568
  const {
1570
1569
  actionButtonLabel: n,
1571
1570
  cancelButtonLabel: t,
1572
1571
  children: a,
1573
- loading: i,
1574
- onClick: r,
1575
- onCloseModal: p,
1572
+ loading: r,
1573
+ onClick: i,
1574
+ onCloseModal: u,
1576
1575
  portalId: l,
1577
- title: s
1578
- } = e, c = B("(max-width: 768px)"), u = document.getElementById(l);
1579
- if (!u)
1576
+ title: d
1577
+ } = e, s = H("(max-width: 768px)"), p = document.getElementById(l);
1578
+ if (!p)
1580
1579
  throw new Error(
1581
1580
  "The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
1582
1581
  );
1583
- return Se(
1584
- /* @__PURE__ */ o(we, { children: /* @__PURE__ */ h(Bn, { $smallScreen: c, children: [
1582
+ return Ee(
1583
+ /* @__PURE__ */ o(Se, { children: /* @__PURE__ */ h(Wn, { $smallScreen: s, children: [
1585
1584
  /* @__PURE__ */ h(g, { direction: "column", gap: "16px", children: [
1586
1585
  /* @__PURE__ */ h(g, { alignContent: "center", justifyContent: "space-between", children: [
1587
- /* @__PURE__ */ o(S, { appearance: "dark", size: "small", type: "headline", children: s }),
1586
+ /* @__PURE__ */ o(w, { appearance: "dark", size: "small", type: "headline", children: d }),
1588
1587
  /* @__PURE__ */ h(g, { alignItems: "center", children: [
1589
- /* @__PURE__ */ o(S, { children: "Cerrar" }),
1588
+ /* @__PURE__ */ o(w, { children: "Cerrar" }),
1590
1589
  /* @__PURE__ */ o(
1591
- L,
1590
+ R,
1592
1591
  {
1593
1592
  appearance: "dark",
1594
- icon: /* @__PURE__ */ o(xe, {}),
1595
- onClick: p,
1593
+ icon: /* @__PURE__ */ o(ye, {}),
1594
+ onClick: u,
1596
1595
  cursorHover: !0
1597
1596
  }
1598
1597
  )
1599
1598
  ] })
1600
1599
  ] }),
1601
- /* @__PURE__ */ o(R, {})
1600
+ /* @__PURE__ */ o(F, {})
1602
1601
  ] }),
1603
1602
  a,
1604
1603
  /* @__PURE__ */ h(g, { gap: "20px", justifyContent: "flex-end", children: [
@@ -1606,8 +1605,8 @@ const Ln = x.div`
1606
1605
  U,
1607
1606
  {
1608
1607
  appearance: "gray",
1609
- onClick: p,
1610
- iconBefore: /* @__PURE__ */ o(ve, {}),
1608
+ onClick: u,
1609
+ iconBefore: /* @__PURE__ */ o(Ce, {}),
1611
1610
  spacing: "wide",
1612
1611
  variant: "outlined",
1613
1612
  children: t
@@ -1617,8 +1616,8 @@ const Ln = x.div`
1617
1616
  U,
1618
1617
  {
1619
1618
  appearance: "primary",
1620
- loading: i,
1621
- onClick: r,
1619
+ loading: r,
1620
+ onClick: i,
1622
1621
  spacing: "wide",
1623
1622
  variant: "filled",
1624
1623
  children: n
@@ -1626,16 +1625,16 @@ const Ln = x.div`
1626
1625
  )
1627
1626
  ] })
1628
1627
  ] }) }),
1629
- u
1628
+ p
1630
1629
  );
1631
- }, Ct = (e) => {
1632
- const { appliedFilters: n, fields: t, onChange: a, noFiltersLabel: i } = e, r = B("(max-width: 768px)"), p = !n || n.length === 0;
1630
+ }, Mt = (e) => {
1631
+ const { appliedFilters: n, fields: t, onChange: a, noFiltersLabel: r } = e, i = H("(max-width: 768px)"), u = !n || n.length === 0;
1633
1632
  return /* @__PURE__ */ h(g, { direction: "column", gap: "16px", children: [
1634
- r && /* @__PURE__ */ h(k, { children: [
1633
+ i && /* @__PURE__ */ h(E, { children: [
1635
1634
  /* @__PURE__ */ h(g, { gap: "6px", width: "100%", alignItems: "center", children: [
1636
- /* @__PURE__ */ o(L, { appearance: "gray", icon: /* @__PURE__ */ o(ye, {}) }),
1635
+ /* @__PURE__ */ o(R, { appearance: "gray", icon: /* @__PURE__ */ o(De, {}) }),
1637
1636
  /* @__PURE__ */ o(
1638
- j,
1637
+ z,
1639
1638
  {
1640
1639
  background: !0,
1641
1640
  borderRadius: "8px",
@@ -1646,8 +1645,8 @@ const Ln = x.div`
1646
1645
  border: !0,
1647
1646
  width: "100%",
1648
1647
  height: "36px",
1649
- children: p ? /* @__PURE__ */ o(S, { size: "small", type: "label", appearance: "gray", children: i }) : n == null ? void 0 : n.map((l) => /* @__PURE__ */ o(
1650
- H,
1648
+ children: u ? /* @__PURE__ */ o(w, { size: "small", type: "label", appearance: "gray", children: r }) : n == null ? void 0 : n.map((l) => /* @__PURE__ */ o(
1649
+ q,
1651
1650
  {
1652
1651
  appearance: "primary",
1653
1652
  displayIcon: !0,
@@ -1661,12 +1660,12 @@ const Ln = x.div`
1661
1660
  }
1662
1661
  )
1663
1662
  ] }),
1664
- /* @__PURE__ */ o(R, { dashed: !0 })
1663
+ /* @__PURE__ */ o(F, { dashed: !0 })
1665
1664
  ] }),
1666
1665
  t.map((l) => /* @__PURE__ */ h(g, { gap: "6px", alignItems: "center", children: [
1667
- /* @__PURE__ */ o(g, { padding: "22px 0 0 0", children: /* @__PURE__ */ o(L, { appearance: "primary", icon: l.icon }) }),
1666
+ /* @__PURE__ */ o(g, { padding: "22px 0 0 0", children: /* @__PURE__ */ o(R, { appearance: "primary", icon: l.icon }) }),
1668
1667
  /* @__PURE__ */ o(
1669
- Ve,
1668
+ je,
1670
1669
  {
1671
1670
  disabled: l.disabled,
1672
1671
  invalid: l.invalid,
@@ -1684,40 +1683,40 @@ const Ln = x.div`
1684
1683
  )
1685
1684
  ] }, l.name))
1686
1685
  ] });
1687
- }, _n = (e) => {
1686
+ }, Kn = (e) => {
1688
1687
  const n = [];
1689
1688
  return e.from !== void 0 && e.from !== null && n.push(`>${e.from}`), e.to !== void 0 && e.to !== null && n.push(`<${e.to}`), n.join(";");
1690
- }, Dt = (e) => {
1691
- var p;
1692
- const { decision: n, fallbackId: t, template: a } = e, i = (l) => typeof l == "object" && l !== null && "from" in l && "to" in l ? _n(l) : l, r = ((p = n.conditionsThatEstablishesTheDecision) == null ? void 0 : p.map((l, s) => {
1693
- var d;
1694
- const c = l == null ? void 0 : l.value;
1695
- return c == null || typeof c == "string" && c.trim() === "" || Array.isArray(c) && c.length === 0 ? null : {
1696
- ...(d = a.conditionsThatEstablishesTheDecision) == null ? void 0 : d[s],
1689
+ }, Lt = (e) => {
1690
+ var u;
1691
+ const { decision: n, fallbackId: t, template: a } = e, r = (l) => typeof l == "object" && l !== null && "from" in l && "to" in l ? Kn(l) : l, i = ((u = n.conditionsThatEstablishesTheDecision) == null ? void 0 : u.map((l, d) => {
1692
+ var c;
1693
+ const s = l == null ? void 0 : l.value;
1694
+ return s == null || typeof s == "string" && s.trim() === "" || Array.isArray(s) && s.length === 0 ? null : {
1695
+ ...(c = a.conditionsThatEstablishesTheDecision) == null ? void 0 : c[d],
1697
1696
  ...l,
1698
- value: i(c)
1697
+ value: r(s)
1699
1698
  };
1700
1699
  }).filter(Boolean)) ?? [];
1701
1700
  return {
1702
1701
  ...a,
1703
1702
  ...n,
1704
1703
  decisionId: t,
1705
- value: i(n.value),
1706
- conditionsThatEstablishesTheDecision: r
1704
+ value: r(n.value),
1705
+ conditionsThatEstablishesTheDecision: i
1707
1706
  };
1708
- }, St = (e) => {
1707
+ }, zt = (e) => {
1709
1708
  if (typeof e != "string") return e;
1710
1709
  const n = e.split(";").map((a) => a.trim()), t = {};
1711
1710
  for (const a of n)
1712
1711
  if (a.startsWith(">")) {
1713
- const i = parseFloat(a.slice(1));
1714
- isNaN(i) || (t.from = i);
1712
+ const r = parseFloat(a.slice(1));
1713
+ isNaN(r) || (t.from = r);
1715
1714
  } else if (a.startsWith("<")) {
1716
- const i = parseFloat(a.slice(1));
1717
- isNaN(i) || (t.to = i);
1715
+ const r = parseFloat(a.slice(1));
1716
+ isNaN(r) || (t.to = r);
1718
1717
  }
1719
1718
  return t.from !== void 0 || t.to !== void 0 ? t : e;
1720
- }, Nt = (e) => {
1719
+ }, Ut = (e) => {
1721
1720
  const { dataDecision: n, originalDecision: t } = e, a = {
1722
1721
  conditionName: n.ruleName || "",
1723
1722
  labelName: n.labelName || "",
@@ -1730,15 +1729,15 @@ const Ln = x.div`
1730
1729
  return {
1731
1730
  ...t,
1732
1731
  conditionsThatEstablishesTheDecision: t.conditionsThatEstablishesTheDecision.map(
1733
- (i) => i.hidden ? { ...a } : i
1732
+ (r) => r.hidden ? { ...a } : r
1734
1733
  )
1735
1734
  };
1736
- }, Et = (e) => {
1735
+ }, Vt = (e) => {
1737
1736
  const { decisions: n } = e;
1738
1737
  return n == null ? void 0 : n.map((t) => {
1739
- var i;
1740
- const a = (i = t.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
1741
- (r) => r.hidden
1738
+ var r;
1739
+ const a = (r = t.conditionsThatEstablishesTheDecision) == null ? void 0 : r.find(
1740
+ (i) => i.hidden
1742
1741
  );
1743
1742
  return a ? {
1744
1743
  ...t,
@@ -1748,19 +1747,19 @@ const Ln = x.div`
1748
1747
  value: t.value,
1749
1748
  howToSetTheDecision: t.howToSetTheDecision,
1750
1749
  conditionsThatEstablishesTheDecision: t.conditionsThatEstablishesTheDecision.map(
1751
- (r) => r.hidden ? { ...a, hidden: !1 } : r
1750
+ (i) => i.hidden ? { ...a, hidden: !1 } : i
1752
1751
  )
1753
1752
  } : t;
1754
1753
  });
1755
- }, Hn = (e) => ({
1754
+ }, Yn = (e) => ({
1756
1755
  schema: ie().required("Required").test(
1757
1756
  "non-empty",
1758
1757
  "Value cannot be empty",
1759
1758
  (n) => n != null && n.trim() !== ""
1760
1759
  ),
1761
1760
  value: e
1762
- }), qn = (e) => ({
1763
- schema: Ne().test(
1761
+ }), Jn = (e) => ({
1762
+ schema: $e().test(
1764
1763
  "isArrayOrString",
1765
1764
  "Must be an array of strings/numbers or a single string",
1766
1765
  (n) => Array.isArray(n) ? n.every(
@@ -1768,8 +1767,8 @@ const Ln = x.div`
1768
1767
  ) : typeof n == "string"
1769
1768
  ),
1770
1769
  value: e
1771
- }), Pn = (e) => ({
1772
- schema: Ne().test(
1770
+ }), Xn = (e) => ({
1771
+ schema: $e().test(
1773
1772
  "isArrayOrString",
1774
1773
  "Must be an array of strings/numbers or a single string",
1775
1774
  (n) => Array.isArray(n) ? n.every(
@@ -1777,44 +1776,44 @@ const Ln = x.div`
1777
1776
  ) : typeof n == "string"
1778
1777
  ),
1779
1778
  value: e
1780
- }), Gn = (e) => {
1779
+ }), Zn = (e) => {
1781
1780
  const n = (e == null ? void 0 : e.from) ?? 0, t = (e == null ? void 0 : e.to) ?? 0;
1782
1781
  return {
1783
- schema: W({
1784
- from: ee().required("Range From is required").max(t, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
1785
- to: ee().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
1782
+ schema: Y({
1783
+ from: ne().required("Range From is required").max(t, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
1784
+ to: ne().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
1786
1785
  "is-greater",
1787
1786
  "To value must be greater than From value",
1788
1787
  function(a) {
1789
- const { from: i } = this.parent;
1790
- return a > i;
1788
+ const { from: r } = this.parent;
1789
+ return a > r;
1791
1790
  }
1792
1791
  )
1793
1792
  }),
1794
1793
  value: { from: n, to: t }
1795
1794
  };
1796
- }, Z = (e, n) => n === I.PERCENTAGE ? {
1797
- schema: ee().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
1795
+ }, ee = (e, n) => n === O.PERCENTAGE ? {
1796
+ schema: ne().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
1798
1797
  value: e
1799
1798
  } : {
1800
1799
  schema: ie().required("Required"),
1801
1800
  value: e
1802
- }, Qn = {
1803
- [D.LIST_OF_VALUES]: qn,
1804
- [D.LIST_OF_VALUES_MULTI]: Pn,
1805
- [D.RANGE]: Gn,
1806
- [D.GREATER_THAN]: Z,
1807
- [D.LESS_THAN]: Z,
1808
- [D.EQUAL]: Z
1809
- }, me = (e) => Qn[e] || Hn;
1810
- function Wn({
1801
+ }, et = {
1802
+ [S.LIST_OF_VALUES]: Jn,
1803
+ [S.LIST_OF_VALUES_MULTI]: Xn,
1804
+ [S.RANGE]: Zn,
1805
+ [S.GREATER_THAN]: ee,
1806
+ [S.LESS_THAN]: ee,
1807
+ [S.EQUAL]: ee
1808
+ }, fe = (e) => et[e] || Yn;
1809
+ function nt({
1811
1810
  decision: e,
1812
1811
  onSubmitEvent: n,
1813
1812
  textValues: t
1814
1813
  }) {
1815
1814
  const a = {
1816
1815
  ruleName: e.ruleName || "",
1817
- decisionDataType: e.decisionDataType || I.ALPHABETICAL,
1816
+ decisionDataType: e.decisionDataType || O.ALPHABETICAL,
1818
1817
  howToSetTheDecision: e.howToSetTheDecision || "",
1819
1818
  value: e.value || "",
1820
1819
  effectiveFrom: e.effectiveFrom || "",
@@ -1824,108 +1823,108 @@ function Wn({
1824
1823
  checkClosed: !1,
1825
1824
  terms: !0
1826
1825
  };
1827
- let i;
1828
- const r = {
1826
+ let r;
1827
+ const i = {
1829
1828
  ruleName: ie().required("Name is required"),
1830
- value: ue(() => me(
1831
- i.values.howToSetTheDecision
1829
+ value: he(() => fe(
1830
+ r.values.howToSetTheDecision
1832
1831
  )(
1833
- i.values.value,
1834
- i.values.decisionDataType
1832
+ r.values.value,
1833
+ r.values.decisionDataType
1835
1834
  ).schema),
1836
- conditionsThatEstablishesTheDecision: ue((s, { parent: c }) => {
1837
- var b;
1838
- if ((c == null ? void 0 : c.toggleNone) && Object.keys(c.conditionsThatEstablishesTheDecision || {}).length > 0) return W().shape({});
1839
- const d = (b = e.conditionsThatEstablishesTheDecision) == null ? void 0 : b.reduce(
1840
- (m, f) => {
1841
- if (i.values.conditionsThatEstablishesTheDecision[f.conditionName] !== void 0) {
1842
- const C = me(
1835
+ conditionsThatEstablishesTheDecision: he((d, { parent: s }) => {
1836
+ var m;
1837
+ if ((s == null ? void 0 : s.toggleNone) && Object.keys(s.conditionsThatEstablishesTheDecision || {}).length > 0) return Y().shape({});
1838
+ const c = (m = e.conditionsThatEstablishesTheDecision) == null ? void 0 : m.reduce(
1839
+ (b, f) => {
1840
+ if (r.values.conditionsThatEstablishesTheDecision[f.conditionName] !== void 0) {
1841
+ const D = fe(
1843
1842
  f.howToSetTheCondition
1844
1843
  );
1845
- m[f.conditionName] = C(
1844
+ b[f.conditionName] = D(
1846
1845
  f.value,
1847
1846
  f.conditionDataType
1848
1847
  ).schema;
1849
1848
  }
1850
- return m;
1849
+ return b;
1851
1850
  },
1852
1851
  {}
1853
1852
  );
1854
- return W(d).test(
1853
+ return Y(c).test(
1855
1854
  "at-least-one-condition",
1856
1855
  "It must be at least one condition in order for the decision to be validated correctly.",
1857
- (m) => m ? Object.values(m).some(
1856
+ (b) => b ? Object.values(b).some(
1858
1857
  (f) => f != null && f !== ""
1859
1858
  ) : !1
1860
1859
  );
1861
1860
  })
1862
1861
  };
1863
- t.terms && (r.effectiveFrom = pe().required(
1862
+ t.terms && (i.effectiveFrom = ge().required(
1864
1863
  "effective From date is required"
1865
- ), r.validUntil = pe().when(
1864
+ ), i.validUntil = ge().when(
1866
1865
  "checkClosed",
1867
- (s, c, { parent: u }) => (u == null ? void 0 : u.checkClosed) ? c.required("valid Until date is required").test(
1866
+ (d, s, { parent: p }) => (p == null ? void 0 : p.checkClosed) ? s.required("valid Until date is required").test(
1868
1867
  "is-after-startDate",
1869
1868
  "valid Until date must be greater than or equal to Start date",
1870
- function(b) {
1871
- const m = this.parent.effectiveFrom;
1872
- return !m || !b ? !0 : new Date(b) >= new Date(m);
1869
+ function(m) {
1870
+ const b = this.parent.effectiveFrom;
1871
+ return !b || !m ? !0 : new Date(m) >= new Date(b);
1873
1872
  }
1874
- ) : c.notRequired()
1873
+ ) : s.notRequired()
1875
1874
  ));
1876
- const p = W(r);
1877
- return i = qe({
1875
+ const u = Y(i);
1876
+ return r = Ge({
1878
1877
  initialValues: a,
1879
- validationSchema: p,
1878
+ validationSchema: u,
1880
1879
  validateOnBlur: !0,
1881
- onSubmit: (s) => {
1882
- var u;
1883
- const c = {
1880
+ onSubmit: (d) => {
1881
+ var p;
1882
+ const s = {
1884
1883
  ...e,
1885
- ruleName: s.ruleName,
1886
- decisionDataType: s.decisionDataType,
1887
- howToSetTheDecision: s.howToSetTheDecision,
1888
- value: s.value,
1889
- effectiveFrom: s.effectiveFrom,
1890
- validUntil: s.validUntil,
1891
- conditionsThatEstablishesTheDecision: (u = e.conditionsThatEstablishesTheDecision) == null ? void 0 : u.filter((d) => {
1892
- const b = s.conditionsThatEstablishesTheDecision[d.conditionName];
1893
- return b != null && b !== "";
1894
- }).map((d) => ({
1895
- ...d,
1896
- value: s.conditionsThatEstablishesTheDecision[d.conditionName]
1884
+ ruleName: d.ruleName,
1885
+ decisionDataType: d.decisionDataType,
1886
+ howToSetTheDecision: d.howToSetTheDecision,
1887
+ value: d.value,
1888
+ effectiveFrom: d.effectiveFrom,
1889
+ validUntil: d.validUntil,
1890
+ conditionsThatEstablishesTheDecision: (p = e.conditionsThatEstablishesTheDecision) == null ? void 0 : p.filter((c) => {
1891
+ const m = d.conditionsThatEstablishesTheDecision[c.conditionName];
1892
+ return m != null && m !== "";
1893
+ }).map((c) => ({
1894
+ ...c,
1895
+ value: d.conditionsThatEstablishesTheDecision[c.conditionName]
1897
1896
  }))
1898
1897
  };
1899
- n(c);
1898
+ n(s);
1900
1899
  }
1901
- }), { formik: i, handleToggleNoneChange: (s) => {
1902
- var c;
1903
- i.setFieldValue("toggleNone", s), (c = e.conditionsThatEstablishesTheDecision) == null || c.forEach((u) => {
1904
- if (s)
1905
- i.setFieldValue(
1906
- `conditionsThatEstablishesTheDecision.${u.conditionName}`,
1900
+ }), { formik: r, handleToggleNoneChange: (d) => {
1901
+ var s;
1902
+ r.setFieldValue("toggleNone", d), (s = e.conditionsThatEstablishesTheDecision) == null || s.forEach((p) => {
1903
+ if (d)
1904
+ r.setFieldValue(
1905
+ `conditionsThatEstablishesTheDecision.${p.conditionName}`,
1907
1906
  void 0
1908
1907
  );
1909
1908
  else {
1910
- const d = u.howToSetTheCondition === D.LIST_OF_VALUES_MULTI ? [] : "";
1911
- i.setFieldValue(
1912
- `conditionsThatEstablishesTheDecision.${u.conditionName}`,
1913
- d
1909
+ const c = p.howToSetTheCondition === S.LIST_OF_VALUES_MULTI ? [] : "";
1910
+ r.setFieldValue(
1911
+ `conditionsThatEstablishesTheDecision.${p.conditionName}`,
1912
+ c
1914
1913
  );
1915
1914
  }
1916
1915
  });
1917
1916
  } };
1918
1917
  }
1919
- const Yn = x.div`
1918
+ const tt = T.div`
1920
1919
  & > div {
1921
1920
  border-radius: 8px;
1922
1921
  border: 1px solid
1923
1922
  ${({ theme: e }) => {
1924
1923
  var n, t;
1925
- return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
1924
+ return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || x.palette.neutral.N30;
1926
1925
  }};
1927
1926
  }
1928
- `, Kn = x.div`
1927
+ `, at = T.div`
1929
1928
  width: 100%;
1930
1929
  height: 100%;
1931
1930
  overflow-y: auto;
@@ -1942,61 +1941,61 @@ const Yn = x.div`
1942
1941
  background-color: #ebecf0;
1943
1942
  border-radius: 8px;
1944
1943
  }
1945
- `, Jn = (e) => {
1944
+ `, ot = (e) => {
1946
1945
  const {
1947
1946
  checked: n,
1948
1947
  children: t,
1949
1948
  handleToggleChange: a,
1950
- id: i,
1951
- labelToggle: r,
1952
- name: p,
1949
+ id: r,
1950
+ labelToggle: i,
1951
+ name: u,
1953
1952
  valueToggle: l = ""
1954
- } = e, [s, c] = O(n), u = (d) => {
1955
- c(d.target.checked), a(d);
1953
+ } = e, [d, s] = M(n), p = (c) => {
1954
+ s(c.target.checked), a(c);
1956
1955
  };
1957
- return oe(() => {
1958
- c(n);
1959
- }, [n]), /* @__PURE__ */ h(k, { children: [
1956
+ return re(() => {
1957
+ s(n);
1958
+ }, [n]), /* @__PURE__ */ h(E, { children: [
1960
1959
  /* @__PURE__ */ o(g, { children: /* @__PURE__ */ o(
1961
- Ce,
1960
+ ke,
1962
1961
  {
1963
- checked: s,
1964
- id: i,
1965
- name: p,
1966
- onChange: u,
1962
+ checked: d,
1963
+ id: r,
1964
+ name: u,
1965
+ onChange: p,
1967
1966
  size: "small",
1968
1967
  value: l,
1969
- children: /* @__PURE__ */ o(S, { size: "medium", type: "label", weight: "bold", children: r })
1968
+ children: /* @__PURE__ */ o(w, { size: "medium", type: "label", weight: "bold", children: i })
1970
1969
  }
1971
1970
  ) }),
1972
- s && /* @__PURE__ */ o(k, { children: t })
1971
+ d && /* @__PURE__ */ o(E, { children: t })
1973
1972
  ] });
1974
- }, Xn = (e) => {
1973
+ }, rt = (e) => {
1975
1974
  const {
1976
1975
  onHandleStartChange: n,
1977
1976
  onHandleEndChange: t,
1978
1977
  onCheckClosedChange: a,
1979
- labelStart: i,
1980
- labelEnd: r,
1981
- checkedClosed: p = !1,
1978
+ labelStart: r,
1979
+ labelEnd: i,
1980
+ checkedClosed: u = !1,
1982
1981
  required: l = !1,
1983
- valueStart: s = "",
1984
- valueEnd: c = "",
1985
- messageStart: u = "",
1986
- messageEnd: d = "",
1987
- statusStart: b = "pending",
1988
- statusEnd: m = "pending"
1989
- } = e, [f, y] = O(p), [C, w] = O(s), [E, $] = O(c), A = ({ target: F }) => {
1990
- y(F.checked), a && a(F.checked);
1991
- }, T = (F) => {
1992
- w(F.target.value), n(F);
1993
- }, N = (F) => {
1994
- $(F.target.value), t(F);
1995
- }, M = B("(max-width: 400px)");
1996
- return /* @__PURE__ */ h(k, { children: [
1982
+ valueStart: d = "",
1983
+ valueEnd: s = "",
1984
+ messageStart: p = "",
1985
+ messageEnd: c = "",
1986
+ statusStart: m = "pending",
1987
+ statusEnd: b = "pending"
1988
+ } = e, [f, y] = M(u), [D, C] = M(d), [N, A] = M(s), $ = ({ target: I }) => {
1989
+ y(I.checked), a && a(I.checked);
1990
+ }, v = (I) => {
1991
+ C(I.target.value), n(I);
1992
+ }, k = (I) => {
1993
+ A(I.target.value), t(I);
1994
+ }, L = H("(max-width: 400px)");
1995
+ return /* @__PURE__ */ h(E, { children: [
1997
1996
  /* @__PURE__ */ h(g, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
1998
1997
  /* @__PURE__ */ o(
1999
- S,
1998
+ w,
2000
1999
  {
2001
2000
  appearance: "gray",
2002
2001
  margin: "10px 0",
@@ -2014,10 +2013,10 @@ const Yn = x.div`
2014
2013
  wrap: "wrap",
2015
2014
  gap: "4px",
2016
2015
  children: /* @__PURE__ */ o(
2017
- je,
2016
+ _e,
2018
2017
  {
2019
2018
  label: "Cerrada",
2020
- onChange: A,
2019
+ onChange: $,
2021
2020
  checked: f,
2022
2021
  value: ""
2023
2022
  }
@@ -2028,61 +2027,61 @@ const Yn = x.div`
2028
2027
  /* @__PURE__ */ h(
2029
2028
  g,
2030
2029
  {
2031
- direction: M ? "column" : "row",
2030
+ direction: L ? "column" : "row",
2032
2031
  justifyContent: "space-between",
2033
2032
  gap: "24px",
2034
2033
  children: [
2035
2034
  /* @__PURE__ */ o(
2036
- de,
2035
+ ue,
2037
2036
  {
2038
2037
  id: "dateStart",
2039
- label: i,
2040
- onChange: T,
2041
- value: C,
2038
+ label: r,
2039
+ onChange: v,
2040
+ value: D,
2042
2041
  required: l,
2043
2042
  size: "compact",
2044
- status: b,
2045
- message: u
2043
+ status: m,
2044
+ message: p
2046
2045
  }
2047
2046
  ),
2048
2047
  f && /* @__PURE__ */ o(
2049
- de,
2048
+ ue,
2050
2049
  {
2051
2050
  id: "dateEnd",
2052
- label: r,
2053
- onChange: N,
2054
- value: E,
2051
+ label: i,
2052
+ onChange: k,
2053
+ value: N,
2055
2054
  required: l,
2056
2055
  size: "compact",
2057
- status: m,
2058
- message: d
2056
+ status: b,
2057
+ message: c
2059
2058
  }
2060
2059
  )
2061
2060
  ]
2062
2061
  }
2063
2062
  )
2064
2063
  ] });
2065
- }, Zn = (e) => {
2064
+ }, it = (e) => {
2066
2065
  const {
2067
2066
  formik: n,
2068
2067
  textValues: t,
2069
2068
  onCancel: a,
2070
- visibleConditions: i,
2071
- normalizedDecision: r,
2072
- handleToggleNoneChange: p,
2069
+ visibleConditions: r,
2070
+ normalizedDecision: i,
2071
+ handleToggleNoneChange: u,
2073
2072
  handleConditionToggleChange: l,
2074
- showConditionsError: s,
2075
- termStartStatus: c,
2076
- termEndStatus: u
2073
+ showConditionsError: d,
2074
+ termStartStatus: s,
2075
+ termEndStatus: p
2077
2076
  } = e;
2078
2077
  return /* @__PURE__ */ o("form", { onSubmit: n.handleSubmit, children: /* @__PURE__ */ h(g, { direction: "column", gap: "24px", children: [
2079
- ce({
2080
- condition: r,
2078
+ pe({
2079
+ condition: i,
2081
2080
  formik: n,
2082
2081
  isDecision: !0
2083
2082
  }),
2084
- /* @__PURE__ */ o(R, { dashed: !0 }),
2085
- /* @__PURE__ */ o(Yn, { children: /* @__PURE__ */ o(Kn, { children: /* @__PURE__ */ h(
2083
+ /* @__PURE__ */ o(F, { dashed: !0 }),
2084
+ /* @__PURE__ */ o(tt, { children: /* @__PURE__ */ o(at, { children: /* @__PURE__ */ h(
2086
2085
  g,
2087
2086
  {
2088
2087
  direction: "column",
@@ -2097,42 +2096,42 @@ const Yn = x.div`
2097
2096
  alignItems: "center",
2098
2097
  gap: "64px",
2099
2098
  children: [
2100
- /* @__PURE__ */ o(S, { type: "title", size: "small", weight: "bold", appearance: "gray", children: t.factsThatConditionIt }),
2099
+ /* @__PURE__ */ o(w, { type: "title", size: "small", weight: "bold", appearance: "gray", children: t.factsThatConditionIt }),
2101
2100
  /* @__PURE__ */ o(
2102
- Ce,
2101
+ ke,
2103
2102
  {
2104
2103
  id: "toggleNone",
2105
- onChange: () => p(!n.values.toggleNone),
2104
+ onChange: () => u(!n.values.toggleNone),
2106
2105
  checked: n.values.toggleNone,
2107
2106
  size: "small",
2108
- children: /* @__PURE__ */ o(S, { as: "span", size: "medium", type: "label", weight: "bold", children: t.none })
2107
+ children: /* @__PURE__ */ o(w, { as: "span", size: "medium", type: "label", weight: "bold", children: t.none })
2109
2108
  }
2110
2109
  )
2111
2110
  ]
2112
2111
  }
2113
2112
  ),
2114
- /* @__PURE__ */ o(g, { direction: "column", gap: "20px", children: i == null ? void 0 : i.map((d) => /* @__PURE__ */ o(
2115
- Jn,
2113
+ /* @__PURE__ */ o(g, { direction: "column", gap: "20px", children: r == null ? void 0 : r.map((c) => /* @__PURE__ */ o(
2114
+ ot,
2116
2115
  {
2117
- id: `toggle-${d.conditionName}`,
2118
- name: `toggle.${d.conditionName}`,
2119
- labelToggle: d.labelName,
2120
- checked: !n.values.toggleNone && n.values.conditionsThatEstablishesTheDecision[d.conditionName] !== void 0,
2121
- handleToggleChange: (b) => l(
2122
- d.conditionName,
2123
- d.howToSetTheCondition === D.LIST_OF_VALUES_MULTI
2124
- )(b.target.checked),
2125
- children: ce({ condition: d, formik: n })
2116
+ id: `toggle-${c.conditionName}`,
2117
+ name: `toggle.${c.conditionName}`,
2118
+ labelToggle: c.labelName,
2119
+ checked: !n.values.toggleNone && n.values.conditionsThatEstablishesTheDecision[c.conditionName] !== void 0,
2120
+ handleToggleChange: (m) => l(
2121
+ c.conditionName,
2122
+ c.howToSetTheCondition === S.LIST_OF_VALUES_MULTI
2123
+ )(m.target.checked),
2124
+ children: pe({ condition: c, formik: n })
2126
2125
  },
2127
- d.conditionName
2126
+ c.conditionName
2128
2127
  )) })
2129
2128
  ]
2130
2129
  }
2131
2130
  ) }) }),
2132
- t.terms && /* @__PURE__ */ h(k, { children: [
2133
- /* @__PURE__ */ o(R, { dashed: !0 }),
2131
+ t.terms && /* @__PURE__ */ h(E, { children: [
2132
+ /* @__PURE__ */ o(F, { dashed: !0 }),
2134
2133
  /* @__PURE__ */ o(
2135
- Xn,
2134
+ rt,
2136
2135
  {
2137
2136
  labelStart: t.termStart,
2138
2137
  labelEnd: t.termEnd,
@@ -2140,27 +2139,27 @@ const Yn = x.div`
2140
2139
  valueEnd: n.values.validUntil,
2141
2140
  messageStart: n.errors.effectiveFrom,
2142
2141
  messageEnd: n.errors.validUntil,
2143
- statusStart: c,
2144
- statusEnd: u,
2145
- onHandleStartChange: (d) => n.setFieldValue("effectiveFrom", d.target.value),
2146
- onHandleEndChange: (d) => n.setFieldValue("validUntil", d.target.value),
2147
- onCheckClosedChange: (d) => {
2148
- n.setFieldValue("checkClosed", d), d && n.setFieldValue("validUntil", "");
2142
+ statusStart: s,
2143
+ statusEnd: p,
2144
+ onHandleStartChange: (c) => n.setFieldValue("effectiveFrom", c.target.value),
2145
+ onHandleEndChange: (c) => n.setFieldValue("validUntil", c.target.value),
2146
+ onCheckClosedChange: (c) => {
2147
+ n.setFieldValue("checkClosed", c), c && n.setFieldValue("validUntil", "");
2149
2148
  },
2150
2149
  checkedClosed: n.values.checkClosed
2151
2150
  }
2152
2151
  )
2153
2152
  ] }),
2154
- /* @__PURE__ */ o(R, {}),
2155
- s && /* @__PURE__ */ o(S, { type: "label", size: "medium", appearance: "danger", children: String(n.errors.conditionsThatEstablishesTheDecision) }),
2153
+ /* @__PURE__ */ o(F, {}),
2154
+ d && /* @__PURE__ */ o(w, { type: "label", size: "medium", appearance: "danger", children: String(n.errors.conditionsThatEstablishesTheDecision) }),
2156
2155
  /* @__PURE__ */ h(g, { direction: "row", justifyContent: "end", gap: "16px", children: [
2157
2156
  /* @__PURE__ */ o(U, { appearance: "gray", onClick: a, children: t.cancel }),
2158
2157
  /* @__PURE__ */ o(U, { type: "submit", children: t.confirm })
2159
2158
  ] })
2160
2159
  ] }) });
2161
- }, Ie = (e) => {
2162
- var m;
2163
- const { decision: n, onSubmitEvent: t, textValues: a, onCancel: i } = e, { formik: r, handleToggleNoneChange: p } = Wn({
2160
+ }, Oe = (e) => {
2161
+ var b;
2162
+ const { decision: n, onSubmitEvent: t, textValues: a, onCancel: r } = e, { formik: i, handleToggleNoneChange: u } = nt({
2164
2163
  decision: n,
2165
2164
  onSubmitEvent: t,
2166
2165
  textValues: a
@@ -2170,46 +2169,46 @@ const Yn = x.div`
2170
2169
  howToSetTheCondition: n.howToSetTheDecision,
2171
2170
  decisionDataType: n.decisionDataType,
2172
2171
  listOfPossibleValues: n.listOfPossibleValues
2173
- }, s = ((m = n.conditionsThatEstablishesTheDecision) == null ? void 0 : m.filter(
2172
+ }, d = ((b = n.conditionsThatEstablishesTheDecision) == null ? void 0 : b.filter(
2174
2173
  (f) => !f.hidden
2175
- )) || [], c = !!r.errors.conditionsThatEstablishesTheDecision && r.submitCount > 0, u = r.touched.effectiveFrom ? r.errors.effectiveFrom ? "invalid" : "valid" : void 0, d = r.touched.validUntil ? r.errors.validUntil ? "invalid" : "valid" : void 0;
2174
+ )) || [], s = !!i.errors.conditionsThatEstablishesTheDecision && i.submitCount > 0, p = i.touched.effectiveFrom ? i.errors.effectiveFrom ? "invalid" : "valid" : void 0, c = i.touched.validUntil ? i.errors.validUntil ? "invalid" : "valid" : void 0;
2176
2175
  return /* @__PURE__ */ o(
2177
- Zn,
2176
+ it,
2178
2177
  {
2179
- formik: r,
2180
- onCancel: i,
2178
+ formik: i,
2179
+ onCancel: r,
2181
2180
  textValues: a,
2182
2181
  decision: n,
2183
- visibleConditions: s,
2182
+ visibleConditions: d,
2184
2183
  normalizedDecision: l,
2185
- handleToggleNoneChange: p,
2186
- handleConditionToggleChange: (f, y) => (C) => {
2187
- if (!C)
2188
- r.setFieldValue(
2184
+ handleToggleNoneChange: u,
2185
+ handleConditionToggleChange: (f, y) => (D) => {
2186
+ if (!D)
2187
+ i.setFieldValue(
2189
2188
  `conditionsThatEstablishesTheDecision.${f}`,
2190
2189
  void 0
2191
- ), r.setFieldTouched(
2190
+ ), i.setFieldTouched(
2192
2191
  `conditionsThatEstablishesTheDecision.${f}`,
2193
2192
  !1,
2194
2193
  !1
2195
2194
  );
2196
2195
  else {
2197
- const w = y ? [] : "";
2198
- r.setFieldValue(
2196
+ const C = y ? [] : "";
2197
+ i.setFieldValue(
2199
2198
  `conditionsThatEstablishesTheDecision.${f}`,
2200
- w
2199
+ C
2201
2200
  );
2202
2201
  }
2203
2202
  },
2204
- showConditionsError: c,
2205
- termStartStatus: u,
2206
- termEndStatus: d
2203
+ showConditionsError: s,
2204
+ termStartStatus: p,
2205
+ termEndStatus: c
2207
2206
  }
2208
2207
  );
2209
- }, kt = (e) => {
2210
- var i;
2211
- const { decisionTemplate: n } = e, t = { ...n }, a = (i = t.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
2212
- (r) => r.switchPlaces
2208
+ }, Bt = (e) => {
2209
+ var r;
2210
+ const { decisionTemplate: n } = e, t = { ...n }, a = (r = t.conditionsThatEstablishesTheDecision) == null ? void 0 : r.find(
2211
+ (i) => i.switchPlaces
2213
2212
  );
2214
2213
  return a ? {
2215
2214
  ...t,
@@ -2219,15 +2218,15 @@ const Yn = x.div`
2219
2218
  value: a.value,
2220
2219
  howToSetTheDecision: a.howToSetTheCondition,
2221
2220
  conditionsThatEstablishesTheDecision: t.conditionsThatEstablishesTheDecision.map(
2222
- (r) => r.conditionName === a.conditionName ? { ...r, hidden: !0 } : r
2221
+ (i) => i.conditionName === a.conditionName ? { ...i, hidden: !0 } : i
2223
2222
  )
2224
2223
  } : t;
2225
- }, At = (e) => {
2224
+ }, Ht = (e) => {
2226
2225
  const { decisions: n } = e;
2227
2226
  return n == null ? void 0 : n.map((t) => {
2228
- var i;
2229
- const a = (i = t.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
2230
- (r) => r.switchPlaces
2227
+ var r;
2228
+ const a = (r = t.conditionsThatEstablishesTheDecision) == null ? void 0 : r.find(
2229
+ (i) => i.switchPlaces
2231
2230
  );
2232
2231
  return a ? {
2233
2232
  ...t,
@@ -2237,21 +2236,183 @@ const Yn = x.div`
2237
2236
  value: a.value,
2238
2237
  howToSetTheDecision: a.howToSetTheCondition,
2239
2238
  conditionsThatEstablishesTheDecision: t.conditionsThatEstablishesTheDecision.map(
2240
- (r) => r.conditionName === a.conditionName ? { ...r, hidden: !0 } : r
2239
+ (i) => i.conditionName === a.conditionName ? { ...i, hidden: !0 } : i
2241
2240
  )
2242
2241
  } : t;
2243
2242
  });
2244
- }, _ = /* @__PURE__ */ new Map(), et = (e, n) => _.get(`${n}:${e}`), nt = (e, n, t) => {
2243
+ }, j = {
2244
+ item: {
2245
+ background: {
2246
+ active: x.palette.blue.B50,
2247
+ inactive: x.palette.neutral.N0,
2248
+ hover: x.palette.neutral.N20,
2249
+ disabled: x.palette.neutral.N20
2250
+ }
2251
+ },
2252
+ border: {
2253
+ expanded: {
2254
+ color: x.palette.blue.B400
2255
+ },
2256
+ contracted: {
2257
+ color: x.palette.neutral.N0
2258
+ }
2259
+ }
2260
+ }, lt = T.div`
2261
+ & > div {
2262
+ border: 1px solid
2263
+ ${({ theme: e, $active: n }) => {
2264
+ var t, a, r, i;
2265
+ return n ? ((a = (t = e == null ? void 0 : e.border) == null ? void 0 : t.expanded) == null ? void 0 : a.color) || j.border.expanded.color : ((i = (r = e == null ? void 0 : e.border) == null ? void 0 : r.contracted) == null ? void 0 : i.color) || j.border.contracted.color;
2266
+ }};
2267
+ }
2268
+ &:hover {
2269
+ cursor: ${({ $disabled: e }) => e ? "not-allowed" : "pointer"};
2270
+ background-color: ${({ theme: e, $disabled: n }) => {
2271
+ var t, a, r;
2272
+ if (!n)
2273
+ return ((r = (a = (t = e == null ? void 0 : e.menu) == null ? void 0 : t.item) == null ? void 0 : a.background) == null ? void 0 : r.hover) || j.item.background.hover;
2274
+ }};
2275
+ }
2276
+ `, dt = T.div`
2277
+ display: block;
2278
+ text-decoration: none;
2279
+ background-color: ${({ theme: e, $active: n }) => {
2280
+ var t, a, r, i, u, l;
2281
+ return n ? ((r = (a = (t = e == null ? void 0 : e.menu) == null ? void 0 : t.item) == null ? void 0 : a.background) == null ? void 0 : r.active) || j.item.background.active : ((l = (u = (i = e == null ? void 0 : e.menu) == null ? void 0 : i.item) == null ? void 0 : u.background) == null ? void 0 : l.inactive) || j.item.background.inactive;
2282
+ }};
2283
+ &:hover {
2284
+ cursor: ${({ $disabled: e }) => e ? "not-allowed" : "pointer"};
2285
+ background-color: ${({ $active: e, theme: n, $disabled: t }) => {
2286
+ var a, r, i;
2287
+ if (!t && !e)
2288
+ return ((i = (r = (a = n == null ? void 0 : n.menu) == null ? void 0 : a.item) == null ? void 0 : r.background) == null ? void 0 : i.hover) || j.item.background.hover;
2289
+ }};
2290
+ }
2291
+ `, st = T.div`
2292
+ display: flex;
2293
+ align-items: center;
2294
+ gap: 12px;
2295
+ width: 100%;
2296
+ outline: none;
2297
+ cursor: pointer;
2298
+ `, ct = (e) => {
2299
+ const { isOpen: n, links: t, onClick: a, title: r, activeId: i } = e;
2300
+ return /* @__PURE__ */ o(lt, { $active: n, children: /* @__PURE__ */ h(z, { border: !0, borderRadius: "8px", width: "100%", children: [
2301
+ /* @__PURE__ */ o(
2302
+ z,
2303
+ {
2304
+ alignItems: "center",
2305
+ borderRadius: "8px",
2306
+ direction: "row",
2307
+ gap: "12px",
2308
+ padding: "12px 8px",
2309
+ children: /* @__PURE__ */ h(
2310
+ st,
2311
+ {
2312
+ onClick: a,
2313
+ onKeyDown: (l) => {
2314
+ (l.key === "Enter" || l.key === " ") && (l.preventDefault(), a());
2315
+ },
2316
+ role: "button",
2317
+ tabIndex: 0,
2318
+ "aria-expanded": n,
2319
+ "aria-controls": "dropdown-links",
2320
+ children: [
2321
+ /* @__PURE__ */ o(
2322
+ R,
2323
+ {
2324
+ appearance: n ? "primary" : "dark",
2325
+ cursorHover: !0,
2326
+ icon: n ? /* @__PURE__ */ o(we, {}) : /* @__PURE__ */ o(ze, {})
2327
+ }
2328
+ ),
2329
+ /* @__PURE__ */ o(
2330
+ w,
2331
+ {
2332
+ appearance: n ? "primary" : "dark",
2333
+ cursorHover: !0,
2334
+ size: "small",
2335
+ type: "title",
2336
+ weight: n ? "bold" : "normal",
2337
+ children: r
2338
+ }
2339
+ )
2340
+ ]
2341
+ }
2342
+ )
2343
+ }
2344
+ ),
2345
+ n && /* @__PURE__ */ h(E, { children: [
2346
+ /* @__PURE__ */ o(F, {}),
2347
+ /* @__PURE__ */ o(g, { direction: "column", children: t.map((l) => {
2348
+ const d = l.id === i;
2349
+ return /* @__PURE__ */ o(
2350
+ Qe,
2351
+ {
2352
+ to: l.path,
2353
+ style: { textDecoration: "none" },
2354
+ children: /* @__PURE__ */ o(dt, { $active: d, children: /* @__PURE__ */ h(
2355
+ g,
2356
+ {
2357
+ alignItems: "center",
2358
+ direction: "row",
2359
+ gap: "8px",
2360
+ padding: d ? "8px 4px" : "8px 32px",
2361
+ children: [
2362
+ d && /* @__PURE__ */ o(R, { appearance: "primary", icon: /* @__PURE__ */ o(Ue, {}) }),
2363
+ /* @__PURE__ */ o(
2364
+ w,
2365
+ {
2366
+ appearance: d ? "primary" : "dark",
2367
+ size: "small",
2368
+ type: "title",
2369
+ weight: d ? "bold" : "normal",
2370
+ children: l.label
2371
+ }
2372
+ )
2373
+ ]
2374
+ }
2375
+ ) })
2376
+ },
2377
+ l.id
2378
+ );
2379
+ }) })
2380
+ ] })
2381
+ ] }) });
2382
+ }, jt = (e) => {
2383
+ const { collapseOnNavigate: n = !1, defaultOpenId: t = null, groups: a } = e, [r, i] = W.useState(t), u = We();
2384
+ W.useEffect(() => {
2385
+ n && i(null);
2386
+ }, [n, u.pathname]);
2387
+ const l = W.useCallback(
2388
+ (d) => {
2389
+ var s;
2390
+ return (s = d.find((p) => p.path === u.pathname)) == null ? void 0 : s.id;
2391
+ },
2392
+ [u.pathname]
2393
+ );
2394
+ return console.log(l(a[0].links), u.pathname), /* @__PURE__ */ o(g, { direction: "column", gap: "8px", children: a.map((d) => /* @__PURE__ */ o(
2395
+ ct,
2396
+ {
2397
+ activeId: l(d.links),
2398
+ isOpen: r === d.id,
2399
+ links: d.links,
2400
+ onClick: () => i((s) => s === d.id ? null : d.id),
2401
+ title: d.title
2402
+ },
2403
+ d.id
2404
+ )) });
2405
+ }, _ = /* @__PURE__ */ new Map(), ut = (e, n) => _.get(`${n}:${e}`), pt = (e, n, t) => {
2245
2406
  const a = `${n}:${e}`;
2246
2407
  if (_.set(a, t), _.size > 1e3) {
2247
- const i = _.keys().next().value;
2248
- i !== void 0 && _.delete(i);
2408
+ const r = _.keys().next().value;
2409
+ r !== void 0 && _.delete(r);
2249
2410
  }
2250
- }, be = /* @__PURE__ */ new Map(), tt = 1e3, at = (e) => {
2251
- const n = Date.now(), t = be.get(e) || 0;
2252
- return n - t < tt ? !0 : (be.set(e, n), !1);
2253
- }, ot = (e) => {
2254
- const n = Ge(e);
2411
+ }, ve = /* @__PURE__ */ new Map(), ht = 1e3, gt = (e) => {
2412
+ const n = Date.now(), t = ve.get(e) || 0;
2413
+ return n - t < ht ? !0 : (ve.set(e, n), !1);
2414
+ }, bt = (e) => {
2415
+ const n = Ye(e);
2255
2416
  return {
2256
2417
  spa: "es",
2257
2418
  eng: "en",
@@ -2260,18 +2421,18 @@ const Yn = x.div`
2260
2421
  ita: "it",
2261
2422
  por: "pt"
2262
2423
  }[n] || "en";
2263
- }, it = async (e, n, { url: t, apiKey: a }) => {
2264
- const i = `${n}:${e}`, r = et(e, n);
2265
- if (r) return r;
2266
- if (at(i))
2424
+ }, mt = async (e, n, { url: t, apiKey: a }) => {
2425
+ const r = `${n}:${e}`, i = ut(e, n);
2426
+ if (i) return i;
2427
+ if (gt(r))
2267
2428
  return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
2268
- const p = ot(e);
2429
+ const u = bt(e);
2269
2430
  try {
2270
- const { data: l } = await Pe.post(
2431
+ const { data: l } = await Ke.post(
2271
2432
  t,
2272
2433
  {
2273
2434
  q: e,
2274
- source: p,
2435
+ source: u,
2275
2436
  target: n,
2276
2437
  api_key: a
2277
2438
  },
@@ -2280,52 +2441,54 @@ const Yn = x.div`
2280
2441
  "Content-Type": "application/json"
2281
2442
  }
2282
2443
  }
2283
- ), s = (l == null ? void 0 : l.translatedText) || e;
2284
- return nt(e, n, s), s;
2444
+ ), d = (l == null ? void 0 : l.translatedText) || e;
2445
+ return pt(e, n, d), d;
2285
2446
  } catch (l) {
2286
2447
  return console.warn(`[Translation] Failed for: "${e}"`, l), e;
2287
2448
  }
2288
- }, rt = (e) => typeof e == "string" && e.trim().length > 0, fe = async (e, n, t) => {
2449
+ }, ft = (e) => typeof e == "string" && e.trim().length > 0, xe = async (e, n, t) => {
2289
2450
  const a = await Promise.all(
2290
- Object.entries(e).map(async ([i, r]) => {
2291
- if (rt(r)) {
2292
- const p = await it(r, n, t);
2293
- return [i, p];
2294
- } else if (Array.isArray(r)) {
2295
- const p = await Promise.all(
2296
- r.map(
2297
- async (l) => typeof l == "object" && l !== null ? await fe(l, n, t) : l
2451
+ Object.entries(e).map(async ([r, i]) => {
2452
+ if (ft(i)) {
2453
+ const u = await mt(i, n, t);
2454
+ return [r, u];
2455
+ } else if (Array.isArray(i)) {
2456
+ const u = await Promise.all(
2457
+ i.map(
2458
+ async (l) => typeof l == "object" && l !== null ? await xe(l, n, t) : l
2298
2459
  )
2299
2460
  );
2300
- return [i, p];
2301
- } else if (typeof r == "object" && r !== null) {
2302
- const p = await fe(r, n, t);
2303
- return [i, p];
2461
+ return [r, u];
2462
+ } else if (typeof i == "object" && i !== null) {
2463
+ const u = await xe(i, n, t);
2464
+ return [r, u];
2304
2465
  } else
2305
- return [i, r];
2466
+ return [r, i];
2306
2467
  })
2307
2468
  );
2308
2469
  return Object.fromEntries(a);
2309
2470
  };
2310
2471
  export {
2311
- re as BusinessRuleCard,
2312
- $e as BusinessRuleCardNew,
2313
- Ee as BusinessRuleView,
2314
- Fe as BusinessRuleViewNew,
2315
- xt as BusinessRules,
2316
- vt as BusinessRulesNew,
2317
- yt as Filter,
2318
- wt as FilterModal,
2319
- Ct as FormFilter,
2320
- ke as ModalRules,
2321
- Ie as RulesForm,
2322
- _n as convertRangeToString,
2323
- Dt as formatDecisionForBackend,
2324
- St as parseRangeFromString,
2325
- Nt as revertSortedDataSampleSwitchPlaces,
2326
- Et as revertSortedDataSwitchPlaces,
2327
- kt as sortDisplayDataSampleSwitchPlaces,
2328
- At as sortDisplayDataSwitchPlaces,
2329
- fe as translateObject,
2330
- it as translateText
2472
+ le as BusinessRuleCard,
2473
+ Fe as BusinessRuleCardNew,
2474
+ Ae as BusinessRuleView,
2475
+ Re as BusinessRuleViewNew,
2476
+ It as BusinessRules,
2477
+ Ft as BusinessRulesNew,
2478
+ ct as DropdownMenu,
2479
+ jt as DropdownMenuContainer,
2480
+ Rt as Filter,
2481
+ Ot as FilterModal,
2482
+ Mt as FormFilter,
2483
+ Ie as ModalRules,
2484
+ Oe as RulesForm,
2485
+ Kn as convertRangeToString,
2486
+ Lt as formatDecisionForBackend,
2487
+ zt as parseRangeFromString,
2488
+ Ut as revertSortedDataSampleSwitchPlaces,
2489
+ Vt as revertSortedDataSwitchPlaces,
2490
+ Bt as sortDisplayDataSampleSwitchPlaces,
2491
+ Ht as sortDisplayDataSwitchPlaces,
2492
+ xe as translateObject,
2493
+ mt as translateText
2331
2494
  };