"use strict";(self.webpackChunkaccount_preferences=self.webpackChunkaccount_preferences||[]).push([[792],{585:(p,u,s)=>{var f=s(345),a=s(5737),m=s(6381),t=s(3953);class d{}var h=s(177),v=s(1413),y=s(6977),g=s(6697),b=s(980),c=s(9417),C=s(6354),S=s(3280),k=s(6802),P=s(2584),B=s(6822);let N=(()=>{class o{constructor(e){this.http=e}get(){return this.http.post(new S.V({namespace:"Personalization",method:"get",arguments:[new k.e("names",["common-alertList"])],config:{json:!0}})).pipe((0,C.T)(e=>{const n=e.data.personalization["common-alertList"];return n.success=(0,P.G)(n.success),n.value=JSON.parse(n.value),e}))}set(e){return this.http.post(new S.V({namespace:"Personalization",method:"set",arguments:[new k.e("personalization",e)],config:{json:!0}})).pipe((0,C.T)(n=>n))}static#t=this.\u0275fac=function(n){return new(n||o)(t.KVO(B.dF))};static#e=this.\u0275prov=t.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})(),F=(()=>{class o{constructor(e,n,i,r,l){this.locale=e,this.analyticsBuilder=n,this.personalizationService=i,this.page=r,this.el=l,this.notificationEvent=new t.bkB,this.createBtn={id:"saveConsentBtn",type:"button",buttonState:a.w.enabled},this.stop$=new v.B}ngOnInit(){this.consentAndPrivacyForm=this.analyticsBuilder.group({analyticsCheckControl:[this.getAnalyticsConsent(this.page?.analytics_info?.analytics)]}),this.consentAndPrivacyForm.valueChanges.pipe((0,y.Q)(this.stop$)).subscribe(()=>{this.createBtn.buttonState=this.consentAndPrivacyForm.valid?a.w.enabled:a.w.disabled})}getAnalyticsConsent(e){return"on"===e}saveAnalyticsPreferences(){this.createBtn.buttonState=a.w.loading;const e={analytics:this.consentAndPrivacyForm.controls.analyticsCheckControl.value?"on":"off"};this.personalizationService.set(e).pipe((0,g.s)(1),(0,b.j)(()=>this.createBtn.buttonState=a.w.enabled)).subscribe({next:n=>{if(JSON.parse(n?.data?.personalization.analytics?.success)){"on"==e?.analytics?this.triggerConsentSavedEvent(!0):this.triggerConsentSavedEvent(),this.position=JSON.parse(this.page?.systemNotification||null)?.position;const r=this.locale.maketext("Successfully updated the Consent and Privacy Preferences.");this.notificationEvent.emit({notificationMessage:r,notificationType:a._n.success})}else this.handleError()},error:n=>this.handleError()})}handleError(){const e=this.locale.maketext("Unable to update the Consent and Privacy Preferences.");this.notificationEvent.emit({notificationMessage:e,notificationType:a._n.error})}triggerConsentSavedEvent(e=!1){const n=new CustomEvent("consentPrivacySaved",{bubbles:!0,detail:{analytics:e}});this.el.nativeElement.dispatchEvent(n)}ngOnDestroy(){this.stop$?.next(),this.stop$?.complete()}static#t=this.\u0275fac=function(n){return new(n||o)(t.rXU(m.h),t.rXU(c.ze),t.rXU(N),t.rXU(d),t.rXU(t.aKT))};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["cp-acct-pref-consent-privacy"]],outputs:{notificationEvent:"notificationEvent"},features:[t.Jv_([a.JE])],decls:14,vars:8,consts:[[1,"mb-5"],["id","consentAndPrivacyForm","name","consentAndPrivacyForm",3,"formGroup"],[1,"card","h-100"],[1,"card-body"],[1,"d-flex","justify-content-start","align-items-end"],[1,"ri-xl","ri-bar-chart-grouped-line","me-2"],[1,"card-title"],["data-testid","analyticsPageDescription",3,"innerHTML"],[1,"form-check","mb-4"],["data-testid","analyticsCheckbox","type","checkbox","formControlName","analyticsCheckControl","name","analyticsCheck","id","analyticsCheck",1,"form-check-input"],["for","analyticsCheck","data-testid","analyticsCheckboxLabel",3,"innerHTML"],["data-testid","analyticsSaveBtn",1,"mt-4",3,"btnClick","id","type","buttonState"]],template:function(n,i){1&n&&(t.j41(0,"div",0)(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),t.nrm(5,"i",5),t.j41(6,"h5",6),t.EFF(7),t.k0s()(),t.nrm(8,"p",7),t.j41(9,"div",8),t.nrm(10,"input",9)(11,"label",10),t.k0s(),t.j41(12,"cp-button",11),t.bIt("btnClick",function(){return i.saveAnalyticsPreferences()}),t.EFF(13),t.k0s()()()()()),2&n&&(t.R7$(),t.Y8G("formGroup",i.consentAndPrivacyForm),t.R7$(6),t.SpI(" ",i.locale.maketext("Consent and Privacy[comment,title]")," "),t.R7$(),t.Y8G("innerHTML",i.locale.maketext("WebPros International, LLC d.b.a cPanel is asking for your consent to participate in user activity tracking using third-party software for the purpose of understanding the performance of Webpros products. Information will be used pursuant to the [output,url,_1,cPanel and WHM Privacy Policy,title,cPanel and WHM Privacy Policy,data-testid,_2,target,_3,class,_4] and may be shared internally within the Webpros group.","https://go.cpanel.net/privacy","privacy-policy","privacy-policy","external-link"),t.npT),t.R7$(3),t.Y8G("innerHTML",i.locale.maketext("Allow tracking: By checking this box, you agree that we may collect your usage statistics. [output,url,_1,Learn more here,title,cPanel Analytics Documentation,class,_2,target,_3,id,_4,data-testid,_5].","https://go.cpanel.net/analytics","external-link","analytics","learnLink","learnAnalyticsLink"),t.npT),t.R7$(),t.Y8G("id",i.createBtn.id)("type",i.createBtn.type)("buttonState",i.createBtn.buttonState),t.R7$(),t.JRh(i.locale.maketext("Save Changes")))},dependencies:[c.qT,c.Zm,c.BC,c.cb,c.j4,c.JD,a.Qp],styles:[".red-color[_ngcontent-%COMP%]{color:#dc3545}"]})}return o})();var R=s(6344);const T=()=>({"data-testid":"systemNotificationSelectInput"});let j=(()=>{class o{constructor(e,n,i,r){this.analyticsBuilder=e,this.personalizationService=n,this.locale=i,this.page=r,this.notificationEvent=new t.bkB,this.notificationListPositions=Object.values(a.Rk).map(l=>({name:l,value:l})),this.createBtn={id:"saveSystemNotificationsBtn",type:"button",buttonState:a.w.enabled},this.stop$=new v.B}ngOnInit(){const e=JSON.parse(this.page?.systemNotification||null)?.position||a.Rk.topRight;this.systemNotificationForm=this.analyticsBuilder.group({notificationTypesControl:[{name:e,value:e},[c.k0.required]]}),this.systemNotificationForm.valueChanges.pipe((0,y.Q)(this.stop$)).subscribe(()=>{this.createBtn.buttonState=this.systemNotificationForm.valid?a.w.enabled:a.w.disabled})}saveNotifications(){this.createBtn.buttonState=a.w.loading;const e={"common-alertList":JSON.stringify({position:this.systemNotificationForm.controls.notificationTypesControl?.value?.value})};this.personalizationService.set(e).pipe((0,g.s)(1),(0,b.j)(()=>this.createBtn.buttonState=a.w.enabled)).subscribe({next:n=>{const i=n?.data?.personalization["common-alertList"];if(this.position=JSON.parse(i?.value)?.position,i?.success){const r=this.locale.maketext("Successfully updated the system notification to \u201c[_1]\u201d.",this.position);this.page.systemNotification=JSON.stringify({position:this.systemNotificationForm.controls.notificationTypesControl?.value?.value}),this.notificationEvent.emit({notificationMessage:r,notificationType:a._n.success})}else this.handleError()},error:n=>this.handleError()})}handleError(){const e=this.locale.maketext("Unable to update the system notification to \u201c[_1]\u201d.",this.position);this.notificationEvent.emit({notificationMessage:e,notificationType:a._n.error})}ngOnDestroy(){this.stop$.next(),this.stop$.complete()}static#t=this.\u0275fac=function(n){return new(n||o)(t.rXU(c.ze),t.rXU(N),t.rXU(m.h),t.rXU(d))};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["cp-acct-pref-system-notifications"]],outputs:{notificationEvent:"notificationEvent"},decls:12,vars:10,consts:[["id","systemNotificationForm","name","systemNotificationForm",3,"formGroup"],[1,"card","h-100"],[1,"card-body"],[1,"d-flex","justify-content-start","align-items-end"],[1,"ri-xl","ri-notification-line","me-2"],[1,"card-title"],["data-testid","systemNotificationPageDescription",3,"innerHTML"],[1,"mb-5"],["data-testid","systemNotificationSelect","placeholder","Select notification type","formControlName","notificationTypesControl","bindLabel","name",3,"items","inputAttrs"],["data-testid","systemNotificationSaveButton",1,"mt-2",3,"btnClick","id","type","buttonState"]],template:function(n,i){1&n&&(t.j41(0,"form",0)(1,"div",1)(2,"div",2)(3,"div",3),t.nrm(4,"i",4),t.j41(5,"h5",5),t.EFF(6),t.k0s()(),t.nrm(7,"p",6),t.j41(8,"div",7),t.nrm(9,"ng-select",8),t.k0s(),t.j41(10,"cp-button",9),t.bIt("btnClick",function(){return i.saveNotifications()}),t.EFF(11),t.k0s()()()()),2&n&&(t.Y8G("formGroup",i.systemNotificationForm),t.R7$(6),t.SpI(" ",i.locale.maketext("System Notifications")," "),t.R7$(),t.Y8G("innerHTML",i.locale.maketext("System notifications show you errors, warnings, and success messages. Select the interface location in the dropdown to set where you want to see system notifications. For more information about system notifications, visit the [output,url,_1,documentation,title,documentation,class,_2,target,_3,id,_4,data-testid,_5].","https://docs.cpanel.net/cpanel/preferences/account-preferences/","external-link","notification","learnLink","learnNotificationLink"),t.npT),t.R7$(2),t.Y8G("items",i.notificationListPositions)("inputAttrs",t.lJ4(9,T)),t.R7$(),t.Y8G("id",i.createBtn.id)("type",i.createBtn.type)("buttonState",i.createBtn.buttonState),t.R7$(),t.JRh(i.locale.maketext("Save Changes")))},dependencies:[c.qT,c.BC,c.cb,c.j4,c.JD,a.Qp,R.vr]})}return o})();function x(o,V){if(1&o){const e=t.RV6();t.j41(0,"div",3)(1,"cp-acct-pref-consent-privacy",4),t.bIt("notificationEvent",function(i){t.eBV(e);const r=t.XpG();return t.Njj(r.sendNotification(i))}),t.k0s()()}}function A(o,V){if(1&o&&(t.j41(0,"div"),t.nrm(1,"cp-notification-list",6),t.k0s()),2&o){const e=t.XpG();t.R7$(),t.Y8G("position",e.position)}}let $=(()=>{class o{constructor(e,n,i){this.locale=e,this.notificationService=n,this.page=i,this.title="account-preferences"}sendNotification(e){switch(this.position=JSON.parse(this.page?.systemNotification||null)?.position||a.Rk.topRight,e.notificationType){case a._n.success:this.notificationService.success(e.notificationMessage);break;case a._n.error:this.notificationService.error(e.notificationMessage)}}static#t=this.\u0275fac=function(n){return new(n||o)(t.rXU(m.h),t.rXU(a.JE),t.rXU(d))};static#e=this.\u0275cmp=t.VBU({type:o,selectors:[["cp-acct-pref-root"]],decls:9,vars:3,consts:[[1,"row"],["id","cpanel",1,"mt-4"],["class","col-md-6 mb-4",4,"ngIf"],[1,"col-md-6","mb-4"],[3,"notificationEvent"],[4,"ngIf"],[3,"position"]],template:function(n,i){1&n&&(t.j41(0,"div",0)(1,"h6"),t.EFF(2),t.k0s()(),t.j41(3,"div",1)(4,"div",0),t.DNE(5,x,2,0,"div",2),t.j41(6,"div",3)(7,"cp-acct-pref-system-notifications",4),t.bIt("notificationEvent",function(l){return i.sendNotification(l)}),t.k0s()()()(),t.DNE(8,A,2,1,"div",5)),2&n&&(t.R7$(2),t.JRh(i.locale.maketext("Update your settings for cPanel.")),t.R7$(3),t.Y8G("ngIf",i.page.features.isUserAnalyticsRequiredByLeika),t.R7$(3),t.Y8G("ngIf",!!i.position))},dependencies:[h.bT,a.bR,F,j]})}return o})();var L=s(8658),G=s(4580),M=s(5992),U=s(3824),w=s(8580),J=s(779),O=s(3400),I=s(9966),z=s(7820),X=s(3816),Y=s(534),D=s(728),E=s(1562);let H=(()=>{class o{static#t=this.\u0275fac=function(n){return new(n||o)};static#e=this.\u0275mod=t.$C({type:o,bootstrap:[$]});static#n=this.\u0275inj=t.G2t({providers:[{provide:d,useValue:window.PAGE},{provide:h.kB,deps:[d],useFactory:e=>e.pageURL},{provide:Window,useValue:window},(0,E.$R)((0,E.Sx)())],imports:[f.Bb,L.B,X.jr.forRoot(),G.h6.forRoot(),M.G.forRoot(),w.zE.forRoot(),J.Q_.forRoot(),Y.Ss.forRoot(),I.k0.forRoot(),z.Hq.forRoot(),O.x6.forRoot(),U.YN.forRoot(),h.MD,c.X1,a.tm,c.YN,D.wb,a.nx,a.zJ,R.MQ,a.CF]})}return o})();f.sG().bootstrapModule(H).catch(o=>console.error(o))}},p=>{p.O(0,[128,996,538],()=>p(p.s=585)),p.O()}]);