import{aJ as e,aQ as x,r as h,aS as S}from"./@ui-core-DKdciH1Z.js";import{u as b,t as j,F as y}from"./@zod-DKyD3xVW.js";import{P as v,a as i,b as g}from"./react-resizable-panels.browser-DzY2Iih7.js";import{S as k,A as N,a as _,f as w,C}from"./schema-C55JazwW.js";import{r as m,x as z,y as P}from"./index-D7KLAbvI.js";import{s as T}from"./index-C1wOIU40.js";import{u as F}from"./create-stack-KDiJJSw2.js";import{c as M}from"./@react-router-DaIuhn3X.js";import"./ComponentIcon-BOKrWHiD.js";import"./bar-chart-square-check-Lt3fLSJ-.js";import"./layout-BRN9AeDt.js";import"./transform-Bq7p9csj.js";import"./constants-Dj_C1ZPH.js";import"./common-DAdwvEpX.js";import"./flavor-select-XFQkfujn.js";import"./index-DPr7bdjs.js";import"./configuration-form-DQMoUCqK.js";import"./form-DKk08jkZ.js";import"./check-tR7EFZ1z.js";import"./CodeSnippet-Dwuwo3ZI.js";import"./file-text-BLW8J__B.js";import"./sharedSchema-CilfqDZ1.js";import"./index.es-DovV9WG3.js";import"./@reactflow-CJzATMj6.js";import"./@monaco-editor-CSMpaClf.js";import"./stack-detail-query-IhXZFDdF.js";function Q(){return e.jsxs("div",{className:"flex h-full flex-col justify-between space-y-5",children:[e.jsxs("div",{className:"space-y-5 p-5",children:[e.jsx(k,{}),e.jsx(N,{})]}),e.jsx(_,{cancelRoute:m.stacks.create.index,submitLabel:"Register Stack"})]})}function R(){const{toast:a}=z(),s=M(),o=x(),r=F({onSuccess:async()=>{o.invalidateQueries({queryKey:T.all}),s(m.stacks.overview)},onError:t=>{a({status:"error",emphasis:"subtle",icon:e.jsx(P,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:t.message,rounded:!0})}});function c(t){const d=Object.entries(t.components).reduce((l,[f,n])=>(n&&(l[f]=[n.id]),l),{}),p={name:t.stackName,components:d};r.mutate({payload:p})}const u=b({resolver:j(w()),defaultValues:{components:{alerter:null,orchestrator:{},annotator:null,artifact_store:{},container_registry:null,data_validator:null,experiment_tracker:null,feature_store:null,model_registry:null,image_builder:null,model_deployer:null,step_operator:null,deployer:null,log_store:null},stackName:""}});return{createManualStack:c,form:u}}function ne(){const[a,s]=h.useState(""),{createManualStack:o,form:r}=R();return e.jsx(y,{...r,children:e.jsx(S,{value:a,onValueChange:s,className:"flex-1 overflow-hidden",children:e.jsx("form",{onSubmit:r.handleSubmit(o),className:"h-full",children:e.jsxs(v,{direction:"horizontal",className:"h-full !flex-col md:!flex-row",children:[e.jsx(i,{className:"!overflow-y-auto",defaultSize:50,minSize:33,children:e.jsx(C,{})}),e.jsx(g,{className:"w-[1px] bg-theme-border-moderate transition-colors duration-200 data-[resize-handle-state=drag]:bg-theme-border-bold data-[resize-handle-state=hover]:bg-theme-border-bold"}),e.jsx(i,{className:"!overflow-y-auto bg-theme-surface-primary",defaultSize:50,minSize:33,children:e.jsx(Q,{})})]})})})})}export{ne as default};
