import{d as r,b as c,c as i,w as d,b0 as p,u,cb as f}from"./registerWidgets.2031932d.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="1540df1f-a6c4-41f6-aa9c-2b640c22db4b",n._sentryDebugIdIdentifier="sentry-dbid-1540df1f-a6c4-41f6-aa9c-2b640c22db4b")}catch{}})();class l{async get(){return(await fetch("/_editor/api/login")).json()}async create(e){return(await fetch("/_editor/api/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e})})).json()}async delete(){await fetch("/_editor/api/login",{method:"DELETE"})}}const s=new l;class a{constructor(e,t){this.projectId=e,this.authorId=t}static async get(){const e=await s.get();return e.logged?new a(e.project_id,e.author_id):null}static async create(e){const t=await s.create(e);if(!t.logged)throw new Error("Failed to login");return new a(t.project_id,t.author_id)}async delete(){return s.delete()}}const h=r({__name:"DocsButton",props:{path:{}},setup(n){return(e,t)=>{var o;return c(),i(u(f),{class:"docs-button",href:`https://docs.abstra.io/${(o=e.path)!=null?o:""}`,target:"_blank"},{default:d(()=>[p(" Docs ")]),_:1},8,["href"])}}});export{a as L,h as _};
//# sourceMappingURL=DocsButton.vue_vue_type_script_setup_true_lang.bf51a812.js.map
