PageSourceSearch

https://app.waitwhile.com/chunk-BYSNR3AV.js

js waitwhile.com collected 2026-10-01 10:17:37 UTC 5,551 bytes, 2 lines download raw bytes

1import{Aa as E,B as v,Fb as L,Fu as ie,Ga as M,Gb as P,Ia as B,Ic as q,Jm as J,K as T,Km as Q,Lc as m,M as U,N as c,O as W,Oa as z,Oc as H,Pa as O,Qa as D,Rg as K,S as $,Sb as _,Sg as V,Si as R,Tg as G,W as b,Wt as Z,Xt as ee,Yb as j,Z as r,Zv as re,_u as f,dl as Y,g as S,gn as h,h as k,hr as X,i as a,jh as N,ju as te,k as C,l as n,o as x,v as g,xa as F,y as w,ya as A}from"./chunk-N6MTJI5Q.js";import"./chunk-UNNH6OJB.js";import{h as I}from"./chunk-HE2D45TV.js";var oe=(o,y)=>{let e=r(f),t=r(m),i=r(h),s=r(Z);return e.impersonator$.pipe(v(1),c(u=>u?k(e.exitImpersonation(u)).pipe(n(()=>!1),w(()=>(t.navigate(["/"]),a(!1)))):s.unassertedUser$.pipe(n(d=>d?d.roles.includes(X.SUPER)?!0:(t.navigate(["/"]),!1):(t.navigate(["/login"],{queryParams:{redirect:y.url}}),i.open({message:$localize`To impersonate you must first login`}),!1)))),v(1))};function se(o,y){o&1&&(z(0,"div",0),D(1,"mat-spinner"),O())}var l=(()=>{class o extends Y{constructor(){super(),this.createUserTokenWrite=r(re),this.firebaseAuth=r(N),this.impersonationService=r(f),this.impersonationRx=r(te),this.locationRx=r(ee),this.requestErrorHandler=r(G),this.route=r(q),this.router=r(m),this.snackBar=r(h),this.sessionRx=r(ie),this.targetIds$=this.impersonationRx.isImpersonating$.pipe(g(e=>!e),c(()=>this.route.params),c(e=>e.accountId?R(e.accountId)?this.impersonationService.getOwnerIdFromAccountId(e.accountId).pipe(n(t=>({userId:t,locationId:null}))):this.impersonationService.getOwnerIdFromAccountShortname(e.accountId).pipe(n(t=>({userId:t,locationId:null}))):e.locationId?R(e.locationId)?this.impersonationService.getOwnerIdFromLocationId(e.locationId).pipe(n(t=>({userId:t,locationId:e.locationId}))):this.impersonationService.getLocationStatusFromLocationShortname(e.locationId).pipe(c(t=>{if(!t||!t.accountId)return a({userId:null,locationId:null});let i=t.id;return this.impersonationService.getOwnerIdFromAccountId(t.accountId).pipe(n(s=>({userId:s,locationId:i})))})):e.email?this.impersonationService.getUserIdFromUserEmail(e.email).pipe(n(t=>({userId:t,locationId:null}))):e.userId?a({userId:e.userId,locationId:null}):S),this.shareReplay()),this.target$=this.targetIds$.pipe($(this.route.queryParams),n(([{userId:e,locationId:t},i])=>{let s=i.redirect?decodeURIComponent(i.redirect):void 0,u=i.useTargetPermissions==="true";return{userId:e,locationId:t,redirect:s,useTargetPermissions:u}})),this.account$=this.targetIds$.pipe(c(({userId:e})=>e?this.impersonationService.getUserById(e):a(void 0)),c(e=>!e||!e.accountId?a(void 0):this.impersonationService.getAccountById(e.accountId))),this.result$=this.account$.pipe($(this.target$),c(([e,t])=>{if(!t.userId)return this.snackBar.open({message:$localize`Could not find a user to impersonate. Did you input the right information?`,duration:1e4,action:$localize`OK`}),this.router.navigate(["/"],{replaceUrl:!0}),a(void 0);if(!e)return this.snackBar.open({message:$localize`Could not find an account to impersonate. Did you input the right information?`,duration:1e4,action:$localize`OK`}),this.router.navigate(["/"],{replaceUrl:!0}),a(void 0);if(e.isDisabled)return this.snackBar.open({message:$localize`Could not impersonate since the target account is disabled.`,duration:1e4,action:$localize`OK`}),this.router.navigate(["/"],{replaceUrl:!0}),a({type:"account-disabled"});let{userId:i,locationId:s,redirect:u,useTargetPermissions:d}=t;return this.createUserTokenWrite.api({userId:i,useTargetPermissions:d}).pipe(this.requestErrorHandler.catchRequestError(p=>K(p)&&V(p.error)&&p.error.errorCode==="action_requires_reauthentication"?{retry:x(()=>this.createUserTokenWrite.api({userId:i,useTargetPermissions:d}))}:{userFacing:$localize`Could not impersonate user.`},null),n(p=>{if(!p?.authToken){this.snackBar.open({message:$localize`Could not get an impersonation token.`,duration:1e4,action:$localize`OK`});return}return{type:"authenticated",authToken:p.authToken,locationId:s,redirect:u}}))}),T({bufferSize:1,refCount:!0})),this.isLoading$=this.result$.pipe(n(()=>!1),U(!0)),this.subscribeToResult()}subscribeToResult(){return I(this,null,function*(){this.result$.pipe(W(this.ngOnDestroy$)).subscribe(e=>{if(e){if(e.type==="account-disabled"){this.router.navigate(["/"]);return}if(e.type==="authenticated"){this.impersonationService.setImpersonator();let{authToken:t,locationId:i,redirect:s}=e;this.signInWithToken(t,i??void 0,s);return}}})})}signInWithToken(e,t,i){return I(this,null,function*(){if(yield this.firebaseAuth.signOut(),yield this.firebaseAuth.signInWithCustomToken(e),t&&this.locationRx.setForcedLocationId(t),yield C(this.sessionRx.isValidSession$.pipe(g(u=>u))),!i){this.router.navigate(["/"],{replaceUrl:!0});return}let s=i.startsWith("/")?i:`/${i}`;yield this.router.navigateByUrl(s,{replaceUrl:!0})})}static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275cmp=F({type:o,selectors:[["ng-component"]],standalone:!1,features:[E],decls:2,vars:3,consts:[[1,"flex","justify-center","p-4"]],template:function(t,i){t&1&&(M(0,se,2,0,"div",0),L(1,"async")),t&2&&B(P(1,1,i.isLoading$)?0:-1)},dependencies:[J,_],encapsulation:2,changeDetection:0})}}return o}
1)();var ae=[{path:"",canActivate:[oe],children:[{path:"account/:accountId",component:l},{path:"location/:locationId",component:l},{path:"user/:userId",component:l},{path:"email/:email",component:l}]}],Be=(()=>{class o{static{this.\u0275fac=function(t){return new(t||o)}}static{this.\u0275mod=A({type:o})}static{this.\u0275inj=b({imports:[H.forChild(ae),j,Q]})}}return o})();export{Be as WwImpersonationModule};
2//noopchunk-BYSNR3AV.js.map

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.