import A from"./CTAcmMAz.js";import B from"./a5umXhxZ.js";import{Y as L,b as N,s as m,c as R,y as V,f as a,m as _,j as f,l as c,w as j,k as s,A as D,p as e,t as h,v as E,_ as H}from"./BCLrUOBx.js";import{u as M}from"./Di7fl9dA.js";import{u as U}from"./BnLnKt_p.js";import{u as q}from"./Ce8lFovl.js";import"./Bxmfm8sn.js";const F={class:"p-tile"},O={class:"img-wrapper"},Y={key:0,class:"badge"},G=["title"],J={class:"flex wrap sided align-end item-title mt-0"},K={class:"price-wrapper"},Q={class:"price"},W={class:"strike-through"},X={class:"color-primary"},Z={class:"discount"},mt={__name:"FlashProductTile",props:{flashProduct:{type:Object,default(){return null}}},emits:["removed"],setup(g,{emit:v}){const b=g,{flashProduct:r}=L(b),i=N(),{currencyIcon:tt,setting:et}=m(i),{unAuthPost:ot,setToastMessage:st,setToastError:rt}=i,k=R(),{authenticated:at}=m(k),{getThumbImageURL:y,productLink:P}=V(),o=a(()=>{var t;return((t=r.value)==null?void 0:t.product_data)||r.value}),S=v,{prevPrice:l}=M({product:o}),C=a(()=>100-parseInt((p.value/l.value*100).toString())),{addToCompare:u}=U({product:o,emit:S}),p=a(()=>{var t;return(t=r.value)==null?void 0:t.price});a(()=>{var t;return((t=r.value)==null?void 0:t.quantity)||0}),a(()=>{var t;return((t=r.value)==null?void 0:t.sold)||0});const T=q(),{setProduct:w}=T,x=()=>{w(o.value)};return(t,n)=>{const I=A,d=B,$=H;return f(),_("div",F,[c($,{to:e(P)(e(o)),class:"block page-link",title:e(o).title,onClick:x},{default:j(()=>[s("div",O,[e(o).badge?(f(),_("span",Y,h(e(o).badge),1)):D("",!0),s("button",{"aria-label":"submit",class:"compare-btn",title:t.$t("product.compare"),onClick:n[0]||(n[0]=E((...z)=>e(u)&&e(u)(...z),["prevent"]))},n[1]||(n[1]=[s("i",{class:"icon reload-icon"},null,-1)]),8,G),c(I,{"lazy-src":e(y)(e(o).image),title:e(o).title,alt:e(o).title},null,8,["lazy-src","title","alt"])]),s("div",J,[s("h4",K,[s("span",Q,[c(d,{price:e(p)},null,8,["price"])]),s("span",W,[c(d,{price:e(l)},null,8,["price"])])]),s("h5",X,[s("span",Z,h(t.$t("home.off",{percent:e(C)})),1)])])]),_:1},8,["to","title"])])}}};export{mt as default};
