import{_ as B}from"./nmarkdown.vue-ffthu1ys.js";import{J as I,K as U,f as D}from"./h48l6b7a.js";import{_ as $}from"./filepath-item.vue-l7pl1gvj.js";import{C as y}from"./constants-b32h69zq.js";import{l as E,m as l,S as F,R as s,N as r,a0 as i,V as o,X as u,a1 as S,u as x,a7 as d,U as c,F as k,a6 as v,ac as j,Z as z}from"./vendor/json-editor-vue-hrh84odz.js";const J={"hover:text-primary":""},K={key:0,"text-primary":""},L={"max-w-100":""},M={px4:"",py3:"","text-sm":""},O={flex:"~ gap2",n:"primary xs"},R={border:"t base","max-h-60":"","of-auto":"",px4:"",py3:""},T={"text-sm":""},W={"text-primary":""},X={flex:"~ col gap-2","items-start":"",pt3:"","text-sm":"",op75:""},Z={key:1,"text-sm":"",op50:""},Q=E({__name:"ComposableItem",props:{item:{},metadata:{},filepath:{},counter:{type:Boolean,default:!0},classes:{default:"px2 py1 text-sm bg-gray:5 "}},setup(b){const t=b,g=I(),C=U(),m=l(()=>t.item.as||t.item.name),n=l(()=>t.metadata?.injectionUsage?.[m.value]?.count||0),h=l(()=>(t.metadata?.injectionUsage?.[m.value]?.moduleIds||[]).filter(a=>!a.endsWith("?macro=true"))),_=l(()=>t.item.meta?.docsUrl?t.item.meta.docsUrl:["nuxt","#app","nuxt3"].includes(t.item.from)?y.nuxt[t.item.name]:t.item.from==="vue"?y.vue[t.item.name]:null);return(a,e)=>{const N=B,f=D,w=$,V=F("VDropdown");return s(),r(V,{disabled:!t.metadata},{popper:i(()=>[o("div",L,[o("div",M,[a.item.meta?.description?(s(),r(N,{key:0,tag:"div",pb3:"","text-sm":"",markdown:a.item.meta.description},null,8,["markdown"])):u("",!0),o("div",O,[S(f,{icon:"carbon-copy",onClick:e[0]||(e[0]=p=>x(g)(m.value,"imports-name"))},{default:i(()=>e[2]||(e[2]=[d(" Copy ")])),_:1}),a.filepath?(s(),r(f,{key:0,icon:"carbon-code",onClick:e[1]||(e[1]=p=>a.filepath&&x(C)(a.filepath))},{default:i(()=>e[3]||(e[3]=[d(" Source ")])),_:1})):u("",!0),_.value?(s(),r(f,{key:1,icon:"carbon-catalog",to:_.value,target:"_blank"},{default:i(()=>e[4]||(e[4]=[d(" Docs ")])),_:1},8,["to"])):u("",!0)])]),o("div",R,[n.value?(s(),c(k,{key:0},[o("div",T,[e[5]||(e[5]=o("span",{op50:""},"It has been referenced ",-1)),o("strong",W,v(n.value),1),e[6]||(e[6]=o("span",{op50:""}," times by:",-1))]),o("div",X,[(s(!0),c(k,null,j(h.value,p=>(s(),r(w,{key:p,filepath:p},null,8,["filepath"]))),128))])],64)):(s(),c("div",Z," Not in use via auto import. "))])])]),default:i(()=>[o("button",J,[o("code",{rounded:"","font-mono":"",class:z([a.metadata&&!n.value?"op30 hover:op100":"",a.classes])},[d(v(m.value)+" ",1),n.value&&a.counter?(s(),c("sup",K,"x"+v(n.value),1)):u("",!0)],2)])]),_:1},8,["disabled"])}}});export{Q as _};
