PageSourceSearch

https://onboarding-widget-dev.web.app/_next/static/chunks/691-917c7a10b65fb492.js

js onboarding-widget-dev.web.app collected 2026-10-03 12:31:58 UTC 103,796 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[691],{2971:function(e,t,s){s.d(t,{QuoteAssistant:function(){return ez}});var a=s(7437),n=s(2265);let i=e=>({viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeMiterlimit:10,strokeLinecap:"round",strokeLinejoin:"round",className:e}),r={logo:e=>(0,a.jsxs)("svg",{viewBox:"0 0 32 32",className:e.className,children:[(0,a.jsx)("circle",{cx:"16",cy:"16",r:"16",fill:"#fff"}),(0,a.jsx)("path",{d:"M22 11a8 8 0 1 0 2 5.3",fill:"none",stroke:"#1B5CFF",strokeWidth:"3",strokeLinecap:"round"})]}),message:e=>(0,a.jsx)("svg",{...i(e.className),children:(0,a.jsx)("path",{d:"M7 18.43H11L15.45 21.39C16.11 21.83 17 21.36 17 20.56V18.43C20 18.43 22 16.43 22 13.43V7.42999C22 4.42999 20 2.42999 17 2.42999H7C4 2.42999 2 4.42999 2 7.42999V13.43C2 16.43 4 18.43 7 18.43Z"})}),clipboard:e=>(0,a.jsxs)("svg",{...i(e.className),children:[(0,a.jsx)("path",{d:"M8 12.2H15"}),(0,a.jsx)("path",{d:"M8 16.2H12.38"}),(0,a.jsx)("path",{d:"M10 6H14C16 6 16 5 16 4C16 2 15 2 14 2H10C9 2 8 2 8 4C8 6 9 6 10 6Z"}),(0,a.jsx)("path",{d:"M16 4.01999C19.33 4.19999 21 5.42999 21 9.99999V16C21 20 20 22 15 22H9C4 22 3 20 3 16V9.99999C3 5.43999 4.67 4.19999 8 4.01999"})]}),restart:e=>(0,a.jsxs)("svg",{...i(e.className),children:[(0,a.jsx)("path",{d:"M14.55 21.67C18.84 20.54 22 16.64 22 12C22 6.48 17.56 2 12 2C5.33 2 2 7.56 2 7.56M6.44 7.56H4.01H2V3"}),(0,a.jsx)("path",{d:"M2 12C2 17.52 6.48 22 12 22",strokeDasharray:"3 3"})]}),arrowRight:e=>(0,a.jsxs)("svg",{...i(e.className),children:[(0,a.jsx)("path",{d:"M14.4301 5.92999L20.5001 12L14.4301 18.07"}),(0,a.jsx)("path",{d:"M3.5 12H20.33"})]}),arrowUp:e=>(0,a.jsxs)("svg",{...i(e.className),children:[(0,a.jsx)("path",{d:"M18.0701 9.57L12.0001 3.5L5.93005 9.57"}),(0,a.jsx)("path",{d:"M12 20.5V3.67001"})]}),buildings:e=>(0,a.jsxs)("svg",{...i(e.className),children:[(0,a.jsx)("path",{d:"M13 22H5C3 22 2 21 2 19V11C2 9 3 8 5 8H10V19C10 21 11 22 13 22Z"}),(0,a.jsx)("path",{d:"M10.11 4C10.03 4.3 10 4.63 10 5V8H5V6C5 4.9 5.9 4 7 4H10.11Z"}),(0,a.jsx)("path",{d:"M14 8V13"}),(0,a.jsx)("path",{d:"M18 8V13"}),(0,a.jsx)("path",{d:"M17 17H15C14.45 17 14 17.45 14 18V22H18V18C18 17.45 17.55 17 17 17Z"}),(0,a.jsx)("path",{d:"M6 13V17"}),(0,a.jsx)("path",{d:"M10 19V5C10 3 11 2 13 2H19C21 2 22 3 22 5V19C22 21 21 22 19 22H13C11 22 10 21 10 19Z"})]}),call:e=>(0,a.jsx)("svg",{...i(e.className),children:(0,a.jsx)("path",{d:"M21.97 18.33C21.97 18.69 21.89 19.06 21.72 19.42C21.55 19.78 21.33 20.12 21.04 20.44C20.55 20.98 20.01 21.37 19.4 21.62C18.8 21.87 18.15 22 17.45 22C16.43 22 15.34 21.76 14.19 21.27C13.04 20.78 11.89 20.12 10.75 19.29C9.6 18.45 8.51 17.52 7.47 16.49C6.44 15.45 5.51 14.36 4.68 13.22C3.86 12.08 3.2 10.94 2.72 9.81C2.24 8.67 2 7.58 2 6.54C2 5.86 2.12 5.21 2.36 4.61C2.6 4 2.98 3.44 3.51 2.94C4.15 2.31 4.85 2 5.59 2C5.87 2 6.15 2.06 6.4 2.18C6.66 2.3 6.89 2.48 7.07 2.74L9.39 6.01C9.57 6.26 9.7 6.49 9.79 6.71C9.88 6.92 9.93 7.13 9.93 7.32C9.93 7.56 9.86 7.8 9.72 8.03C9.59 8.26 9.4 8.5 9.16 8.74L8.4 9.53C8.29 9.64 8.24 9.77 8.24 9.93C8.24 10.01 8.25 10.08 8.27 10.16C8.3 10.24 8.33 10.3 8.35 10.36C8.53 10.69 8.84 11.12 9.28 11.64C9.73 12.16 10.21 12.69 10.73 13.22C11.27 13.75 11.79 14.24 12.32 14.69C12.84 15.13 13.27 15.43 13.61 15.61C13.66 15.63 13.72 15.66 13.79 15.69C13.87 15.72 13.95 15.73 14.04 15.73C14.21 15.73 14.34 15.67 14.45 15.56L15.21 14.81C15.46 14.56 15.7 14.37 15.93 14.25C16.16 14.11 16.39 14.04 16.64 14.04C16.83 14.04 17.03 14.08 17.25 14.17C17.47 14.26 17.7 14.39 17.95 14.56L21.26 16.91C21.52 17.09 21.7 17.3 21.81 17.55C21.91 17.8 21.97 18.05 21.97 18.33Z"})}),export:e=>(0,a.jsxs)("svg",{...i(e.className),children:[(0,a.jsx)("path",{d:"M16.44 8.89999C20.04 9.20999 21.51 11.06 21.51 15.11V15.24C21.51 19.71 19.72 21.5 15.25 21.5H8.73998C4.26998 21.5 2.47998 19.71 2.47998 15.24V15.11C2.47998 11.09 3.92998 9.23999 7.46998 8.90999"}),(0,a.jsx)("path",{d:"M12 15V3.62"}),(0,a.jsx)("path",{d:"M15.35 5.85L12 2.5L8.65002 5.85"})]}),monitor:e=>(0,a.jsxs)("svg",{...i(e.className),children:[(0,a.jsx)("path",{d:"M6.44 2H17.55C21.11 2 22 2.89 22 6.44V12.77C22 16.33 21.11 17.21 17.56 17.21H6.44C2.89 17.22 2 16.33 2 12.78V6.44C2 2.89 2.89 2 6.44 2Z"}),(0,a.jsx)("path",{d:"M12 17.22V22"}),(0,a.jsx)("path",{d:"M2 13H22"}),(0,a.jsx)("path",{d:"M7.5 22H16.5"})]}),user:e=>(0,a.jsxs)("svg",{...i(e.className),children:[(0,a.jsx)("circle",{cx:"12",cy:"8",r:"3.5"}),(0,a.jsx)("path",{d:"M5.5 19a6.5 6.5 0 0 1 13 0"})]}),userSquare:e=>(0,a.jsxs)("svg",{...i(e.className),children:[(0,a.jsx)("path",{d:"M18.14 21.62C17.26 21.88 16.22 22 15 22H8.99998C7.77998 22 6.73999 21.88 5.85999 21.62C6.07999 19.02 8.74998 16.97 12 16.97C15.25 16.97 17.92 19.02 18.14 21.62Z"}),(0,a.jsx)("path",{d:"M15 2H9C4 2 2 4 2 9V15C2 18.78 3.14 20.85 5.86 21.62C6.08 19.02 8.75 16.97 12 16.97C15.25 16.97 17.92 19.02 18.14 21.62C20.86 20.85 22 18.78 22 15V9C22 4 20 2 15 2ZM12 14.17C10.02 14.17 8.42 12.56 8.42 10.58C8.42 8.60002 10.02 7 12 7C13.98 7 15.58 8.60002 15.58 10.58C15.58 12.56 13.98 14.17 12 14.17Z"}),(0,a.jsx)("path",{d:"M15.58 10.58C15.58 12.56 13.98 14.17 12 14.17C10.02 14.17 8.42004 12.56 8.42004 10.58C8.42004 8.60002 10.02 7 12 7C13.98 7 15.58 8.60002 15.58 10.58Z"})]}),shield:e=>(0,a.jsxs)("svg",{...i(e.className),children:[(0,a.jsx)("path",{d:"M10.49 2.23L5.50003 4.11C4.35003 4.54 3.41003 5.9 3.41003 7.12V14.55C3.41003 15.73 4.19003 17.28 5.14003 17.99L9.44003 21.2C10.85 22.26 13.17 22.26 14.58 21.2L18.88 17.99C19.83 17.28 20.61 15.73 20.61 14.55V7.12C20.61 5.89 19.67 4.53 18.52 4.1L13.53 2.23C12.68 1.92 11.32 1.92 10.49 2.23Z"}),(0,a.jsx)("path",{d:"M9.05005 11.87L10.66 13.48L14.96 9.17999"})]}),lock:e=>(0,a.jsxs)("svg",{...i(e.className),children:[(0,a.jsx)("rect",{x:"5",y:"11",width:"14",height:"9",rx:"2"}),(0,a.jsx)("path",{d:"M8 11V8a4 4 0 0 1 8 0v3"})]}),search:e=>(0,a.jsxs)("svg",{...i(e.className),children:[(0,a.jsx)("path",{d:"M11.5 21C16.7467 21 21 16.7467 21 11.5C21 6.25329 16.7467 2 11.5 2C6.25329 2 2 6.25329 2 
111.5C2 16.7467 6.25329 21 11.5 21Z"}),(0,a.jsx)("path",{d:"M22 22L20 20"})]}),tick:e=>(0,a.jsx)("svg",{...i(e.className),children:(0,a.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7"})}),tickCircle:e=>(0,a.jsxs)("svg",{...i(e.className),children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,a.jsx)("path",{d:"M8.5 12.5l2.5 2.5 4.5-5"})]}),edit:e=>(0,a.jsxs)("svg",{...i(e.className),children:[(0,a.jsx)("path",{d:"M11 2H9C4 2 2 4 2 9V15C2 20 4 22 9 22H15C20 22 22 20 22 15V13"}),(0,a.jsx)("path",{d:"M16.04 3.02001L8.16 10.9C7.86 11.2 7.56 11.79 7.5 12.22L7.07 15.23C6.91 16.32 7.68 17.08 8.77 16.93L11.78 16.5C12.2 16.44 12.79 16.14 13.1 15.84L20.98 7.96001C22.34 6.60001 22.98 5.02001 20.98 3.02001C18.98 1.02001 17.4 1.66001 16.04 3.02001Z"}),(0,a.jsx)("path",{d:"M14.91 4.14999C15.58 6.53999 17.45 8.40999 19.85 9.08999"})]}),x:e=>(0,a.jsx)("svg",{...i(e.className),children:(0,a.jsx)("path",{d:"M6 6l12 12M18 6L6 18"})}),danger:e=>(0,a.jsxs)("svg",{...i(e.className),children:[(0,a.jsx)("path",{d:"M12 9V14"}),(0,a.jsx)("path",{d:"M12.0001 21.41H5.94005C2.47005 21.41 1.02005 18.93 2.70005 15.9L5.82006 10.28L8.76006 5C10.5401 1.79 13.4601 1.79 15.2401 5L18.1801 10.29L21.3001 15.91C22.9801 18.94 21.5201 21.42 18.0601 21.42H12.0001V21.41Z"}),(0,a.jsx)("path",{d:"M11.9945 17H12.0035",strokeWidth:2})]}),info:e=>(0,a.jsxs)("svg",{...i(e.className),children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,a.jsx)("path",{d:"M12 11v5M12 8h0"})]}),chevronDown:e=>(0,a.jsx)("svg",{...i(e.className),children:(0,a.jsx)("path",{d:"M6 9l6 6 6-6"})})};function l(e){let{name:t,className:s}=e,n=r[t];return n?(0,a.jsx)(n,{className:s}):null}let o=["Aerospace & Defense","Alternative Energy","Automobiles & Parts","Banks","Beverages","Chemicals","Construction & Materials","Consumer Discretionary","Consumer Goods","Consumer Services","Consumer Staples","Education Services","Electricity","Electronic & Electrical Equipment","Energy","Equity Investment Instruments","Financial Services","Financials","Fixed Line Telecommunications","Food & Beverage","Food & Drug Retailers","Food Producers","Forestry & Paper","Gas, Water & Multi-Utilities","General Consumer Services","General Industrials","General Retailers","Government Agencies","Health Care","Health Care Equipment & Services","Household Goods & Home Construction","Industrial Engineering","Industrial Metals & Mining","Industrial Transportation","Industrials","Information Technology","Insurance","Legal Services","Leisure Goods","Life Insurance","Materials","Media","Mining","Mobile Telecommunications","Non-Profit","Nonequity Investment Instruments","Nonlife Insurance","Oil & Gas","Oil & Gas Producers","Oil Equipment, Services & Distribution","Personal Goods","Pharmaceuticals & Biotechnology","Professional Services","Real Estate","Real Estate Investment & Services","Real Estate Investment Trusts","Retail","Software & Computer Services","Support Services","Technology Hardware & Equipment","Telecommunication Services","Telecommunications","Tobacco","Travel & Leisure","Utilities"],c=[["allied health","Allied health"],["physio","Allied health"],["psycholog","Allied health"],["dental","Allied health"],["dentist","Allied health"],["health","Healthcare & medical"],["medical","Healthcare & medical"],["clinic","Healthcare & medical"],["hospital","Healthcare & medical"],["information technology","Information technology & software"],["software","Information technology & software"],["saas","Information technology & software"],["it support","Information technology & software"],["it services","Information technology & software"],["managed services","Information technology & software"],["technology","Information technology & software"],["developer","Information technology & software"],["web develop","Information technology & software"],["account","Accounting & bookkeeping"],["bookkeep","Accounting & bookkeeping"],["legal","Legal services"],["solicitor","Legal services"],["barrister","Legal services"],["financ","Financial services"],["mortgage","Financial services"],["invest","Financial services"],["market","Marketing & advertising"],["advertis","Marketing & advertising"],["seo","Marketing & advertising"],["consult","Consulting"],["wholesale","Wholesale & distribution"],["distribut","Wholesale & distribution"],["retail","Retail & e-commerce"],["e-commerce","Retail & e-commerce"],["ecommerce","Retail & e-commerce"],["online store","Retail & e-commerce"],["online shop","Retail & e-commerce"],["shop","Retail & e-commerce"],["manufactur","Manufacturing"],["factory","Manufacturing"],["construct","Construction & trades"],["builder","Construction & trades"],["building","Construction & trades"],["plumb","Construction & trades"],["electric","Construction & trades"],["carpent","Construction & trades"],["trade","Construction & trades"],["real estate","Real estate"],["property","Real estate"],["education","Education & training"],["training","Education & training"],["school","Education & training"],["tutor","Education & training"],["coaching","Education & training"],["hospital
1ity","Hospitality & food services"],["restaurant","Hospitality & food services"],["cafe","Hospitality & food services"],["catering","Hospitality & food services"],["food","Hospitality & food services"],["tourism","Tourism & events"],["event","Tourism & events"],["travel","Tourism & events"],["transport","Transport & logistics"],["logistic","Transport & logistics"],["freight","Transport & logistics"],["courier","Transport & logistics"],["delivery","Transport & logistics"],["automotive","Automotive"],["mechanic","Automotive"],["vehicle","Automotive"],["agricultur","Agriculture"],["farm","Agriculture"],["beauty","Beauty & personal care"],["cosmetic","Beauty & personal care"],["skin care","Beauty & personal care"],["skincare","Beauty & personal care"],["salon","Beauty & personal care"],["hairdress","Beauty & personal care"],["personal care","Beauty & personal care"],["fitness","Fitness & wellness"],["gym","Fitness & wellness"],["wellness","Fitness & wellness"],["yoga","Fitness & wellness"],["creative","Creative & media"],["media","Creative & media"],["design","Creative & media"],["photograph","Creative & media"],["video","Creative & media"],["film","Creative & media"],["not-for-profit","Not-for-profit"],["not for profit","Not-for-profit"],["nonprofit","Not-for-profit"],["non-profit","Not-for-profit"],["charity","Not-for-profit"],["professional service","Professional services"]];function d(e){let t=(e||"").trim().toLowerCase();if(!t)return"";let s=o.find(e=>e.toLowerCase()===t);if(s)return s;for(let[e,s]of c)if(t.includes(e))return s;return""}function u(e){let t=String(e||"").toLowerCase().replace(/aud|usd|a\$|us\$|\$|,|\s/g,"").trim(),s=1;/m$/.test(t)?(s=1e6,t=t.replace(/m$/,"")):/k$/.test(t)&&(s=1e3,t=t.replace(/k$/,""));let a=parseFloat(t);return isNaN(a)?0:a*s}function m(e){let t=u(e);return t?t<25e4?"Under $250K":t<5e5?"$250K – 500K":t<1e6?"$500K – 1M":t<5e6?"$1 – 5M":t<=1e7?"$5 – 10M":"Over $10M":""}function p(e){let t=Math.round(u(e));return t?t<=10?"1-10":t<=30?"11-30":t<=50?"31-50":t<=100?"51-100":"100+":""}function x(e){let t=(e||"").replace(/[\s().-]/g,""),s=t.replace(/^(?:\+?61)/,"0");return!!/^0[2-478]\d{8}$/.test(s)||/^\+\d{8,15}$/.test(t)&&!t.startsWith("+61")}let h={contacts:"contact_details",documentUpload:"document_upload",method:"business_profile",business:"business_profile",abn:"business_profile",bizName:"business_profile",website:"business_profile",location:"business_profile",businessAddress:"business_profile",years:"business_profile",industry:"business_profile",activities:"business_profile",staff:"business_profile",revenue:"business_profile",quoteTiming:"business_profile",quoteDate:"business_profile",overseasIncome:"cyber_risk",overseasCountries:"cyber_risk",records:"cyber_risk",backup:"cyber_risk",mfa:"cyber_risk",cloud:"cyber_risk",claims:"claims_history",targetPremium:"coverage",recommendation:"coverage",done:"review"},b=e=>e?h[e]:void 0,f=[{id:"contact",label:"Contact details",steps:["contacts"]},{id:"business",label:"Business profile",steps:["method","documentUpload","business","abn","bizName","website","location","businessAddress","years","industry","activities","staff","revenue","quoteTiming","quoteDate"]},{id:"cyber",label:"Cyber risk",steps:["overseasIncome","overseasCountries","records","backup","mfa","cloud","targetPremium","claims"]},{id:"coverage",label:"Coverage",steps:["recommendation"]}],g=(e,t)=>"documentUpload"!==e&&("overseasCountries"===e?"Yes"===t.overseasIncome:"quoteDate"!==e||"Specific date"===t.quoteTiming),y=["Software development","IT consulting & support","Web design & development","Digital marketing","Cloud services","Data analysis","Cybersecurity services","Graphic design","Business consulting","Bookkeeping","Financial advice","Legal advice","Retail sales","Online sales","Wholesale","Product manufacturing","Installation & maintenance","Project management","Training & coaching","Customer support"],v=[{key:"cyber",name:"Cyber & Technology",locked:!0,defaultOn:!0,limits:["$250K","$500K","$1M","$2M","$5M","$10M","$20M"]},{key:"ppl",name:"Public & Products Liability",defaultOn:!1,limits:["$5M","$10M","$20M"],description:"Covers third party injury & property damage claims from your services, products or at your business."},{key:"pi",name:"Professional Indemnity",defaultOn:!1,limits:["$1M","$2M","$5M","$10M","$20M"],description:"Covers negligence claims from third parties to help protect your business from professional errors."},{key:"do",name:"Directors & Officers",defaultOn:!1,limits:["$1M","$2M","$5M","$10M"],description:"Covers claims against company executives and senior management for litigation against the company."}],j=[{id:"contacts",key:"firstName",type:"intake",prompt:"Great, let's get you set up. Please enter your name, email and ph
1one number below, and we'll take it from there.",skip:e=>!!(e.firstName&&e.email&&e.phone)},{id:"method",key:"method",type:"option-cards",prompt:"How would you like to provide your business details?",cards:[{value:"chat",title:"Chat with Quote Assistant",subtitle:"We'll ask a few quick questions",icon:"message"},{value:"upload",title:"Upload policy documents",subtitle:"Share a policy schedule or COC",icon:"export"},{value:"expert",title:"Talk to an expert",subtitle:"A specialist will call you back",icon:"call",href:"https://www.upcover.com/book-a-call?source=specialty"}],next:e=>"upload"===e.method?"documentUpload":"business"},{id:"documentUpload",key:"method",type:"document-upload",prompt:"Upload your policy documents",next:()=>"abn"},{id:"business",key:"businessName",type:"business-lookup",prompt:"Can you share your business name, website, or ABN?\n\nWe'll fill out the rest of the business profile automatically.",placeholder:"Business name, website or ABN"},{id:"abn",key:"abn",type:"abn",prompt:"What's your ABN?",placeholder:"12 345 678 901",skip:e=>!!e.abn},{id:"bizName",key:"businessName",type:"name",prompt:"What's your registered business name?",placeholder:"Business name",skip:e=>!!e.businessName},{id:"website",key:"website",type:"website",prompt:"What's your business website?",placeholder:"yourbusiness.com.au",skip:e=>!!e.website},{id:"location",key:"location",type:"location",prompt:"Where is your business located?",placeholder:"e.g. Sydney or NSW",skip:e=>!!e.location},{id:"businessAddress",key:"businessAddress",type:"address",prompt:"What is your business address?",placeholder:"e.g. 12 Main St, Sydney NSW 2000",skip:e=>!!e.businessAddress},{id:"years",key:"yearsInBusiness",type:"number",prompt:"How many years has your business been operating?",placeholder:"e.g. 5",skip:e=>!!e.yearsInBusiness},{id:"industry",key:"industry",type:"industry-select",prompt:"Which industry best describes your business?",skip:e=>!!e.industry},{id:"activities",key:"activities",type:"long-text",prompt:"What does your business do day to day?",hint:"For faster quoting, try to include your industry, your business activities and/or how your product is used by your customers.",skip:e=>!!e.activities},{id:"staff",key:"staff",type:"options",prompt:"How many employees do you have?",options:["1-10","11-30","31-50","51-100","100+","Not sure"],skip:e=>!!e.staff},{id:"revenue",key:"revenue",type:"options",prompt:"What's your expected revenue for the next 12 months?",options:["Under $250K","$250K – 500K","$500K – 1M","$1 – 5M","$5 – 10M","Over $10M"],skip:e=>!!e.revenue},{id:"quoteTiming",key:"quoteTiming",type:"options",prompt:"When do you need the quotes by?",options:["ASAP","This week","This month","Specific date"],skip:e=>!!e.quoteTiming},{id:"quoteDate",key:"quoteDate",type:"date",prompt:"Please specify the date you want quotes by",skip:e=>"Specific date"!==e.quoteTiming||!!e.quoteDate},{id:"overseasIncome",key:"overseasIncome",type:"yesno",prompt:"Do you generate any revenue from outside Australia?",options:["Yes","No"]},{id:"overseasCountries",key:"overseasCountries",type:"country-split",prompt:"Which countries does your revenue come from? Australia is pre-filled at 100% and adjusts as you add other countries. The shares must total 100%.",skip:e=>"Yes"!==e.overseasIncome||Array.isArray(e.overseasCountries)&&e.overseasCountries.length>0},{id:"records",key:"records",type:"options",prompt:"How many individuals' personal information records do you store?",options:["None","1–1,000","1,000–10,000","10,000–50,000","50,000+"]},{id:"backup",key:"backup",type:"options",prompt:"How often is your business data backed up?",options:["Daily","Weekly","Monthly","Not backed up"]},{id:"mfa",key:"mfa",type:"multi",prompt:"Where do you have multi-factor authentication (MFA) enabled?",options:["Email","VPN / remote access","Cloud apps","Admin accounts","Not sure","No MFA"]},{id:"cloud",key:"cloud",type:"multi",prompt:"Which cloud tools does your business use?",options:["Cloudflare — DNS & hosting","Zoho Books","Microsoft 365 / Azure / SharePoint / Teams","Google Worksp
1ace","AWS","Other","Not sure"]},{id:"targetPremium",key:"targetPremium",type:"premium",prompt:"What is your target premium?",skip:e=>!!e.targetPremium},{id:"claims",key:"claims",type:"yesno",prompt:"Have you had any cyber claims or incidents in the past 5 years?",options:["Yes","No"]},{id:"recommendation",key:"covers",type:"recommendation",prompt:"Based on your business profile, these covers may be relevant to your business. Select the products you’d like quoted:"},{id:"done",key:"method",type:"done",prompt:"You're all set."}],w=Object.fromEntries(j.map((e,t)=>[e.id,t])),N=j[0].id,k=e=>j[w[e]],C=w.contacts,S=e=>w[e],M="text-[16px]";function I(e){let{children:t}=e;return(0,a.jsx)("div",{className:"max-w-[85%] self-start rounded-bubble rounded-bl-[4px] bg-white px-4 py-3 text-[14.5px] leading-relaxed text-ink shadow-bubble animate-bubbleIn whitespace-pre-line",children:t})}function F(e){let{children:t}=e;return(0,a.jsx)("div",{className:"max-w-[85%] self-end rounded-bubble rounded-br-[4px] bg-brand px-4 py-2.5 text-[14.5px] font-medium text-white animate-bubbleIn",children:t})}function _(){return(0,a.jsxs)("div",{className:"max-w-[85%] self-start rounded-bubble rounded-bl-[4px] bg-white px-4 py-3.5 shadow-bubble",children:[(0,a.jsx)("span",{className:"inline-flex gap-1",children:[0,1,2].map(e=>(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-slate-300",style:{animation:"qaBlink 1.2s ".concat(.2*e,"s infinite both")}},e))}),(0,a.jsx)("style",{children:"@keyframes qaBlink{0%,60%,100%{opacity:.3}30%{opacity:1}}"})]})}function B(e){let{cards:t,chosen:s,onPick:n}=e;return(0,a.jsx)("div",{className:"flex w-full flex-col gap-2.5 self-stretch animate-bubbleIn",children:t.map(e=>(0,a.jsx)(T,{card:e,disabled:s,onClick:()=>e.href?function(e){try{let t=new URL(e,window.location.href),s=new URL(window.location.href).searchParams;["utm_source","utm_medium","utm_campaign","utm_term","utm_content","utm_id","gclid","fbclid"].forEach(e=>{let a=s.get(e);a&&!t.searchParams.has(e)&&t.searchParams.set(e,a)}),window.open(t.toString(),"_blank","noopener,noreferrer")}catch(t){window.open(e,"_blank","noopener,noreferrer")}}(e.href):n(e.value,e.title)},e.value))})}function T(e){let{card:t,disabled:s,onClick:n}=e;return(0,a.jsxs)("button",{onClick:n,disabled:s,className:"group flex w-full items-center gap-3 rounded-card border border-line bg-white p-3.5 text-left transition enabled:hover:border-brand enabled:hover:bg-[#EEF3FF] enabled:hover:shadow-sm disabled:opacity-60",children:[(0,a.jsx)("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-brand text-white",children:(0,a.jsx)(l,{name:t.icon,className:"h-5 w-5"})}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"flex items-center gap-2",children:(0,a.jsx)("span",{className:"whitespace-nowrap font-bold text-ink",children:t.title})}),(0,a.jsx)("span",{className:"block text-[13px] text-muted",children:t.subtitle})]}),(0,a.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-chat text-brand transition-colors group-enabled:group-hover:bg-brand group-enabled:group-hover:text-white",children:(0,a.jsx)(l,{name:"arrowRight",className:"h-4 w-4"})})]})}let A=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.trim()),L=e=>x(e),P=(e,t)=>{let s=(t||"").trim();return s?"email"!==e||A(s)?"phone"!==e||L(s)?null:"Enter a valid phone number":"Email must be formatted correctly":"Required"};function D(e){let{onSubmit:t,onInvalid:s}=e,[i,r]=n.useState(""),[o,c]=n.useState(""),[d,u]=n.useState(""),[m,p]=n.useState(""),[x,h]=n.useState({}),[b,f]=n.useState(!1),g=P("firstName",i),y=P("email",d),v=P("phone",m),j=!g&&!y&&!v,w=()=>{h({firstName:!0,email:!0,phone:!0}),j||null==s||s(),j&&!b&&(f(!0),t({firstName:i.trim(),lastName:o.trim(),email:d.trim(),phone:m.trim()}))};if(b)return null;let N=e=>"w-full rounded-lg border px-3 py-2 ".concat(M," outline-none focus:border-brand ").concat(e?"border-[#FF515D]":"border-line");return(0,a.jsxs)("div",{className:"flex w-full flex-1 flex-col animate-bubbleIn",children:[(0,a.jsx)("div",{className:"flex flex-1 flex-col justify-center",children:(0,a.jsxs)("div",{className:"rounded-card border border-line bg-white p-4 shadow-bubble",children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center gap-2 font-bold text-ink",children:[(0,a.jsx)(l,{name:"userSquare",className:"h-[18px] w-[18px]"})," Contact details"]}
1),(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,a.jsxs)("label",{className:"grid grid-cols-[92px_1fr] items-start gap-2",children:[(0,a.jsx)("span",{className:"pt-2.5 text-[12.5px] text-muted",children:"First name"}),(0,a.jsxs)("span",{children:[(0,a.jsx)("input",{value:i,autoFocus:!0,onChange:e=>r(e.target.value),onBlur:()=>h(e=>({...e,firstName:!0})),onKeyDown:e=>"Enter"===e.key&&w(),placeholder:"First name",className:N(!!x.firstName&&!!g)}),x.firstName&&g&&(0,a.jsx)("span",{className:"mt-1 block rounded-md bg-red-50 px-2 py-1 text-[11.5px] font-medium text-[#B42318]",children:g})]})]}),(0,a.jsxs)("label",{className:"grid grid-cols-[92px_1fr] items-start gap-2",children:[(0,a.jsx)("span",{className:"pt-2.5 text-[12.5px] text-muted",children:"Last name"}),(0,a.jsx)("span",{children:(0,a.jsx)("input",{value:o,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&w(),placeholder:"Last name",className:N(!1)})})]}),(0,a.jsxs)("label",{className:"grid grid-cols-[92px_1fr] items-start gap-2",children:[(0,a.jsx)("span",{className:"pt-2.5 text-[12.5px] text-muted",children:"Email"}),(0,a.jsxs)("span",{children:[(0,a.jsx)("input",{value:d,type:"email",inputMode:"email",onChange:e=>u(e.target.value),onBlur:()=>h(e=>({...e,email:!0})),onKeyDown:e=>"Enter"===e.key&&w(),placeholder:"Email address",className:N(!!x.email&&!!y)}),x.email&&y&&(0,a.jsx)("span",{className:"mt-1 block rounded-md bg-red-50 px-2 py-1 text-[11.5px] font-medium text-[#B42318]",children:y})]})]}),(0,a.jsxs)("label",{className:"grid grid-cols-[92px_1fr] items-start gap-2",children:[(0,a.jsx)("span",{className:"pt-2.5 text-[12.5px] text-muted",children:"Phone"}),(0,a.jsxs)("span",{children:[(0,a.jsx)("input",{value:m,type:"tel",inputMode:"tel",onChange:e=>p(e.target.value),onBlur:()=>h(e=>({...e,phone:!0})),onKeyDown:e=>"Enter"===e.key&&w(),placeholder:"e.g. 0412 345 678",className:N(!!x.phone&&!!v)}),x.phone&&v&&(0,a.jsx)("span",{className:"mt-1 block rounded-md bg-red-50 px-2 py-1 text-[11.5px] font-medium text-[#B42318]",children:v})]})]})]})]})}),(0,a.jsx)("div",{className:"pt-3",children:(0,a.jsx)("button",{onClick:w,className:"w-full rounded-xl bg-brand py-3 font-bold text-white hover:bg-brand-600",children:"Continue"})})]})}let E=["Checking public info","Extracting business details","Building profile"];function q(e){let{stage:t,failed:s}=e;return(0,a.jsx)("div",{className:"max-w-[85%] self-start rounded-card bg-white p-4 shadow-bubble animate-bubbleIn",children:(0,a.jsx)("div",{className:"flex flex-col gap-3",children:E.map((e,n)=>{let i=n<t,r=n===t;return(0,a.jsxs)("div",{className:"flex items-center gap-2.5 text-[14px]",children:[i?(0,a.jsx)(l,{name:"tickCircle",className:"h-5 w-5 text-brand"}):s&&n===t?(0,a.jsx)(l,{name:"x",className:"h-5 w-5 text-[#F04438]"}):r?(0,a.jsx)("span",{className:"h-5 w-5 rounded-full border-2 border-brand border-t-transparent animate-spinSlow"}):(0,a.jsx)("span",{className:"h-5 w-5 rounded-full border-2 border-slate-200"}),(0,a.jsx)("span",{className:i||r?"text-ink":"text-slate-400",children:e})]},e)})})})}let R=[["businessName","Business name"],["website","Website"],["location","Location"],["abn","ABN"],["yearsInBusiness","Years in Business"],["industry","Industry"]],O=[["businessName","Business name","Registered business name"],["website","Website","https://..."],["location","Location","City, State"],["abn","ABN","11-digit ABN"],["yearsInBusiness","Years in Business","e.g. 5"]],H=e=>(e||"").replace(/\D/g,"");function $(e){let{label:t,children:s}=e;return(0,a.jsxs)("label",{className:"grid grid-cols-[92px_1fr] items-start gap-2",children:[(0,a.jsx)("span",{className:"pt-2 text-[12.5px] text-muted",children:t}),(0,a.jsx)("span",{children:s})]})}function U(e){let{profile:t,decided:s,onConfirm:i,onSave:r}=e,[c,d]=n.useState(!1),[u,m]=n.useState(t),[p,x]=n.useState("");n.useEffect(()=>{c||m(t)},[t]);let h=(e,t)=>m(s=>({...s,[e]:t})),b=e=>{let t=e.trim();t&&!u.activities.includes(t)&&m(e=>({...e,activities:[...e.activities,t]})),x("")},f=e=>m(t=>({...t,activities:t.activities.filter(t=>t!==e)})),g=!!u.abn.trim()&&11!==H(u.abn).length,v=!!u.businessName.trim()&&!g;return c?(0,a.jsx)("div",{className:"max-w-[92%] self-start animate-bubbleIn",children:(0,a.jsxs)("div",{className:"rounded-bubble rounded-bl-[4px] bg-white p-3.5 shadow-bubble",children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 font-bold text-ink",children:[(0,a.jsx)(l,{name:"buildings",className:"h-[18px] w-[18px]"})," Business Profile"]}),(0,a.jsxs)("button",{onClick:()=>v&&r({...u,businessName:u.businessName.trim()}),disabled:!v,className:"flex items-center gap-1 text-[14px] font-semibold text-brand disabled:text-slate-300",children:["Save ",(0,a.jsx)(l,{name:"tickCircle",className:"h-4 w-4"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[O.map(e=>{let[t,s,n]=e;return(0,a.jsxs)($,{label:s,children:[(0,a.jsx)("input",{value:String(u[t]||""),inputMode:"abn"===t?"numeric":void 0,onChange:e=>h(t,"abn"===t?e.target.value.replace(/\D/g,"").slice(0,11):e.target.value),placeholder:n,className:"w-full rounded-lg border px-3 py-2 ".concat(M," outline-none focus:border-brand ").concat("abn"===t&&g?"border-[#F04438]":"border-line")}),"abn"===t&&g&&(0,a.jsx)("span",{className:"mt-1 block text-[11px] font-medium text-[#B42318]",children:"ABN must be 11 digits"})]},t)}),(0,a.jsx)($,{label:"Industry",children:(0,a.jsxs)("span",{className:"relative block",children:[(0,a.jsxs)("select",{value:u.industry,onChange:e=>m(t=>({...t,industry:e.target.value})),className:"w-full appearance-none rounded-lg border border-line bg-white px-3 py-2 pr-8 ".concat(M," text-ink outline-none focus:border-brand"),children:[(0,a.jsx)("option",{value:"",children:"Select an industry"}),o.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]}),(0,a.jsx)(l,{name:"chevronDown",className:"pointer-events-none absolute right-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted"})]})}),(0,a.jsx)($,{label:"Activities",children:(0,a.jsxs)("span",{className:"block rounded-lg border border-line p-2",children:[u.activities.length>0&&(0,a.jsx)("span",{className:"mb-1.5 flex flex-wrap gap-1.5",children:u.activities.map(e=>(0,a.jsxs)("span",{className:"flex items-center gap-1 rounded-full bg-brand px-2 py-0.5 text-[12px] font-medium text-white",children:[e,(0,a.jsx)("button",{onClick:()=>f(e),"aria-label":"Remove ".concat(e),children:(0,a.jsx)(l,{name:"x",className:"h-3 w-3"})})]},e))}),(0,a.jsx)("input",{list:"qa-activity-suggestions",value:p,onChange:e=>x(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),b(p))},placeholder:"Type an activity, press Enter",className:"w-full px-1.5 py-1 ".concat(M," outline-none")}),(0,a.jsx)("datalist",{id:"qa-activity-suggestions",children:y.map(e=>(0,a.jsx)("option",{value:e},e))})]})})]})]})}):(0,a.jsxs)("div",{className:"max-w-[92%] self-start animate-bubbleIn",children:[(0,a.jsxs)("div",{className:"rounded-bubble rounded-bl-[4px] bg-white p-3.5 shadow-bubble",children:[(0,a.jsx)("p",{className:"mb-3 px-0.5 text-[14.5px] text-ink",children:"Found it! Please confirm this is your business:"}),(0,a.jsxs)("div",{className:"rounded-card border border-line bg-white p-4",children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 font-bold text-ink",children:[(0,a.jsx)(l,{name:"buildings",className:"h-[18px] w-[18px]"})," Business Profile"]}),!s&&(0,a.jsx)("button",{onClick:()=>d(!0),"aria-label":"Edit details",className:"text-muted hover:text-brand",children:(0,a.jsx)(l,{name:"edit",className:"h-4 w-4"})})]}),(0,a.jsxs)("div",{className:"divide-y divide-slate-100",children:[R.filter(e=>{let[s]=e;return String(t[s]||"").trim()}).map(e=>{let[s,n]=e;return(0,a.jsxs)("div",{className:"flex justify-between gap-3 py-2 text-[13.5px]",children:[(0,a.jsx)("span",{className:"text-muted",children:n}),(0,a.jsx)("span",{className:"text-right font-medium text-ink",children:String(t[s])})]},s)}),t.activities.length>0&&(0,a.jsxs)("div",{className:"flex justify-between gap-3 py-2 text-[13.5px]",children:[(0,a.jsx)("span",{className:"text-muted",children:"Activities"}),(0,a.jsx)("span",{className:"text-right font-medium text-ink",children:t.activities.join(", ")})]})]})]})]}),!s&&(0,a.jsxs)("div",{className:"mt-3 flex flex-col gap-2",children:[(0,a.jsx)("button",{onClick:i,className:"rounded-xl bg-brand py-3 font-bold text-white hover:bg-brand-600",children:"Yes, that's my business"}),(0,a.jsx)("button",{onClick:()=>d(!0),className:"py-1.5 text-[13.5px] font-medium text-ink underline",children:"That's not my business, enter manually"})]})]})}function W(e){let{label:t,onClick:s,disabled:n,className:i=""}=e;return(0,a.jsxs)("button",{onClick:s,disabled:n,className:"group flex items-center justify-center overflow-hidden transition-[border-radius] duration-[160ms] ease-linear hover:rounded-none ".concat(i),children:[!n&&(0,a.jsx)("span",{"aria-hidden":!0,
1className:"flex w-0 items-center overflow-hidden opacity-0 transition-all duration-[160ms] ease-linear group-hover:w-[20px] group-hover:opacity-100",children:(0,a.jsx)("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",className:"min-w-[16px] -translate-x-[12px] transition-transform duration-[160ms] ease-linear group-hover:translate-x-0",children:(0,a.jsx)("path",{d:"M15.7062 6.70859C16.0969 6.31797 16.0969 5.68359 15.7062 5.29297L10.7063 0.292969C10.3156 -0.0976562 9.68125 -0.0976562 9.29062 0.292969C8.9 0.683594 8.9 1.31797 9.29062 1.70859L12.5844 5.00234H1C0.446875 5.00234 0 5.44922 0 6.00234C0 6.55547 0.446875 7.00234 1 7.00234H12.5844L9.29062 10.2961C8.9 10.6867 8.9 11.3211 9.29062 11.7117C9.68125 12.1023 10.3156 12.1023 10.7063 11.7117L15.7062 6.71172V6.70859Z",fill:"currentColor"})})}),(0,a.jsx)("span",{className:n?"":"transition-[margin] duration-[160ms] ease-linear group-hover:ml-[10px]",children:t})]})}function V(e){let{text:t}=e,[s,i]=n.useState(!1);return(0,a.jsxs)("span",{className:"relative inline-flex",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[(0,a.jsx)("button",{type:"button","aria-label":"More information",onClick:e=>{e.stopPropagation(),i(e=>!e)},className:"text-muted transition-colors hover:text-brand",children:(0,a.jsx)(l,{name:"info",className:"h-4 w-4"})}),s&&(0,a.jsxs)("span",{role:"tooltip",className:"absolute bottom-full left-1/2 z-30 mb-2 w-[200px] -translate-x-1/2 rounded-[10px] border border-line bg-white px-3 py-2 text-[12px] font-normal leading-snug text-ink shadow-lg",children:[t,(0,a.jsx)("span",{className:"absolute left-1/2 top-full h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rotate-45 border-b border-r border-line bg-white"})]})]})}function z(e){let{value:t,onChange:s,showError:n}=e,i=t||{},r=(e,t)=>{let a=i[e]||{enabled:!1};s({...i,[e]:{...a,...t}})};return(0,a.jsx)("div",{className:"flex flex-col gap-2.5",children:v.map(e=>{let t=i[e.key]||{enabled:!!e.locked||e.defaultOn,limit:e.defaultLimit},s=!!e.locked||!!t.enabled,o=!!n&&s&&!t.limit;return(0,a.jsxs)("div",{className:"rounded-xl border border-line p-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1.5 font-semibold text-ink",children:[e.name,e.description&&(0,a.jsx)(V,{text:e.description})]}),(0,a.jsx)(G,{on:s,disabled:e.locked,onClick:()=>!e.locked&&r(e.key,{enabled:!t.enabled})})]}),s&&(0,a.jsxs)("label",{className:"mt-2 flex items-center gap-2 text-[13px] text-muted",children:["Limit:",(0,a.jsxs)("span",{className:"relative inline-flex",children:[(0,a.jsxs)("select",{value:t.limit||"",onChange:t=>r(e.key,{limit:t.target.value}),className:"appearance-none rounded-md border bg-white py-1 pl-2.5 pr-7 ".concat(M," text-ink outline-none focus:border-brand ").concat(o?"border-[#FF515D]":"border-line"),children:[(0,a.jsx)("option",{value:"",children:"Select a limit"}),e.limits.map(e=>(0,a.jsx)("option",{value:e,children:e},e)),(0,a.jsx)("option",{value:"Other",children:"Other"})]}),(0,a.jsx)(l,{name:"chevronDown",className:"pointer-events-none absolute right-1.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted"})]})]})]},e.key)})})}function K(e){let{value:t,onChange:s,onContinue:i}=e,r=t||{},[o,c]=n.useState(!1),d=v.filter(e=>{let t=r[e.key];return(!!e.locked||!!(null==t?void 0:t.enabled))&&!(null==t?void 0:t.limit)});return(0,a.jsxs)("div",{className:"flex w-full max-w-[92%] flex-col gap-3 self-stretch animate-bubbleIn",children:[(0,a.jsxs)("div",{className:"rounded-card border border-line bg-white p-4 shadow-bubble",children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center gap-2 font-bold text-ink",children:[(0,a.jsx)(l,{name:"shield",className:"h-[18px] w-[18px]"})," Coverage Options"]}),(0,a.jsx)(z,{value:t,onChange:s,showError:o})]}),(0,a.jsx)("button",{onClick:()=>{if(d.length){c(!0);return}i()},className:"w-full rounded-xl bg-brand py-3.5 font-bold text-white transition hover:bg-brand-600",children:"Continue"}),o&&d.length>0&&(0,a.jsx)("p",{className:"rounded-lg bg-[#FFF1F2] px-3 py-2 text-center text-[13px] font-medium text-[#FF515D]",children:"Please select limits for all selected covers"})]})}function G(e){let{on:t,disabled:s,onClick:n}=e;return(0,a.jsx)("button",{onClick:n,disabled:s,"aria-pressed":t,className:"relative h-6 w-11 rounded-full transition ".concat(t?"bg-brand":"bg-slate-300"," ").concat(s?"cursor-not-allowed opacity-70":""),children:(0,a.jsx)("span",{className:"absolute top-0.5 h-5 w-5 rounded-full bg-white transition-all ".concat(t?"left-[22px]":"left-0.5")})})}function Z(e){let t=e.replace(/\D/g,"");if(11!==t.length)return!1;let s=[10,1,3,5,7,9,11,13,15,17,19],a=t.split("").map(Number);return a[0]-=1,a.reduce((e,t,a)=>e+t*s[a],0)%89==0}let Q=e=>e.length>=2&&/[a-z]/i.test(e)&&!/^[\d\s.\-]+$/.test(e),Y=e=>{let t=e.replace(/^https?:\/\//i,"").replace(/^www\./i,"").split("/")[0];return/^([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,}$/i.test(t)},J=e=>/[a-z]{2,}/i.test(e),X=e=>{let t=e.trim();return t.length>=6&&/[a-z]/i.test(t)&&/\s/.test(t)};function ee(e){let{msg:t}=e;return(0,a.jsx)("div",{className:"absolute bottom-full left-0 z-20 mb-1.5",children:(0,a.jsxs)("div",{className:"relative rounded-[10px] border-[1.5px] border-[#FF515D] bg-[#FFF5F6] px-3.5 py-2 text-[12.5px] font-medium text-[#FF515D] shadow-sm",children:[t,(0,a.jsx)("span",{className:"absolute left-5 top-full h-2.5 w-2.5 -translate-y-1/2 rotate-45 border-b-[1.5px] border-r-[1.5px] border-[#FF515D] bg-[#FFF5F6]"})]})})}let et=[{key:"name",label:"Business name",placeholder:"e.g. Acme Pty Ltd"},{key:"website",label:"Website",placeholder:"e.g. yourbusiness.com.au"},{key:"abn",label:"ABN",placeholder:"e.g. 12 345 678 901"}];function es(e){let{onSubmit:t}=e,[s,i]=n.useState(""),[r,o]=n.useState(""),[c,d]=n.useState(null),u=et.find(e=>e.key===s),m=()=>{let e=r.trim().replace(/\s+/g," ");return e?"name"===s&&(e.length<2||!/[a-z]/i.test(e))?d("Please enter your business name."):"website"!==s||Y(e)?"abn"!==s||Z(e)?void(t(e,s),o(""),d(null),i("")):d("Enter a valid 11-digit ABN."):d("Enter a valid website, e.g. yourbusiness.com.au"):d("Please enter a value.")};return s?(0,a.jsxs)("div",{className:"relative px-3.5 py-3",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-2 px-0.5 text-[12.5px] text-muted",children:[(0,a.jsx)("button",{onClick:()=>{i(""),d(null)},className:"font-semibold text-brand hover:underline",children:"‹ Change"}),(0,a.jsxs)("span",{children:["Entering your ",null==u?void 0:u.label.toLowerCase()]})]}),(0,a.jsxs)("div",{className:"relative flex items-center gap-2.5",children:[c&&(0,a.jsx)(ee,{msg:c}),(0,a.jsx)("input",{autoFocus:!0,value:r,inputMode:"abn"===s?"numeric":void 0,onChange:e=>{o("abn"===s?e.target.value.replace(/\D/g,"").slice(0,11):e.target.value),c&&d(null)},onKeyDown:e=>"Enter"===e.key&&m(),placeholder:null==u?void 0:u.placeholder,className:"flex-1 rounded-full border bg-slate-50 px-4 py-2.5 ".concat(M," outline-none focus:bg-white ").concat(c?"border-[#FF515D] ring-1 ring-[#FF515D]/40":"border-line focus:border-brand")}),(0,a.jsx)("button",{onClick:m,disabled:!r.trim(),"aria-label":"Search",className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-brand text-white hover:bg-brand-600 disabled:bg-slate-300",children:(0,a.jsx)(l,{name:"arrowUp",className:"h-[18px] w-[18px]"})})]})]}):(0,a.jsxs)("div",{className:"px-3.5 py-3",children:[(0,a.jsx)("div",{className:"mb-2 px-0.5 text-[13px] text-muted",children:"What would you like to share?"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:et.map(e=>(0,a.jsx)("button",{onClick:()=>
1{i(e.key),o(""),d(null)},className:"rounded-full bg-chip px-4 py-2 text-[14px] font-medium text-brand/80 transition hover:bg-chip-hover",children:e.label},e.key))})]})}function ea(e){let{placeholder:t,type:s,onSubmit:i,onInvalid:r}=e,[o,c]=n.useState(""),[d,u]=n.useState(null),m=e=>{null==r||r(),u(e)},p="optional-short"===s||"website"===s,h=e=>"abn"===s?e.replace(/\D/g,"").slice(0,11):"phone"===s?e.replace(/\D/g,""):e,b=()=>{let e=o.trim();if(!e){if(p){i("—"),c("");return}return m("This field is required")}if("email"===s&&!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(e))return m("Please enter a valid email address");if("phone"===s&&!x(e))return m("Please enter a valid phone number");if("abn"===s&&!Z(e))return m("Enter a valid 11-digit ABN");if("name"===s&&!Q(e))return m("Please enter a valid business name");if("website"===s&&!Y(e))return m("Enter a valid website, e.g. yourbusiness.com.au");if("location"===s&&!J(e))return m("Enter your city and state, e.g. Sydney, NSW");if("address"===s&&!X(e))return m("Please enter your full business address");if("number"===s){let t=e.replace(/[^0-9.]/g,"");if(!/\d/.test(e)||!t||isNaN(Number(t)))return m("Please enter a number")}i("abn"===s?function(e){let t=e.replace(/\D/g,"");return 11===t.length?"".concat(t.slice(0,2)," ").concat(t.slice(2,5)," ").concat(t.slice(5,8)," ").concat(t.slice(8,11)):e}(e):e),c("")};return(0,a.jsxs)("div",{className:"relative px-3.5 py-3",children:[(0,a.jsxs)("div",{className:"relative flex items-center gap-2.5",children:[d&&(0,a.jsx)(ee,{msg:d}),(0,a.jsx)("input",{autoFocus:!0,value:o,inputMode:"phone"===s||"abn"===s?"numeric":void 0,onChange:e=>{c(h(e.target.value)),d&&u(null)},onKeyDown:e=>"Enter"===e.key&&b(),placeholder:t||"Type your answer…",className:"flex-1 rounded-full border bg-slate-50 px-4 py-2.5 ".concat(M," outline-none focus:bg-white ").concat(d?"border-[#FF515D] ring-1 ring-[#FF515D]/40":"border-line focus:border-brand")}),(0,a.jsx)("button",{onClick:b,className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-brand text-white hover:bg-brand-600","aria-label":"Send",children:(0,a.jsx)(l,{name:"arrowUp",className:"h-[18px] w-[18px]"})})]}),p&&(0,a.jsx)("div",{className:"mt-2 text-center",children:(0,a.jsx)("button",{onClick:()=>{i("—"),c(""),u(null)},className:"text-[12.5px] font-medium text-muted underline underline-offset-2 hover:text-ink",children:"or skip this question."})})]})}function en(e){let{onSubmit:t,onInvalid:s}=e,[i,r]=n.useState(""),[o,c]=n.useState(null),d=new Date().toISOString().slice(0,10),u=()=>{if(!i){null==s||s(),c("Please pick a date");return}let[e,a,n]=i.split("-").map(Number);t(n&&a&&e?"".concat(n," ").concat(["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a-1]," ").concat(e):i),r("")};return(0,a.jsx)("div",{className:"relative px-3.5 py-3",children:(0,a.jsxs)("div",{className:"relative flex items-center gap-2.5",children:[o&&(0,a.jsx)(ee,{msg:o}),(0,a.jsx)("input",{type:"date",autoFocus:!0,value:i,min:d,onChange:e=>{r(e.target.value),o&&c(null)},onKeyDown:e=>"Enter"===e.key&&u(),className:"flex-1 rounded-full border bg-slate-50 px-4 py-2.5 ".concat(M," outline-none focus:bg-white ").concat(o?"border-[#FF515D] ring-1 ring-[#FF515D]/40":"border-line focus:border-brand")}),(0,a.jsx)("button",{onClick:u,className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-brand text-white hover:bg-brand-600","aria-label":"Send",children:(0,a.jsx)(l,{name:"arrowUp",className:"h-[18px] w-[18px]"})})]})})}function ei(e){let{hint:t,onSubmit:s,onInvalid:i,minLength:r=30,maxLength:o=2e4}=e,[c,d]=n.useState(""),[u,m]=n.useState(null);return(0,a.jsxs)("div",{className:"px-3.5 py-3",children:[t&&(0,a.jsx)("p",{className:"mb-2 px-0.5 text-[12.5px] leading-snug text-muted",children:t}),(0,a.jsxs)("div",{className:"relative flex items-end gap-2.5",children:[u&&(0,a.jsx)(ee,{msg:u}),(0,a.jsx)("textarea",{autoFocus:!0,value:c,rows:3,maxLength:o,onChange:e=>{d(e.target.value),u&&m(null)},placeholder:"",className:"qa-scroll flex-1 resize-none rounded-2xl border bg-slate-50 px-4 py-2.5 ".concat(M," leading-relaxed outline-none focus:bg-white ").concat(u?"border-[#FF515D] ring-1 ring-[#FF515D]/40":"border-line focus:border-brand")}),(0,a.jsx)("button",{onClick:()=>{let e=c.trim();if(e.length<r){null==i||i(),m("Please add a little more detail (at least ".concat(r," characters)."));return}s(e.slice(0,o)),d("")},"aria-label":"Send",className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-brand text-white hover:bg-brand-600",children:(0,a.jsx)(l,{name:"arrowUp",className:"h-[18px] w-[18px]"})})]})]})}let er=e=>{let t=e.replace(/AUD|AU\$|A\$|\$|,|\s/gi,"");return t.length>0&&/^\d+$/.test(t)},el=e=>{let t=e.replace(/[^0-9]/g,"");
1return t?"A$"+Number(t).toLocaleString("en-US"):""};function eo(e){let{onSubmit:t}=e,[s,i]=n.useState(""),r=n.useRef(null),o=()=>{let e=s.trim();if(e){if(er(e)){let s=e.replace(/[^0-9]/g,"");t(s,el(s))}else t(e,e);i("")}};return(0,a.jsxs)("div",{className:"px-3.5 py-3",children:[(0,a.jsx)("div",{className:"mb-2 px-0.5 text-[13px] text-muted",children:"Optional"}),(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)("input",{ref:r,autoFocus:!0,value:s,onChange:e=>{let t=e.target.value;i(er(t)?el(t):t),requestAnimationFrame(()=>{let e=r.current;e&&e.setSelectionRange(e.value.length,e.value.length)})},onKeyDown:e=>"Enter"===e.key&&o(),placeholder:"e.g. A$5,000",className:"flex-1 rounded-full border border-line bg-slate-50 px-4 py-2.5 ".concat(M," outline-none focus:border-brand focus:bg-white")}),(0,a.jsx)("button",{onClick:o,disabled:!s.trim(),"aria-label":"Send",className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-brand text-white hover:bg-brand-600 disabled:bg-slate-300",children:(0,a.jsx)(l,{name:"arrowUp",className:"h-[18px] w-[18px]"})})]}),(0,a.jsx)("div",{className:"mt-2 text-center",children:(0,a.jsx)("button",{onClick:()=>t("—","Question skipped"),className:"text-[12.5px] font-medium text-muted underline underline-offset-2 hover:text-ink",children:"Skip this question"})})]})}let ec=/^(no mfa|not sure|none)/i;function ed(e){let{options:t,multi:s,onPick:i}=e,[r,o]=n.useState([]),c=e=>s?ec.test(e)?o([e]):void o(t=>t.includes(e)?t.filter(t=>t!==e):[...t.filter(e=>!ec.test(e)),e]):i(e);return(0,a.jsx)("div",{className:"px-3.5 py-3",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[t.map(e=>{let t=r.includes(e);return(0,a.jsx)("button",{onClick:()=>c(e),className:"rounded-full px-4 py-2 text-[16px] transition ".concat(t?"bg-brand font-semibold text-white":"bg-chip font-medium text-brand/80 hover:bg-chip-hover"),children:e},e)}),s&&(0,a.jsx)("button",{onClick:()=>r.length&&i(r.join(", ")),disabled:!r.length,"aria-label":"Continue",className:"ml-auto flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-brand text-white transition hover:bg-brand-600 disabled:bg-slate-300",children:(0,a.jsx)(l,{name:"arrowUp",className:"h-[18px] w-[18px]"})})]})})}function eu(e){let{options:t,onPick:s}=e;return(0,a.jsx)("div",{className:"flex flex-col gap-2.5 px-3.5 py-3",children:t.map(e=>(0,a.jsx)("button",{onClick:()=>s(e),className:"w-full rounded-full bg-chip py-3.5 text-[16px] font-semibold text-brand transition hover:bg-chip-hover",children:e},e))})}function em(e){let{onPick:t}=e,[s,i]=n.useState(""),[r,c]=n.useState(null),d=e=>{let s=e.trim();if(s){if(!/[a-z]/i.test(s))return c("Please choose a valid industry");t(s)}},u=o.filter(e=>e.toLowerCase().includes(s.toLowerCase()));return(0,a.jsxs)("div",{className:"relative px-3.5 py-3",children:[s&&(0,a.jsx)("div",{className:"qa-scroll absolute bottom-full left-3.5 right-3.5 z-30 mb-2 max-h-60 overflow-y-auto rounded-2xl border border-line bg-white shadow-lg",children:u.length?u.map(e=>(0,a.jsx)("button",{onClick:()=>t(e),className:"block w-full px-3.5 py-2 text-left text-[16px] text-ink hover:bg-[#EEF3FF]",children:e},e)):(0,a.jsxs)("button",{onClick:()=>d(s),className:"block w-full px-3.5 py-2 text-left text-[16px] font-medium text-brand hover:bg-[#EEF3FF]",children:["Use “",s,"”"]})}),r&&(0,a.jsx)("p",{className:"mb-1.5 px-1 text-[12px] font-medium text-[#B42318]",children:r}),(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)("input",{autoFocus:!0,value:s,onChange:e=>{i(e.target.value),r&&c(null)},onKeyDown:e=>"Enter"===e.key&&d(s),placeholder:"Search for your industry",className:"flex-1 rounded-full border border-line bg-slate-50 px-4 py-2.5 ".concat(M," outline-none focus:border-brand focus:bg-white")}),(0,a.jsx)("button",{onClick:()=>d(s),disabled:!s.trim(),"aria-label":"Select industry",className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-brand text-white disabled:bg-slate-300",children:(0,a.jsx)(l,{name:"arrowUp",className:"h-[18px] w-[18px]"})})]})]})}let ep="Australia",ex=["10","20","30","40","50","60","70","80","90","100"],eh=["0",...ex],eb=[ep,"Afghanistan","Albania","Algeria","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei Darussalam","Bulgaria","Burkina Faso","Burundi","Cabo Verde","Cambodia","Cameroon","Canada","Central African Republic","Chad","Chile","China","Colombia","Comoros","Congo (Democratic Republic of the)","Congo (Republic of the)","Cook Islands","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Cyprus","Czechia","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Eswatini","Ethiopia","Fiji","Finland","France","Gabon","Gambia","Georgia","Germany","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Holy See (Vatican City)","Honduras","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Korea (Democratic People's Republic of)","Korea (Republic of)","Kosovo","Kuwait","Kyrgyzstan","Lao People's Democratic Republic","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia (Federated States of)","Moldova","Monaco","Mongolia","Montenegro","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","Niue","North Macedonia","Norway","Oman","Pakistan","Palau","Palestine","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russian Federation","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent and the Grenadines","S
1amoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Sudan","Spain","Sri Lanka","Sudan","Suriname","Sweden","Switzerland","Syrian Arab Republic","Tajikistan","Tanzania","Thailand","Timor-Leste","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkiye","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States of America","Uruguay","Uzbekistan","Vanuatu","Venezuela","Viet Nam","Yemen","Zambia","Zimbabwe"];function ef(e){let{value:t,onSubmit:s}=e,i=t&&t.length?t:null,[r,o]=n.useState(i?i[0].country:ep),[c,d]=n.useState(i?String(i[0].pct):"100"),[u,m]=n.useState(!!i),[p,x]=n.useState(()=>i?i.slice(1).map(e=>({country:e.country,pct:String(e.pct)})):[{country:"",pct:""}]),[h,b]=n.useState(null),[f,g]=n.useState(""),y=p.reduce((e,t)=>e+(Number(t.pct)||0),0),v=u?Number(c)||0:Math.max(0,100-y),j=v+y,w=new Set([r,...p.map(e=>e.country)].filter(Boolean)),N=!!r&&p.every(e=>!e.country&&!e.pct||e.country&&e.pct)&&100===j,k=w.size<eb.length,C=(e,t)=>x(s=>s.map((s,a)=>a===e?{...s,...t}:s)),S=(e,t)=>{C(e,{country:t}),b(null),g("")},M=e=>{o(e),b(null),g("")},I=e=>{b(null),x(t=>t.filter((t,s)=>s!==e))},F=e=>{g(""),b(t=>t===e?null:e)},_=e=>{b(null),m(!0),d(e)},B=e=>eb.filter(t=>t===p[e].country||!w.has(t)),T=()=>eb.filter(e=>e===r||!w.has(e)),A=e=>e.filter(e=>e.toLowerCase().includes(f.toLowerCase()));return(0,a.jsx)("div",{className:"self-stretch animate-bubbleIn",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2.5 rounded-card border border-line bg-white p-4 shadow-bubble",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between text-[12px] font-semibold text-ink",children:[(0,a.jsx)("span",{children:"Country"}),(0,a.jsx)("span",{children:"% of revenue"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"relative min-w-0 flex-1",children:-1===h?(0,a.jsx)("input",{autoFocus:!0,value:f,onChange:e=>g(e.target.value),onKeyDown:e=>{"Escape"===e.key&&b(null)},placeholder:"Search country",className:"w-full rounded-[10px] border border-brand bg-white px-3 py-2 text-[16px] outline-none"}):(0,a.jsxs)("button",{onClick:()=>F(-1),className:"flex w-full items-center justify-between gap-1 rounded-[10px] border border-line bg-white px-3 py-2 text-left text-[14px]",children:[(0,a.jsx)("span",{className:"truncate text-ink",children:r}),(0,a.jsx)(l,{name:"chevronDown",className:"h-4 w-4 shrink-0 text-muted"})]})}),(0,a.jsxs)("div",{className:"relative w-[88px] shrink-0",children:[(0,a.jsx)("select",{value:String(v),onChange:e=>_(e.target.value),"aria-label":"Anchor percentage",className:"w-full appearance-none rounded-[10px] border border-line bg-white px-3 py-2 pr-7 text-[16px] text-ink outline-none",children:eh.map(e=>(0,a.jsxs)("option",{value:e,children:[e,"%"]},e))}),(0,a.jsx)(l,{name:"chevronDown",className:"pointer-events-none absolute right-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted"})]}),(0,a.jsx)("span",{className:"w-7 shrink-0","aria-hidden":!0})]}),-1===h&&(0,a.jsx)("div",{className:"qa-scroll max-h-52 overflow-y-auto rounded-[10px] border border-line bg-white",children:A(T()).length?A(T()).slice(0,80).map(e=>(0,a.jsx)("button",{onClick:()=>M(e),className:"block w-full px-3 py-2 text-left text-[14px] text-ink hover:bg-[#EEF3FF]",children:e},e)):(0,a.jsx)("div",{className:"px-3 py-2 text-[13px] text-muted",children:"No matching countries"})})]}),p.map((e,t)=>{let s=A(B(t));return(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"relative min-w-0 flex-1",children:h===t?(0,a.jsx)("input",{autoFocus:!0,value:f,onChange:e=>g(e.target.value),onKeyDown:e=>{"Escape"===e.key&&b(null)},placeholder:"Search country",className:"w-full rounded-[10px] border border-brand bg-white px-3 py-2 text-[16px] outline-none"}):(0,a.jsxs)("button",{onClick:()=>
1F(t),className:"flex w-full items-center justify-between gap-1 rounded-[10px] border border-line bg-white px-3 py-2 text-left text-[14px]",children:[(0,a.jsx)("span",{className:"truncate ".concat(e.country?"text-ink":"text-muted"),children:e.country||"Select country"}),(0,a.jsx)(l,{name:"chevronDown",className:"h-4 w-4 shrink-0 text-muted"})]})}),(0,a.jsxs)("div",{className:"relative w-[88px] shrink-0",children:[(0,a.jsxs)("select",{value:e.pct,onChange:e=>{b(null),C(t,{pct:e.target.value})},className:"w-full appearance-none rounded-[10px] border border-line bg-white px-3 py-2 pr-7 text-[16px] outline-none ".concat(e.pct?"text-ink":"text-muted"),children:[(0,a.jsx)("option",{value:"",children:"—"}),ex.map(e=>(0,a.jsxs)("option",{value:e,children:[e,"%"]},e))]}),(0,a.jsx)(l,{name:"chevronDown",className:"pointer-events-none absolute right-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted"})]}),(0,a.jsx)("button",{onClick:()=>I(t),"aria-label":"Remove country",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-[#FF515D] hover:bg-[#f8f7f7]",children:(0,a.jsx)(l,{name:"x",className:"h-4 w-4"})})]}),h===t&&(0,a.jsx)("div",{className:"qa-scroll max-h-52 overflow-y-auto rounded-[10px] border border-line bg-white",children:s.length?s.slice(0,80).map(e=>(0,a.jsx)("button",{onClick:()=>S(t,e),className:"block w-full px-3 py-2 text-left text-[14px] text-ink hover:bg-[#EEF3FF]",children:e},e)):(0,a.jsx)("div",{className:"px-3 py-2 text-[13px] text-muted",children:"No matching countries"})})]},t)}),k&&(0,a.jsxs)("button",{onClick:()=>{b(null),x(e=>[...e,{country:"",pct:""}])},className:"flex items-center gap-1 self-start text-[14px] font-medium text-brand hover:opacity-80",children:[(0,a.jsx)("span",{className:"text-[18px] leading-none",children:"+"})," Add another country"]}),(0,a.jsx)("div",{className:"mt-0.5 border-t border-line pt-2.5",children:(0,a.jsxs)("div",{className:"flex items-center justify-between text-[13px] font-semibold text-ink",children:[(0,a.jsx)("span",{children:"Total"}),(0,a.jsxs)("span",{children:[j,"%"]})]})}),100!==j&&(0,a.jsx)("div",{className:"rounded-[10px] bg-[#E5EFFF] py-2 text-center text-[13px] font-semibold text-brand",children:"Total must add up to 100%"}),(0,a.jsx)("button",{onClick:()=>{let e=[];v>0&&e.push({country:r,pct:v}),p.filter(e=>e.country&&e.pct).forEach(t=>e.push({country:t.country,pct:Number(t.pct)})),s(e)},disabled:!N,className:"mt-0.5 w-full rounded-xl py-3 font-bold text-white ".concat(N?"bg-brand hover:bg-brand-600":"cursor-not-allowed bg-slate-300"),children:"Continue"})]})})}function eg(e){let{onFile:t}=e,[s,i]=n.useState(!1),[r,o]=n.useState(null),c=n.useRef(null),d=e=>{if(e){if(e.size>10485760){o("File is larger than 10 MB");return}o(null),i(!0),t(e)}};return(0,a.jsxs)("div",{className:"px-3.5 py-3",children:[(0,a.jsx)("input",{ref:c,type:"file",className:"hidden",accept:".pdf,.doc,.docx,.jpg,.jpeg,.png,.xls,.xlsx",onChange:e=>{var t;return d(null===(t=e.target.files)||void 0===t?void 0:t[0])}}),(0,a.jsxs)("button",{onClick:()=>{var e;return!s&&(null===(e=c.current)||void 0===e?void 0:e.click())},disabled:s,onDragOver:e=>e.preventDefault(),onDrop:e=>{var t;e.preventDefault(),s||d(null===(t=e.dataTransfer.files)||void 0===t?void 0:t[0])},className:"flex w-full flex-col items-center gap-1.5 rounded-card border-2 border-dashed border-line py-6 text-muted hover:border-brand/50",children:[(0,a.jsx)(l,{name:"export",className:"h-6 w-6 text-brand"}),(0,a.jsx)("span",{className:"text-[14px] font-medium text-ink",children:s?"Extracting details…":"Drag and drop files here or Choose files"}),!s&&(0,a.jsx)("span",{className:"text-[12px] text-muted",children:"PDF, DOC, JPG, PNG, XLS \xb7 up to 10 MB each"})]}),r&&(0,a.jsx)("p",{className:"mt-1.5 px-1 text-[12px] font-medium text-[#B42318]",children:r})]})}let ey={title:"Contact details",icon:"userSquare",fields:[{key:"firstName",label:"First name"},{key:"lastName",label:"Last name"},{key:"email",label:"Email"},{key:"phone",label:"Phone"}],required:["firstName","lastName","email"]},ev={title:"Business Profile",icon:"buildings",fields:[{key:"businessName",label:"Business name"},{key:"website",label:"Website"},{key:"location",label:"Location"},{key:"businessAddress",label:"Business address"},{key:"abn",label:"ABN"},{key:"yearsInBusiness",label:"Years in business"},{key:"industry",label:"Industry"},{key:"activities",label:"Activities"},{key:"revenue",label:"Expected revenue"},{key:"staff",label:"Staff"},{key:"quoteTiming",label:"Quotes needed by"}],required:["businessName","location","businessAddress","abn","yearsInBusiness","industry","activities","revenue","staff"]},ej={title:"Cyber Profile",icon:"monitor",fields:[{key:"overseasIncome",label:"Overseas revenue"},{key:"records",label:"Records stored"},{key:"backup",label:"Data backup"},{key:"mfa",label:"MFA enabled"},{key:"cloud",label:"Cloud tools"},{key:"targetPremium",label:"Target premium"},{key:"claims",label:"Had claims"}],required:["overseasIncome","records","backup","mfa","cloud","claims"]},ew=[ey,ev,ej],eN={"Contact details":"contact_details","Business Profile":"business_profile","Cyber Profile":"cyber_risk"},ek=e=>{let t=ew.find(t=>t.fields.some(t=>String(t.key)===e));return t?eN[t.title]:void 0},eC=new Set(["firstName","lastName","email"]),eS=/^[^@\s]+@[^@\s]+\.[^@\s]+$/,eM=e=>x(e),eI=e=>"string"==typeof e&&""!==e.trim()&&"—"!==e.trim(),eF=(e,t)=>
1"targetPremium"===e&&/^\d+$/.test(t)?"A$"+Number(t).toLocaleString("en-US"):t;function e_(e,t){let s=(t||"").trim();return eC.has(e)&&!s?"Required":"email"===e&&s&&!eS.test(s)?"Email must be formatted correctly":"phone"===e&&s&&"—"!==s&&!eM(s)?"Enter a valid phone number":null}function eB(e){let{id:t,value:s,options:i,onChange:r}=e,o=s?s.split(",").map(e=>e.trim()).filter(Boolean):[],[c,d]=n.useState(!1),[u,m]=n.useState(""),p=e=>r(e.join(", ")),x=e=>{let t=e.trim();t&&!o.includes(t)&&p([...o,t]),m(""),d(!1)};return(0,a.jsxs)("div",{className:"rounded-lg border border-line p-2",children:[o.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:o.map(e=>(0,a.jsxs)("span",{className:"flex items-center gap-1 rounded-full bg-brand px-2.5 py-1 text-[12.5px] font-medium text-white",children:[e,(0,a.jsx)("button",{type:"button",onClick:()=>p(o.filter(t=>t!==e)),"aria-label":"Remove ".concat(e),children:(0,a.jsx)(l,{name:"x",className:"h-3 w-3"})})]},e))}),c?(0,a.jsx)("input",{autoFocus:!0,list:"rev-".concat(t),value:u,onChange:e=>m(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),x(u))},onBlur:()=>u.trim()?x(u):d(!1),placeholder:"Type and press Enter",className:"mt-1.5 w-full rounded-md border border-line px-2 py-1 ".concat(M," outline-none focus:border-brand")}):(0,a.jsx)("button",{type:"button",onClick:()=>d(!0),className:"mt-1.5 text-[13px] font-semibold text-brand",children:"+ Add"}),(0,a.jsx)("datalist",{id:"rev-".concat(t),children:i.map(e=>(0,a.jsx)("option",{value:e},e))})]})}function eT(e){let{fieldKey:t,value:s,err:n,onChange:i}=e,r=function(e){let t=j.find(t=>t.key===e&&["options","yesno","multi","industry-select","long-text"].includes(t.type));return t?"multi"===t.type?{kind:"multi",options:t.options||[]}:"long-text"===t.type?{kind:"textarea",options:[]}:"industry-select"===t.type?{kind:"select",options:o}:{kind:"select",options:t.options||[]}:{kind:"text",options:[]}}(t),c="—"===s?"":s;return"multi"===r.kind?(0,a.jsx)(eB,{id:t,value:c,options:r.options,onChange:e=>i(t,e)}):"textarea"===r.kind?(0,a.jsx)("textarea",{value:c,rows:3,placeholder:"Not provided",onChange:e=>i(t,e.target.value),className:"qa-scroll w-full resize-none rounded-lg border px-3 py-2 ".concat(M," leading-relaxed outline-none focus:border-brand ").concat(n?"border-[#FF515D]":"border-line")}):"select"===r.kind?(0,a.jsxs)("span",{className:"relative flex w-full",children:[(0,a.jsxs)("select",{value:c,onChange:e=>i(t,e.target.value),className:"w-full appearance-none rounded-lg border bg-white px-3 py-2 pr-8 ".concat(M," outline-none focus:border-brand ").concat(n?"border-[#FF515D]":"border-line"),children:[(0,a.jsx)("option",{value:"",children:"Select…"}),c&&!r.options.includes(c)&&(0,a.jsx)("option",{value:c,children:c}),r.options.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]}),(0,a.jsx)(l,{name:"chevronDown",className:"pointer-events-none absolute right-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted"})]}):(0,a.jsx)("input",{value:c,placeholder:"Not provided",inputMode:"phone"===t||"abn"===t?"numeric":void 0,onChange:e=>i(t,"abn"===t?e.target.value.replace(/\D/g,"").slice(0,11):"phone"===t?e.target.value.replace(/[^\d+]/g,""):e.target.value),className:"w-full rounded-lg border px-3 py-2 ".concat(M," outline-none focus:border-brand ").concat(n?"border-[#FF515D]":"border-line")})}function eA(e){let{data:t,onChange:s,onCoversChange:i,onSubmit:r,onBack:o,onSectionSaved:c}=e,[d,u]=n.useState({}),m=e=>u(t=>({...t,[e]:!t[e]})),p=n.useRef({}),x=(e,t)=>{let a=ek(e);a&&(p.current[a]=p.current[a]||new Set).add(e),s(e,t)},h=e=>{let t=eN[e.title];t&&(null==c||c(t,[...p.current[t]||[]]),p.current[t]=new Set)},b=e=>e.required.every(e=>eI(t[e])),f=e=>b(e)&&e.fields.every(e=>!e_(String(e.key),t[e.key]||"")),g=e=>e.fields.some(e=>eI(t[e.key])),y=!!(t.covers&&Object.values(t.covers).some(e=>e&&e.enabled)),v=25*[b(ey),b(ev),y,b(ej)].filter(Boolean).length,j=ew.some(e=>e.fields.some(e=>e_(String(e.key),t[e.key]||""))),w=100===v&&!j,N=e=>{if(!b(e)&&!d[e.title]&&!g(e))return null;let s=!!d[e.title],n=f(e);return(0,a.jsxs)("div",{className:"mb-3.5 rounded-card border border-line bg-white p-4",children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 font-bold text-ink",children:[(0,a.jsx)(l,{name:e.icon,className:"h-[18px] w-[18px]"})," ",e.title]}),(0,a.jsxs)("button",{onClick:()=>{(!s||n)&&(s&&h(e),m(e.title))},disabled:s&&!n,className:"flex items-center gap-1 text-[13px] font-semibold ".concat(s&&!n?"cursor-not-allowed text-slate-300":"text-brand hover:opacity-80"),children:[s?"Save":(0,a.jsx)(l,{name:"edit",className:"h-4 w-4"}),s&&(0,a.jsx)(l,{name:"tickCircle",className:"h-4 w-4"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2.5",children:[e.fields.map(e=>{let n=t[e.key]||"",i=e_(String(e.key),n);return s?(0,a.jsxs)("label",{className:"grid grid-cols-[110px_1fr] items-start gap-2",children:[(0,a.jsx)("span",{className:"pt-2 text-[12.5px] text-muted",children:e.label}),(0,a.jsxs)("span",{className:"min-w-0",children:[(0,a.jsx)(eT,{fieldKey:String(e.key),value:n,err:i,onChange:x}),i&&(0,a.jsx)("span",{className:"mt-1 block rounded-md bg-red-50 px-2 py-1 text-[11.5px] font-medium text-[#B42318]",children:i})]})]},String(e.key)):(0,a.jsxs)("div",{className:"grid grid-cols-[110px_1fr] items-start gap-2 text-[13.5px]",children:[(0,a.jsx)("span",{className:"text-muted",children:e.label}),(0,a.jsxs)("span",{className:"min-w-0 break-words",children:[(0,a.jsx)("span",{className:"font-medium ".concat(i?"text-[#B42318]":"text-ink"),children:n&&"—"!==n?eF(String(e.key),n):"—"}),i&&(0,a.jsx)("span",{className:"mt-0.5 block text-[11.5px] font-medium text-[#B42318]",children:i})]})]},String(e.key))}),"Cyber Profile"===e.title&&Array.isArray(t.overseasCountries)&&t.overseasCountries.length>0&&(0,a.jsxs)("div",{className:"grid grid-cols-[110px_1fr] items-start gap-2 text-[13.5px]",children:[(0,a.jsx)("span",{className:"text-muted",children:"Revenue by country"}),(0,a.jsx)("span",{className:"min-w-0 break-words font-medium text-ink",children:t.overseasCountries.map(e=>"".concat(e.country," ").concat(e.pct,"%")).join(", ")})]}),"Business Profile"===e.title&&"Specific date"===t.quoteTiming&&eI(t.quoteDate)&&(0,a.jsxs)("div",{className:"grid grid-cols-[110px_1fr] items-start gap-2 text-[13.5px]",children:[(0,a.jsx)("span",{className:"text-muted",children:"Requested date"}),(0,a.jsx)("span",{className:"min-w-0 break-words font-medium text-ink",children:t.quoteDate})]})]})]},e.title)};return(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,a.jsxs)("div",{className:"qa-scroll flex-1 overflow-y-auto bg-chat px-4 py-5",children:[N(ey),N(ev),N(ej),y&&(0,a.jsxs)("div",{className:"mb-3.5 rounded-card border border-line bg-white p-4",children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center gap-2 font-bold text-ink",children:[(0,a.jsx)(l,{name:"shield",className:"h-[18px] w-[18px]"})," Insurance Covers"]}),(0,a.jsx)(z,{value:t.covers,onChange:i})]}),!w&&(0,a.jsxs)("div",{className:"mb-3.5 rounded-card border border-line bg-white p-4",children:[(0,a.jsx)("p",{className:"mb-3 text-[14px] text-ink",children:"Your submission is not ready yet"}),(0,a.jsx)("button",{onClick:o,className:"w-full rounded-xl bg-brand py-3 text-[15px] font-bold text-white hover:bg-brand-600",children:"Go back to Chat"})]})]}),(0,a.jsx)("div",{className:"border-t border-line bg-white px-4 py-3",children:(0,a.jsx)(W,{label:"Submit",onClick:r,disabled:!w,className:"w-full rounded-xl bg-brand py-3.5 text-[15px] font-bold text-white transition hover:bg-brand-600 disabled:cursor-not-allowed disabled:bg-slate-300"})})]})}let eL=[{match:/upcover/i,profile:{businessName:"upcover Pty Ltd",website:"https://www.upcover.com",location:"Sydney 
1NSW",abn:"51 824 753 556",yearsInBusiness:"6",industry:"",activities:[]}},{match:/acme/i,profile:{businessName:"Acme Digital Pty Ltd",website:"https://acme.com.au",location:"Sydney NSW",abn:"12 345 678 901",yearsInBusiness:"5",industry:"",activities:[]}}];function eP(){try{let e=window.analytics;return e&&"function"==typeof e.track?e:null}catch(e){return null}}let eD={};function eE(e){eD={...eD,...eq(e)}}function eq(e){let t={};return Object.keys(e).forEach(s=>{let a=e[s];null!=a&&""!==a&&(t[s]=a)}),t}function eR(e,t){let s=eP();if(null==s?void 0:s.track)try{s.track(e,{...eD,...eq(t||{})})}catch(e){}}let eO="https://n8n-myaborgcha-ts.a.run.app/webhook".replace(/\/$/,""),eH=!!eO;function e$(){try{let e=new URL(window.location.href).searchParams,t=t=>e.get(t)||void 0,s={utm_source:t("utm_source"),utm_medium:t("utm_medium"),utm_campaign:t("utm_campaign"),utm_term:t("utm_term"),utm_content:t("utm_content"),utm_id:t("utm_id"),utm_agid:t("utm_agid"),gclid:t("gclid"),fbclid:t("fbclid"),referrer:t("ref"),landing:t("landing")};return Object.values(s).some(Boolean)?s:null}catch(e){return null}}function eU(){try{let e=new URL(window.location.href).searchParams.get("aid");if(e)return e;let t=document.cookie.match(/(?:^|;\s*)ajs_anonymous_id=([^;]+)/);if(t)return decodeURIComponent(t[1]).replace(/^"|"$/g,"")}catch(e){}return""}function eW(){try{let e=localStorage.getItem("qa_sid");return e||(e="undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"sid-"+Math.random().toString(36).slice(2)+Date.now(),localStorage.setItem("qa_sid",e)),e}catch(e){return"sid-mem"}}let eV=(s(257).env.NEXT_PUBLIC_ASSET_BASE||"").replace(/\/$/,"");function ez(e){var t;let{apiBase:s="",product:i="cyber",onClose:r}=e,o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"cyber",[s,a]=(0,n.useState)("loading"),[i,r]=(0,n.useState)([]),[l,o]=(0,n.useState)(null),[c,u]=(0,n.use
1State)({}),[x,h]=(0,n.useState)(!1),[f,g]=(0,n.useState)(0),[y,M]=(0,n.useState)(!1),[I,F]=(0,n.useState)(null),[_,B]=(0,n.useState)(!1),[T,A]=(0,n.useState)(null),[L,P]=(0,n.useState)(0),[D,E]=(0,n.useState)(!1),q=(0,n.useRef)(0),R=(0,n.useRef)(0),O=(0,n.useRef)({});O.current=c;let H=(0,n.useRef)(null);H.current=l;let $=(0,n.useRef)("business"),U=()=>++q.current,W=e=>r(t=>[...t,e]),V=t=>e.replace(/\/$/,"")+t,z=(e,t)=>{if(eH)try{fetch("".concat(eO,"/").concat(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0}).catch(()=>{})}catch(e){}},K=()=>{try{let e=new URL(window.location.href).searchParams.get("landing");if(e)return new URL(e).origin}catch(e){}try{if(document.referrer)return new URL(document.referrer).origin}catch(e){}return"*"},G=e=>{let t=(e||"").trim();if(!t)return"";if("+"===t[0])return t.replace(/[^\d+]/g,"");let s=t.replace(/\D/g,"");return s.startsWith("61")?"+"+s:s.startsWith("0")?"+61"+s.slice(1):9===s.length?"+61"+s:s?"+"+s:""},Z=(e,t)=>{try{if(window.parent&&window.parent!==window)window.parent.postMessage(Object.assign({type:"qa:event",event:e},t||{}),K());else{let s=window;s.dataLayer=s.dataLayer||[],s.dataLayer.push(Object.assign({event:e},t||{}))}}catch(e){}},Q=(0,n.useCallback)(async e=>{var s,a,n,i,r,o,c;let d=O.current;if(!d.attribution){let e=e$();e&&(d.attribution=e)}let u=null!==(a=null==e?void 0:e.step)&&void 0!==a?a:l?S(l):0,m=null!==(n=null==e?void 0:e.stepId)&&void 0!==n?n:(null===(s=j[u])||void 0===s?void 0:s.id)||"",p=null!==(i=null==e?void 0:e.stepIndex)&&void 0!==i?i:u,x=null!==(r=null==e?void 0:e.submitted)&&void 0!==r&&r,h=null!==(o=null==e?void 0:e.started)&&void 0!==o&&o,b=null!==(c=null==e?void 0:e.resumed)&&void 0!==c&&c;if(eH){try{await fetch("".concat(eO,"/session/save"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:eW(),anonymousId:eU(),email:d.email||"",product:t,data:JSON.stringify(d),step:u,stepId:m,stepIndex:p,submitted:x,started:h,resumed:b})}),h||b||(A("Progress saved"),setTimeout(()=>A(null),1600))}catch(e){}return}if(d.email)try{await fetch(V("/api/session"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:d.email,data:d,step:u,submitted:x})}),A("Progress saved"),setTimeout(()=>A(null),1600)}catch(e){}},[e,l]);async function Y(e){try{let t=await fetch(V("/api/session?email="+encodeURIComponent(e)));return t.ok?await t.json():null}catch(e){return null}}async function J(){try{let e=await fetch("".concat(eO,"/session/get"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:eW()})});if(!e.ok)return null;let t=await e.json();if(!t.found)return{found:!1,email:"",data:{},step:0,submitted:!1};let s={};try{s=JSON.parse(t.data||"{}")}catch(e){}return{found:!0,email:t.email||"",data:s,step:Number(t.step)||0,submitted:!!t.submitted}}catch(e){return null}}let X=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500;return new Promise(s=>{let a=U();W({id:a,role:"bot",kind:"typing"}),setTimeout(()=>{r(t=>t.filter(e=>e.id!==a).concat({id:U(),role:"bot",kind:"text",text:e})),s()},t)})},ee=(0,n.useCallback)(async e=>{if(!e)return;o(e);let t=k(e);if(await X(t.prompt),"option-cards"===t.type)W({id:U(),role:"bot",kind:"cards"});else if("intake"===t.type)W({id:U(),role:"bot",kind:"intake"});else if("recommendation"===t.type){if(!O.current.covers){let e={};v.forEach(t=>{e[t.key]={enabled:!!t.locked||t.defaultOn,limit:t.defaultLimit}}),u(t=>({...t,covers:e})),O.current={...O.current,covers:e}}W({id:U(),role:"bot",kind:"recommend"})}else"country-split"===t.type?W({id:U(),role:"bot",kind:"overseas"}):"done"===t.type&&(E(!0),await X("Next, head to the Review tab to confirm your information. Once you’re happy with the details, you can submit your application.",450),W({id:U(),role:"bot",kind:"go-review"}))},[]),et=(0,n.useCallback)(async(e,t)=>{let s=function(e,t){if(e.next){let s=e.next(t);if(!s)return null;let a=w[s];for(;j[a]&&j[a].skip&&j[a].skip(t);)a++;return j[a]?j[a].id:null}let s=w[e.id]+1;for(;j[s]&&("documentUpload"===j[s].id||j[s].skip&&j[s].skip(t));)s++;return j[s]?j[s].id:null}(e,O.current);Q({step:s?S(s):j.length,stepId:e.id,stepIndex:S(e.id)});let a=ei.current[e.id]||0;eR("Onboarding Step Completed",es(e.id,{...a?{validation_attempts:a}:{},...ea.current[e.id]||{},...t||{}})),delete ei.current[e.id],delete ea.current[e.id],await ee(s)},[Q,ee]);(0,n.useEffect)(()=>{let e=e$()||{};eE({quote_id:eW(),product:t,utm_source:e.utm_source,utm_medium:e.utm_medium,utm_campaign:e.utm_campaign,utm_term:e.utm_term,utm_content:e.utm_content,utm_id:e.utm_id})},[t]);let es=(e,t)=>({step_id:e,step_index:S(e),section_id:b(e),...t||{}}),ea=(0,n.useRef)({}),en=(e,t)=>{ea.current[e]={...ea.current[e]||{},...t}},ei=(0,n.useRef)({}),er=(0,n.useCallback)(e=>{let t=e||H.current;t&&(ei.current[t]=(ei.current[t]||0)+1)},[]),el=(0,n.useCallback)((e,t)=>{let s="review:".concat(e),a=ei.current[s]||0;eR("Quote Review Section Saved",{section_id:e,fields_edited:t,...a?{validation_attempts:a}:{}}),delete ei.current[s]},[]);(0,n.useEffect)(()=>{let e=!1,t=e=>Promise.race([e,new Promise(e=>setTimeout(()=>e(null),4e3))]);return(async()=>{try{if(eH){let s=await t(J());if(!e&&(null==s?void 0:s.found)&&!s.submitted&&s.step>=1){u(s.data||{}),O.current=s.data||{};let e=Math.min(s.step,j.length-1);P(e),R.current=e,a("resume");return}}else{let s=null;try{s=localStorage.getItem("qa_email")}catch(e){}if(s){let n=await t(Y(s));if(!e&&(null==n?void 0:n.found)&&!n.submitted&&n.step>C){u(n.data||{}),O.current=n.data||{};let e=Math.min(n.step,j.length-1);P(e),R.current=e,a("resume");return}}}}catch(e){}e||a("intro")})(),()=>{e=!0}},[]);let eo=(0,n.useCallback)(async()=>{a("chat"),E(!1),Q({started:!0}),eR("Quote Started"),ee(N)},[ee,Q]),ec=(0,n.useCallback)(async()=>{var e;a("chat"),Q({resumed:!0});let t=(null===(e=j[R.current])||void 0===e?void 0:e.id)||N;eR("Quote Resumed",es(t)),await X("Welcome back".concat(O.current.firstName?", ".concat(O.current.firstName):"","! Let’s pick up where you left off.")),ee(t)},[ee,Q]),ed=(0,n.useCallback)(()=>{var e;eR("Quote Restarted",es((null===(e=j[R.current])||void 0===e?void 0:e.id)||N,{source:"resume_screen"}));try{localStorage.removeItem("qa_email"),localStorage.removeItem("qa_sid")}catch(e){}eE({quote_id:eW()}),r([]),u({}),O.current={},F(null),B(!1),o(null),E(!1),a("intro")},[]),eu=async(e,t,s)=>{u(s=>({...s,[e.key]:t})),O.current={...O.current,[e.key]:t},await et(e,s)},em=(0,n.useCallback)(async e=>{let s=k(l);if(W({id:U(),role:"user",kind:"text",text:"—"===e?"Question skipped":e}),"email"===s.id){u(t=>({...t,email:e})),O.current={...O.current,email:e};try{localStorage.setItem("qa_email",e.toLowerCase().trim())}catch(e){}if(z("contact",{sessionId:eW(),firstName:O.current.firstName||"",lastName:O.current.lastName||"",email:e,ph
1one:O.current.phone||"",product:t}),!eH){let t=await Y(e);if((null==t?void 0:t.found)&&(t.submitted||t.step>C))return u(t.data||{}),O.current=t.data||{},await X("Welcome back! I’ve restored your earlier answers — let’s continue."),ee(j[Math.min(t.step,j.length-1)].id)}}await eu(s,e,"—"===e?{was_skipped:!0}:void 0)},[l,et,ee]),ep=(0,n.useCallback)(async e=>{let t={...O.current,overseasCountries:e};u(t),O.current=t,W({id:U(),role:"user",kind:"text",text:e.map(e=>"".concat(e.country," ").concat(e.pct,"%")).join(", ")}),await et(k("overseasCountries"))},[et]),ex=(0,n.useCallback)(async e=>{let{firstName:s,lastName:a,email:n,phone:i}=e,r=s.trim(),l=a.trim(),o=n.trim(),c=i.trim(),d={...O.current,firstName:r,lastName:l,email:o,phone:c};u(d),O.current=d;try{localStorage.setItem("qa_email",o.toLowerCase())}catch(e){}let m=[r,l].filter(Boolean).join(" ");W({id:U(),role:"user",kind:"text",text:"".concat(m," \xb7 ").concat(o," \xb7 ").concat(c)}),z("contact",{sessionId:eW(),firstName:r,lastName:l,email:o,phone:c,product:t}),Z("qa_contact_created",{quote_id:eW(),product:t,user_data:{email:o.toLowerCase(),phone_number:G(c)}}),function(e,t){let s=eP();if(null==s?void 0:s.identify)try{s.identify(e,eq(t||{}))}catch(e){}}(o.toLowerCase(),{firstName:r,lastName:l}),await et(k("contacts"))},[et,t]),eh=(0,n.useCallback)(async e=>{let t=k(l);W({id:U(),role:"user",kind:"text",text:e}),await eu(t,e)},[l,et]),eb=(0,n.useCallback)(async(e,t)=>{let s=k(l);W({id:U(),role:"user",kind:"text",text:t}),await eu(s,e)},[l,et]),ef=(0,n.useCallback)(async e=>{W({id:U(),role:"user",kind:"text",text:e});let s=/^[\d\s]{9,}$/.test(e)?"abn":/\./.test(e)?"website":"name";h(!0),M(!1),g(0),W({id:U(),role:"bot",kind:"scan"});let a=setTimeout(()=>g(1),600),n=setTimeout(()=>g(2),1300),i=null,l="";try{let s=await fetch(eH?"".concat(eO,"/lookup"):V("/api/lookup"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,sessionId:eW(),anonymousId:eU(),product:t})}),a=await s.json();a.ok&&a.profile&&(i=a.profile),l=a.source||""}catch(e){}if(i||"fallback"!==l||(i=function(e){let t=(e||"").trim();if(t.length<2)return null;let s=eL.find(e=>e.match.test(t));return s?{...s.profile,activities:[...s.profile.activities]}:null}(e)),clearTimeout(a),clearTimeout(n),!i){g(2),M(!0),h(!1),en("business",{step_status:"fail",lookup_method:s}),await X("We couldn’t find enough information to build your business profile automatically."),await X("Let’s continue step by step with a few quick questions."),await et(k("business"));return}en("business",{step_status:"success",lookup_method:s}),g(3),setTimeout(()=>{r(e=>e.filter(e=>"scan"!==e.kind)),$.current="business",F(i),B(!1);let e={...O.current,businessName:i.businessName,website:i.website,location:i.location,abn:i.abn,yearsInBusiness:i.yearsInBusiness,industry:i.industry,activities:i.activities.join(", ")};u(e),O.current=e,W({id:U(),role:"bot",kind:"profile"}),h(!1)},550)},[et]),eg=(0,n.useCallback)(async()=>{B(!0),W({id:U(),role:"user",kind:"text",text:"Yes, that's my business"}),await et(k($.current))},[et]),ey=(0,n.useCallback)(async e=>{B(!0),F(e);let t={...O.current,businessName:e.businessName,website:e.website,location:e.location,abn:e.abn,yearsInBusiness:e.yearsInBusiness,industry:e.industry,activities:e.activities.join(", ")};u(t),O.current=t,await X("Thanks — I’ve saved your business details."),await et(k($.current))},[et]),ev=(0,n.useCallback)(async()=>{await et(k("recommendation"))},[et]),ej=(0,n.useCallback)(e=>{u(t=>({...t,covers:e})),O.current={...O.current,covers:e}},[]),ew=(e,t,s)=>{r(e=>e.filter(e=>"scan"!==e.kind)),$.current=t,F(e),B(!1);let a={...O.current,businessName:e.businessName,website:e.website,location:e.location,abn:e.abn,yearsInBusiness:e.yearsInBusiness,industry:e.industry,activities:e.activities.join(", ")};(null==s?void 0:s.revenue)&&(a.revenue=s.revenue),(null==s?void 0:s.staff)&&(a.staff=s.staff),u(a),O.current=a,W({id:U(),role:"bot",kind:"profile"}),h(!1)},eN=(0,n.useCallback)(async e=>{W({id:U(),role:"user",kind:"text",text:"\uD83D\uDCC4 ".concat(e.name)}),h(!0),M(!1),g(0),W({id:U(),role:"bot",kind:"scan"});let s=setTimeout(()=>g(1),600),a=setTimeout(()=>g(2),1300),n=null;if(eH)try{let s=new FormData;s.append("file",e),s.append("sessionId",eW()),s.append("anonymousId",eU()),s.append("product",t);let a=await fetch("".concat(eO,"/upload"),{method:"POST",body:s}),i=await a.json();if(i.ok&&i.profile&&(n=i.profile),i.fileId){let t=String(i.fileId),s=i.fileName||e.name;O.current={...O.current,policyFileId:t,policyFileName:s},u(e=>({...e,policyFileId:t,policyFileName:s}))}}catch(e){}if(clearTimeout(s),clearTimeout(a),n&&n.businessName){en("documentUpload",{step_status:"success"}),ew({businessName:n.businessName||"",website:n.website||"",location:n.location||"",abn:n.abn||"",yearsInBusiness:(n.yearsInBusiness||"").replace(/[^\d]/g,""),industry:d(n.industry),activities:Array.isArray(n.activities)?n.activities:[]},"documentUpload",{revenue:m(n.revenue),staff:p(n.staff)});return}if(r(e=>e.filter(e=>"scan"!==e.kind)),n){let e={...O.current},t=[],s=(s,a,n)=>
1{n&&String(n).trim()&&(e[s]=n,t.push(a))};(s("businessName","business name",n.businessName),s("abn","ABN",n.abn),s("website","website",n.website),s("location","location",n.location),s("yearsInBusiness","years in business",(n.yearsInBusiness||"").replace(/[^\d]/g,"")),s("industry","industry",d(n.industry)),s("revenue","expected revenue",m(n.revenue)),s("staff","staff",p(n.staff)),n.activities&&n.activities.length&&(e.activities=n.activities.join(", "),t.push("activities")),u(e),O.current=e,t.length)?(en("documentUpload",{step_status:"success"}),await X("Thanks — from your document I filled in ".concat(t.length<=1?t[0]||"":"".concat(t.slice(0,-1).join(", ")," and ").concat(t[t.length-1]),". I’ll just ask for anything that’s missing."))):(en("documentUpload",{step_status:"fail"}),await X("I couldn’t find your business details in that document — no worries, let’s add them manually."))}else en("documentUpload",{step_status:"fail"}),await X("There wasn’t enough information in that document — no worries, let’s add your business details manually.");h(!1),await et(k("documentUpload"))},[et,t]),ek=(0,n.useCallback)(async e=>{W({id:U(),role:"user",kind:"text",text:e}),h(!0),M(!1),g(0),W({id:U(),role:"bot",kind:"scan"});let s=setTimeout(()=>g(1),600),a=setTimeout(()=>g(2),1300),n=null;if(eH)try{let s=await fetch("".concat(eO,"/enrich"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({website:e,sessionId:eW(),anonymousId:eU(),product:t})}),a=await s.json();a.ok&&a.profile&&(n=a.profile)}catch(e){}if(clearTimeout(s),clearTimeout(a),n&&n.businessName){en("business",{step_status:"success",lookup_method:"website"}),ew({businessName:n.businessName||"",website:e,location:n.location||"",abn:n.abn||"",yearsInBusiness:(n.yearsInBusiness||"").replace(/[^\d]/g,""),industry:d(n.industry),activities:Array.isArray(n.activities)?n.activities:[]},"business",{revenue:m(n.revenue),staff:p(n.staff)});return}r(e=>e.filter(e=>"scan"!==e.kind));let i={...O.current},l=[],o=(e,t,s)=>{s&&String(s).trim()&&(i[e]=s,l.push(t))};(i.website||(i.website=e),n&&(o("businessName","business name",n.businessName),o("abn","ABN",n.abn),o("location","location",n.location),o("yearsInBusiness","years in business",(n.yearsInBusiness||"").replace(/[^\d]/g,"")),o("industry","industry",d(n.industry)),o("revenue","expected revenue",m(n.revenue)),o("staff","staff",p(n.staff)),n.activities&&n.activities.length&&(i.activities=n.activities.join(", "),l.push("activities"))),u(i),O.current=i,l.length)?(en("business",{step_status:"success",lookup_method:"website"}),await X("Thanks — from your website I filled in ".concat(l.length<=1?l[0]||"":"".concat(l.slice(0,-1).join(", ")," and ").concat(l[l.length-1]),". I’ll just ask for anything that’s missing."))):(M(!0),en("business",{step_status:"fail",lookup_method:"website"}),await X("I couldn’t pull much from that site — no worries, let’s add your business details together.")),h(!1),await et(k("business"))},[et,t]),eC=(0,n.useCallback)((e,t)=>{u(s=>({...s,[e]:t})),O.current={...O.current,[e]:t}},[]),eS=(0,n.useCallback)(()=>{eR("Quote Review Opened",{section_id:"review"}),a("review")},[]),eM=(0,n.useCallback)(()=>a("chat"),[]),eI=(0,n.useCallback)(async()=>{await Q({submitted:!0}),z("submit",{sessionId:eW(),email:O.current.email||"",data:O.current,product:t});let e=O.current.covers,s=String(O.current.targetPremium||"").trim(),n={quote_id:eW(),product:t,currency:"AUD",covers:e?Object.keys(e).filter(t=>{var s;return null===(s=e[t])||void 0===s?void 0:s.enabled}):[],user_data:{email:String(O.current.email||"").trim().toLowerCase(),phone_number:G(String(O.current.phone||""))}};/^\d+(\.\d+)?$/.test(s)&&(n.value=Number(s)),Z("qa_quote_submitted",n),eR("Quote Submitted",{covers:n.covers}),a("thankyou")},[Q,t]),eF=(0,n.useCallback)(()=>{eR("Quote Restarted",es(H.current||N,{source:"restart_button"}));try{localStorage.removeItem("qa_email"),localStorage.removeItem("qa_sid")}catch(e){}eE({quote_id:eW()}),r([]),u({}),O.current={},F(null),B(!1),h(!1),E(!1),a("chat"),o(null),ee(N)},[ee]);return{view:s,items:i,data:c,busy:x,scanStage:f,scanFailed:y,profile:I,profileDecided:_,toast:T,resumePct:Math.max(5,Math.min(95,Math.round(L/Math.max(1,j.length-1)*100))),progressPct:l?Math.min(100,Math.max(4,Math.round(S(l)/Math.max(1,j.length-1)*100))):0,reachedReview:D,step:l?k(l):void 0,actions:{start:eo,continueResume:ec,startNew:ed,answerText:em,answerOption:eh,pickCard:eb,submitLookup:ef,submitOverseasCountries:ep,submitContactDetails:ex,confirmProfile:eg,saveManualProfile:ey,continueRecommendation:ev,setCovers:ej,uploadDocument:eN,enrichWebsite:ek,updateField:eC,goReview:eS,backToChat:eM,submit:eI,restart:eF,noteValidationFail:er,trackReviewSectionSaved:el}}}(s,i),{view:c,items:u,data:x,busy:h,scanStage:y,scanFailed:M,profile:T,profileDecided:A,step:L,toast:P,resumePct:E,reachedReview:R,actions:O}=o,H=n.useRef(null),[$,W]=n.useState(!1);if(n.useEffect(()=>{var e;null===(e=H.current)||void 0===e||e.scrollTo({top:H.current.scrollHeight,behavior:"smooth"})},[u,y]),"loading"===c)return(0,a.jsx)("div",{className:"h-full w-full bg-brand"});if("intro"===c)return(0,a.jsx)(e0,{onStart:O.start,onClose:r});if("resume"===c)return(0,a.jsx)(e1,{name:x.firstName,percent:E,onContinue:O.continueResume,onStartNew:O.startNew,onClose:r});let V=u.some(e=>"profile"===e.kind)&&!A,z=function(e,t){var s,a;let n=f.map(t=>({...t,applicable:t.steps.filter(t=>g(t,e))})).filter(e=>e.applicable.length>0),i=!t||"done"===t,r=-1;return t&&"done"!==t&&(r=n.findIndex(e=>e.steps.includes(t))),r<0&&(r=i?n.length:0),{stages:n.map((e,s)=>{if(s<r)return{id:e.id,label:e.label,fill:1,current:!1};if(s>r)return{id:e.id,label:e.label,fill:0,current:!1};let a=t?e.applicable.indexOf(t):0;return{id:e.id,label:e.label,fill:Math.max(0,a)/e.applicable.length,current:!0}}),label:"done"===t?"Review":(null===(s=n[r])||void 0===s?void 0:s.label)||(null===(a=n[n.length-1])||void 0===a?void 0:a.label)||""}}(x,null!==(t=null==L?void 0:L.id)&&void 0!==t?t:null);return(0,a.jsxs)("div",{className:"relative flex h-full w-full flex-col overflow-hidden bg-white text-ink",children:[(0,a.jsx)(eZ,{onRestart:()=>W(!0),onClose:r,saved:!!P,showRestart:"thankyou"!==c,stages:"thankyou"===c?[]:z.stages,stageLabel:z.label}),$&&(0,a.jsx)(eG,{onConfirm:()=>{W(!1),O.restart()},onCancel:()=>W(!1)}),"thankyou"!==c&&R&&(0,a.jsx)(eQ,{view:c,onChat:O.backToChat,onReview:O.goReview}),"review"===c?(0,a.jsx)(eA,{data:x,onChange:O.updateField,onCoversChange:O.setCovers,onSubmit:O.submit,onBack:O.backToChat,onSectionSaved:O.trackReviewSectionSaved}):"thankyou"===c?(0,a.jsx)(e5,{email:x.email}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{ref:H,className:"qa-scroll flex flex-1 flex-col gap-3 overflow-y-auto bg-chat px-4 py-4",children:u.map(e=>{var t,s,n;switch(e.kind){case"text":return"bot"===e.role?(0,a.jsx)(I,{children:e.text},e.id):(0,a.jsx)(F,{children:e.text},e.id);case"typing":return(0,a.jsx)(_,{},e.id);case"scan":return(0,a.jsx)(q,{stage:y,failed:M},e.id);case"profile":return T?(0,a.jsx)(U,{profile:T,decided:A,onConfirm:O.confirmProfile,onSave:O.saveManualProfile},e.id):null;case"cards":return(0,a.jsx)(B,{cards:(null===(t=k("method"))||void 0===t?void 0:t.cards)||[],chosen:!!x.method,onPick:(e,t)=>O.pickCard(e,t)},e.id);
1case"recommend":return(0,a.jsx)(K,{value:x.covers,onChange:O.setCovers,onContinue:O.continueRecommendation},e.id);case"overseas":return(0,a.jsx)(ef,{value:x.overseasCountries,onSubmit:O.submitOverseasCountries},e.id);case"intake":return(null===(n=k("contacts"))||void 0===n?void 0:null===(s=n.skip)||void 0===s?void 0:s.call(n,x))?null:(0,a.jsx)(D,{onSubmit:O.submitContactDetails,onInvalid:()=>O.noteValidationFail("contacts")},e.id);case"go-review":return(0,a.jsxs)("button",{onClick:O.goReview,className:"flex items-center gap-3 self-stretch rounded-card border border-line bg-white p-3.5 text-left hover:border-brand/40",children:[(0,a.jsx)("span",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-brand text-white",children:(0,a.jsx)(l,{name:"clipboard",className:"h-5 w-5"})}),(0,a.jsxs)("span",{className:"flex-1",children:[(0,a.jsx)("span",{className:"block font-bold text-ink",children:"Go to Review"}),(0,a.jsx)("span",{className:"block text-[13px] text-muted",children:"Check your information"})]}),(0,a.jsx)(l,{name:"arrowRight",className:"h-4 w-4 text-brand"})]},e.id)}})}),!h&&!V&&(null==L?void 0:L.type)!=="option-cards"&&(null==L?void 0:L.type)!=="done"&&(null==L?void 0:L.type)!=="recommendation"&&(null==L?void 0:L.type)!=="intake"&&(null==L?void 0:L.type)!=="country-split"&&(0,a.jsx)("div",{className:"border-t border-line bg-white",children:(0,a.jsx)(eK,{qa:o},null==L?void 0:L.id)})]})]})}function eK(e){let{qa:t}=e,{step:s,actions:n}=t;if(!s)return null;switch(s.type){case"short":case"optional-short":case"email":case"phone":case"number":case"abn":case"name":case"website":case"location":case"address":return(0,a.jsx)(ea,{type:s.type,placeholder:s.placeholder,onSubmit:n.answerText,onInvalid:()=>n.noteValidationFail()});case"date":return(0,a.jsx)(en,{onSubmit:n.answerText,onInvalid:()=>n.noteValidationFail()});case"options":return(0,a.jsx)(ed,{options:s.options||[],onPick:n.answerOption});case"yesno":return(0,a.jsx)(eu,{options:s.options||[],onPick:n.answerOption});case"multi":return(0,a.jsx)(ed,{options:s.options||[],multi:!0,onPick:n.answerOption});case"option-cards":case"recommendation":case"done":default:return null;case"business-lookup":return(0,a.jsx)(es,{placeholder:s.placeholder,onSubmit:(e,t)=>"website"===t?n.enrichWebsite(e):n.submitLookup(e)});case"industry-select":return(0,a.jsx)(em,{onPick:n.answerOption});case"long-text":return(0,a.jsx)(ei,{hint:s.hint,onSubmit:n.answerText,onInvalid:()=>n.noteValidationFail()});case"document-upload":return(0,a.jsx)(eg,{onFile:n.uploadDocument});case"premium":return(0,a.jsx)(eo,{onSubmit:(e,t)=>n.pickCard(e,t)})}}function eG(e){let{onConfirm:t,onCancel:s}=e;return(0,a.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center p-6",style:{backgroundColor:"rgba(37, 42, 65, 0.3)"},onClick:s,children:(0,a.jsxs)("div",{className:"relative w-full max-w-[320px] rounded-3xl bg-[#f6f7f9] p-6 pt-8 text-center shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("button",{onClick:s,"aria-label":"Close",className:"absolute right-4 top-4 flex h-8 w-8 items-center justify-center rounded-full bg-white text-ink shadow-sm hover:bg-slate-50",children:(0,a.jsx)(l,{name:"x",className:"h-4 w-4"})}),(0,a.jsx)("div",{className:"mb-3 flex justify-center",children:(0,a.jsx)(l,{name:"danger",className:"h-9 w-9 text-brand"})}),(0,a.jsx)("h3",{className:"text-[20px] font-extrabold text-ink",children:"Are you sure?"}),(0,a.jsx)("p",{className:"mx-auto mt-2 max-w-[240px] text-[14.5px] leading-relaxed text-muted",children:"Are you sure you want to restart? You will lose all your progress."}),(0,a.jsxs)("div",{className:"mt-5 flex flex-col gap-2.5",children:[(0,a.jsx)("button",{onClick:t,className:"w-full rounded-xl border border-brand bg-white py-3 font-bold text-brand transition hover:bg-[#EEF3FF]",children:"RESTART"}),(0,a.jsx)("button",{onClick:s,className:"w-full rounded-xl bg-brand py-3 font-bold text-white transition hover:bg-brand-600",children:"KEEP EDITING"})]})]})})}function eZ(e){let{onRestart:t,onClose:s,saved:n,showRestart:i=!0,stages:r=[],stageLabel:o=""}=e;return(0,a.jsxs)("div",{className:"bg-[#1A37D0] px-4 pb-3 pt-3.5 text-white",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-white",children:(0,a.jsx)("img",{src:"".concat(eV,"/upcover-logo.svg"),alt:"upcover",className:"h-[19px] w-6 translate-y-[2px]"})}),(0,a.jsxs)("div",{className:"leading-tight",children:[(0,a.jsx)("div",{className:"text-[16px] font-extrabold",children:"Quote Assistant"}),n?(0,a.jsxs)("div",{className:"flex items-center gap-1 text-[12px] font-semibold text-lime",children:[(0,a.jsx)(l,{name:"tickCircle",className:"h-3.5 w-3.5"})," Progress saved"]}):(0,a.jsx)("div",{className:"text-[12px] font-semibold text-lime",children:o||"Replies instantly"})]}),(0,a.jsxs)("div",{className:"ml-auto flex gap-2",children:[i&&(0,a.jsx)("button",{onClick:t,title:"Restart",className:"flex h-8 w-8 items-center justify-center rounded-full border border-white/50 hover:bg-white/15",children:(0,a.jsx)(l,{name:"restart",className:"h-4 w-4"})}),s&&(0,a.jsx)("button",{onClick:s,title:"Minimise",className:"flex h-8 w-8 items-center justify-center rounded-full border border-white/50 hover:bg-white/15",children:(0,a.jsx)(l,{name:"x",className:"h-4 w-4"})})]})]}),r.length>0&&(0,a.jsx)("div",{className:"mt-3 flex gap-1.5",role:"progressbar","aria-valuemin":0,"aria-valuemax":r.length,"aria-valuenow":r.filter(e=>e.fill>=1).length,"aria-label":"Progress: ".concat(o),children:r.map(e=>(0,a.jsx)("div",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-white/25",title:e.label,children:(0,a.jsx)("div",{className:"h-full rounded-full bg-lime transition-all duration-300",style:{width:"".concat(Math.round(100*e.fill),"%")}})},e.id))})]})}function eQ(e){let{view:t,onChat:s,onReview:n}=e,i=(e,t,s,n)=>(0,a.jsxs)("button",{onClick:n,className:"flex flex-1 items-center justify-center gap-2 border-b-2 py-2.5 text-[14.5px] font-semibold ".concat(e?"border-brand text-brand":"border-transparent text-slate-500"),children:[(0,a.jsx)(l,{name:s,className:"h-[17px] w-[17px]"})," ",t]});return(0,a.jsxs)("div",{className:"flex border-b border-line bg-white",children:[i("chat"===t,"Chat","message",s),i("review"===t,"Review","clipboard",n)]})}function eY(){return(0,a.jsxs)("div",{className:"pointer-events-none absolute inset-0 overflow-hidden bg-white","aria-hidden":!0,
1children:[(0,a.jsx)("div",{className:"qa-intro-fallback absolute inset-x-0 bottom-0 h-1/2"}),(0,a.jsx)("video",{className:"absolute inset-0 h-full w-full translate-y-[80px] object-cover object-bottom",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,preload:"auto",children:(0,a.jsx)("source",{src:"".concat(eV,"/cropped-widget-video-new.mp4"),type:"video/mp4"})}),(0,a.jsx)("div",{className:"absolute inset-0",style:{background:"linear-gradient(to bottom, #ffffff 0%, #ffffff 44%, rgba(255,255,255,0.35) 60%, rgba(255,255,255,0) 76%)"}})]})}function eJ(e){let{onClose:t,center:s}=e;return s?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"absolute left-1/2 top-0 z-20 flex h-[45px] w-[200px] -translate-x-1/2 items-center justify-center gap-3 rounded-b-[10px] bg-[#d5e525]",children:[(0,a.jsx)("img",{src:"".concat(eV,"/upcover-logo-dark.svg"),alt:"upcover",className:"h-[19px] w-6"}),(0,a.jsx)("span",{className:"text-[16px] font-semibold text-[#242826]",children:"Quote Assistant"})]}),t&&(0,a.jsx)("button",{onClick:t,className:"absolute right-5 top-4 z-20 text-[#242826]/60 hover:text-[#242826]",children:(0,a.jsx)(l,{name:"x",className:"h-5 w-5"})})]}):(0,a.jsxs)("div",{className:"relative z-10 flex items-start px-6 pt-6",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-2.5 rounded-[10px] bg-[#d5e525] px-4 py-2.5",children:[(0,a.jsx)("img",{src:"/upcover-logo-dark.svg",alt:"upcover",className:"h-[19px] w-6"}),(0,a.jsx)("span",{className:"text-[15px] font-semibold text-[#242826]",children:"Quote Assistant"})]}),t&&(0,a.jsx)("button",{onClick:t,className:"ml-auto text-[#242826]/60 hover:text-[#242826]",children:(0,a.jsx)(l,{name:"x",className:"h-5 w-5"})})]})}function eX(e){let{label:t,onClick:s,className:n=""}=e;return(0,a.jsx)(W,{label:t,onClick:s,className:"w-full max-w-[334px] rounded-[20px] bg-lime py-4 text-[16px] font-semibold text-[#242826] ".concat(n)})}function e0(e){let{onStart:t,onClose:s}=e;return(0,a.jsxs)("div",{className:"relative flex h-full w-full flex-col overflow-hidden bg-white text-[#242826]",children:[(0,a.jsx)(eY,{}),(0,a.jsx)(eJ,{onClose:s,center:!0}),(0,a.jsxs)("div",{className:"relative z-10 flex flex-1 flex-col items-center justify-center px-6 text-center",children:[(0,a.jsxs)("h1",{className:"text-[40px] font-extrabold leading-[1.05] tracking-[-0.01em] text-[#242826]",children:["Let’s build",(0,a.jsx)("br",{}),"your quote"]}),(0,a.jsx)("p",{className:"mt-5 max-w-[380px] text-[14px] leading-[1.4] text-[#494949]",children:"Answer a few quick questions about your business. We'll help identify relevant cyber cover options."}),(0,a.jsx)(eX,{label:"START A QUOTE",onClick:t,className:"mt-[62px]"})]}),(0,a.jsx)("div",{className:"relative z-10 px-6 pb-6 text-center",children:(0,a.jsxs)("p",{className:"text-[13px] leading-relaxed text-white",children:["By continuing, you agree to upcover's"," ",(0,a.jsx)("a",{href:"https://www.upcover.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"privacy policy"})," ","and"," ",(0,a.jsx)("a",{href:"https://www.upcover.com/terms-and-conditions",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"terms and conditions"}),"."]})})]})}function e1(e){let{name:t,percent:s,onContinue:n,onStartNew:i,onClose:r}=e;return(0,a.jsxs)("div",{className:"relative flex h-full w-full flex-col overflow-hidden bg-white text-[#242826]",children:[(0,a.jsx)(eY,{}),(0,a.jsx)(eJ,{onClose:r,center:!0}),(0,a.jsxs)("div",{className:"relative z-10 flex flex-1 flex-col items-center justify-center px-6 text-center",children:[(0,a.jsxs)("h1",{className:"text-[34px] font-extrabold leading-[1.08] tracking-[-0.01em] text-[#242826]",children:["Welcome back",t?", ".concat(t):""]}),(0,a.jsx)("p",{className:"mt-4 max-w-[360px] text-[16px] leading-[1.4] text-[#494949]",children:"Progress saved. Continue the remaining questions when you're ready."}),(0,a.jsxs)("div",{className:"mt-6 w-full max-w-[332px]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between text-[15px] font-semibold",children:[(0,a.jsx)("span",{className:"text-[#242826]",children:"Your progress"}),(0,a.jsxs)("span",{className:"text-[#494949]",children:[s,"%"]})]}),(0,a.jsx)("div",{className:"mt-2 h-2 w-full overflow-hidden rounded-full bg-[#e3e7ec]",children:(0,a.jsx)("div",{className:"h-full rounded-full bg-[#005dff] transition-all",style:{width:"".concat(s,"%")}})})]}),(0,a.jsx)(eX,{label:"CONTINUE APPLICATION",onClick:n,className:"mt-[58px]"})]}),(0,a.jsx)("div",{className:"relative z-10 px-6 pb-6 text-center",children:(0,a.jsx)("button",{onClick:i,className:"text-[14px] font-medium text-white underline",children:"or Start a new application"})})]})}function e2(){try{var e,t;let s=new Intl.DateTimeFormat("en-US",{timeZone:"Australia/Sydney",weekday:"short",hour:"2-digit",hour12:!1}).formatToParts(new Date),a=(null===(e=s.find(e=>"weekday"===e.type))||void 0===e?void 0:e.value)||"",n=parseInt((null===(t=s.find(e=>"hour"===e.type))||void 0===t?void 0:t.value)||"0",10);return 24===n&&(n=0),["Mon","Tue","Wed","Thu","Fri"].includes(a)&&n>=9&&n<20}catch(e){return!0}}function e5(e){let{email:t}=e,[s]=n.useState(e2);return(0,a.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center bg-white px-7 text-center",children:[(0,a.jsx)("div",{className:"mb-6 flex h-[92px] w-[92px] items-center justify-center rounded-full bg-[#005dff]",children:(0,a.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",className:"h-11 w-11 text-white",children:(0,a.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,a.jsx)("h3",{className:"text-[28px] font-extrabold text-ink",children:"Thank You!"}),(0,a.jsx)("p",{className:"mt-3 max-w-[330px] text-[14.5px] leading-relaxed text-slate-500",children:s?"Your quote request has been received. A specialist will be in touch within 1 business hour.":"Your quote request has been received. Our specialists are available Monday to Frid
1ay, 9am to 8pm (Australian Eastern Time). We'll be in touch within 1 business hour of opening."}),(0,a.jsxs)("div",{className:"mt-6 flex w-full max-w-[350px] items-center gap-3 rounded-2xl border border-line bg-white px-4 py-3 text-left",children:[(0,a.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-chat text-muted",children:(0,a.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:"h-[18px] w-[18px]",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,a.jsx)("path",{d:"M3.5 7l8.5 6 8.5-6"})]})}),(0,a.jsxs)("span",{className:"text-[13.5px] text-ink",children:["A copy was sent to ",(0,a.jsx)("span",{className:"font-bold",children:t||"your email"})]})]})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.