@getcredify/credify-insurance-widget 1.41.1 → 1.42.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 (65) hide show
  1. package/README.md +91 -0
  2. package/dist/address-BEVwov8q-C8G87tij.js +59 -0
  3. package/dist/api-C7f0dnt7.js +51 -0
  4. package/dist/car-B0hJrE0Z.js +26 -0
  5. package/dist/check-Dfh9u4c0.js +15 -0
  6. package/dist/copy-applicant-offer-B-BIN2o5-BX-QE7Ao.js +56 -0
  7. package/dist/copy-from-record-BNP6CFFR-Bcb9EW-a.js +189 -0
  8. package/dist/core-Po4qPIof-fZL0sXdW.js +417 -0
  9. package/dist/coverageDerivation-CV2ORogj-CAthw76f.js +76 -0
  10. package/dist/credify-insurance-widget.css +1 -1
  11. package/dist/{fixtures-ijbZ16Zg-BfdDTLYu.js → fixtures-ijbZ16Zg-Csnryzo8.js} +1 -1
  12. package/dist/household-prefill-DVLBBva1-GGgzEdDL.js +151 -0
  13. package/dist/householdPrefill-DLm3pxFH-B34UGBGP.js +111 -0
  14. package/dist/iframe/assets/address-BEVwov8q-BpbNiia-.js +1 -0
  15. package/dist/iframe/assets/car-DkfXVYz0.js +6 -0
  16. package/dist/iframe/assets/check-l6TGSrXO.js +6 -0
  17. package/dist/iframe/assets/copy-applicant-offer-B-BIN2o5-cs-SCWuH.js +1 -0
  18. package/dist/iframe/assets/copy-from-record-BNP6CFFR-BtCRUQRw.js +6 -0
  19. package/dist/iframe/assets/core-Po4qPIof-jDmdAxP7.js +16 -0
  20. package/dist/iframe/assets/coverageDerivation-CV2ORogj-DhQFAhwv.js +1 -0
  21. package/dist/iframe/assets/dob-calendar-RIJ5S6YU-DO_r0-z3.js +1 -0
  22. package/dist/iframe/assets/{fixtures-ijbZ16Zg-DbpkZfa3.js → fixtures-ijbZ16Zg-CUQxYANz.js} +1 -1
  23. package/dist/iframe/assets/household-prefill-DVLBBva1-DTK1EHT0.js +1 -0
  24. package/dist/iframe/assets/householdPrefill-DLm3pxFH-BM54Rqyd.js +6 -0
  25. package/dist/iframe/assets/iframe-BImWklE9.js +107 -0
  26. package/dist/iframe/assets/iframe-Bl0qTZgO.css +1 -0
  27. package/dist/iframe/assets/index-CNb9AhPB.js +6 -0
  28. package/dist/iframe/assets/intake-review-panel-B7rXvRvm-wNGntinn.js +1 -0
  29. package/dist/iframe/assets/{mockJump-CL8w249w-Bp9W72n5.js → mockJump-DpXrnQUq-DKyp2H5R.js} +1 -1
  30. package/dist/iframe/assets/payload-JXpCaeS6-CcfrGvLo.js +1 -0
  31. package/dist/iframe/assets/question-list-ChcBzofd-D5ZVofFR.js +317 -0
  32. package/dist/iframe/assets/rates-panel-BaIzEqX6-GSsykLkc.js +17 -0
  33. package/dist/iframe/assets/review-panel-DYCuhwdo-CyBebe6T.js +6 -0
  34. package/dist/iframe/assets/stage-Bpq1A5xB-CwZgWOhp.js +1 -0
  35. package/dist/iframe/assets/types-LUGvo5ic-CB-wcgK3.js +1 -0
  36. package/dist/iframe/assets/validation-DRqHT-u7-pY2KjHw4.js +3 -0
  37. package/dist/iframe/assets/vehicleCoverage-BPJaWQyg-DBJ_jL3e.js +1 -0
  38. package/dist/iframe/assets/visibility-hEdBjgi7-_AUGO8E2.js +1 -0
  39. package/dist/iframe/iframe.html +2 -2
  40. package/dist/index-CQXR1Un8.js +354 -0
  41. package/dist/index.d.ts +16 -0
  42. package/dist/index.es.js +4 -4
  43. package/dist/index.umd.js +105 -115
  44. package/dist/intake-review-panel-B7rXvRvm-CDyR-rVg.js +186 -0
  45. package/dist/{mockJump-CL8w249w-1jjBaNyK.js → mockJump-DpXrnQUq-BaitU9aZ.js} +1 -1
  46. package/dist/payload-JXpCaeS6-pjITtvlm.js +128 -0
  47. package/dist/question-list-ChcBzofd-fVRN9fTl.js +6505 -0
  48. package/dist/rates-panel-BaIzEqX6-BULjKxqz.js +1001 -0
  49. package/dist/review-panel-DYCuhwdo-BImR4S06.js +903 -0
  50. package/dist/stage-Bpq1A5xB-Cphc07aC.js +197 -0
  51. package/dist/types-LUGvo5ic-CiVRcsV9.js +9 -0
  52. package/dist/utils/assets.d.ts +12 -0
  53. package/dist/utils/branding.d.ts +21 -0
  54. package/dist/utils/partner.d.ts +32 -0
  55. package/dist/utils/support/bland.d.ts +5 -0
  56. package/dist/validation-DRqHT-u7-CL2m7f4k.js +2852 -0
  57. package/dist/vehicleCoverage-BPJaWQyg-g7bBFmro.js +144 -0
  58. package/dist/visibility-hEdBjgi7-WW4BVjmf.js +198 -0
  59. package/dist/widget-BUAzkBEK.js +13061 -0
  60. package/package.json +2 -2
  61. package/dist/api-Cjj6Dfhg.js +0 -51
  62. package/dist/iframe/assets/dob-calendar-RIJ5S6YU-DMJbmHdB.js +0 -1
  63. package/dist/iframe/assets/iframe-DFqQdMHv.css +0 -1
  64. package/dist/iframe/assets/iframe-iPSy7w5L.js +0 -494
  65. package/dist/widget-Umfy69_M.js +0 -27318
@@ -0,0 +1,186 @@
1
+ import { t as V, J as j, R as w, U as h, G as q, X as S, Z as $ } from "./widget-BUAzkBEK.js";
2
+ import { t as z } from "./question-list-ChcBzofd-fVRN9fTl.js";
3
+ import { S as D, w as L, D as M, x as N, P as U } from "./review-panel-DYCuhwdo-BImR4S06.js";
4
+ import { o as _, n as A, r as G } from "./stage-Bpq1A5xB-Cphc07aC.js";
5
+ import { useState as k, useMemo as g, useCallback as H } from "react";
6
+ import { jsxs as t, jsx as s, Fragment as J } from "react/jsx-runtime";
7
+ import { C as W } from "./check-Dfh9u4c0.js";
8
+ (function() {
9
+ if (typeof a > "u")
10
+ var a = { env: {} };
11
+ })();
12
+ var de = /* @__PURE__ */ V({ IntakeReviewPanel: () => Z }), C = (a) => `${a} ${a === 1 ? "answer needs" : "answers need"} your attention`, X = ({ label: a, open: r, onClick: i }) => /* @__PURE__ */ t("button", {
13
+ type: "button",
14
+ onClick: i,
15
+ "aria-expanded": r,
16
+ "aria-label": r ? `Done editing ${a}` : `Edit ${a}`,
17
+ className: h("cds-inline-flex cds-items-center cds-gap-1 cds-rounded cds-px-2 cds-py-1 cds-text-xs cds-font-semibold cds-text-fg hover:cds-bg-highlight", q),
18
+ children: [s(r ? W : U, {
19
+ "aria-hidden": "true",
20
+ className: "cds-h-3.5 cds-w-3.5"
21
+ }), r ? "Done" : "Edit"]
22
+ }), Z = ({ stages: a, questionsByStage: r, values: i, quoteId: K, loading: f, busy: o, error: P, suppressedKeys: c, onPatch: I, onConfirm: E }) => {
23
+ let [B, p] = k(null), [b, F] = k(!1), y = g(() => a.filter((e) => !j.has(e)), [a]), l = g(() => y.map((e) => {
24
+ let d = r[e] ?? [];
25
+ return {
26
+ stage: e,
27
+ questions: d,
28
+ rows: G({
29
+ questions: d,
30
+ values: i,
31
+ stageKey: e,
32
+ suppressedKeys: c
33
+ }),
34
+ groups: A({
35
+ questions: d,
36
+ values: i,
37
+ stageKey: e,
38
+ suppressedKeys: c
39
+ }),
40
+ validation: _({
41
+ questions: d,
42
+ values: i,
43
+ stageKey: e
44
+ })
45
+ };
46
+ }), [
47
+ y,
48
+ r,
49
+ i,
50
+ c
51
+ ]), x = g(() => l.filter((e) => !e.validation.isValid), [l]), m = x.reduce((e, d) => e + d.validation.issues.length, 0), R = H((e) => {
52
+ p(e), requestAnimationFrame(() => {
53
+ document.getElementById(`intake-review-${e}`)?.scrollIntoView?.({
54
+ behavior: "smooth",
55
+ block: "start"
56
+ });
57
+ });
58
+ }, []), T = !f && !o && m === 0 && b;
59
+ return f ? /* @__PURE__ */ t("div", {
60
+ className: "cds-py-12 cds-text-center",
61
+ "aria-live": "polite",
62
+ children: [/* @__PURE__ */ s("div", {
63
+ className: "cds-mx-auto cds-mb-4 cds-h-8 cds-w-8 cds-animate-spin cds-rounded-full cds-border-4 cds-border-accent cds-border-t-transparent",
64
+ "aria-hidden": "true"
65
+ }), /* @__PURE__ */ s("p", {
66
+ className: "cds-text-fg-muted",
67
+ children: "Loading your details…"
68
+ })]
69
+ }) : /* @__PURE__ */ t("div", {
70
+ className: "cds-py-2",
71
+ children: [
72
+ /* @__PURE__ */ s("h2", {
73
+ className: "cds-mb-1 cds-text-2xl cds-font-bold cds-text-fg",
74
+ children: "Review your information"
75
+ }),
76
+ /* @__PURE__ */ s("p", {
77
+ className: "cds-mb-5 cds-text-sm cds-text-fg-muted",
78
+ children: "Here's what we took down during your call. Check each section, fix anything we got wrong, and fill in anything missing — then confirm below to see your quotes."
79
+ }),
80
+ m ? /* @__PURE__ */ t("div", {
81
+ className: "cds-mb-5 cds-rounded-xl cds-border cds-border-warning cds-bg-warning-surface cds-p-4",
82
+ children: [/* @__PURE__ */ s("h3", {
83
+ className: "cds-mb-2 cds-text-sm cds-font-bold cds-text-fg",
84
+ children: C(m)
85
+ }), /* @__PURE__ */ s("ul", {
86
+ className: "cds-space-y-1 cds-text-sm cds-text-fg-muted",
87
+ children: x.map((e) => /* @__PURE__ */ t("li", { children: [
88
+ /* @__PURE__ */ s("button", {
89
+ type: "button",
90
+ onClick: () => R(e.stage),
91
+ className: h("cds-font-semibold cds-text-fg cds-underline", q),
92
+ children: w(e.stage).short
93
+ }),
94
+ ": ",
95
+ e.validation.issues[0],
96
+ e.validation.issues.length > 1 ? ` (+${e.validation.issues.length - 1} more)` : ""
97
+ ] }, e.stage))
98
+ })]
99
+ }) : null,
100
+ l.map((e) => {
101
+ let d = w(e.stage).short, n = B === e.stage, u = !e.validation.isValid;
102
+ return !n && !e.rows.length && !e.groups.length && !u ? null : /* @__PURE__ */ t("section", {
103
+ id: `intake-review-${e.stage}`,
104
+ className: h(N, u && "cds-border-warning"),
105
+ children: [/* @__PURE__ */ t("div", {
106
+ className: "cds-mb-2 cds-flex cds-items-center cds-justify-between",
107
+ children: [/* @__PURE__ */ s("h3", {
108
+ className: D,
109
+ children: d
110
+ }), /* @__PURE__ */ s(X, {
111
+ label: d,
112
+ open: n,
113
+ onClick: () => p(n ? null : e.stage)
114
+ })]
115
+ }), n ? /* @__PURE__ */ s(z, {
116
+ questions: e.questions,
117
+ values: i,
118
+ errors: e.validation.errorsByKey,
119
+ itemErrors: e.validation.itemErrors,
120
+ stageKey: e.stage,
121
+ quoteId: K,
122
+ suppressedKeys: c,
123
+ onPatch: I
124
+ }) : /* @__PURE__ */ t(J, { children: [
125
+ u ? /* @__PURE__ */ s("p", {
126
+ className: "cds-mb-2 cds-text-sm cds-font-semibold cds-text-warning-foreground",
127
+ children: C(e.validation.issues.length)
128
+ }) : null,
129
+ e.rows.length ? /* @__PURE__ */ s(L, { rows: e.rows }) : null,
130
+ e.groups.map((v) => /* @__PURE__ */ s(M, { group: v }, v.groupKey))
131
+ ] })]
132
+ }, e.stage);
133
+ }),
134
+ /* @__PURE__ */ t("section", {
135
+ className: N,
136
+ children: [/* @__PURE__ */ t("label", {
137
+ className: "cds-flex cds-cursor-pointer cds-items-start cds-gap-2 cds-text-sm cds-text-fg-muted",
138
+ children: [/* @__PURE__ */ s("input", {
139
+ type: "checkbox",
140
+ checked: b,
141
+ disabled: o,
142
+ onChange: (e) => F(e.target.checked),
143
+ className: "cds-mt-1 cds-h-4 cds-w-4 cds-shrink-0 cds-accent-brand-accent"
144
+ }), /* @__PURE__ */ s("span", { children: "I have reviewed my information and confirm it is accurate, and I agree to the Terms of Service and Privacy Policy." })]
145
+ }), /* @__PURE__ */ t("p", {
146
+ className: "cds-mt-3 cds-text-xs cds-leading-relaxed cds-text-fg-muted",
147
+ children: [
148
+ "Credify Corporation – Texas #3309669.",
149
+ " ",
150
+ /* @__PURE__ */ s("a", {
151
+ href: "/privacy-policy",
152
+ target: "_blank",
153
+ rel: "noreferrer",
154
+ className: "cds-font-semibold cds-text-fg cds-underline",
155
+ children: "Privacy Policy"
156
+ }),
157
+ " ",
158
+ "|",
159
+ " ",
160
+ /* @__PURE__ */ s("a", {
161
+ href: "/terms-of-service",
162
+ target: "_blank",
163
+ rel: "noreferrer",
164
+ className: "cds-font-semibold cds-text-fg cds-underline",
165
+ children: "Terms of Service"
166
+ })
167
+ ]
168
+ })]
169
+ }),
170
+ /* @__PURE__ */ s(S, { message: P }),
171
+ /* @__PURE__ */ s($, {
172
+ disabled: !T,
173
+ onClick: E,
174
+ children: o ? "Submitting…" : "Confirm & see my quotes"
175
+ }),
176
+ /* @__PURE__ */ s("p", {
177
+ className: "cds-mt-3 cds-text-xs cds-text-fg-muted",
178
+ children: "Submitting runs a soft credit inquiry with the carriers you authorized. It does not affect your credit score."
179
+ })
180
+ ]
181
+ });
182
+ };
183
+ export {
184
+ de as n,
185
+ Z as t
186
+ };
@@ -1,4 +1,4 @@
1
- import { f as o } from "./widget-Umfy69_M.js";
1
+ import { f as o } from "./widget-BUAzkBEK.js";
2
2
  (function() {
3
3
  if (typeof t > "u")
4
4
  var t = { env: {} };
@@ -0,0 +1,128 @@
1
+ import { t as E, u as d, F as w } from "./widget-BUAzkBEK.js";
2
+ import { n as c, t as f } from "./types-LUGvo5ic-CiVRcsV9.js";
3
+ import { t as M, n as N } from "./address-BEVwov8q-C8G87tij.js";
4
+ (function() {
5
+ if (typeof t > "u")
6
+ var t = { env: {} };
7
+ })();
8
+ var z = /* @__PURE__ */ E({
9
+ REPEATABLE_GROUP_KEYS: () => h,
10
+ fromQuoteRecord: () => g,
11
+ normalizeEducationLevelValue: () => v,
12
+ normalizeIndustryValue: () => b,
13
+ normalizeOccupationValue: () => A,
14
+ toQuotePayload: () => j
15
+ }), p = 21474836, y = /* @__PURE__ */ new Set(["sale_price_cents"]), h = [
16
+ "drivers",
17
+ "vehicles",
18
+ "losses",
19
+ "home_losses",
20
+ "driver_violations",
21
+ "driver_accidents"
22
+ ], L = (t) => t === "Yes" || t !== "No" && t, P = (t) => t === !0 ? "Yes" : t === !1 ? "No" : t, x = (t) => {
23
+ if (typeof t != "number" || !Number.isFinite(t)) return t;
24
+ let e = Math.trunc(t);
25
+ return e < 1 ? t : Math.min(e, p) * 100;
26
+ }, m = (t, e) => {
27
+ if (typeof t != "string" || !e) return t;
28
+ let s = t.trim();
29
+ if (!s || e[s]) return t;
30
+ let n = s.toLowerCase();
31
+ return Object.keys(e).find((i) => i.toLowerCase() === n || e[i]?.toLowerCase() === n) ?? t;
32
+ }, b = (t) => m(t, d.industry), v = (t) => m(t, d.education_level), A = (t) => m(t, w), j = (t) => {
33
+ let e = {}, s = Object.keys(t).filter((r) => !r.includes(f)), n = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
34
+ for (let [r, o] of Object.entries(t)) if (r.endsWith("__items") && Array.isArray(o)) {
35
+ let u = r.slice(0, -f.length);
36
+ i.add(u), s.includes(u) && o.forEach((_) => {
37
+ _ && typeof _ == "object" && Object.keys(_).forEach((O) => n.add(O));
38
+ });
39
+ }
40
+ for (let [r, o] of Object.entries(t)) {
41
+ if (r.endsWith("__items")) {
42
+ let u = r.slice(0, -f.length);
43
+ if (!s.includes(u)) continue;
44
+ e[u] = Array.isArray(o) ? o.map((_) => j(_)) : o;
45
+ continue;
46
+ }
47
+ i.has(r) || n.has(r) || r.startsWith("__") || (e[r] = y.has(r) ? x(o) : L(o));
48
+ }
49
+ let a = e.auto_prior_carrier_name;
50
+ if (typeof a == "string" && a.trim() !== "") {
51
+ let r = a === "NoPriorInsurance";
52
+ if (e.auto_has_prior_insurance = !r, r) for (let o of [
53
+ "auto_prior_years",
54
+ "auto_prior_months",
55
+ "auto_prior_expiration_date",
56
+ "auto_prior_liability_limit",
57
+ "auto_continuous_coverage_years",
58
+ "auto_cancelled_declined_refused_to_renew",
59
+ "auto_current_annual_premium_cents"
60
+ ]) delete e[o];
61
+ }
62
+ let l = e.home_prior_carrier_name;
63
+ if (typeof l == "string" && l.trim() !== "") {
64
+ let r = l === "NoPriorInsurance";
65
+ if (e.home_has_prior_insurance = !r, r) for (let o of [
66
+ "home_prior_years",
67
+ "home_continuous_coverage_years",
68
+ "home_prior_expiration_date",
69
+ "property_insurance_cancelled"
70
+ ]) delete e[o];
71
+ }
72
+ return Array.isArray(e.drivers) && (e.drivers = e.drivers.map((r) => {
73
+ if (!r || typeof r != "object") return r;
74
+ let o = { ...r };
75
+ return o.industry = b(o.industry), o.education_level = v(o.education_level), o.occupation = A(o.occupation), o;
76
+ })), Array.isArray(e.home_losses) && (e.home_losses = e.home_losses.map((r) => {
77
+ if (!r || typeof r != "object") return r;
78
+ let o = r, u = o.amount_paid_cents;
79
+ if (typeof u != "number" || !Number.isFinite(u)) return o;
80
+ let _ = Math.min(Math.max(Math.trunc(u), 0), p);
81
+ return {
82
+ ...o,
83
+ amount_paid_cents: _ * 100
84
+ };
85
+ })), e;
86
+ }, g = (t) => {
87
+ let e = {};
88
+ for (let [n, i] of Object.entries(t)) if (i != null) {
89
+ if (Array.isArray(i)) {
90
+ if (h.includes(n)) {
91
+ let a = i.map((l) => l && typeof l == "object" ? g(l) : l);
92
+ e[c(n)] = a, e[n] = a.length ? "Yes" : "No";
93
+ }
94
+ continue;
95
+ }
96
+ if (typeof i != "object") {
97
+ if (y.has(n) && typeof i == "number") {
98
+ e[n] = Math.round(i / 100);
99
+ continue;
100
+ }
101
+ e[n] = P(i);
102
+ }
103
+ }
104
+ let s = e[c("home_losses")];
105
+ Array.isArray(s) && (e[c("home_losses")] = s.map((n) => {
106
+ let i = n, a = i?.amount_paid_cents;
107
+ return typeof a == "number" ? {
108
+ ...i,
109
+ amount_paid_cents: Math.round(a / 100)
110
+ } : i;
111
+ }));
112
+ for (let [n, i] of Object.entries(e)) typeof i == "string" && /^\d{4}-\d{2}-\d{2}T/.test(i) && (e[n] = i.slice(0, 10));
113
+ for (let [n, i] of Object.entries(M)) {
114
+ if (e[n]) continue;
115
+ let a = N(t, i);
116
+ a && (e[n] = a);
117
+ }
118
+ return e;
119
+ };
120
+ export {
121
+ A as a,
122
+ b as i,
123
+ g as n,
124
+ z as o,
125
+ v as r,
126
+ j as s,
127
+ h as t
128
+ };