import{d as t,r as p,G as E,j as e,P as j,Q as b,T as I}from"./index-DET0E_3l.js";import{F as n}from"./FormMenuItem-CafR0V9n.js";import{A as S}from"./AutoExpandingTextArea-C0eJ1NqN.js";import{S as g}from"./formFields-D4E6x_f1.js";import{k as C,S as v}from"./SshKeyForm-CCywfCqi.js";const f="Main configuration",N="Disk",_="Network",O="GPU",P="Proxy",R="Other",D="Resource limits",M="Security policies",T="Snapshots",A="Migration",F="Boot",y="Cloud init",V="YAML configuration",Y=({active:a,setActive:o,isDisabled:i,formik:r})=>{var u;const x=t.useNotify(),[l,h]=p.useState(!0),{hasMetadataConfiguration:m}=E(),c=i?"Please enter a name before adding custom configuration":void 0,s={active:a,setActive:o,disableReason:c},d=()=>{I("form-navigation","p-bottom-controls")};return p.useEffect(d,[(u=x.notification)==null?void 0:u.message]),t.useListener(window,d,"resize",!0),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:f,...s}),e.jsxs("li",{className:"p-side-navigation__item",children:[e.jsx(t.Button,{type:"button",className:"p-side-navigation__accordion-button","aria-expanded":l?"true":"false",onClick:()=>{i||h(!l)},disabled:i,title:c,children:"Devices"}),e.jsxs("ul",{className:"p-side-navigation__list","aria-expanded":l?"true":"false",children:[e.jsx(n,{label:N,hasError:j(r),...s}),e.jsx(n,{label:_,hasError:b(r),...s}),e.jsx(n,{label:O,...s}),e.jsx(n,{label:P,...s}),m&&e.jsx(n,{label:R,...s})]})]}),e.jsx(n,{label:D,...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:y,...s})]})})})},z=a=>({name:a.name,description:a.description}),H=({formik:a,isEdit:o})=>{const i=a.values.name==="default";return e.jsx(g,{children:e.jsx(t.Row,{children:e.jsxs(t.Col,{size:12,children:[e.jsx(t.Input,{id:"name",name:"name",type:"text",label:"Profile name",placeholder:"Enter name",help:o&&!i&&"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:o}),e.jsx(S,{id:"description",name:"description",label:"Description",placeholder:"Enter description",onBlur:a.handleBlur,onChange:r=>{o&&C(a),a.handleChange(r)},value:a.values.description,disabled:!!a.values.editRestriction,title:a.values.editRestriction}),e.jsx(v,{formik:a})]})})})};export{F as B,y as C,N as D,O as G,f as M,_ as N,R as O,Y as P,D as R,M as S,V as Y,H as a,P as b,T as c,A as d,z as p};
