import{d as i,r as p,u as E,D as j,j as e,E as I,F as b,H as g}from"./index-DRe7Uehz.js";import{F as n,i as C}from"./FormMenuItem-Drov6ZdA.js";import{A as f}from"./AutoExpandingTextArea-CM-5O8_l.js";import{S}from"./FormFooterLayout-DzEn1tAf.js";const v="Main configuration",N="Disk",_="Network",D="GPU",O="Proxy",P="Other",R="Resource limits",M="Security policies",T="Snapshots",A="Migration",F="Boot",B="Cloud init",V="YAML configuration",Y=({active:a,setActive:t,isDisabled:o,formik:r})=>{var u;const x=i.useNotify(),[l,m]=p.useState(!0),{hasMetadataConfiguration:h}=E(),c=o?"Please enter a name before adding custom configuration":void 0,s={active:a,setActive:t,disableReason:c},d=()=>{g("form-navigation","p-bottom-controls")};return p.useEffect(d,[(u=x.notification)==null?void 0:u.message]),j("resize",d),e.jsx("div",{className:"p-side-navigation--accordion form-navigation",children:e.jsx("nav",{"aria-label":"Profile form navigation",children:e.jsxs("ul",{className:"p-side-navigation__list",children:[e.jsx(n,{label:v,...s}),e.jsxs("li",{className:"p-side-navigation__item",children:[e.jsx(i.Button,{type:"button",className:"p-side-navigation__accordion-button","aria-expanded":l?"true":"false",onClick:()=>{o||m(!l)},disabled:o,title:c,children:"Devices"}),e.jsxs("ul",{className:"p-side-navigation__list","aria-expanded":l?"true":"false",children:[e.jsx(n,{label:N,hasError:I(r),...s}),e.jsx(n,{label:_,hasError:b(r),...s}),e.jsx(n,{label:D,...s}),e.jsx(n,{label:O,...s}),h&&e.jsx(n,{label:P,...s})]})]}),e.jsx(n,{label:R,...s}),e.jsx(n,{label:M,...s}),e.jsx(n,{label:T,...s}),e.jsx(n,{label:A,...s}),e.jsx(n,{label:F,...s}),e.jsx(n,{label:B,...s})]})})})},H=a=>({name:a.name,description:a.description}),w=({formik:a,isEdit:t})=>{const o=a.values.name==="default";return e.jsx(S,{children:e.jsx(i.Row,{children:e.jsxs(i.Col,{size:12,children:[e.jsx(i.Input,{id:"name",name:"name",type:"text",label:"Profile name",placeholder:"Enter name",help:t&&!o&&"Click the name in the header to rename the profile",onBlur:a.handleBlur,onChange:a.handleChange,value:a.values.name,error:a.touched.name?a.errors.name:null,required:!0,disabled:t}),e.jsx(f,{id:"description",name:"description",label:"Description",placeholder:"Enter description",onBlur:a.handleBlur,onChange:r=>{t&&C(a),a.handleChange(r)},value:a.values.description})]})})})};export{F as B,B as C,N as D,D as G,v as M,_ as N,P as O,Y as P,R,M as S,V as Y,w as a,T as b,A as c,H as p};
