1import qe from"./DMudY3sF.js";import Be from"./eddRTplw.js";import Ae from"./DuduP3TS.js";import He from"./DcMUOD7Z.js";import De from"./CpoeCVZH.js";import{u as Ue}from"./DUmbAXpd.js";import{g as je,h as ze,r as Qe,s as Ye,d as Ze,u as Ge,c as We,e as Je,o as be,a0 as Xe,M as et,A as tt,m as ot,a1 as st,F as it,_ as at}from"./CJbEmYD_.js";import{d as lt,as as nt,ak as rt,e as q,k as g,o as ut,w as dt,a8 as n,a9 as u,aa as r,ab as h,u as i,f as C,G as ke,ah as x,ag as ge,F as M,aw as R,ac as N,ae as B,b as ct,n as we,E as A,am as pt,an as vt}from"./BYIl8Myl.js";import{S as yt,a as mt}from"./Bfrku9Ic.js";import{B as z,b as ht}from"./C1WEQQTf.js";import"./BZmLzdjG.js";import"./B5DD-VZF.js";import"./B6xwUs71.js";import"./CZXRPoR8.js";import"./C4ftu5dF.js";const _t=` 2 title 3 filter 4 deliveryDateTag 5 noResultContent { 6 value 7 links { 8 __typename 9 ... on NavigationRecord { 10 name 11 id 12 link { 13 __typename 14 } 15 query 16 } 17 ... on LinkRecord { 18 name 19 id 20 url 21 } 22 } 23 } 24 emptyBackground { 25 ${Qe} 26 } 27 clear 28 showResults 29 orderNow 30 sort { 31 label 32 priceHighLow 33 priceLowHigh 34 cancel 35 confirm 36 } 37`,ft=` 38 copyright { 39 text 40 backgroundColor { 41 hex 42 } 43 fontColor { 44 hex 45 } 46 links { 47 __typename 48 ... on NavigationRecord { 49 name 50 link { 51 __typename 52 } 53 query 54 } 55 ... on LinkRecord { 56 name 57 url 58 } 59 } 60 showYear 61 } 62`,bt=je({name:"inventory",fragments:[ze],append:[_t,ft,"_locales"]}),kt=T=>(pt("data-v-3f900083"),T=T(),vt(),T),gt={class:"inventory"},wt={class:"h3"},Ct={key:0,class:"inventory-header-action"},Vt={class:"inventory-body-filter"},St={class:"inventory-body-filter-item"},Lt={key:0,class:"inventory-body-filter-item"},xt={class:"inventory-body"},Mt={key:0,class:"inventory-body-left"},Rt={key:1,class:"inventory-body-right"},It={class:"inventory-body-right-item"},Nt={class:"modal-picture"},Ft=["src"],Pt={key:0,class:"inventory-body-right-item-delivery-tag body6"},Tt={key:1,class:"swiper-indicator"},Et={class:"inventory-body-right-item-info"},Kt={class:"inventory-body-right-item-info-wrapper"},$t={class:"inventory-body-right-item-info-header"},Ot={class:"inventory-body-right-item-info-header-title title1"},qt={class:"series"},Bt={class:"model body6"},At={class:"inventory-body-right-item-info-header-price title1"},Ht={class:"inventory-body-right-item-info-argument"},Dt={class:"inventory-body-right-item-info-argument-item"},Ut={class:"inventory-body-right-item-info-argument-item-title title1"},jt={class:"body7"},zt={class:"inventory-body-right-item-info-argument-item-desc body7"},Qt={class:"inventory-body-right-item-info-disposition body6"},Yt={class:"inventory-body-right-item-info-disposition-left"},Zt={class:"inventory-body-right-item-info-disposition-item"},Gt={class:"inventory-body-right-item-info-disposition-right"},Wt={class:"inventory-body-right-item-info-disposition-item"},Jt={key:2,class:"inventory-body-empty"},Xt={class:"inventory-body-empty-content-img"},eo={class:"common-modal-header"},to={class:"common-modal-close"},oo=kt(()=>r("path",{d:"M6.4001 18.6501L5.3501 17.6001L10.9501 12.0001L5.3501 6.4001L6.4001 5.3501L12.0001 10.9501L17.6001 5.3501L18.6501 6.4001L13.0501 12.0001L18.6501 17.6001L17.6001 18.6501L12.0001 13.0501L6.4001 18.6501Z",fill:"#24292B"},null,-1)),so=[oo],io={class:"common-modal-title h4"},ao={key:0,class:"common-modal-body"},lo={class:"common-modal-footer"},no=lt({__name:"inventory",async setup(T){var ie,ae;let E,Q;const Y=Ue(),Ce=it(),{data:y,head:Ve}=([E,Q]=nt(()=>Je({query:bt,key:"inventory"})),E=await E,Q(),E);(ae=(ie=y==null?void 0:y.value)==null?void 0:ie.page)!=null&&ae.title||Ye("404");const Z=rt("(max-width: 992px)"),{$drawer:Se}=st(),G=q(()=>{var e,t;return(t=(e=y.value)==null?void 0:e.page)==null?void 0:t.copyright});Ze(()=>Ve.value);const{locale:m}=Ge(),c=We(),I=g(!1),F=g([{optionKey:"carSeries",isMultiple:!1,title:"Model",options:[],defaultValue:"",key:"seriesCodes"},{optionKey:"carModels",isMultiple:!1,title:"Trim",options:[],key:"carModelCodes",defaultValue:""},{optionKey:"exteriorOptions",isMultiple:!0,title:"Exterior",options:[],key:"exterior
62Codes",defaultValue:[]},{optionKey:"interiorOptions",isMultiple:!0,title:"Interior",options:[],key:"interiorCodes",defaultValue:[]},{optionKey:"wheelOptions",isMultiple:!0,title:"Alloy Wheels",options:[],key:"wheelCodes",defaultValue:[]},{optionKey:"roofColorOptions",isMultiple:!0,title:"Roof Color",options:[],key:"roofColorCodes",defaultValue:[]}]),Le=[{code:"Ex_decoration"},{code:"hub"},{code:"Interior"},{code:"assembly"}];let S={},K={};const H=g([]),P=g([]),W=g(!1),f=g([]),J=g([]),X=g(!1),D=g(),V=q(()=>{var e,t;return(t=(e=y.value)==null?void 0:e.page)==null?void 0:t.sort}),U=e=>{f.value=[],S[e.key]=e.value;let t=0;F.value.forEach(o=>{var s,l,d,p,_;o.key===e.key&&(o.defaultValue=o.isMultiple?e.value:(s=e.value)==null?void 0:s[0]),o.isMultiple?(t+=((l=o.defaultValue)==null?void 0:l.length)||0,f.value.length===0&&o.defaultValue&&((d=o.defaultValue)==null?void 0:d.length)>0&&(f.value.push((p=o.options.find(b=>o.defaultValue.includes(b.code)))==null?void 0:p.name),t-=1)):o.defaultValue&&f.value.push((_=o.options.find(b=>b.code===o.defaultValue))==null?void 0:_.name)}),t>0&&f.value.push(`+${t}`),j(S)},xe=e=>{K[e.key]=e.value},Me=()=>{K=Object.assign({},S),I.value=!0},Re=()=>{S=Object.assign({},K),I.value=!1,f.value=[];let e=0;F.value.forEach(t=>{var o,s,l,d;t.defaultValue=t.isMultiple?S[t.key]:(o=S[t.key])==null?void 0:o[0],t.isMultiple?(e+=((s=t.defaultValue)==null?void 0:s.length)||0,f.value.length===0&&t.defaultValue&&((l=t.defaultValue)==null?void 0:l.length)>0&&t.defaultValue.forEach(p=>{var _;f.value.length===0&&(f.value.push((_=t.options.find(b=>b.code===p))==null?void 0:_.name),e-=1)})):t.defaultValue&&f.value.push((d=t.options.find(p=>p.code===t.defaultValue))==null?void 0:d.name)}),e>0&&f.value.push(`+${e}`),j(S)},ee=g({}),Ie=(e,t)=>{e&&(ee.value[`${t}`]=e)},Ne=()=>{K={},F.value.forEach(e=>{let t="";e.optionKey==="carSeries"&&(c!=null&&c.query.s)&&e.options.find(s=>s.code===(c==null?void 0:c.query.s))&&(t=c==null?void 0:c.query.s),e.isMultiple||e.options.length===1&&(t=e.options[0].code),ee.value[`${e.optionKey}`].clearFilter(t)})},te=e=>{P.value=[...P.value].sort((t,o)=>e==="asc"?t.basePrice-o.basePrice:o.basePrice-t.basePrice)},j=async e=>{var s,l,d;const t={};Object.keys(e).forEach(p=>{t[p]=e[p].reduce((_,b)=>b.includes(",")?_.concat(b.split(",")):(_.push(b),_),[])});const o=await Y.queryStockSkuPageList({countryCode:(s=m==null?void 0:m.value)==null?void 0:s.split("-")[1],languageCode:(l=m==null?void 0:m.value)==null?void 0:l.split("-")[0],pageSize:100,...t});W.value=!0,P.value=((d=o==null?void 0:o.data)==null?void 0:d.items)||[],te(L.value)},oe=(e,t)=>{const o=Object.assign([],Le);return e.forEach(s=>{const l=o.find(d=>d.code===s.attribute.code);if(l)if(l.code==="batteryBrand"){const d=e.find(p=>p.attribute.code==="battery_power");l.value=s.attributeValue.name+" "+d.attributeValue.name}else l.code==="Interior"?l.value=`${s.attributeValue.name} Interior`:l.value=s.attributeValue.name}),t==="left"?o.filter((s,l)=>l%2===0):o.filter((s,l)=>l%2===1)},Fe=e=>{window.location.href=`${Ce.public.shopUrl}/${m==null?void 0:m.value}/configuration?itemskubizid=${e.itemSkuBizId}`},Pe=()=>{if(D.value){let e=null;const o=D.value.offsetTop,s=()=>{e&&clearTimeout(e),e=setTimeout(()=>{const l=window.pageYOffset||document.documentElement.scrollTop;X.value=l>=o},10)};window.addEventListener("scroll",s,{passive:!0}),ct(()=>{e&&clearTimeout(e),window.removeEventListener("scroll",s)})}};ut(async()=>{var t,o;const e=await Y.queryStockSkuFilter({countryCode:(t=m==null?void 0:m.value)==null?void 0:t.split("-")[1],languageCode:(o=m==null?void 0:m.value)==null?void 0:o.split("-")[0]});e.data&&(F.value.forEach(s=>{s.options=e.data[s.optionKey]||[],s.options=s.options.reduce((l,d)=>{const p=l.find(_=>_.name===d.name);return p?p.code+=`,${d.code}`:l.push(d),l},[]),s.optionKey==="carSeries"&&(c!=null&&c.query.s)&&s.options.find(d=>d.code===(c==null?void 0:c.query.s))&&(s.defaultValue=c==null?void 0:c.query.s,U({key:s.key,value:[s.defaultValue]})),s.isMultiple||s.options.length===1&&(s.defaultValue=s.options[0].code,U({key:s.key,value:[s.defaultValue]}))}),H.value=F.value.filter(s=>s.options.length>0)),j(S),Pe()});const Te=[be(Xe,({adapter:{renderNode:e},children:t,key:o})=>e("p",{key:o,class:"h4 mb-16"},[...t])),be(et,({adapter:{renderNode:e},children:t,key:o})=>e("p",{key:o,class:"mb-8 body4"},[...t]))],Ee=({record:e,children:t,transformedMeta:o})=>{switch(e.__typename){case"LinkRecord":return we("a",{...o,href:e.url,target:"_blank"},t);case"NavigationRecord":return we("a",{...o,href:tt(e.link,e.query)},t);default:return null}},Ke=(e,t)=>{J.value[t]={activeIndex:e==null?void 0:e.realIndex}},L=g("desc"),se=q(()=>{var e,t;return[{label:(e=V.value)==null?void 0:e.priceLowHigh,value:"asc"},{label:(t=V.value)==null?void 0:t.priceHighLow,value:"desc"}]}),$e=q(()=>{var e;return(e=se.value.find(t=>t.value===L.value))==null?void 0:e.label});dt(L,e=>{te(e)},{immediate:!0});const Oe=()=>{var e,t;Se.bottom({componentProps:{...V.value,sortOption:L.value},cancelText:(e=V.value)==null?void 0:e.cancel,confirmText:(t=V.value)==null?void 0:t.confirm,showFooter:!0,showConfirm:!0,onConfirm:o=>{L.value=o||"desc"}})};return(e,t)=>{var _,b,le,ne,re,ue,de,ce,pe,ve,ye;const o=qe,s=Be,l=Ae,d=He,p=De;return n(),u("section",gt,[r("div",{ref_key:"headerRef",ref:D,class:ge(["inventory-header",{compact:i(X)}])},[r("h1",wt,h((b=(_=i(y))==null?void 0:_.page)==null?void 0:b.title),
621),i(V)?(n(),u("div",Ct,[C(o,{modelValue:i(L),"onUpdate:modelValue":t[0]||(t[0]=a=>ke(L)?L.value=a:null),label:(le=i(V))==null?void 0:le.label,options:i(se)},null,8,["modelValue","label","options"])])):x("",!0)],2),r("div",Vt,[r("div",St,[C(s,{label:(re=(ne=i(y))==null?void 0:ne.page)==null?void 0:re.filter,value:i(f),placeholder:"No filters selected",onClick:Me},null,8,["label","value"])]),i(V)?(n(),u("div",Lt,[C(s,{label:(ue=i(V))==null?void 0:ue.label,value:i($e),placeholder:"No filters selected",onClick:Oe},null,8,["label","value"])])):x("",!0)]),r("div",xt,[i(Z)?x("",!0):(n(),u("div",Mt,[(n(!0),u(M,null,R(i(H),a=>(n(),B(l,{optionKey:a.key,onValueChange:U,options:a.options,isMultiple:a.isMultiple,title:a.title,defaultValue:a.defaultValue},null,8,["optionKey","options","isMultiple","title","defaultValue"]))),256))])),((de=i(P))==null?void 0:de.length)>0?(n(),u("div",Rt,[(n(!0),u(M,null,R(i(P),(a,k)=>{var w,$,me,he,_e;return n(),u("div",It,[r("div",Nt,[C(i(mt),{class:"swiper",onSlideChange:v=>{Ke(v,k)},"allow-touch-move":!0,loop:!0},{default:N(()=>[(n(!0),u(M,null,R(a.imageUrls,v=>(n(),B(i(yt),null,{default:N(()=>[r("img",{src:v,alt:""},null,8,Ft)]),_:2},1024))),256))]),_:2},1032,["onSlideChange"]),($=(w=i(y))==null?void 0:w.page)!=null&&$.deliveryDateTag?(n(),u("div",Pt,h((he=(me=i(y))==null?void 0:me.page)==null?void 0:he.deliveryDateTag),1)):x("",!0),((_e=a.imageUrls)==null?void 0:_e.length)>1?(n(),u("div",Tt,[(n(!0),u(M,null,R(a.imageUrls,(v,O)=>{var fe;return n(),u("div",{class:ge(["swiper-indicator-item",{active:O===(((fe=i(J)[k])==null?void 0:fe.activeIndex)||0)}])},null,2)}),256))])):x("",!0)]),r("div",Et,[r("div",Kt,[r("div",$t,[r("div",Ot,[r("span",qt,h(a.carSeriesName),1),r("span",Bt,h(a.carModelName),1)]),r("div",At,h(parseInt((a==null?void 0:a.basePrice)||0))+" "+h(a.currencyCode),1)]),r("div",Ht,[(n(!0),u(M,null,R(a.performanceDataVos,v=>(n(),u("div",Dt,[r("div",Ut,[A(h(v.valueStr),1),r("span",jt,h(v.unitStr),1)]),r("div",zt,h(v.dataTitle),1)]))),256))]),r("div",Qt,[r("div",Yt,[(n(!0),u(M,null,R(oe(a.attributeProperties,"left"),v=>(n(),u("div",Zt,h(v.value),1))),256))]),r("div",Gt,[(n(!0),u(M,null,R(oe(a.attributeProperties,"right"),v=>(n(),u("div",Wt,h(v.value),1))),256))])])]),C(i(z),{class:"inventory-body-right-item-info-button",onClick:v=>Fe(a)},{default:N(()=>{var v,O;return[A(h((O=(v=i(y))==null?void 0:v.page)==null?void 0:O.orderNow),1)]}),_:2},1032,["onClick"])])])}),256))])):i(W)?(n(),u("div",Jt,[r("div",Xt,[C(d,{class:"image",data:(pe=(ce=i(y))==null?void 0:ce.page)==null?void 0:pe.emptyBackground,"object-position":"top"},null,8,["data"]),C(i(ot),{class:"structured-text",data:(ye=(ve=i(y))==null?void 0:ve.page)==null?void 0:ye.noResultContent,customNodeRules:Te,renderLinkToRecord:Ee},null,8,["data"])])])):x("",!0)]),C(i(ht),{visible:i(I),"onUpdate:visible":t[2]||(t[2]=a=>ke(I)?I.value=a:null),placement:"bottom",destroyOnClose:"",closable:!1,bodyStyle:{padding:0},onClose:t[3]||(t[3]=a=>I.value=!1),class:"dialog-drawer"},{default:N(()=>{var a,k;return[r("div",eo,[r("div",to,[(n(),u("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",onClick:t[1]||(t[1]=w=>I.value=!1)},so))])]),r("div",io,h((k=(a=i(y))==null?void 0:a.page)==null?void 0:k.filter),1),i(Z)?(n(),u("div",ao,[(n(!0),u(M,null,R(i(H),w=>(n(),B(l,{ref_for:!0,ref:$=>Ie($,w.optionKey),optionKey:w.key,onValueChange:xe,options:w.options,isMultiple:w.isMultiple,title:w.title,defaultValue:w.defaultValue},null,8,["optionKey","options","isMultiple","title","defaultValue"]))),256))])):x("",!0)]}),footer:N(()=>[r("div",lo,[C(i(z),{class:"clear",onClick:Ne},{default:N(()=>{var a,k;return[A(h((k=(a=i(y))==null?void 0:a.page)==null?void 0:k.clear),1)]}),_:1}),C(i(z),{type:"primary",onClick:Re},{default:N(()=>{var a,k;return[A(h((k=(a=i(y))==null?void 0:a.page)==null?void 0:k.showResults),1)]}),_:1})])]),_:1},8,["visible"]),i(G)?(n(),B(p,{key:0,copyright:i(G)},null,8,["copyright"])):x("",!0)])}}}),Vo=at(no,[["__scopeId","data-v-3f900083"]]);export{Vo 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.