import{_ as V}from"./nmarkdown.vue-h4mq92u9.js";import{I as B,J as U,e as D}from"./howhlbef.js";import{_ as $}from"./filepath-item.vue-oo6zkdxa.js";import{C as y}from"./constants-b32h69zq.js";import{k as E,l,S as F,R as s,N as r,a0 as i,V as o,X as u,a1 as S,u as k,a7 as d,U as c,F as x,a6 as v,ac as j,Z as z}from"./vendor/json-editor-vue-gplv2x2n.js";const J={"hover:text-primary":""},L={key:0,"text-primary":""},M={"max-w-100":""},O={px4:"",py3:"","text-sm":""},R={flex:"~ gap2",n:"primary xs"},T={border:"t base","max-h-60":"","of-auto":"",px4:"",py3:""},W={"text-sm":""},X={"text-primary":""},Z={flex:"~ col gap-2","items-start":"",pt3:"","text-sm":"",op75:""},q={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=B(),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=V,f=D,w=$,I=F("VDropdown");return s(),r(I,{disabled:!t.metadata},{popper:i(()=>[o("div",M,[o("div",O,[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",R,[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",T,[n.value?(s(),c(x,{key:0},[o("div",W,[e[5]||(e[5]=o("span",{op50:""},"It has been referenced ",-1)),o("strong",X,v(n.value),1),e[6]||(e[6]=o("span",{op50:""}," times by:",-1))]),o("div",Z,[(s(!0),c(x,null,j(h.value,p=>(s(),r(w,{key:p,filepath:p},null,8,["filepath"]))),128))])],64)):(s(),c("div",q," 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",L,"x"+v(n.value),1)):u("",!0)],2)])]),_:1},8,["disabled"])}}});export{Q as _};
