D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
psa
/
admin
/
cp
/
public
/
javascript
/
views
/
smb
/
web
/
Filename :
setup.js
back
Copy
(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/smb/web/setup"],{1626:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>x});var i=t(285),a=t(596),s=t.n(a),o=t(611),r=t.n(o),d=t(89),l=t(580),c=t(1627),m=t(1629),u=t(1630);t(1632);const p=d.Locale.getTranslate("components.domain-applications.applications"),g=e=>`ext-${e}`,f=({onFieldChange:e,onStepChange:n,formPrefix:a="",wizardConfig:s={enabled:!0,blankSite:!0,uploadFiles:!0,mailHosting:!0},isMailServiceSupported:o,embeddedForms:d=[],extensionButtons:f=[],values:x,children:b=null,entity:h,className:j,...v})=>{const w=(0,l.useLocation)(),[S,y]=(0,i.useState)((()=>new URLSearchParams(w.search).get("appName"))),N=n=>{e("applicationName",n)},k=[s.blankSite&&{name:"blank-site",icon:t(1633),title:(0,i.jsx)(p,{content:"blank-site.title"}),description:(0,i.jsx)(p,{content:"blank-site.description"})},s.uploadFiles&&{name:"upload-files",icon:t(1634),title:(0,i.jsx)(p,{content:"upload-files.title"}),description:(0,i.jsx)(p,{content:"upload-files.description"})},...f.map((({id:e,extensionId:n,title:t,icon:i,description:a})=>({name:g(n),id:e,icon:i,title:t,description:a}))),s.mailHosting&&o&&{name:"mail-hosting",icon:t(1635),title:(0,i.jsx)(p,{content:"mail-hosting.title"}),description:(0,i.jsx)(p,{content:"mail-hosting.description"})}].filter(Boolean),T=x.applicationName?k.find((({name:e})=>e===x.applicationName)):null,I=T&&k.length>1,C=[k.length>1&&{key:"chooseApplicationStep",children:(0,i.jsx)(c.default,{onApplicationSelect:N,applicationsList:k}),nextButton:!1},{key:"addDomainStep",formPrefix:a,children:(0,i.jsxs)(i.Fragment,{children:[I&&(0,i.jsx)(u.default,{icon:T.icon,applicationTitle:T.title,entity:h}),b]}),embeddedForms:d}].filter(Boolean);if((0,i.useEffect)((()=>{if(0===k.length&&N("blank-site"),1===k.length){const[{name:e}]=k;N(e)}}),[]),S&&!x.applicationName&&k.length>1){const e=k.find((({name:e})=>e===S||e===g(S)));e&&N(e.name)}const F=x.applicationName&&1!==C.length?1:0;return(0,i.useEffect)((()=>{n?.(C[F].key)}),[F]),(0,i.jsx)(m.default,{...v,className:r()(j,{"application-wizard-form__with-selected-info":I}),values:x,onFieldChange:e,onStepChange:(n,t)=>0===t&&C.length>1?(e("applicationName",null),S&&(y(null),window.history.replaceState(null,"",w.pathname)),n):t,step:F,steps:C})};f.propTypes={values:s().object.isRequired,className:s().string,onFieldChange:s().func.isRequired,onStepChange:s().func,children:s().node,formPrefix:s().string,wizardConfig:s().shape({enabled:s().bool,blankSite:s().bool,uploadFiles:s().bool}),isMailServiceSupported:s().bool.isRequired,embeddedForms:s().array,extensionButtons:s().array,entity:s().oneOf(["domain","subscription"])};const x=f},1627:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>c});var i=t(286),a=t(596),s=t.n(a),o=t(89),r=(t(1628),t(285));const d=o.Locale.getTranslate("components.domain-applications"),l=({onApplicationSelect:e,applicationsList:n=[]})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Heading,{level:"3",children:(0,r.jsx)(d,{content:"title"})}),(0,r.jsx)(i.ItemList,{minColumnWidth:220,gap:"xs",selectable:!0,stretchable:!0,children:n.map((({id:n,name:t,icon:a,title:s,description:o})=>(0,r.jsx)(i.Item,{"data-action":t,role:"button",icon:(0,r.jsx)(i.Icon,{src:a,intent:"info",size:"48",className:"choose-application-step__icon"}),"data-testid":"listItem","data-cy":n??t,title:(0,r.jsx)(i.Heading,{level:"4",children:s}),onClick:()=>e(t),children:(0,r.jsx)(i.Paragraph,{children:o})},t)))})]});l.propTypes={onApplicationSelect:s().func.isRequired,applicationsList:s().arrayOf(s().shape({name:s().string.isRequired,icon:s().string.isRequired,title:s().node,description:s().node}))};const c=l},1629:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>m});var i=t(286),a=t(285),s=t(1289),o=t(89),r=t(596),d=t.n(r);const l=o.Locale.getTranslate("components.buttons"),c=({step:e=0,steps:n=[],onStepChange:t=(e,n)=>n,onSubmit:o,submitButton:r={},cancelButton:d={},...c})=>{const m=(0,a.useRef)(),[u,p]=(0,a.useState)(0),g=u+e,{children:f,formPrefix:x,embeddedForms:b,backButton:h,nextButton:j}={backButton:{},nextButton:{},...n[g]},v=g===n.length-1,w=0===g,S=n[g]?.key??g,y=()=>{m.current.handleEmbeddedFormValues(),p((n=>t(n+e,n+e-1)-e))},N=()=>{m.current.handleEmbeddedFormValues(),p((n=>t(n+e,n+e+1)-e))},k=()=>m.current.submit();return(0,a.jsx)(s.default,{...c,ref:m,additionalButtons:(()=>{const e=[w&&d&&(0,a.jsx)(i.Button,{id:"btn-cancel","data-type":S,children:(0,a.jsx)(l,{content:"cancel"}),...d},"cancel"),!w&&h&&(0,a.jsx)(i.Button,{id:"btn-back","data-type":S,arrow:"backward",onClick:y,children:(0,a.jsx)(l,{content:"back"}),...h},"back"),!v&&j&&(0,a.jsx)(i.Button,{id:"btn-next","data-type":S,intent:"primary",onClick:N,arrow:"forward",children:(0,a.jsx)(l,{content:"nextWithoutArrow"}),...j},"next")];return v&&r&&e.push((0,a.isValidElement)(r)?(0,a.cloneElement)(r,{handleSubmit:k}):(0,a.jsx)(i.Button,{id:"btn-submit","data-type":S,intent:"primary",arrow:"forward",onClick:k,children:(0,a.jsx)(l,{content:"ok"}),...r},"submit")),e})(),submitButton:!1,onSubmit:v?o:N,onError:i=>{const a=n.findIndex((({formPrefix:e})=>""===e)),s=Object.keys(i).map((e=>{const t=n.findIndex((({formPrefix:n,embeddedForms:t=[]})=>n===e||t.some((({name:n})=>n===e))));return t>=0?t:a}));p(t(g,s.length>0?Math.min(...s):e)-e)},applyButton:!1,cancelButton:!1,formPrefix:x,embeddedForms:b,children:f})};c.propTypes={step:d().number,steps:d().arrayOf(d().shape({formPrefix:d().string,embeddedForms:d().array,children:d().node,nextButton:d().bool,backButton:d().bool,key:d().string})),onStepChange:d().func,onSubmit:d().func,submitButton:d().object,cancelButton:d().object};const m=c},1630:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>m});var i=t(596),a=t.n(i),s=t(89),o=t(286),r=(t(1631),t(285));const d=s.Locale.getTranslate("components.domain-applications.applications"),l=s.Locale.getSection("components.domain-applications.applications"),c=({icon:e,entity:n="domain",applicationTitle:t})=>(0,r.jsxs)("div",{className:"application-wizard-selected-application-info",children:[(0,r.jsx)(o.Icon,{src:e,size:"32",alt:l.lmsg("selectedOptionIcon")}),(0,r.jsx)(d,{component:"div",content:"selectedOption",params:{optionName:(0,r.jsx)(o.Text,{bold:!0,children:t}),entity:l.lmsg(`${n}Entity`)}})]});c.propTypes={icon:a().string.isRequired,applicationTitle:a().node.isRequired,entity:a().oneOf(["domain","subscription"])};const m=c},1625:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>i.default});var i=t(1626)},1417:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>c});var i=t(286),a=t(596),s=t.n(a),o=t(89),r=t(285);const d=o.Locale.getTranslate("components.forms.ip-addresses-selector"),l=({ipAddresses:e,namePrefix:n,type:t,isOtherTypeAvailable:a,getIpAddressType:s,...o})=>{const l=(0,i.useTranslate)("components.forms.ip-addresses-selector");return!!e.length&&(0,r.jsxs)(i.FormFieldSelect,{label:(0,r.jsx)(d,{content:a?`${t}Address`:"ipAddress"}),name:`${n}[${t}]`,...o,children:[e.map((({id:e,ipAddress:n,publicIpAddress:t,type:a})=>(0,r.jsx)(i.SelectOption,{value:e,children:`${t||n}${s(a)}`},e))),a&&(0,r.jsx)(i.SelectOption,{value:"none",children:l("noIpAddressHint")})]},t)};l.propTypes={ipAddresses:s().array.isRequired,namePrefix:s().string.isRequired,type:s().string.isRequired,isOtherTypeAvailable:s().bool.isRequired,getIpAddressType:s().func.isRequired};const c=l},1416:(e,n,t)=>{"use strict";t.r(n),t.d(n,{TYPE_EXCLUSIVE:()=>m,TYPE_IPV4:()=>d,TYPE_IPV6:()=>l,TYPE_SHARED:()=>c,default:()=>p});var i=t(286),a=t(596),s=t.n(a),o=t(285),r=t(1417);const d="ipv4",l="ipv6",c="SHARED",m="EXCLUSIVE",u=({ipAddresses:e,namePrefix:n,isIPv6Supported:t=!0,...a})=>{const s=(0,i.useTranslate)("components.forms.ip-addresses-selector"),u=(0,o.useMemo)((()=>e.filter((({isIPv6:e,isBroken:n})=>!e&&!n))),[e]),p=(0,o.useMemo)((()=>e.filter((({isIPv6:e,isBroken:n})=>e&&!n))),[e]),g=(0,o.useCallback)((e=>{switch(e){case c:return` (${s("shared")})`;case m:return` (${s("exclusive")})`;default:return""}}),[s]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r.default,{ipAddresses:u,namePrefix:n,type:d,isOtherTypeAvailable:t&&!!p.length,getIpAddressType:g,...a}),t&&(0,o.jsx)(r.default,{ipAddresses:p,namePrefix:n,type:l,isOtherTypeAvailable:!!u.length,getIpAddressType:g,...a})]})};u.propTypes={ipAddresses:s().array.isRequired,namePrefix:s().string.isRequired,isIPv6Supported:s().bool};const p=u},1415:(e,n,t)=>{"use strict";t.r(n),t.d(n,{TYPE_EXCLUSIVE:()=>i.TYPE_EXCLUSIVE,TYPE_SHARED:()=>i.TYPE_SHARED,default:()=>i.default,prepareBackendData:()=>a});var i=t(1416);const a=e=>{const n=[];return Object.keys(e).forEach((t=>{Object.keys(e[t]).forEach((a=>{"none"!==a&&n.push({id:a,ipAddress:e[t][a],isIPv6:t===i.TYPE_IPV6})}))})),n}},1623:(e,n,t)=>{"use strict";t.r(n),t.d(n,{TYPE_CUSTOM:()=>c,TYPE_TECH:()=>l,default:()=>x});var i=t(286),a=t(285),s=t(596),o=t.n(s),r=t(89),d=t(1624);const l="tech",c="custom",m=r.Locale.getTranslate("components.forms.domain.tech-domain-name"),u=({isEnabled:e,isDefault:n,url:t,vendor:s,maxDomainLength:o,typeName:r,name:d,ipAddress:u=null,onDomainNameChange:f,onTypeChange:x})=>{const[b,h]=(0,a.useState)(e&&n?l:c);if(!e)return(0,a.jsx)(p,{name:d,isEnabled:!1,onDomainNameChange:f});const j=[{key:c,icon:(0,a.jsx)(i.Icon,{name:"ribbon",intent:"success"})},{key:l,icon:(0,a.jsx)(i.Icon,{name:"rocket",intent:"info"})}];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Section,{title:(0,a.jsx)(m,{content:"title"}),vertical:!0,children:(0,a.jsx)(i.FormField,{name:r,onChange:e=>(e=>{h(e),x(e),f("")})(e),children:({getId:e,getName:n,getValue:t,setValue:s,isDisabled:o})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.ItemList,{stretchable:!0,selectable:!0,minColumnWidth:270,gap:"sm",value:t(),onSelect:e=>{e!==b&&s(e)},children:j.map((({key:e,icon:n})=>(0,a.jsx)(i.Item,{icon:n,role:"button",value:e,"data-action":`use-${e}-domain`,title:(0,a.jsx)(i.Heading,{level:"4",children:(0,a.jsx)(i.Paragraph,{children:(0,a.jsx)(m,{content:`${e}DomainTitle`})})}),disabled:o(),children:(0,a.jsx)(i.Text,{fontSize:"md",children:(0,a.jsx)(m,{content:`${e}DomainText`})})},e)))}),(0,a.jsx)("input",{hidden:!0,id:e(),name:n(),value:t(),readOnly:!0})]})})}),b===l?(0,a.jsx)(g,{name:d,ipAddress:u,url:t,vendor:s,maxDomainLength:o,onDomainNameChange:f}):(0,a.jsx)(p,{name:d,isEnabled:!0,onDomainNameChange:f})]})},p=({name:e,isEnabled:n,onDomainNameChange:t})=>(0,a.jsx)(i.Section,{vertical:!0,children:(0,a.jsx)(d.default,{name:e,label:n?(0,a.jsx)(m,{content:"customDomain"}):(0,a.jsx)(m,{content:"domainName"}),onChange:t,required:!0})});p.propTypes={name:o().string.isRequired,isEnabled:o().bool.isRequired,onDomainNameChange:o().func.isRequired};const g=({name:e,onDomainNameChange:n,...t})=>(0,a.jsx)(i.Section,{vertical:!0,children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.FormField,{label:(0,a.jsx)(m,{content:"techDomain"}),name:e,onChange:e=>n(e),children:({getId:e,getName:n,...i})=>(0,a.jsx)(f,{id:e(),name:n(),...i,...t})}),(0,a.jsxs)(i.Cuttable,{maxHeight:24,children:[(0,a.jsx)(i.Paragraph,{children:(0,a.jsx)(m,{content:"techDomainDesc"})}),(0,a.jsxs)("ul",{children:[(0,a.jsx)("li",{children:(0,a.jsx)(m,{content:"techDomainRandom"})}),(0,a.jsx)("li",{children:(0,a.jsx)(m,{content:"techDomainDns"})})]}),(0,a.jsx)(i.Paragraph,{children:(0,a.jsx)(m,{content:"techDomainSwitch"})})]})]})});g.propTypes={name:o().string.isRequired,onDomainNameChange:o().func.isRequired};const f=({id:e,name:n,ipAddress:t=null,url:s,vendor:o,getValue:r,setValue:d,maxDomainLength:l})=>{const[c,u]=(0,a.useState)(!1),[p,g]=(0,a.useState)(t),[f,x]=(0,a.useState)({}),b=(0,a.useCallback)((async()=>{if(x({}),!r()||t!==p)if(t){u(!0);try{const e=await(async({url:e,ipAddress:n,vendor:t,maxDomainLength:i})=>{const a=await fetch(e,{method:"POST",body:JSON.stringify({ip_address:n,vendor:t,max_length:i})}),{subdomain:s}=await a.json();if(!s)throw new Error("subdomain is empty");return s})({url:s,ipAddress:t,vendor:o,maxDomainLength:l});d(e),g(t)}catch{x({error:(0,a.jsx)(m,{content:"error"})})}finally{u(!1)}}else x({noIpAddress:(0,a.jsx)(m,{content:"errorNoIpAddress"})})}),[r,d,t,p,s,o,l]);return(0,a.useEffect)((()=>{b()}),[t]),(0,a.jsxs)(a.Fragment,{children:[c?(0,a.jsx)(i.Status,{progress:!0,children:(0,a.jsx)(m,{content:"generating"})}):(0,a.jsx)(i.Text,{bold:!0,children:r()}),(0,a.jsx)("input",{hidden:!0,id:e,name:n,value:r(),readOnly:!0}),Object.keys(f).map((e=>(0,a.jsxs)(i.Alert,{intent:"danger",children:[(0,a.jsx)(i.Icon,{name:"exclamation-mark-circle-filled",intent:"danger"})," ",f[e]]},e)))]})};f.propTypes={id:o().string.isRequired,name:o().string.isRequired,ipAddress:o().string,url:o().string.isRequired,vendor:o().string.isRequired,maxDomainLength:o().number.isRequired,getValue:o().func.isRequired,setValue:o().func.isRequired},u.propTypes={isEnabled:o().bool.isRequired,isDefault:o().bool.isRequired,url:o().string.isRequired,vendor:o().string.isRequired,maxDomainLength:o().number.isRequired,typeName:o().string.isRequired,name:o().string.isRequired,ipAddress:o().string,onDomainNameChange:o().func.isRequired,onTypeChange:o().func.isRequired};const x=u},1624:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>d});var i=t(286),a=t(596),s=t.n(a),o=t(285);const r=({size:e="lg",...n})=>(0,o.jsx)(i.FormField,{...n,children:({getId:n,getName:t,getValue:a,setValue:s,isDisabled:r})=>(0,o.jsxs)("div",{className:"composite-field",children:[(0,o.jsx)(i.Text,{className:"composite-field__prefix",children:"www. "}),(0,o.jsx)(i.Input,{id:n(),name:t(),value:a(),placeholder:"domain.name",size:e,onChange:e=>s(e.target.value),disabled:r()})]})});r.propTypes={size:s().string};const d=r},1412:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>m});var i=t(596),a=t.n(i),s=t(286),o=t(1413),r=t(89),d=t(285);const l=r.Locale.getSection("components.elements.lookup"),c=({data:e,dataUrl:n,lookUpParams:t,newItemValue:i,locale:a,placeholder:r,...c})=>(0,d.jsx)(s.FormField,{...c,children:({getId:s,getName:c,getValue:m,setValue:u,isDisabled:p})=>(0,d.jsx)(o.default,{id:s(),name:c(),value:m(),onChange:e=>u(e),data:e,dataUrl:n,lookUpParams:t,newItemValue:i,locale:{...l.messages,...a},disabled:p(),placeholder:r})});c.propTypes={locale:a().object,data:a().array,dataUrl:a().string,lookUpParams:a().object,newItemValue:a().object,placeholder:a().string};const m=c},1622:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>F,useAddDomainFormInDrawer:()=>C});var i=t(285),a=t(596),s=t.n(a),o=t(588),r=t(580),d=t(89),l=t(286),c=t(620),m=t(536),u=t(1623),p=t(1289),g=t(1412),f=t(1625),x=t(1636),b=t.n(x),h=t(1637),j=t(1415);const v=d.Locale.getSection("smb.components.forms.web.add-domain"),w=d.Locale.getTranslate("smb.components.forms.web.add-domain"),S=d.Locale.getTranslate("smb.components.forms.domain-info-section"),y=d.Locale.getTranslate("smb.components.forms.web._shared"),N=d.Locale.getTranslate("admin.components.forms.admin-panel.form.contact-info"),k=d.Locale.getTranslate("components.buttons"),T=d.Locale.getTranslate("admin.components.forms.admin-panel.form.login-info"),I=({id:e,webspaceIpAddress:n=null,webspaceIpAddresses:t,allowCustomerCreation:a=!1,allowWebspaceCreation:s=!1,subscriptionsLookUpParams:c=null,canManageMailSettings:x=!1,maxSysnameSize:I,isWindows:C,techDomain:F,settingsEnabled:D=!1,settingsCollapsed:A=!1,applicationWizardConfig:E={},isMailServiceSupported:q=!1,embeddedForms:P,extensionButtons:R=[],cancelLink:L=null,className:V,render:B,onProcess:H,onToggleDomainSettings:_,status:O,...U})=>{const z=(0,o.useApolloClient)(),M=(0,r.useNavigate)(),[$,W]=(0,i.useState)(U.values),[Y,G]=(0,i.useState)(Boolean(U.values.hostingSettings.root)),[J,X]=(0,i.useState)(!U.values.domainInfo),[Q,Z]=(0,i.useState)(n),[K,ee]=(0,i.useState)(t),ne=t,te=(0,i.useMemo)((()=>"mail-hosting"===$.applicationName),[$.applicationName]);(0,i.useEffect)((()=>{te&&(W((0,l.setIn)($,"hostingType[hosting]","none")),X(!0))}),[te]),(0,i.useEffect)((()=>{if(Y)return;let e=$.domainName.name.replace(/\*/g,"_");-1!==$.hostingSettings.rootPattern.indexOf("<domain>")&&(e=$.hostingSettings.rootPattern.replace("<domain>",e)),W((0,l.setIn)($,"hostingSettings[root]",(0,d.toPunycode)(e)))}),[$.domainName.name]),(0,i.useEffect)((()=>{$.domainName.webspace&&"new"!==$.domainName.webspace.id&&z.query({query:b(),variables:{id:btoa(`Domain:${$.domainName.webspace.id}`)}}).then((({data:{domain:{ipAddresses:e}}})=>{const{publicIpAddress:n,ipAddress:t}=e[0];Z(n||t)})).catch((({message:e})=>{L&&M(L),(0,m.addToast)({intent:"danger",message:e})}))}),[$.domainName.webspace]);const ie=(e,n)=>{switch(W((t=>{if(t=(0,l.setIn)(t,e,n),"domainName[name]"===e&&!J){const e=(0,h.generateUserName)({domainName:n,maxUserNameSize:I,isTechDomain:t.domainName.type===u.TYPE_TECH,isWindows:C});t=(0,l.setIn)(t,"domainInfo[userName]",e||U.values.domainInfo.userName)}return t})),["domainInfo[ipSelector][ipv4]","domainInfo[ipSelector][ipv6]","domainInfo[userName]","domainInfo[password]"].includes(e)&&d.UAT.dispatchAction("CUSTOM-VALUE",{name:e}),e){case"hostingSettings[root]":G(!0);break;case"domainInfo[userName]":X(!0);break;case"domainName[customer]":ee(n.ipAddresses?n.ipAddresses:ne)}},ae="1"===$.domainName.assignToCustomer||void 0!==$.domainName.targetWebspace||$.domainName.webspace&&"new"===$.domainName.webspace.id,se=ae||!Q?Object.keys(K).map((e=>{const n=$.domainInfo.ipSelector[e];return"none"===n?null:K[e][n]?.split(" ")[0]})).filter(Boolean)[0]:Q,oe=E.enabled?f.default:p.default;return(0,i.jsxs)(oe,{vertical:!0,id:e,className:V,render:B,values:$,onFieldChange:ie,onSubmit:e=>(e.domainName.customer&&(e=(0,l.setIn)(e,"domainName[customer]",e.domainName.customer.id)),e.domainName.webspace&&(e=(0,l.setIn)(e,"domainName[webspace]",e.domainName.webspace.id)),e),onLongTask:H,wizardConfig:E,isMailServiceSupported:q,embeddedForms:P,extensionButtons:R,submitButton:{id:"btn-send",children:(0,i.jsx)(w,{content:"buttonAddDomain"})},applyButton:!1,cancelButton:!!L&&{id:"btn-cancel",children:(0,i.jsx)(k,{content:"cancel"}),onClick:()=>{M(L)}},entity:"domain",children:[(O||[]).filter((({status:e})=>"warning"===e)).map((({content:e})=>(0,i.jsx)(l.StatusMessage,{intent:"warning",children:(0,i.jsx)("div",{dangerouslySetInnerHTML:{__html:e}})},e))),(0,i.jsx)(u.default,{isEnabled:void 0!==$.domainName.type,isDefault:$.domainName.type===u.TYPE_TECH,typeName:"domainName[type]",name:"domainName[name]",ipAddress:se,onTypeChange:e=>ie("domainName[type]",e),onDomainNameChange:e=>ie("domainName[name]",e),...F}),void 0===$.domainName.assignToCustomer?null:(0,i.jsxs)(l.Section,{children:[(0,i.jsx)(l.FormFieldCheckbox,{name:"domainName[assignToCustomer]",label:(0,i.jsx)(w,{content:"assignToCustomer"}),checkedValue:"1",uncheckedValue:"0"}),"1"===$.domainName.assignToCustomer?(0,i.jsxs)(l.Section,{collapsible:!0,children:[void 0===$.domainName.customer?null:(0,i.jsx)(g.default,{name:"domainName[customer]",label:(0,i.jsx)(w,{content:"customer"}),dataUrl:"/admin/customer/look-up",newItemValue:a?{id:"new",title:v.lmsg("createNewCustomer")}:null,locale:{label:v.lmsg("selectExistingCustomer")},required:!0}),void 0===$.domainName.customer||"new"===$.domainName.customer?.id?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.FormFieldText,{name:"customerInfo[customerContactInfo][contactName]",label:(0,i.jsx)(N,{content:"contactName"}),required:!0}),(0,i.jsx)(l.FormFieldText,{name:"customerInfo[customerContactInfo][email]",label:(0,i.jsx)(N,{content:"email"}),required:!0}),(0,i.jsx)("br",{}),(0,i.jsx)(l.Heading,{level:"4",children:(0,i.jsx)(w,{content:"customerLoginInfoHint"})}),(0,i.jsx)(l.FormFieldText,{name:"customerInfo[customerLoginInfo][userName]",label:(0,i.jsx)(T,{content:"userName"}),required:!0,autoComplete:"off"}),(0,i.jsx)(l.FormFieldPassword,{name:"customerInfo[customerLoginInfo][password]",label:(0,i.jsx)(T,{content:"password"}),required:!0,autoComplete:"new-password"}),(0,i.jsx)(l.FormFieldCheckbox,{name:"customerInfo[customerLoginInfo][isActivationRequired]",label:(0,i.jsx)(T,{content:"emailActivation"}),description:(0,i.jsx)(T,{content:"emailActivationHint"}),checkedValue:"1",uncheckedValue:"0"})]}):null]}):null]}),void 0===$.domainName.webspace||"1"===$.domainName.assignToCustomer?null:(0,i.jsx)(l.Section,{children:(0,i.jsx)(g.default,{name:"domainName[webspace]",label:(0,i.jsx)(w,{content:"target"}),dataUrl:"/smb/web/subscription-look-up",newItemValue:s?{id:"new",title:v.lmsg("createNewTarget")}:null,locale:{label:v.lmsg("selectExistingTarget")},lookUpParams:c,required:!0})}),ae?D?(0,i.jsxs)(l.Section,{id:"domainInfo",title:(0,i.jsx)(w,{content:"webspaceLegend"}),collapsible:!0,collapsed:A,onToggle:_,children:[(0,i.jsx)(j.default,{ipAddresses:(0,j.prepareBackendData)(K),namePrefix:"domainInfo[ipSelector]"}),(0,i.jsx)("br",{}),!te&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.Heading,{level:"4",children:(0,i.jsx)(w,{content:"credentials"})}),(0,i.jsx)(l.Text,{component:"p",intent:"muted",children:(0,i.jsx)(w,{content:C?"credentialsHintWin":"credentialsHint"})}),(0,i.jsx)(l.FormFieldText,{name:"domainInfo[userName]",label:(0,i.jsx)(S,{content:"userName"}),required:!0}),(0,i.jsx)(l.FormFieldPassword,{name:"domainInfo[password]",label:(0,i.jsx)(S,{content:"password"}),required:!0})]})]}):null:(0,i.jsxs)(l.Section,{children:[(0,i.jsxs)(l.FormFieldSelect,{name:"hostingType[hosting]",label:(0,i.jsx)(w,{content:"hostingManagementOptions"}),children:[(0,i.jsx)(l.SelectOption,{value:"hosting",label:"hosting",children:(0,i.jsx)(w,{content:"websiteHosting"})}),(0,i.jsx)(l.SelectOption,{value:"forwarding",label:"forwarding",children:(0,i.jsx)(w,{content:"websiteForwarding"})}),(0,i.jsx)(l.SelectOption,{value:"none",label:"none",children:(0,i.jsx)(w,{content:"websiteNoHosting"})})]}),void 0===$.dnsSettings?null:(0,i.jsx)(l.FormFieldCheckbox,{name:"dnsSettings[dns]",label:(0,i.jsx)(w,{content:"dns"}),description:(0,i.jsx)(w,{content:"dnsHint"}),disabled:$.domainName.type===u.TYPE_TECH,checkedValue:$.domainName.type!==u.TYPE_TECH&&"master",uncheckedValue:"none"}),void 0===$.mailSettings?null:(0,i.jsx)(l.FormFieldCheckbox,{name:"mailSettings[mail]",label:(0,i.jsx)(w,{content:"mail"}),description:x?(0,i.jsx)(w,{content:"mailHint"}):(0,i.jsx)(w,{content:"mailHintNoPermission"}),checkedValue:"1",uncheckedValue:"0"}),"hosting"===$.hostingType.hosting?(0,i.jsxs)(l.Section,{id:"hostingSettings",title:(0,i.jsx)(w,{content:"hostingSettingsSectionLegend"}),collapsible:!0,collapsed:!0,children:[(0,i.jsx)(l.FormField,{name:"hostingSettings[root]",label:(0,i.jsx)(y,{content:"documentRoot"}),description:(0,i.jsx)(y,{content:"documentRootHint"}),required:!0,children:({getId:e,getName:n,getValue:t,setValue:a})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.Icon,{name:"home"})," / ",(0,i.jsx)(l.Input,{id:e(),name:n(),value:t(),onChange:({target:e})=>a(e.value)})]})}),(0,i.jsx)(l.FormFieldRadioButtons,{name:"hostingSettings[seoRedirectDirection]",label:(0,i.jsx)(y,{content:"seoRedirectDirection"}),description:(0,i.jsx)(y,{content:"seoRedirectDirectionHint"}),required:!0,options:[{value:"www",label:`www.${$.domainName.name||"<your_domain>"}`},{value:"non-www",label:$.domainName.name||"<your_domain>"},{value:"none",label:(0,i.jsx)(y,{content:"seoRedirectDirectionNone"})}]})]}):null,"forwarding"===$.hostingType.hosting?(0,i.jsxs)(l.Section,{id:"forwardingSettings",title:(0,i.jsx)(y,{content:"forwardingSettingsSectionLegend"}),collapsible:!0,collapsed:!0,children:[(0,i.jsx)(l.FormFieldText,{name:"forwardingSettings[forwardTo]",label:(0,i.jsx)(y,{content:"forwardDestination"}),description:(0,i.jsx)(y,{content:"forwardDestinationHint"}),required:!0}),(0,i.jsx)(l.FormFieldRadioButtons,{name:"forwardingSettings[forwardingType]",label:(0,i.jsx)(y,{content:"forwardingTypeOptions"}),options:[{value:"std_fwd301",label:(0,i.jsx)(y,{content:"forwardingHttpCode301"}),description:(0,i.jsx)(y,{content:"forwardingHttpCode301Hint"})},{value:"std_fwd302",label:(0,i.jsx)(y,{content:"forwardingHttpCode302"}),description:(0,i.jsx)(y,{content:"forwardingHttpCode302Hint"})},{value:"frm_fwd",label:(0,i.jsx)(y,{content:"forwardingFrame"}),description:(0,i.jsx)(y,{content:"forwardingFrameHint"})}]})]}):null]})]})};I.propTypes={id:s().string.isRequired,values:s().object.isRequired,webspaceIpAddresses:s().shape({ipv4:s().object,ipv6:s().object}).isRequired,allowCustomerCreation:s().bool,allowWebspaceCreation:s().bool,subscriptionsLookUpParams:s().object,webspaceIpAddress:s().string,canManageMailSettings:s().bool,maxSysnameSize:s().number.isRequired,isWindows:s().bool.isRequired,techDomain:s().object.isRequired,settingsEnabled:s().bool,settingsCollapsed:s().bool,applicationWizardConfig:s().object,isMailServiceSupported:s().bool,embeddedForms:s().array,extensionButtons:s().array,cancelLink:s().string,className:s().string,render:s().func,onProcess:s().func,onToggleDomainSettings:s().func,status:s().array};const C=(e,n)=>(0,c.useCreateFormInDrawer)(I,"add-domain",e,n),F=I},1413:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>d});var i=t(285),a=t(89),s=t(641),o=t(596);const r=({disabled:e=!1,...n})=>{const[t,o]=(0,i.useState)(null);return(0,i.useEffect)((()=>{const t=new a.LookUp({disabled:e,...n});return o(t),()=>{t.remove(),o(null)}}),[]),(0,i.useEffect)((()=>{t&&(e?t.disable():t.enable())}),[t,e]),t?(0,i.jsx)(s.default,{children:t}):null};r.propTypes={disabled:t.n(o)().bool};const d=r},1637:(e,n,t)=>{"use strict";t.r(n),t.d(n,{generateUserName:()=>s,randomString:()=>i});const i=()=>Math.random().toString(36).slice(2),a=()=>`_${i()}`,s=({domainName:e,maxUserNameSize:n,isTechDomain:t,isWindows:i,postfix:s=a()})=>{let o=e;const r=!i,d=!/^[a-zA-Z0-9_.\-]+$/.test(e),l=/^[0-9]+/.test(e);if("string"!=typeof e||"string"!=typeof s)return"";if(d)return"";if(r&&l)return"";if("number"!=typeof n&&void 0!==n)return"";if(n){if(s.length>n)return"";n-=s.length}return t&&(o=o.split(".")[0]),o=o.toLowerCase().substr(0,n)+s,i&&(o=o.replace(/\.+$/,"")),o}},1831:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>p});var i=t(286),a=t(596),s=t.n(a),o=t(89),r=t(646),d=t(603),l=t(1622),c=t(285);const m=o.Locale.getTranslate("smb.controllers.web.setup"),u=({addDomainUrl:e,openTutorialUrl:n,baseClassName:a="web-setup-panel"})=>{const[s]=(0,l.useAddDomainFormInDrawer)("/smb/web/setup","/smb/web/add-domain/create-webspace/true");return(0,c.jsxs)(c.Fragment,{children:[s,(0,c.jsx)(i.ListEmptyView,{className:a,title:(0,c.jsx)(m,{content:"noDomainTitle"}),description:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(m,{content:"description"}),(0,c.jsx)("br",{}),(0,c.jsx)(m,{content:"openTutorial",params:{link:(0,c.jsx)(r.default,{to:n,target:"_blank",id:"linkOpenTutorial",children:(0,c.jsx)(m,{content:"openTutorialLink"})})}})]}),image:(0,c.jsx)("img",{src:t(1832),width:"408",alt:""}),actions:(0,c.jsx)(i.Button,{component:r.default,to:e,size:"lg",icon:"plus",intent:"primary",id:"buttonAddDomain",children:(0,c.jsx)(m,{content:"addDomain"})})})]})};u.propTypes={addDomainUrl:s().string.isRequired,openTutorialUrl:s().string.isRequired,baseClassName:s().string};const p=(0,d.withPageLayout)(u)},1830:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>i.default});var i=t(1831)},1832:e=>{e.exports=Jsw.skinUrl+"/images/add-domain.png?d190c8c6ec4abdd19916bbce32c98082"},1633:e=>{e.exports=Jsw.skinUrl+"/images/code.svg?d9dcc332aeb03168d77f5fbcc97e7bcb"},1635:e=>{e.exports=Jsw.skinUrl+"/images/mail.svg?e19a5f99ea85bc24608c0601bfe29fcc"},1634:e=>{e.exports=Jsw.skinUrl+"/images/upload-files.svg?3659f9de736ae2576023d51cbfb48963"},1636:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetWebspaceIpAddress"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"domain"},name:{kind:"Name",value:"node"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Domain"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ipAddresses"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicIpAddress"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ipAddress"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:207}};n.loc.source={body:"query GetWebspaceIpAddress($id: ID!) {\n domain: node(id: $id) {\n ... on Domain {\n ipAddresses {\n publicIpAddress\n ipAddress\n }\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function t(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&n.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){t(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){t(e,n)})),e.definitions&&e.definitions.forEach((function(e){t(e,n)}))}var i={};function a(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n,e.exports.GetWebspaceIpAddress=function(e,n){var t={kind:e.kind,definitions:[a(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var s=i[n]||new Set,o=new Set,r=new Set;for(s.forEach((function(e){r.add(e)}));r.size>0;){var d=r;r=new Set,d.forEach((function(e){o.has(e)||(o.add(e),(i[e]||new Set).forEach((function(e){r.add(e)})))}))}return o.forEach((function(n){var i=a(e,n);i&&t.definitions.push(i)})),t}(n,"GetWebspaceIpAddress")},1632:(e,n,t)=>{"use strict";t.r(n)},1628:(e,n,t)=>{"use strict";t.r(n)},1631:(e,n,t)=>{"use strict";t.r(n)}}]); //# sourceMappingURL=setup.js.map?104090238d931947ce93