import{_ as I}from"./nmarkdown.vue-lym2fx3e.js";import{J as U,K as V,f as $}from"./nqd95jrf.js";import{_ as D}from"./filepath-item.vue-dhlc2m5d.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-fw81xiot.js";const W={"hover:text-primary":""},z={key:0,"text-primary":""},J={"max-w-100":""},K={px4:"",py3:"","text-sm":""},L={flex:"~ gap2",n:"primary xs"},O={border:"t base","max-h-60":"","of-auto":"",px4:"",py3:""},Q={"text-sm":""},R={"text-primary":""},T={flex:"~ col gap-2","items-start":"",pt3:"","text-sm":"",op75:""},Y={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=I,f=$,N=D,B=F("VDropdown");return s(),r(B,{disabled:!t.metadata},{popper:i(()=>[o("div",J,[o("div",K,[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",L,[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",O,[n.value?(s(),c(x,{key:0},[o("div",Q,[e[5]||(e[5]=o("span",{op50:""},"It has been referenced ",-1)),o("strong",R,v(n.value),1),e[6]||(e[6]=o("span",{op50:""}," times by:",-1))]),o("div",T,[(s(!0),c(x,null,j(h.value,p=>(s(),r(N,{key:p,filepath:p},null,8,["filepath"]))),128))])],64)):(s(),c("div",Y," 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 _};
