@nuxt/devtools 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/module-main.mjs +1 -1
- package/dist/client/200.html +11 -11
- package/dist/client/404.html +11 -11
- package/dist/client/_nuxt/__blank-9iu4tv0f.js +1 -0
- package/dist/client/_nuxt/{analyze-build-bc01194s.js → analyze-build-nqeql2rs.js} +1 -1
- package/dist/client/_nuxt/{assets-gg6tjz6t.js → assets-jvf69cxf.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/ab41567e-1b8e-4e48-840c-591dd62a1246.json +1 -0
- package/dist/client/_nuxt/{client-klf75x38.js → client-dgt05ivb.js} +1 -1
- package/dist/client/_nuxt/{code-diff.vue-bbo8eegp.js → code-diff.vue-i05ynbel.js} +1 -1
- package/dist/client/_nuxt/{code-snippets.vue-bs8dkort.js → code-snippets.vue-17pri79b.js} +1 -1
- package/dist/client/_nuxt/components-d1yojeh6.js +1 -0
- package/dist/client/_nuxt/components-tree-gcdwuwyn.js +1 -0
- package/dist/client/_nuxt/{composable-item.vue-c5sp1o62.js → composable-item.vue-ihurs8kc.js} +1 -1
- package/dist/client/_nuxt/{custom-_name_-ecwrjze9.js → custom-_name_-ik277266.js} +1 -1
- package/dist/client/_nuxt/{default-gmsazh48.js → default-c97elafe.js} +1 -1
- package/dist/client/_nuxt/{duration-display.vue-h3qa2740.js → duration-display.vue-n7a3864v.js} +1 -1
- package/dist/client/_nuxt/entry.css-kzp9yj98.css +1 -0
- package/dist/client/_nuxt/{error-404-h4fqrpm0.js → error-404-chhw212o.js} +1 -1
- package/dist/client/_nuxt/{error-500-kqeq0g89.js → error-500-oi6j6wh4.js} +1 -1
- package/dist/client/_nuxt/{error-obpt6k3h.js → error-kcw3c5n2.js} +1 -1
- package/dist/client/_nuxt/{filepath-item.vue-n7veglgp.js → filepath-item.vue-jp3k05dh.js} +1 -1
- package/dist/client/_nuxt/full-j1e8c0fm.js +1 -0
- package/dist/client/_nuxt/{help-fab.vue-fdt1wizc.js → help-fab.vue-kqlhhn29.js} +1 -1
- package/dist/client/_nuxt/{hooks-efkra01q.js → hooks-bbeec6rm.js} +1 -1
- package/dist/client/_nuxt/{imports-ttyvta35.js → imports-cadcbs1b.js} +1 -1
- package/dist/client/_nuxt/index-f7gtpn4a.js +2 -0
- package/dist/client/_nuxt/{index-jig07ory.js → index-h6urifqi.js} +1 -1
- package/dist/client/_nuxt/{launch-page.vue-sa4rwdv5.js → launch-page.vue-opmg26gw.js} +1 -1
- package/dist/client/_nuxt/{modules-clzspzzh.js → modules-dckgmu9u.js} +1 -1
- package/dist/client/_nuxt/nbadge-ggvrch1r.js +1 -0
- package/dist/client/_nuxt/{ncheckbox.vue-h2ndpucy.js → ncheckbox.vue-ir8t2t9x.js} +1 -1
- package/dist/client/_nuxt/{ncode-block.vue-bfbbo3c9.js → ncode-block.vue-d334f2dp.js} +1 -1
- package/dist/client/_nuxt/{ndrawer.vue-of9w84z3.js → ndrawer.vue-fdnlfvql.js} +1 -1
- package/dist/client/_nuxt/{ndropdown.vue-fg6r3yd7.js → ndropdown.vue-haoov59z.js} +1 -1
- package/dist/client/_nuxt/{nicon-title.vue-g9trlv29.js → nicon-title.vue-ef3vf9hr.js} +1 -1
- package/dist/client/_nuxt/{nlink.vue-jt5fxemk.js → nlink.vue-eq8gk3iz.js} +1 -1
- package/dist/client/_nuxt/{nmarkdown.vue-nnge8mex.js → nmarkdown.vue-bwv440ol.js} +1 -1
- package/dist/client/_nuxt/{nnavbar.vue-lvh4ek84.js → nnavbar.vue-jap952ju.js} +1 -1
- package/dist/client/_nuxt/none-oo3u4xub.js +1 -0
- package/dist/client/_nuxt/{nsection-block-oxvuqj5d.js → nsection-block-hjiyf44n.js} +1 -1
- package/dist/client/_nuxt/{nselect-tabs.vue-jbavzq5x.js → nselect-tabs.vue-ctgj28x2.js} +1 -1
- package/dist/client/_nuxt/{nselect.vue-bpqzr4w7.js → nselect.vue-kb4ychx8.js} +1 -1
- package/dist/client/_nuxt/nxp3p1l5.js +16 -0
- package/dist/client/_nuxt/{open-graph-m7tynilx.js → open-graph-fwcucpwr.js} +1 -1
- package/dist/client/_nuxt/{overview-c0efrbe7.js → overview-du74wcc9.js} +1 -1
- package/dist/client/_nuxt/{pages-ehpry05k.js → pages-m3ksw3nx.js} +1 -1
- package/dist/client/_nuxt/{payload-h6m4z8q8.js → payload-np4rk8uw.js} +1 -1
- package/dist/client/_nuxt/pinia-n87t5bm8.js +1 -0
- package/dist/client/_nuxt/{plugins-kw7bkrlj.js → plugins-jcz0d5g6.js} +1 -1
- package/dist/client/_nuxt/{runtime-configs-ikmw9eyd.js → runtime-configs-h7di7gvu.js} +1 -1
- package/dist/client/_nuxt/{server-route-inputs.vue-mdebn387.js → server-route-inputs.vue-hs0k8usl.js} +1 -1
- package/dist/client/_nuxt/{server-routes-ni30gkww.js → server-routes-chengpen.js} +2 -2
- package/dist/client/_nuxt/{server-tasks-kyepxd0d.js → server-tasks-il5b1l64.js} +1 -1
- package/dist/client/_nuxt/{settings-hpl0aq9k.js → settings-k964fibj.js} +1 -1
- package/dist/client/_nuxt/{stacktrace-list.vue-o3y775xx.js → stacktrace-list.vue-n51hjl65.js} +1 -1
- package/dist/client/_nuxt/{state-components-gjywkn4p.js → state-components-j9dsopcn.js} +1 -1
- package/dist/client/_nuxt/{state-editor.vue-i1wc6lzu.js → state-editor.vue-eev8247c.js} +1 -1
- package/dist/client/_nuxt/{state-modules-cg77e2k8.js → state-modules-jx57qxz7.js} +1 -1
- package/dist/client/_nuxt/{storage-fk7l5l70.js → storage-c7x4faia.js} +1 -1
- package/dist/client/_nuxt/{terminals-osgm1ufi.js → terminals-lb2z98e5.js} +1 -1
- package/dist/client/_nuxt/{timeline-o0jhmda4.js → timeline-bpt56wqz.js} +1 -1
- package/dist/client/_nuxt/vendor/{json-editor-vue-mdfcgt41.js → json-editor-vue-f126ciji.js} +1 -1
- package/dist/client/_nuxt/vendor/shiki-hhqxa887.js +161 -0
- package/dist/client/_nuxt/{virtual-files-lddzeigf.js → virtual-files-o77aoqwj.js} +1 -1
- package/dist/client/_nuxt/{vue-virtual-scroller.esm-k82i9hy2.js → vue-virtual-scroller.esm-dbbmx9wu.js} +1 -1
- package/dist/client/index.html +11 -11
- package/dist/module.json +1 -1
- package/package.json +7 -7
- package/dist/client/_nuxt/__blank-c3ogaker.js +0 -1
- package/dist/client/_nuxt/builds/meta/dbd07eab-7668-4aa4-b9a0-35fc744ce950.json +0 -1
- package/dist/client/_nuxt/components-esse2omz.js +0 -1
- package/dist/client/_nuxt/components-tree-5is5wtsc.js +0 -1
- package/dist/client/_nuxt/d8ykqm74.js +0 -16
- package/dist/client/_nuxt/entry.css-bgn3dvs3.css +0 -1
- package/dist/client/_nuxt/full-dim3uzh3.js +0 -1
- package/dist/client/_nuxt/index-l7vmcxxc.js +0 -2
- package/dist/client/_nuxt/nbadge-ntuzwfj6.js +0 -1
- package/dist/client/_nuxt/none-c68tef68.js +0 -1
- package/dist/client/_nuxt/pinia-dwfgs7y1.js +0 -1
- package/dist/client/_nuxt/vendor/shiki-fpe2sz4h.js +0 -87
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{ad as oe,I as ae,J as H,W as J,e as U,ae as V,af as ne,ag as se,ah as re,_ as ie,ai as le,aj as ce,G as de,ak as pe,al as ue,am as me,an as G,v as ge}from"./
|
|
1
|
+
import{ad as oe,I as ae,J as H,W as J,e as U,ae as V,af as ne,ag as se,ah as re,_ as ie,ai as le,aj as ce,G as de,ak as pe,al as ue,am as me,an as G,v as ge}from"./nxp3p1l5.js";import{_ as he}from"./nnavbar.vue-jap952ju.js";import{_ as P}from"./nlink.vue-eq8gk3iz.js";import{_ as q}from"./nsection-block-hjiyf44n.js";import{_ as _e}from"./ncode-block.vue-d334f2dp.js";import{k as N,l as C,b as I,O as A,$ as h,W as y,Q as t,U as e,S as n,ab as B,Y as O,a5 as u,F as S,a0 as p,a6 as $,u as g,X as L,ai as fe,n as ve,af as be,Z as we,a8 as z}from"./vendor/json-editor-vue-f126ciji.js";import{_ as xe}from"./help-fab.vue-kqlhhn29.js";import"./vendor/unocss-mnpxkox6.js";import"./vendor/shiki-hhqxa887.js";import"./nicon-title.vue-ef3vf9hr.js";import"./client-dgt05ivb.js";const W=[{name:"title",suggestion:"required",head:{title:"[title]"},seoMeta:{title:"[title]"},docs:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title",description:"A concise and descriptive title for the browser that accurately summarizes the content of the page."},{name:"description",suggestion:"required",head:{meta:[{name:"description",content:"[description]"}]},seoMeta:{description:"[description]"},description:"A one to two sentence summary for search engines that includes relevant keywords to improve visibility in search results."},{name:"icon",suggestion:"recommended",head:{link:[{rel:"icon",type:"image/png",href:"/favicon.png"}]},description:"A small image that appears in the browser tab and bookmark menu to help users easily identify the page."},{name:"lang",suggestion:"recommended",head:{htmlAttrs:{lang:"en"}},description:"The primary language of the page to help search engines and browsers understand the content."},{name:"og:title",suggestion:"recommended",head:{meta:[{property:"og:title",content:"[og:title]"}]},seoMeta:{ogTitle:"[og:title]"},docs:"https://ogp.me/#metadata",description:"A title for the link preview used by social media platforms."},{name:"og:description",suggestion:"recommended",head:{meta:[{property:"og:description",content:"[og:description]"}]},seoMeta:{ogDescription:"[og:description]"},docs:"https://ogp.me/#metadata",description:"A description for the link preview used by social media platforms."},{name:"og:image",suggestion:"recommended",head:{meta:[{property:"og:image",content:"[og:image]"}]},seoMeta:{ogImage:"[og:image]"},docs:"https://ogp.me/#metadata",description:"An image for the link preview used by social media platforms."},{name:"og:url",suggestion:"recommended",head:{meta:[{property:"og:url",content:"[og:url]"}]},seoMeta:{ogUrl:"[og:url]"},docs:"https://ogp.me/#metadata",description:"A canonical URL for the link preview used to specify the preferred URL to display in search engine results and social media previews when multiple URLs may point to the same page."},{name:"twitter:title",suggestion:"optional",head:{meta:[{name:"twitter:title",content:"[twitter:title]"}]},seoMeta:{twitterTitle:"[twitter:title]"},docs:"https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards",description:"A title for the Twitter card used to provide a preview of the content shared on the page."},{name:"twitter:description",suggestion:"optional",head:{meta:[{name:"twitter:description",content:"[twitter:description]"}]},seoMeta:{twitterDescription:"[twitter:description]"},docs:"https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards",description:"A description for the Twitter card used to provide a preview of the content shared on the page."},{name:"twitter:image",suggestion:"optional",head:{meta:[{name:"twitter:image",content:"[twitter:image]"}]},seoMeta:{twitterImage:"[twitter:image]"},docs:"https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards",description:"An image for the Twitter card used to provide a preview of the content shared on the page."},{name:"twitter:card",suggestion:"optional",head:{meta:[{name:"twitter:card",content:"summary"}]},seoMeta:{twitterCard:"summary"},docs:"https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards",description:"The type of Twitter card to use, which determines the type of card to display in link previews on Twitter."}],ye={flex:"~ wrap","mt--2":"","w-full":"","flex-none":""},ke=["onClick"],$e={key:0,"x-divider":""},Te={key:1,"x-divider":""},Se={flex:"~ gap-1 items-center",class:"px2 pt2",lg:"px4 py2"},Ce={"w-full":"",p2:"",op75:""},Ne={key:1,m4:"",flex:"~ col gap-2"},Me={flex:"~ gap-1 wrap items-center"},Oe={key:1},Ae={flex:"~ gap-2",n:"sm primary",absolute:"","right-2":"","top-2":""},Ie=N({__name:"OpenGraphMissingTabs",props:{tags:{},matchedRouteFilepath:{}},setup(v){const s=v,l=C(()=>W.filter(d=>!s.tags?.some(o=>o.name===d.name))),a=C(()=>{let d={};const o={};l.value.forEach(m=>{m.seoMeta?Object.assign(o,m.seoMeta):d=oe(d,m.head)});const w=[];if(Object.keys(o).length){const m=JSON.stringify(o,null,2).replace(/"([^"]+)":/g,"$1:").replace(/"/g,"'");w.push(`useSeoMeta(${m})`)}if(Object.keys(d).length){const m=JSON.stringify(d,null,2).replace(/"([^"]+)":/g,"$1:").replace(/"/g,"'");w.push(`useHead(${m})`)}return w.join(`
|
|
2
2
|
|
|
3
3
|
`)}),c=ae(),k=H(),b=["Missing Tags","Code Snippet"],_=I(b[0]);return(d,o)=>{const w=P,m=J,T=U,M=_e,R=q;return l.value.length?(t(),A(R,{key:0,text:"Missing Tags",description:`${l.value.length} missing tags`,icon:"carbon:warning-other","header-class":"text-orange op100! [[open]_&]:text-inherit",padding:!1},{default:h(()=>[e("div",ye,[(t(),n(S,null,B(b,(r,i)=>e("button",{key:i,px4:"",py2:"",border:"r t base",hover:"bg-active",class:O(r===_.value?"":"border-b"),onClick:f=>_.value=r},[e("div",{class:O(r===_.value?"":"op30"),capitalize:""},u(r),3)],10,ke)),64)),o[3]||(o[3]=e("div",{border:"b base","flex-auto":""},null,-1))]),_.value===b[0]?(t(),A(m,{key:0,grid:"~ cols-[1fr] lg:cols-[max-content_1fr]",m4:"","items-center":"","justify-between":"","of-hidden":""},{default:h(()=>[(t(!0),n(S,null,B(l.value,(r,i)=>(t(),n(S,{key:i},[i?(t(),n("div",$e)):y("",!0),i?(t(),n("div",Te)):y("",!0),e("div",Se,[o[4]||(o[4]=e("div",{"i-carbon-warning":"","text-orange":""},null,-1)),p(w,{"op-50":"",href:r.docs,target:"_blank",n:"orange"},{default:h(()=>[$(u(r.name),1)]),_:2},1032,["href"])]),e("div",Ce,u(r.description),1)],64))),128))]),_:1})):(t(),n("div",Ne,[e("p",Me,[p(T,{icon:"carbon-copy",n:"xs","px-2":"",onClick:o[0]||(o[0]=r=>g(c)(a.value,"open-graph-suggestion"))},{default:h(()=>o[5]||(o[5]=[$(" Copy ")])),_:1}),o[7]||(o[7]=$(" the following code snippet and paste it into your ")),d.matchedRouteFilepath?(t(),A(T,{key:0,icon:"carbon-launch",n:"xs","px-2":"",onClick:o[1]||(o[1]=r=>g(k)(d.matchedRouteFilepath))},{default:h(()=>o[6]||(o[6]=[$(" page component ")])),_:1})):(t(),n("span",Oe,"page component")),o[8]||(o[8]=$(" to full fill the missing tags. "))]),p(m,{relative:"","n-code-block":""},{default:h(()=>[p(M,{code:a.value,lang:"ts",lines:!1,"w-full":"","of-auto":"",p3:""},null,8,["code"]),e("div",Ae,[p(T,{icon:"carbon-copy",onClick:o[2]||(o[2]=r=>g(c)(a.value,"open-graph-suggestion"))},{default:h(()=>o[9]||(o[9]=[$(" Copy ")])),_:1})])]),_:1})]))]),_:1},8,["description"])):y("",!0)}}}),Be={class:"max-w-[524px] min-w-[524px] cursor-pointer bg-base"},Le={class:"break-words border border-base px-[12px] py-[10px] antialiased"},Re={class:"overflow-hidden truncate whitespace-nowrap text-[12px] leading-[11px] uppercase op50"},je={class:"block h-[46px] max-h-[46px] border-separate select-none overflow-hidden break-words text-left",style:{"border-spacing":"0px"}},Fe={class:"mt-[3px] truncate pt-[2px] text-[16px] font-semibold leading-[20px]"},De={class:"mt-[3px] block h-[18px] max-h-[80px] border-separate select-none overflow-hidden truncate whitespace-nowrap break-words text-left text-[14px] leading-[20px] op50",style:{"-webkit-line-clamp":"1","border-spacing":"0px","-webkit-box-orient":"vertical"}},ze=N({__name:"SocialFacebook",props:{card:{}},setup(v){return(s,l)=>(t(),n("div",Be,[e("div",{class:"h-[274px] border border-b-0 border-base bg-cover bg-center bg-no-repeat",style:L({backgroundImage:`url(${JSON.stringify(s.card.image)})`})},null,4),e("div",Le,[e("div",Re,u(s.card.url),1),e("div",je,[e("div",Fe,u(s.card.title),1),e("div",De,u(s.card.description),1)])])]))}}),Ee={class:"max-w-[438px] min-w-[438px] of-hidden border border-base rounded-[16px] bg-base -outline-offset-1",style:{"font-family":"TwitterChirp, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif"}},Ge={class:"break-words border-base p-[0.75em] antialiased",flex:"~ col justify-center gap-[2px]"},He={class:"overflow-hidden truncate whitespace-nowrap text-[15px] leading-[20px] lowercase op50"},Je={class:"m-0 truncate text-[15px] font-semibold leading-[20px]"},Ue={class:"line-clamp-2 select-none overflow-hidden break-words text-left text-[15px] leading-[20px] op50"},Ve=N({__name:"SocialTwitter",props:{tags:{}},setup(v){const s=v,l=C(()=>V(s.tags,{title:[{tag:"title"}],image:[{tag:"meta",name:"twitter:image"},{tag:"meta",name:"og:image"}],imageAlt:[{tag:"meta",name:"twitter:image:alt"}],description:[{tag:"meta",name:"twitter:description"},{tag:"meta",name:"description"}],favicon:[{tag:"link",name:"icon"}]})),a=C(()=>l.value.image?s.tags.find(c=>c.tag==="meta"&&c.name==="twitter:card")?.value||"summary_large_image":"summary");return(c,k)=>(t(),n("div",Ee,[e("div",{class:O(["cursor-pointer overflow-hidden leading-[1.3em]",a.value==="summary_large_image"?"":"flex"]),hover:"bg-[#88888805]"},[a.value==="summary_large_image"?(t(),n("div",{key:0,class:"h-[220px] border-b border-base bg-cover bg-center bg-no-repeat",style:L({backgroundImage:`url(${JSON.stringify(l.value.image)})`})},null,4)):(t(),n("div",{key:1,class:"h-[129px] w-[129px] flex-none border-r border-base bg-cover bg-center bg-no-repeat",style:L({backgroundImage:`url(${JSON.stringify(l.value.image)})`})},null,4)),e("div",Ge,[e("div",He,u(l.value.url),1),e("div",Je,u(l.value.title),1),e("div",Ue,u(l.value.description),1)])],2)]))}}),Pe={class:"max-w-[520px] min-w-[520px] cursor-pointer overflow-hidden border border-base rounded-[2px] shadow-md bg-base"},qe={class:"break-words p-[10px] antialiased"},We={class:"block h-auto max-h-[50px] border-separate select-none break-words text-left",style:{"border-spacing":"0px"}},Ke={class:"pb-[2px] text-[16px] font-semibold leading-[24px]"},Ye={class:"overflow-hidden truncate whitespace-nowrap text-xs font-normal uppercase op85"},Qe=N({__name:"SocialLinkedin",props:{card:{}},setup(v){return(s,l)=>(t(),n("div",Pe,[e("div",{class:"h-[270px] border-b border-base bg-cover bg-center bg-no-repeat",style:L({backgroundImage:`url(${JSON.stringify(s.card.image)})`})},null,4),e("div",qe,[e("div",We,[e("div",Ke,u(s.card.title),1),e("div",Ye,u(s.card.url),1)])])]))}}),Xe={class:"relative max-w-[420px] min-w-[420px] rounded-[16px] rounded-bl-0 py-[6px] leading-[18px] drop-shadow-sm drop-shadow-color-[#10232f26] bg-base"},Ze={class:"pl-[10px] pr-[8px]"},et={class:"text-[#3390ec] leading-normal underline"},tt={class:"quote w-full flex"},ot={class:"flex flex-col gap-1"},at={key:0,class:"my-[3px] overflow-hidden rounded"},nt=["src"],st={class:"cursor-pointer text-sm text-[#3390ec]"},rt={class:"cursor-pointer text-sm"},it={class:"cursor-pointer text-sm"},lt={class:"flex justify-end text-xs text-[#707579]"},ct=N({__name:"SocialTelegram",props:{card:{}},setup(v){const s=ne(),l=se(re(),"HH:mm");return(a,c)=>(t(),n("div",Xe,[e("div",Ze,[e("div",et,u(a.card.url),1),e("div",tt,[e("div",ot,[a.card.image?(t(),n("div",at,[e("img",{class:"h-full max-w-full w-full rounded object-cover",src:a.card.image},null,8,nt)])):y("",!0),e("div",st,[e("strong",null,u(g(s).hostname),1)]),e("div",rt,[e("strong",null,u(a.card.title),1)]),e("div",it,u(a.card.description),1)])]),e("div",lt,[e("span",null,u(g(l)),1)])]),c[0]||(c[0]=e("svg",{width:"11",height:"20",viewBox:"0 0 11 20",xmlns:"http://www.w3.org/2000/svg",class:"absolute bottom-0 ml-[-8.4px] translate-y-px text-white"},[e("g",{transform:"translate(9 -14)","fill-rule":"evenodd"},[e("path",{id:"corner-fill",d:"M-6 16h6v17c-.193-2.84-.876-5.767-2.05-8.782-.904-2.325-2.446-4.485-4.625-6.48A1 1 0 01-6 16z",transform:"matrix(1 0 0 -1 0 49)",fill:"currentColor"})])],-1))]))}}),dt=ie(ct,[["__scopeId","data-v-cc2245a1"]]),pt={flex:"~ col","w-full":""},ut={flex:"~ wrap","w-full":"","flex-none":""},mt=["onClick"],gt={flex:"~ items-center justify-center","flex-auto":"",p4:"","n-panel-grids":""},ht={key:0},_t={key:1},ft={key:2},vt={key:3},bt=N({__name:"SocialPreviewGroup",props:{tags:{}},setup(v){const s=v,l=["twitter","facebook","linkedin","telegram"],a=le("nuxt-devtools-social-preview-tab",l[0]),c=C(()=>V(s.tags,{title:[{tag:"title"}],image:[{tag:"meta",name:"og:image"}],imageAlt:[{tag:"meta",name:"og:image:alt"}],description:[{tag:"meta",name:"og:description"},{tag:"meta",name:"description"}],favicon:[{tag:"link",name:"icon"}]}));return(k,b)=>{const _=ze,d=Ve,o=Qe,w=dt;return t(),n("div",pt,[e("div",ut,[(t(),n(S,null,B(l,(m,T)=>e("button",{key:T,px4:"",py2:"",border:"r base",hover:"bg-active",class:O(m===g(a)?"":"border-b"),onClick:M=>a.value=m},[e("div",{class:O(m===g(a)?"":"op30"),capitalize:""},u(m),3)],10,mt)),64)),b[0]||(b[0]=e("div",{border:"b base","flex-auto":""},null,-1))]),e("div",gt,[g(a)==="facebook"?(t(),n("div",ht,[p(_,{card:c.value},null,8,["card"])])):g(a)==="twitter"?(t(),n("div",_t,[p(d,{tags:k.tags},null,8,["tags"])])):g(a)==="linkedin"?(t(),n("div",ft,[p(o,{card:c.value},null,8,["card"])])):g(a)==="telegram"?(t(),n("div",vt,[p(w,{card:c.value},null,8,["card"])])):y("",!0)])])}}}),wt={class:"markdown-body"},xt={__name:"open-graph",setup(v,{expose:s}){return s({frontmatter:{}}),(a,c)=>(t(),n("div",wt,c[0]||(c[0]=[fe('<h1>Open Graph</h1><p>Nuxt provides several different ways to manage your meta tags using <a href="https://unhead.harlanzw.com/" target="_blank" rel="noopener"><code>unhead</code></a>. Improve your Nuxt app’s SEO with powerful head config, composables and components.</p><p><a href="https://nuxt.com/docs/getting-started/seo-meta" target="_blank" rel="noopener">Learn more on the documentation</a></p><hr><p>You can also find how open graph specs are defined in:</p><ul><li><a href="https://ogp.me/" target="_blank" rel="noopener">The Open Graph protocol</a></li><li><a href="https://developer.twitter.com/en/docs/twitter-for-websites/cards/guides/getting-started" target="_blank" rel="noopener">Twitter Cards</a></li></ul>',6)])))}},yt=xt,kt={grid:"~ lg:cols-2","h-full":"","w-full":"","of-hidden":""},$t={"flex-auto":"","of-auto":""},Tt={"flex-none":"",flex:"~ gap2 items-center"},St={flex:"~ col"},Ct={key:0,"x-divider":""},Nt={key:1,"x-divider":""},Mt={mr2:"",px4:"",py2:""},Gt=N({__name:"open-graph",setup(v){const s=I(0),l=ce(),a=de(async()=>(s.value,(await l.value?.resolveTags()).map(i=>{const f=i.props||{};return i.tag==="htmlAttrs"&&f.lang?{tag:"html",name:"lang",value:f.lang}:f.charset?{tag:"meta",name:"charset",value:f.charset}:{tag:i.tag,name:f.property??f.name??f.rel??i.tag,value:f.content??f.href??i.textContent??JSON.stringify(f)}})),[]),c=I(!0);function k(){s.value+=1}const b=pe(),_=ue(),d=I(""),o=me(),w=H();async function m(){d.value!==_.value.path&&b.value.push(d.value||"/")}const T=C(()=>d.value===_.value.path?[]:b.value.resolve(d.value||"/").matched),M=C(()=>{const r=o.value.find(i=>i.path===_.value?.matched?.[0]?.path);return r?.file||r?.meta?.file});function R(r){return W.find(i=>i.name===r.name)?.docs}return G(_).toBeTruthy().then(r=>{d.value=r.path}),G(b).toBeTruthy().then(r=>{r.afterEach(()=>{ve(()=>{d.value=_.value.path,setTimeout(k,200),setTimeout(k,800)})})}),(r,i)=>{const f=ge,j=U,K=he,E=P,Y=J,Q=q,X=Ie,Z=bt,ee=yt,te=xe,F=be("tooltip");return t(),n(S,null,[e("div",kt,[e("div",$t,[p(K,null,{search:h(()=>[p(f,{modelValue:d.value,"onUpdate:modelValue":i[0]||(i[0]=x=>d.value=x),placeholder:"Route",icon:"carbon-direction-right-01 scale-y--100",n:"primary","flex-auto":"","font-mono":"",class:O(["px-5 py-2",g(_)?.path===d.value?"":T.value.length?"text-green":"text-orange"]),onKeydown:we(m,["enter"])},null,8,["modelValue","class"])]),actions:h(()=>[e("div",Tt,[M.value?z((t(),A(j,{key:0,"text-lg":"",border:!1,icon:"carbon:launch",title:"Open file in editor",onClick:i[1]||(i[1]=x=>g(w)(M.value))},null,512)),[[F,"Open file in editor"]]):y("",!0),z(p(j,{"text-lg":"",border:!1,icon:"carbon:reset",title:"Refresh Data",onClick:k},null,512),[[F,"Refresh Data"]]),z(p(j,{"text-lg":"",border:!1,icon:c.value?"carbon:side-panel-open":"carbon:open-panel-right",title:"Toggle Preview",onClick:i[2]||(i[2]=x=>c.value=!c.value)},null,8,["icon"]),[[F,"Toggle Preview"]])])]),_:1}),e("div",St,[p(Q,{text:"Tags",icon:"carbon:tag-group"},{default:h(()=>[p(Y,{grid:"~ cols-[max-content_1fr]","items-center":"","justify-between":"","of-hidden":""},{default:h(()=>[(t(!0),n(S,null,B(g(a),(x,D)=>(t(),n(S,{key:D},[D?(t(),n("div",Ct)):y("",!0),D?(t(),n("div",Nt)):y("",!0),e("div",Mt,[p(E,{op50:"",href:R(x),target:"_blank",n:"primary"},{default:h(()=>[$(u(x.name),1)]),_:2},1032,["href"])]),p(E,{href:String(x.value).match(/^https?:\/\//)?x.value:void 0,target:"_blank","w-full":"",p2:"","font-mono":"",n:"primary"},{default:h(()=>[$(u(x.value),1)]),_:2},1032,["href"])],64))),128))]),_:1})]),_:1}),p(X,{tags:g(a),"matched-route-filepath":M.value},null,8,["tags","matched-route-filepath"])])]),c.value&&g(a)?.length?(t(),A(Z,{key:0,tags:g(a),"flex-none":"","border-base":"","lt-lg":"border-t",lg:"h-full w-140 border-l"},null,8,["tags"])):y("",!0)]),p(te,null,{default:h(()=>[p(ee)]),_:1})],64)}}});export{Gt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Q as M,H as O,a8 as $,ao as z,ap as P,l as E,c as F,aq as g,ar as k,as as H,a3 as G,i as K,h as Q,d as U,a as W,w as q,e as J}from"./
|
|
1
|
+
import{Q as M,H as O,a8 as $,ao as z,ap as P,l as E,c as F,aq as g,ar as k,as as H,a3 as G,i as K,h as Q,d as U,a as W,w as q,e as J}from"./nxp3p1l5.js";import{u as X,_ as Y}from"./state-modules-jx57qxz7.js";import{u as Z}from"./state-components-j9dsopcn.js";import{k as h,l as A,O as v,$ as n,Q as s,u as o,S as p,U as e,a0 as i,a5 as a,W as u,F as f,a6 as l}from"./vendor/json-editor-vue-f126ciji.js";import"./vendor/unocss-mnpxkox6.js";import"./vendor/shiki-hhqxa887.js";import"./nbadge-ggvrch1r.js";import"./ncode-block.vue-d334f2dp.js";import"./client-dgt05ivb.js";import"./ncheckbox.vue-ir8t2t9x.js";const c="1.6.1",tt={key:0},et={key:1,flex:"~ col gap2",ma:"","h-full":"","max-w-300":"","w-full":"",p5:"",px5:"","md:px20":""},ot={flex:"~ col","mt-5":"","items-center":"","md:mt-20":""},nt={op40:""},st={flex:"~ gap2 wrap"},lt={key:5,"pointer-events-none":"","min-w-40":"",p4:"","theme-card-lime":"",flex:"~ auto gap-6"},it={grid:"~ cols-[auto_auto] gap-x-5 items-center"},ut={"text-right":""},rt={"text-right":""},at={"text-right":""},dt={"text-right":""},pt={flex:"~ col gap2"},mt={flex:"~ gap-6 wrap","mt-5":"","items-center":"","justify-center":""},xt={flex:"col gap-2",mxa:"",hidden:"","w-100":"","text-sm":"",op50:"","md:flex":""},vt={flex:"~ gap-1","items-center":""},ft={flex:"~ gap-1","items-center":""},jt=h({__name:"overview",setup(gt){const b=M(),m=O(),D=Z(),y=$(),j=X(),B=z(),w=P(),I=E();function V(){K.value=!0,I.push("/")}const S=A(()=>b.value?.nuxt.vueApp.version),r=A(()=>b.value?.metrics.loading());function L(){Q()}return(C,t)=>{const R=U,x=W,_=Y,N=q,d=J,T=F;return s(),v(T,{"h-screen":"","w-full":"",flex:""},{default:n(()=>[o(m)?(s(),p("div",et,[t[40]||(t[40]=e("div",{"flex-auto":""},null,-1)),e("div",ot,[i(x,{flex:"~","mt--10":"","items-center":"","justify-center":"",to:"https://devtools.nuxt.com/",target:"_blank"},{default:n(()=>[i(R,{"h-10":""})]),_:1}),e("button",{mb6:"",mt3:"","text-center":"","text-sm":"",flex:"~ gap-1 wrap",onClick:V},[t[0]||(t[0]=e("span",{op40:""}," Nuxt DevTools ",-1)),e("code",nt,"v"+a(o(c)),1),i(_,{"package-name":"@nuxt/devtools",options:{dev:!0},"show-version":!1})])]),e("div",st,[i(x,{to:"https://nuxt.com",target:"_blank",p4:"","theme-card-green":"",flex:"~ col auto"},{default:n(()=>[t[1]||(t[1]=e("div",{"logos-nuxt-icon":"","text-3xl":""},null,-1)),i(_,{"package-name":"nuxt",options:{dev:!0}})]),_:1}),S.value?(s(),v(x,{key:0,to:"https://vuejs.org",target:"_blank",p4:"","theme-card-green":"",flex:"~ col auto"},{default:n(()=>[t[2]||(t[2]=e("div",{"logos-vue":"","text-3xl":""},null,-1)),e("code",null,"v"+a(S.value),1)]),_:1})):u("",!0),o(m)?(s(),p(f,{key:1},[o(m)&&o(m).pages&&o(b)?(s(),v(x,{key:0,"min-w-40":"",p4:"","theme-card-lime":"",flex:"~ col auto",to:"/modules/pages"},{default:n(()=>[t[3]||(t[3]=e("div",{"carbon-tree-view-alt":"","text-3xl":""},null,-1)),e("div",null,a(o(g)(o(B).length,"page")),1)]),_:1})):u("",!0),o(m)?(s(),v(x,{key:1,"min-w-40":"",p4:"","theme-card-lime":"",flex:"~ col auto",to:"/modules/components"},{default:n(()=>[t[4]||(t[4]=e("div",{"i-carbon-assembly-cluster":"","text-3xl":""},null,-1)),e("div",null,a(o(g)(o(D).length,"component")),1)]),_:1})):u("",!0),o(m)&&o(y)?(s(),v(x,{key:2,"min-w-40":"",p4:"","theme-card-yellow":"",flex:"~ col auto",to:"/modules/imports"},{default:n(()=>[t[5]||(t[5]=e("div",{"carbon-function":"","text-3xl":""},null,-1)),e("div",null,a(o(g)(o(y).imports.length,"import")),1)]),_:1})):u("",!0),o(m)?(s(),v(x,{key:3,"min-w-40":"",p4:"","theme-card-purple":"",flex:"~ col auto",to:"/modules/modules"},{default:n(()=>[t[6]||(t[6]=e("div",{"carbon-3d-mpr-toggle":"","text-3xl":""},null,-1)),e("div",null,a(o(g)(o(j).length,"module")),1)]),_:1})):u("",!0),o(m)?(s(),v(x,{key:4,"min-w-40":"",p4:"","theme-card-teal":"",flex:"~ col auto",to:"/modules/plugins"},{default:n(()=>[t[7]||(t[7]=e("div",{"carbon-plug":"","text-3xl":""},null,-1)),e("div",null,a(o(g)(o(m).plugins.length,"plugin")),1)]),_:1})):u("",!0),r.value?(s(),p("div",lt,[t[12]||(t[12]=e("div",{"i-carbon-time-plot":"","flex-none":"","text-3xl":""},null,-1)),e("div",it,[r.value.ssrStart?(s(),p(f,{key:0},[t[8]||(t[8]=e("div",{"text-sm":""}," SSR to full load ",-1)),e("div",ut,a(o(k)(r.value.appLoad-r.value.ssrStart)),1)],64)):u("",!0),t[10]||(t[10]=e("div",{"text-sm":""}," Page load ",-1)),e("div",rt,a(o(k)(r.value.appLoad-r.value.appInit)),1),t[11]||(t[11]=e("div",{"text-sm":""}," Navigation ",-1)),e("div",at,a(o(k)(r.value.pageEnd-r.value.pageStart)),1),r.value.hmrStart?(s(),p(f,{key:1},[t[9]||(t[9]=e("div",{"text-sm":""}," HMR ",-1)),e("div",dt,a(o(k)(r.value.hmrEnd-r.value.hmrStart)),1)],64)):u("",!0)])])):u("",!0)],64)):u("",!0)]),e("div",pt,[o(H)?(s(),v(N,{key:0,n:"yellow5",icon:"carbon-unlink","justify-center":""},{default:n(()=>t[13]||(t[13]=[l(" Not connected to the client app, showing server-side data only. Use the embedded mode for full features. ")])),_:1})):u("",!0),e("button",{title:"Authorize",onClick:L},[("isDevAuthed"in C?C.isDevAuthed:o(G))?u("",!0):(s(),v(N,{key:0,n:"orange5",icon:"i-carbon-locked","justify-center":""},{default:n(()=>t[14]||(t[14]=[l(" Access from an untrusted browser, some features are limited. Click to authorize now. ")])),_:1}))])]),e("div",mt,[t[16]||(t[16]=e("a",{href:"https://github.com/nuxt/devtools",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-blue",transition:""},[e("div",{"i-carbon-star":""}),l(" Star on GitHub ")],-1)),t[17]||(t[17]=e("a",{href:"https://github.com/nuxt/devtools/discussions/29",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-yellow",transition:""},[e("div",{"i-carbon-data-enrichment":""}),l(" Ideas & Suggestions ")],-1)),t[18]||(t[18]=e("a",{href:"https://github.com/nuxt/devtools/discussions/31",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-lime",transition:""},[e("div",{"i-carbon-plan":""}),l(" Project Roadmap ")],-1)),t[19]||(t[19]=e("a",{href:"https://github.com/nuxt/devtools/issues",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-rose",transition:""},[e("div",{"i-carbon-debug":""}),l(" Bug Reports ")],-1)),i(x,{to:"/settings",flex:"~ gap1","inline-block":"","items-center":"",op50:"","hover:op80":""},{default:n(()=>t[15]||(t[15]=[e("div",{"i-carbon-settings-adjust":""},null,-1),l(" Settings ")])),_:1})]),t[41]||(t[41]=e("div",{"flex-auto":""},null,-1)),e("div",xt,[e("div",vt,[o(w)?(s(),p(f,{key:0},[i(d,{n:"xs",class:"px2"},{default:n(()=>t[20]||(t[20]=[l(" ⌘ Cmd ")])),_:1}),t[22]||(t[22]=e("span",null,"+",-1)),i(d,{n:"xs",class:"px2"},{default:n(()=>t[21]||(t[21]=[l(" K ")])),_:1})],64)):(s(),p(f,{key:1},[i(d,{n:"xs",class:"px2"},{default:n(()=>t[23]||(t[23]=[l(" Ctrl ")])),_:1}),t[25]||(t[25]=e("span",null,"+",-1)),i(d,{n:"xs",class:"px2"},{default:n(()=>t[24]||(t[24]=[l(" K ")])),_:1})],64)),t[26]||(t[26]=e("div",{"flex-auto":""},null,-1)),t[27]||(t[27]=l(" Open Command Palette "))]),e("div",ft,[o(w)?(s(),p(f,{key:0},[i(d,{n:"xs",class:"px2"},{default:n(()=>t[28]||(t[28]=[l(" ⇧ Shift ")])),_:1}),t[31]||(t[31]=e("span",null,"+",-1)),i(d,{n:"xs",class:"px2"},{default:n(()=>t[29]||(t[29]=[l(" ⌥ Option ")])),_:1}),t[32]||(t[32]=e("span",null,"+",-1)),i(d,{n:"xs",class:"px2"},{default:n(()=>t[30]||(t[30]=[l(" D ")])),_:1})],64)):(s(),p(f,{key:1},[i(d,{n:"xs",class:"px2"},{default:n(()=>t[33]||(t[33]=[l(" Shift ")])),_:1}),t[36]||(t[36]=e("span",null,"+",-1)),i(d,{n:"xs",class:"px2"},{default:n(()=>t[34]||(t[34]=[l(" Alt ")])),_:1}),t[37]||(t[37]=e("span",null,"+",-1)),i(d,{n:"xs",class:"px2"},{default:n(()=>t[35]||(t[35]=[l(" D ")])),_:1})],64)),t[38]||(t[38]=e("div",{"flex-auto":""},null,-1)),t[39]||(t[39]=e("div",null,"Toggle DevTools",-1))])])])):(s(),p("div",tt," Loading... "))]),_:1})}}});export{jt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as A,e as H,J as K,ay as D,ak as J,al as Q,H as Y,U as Z,am as q,r as G,h as X}from"./
|
|
1
|
+
import{v as A,e as H,J as K,ay as D,ak as J,al as Q,H as Y,U as Z,am as q,r as G,h as X}from"./nxp3p1l5.js";import{_ as S}from"./nbadge-ggvrch1r.js";import{k as L,b as E,l as k,R as ee,Q as t,S as a,U as e,a5 as w,O as y,$ as x,ah as te,F as g,ab as B,W as P,a0 as _,a6 as T,Y as M,u as m,x as ne,Z as oe}from"./vendor/json-editor-vue-f126ciji.js";import{_ as F}from"./filepath-item.vue-jp3k05dh.js";import{_ as ae}from"./nsection-block-hjiyf44n.js";import{_ as se}from"./launch-page.vue-opmg26gw.js";import{_ as re}from"./help-fab.vue-kqlhhn29.js";import"./vendor/unocss-mnpxkox6.js";import"./vendor/shiki-hhqxa887.js";import"./nicon-title.vue-ef3vf9hr.js";import"./nmarkdown.vue-bwv440ol.js";import"./client-dgt05ivb.js";const le={block:"","cursor-pointer":""},ue={p2:""},ie=["onSubmit"],de={flex:"~","items-center":"",p2:"","text-sm":"","font-mono":""},pe={key:1},ce=L({__name:"RoutePathItem",props:{route:{}},emits:["navigate"],setup(V,{emit:u}){const h=V,$=u,c=E([]),v=k(()=>{const i=N(h.route.path);return c.value=Array.from({length:i.length},()=>""),i});function N(i){return i.split(/(:\w+[?*]?(?:\(\))?)/).filter(Boolean).map(d=>d[0]===":"?d.replace(/\(\)$/,"?"):d)}const s=k(()=>v.value.map((i,d)=>i[0]===":"?c.value[d]:i).join("").replace(/\/+/g,"/")),n=k(()=>h.route.path.includes(":"));function f(){$("navigate",s.value)}return(i,d)=>{const o=A,l=H,p=ee("VDropdown");return n.value?(t(),y(p,{key:1},{popper:x(({hide:r})=>[e("div",ue,[e("form",{flex:"~ col",onSubmit:te(()=>{f(),r()},["prevent"])},[n.value?(t(),a(g,{key:0},[d[0]||(d[0]=e("div",{px2:"","text-sm":"",op50:""}," Fill params and navigate: ",-1)),e("div",de,[(t(!0),a(g,null,B(v.value,(b,R)=>(t(),a(g,{key:R},[b[0]===":"?(t(),y(o,{key:0,modelValue:c.value[R],"onUpdate:modelValue":I=>c.value[R]=I,"w-20":"","n-sm":"",placeholder:b.slice(1)},null,8,["modelValue","onUpdate:modelValue","placeholder"])):(t(),a("span",pe,w(b),1))],64))),128))])],64)):P("",!0),_(l,{type:"submit",block:"",n:"primary"},{default:x(()=>d[1]||(d[1]=[T(" Navigate ")])),_:1})],40,ie)])]),default:x(()=>[e("code",le,[(t(!0),a(g,null,B(v.value,(r,b)=>(t(),a("span",{key:b,class:M(r[0]===":"?"text-gray border border-dashed rounded border-gray:50 px1":"")},w(r[0]===":"?r.slice(1):r),3))),128))])]),_:1})):(t(),a("button",{key:0,onClick:f},[e("code",null,w(i.route.path),1)]))}}}),me={"w-full":""},he={"w-20":"","pr-1":""},ve={flex:"","items-center":"","justify-end":""},_e={"text-sm":""},fe={flex:"inline gap3","items-center":""},ge={op0:"","group-hover:op100":"",flex:"~ gap1"},ye=["onClick"],be={"w-0":"","ws-nowrap":"","pr-1":"","text-left":"","text-sm":"","font-mono":"",op50:""},xe={"w-0":"","ws-nowrap":"","pr-1":"","text-center":"","text-sm":"","font-mono":"",op50:""},ke={"w-0":"","ws-nowrap":"","text-center":"","text-sm":"","font-mono":""},we={key:0},$e=["onClick"],Ne=L({__name:"RoutesTable",props:{pages:{},layouts:{},matched:{},matchedPending:{}},emits:["navigate"],setup(V){const u=V,h=K(),$=D(),c=k(()=>[...u.pages].sort((s,n)=>s.path.localeCompare(n.path)));function v(s){const n=u.layouts.find(f=>f.name===s);n&&h(n.file)}function N(s){if(typeof s=="string")return $.value?.middleware.find(n=>n.name===s)?.path}return(s,n)=>{const f=S,i=ce,d=F;return t(),a("div",null,[e("table",me,[n[3]||(n[3]=e("thead",{border:"b base"},[e("tr",null,[e("th",{"text-left":""}),e("th",{"text-left":""}," Route Path "),e("th",{"text-left":""}," Name "),e("th",{"text-left":""}," Middleware "),e("th",null," Layout ")])],-1)),e("tbody",null,[(t(!0),a(g,null,B(c.value,o=>(t(),a("tr",{key:o.name,class:"group","h-7":"",border:"b dashed transparent hover:base"},[e("td",he,[e("div",ve,[s.matched.find(l=>l.name===o.name)?(t(),y(f,{key:0,n:"green",title:"active",textContent:"active"})):s.matchedPending.find(l=>l.name===o.name)?(t(),y(f,{key:1,n:"teal",title:"next",textContent:"next"})):P("",!0)])]),e("td",_e,[e("div",fe,[_(i,{route:o,class:M(s.matched.find(l=>l.name===o.name)?"text-primary":s.matchedPending.find(l=>l.name===o.name)?"text-teal":""),onNavigate:n[0]||(n[0]=l=>s.$emit("navigate",l))},null,8,["route","class"]),e("div",ge,[o.file||o.meta?.file?(t(),a("button",{key:0,"text-sm":"",op40:"",hover:"op100 text-primary",title:"Open in editor",onClick:l=>m(h)(o.file||o.meta?.file)},n[2]||(n[2]=[e("div",{"i-carbon-script-reference":""},null,-1)]),8,ye)):P("",!0)])])]),e("td",be,w(o.name),1),e("td",xe,[_(d,{filepath:N(o.meta.middleware),override:`${o.meta.middleware||"-"}`},null,8,["filepath","override"])]),e("td",ke,[o.meta.layout===!1?(t(),a("span",we,"-")):o.meta.layout?(t(),a("button",{key:1,onClick:l=>v(o.meta.layout)},w(o.meta.layout),9,$e)):(t(),a("button",{key:2,"text-sm":"",op15:"",onClick:n[1]||(n[1]=l=>v("default"))}," (default) "))])]))),128))])])])}}}),Re={class:"markdown-body"},Ce={__name:"pages",setup(V,{expose:u}){return u({frontmatter:{}}),($,c)=>(t(),a("div",Re,c[0]||(c[0]=[e("h1",null,"Pages",-1),e("p",null,[T("Nuxt provides a file-based routing to create routes within your web application using Vue Router under the hood. Pages are Vue components and can have any valid extension that Nuxt supports (by default .vue, .js, .jsx, .mjs, .ts or .tsx). Nuxt will automatically create a route for every page in your "),e("code",null,"~/pages/"),T(" directory.")],-1),e("p",null,[e("a",{href:"https://nuxt.com/docs/getting-started/routing",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1),e("hr",null,null,-1),e("h1",null,"Middlewares",-1),e("p",null,"Nuxt provides a customizable route middleware framework that can be used throughout the application. This is ideal for extracting code that needs to run before navigating to a particular route.",-1),e("p",null,[e("a",{href:"https://nuxt.com/docs/guide/directory-structure/middleware",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1)])))}},Pe=Ce,Ve={key:0,"h-full":"","of-auto":""},Ie={border:"b base",flex:"~ col gap1",px4:"",py3:"","n-navbar-glass":""},Te={"font-mono":""},Be={key:1,op50:""},Ee={key:0,"text-orange":"",op75:""},Le={key:1,op50:""},Me={"min-h-14":""},Ae={key:1,class:"py-4 text-center"},De={"w-full":""},Se={mr1:""},qe=L({__name:"pages",setup(V){const u=J(),h=Q(),$=Y(),c=D(),v=Z(),N=q(),s=k(()=>c.value?.middleware||[]),n=E(""),f=E(0),i=k(()=>(s.value,n.value,v.value,f.value,u.value?.currentRoute?.value?.path));ne(()=>{h.value&&(n.value=u.value?.currentRoute?.value?.path),u.value?.beforeEach(p=>{n.value=p.fullPath}),u.value?.afterEach(p=>{n.value=p.fullPath})});async function d(){n.value!==u.value?.currentRoute?.value?.path&&u.value.push(n.value||"/")}const o=k(()=>u.value.resolve(n.value||"/").matched);function l(p){u.value.push(p),n.value=p}return(p,r)=>{const b=A,R=Ne,I=ae,j=S,U=F,z=se,O=Pe,W=re;return t(),a(g,null,[m($)?.pages&&m(u)?(t(),a("div",Ve,[e("div",Ie,[e("div",null,[i.value!==n.value?(t(),a(g,{key:0},[r[1]||(r[1]=e("span",{op50:""},"Navigate from ",-1)),e("span",Te,w(i.value),1),r[2]||(r[2]=e("span",{op50:""}," to ",-1))],64)):(t(),a("span",Be,"Current route"))]),_(b,{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=C=>n.value=C),"font-mono":"",icon:"carbon-direction-right-01 scale-y--100",class:M(i.value===n.value?"":o.value.length?"text-green":"text-orange"),onKeydown:oe(d,["enter"])},null,8,["modelValue","class"]),e("div",null,[i.value!==n.value?(t(),a(g,{key:0},[r[3]||(r[3]=e("span",null,[T("Press "),e("b",{"font-bold":""},"Enter"),T(" to navigate")],-1)),o.value.length?P("",!0):(t(),a("span",Ee," (no match)"))],64)):(t(),a("span",Le,"Edit path above to navigate"))])]),_(I,{icon:"carbon-tree-view",text:"Matched Routes",padding:!1},{default:x(()=>[e("div",Me,[o.value.length?(t(),y(R,{key:0,pages:o.value,layouts:m(v)||[],matched:m(h).matched,"matched-pending":o.value,onNavigate:l},null,8,["pages","layouts","matched","matched-pending"])):(t(),a("div",Ae,r[4]||(r[4]=[e("span",{op50:""},"No routes matched",-1)])))])]),_:1}),_(I,{icon:"carbon-tree-view-alt",text:"All Routes",description:`${m(N).length} routes registered in your application`,padding:"pr5"},{default:x(()=>[_(R,{pages:m(N),layouts:m(v)||[],matched:m(h).matched,"matched-pending":o.value,onNavigate:l},null,8,["pages","layouts","matched","matched-pending"])]),_:1},8,["description"]),s.value.length?(t(),y(I,{key:0,icon:"carbon:ibm-watson-studio",text:"Middleware",description:`${s.value.length} middleware registered in your application`,padding:"px13"},{default:x(()=>[e("table",De,[r[5]||(r[5]=e("thead",{border:"b base","h-7":""},[e("tr",null,[e("th",{"text-left":""}," Name "),e("th",{"text-left":""}," Path ")])],-1)),(t(!0),a(g,null,B(s.value,C=>(t(),a("tr",{key:C.path,"h-7":""},[e("td",null,[e("span",Se,w(C.name),1),C.global?(t(),y(j,{key:0,n:"green",title:"Registered at runtime as a global component",textContent:"global"})):P("",!0)]),e("td",null,[_(U,{filepath:C.path},null,8,["filepath"])])]))),128))])]),_:1},8,["description"])):P("",!0)])):(t(),y(z,{key:1,icon:"carbon-tree-view-alt",name:"wizard-pages",title:"Nuxt Routing",description:"Create `./pages/index.vue` to enable routing",actions:[{label:"Learn more",src:"https://nuxt.com/docs/getting-started/routing",attrs:{n:"primary"}},{label:"Enable Routing",async handle(){return("rpc"in p?p.rpc:m(G)).runWizard(await("ensureDevAuthToken"in p?p.ensureDevAuthToken:m(X))(),"enablePages")}}]},null,8,["actions"])),_(W,null,{default:x(()=>[_(O)]),_:1})],64)}}});export{qe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as h}from"./state-editor.vue-
|
|
1
|
+
import{_ as h}from"./state-editor.vue-eev8247c.js";import{k as x,Q as e,S as i,F as $,ab as N,O as d,$ as a,V as B,a1 as O,U as k,l as b,af as V,u as w,a0 as o,W as p,a6 as F,a8 as E}from"./vendor/json-editor-vue-f126ciji.js";import{_ as P}from"./nsection-block-hjiyf44n.js";import{Q as R,e as j}from"./nxp3p1l5.js";import{_ as A}from"./help-fab.vue-kqlhhn29.js";import"./nicon-title.vue-ef3vf9hr.js";import"./vendor/unocss-mnpxkox6.js";import"./vendor/shiki-hhqxa887.js";const G={key:0,flex:"~ col gap-1"},H={key:1,mt2:"",px4:"",italic:"",op35:""},K=x({__name:"StateGroup",props:{state:{},revision:{},prefix:{default:""}},setup(f){return(t,n)=>{const c=h;return e(),i("div",null,[t.state&&Object.keys(t.state).length>0?(e(),i("div",G,[(e(!0),i($,null,N(t.state,(s,r)=>(e(),d(c,{key:r,revision:t.revision,state:s,name:r.startsWith(t.prefix)?r.slice(t.prefix.length):r},{actions:a(l=>[B(t.$slots,"actions",O({ref_for:!0},l))]),_:2},1032,["revision","state","name"]))),128))])):(e(),i("div",H," No data "))])}}}),Q={class:"markdown-body"},T={__name:"payload",setup(f,{expose:t}){return t({frontmatter:{}}),(c,s)=>(e(),i("div",Q,s[0]||(s[0]=[k("h1",null,"State & Async Data",-1),k("p",null,"// TODO",-1)])))}},W=T,L={key:0},tt=x({__name:"payload",setup(f){const t=R(),n=b(()=>t.value?.nuxt.payload),c=b(()=>t.value?.revision.value);async function s(r){await t.value?.nuxt.hooks.callHookParallel("app:data:refresh",r)}return(r,l)=>{const m=K,_=P,v=j,S=h,g=W,D=A,C=V("tooltip");return e(),i($,null,[w(t)?(e(),i("div",L,[o(_,{icon:"carbon-data-set",text:"State",description:"Keyed state from `useState`",padding:!1},{default:a(()=>[o(m,{state:n.value.state,revision:c.value,prefix:"$s"},null,8,["state","revision"])]),_:1}),o(_,{icon:"carbon-data-blob",text:"Data",description:"Keyed state from `useAsyncData`",padding:!1},{actions:a(()=>[o(v,{n:"xs primary","self-start":"",icon:"i-carbon-recycle",onClick:l[0]||(l[0]=y=>s())},{default:a(()=>l[1]||(l[1]=[F(" Re-fetch all data ")])),_:1})]),default:a(()=>[o(m,{state:n.value.data,revision:c.value},{actions:a(({isOpen:y,name:u})=>[y&&u?E((e(),d(v,{key:0,title:`Re-fetch '${u}'`,icon:"carbon-recycle",border:!1,onClick:U=>s([u])},null,8,["title","onClick"])),[[C,`Re-fetch '${u}'`,void 0,{bottom:!0}]]):p("",!0)]),_:1},8,["state","revision"])]),_:1}),n.value.functions&&Object.keys(n.value.functions).length?(e(),d(_,{key:0,icon:"carbon-function",text:"Functions",description:"State for functions"},{default:a(()=>[o(S,{"ml--6":"",state:n.value.functions,revision:c.value},null,8,["state","revision"])]),_:1})):p("",!0)])):p("",!0),o(D,null,{default:a(()=>[o(g)]),_:1})],64)}}});export{tt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{P as r,R as p}from"./nxp3p1l5.js";import{p as c}from"./index-f7gtpn4a.js";import{k as i,S as m,u as o,O as n,$ as _,Q as t,a6 as l}from"./vendor/json-editor-vue-f126ciji.js";import"./vendor/unocss-mnpxkox6.js";import"./vendor/shiki-hhqxa887.js";import"./vue-virtual-scroller.esm-dbbmx9wu.js";const u={class:"h-full w-full"},v=i({__name:"pinia",setup(f){const{connected:s}=r();return(d,e)=>{const a=p;return t(),m("div",u,[o(s)?(t(),n(o(c),{key:0})):(t(),n(a,{key:1},{default:_(()=>e[0]||(e[0]=[l(" Connecting.... ")])),_:1}))])}}});export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as T}from"./filepath-item.vue-
|
|
1
|
+
import{_ as T}from"./filepath-item.vue-jp3k05dh.js";import{_ as w}from"./nbadge-ggvrch1r.js";import{_ as k}from"./duration-display.vue-n7a3864v.js";import{H as D,ax as B,D as V,_ as H,ay as F,Q as I}from"./nxp3p1l5.js";import{k as v,l as h,Q as o,S as _,U as n,a5 as C,a0 as u,O as p,W as d,R as W,V as P,$ as g,a6 as x,F as b,ab as E,Y as L}from"./vendor/json-editor-vue-f126ciji.js";import{_ as M}from"./nsection-block-hjiyf44n.js";import{_ as Q}from"./help-fab.vue-kqlhhn29.js";import"./vendor/unocss-mnpxkox6.js";import"./vendor/shiki-hhqxa887.js";import"./nicon-title.vue-ef3vf9hr.js";const R={flex:"~ gap2","items-center":""},Y={w8:"","text-right":"","text-sm":"",op25:""},j={key:0,"flex-auto":"","text-right":""},z=v({__name:"PluginItem",props:{plugin:{},index:{}},setup(m){const e=m,a=D(),l=h(()=>B(e.plugin.src,a.value?.rootDir||"").path);return(t,c)=>{const r=T,s=w,i=k;return o(),_("div",R,[n("div",Y,C(t.index),1),u(r,{filepath:e.plugin.src,subpath:!0},null,8,["filepath"]),n("div",null,[l.value.startsWith("#")?(o(),p(s,{key:0,n:"rose",textContent:"virtual"})):l.value.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",j,[u(i,{duration:t.plugin.metric?.duration,factor:10},null,8,["duration"])])):d("",!0)])}}}),A={class:"n-tip n-tip-base",flex:"~ col items-start","mx--4":"",px4:"",py4:""},O={flex:"~ items-center gap-1","font-bold":""},U=v({__name:"HelpTip",props:{title:{},icon:{}},setup(m){return(e,a)=>{const l=V,t=W("ContentSlot");return o(),_("div",A,[n("div",O,[e.icon?(o(),p(l,{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 a=U;return o(),p(a,{title:"Performance Tip",icon:"carbon-meter",n:"lime6 dark:lime5"},{default:g(()=>[P(m.$slots,"default")]),_:3})}const J=H(q,[["render",G]]),K={class:"markdown-body"},X={__name:"plugins",setup(m,{expose:e}){return e({frontmatter:{}}),(l,t)=>{const c=J;return o(),_("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(c,null,{default:g(()=>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))])}}},Z=X,tt={pt4:""},nt={class:"text-sm",flex:"~ gap-1 items-center justify-start","mt-3":""},mt=v({__name:"plugins",setup(m){const e=F(),a=I(),l=h(()=>{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(f=>f.src===i.src||f.src.startsWith(i.src))}})}),t=h(()=>{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=z,i=k,f=M,N=Z,S=Q;return o(),_(b,null,[u(f,{icon:"carbon-plug",text:"Plugins",description:`Total plugins: ${l.value.length}`},{default:g(()=>[n("div",tt,[(o(!0),_(b,null,E(l.value,(y,$)=>(o(),p(s,{key:y.src,plugin:y,index:$+1,"ml--4":"","border-base":"",py2:"",class:L($?"border-t":"")},null,8,["plugin","index","class"]))),128)),n("div",nt,[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:t.value,factor:10},null,8,["duration"])])])]),_:1},8,["description"]),u(S,null,{default:g(()=>[u(N)]),_:1})],64)}}});export{mt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as x}from"./state-editor.vue-
|
|
1
|
+
import{_ as x}from"./state-editor.vue-eev8247c.js";import{_ as y}from"./nsection-block-hjiyf44n.js";import{Q as u,S as l,U as o,a6 as d,k as C,l as c,u as _,a0 as e,$ as a,W as b,F as k}from"./vendor/json-editor-vue-f126ciji.js";import{_ as w}from"./help-fab.vue-kqlhhn29.js";import{Q as N,aZ as R}from"./nxp3p1l5.js";import"./nicon-title.vue-ef3vf9hr.js";import"./vendor/unocss-mnpxkox6.js";import"./vendor/shiki-hhqxa887.js";const T={class:"markdown-body"},$={__name:"runtime-configs",setup(f,{expose:t}){return t({frontmatter:{}}),(m,n)=>(u(),l("div",T,n[0]||(n[0]=[o("h1",null,"Runtime Configs",-1),o("p",null,"Nuxt provides a runtime config API to expose configuration within your application and server routes, with the ability to update it at runtime by setting environment variables.",-1),o("p",null,[d("In Nuxt DevTools, the editor allows you to edit the runtime config temporarily to see how the changes affect your application. To update them, you might want to update your "),o("code",null,"nuxt.config.js"),d(" file, or check more details in the documentation.")],-1),o("p",null,[o("a",{href:"https://nuxt.com/docs/guide/going-further/runtime-config",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1)])))}},B=$,S={key:0},H=C({__name:"runtime-configs",setup(f){const t=N(),p=R(),m=c(()=>t.value?.nuxt.payload),n=c(()=>t.value?.revision.value),g=c(()=>{const i={...p.value};return delete i.public,delete i.app,i});return(i,V)=>{const s=x,r=y,v=B,h=w;return u(),l(k,null,[_(t)?(u(),l("div",S,[e(r,{icon:"carbon-settings-services",text:"App Config",padding:!1},{default:a(()=>[e(s,{state:_(t).app.appConfig,revision:n.value},null,8,["state","revision"])]),_:1}),e(r,{icon:"carbon-settings",text:"Public Runtime Config",padding:!1},{default:a(()=>[e(s,{state:m.value.config?.public,revision:n.value},null,8,["state","revision"])]),_:1}),e(r,{icon:"i-carbon-code-signing-service",text:"Private Runtime Config",open:!1,padding:!1,description:"These values are not exposed to the client. Readonly in the DevTools."},{default:a(()=>[e(s,{state:g.value,revision:n.value,readonly:""},null,8,["state","revision"])]),_:1})])):b("",!0),e(h,null,{default:a(()=>[e(v)]),_:1})],64)}}});export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as O}from"./ncheckbox.vue-
|
|
1
|
+
import{_ as O}from"./ncheckbox.vue-ir8t2t9x.js";import{y as j,v as R,D as T,e as A}from"./nxp3p1l5.js";import{_ as E}from"./nselect.vue-kb4ychx8.js";import{k as L,l as N,c as z,Q as s,S as u,F as c,ab as h,V as b,O as p,W as y,Y as v,a0 as m,$ as V,U as C,a5 as K,u as r,a6 as S}from"./vendor/json-editor-vue-f126ciji.js";const M={p4:"",flex:"~ col gap-4"},Q={key:1,ml2:"",flex:""},W=["value"],Y={key:0,flex:"","gap-4":""},X=L({__name:"ServerRouteInputs",props:{modelValue:{},keys:{default:()=>[]},default:{default:()=>({})},disabled:{type:Boolean,default:!1}},setup(U,{emit:w}){const g=U,d=j(g,"modelValue",w,{passive:!0}),_=N(()=>[...g.keys,"active","key","value","type"]),B=N(()=>{const l={};for(const e of _.value)l[e]=g.default[e]||"";return l}),D=["string","number","boolean","file","date","time","datetime-local"];function F(l,e){const t=e.target;if(t.files&&t.files[0]){const i=t.files[0],f=new FileReader;f.readAsDataURL(i),f.onload=()=>{d.value[l].value=f.result}}}return z(()=>d,l=>{l.value.forEach(e=>{if(e.type==="number"&&typeof e.value!="number"){const t=Number.parseFloat(e.value);e.value=Number.isNaN(t)?0:t}else e.type==="boolean"&&typeof e.value!="boolean"?e.value=!0:e.type==="file"&&typeof e.value!="object"?e.value="":e.type==="date"&&typeof e.value=="string"&&!e.value.match(/^\d{4}-\d{2}-\d{2}$/)?e.value=new Date().toISOString().slice(0,10):e.type==="time"&&typeof e.value=="string"&&!e.value.match(/^\d{2}:\d{2}$/)?e.value=new Date().toISOString().slice(11,16):e.type==="datetime-local"&&typeof e.value=="string"&&!e.value.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/)?e.value=new Date().toISOString().slice(0,16):e.type==="string"&&(e.value=e.value.toString())})},{deep:!0,immediate:!0,flush:"sync"}),(l,e)=>{const t=O,i=R,f=E,I=T,k=A;return s(),u("div",M,[(s(!0),u(c,null,h(r(d),(a,$)=>(s(),u("div",{key:$,flex:"~ gap-2","justify-around":""},[b(l.$slots,"input",{item:a}),(s(!0),u(c,null,h(_.value,n=>(s(),u(c,{key:n},[a.type!==null&&n==="active"?(s(),p(t,{key:0,modelValue:a[n],"onUpdate:modelValue":o=>a[n]=o,n:"sm primary",disabled:l.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):y("",!0),a.type!==null&&n==="key"?(s(),p(i,{key:1,modelValue:a[n],"onUpdate:modelValue":o=>a[n]=o,placeholder:n,"flex-1":"","font-mono":"",n:"sm primary",disabled:l.disabled,class:v(l.disabled?"op50":"")},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled","class"])):n==="value"?(s(),u(c,{key:2},[a.type==="file"?(s(),p(i,{key:0,type:"file",disabled:l.disabled,class:v(l.disabled?"op75":""),onChange:o=>F($,o)},null,8,["disabled","class","onChange"])):a.type==="boolean"?(s(),u("div",Q,[m(t,{modelValue:a.value,"onUpdate:modelValue":o=>a.value=o,placeholder:"Value",n:"green lg",disabled:l.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(s(),p(i,{key:2,modelValue:a.value,"onUpdate:modelValue":o=>a.value=o,type:a.type,placeholder:"Value","flex-1":"","font-mono":"",n:"sm primary",disabled:l.disabled,class:v(l.disabled?"op75":"")},null,8,["modelValue","onUpdate:modelValue","type","disabled","class"]))],64)):n==="type"?(s(),p(f,{key:3,modelValue:a.type,"onUpdate:modelValue":o=>a.type=o,n:"sm green",class:v(l.disabled?"op75":""),disabled:l.disabled},{default:V(()=>[(s(),u(c,null,h(D,o=>C("option",{key:o,value:o},K(o),9,W)),64))]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled"])):y("",!0)],64))),128)),b(l.$slots,"input-actions",{},()=>[m(k,{n:"red",disabled:l.disabled,class:v(l.disabled?"op0!":""),onClick:n=>r(d).splice($,1)},{default:V(()=>[m(I,{icon:"carbon:trash-can"})]),_:2},1032,["disabled","class","onClick"])])]))),128)),l.disabled?y("",!0):(s(),u("div",Y,[b(l.$slots,"actions",{params:r(d)},()=>[m(k,{icon:"carbon-add",n:"sm primary",my1:"","px-3":"",onClick:e[0]||(e[0]=a=>r(d).push({...B.value}))},{default:V(()=>e[2]||(e[2]=[S(" Add ")])),_:1}),e[4]||(e[4]=C("div",{"flex-auto":""},null,-1)),r(d).length?(s(),p(k,{key:0,icon:"carbon-trash-can",n:"sm red",my1:"","px-3":"",onClick:e[1]||(e[1]=a=>r(d).splice(0,r(d).length))},{default:V(()=>e[3]||(e[3]=[S(" Remove All ")])),_:1})):y("",!0)])])),b(l.$slots,"default")])}}});export{X as _};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b1 as $e,b2 as le,D as Ee,b3 as Ge,b4 as Ke,S as Qe,H as Xe,Q as Ye,J as Ze,b as De,ai as et,b5 as tt,I as ot,q as nt,e as Re,v as at,c as Ve,R as st,b6 as lt,M as rt,p as it,W as ut}from"./d8ykqm74.js";import{_ as dt}from"./nnavbar.vue-lvh4ek84.js";import{_ as je}from"./nbadge-ntuzwfj6.js";import{k as ye,b as L,Q as r,S as k,U as i,Y as M,O as $,u as b,a5 as I,W as P,a6 as K,X as ct,V as pt,F as N,ab as W,z as me,c as Ue,g as Ie,D as ft,n as vt,r as ve,l as V,w as mt,af as Oe,$ as C,a0 as v,a8 as Z,a1 as yt,aw as ht,K as gt}from"./vendor/json-editor-vue-mdfcgt41.js";import{_ as bt}from"./nselect.vue-bpqzr4w7.js";import{_ as Ne}from"./server-route-inputs.vue-mdebn387.js";import{_ as _t}from"./code-snippets.vue-bs8dkort.js";import{_ as kt}from"./ncode-block.vue-bfbbo3c9.js";import{d as wt}from"./vendor/unocss-mnpxkox6.js";import{C as xe,S as Le}from"./constants-b32h69zq.js";import{_ as xt}from"./nsection-block-oxvuqj5d.js";import{_ as Ct}from"./ndrawer.vue-of9w84z3.js";import"./vendor/shiki-fpe2sz4h.js";import"./ncheckbox.vue-h2ndpucy.js";import"./client-klf75x38.js";import"./nicon-title.vue-g9trlv29.js";function St(e,l){if(typeof e!="string")throw new TypeError("argument str must be a string");const n={},o=l||{},y=o.decode||Tt;let f=0;for(;f<e.length;){const d=e.indexOf("=",f);if(d===-1)break;let m=e.indexOf(";",f);if(m===-1)m=e.length;else if(m<d){f=e.lastIndexOf(";",d-1)+1;continue}const g=e.slice(f,d).trim();if(o?.filter&&!o?.filter(g)){f=m+1;continue}if(n[g]===void 0){let u=e.slice(d+1,m).trim();u.codePointAt(0)===34&&(u=u.slice(1,-1)),n[g]=$t(u,y)}f=m+1}return n}function Tt(e){return e.includes("%")?decodeURIComponent(e):e}function $t(e,l){try{return l(e)}catch{return e}}const ae=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function Ce(e,l,n){const o=n||{},y=o.encode||encodeURIComponent;if(typeof y!="function")throw new TypeError("option encode is invalid");if(!ae.test(e))throw new TypeError("argument name is invalid");const f=y(l);if(f&&!ae.test(f))throw new TypeError("argument val is invalid");let d=e+"="+f;if(o.maxAge!==void 0&&o.maxAge!==null){const m=o.maxAge-0;if(Number.isNaN(m)||!Number.isFinite(m))throw new TypeError("option maxAge is invalid");d+="; Max-Age="+Math.floor(m)}if(o.domain){if(!ae.test(o.domain))throw new TypeError("option domain is invalid");d+="; Domain="+o.domain}if(o.path){if(!ae.test(o.path))throw new TypeError("option path is invalid");d+="; Path="+o.path}if(o.expires){if(!Et(o.expires)||Number.isNaN(o.expires.valueOf()))throw new TypeError("option expires is invalid");d+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(d+="; HttpOnly"),o.secure&&(d+="; Secure"),o.priority)switch(typeof o.priority=="string"?o.priority.toLowerCase():o.priority){case"low":{d+="; Priority=Low";break}case"medium":{d+="; Priority=Medium";break}case"high":{d+="; Priority=High";break}default:throw new TypeError("option priority is invalid")}if(o.sameSite)switch(typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite){case!0:{d+="; SameSite=Strict";break}case"lax":{d+="; SameSite=Lax";break}case"strict":{d+="; SameSite=Strict";break}case"none":{d+="; SameSite=None";break}default:throw new TypeError("option sameSite is invalid")}return o.partitioned&&(d+="; Partitioned"),d}function Et(e){return Object.prototype.toString.call(e)==="[object Date]"||e instanceof Date}const Pe=ye({__name:"ServerRouteListItem",props:{item:{},index:{default:0}},setup(e){const l=L(!0),n=$e();return(o,y)=>{const f=Ee,d=je,m=Pe;return r(),k("div",null,[i("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"",class:M([{"bg-active":b(n)===o.item.filepath}]),style:ct({paddingLeft:`calc(0.5rem + ${o.index*1.5}em)`}),onClick:y[0]||(y[0]=g=>{l.value=!l.value,n.value=o.item.filepath})},[i("div",{class:M({"w-12":!o.item.routes}),"flex-none":"","text-left":""},[o.item.type==="collection"?(r(),$(f,{key:0,icon:"carbon:chevron-right","mb0.5":"","transform-rotate":l.value?90:0,transition:""},null,8,["transform-rotate"])):(r(),$(d,{key:1,class:M(b(le)(o.item.method||"*")),textContent:I((o.item.method||"*").toUpperCase())},null,8,["class","textContent"]))],2),i("span",{class:M({"flex items-center":o.item.routes}),"text-sm":"","font-mono":""},[o.item.type==="collection"?(r(),$(f,{key:0,title:`${o.item.routes?.length} routes`,icon:"carbon:folder",mr1:""},null,8,["title"])):P("",!0),K(" "+I(o.item.route),1)],2)],6),y[1]||(y[1]=i("div",{"x-divider":""},null,-1)),l.value?pt(o.$slots,"default",{key:0},()=>[(r(!0),k(N,null,W(o.item.routes,g=>(r(),$(m,{key:g.filepath,item:g,index:o.index+1},null,8,["item","index"]))),128))]):P("",!0)])}}});function B(e){if(typeof e!="object")return e;var l,n,o=Object.prototype.toString.call(e);if(o==="[object Object]"){if(e.constructor!==Object&&typeof e.constructor=="function"){n=new e.constructor;for(l in e)e.hasOwnProperty(l)&&n[l]!==e[l]&&(n[l]=B(e[l]))}else{n={};for(l in e)l==="__proto__"?Object.defineProperty(n,l,{value:B(e[l]),configurable:!0,enumerable:!0,writable:!0}):n[l]=B(e[l])}return n}if(o==="[object Array]"){for(l=e.length,n=Array(l);l--;)n[l]=B(e[l]);return n}return o==="[object Set]"?(n=new Set,e.forEach(function(y){n.add(B(y))}),n):o==="[object Map]"?(n=new Map,e.forEach(function(y,f){n.set(B(f),B(y))}),n):o==="[object Date]"?new Date(+e):o==="[object RegExp]"?(n=new RegExp(e.source,e.flags),n.lastIndex=e.lastIndex,n):o==="[object DataView]"?new e.constructor(B(e.buffer)):o==="[object ArrayBuffer]"?e.slice(0):o.slice(-6)==="Array]"?new e.constructor(e):e}const Dt={path:"/",watch:!0,decode:e=>wt(decodeURIComponent(e)),encode:e=>encodeURIComponent(typeof e=="string"?e:JSON.stringify(e))},se=window.cookieStore;function Rt(e,l){const n={...Dt,...l};n.filter??=g=>g===e;const o=Se(n)||{};let y;n.maxAge!==void 0?y=n.maxAge*1e3:n.expires&&(y=n.expires.getTime()-Date.now());const f=y!==void 0&&y<=0,d=B(f?void 0:o[e]??n.default?.()),m=y&&!f?Ut(d,y,n.watch&&n.watch!=="shallow"):L(d);{let g=null;try{!se&&typeof BroadcastChannel<"u"&&(g=new BroadcastChannel(`nuxt:cookies:${e}`))}catch{}const u=()=>{n.readonly||Ge(m.value,o[e])||(jt(e,m.value,n),o[e]=B(m.value),g?.postMessage({value:n.encode(m.value)}))},E=A=>{const S=A.refresh?Se(n)?.[e]:n.decode(A.value);U=!0,m.value=S,o[e]=B(S),vt(()=>{U=!1})};let U=!1;const F=!!Ie();if(F&&me(()=>{U=!0,u(),g?.close()}),se){const A=S=>{const _=S.changed.find(h=>h.name===e),O=S.deleted.find(h=>h.name===e);_&&E({value:_.value}),O&&E({value:null})};se.addEventListener("change",A),F&&me(()=>se.removeEventListener("change",A))}else g&&(g.onmessage=({data:A})=>E(A));n.watch?Ue(m,()=>{U||u()},{deep:n.watch!=="shallow"}):u()}return m}function Se(e={}){return St(document.cookie,e)}function Vt(e,l,n={}){return l==null?Ce(e,l,{...n,maxAge:-1}):Ce(e,l,n)}function jt(e,l,n={}){document.cookie=Vt(e,l,n)}const Te=2147483647;function Ut(e,l,n){let o,y,f=0;const d=n?L(e):{value:e};return Ie()&&me(()=>{y?.(),clearTimeout(o)}),ft((m,g)=>{n&&(y=Ue(d,g));function u(){f=0,clearTimeout(o);const E=l-f,U=E<Te?E:Te;o=setTimeout(()=>{if(f+=U,f<l)return u();d.value=void 0,g()},U)}return{get(){return m(),d.value},set(E){u(),d.value=E,g()}}})}const It={"h-full":"","w-full":"",flex:"~ col"},Ot={flex:"~ col gap-2","flex-none":"",p4:"","n-navbar-glass":""},Nt={flex:"~ gap2 items-center"},Lt={relative:"","w-full":""},Pt={absolute:"","right-2":"","top-1.5":"",flex:"~ gap-1"},At={flex:"~ gap2 wrap","w-full":"","items-center":"",px4:"",pb2:"","text-center":"","text-sm":"",border:"b base"},Bt={class:"hidden md:block"},qt={key:0,border:"b base","items-center":"",px4:"",py2:"",grid:"~ cols-[max-content_1fr] gap-2"},Mt={"text-right":"","font-mono":""},Ft={key:1,border:"b base",p4:"",flex:"~ col gap-4","font-mono":""},Ht={flex:"~ gap-4"},zt={flex:"~ gap2","mb--2":"","items-center":"",op50:""},Wt={key:2},Jt={key:3,border:"b base",relative:"","n-code-block":""},Gt={flex:"~ wrap","w-full":""},Kt=["onClick"],Qt={border:"b base",flex:"~ gap2","items-center":"",px4:"",py2:""},Xt={key:1,"text-xs":"",op50:""},Yt={key:0,"flex-auto":"","overflow-auto":""},Zt={border:"~ base","h-full":"","w-full":"",rounded:""},eo=["data"],to={key:2,"flex-auto":"","overflow-auto":"",p4:""},oo={border:"~ base",rounded:""},no=["src"],ao={key:1,controls:"",rounded:""},so=["src"],lo=ye({__name:"ServerRouteDetails",props:{route:{}},emits:["open-default-input"],setup(e,{emit:l}){const n=e,o=l,[y,f]=Ke(),d=Qe(),m=Xe(),g=Ye(),u=ve({contentType:"text/plain",data:"",statusCode:200,error:void 0,fetchTime:0}),E=V(()=>u.contentType.includes("application/json")?"json":u.contentType.includes("text/html")?"html":u.contentType.includes("text/css")?"css":u.contentType.includes("text/javascript")?"javascript":u.contentType.includes("image")||u.contentType.includes("video")?"media":u.contentType.includes("text/xml")||u.contentType.includes("application/xml")?"xml":u.contentType.includes("application/pdf")?"pdf":"text"),U=V(()=>{if(E.value==="json")return JSON.stringify(u.data,null,2);if(E.value==="media"||E.value==="pdf"){const a=new Blob([u.data],{type:u.contentType});return URL.createObjectURL(a)}return u.data}),F=L(!1),A=L(!1),S=Ze(),_=V(()=>n.route.route?.split(/((?:\*\*)?:\w+)/g)),O=V(()=>_.value?.filter(a=>a.startsWith(":")||a.startsWith("**:"))||[]),h=L(n.route.method||"GET"),D=L({}),w=ve({query:[{active:!0,key:"",value:"",type:"string"}],body:[{active:!0,key:"",value:"",type:"string"}],headers:[{active:!0,key:"Content-Type",value:"application/json",type:"string"}]}),j=L({}),{inputDefaults:x,sendFrom:H}=De("serverRoutes"),Q=V(()=>g?.value?.app?.$fetch?H.value:"devtools"),re=["GET","POST","PUT","PATCH","DELETE","HEAD"],ie=["PATCH","POST","PUT","DELETE"],ee=V(()=>ie.includes(h.value.toUpperCase())),c=L(),te=["input","json"],J=L(te[0]),ue=V({get:()=>w[c.value],set:a=>{w[c.value]=a}}),he=V(()=>({...G(x.value.query),...G(w.query)})),ge=V(()=>({...G(x.value.headers),...G(w.headers)})),de=V(()=>ee.value?J.value==="json"?{...G(x.value.body),...j.value}:{...G(x.value.body),...G(w.body)}:void 0),Ae=V(()=>{let a=window?.location.origin;return a.charAt(a.length-1)==="/"&&(a=a.slice(0,-1)),a}),oe=V(()=>{let a=new URLSearchParams(he.value).toString();a&&(a=`?${a}`);const t=(_.value?.map(R=>(R.startsWith(":")||R.startsWith("**:"))&&D.value[R]||R).join("")||"")+a;let p=m.value?.app.baseURL||"";return(p==="./"||p===".")&&(p=""),p.endsWith("/")&&(p=p.slice(0,-1)),p+t}),be=V(()=>Ae.value+oe.value);function G(a){const t=Object.fromEntries(a.filter(({active:p,key:R,value:T})=>p&&R&&T!==void 0).map(({key:p,value:R})=>[p,R]));return Object.entries(t).length?t:void 0}async function _e(){A.value=!0,F.value=!0;const a=Date.now(),t=Q.value==="app"?g.value.app.$fetch:$fetch;nt("server-routes:fetch",{method:h.value,sendFrom:Q.value});try{u.data=await t(be.value,{method:h.value.toUpperCase(),headers:ge.value,query:he.value,body:de.value,onResponse({response:p}){u.contentType=(p.headers.get("content-type")||"").toString().toLowerCase().trim(),u.statusCode=p.status,u.error=void 0},onResponseError(p){u.error=p.response._data,u.data=p.response._data}})}catch{}F.value=!1,u.fetchTime=Date.now()-a}const ke=V(()=>{const a=[],t=[],p=Object.entries(ge.value).filter(([T,q])=>T&&q&&!(T==="Content-Type"&&q==="application/json")).map(([T,q])=>` '${T}': '${q}'`).join(`,
|
|
1
|
+
import{a_ as $e,a$ as le,D as Ee,b0 as Ge,b1 as Ke,S as Qe,H as Xe,Q as Ye,J as Ze,b as De,ai as et,b2 as tt,I as ot,q as nt,e as Re,v as at,c as Ve,R as st,b3 as lt,M as rt,p as it,W as ut}from"./nxp3p1l5.js";import{_ as dt}from"./nnavbar.vue-jap952ju.js";import{_ as je}from"./nbadge-ggvrch1r.js";import{k as ye,b as L,Q as r,S as k,U as i,Y as M,O as $,u as b,a5 as U,W as P,a6 as K,X as ct,V as pt,F as N,ab as W,A as me,c as Ie,g as Ue,B as ft,n as vt,r as ve,l as V,w as mt,af as Oe,$ as C,a0 as v,a8 as Z,a1 as yt,aw as ht,K as gt}from"./vendor/json-editor-vue-f126ciji.js";import{_ as bt}from"./nselect.vue-kb4ychx8.js";import{_ as Ne}from"./server-route-inputs.vue-hs0k8usl.js";import{_ as _t}from"./code-snippets.vue-17pri79b.js";import{_ as kt}from"./ncode-block.vue-d334f2dp.js";import{d as wt}from"./vendor/unocss-mnpxkox6.js";import{C as xe,S as Le}from"./constants-b32h69zq.js";import{_ as xt}from"./nsection-block-hjiyf44n.js";import{_ as Ct}from"./ndrawer.vue-fdnlfvql.js";import"./vendor/shiki-hhqxa887.js";import"./ncheckbox.vue-ir8t2t9x.js";import"./client-dgt05ivb.js";import"./nicon-title.vue-ef3vf9hr.js";function St(e,l){if(typeof e!="string")throw new TypeError("argument str must be a string");const n={},o=l||{},y=o.decode||Tt;let f=0;for(;f<e.length;){const d=e.indexOf("=",f);if(d===-1)break;let m=e.indexOf(";",f);if(m===-1)m=e.length;else if(m<d){f=e.lastIndexOf(";",d-1)+1;continue}const g=e.slice(f,d).trim();if(o?.filter&&!o?.filter(g)){f=m+1;continue}if(n[g]===void 0){let u=e.slice(d+1,m).trim();u.codePointAt(0)===34&&(u=u.slice(1,-1)),n[g]=$t(u,y)}f=m+1}return n}function Tt(e){return e.includes("%")?decodeURIComponent(e):e}function $t(e,l){try{return l(e)}catch{return e}}const ae=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function Ce(e,l,n){const o=n||{},y=o.encode||encodeURIComponent;if(typeof y!="function")throw new TypeError("option encode is invalid");if(!ae.test(e))throw new TypeError("argument name is invalid");const f=y(l);if(f&&!ae.test(f))throw new TypeError("argument val is invalid");let d=e+"="+f;if(o.maxAge!==void 0&&o.maxAge!==null){const m=o.maxAge-0;if(Number.isNaN(m)||!Number.isFinite(m))throw new TypeError("option maxAge is invalid");d+="; Max-Age="+Math.floor(m)}if(o.domain){if(!ae.test(o.domain))throw new TypeError("option domain is invalid");d+="; Domain="+o.domain}if(o.path){if(!ae.test(o.path))throw new TypeError("option path is invalid");d+="; Path="+o.path}if(o.expires){if(!Et(o.expires)||Number.isNaN(o.expires.valueOf()))throw new TypeError("option expires is invalid");d+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(d+="; HttpOnly"),o.secure&&(d+="; Secure"),o.priority)switch(typeof o.priority=="string"?o.priority.toLowerCase():o.priority){case"low":{d+="; Priority=Low";break}case"medium":{d+="; Priority=Medium";break}case"high":{d+="; Priority=High";break}default:throw new TypeError("option priority is invalid")}if(o.sameSite)switch(typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite){case!0:{d+="; SameSite=Strict";break}case"lax":{d+="; SameSite=Lax";break}case"strict":{d+="; SameSite=Strict";break}case"none":{d+="; SameSite=None";break}default:throw new TypeError("option sameSite is invalid")}return o.partitioned&&(d+="; Partitioned"),d}function Et(e){return Object.prototype.toString.call(e)==="[object Date]"||e instanceof Date}const Pe=ye({__name:"ServerRouteListItem",props:{item:{},index:{default:0}},setup(e){const l=L(!0),n=$e();return(o,y)=>{const f=Ee,d=je,m=Pe;return r(),k("div",null,[i("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"",class:M([{"bg-active":b(n)===o.item.filepath}]),style:ct({paddingLeft:`calc(0.5rem + ${o.index*1.5}em)`}),onClick:y[0]||(y[0]=g=>{l.value=!l.value,n.value=o.item.filepath})},[i("div",{class:M({"w-12":!o.item.routes}),"flex-none":"","text-left":""},[o.item.type==="collection"?(r(),$(f,{key:0,icon:"carbon:chevron-right","mb0.5":"","transform-rotate":l.value?90:0,transition:""},null,8,["transform-rotate"])):(r(),$(d,{key:1,class:M(b(le)(o.item.method||"*")),textContent:U((o.item.method||"*").toUpperCase())},null,8,["class","textContent"]))],2),i("span",{class:M({"flex items-center":o.item.routes}),"text-sm":"","font-mono":""},[o.item.type==="collection"?(r(),$(f,{key:0,title:`${o.item.routes?.length} routes`,icon:"carbon:folder",mr1:""},null,8,["title"])):P("",!0),K(" "+U(o.item.route),1)],2)],6),y[1]||(y[1]=i("div",{"x-divider":""},null,-1)),l.value?pt(o.$slots,"default",{key:0},()=>[(r(!0),k(N,null,W(o.item.routes,g=>(r(),$(m,{key:g.filepath,item:g,index:o.index+1},null,8,["item","index"]))),128))]):P("",!0)])}}});function B(e){if(typeof e!="object")return e;var l,n,o=Object.prototype.toString.call(e);if(o==="[object Object]"){if(e.constructor!==Object&&typeof e.constructor=="function"){n=new e.constructor;for(l in e)e.hasOwnProperty(l)&&n[l]!==e[l]&&(n[l]=B(e[l]))}else{n={};for(l in e)l==="__proto__"?Object.defineProperty(n,l,{value:B(e[l]),configurable:!0,enumerable:!0,writable:!0}):n[l]=B(e[l])}return n}if(o==="[object Array]"){for(l=e.length,n=Array(l);l--;)n[l]=B(e[l]);return n}return o==="[object Set]"?(n=new Set,e.forEach(function(y){n.add(B(y))}),n):o==="[object Map]"?(n=new Map,e.forEach(function(y,f){n.set(B(f),B(y))}),n):o==="[object Date]"?new Date(+e):o==="[object RegExp]"?(n=new RegExp(e.source,e.flags),n.lastIndex=e.lastIndex,n):o==="[object DataView]"?new e.constructor(B(e.buffer)):o==="[object ArrayBuffer]"?e.slice(0):o.slice(-6)==="Array]"?new e.constructor(e):e}const Dt={path:"/",watch:!0,decode:e=>wt(decodeURIComponent(e)),encode:e=>encodeURIComponent(typeof e=="string"?e:JSON.stringify(e))},se=window.cookieStore;function Rt(e,l){const n={...Dt,...l};n.filter??=g=>g===e;const o=Se(n)||{};let y;n.maxAge!==void 0?y=n.maxAge*1e3:n.expires&&(y=n.expires.getTime()-Date.now());const f=y!==void 0&&y<=0,d=B(f?void 0:o[e]??n.default?.()),m=y&&!f?It(d,y,n.watch&&n.watch!=="shallow"):L(d);{let g=null;try{!se&&typeof BroadcastChannel<"u"&&(g=new BroadcastChannel(`nuxt:cookies:${e}`))}catch{}const u=()=>{n.readonly||Ge(m.value,o[e])||(jt(e,m.value,n),o[e]=B(m.value),g?.postMessage({value:n.encode(m.value)}))},E=A=>{const S=A.refresh?Se(n)?.[e]:n.decode(A.value);I=!0,m.value=S,o[e]=B(S),vt(()=>{I=!1})};let I=!1;const F=!!Ue();if(F&&me(()=>{I=!0,u(),g?.close()}),se){const A=S=>{const _=S.changed.find(h=>h.name===e),O=S.deleted.find(h=>h.name===e);_&&E({value:_.value}),O&&E({value:null})};se.addEventListener("change",A),F&&me(()=>se.removeEventListener("change",A))}else g&&(g.onmessage=({data:A})=>E(A));n.watch?Ie(m,()=>{I||u()},{deep:n.watch!=="shallow"}):u()}return m}function Se(e={}){return St(document.cookie,e)}function Vt(e,l,n={}){return l==null?Ce(e,l,{...n,maxAge:-1}):Ce(e,l,n)}function jt(e,l,n={}){document.cookie=Vt(e,l,n)}const Te=2147483647;function It(e,l,n){let o,y,f=0;const d=n?L(e):{value:e};return Ue()&&me(()=>{y?.(),clearTimeout(o)}),ft((m,g)=>{n&&(y=Ie(d,g));function u(){f=0,clearTimeout(o);const E=l-f,I=E<Te?E:Te;o=setTimeout(()=>{if(f+=I,f<l)return u();d.value=void 0,g()},I)}return{get(){return m(),d.value},set(E){u(),d.value=E,g()}}})}const Ut={"h-full":"","w-full":"",flex:"~ col"},Ot={flex:"~ col gap-2","flex-none":"",p4:"","n-navbar-glass":""},Nt={flex:"~ gap2 items-center"},Lt={relative:"","w-full":""},Pt={absolute:"","right-2":"","top-1.5":"",flex:"~ gap-1"},At={flex:"~ gap2 wrap","w-full":"","items-center":"",px4:"",pb2:"","text-center":"","text-sm":"",border:"b base"},Bt={class:"hidden md:block"},qt={key:0,border:"b base","items-center":"",px4:"",py2:"",grid:"~ cols-[max-content_1fr] gap-2"},Mt={"text-right":"","font-mono":""},Ft={key:1,border:"b base",p4:"",flex:"~ col gap-4","font-mono":""},Ht={flex:"~ gap-4"},zt={flex:"~ gap2","mb--2":"","items-center":"",op50:""},Wt={key:2},Jt={key:3,border:"b base",relative:"","n-code-block":""},Gt={flex:"~ wrap","w-full":""},Kt=["onClick"],Qt={border:"b base",flex:"~ gap2","items-center":"",px4:"",py2:""},Xt={key:1,"text-xs":"",op50:""},Yt={key:0,"flex-auto":"","overflow-auto":""},Zt={border:"~ base","h-full":"","w-full":"",rounded:""},eo=["data"],to={key:2,"flex-auto":"","overflow-auto":"",p4:""},oo={border:"~ base",rounded:""},no=["src"],ao={key:1,controls:"",rounded:""},so=["src"],lo=ye({__name:"ServerRouteDetails",props:{route:{}},emits:["openDefaultInput"],setup(e,{emit:l}){const n=e,o=l,[y,f]=Ke(),d=Qe(),m=Xe(),g=Ye(),u=ve({contentType:"text/plain",data:"",statusCode:200,error:void 0,fetchTime:0}),E=V(()=>u.contentType.includes("application/json")?"json":u.contentType.includes("text/html")?"html":u.contentType.includes("text/css")?"css":u.contentType.includes("text/javascript")?"javascript":u.contentType.includes("image")||u.contentType.includes("video")?"media":u.contentType.includes("text/xml")||u.contentType.includes("application/xml")?"xml":u.contentType.includes("application/pdf")?"pdf":"text"),I=V(()=>{if(E.value==="json")return JSON.stringify(u.data,null,2);if(E.value==="media"||E.value==="pdf"){const a=new Blob([u.data],{type:u.contentType});return URL.createObjectURL(a)}return u.data}),F=L(!1),A=L(!1),S=Ze(),_=V(()=>n.route.route?.split(/((?:\*\*)?:\w+)/g)),O=V(()=>_.value?.filter(a=>a.startsWith(":")||a.startsWith("**:"))||[]),h=L(n.route.method||"GET"),D=L({}),w=ve({query:[{active:!0,key:"",value:"",type:"string"}],body:[{active:!0,key:"",value:"",type:"string"}],headers:[{active:!0,key:"Content-Type",value:"application/json",type:"string"}]}),j=L({}),{inputDefaults:x,sendFrom:H}=De("serverRoutes"),Q=V(()=>g?.value?.app?.$fetch?H.value:"devtools"),re=["GET","POST","PUT","PATCH","DELETE","HEAD"],ie=["PATCH","POST","PUT","DELETE"],ee=V(()=>ie.includes(h.value.toUpperCase())),c=L(),te=["input","json"],J=L(te[0]),ue=V({get:()=>w[c.value],set:a=>{w[c.value]=a}}),he=V(()=>({...G(x.value.query),...G(w.query)})),ge=V(()=>({...G(x.value.headers),...G(w.headers)})),de=V(()=>ee.value?J.value==="json"?{...G(x.value.body),...j.value}:{...G(x.value.body),...G(w.body)}:void 0),Ae=V(()=>{let a=window?.location.origin;return a.charAt(a.length-1)==="/"&&(a=a.slice(0,-1)),a}),oe=V(()=>{let a=new URLSearchParams(he.value).toString();a&&(a=`?${a}`);const t=(_.value?.map(R=>(R.startsWith(":")||R.startsWith("**:"))&&D.value[R]||R).join("")||"")+a;let p=m.value?.app.baseURL||"";return(p==="./"||p===".")&&(p=""),p.endsWith("/")&&(p=p.slice(0,-1)),p+t}),be=V(()=>Ae.value+oe.value);function G(a){const t=Object.fromEntries(a.filter(({active:p,key:R,value:T})=>p&&R&&T!==void 0).map(({key:p,value:R})=>[p,R]));return Object.entries(t).length?t:void 0}async function _e(){A.value=!0,F.value=!0;const a=Date.now(),t=Q.value==="app"?g.value.app.$fetch:$fetch;nt("server-routes:fetch",{method:h.value,sendFrom:Q.value});try{u.data=await t(be.value,{method:h.value.toUpperCase(),headers:ge.value,query:he.value,body:de.value,onResponse({response:p}){u.contentType=(p.headers.get("content-type")||"").toString().toLowerCase().trim(),u.statusCode=p.status,u.error=void 0},onResponseError(p){u.error=p.response._data,u.data=p.response._data}})}catch{}F.value=!1,u.fetchTime=Date.now()-a}const ke=V(()=>{const a=[],t=[],p=Object.entries(ge.value).filter(([T,q])=>T&&q&&!(T==="Content-Type"&&q==="application/json")).map(([T,q])=>` '${T}': '${q}'`).join(`,
|
|
2
2
|
`);h.value.toUpperCase()!=="GET"&&t.push(`method: '${h.value.toUpperCase()}'`),p&&t.push(`headers: {
|
|
3
3
|
${p}
|
|
4
4
|
}`),de.value&&t.push(`body: ${JSON.stringify(de.value,null,2)}`);const R=t.length?`, {
|
|
@@ -6,4 +6,4 @@ ${t.join(`,
|
|
|
6
6
|
`).split(`
|
|
7
7
|
`).map(T=>` ${T}`).join(`
|
|
8
8
|
`)}
|
|
9
|
-
}`:"";return a.push({name:"useFetch",lang:"javascript",docs:xe.nuxt.useFetch,code:`const { data, pending, error, refresh } = useFetch('${oe.value}'${R})`}),a.push({name:"$fetch",lang:"javascript",docs:xe.nuxt.$fetch,code:`await $fetch('${oe.value}'${R})`}),a}),X=L(qe()),z=ve({key:"",value:""}),Be=V(()=>{const a=[];return O.value.length&&a.push({name:"Params",slug:"params",length:O.value.length}),a.push({name:"Query",slug:"query",length:w.query.length}),ee.value&&a.push({name:"Body",slug:"body",length:w.body.length}),a.push({name:"Headers",slug:"headers",length:w.headers.length}),a.push({name:"Cookies",slug:"cookies",length:X.value.length}),a.push({name:"Snippets",slug:"snippet"}),a});function qe(){return document.cookie.split("; ").map(a=>{const[t,p]=a.split("=");return{key:t,value:p}}).filter(a=>a.key)}function ce(a,t){if(!a)return;const p=X.value.find(T=>T.key===a),R=Rt(a);p!==void 0?t===void 0&&(X.value=X.value.filter(T=>T.key!==a)):(X.value.push({key:a,value:t}),z.key="",z.value=""),R.value=t}mt(()=>{J.value==="json"&&typeof j.value=="string"&&(j.value=JSON.parse(j.value))});const pe=et("nuxt-devtools:server-routes:inputs",()=>[],{window:window.parent});tt([w,c],()=>{const a=pe.value?.find(t=>t.path===n.route.filepath);if(a){c.value||(c.value=a.tab),a.tab!==c.value&&(a.tab=c.value);const{body:t,query:p,headers:R,params:T}=a.inputs;Object.assign(w,{body:t,query:p,headers:R}),D.value=T}else{const t={path:n.route.filepath,tab:O.value.length?"params":"query",inputs:{...w,...O.value.length?{params:D.value}:{}}};pe.value.push(t),c.value||(c.value=t.tab)}},{immediate:!0,deep:!0,debounce:500});function Me(){pe.value=[],w.body=[],w.query=[],w.headers=[],D.value={},c.value=O.value.length?"params":"query"}const Fe=ot();return(a,t)=>{const p=Re,R=bt,T=at,q=Ee,we=Ne,He=_t,ze=Ve,We=st,fe=je,Je=kt,ne=Oe("tooltip");return r(),k("div",It,[i("div",Ot,[i("div",Nt,[a.route.method?(r(),$(p,{key:0,class:M(["n-badge-base n-sm",b(le)(h.value)]),"pointer-events-none":"","font-mono":"",tabindex:"-1"},{default:C(()=>[K(I(h.value.toUpperCase()),1)]),_:1},8,["class"])):(r(),$(R,{key:1,modelValue:h.value,"onUpdate:modelValue":t[0]||(t[0]=s=>h.value=s),class:M(["n-badge-base n-sm",b(le)(h.value)])},{default:C(()=>[(r(),k(N,null,W(re,s=>i("option",{key:s,class:M(b(le)(s))},I(s.toUpperCase()),3)),64))]),_:1},8,["modelValue","class"])),i("div",Lt,[v(T,{"model-value":oe.value,readonly:"","flex-auto":"","font-mono":"",p:"x5 y2",n:"sm"},null,8,["model-value"]),i("div",Pt,[Z(v(p,{title:"Copy URL",n:"xs blue",icon:"carbon:copy",border:!1,onClick:t[1]||(t[1]=s=>b(Fe)(be.value,"server-route-url"))},null,512),[[ne,"Copy URL"]]),Z(v(p,{title:"Open in Editor",icon:"carbon-launch",n:"xs blue",border:!1,onClick:t[2]||(t[2]=s=>b(S)(a.route.filepath))},null,512),[[ne,"Open in Editor"]])])]),v(p,{"h-full":"",n:"primary solid",onClick:_e},{default:C(()=>[v(q,{icon:"carbon:send"})]),_:1})])]),i("div",At,[(r(!0),k(N,null,W(Be.value,s=>Z((r(),$(p,{key:s.slug,class:M(c.value===s.slug?"text-primary n-primary":"border-transparent shadow-none"),onClick:Y=>c.value=s.slug},{default:C(()=>[v(q,{icon:b(Le)[s.slug]},null,8,["icon"]),i("div",Bt,[K(I(s.name)+" "+I(s?.length?`(${s.length})`:"")+" ",1),i("span",null,I(b(x)[s.slug]?.length?`(${b(x)[s.slug].length})`:""),1)])]),_:2},1032,["class","onClick"])),[[ne,s.name]])),128)),t[12]||(t[12]=i("div",{"flex-auto":""},null,-1)),t[13]||(t[13]=i("div",{"text-xs":"",op50:""}," Send from ",-1)),v(R,{modelValue:Q.value,"onUpdate:modelValue":t[3]||(t[3]=s=>Q.value=s),class:"n-xs",disabled:!b(g)?.app?.$fetch},{default:C(()=>t[11]||(t[11]=[i("option",{value:"app"}," App ",-1),i("option",{value:"devtools"}," DevTools ",-1)])),_:1},8,["modelValue","disabled"]),Z(v(p,{n:"orange",class:"p-3",icon:"i-carbon-clean",onClick:Me},null,512),[[ne,"Clear Inputs Saved Cache"]])]),c.value==="params"?(r(),k("div",qt,[(r(!0),k(N,null,W(O.value,s=>(r(),k(N,{key:s},[i("div",Mt,I(s),1),v(T,{modelValue:D.value[s],"onUpdate:modelValue":Y=>D.value[s]=Y,placeholder:s,"flex-1":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])],64))),128))])):P("",!0),c.value==="cookies"?(r(),k("div",Ft,[(r(!0),k(N,null,W(X.value,s=>(r(),k("div",{key:s.key,flex:"~ gap-4 items-center"},[v(T,{placeholder:"Key...","model-value":s.key,disabled:"","op-70":""},null,8,["model-value"]),v(T,{placeholder:"Value...","model-value":s.value,"flex-1":"",n:"primary",onInput:Y=>ce(s.key,Y.target?.value)},null,8,["model-value","onInput"]),v(p,{title:"Delete",n:"red",onClick:Y=>ce(s.key,void 0)},{default:C(()=>[v(q,{icon:"i-carbon-trash-can"})]),_:2},1032,["onClick"])]))),128)),i("div",Ht,[v(T,{modelValue:z.key,"onUpdate:modelValue":t[4]||(t[4]=s=>z.key=s),placeholder:"Key",n:"primary","flex-1":""},null,8,["modelValue"]),v(T,{modelValue:z.value,"onUpdate:modelValue":t[5]||(t[5]=s=>z.value=s),placeholder:"Value",n:"primary","flex-1":""},null,8,["modelValue"]),v(p,{title:"Add",n:"primary",onClick:t[6]||(t[6]=s=>ce(z.key,z.value))},{default:C(()=>[v(q,{icon:"i-carbon-save"})]),_:1})])])):P("",!0),v(b(y),null,{default:C(()=>[v(we,{modelValue:ue.value,"onUpdate:modelValue":t[9]||(t[9]=s=>ue.value=s),default:{active:!0,type:"string"},"max-h-xs":"","of-auto":""},{default:C(()=>[b(x)[c.value]?.length?(r(),k(N,{key:0},[i("div",zt,[t[14]||(t[14]=i("div",{"w-5":"","x-divider":""},null,-1)),t[15]||(t[15]=i("div",{"flex-none":""}," Default Inputs ",-1)),v(p,{icon:"i-carbon-edit",border:!1,onClick:t[7]||(t[7]=s=>o("open-default-input"))}),t[16]||(t[16]=i("div",{"x-divider":""},null,-1))]),v(we,{modelValue:b(x)[c.value],"onUpdate:modelValue":t[8]||(t[8]=s=>b(x)[c.value]=s),disabled:"",p0:""},null,8,["modelValue"])],64)):P("",!0)]),_:1},8,["modelValue"])]),_:1}),c.value==="snippet"?(r(),k("div",Wt,[ke.value.length?(r(),$(He,{key:0,"code-snippets":ke.value},null,8,["code-snippets"])):P("",!0)])):ue.value?(r(),k("div",Jt,[c.value==="body"?(r(),k(N,{key:0},[i("div",Gt,[(r(),k(N,null,W(te,s=>i("button",{key:s,px4:"",py2:"",border:"r base",hover:"bg-active",class:M({"border-b":s!==J.value}),onClick:Y=>J.value=s},[i("div",{class:M({op30:s!==J.value}),"font-mono":""},I(s),3)],10,Kt)),64)),t[17]||(t[17]=i("div",{border:"b base","flex-auto":""},null,-1))]),J.value==="input"?(r(),$(b(f),{key:0})):J.value==="json"?(r(),$(b(ht),yt({key:1,modelValue:j.value,"onUpdate:modelValue":t[10]||(t[10]=s=>j.value=s),class:[b(d)==="dark"?"jse-theme-dark":"light","json-editor-vue of-auto text-sm outline-none"]},a.$attrs,{mode:"text","navigation-bar":!1,indentation:2,"tab-size":2}),null,16,["modelValue","class"])):P("",!0)],64)):(r(),$(b(f),{key:1}))])):P("",!0),A.value?F.value?(r(),$(We,{key:5,"z-10":"","flex-auto":"","backdrop-blur":""},{default:C(()=>t[19]||(t[19]=[K(" Fetching... ")])),_:1})):(r(),k(N,{key:6},[i("div",Qt,[t[21]||(t[21]=i("div",null,"Response",-1)),u.error?(r(),$(fe,{key:0,n:"red"},{default:C(()=>t[20]||(t[20]=[K(" Error ")])),_:1})):P("",!0),v(fe,{n:u.error?"orange":"green",textContent:I(u.statusCode)},null,8,["n","textContent"]),u.contentType?(r(),k("code",Xt,I(u.contentType),1)):P("",!0),t[22]||(t[22]=i("div",{"flex-auto":""},null,-1)),t[23]||(t[23]=i("div",{op50:""}," Request finished in ",-1)),v(fe,{n:"green"},{default:C(()=>[K(I(u.fetchTime)+" ms ",1)]),_:1})]),E.value==="pdf"?(r(),k("div",Yt,[i("div",Zt,[i("object",{data:U.value,type:"application/pdf","flex-auto":"",width:"100%",height:"100%",rounded:""},null,8,eo)])])):E.value!=="media"?(r(),$(Je,{key:1,"flex-auto":"","overflow-auto":"","py-2":"",code:U.value,lang:E.value},null,8,["code","lang"])):(r(),k("div",to,[i("div",oo,[u.contentType.includes("image")?(r(),k("img",{key:0,rounded:"",src:U.value},null,8,no)):(r(),k("video",ao,[i("source",{src:U.value,type:"video/mp4"},null,8,so)]))])]))],64)):(r(),$(ze,{key:4},{default:C(()=>[v(p,{n:"primary",onClick:_e},{default:C(()=>[v(q,{icon:"carbon:send"}),t[18]||(t[18]=K(" Send request "))]),_:1})]),_:1}))])}}}),ro={flex:"~ gap1","text-sm":""},io={key:0,op50:""},uo={op50:""},$o=ye({__name:"server-routes",setup(e){const l=L(!1),n=lt(),o=$e(),{selectedRoute:y,view:f,inputDefaults:d}=De("serverRoutes"),m=V(()=>{!o.value&&y.value&&(o.value=y.value.filepath);const S=n.value?.find(_=>_.filepath===o.value);return o.value!==y.value?.filepath&&S&&(y.value=S),S}),g=L(""),u=V(()=>new rt(n.value||[],{keys:["method","route"],shouldSort:!0})),E=V(()=>n.value?g.value?u.value.search(g.value).map(_=>_.item):n.value:[]),U=V(()=>{const S=[],_=(h,D)=>{h.routes=h.routes||[],h.routes.push(D)},O=(h,D)=>{const w=D?D.routes?.find(x=>x.route===h):S.find(x=>x.route===h);if(w)return w;const j={route:h,filepath:h.replace(/\W/g,"-").toLowerCase(),type:"collection",routes:[]};return D?_(D,j):S.push(j),j};return E.value.forEach(h=>{let D,w;const j=h.filepath.split("/"),x=j.slice(j.indexOf("server")+1);if(h.type==="runtime"){x[0]="runtime";const H=j.indexOf("dist");H!==-1&&(D=j[H-1],D&&x.splice(1,0,D))}x.length>0&&x[x.length-1].includes(".")&&x.pop(),x.forEach(H=>{w=O(H,w)}),w?_(w,h):S.push(h)}),S});function F(){f.value=f.value==="tree"?"list":"tree"}function A(S){return S.charAt(0).toUpperCase()+S.slice(1)}return(S,_)=>{const O=Re,h=dt,D=Pe,w=lo,j=ut,x=Ve,H=it,Q=Ne,re=xt,ie=Ct,ee=Oe("tooltip");return r(),k(N,null,[v(H,{"storage-key":"tab-server-routes"},{left:C(()=>[v(h,{search:g.value,"onUpdate:search":_[1]||(_[1]=c=>g.value=c),pb2:""},{actions:C(()=>[Z(v(O,{"text-lg":"",icon:b(f)==="list"?"i-carbon-list":"i-carbon-tree-view-alt",title:"Toggle view",border:!1,onClick:F},null,8,["icon"]),[[ee,"Toggle View"]]),Z(v(O,{"text-lg":"",icon:"i-carbon-cics-sit-overrides",title:"Default Inputs",border:!1,onClick:_[0]||(_[0]=c=>l.value=!l.value)},null,512),[[ee,"Default Inputs"]])]),default:C(()=>[i("div",ro,[g.value?(r(),k("span",io,I(E.value.length)+" matched · ",1)):P("",!0),i("span",uo,I(b(n)?.length)+" routes in total",1)])]),_:1},8,["search"]),(r(!0),k(N,null,W(b(f)==="tree"?U.value:E.value,c=>(r(),$(D,{key:c.filepath,item:c},null,8,["item"]))),128))]),right:C(()=>[(r(),$(gt,{max:10},[m.value?(r(),$(w,{key:m.value.filepath,route:m.value,onOpenDefaultInput:_[2]||(_[2]=c=>l.value=!0)},null,8,["route"])):P("",!0)],1024)),m.value?P("",!0):(r(),$(x,{key:0},{default:C(()=>[v(j,{px6:"",py2:""},{default:C(()=>_[5]||(_[5]=[i("span",{op75:""},"Select a route to start",-1)])),_:1})]),_:1}))]),_:1}),v(ie,{modelValue:l.value,"onUpdate:modelValue":_[3]||(_[3]=c=>l.value=c),"auto-close":"","max-w-xl":"","min-w-xl":"",onClose:_[4]||(_[4]=c=>l.value=!1)},{default:C(()=>[i("div",null,[_[6]||(_[6]=i("div",{p4:"",border:"b base"},[i("span",{"text-lg":""},"Default Inputs"),i("br"),i("span",{"text-white":"",op50:""},"Merged as default for every request in DevTools")],-1)),(r(!0),k(N,null,W(Object.keys(b(d)),c=>(r(),$(re,{key:c,text:`${A(c)} ${b(d)[c].length?`(${b(d)[c].length})`:""}`,padding:!1,icon:b(Le)[c]},{default:C(()=>[v(Q,{modelValue:b(d)[c],"onUpdate:modelValue":te=>b(d)[c]=te,py0:"",default:{active:!0,type:"string"}},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["text","icon"]))),128))])]),_:1},8,["modelValue"])],64)}}});export{$o as default};
|
|
9
|
+
}`:"";return a.push({name:"useFetch",lang:"javascript",docs:xe.nuxt.useFetch,code:`const { data, pending, error, refresh } = useFetch('${oe.value}'${R})`}),a.push({name:"$fetch",lang:"javascript",docs:xe.nuxt.$fetch,code:`await $fetch('${oe.value}'${R})`}),a}),X=L(qe()),z=ve({key:"",value:""}),Be=V(()=>{const a=[];return O.value.length&&a.push({name:"Params",slug:"params",length:O.value.length}),a.push({name:"Query",slug:"query",length:w.query.length}),ee.value&&a.push({name:"Body",slug:"body",length:w.body.length}),a.push({name:"Headers",slug:"headers",length:w.headers.length}),a.push({name:"Cookies",slug:"cookies",length:X.value.length}),a.push({name:"Snippets",slug:"snippet"}),a});function qe(){return document.cookie.split("; ").map(a=>{const[t,p]=a.split("=");return{key:t,value:p}}).filter(a=>a.key)}function ce(a,t){if(!a)return;const p=X.value.find(T=>T.key===a),R=Rt(a);p!==void 0?t===void 0&&(X.value=X.value.filter(T=>T.key!==a)):(X.value.push({key:a,value:t}),z.key="",z.value=""),R.value=t}mt(()=>{J.value==="json"&&typeof j.value=="string"&&(j.value=JSON.parse(j.value))});const pe=et("nuxt-devtools:server-routes:inputs",()=>[],{window:window.parent});tt([w,c],()=>{const a=pe.value?.find(t=>t.path===n.route.filepath);if(a){c.value||(c.value=a.tab),a.tab!==c.value&&(a.tab=c.value);const{body:t,query:p,headers:R,params:T}=a.inputs;Object.assign(w,{body:t,query:p,headers:R}),D.value=T}else{const t={path:n.route.filepath,tab:O.value.length?"params":"query",inputs:{...w,...O.value.length?{params:D.value}:{}}};pe.value.push(t),c.value||(c.value=t.tab)}},{immediate:!0,deep:!0,debounce:500});function Me(){pe.value=[],w.body=[],w.query=[],w.headers=[],D.value={},c.value=O.value.length?"params":"query"}const Fe=ot();return(a,t)=>{const p=Re,R=bt,T=at,q=Ee,we=Ne,He=_t,ze=Ve,We=st,fe=je,Je=kt,ne=Oe("tooltip");return r(),k("div",Ut,[i("div",Ot,[i("div",Nt,[a.route.method?(r(),$(p,{key:0,class:M(["n-badge-base n-sm",b(le)(h.value)]),"pointer-events-none":"","font-mono":"",tabindex:"-1"},{default:C(()=>[K(U(h.value.toUpperCase()),1)]),_:1},8,["class"])):(r(),$(R,{key:1,modelValue:h.value,"onUpdate:modelValue":t[0]||(t[0]=s=>h.value=s),class:M(["n-badge-base n-sm",b(le)(h.value)])},{default:C(()=>[(r(),k(N,null,W(re,s=>i("option",{key:s,class:M(b(le)(s))},U(s.toUpperCase()),3)),64))]),_:1},8,["modelValue","class"])),i("div",Lt,[v(T,{"model-value":oe.value,readonly:"","flex-auto":"","font-mono":"",p:"x5 y2",n:"sm"},null,8,["model-value"]),i("div",Pt,[Z(v(p,{title:"Copy URL",n:"xs blue",icon:"carbon:copy",border:!1,onClick:t[1]||(t[1]=s=>b(Fe)(be.value,"server-route-url"))},null,512),[[ne,"Copy URL"]]),Z(v(p,{title:"Open in Editor",icon:"carbon-launch",n:"xs blue",border:!1,onClick:t[2]||(t[2]=s=>b(S)(a.route.filepath))},null,512),[[ne,"Open in Editor"]])])]),v(p,{"h-full":"",n:"primary solid",onClick:_e},{default:C(()=>[v(q,{icon:"carbon:send"})]),_:1})])]),i("div",At,[(r(!0),k(N,null,W(Be.value,s=>Z((r(),$(p,{key:s.slug,class:M(c.value===s.slug?"text-primary n-primary":"border-transparent shadow-none"),onClick:Y=>c.value=s.slug},{default:C(()=>[v(q,{icon:b(Le)[s.slug]},null,8,["icon"]),i("div",Bt,[K(U(s.name)+" "+U(s?.length?`(${s.length})`:"")+" ",1),i("span",null,U(b(x)[s.slug]?.length?`(${b(x)[s.slug].length})`:""),1)])]),_:2},1032,["class","onClick"])),[[ne,s.name]])),128)),t[12]||(t[12]=i("div",{"flex-auto":""},null,-1)),t[13]||(t[13]=i("div",{"text-xs":"",op50:""}," Send from ",-1)),v(R,{modelValue:Q.value,"onUpdate:modelValue":t[3]||(t[3]=s=>Q.value=s),class:"n-xs",disabled:!b(g)?.app?.$fetch},{default:C(()=>t[11]||(t[11]=[i("option",{value:"app"}," App ",-1),i("option",{value:"devtools"}," DevTools ",-1)])),_:1},8,["modelValue","disabled"]),Z(v(p,{n:"orange",class:"p-3",icon:"i-carbon-clean",onClick:Me},null,512),[[ne,"Clear Inputs Saved Cache"]])]),c.value==="params"?(r(),k("div",qt,[(r(!0),k(N,null,W(O.value,s=>(r(),k(N,{key:s},[i("div",Mt,U(s),1),v(T,{modelValue:D.value[s],"onUpdate:modelValue":Y=>D.value[s]=Y,placeholder:s,"flex-1":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])],64))),128))])):P("",!0),c.value==="cookies"?(r(),k("div",Ft,[(r(!0),k(N,null,W(X.value,s=>(r(),k("div",{key:s.key,flex:"~ gap-4 items-center"},[v(T,{placeholder:"Key...","model-value":s.key,disabled:"","op-70":""},null,8,["model-value"]),v(T,{placeholder:"Value...","model-value":s.value,"flex-1":"",n:"primary",onInput:Y=>ce(s.key,Y.target?.value)},null,8,["model-value","onInput"]),v(p,{title:"Delete",n:"red",onClick:Y=>ce(s.key,void 0)},{default:C(()=>[v(q,{icon:"i-carbon-trash-can"})]),_:2},1032,["onClick"])]))),128)),i("div",Ht,[v(T,{modelValue:z.key,"onUpdate:modelValue":t[4]||(t[4]=s=>z.key=s),placeholder:"Key",n:"primary","flex-1":""},null,8,["modelValue"]),v(T,{modelValue:z.value,"onUpdate:modelValue":t[5]||(t[5]=s=>z.value=s),placeholder:"Value",n:"primary","flex-1":""},null,8,["modelValue"]),v(p,{title:"Add",n:"primary",onClick:t[6]||(t[6]=s=>ce(z.key,z.value))},{default:C(()=>[v(q,{icon:"i-carbon-save"})]),_:1})])])):P("",!0),v(b(y),null,{default:C(()=>[v(we,{modelValue:ue.value,"onUpdate:modelValue":t[9]||(t[9]=s=>ue.value=s),default:{active:!0,type:"string"},"max-h-xs":"","of-auto":""},{default:C(()=>[b(x)[c.value]?.length?(r(),k(N,{key:0},[i("div",zt,[t[14]||(t[14]=i("div",{"w-5":"","x-divider":""},null,-1)),t[15]||(t[15]=i("div",{"flex-none":""}," Default Inputs ",-1)),v(p,{icon:"i-carbon-edit",border:!1,onClick:t[7]||(t[7]=s=>o("openDefaultInput"))}),t[16]||(t[16]=i("div",{"x-divider":""},null,-1))]),v(we,{modelValue:b(x)[c.value],"onUpdate:modelValue":t[8]||(t[8]=s=>b(x)[c.value]=s),disabled:"",p0:""},null,8,["modelValue"])],64)):P("",!0)]),_:1},8,["modelValue"])]),_:1}),c.value==="snippet"?(r(),k("div",Wt,[ke.value.length?(r(),$(He,{key:0,"code-snippets":ke.value},null,8,["code-snippets"])):P("",!0)])):ue.value?(r(),k("div",Jt,[c.value==="body"?(r(),k(N,{key:0},[i("div",Gt,[(r(),k(N,null,W(te,s=>i("button",{key:s,px4:"",py2:"",border:"r base",hover:"bg-active",class:M({"border-b":s!==J.value}),onClick:Y=>J.value=s},[i("div",{class:M({op30:s!==J.value}),"font-mono":""},U(s),3)],10,Kt)),64)),t[17]||(t[17]=i("div",{border:"b base","flex-auto":""},null,-1))]),J.value==="input"?(r(),$(b(f),{key:0})):J.value==="json"?(r(),$(b(ht),yt({key:1,modelValue:j.value,"onUpdate:modelValue":t[10]||(t[10]=s=>j.value=s),class:[b(d)==="dark"?"jse-theme-dark":"light","json-editor-vue of-auto text-sm outline-none"]},a.$attrs,{mode:"text","navigation-bar":!1,indentation:2,"tab-size":2}),null,16,["modelValue","class"])):P("",!0)],64)):(r(),$(b(f),{key:1}))])):P("",!0),A.value?F.value?(r(),$(We,{key:5,"z-10":"","flex-auto":"","backdrop-blur":""},{default:C(()=>t[19]||(t[19]=[K(" Fetching... ")])),_:1})):(r(),k(N,{key:6},[i("div",Qt,[t[21]||(t[21]=i("div",null,"Response",-1)),u.error?(r(),$(fe,{key:0,n:"red"},{default:C(()=>t[20]||(t[20]=[K(" Error ")])),_:1})):P("",!0),v(fe,{n:u.error?"orange":"green",textContent:U(u.statusCode)},null,8,["n","textContent"]),u.contentType?(r(),k("code",Xt,U(u.contentType),1)):P("",!0),t[22]||(t[22]=i("div",{"flex-auto":""},null,-1)),t[23]||(t[23]=i("div",{op50:""}," Request finished in ",-1)),v(fe,{n:"green"},{default:C(()=>[K(U(u.fetchTime)+" ms ",1)]),_:1})]),E.value==="pdf"?(r(),k("div",Yt,[i("div",Zt,[i("object",{data:I.value,type:"application/pdf","flex-auto":"",width:"100%",height:"100%",rounded:""},null,8,eo)])])):E.value!=="media"?(r(),$(Je,{key:1,"flex-auto":"","overflow-auto":"","py-2":"",code:I.value,lang:E.value},null,8,["code","lang"])):(r(),k("div",to,[i("div",oo,[u.contentType.includes("image")?(r(),k("img",{key:0,rounded:"",src:I.value},null,8,no)):(r(),k("video",ao,[i("source",{src:I.value,type:"video/mp4"},null,8,so)]))])]))],64)):(r(),$(ze,{key:4},{default:C(()=>[v(p,{n:"primary",onClick:_e},{default:C(()=>[v(q,{icon:"carbon:send"}),t[18]||(t[18]=K(" Send request "))]),_:1})]),_:1}))])}}}),ro={flex:"~ gap1","text-sm":""},io={key:0,op50:""},uo={op50:""},$o=ye({__name:"server-routes",setup(e){const l=L(!1),n=lt(),o=$e(),{selectedRoute:y,view:f,inputDefaults:d}=De("serverRoutes"),m=V(()=>{!o.value&&y.value&&(o.value=y.value.filepath);const S=n.value?.find(_=>_.filepath===o.value);return o.value!==y.value?.filepath&&S&&(y.value=S),S}),g=L(""),u=V(()=>new rt(n.value||[],{keys:["method","route"],shouldSort:!0})),E=V(()=>n.value?g.value?u.value.search(g.value).map(_=>_.item):n.value:[]),I=V(()=>{const S=[],_=(h,D)=>{h.routes=h.routes||[],h.routes.push(D)},O=(h,D)=>{const w=D?D.routes?.find(x=>x.route===h):S.find(x=>x.route===h);if(w)return w;const j={route:h,filepath:h.replace(/\W/g,"-").toLowerCase(),type:"collection",routes:[]};return D?_(D,j):S.push(j),j};return E.value.forEach(h=>{let D,w;const j=h.filepath.split("/"),x=j.slice(j.indexOf("server")+1);if(h.type==="runtime"){x[0]="runtime";const H=j.indexOf("dist");H!==-1&&(D=j[H-1],D&&x.splice(1,0,D))}x.length>0&&x[x.length-1].includes(".")&&x.pop(),x.forEach(H=>{w=O(H,w)}),w?_(w,h):S.push(h)}),S});function F(){f.value=f.value==="tree"?"list":"tree"}function A(S){return S.charAt(0).toUpperCase()+S.slice(1)}return(S,_)=>{const O=Re,h=dt,D=Pe,w=lo,j=ut,x=Ve,H=it,Q=Ne,re=xt,ie=Ct,ee=Oe("tooltip");return r(),k(N,null,[v(H,{"storage-key":"tab-server-routes"},{left:C(()=>[v(h,{search:g.value,"onUpdate:search":_[1]||(_[1]=c=>g.value=c),pb2:""},{actions:C(()=>[Z(v(O,{"text-lg":"",icon:b(f)==="list"?"i-carbon-list":"i-carbon-tree-view-alt",title:"Toggle view",border:!1,onClick:F},null,8,["icon"]),[[ee,"Toggle View"]]),Z(v(O,{"text-lg":"",icon:"i-carbon-cics-sit-overrides",title:"Default Inputs",border:!1,onClick:_[0]||(_[0]=c=>l.value=!l.value)},null,512),[[ee,"Default Inputs"]])]),default:C(()=>[i("div",ro,[g.value?(r(),k("span",io,U(E.value.length)+" matched · ",1)):P("",!0),i("span",uo,U(b(n)?.length)+" routes in total",1)])]),_:1},8,["search"]),(r(!0),k(N,null,W(b(f)==="tree"?I.value:E.value,c=>(r(),$(D,{key:c.filepath,item:c},null,8,["item"]))),128))]),right:C(()=>[(r(),$(gt,{max:10},[m.value?(r(),$(w,{key:m.value.filepath,route:m.value,onOpenDefaultInput:_[2]||(_[2]=c=>l.value=!0)},null,8,["route"])):P("",!0)],1024)),m.value?P("",!0):(r(),$(x,{key:0},{default:C(()=>[v(j,{px6:"",py2:""},{default:C(()=>_[5]||(_[5]=[i("span",{op75:""},"Select a route to start",-1)])),_:1})]),_:1}))]),_:1}),v(ie,{modelValue:l.value,"onUpdate:modelValue":_[3]||(_[3]=c=>l.value=c),"auto-close":"","max-w-xl":"","min-w-xl":"",onClose:_[4]||(_[4]=c=>l.value=!1)},{default:C(()=>[i("div",null,[_[6]||(_[6]=i("div",{p4:"",border:"b base"},[i("span",{"text-lg":""},"Default Inputs"),i("br"),i("span",{"text-white":"",op50:""},"Merged as default for every request in DevTools")],-1)),(r(!0),k(N,null,W(Object.keys(b(d)),c=>(r(),$(re,{key:c,text:`${A(c)} ${b(d)[c].length?`(${b(d)[c].length})`:""}`,padding:!1,icon:b(Le)[c]},{default:C(()=>[v(Q,{modelValue:b(d)[c],"onUpdate:modelValue":te=>b(d)[c]=te,py0:"",default:{active:!0,type:"string"}},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["text","icon"]))),128))])]),_:1},8,["modelValue"])],64)}}});export{$o as default};
|