@websublime/vite-plugin-open-api-devtools 0.8.5 → 0.9.0-next.0

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.
Files changed (56) hide show
  1. package/dist/{ModelsPage-DxcKgz3y.js → ModelsPage-DoqfBilK.js} +5 -5
  2. package/dist/{ModelsPage-DxcKgz3y.js.map → ModelsPage-DoqfBilK.js.map} +1 -1
  3. package/dist/{RoutesPage-BCKS0kdj.js → RoutesPage-DmXBJ4J5.js} +4 -4
  4. package/dist/{RoutesPage-BCKS0kdj.js.map → RoutesPage-DmXBJ4J5.js.map} +1 -1
  5. package/dist/{SimulatorPage-BlbxLDdf.js → SimulatorPage-BmM-ExQg.js} +4 -4
  6. package/dist/{SimulatorPage-BlbxLDdf.js.map → SimulatorPage-BmM-ExQg.js.map} +1 -1
  7. package/dist/{TimelinePage-BhtcWy3o.js → TimelinePage-Dnh_47wz.js} +7 -7
  8. package/dist/{TimelinePage-BhtcWy3o.js.map → TimelinePage-Dnh_47wz.js.map} +1 -1
  9. package/dist/{check-BZ_jBwd4.js → check-BdvaZxRt.js} +2 -2
  10. package/dist/{check-BZ_jBwd4.js.map → check-BdvaZxRt.js.map} +1 -1
  11. package/dist/devtools.js +1 -1
  12. package/dist/devtools.umd.cjs +3 -3
  13. package/dist/devtools.umd.cjs.map +1 -1
  14. package/dist/{format-Dq-zmlAN.js → format-Cj8p3HJO.js} +2 -2
  15. package/dist/{format-Dq-zmlAN.js.map → format-Cj8p3HJO.js.map} +1 -1
  16. package/dist/main-HjHdsAps.js +619 -0
  17. package/dist/main-HjHdsAps.js.map +1 -0
  18. package/dist/spa/assets/{ModelsPage-Bd7YM0_p.js → ModelsPage-_etl-kz9.js} +2 -2
  19. package/dist/spa/assets/{ModelsPage-Bd7YM0_p.js.map → ModelsPage-_etl-kz9.js.map} +1 -1
  20. package/dist/spa/assets/{RoutesPage-YQcTov5t.js → RoutesPage-BN_Lo8uo.js} +2 -2
  21. package/dist/spa/assets/{RoutesPage-YQcTov5t.js.map → RoutesPage-BN_Lo8uo.js.map} +1 -1
  22. package/dist/spa/assets/{SimulatorPage-DPxecZGS.js → SimulatorPage-BF4VLn5k.js} +2 -2
  23. package/dist/spa/assets/{SimulatorPage-DPxecZGS.js.map → SimulatorPage-BF4VLn5k.js.map} +1 -1
  24. package/dist/spa/assets/TimelinePage-7OqKgItP.js +2 -0
  25. package/dist/spa/assets/{TimelinePage-CbWvtFc_.js.map → TimelinePage-7OqKgItP.js.map} +1 -1
  26. package/dist/spa/assets/check-9axZ93X-.js +2 -0
  27. package/dist/spa/assets/{check-DaD3RpI4.js.map → check-9axZ93X-.js.map} +1 -1
  28. package/dist/spa/assets/{format-er1_KlP8.js → format-CB-GiJ6N.js} +2 -2
  29. package/dist/spa/assets/{format-er1_KlP8.js.map → format-CB-GiJ6N.js.map} +1 -1
  30. package/dist/spa/assets/index-BQr16DJ3.js +3 -0
  31. package/dist/spa/assets/index-BQr16DJ3.js.map +1 -0
  32. package/dist/spa/assets/{registry-DjJcdO1T.js → registry-DAv66ZPp.js} +2 -2
  33. package/dist/spa/assets/{registry-DjJcdO1T.js.map → registry-DAv66ZPp.js.map} +1 -1
  34. package/dist/spa/assets/{trash-2-BhRxw6RN.js → trash-2-Cj6nHRK8.js} +2 -2
  35. package/dist/spa/assets/{trash-2-BhRxw6RN.js.map → trash-2-Cj6nHRK8.js.map} +1 -1
  36. package/dist/spa/assets/{triangle-alert-QXcMwGDR.js → triangle-alert-BXnev_tx.js} +2 -2
  37. package/dist/spa/assets/{triangle-alert-QXcMwGDR.js.map → triangle-alert-BXnev_tx.js.map} +1 -1
  38. package/dist/spa/assets/{vue-vendor-Bkktf9yg.js → vue-vendor-D62nux6V.js} +2 -2
  39. package/dist/spa/assets/{vue-vendor-Bkktf9yg.js.map → vue-vendor-D62nux6V.js.map} +1 -1
  40. package/dist/spa/assets/x-9zeMJ8Mo.js +2 -0
  41. package/dist/spa/assets/{x-DGt4DUCk.js.map → x-9zeMJ8Mo.js.map} +1 -1
  42. package/dist/spa/index.html +2 -2
  43. package/dist/{trash-2-D9Av3Lfp.js → trash-2-unSVE8Jc.js} +2 -2
  44. package/dist/{trash-2-D9Av3Lfp.js.map → trash-2-unSVE8Jc.js.map} +1 -1
  45. package/dist/{triangle-alert-6Spra6HA.js → triangle-alert-B1V6ucAg.js} +2 -2
  46. package/dist/{triangle-alert-6Spra6HA.js.map → triangle-alert-B1V6ucAg.js.map} +1 -1
  47. package/dist/{x-DI-fqJ3g.js → x-DWlhu3h-.js} +2 -2
  48. package/dist/{x-DI-fqJ3g.js.map → x-DWlhu3h-.js.map} +1 -1
  49. package/package.json +13 -12
  50. package/dist/main-DmyM_bX3.js +0 -537
  51. package/dist/main-DmyM_bX3.js.map +0 -1
  52. package/dist/spa/assets/TimelinePage-CbWvtFc_.js +0 -2
  53. package/dist/spa/assets/check-DaD3RpI4.js +0 -2
  54. package/dist/spa/assets/index-x38XzU3c.js +0 -3
  55. package/dist/spa/assets/index-x38XzU3c.js.map +0 -1
  56. package/dist/spa/assets/x-DGt4DUCk.js +0 -2
@@ -1,4 +1,4 @@
1
- (function(j,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("pinia"),require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","pinia","vue","vue-router"],W):(j=typeof globalThis<"u"?globalThis:j||self,W(j.ViteOpenApiDevtools={},j.Pinia,j.Vue,j.VueRouter))})(this,(function(j,W,e,ce){"use strict";const Le=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Xe=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,l)=>l?l.toUpperCase():s.toLowerCase()),ve=n=>{const t=Xe(n);return t.charAt(0).toUpperCase()+t.slice(1)},et=(...n)=>n.filter((t,s,l)=>!!t&&t.trim()!==""&&l.indexOf(t)===s).join(" ").trim();var de={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const tt=({size:n,strokeWidth:t=2,absoluteStrokeWidth:s,color:l,iconNode:i,name:o,class:y,...E},{slots:_})=>e.h("svg",{...de,width:n||de.width,height:n||de.height,stroke:l||de.stroke,"stroke-width":s?Number(t)*24/Number(n):t,class:et("lucide",...o?[`lucide-${Le(ve(o))}-icon`,`lucide-${Le(o)}`]:["lucide-icon"]),...E},[...i.map(a=>e.h(...a)),..._.default?[_.default()]:[]]);const I=(n,t)=>(s,{slots:l})=>e.h(tt,{...s,iconNode:t,name:n},l);const me=I("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const X=I("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const te=I("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const Re=I("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const nt=I("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const ot=I("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const G=I("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const be=I("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);const Ve=I("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const pe=I("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const Se=I("file-json",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);const Ae=I("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]);const st=I("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const lt=I("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const at=I("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const Be=I("route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);const rt=I("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const ue=I("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const it=I("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);const Ce=I("sprout",[["path",{d:"M7 20h10",key:"e6iznv"}],["path",{d:"M10 20c5.5-2.5.8-6.4 3-10",key:"161w41"}],["path",{d:"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z",key:"9gtqwd"}],["path",{d:"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z",key:"bkxnd2"}]]);const ct=I("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);const fe=I("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const $e=I("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const dt=I("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const mt=I("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);const ae=I("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const ne=I("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),xe={path:"/_ws",reconnectDelay:2e3,maxReconnectAttempts:Number.POSITIVE_INFINITY,autoConnect:!0},O=e.ref("disconnected"),we=e.ref(null),re=e.ref(0);let L=null,ye=null,oe={...xe},De=!1;const Q=new Map;function Oe(){return typeof window<"u"&&typeof WebSocket<"u"}function pt(){return e.getCurrentInstance()!==null}function ut(n){return Oe()?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${n}`:`ws://localhost${n}`}function Pe(){ye!==null&&(clearTimeout(ye),ye=null)}function ft(n,t){const s=Q.get(n);if(s)for(const i of s)try{i(t)}catch(o){console.error(`[DevTools WebSocket] Error in event handler for '${n}':`,o)}const l=Q.get("*");if(l)for(const i of l)try{i({type:n,data:t})}catch(o){console.error("[DevTools WebSocket] Error in wildcard event handler:",o)}}function yt(){O.value="connected",re.value=0,Pe()}function ht(n){try{const t=JSON.parse(n.data);if(t.type==="connected"){const s=t.data;we.value=s.serverVersion}ft(t.type,t.data)}catch(t){console.error("[DevTools WebSocket] Failed to parse message:",t)}}function _t(){O.value,O.value="disconnected",L=null,re.value<oe.maxReconnectAttempts&&(O.value="reconnecting",re.value++,ye=setTimeout(()=>{Te()},oe.reconnectDelay))}function gt(n){console.error("[DevTools WebSocket] Error:",n)}function Te(){if(!Oe()||O.value==="connecting"||O.value==="connected"||L&&(L.readyState===WebSocket.CONNECTING||L.readyState===WebSocket.OPEN))return;He(),O.value="connecting";const n=ut(oe.path);try{L=new WebSocket(n),L.onopen=yt,L.onmessage=ht,L.onclose=_t,L.onerror=gt}catch(t){console.error("[DevTools WebSocket] Failed to create WebSocket:",t),O.value="disconnected"}}function He(){L&&(L.onopen=null,L.onmessage=null,L.onclose=null,L.onerror=null,(L.readyState===WebSocket.OPEN||L.readyState===WebSocket.CONNECTING)&&L.close(),L=null)}function je(){Pe(),He(),O.value="disconnected",re.value=0}function kt(n){if(!L||L.readyState!==WebSocket.OPEN)return!1;try{return L.send(JSON.stringify(n)),!0}catch(t){return console.error("[DevTools WebSocket] Failed to send command:",t),!1}}function Ie(n,t){Q.has(n)||Q.set(n,new Set);const s=Q.get(n);return s&&s.add(t),()=>{const l=Q.get(n);l&&(l.delete(t),l.size===0&&Q.delete(n))}}function ze(n,t){const s=Q.get(n);s&&(s.delete(t),s.size===0&&Q.delete(n))}function Et(n,t){const s=l=>{ze(n,s),t(l)};return Ie(n,s)}function Nt(n,t){const s=l=>{t(l)===!0&&ze(n,s)};return Ie(n,s)}function bt(){je(),we.value=null,Q.clear(),oe={...xe},De=!1}function se(n={}){(!De||O.value==="disconnected")&&(oe={...xe,...n},De=!0);const t=e.computed(()=>O.value==="connected"),s=e.computed(()=>O.value==="reconnecting");return pt()&&e.onMounted(()=>{oe.autoConnect&&Te()}),{connectionState:e.computed(()=>O.value),connected:t,isReconnecting:s,serverVersion:e.computed(()=>we.value),reconnectAttempts:e.computed(()=>re.value),connect:Te,disconnect:je,send:kt,on:Ie,off:ze,once:Et,onUntil:Nt,resetState:bt}}const Ue=[{path:"/",redirect:"/routes"},{path:"/routes",name:"routes",component:()=>Promise.resolve().then(()=>to),meta:{title:"Routes",icon:"route"}},{path:"/timeline",name:"timeline",component:()=>Promise.resolve().then(()=>As),meta:{title:"Timeline",icon:"clock"}},{path:"/models",name:"models",component:()=>Promise.resolve().then(()=>Hl),meta:{title:"Models",icon:"database"}},{path:"/simulator",name:"simulator",component:()=>Promise.resolve().then(()=>pa),meta:{title:"Simulator",icon:"zap"}},{path:"/:pathMatch(.*)*",name:"not-found",redirect:"/routes"}],Vt=ce.createRouter({history:ce.createWebHashHistory(),routes:Ue}),St={class:"app"},Bt={class:"app-header"},Ct={class:"app-header__brand"},$t={class:"app-nav",role:"tablist","aria-label":"DevTools navigation"},xt=["aria-selected","aria-current","aria-controls","onClick"],wt={class:"app-nav__label"},Dt={class:"app-header__status"},Tt={class:"connection-status"},It={class:"connection-status__text"},zt={class:"app-main"},Mt=e.defineComponent({__name:"App",setup(n){const t=ce.useRoute(),s=ce.useRouter(),l=e.computed(()=>Ue.filter(a=>a.name&&a.meta?.title).map(a=>({name:a.name,path:a.path,title:a.meta?.title,icon:a.meta?.icon}))),i=e.computed(()=>t.name);function o(a){s.push(a)}const y={route:Be,clock:G,database:pe,zap:ne};function E(a){return y[a]??Be}const{connected:_}=se();return(a,b)=>{const S=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",St,[e.createElementVNode("header",Bt,[e.createElementVNode("div",Ct,[e.createVNode(e.unref(ne),{class:"app-header__logo",size:20}),b[0]||(b[0]=e.createElementVNode("span",{class:"app-header__title"},"OpenAPI DevTools",-1))]),e.createElementVNode("nav",$t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,B=>(e.openBlock(),e.createElementBlock("button",{key:B.name,role:"tab","aria-selected":i.value===B.name,"aria-current":i.value===B.name?"true":void 0,"aria-controls":`panel-${B.name}`,tabindex:0,class:e.normalizeClass(["app-nav__tab",{"app-nav__tab--active":i.value===B.name}]),onClick:x=>o(B.path)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E(B.icon)),{size:16,class:"app-nav__icon"})),e.createElementVNode("span",wt,e.toDisplayString(B.title),1)],10,xt))),128))]),e.createElementVNode("div",Dt,[e.createElementVNode("div",Tt,[e.createElementVNode("span",{class:e.normalizeClass(["connection-status__dot",e.unref(_)?"connection-status__dot--connected":"connection-status__dot--disconnected"])},null,2),e.createElementVNode("span",It,e.toDisplayString(e.unref(_)?"Connected":"Disconnected"),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(_)?e.unref(mt):e.unref(dt)),{size:14,class:"connection-status__icon"}))])])]),e.createElementVNode("main",zt,[e.createVNode(S,null,{default:e.withCtx(({Component:B})=>[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(B)))]),_:2},1024)]),_:1})])])}}}),U=(n,t)=>{const s=n.__vccOpts||n;for(const[l,i]of t)s[l]=i;return s},qt=U(Mt,[["__scopeId","data-v-0a83e2b9"]]);function he(n){try{return structuredClone(e.toRaw(n))}catch{return JSON.parse(JSON.stringify(n))}}const Ft=W.defineStore("models",()=>{const n=e.ref([]),t=e.ref(null),s=e.ref([]),l=e.ref([]),i=e.ref(!1),o=e.ref(null),y=e.computed(()=>t.value?n.value.find(g=>g.name===t.value)??null:null),E=e.ref(!1),_=e.computed(()=>E.value),a=e.computed(()=>n.value.length),b=e.computed(()=>n.value.reduce((g,f)=>g+f.count,0));async function S(){i.value=!0,o.value=null;try{const g=await fetch("/_api/store");if(!g.ok)throw new Error(`Failed to fetch schemas: ${g.statusText}`);const f=await g.json();n.value=f.schemas??[]}catch(g){o.value=g instanceof Error?g.message:"Failed to fetch schemas",console.error("[ModelsStore] Error fetching schemas:",g)}finally{i.value=!1}}async function B(g){t.value!==g&&(t.value=g,await x(g))}async function x(g){i.value=!0,o.value=null;try{const f=await fetch(`/_api/store/${encodeURIComponent(g)}`);if(!f.ok)throw new Error(`Failed to fetch schema data: ${f.statusText}`);const h=await f.json(),u=h.items??[];s.value=he(u),l.value=he(u),E.value=!1;const z=n.value.findIndex(k=>k.name===g);z!==-1&&(n.value[z].count=h.count)}catch(f){o.value=f instanceof Error?f.message:"Failed to fetch schema data",console.error("[ModelsStore] Error fetching schema data:",f)}finally{i.value=!1}}function F(g){if(!Array.isArray(g)){o.value="Invalid data: Expected an array of items",console.error("[ModelsStore] updateItems received non-array value:",typeof g);return}s.value=g,o.value=null,E.value=!0}async function R(){if(!t.value)return o.value="No schema selected",!1;i.value=!0,o.value=null;try{const g=await fetch(`/_api/store/${encodeURIComponent(t.value)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s.value)});if(!g.ok){const u=await g.json().catch(()=>({}));throw new Error(u.error||`Failed to save items: ${g.statusText}`)}const f=await g.json();l.value=he(s.value),E.value=!1;const h=n.value.findIndex(u=>u.name===t.value);return h!==-1&&(n.value[h].count=f.created??s.value.length),!0}catch(g){return o.value=g instanceof Error?g.message:"Failed to save items",console.error("[ModelsStore] Error saving items:",g),!1}finally{i.value=!1}}async function $(){if(!t.value)return o.value="No schema selected",!1;i.value=!0,o.value=null;try{const g=await fetch(`/_api/store/${encodeURIComponent(t.value)}`,{method:"DELETE"});if(!g.ok)throw new Error(`Failed to clear schema: ${g.statusText}`);s.value=[],l.value=[],E.value=!1;const f=n.value.findIndex(h=>h.name===t.value);return f!==-1&&(n.value[f].count=0),!0}catch(g){return o.value=g instanceof Error?g.message:"Failed to clear schema",console.error("[ModelsStore] Error clearing schema:",g),!1}finally{i.value=!1}}function r(){s.value=he(l.value),E.value=!1}async function c(){t.value?await x(t.value):await S()}function d(){n.value=[],t.value=null,s.value=[],l.value=[],i.value=!1,o.value=null,E.value=!1}function C(g){const f=n.value.findIndex(h=>h.name===g.schema);f!==-1&&(n.value[f].count=g.count),t.value===g.schema&&(_.value?console.warn(`[ModelsStore] Skipping auto-refresh for schema "${g.schema}" - unsaved changes exist`):x(g.schema))}function q(g){g.success&&(S(),t.value&&(_.value?console.warn(`[ModelsStore] Skipping auto-refresh after reseed for schema "${t.value}" - unsaved changes exist`):x(t.value)))}return{schemas:n,selectedSchema:t,currentItems:s,loading:i,error:o,currentSchema:y,isDirty:_,schemaCount:a,totalItems:b,fetchSchemas:S,selectSchemaByName:B,fetchSchemaData:x,updateItems:F,saveItems:R,clearSchema:$,discardChanges:r,refresh:c,reset:d,handleStoreUpdate:C,handleReseedComplete:q}}),Je=W.defineStore("registry",()=>{const n=e.ref([]),t=e.ref({totalEndpoints:0,withCustomHandler:0,totalSchemas:0,withCustomSeed:0,autoGenerated:0}),s=e.ref(!1),l=e.ref(null),i=e.ref(""),o=e.ref({methods:[],hasHandler:null,hasSeed:null,tags:[]}),y=e.ref(null),E=e.ref(new Set),_=e.computed(()=>{const m=new Set;for(const N of n.value)for(const w of N.tags)m.add(w);return Array.from(m).sort()}),a=e.computed(()=>{const m=new Set;for(const N of n.value)N.responseSchema&&m.add(N.responseSchema);return Array.from(m).sort()}),b=e.computed(()=>{let m=n.value;if(i.value.trim()){const N=i.value.toLowerCase().trim();m=m.filter(w=>w.path.toLowerCase().includes(N)||w.operationId.toLowerCase().includes(N)||w.summary?.toLowerCase().includes(N)||w.tags.some(p=>p.toLowerCase().includes(N)))}return o.value.methods.length>0&&(m=m.filter(N=>o.value.methods.includes(N.method))),o.value.hasHandler!==null&&(m=m.filter(N=>N.hasHandler===o.value.hasHandler)),o.value.hasSeed!==null&&(m=m.filter(N=>N.hasSeed===o.value.hasSeed)),o.value.tags.length>0&&(m=m.filter(N=>N.tags.some(w=>o.value.tags.includes(w)))),m}),S=e.computed(()=>{const m=new Map;for(const N of b.value){let w;N.tags.length>0?w=N.tags[0]:N.responseSchema?w=N.responseSchema:w=N.path.split("/").filter(Boolean)[0]||"Other",m.has(w)||m.set(w,[]),m.get(w)?.push(N)}return Array.from(m.entries()).map(([N,w])=>({tag:N,endpoints:w.sort((p,V)=>p.path.localeCompare(V.path)),isExpanded:E.value.has(N)})).sort((N,w)=>N.tag.localeCompare(w.tag))}),B=e.computed(()=>y.value?n.value.find(m=>m.key===y.value)??null:null),x=e.computed(()=>n.value.filter(m=>m.hasHandler).length),F=e.computed(()=>n.value.filter(m=>m.hasSeed).length);function R(m){n.value=m.endpoints,t.value=m.stats,l.value=null;for(const N of m.endpoints)N.tags.length>0&&E.value.add(N.tags[0])}function $(m){s.value=m}function r(m){l.value=m,s.value=!1}function c(){l.value=null}function d(m){i.value=m}function C(m){const N=o.value.methods.indexOf(m);N===-1?o.value.methods.push(m):o.value.methods.splice(N,1)}function q(m){o.value.hasHandler=m}function g(m){o.value.hasSeed=m}function f(m){const N=o.value.tags.indexOf(m);N===-1?o.value.tags.push(m):o.value.tags.splice(N,1)}function h(){o.value={methods:[],hasHandler:null,hasSeed:null,tags:[]},i.value=""}function u(){return i.value.trim()!==""||o.value.methods.length>0||o.value.hasHandler!==null||o.value.hasSeed!==null||o.value.tags.length>0}function z(m){y.value=m}function k(m){E.value.has(m)?E.value.delete(m):E.value.add(m)}function D(){for(const m of S.value)E.value.add(m.tag)}function A(){E.value.clear()}function H(m){const N=new Set(m);for(const w of n.value)w.hasHandler=N.has(w.operationId)}function M(m){const N=new Set(m);for(const w of n.value)w.hasSeed=w.responseSchema?N.has(w.responseSchema):!1}return{endpoints:n,stats:t,isLoading:s,error:l,searchQuery:i,filter:o,selectedEndpointKey:y,expandedTags:E,allTags:_,allSchemas:a,filteredEndpoints:b,groupedEndpoints:S,selectedEndpoint:B,handlerCount:x,seedCount:F,setRegistryData:R,setLoading:$,setError:r,clearError:c,setSearchQuery:d,toggleMethodFilter:C,setHandlerFilter:q,setSeedFilter:g,toggleTagFilter:f,clearFilters:h,hasActiveFilters:u,selectEndpoint:z,toggleGroup:k,expandAllGroups:D,collapseAllGroups:A,updateHandlerStatus:H,updateSeedStatus:M}}),Me=[{id:"slow-network",label:"Slow Network",description:"3000ms delay (3G simulation)",type:"delay",status:200,delay:3e3},{id:"server-error",label:"Server Error",description:"Returns HTTP 500",type:"error",status:500,body:{error:"Internal Server Error",message:"Simulated server error"}},{id:"rate-limit",label:"Rate Limited",description:"Returns HTTP 429",type:"error",status:429,body:{error:"Too Many Requests",message:"Rate limit exceeded"}},{id:"not-found",label:"Not Found",description:"Returns HTTP 404",type:"error",status:404,body:{error:"Not Found",message:"Resource not found"}},{id:"request-timeout",label:"Request Timeout",description:"30000ms delay (simulates timeout)",type:"delay",status:200,delay:3e4},{id:"empty-response",label:"Empty Response",description:"Returns HTTP 200 with empty body",type:"empty",status:200,body:null},{id:"unauthorized",label:"Unauthorized",description:"Returns HTTP 401",type:"error",status:401,body:{error:"Unauthorized",message:"Authentication required"}}],Lt=W.defineStore("simulation",()=>{const n=e.ref(new Map),t=e.ref(new Map),s=e.ref(!1),l=e.ref(null),i=e.computed(()=>Array.from(n.value.values())),o=e.computed(()=>n.value.size),y=e.computed(()=>Me),E=e.computed(()=>n.value.size>0),_=e.computed(()=>{const k={delay:[],error:[],empty:[]};for(const D of n.value.values()){const A=a(D);k[A].push(D)}return k});function a(k){const D=k.presetId?Me.find(A=>A.id===k.presetId):null;return D?D.type:k.delay&&k.delay>0?"delay":k.body===null?"empty":"error"}function b(k){n.value.clear();for(const D of k)n.value.set(D.path,D);l.value=null}function S(k,D=!1){if(D){const A=n.value.get(k.path)||null;t.value.set(k.path,A)}n.value.set(k.path,k)}function B(k,D=!1){if(D){const A=n.value.get(k)||null;t.value.set(k,A)}return n.value.delete(k)}function x(){n.value.clear()}function F(k){return n.value.get(k)}function R(k){return n.value.has(k)}function $(k){return Me.find(D=>D.id===k)}function r(k,D,A){const H=$(D);return H?{path:k,operationId:A,status:H.status,delay:H.delay,body:H.body,presetId:H.id}:(l.value=`Preset not found: ${D}`,null)}function c(k){s.value=k}function d(k){l.value=k,s.value=!1}function C(){l.value=null}function q(k){if(!t.value.has(k))return;const D=t.value.get(k);D==null?n.value.delete(k):n.value.set(k,D),t.value.delete(k)}function g(k){console.log("[Simulation] Added:",k.path)}function f(k){B(k.path),console.log("[Simulation] Removed:",k.path)}function h(k){x(),console.log("[Simulation] Cleared all:",k.count)}function u(k){k.success?(t.value.delete(k.path),console.log("[Simulation] Set successfully:",k.path)):(q(k.path),d(`Failed to set simulation for ${k.path}`)),c(!1)}function z(k){k.success?(t.value.delete(k.path),console.log("[Simulation] Cleared successfully:",k.path)):(q(k.path),d(`Failed to clear simulation for ${k.path}`)),c(!1)}return{simulations:n,isLoading:s,error:l,activeSimulations:i,count:o,presets:y,hasActiveSimulations:E,simulationsByType:_,setSimulations:b,addSimulationLocal:S,removeSimulationLocal:B,clearSimulationsLocal:x,getSimulation:F,hasSimulation:R,getPreset:$,createSimulationFromPreset:r,setLoading:c,setError:d,clearError:C,rollbackSimulation:q,handleSimulationAdded:g,handleSimulationRemoved:f,handleSimulationsCleared:h,handleSimulationSet:u,handleSimulationCleared:z}}),Rt=W.defineStore("timeline",()=>{const n=e.ref([]),t=e.ref(!1),s=e.ref(null),l=e.ref({methods:[],statusCodes:[],searchQuery:"",simulatedOnly:null}),i=e.ref(null),o=e.ref(500),y=new Map;function E(p){return p<200?"1xx":p<300?"2xx":p<400?"3xx":p<500?"4xx":"5xx"}const _=e.computed(()=>{let p=n.value;if(l.value.searchQuery.trim()){const V=l.value.searchQuery.toLowerCase().trim();p=p.filter(T=>T.request.path.toLowerCase().includes(V)||T.request.operationId.toLowerCase().includes(V))}return l.value.methods.length>0&&(p=p.filter(V=>l.value.methods.includes(V.request.method.toUpperCase()))),l.value.statusCodes.length>0&&(p=p.filter(V=>{if(V.status===null)return!1;const T=E(V.status);return l.value.statusCodes.includes(T)})),l.value.simulatedOnly!==null&&(p=p.filter(V=>V.simulated===l.value.simulatedOnly)),p}),a=e.computed(()=>i.value?n.value.find(p=>p.id===i.value)??null:null),b=e.computed(()=>n.value.length),S=e.computed(()=>n.value.filter(p=>p.response!==null).length),B=e.computed(()=>n.value.filter(p=>p.response===null).length),x=e.computed(()=>{const p={"1xx":0,"2xx":0,"3xx":0,"4xx":0,"5xx":0};for(const V of n.value)if(V.status!==null){const T=E(V.status);p[T]++}return p}),F=e.computed(()=>{const p=n.value.filter(T=>T.duration!==null);if(p.length===0)return 0;const V=p.reduce((T,Z)=>T+(Z.duration??0),0);return Math.round(V/p.length)});function R(p){const V={id:p.id,request:p,response:null,status:null,duration:null,simulated:!1},T=y.get(p.id);T&&(r(V,T),y.delete(p.id)),n.value.unshift(V),n.value.length>o.value&&(n.value=n.value.slice(0,o.value))}function $(p){const V=n.value.find(T=>T.id===p.requestId);if(V)r(V,p),y.delete(p.requestId);else if(y.set(p.requestId,p),y.size>100){const T=c(p);n.value.unshift(T),y.delete(p.requestId),n.value.length>o.value&&(n.value=n.value.slice(0,o.value))}}function r(p,V){p.response=V,p.status=V.status,p.duration=V.duration,p.simulated=V.simulated}function c(p){const V={id:p.requestId,method:"UNKNOWN",path:"/unknown",operationId:"unknown",timestamp:Date.now(),headers:{},query:{},body:void 0};return{id:p.requestId,request:V,response:p,status:p.status,duration:p.duration,simulated:p.simulated}}function d(p){for(const[V,T]of y){const Z=p.get(V);Z?(r(Z,T),y.delete(V)):(p.set(V,c(T)),y.delete(V))}}function C(p,V){for(const[T,Z]of V){const Y=p.get(T);Y?r(Y,Z):y.set(T,Z)}}function q(p){for(const[V,T]of y)p.has(V)||(p.set(V,c(T)),y.delete(V))}function g(p){const V=new Map,T=new Map;for(const Y of p.entries)if(Y.type==="request"){const v=Y.data;V.set(v.id,{id:v.id,request:v,response:null,status:null,duration:null,simulated:!1})}else if(Y.type==="response"){const v=Y.data;T.set(v.requestId,v)}d(V),C(V,T),q(V);const Z=Array.from(V.values()).sort((Y,v)=>v.request.timestamp-Y.request.timestamp);n.value=Z.slice(0,o.value),s.value=null}function f(){n.value=[],i.value=null,y.clear()}function h(p){t.value=p}function u(p){s.value=p,t.value=!1}function z(){s.value=null}function k(p){l.value.searchQuery=p}function D(p){const V=l.value.methods.indexOf(p);V===-1?l.value.methods.push(p):l.value.methods.splice(V,1)}function A(p){const V=l.value.statusCodes.indexOf(p);V===-1?l.value.statusCodes.push(p):l.value.statusCodes.splice(V,1)}function H(p){l.value.simulatedOnly=p}function M(){l.value={methods:[],statusCodes:[],searchQuery:"",simulatedOnly:null}}function m(){return l.value.searchQuery.trim()!==""||l.value.methods.length>0||l.value.statusCodes.length>0||l.value.simulatedOnly!==null}function N(p){i.value=p}function w(p){const V=Math.max(1,p);o.value=V,n.value.length>V&&(n.value=n.value.slice(0,V))}return{entries:n,isLoading:t,error:s,filter:l,selectedEntryId:i,maxEntries:o,filteredEntries:_,selectedEntry:a,totalCount:b,completedCount:S,pendingCount:B,statusCounts:x,averageDuration:F,addRequest:R,addResponse:$,setTimelineData:g,clearTimeline:f,setLoading:h,setError:u,clearError:z,setSearchQuery:k,toggleMethodFilter:D,toggleStatusFilter:A,setSimulatedFilter:H,clearFilters:M,hasActiveFilters:m,selectEntry:N,setMaxEntries:w}}),At=["light","dark","system"];function Qe(n){return typeof n=="string"&&At.includes(n)}const qe="openapi-devtools-theme",K=e.ref("system"),ee=e.ref(!1);let _e=null,ge=null;function ke(){return typeof window<"u"&&typeof document<"u"}function Ot(){return e.getCurrentInstance()!==null}function Pt(){const n=e.computed(()=>K.value==="system"?ee.value?"dark":"light":K.value),t=e.computed(()=>n.value==="dark");function s(){if(!ke())return;const a=document.documentElement;n.value==="dark"?(a.classList.add("dark"),a.classList.remove("light")):(a.classList.add("light"),a.classList.remove("dark"))}function l(a){if(!Qe(a)){console.warn(`[DevTools] Invalid theme mode: ${a}`);return}if(K.value=a,ke())try{localStorage.setItem(qe,a)}catch{console.warn("[DevTools] Unable to persist theme preference")}}function i(){K.value==="system"?l(ee.value?"light":"dark"):l(K.value==="dark"?"light":"dark")}function o(){l("system")}function y(){_e&&ge&&(_e.removeEventListener("change",ge),_e=null,ge=null)}function E(){if(!ke())return;y();const a=window.matchMedia("(prefers-color-scheme: dark)");ee.value=a.matches;const b=S=>{ee.value=S.matches};a.addEventListener("change",b),_e=a,ge=b;try{const S=localStorage.getItem(qe);Qe(S)&&(K.value=S)}catch{}s()}function _(){if(y(),K.value="system",ee.value=!1,ke()){document.documentElement.classList.remove("dark","light");try{localStorage.removeItem(qe)}catch{}}}return e.watch([K,ee],()=>{s()}),Ot()&&(e.onMounted(()=>{E()}),e.onUnmounted(()=>{y()})),{themeMode:e.computed(()=>K.value),effectiveTheme:n,isDark:t,systemPrefersDark:e.computed(()=>ee.value),setTheme:l,toggleTheme:i,resetToSystem:o,initialize:E,resetState:_}}let We=!1,Ge=null;function Ke(){if(We)return Ge;const n=e.createApp(qt),t=W.createPinia();return n.use(t),n.use(Vt),n.mount("#app"),We=!0,Ge=n,n}typeof window<"u"&&document.getElementById("app")&&Ke();function Ee(n){return n.toUpperCase()}const Ht={class:"endpoint-detail"},jt={key:0,class:"endpoint-detail__empty"},Ut={key:1,class:"endpoint-detail__content"},Jt={class:"endpoint-detail__header"},Qt={class:"endpoint-detail__path font-mono"},Wt={class:"endpoint-detail__status"},Gt={key:0,class:"endpoint-detail__status-item endpoint-detail__status-item--handler"},Kt={key:1,class:"endpoint-detail__status-item endpoint-detail__status-item--seed"},Zt={key:2,class:"endpoint-detail__status-item endpoint-detail__status-item--security"},Yt={key:3,class:"endpoint-detail__status-item endpoint-detail__status-item--auto"},Xt={class:"endpoint-detail__sections"},vt={class:"endpoint-detail__section"},en={class:"endpoint-detail__section-content font-mono"},tn={key:0,class:"endpoint-detail__section"},nn={class:"endpoint-detail__section-title"},on={class:"endpoint-detail__tags"},sn={key:1,class:"endpoint-detail__section"},ln={class:"endpoint-detail__section-content"},an={key:2,class:"endpoint-detail__section"},rn={class:"endpoint-detail__section-content endpoint-detail__description"},cn={key:3,class:"endpoint-detail__section"},dn={class:"endpoint-detail__section-title"},mn={class:"endpoint-detail__section-content font-mono"},pn={key:4,class:"endpoint-detail__section"},un={class:"endpoint-detail__section-title"},fn={class:"endpoint-detail__security"},yn={class:"endpoint-detail__security-name font-mono"},hn={class:"endpoint-detail__security-scopes text-muted"},_n=U(e.defineComponent({__name:"EndpointDetail",props:{endpoint:{}},setup(n){const t=n,s=e.computed(()=>t.endpoint?.security&&t.endpoint.security.length>0),l=e.computed(()=>t.endpoint?.security?t.endpoint.security.map(i=>({name:i.name,scopes:i.scopes.length>0?i.scopes.join(", "):"No scopes"})):[]);return(i,o)=>(e.openBlock(),e.createElementBlock("div",Ht,[n.endpoint?(e.openBlock(),e.createElementBlock("div",Ut,[e.createElementVNode("header",Jt,[e.createElementVNode("span",{class:e.normalizeClass(["method-badge","method-badge--large",`method-badge--${n.endpoint.method}`])},e.toDisplayString(e.unref(Ee)(n.endpoint.method)),3),e.createElementVNode("h2",Qt,e.toDisplayString(n.endpoint.path),1)]),e.createElementVNode("div",Wt,[n.endpoint.hasHandler?(e.openBlock(),e.createElementBlock("div",Gt,[e.createVNode(e.unref(be),{size:14}),o[2]||(o[2]=e.createElementVNode("span",null,"Has custom handler",-1))])):e.createCommentVNode("",!0),n.endpoint.hasSeed?(e.openBlock(),e.createElementBlock("div",Kt,[e.createVNode(e.unref(Ce),{size:14}),o[3]||(o[3]=e.createElementVNode("span",null,"Has seed data",-1))])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",Zt,[e.createVNode(e.unref(st),{size:14}),o[4]||(o[4]=e.createElementVNode("span",null,"Requires authentication",-1))])):e.createCommentVNode("",!0),!n.endpoint.hasHandler&&!n.endpoint.hasSeed?(e.openBlock(),e.createElementBlock("div",Yt,[e.createVNode(e.unref(Se),{size:14}),o[5]||(o[5]=e.createElementVNode("span",null,"Auto-generated response",-1))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Xt,[e.createElementVNode("section",vt,[o[6]||(o[6]=e.createElementVNode("h3",{class:"endpoint-detail__section-title"},"Operation",-1)),e.createElementVNode("p",en,e.toDisplayString(n.endpoint.operationId),1)]),n.endpoint.tags.length>0?(e.openBlock(),e.createElementBlock("section",tn,[e.createElementVNode("h3",nn,[e.createVNode(e.unref(ct),{size:14}),o[7]||(o[7]=e.createTextVNode(" Tags ",-1))]),e.createElementVNode("div",on,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.endpoint.tags,y=>(e.openBlock(),e.createElementBlock("span",{key:y,class:"endpoint-detail__tag"},e.toDisplayString(y),1))),128))])])):e.createCommentVNode("",!0),n.endpoint.summary?(e.openBlock(),e.createElementBlock("section",sn,[o[8]||(o[8]=e.createElementVNode("h3",{class:"endpoint-detail__section-title"},"Summary",-1)),e.createElementVNode("p",ln,e.toDisplayString(n.endpoint.summary),1)])):e.createCommentVNode("",!0),n.endpoint.description?(e.openBlock(),e.createElementBlock("section",an,[o[9]||(o[9]=e.createElementVNode("h3",{class:"endpoint-detail__section-title"},"Description",-1)),e.createElementVNode("p",rn,e.toDisplayString(n.endpoint.description),1)])):e.createCommentVNode("",!0),n.endpoint.responseSchema?(e.openBlock(),e.createElementBlock("section",cn,[e.createElementVNode("h3",dn,[e.createVNode(e.unref(Se),{size:14}),o[10]||(o[10]=e.createTextVNode(" Response Schema ",-1))]),e.createElementVNode("p",mn,e.toDisplayString(n.endpoint.responseSchema),1)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("section",pn,[e.createElementVNode("h3",un,[e.createVNode(e.unref(it),{size:14}),o[11]||(o[11]=e.createTextVNode(" Security ",-1))]),e.createElementVNode("div",fn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,y=>(e.openBlock(),e.createElementBlock("div",{key:y.name,class:"endpoint-detail__security-item"},[e.createElementVNode("span",yn,e.toDisplayString(y.name),1),e.createElementVNode("span",hn,e.toDisplayString(y.scopes),1)]))),128))])])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("div",jt,[e.createVNode(e.unref(Se),{size:48,class:"endpoint-detail__empty-icon"}),o[0]||(o[0]=e.createElementVNode("h3",{class:"endpoint-detail__empty-title"},"No endpoint selected",-1)),o[1]||(o[1]=e.createElementVNode("p",{class:"endpoint-detail__empty-text text-muted"}," Select an endpoint from the list to view its details ",-1))]))]))}}),[["__scopeId","data-v-c66a0f52"]]),gn={class:"endpoint-list"},kn={key:0,class:"endpoint-list__empty"},En={key:1,class:"endpoint-list__groups"},Nn=["aria-expanded","aria-controls","onClick"],bn={class:"endpoint-group__tag"},Vn={class:"endpoint-group__count text-muted"},Sn=["id","aria-label"],Bn=["aria-selected","onClick"],Cn={class:"endpoint-item__path font-mono"},$n={class:"endpoint-item__indicators"},xn={key:0,class:"endpoint-item__indicator endpoint-item__indicator--handler",title:"Has custom handler"},wn={key:1,class:"endpoint-item__indicator endpoint-item__indicator--seed",title:"Has seed data"},Dn=U(e.defineComponent({__name:"EndpointList",props:{groups:{},selectedKey:{}},emits:["select","toggle-group"],setup(n,{emit:t}){const s=n,l=t;function i(E){l("select",E.key)}function o(E){l("toggle-group",E)}function y(E){return s.selectedKey===E.key}return(E,_)=>(e.openBlock(),e.createElementBlock("div",gn,[n.groups.length===0?(e.openBlock(),e.createElementBlock("div",kn,[..._[0]||(_[0]=[e.createElementVNode("p",{class:"text-muted"},"No endpoints found",-1)])])):(e.openBlock(),e.createElementBlock("div",En,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.groups,a=>(e.openBlock(),e.createElementBlock("div",{key:a.tag,class:"endpoint-group"},[e.createElementVNode("button",{type:"button",class:"endpoint-group__header","aria-expanded":a.isExpanded,"aria-controls":`group-${a.tag}`,onClick:b=>o(a.tag)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.isExpanded?e.unref(X):e.unref(te)),{size:16,class:"endpoint-group__chevron"})),e.createElementVNode("span",bn,e.toDisplayString(a.tag),1),e.createElementVNode("span",Vn," ("+e.toDisplayString(a.endpoints.length)+") ",1)],8,Nn),e.withDirectives(e.createElementVNode("div",{id:`group-${a.tag}`,class:"endpoint-group__items",role:"group","aria-label":`${a.tag} endpoints`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.endpoints,b=>(e.openBlock(),e.createElementBlock("button",{key:b.key,type:"button",class:e.normalizeClass(["endpoint-item",{"endpoint-item--selected":y(b)}]),"aria-selected":y(b),onClick:S=>i(b)},[e.createElementVNode("span",{class:e.normalizeClass(["method-badge",`method-badge--${b.method}`])},e.toDisplayString(e.unref(Ee)(b.method)),3),e.createElementVNode("span",Cn,e.toDisplayString(b.path),1),e.createElementVNode("div",$n,[b.hasHandler?(e.openBlock(),e.createElementBlock("span",xn,[e.createVNode(e.unref(be),{size:12})])):e.createCommentVNode("",!0),b.hasSeed?(e.openBlock(),e.createElementBlock("span",wn,[e.createVNode(e.unref(Ce),{size:12})])):e.createCommentVNode("",!0)])],10,Bn))),128))],8,Sn),[[e.vShow,a.isExpanded]])]))),128))]))]))}}),[["__scopeId","data-v-554ffe63"]]),Tn={class:"routes-page"},In={class:"routes-toolbar"},zn={class:"routes-search"},Mn=["value"],qn=["aria-expanded"],Fn={key:0,class:"routes-filter-toggle__badge"},Ln={class:"routes-stats"},Rn={class:"routes-stats__item"},An={class:"routes-stats__item"},On={key:0,class:"routes-filters"},Pn={class:"routes-filters__section"},Hn={class:"routes-filters__methods"},jn=["onClick"],Un={class:"routes-filters__section"},Jn={class:"routes-filters__status"},Qn={key:0,class:"routes-filters__actions"},Wn={class:"routes-content"},Gn={key:0,class:"routes-loading"},Kn={key:1,class:"routes-error"},Zn={class:"routes-error__message"},Yn={key:2,class:"routes-empty empty-state"},Xn={key:3,class:"routes-empty empty-state"},vn={class:"routes-list-panel"},eo={class:"routes-detail-panel"},to=Object.freeze(Object.defineProperty({__proto__:null,default:U(e.defineComponent({__name:"RoutesPage",setup(n){const t=Je(),{send:s,on:l,connected:i}=se(),o=e.ref(!1),y=e.ref(null),E=["get","post","put","patch","delete","options","head","trace"];function _(){i.value&&(t.setLoading(!0),s({type:"get:registry"}))}function a(h){t.setRegistryData(h),t.setLoading(!1)}function b(h){t.selectEndpoint(h)}function S(h){t.toggleGroup(h)}function B(h){const u=h.target;t.setSearchQuery(u.value)}function x(){t.setSearchQuery(""),y.value?.focus()}function F(h){t.toggleMethodFilter(h)}function R(h){return t.filter.methods.includes(h)}function $(){const h=t.filter.hasHandler;t.setHandlerFilter(h===!0?null:!0)}function r(){const h=t.filter.hasSeed;t.setSeedFilter(h===!0?null:!0)}function c(){t.clearFilters()}function d(){o.value=!o.value}const C=e.computed(()=>t.hasActiveFilters());let q=null,g=null,f=null;return e.onMounted(()=>{q=l("registry",a),g=l("handlers:updated",()=>_()),f=l("seeds:updated",()=>_()),i.value&&_()}),e.onUnmounted(()=>{q?.(),g?.(),f?.()}),e.watch(i,h=>{h&&_()}),(h,u)=>(e.openBlock(),e.createElementBlock("div",Tn,[e.createElementVNode("div",In,[e.createElementVNode("div",zn,[e.createVNode(e.unref(ue),{size:16,class:"routes-search__icon"}),e.createElementVNode("input",{ref_key:"searchInputRef",ref:y,type:"text",class:"routes-search__input input",placeholder:"Search endpoints...",value:e.unref(t).searchQuery,onInput:B},null,40,Mn),e.unref(t).searchQuery?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"routes-search__clear btn btn--ghost btn--icon",title:"Clear search",onClick:x},[e.createVNode(e.unref(ae),{size:14})])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["routes-filter-toggle btn btn--secondary",{"routes-filter-toggle--active":C.value}]),"aria-expanded":o.value,onClick:d},[e.createVNode(e.unref(Ae),{size:16}),u[0]||(u[0]=e.createElementVNode("span",null,"Filters",-1)),C.value?(e.openBlock(),e.createElementBlock("span",Fn,e.toDisplayString(e.unref(t).filter.methods.length+(e.unref(t).filter.hasHandler?1:0)+(e.unref(t).filter.hasSeed?1:0)),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value?e.unref(Re):e.unref(X)),{size:14}))],10,qn),e.createElementVNode("div",Ln,[e.createElementVNode("span",Rn,e.toDisplayString(e.unref(t).filteredEndpoints.length)+" endpoints ",1),u[1]||(u[1]=e.createElementVNode("span",{class:"routes-stats__separator"},"|",-1)),e.createElementVNode("span",An,e.toDisplayString(e.unref(t).allTags.length)+" tags ",1)])]),o.value?(e.openBlock(),e.createElementBlock("div",On,[e.createElementVNode("div",Pn,[u[2]||(u[2]=e.createElementVNode("h4",{class:"routes-filters__title"},"Methods",-1)),e.createElementVNode("div",Hn,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(E,z=>e.createElementVNode("button",{key:z,type:"button",class:e.normalizeClass(["method-badge",`method-badge--${z}`,{"method-badge--inactive":!R(z)&&e.unref(t).filter.methods.length>0}]),onClick:k=>F(z)},e.toDisplayString(z.toUpperCase()),11,jn)),64))])]),e.createElementVNode("div",Un,[u[5]||(u[5]=e.createElementVNode("h4",{class:"routes-filters__title"},"Status",-1)),e.createElementVNode("div",Jn,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["routes-filters__status-btn",{"routes-filters__status-btn--active":e.unref(t).filter.hasHandler}]),onClick:$},[e.createVNode(e.unref(be),{size:14}),u[3]||(u[3]=e.createElementVNode("span",null,"Has Handler",-1))],2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["routes-filters__status-btn",{"routes-filters__status-btn--active":e.unref(t).filter.hasSeed}]),onClick:r},[e.createVNode(e.unref(Ce),{size:14}),u[4]||(u[4]=e.createElementVNode("span",null,"Has Seed",-1))],2)])]),C.value?(e.openBlock(),e.createElementBlock("div",Qn,[e.createElementVNode("button",{type:"button",class:"btn btn--ghost",onClick:c},[e.createVNode(e.unref(ae),{size:14}),u[6]||(u[6]=e.createTextVNode(" Clear all filters ",-1))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Wn,[e.unref(t).isLoading?(e.openBlock(),e.createElementBlock("div",Gn,[...u[7]||(u[7]=[e.createElementVNode("div",{class:"routes-loading__spinner"},null,-1),e.createElementVNode("span",{class:"text-muted"},"Loading endpoints...",-1)])])):e.unref(t).error?(e.openBlock(),e.createElementBlock("div",Kn,[e.createElementVNode("p",Zn,e.toDisplayString(e.unref(t).error),1),e.createElementVNode("button",{type:"button",class:"btn btn--primary",onClick:_}," Retry ")])):e.unref(t).endpoints.length===0?(e.openBlock(),e.createElementBlock("div",Yn,[e.createVNode(e.unref(Be),{size:48,class:"empty-state__icon"}),u[8]||(u[8]=e.createElementVNode("h3",{class:"empty-state__title"},"No endpoints found",-1)),u[9]||(u[9]=e.createElementVNode("p",{class:"empty-state__description"}," No API endpoints are available. Make sure your OpenAPI spec is loaded. ",-1))])):e.unref(t).filteredEndpoints.length===0?(e.openBlock(),e.createElementBlock("div",Xn,[e.createVNode(e.unref(ue),{size:48,class:"empty-state__icon"}),u[10]||(u[10]=e.createElementVNode("h3",{class:"empty-state__title"},"No matching endpoints",-1)),u[11]||(u[11]=e.createElementVNode("p",{class:"empty-state__description"}," Try adjusting your search or filters. ",-1)),C.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"btn btn--secondary",onClick:c}," Clear filters ")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",vn,[e.createVNode(Dn,{groups:e.unref(t).groupedEndpoints,"selected-key":e.unref(t).selectedEndpointKey,onSelect:b,onToggleGroup:S},null,8,["groups","selected-key"])]),e.createElementVNode("div",eo,[e.createVNode(_n,{endpoint:e.unref(t).selectedEndpoint},null,8,["endpoint"])])],64))])]))}}),[["__scopeId","data-v-bdd419e3"]])},Symbol.toStringTag,{value:"Module"})),no={class:"timeline-detail"},oo={key:0,class:"timeline-detail__empty"},so={key:1,class:"timeline-detail__content"},lo={class:"timeline-detail__header"},ao={class:"timeline-detail__summary"},ro={class:"timeline-detail__path font-mono"},io={class:"timeline-detail__meta"},co={key:1,class:"status-badge status-badge--pending"},mo={class:"timeline-detail__duration"},po={key:2,class:"timeline-detail__simulated",title:"Simulated response"},uo={class:"timeline-detail__actions"},fo={class:"timeline-detail__info"},yo={class:"timeline-detail__info-item"},ho={class:"timeline-detail__info-value font-mono"},_o={class:"timeline-detail__info-item"},go={class:"timeline-detail__info-value font-mono"},ko={class:"timeline-detail__info-item"},Eo={class:"timeline-detail__info-value font-mono"},No={class:"timeline-detail__section"},bo={key:0,class:"timeline-detail__subsection"},Vo=["aria-expanded"],So={class:"text-muted"},Bo={id:"requestQuery-panel",class:"timeline-detail__subsection-content"},Co={class:"timeline-detail__kv-key font-mono"},$o={class:"timeline-detail__kv-value font-mono"},xo={key:1,class:"timeline-detail__subsection"},wo=["aria-expanded"],Do={class:"text-muted"},To={id:"requestHeaders-panel",class:"timeline-detail__subsection-content"},Io={class:"timeline-detail__kv-key font-mono"},zo={class:"timeline-detail__kv-value font-mono"},Mo={key:2,class:"timeline-detail__subsection"},qo={class:"timeline-detail__subsection-header",role:"group"},Fo=["aria-expanded"],Lo={id:"requestBody-panel",class:"timeline-detail__subsection-content"},Ro={class:"timeline-detail__json"},Ao={key:0,class:"timeline-detail__section"},Oo={key:0,class:"timeline-detail__subsection"},Po=["aria-expanded"],Ho={class:"text-muted"},jo={id:"responseHeaders-panel",class:"timeline-detail__subsection-content"},Uo={class:"timeline-detail__kv-key font-mono"},Jo={class:"timeline-detail__kv-value font-mono"},Qo={key:1,class:"timeline-detail__subsection"},Wo={class:"timeline-detail__subsection-header",role:"group"},Go=["aria-expanded"],Ko={id:"responseBody-panel",class:"timeline-detail__subsection-content"},Zo={class:"timeline-detail__json"},Yo={key:1,class:"timeline-detail__section timeline-detail__section--pending"},Xo={class:"timeline-detail__pending"},vo=U(e.defineComponent({__name:"TimelineDetail",props:{entry:{}},setup(n){const t=n,s=e.ref({requestHeaders:!0,requestQuery:!0,requestBody:!0,responseHeaders:!0,responseBody:!0}),l=e.ref(null),i=e.computed(()=>t.entry?new Date(t.entry.request.timestamp).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,hour12:!1}):""),o=e.computed(()=>t.entry?.duration==null?"pending...":t.entry.duration<1e3?`${t.entry.duration}ms`:`${(t.entry.duration/1e3).toFixed(2)}s`),y=e.computed(()=>t.entry?.status?t.entry.status<200?"status-badge--1xx":t.entry.status<300?"status-badge--2xx":t.entry.status<400?"status-badge--3xx":t.entry.status<500?"status-badge--4xx":"status-badge--5xx":"status-badge--pending"),E=e.computed(()=>t.entry?.request.query?Object.keys(t.entry.request.query).length>0:!1),_=e.computed(()=>t.entry?.request.headers?Object.keys(t.entry.request.headers).length>0:!1),a=e.computed(()=>t.entry?.request.body!==void 0&&t.entry?.request.body!==null),b=e.computed(()=>t.entry?.response?.headers?Object.keys(t.entry.response.headers).length>0:!1),S=e.computed(()=>t.entry?.response?.body!==void 0&&t.entry?.response?.body!==null);function B($){try{return JSON.stringify($,null,2)}catch{return String($)}}function x($){s.value[$]=!s.value[$]}async function F($,r){try{await navigator.clipboard.writeText($),l.value=r,setTimeout(()=>{l.value=null},2e3)}catch(c){console.error("Failed to copy:",c)}}async function R(){if(!t.entry)return;const $={request:t.entry.request,response:t.entry.response};await F(JSON.stringify($,null,2),"full")}return($,r)=>(e.openBlock(),e.createElementBlock("div",no,[n.entry?(e.openBlock(),e.createElementBlock("div",so,[e.createElementVNode("div",lo,[e.createElementVNode("div",ao,[e.createElementVNode("span",{class:e.normalizeClass(["method-badge",`method-badge--${n.entry.request.method.toLowerCase()}`])},e.toDisplayString(e.unref(Ee)(n.entry.request.method)),3),e.createElementVNode("span",ro,e.toDisplayString(n.entry.request.path),1)]),e.createElementVNode("div",io,[n.entry.status!==null?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-badge",y.value])},e.toDisplayString(n.entry.status),3)):(e.openBlock(),e.createElementBlock("span",co,"pending")),e.createElementVNode("span",mo,[e.createVNode(e.unref(G),{size:14}),e.createTextVNode(" "+e.toDisplayString(o.value),1)]),n.entry.simulated?(e.openBlock(),e.createElementBlock("span",po,[e.createVNode(e.unref(ne),{size:14}),r[9]||(r[9]=e.createTextVNode(" Simulated ",-1))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",uo,[e.createElementVNode("button",{type:"button",class:"btn btn--ghost btn--sm",title:"Copy as JSON",onClick:R},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value==="full"?e.unref(me):e.unref(Ve)),{size:14})),e.createTextVNode(" "+e.toDisplayString(l.value==="full"?"Copied!":"Copy JSON"),1)])])]),e.createElementVNode("div",fo,[e.createElementVNode("div",yo,[r[10]||(r[10]=e.createElementVNode("span",{class:"timeline-detail__info-label"},"Timestamp",-1)),e.createElementVNode("span",ho,e.toDisplayString(i.value),1)]),e.createElementVNode("div",_o,[r[11]||(r[11]=e.createElementVNode("span",{class:"timeline-detail__info-label"},"Operation ID",-1)),e.createElementVNode("span",go,e.toDisplayString(n.entry.request.operationId),1)]),e.createElementVNode("div",ko,[r[12]||(r[12]=e.createElementVNode("span",{class:"timeline-detail__info-label"},"Request ID",-1)),e.createElementVNode("span",Eo,e.toDisplayString(n.entry.id),1)])]),e.createElementVNode("div",No,[r[16]||(r[16]=e.createElementVNode("h3",{class:"timeline-detail__section-title"},"Request",-1)),E.value?(e.openBlock(),e.createElementBlock("div",bo,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-header","aria-expanded":s.value.requestQuery,"aria-controls":"requestQuery-panel",onClick:r[0]||(r[0]=c=>x("requestQuery"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value.requestQuery?e.unref(X):e.unref(te)),{size:16})),r[13]||(r[13]=e.createElementVNode("span",null,"Query Parameters",-1)),e.createElementVNode("span",So,"("+e.toDisplayString(Object.keys(n.entry.request.query).length)+")",1)],8,Vo),e.withDirectives(e.createElementVNode("div",Bo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.entry.request.query,(c,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"timeline-detail__kv-row"},[e.createElementVNode("span",Co,e.toDisplayString(d),1),e.createElementVNode("span",$o,e.toDisplayString(Array.isArray(c)?c.join(", "):c),1)]))),128))],512),[[e.vShow,s.value.requestQuery]])])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("div",xo,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-header","aria-expanded":s.value.requestHeaders,"aria-controls":"requestHeaders-panel",onClick:r[1]||(r[1]=c=>x("requestHeaders"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value.requestHeaders?e.unref(X):e.unref(te)),{size:16})),r[14]||(r[14]=e.createElementVNode("span",null,"Headers",-1)),e.createElementVNode("span",Do,"("+e.toDisplayString(Object.keys(n.entry.request.headers).length)+")",1)],8,wo),e.withDirectives(e.createElementVNode("div",To,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.entry.request.headers,(c,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"timeline-detail__kv-row"},[e.createElementVNode("span",Io,e.toDisplayString(d),1),e.createElementVNode("span",zo,e.toDisplayString(c),1)]))),128))],512),[[e.vShow,s.value.requestHeaders]])])):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("div",Mo,[e.createElementVNode("div",qo,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-toggle","aria-expanded":s.value.requestBody,"aria-controls":"requestBody-panel",onClick:r[2]||(r[2]=c=>x("requestBody"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value.requestBody?e.unref(X):e.unref(te)),{size:16})),r[15]||(r[15]=e.createElementVNode("span",null,"Body",-1))],8,Fo),e.createElementVNode("button",{type:"button",class:"btn btn--ghost btn--icon btn--sm",title:"Copy body",onClick:r[3]||(r[3]=e.withModifiers(c=>F(B(n.entry.request.body),"reqBody"),["stop"]))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value==="reqBody"?e.unref(me):e.unref(Ve)),{size:12}))])]),e.withDirectives(e.createElementVNode("div",Lo,[e.createElementVNode("pre",Ro,e.toDisplayString(B(n.entry.request.body)),1)],512),[[e.vShow,s.value.requestBody]])])):e.createCommentVNode("",!0)]),n.entry.response?(e.openBlock(),e.createElementBlock("div",Ao,[r[19]||(r[19]=e.createElementVNode("h3",{class:"timeline-detail__section-title"},"Response",-1)),b.value?(e.openBlock(),e.createElementBlock("div",Oo,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-header","aria-expanded":s.value.responseHeaders,"aria-controls":"responseHeaders-panel",onClick:r[4]||(r[4]=c=>x("responseHeaders"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value.responseHeaders?e.unref(X):e.unref(te)),{size:16})),r[17]||(r[17]=e.createElementVNode("span",null,"Headers",-1)),e.createElementVNode("span",Ho,"("+e.toDisplayString(Object.keys(n.entry.response.headers).length)+")",1)],8,Po),e.withDirectives(e.createElementVNode("div",jo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.entry.response.headers,(c,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"timeline-detail__kv-row"},[e.createElementVNode("span",Uo,e.toDisplayString(d),1),e.createElementVNode("span",Jo,e.toDisplayString(c),1)]))),128))],512),[[e.vShow,s.value.responseHeaders]])])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("div",Qo,[e.createElementVNode("div",Wo,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-toggle","aria-expanded":s.value.responseBody,"aria-controls":"responseBody-panel",onClick:r[5]||(r[5]=c=>x("responseBody"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value.responseBody?e.unref(X):e.unref(te)),{size:16})),r[18]||(r[18]=e.createElementVNode("span",null,"Body",-1))],8,Go),e.createElementVNode("button",{type:"button",class:"btn btn--ghost btn--icon btn--sm",title:"Copy body",onClick:r[6]||(r[6]=e.withModifiers(c=>F(B(n.entry.response.body),"resBody"),["stop"]))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value==="resBody"?e.unref(me):e.unref(Ve)),{size:12}))])]),e.withDirectives(e.createElementVNode("div",Ko,[e.createElementVNode("pre",Zo,e.toDisplayString(B(n.entry.response.body)),1)],512),[[e.vShow,s.value.responseBody]])])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Yo,[r[21]||(r[21]=e.createElementVNode("h3",{class:"timeline-detail__section-title"},"Response",-1)),e.createElementVNode("div",Xo,[e.createVNode(e.unref(G),{size:24,class:"timeline-detail__pending-icon"}),r[20]||(r[20]=e.createElementVNode("span",{class:"text-muted"},"Waiting for response...",-1))])]))])):(e.openBlock(),e.createElementBlock("div",oo,[e.createVNode(e.unref(G),{size:48,class:"timeline-detail__empty-icon"}),r[7]||(r[7]=e.createElementVNode("h3",{class:"timeline-detail__empty-title"},"Select an entry",-1)),r[8]||(r[8]=e.createElementVNode("p",{class:"timeline-detail__empty-description"}," Click on a timeline entry to view its details. ",-1))]))]))}}),[["__scopeId","data-v-b4bdd2d2"]]),es={class:"timeline-entry__time font-mono text-muted"},ts={class:"timeline-entry__method"},ns={class:"timeline-entry__path font-mono"},os={class:"timeline-entry__status"},ss={key:1,class:"status-badge status-badge--pending"},ls={class:"timeline-entry__duration font-mono text-muted"},as={key:0,class:"timeline-entry__simulated",title:"Simulated response"},rs=U(e.defineComponent({__name:"TimelineEntry",props:{entry:{},isSelected:{type:Boolean,default:!1}},emits:["select"],setup(n,{emit:t}){const s=n,l=t,i=e.computed(()=>new Date(s.entry.request.timestamp).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})),o=e.computed(()=>s.entry.duration===null?"pending...":s.entry.duration<1e3?`${s.entry.duration}ms`:`${(s.entry.duration/1e3).toFixed(2)}s`),y=e.computed(()=>s.entry.status===null?"status-badge--pending":s.entry.status<200?"status-badge--1xx":s.entry.status<300?"status-badge--2xx":s.entry.status<400?"status-badge--3xx":s.entry.status<500?"status-badge--4xx":"status-badge--5xx"),E=e.computed(()=>s.entry.status===null?G:s.entry.status<400?ot:$e),_=e.computed(()=>s.entry.response===null);function a(){l("select",s.entry.id)}return(b,S)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:e.normalizeClass(["timeline-entry",{"timeline-entry--selected":n.isSelected},{"timeline-entry--pending":_.value},{"timeline-entry--simulated":n.entry.simulated}]),onClick:a},[e.createElementVNode("div",es,e.toDisplayString(i.value),1),e.createElementVNode("div",ts,[e.createElementVNode("span",{class:e.normalizeClass(["method-badge",`method-badge--${n.entry.request.method.toLowerCase()}`])},e.toDisplayString(e.unref(Ee)(n.entry.request.method)),3)]),e.createElementVNode("div",ns,e.toDisplayString(n.entry.request.path),1),e.createElementVNode("div",os,[n.entry.status!==null?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-badge",y.value])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E.value),{size:12})),e.createTextVNode(" "+e.toDisplayString(n.entry.status),1)],2)):(e.openBlock(),e.createElementBlock("span",ss,[e.createVNode(e.unref(G),{size:12}),S[0]||(S[0]=e.createTextVNode(" pending ",-1))]))]),e.createElementVNode("div",ls,e.toDisplayString(o.value),1),n.entry.simulated?(e.openBlock(),e.createElementBlock("div",as,[e.createVNode(e.unref(ne),{size:14})])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-a073dbdf"]]),is={class:"timeline-page"},cs={class:"timeline-toolbar"},ds={class:"timeline-search"},ms=["value"],ps=["aria-expanded"],us={key:0,class:"timeline-filter-toggle__badge"},fs={class:"timeline-stats"},ys={class:"timeline-stats__item"},hs={key:0,class:"timeline-stats__separator"},_s={key:1,class:"timeline-stats__item"},gs=["disabled"],ks={key:0,class:"timeline-filters"},Es={class:"timeline-filters__section"},Ns={class:"timeline-filters__methods"},bs=["onClick"],Vs={class:"timeline-filters__section"},Ss={class:"timeline-filters__status"},Bs=["onClick"],Cs={class:"timeline-filters__status-count"},$s={class:"timeline-filters__section"},xs={class:"timeline-filters__type"},ws={key:0,class:"timeline-filters__actions"},Ds={class:"timeline-content"},Ts={key:0,class:"timeline-loading"},Is={key:1,class:"timeline-error"},zs={class:"timeline-error__message"},Ms={key:2,class:"timeline-empty empty-state"},qs={key:3,class:"timeline-empty empty-state"},Fs={class:"timeline-list-panel"},Ls={class:"timeline-list"},Rs={class:"timeline-detail-panel"},As=Object.freeze(Object.defineProperty({__proto__:null,default:U(e.defineComponent({__name:"TimelinePage",setup(n){const t=Rt(),{send:s,on:l,connected:i}=se(),o=e.ref(!1),y=e.ref(null),E=["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD","TRACE"],_=["2xx","3xx","4xx","5xx"];function a(){i.value&&(t.setLoading(!0),s({type:"get:timeline"}))}function b(M){t.setTimelineData(M),t.setLoading(!1)}function S(M){t.addRequest(M)}function B(M){t.addResponse(M)}function x(){t.clearTimeline()}function F(){s({type:"clear:timeline"}),t.clearTimeline()}function R(M){t.selectEntry(M)}function $(M){const m=M.target;t.setSearchQuery(m.value)}function r(){t.setSearchQuery(""),y.value?.focus()}function c(M){t.toggleMethodFilter(M)}function d(M){return t.filter.methods.includes(M)}function C(M){t.toggleStatusFilter(M)}function q(M){return t.filter.statusCodes.includes(M)}function g(){const M=t.filter.simulatedOnly;t.setSimulatedFilter(M===!0?null:!0)}function f(){t.clearFilters()}function h(){o.value=!o.value}const u=e.computed(()=>t.hasActiveFilters()),z=e.computed(()=>t.filter.methods.length+t.filter.statusCodes.length+(t.filter.simulatedOnly!==null?1:0));let k=null,D=null,A=null,H=null;return e.onMounted(()=>{k=l("timeline",b),D=l("request",S),A=l("response",B),H=l("timeline:cleared",x),i.value&&a()}),e.onUnmounted(()=>{k?.(),D?.(),A?.(),H?.()}),e.watch(i,M=>{M&&a()}),(M,m)=>(e.openBlock(),e.createElementBlock("div",is,[e.createElementVNode("div",cs,[e.createElementVNode("div",ds,[e.createVNode(e.unref(ue),{size:16,class:"timeline-search__icon"}),e.createElementVNode("input",{ref_key:"searchInputRef",ref:y,type:"text",class:"timeline-search__input input",placeholder:"Search by path or operation...",value:e.unref(t).filter.searchQuery,onInput:$},null,40,ms),e.unref(t).filter.searchQuery?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"timeline-search__clear btn btn--ghost btn--icon",title:"Clear search",onClick:r},[e.createVNode(e.unref(ae),{size:14})])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["timeline-filter-toggle btn btn--secondary",{"timeline-filter-toggle--active":u.value}]),"aria-expanded":o.value,onClick:h},[e.createVNode(e.unref(Ae),{size:16}),m[0]||(m[0]=e.createElementVNode("span",null,"Filters",-1)),z.value>0?(e.openBlock(),e.createElementBlock("span",us,e.toDisplayString(z.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value?e.unref(Re):e.unref(X)),{size:14}))],10,ps),e.createElementVNode("div",fs,[e.createElementVNode("span",ys,e.toDisplayString(e.unref(t).filteredEntries.length)+" requests ",1),e.unref(t).averageDuration>0?(e.openBlock(),e.createElementBlock("span",hs,"|")):e.createCommentVNode("",!0),e.unref(t).averageDuration>0?(e.openBlock(),e.createElementBlock("span",_s," avg "+e.toDisplayString(e.unref(t).averageDuration)+"ms ",1)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:"btn btn--secondary btn--icon",title:"Clear timeline",disabled:e.unref(t).entries.length===0,onClick:F},[e.createVNode(e.unref(fe),{size:16})],8,gs)]),o.value?(e.openBlock(),e.createElementBlock("div",ks,[e.createElementVNode("div",Es,[m[1]||(m[1]=e.createElementVNode("h4",{class:"timeline-filters__title"},"Methods",-1)),e.createElementVNode("div",Ns,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(E,N=>e.createElementVNode("button",{key:N,type:"button",class:e.normalizeClass(["method-badge",`method-badge--${N.toLowerCase()}`,{"method-badge--inactive":!d(N)&&e.unref(t).filter.methods.length>0}]),onClick:w=>c(N)},e.toDisplayString(N),11,bs)),64))])]),e.createElementVNode("div",Vs,[m[2]||(m[2]=e.createElementVNode("h4",{class:"timeline-filters__title"},"Status",-1)),e.createElementVNode("div",Ss,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(_,N=>e.createElementVNode("button",{key:N,type:"button",class:e.normalizeClass(["timeline-filters__status-btn",`timeline-filters__status-btn--${N}`,{"timeline-filters__status-btn--active":q(N)}]),onClick:w=>C(N)},[e.createTextVNode(e.toDisplayString(N)+" ",1),e.createElementVNode("span",Cs," ("+e.toDisplayString(e.unref(t).statusCounts[N])+") ",1)],10,Bs)),64))])]),e.createElementVNode("div",$s,[m[3]||(m[3]=e.createElementVNode("h4",{class:"timeline-filters__title"},"Type",-1)),e.createElementVNode("div",xs,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["timeline-filters__status-btn",{"timeline-filters__status-btn--active":e.unref(t).filter.simulatedOnly}]),onClick:g}," Simulated only ",2)])]),u.value?(e.openBlock(),e.createElementBlock("div",ws,[e.createElementVNode("button",{type:"button",class:"btn btn--ghost",onClick:f},[e.createVNode(e.unref(ae),{size:14}),m[4]||(m[4]=e.createTextVNode(" Clear all filters ",-1))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ds,[e.unref(t).isLoading?(e.openBlock(),e.createElementBlock("div",Ts,[...m[5]||(m[5]=[e.createElementVNode("div",{class:"timeline-loading__spinner"},null,-1),e.createElementVNode("span",{class:"text-muted"},"Loading timeline...",-1)])])):e.unref(t).error?(e.openBlock(),e.createElementBlock("div",Is,[e.createElementVNode("p",zs,e.toDisplayString(e.unref(t).error),1),e.createElementVNode("button",{type:"button",class:"btn btn--primary",onClick:a}," Retry ")])):e.unref(t).entries.length===0?(e.openBlock(),e.createElementBlock("div",Ms,[e.createVNode(e.unref(G),{size:48,class:"empty-state__icon"}),m[6]||(m[6]=e.createElementVNode("h3",{class:"empty-state__title"},"No requests yet",-1)),m[7]||(m[7]=e.createElementVNode("p",{class:"empty-state__description"}," API requests will appear here in real-time as they are made. ",-1))])):e.unref(t).filteredEntries.length===0?(e.openBlock(),e.createElementBlock("div",qs,[e.createVNode(e.unref(ue),{size:48,class:"empty-state__icon"}),m[8]||(m[8]=e.createElementVNode("h3",{class:"empty-state__title"},"No matching requests",-1)),m[9]||(m[9]=e.createElementVNode("p",{class:"empty-state__description"}," Try adjusting your search or filters. ",-1)),u.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"btn btn--secondary",onClick:f}," Clear filters ")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",Fs,[e.createElementVNode("div",Ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).filteredEntries,N=>(e.openBlock(),e.createBlock(rs,{key:N.id,entry:N,"is-selected":e.unref(t).selectedEntryId===N.id,onSelect:R},null,8,["entry","is-selected"]))),128))])]),e.createElementVNode("div",Rs,[e.createVNode(vo,{entry:e.unref(t).selectedEntry},null,8,["entry"])])],64))])]))}}),[["__scopeId","data-v-a5c73778"]])},Symbol.toStringTag,{value:"Module"}));function Fe(n,t){return n.length<=t?n:`${n.slice(0,t)}…`}function Os(n){return n==null?"--":typeof n=="string"?Fe(n,50):typeof n=="number"||typeof n=="boolean"?String(n):Array.isArray(n)||typeof n=="object"?Fe(JSON.stringify(n),50):String(n)}function Ze(n,t){if(!(typeof n!="object"||n===null))return n[t]}function Ps(n,t,s){const l=Ze(n,t);return typeof l=="string"||typeof l=="number"?l:s}function Hs(n,t){if(n.length===0)return[];const s=new Set;for(const i of n)if(typeof i=="object"&&i!==null)for(const o of Object.keys(i))s.add(o);if(s.size===0)return[];const l=Array.from(s);return l.includes(t)?[t,...l.filter(i=>i!==t)]:l}const js={class:"data-table"},Us={key:0,class:"data-table__empty"},Js={key:1,class:"data-table__container"},Qs={class:"data-table__table"},Ws=["onClick"],Gs={class:"data-table__row-num"},Ks={key:2,class:"data-table__footer"},Zs={class:"data-table__info"},Ys={class:"data-table__info"},Xs=U(e.defineComponent({__name:"DataTable",props:{items:{},idField:{},selectedIndex:{default:-1}},emits:["select"],setup(n,{emit:t}){const s=n,l=t,i=e.computed(()=>Hs(s.items,s.idField));function o(E){l("select",E)}function y(E,_){return Ps(E,s.idField,_)}return(E,_)=>(e.openBlock(),e.createElementBlock("div",js,[n.items.length===0?(e.openBlock(),e.createElementBlock("div",Us,[e.createVNode(e.unref(pe),{size:32,class:"data-table__empty-icon"}),_[0]||(_[0]=e.createElementVNode("span",null,"No items",-1))])):(e.openBlock(),e.createElementBlock("div",Js,[e.createElementVNode("table",Qs,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[_[1]||(_[1]=e.createElementVNode("th",{class:"data-table__row-num"},"#",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,a=>(e.openBlock(),e.createElementBlock("th",{key:a,class:e.normalizeClass(["data-table__header",{"data-table__header--id":a===n.idField}])},e.toDisplayString(a),3))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,(a,b)=>(e.openBlock(),e.createElementBlock("tr",{key:y(a,b),class:e.normalizeClass(["data-table__row",{"data-table__row--selected":b===n.selectedIndex}]),onClick:S=>o(b)},[e.createElementVNode("td",Gs,e.toDisplayString(b+1),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,S=>(e.openBlock(),e.createElementBlock("td",{key:S,class:e.normalizeClass(["data-table__cell",{"data-table__cell--id":S===n.idField}])},e.toDisplayString(e.unref(Os)(e.unref(Ze)(a,S))),3))),128))],10,Ws))),128))])])])),n.items.length>0?(e.openBlock(),e.createElementBlock("div",Ks,[e.createElementVNode("span",Zs,e.toDisplayString(n.items.length)+" items",1),e.createElementVNode("span",Ys,e.toDisplayString(i.value.length)+" columns",1)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-dcdce8f7"]]),vs={class:"json-editor"},el={class:"json-editor__container"},tl=["value","readonly","placeholder"],nl={class:"json-editor__status"},ol={class:"json-editor__status-left"},sl={key:0,class:"json-editor__valid"},ll={key:1,class:"json-editor__error"},al={class:"json-editor__status-right"},rl={class:"json-editor__info"},il=U(e.defineComponent({__name:"JsonEditor",props:{modelValue:{},readonly:{type:Boolean,default:!1},placeholder:{default:"Enter JSON data..."},minHeight:{default:200}},emits:["update:modelValue"],setup(n,{expose:t,emit:s}){const l=n,i=s,o=e.ref(""),y=e.ref(null),E=e.computed(()=>y.value===null),_=e.computed(()=>o.value.split(`
2
- `).length),a=e.computed(()=>Array.from({length:_.value},(r,c)=>c+1)),b=e.ref(null);function S(){try{o.value=JSON.stringify(l.modelValue,null,2),y.value=null}catch{o.value="",y.value="Invalid initial value"}}S(),e.watch(()=>l.modelValue,()=>{try{const r=JSON.parse(o.value);JSON.stringify(r)!==JSON.stringify(l.modelValue)&&S()}catch{S()}});function B(r){const c=r.target;o.value=c.value,x()}function x(){if(o.value.trim()===""){y.value=null,i("update:modelValue",[]);return}try{const r=JSON.parse(o.value);y.value=null,i("update:modelValue",r)}catch(r){if(r instanceof Error){const c=r.message.match(/position (\d+)/);if(c){const d=Number.parseInt(c[1],10),C=o.value.substring(0,d).split(`
3
- `),q=C.length,g=C[C.length-1].length+1;y.value=`Line ${q}, Column ${g}: ${r.message}`}else y.value=r.message}else y.value="Invalid JSON"}}function F(){try{const r=JSON.parse(o.value);o.value=JSON.stringify(r,null,2),y.value=null,i("update:modelValue",r)}catch{}}function R(r){if(r.key==="Tab"){r.preventDefault();const c=r.target,d=c.selectionStart,C=c.selectionEnd,q=`${o.value.substring(0,d)} ${o.value.substring(C)}`;o.value=q,setTimeout(()=>{c.selectionStart=c.selectionEnd=d+2},0),x()}}function $(r){const c=r.target;b.value&&(b.value.scrollTop=c.scrollTop)}return t({formatJson:F,isValid:E}),(r,c)=>(e.openBlock(),e.createElementBlock("div",vs,[e.createElementVNode("div",el,[e.createElementVNode("div",{ref_key:"linesRef",ref:b,class:"json-editor__lines","aria-hidden":"true"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,d=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"json-editor__line-number"},e.toDisplayString(d),1))),128))],512),e.createElementVNode("textarea",{value:o.value,readonly:n.readonly,placeholder:n.placeholder,style:e.normalizeStyle({"--json-editor-min-height":`${n.minHeight}px`}),class:"json-editor__textarea",spellcheck:"false",onInput:B,onKeydown:R,onScroll:$},null,44,tl)]),e.createElementVNode("div",nl,[e.createElementVNode("div",ol,[E.value?(e.openBlock(),e.createElementBlock("div",sl,[e.createVNode(e.unref(me),{size:14}),c[0]||(c[0]=e.createElementVNode("span",null,"Valid JSON",-1))])):y.value?(e.openBlock(),e.createElementBlock("div",ll,[e.createVNode(e.unref(nt),{size:14}),e.createElementVNode("span",null,e.toDisplayString(y.value),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",al,[e.createElementVNode("span",rl,e.toDisplayString(_.value)+" lines",1)])])]))}}),[["__scopeId","data-v-a953e764"]]),ie=e.ref([]),J=e.reactive({visible:!1,title:"",message:"",confirmText:"Confirm",cancelText:"Cancel",onConfirm:null,onCancel:null}),le=new Map;let P=null,cl=0;function dl(){return`toast-${Date.now()}-${cl++}`}function Ne(n,t,s=3e3){const l=dl(),i={id:l,type:n,message:t,duration:s,timestamp:Date.now()};if(ie.value.push(i),s>0){const o=setTimeout(()=>{Ye(l),le.delete(l)},s);le.set(l,o)}return l}function Ye(n){const t=le.get(n);t!==void 0&&(clearTimeout(t),le.delete(n));const s=ie.value.findIndex(l=>l.id===n);s!==-1&&ie.value.splice(s,1)}function ml(){function n(_,a){return Ne("success",_,a)}function t(_,a){return Ne("error",_,a)}function s(_,a){return Ne("info",_,a)}function l(_,a){return Ne("warning",_,a)}function i(_,a){return new Promise(b=>{P&&(P(!1),P=null),P=b,J.visible=!0,J.title=a?.title||"Confirm",J.message=_,J.confirmText=a?.confirmText||"Confirm",J.cancelText=a?.cancelText||"Cancel",J.onConfirm=()=>{J.visible=!1,P&&(P(!0),P=null)},J.onCancel=()=>{J.visible=!1,P&&(P(!1),P=null)}})}function o(){J.visible=!1,P&&(P(!1),P=null)}function y(_){Ye(_)}function E(){for(const _ of le.values())clearTimeout(_);le.clear(),ie.value=[]}return{toasts:ie,confirmDialog:J,success:n,error:t,info:s,warning:l,dismiss:y,clearAll:E,confirm:i,closeConfirm:o}}const pl={class:"models-page"},ul={class:"models-sidebar"},fl={class:"models-sidebar__header"},yl={class:"models-sidebar__badge"},hl={key:0,class:"models-sidebar__loading"},_l={key:1,class:"models-sidebar__list"},gl=["onClick"],kl={class:"models-sidebar__name"},El={class:"models-sidebar__count"},Nl={class:"models-sidebar__footer"},bl={class:"models-sidebar__stat"},Vl={class:"font-mono"},Sl={class:"models-content"},Bl={class:"models-toolbar"},Cl={class:"models-toolbar__title"},$l={class:"font-mono"},xl={class:"text-muted"},wl={key:0,class:"models-toolbar__badge models-toolbar__badge--warning"},Dl={class:"models-toolbar__actions"},Tl=["disabled"],Il=["disabled"],zl={key:0,class:"models-error"},Ml={class:"models-panels"},ql={class:"models-panel"},Fl={class:"models-panel"},Ll={key:1,class:"models-loading-overlay"},Rl={key:1,class:"empty-state"},Al={key:0,class:"models-error"},Ol={class:"modal__body"},Pl={class:"modal__footer"},Hl=Object.freeze(Object.defineProperty({__proto__:null,default:U(e.defineComponent({__name:"ModelsPage",setup(n){const t=Ft(),{send:s,on:l,connected:i}=se(),{success:o,error:y,confirm:E}=ml(),_=e.ref(null),a=e.ref(!1),b=e.ref(-1);e.onMounted(async()=>{try{await t.fetchSchemas(),t.schemas.length>0&&!t.selectedSchema&&await t.selectSchemaByName(t.schemas[0].name)}catch(c){t.error||(t.error=c instanceof Error?c.message:"Failed to load schemas")}}),l("store:updated",c=>{const d=c;if(typeof c!="object"||c===null||typeof d.schema!="string"||typeof d.action!="string"||typeof d.count!="number"){console.warn("[ModelsPage] Invalid store:updated payload:",c);return}t.handleStoreUpdate(c),b.value=-1}),l("reseeded",c=>{const d=c;if(typeof c!="object"||c===null||typeof d.success!="boolean"||!Array.isArray(d.schemas)){console.warn("[ModelsPage] Invalid reseeded payload:",c);return}t.handleReseedComplete(c),b.value=-1}),e.watch(()=>t.selectedSchema,async()=>{b.value=-1,_.value&&t.currentItems.length>0&&(await e.nextTick(),_.value?.formatJson())}),e.watch(()=>t.currentItems,(c,d)=>{const C=b.value;if(C<0)return;if(C>=c.length){b.value=-1;return}const q=t.currentSchema?.idField??"id",g=d?.[C],f=c[C];if(g!==f){if(typeof g=="object"&&g!==null&&typeof f=="object"&&f!==null){const h=g[q],u=f[q];if(h!==void 0&&h===u)return}b.value=-1}});async function S(c){t.isDirty&&!await E("You have unsaved changes. Are you sure you want to switch schemas?",{title:"Unsaved Changes",confirmText:"Switch Schema",cancelText:"Cancel"})||await t.selectSchemaByName(c)}async function B(){if(!_.value?.isValid){y("Cannot save invalid JSON. Please fix the errors first.");return}if(await t.saveItems())o("Items saved successfully");else{const d=t.error||"Failed to save items";y(d)}}async function x(){if(!t.isDirty)return;await E("Discard all changes and revert to saved data?",{title:"Discard Changes",confirmText:"Discard",cancelText:"Cancel"})&&(t.discardChanges(),o("Changes discarded"))}async function F(){a.value=!1;try{if(await t.clearSchema())o("Schema cleared successfully");else{const d=t.error||"Failed to clear schema";y(d)}}catch(c){const d=c instanceof Error?c.message:"Failed to clear schema";y(d)}}async function R(){if(!i.value){y("WebSocket not connected. Cannot trigger reseed.");return}await E("This will regenerate all seed data and replace existing items. Continue?",{title:"Reseed All Schemas",confirmText:"Reseed",cancelText:"Cancel"})&&(s({type:"reseed"}),o("Reseed command sent"))}function $(c){t.updateItems(c)}function r(c){b.value=b.value===c?-1:c}return(c,d)=>(e.openBlock(),e.createElementBlock("div",pl,[e.createElementVNode("aside",ul,[e.createElementVNode("div",fl,[e.createVNode(e.unref(pe),{size:18}),d[4]||(d[4]=e.createElementVNode("span",null,"Schemas",-1)),e.createElementVNode("span",yl,e.toDisplayString(e.unref(t).schemaCount),1)]),e.unref(t).loading&&e.unref(t).schemas.length===0?(e.openBlock(),e.createElementBlock("div",hl,[...d[5]||(d[5]=[e.createElementVNode("div",{class:"spinner"},null,-1),e.createElementVNode("span",null,"Loading...",-1)])])):(e.openBlock(),e.createElementBlock("div",_l,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).schemas,C=>(e.openBlock(),e.createElementBlock("button",{key:C.name,class:e.normalizeClass(["models-sidebar__item",{"models-sidebar__item--active":e.unref(t).selectedSchema===C.name}]),onClick:q=>S(C.name)},[e.createElementVNode("span",kl,e.toDisplayString(C.name),1),e.createElementVNode("span",El,e.toDisplayString(C.count),1)],10,gl))),128))])),e.createElementVNode("div",Nl,[e.createElementVNode("div",bl,[d[6]||(d[6]=e.createElementVNode("span",{class:"text-muted"},"Total Items:",-1)),e.createElementVNode("span",Vl,e.toDisplayString(e.unref(t).totalItems),1)])])]),e.createElementVNode("main",Sl,[e.unref(t).selectedSchema?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Bl,[e.createElementVNode("div",Cl,[e.createElementVNode("span",$l,e.toDisplayString(e.unref(t).selectedSchema),1),e.createElementVNode("span",xl,"("+e.toDisplayString(e.unref(t).currentItems.length)+" items)",1),e.unref(t).isDirty?(e.openBlock(),e.createElementBlock("span",wl," Unsaved ")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Dl,[e.unref(t).isDirty?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn btn--ghost",title:"Discard changes",onClick:x},[e.createVNode(e.unref(ae),{size:16}),d[7]||(d[7]=e.createElementVNode("span",null,"Discard",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{disabled:!e.unref(t).isDirty||e.unref(t).loading,class:"btn btn--primary",title:"Save changes",onClick:B},[e.createVNode(e.unref(rt),{size:16}),d[8]||(d[8]=e.createElementVNode("span",null,"Save",-1))],8,Tl),e.createElementVNode("button",{class:"btn btn--danger",title:"Clear all items",onClick:d[0]||(d[0]=C=>a.value=!0)},[e.createVNode(e.unref(fe),{size:16}),d[9]||(d[9]=e.createElementVNode("span",null,"Clear",-1))]),e.createElementVNode("button",{disabled:!e.unref(i),class:"btn btn--secondary",title:"Reseed all schemas with generated data",onClick:R},[e.createVNode(e.unref(at),{size:16}),d[10]||(d[10]=e.createElementVNode("span",null,"Reseed All",-1))],8,Il)])]),e.unref(t).error?(e.openBlock(),e.createElementBlock("div",zl,[e.createElementVNode("span",null,"⚠️ "+e.toDisplayString(e.unref(t).error),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ml,[e.createElementVNode("div",ql,[e.createVNode(il,{ref_key:"jsonEditorRef",ref:_,"model-value":e.unref(t).currentItems,readonly:e.unref(t).loading,"min-height":400,"onUpdate:modelValue":$},null,8,["model-value","readonly"])]),e.createElementVNode("div",Fl,[e.createVNode(Xs,{items:e.unref(t).currentItems,"id-field":e.unref(t).currentSchema?.idField??"id","selected-index":b.value,onSelect:r},null,8,["items","id-field","selected-index"])])]),e.unref(t).loading?(e.openBlock(),e.createElementBlock("div",Ll,[...d[11]||(d[11]=[e.createElementVNode("div",{class:"spinner"},null,-1),e.createElementVNode("span",null,"Loading...",-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",Rl,[e.unref(t).error?(e.openBlock(),e.createElementBlock("div",Al,[e.createElementVNode("span",null,"⚠️ "+e.toDisplayString(e.unref(t).error),1)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(pe),{size:48,class:"empty-state__icon"}),d[12]||(d[12]=e.createElementVNode("h3",{class:"empty-state__title"},"Select a schema",-1)),d[13]||(d[13]=e.createElementVNode("p",{class:"empty-state__description"}," Choose a schema from the sidebar to view and edit its data. ",-1))],64))]))]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-overlay",onClick:d[3]||(d[3]=C=>a.value=!1)},[e.createElementVNode("div",{class:"modal",onClick:d[2]||(d[2]=e.withModifiers(()=>{},["stop"]))},[d[17]||(d[17]=e.createElementVNode("div",{class:"modal__header"},[e.createElementVNode("h3",null,"Clear Schema Data")],-1)),e.createElementVNode("div",Ol,[e.createElementVNode("p",null,[d[14]||(d[14]=e.createTextVNode(" Are you sure you want to clear all items for ",-1)),e.createElementVNode("strong",null,e.toDisplayString(e.unref(t).selectedSchema),1),d[15]||(d[15]=e.createTextVNode("? ",-1))]),d[16]||(d[16]=e.createElementVNode("p",{class:"text-muted"},"This action cannot be undone.",-1))]),e.createElementVNode("div",Pl,[e.createElementVNode("button",{class:"btn btn--ghost",onClick:d[1]||(d[1]=C=>a.value=!1)}," Cancel "),e.createElementVNode("button",{class:"btn btn--danger",onClick:F}," Clear Schema ")])])])):e.createCommentVNode("",!0)]))]))}}),[["__scopeId","data-v-62a953d5"]])},Symbol.toStringTag,{value:"Module"})),jl={class:"simulator-page"},Ul={class:"simulator-form card"},Jl={class:"simulator-form__header"},Ql={class:"simulator-form__body"},Wl={key:0,class:"simulator-form__row"},Gl=["value"],Kl={class:"simulator-form__row"},Zl=["value"],Yl={class:"simulator-presets"},Xl=["title","onClick"],vl={class:"simulator-preset__label"},ea=["disabled"],ta={class:"simulator-active"},na={class:"simulator-active__header"},oa={class:"simulator-active__title"},sa=["disabled"],la={class:"simulator-active__list"},aa={class:"simulator-simulation__info"},ra={class:"simulator-simulation__path font-mono"},ia={class:"simulator-simulation__preset"},ca={key:0,class:"text-muted"},da=["disabled","onClick"],ma={key:0,class:"empty-state"},pa=Object.freeze(Object.defineProperty({__proto__:null,default:U(e.defineComponent({__name:"SimulatorPage",setup(n){const t=Lt(),s=Je(),{send:l,on:i,connected:o}=se(),y=e.ref(""),E=e.ref("GET"),_=e.ref(null),a=e.ref(null),b=["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD"];let S=[];const B=e.ref(new Set),x=e.computed(()=>s.endpoints.map(f=>({key:f.key,label:`${f.method.toUpperCase()} ${f.path}`,method:f.method.toUpperCase(),path:f.path,operationId:f.operationId}))),F=e.computed(()=>{const f=y.value.trim()!=="",h=_.value!==null;return f&&h}),R=e.computed(()=>t.activeSimulations.map(f=>{const h=f.presetId?t.getPreset(f.presetId):null;return{...f,preset:h}})),$=e.computed(()=>t.count);function r(){if(!F.value||!_.value||!t.getPreset(_.value))return;const h=y.value.trim();if(!h.startsWith("/")){t.setError("Path must start with /");return}if(h.length>500){t.setError("Path is too long (max 500 characters)");return}if(!/^\/[\w\-/{}:.]*$/.test(h)){t.setError("Path contains invalid characters");return}const u=`${E.value.toLowerCase()}:${h}`,z=t.createSimulationFromPreset(u,_.value,void 0);z&&(t.addSimulationLocal(z,!0),t.setLoading(!0),l({type:"set:simulation",data:{path:z.path,status:z.status,delay:z.delay,body:z.body}}),y.value="",_.value=null,a.value=null)}function c(f){t.removeSimulationLocal(f,!0),t.setLoading(!0),l({type:"clear:simulation",data:{path:f}})}function d(){if($.value!==0){for(const f of t.activeSimulations)B.value.add(f.path),t.removeSimulationLocal(f.path,!0),l({type:"clear:simulation",data:{path:f.path}});t.setLoading(!0)}}function C(){if(!a.value)return;const f=s.endpoints.find(h=>h.key===a.value);f&&(E.value=f.method.toUpperCase(),y.value=f.path)}function q(){a.value=null}function g(){o.value&&(t.setLoading(!0),l({type:"get:registry"}))}return e.onMounted(()=>{S=[i("simulation:active",f=>{t.setSimulations(f.simulations),t.setLoading(!1)}),i("simulation:added",f=>{t.handleSimulationAdded(f)}),i("simulation:removed",f=>{t.handleSimulationRemoved(f)}),i("simulations:cleared",f=>{t.handleSimulationsCleared(f)}),i("simulation:set",f=>{t.handleSimulationSet(f)}),i("simulation:cleared",f=>{B.value.has(f.path)&&B.value.delete(f.path),t.handleSimulationCleared(f)})],o.value&&g()}),e.onUnmounted(()=>{for(const f of S)f()}),e.watch(o,f=>{f?g():t.setLoading(!1)}),(f,h)=>(e.openBlock(),e.createElementBlock("div",jl,[e.createElementVNode("div",Ul,[e.createElementVNode("div",Jl,[e.createVNode(e.unref(ne),{size:18}),h[3]||(h[3]=e.createElementVNode("span",null,"Add Simulation",-1))]),e.createElementVNode("div",Ql,[x.value.length>0?(e.openBlock(),e.createElementBlock("div",Wl,[h[5]||(h[5]=e.createElementVNode("label",{class:"simulator-form__label"},"Select Endpoint (optional):",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":h[0]||(h[0]=u=>a.value=u),class:"input",onChange:C},[h[4]||(h[4]=e.createElementVNode("option",{value:null},"Manual entry...",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,u=>(e.openBlock(),e.createElementBlock("option",{key:u.key,value:u.key},e.toDisplayString(u.label),9,Gl))),128))],544),[[e.vModelSelect,a.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",Kl,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":h[1]||(h[1]=u=>E.value=u),class:"simulator-form__method input",onChange:q},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(b,u=>e.createElementVNode("option",{key:u,value:u},e.toDisplayString(u),9,Zl)),64))],544),[[e.vModelSelect,E.value]]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[2]||(h[2]=u=>y.value=u),type:"text",class:"simulator-form__path input",placeholder:"/api/path",onInput:q},null,544),[[e.vModelText,y.value]])]),e.createElementVNode("div",Yl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).presets,u=>(e.openBlock(),e.createElementBlock("button",{key:u.id,class:e.normalizeClass(["simulator-preset",{"simulator-preset--selected":_.value===u.id},`simulator-preset--${u.type}`]),title:u.description,onClick:z=>_.value=u.id},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.type==="delay"?e.unref(G):e.unref($e)),{size:14})),e.createElementVNode("span",vl,e.toDisplayString(u.label),1)],10,Xl))),128))]),e.createElementVNode("button",{class:"btn btn--primary",disabled:!F.value||e.unref(t).isLoading,onClick:r},[e.createVNode(e.unref(lt),{size:16}),h[6]||(h[6]=e.createElementVNode("span",null,"Add Simulation",-1))],8,ea)])]),e.createElementVNode("div",ta,[e.createElementVNode("div",na,[e.createElementVNode("span",oa," Active Simulations ("+e.toDisplayString($.value)+") ",1),$.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn btn--ghost",disabled:e.unref(t).isLoading,onClick:d},[e.createVNode(e.unref(fe),{size:14}),h[7]||(h[7]=e.createElementVNode("span",null,"Clear All",-1))],8,sa)):e.createCommentVNode("",!0)]),e.createElementVNode("div",la,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,u=>(e.openBlock(),e.createElementBlock("div",{key:u.path,class:"simulator-simulation card"},[e.createElementVNode("div",aa,[e.createElementVNode("span",ra,e.toDisplayString(u.path),1)]),e.createElementVNode("div",ia,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.preset?.type==="delay"?e.unref(G):e.unref($e)),{size:14,class:e.normalizeClass({"text-warning":u.preset?.type==="delay","text-error":u.preset?.type==="error","text-muted":u.preset?.type==="empty"})},null,8,["class"])),e.createElementVNode("span",null,e.toDisplayString(u.preset?.label||`HTTP ${u.status}`),1),u.delay?(e.openBlock(),e.createElementBlock("span",ca," ("+e.toDisplayString(u.delay)+"ms) ",1)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"btn btn--ghost btn--icon",title:"Remove simulation",disabled:e.unref(t).isLoading,onClick:z=>c(u.path)},[e.createVNode(e.unref(fe),{size:14})],8,da)]))),128)),$.value===0?(e.openBlock(),e.createElementBlock("div",ma,[e.createVNode(e.unref(ne),{size:48,class:"empty-state__icon"}),h[8]||(h[8]=e.createElementVNode("h3",{class:"empty-state__title"},"No active simulations",-1)),h[9]||(h[9]=e.createElementVNode("p",{class:"empty-state__description"}," Add a simulation above to test error handling and slow responses. ",-1))])):e.createCommentVNode("",!0)])])]))}}),[["__scopeId","data-v-3076fbb2"]])},Symbol.toStringTag,{value:"Module"}));j.bootstrap=Ke,j.useTheme=Pt,j.useWebSocket=se,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(U,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("pinia"),require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","pinia","vue","vue-router"],W):(U=typeof globalThis<"u"?globalThis:U||self,W(U.ViteOpenApiDevtools={},U.Pinia,U.Vue,U.VueRouter))})(this,(function(U,W,e,de){"use strict";const Re=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ve=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,o,l)=>l?l.toUpperCase():o.toLowerCase()),et=n=>{const t=ve(n);return t.charAt(0).toUpperCase()+t.slice(1)},tt=(...n)=>n.filter((t,o,l)=>!!t&&t.trim()!==""&&l.indexOf(t)===o).join(" ").trim();var me={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const nt=({size:n,strokeWidth:t=2,absoluteStrokeWidth:o,color:l,iconNode:r,name:s,class:f,...N},{slots:_})=>e.h("svg",{...me,width:n||me.width,height:n||me.height,stroke:l||me.stroke,"stroke-width":o?Number(t)*24/Number(n):t,class:tt("lucide",...s?[`lucide-${Re(et(s))}-icon`,`lucide-${Re(s)}`]:["lucide-icon"]),...N},[...r.map(a=>e.h(...a)),..._.default?[_.default()]:[]]);const I=(n,t)=>(o,{slots:l})=>e.h(nt,{...o,iconNode:t,name:n},l);const pe=I("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const v=I("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const ne=I("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const Ae=I("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const ot=I("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const st=I("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const K=I("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ve=I("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);const Se=I("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ue=I("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const Ce=I("file-json",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);const Oe=I("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]);const lt=I("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const at=I("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const rt=I("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const Be=I("route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);const it=I("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const fe=I("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const ct=I("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);const $e=I("sprout",[["path",{d:"M7 20h10",key:"e6iznv"}],["path",{d:"M10 20c5.5-2.5.8-6.4 3-10",key:"161w41"}],["path",{d:"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z",key:"9gtqwd"}],["path",{d:"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z",key:"bkxnd2"}]]);const dt=I("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);const ye=I("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const xe=I("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const mt=I("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const pt=I("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);const re=I("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const oe=I("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),ut="#94a3b8",ft=W.defineStore("specs",()=>{const n=e.ref([]),t=e.ref(null),o=e.computed(()=>new Map(n.value.map(h=>[h.id,h]))),l=e.computed(()=>n.value.map(h=>h.id)),r=e.computed(()=>t.value?o.value.get(t.value)??null:null),s=e.computed(()=>t.value!==null);function f(h){n.value=h,t.value&&!h.some(S=>S.id===t.value)&&(t.value=null)}function N(h){t.value=h!==null&&!n.value.some(S=>S.id===h)?null:h}function _(h){t.value===h?t.value=null:N(h)}function a(h){return o.value.get(h)?.color??ut}return{specs:n,activeSpecFilter:t,specMap:o,specIds:l,activeSpec:r,isFiltered:s,setSpecs:f,setFilter:N,toggleFilter:_,getColor:a}}),we={path:"/_ws",reconnectDelay:2e3,maxReconnectAttempts:Number.POSITIVE_INFINITY,autoConnect:!0},O=e.ref("disconnected"),De=e.ref(null),ie=e.ref(0);let L=null,he=null,se={...we},Te=!1;const G=new Map;function Pe(){return typeof window<"u"&&typeof WebSocket<"u"}function yt(){return e.getCurrentInstance()!==null}function ht(n){return Pe()?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${n}`:`ws://localhost${n}`}function He(){he!==null&&(clearTimeout(he),he=null)}function _t(n,t){const o=G.get(n);if(o)for(const r of o)try{r(t)}catch(s){console.error(`[DevTools WebSocket] Error in event handler for '${n}':`,s)}const l=G.get("*");if(l)for(const r of l)try{r({type:n,data:t})}catch(s){console.error("[DevTools WebSocket] Error in wildcard event handler:",s)}}function gt(){O.value="connected",ie.value=0,He()}function kt(n){for(const t of n)P({type:"get:registry",data:{specId:t.id}}),P({type:"get:timeline",data:{specId:t.id}})}function Et(n){try{const t=JSON.parse(n.data);if(t.type==="connected"){const o=t.data;De.value=o.serverVersion,o.specs&&Array.isArray(o.specs)&&(ft().setSpecs(o.specs),kt(o.specs))}_t(t.type,t.data)}catch(t){console.error("[DevTools WebSocket] Failed to parse message:",t)}}function Nt(){O.value,O.value="disconnected",L=null,ie.value<se.maxReconnectAttempts&&(O.value="reconnecting",ie.value++,he=setTimeout(()=>{Ie()},se.reconnectDelay))}function bt(n){console.error("[DevTools WebSocket] Error:",n)}function Ie(){if(!Pe()||O.value==="connecting"||O.value==="connected"||L&&(L.readyState===WebSocket.CONNECTING||L.readyState===WebSocket.OPEN))return;je(),O.value="connecting";const n=ht(se.path);try{L=new WebSocket(n),L.onopen=gt,L.onmessage=Et,L.onclose=Nt,L.onerror=bt}catch(t){console.error("[DevTools WebSocket] Failed to create WebSocket:",t),O.value="disconnected"}}function je(){L&&(L.onopen=null,L.onmessage=null,L.onclose=null,L.onerror=null,(L.readyState===WebSocket.OPEN||L.readyState===WebSocket.CONNECTING)&&L.close(),L=null)}function Ue(){He(),je(),O.value="disconnected",ie.value=0}function P(n){if(!L||L.readyState!==WebSocket.OPEN)return!1;try{return L.send(JSON.stringify(n)),!0}catch(t){return console.error("[DevTools WebSocket] Failed to send command:",t),!1}}function Vt(){return P({type:"get:specs"})}function St(n){return P({type:"get:registry",data:n?{specId:n}:void 0})}function Ct(n,t){const o={};return n&&(o.specId=n),t!==void 0&&(o.limit=t),P({type:"get:timeline",data:Object.keys(o).length>0?o:void 0})}function Bt(n){return P({type:"clear:timeline",data:n?{specId:n}:void 0})}function $t(n,t){return P({type:"get:store",data:{specId:n,schema:t}})}function xt(n,t,o){return P({type:"set:store",data:{specId:n,schema:t,items:o}})}function wt(n,t){return P({type:"clear:store",data:{specId:n,schema:t}})}function Dt(n,t){return P({type:"set:simulation",data:{specId:n,...t}})}function Tt(n,t){return P({type:"clear:simulation",data:{specId:n,path:t}})}function It(n){return P({type:"reseed",data:{specId:n}})}function ze(n,t){G.has(n)||G.set(n,new Set);const o=G.get(n);return o&&o.add(t),()=>{const l=G.get(n);l&&(l.delete(t),l.size===0&&G.delete(n))}}function Me(n,t){const o=G.get(n);o&&(o.delete(t),o.size===0&&G.delete(n))}function zt(n,t){const o=l=>{Me(n,o),t(l)};return ze(n,o)}function Mt(n,t){const o=l=>{t(l)===!0&&Me(n,o)};return ze(n,o)}function qt(){Ue(),De.value=null,G.clear(),se={...we},Te=!1}function le(n={}){(!Te||O.value==="disconnected")&&(se={...we,...n},Te=!0);const t=e.computed(()=>O.value==="connected"),o=e.computed(()=>O.value==="reconnecting");return yt()&&e.onMounted(()=>{se.autoConnect&&Ie()}),{connectionState:e.computed(()=>O.value),connected:t,isReconnecting:o,serverVersion:e.computed(()=>De.value),reconnectAttempts:e.computed(()=>ie.value),connect:Ie,disconnect:Ue,send:P,on:ze,off:Me,once:zt,onUntil:Mt,resetState:qt,getSpecs:Vt,getRegistry:St,getTimeline:Ct,clearTimeline:Bt,getStore:$t,setStore:xt,clearStore:wt,setSimulation:Dt,clearSimulation:Tt,reseed:It}}const Je=[{path:"/",redirect:"/routes"},{path:"/routes",name:"routes",component:()=>Promise.resolve().then(()=>yo),meta:{title:"Routes",icon:"route"}},{path:"/timeline",name:"timeline",component:()=>Promise.resolve().then(()=>Xs),meta:{title:"Timeline",icon:"clock"}},{path:"/models",name:"models",component:()=>Promise.resolve().then(()=>ta),meta:{title:"Models",icon:"database"}},{path:"/simulator",name:"simulator",component:()=>Promise.resolve().then(()=>Ca),meta:{title:"Simulator",icon:"zap"}},{path:"/:pathMatch(.*)*",name:"not-found",redirect:"/routes"}],Ft=de.createRouter({history:de.createWebHashHistory(),routes:Je}),Lt={class:"app"},Rt={class:"app-header"},At={class:"app-header__brand"},Ot={class:"app-nav",role:"tablist","aria-label":"DevTools navigation"},Pt=["aria-selected","aria-current","aria-controls","onClick"],Ht={class:"app-nav__label"},jt={class:"app-header__status"},Ut={class:"connection-status"},Jt={class:"connection-status__text"},Qt={class:"app-main"},Wt=e.defineComponent({__name:"App",setup(n){const t=de.useRoute(),o=de.useRouter(),l=e.computed(()=>Je.filter(a=>a.name&&a.meta?.title).map(a=>({name:a.name,path:a.path,title:a.meta?.title,icon:a.meta?.icon}))),r=e.computed(()=>t.name);function s(a){o.push(a)}const f={route:Be,clock:K,database:ue,zap:oe};function N(a){return f[a]??Be}const{connected:_}=le();return(a,h)=>{const S=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",Lt,[e.createElementVNode("header",Rt,[e.createElementVNode("div",At,[e.createVNode(e.unref(oe),{class:"app-header__logo",size:20}),h[0]||(h[0]=e.createElementVNode("span",{class:"app-header__title"},"OpenAPI DevTools",-1))]),e.createElementVNode("nav",Ot,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,C=>(e.openBlock(),e.createElementBlock("button",{key:C.name,role:"tab","aria-selected":r.value===C.name,"aria-current":r.value===C.name?"true":void 0,"aria-controls":`panel-${C.name}`,tabindex:0,class:e.normalizeClass(["app-nav__tab",{"app-nav__tab--active":r.value===C.name}]),onClick:x=>s(C.path)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(N(C.icon)),{size:16,class:"app-nav__icon"})),e.createElementVNode("span",Ht,e.toDisplayString(C.title),1)],10,Pt))),128))]),e.createElementVNode("div",jt,[e.createElementVNode("div",Ut,[e.createElementVNode("span",{class:e.normalizeClass(["connection-status__dot",e.unref(_)?"connection-status__dot--connected":"connection-status__dot--disconnected"])},null,2),e.createElementVNode("span",Jt,e.toDisplayString(e.unref(_)?"Connected":"Disconnected"),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(_)?e.unref(pt):e.unref(mt)),{size:14,class:"connection-status__icon"}))])])]),e.createElementVNode("main",Qt,[e.createVNode(S,null,{default:e.withCtx(({Component:C})=>[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(C)))]),_:2},1024)]),_:1})])])}}}),J=(n,t)=>{const o=n.__vccOpts||n;for(const[l,r]of t)o[l]=r;return o},Gt=J(Wt,[["__scopeId","data-v-0a83e2b9"]]);function _e(n){try{return structuredClone(e.toRaw(n))}catch{return JSON.parse(JSON.stringify(n))}}const Kt=W.defineStore("models",()=>{const n=e.ref([]),t=e.ref(null),o=e.ref([]),l=e.ref([]),r=e.ref(!1),s=e.ref(null),f=e.computed(()=>t.value?n.value.find(k=>k.name===t.value)??null:null),N=e.ref(!1),_=e.computed(()=>N.value),a=e.computed(()=>n.value.length),h=e.computed(()=>n.value.reduce((k,y)=>k+y.count,0));async function S(){r.value=!0,s.value=null;try{const k=await fetch("/_api/store");if(!k.ok)throw new Error(`Failed to fetch schemas: ${k.statusText}`);const y=await k.json();n.value=y.schemas??[]}catch(k){s.value=k instanceof Error?k.message:"Failed to fetch schemas",console.error("[ModelsStore] Error fetching schemas:",k)}finally{r.value=!1}}async function C(k){t.value!==k&&(t.value=k,await x(k))}async function x(k){r.value=!0,s.value=null;try{const y=await fetch(`/_api/store/${encodeURIComponent(k)}`);if(!y.ok)throw new Error(`Failed to fetch schema data: ${y.statusText}`);const g=await y.json(),u=g.items??[];o.value=_e(u),l.value=_e(u),N.value=!1;const z=n.value.findIndex(E=>E.name===k);z!==-1&&(n.value[z].count=g.count)}catch(y){s.value=y instanceof Error?y.message:"Failed to fetch schema data",console.error("[ModelsStore] Error fetching schema data:",y)}finally{r.value=!1}}function F(k){if(!Array.isArray(k)){s.value="Invalid data: Expected an array of items",console.error("[ModelsStore] updateItems received non-array value:",typeof k);return}o.value=k,s.value=null,N.value=!0}async function R(){if(!t.value)return s.value="No schema selected",!1;r.value=!0,s.value=null;try{const k=await fetch(`/_api/store/${encodeURIComponent(t.value)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o.value)});if(!k.ok){const u=await k.json().catch(()=>({}));throw new Error(u.error||`Failed to save items: ${k.statusText}`)}const y=await k.json();l.value=_e(o.value),N.value=!1;const g=n.value.findIndex(u=>u.name===t.value);return g!==-1&&(n.value[g].count=y.created??o.value.length),!0}catch(k){return s.value=k instanceof Error?k.message:"Failed to save items",console.error("[ModelsStore] Error saving items:",k),!1}finally{r.value=!1}}async function $(){if(!t.value)return s.value="No schema selected",!1;r.value=!0,s.value=null;try{const k=await fetch(`/_api/store/${encodeURIComponent(t.value)}`,{method:"DELETE"});if(!k.ok)throw new Error(`Failed to clear schema: ${k.statusText}`);o.value=[],l.value=[],N.value=!1;const y=n.value.findIndex(g=>g.name===t.value);return y!==-1&&(n.value[y].count=0),!0}catch(k){return s.value=k instanceof Error?k.message:"Failed to clear schema",console.error("[ModelsStore] Error clearing schema:",k),!1}finally{r.value=!1}}function i(){o.value=_e(l.value),N.value=!1}async function c(){t.value?await x(t.value):await S()}function d(){n.value=[],t.value=null,o.value=[],l.value=[],r.value=!1,s.value=null,N.value=!1}function B(k){const y=n.value.findIndex(g=>g.name===k.schema);y!==-1&&(n.value[y].count=k.count),t.value===k.schema&&(_.value?console.warn(`[ModelsStore] Skipping auto-refresh for schema "${k.schema}" - unsaved changes exist`):x(k.schema))}function q(k){k.success&&(S(),t.value&&(_.value?console.warn(`[ModelsStore] Skipping auto-refresh after reseed for schema "${t.value}" - unsaved changes exist`):x(t.value)))}return{schemas:n,selectedSchema:t,currentItems:o,loading:r,error:s,currentSchema:f,isDirty:_,schemaCount:a,totalItems:h,fetchSchemas:S,selectSchemaByName:C,fetchSchemaData:x,updateItems:F,saveItems:R,clearSchema:$,discardChanges:i,refresh:c,reset:d,handleStoreUpdate:B,handleReseedComplete:q}}),Qe=W.defineStore("registry",()=>{const n=e.ref([]),t=e.ref({totalEndpoints:0,withCustomHandler:0,totalSchemas:0,withCustomSeed:0,autoGenerated:0}),o=e.ref(!1),l=e.ref(null),r=e.ref(""),s=e.ref({methods:[],hasHandler:null,hasSeed:null,tags:[]}),f=e.ref(null),N=e.ref(new Set),_=e.computed(()=>{const m=new Set;for(const b of n.value)for(const w of b.tags)m.add(w);return Array.from(m).sort()}),a=e.computed(()=>{const m=new Set;for(const b of n.value)b.responseSchema&&m.add(b.responseSchema);return Array.from(m).sort()}),h=e.computed(()=>{let m=n.value;if(r.value.trim()){const b=r.value.toLowerCase().trim();m=m.filter(w=>w.path.toLowerCase().includes(b)||w.operationId.toLowerCase().includes(b)||w.summary?.toLowerCase().includes(b)||w.tags.some(p=>p.toLowerCase().includes(b)))}return s.value.methods.length>0&&(m=m.filter(b=>s.value.methods.includes(b.method))),s.value.hasHandler!==null&&(m=m.filter(b=>b.hasHandler===s.value.hasHandler)),s.value.hasSeed!==null&&(m=m.filter(b=>b.hasSeed===s.value.hasSeed)),s.value.tags.length>0&&(m=m.filter(b=>b.tags.some(w=>s.value.tags.includes(w)))),m}),S=e.computed(()=>{const m=new Map;for(const b of h.value){let w;b.tags.length>0?w=b.tags[0]:b.responseSchema?w=b.responseSchema:w=b.path.split("/").filter(Boolean)[0]||"Other",m.has(w)||m.set(w,[]),m.get(w)?.push(b)}return Array.from(m.entries()).map(([b,w])=>({tag:b,endpoints:w.sort((p,V)=>p.path.localeCompare(V.path)),isExpanded:N.value.has(b)})).sort((b,w)=>b.tag.localeCompare(w.tag))}),C=e.computed(()=>f.value?n.value.find(m=>m.key===f.value)??null:null),x=e.computed(()=>n.value.filter(m=>m.hasHandler).length),F=e.computed(()=>n.value.filter(m=>m.hasSeed).length);function R(m){n.value=m.endpoints,t.value=m.stats,l.value=null;for(const b of m.endpoints)b.tags.length>0&&N.value.add(b.tags[0])}function $(m){o.value=m}function i(m){l.value=m,o.value=!1}function c(){l.value=null}function d(m){r.value=m}function B(m){const b=s.value.methods.indexOf(m);b===-1?s.value.methods.push(m):s.value.methods.splice(b,1)}function q(m){s.value.hasHandler=m}function k(m){s.value.hasSeed=m}function y(m){const b=s.value.tags.indexOf(m);b===-1?s.value.tags.push(m):s.value.tags.splice(b,1)}function g(){s.value={methods:[],hasHandler:null,hasSeed:null,tags:[]},r.value=""}function u(){return r.value.trim()!==""||s.value.methods.length>0||s.value.hasHandler!==null||s.value.hasSeed!==null||s.value.tags.length>0}function z(m){f.value=m}function E(m){N.value.has(m)?N.value.delete(m):N.value.add(m)}function D(){for(const m of S.value)N.value.add(m.tag)}function A(){N.value.clear()}function j(m){const b=new Set(m);for(const w of n.value)w.hasHandler=b.has(w.operationId)}function M(m){const b=new Set(m);for(const w of n.value)w.hasSeed=w.responseSchema?b.has(w.responseSchema):!1}return{endpoints:n,stats:t,isLoading:o,error:l,searchQuery:r,filter:s,selectedEndpointKey:f,expandedTags:N,allTags:_,allSchemas:a,filteredEndpoints:h,groupedEndpoints:S,selectedEndpoint:C,handlerCount:x,seedCount:F,setRegistryData:R,setLoading:$,setError:i,clearError:c,setSearchQuery:d,toggleMethodFilter:B,setHandlerFilter:q,setSeedFilter:k,toggleTagFilter:y,clearFilters:g,hasActiveFilters:u,selectEndpoint:z,toggleGroup:E,expandAllGroups:D,collapseAllGroups:A,updateHandlerStatus:j,updateSeedStatus:M}}),qe=[{id:"slow-network",label:"Slow Network",description:"3000ms delay (3G simulation)",type:"delay",status:200,delay:3e3},{id:"server-error",label:"Server Error",description:"Returns HTTP 500",type:"error",status:500,body:{error:"Internal Server Error",message:"Simulated server error"}},{id:"rate-limit",label:"Rate Limited",description:"Returns HTTP 429",type:"error",status:429,body:{error:"Too Many Requests",message:"Rate limit exceeded"}},{id:"not-found",label:"Not Found",description:"Returns HTTP 404",type:"error",status:404,body:{error:"Not Found",message:"Resource not found"}},{id:"request-timeout",label:"Request Timeout",description:"30000ms delay (simulates timeout)",type:"delay",status:200,delay:3e4},{id:"empty-response",label:"Empty Response",description:"Returns HTTP 200 with empty body",type:"empty",status:200,body:null},{id:"unauthorized",label:"Unauthorized",description:"Returns HTTP 401",type:"error",status:401,body:{error:"Unauthorized",message:"Authentication required"}}],Zt=W.defineStore("simulation",()=>{const n=e.ref(new Map),t=e.ref(new Map),o=e.ref(!1),l=e.ref(null),r=e.computed(()=>Array.from(n.value.values())),s=e.computed(()=>n.value.size),f=e.computed(()=>qe),N=e.computed(()=>n.value.size>0),_=e.computed(()=>{const E={delay:[],error:[],empty:[]};for(const D of n.value.values()){const A=a(D);E[A].push(D)}return E});function a(E){const D=E.presetId?qe.find(A=>A.id===E.presetId):null;return D?D.type:E.delay&&E.delay>0?"delay":E.body===null?"empty":"error"}function h(E){n.value.clear();for(const D of E)n.value.set(D.path,D);l.value=null}function S(E,D=!1){if(D){const A=n.value.get(E.path)||null;t.value.set(E.path,A)}n.value.set(E.path,E)}function C(E,D=!1){if(D){const A=n.value.get(E)||null;t.value.set(E,A)}return n.value.delete(E)}function x(){n.value.clear()}function F(E){return n.value.get(E)}function R(E){return n.value.has(E)}function $(E){return qe.find(D=>D.id===E)}function i(E,D,A){const j=$(D);return j?{path:E,operationId:A,status:j.status,delay:j.delay,body:j.body,presetId:j.id}:(l.value=`Preset not found: ${D}`,null)}function c(E){o.value=E}function d(E){l.value=E,o.value=!1}function B(){l.value=null}function q(E){if(!t.value.has(E))return;const D=t.value.get(E);D==null?n.value.delete(E):n.value.set(E,D),t.value.delete(E)}function k(E){console.log("[Simulation] Added:",E.path)}function y(E){C(E.path),console.log("[Simulation] Removed:",E.path)}function g(E){x(),console.log("[Simulation] Cleared all:",E.count)}function u(E){E.success?(t.value.delete(E.path),console.log("[Simulation] Set successfully:",E.path)):(q(E.path),d(`Failed to set simulation for ${E.path}`)),c(!1)}function z(E){E.success?(t.value.delete(E.path),console.log("[Simulation] Cleared successfully:",E.path)):(q(E.path),d(`Failed to clear simulation for ${E.path}`)),c(!1)}return{simulations:n,isLoading:o,error:l,activeSimulations:r,count:s,presets:f,hasActiveSimulations:N,simulationsByType:_,setSimulations:h,addSimulationLocal:S,removeSimulationLocal:C,clearSimulationsLocal:x,getSimulation:F,hasSimulation:R,getPreset:$,createSimulationFromPreset:i,setLoading:c,setError:d,clearError:B,rollbackSimulation:q,handleSimulationAdded:k,handleSimulationRemoved:y,handleSimulationsCleared:g,handleSimulationSet:u,handleSimulationCleared:z}}),Yt=W.defineStore("timeline",()=>{const n=e.ref([]),t=e.ref(!1),o=e.ref(null),l=e.ref({methods:[],statusCodes:[],searchQuery:"",simulatedOnly:null}),r=e.ref(null),s=e.ref(500),f=new Map;function N(p){return p<200?"1xx":p<300?"2xx":p<400?"3xx":p<500?"4xx":"5xx"}const _=e.computed(()=>{let p=n.value;if(l.value.searchQuery.trim()){const V=l.value.searchQuery.toLowerCase().trim();p=p.filter(T=>T.request.path.toLowerCase().includes(V)||T.request.operationId.toLowerCase().includes(V))}return l.value.methods.length>0&&(p=p.filter(V=>l.value.methods.includes(V.request.method.toUpperCase()))),l.value.statusCodes.length>0&&(p=p.filter(V=>{if(V.status===null)return!1;const T=N(V.status);return l.value.statusCodes.includes(T)})),l.value.simulatedOnly!==null&&(p=p.filter(V=>V.simulated===l.value.simulatedOnly)),p}),a=e.computed(()=>r.value?n.value.find(p=>p.id===r.value)??null:null),h=e.computed(()=>n.value.length),S=e.computed(()=>n.value.filter(p=>p.response!==null).length),C=e.computed(()=>n.value.filter(p=>p.response===null).length),x=e.computed(()=>{const p={"1xx":0,"2xx":0,"3xx":0,"4xx":0,"5xx":0};for(const V of n.value)if(V.status!==null){const T=N(V.status);p[T]++}return p}),F=e.computed(()=>{const p=n.value.filter(T=>T.duration!==null);if(p.length===0)return 0;const V=p.reduce((T,Y)=>T+(Y.duration??0),0);return Math.round(V/p.length)});function R(p){const V={id:p.id,request:p,response:null,status:null,duration:null,simulated:!1},T=f.get(p.id);T&&(i(V,T),f.delete(p.id)),n.value.unshift(V),n.value.length>s.value&&(n.value=n.value.slice(0,s.value))}function $(p){const V=n.value.find(T=>T.id===p.requestId);if(V)i(V,p),f.delete(p.requestId);else if(f.set(p.requestId,p),f.size>100){const T=c(p);n.value.unshift(T),f.delete(p.requestId),n.value.length>s.value&&(n.value=n.value.slice(0,s.value))}}function i(p,V){p.response=V,p.status=V.status,p.duration=V.duration,p.simulated=V.simulated}function c(p){const V={id:p.requestId,method:"UNKNOWN",path:"/unknown",operationId:"unknown",timestamp:Date.now(),headers:{},query:{},body:void 0};return{id:p.requestId,request:V,response:p,status:p.status,duration:p.duration,simulated:p.simulated}}function d(p){for(const[V,T]of f){const Y=p.get(V);Y?(i(Y,T),f.delete(V)):(p.set(V,c(T)),f.delete(V))}}function B(p,V){for(const[T,Y]of V){const X=p.get(T);X?i(X,Y):f.set(T,Y)}}function q(p){for(const[V,T]of f)p.has(V)||(p.set(V,c(T)),f.delete(V))}function k(p){const V=new Map,T=new Map;for(const X of p.entries)if(X.type==="request"){const ee=X.data;V.set(ee.id,{id:ee.id,request:ee,response:null,status:null,duration:null,simulated:!1})}else if(X.type==="response"){const ee=X.data;T.set(ee.requestId,ee)}d(V),B(V,T),q(V);const Y=Array.from(V.values()).sort((X,ee)=>ee.request.timestamp-X.request.timestamp);n.value=Y.slice(0,s.value),o.value=null}function y(){n.value=[],r.value=null,f.clear()}function g(p){t.value=p}function u(p){o.value=p,t.value=!1}function z(){o.value=null}function E(p){l.value.searchQuery=p}function D(p){const V=l.value.methods.indexOf(p);V===-1?l.value.methods.push(p):l.value.methods.splice(V,1)}function A(p){const V=l.value.statusCodes.indexOf(p);V===-1?l.value.statusCodes.push(p):l.value.statusCodes.splice(V,1)}function j(p){l.value.simulatedOnly=p}function M(){l.value={methods:[],statusCodes:[],searchQuery:"",simulatedOnly:null}}function m(){return l.value.searchQuery.trim()!==""||l.value.methods.length>0||l.value.statusCodes.length>0||l.value.simulatedOnly!==null}function b(p){r.value=p}function w(p){const V=Math.max(1,p);s.value=V,n.value.length>V&&(n.value=n.value.slice(0,V))}return{entries:n,isLoading:t,error:o,filter:l,selectedEntryId:r,maxEntries:s,filteredEntries:_,selectedEntry:a,totalCount:h,completedCount:S,pendingCount:C,statusCounts:x,averageDuration:F,addRequest:R,addResponse:$,setTimelineData:k,clearTimeline:y,setLoading:g,setError:u,clearError:z,setSearchQuery:E,toggleMethodFilter:D,toggleStatusFilter:A,setSimulatedFilter:j,clearFilters:M,hasActiveFilters:m,selectEntry:b,setMaxEntries:w}}),Xt=["light","dark","system"];function We(n){return typeof n=="string"&&Xt.includes(n)}const Fe="openapi-devtools-theme",Z=e.ref("system"),te=e.ref(!1);let ge=null,ke=null;function Ee(){return typeof window<"u"&&typeof document<"u"}function vt(){return e.getCurrentInstance()!==null}function en(){const n=e.computed(()=>Z.value==="system"?te.value?"dark":"light":Z.value),t=e.computed(()=>n.value==="dark");function o(){if(!Ee())return;const a=document.documentElement;n.value==="dark"?(a.classList.add("dark"),a.classList.remove("light")):(a.classList.add("light"),a.classList.remove("dark"))}function l(a){if(!We(a)){console.warn(`[DevTools] Invalid theme mode: ${a}`);return}if(Z.value=a,Ee())try{localStorage.setItem(Fe,a)}catch{console.warn("[DevTools] Unable to persist theme preference")}}function r(){Z.value==="system"?l(te.value?"light":"dark"):l(Z.value==="dark"?"light":"dark")}function s(){l("system")}function f(){ge&&ke&&(ge.removeEventListener("change",ke),ge=null,ke=null)}function N(){if(!Ee())return;f();const a=window.matchMedia("(prefers-color-scheme: dark)");te.value=a.matches;const h=S=>{te.value=S.matches};a.addEventListener("change",h),ge=a,ke=h;try{const S=localStorage.getItem(Fe);We(S)&&(Z.value=S)}catch{}o()}function _(){if(f(),Z.value="system",te.value=!1,Ee()){document.documentElement.classList.remove("dark","light");try{localStorage.removeItem(Fe)}catch{}}}return e.watch([Z,te],()=>{o()}),vt()&&(e.onMounted(()=>{N()}),e.onUnmounted(()=>{f()})),{themeMode:e.computed(()=>Z.value),effectiveTheme:n,isDark:t,systemPrefersDark:e.computed(()=>te.value),setTheme:l,toggleTheme:r,resetToSystem:s,initialize:N,resetState:_}}let Ge=!1,Ke=null;function Ze(){if(Ge)return Ke;const n=e.createApp(Gt),t=W.createPinia();return n.use(t),n.use(Ft),n.mount("#app"),Ge=!0,Ke=n,n}typeof window<"u"&&document.getElementById("app")&&Ze();function Ne(n){return n.toUpperCase()}const tn={class:"endpoint-detail"},nn={key:0,class:"endpoint-detail__empty"},on={key:1,class:"endpoint-detail__content"},sn={class:"endpoint-detail__header"},ln={class:"endpoint-detail__path font-mono"},an={class:"endpoint-detail__status"},rn={key:0,class:"endpoint-detail__status-item endpoint-detail__status-item--handler"},cn={key:1,class:"endpoint-detail__status-item endpoint-detail__status-item--seed"},dn={key:2,class:"endpoint-detail__status-item endpoint-detail__status-item--security"},mn={key:3,class:"endpoint-detail__status-item endpoint-detail__status-item--auto"},pn={class:"endpoint-detail__sections"},un={class:"endpoint-detail__section"},fn={class:"endpoint-detail__section-content font-mono"},yn={key:0,class:"endpoint-detail__section"},hn={class:"endpoint-detail__section-title"},_n={class:"endpoint-detail__tags"},gn={key:1,class:"endpoint-detail__section"},kn={class:"endpoint-detail__section-content"},En={key:2,class:"endpoint-detail__section"},Nn={class:"endpoint-detail__section-content endpoint-detail__description"},bn={key:3,class:"endpoint-detail__section"},Vn={class:"endpoint-detail__section-title"},Sn={class:"endpoint-detail__section-content font-mono"},Cn={key:4,class:"endpoint-detail__section"},Bn={class:"endpoint-detail__section-title"},$n={class:"endpoint-detail__security"},xn={class:"endpoint-detail__security-name font-mono"},wn={class:"endpoint-detail__security-scopes text-muted"},Dn=J(e.defineComponent({__name:"EndpointDetail",props:{endpoint:{}},setup(n){const t=n,o=e.computed(()=>t.endpoint?.security&&t.endpoint.security.length>0),l=e.computed(()=>t.endpoint?.security?t.endpoint.security.map(r=>({name:r.name,scopes:r.scopes.length>0?r.scopes.join(", "):"No scopes"})):[]);return(r,s)=>(e.openBlock(),e.createElementBlock("div",tn,[n.endpoint?(e.openBlock(),e.createElementBlock("div",on,[e.createElementVNode("header",sn,[e.createElementVNode("span",{class:e.normalizeClass(["method-badge","method-badge--large",`method-badge--${n.endpoint.method}`])},e.toDisplayString(e.unref(Ne)(n.endpoint.method)),3),e.createElementVNode("h2",ln,e.toDisplayString(n.endpoint.path),1)]),e.createElementVNode("div",an,[n.endpoint.hasHandler?(e.openBlock(),e.createElementBlock("div",rn,[e.createVNode(e.unref(Ve),{size:14}),s[2]||(s[2]=e.createElementVNode("span",null,"Has custom handler",-1))])):e.createCommentVNode("",!0),n.endpoint.hasSeed?(e.openBlock(),e.createElementBlock("div",cn,[e.createVNode(e.unref($e),{size:14}),s[3]||(s[3]=e.createElementVNode("span",null,"Has seed data",-1))])):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",dn,[e.createVNode(e.unref(lt),{size:14}),s[4]||(s[4]=e.createElementVNode("span",null,"Requires authentication",-1))])):e.createCommentVNode("",!0),!n.endpoint.hasHandler&&!n.endpoint.hasSeed?(e.openBlock(),e.createElementBlock("div",mn,[e.createVNode(e.unref(Ce),{size:14}),s[5]||(s[5]=e.createElementVNode("span",null,"Auto-generated response",-1))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",pn,[e.createElementVNode("section",un,[s[6]||(s[6]=e.createElementVNode("h3",{class:"endpoint-detail__section-title"},"Operation",-1)),e.createElementVNode("p",fn,e.toDisplayString(n.endpoint.operationId),1)]),n.endpoint.tags.length>0?(e.openBlock(),e.createElementBlock("section",yn,[e.createElementVNode("h3",hn,[e.createVNode(e.unref(dt),{size:14}),s[7]||(s[7]=e.createTextVNode(" Tags ",-1))]),e.createElementVNode("div",_n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.endpoint.tags,f=>(e.openBlock(),e.createElementBlock("span",{key:f,class:"endpoint-detail__tag"},e.toDisplayString(f),1))),128))])])):e.createCommentVNode("",!0),n.endpoint.summary?(e.openBlock(),e.createElementBlock("section",gn,[s[8]||(s[8]=e.createElementVNode("h3",{class:"endpoint-detail__section-title"},"Summary",-1)),e.createElementVNode("p",kn,e.toDisplayString(n.endpoint.summary),1)])):e.createCommentVNode("",!0),n.endpoint.description?(e.openBlock(),e.createElementBlock("section",En,[s[9]||(s[9]=e.createElementVNode("h3",{class:"endpoint-detail__section-title"},"Description",-1)),e.createElementVNode("p",Nn,e.toDisplayString(n.endpoint.description),1)])):e.createCommentVNode("",!0),n.endpoint.responseSchema?(e.openBlock(),e.createElementBlock("section",bn,[e.createElementVNode("h3",Vn,[e.createVNode(e.unref(Ce),{size:14}),s[10]||(s[10]=e.createTextVNode(" Response Schema ",-1))]),e.createElementVNode("p",Sn,e.toDisplayString(n.endpoint.responseSchema),1)])):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("section",Cn,[e.createElementVNode("h3",Bn,[e.createVNode(e.unref(ct),{size:14}),s[11]||(s[11]=e.createTextVNode(" Security ",-1))]),e.createElementVNode("div",$n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,f=>(e.openBlock(),e.createElementBlock("div",{key:f.name,class:"endpoint-detail__security-item"},[e.createElementVNode("span",xn,e.toDisplayString(f.name),1),e.createElementVNode("span",wn,e.toDisplayString(f.scopes),1)]))),128))])])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("div",nn,[e.createVNode(e.unref(Ce),{size:48,class:"endpoint-detail__empty-icon"}),s[0]||(s[0]=e.createElementVNode("h3",{class:"endpoint-detail__empty-title"},"No endpoint selected",-1)),s[1]||(s[1]=e.createElementVNode("p",{class:"endpoint-detail__empty-text text-muted"}," Select an endpoint from the list to view its details ",-1))]))]))}}),[["__scopeId","data-v-c66a0f52"]]),Tn={class:"endpoint-list"},In={key:0,class:"endpoint-list__empty"},zn={key:1,class:"endpoint-list__groups"},Mn=["aria-expanded","aria-controls","onClick"],qn={class:"endpoint-group__tag"},Fn={class:"endpoint-group__count text-muted"},Ln=["id","aria-label"],Rn=["aria-selected","onClick"],An={class:"endpoint-item__path font-mono"},On={class:"endpoint-item__indicators"},Pn={key:0,class:"endpoint-item__indicator endpoint-item__indicator--handler",title:"Has custom handler"},Hn={key:1,class:"endpoint-item__indicator endpoint-item__indicator--seed",title:"Has seed data"},jn=J(e.defineComponent({__name:"EndpointList",props:{groups:{},selectedKey:{}},emits:["select","toggle-group"],setup(n,{emit:t}){const o=n,l=t;function r(N){l("select",N.key)}function s(N){l("toggle-group",N)}function f(N){return o.selectedKey===N.key}return(N,_)=>(e.openBlock(),e.createElementBlock("div",Tn,[n.groups.length===0?(e.openBlock(),e.createElementBlock("div",In,[..._[0]||(_[0]=[e.createElementVNode("p",{class:"text-muted"},"No endpoints found",-1)])])):(e.openBlock(),e.createElementBlock("div",zn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.groups,a=>(e.openBlock(),e.createElementBlock("div",{key:a.tag,class:"endpoint-group"},[e.createElementVNode("button",{type:"button",class:"endpoint-group__header","aria-expanded":a.isExpanded,"aria-controls":`group-${a.tag}`,onClick:h=>s(a.tag)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.isExpanded?e.unref(v):e.unref(ne)),{size:16,class:"endpoint-group__chevron"})),e.createElementVNode("span",qn,e.toDisplayString(a.tag),1),e.createElementVNode("span",Fn," ("+e.toDisplayString(a.endpoints.length)+") ",1)],8,Mn),e.withDirectives(e.createElementVNode("div",{id:`group-${a.tag}`,class:"endpoint-group__items",role:"group","aria-label":`${a.tag} endpoints`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.endpoints,h=>(e.openBlock(),e.createElementBlock("button",{key:h.key,type:"button",class:e.normalizeClass(["endpoint-item",{"endpoint-item--selected":f(h)}]),"aria-selected":f(h),onClick:S=>r(h)},[e.createElementVNode("span",{class:e.normalizeClass(["method-badge",`method-badge--${h.method}`])},e.toDisplayString(e.unref(Ne)(h.method)),3),e.createElementVNode("span",An,e.toDisplayString(h.path),1),e.createElementVNode("div",On,[h.hasHandler?(e.openBlock(),e.createElementBlock("span",Pn,[e.createVNode(e.unref(Ve),{size:12})])):e.createCommentVNode("",!0),h.hasSeed?(e.openBlock(),e.createElementBlock("span",Hn,[e.createVNode(e.unref($e),{size:12})])):e.createCommentVNode("",!0)])],10,Rn))),128))],8,Ln),[[e.vShow,a.isExpanded]])]))),128))]))]))}}),[["__scopeId","data-v-554ffe63"]]),Un={class:"routes-page"},Jn={class:"routes-toolbar"},Qn={class:"routes-search"},Wn=["value"],Gn=["aria-expanded"],Kn={key:0,class:"routes-filter-toggle__badge"},Zn={class:"routes-stats"},Yn={class:"routes-stats__item"},Xn={class:"routes-stats__item"},vn={key:0,class:"routes-filters"},eo={class:"routes-filters__section"},to={class:"routes-filters__methods"},no=["onClick"],oo={class:"routes-filters__section"},so={class:"routes-filters__status"},lo={key:0,class:"routes-filters__actions"},ao={class:"routes-content"},ro={key:0,class:"routes-loading"},io={key:1,class:"routes-error"},co={class:"routes-error__message"},mo={key:2,class:"routes-empty empty-state"},po={key:3,class:"routes-empty empty-state"},uo={class:"routes-list-panel"},fo={class:"routes-detail-panel"},yo=Object.freeze(Object.defineProperty({__proto__:null,default:J(e.defineComponent({__name:"RoutesPage",setup(n){const t=Qe(),{send:o,on:l,connected:r}=le(),s=e.ref(!1),f=e.ref(null),N=["get","post","put","patch","delete","options","head","trace"];function _(){r.value&&(t.setLoading(!0),o({type:"get:registry"}))}function a(g){t.setRegistryData(g),t.setLoading(!1)}function h(g){t.selectEndpoint(g)}function S(g){t.toggleGroup(g)}function C(g){const u=g.target;t.setSearchQuery(u.value)}function x(){t.setSearchQuery(""),f.value?.focus()}function F(g){t.toggleMethodFilter(g)}function R(g){return t.filter.methods.includes(g)}function $(){const g=t.filter.hasHandler;t.setHandlerFilter(g===!0?null:!0)}function i(){const g=t.filter.hasSeed;t.setSeedFilter(g===!0?null:!0)}function c(){t.clearFilters()}function d(){s.value=!s.value}const B=e.computed(()=>t.hasActiveFilters());let q=null,k=null,y=null;return e.onMounted(()=>{q=l("registry",a),k=l("handlers:updated",()=>_()),y=l("seeds:updated",()=>_()),r.value&&_()}),e.onUnmounted(()=>{q?.(),k?.(),y?.()}),e.watch(r,g=>{g&&_()}),(g,u)=>(e.openBlock(),e.createElementBlock("div",Un,[e.createElementVNode("div",Jn,[e.createElementVNode("div",Qn,[e.createVNode(e.unref(fe),{size:16,class:"routes-search__icon"}),e.createElementVNode("input",{ref_key:"searchInputRef",ref:f,type:"text",class:"routes-search__input input",placeholder:"Search endpoints...",value:e.unref(t).searchQuery,onInput:C},null,40,Wn),e.unref(t).searchQuery?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"routes-search__clear btn btn--ghost btn--icon",title:"Clear search",onClick:x},[e.createVNode(e.unref(re),{size:14})])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["routes-filter-toggle btn btn--secondary",{"routes-filter-toggle--active":B.value}]),"aria-expanded":s.value,onClick:d},[e.createVNode(e.unref(Oe),{size:16}),u[0]||(u[0]=e.createElementVNode("span",null,"Filters",-1)),B.value?(e.openBlock(),e.createElementBlock("span",Kn,e.toDisplayString(e.unref(t).filter.methods.length+(e.unref(t).filter.hasHandler?1:0)+(e.unref(t).filter.hasSeed?1:0)),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value?e.unref(Ae):e.unref(v)),{size:14}))],10,Gn),e.createElementVNode("div",Zn,[e.createElementVNode("span",Yn,e.toDisplayString(e.unref(t).filteredEndpoints.length)+" endpoints ",1),u[1]||(u[1]=e.createElementVNode("span",{class:"routes-stats__separator"},"|",-1)),e.createElementVNode("span",Xn,e.toDisplayString(e.unref(t).allTags.length)+" tags ",1)])]),s.value?(e.openBlock(),e.createElementBlock("div",vn,[e.createElementVNode("div",eo,[u[2]||(u[2]=e.createElementVNode("h4",{class:"routes-filters__title"},"Methods",-1)),e.createElementVNode("div",to,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(N,z=>e.createElementVNode("button",{key:z,type:"button",class:e.normalizeClass(["method-badge",`method-badge--${z}`,{"method-badge--inactive":!R(z)&&e.unref(t).filter.methods.length>0}]),onClick:E=>F(z)},e.toDisplayString(z.toUpperCase()),11,no)),64))])]),e.createElementVNode("div",oo,[u[5]||(u[5]=e.createElementVNode("h4",{class:"routes-filters__title"},"Status",-1)),e.createElementVNode("div",so,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["routes-filters__status-btn",{"routes-filters__status-btn--active":e.unref(t).filter.hasHandler}]),onClick:$},[e.createVNode(e.unref(Ve),{size:14}),u[3]||(u[3]=e.createElementVNode("span",null,"Has Handler",-1))],2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["routes-filters__status-btn",{"routes-filters__status-btn--active":e.unref(t).filter.hasSeed}]),onClick:i},[e.createVNode(e.unref($e),{size:14}),u[4]||(u[4]=e.createElementVNode("span",null,"Has Seed",-1))],2)])]),B.value?(e.openBlock(),e.createElementBlock("div",lo,[e.createElementVNode("button",{type:"button",class:"btn btn--ghost",onClick:c},[e.createVNode(e.unref(re),{size:14}),u[6]||(u[6]=e.createTextVNode(" Clear all filters ",-1))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ao,[e.unref(t).isLoading?(e.openBlock(),e.createElementBlock("div",ro,[...u[7]||(u[7]=[e.createElementVNode("div",{class:"routes-loading__spinner"},null,-1),e.createElementVNode("span",{class:"text-muted"},"Loading endpoints...",-1)])])):e.unref(t).error?(e.openBlock(),e.createElementBlock("div",io,[e.createElementVNode("p",co,e.toDisplayString(e.unref(t).error),1),e.createElementVNode("button",{type:"button",class:"btn btn--primary",onClick:_}," Retry ")])):e.unref(t).endpoints.length===0?(e.openBlock(),e.createElementBlock("div",mo,[e.createVNode(e.unref(Be),{size:48,class:"empty-state__icon"}),u[8]||(u[8]=e.createElementVNode("h3",{class:"empty-state__title"},"No endpoints found",-1)),u[9]||(u[9]=e.createElementVNode("p",{class:"empty-state__description"}," No API endpoints are available. Make sure your OpenAPI spec is loaded. ",-1))])):e.unref(t).filteredEndpoints.length===0?(e.openBlock(),e.createElementBlock("div",po,[e.createVNode(e.unref(fe),{size:48,class:"empty-state__icon"}),u[10]||(u[10]=e.createElementVNode("h3",{class:"empty-state__title"},"No matching endpoints",-1)),u[11]||(u[11]=e.createElementVNode("p",{class:"empty-state__description"}," Try adjusting your search or filters. ",-1)),B.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"btn btn--secondary",onClick:c}," Clear filters ")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",uo,[e.createVNode(jn,{groups:e.unref(t).groupedEndpoints,"selected-key":e.unref(t).selectedEndpointKey,onSelect:h,onToggleGroup:S},null,8,["groups","selected-key"])]),e.createElementVNode("div",fo,[e.createVNode(Dn,{endpoint:e.unref(t).selectedEndpoint},null,8,["endpoint"])])],64))])]))}}),[["__scopeId","data-v-bdd419e3"]])},Symbol.toStringTag,{value:"Module"})),ho={class:"timeline-detail"},_o={key:0,class:"timeline-detail__empty"},go={key:1,class:"timeline-detail__content"},ko={class:"timeline-detail__header"},Eo={class:"timeline-detail__summary"},No={class:"timeline-detail__path font-mono"},bo={class:"timeline-detail__meta"},Vo={key:1,class:"status-badge status-badge--pending"},So={class:"timeline-detail__duration"},Co={key:2,class:"timeline-detail__simulated",title:"Simulated response"},Bo={class:"timeline-detail__actions"},$o={class:"timeline-detail__info"},xo={class:"timeline-detail__info-item"},wo={class:"timeline-detail__info-value font-mono"},Do={class:"timeline-detail__info-item"},To={class:"timeline-detail__info-value font-mono"},Io={class:"timeline-detail__info-item"},zo={class:"timeline-detail__info-value font-mono"},Mo={class:"timeline-detail__section"},qo={key:0,class:"timeline-detail__subsection"},Fo=["aria-expanded"],Lo={class:"text-muted"},Ro={id:"requestQuery-panel",class:"timeline-detail__subsection-content"},Ao={class:"timeline-detail__kv-key font-mono"},Oo={class:"timeline-detail__kv-value font-mono"},Po={key:1,class:"timeline-detail__subsection"},Ho=["aria-expanded"],jo={class:"text-muted"},Uo={id:"requestHeaders-panel",class:"timeline-detail__subsection-content"},Jo={class:"timeline-detail__kv-key font-mono"},Qo={class:"timeline-detail__kv-value font-mono"},Wo={key:2,class:"timeline-detail__subsection"},Go={class:"timeline-detail__subsection-header",role:"group"},Ko=["aria-expanded"],Zo={id:"requestBody-panel",class:"timeline-detail__subsection-content"},Yo={class:"timeline-detail__json"},Xo={key:0,class:"timeline-detail__section"},vo={key:0,class:"timeline-detail__subsection"},es=["aria-expanded"],ts={class:"text-muted"},ns={id:"responseHeaders-panel",class:"timeline-detail__subsection-content"},os={class:"timeline-detail__kv-key font-mono"},ss={class:"timeline-detail__kv-value font-mono"},ls={key:1,class:"timeline-detail__subsection"},as={class:"timeline-detail__subsection-header",role:"group"},rs=["aria-expanded"],is={id:"responseBody-panel",class:"timeline-detail__subsection-content"},cs={class:"timeline-detail__json"},ds={key:1,class:"timeline-detail__section timeline-detail__section--pending"},ms={class:"timeline-detail__pending"},ps=J(e.defineComponent({__name:"TimelineDetail",props:{entry:{}},setup(n){const t=n,o=e.ref({requestHeaders:!0,requestQuery:!0,requestBody:!0,responseHeaders:!0,responseBody:!0}),l=e.ref(null),r=e.computed(()=>t.entry?new Date(t.entry.request.timestamp).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,hour12:!1}):""),s=e.computed(()=>t.entry?.duration==null?"pending...":t.entry.duration<1e3?`${t.entry.duration}ms`:`${(t.entry.duration/1e3).toFixed(2)}s`),f=e.computed(()=>t.entry?.status?t.entry.status<200?"status-badge--1xx":t.entry.status<300?"status-badge--2xx":t.entry.status<400?"status-badge--3xx":t.entry.status<500?"status-badge--4xx":"status-badge--5xx":"status-badge--pending"),N=e.computed(()=>t.entry?.request.query?Object.keys(t.entry.request.query).length>0:!1),_=e.computed(()=>t.entry?.request.headers?Object.keys(t.entry.request.headers).length>0:!1),a=e.computed(()=>t.entry?.request.body!==void 0&&t.entry?.request.body!==null),h=e.computed(()=>t.entry?.response?.headers?Object.keys(t.entry.response.headers).length>0:!1),S=e.computed(()=>t.entry?.response?.body!==void 0&&t.entry?.response?.body!==null);function C($){try{return JSON.stringify($,null,2)}catch{return String($)}}function x($){o.value[$]=!o.value[$]}async function F($,i){try{await navigator.clipboard.writeText($),l.value=i,setTimeout(()=>{l.value=null},2e3)}catch(c){console.error("Failed to copy:",c)}}async function R(){if(!t.entry)return;const $={request:t.entry.request,response:t.entry.response};await F(JSON.stringify($,null,2),"full")}return($,i)=>(e.openBlock(),e.createElementBlock("div",ho,[n.entry?(e.openBlock(),e.createElementBlock("div",go,[e.createElementVNode("div",ko,[e.createElementVNode("div",Eo,[e.createElementVNode("span",{class:e.normalizeClass(["method-badge",`method-badge--${n.entry.request.method.toLowerCase()}`])},e.toDisplayString(e.unref(Ne)(n.entry.request.method)),3),e.createElementVNode("span",No,e.toDisplayString(n.entry.request.path),1)]),e.createElementVNode("div",bo,[n.entry.status!==null?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-badge",f.value])},e.toDisplayString(n.entry.status),3)):(e.openBlock(),e.createElementBlock("span",Vo,"pending")),e.createElementVNode("span",So,[e.createVNode(e.unref(K),{size:14}),e.createTextVNode(" "+e.toDisplayString(s.value),1)]),n.entry.simulated?(e.openBlock(),e.createElementBlock("span",Co,[e.createVNode(e.unref(oe),{size:14}),i[9]||(i[9]=e.createTextVNode(" Simulated ",-1))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bo,[e.createElementVNode("button",{type:"button",class:"btn btn--ghost btn--sm",title:"Copy as JSON",onClick:R},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value==="full"?e.unref(pe):e.unref(Se)),{size:14})),e.createTextVNode(" "+e.toDisplayString(l.value==="full"?"Copied!":"Copy JSON"),1)])])]),e.createElementVNode("div",$o,[e.createElementVNode("div",xo,[i[10]||(i[10]=e.createElementVNode("span",{class:"timeline-detail__info-label"},"Timestamp",-1)),e.createElementVNode("span",wo,e.toDisplayString(r.value),1)]),e.createElementVNode("div",Do,[i[11]||(i[11]=e.createElementVNode("span",{class:"timeline-detail__info-label"},"Operation ID",-1)),e.createElementVNode("span",To,e.toDisplayString(n.entry.request.operationId),1)]),e.createElementVNode("div",Io,[i[12]||(i[12]=e.createElementVNode("span",{class:"timeline-detail__info-label"},"Request ID",-1)),e.createElementVNode("span",zo,e.toDisplayString(n.entry.id),1)])]),e.createElementVNode("div",Mo,[i[16]||(i[16]=e.createElementVNode("h3",{class:"timeline-detail__section-title"},"Request",-1)),N.value?(e.openBlock(),e.createElementBlock("div",qo,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-header","aria-expanded":o.value.requestQuery,"aria-controls":"requestQuery-panel",onClick:i[0]||(i[0]=c=>x("requestQuery"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value.requestQuery?e.unref(v):e.unref(ne)),{size:16})),i[13]||(i[13]=e.createElementVNode("span",null,"Query Parameters",-1)),e.createElementVNode("span",Lo,"("+e.toDisplayString(Object.keys(n.entry.request.query).length)+")",1)],8,Fo),e.withDirectives(e.createElementVNode("div",Ro,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.entry.request.query,(c,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"timeline-detail__kv-row"},[e.createElementVNode("span",Ao,e.toDisplayString(d),1),e.createElementVNode("span",Oo,e.toDisplayString(Array.isArray(c)?c.join(", "):c),1)]))),128))],512),[[e.vShow,o.value.requestQuery]])])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("div",Po,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-header","aria-expanded":o.value.requestHeaders,"aria-controls":"requestHeaders-panel",onClick:i[1]||(i[1]=c=>x("requestHeaders"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value.requestHeaders?e.unref(v):e.unref(ne)),{size:16})),i[14]||(i[14]=e.createElementVNode("span",null,"Headers",-1)),e.createElementVNode("span",jo,"("+e.toDisplayString(Object.keys(n.entry.request.headers).length)+")",1)],8,Ho),e.withDirectives(e.createElementVNode("div",Uo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.entry.request.headers,(c,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"timeline-detail__kv-row"},[e.createElementVNode("span",Jo,e.toDisplayString(d),1),e.createElementVNode("span",Qo,e.toDisplayString(c),1)]))),128))],512),[[e.vShow,o.value.requestHeaders]])])):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("div",Go,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-toggle","aria-expanded":o.value.requestBody,"aria-controls":"requestBody-panel",onClick:i[2]||(i[2]=c=>x("requestBody"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value.requestBody?e.unref(v):e.unref(ne)),{size:16})),i[15]||(i[15]=e.createElementVNode("span",null,"Body",-1))],8,Ko),e.createElementVNode("button",{type:"button",class:"btn btn--ghost btn--icon btn--sm",title:"Copy body",onClick:i[3]||(i[3]=e.withModifiers(c=>F(C(n.entry.request.body),"reqBody"),["stop"]))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value==="reqBody"?e.unref(pe):e.unref(Se)),{size:12}))])]),e.withDirectives(e.createElementVNode("div",Zo,[e.createElementVNode("pre",Yo,e.toDisplayString(C(n.entry.request.body)),1)],512),[[e.vShow,o.value.requestBody]])])):e.createCommentVNode("",!0)]),n.entry.response?(e.openBlock(),e.createElementBlock("div",Xo,[i[19]||(i[19]=e.createElementVNode("h3",{class:"timeline-detail__section-title"},"Response",-1)),h.value?(e.openBlock(),e.createElementBlock("div",vo,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-header","aria-expanded":o.value.responseHeaders,"aria-controls":"responseHeaders-panel",onClick:i[4]||(i[4]=c=>x("responseHeaders"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value.responseHeaders?e.unref(v):e.unref(ne)),{size:16})),i[17]||(i[17]=e.createElementVNode("span",null,"Headers",-1)),e.createElementVNode("span",ts,"("+e.toDisplayString(Object.keys(n.entry.response.headers).length)+")",1)],8,es),e.withDirectives(e.createElementVNode("div",ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.entry.response.headers,(c,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"timeline-detail__kv-row"},[e.createElementVNode("span",os,e.toDisplayString(d),1),e.createElementVNode("span",ss,e.toDisplayString(c),1)]))),128))],512),[[e.vShow,o.value.responseHeaders]])])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("div",ls,[e.createElementVNode("div",as,[e.createElementVNode("button",{type:"button",class:"timeline-detail__subsection-toggle","aria-expanded":o.value.responseBody,"aria-controls":"responseBody-panel",onClick:i[5]||(i[5]=c=>x("responseBody"))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value.responseBody?e.unref(v):e.unref(ne)),{size:16})),i[18]||(i[18]=e.createElementVNode("span",null,"Body",-1))],8,rs),e.createElementVNode("button",{type:"button",class:"btn btn--ghost btn--icon btn--sm",title:"Copy body",onClick:i[6]||(i[6]=e.withModifiers(c=>F(C(n.entry.response.body),"resBody"),["stop"]))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value==="resBody"?e.unref(pe):e.unref(Se)),{size:12}))])]),e.withDirectives(e.createElementVNode("div",is,[e.createElementVNode("pre",cs,e.toDisplayString(C(n.entry.response.body)),1)],512),[[e.vShow,o.value.responseBody]])])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ds,[i[21]||(i[21]=e.createElementVNode("h3",{class:"timeline-detail__section-title"},"Response",-1)),e.createElementVNode("div",ms,[e.createVNode(e.unref(K),{size:24,class:"timeline-detail__pending-icon"}),i[20]||(i[20]=e.createElementVNode("span",{class:"text-muted"},"Waiting for response...",-1))])]))])):(e.openBlock(),e.createElementBlock("div",_o,[e.createVNode(e.unref(K),{size:48,class:"timeline-detail__empty-icon"}),i[7]||(i[7]=e.createElementVNode("h3",{class:"timeline-detail__empty-title"},"Select an entry",-1)),i[8]||(i[8]=e.createElementVNode("p",{class:"timeline-detail__empty-description"}," Click on a timeline entry to view its details. ",-1))]))]))}}),[["__scopeId","data-v-b4bdd2d2"]]),us={class:"timeline-entry__time font-mono text-muted"},fs={class:"timeline-entry__method"},ys={class:"timeline-entry__path font-mono"},hs={class:"timeline-entry__status"},_s={key:1,class:"status-badge status-badge--pending"},gs={class:"timeline-entry__duration font-mono text-muted"},ks={key:0,class:"timeline-entry__simulated",title:"Simulated response"},Es=J(e.defineComponent({__name:"TimelineEntry",props:{entry:{},isSelected:{type:Boolean,default:!1}},emits:["select"],setup(n,{emit:t}){const o=n,l=t,r=e.computed(()=>new Date(o.entry.request.timestamp).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})),s=e.computed(()=>o.entry.duration===null?"pending...":o.entry.duration<1e3?`${o.entry.duration}ms`:`${(o.entry.duration/1e3).toFixed(2)}s`),f=e.computed(()=>o.entry.status===null?"status-badge--pending":o.entry.status<200?"status-badge--1xx":o.entry.status<300?"status-badge--2xx":o.entry.status<400?"status-badge--3xx":o.entry.status<500?"status-badge--4xx":"status-badge--5xx"),N=e.computed(()=>o.entry.status===null?K:o.entry.status<400?st:xe),_=e.computed(()=>o.entry.response===null);function a(){l("select",o.entry.id)}return(h,S)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:e.normalizeClass(["timeline-entry",{"timeline-entry--selected":n.isSelected},{"timeline-entry--pending":_.value},{"timeline-entry--simulated":n.entry.simulated}]),onClick:a},[e.createElementVNode("div",us,e.toDisplayString(r.value),1),e.createElementVNode("div",fs,[e.createElementVNode("span",{class:e.normalizeClass(["method-badge",`method-badge--${n.entry.request.method.toLowerCase()}`])},e.toDisplayString(e.unref(Ne)(n.entry.request.method)),3)]),e.createElementVNode("div",ys,e.toDisplayString(n.entry.request.path),1),e.createElementVNode("div",hs,[n.entry.status!==null?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["status-badge",f.value])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(N.value),{size:12})),e.createTextVNode(" "+e.toDisplayString(n.entry.status),1)],2)):(e.openBlock(),e.createElementBlock("span",_s,[e.createVNode(e.unref(K),{size:12}),S[0]||(S[0]=e.createTextVNode(" pending ",-1))]))]),e.createElementVNode("div",gs,e.toDisplayString(s.value),1),n.entry.simulated?(e.openBlock(),e.createElementBlock("div",ks,[e.createVNode(e.unref(oe),{size:14})])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-a073dbdf"]]),Ns={class:"timeline-page"},bs={class:"timeline-toolbar"},Vs={class:"timeline-search"},Ss=["value"],Cs=["aria-expanded"],Bs={key:0,class:"timeline-filter-toggle__badge"},$s={class:"timeline-stats"},xs={class:"timeline-stats__item"},ws={key:0,class:"timeline-stats__separator"},Ds={key:1,class:"timeline-stats__item"},Ts=["disabled"],Is={key:0,class:"timeline-filters"},zs={class:"timeline-filters__section"},Ms={class:"timeline-filters__methods"},qs=["onClick"],Fs={class:"timeline-filters__section"},Ls={class:"timeline-filters__status"},Rs=["onClick"],As={class:"timeline-filters__status-count"},Os={class:"timeline-filters__section"},Ps={class:"timeline-filters__type"},Hs={key:0,class:"timeline-filters__actions"},js={class:"timeline-content"},Us={key:0,class:"timeline-loading"},Js={key:1,class:"timeline-error"},Qs={class:"timeline-error__message"},Ws={key:2,class:"timeline-empty empty-state"},Gs={key:3,class:"timeline-empty empty-state"},Ks={class:"timeline-list-panel"},Zs={class:"timeline-list"},Ys={class:"timeline-detail-panel"},Xs=Object.freeze(Object.defineProperty({__proto__:null,default:J(e.defineComponent({__name:"TimelinePage",setup(n){const t=Yt(),{send:o,on:l,connected:r}=le(),s=e.ref(!1),f=e.ref(null),N=["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD","TRACE"],_=["2xx","3xx","4xx","5xx"];function a(){r.value&&(t.setLoading(!0),o({type:"get:timeline"}))}function h(M){t.setTimelineData(M),t.setLoading(!1)}function S(M){t.addRequest(M)}function C(M){t.addResponse(M)}function x(){t.clearTimeline()}function F(){o({type:"clear:timeline"}),t.clearTimeline()}function R(M){t.selectEntry(M)}function $(M){const m=M.target;t.setSearchQuery(m.value)}function i(){t.setSearchQuery(""),f.value?.focus()}function c(M){t.toggleMethodFilter(M)}function d(M){return t.filter.methods.includes(M)}function B(M){t.toggleStatusFilter(M)}function q(M){return t.filter.statusCodes.includes(M)}function k(){const M=t.filter.simulatedOnly;t.setSimulatedFilter(M===!0?null:!0)}function y(){t.clearFilters()}function g(){s.value=!s.value}const u=e.computed(()=>t.hasActiveFilters()),z=e.computed(()=>t.filter.methods.length+t.filter.statusCodes.length+(t.filter.simulatedOnly!==null?1:0));let E=null,D=null,A=null,j=null;return e.onMounted(()=>{E=l("timeline",h),D=l("request",S),A=l("response",C),j=l("timeline:cleared",x),r.value&&a()}),e.onUnmounted(()=>{E?.(),D?.(),A?.(),j?.()}),e.watch(r,M=>{M&&a()}),(M,m)=>(e.openBlock(),e.createElementBlock("div",Ns,[e.createElementVNode("div",bs,[e.createElementVNode("div",Vs,[e.createVNode(e.unref(fe),{size:16,class:"timeline-search__icon"}),e.createElementVNode("input",{ref_key:"searchInputRef",ref:f,type:"text",class:"timeline-search__input input",placeholder:"Search by path or operation...",value:e.unref(t).filter.searchQuery,onInput:$},null,40,Ss),e.unref(t).filter.searchQuery?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"timeline-search__clear btn btn--ghost btn--icon",title:"Clear search",onClick:i},[e.createVNode(e.unref(re),{size:14})])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["timeline-filter-toggle btn btn--secondary",{"timeline-filter-toggle--active":u.value}]),"aria-expanded":s.value,onClick:g},[e.createVNode(e.unref(Oe),{size:16}),m[0]||(m[0]=e.createElementVNode("span",null,"Filters",-1)),z.value>0?(e.openBlock(),e.createElementBlock("span",Bs,e.toDisplayString(z.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value?e.unref(Ae):e.unref(v)),{size:14}))],10,Cs),e.createElementVNode("div",$s,[e.createElementVNode("span",xs,e.toDisplayString(e.unref(t).filteredEntries.length)+" requests ",1),e.unref(t).averageDuration>0?(e.openBlock(),e.createElementBlock("span",ws,"|")):e.createCommentVNode("",!0),e.unref(t).averageDuration>0?(e.openBlock(),e.createElementBlock("span",Ds," avg "+e.toDisplayString(e.unref(t).averageDuration)+"ms ",1)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:"btn btn--secondary btn--icon",title:"Clear timeline",disabled:e.unref(t).entries.length===0,onClick:F},[e.createVNode(e.unref(ye),{size:16})],8,Ts)]),s.value?(e.openBlock(),e.createElementBlock("div",Is,[e.createElementVNode("div",zs,[m[1]||(m[1]=e.createElementVNode("h4",{class:"timeline-filters__title"},"Methods",-1)),e.createElementVNode("div",Ms,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(N,b=>e.createElementVNode("button",{key:b,type:"button",class:e.normalizeClass(["method-badge",`method-badge--${b.toLowerCase()}`,{"method-badge--inactive":!d(b)&&e.unref(t).filter.methods.length>0}]),onClick:w=>c(b)},e.toDisplayString(b),11,qs)),64))])]),e.createElementVNode("div",Fs,[m[2]||(m[2]=e.createElementVNode("h4",{class:"timeline-filters__title"},"Status",-1)),e.createElementVNode("div",Ls,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(_,b=>e.createElementVNode("button",{key:b,type:"button",class:e.normalizeClass(["timeline-filters__status-btn",`timeline-filters__status-btn--${b}`,{"timeline-filters__status-btn--active":q(b)}]),onClick:w=>B(b)},[e.createTextVNode(e.toDisplayString(b)+" ",1),e.createElementVNode("span",As," ("+e.toDisplayString(e.unref(t).statusCounts[b])+") ",1)],10,Rs)),64))])]),e.createElementVNode("div",Os,[m[3]||(m[3]=e.createElementVNode("h4",{class:"timeline-filters__title"},"Type",-1)),e.createElementVNode("div",Ps,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["timeline-filters__status-btn",{"timeline-filters__status-btn--active":e.unref(t).filter.simulatedOnly}]),onClick:k}," Simulated only ",2)])]),u.value?(e.openBlock(),e.createElementBlock("div",Hs,[e.createElementVNode("button",{type:"button",class:"btn btn--ghost",onClick:y},[e.createVNode(e.unref(re),{size:14}),m[4]||(m[4]=e.createTextVNode(" Clear all filters ",-1))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",js,[e.unref(t).isLoading?(e.openBlock(),e.createElementBlock("div",Us,[...m[5]||(m[5]=[e.createElementVNode("div",{class:"timeline-loading__spinner"},null,-1),e.createElementVNode("span",{class:"text-muted"},"Loading timeline...",-1)])])):e.unref(t).error?(e.openBlock(),e.createElementBlock("div",Js,[e.createElementVNode("p",Qs,e.toDisplayString(e.unref(t).error),1),e.createElementVNode("button",{type:"button",class:"btn btn--primary",onClick:a}," Retry ")])):e.unref(t).entries.length===0?(e.openBlock(),e.createElementBlock("div",Ws,[e.createVNode(e.unref(K),{size:48,class:"empty-state__icon"}),m[6]||(m[6]=e.createElementVNode("h3",{class:"empty-state__title"},"No requests yet",-1)),m[7]||(m[7]=e.createElementVNode("p",{class:"empty-state__description"}," API requests will appear here in real-time as they are made. ",-1))])):e.unref(t).filteredEntries.length===0?(e.openBlock(),e.createElementBlock("div",Gs,[e.createVNode(e.unref(fe),{size:48,class:"empty-state__icon"}),m[8]||(m[8]=e.createElementVNode("h3",{class:"empty-state__title"},"No matching requests",-1)),m[9]||(m[9]=e.createElementVNode("p",{class:"empty-state__description"}," Try adjusting your search or filters. ",-1)),u.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"btn btn--secondary",onClick:y}," Clear filters ")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",Ks,[e.createElementVNode("div",Zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).filteredEntries,b=>(e.openBlock(),e.createBlock(Es,{key:b.id,entry:b,"is-selected":e.unref(t).selectedEntryId===b.id,onSelect:R},null,8,["entry","is-selected"]))),128))])]),e.createElementVNode("div",Ys,[e.createVNode(ps,{entry:e.unref(t).selectedEntry},null,8,["entry"])])],64))])]))}}),[["__scopeId","data-v-a5c73778"]])},Symbol.toStringTag,{value:"Module"}));function Le(n,t){return n.length<=t?n:`${n.slice(0,t)}…`}function vs(n){return n==null?"--":typeof n=="string"?Le(n,50):typeof n=="number"||typeof n=="boolean"?String(n):Array.isArray(n)||typeof n=="object"?Le(JSON.stringify(n),50):String(n)}function Ye(n,t){if(!(typeof n!="object"||n===null))return n[t]}function el(n,t,o){const l=Ye(n,t);return typeof l=="string"||typeof l=="number"?l:o}function tl(n,t){if(n.length===0)return[];const o=new Set;for(const r of n)if(typeof r=="object"&&r!==null)for(const s of Object.keys(r))o.add(s);if(o.size===0)return[];const l=Array.from(o);return l.includes(t)?[t,...l.filter(r=>r!==t)]:l}const nl={class:"data-table"},ol={key:0,class:"data-table__empty"},sl={key:1,class:"data-table__container"},ll={class:"data-table__table"},al=["onClick"],rl={class:"data-table__row-num"},il={key:2,class:"data-table__footer"},cl={class:"data-table__info"},dl={class:"data-table__info"},ml=J(e.defineComponent({__name:"DataTable",props:{items:{},idField:{},selectedIndex:{default:-1}},emits:["select"],setup(n,{emit:t}){const o=n,l=t,r=e.computed(()=>tl(o.items,o.idField));function s(N){l("select",N)}function f(N,_){return el(N,o.idField,_)}return(N,_)=>(e.openBlock(),e.createElementBlock("div",nl,[n.items.length===0?(e.openBlock(),e.createElementBlock("div",ol,[e.createVNode(e.unref(ue),{size:32,class:"data-table__empty-icon"}),_[0]||(_[0]=e.createElementVNode("span",null,"No items",-1))])):(e.openBlock(),e.createElementBlock("div",sl,[e.createElementVNode("table",ll,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[_[1]||(_[1]=e.createElementVNode("th",{class:"data-table__row-num"},"#",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,a=>(e.openBlock(),e.createElementBlock("th",{key:a,class:e.normalizeClass(["data-table__header",{"data-table__header--id":a===n.idField}])},e.toDisplayString(a),3))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,(a,h)=>(e.openBlock(),e.createElementBlock("tr",{key:f(a,h),class:e.normalizeClass(["data-table__row",{"data-table__row--selected":h===n.selectedIndex}]),onClick:S=>s(h)},[e.createElementVNode("td",rl,e.toDisplayString(h+1),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,S=>(e.openBlock(),e.createElementBlock("td",{key:S,class:e.normalizeClass(["data-table__cell",{"data-table__cell--id":S===n.idField}])},e.toDisplayString(e.unref(vs)(e.unref(Ye)(a,S))),3))),128))],10,al))),128))])])])),n.items.length>0?(e.openBlock(),e.createElementBlock("div",il,[e.createElementVNode("span",cl,e.toDisplayString(n.items.length)+" items",1),e.createElementVNode("span",dl,e.toDisplayString(r.value.length)+" columns",1)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-dcdce8f7"]]),pl={class:"json-editor"},ul={class:"json-editor__container"},fl=["value","readonly","placeholder"],yl={class:"json-editor__status"},hl={class:"json-editor__status-left"},_l={key:0,class:"json-editor__valid"},gl={key:1,class:"json-editor__error"},kl={class:"json-editor__status-right"},El={class:"json-editor__info"},Nl=J(e.defineComponent({__name:"JsonEditor",props:{modelValue:{},readonly:{type:Boolean,default:!1},placeholder:{default:"Enter JSON data..."},minHeight:{default:200}},emits:["update:modelValue"],setup(n,{expose:t,emit:o}){const l=n,r=o,s=e.ref(""),f=e.ref(null),N=e.computed(()=>f.value===null),_=e.computed(()=>s.value.split(`
2
+ `).length),a=e.computed(()=>Array.from({length:_.value},(i,c)=>c+1)),h=e.ref(null);function S(){try{s.value=JSON.stringify(l.modelValue,null,2),f.value=null}catch{s.value="",f.value="Invalid initial value"}}S(),e.watch(()=>l.modelValue,()=>{try{const i=JSON.parse(s.value);JSON.stringify(i)!==JSON.stringify(l.modelValue)&&S()}catch{S()}});function C(i){const c=i.target;s.value=c.value,x()}function x(){if(s.value.trim()===""){f.value=null,r("update:modelValue",[]);return}try{const i=JSON.parse(s.value);f.value=null,r("update:modelValue",i)}catch(i){if(i instanceof Error){const c=i.message.match(/position (\d+)/);if(c){const d=Number.parseInt(c[1],10),B=s.value.substring(0,d).split(`
3
+ `),q=B.length,k=B[B.length-1].length+1;f.value=`Line ${q}, Column ${k}: ${i.message}`}else f.value=i.message}else f.value="Invalid JSON"}}function F(){try{const i=JSON.parse(s.value);s.value=JSON.stringify(i,null,2),f.value=null,r("update:modelValue",i)}catch{}}function R(i){if(i.key==="Tab"){i.preventDefault();const c=i.target,d=c.selectionStart,B=c.selectionEnd,q=`${s.value.substring(0,d)} ${s.value.substring(B)}`;s.value=q,setTimeout(()=>{c.selectionStart=c.selectionEnd=d+2},0),x()}}function $(i){const c=i.target;h.value&&(h.value.scrollTop=c.scrollTop)}return t({formatJson:F,isValid:N}),(i,c)=>(e.openBlock(),e.createElementBlock("div",pl,[e.createElementVNode("div",ul,[e.createElementVNode("div",{ref_key:"linesRef",ref:h,class:"json-editor__lines","aria-hidden":"true"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,d=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"json-editor__line-number"},e.toDisplayString(d),1))),128))],512),e.createElementVNode("textarea",{value:s.value,readonly:n.readonly,placeholder:n.placeholder,style:e.normalizeStyle({"--json-editor-min-height":`${n.minHeight}px`}),class:"json-editor__textarea",spellcheck:"false",onInput:C,onKeydown:R,onScroll:$},null,44,fl)]),e.createElementVNode("div",yl,[e.createElementVNode("div",hl,[N.value?(e.openBlock(),e.createElementBlock("div",_l,[e.createVNode(e.unref(pe),{size:14}),c[0]||(c[0]=e.createElementVNode("span",null,"Valid JSON",-1))])):f.value?(e.openBlock(),e.createElementBlock("div",gl,[e.createVNode(e.unref(ot),{size:14}),e.createElementVNode("span",null,e.toDisplayString(f.value),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",kl,[e.createElementVNode("span",El,e.toDisplayString(_.value)+" lines",1)])])]))}}),[["__scopeId","data-v-a953e764"]]),ce=e.ref([]),Q=e.reactive({visible:!1,title:"",message:"",confirmText:"Confirm",cancelText:"Cancel",onConfirm:null,onCancel:null}),ae=new Map;let H=null,bl=0;function Vl(){return`toast-${Date.now()}-${bl++}`}function be(n,t,o=3e3){const l=Vl(),r={id:l,type:n,message:t,duration:o,timestamp:Date.now()};if(ce.value.push(r),o>0){const s=setTimeout(()=>{Xe(l),ae.delete(l)},o);ae.set(l,s)}return l}function Xe(n){const t=ae.get(n);t!==void 0&&(clearTimeout(t),ae.delete(n));const o=ce.value.findIndex(l=>l.id===n);o!==-1&&ce.value.splice(o,1)}function Sl(){function n(_,a){return be("success",_,a)}function t(_,a){return be("error",_,a)}function o(_,a){return be("info",_,a)}function l(_,a){return be("warning",_,a)}function r(_,a){return new Promise(h=>{H&&(H(!1),H=null),H=h,Q.visible=!0,Q.title=a?.title||"Confirm",Q.message=_,Q.confirmText=a?.confirmText||"Confirm",Q.cancelText=a?.cancelText||"Cancel",Q.onConfirm=()=>{Q.visible=!1,H&&(H(!0),H=null)},Q.onCancel=()=>{Q.visible=!1,H&&(H(!1),H=null)}})}function s(){Q.visible=!1,H&&(H(!1),H=null)}function f(_){Xe(_)}function N(){for(const _ of ae.values())clearTimeout(_);ae.clear(),ce.value=[]}return{toasts:ce,confirmDialog:Q,success:n,error:t,info:o,warning:l,dismiss:f,clearAll:N,confirm:r,closeConfirm:s}}const Cl={class:"models-page"},Bl={class:"models-sidebar"},$l={class:"models-sidebar__header"},xl={class:"models-sidebar__badge"},wl={key:0,class:"models-sidebar__loading"},Dl={key:1,class:"models-sidebar__list"},Tl=["onClick"],Il={class:"models-sidebar__name"},zl={class:"models-sidebar__count"},Ml={class:"models-sidebar__footer"},ql={class:"models-sidebar__stat"},Fl={class:"font-mono"},Ll={class:"models-content"},Rl={class:"models-toolbar"},Al={class:"models-toolbar__title"},Ol={class:"font-mono"},Pl={class:"text-muted"},Hl={key:0,class:"models-toolbar__badge models-toolbar__badge--warning"},jl={class:"models-toolbar__actions"},Ul=["disabled"],Jl=["disabled"],Ql={key:0,class:"models-error"},Wl={class:"models-panels"},Gl={class:"models-panel"},Kl={class:"models-panel"},Zl={key:1,class:"models-loading-overlay"},Yl={key:1,class:"empty-state"},Xl={key:0,class:"models-error"},vl={class:"modal__body"},ea={class:"modal__footer"},ta=Object.freeze(Object.defineProperty({__proto__:null,default:J(e.defineComponent({__name:"ModelsPage",setup(n){const t=Kt(),{send:o,on:l,connected:r}=le(),{success:s,error:f,confirm:N}=Sl(),_=e.ref(null),a=e.ref(!1),h=e.ref(-1);e.onMounted(async()=>{try{await t.fetchSchemas(),t.schemas.length>0&&!t.selectedSchema&&await t.selectSchemaByName(t.schemas[0].name)}catch(c){t.error||(t.error=c instanceof Error?c.message:"Failed to load schemas")}}),l("store:updated",c=>{const d=c;if(typeof c!="object"||c===null||typeof d.schema!="string"||typeof d.action!="string"||typeof d.count!="number"){console.warn("[ModelsPage] Invalid store:updated payload:",c);return}t.handleStoreUpdate(c),h.value=-1}),l("reseeded",c=>{const d=c;if(typeof c!="object"||c===null||typeof d.success!="boolean"||!Array.isArray(d.schemas)){console.warn("[ModelsPage] Invalid reseeded payload:",c);return}t.handleReseedComplete(c),h.value=-1}),e.watch(()=>t.selectedSchema,async()=>{h.value=-1,_.value&&t.currentItems.length>0&&(await e.nextTick(),_.value?.formatJson())}),e.watch(()=>t.currentItems,(c,d)=>{const B=h.value;if(B<0)return;if(B>=c.length){h.value=-1;return}const q=t.currentSchema?.idField??"id",k=d?.[B],y=c[B];if(k!==y){if(typeof k=="object"&&k!==null&&typeof y=="object"&&y!==null){const g=k[q],u=y[q];if(g!==void 0&&g===u)return}h.value=-1}});async function S(c){t.isDirty&&!await N("You have unsaved changes. Are you sure you want to switch schemas?",{title:"Unsaved Changes",confirmText:"Switch Schema",cancelText:"Cancel"})||await t.selectSchemaByName(c)}async function C(){if(!_.value?.isValid){f("Cannot save invalid JSON. Please fix the errors first.");return}if(await t.saveItems())s("Items saved successfully");else{const d=t.error||"Failed to save items";f(d)}}async function x(){if(!t.isDirty)return;await N("Discard all changes and revert to saved data?",{title:"Discard Changes",confirmText:"Discard",cancelText:"Cancel"})&&(t.discardChanges(),s("Changes discarded"))}async function F(){a.value=!1;try{if(await t.clearSchema())s("Schema cleared successfully");else{const d=t.error||"Failed to clear schema";f(d)}}catch(c){const d=c instanceof Error?c.message:"Failed to clear schema";f(d)}}async function R(){if(!r.value){f("WebSocket not connected. Cannot trigger reseed.");return}await N("This will regenerate all seed data and replace existing items. Continue?",{title:"Reseed All Schemas",confirmText:"Reseed",cancelText:"Cancel"})&&(o({type:"reseed"}),s("Reseed command sent"))}function $(c){t.updateItems(c)}function i(c){h.value=h.value===c?-1:c}return(c,d)=>(e.openBlock(),e.createElementBlock("div",Cl,[e.createElementVNode("aside",Bl,[e.createElementVNode("div",$l,[e.createVNode(e.unref(ue),{size:18}),d[4]||(d[4]=e.createElementVNode("span",null,"Schemas",-1)),e.createElementVNode("span",xl,e.toDisplayString(e.unref(t).schemaCount),1)]),e.unref(t).loading&&e.unref(t).schemas.length===0?(e.openBlock(),e.createElementBlock("div",wl,[...d[5]||(d[5]=[e.createElementVNode("div",{class:"spinner"},null,-1),e.createElementVNode("span",null,"Loading...",-1)])])):(e.openBlock(),e.createElementBlock("div",Dl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).schemas,B=>(e.openBlock(),e.createElementBlock("button",{key:B.name,class:e.normalizeClass(["models-sidebar__item",{"models-sidebar__item--active":e.unref(t).selectedSchema===B.name}]),onClick:q=>S(B.name)},[e.createElementVNode("span",Il,e.toDisplayString(B.name),1),e.createElementVNode("span",zl,e.toDisplayString(B.count),1)],10,Tl))),128))])),e.createElementVNode("div",Ml,[e.createElementVNode("div",ql,[d[6]||(d[6]=e.createElementVNode("span",{class:"text-muted"},"Total Items:",-1)),e.createElementVNode("span",Fl,e.toDisplayString(e.unref(t).totalItems),1)])])]),e.createElementVNode("main",Ll,[e.unref(t).selectedSchema?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Rl,[e.createElementVNode("div",Al,[e.createElementVNode("span",Ol,e.toDisplayString(e.unref(t).selectedSchema),1),e.createElementVNode("span",Pl,"("+e.toDisplayString(e.unref(t).currentItems.length)+" items)",1),e.unref(t).isDirty?(e.openBlock(),e.createElementBlock("span",Hl," Unsaved ")):e.createCommentVNode("",!0)]),e.createElementVNode("div",jl,[e.unref(t).isDirty?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn btn--ghost",title:"Discard changes",onClick:x},[e.createVNode(e.unref(re),{size:16}),d[7]||(d[7]=e.createElementVNode("span",null,"Discard",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{disabled:!e.unref(t).isDirty||e.unref(t).loading,class:"btn btn--primary",title:"Save changes",onClick:C},[e.createVNode(e.unref(it),{size:16}),d[8]||(d[8]=e.createElementVNode("span",null,"Save",-1))],8,Ul),e.createElementVNode("button",{class:"btn btn--danger",title:"Clear all items",onClick:d[0]||(d[0]=B=>a.value=!0)},[e.createVNode(e.unref(ye),{size:16}),d[9]||(d[9]=e.createElementVNode("span",null,"Clear",-1))]),e.createElementVNode("button",{disabled:!e.unref(r),class:"btn btn--secondary",title:"Reseed all schemas with generated data",onClick:R},[e.createVNode(e.unref(rt),{size:16}),d[10]||(d[10]=e.createElementVNode("span",null,"Reseed All",-1))],8,Jl)])]),e.unref(t).error?(e.openBlock(),e.createElementBlock("div",Ql,[e.createElementVNode("span",null,"⚠️ "+e.toDisplayString(e.unref(t).error),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Wl,[e.createElementVNode("div",Gl,[e.createVNode(Nl,{ref_key:"jsonEditorRef",ref:_,"model-value":e.unref(t).currentItems,readonly:e.unref(t).loading,"min-height":400,"onUpdate:modelValue":$},null,8,["model-value","readonly"])]),e.createElementVNode("div",Kl,[e.createVNode(ml,{items:e.unref(t).currentItems,"id-field":e.unref(t).currentSchema?.idField??"id","selected-index":h.value,onSelect:i},null,8,["items","id-field","selected-index"])])]),e.unref(t).loading?(e.openBlock(),e.createElementBlock("div",Zl,[...d[11]||(d[11]=[e.createElementVNode("div",{class:"spinner"},null,-1),e.createElementVNode("span",null,"Loading...",-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",Yl,[e.unref(t).error?(e.openBlock(),e.createElementBlock("div",Xl,[e.createElementVNode("span",null,"⚠️ "+e.toDisplayString(e.unref(t).error),1)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(ue),{size:48,class:"empty-state__icon"}),d[12]||(d[12]=e.createElementVNode("h3",{class:"empty-state__title"},"Select a schema",-1)),d[13]||(d[13]=e.createElementVNode("p",{class:"empty-state__description"}," Choose a schema from the sidebar to view and edit its data. ",-1))],64))]))]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-overlay",onClick:d[3]||(d[3]=B=>a.value=!1)},[e.createElementVNode("div",{class:"modal",onClick:d[2]||(d[2]=e.withModifiers(()=>{},["stop"]))},[d[17]||(d[17]=e.createElementVNode("div",{class:"modal__header"},[e.createElementVNode("h3",null,"Clear Schema Data")],-1)),e.createElementVNode("div",vl,[e.createElementVNode("p",null,[d[14]||(d[14]=e.createTextVNode(" Are you sure you want to clear all items for ",-1)),e.createElementVNode("strong",null,e.toDisplayString(e.unref(t).selectedSchema),1),d[15]||(d[15]=e.createTextVNode("? ",-1))]),d[16]||(d[16]=e.createElementVNode("p",{class:"text-muted"},"This action cannot be undone.",-1))]),e.createElementVNode("div",ea,[e.createElementVNode("button",{class:"btn btn--ghost",onClick:d[1]||(d[1]=B=>a.value=!1)}," Cancel "),e.createElementVNode("button",{class:"btn btn--danger",onClick:F}," Clear Schema ")])])])):e.createCommentVNode("",!0)]))]))}}),[["__scopeId","data-v-62a953d5"]])},Symbol.toStringTag,{value:"Module"})),na={class:"simulator-page"},oa={class:"simulator-form card"},sa={class:"simulator-form__header"},la={class:"simulator-form__body"},aa={key:0,class:"simulator-form__row"},ra=["value"],ia={class:"simulator-form__row"},ca=["value"],da={class:"simulator-presets"},ma=["title","onClick"],pa={class:"simulator-preset__label"},ua=["disabled"],fa={class:"simulator-active"},ya={class:"simulator-active__header"},ha={class:"simulator-active__title"},_a=["disabled"],ga={class:"simulator-active__list"},ka={class:"simulator-simulation__info"},Ea={class:"simulator-simulation__path font-mono"},Na={class:"simulator-simulation__preset"},ba={key:0,class:"text-muted"},Va=["disabled","onClick"],Sa={key:0,class:"empty-state"},Ca=Object.freeze(Object.defineProperty({__proto__:null,default:J(e.defineComponent({__name:"SimulatorPage",setup(n){const t=Zt(),o=Qe(),{send:l,on:r,connected:s}=le(),f=e.ref(""),N=e.ref("GET"),_=e.ref(null),a=e.ref(null),h=["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD"];let S=[];const C=e.ref(new Set),x=e.computed(()=>o.endpoints.map(y=>({key:y.key,label:`${y.method.toUpperCase()} ${y.path}`,method:y.method.toUpperCase(),path:y.path,operationId:y.operationId}))),F=e.computed(()=>{const y=f.value.trim()!=="",g=_.value!==null;return y&&g}),R=e.computed(()=>t.activeSimulations.map(y=>{const g=y.presetId?t.getPreset(y.presetId):null;return{...y,preset:g}})),$=e.computed(()=>t.count);function i(){if(!F.value||!_.value||!t.getPreset(_.value))return;const g=f.value.trim();if(!g.startsWith("/")){t.setError("Path must start with /");return}if(g.length>500){t.setError("Path is too long (max 500 characters)");return}if(!/^\/[\w\-/{}:.]*$/.test(g)){t.setError("Path contains invalid characters");return}const u=`${N.value.toLowerCase()}:${g}`,z=t.createSimulationFromPreset(u,_.value,void 0);z&&(t.addSimulationLocal(z,!0),t.setLoading(!0),l({type:"set:simulation",data:{path:z.path,status:z.status,delay:z.delay,body:z.body}}),f.value="",_.value=null,a.value=null)}function c(y){t.removeSimulationLocal(y,!0),t.setLoading(!0),l({type:"clear:simulation",data:{path:y}})}function d(){if($.value!==0){for(const y of t.activeSimulations)C.value.add(y.path),t.removeSimulationLocal(y.path,!0),l({type:"clear:simulation",data:{path:y.path}});t.setLoading(!0)}}function B(){if(!a.value)return;const y=o.endpoints.find(g=>g.key===a.value);y&&(N.value=y.method.toUpperCase(),f.value=y.path)}function q(){a.value=null}function k(){s.value&&(t.setLoading(!0),l({type:"get:registry"}))}return e.onMounted(()=>{S=[r("simulation:active",y=>{t.setSimulations(y.simulations),t.setLoading(!1)}),r("simulation:added",y=>{t.handleSimulationAdded(y)}),r("simulation:removed",y=>{t.handleSimulationRemoved(y)}),r("simulations:cleared",y=>{t.handleSimulationsCleared(y)}),r("simulation:set",y=>{t.handleSimulationSet(y)}),r("simulation:cleared",y=>{C.value.has(y.path)&&C.value.delete(y.path),t.handleSimulationCleared(y)})],s.value&&k()}),e.onUnmounted(()=>{for(const y of S)y()}),e.watch(s,y=>{y?k():t.setLoading(!1)}),(y,g)=>(e.openBlock(),e.createElementBlock("div",na,[e.createElementVNode("div",oa,[e.createElementVNode("div",sa,[e.createVNode(e.unref(oe),{size:18}),g[3]||(g[3]=e.createElementVNode("span",null,"Add Simulation",-1))]),e.createElementVNode("div",la,[x.value.length>0?(e.openBlock(),e.createElementBlock("div",aa,[g[5]||(g[5]=e.createElementVNode("label",{class:"simulator-form__label"},"Select Endpoint (optional):",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":g[0]||(g[0]=u=>a.value=u),class:"input",onChange:B},[g[4]||(g[4]=e.createElementVNode("option",{value:null},"Manual entry...",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,u=>(e.openBlock(),e.createElementBlock("option",{key:u.key,value:u.key},e.toDisplayString(u.label),9,ra))),128))],544),[[e.vModelSelect,a.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",ia,[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":g[1]||(g[1]=u=>N.value=u),class:"simulator-form__method input",onChange:q},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(h,u=>e.createElementVNode("option",{key:u,value:u},e.toDisplayString(u),9,ca)),64))],544),[[e.vModelSelect,N.value]]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[2]||(g[2]=u=>f.value=u),type:"text",class:"simulator-form__path input",placeholder:"/api/path",onInput:q},null,544),[[e.vModelText,f.value]])]),e.createElementVNode("div",da,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).presets,u=>(e.openBlock(),e.createElementBlock("button",{key:u.id,class:e.normalizeClass(["simulator-preset",{"simulator-preset--selected":_.value===u.id},`simulator-preset--${u.type}`]),title:u.description,onClick:z=>_.value=u.id},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.type==="delay"?e.unref(K):e.unref(xe)),{size:14})),e.createElementVNode("span",pa,e.toDisplayString(u.label),1)],10,ma))),128))]),e.createElementVNode("button",{class:"btn btn--primary",disabled:!F.value||e.unref(t).isLoading,onClick:i},[e.createVNode(e.unref(at),{size:16}),g[6]||(g[6]=e.createElementVNode("span",null,"Add Simulation",-1))],8,ua)])]),e.createElementVNode("div",fa,[e.createElementVNode("div",ya,[e.createElementVNode("span",ha," Active Simulations ("+e.toDisplayString($.value)+") ",1),$.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn btn--ghost",disabled:e.unref(t).isLoading,onClick:d},[e.createVNode(e.unref(ye),{size:14}),g[7]||(g[7]=e.createElementVNode("span",null,"Clear All",-1))],8,_a)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ga,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,u=>(e.openBlock(),e.createElementBlock("div",{key:u.path,class:"simulator-simulation card"},[e.createElementVNode("div",ka,[e.createElementVNode("span",Ea,e.toDisplayString(u.path),1)]),e.createElementVNode("div",Na,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.preset?.type==="delay"?e.unref(K):e.unref(xe)),{size:14,class:e.normalizeClass({"text-warning":u.preset?.type==="delay","text-error":u.preset?.type==="error","text-muted":u.preset?.type==="empty"})},null,8,["class"])),e.createElementVNode("span",null,e.toDisplayString(u.preset?.label||`HTTP ${u.status}`),1),u.delay?(e.openBlock(),e.createElementBlock("span",ba," ("+e.toDisplayString(u.delay)+"ms) ",1)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"btn btn--ghost btn--icon",title:"Remove simulation",disabled:e.unref(t).isLoading,onClick:z=>c(u.path)},[e.createVNode(e.unref(ye),{size:14})],8,Va)]))),128)),$.value===0?(e.openBlock(),e.createElementBlock("div",Sa,[e.createVNode(e.unref(oe),{size:48,class:"empty-state__icon"}),g[8]||(g[8]=e.createElementVNode("h3",{class:"empty-state__title"},"No active simulations",-1)),g[9]||(g[9]=e.createElementVNode("p",{class:"empty-state__description"}," Add a simulation above to test error handling and slow responses. ",-1))])):e.createCommentVNode("",!0)])])]))}}),[["__scopeId","data-v-3076fbb2"]])},Symbol.toStringTag,{value:"Module"}));U.bootstrap=Ze,U.useTheme=en,U.useWebSocket=le,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})}));
4
4
  //# sourceMappingURL=devtools.umd.cjs.map