Viewing File: /usr/local/cpanel/whostmgr/docroot/templates/link-server-nodes/main.js

"use strict";(self.webpackChunklink_server_nodes=self.webpackChunklink_server_nodes||[]).push([[179],{9742:(b,P,c)=>{var v=c(1481),t=c(5062),p=c(6895),F=c(3327),j=c(348),u=c(2904),r=c(4719),g=c(269),L=c(2502);const V=window&&window.PAGE?window.PAGE.base:"",w=!(!window||!window.PAGE)&&"1"===window.PAGE.locale_is_rtl,T=window&&window.PAGE?window.PAGE.cp_security_token:"",B=window&&window.PAGE?window.PAGE.short_hostname:"";var _=c(7709),C=c(5397),G=c(5380),$=c(755),N=c(3357),m=c(4850),W=c(1709);class q{constructor(o,e,i,a,s,d,x,k){if(this.deleting=!1,this.confirmingDelete=!1,this.handleApiToken="expire_24h",this.alias=o,this.hostname=e,this.username=i,this.enabledServices=a,s instanceof Date)this.lastCheck=s;else{const U=parseInt(s.toString(),10);this.lastCheck=new Date(1e3*U)}this.version=d,this.workerCapabilities=x,this.tlsVerified="boolean"==typeof k?k:"1"===k.toString()}}const X=["hostname"];let A=(()=>{class n{constructor(e){this.apiClient=e}generateRemoteToken(e,i,a,s){const d=this._apiCall("execute_remote_whmapi1_with_password",{host:e,username:i,password:a,tls_verification:s?"off":"on",function:"api_token_create"});return d.addArgument(new _.h("parameter_name","token_name")),d.addArgument(new _.h("parameter_value",this._generateTokenName())),d.addArgument(new _.h("parameter_name","acl")),d.addArgument(new _.h("parameter_value","all")),this.apiClient.post(d).pipe((0,m.U)(this._parseTypedResponse))}forceDedistributeAccounts(e,i){const a=[new _.h("node_alias",e)];i.forEach(d=>{a.push(new _.h("user",d))});const s=new C.r(C.N.JsonApi,{method:"force_dedistribution_from_node",arguments:a});return this.apiClient.post(s).pipe((0,m.U)(this._parseForceDedistributeData))}linkServerNode(e,i,a,s,d){return this.generateRemoteToken(i,a,s,d).pipe((0,W.zg)(x=>{const U=this._apiCall("link_server_node_with_api_token",{alias:e,hostname:i,username:a,api_token:x.data.token,skip_tls_verification:d?"1":"0"});return this.apiClient.post(U).pipe((0,m.U)(this._parseTypedResponse))}))}listDistributedAccounts(e,i){const a=new C.r(C.N.JsonApi,{method:"PRIVATE_list_accounts_distributed_to_child_node",arguments:[new _.h("alias",e)],pager:new G.uE(i.page,i.recordsPerPage),sorts:[new $.PE("username")],filters:[new N.w("username",N.p.Contains,i.filter)]});return this.apiClient.post(a).pipe((0,m.U)(this._parseListAccountResponse))}listLinkedServerNodes(){const e=this._apiCall("list_linked_server_nodes");return this.apiClient.post(e).pipe((0,m.U)(this._parseDataFromWhmApiResponse),(0,m.U)(i=>i.map(this._parseLinkedServerNode)))}unlinkServerNode(e,i){const a=this._apiCall("unlink_server_node",{alias:e,..."expire_24h"===i&&{handleApiToken:i}});return this.apiClient.post(a).pipe((0,m.U)(s=>{if(s.hasErrors)throw s.errors.pop();return s}))}updateServerNode(e,i){const a=this._apiCall("update_linked_server_node",{alias:e.alias});return X.forEach(s=>{e[s]!==i[s]&&a.addArgument(new _.h(s,i[s]))}),this.apiClient.post(a).pipe((0,m.U)(s=>{if(s.hasErrors)throw s.errors.pop();return s}))}_apiCall(e,i){const a=i?Object.keys(i).map(s=>new _.h(s,i[s])):[];return new C.r(C.N.JsonApi,{method:e,arguments:a})}_parseDataFromWhmApiResponse(e){if(e.status)return e.data;if(e.hasErrors)throw e.errors.pop()}_parseForceDedistributeData(e){if(e.status){let i="";return e.data.log.forEach(a=>{i+=a.indent?`\t${a.contents}\n`:`${a.contents}\n`}),e.data.formattedLog=i,e.data}if(e.hasErrors)throw e.errors.pop()}_parseLinkedServerNode(e){return new q(e.alias,e.hostname,e.username,e.enabled_services,e.last_check,e.version,e.worker_capabilities,e.tls_verified)}_parseListAccountResponse(e){if(e.status)return e.meta.isPaged?{data:e.data.map(a=>(a.selected=!1,a)),pagination:{page:e.meta.page,recordsPerPage:e.meta.pageSize,totalPages:e.meta.totalPages,totalRecords:e.meta.totalRecords,start:e.meta.record,filter:""}}:e.data;if(e.hasErrors)throw e.errors.pop()}_generateTokenName(){const i="PARENT-DO_NOT_DELETE-"+B.replace(/[^a-z0-9_-]/gi,"_"),a=Math.random().toString(36).substr(2);return i.substring(0,49-a.length)+"-"+a}_parseTypedResponse(e){if(e.hasErrors){const i=e.errors.pop();throw e.data&&e.data.type&&(i.type=e.data.type,i.data=e.data),i}return e}}return n.\u0275fac=function(e){return new(e||n)(t.LFG(F.A4))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();const K=(n,o)=>e=>n.find(a=>a.alias===e.value)?{aliasIsUnique:{message:o}}:null,O=(n,o)=>e=>n.find(a=>a.hostname===e.value)?{hostnameIsUnique:{message:o}}:null,tt=(n,o)=>{const e=r.kI.maxLength(n);return i=>e(i)?{maxLength:{message:o}}:null},et=(n,o)=>{const e=r.kI.pattern(n);return i=>e(i)?{pattern:{value:i.value,message:o}}:null},Z=n=>o=>r.kI.required(o)?{required:{message:n}}:null;var nt=c(2198),l=c(8738);const it=[[["","form-group-label",""]],[["","form-group-control",""]]],ot=["[form-group-label]","[form-group-control]"];let J=(()=>{class n{constructor(){}hasErrors(){return this.control.invalid}hasChanged(){return this.control.dirty||this.control.touched}getFieldErrors(){return Object.keys(this.control.errors).map(e=>({key:e,message:this.control.errors[e].message}))}getFieldStateClasses(){return this.hasChanged()?this.hasErrors()?"has-error":"has-success":""}ngOnInit(){this.id=`formGroup_${this.for}`,this.labelID=`${this.id}_formLabel`,this.validationContainerID=`${this.id}_validationContainer`}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["cp-link-nodes-form-group"]],inputs:{for:"for",label:"label",control:"control",showAllHelp:"showAllHelp"},ngContentSelectors:ot,decls:11,vars:8,consts:[[1,"form-group",3,"ngClass"],[1,"row"],[1,"col-xs-12"],[3,"id","for","labelText","showInfoBlock"],[3,"id","control"]],template:function(e,i){1&e&&(t.F$t(it),t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"cp-form-label",3),t.Hsn(4),t.qZA()()(),t.TgZ(5,"div",1)(6,"div",2),t.Hsn(7,1),t.qZA()(),t.TgZ(8,"div",1)(9,"div",2),t._UZ(10,"cp-validation-container",4),t.qZA()()()),2&e&&(t.Q6J("ngClass",i.getFieldStateClasses()),t.uIk("id",i.id),t.xp6(3),t.Q6J("id",i.labelID)("for",i.for)("labelText",i.label)("showInfoBlock",i.showAllHelp),t.xp6(7),t.Q6J("id",i.validationContainerID)("control",i.control))},directives:[p.mk,l._P,l.fm],encapsulation:2}),n})();const H=function(){return["/"]},I=function(n,o){return{"fa-arrow-left":n,"fa-arrow-right":o}};function at(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div",2)(1,"div",3)(2,"div",4),t._uU(3),t.qZA()(),t.TgZ(4,"div",5)(5,"cp-callout",6)(6,"span",7),t._uU(7),t.qZA(),t.TgZ(8,"p"),t._uU(9),t.qZA(),t.TgZ(10,"h4"),t._uU(11),t.qZA(),t.TgZ(12,"ul")(13,"li")(14,"a",8),t._uU(15),t.qZA()(),t._UZ(16,"li",9),t.qZA()()(),t.TgZ(17,"div",10)(18,"div")(19,"button",11),t.NdJ("click",function(){return t.CHM(e),t.oxw().reset()}),t._UZ(20,"i",12),t._uU(21),t.qZA(),t.TgZ(22,"button",13),t._UZ(23,"i",14),t._uU(24),t.qZA()()()()}if(2&n){const e=t.oxw();t.xp6(3),t.Oqu(e.pageTitle),t.xp6(4),t.Oqu(e.locale.maketext("Success!")),t.xp6(2),t.hij(" ",e.locale.maketext("You have successfully created a new connection to the linked node.")," "),t.xp6(2),t.Oqu(e.locale.maketext("What Next?")),t.xp6(3),t.MGl("href","",e.cpSecurityToken,"/scripts5/wwwacctform",t.LSH),t.xp6(1),t.hij(" ",e.locale.maketext("Create a new account that uses this connection")," "),t.xp6(1),t.Q6J("innerHTML",e.locale.maketext("[output,strong,Warning:] Do [output,strong,not] update your child node\u2019s hostname after you link two nodes. This operation could corrupt the nodes\u2019 ability to communicate."),t.oJD),t.xp6(3),t.Q6J("title",e.locale.maketext("Click here to create another connection to a remote node.")),t.xp6(2),t.hij(" ",e.locale.maketext("Create Another")," "),t.xp6(1),t.s9C("title",e.locale.maketext("Go back to the list of linked nodes.")),t.Q6J("routerLink",t.DdM(14,H)),t.uIk("disabled",e.serverNodes.length?null:""),t.xp6(1),t.Q6J("ngClass",t.WLB(15,I,!e.RTL,e.RTL)),t.xp6(1),t.hij(" ",e.locale.maketext("Go Back")," ")}}function st(n,o){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(4);t.xp6(1),t.Oqu(e.locale.maketext("Show Details"))}}function rt(n,o){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(4);t.xp6(1),t.Oqu(e.locale.maketext("Hide Details"))}}function lt(n,o){if(1&n&&(t.TgZ(0,"pre",45),t._uU(1),t.qZA()),2&n){const e=t.oxw(4);t.xp6(1),t.Oqu(e.verificationError)}}function ct(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div",38)(1,"div",39)(2,"cp-callout",40)(3,"span",41),t._uU(4),t.qZA(),t.TgZ(5,"p"),t._uU(6),t.qZA(),t.TgZ(7,"a",42),t.NdJ("click",function(){return t.CHM(e),t.oxw(3).toggleErrorDetails()}),t.YNc(8,st,2,1,"span",23),t.YNc(9,rt,2,1,"span",23),t._uU(10," \xa0 "),t._UZ(11,"i",43),t.qZA(),t.YNc(12,lt,2,1,"pre",44),t.qZA()()()}if(2&n){const e=t.oxw(3);t.xp6(4),t.Oqu(e.locale.maketext("Error:")),t.xp6(2),t.hij(" ",e.locale.maketext("The system could not create the connection to the remote server because of an error.")," "),t.xp6(2),t.Q6J("ngIf",!e.showErrorDetails),t.xp6(1),t.Q6J("ngIf",e.showErrorDetails),t.xp6(2),t.Q6J("ngClass",e.showErrorDetailsArrowClass),t.xp6(1),t.Q6J("ngIf",e.showErrorDetails)}}function dt(n,o){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(4);t.xp6(1),t.Oqu(e.locale.maketext("Show Details"))}}function pt(n,o){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(4);t.xp6(1),t.Oqu(e.locale.maketext("Hide Details"))}}function ut(n,o){if(1&n&&(t.TgZ(0,"pre",45),t._uU(1),t.qZA()),2&n){const e=t.oxw(4);t.xp6(1),t.Oqu(e.verificationError)}}function mt(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div",46)(1,"div",39)(2,"cp-callout",47)(3,"span",41),t._uU(4),t.qZA(),t._UZ(5,"p",48),t.TgZ(6,"a",42),t.NdJ("click",function(){return t.CHM(e),t.oxw(3).toggleErrorDetails()}),t.YNc(7,dt,2,1,"span",23),t.YNc(8,pt,2,1,"span",23),t._uU(9," \xa0 "),t._UZ(10,"i",43),t.qZA(),t.YNc(11,ut,2,1,"pre",44),t.TgZ(12,"div",49)(13,"label",50),t._UZ(14,"input",51),t._uU(15),t.qZA()()()()()}if(2&n){const e=t.oxw(3);t.xp6(4),t.Oqu(e.locale.maketext("Warning:")),t.xp6(1),t.Q6J("innerHtml",e.locale.maketext("The system could not create a connection to the remote server because of a [output,abbr,TLS,Transport Layer Security] verification error. You can attempt to create an insecure connection between the servers instead."),t.oJD),t.xp6(2),t.Q6J("ngIf",!e.showErrorDetails),t.xp6(1),t.Q6J("ngIf",e.showErrorDetails),t.xp6(2),t.Q6J("ngClass",e.showErrorDetailsArrowClass),t.xp6(1),t.Q6J("ngIf",e.showErrorDetails),t.xp6(4),t.hij(" ",e.locale.maketext("I understand the risks. Connect anyway.")," ")}}function ht(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div")(1,"section")(2,"cp-link-nodes-form-group",26)(3,"div",27),t._uU(4),t.qZA(),t.TgZ(5,"div",28)(6,"input",29),t.NdJ("blur",function(){return t.CHM(e),t.oxw(2).onHostnameBlur()}),t.qZA(),t.TgZ(7,"span",30),t._uU(8,":2087"),t.qZA()()(),t.TgZ(9,"cp-link-nodes-form-group",31)(10,"div",27),t._uU(11),t.qZA(),t._UZ(12,"input",32),t.qZA(),t.TgZ(13,"cp-link-nodes-form-group",33)(14,"div",27),t._uU(15),t.qZA(),t.TgZ(16,"div",34),t._UZ(17,"input",35),t.qZA()(),t.YNc(18,ct,13,6,"div",36),t.YNc(19,mt,16,7,"div",37),t.qZA()()}if(2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("showAllHelp",e.showAllHelp)("control",e.hostname)("label",e.locale.maketext("Hostname")),t.xp6(2),t.hij(" ",e.locale.maketext("Enter the hostname of the remote node for this connection.")," "),t.xp6(5),t.Q6J("showAllHelp",e.showAllHelp)("control",e.alias)("label",e.locale.maketext("Friendly Name")),t.xp6(2),t.AsE(" ",e.locale.maketext("Provide a name for the connection to the linked node.")," ",e.locale.maketext("You can only enter alphanumeric, dash, and underscore characters. The length must be less than or equal to [quant,_1,character,characters].",50)," "),t.xp6(2),t.Q6J("showAllHelp",e.showAllHelp)("control",e.password)("label",e.locale.maketext("Remote [asis,root] Password")),t.xp6(2),t.hij(" ",e.locale.maketext("Enter the remote node\u2019s [asis,root] password for this connection.")," "),t.xp6(3),t.Q6J("ngIf",!e.showSkipTLSWarning&&e.verificationError),t.xp6(1),t.Q6J("ngIf",e.showSkipTLSWarning)}}function _t(n,o){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.locale.maketext("Linking to \u201c[_1]\u201d \u2026",e.alias.value))}}function gt(n,o){if(1&n&&(t.TgZ(0,"div")(1,"div",52),t.YNc(2,_t,2,1,"ng-template",null,53,t.W1O),t._UZ(4,"cp-loading-spinner",54),t.qZA(),t._UZ(5,"hr",55),t.qZA()),2&n){const e=t.MAs(3);t.xp6(4),t.Q6J("loadingTemplate",e)}}function ft(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"form",15)(1,"div",16)(2,"div",17)(3,"div",18),t._uU(4),t.qZA(),t.TgZ(5,"div",19)(6,"button",20),t.NdJ("click",function(){return t.CHM(e),t.oxw().toggleHelp()}),t._uU(7),t._UZ(8,"i",21),t.qZA()(),t._UZ(9,"div",22),t.qZA(),t.TgZ(10,"div",5),t.YNc(11,ht,20,15,"div",23),t.YNc(12,gt,6,1,"div",23),t.qZA(),t.TgZ(13,"div",10)(14,"div")(15,"button",24),t.NdJ("click",function(){return t.CHM(e),t.oxw().create()}),t._UZ(16,"i",12),t._uU(17),t.qZA(),t.TgZ(18,"button",25),t._UZ(19,"i",14),t._uU(20),t.qZA()()()()()}if(2&n){const e=t.oxw();t.Q6J("formGroup",e.linkForm),t.xp6(4),t.Oqu(e.pageTitle),t.xp6(3),t.hij(" ",e.getToggleHelpLabel()," "),t.xp6(4),t.Q6J("ngIf",!e.creatingLink),t.xp6(1),t.Q6J("ngIf",e.creatingLink),t.xp6(3),t.s9C("title",e.locale.maketext("Click here to connect this server to a remote node.")),t.Q6J("disabled",e.creatingLink),t.xp6(2),t.hij(" ",e.locale.maketext("Create")," "),t.xp6(1),t.s9C("title",e.locale.maketext("Go back to the list of linked nodes.")),t.Q6J("disabled",e.creatingLink)("routerLink",t.DdM(14,H)),t.uIk("disabled",e.serverNodes.length?null:""),t.xp6(1),t.Q6J("ngClass",t.WLB(15,I,!e.RTL,e.RTL)),t.xp6(1),t.hij(" ",e.locale.maketext("Return to Linked Nodes")," ")}}let xt=(()=>{class n{constructor(e,i){this.locale=e,this.service=i,this.rtl=!1,this.cpSecurityToken=T,this.rtl=w,this.showErrorDetails=!1,this.showErrorDetailsArrowClass=this.rtl?"fas fa-chevron-left":"fas fa-chevron-right"}get alias(){return this.linkForm.get("alias")}get hostname(){return this.linkForm.get("hostname")}get password(){return this.linkForm.get("password")}get confirmNonTLS(){return this.linkForm.get("confirmNonTLS")}toggleHelp(){this.showAllHelp=!this.showAllHelp}reset(){this.showSkipTLSWarning=!1,this.verificationError=null,this.creationComplete=!1,this.creatingLink=!1,this.linkForm.reset({hostname:"",user:"root"})}showError(e){this.verificationError=e}toggleErrorDetails(){this.showErrorDetails=!this.showErrorDetails,this.showErrorDetailsArrowClass=this.showErrorDetails?"fas fa-chevron-down":this.rtl?"fas fa-chevron-left":"fas fa-chevron-right"}create(){if(Object.keys(this.linkForm.controls).forEach(e=>{this.linkForm.controls[e].markAsTouched(),this.linkForm.controls[e].updateValueAndValidity()}),this.linkForm.updateValueAndValidity(),this.linkForm.markAsTouched(),this.linkForm.valid)return this._create()}getToggleHelpLabel(){return this.locale.maketext(this.showAllHelp?"Hide Help Text":"Show Help Text")}loadLinkedServerNodes(){this.service.listLinkedServerNodes().subscribe(e=>{this.serverNodes.splice(0,this.serverNodes.length),e.forEach(i=>{this.serverNodes.push(i)})})}populateEmptyAlias(){if(this.alias.untouched){const i=this.hostname.value.replace(/[^a-z0-9_-]/gi,"-");this.alias.setValue(i)}}onHostnameBlur(){this.hostname.valid&&this.populateEmptyAlias()}ngOnInit(){this.serverNodes=[],this.pageTitle=this.locale.maketext("Create A New Connection"),this.linkForm=new r.cw({alias:new r.NI("",[Z(this.locale.maketext("You [output,strong,must] enter a friendly name for the connection.")),tt(50,this.locale.maketext("The friendly name cannot be longer than [quant,_1,character,characters].",50)),et(/^[a-zA-Z0-9_-]{1,}$/,this.locale.maketext("The friendly name can only contain alphanumeric, dash, and underscore characters.")),K(this.serverNodes,this.locale.maketext("The friendly name [output,strong,must] be unique. A connection with this friendly name already exists."))]),user:new r.NI("root"),hostname:new r.NI("",[Z(this.locale.maketext("You [output,strong,must] enter a hostname.")),O(this.serverNodes,this.locale.maketext("The hostname must be unique. A connection with this hostname already exists.")),L.Xz.fqdn()]),password:new r.NI("",[Z(this.locale.maketext("You [output,strong,must] enter a [asis,root] password for the remote node."))]),confirmNonTLS:new r.NI(!1,[this._validateConfirmNonTLS.bind(this)])});const e={};["alias","hostname","password"].forEach(function(i){this.linkForm.get(i).valueChanges.pipe((0,nt.h)(a=>a!==e[i])).subscribe(a=>{e[i]=a,this.showSkipTLSWarning=!1,this.verificationError=null})},this),this.loadLinkedServerNodes()}_validateConfirmNonTLS(e){return this.linkForm&&this.showSkipTLSWarning&&r.kI.requiredTrue(e)?{requiredTrue:{message:this.locale.maketext("You [output,strong,must] confirm that you acknowledge the risks.")}}:null}_generateSSLDetailMessage(e){if(e.data&&e.data.detail){const i=[];return"1"!==e.data.detail.matches_host.toString()&&i.push(this.locale.maketext("The remote hostname does not match the installed certificate.")),"DEPTH_ZERO_SELF_SIGNED_CERT"===e.data.detail.handshake_verify_text&&i.push(this.locale.maketext("The remote certificate is self-signed.")),i.length?this.locale.maketext("Verification of the remote node\u2019s [asis,SSL] certificate failed for the following [numerate,_1,reason,reasons]:",i.length)+"\n"+i.join("\n"):e.message}return e.message}_create(){return this.linkForm.disable(),this.creatingLink=!0,this.service.linkServerNode(this.linkForm.value.alias,this.linkForm.value.hostname,this.linkForm.value.user,this.linkForm.value.password,this.linkForm.value.confirmNonTLS).subscribe({error:e=>{let i=e.message;this.linkForm.value.confirmNonTLS||"TLSVerification"!==e.type?this.showSkipTLSWarning=!1:(this.showSkipTLSWarning=!0,i=this._generateSSLDetailMessage(e)),this.showError(i),this.creatingLink=!1,this.linkForm.enable()},next:()=>{this.linkForm.enable(),this.creationComplete=!0,this.creatingLink=!1,this.loadLinkedServerNodes()}})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.g),t.Y36(A))},n.\u0275cmp=t.Xpm({type:n,selectors:[["cp-link-nodes-create"]],decls:3,vars:2,consts:[["class","panel panel-success",4,"ngIf"],["id","createLinkForm","name","createLinkForm",3,"formGroup",4,"ngIf"],[1,"panel","panel-success"],[1,"panel-heading","text-left"],[1,"widget-title"],[1,"panel-body"],["id","creationSuccessfulCallout","calloutType","success"],["callout-heading","",2,"text-transform","none"],[3,"href"],[3,"innerHTML"],[1,"panel-footer"],["id","btnPostSuccessContinue","type","submit",1,"btn","btn-primary",3,"title","click"],["aria-hidden","true",1,"fas","fa-plus"],["id","btnCancelCreateAnother","type","button",1,"btn","btn-link","pull-right","flip",3,"routerLink","title"],["aria-hidden","true",1,"fas",3,"ngClass"],["id","createLinkForm","name","createLinkForm",3,"formGroup"],[1,"panel","panel-default"],[1,"panel-heading"],[1,"widget-title","pull-left","flip"],[1,"pull-right","flip"],["type","button","id","lnkshowHideHelp",1,"btn","btn-default","btn-xs",3,"click"],[1,"far","fa-question-circle","form-info-sign"],[1,"clearfix"],[4,"ngIf"],["id","btnCreateServerLink","type","submit",1,"btn","btn-primary",3,"disabled","title","click"],["id","btnCancelServerLink","type","button",1,"btn","btn-link","pull-right","flip",3,"disabled","routerLink","title"],["for","hostname",3,"showAllHelp","control","label"],["form-group-label",""],["form-group-control","",1,"input-group"],["type","text","id","hostname","name","hostname","placeholder","host.example.com","formControlName","hostname",1,"form-control",3,"blur"],[1,"input-group-addon"],["for","alias",3,"showAllHelp","control","label"],["form-group-control","","type","text","id","alias","placeholder","mymailserver","formControlName","alias",1,"form-control"],["for","password",3,"showAllHelp","control","label"],["form-group-control",""],["type","password","id","password","name","password","autocomplete","off","formControlName","password",1,"form-control"],["class","row",4,"ngIf"],["class","row","class","tls-warning-callout",4,"ngIf"],[1,"row"],[1,"col-xs-12"],["id","connectionVerifiedCallout","calloutType","danger",1,"tlsVerification"],["callout-heading",""],["href","javascript:void(0)",1,"btn","btn-link","show-error-details-btn",3,"click"],["aria-hidden","true",3,"ngClass"],["class","verification-error-pre",4,"ngIf"],[1,"verification-error-pre"],[1,"tls-warning-callout"],["id","connectionCheckCallout","calloutType","warning"],[3,"innerHtml"],[1,"checkbox"],["for","confirmNonTLS"],["type","checkbox","name","confirmNonTLS","id","confirmNonTLS","formControlName","confirmNonTLS"],[1,"checkbox","creating-link-spinner"],["creatingLinkTemplate",""],["id","creatingLinkLoader",3,"loadingTemplate"],[1,"separator"]],template:function(e,i){1&e&&(t.TgZ(0,"div"),t.YNc(1,at,25,18,"div",0),t.YNc(2,ft,21,18,"form",1),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",i.creationComplete),t.xp6(1),t.Q6J("ngIf",!i.creationComplete))},directives:[p.O5,l.Oc,u.rH,p.mk,r._Y,r.JL,r.sg,J,r.Fj,r.JJ,r.u,r.Wl,l.go],styles:[".verification-error-pre[_ngcontent-%COMP%]{white-space:pre-wrap;word-wrap:break-word}.tls-warning-callout[_ngcontent-%COMP%]{margin-top:-15px}.show-error-details-btn[_ngcontent-%COMP%]{padding-left:0;padding-right:0;margin-top:0}"]}),n})();var D=c(7489),Ct=c(7739),bt=c(5229),f=c(6775),S=c(835);const kt=["*"];let y=(()=>{class n{constructor(e){this.locale=e,this.deleteConfirmationHeader=this.locale.maketext("Are you sure?")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.g))},n.\u0275cmp=t.Xpm({type:n,selectors:[["cp-link-nodes-deletion-callout"]],inputs:{id:"id"},ngContentSelectors:kt,decls:8,vars:1,consts:[[1,"delete-confirm-container"],[1,"callout","callout-danger"],[1,"delete-confirm-message"],[1,"callout-heading"],[1,"delete-dialog-icon","fas","fa-question-circle"],[1,"delete-dialog-content"]],template:function(e,i){1&e&&(t.F$t(),t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t._uU(4),t.qZA(),t._UZ(5,"i",4),t.TgZ(6,"div",5),t.Hsn(7),t.qZA()()()()),2&e&&(t.xp6(4),t.Oqu(i.deleteConfirmationHeader))},styles:[".delete-confirm-container[_ngcontent-%COMP%]{padding:0}.delete-confirm-container[_ngcontent-%COMP%]   .callout[_ngcontent-%COMP%]{padding-top:0;padding-bottom:0;margin-bottom:0;overflow:hidden}.delete-confirm-message[_ngcontent-%COMP%]{position:relative;padding:3rem 6rem 1.5rem}.delete-confirm-message[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{font-size:1.4em}.delete-dialog-icon[_ngcontent-%COMP%]{position:absolute;top:-21px;padding:0;font-size:9em;color:#e74c3c38;pointer-events:none}html[dir=ltr][_ngcontent-%COMP%]   .delete-dialog-icon[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%]   .delete-dialog-icon[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%]   .delete-dialog-icon[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%]   .delete-dialog-icon[_ngcontent-%COMP%], html[dir=ltr]   [_nghost-%COMP%]   .delete-dialog-icon[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%]   .delete-dialog-icon[_ngcontent-%COMP%], [dir=ltr]   [_nghost-%COMP%]   .delete-dialog-icon[_ngcontent-%COMP%]{left:-32px}html[dir=rtl][_ngcontent-%COMP%]   .delete-dialog-icon[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%]   .delete-dialog-icon[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%]   .delete-dialog-icon[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%]   .delete-dialog-icon[_ngcontent-%COMP%], html[dir=rtl]   [_nghost-%COMP%]   .delete-dialog-icon[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%]   .delete-dialog-icon[_ngcontent-%COMP%], [dir=rtl]   [_nghost-%COMP%]   .delete-dialog-icon[_ngcontent-%COMP%]{right:-32px}.callout[_ngcontent-%COMP%]{margin-top:0;margin-bottom:5px}.delete-note[_ngcontent-%COMP%]{font-size:.95em;padding-top:10px;display:block}.delete-confirm[_ngcontent-%COMP%]{overflow:hidden}html[dir=ltr][_ngcontent-%COMP%]   .delete-confirm[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%]   .delete-confirm[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%]   .delete-confirm[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%]   .delete-confirm[_ngcontent-%COMP%], html[dir=ltr]   [_nghost-%COMP%]   .delete-confirm[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%]   .delete-confirm[_ngcontent-%COMP%], [dir=ltr]   [_nghost-%COMP%]   .delete-confirm[_ngcontent-%COMP%]{padding-left:0}html[dir=rtl][_ngcontent-%COMP%]   .delete-confirm[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%]   .delete-confirm[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%]   .delete-confirm[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%]   .delete-confirm[_ngcontent-%COMP%], html[dir=rtl]   [_nghost-%COMP%]   .delete-confirm[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%]   .delete-confirm[_ngcontent-%COMP%], [dir=rtl]   [_nghost-%COMP%]   .delete-confirm[_ngcontent-%COMP%]{padding-right:0}"]}),n})();function vt(n,o){if(1&n&&(t._UZ(0,"i",8),t._uU(1," \xa0 "),t._UZ(2,"span",9)),2&n){const e=t.oxw();t.xp6(2),t.Q6J("innerHtml",e.locale.maketext("[output,abbr,TLS,Transport Layer Security] Verified"),t.oJD)}}function wt(n,o){if(1&n&&(t._UZ(0,"i",10),t._uU(1," \xa0 "),t._UZ(2,"span",9)),2&n){const e=t.oxw();t.xp6(2),t.Q6J("innerHtml",e.locale.maketext("Not [output,abbr,TLS,Transport Layer Security] Verified"),t.oJD)}}function Tt(n,o){1&n&&t._UZ(0,"i",22)}function At(n,o){1&n&&t._UZ(0,"i",10)}function Zt(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div",23)(1,"pagination",24),t.NdJ("pageChanged",function(a){return t.CHM(e),t.oxw(2).pageChanged(a)}),t.qZA(),t.TgZ(2,"p",25),t._uU(3),t.qZA()()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("boundaryLinks",e.pagination.showBoundaryLinks)("totalItems",e.items.length)("maxSize",e.pagination.maxSize)("itemsPerPage",e.pagination.pageSize),t.xp6(2),t.Oqu(e.showingText)}}function Lt(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div",11)(1,"div",12)(2,"div",13)(3,"form",14),t._UZ(4,"input",15),t.qZA(),t.TgZ(5,"span",16)(6,"button",17),t.NdJ("click",function(){return t.CHM(e),t.oxw().searchFilter=""}),t.YNc(7,Tt,1,0,"i",18),t.YNc(8,At,1,0,"i",19),t.qZA()()()(),t.TgZ(9,"div",20),t.YNc(10,Zt,4,5,"div",21),t.qZA()()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("formGroup",e.searchFilterForm),t.xp6(1),t.Q6J("placeholder",e.locale.maketext("Search"))("title",e.locale.maketext("Search")),t.uIk("aria-label",e.locale.maketext("Search")),t.xp6(2),t.uIk("aria-label",e.locale.maketext(e.searchFilter?"Search":"Clear")),t.xp6(1),t.Q6J("ngIf",e.searchFilter),t.xp6(1),t.Q6J("ngIf",!e.searchFilter),t.xp6(2),t.Q6J("ngIf",e.pagination.show)}}function St(n,o){if(1&n&&(t.TgZ(0,"label",45),t._uU(1),t.qZA()),2&n){const e=o.$implicit;t.s9C("btnRadio",e),t.xp6(1),t.Oqu(e)}}function yt(n,o){if(1&n&&(t.TgZ(0,"ul",38)(1,"li",39)(2,"div",40),t._uU(3),t.qZA(),t.TgZ(4,"div")(5,"div",41)(6,"form",14)(7,"div",42)(8,"div",43),t.YNc(9,St,2,2,"label",44),t.qZA()()()()()()()),2&n){const e=t.oxw(3);t.xp6(3),t.hij(" ",e.locale.maketext("Entries Per Page")," "),t.xp6(3),t.Q6J("formGroup",e.pageSizeForm),t.xp6(3),t.Q6J("ngForOf",e.pagination.pageSizes)}}function Mt(n,o){1&n&&(t.TgZ(0,"div",33)(1,"button",34),t._UZ(2,"i",35)(3,"span",36),t.qZA(),t.YNc(4,yt,10,3,"ul",37),t.qZA())}const Ut=function(){return["/create"]};function Pt(n,o){if(1&n&&(t.TgZ(0,"div",26)(1,"div",27),t._UZ(2,"div",28),t.TgZ(3,"div",29)(4,"a",30),t._UZ(5,"i",31),t._uU(6),t.qZA(),t._uU(7," \xa0 "),t.YNc(8,Mt,5,0,"div",32),t.qZA()()()),2&n){const e=t.oxw();t.xp6(4),t.Q6J("routerLink",t.DdM(3,Ut)),t.xp6(2),t.hij(" ",e.locale.maketext("Create A New Connection")," "),t.xp6(2),t.Q6J("ngIf",e.items.length>e.pagination.pageSizes[0])}}function Ft(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div",46)(1,"div",27)(2,"cp-callout",47),t.NdJ("close",function(){return t.CHM(e),t.oxw().closeDeleteFailure()}),t.TgZ(3,"p"),t._uU(4),t.qZA(),t.TgZ(5,"pre",48),t._uU(6),t.qZA()()()()}if(2&n){const e=t.oxw();t.xp6(2),t.Q6J("closeable",!0),t.xp6(2),t.hij(" ",e.locale.maketext("The server failed to remove the connection to the linked node.")," "),t.xp6(2),t.Oqu(e.deletionFailureMessage)}}function Nt(n,o){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.locale.maketext("Loading \u2026"))}}function qt(n,o){if(1&n&&(t.TgZ(0,"div",46)(1,"div",27),t.YNc(2,Nt,2,1,"ng-template",null,49,t.W1O),t._UZ(4,"cp-loading-spinner",50),t.qZA()()),2&n){const e=t.MAs(3);t.xp6(4),t.Q6J("loadingTemplate",e)}}function Ot(n,o){if(1&n&&(t.TgZ(0,"div",46)(1,"div",27)(2,"cp-callout",51)(3,"pre",48),t._uU(4),t.qZA()()()()),2&n){const e=t.oxw();t.xp6(4),t.Oqu(e.loadFailureMessage)}}function Jt(n,o){if(1&n&&t._UZ(0,"i"),2&n){const e=t.oxw().$implicit,i=t.oxw(2);t.Tol(i.sortDirClass),t.uIk("title",e.title)}}function Ht(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"th")(1,"a",55),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw(2).changeSort(s.key)}),t._UZ(2,"span",9),t._uU(3," \xa0 "),t.YNc(4,Jt,1,3,"i",56),t.qZA()()}if(2&n){const e=o.$implicit,i=t.oxw(2);t.xp6(2),t.Q6J("innerHtml",e.label,t.oJD),t.xp6(2),t.Q6J("ngIf",e.key===i.sortConfig.key)}}function It(n,o){if(1&n&&(t.TgZ(0,"tr")(1,"td")(2,"cp-callout",57),t._UZ(3,"i",58),t._uU(4),t.qZA()()()),2&n){const e=t.oxw().$implicit,i=t.oxw(3);t.xp6(1),t.uIk("colspan",i.tableHeaders.length+1),t.xp6(1),t.MGl("id","",e.alias,"_deleteCallout"),t.xp6(1),t.uIk("id",i.spinnerId),t.xp6(1),t.hij(" ",i.locale.maketext("Unlinking \u201c[_1]\u201d\u2026",e.hostname)," ")}}function Dt(n,o){1&n&&t.GkF(0)}const Qt=function(n){return["/manage",n]};function Et(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t.YNc(6,Dt,1,0,"ng-container",59),t.qZA(),t.TgZ(7,"td")(8,"div",60)(9,"a",61),t._UZ(10,"i",62),t._uU(11),t.qZA(),t.TgZ(12,"button",63),t.NdJ("click",function(){t.CHM(e);const a=t.oxw().$implicit;return t.oxw(3).openDeletionConfirmation(a)}),t._UZ(13,"i",64),t._uU(14),t.qZA()()()()}if(2&n){const e=t.oxw(),i=e.$implicit,a=e.index,s=t.oxw(3),d=t.MAs(1),x=t.MAs(3);t.xp6(2),t.Oqu(i.alias),t.xp6(2),t.Oqu(i.hostname),t.xp6(2),t.Q6J("ngTemplateOutlet",i.tlsVerified?d:x),t.xp6(3),t.MGl("id","getAccountListBtn_",a,""),t.Q6J("routerLink",t.VKq(8,Qt,i.alias)),t.xp6(2),t.hij(" ",s.locale.maketext("Manage")," "),t.xp6(1),t.MGl("id","unlinkServerBtn_",a,""),t.xp6(2),t.hij(" ",s.locale.maketext("Unlink")," ")}}function Rt(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"tr")(1,"td")(2,"cp-link-nodes-deletion-callout",65)(3,"form",66)(4,"div")(5,"p")(6,"strong"),t._uU(7),t.qZA()(),t.TgZ(8,"p"),t._uU(9),t.qZA(),t.TgZ(10,"div",67)(11,"label")(12,"input",68),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(4).confirmDeletionCheck=a}),t.qZA(),t._uU(13),t.qZA()(),t.TgZ(14,"p",69)(15,"strong"),t._uU(16),t.qZA()(),t.TgZ(17,"div",70)(18,"label")(19,"input",71),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().$implicit.handleApiToken=a}),t.qZA(),t._uU(20),t.qZA(),t._UZ(21,"br"),t.TgZ(22,"label")(23,"input",72),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().$implicit.handleApiToken=a}),t.qZA(),t._uU(24),t.qZA()()(),t.TgZ(25,"div",73)(26,"button",74),t.NdJ("click",function(){t.CHM(e);const a=t.oxw().$implicit;return t.oxw(3).terminateLinkage(a)}),t._UZ(27,"i",64),t._uU(28),t.qZA(),t._uU(29," \xa0 "),t.TgZ(30,"button",75),t.NdJ("click",function(){return t.CHM(e),t.oxw().$implicit.confirmingDelete=!1}),t._uU(31),t.qZA()()()()()()}if(2&n){const e=t.oxw().$implicit,i=t.oxw(3);t.xp6(1),t.uIk("colspan",i.tableHeaders.length+1),t.xp6(6),t.Oqu(i.locale.maketext("Are you sure you want to remove the connection to the \u201c[_1]\u201d linked node?",e.hostname)),t.xp6(2),t.hij(" ",i.locale.maketext("This will permanently remove the connection.")," "),t.xp6(3),t.Q6J("ngModel",i.confirmDeletionCheck),t.xp6(1),t.hij(" ",i.locale.maketext("Select this checkbox to confirm that you want to remove the connection to the linked node.")," "),t.xp6(3),t.Oqu(i.locale.maketext("What do you want to do with the API token used for this connection?")),t.xp6(3),t.Q6J("value","expire_24h")("ngModel",e.handleApiToken),t.xp6(1),t.hij(" ",i.locale.maketext("Set it to expire in [quant,_1,hour,hours].",24)," "),t.xp6(3),t.Q6J("value","")("ngModel",e.handleApiToken),t.xp6(1),t.hij(" ",i.locale.maketext("Leave token active. (Not recommended.)")," "),t.xp6(2),t.Q6J("disabled",!i.confirmDeletionCheck),t.xp6(2),t.hij(" \xa0 ",i.locale.maketext("Yes, remove this connection")," "),t.xp6(3),t.hij(" ",i.locale.maketext("Cancel")," ")}}function Yt(n,o){if(1&n&&(t.ynx(0),t.YNc(1,It,5,4,"tr",54),t.YNc(2,Et,15,10,"tr",54),t.YNc(3,Rt,32,15,"tr",54),t.BQk()),2&n){const e=o.$implicit;t.xp6(1),t.Q6J("ngIf",e.deleting),t.xp6(1),t.Q6J("ngIf",!e.confirmingDelete&&!e.deleting),t.xp6(1),t.Q6J("ngIf",e.confirmingDelete)}}function zt(n,o){if(1&n&&(t.TgZ(0,"tbody"),t.YNc(1,Yt,4,3,"ng-container",53),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.displayItems)}}function jt(n,o){if(1&n&&(t.TgZ(0,"tbody")(1,"tr",76)(2,"td"),t._uU(3),t.qZA()()()),2&n){const e=t.oxw(2);t.xp6(2),t.uIk("colspan",e.tableHeaders.length+1),t.xp6(1),t.hij(" ",e.locale.maketext("No connections exist.")," ")}}function Vt(n,o){if(1&n&&(t.TgZ(0,"tbody")(1,"tr",76)(2,"td"),t._uU(3),t.qZA()()()),2&n){const e=t.oxw(2);t.xp6(2),t.uIk("colspan",e.tableHeaders.length+1),t.xp6(1),t.hij(" ",e.locale.maketext("No results match your query.")," ")}}function Bt(n,o){if(1&n&&(t.TgZ(0,"table",52)(1,"thead")(2,"tr"),t.YNc(3,Ht,5,2,"th",53),t._UZ(4,"th"),t.qZA()(),t.YNc(5,zt,2,1,"tbody",54),t.YNc(6,jt,4,2,"tbody",54),t.YNc(7,Vt,4,2,"tbody",54),t.qZA()),2&n){const e=t.oxw();t.xp6(3),t.Q6J("ngForOf",e.tableHeaders),t.xp6(2),t.Q6J("ngIf",e.filteredItems.length>0),t.xp6(1),t.Q6J("ngIf",0===e.items.length),t.xp6(1),t.Q6J("ngIf",0!==e.items.length&&0===e.filteredItems.length)}}let Gt=(()=>{class n{constructor(e,i,a,s){this.service=e,this.locale=i,this.router=a,this.alertService=s,this.items=[],this.filteredItems=[],this.loadingData=!0,this.confirmDeletionCheck=!1,this.displayItems=[],this.pagination={pageSizes:[20,50,100],currentPage:1,pageSize:20,showBoundaryLinks:!0,maxSize:5,_start:1,_limit:1,show:!0},this.sortConfig={direction:"asc",key:"alias"}}get htmlDir(){return w?"rtl":"ltr"}get sortDirClass(){return"asc"===this.sortConfig.direction?"icon-arrow-up":"icon-arrow-down"}get showingText(){return this.locale.maketext("[_1] - [_2] of [_3]",this.pagination._start+1,this.pagination._limit,this.filteredItems.length)}ngOnInit(){this.tableHeaders=[{key:"alias",title:this.locale.maketext("Friendly Name"),label:this.locale.maketext("Friendly Name")},{key:"hostname",title:this.locale.maketext("Hostname"),label:this.locale.maketext("Hostname")},{key:"tlsVerified",title:this.locale.maketext("[asis,TLS] Verified"),label:this.locale.maketext("[output,abbr,TLS,Transport Layer Security] Verified")}],this.loadingData=!0,this.confirmDeletionCheck=!1,this.loadFailureMessage=null,this.loadLinkedServerNodes(),this.pageSizeForm=new r.cw({pageSize:new r.NI(this.pagination.pageSizes[0])}),this.pageSizeForm.valueChanges.pipe((0,m.U)(e=>e.pageSize)).subscribe({next:e=>{this.pagination.pageSize=e,this.fetch()}}),this.searchFilterForm=new r.cw({searchFilter:new r.NI("")}),this.searchFilterForm.valueChanges.pipe((0,bt.D)(()=>(0,Ct.H)(500)),(0,m.U)(e=>e.searchFilter)).subscribe({next:e=>{this.searchFilter=e,this.fetch()}})}showDeleteFailure(e){this.deletionFailureMessage=e}closeDeleteFailure(){this.deletionFailureMessage=null}openDeletionConfirmation(e){e.confirmingDelete=!0,e.handleApiToken="expire_24h",this.confirmDeletionCheck=!1}terminateLinkage(e){e.deleting=!0,e.confirmingDelete=!1,this.service.unlinkServerNode(e.alias,e.handleApiToken).subscribe({next:i=>{this.loadLinkedServerNodes(),"expire_24h"===e.handleApiToken&&this.alertService.warn(this.locale.maketext("Token is set to expire in [quant,_1,hour,hours].",24))},error:i=>{e.deleting=!1,this.showDeleteFailure(i.message)}})}pageChanged(e){this.pagination.currentPage=e.page,this._paginate()}changeSort(e){this.sortConfig.key===e&&(this.sortConfig.direction="asc"===this.sortConfig.direction?"desc":"asc"),this.sortConfig.key=e,this.filteredItems=this._sort(this.filteredItems),this.pagination.currentPage=1,this._paginate()}fetch(){this.pagination.currentPage=1;let e=this.items;e=this._filter(e),e=this._sort(e),this.filteredItems=e,this.displayItems=this._paginate()}loadLinkedServerNodes(){this.service.listLinkedServerNodes().subscribe({next:e=>{this.items=e,0===this.items.length?this.router.navigateByUrl("/create"):(this.fetch(),this.loadingData=!1)},error:e=>{this.loadFailureMessage=e.message}})}_paginate(){return this.pagination.show=!(this.pagination.pageSize>=this.filteredItems.length),this.pagination._start=this.pagination.pageSize*(this.pagination.currentPage-1),this.pagination._limit=Math.min(this.filteredItems.length,this.pagination._start+this.pagination.pageSize),this.displayItems=this.filteredItems.slice(this.pagination._start,this.pagination._limit),this.displayItems}_sort(e){return D.orderBy(e,this.sortConfig.key,"asc"===this.sortConfig.direction?"asc":"desc")}_filter(e){if(!this.searchFilter)return e;const i=new RegExp(this.searchFilter,"gi");return D.filter(e,a=>i.test(a.alias)||i.test(a.hostname))}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(A),t.Y36(g.g),t.Y36(u.F0),t.Y36(l.c9))},n.\u0275cmp=t.Xpm({type:n,selectors:[["cp-link-nodes-list"]],decls:12,vars:7,consts:[["tlsVerified",""],["tlsNotVerified",""],[1,"section"],["class","row search-page-container",4,"ngIf"],[1,"row","table-controls-row"],["class","row action-bar",4,"ngIf"],["class","row",4,"ngIf"],["class","table table-striped","id","items_table",4,"ngIf"],["aria-hidden","true",1,"fas","fa-check"],[3,"innerHtml"],["aria-hidden","true",1,"fas","fa-times"],[1,"row","search-page-container"],[1,"col-xs-12","col-sm-12","col-md-4","col-lg-4"],[1,"input-group"],[1,"form-inline",3,"formGroup"],["type","text","id","searchField_input","formControlName","searchFilter",1,"form-control",3,"placeholder","title"],[1,"input-group-btn"],["id","searchField_submit_btn","type","button",1,"btn","btn-default",3,"click"],["class","fas fa-search","aria-hidden","true",4,"ngIf"],["class","fas fa-times","aria-hidden","true",4,"ngIf"],[1,"col-xs-12","col-sm-12","col-md-8","col-lg-8"],["class","pagination-container hidden-xs hidden-sm",4,"ngIf"],["aria-hidden","true",1,"fas","fa-search"],[1,"pagination-container","hidden-xs","hidden-sm"],["firstText","\u2039\u2039","lastText","\u203a\u203a","previousText","\u2039","nextText","\u203a",3,"boundaryLinks","totalItems","maxSize","itemsPerPage","pageChanged"],[1,"text-small"],[1,"row","action-bar"],[1,"col-xs-12"],[1,"pull-left"],[1,"pull-right","flip"],[1,"btn","btn-primary","btn-sm",3,"routerLink"],["aria-hidden","true",1,"fas","fa-plus"],["class","btn-group","dropdown","","auto-close","outsideClick",4,"ngIf"],["dropdown","","auto-close","outsideClick",1,"btn-group"],["id","single-button","type","button","dropdownToggle","","aria-controls","dropdown-basic",1,"btn","btn-default","btn-sm","dropdown-toggle"],[1,"fas","fa-cog"],[1,"caret"],["class","dropdown-menu dropdown-menu-right","role","menu","aria-labelledby","single-button",4,"dropdownMenu"],["role","menu","aria-labelledby","single-button",1,"dropdown-menu","dropdown-menu-right"],["role","menuitem"],[1,"text-small","text-uppercase"],["role","group",1,"btn-group","pageSizeButtons"],[1,"form-group"],["btnRadioGroup","","formControlName","pageSize",1,"btn-group"],["class","btn btn-default btn-sm","tabindex","0","role","button",3,"btnRadio",4,"ngFor","ngForOf"],["tabindex","0","role","button",1,"btn","btn-default","btn-sm",3,"btnRadio"],[1,"row"],["id","deletionFailureMessage","calloutType","danger",3,"closeable","close"],[1,"unlink-error-pre"],["loadingDataTemplate",""],["id","loadingDataLoader",3,"loadingTemplate"],["id","loadFailureMessage","calloutType","danger"],["id","items_table",1,"table","table-striped"],[4,"ngFor","ngForOf"],[4,"ngIf"],["href","javascript:void(0)",1,"sort-link",3,"click"],[3,"class",4,"ngIf"],["calloutType","danger",3,"id"],[1,"fas","fa-spinner","fa-spin","spinner"],[4,"ngTemplateOutlet"],[1,"pull-right"],[1,"btn","btn-outline-primary","btn-sm","flip",3,"routerLink","id"],["aria-hidden","true",1,"fas","fa-wrench"],[1,"btn","btn-outline-danger","btn-sm","flip",3,"id","click"],["aria-hidden","true",1,"fas","fa-trash"],["id","confirmDeletionCallout"],["id","confirmDeletionForm",1,"form-inline"],[1,"checkbox"],["id","confirmDeletionCheck","name","confirmDeletionCheck","type","checkbox",3,"ngModel","ngModelChange"],[1,"handle-token"],[1,"radio"],["id","expire","name","handleApiToken","type","radio",3,"value","ngModel","ngModelChange"],["id","doNotExpire","name","handleApiToken","type","radio",3,"value","ngModel","ngModelChange"],[1,"form-group","action-group"],["type","button",1,"btn","btn-primary",3,"disabled","click"],["type","button",1,"btn","btn-sm","btn-link",3,"click"],[1,"info","empty-row"]],template:function(e,i){1&e&&(t.YNc(0,vt,3,1,"ng-template",null,0,t.W1O),t.YNc(2,wt,3,1,"ng-template",null,1,t.W1O),t.TgZ(4,"div",2),t.YNc(5,Lt,11,8,"div",3),t._UZ(6,"div",4),t.YNc(7,Pt,9,4,"div",5),t.YNc(8,Ft,7,3,"div",6),t.YNc(9,qt,5,1,"div",6),t.YNc(10,Ot,5,1,"div",6),t.YNc(11,Bt,8,4,"table",7),t.qZA()),2&e&&(t.xp6(4),t.uIk("dir",i.htmlDir),t.xp6(1),t.Q6J("ngIf",!i.loadingData),t.xp6(2),t.Q6J("ngIf",!i.loadingData),t.xp6(1),t.Q6J("ngIf",i.deletionFailureMessage),t.xp6(1),t.Q6J("ngIf",i.loadingData&&!i.loadFailureMessage),t.xp6(1),t.Q6J("ngIf",i.loadFailureMessage),t.xp6(1),t.Q6J("ngIf",!i.loadingData))},directives:[p.O5,r._Y,r.JL,r.sg,r.Fj,r.JJ,r.u,u.yS,f.TO,f.Mq,f.Hz,S.pj,p.sg,S.lz,l.Oc,l.go,p.tP,y,r.F,r.Wl,r.On,r._],styles:[".unlink-error-pre[_ngcontent-%COMP%]{white-space:pre-wrap;word-wrap:break-word;max-width:95%}.handle-token[_ngcontent-%COMP%]{margin-top:10px}"]}),n})();var Q=c(5712),h=(()=>{return(n=h||(h={})).up="icon-arrow-up",n.down="icon-arrow-down",h;var n})(),M=c(6962),E=c(5529);let R=(()=>{class n{constructor(){this.description=new E.xQ}clear(){this.description.next()}set(e){this.description.next(e)}get(){return this.description}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();var Y=c(537);function $t(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div",28)(1,"div",8)(2,"pre",29),t._uU(3),t.qZA(),t.TgZ(4,"button",30),t.NdJ("click",function(){return t.CHM(e),t.oxw().dismissLogOutput()}),t._UZ(5,"i",31),t._uU(6),t.qZA()()()}if(2&n){const e=t.oxw();t.xp6(3),t.Oqu(e.dedistributeLogText),t.xp6(3),t.hij(" ",e.locale.maketext("Dismiss")," ")}}function Wt(n,o){1&n&&t._UZ(0,"i",16)}function Xt(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"cp-link-nodes-deletion-callout",32),t._UZ(1,"div",33),t.TgZ(2,"cp-action-button",34),t.NdJ("click",function(){return t.CHM(e),t.oxw().forceDedistributeAccounts()}),t.YNc(3,Wt,1,0,"i",35),t._uU(4),t.qZA(),t.TgZ(5,"button",36),t.NdJ("click",function(){return t.CHM(e),t.oxw().toggleConfirmationVisibility()}),t._uU(6),t.qZA()()}if(2&n){const e=t.oxw();t.xp6(1),t.Q6J("innerHTML",e.dedistributeConfirmationWarningText,t.oJD),t.xp6(1),t.Q6J("buttonState",e.dedistributeBtnState)("buttonClass",e.confirmationBtnClass),t.xp6(1),t.Q6J("ngIf",!e.isDedistributing),t.xp6(1),t.hij(" ",e.locale.maketext("Force Dedistribute ([_1])?",e.totalSelectedAccounts)," "),t.xp6(2),t.hij(" ",e.locale.maketext("Cancel")," ")}}function Kt(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"ul",37)(1,"li",38)(2,"cp-page-size-selector",39),t.NdJ("optionSelected",function(a){return t.CHM(e),t.oxw().selectPageSize(a)}),t.qZA()()()}if(2&n){const e=t.oxw();t.xp6(2),t.Q6J("selectedPageSize",e.pageSize)}}function te(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"a",40),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.isContentSuccessful&&a.sortColumn()}),t._uU(1),t._UZ(2,"i",41),t.qZA()}if(2&n){const e=t.oxw();t.xp6(1),t.hij(" ",e.locale.maketext("Account Name")," "),t.xp6(1),t.Q6J("ngClass",e.caretClass)}}function ee(n,o){if(1&n&&(t.ynx(0),t._uU(1),t.BQk()),2&n){const e=t.oxw();t.xp6(1),t.hij(" ",e.locale.maketext("Account Name")," ")}}function ne(n,o){if(1&n&&(t.TgZ(0,"tr",42)(1,"td",43),t._UZ(2,"i",44),t._uU(3),t.qZA()()),2&n){const e=t.oxw();t.xp6(3),t.hij(" ",e.locale.maketext("Fetching the account list for \u201c[_1]\u201d \u2026",e.alias)," ")}}function ie(n,o){if(1&n&&(t.TgZ(0,"tr",42)(1,"td",43),t._uU(2),t.qZA()()),2&n){const e=t.oxw(2);t.xp6(2),t.hij(" ",e.locale.maketext("No accounts utilize this linkage.")," ")}}function oe(n,o){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"tr",46)(2,"td",47)(3,"label",48)(4,"input",49),t.NdJ("ngModelChange",function(a){return t.CHM(e).$implicit.selected=a})("click",function(){const s=t.CHM(e).$implicit;return t.oxw(2).toggleSelectSingleRow(s)}),t.qZA()()(),t.TgZ(5,"td",50)(6,"a",51),t._uU(7),t.qZA()()(),t.BQk()}if(2&n){const e=o.$implicit,i=o.index,a=t.oxw(2);t.xp6(1),t.MGl("id","accountRow_",i,""),t.xp6(2),t.MGl("for","rowCheckbox_",i,""),t.xp6(1),t.MGl("id","rowCheckbox_",i,""),t.s9C("disabled",a.isConfirmationVisible),t.Q6J("ngModel",e.selected),t.xp6(2),t.MGl("id","accountNameLink_",i,""),t.s9C("href",a.getListAcctLink(e),t.LSH),t.s9C("title",a.locale.maketext("Navigate to the Modify an Account interface.")),t.xp6(1),t.hij(" ",e.username," ")}}function ae(n,o){if(1&n&&(t.ynx(0),t.YNc(1,ie,3,1,"tr",27),t.YNc(2,oe,8,9,"ng-container",45),t.BQk()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",!e.accountList.length),t.xp6(1),t.Q6J("ngForOf",e.accountList)}}const z=function(n){return{disabled:n}};let se=(()=>{class n{constructor(e,i,a,s,d){this._activatedRoute=e,this._listService=i,this.locale=a,this._alertService=s,this._locationService=d,this.accountList=[],this.caretClass=h.up,this.dedistributeBtnState=l.FP.enabled,this.isConfirmationVisible=!1,this.isContentLoading=!0,this.isContentSuccessful=!1,this.isDedistributing=!1,this.isDedistributingLogVisible=!1,this.isSelectAllSelected=!1,this.isRTL=w}get confirmationBtnClass(){return"btn btn-primary btn-sm"}get dedistributeAccountsText(){return this.locale.maketext("Force Dedistribute Accounts ([_1])[comment,action button text]",this.totalSelectedAccounts)}get dedistributeConfirmationWarningText(){return`${this.locale.maketext("The system will force all of the selected distributed accounts to use only the local server. Performing this action [output,strong,will] result in account data loss.")} ${this.modifyAcctLinkText}`}get isAnyRowSelected(){for(let e=0,i=this.accountList.length;e<i;e++)if(this.accountList[e].selected)return!0;return!1}get modifyAcctLink(){return`${this._path.rootUrl}${T}/scripts/edituser`}get modifyAcctLinkText(){return this.locale.maketext("Use [asis,WHM]\u2019s [output,url,_1,Modify an Account,_2,_3] interface to gracefully dedistribute an account.",this.modifyAcctLink,"target","_blank")}get pageSize(){return n.pagination.recordsPerPage}get totalRecords(){return n.pagination.totalRecords}get totalSelectedAccounts(){return this.accountList.filter(i=>i.selected).length}get selectedRowsUsernames(){const e=[];return this.accountList.forEach(i=>{i.selected&&e.push(i.username)}),e}dismissLogOutput(){this.isDedistributingLogVisible=!1}filterAccounts(e){e.trim(),n.pagination.filter=e,this._fetchAccountList()}forceDedistributeAccounts(){this.dedistributeBtnState=l.FP.loading,this.isDedistributing=!0,this._listService.forceDedistributeAccounts(this.alias,this.selectedRowsUsernames).pipe((0,Y.x)(()=>{this.dedistributeBtnState=l.FP.enabled,this.isDedistributing=!1})).subscribe({next:e=>{this.dedistributeLogText=e.formattedLog,this.isDedistributingLogVisible=!0,this.isConfirmationVisible=!1,this._fetchAccountList()},error:e=>{this._alertService.error(e.message)}})}selectPageSize(e){e!==n.pagination.recordsPerPage&&(n.pagination.recordsPerPage=e,this._fetchAccountList())}sortColumn(){this.caretClass=this.caretClass===h.up?h.down:h.up,this.accountList.sort(this.caretClass===h.up?(e,i)=>e.username<i.username?-1:1:(e,i)=>e.username<i.username?1:-1)}toggleConfirmationVisibility(){this.isAnyRowSelected&&(this.isConfirmationVisible=!this.isConfirmationVisible)}toggleSelectAllRows(){this.isSelectAllSelected=!this.isSelectAllSelected,this.accountList.forEach(e=>{e.selected=this.isSelectAllSelected})}toggleSelectSingleRow(e){if(e.selected=!e.selected,e.selected)for(let i=0,a=this.accountList.length;i<a;i++){if(!this.accountList[i].selected){this.isSelectAllSelected=!1;break}this.isSelectAllSelected=!0}else this.isSelectAllSelected=!1}updatePage(e){n.pagination.page!==e&&(n.pagination.page=e,this._fetchAccountList())}getListAcctLink(e){const i=encodeURIComponent(e.username);return`${this._path.rootUrl}${T}/scripts4/listaccts?search=${i}&searchtype=user`}ngOnInit(){this._path=new Q.b5(this._locationService),this._activatedRoute.paramMap.subscribe(e=>{this.alias=e.get("alias"),this._fetchAccountList()})}_fetchAccountList(){this.isContentLoading=!0,this.caretClass=h.up,this._listService.listDistributedAccounts(this.alias,n.pagination).pipe((0,Y.x)(()=>{this.isContentLoading=!1,this.isSelectAllSelected=!1})).subscribe({next:e=>{this.accountList=e.data;const i=n.pagination.filter;n.pagination=e.pagination,n.pagination.filter=i,this.isContentSuccessful=!0},error:e=>{this._alertService.error(e.message),this.isContentSuccessful=!1}})}}return n.pagination={page:1,recordsPerPage:20,totalPages:0,totalRecords:0,start:1,filter:""},n.\u0275fac=function(e){return new(e||n)(t.Y36(u.gz),t.Y36(A),t.Y36(g.g),t.Y36(l.c9),t.Y36(M.a))},n.\u0275cmp=t.Xpm({type:n,selectors:[["cp-link-nodes-distributed-accts-list"]],decls:36,vars:19,consts:[[1,"row"],[1,"pull-left","flip","col-xs-12","col-sm-5"],[1,"search-container"],["id","linkedAccountListSearch","name","linkedAccountListSearch",3,"disabled","valueChange"],[1,"pull-right","text-right","flip","col-xs-12","col-sm-7"],["id","accountListPagination",3,"totalItems","pageSize","disabled","pageChanged"],["class","row logRow",4,"ngIf"],[1,"row","confirm-dedistribute-callout-row"],[1,"col-xs-12"],["id","deleteConfirmationCallout",4,"ngIf"],[1,"row","action-bar"],[1,"pull-left","flip"],[1,"table-action-button-container"],["for","selectAllAccountsCheckbox",1,"table-action-button-label","table-action-button-sm"],["type","checkbox","id","selectAllAccountsCheckbox",3,"ngModel","disabled","ngModelChange","click"],["type","button","id","forceDedistributeBtn",1,"btn","btn-sm","btn-danger",3,"ngClass","click"],["aria-hidden","true",1,"fas","fa-unlink"],[1,"pull-right","flip","hidden-xs"],["dropdown","",1,"btn-group","pull-right","flip"],["id","pageSizeDropdownBtn","dropdownToggle","","type","button","aria-controls","dropdown-basic",1,"btn","btn-sm","btn-default","dropdown-toggle",3,"ngClass"],[1,"fas","fa-cog"],[1,"caret"],["id","pageSizeDropdownList","class","dropdown-menu dropdown-menu-right","role","menu","aria-labelledby","button-basic",4,"dropdownMenu"],["id","listAccountsTable",1,"table","table-striped","table-details"],["scope","col"],["href","javascript:void(0)",3,"click",4,"ngIf"],[4,"ngIf"],["class","info empty-row",4,"ngIf"],[1,"row","logRow"],["id","dedistributeOutputLog",1,"log"],["type","button",1,"btn","btn-link","btn-sm","pull-right","flip",3,"click"],["aria-hidden","true",1,"fas","fa-times"],["id","deleteConfirmationCallout"],[3,"innerHTML"],["id","confirmDedistributeBtn",3,"buttonState","buttonClass","click"],["class","fas fa-unlink","aria-hidden","true",4,"ngIf"],["type","button","id","cancelDedistributeConfirmationBtn",1,"btn","btn-sm","btn-link",3,"click"],["id","pageSizeDropdownList","role","menu","aria-labelledby","button-basic",1,"dropdown-menu","dropdown-menu-right"],["role","menuitem"],["id","listAccountsPageSizeSelection",3,"selectedPageSize","optionSelected"],["href","javascript:void(0)",3,"click"],[3,"ngClass"],[1,"info","empty-row"],["colspan","2"],["aria-hidden","true",1,"fas","fa-spinner","fa-spin"],[4,"ngFor","ngForOf"],[1,"data-row",3,"id"],[1,"check-column"],[1,"tableRowCheckboxLabel",3,"for"],["type","checkbox",3,"id","disabled","ngModel","ngModelChange","click"],[1,"name-column"],["target","_blank",3,"id","href","title"]],template:function(e,i){1&e&&(t.TgZ(0,"div")(1,"div",0)(2,"div",1)(3,"div",2)(4,"cp-search",3),t.NdJ("valueChange",function(s){return i.filterAccounts(s)}),t.qZA()()(),t.TgZ(5,"div",4)(6,"cp-pagination",5),t.NdJ("pageChanged",function(s){return i.updatePage(s.page)}),t.qZA()()(),t.YNc(7,$t,7,2,"div",6),t.TgZ(8,"div",7)(9,"div",8),t.YNc(10,Xt,7,6,"cp-link-nodes-deletion-callout",9),t.qZA()(),t.TgZ(11,"div",10)(12,"div",8)(13,"div",11)(14,"div",12)(15,"label",13)(16,"input",14),t.NdJ("ngModelChange",function(s){return i.isSelectAllSelected=s})("click",function(){return i.toggleSelectAllRows()}),t.qZA()()(),t.TgZ(17,"button",15),t.NdJ("click",function(){return i.toggleConfirmationVisibility()}),t._UZ(18,"i",16),t._uU(19),t.qZA()(),t.TgZ(20,"div",17)(21,"div",18)(22,"button",19),t._UZ(23,"i",20)(24,"span",21),t.qZA(),t.YNc(25,Kt,3,1,"ul",22),t.qZA()()()(),t.TgZ(26,"table",23)(27,"thead")(28,"tr"),t._UZ(29,"th",24),t.TgZ(30,"th",24),t.YNc(31,te,3,2,"a",25),t.YNc(32,ee,2,1,"ng-container",26),t.qZA()()(),t.TgZ(33,"tbody"),t.YNc(34,ne,4,1,"tr",27),t.YNc(35,ae,3,2,"ng-container",26),t.qZA()()()),2&e&&(t.xp6(4),t.Q6J("disabled",i.isConfirmationVisible),t.xp6(2),t.Q6J("totalItems",i.totalRecords)("pageSize",i.pageSize)("disabled",i.isConfirmationVisible),t.xp6(1),t.Q6J("ngIf",i.isDedistributingLogVisible),t.xp6(3),t.Q6J("ngIf",i.isConfirmationVisible),t.xp6(6),t.s9C("disabled",i.isConfirmationVisible),t.Q6J("ngModel",i.isSelectAllSelected),t.xp6(1),t.Q6J("ngClass",t.VKq(15,z,!i.isAnyRowSelected||i.isConfirmationVisible)),t.xp6(2),t.hij(" ",i.dedistributeAccountsText," "),t.xp6(3),t.Q6J("ngClass",t.VKq(17,z,i.isConfirmationVisible)),t.xp6(9),t.Q6J("ngIf",!i.isConfirmationVisible),t.xp6(1),t.Q6J("ngIf",i.isConfirmationVisible),t.xp6(2),t.Q6J("ngIf",i.isContentLoading),t.xp6(1),t.Q6J("ngIf",i.isContentSuccessful&&!i.isContentLoading))},directives:[l.gS,l.Qt,p.O5,y,l.xV,r.Wl,r.JJ,r.On,p.mk,f.TO,f.Mq,f.Hz,l.k6,p.sg],styles:["table[_ngcontent-%COMP%]{margin-top:15px}.return-link[_ngcontent-%COMP%]{padding-top:2em;padding-bottom:2em;text-align:center}.check-column[_ngcontent-%COMP%]{max-width:5%}#pageSizeDropdownList[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{margin:0 5px}.search-container[_ngcontent-%COMP%]{margin-top:20px}.description[_ngcontent-%COMP%]{margin-bottom:10px}.tableRowCheckboxLabel[_ngcontent-%COMP%]{margin-bottom:0}.log[_ngcontent-%COMP%]{height:500px}.logRow[_ngcontent-%COMP%]{margin-bottom:10px}.logRow[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{padding:0}.confirm-dedistribute-callout-row[_ngcontent-%COMP%]{margin-bottom:10px}"]}),n})();function re(n,o){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.locale.maketext("Loading \u2026"))}}function le(n,o){if(1&n&&(t.TgZ(0,"div"),t.YNc(1,re,2,1,"ng-template",null,3,t.W1O),t._UZ(3,"cp-loading-spinner",4),t.qZA()),2&n){const e=t.MAs(2);t.xp6(3),t.Q6J("loadingTemplate",e)}}function ce(n,o){1&n&&(t.TgZ(0,"div",8),t._UZ(1,"input",9),t.TgZ(2,"span",10),t._uU(3,":2087"),t.qZA()())}function de(n,o){if(1&n&&(t.TgZ(0,"cp-link-nodes-form-group",5)(1,"div",6),t._uU(2),t.qZA(),t.YNc(3,ce,4,0,"div",7),t.qZA()),2&n){const e=t.oxw();t.Q6J("showAllHelp",e.showAllHelp)("control",e.hostname)("label",e.locale.maketext("Hostname")),t.xp6(2),t.hij(" ",e.locale.maketext("Enter the hostname of the child node for this connection.")," "),t.xp6(1),t.Q6J("ngIf",e.showFormElements)}}function pe(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div")(1,"button",11),t.NdJ("click",function(){return t.CHM(e),t.oxw().beginConfirmUpdateHostname()}),t._UZ(2,"i",12),t._uU(3),t.qZA()()}if(2&n){const e=t.oxw();t.xp6(1),t.s9C("title",e.locale.maketext("Click here to update the hostname.")),t.xp6(2),t.hij(" ",e.locale.maketext("Update Hostname")," ")}}function ue(n,o){1&n&&t._UZ(0,"i",12)}function me(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div")(1,"cp-link-nodes-deletion-callout",13)(2,"div")(3,"p")(4,"strong"),t._uU(5),t.qZA()(),t._UZ(6,"p",14),t.TgZ(7,"div",15)(8,"label"),t._UZ(9,"input",16),t._uU(10),t.qZA()()(),t.TgZ(11,"div",17)(12,"cp-action-button",18),t.NdJ("click",function(){return t.CHM(e),t.oxw().updateHostname()}),t.YNc(13,ue,1,0,"i",19),t._uU(14),t.qZA(),t.TgZ(15,"button",20),t.NdJ("click",function(){return t.CHM(e),t.oxw().endConfirmUpdateHostname()}),t._uU(16),t.qZA()()()()}if(2&n){const e=t.oxw();t.xp6(5),t.Oqu(e.locale.maketext("Are you sure that you want to update the hostname for the child node \u201c[_1]\u201d from \u201c[_2]\u201d to \u201c[_3]\u201d?",e.currentNode.alias,e.currentNode.hostname,e.hostname.value)),t.xp6(1),t.Q6J("innerHtml",e.locale.maketext("Ideally, the hostname on the linkage [output,strong,should] match the hostname of the child node. For more information, read our [output,url,_1,documentation,target,_blank].","https://go.cpanel.net/whmlinkednodes"),t.oJD),t.xp6(4),t.hij(" ",e.locale.maketext("Select this checkbox to confirm that you want to rename the hostname of the child node.")," "),t.xp6(2),t.Q6J("buttonState",e.confirmRenameHostnameBtnState),t.xp6(1),t.Q6J("ngIf",!e.hostnameIsUpdating),t.xp6(1),t.hij(" ",e.locale.maketext("Update Hostname")," "),t.xp6(2),t.hij(" ",e.locale.maketext("Cancel")," ")}}let he=(()=>{class n{constructor(e,i,a,s){this._activatedRoute=e,this._alertService=i,this._mainService=a,this.locale=s,this.showFormElements=!1,this.showConfirmHostnameChangePanel=!1,this._serverNodes=new E.xQ,this.showLoadingMessage=!0,this.confirmDeletionCheck=!1,this.confirmRenameHostnameBtnState=l.FP.enabled,this._activatedRoute.paramMap.subscribe(d=>{this.alias=d.get("alias")})}get hostname(){return this.hostnameForm.get("hostname")}get confirmRenameHostname(){return this.hostnameForm.get("confirmRenameHostname")}get confirmRenameHostnameHeader(){return this.locale.maketext("Are you sure?")}ngOnInit(){this.hostnameForm=new r.cw({hostname:new r.NI(""),confirmRenameHostname:new r.NI(!1,[])}),this.hostnameForm.valueChanges.subscribe(e=>{this.hostnameIsUpdating||(this.confirmRenameHostnameBtnState=e.confirmRenameHostname?l.FP.enabled:l.FP.disabled)}),this._serverNodes.subscribe(e=>{this.currentNode=e.find(a=>a.alias===this.alias),this._resetForm();const i=e.filter(a=>a.alias!==this.currentNode.alias);this.hostname.setValidators([Z(this.locale.maketext("You [output,strong,must] enter a hostname.")),O(i,this.locale.maketext("The hostname must be unique. A connection with this hostname already exists.")),L.Xz.fqdn()])}),this._updateLinkedServerNodes()}beginConfirmUpdateHostname(){if(this.hostnameForm.invalid)return!1;this.showFormElements=!1,this.showConfirmHostnameChangePanel=!0}endConfirmUpdateHostname(){this.showFormElements=!0,this.showConfirmHostnameChangePanel=!1}updateHostname(){if(this.hostnameForm.updateValueAndValidity(),this.confirmRenameHostnameBtnState=l.FP.loading,this.hostnameIsUpdating=!0,this.confirmRenameHostname.disable(),this.hostnameForm.valid){const e=new q(this.currentNode.alias,this.hostname.value,this.currentNode.username,this.currentNode.enabledServices,this.currentNode.lastCheck,this.currentNode.version,this.currentNode.workerCapabilities,this.currentNode.tlsVerified);this._mainService.updateServerNode(this.currentNode,e).subscribe({next:i=>{this._alertService.success(this.locale.maketext("The system successfully updated the hostname for \u201c[_1]\u201d to \u201c[_2]\u201d.",this.alias,this.hostname.value)),this._updateHostnameCompleted(),this._updateLinkedServerNodes()},error:i=>{this._alertService.error(i.message),this._updateHostnameCompleted(),this._resetForm()}})}}_updateHostnameCompleted(){this.endConfirmUpdateHostname(),this.confirmRenameHostnameBtnState=l.FP.enabled,this.hostnameIsUpdating=!1,this.confirmRenameHostname.enable()}_updateLinkedServerNodes(){this.showFormElements=!1,this.showLoadingMessage=!0,this._mainService.listLinkedServerNodes().subscribe(e=>{this._serverNodes.next(e),this.showFormElements=!0,this.showLoadingMessage=!1})}_resetForm(){this.hostnameForm.reset({hostname:this.currentNode?this.currentNode.hostname:"",confirmRenameHostname:!1})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(u.gz),t.Y36(l.c9),t.Y36(A),t.Y36(g.g))},n.\u0275cmp=t.Xpm({type:n,selectors:[["cp-link-nodes-update-hostname-form"]],decls:6,vars:5,consts:[["id","hostnameForm","name","hostnameForm",3,"formGroup"],[4,"ngIf"],["for","hostname",3,"showAllHelp","control","label",4,"ngIf"],["loadingHostnameData",""],["id","loadingHostnameDataPanel",3,"loadingTemplate"],["for","hostname",3,"showAllHelp","control","label"],["form-group-label",""],["class","input-group","form-group-control","",4,"ngIf"],["form-group-control","",1,"input-group"],["type","text","id","hostname","name","hostname","placeholder","host.example.com","formControlName","hostname",1,"form-control"],[1,"input-group-addon"],["id","btnUpdateHostname","type","submit",1,"btn","btn-outline-primary",3,"title","click"],["aria-hidden","true",1,"fas","fa-save"],["id","confirmHostnameChangeCallout"],[3,"innerHtml"],[1,"checkbox"],["id","confirmRenameHostname","name","confirmRenameHostname","type","checkbox","formControlName","confirmRenameHostname"],[1,"form-group","action-group"],["id","btnUpdateHostnameConfirm","type","submit","buttonClass","btn btn-sm btn-primary",3,"buttonState","click"],["class","fas fa-save","aria-hidden","true",4,"ngIf"],["id","btnCancelUpdateHostname","type","button",1,"btn","btn-link",3,"click"]],template:function(e,i){1&e&&(t.TgZ(0,"form",0),t.YNc(1,le,4,1,"div",1),t.YNc(2,de,4,5,"cp-link-nodes-form-group",2),t.TgZ(3,"div"),t.YNc(4,pe,4,2,"div",1),t.YNc(5,me,17,7,"div",1),t.qZA()()),2&e&&(t.Q6J("formGroup",i.hostnameForm),t.xp6(1),t.Q6J("ngIf",i.showLoadingMessage),t.xp6(1),t.Q6J("ngIf",i.showFormElements),t.xp6(2),t.Q6J("ngIf",i.showFormElements),t.xp6(1),t.Q6J("ngIf",i.showConfirmHostnameChangePanel))},directives:[r._Y,r.JL,r.sg,p.O5,l.go,J,r.Fj,r.JJ,r.u,y,r.Wl,l.xV],styles:[".panel-danger[_ngcontent-%COMP%] > .panel-heading[_ngcontent-%COMP%]{color:#e74c3c}"]}),n})();const _e=function(n,o){return{"text-right":n,"text-left":o}},ge=function(){return["/list"]},fe=function(n,o){return{"fa-arrow-left":n,"fa-arrow-right":o}},xe=[{path:"create",component:xt,data:{showResourcePanel:!0}},{path:"list",component:Gt,data:{showResourcePanel:!1}},{path:"manage/:alias",component:(()=>{class n{constructor(e,i,a,s){this._activatedRoute=e,this.locale=i,this._locationService=a,this._pageDescriptionService=s,this.caretClass=h.up,this.isRTL=w,this._path=new Q.b5(this._locationService),this._activatedRoute.paramMap.subscribe(d=>{this.alias=d.get("alias"),this._pageDescriptionService.set(this.locale.maketext("Use this interface to manage the \u201c[_1]\u201d child node.",this.alias)),this.distributedAcctsPanelTitle=this.locale.maketext("Manage Distributed Accounts for \u201c[_1]\u201d",this.alias),this.hostnamePanelTitle=this.locale.maketext("Manage Hostname for \u201c[_1]\u201d",this.alias)})}get distributedAcctsDescription(){return`${this.locale.maketext("[output,strong,Warning:] This action will result in account data loss. [output,strong,Only] use this procedure in an emergency situation.")} ${this.modifyAcctLinkText}`}get modifyAcctLink(){return`${this._path.rootUrl}${T}/scripts/edituser`}get modifyAcctLinkText(){return this.locale.maketext("Use [asis,WHM]\u2019s [output,url,_1,Modify an Account,_2,_3] interface to gracefully dedistribute an account.",this.modifyAcctLink,"target","_blank")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(u.gz),t.Y36(g.g),t.Y36(M.a),t.Y36(R))},n.\u0275cmp=t.Xpm({type:n,selectors:[["cp-link-nodes-manage"]],decls:28,vars:15,consts:[["id","listAccountsPerLinkageAlertList"],[1,"panel","panel-default"],[1,"panel-heading"],[1,"widget-title","pull-left","flip"],[1,"clearfix"],[1,"panel-body"],[1,"row"],[1,"col-md-12"],[3,"innerHTML"],[1,"panel-footer"],[3,"ngClass"],["id","btnCancelModifyAcct","type","button","id","returnToLinkListBtn",1,"btn","btn-link",3,"routerLink","title"],["aria-hidden","true",1,"fas",3,"ngClass"],[1,"panel","panel-danger"]],template:function(e,i){1&e&&(t._UZ(0,"cp-alert-list",0),t.TgZ(1,"div",1)(2,"div",2)(3,"div",3),t._uU(4),t.qZA(),t._UZ(5,"div",4),t.qZA(),t.TgZ(6,"div",5)(7,"div",6)(8,"div",7),t._UZ(9,"p",8),t.qZA()(),t.TgZ(10,"div",6)(11,"div",7),t._UZ(12,"cp-link-nodes-distributed-accts-list"),t.qZA()()(),t.TgZ(13,"div",9)(14,"div",10)(15,"button",11),t._UZ(16,"i",12),t._uU(17),t.qZA()()()(),t.TgZ(18,"div",13)(19,"div",2)(20,"div",3),t._uU(21),t.qZA(),t._UZ(22,"div",4),t.qZA(),t.TgZ(23,"div",5)(24,"div",6)(25,"div",7)(26,"section"),t._UZ(27,"cp-link-nodes-update-hostname-form"),t.qZA()()()()()),2&e&&(t.xp6(4),t.hij(" ",i.distributedAcctsPanelTitle," "),t.xp6(5),t.Q6J("innerHTML",i.distributedAcctsDescription,t.oJD),t.xp6(5),t.Q6J("ngClass",t.WLB(8,_e,!i.isRTL,i.isRTL)),t.xp6(1),t.s9C("title",i.locale.maketext("Go back to the list of linked nodes.")),t.Q6J("routerLink",t.DdM(11,ge)),t.xp6(1),t.Q6J("ngClass",t.WLB(12,fe,!i.isRTL,i.isRTL)),t.xp6(1),t.hij(" ",i.locale.maketext("Go Back")," "),t.xp6(4),t.Oqu(i.hostnamePanelTitle))},directives:[l.hF,se,p.mk,u.rH,he],encapsulation:2}),n})(),data:{showResourcePanel:!0}},{path:"**",redirectTo:"list",pathMatch:"full"}];let Ce=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[M.a],imports:[[u.Bz.forRoot(xe,{relativeLinkResolution:"legacy"}),p.ez,l.kM,l.wL,r.UX,r.u5,l.df,l.zf,l.u3,l.RV,f.mr.forRoot(),S.Fq.forRoot(),l.CQ,l.t8,l.zr],u.Bz]}),n})();function be(n,o){if(1&n&&(t.TgZ(0,"div",2)(1,"div",3),t._UZ(2,"p",9),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("innerHTML",e.description,t.oJD)}}function ke(n,o){1&n&&t.GkF(0)}function ve(n,o){if(1&n&&(t.TgZ(0,"div",5)(1,"div",10),t.YNc(2,ke,1,0,"ng-container",11),t.qZA()()),2&n){const e=t.oxw(),i=t.MAs(11);t.Q6J("ngClass",e.sidePanelClasses),t.xp6(2),t.Q6J("ngTemplateOutlet",i)}}function we(n,o){1&n&&t.GkF(0)}function Te(n,o){if(1&n&&(t.TgZ(0,"div",12)(1,"div",10),t.YNc(2,we,1,0,"ng-container",11),t.qZA()()),2&n){t.oxw();const e=t.MAs(11);t.xp6(2),t.Q6J("ngTemplateOutlet",e)}}function Ae(n,o){if(1&n&&(t.TgZ(0,"section",13)(1,"h3",14),t._uU(2),t.qZA(),t.TgZ(3,"ul")(4,"li")(5,"a",15),t._UZ(6,"i",16),t._uU(7),t.qZA()(),t.TgZ(8,"li")(9,"a",17),t._UZ(10,"i",18),t._uU(11),t.qZA()()()(),t.TgZ(12,"section",13)(13,"h3",14),t._uU(14),t.qZA(),t.TgZ(15,"ul")(16,"li")(17,"a",19),t._UZ(18,"i",20),t._uU(19),t.qZA()()()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.locale.maketext("I want to \u2026")),t.xp6(3),t.s9C("title",e.locale.maketext("Create a New [asis,cPanel] Account")),t.xp6(2),t.hij(" ",e.locale.maketext("Create a new [asis,cPanel] Account")," "),t.xp6(2),t.s9C("title",e.locale.maketext("Distribute an Existing [asis,cPanel] Account")),t.xp6(2),t.hij(" ",e.locale.maketext("Distribute an Existing [asis,cPanel] Account")," "),t.xp6(3),t.Oqu(e.locale.maketext("Need Help?")),t.xp6(3),t.s9C("title",e.locale.maketext("Need help? Click here to read more about this interface.")),t.xp6(2),t.hij(" ",e.locale.maketext("About This Interface")," ")}}let Ze=(()=>{class n{constructor(e,i,a,s){this.router=e,this.route=i,this.locale=a,this.pageDescriptionService=s,L.uZ.locale=this.locale,e.events.subscribe(d=>{d instanceof u.OD&&this.pageDescriptionService.clear(),d instanceof u.m2&&(this.showResourcePanel=i.root.firstChild.snapshot.data.showResourcePanel,this._updatePanelClasses())})}get description(){return this._description}ngOnInit(){this.showResourcePanel=!1,this._updatePanelClasses(),this.pageDescriptionService.get().subscribe(e=>{this._description=e})}_updatePanelClasses(){this.sidePanelClasses="col-md-4 hidden-xs hidden-sm",this.sidePanelClasses+=" ",this.sidePanelClasses+="pull-right",this.mainPanelClasses=this.showResourcePanel?"col-xs-12 col-sm-12 col-md-8 pull-left":"col-xs-12"}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(u.F0),t.Y36(u.gz),t.Y36(g.g),t.Y36(R))},n.\u0275cmp=t.Xpm({type:n,selectors:[["cp-link-nodes-root"]],decls:12,vars:4,consts:[["id","content"],["class","row",4,"ngIf"],[1,"row"],[1,"col-xs-12","col-lg-8"],[3,"ngClass",4,"ngIf"],[3,"ngClass"],["id","viewContent",1,"ng-cloak","section","animate-view"],["class","col-xs-12 hidden-lg hidden-md",4,"ngIf"],["resourceTemplate",""],[1,"description",3,"innerHTML"],[1,"section"],[4,"ngTemplateOutlet"],[1,"col-xs-12","hidden-lg","hidden-md"],[1,"widget"],[1,"widget-title"],["id","lnkCreateNewAccount","href","../../scripts5/wwwacctform",3,"title"],["aria-hidden","true",1,"fas","fa-plus"],["id","lnkModifyExistingAcct","href","../../scripts/edituser",3,"title"],["aria-hidden","true",1,"fas","fa-wrench"],["href","https://go.cpanel.net/whmlinkednodes","id","linkAboutTheInterface","target","whm_documentation",3,"title"],["aria-hidden","true",1,"fas","fa-fw","fa-external-link-alt"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div"),t.YNc(2,be,3,1,"div",1),t._UZ(3,"cp-alert-list"),t.TgZ(4,"div",2)(5,"div",3),t.YNc(6,ve,3,2,"div",4),t.TgZ(7,"div",5),t._UZ(8,"router-outlet",6),t.qZA(),t.YNc(9,Te,3,1,"div",7),t.qZA()()()(),t.YNc(10,Ae,20,8,"ng-template",null,8,t.W1O)),2&e&&(t.xp6(2),t.Q6J("ngIf",i.description),t.xp6(4),t.Q6J("ngIf",i.showResourcePanel),t.xp6(1),t.Q6J("ngClass",i.mainPanelClasses),t.xp6(2),t.Q6J("ngIf",i.showResourcePanel))},directives:[p.O5,l.hF,p.mk,p.tP,u.lC],encapsulation:2}),n})(),Le=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n,bootstrap:[Ze]}),n.\u0275inj=t.cJS({providers:[l.c9,{provide:p.mr,useValue:V}],imports:[[v.b2,Ce,j.m,p.ez,l.df,F.au,l.CQ]]}),n})();(0,t.G48)(),v.q6().bootstrapModule(Le).catch(n=>console.error(n))}},b=>{b.O(0,[736],()=>b(b.s=9742)),b.O()}]);
Back to Directory File Manager