@isettingkit/business-rules 0.1.29 → 0.1.30

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