import{k as d,l as h,o as p,j as s,E as l,G as u,y as g,I as D,ei as b,a as m,D as R,g as y,h as A,i as w,dT as f}from"./app-BgLa5dit.js";import{D as S,E as T}from"./LqVj63BJ.chunk.js";import{D as P}from"./BE59vaMU.chunk.js";import"./KIVqng-q.chunk.js";function L(e){var r;const n=d(),t=h(),o=p(f.contentRegions());async function i(a){try{const c=await n(P.createDashboard({name:a.name,description:a.description,target:m.getDashboardTarget({targetType:R.PartnerProfile,slug:e.slug}),learningLevel:b.Any,userType:D.Any,status:g.Draft,contentRegion:a.contentRegion}));t.success("Successfully created the dashboard"),y.trigger({application:w.DASHBOARD_EDITOR,action:A.DashboardEditor.EDIT_DASHBOARD,args:[c.id]})}catch{t.error("Something went wrong when creating the dashboard"),e.closePopup()}}return s.jsx(l,{title:"Create new dashboard",closePopup:e.closePopup,showLoadingSpinner:!o.data,children:s.jsx(u,{initialValues:{name:"",description:""},validationSchema:S,onSubmit:i,children:s.jsx(T,{closePopup:e.closePopup,dashboardWidgets:[],isNew:!0,showRegionField:!0,contentRegions:(r=o.data)==null?void 0:r.data})})})}export{L as NewDashboardView};
//# sourceMappingURL=B--LJ_FX.chunk.js.map
