(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[464],{62705:function(e,t,n){var r=n(55639).Symbol;e.exports=r},44239:function(e,t,n){var r=n(62705),l=n(89607),i=n(2333),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?l(e):i(e)}},27561:function(e,t,n){var r=n(67990),l=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(l,""):e}},31957:function(e,t,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},89607:function(e,t,n){var r=n(62705),l=Object.prototype,i=l.hasOwnProperty,s=l.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var l=s.call(e);return r&&(t?e[a]=n:delete e[a]),l}},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},55639:function(e,t,n){var r=n(31957),l="object"==typeof self&&self&&self.Object===Object&&self,i=r||l||Function("return this")();e.exports=i},67990:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},23279:function(e,t,n){var r=n(13218),l=n(7771),i=n(14841),s=Math.max,a=Math.min;e.exports=function(e,t,n){var o,u,c,d,h,m,f=0,x=!1,g=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function p(t){var n=o,r=u;return o=u=void 0,f=t,d=e.apply(r,n)}function j(e){var n=e-m,r=e-f;return void 0===m||n>=t||n<0||g&&r>=c}function b(){var e,n,r,i=l();if(j(i))return P(i);h=setTimeout(b,(e=i-m,n=i-f,r=t-e,g?a(r,c-n):r))}function P(e){return(h=void 0,v&&o)?p(e):(o=u=void 0,d)}function y(){var e,n=l(),r=j(n);if(o=arguments,u=this,m=n,r){if(void 0===h)return f=e=m,h=setTimeout(b,t),x?p(e):d;if(g)return clearTimeout(h),h=setTimeout(b,t),p(m)}return void 0===h&&(h=setTimeout(b,t)),d}return t=i(t)||0,r(n)&&(x=!!n.leading,c=(g="maxWait"in n)?s(i(n.maxWait)||0,t):c,v="trailing"in n?!!n.trailing:v),y.cancel=function(){void 0!==h&&clearTimeout(h),f=0,o=m=u=h=void 0},y.flush=function(){return void 0===h?d:P(l())},y}},13218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},37005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},33448:function(e,t,n){var r=n(44239),l=n(37005);e.exports=function(e){return"symbol"==typeof e||l(e)&&"[object Symbol]"==r(e)}},7771:function(e,t,n){var r=n(55639);e.exports=function(){return r.Date.now()}},14841:function(e,t,n){var r=n(27561),l=n(13218),i=n(33448),s=0/0,a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return s;if(l(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=l(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=o.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):a.test(e)?s:+e}},45844:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/init",function(){return n(30483)}])},81208:function(e,t,n){"use strict";var r=n(85893),l=n(67294),i=n(99576);let s={count:0,defaultMessageType:"info",messages:void 0,onSet:void 0,usePlaceholder:!0},a=(0,l.forwardRef)((e,t)=>{let{count:n=s.count,defaultMessageType:a=s.defaultMessageType,messages:o,onSet:u,usePlaceholder:c=s.usePlaceholder}=e,[d,h]=(0,l.useState)({}),m=(0,l.useMemo)(()=>({...o,...d}),[o,d]),f=(0,l.useCallback)(e=>void 0!==m[e],[m]),x=(0,l.useCallback)((e,t)=>{let n=0;h(r=>{let{[e]:l,...i}=r;return t&&(i[e]=t),n=Object.keys(i).length,i}),null==u||u.call(null,n)},[u]),g=(0,l.useCallback)((e,t)=>{let n=0,r=t?(e,r)=>{e[r]=t,n+=1}:void 0;h(t=>{let l={};return Object.keys(t).forEach(i=>{e.test(i)?null==r||r.call(null,l,i):(l[i]=t[i],n+=1)}),l}),null==u||u.call(null,n)},[u]),v=(0,l.useMemo)(()=>{let e=Object.entries(m),t=n>0,l=t?n:e.length,s=[];if(e.every(e=>{let[t,n]=e,{children:o,type:u=a}=n;return s.push((0,r.jsx)(i.Z,{type:u,children:o},"message-".concat(t))),s.length({exists:f,setMessage:x,setMessageRe:g}),[f,x,g]),(0,r.jsx)(r.Fragment,{children:v})});a.defaultProps=s,a.displayName="MessageGroup",t.Z=a},14879:function(e,t){"use strict";t.Z={boolean:e=>!!e,number:e=>parseInt(String(e),10)||0,string:e=>String(e)}},52675:function(e,t,n){"use strict";n.d(t,{_:function(){return a},dg:function(){return o},qY:function(){return d},Gn:function(){return h},LT:function(){return j},BD:function(){return p},X7:function(){return b},HJ:function(){return s},SQ:function(){return u}});var r=n(85893),l=n(38189),i=n(59278),s=e=>{let{value:t}=e;return!!t&&String(t).length>0},a=function(e,t){let{isRequired:n,onFinishBatch:i,...a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;return{defaults:{...a,onSuccess:t},isRequired:n,onFinishBatch:i,tests:[{test:s},{onFailure:function(){for(var t=arguments.length,n=Array(t),l=0;l{let{value:t}=e;return l.tf.test(t)}}]}},o=function(e,t){let{isRequired:n,onFinishBatch:i,...a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;return{defaults:{...a,onSuccess:t},isRequired:n,onFinishBatch:i,tests:[{test:s},{onFailure:function(){for(var t=arguments.length,n=Array(t),l=0;l{let{value:t}=e;return l.ah.test(t)}}]}},u=e=>{let{max:t,min:n,value:r}=e;return!!r&&r>=n&&r<=t},c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"parseInt";return"number"==typeof e?e:Number[t](String(e))},d=function(e,t){let{isRequired:n,onFinishBatch:l,...i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,d=[];return s?d.push({onFailure:function(){for(var t=arguments.length,n=Array(t),l=0;l{let{value:t}=e;return Number.isSafeInteger(c(t))}}):a&&d.push({onFailure:function(){for(var t=arguments.length,n=Array(t),l=0;l{let{value:t}=e;return Number.isFinite(c(t,"parseFloat"))}}),o&&d.push({onFailure:function(){for(var t=arguments.length,n=Array(t),l=0;l2&&void 0!==arguments[2]?arguments[2]:{},u=arguments.length>3?arguments[3]:void 0;return{defaults:{...o,onSuccess:t},isRequired:n,onFinishBatch:a,tests:[{test:s},{onFailure:function(){for(var t=arguments.length,n=Array(t),l=0;l"}),"), curly brackets (",(0,r.jsx)(i.Q0,{inheritColour:!0,text:"{}"}),")."]}),...n)},test:e=>{let{value:t}=e;return l.OU.test(t)}}]}};let m=()=>({}),f=e=>{let{onFailure:t,onSuccess:n}=e;return{cbFailure:t,cbSuccess:n}},x=e=>{let{isIgnoreOnCallbacks:t,onFinishBatch:n}=e;return t?{setTestCallbacks:m}:{cbFinishBatch:n,setTestCallbacks:f}},g=(e,t)=>null!=e?e:t,v=(e,t)=>e||t;var p=function(){let{excludeTestIds:e=[],excludeTestIdsRe:t,inputs:n={},isContinueOnFailure:r,isIgnoreOnCallbacks:l,isTestAll:i=0===Object.keys(n).length,tests:s={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=[...e],o={},u=!0;return i&&Object.keys(s).forEach(e=>{o[e]={}}),o={...o,...n},t&&Object.keys(o).forEach(e=>{t.test(e)&&a.push(e)}),a.forEach(e=>{delete o[e]}),Object.keys(o).every(e=>{let{defaults:{compare:t=[],displayMax:n,displayMin:i,getCompare:a,getValue:c,isIgnoreOnCallbacks:d=l,max:h=0,min:m=0,onSuccess:f,value:p=null}={},isRequired:j=!1,onFinishBatch:b,optionalTests:P,tests:y}=s[e],{getCompare:Z=a,getValue:k=c,isIgnoreOnCallbacks:C=d,max:w=h,min:N=m,compare:S=g(null==Z?void 0:Z.call(null),t),value:A=g(null==k?void 0:k.call(null),p),displayMax:F=v(n,String(w)),displayMin:V=v(i,String(N))}=o[e],{cbFinishBatch:O,setTestCallbacks:R}=x({isIgnoreOnCallbacks:C,onFinishBatch:b});if(!A&&!j)return null==O||O.call(null,!0,e),!0;let z=e=>{let{onFailure:t,onSuccess:n=f,test:r}=e,l={},i=r({append:l,compare:S,max:w,min:N,value:A}),{cbFailure:s,cbSuccess:a}=R({onFailure:t,onSuccess:n});return i?null==a||a.call(null,{append:l}):(u=i,null==s||s.call(null,{append:l,compare:S,displayMax:F,displayMin:V,max:w,min:N,value:A})),i};null==P||P.forEach(z);let I=y.every(z);return null==O||O.call(null,I,e),I||r}),u},j=function(e){let{excludeTestIds:t=[],...n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(){let{excludeTestIds:r=[],...l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return p({tests:e,excludeTestIds:[...t,...r],...n,...l})}},b=e=>{let{max:t,min:n}=e;return t>=n}},30483:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return D}});var r=n(85893),l=n(14440),i=n(19338),s=n(99514),a=n(11163),o=n(67294),u=n(92230),c=n(77831),d=n(98484),h=n(77583),m=n(99429),f=n(56903),x=n(20869),g=n(37842),v=n(38189),p=n(28293),j=n(99576),b=n(81208),P=n(91029),y=function(e){let{fillString:t="0",maxLength:n=2,which:r="Start"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return String(e)["pad".concat(r)](n,t)};let Z={show:!0},k=e=>{let{onClick:t,show:n=Z.show,...l}=e;return n?(0,r.jsx)(m.Z,{onClick:t,tabIndex:-1,...l,children:"Suggest"}):(0,r.jsx)(r.Fragment,{})};k.defaultProps=Z;var C=n(52675),w=n(59278);let N={adminPassword:"adminPassword",confirmAdminPassword:"confirmAdminPassword",domainName:"domainName",hostName:"hostName",hostNumber:"hostNumber",organizationName:"organizationName",organizationPrefix:"organizationPrefix"},S={0:()=>"",1:e=>{let[t]=e;return t.substring(0,1).toLocaleLowerCase()},2:e=>e.map(e=>e.substring(0,1).toLocaleLowerCase()).join("")},A=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split(/\s/).filter(e=>!/and|of/.test(e)).slice(0,5);return S[t.length>1?2:t.length](t)},F=e=>{let{organizationPrefix:t,hostNumber:n,domainName:r}=e;return[t,n,r].every(e=>!!e)?"".concat(t,"-striker").concat(y(n),".").concat(r):""},V=(0,o.forwardRef)((e,t)=>{var n,l,i,a;let{expectHostDetail:u=!1,hostDetail:c,onHostNumberBlurAppend:d,toggleSubmitDisabled:h}=e,[m,y]=(0,o.useState)(),[Z,S]=(0,o.useState)(!1),[V,O]=(0,o.useState)(!1),[R,z]=(0,o.useState)(!0),I=(0,o.useRef)(!0),H=(0,o.useRef)({}),T=(0,o.useRef)({}),_=(0,o.useRef)({}),q=(0,o.useRef)({}),M=(0,o.useRef)({}),D=(0,o.useRef)({}),Q=(0,o.useRef)({}),L=(0,o.useRef)({}),E=(0,o.useCallback)(e=>{var t;return null===(t=L.current.setMessage)||void 0===t?void 0:t.call(null,N.organizationPrefix,e)},[]),B=(0,o.useCallback)(e=>{var t;return null===(t=L.current.setMessage)||void 0===t?void 0:t.call(null,N.hostNumber,e)},[]),$=(0,o.useCallback)(e=>{var t;return null===(t=L.current.setMessage)||void 0===t?void 0:t.call(null,N.domainName,e)},[]),U=(0,o.useCallback)(e=>{var t;return null===(t=L.current.setMessage)||void 0===t?void 0:t.call(null,N.hostName,e)},[]),J=(0,o.useCallback)(e=>{var t;return null===(t=L.current.setMessage)||void 0===t?void 0:t.call(null,N.adminPassword,e)},[]),G=(0,o.useCallback)(e=>{var t;return null===(t=L.current.setMessage)||void 0===t?void 0:t.call(null,N.confirmAdminPassword,e)},[]),W=(0,o.useMemo)(()=>({[N.adminPassword]:{defaults:{getValue:()=>{var e;return null===(e=H.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:()=>{J(void 0)}},isRequired:!0,tests:[{onFailure:()=>{J({children:(0,r.jsxs)(r.Fragment,{children:["Admin password cannot contain single-quote (",(0,r.jsx)(w.Q0,{text:"'"}),"), double-quote (",(0,r.jsx)(w.Q0,{text:'"'}),"), slash (",(0,r.jsx)(w.Q0,{text:"/"}),"), backslash (",(0,r.jsx)(w.Q0,{text:"\\"}),"), angle brackets (",(0,r.jsx)(w.Q0,{text:"<>"}),"), curly brackets (",(0,r.jsx)(w.Q0,{text:"{}"}),")."]})})},test:e=>{let{value:t}=e;return!/['"/\\><}{]/g.test(t)}},{test:C.HJ}]},[N.confirmAdminPassword]:{defaults:{getValue:()=>{var e,t;return null===(t=T.current)||void 0===t?void 0:null===(e=t.getValue)||void 0===e?void 0:e.call(null)},onSuccess:()=>{G(void 0)}},isRequired:!0,tests:[{onFailure:()=>{G({children:"Confirmation doesn't match admin password."})},test:e=>{var t;let{value:n}=e;return n===(null===(t=H.current.getValue)||void 0===t?void 0:t.call(null))}},{test:C.HJ}]},[N.domainName]:{defaults:{compare:[!R],getValue:()=>{var e;return null===(e=M.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:()=>{$(void 0)}},isRequired:!0,tests:[{onFailure:()=>{$({children:(0,r.jsxs)(r.Fragment,{children:["Domain name can only contain lowercase alphanumeric, hyphen (",(0,r.jsx)(w.Q0,{text:"-"}),"), and dot (",(0,r.jsx)(w.Q0,{text:"."}),") characters."]})})},test:e=>{let{compare:t,value:n}=e;return t[0]||v.FZ.test(n)}},{test:C.HJ}]},[N.hostName]:{defaults:{compare:[!R],getValue:()=>{var e;return null===(e=Q.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:()=>{U(void 0)}},isRequired:!0,tests:[{onFailure:()=>{U({children:(0,r.jsxs)(r.Fragment,{children:["Host name can only contain lowercase alphanumeric, hyphen (",(0,r.jsx)(w.Q0,{text:"-"}),"), and dot (",(0,r.jsx)(w.Q0,{text:"."}),") characters."]})})},test:e=>{let{compare:t,value:n}=e;return t[0]||v.FZ.test(n)}},{test:C.HJ}]},[N.hostNumber]:{defaults:{getValue:()=>{var e;return null===(e=D.current.getValue)||void 0===e?void 0:e.call(null)},onSuccess:()=>{B(void 0)}},isRequired:!0,tests:[{onFailure:()=>{B({children:"Striker number can only contain digits."})},test:e=>{let{value:t}=e;return/^\d+$/.test(t)}},{test:C.HJ}]},[N.organizationName]:{defaults:{getValue:()=>{var e;return null===(e=_.current.getValue)||void 0===e?void 0:e.call(null)}},isRequired:!0,tests:[{test:C.HJ}]},[N.organizationPrefix]:{defaults:{getValue:()=>{var e;return null===(e=q.current.getValue)||void 0===e?void 0:e.call(null)},max:5,min:1,onSuccess:()=>{E(void 0)}},isRequired:!0,tests:[{onFailure:e=>{let{max:t,min:n}=e;E({children:"Organization prefix must be ".concat(n," to ").concat(t," lowercase alphanumeric characters.")})},test:e=>{let{max:t,min:n,value:r}=e;return RegExp("^[a-z0-9]{".concat(n,",").concat(t,"}$")).test(r)}}]}}),[R,J,G,$,U,B,E]),X=(0,o.useMemo)(()=>(0,C.LT)(W),[W]),Y=(0,o.useCallback)(function(){let{excludeTestIds:e=[],inputs:t,isContinueOnFailure:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};null==h||h.call(null,X({excludeTestIds:e,inputs:t,isContinueOnFailure:n,isIgnoreOnCallbacks:!0,isTestAll:!0}))},[X,h]),K=(0,o.useCallback)(function(){var e;let{organizationName:t=null===(n=_.current.getValue)||void 0===n?void 0:n.call(null)}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=A(t);return null===(e=q.current.setValue)||void 0===e||e.call(null,r),Y({inputs:{[N.organizationPrefix]:{isIgnoreOnCallbacks:!1,value:r}},isContinueOnFailure:!0}),r},[Y]),ee=(0,o.useCallback)(function(){var e;let{organizationPrefix:t=null===(l=q.current.getValue)||void 0===l?void 0:l.call(null),hostNumber:n=null===(i=D.current.getValue)||void 0===i?void 0:i.call(null),domainName:r=null===(a=M.current.getValue)||void 0===a?void 0:a.call(null)}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=F({organizationPrefix:t,hostNumber:n,domainName:r});return null===(e=Q.current.setValue)||void 0===e||e.call(null,s),Y({inputs:{[N.hostName]:{isIgnoreOnCallbacks:!1,value:s}},isContinueOnFailure:!0}),s},[Y]),et=(0,o.useCallback)(()=>{var e;return!!(null===(e=_.current.getValue)||void 0===e?void 0:e.call(null))},[]),en=(0,o.useCallback)(()=>{var e,t,n;return[null===(e=q.current.getValue)||void 0===e?void 0:e.call(null),null===(t=D.current.getValue)||void 0===t?void 0:t.call(null),null===(n=M.current.getValue)||void 0===n?void 0:n.call(null)].every(e=>!!e)},[]),er=(0,o.useCallback)(()=>{var e;(null===(e=q.current.getIsChangedByUser)||void 0===e?void 0:e.call(null))?S(et()):K()},[et,K]),el=(0,o.useCallback)(()=>{var e;(null===(e=Q.current.getIsChangedByUser)||void 0===e?void 0:e.call(null))?O(en()):ee()},[en,ee]),ei=(0,o.useCallback)(()=>{var e;let t=K();(null===(e=Q.current.getIsChangedByUser)||void 0===e?void 0:e.call(null))||ee({organizationPrefix:t})},[ee,K]),es=(0,o.useCallback)(()=>{ee()},[ee]),ea=(0,o.useCallback)(e=>t=>t===e?void 0:e,[]),eo=(0,o.useMemo)(()=>(0,r.jsx)(x.Z,{checked:R,onChange:(e,t)=>{z(t),Y({inputs:{[N.domainName]:{compare:[!t],isIgnoreOnCallbacks:!1},[N.hostName]:{compare:[!t],isIgnoreOnCallbacks:!1}},isContinueOnFailure:!0})},sx:{padding:".2em"}}),[R,Y]);return(0,o.useEffect)(()=>{if([u,c,I.current,M.current,Q.current,D.current,_.current,q.current].every(e=>!!e)){var e,t,n,r,l;I.current=!1;let{domain:i,hostName:s,organization:a,prefix:o,sequence:u}=c;null===(e=M.current.setValue)||void 0===e||e.call(null,i),null===(t=Q.current.setValue)||void 0===t||t.call(null,s),null===(n=D.current.setValue)||void 0===n||n.call(null,u),null===(r=_.current.setValue)||void 0===r||r.call(null,a),null===(l=q.current.setValue)||void 0===l||l.call(null,o),Y()}},[u,c,Y]),(0,o.useImperativeHandle)(t,()=>({get:()=>{var e,t,n,r,l,i;return{adminPassword:null===(e=H.current.getValue)||void 0===e?void 0:e.call(null),organizationName:null===(t=_.current.getValue)||void 0===t?void 0:t.call(null),organizationPrefix:null===(n=q.current.getValue)||void 0===n?void 0:n.call(null),domainName:null===(r=M.current.getValue)||void 0===r?void 0:r.call(null),hostNumber:null===(l=D.current.getValue)||void 0===l?void 0:l.call(null),hostName:null===(i=Q.current.getValue)||void 0===i?void 0:i.call(null)}}})),(0,r.jsxs)(f.Z,{children:[(0,r.jsxs)(s.ZP,{columns:{xs:1,sm:2,md:3},container:!0,spacing:"1em",children:[(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsxs)(f.Z,{children:[(0,r.jsx)(p.Z,{input:(0,r.jsx)(P.Z,{id:"striker-init-general-organization-name",inputProps:{onBlur:er},inputLabelProps:{isNotifyRequired:!0},label:"Organization name",onChange:()=>{Y()},onHelp:()=>{y(ea("Name of the organization that maintains this Anvil! system. You can enter anything that makes sense to you."))}}),ref:_}),(0,r.jsxs)(f.Z,{row:!0,sx:{"& > :first-child":{flexGrow:1}},children:[(0,r.jsx)(p.Z,{input:(0,r.jsx)(P.Z,{id:"striker-init-general-organization-prefix",inputProps:{endAdornment:(0,r.jsx)(k,{show:Z,onClick:ei}),inputProps:{maxLength:5,sx:{minWidth:"2.5em"}},onBlur:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{let{target:{value:t}}=e;Y({inputs:{[N.organizationPrefix]:{value:t}}}),E(),S(et())},onHelp:()=>{y(ea("Alphanumberic short-form of the organization name. It's used as the prefix for host names."))}}),ref:q}),(0,r.jsx)(p.Z,{input:(0,r.jsx)(P.Z,{id:"striker-init-general-host-number",inputProps:{inputProps:{maxLength:2,sx:{minWidth:"2em"}},onBlur:function(){for(var e=arguments.length,t=Array(e),n=0;n{let{target:{value:t}}=e;Y({inputs:{[N.hostNumber]:{value:t}}}),B()},onHelp:()=>{y(ea("Number or count of this striker; this should be '1' for the first striker, '2' for the second striker, and such."))}}),ref:D,valueType:"number"})]})]})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsxs)(f.Z,{children:[(0,r.jsx)(p.Z,{input:(0,r.jsx)(P.Z,{id:"striker-init-general-domain-name",inputProps:{onBlur:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{let{target:{value:t}}=e;Y({inputs:{[N.domainName]:{value:t}}}),$()},onHelp:()=>{y(ea("Domain name for this striker. It's also the default domain used when creating new install manifests."))}}),ref:M}),(0,r.jsx)(p.Z,{input:(0,r.jsx)(P.Z,{id:"striker-init-general-host-name",inputProps:{endAdornment:(0,r.jsx)(k,{show:V,onClick:es}),onBlur:e=>{let{target:{value:t}}=e;X({inputs:{[N.hostName]:{value:t}}})}},inputLabelProps:{isNotifyRequired:!0},label:"Host name",onChange:e=>{let{target:{value:t}}=e;Y({inputs:{[N.hostName]:{value:t}}}),U(),O(en())},onHelp:()=>{y(ea("Host name for this striker. It's usually a good idea to use the auto-generated value."))}}),ref:Q})]})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,sm:2,md:1,children:(0,r.jsxs)(s.ZP,{columns:{xs:1,sm:2,md:1},container:!0,spacing:"1em",sx:{"& > * > *":{width:"100%"}},children:[(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(p.Z,{input:(0,r.jsx)(P.Z,{disableAutofill:!0,id:"striker-init-general-admin-password",inputProps:{inputProps:{type:g.Z.password},onBlur:e=>{let{target:{value:t}}=e;X({inputs:{[N.adminPassword]:{value:t}}})}},inputLabelProps:{isNotifyRequired:!0},label:"Admin password",onChange:e=>{let{target:{value:t}}=e;Y({inputs:{[N.adminPassword]:{value:t}}}),J()},onHelp:()=>{y(ea("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:H})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(p.Z,{input:(0,r.jsx)(P.Z,{disableAutofill:!0,id:"striker-init-general-confirm-admin-password",inputProps:{inputProps:{type:g.Z.password},onBlur:e=>{let{target:{value:t}}=e;X({inputs:{[N.confirmAdminPassword]:{value:t}}})}},inputLabelProps:{isNotifyRequired:!0},label:"Confirm password",onChange:e=>{let{target:{value:t}}=e;Y({inputs:{[N.confirmAdminPassword]:{value:t}}}),G()}}),ref:T})})]})})]}),(0,r.jsx)(b.Z,{count:1,defaultMessageType:"warning",ref:L}),(0,r.jsx)(j.Z,{children:(0,r.jsxs)(f.Z,{row:!0,sx:{"& > :last-child":{flexGrow:1}},children:[eo,(0,r.jsx)(w.Ac,{inverted:!0,children:R?"Uncheck to skip domain and host name pattern validation.":"Check to re-enable domain and host name pattern validation."})]})}),m&&(0,r.jsx)(j.Z,{onClose:()=>{y(void 0)},children:m})]})});V.defaultProps={expectHostDetail:!1,hostDetail:void 0,onHostNumberBlurAppend:void 0,toggleSubmitDisabled:void 0},V.displayName="GeneralInitForm";var O=n(97607),R=n(65895),z=n(85838),I=n(39333),H=n(86549),T=n(4244),_=n(23930),q=n(25137),M=()=>{var e;let{isReady:t,query:{re:n}}=(0,a.useRouter)(),[l,x]=(0,o.useState)(),[g,v]=(0,o.useState)(),[p,b]=(0,o.useState)(!1),[P,y]=(0,o.useState)(!0),[Z,k]=(0,o.useState)(!1),[C,N]=(0,o.useState)(!1),[S,A]=(0,o.useState)(!1),[F,M]=(0,o.useState)(),[D,Q]=(0,o.useState)(),L=(0,o.useRef)(!0),E=(0,o.useRef)({}),B=(0,o.useRef)({}),$=(0,o.useRef)({}),U=(0,o.useRef)({}),[J,G]=(0,o.useState)("Loading..."),W=(0,o.useMemo)(()=>!!n,[n]),X=(0,o.useMemo)(()=>S?(0,r.jsx)(q.Z,{}):(0,r.jsx)(f.Z,{row:!0,sx:{flexDirection:"row-reverse"},children:(0,r.jsx)(m.Z,{disabled:P,onClick:()=>{var e,t,n,r;v({...null!==(n=null===(e=E.current.get)||void 0===e?void 0:e.call(null))&&void 0!==n?n:{},...null!==(r=null===(t=B.current.get)||void 0===t?void 0:t.call(null))&&void 0!==r?r:{networks:[]}}),b(!0)},children:"Initialize"})}),[P,S]),Y=(0,o.useCallback)(function(){for(var e=arguments.length,t=Array(e),n=0;ne))},[]);return(0,o.useEffect)(()=>{if(t){if(!W){G("Initialize striker");return}L.current&&(L.current=!1,d.Z.get("/host/local").then(e=>{let{data:t}=e;Q(t),G("Reconfigure ".concat(t.shortHostName))}).catch(e=>{let t=(0,O.Z)(e);t.children=(0,r.jsxs)(r.Fragment,{children:["Failed to get host detail data. ",t.children]}),x(t)}))}},[t,W,Q]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(_.s_,{children:[(0,r.jsxs)(_.V9,{children:[(0,r.jsx)(w.z,{children:J}),(0,r.jsx)(R.Z,{onClick:e=>{var t,n;let{currentTarget:r}=e;null===(t=U.current.setAnchor)||void 0===t||t.call(null,r),null===(n=U.current.setOpen)||void 0===n||n.call(null,!0)},variant:"normal",children:(0,r.jsx)(z.Z,{icon:i.Z,ref:$})})]}),(0,r.jsxs)(f.Z,{children:[(0,r.jsx)(V,{expectHostDetail:W,hostDetail:D,onHostNumberBlurAppend:e=>{let{target:{value:t}}=e;M(t)},ref:E,toggleSubmitDisabled:e=>{e!==Z&&(k(e),Y(e,C))}}),(0,r.jsx)(T.Z,{expectHostDetail:W,hostDetail:D,hostSequence:F,ref:B,toggleSubmitDisabled:e=>{e!==C&&(N(e),Y(Z,e))}}),l&&(0,r.jsx)(j.Z,{...l,onClose:()=>x(void 0)}),X]})]}),(0,r.jsx)(h.Z,{actionProceedText:"Initialize",content:(0,r.jsxs)(s.ZP,{container:!0,spacing:".6em",columns:{xs:2},children:[(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.Ac,{children:"Organization name"})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.$_,{children:null==g?void 0:g.organizationName})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.Ac,{children:"Organization prefix"})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.$_,{children:null==g?void 0:g.organizationPrefix})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.Ac,{children:"Striker number"})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.$_,{children:null==g?void 0:g.hostNumber})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.Ac,{children:"Domain name"})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.$_,{children:null==g?void 0:g.domainName})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.Ac,{children:"Host name"})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.$_,{children:null==g?void 0:g.hostName})}),(0,r.jsx)(s.ZP,{item:!0,sx:{marginTop:"1.4em"},xs:2,children:(0,r.jsx)(w.Ac,{children:"Networks"})}),null==g?void 0:g.networks.map(e=>{let{inputUUID:t,interfaces:n,ipAddress:l,name:i,subnetMask:a,type:o,typeCount:u}=e;return(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsxs)(s.ZP,{container:!0,spacing:".6em",columns:{xs:2},children:[(0,r.jsx)(s.ZP,{item:!0,xs:2,children:(0,r.jsxs)(w.Ac,{children:[i," (",(0,r.jsx)(w.Q0,{children:"".concat(o.toUpperCase()).concat(u)}),")"]})}),n.map((e,n)=>{let l="network-confirm-".concat(t,"-interface").concat(n),i="none";if(e){let{networkInterfaceName:t,networkInterfaceUUID:n}=e;l="".concat(l,"-").concat(n),i=t}return(0,r.jsxs)(s.ZP,{columns:{xs:2},container:!0,item:!0,children:[(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.Ac,{children:"Link ".concat(n+1)})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.$_,{children:i})})]},l)}),(0,r.jsx)(s.ZP,{item:!0,xs:2,children:(0,r.jsx)(w.$_,{children:"".concat(l,"/").concat(a)})})]})},"network-confirm-".concat(t))}),(0,r.jsx)(s.ZP,{item:!0,sx:{marginBottom:"1.4em"},xs:2}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.Ac,{children:"Gateway"})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.$_,{children:null==g?void 0:g.gateway})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.Ac,{children:"Gateway network"})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.$_,{children:null==g?void 0:null===(e=g.gatewayInterface)||void 0===e?void 0:e.toUpperCase()})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.Ac,{children:"Domain name server(s)"})}),(0,r.jsx)(s.ZP,{item:!0,xs:1,children:(0,r.jsx)(w.$_,{children:null==g?void 0:g.dns})})]}),dialogProps:{open:p},onCancelAppend:()=>{b(!1)},onProceedAppend:()=>{x(void 0),A(!0),b(!1),d.Z.put("/init",g).then(()=>{A(!1),x({children:W?(0,r.jsx)(r.Fragment,{children:"Successfully initiated reconfiguration."}):(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)(H.Z,{href:"/login",sx:{color:c.E5,display:"inline-flex"},children:"login page"}),"."]}),type:"info"})}).catch(e=>{x((0,O.Z)(e)),A(!1)})},titleText:"Confirm striker initialization"}),(0,r.jsx)(I.Z,{getJobUrl:e=>"".concat(u.Z,"/init/job?start=").concat(e),onFetchSuccessAppend:e=>{var t;null===(t=$.current.indicate)||void 0===t||t.call(null,Object.keys(e).length>0)},ref:U})]})},D=()=>(0,r.jsx)(l.Z,{sx:{display:"flex",flexDirection:"column"},children:(0,r.jsx)(M,{})})}},function(e){e.O(0,[572,442,341,514,242,74,982,161,616,762,784,888,774,179],function(){return e(e.s=45844)}),_N_E=e.O()}]);