@isettingkit/business-rules 1.0.9 → 1.0.11

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