1import{C as no}from"./T4Tu7M-s.js";import{al as U,h as S,a1 as ve,aq as so,o as b,d as y,a4 as e,a6 as f,af as m,ah as _,ai as g,ag as V,a7 as ie,aw as ne,v as C,at as co,a5 as mo,T as d,u as Ge,n as uo,a as Ye,D as W,F as M,e as fo,r as te,Q as bo,b as Re,p as qe,P as Ce,bF as Te,as as Z,ab as E,bz as O,c6 as vo,k as po,a8 as ho,c9 as $e,ca as Le,c8 as go,x as yo,ac as _o,ch as Eo,cw as Fo,t as Co,ae as ko}from"./5RD0fXVg.js";import{_ as F,D as ee}from"./CFD-5_kG.js";/* empty css */import"./B2_xPziN.js";/* empty css */import"./BDhZ2kgM.js";/* empty css */import{D as Bo}from"./Dgw0elqX.js";/* empty css */import{_ as Ee}from"./C2xaIknh.js";import"./C166q3gT.js";/* empty css */import{c as Vo,_ as T,b as wo}from"./D7m5VCOG.js";/* empty css */import{_ as Ne}from"./B2pdFDfd.js";/* empty css */import{_ as J}from"./Dn_SFEXA.js";import{_ as Io}from"./DKdD0fYn.js";import{n as re,o as Fe,p as Ro,q as So,r as Ao,s as Pe,t as De,v as Oo,w as To,x as Ue,y as $o,a as Lo,g as No,z as Po,A as Do,u as Ke,B as Uo,i as Mo,C as Me}from"./D0PonSmI.js";import{u as jo}from"./CJfTB9_3.js";import{u as Se}from"./Bnb-KAtV.js";import{C as je,u as Ho,m as xo,n as fe}from"./CI92FDAo.js";import{a as Qe,c as ke}from"./D48Cu7DX.js";import{C as Be,a as Ve}from"./Dw2_rZYq.js";import{a as He,i as zo,C as we}from"./BbprSG4C.js";import{a as Go}from"./BmpnJxUV.js";import{a as Yo}from"./1ECKNx2P.js";import{F as qo}from"./DE-JHR_U.js";/* empty css */import{_ as Ko}from"./Dp815Kon.js";import{u as Qo}from"./CwxqoFVz.js";import{c as Xo}from"./6F7st_Hq.js";import{u as Jo,O as Wo}from"./B8Py0ixQ.js";import{B as Zo}from"./DG7DAb4i.js";import"./NhdM2h-x.js";import"./CDQqatjk.js";import"./C5xsVr_W.js";import"./B-NN_LcN.js";import"./CxgZ2y2I.js";import"./BRs_K2b4.js";import"./B6EbUxE2.js";import"./DUYRC0FZ.js";import"./QtJKVf-2.js";import"./B7LrmgbO.js";import"./Dm8XgGgx.js";import"./os3bA_PB.js";import"./CwGu6y_Q.js";import"./BhmOm5mM.js";import"./DGx2wkWK.js";import"./DP8uEk1x.js";import"./ZtSIiDn7.js";import"./DECb11-m.js";import"./w6kTIUMn.js";import"./CKcpHLIl.js";import"./Cacir5K5.js";import"./QKyv4D5m.js";import"./CWLsehO3.js";import"./nSzr1-4W.js";import"./DVkareJ2.js";import"./Dkzh7cle.js";import"./D0cgnyFd.js";(function(){try{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{};t["__faroBundleId_ecommerce-website-app"]="2026.10.1-p0937-aramisauto"}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"[email protected]"};var i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="b7412367-8d83-4598-9544-565b2545d2e7",t._sentryDebugIdIdentifier="sentry-dbid-b7412367-8d83-4598-9544-565b2545d2e7")}catch{}})();const er={error:void 0,disabled:!1};function or(t){const i=S(()=>t.options.map(n=>({value:n.value,label:n.label,id:`${t.name}-${n.value}`}))),o=S(()=>t.error!==void 0),l=S(()=>`${t.name}-error`);return U({optionViews:i,hasError:o,errorId:l})}const rr=["aria-describedby"],tr={key:0,class:"ds-radio-group__legend"},lr=["for"],ar=ve({__name:"DsRadioGroup",props:co(mo({options:{},name:{},legend:{},error:{},disabled:{type:Boolean}},er),{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const i=t,o=so(t,"modelValue"),l=or(i);return(n,c)=>(b(),y("fieldset",{class:"ds-radio-group","aria-describedby":e(l).hasError?e(l).errorId:void 0},[t.legend?(b(),y("legend",tr,[f(e(F),{tag:"span",variant:"body",size:"medium",weight:"strong"},{default:m(()=>[_(g(t.legend),1)]),_:1})])):V("",!0),(b(!0),y(ie,null,ne(e(l).optionViews,a=>(b(),y("span",{key:a.value,class:"ds-radio-group__option"},[f(e(Io),{id:a.id,modelValue:o.value,"onUpdate:modelValue":c[0]||(c[0]=R=>o.value=R),value:a.value,name:t.name,error:e(l).hasError,disabled:t.disabled},null,8,["id","modelValue","value","name","error","disabled"]),C("label",{class:"ds-radio-group__option-label",for:a.id}
1,[f(e(F),{tag:"span",variant:"body",size:"medium"},{default:m(()=>[_(g(a.label),1)]),_:2},1024)],8,lr)]))),128)),f(e(Vo),{id:e(l).errorId,class:"ds-radio-group__error",message:t.error},null,8,["id","message"])],8,rr))}}),h={year:d("c2b.vehicle-form.year.label"),month:d("c2b.vehicle-form.month.label"),brand:d("c2b.vehicle-form.brand.label"),model:d("c2b.vehicle-form.model.label"),bodywork:d("c2b.vehicle-form.bodywork.label"),doors:d("c2b.vehicle-form.doors.label"),engine:d("c2b.vehicle-form.engine.label"),fuel:d("c2b.vehicle-form.fuel.label"),gearbox:d("c2b.vehicle-form.gearbox.label"),package:d("c2b.vehicle-form.package.label"),mileage:d("c2b.vehicle-form.mileage.label"),reason:d("c2b.vehicle-form.reason.label"),purchaseProject:d("c2b.vehicle-form.purchase-project.legend")},$={year:d("c2b.vehicle-form.year.placeholder"),month:d("c2b.vehicle-form.month.placeholder"),brand:d("c2b.vehicle-form.brand.placeholder"),model:d("c2b.vehicle-form.model.placeholder"),engine:d("c2b.vehicle-form.engine.placeholder"),fuel:d("c2b.vehicle-form.fuel.placeholder"),package:d("c2b.vehicle-form.package.placeholder"),mileage:d("c2b.vehicle-form.mileage.placeholder"),reason:d("c2b.vehicle-form.reason.placeholder")},ir=d("c2b.vehicle-form.a11y.field-revealed-prefix"),x=d("c2b.vehicle-form.empty-state"),nr=d("c2b.vehicle-form.required-fields-note"),sr=d("c2b.vehicle-form.submit"),cr=d("c2b.vehicle-form.mileage.unit"),dr=d("c2b.vehicle-form.purchase-project.hint"),L=["brand","model","bodywork","doors","fuel","gearbox","engine","package"],mr=["brand","model"],Ie=[...L,"mileage","reason","purchaseProject"],Xe=new Set(["year","month","brand","model"]),xe=Ie.filter(t=>!Xe.has(t)),ur=new Set(["bodywork","doors","fuel","gearbox","engine","package"]),fr={year:d("c2b.vehicle-form.validation.invalid-year"),month:d("c2b.vehicle-form.validation.invalid-month"),brand:d("c2b.vehicle-form.validation.invalid-brand"),model:d("c2b.vehicle-form.validation.invalid-model"),bodywork:d("c2b.vehicle-form.validation.invalid-bodywork"),doors:d("c2b.vehicle-form.validation.invalid-doors"),engine:d("c2b.vehicle-form.validation.invalid-engine"),fuel:d("c2b.vehicle-form.validation.invalid-fuel"),gearbox:d("c2b.vehicle-form.validation.invalid-gearbox"),package:d("c2b.vehicle-form.validation.invalid-package"),mileage:d("c2b.vehicle-form.validation.invalid-mileage"),reason:d("c2b.vehicle-form.validation.invalid-reason"),purchaseProject:d("c2b.vehicle-form.validation.invalid-purchase-project")},Je={year:!0,month:!0,brand:!0,model:!0,bodywork:!0,doors:!0,engine:!0,fuel:!0,gearbox:!0,package:!0,mileage:!0,reason:!0,purchaseProject:!0};function br(t){return Object.hasOwn(Je,t)}function be(t){return{brand:t,model:t,bodywork:t,doors:t,fuel:t,gearbox:t,engine:t,package:t}}
1function vr(){const t=Ge(),i=uo(),o=Se(),l=Ye("c2b"),n=Ho(),c=t.c2bEstimation;if(c===null)throw new Error("c2B vehicle form mounted for a brand that runs no C2B funnel");const a=U({year:"",month:"",brand:"",model:"",bodywork:"",doors:"",engine:"",fuel:"",gearbox:"",package:"",mileage:"",reason:"",purchaseProject:""}),R=(()=>{const r=[];for(let s=new Date().getFullYear();c.earliestReleaseYear<=s;s--)r.push({value:String(s),label:String(s)});return r})(),z=12,se=new Intl.DateTimeFormat(i.id,{month:"long"}),G=Array.from({length:z},(r,s)=>{const p=se.format(new Date(2e3,s,1));return{value:String(s+1),label:p.charAt(0).toLocaleUpperCase(i.id)+p.slice(1)}}),ce=[{value:re.CUSTOMER_TO_BUSINESS,label:o.translate(d("c2b.vehicle-form.reason.customer-to-business"))},{value:re.CUSTOMER_TO_CUSTOMER,label:o.translate(d("c2b.vehicle-form.reason.customer-to-customer"))},{value:re.PURCHASE,label:o.translate(d("c2b.vehicle-form.reason.purchase"))},{value:re.OTHER,label:o.translate(d("c2b.vehicle-form.reason.other-reason"))}],Y=[{value:Fe.TRADE_IN,label:o.translate(d("c2b.vehicle-form.purchase-project.c2b-purchase"))},{value:Fe.C2B_PURCHASE,label:o.translate(d("c2b.vehicle-form.purchase-project.trade-in"))}],pe={value:$o,label:o.translate(d("c2b.vehicle-form.package.none"))},w=U({brand:"",model:""}),A=te([]);function de(r){const s=fe(r);return A.value.find(p=>fe(p.value)===s)}const he=S(()=>{const r=c.featuredVehicleBrands.map(p=>de(p)??{value:p,label:p}),s=new Set(r.map(p=>fe(p.value)));return[...r,...A.value.filter(p=>!s.has(fe(p.value)))]});function me(r,s){return a[r]!==""?[]:s.filter(p=>xo(p.label,w[r]))}const ge=S(()=>me("brand",he.value)),j=U(be([])),ye=S(()=>me("model",j.model));function ue(r,s){w[r]=s,a[r]=""}function q(r,s){w[r]=s.label,a[r]=s.value}function oe(r){w[r]="",a[r]=""}W(A,()=>{if(a.brand==="")return;const r=de(a.brand);r!==void 0&&r.value!==a.brand&&q("brand",r)});const K=U(be(!1)),Q=U(be(!1)),H=be(0),X=S(()=>a.year===""||a.month===""?null:je({year:Ve(Number(a.year)),month:ke(Number(a.month))}));function _e(r,s){switch(r){case"bodywork":return Po(Ue(s));case"fuel":return No(De(s));case"gearbox":return Lo(Pe(s));default:return}}function u(r,s){const p=_e(r,s);return{value:s,label:p===void 0?s:o.translate(p)}}function v(r){const s=r===null?0:L.indexOf(r)+1;return L.slice(s)}function k(r){for(const s of v(r))a[s]="",j[s]=[],Q[s]=!1,K[s]=!1,H[s]++}function eo(r){return L.slice(0,L.indexOf(r)).every(s=>a[s]!=="")}function oo(r){const s={};for(const p of L.slice(0,L.indexOf(r)))s[p]=a[p];return s}const Ae={year:()=>Ve(Number(a.year)),month:()=>ke(Number(a.month)),brand:()=>Be(a.brand),model:()=>Qe(a.model),bodywork:()=>Ue(a.bodywork),doors:()=>To(a.doors),engine:()=>Oo(a.engine),fuel:()=>De(a.fuel),gearbox:()=>Pe(a.gearbox),package:()=>Ao(a.package),mileage:()=>So(Number(a.mileage)),reason:()=>re(a.reason),purchaseProject:()=>Fe(a.purchaseProject)},N=jo({validationKeys:fr,controlFields:Je,controlOf:r=>r,lifts:Ae,fieldValue:r=>a[r]});async function Oe(r){const s=X.value;if(s===null)return;const p=++H[r];K[r]=!0;try{let B;if(r==="brand")B=(await n.listBrands(s)).map(P=>({value:P,label:P}));else if(r==="model"){const I=Be(a.brand);B=(await n.listModels(s,I)).map(D=>({value:D,label:D}))}else{const I=await n.listAttributeValues(r,s,oo(r));B=I.length===0&&r==="package"?[pe]:I.map(P=>u(r,P))}if(p!==H[r])return;if(r==="brand"?A.value=B:j[r]=B,Q[r]=B.length===0,ur.has(r)&&B.length===1){const[I]=B;I!==void 0&&(a[r]=I.value,N.markVisited(r))}}catch(B){l.error(`Failed to list C2B ${r} options`,{error:B}),p===H[r]&&(r==="brand"?A.value=[]:j[r]=[],Q[r]=!0)}finally{p===H[r]&&(K[r]=!1)}}function ro(r){return Xe.has(r)?!0:Ie.slice(0,Ie.indexOf(r)).every(s=>a[s]!=="")}W(X,r=>{k(null),r!==null&&Oe("brand")});for(const r of L.slice(0,-1))W(()=>a[r],()=>{const s=v(r)[0];k(r),s!==void 0&&eo(s)&&Oe(s)});for(const r of mr)W(()=>a[r],(s,p)=>{s!==""?w[r]=s:w[r]===p&&(w[r]="")});W(()=>a.brand,()=>{w.model=""});function to(){try{return Ro.map(Ae)}catch(r){if(!(r instanceof fo)||N.recordRejections(Object.keys(r.errors))===0)throw r;return}}async function lo(r){const{year:s,month:p}=r;if(s===void 0||p===void 0||!R.some(D=>String(s)===D.value))return;const B=je({year:s,month:p});if(a.year=String(s),a.month=String(p),await M(),r.brand===void 0)return;let I;try{I=await n.listBrands(B)}catch(D){l.error("Failed to list C2B brand options for URL prefill",{error:D});return}if(!I.includes(r.brand)||(a.brand=r.brand,await M(),r.model===void 0))return;let P;try{P=await n.listModels(B,r.brand)}catch(D){l.error("Failed to list C2B model options for URL prefill",{error:D});return}P.includes(r.model)&&(a.model=r.model,await M())}async function ao(r){a.year=String(r.year),a.month=String(r.month),await M();
1for(const s of L)a[s]=r[s],await M();a.mileage=String(r.mileage),a.reason=r.reason,a.purchaseProject=r.purchaseProject}function io(r){N.recordRejections(r);for(const s of r)br(s)&&N.markVisited(s)}return U({form:a,query:w,yearOptions:R,monthOptions:G,brandOptions:ge,modelOptions:ye,typeQuery:ue,pickOption:q,clearQuery:oe,optionsByAttribute:j,isLoadingByAttribute:K,isEmptyByAttribute:Q,reasonOptions:ce,purchaseProjectOptions:Y,isVisible:ro,fieldError:N.fieldError,markVisited:N.markVisited,controlledFields:N.controlledFields,buildVehicle:to,clearRejections:N.clearRejections,applyUrlPrefill:lo,restoreFromVehicle:ao,restoreRejections:io})}const pr=["year","month","brand","model"];function We(t,i){const o={};for(const l of i){const n=t[l];typeof n=="string"&&n!==""&&(o[l]=n)}return bo(o)}function le(t,i){const o=t[i];return o!==void 0&&!Array.isArray(o)?o:void 0}function ae(t,i){if(i!==void 0)try{return t(i)}catch{return}}function hr(t){const i=We(t,pr);return Do({year:ae(o=>Ve(Number(o)),le(i,"year")),month:ae(o=>ke(Number(o)),le(i,"month")),brand:ae(o=>Be(o),le(i,"brand")),model:ae(o=>Qe(o),le(i,"model"))})}function gr(t){return t.year!==void 0||t.month!==void 0||t.brand!==void 0||t.model!==void 0}function Ze(t){const i=le(We(t,[He]),He);return ae(o=>Go(o),i)}const yr=/\B(?=(?:\d{3})+(?!\d))/g,_r=/\D/g,Er=6;function Fr(t){return t.replace(yr," ")}function Cr(t){return t.map(i=>({id:i.value,label:i.label,value:i.value}))}function ze(t){return{label:t.label,value:t.value}}function kr({entryContext:t}){const i=vr(),o=Se(),l=Ke(),{redirectToPage:n}=Re(),c=qe(),a=te(!0);function R(){a.value=!1}function z(){const u=l.takeRejectedFields();u!==void 0&&i.restoreRejections([...u])}async function se(u){try{await i.restoreFromVehicle(u),z()}finally{R()}}const G=hr(c.query);if(gr(G)){const u=l.vehicle(),v=l.urlEntry(),k=v!==void 0&&Uo(v,G);u!==void 0&&k?se(u):(l.clear(),l.saveUrlEntry(G),i.applyUrlPrefill(G).finally(R))}else{const u=l.vehicle();u!==void 0?se(u):(z(),R())}const ce=Ze(c.query);ce!==void 0&&l.saveContextData(ce),t!==void 0&&!zo(t)&&l.saveEntryContext(t),t?.customerId===void 0&&l.clearCustomerId();const Y=new Map;function pe(u){return v=>{if(v===null){Y.delete(u);return}Y.set(u,v)}}function w(u){const v=Y.get(u),k=v instanceof Element?v.querySelector("input, button, [tabindex]"):null;return k instanceof HTMLElement?k:void 0}function A(u){w(u)?.focus({preventScroll:!0})}function de(u){const v=i.controlledFields.slice(i.controlledFields.indexOf(u)+1).find(k=>i.isVisible(k)&&w(k)!==void 0);v!==void 0&&A(v)}const he=S(()=>i.brandOptions.map(ze)),me=S(()=>i.modelOptions.map(ze));async function ge(u,v){i.pickOption(u,{value:String(v.value),label:v.label}),await M(),de(u)}function j(u,v){i.form[u]=v,i.markVisited(u)}function ye(u){const v=Y.get(u);if(!(v instanceof Element))return;const k=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth";v.scrollIntoView?.({behavior:k,block:"start"})}const ue=te(""),q=new Set;W(()=>xe.map(u=>i.isVisible(u)),async()=>{for(const u of xe){const v=i.isVisible(u);v&&!q.has(u)?(q.add(u),ue.value=`${o.translate(ir)} ${o.translate(h[u])}`,await M(),A(u),a.value||ye(u)):v||q.delete(u)}});const oe=te(!1),K=S({get:()=>oe.value?i.form.mileage:Fr(i.form.mileage),set:u=>{i.form.mileage=u.replace(_r,"").slice(0,Er)}});function Q(){oe.value=!0}function H(){oe.value=!1,i.markVisited("mileage")}const X=te(!1);async function _e(){if(X.value)return;for(const v of i.controlledFields)i.markVisited(v);const u=i.buildVehicle();if(u===void 0){const v=i.controlledFields.find(k=>i.fieldError(k)!==void 0);await M(),v!==void 0&&A(v);return}X.value=!0,l.saveVehicle(u),await n(l.customerId()!==void 0?Ce.C2B_LOADING:Ce.C2B_DETAILS,{})}return U({vehicleForm:i,announcement:ue,setFieldRef:pe,onSubmit:_e,isLeaving:X,mileageDisplay:K,onMileageFocus:Q,onMileageBlur:H,toSelectItems:Cr,brandAutocompleteOptions:he,modelAutocompleteOptions:me,pickAutocompleteOption:ge,pickChoice:j})}const Br={class:"c2b-vehicle-form__fields"},Vr={class:"c2b-vehicle-form__year-month"},wr={class:"c2b-vehicle-form__legend"},Ir={key:1,class:"c2b-vehicle-form__choice-cards"},Rr={class:"c2b-vehicle-form__legend"},Sr={key:1,class:"c2b-vehicle-form__choice-cards"},Ar={class:"c2b-vehicle-form__legend"},Or={key:1,class:"c2b-vehicle-form__choice-cards"},Tr={class:"c2b-vehicle-form__required-note"},$r={class:"c2b-vehicle-form__announcement","aria-live":"polite",role:"status"},Lr=ve({__name:"C2BVehicleForm",props:{entryContext:{}},setup(t){const o=kr({entryContext:t.entryContext});return(l,n)=>(b(),y("form",{class:"c2b-vehicle-form",onSubmit:n[22]||(n[22]=vo((...c)=>e(o).onSubmit&&e(o).onSubmit(...c),["prevent"]))},[C("div",Br,[C("div",Vr,[C("div",{ref:e(o).setFieldRef("year"),class:"c2b-vehicle-form__field"},[f(e(T),{label:l.$ts(e(h).year),error:e(o).vehicleForm.fieldError("year")},{default:m(({ariaInvalid:c})=>[f(e(J),{name:"year",items:e(o).toSelectItems(e(o).vehicleForm.yearOptions),"aria-label":l.$ts(e(h).year),placeholder:l.$ts(e($).year),error:c,"model-value":e(o).vehicleForm.form.year,"onUpdate:modelValue":n[0]||(n[0]=a=>e(o).vehicleForm.form.year=a??""),onSelect:n[1]||(n[1]=a=>e(o).vehicleForm.markVisited("year"))},null,8,["items","aria-label","placeholder","error","model-value"])]),_:1},8,["label","error"])],512),C("div",{ref:e(o).setFieldRef("month"),class:"c2b-vehicle-form__field"},[f(e(T),{label:l.$ts(e(h).month),error:e(o).vehicleForm.fieldError("month")},{default:m(({ariaInvalid:c})=>[f(e(J),{name:"month",items:e(o).toSelectItems(e(o).vehicleForm.monthOptions),"aria-label":l.$ts(e(h).month),placeholder:l.$ts(e($).month),error:c,"model-value":e(o).vehicleForm.form.month,"onUpdate:modelValue":n[2]||(n[2]=a=>e(o).vehicleForm.form.month=a??""),onSelect:n[3]||(n[3]=a=>e(o).vehicleForm.markVisited("month"))},null,8,["items","aria-label","placeholder","error","model-value"])]),_:1},8,["label","error"])],512)]),C("div",{ref:e(o).setFieldRef("brand"),class:"c2b-vehicle-form__field"},[f(e(T),{label:l.$ts(e(h).brand),error:e(o).vehicleForm.fieldError("brand")},{default:m(()=>[f(e(Ne),{name:"brand",value:e(o).vehicleForm.query.brand,options:e(o).brandAutocompleteOptions,"aria-label":l.$ts(e(h).brand),placeholder:l.$ts(e($).brand),onInput:n[4]||(n[4]=c=>e(o).vehicleForm.typeQuery("brand",c)),onSelect:n[5]||(n[5]=c=>e(o).pickAutocompleteOption("brand",c)),onClear:n[6]||(n[6]=c=>e(o).vehicleForm.clearQuery("brand")),onBlur:n[7]||(n[7]=c=>e(o).vehicleForm.markVisited("brand"))},Te({_:2},[e(o).vehicleForm.isLoadingByAttribute.brand&&e(o).vehicleForm.brandOptions.length===0?{name:"actions",fn:m(()=>
1[f(e(ee),{icon:e(Z).GENERIC_SPINNER,size:"small",class:"c2b-vehicle-form__spinner"},null,8,["icon"])]),key:"0"}:void 0]),1032,["value","options","aria-label","placeholder"])]),_:1},8,["label","error"])],512),C("div",{ref:e(o).setFieldRef("model"),class:"c2b-vehicle-form__field"},[f(e(T),{label:l.$ts(e(h).model),error:e(o).vehicleForm.fieldError("model")},{default:m(()=>[e(o).vehicleForm.isEmptyByAttribute.model?(b(),E(e(F),{key:0,tag:"span",variant:"body",size:"small"},{default:m(()=>[_(g(l.$ts(e(x))),1)]),_:1})):(b(),E(e(Ne),{key:1,name:"model",value:e(o).vehicleForm.query.model,options:e(o).modelAutocompleteOptions,"aria-label":l.$ts(e(h).model),placeholder:l.$ts(e($).model),onInput:n[8]||(n[8]=c=>e(o).vehicleForm.typeQuery("model",c)),onSelect:n[9]||(n[9]=c=>e(o).pickAutocompleteOption("model",c)),onClear:n[10]||(n[10]=c=>e(o).vehicleForm.clearQuery("model")),onBlur:n[11]||(n[11]=c=>e(o).vehicleForm.markVisited("model"))},Te({_:2},[e(o).vehicleForm.isLoadingByAttribute.model?{name:"actions",fn:m(()=>[f(e(ee),{icon:e(Z).GENERIC_SPINNER,size:"small",class:"c2b-vehicle-form__spinner"},null,8,["icon"])]),key:"0"}:void 0]),1032,["value","options","aria-label","placeholder"]))]),_:1},8,["label","error"])],512),f(O,{name:"c2b-vehicle-form-field"},{default:m(()=>[e(o).vehicleForm.isVisible("bodywork")?(b(),y("fieldset",{key:0,ref:e(o).setFieldRef("bodywork"),class:"c2b-vehicle-form__field c2b-vehicle-form__choice-group"},[C("legend",wr,[f(e(F),{tag:"span",variant:"body",size:"medium",weight:"strong"},{default:m(()=>[_(g(l.$ts(e(h).bodywork)),1)]),_:1}),e(o).vehicleForm.isLoadingByAttribute.bodywork?(b(),E(e(ee),{key:0,icon:e(Z).GENERIC_SPINNER,size:"small",class:"c2b-vehicle-form__spinner"},null,8,["icon"])):V("",!0)]),e(o).vehicleForm.isEmptyByAttribute.bodywork?(b(),E(e(F),{key:0,tag:"span",variant:"body",size:"small"},{default:m(()=>[_(g(l.$ts(e(x))),1)]),_:1})):(b(),y("div",Ir,[(b(!0),y(ie,null,ne(e(o).vehicleForm.optionsByAttribute.bodywork,c=>(b(),E(e(Ee),{key:c.value,selected:e(o).vehicleForm.form.bodywork===c.value,"onUpdate:selected":a=>a&&e(o).pickChoice("bodywork",c.value)},{default:m(()=>[_(g(c.label),1)]),_:2},1032,["selected","onUpdate:selected"]))),128))]))],512)):V("",!0)]),_:1}),f(O,{name:"c2b-vehicle-form-field"},{default:m(()=>[e(o).vehicleForm.isVisible("doors")?(b(),y("fieldset",{key:0,ref:e(o).setFieldRef("doors"),class:"c2b-vehicle-form__field c2b-vehicle-form__choice-group"},[C("legend",Rr,[f(e(F),{tag:"span",variant:"body",size:"medium",weight:"strong"},{default:m(()=>[_(g(l.$ts(e(h).doors)),1)]),_:1}),e(o).vehicleForm.isLoadingByAttribute.doors?(b(),E(e(ee),{key:0,icon:e(Z).GENERIC_SPINNER,size:"small",class:"c2b-vehicle-form__spinner"},null,8,["icon"])):V("",!0)]),e(o).vehicleForm.isEmptyByAttribute.doors?(b(),E(e(F),{key:0,tag:"span",variant:"body",size:"small"},{default:m(()=>[_(g(l.$ts(e(x))),1)]),_:1})):(b(),y("div",Sr,[(b(!0),y(ie,null,ne(e(o).vehicleForm.optionsByAttribute.doors,c=>(b(),E(e(Ee),{key:c.value,selected:e(o).vehicleForm.form.doors===c.value,"onUpdate:selected":a=>a&&e(o).pickChoice("doors",c.value)},{default:m(()=>[_(g(c.label),1)]),_:2},1032,["selected","onUpdate:selected"]))),128))]))],512)):V("",!0)]),_:1}),f(O,{name:"c2b-vehicle-form-field"},{default:m(()=>[e(o).vehicleForm.isVisible("fuel")?(b(),y("div",{key:0,ref:e(o).setFieldRef("fuel"),class:"c2b-vehicle-form__field"},[f(e(T),{label:l.$ts(e(h).fuel),error:e(o).vehicleForm.fieldError("fuel")},{default:m(({ariaInvalid:c})=>[e(o).vehicleForm.isEmptyByAttribute.fuel?(b(),E(e(F),{key:0,tag:"span",variant:"body",size:"small"},{default:m(()=>[_(g(l.$ts(e(x))),1)]),_:1})):(b(),E(e(J),{key:1,name:"fuel",items:e(o).toSelectItems(e(o).vehicleForm.optionsByAttribute.fuel),"aria-label":l.$ts(e(h).fuel),placeholder:l.$ts(e($).fuel),error:c,"is-loading":e(o).vehicleForm.isLoadingByAttribute.fuel,"model-value":e(o).vehicleForm.form.fuel,"onUpdate:modelValue":n[12]||(n[12]=a=>e(o).vehicleForm.form.fuel=a??""),onSelect:n[13]||(n[13]=a=>e(o).vehicleForm.markVisited("fuel"))},null,8,["items","aria-label","placeholder","error","is-loading","model-value"]))]),_:1},8,["label","error"])],512)):V("",!0)]),_:1}),f(O,{name:"c2b-vehicle-form-field"},{default:m(()=>[e(o).vehicleForm.isVisible("gearbox")?(b(),y("fieldset",{key:0,ref:e(o).setFieldRef("gearbox"),class:"c2b-vehicle-form__field c2b-vehicle-form__choice-group"}
1,[C("legend",Ar,[f(e(F),{tag:"span",variant:"body",size:"medium",weight:"strong"},{default:m(()=>[_(g(l.$ts(e(h).gearbox)),1)]),_:1}),e(o).vehicleForm.isLoadingByAttribute.gearbox?(b(),E(e(ee),{key:0,icon:e(Z).GENERIC_SPINNER,size:"small",class:"c2b-vehicle-form__spinner"},null,8,["icon"])):V("",!0)]),e(o).vehicleForm.isEmptyByAttribute.gearbox?(b(),E(e(F),{key:0,tag:"span",variant:"body",size:"small"},{default:m(()=>[_(g(l.$ts(e(x))),1)]),_:1})):(b(),y("div",Or,[(b(!0),y(ie,null,ne(e(o).vehicleForm.optionsByAttribute.gearbox,c=>(b(),E(e(Ee),{key:c.value,selected:e(o).vehicleForm.form.gearbox===c.value,"onUpdate:selected":a=>a&&e(o).pickChoice("gearbox",c.value)},{default:m(()=>[_(g(c.label),1)]),_:2},1032,["selected","onUpdate:selected"]))),128))]))],512)):V("",!0)]),_:1}),f(O,{name:"c2b-vehicle-form-field"},{default:m(()=>[e(o).vehicleForm.isVisible("engine")?(b(),y("div",{key:0,ref:e(o).setFieldRef("engine"),class:"c2b-vehicle-form__field"},[f(e(T),{label:l.$ts(e(h).engine),error:e(o).vehicleForm.fieldError("engine")},{default:m(({ariaInvalid:c})=>[e(o).vehicleForm.isEmptyByAttribute.engine?(b(),E(e(F),{key:0,tag:"span",variant:"body",size:"small"},{default:m(()=>[_(g(l.$ts(e(x))),1)]),_:1})):(b(),E(e(J),{key:1,name:"engine",items:e(o).toSelectItems(e(o).vehicleForm.optionsByAttribute.engine),"aria-label":l.$ts(e(h).engine),placeholder:l.$ts(e($).engine),error:c,"is-loading":e(o).vehicleForm.isLoadingByAttribute.engine,"model-value":e(o).vehicleForm.form.engine,"onUpdate:modelValue":n[14]||(n[14]=a=>e(o).vehicleForm.form.engine=a??""),onSelect:n[15]||(n[15]=a=>e(o).vehicleForm.markVisited("engine"))},null,8,["items","aria-label","placeholder","error","is-loading","model-value"]))]),_:1},8,["label","error"])],512)):V("",!0)]),_:1}),f(O,{name:"c2b-vehicle-form-field"},{default:m(()=>[e(o).vehicleForm.isVisible("package")?(b(),y("div",{key:0,ref:e(o).setFieldRef("package"),class:"c2b-vehicle-form__field"},[f(e(T),{label:l.$ts(e(h).package),error:e(o).vehicleForm.fieldError("package")},{default:m(({ariaInvalid:c})=>[e(o).vehicleForm.isEmptyByAttribute.package?(b(),E(e(F),{key:0,tag:"span",variant:"body",size:"small"},{default:m(()=>[_(g(l.$ts(e(x))),1)]),_:1})):(b(),E(e(J),{key:1,name:"package",items:e(o).toSelectItems(e(o).vehicleForm.optionsByAttribute.package),"aria-label":l.$ts(e(h).package),placeholder:l.$ts(e($).package),error:c,"is-loading":e(o).vehicleForm.isLoadingByAttribute.package,"model-value":e(o).vehicleForm.form.package,"onUpdate:modelValue":n[16]||(n[16]=a=>e(o).vehicleForm.form.package=a??""),onSelect:n[17]||(n[17]=a=>e(o).vehicleForm.markVisited("package"))},null,8,["items","aria-label","placeholder","error","is-loading","model-value"]))]),_:1},8,["label","error"])],512)):V("",!0)]),_:1}),f(O,{name:"c2b-vehicle-form-field"},{default:m(()=>[e(o).vehicleForm.isVisible("mileage")?(b(),y("div",{key:0,ref:e(o).setFieldRef("mileage"),class:"c2b-vehicle-form__field"},[f(e(T),{label:l.$ts(e(h).mileage),error:e(o).vehicleForm.fieldError("mileage")},{default:m(({inputId:c,ariaDescribedby:a,ariaInvalid:R})=>[f(e(wo),{id:c,value:e(o).mileageDisplay,"onUpdate:value":n[18]||(n[18]=z=>e(o).mileageDisplay=z),name:"mileage",type:"text",inputmode:"numeric",placeholder:l.$ts(e($).mileage),"aria-describedby":a,error:R,onFocus:e(o).onMileageFocus,onBlur:e(o).onMileageBlur},{suffix:m(()=>[_(g(l.$ts(e(cr))),1)]),_:1},8,["id","value","placeholder","aria-describedby","error","onFocus","onBlur"])]),_:1},8,["label","error"])],512)):V("",!0)]),_:1}),f(O,{name:"c2b-vehicle-form-field"},{default:m(()=>[e(o).vehicleForm.isVisible("reason")?(b(),y("div",{key:0,ref:e(o).setFieldRef("reason"),class:"c2b-vehicle-form__field"},[f(e(T),{label:l.$ts(e(h).reason),error:e(o).vehicleForm.fieldError("reason")},{default:m(({ariaInvalid:c})=>[f(e(J),{name:"reason",items:e(o).toSelectItems(e(o).vehicleForm.reasonOptions),"aria-label":l.$ts(e(h).reason),placeholder:l.$ts(e($).reason),error:c,"model-value":e(o).vehicleForm.form.reason,"onUpdate:modelValue":n[19]||(n[19]=a=>e(o).vehicleForm.form.reason=a??""),onSelect:n[20]||(n[20]=a=>e(o).vehicleForm.markVisited("reason"))},null,8,["items","aria-label","placeholder","error","model-value"])]),_:1},8,["label","error"])],512)):V("",!0)]),_:1}),f(O,{name:"c2b-vehicle-form-field"},{default:m(()=>[e(o).vehicleForm.isVisible("purchaseProject")?(b(),y("div",{key:0,ref:e(o).setFieldRef("purchaseProject"),class:"c2b-vehicle-form__field c2b-vehicle-form__purchase-project"},[f(e(F),{id:"c2b-vehicle-form-purchase-project-legend",tag:"span",variant:"body",
1size:"medium",weight:"strong"},{default:m(()=>[_(g(l.$ts(e(h).purchaseProject)),1)]),_:1}),f(e(F),{class:"c2b-vehicle-form__purchase-project-hint",tag:"span",variant:"body",size:"small"},{default:m(()=>[_(g(l.$ts(e(dr))),1)]),_:1}),f(e(ar),{name:"purchase-project",options:e(o).vehicleForm.purchaseProjectOptions.map(c=>({value:c.value,label:c.label})),error:e(o).vehicleForm.fieldError("purchaseProject"),"aria-labelledby":"c2b-vehicle-form-purchase-project-legend","model-value":e(o).vehicleForm.form.purchaseProject,"onUpdate:modelValue":n[21]||(n[21]=c=>e(o).pickChoice("purchaseProject",c??""))},null,8,["options","error","model-value"])],512)):V("",!0)]),_:1})]),C("p",Tr,[f(e(F),{tag:"span",variant:"body",size:"small"},{default:m(()=>[_(g(l.$ts(e(nr))),1)]),_:1})]),f(e(Bo),{type:"submit",class:"c2b-vehicle-form__submit",label:l.$ts(e(sr)),"is-disabled":e(o).isLeaving},null,8,["label","is-disabled"]),C("p",$r,g(e(o).announcement),1)],32))}}),Nr=Object.assign(Lr,{__name:"C2BVehicleForm"});function Pr(){const{track:t}=Jo(),{getMetaForCurrentRoute:i}=Re(),o=Ke();po(()=>{const l={event:Me.START,env_template:"C2B",page_name:i()?.tracking?.page_name,...Mo(o.previousJourney())};t({type:Wo.UI.HIT,name:Me.START,context:{dataLayer:l}})})}function Dr(){const t=Se(),{navigateToPage:i}=Re();Pr();const o=Qo({query:{}});ho(()=>({link:[{id:"i18n-can",rel:"canonical",href:o.value}],meta:[{id:"i18n-og-url",property:"og:url",content:o.value}]}));const l=t.translate(d("c2b.vehicle-form.title")),n=t.translate(d("c2b.vehicle-form.subtitle"));function c(){i(Ce.C2B_LANDING,{})}return{title:l,subtitle:n,steps:Xo(t),currentStep:0,backLabel:t.translate(d("common.back")),goBack:c,documentsIcon:Z.GENERIC_LIGHTBULB,documentsHeading:t.translate(d("c2b.vehicle-form.documents.title")),documentItems:[t.translate(d("c2b.vehicle-form.documents.licence")),t.translate(d("c2b.vehicle-form.documents.registration")),t.translate(d("c2b.vehicle-form.documents.insurance"))],seoMeta:{[$e.TITLE]:Le(l),[$e.DESCRIPTION]:Le(n)}}}const Ur={class:"c2b-vehicle-form-view__documents"},Mr={class:"c2b-vehicle-form-view__documents-icon","aria-hidden":"true"},jr={class:"c2b-vehicle-form-view__documents-list"},Hr=ve({__name:"C2BVehicleFormView",props:{entryContext:{}},setup(t){const i=t,o=Dr();return go(o.seoMeta),(l,n)=>(b(),E(e(qo),{class:"c2b-vehicle-form-view",title:e(o).title,subtitle:e(o).subtitle,"is-contact-raised":e(yo)(!0)},{stepper:m(()=>[f(e(Ko),{steps:e(o).steps,"current-step":e(o).currentStep,"back-label":e(o).backLabel,onBack:e(o).goBack},null,8,["steps","current-step","back-label","onBack"])]),panel:m(()=>[C("div",Ur,[C("span",Mr,[f(e(ee),{icon:e(o).documentsIcon},null,8,["icon"])]),f(e(F),{tag:"p",variant:"heading",size:"small",class:"c2b-vehicle-form-view__documents-heading"},{default:m(()=>[_(g(e(o).documentsHeading),1)]),_:1}),C("ul",jr,[(b(!0),y(ie,null,ne(e(o).documentItems,c=>(b(),y("li",{key:c},[f(e(F),{tag:"span",variant:"body",size:"small"},{default:m(()=>[_(g(c),1)]),_:2},1024)]))),128))])])]),contact:m(()=>[f(e(Yo),_o(Eo(e(no))),null,16)]),default:m(()=>[f(e(Nr),{"entry-context":i.entryContext},null,8,["entry-context"])]),_:1},8,["title","subtitle","is-contact-raised"]))}}),xr=Object.assign(Hr,{__name:"C2BVehicleFormView"});function zr(t){return we.fromUnknown(t)}const Gr=Zo("/wsa/api/c2b/entry-context");function Yr(){const t=Ye("c2b");return{async resolve(i){const{data:o,error:l}=await Fo(Gr,{key:`c2b-entry-context-${i}`,query:{contextData:i}},"$WtYGO512Gg");return qr(o.value,l.value,t)}}}function qr(t,i,o){if(i!=null)return o.warn("c2b entry context unavailable, the funnel runs without one",{error:i}),we({});try{return zr(t)}catch(l){return o.warn("c2b entry context unreadable, the funnel runs without one",{error:l}),we({})}}const rl=ve({__name:"c2b-funnel",async setup(t){let i,o;if(Ge().c2bEstimation===null)throw Co({statusCode:404,statusMessage:"Brand runs no C2B funnel"});const l=Ze(qe().query),n=l===void 0?void 0:([i,o]=ko(()=>Yr().resolve(l)),i=await i,o(),i);return(c,a)=>(b(),E(e(xr),{"entry-context":e(n)},null,8,["entry-context"]))}});export{rl 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.