import{_ as B}from"./nmarkdown.vue-ew01nvcn.js";import{I as U,J as V,e as $}from"./er2hcepb.js";import{_ as D}from"./filepath-item.vue-n2otfocd.js";import{C as y}from"./constants-b32h69zq.js";import{k as E,l,R as F,Q as s,M as r,$ as i,U as o,W as u,a0 as S,u as k,a6 as d,S as c,F as x,a5 as v,ab as j,Y as M}from"./vendor/json-editor-vue-gv8v06ez.js";const W={"hover:text-primary":""},z={key:0,"text-primary":""},J={"max-w-100":""},L={px4:"",py3:"","text-sm":""},O={flex:"~ gap2",n:"primary xs"},Q={border:"t base","max-h-60":"","of-auto":"",px4:"",py3:""},R={"text-sm":""},T={"text-primary":""},Y={flex:"~ col gap-2","items-start":"",pt3:"","text-sm":"",op75:""},q={key:1,"text-sm":"",op50:""},X=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=U(),C=V(),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 w=B,f=$,I=D,N=F("VDropdown");return s(),r(N,{disabled:!t.metadata},{popper:i(()=>[o("div",J,[o("div",L,[a.item.meta?.description?(s(),r(w,{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=>k(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&&k(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",Q,[n.value?(s(),c(x,{key:0},[o("div",R,[e[5]||(e[5]=o("span",{op50:""},"It has been referenced ",-1)),o("strong",T,v(n.value),1),e[6]||(e[6]=o("span",{op50:""}," times by:",-1))]),o("div",Y,[(s(!0),c(x,null,j(h.value,p=>(s(),r(I,{key:p,filepath:p},null,8,["filepath"]))),128))])],64)):(s(),c("div",q," Not in use via auto import. "))])])]),default:i(()=>[o("button",W,[o("code",{rounded:"","font-mono":"",class:M([a.metadata&&!n.value?"op30 hover:op100":"",a.classes])},[d(v(m.value)+" ",1),n.value&&a.counter?(s(),c("sup",z,"x"+v(n.value),1)):u("",!0)],2)])]),_:1},8,["disabled"])}}});export{X as _};
