Local modifications to ClusterLabs/Anvil by Alteeve
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
29 KiB

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[464],{593:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/init",function(){return t(8616)}])},9099:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var r=t(7294),i={boolean:function(e){return Boolean(e)},number:function(e){return parseInt(String(e),10)||0},string:function(e){return String(e)}},l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.postSet,t=e.preSet,r=e.set,l=e.setType,o=void 0===l?"string":l,u=e.valueKey,a=void 0===u?"value":u;return function(e){var l=e.target[a],u=i[o](l);null===t||void 0===t||t.call(null,e),null===r||void 0===r||r.call(null,u),null===n||void 0===n||n.call(null,e)}},o=t(7987);function u(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){a(e,n,t[n])}))}return e}function c(e,n){if(null==e)return{};var t,r,i=function(e,n){if(null==e)return{};var t,r,i={},l=Object.keys(e);for(r=0;r<l.length;r++)t=l[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)t=l[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function d(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(!e)return;if("string"===typeof e)return u(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return u(e,n)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e){var n=function(e,n){if("object"!==v(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==v(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===v(n)?n:String(n)}var v=function(e){return e&&"undefined"!==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var p="input",m={boolean:!1,number:0,string:""},h={createInputOnChangeHandlerOptions:{},required:!1,valueType:"string"},g=(0,r.forwardRef)((function(e,n){var t=e.input,i=e.inputTestBatch,u=e.onBlurAppend,v=e.onFirstRender,g=e.onFocusAppend,x=e.onUnmount,b=e.required,y=void 0===b?h.required:b,j=e.valueKey,w=e.valueType,P=void 0===w?h.valueType:w,k=e.createInputOnChangeHandlerOptions,O=void 0===k?h.createInputOnChangeHandlerOptions:k,S=O.postSet,Z=O.valueKey,C=void 0===Z?j:Z,A=c(e.createInputOnChangeHandlerOptions,["postSet","valueKey"]),I=t.props,N=(0,r.useMemo)((function(){return null!==C&&void 0!==C?C:"checked"in I?"checked":"value"}),[I,C]),V=I.onBlur,T=I.onChange,F=I.onFocus,M=I[N],R=void 0===M?m[P]:M,z=c(I,["onBlur","onChange","onFocus",N].map(f)),E=(0,r.useState)(R),H=E[0],_=E[1],B=(0,r.useState)(!1),D=B[0],L=B[1],U=(0,r.useState)(!1),$=U[0],q=U[1],Q=(0,r.useCallback)((function(e){_(e)}),[]),J=(0,r.useMemo)((function(){var e;return i&&(i.isRequired=y,e=(0,o.LT)(a({},p,i))),e}),[i,y]),G=(0,r.useMemo)((function(){return null!==V&&void 0!==V?V:J&&function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r,i=n[0],l=i.target.value,o=J({inputs:a({},p,{value:l})});q(o),null===u||void 0===u||(r=u).call.apply(r,[null].concat(d(n)))}}),[V,u,J]),K=(0,r.useMemo)((function(){return l(s({postSet:function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r,i;L(!0),null===T||void 0===T||(r=T).call.apply(r,[null].concat(d(n))),null===S||void 0===S||(i=S).call.apply(i,[null].concat(d(n)))},set:Q,setType:P,valueKey:N},A))}),[T,S,A,Q,N,P]),W=(0,r.useMemo)((function(){return null!==F&&void 0!==F?F:i&&function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r,l,o;null===(l=i.defaults)||void 0===l||null===(o=l.onSuccess)||void 0===o||o.call(null,{append:{}}),null===g||void 0===g||(r=g).call.apply(r,[null].concat(d(n)))}}),[F,i,g]);return(0,r.useEffect)((function(){var e,n=null!==(e=null===J||void 0===J?void 0:J.call(null,{inputs:a({},p,{value:H}),isIgnoreOnCallbacks:!0}))&&void 0!==e&&e;return null===v||void 0===v||v.call(null,{isValid:n}),x}),[]),(0,r.useImperativeHandle)(n,(function(){return{getIsChangedByUser:function(){return D},getValue:function(){return H},isValid:function(){return $},setValue:Q}}),[H,D,$,Q]),(0,r.cloneElement)(t,s({},z,a({onBlur:G,onChange:K,onFocus:W,required:y},N,H)))}));g.defaultProps=h,g.displayName="InputWithRef";var x=g},7869:function(e,n,t){"use strict";var r=t(5893),i=t(7294),l=t(8187);function o(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function u(e,n){if(null==e)return{};var t,r,i=function(e,n){if(null==e)return{};var t,r,i={},l=Object.keys(e);for(r=0;r<l.length;r++)t=l[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)t=l[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function a(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,i,l=[],o=!0,u=!1;try{for(t=t.call(e);!(o=(r=t.next()).done)&&(l.push(r.value),!n||l.length!==n);o=!0);}catch(a){u=!0,i=a}finally{try{o||null==t.return||t.return()}finally{if(u)throw i}}return l}}(e,n)||function(e,n){if(!e)return;if("string"===typeof e)return o(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return o(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){var n=function(e,n){if("object"!==c(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!==c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===c(n)?n:String(n)}var c=function(e){return e&&"undefined"!==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var d={count:0,defaultMessageType:"info",onSet:void 0,usePlaceholder:!0},f=(0,i.forwardRef)((function(e,n){var t=e.count,o=void 0===t?d.count:t,c=e.defaultMessageType,f=void 0===c?d.defaultMessageType:c,v=e.onSet,p=e.usePlaceholder,m=void 0===p?d.usePlaceholder:p,h=(0,i.useState)({}),g=h[0],x=h[1],b=(0,i.useCallback)((function(e){return void 0!==g[e]}),[g]),y=(0,i.useCallback)((function(e,n){var t=0;x((function(r){r[e];var i=u(r,[e].map(s));return n&&(i[e]=n),t=Object.keys(i).length,i})),null===v||void 0===v||v.call(null,t)}),[v]),j=(0,i.useCallback)((function(e,n){var t=0,r=n?function(e,r){e[r]=n,t+=1}:void 0;x((function(n){var i={};return Object.keys(n).forEach((function(l){e.test(l)?null===r||void 0===r||r.call(null,i,l):(i[l]=n[l],t+=1)})),i})),null===v||void 0===v||v.call(null,t)}),[v]),w=(0,i.useMemo)((function(){var e=Object.entries(g),n=o>0,t=n?o:e.length,i=[];if(e.every((function(e){var n=a(e,2),o=n[0],u=n[1],s=u.children,c=u.type,d=void 0===c?f:c;return i.push((0,r.jsx)(l.Z,{type:d,children:s},"message-".concat(o))),i.length<t})),m&&n&&0===i.length)for(var u=o-i.length,s=0;s<u;s+=1)i.push((0,r.jsx)(l.Z,{sx:{visibility:"hidden"},text:"Placeholder"},"message-placeholder-".concat(s)));return i}),[o,f,m,g]);return(0,i.useImperativeHandle)(n,(function(){return{exists:b,setMessage:y,setMessageRe:j}}),[b,y,j]),(0,r.jsx)(r.Fragment,{children:w})}));f.defaultProps=d,f.displayName="MessageGroup",n.Z=f},8616:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return re}});var r=t(5893),i=t(7357),l=t(1113),o=t(6886),u=t(7294),a=t(2029),s=t(7169),c=t(4390),d=t(157),f=t(4825),v=t(4690),p=t(8128),m=t(4188),h=t(1250),g=t(9099),x=t(8187),b=t(7869),y=t(6284),j=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.fillString,r=void 0===t?"0":t,i=n.maxLength,l=void 0===i?2:i,o=n.which,u=void 0===o?"Start":o;return String(e)["pad".concat(u)](l,r)};function w(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function P(e,n){if(null==e)return{};var t,r,i=function(e,n){if(null==e)return{};var t,r,i={},l=Object.keys(e);for(r=0;r<l.length;r++)t=l[r],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)t=l[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var k={show:!0},O=function(e){var n=e.onClick,t=e.show,i=void 0===t?k.show:t,l=P(e,["onClick","show"]);return i?(0,r.jsx)(f.Z,function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){w(e,n,t[n])}))}return e}({onClick:n,tabIndex:-1},l,{children:"Suggest"})):(0,r.jsx)(r.Fragment,{})};O.defaultProps=k;var S=O,Z=t(7987),C=t(7750);function A(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function I(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function N(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,i,l=[],o=!0,u=!1;try{for(t=t.call(e);!(o=(r=t.next()).done)&&(l.push(r.value),!n||l.length!==n);o=!0);}catch(a){u=!0,i=a}finally{try{o||null==t.return||t.return()}finally{if(u)throw i}}return l}}(e,n)||T(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(e){return function(e){if(Array.isArray(e))return A(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||T(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e,n){if(e){if("string"===typeof e)return A(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?A(e,n):void 0}}var F="adminPassword",M="confirmAdminPassword",R="domainName",z="hostName",E="hostNumber",H="organizationName",_="organizationPrefix",B={0:function(){return""},1:function(e){return N(e,1)[0].substring(0,1).toLocaleLowerCase()},2:function(e){return e.map((function(e){return e.substring(0,1).toLocaleLowerCase()})).join("")}},D=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=e.split(/\s/).filter((function(e){return!/and|of/.test(e)})).slice(0,5),t=n.length>1?2:n.length;return B[t](n)},L=function(e){var n=e.organizationPrefix,t=e.hostNumber,r=e.domainName;return[n,t,r].every((function(e){return Boolean(e)}))?"".concat(n,"-striker").concat(j(t),".").concat(r):""},U=(0,u.forwardRef)((function(e,n){var t,i,l,a,s=e.toggleSubmitDisabled,c=(0,u.useState)(),d=c[0],f=c[1],j=(0,u.useState)(!1),w=j[0],P=j[1],k=(0,u.useState)(!1),O=k[0],A=k[1],N=(0,u.useState)(!0),T=N[0],B=N[1],U=(0,u.useState)(!0),$=U[0],q=U[1],Q=(0,u.useRef)({}),J=(0,u.useRef)({}),G=(0,u.useRef)({}),K=(0,u.useRef)({}),W=(0,u.useRef)({}),X=(0,u.useRef)({}),Y=(0,u.useRef)({}),ee=(0,u.useRef)({}),ne=(0,u.useCallback)((function(e){var n;return null===(n=ee.current.setMessage)||void 0===n?void 0:n.call(null,_,e)}),[]),te=(0,u.useCallback)((function(e){var n;return null===(n=ee.current.setMessage)||void 0===n?void 0:n.call(null,E,e)}),[]),re=(0,u.useCallback)((function(e){var n;return null===(n=ee.current.setMessage)||void 0===n?void 0:n.call(null,R,e)}),[]),ie=(0,u.useCallback)((function(e){var n;return null===(n=ee.current.setMessage)||void 0===n?void 0:n.call(null,z,e)}),[]),le=(0,u.useCallback)((function(e){var n;return null===(n=ee.current.setMessage)||void 0===n?void 0:n.call(null,F,e)}),[]),oe=(0,u.useCallback)((function(e){var n;return null===(n=ee.current.setMessage)||void 0===n?void 0:n.call(null,M,e)}),[]),ue=(0,u.useMemo)((function(){var e;return I(e={},F,{defaults:{getValue:function(){var e;return null===(e=Q.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){le(void 0)}},tests:[{onFailure:function(){le({children:(0,r.jsxs)(r.Fragment,{children:["Admin password cannot contain single-quote (",(0,r.jsx)(C.Q0,{text:"'"}),"), double-quote (",(0,r.jsx)(C.Q0,{text:'"'}),"), slash (",(0,r.jsx)(C.Q0,{text:"/"}),"), backslash (",(0,r.jsx)(C.Q0,{text:"\\"}),"), angle brackets (",(0,r.jsx)(C.Q0,{text:"<>"}),"), curly brackets (",(0,r.jsx)(C.Q0,{text:"{}"}),")."]})})},test:function(e){var n=e.value;return!/['"/\\><}{]/g.test(n)}},{test:Z.HJ}]}),I(e,M,{defaults:{getValue:function(){var e,n;return null===(e=J.current)||void 0===e||null===(n=e.getValue)||void 0===n?void 0:n.call(null)},onSuccess:function(){oe(void 0)}},tests:[{onFailure:function(){oe({children:"Confirmation doesn't match admin password."})},test:function(e){var n;return e.value===(null===(n=Q.current.getValue)||void 0===n?void 0:n.call(null))}},{test:Z.HJ}]}),I(e,R,{defaults:{compare:[!$],getValue:function(){var e;return null===(e=W.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){re(void 0)}},tests:[{onFailure:function(){re({children:(0,r.jsxs)(r.Fragment,{children:["Domain name can only contain lowercase alphanumeric, hyphen (",(0,r.jsx)(C.Q0,{text:"-"}),"), and dot (",(0,r.jsx)(C.Q0,{text:"."}),") characters."]})})},test:function(e){var n=e.compare,t=e.value;return n[0]||h.FZ.test(t)}},{test:Z.HJ}]}),I(e,z,{defaults:{compare:[!$],getValue:function(){var e;return null===(e=Y.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){ie(void 0)}},tests:[{onFailure:function(){ie({children:(0,r.jsxs)(r.Fragment,{children:["Host name can only contain lowercase alphanumeric, hyphen (",(0,r.jsx)(C.Q0,{text:"-"}),"), and dot (",(0,r.jsx)(C.Q0,{text:"."}),") characters."]})})},test:function(e){var n=e.compare,t=e.value;return n[0]||h.FZ.test(t)}},{test:Z.HJ}]}),I(e,E,{defaults:{getValue:function(){var e;return null===(e=X.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:function(){te(void 0)}},tests:[{onFailure:function(){te({children:"Striker number can only contain digits."})},test:function(e){var n=e.value;return/^\d+$/.test(n)}},{test:Z.HJ}]}),I(e,H,{defaults:{getValue:function(){var e;return null===(e=G.current.getValue)||void 0===e?void 0:e.call(null)}},tests:[{test:Z.HJ}]}),I(e,_,{defaults:{getValue:function(){var e;return null===(e=K.current.getValue)||void 0===e?void 0:e.call(null)},max:5,min:1,onSuccess:function(){ne(void 0)}},tests:[{onFailure:function(e){var n=e.max,t=e.min;ne({children:"Organization prefix must be ".concat(t," to ").concat(n," lowercase alphanumeric characters.")})},test:function(e){var n=e.max,t=e.min,r=e.value;return RegExp("^[a-z0-9]{".concat(t,",").concat(n,"}$")).test(r)}}]}),e}),[$,le,oe,re,ie,te,ne]),ae=(0,u.useMemo)((function(){return(0,Z.LT)(ue)}),[ue]),se=(0,u.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.excludeTestIds,t=void 0===n?[]:n,r=e.inputs,i=e.isContinueOnFailure,l=e.isExcludeConfirmAdminPassword,o=void 0===l?!T:l;o&&t.push(M),null===s||void 0===s||s.call(null,ae({excludeTestIds:t,inputs:r,isContinueOnFailure:i,isIgnoreOnCallbacks:!0,isTestAll:!0}))}),[T,ae,s]),ce=(0,u.useCallback)((function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.organizationName,i=void 0===r?null===(t=G.current.getValue)||void 0===t?void 0:t.call(null):r,l=D(i);return null===(e=K.current.setValue)||void 0===e||e.call(null,l),se({inputs:I({},_,{isIgnoreOnCallbacks:!1,value:l}),isContinueOnFailure:!0}),l}),[se]),de=(0,u.useCallback)((function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.organizationPrefix,r=void 0===t?null===(i=K.current.getValue)||void 0===i?void 0:i.call(null):t,o=n.hostNumber,u=void 0===o?null===(l=X.current.getValue)||void 0===l?void 0:l.call(null):o,s=n.domainName,c=void 0===s?null===(a=W.current.getValue)||void 0===a?void 0:a.call(null):s,d=L({organizationPrefix:r,hostNumber:u,domainName:c});return null===(e=Y.current.setValue)||void 0===e||e.call(null,d),se({inputs:I({},z,{isIgnoreOnCallbacks:!1,value:d}),isContinueOnFailure:!0}),d}),[se]),fe=(0,u.useCallback)((function(){var e;return Boolean(null===(e=G.current.getValue)||void 0===e?void 0:e.call(null))}),[]),ve=(0,u.useCallback)((function(){var e,n,t;return[null===(e=K.current.getValue)||void 0===e?void 0:e.call(null),null===(n=X.current.getValue)||void 0===n?void 0:n.call(null),null===(t=W.current.getValue)||void 0===t?void 0:t.call(null)].every((function(e){return Boolean(e)}))}),[]),pe=(0,u.useCallback)((function(){var e;(null===(e=K.current.getIsChangedByUser)||void 0===e?void 0:e.call(null))?P(fe()):ce()}),[fe,ce]),me=(0,u.useCallback)((function(){var e;(null===(e=Y.current.getIsChangedByUser)||void 0===e?void 0:e.call(null))?A(ve()):de()}),[ve,de]),he=(0,u.useCallback)((function(){var e,n=ce();(null===(e=Y.current.getIsChangedByUser)||void 0===e?void 0:e.call(null))||de({organizationPrefix:n})}),[de,ce]),ge=(0,u.useCallback)((function(){de()}),[de]),xe=(0,u.useCallback)((function(e){return function(n){return n===e?void 0:e}}),[]),be=(0,u.useMemo)((function(){return(0,r.jsx)(p.Z,{checked:$,onChange:function(e,n){var t;q(n),se({inputs:(t={},I(t,R,{compare:[!n],isIgnoreOnCallbacks:!1}),I(t,z,{compare:[!n],isIgnoreOnCallbacks:!1}),t),isContinueOnFailure:!0})},sx:{padding:".2em"}})}),[$,se]);return(0,u.useImperativeHandle)(n,(function(){return{get:function(){var e,n,t,r,i,l;return{adminPassword:null===(e=Q.current.getValue)||void 0===e?void 0:e.call(null),organizationName:null===(n=G.current.getValue)||void 0===n?void 0:n.call(null),organizationPrefix:null===(t=K.current.getValue)||void 0===t?void 0:t.call(null),domainName:null===(r=W.current.getValue)||void 0===r?void 0:r.call(null),hostNumber:null===(i=X.current.getValue)||void 0===i?void 0:i.call(null),hostName:null===(l=Y.current.getValue)||void 0===l?void 0:l.call(null)}}}})),(0,r.jsxs)(v.Z,{children:[(0,r.jsxs)(o.ZP,{columns:{xs:1,sm:2,md:3},container:!0,spacing:"1em",children:[(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsxs)(v.Z,{children:[(0,r.jsx)(g.Z,{input:(0,r.jsx)(y.Z,{id:"striker-init-general-organization-name",inputProps:{onBlur:pe},inputLabelProps:{isNotifyRequired:!0},label:"Organization name",onChange:function(){se()},onHelp:function(){f(xe("Name of the organization that maintains this Anvil! system. You can enter anything that makes sense to you."))}}),ref:G}),(0,r.jsxs)(v.Z,{row:!0,sx:{"& > :first-child":{flexGrow:1}},children:[(0,r.jsx)(g.Z,{input:(0,r.jsx)(y.Z,{id:"striker-init-general-organization-prefix",inputProps:{endAdornment:(0,r.jsx)(S,{show:w,onClick:he}),inputProps:{maxLength:5,sx:{minWidth:"2.5em"}},onBlur:function(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];var i=e.target.value;ae({inputs:I({},_,{value:i})}),me.apply(void 0,[e].concat(V(t)))}},inputLabelProps:{isNotifyRequired:!0},label:"Prefix",onChange:function(e){var n=e.target.value;se({inputs:I({},_,{value:n})}),ne(),P(fe())},onHelp:function(){f(xe("Alphanumberic short-form of the organization name. It's used as the prefix for host names."))}}),ref:K}),(0,r.jsx)(g.Z,{input:(0,r.jsx)(y.Z,{id:"striker-init-general-host-number",inputProps:{inputProps:{maxLength:2,sx:{minWidth:"2em"}},onBlur:function(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];var i=e.target.value;ae({inputs:I({},E,{value:i})}),me.apply(void 0,[e].concat(V(t)))}},inputLabelProps:{isNotifyRequired:!0},label:"Striker #",onChange:function(e){var n=e.target.value;se({inputs:I({},E,{value:n})}),te()},onHelp:function(){f(xe("Number or count of this striker; this should be '1' for the first striker, '2' for the second striker, and such."))}}),ref:X,valueType:"number"})]})]})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsxs)(v.Z,{children:[(0,r.jsx)(g.Z,{input:(0,r.jsx)(y.Z,{id:"striker-init-general-domain-name",inputProps:{onBlur:function(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];var i=e.target.value;ae({inputs:I({},R,{value:i})}),me.apply(void 0,[e].concat(V(t)))}},inputLabelProps:{isNotifyRequired:!0},label:"Domain name",onChange:function(e){var n=e.target.value;se({inputs:I({},R,{value:n})}),re()},onHelp:function(){f(xe("Domain name for this striker. It's also the default domain used when creating new install manifests."))}}),ref:W}),(0,r.jsx)(g.Z,{input:(0,r.jsx)(y.Z,{id:"striker-init-general-host-name",inputProps:{endAdornment:(0,r.jsx)(S,{show:O,onClick:ge}),onBlur:function(e){var n=e.target.value;ae({inputs:I({},z,{value:n})})}},inputLabelProps:{isNotifyRequired:!0},label:"Host name",onChange:function(e){var n=e.target.value;se({inputs:I({},z,{value:n})}),ie(),A(ve())},onHelp:function(){f(xe("Host name for this striker. It's usually a good idea to use the auto-generated value."))}}),ref:Y})]})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,sm:2,md:1,children:(0,r.jsxs)(o.ZP,{columns:{xs:1,sm:2,md:1},container:!0,spacing:"1em",sx:{"& > * > *":{width:"100%"}},children:[(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(g.Z,{input:(0,r.jsx)(y.Z,{id:"striker-init-general-admin-password",inputProps:{inputProps:{type:m.Z.password},onBlur:function(e){var n=e.target.value;ae({inputs:I({},F,{value:n})})},onPasswordVisibilityAppend:function(e){var n=e===m.Z.password;se({isExcludeConfirmAdminPassword:!n}),B(n),oe()}},inputLabelProps:{isNotifyRequired:!0},label:"Admin password",onChange:function(e){var n=e.target.value;se({inputs:I({},F,{value:n})}),le()},onHelp:function(){f(xe("Password use to login to this Striker and connect to its database. Don't provide an used password here because it'll be stored as plaintext."))}}),ref:Q})}),T&&(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(g.Z,{input:(0,r.jsx)(y.Z,{id:"striker-init-general-confirm-admin-password",inputProps:{inputProps:{type:m.Z.password},onBlur:function(e){var n=e.target.value;ae({inputs:I({},M,{value:n})})}},inputLabelProps:{isNotifyRequired:T},label:"Confirm password",onChange:function(e){var n=e.target.value;se({inputs:I({},M,{value:n})}),oe()}}),ref:J})})]})})]}),(0,r.jsx)(b.Z,{count:1,defaultMessageType:"warning",ref:ee}),(0,r.jsx)(x.Z,{children:(0,r.jsxs)(v.Z,{row:!0,sx:{"& > :last-child":{flexGrow:1}},children:[be,(0,r.jsx)(C.Ac,{inverted:!0,children:$?"Uncheck to skip domain and host name pattern validation.":"Check to re-enable domain and host name pattern validation."})]})}),d&&(0,r.jsx)(x.Z,{onClose:function(){f(void 0)},children:d})]})}));U.defaultProps={toggleSubmitDisabled:void 0},U.displayName="GeneralInitForm";var $=U,q=t(1770),Q=t(1706),J=t(3377),G=t(2444),K=t(5741),W=t(8461),X=t(3679),Y=t(2152);function ee(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function ne(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){ee(e,n,t[n])}))}return e}var te=function(){var e,n=(0,u.useState)(),t=n[0],i=n[1],p=(0,u.useState)(),m=p[0],h=p[1],g=(0,u.useState)(!1),b=g[0],y=g[1],j=(0,u.useState)(!0),w=j[0],P=j[1],k=(0,u.useState)(!1),O=k[0],S=k[1],Z=(0,u.useState)(!1),A=Z[0],I=Z[1],N=(0,u.useState)(!1),V=N[0],T=N[1],F=(0,u.useRef)({}),M=(0,u.useRef)({}),R=(0,u.useRef)({}),z=(0,u.useRef)({}),E=(0,u.useMemo)((function(){return V?(0,r.jsx)(Y.Z,{}):(0,r.jsx)(v.Z,{row:!0,sx:{flexDirection:"row-reverse"},children:(0,r.jsx)(f.Z,{disabled:w,onClick:function(){var e,n,t,r;h(ne({},null!==(t=null===(e=F.current.get)||void 0===e?void 0:e.call(null))&&void 0!==t?t:{},null!==(r=null===(n=M.current.get)||void 0===n?void 0:n.call(null))&&void 0!==r?r:{networks:[]})),y(!0)},children:"Initialize"})})}),[w,V]),H=(0,u.useCallback)((function(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];P(!n.every((function(e){return e})))}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(X.s_,{children:[(0,r.jsxs)(X.V9,{children:[(0,r.jsx)(C.z,{text:"Initialize striker"}),(0,r.jsx)(Q.Z,{onClick:function(e){var n,t,r=e.currentTarget;null===(n=z.current.setAnchor)||void 0===n||n.call(null,r),null===(t=z.current.setOpen)||void 0===t||t.call(null,!0)},variant:"normal",children:(0,r.jsx)(J.Z,{icon:l.Z,ref:R})})]}),(0,r.jsxs)(v.Z,{children:[(0,r.jsx)($,{ref:F,toggleSubmitDisabled:function(e){e!==O&&(S(e),H(e,A))}}),(0,r.jsx)(W.Z,{ref:M,toggleSubmitDisabled:function(e){e!==A&&(I(e),H(O,e))}}),t&&(0,r.jsx)(x.Z,ne({},t,{onClose:function(){return i(void 0)}})),E]})]}),(0,r.jsx)(d.Z,{actionProceedText:"Initialize",content:(0,r.jsxs)(o.ZP,{container:!0,spacing:".6em",columns:{xs:2},children:[(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.Ac,{children:"Organization name"})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.$_,{children:null===m||void 0===m?void 0:m.organizationName})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.Ac,{children:"Organization prefix"})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.$_,{children:null===m||void 0===m?void 0:m.organizationPrefix})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.Ac,{children:"Striker number"})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.$_,{children:null===m||void 0===m?void 0:m.hostNumber})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.Ac,{children:"Domain name"})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.$_,{children:null===m||void 0===m?void 0:m.domainName})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.Ac,{children:"Host name"})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.$_,{children:null===m||void 0===m?void 0:m.hostName})}),(0,r.jsx)(o.ZP,{item:!0,sx:{marginTop:"1.4em"},xs:2,children:(0,r.jsx)(C.Ac,{children:"Networks"})}),null===m||void 0===m?void 0:m.networks.map((function(e){var n=e.inputUUID,t=e.interfaces,i=e.ipAddress,l=e.name,u=e.subnetMask,a=e.type,s=e.typeCount;return(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsxs)(o.ZP,{container:!0,spacing:".6em",columns:{xs:2},children:[(0,r.jsx)(o.ZP,{item:!0,xs:2,children:(0,r.jsxs)(C.Ac,{children:[l," (",(0,r.jsx)(C.Q0,{children:"".concat(a.toUpperCase()).concat(s)}),")"]})}),t.map((function(e,t){var i="network-confirm-".concat(n,"-interface").concat(t),l="none";if(e){var u=e.networkInterfaceName,a=e.networkInterfaceUUID;i="".concat(i,"-").concat(a),l=u}return(0,r.jsxs)(o.ZP,{container:!0,item:!0,children:[(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.Ac,{children:"Link ".concat(t+1)})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.$_,{children:l})})]},i)})),(0,r.jsx)(o.ZP,{item:!0,xs:2,children:(0,r.jsx)(C.$_,{children:"".concat(i,"/").concat(u)})})]})},"network-confirm-".concat(n))})),(0,r.jsx)(o.ZP,{item:!0,sx:{marginBottom:"1.4em"},xs:2}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.Ac,{children:"Gateway"})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.$_,{children:null===m||void 0===m?void 0:m.gateway})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.Ac,{children:"Gateway network"})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.$_,{children:null===m||void 0===m||null===(e=m.gatewayInterface)||void 0===e?void 0:e.toUpperCase()})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.Ac,{children:"Domain name server(s)"})}),(0,r.jsx)(o.ZP,{item:!0,xs:1,children:(0,r.jsx)(C.$_,{children:null===m||void 0===m?void 0:m.dns})})]}),dialogProps:{open:b},onCancelAppend:function(){y(!1)},onProceedAppend:function(){i(void 0),T(!0),y(!1),c.Z.put("/init",m).then((function(){T(!1),i({children:(0,r.jsxs)(r.Fragment,{children:["Successfully registered the configuration job! You can check the progress at the top right icon. Once the job completes, you can access the"," ",(0,r.jsx)(K.Z,{href:"/login",sx:{color:s.E5,display:"inline-flex"},children:"login page"}),"."]}),type:"info"})})).catch((function(e){var n=(0,q.Z)(e);i(n),T(!1)}))},titleText:"Confirm striker initialization"}),(0,r.jsx)(G.Z,{getJobUrl:function(e){return"".concat(a.Z,"/init/job?start=").concat(e)},onFetchSuccessAppend:function(e){var n;null===(n=R.current.indicate)||void 0===n||n.call(null,Object.keys(e).length>0)},ref:z})]})},re=function(){return(0,r.jsx)(i.Z,{sx:{display:"flex",flexDirection:"column"},children:(0,r.jsx)(te,{})})}}},function(e){e.O(0,[382,923,182,536,644,676,746,203,899,140,692,774,888,179],(function(){return n=593,e(e.s=n);var n}));var n=e.O();_N_E=n}]);