@isettingkit/business-rules 0.1.22 → 0.1.23

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.
Files changed (2) hide show
  1. package/dist/index.es.js +464 -399
  2. package/package.json +2 -2
package/dist/index.es.js CHANGED
@@ -1,148 +1,175 @@
1
- import { jsxs as p, Fragment as A, jsx as t } from "react/jsx-runtime";
2
- import { useFormik as ee } from "formik";
3
- import { useState as k, useEffect as Z } from "react";
4
- import { Divider as S } from "@inubekit/divider";
5
- import { Stack as l } from "@inubekit/stack";
6
- import { Text as f } from "@inubekit/text";
7
- import { Toggle as J } from "@inubekit/toggle";
8
- import { ValueHowToSetUp as b, ValueDataType as O, DecisionConditionRenderer as _ } from "@isettingkit/input";
9
- import { Button as L } from "@inubekit/button";
10
- import { object as K, string as H, number as $, mixed as q } from "yup";
11
- import { Date as G } from "@inubekit/date";
12
- import { Checkbox as te } from "@inubekit/checkbox";
13
- import { inube as w } from "@inubekit/foundations";
14
- import g, { keyframes as ne } from "styled-components";
1
+ import { jsxs as p, Fragment as F, jsx as t } from "react/jsx-runtime";
2
+ import { useFormik as de } from "formik";
3
+ import { useState as k, useEffect as ae } from "react";
4
+ import { Divider as E } from "@inubekit/divider";
5
+ import { Stack as s } from "@inubekit/stack";
6
+ import { Text as v } from "@inubekit/text";
7
+ import { Toggle as ne } from "@inubekit/toggle";
8
+ import { ValueHowToSetUp as y, ValueDataType as $, DecisionConditionRenderer as Y } from "@isettingkit/input";
9
+ import { Button as W } from "@inubekit/button";
10
+ import { string as L, object as oe, number as G, mixed as Z } from "yup";
11
+ import { Date as J } from "@inubekit/date";
12
+ import { Checkbox as se } from "@inubekit/checkbox";
13
+ import { inube as S } from "@inubekit/foundations";
14
+ import f, { keyframes as ce } from "styled-components";
15
15
  import { DecisionViewConditionRenderer as z } from "@isettingkit/view";
16
- import { SkeletonLine as V } from "@inubekit/skeleton";
17
- import { MdOutlineEdit as re, MdOutlineDelete as ae, MdClear as ie, MdAdd as oe } from "react-icons/md";
18
- import { Icon as F } from "@inubekit/icon";
19
- import { createPortal as le } from "react-dom";
20
- import { Blanket as de } from "@inubekit/blanket";
21
- import { Grid as ce } from "@inubekit/grid";
22
- import { useMediaQuery as se } from "@inubekit/hooks";
23
- const B = (n) => {
24
- if ("value" in n && "valueUse" in n && n.value !== void 0) {
25
- const e = n.value, a = typeof e == "object" && "from" in e && typeof e.from == "number" ? e.from : 0, i = typeof e == "object" && "to" in e && typeof e.to == "number" ? e.to : 1 / 0;
26
- switch (n.valueUse) {
27
- case b.LIST_OF_VALUES:
16
+ import { SkeletonLine as R } from "@inubekit/skeleton";
17
+ import { MdOutlineDelete as pe, MdClear as ue, MdAdd as he } from "react-icons/md";
18
+ import { Icon as ie } from "@inubekit/icon";
19
+ import { createPortal as ge } from "react-dom";
20
+ import { Blanket as me } from "@inubekit/blanket";
21
+ import { Grid as be } from "@inubekit/grid";
22
+ import { useMediaQuery as fe } from "@inubekit/hooks";
23
+ const K = (r) => {
24
+ if ("value" in r && "valueUse" in r && r.value !== void 0) {
25
+ const e = r.value, o = typeof e == "object" && "from" in e && typeof e.from == "number" ? e.from : 0, i = typeof e == "object" && "to" in e && typeof e.to == "number" ? e.to : 0;
26
+ switch (r.valueUse) {
27
+ case y.LIST_OF_VALUES:
28
28
  return {
29
- schema: q().test(
29
+ schema: Z().test(
30
30
  "isArrayOrString",
31
31
  "Must be an array of strings/numbers or a single string",
32
32
  (d) => Array.isArray(d) ? d.every(
33
- (u) => typeof u == "string" || typeof u == "number"
33
+ (c) => typeof c == "string" || typeof c == "number"
34
34
  ) : typeof d == "string"
35
35
  ),
36
36
  value: e
37
37
  };
38
- case b.LIST_OF_VALUES_MULTI:
38
+ case y.LIST_OF_VALUES_MULTI:
39
39
  return {
40
- schema: q().test(
40
+ schema: Z().test(
41
41
  "isArrayOrString",
42
42
  "Must be an array of strings/numbers or a single string",
43
43
  (d) => Array.isArray(d) ? d.every(
44
- (u) => typeof u == "string" || typeof u == "number"
44
+ (c) => typeof c == "string" || typeof c == "number"
45
45
  ) : typeof d == "string"
46
46
  ),
47
47
  value: e
48
48
  };
49
- case b.RANGE:
49
+ case y.RANGE:
50
50
  return {
51
- schema: K({
52
- from: $().required("Range From is required").max(i, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
53
- to: $().required("Range To is required").min(a, "'Range To' cannot be less than 'Range From'").min(0, "'Range To' cannot be less than 0")
51
+ schema: oe({
52
+ from: G().required("Range From is required").max(i, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
53
+ to: G().required("Range To is required").min(o, "'Range To' cannot be less than 'Range From'").min(0, "'Range To' cannot be less than 0")
54
54
  }),
55
55
  value: {
56
- from: a,
56
+ from: o,
57
57
  to: i
58
58
  }
59
59
  };
60
- case b.GREATER_THAN:
61
- case b.LESS_THAN:
62
- case b.EQUAL:
63
- return n.dataType === O.PERCENTAGE ? {
64
- schema: $().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
60
+ case y.GREATER_THAN:
61
+ case y.LESS_THAN:
62
+ case y.EQUAL:
63
+ return r.dataType === $.PERCENTAGE ? {
64
+ schema: G().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
65
65
  value: e
66
66
  } : {
67
- schema: H().required("Required"),
67
+ schema: L().required("Required"),
68
68
  value: e
69
69
  };
70
70
  default:
71
71
  return {
72
- schema: H(),
72
+ schema: L(),
73
73
  value: void 0
74
74
  };
75
75
  }
76
76
  }
77
- }, pe = (n) => {
78
- const e = {}, a = {};
79
- if (n) {
80
- const i = B(n);
81
- i && (e[n.name] = i.schema, a[n.name] = i.value);
77
+ }, xe = (r, e = [], o = !1) => {
78
+ const i = {}, d = {};
79
+ if (r) {
80
+ const c = K(r);
81
+ c && (i[r.name] = c.schema, d[r.name] = c.value), i.startDate = L().required("Start date is required.").test(
82
+ "not-placeholder",
83
+ "Start date cannot be 'dd/mm/yyyy'.",
84
+ (a) => a !== "dd/mm/yyyy"
85
+ ).test(
86
+ "valid-date-format",
87
+ "Start date must be a valid date.",
88
+ (a) => {
89
+ if (!a) return !1;
90
+ const l = Date.parse(a);
91
+ return !isNaN(l);
92
+ }
93
+ ), d.startDate = r.startDate || "", i.endDate = L().test(
94
+ "valid-date-format",
95
+ "End date must be a valid date or null.",
96
+ (a) => {
97
+ if (!a) return !0;
98
+ const l = Date.parse(a);
99
+ return !isNaN(l);
100
+ }
101
+ ).test(
102
+ "start-before-end",
103
+ "Start date must not be greater than end date.",
104
+ (a, l) => {
105
+ if (!o || !a) return !0;
106
+ const m = Date.parse(l.parent.startDate), x = Date.parse(a);
107
+ return m <= x;
108
+ }
109
+ ), d.endDate = r.endDate || "";
82
110
  }
83
- return n.conditions && n.conditions.forEach((i) => {
84
- const d = B(i);
85
- d && (e[i.name] = d.schema, a[i.name] = d.value);
86
- }), { validationSchema: K().shape(e), initialValues: a };
87
- }, U = (n) => {
88
- if (typeof n == "string")
89
- return n;
90
- if (typeof n == "object" && ("from" in n || "to" in n))
111
+ return e.forEach((c) => {
112
+ const a = K(c);
113
+ a && (i[c.name] = a.schema, d[c.name] = a.value);
114
+ }), { validationSchema: oe().shape(i), initialValues: d };
115
+ }, O = (r) => {
116
+ if (typeof r == "string")
117
+ return r;
118
+ if (typeof r == "object" && ("from" in r || "to" in r))
91
119
  return {
92
- from: n.from || "",
93
- to: n.to || ""
120
+ from: r.from || "",
121
+ to: r.to || ""
94
122
  };
95
- for (const e in n)
96
- if (Object.prototype.hasOwnProperty.call(n, e)) {
97
- const a = U(n[e]);
98
- if (a) return a;
123
+ for (const e in r)
124
+ if (Object.prototype.hasOwnProperty.call(r, e)) {
125
+ const o = O(r[e]);
126
+ if (o) return o;
99
127
  }
100
128
  return "";
101
- }, ue = (n) => {
129
+ }, ye = (r) => {
102
130
  const {
103
131
  checked: e,
104
- children: a,
132
+ children: o,
105
133
  handleToggleChange: i,
106
134
  id: d,
107
- labelToggle: u,
108
- name: c,
109
- valueToggle: s = ""
110
- } = n, [x, m] = k(e), y = (h) => {
111
- m(h.target.checked), i(h);
135
+ labelToggle: c,
136
+ name: a,
137
+ valueToggle: l = ""
138
+ } = r, [m, x] = k(e), w = (h) => {
139
+ x(h.target.checked), i(h);
112
140
  };
113
- return Z(() => {
114
- m(e);
115
- }, [e]), /* @__PURE__ */ p(A, { children: [
116
- /* @__PURE__ */ t(l, { children: /* @__PURE__ */ t(
117
- J,
141
+ return ae(() => {
142
+ x(e);
143
+ }, [e]), /* @__PURE__ */ p(F, { children: [
144
+ /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
145
+ ne,
118
146
  {
119
- checked: x,
147
+ checked: m,
120
148
  id: d,
121
- margin: "10px",
122
- name: c,
123
- onChange: y,
149
+ name: a,
150
+ onChange: w,
124
151
  size: "small",
125
- value: s,
126
- children: /* @__PURE__ */ t(f, { size: "medium", type: "label", weight: "bold", children: u })
152
+ value: l,
153
+ children: /* @__PURE__ */ t(v, { size: "medium", type: "label", weight: "bold", children: c })
127
154
  }
128
155
  ) }),
129
- x && /* @__PURE__ */ t(A, { children: a })
156
+ m && /* @__PURE__ */ t(F, { children: o })
130
157
  ] });
131
- }, he = (n) => {
158
+ }, ve = (r) => {
132
159
  const {
133
160
  onHandleStartChange: e,
134
- onHandleEndChange: a,
161
+ onHandleEndChange: o,
135
162
  labelStart: i,
136
163
  labelEnd: d,
137
- checkedClosed: u = !1,
138
- required: c = !1,
139
- valueStart: s = "",
140
- valueEnd: x = ""
141
- } = n, [m, y] = k(u), [h, v] = k(s), [E, T] = k(x);
142
- return /* @__PURE__ */ p(A, { children: [
143
- /* @__PURE__ */ p(l, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
144
- /* @__PURE__ */ t(l, { children: /* @__PURE__ */ t(
145
- f,
164
+ checkedClosed: c = !1,
165
+ required: a = !1,
166
+ valueStart: l = "",
167
+ valueEnd: m = ""
168
+ } = r, [x, w] = k(c), [h, C] = k(l), [T, N] = k(m);
169
+ return /* @__PURE__ */ p(F, { children: [
170
+ /* @__PURE__ */ p(s, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
171
+ /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
172
+ v,
146
173
  {
147
174
  appearance: "gray",
148
175
  margin: "10px 0",
@@ -153,61 +180,61 @@ const B = (n) => {
153
180
  }
154
181
  ) }),
155
182
  /* @__PURE__ */ t(
156
- l,
183
+ s,
157
184
  {
158
185
  alignContent: "center",
159
186
  justifyContent: "center",
160
187
  wrap: "wrap",
161
188
  gap: "4px",
162
189
  children: /* @__PURE__ */ t(
163
- te,
190
+ se,
164
191
  {
165
192
  label: "Cerrada",
166
- onChange: ({ target: o }) => {
167
- y(o.checked);
193
+ onChange: ({ target: n }) => {
194
+ w(n.checked);
168
195
  },
169
- checked: m,
196
+ checked: x,
170
197
  value: ""
171
198
  }
172
199
  )
173
200
  }
174
201
  )
175
202
  ] }),
176
- /* @__PURE__ */ p(l, { justifyContent: "space-between", gap: "24px", children: [
177
- /* @__PURE__ */ t(l, { width: "189px", children: /* @__PURE__ */ t(
178
- G,
203
+ /* @__PURE__ */ p(s, { justifyContent: "space-between", gap: "24px", children: [
204
+ /* @__PURE__ */ t(s, { width: "189px", children: /* @__PURE__ */ t(
205
+ J,
179
206
  {
180
207
  id: "dateStart",
181
208
  label: i,
182
- onChange: (o) => {
183
- v(o.target.value), e(o);
209
+ onChange: (n) => {
210
+ C(n.target.value), e(n);
184
211
  },
185
212
  value: h,
186
- required: c,
213
+ required: a,
187
214
  size: "compact"
188
215
  }
189
216
  ) }),
190
- m && /* @__PURE__ */ t(l, { width: "189px", children: /* @__PURE__ */ t(
191
- G,
217
+ x && /* @__PURE__ */ t(s, { width: "189px", children: /* @__PURE__ */ t(
218
+ J,
192
219
  {
193
220
  id: "dateEnd",
194
221
  label: d,
195
- onChange: (o) => {
196
- T(o.target.value), a(o);
222
+ onChange: (n) => {
223
+ N(n.target.value), o(n);
197
224
  },
198
- value: E,
199
- required: c,
225
+ value: T,
226
+ required: a,
200
227
  size: "compact"
201
228
  }
202
229
  ) })
203
230
  ] })
204
231
  ] });
205
- }, ge = g.div`
232
+ }, we = f.div`
206
233
  & > div {
207
234
  border-radius: 8px;
208
- border: 1px solid ${w.palette.neutral.N30};
235
+ border: 1px solid ${S.palette.neutral.N30};
209
236
  }
210
- `, me = g.div`
237
+ `, Ce = f.div`
211
238
  width: 100%;
212
239
  height: 100%;
213
240
  overflow-y: auto;
@@ -224,212 +251,243 @@ const B = (n) => {
224
251
  background-color: #ebecf0;
225
252
  border-radius: 8px;
226
253
  }
227
- `, be = (n) => {
254
+ `, ke = (r) => {
228
255
  const {
229
256
  decision: e,
230
- formik: a,
257
+ formik: o,
231
258
  onChangeCondition: i,
232
259
  onChangeDecision: d,
233
- onStartChange: u,
234
- onEndChange: c,
235
- textValues: s,
236
- onCancel: x,
237
- onSubmit: m
238
- } = n, [y, h] = k(!0), [v] = k(!0), E = {
260
+ onStartChange: c,
261
+ onEndChange: a,
262
+ textValues: l,
263
+ onCancel: m,
264
+ onSubmit: x,
265
+ checkNone: w,
266
+ setCheckNone: h,
267
+ handleToggleChange: C,
268
+ hasErrors: T
269
+ } = r, N = {
239
270
  name: e.name,
240
271
  dataType: e.dataType,
241
272
  value: e.value,
242
273
  valueUse: e.valueUse,
243
274
  possibleValue: e.possibleValue
244
275
  };
245
- Z(() => {
246
- console.log("Updated formik.errors in RulesFormUI:", a.errors);
247
- }, [a.errors]);
248
- const T = (r) => {
249
- h(r.target.checked);
250
- }, C = (r) => {
251
- const o = U(a.errors[r] || {});
252
- return typeof o == "string" ? o ? "invalid" : "pending" : o;
253
- }, D = (r) => {
254
- const o = U(a.errors[r] || {});
255
- return o;
276
+ ae(() => {
277
+ console.log("Updated formik.errors in RulesFormUI:", o.errors);
278
+ }, [o.errors]);
279
+ const M = (n) => {
280
+ h(n.target.checked);
281
+ }, A = (n) => {
282
+ const g = O(o.errors[n] || {});
283
+ return console.log(
284
+ "getFieldStatus(error): ",
285
+ O(o.errors[n])
286
+ ), typeof g == "string" ? g ? "invalid" : "pending" : g;
287
+ }, j = (n) => {
288
+ const g = O(o.errors[n] || {});
289
+ return g;
256
290
  };
257
- return /* @__PURE__ */ p(l, { direction: "column", gap: "24px", children: [
291
+ return console.log(
292
+ "getFieldMessage: ",
293
+ A(e.name),
294
+ " - getFieldMessage: ",
295
+ j(o.errors[e.name])
296
+ ), /* @__PURE__ */ p(s, { direction: "column", gap: "24px", children: [
258
297
  e && /* @__PURE__ */ t(
259
- _,
298
+ Y,
260
299
  {
261
- element: E,
300
+ element: N,
262
301
  onDecision: d,
263
- valueData: a.values[e.name],
264
- message: a.errors[e.name],
265
- status: C(e.name),
302
+ valueData: o.values[e.name],
303
+ message: o.errors[e.name],
304
+ status: A(e.name),
266
305
  textValues: {
267
306
  selectOptions: "Select an option",
268
307
  selectOption: "Option selected",
269
- rangeMin: (r) => `Minimum ${r}`,
270
- rangeMax: (r) => `Maximum ${r}`
308
+ rangeMin: (n) => `Minimum ${n}`,
309
+ rangeMax: (n) => `Maximum ${n}`
271
310
  }
272
311
  }
273
312
  ),
274
- /* @__PURE__ */ t(S, { dashed: !0 }),
275
- /* @__PURE__ */ t(ge, { children: /* @__PURE__ */ t(me, { children: /* @__PURE__ */ p(
276
- l,
313
+ /* @__PURE__ */ t(E, { dashed: !0 }),
314
+ /* @__PURE__ */ t(we, { children: /* @__PURE__ */ t(Ce, { children: /* @__PURE__ */ p(
315
+ s,
277
316
  {
278
317
  direction: "column",
279
318
  padding: "6px 12px",
280
319
  gap: "16px",
281
320
  height: "272px",
282
321
  children: [
283
- /* @__PURE__ */ p(l, { direction: "row", justifyContent: "space-between", children: [
284
- /* @__PURE__ */ t(f, { children: s.factsThatConditionIt }),
322
+ /* @__PURE__ */ p(s, { direction: "row", justifyContent: "space-between", children: [
323
+ /* @__PURE__ */ t(v, { children: l.factsThatConditionIt }),
285
324
  /* @__PURE__ */ t(
286
- J,
325
+ ne,
287
326
  {
288
327
  id: "toogleNone",
289
- onChange: T,
290
- checked: y,
328
+ onChange: M,
329
+ checked: w,
291
330
  size: "small",
292
- children: /* @__PURE__ */ t(f, { size: "medium", type: "label", weight: "bold", children: s.none })
331
+ children: /* @__PURE__ */ t(v, { size: "medium", type: "label", weight: "bold", children: l.none })
293
332
  }
294
333
  )
295
334
  ] }),
296
- /* @__PURE__ */ t(l, { direction: "column", gap: "20px", children: e.conditions && e.conditions.filter((r) => !r.hidden).map((r) => /* @__PURE__ */ t(
297
- ue,
335
+ /* @__PURE__ */ t(s, { direction: "column", gap: "20px", children: e.conditions && e.conditions.filter((n) => !n.hidden).map((n) => /* @__PURE__ */ t(
336
+ ye,
298
337
  {
299
- checked: !y,
300
- handleToggleChange: (o) => {
301
- o.target.checked || i(
338
+ checked: !w,
339
+ handleToggleChange: (g) => {
340
+ const I = g.target.checked;
341
+ C(n.name, I), I || i(
302
342
  {
303
343
  value: "",
304
344
  to: 0,
305
345
  from: 0,
306
- list: r.possibleValue.list
346
+ list: n.possibleValue.list
307
347
  },
308
- r.name
348
+ n.name
309
349
  );
310
350
  },
311
- id: r.name.replace(" ", ""),
312
- labelToggle: r.name.split(/(?=[A-Z])/).join(" "),
313
- name: r.name.replace(" ", ""),
351
+ id: n.name.replace(" ", ""),
352
+ labelToggle: n.name.split(/(?=[A-Z])/).join(" "),
353
+ name: n.name.replace(" ", ""),
314
354
  children: /* @__PURE__ */ t(
315
- _,
355
+ Y,
316
356
  {
317
- element: r,
357
+ element: n,
318
358
  onDecision: i,
319
- valueData: a.values[r.name],
320
- message: D(r.name),
321
- status: C(r.name),
359
+ valueData: o.values[n.name],
360
+ message: j(n.name),
361
+ status: A(n.name),
322
362
  textValues: {
323
363
  selectOptions: "Select an option",
324
364
  selectOption: "Option selected",
325
- rangeMin: (o) => `Minimum ${o}`,
326
- rangeMax: (o) => `Maximum ${o}`
365
+ rangeMin: (g) => `Minimum ${g}`,
366
+ rangeMax: (g) => `Maximum ${g}`
327
367
  },
328
368
  type: "condition"
329
369
  }
330
370
  )
331
371
  },
332
- r.name
372
+ n.name
333
373
  )) })
334
374
  ]
335
375
  }
336
376
  ) }) }),
337
- /* @__PURE__ */ t(S, { dashed: !0 }),
338
- /* @__PURE__ */ t(l, { direction: "column", children: e && /* @__PURE__ */ t(
339
- he,
377
+ /* @__PURE__ */ t(E, { dashed: !0 }),
378
+ /* @__PURE__ */ t(s, { direction: "column", children: e && /* @__PURE__ */ t(
379
+ ve,
340
380
  {
341
- onHandleStartChange: (r) => u(r.target.value),
342
- onHandleEndChange: (r) => c(r.target.value),
343
- labelStart: s.termStart,
344
- labelEnd: s.termEnd,
381
+ onHandleStartChange: (n) => c(n.target.value),
382
+ onHandleEndChange: (n) => a(n.target.value),
383
+ labelStart: l.termStart,
384
+ labelEnd: l.termEnd,
345
385
  checkedClosed: !!e.endDate,
346
386
  valueStart: String(e.startDate),
347
- valueEnd: String(e.endDate) || ""
387
+ valueEnd: String(e.endDate) || "",
388
+ required: !0
348
389
  }
349
390
  ) }),
350
- /* @__PURE__ */ t(S, {}),
351
- /* @__PURE__ */ p(l, { direction: "row", justifyContent: "end", gap: "16px", children: [
352
- /* @__PURE__ */ t(L, { appearance: "gray", onClick: x, children: s.cancel }),
391
+ /* @__PURE__ */ t(E, {}),
392
+ /* @__PURE__ */ p(s, { direction: "row", justifyContent: "end", gap: "16px", children: [
393
+ /* @__PURE__ */ t(W, { appearance: "gray", onClick: m, children: l.cancel }),
353
394
  /* @__PURE__ */ t(
354
- L,
395
+ W,
355
396
  {
356
- onClick: m,
357
- disabled: v || !a.isValid,
397
+ onClick: x,
398
+ disabled: T,
358
399
  type: "submit",
359
- children: s.confirm
400
+ children: l.confirm
360
401
  }
361
402
  )
362
403
  ] })
363
404
  ] });
364
- }, fe = (n) => {
365
- const { id: e, decision: a, onCancel: i, onSubmitEvent: d, textValues: u } = n, [c, s] = k(a), x = (r, o) => {
366
- C.setFieldValue(r, o), C.validateField(r);
367
- }, m = (r, o) => {
368
- const I = r instanceof Date ? r.toISOString() : r;
369
- s((j) => {
370
- if (!j.conditions)
371
- return j;
372
- const X = j.conditions.map((R) => R.name === o ? { ...R, value: I } : R);
405
+ }, Se = (r) => {
406
+ var Q;
407
+ const { id: e, decision: o, onCancel: i, onSubmitEvent: d, textValues: c } = r, [a, l] = k(o), [m, x] = k(!0), [w, h] = k([]), [C, T] = k(!1), N = (u, b) => {
408
+ _.setFieldValue(u, b), _.validateField(u);
409
+ }, M = (u, b) => {
410
+ const D = u instanceof Date ? u.toISOString() : u;
411
+ l((V) => {
412
+ if (!V.conditions)
413
+ return V;
414
+ const le = V.conditions.map((H) => H.name === b ? { ...H, value: D } : H);
373
415
  return {
374
- ...j,
375
- conditions: X
416
+ ...V,
417
+ conditions: le
376
418
  };
377
- }), x(o, I);
378
- }, y = (r) => {
379
- s(
380
- (o) => D(o, "value", r)
419
+ }), N(b, D);
420
+ }, A = (u, b) => {
421
+ h((D) => b ? [...D, u] : D.filter((V) => V !== u));
422
+ }, j = (u) => {
423
+ l(
424
+ (b) => q(b, "value", u)
381
425
  );
382
- }, h = (r) => {
383
- s(
384
- (o) => D(o, "endDate", r)
426
+ }, n = (u) => {
427
+ l(
428
+ (b) => q(b, "endDate", u)
385
429
  );
386
- }, v = (r) => {
387
- s(
388
- (o) => D(o, "startDate", r)
430
+ }, g = (u) => {
431
+ l(
432
+ (b) => q(b, "startDate", u)
389
433
  );
390
- }, { validationSchema: E, initialValues: T } = pe(c);
391
- E.validate(T, { abortEarly: !1 }).then(() => console.log("Validation passed")).catch((r) => console.log("Validation failed:", r.errors));
392
- const C = ee({
393
- initialValues: T,
394
- validationSchema: E,
434
+ }, { validationSchema: I, initialValues: P } = xe(
435
+ a,
436
+ m ? (Q = o.conditions) == null ? void 0 : Q.filter(
437
+ (u) => w.includes(u.name)
438
+ ) : o.conditions,
439
+ m
440
+ );
441
+ I.validate(P, { abortEarly: !1 }).then(() => {
442
+ T(!1), console.log("Validation passed");
443
+ }).catch((u) => {
444
+ console.log("Validation failed:", u.errors), T(!0);
445
+ });
446
+ const _ = de({
447
+ initialValues: P,
448
+ validationSchema: I,
395
449
  validateOnChange: !0,
396
450
  validateOnBlur: !0,
397
451
  onSubmit: () => {
398
- d(c);
452
+ d(a);
399
453
  }
400
- }), D = (r, o, I) => ({
401
- ...r,
402
- ...r.decision,
403
- [o]: I
454
+ }), q = (u, b, D) => ({
455
+ ...u,
456
+ ...u.decision,
457
+ [b]: D
404
458
  });
405
459
  return /* @__PURE__ */ t(
406
- be,
460
+ ke,
407
461
  {
408
462
  id: e,
409
- formik: C,
410
- decision: c,
463
+ formik: _,
464
+ decision: a,
411
465
  onCancel: i,
412
- onSubmit: () => d(c),
413
- onChangeCondition: m,
414
- onChangeDecision: y,
415
- onStartChange: v,
416
- onEndChange: h,
417
- textValues: u
466
+ onSubmit: () => d(a),
467
+ onChangeCondition: M,
468
+ onChangeDecision: j,
469
+ onStartChange: g,
470
+ onEndChange: n,
471
+ textValues: c,
472
+ checkNone: m,
473
+ setCheckNone: x,
474
+ handleToggleChange: A,
475
+ hasErrors: C
418
476
  }
419
477
  );
420
- }, N = (n) => {
421
- if (!n)
478
+ }, U = (r) => {
479
+ if (!r)
422
480
  return;
423
- const e = n.value;
481
+ const e = r.value;
424
482
  if (!e)
425
483
  return;
426
484
  if (((i) => typeof i == "object" && i !== null)(e))
427
- switch (n.valueUse) {
428
- case b.LIST_OF_VALUES_MULTI:
485
+ switch (r.valueUse) {
486
+ case y.LIST_OF_VALUES_MULTI:
429
487
  return e;
430
- case b.LIST_OF_VALUES:
488
+ case y.LIST_OF_VALUES:
431
489
  return e;
432
- case b.RANGE:
490
+ case y.RANGE:
433
491
  return {
434
492
  from: e.from,
435
493
  to: e.to
@@ -438,12 +496,12 @@ const B = (n) => {
438
496
  return e.value;
439
497
  }
440
498
  return e;
441
- }, P = g.div`
499
+ }, X = f.div`
442
500
  & > div {
443
501
  border-radius: 8px;
444
- border: 1px solid ${w.palette.neutral.N30};
502
+ border: 1px solid ${S.palette.neutral.N30};
445
503
  }
446
- `, Q = g.div`
504
+ `, ee = f.div`
447
505
  width: 100%;
448
506
  height: 100%;
449
507
  overflow-y: auto;
@@ -461,25 +519,25 @@ const B = (n) => {
461
519
  background-color: #ebecf0;
462
520
  border-radius: 8px;
463
521
  }
464
- `, Y = (n) => {
465
- const { decision: e, loading: a = !1, textValues: i } = n, d = (c) => c && Object.keys(c).length > 0, u = {
522
+ `, te = (r) => {
523
+ const { decision: e, loading: o = !1, textValues: i } = r, d = (a) => a && Object.keys(a).length > 0, c = {
466
524
  name: (e == null ? void 0 : e.name) || "",
467
525
  dataType: (e == null ? void 0 : e.dataType) || "alphabetical",
468
- value: N(e),
526
+ value: U(e),
469
527
  valueUse: (e == null ? void 0 : e.valueUse) || "equal"
470
528
  };
471
- return !a && e && i ? /* @__PURE__ */ p(l, { direction: "column", gap: "12px", children: [
472
- e && /* @__PURE__ */ t(l, { direction: "column", alignItems: "center", children: /* @__PURE__ */ t(
529
+ return !o && e && i ? /* @__PURE__ */ p(s, { direction: "column", gap: "12px", children: [
530
+ e && /* @__PURE__ */ t(s, { direction: "column", alignItems: "center", children: /* @__PURE__ */ t(
473
531
  z,
474
532
  {
475
- element: u,
476
- valueData: N(u),
533
+ element: c,
534
+ valueData: U(c),
477
535
  type: "decision"
478
536
  }
479
537
  ) }, e.name),
480
- /* @__PURE__ */ t(S, { dashed: !0 }),
481
- /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ p(
482
- l,
538
+ /* @__PURE__ */ t(E, { dashed: !0 }),
539
+ /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ p(
540
+ s,
483
541
  {
484
542
  direction: "column",
485
543
  gap: "12px",
@@ -487,7 +545,7 @@ const B = (n) => {
487
545
  height: "203px",
488
546
  children: [
489
547
  /* @__PURE__ */ t(
490
- f,
548
+ v,
491
549
  {
492
550
  type: "label",
493
551
  size: "large",
@@ -497,81 +555,102 @@ const B = (n) => {
497
555
  children: i.factsThatConditionIt
498
556
  }
499
557
  ),
500
- e.conditions && e.conditions.map((c) => {
501
- if (c.hidden) return null;
502
- const s = c.value;
503
- return (typeof s == "object" && d(s) || s) && /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(l, { direction: "column", padding: "8px", children: /* @__PURE__ */ t(
558
+ e.conditions && e.conditions.map((a) => {
559
+ if (a.hidden) return null;
560
+ const l = a.value;
561
+ return (typeof l == "object" && d(l) || l !== void 0 && typeof l == "string" && l.length > 0) && /* @__PURE__ */ t(X, { children: /* @__PURE__ */ t(s, { direction: "column", padding: "8px", children: /* @__PURE__ */ t(
504
562
  z,
505
563
  {
506
564
  element: {
507
- ...c,
508
- value: s
565
+ ...a,
566
+ value: l
509
567
  },
510
- valueData: N(c)
568
+ valueData: U(a)
511
569
  }
512
- ) }) }, c.name);
570
+ ) }) }, a.name);
513
571
  }),
514
- /* @__PURE__ */ t(S, { dashed: !0 }),
515
- /* @__PURE__ */ t(l, { direction: "column", gap: "12px", children: (e == null ? void 0 : e.startDate) && (e == null ? void 0 : e.endDate) && /* @__PURE__ */ t(
516
- z,
517
- {
518
- element: {
519
- name: i.terms,
520
- value: String(e.startDate),
521
- valueUse: b.RANGE,
522
- dataType: O.DATE
572
+ /* @__PURE__ */ t(E, { dashed: !0 }),
573
+ /* @__PURE__ */ p(s, { direction: "column", gap: "12px", children: [
574
+ (e == null ? void 0 : e.startDate) && (e == null ? void 0 : e.endDate) && /* @__PURE__ */ t(
575
+ z,
576
+ {
577
+ element: {
578
+ name: i.terms,
579
+ value: String(e.startDate),
580
+ valueUse: y.RANGE,
581
+ dataType: $.DATE
582
+ },
583
+ valueData: U({
584
+ name: i.terms,
585
+ value: {
586
+ from: String(e.startDate),
587
+ to: String(e.endDate)
588
+ },
589
+ valueUse: y.RANGE,
590
+ dataType: $.DATE
591
+ }),
592
+ type: "decision"
523
593
  },
524
- valueData: N({
525
- name: i.terms,
526
- value: {
527
- from: String(e.startDate),
528
- to: String(e.endDate)
594
+ i.terms
595
+ ),
596
+ (e == null ? void 0 : e.startDate) && !(e != null && e.endDate) && /* @__PURE__ */ t(
597
+ z,
598
+ {
599
+ element: {
600
+ name: i.terms,
601
+ value: String(e.startDate),
602
+ valueUse: y.EQUAL,
603
+ dataType: $.DATE
529
604
  },
530
- valueUse: b.RANGE,
531
- dataType: O.DATE
532
- }),
533
- type: "decision"
534
- },
535
- i.terms
536
- ) })
605
+ valueData: U({
606
+ name: i.terms,
607
+ value: String(e.startDate),
608
+ valueUse: y.EQUAL,
609
+ dataType: $.DATE
610
+ }),
611
+ type: "decision"
612
+ },
613
+ i.terms
614
+ )
615
+ ] })
537
616
  ]
538
617
  }
539
618
  ) })
540
- ] }) : /* @__PURE__ */ p(l, { direction: "column", gap: "12px", children: [
541
- /* @__PURE__ */ p(l, { direction: "column", alignItems: "center", gap: "4px", children: [
542
- /* @__PURE__ */ t(V, { animated: !0, width: "180px" }),
543
- /* @__PURE__ */ t(V, { animated: !0, width: "85px" })
619
+ ] }) : /* @__PURE__ */ p(s, { direction: "column", gap: "12px", children: [
620
+ /* @__PURE__ */ p(s, { direction: "column", alignItems: "center", gap: "4px", children: [
621
+ /* @__PURE__ */ t(R, { animated: !0, width: "180px" }),
622
+ /* @__PURE__ */ t(R, { animated: !0, width: "85px" })
544
623
  ] }, "loading"),
545
- /* @__PURE__ */ p(l, { direction: "column", gap: "12px", alignItems: "center", children: [
546
- /* @__PURE__ */ t(S, { dashed: !0 }),
547
- /* @__PURE__ */ t(V, { animated: !0, width: "150px" })
624
+ /* @__PURE__ */ p(s, { direction: "column", gap: "12px", alignItems: "center", children: [
625
+ /* @__PURE__ */ t(E, { dashed: !0 }),
626
+ /* @__PURE__ */ t(R, { animated: !0, width: "150px" })
548
627
  ] }),
549
- /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(
550
- l,
628
+ /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(
629
+ s,
551
630
  {
552
631
  direction: "column",
553
632
  gap: "12px",
554
633
  justifyContent: "space-between",
555
634
  height: "203px",
556
- children: Array.from({ length: 5 }).map((c, s) => /* @__PURE__ */ t(P, { children: /* @__PURE__ */ p(
557
- l,
635
+ children: Array.from({ length: 5 }).map((a, l) => /* @__PURE__ */ t(X, { children: /* @__PURE__ */ p(
636
+ s,
558
637
  {
559
638
  direction: "column",
560
639
  gap: "12px",
561
640
  alignItems: "start",
562
641
  padding: "8px",
563
642
  children: [
564
- /* @__PURE__ */ t(V, { animated: !0, width: "180px" }),
565
- /* @__PURE__ */ t(V, { animated: !0, width: "85px" })
643
+ /* @__PURE__ */ t(R, { animated: !0, width: "180px" }),
644
+ /* @__PURE__ */ t(R, { animated: !0, width: "85px" })
566
645
  ]
567
646
  }
568
- ) }, `condition-${s}`))
647
+ ) }, `condition-${l}`))
569
648
  }
570
649
  ) })
571
650
  ] });
572
- }, xe = g.div`
651
+ }, De = f.div`
573
652
  border-radius: 8px;
574
- border: 1px solid ${w.palette.neutral.N30};
653
+ border: 1px solid ${S.palette.neutral.N30};
575
654
  box-sizing: border-box;
576
655
  display: flex;
577
656
  flex-direction: column;
@@ -581,7 +660,7 @@ const B = (n) => {
581
660
  height: 100%;
582
661
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
583
662
  `;
584
- g.div`
663
+ f.div`
585
664
  width: 100%;
586
665
  height: 100%;
587
666
  overflow-y: auto;
@@ -600,49 +679,35 @@ g.div`
600
679
  border-radius: 8px;
601
680
  }
602
681
  `;
603
- const M = (n) => {
604
- const { children: e, controls: a = !0, handleDelete: i, handleView: d, id: u } = n;
605
- return /* @__PURE__ */ t(xe, { children: /* @__PURE__ */ p(l, { direction: "column", gap: "16px", padding: "12px 16px", children: [
682
+ const B = (r) => {
683
+ const { children: e, controls: o = !0, handleDelete: i, id: d } = r;
684
+ return /* @__PURE__ */ t(De, { children: /* @__PURE__ */ p(s, { direction: "column", gap: "16px", padding: "12px 16px", children: [
606
685
  e,
607
- a && /* @__PURE__ */ p(A, { children: [
608
- /* @__PURE__ */ t(S, {}),
609
- /* @__PURE__ */ p(l, { gap: "16px", justifyContent: "end", children: [
610
- /* @__PURE__ */ t(
611
- F,
612
- {
613
- appearance: "dark",
614
- size: "24px",
615
- cursorHover: !0,
616
- icon: /* @__PURE__ */ t(re, {}),
617
- onClick: () => {
618
- d(u);
619
- }
620
- }
621
- ),
622
- /* @__PURE__ */ t(
623
- F,
624
- {
625
- cursorHover: !0,
626
- appearance: "dark",
627
- size: "24px",
628
- icon: /* @__PURE__ */ t(ae, {}),
629
- onClick: () => {
630
- i(u);
631
- }
686
+ o && /* @__PURE__ */ p(F, { children: [
687
+ /* @__PURE__ */ t(E, {}),
688
+ /* @__PURE__ */ t(s, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ t(
689
+ ie,
690
+ {
691
+ cursorHover: !0,
692
+ appearance: "dark",
693
+ size: "24px",
694
+ icon: /* @__PURE__ */ t(pe, {}),
695
+ onClick: () => {
696
+ i(d);
632
697
  }
633
- )
634
- ] })
698
+ }
699
+ ) })
635
700
  ] })
636
701
  ] }) });
637
- }, ye = g.div`
702
+ }, Ee = f.div`
638
703
  position: relative;
639
704
  & > div {
640
705
  padding: 24px 16px;
641
706
  }
642
- `, ve = g.div`
643
- background-color: ${({ theme: n }) => {
644
- var e, a;
645
- return ((a = (e = n == null ? void 0 : n.palette) == null ? void 0 : e.neutral) == null ? void 0 : a.N0) || w.palette.neutral.N0;
707
+ `, Te = f.div`
708
+ background-color: ${({ theme: r }) => {
709
+ var e, o;
710
+ return ((o = (e = r == null ? void 0 : r.palette) == null ? void 0 : e.neutral) == null ? void 0 : o.N0) || S.palette.neutral.N0;
646
711
  }};
647
712
  max-width: 450px;
648
713
  max-height: 90vh;
@@ -670,23 +735,23 @@ const M = (n) => {
670
735
  background-color: #ebecf0;
671
736
  border-radius: 8px;
672
737
  }
673
- `, we = (n) => {
674
- const { children: e, portalId: a, onCloseModal: i, title: d } = n, u = document.getElementById(a);
675
- if (!u)
738
+ `, Ae = (r) => {
739
+ const { children: e, portalId: o, onCloseModal: i, title: d } = r, c = document.getElementById(o);
740
+ if (!c)
676
741
  throw new Error(
677
742
  "The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
678
743
  );
679
- return le(
680
- /* @__PURE__ */ t(ye, { children: /* @__PURE__ */ t(de, { children: /* @__PURE__ */ t(ve, { children: /* @__PURE__ */ p(l, { direction: "column", gap: "24px", children: [
681
- /* @__PURE__ */ t(l, { direction: "column", gap: "24px", children: /* @__PURE__ */ p(l, { alignItems: "center", justifyContent: "space-between", children: [
682
- /* @__PURE__ */ t(f, { type: "title", size: "large", appearance: "dark", weight: "bold", children: d }),
683
- /* @__PURE__ */ t(ie, { size: "24px", cursor: "pointer", onClick: i })
744
+ return ge(
745
+ /* @__PURE__ */ t(Ee, { children: /* @__PURE__ */ t(me, { children: /* @__PURE__ */ t(Te, { children: /* @__PURE__ */ p(s, { direction: "column", gap: "24px", children: [
746
+ /* @__PURE__ */ t(s, { direction: "column", gap: "24px", children: /* @__PURE__ */ p(s, { alignItems: "center", justifyContent: "space-between", children: [
747
+ /* @__PURE__ */ t(v, { type: "title", size: "large", appearance: "dark", weight: "bold", children: d }),
748
+ /* @__PURE__ */ t(ue, { size: "24px", cursor: "pointer", onClick: i })
684
749
  ] }) }),
685
750
  e
686
751
  ] }) }) }) }),
687
- u
752
+ c
688
753
  );
689
- }, Ce = ne`
754
+ }, Ve = ce`
690
755
  from {
691
756
  opacity: 0;
692
757
  transform: translateY(20px);
@@ -695,16 +760,16 @@ const M = (n) => {
695
760
  opacity: 1;
696
761
  transform: translateY(0);
697
762
  }
698
- `, W = g.div`
763
+ `, re = f.div`
699
764
  width: 100%;
700
765
  height: 100%;
701
766
  & > div {
702
- animation: ${Ce} 600ms ease-out;
767
+ animation: ${Ve} 600ms ease-out;
703
768
  }
704
769
  `;
705
- g.div`
770
+ f.div`
706
771
  border-radius: 8px;
707
- border: 1px solid ${w.palette.neutral.N30};
772
+ border: 1px solid ${S.palette.neutral.N30};
708
773
  box-sizing: border-box;
709
774
  display: flex;
710
775
  flex-direction: column;
@@ -714,7 +779,7 @@ g.div`
714
779
  height: 100%;
715
780
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
716
781
  `;
717
- const ke = g.div`
782
+ const Ne = f.div`
718
783
  & > div {
719
784
  width: 100%;
720
785
  height: 100%;
@@ -734,16 +799,16 @@ const ke = g.div`
734
799
  border-radius: 8px;
735
800
  }
736
801
  }
737
- `, Se = g.div`
802
+ `, je = f.div`
738
803
  & > div > div {
739
804
  border-radius: 8px;
740
- border: 1px solid ${w.palette.neutral.N30};
805
+ border: 1px solid ${S.palette.neutral.N30};
741
806
  box-sizing: border-box;
742
807
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
743
808
  }
744
- `, Ee = g.div`
809
+ `, Ie = f.div`
745
810
  & > div {
746
- background-color: ${w.palette.neutral.N30};
811
+ background-color: ${S.palette.neutral.N30};
747
812
  justify-content: center;
748
813
  }
749
814
  min-height: 300px;
@@ -751,32 +816,32 @@ const ke = g.div`
751
816
  height: 100%;
752
817
  padding-bottom: 12px;
753
818
  `;
754
- g.div`
819
+ f.div`
755
820
  & > div {
756
821
  border-radius: 8px;
757
- border: 1px solid ${w.palette.neutral.N30};
822
+ border: 1px solid ${S.palette.neutral.N30};
758
823
  }
759
824
  `;
760
- const Ye = ({
761
- decisions: n,
825
+ const tt = ({
826
+ decisions: r,
762
827
  textValues: e,
763
- decisionTemplate: a,
828
+ decisionTemplate: o,
764
829
  isModalOpen: i,
765
830
  selectedDecision: d,
766
- loading: u,
767
- handleOpenModal: c,
768
- handleCloseModal: s,
769
- handleSubmitForm: x,
770
- handleDelete: m
831
+ loading: c,
832
+ handleOpenModal: a,
833
+ handleCloseModal: l,
834
+ handleSubmitForm: m,
835
+ handleDelete: x
771
836
  }) => {
772
- const y = se("(max-width: 681px)");
773
- return /* @__PURE__ */ p(A, { children: [
774
- /* @__PURE__ */ t(Se, { children: /* @__PURE__ */ t(ke, { children: /* @__PURE__ */ p(l, { direction: "column", gap: "16px", padding: "6px", children: [
775
- n.length === 0 && /* @__PURE__ */ p(f, { as: "span", type: "label", size: "large", appearance: "gray", children: [
837
+ const w = fe("(max-width: 681px)");
838
+ return /* @__PURE__ */ p(F, { children: [
839
+ /* @__PURE__ */ t(je, { children: /* @__PURE__ */ t(Ne, { children: /* @__PURE__ */ p(s, { direction: "column", gap: "16px", padding: "6px", children: [
840
+ r.length === 0 && !c && /* @__PURE__ */ p(v, { as: "span", type: "label", size: "large", appearance: "gray", children: [
776
841
  "Aún no tienes definidas tasas de interés efectivas. Presiona",
777
842
  " ",
778
843
  /* @__PURE__ */ t(
779
- f,
844
+ v,
780
845
  {
781
846
  as: "span",
782
847
  type: "label",
@@ -790,7 +855,7 @@ const Ye = ({
790
855
  "para empezar."
791
856
  ] }),
792
857
  /* @__PURE__ */ p(
793
- ce,
858
+ be,
794
859
  {
795
860
  templateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
796
861
  autoFlow: "row dense",
@@ -800,21 +865,21 @@ const Ye = ({
800
865
  autoRows: "1fr",
801
866
  justifyItems: "center",
802
867
  padding: "6px",
803
- height: y ? "auto" : "484px",
868
+ height: w ? "auto" : "484px",
804
869
  children: [
805
- u ? Array.from({ length: 3 }).map((h, v) => /* @__PURE__ */ t(
806
- M,
870
+ c ? Array.from({ length: 3 }).map((h, C) => /* @__PURE__ */ t(
871
+ B,
807
872
  {
808
- id: `loading-card-${v}`,
873
+ id: `loading-card-${C}`,
809
874
  handleDelete: () => {
810
875
  },
811
- handleView: () => c(),
876
+ handleView: () => a(),
812
877
  controls: !1,
813
- children: /* @__PURE__ */ t(Y, { loading: !0 })
878
+ children: /* @__PURE__ */ t(te, { loading: !0 })
814
879
  },
815
- `loading-card-${v}`
816
- )) : n.map((h) => /* @__PURE__ */ t(W, { children: /* @__PURE__ */ p(
817
- l,
880
+ `loading-card-${C}`
881
+ )) : r.map((h) => /* @__PURE__ */ t(re, { children: /* @__PURE__ */ p(
882
+ s,
818
883
  {
819
884
  direction: "column",
820
885
  gap: "4px",
@@ -822,7 +887,7 @@ const Ye = ({
822
887
  padding: "0 0 12px 0",
823
888
  children: [
824
889
  /* @__PURE__ */ t(
825
- f,
890
+ v,
826
891
  {
827
892
  type: "title",
828
893
  size: "medium",
@@ -832,13 +897,13 @@ const Ye = ({
832
897
  }
833
898
  ),
834
899
  /* @__PURE__ */ t(
835
- M,
900
+ B,
836
901
  {
837
902
  id: h.id,
838
- handleDelete: () => m(h.id),
839
- handleView: () => c(h),
903
+ handleDelete: () => x(h.id),
904
+ handleView: () => a(h),
840
905
  children: /* @__PURE__ */ t(
841
- Y,
906
+ te,
842
907
  {
843
908
  decision: h,
844
909
  textValues: e
@@ -850,8 +915,8 @@ const Ye = ({
850
915
  },
851
916
  h.id
852
917
  ) }, h.id)),
853
- (n.length === 0 || n.length < Math.floor(window.innerWidth / 300)) && !u && /* @__PURE__ */ t(W, { children: /* @__PURE__ */ p(
854
- l,
918
+ (r.length === 0 || r.length < Math.floor(window.innerWidth / 300)) && !c && /* @__PURE__ */ t(re, { children: /* @__PURE__ */ p(
919
+ s,
855
920
  {
856
921
  direction: "column",
857
922
  gap: "4px",
@@ -859,7 +924,7 @@ const Ye = ({
859
924
  height: "100%",
860
925
  children: [
861
926
  /* @__PURE__ */ t(
862
- f,
927
+ v,
863
928
  {
864
929
  type: "title",
865
930
  size: "medium",
@@ -869,33 +934,33 @@ const Ye = ({
869
934
  }
870
935
  ),
871
936
  /* @__PURE__ */ t(
872
- Ee,
937
+ Ie,
873
938
  {
874
- onClick: () => c(),
939
+ onClick: () => a(),
875
940
  children: /* @__PURE__ */ t(
876
- M,
941
+ B,
877
942
  {
878
- id: `add-decision-${n.length}`,
943
+ id: `add-decision-${r.length}`,
879
944
  handleDelete: () => {
880
945
  },
881
- handleView: () => c(),
946
+ handleView: () => a(),
882
947
  controls: !1,
883
948
  children: /* @__PURE__ */ p(
884
- l,
949
+ s,
885
950
  {
886
951
  direction: "column",
887
952
  gap: "12px",
888
953
  alignItems: "center",
889
954
  children: [
890
955
  /* @__PURE__ */ t(
891
- F,
956
+ ie,
892
957
  {
893
958
  appearance: "gray",
894
- icon: /* @__PURE__ */ t(oe, {}),
959
+ icon: /* @__PURE__ */ t(he, {}),
895
960
  size: "35px"
896
961
  }
897
962
  ),
898
- /* @__PURE__ */ t(f, { appearance: "gray", type: "body", size: "large", children: "Agregar decisión" })
963
+ /* @__PURE__ */ t(v, { appearance: "gray", type: "body", size: "large", children: "Agregar decisión" })
899
964
  ]
900
965
  }
901
966
  )
@@ -905,27 +970,27 @@ const Ye = ({
905
970
  )
906
971
  ]
907
972
  },
908
- `add-decision-${n.length}`
909
- ) }, `add-decision-${n.length}`)
973
+ `add-decision-${r.length}`
974
+ ) }, `add-decision-${r.length}`)
910
975
  ]
911
976
  }
912
977
  )
913
978
  ] }) }) }),
914
979
  i && /* @__PURE__ */ t(
915
- we,
980
+ Ae,
916
981
  {
917
982
  portalId: "modal-portal",
918
- onCloseModal: s,
983
+ onCloseModal: l,
919
984
  title: d ? "Editar Decisión" : "Nueva decisión",
920
985
  children: /* @__PURE__ */ t(
921
- fe,
986
+ Se,
922
987
  {
923
- id: d ? d.id : `decision-${n.length + 1}`,
924
- decision: d || a,
925
- onCloseModal: s,
926
- onSubmitEvent: x,
988
+ id: d ? d.id : `Decisión ${r.length + 1}`,
989
+ decision: d || o,
990
+ onCloseModal: l,
991
+ onSubmitEvent: m,
927
992
  textValues: e,
928
- onCancel: () => s()
993
+ onCancel: () => l()
929
994
  }
930
995
  )
931
996
  }
@@ -933,9 +998,9 @@ const Ye = ({
933
998
  ] });
934
999
  };
935
1000
  export {
936
- M as BusinessRuleCard,
937
- Y as BusinessRuleView,
938
- Ye as BusinessRules,
939
- we as ModalRules,
940
- fe as RulesForm
1001
+ B as BusinessRuleCard,
1002
+ te as BusinessRuleView,
1003
+ tt as BusinessRules,
1004
+ Ae as ModalRules,
1005
+ Se as RulesForm
941
1006
  };
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "description": "",
12
12
  "private": false,
13
- "version": "0.1.22",
13
+ "version": "0.1.23",
14
14
  "type": "module",
15
15
  "exports": {
16
16
  ".": {
@@ -51,7 +51,7 @@
51
51
  "@inubekit/text": "^2.17.0",
52
52
  "@inubekit/textarea": "^2.45.0",
53
53
  "@inubekit/toggle": "^3.8.2",
54
- "@isettingkit/input": "^0.1.30",
54
+ "@isettingkit/input": "^0.1.31",
55
55
  "@isettingkit/view": "^0.1.18"
56
56
  },
57
57
  "peerDependencies": {