import{d as y,r as h,o as w,L as v,b as d,c as s,w as e,aB as a,u as t,b_ as u,f as n,eB as m,cC as k}from"./outputWidgets.d6334d0e.js";import{A as C,a as g}from"./Text.2f6a30da.js";import{A as p}from"./index.6da051f8.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[r]="527e569d-aa98-4e42-b616-f1596e63a8b1",o._sentryDebugIdIdentifier="sentry-dbid-527e569d-aa98-4e42-b616-f1596e63a8b1")}catch{}})();const I=y({__name:"Debugger",setup(o){async function r(){const i=await fetch("/_editor/api/debugger",{method:"GET"});if(!i.ok)throw new Error("Failed to check debugger connection");return await i.json()}async function f(){await fetch("/_editor/api/debugger/vscode-launch",{method:"POST"}),_()}const c=h({connected:!1,port:0,is_launch_json_configured:!1});async function _(){c.value=await r()}let l=null;return w(()=>{l=setInterval(_,1e3)}),v(()=>{l&&clearInterval(l)}),(i,b)=>c.value.connected?(d(),s(t(u),{key:0,disabled:""},{default:e(()=>[a("VSCode connected")]),_:1})):(d(),s(t(k),{key:1},{content:e(()=>[n(t(p),{direction:"vertical"},{default:e(()=>[n(t(C),null,{default:e(()=>[a(" Abstra allows you to connect to your VSCode debugger ")]),_:1}),n(t(g),null,{default:e(()=>[a(" You're not connected ")]),_:1}),c.value.is_launch_json_configured?(d(),s(t(p),{key:0,direction:"vertical"},{default:e(()=>[n(t(g),{style:{"font-size":"24px"},copyable:"",code:""},{default:e(()=>[a(m(c.value.port),1)]),_:1}),n(t(u),{href:"https://docs.abstra.io/debug/vscode",target:"_blank"},{default:e(()=>[a(" Learn how to connect to vscode ")]),_:1})]),_:1})):(d(),s(t(u),{key:1,onClick:f},{default:e(()=>[a("Configure launch.json")]),_:1}))]),_:1})]),default:e(()=>[n(t(u),null,{default:e(()=>[a("Connect to VSCode")]),_:1})]),_:1}))}});export{I as _};
//# sourceMappingURL=Debugger.vue_vue_type_script_setup_true_lang.5b576fab.js.map
