1import{a as X}from"./chunk-WVFBOYBV.js";import{a as It}from"./chunk-QFWDB6FK.js";import{a as Ut}from"./chunk-S5X3BRPE.js";import{a as Lt}from"./chunk-C6VAAMFV.js";import{a as ht}from"./chunk-PJV6LDFC.js";import{n as Dt}from"./chunk-AVNXF7VD.js";import{a as vt,b as wt}from"./chunk-HZUKFGI6.js";import"./chunk-3RCJDWPE.js";import"./chunk-5NGGNZQM.js";import"./chunk-O7M4JDIM.js";import"./chunk-KPDEQWHW.js";import"./chunk-WRVIIUXK.js";import"./chunk-LN5XKMNB.js";import"./chunk-QO5A3F3Y.js";import"./chunk-WHL7LWMY.js";import"./chunk-ZH6NLAOL.js";import"./chunk-AGET5VCK.js";import"./chunk-I6DU53UU.js";import"./chunk-2OU64ZHR.js";import"./chunk-NXF4L5RT.js";import"./chunk-KEK77U7R.js";import"./chunk-G6J44ARL.js";import"./chunk-7RH43WNR.js";import"./chunk-67DCWTE4.js";import"./chunk-2NJK4MTM.js";import"./chunk-LHMPABQI.js";import"./chunk-ZU73LWWM.js";import"./chunk-GIMA7KY7.js";import"./chunk-DIQ5O6VR.js";import"./chunk-AJ7LP5PW.js";import"./chunk-A4WHSYFL.js";import"./chunk-3FU5CIVU.js";import"./chunk-MJMR4HDF.js";import"./chunk-VOSRJFEU.js";import"./chunk-LSSRKN4L.js";import"./chunk-3OEULWSU.js";import"./chunk-SF627MGU.js";import"./chunk-AKIZZQ5L.js";import"./chunk-H64PJFMC.js";import"./chunk-AI6OPKIJ.js";import{a as xt}from"./chunk-TSBKPDV5.js";import"./chunk-6MXIY2T5.js";import"./chunk-NIZHEZTJ.js";import"./chunk-SMSVQKUS.js";import"./chunk-G67CPOUZ.js";import"./chunk-QVZZFICN.js";import"./chunk-CDZUFVJ5.js";import"./chunk-KX6VSGM4.js";import"./chunk-H464U3YW.js";import"./chunk-GH2QDE5U.js";import"./chunk-EF2UGFTJ.js";import"./chunk-YTEIBNV2.js";import{a as Pt,b as Nt,c as kt,d as $t}from"./chunk-PTF2YNMW.js";import"./chunk-BVUEGLEI.js";import"./chunk-5VMF6AWD.js";import"./chunk-ULVHDWHD.js";import"./chunk-BDPYG7QH.js";import"./chunk-CIVZ6HBH.js";import"./chunk-AXJXZVBV.js";import"./chunk-OQJ2GXV4.js";import"./chunk-QNY256YL.js";import"./chunk-7YXGOQQW.js";import{a as bt}from"./chunk-5FI2CFOQ.js";import"./chunk-EASZWRLC.js";import{a as W}from"./chunk-D4SYCBUB.js";import"./chunk-OQCUSKEX.js";import{a as gt}from"./chunk-M52DWHN3.js";import"./chunk-PJXQPZ7M.js";import"./chunk-ZJ5AAPDT.js";import"./chunk-K6SAUG27.js";import"./chunk-U7WZQGKK.js";import"./chunk-NWEDE4WZ.js";import"./chunk-7HGEJW2S.js";import"./chunk-3GL4B3JL.js";import"./chunk-J7NINB53.js";import"./chunk-EAMPKAT4.js";import"./chunk-YBYFRSS7.js";import"./chunk-ZOCKJWKJ.js";import"./chunk-HFGZAP5C.js";import{a as St,d as Ct,e as Et}from"./chunk-QFRG2M76.js";import"./chunk-AGV4VVBA.js";import"./chunk-KE3H4RT7.js";import{f as yt}from"./chunk-JTYFTMKE.js";import"./chunk-VOKAWSQ7.js";import"./chunk-J2XSVHXC.js";import"./chunk-PHRPH3PI.js";import"./chunk-2NTIDCXA.js";import{m as At}from"./chunk-2DH5HUHN.js";import"./chunk-JMSKMDYR.js";import"./chunk-3COI7UMI.js";import"./chunk-IK4KIDRR.js";import"./chunk-FUYGZNFG.js";import"./chunk-VRMS3BZC.js";import"./chunk-NCT2X7WQ.js";import"./chunk-KF3I4JOE.js";import{a as Tt}from"./chunk-OF3PLAMF.js";import"./chunk-HFQKIM4N.js";import"./chunk-H73LUCLC.js";import"./chunk-SH35P5OH.js";import"./chunk-ZJCPM7GQ.js";import"./chunk-CQJYMVMG.js";import"./chunk-NQZH72VX.js";import"./chunk-QIHP3UL7.js";import"./chunk-5T7O2PVP.js";import"./chunk-BQ6ZQCNP.js";import"./chunk-WKXYMJZD.js";import"./chunk-IAZKVN7K.js";import"./chunk-UK77E2VQ.js";import"./chunk-CYT5WFM2.js";import"./chunk-O3NNXUH7.js";import"./chunk-ORHRQCEQ.js";import"./chunk-VOBLALB3.js";import"./chunk-TILKVCLV.js";import"./chunk-5CV23JOC.js";import"./chunk-WIOE7GMX.js";import"./chunk-DJBQF53X.js";import"./chunk-6663LS63.js";import"./chunk-UKFX7ZFT.js";import"./chunk-2NBRREAK.js";import"./chunk-UGRWNU6D.js";import"./chunk-D6KOQZLJ.js";import"./chunk-22IQPPFG.js";import{a as Mt}from"./chunk-LYKH4BRY.js";import"./chunk-ETDGRGQ6.js";import"./chunk-PB5SNKA2.js";import"./chunk-I3FG3M7S.js";import"./chunk-E4BX2XKI.js";import{c as Rt}from"./chunk-W7FQNKAV.js";import"./chunk-NRRCW2VX.js";import"./chunk-YBULNWC6.js";import"./chunk-O2QQ5VAD.js";import"./chunk-73GEHDSI.js";import"./chunk-JYDDFEZK.js";import"./chunk-UG4STXAK.js";import"./chunk-5CA5PBRX.js";import"./chunk-KEUKURBA.js";import"./chunk-FBG2X6LH.js";import"./chunk-RSDQOQIM.js";import"./chunk-V4ZM7SXN.js";import"./chunk-BJNHO3QB.js";import{a as Ot}from"./chunk-WOJHBBSB.js";import{a as H}from"./chunk-4LING6RH.js";import{E as pt,F as L,H as ft,J as _t,a as xe,b as be,c as We,d as Xe,e as Je,s as qe,u as ie}from"./chunk-YUF7LLLH.js";import"./chunk-ILO4ZXSP.js";import{d as mt,g as ut}from"./chunk-BJVNMKDT.js";import{b as j,d as Ve,f as Be,g as z,h as je,j as ze,k as Ke,l as Ge,m as Ye,n as He,r as ne}from"./chunk-HSR5XPRD.js";import{c as nt,d as it,f as st}from"./chunk-R6PN4VAS.js";import{Aa as ot,Ba as rt,b as $e,d as Fe,ma as G,sa as et,ua as tt,y as Qe}from"./chunk-E2CPCWXV.js";import"./chunk-RLFH4UIG.js";import{b as K}from"./chunk-CCZ7AUFI.js";import{h as M,j as we,k as Le,l as Ue,m as _}from"./chunk-5P6VEDXF.js";import{L as Y,M as dt,b as at,i as lt,p as ct}from"./chunk-TDJPADBB.js";import{$c as P,Aa as ge,Cc as b,Cd as te,D as pe,Fa as S,Ga as C,Hd as Ae,I as A,Kc as O,L as me,La as k,Lb as Oe,Ld as ye,Mc as u,Oa as he,Pa as Se,Pb as $,Ra as y,Uc as Re,Vc as ve,Wa as Ce,Yc as q,ad as ee,ba as ue,bc as Z,e as de,ed as F,fd as V,gd as B,j as w,ja as fe,ke as Ie,la as _e,lc as T,nc as R,nd as Ne,ne as De,od as Me,p as Q,pe as ke,qc as Pe,rb as Ee,rc as Te,sc as x,ta as h,tc as a,uc as l,vc as m,xb as p,ya as c}from"./chunk-EB7A3FJJ.js";import"./chunk-V5YSFTKA.js";import{b as Ze}from"./chunk-CK5RBEWP.js";import{a as s}from"./chunk-NM5BXVII.js";import{a as I,b as D}from"./chunk-E5QWB6YB.js";s();s();s();var Ft;function Vt(t){Ft??=new TextEncoder;let o=Ft.encode(t),e=new DataView(o.buffer,o.byteOffset,o.byteLength),n=Bt(e,o.length,0),i=Bt(e,o.length,102072);return n==0&&(i==0||i==1)&&(n=n^319790063,i=i^-1801410264),BigInt.asUintN(32,BigInt(n))<<BigInt(32)|BigInt.asUintN(32,BigInt(i))}function mn(t,o=""){let e=Vt(t);return o&&(e=BigInt.asUintN(64,e<<BigInt(1))|e>>BigInt(63)&BigInt(1),e+=Vt(o)),BigInt.asUintN(63,e).toString()}function Bt(t,o,e){let n=2654435769,i=2654435769,r=0,g=o-12;for(;r<=g;
1r+=12){n+=t.getUint32(r,!0),i+=t.getUint32(r+4,!0),e+=t.getUint32(r+8,!0);let d=jt(n,i,e);n=d[0],i=d[1],e=d[2]}let f=o-r;return e+=o,f>=4?(n+=t.getUint32(r,!0),r+=4,f>=8?(i+=t.getUint32(r,!0),r+=4,f>=9&&(e+=t.getUint8(r++)<<8),f>=10&&(e+=t.getUint8(r++)<<16),f===11&&(e+=t.getUint8(r++)<<24)):(f>=5&&(i+=t.getUint8(r++)),f>=6&&(i+=t.getUint8(r++)<<8),f===7&&(i+=t.getUint8(r++)<<16))):(f>=1&&(n+=t.getUint8(r++)),f>=2&&(n+=t.getUint8(r++)<<8),f===3&&(n+=t.getUint8(r++)<<16)),jt(n,i,e)[2]}function jt(t,o,e){return t-=o,t-=e,t^=e>>>13,o-=e,o-=t,o^=t<<8,e-=t,e-=o,e^=o>>>13,t-=o,t-=e,t^=e>>>12,o-=e,o-=t,o^=t<<16,e-=t,e-=o,e^=o>>>5,t-=o,t-=e,t^=e>>>3,o-=e,o-=t,o^=t<<10,e-=t,e-=o,e^=o>>>15,[t,o,e]}function zt(t,o,e,n,i=[]){let r={},g={},f={},d=un(t[0],t.raw[0]),E=[d.text],se=[],J=d.text;for(let v=1;v<t.length;v++){let{messagePart:le,placeholderName:U=_n(v),associatedMessageId:ce}=fn(t[v],t.raw[v]);J+=`{$${U}}${le}`,o!==void 0&&(r[U]=o[v-1],g[U]=i[v-1]),se.push(U),ce!==void 0&&(f[U]=ce),E.push(le)}let ae=d.customId||mn(J,d.meaning||""),pn=d.legacyIds?d.legacyIds.filter(v=>v!==ae):[];return{id:ae,legacyIds:pn,substitutions:r,substitutionLocations:g,text:J,customId:d.customId,meaning:d.meaning||"",description:d.description||"",messageParts:E,messagePartLocations:n,placeholderNames:se,associatedMessageIds:f,location:e}}function un(t,o){let{text:e,block:n}=Kt(t,o);if(n===void 0)return{text:e};{let[i,...r]=n.split("\u241F"),[g,f]=i.split("@@",2),[d,E]=g.split("|",2);return E===void 0&&(E=d,d=void 0),E===""&&(E=void 0),{text:e,meaning:d,description:E,customId:f,legacyIds:r}}}function fn(t,o){let{text:e,block:n}=Kt(t,o);if(n===void 0)return{messagePart:e};{let[i,r]=n.split("@@");return{messagePart:e,placeholderName:i,associatedMessageId:r}}}function Kt(t,o){if(o.charAt(0)!==":")return{text:t};{let e=gn(t,o);return{block:t.substring(1,e),text:t.substring(e+1)}}}function _n(t){return t===1?"PH":`PH_${t-1}`}function gn(t,o){for(let e=1,n=1;e<t.length;e++,n++)if(o[n]==="\\")n++;else if(t[e]===":")return e;throw new Error(`Unterminated $localize metadata block in "${o}".`)}var oe=class extends Error{parsedMessage;type="MissingTranslationError";constructor(o){super(`No translation found for ${Gt(o)}.`),this.parsedMessage=o}};function Sn(t,o,e){let n=zt(o,e),i=t[n.id];if(n.legacyIds!==void 0)for(let r=0;r<n.legacyIds.length&&i===void 0;r++)i=t[n.legacyIds[r]];if(i===void 0)throw new oe(n);return[i.messageParts,i.placeholderNames.map(r=>{if(n.substitutions.hasOwnProperty(r))return n.substitutions[r];throw new Error(`There is a placeholder name mismatch with the translation provided for the message ${Gt(n)}. 2The translation contains a placeholder with name ${r}, which does not exist in the message.`)})]}function Cn(t){let o=t.split(/{\$([^}]*)}/),e=[o[0]],n=[];for(let r=1;r<o.length-1;r+=2)n.push(o[r]),e.push(`${o[r+1]}`);let i=e.map(r=>r.charAt(0)===":"?"\\"+r:r);return{text:t,messageParts:En(e,i),placeholderNames:n}}function En(t,o){return Object.defineProperty(t,"raw",{value:o}),t}function Gt(t){let o=t.meaning&&` - "${t.meaning}"`,e=t.legacyIds&&t.legacyIds.length>0?` [${t.legacyIds.map(n=>`"${n}"`).join(", ")}]`:"";return`"${t.id}"${e} ("${t.text}"${o})`}function Yt(t){$localize.translate||($localize.translate=On),$localize.TRANSLATIONS||($localize.TRANSLATIONS={}),Object.keys(t).forEach(o=>{$localize.TRANSLATIONS[o]=Cn(t[o])})}function On(t,o){try{return Sn($localize.TRANSLATIONS,t,o)}catch(e){return console.warn(e.message),[t,o]}}s();s();s();var Ht=(()=>{class t extends G{_createContainer(){super._createContainer(),this._containerElement?.classList.add("superuser-panel-overlay-container")}static{this.\u0275fac=(()=>{let e;return function(i){return(e||(e=Ce(t)))(i||t)}})()}static{this.\u0275prov=h({token:t,factory:t.\u0275fac})}}return t})();var Pn=()=>({manage:!0,as_impersonator:!0}),Tn=(t,o)=>o.id;function Rn(t,o){if(t&1){let e=b();a(0,"button",30),O("click",function(){S(e);let i=u(2);return C(i.stopImpersonating())}),m(1,"icon",31),l()}}function vn(t,o){if(t&1){let e=b();a(0,"div",12)(1,"button",32),O("click",function(){let i=S(e).$implicit,r=u(2);return C(r.impersonate(i.id))}),a(2,"div",33),m(3,"profile-pic",34),l(),a(4,"span",35),P(5),l()(),a(6,"button",36),O("click",function(){let i=S(e).$implicit,r=u(2);return C(r.removeUser(i))}),m(7,"icon",37),l()()}if(t&2){let e=o.$implicit,n=u(2);x("cdkDragData",e),p(),q("active",n.isImpersonating(e.id)),p(2),x("profilePic",e.profile_pic),p(2),ee(e.name)}
2}function Nn(t,o){if(t&1){let e=b();a(0,"button",41),O("click",function(){S(e);let i=u(3);return C(i.saveImpersonatedUser())}),m(1,"icon",42),l()}}function Mn(t,o){if(t&1){let e=b();a(0,"div",13)(1,"div",38)(2,"button",39),O("click",function(){S(e);let i=u(2);return C(i.stopImpersonating())}),a(3,"div",33),m(4,"profile-pic",34),l(),a(5,"span",35),P(6),l()(),T(7,Nn,2,0,"button",40),l()()}if(t&2){let e=u(2);p(4),x("profilePic",e.usersService.userData().profile_pic),p(2),ee(e.usersService.userData().name),p(),R(e.canSaveImpersonatedUser()?7:-1)}}function An(t,o){if(t&1){let e=b();a(0,"button",43),O("click",function(){S(e);let i=u(2);return C(i.editUsers())}),a(1,"span"),P(2,"Add Users"),l()()}}function yn(t,o){if(t&1&&(a(0,"a",22),m(1,"icon",44),a(2,"span"),P(3,"FLOW"),l()()),t&2){let e=u(2);x("href",e.flowUrl,Ee)}}function xn(t,o){if(t&1){let e=b();a(0,"div",0)(1,"div",2)(2,"div",3)(3,"div")(4,"div",4)(5,"p",5),P(6,"Impersonate"),l(),T(7,Rn,2,0,"button",6),a(8,"button",7),O("click",function(){S(e);let i=u();return C(i.editUsers())}),m(9,"icon",8),l()(),a(10,"div",9)(11,"search-users",10),O("selectUser",function(i){S(e);let r=u();return C(r.impersonate(i.id))}),l()(),a(12,"div",11),O("cdkDropListDropped",function(i){S(e);let r=u();return C(r.userDropped(i))}),Pe(13,vn,8,5,"div",12,Tn),T(15,Mn,8,3,"div",13),T(16,An,3,0,"button",14),l()(),m(17,"div",15),a(18,"div",16)(19,"p",17),P(20,"Quick Nav"),l(),a(21,"a",18),m(22,"icon",19),a(23,"span"),P(24,"Portal Home"),l()(),a(25,"a",20),m(26,"icon",21),a(27,"span"),P(28,"Admin Center"),l()(),T(29,yn,4,1,"a",22),l(),m(30,"div",15),a(31,"div")(32,"p",23),P(33,"Preferences"),l(),a(34,"div",24)(35,"label",25)(36,"input",26),B("ngModelChange",function(i){S(e);let r=u();return V(r.keepOpen,i)||(r.keepOpen=i),C(i)}),O("ngModelChange",function(){S(e);let i=u();return C(i.saveSettings())}),l(),m(37,"span",27),a(38,"span"),P(39,"Keep open"),l()(),a(40,"label",25)(41,"input",26),B("ngModelChange",function(i){S(e);let r=u();return V(r.safeMode,i)||(r.safeMode=i),C(i)}),O("ngModelChange",function(){S(e);let i=u();return C(i.onSafeModeChange())}),l(),m(42,"span",27),a(43,"span"),P(44,"Safe mode"),l(),m(45,"icon",28),l(),a(46,"label",25)(47,"input",26),B("ngModelChange",function(i){S(e);let r=u();return V(r.adminCenterNarrowMode,i)||(r.adminCenterNarrowMode=i),C(i)}),O("ngModelChange",function(){S(e);let i=u();return C(i.onAdminCenterNarrowModeChange())}),l(),m(48,"span",27),a(49,"span"),P(50,"Narrow Admin Center"),l(),m(51,"icon",29),l()()()()()()}if(t&2){let e=u();p(),q("show",e.isShowing()),p(6),R(e.isImpersonating()?7:-1),p(4),x("extraParams",Me(11,Pn)),p(),x("cdkDropListData",e.users()),p(),Te(e.users()),p(2),R(e.isImpersonatingOtherUser()?15:-1),p(),R(e.users().length?-1:16),p(13),R(e.flowUrl?29:-1),p(7),F("ngModel",e.keepOpen),p(5),F("ngModel",e.safeMode),p(6),F("ngModel",e.adminCenterNarrowMode)}}function bn(t,o){t&1&&m(0,"div",1)}var Wt=(()=>{class t{constructor(){this.usersService=c(L),this.helperService=c(K),this.dialogService=c(st),this.sharedService=c(X),this.router=c(z),this.destroyRef=c(k),this.isActive=y(!1),this.isShowing=y(!1),this.users=y([]),this.keepOpen=y(!1),this.safeMode=y(!1),this.adminCenterNarrowMode=y(!1),this.activeImpersonation=null,this.lastToggleKeyPressAt=null,this.flowUrl=_.FLOW_SERVER,this.localStorageKey="superuser-control-panel",this.maxUsers=5,this.defaultSettings={users:[],keepOpen:!1,safeMode:!1,activeImpersonation:null,adminCenterNarrowMode:!1},this.toggleKey="`",this.toggleKeyInterval=400,this.searchUsers=Ae(W),this.isImpersonatingOtherUser=te(()=>this.usersService.isImpersonate()&&!this.users().some(e=>e.id===this.usersService.getUserId())),this.canSaveImpersonatedUser=te(()=>this.isImpersonatingOtherUser()&&this.users().length<this.maxUsers)}ngOnInit(){if(this.usersService.isSuperuser(!0)&&!location.pathname.includes("external/login-success"))try{this.init()}catch(e){console.debug(`SuperuserControlPanel - Error while initializing: ${e}`)}}init(){this.loadSettings(),this.isActive.set(!0),this.isShowing.set(this.keepOpen()),this.sharedService.safeMode.set(this.safeMode()),this.sharedService.adminCenterNarrowMode.set(this.adminCenterNarrowMode()),this.initToggleListener(),this.initCloseDialogsOnNavigation(),this.initActiveImpersonation(),this.usersService.impersonationStopped$.pipe(H(this.destroyRef)).subscribe(()=>{this.activeImpersonation=null,this.saveSettings()})}initCloseDialogsOnNavigation(){this.router.events.pipe(A(e=>e instanceof j),H(this.destroyRef)).subscribe(()=>{this.keepOpen()||this.isShowing.set(!1)})}initActiveImpersonation(){if(this.activeImpersonation&&!this.usersService.isImpersonate()){let e=this.activeImpersonation;this.activeImpersonation=null,this.saveSettings(),this.impersonate(e)}else this.activeImpersonation=this.usersService.isImpersonate()?this.usersService.getUserId():null,this.saveSettings()}initToggleListener(){pe(window,"keydown").pipe(A(e=>e.key===this.toggleKey&&!e.repeat&&!e.ctrlKey&&!e.metaKey&&!e.altKey),A(()=>this.isTogglePressPairComplete()),_e(e=>{e.preventDefault();let n=document.activeElement;if(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement){let i=n.selectionStart;i!==null&&i>0&&n.value[i-1]===this.toggleKey&&(n.value=n.value.slice(0,i-1)+n.value.slice(i),n.setSelectionRange(i-1,i-1),n.dispatchEvent(new Event("input",{bubbles:!0})))}else if(n instanceof HTMLElement&&n.isContentEditable){let i=window.getSelection();if(i&&i.rangeCount>0){let r=i.getRangeAt(0);if(r.collapsed&&r.startOffset>0){let g=r.cloneRange();g.setStart(r.startContainer,r.startOffset-1),g.toString()===this.toggleKey&&g.deleteContents()}}}}),H(this.destroyRef)).subscribe(()=>this.toggle())}isTogglePressPairComplete(){let e=Date.now(),n=this.lastToggleKeyPressAt!==null&&e-this.lastToggleKeyPressAt<this.toggleKeyInterval;return this.lastToggleKeyPressAt=n?null:e,n}toggle(){this.isShowing()?(this.isShowing.set(!1),this.elementFocusedBeforeShow?.focus(),this.searchUsers()?.closePanel()):(this.elementFocusedBeforeShow=document.activeElement,this.isShowing.set(!0),setTimeout(()=>
2{this.searchUsers()?.focus()}))}impersonate(e){this.isImpersonating(e)?this.stopImpersonating():this.usersService.impersonateUser(e)}stopImpersonating(){this.usersService.stopImpersonate()}isImpersonating(e){return e?e===this.usersService.getUserId():this.usersService.isImpersonate()}editUsers(){this.dialogService.smallDialog(ht,{data:{users:Ze(this.users()),title:"Edit Users",message:"Select users for quick impersonation:",max:this.maxUsers,extraParams:{manage:!0,as_impersonator:!0,field:["id","name","profile_pic"]}}}).closed.subscribe(e=>{e&&(this.users.set(e.map(({id:n,name:i,profile_pic:r})=>({id:n,name:i,profile_pic:r}))),this.saveSettings())})}removeUser(e){this.dialogService.confirm({title:$localize`Remove User?`,message:$localize`Are you sure you want to remove ${e.name} from your quick impersonation list?`,confirmText:$localize`Remove`,cancelText:$localize`Cancel`,isDanger:!0}).closed.pipe(A(n=>!!n)).subscribe(()=>{this.users.update(n=>n.filter(i=>i.id!==e.id)),this.saveSettings()})}saveImpersonatedUser(){if(!this.canSaveImpersonatedUser())return;let{id:e,name:n,profile_pic:i}=this.usersService.userData();this.users.update(r=>[...r,{id:e,name:n,profile_pic:i}]),this.saveSettings()}userDropped(e){e.previousIndex!==e.currentIndex&&(this.users.update(n=>{let i=[...n];return St(i,e.previousIndex,e.currentIndex),i}),this.saveSettings())}onSafeModeChange(){this.sharedService.safeMode.set(this.safeMode()),this.saveSettings()}onAdminCenterNarrowModeChange(){this.sharedService.adminCenterNarrowMode.set(this.adminCenterNarrowMode()),this.saveSettings()}loadSettings(){let e=this.helperService.getJsonFromLocalStorage(this.localStorageKey),n=D(I(I({},this.defaultSettings),e),{users:Array.isArray(e?.users)?e.users:[]});this.users.set(n.users),this.keepOpen.set(n.keepOpen),this.safeMode.set(n.safeMode),this.adminCenterNarrowMode.set(n.adminCenterNarrowMode),this.activeImpersonation=n.activeImpersonation,this.saveSettings()}saveSettings(){let e={users:this.users(),keepOpen:this.keepOpen(),safeMode:this.safeMode(),activeImpersonation:this.activeImpersonation,adminCenterNarrowMode:this.adminCenterNarrowMode()};this.helperService.saveJsonToLocalStorage(this.localStorageKey,e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=$({type:t,selectors:[["superuser-control-panel"]],viewQuery:function(n,i){n&1&&Re(i.searchUsers,W,5),n&2&&ve()},features:[Ne([tt,{provide:G,useClass:Ht}])],decls:2,vars:2,consts:()=>{let e;e=$localize`Stop impersonating`;let n;n=$localize`Add/remove users`;let i;i=$localize`Search users`;let r;r=$localize`Blocks all POST, PATCH, PUT, and DELETE requests. Useful for impersonating when you don't want to accidentally make changes as that user.`;let g;g=$localize`Adds max width to Admin Center. Useful for widescreens, especially ultrawides.`;let f;f=$localize`Remove from saved users`;let d;return d=$localize`Add to saved users`,[[1,"superuser-panel-wrapper","pos-fix-t","d-flex","justify-content-center"],[1,"safe-mode-indicator","pos-fix","top-0","right-0","bottom-0","left-0"],[1,"panel","rounded-bottom-double","bg-white","pa-8","w-100","w-sm-auto"],[1,"d-flex","flex-column","flex-lg-row"],[1,"d-flex","align-items-center"],[1,"text-bold","flex-grow","mr-24"],["type","button","tooltip",e,1,"btn","sm","borderless"],["type","button","tooltip",n,1,"btn","sm","borderless","ml-4",3,"click"],["name","internal-edit"],[1,"my-8"],["placeholder",i,3,"selectUser","extraParams"],["cdkDropList","","cdkDropListOrientation","horizontal",1,"user-list","d-flex","dynamic-hlist-m-4","mt-4",3,"cdkDropListDropped","cdkDropListData"],["cdkDrag","","cdkDragBoundary",".user-list","cdkDragPreviewContainer","parent",1,"impersonate-item","pos-rel","d-flex",3,"cdkDragData"],[1,"pl-4","bl"],["type","button",1,"btn","md","secondary","my-24","mx-auto"],[1,"divider"],[1,"d-flex","flex-column","align-items-start"],[1,"text-bold","mr-24","my-4"],["routerLink","/",1,"btn","md","hoverable"],["name","common-home"],["routerLink","/admin",1,"btn","md","hoverable"],["name","common-admin-plus"],[1,"btn","md","hoverable",3,"href"],[1,"text-bold","flex-grow","mr-24","my-4"],[1,"d-flex","flex-column"],[1,"form-checkbox","mr-16"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"checkbox","mr-12"],["name","common-info-outline","tooltip",r,1,"size-20","text-muted","ml-8","mr-4"],["name","common-info-outline","tooltip",g,1,"size-20","text-muted","ml-8","mr-4"],["type","button","tooltip",e,1,"btn","sm","borderless",3,"click"],["name","common-logout"],["type","button",1,"btn","borderless","flex-column","justify-content-start","text-center","pa-4","text-center","impersonate-btn",3,"click"],[1,"avatar","size-48","d-inline-block"],[3,"profilePic"],[1,"text-md","text-wrap"],["type","button","tooltip",f,1,"btn","borderless","item-action","pos-abs",3,"click"],["name","internal-close",1,"size-12"],[1,"impersonate-item","pos-rel","d-flex","h-100"],["type","button",1,"btn","borderless","flex-column","justify-content-start","text-center","pa-4","text-center","impersonate-btn","active",3,"click"],["type","button","tooltip",d,1,"btn","borderless","item-action","pos-abs"],["type","button","tooltip",d,1,"btn","borderless","item-action","pos-abs",3,"click"],["name","internal-add",1,"size-12"],["type","button",1,"btn","md","secondary","my-24","mx-auto",3,"click"],["name","common-connection"]]},template:function(n,i){n&1&&(T(0,xn,52,12,"div",0),T(1,bn,1,0,"div",1)),n&2&&(R(i.isActive()?0:-1),p(),R(i.safeMode()?1:-1))},dependencies:[ot,W,Et,Ct,pt,je,Ot,Y,at,lt,ct,rt],styles:[".superuser-panel-wrapper[_ngcontent-%COMP%]{pointer-events:none;z-index:var(--zindex-superuser-panel)}.superuser-panel-wrapper[_ngcontent-%COMP%] .panel[_ngcontent-%COMP%]{pointer-events:initial;box-shadow:var(--card-shadow-lg);display:none}.superuser-panel-wrapper[_ngcontent-%COMP%] .panel.show[_ngcontent-%COMP%]{display:block}.impersonate-btn[_ngcontent-%COMP%]{width:90px;max-width:90px}.impersonate-btn.active[_ngcontent-%COMP%]{box-shadow:inset 0 -4px 0 0 var(--r2);border-bottom-right-radius:0;border-bottom-left-radius:0}.impersonate-item[_ngcontent-%COMP%] .item-action[_ngcontent-%COMP%]{top:0;right:0;min-width:0;width:20px;height:20px;padding:0;border-radius:50%;background:var(--n2);opacity:0;transition:opacity .15s ease-in-out}.impersonate-item[_ngcontent-%COMP%]:hover .item-action[_ngcontent-%COMP%], .impersonate-item[_ngcontent-%COMP%] .item-action[_ngcontent-%COMP%]:focus-visible{opacity:1}.divider[_ngcontent-%COMP%]{border-left:1px solid var(--n3);border-top:1px solid var(--n3);margin:8px}.safe-mode-indicator[_ngcontent-%COMP%]{box-shadow:inset 0 0 0 3px var(--r3);z-index:var(--zindex-top);pointer-events:none}"],changeDetection:0})}}return t})();function wn(t,o){t&1&&m(0,"superuser-control-panel")}var Xt=(()=>{class t{constructor(){this.analytics=c(_t),this.router=c(z),this.dialog=c(nt),this.usersService=c(L),this.vcRef=c(Oe),this.superuserControlPanelEnabled=!1,this.destroySubject=ne
2w de}ngOnInit(){this.superuserControlPanelEnabled=this.usersService.isSuperuser(!0),this.analytics.analyticsEvent({type:ie.SESSION_START});let e=this.router.events.pipe(A(n=>n instanceof j),fe(this.destroySubject));e.subscribe(()=>{for(let n of this.dialog.openDialogs)n.keepOpenWhenNavigating||n.close()}),e.subscribe(()=>{this.analytics.analyticsEvent({type:ie.LOCATION_CHANGED,properties:{url:window.location.href,path:window.location.pathname,query:window.location.search.substring(1),hash:window.location.hash.substring(1)}})})}ngOnDestroy(){this.destroySubject.next(),this.destroySubject.complete()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=$({type:t,selectors:[["campus-app"]],decls:3,vars:1,template:function(n,i){n&1&&(m(0,"router-outlet")(1,"snackbar-outlet"),T(2,wn,1,0,"superuser-control-panel")),n&2&&(p(2),R(i.superuserControlPanelEnabled?2:-1))},dependencies:[Ve,Pt,Wt],encapsulation:2})}}return t})();s();s();var Jt="chunkReloadAttempt",Un=3e4;function Qt(t){let o=typeof t=="string"?t:t?.message??"";return/dynamically imported module/i.test(o)||/importing a module script failed/i.test(o)}function Zt(t,o){if(Qt(t)&&!In()){Dn(),window.location.assign(o??window.location.href);return}xe(t)}function qt(){let t=Xe({showDialog:!1});return{handleError(o){Qt(o)||t.handleError(o)}}}function In(){try{let t=Number(sessionStorage.getItem(Jt)??0);return Date.now()-t<Un}catch(t){return!1}}function Dn(){try{sessionStorage.setItem(Jt,String(Date.now()))}catch(t){}}s();var en=(()=>{class t{constructor(){this.ngZone=c(he),this.destroyRef=c(k),this.interactivityChecker=c(Qe),this.onKeydown=e=>{e.key==="Tab"&&document.querySelectorAll(t.WRAPPER).forEach(n=>{let i=this.needsTabStop(n)?"0":"-1";n.getAttribute("tabindex")!==i&&n.setAttribute("tabindex",i)})}}static{this.WRAPPER=".simplebar-content-wrapper"}static{this.TAB_STOP_CANDIDATE='a, button, input, select, textarea, iframe, object, [tabindex], [contenteditable="true"]'}init(){this.ngZone.runOutsideAngular(()=>{document.addEventListener("keydown",this.onKeydown,!0)}),this.destroyRef.onDestroy(()=>document.removeEventListener("keydown",this.onKeydown,!0))}needsTabStop(e){return this.overflows(e)&&!this.hasTabStopInside(e)}overflows(e){let{overflowX:n,overflowY:i}=getComputedStyle(e),r=g=>g==="auto"||g==="scroll";return r(i)&&e.scrollHeight-e.clientHeight>1||r(n)&&e.scrollWidth-e.clientWidth>1}hasTabStopInside(e){let n=e.querySelectorAll(t.TAB_STOP_CANDIDATE);for(let i of n)if(i.closest(t.WRAPPER)===e&&!i.closest("[inert], fieldset[disabled]")){if(i.tagName==="IFRAME"||i.tagName==="OBJECT"){if(this.interactivityChecker.isVisible(i))return!0;continue}if(this.interactivityChecker.isTabbable(i)&&this.interactivityChecker.isFocusable(i))return!0}return!1}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=h({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();s();var tn=(()=>{class t{constructor(){this.preloadedModules=[]}preload(e,n){return e.data?.preload&&e.path!==null?(this.preloadedModules.push(e.path),n().pipe(ue({count:1,delay:2e3}),me(()=>Q(null)))):Q(null)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=h({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();s();var nn={parse:{dateInput:"D MMMM YYYY"},display:{dateInput:"D MMMM YYYY",monthYearLabel:"MMMM YYYY",dateA11yLabel:"D MMMM YYYY",monthYearA11yLabel:"MMMM YYYY"}};s();var on={autoActiveFirstOption:!0,overlayPanelClass:"mat-autocomplete-overlay-custom"},rn={disableOptionCentering:!0,overlayPanelClass:"mat-select-panel-custom"};s();var sn=(()=>{class t{constructor(){this.sharedService=c(X)}intercept(e,n){return this.sharedService.safeMode()===!0&&["POST","PATCH","PUT","DELETE"].includes(e.method)?(console.debug(`SAFE MODE - blocked request: ${e.method} ${e.urlWithParams}`),w):n.handle(e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=h({token:t,factory:t.\u0275fac})}}return t})();s();var an=(()=>{class t{constructor(){this.usersService=c(L)}intercept(e,n){return this.usersService.isImpersonate()&&this.usersService.userData().impersonator.read_only_impersonate&&!["GET","HEAD","OPTIONS"].includes(e.method)?(console.debug(`Blocked mutating request while impersonating: ${e.method} ${e.urlWithParams}`),w):n.handle(e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=h({token:t,factory:t.\u0275fac})}}return t})();s();var ln=(()=>{class t{constructor(){this.originsAllowed=[new URL(_.BACKEND_SERVER).origin,new URL(_.CUBE_API_URL).origin,window.location.origin]}intercept(e,n){let i=new URL(e.url,location.origin);for(let r of this.originsAllowed)if(i.origin===r)return n.handle(e);return console.debug("Request disallowed - URL not on allow list:",e.url),w}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=h({token:t,factory:t.\u0275fac})}}return t})();s();var cn=(()=>{class t{constructor(){this.credentialedOrigins=[new URL(_.BACKEND_SERVER).origin,window.location.origin]}intercept(e,n){let i=new URL(e.url,location.origin);return this.credentialedOrigins.includes(i.origin)&&(e=e.clone({withCredentials:!0})),n.handle(e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=h({token:t,factory:t.\u0275fac})}}return t})();s();var dn=(()=>{class t{constructor(){this.helper=c(K)}intercept(e,n){if(!e.body||e.body instanceof FormData)return n.handle(e);let[i,r]=this.helper.splitFormData(e.body);if(!r)return n.handle(e);r.append("_json_data",JSON.stringify(i));let g=e.clone({body:r});return n.handle(g)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=h({token:t,factory:t.\u0275fac})}}return t})();var re={providers:[ge(Fe,Y,dt,it,Tt.forRoot(),Rt),Nt(),we(Le(),Ue({cookieName:_.CSRF_COOKIE_NAME})),ze(Dt,Ke(tn),Ge({onSameUrlNavigation:"reload"}),He(),Ye(t=>
2Zt(t.error,t.url))),$t(),{provide:Se,useFactory:qt},Z(()=>(o=>()=>o.configureApp())(c(qe))()),Z(()=>c(en).init()),{provide:Be,useClass:vt},{provide:et,useValue:{usePopover:!1}},{provide:M,useClass:sn,multi:!0},{provide:M,useClass:an,multi:!0},{provide:M,useClass:ln,multi:!0},{provide:M,useClass:cn,multi:!0},{provide:M,useClass:kt,multi:!0},{provide:M,useClass:ft,multi:!0},{provide:M,useClass:dn,multi:!0},{provide:mt,useValue:nn},{provide:ut,useValue:{disabled:!0}},{provide:gt,useValue:on},{provide:xt,useValue:rn},It,ke,Lt,wt,Ie,Mt,De,Ut,bt,At,yt]};kn();function kn(){if(Je.production){$n();let t=console.warn;console.warn=(...o)=>{o?.[0]?.startsWith("No translation found for")||t(...o)}}Fn().then(t=>console.debug(`Successfully loaded translations for locale ${t.locale}`)).catch(t=>console.debug("Error while loading translations",t)).finally(()=>{$e(Xt,D(I({},re),{providers:[ye(),...re.providers]})).catch(t=>console.error(t))})}function $n(){if(_.SENTRY_CONFIG){let t=e=>e&&e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o={dsn:_.SENTRY_CONFIG,environment:_.ENVIRONMENT,integrations:[be({filterKeys:["pathify-sentry-app-key"],behaviour:"drop-error-if-contains-third-party-frames"})],allowUrls:[new RegExp(`^${t(window.location.origin)}`),new RegExp(`^${t(_.FLOW_SERVER)}`)],beforeSend:(e,n)=>e.exception?.values?.[0]?.stacktrace?.frames?.some(i=>i.filename?.includes("https://www.googletagmanager.com/gtm.js"))?null:e,ignoreErrors:["top.GLOBALS","originalCreateNotification","canvas.contentDocument","MyApp_RemoveAllHighlights","http://tt.epicplay.com","Can't find variable: ZiteReader","jigsaw is not defined","ComboSearch is not defined","http://loading.retry.widdit.com/","atomicFindClose","fb_xd_fragment","bmi_SafeAddOnload","EBCallBackMessageReceived","conduitPage","Non-Error exception captured",/^Http failure response for/]};_.PORTAL_VERSION&&!_.PORTAL_VERSION?.startsWith("sha")&&(o.release=_.PORTAL_VERSION),We(o)}}function Fn(){let t=localStorage.getItem(_.LANG_STORAGE_KEY)||_.DEFAULT_LANG;console.debug("Lang is",t),(!t||t==="en")&&(t="en-US");let o=e=>{let n=JSON.parse(e);return Yt(n.translations),n};return t!=="en-US"?(ne.setLocale(t.toLowerCase()),fetch(`/static/frontend/static/i18n/${t}.json`).then(e=>e.text().then(n=>o(n))).catch(e=>(console.debug(`Error loading file for ${t}, falling back to en-US`),ne.setLocale("en"),fetch("/static/frontend/static/i18n/en-US.json").then(n=>n.text()).then(n=>o(n))))):Promise.resolve({locale:"en-US"})}
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.