import{_ as S}from"./nbadge-d24jlq2b.js";import{_ as D}from"./filepath-item-owlv864w.js";import{_ as k}from"./duration-display-cjpkh71u.js";import{A as B,a3 as H,I,b as P,x as V,f as j}from"#entry";import{p as v,q as h,J as m,Y as s,a3 as n,a1 as l,a4 as _,ab as C,$ as d,X as u,Z as F,a0 as T,ac as x,F as b,ah as E,a7 as O}from"./vendor/json-editor-vue-ikjc812x.js";import{_ as W}from"./nsection-block-je23gs2w.js";import{_ as A}from"./help-fab-chg6ox1v.js";import"./vendor/shiki-hpfujfi3.js";import"./vendor/unocss-hczpatch.js";import"./nicon-title-he6hzgyb.js";const L={flex:"~ gap2","items-center":""},M={w8:"","text-right":"","text-sm":"",op25:""},Y={key:0,"flex-auto":"","text-right":""},q=v({__name:"PluginItem",props:{plugin:{},index:{}},setup(e){const t=e,a=B(),c=h(()=>H(t.plugin.src,a.value?.rootDir||"").path);return(f,p)=>{const o=S,r=D,i=k;return s(),m("div",L,[n("div",M,C(e.index),1),l(r,{filepath:t.plugin.src,subpath:!0},{default:d(()=>[n("div",null,[c.value.startsWith("#")?(s(),u(o,{key:0,n:"rose",textContent:"virtual"})):c.value.startsWith(".")?_("",!0):(s(),u(o,{key:1,n:"gray",textContent:"module"})),e.plugin.mode==="server"?(s(),u(o,{key:2,n:"teal",textContent:"server"})):_("",!0),e.plugin.mode==="client"?(s(),u(o,{key:3,n:"orange",textContent:"client"})):_("",!0)])]),_:1},8,["filepath"]),e.plugin.metric?.duration!=null?(s(),m("div",Y,[l(i,{duration:e.plugin.metric?.duration,factor:10},null,8,["duration"])])):_("",!0)])}}}),z=Object.assign(q,{__name:"PluginItem"}),J={class:"n-tip n-tip-base",flex:"~ col items-start","mx--4":"",px4:"",py4:""},R={flex:"~ items-center gap-1","font-bold":""},X=v({__name:"HelpTip",props:{title:{},icon:{}},setup(e){return(t,a)=>{const c=I,f=F("ContentSlot");return s(),m("div",J,[n("div",R,[e.icon?(s(),u(c,{key:0,icon:e.icon,class:"n-tip-icon"},null,8,["icon"])):_("",!0),n("div",null,C(e.title),1)]),n("div",null,[T(t.$slots,"default",{},()=>[l(f,{use:t.$slots.default,unwrap:"p"},null,8,["use"])])])])}}}),Z=Object.assign(X,{__name:"HelpTip"}),G={};function K(e,t){const a=Z;return s(),u(a,{title:"Performance Tip",icon:"carbon-meter",n:"lime6 dark:lime5"},{default:d(()=>[T(e.$slots,"default")]),_:3})}const Q=Object.assign(P(G,[["render",K]]),{__name:"HelpTipPerformance"}),U={},tt={class:"markdown-body"},nt={class:"markdown-body"};function et(e,t){const a=Q;return s(),m("div",tt,[n("template",null,[n("div",nt,[t[1]||(t[1]=n("h1",null,"Plugins",-1)),t[2]||(t[2]=n("p",null,[x("Nuxt plugins allow you to extend the functionality of the Nuxt runtime and the Vue instance. You can add plugins to the "),n("code",{"v-pre":""},"plugins/"),x(" directory and they will be automatically imported and registered.")],-1)),l(a,null,{default:d(()=>[...t[0]||(t[0]=[x(" Plugins always run before your application's runtime. The loading time of each plugin will directly impact your application's initial loading time. ",-1)])]),_:1}),t[3]||(t[3]=n("p",null,[n("a",{href:"https://nuxt.com/docs/guide/directory-structure/plugins",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1))])])])}const ot=P(U,[["render",et]]),st={pt4:""},it={class:"text-sm",flex:"~ gap-1 items-center justify-start","mt-3":""},gt=v({__name:"plugins",setup(e){const t=V(),a=j(),c=h(()=>{const p=t.value?.plugins||[],o=a.value?.metrics.clientPlugins()||[];return p.map(r=>{const i=typeof r=="string"?{src:r}:r;return{...i,metric:o.find(g=>g.src===i.src||g.src.startsWith(i.src))}})}),f=h(()=>{const p=a.value?.metrics.clientPlugins()||[],o=Math.min(...p.map(i=>i.start));return Math.max(...p.map(i=>i.end))-o});return(p,o)=>{const r=z,i=k,g=W,w=ot,N=A;return s(),m(b,null,[l(g,{icon:"carbon-plug",text:"Plugins",description:`Total plugins: ${c.value.length}`},{default:d(()=>[n("div",st,[(s(!0),m(b,null,E(c.value,(y,$)=>(s(),u(r,{key:y.src,plugin:y,index:$+1,"ml--4":"","border-base":"",py2:"",class:O($?"border-t":"")},null,8,["plugin","index","class"]))),128)),n("div",it,[o[0]||(o[0]=n("div",{"i-carbon-timer":"","text-lg":"",op75:""},null,-1)),o[1]||(o[1]=n("span",{op50:""},"Total execution time:",-1)),l(i,{duration:f.value,factor:10},null,8,["duration"])])])]),_:1},8,["description"]),l(N,null,{default:d(()=>[l(w)]),_:1})],64)}}});export{gt as default};
