vite-plugin-inspect
Version:
Inspect the intermediate state of Vite plugins
2 lines (1 loc) • 7.66 kB
JavaScript
import{o as t,c as e,a as n,r,u as l,b as o,d as a,e as s,f as i,g as c,h as u,i as d,F as p,t as h,j as m,k as w,l as v,m as x,w as f,n as g,p as k,q as y,s as M,v as b,x as C}from"./vendor.2d084ca7.js";let _;const z={},L=function(t,e){if(!e||0===e.length)return t();if(void 0===_){const t=document.createElement("link").relList;_=t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"}return Promise.all(e.map((t=>{if((t=`/__inspect/${t}`)in z)return;z[t]=!0;const e=t.endsWith(".css"),n=e?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${t}"]${n}`))return;const r=document.createElement("link");return r.rel=e?"stylesheet":_,e||(r.as="script",r.crossOrigin=""),r.href=t,document.head.appendChild(r),e?new Promise(((t,e)=>{r.addEventListener("load",t),r.addEventListener("error",e)})):void 0}))).then((()=>t()))},A={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"1.2em",height:"1.2em",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},H=[n("path",{d:"M14 26l1.41-1.41L7.83 17H28v-2H7.83l7.58-7.59L14 6L4 16l10 10z",fill:"currentColor"},null,-1)];var R={name:"carbon-arrow-left",render:function(n,r){return t(),e("svg",A,H)}};const E={},V={class:"text-[10px] whitespace-nowrap px-2 py-1 mx-1 rounded"};E.render=function(n,l){return t(),e("span",V,[r(n.$slots,"default")])};const j=l(),B=o(j),Y=a(!0),$=a(!1),I=s(i("/__inspect_api/list").get().json()),P=c((()=>{var t;return(null==(t=I.data)?void 0:t.root)||""}));function q(){return I.execute()}const O={key:0,class:"text-sm font-mono my-auto"},D=n("span",{class:"opacity-50"},".",-1),S={key:1};var T=u({props:{id:{type:String,required:!1}},setup(r){const l=r,o=c((()=>{var t,e;return null==(e=null==(t=I.data)?void 0:t.modules.find((t=>t.id===l.id)))?void 0:e.virtual}));return(l,a)=>{const s=E;return r.id?(t(),e("div",O,[r.id.startsWith(d(P))?(t(),e(p,{key:0},[D,n("span",null,h(r.id.slice(d(P).length)),1)],64)):(t(),e("span",S,h(r.id),1)),d(o)?(t(),m(s,{key:2,class:"bg-teal-400/10 text-teal-400",textContent:h("virtual")},null,8,["textContent"])):w("",!0)])):w("",!0)}}});const W={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"1.2em",height:"1.2em",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},F=[n("path",{d:"M12 10H6.78A11 11 0 0 1 27 16h2A13 13 0 0 0 6 7.68V4H4v8h8z",fill:"currentColor"},null,-1),n("path",{d:"M20 22h5.22A11 11 0 0 1 5 16H3a13 13 0 0 0 23 8.32V28h2v-8h-8z",fill:"currentColor"},null,-1)];var U={name:"carbon-renew",render:function(n,r){return t(),e("svg",W,F)}};const G={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"1.2em",height:"1.2em",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},J=[n("path",{d:"M4 23h8v2H4z",fill:"currentColor"},null,-1),n("path",{d:"M24.523 14H4v2h20.5a3.5 3.5 0 0 1 0 7h-5.672l2.586-2.586L20 19l-5 5l5 5l1.414-1.414L18.828 25h5.705a5.5 5.5 0 0 0-.01-11z",fill:"currentColor"},null,-1),n("path",{d:"M4 5h24v2H4z",fill:"currentColor"},null,-1)];var K={name:"carbon-text-wrap",render:function(n,r){return t(),e("svg",G,J)}};const N={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"1.2em",height:"1.2em",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},Q=[n("path",{d:"M28 6H18V4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h10v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zM4 15h6.17l-2.58 2.59L9 19l5-5l-5-5l-1.41 1.41L10.17 13H4V4h12v20H4zm12 13v-2a2 2 0 0 0 2-2V8h10v9h-6.17l2.58-2.59L23 13l-5 5l5 5l1.41-1.41L21.83 19H28v9z",fill:"currentColor"},null,-1)];var X={name:"carbon-compare",render:function(n,r){return t(),e("svg",N,Q)}};const Z={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"1.2em",height:"1.2em",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},tt=[n("path",{d:"M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z",fill:"currentColor"},null,-1)];var et={name:"carbon-moon",render:function(n,r){return t(),e("svg",Z,tt)}};const nt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"1.2em",height:"1.2em",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 32 32"},rt=[v('<path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path>',9)];var lt={name:"carbon-sun",render:function(n,r){return t(),e("svg",nt,rt)}};const ot={class:"text-xl font-light px-6 border-b border-main flex gap-4 h-54px"},at={key:2,class:"text-md my-auto"},st=n("div",{class:"flex-auto"},null,-1);var it=u({props:{id:{type:String,required:!1}},setup:r=>(l,o)=>{const a=R,s=x("router-link"),i=T,c=U,u=K,p=X,h=et,v=lt;return t(),e("nav",ot,["/"!=l.$route.path?(t(),m(s,{key:0,class:"icon-btn !outline-none my-auto",to:"/"},{default:f((()=>[g(a)])),_:1})):w("",!0),r.id?(t(),m(i,{key:1,id:r.id},null,8,["id"])):(t(),e("span",at,"Vite Inspect")),st,n("button",{class:"icon-btn !outline-none my-auto",onClick:o[0]||(o[0]=t=>d(q)())},[g(c)]),n("button",{class:"icon-btn !outline-none my-auto",onClick:o[1]||(o[1]=t=>$.value=!d($))},[g(u,{class:k(d($)?"opacity-100":"opacity-25")},null,8,["class"])]),n("button",{class:"icon-btn !outline-none my-auto",onClick:o[2]||(o[2]=t=>Y.value=!d(Y))},[g(p,{class:k(d(Y)?"opacity-100":"opacity-25")},null,8,["class"])]),n("button",{class:"icon-btn !outline-none my-auto",onClick:o[3]||(o[3]=t=>d(B)())},[d(j)?(t(),m(h,{key:0})):(t(),m(v,{key:1}))])])}});const ct={key:0};var ut=u({setup:n=>(n,r)=>{const l=T,o=x("RouterLink");return d(I).data&&d(I).data.modules?(t(),e("div",ct,[(t(!0),e(p,null,y(d(I).data.modules,(e=>(t(),m(o,{key:e.id,class:"block border-b border-main px-3 py-2 text-left font-mono text-sm",to:`/module?id=${encodeURIComponent(e.id)}`},{default:f((()=>[g(l,{id:e.id},null,8,["id"])])),_:2},1032,["to"])))),128))])):w("",!0)}});const dt={};dt.render=function(n,r){const l=it,o=ut;return t(),e(p,null,[g(l),g(o)],64)};const pt=[{name:"module",path:"/module",component:()=>L((()=>import("./module.b62ccc66.js")),["assets/module.b62ccc66.js","assets/module.14244c0f.css","assets/vendor.2d084ca7.js"]),props:!0},{name:"index",path:"/",component:dt,props:!0},{name:"hi-name",path:"/hi/:name",component:()=>L((()=>import("./[name].b5eaaed8.js")),["assets/[name].b5eaaed8.js","assets/vendor.2d084ca7.js"]),props:!0},{name:"all",path:"/:all(.*)*",component:()=>L((()=>import("./[...all].efd840ef.js")),["assets/[...all].efd840ef.js","assets/vendor.2d084ca7.js"]),props:!0}],ht={},mt={class:"text-gray-700 dark:text-gray-200 w-screen h-screen grid grid-rows-[min-content,1fr]"};ht.render=function(n,r){const l=x("router-view");return t(),e("main",mt,[g(l)])};const wt=M(ht),vt=b({history:C("/__inspect/"),routes:pt});wt.use(vt),wt.mount("#app");export{it as _,I as a,E as b,Y as e,$ as l};