@ansible/ansible-ui-framework 2.4.2580 → 2.4.2581
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +1 -1
- package/index.umd.cjs +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
@@ -44615,7 +44615,7 @@ function B1e(e) {
|
|
44615
44615
|
},
|
44616
44616
|
{ path: "*", element: /* @__PURE__ */ m.jsx(x0e, {}) }
|
44617
44617
|
],
|
44618
|
-
[n, t, e.banner, e.basename]
|
44618
|
+
[n, t, e.banner, e.basename, e.contextSwitcher]
|
44619
44619
|
), [i, a] = Sbe();
|
44620
44620
|
return be(() => a(r), [r, a]), /* @__PURE__ */ m.jsx(RD, { children: r.map(qA) });
|
44621
44621
|
}
|
package/index.umd.cjs
CHANGED
@@ -495,7 +495,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
495
495
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D3(e,t){if(e){if(typeof e=="string")return Cv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cv(e,t)}}function Cv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function N0e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function W0e(e){if(Array.isArray(e))return e}function P3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ct(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P3(Object(n),!0).forEach(function(r){wv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kh(e,t){if(e==null)return{};var n=R0e(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function R0e(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Ev=v.forwardRef(function(e,t){var n=e.children,r=kh(e,A0e),i=M3(r),o=i.open,a=kh(i,D0e);return v.useImperativeHandle(t,function(){return{open:o}},[o]),v.createElement(v.Fragment,null,n(Ct(Ct({},a),{},{open:o})))});Ev.displayName="Dropzone";var j3={disabled:!1,getFilesFromEvent:Jge,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};Ev.defaultProps=j3,Ev.propTypes={children:ut.func,accept:ut.objectOf(ut.arrayOf(ut.string)),multiple:ut.bool,preventDropOnDocument:ut.bool,noClick:ut.bool,noKeyboard:ut.bool,noDrag:ut.bool,noDragEventsBubbling:ut.bool,minSize:ut.number,maxSize:ut.number,maxFiles:ut.number,disabled:ut.bool,getFilesFromEvent:ut.func,onFileDialogCancel:ut.func,onFileDialogOpen:ut.func,useFsAccessApi:ut.bool,autoFocus:ut.bool,onDragEnter:ut.func,onDragLeave:ut.func,onDragOver:ut.func,onDrop:ut.func,onDropAccepted:ut.func,onDropRejected:ut.func,onError:ut.func,validator:ut.func};var Ov={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function M3(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Ct(Ct({},j3),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,c=t.onDragEnter,u=t.onDragLeave,d=t.onDragOver,f=t.onDrop,h=t.onDropAccepted,m=t.onDropRejected,p=t.onFileDialogCancel,y=t.onFileDialogOpen,b=t.useFsAccessApi,x=t.autoFocus,S=t.preventDropOnDocument,C=t.noClick,_=t.noKeyboard,w=t.noDrag,k=t.noDragEventsBubbling,A=t.onError,j=t.validator,I=v.useMemo(function(){return O0e(n)},[n]),T=v.useMemo(function(){return E0e(n)},[n]),P=v.useMemo(function(){return typeof y=="function"?y:I3},[y]),D=v.useMemo(function(){return typeof p=="function"?p:I3},[p]),M=v.useRef(null),$=v.useRef(null),R=v.useReducer(B0e,Ov),W=Sv(R,2),U=W[0],z=W[1],N=U.isFocused,H=U.isFileDialogActive,X=v.useRef(typeof window<"u"&&window.isSecureContext&&b&&w0e()),J=function(){!X.current&&H&&setTimeout(function(){if($.current){var ce=$.current.files;ce.length||(z({type:"closeDialog"}),D())}},300)};v.useEffect(function(){return window.addEventListener("focus",J,!1),function(){window.removeEventListener("focus",J,!1)}},[$,H,D,X]);var te=v.useRef([]),Q=function(ce){M.current&&M.current.contains(ce.target)||(ce.preventDefault(),te.current=[])};v.useEffect(function(){return S&&(document.addEventListener("dragover",k3,!1),document.addEventListener("drop",Q,!1)),function(){S&&(document.removeEventListener("dragover",k3),document.removeEventListener("drop",Q))}},[M,S]),v.useEffect(function(){return!r&&x&&M.current&&M.current.focus(),function(){}},[M,x,r]);var ie=v.useCallback(function(Y){A?A(Y):console.error(Y)},[A]),ue=v.useCallback(function(Y){Y.preventDefault(),Y.persist(),G(Y),te.current=[].concat(M0e(te.current),[Y.target]),Oh(Y)&&Promise.resolve(i(Y)).then(function(ce){if(!(Eh(Y)&&!k)){var be=ce.length,xe=be>0&&x0e({files:ce,accept:I,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:j}),We=be>0&&!xe;z({isDragAccept:xe,isDragReject:We,isDragActive:!0,type:"setDraggedFiles"}),c&&c(Y)}}).catch(function(ce){return ie(ce)})},[i,c,ie,k,I,a,o,s,l,j]),he=v.useCallback(function(Y){Y.preventDefault(),Y.persist(),G(Y);var ce=Oh(Y);if(ce&&Y.dataTransfer)try{Y.dataTransfer.dropEffect="copy"}catch{}return ce&&d&&d(Y),!1},[d,k]),Z=v.useCallback(function(Y){Y.preventDefault(),Y.persist(),G(Y);var ce=te.current.filter(function(xe){return M.current&&M.current.contains(xe)}),be=ce.indexOf(Y.target);be!==-1&&ce.splice(be,1),te.current=ce,!(ce.length>0)&&(z({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Oh(Y)&&u&&u(Y))},[M,u,k]),re=v.useCallback(function(Y,ce){var be=[],xe=[];Y.forEach(function(We){var Ve=E3(We,I),rt=Sv(Ve,2),wt=rt[0],jt=rt[1],Et=O3(We,a,o),Be=Sv(Et,2),Me=Be[0],mt=Be[1],Vt=j?j(We):null;if(wt&&Me&&!Vt)be.push(We);else{var Ot=[jt,mt];Vt&&(Ot=Ot.concat(Vt)),xe.push({file:We,errors:Ot.filter(function(Bn){return Bn})})}}),(!s&&be.length>1||s&&l>=1&&be.length>l)&&(be.forEach(function(We){xe.push({file:We,errors:[b0e]})}),be.splice(0)),z({acceptedFiles:be,fileRejections:xe,type:"setFiles"}),f&&f(be,xe,ce),xe.length>0&&m&&m(xe,ce),be.length>0&&h&&h(be,ce)},[z,s,I,a,o,l,f,h,m,j]),pe=v.useCallback(function(Y){Y.preventDefault(),Y.persist(),G(Y),te.current=[],Oh(Y)&&Promise.resolve(i(Y)).then(function(ce){Eh(Y)&&!k||re(ce,Y)}).catch(function(ce){return ie(ce)}),z({type:"reset"})},[i,re,ie,k]),B=v.useCallback(function(){if(X.current){z({type:"openDialog"}),P();var Y={multiple:s,types:T};window.showOpenFilePicker(Y).then(function(ce){return i(ce)}).then(function(ce){re(ce,null),z({type:"closeDialog"})}).catch(function(ce){k0e(ce)?(D(ce),z({type:"closeDialog"})):T0e(ce)?(X.current=!1,$.current?($.current.value=null,$.current.click()):ie(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ie(ce)});return}$.current&&(z({type:"openDialog"}),P(),$.current.value=null,$.current.click())},[z,P,D,b,re,ie,T,s]),Ae=v.useCallback(function(Y){!M.current||!M.current.isEqualNode(Y.target)||(Y.key===" "||Y.key==="Enter"||Y.keyCode===32||Y.keyCode===13)&&(Y.preventDefault(),B())},[M,B]),ke=v.useCallback(function(){z({type:"focus"})},[]),Ge=v.useCallback(function(){z({type:"blur"})},[]),Le=v.useCallback(function(){C||(C0e()?setTimeout(B,0):B())},[C,B]),st=function(ce){return r?null:ce},L=function(ce){return _?null:st(ce)},q=function(ce){return w?null:st(ce)},G=function(ce){k&&ce.stopPropagation()},de=v.useMemo(function(){return function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ce=Y.refKey,be=ce===void 0?"ref":ce,xe=Y.role,We=Y.onKeyDown,Ve=Y.onFocus,rt=Y.onBlur,wt=Y.onClick,jt=Y.onDragEnter,Et=Y.onDragOver,Be=Y.onDragLeave,Me=Y.onDrop,mt=kh(Y,P0e);return Ct(Ct(wv({onKeyDown:L(ui(We,Ae)),onFocus:L(ui(Ve,ke)),onBlur:L(ui(rt,Ge)),onClick:st(ui(wt,Le)),onDragEnter:q(ui(jt,ue)),onDragOver:q(ui(Et,he)),onDragLeave:q(ui(Be,Z)),onDrop:q(ui(Me,pe)),role:typeof xe=="string"&&xe!==""?xe:"presentation"},be,M),!r&&!_?{tabIndex:0}:{}),mt)}},[M,Ae,ke,Ge,Le,ue,he,Z,pe,_,w,r]),fe=v.useCallback(function(Y){Y.stopPropagation()},[]),oe=v.useMemo(function(){return function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ce=Y.refKey,be=ce===void 0?"ref":ce,xe=Y.onChange,We=Y.onClick,Ve=kh(Y,j0e),rt=wv({accept:I,multiple:s,type:"file",style:{display:"none"},onChange:st(ui(xe,pe)),onClick:st(ui(We,fe)),tabIndex:-1},be,$);return Ct(Ct({},rt),Ve)}},[$,n,s,pe,r]);return Ct(Ct({},U),{},{isFocused:N&&!r,getRootProps:de,getInputProps:oe,rootRef:M,inputRef:$,open:st(B)})}function B0e(e,t){switch(t.type){case"focus":return Ct(Ct({},e),{},{isFocused:!0});case"blur":return Ct(Ct({},e),{},{isFocused:!1});case"openDialog":return Ct(Ct({},Ov),{},{isFileDialogActive:!0});case"closeDialog":return Ct(Ct({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Ct(Ct({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Ct(Ct({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Ct({},Ov);default:return e}}function I3(){}function z0e(e){const{t}=$e(),n=$u(),{onDrop:r}=e,i=v.useCallback(s=>{if(!s||s.length===0)return;const l=s[0],c=new FileReader;c.onload=()=>{const u=c.result;if(typeof u=="string"){const d={variant:"success",title:t("File uploaded"),timeout:!0};n.addAlert(d),r(u)}},c.onerror=()=>{const u={variant:"danger",title:t("Failed to upload file"),children:t("Unable to upload")};n.addAlert(u)},c.readAsText(l)},[t,n,r]),{getRootProps:o,getInputProps:a}=M3({onDrop:i,noClick:!0,accept:e.accept??{"application/json":[".json"],"text/yaml":[".yaml",".yml"]}});return g.jsxs("div",{id:"code-editor-dropzone",...o({disabled:!0}),style:{width:"100%",height:"100%"},children:[g.jsx("input",{id:"code-editor-dropzone-input",...a(),ref:e.inputRef}),e.children]})}function V0e(e){return g.jsx(O.Icon,{size:e.size??"md",children:g.jsx(ve.AngleDownIcon,{"data-cy":"expandable",style:{transform:e.isExpanded?"rotate(0deg)":e.direction==="left"?"rotate(90deg)":"rotate(-90deg)",transition:"transform 0.2s",alignSelf:"center"},onClick:()=>e.setExpanded(!e.isExpanded),"aria-label":e.isExpanded?Wc("Collapse"):Wc("Expand")})})}function U0e(e,t,n="txt"){const r=new Blob(t.split("/n"),{type:"text/plain"}),i=document.createElement("a");i.href=URL.createObjectURL(r),i.download=e+"."+n,document.body.appendChild(i),i.click(),document.body.removeChild(i)}function Kc(e){const{children:t,helperText:n,helperTextInvalid:r,isRequired:i,labelHelp:o,labelHelpTitle:a,label:s}=e;return g.jsxs(O.FormGroup,{id:`${e.fieldId}-form-group`,fieldId:e.fieldId,label:g.jsxs(g.Fragment,{children:[e.icon,s]}),labelIcon:o?g.jsx(Mu,{title:a,help:o}):void 0,labelInfo:e.additionalControls,isRequired:i,"data-cy":`${e.fieldId}-form-group`,children:[t,(n||r)&&g.jsx(O.FormHelperText,{children:g.jsx(O.HelperText,{children:g.jsx(O.HelperTextItem,{variant:r?"error":void 0,children:r||n})})})]})}function H0e(e){const{t}=$e(),{name:n,format:r,disableCopy:i,disableUpload:o,disableDownload:a,disableExpand:s,validate:l,isArray:c}=e,u=_i(e),{formState:{isSubmitting:d,isValidating:f},setError:h,getValues:m,clearErrors:p,control:y}=oi(),x=Xo().dataEditorFormat??"yaml",[S,C]=v.useState(x),[_,w]=v.useState(!e.defaultCollapsed),[k,A]=v.useState(()=>{const J=m(n);return typeof J=="string"?J:di(J,x)}),j=$u(),{writeToClipboard:I}=P1(),T=v.useCallback(()=>I(di(Ki(m(n),c),S)),[m,c,S,n,I]),P=v.useCallback(J=>{A(di(Ki(J,c),S))},[c,S]),D=v.useRef(null),M=v.useCallback(()=>{var J;return(J=D.current)==null?void 0:J.click()},[]),$=v.useCallback(()=>{const J=n||"data",te=S==="json"?"json":"yaml";U0e(J,di(Ki(m(n),c),S),te),j.addAlert({variant:"success",title:t("File downloaded"),timeout:!0})},[j,m,c,S,n,t]);v.useLayoutEffect(()=>{const J=di(Ki(m(n),c),S);A(J)},[m,c,S,n]);const[R,W]=v.useState(!1),U=uk({name:n});v.useEffect(()=>{R||A(di(Ki(U,c),S))},[R,U,c,S]);const{setValue:z,formState:{defaultValues:N}}=oi(),H=Rc(e.label,e.isRequired),X=Vs(N,e.name);return g.jsx(Ws,{name:n,control:y,shouldUnregister:!0,render:({field:{value:J,name:te,onChange:Q},fieldState:{error:ie}})=>{var he;function ue(Z){try{const re=Ki(Z,c);switch(r){case"object":Q(re);return;default:Q(di(re,r));break}p(te)}catch(re){re instanceof Error&&h(te,{message:re.message})}}return g.jsxs(Kc,{fieldId:u,icon:!s&&g.jsx(V0e,{isExpanded:_,setExpanded:w}),label:e.label,labelHelpTitle:e.labelHelpTitle??e.label,labelHelp:e.labelHelp,additionalControls:g.jsx(L3,{handleCopy:!i&&T,handleUpload:!o&&M,handleDownload:!a&&$,language:S,setLanguage:C,children:e.additionalControls}),helperText:e.helperText,helperTextInvalid:!(l&&f)&&((he=ie==null?void 0:ie.message)==null?void 0:he.split(`
|
496
496
|
`)),isRequired:e.isRequired,children:[_&&g.jsxs("div",{style:{display:"flex"},children:[g.jsx(z0e,{onDrop:P,isDisabled:d||e.isReadOnly,inputRef:D,children:g.jsx(Nge,{"data-cy":u,id:u,name:te,language:S,value:k,onChange:ue,setError:Z=>{Z?h(te,{message:Z}):p(te)},isReadOnly:e.isReadOnly||d,className:e.isReadOnly?"pf-v5-c-form-control pf-m-disabled":"pf-v5-c-form-control",onFocus:()=>W(!0),onBlur:()=>W(!1)})}),g.jsx(Kr,{actions:[{label:t("Undo changes"),type:ot.Button,selection:Ye.None,onClick:()=>{z(e.name,X),A(""),setTimeout(()=>{A(di(Ki(X,c),S))},0)},isHidden:()=>!e.enableUndo||Uk(J,X)},{label:t("Reset to default"),type:ot.Button,selection:Ye.None,onClick:()=>{z(e.name,e.defaultValue),A(""),setTimeout(()=>{A(di(Ki(e.defaultValue,c),S))},0)},isHidden:()=>!e.enableReset||Uk(J,e.defaultValue)}],position:"right"})]}),!_&&g.jsx("div",{className:"pf-v5-c-form-control"})]})},rules:{required:H,validate:e.validate}})}function $3(e){const{t}=$e(),{handleCopy:n,handleDownload:r,handleUpload:i}=e;return!n&&!r&&!i?g.jsx(g.Fragment,{}):g.jsxs(O.Flex,{spaceItems:{default:"spaceItemsMd"},children:[n&&g.jsx(O.FlexItem,{children:g.jsx(ju,{id:"copy-button","data-cy":"copy-button","aria-label":t("Copy to clipboard"),type:"button",onClick:n,children:g.jsx(O.Icon,{size:"md",children:g.jsx(ve.CopyIcon,{})})})}),i&&g.jsx(O.FlexItem,{children:g.jsx(ju,{id:"upload-button","data-cy":"upload-button","aria-label":t("Upload from file"),type:"button",onClick:i,children:g.jsx(O.Icon,{size:"md",children:g.jsx(ve.UploadIcon,{})})})}),r&&g.jsx(O.FlexItem,{children:g.jsx(ju,{id:"download-button","data-cy":"download-button","aria-label":t("Download file"),type:"button",onClick:r,children:g.jsx(O.Icon,{size:"md",children:g.jsx(ve.DownloadIcon,{})})})})]})}function L3(e){const{t}=$e(),{handleCopy:n,handleDownload:r,handleUpload:i,language:o,setLanguage:a}=e;return g.jsxs(O.Flex,{spaceItems:{default:"spaceItemsLg"},children:[g.jsx(O.FlexItem,{children:e.children}),g.jsx($3,{handleCopy:n,handleDownload:r,handleUpload:i}),g.jsx(O.FlexItem,{align:{default:"alignRight"},children:g.jsxs(O.ToggleGroup,{isCompact:!0,children:[g.jsx(O.ToggleGroupItem,{id:"toggle-yaml","data-cy":"toggle-yaml","aria-label":t("Toggle to YAML"),isSelected:o==="yaml",text:"YAML",type:"button",onChange:()=>a("yaml")}),g.jsx(O.ToggleGroupItem,{id:"toggle-json","data-cy":"toggle-json","aria-label":t("Toggle to JSON"),isSelected:o==="json",text:"JSON",type:"button",onChange:()=>a("json")})]})})]})}function Ki(e,t){if(e==null)return t?[]:{};if(typeof e=="string")try{e=JSON.parse(e)}catch{try{e=ZT.load(e)}catch(n){return n instanceof Error||n instanceof ov?new Error(n.message):{}}}return t?Array.isArray(e)?e:[]:Array.isArray(e)?{}:e}function di(e,t){if(e==null)return"";if(e instanceof Error)return e.message;switch(t){case"json":return JSON.stringify(e,null,2);case"yaml":try{const n=ZT.dump(e).trimEnd();switch(n){case"null":case"{}":case"[]":return"";default:return n}}catch(n){return n instanceof Error||n instanceof ov?n.message:""}default:return""}}function q0e(e){const{name:t,label:n,labelHelpTitle:r,labelHelp:i,additionalControls:o,placeholderText:a,options:s,footer:l,helperText:c,isDisabled:u,isReadOnly:d,isRequired:f,validate:h,fieldNameToResetOnFieldChange:m}=e,p=_i(e),{t:y}=$e(),{control:b,setValue:x,formState:{isSubmitting:S,isValidating:C,defaultValues:_},resetField:w}=oi(),[k,A]=v.useState(!1),j=v.useCallback(()=>A(!k),[k]),[I]=It(),T=Rc(e.label,e.isRequired),P=Vs(_,e.name);return g.jsx(Ws,{name:t,control:b,defaultValue:e.defaultValue,shouldUnregister:!0,render:({field:{onChange:D,value:M},fieldState:{error:$}})=>{M===""&&s.length===1&&f&&D(s[0].value);const R=(z,N)=>{var X;const H=(X=s.find(J=>J.label===N.toString()))==null?void 0:X.value;D(H),m&&w(m),e.onChange&&e.onChange(H),A(!1)},W=$!=null&&$.message?h&&C?I.validating:$==null?void 0:$.message:void 0,U=s.find(z=>z.value===M);return g.jsx(Kc,{fieldId:p,label:n,labelHelpTitle:r??n,labelHelp:i,additionalControls:o,helperText:c,helperTextInvalid:W,isRequired:f,children:g.jsxs("div",{style:{display:"flex"},children:[g.jsx(Lo,{id:p,itemID:p,placeholderText:a,variant:"single","aria-describedby":`${p}-form-group`,selections:U==null?void 0:U.label,onSelect:R,isOpen:k,onToggle:j,onClear:f?void 0:()=>{D(null),A(!1)},maxHeight:280,validated:W?"error":void 0,isDisabled:u||d||S,hasPlaceholderStyle:!0,footer:l,ouiaId:"menu-select","data-cy":p,children:s.map(z=>{const N=Yr(z);return g.jsx(Hr,{id:N,value:z.label,label:z.label,description:z.description,"data-cy":N,children:z.label},z.label)})}),g.jsx(Kr,{actions:[{label:y("Undo changes"),type:ot.Button,selection:Ye.None,onClick:()=>{x(e.name,P)},isHidden:()=>!e.enableUndo||M===P},{label:y("Reset to default"),type:ot.Button,selection:Ye.None,onClick:()=>{x(e.name,e.defaultValue)},isHidden:()=>!e.enableReset||M===e.defaultValue}],variant:O.ButtonVariant.control,position:"right"})]})})},rules:{required:T,validate:h}})}function G0e(e){const{name:t,helperText:n,validate:r,additionalControls:i,label:o,labelHelp:a,labelHelpTitle:s,labelOn:l,labelOff:c}=e,{control:u,formState:{isSubmitting:d,isValidating:f}}=oi(),h=_i(e);return g.jsx(Ws,{name:t,control:u,shouldUnregister:!0,render:({field:{onChange:m,value:p},fieldState:{error:y}})=>{const b=r&&f||y==null?void 0:y.message;return g.jsx(Kc,{fieldId:h,"data-cy":h+"-form-group",label:o,labelHelpTitle:s??o,labelHelp:a,helperText:n,helperTextInvalid:b,additionalControls:i,children:g.jsx(O.Switch,{"data-cy":h+"-toggle","aria-label":o,isChecked:p,onChange:x=>m(x),isDisabled:d,label:l,labelOff:c})})}})}function Y0e(e){const{type:t,name:n,label:r,labelHelpTitle:i,labelHelp:o,additionalControls:a,placeholder:s,button:l,helperText:c,isDisabled:u,isReadOnly:d,isRequired:f,validate:h,minLength:m,maxLength:p,min:y,max:b,pattern:x,selectTitle:S,selectOpen:C,selectValue:_,autoFocus:w,autoComplete:k,disableAutoResize:A}=e,j=_i(e),{control:I,setValue:T,formState:{isSubmitting:P,isValidating:D}}=oi(),[M,$]=v.useState(!1),[R]=It(),W=Rc(e.label,e.isRequired);return g.jsx(Ws,{name:n,control:I,shouldUnregister:!0,render:({field:{onChange:U,value:z,name:N},fieldState:{error:H}})=>{const X=H!=null&&H.message?h&&D?R.validating:H==null?void 0:H.message:void 0;function J(te){U(te.trimStart())}return g.jsx(Kc,{fieldId:j,label:r,labelHelpTitle:i??r,labelHelp:o,additionalControls:a,helperText:c,helperTextInvalid:X,isRequired:f,children:g.jsxs(O.InputGroup,{children:[g.jsx(O.InputGroupItem,{isFill:!0,children:g.jsx(O.TextArea,{id:j,placeholder:s,onChange:(te,Q)=>J(Q),value:z??"","aria-describedby":j?`${j}-form-group`:void 0,validated:X?"error":void 0,type:t==="password"?M?"text":"password":t,readOnlyVariant:d?"default":void 0,isDisabled:u,autoFocus:w,autoComplete:k||"off","data-cy":j,autoResize:A===void 0?!0:!A})}),t==="password"&&g.jsx(O.Button,{variant:"control",onClick:()=>$(!M),isDisabled:u||d,children:M?g.jsx(ve.EyeIcon,{}):g.jsx(ve.EyeSlashIcon,{})}),S&&g.jsx(O.Button,{ouiaId:`lookup-${N}-button`,variant:"control",onClick:()=>C==null?void 0:C(te=>{if(_){const Q=_(te);T(N,Q,{shouldValidate:!0})}},S),"aria-label":"Options menu",isDisabled:u||P,children:g.jsx(ve.SearchIcon,{})}),l&&l]})})},rules:{required:W,validate:h,minLength:typeof r=="string"&&typeof m=="number"?{value:m,message:`${li(r.toLocaleLowerCase())} must be at least ${m} characters.`}:m,maxLength:typeof r=="string"&&typeof p=="number"?{value:p,message:`${li(r.toLocaleLowerCase())} cannot be greater than ${p} characters.`}:p,min:typeof r=="string"&&(typeof y=="number"||typeof y=="string")?{value:y,message:`${li(r.toLocaleLowerCase())} must be less than ${y}.`}:m,max:typeof r=="string"&&(typeof b=="number"||typeof b=="string")?{value:b,message:`${li(r.toLocaleLowerCase())} cannot be greater than ${b}.`}:m,pattern:x}})}function K0e(e){const{type:t,name:n,label:r,labelHelpTitle:i,labelHelp:o,additionalControls:a,placeholder:s,button:l,helperText:c,isDisabled:u,isReadOnly:d,isRequired:f,validate:h,minLength:m,maxLength:p,min:y,max:b,pattern:x,selectTitle:S,selectOpen:C,selectValue:_,autoFocus:w,autoComplete:k}=e,A=_i(e),{t:j}=$e(),{control:I,setValue:T,formState:{isSubmitting:P,isValidating:D,defaultValues:M}}=oi(),[$,R]=v.useState(!1),[W]=It(),U=Rc(e.label,e.isRequired),z=Vs(M,e.name);return g.jsx(Ws,{name:n,control:I,shouldUnregister:!0,defaultValue:e.defaultValue,render:({field:{onChange:N,value:H,name:X},fieldState:{error:J}})=>{const te=J!=null&&J.message?h&&D?W.validating:J==null?void 0:J.message:void 0;let Q=H;switch(t){case"datetime-local":if(H){const ue=new Date(H);Q=new Date(ue.getTime()-ue.getTimezoneOffset()*6e4).toISOString().slice(0,16)}break}function ie(ue){switch(e.type){case"datetime-local":{N(new Date(ue).toISOString());break}case"number":{let he=Number(ue);if(ue===""||isNaN(he)){T(X,null),N(null);return}b!==void 0&&he>Number(b)&&(he=Number(b)),y!==void 0&&he<Number(y)&&(he=Number(y)),T(X,he),N(he);break}default:N(ue.trimStart())}}return g.jsx(Kc,{fieldId:A,label:r,labelHelpTitle:i??r,labelHelp:o,additionalControls:a,helperText:c,helperTextInvalid:te,isRequired:f,children:g.jsxs(O.InputGroup,{children:[g.jsx(O.InputGroupItem,{isFill:!0,children:g.jsx(O.TextInput,{id:A,placeholder:s,onChange:(ue,he)=>ie(he),value:Q??"","aria-describedby":A?`${A}-form-group`:void 0,validated:te?"error":void 0,type:t==="password"?$?"text":"password":t,readOnlyVariant:d?"default":void 0,isDisabled:u,autoFocus:w,autoComplete:k||"off","data-cy":A})}),t==="password"&&g.jsx(O.Button,{variant:"control",onClick:()=>R(!$),isDisabled:u||d,children:$?g.jsx(ve.EyeIcon,{}):g.jsx(ve.EyeSlashIcon,{})}),S&&g.jsx(O.Button,{ouiaId:`lookup-${X}-button`,variant:"control",onClick:()=>C==null?void 0:C(ue=>{if(_){const he=_(ue);T(X,he,{shouldValidate:!0})}},S),"aria-label":"Options menu",isDisabled:u||P,children:g.jsx(ve.SearchIcon,{"data-cy":"lookup-button"})}),l,g.jsx(Kr,{actions:[{label:j("Undo changes"),type:ot.Button,selection:Ye.None,onClick:()=>{T(e.name,z)},isHidden:()=>!e.enableUndo||H===z},{label:j("Reset to default"),type:ot.Button,selection:Ye.None,onClick:()=>{T(e.name,e.defaultValue)},isHidden:()=>!e.enableReset||H===e.defaultValue}],variant:O.ButtonVariant.control,position:"right"})]})})},rules:{required:U,validate:h,minLength:typeof r=="string"&&typeof m=="number"?{value:m,message:`${li(r.toLocaleLowerCase())} must be at least ${m} characters.`}:m,maxLength:typeof r=="string"&&typeof p=="number"?{value:p,message:`${li(r.toLocaleLowerCase())} cannot be greater than ${p} characters.`}:p,min:typeof r=="string"&&(typeof y=="number"||typeof y=="string")?{value:y,message:`${li(r.toLocaleLowerCase())} must be greater or equal to ${y}.`}:m,max:typeof r=="string"&&(typeof b=="number"||typeof b=="string")?{value:b,message:`${li(r.toLocaleLowerCase())} cannot be greater than ${b}.`}:b,pattern:x}})}const kv=v.createContext({isOpen:!1,setState:()=>({})});function Th(){return v.useContext(kv)}function F3(e){const t=fn("xl"),[n,r]=v.useState(()=>t),i=v.useCallback(o=>{o.isOpen!==void 0&&r(o.isOpen)},[]);return v.useEffect(()=>i({isOpen:t}),[t,i]),g.jsx(kv.Provider,{value:{isOpen:n,setState:i},children:e.children})}function N3(){const e=Lt.useNavigate(),t=fn("xl"),n=Th();return v.useCallback(i=>{e(i),t||n.setState({isOpen:!n.isOpen})},[e,t,n])}const Tv=v.createContext([{},()=>{}]);function Z0e(){return v.useContext(Tv)[0]}function X0e(){return v.useContext(Tv)}function J0e(e){const[t,n]=v.useState({}),r=v.useCallback(o=>{n(W3("",o))},[]),i=v.useMemo(()=>[t,r],[t,r]);return g.jsx(Tv.Provider,{value:i,children:e.children})}function W3(e,t){const n={};return t.forEach(r=>{const i=(e+"/"+r.path).replace("//","/");"id"in r&&typeof r.id=="string"&&(n[r.id]=i),"children"in r&&Object.assign(n,W3(i,r.children))}),n}const R3=v.createContext({notificationsDrawerOpen:!1,setNotificationsDrawerOpen:()=>{throw new Error("PageNotificationsContext not implemented")},notificationGroups:{},setNotificationGroups:()=>{throw new Error("PageNotificationsContext not implemented")}});function Ah(){return v.useContext(R3)}function Q0e(e){const[t,n]=v.useState(!1),[r,i]=v.useState({});return g.jsx(R3.Provider,{value:{notificationGroups:r,setNotificationGroups:i,notificationsDrawerOpen:t,setNotificationsDrawerOpen:n},children:e.children})}function epe(e){const{t}=$e(),{notificationsDrawerOpen:n,setNotificationsDrawerOpen:r}=Ah(),i=v.useRef(null);function o(){var s;r(!1),(s=i.current)==null||s.focus()}const{notificationGroups:a}=Ah();return g.jsx(O.Drawer,{isExpanded:n,onExpand:()=>r(!0),children:g.jsx(O.DrawerContent,{panelContent:g.jsx(O.DrawerPanelContent,{children:g.jsxs(O.NotificationDrawer,{"data-cy":"notifications-drawer",children:[g.jsx(O.NotificationDrawerHeader,{title:t("Notifications"),children:g.jsx(O.DrawerCloseButton,{onClick:o})}),g.jsx(O.NotificationDrawerBody,{children:g.jsx(O.NotificationDrawerGroupList,{children:Object.values(a).map((s,l)=>g.jsx(npe,{group:s},l))})})]})}),children:g.jsx(tpe,{children:e.children})})})}const tpe=Pe(O.DrawerContentBody)`
|
497
497
|
max-height: 100%;
|
498
|
-
`;function npe(e){const{t}=$e(),[n,r]=v.useState(!0);return g.jsx(O.NotificationDrawerGroup,{title:e.group.title,isExpanded:n,count:e.group.notifications.length,onExpand:(i,o)=>r(o),children:g.jsxs(O.NotificationDrawerList,{isHidden:!n,children:[e.group.notifications.map((i,o)=>g.jsx(rpe,{notification:i},o)),e.group.notifications.length===0&&g.jsxs(O.EmptyState,{variant:O.EmptyStateVariant.full,children:[g.jsx(O.EmptyStateHeader,{headingLevel:"h2",titleText:t("No notifications")}),g.jsx(O.EmptyStateBody,{children:t("There are currently no notifications.")})]})]})})}function rpe(e){const t=e.notification.variant==="info"?void 0:e.notification.variant,n=Lt.useNavigate(),{setNotificationsDrawerOpen:r}=Ah(),i=e.notification.timestamp?new Date(e.notification.timestamp):void 0,o=i?`${i.toLocaleDateString()} ${i.toLocaleTimeString()}`:void 0;return g.jsxs(O.NotificationDrawerListItem,{variant:e.notification.variant,onClick:()=>{n(e.notification.to),r(!1)},children:[g.jsx(O.NotificationDrawerListItemHeader,{title:e.notification.title,variant:t}),g.jsx(O.NotificationDrawerListItemBody,{timestamp:o,children:e.notification.description})]})}function ipe(e){return g.jsx(Cb,{children:g.jsx(vx,{defaultRefreshInterval:e.defaultRefreshInterval,children:g.jsx(J0e,{children:g.jsx(NO,{children:g.jsx(A1,{children:g.jsx(F3,{children:g.jsx(Q0e,{children:g.jsx(YD,{children:e.children})})})})})})})})}function B3(e){const[t]=It();return g.jsx(D1,{message:t.errorText,children:g.jsx("div",{style:{display:"flex",flexDirection:"column",height:"100%",maxHeight:"100%"},children:e.children})})}function ope(e){const t=fn("sm");return g.jsxs(O.Masthead,{display:{default:"inline"},style:{borderBottom:"1px solid #fff4",paddingRight:0},children:[g.jsx(z3,{}),t&&g.jsx(O.MastheadMain,{children:g.jsx(O.MastheadBrand,{component:n=>g.jsx(Lt.Link,{...n,to:"/"}),children:e.brand})}),g.jsx(O.MastheadContent,{style:{marginLeft:0,minHeight:0},children:g.jsx(O.Toolbar,{id:"toolbar","data-cy":"toolbar",inset:{default:"insetNone"},style:{padding:0},children:g.jsx(O.ToolbarContent,{children:e.children})})})]})}function z3(){const e=Th();return g.jsx(O.MastheadToggle,{onClick:()=>e.setState({isOpen:!e.isOpen}),children:g.jsx(O.PageToggleButton,{"data-cy":"nav-toggle",variant:"plain","aria-label":"Global navigation",children:g.jsx(ve.BarsIcon,{})})})}function ape(){const{setNotificationsDrawerOpen:e,notificationGroups:t}=Ah(),n=Object.values(t).reduce((r,i)=>r+i.notifications.length,0);return g.jsx(O.NotificationBadge,{"data-cy":"notification-badge",variant:n===0?"read":"unread",count:n,onClick:()=>e(r=>!r)})}function spe(){const[e,t]=v.useContext(Zo);return e.activeTheme==="dark"?g.jsx(O.Button,{"data-cy":"settings-icon",variant:"plain",onClick:()=>t({...e,theme:"light"}),children:g.jsx(ve.MoonIcon,{})}):g.jsx(O.Button,{"data-cy":"theme-icon",variant:"plain",onClick:()=>t({...e,theme:"dark"}),children:g.jsx(ve.SunIcon,{})})}function V3(e){const{navigation:t}=e,n=Th();return g.jsx(O.PageSidebar,{isSidebarOpen:n.isOpen,className:"bg-lighten",children:g.jsxs(O.PageSidebarBody,{children:[e.contextSwitcher&&g.jsxs(g.Fragment,{children:[g.jsx(O.PageSection,{style:{background:"transparent",paddingTop:16},children:g.jsx(O.Stack,{hasGutter:!0,children:e.contextSwitcher})}),g.jsx(O.Divider,{})]}),g.jsx(O.Nav,{"data-cy":"page-navigation",className:"side-nav",children:g.jsx(O.NavList,{children:g.jsx(Dh,{baseRoute:e.basename??"",items:t})})})]})})}function Dh(e){return g.jsx(g.Fragment,{children:e.items.filter(t=>"hidden"in t?t.hidden!==!0:!0).map((t,n)=>g.jsx(lpe,{item:t,baseRoute:e.baseRoute},t.id??t.label??n))})}function lpe(e){var u;const{item:t}=e,[n,r]=v.useState(()=>localStorage.getItem("default-nav-expanded")==="true"||localStorage.getItem((t.id??t.label)+"-expanded")==="true"),i=d=>{r(d),localStorage.setItem((t.id??t.label)+"-expanded",d?"true":"false")};let o;if("id"in e.item)o=e.item.id;else if("children"in e.item){const d=e.item.children.find(f=>f.path==="");d&&"id"in d&&(o=d.id)}const a=N3();let s=e.baseRoute+"/"+t.path;if(s=s.replace("//","/"),t.path==="/"&&"children"in t)return g.jsx(Dh,{items:t.children,baseRoute:""});const l="children"in t&&((u=t.children)==null?void 0:u.find(d=>d.label)),c={fontSize:"small",opacity:.5,textAlign:"left"};if(!l&&"label"in t){let d=(process.env.ROUTE_PREFIX??"")+s;d=d.replace("//","/");const f=t.href?!1:location.pathname.startsWith(d);return g.jsxs(O.NavItem,{id:o,href:t.href||s,isActive:f,className:f?"bg-lighten":void 0,onClick:()=>t.href?window.open(t.href,"_blank"):a(s),target:t.href?"_blank":"","data-cy":o,style:{display:"flex",alignItems:"stretch",flexDirection:"column"},children:[g.jsxs(O.Flex,{children:[g.jsx(O.FlexItem,{grow:{default:"grow"},children:t.label}),"badge"in t&&t.badge&&g.jsx(O.FlexItem,{children:g.jsx(O.Label,{isCompact:!0,variant:"outline",color:t.badgeColor,children:t.badge})}),"href"in t&&t.href&&g.jsx("span",{className:"pf-v5-c-nav__toggle",children:g.jsx("span",{className:"pf-v5-c-nav__toggle-icon",children:g.jsx(ve.ExternalLinkAltIcon,{})})})]}),t.subtitle&&g.jsx("div",{style:c,children:t.subtitle})]})}return!l||t.label===void 0?null:t.label?g.jsx(O.NavExpandable,{title:g.jsxs("div",{children:[g.jsx("div",{style:{textAlign:"left"},children:t.label}),t.subtitle&&g.jsx("div",{style:c,children:t.subtitle})]}),isExpanded:n,onExpand:(d,f)=>i(f),children:g.jsx(Dh,{items:t.children,baseRoute:s})}):g.jsx(Dh,{items:t.children,baseRoute:s})}function cpe(e){const{navigation:t,masthead:n}=e,r=v.useMemo(()=>[{path:e.basename??"/",element:g.jsx(O.Page,{header:n,sidebar:g.jsx(V3,{navigation:t,basename:e.basename,contextSwitcher:e.contextSwitcher}),children:g.jsx(epe,{children:g.jsxs("div",{style:{maxHeight:"100%",overflow:"hidden",height:"100%",display:"flex",flexDirection:"column"},children:[e.banner,g.jsx("div",{style:{flexGrow:1,overflow:"hidden"},children:g.jsx(Lt.Outlet,{})})]})})}),children:t.filter(({href:a})=>!a)},{path:"*",element:g.jsx(QO,{})}],[n,t,e.banner,e.basename]),[i,o]=X0e();return v.useEffect(()=>o(r),[r,o]),g.jsx(Lt.Routes,{children:r.map(U3)})}function U3(e){var t;return g.jsx(Lt.Route,{path:e.path,element:e.element,children:(t=e.children)==null?void 0:t.map(U3)},e.path)}function upe(e){return e.replace(/^\//,"")}function H3(e,t){for(const n of e){if("id"in n&&n.id===t)return n;if("children"in n){const r=H3(n.children,t);if(r)return r}}}function q3(e,t){for(let n=0;n<e.length;n++){const r=e[n];if("id"in r&&r.id===t)return e.splice(n,1),r;if("children"in r){const i=q3(r.children,t);if(i)return i}}}function G3(e,t,n){for(const r of e)if("id"in r&&r.id===t){const i=r;"children"in r||(i.children=[]),i.children.push(n);return}else"children"in r&&G3(r.children,t,n)}function Y3(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];if("id"in i&&i.id===t){e.splice(r+1,0,n);return}else"children"in i&&Y3(i.children,t,n)}}function K3(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];if("id"in i&&i.id===t){e.splice(r,0,n);return}else"children"in i&&K3(i.children,t,n)}}function Z3(){const e=Z0e();return v.useCallback((t,n)=>{let r=e[t]??"";const i=n==null?void 0:n.params,o=n==null?void 0:n.query;return r?(i&&(r=Object.keys(i).reduce((a,s)=>{let l=i[s];if(l===void 0)return a;l=encodeURIComponent(l.toString());const c=":"+s,u=new RegExp(c+"(?!.*"+c+")","g");return a.replace(u,l)},r)),o&&(r=`${r}?${Object.keys(o).map(a=>{let s=o[a];return s===void 0?"":(s=encodeURIComponent(s.toString()),`${a}=${s}`)}).join("&").replace("/&&/g","&")}`)):console.error(`Page id ${t} not found`),r},[e])}function dpe(){const e=Lt.useNavigate(),t=Z3();return v.useCallback((n,r)=>{const i=t(n,r);i&&e(i)},[e,t])}function fpe(e){const{loading:t}=e,[n,r]=v.useState((e==null?void 0:e.initialTabIndex)??0),i=v.useCallback((l,c)=>r(c),[r]),o=v.Children.toArray(e.children),a=o.map((l,c)=>{if(v.isValidElement(l)&&l.type===Av){const u=l.props.label;return g.jsx(O.Tab,{title:u||g.jsx(O.Skeleton,{width:"60px"}),eventKey:c},u??c)}return l}),s=o[n];return t?g.jsx(O.Tabs,{style:{flexShrink:0,backgroundColor:"var(--pf-v5-c-tabs__link--BackgroundColor)"},children:g.jsx(Av,{children:g.jsx(O.PageSection,{variant:"light",children:g.jsx(O.Skeleton,{})})})}):g.jsxs(g.Fragment,{children:[g.jsx(O.Tabs,{activeKey:n,onSelect:i,inset:{default:"insetSm"},isBox:!0,style:{flexShrink:0,backgroundColor:"var(--pf-v5-c-tabs__link--BackgroundColor)"},children:a}),s]})}function Av(e){return g.jsx(g.Fragment,{children:e.children})}function hpe(){const[e,t]=v.useState(!0);return v.useEffect(()=>()=>{t(!1)},[]),e}function mpe(){const e=v.useRef({isMounted:!0});return v.useEffect(()=>()=>{e.current.isMounted=!1},[]),e}function X3(){const e=hpe(),[t,n]=v.useState(e?window.location:void 0),r=v.useCallback(()=>{n(window.location)},[]);v.useEffect(()=>{if(e)return t||r(),window.addEventListener("popstate",r),()=>{window.removeEventListener("popstate",r)}},[e,t,r]);const i=v.useCallback(a=>{window.history.replaceState(null,"",a),r()},[r]),o=v.useCallback(a=>{window.history.replaceState(null,"",a),r()},[r]);return{location:t,push:i,update:o}}function J3(){var i,o;const e=X3(),t=((i=e.location)==null?void 0:i.pathname)||"/",n=v.useMemo(()=>{var s;let a=(s=e.location)==null?void 0:s.search;return a&&a.includes("?specPath=")?a=a.substring(0,a.indexOf("?specPath=")):a&&a.includes("&specPath=")&&(a=a.substring(0,a.indexOf("&specPath="))),new URLSearchParams(a??"/")},[(o=e.location)==null?void 0:o.search]),r=v.useCallback(a=>{const s=a.toString();s?e.update("?"+s):e.update(t)},[e,t]);return[n,r]}const Q3=v.createContext({});function Ca(){return v.useContext(Q3)}function gpe(e,t){return!e.hidden||!e.hidden(t)?e:null}function Zi(e){return(e==null?void 0:e.substeps)!==void 0}function ppe(e){const{steps:t,onSubmit:n}=e,[r,i]=v.useState(!1),[o,a]=v.useState(null),[s,l]=v.useState({}),[c,u]=v.useState(e.stepDefaults??{}),[d,f]=v.useState({}),[h,m]=v.useState(),[p,y]=v.useState(!1),[b,x]=J3(),S=v.useMemo(()=>ype(t),[t]);v.useEffect(()=>{if(process.env.NODE_ENV==="development")for(const k in e.stepDefaults)t.find(A=>A.id===k)||console.warn(`PageWizardProvider: defaultValue key '${k}' not found in steps.`)},[e.stepDefaults,t]),v.useEffect(()=>{const k=Ph(t,s);o||!k.length||(k[0].substeps?a(k[0].substeps[0]):a(k[0]))},[o,t,s]);const C=v.useCallback(async(k={})=>{var P;const A=eA(t,{...s,...k});if(o===null)return Promise.resolve();if(!Zi(o)&&o.validate&&await o.validate(k,s),(o==null?void 0:o.id)===((P=A[A.length-1])==null?void 0:P.id)){y(!0);try{await n(s)}catch(D){m(D instanceof Error?D:new Error(Wc("An error occurred.")))}finally{y(!1)}return}const I=A.findIndex(D=>D.id===(o==null?void 0:o.id)),T=Zi(A[I+1])?A[I+2]:A[I+1];return x(new URLSearchParams("")),l(D=>({...D,...k})),u(D=>({...D,[o==null?void 0:o.id]:k})),a(T),Promise.resolve()},[o,t,n,x,s,m]),_=v.useCallback(()=>{const k=Ph(S,s),A=k.findIndex(I=>I.id===(o==null?void 0:o.id)),j=Zi(k[A-1])?k[A-2]:k[A-1];x(new URLSearchParams("")),a(j)},[o==null?void 0:o.id,S,x,s]),w=v.useMemo(()=>({wizardData:s,setWizardData:l,stepData:c,setStepData:u,steps:e.steps,visibleSteps:Ph(t,s),visibleStepsFlattened:eA(t,s),activeStep:o,setActiveStep:a,stepError:d,setStepError:f,submitError:h,setSubmitError:m,isToggleExpanded:r,setToggleExpanded:i,onNext:C,onBack:_,isSubmitting:p}),[s,l,c,u,e.steps,t,o,a,d,f,h,m,r,i,C,_,p]);return g.jsx(Q3.Provider,{value:w,children:e.children})}function ype(e){return e.reduce((t,n)=>(t.push(n),Zi(n)&&t.push(...n.substeps),t),[])}function Ph(e,t){return e.filter(n=>gpe(n,t))}function eA(e,t){return Ph(e,t).reduce((r,i)=>(r.push(i),Zi(i)&&r.push(...i.substeps),r),[])}function tA(e){const{t}=$e(),{activeStep:n,visibleStepsFlattened:r,setSubmitError:i}=Ca(),o=(n==null?void 0:n.id)===r[r.length-1].id,a=t(o?"Finish":"Next"),s=Zi(r[0])?(n==null?void 0:n.id)===r[1].id:(n==null?void 0:n.id)===r[0].id,l=s?"pf-v5-c-button pf-m-disabled":"pf-v5-c-button pf-m-secondary";return g.jsxs("footer",{className:"pf-v5-c-wizard__footer border-top bg-lighten","data-cy":"wizard-footer",children:[n!==null&&"inputs"in n?g.jsx(Wy,{style:{minWidth:10},children:a}):g.jsx("button",{"data-cy":"wizard-next",className:"pf-v5-c-button pf-m-primary",type:"submit",onClick:()=>{var c;i(void 0),(c=e.onNext)==null||c.call(e)},children:a}),g.jsx("button",{type:"button","data-cy":"wizard-back",className:l,disabled:s,onClick:()=>{var c;i(void 0),(c=e.onBack)==null||c.call(e)},children:t("Back")}),g.jsx("div",{"data-cy":"wizard-cancel",className:"pf-v5-c-wizard__footer-cancel",children:g.jsx("button",{className:"pf-v5-c-button pf-m-link",type:"button",onClick:e.onCancel,children:t("Cancel")})})]})}function vpe({onCancel:e,disableGrid:t,errorAdapter:n,isVertical:r,singleColumn:i}){const o=Lt.useNavigate(),{activeStep:a,stepData:s,onNext:l,onBack:c,submitError:u,isSubmitting:d}=Ca(),f=v.useCallback(()=>{e?e():o(-1)},[o,e]);return d?g.jsx(O.Bullseye,{children:g.jsx(O.Spinner,{})}):g.jsxs(B3,{children:[g.jsx(xpe,{error:u}),a!==null&&("inputs"in a?g.jsxs(Ak,{onSubmit:l,footer:g.jsx(tA,{onBack:c,onCancel:f}),defaultValue:s[a.id],errorAdapter:n,disableGrid:t,isVertical:r,singleColumn:i,isWizard:!0,children:[g.jsx(bpe,{}),a.inputs]},a.id):g.jsxs("div",{"data-cy":`wizard-section-${a.id}`,style:{display:"flex",flexDirection:"column",flexGrow:1,overflow:"hidden"},children:[g.jsx(O.PageSection,{"aria-label":Wc("Wizard step content"),hasOverflowScroll:!0,isFilled:!0,variant:"light",children:a==null?void 0:a.element}),g.jsx(tA,{onNext:()=>void l({}),onBack:c,onCancel:f})]}))]})}function bpe(){const{activeStep:e,setStepError:t}=Ca(),{errors:n}=My(),r=JSON.stringify(n);return v.useEffect(()=>{Object.keys(n).length===0?t({}):e&&t({[e.id]:n})},[n,e,t,r]),null}function xpe(e){const{t}=$e(),n=e.error;if(!e.error)return null;if(!(e.error instanceof Error))return typeof e.error=="string"?g.jsx(O.Alert,{variant:"danger",title:e.error}):g.jsx(O.Alert,{variant:"danger",title:t("An error occurred.")});if("message"in e.error&&!n.json)return g.jsx(O.Alert,{variant:"danger",title:e.error.message});if(n.json)return g.jsx(O.Alert,{variant:"danger",title:n.message,isInline:!0,children:Object.values(n.json).map((r,i)=>g.jsx("div",{children:r},i))})}const _pe=Pe.div`
|
498
|
+
`;function npe(e){const{t}=$e(),[n,r]=v.useState(!0);return g.jsx(O.NotificationDrawerGroup,{title:e.group.title,isExpanded:n,count:e.group.notifications.length,onExpand:(i,o)=>r(o),children:g.jsxs(O.NotificationDrawerList,{isHidden:!n,children:[e.group.notifications.map((i,o)=>g.jsx(rpe,{notification:i},o)),e.group.notifications.length===0&&g.jsxs(O.EmptyState,{variant:O.EmptyStateVariant.full,children:[g.jsx(O.EmptyStateHeader,{headingLevel:"h2",titleText:t("No notifications")}),g.jsx(O.EmptyStateBody,{children:t("There are currently no notifications.")})]})]})})}function rpe(e){const t=e.notification.variant==="info"?void 0:e.notification.variant,n=Lt.useNavigate(),{setNotificationsDrawerOpen:r}=Ah(),i=e.notification.timestamp?new Date(e.notification.timestamp):void 0,o=i?`${i.toLocaleDateString()} ${i.toLocaleTimeString()}`:void 0;return g.jsxs(O.NotificationDrawerListItem,{variant:e.notification.variant,onClick:()=>{n(e.notification.to),r(!1)},children:[g.jsx(O.NotificationDrawerListItemHeader,{title:e.notification.title,variant:t}),g.jsx(O.NotificationDrawerListItemBody,{timestamp:o,children:e.notification.description})]})}function ipe(e){return g.jsx(Cb,{children:g.jsx(vx,{defaultRefreshInterval:e.defaultRefreshInterval,children:g.jsx(J0e,{children:g.jsx(NO,{children:g.jsx(A1,{children:g.jsx(F3,{children:g.jsx(Q0e,{children:g.jsx(YD,{children:e.children})})})})})})})})}function B3(e){const[t]=It();return g.jsx(D1,{message:t.errorText,children:g.jsx("div",{style:{display:"flex",flexDirection:"column",height:"100%",maxHeight:"100%"},children:e.children})})}function ope(e){const t=fn("sm");return g.jsxs(O.Masthead,{display:{default:"inline"},style:{borderBottom:"1px solid #fff4",paddingRight:0},children:[g.jsx(z3,{}),t&&g.jsx(O.MastheadMain,{children:g.jsx(O.MastheadBrand,{component:n=>g.jsx(Lt.Link,{...n,to:"/"}),children:e.brand})}),g.jsx(O.MastheadContent,{style:{marginLeft:0,minHeight:0},children:g.jsx(O.Toolbar,{id:"toolbar","data-cy":"toolbar",inset:{default:"insetNone"},style:{padding:0},children:g.jsx(O.ToolbarContent,{children:e.children})})})]})}function z3(){const e=Th();return g.jsx(O.MastheadToggle,{onClick:()=>e.setState({isOpen:!e.isOpen}),children:g.jsx(O.PageToggleButton,{"data-cy":"nav-toggle",variant:"plain","aria-label":"Global navigation",children:g.jsx(ve.BarsIcon,{})})})}function ape(){const{setNotificationsDrawerOpen:e,notificationGroups:t}=Ah(),n=Object.values(t).reduce((r,i)=>r+i.notifications.length,0);return g.jsx(O.NotificationBadge,{"data-cy":"notification-badge",variant:n===0?"read":"unread",count:n,onClick:()=>e(r=>!r)})}function spe(){const[e,t]=v.useContext(Zo);return e.activeTheme==="dark"?g.jsx(O.Button,{"data-cy":"settings-icon",variant:"plain",onClick:()=>t({...e,theme:"light"}),children:g.jsx(ve.MoonIcon,{})}):g.jsx(O.Button,{"data-cy":"theme-icon",variant:"plain",onClick:()=>t({...e,theme:"dark"}),children:g.jsx(ve.SunIcon,{})})}function V3(e){const{navigation:t}=e,n=Th();return g.jsx(O.PageSidebar,{isSidebarOpen:n.isOpen,className:"bg-lighten",children:g.jsxs(O.PageSidebarBody,{children:[e.contextSwitcher&&g.jsxs(g.Fragment,{children:[g.jsx(O.PageSection,{style:{background:"transparent",paddingTop:16},children:g.jsx(O.Stack,{hasGutter:!0,children:e.contextSwitcher})}),g.jsx(O.Divider,{})]}),g.jsx(O.Nav,{"data-cy":"page-navigation",className:"side-nav",children:g.jsx(O.NavList,{children:g.jsx(Dh,{baseRoute:e.basename??"",items:t})})})]})})}function Dh(e){return g.jsx(g.Fragment,{children:e.items.filter(t=>"hidden"in t?t.hidden!==!0:!0).map((t,n)=>g.jsx(lpe,{item:t,baseRoute:e.baseRoute},t.id??t.label??n))})}function lpe(e){var u;const{item:t}=e,[n,r]=v.useState(()=>localStorage.getItem("default-nav-expanded")==="true"||localStorage.getItem((t.id??t.label)+"-expanded")==="true"),i=d=>{r(d),localStorage.setItem((t.id??t.label)+"-expanded",d?"true":"false")};let o;if("id"in e.item)o=e.item.id;else if("children"in e.item){const d=e.item.children.find(f=>f.path==="");d&&"id"in d&&(o=d.id)}const a=N3();let s=e.baseRoute+"/"+t.path;if(s=s.replace("//","/"),t.path==="/"&&"children"in t)return g.jsx(Dh,{items:t.children,baseRoute:""});const l="children"in t&&((u=t.children)==null?void 0:u.find(d=>d.label)),c={fontSize:"small",opacity:.5,textAlign:"left"};if(!l&&"label"in t){let d=(process.env.ROUTE_PREFIX??"")+s;d=d.replace("//","/");const f=t.href?!1:location.pathname.startsWith(d);return g.jsxs(O.NavItem,{id:o,href:t.href||s,isActive:f,className:f?"bg-lighten":void 0,onClick:()=>t.href?window.open(t.href,"_blank"):a(s),target:t.href?"_blank":"","data-cy":o,style:{display:"flex",alignItems:"stretch",flexDirection:"column"},children:[g.jsxs(O.Flex,{children:[g.jsx(O.FlexItem,{grow:{default:"grow"},children:t.label}),"badge"in t&&t.badge&&g.jsx(O.FlexItem,{children:g.jsx(O.Label,{isCompact:!0,variant:"outline",color:t.badgeColor,children:t.badge})}),"href"in t&&t.href&&g.jsx("span",{className:"pf-v5-c-nav__toggle",children:g.jsx("span",{className:"pf-v5-c-nav__toggle-icon",children:g.jsx(ve.ExternalLinkAltIcon,{})})})]}),t.subtitle&&g.jsx("div",{style:c,children:t.subtitle})]})}return!l||t.label===void 0?null:t.label?g.jsx(O.NavExpandable,{title:g.jsxs("div",{children:[g.jsx("div",{style:{textAlign:"left"},children:t.label}),t.subtitle&&g.jsx("div",{style:c,children:t.subtitle})]}),isExpanded:n,onExpand:(d,f)=>i(f),children:g.jsx(Dh,{items:t.children,baseRoute:s})}):g.jsx(Dh,{items:t.children,baseRoute:s})}function cpe(e){const{navigation:t,masthead:n}=e,r=v.useMemo(()=>[{path:e.basename??"/",element:g.jsx(O.Page,{header:n,sidebar:g.jsx(V3,{navigation:t,basename:e.basename,contextSwitcher:e.contextSwitcher}),children:g.jsx(epe,{children:g.jsxs("div",{style:{maxHeight:"100%",overflow:"hidden",height:"100%",display:"flex",flexDirection:"column"},children:[e.banner,g.jsx("div",{style:{flexGrow:1,overflow:"hidden"},children:g.jsx(Lt.Outlet,{})})]})})}),children:t.filter(({href:a})=>!a)},{path:"*",element:g.jsx(QO,{})}],[n,t,e.banner,e.basename,e.contextSwitcher]),[i,o]=X0e();return v.useEffect(()=>o(r),[r,o]),g.jsx(Lt.Routes,{children:r.map(U3)})}function U3(e){var t;return g.jsx(Lt.Route,{path:e.path,element:e.element,children:(t=e.children)==null?void 0:t.map(U3)},e.path)}function upe(e){return e.replace(/^\//,"")}function H3(e,t){for(const n of e){if("id"in n&&n.id===t)return n;if("children"in n){const r=H3(n.children,t);if(r)return r}}}function q3(e,t){for(let n=0;n<e.length;n++){const r=e[n];if("id"in r&&r.id===t)return e.splice(n,1),r;if("children"in r){const i=q3(r.children,t);if(i)return i}}}function G3(e,t,n){for(const r of e)if("id"in r&&r.id===t){const i=r;"children"in r||(i.children=[]),i.children.push(n);return}else"children"in r&&G3(r.children,t,n)}function Y3(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];if("id"in i&&i.id===t){e.splice(r+1,0,n);return}else"children"in i&&Y3(i.children,t,n)}}function K3(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];if("id"in i&&i.id===t){e.splice(r,0,n);return}else"children"in i&&K3(i.children,t,n)}}function Z3(){const e=Z0e();return v.useCallback((t,n)=>{let r=e[t]??"";const i=n==null?void 0:n.params,o=n==null?void 0:n.query;return r?(i&&(r=Object.keys(i).reduce((a,s)=>{let l=i[s];if(l===void 0)return a;l=encodeURIComponent(l.toString());const c=":"+s,u=new RegExp(c+"(?!.*"+c+")","g");return a.replace(u,l)},r)),o&&(r=`${r}?${Object.keys(o).map(a=>{let s=o[a];return s===void 0?"":(s=encodeURIComponent(s.toString()),`${a}=${s}`)}).join("&").replace("/&&/g","&")}`)):console.error(`Page id ${t} not found`),r},[e])}function dpe(){const e=Lt.useNavigate(),t=Z3();return v.useCallback((n,r)=>{const i=t(n,r);i&&e(i)},[e,t])}function fpe(e){const{loading:t}=e,[n,r]=v.useState((e==null?void 0:e.initialTabIndex)??0),i=v.useCallback((l,c)=>r(c),[r]),o=v.Children.toArray(e.children),a=o.map((l,c)=>{if(v.isValidElement(l)&&l.type===Av){const u=l.props.label;return g.jsx(O.Tab,{title:u||g.jsx(O.Skeleton,{width:"60px"}),eventKey:c},u??c)}return l}),s=o[n];return t?g.jsx(O.Tabs,{style:{flexShrink:0,backgroundColor:"var(--pf-v5-c-tabs__link--BackgroundColor)"},children:g.jsx(Av,{children:g.jsx(O.PageSection,{variant:"light",children:g.jsx(O.Skeleton,{})})})}):g.jsxs(g.Fragment,{children:[g.jsx(O.Tabs,{activeKey:n,onSelect:i,inset:{default:"insetSm"},isBox:!0,style:{flexShrink:0,backgroundColor:"var(--pf-v5-c-tabs__link--BackgroundColor)"},children:a}),s]})}function Av(e){return g.jsx(g.Fragment,{children:e.children})}function hpe(){const[e,t]=v.useState(!0);return v.useEffect(()=>()=>{t(!1)},[]),e}function mpe(){const e=v.useRef({isMounted:!0});return v.useEffect(()=>()=>{e.current.isMounted=!1},[]),e}function X3(){const e=hpe(),[t,n]=v.useState(e?window.location:void 0),r=v.useCallback(()=>{n(window.location)},[]);v.useEffect(()=>{if(e)return t||r(),window.addEventListener("popstate",r),()=>{window.removeEventListener("popstate",r)}},[e,t,r]);const i=v.useCallback(a=>{window.history.replaceState(null,"",a),r()},[r]),o=v.useCallback(a=>{window.history.replaceState(null,"",a),r()},[r]);return{location:t,push:i,update:o}}function J3(){var i,o;const e=X3(),t=((i=e.location)==null?void 0:i.pathname)||"/",n=v.useMemo(()=>{var s;let a=(s=e.location)==null?void 0:s.search;return a&&a.includes("?specPath=")?a=a.substring(0,a.indexOf("?specPath=")):a&&a.includes("&specPath=")&&(a=a.substring(0,a.indexOf("&specPath="))),new URLSearchParams(a??"/")},[(o=e.location)==null?void 0:o.search]),r=v.useCallback(a=>{const s=a.toString();s?e.update("?"+s):e.update(t)},[e,t]);return[n,r]}const Q3=v.createContext({});function Ca(){return v.useContext(Q3)}function gpe(e,t){return!e.hidden||!e.hidden(t)?e:null}function Zi(e){return(e==null?void 0:e.substeps)!==void 0}function ppe(e){const{steps:t,onSubmit:n}=e,[r,i]=v.useState(!1),[o,a]=v.useState(null),[s,l]=v.useState({}),[c,u]=v.useState(e.stepDefaults??{}),[d,f]=v.useState({}),[h,m]=v.useState(),[p,y]=v.useState(!1),[b,x]=J3(),S=v.useMemo(()=>ype(t),[t]);v.useEffect(()=>{if(process.env.NODE_ENV==="development")for(const k in e.stepDefaults)t.find(A=>A.id===k)||console.warn(`PageWizardProvider: defaultValue key '${k}' not found in steps.`)},[e.stepDefaults,t]),v.useEffect(()=>{const k=Ph(t,s);o||!k.length||(k[0].substeps?a(k[0].substeps[0]):a(k[0]))},[o,t,s]);const C=v.useCallback(async(k={})=>{var P;const A=eA(t,{...s,...k});if(o===null)return Promise.resolve();if(!Zi(o)&&o.validate&&await o.validate(k,s),(o==null?void 0:o.id)===((P=A[A.length-1])==null?void 0:P.id)){y(!0);try{await n(s)}catch(D){m(D instanceof Error?D:new Error(Wc("An error occurred.")))}finally{y(!1)}return}const I=A.findIndex(D=>D.id===(o==null?void 0:o.id)),T=Zi(A[I+1])?A[I+2]:A[I+1];return x(new URLSearchParams("")),l(D=>({...D,...k})),u(D=>({...D,[o==null?void 0:o.id]:k})),a(T),Promise.resolve()},[o,t,n,x,s,m]),_=v.useCallback(()=>{const k=Ph(S,s),A=k.findIndex(I=>I.id===(o==null?void 0:o.id)),j=Zi(k[A-1])?k[A-2]:k[A-1];x(new URLSearchParams("")),a(j)},[o==null?void 0:o.id,S,x,s]),w=v.useMemo(()=>({wizardData:s,setWizardData:l,stepData:c,setStepData:u,steps:e.steps,visibleSteps:Ph(t,s),visibleStepsFlattened:eA(t,s),activeStep:o,setActiveStep:a,stepError:d,setStepError:f,submitError:h,setSubmitError:m,isToggleExpanded:r,setToggleExpanded:i,onNext:C,onBack:_,isSubmitting:p}),[s,l,c,u,e.steps,t,o,a,d,f,h,m,r,i,C,_,p]);return g.jsx(Q3.Provider,{value:w,children:e.children})}function ype(e){return e.reduce((t,n)=>(t.push(n),Zi(n)&&t.push(...n.substeps),t),[])}function Ph(e,t){return e.filter(n=>gpe(n,t))}function eA(e,t){return Ph(e,t).reduce((r,i)=>(r.push(i),Zi(i)&&r.push(...i.substeps),r),[])}function tA(e){const{t}=$e(),{activeStep:n,visibleStepsFlattened:r,setSubmitError:i}=Ca(),o=(n==null?void 0:n.id)===r[r.length-1].id,a=t(o?"Finish":"Next"),s=Zi(r[0])?(n==null?void 0:n.id)===r[1].id:(n==null?void 0:n.id)===r[0].id,l=s?"pf-v5-c-button pf-m-disabled":"pf-v5-c-button pf-m-secondary";return g.jsxs("footer",{className:"pf-v5-c-wizard__footer border-top bg-lighten","data-cy":"wizard-footer",children:[n!==null&&"inputs"in n?g.jsx(Wy,{style:{minWidth:10},children:a}):g.jsx("button",{"data-cy":"wizard-next",className:"pf-v5-c-button pf-m-primary",type:"submit",onClick:()=>{var c;i(void 0),(c=e.onNext)==null||c.call(e)},children:a}),g.jsx("button",{type:"button","data-cy":"wizard-back",className:l,disabled:s,onClick:()=>{var c;i(void 0),(c=e.onBack)==null||c.call(e)},children:t("Back")}),g.jsx("div",{"data-cy":"wizard-cancel",className:"pf-v5-c-wizard__footer-cancel",children:g.jsx("button",{className:"pf-v5-c-button pf-m-link",type:"button",onClick:e.onCancel,children:t("Cancel")})})]})}function vpe({onCancel:e,disableGrid:t,errorAdapter:n,isVertical:r,singleColumn:i}){const o=Lt.useNavigate(),{activeStep:a,stepData:s,onNext:l,onBack:c,submitError:u,isSubmitting:d}=Ca(),f=v.useCallback(()=>{e?e():o(-1)},[o,e]);return d?g.jsx(O.Bullseye,{children:g.jsx(O.Spinner,{})}):g.jsxs(B3,{children:[g.jsx(xpe,{error:u}),a!==null&&("inputs"in a?g.jsxs(Ak,{onSubmit:l,footer:g.jsx(tA,{onBack:c,onCancel:f}),defaultValue:s[a.id],errorAdapter:n,disableGrid:t,isVertical:r,singleColumn:i,isWizard:!0,children:[g.jsx(bpe,{}),a.inputs]},a.id):g.jsxs("div",{"data-cy":`wizard-section-${a.id}`,style:{display:"flex",flexDirection:"column",flexGrow:1,overflow:"hidden"},children:[g.jsx(O.PageSection,{"aria-label":Wc("Wizard step content"),hasOverflowScroll:!0,isFilled:!0,variant:"light",children:a==null?void 0:a.element}),g.jsx(tA,{onNext:()=>void l({}),onBack:c,onCancel:f})]}))]})}function bpe(){const{activeStep:e,setStepError:t}=Ca(),{errors:n}=My(),r=JSON.stringify(n);return v.useEffect(()=>{Object.keys(n).length===0?t({}):e&&t({[e.id]:n})},[n,e,t,r]),null}function xpe(e){const{t}=$e(),n=e.error;if(!e.error)return null;if(!(e.error instanceof Error))return typeof e.error=="string"?g.jsx(O.Alert,{variant:"danger",title:e.error}):g.jsx(O.Alert,{variant:"danger",title:t("An error occurred.")});if("message"in e.error&&!n.json)return g.jsx(O.Alert,{variant:"danger",title:e.error.message});if(n.json)return g.jsx(O.Alert,{variant:"danger",title:n.message,isInline:!0,children:Object.values(n.json).map((r,i)=>g.jsx("div",{children:r},i))})}const _pe=Pe.div`
|
499
499
|
background-color: var(--pf-v5-global--BackgroundColor--light-100);
|
500
500
|
color: var(--pf-v5-global--Color--dark-100);
|
501
501
|
|