1import{v as X,r as y,j as e,cO as J,$ as ee,z as se,C,dy as te,cx as re,bP as ae,B as ne,a as ie,aQ as le,dW as oe,dX as ce,S as de,L as g,bf as me,o as ue,e as xe,b7 as he,aU as fe,A as pe,l as ge,m as je,n as be,dY as V,dZ as B,f as I,c as Ne,G as ye,Z as _,d_ as F,d2 as ve,d3 as $,aH as ke,F as P}from"./index-DWGp9uR9.js";import{u as we}from"./useSuspenseQuery-BCu3jXOx.js";import{S as Ce}from"./SiteFooter-CMjatFcu.js";import{C as b}from"./card-C_1WMBZC.js";import{e as Me}from"./PremiumPage-SjAU8iBG.js";import{c as G,M as Se,g as Oe,e as Te,a as De,D as ze}from"./fuel-cost.functions-Dhk217We.js";import{s as Ee}from"./mot-reminders.functions-1QeIDk2p.js";import{M as Ae}from"./mail-check-D4t56kiZ.js";import{W as Le}from"./WorthTheDrive-CcyXzyCl.js";import{A as Re}from"./arrow-left-CdVc8CVy.js";import{C as E}from"./chevron-right-DT4ofP0X.js";import{T as A}from"./triangle-alert--cO1fdyU.js";import{T as Fe}from"./trending-up-BDjGGYjJ.js";import{E as $e}from"./external-link-DQGVeCAk.js";import{C as S}from"./circle-x-CnJdeekS.js";import{C as M}from"./circle-question-mark-DRNbv5fu.js";import{C as Z}from"./coins-DuiX0q14.js";import"./lock-DqX08OuW.js";import"./shield-DVkFFmQ5.js";import"./useMutation-CuJPIMDS.js";import"./slider-B2nWlkG6.js";import"./index-BdQq_4o_.js";import"./RegPlateInput-CLSR4cNg.js";import"./circle-minus-BjxxdLeg.js";const Pe=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]],Ue=X("shield-x",Pe);var Ve=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Be=Ve.reduce((s,t)=>{const r=J(`Primitive.${t}`),a=y.forwardRef((l,n)=>{const{asChild:o,...c}=l,m=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(m,{...c,ref:n})});return a.displayName=`Primitive.${t}`,{...s,[t]:a}},{}),Ie="Separator",U="horizontal",_e=["horizontal","vertical"],q=y.forwardRef((s,t)=>{const{decorative:r,orientation:a=U,...l}=s,n=Ge(a)?a:U,c=r?{role:"none"}:{"aria-orientation":n==="vertical"?n:void 0,role:"separator"};return e.jsx(Be.div,{"data-orientation":n,...c,...l,ref:t})});q.displayName=Ie;function Ge(s){return _e.includes(s)}var H=q;const W=y.forwardRef(({className:s,orientation:t="horizontal",decorative:r=!0,...a},l)=>e.jsx(H,{ref:l,decorative:r,orientation:t,className:ee("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",s),...a}));W.displayName=H.displayName;const Ze="Email me MOT reminders + car deals & offers from Motoring Today. Unsubscribe anytime.",qe=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function He({vrm:s,motExpiry:t,make:r,model:a}){const l=se(Ee),[n,o]=y.useState(""),[c,m]=y.useState(!1),[u,j]=y.useState({kind:"idle"}),N=qe.test(n.trim())&&c&&u.kind!=="submitting";async function O(){if(N){j({kind:"submitting"}),le("mot_reminder");try{const d=await l({data:{vrm:s,email:n.trim(),motExpiry:t,make:r,model:a,consent:!0}});d.ok?j({kind:"done",status:d.status}):d.reason==="suppressed"?j({kind:"error",message:"This address previously unsubscribed. Email [email protected] if you'd like to receive reminders again."}):j({kind:"error",message:"Something went wrong. Please try again."})}catch{j({kind:"error",message:"Something went wrong. Please try again."})}}}return u.kind==="done"?e.jsx(b,{className:"p-5",children:e.jsxs("div",{className:"flex items-start gap-3",children:[u.status==="pending_confirm"?e.jsx(Ae,{className:"mt-0.5 size-5 text-primary"}):e.jsx(C,{className:"mt-0.5 size-5 text-primary"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold",children:u.status==="pending_confirm"?"Check your inbox":"You're all set"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:u.status==="pending_confirm"?"We've emailed you a link â click it to confirm your MOT reminders.":"You're already signed up for MOT reminders for this car."})]})]})}):e.jsxs(b,{className:"p-5",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold",children:[e.jsx(te,{className:"size-4 text-primary"})," Never miss your MOT"]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t?"Get a free reminder before your MOT is due â plus the latest car deals & offers.":"Get free MOT reminders â plus the latest car deals & offers."}),e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsx(re,{type:"email",inputMode:"email",autoComplete:"email",placeholder:"[email protected]",value:n,onChange:d=>o(d.target.value),"aria-label":"Email address"}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-2.5 text-xs leading-relaxed text-muted-foreground",children:[e.jsx(ae,{checked:c,onCheckedChange:d=>m(d===!0),className:"mt-0.5","aria-label":"Email me MOT reminders and car deals and offers"}),e.jsx("span",{children:Ze})]}),u.kind==="error"?e.jsx("p",{className:"text-xs text-destructive",children:u.message}):null,e.jsx(ne,{type:"button",onClick:O,disabled:!N,className:"w-full",children:u.kind==="submitting"?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"mr-2 size-4 animate-spin"})," Setting upâ¦"]}):"Email me reminders"}),e.jsxs("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:["Motor Genius Group Ltd (Motoring Today) is the data controller. We'll use your email to send MOT reminders and related car deals and offers, on the basis of your consent, until you unsubscribe. See our"," ",e.jsx("a",{href:"/privacy",className:"underline",children:"Privacy Policy"})," ","for your rights."]})]})]})}function Fs(){const{slug:s}=oe.useParams(),{data:t}=we(ce(s));if(!t||!t.ok)return null;const r=t.vehicle?.dvla?.data??null,a=t.vehicle?.mot?.vehicle??null,l=t.vehicle?.sales?.entries??[],n=a?.motTests??[],o=t.meta?.make??r?.make??null,c=t.meta?.model??a?.model??null,u=[t.meta?.year??r?.yearOfManufacture??null,o,c].filter(
1Boolean).join(" ")||t.vrm,j=[r?.colour,r?.fuelType,r?.engineCapacity?`${Number(r.engineCapacity).toLocaleString()} cc`:null].filter(Boolean).join(" · "),v=p(r?.monthOfFirstRegistration),N=n.filter(i=>i.testResult==="PASSED").length,O=n.filter(i=>i.testResult==="FAILED").length,d=n.map(i=>({ms:Date.parse(i.completedDate??""),value:is(i),unit:i.odometerUnit??"mi",t:i})).filter(i=>Number.isFinite(i.ms)&&i.value!=null).sort((i,h)=>i.ms-h.ms),k=d.length?d[d.length-1]:null,L=k?.unit??"mi",T=n.reduce((i,h)=>i+(h.defects??[]).filter(Q=>(Q.type??"").toUpperCase()==="ADVISORY").length,0),D=cs(d.map(i=>i.value)),Y=a?.hasOutstandingRecall,R=os(Y),K=R==="yes";return e.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[e.jsx(de,{}),e.jsxs("main",{className:"mesh-page flex-1",children:[e.jsx("div",{className:"mx-auto w-full max-w-5xl px-4 pt-6",children:e.jsxs(g,{to:"/motor-history",className:"inline-flex min-h-11 items-center text-[13px] text-muted-foreground transition-colors hover:text-foreground",children:[e.jsx(Re,{className:"mr-1 size-4"})," Check another vehicle"]})}),e.jsx("div",{className:"mx-auto mt-3 w-full max-w-5xl px-4",children:e.jsx("div",{className:"relative overflow-hidden rounded-3xl p-6 text-foreground-inverse shadow-overlay sm:p-9",style:{background:Me},children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-6",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10.5px] font-semibold uppercase tracking-[0.22em] text-primary",children:"Free vehicle check · DVLA + DVSA"}),e.jsx("h1",{className:"mt-3 font-brand text-[clamp(1.9rem,4.6vw,3.1rem)] font-light leading-[1.06] tracking-tight text-foreground-inverse",children:u}),(j||v)&&e.jsx("p",{className:"mt-2 text-sm leading-relaxed text-foreground-inverse/70",children:[j,v?`First registered ${v}`:null].filter(Boolean).join(" · ")}),e.jsxs("div",{className:"mt-5 flex flex-wrap gap-2",children:[e.jsx(Xe,{status:r?.motStatus,expiry:r?.motExpiryDate}),e.jsx(Je,{dvla:r}),e.jsx(es,{dvla:r}),e.jsx(ss,{recall:R})]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx(Qe,{vrm:t.vrm}),e.jsxs(g,{to:"/motor-history",className:"mt-3 inline-flex min-h-11 items-center gap-1.5 rounded-full border border-foreground-inverse/25 px-4 py-2 text-[12.5px] font-medium text-foreground-inverse/90 transition hover:bg-foreground-inverse/10",children:["Check another reg ",e.jsx(E,{className:"size-3.5"})]})]})]})})}),e.jsx("div",{className:"mx-auto mt-5 w-full max-w-5xl px-4",children:e.jsxs("div",{className:"grid gap-3 lg:grid-cols-[minmax(0,300px)_minmax(0,1fr)]",children:[e.jsx("div",{className:"glass-vitals flex flex-col items-center justify-center rounded-3xl px-5 py-6 text-center",children:n.length?e.jsxs(e.Fragment,{children:[e.jsx(me,{value:N/n.length*100,label:"MOT pass rate",size:192}),e.jsxs("p",{className:"mt-3 text-[13px] text-muted-foreground",children:[e.jsx("b",{className:"font-semibold text-foreground tabular-nums",children:`${N} / ${n.length}`})," ",`test${n.length===1?"":"s"} on record`]})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-[0.2em] text-muted-foreground",children:"MOT pass rate"}),e.jsx("span",{className:"mt-2 block font-brand text-4xl font-light leading-none tracking-tight text-foreground",children:"â"}),e.jsx("p",{className:"mt-2 text-[11.5px] text-muted-foreground",children:"no tests yet"})]})}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[e.jsx(z,{tone:"default",label:"Latest mileage",value:k?`${k.value.toLocaleString()} ${L}`:"â",sub:k?`last MOT · ${p(k.t.completedDate)??""}`:"no reading on file"}),e.jsx(z,{tone:T>0?"warn":"good",label:"Advisories ever",value:String(T),sub:T>0?"across all MOT tests":"none recorded"}),e.jsx(z,{tone:D.tone,label:"Mileage pattern",value:D.label,sub:D.sub})]})]})}),e.jsxs("div",{className:"mx-auto grid w-full max-w-5xl gap-6 px-4 py-8 lg:grid-cols-3",children:[e.jsxs("section",{className:"space-y-6 lg:col-span-2",children:[K&&e.jsxs("div",{className:"flex items-start gap-3 rounded-2xl border border-warning/50 bg-warning-soft p-4 text-warning-ink",children:[e.jsx(A,{className:"mt-0.5 size-5 shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-semibold",children:"Outstanding safety recall"}),e.jsxs("p",{className:"mt-0.5",children:["DVSA records show this vehicle has an unresolved manufacturer recall. Recall repairs are free â check the details at"," ",e.jsx("a",{href:"https://www.gov.uk/check-vehicle-recall",target:"_blank",rel:"noopener noreferrer",className:"font-medium underline",children:"gov.uk/check-vehicle-recall"})," ","or with a franchised dealer before you drive."]})]})]}),e.jsx(ds,{dvla:r}),G(r?.fuelType)!=="electric"&&e.jsx(Le,{vrm:t.vrm}),e.jsxs(b,{className:"rounded-3xl p-6 shadow-card sm:p-7",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("h2",{className:"flex items-center gap-2.5 font-brand text-[1.45rem] font-light tracking-tight text-foreground",children:[e.jsx("span",{className:"grid size-9 shrink-0 place-items-center rounded-xl border border-border bg-surface-sunken",children:e.jsx(ue,{className:"size-4 text-primary"})}),"MOT history"]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(xe,{tone:"good",className:"shrink-0",children:[e.jsx(he,{className:"size-3"})," DVSA verified"]})})]}),e.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[n.length," test",n.length===1?"":"s"," · ",N," pass · ",O," fail"]}),n.length===0?e.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"No MOT tests on file yet."}):e.jsxs(e.Fragment,{children:[e.jsx(ts,{tests:n}),e.jsx("ol",{className:"mt-5 space-y-3",children:n.slice(0,25).map((i,h)=>e.jsx(rs,{t:i},h))})]})]}),d.length>=2&&e.jsxs(b,{className:"rounded-3xl p-6 shadow-card sm:p-7",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("h2",{className:"flex items-center gap-2.5 font-brand text-[1.45rem] font-light tracking-tight text-foreground",children:[e.jsx("span",{className:"grid size-9 shrink-0 place-items-center rounded-xl border border-border bg-surface-sunken",children:e.jsx(Fe,{className:"size-4 text-primary"})}),"Mileage over time"]}),e.jsxs("span",{className:"text-[10px] font-medium uppercase tracking-[0.16em] text-muted-foreground",children:["recorded at each MOT (",L,")"]})]}),e.jsx(ns,{readings:d})]}),e.jsx(Se,{vrm:t.vrm}),e.jsxs(b,{className:"rounded-3xl p-6 shadow-card sm:p-7",children:[e.jsxs("h2",{className:"flex items-center gap-2.5 font-brand text-[1.45rem] font-light tracking-tight text-foreground",children:[e.jsx("span",{className:"grid size-9 shrink-0 place-items-center rounded-xl border border-border bg-surface-sunken",children:e.jsx(fe,{className:"size-4 text-primary"})}),"Sales history"]}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Every dealer that has advertised this vehicle, with asking prices and time on the market."}),l.length===0?e.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"No previous dealer listings on record."}):e.jsx("ol",{className:"mt-5 space-y-3",children:l.map((i,h)=>e.jsxs("li",{className:"rounded-2xl border border-border/60 p-4 transition-colors hover:bg-surface-sunken",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[e.jsx("div",{className:"font-medium",children:i.sellerName??"Unknown dealer"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:[i.city,i.zip].filter(
1Boolean).join(" · ")})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-4 text-sm text-muted-foreground",children:[e.jsxs("span",{children:[p(i.startedAt)," â ",i.endedAt?p(i.endedAt):"currently listed"]}),i.daysListed!==null&&e.jsxs("span",{children:[i.daysListed," days"]}),i.lastPrice!==null&&e.jsxs("span",{children:["£",i.lastPrice.toLocaleString(),i.priceDelta?` (${i.priceDelta>0?"+":""}£${Math.abs(i.priceDelta).toLocaleString()})`:""]}),i.lastMiles!==null&&e.jsxs("span",{children:[i.lastMiles.toLocaleString()," mi"]})]}),i.vdpUrl&&e.jsxs("a",{href:i.vdpUrl,target:"_blank",rel:"noopener noreferrer",className:"mt-2 inline-flex items-center text-xs text-primary hover:underline",children:["Original listing ",e.jsx($e,{className:"ml-1 size-3"})]})]},h))})]}),e.jsxs("section",{"aria-labelledby":"mot-faq-heading",children:[e.jsx("h2",{id:"mot-faq-heading",className:"font-brand text-[1.45rem] font-light tracking-tight text-foreground",children:"MOT & history check FAQs"}),e.jsx("div",{className:"mt-4 rounded-3xl border border-border/70 bg-card p-2 shadow-card sm:p-3",children:e.jsx(pe,{type:"single",collapsible:!0,children:Ke.map((i,h)=>e.jsxs(ge,{value:`faq-${h}`,className:"border-border/60 px-3",children:[e.jsx(je,{className:"text-left text-[15px] font-semibold",children:i.q}),e.jsx(be,{className:"text-sm leading-relaxed text-muted-foreground",children:i.a})]},h))})})]})]}),e.jsxs("aside",{className:"space-y-4",children:[e.jsxs(b,{className:"rounded-3xl p-5 shadow-card sm:p-6",children:[e.jsx("h3",{className:"text-[10px] font-semibold uppercase tracking-[0.2em] text-muted-foreground",children:"DVLA record"}),e.jsxs("dl",{className:"mt-2 divide-y divide-border/60 text-sm",children:[e.jsx(f,{k:"Make",v:r?.make}),e.jsx(f,{k:"Year",v:r?.yearOfManufacture}),e.jsx(f,{k:"Fuel",v:r?.fuelType}),e.jsx(f,{k:"Colour",v:r?.colour}),e.jsx(f,{k:"COâ",v:r?.co2Emissions?`${r.co2Emissions} g/km`:null}),e.jsx(f,{k:"Engine",v:r?.engineCapacity?`${r.engineCapacity}cc`:null}),e.jsx(f,{k:"First reg.",v}),e.jsx(f,{k:"Tax due",v:p(r?.taxDueDate)}),e.jsx(f,{k:"MOT expiry",v:p(r?.motExpiryDate)}),e.jsx(f,{k:"Euro status",v:r?.euroStatus})]}),r?.markedForExport&&e.jsxs("p",{className:"mt-3 inline-flex items-center gap-2 rounded-md bg-destructive/10 px-2 py-1 text-xs text-destructive",children:[e.jsx(Ue,{className:"size-3.5"})," Marked for export"]})]}),e.jsx(He,{vrm:t.vrm,motExpiry:r?.motExpiryDate??null,make:o,model:c}),e.jsxs(b,{className:"rounded-3xl p-5 shadow-card sm:p-6",children:[e.jsx("h3",{className:"font-brand text-xl font-light tracking-tight text-foreground",children:"Looking to buy?"}),e.jsxs("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:["Browse used ",o??"cars"," with finance up front."]}),e.jsx(W,{className:"my-3"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(g,{to:"/used-cars",className:"text-sm text-primary hover:underline",children:"All used cars â"}),e.jsx(g,{to:"/finance-guides/pcp",className:"text-sm text-primary hover:underline",children:"Understand PCP finance â"}),e.jsx(g,{to:"/clean-air-zones",className:"text-sm text-primary hover:underline",children:"Clean Air Zone rules â"})]})]})]})]}),e.jsx(Ye,{make:o,model:c})]}),e.jsx(Ce,{})]})}function We(s){return s.replace(/[A-Za-z][A-Za-z0-9]*/g,t=>t!==t.toUpperCase()||t.length<=3?t:t[0]+t.slice(1).toLowerCase())}function Ye({make:s,model:t}){const{data:r}=_({queryKey:["vehicle-similar",s,t],enabled:!!s,staleTime:3e5,queryFn:async()=>{const c={page:1,pageSize:3},m=await F({data:t?{...c,makes:[s],models:[t]}:{...c,makes:[s]}});return m.listings.length>0?{rows:m.listings,modelMatched:!!t}:t?{rows:(await F({data:{...c,makes:[s]}})).listings,modelMatched:!1}:{rows:[],modelMatched:!1}}}),a=r?.rows??[];if(!s||a.length===0)return null;const l=r?.modelMatched??!1,n=We([s,l?t:null].filter(Boolean).join(" ")),o=a[0];return e.jsxs("section",{"aria-labelledby":"similar-cars-heading",className:"mx-auto w-full max-w-5xl px-4 pb-12",children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10.5px] font-semibold uppercase tracking-[0.2em] text-primary",children:"Like this car?"}),e.jsxs("h2",{id:"similar-cars-heading",className:"mt-1.5 font-brand text-[1.45rem] font-light tracking-tight text-foreground",children:["Similar ",n," for sale"]})]}),l?e.jsxs(g,{to:"/used-cars/$make/$model",params:{make:$(o),model:ve(o)},className:"inline-flex items-center gap-1 rounded-full border border-border px-3.5 py-1.5 text-[12.5px] font-semibold text-foreground transition hover:border-primary/40 hover:text-primary",children:["See all ",e.jsx(E,{className:"size-3.5"})]}):e.jsxs(g,{to:"/used-cars/$make",params:{make:$(o)},className:"inline-flex items-center gap-1 rounded-full border border-border px-3.5 py-1.5 text-[12.5px] font-semibold text-foreground transition hover:border-primary/40 hover:text-primary",children:["See all ",e.jsx(E,{className:"size-3.5"})]})]}),e.jsx("div",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:a.map(c=>e.jsx(ke,{car:c},c.id))})]})}const Ke=[{q:"Is this vehicle check really free?",a:"Yes â the MOT history, DVLA tax and MOT status, and previous dealer listings shown here are free, with no sign-up. We make money when you go on to buy or finance a car through our approved dealers."},{q:"How fresh is this data?",a:"MOT results come directly from the DVSA MOT History service and the DVLA vehicle details from the Vehicle Enquiry Service, read when you check the plate. Always confirm the current status at gov.uk before relying on it."},{q:"Does this replace a paid history check?",a:"It covers MOT history, tax and MOT status, recalls, mileage at each test and previous dealer listings. For finance-outstanding, stolen or write-off markers, use a dedicated provenance check."}];function Qe({vrm:s}){return e.jsxs("span",{className:"inline-flex h-14 items-stretch overflow-hidden rounded-lg border-2",style:{borderColor:"oklch(0.72 0.15 92)",boxShadow:"0 8px 28px -6px oklch(0.72 0.15 92 / 0.55)"},children:[e.jsx("span",{className:"grid w-10 place-items-center text-[0.62rem] font-extrabold",style:{background:"oklch(0.35 0.12 260)",color:"oklch(0.95 0.09 100)"},children:"UK"}),e.jsx("b",{className:"grid place-items-center px-5 font-display text-2xl font-extrabold tracking-[0.12em]",style:{background:"oklch(0.88 0.16 95)",color:"oklch(0.2 0 0)"},children:s})]})}
1function x({tone:s,icon:t,children:r}){const a=s==="good"?"bg-success-soft text-success-ink":s==="bad"?"bg-danger-soft text-danger-ink":s==="warn"?"bg-warning-soft text-warning-ink":"bg-info-soft text-info-ink";return e.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-bold ${a}`,children:[t,r]})}function Xe({status:s,expiry:t}){const r=(s??"").toLowerCase(),a=t?Date.parse(t):NaN,l=Number.isFinite(a)?a<Date.now():r.includes("no")||r.includes("expired");return(r.includes("valid")||r==="taxed"||Number.isFinite(a)&&!l)&&t?e.jsxs(x,{tone:"good",icon:e.jsx(C,{className:"size-3.5"}),children:["MOT until ",p(t)]}):l?e.jsxs(x,{tone:"bad",icon:e.jsx(S,{className:"size-3.5"}),children:["MOT expired",t?` ${p(t)}`:""]}):e.jsx(x,{tone:"info",icon:e.jsx(M,{className:"size-3.5"}),children:"MOT status unknown"})}function Je({dvla:s}){const t=s?.taxStatus??null,r=(t??"").toLowerCase();if(!t)return e.jsx(x,{tone:"info",icon:e.jsx(M,{className:"size-3.5"}),children:"Tax status unknown"});const a=r.includes("tax")&&!r.includes("untax"),l=typeof s?.co2Emissions=="number"?s.co2Emissions:null,n=V({co2:l,fuel:s?.fuelType??null,regDate:s?.monthOfFirstRegistration??null,year:typeof s?.yearOfManufacture=="number"?s.yearOfManufacture:null});return e.jsxs(x,{tone:a?"info":"warn",icon:a?e.jsx(Z,{className:"size-3.5"}):e.jsx(A,{className:"size-3.5"}),children:[t,a&&n.annualGbp!=null?` · £${n.annualGbp}/yr`:""]})}function es({dvla:s}){const t=B(null,s?.fuelType??null,s?.euroStatus??null,s?.monthOfFirstRegistration??null);return t===!0?e.jsx(x,{tone:"good",icon:e.jsx(I,{className:"size-3.5"}),children:"ULEZ compliant"}):t===!1?e.jsx(x,{tone:"bad",icon:e.jsx(S,{className:"size-3.5"}),children:"ULEZ charge applies"}):e.jsx(x,{tone:"info",icon:e.jsx(M,{className:"size-3.5"}),children:"ULEZ can't confirm"})}function ss({recall:s}){return s==="yes"?e.jsx(x,{tone:"warn",icon:e.jsx(A,{className:"size-3.5"}),children:"Outstanding recall"}):s==="no"?e.jsx(x,{tone:"good",icon:e.jsx(C,{className:"size-3.5"}),children:"No outstanding recalls"}):e.jsx(x,{tone:"info",icon:e.jsx(M,{className:"size-3.5"}),children:"Recall status unknown"})}function z({tone:s="default",label:t,value:r,sub:a}){const l=s==="good"?"text-success-ink":s==="warn"?"text-warning-ink":s==="bad"?"text-danger-ink":"text-foreground";return e.jsxs("div",{className:"flex min-w-0 flex-col justify-center rounded-2xl border border-border bg-card p-4 shadow-card sm:p-5",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:t}),e.jsx("div",{className:`mt-2 font-serif text-[1.7rem] font-light leading-none tracking-tight tabular-nums ${l}`,children:r}),a&&e.jsx("div",{className:"mt-1.5 text-[11.5px] text-muted-foreground",children:a})]})}function ts({tests:s}){const t=[...s].slice(0,25).sort((r,a)=>Date.parse(r.completedDate??"")-Date.parse(a.completedDate??""));return t.length<2?null:e.jsx("div",{className:"mt-4 flex overflow-hidden rounded-full",role:"img","aria-label":"MOT results, oldest to newest",children:t.map((r,a)=>{const l=r.testResult==="FAILED",n=(r.defects??[]).some(m=>(m.type??"").toUpperCase()==="ADVISORY"),o=l?"bg-danger":n?"bg-warning":"bg-success",c=l?"Fail":n?"Pass with advisories":"Pass";return e.jsx("span",{className:`h-2 flex-1 ${o}`,title:`${c}${r.completedDate?` · ${p(r.completedDate)}`:""}`},a)})})}function rs({t:s}){const t=s.testResult==="PASSED",r=s.defects??[];return e.jsxs("li",{className:`rounded-2xl border p-4 transition-colors ${t?"border-border/60 hover:bg-surface-sunken":"border-destructive/30 bg-destructive/[0.03]"}`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[t?e.jsx(C,{className:"size-4 text-success-ink"}):e.jsx(S,{className:"size-4 text-destructive"}),t?"Pass":"Fail",e.jsxs("span",{className:"font-normal text-muted-foreground",children:["· ",p(s.completedDate)]})]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx(ye,{className:"size-3.5"}
1)," ",s.odometerValue?`${Number(s.odometerValue).toLocaleString()} ${s.odometerUnit??""}`:"â"]})]}),!!r.length&&e.jsx("ul",{className:"mt-3 space-y-1.5 text-sm text-muted-foreground",children:r.slice(0,8).map((a,l)=>e.jsxs("li",{className:"flex gap-2",children:[e.jsx(as,{type:a.type,dangerous:a.dangerous}),e.jsx("span",{children:a.text})]},l))})]})}function as({type:s,dangerous:t}){const r=(s??"").toUpperCase(),a=t||r==="DANGEROUS",l=a?"border-destructive/40 bg-destructive/10 text-destructive":r==="MAJOR"||r==="FAIL"?"border-destructive/30 bg-destructive/5 text-destructive":r==="MINOR"?"border-warning/50 bg-warning-soft text-warning-ink":"border-border bg-muted/40 text-muted-foreground",n=a?"Dangerous":r?r.charAt(0)+r.slice(1).toLowerCase():"Advisory";return e.jsx("span",{className:`inline-flex shrink-0 items-center rounded-md border px-1.5 py-0.5 text-[11px] font-semibold ${l}`,children:n})}function ns({readings:s}){const t=Math.max(...s.map(r=>r.value),1);return e.jsx("div",{className:"mt-4 flex items-end gap-2",style:{height:"9rem"},children:s.map((r,a)=>{const l=Math.max(6,Math.round(r.value/t*100)),n=Number.isFinite(r.ms)?new Date(r.ms).getFullYear():"";return e.jsxs("div",{className:"flex flex-1 flex-col items-center justify-end gap-1.5",style:{height:"100%"},children:[e.jsx("span",{className:"text-[0.68rem] font-semibold text-foreground",children:ls(r.value)}),e.jsx("span",{className:"w-full max-w-[3.2rem] rounded-t-md bg-brand-gradient",style:{height:`${l}%`},title:`${r.value.toLocaleString()} ${r.unit}`}),e.jsx("span",{className:"text-[0.66rem] text-muted-foreground",children:n})]},a)})})}function is(s){if(!s.odometerValue)return null;const t=Number(String(s.odometerValue).replace(/[^\d.]/g,""));return Number.isFinite(t)&&t>0?t:null}function ls(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function os(s){const t=(s??"").trim().toLowerCase();return/^(yes|true|1)$/.test(t)?"yes":/^(no|false|0)$/.test(t)?"no":"unknown"}function cs(s){if(s.length<2)return{tone:"default",label:"Not enough data",sub:"needs ⥠2 MOT readings"};for(let t=1;t<s.length;t++)if(s[t]<s[t-1])return{tone:"warn",label:"Check history",sub:"a reading decreased"};return{tone:"good",label:"Consistent",sub:"no odometer drops"}}function f({k:s,v:t}){return t==null||t===""?null:e.jsxs("div",{className:"flex justify-between gap-3 py-2",children:[e.jsx("dt",{className:"text-muted-foreground",children:s}),e.jsx("dd",{className:"font-medium text-right tabular-nums",children:t})]})}function p(s){if(!s)return null;const t=Date.parse(s);return Number.isFinite(t)?new Date(t).toLocaleDateString("en-GB",{year:"numeric",month:"short",day:"numeric"}):s}function w({icon:s,title:t,value:r,sub:a,tone:l="default",children:n}){const o=l==="good"?"text-success-ink":l==="bad"?"text-danger-ink":l==="warn"?"text-warning-ink":"text-foreground";return e.jsxs(b,{className:"rounded-2xl p-5 shadow-card",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:[s,e.jsx("span",{children:t})]}),e.jsx("div",{className:`mt-2.5 font-serif text-[1.9rem] font-light leading-none tracking-tight tabular-nums ${o}`,children:r}),a&&e.jsx("p",{className:"mt-2 text-xs leading-relaxed text-muted-foreground",children:a}),n]})}function ds({dvla:s}){if(!s)return null;const t=typeof s.co2Emissions=="number"?s.co2Emissions:null,r=s.fuelType??null,a=s.monthOfFirstRegistration??null,l=typeof s.yearOfManufacture=="number"?s.yearOfManufacture:null,n=s.euroStatus??null,o=V({co2:t,fuel:r,regDate:a,year:l}),c=B(null,r,n,a),m=t!=null||!!n||!!s.realDrivingEmissions;return e.jsxs("section",{"aria-labelledby":"cost-compliance-heading",className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-x-3 gap-y-1",children:[e.jsx("h2",{id:"cost-compliance-heading",className:"font-brand text-[1.45rem] font-light tracking-tight text-foreground",children:"Running costs & Clean Air Zone"}),e.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.16em] text-muted-foreground",children:"Estimates from the free DVLA record"})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(w,{icon:e.jsx(Z,{className:"size-4"}),title:"Road tax (VED)",value:o.annualGbp!=null?`£${o.annualGbp}/yr`:"Not on record",sub:o.annualGbp!=null?e.jsxs(e.Fragment,{children:[o.band,". Annual rate for the current keeper (2026/27). Cars with a list price over £40,000 when new may pay an added supplement in years 2â6."]}):e.jsx(e.Fragment,{children:"COâ isn't on the DVLA record for this vehicle, so we can't show its tax band."})}),e.jsx(ms,{dvla:s}),e.jsx(w,{icon:e.jsx(I,{className:"size-4"}
1),title:"ULEZ / Clean Air Zone",tone:c===!0?"good":c===!1?"bad":"warn",value:c===!0?e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(C,{className:"size-5"})," Compliant"]}):c===!1?e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(S,{className:"size-5"})," Would be charged"]}):e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(M,{className:"size-5"})," Can't confirm"]}),sub:c===!0?"Meets London ULEZ emissions standards â no daily charge there.":c===!1?"Doesn't meet London ULEZ standards â a daily charge would apply.":"Not enough emissions data on record to confirm the ULEZ position.",children:e.jsxs("div",{className:"mt-3 flex flex-col gap-1.5 text-sm",children:[e.jsx(g,{to:"/ulez-checker",className:"text-primary hover:underline",children:"Check every UK Clean Air Zone â"}),e.jsx(g,{to:"/clean-air-zones",className:"text-primary hover:underline",children:"Clean Air Zone rules & charges â"})]})}),m&&e.jsx(w,{icon:e.jsx(Ne,{className:"size-4"}),title:"Emissions",value:t!=null?`${t} g/km COâ`:n||"â",sub:e.jsxs(e.Fragment,{children:[t!=null&&n?`${n}. `:"",s.realDrivingEmissions?`Real Driving Emissions: ${s.realDrivingEmissions}. `:"","Tailpipe COâ and the Euro emissions standard from the DVLA record."]})})]})]})}function ms({dvla:s}){const{data:t}=_({queryKey:["fuel-prices"],queryFn:()=>Oe(),staleTime:36e5}),r=s.fuelType??null,a=G(r),l=typeof s.engineCapacity=="number"?s.engineCapacity:null,n=a==="electric"?null:Te(r,l);if(!t)return e.jsx(w,{icon:e.jsx(P,{className:"size-4"}),title:"Running cost (fuel)",value:"â¦",sub:"Loading today's fuel prices."});const o=De({mpg:n,fuel:r,prices:t,annualMiles:ze});if(!o)return null;const c=o.annualFuelCost.toLocaleString("en-GB"),m=Math.round(o.costPerMilePence*10)/10,u=o.fuelKind==="electric";return e.jsx(w,{icon:e.jsx(P,{className:"size-4"}),title:"Running cost (fuel)",value:`~£${c}/yr`,sub:e.jsxs(e.Fragment,{children:["About ",m,"p/mile at ",o.annualMiles.toLocaleString("en-GB")," miles/yr."," ",u?e.jsxs(e.Fragment,{children:["Home-charging estimate at a typical electricity tariff (~",o.milesPerKwh," miles/kWh)."]}):e.jsx(e.Fragment,{children:"Estimated from engine size at today's average pump price â an actual test drive will vary."})," ","Source: DESNZ (OGL v3.0)."]})})}export{Fs as component};
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.