@getcredify/credify-insurance-widget 1.41.1 → 1.43.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.
- package/README.md +109 -0
- package/dist/address-BEVwov8q-Cgvd-ydq.js +59 -0
- package/dist/{api-Cjj6Dfhg.js → api-BGeBevot.js} +15 -15
- package/dist/car-BQXTRajZ.js +26 -0
- package/dist/check-04Hiu_0S.js +15 -0
- package/dist/copy-applicant-offer-CqzfNhkJ-CXzGxES4.js +56 -0
- package/dist/copy-from-record-BNP6CFFR-Ea4bf4lq.js +189 -0
- package/dist/core-CrEw_I-E-B6agkb7g.js +417 -0
- package/dist/coverageDerivation-CV2ORogj-B42UJhMa.js +76 -0
- package/dist/credify-insurance-widget.css +1 -1
- package/dist/{fixtures-ijbZ16Zg-BfdDTLYu.js → fixtures-ijbZ16Zg-Bmt9N4zO.js} +1 -1
- package/dist/household-prefill-CmtB9R3R-DaQcDYh7.js +151 -0
- package/dist/householdPrefill-DLm3pxFH-CqqJoa0N.js +111 -0
- package/dist/iframe/assets/address-BEVwov8q-Bqt4jr_e.js +1 -0
- package/dist/iframe/assets/car-B0PQzDYj.js +6 -0
- package/dist/iframe/assets/check-bC0Zibyh.js +6 -0
- package/dist/iframe/assets/copy-applicant-offer-CqzfNhkJ-D6mTQGjz.js +1 -0
- package/dist/iframe/assets/copy-from-record-BNP6CFFR-D3zdAXXN.js +6 -0
- package/dist/iframe/assets/core-CrEw_I-E-ecektrnv.js +16 -0
- package/dist/iframe/assets/coverageDerivation-CV2ORogj-CA4KQiLs.js +1 -0
- package/dist/iframe/assets/dob-calendar-RIJ5S6YU-1oIu3-0M.js +1 -0
- package/dist/iframe/assets/{fixtures-ijbZ16Zg-DbpkZfa3.js → fixtures-ijbZ16Zg-Dif2LDkg.js} +1 -1
- package/dist/iframe/assets/household-prefill-CmtB9R3R-CrgN1qav.js +1 -0
- package/dist/iframe/assets/householdPrefill-DLm3pxFH-B3K_XX2k.js +6 -0
- package/dist/iframe/assets/iframe-Bl0qTZgO.css +1 -0
- package/dist/iframe/assets/iframe-BsUmazO0.js +107 -0
- package/dist/iframe/assets/index-BipROEB3.js +6 -0
- package/dist/iframe/assets/intake-review-panel-D27t8CZO-UOfbb2gR.js +1 -0
- package/dist/iframe/assets/{mockJump-CL8w249w-Bp9W72n5.js → mockJump-hNzgzUmO-Dd1MY0fT.js} +1 -1
- package/dist/iframe/assets/payload-DrGFAxms-DeQGFkZt.js +1 -0
- package/dist/iframe/assets/question-list-DFjWa8ZA--GTrxgeK.js +317 -0
- package/dist/iframe/assets/rates-panel-BSFiWEZX-Bw7hcmIi.js +17 -0
- package/dist/iframe/assets/review-panel-C_WxX33U-BxLq8fbL.js +6 -0
- package/dist/iframe/assets/stage-knShj71W-BctzWtx2.js +1 -0
- package/dist/iframe/assets/types-LUGvo5ic-CB-wcgK3.js +1 -0
- package/dist/iframe/assets/validation-D42QXxck-CI1J_zUB.js +3 -0
- package/dist/iframe/assets/vehicleCoverage-CBWORI1l-D_NVJvjm.js +1 -0
- package/dist/iframe/assets/visibility-CKRGC3Il-CzwGG4Rt.js +1 -0
- package/dist/iframe/iframe.html +2 -2
- package/dist/index-C9szcdxC.js +354 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.es.js +4 -4
- package/dist/index.umd.js +105 -115
- package/dist/intake-review-panel-D27t8CZO-BprNqAxn.js +186 -0
- package/dist/{mockJump-CL8w249w-1jjBaNyK.js → mockJump-hNzgzUmO-DdKPcdjz.js} +1 -1
- package/dist/payload-DrGFAxms-4aJBixaL.js +128 -0
- package/dist/question-list-DFjWa8ZA-DqUPEU4a.js +6505 -0
- package/dist/rates-panel-BSFiWEZX-poz1p0rK.js +1001 -0
- package/dist/review-panel-C_WxX33U-DAqsW53a.js +903 -0
- package/dist/stage-knShj71W-DkbEgye4.js +197 -0
- package/dist/types-LUGvo5ic-CiVRcsV9.js +9 -0
- package/dist/utils/assets.d.ts +12 -0
- package/dist/utils/branding.d.ts +21 -0
- package/dist/utils/partner.d.ts +32 -0
- package/dist/utils/prefill.d.ts +18 -0
- package/dist/utils/support/bland.d.ts +5 -0
- package/dist/validation-D42QXxck-6HA5X_Ql.js +2852 -0
- package/dist/vehicleCoverage-CBWORI1l-Cy7XD_03.js +144 -0
- package/dist/visibility-CKRGC3Il-v2xplFmb.js +198 -0
- package/dist/widget-wgT55Lu5.js +13109 -0
- package/package.json +2 -2
- package/dist/iframe/assets/dob-calendar-RIJ5S6YU-DMJbmHdB.js +0 -1
- package/dist/iframe/assets/iframe-DFqQdMHv.css +0 -1
- package/dist/iframe/assets/iframe-iPSy7w5L.js +0 -494
- package/dist/widget-Umfy69_M.js +0 -27318
package/README.md
CHANGED
|
@@ -338,6 +338,115 @@ being submitted. Remove the `?mock=` parameter to return to the live flow.
|
|
|
338
338
|
> production. The key only gates demo behaviour in the browser session that supplies
|
|
339
339
|
> it; it grants no access and carries no risk if shared.
|
|
340
340
|
|
|
341
|
+
## Partner attribution
|
|
342
|
+
|
|
343
|
+
If you are a Credify partner, tell the widget who you are and the quotes it
|
|
344
|
+
collects are credited to your firm:
|
|
345
|
+
|
|
346
|
+
```html
|
|
347
|
+
<script src="https://widget.getcredify.com/index.umd.js"></script>
|
|
348
|
+
<script>
|
|
349
|
+
CredifyInsuranceWidget.init({
|
|
350
|
+
partner: { id: 'cp_live_eDt64Vv3jIS7x9hnQGv8i4iLLFDdRX0o' }
|
|
351
|
+
});
|
|
352
|
+
</script>
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
Your partner ID is in the partner portal under **Settings → API keys**, with
|
|
356
|
+
this snippet already filled in. You do not create it — it exists as soon as
|
|
357
|
+
your firm profile does, and it never changes.
|
|
358
|
+
|
|
359
|
+
**It is not a secret.** It names your firm and authorizes nothing: holding it
|
|
360
|
+
lets you say "credit Acme for this quote" and nothing else. It cannot submit an
|
|
361
|
+
application, read anything, or act as you. So it belongs in your page source,
|
|
362
|
+
and there is nothing to rotate.
|
|
363
|
+
|
|
364
|
+
**Never put a secret key here.** The `sk_live_`/`sk_test_` keys are for
|
|
365
|
+
server-to-server calls to the Intake API, and anyone viewing your page could
|
|
366
|
+
read one pasted into this snippet. The widget refuses anything that is not a
|
|
367
|
+
`cp_` id, but the safer habit is not to have the key near the browser at all.
|
|
368
|
+
|
|
369
|
+
### Your logo and colour
|
|
370
|
+
|
|
371
|
+
The same id also brands the widget. Set your logo and brand colour in the
|
|
372
|
+
partner portal under **Settings → Partner profile** and embeds carrying your id
|
|
373
|
+
pick them up — there is nothing to add to the snippet.
|
|
374
|
+
|
|
375
|
+
Your logo appears above the quote form, and your brand colour becomes the fill
|
|
376
|
+
behind the buttons customers press. A colour you have not set means Credify's
|
|
377
|
+
own green, so an embed looks exactly as it does today until you choose
|
|
378
|
+
otherwise.
|
|
379
|
+
|
|
380
|
+
Logos are PNG, JPEG or WebP up to 1 MB, re-encoded and served from
|
|
381
|
+
`assets.getcredify.com`. SVG is not accepted: it is a document that can carry
|
|
382
|
+
script, not just a picture.
|
|
383
|
+
|
|
384
|
+
Changes reach live embeds within about five minutes.
|
|
385
|
+
|
|
386
|
+
What does not change is the licence disclosure under the form, and the support
|
|
387
|
+
number on it. Quotes are written by Credify Corporation, a licensed insurance
|
|
388
|
+
agency, whoever referred the customer — so the widget carries your branding and
|
|
389
|
+
Credify's licensing at the same time, which is what makes the co-branding
|
|
390
|
+
truthful.
|
|
391
|
+
|
|
392
|
+
If the branding cannot be loaded the widget renders unbranded and the quote
|
|
393
|
+
proceeds normally, for the same reason a malformed id does not stop one.
|
|
394
|
+
|
|
395
|
+
### Labelling a placement
|
|
396
|
+
|
|
397
|
+
`sub` records which page or campaign produced the quote, and comes back in your
|
|
398
|
+
reporting. Different pages can carry different values with the same id:
|
|
399
|
+
|
|
400
|
+
```js
|
|
401
|
+
CredifyInsuranceWidget.init({
|
|
402
|
+
partner: { id: 'cp_live_...', sub: 'homepage-hero' }
|
|
403
|
+
});
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
Lowercased and reduced to letters, digits, `-` and `_`; capped at 100
|
|
407
|
+
characters.
|
|
408
|
+
|
|
409
|
+
### If you get it wrong
|
|
410
|
+
|
|
411
|
+
A malformed id — a typo, or a secret key pasted in by mistake — is ignored with
|
|
412
|
+
a console warning and the flow continues unattributed. A visitor never loses a
|
|
413
|
+
quote because attribution was misconfigured, so check your browser console
|
|
414
|
+
after wiring it up rather than assuming silence means success.
|
|
415
|
+
|
|
416
|
+
An id belonging to a partner who is no longer active stops attributing for the
|
|
417
|
+
same reason: the quote is still created, it is simply credited to nobody.
|
|
418
|
+
|
|
419
|
+
### React hosts using the kit directly
|
|
420
|
+
|
|
421
|
+
Embeds built on `@getcredify/credify-insurance-ui-kit` pass the same object to
|
|
422
|
+
`configureApi` instead:
|
|
423
|
+
|
|
424
|
+
```ts
|
|
425
|
+
configureApi({
|
|
426
|
+
baseUrl: 'https://api.getcredify.com',
|
|
427
|
+
storagePrefix: 'acme_credify_',
|
|
428
|
+
partner: { id: 'cp_live_...' }
|
|
429
|
+
});
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
## Skipping questions you have already asked
|
|
433
|
+
|
|
434
|
+
If your page collects a ZIP or an email of its own, hand them over and the flow
|
|
435
|
+
starts on the first question the visitor has not seen:
|
|
436
|
+
|
|
437
|
+
```js
|
|
438
|
+
CredifyInsuranceWidget.init({
|
|
439
|
+
partner: { id: 'cp_live_...' },
|
|
440
|
+
prefill: { zip: '78701', email: 'sam@example.com' }
|
|
441
|
+
});
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
Both are optional and independently applied. A value the flow cannot use — a
|
|
445
|
+
four-digit ZIP, something that is not an address — is dropped and that one
|
|
446
|
+
question is asked as usual, so a bad value costs the shortcut and never the
|
|
447
|
+
quote. A visitor resuming a saved quote is never overwritten: their own answers
|
|
448
|
+
win.
|
|
449
|
+
|
|
341
450
|
## Test Mode (internal)
|
|
342
451
|
|
|
343
452
|
Test mode is for walking the **live** flow — real API, real carriers, real SMS —
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { t as _ } from "./widget-wgT55Lu5.js";
|
|
2
|
+
(function() {
|
|
3
|
+
if (typeof t > "u")
|
|
4
|
+
var t = { env: {} };
|
|
5
|
+
})();
|
|
6
|
+
var u = /* @__PURE__ */ _({
|
|
7
|
+
ADDRESS_COLUMN_PREFIXES: () => p,
|
|
8
|
+
addressFromColumns: () => c,
|
|
9
|
+
addressToColumns: () => m,
|
|
10
|
+
composeAddress: () => n,
|
|
11
|
+
normalizeStateCode: () => a,
|
|
12
|
+
parseAddress: () => l
|
|
13
|
+
}), a = (t) => {
|
|
14
|
+
let e = t.trim();
|
|
15
|
+
return /^[A-Za-z]{2}$/.test(e) ? e.toUpperCase() : e;
|
|
16
|
+
}, l = (t) => {
|
|
17
|
+
let [e = "", r = "", o = ""] = t.split(",").map((d) => d.trim()).filter(Boolean), i = /^([A-Za-z .]{2,})\s+(\d{5})(?:-\d{4})?$/.exec(o);
|
|
18
|
+
return {
|
|
19
|
+
line_1: e,
|
|
20
|
+
city: r,
|
|
21
|
+
state: a(i?.[1]?.trim() ?? ""),
|
|
22
|
+
postal_code: i?.[2] ?? ""
|
|
23
|
+
};
|
|
24
|
+
}, n = (t) => {
|
|
25
|
+
let e = [t.line_1.trim(), t.line_2.trim()].filter(Boolean).join(" ");
|
|
26
|
+
if (!e) return "";
|
|
27
|
+
let r = a(t.state.trim());
|
|
28
|
+
return `${e}, ${t.city.trim()}, ${r} ${t.postal_code.trim()}`.replace(/\s+/g, " ").trim();
|
|
29
|
+
}, p = {
|
|
30
|
+
address: "",
|
|
31
|
+
prior_address: "prior_",
|
|
32
|
+
garaging_address: "garaging_address_"
|
|
33
|
+
}, s = (t, e) => {
|
|
34
|
+
let r = t[e];
|
|
35
|
+
return r == null ? "" : String(r);
|
|
36
|
+
}, c = (t, e) => n({
|
|
37
|
+
line_1: s(t, `${e}line_1`),
|
|
38
|
+
line_2: s(t, `${e}line_2`),
|
|
39
|
+
city: s(t, `${e}city`),
|
|
40
|
+
state: s(t, `${e}state`),
|
|
41
|
+
postal_code: s(t, `${e}postal_code`)
|
|
42
|
+
}), m = (t, e) => {
|
|
43
|
+
let r = l(t);
|
|
44
|
+
return {
|
|
45
|
+
[`${e}line_1`]: r.line_1 || null,
|
|
46
|
+
[`${e}city`]: r.city || null,
|
|
47
|
+
[`${e}state`]: r.state || null,
|
|
48
|
+
[`${e}postal_code`]: r.postal_code || null
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
n as a,
|
|
53
|
+
u as i,
|
|
54
|
+
c as n,
|
|
55
|
+
a as o,
|
|
56
|
+
m as r,
|
|
57
|
+
l as s,
|
|
58
|
+
p as t
|
|
59
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Z as i, e as o, X as t, A as r, D as l, c as u, H as n, z as d, K as f, F as p, q as g, W as c, V as m, d as S, T, j as h, O as y, k, E as A, J as E, C as Q, p as v, _ as P, S as R, w as C, B as _, a as O, m as V, Y as b, v as D, N as I, b as F, s as K, x as U, I as B, y as L, f as M, g as Y, L as Z, P as q, M as x, h as G, i as H, l as N } from "./widget-wgT55Lu5.js";
|
|
2
2
|
(function() {
|
|
3
3
|
if (typeof e > "u")
|
|
4
4
|
var e = { env: {} };
|
|
@@ -31,20 +31,20 @@ export {
|
|
|
31
31
|
C as getVehicleOptions,
|
|
32
32
|
_ as hasResumeToken,
|
|
33
33
|
O as isMockEnabled,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
V as isSupportedState,
|
|
35
|
+
b as isTestModeEnabled,
|
|
36
|
+
D as issueResumeLink,
|
|
37
|
+
I as loadAuthToken,
|
|
38
|
+
F as loadQuoteId,
|
|
39
|
+
K as post,
|
|
40
|
+
U as prefillProperty,
|
|
41
|
+
B as prefillSuggestions,
|
|
42
|
+
L as redeemResumeToken,
|
|
43
|
+
M as requestBind,
|
|
44
|
+
Y as resetApiConfig,
|
|
45
|
+
Z as resetPrefillSuggestions,
|
|
46
|
+
q as saveAuthToken,
|
|
47
|
+
x as saveQuoteId,
|
|
48
48
|
G as sendSmsCode,
|
|
49
49
|
H as updateQuote,
|
|
50
50
|
N as verifySmsCode
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { a4 as e } from "./widget-wgT55Lu5.js";
|
|
2
|
+
(function() {
|
|
3
|
+
if (typeof c > "u")
|
|
4
|
+
var c = { env: {} };
|
|
5
|
+
})();
|
|
6
|
+
/**
|
|
7
|
+
* @license lucide-react v0.562.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
const r = [
|
|
13
|
+
[
|
|
14
|
+
"path",
|
|
15
|
+
{
|
|
16
|
+
d: "M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",
|
|
17
|
+
key: "5owen"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
["circle", { cx: "7", cy: "17", r: "2", key: "u2ysq9" }],
|
|
21
|
+
["path", { d: "M9 17h6", key: "r8uit2" }],
|
|
22
|
+
["circle", { cx: "17", cy: "17", r: "2", key: "axvx0g" }]
|
|
23
|
+
], a = e("car", r);
|
|
24
|
+
export {
|
|
25
|
+
a as C
|
|
26
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { a4 as c } from "./widget-wgT55Lu5.js";
|
|
2
|
+
(function() {
|
|
3
|
+
if (typeof e > "u")
|
|
4
|
+
var e = { env: {} };
|
|
5
|
+
})();
|
|
6
|
+
/**
|
|
7
|
+
* @license lucide-react v0.562.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
const o = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], t = c("check", o);
|
|
13
|
+
export {
|
|
14
|
+
t as C
|
|
15
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { t as d } from "./widget-wgT55Lu5.js";
|
|
2
|
+
import { k as y, j as h } from "./visibility-CKRGC3Il-v2xplFmb.js";
|
|
3
|
+
import { u as m, l as f, s as c } from "./copy-from-record-BNP6CFFR-Ea4bf4lq.js";
|
|
4
|
+
import { useMemo as p, useCallback as b } from "react";
|
|
5
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
6
|
+
(function() {
|
|
7
|
+
if (typeof a > "u")
|
|
8
|
+
var a = { env: {} };
|
|
9
|
+
})();
|
|
10
|
+
var O = /* @__PURE__ */ d({ CopyApplicantOffer: () => v }), k = {
|
|
11
|
+
Demographics: {
|
|
12
|
+
kind: "applicant",
|
|
13
|
+
heading: "Are you one of the drivers?",
|
|
14
|
+
body: "We'll reuse the details you already gave for them, so you don't type them twice.",
|
|
15
|
+
applyLabel: "Use these details"
|
|
16
|
+
},
|
|
17
|
+
Ssn: {
|
|
18
|
+
kind: "applicantSsn",
|
|
19
|
+
heading: "Are you one of the drivers?",
|
|
20
|
+
body: "We can reuse the Social Security number you already entered for them.",
|
|
21
|
+
applyLabel: "Use the SSN"
|
|
22
|
+
}
|
|
23
|
+
}, v = ({ stage: a, questions: n, values: t, onPatch: u }) => {
|
|
24
|
+
let e = k[a], i = p(() => e ? y(n, t, a) : [], [
|
|
25
|
+
e,
|
|
26
|
+
n,
|
|
27
|
+
t,
|
|
28
|
+
a
|
|
29
|
+
]), r = b((o) => e ? m({
|
|
30
|
+
kind: e.kind,
|
|
31
|
+
source: h(t, "drivers")[o] ?? {},
|
|
32
|
+
targetQuestions: i
|
|
33
|
+
}) : {}, [
|
|
34
|
+
e,
|
|
35
|
+
t,
|
|
36
|
+
i
|
|
37
|
+
]), l = p(() => e ? f(t).filter((o) => Object.keys(r(o.index)).length > 0) : [], [
|
|
38
|
+
e,
|
|
39
|
+
t,
|
|
40
|
+
r
|
|
41
|
+
]);
|
|
42
|
+
return !e || !l.length ? null : /* @__PURE__ */ g(c, {
|
|
43
|
+
heading: e.heading,
|
|
44
|
+
body: e.body,
|
|
45
|
+
applyLabel: e.applyLabel,
|
|
46
|
+
candidates: l,
|
|
47
|
+
onApply: (o) => {
|
|
48
|
+
let s = r(o);
|
|
49
|
+
return u(s), Object.keys(s).length;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
O as n,
|
|
55
|
+
v as t
|
|
56
|
+
};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { a4 as x, a5 as b, r as v } from "./widget-wgT55Lu5.js";
|
|
2
|
+
import { j as N } from "./visibility-CKRGC3Il-v2xplFmb.js";
|
|
3
|
+
import { O as f } from "./validation-D42QXxck-6HA5X_Ql.js";
|
|
4
|
+
import { useState as y } from "react";
|
|
5
|
+
import { jsxs as p, jsx as n, Fragment as k } from "react/jsx-runtime";
|
|
6
|
+
import { C as K } from "./check-04Hiu_0S.js";
|
|
7
|
+
(function() {
|
|
8
|
+
if (typeof t > "u")
|
|
9
|
+
var t = { env: {} };
|
|
10
|
+
})();
|
|
11
|
+
/**
|
|
12
|
+
* @license lucide-react v0.562.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/
|
|
17
|
+
const S = [
|
|
18
|
+
["path", { d: "M2 21a8 8 0 0 1 13.292-6", key: "bjp14o" }],
|
|
19
|
+
["circle", { cx: "10", cy: "8", r: "5", key: "o932ke" }],
|
|
20
|
+
["path", { d: "m16 19 2 2 4-4", key: "1b14m6" }]
|
|
21
|
+
], w = x("user-round-check", S);
|
|
22
|
+
var A = {
|
|
23
|
+
applicant: {
|
|
24
|
+
gender: "gender",
|
|
25
|
+
marital_status: "marital_status",
|
|
26
|
+
employment_industry: "industry",
|
|
27
|
+
occupation: "occupation"
|
|
28
|
+
},
|
|
29
|
+
applicantSsn: { social_security_number: "social_security_number" },
|
|
30
|
+
coApplicant: {
|
|
31
|
+
co_applicant_first_name: "first_name",
|
|
32
|
+
co_applicant_middle_name: "middle_name",
|
|
33
|
+
co_applicant_last_name: "last_name",
|
|
34
|
+
co_applicant_date_of_birth: "date_of_birth",
|
|
35
|
+
co_applicant_gender: "gender",
|
|
36
|
+
co_applicant_marital_status: "marital_status",
|
|
37
|
+
co_applicant_employment_industry: "industry",
|
|
38
|
+
co_applicant_occupation: "occupation",
|
|
39
|
+
co_applicant_relationship: "relationship_to_insured"
|
|
40
|
+
},
|
|
41
|
+
driverFromApplicant: {
|
|
42
|
+
first_name: "first_name",
|
|
43
|
+
last_name: "last_name",
|
|
44
|
+
date_of_birth: "date_of_birth",
|
|
45
|
+
gender: "gender",
|
|
46
|
+
marital_status: "marital_status",
|
|
47
|
+
industry: "employment_industry",
|
|
48
|
+
occupation: "occupation",
|
|
49
|
+
social_security_number: "social_security_number"
|
|
50
|
+
}
|
|
51
|
+
}, $ = {
|
|
52
|
+
applicant: {
|
|
53
|
+
industryKey: "employment_industry",
|
|
54
|
+
occupationKey: "occupation"
|
|
55
|
+
},
|
|
56
|
+
coApplicant: {
|
|
57
|
+
industryKey: "co_applicant_employment_industry",
|
|
58
|
+
occupationKey: "co_applicant_occupation"
|
|
59
|
+
},
|
|
60
|
+
driverFromApplicant: {
|
|
61
|
+
industryKey: "industry",
|
|
62
|
+
occupationKey: "occupation"
|
|
63
|
+
}
|
|
64
|
+
}, j = {
|
|
65
|
+
Separated: ["Seperated"],
|
|
66
|
+
Seperated: ["Separated"],
|
|
67
|
+
DomesticPartner: ["Domestic Partner"],
|
|
68
|
+
"Domestic Partner": ["DomesticPartner"]
|
|
69
|
+
}, C = (t, c) => {
|
|
70
|
+
let e = t.options;
|
|
71
|
+
if (!Array.isArray(e) || e.length === 0) return c;
|
|
72
|
+
let i = String(c);
|
|
73
|
+
return e.includes(i) ? c : (j[i] ?? []).find((a) => e.includes(a));
|
|
74
|
+
}, h = (t, c = "") => [t[`${c}first_name`], t[`${c}last_name`]].map((e) => String(e ?? "").trim()).filter(Boolean).join(" "), O = (t) => h(t), B = (t, c = {}) => N(t, "drivers").flatMap((e, i) => {
|
|
75
|
+
if (c.exclude?.(e, i)) return [];
|
|
76
|
+
let a = h(e);
|
|
77
|
+
return a || !f(e.date_of_birth) ? [{
|
|
78
|
+
index: i,
|
|
79
|
+
name: a || `Driver ${i + 1}`
|
|
80
|
+
}] : [];
|
|
81
|
+
}), I = ({ kind: t, source: c, targetQuestions: e }) => {
|
|
82
|
+
let i = new Map(e.map((d) => [d.key, d])), a = {};
|
|
83
|
+
for (let [d, o] of Object.entries(A[t])) {
|
|
84
|
+
let m = i.get(d);
|
|
85
|
+
if (!m) continue;
|
|
86
|
+
let u = c[o];
|
|
87
|
+
if (f(u, m.inputType)) continue;
|
|
88
|
+
let l = C(m, u);
|
|
89
|
+
l !== void 0 && (a[d] = l);
|
|
90
|
+
}
|
|
91
|
+
let r = $[t];
|
|
92
|
+
return r && a[r.occupationKey] !== void 0 && (b(a[r.industryKey])?.includes(String(a[r.occupationKey])) || delete a[r.occupationKey]), a;
|
|
93
|
+
}, Q = ({ heading: t, body: c, candidates: e, applyLabel: i = "Use these details", onApply: a }) => {
|
|
94
|
+
let [r, d] = y(e[0]?.index ?? 0), [o, m] = y(null);
|
|
95
|
+
if (!e.length) return null;
|
|
96
|
+
if (o) return /* @__PURE__ */ p("p", {
|
|
97
|
+
className: "cds-mb-4 cds-flex cds-items-center cds-gap-2 cds-text-sm cds-text-fg-muted",
|
|
98
|
+
"aria-live": "polite",
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ n(K, {
|
|
101
|
+
"aria-hidden": "true",
|
|
102
|
+
className: "cds-h-4 cds-w-4 cds-shrink-0 cds-text-accent"
|
|
103
|
+
}),
|
|
104
|
+
"Filled ",
|
|
105
|
+
o.count,
|
|
106
|
+
" ",
|
|
107
|
+
o.count === 1 ? "answer" : "answers",
|
|
108
|
+
" from ",
|
|
109
|
+
/* @__PURE__ */ n("span", {
|
|
110
|
+
"data-credify-redact": !0,
|
|
111
|
+
children: o.name
|
|
112
|
+
}),
|
|
113
|
+
". Change anything below that is not right."
|
|
114
|
+
]
|
|
115
|
+
});
|
|
116
|
+
let u = () => {
|
|
117
|
+
let s = e.find((g) => g.index === r) ?? e[0];
|
|
118
|
+
if (!s) return;
|
|
119
|
+
let _ = a(s.index);
|
|
120
|
+
_ > 0 && m({
|
|
121
|
+
name: s.name,
|
|
122
|
+
count: _
|
|
123
|
+
});
|
|
124
|
+
}, l = e.length === 1 ? e[0] : void 0;
|
|
125
|
+
return /* @__PURE__ */ n("div", {
|
|
126
|
+
className: "cds-mb-5 cds-rounded-xl cds-border cds-border-accent/40 cds-bg-highlight cds-p-4",
|
|
127
|
+
children: /* @__PURE__ */ p("div", {
|
|
128
|
+
className: "cds-flex cds-items-start cds-gap-3",
|
|
129
|
+
children: [/* @__PURE__ */ n(w, {
|
|
130
|
+
"aria-hidden": "true",
|
|
131
|
+
className: "cds-mt-0.5 cds-h-5 cds-w-5 cds-shrink-0 cds-text-accent"
|
|
132
|
+
}), /* @__PURE__ */ p("div", {
|
|
133
|
+
className: "cds-min-w-0 cds-flex-1",
|
|
134
|
+
children: [
|
|
135
|
+
/* @__PURE__ */ n("h3", {
|
|
136
|
+
className: "cds-text-sm cds-font-bold cds-text-fg",
|
|
137
|
+
children: t
|
|
138
|
+
}),
|
|
139
|
+
/* @__PURE__ */ n("p", {
|
|
140
|
+
className: "cds-mt-0.5 cds-text-sm cds-text-fg-muted",
|
|
141
|
+
children: c
|
|
142
|
+
}),
|
|
143
|
+
l ? null : /* @__PURE__ */ p("fieldset", {
|
|
144
|
+
className: "cds-mt-3",
|
|
145
|
+
children: [/* @__PURE__ */ n("legend", {
|
|
146
|
+
className: "sr-only",
|
|
147
|
+
children: t
|
|
148
|
+
}), /* @__PURE__ */ n("div", {
|
|
149
|
+
className: "cds-space-y-1.5",
|
|
150
|
+
children: e.map((s) => /* @__PURE__ */ p("label", {
|
|
151
|
+
className: "cds-flex cds-cursor-pointer cds-items-center cds-gap-2 cds-text-sm cds-text-fg",
|
|
152
|
+
children: [/* @__PURE__ */ n("input", {
|
|
153
|
+
type: "radio",
|
|
154
|
+
name: `copy-source-${t.replace(/\W+/g, "-")}`,
|
|
155
|
+
checked: r === s.index,
|
|
156
|
+
onChange: () => d(s.index)
|
|
157
|
+
}), /* @__PURE__ */ n("span", {
|
|
158
|
+
"data-credify-redact": !0,
|
|
159
|
+
className: "cds-font-semibold",
|
|
160
|
+
children: s.name
|
|
161
|
+
})]
|
|
162
|
+
}, s.index))
|
|
163
|
+
})]
|
|
164
|
+
}),
|
|
165
|
+
/* @__PURE__ */ n("button", {
|
|
166
|
+
type: "button",
|
|
167
|
+
onClick: u,
|
|
168
|
+
className: `cds-mt-4 cds-rounded-lg cds-bg-accent cds-px-4 cds-py-2 cds-text-sm cds-font-bold cds-text-primary-foreground hover:cds-bg-accent ${v}`,
|
|
169
|
+
children: l ? /* @__PURE__ */ p(k, { children: [
|
|
170
|
+
i,
|
|
171
|
+
" from ",
|
|
172
|
+
/* @__PURE__ */ n("span", {
|
|
173
|
+
"data-credify-redact": !0,
|
|
174
|
+
children: l.name
|
|
175
|
+
})
|
|
176
|
+
] }) : i
|
|
177
|
+
})
|
|
178
|
+
]
|
|
179
|
+
})]
|
|
180
|
+
})
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
export {
|
|
184
|
+
w as U,
|
|
185
|
+
O as c,
|
|
186
|
+
B as l,
|
|
187
|
+
Q as s,
|
|
188
|
+
I as u
|
|
189
|
+
};
|