"use strict";var E=Object.create;var t=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var h=Object.getPrototypeOf;var y=Object.prototype.hasOwnProperty;var m=(o,e)=>t(o,"name",{value:e,configurable:true});var B=(o,e)=>{for(var r in e)t(o,r,{get:e[r],enumerable:true})};var k=(o,e,r,p)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let s of W(e))if(!y.call(o,s)&&s!==r)t(o,s,{get:()=>e[s],enumerable:!(p=S(e,s))||p.enumerable})}return o};var i=(o,e,r)=>(r=o!=null?E(h(o)):{},k(e||!o||!o.__esModule?t(r,"default",{value:o,enumerable:true}):r,o));var g=o=>k(t({},"__esModule",{value:true}),o);var R={};B(R,{default:()=>q});module.exports=g(R);var d=require("react/jsx-runtime");var a=require("mobx-react");var f=require("react");var l=i(require("../../../components/util/ErrorBoundary"));var c=require("../api");var w=i(require("../components/EditWorkspaceForm"));var n=require("../index");var v=i(require("../models/Workspace"));class u extends f.Component{onDelete=()=>{const{workspaceBeingEdited:e}=n.workspaceStore;const{actions:r}=this.props;if(!e)return;r.workspaces.delete({workspace:e})};onSave=e=>{const{workspaceBeingEdited:r}=n.workspaceStore;const{actions:p}=this.props;const s=new v.default({saving:true,...r,...e});p.workspaces.update({workspace:s})};render(){const{workspaceBeingEdited:e}=n.workspaceStore;const{stores:r}=this.props;if(!e)return null;return(0,d.jsx)(l.default,{children:(0,d.jsx)(w.default,{workspace:e,services:r.services.all,onDelete:this.onDelete,onSave:this.onSave,updateWorkspaceRequest:c.updateWorkspaceRequest,deleteWorkspaceRequest:c.deleteWorkspaceRequest})})}}m(u,"EditWorkspaceScreen");var q=(0,a.inject)("stores","actions")((0,a.observer)(u));
