@isettingkit/business-rules 1.0.18 → 1.0.20

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