import{_ as D}from"./liR6BZS3.js";import{_ as S}from"./CYbF-3Z7.js";import{_ as C}from"./alICnoxW.js";import{d as v,a9 as B,a as y,bc as V,o,m as _,k as n,t as P,i as u,f,h as p,p as d,as as F,a8 as N,a4 as H,q as I,j as x,v as h,be as E,ak as W,F as k,n as j,D as L}from"./zEcrVex8.js";import{_ as M}from"./CtHtR2Xl.js";import{_ as q}from"./tPM_oRvF.js";import"./anMKTYBY.js";const z={flex:"~ gap2","items-center":""},A={w8:"","text-right":"","text-sm":"",op25:""},R={key:0,"flex-auto":"","text-right":""},Y=v({__name:"PluginItem",props:{plugin:{},index:{}},setup(m){const e=m,a=B(),l=y(()=>V(e.plugin.src,a.value?.rootDir||"").path);return(t,c)=>{const r=D,s=S,i=C;return o(),_("div",z,[n("div",A,P(t.index),1),u(r,{filepath:e.plugin.src,subpath:!0},null,8,["filepath"]),n("div",null,[f(l).startsWith("#")?(o(),p(s,{key:0,n:"rose",textContent:"virtual"})):f(l).startsWith(".")?d("",!0):(o(),p(s,{key:1,n:"gray",textContent:"module"})),t.plugin.mode==="server"?(o(),p(s,{key:2,n:"teal",textContent:"server"})):d("",!0),t.plugin.mode==="client"?(o(),p(s,{key:3,n:"orange",textContent:"client"})):d("",!0)]),t.plugin.metric?.duration!=null?(o(),_("div",R,[u(i,{duration:t.plugin.metric?.duration,factor:10},null,8,["duration"])])):d("",!0)])}}}),G={class:"n-tip n-tip-base",flex:"~ col items-start","mx--4":"",px4:"",py4:""},J={flex:"~ items-center gap-1","font-bold":""},K=v({__name:"HelpTip",props:{title:{},icon:{}},setup(m){return(e,a)=>{const l=H,t=F("ContentSlot");return o(),_("div",G,[n("div",J,[e.icon?(o(),p(l,{key:0,icon:e.icon,class:"n-tip-icon"},null,8,["icon"])):d("",!0),n("div",null,P(e.title),1)]),n("div",null,[N(e.$slots,"default",{},()=>[u(t,{use:e.$slots.default,unwrap:"p"},null,8,["use"])])])])}}}),O={};function Q(m,e){const a=K;return o(),p(a,{title:"Performance Tip",icon:"carbon-meter",n:"lime6 dark:lime5"},{default:x(()=>[N(m.$slots,"default")]),_:3})}const U=I(O,[["render",Q]]),X={class:"markdown-body"},Z={__name:"plugins",setup(m,{expose:e}){return e({frontmatter:{}}),(l,t)=>{const c=U;return o(),_("div",X,[t[1]||(t[1]=n("h1",null,"Plugins",-1)),t[2]||(t[2]=n("p",null,[h("Nuxt plugins allow you to extend the functionality of the Nuxt runtime and the Vue instance. You can add plugins to the "),n("code",null,"plugins/"),h(" directory and they will be automatically imported and registered.")],-1)),u(c,null,{default:x(()=>t[0]||(t[0]=[h(" Plugins always run before your application's runtime. The loading time of each plugin will directly impact your application's initial loading time. ")])),_: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))])}}},tt=Z,nt={pt4:""},et={class:"text-sm",flex:"~ gap-1 items-center justify-start","mt-3":""},ut=v({__name:"plugins",setup(m){const e=E(),a=W(),l=y(()=>{const c=e.value?.plugins||[],r=a.value?.metrics.clientPlugins()||[];return c.map(s=>{const i=typeof s=="string"?{src:s}:s;return{...i,metric:r.find(g=>g.src===i.src||g.src.startsWith(i.src))}})}),t=y(()=>{const c=a.value?.metrics.clientPlugins()||[],r=Math.min(...c.map(i=>i.start));return Math.max(...c.map(i=>i.end))-r});return(c,r)=>{const s=Y,i=C,g=M,T=tt,w=q;return o(),_(k,null,[u(g,{icon:"carbon-plug",text:"Plugins",description:`Total plugins: ${f(l).length}`},{default:x(()=>[n("div",nt,[(o(!0),_(k,null,j(f(l),($,b)=>(o(),p(s,{key:$.src,plugin:$,index:b+1,"ml--4":"","border-base":"",py2:"",class:L(b?"border-t":"")},null,8,["plugin","index","class"]))),128)),n("div",et,[r[0]||(r[0]=n("div",{"i-carbon-timer":"","text-lg":"",op75:""},null,-1)),r[1]||(r[1]=n("span",{op50:""},"Total execution time:",-1)),u(i,{duration:f(t),factor:10},null,8,["duration"])])])]),_:1},8,["description"]),u(w,null,{default:x(()=>[u(T)]),_:1})],64)}}});export{ut as default};
