import{y as C,s as k,D as x,A as F,o as n,e as r,k as S,l as _,C as T,t as f,m as a,n as l,F as A,B as N,f as v,v as z}from"./vendor-CI5NvTnj.js";import{u as V,b as w}from"./index-BRMV7KFd.js";function p(t){const i=t;i.__i18n=i.__i18n||[],i.__i18n.push({locale:"",resource:{cs:{add_to_favorite:o=>{const{normalize:e}=o;return e(["PĹ™idat do oblĂbenĂ˝ch"])},added_to_favorite:o=>{const{normalize:e}=o;return e(["PĹ™idáno do oblĂbenĂ˝ch"])}},sk:{add_to_favorite:o=>{const{normalize:e}=o;return e(["PridaĹĄ do obľúbenĂ˝ch"])},added_to_favorite:o=>{const{normalize:e}=o;return e(["PridanĂ© do obľúbenĂ˝ch"])}},pl:{add_to_favorite:o=>{const{normalize:e}=o;return e(["Dodaj do ulubionych"])},added_to_favorite:o=>{const{normalize:e}=o;return e(["Dodano do ulubionych"])}},hu:{add_to_favorite:o=>{const{normalize:e}=o;return e(["Hozzáadás a kedvencekhez"])},added_to_favorite:o=>{const{normalize:e}=o;return e(["Hozzáadva a kedvencekhez"])}},de:{add_to_favorite:o=>{const{normalize:e}=o;return e(["Zu Favoriten hinzufĂĽgen"])},added_to_favorite:o=>{const{normalize:e}=o;return e(["Zu den Favoriten hinzugefĂĽgt"])}},at:{add_to_favorite:o=>{const{normalize:e}=o;return e(["Zu Favoriten hinzufĂĽgen"])},added_to_favorite:o=>{const{normalize:e}=o;return e(["Zu den Favoriten hinzugefĂĽgt"])}},ro:{add_to_favorite:o=>{const{normalize:e}=o;return e(["AdÄugaČ›i la favorite"])},added_to_favorite:o=>{const{normalize:e}=o;return e(["AdÄugat la favorite"])}}}})}const B=["aria-label","title"],P={key:0,class:"mi-heart-fill text-danger icon-20px"},D={key:2,class:"heart-pop"},Z={key:3,class:"added-to-favourite px-3 py-2 bg-white rounded-lg shadow absolute text-primary"},H={__name:"ButtonFavorite",props:{id:{type:[Number,String],required:!0},btnClass:{type:String,default:""},iconSize:{type:[Number,String],default:30},iconColorClass:{type:String,default:"text-muted"},boxClass:{type:String,default:"m-1 m-md-2 m-lg-4"}},setup(t){const i=t,{openModal:o}=V(),{t:e}=C(),s=w(),{isSignedIn:b}=k(s),d=x(!1),h=setTimeout(()=>{d.value=!1},4e3),g=()=>{clearTimeout(h),s.toggleFavoriteProducts(i.id),d.value=!0},u=["btn p-1 rounded-circle relative",i.btnClass];return(I,c)=>{const y=F("VTooltip");return n(),r("div",{class:l(t.boxClass)},[S(y,{theme:"baseTooltip"},{popper:_(()=>[T(f(a(e)("add_to_favorite")),1)]),default:_(()=>[a(b)?(n(),r("button",{key:0,type:"button",class:l(u),"aria-label":a(e)("add_to_favorite"),"aria-pressed":"false",title:a(e)("add_to_favorite"),onClick:g},[a(s).isFavorite(t.id)?(n(),r("i",P)):(n(),r("i",{key:1,class:l(["mi-heart icon-20px",t.iconColorClass])},null,2)),a(s).isFavorite(t.id)&&d.value?(n(),r("div",D,[(n(),r(A,null,N(5,m=>v("i",{key:m,class:"mi-heart-fill text-danger icon-20px"})),64))])):z("",!0),a(s).isFavorite(t.id)&&d.value?(n(),r("div",Z,f(a(e)("added_to_favorite")),1)):z("",!0)],8,B)):(n(),r("button",{key:1,class:l(u),"aria-label":"Add to favorite",type:"button",onClick:c[0]||(c[0]=m=>a(o)({id:"modal-sign-in"}))},[v("i",{class:l(["mi-heart icon-20px",t.iconColorClass])},null,2)]))]),_:1})],2)}}};typeof p=="function"&&p(H);export{H as default};