bmi-next 1.0.0

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 (107) hide show
  1. package/README.md +2 -0
  2. package/dist/Contratacion.module-DVSWILuV.js +26 -0
  3. package/dist/assets/Contratacion.css +1 -0
  4. package/dist/assets/constantes.css +1 -0
  5. package/dist/assets/index.css +1 -0
  6. package/dist/assets/index10.css +1 -0
  7. package/dist/assets/index11.css +1 -0
  8. package/dist/assets/index12.css +1 -0
  9. package/dist/assets/index13.css +1 -0
  10. package/dist/assets/index14.css +1 -0
  11. package/dist/assets/index15.css +1 -0
  12. package/dist/assets/index16.css +1 -0
  13. package/dist/assets/index17.css +1 -0
  14. package/dist/assets/index18.css +1 -0
  15. package/dist/assets/index19.css +1 -0
  16. package/dist/assets/index2.css +1 -0
  17. package/dist/assets/index20.css +1 -0
  18. package/dist/assets/index21.css +1 -0
  19. package/dist/assets/index22.css +1 -0
  20. package/dist/assets/index23.css +1 -0
  21. package/dist/assets/index24.css +1 -0
  22. package/dist/assets/index3.css +1 -0
  23. package/dist/assets/index4.css +1 -0
  24. package/dist/assets/index5.css +1 -0
  25. package/dist/assets/index6.css +1 -0
  26. package/dist/assets/index7.css +1 -0
  27. package/dist/assets/index8.css +1 -0
  28. package/dist/assets/index9.css +1 -0
  29. package/dist/assets/styles.css +1 -0
  30. package/dist/components/Alert/index.d.ts +64 -0
  31. package/dist/components/Alert/index.js +50 -0
  32. package/dist/components/Button/index.d.ts +37 -0
  33. package/dist/components/Button/index.js +61 -0
  34. package/dist/components/Checkbox/index.d.ts +20 -0
  35. package/dist/components/Checkbox/index.js +16 -0
  36. package/dist/components/ContratacionPage/Link.d.ts +9 -0
  37. package/dist/components/ContratacionPage/Link.js +19 -0
  38. package/dist/components/ContratacionPage/SelectorA/303/261osCobertura.d.ts +8 -0
  39. package/dist/components/ContratacionPage/SelectorA/303/261osCobertura.js +44 -0
  40. package/dist/components/ContratacionPage/Slider.d.ts +9 -0
  41. package/dist/components/ContratacionPage/Slider.js +32 -0
  42. package/dist/components/ContratacionPage/index.d.ts +24 -0
  43. package/dist/components/ContratacionPage/index.js +460 -0
  44. package/dist/components/DatePicker/index.d.ts +16 -0
  45. package/dist/components/DatePicker/index.js +169 -0
  46. package/dist/components/Drawer/index.d.ts +39 -0
  47. package/dist/components/Drawer/index.js +27 -0
  48. package/dist/components/DrawerPortal/index.d.ts +18 -0
  49. package/dist/components/DrawerPortal/index.js +92 -0
  50. package/dist/components/DrawerPortalBase/index.d.ts +16 -0
  51. package/dist/components/DrawerPortalBase/index.js +73 -0
  52. package/dist/components/ExclusionPage/constantes.d.ts +7 -0
  53. package/dist/components/ExclusionPage/constantes.js +5 -0
  54. package/dist/components/ExclusionPage/index.d.ts +14 -0
  55. package/dist/components/ExclusionPage/index.js +61 -0
  56. package/dist/components/ExclusionPage/texto.d.ts +4 -0
  57. package/dist/components/ExclusionPage/texto.js +11 -0
  58. package/dist/components/FakeLoader/index.d.ts +5 -0
  59. package/dist/components/FakeLoader/index.js +16 -0
  60. package/dist/components/FieldError/index.d.ts +19 -0
  61. package/dist/components/FieldError/index.js +11 -0
  62. package/dist/components/Input/index.d.ts +47 -0
  63. package/dist/components/Input/index.js +67 -0
  64. package/dist/components/Label/index.d.ts +23 -0
  65. package/dist/components/Label/index.js +16 -0
  66. package/dist/components/Navbar/index.d.ts +34 -0
  67. package/dist/components/Navbar/index.js +88 -0
  68. package/dist/components/PasswordVisibility/index.d.ts +28 -0
  69. package/dist/components/PasswordVisibility/index.js +14 -0
  70. package/dist/components/Popup/index.d.ts +53 -0
  71. package/dist/components/Popup/index.js +26 -0
  72. package/dist/components/Radio/index.d.ts +27 -0
  73. package/dist/components/Radio/index.js +17 -0
  74. package/dist/components/Search/index.d.ts +53 -0
  75. package/dist/components/Search/index.js +82 -0
  76. package/dist/components/Select/index.d.ts +54 -0
  77. package/dist/components/Select/index.js +98 -0
  78. package/dist/components/SelectDrawer/index.d.ts +66 -0
  79. package/dist/components/SelectDrawer/index.js +73 -0
  80. package/dist/components/Spinner/index.d.ts +1 -0
  81. package/dist/components/Spinner/index.js +8 -0
  82. package/dist/components/Steps/index.d.ts +36 -0
  83. package/dist/components/Steps/index.js +136 -0
  84. package/dist/components/TextArea/index.d.ts +37 -0
  85. package/dist/components/TextArea/index.js +64 -0
  86. package/dist/components/h1/index.d.ts +8 -0
  87. package/dist/components/h1/index.js +11 -0
  88. package/dist/components/h2/index.d.ts +8 -0
  89. package/dist/components/h2/index.js +11 -0
  90. package/dist/components/h3/index.d.ts +8 -0
  91. package/dist/components/h3/index.js +11 -0
  92. package/dist/components/h4/index.d.ts +8 -0
  93. package/dist/components/h4/index.js +11 -0
  94. package/dist/components/h5/index.d.ts +8 -0
  95. package/dist/components/h5/index.js +11 -0
  96. package/dist/components/images/index.d.ts +7 -0
  97. package/dist/components/images/index.js +5 -0
  98. package/dist/constantes-PXVssL1x.js +52 -0
  99. package/dist/hooks/useIsMobile.d.ts +20 -0
  100. package/dist/hooks/useIsMobile.js +17 -0
  101. package/dist/icons/icons.d.ts +104 -0
  102. package/dist/icons/icons.js +4216 -0
  103. package/dist/index-Cb7Kc3pQ.js +19065 -0
  104. package/dist/main.d.ts +27 -0
  105. package/dist/main.js +57 -0
  106. package/dist/styles.module-Cv_LNFFk.js +6 -0
  107. package/package.json +54 -0
@@ -0,0 +1,460 @@
1
+ import { jsxs as e, jsx as n } from "react/jsx-runtime";
2
+ import S, { useState as h, useEffect as $, useCallback as ie } from "react";
3
+ import te from "./SelectorAñosCobertura.js";
4
+ import ae from "./Slider.js";
5
+ import { s as a } from "../../Contratacion.module-DVSWILuV.js";
6
+ import { useIsMobile as re } from "../../hooks/useIsMobile.js";
7
+ import { Button as j } from "../Button/index.js";
8
+ import oe from "./Link.js";
9
+ import { Radio as _ } from "../Radio/index.js";
10
+ import { Input as le } from "../Input/index.js";
11
+ import "../../index-Cb7Kc3pQ.js";
12
+ const ce = S.createContext({}), V = !0;
13
+ function se({ baseColor: t, highlightColor: o, width: m, height: C, borderRadius: l, circle: N, direction: s, duration: g, enableAnimation: d = V, customHighlightBackground: f }) {
14
+ const c = {};
15
+ return s === "rtl" && (c["--animation-direction"] = "reverse"), typeof g == "number" && (c["--animation-duration"] = `${g}s`), d || (c["--pseudo-element-display"] = "none"), (typeof m == "string" || typeof m == "number") && (c.width = m), (typeof C == "string" || typeof C == "number") && (c.height = C), (typeof l == "string" || typeof l == "number") && (c.borderRadius = l), N && (c.borderRadius = "50%"), typeof t < "u" && (c["--base-color"] = t), typeof o < "u" && (c["--highlight-color"] = o), typeof f == "string" && (c["--custom-highlight-background"] = f), c;
16
+ }
17
+ function de({ count: t = 1, wrapper: o, className: m, containerClassName: C, containerTestId: l, circle: N = !1, style: s, ...g }) {
18
+ var d, f, c;
19
+ const E = S.useContext(ce), I = { ...g };
20
+ for (const [u, y] of Object.entries(g))
21
+ typeof y > "u" && delete I[u];
22
+ const P = {
23
+ ...E,
24
+ ...I,
25
+ circle: N
26
+ }, F = {
27
+ ...s,
28
+ ...se(P)
29
+ };
30
+ let w = "react-loading-skeleton";
31
+ m && (w += ` ${m}`);
32
+ const T = (d = P.inline) !== null && d !== void 0 ? d : !1, D = [], p = Math.ceil(t);
33
+ for (let u = 0; u < p; u++) {
34
+ let y = F;
35
+ if (p > t && u === p - 1) {
36
+ const x = (f = y.width) !== null && f !== void 0 ? f : "100%", k = t % 1, O = typeof x == "number" ? x * k : `calc(${x} * ${k})`;
37
+ y = { ...y, width: O };
38
+ }
39
+ const A = S.createElement("span", { className: w, style: y, key: u }, "‌");
40
+ T ? D.push(A) : D.push(S.createElement(
41
+ S.Fragment,
42
+ { key: u },
43
+ A,
44
+ S.createElement("br", null)
45
+ ));
46
+ }
47
+ return S.createElement("span", { className: C, "data-testid": l, "aria-live": "polite", "aria-busy": (c = P.enableAnimation) !== null && c !== void 0 ? c : V }, o ? D.map((u, y) => S.createElement(o, { key: y }, u)) : D);
48
+ }
49
+ const Ie = ({
50
+ datosUsuario: t,
51
+ datosCuestionario: o
52
+ }) => {
53
+ const [m, C] = h(0), [l, N] = h(1e5), [s, g] = h(5), [d, f] = h(!1), [c, E] = h(!1), [I, P] = h(!1), [F, w] = h(!1), [T, D] = h(), [p, u] = h(), [y, A] = h(!1), x = o.limiteInfCobertura || 5e4, k = o.limiteSupCobertura || 25e4, [O, H] = h([5, 10, 15, 20, 30]), v = re("(max-width: 1095px)");
54
+ $(() => {
55
+ if (!t.edad) return;
56
+ let i = [5, 10, 15, 20, 30];
57
+ o.limiteTermino && (i = o.limiteTermino), t.edad > 45 && (i = i.filter((r) => r !== 30)), t.edad > 55 && (i = i.filter((r) => r !== 20)), t.edad > 60 && (i = i.filter((r) => r !== 15)), t.edad > 65 && (i = i.filter((r) => r !== 10)), t.edad > 70 && (i = []), H(i);
58
+ }, [o.limiteTermino, t.edad]), $(() => {
59
+ (async () => {
60
+ A(!0);
61
+ try {
62
+ const r = await fetch(
63
+ "https://integraciones.bmivida.com/cotizador/getTasas.php",
64
+ {
65
+ method: "POST",
66
+ body: JSON.stringify({
67
+ sexo: t.sexo,
68
+ fumador: t.fumador
69
+ })
70
+ }
71
+ ), b = await r.json();
72
+ if (!r.ok)
73
+ throw new Error(b.error || "Ha ocurrido un error");
74
+ D(b.tasas), u(b.comisiones);
75
+ } catch (r) {
76
+ console.error(r);
77
+ } finally {
78
+ A(!1);
79
+ }
80
+ })();
81
+ }, [t]), $(() => {
82
+ o.limiteSupCobertura && N(o.limiteSupCobertura), o.limiteTermino && g(Math.max(...o.limiteTermino));
83
+ }, [o]), $(() => {
84
+ l < x || l > k ? P(!0) : P(!1), (!s || [5, 10, 15].includes(s)) && f(!1);
85
+ }, [
86
+ l,
87
+ s,
88
+ x,
89
+ k
90
+ ]);
91
+ const z = ie(() => {
92
+ const i = document.getElementById(
93
+ "condiciones"
94
+ ), r = document.getElementById("veracidad"), b = (i == null ? void 0 : i.checked) && (r == null ? void 0 : r.checked) && !I && m > 0 && t.edad <= 70 && t.edad >= 18;
95
+ w(b);
96
+ }, [I, m, t.edad]);
97
+ $(() => {
98
+ z();
99
+ }, [z]);
100
+ const R = z;
101
+ $(() => {
102
+ if (!T || !p) return;
103
+ const { edad: i } = t, b = (d ? T.siDev : T.noDev)[s];
104
+ if (!b)
105
+ return;
106
+ const B = b[i];
107
+ if (!B)
108
+ return;
109
+ const L = l / p.DIVISOR_MIL * B, Y = L * p.COMISION_BROKER, Z = L * p.CARGOS_ADMIN, M = L + Y + Z, U = M * p.SEGURO_CAMPESINO, ee = M * p.SUPER_BANCOS, ne = (M + U + ee) / 12;
110
+ C(ne);
111
+ }, [
112
+ o,
113
+ t,
114
+ T,
115
+ p,
116
+ l,
117
+ s,
118
+ d
119
+ ]);
120
+ const W = (i) => {
121
+ const r = parseInt(i.target.value.replace(/\D/g, ""));
122
+ isNaN(r) || N(r);
123
+ }, G = (i) => {
124
+ E(!1), N(i);
125
+ }, J = () => {
126
+ const i = document.querySelector(`.${a.adjustCard}`);
127
+ i == null || i.scrollIntoView({ behavior: "smooth" });
128
+ }, K = () => {
129
+ const i = document.querySelector(`.${a.priceCard}`);
130
+ i == null || i.scrollIntoView({ behavior: "smooth", block: "end" });
131
+ }, Q = () => {
132
+ const i = "https://integraciones.bmivida.com/placeToPay/checkout.php", r = Math.round((m + Number.EPSILON) * 100) / 100, b = d ? "si" : "no", B = `?id=${t.idUsuario}&name=${t.nombre}&surname=${t.surname}&email=${t.email}&document=${t.document}&mobile=${t.mobile}&amount=${r}&documentType=${t.documentType}&termino=${s}&sumaAsegurada=${l}&devolucionPrima=${b}`;
133
+ window.location.href = i + B;
134
+ }, X = () => {
135
+ window.location.href = "https://bmivida.com";
136
+ };
137
+ return /* @__PURE__ */ e("div", { "data-name": "contratacion", children: [
138
+ /* @__PURE__ */ e("div", { className: a.contenedorContratacion, children: [
139
+ /* @__PURE__ */ n("h1", { style: { marginTop: v ? "20px" : "75px", fontFamily: "Palanquin BMI Dark Semibold" }, children: "El mejor precio, para ti" }),
140
+ /* @__PURE__ */ n("p", { className: a.subtitle, children: "Este es el precio que hemos calculado para ti:" }),
141
+ /* @__PURE__ */ n("div", { style: { maxWidth: "1056px", margin: "0 auto" }, children: /* @__PURE__ */ e(
142
+ "div",
143
+ {
144
+ style: {
145
+ display: "flex",
146
+ flexDirection: v ? "column" : "row",
147
+ justifyContent: "center",
148
+ gap: "20px",
149
+ alignItems: v ? "center" : "flex-start"
150
+ },
151
+ children: [
152
+ /* @__PURE__ */ e(
153
+ "div",
154
+ {
155
+ className: a.priceCard,
156
+ style: {
157
+ display: "flex",
158
+ flexDirection: "column",
159
+ maxWidth: v ? "100%" : "382px"
160
+ },
161
+ children: [
162
+ y ? /* @__PURE__ */ n(
163
+ de,
164
+ {
165
+ baseColor: "#e7fff4",
166
+ highlightColor: "#77e3b2",
167
+ height: 88,
168
+ style: { marginBottom: "24px", borderRadius: "8px" }
169
+ }
170
+ ) : /* @__PURE__ */ e("div", { className: a.priceBox, children: [
171
+ /* @__PURE__ */ e("span", { className: a.priceAmount, children: [
172
+ "$",
173
+ Math.round((m + Number.EPSILON) * 100) / 100
174
+ ] }),
175
+ /* @__PURE__ */ n("span", { className: a.pricePeriod, children: "/mes" })
176
+ ] }),
177
+ /* @__PURE__ */ e("ul", { className: a.benefitsList, children: [
178
+ /* @__PURE__ */ e("li", { children: [
179
+ /* @__PURE__ */ n("div", { className: a.bulletPoint }),
180
+ /* @__PURE__ */ e("span", { children: [
181
+ "Seguro de vida a término para ",
182
+ t.nombre
183
+ ] })
184
+ ] }),
185
+ /* @__PURE__ */ e("li", { children: [
186
+ /* @__PURE__ */ n("div", { className: a.bulletPoint }),
187
+ /* @__PURE__ */ e("span", { children: [
188
+ l.toLocaleString("es-US", {
189
+ style: "currency",
190
+ currency: "USD",
191
+ minimumFractionDigits: 0,
192
+ maximumFractionDigits: 0
193
+ }),
194
+ " ",
195
+ "de cobertura"
196
+ ] })
197
+ ] }),
198
+ s && /* @__PURE__ */ e("li", { children: [
199
+ /* @__PURE__ */ n("div", { className: a.bulletPoint }),
200
+ /* @__PURE__ */ e("span", { children: [
201
+ "Término a ",
202
+ s,
203
+ " años"
204
+ ] })
205
+ ] }),
206
+ d && /* @__PURE__ */ e("li", { children: [
207
+ /* @__PURE__ */ n("div", { className: a.bulletPoint }),
208
+ /* @__PURE__ */ n("span", { children: "Devolución de prima" })
209
+ ] })
210
+ ] }),
211
+ /* @__PURE__ */ e("div", { className: a.containerCheckbox, children: [
212
+ /* @__PURE__ */ e("label", { children: [
213
+ /* @__PURE__ */ n(
214
+ "input",
215
+ {
216
+ type: "checkbox",
217
+ name: "condiciones",
218
+ id: "condiciones",
219
+ onChange: R
220
+ }
221
+ ),
222
+ /* @__PURE__ */ e("span", { children: [
223
+ "He leído y acepto las",
224
+ " ",
225
+ /* @__PURE__ */ n(
226
+ "a",
227
+ {
228
+ href: "https://bmivida.com/terminos-y-condiciones/",
229
+ target: "_blank",
230
+ children: "Condiciones de contratación del plan"
231
+ }
232
+ )
233
+ ] })
234
+ ] }),
235
+ /* @__PURE__ */ e("label", { children: [
236
+ /* @__PURE__ */ n(
237
+ "input",
238
+ {
239
+ type: "checkbox",
240
+ name: "veracidad",
241
+ id: "veracidad",
242
+ onChange: R
243
+ }
244
+ ),
245
+ /* @__PURE__ */ n("span", { children: "Como persona asegurada he contestado de forma veraz y detalladamente a cada pregunta de salud. Entiendo que no declarar todos mis antecedentes médicos podrá suponer la pérdida del derecho a la indemnización en caso de siniestro, incluso cuando la causa directa del siniestro no tenga relación con la misma." })
246
+ ] })
247
+ ] }),
248
+ /* @__PURE__ */ n(
249
+ "span",
250
+ {
251
+ onClick: J,
252
+ className: a.customizeLink,
253
+ style: { display: v ? "block" : "none" },
254
+ children: "Personaliza tu cobertura"
255
+ }
256
+ ),
257
+ /* @__PURE__ */ n(
258
+ j,
259
+ {
260
+ disabled: !F,
261
+ variant: "primary",
262
+ onClick: Q,
263
+ children: "Activar cobertura"
264
+ }
265
+ ),
266
+ /* @__PURE__ */ n(
267
+ "a",
268
+ {
269
+ href: "#",
270
+ onClick: X,
271
+ style: {
272
+ textAlign: "center",
273
+ fontSize: "16px",
274
+ margin: "4px auto"
275
+ },
276
+ children: "Activaré en otro momento"
277
+ }
278
+ )
279
+ ]
280
+ }
281
+ ),
282
+ /* @__PURE__ */ n(
283
+ "div",
284
+ {
285
+ className: `${a.flexColumn} ${a.gap10}`,
286
+ style: { padding: "0", margin: "0", maxWidth: v ? "100%" : "654px" },
287
+ children: /* @__PURE__ */ e("div", { className: a.adjustCard, children: [
288
+ /* @__PURE__ */ n("h1", { style: { fontSize: "32px", lineHeight: "36px", margin: "0" }, children: "Ajusta tu póliza" }),
289
+ /* @__PURE__ */ e("div", { children: [
290
+ /* @__PURE__ */ e(
291
+ "p",
292
+ {
293
+ style: { fontSize: "25px", lineHeight: "30px", fontWeight: "bold", margin: "0" },
294
+ children: [
295
+ "Cobertura:",
296
+ " ",
297
+ l.toLocaleString("es-US", {
298
+ style: "currency",
299
+ currency: "USD",
300
+ minimumFractionDigits: 0,
301
+ maximumFractionDigits: 0
302
+ })
303
+ ]
304
+ }
305
+ ),
306
+ /* @__PURE__ */ n(
307
+ ae,
308
+ {
309
+ cobertura: l,
310
+ setCobertura: G,
311
+ limiteInferior: x,
312
+ limiteSuperior: k
313
+ }
314
+ ),
315
+ /* @__PURE__ */ e(
316
+ oe,
317
+ {
318
+ handleClick: () => E(!0),
319
+ style: { margin: "10px 0" },
320
+ children: [
321
+ "Quiero otro monto",
322
+ " "
323
+ ]
324
+ }
325
+ ),
326
+ c && /* @__PURE__ */ n(
327
+ "div",
328
+ {
329
+ style: {
330
+ marginTop: "4px",
331
+ display: "flex",
332
+ alignItems: "center"
333
+ },
334
+ children: /* @__PURE__ */ n(
335
+ le,
336
+ {
337
+ value: "$" + l.toLocaleString("es-US", {
338
+ minimumFractionDigits: 0,
339
+ maximumFractionDigits: 0
340
+ }),
341
+ type: "text",
342
+ onChange: W,
343
+ placeholder: "Ingresa el valor de la cobertura"
344
+ }
345
+ )
346
+ }
347
+ ),
348
+ I && /* @__PURE__ */ e("div", { style: me, children: [
349
+ "Debes seleccionar una cantidad entre",
350
+ " ",
351
+ x,
352
+ " y ",
353
+ k
354
+ ] })
355
+ ] }),
356
+ /* @__PURE__ */ n("p", { style: { ...pe }, children: "Te recomendamos seleccionar un monto que cubra las responsabilidades financieras de tu familia, como por ejemplo una hipoteca o la universidad." }),
357
+ /* @__PURE__ */ e("div", { children: [
358
+ /* @__PURE__ */ n("h3", { style: q, children: "Años de cobertura" }),
359
+ /* @__PURE__ */ n(
360
+ te,
361
+ {
362
+ devolucionPrima: d,
363
+ añosCobertura: s,
364
+ setAñosCobertura: g,
365
+ terminos: O
366
+ }
367
+ )
368
+ ] }),
369
+ s && ![5, 10, 15].includes(s) && /* @__PURE__ */ e("div", { children: [
370
+ /* @__PURE__ */ n("h3", { style: q, children: "Devolución de prima" }),
371
+ /* @__PURE__ */ e(
372
+ "div",
373
+ {
374
+ className: `${v ? a.flexColumn : a.flexRow} ${a.gap10}`,
375
+ style: { width: "100%" },
376
+ children: [
377
+ /* @__PURE__ */ n(
378
+ _,
379
+ {
380
+ label: "Sí",
381
+ name: "devolucionPrima",
382
+ checked: d,
383
+ onChange: () => f(!0)
384
+ }
385
+ ),
386
+ /* @__PURE__ */ n(
387
+ _,
388
+ {
389
+ label: "No",
390
+ name: "devolucionPrima",
391
+ checked: !d,
392
+ onChange: () => f(!1)
393
+ }
394
+ )
395
+ ]
396
+ }
397
+ )
398
+ ] })
399
+ ] })
400
+ }
401
+ )
402
+ ]
403
+ }
404
+ ) })
405
+ ] }),
406
+ v && /* @__PURE__ */ e("footer", { className: a.resumen, children: [
407
+ /* @__PURE__ */ e("section", { children: [
408
+ /* @__PURE__ */ e("div", { children: [
409
+ /* @__PURE__ */ n("span", { style: { fontSize: "17px" }, children: "Tu precio:" }),
410
+ /* @__PURE__ */ e("span", { children: [
411
+ /* @__PURE__ */ e("span", { style: { lineHeight: 1 }, className: a.priceAmount, children: [
412
+ "$",
413
+ Math.round((m + Number.EPSILON) * 100) / 100
414
+ ] }),
415
+ /* @__PURE__ */ n("span", { className: a.pricePeriod, children: "/mes" })
416
+ ] })
417
+ ] }),
418
+ /* @__PURE__ */ e("div", { children: [
419
+ /* @__PURE__ */ e("span", { className: a.datoResumen, children: [
420
+ "Cobertura:",
421
+ " ",
422
+ /* @__PURE__ */ e("span", { children: [
423
+ l.toLocaleString("es-US", {
424
+ style: "currency",
425
+ currency: "USD",
426
+ minimumFractionDigits: 0,
427
+ maximumFractionDigits: 0
428
+ }),
429
+ " "
430
+ ] })
431
+ ] }),
432
+ /* @__PURE__ */ e("span", { className: a.datoResumen, children: [
433
+ "Término: ",
434
+ /* @__PURE__ */ e("span", { children: [
435
+ s,
436
+ " años"
437
+ ] })
438
+ ] }),
439
+ /* @__PURE__ */ n("span", { className: a.datoResumen, children: /* @__PURE__ */ n("span", { children: d ? "Devolución de prima" : "Sin devolución de prima" }) })
440
+ ] })
441
+ ] }),
442
+ /* @__PURE__ */ n(j, { variant: "secondary", onClick: K, children: "Volver para confirmar cobertura" })
443
+ ] })
444
+ ] });
445
+ }, me = {
446
+ display: "flex",
447
+ alignItems: "center",
448
+ gap: "4px",
449
+ marginTop: "8px",
450
+ color: "#d90000"
451
+ }, pe = { fontSize: "19px", opacity: 0.75, margin: 0 }, q = {
452
+ margin: "10px",
453
+ marginLeft: "0",
454
+ fontSize: "25px",
455
+ lineHeight: "30px",
456
+ fontWeight: "bold"
457
+ };
458
+ export {
459
+ Ie as ContratacionPage
460
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Props para el componente SelectDrawer
3
+ * @interface SelectDrawerProps
4
+ */
5
+ interface DatePickerProps {
6
+ /** Texto del título que se muestra en la parte superior del cajón */
7
+ title: string;
8
+ /** Texto del botón que se muestra en la parte inferior del cajón */
9
+ buttonText: string;
10
+ /** La fecha actualmente seleccionada */
11
+ selected: Date;
12
+ /** Función callback para actualizar la fecha seleccionada */
13
+ setSelected: (selected: Date) => void;
14
+ }
15
+ export declare function DatePicker({ title, buttonText, selected, setSelected }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,169 @@
1
+ import { jsxs as l, Fragment as F, jsx as n } from "react/jsx-runtime";
2
+ import { Icon as j } from "../../icons/icons.js";
3
+ import { useState as s, useRef as k, useEffect as m } from "react";
4
+ import { Button as E } from "../Button/index.js";
5
+ import { Input as J } from "../Input/index.js";
6
+ import '../../assets/index18.css';const q = "_overlay_pyf74_1", z = "_closing_pyf74_12", G = "_bottomDrawer_pyf74_16", K = "_drawerHeader_pyf74_34", L = "_drawerIndicator_pyf74_46", Q = "_dateButton_pyf74_53", U = "_drawerContent_pyf74_69", V = "_closeButton_pyf74_78", W = "_pickerContainer_pyf74_98", X = "_topFade_pyf74_134", Z = "_bottomFade_pyf74_150", ee = "_pickerColumn_pyf74_165", te = "_pickerItem_pyf74_199", oe = "_selected_pyf74_226", ne = "_confirmButton_pyf74_250", t = {
7
+ overlay: q,
8
+ closing: z,
9
+ bottomDrawer: G,
10
+ drawerHeader: K,
11
+ drawerIndicator: L,
12
+ dateButton: Q,
13
+ drawerContent: U,
14
+ closeButton: V,
15
+ pickerContainer: W,
16
+ topFade: X,
17
+ bottomFade: Z,
18
+ pickerColumn: ee,
19
+ pickerItem: te,
20
+ selected: oe,
21
+ confirmButton: ne
22
+ }, re = ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"];
23
+ function de({ title: S, buttonText: $, selected: r, setSelected: M }) {
24
+ const [p, w] = s(!1), [N, I] = s(!1), [a, b] = s(r.getMonth()), [c, B] = s(r.getFullYear()), [i, _] = s(r.getDate()), [h, Y] = s([]), [y, x] = s([]), D = k(null), C = k(null), g = k(null), d = () => {
25
+ requestAnimationFrame(() => {
26
+ if (D.current) {
27
+ const e = h.findIndex((o) => o.getDate() === i);
28
+ if (e !== -1) {
29
+ const o = e * 44;
30
+ D.current.scrollTo({
31
+ top: o,
32
+ behavior: "smooth"
33
+ });
34
+ }
35
+ }
36
+ if (C.current) {
37
+ const e = a * 44;
38
+ C.current.scrollTo({
39
+ top: e,
40
+ behavior: "smooth"
41
+ });
42
+ }
43
+ if (g.current) {
44
+ const e = y.indexOf(c);
45
+ if (e !== -1) {
46
+ const o = e * 44;
47
+ g.current.scrollTo({
48
+ top: o,
49
+ behavior: "smooth"
50
+ });
51
+ }
52
+ }
53
+ });
54
+ };
55
+ m(() => {
56
+ p && (b(r.getMonth()), B(r.getFullYear()), _(r.getDate()), d());
57
+ }, [p, r]), m(() => {
58
+ const e = (/* @__PURE__ */ new Date()).getFullYear(), o = Array.from({ length: 100 }, (f, u) => e - 99 + u);
59
+ x(o);
60
+ }, []), m(() => {
61
+ const e = [], o = new Date(c, a, 1), f = new Date(c, a + 1, 0).getDate();
62
+ for (let u = 1; u <= f; u++)
63
+ e.push(new Date(o)), o.setDate(o.getDate() + 1);
64
+ Y(e), i > f && _(f);
65
+ }, [a, c, i]), m(() => {
66
+ p && d();
67
+ }, [i, a, c, h, y]);
68
+ const A = (e) => {
69
+ _(e.getDate()), d();
70
+ }, O = (e) => {
71
+ b(e), d();
72
+ }, T = (e) => {
73
+ B(e), d();
74
+ }, v = () => {
75
+ I(!0), setTimeout(() => {
76
+ w(!1), I(!1);
77
+ }, 300);
78
+ }, H = () => {
79
+ const e = new Date(c, a, i);
80
+ M(e), v();
81
+ }, P = (e) => `${e.getDate()}`, R = (e) => e.toISOString().split("T")[0];
82
+ return m(() => {
83
+ console.log(r);
84
+ }, [r]), /* @__PURE__ */ l(F, { children: [
85
+ /* @__PURE__ */ n(
86
+ J,
87
+ {
88
+ type: "date",
89
+ className: t.dateButton,
90
+ onClick: () => w(!0),
91
+ value: R(r)
92
+ }
93
+ ),
94
+ p && /* @__PURE__ */ l(F, { children: [
95
+ /* @__PURE__ */ n("div", { className: `${t.overlay} ${N ? t.closing : ""}`, onClick: v }),
96
+ /* @__PURE__ */ l(
97
+ "div",
98
+ {
99
+ className: `${t.bottomDrawer} ${N ? t.closing : ""}`,
100
+ children: [
101
+ /* @__PURE__ */ l("div", { className: t.drawerHeader, children: [
102
+ /* @__PURE__ */ n("div", { className: t.drawerIndicator }),
103
+ /* @__PURE__ */ n("div", { className: t.closeButton, onClick: v, children: /* @__PURE__ */ n(j, { name: "Close", fill: "#030c2466" }) })
104
+ ] }),
105
+ /* @__PURE__ */ l("div", { className: t.drawerContent, children: [
106
+ /* @__PURE__ */ n("p", { children: S }),
107
+ /* @__PURE__ */ l("div", { className: t.pickerContainer, children: [
108
+ /* @__PURE__ */ n("div", { className: t.topFade }),
109
+ /* @__PURE__ */ n("div", { className: t.bottomFade }),
110
+ /* @__PURE__ */ n(
111
+ "div",
112
+ {
113
+ ref: D,
114
+ className: t.pickerColumn,
115
+ children: h.map((e, o) => /* @__PURE__ */ n(
116
+ "div",
117
+ {
118
+ className: `${t.pickerItem} ${e.getDate() === i ? t.selected : ""}`,
119
+ onClick: () => A(e),
120
+ children: P(e)
121
+ },
122
+ o
123
+ ))
124
+ }
125
+ ),
126
+ /* @__PURE__ */ n(
127
+ "div",
128
+ {
129
+ ref: C,
130
+ className: t.pickerColumn,
131
+ children: re.map((e, o) => /* @__PURE__ */ n(
132
+ "div",
133
+ {
134
+ className: `${t.pickerItem} ${o === a ? t.selected : ""}`,
135
+ onClick: () => O(o),
136
+ children: e
137
+ },
138
+ e
139
+ ))
140
+ }
141
+ ),
142
+ /* @__PURE__ */ n(
143
+ "div",
144
+ {
145
+ ref: g,
146
+ className: t.pickerColumn,
147
+ children: y.map((e) => /* @__PURE__ */ n(
148
+ "div",
149
+ {
150
+ className: `${t.pickerItem} ${e === c ? t.selected : ""}`,
151
+ onClick: () => T(e),
152
+ children: e
153
+ },
154
+ e
155
+ ))
156
+ }
157
+ )
158
+ ] }),
159
+ /* @__PURE__ */ n(E, { className: t.confirmButton, variant: "secondary", onClick: H, children: $ })
160
+ ] })
161
+ ]
162
+ }
163
+ )
164
+ ] })
165
+ ] });
166
+ }
167
+ export {
168
+ de as DatePicker
169
+ };
@@ -0,0 +1,39 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Props para el componente Drawer
4
+ * @interface DrawerProps
5
+ */
6
+ export interface DrawerProps {
7
+ /** Indica si el drawer está abierto */
8
+ isOpen: boolean;
9
+ /** Función para cerrar el drawer */
10
+ onClose: () => void;
11
+ /** Título que se muestra en la parte superior del drawer */
12
+ title?: string;
13
+ /** Contenido del drawer */
14
+ children: ReactNode;
15
+ }
16
+ /**
17
+ * Un componente de drawer que se abre desde la parte inferior de la pantalla
18
+ *
19
+ * @component
20
+ * @example
21
+ * ```tsx
22
+ * const [isOpen, setIsOpen] = useState(false);
23
+ *
24
+ * <Drawer
25
+ * isOpen={isOpen}
26
+ * onClose={() => setIsOpen(false)}
27
+ * title="Mi Drawer"
28
+ * >
29
+ * <div>Contenido del drawer</div>
30
+ * </Drawer>
31
+ * ```
32
+ *
33
+ * Características:
34
+ * - Interfaz de cajón inferior optimizada para móviles
35
+ * - Cajón arrastrable con cierre al arrastrar hacia abajo
36
+ * - Previene el desplazamiento del fondo cuando está abierto
37
+ * - Animaciones suaves de entrada y salida
38
+ */
39
+ export declare function Drawer({ isOpen, onClose, title, children }: DrawerProps): import("react/jsx-runtime").JSX.Element;