var i=Object.defineProperty;var r=(s,t,e)=>t in s?i(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var a=(s,t,e)=>(r(s,typeof t!="symbol"?t+"":t,e),e);class h{async get(){return await(await fetch("/_editor/api/workspace",{method:"GET",headers:{"Content-Type":"application/json"}})).json()}async update(t){return await(await fetch("/_editor/api/workspace",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json()}}const n=new h;class o{constructor(t){a(this,"initialState");a(this,"changes");this.initialState=t,this.changes={}}static async get(){const t=await n.get();return new o(t)}get brandName(){return this.get("brand_name")}set brandName(t){this.set("brand_name",t)}get fontColor(){var t;return(t=this.get("font_color"))!=null?t:"#000000"}set fontColor(t){this.set("font_color",t)}get logoUrl(){return this.get("logo_url")}set logoUrl(t){this.set("logo_url",t)}get mainColor(){var t;return(t=this.get("main_color"))!=null?t:"#000000"}set mainColor(t){this.set("main_color",t)}get fontFamily(){return this.get("font_family")}set fontFamily(t){this.set("font_family",t)}get theme(){var t;return(t=this.get("theme"))!=null?t:"#ffffff"}set theme(t){this.set("theme",t)}get(t){var e;return(e=this.changes[t])!=null?e:this.initialState[t]}set(t,e){this.changes[t]=e}async save(){Object.keys(this.changes).length!==0&&(this.initialState=await n.update(this.changes),this.changes={})}hasChanges(){return Object.keys(this.changes).length>0}}export{o as W};
//# sourceMappingURL=workspaces.252c90d6.js.map
