import{_ as $}from"./AbstraButton.vue_vue_type_script_setup_true_lang-60wd7w0p.js";import{F as H}from"./PhKey.vue-Bz67FGPT.js";import{G as T}from"./PhPencil.vue-B1w6UtLB.js";import{_ as C,P as k}from"./vue-flow-core-DIcVZb9v.js";import{C as z}from"./index-FhuFwKwr.js";import{a as D,c as g,a8 as V,b as o,f as n,u as t,K as y,w as l,h as i,k as j,e as r,R as K,$ as E,F as f,T as p,g as h,t as b,ak as F,aK as L}from"./jwt-decode.esm-Dw_OlTCW.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},c=new Error().stack;c&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[c]="981bbc5c-faa5-4aab-b4c1-73c48446e361",e._sentryDebugIdIdentifier="sentry-dbid-981bbc5c-faa5-4aab-b4c1-73c48446e361")}catch{}})();const R=D({__name:"TableCard",props:{table:{},projectId:{},showHandles:{type:Boolean},maxVisibleColumns:{},connectedColumns:{},highlightedColumns:{},isHighlighted:{type:Boolean},showEditButton:{type:Boolean,default:!0}},emits:["dblclick"],setup(e,{emit:c}){const a=e,v=c,u=g(()=>a.maxVisibleColumns??5),x=g(()=>a.table.getColumns().slice(0,u.value)),w=g(()=>a.table.getColumns().length>u.value),_=g(()=>!a.highlightedColumns||a.highlightedColumns.length===0?!1:a.table.getColumns().slice(u.value).some(d=>d.id&&a.highlightedColumns?.includes(d.id))),I=m=>a.connectedColumns?.includes(m)??!1;return(m,d)=>{const B=V("RouterLink");return n(),o(t(z),{hoverable:!0,class:y(["table-card",{"table-highlighted":e.isHighlighted}]),onDblclick:d[0]||(d[0]=s=>v("dblclick"))},{title:l(()=>[i(t(f),{align:"center",justify:"space-between"},{default:l(()=>[i(t(F),{level:5,style:{margin:"0"}},{default:l(()=>[h(b(e.table.name),1)]),_:1}),e.showEditButton?(n(),o(B,{key:0,to:`/projects/${e.projectId}/tables/${e.table.id}`},{default:l(()=>[i($,{size:"small",type:"text"},{default:l(()=>[i(t(T),{size:16})]),_:1})]),_:1},8,["to"])):r("",!0)]),_:1})]),default:l(()=>[i(t(f),{vertical:"",gap:"small",class:"columns-list"},{default:l(()=>[(n(!0),j(K,null,E(x.value,s=>(n(),o(t(f),{key:s.id,align:"center",gap:"small",class:y(["column-row",{"column-highlighted":s.id&&e.highlightedColumns?.includes(s.id)}])},{default:l(()=>[e.showHandles&&s.foreignKey?(n(),o(t(C),{key:0,id:`target-${s.id}`,type:"target",position:t(k).Left,connectable:!1},null,8,["id","position"])):r("",!0),s.primaryKey?(n(),o(t(H),{key:1,size:14,class:"key-icon"})):r("",!0),i(t(p),{strong:"",style:{flex:"1","font-size":"13px","line-height":"1"}},{default:l(()=>[h(b(s.name),1)]),_:2},1024),i(t(p),{type:"secondary",style:{"line-height":"1"}},{default:l(()=>[h(b(s.type),1)]),_:2},1024),e.showHandles&&(s.primaryKey||s.id&&I(s.id))?(n(),o(t(C),{key:2,id:`source-${s.id}`,type:"source",position:t(k).Right,connectable:!1},null,8,["id","position"])):r("",!0)]),_:2},1032,["class"]))),128)),w.value?(n(),o(t(f),{key:0,justify:"center",align:"center",style:{"padding-top":"8px"},class:y({"more-columns-highlighted":_.value})},{default:l(()=>[i(t(p),{type:"secondary",style:{"font-size":"12px"}},{default:l(()=>[h(" +"+b(e.table.getColumns().length-u.value)+" more columns ",1)]),_:1})]),_:1},8,["class"])):r("",!0)]),_:1})]),_:1},8,["class"])}}}),q=L(R,[["__scopeId","data-v-e197befa"]]);export{q as T};
//# sourceMappingURL=TableCard-DcyqoXGU.js.map
