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