diff --git a/404.html b/404.html index 9b8ed82..fe6d9b1 100644 --- a/404.html +++ b/404.html @@ -34,6 +34,6 @@ - + \ No newline at end of file diff --git a/index.html b/index.html index 9b8ed82..fe6d9b1 100644 --- a/index.html +++ b/index.html @@ -34,6 +34,6 @@ - + \ No newline at end of file diff --git a/main.6deeb2d753725b10.js b/main.e62a5029268225f6.js similarity index 98% rename from main.6deeb2d753725b10.js rename to main.e62a5029268225f6.js index c4221fc..484311f 100644 --- a/main.6deeb2d753725b10.js +++ b/main.e62a5029268225f6.js @@ -14,7 +14,7 @@ bannerLink } } - `,fetchPolicy:"no-cache",context:{headers:{Authorization:"Bearer "+V.getToken(),"Operation-Metadata":JSON.stringify({securityDomains:[{userId:j}]})}}}));X.error||V.setPayload({accessToken:V.getToken(),user:X.data.users[0]})})()}ngOnDestroy(){this.onDestroy$.next(),this.onDestroy$.complete()}logout(){this.setPayload(void 0),window.location.reload()}setPayload(V){localStorage.removeItem(ve),V&&localStorage.setItem(ve,JSON.stringify(V)),this.payloadSubject.next(V)}getPayload(){const V=localStorage.getItem(ve);return V?JSON.parse(V):null}getToken(){return this.getPayload()?.accessToken??""}socialLogin(V){let j=this.oAuthLink+V;const X=new N.y(Ie=>{window.open(j,"myWindow","location=1,status=1,scrollbars=1,width=800,height=900"),window.addEventListener("message",lt=>{if(lt.origin===this.settings.Backend.backendHttpsURL){if(null==lt.data)return console.log("on cancelled"),Ie.next(void 0),void Ie.complete();lt.data.accessToken&<.data.user&&(console.log("on succeeded"),Ie.next(lt.data),Ie.complete())}})});return X.pipe((0,O.R)(this.onDestroy$)).subscribe({next:Ie=>{this.setPayload(Ie)}}),X}login(V,j){const X=this.http.post(this.authLink+"signin",{username:V,password:j},ye);return X.pipe((0,O.R)(this.onDestroy$)).subscribe({next:Ie=>{this.setPayload(Ie)}}),X}signup(V,j,X){const Ie=this.http.post(this.authLink+"signup",{username:V,email:j,password:X},ye);return Ie.pipe((0,O.R)(this.onDestroy$)).subscribe({next:ke=>{this.setPayload(ke)}}),Ie}}return z.\u0275fac=function(V){return new(V||z)(g.LFG(m._M),g.LFG(B.F0),g.LFG(r.eN),g.LFG(T),g.LFG(Se.g))},z.\u0275prov=g.Yz7({token:z,factory:z.\u0275fac,providedIn:"root"}),z})()},831:(Ue,J,s)=>{"use strict";s.d(J,{v:()=>Ke});var o=s(8239),r=s(8862),h=s(1132),m=s(4762),f=s(4854),d=s(56);function w(me){return new d.i(function(P,se){return new f.y(function(Ce){var He,Qe,st;try{He=se(P).subscribe({next:function(Ge){Ge.errors&&(st=me({graphQLErrors:Ge.errors,response:Ge,operation:P,forward:se}))?Qe=st.subscribe({next:Ce.next.bind(Ce),error:Ce.error.bind(Ce),complete:Ce.complete.bind(Ce)}):Ce.next(Ge)},error:function(Ge){(st=me({operation:P,networkError:Ge,graphQLErrors:Ge&&Ge.result&&Ge.result.errors,forward:se}))?Qe=st.subscribe({next:Ce.next.bind(Ce),error:Ce.error.bind(Ce),complete:Ce.complete.bind(Ce)}):Ce.error(Ge)},complete:function(){st||Ce.complete.bind(Ce)()}})}catch(Ge){me({networkError:Ge,operation:P,forward:se}),Ce.error(Ge)}return function(){He&&He.unsubscribe(),Qe&&He.unsubscribe()}})})}!function(me){function P(se){var Ce=me.call(this)||this;return Ce.link=w(se),Ce}(0,m.ZT)(P,me),P.prototype.request=function(se,Ce){return this.link.request(se,Ce)}}(d.i);var O=s(4145),g=s(9231),B=s(709),b=function(me){function P(se){var Ce=me.call(this)||this;return Ce.client=se,Ce}return(0,m.ZT)(P,me),P.prototype.request=function(se){var Ce=this;return new f.y(function(He){return Ce.client.subscribe((0,m.pi)((0,m.pi)({},se),{query:(0,O.S)(se.query)}),{next:He.next.bind(He),complete:He.complete.bind(He),error:function(Qe){return Qe instanceof Error?He.error(Qe):function _(me){return(0,g.s)(me)&&"code"in me&&"reason"in me}(Qe)?He.error(new Error("Socket closed with event ".concat(Qe.code," ").concat(Qe.reason||""))):He.error(new B.c({graphQLErrors:Array.isArray(Qe)?Qe:[Qe]}))}})})},P}(d.i),S=s(1144),v=s(1141),H=s.n(v);function x(me){return null===me?"null":Array.isArray(me)?"array":typeof me}function te(me){return"object"===x(me)}function Z(me,P){return me.length<124?me:P}const Me="graphql-transport-ws";var ve=(()=>{return(me=ve||(ve={}))[me.InternalServerError=4500]="InternalServerError",me[me.InternalClientError=4005]="InternalClientError",me[me.BadRequest=4400]="BadRequest",me[me.BadResponse=4004]="BadResponse",me[me.Unauthorized=4401]="Unauthorized",me[me.Forbidden=4403]="Forbidden",me[me.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",me[me.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",me[me.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",me[me.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",me[me.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests",ve;var me})(),ye=(()=>{return(me=ye||(ye={})).ConnectionInit="connection_init",me.ConnectionAck="connection_ack",me.Ping="ping",me.Pong="pong",me.Subscribe="subscribe",me.Next="next",me.Error="error",me.Complete="complete",ye;var me})();function De(me){if(!te(me))throw new Error(`Message is expected to be an object, but got ${x(me)}`);if(!me.type)throw new Error("Message is missing the 'type' property");if("string"!=typeof me.type)throw new Error(`Message is expects the 'type' property to be a string, but got ${x(me.type)}`);switch(me.type){case ye.ConnectionInit:case ye.ConnectionAck:case ye.Ping:case ye.Pong:if("payload"in me&&!te(me.payload))throw new Error(`"${me.type}" message expects the 'payload' property to be an object or missing, but got "${me.payload}"`);break;case ye.Subscribe:if("string"!=typeof me.id)throw new Error(`"${me.type}" message expects the 'id' property to be a string, but got ${x(me.id)}`);if(!me.id)throw new Error(`"${me.type}" message requires a non-empty 'id' property`);if(!te(me.payload))throw new Error(`"${me.type}" message expects the 'payload' property to be an object, but got ${x(me.payload)}`);if("string"!=typeof me.payload.query)throw new Error(`"${me.type}" message payload expects the 'query' property to be a string, but got ${x(me.payload.query)}`);if(null!=me.payload.variables&&!te(me.payload.variables))throw new Error(`"${me.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${x(me.payload.variables)}`);if(null!=me.payload.operationName&&"string"!==x(me.payload.operationName))throw new Error(`"${me.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${x(me.payload.operationName)}`);if(null!=me.payload.extensions&&!te(me.payload.extensions))throw new Error(`"${me.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${x(me.payload.extensions)}`);break;case ye.Next:if("string"!=typeof me.id)throw new Error(`"${me.type}" message expects the 'id' property to be a string, but got ${x(me.id)}`);if(!me.id)throw new Error(`"${me.type}" message requires a non-empty 'id' property`);if(!te(me.payload))throw new Error(`"${me.type}" message expects the 'payload' property to be an object, but got ${x(me.payload)}`);break;case ye.Error:if("string"!=typeof me.id)throw new Error(`"${me.type}" message expects the 'id' property to be a string, but got ${x(me.id)}`);if(!me.id)throw new Error(`"${me.type}" message requires a non-empty 'id' property`);if(!function ue(me){return Array.isArray(me)&&me.length>0&&me.every(P=>"message"in P)}(me.payload))throw new Error(`"${me.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(me.payload)}`);break;case ye.Complete:if("string"!=typeof me.id)throw new Error(`"${me.type}" message expects the 'id' property to be a string, but got ${x(me.id)}`);if(!me.id)throw new Error(`"${me.type}" message requires a non-empty 'id' property`);break;default:throw new Error(`Invalid message 'type' property "${me.type}"`)}return me}function Y(me,P){try{return De(me)}catch{if("string"!=typeof me)throw new Error("Only strings are parsable messages");return De(JSON.parse(me,P))}}function V(me,P){return De(me),JSON.stringify(me,P)}function X(me){return te(me)&&"code"in me&&"reason"in me}var tt=s(8023),lt=s(4537),$=s(274),Re=s(9942),re=s(5732),xe=s(1656);let Ke=(()=>{class me{constructor(se,Ce,He,Qe){this.apollo=se,this.authService=Ce,this.http=He,this.settings=Qe,this.onDestroy$=new tt.x,this.opSettings=this.defaultOpSettings(),this.rebuildClient()}ngOnDestroy(){this.onDestroy$.next(),this.onDestroy$.complete()}resetOpSettings(){this.opSettings=this.defaultOpSettings()}rebuildClient(){this.apollo.default().client&&(this.apollo.default().client.stop(),this.apollo.default().client.clearStore(),this.apollo.removeClient("default")),this.apollo.createDefault(this.configureApolloClientOptions(this.authService.getToken()))}defaultOpSettings(){return{useAuth:!1,operationDomains:void 0}}getHeaders(){return{Authorization:"Bearer "+this.authService.getToken(),...this.opSettings.operationDomains&&{"Operation-Metadata":JSON.stringify({securityDomains:this.opSettings.operationDomains})}}}configureApolloOperationOptions(se){return{...se,...this.opSettings.useAuth&&{context:{...se.context,headers:{...this.getHeaders(),...se.context?.headers}}}}}configureApolloClientOptions(se=""){const Ce=this.settings.Backend.backendDomainPlusBaseUrl+this.settings.Backend.graphQLRelativePath,He=this.settings.Backend.httpsPrefix,Qe=this.settings.Backend.wssPrefix,st=H()({uri:`${He}${Ce}`,headers:{"Apollo-Require-Preflight":"true"}});console.log(`graphql link: ${Qe}${Ce}`),this.graphQLWsClient&&this.graphQLWsClient.dispose(),this.graphQLWsClient=function j(me){const{url:P,connectionParams:se,lazy:Ce=!0,onNonLazyError:He=console.error,lazyCloseTimeout:Qe=0,keepAlive:st=0,disablePong:Ge,connectionAckWaitTimeout:at=0,retryAttempts:_t=5,retryWait:xt=function(){var le=(0,o.Z)(function*(ae){let he=1e3;for(let pe=0;pesetTimeout(pe,he+Math.floor(2700*Math.random()+300)))});return function _e(ae){return le.apply(this,arguments)}}(),shouldRetry:yt=X,isFatalConnectionProblem:Pt,on:At,webSocketImpl:nt,generateID:ft=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,_e=>{const ae=16*Math.random()|0;return("x"==_e?ae:3&ae|8).toString(16)})},jsonMessageReplacer:G,jsonMessageReviver:U}=me;let ie;if(nt){if(!function ke(me){return"function"==typeof me&&"constructor"in me&&"CLOSED"in me&&"CLOSING"in me&&"CONNECTING"in me&&"OPEN"in me}(nt))throw new Error("Invalid WebSocket implementation provided");ie=nt}else typeof WebSocket<"u"?ie=WebSocket:typeof global<"u"?ie=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(ie=window.WebSocket||window.MozWebSocket);if(!ie)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const oe=ie,Te=(()=>{const le=(()=>{const ae={};return{on:(he,pe)=>(ae[he]=pe,()=>{delete ae[he]}),emit(he){var pe;"id"in he&&(null===(pe=ae[he.id])||void 0===pe||pe.call(ae,he))}}})(),_e={connecting:At?.connecting?[At.connecting]:[],opened:At?.opened?[At.opened]:[],connected:At?.connected?[At.connected]:[],ping:At?.ping?[At.ping]:[],pong:At?.pong?[At.pong]:[],message:At?.message?[le.emit,At.message]:[le.emit],closed:At?.closed?[At.closed]:[],error:At?.error?[At.error]:[]};return{onMessage:le.on,on(ae,he){const pe=_e[ae];return pe.push(he),()=>{pe.splice(pe.indexOf(he),1)}},emit(ae,...he){for(const pe of[..._e[ae]])pe(...he)}}})();function Xe(le){const _e=[Te.on("error",ae=>{_e.forEach(he=>he()),le(ae)}),Te.on("closed",ae=>{_e.forEach(he=>he()),le(ae)})]}let Ze,we=0,Ve=!1,We=0,Ye=!1;function et(){return de.apply(this,arguments)}function de(){return(de=(0,o.Z)(function*(){const[le,_e]=yield Ze??(Ze=new Promise((pe,be)=>(0,o.Z)(function*(){if(Ve){if(yield xt(We),!we)return Ze=void 0,be({code:1e3,reason:"All Subscriptions Gone"});We++}Te.emit("connecting");const Oe=new oe("function"==typeof P?yield P():P,Me);let Ae,Je;function ct(){isFinite(st)&&st>0&&(clearTimeout(Je),Je=setTimeout(()=>{Oe.readyState===oe.OPEN&&(Oe.send(V({type:ye.Ping})),Te.emit("ping",!1,void 0))},st))}Xe(Mt=>{Ze=void 0,clearTimeout(Ae),clearTimeout(Je),be(Mt),X(Mt)&&4499===Mt.code&&(Oe.close(4499,"Terminated"),Oe.onerror=null,Oe.onclose=null)}),Oe.onerror=Mt=>Te.emit("error",Mt),Oe.onclose=Mt=>Te.emit("closed",Mt),Oe.onopen=(0,o.Z)(function*(){try{Te.emit("opened",Oe);const Mt="function"==typeof se?yield se():se;if(Oe.readyState!==oe.OPEN)return;Oe.send(V(Mt?{type:ye.ConnectionInit,payload:Mt}:{type:ye.ConnectionInit},G)),isFinite(at)&&at>0&&(Ae=setTimeout(()=>{Oe.close(ve.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},at)),ct()}catch(Mt){Te.emit("error",Mt),Oe.close(ve.InternalClientError,Z(Mt instanceof Error?Mt.message:new Error(Mt).message,"Internal client error"))}});let mt=!1;Oe.onmessage=({data:Mt})=>{try{const St=Y(Mt,U);if(Te.emit("message",St),"ping"===St.type||"pong"===St.type)return Te.emit(St.type,!0,St.payload),void("pong"===St.type?ct():Ge||(Oe.send(V(St.payload?{type:ye.Pong,payload:St.payload}:{type:ye.Pong})),Te.emit("pong",!1,St.payload)));if(mt)return;if(St.type!==ye.ConnectionAck)throw new Error(`First message cannot be of type ${St.type}`);clearTimeout(Ae),mt=!0,Te.emit("connected",Oe,St.payload),Ve=!1,We=0,pe([Oe,new Promise((Zt,$t)=>Xe($t))])}catch(St){Oe.onmessage=null,Te.emit("error",St),Oe.close(ve.BadResponse,Z(St instanceof Error?St.message:new Error(St).message,"Bad response"))}}})()));le.readyState===oe.CLOSING&&(yield _e);let ae=()=>{};const he=new Promise(pe=>ae=pe);return[le,ae,Promise.race([he.then(()=>{if(!we){const pe=()=>le.close(1e3,"Normal Closure");isFinite(Qe)&&Qe>0?setTimeout(()=>{!we&&le.readyState===oe.OPEN&&pe()},Qe):pe()}}),_e])]})).apply(this,arguments)}function K(le){if(X(le)&&(function Ie(me){return![1e3,1001,1006,1005,1012,1013,1013].includes(me)&&me>=1e3&&me<=1999}(le.code)||[ve.InternalServerError,ve.InternalClientError,ve.BadRequest,ve.BadResponse,ve.Unauthorized,ve.SubprotocolNotAcceptable,ve.SubscriberAlreadyExists,ve.TooManyInitialisationRequests].includes(le.code)))throw le;if(Ye)return!1;if(X(le)&&1e3===le.code)return we>0;if(!_t||We>=_t||!yt(le)||Pt?.(le))throw le;return Ve=!0}return Ce||(0,o.Z)(function*(){for(we++;;)try{const[,,le]=yield et();yield le}catch(le){try{if(!K(le))return}catch(_e){return He?.(_e)}}})(),{on:Te.on,subscribe(le,_e){const ae=ft();let he=!1,pe=!1,be=()=>{we--,he=!0};return(0,o.Z)(function*(){for(we++;;)try{const[Oe,Ae,Je]=yield et();if(he)return Ae();const ct=Te.onMessage(ae,mt=>{switch(mt.type){case ye.Next:return void _e.next(mt.payload);case ye.Error:return pe=!0,he=!0,_e.error(mt.payload),void be();case ye.Complete:return he=!0,void be()}});return Oe.send(V({id:ae,type:ye.Subscribe,payload:le},G)),be=()=>{!he&&Oe.readyState===oe.OPEN&&Oe.send(V({id:ae,type:ye.Complete},G)),we--,he=!0,Ae()},void(yield Je.finally(ct))}catch(Oe){if(!K(Oe))return}})().then(()=>{pe||_e.complete()}).catch(Oe=>{_e.error(Oe)}),()=>{he||be()}},dispose:()=>(0,o.Z)(function*(){if(Ye=!0,Ze){const[le]=yield Ze;le.close(1e3,"Normal Closure")}})(),terminate(){Ze&&Te.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}({url:`${Qe}${Ce}`,connectionParams:{authentication:`Bearer ${se}`}});const Ge=new b(this.graphQLWsClient),at=(0,r.V)(({query:xt})=>{const yt=(0,S.p$)(xt);return"OperationDefinition"===yt.kind&&"subscription"===yt.operation},Ge,st);return{link:w(({networkError:xt})=>{xt&&((xt?.result?.errors[0]?.message??"").includes("Token unauthorized")&&this.authService.logout(),console.log("NetworkError: ",xt))}).concat(at),cache:new h.h}}configureHttpOptions(se){return se||(se={}),{...se,...this.opSettings.useAuth&&{headers:{...this.getHeaders(),...se.headers}}}}configureUrl(se){return se.startsWith("/")?this.settings.Backend.backendHttpsURL+se:se}cacheEvict(se){var Ce=this;return(0,o.Z)(function*(){Ce.apollo.client.cache.evict({broadcast:!0,...se})})()}clearCache(){var se=this;return(0,o.Z)(function*(){yield se.apollo.client.clearStore()})()}withOpDomain(se){return se&&(this.opSettings.operationDomains=[se]),this}withOpDomains(se){return this.opSettings.operationDomains=se,this}withAuth(){return this.authService.authenticated&&(this.opSettings.useAuth=!0),this}watchQuery(se){const Ce=this.apollo.default().watchQuery(this.configureApolloOperationOptions(se));return this.resetOpSettings(),Ce}query(se){let Ce=this.apollo.default().query(this.configureApolloOperationOptions(se));return this.resetOpSettings(),Ce}mutate(se){let Ce=this.apollo.default().mutate(this.configureApolloOperationOptions(se));return this.resetOpSettings(),Ce}subscribe(se,Ce){let He=this.apollo.default().subscribe(this.configureApolloOperationOptions(se),Ce);return this.resetOpSettings(),He}get(se,Ce,He){return this.http.get(this.configureUrl(se),this.configureHttpOptions(He))}head(se,Ce,He){return this.http.head(this.configureUrl(se),this.configureHttpOptions(He))}post(se,Ce,He){return this.http.post(this.configureUrl(se),Ce,this.configureHttpOptions(He))}put(se,Ce,He){return this.http.put(this.configureUrl(se),Ce,this.configureHttpOptions(He))}delete(se,Ce){return this.http.delete(this.configureUrl(se),this.configureHttpOptions(Ce))}patch(se,Ce,He){return this.http.patch(this.configureUrl(se),Ce,this.configureHttpOptions(He))}request(se,Ce,He){return this.http.request(se,Ce,this.configureHttpOptions(He))}}return me.\u0275fac=function(se){return new(se||me)(lt.LFG($._M),lt.LFG(Re.e),lt.LFG(re.eN),lt.LFG(xe.g))},me.\u0275prov=lt.Yz7({token:me,factory:me.\u0275fac,providedIn:"root"}),me})()},6527:(Ue,J,s)=>{"use strict";s.d(J,{I:()=>d});var o=s(1769),r=s(8023),h=s(3528),m=s(4537),f=s(1444);let d=(()=>{class w{constructor(O){this.breakpointObserver=O,this.breakpointsMatched=[],this.onDestroy$=new r.x;for(let g=0;g{this.breakpointsMatched[g]=B.matches});this.breakpointsMatched.push(!0)}get currentBreakpoint(){for(let O=0;OB.name===O);return this.breakpointsMatched[g]}matchedBreakpointRange(O,g){if(o.bt.findIndex(b=>b.name===O)>o.bt.findIndex(b=>b.name===g)){let b=O;O=g,g=b}return this.matchedBreakpointOrAbove(O)&&this.matchedBreakpointOrBelow(g)}matchedBreakpointOrAbove(O,g=""){const B=o.bt.findIndex(_=>_.name===O);return!(B>0&&this.breakpointsMatched[B-1])}ngOnDestroy(){this.onDestroy$.next(),this.onDestroy$.complete()}}return w.\u0275fac=function(O){return new(O||w)(m.LFG(f.Yg))},w.\u0275prov=m.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"}),w})()},6440:(Ue,J,s)=>{"use strict";s.d(J,{U:()=>h});var o=s(4537),r=s(1656);let h=(()=>{class m{constructor(d){this.settings=d}isSelfHostedFile(d){return d.startsWith(this.settings.Backend.selfHostedPrefix)&&d.length>this.settings.Backend.selfHostedPrefix.length}selfHostedToRelativeFilePath(d){if(!this.isSelfHostedFile(d))throw new Error("Cannot get self hosted filepath from filepath that isn't self hosted.");return d.substring(this.settings.Backend.selfHostedPrefix.length)}getFileLink(d){return d?this.isSelfHostedFile(d)?this.getSelfHostedFileLink(d):d:""}getSelfHostedFileLink(d){const w=this.selfHostedToRelativeFilePath(d);return this.settings.Backend.backendHttpsURL+this.settings.Backend.cdnRelativePath+"/"+w}}return m.\u0275fac=function(d){return new(d||m)(o.LFG(r.g))},m.\u0275prov=o.Yz7({token:m,factory:m.\u0275fac,providedIn:"root"}),m})()},5596:(Ue,J,s)=>{"use strict";s.d(J,{F:()=>d});var o=s(8692),r=s(8023),h=s(8655),m=s(8198),f=s(4537);let d=(()=>{class w extends((0,h.AF)(m.tA)){constructor(O){super(),this.document=O,this.onClick$=new r.x,this.clickEvent=g=>{this.onClick$.next(g)},this.document.addEventListener("click",this.clickEvent)}ngOnDestroy(){super.ngOnDestroy(),this.document.removeEventListener("click",this.clickEvent)}}return w.\u0275fac=function(O){return new(O||w)(f.LFG(o.K0))},w.\u0275prov=f.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"}),w})()},9883:(Ue,J,s)=>{"use strict";s.d(J,{f:()=>O});var o=s(8239),r=s(3556),h=s(3176),m=s(274),f=s(8023),d=s(7445),w=s(4537),N=s(7545);let O=(()=>{class g{constructor(_,b){this.securityService=_,this.backend=b,this.onDestroy$=new f.x}ngOnDestroy(){this.onDestroy$.next(),this.onDestroy$.complete()}getAddableUserRoles(){var _=this;return(0,o.Z)(function*(){const b=yield _.getUserRoles();let S=(0,h.BS)(b).filter(v=>h.Kh[v].type.includes(h.GD.User));return b.includes(r.LO.SuperAdmin)&&S.push(r.LO.SuperAdmin),S})()}getDisabledUserRoles(){var _=this;return(0,o.Z)(function*(){const b=yield _.getUserRoles();let S=(0,h.o1)(b);return b.includes(r.LO.SuperAdmin)&&(S=S.filter(v=>v!=r.LO.SuperAdmin)),S.includes(r.LO.User)||S.push(r.LO.User),S})()}getUserRoles(){var _=this;return(0,o.Z)(function*(){if(!_.securityService.securityContext?.userId)return[];const b=yield(0,d.z)(_.backend.withAuth().query({query:m.Ps` + `,fetchPolicy:"no-cache",context:{headers:{Authorization:"Bearer "+V.getToken(),"Operation-Metadata":JSON.stringify({securityDomains:[{userId:j}]})}}}));X.error||V.setPayload({accessToken:V.getToken(),user:X.data.users[0]})})()}ngOnDestroy(){this.onDestroy$.next(),this.onDestroy$.complete()}logout(){this.setPayload(void 0),window.location.reload()}setPayload(V){localStorage.removeItem(ve),V&&localStorage.setItem(ve,JSON.stringify(V)),this.payloadSubject.next(V)}getPayload(){const V=localStorage.getItem(ve);return V?JSON.parse(V):null}getToken(){return this.getPayload()?.accessToken??""}socialLogin(V){let j=this.oAuthLink+V;const X=new N.y(Ie=>{window.open(j,"myWindow","location=1,status=1,scrollbars=1,width=800,height=900"),window.addEventListener("message",lt=>{if(lt.origin===this.settings.Backend.httpsPrefix+this.settings.Backend.backendDomain){if(null==lt.data)return console.log("on cancelled"),Ie.next(void 0),void Ie.complete();lt.data.accessToken&<.data.user&&(console.log("on succeeded"),Ie.next(lt.data),Ie.complete())}})});return X.pipe((0,O.R)(this.onDestroy$)).subscribe({next:Ie=>{this.setPayload(Ie)}}),X}login(V,j){const X=this.http.post(this.authLink+"signin",{username:V,password:j},ye);return X.pipe((0,O.R)(this.onDestroy$)).subscribe({next:Ie=>{this.setPayload(Ie)}}),X}signup(V,j,X){const Ie=this.http.post(this.authLink+"signup",{username:V,email:j,password:X},ye);return Ie.pipe((0,O.R)(this.onDestroy$)).subscribe({next:ke=>{this.setPayload(ke)}}),Ie}}return z.\u0275fac=function(V){return new(V||z)(g.LFG(m._M),g.LFG(B.F0),g.LFG(r.eN),g.LFG(T),g.LFG(Se.g))},z.\u0275prov=g.Yz7({token:z,factory:z.\u0275fac,providedIn:"root"}),z})()},831:(Ue,J,s)=>{"use strict";s.d(J,{v:()=>Ke});var o=s(8239),r=s(8862),h=s(1132),m=s(4762),f=s(4854),d=s(56);function w(me){return new d.i(function(P,se){return new f.y(function(Ce){var He,Qe,st;try{He=se(P).subscribe({next:function(Ge){Ge.errors&&(st=me({graphQLErrors:Ge.errors,response:Ge,operation:P,forward:se}))?Qe=st.subscribe({next:Ce.next.bind(Ce),error:Ce.error.bind(Ce),complete:Ce.complete.bind(Ce)}):Ce.next(Ge)},error:function(Ge){(st=me({operation:P,networkError:Ge,graphQLErrors:Ge&&Ge.result&&Ge.result.errors,forward:se}))?Qe=st.subscribe({next:Ce.next.bind(Ce),error:Ce.error.bind(Ce),complete:Ce.complete.bind(Ce)}):Ce.error(Ge)},complete:function(){st||Ce.complete.bind(Ce)()}})}catch(Ge){me({networkError:Ge,operation:P,forward:se}),Ce.error(Ge)}return function(){He&&He.unsubscribe(),Qe&&He.unsubscribe()}})})}!function(me){function P(se){var Ce=me.call(this)||this;return Ce.link=w(se),Ce}(0,m.ZT)(P,me),P.prototype.request=function(se,Ce){return this.link.request(se,Ce)}}(d.i);var O=s(4145),g=s(9231),B=s(709),b=function(me){function P(se){var Ce=me.call(this)||this;return Ce.client=se,Ce}return(0,m.ZT)(P,me),P.prototype.request=function(se){var Ce=this;return new f.y(function(He){return Ce.client.subscribe((0,m.pi)((0,m.pi)({},se),{query:(0,O.S)(se.query)}),{next:He.next.bind(He),complete:He.complete.bind(He),error:function(Qe){return Qe instanceof Error?He.error(Qe):function _(me){return(0,g.s)(me)&&"code"in me&&"reason"in me}(Qe)?He.error(new Error("Socket closed with event ".concat(Qe.code," ").concat(Qe.reason||""))):He.error(new B.c({graphQLErrors:Array.isArray(Qe)?Qe:[Qe]}))}})})},P}(d.i),S=s(1144),v=s(1141),H=s.n(v);function x(me){return null===me?"null":Array.isArray(me)?"array":typeof me}function te(me){return"object"===x(me)}function Z(me,P){return me.length<124?me:P}const Me="graphql-transport-ws";var ve=(()=>{return(me=ve||(ve={}))[me.InternalServerError=4500]="InternalServerError",me[me.InternalClientError=4005]="InternalClientError",me[me.BadRequest=4400]="BadRequest",me[me.BadResponse=4004]="BadResponse",me[me.Unauthorized=4401]="Unauthorized",me[me.Forbidden=4403]="Forbidden",me[me.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",me[me.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",me[me.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",me[me.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",me[me.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests",ve;var me})(),ye=(()=>{return(me=ye||(ye={})).ConnectionInit="connection_init",me.ConnectionAck="connection_ack",me.Ping="ping",me.Pong="pong",me.Subscribe="subscribe",me.Next="next",me.Error="error",me.Complete="complete",ye;var me})();function De(me){if(!te(me))throw new Error(`Message is expected to be an object, but got ${x(me)}`);if(!me.type)throw new Error("Message is missing the 'type' property");if("string"!=typeof me.type)throw new Error(`Message is expects the 'type' property to be a string, but got ${x(me.type)}`);switch(me.type){case ye.ConnectionInit:case ye.ConnectionAck:case ye.Ping:case ye.Pong:if("payload"in me&&!te(me.payload))throw new Error(`"${me.type}" message expects the 'payload' property to be an object or missing, but got "${me.payload}"`);break;case ye.Subscribe:if("string"!=typeof me.id)throw new Error(`"${me.type}" message expects the 'id' property to be a string, but got ${x(me.id)}`);if(!me.id)throw new Error(`"${me.type}" message requires a non-empty 'id' property`);if(!te(me.payload))throw new Error(`"${me.type}" message expects the 'payload' property to be an object, but got ${x(me.payload)}`);if("string"!=typeof me.payload.query)throw new Error(`"${me.type}" message payload expects the 'query' property to be a string, but got ${x(me.payload.query)}`);if(null!=me.payload.variables&&!te(me.payload.variables))throw new Error(`"${me.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${x(me.payload.variables)}`);if(null!=me.payload.operationName&&"string"!==x(me.payload.operationName))throw new Error(`"${me.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${x(me.payload.operationName)}`);if(null!=me.payload.extensions&&!te(me.payload.extensions))throw new Error(`"${me.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${x(me.payload.extensions)}`);break;case ye.Next:if("string"!=typeof me.id)throw new Error(`"${me.type}" message expects the 'id' property to be a string, but got ${x(me.id)}`);if(!me.id)throw new Error(`"${me.type}" message requires a non-empty 'id' property`);if(!te(me.payload))throw new Error(`"${me.type}" message expects the 'payload' property to be an object, but got ${x(me.payload)}`);break;case ye.Error:if("string"!=typeof me.id)throw new Error(`"${me.type}" message expects the 'id' property to be a string, but got ${x(me.id)}`);if(!me.id)throw new Error(`"${me.type}" message requires a non-empty 'id' property`);if(!function ue(me){return Array.isArray(me)&&me.length>0&&me.every(P=>"message"in P)}(me.payload))throw new Error(`"${me.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(me.payload)}`);break;case ye.Complete:if("string"!=typeof me.id)throw new Error(`"${me.type}" message expects the 'id' property to be a string, but got ${x(me.id)}`);if(!me.id)throw new Error(`"${me.type}" message requires a non-empty 'id' property`);break;default:throw new Error(`Invalid message 'type' property "${me.type}"`)}return me}function Y(me,P){try{return De(me)}catch{if("string"!=typeof me)throw new Error("Only strings are parsable messages");return De(JSON.parse(me,P))}}function V(me,P){return De(me),JSON.stringify(me,P)}function X(me){return te(me)&&"code"in me&&"reason"in me}var tt=s(8023),lt=s(4537),$=s(274),Re=s(9942),re=s(5732),xe=s(1656);let Ke=(()=>{class me{constructor(se,Ce,He,Qe){this.apollo=se,this.authService=Ce,this.http=He,this.settings=Qe,this.onDestroy$=new tt.x,this.opSettings=this.defaultOpSettings(),this.rebuildClient()}ngOnDestroy(){this.onDestroy$.next(),this.onDestroy$.complete()}resetOpSettings(){this.opSettings=this.defaultOpSettings()}rebuildClient(){this.apollo.default().client&&(this.apollo.default().client.stop(),this.apollo.default().client.clearStore(),this.apollo.removeClient("default")),this.apollo.createDefault(this.configureApolloClientOptions(this.authService.getToken()))}defaultOpSettings(){return{useAuth:!1,operationDomains:void 0}}getHeaders(){return{Authorization:"Bearer "+this.authService.getToken(),...this.opSettings.operationDomains&&{"Operation-Metadata":JSON.stringify({securityDomains:this.opSettings.operationDomains})}}}configureApolloOperationOptions(se){return{...se,...this.opSettings.useAuth&&{context:{...se.context,headers:{...this.getHeaders(),...se.context?.headers}}}}}configureApolloClientOptions(se=""){const Ce=this.settings.Backend.backendDomainPlusBaseUrl+this.settings.Backend.graphQLRelativePath,He=this.settings.Backend.httpsPrefix,Qe=this.settings.Backend.wssPrefix,st=H()({uri:`${He}${Ce}`,headers:{"Apollo-Require-Preflight":"true"}});console.log(`graphql link: ${Qe}${Ce}`),this.graphQLWsClient&&this.graphQLWsClient.dispose(),this.graphQLWsClient=function j(me){const{url:P,connectionParams:se,lazy:Ce=!0,onNonLazyError:He=console.error,lazyCloseTimeout:Qe=0,keepAlive:st=0,disablePong:Ge,connectionAckWaitTimeout:at=0,retryAttempts:_t=5,retryWait:xt=function(){var le=(0,o.Z)(function*(ae){let he=1e3;for(let pe=0;pesetTimeout(pe,he+Math.floor(2700*Math.random()+300)))});return function _e(ae){return le.apply(this,arguments)}}(),shouldRetry:yt=X,isFatalConnectionProblem:Pt,on:At,webSocketImpl:nt,generateID:ft=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,_e=>{const ae=16*Math.random()|0;return("x"==_e?ae:3&ae|8).toString(16)})},jsonMessageReplacer:G,jsonMessageReviver:U}=me;let ie;if(nt){if(!function ke(me){return"function"==typeof me&&"constructor"in me&&"CLOSED"in me&&"CLOSING"in me&&"CONNECTING"in me&&"OPEN"in me}(nt))throw new Error("Invalid WebSocket implementation provided");ie=nt}else typeof WebSocket<"u"?ie=WebSocket:typeof global<"u"?ie=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(ie=window.WebSocket||window.MozWebSocket);if(!ie)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const oe=ie,Te=(()=>{const le=(()=>{const ae={};return{on:(he,pe)=>(ae[he]=pe,()=>{delete ae[he]}),emit(he){var pe;"id"in he&&(null===(pe=ae[he.id])||void 0===pe||pe.call(ae,he))}}})(),_e={connecting:At?.connecting?[At.connecting]:[],opened:At?.opened?[At.opened]:[],connected:At?.connected?[At.connected]:[],ping:At?.ping?[At.ping]:[],pong:At?.pong?[At.pong]:[],message:At?.message?[le.emit,At.message]:[le.emit],closed:At?.closed?[At.closed]:[],error:At?.error?[At.error]:[]};return{onMessage:le.on,on(ae,he){const pe=_e[ae];return pe.push(he),()=>{pe.splice(pe.indexOf(he),1)}},emit(ae,...he){for(const pe of[..._e[ae]])pe(...he)}}})();function Xe(le){const _e=[Te.on("error",ae=>{_e.forEach(he=>he()),le(ae)}),Te.on("closed",ae=>{_e.forEach(he=>he()),le(ae)})]}let Ze,we=0,Ve=!1,We=0,Ye=!1;function et(){return de.apply(this,arguments)}function de(){return(de=(0,o.Z)(function*(){const[le,_e]=yield Ze??(Ze=new Promise((pe,be)=>(0,o.Z)(function*(){if(Ve){if(yield xt(We),!we)return Ze=void 0,be({code:1e3,reason:"All Subscriptions Gone"});We++}Te.emit("connecting");const Oe=new oe("function"==typeof P?yield P():P,Me);let Ae,Je;function ct(){isFinite(st)&&st>0&&(clearTimeout(Je),Je=setTimeout(()=>{Oe.readyState===oe.OPEN&&(Oe.send(V({type:ye.Ping})),Te.emit("ping",!1,void 0))},st))}Xe(Mt=>{Ze=void 0,clearTimeout(Ae),clearTimeout(Je),be(Mt),X(Mt)&&4499===Mt.code&&(Oe.close(4499,"Terminated"),Oe.onerror=null,Oe.onclose=null)}),Oe.onerror=Mt=>Te.emit("error",Mt),Oe.onclose=Mt=>Te.emit("closed",Mt),Oe.onopen=(0,o.Z)(function*(){try{Te.emit("opened",Oe);const Mt="function"==typeof se?yield se():se;if(Oe.readyState!==oe.OPEN)return;Oe.send(V(Mt?{type:ye.ConnectionInit,payload:Mt}:{type:ye.ConnectionInit},G)),isFinite(at)&&at>0&&(Ae=setTimeout(()=>{Oe.close(ve.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},at)),ct()}catch(Mt){Te.emit("error",Mt),Oe.close(ve.InternalClientError,Z(Mt instanceof Error?Mt.message:new Error(Mt).message,"Internal client error"))}});let mt=!1;Oe.onmessage=({data:Mt})=>{try{const St=Y(Mt,U);if(Te.emit("message",St),"ping"===St.type||"pong"===St.type)return Te.emit(St.type,!0,St.payload),void("pong"===St.type?ct():Ge||(Oe.send(V(St.payload?{type:ye.Pong,payload:St.payload}:{type:ye.Pong})),Te.emit("pong",!1,St.payload)));if(mt)return;if(St.type!==ye.ConnectionAck)throw new Error(`First message cannot be of type ${St.type}`);clearTimeout(Ae),mt=!0,Te.emit("connected",Oe,St.payload),Ve=!1,We=0,pe([Oe,new Promise((Zt,$t)=>Xe($t))])}catch(St){Oe.onmessage=null,Te.emit("error",St),Oe.close(ve.BadResponse,Z(St instanceof Error?St.message:new Error(St).message,"Bad response"))}}})()));le.readyState===oe.CLOSING&&(yield _e);let ae=()=>{};const he=new Promise(pe=>ae=pe);return[le,ae,Promise.race([he.then(()=>{if(!we){const pe=()=>le.close(1e3,"Normal Closure");isFinite(Qe)&&Qe>0?setTimeout(()=>{!we&&le.readyState===oe.OPEN&&pe()},Qe):pe()}}),_e])]})).apply(this,arguments)}function K(le){if(X(le)&&(function Ie(me){return![1e3,1001,1006,1005,1012,1013,1013].includes(me)&&me>=1e3&&me<=1999}(le.code)||[ve.InternalServerError,ve.InternalClientError,ve.BadRequest,ve.BadResponse,ve.Unauthorized,ve.SubprotocolNotAcceptable,ve.SubscriberAlreadyExists,ve.TooManyInitialisationRequests].includes(le.code)))throw le;if(Ye)return!1;if(X(le)&&1e3===le.code)return we>0;if(!_t||We>=_t||!yt(le)||Pt?.(le))throw le;return Ve=!0}return Ce||(0,o.Z)(function*(){for(we++;;)try{const[,,le]=yield et();yield le}catch(le){try{if(!K(le))return}catch(_e){return He?.(_e)}}})(),{on:Te.on,subscribe(le,_e){const ae=ft();let he=!1,pe=!1,be=()=>{we--,he=!0};return(0,o.Z)(function*(){for(we++;;)try{const[Oe,Ae,Je]=yield et();if(he)return Ae();const ct=Te.onMessage(ae,mt=>{switch(mt.type){case ye.Next:return void _e.next(mt.payload);case ye.Error:return pe=!0,he=!0,_e.error(mt.payload),void be();case ye.Complete:return he=!0,void be()}});return Oe.send(V({id:ae,type:ye.Subscribe,payload:le},G)),be=()=>{!he&&Oe.readyState===oe.OPEN&&Oe.send(V({id:ae,type:ye.Complete},G)),we--,he=!0,Ae()},void(yield Je.finally(ct))}catch(Oe){if(!K(Oe))return}})().then(()=>{pe||_e.complete()}).catch(Oe=>{_e.error(Oe)}),()=>{he||be()}},dispose:()=>(0,o.Z)(function*(){if(Ye=!0,Ze){const[le]=yield Ze;le.close(1e3,"Normal Closure")}})(),terminate(){Ze&&Te.emit("closed",{code:4499,reason:"Terminated",wasClean:!1})}}}({url:`${Qe}${Ce}`,connectionParams:{authentication:`Bearer ${se}`}});const Ge=new b(this.graphQLWsClient),at=(0,r.V)(({query:xt})=>{const yt=(0,S.p$)(xt);return"OperationDefinition"===yt.kind&&"subscription"===yt.operation},Ge,st);return{link:w(({networkError:xt})=>{xt&&((xt?.result?.errors[0]?.message??"").includes("Token unauthorized")&&this.authService.logout(),console.log("NetworkError: ",xt))}).concat(at),cache:new h.h}}configureHttpOptions(se){return se||(se={}),{...se,...this.opSettings.useAuth&&{headers:{...this.getHeaders(),...se.headers}}}}configureUrl(se){return se.startsWith("/")?this.settings.Backend.backendHttpsURL+se:se}cacheEvict(se){var Ce=this;return(0,o.Z)(function*(){Ce.apollo.client.cache.evict({broadcast:!0,...se})})()}clearCache(){var se=this;return(0,o.Z)(function*(){yield se.apollo.client.clearStore()})()}withOpDomain(se){return se&&(this.opSettings.operationDomains=[se]),this}withOpDomains(se){return this.opSettings.operationDomains=se,this}withAuth(){return this.authService.authenticated&&(this.opSettings.useAuth=!0),this}watchQuery(se){const Ce=this.apollo.default().watchQuery(this.configureApolloOperationOptions(se));return this.resetOpSettings(),Ce}query(se){let Ce=this.apollo.default().query(this.configureApolloOperationOptions(se));return this.resetOpSettings(),Ce}mutate(se){let Ce=this.apollo.default().mutate(this.configureApolloOperationOptions(se));return this.resetOpSettings(),Ce}subscribe(se,Ce){let He=this.apollo.default().subscribe(this.configureApolloOperationOptions(se),Ce);return this.resetOpSettings(),He}get(se,Ce,He){return this.http.get(this.configureUrl(se),this.configureHttpOptions(He))}head(se,Ce,He){return this.http.head(this.configureUrl(se),this.configureHttpOptions(He))}post(se,Ce,He){return this.http.post(this.configureUrl(se),Ce,this.configureHttpOptions(He))}put(se,Ce,He){return this.http.put(this.configureUrl(se),Ce,this.configureHttpOptions(He))}delete(se,Ce){return this.http.delete(this.configureUrl(se),this.configureHttpOptions(Ce))}patch(se,Ce,He){return this.http.patch(this.configureUrl(se),Ce,this.configureHttpOptions(He))}request(se,Ce,He){return this.http.request(se,Ce,this.configureHttpOptions(He))}}return me.\u0275fac=function(se){return new(se||me)(lt.LFG($._M),lt.LFG(Re.e),lt.LFG(re.eN),lt.LFG(xe.g))},me.\u0275prov=lt.Yz7({token:me,factory:me.\u0275fac,providedIn:"root"}),me})()},6527:(Ue,J,s)=>{"use strict";s.d(J,{I:()=>d});var o=s(1769),r=s(8023),h=s(3528),m=s(4537),f=s(1444);let d=(()=>{class w{constructor(O){this.breakpointObserver=O,this.breakpointsMatched=[],this.onDestroy$=new r.x;for(let g=0;g{this.breakpointsMatched[g]=B.matches});this.breakpointsMatched.push(!0)}get currentBreakpoint(){for(let O=0;OB.name===O);return this.breakpointsMatched[g]}matchedBreakpointRange(O,g){if(o.bt.findIndex(b=>b.name===O)>o.bt.findIndex(b=>b.name===g)){let b=O;O=g,g=b}return this.matchedBreakpointOrAbove(O)&&this.matchedBreakpointOrBelow(g)}matchedBreakpointOrAbove(O,g=""){const B=o.bt.findIndex(_=>_.name===O);return!(B>0&&this.breakpointsMatched[B-1])}ngOnDestroy(){this.onDestroy$.next(),this.onDestroy$.complete()}}return w.\u0275fac=function(O){return new(O||w)(m.LFG(f.Yg))},w.\u0275prov=m.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"}),w})()},6440:(Ue,J,s)=>{"use strict";s.d(J,{U:()=>h});var o=s(4537),r=s(1656);let h=(()=>{class m{constructor(d){this.settings=d}isSelfHostedFile(d){return d.startsWith(this.settings.Backend.selfHostedPrefix)&&d.length>this.settings.Backend.selfHostedPrefix.length}selfHostedToRelativeFilePath(d){if(!this.isSelfHostedFile(d))throw new Error("Cannot get self hosted filepath from filepath that isn't self hosted.");return d.substring(this.settings.Backend.selfHostedPrefix.length)}getFileLink(d){return d?this.isSelfHostedFile(d)?this.getSelfHostedFileLink(d):d:""}getSelfHostedFileLink(d){const w=this.selfHostedToRelativeFilePath(d);return this.settings.Backend.backendHttpsURL+this.settings.Backend.cdnRelativePath+"/"+w}}return m.\u0275fac=function(d){return new(d||m)(o.LFG(r.g))},m.\u0275prov=o.Yz7({token:m,factory:m.\u0275fac,providedIn:"root"}),m})()},5596:(Ue,J,s)=>{"use strict";s.d(J,{F:()=>d});var o=s(8692),r=s(8023),h=s(8655),m=s(8198),f=s(4537);let d=(()=>{class w extends((0,h.AF)(m.tA)){constructor(O){super(),this.document=O,this.onClick$=new r.x,this.clickEvent=g=>{this.onClick$.next(g)},this.document.addEventListener("click",this.clickEvent)}ngOnDestroy(){super.ngOnDestroy(),this.document.removeEventListener("click",this.clickEvent)}}return w.\u0275fac=function(O){return new(O||w)(f.LFG(o.K0))},w.\u0275prov=f.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"}),w})()},9883:(Ue,J,s)=>{"use strict";s.d(J,{f:()=>O});var o=s(8239),r=s(3556),h=s(3176),m=s(274),f=s(8023),d=s(7445),w=s(4537),N=s(7545);let O=(()=>{class g{constructor(_,b){this.securityService=_,this.backend=b,this.onDestroy$=new f.x}ngOnDestroy(){this.onDestroy$.next(),this.onDestroy$.complete()}getAddableUserRoles(){var _=this;return(0,o.Z)(function*(){const b=yield _.getUserRoles();let S=(0,h.BS)(b).filter(v=>h.Kh[v].type.includes(h.GD.User));return b.includes(r.LO.SuperAdmin)&&S.push(r.LO.SuperAdmin),S})()}getDisabledUserRoles(){var _=this;return(0,o.Z)(function*(){const b=yield _.getUserRoles();let S=(0,h.o1)(b);return b.includes(r.LO.SuperAdmin)&&(S=S.filter(v=>v!=r.LO.SuperAdmin)),S.includes(r.LO.User)||S.push(r.LO.User),S})()}getUserRoles(){var _=this;return(0,o.Z)(function*(){if(!_.securityService.securityContext?.userId)return[];const b=yield(0,d.z)(_.backend.withAuth().query({query:m.Ps` query GetUserRoles($filter: UserFilterInput!) { users(filter: $filter) { roles {