var c=Object.defineProperty;var d=(a,e,t)=>e in a?c(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var s=(a,e,t)=>(d(a,typeof e!="symbol"?e+"":e,t),t);import{D as l,e as h,f as p,h as f,m as y}from"./workspaceStore.1dfebc80.js";import{A as g}from"./record.a84b6d90.js";import"./vue-router.97d0d8a6.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="d9ccc5db-7131-4bbf-83b1-9a156da27129",a._sentryDebugIdIdentifier="sentry-dbid-d9ccc5db-7131-4bbf-83b1-9a156da27129")}catch{}})();class u{async get(){return await(await fetch("/_editor/api/workspace",{method:"GET",headers:{"Content-Type":"application/json"}})).json()}async update(e,t){return await(await fetch("/_editor/api/workspace",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json()}async create(e){throw new Error("Not implemented")}async openFile(e){await fetch("/_editor/api/workspace/open-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})})}async initFile(e,t){await fetch("/_editor/api/workspace/init-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,type:t})})}async checkFile(e){const t=await fetch(`/_editor/api/workspace/check-file?path=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!t.ok)throw new Error("Failed to check file");return await t.json()}async readFile(e){const t=await fetch(`/_editor/api/workspace/read-file?file=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}});return t.status===404?null:await t.text()}async readTestData(){return await(await fetch("/_editor/api/workspace/read-test-data",{method:"GET",headers:{"Content-Type":"application/json"}})).text()}async writeTestData(e){if(!(await fetch("/_editor/api/workspace/write-test-data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({test_data:e})})).ok)throw new Error("Failed to write test data");return{success:!0}}async deploy(){if(!(await fetch("/_editor/api/workspace/deploy",{method:"POST",headers:{"Content-Type":"application/json"}})).ok)throw new Error("Failed to deploy")}}const r=new u,o=class{constructor(e){s(this,"record");this.record=g.create(r,e)}static async get(){const e=await r.get();return new o(e)}static from(e){return new o(e)}get brandName(){var e;return(e=this.record.get("brand_name"))!=null?e:""}set brandName(e){this.record.set("brand_name",e)}get fontColor(){var e;return(e=this.record.get("font_color"))!=null?e:"#000000"}set fontColor(e){this.record.set("font_color",e)}get logoUrl(){var e;return(e=this.record.get("logo_url"))!=null?e:""}set logoUrl(e){this.record.set("logo_url",e)}get faviconUrl(){var e;return(e=this.record.get("favicon_url"))!=null?e:""}set faviconUrl(e){this.record.set("favicon_url",e)}get mainColor(){var e;return(e=this.record.get("main_color"))!=null?e:l}set mainColor(e){this.record.set("main_color",e)}get fontFamily(){var e;return(e=this.record.get("font_family"))!=null?e:h}set fontFamily(e){this.record.set("font_family",e)}get language(){var e;return(e=this.record.get("language"))!=null?e:p.value}set language(e){this.record.set("language",e)}get theme(){var e;return(e=this.record.get("theme"))!=null?e:f}set theme(e){this.record.set("theme",e)}async save(){return this.record.save()}hasChanges(){return this.record.hasChanges()}static async openFile(e){await r.openFile(e)}static async initFile(e,t){await r.initFile(e,t)}static async checkFile(e){return r.checkFile(e)}async readFile(e){return r.readFile(e)}static async readTestData(){return r.readTestData()}static async writeTestData(e){return r.writeTestData(e)}static async deploy(){return r.deploy()}get sidebar(){var e;return(e=this.record.get("sidebar"))!=null?e:[]}set sidebar(e){this.record.set("sidebar",e)}makeRunnerData(){return{sidebar:this.sidebar,name:this.brandName,fontColor:this.fontColor,brandName:this.brandName,fontFamily:this.fontFamily,logoUrl:y("logo",this.logoUrl,"player"),mainColor:this.mainColor,theme:this.theme,language:this.language}}};let n=o;s(n,"instance");export{n as W};
//# sourceMappingURL=workspaces.95ddd972.js.map
