1import{a as u}from"./chunk-7LVTGPPG.js";import{n as g,p as h}from"./chunk-MAMFQQB4.js";import{$b as m,Na as a,aa as p,xb as f}from"./chunk-6O6WDLEP.js";import"./chunk-FO65GQC2.js";var s=class extends Error{};s.prototype.name="InvalidTokenError";function y(o){return decodeURIComponent(atob(o).replace(/(.)/g,(n,t)=>{let e=t.charCodeAt(0).toString(16).toUpperCase();return e.length<2&&(e="0"+e),"%"+e}))}function b(o){let n=o.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return y(n)}catch{return atob(n)}}function k(o,n){if(typeof o!="string")throw new s("Invalid token specified: must be a string");n||(n={});let t=n.header===!0?0:1,e=o.split(".")[t];if(typeof e!="string")throw new s(`Invalid token specified: missing part #${t+1}`);let i;try{i=b(e)}catch(r){throw new s(`Invalid token specified: invalid base64 for part #${t+1} (${r.message})`)}try{return JSON.parse(i)}catch(r){throw new s(`Invalid token specified: invalid json for part #${t+1} (${r.message})`)}}var j=(()=>{class o{constructor(t,e,i){this.route=t,this.router=e,this.tokenService=i}ngOnInit(){this.initializeTokenFromUrl()}initializeTokenFromUrl(){this.route.fragment.subscribe(t=>{if(t){let e=new URLSearchParams(t),i=e.get("id_token")||e.get("access_token");if(console.log("Token Capturado:",i),i){let r=i;sessionStorage.setItem("token",r);let c=k(r);this.tokenService.setTokenObject(c);for(let d in c){let l=c[d];typeof l=="object"?sessionStorage.setItem(d,JSON.stringify(l)):sessionStorage.setItem(d,l.toString())}sessionStorage.getItem("extension_CompanyId")==="a2f7c3e1-4d9b-4c3a-8b69-45e8e72f2c6f"?window.location.href=`https://one.lexyia.com.br/lexyia/login-sso?id_token=${r}`:window.location.href=`https://corp.lexyia.com.br/lexyia/login-sso?id_token=${r}`}else this.router.navigate(["/pontoia"])}})}static{this.\u0275fac=function(e){return new(e||o)(a(g),a(h),a(u))}}static{this.\u0275cmp=p({type:o,selectors:[["app-login-sso"]],standalone:!0,features:[f],decls:0,vars:0,template:function(e,i){},dependencies:[m],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return o})();export{j as LoginSsoComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.