import{u as g,s as h,J as x,z as L,r as w,e as I,o as c,c as _,a as t,n as b,j as y,f as p,w as n,g as u,X as V,p as S,a0 as M,t as l}from"./index-Cdt4oMy6.js";const k={class:"sale-list__item"},B=t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("path",{d:"M5.4964 3.00449C6.19989 2.77691 6.9414 2.70085 7.67451 2.78081C8.40763 2.86078 9.11738 3.09516 9.75908 3.46994C10.4008 3.84475 10.961 4.3521 11.4035 4.96093L12.0067 5.79074L12.6144 4.96428C13.0588 4.3599 13.6196 3.857 14.2609 3.48619C14.9021 3.1154 15.6104 2.88441 16.3415 2.80694C17.0725 2.72947 17.8115 2.80709 18.5124 3.0352C19.2134 3.26333 19.8619 3.6373 20.417 4.13467C20.9721 4.63208 21.4219 5.24226 21.7373 5.9276C22.0527 6.61298 22.2267 7.35826 22.2478 8.11666C22.2689 8.87506 22.1367 9.62939 21.8597 10.3323C21.5828 11.0351 21.1675 11.6708 20.6406 12.1999L20.6386 12.2019L12.0104 20.9328L9.86311 18.7582L8.80243 19.8189L12.01 23.0672L21.7036 13.2583L21.7047 13.2572C22.3767 12.582 22.9042 11.7733 23.2553 10.8821C23.6066 9.99047 23.7739 9.03488 23.7472 8.07494C23.7205 7.115 23.5003 6.17052 23.0999 5.30049C22.6995 4.43043 22.1272 3.65302 21.4179 3.01751C20.7086 2.38196 19.8776 1.90208 18.9766 1.60884C18.0756 1.31559 17.1246 1.21556 16.1834 1.31529C15.2423 1.41502 14.3321 1.71225 13.51 2.18765C12.9591 2.50621 12.4558 2.90007 12.0134 3.35685C11.5715 2.89542 11.0677 2.49715 10.5156 2.17467C9.69289 1.69419 8.78094 1.3926 7.83716 1.28966C6.89336 1.18671 5.93909 1.28474 5.03471 1.57731C4.13036 1.86987 3.2962 2.35036 2.58438 2.98758C1.87261 3.62475 1.29863 4.40475 0.897656 5.27787C0.496702 6.15096 0.277174 7.09878 0.252367 8.06178C0.227559 9.02477 0.397985 9.98295 0.753332 10.8762C1.10827 11.7684 1.64029 12.577 2.31685 13.2509L2.31926 13.2533L6.69451 17.6842L7.75518 16.6235L3.38193 12.1946L3.37726 12.19C2.84635 11.6617 2.42719 11.0257 2.14709 10.3217C1.86698 9.61759 1.73227 8.86123 1.75187 8.1004C1.77147 7.33959 1.94492 6.59167 2.26079 5.90387C2.57663 5.21611 3.02776 4.60389 3.58486 4.10519C4.14191 3.60652 4.79288 3.23208 5.4964 3.00449Z",fill:"white"})],-1),H=[B],E={class:"sale-list__item-img"},F=["src"],O={key:0,class:"sale-list__item-price sale-list__item-price--no-price text-big color-green"},Z=t("span",{class:"text"},"Цена формируетÑÑ",-1),N=t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.79002 6.20661C1.86284 9.83896 2.08596 15.1697 5.45938 18.5432C8.83281 21.9166 14.1636 22.1397 17.7959 19.2125L18.8619 20.2785C14.6386 23.7884 8.35842 23.5635 4.39872 19.6038C0.439028 15.6441 0.214131 9.36391 3.72403 5.14062L4.79002 6.20661ZM10 10.7524H11.25V17.7524H14V16.2524H12.75V9.25244H10V10.7524Z",fill:"#314157"}),t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.13818 3.72399C9.36147 0.214005 15.6417 0.438877 19.6015 4.3986C23.5612 8.35833 23.7861 14.6386 20.2761 18.8619L19.2101 17.7959C22.1374 14.1636 21.9143 8.83272 18.5408 5.45926C15.1674 2.08581 9.83652 1.86271 6.20417 4.78997L5.13818 3.72399ZM12.75 7V5H11.25V7H12.75Z",fill:"#017338"})],-1),T=t("div",{class:"text-xs",style:{"margin-bottom":"15px"}}," Ðвтомобиль на оценке, Ð²Ñ€ÐµÐ¼Ñ Ð¾Ñ†ÐµÐ½ÐºÐ¸ до трех рабочих дней. Ð’Ñ‹ можете оÑтавить Ð°Ð´Ñ€ÐµÑ Ñл. почты и мы уведомим Ð’Ð°Ñ Ð¾ Ñформированной цене ",-1),j={key:1,class:"sale-list__item-price text-big color-green"},A={class:"sale-list__item-model text-big"},D={class:"sale-list__item-info text-normal"},P={__name:"SaleItemForList",props:{data:{type:Object,required:!0}},setup(v){const d=g(),e=v;h(()=>{r.value.findIndex(a=>a.id===e.data.id)!==-1&&(i.value=!0)}),x(d.state.favorites,()=>{r.value.findIndex(a=>a.id===e.data.id)!==-1?i.value=!0:i.value=!1},{deep:!0});const C=s=>s?s.replace(".00","").replace(/\B(?=(\d{3})+(?!\d))/g," "):"-",f=s=>"https://api-sale.resoleasing.com"+s,r=L(()=>d.state.favorites),i=w(!1),m=()=>{const s=r.value.findIndex(o=>o.id===e.data.id),a=r.value;if(s!==-1)a.splice(s,1),i.value=!1;else{const o={id:e.data.id,brand:e.data.brand,model:e.data.model,price:e.data.price,status:e.data.status,cover_url:e.data.cover_url,year:e.data.year,mileage:e.data.mileage,region:e.data.region};a.push(o),i.value=!0,d.commit("SET_SHOW_FAV_MODAL",!0)}localStorage.setItem("favorites",JSON.stringify(a)),d.commit("SET_FAVORITES",a)};return(s,a)=>{const o=I("router-link");return c(),_("div",k,[t("div",{class:b(["sale-list__item-fav",{"is-active":i.value}]),onClick:a[0]||(a[0]=y(z=>m(),["prevent"]))},H,2),p(o,{to:{path:`/sale/${e.data.id}`}},{default:n(()=>[t("div",E,[t("img",{src:f(e.data.cover_url),alt:""},null,8,F)])]),_:1},8,["to"]),e.data.status==="Выдано"||e.data.status==="Оплачено (не выдано)"||e.data.status==="СнÑтие ограничений"?(c(),_("div",O,[Z,p(u(M),{width:255,"popper-style":"box-shadow: 0px 15px 45px 0px rgba(142, 159, 186, 0.25); padding: 20px;"},{reference:n(()=>[N]),default:n(()=>[T,p(u(V),{type:"success",round:"",class:"w-full"},{default:n(()=>[S("Уведомить о цене")]),_:1})]),_:1})])):(c(),_("div",j,l(C(e.data.price))+" ₽ ",1)),t("div",A,l(e.data.brand+" "+e.data.model),1),t("div",D,l(e.data.year)+" / "+l(e.data.mileage)+" км / "+l(e.data.region),1)])}}};export{P as _};