@isettingkit/business-rules 1.0.17 → 1.0.19

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