import{_ as S}from"./nbadge-hhw3aa8r.js";import{_ as T}from"./filepath-item.vue-l7pl1gvj.js";import{_ as k}from"./duration-display.vue-onla0yr8.js";import{I as D,av as B,E as V,_ as I,aw as E,b as F}from"./h48l6b7a.js";import{l as v,m as h,R as s,U as _,V as n,a6 as C,a1 as u,a0 as f,N as p,X as d,S as H,W as P,a7 as x,F as b,ac as W,Z as L}from"./vendor/json-editor-vue-hrh84odz.js";import{_ as M}from"./nsection-block-m2ivsm2j.js";import{_ as R}from"./help-fab.vue-fjxqso9x.js";import"./vendor/unocss-cbkcukyd.js";import"./vendor/shiki-nyzr6cds.js";import"./nicon-title.vue-evdbm4ef.js";const j={flex:"~ gap2","items-center":""},z={w8:"","text-right":"","text-sm":"",op25:""},A={key:0,"flex-auto":"","text-right":""},U=v({__name:"PluginItem",props:{plugin:{},index:{}},setup(m){const e=m,r=D(),a=h(()=>B(e.plugin.src,r.value?.rootDir||"").path);return(t,l)=>{const o=S,c=T,i=k;return s(),_("div",j,[n("div",z,C(t.index),1),u(c,{filepath:e.plugin.src,subpath:!0},{default:f(()=>[n("div",null,[a.value.startsWith("#")?(s(),p(o,{key:0,n:"rose",textContent:"virtual"})):a.value.startsWith(".")?d("",!0):(s(),p(o,{key:1,n:"gray",textContent:"module"})),t.plugin.mode==="server"?(s(),p(o,{key:2,n:"teal",textContent:"server"})):d("",!0),t.plugin.mode==="client"?(s(),p(o,{key:3,n:"orange",textContent:"client"})):d("",!0)])]),_:1},8,["filepath"]),t.plugin.metric?.duration!=null?(s(),_("div",A,[u(i,{duration:t.plugin.metric?.duration,factor:10},null,8,["duration"])])):d("",!0)])}}}),X={class:"n-tip n-tip-base",flex:"~ col items-start","mx--4":"",px4:"",py4:""},Y={flex:"~ items-center gap-1","font-bold":""},Z=v({__name:"HelpTip",props:{title:{},icon:{}},setup(m){return(e,r)=>{const a=V,t=H("ContentSlot");return s(),_("div",X,[n("div",Y,[e.icon?(s(),p(a,{key:0,icon:e.icon,class:"n-tip-icon"},null,8,["icon"])):d("",!0),n("div",null,C(e.title),1)]),n("div",null,[P(e.$slots,"default",{},()=>[u(t,{use:e.$slots.default,unwrap:"p"},null,8,["use"])])])])}}}),q={};function G(m,e){const r=Z;return s(),p(r,{title:"Performance Tip",icon:"carbon-meter",n:"lime6 dark:lime5"},{default:f(()=>[P(m.$slots,"default")]),_:3})}const J=I(q,[["render",G]]),K={class:"markdown-body"},O={__name:"plugins",setup(m,{expose:e}){return e({frontmatter:{}}),(a,t)=>{const l=J;return s(),_("div",K,[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",null,"plugins/"),x(" directory and they will be automatically imported and registered.")],-1)),u(l,null,{default:f(()=>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}),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))])}}},Q={pt4:""},tt={class:"text-sm",flex:"~ gap-1 items-center justify-start","mt-3":""},pt=v({__name:"plugins",setup(m){const e=E(),r=F(),a=h(()=>{const l=e.value?.plugins||[],o=r.value?.metrics.clientPlugins()||[];return l.map(c=>{const i=typeof c=="string"?{src:c}:c;return{...i,metric:o.find(g=>g.src===i.src||g.src.startsWith(i.src))}})}),t=h(()=>{const l=r.value?.metrics.clientPlugins()||[],o=Math.min(...l.map(i=>i.start));return Math.max(...l.map(i=>i.end))-o});return(l,o)=>{const c=U,i=k,g=M,N=O,w=R;return s(),_(b,null,[u(g,{icon:"carbon-plug",text:"Plugins",description:`Total plugins: ${a.value.length}`},{default:f(()=>[n("div",Q,[(s(!0),_(b,null,W(a.value,(y,$)=>(s(),p(c,{key:y.src,plugin:y,index:$+1,"ml--4":"","border-base":"",py2:"",class:L($?"border-t":"")},null,8,["plugin","index","class"]))),128)),n("div",tt,[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)),u(i,{duration:t.value,factor:10},null,8,["duration"])])])]),_:1},8,["description"]),u(w,null,{default:f(()=>[u(N)]),_:1})],64)}}});export{pt as default};
