@getcredify/credify-insurance-widget 1.45.0 → 1.47.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/dist/{address-BEVwov8q-BHA-1zzm.js → address-BEVwov8q-CFogwodr.js} +1 -1
- package/dist/api-EzrQ6TjH.js +53 -0
- package/dist/{car-B8Sfr377.js → car-CxlVKO91.js} +1 -1
- package/dist/{check-B8qTJ1zD.js → check-BAikbl_K.js} +1 -1
- package/dist/{copy-applicant-offer-BPo842pD-COcsLcbo.js → copy-applicant-offer-UApiJBeU-BesLtSKE.js} +3 -3
- package/dist/{copy-from-record-DL503itm-B05F775l.js → copy-from-record-DL503itm-Cr4NH27U.js} +8 -8
- package/dist/{coverageDerivation-CV2ORogj-D4IAkVAP.js → coverageDerivation-CV2ORogj-C2Nwlsa1.js} +1 -1
- package/dist/{fixtures-ijbZ16Zg-CB6WPBEx.js → fixtures-ijbZ16Zg-B9zEGweJ.js} +1 -1
- package/dist/{household-prefill-DJ-Y0NcP-TwmnYrqf.js → household-prefill-BwSS00qI-Cngp1yri.js} +22 -22
- package/dist/{householdPrefill-DLm3pxFH-Gudko0w4.js → householdPrefill-DLm3pxFH-CSdgf8cD.js} +1 -1
- package/dist/iframe/assets/{address-BEVwov8q-RcBegFnh.js → address-BEVwov8q-CQFQYwN_.js} +1 -1
- package/dist/iframe/assets/{car-DQIQf4LA.js → car-dMyHgJCm.js} +1 -1
- package/dist/iframe/assets/{check-BiNh2j82.js → check-vA4Wm8iT.js} +1 -1
- package/dist/iframe/assets/{copy-applicant-offer-BPo842pD-Cj352DzN.js → copy-applicant-offer-UApiJBeU-DoOvd5Iq.js} +1 -1
- package/dist/iframe/assets/{copy-from-record-DL503itm-B7hBbUhh.js → copy-from-record-DL503itm-Db_VVvOI.js} +1 -1
- package/dist/iframe/assets/{coverageDerivation-CV2ORogj-D3oRqD1U.js → coverageDerivation-CV2ORogj-gpaPp3-I.js} +1 -1
- package/dist/iframe/assets/{dob-calendar-RIJ5S6YU-vOGgSHSK.js → dob-calendar-RIJ5S6YU-Tg0d9tov.js} +1 -1
- package/dist/iframe/assets/{fixtures-ijbZ16Zg-BmEw6uDw.js → fixtures-ijbZ16Zg-Cbt1vB2m.js} +1 -1
- package/dist/iframe/assets/household-prefill-BwSS00qI-C8MTGR1p.js +1 -0
- package/dist/iframe/assets/{householdPrefill-DLm3pxFH-BZXueCa7.js → householdPrefill-DLm3pxFH-BMN6WUsw.js} +1 -1
- package/dist/iframe/assets/{iframe-ku_diR98.js → iframe-BqFwviRo.js} +29 -29
- package/dist/iframe/assets/{index-IiQzPjFm.js → index-CeDETFEQ.js} +2 -2
- package/dist/iframe/assets/{intake-review-panel-CWz2efw4-CP-sEc-j.js → intake-review-panel-CjiYTJXh-CxJXC0fl.js} +1 -1
- package/dist/iframe/assets/{mockJump-H1NFTDah-yzeq4yea.js → mockJump-DCZoGtRl-DqT1rb7l.js} +1 -1
- package/dist/iframe/assets/{payload-CQc06PZC-BxklUdmW.js → payload-DurIYSZk-Bq3ZDZQk.js} +1 -1
- package/dist/iframe/assets/{question-list-CcoyuyQD-DCzTkzeE.js → question-list-CjN64tfw-D8aGV13x.js} +3 -3
- package/dist/iframe/assets/rates-panel-B1xVYtTQ-CInEw7cd.js +17 -0
- package/dist/iframe/assets/{review-panel-CFVxGU7F-CqUUCDLK.js → review-panel-DuzWoTKP-Rwdzp6eC.js} +2 -2
- package/dist/iframe/assets/{stage-BSRsu--X-BAWfI2cm.js → stage-CnucLiNn-DuURgPad.js} +1 -1
- package/dist/iframe/assets/{validation-ELW00AsL-ytOMlsxG.js → validation-Db4WCn17-_NNdawKQ.js} +1 -1
- package/dist/iframe/assets/{vehicleCoverage-DI2dKrnI-DVXwPfxd.js → vehicleCoverage-CDBtkdww-Bo-t8CRG.js} +1 -1
- package/dist/iframe/assets/{visibility-CyRoLvg5-CxslMJYX.js → visibility-iwttXt0y-DNGCSVig.js} +1 -1
- package/dist/iframe/assets/{waves-vdL6w3zC.js → waves-DRA5QD6r.js} +1 -1
- package/dist/iframe/iframe.html +1 -1
- package/dist/{index-IZRzz1Mi.js → index-DBc8hvqD.js} +21 -21
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +95 -95
- package/dist/{intake-review-panel-CWz2efw4-BQ-Nog4K.js → intake-review-panel-CjiYTJXh-Cy_2auOe.js} +17 -17
- package/dist/{mockJump-H1NFTDah-CkqZVQxf.js → mockJump-DCZoGtRl-DBhd5ad0.js} +1 -1
- package/dist/{payload-CQc06PZC-KA6cBCno.js → payload-DurIYSZk-CKtSbWzb.js} +22 -22
- package/dist/{question-list-CcoyuyQD-_c4J4n0G.js → question-list-CjN64tfw-BpPrkylH.js} +13 -13
- package/dist/{rates-panel-MXCbnqpL-DGYBAFto.js → rates-panel-B1xVYtTQ-BUF3Ofoi.js} +237 -222
- package/dist/{review-panel-CFVxGU7F-CtO3WmnD.js → review-panel-DuzWoTKP-BfwFC6Jz.js} +57 -57
- package/dist/{stage-BSRsu--X-DJs8ps3K.js → stage-CnucLiNn-CjHsEHOW.js} +4 -4
- package/dist/{validation-ELW00AsL-C4xgPdbr.js → validation-Db4WCn17-DiPhPmjM.js} +2 -2
- package/dist/{vehicleCoverage-DI2dKrnI-Lq9BCjQm.js → vehicleCoverage-CDBtkdww-Bm9pGAq7.js} +3 -3
- package/dist/{visibility-CyRoLvg5-DNRgF2sH.js → visibility-iwttXt0y-DtOOYFcv.js} +1 -1
- package/dist/{waves-DM8Lgssk.js → waves-oZRnENZl.js} +1 -1
- package/dist/{widget-3S1xkGig.js → widget-CpC6N1oq.js} +1320 -1286
- package/package.json +2 -2
- package/dist/api-BLmgLEy-.js +0 -51
- package/dist/iframe/assets/household-prefill-DJ-Y0NcP-z6AnkJcR.js +0 -1
- package/dist/iframe/assets/rates-panel-MXCbnqpL-TFkvW-DN.js +0 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getcredify/credify-insurance-widget",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.0",
|
|
4
4
|
"description": "Credify Insurance Widget - Embeddable React widget for insurance quotes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.es.js",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@getcredify/credify-insurance-ui-kit": "^1.
|
|
64
|
+
"@getcredify/credify-insurance-ui-kit": "^1.7.0",
|
|
65
65
|
"@internationalized/date": "^3.12.2",
|
|
66
66
|
"@sentry/react": "^8.40.0",
|
|
67
67
|
"react-aria-components": "^1.19.0",
|
package/dist/api-BLmgLEy-.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { j as i, e as o, A as t, N as r, a as u, d as l, X as n, q as d, b as f, H as p, Y as g, Q as c, c as m, m as S, O as T, P as h, f as y, M as Q, k, g as A, E, h as R, i as v, T as P, D as C, J as _, l as O, _ as V, Z as b, x as D, B as I, R as U, u as B, w as F, z as K, S as M, C as Y, n as Z, o as q, V as x, p as G, v as H, r as L, y as N } from "./widget-3S1xkGig.js";
|
|
2
|
-
(function() {
|
|
3
|
-
if (typeof e > "u")
|
|
4
|
-
var e = { env: {} };
|
|
5
|
-
})();
|
|
6
|
-
export {
|
|
7
|
-
i as AUTH_TOKEN_STORAGE_KEY,
|
|
8
|
-
o as CredifyApiError,
|
|
9
|
-
t as QUOTE_ID_STORAGE_KEY,
|
|
10
|
-
r as applyDriverPrefill,
|
|
11
|
-
u as applyVehiclePrefill,
|
|
12
|
-
l as bodyWithQuoteId,
|
|
13
|
-
n as buildResumeUrl,
|
|
14
|
-
d as captureResumeTokenFromUrl,
|
|
15
|
-
f as cityFromZip,
|
|
16
|
-
p as clearQuoteSession,
|
|
17
|
-
g as configureApi,
|
|
18
|
-
c as configureZipCityLookup,
|
|
19
|
-
m as consumeResumeToken,
|
|
20
|
-
S as createQuote,
|
|
21
|
-
T as decodeVin,
|
|
22
|
-
h as dismissDriverPrefill,
|
|
23
|
-
y as dismissVehiclePrefill,
|
|
24
|
-
Q as fetchDriverPrefillSuggestions,
|
|
25
|
-
k as fetchVehiclePrefillSuggestions,
|
|
26
|
-
A as getApiConfig,
|
|
27
|
-
E as getQuestionsByStage,
|
|
28
|
-
R as getQuote,
|
|
29
|
-
v as getRates,
|
|
30
|
-
P as getStagesForQuote,
|
|
31
|
-
C as getVehicleOptions,
|
|
32
|
-
_ as hasResumeToken,
|
|
33
|
-
O as isMockEnabled,
|
|
34
|
-
V as isSupportedState,
|
|
35
|
-
b as isTestModeEnabled,
|
|
36
|
-
D as issueResumeLink,
|
|
37
|
-
I as loadAuthToken,
|
|
38
|
-
U as loadQuoteId,
|
|
39
|
-
B as post,
|
|
40
|
-
F as prefillProperty,
|
|
41
|
-
K as prefillSuggestions,
|
|
42
|
-
M as redeemResumeToken,
|
|
43
|
-
Y as requestBind,
|
|
44
|
-
Z as resetApiConfig,
|
|
45
|
-
q as resetPrefillSuggestions,
|
|
46
|
-
x as saveAuthToken,
|
|
47
|
-
G as saveQuoteId,
|
|
48
|
-
H as sendSmsCode,
|
|
49
|
-
L as updateQuote,
|
|
50
|
-
N as verifySmsCode
|
|
51
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as $,r as a,P as E,N as W,z as u,j as z,a as O,b as s,f as N}from"./iframe-ku_diR98.js";import{U as R,y as U,h as L,m as q,d as D,u as H,l as T}from"./householdPrefill-DLm3pxFH-BZXueCa7.js";import{j as B}from"./visibility-CyRoLvg5-CxslMJYX.js";import{C as F}from"./car-DQIQf4LA.js";import"./types-LUGvo5ic-CB-wcgK3.js";var Y=$({HouseholdPrefill:()=>J}),G={vehicle:{fetch:u.vehicle.fetch,peek:u.vehicle.peek,apply:O,dismiss:z,mergeInto:q,skip:()=>!1,alreadyPresent:()=>!1,icon:F,heading:t=>t===1?"We found a vehicle at your address":`We found ${t} vehicles at your address`,body:"Pick the ones you want covered and we'll fill in the details.",decline:"I'll add them myself",searching:"Looking for vehicles registered at your address…"},driver:{fetch:u.driver.fetch,peek:u.driver.peek,apply:W,dismiss:E,mergeInto:L,skip:U,alreadyPresent:(t,c)=>B(t,"drivers").some(i=>D(T(i),H(c.label))),icon:R,heading:t=>t===1?"We found another driver in your household":`We found ${t} drivers in your household`,body:"Add anyone who drives these vehicles. We already have you.",decline:"I'll add them myself",searching:"Looking for other drivers in your household…"}},J=({kind:t,quoteId:c,values:i,onApply:k})=>{let d=G[t],[p]=a.useState(()=>d.skip(i)),g=!!c&&!p,n=g&&c?d.peek(c):void 0,[y,r]=a.useState(n?n.length?"offering":"done":"idle"),[w,S]=a.useState(n??[]),[o,b]=a.useState(()=>new Set((n??[]).filter(e=>e.alreadyOnApplication).map(e=>e.id))),v=a.useRef(!1),j=a.useRef(i);a.useEffect(()=>{j.current=i}),a.useEffect(()=>{!c||v.current||p||(v.current=!0,d.fetch(c).then(e=>{S(e),b(new Set(e.filter(l=>l.alreadyOnApplication).map(l=>l.id))),r(e.length?"offering":"done")}).catch(()=>{r("done")}))},[c,d,p]);let C=d.icon,h=y==="idle"&&g?"searching":y;if(h==="searching")return s.jsx("div",{className:"cds-mb-5 cds-rounded-xl cds-border cds-border-accent/40 cds-bg-highlight cds-p-4","aria-live":"polite",children:s.jsxs("div",{className:"cds-flex cds-items-center cds-gap-3",children:[s.jsx("div",{className:"cds-h-5 cds-w-5 cds-shrink-0 cds-animate-spin cds-rounded-full cds-border-2 cds-border-accent cds-border-t-transparent","aria-hidden":"true"}),s.jsxs("div",{className:"cds-min-w-0 cds-flex-1",children:[s.jsx("p",{className:"cds-text-sm cds-font-bold cds-text-fg",children:d.searching}),s.jsx("p",{className:"cds-mt-0.5 cds-text-sm cds-text-fg-muted",children:"No need to wait — you can fill this in yourself below."})]})]})});if(h!=="offering"&&h!=="applying")return null;let x=w.filter(e=>!d.alreadyPresent(i,e));if(!x.length)return null;let A=e=>{b(l=>{let f=new Set(l);return f.has(e)?f.delete(e):f.add(e),f})},I=async()=>{if(!c||!o.size)return;r("applying");let e=await d.apply([...o],c);e.length&&k(d.mergeInto(j.current,e)),r("done")},P=()=>{r("done"),c&&d.dismiss(c)},m=h==="applying";return s.jsx("div",{className:"cds-mb-5 cds-rounded-xl cds-border cds-border-accent/40 cds-bg-highlight cds-p-4",children:s.jsxs("div",{className:"cds-flex cds-items-start cds-gap-3",children:[s.jsx(C,{"aria-hidden":"true",className:"cds-mt-0.5 cds-h-5 cds-w-5 cds-shrink-0 cds-text-accent"}),s.jsxs("div",{className:"cds-min-w-0 cds-flex-1",children:[s.jsx("h3",{className:"cds-text-sm cds-font-bold cds-text-fg",children:d.heading(x.length)}),s.jsx("p",{className:"cds-mt-0.5 cds-text-sm cds-text-fg-muted",children:d.body}),s.jsx("ul",{className:"cds-mt-3 cds-space-y-2",children:x.map(e=>s.jsx("li",{children:s.jsxs("label",{className:"cds-flex cds-cursor-pointer cds-items-start cds-gap-2 cds-text-sm cds-text-fg",children:[s.jsx("input",{type:"checkbox",className:"cds-mt-0.5",checked:o.has(e.id),disabled:m,onChange:()=>A(e.id)}),s.jsx("span",{"data-credify-redact":!0,className:"cds-font-semibold",children:e.label})]})},e.id))}),s.jsxs("div",{className:"cds-mt-4 cds-flex cds-flex-wrap cds-items-center cds-gap-3",children:[s.jsx("button",{type:"button",disabled:m||!o.size,onClick:()=>void I(),className:`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 disabled:cds-cursor-not-allowed disabled:cds-opacity-50 ${N}`,children:m?"Adding…":"Use these"}),s.jsx("button",{type:"button",disabled:m,onClick:P,className:`cds-text-sm cds-font-semibold cds-text-fg cds-underline disabled:cds-opacity-50 ${N}`,children:d.decline})]})]})]})})};export{Y as n,J as t};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/iframe-ku_diR98.js","assets/iframe-Bl0qTZgO.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{m as te,n as We,t as Ge,r as u,_ as fe,b as e,f as _,T as De,h as T,o as S,C as X,p as R,q as Le,g as pe,s as Ue,v as ze,K as ge,S as Ye,w as Ve,x as Je,B as be,D as Ke,H as Ze,E as Qe}from"./iframe-ku_diR98.js";import{C as Xe}from"./check-BiNh2j82.js";import{S as ee,W as ye,H as es}from"./waves-vdL6w3zC.js";import{C as ss}from"./car-DQIQf4LA.js";/**
|
|
3
|
-
* @license lucide-react v0.562.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/const ts=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],as=te("copy",ts);/**
|
|
8
|
-
* @license lucide-react v0.562.0 - ISC
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the ISC license.
|
|
11
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/const rs=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],ds=te("link-2",rs);/**
|
|
13
|
-
* @license lucide-react v0.562.0 - ISC
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the ISC license.
|
|
16
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/const cs=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],_e=te("phone",cs);var ns={SafecoPersonal:"Safeco",SafecoPersoanl:"Safeco",AssuranceAmerica:"Assurance America",CommonWealthCasualty:"Commonwealth Casualty",Alinsco:"Alinsco",ACORDBOLTPersonalAuto:"Bolt Auto",ACORDBOLTPersonalHome:"Bolt Home",TwentyFirstCentury:"21st Century",ACentral:"A-Central",AAA:"AAA",AARP:"AARP",Acadia:"Acadia",Ace:"ACE",Acuity:"Acuity",AdirondackInsExchange:"Adirondack",Aegis:"Aegis",AIC:"AIC",AIG:"AIG",AlfaAlliance:"Alfa Alliance",AllianzOfAmerica:"Allianz",AllianzOfAmericaJefferson:"Allianz Jefferson",Allied:"Allied",Allmerica:"Allmerica",Allstate:"Allstate",AmericaFirst:"America First",AmericanCommerce:"American Commerce",AmericanFamily:"American Family",Amica:"Amica",Ameriprise:"Ameriprise",ASILloyds:"ASI Lloyds",Assurant:"Assurant",AtlasGeneralAgency:"Atlas General",AustinMutual:"Austin Mutual",Autoone:"AutoOne",AutoOwners:"Auto-Owners",BadgerMutual:"Badger Mutual",Balboa:"Balboa",Bamboo:"Bamboo",Bankers:"Bankers",BeaconNational:"Beacon National",BrethernMutual:"Brethren Mutual",BristolWest:"Bristol West",BunkerHill:"Bunker Hill",CapitalInsuranceGroup:"Capital Insurance",Celina:"Celina",CentralMutualOfOH:"Central Mutual",Chubb:"Chubb",ChubbInsurance:"Chubb",Cincinnati:"Cincinnati",Citizens:"Citizens",Clearcover:"Clearcover",CNA:"CNA",ColonialPenn:"Colonial Penn",ColoradoCasualty:"Colorado Casualty",Columbia:"Columbia",CommerceWest:"Commerce West",CommonwealthCasualty:"Commonwealth Casualty",ConstitutionalCasualty:"Constitutional Casualty",Cornerstone:"Cornerstone",Countrywide:"Countrywide",CSE:"CSE",Cumberland:"Cumberland",Cypress:"Cypress",Dairyland:"Dairyland",Deerbrook:"Deerbrook",Direct:"Direct",Donegal:"Donegal",Drive:"Drive",Electric:"Electric",EMC:"EMC",Encompass:"Encompass",Erie:"Erie",Esurance:"Esurance",ExcelsiorInsuranceCompany:"Excelsior",Explorer:"Explorer",FairPlan:"FAIR Plan",FarmBureau:"Farm Bureau",Farmers:"Farmers",Fidelity:"Fidelity",FirstAmerican:"First American",Foremost:"Foremost",ForemostInsuranceCompany:"Foremost",Geico:"GEICO",GeneralCasualty:"General Casualty",GermantownMutual:"Germantown Mutual",GMAC:"GMAC",Grange:"Grange",GreatAmerican:"Great American",Grinnell:"Grinnell Mutual",GuideOne:"GuideOne",Hanover:"Hanover",Harbor:"Harbor",Harleysville:"Harleysville",Hartford:"The Hartford",HartfordOMNI:"Hartford OMNI",HastingsMutual:"Hastings Mutual",HawkeyeSecurity:"Hawkeye Security",HDI:"HDI",HippoInsuranceCompany:"Hippo",HomeownersOfAmerica:"Homeowners of America",Homesite:"Homesite",HoraceMann:"Horace Mann",HoustonGeneral:"Houston General",IFA:"IFA",ImperialCasualty:"Imperial Casualty",Indiana:"Indiana Insurance",IndianaFarmers:"Indiana Farmers",Infinity:"Infinity",Insurequest:"Insurequest",Integon:"Integon",Integrity:"Integrity",Kemper:"Kemper",LibertyMutual:"Liberty Mutual",LibertyNorthwest:"Liberty Northwest",MainStreetAmerica:"Main Street America",Mapfre:"MAPFRE",MarkelInsuranceCompany:"Markel",Mendota:"Mendota",MerchantsGroup:"Merchants Group",Mercury:"Mercury",Metlife:"MetLife",Metropolitan:"Metropolitan",MidContinent:"Mid-Continent",MidwesternIndemnity:"Midwestern Indemnity",Montgomery:"Montgomery",MSA:"MSA",MtWashington:"Mt. Washington",MutualBenefit:"Mutual Benefit",NatGenPremier:"NatGen Premier",NationalGeneral:"National General",Nationwide:"Nationwide",NationwideScottsdale:"Nationwide Scottsdale",NewYorkCentralMutual:"NY Central Mutual",NJManufacturers:"NJM Insurance",NJSkylands:"NJ Skylands",Northstar:"Northstar",Occidental:"Occidental",OhioCasualty:"Ohio Casualty",OmahaPC:"Omaha P&C",OneBeacon:"OneBeacon",OregonMutual:"Oregon Mutual",Palisades:"Palisades",PeerlessMontgomery:"Peerless Montgomery",Pekin:"Pekin",Pemco:"PEMCO",PennNational:"Penn National",PlymouthRock:"Plymouth Rock",PreferredMutual:"Preferred Mutual",Proformance:"Proformance",Progressive:"Progressive",Prudential:"Prudential",PureHighValue:"PURE",Republic:"Republic",RockfordMutual:"Rockford Mutual",RoyalAndSunAlliance:"Royal & SunAlliance",Safeco:"Safeco",SECURA:"SECURA",Selective:"Selective",SouthernCounty:"Southern County",SouthernMutual:"Southern Mutual",SouthernTrust:"Southern Trust",StPaulTravelers:"St. Paul Travelers",StandardMutual:"Standard Mutual",StarCasualty:"Star Casualty",StateAuto:"State Auto",StateFarm:"State Farm",StateFarmFloridaInsuranceCompany:"State Farm Florida",SunshineStateInsuranceCompany:"Sunshine State",Travelers:"Travelers",Tower:"Tower",TWFG:"TWFG",Unigard:"Unigard",UnitedFireAndCasualty:"United Fire & Casualty",Unitrin:"Unitrin",Universal:"Universal",USAA:"USAA",UticaNational:"Utica National",Victoria:"Victoria",Wellington:"Wellington",WestBend:"West Bend",WesternNational:"Western National",WesternReserveGroup:"Western Reserve",Westfield:"Westfield",WhiteMountains:"White Mountains",WilsonMutual:"Wilson Mutual",Windsor:"Windsor",Zurich:"Zurich"},ls=s=>s.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/_/g," ").trim(),g=s=>s&&(ns[s]??ls(s)),ke={PersonalHome:"Homeowners",PersonalAuto:"Personal Auto",Flood:"Flood",ExcessFlood:"Excess Flood",_other:"Other"},je=["PersonalHome","PersonalAuto","Flood","ExcessFlood"],C=s=>s?ke[s]??s:null,W=s=>{if(s.monthly_premium_cents!=null)return s.monthly_premium_cents;let a=Number.isFinite(s.term_months)&&s.term_months>0?s.term_months:1;return Math.round((s.premium_cents||0)/a)},Ae=s=>s.admitted_status==="non_admitted"||s.admitted_status==="not_quoted"?s.admitted_status:"admitted",is=s=>{let a={admitted:[],non_admitted:[],not_quoted:[]};for(let l of s)a[Ae(l)].push(l);return a},os=(s,a)=>W(s)-W(a),us=(s,a)=>g(s.carrier_name).localeCompare(g(a.carrier_name)),ms=(s,{sortBy:a="premium"}={})=>{if(!s.length)return[];let l=a==="carrier"?us:os;if(!s.some(m=>m.lob))return[{lob:null,title:"Rates",rates:[...s].sort(l)}];let c=new Map;for(let m of s){let r=m.lob||"_other",i=c.get(r);i?i.push(m):c.set(r,[m])}let o=m=>{let r=je.indexOf(m);return r===-1?je.length:r};return[...c.entries()].sort(([m],[r])=>o(m)-o(r)).map(([m,r])=>({lob:m,title:ke[m]??m,rates:[...r].sort(l)}))},hs=s=>(s.coverages??[]).filter(a=>!!a&&typeof a.label=="string"&&a.label.trim()!==""&&typeof a.value=="string"&&a.value.trim()!==""),xs=[{match:/uninsured.*motorist.*(?:cannot|can not|can't) be (?:greater|higher|more) than.*bodily injury/i,render:()=>"Uninsured motorist coverage can't be higher than your bodily injury limit. Lower it, or raise bodily injury to match."},{match:/(?:cannot|can not|can't) be (?:greater|higher|more) than/i,render:s=>s?`${s} is set higher than this carrier allows.`:"One limit is set higher than this carrier allows."},{match:/please complete all required fields|is required|(?:cannot|can not|can't) be (?:empty|blank)|must be (?:provided|entered)/i,render:()=>"These need an answer before the carrier can price your quote:",shared:!0}],fs={vehicle:"Your vehicles",driver:"Your drivers",coverage:"Your coverage choices",home:"Your home",applicant:"Your details",history:"Your insurance history",general:"A few other answers"},ps=["vehicle","driver","home","coverage","history","applicant","general"],F=s=>typeof s=="string"?s.trim():typeof s=="number"?String(s):"",gs=s=>[F(s.year),F(s.make),F(s.model)].filter(Boolean).join(" "),bs=s=>[F(s.first_name),F(s.last_name)].filter(Boolean).join(" "),ys=(s,a)=>{let l=a.vehicles?.length===1?a.vehicles[0]:void 0;if(s==="vehicle"&&l){let o=gs(l);if(o)return`Your ${o}`}let c=a.drivers?.length===1?a.drivers[0]:void 0;if(s==="driver"&&c){let o=bs(c);if(o)return o}return fs[s]},Ne=s=>s&&(s[0]??"").toUpperCase()+s.slice(1),js=s=>s.length<=1?s[0]??"":s.length===2?`${s[0]} and ${s[1]}`:`${s.slice(0,-1).join(", ")}, and ${s[s.length-1]}`,Ns=(s,a={})=>{let l=new Map,c=[],o=0;for(let r of s??[]){let i=We(r.field??""),p=(i.key?a.describeField?.(i.key):void 0)?.label??(i.isOpaque?void 0:i.label);i.key&&c.push(i.key);let x=(r.message??"").trim(),f=xs.find(N=>N.match.test(x)),v=f?f.render(p):x;if(!v||!p&&!x){o+=1;continue}if(!p&&f?.shared){o+=1;continue}let k=l.get(i.entity)??{issues:[],seen:new Set},b=`${p??""}|${v}`;k.seen.has(b)||(k.seen.add(b),k.issues.push({label:p,message:v,key:i.key}),l.set(i.entity,k))}let m=[];for(let r of ps){let i=l.get(r);if(!i?.issues.length)continue;let p=i.issues[0]?.message??"",x=i.issues.every(f=>f.message===p&&f.label);m.push({id:r,heading:ys(r,a),sharedMessage:x?p:void 0,labels:x?i.issues.map(f=>f.label):[],issues:i.issues})}return{groups:m,otherCount:o,isOpaque:m.length===0,keys:[...new Set(c)]}},vs=s=>s.label?`${s.label}: ${Ne(s.message)}`:Ne(s.message),_s=2500,ks=s=>{if(!s)return null;let a=Math.round((Date.parse(s)-Date.now())/864e5);return!Number.isFinite(a)||a<1?null:a===1?"It works for 1 more day.":`It works for the next ${a} days.`},As=({quoteId:s})=>{let[a,l]=u.useState({kind:"pending"}),[c,o]=u.useState(!1),m=u.useRef(null),r=u.useRef(!1);u.useEffect(()=>{r.current||(r.current=!0,(async()=>{try{let[{issueResumeLink:x},{buildResumeUrl:f}]=await Promise.all([fe(()=>import("./iframe-ku_diR98.js").then(b=>b.a8),__vite__mapDeps([0,1])),fe(()=>import("./iframe-ku_diR98.js").then(b=>b.a7),__vite__mapDeps([0,1])).then(b=>b.u)]),{resumeToken:v,expiresAt:k}=await x(s??void 0);l({kind:"ready",url:f(v),expiresAt:k})}catch{l({kind:"unavailable"})}})())},[s]),u.useEffect(()=>{if(!c)return;let x=setTimeout(()=>o(!1),_s);return()=>clearTimeout(x)},[c]);let i=u.useCallback(async x=>{m.current?.select();try{await navigator.clipboard.writeText(x),o(!0)}catch{o(!1)}},[]);if(a.kind!=="ready")return null;let p=ks(a.expiresAt);return e.jsx("div",{"data-credify-resume-link":!0,className:"cds-mt-6 cds-rounded-xl cds-border cds-border-border cds-bg-surface-muted cds-p-4",children:e.jsxs("div",{className:"cds-flex cds-items-start cds-gap-3",children:[e.jsx(ds,{"aria-hidden":"true",className:"cds-mt-0.5 cds-h-5 cds-w-5 cds-shrink-0 cds-text-fg"}),e.jsxs("div",{className:"cds-min-w-0 cds-flex-1",children:[e.jsx("h3",{className:"cds-text-sm cds-font-bold cds-text-fg",children:"Want to think it over?"}),e.jsxs("p",{className:"cds-mt-1 cds-text-sm cds-text-fg-muted",children:["Save this link and open it on any device to come back to these quotes.",p?` ${p}`:""]}),e.jsxs("div",{className:"cds-mt-3 cds-flex cds-flex-col cds-gap-2 sm:cds-flex-row",children:[e.jsx("input",{ref:m,type:"text",readOnly:!0,value:a.url,"aria-label":"Link back to your quotes",onFocus:x=>x.currentTarget.select(),className:`cds-min-w-0 cds-flex-1 cds-rounded-lg cds-border cds-border-input cds-bg-surface-elevated cds-px-3 cds-py-2 cds-text-xs cds-text-fg-muted ${_}`}),e.jsxs("button",{type:"button",onClick:()=>void i(a.url),className:`cds-inline-flex cds-shrink-0 cds-items-center cds-justify-center cds-gap-1.5 cds-rounded-lg cds-border cds-border-primary cds-px-4 cds-py-2 cds-text-sm cds-font-semibold cds-text-fg cds-transition-colors hover:cds-bg-primary hover:cds-text-primary-foreground ${_}`,children:[e.jsx(c?Xe:as,{"aria-hidden":"true",className:"cds-h-4 cds-w-4"}),c?"Copied":"Copy link"]})]}),e.jsx("p",{"aria-live":"polite",className:"sr-only",children:c?"Link copied to clipboard":""}),e.jsx("p",{className:"cds-mt-2 cds-text-xs cds-text-fg-muted",children:"Anyone with this link can see your quote, so keep it to yourself. You'll still confirm by text message before anything is submitted to a carrier."})]})]})})},Bs=Ge({RatesPanel:()=>Hs}),ws=3e3,Cs=33e4,se=s=>`$${(s/100).toLocaleString("en-US",{maximumFractionDigits:0})}`,Ss=s=>s.split(/\s+/).filter(Boolean).slice(0,2).map(a=>a[0]?.toUpperCase()??"").join(""),qs=[{market:"admitted",label:"Admitted"},{market:"non_admitted",label:"Non-admitted"},{market:"not_quoted",label:"Not quoted"}],O=s=>({tab:`rates-tab-${s}`,panel:`rates-panel-${s}`}),we=({rate:s,size:a})=>{let l=g(s.carrier_name),c=a==="sm"?"cds-h-9 cds-w-9":"cds-h-10 cds-w-10";return s.carrier_logo_base64?e.jsx("img",{src:`data:image/png;base64,${s.carrier_logo_base64}`,alt:l,className:`${c} cds-rounded cds-object-contain`}):e.jsx("span",{"aria-hidden":"true",className:`cds-flex ${c} cds-shrink-0 cds-items-center cds-justify-center cds-rounded cds-bg-primary/10 cds-text-sm cds-font-bold cds-text-fg`,children:Ss(l)})},ve={PersonalAuto:"Personal Auto",PersonalHome:"Homeowners"},Ms={PersonalHome:es,PersonalAuto:ss,Flood:ye,ExcessFlood:ye},B=({lob:s,size:a="md"})=>{let l=s&&Ms[s]||ee,c=a==="sm"?"cds-h-5 cds-w-5":"cds-h-7 cds-w-7",o=a==="sm"?"cds-h-3 cds-w-3":"cds-h-4 cds-w-4";return e.jsx("span",{"aria-hidden":"true",className:`cds-inline-flex ${c} cds-shrink-0 cds-items-center cds-justify-center cds-rounded-full cds-bg-accent/15 cds-ring-1 cds-ring-inset cds-ring-ring/25`,children:e.jsx(l,{className:`${o} cds-text-accent`,strokeWidth:2.5})})},Is=({rate:s,showLob:a,isSelected:l,isRequested:c,lobLocked:o,onSelect:m})=>{let r=g(s.carrier_name),i=hs(s),p=a?C(s.lob):null,x=s.effective_date&&s.policy_end_date?`${s.effective_date} – ${s.policy_end_date}`:s.effective_date;return e.jsxs("div",{className:`cds-rounded-xl cds-border cds-bg-surface-elevated cds-p-4 ${c?"cds-border-accent cds-ring-2 ring-emerald-500/30":l?"cds-border-accent cds-ring-2 cds-ring-ring/30":"cds-border-border"} ${o?"cds-opacity-60":""}`,children:[p?e.jsxs("p",{className:"cds-mb-2 cds-flex cds-items-center cds-gap-1.5 cds-text-xs cds-font-semibold cds-uppercase cds-tracking-wide cds-text-fg",children:[e.jsx(B,{lob:s.lob,size:"sm"}),p]}):null,e.jsxs("div",{className:"cds-flex cds-items-center cds-gap-3",children:[e.jsx(we,{rate:s,size:"md"}),e.jsxs("div",{className:"cds-min-w-0 cds-flex-1",children:[e.jsx("p",{className:"cds-truncate cds-font-bold cds-text-fg",children:r}),e.jsxs("p",{className:"cds-text-xs cds-text-fg-muted",children:[se(s.premium_cents)," for ",s.term_months," months"]}),s.admitted_status==="non_admitted"?e.jsx("p",{className:"cds-mt-1 cds-inline-block cds-rounded cds-bg-warning-surface cds-px-1.5 cds-py-0.5 cds-text-[11px] cds-font-semibold cds-text-warning-foreground",children:"Surplus lines"}):null]}),e.jsxs("div",{className:"cds-text-right",children:[e.jsx("p",{className:"cds-text-xl cds-font-extrabold cds-text-fg",children:se(W(s))}),e.jsx("p",{className:"cds-text-xs cds-text-fg-muted",children:"/mo"})]})]}),x?e.jsxs("p",{className:"cds-mt-2 cds-text-xs cds-text-fg-muted",children:["Effective ",x]}):null,i.length?e.jsx("dl",{className:"cds-mt-3 cds-space-y-1 cds-border-t cds-border-border cds-pt-3 cds-text-xs",children:i.map((f,v)=>e.jsxs("div",{className:"cds-flex cds-justify-between cds-gap-2",children:[e.jsx("dt",{className:"cds-text-fg-muted",children:f.label}),e.jsx("dd",{className:"cds-text-right cds-font-semibold cds-text-fg",children:f.value})]},`${f.label}-${v}`))}):null,s.carrier_quote_id?e.jsxs("p",{className:"cds-mt-2 cds-text-xs cds-text-fg-muted",children:["Carrier quote ID: ",s.carrier_quote_id]}):null,c?e.jsx("p",{className:"cds-mt-3 cds-rounded-lg cds-bg-highlight cds-px-4 cds-py-2 cds-text-center cds-text-sm cds-font-bold cds-text-accent",children:"Request sent"}):o?e.jsxs("p",{className:"cds-mt-3 cds-text-center cds-text-xs cds-text-fg-muted",children:["You already have a request in for ",C(s.lob)??"this line","."]}):e.jsx("button",{type:"button",onClick:m,className:`cds-mt-3 cds-w-full cds-rounded-lg cds-border cds-border-accent cds-px-4 cds-py-2 cds-text-sm cds-font-bold cds-text-fg hover:cds-bg-highlight ${_}`,children:l?"Selected":"Continue with this quote"})]})},Ps=({rate:s})=>{let a=(s.decline_reasons??[]).filter(Boolean),l=s.decline_category?.trim();return e.jsxs("div",{className:"cds-flex cds-gap-3 cds-rounded-xl cds-border cds-border-border cds-bg-surface-elevated cds-p-4",children:[e.jsx(we,{rate:s,size:"sm"}),e.jsxs("div",{className:"cds-min-w-0 cds-flex-1",children:[e.jsx("p",{className:"cds-font-bold cds-text-fg",children:g(s.carrier_name)}),l?e.jsx("p",{className:"cds-mt-0.5 cds-text-xs cds-font-semibold cds-uppercase cds-tracking-wide cds-text-fg-muted",children:l}):null,a.length?e.jsx("ul",{className:"cds-mt-2 cds-list-outside cds-list-disc cds-space-y-1 cds-pl-5 cds-text-sm cds-text-fg-muted",children:a.map((c,o)=>e.jsx("li",{children:c},`${c}-${o}`))}):e.jsx("p",{className:"cds-mt-2 cds-text-sm cds-text-fg-muted",children:"This carrier did not return a quote."})]})]})},$=({quoteId:s})=>s?e.jsxs("div",{className:"cds-mt-6 cds-inline-block cds-rounded-lg cds-border cds-border-border cds-bg-surface-muted cds-px-4 cds-py-2.5 cds-text-center",children:[e.jsx("p",{className:"cds-text-xs cds-text-fg-muted",children:"Reference ID"}),e.jsx("p",{className:"cds-mt-0.5 cds-select-all cds-font-mono cds-text-sm cds-font-semibold cds-text-fg",children:s})]}):null,K=({heading:s,body:a,quoteId:l})=>e.jsxs("div",{className:"cds-py-6 cds-text-center",children:[e.jsx("h2",{className:"cds-mb-2 cds-text-2xl cds-font-bold cds-text-fg",children:s}),e.jsx("p",{className:"cds-mb-6 cds-text-fg-muted",children:a}),e.jsxs("a",{href:R,onClick:()=>X("phone_call_click",{placement:"quote_rates_fallback",phone:S}),className:`cds-inline-flex cds-items-center cds-gap-2 cds-rounded-xl cds-bg-accent cds-px-8 cds-py-3.5 cds-text-base cds-font-bold cds-text-primary-foreground hover:cds-bg-accent ${_}`,children:[e.jsx(_e,{"aria-hidden":"true",className:"cds-h-4 cds-w-4"}),"Call ",S]}),e.jsx("div",{children:e.jsx($,{quoteId:l})})]}),$s={Auto:["PersonalAuto"],Home:["PersonalHome"],Bundle:["PersonalAuto","PersonalHome"]},M=s=>s.length<=1?s[0]??"":`${s.slice(0,-1).join(", ")} and ${s[s.length-1]}`,Z=s=>s.lob??"_other",Q=(s,a)=>{let l=new Set(a.map(c=>c.lob));return[...new Set(s.filter(c=>Ae(c)!=="not_quoted").map(c=>c.lob).filter(c=>!!c))].filter(c=>!l.has(c))},Fs=({appetites:s,product:a})=>{let l=$s[a]??Object.keys(s??{}),c=[...new Set(l.flatMap(o=>s?.[o]??[]).map(g))].slice(0,8);return c.length?e.jsxs("p",{className:"cds-mt-4 cds-text-sm cds-text-fg-muted",children:["Checking ",c.join(", "),c.length>=8?" and more":"","…"]}):null},Hs=({product:s,quoteId:a,describeField:l,onFixAnswers:c,onRetry:o,onBound:m})=>{let[r,i]=u.useState({kind:"polling"}),[p,x]=u.useState(null),[f,v]=u.useState(),[k,b]=u.useState({}),[N,Ce]=u.useState([]),[Se,qe]=u.useState(!1),[G,ae]=u.useState(""),[Me,I]=u.useState(),[D,re]=u.useState(!1),[P,L]=u.useState(0),[de,ce]=u.useState(!1),[U,ne]=u.useState(!1),[Ie,le]=u.useState(),q=u.useRef(0),z=u.useCallback(()=>{q.current+=1;let t=q.current,d=Date.now(),n=async()=>{if(t===q.current){try{let{quote:h}=await Ue(a??void 0);if(t!==q.current)return;v(h);let J=h?.rates_status;if(J==="completed"){let{rates:H}=await ze(a??void 0);if(t!==q.current)return;let E=H??[];i(E.length?{kind:"ready",rates:E}:{kind:"no_rates"});return}if(J==="no_rates"){i({kind:"no_rates"});return}if(J==="failed"){let H=h?.last_validation_errors??[];if(h?.last_failure_code==="BOLT_VALIDATION"&&H.length){i({kind:"validation_failed",errors:H,message:h?.rates_failure_message??void 0});return}let E=h?.last_failure_code==="UNHANDLED"||h?.last_failure_code==="DISPATCH"||h?.last_failure_code==="BOLT_RATES";i({kind:"failed",retryable:E,message:h?.rates_failure_message??void 0}),ge(Error(h?.rates_failure_message||`Rating failed: ${h?.last_failure_code??"unknown"}`),{phase:"rates_failed",product:s,quoteId:a,failureCode:h?.last_failure_code});return}}catch(h){Ye("rates poll failed",{status:Ve(h)})}if(Date.now()-d>=Cs){i({kind:"failed",retryable:!0}),ge(Error("Rating timed out before returning a result"),{phase:"rates_timeout",product:s,quoteId:a});return}setTimeout(()=>void n(),ws)}};n()},[a,s]);u.useEffect(()=>(z(),()=>{q.current+=1}),[z]),u.useEffect(()=>{if(P<=0)return;let t=setTimeout(()=>L(d=>d-1),1e3);return()=>clearTimeout(t)},[P]);let y=u.useMemo(()=>is(r.kind==="ready"?r.rates:[]),[r]),ie=t=>Array.isArray(t)?t.filter(d=>d&&typeof d=="object"):[],Pe=u.useMemo(()=>r.kind==="validation_failed"?Ns(r.errors,{describeField:l,vehicles:ie(f?.vehicles),drivers:ie(f?.drivers)}):void 0,[r,l,f]),j=p??(y.admitted.length?"admitted":y.non_admitted.length?"non_admitted":y.not_quoted.length?"not_quoted":"admitted"),oe=async(t,d)=>{if(!a)return;i({kind:"verify",rate:t,rates:d}),I(void 0),ae("");let n=String(f?.phone??"");try{await Ke(a,n),L(60)}catch(h){h instanceof be&&h.statusCode===429?L(h.retryAfterSeconds??60):I("We could not text your code. Try again in a moment.")}},$e=async(t,d)=>{if(!(!a||D)){re(!0),I(void 0);try{let{isVerified:n}=await Je(a,G);if(!n){I("That code did not match. Check it and try again.");return}i({kind:"ready",rates:d.length?d:[t]}),qe(!0),b(h=>({...h,[Z(t)]:t.quote_rate_id}))}catch(n){I(n instanceof be&&n.statusCode===429?"Too many attempts. Request a new code.":"We could not verify that code. Please try again.")}finally{re(!1)}}},ue=t=>{Ze(),i({kind:"bound",rates:t}),m?.(t)},Fe=async t=>{if(U||!t.length)return;ne(!0),le(void 0);try{await Qe(t.map(n=>n.quote_rate_id),!0)}catch{le(t.length>1?"We could not submit those requests. Please call us and we will finish them for you.":"We could not submit that request. Please call us and we will finish it for you.");return}finally{ne(!1)}let d=[...N,...t];if(Ce(d),b({}),Q(r.kind==="ready"?r.rates:[],d).length){ce(!1);return}ue(d)};if(r.kind==="polling")return e.jsxs("div",{className:"cds-py-10 cds-text-center","aria-live":"polite",children:[e.jsx("div",{className:"cds-mx-auto cds-mb-6 cds-h-10 cds-w-10 cds-animate-spin cds-rounded-full cds-border-4 cds-border-accent cds-border-t-transparent","aria-hidden":"true"}),e.jsx("h2",{className:"cds-mb-2 cds-text-2xl cds-font-bold cds-text-fg",children:"Getting your quotes…"}),e.jsx("p",{className:"cds-text-fg-muted",children:"Please keep this window open while we run your details through our carriers. This usually takes a minute or two."}),e.jsx("p",{className:"cds-mt-2 cds-text-fg-muted",children:"If you get disconnected, your progress is saved in this browser — reopen this page and you'll pick up where you left off. Thanks for your patience."}),e.jsx(Fs,{appetites:f?.appetites,product:s})]});if(r.kind==="validation_failed"){let t=Pe;return!t||t.isOpaque?e.jsx(K,{heading:"Let's finish this one together",body:"The carrier needs a couple of details we can't collect online. An agent can sort it out with you in a few minutes.",quoteId:a}):e.jsxs("div",{className:"cds-py-6",children:[e.jsxs("div",{className:"cds-mb-5 cds-rounded-xl cds-border cds-border-warning cds-bg-warning-surface cds-p-4",children:[e.jsxs("div",{className:"cds-flex cds-items-start cds-gap-3",children:[e.jsx(De,{"aria-hidden":"true",className:"cds-mt-0.5 cds-h-5 cds-w-5 cds-shrink-0 cds-text-warning"}),e.jsxs("div",{children:[e.jsx("h2",{className:"cds-text-lg cds-font-bold cds-text-fg",children:"A few answers need another look"}),e.jsx("p",{className:"cds-mt-1 cds-text-sm cds-text-fg-muted",children:"The carrier couldn't price your quote until these are sorted. It only takes a minute."})]})]}),e.jsx("div",{className:"cds-mt-4 cds-space-y-4",children:t.groups.map(d=>e.jsxs("div",{children:[e.jsx("p",{className:"cds-text-sm cds-font-bold cds-text-fg",children:d.heading}),d.sharedMessage?e.jsxs("p",{className:"cds-mt-1 cds-text-sm cds-text-fg-muted",children:[d.sharedMessage," ",e.jsx("span",{className:"cds-font-semibold",children:js(d.labels)}),"."]}):e.jsx("ul",{className:"cds-mt-1 cds-list-outside cds-list-disc cds-space-y-1 cds-pl-5 cds-text-sm cds-text-fg-muted",children:d.issues.map(n=>e.jsx("li",{children:vs(n)},`${n.label??""}-${n.message}`))})]},d.id))}),t.otherCount?e.jsxs("p",{className:"cds-mt-4 cds-text-xs cds-text-fg-muted",children:["The carrier flagged ",t.otherCount," other ",t.otherCount===1?"detail":"details"," we'll check with you if it still won't price."]}):null]}),e.jsx(T,{onClick:()=>c(r.errors),children:"Fix my answers"}),e.jsxs("p",{className:"cds-mt-4 cds-text-center cds-text-sm cds-text-fg-muted",children:["Or call"," ",e.jsx("a",{href:R,onClick:()=>X("phone_call_click",{placement:"quote_rates_validation",phone:S}),className:"cds-font-semibold cds-text-fg cds-underline",children:S})," ","and an agent will finish it with you."]}),e.jsx("div",{className:"cds-text-center",children:e.jsx($,{quoteId:a})})]})}if(r.kind==="failed")return e.jsx("div",{className:"cds-py-6",children:r.retryable?e.jsxs("div",{className:"cds-text-center",children:[e.jsx("h2",{className:"cds-mb-2 cds-text-2xl cds-font-bold cds-text-fg",children:"That took longer than expected"}),e.jsx("p",{className:"cds-mb-6 cds-text-fg-muted",children:r.message??"Our carrier connection hiccuped. One more try usually does it."}),e.jsx(T,{onClick:()=>{i({kind:"polling"}),o().then(t=>{t&&z()})},children:"Try again"}),e.jsxs("p",{className:"cds-mt-4 cds-text-sm cds-text-fg-muted",children:["Or call"," ",e.jsx("a",{href:R,className:"cds-font-semibold cds-text-fg cds-underline",children:S})," ","and an agent will pull them for you."]}),e.jsx($,{quoteId:a})]}):e.jsx(K,{heading:"Let's get your quotes another way",body:"A licensed agent can pull your quotes over the phone in a few minutes — no waiting.",quoteId:a})});if(r.kind==="no_rates")return e.jsx(K,{heading:"No online offers for this one",body:"That happens with some homes and vehicles. An agent has access to carriers that don't quote online.",quoteId:a});if(r.kind==="verify"){let{rate:t,rates:d}=r;return e.jsxs("div",{className:"cds-py-6",children:[e.jsx("h2",{className:"cds-mb-2 cds-text-2xl cds-font-bold cds-text-fg",children:"Verify your number"}),e.jsxs("p",{className:"cds-mb-6 cds-text-fg-muted",children:["We texted a 6-digit code to confirm it's you before we send your ",t.carrier_name," request."]}),e.jsx("label",{htmlFor:"sms-code",className:"cds-mb-1 cds-block cds-text-sm cds-font-semibold cds-text-fg",children:"Verification code"}),e.jsx("input",{id:"sms-code",type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:6,value:G,onChange:n=>ae(n.target.value.replace(/\D/g,"").slice(0,6)),className:`${Le} cds-tracking-[0.4em]`}),e.jsx(pe,{message:Me}),e.jsx(T,{disabled:G.length!==6||D,onClick:()=>void $e(t,d),children:D?"Verifying…":"Verify and continue"}),e.jsx("button",{type:"button",disabled:P>0,onClick:()=>void oe(t,d),className:`cds-mt-3 cds-w-full cds-rounded-lg cds-px-4 cds-py-2 cds-text-sm cds-font-semibold cds-text-fg cds-underline disabled:cds-no-underline disabled:cds-opacity-60 ${_}`,children:P>0?`Resend code in ${P}s`:"Resend code"})]})}if(r.kind==="bound"){let t=r.rates.length===1?r.rates[0]:void 0;return e.jsxs("div",{className:"cds-py-10 cds-text-center",children:[e.jsx(ee,{"aria-hidden":"true",className:"cds-mx-auto cds-mb-4 cds-h-12 cds-w-12 cds-text-accent"}),e.jsx("h2",{className:"cds-mb-2 cds-text-2xl cds-font-bold cds-text-fg",children:"You're all set"}),t?e.jsxs("p",{className:"cds-text-fg-muted",children:["A licensed agent is finalizing your ",g(t.carrier_name)," policy and will call you shortly to confirm the details."]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"cds-mb-4 cds-text-fg-muted",children:"A licensed agent is finalizing these policies and will call you shortly to confirm the details."}),e.jsx("ul",{className:"cds-mx-auto cds-max-w-sm cds-space-y-2 cds-text-left",children:r.rates.map(d=>e.jsxs("li",{className:"cds-flex cds-items-center cds-gap-2 cds-rounded-lg cds-border cds-border-border cds-bg-surface-elevated cds-p-3 cds-text-sm",children:[e.jsx(B,{lob:d.lob}),e.jsxs("span",{children:[e.jsx("span",{className:"cds-font-bold cds-text-fg",children:g(d.carrier_name)}),C(d.lob)?e.jsxs("span",{className:"cds-text-fg-muted",children:[" — ",C(d.lob)]}):null]})]},d.quote_rate_id))})]}),e.jsx($,{quoteId:a}),e.jsxs("p",{className:"cds-mt-2 cds-text-xs cds-text-fg-muted",children:["Quote this if you call us about ",r.rates.length>1?"these requests":"this request","."]})]})}let Y=new Set(N.map(t=>t.quote_rate_id)),He=new Set(N.map(t=>t.lob)),me=t=>k[Z(t)]===t.quote_rate_id,A=r.rates.filter(t=>me(t)&&!Y.has(t.quote_rate_id)),Ee=Se,V=Q(r.rates,N),Te=Q(r.rates,[]).length>1,he=V.filter(t=>!A.some(d=>d.lob===t)),w=qs.filter(t=>t.market!=="not_quoted"||y.not_quoted.length>0),Oe=y.admitted.length+y.non_admitted.length,Re=ms(j==="not_quoted"?y.not_quoted:y[j],{sortBy:j==="not_quoted"?"carrier":"premium"}),xe=s==="Bundle"?[{lob:"PersonalAuto",label:ve.PersonalAuto},{lob:"PersonalHome",label:ve.PersonalHome}].filter(({lob:t})=>!r.rates.some(d=>d.lob===t)):[],Be=t=>{let d=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0,n=t.key==="Home"?w[0]:t.key==="End"?w[w.length-1]:d?w[(w.findIndex(h=>h.market===j)+d+w.length)%w.length]:void 0;n&&(t.preventDefault(),x(n.market),setTimeout(()=>document.getElementById(O(n.market).tab)?.focus(),0))};return e.jsxs("div",{className:"cds-py-2",children:[e.jsx("h2",{className:"cds-mb-1 cds-text-2xl cds-font-bold cds-text-fg",children:"Your quotes"}),e.jsx("p",{className:"cds-mb-4 cds-text-sm cds-text-fg-muted",children:"Real prices from our carriers, based on the answers you gave."}),xe.length?e.jsx("div",{className:"cds-mb-4 cds-space-y-1",children:xe.map(({lob:t,label:d})=>e.jsxs("p",{className:"cds-text-sm cds-text-fg-muted",children:["Sorry, no rates found for ",d,"."]},t))}):null,N.length>0&&V.length>0?e.jsxs("div",{className:"cds-mb-5 cds-rounded-xl cds-border cds-border-accent cds-bg-highlight cds-p-4",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"cds-flex cds-items-start cds-gap-3",children:[e.jsx(ee,{"aria-hidden":"true",className:"cds-mt-0.5 cds-h-5 cds-w-5 cds-shrink-0 cds-text-accent"}),e.jsxs("div",{children:[e.jsxs("h3",{className:"cds-text-sm cds-font-bold cds-text-fg",children:["We've sent your ",M(N.map(t=>C(t.lob)??g(t.carrier_name)))," request to"," ",M(N.map(t=>g(t.carrier_name)))]}),e.jsxs("p",{className:"cds-mt-1 cds-text-sm cds-text-fg-muted",children:["You can still add ",M(V.map(t=>C(t)??t))," — pick a quote above and we'll send that one too. You won't need another verification code."]})]})]}),e.jsx("button",{type:"button",onClick:()=>ue(N),className:`cds-mt-3 cds-text-sm cds-font-semibold cds-text-fg cds-underline ${_}`,children:"No thanks, I'm done"})]}):null,e.jsx("div",{className:"cds-mb-4 -cds-mx-1 cds-overflow-x-auto cds-border-b cds-border-border cds-px-1",children:e.jsx("div",{className:"cds-flex cds-items-center cds-gap-4 sm:cds-gap-6",role:"tablist","aria-label":"Rate market type",children:w.map(t=>{let d=t.market===j,n=O(t.market);return e.jsxs("button",{id:n.tab,type:"button",role:"tab","aria-selected":d,"aria-controls":n.panel,tabIndex:d?0:-1,onClick:()=>x(t.market),onKeyDown:Be,className:`cds-whitespace-nowrap cds-border-b-2 cds-px-1 cds-py-2 cds-text-xs cds-font-semibold cds-transition-colors sm:cds-text-sm ${_} ${d?"cds-border-accent cds-text-fg":"cds-border-transparent cds-text-fg-muted hover:cds-text-fg"}`,children:[t.label," (",y[t.market].length,")"]},t.market)})})}),e.jsxs("div",{id:O(j).panel,role:"tabpanel","aria-labelledby":O(j).tab,tabIndex:0,className:`cds-mb-6 cds-outline-none ${_}`,children:[j==="admitted"&&!y.admitted.length?e.jsx("p",{className:"cds-text-sm cds-text-fg-muted",children:"No admitted-market carriers priced this quote."}):null,j==="non_admitted"&&!y.non_admitted.length?e.jsx("p",{className:"cds-text-sm cds-text-fg-muted",children:"No surplus-lines carriers priced this quote."}):null,j==="not_quoted"?e.jsx("p",{className:"cds-mb-3 cds-text-sm cds-text-fg-muted",children:"These carriers looked at your details and passed. Their reasons are below."}):null,Re.map((t,d)=>e.jsxs("div",{className:"cds-mb-5 last:cds-mb-0",children:[d?e.jsx("div",{"aria-hidden":"true",className:"cds-mb-5 cds-h-px cds-bg-gradient-to-r cds-from-transparent cds-via-brand-accent/40 cds-to-transparent"}):null,t.lob?e.jsxs("h3",{className:"cds-mb-2 cds-flex cds-items-center cds-gap-2 cds-text-sm cds-font-bold cds-uppercase cds-tracking-wide cds-text-fg",children:[e.jsx(B,{lob:t.lob}),t.title]}):null,e.jsx("ul",{className:"cds-space-y-3",children:t.rates.map(n=>j==="not_quoted"?e.jsx("li",{children:e.jsx(Ps,{rate:n})},n.quote_rate_id):e.jsx("li",{children:e.jsx(Is,{rate:n,showLob:!t.lob,isSelected:me(n),isRequested:Y.has(n.quote_rate_id),lobLocked:!Y.has(n.quote_rate_id)&&He.has(n.lob),onSelect:()=>Ee?b(h=>({...h,[Z(n)]:n.quote_rate_id})):void oe(n,r.rates)})},n.quote_rate_id))})]},t.lob??"all"))]}),Oe?null:e.jsxs("div",{className:"cds-mb-6 cds-rounded-xl cds-border cds-border-border cds-bg-surface-muted cds-p-4 cds-text-center",children:[e.jsx("p",{className:"cds-mb-3 cds-text-sm cds-text-fg-muted",children:"No carrier priced this one online. An agent has access to carriers that don't quote on the web."}),e.jsxs("a",{href:R,onClick:()=>X("phone_call_click",{placement:"quote_rates_all_declined",phone:S}),className:`cds-inline-flex cds-items-center cds-gap-2 cds-rounded-xl cds-bg-accent cds-px-6 cds-py-3 cds-text-sm cds-font-bold cds-text-primary-foreground hover:cds-bg-accent ${_}`,children:[e.jsx(_e,{"aria-hidden":"true",className:"cds-h-4 cds-w-4"}),"Call ",S]}),e.jsx("div",{children:e.jsx($,{quoteId:a})})]}),A.length?e.jsxs("div",{className:"cds-rounded-xl cds-border cds-border-border cds-bg-surface-muted cds-p-4",children:[e.jsxs("h3",{className:"cds-mb-2 cds-text-sm cds-font-bold cds-text-fg",children:["Finish with ",M(A.map(t=>g(t.carrier_name)))]}),Te?e.jsx("ul",{className:"cds-mb-3 cds-space-y-1",children:A.map(t=>e.jsxs("li",{className:"cds-flex cds-justify-between cds-gap-2 cds-text-xs",children:[e.jsxs("span",{className:"cds-flex cds-items-center cds-gap-1.5 cds-text-fg-muted",children:[e.jsx(B,{lob:t.lob,size:"sm"}),C(t.lob)??"Policy"]}),e.jsxs("span",{className:"cds-text-right cds-font-semibold cds-text-fg",children:[g(t.carrier_name)," · ",se(W(t)),"/mo"]})]},t.quote_rate_id))}):null,e.jsxs("label",{className:"cds-mb-3 cds-flex cds-cursor-pointer cds-items-start cds-gap-2 cds-text-xs cds-text-fg-muted",children:[e.jsx("input",{type:"checkbox",checked:de,onChange:t=>ce(t.target.checked),className:"cds-mt-0.5"}),e.jsxs("span",{children:["I acknowledge the"," ",e.jsx("a",{href:"/privacy-policy",className:"cds-font-semibold cds-text-fg cds-underline",children:"Privacy Notice"})," ","and authorize Credify to share my information with"," ",e.jsx("span",{className:"cds-font-semibold",children:M(A.map(t=>g(t.carrier_name)))})," to complete my"," ",A.length>1?"applications":"application","."]})]}),he.length?e.jsxs("p",{className:"cds-mb-3 cds-text-xs cds-text-fg-muted",children:["You haven't picked a ",M(he.map(t=>C(t)??t))," quote yet — choose one above to request both together, or go ahead and we'll ask about it after."]}):null,e.jsx(pe,{message:Ie}),e.jsx(T,{disabled:!de||U,onClick:()=>void Fe(A),children:U?"Submitting…":A.length>1?"Request these policies":"Request this policy"})]}):null,e.jsx(As,{quoteId:a}),e.jsx("p",{className:"cds-mt-6 cds-text-xs cds-leading-relaxed cds-text-fg-muted",children:"Quotes are estimates based on the information provided and are subject to carrier underwriting. Final premiums may differ."})]})};export{Bs as n,As as r,Hs as t};
|