1import{r as d,ei as Pe,ej as Fe,j as e,ab as V,B as k,A as X,z as ne,ay as ke,T as Ae,b0 as Te,L as z,u as M,e7 as qe,e8 as Oe,e9 as Ie,ea as Re,aU as oe,a2 as $e,a3 as Ee,a0 as ze,a4 as Le,a5 as Be,I as A,ek as Ue,el as De,em as We,en as pe,e5 as Ye,F as Ve,eo as Ge,a8 as Ke,ad as Xe,ep as He,H as G,bo as ye,eq as Je,P as be,v as Qe,bs as Ze,S as es,b as B,d as ss,aR as ts,f as as,w as te,de as rs,er as ns}from"./index-C-B5SaCl.js";import{u as os,a as ls}from"./useApplicantPageAppearance-CtRpS6E1.js";import{g as is}from"./applicantPropertyGrouping-DZHHpEvF.js";import{M as cs}from"./mountain-BNb4DCR2.js";import{e as ds,a as ms}from"./deriveIntent-tk3oLNSN.js";function us(s){const r=s instanceof URLSearchParams?s.getAll("subject"):Array.isArray(s)?[...s]:[s],c=new Set,w=[];for(const m of r)if(typeof m=="string")for(const b of m.split(",")){const x=b.trim();!x||c.has(x)||(c.add(x),w.push(x))}return w}function hs(s,r,c=Date.now()){const w=us(r);let m=null;for(const t of w){const g=s.find(o=>!!o.screen_property_id&&o.screen_property_id===t);if(g){m=g;break}}const b=new Set;m!=null&&m.screen_property_id&&b.add(m.screen_property_id);const x=[];for(const t of s){const g=t.screen_property_id??"";g&&b.has(g)||(g&&b.add(g),x.push(t))}return{featured:m,grouped:is(x,c)}}function xs(s){const r=s.toLowerCase();return r.includes("must have")||r.includes("must-have")||r.includes("important")?["A garden","Off-road parking","South-facing","Modern kitchen","Quiet street"]:r.includes("avoid")||r.includes("deal-break")||r.includes("rule out")?["Main road","Leasehold","Needs full refurb","No garden"]:r.includes("when")||r.includes("timeline")||r.includes("move")?["ASAP","Next 3 months","Next 6 months","Flexible"]:r.includes("style")||r.includes("type")||r.includes("character")?["Victorian","Modern new-build","Period charm","Open plan"]:[]}function fs(s){const r=d.useMemo(()=>{const l=[];s.showMortgageStep!==!1&&l.push({key:"mortgage",eyebrow:"Your buying position",title:"Where are you with a mortgage?",sub:"This helps us point you in the right direction â no judgement either way.",options:Pe}),s.showPropertyStep!==!1&&l.push({key:"property",eyebrow:"Anything to sell?",title:"Do you have a property to sell?",sub:"If you do, we can help you get going â even if it's just an early-stage valuation.",options:Fe});for(const h of s.questions)l.push({key:"free",eyebrow:"Tell us more",question:h,suggestions:xs(h)});return s.profileSlot&&l.push({key:"profile",eyebrow:"Your profile"}),l},[s.questions,s.showMortgageStep,s.showPropertyStep,s.profileSlot]);if(r.length===0)return queueMicrotask(s.onClose),null;const[c,w]=d.useState(0),[m,b]=d.useState(s.initialMortgage),[x,t]=d.useState(s.initialProperty),[g,o]=d.useState(()=>s.questions.map(()=>"")),[j,N]=d.useState(!1),[T,q]=d.useState(!1),C=r.length,y=r[c],S=c===C-1,P=(()=>{if(y.key!=="free")return-1;let l=-1;for(let h=0;h<=c;h++)r[h].key==="free"&&l++;return l})(),_=y.key==="mortgage"?m!==null:y.key==="property"?x!==null:(y.key==="profile",!0),a=async()=>{if(!S){w(l=>Math.min(l+1,C-1));return}N(!0);try{const l=s.questions.map((h,n)=>({question:h,answer:(g[n]??"").trim()}));await s.onSubmit({answers:l,mortgage_status:m,property_to_sell_status:x}),q(!0)}catch(l){M.error((l==null?void 0:l.message)??"Couldn't save your answers")}finally{N(!1)}},u=()=>S?a():w(l=>l+1),f=l=>{o(h=>{const n=[...h];return n[P]=l,n})},R=l=>{const h=g[P]??"",n=h.trim()&&!h.trim().endsWith(",")?", ":h.trim()?" ":"";f(h+n+l)};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-stretch justify-center bg-black/55 backdrop-blur-sm sm:items-center sm:p-4",children:e.jsxs("div",{className:"flex w-full max-w-xl flex-col overflow-hidden bg-background shadow-2xl sm:rounded-2xl",style:{animation:"wizardEnter 380ms cubic-bezier(0.22,1,0.36,1) both"},children:[e.jsx("style",{children:` 2 @keyframes wizardEnter { 3 from { opacity: 0; transform: translateY(24px) scale(0.98); } 4 to { opacity: 1; transform: translateY(0) scale(1); } 5 } 6 @keyframes stepEnter { 7 from { opacity: 0; transform: translateX(16px); } 8 to { opacity: 1; transform: translateX(0); } 9 } 10 `}),T?e.jsxs("div",{className:"space-y-5 p-8 text-center",children:[e.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-full",style:{background:`color-mix(in srgb, ${s.appearance.primary_color} 16%, transparent)`,color:s.appearance.primary_color},children:e.jsx(V,{className:"h-8 w-8"})}),e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-semibold leading-tight",style:{fontFamily:s.appearance.heading_font},children:["Brilliant, ",s.firstName," â that really helps."]}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"We've tuned your matches and we'll surface the right next steps for you on the page."})]}),e.jsxs(k,{onClick:s.onClose,className:"w-full sm:w-auto",style:{background:s.appearance.primary_color,color:"#fff"},children:["See my matches ",e.jsx(X,{className:"ml-1 h-4 w-4"})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between border-b px-5 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(ne,{className:"h-3.5 w-3.5",
10style:{color:s.appearance.primary_color}}),"Tailoring your matches"]}),e.jsx("button",{type:"button",onClick:s.onClose,className:"text-muted-foreground transition-colors hover:text-foreground","aria-label":"Close",children:e.jsx(ke,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"flex gap-1.5 px-5 pt-4",children:r.map((l,h)=>e.jsx("div",{className:"h-1.5 flex-1 rounded-full transition-all duration-500",style:{background:h<=c?s.appearance.primary_color:"color-mix(in srgb, currentColor 12%, transparent)"}},h))}),e.jsx("div",{className:"flex-1 space-y-5 px-6 py-6",style:{animation:"stepEnter 320ms cubic-bezier(0.22,1,0.36,1) both"},children:y.key==="profile"?s.profileSlot:y.key==="free"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] opacity-70",style:{color:s.appearance.primary_color},children:y.eyebrow}),e.jsx("h2",{className:"mt-1.5 text-2xl font-semibold leading-tight",style:{fontFamily:s.appearance.heading_font},children:y.question})]}),e.jsx(Ae,{value:g[P]??"",onChange:l=>f(l.target.value),placeholder:"A short note is plenty â or as much detail as you like.",rows:4,autoFocus:!0}),y.suggestions.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:y.suggestions.map(l=>e.jsxs("button",{type:"button",onClick:()=>R(l),className:"rounded-full border bg-card px-3 py-1 text-xs text-muted-foreground transition-all hover:scale-[1.02] hover:border-current",style:{borderColor:`color-mix(in srgb, ${s.appearance.primary_color} 22%, transparent)`},children:["+ ",l]},l))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Skip anything that doesn't apply â no pressure."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] opacity-70",style:{color:s.appearance.primary_color},children:y.eyebrow}),e.jsx("h2",{className:"mt-1.5 text-2xl font-semibold leading-tight",style:{fontFamily:s.appearance.heading_font},children:y.title}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:y.sub})]}),e.jsx("div",{className:"space-y-2",children:y.options.map(l=>{const h=l.value,n=y.key==="mortgage"?m===h:x===h;return e.jsxs("button",{type:"button",onClick:()=>{y.key==="mortgage"?b(h):t(h)},className:`group flex w-full items-start gap-3 rounded-xl border p-3.5 text-left transition-all ${n?"shadow-md":"hover:bg-muted/50"}`,style:{borderColor:n?s.appearance.primary_color:"color-mix(in srgb, currentColor 14%, transparent)",background:n?`color-mix(in srgb, ${s.appearance.primary_color} 8%, transparent)`:void 0},children:[e.jsx("span",{className:"mt-0.5 flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full border-2 transition-all",style:{borderColor:n?s.appearance.primary_color:"color-mix(in srgb, currentColor 30%, transparent)",background:n?s.appearance.primary_color:void 0},children:n&&e.jsx(V,{className:"h-3 w-3",style:{color:"#fff"}})}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-sm font-medium leading-snug",children:l.label}),e.jsx("span",{className:"block text-xs text-muted-foreground",children:l.hint})]})]},h)})})]})},c),e.jsxs("div",{className:"flex items-center justify-between gap-2 border-t bg-muted/30 px-5 py-3",children:[e.jsxs(k,{variant:"ghost",size:"sm",onClick:()=>w(l=>Math.max(l-1,0)),disabled:c===0||j,children:[e.jsx(Te,{className:"mr-1 h-3.5 w-3.5"})," Back"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[(y.key==="free"||y.key==="profile")&&e.jsx(k,{variant:"ghost",size:"sm",onClick:u,disabled:j,children:"Skip"}),e.jsx(k,{size:"sm",onClick:a,disabled:j||!_,style:{background:s.appearance.primary_color,color:"#fff"},children:j?e.jsx(z,{className:"h-3.5 w-3.5 animate-spin"}):S?e.jsxs(e.Fragment,{children:["Finish ",e.jsx(V,{className:"ml-1 h-3.5 w-3.5"})]}):e.jsxs(e.Fragment,{children:["Next ",e.jsx(X,{className:"ml-1 h-3.5 w-3.5"})]})})]})]})]})]},"wizard-card")})}const gs={House:G,Flat:ye,Bungalow:G,Maisonette:ye,Cottage:G,Land:cs};function je(s){return s>=1e6?`£${(s/1e6).toFixed(s%1e6===0?0:1)}m`:s>=1e3?`£${Math.round(s/1e3)}
10k`:`£${s}`}const ps=["WN1","WN2","WN3","WN4","WN5","WN6","WN7","WN8","L39","L40"],L=2e6,E=13e5,K=100;function we(s){return s<=0?0:s>=L?K:s<=E?s/E*80:80+(s-E)/(L-E)*20}function ve(s){return s<=0?0:s>=K?L:s<=80?s/80*E:E+(s-80)/20*(L-E)}function ys(s){const[r,c]=d.useState(s.value),[w,m]=d.useState(""),[b,x]=d.useState(!1),[t,g]=d.useState(!1);d.useEffect(()=>{s.open&&(c(s.value),m(""))},[s.open,s.value]);const o=a=>{const u=a.split(/[,;\s]+/).map(f=>f.trim().toUpperCase()).filter(Boolean);u.length&&(c(f=>({...f,search_postcodes:Array.from(new Set([...f.search_postcodes??[],...u]))})),m(""))},j=a=>c(u=>({...u,search_postcodes:u.search_postcodes.filter(f=>f!==a)})),N=a=>c(u=>({...u,search_postcodes:u.search_postcodes.includes(a)?u.search_postcodes.filter(f=>f!==a):[...u.search_postcodes,a]})),T=Array.from(new Set([...ps,...s.postcodeOptions??[],...r.search_postcodes].map(a=>a.toUpperCase()))).sort(),q=a=>c(u=>({...u,property_types:u.property_types.includes(a)?u.property_types.filter(f=>f!==a):[...u.property_types,a]})),C=r.price_min??0,y=r.price_max??L,S=we(C),P=r.price_max===null?K:we(y),_=async()=>{x(!0);try{await s.onSave(r),M.success("Search updated â refreshing your matches"),s.onOpenChange(!1)}catch(a){M.error((a==null?void 0:a.message)??"Couldn't update")}finally{x(!1)}};return e.jsx(qe,{open:s.open,onOpenChange:s.onOpenChange,children:e.jsxs(Oe,{side:"right",className:"w-full sm:max-w-md overflow-y-auto",children:[e.jsxs(Ie,{children:[e.jsx(Re,{style:{fontFamily:s.headingFont},className:"text-2xl",children:"Tune your search"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Adjust anything below â we'll re-match instantly."})]}),e.jsxs("div",{className:"mt-6 space-y-7",children:[e.jsxs("section",{children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2 text-sm font-medium",children:[e.jsx(oe,{className:"h-4 w-4",style:{color:s.brandColor}}),"Areas you want"]}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[r.search_postcodes.map(a=>e.jsxs("button",{type:"button",onClick:()=>j(a),className:"group inline-flex items-center gap-1 rounded-full border bg-card px-3 py-1 text-xs transition-colors hover:border-destructive hover:text-destructive",style:{borderColor:`color-mix(in srgb, ${s.brandColor} 22%, transparent)`},children:[a,e.jsx(ke,{className:"h-3 w-3 opacity-50 group-hover:opacity-100"})]},a)),r.search_postcodes.length===0&&e.jsx("span",{className:"text-xs text-muted-foreground",children:"No areas yet â pick some below"})]}),e.jsx("div",{className:"mt-2",children:e.jsxs($e,{open:t,onOpenChange:g,children:[e.jsx(Ee,{asChild:!0,children:e.jsxs(k,{type:"button",variant:"outline",size:"sm",className:"w-full justify-between font-normal",children:[e.jsx("span",{className:"text-muted-foreground",children:r.search_postcodes.length?`${r.search_postcodes.length} area${r.search_postcodes.length===1?"":"s"} selected`:"Choose areas"}),e.jsx(ze,{className:"h-4 w-4 opacity-60"})]})}),e.jsxs(Le,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:[e.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:T.length===0?e.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:"No areas available yet â add one below."}):T.map(a=>{const u=r.search_postcodes.includes(a);return e.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-muted",children:[e.jsx(Be,{checked:u,onCheckedChange:()=>N(a)}),e.jsx("span",{children:a})]},a)})}),e.jsx("div",{className:"border-t p-2",children:e.jsxs("div",{className:"flex gap-1.5",children:[e.jsx(A,{value:w,onChange:a=>m(a.target.value),onKeyDown:a=>{(a.key==="Enter"||a.key===",")&&(a.preventDefault(),o(w))},placeholder:"Add another, e.g. SW1",className:"h-8 text-xs"}),e.jsx(k,{type:"button",variant:"outline",size:"sm",className:"h-8",onClick:()=>o(w),disabled:!w.trim(),children:"Add"})]})})]})]})})]}),e.jsxs("section",{children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-medium",children:"Price range"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[je(C)," â ",y>=L?"£2m+":je(y)]})]}),e.jsxs(Ue,{className:"relative flex w-full touch-none select-none items-center",value:[S,P],min:0,max:K,step:1,minStepsBetweenThumbs:1,onValueChange:([a,u])=>c(f=>({...f,price_min:a>0?ve(a):null,price_max:u>=K?null:ve(u)})),children:[e.jsx(De,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:e.jsx(We,{className:"absolute h-full",style:{background:s.brandColor}})}),e.jsx(pe,{"aria-label":"Minimum price",className:"block h-5 w-5 rounded-full border-2 bg-background shadow ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",style:{borderColor:s.brandColor}}),e.jsx(pe,{"aria-label":"Maximum price",className:"block h-5 w-5 rounded-full border-2 bg-background shadow ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",style:{borderColor:s.brandColor}})]}),e.jsxs("div",{className:"mt-1 flex justify-between text-[10px] uppercase tracking-wide text-muted-foreground",children:[e.jsx("span",{children:"£0"}),e.jsx("span",{children:"£2m+"})]}),e.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[e.jsx(A,{type:"number",placeholder:"Min",value:r.price_min??"",onFocus:a=>a.target.select(),onChange:a=>c(u=>({...u,price_min:a.target.value?Number(a.target.value):null}))}),e.jsx(A,{type:"number",placeholder:"Max (blank = no limit)",value:r.price_max??"",onFocus:a=>a.target.select(),onChange:a=>c(u=>{const f=a.target.value?Number(a.target.value):null;return{...u,price_max:f&&f>=L?null:f}})})]})]}),e.jsxs("section",{children:[e.jsx("span",{className:"mb-2 block text-sm font-medium",children:"Minimum bedrooms"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(k,{variant:"outline",size:"icon",className:"h-9 w-9",onClick:()=>c(a=>({...a,bedrooms_min:Math.max(0,(a.bedrooms_min??0)-1)})),children:e.jsx(Ye,{className:"h-4 w-4"})}),e.jsx("div",{className:"flex h-12 w-16 items-center justify-center rounded-lg border text-xl font-semibold",style:{fontFamily:s.headingFont,borderColor:`color-mix(in srgb, ${s.brandColor} 30%, transparent)`},children:r.bedrooms_min||0}),e.jsx(k,{variant:"outline",size:"icon",className:"h-9 w-9",onClick:()=>c(a=>({...a,bedrooms_min:Math.min(10,(a.bedrooms_min??0)+1)})),children:e.jsx(Ve,{className:"h-4 w-4"})}),e.jsx("span",{className:"text-xs text-muted-foreground",children:r.bedrooms_min?`${r.bedrooms_min}+ beds`:"Any size"})]})]}),e.jsxs("section",{children:[e.jsx("span",{className:"mb-2 block text-sm font-medium",children:"Property types"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:Ge.map(a=>{const u=gs[a]??He,f=r.property_types.includes(a);return e.jsxs("button",{type:"button",onClick:()=>q(a),className:"flex flex-col items-center gap-1.5 rounded-xl border bg-card p-3 text-xs font-medium transition-all hover:scale-[1.02]",style:{borderColor:f?s.brandColor:"color-mix(in srgb, currentColor 14%, transparent)",background:f?`color-mix(in srgb, ${s.brandColor} 10%, transparent)`:void 0,color:f?s.brandColor:void 0},children:[e.jsx(u,{className:"h-5 w-5"}),a]},a)})})]})]}),s.profileSlot&&e.jsxs("section",{className:"mt-8 border-t pt-6",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2 text-sm font-medium",children:[e.jsx(Ke,{className:"h-4 w-4",style:{color:s.brandColor}}),"Your contact details"]}
10),s.profileSlot]}),e.jsxs("div",{className:"sticky bottom-0 -mx-6 mt-8 flex items-center justify-end gap-2 border-t bg-background/95 px-6 py-3 backdrop-blur",children:[e.jsx(k,{variant:"outline",onClick:()=>s.onOpenChange(!1),disabled:b,children:"Cancel"}),e.jsxs(k,{onClick:_,disabled:b,style:{background:s.brandColor,color:"#fff"},children:[b?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(Xe,{className:"mr-2 h-4 w-4"}),"Save & re-match"]})]})]})})}const ae=[{heading:"Do you know the value of your home?",body:"Get an instant Ballpark estimate, or book a valuation with one of our expert valuers.",cta:"Value my home"},{heading:"Curious what your home is worth?",body:"A quick Ballpark estimate or full valuation puts you in a stronger buying position.",cta:"Find out now"},{heading:"Need a rough idea on your home's value?",body:"Get a Ballpark Estimate in under 30 seconds",cta:"Get estimate"}];function Ne(s){const[r,c]=d.useState(!1),[w,m]=d.useState(!1),b=s.done||w,x=d.useMemo(()=>{if(s.kind!=="valuation")return null;const g=typeof s.valuationVariant=="number"?s.valuationVariant%ae.length:Math.floor(Math.random()*ae.length);return ae[g]},[s.kind,s.valuationVariant]);if(s.kind==="valuation"&&x)return e.jsx("a",{href:"https://neilrobinson.co.uk/book-valuation",target:"_blank",rel:"noopener noreferrer",className:"col-span-full block rounded-2xl border overflow-hidden bg-card transition-shadow hover:shadow-md",style:{borderColor:`color-mix(in srgb, ${s.brandColor} 22%, transparent)`},children:e.jsxs("div",{className:"flex items-center gap-4 p-5 sm:p-6",children:[e.jsx("div",{className:"flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full",style:{background:`color-mix(in srgb, ${s.brandColor} 14%, transparent)`,color:s.brandColor},children:e.jsx(G,{className:"h-6 w-6"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"text-lg sm:text-xl font-semibold leading-snug",style:{fontFamily:s.headingFont},children:x.heading}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground leading-relaxed",children:x.body})]}),e.jsxs("span",{className:"hidden sm:inline-flex items-center gap-1.5 rounded-full px-4 py-2 text-sm font-medium text-white flex-shrink-0",style:{background:s.brandColor},children:[x.cta," ",e.jsx(X,{className:"h-4 w-4"})]})]})});const t=async()=>{var g;c(!0);try{const o=await fetch(`${s.apiUrl}?action=request-action&token=${encodeURIComponent(s.token)}`,{method:"POST",headers:{"Content-Type":"application/json",apikey:s.apiKey},body:JSON.stringify({kind:"mortgage_referral"})}),j=await o.json();if(!o.ok)throw new Error(j.error??"Couldn't submit your request");m(!0),M.success("We'll be in touch shortly â thanks!"),(g=s.onAfterRequest)==null||g.call(s)}catch(o){M.error((o==null?void 0:o.message)??"Couldn't submit your request")}finally{c(!1)}};return e.jsx("div",{className:"col-span-full rounded-2xl border bg-card overflow-hidden",style:{borderColor:`color-mix(in srgb, ${s.brandColor} 22%, transparent)`},children:e.jsxs("div",{className:"flex items-center gap-4 p-5 sm:p-6",children:[e.jsx("div",{className:"flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full",style:{background:`color-mix(in srgb, ${s.brandColor} 14%, transparent)`,color:s.brandColor},children:e.jsx(Je,{className:"h-6 w-6"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"text-lg sm:text-xl font-semibold leading-snug",style:{fontFamily:s.headingFont},children:"Free mortgage consultation"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground leading-relaxed",children:"Our independent advisor can find the right deal for your budget â no obligation."})]}),e.jsx("div",{className:"flex-shrink-0",children:b?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-sm font-medium text-emerald-600",children:[e.jsx(V,{className:"h-4 w-4"})," Request received"]}):e.jsx(k,{onClick:t,disabled:r,style:{background:s.brandColor,color:"#fff"},children:r?e.jsx(z,{className:"h-4 w-4 animate-spin"}):e.jsxs(e.Fragment,{children:["Arrange a chat ",e.jsx(X,{className:"ml-1 h-4 w-4"})]})})})]})})}function bs({criteriaSummary:s,primaryColor:r,hasUnanswered:c,hasAnsweredAnything:w,onEditSearch:m,onRefineMatches:b}){return e.jsxs("div",{className:"am-reveal mt-10 grid gap-4 sm:grid-cols-2 max-w-3xl",style:{animationDelay:"240ms"},children:[e.jsxs("div",{className:"group relative overflow-hidden rounded-xl border border-white/10 bg-white/[0.07] backdrop-blur-md p-5 transition-colors hover:bg-white/[0.11]",children:[e.jsxs("div",{className:"flex items-start gap-3.5",children:[e.jsx("div",{className:"flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-full",style:{background:`color-mix(in srgb, ${r} 22%, rgba(255,255,255,0.1))`,color:"#fff"},children:e.jsx(oe,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-white/60",children:"Searching"}),e.jsx("p",{className:"mt-1 text-sm text-white/90 leading-snug truncate",children:s||"No criteria set yet"})]})]}),e.jsxs("button",{type:"button",onClick:m,className:"mt-4 inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 text-xs font-medium transition-colors bg-white/10 hover:bg-white/20 text-white",children:[e.jsx(be,{className:"h-3 w-3"})," Edit search"]})]}),e.jsxs("div",{className:"group relative overflow-hidden rounded-xl border border-white/10 bg-white/[0.07] backdrop-blur-md p-5 transition-colors hover:bg-white/[0.11]",children:[e.jsxs("div",{className:"flex items-start gap-3.5",children:[e.jsx("div",{className:"flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-full",style:{background:`color-mix(in srgb, ${r} 22%, rgba(255,255,255,0.1))`,color:"#fff"},children:c?e.jsx(ne,{className:"h-4 w-4"}):e.jsx(V,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-white/60",children:c?"Matches":"Refined for you"}),e.jsx("p",{className:"mt-1 text-sm text-white/90 leading-snug",children:c?"A few quick questions left â under a minute.":"We've tuned your results based on what you told us."})]})]}),e.jsx("button",{type:"button",onClick:b,className:"mt-4 inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 text-xs font-medium transition-colors bg-white/10 hover:bg-white/20 text-white",children:c?e.jsxs(e.Fragment,{children:["Refine now ",e.jsx(X,{className:"h-3 w-3"})]}):e.jsxs(e.Fragment,{children:[e.jsx(be,{className:"h-3 w-3"})," Update answers"]})})]})]})}function js(s){const{apiUrl:r,apiKey:c,token:w,masked:m,brandColor:b,headingFont:
10x,onSaved:t}=s,[g,o]=d.useState("locked"),[j,N]=d.useState(!1),[T,q]=d.useState(m.email_masked),[C,y]=d.useState(""),[S,P]=d.useState(null),[_,a]=d.useState(null),u=async(n,$)=>{const O=await fetch(`${r}?action=${n}&token=${encodeURIComponent(w)}`,{method:"POST",headers:{"Content-Type":"application/json",apikey:c},body:$?JSON.stringify($):"{}"}),H=await O.json();if(!O.ok)throw new Error(H.error??"Request failed");return H},f=async()=>{N(!0);try{const n=await u("request-contact-otp");q(n.sent_to??m.email_masked),o("code-sent"),M.success("Code sent â check your inbox")}catch(n){M.error((n==null?void 0:n.message)??"Couldn't send code")}finally{N(!1)}},R=async()=>{if(!/^\d{6}$/.test(C)){M.error("Enter the 6-digit code");return}N(!0);try{const n=await u("verify-contact-otp",{code:C});P(n.unlock_token),a(n.contact),o("unlocked")}catch(n){M.error((n==null?void 0:n.message)??"Verification failed")}finally{N(!1)}},l=async()=>{if(!(!_||!S)){N(!0);try{await u("update-contact",{..._,unlock_token:S}),M.success("Contact details updated"),t()}catch(n){M.error((n==null?void 0:n.message)??"Couldn't save")}finally{N(!1)}}},h=(n,$)=>a(O=>O&&{...O,[n]:$});return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] opacity-70",style:{color:b},children:"Your profile"}),e.jsx("h2",{className:"mt-1.5 text-2xl font-semibold leading-tight",style:{fontFamily:x},children:"Keep your contact details up to date"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"To protect your information, we'll send a short code to your email before showing or changing these."})]}),g==="locked"&&e.jsxs("div",{className:"rounded-xl border bg-card p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Qe,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"font-medium",children:"Hidden for your security"})]}),e.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsxs("div",{children:["Email: ",e.jsx("span",{className:"font-mono",children:m.email_masked??"â"})]}),e.jsxs("div",{children:["Phone: ",e.jsx("span",{className:"font-mono",children:m.phone_masked??"â"})]})]}),e.jsx(k,{onClick:f,disabled:j,className:"w-full",style:{background:b,color:"#fff"},children:j?e.jsx(z,{className:"h-4 w-4 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(Ze,{className:"h-4 w-4 mr-2"})," Email me a code to unlock"]})})]}),g==="code-sent"&&e.jsxs("div",{className:"rounded-xl border bg-card p-4 space-y-3",children:[e.jsxs("p",{className:"text-sm",children:["We sent a 6-digit code to ",e.jsx("span",{className:"font-medium",children:T}),". Enter it below to continue."]}),e.jsx(A,{value:C,onChange:n=>y(n.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"â¢â¢â¢â¢â¢â¢",inputMode:"numeric",className:"text-center text-2xl tracking-[10px] font-mono",autoFocus:!0}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k,{variant:"ghost",size:"sm",onClick:f,disabled:j,children:"Resend"}),e.jsx(k,{onClick:R,disabled:j||C.length!==6,className:"flex-1",style:{background:b,color:"#fff"},children:j?e.jsx(z,{className:"h-4 w-4 animate-spin"}):"Verify"})]})]}),g==="unlocked"&&_&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-emerald-700 dark:text-emerald-400",children:[e.jsx(es,{className:"h-4 w-4"})," Verified â edits are open for the next 30 minutes"]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(B,{className:"text-xs",children:"First name"}),e.jsx(A,{value:_.first_name??"",onChange:n=>h("first_name",n.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(B,{className:"text-xs",children:"Last name"}),e.jsx(A,{value:_.last_name??"",onChange:n=>h("last_name",n.target.value)})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(B,{className:"text-xs",children:"Email"}),e.jsx(A,{type:"email",value:_.email??"",onChange:n=>h("email",n.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(B,{className:"text-xs",children:"Phone"}),e.jsx(A,{value:_.phone??"",onChange:n=>h("phone",n.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(B,{className:"text-xs",children:"Current address"}),e.jsx(A,{value:_.current_address??"",onChange:n=>h("current_address",n.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(B,{className:"text-xs",children:"Postcode"}),e.jsx(A,{value:_.current_postcode??"",onChange:n=>h("current_postcode",n.target.value)})]}),e.jsx(k,{onClick:l,disabled:j,className:"w-full",style:{background:b,color:"#fff"},children:j?e.jsx(z,{className:"h-4 w-4 animate-spin"}):"Save changes"})]})]})}const ws="https://nohyebjnythqmwatmkoa.supabase.co",U="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im5vaHllYmpueXRocW13YXRta29hIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzU0MjExMTksImV4cCI6MjA5MDk5NzExOX0.h7LKol0bac-u64FkHMgOMNd7nhyIKkanqpItYfX0d8U",D=`${ws}/functions/v1/applicant-public`;function re(s){return s==null?"POA":new Intl.NumberFormat("en-GB",{style:"currency",currency:"GBP",maximumFractionDigits:0}).format(s)}function _e(s){const r=s.trim().toLowerCase();return r.includes("suitable homes")&&r.includes("no viewing yet")?"stalled-price-range":r.includes("mortgage conversation")&&r.includes("firm up your budget")?"mortgage-conversation":r}function Ss(){var fe;const{token:s}=ss(),[r,c]=ts(),[w,m]=d.useState(!0),[b,x]=d.useState(null),[t,g]=d.useState(null),[o,j]=d.use
10State([]),[N,T]=d.useState(0),[q,C]=d.useState(!1),[y,S]=d.useState(!1),[P,_]=d.useState(!1),{appearance:a,loading:u}=os(),f=ls(a),R="'Fraunces', Georgia, serif",l="'Inter', system-ui, -apple-system, sans-serif",h=a.background_color,n=d.useCallback(async()=>{var i;m(!0),x(null);try{const p=await fetch(`${D}?action=match&token=${encodeURIComponent(s??"")}`,{headers:{apikey:U}}),v=await p.json();if(!p.ok){x(v.error??"Unable to load matches"),m(!1);return}g(v.applicant),j(v.matches??[]),T(((i=v.activity)==null?void 0:i.viewings_requested_count)??0)}catch(p){x((p==null?void 0:p.message)??"Network error")}finally{m(!1)}},[s]);d.useEffect(()=>{n()},[n]),d.useEffect(()=>{var Y,ge;if(!t)return;const i=s?`applicant-wizard-seen:${s}`:null,p=i?localStorage.getItem(i)==="1":!1,v=!!r.get("refine"),F=(((Y=t.qualification_questions)==null?void 0:Y.length)??0)>0,Q=(((ge=t.qualification_answers)==null?void 0:ge.length)??0)>0,I=!!t.mortgage_status||!!t.property_to_sell_status;v||!p&&(F&&!Q||!I)?(S(!0),i&&localStorage.setItem(i,"1")):i&&!p&&localStorage.setItem(i,"1")},[t,r]);const $=()=>{if(S(!1),_(!1),r.get("refine")){const i=new URLSearchParams(r);i.delete("refine"),c(i,{replace:!0})}},O=async i=>{const p=await fetch(`${D}?action=submit-answers&token=${encodeURIComponent(s??"")}`,{method:"POST",headers:{"Content-Type":"application/json",apikey:U},body:JSON.stringify(i)}),v=await p.json();if(!p.ok)throw new Error(v.error??"Failed to save answers");M.success("Thanks â we've tuned your matches"),await n()},H=async i=>{const p=await fetch(`${D}?action=update&token=${encodeURIComponent(s??"")}`,{method:"POST",headers:{"Content-Type":"application/json",apikey:U},body:JSON.stringify(i)}),v=await p.json();if(!p.ok)throw new Error(v.error??"Failed to update");await n()},Ce=d.useMemo(()=>{if(!t)return"";const i=[];return t.search_postcodes.length&&i.push(t.search_postcodes.join(", ")),(t.price_min||t.price_max)&&i.push(`${re(t.price_min)} â ${re(t.price_max)}`),t.bedrooms_min&&i.push(`${t.bedrooms_min}+ beds`),t.property_types.length&&i.push(t.property_types.join(", ")),i.join(" · ")},[t]),le=r.getAll("subject").join("|"),{subjectMatch:ie,grouped:W}=d.useMemo(()=>{const{featured:i,grouped:p}=hs(o,r);return le&&!i&&console.warn("[ApplicantMatchPage] subject property not found in matches; rendering without Featured section",{subjectCandidates:r.getAll("subject")}),{subjectMatch:i,grouped:p}},[o,le]),ee=ds(t==null?void 0:t.mortgage_status,t==null?void 0:t.funding),se=ms(t==null?void 0:t.property_to_sell_status,t==null?void 0:t.buyer_position),ce=d.useMemo(()=>Math.floor(Math.random()*3),[]),J=d.useMemo(()=>{const i=[],p=se==="not_on_market"||se==="on_market",v=ee==="needed"||ee==="unsure";return p&&i.push(e.jsx(Ne,{kind:"valuation",apiUrl:D,apiKey:U,token:s??"",done:!!(t!=null&&t.valuation_self_request_at),brandColor:a.primary_color,headingFont:a.heading_font,onAfterRequest:n,valuationVariant:ce},"valuation")),v&&i.push(e.jsx(Ne,{kind:"mortgage",apiUrl:D,apiKey:U,token:s??"",done:!!(t!=null&&t.mortgage_referral_requested_at),brandColor:a.primary_color,headingFont:a.heading_font,onAfterRequest:n},"mortgage")),i},[ee,se,t==null?void 0:t.valuation_self_request_at,t==null?void 0:t.mortgage_referral_requested_at,s,a.primary_color,a.heading_font,n,ce]),Se=!!(t!=null&&t.mortgage_status||t!=null&&t.property_to_sell_status||(((fe=t==null?void 0:t.qualification_answers)==null?void 0:fe.length)??0)>0),de=d.useMemo(()=>{var p;const i=new Set;for(const v of(t==null?void 0:t.qualification_answers)??[])(p=v.question)!=null&&p.trim()&&i.add(_e(v.question));return i},[t]),me=d.useMemo(()=>{const i=I=>de.has(_e(I)),p=((t==null?void 0:t.qualification_questions)??[]).filter(I=>
10!i(I));if(!t)return p;const v=[];if((t.created_at?(Date.now()-new Date(t.created_at).getTime())/864e5:0)>=7&&o.length>=8&&N===0){const I="We've shown you several suitable homes but no viewing yet â is your price range still right, or would stretching it slightly open up the right home?";if(i(I)||v.push(I),!t.mortgage_status||t.mortgage_status==="needed"||t.mortgage_status==="unsure"){const Y="Would a quick mortgage conversation help firm up your budget? We can arrange a no-obligation chat.";i(Y)||v.push(Y)}}return[...p,...v].slice(0,5)},[t,de,o.length,N]),ue=!(t!=null&&t.mortgage_status),he=!(t!=null&&t.property_to_sell_status),xe=me.length>0||ue||he;return w||u?e.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-background text-muted-foreground",style:f,children:[e.jsx(z,{className:"h-5 w-5 animate-spin mr-2"})," Loading your matchesâ¦"]}):b||!t?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-6",style:f,children:e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("h1",{className:"text-xl font-semibold mb-2",children:"We couldn't load this page"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:b??"This link may have expired."})]})}):e.jsxs("div",{className:"min-h-screen",style:{...f,background:h,fontFamily:l},children:[e.jsx("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Fraunces:opsz,[email protected],400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap"}),e.jsx("style",{children:` 11 @keyframes amRevealUp { 12 from { opacity: 0; transform: translateY(14px); } 13 to { opacity: 1; transform: translateY(0); } 14 } 15 .am-reveal { animation: amRevealUp 600ms cubic-bezier(0.22,1,0.36,1) both; } 16 .am-card { transition: transform 380ms cubic-bezier(0.22,1,0.36,1), box-shadow 380ms ease, border-color 380ms ease; } 17 .am-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -22px rgba(0,0,0,0.28); } 18 .am-card:hover .am-card-img { transform: scale(1.04); } 19 .am-card-img { transition: transform 700ms cubic-bezier(0.22,1,0.36,1); } 20 @keyframes amShimmer { 21 0% { background-position: -200% 0; } 22 100% { background-position: 200% 0; } 23 } 24 .am-shimmer { 25 background-image: linear-gradient( 26 90deg, 27 rgba(220,38,38,0.00) 0%, 28 rgba(220,38,38,0.18) 50%, 29 rgba(220,38,38,0.00) 100% 30 ); 31 background-size: 200% 100%; 32 background-repeat: no-repeat; 33 animation: amShimmer 2s linear infinite; 34 } 35 `}),e.jsx("div",{className:"w-full",style:{background:"#545454"},children:e.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 h-[76px] sm:h-[92px] flex items-center",children:a.logo_url?e.jsx("img",{src:a.logo_url,alt:"",className:"h-[54px] sm:h-[66px] w-auto object-contain"}):e.jsx("span",{className:"text-cream text-lg font-semibold tracking-wide",style:{fontFamily:R,color:"#f2f2f2"}
35,children:a.hero_title||"Your matches"})})}),e.jsxs("section",{className:"relative isolate overflow-hidden",children:[e.jsxs("div",{className:"absolute inset-0 -z-10",children:[a.background_image_url?e.jsx("img",{src:a.background_image_url,alt:"",className:"h-full w-full object-cover"}):e.jsx("div",{className:"h-full w-full",style:{background:`linear-gradient(135deg, ${a.primary_color} 0%, hsl(0 0% 18%) 100%)`}}),e.jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(115deg, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.55) 45%, rgba(0,0,0,0.35) 100%)"}})]}),e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 pt-16 pb-20 sm:pt-24 sm:pb-28 text-[#f2f2f2]",children:[e.jsxs("p",{className:"am-reveal text-[11px] uppercase tracking-[0.28em] text-[#f2f2f2]/70 mb-5",style:{fontFamily:l},children:[e.jsx(ne,{className:"inline h-3 w-3 mr-2 -mt-0.5"}),"Hi ",t.first_name," · Curated for you"]}),e.jsx("h1",{className:"am-reveal text-4xl sm:text-6xl lg:text-7xl leading-[1.02] font-normal max-w-4xl text-balance",style:{fontFamily:R,letterSpacing:"-0.015em",animationDelay:"80ms"},children:"Your property matches."}),e.jsx("p",{className:"am-reveal mt-6 max-w-2xl text-base sm:text-lg text-[#f2f2f2]/85 leading-relaxed",style:{fontFamily:l,animationDelay:"160ms"},children:a.hero_subtitle||`${o.length} ${o.length===1?"home":"homes"} hand-picked from your search â refined the more you tell us.`}),e.jsx(bs,{criteriaSummary:Ce,primaryColor:a.primary_color,hasUnanswered:xe,hasAnsweredAnything:Se,onEditSearch:()=>C(!0),onRefineMatches:()=>{_(!xe),S(!0)}})]})]}),e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 py-10 sm:py-14 space-y-10 relative",children:[a.watermark_url&&e.jsx("img",{src:a.watermark_url,alt:"",className:"pointer-events-none fixed bottom-6 right-6 max-h-24 max-w-40 object-contain opacity-10"}),e.jsxs("section",{className:"am-reveal space-y-10",style:{animationDelay:"240ms"},children:[e.jsx("div",{className:"flex items-end justify-between gap-4 border-b pb-3",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.18em] opacity-70",style:{color:a.primary_color},children:"The shortlist"}),e.jsxs("h2",{className:"mt-1 text-2xl sm:text-3xl font-semibold tracking-tight",style:{fontFamily:R,color:a.primary_color,fontWeight:500},children:[o.length," ",o.length===1?"property":"properties"," to explore"]})]})}),o.length===0?e.jsx("div",{className:"rounded-2xl border bg-card p-12 text-center text-sm text-muted-foreground",children:"No matching properties at the moment. We'll email you as soon as something new comes in."}):e.jsxs(e.Fragment,{children:[ie&&e.jsx(Z,{title:"From your email",subtitle:"The property we just told you about",items:[ie],accentLabel:"Featured",appearance:a,token:s??"",banners:J}),e.jsx(Z,{title:"New To The Market",subtitle:"Listed in the last 72 hours",items:W.newToMarket,accentLabel:"New",appearance:a,token:s??"",banners:J}),e.jsx(Z,{title:"Price Reductions",subtitle:"Reduced in the last 5 days",items:W.priceReductions,accentLabel:"Reduced",appearance:a,token:s??"",banners:J}),e.jsx(Z,{title:W.newToMarket.length||W.priceReductions.length?"More properties":"Properties",items:W.rest,appearance:a,token:s??"",banners:J})]})]}),e.jsxs("footer",{className:"text-xs opacity-70 text-center pt-6 border-t space-y-1",children:[e.jsxs("div",{children:["Logged in as ",t.email,". This link is personal to you â please don't share it."]}),a.footer_text&&e.jsx("div",{children:a.footer_text})]})]}),y&&e.jsx(fs,{questions:P?t.qualification_questions??[]:me,showMortgageStep:P?!0:ue,showPropertyStep:P?!0:he,firstName:t.first_name,initialMortgage:t.mortgage_status??null,initialProperty:t.property_to_sell_status??null,onClose:$,onSubmit:async i=>{const p=t.qualification_answers??[],v=new Map(p.map(F=>[F.question,F.answer]));for(const F of i.answers)v.set(F.question,F.answer);await O({...i,answers:Array.from(v,([F,Q])=>({question:F,answer:Q}))}),$()},appearance:{primary_color:a.primary_color,heading_font:a.heading_font,logo_url:a.logo_url}}),e.jsx(ys,{open:q,onOpenChange:C,value:{search_postcodes:t.search_postcodes??[],price_min:t.price_min,price_max:t.price_max,bedrooms_min:t.bedrooms_min,property_types:t.property_types??[]},onSave:H,brandColor:a.primary_color,headingFont:a.heading_font,postcodeOptions:Array.from(new Set(o.map(i=>
35(i.postcode??"").toUpperCase().split(" ")[0]).filter(Boolean))),profileSlot:e.jsx(js,{apiUrl:D,apiKey:U,token:s??"",masked:{email_masked:t.email?t.email.replace(/^(.{2}).*(@.*)$/,"$1â¢â¢â¢$2"):null,phone_masked:t.phone?"â¢â¢â¢ â¢â¢â¢ "+String(t.phone).replace(/\D/g,"").slice(-4):null},brandColor:a.primary_color,headingFont:a.heading_font,onSaved:()=>{n()}})})]})}function Z({title:s,subtitle:r,items:c,accentLabel:w,appearance:m,token:b,banners:x}){const t="'Fraunces', Georgia, serif";if(!c.length)return null;const g=6;return e.jsxs("div",{className:"space-y-5",children:[e.jsx("div",{className:"flex items-baseline justify-between gap-3",children:e.jsxs("div",{children:[e.jsxs("h3",{className:"text-xl sm:text-2xl tracking-tight",style:{fontFamily:t,color:m.primary_color,fontWeight:500,letterSpacing:"-0.015em"},children:[s,e.jsxs("span",{className:"ml-2 text-sm font-normal opacity-60",children:["(",c.length,")"]})]}),r&&e.jsx("p",{className:"text-xs opacity-70 mt-0.5",children:r})]})}),e.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-5 sm:gap-6",children:c.flatMap((o,j)=>{const N=e.jsxs(as,{to:`/applicants/match/${b}/property/${o.screen_property_id}`,className:"am-card am-reveal group rounded-2xl border bg-card overflow-hidden flex flex-col shadow-[0_1px_2px_rgba(0,0,0,0.04)] focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",style:{animationDelay:`${Math.min(j*60,360)}ms`,borderColor:`color-mix(in srgb, ${m.primary_color} 12%, transparent)`},children:[e.jsxs("div",{className:"aspect-[4/3] bg-muted overflow-hidden relative",children:[o.main_image_url?e.jsx("img",{src:o.main_image_url,alt:o.display_address??"Property",className:"am-card-img w-full h-full object-cover",loading:"lazy"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:e.jsx(G,{className:"h-10 w-10"})}),e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-24 bg-gradient-to-t from-black/55 to-transparent pointer-events-none"}),w&&e.jsx("span",{className:"absolute top-3 left-3 text-[10px] font-semibold uppercase tracking-[0.12em] px-2.5 py-1 rounded-full shadow-sm",style:{background:m.primary_color,color:"#fff"},children:w}),e.jsx("div",{className:"absolute bottom-3 left-3 text-base font-semibold text-white drop-shadow",style:{fontFamily:t},children:re(o.price)})]}),e.jsxs("div",{className:"p-4 sm:p-5 space-y-3 flex-1 flex flex-col",children:[e.jsx("div",{className:"text-sm font-medium leading-snug line-clamp-2 min-h-[2.5rem]",children:o.display_address??o.postcode??"Address available on request"}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-auto pt-1",children:[o.bedrooms!=null&&e.jsxs(te,{variant:"secondary",className:"gap-1 font-normal",children:[e.jsx(rs,{className:"h-3 w-3"}),o.bedrooms," ",o.bedrooms===1?"bed":"beds"]}),o.property_type&&e.jsx(te,{variant:"secondary",className:"font-normal",children:ns(o.property_type)}),o.postcode&&e.jsxs(te,{variant:"outline",className:"gap-1 font-normal",children:[e.jsx(oe,{className:"h-3 w-3"}),o.postcode]})]})]})]},o.screen_property_id);if(x&&x.length>0&&(j+1)%g===0&&j<c.length-1){const q=Math.floor(j/g)%x.length;return[N,e.jsx("div",{className:"col-span-full",children:x[q]},`banner-${j}`)]}return[N]})})]})}export{Ss as default};
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.