import{k as p}from"./chunk-5Z3QBZPS.js";import{f as U,i as q}from"./chunk-V2DPLVZ2.js";import"./chunk-LMJERMSP.js";import{$a as B,I as T,Ia as M,O as D,Oa as _,Pa as j,R as O,Ra as A,Ta as F,ba as R,da as L,ib as N,jb as Y,kb as J}from"./chunk-OGMMZFJL.js";import{Da as w,Eb as x,G as b,Gc as m,Hc as d,Ic as k,N as C,Sc as I,Yc as h,Zc as g,aa as y,fd as E,gc as l,hc as s,la as a,ob as c,rc as P,t as v,u as S,ub as o}from"./chunk-QVZULMP5.js";import{i as u}from"./chunk-2AVGQ2MQ.js";var le=(()=>{class i{#t;#e;#o;constructor(e,t,n,f,z,G){this.authService=e,this.router=t,this.apiService=n,this.titleService=f,this.userRoleService=z,this.cdr=G,this.title="Logout Page",this.portalSSOutEnable=!1,this.cloudPropertyElement=null,this.#t=a(D),this.#e=a(F),this.colorMode=this.#e.colorMode,this.#o=a(w),this.currentYear=new Date().getFullYear(),this.#e.localStorageItemName.set("theme-default"),this.#e.eventName.set("ColorSchemeChange"),this.#t.queryParams.pipe(C(1),S(r=>r.theme?.match(/^[A-Za-z0-9\s]+/)?.[0]),b(r=>["dark","light","auto"].includes(r)),y(r=>{this.colorMode.set(r)}),L(this.#o)).subscribe(),this.titleService.setTitle(this.title)}ngOnInit(){return u(this,null,function*(){try{yield this.getCloudProperties(),this.logout()}catch(e){console.error("ngOnInit error in LogoutComponent:",e)}})}logout(){try{let e=localStorage.getItem("theme-default");this.authService.clearToken(),localStorage.clear(),e&&localStorage.setItem("theme-default",e),this.userRoleService.clear(),this.portalSSOutEnable==!0&&setTimeout(()=>{window.open("https://login.microsoftonline.com/common/oauth2/v2.0/logout","_blank")},3e3),this.router.url!=="/logout"&&this.router.navigate(["/logout"])}catch(e){console.error("Logout failed:",e)}}goToLogin(){this.authService.clearToken(),this.router.navigate(["/login"])}getCloudProperties(){return u(this,null,function*(){try{let e=yield v(this.apiService.cloudProperties()),t=e?.body?JSON.parse(JSON.stringify(e.body)):{};this.cloudPropertyElement=t.cloudPropertyElement,this.portalSSOutEnable=this.cloudPropertyElement.portalSSOutEnable,this.cdr.detectChanges()}catch(e){throw console.error("Error from getCloudProperties: ",e),e}})}static{this.\u0275fac=function(t){return new(t||i)(o(U),o(O),o(p),o(T),o(q),o(E))}}static{this.\u0275cmp=x({type:i,selectors:[["app-logout"]],features:[I([p])],decls:19,vars:7,consts:[[1,"bg-light","dark:bg-transparent","min-vh-100","d-flex","flex-row","align-items-center"],["breakpoint","md"],[1,"justify-content-center"],["lg","10","xl","8"],[1,"p-4"],["cForm",""],["xs","6"],["cButton","","color","primary",1,"logout-btn",3,"click"],[1,"text-center"],["href","https://www.crashplan.com","target","_blank",2,"color","#062D4D","text-decoration","none"]],template:function(t,n){t&1&&(l(0,"div",0)(1,"c-container",1)(2,"c-row",2)(3,"c-col",3)(4,"c-card-group")(5,"c-card",4)(6,"c-card-body")(7,"form",5)(8,"h2"),m(9),h(10,"translate"),s(),l(11,"c-row")(12,"c-col",6)(13,"button",7),P("click",function(){return n.goToLogin()}),m(14),h(15,"translate"),s()()()()()()()()()()(),l(16,"div",8)(17,"a",9),m(18),s()()),t&2&&(c(9),d(g(10,3,"You have been successfully logged out")),c(5),d(g(15,5,"Login to Portal")),c(4),k("\xA9 CrashPlan ",n.currentYear," "))},dependencies:[N,J,Y,A,_,j,B,M,R],styles:[".logout-btn[_ngcontent-%COMP%]{color:#fff!important;background-color:#35b7f4!important;border-color:#35b7f4!important;transition:none}.logout-btn[_ngcontent-%COMP%]:hover{transition:background-color .3s ease-in-out,box-shadow .3s ease-in-out;background-color:#35b7f4!important;box-shadow:0 0 5px #0003}"]})}}return i})();export{le as LogoutComponent};
