"use strict";(self.webpackChunkssl_tls_configuration=self.webpackChunkssl_tls_configuration||[]).push([[179],{7280:(p,g,a)=>{var u=a(1481),e=a(1657),y=a(7564),T=a(348),l=a(3063),r=a(4719),_=a(269);const f=new e.OlP("AppConfigInjectionToken"),L=window.PAGE;var C=a(6729);class x{constructor(s,t,n=""){this.label=s,this.value=t,this.description=n}}var v=a(7709),S=a(4642),d=a(4850),k=a(2868),A=a(5419);let m=(()=>{class i{constructor(t,n,o){this._apiClient=t,this._alert=n,this._appConfig=o,this.getCurrentSSLDefaultKeyType$=new C.xQ}getSSLDefaultKeyTypeOptions(){return this._appConfig.sslDefaultKeyTypeOptions.map(t=>new x(t.label,t.type))}getSSLDefaultKeyType(){return this._appConfig.sslDefaultKeyType}getCurrentSSLDefaultKeyType(){const t=this._apiCall("get_tweaksetting",{key:"ssl_default_key_type"});return this._post(t).pipe((0,d.U)(n=>n.status?n.data.tweaksetting.value:n)).subscribe(this.getCurrentSSLDefaultKeyType$.next.bind(this.getCurrentSSLDefaultKeyType$)),this.getCurrentSSLDefaultKeyType$}setCurrentSSLDefaultKeyType(t){const n=this._apiCall("set_tweaksetting",{key:"ssl_default_key_type",value:t});return this._post(n).pipe((0,d.U)(o=>(o.status&&this.getCurrentSSLDefaultKeyType$.next(t),o)))}_post(t){return this._apiClient.post(t).pipe((0,k.b)(this._handleMessages.bind(this)))}_apiCall(t,n){const o=n?Object.keys(n).map(c=>new v.h(c,n[c])):[];return new S.r(S.N.JsonApi,{method:t,arguments:o})}_handleMessages(t){return t.errors.forEach(n=>{this._alert.error(n.message),(0,e.X6Q)()&&console.error(n.message)}),t.warnings.forEach(n=>{this._alert.warn(n.message),(0,e.X6Q)()&&console.warn(n.message)}),t.infoMessages.forEach(n=>{this._alert.info(n.message),(0,e.X6Q)()&&console.log(n.message)}),t}}return i.\u0275fac=function(t){return new(t||i)(e.LFG(A.A4),e.LFG(l.c9),e.LFG(f))},i.\u0275prov=e.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})();var h=a(6895);const b=["*"];let w=(()=>{class i{constructor(t){this._appConfig=t,this._baseUrl=`${window.location.origin}${t.cpSecurityToken}`}ngOnInit(){const t=!!this.href.match(/^\//);this.target=t?"_self":this.id,this.parsedHREF=t?`${this._baseUrl}${this.href}`:this.href,this.iconClass=this.iconClass?this.iconClass:"fas fa-fw fa-external-link-alt"}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(f))},i.\u0275cmp=e.Xpm({type:i,selectors:[["cp-tls-resource-panel-link"]],inputs:{href:"href",id:"id",title:"title",iconClass:"iconClass"},ngContentSelectors:b,decls:4,vars:5,consts:[[3,"id","href","title","target"],["aria-hidden","true",1,"fas",3,"ngClass"]],template:function(t,n){1&t&&(e.F$t(),e.TgZ(0,"li")(1,"a",0),e._UZ(2,"i",1),e.Hsn(3),e.qZA()()),2&t&&(e.xp6(1),e.Q6J("id",n.id)("href",n.parsedHREF,e.LSH)("title",n.title)("target",n.target),e.xp6(1),e.Q6J("ngClass",n.iconClass))},directives:[h.mk],encapsulation:2}),i})();function Z(i,s){1&i&&e._UZ(0,"cp-loading-spinner",3)}function K(i,s){1&i&&e.GkF(0)}function D(i,s){if(1&i&&(e.TgZ(0,"span",34),e._uU(1),e.qZA()),2&i){const t=e.oxw(3);e.Q6J("title",t.currentLabelDescription),e.xp6(1),e.Oqu(t.locale.maketext("Current"))}}function U(i,s){if(1&i&&e._UZ(0,"span",35),2&i){const t=e.oxw().$implicit;e.Q6J("innerHtml",t.description,e.oJD)}}function H(i,s){if(1&i&&(e.TgZ(0,"div",30)(1,"label"),e._UZ(2,"input",31),e._uU(3),e.qZA(),e.YNc(4,D,2,2,"span",32),e.YNc(5,U,1,1,"span",33),e.qZA()),2&i){const t=s.$implicit,n=e.oxw(2);e.xp6(2),e.Q6J("formControl",n.defaultSSLKeyType)("value",t.value),e.uIk("value",t.value),e.xp6(1),e.hij(" ",t.label," "),e.xp6(1),e.Q6J("ngIf",n.showCurrentLabel(t.value)),e.xp6(1),e.Q6J("ngIf",n.showAllHelp)}}function F(i,s){if(1&i&&(e.TgZ(0,"cp-callout",36),e._UZ(1,"p",37),e.qZA()),2&i){const t=e.oxw(2);e.xp6(1),e.Q6J("innerHtml",t.locale.maketext("When you change this setting, the server will replace [output,strong,all] [asis,AutoSSL]-issued certificates that use a different key type."),e.oJD)}}function J(i,s){1&i&&e._UZ(0,"i",38)}function I(i,s){1&i&&e.GkF(0)}function Q(i,s){if(1&i){const t=e.EpF();e.TgZ(0,"div",4)(1,"p",5),e._uU(2),e.qZA(),e.TgZ(3,"div",6)(4,"div",7)(5,"div",8)(6,"div",9),e.YNc(7,K,1,0,"ng-container",10),e.qZA()(),e.TgZ(8,"div",11)(9,"form",12)(10,"div",13)(11,"div",14)(12,"div",15),e._uU(13),e.qZA(),e.TgZ(14,"div",16)(15,"button",17),e.NdJ("click",function(){return e.CHM(t),e.oxw().toggleHelp()}),e._uU(16),e._UZ(17,"i",18),e.qZA()(),e._UZ(18,"div",19),e.qZA(),e.TgZ(19,"div",20)(20,"section")(21,"div",21)(22,"div",6)(23,"div",22)(24,"cp-form-label",23)(25,"p"),e._uU(26),e.qZA()()()(),e.TgZ(27,"div",6)(28,"div",22),e.YNc(29,H,6,6,"div",24),e.qZA()()(),e.YNc(30,F,2,1,"cp-callout",25),e.qZA()(),e.TgZ(31,"div",26)(32,"div")(33,"cp-action-button",27),e.NdJ("click",function(){return e.CHM(t),e.oxw().submit()}),e.YNc(34,J,1,0,"i",28),e._uU(35),e.qZA()()()()()(),e.TgZ(36,"div",29)(37,"div",9),e.YNc(38,I,1,0,"ng-container",10),e.qZA()()()()()}if(2&i){const t=e.oxw(),n=e.MAs(5);e.xp6(2),e.hij(" ",t.locale.maketext("Configure [asis,SSL/TLS] related configurations.")," "),e.xp6(5),e.Q6J("ngTemplateOutlet",n),e.xp6(2),e.Q6J("formGroup",t.sslTypeForm),e.xp6(4),e.hij(" ",t.sectionTitle," "),e.xp6(3),e.hij(" ",t.toggleHelpLabel," "),e.xp6(8),e.Q6J("labelText",t.locale.maketext("Default [asis,SSL/TLS] Key Type"))("showInfoBlock",t.showAllHelp),e.xp6(2),e.hij(" ",t.locale.maketext("The type of key that the system will create by default for [asis,SSL/TLS] certificates and signing requests.")," "),e.xp6(3),e.Q6J("ngForOf",t.sslDefaultKeyTypeOptions),e.xp6(1),e.Q6J("ngIf",t.showWarning),e.xp6(3),e.s9C("title",t.locale.maketext("Click here to save these settings.")),e.Q6J("buttonState",t.saveButtonState),e.xp6(1),e.Q6J("ngIf",!t.saving),e.xp6(1),e.hij(" ",t.locale.maketext("Save")," "),e.xp6(3),e.Q6J("ngTemplateOutlet",n)}}function O(i,s){if(1&i&&(e.TgZ(0,"section",39)(1,"h3",40),e._uU(2),e.qZA(),e.TgZ(3,"ul")(4,"cp-tls-resource-panel-link",41),e._uU(5),e.qZA(),e.TgZ(6,"cp-tls-resource-panel-link",42),e._uU(7),e.qZA(),e.TgZ(8,"cp-tls-resource-panel-link",43),e._uU(9),e.qZA(),e.TgZ(10,"cp-tls-resource-panel-link",44),e._uU(11),e.qZA(),e.TgZ(12,"cp-tls-resource-panel-link",45),e._uU(13),e.qZA(),e.TgZ(14,"cp-tls-resource-panel-link",46),e._uU(15),e.qZA()()(),e.TgZ(16,"section",39)(17,"h3",40),e._uU(18),e.qZA(),e.TgZ(19,"ul")(20,"cp-tls-resource-panel-link",47),e._uU(21),e.qZA()()()),2&i){const t=e.oxw();e.xp6(2),e.Oqu(t.locale.maketext("I want to:")),e.xp6(2),e.s9C("title",t.locale.maketext("Click here to configure [asis, AutoSSL].")),e.xp6(1),e.hij(" ",t.locale.maketext("Configure [asis,AutoSSL]")," "),e.xp6(1),e.s9C("title",t.locale.maketext("Click here to configure Webdisk [asis,SSL] Ciphers.")),e.xp6(1),e.hij(" ",t.locale.maketext("Configure Webdisk SSL Ciphers")," "),e.xp6(1),e.s9C("title",t.locale.maketext("Click here to configure Apache [asis,SSL] Ciphers.")),e.xp6(1),e.hij(" ",t.locale.maketext("Configure Apache [asis,SSL] Ciphers")," "),e.xp6(1),e.s9C("title",t.locale.maketext("Click here to configure Web Services [asis,SSL] Ciphers.")),e.xp6(1),e.hij(" ",t.locale.maketext("Configure Web Services [asis,SSL] Ciphers")," "),e.xp6(1),e.s9C("title",t.locale.maketext("Click here to manage [asis,SSL] hosts.")),e.xp6(1),e.hij(" ",t.locale.maketext("Manage [asis,SSL] Hosts")," "),e.xp6(1),e.s9C("title",t.locale.maketext("Click here to manage [asis,SSL] storage.")),e.xp6(1),e.hij(" ",t.locale.maketext("Manage [asis,SSL] Storage")," "),e.xp6(3),e.Oqu(t.locale.maketext("Need Help?")),e.xp6(2),e.s9C("title",t.locale.maketext("Need help? Click here to read more about this interface.")),e.xp6(1),e.hij(" ",t.locale.maketext("About This Interface")," ")}}let j=(()=>{class i{constructor(t,n,o,c){this.locale=t,this.configurationService=n,this._alert=o,this._appConfig=c,this.sectionTitle=this.locale.maketext("SSL/TLS Configuration"),this.showAllHelp=!1,this.keyDescriptions=c.sslDefaultKeyTypeDescriptions,this.defaultLabelDescription=this.locale.maketext("This is the default setting for new systems."),this.currentLabelDescription=this.locale.maketext("This is the current setting that the system utilizes.")}get defaultSSLKeyType(){return this.sslTypeForm.get("defaultSSLKeyType")}get toggleHelpLabel(){return this.locale.maketext(this.showAllHelp?"Hide Help Text":"Show Help Text")}get loading(){return!this.defaultSSLKeyType.value||""===this.defaultSSLKeyType.value}get saveButtonState(){return this.saving?l.FP.loading:l.FP.enabled}get saving(){return this._saving}get showWarning(){return this.hasChanged(this.defaultSSLKeyType)&&this.currentDefaultKeyType!==this.defaultSSLKeyType.value}toggleHelp(){this.showAllHelp=!this.showAllHelp}hasChanged(t){return t.dirty||t.touched}showDefaultLabel(t){return!!t&&t===this.unsetDefaultKeyType}showCurrentLabel(t){return!!t&&t===this.currentDefaultKeyType}getKeyTypeByValue(t){return this.sslDefaultKeyTypeOptions.find(n=>{if(n.value===t)return!0})}submit(){this._saving=!0;const t=this.defaultSSLKeyType.value,n=this.getKeyTypeByValue(t);this.configurationService.setCurrentSSLDefaultKeyType(t).subscribe(()=>{this._alert.success(this.locale.maketext("The system updated the default [asis,SSL/TLS] key type to \u201c[_1]\u201d.",n.label)),this.defaultSSLKeyType.value===t&&(this.sslTypeForm.markAsPristine(),this.sslTypeForm.markAsUntouched()),this._saving=!1})}ngOnInit(){this.sslTypeForm=new r.cw({defaultSSLKeyType:new r.NI}),this.sslDefaultKeyTypeOptions=this.configurationService.getSSLDefaultKeyTypeOptions().map(this._addKeyDescription.bind(this)),this.unsetDefaultKeyType=this.configurationService.getSSLDefaultKeyType(),this.configurationService.getCurrentSSLDefaultKeyType().subscribe(t=>{this.defaultSSLKeyType.setValue(t),this.currentDefaultKeyType=t})}_addKeyDescription(t){return t.description=this.keyDescriptions[t.value],t.value.match(/ecdsa/)&&(t.description+=" ",t.description+=this.locale.maketext("[asis,ECDSA] is recommended for systems running [output,acronym,LSWS,LiteSpeed Web Servers].")),t}}return i.\u0275fac=function(t){return new(t||i)(e.Y36(_.g),e.Y36(m),e.Y36(l.c9),e.Y36(f))},i.\u0275cmp=e.Xpm({type:i,selectors:[["cp-tls-root"]],decls:6,vars:2,consts:[["id","loadingSpinner",4,"ngIf","ngIfElse"],["mainContent",""],["resourceTemplate",""],["id","loadingSpinner"],["id","content"],[1,"description"],[1,"row"],[1,"col-xs-12","col-lg-8"],[1,"col-md-4","hidden-xs","hidden-sm","pull-right","flip"],[1,"section"],[4,"ngTemplateOutlet"],[1,"col-xs-12","col-sm-12","col-md-8","pull-left","flip"],["id","sslTLSConfigurations","name","sslTLSConfigurations",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"],[1,"panel-body"],["id","defaultSSLTypeGroup",1,"form-group"],[1,"col-xs-12"],["id","defaultSSLKeyTypeLabel","for","defaultSSLKeyType",3,"labelText","showInfoBlock"],["class","radio",4,"ngFor","ngForOf"],["id","defaultSSLKeyTypeWarning","callout-type","warning",4,"ngIf"],[1,"panel-footer"],["id","btnUpdateSSLDefaultType","name","submitButton",3,"buttonState","title","click"],["class","fas fa-save","aria-hidden","true",4,"ngIf"],[1,"col-xs-12","hidden-lg","hidden-md"],[1,"radio"],["type","radio","name","defaultSSLKeyType",3,"formControl","value"],["class","label label-success",3,"title",4,"ngIf"],["class","help-block",3,"innerHtml",4,"ngIf"],[1,"label","label-success",3,"title"],[1,"help-block",3,"innerHtml"],["id","defaultSSLKeyTypeWarning","callout-type","warning"],[3,"innerHtml"],["aria-hidden","true",1,"fas","fa-save"],[1,"widget"],[1,"widget-title"],["id","linkConfigureAutoSSL","iconClass","fas fa-wrench","href","/scripts12/autossl",3,"title"],["id","linkConfigureWebdiskCiphers","iconClass","fas fa-wrench","href","/scripts2/cpdavdconfiguration",3,"title"],["id","linkConfigureApacheCiphers","iconClass","fas fa-wrench","href","/scripts2/globalapachesetup?find=SSL",3,"title"],["id","linkConfigureWebServiceCiphers","iconClass","fas fa-wrench","href","/scripts2/cpsrvdconfiguration",3,"title"],["id","linkConfigureInstallSSL","iconClass","fas fa-wrench","href","/scripts2/installssl",3,"title"],["id","linkConfigureSSLStorage","iconClass","fas fa-wrench","href","/scripts2/sslmanager",3,"title"],["id","linkAboutTheInterface","href","https://go.cpanel.net/whmdocsSSLTLSConfiguration",3,"title"]],template:function(t,n){if(1&t&&(e._UZ(0,"cp-alert-list"),e.YNc(1,Z,1,0,"cp-loading-spinner",0),e.YNc(2,Q,39,15,"ng-template",null,1,e.W1O),e.YNc(4,O,22,16,"ng-template",null,2,e.W1O)),2&t){const o=e.MAs(3);e.xp6(1),e.Q6J("ngIf",n.loading)("ngIfElse",o)}},directives:[l.hF,h.O5,l.go,h.tP,r._Y,r.JL,r.sg,l._P,h.sg,r._,r.Fj,r.JJ,r.oH,l.Oc,l.xV,w],encapsulation:2}),i})(),q=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.oAB({type:i,bootstrap:[j]}),i.\u0275inj=e.cJS({providers:[m,l.c9,{provide:f,useValue:L}],imports:[[u.b2,l.kM,r.UX,r.u5,l.nM,y.JF,l.zr,l.zf,l.CQ,l.df,T.m]]}),i})();(0,e.G48)(),u.q6().bootstrapModule(q).catch(i=>console.error(i))}},p=>{p.O(0,[736],()=>p(p.s=7280)),p.O()}]);