import{u as b,o as s,c as u,w as t,b as a,l as g,t as n,S as y,aj as _,C as p,E as C,ay as v,H as h,p as m,d as c,f,B as V,W as x,k as I,az as B,D as k}from"./index-c12e76f5.js";import{_ as S}from"./_plugin-vue_export-helper-c27b6911.js";const w={name:"ItemCard",setup(){const{t:l}=b();return{t:l}},props:{item:{type:Object,required:!0},titleField:{type:String,default:"id"},enabledField:{type:String,default:"enable"},bglogo:{type:String,default:null},loading:{type:Boolean,default:!1},showCopyButton:{type:Boolean,default:!1}},emits:["toggle-enabled","delete","edit","copy"],methods:{getItemTitle(){return this.item[this.titleField]},getItemEnabled(){return this.item[this.enabledField]},toggleEnabled(){this.$emit("toggle-enabled",this.item)}}},E=["title"],T={key:0,class:"d-flex justify-end align-center",style:{position:"absolute",bottom:"16px",right:"16px",opacity:"0.2"}};function j(l,o,e,d,F,i){return s(),u(k,{class:"item-card hover-elevation",style:{padding:"4px"},elevation:"0"},{default:t(()=>[a(C,{class:"d-flex justify-space-between align-center pb-1 pt-3"},{default:t(()=>[g("span",{class:"text-h2 text-truncate",title:i.getItemTitle()},n(i.getItemTitle()),9,E),a(y,{location:"top"},{activator:t(({props:r})=>[a(_,p({color:"primary","hide-details":"",density:"compact","model-value":i.getItemEnabled(),loading:e.loading,disabled:e.loading},r,{"onUpdate:modelValue":i.toggleEnabled}),null,16,["model-value","loading","disabled","onUpdate:modelValue"])]),default:t(()=>[g("span",null,n(i.getItemEnabled()?d.t("core.common.itemCard.enabled"):d.t("core.common.itemCard.disabled")),1)]),_:1})]),_:1}),a(h,null,{default:t(()=>[v(l.$slots,"item-details",{item:e.item},void 0,!0)]),_:3}),a(x,{style:{margin:"8px"}},{default:t(()=>[a(m,{variant:"outlined",color:"error",rounded:"xl",onClick:o[0]||(o[0]=r=>l.$emit("delete",e.item))},{default:t(()=>[c(n(d.t("core.common.itemCard.delete")),1)]),_:1}),a(m,{variant:"tonal",color:"primary",rounded:"xl",onClick:o[1]||(o[1]=r=>l.$emit("edit",e.item))},{default:t(()=>[c(n(d.t("core.common.itemCard.edit")),1)]),_:1}),e.showCopyButton?(s(),u(m,{key:0,variant:"tonal",color:"secondary",rounded:"xl",onClick:o[2]||(o[2]=r=>l.$emit("copy",e.item))},{default:t(()=>[c(n(d.t("core.common.itemCard.copy")),1)]),_:1})):f("",!0),a(V)]),_:1}),e.bglogo?(s(),I("div",T,[a(B,{src:e.bglogo,contain:"",width:"120",height:"120"},null,8,["src"])])):f("",!0)]),_:3})}const U=S(w,[["render",j],["__scopeId","data-v-5fb36c6b"]]);export{U as I};
